diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000000000000000000000000000000000..927788db531ca30cd781da02a8edb3133ce27471
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,23 @@
+# Linux users : please configure your git with `git config --global core.autocrlf input` 
+
+# Do not change the line endings by default
+* -text
+
+# Explicitly declare text files we want to always be normalized and converted
+# to native line endings on checkout.
+*.c text
+*.csv text
+*.h text
+*.htm* text
+*.md text
+*.mo text
+*.mos text
+*.order text
+*.py text
+*.txt text
+*.yml text
+.gitattributes text
+.gitignore text
+.mailmap text
+LICENSE text
+
diff --git a/.gitignore b/.gitignore
index a0a7e59b34d6b4cb9f0a721284772c7fd5315cc8..3f0d86710e85b2f88c9ff4589c7f142117ddff0c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,8 +8,12 @@ dsfinal.txt
 dsin.txt
 dslog.txt
 dsmodel.c
-dsres.mat
+*.mat
 dymosim
 dymosim.exe
-request.
-status.
+request*
+status*
+*.mof
+*.c
+buildlog.txt
+
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..37caa304c197aae73d9c4a3d3f37202b69afc2e5
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,29 @@
+# This is the GitLab CI/CD configuration file to test ThermoSysPro on an internal VM (PAM).
+# This script works once it is mirrored on the internal (pleiade) gitlab, so that it can
+# exchange with the internal VM. 
+# 
+# The objectives of this pipeline are:
+# - Test ThermoSysPro examples on Dymola (done)
+# - Test extra models (additional gitlab project)
+# - Test ThermoSysPro on other tools (OpenModelica)
+# - Evaluate changes on some realistic studies (calibration, optimisation, 
+# uncertainties propagations...)
+# - Publish ThermoSysPro on GitHub:
+#   - Remove confidential modules (based on a "database" file)
+#   - Publish the public version on GitHub
+#
+# A pipeline is composed of independent jobs that run scripts, grouped into stages.
+# Stages run in sequential order, but jobs within stages run in parallel.
+# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
+#
+
+stages:          # List of stages for jobs, and their order of execution
+  - build
+#  - test
+#  - deploy
+
+build-job:       # This job runs in the build stage, which runs first.
+  stage: build
+  script:
+    - python --version
+    - echo "Still have to fetch test script and potentially others projets (e.g. additional examples)"
\ No newline at end of file
diff --git a/ThermoSysPro/Combustion/BoundaryConditions/FuelSourcePQ.mo b/ThermoSysPro/Combustion/BoundaryConditions/FuelSourcePQ.mo
index 44904070dbe8edb7ff840280ffe749908c40d08d..7aa48db1650a4458aa2171e4b96b1b75886bdd59 100644
--- a/ThermoSysPro/Combustion/BoundaryConditions/FuelSourcePQ.mo
+++ b/ThermoSysPro/Combustion/BoundaryConditions/FuelSourcePQ.mo
@@ -1,112 +1,112 @@
-within ThermoSysPro.Combustion.BoundaryConditions;
-model FuelSourcePQ "Fuel source with fixed pressure and mass flow rate"
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Fuel pressure (active if pressure input port is not connected)";
-  parameter Units.SI.MassFlowRate Q0=10
-    "Fuel mass flow rate (active if mass flow input port is not connected)";
-  parameter Units.SI.Temperature T0=300 "Fuel temperature";
-  parameter Units.SI.SpecificEnergy LHV=48e6 "Lower heating value";
-  parameter Units.SI.SpecificHeatCapacity Cp=1e3
-    "Fuel specific heat capacity at 273.15K";
-  parameter Real Hum=0.0 "Fuel humidity (%)";
-  parameter Real Xc=0.75 "C mass fraction";
-  parameter Real Xh=0.25 "H mass fraction";
-  parameter Real Xo=0 "O mass fraction";
-  parameter Real Xn=0 "N mass fraction";
-  parameter Real Xs=0 "S mass fraction";
-  parameter Real Xashes=0 "Ashes mass fraction";
-  parameter Real Vol=0 "Volatile matter mass fraction";
-  parameter Units.SI.Density rho=0.72 "Fuel density";
-
-  Connectors.FuelOutlet C                   annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-equation
-
- /* Fuel composition */
- C.hum = Hum;
- C.Xc = Xc;
- C.Xh = Xh;
- C.Xo = Xo;
- C.Xn = Xn;
- C.Xs = Xs;
- C.Xashes = Xashes;
- C.VolM = Vol;
-
- /* Mass flow rate */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  C.Q = IMassFlow.signal;
-
- /* Temperature */
-  C.T = T0;
-
- /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  C.P = IPressure.signal;
-
- /* LHV */
-  C.LHV = LHV;
-
- /* Specific heat capacity */
-  C.cp = Cp;
-
- /* Density */
-  C.rho = rho;
-
-  annotation (Diagram(graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.CrossDiag),
-        Text(extent={{-30,60},{-12,40}}, textString=
-                                             "Q"),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),Icon(graphics={
-        Text(
-          extent={{-38,60},{-4,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.CrossDiag),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</h4></p>
-<p><b>ThermoSysPro Version 3.0</h4>
-</html>"));
-end FuelSourcePQ;
+within ThermoSysPro.Combustion.BoundaryConditions;
+model FuelSourcePQ "Fuel source with fixed pressure and mass flow rate"
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Fuel pressure (active if pressure input port is not connected)";
+  parameter Units.SI.MassFlowRate Q0=10
+    "Fuel mass flow rate (active if mass flow input port is not connected)";
+  parameter Units.SI.Temperature T0=300 "Fuel temperature";
+  parameter Units.SI.SpecificEnergy LHV=48e6 "Lower heating value";
+  parameter Units.SI.SpecificHeatCapacity Cp=1e3
+    "Fuel specific heat capacity at 273.15K";
+  parameter Real Hum=0.0 "Fuel humidity (%)";
+  parameter Real Xc=0.75 "C mass fraction";
+  parameter Real Xh=0.25 "H mass fraction";
+  parameter Real Xo=0 "O mass fraction";
+  parameter Real Xn=0 "N mass fraction";
+  parameter Real Xs=0 "S mass fraction";
+  parameter Real Xashes=0 "Ashes mass fraction";
+  parameter Real Vol=0 "Volatile matter mass fraction";
+  parameter Units.SI.Density rho=0.72 "Fuel density";
+
+  Connectors.FuelOutlet C                   annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+equation
+
+ /* Fuel composition */
+ C.hum = Hum;
+ C.Xc = Xc;
+ C.Xh = Xh;
+ C.Xo = Xo;
+ C.Xn = Xn;
+ C.Xs = Xs;
+ C.Xashes = Xashes;
+ C.VolM = Vol;
+
+ /* Mass flow rate */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  C.Q = IMassFlow.signal;
+
+ /* Temperature */
+  C.T = T0;
+
+ /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  C.P = IPressure.signal;
+
+ /* LHV */
+  C.LHV = LHV;
+
+ /* Specific heat capacity */
+  C.cp = Cp;
+
+ /* Density */
+  C.rho = rho;
+
+  annotation (Diagram(graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.CrossDiag),
+        Text(extent={{-30,60},{-12,40}}, textString=
+                                             "Q"),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),Icon(graphics={
+        Text(
+          extent={{-38,60},{-4,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.CrossDiag),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</h4></p>
+<p><b>ThermoSysPro Version 3.0</h4>
+</html>"));
+end FuelSourcePQ;
diff --git a/ThermoSysPro/Combustion/BoundaryConditions/package.mo b/ThermoSysPro/Combustion/BoundaryConditions/package.mo
index 3543b4e7147e8b147683fe63d057ca73be035fa8..98a061308606bf1b9c87757bd435ac4204553f32 100644
--- a/ThermoSysPro/Combustion/BoundaryConditions/package.mo
+++ b/ThermoSysPro/Combustion/BoundaryConditions/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.Combustion;
-package BoundaryConditions "Boundary conditions"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end BoundaryConditions;
+within ThermoSysPro.Combustion;
+package BoundaryConditions "Boundary conditions"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end BoundaryConditions;
diff --git a/ThermoSysPro/Combustion/CombustionChambers/GTCombustionChamber.mo b/ThermoSysPro/Combustion/CombustionChambers/GTCombustionChamber.mo
index 2c6d7f1c925aacb5b37e08b7756462ea685d26a0..b452923d355a241effdcfc80508ddffe87614e66 100644
--- a/ThermoSysPro/Combustion/CombustionChambers/GTCombustionChamber.mo
+++ b/ThermoSysPro/Combustion/CombustionChambers/GTCombustionChamber.mo
@@ -1,277 +1,277 @@
-within ThermoSysPro.Combustion.CombustionChambers;
-model GTCombustionChamber "Gas turbine combustion chamber"
-  parameter Real kcham=1 "Pressure loss coefficient in the combustion chamber";
-  parameter Units.SI.Area Acham=1
-    "Average corss-sectional area of the combusiton chamber";
-  parameter Real eta_comb=1 "Combustion efficiency";
-  parameter Units.SI.Power Wpth=1e6
-    "Thermal loss fraction in the body of the combustion chamber";
-  parameter Boolean air_atomisation=false
-    "true: computation with air atomisation - false: computation without air atomisation";
-  parameter Units.SI.Temperature Tecpat=293
-    "Temperature at the inlet of the atomisation compressor";
-  parameter Real kat=0 "Atomisation pressure loss coefficient";
-  parameter Real XQat=0 "Atomisation air mass flow rate coefficient";
-  parameter Real Xspat=0 "Atomisation over-pressure coefficient";
-  parameter Real eta_is=1 "Atomisation compressor isentropic efficiency";
-
-protected
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Real eps_a=1e-6 "Zero criterion for a-dimensional numbers";
-  constant Real eps_s=1e-6 "Zero criterion for surface numbers";
-  Real amCO2 "CO2 molecular mass";
-  Real amH2O "H2O molecular mass";
-  Real amSO2 "SO2 molecular mass";
-  Real eta_isc(start=1)
-    "Intermediate variable for the computation of the isentropic efficiency of the atomisaiton compressor";
-  Units.SI.Area Achamc(start=1)
-    "Intermediate variable for the computation of the average corss-section aera of the combusion chamber";
-  Real XeaO2c(start=0.2)
-    "Intermediate variable for the computation of the O2 mass fraction";
-
-public
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
-  Units.SI.SpecificEnthalpy Hea(start=50e3)
-    "Air specific enthalpy at the inlet";
-  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
-  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
-  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
-  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
-  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
-  Real XCfuel(start=0.8) "C mass fraction in the fuel";
-  Real XHfuel(start=0.2) "H mass fraction in the fuel";
-  Real XOfuel(start=0) "O mass fraction in the fuel";
-  Real XSfuel(start=0) "S mass fraction in the fuel";
-  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value";
-  Units.SI.SpecificHeatCapacity Cpfuel(start=1000)
-    "Fuel specific heat capacity";
-  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
-  Units.SI.SpecificEnthalpy Hews(start=10e3)
-    "Water/steam specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
-  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4)
-    "Flue gases specific enthalpy at the outlet";
-  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
-  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
-  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
-  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
-  Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel";
-  Real exc(start=1) "Combustion air ratio";
-  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3)
-    "Pressure loss in the combusiton chamber";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrws(start=10e4)
-    "Water/steam reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfuel(start=10e3)
-    "Fuel reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfg(start=10e3)
-    "Flue gases reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hecpat(start=10e3)
-    "Air specific enthalpy at the inlet of the atomisaiton compressor";
-  Units.SI.SpecificEnthalpy Hiscpat(start=10e3)
-    "Air specific enthalpy after isentropic expansion at the outlet of the atomisaiotn compressor";
-  Units.SI.AbsolutePressure Pecpat(start=1e5)
-    "Pressure at the inlet of the atomisation compressor";
-  Units.SI.AbsolutePressure Pscpat(start=1e5)
-    "Pressure at the outlet of the atomisation compressor";
-  Units.SI.SpecificEntropy Secpat(start=1e3)
-    "Entropy at the inlet of the atomisation compressor";
-  Units.SI.MassFlowRate Qm(start=400)
-    "Average mass flow rate in the combustion chamber";
-  Real Vea(start=0.001) "Air volume mass (m3/kg)";
-  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
-  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
-  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
-  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
-  Units.SI.Velocity v(start=100)
-    "Flue gases reference velocity in the combusiton chamber";
-  Units.SI.Power Wcpat(start=1e3) "Power of the atomisation compressor";
-  Units.SI.Power Wrfat(start=1e3)
-    "Thermal power extracted by the atomisaiton refrigerant";
-public
-  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca "Air inlet"
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg "Flue gases outlet"
-    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws "Water/steam inlet"
-    annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation=
-            0)));
-equation
-  /* Air inlet */
-  Qea = Ca.Q;
-  Pea = Ca.P;
-  Tea = Ca.T;
-  XeaCO2 = Ca.Xco2;
-  XeaH2O = Ca.Xh2o;
-  XeaO2 = Ca.Xo2;
-  XeaSO2 = Ca.Xso2;
-
-  /* Fuel inlet */
-  Qfuel = Cfuel.Q;
-  Tfuel = Cfuel.T;
-  XCfuel = Cfuel.Xc;
-  XHfuel = Cfuel.Xh;
-  XOfuel = Cfuel.Xo;
-  XSfuel = Cfuel.Xs;
-  LHVfuel = Cfuel.LHV;
-  Cpfuel = Cfuel.cp;
-
-  /* Water inlet */
-  Qews = Cws.Q;
-  Hews = Cws.h;
-  Cws.h = Cws.h_vol;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Tsf = Cfg.T;
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Specific enthalpy and entropy at the inlet of the atomisaiton compressor */
-  if air_atomisation then
-     Hecpat  = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-     Secpat  = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-     Hiscpat = ThermoSysPro.Properties.FlueGases.FlueGases_h_Ps(Pscpat, Secpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-  else
-     Hecpat =  60000;
-     Secpat = -2000;
-     Hiscpat = 60000;
-  end if;
-
-  /* Air specific enthalpy at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-
-  /* Flue gases specific enthalpy at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Air density at the inlet */
-  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-  Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1;
-
-  /* Flue gases density at the outlet */
-  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-  Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1;
-
-  0 = if (eta_is > eps_a) then (eta_isc - eta_is) else (eta_isc - eps_a);
-  0 = if (Acham > eps_s) then (Achamc - Acham) else (Achamc - eps_s);
-  0 = if (XeaO2 > eps_a) then (XeaO2c - XeaO2) else (XeaO2c - eps_a);
-
-  amCO2 = amC + 2*amO;
-  amH2O = 2*amH + amO;
-  amSO2 = amS + 2*amO;
-
-  /* Mass balance equation */
-  Qsf = Qea + Qews + Qfuel;
-
-  /* CO2 flue gases mass fraction */
-  XsfCO2*(Qea + Qews + Qfuel) = (Qea*XeaCO2) + (Qfuel*XCfuel*amCO2/amC);
-
-  /* H2O flue gases mass fraction */
-  XsfH2O*(Qea + Qews + Qfuel) = (Qews) + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2/amH);
-
-  /* O2 flue gases mass fraction */
-  XsfO2*(Qea + Qews + Qfuel) = (Qea*XeaO2c) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
-
-  /* SO2 flue gases mass fraction */
-  XsfSO2*(Qea + Qews + Qfuel) = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
-
-  /* Fuel thermal power */
-  Wfuel = Qfuel*LHVfuel;
-
-  /* Combusiton air ratio */
-  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O)));
-
-  /* Pressure losses */
-  Pea - Psf = deltaPccb;
-  Qm = Qea + (Qfuel + Qews)/2;
-  Vccbm = (Vea + Vsf)/2;
-  v = Qm*Vccbm/Achamc;
-  deltaPccb = (kcham*(v^2))/(2*Vccbm);
-
-  /* Fuel specific enthalpy at the inlet */
-  Hfuel = Cpfuel*(Tfuel - 273.16);
-
-  if air_atomisation then
-     /* Energy balance equation */
-     ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wrfat + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws) + Wcpat) = 0;
-
-     /* Atomisation power */
-     Pecpat = Pea*(1 - kat);
-     Pscpat = (1 + Xspat)*Pea;
-     Wcpat = Qea*XQat*(Hiscpat - Hecpat)*eta_isc;
-
-     /* Heat extracted by the atomisaiotn refrigerant */
-     Wrfat = Qea*XQat*(Hea - Hecpat);
-  else
-     /* Energy balance equation */
-     ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) = 0;
-
-     /* Atomisation power */
-     Pecpat = Pea;
-     Pscpat = Pea;
-     Wcpat = 0;
-
-     /* Heat extracted by the atomisaiotn refrigerant */
-     Wrfat = 0;
-  end if;
-
-  /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrfuel = 0;
-  Hrws = 2501.569e3;
-  Hrfg = 2501.569e3*XsfH2O;
-
-    annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
-        Polygon(
-          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
-              -44},{-20,-60},{-20,62}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.CrossDiag)}),
-                             Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
-        Polygon(
-          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
-              -44},{-20,-60},{-20,62}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.CrossDiag)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 8.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>"));
-end GTCombustionChamber;
+within ThermoSysPro.Combustion.CombustionChambers;
+model GTCombustionChamber "Gas turbine combustion chamber"
+  parameter Real kcham=1 "Pressure loss coefficient in the combustion chamber";
+  parameter Units.SI.Area Acham=1
+    "Average corss-sectional area of the combusiton chamber";
+  parameter Real eta_comb=1 "Combustion efficiency";
+  parameter Units.SI.Power Wpth=1e6
+    "Thermal loss fraction in the body of the combustion chamber";
+  parameter Boolean air_atomisation=false
+    "true: computation with air atomisation - false: computation without air atomisation";
+  parameter Units.SI.Temperature Tecpat=293
+    "Temperature at the inlet of the atomisation compressor";
+  parameter Real kat=0 "Atomisation pressure loss coefficient";
+  parameter Real XQat=0 "Atomisation air mass flow rate coefficient";
+  parameter Real Xspat=0 "Atomisation over-pressure coefficient";
+  parameter Real eta_is=1 "Atomisation compressor isentropic efficiency";
+
+protected
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Real eps_a=1e-6 "Zero criterion for a-dimensional numbers";
+  constant Real eps_s=1e-6 "Zero criterion for surface numbers";
+  Real amCO2 "CO2 molecular mass";
+  Real amH2O "H2O molecular mass";
+  Real amSO2 "SO2 molecular mass";
+  Real eta_isc(start=1)
+    "Intermediate variable for the computation of the isentropic efficiency of the atomisaiton compressor";
+  Units.SI.Area Achamc(start=1)
+    "Intermediate variable for the computation of the average corss-section aera of the combusion chamber";
+  Real XeaO2c(start=0.2)
+    "Intermediate variable for the computation of the O2 mass fraction";
+
+public
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
+  Units.SI.SpecificEnthalpy Hea(start=50e3)
+    "Air specific enthalpy at the inlet";
+  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
+  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
+  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
+  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
+  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
+  Real XCfuel(start=0.8) "C mass fraction in the fuel";
+  Real XHfuel(start=0.2) "H mass fraction in the fuel";
+  Real XOfuel(start=0) "O mass fraction in the fuel";
+  Real XSfuel(start=0) "S mass fraction in the fuel";
+  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value";
+  Units.SI.SpecificHeatCapacity Cpfuel(start=1000)
+    "Fuel specific heat capacity";
+  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
+  Units.SI.SpecificEnthalpy Hews(start=10e3)
+    "Water/steam specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
+  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4)
+    "Flue gases specific enthalpy at the outlet";
+  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
+  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
+  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
+  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
+  Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel";
+  Real exc(start=1) "Combustion air ratio";
+  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3)
+    "Pressure loss in the combusiton chamber";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrws(start=10e4)
+    "Water/steam reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfuel(start=10e3)
+    "Fuel reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfg(start=10e3)
+    "Flue gases reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hecpat(start=10e3)
+    "Air specific enthalpy at the inlet of the atomisaiton compressor";
+  Units.SI.SpecificEnthalpy Hiscpat(start=10e3)
+    "Air specific enthalpy after isentropic expansion at the outlet of the atomisaiotn compressor";
+  Units.SI.AbsolutePressure Pecpat(start=1e5)
+    "Pressure at the inlet of the atomisation compressor";
+  Units.SI.AbsolutePressure Pscpat(start=1e5)
+    "Pressure at the outlet of the atomisation compressor";
+  Units.SI.SpecificEntropy Secpat(start=1e3)
+    "Entropy at the inlet of the atomisation compressor";
+  Units.SI.MassFlowRate Qm(start=400)
+    "Average mass flow rate in the combustion chamber";
+  Real Vea(start=0.001) "Air volume mass (m3/kg)";
+  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
+  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
+  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
+  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
+  Units.SI.Velocity v(start=100)
+    "Flue gases reference velocity in the combusiton chamber";
+  Units.SI.Power Wcpat(start=1e3) "Power of the atomisation compressor";
+  Units.SI.Power Wrfat(start=1e3)
+    "Thermal power extracted by the atomisaiton refrigerant";
+public
+  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca "Air inlet"
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg "Flue gases outlet"
+    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws "Water/steam inlet"
+    annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation=
+            0)));
+equation
+  /* Air inlet */
+  Qea = Ca.Q;
+  Pea = Ca.P;
+  Tea = Ca.T;
+  XeaCO2 = Ca.Xco2;
+  XeaH2O = Ca.Xh2o;
+  XeaO2 = Ca.Xo2;
+  XeaSO2 = Ca.Xso2;
+
+  /* Fuel inlet */
+  Qfuel = Cfuel.Q;
+  Tfuel = Cfuel.T;
+  XCfuel = Cfuel.Xc;
+  XHfuel = Cfuel.Xh;
+  XOfuel = Cfuel.Xo;
+  XSfuel = Cfuel.Xs;
+  LHVfuel = Cfuel.LHV;
+  Cpfuel = Cfuel.cp;
+
+  /* Water inlet */
+  Qews = Cws.Q;
+  Hews = Cws.h;
+  Cws.h = Cws.h_vol;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Tsf = Cfg.T;
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Specific enthalpy and entropy at the inlet of the atomisaiton compressor */
+  if air_atomisation then
+     Hecpat  = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+     Secpat  = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+     Hiscpat = ThermoSysPro.Properties.FlueGases.FlueGases_h_Ps(Pscpat, Secpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+  else
+     Hecpat =  60000;
+     Secpat = -2000;
+     Hiscpat = 60000;
+  end if;
+
+  /* Air specific enthalpy at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+
+  /* Flue gases specific enthalpy at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Air density at the inlet */
+  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+  Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1;
+
+  /* Flue gases density at the outlet */
+  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+  Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1;
+
+  0 = if (eta_is > eps_a) then (eta_isc - eta_is) else (eta_isc - eps_a);
+  0 = if (Acham > eps_s) then (Achamc - Acham) else (Achamc - eps_s);
+  0 = if (XeaO2 > eps_a) then (XeaO2c - XeaO2) else (XeaO2c - eps_a);
+
+  amCO2 = amC + 2*amO;
+  amH2O = 2*amH + amO;
+  amSO2 = amS + 2*amO;
+
+  /* Mass balance equation */
+  Qsf = Qea + Qews + Qfuel;
+
+  /* CO2 flue gases mass fraction */
+  XsfCO2*(Qea + Qews + Qfuel) = (Qea*XeaCO2) + (Qfuel*XCfuel*amCO2/amC);
+
+  /* H2O flue gases mass fraction */
+  XsfH2O*(Qea + Qews + Qfuel) = (Qews) + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2/amH);
+
+  /* O2 flue gases mass fraction */
+  XsfO2*(Qea + Qews + Qfuel) = (Qea*XeaO2c) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
+
+  /* SO2 flue gases mass fraction */
+  XsfSO2*(Qea + Qews + Qfuel) = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
+
+  /* Fuel thermal power */
+  Wfuel = Qfuel*LHVfuel;
+
+  /* Combusiton air ratio */
+  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O)));
+
+  /* Pressure losses */
+  Pea - Psf = deltaPccb;
+  Qm = Qea + (Qfuel + Qews)/2;
+  Vccbm = (Vea + Vsf)/2;
+  v = Qm*Vccbm/Achamc;
+  deltaPccb = (kcham*(v^2))/(2*Vccbm);
+
+  /* Fuel specific enthalpy at the inlet */
+  Hfuel = Cpfuel*(Tfuel - 273.16);
+
+  if air_atomisation then
+     /* Energy balance equation */
+     ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wrfat + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws) + Wcpat) = 0;
+
+     /* Atomisation power */
+     Pecpat = Pea*(1 - kat);
+     Pscpat = (1 + Xspat)*Pea;
+     Wcpat = Qea*XQat*(Hiscpat - Hecpat)*eta_isc;
+
+     /* Heat extracted by the atomisaiotn refrigerant */
+     Wrfat = Qea*XQat*(Hea - Hecpat);
+  else
+     /* Energy balance equation */
+     ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) = 0;
+
+     /* Atomisation power */
+     Pecpat = Pea;
+     Pscpat = Pea;
+     Wcpat = 0;
+
+     /* Heat extracted by the atomisaiotn refrigerant */
+     Wrfat = 0;
+  end if;
+
+  /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrfuel = 0;
+  Hrws = 2501.569e3;
+  Hrfg = 2501.569e3*XsfH2O;
+
+    annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
+        Polygon(
+          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
+              -44},{-20,-60},{-20,62}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.CrossDiag)}),
+                             Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
+        Polygon(
+          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
+              -44},{-20,-60},{-20,62}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.CrossDiag)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 8.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>"));
+end GTCombustionChamber;
diff --git a/ThermoSysPro/Combustion/CombustionChambers/GenericCombustion.mo b/ThermoSysPro/Combustion/CombustionChambers/GenericCombustion.mo
index 9ea775917b11f15e748cbb151d991aa29fcb4f78..23a81f14a11745386cf93c96b48bd589614487b7 100644
--- a/ThermoSysPro/Combustion/CombustionChambers/GenericCombustion.mo
+++ b/ThermoSysPro/Combustion/CombustionChambers/GenericCombustion.mo
@@ -1,255 +1,255 @@
-within ThermoSysPro.Combustion.CombustionChambers;
-model GenericCombustion "Generic combustion chamber"
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=1
-    "Pressure loss coefficient in the combustion chamber";
-  parameter Units.SI.Area Acham=1
-    "Average corss-sectional area of the combusiton chamber";
-  parameter Real Xpth=0.01
-    "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)";
-  parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)";
-  parameter Real ImbBF=0
-    "Unburnt particle ratio in the low furnace ashes (0-1)";
-  parameter Units.SI.SpecificHeatCapacity Cpcd=500
-    "Ashes specific heat capacity";
-  parameter Units.SI.Temperature Tbf=500
-    "Ashes temperature at the outlet of the low furnace";
-  parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)";
-
-protected
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Units.SI.SpecificEnergy HHVcarbone=32.8e6
-    "Unburnt carbon higher heating value";
-  Real amCO2 "CO2 molecular mass";
-  Real amH2O "H2O molecular mass";
-  Real amSO2 "SO2 molecular mass";
-
-public
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
-  Units.SI.SpecificEnthalpy Hea(start=50e3)
-    "Air specific enthalpy at the inlet";
-  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
-  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
-  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
-  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
-  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
-  Real XCfuel(start=0.8) "C mass fraction in the fuel";
-  Real XHfuel(start=0.2) "H mass fraction in the fuel";
-  Real XOfuel(start=0) "O mass fraction in the fuel";
-  Real XSfuel(start=0) "S mass fraction in the fuel";
-  Real Xwfuel(start=0) "H2O mass fraction in the fuel";
-  Real XCDfuel(start=0) "Ashes mass fraction in the fuel";
-  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value";
-  Units.SI.SpecificHeatCapacity Cpfuel(start=1000)
-    "Fuel specific heat capacity";
-  Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value";
-  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
-  Units.SI.SpecificEnthalpy Hews(start=10e3)
-    "Water/steam specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
-  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4)
-    "Flue gases specific enthalpy at the outlet";
-  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
-  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
-  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
-  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
-  Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel";
-  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
-  Real exc(start=1) "Combustion air ratio";
-  Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate";
-  Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate";
-  Units.SI.SpecificEnthalpy Hcv(start=10e3)
-    "Volatile ashes specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hbf(start=10e3)
-    "Low furnace ashes specific enthalpy at the outlet";
-  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3)
-    "Pressure loss in the combustion chamber";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrws(start=10e4)
-    "Water/steam reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfuel(start=10e3)
-    "Fuel reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrcd(start=10e3)
-    "Ashes reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfg(start=10e3)
-    "Flue gases reference specific enthalpy";
-  Real Vea(start=0.001) "Air volume mass (m3/kg)";
-  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
-  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
-  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
-  Units.SI.MassFlowRate Qm(start=400)
-    "Average mlass flow rate in the combusiton chamber";
-  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
-  Units.SI.Velocity v(start=100)
-    "Flue gases reference velocity in the combusiton chamber";
-public
-  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{20,-100},{40,-80}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca "Air inlet"
-    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg "Flue gases outlet"
-    annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws "Water/steam inlet"
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-equation
-  /* Air inlet */
-  Qea = Ca.Q;
-  Pea = Ca.P;
-  Tea = Ca.T;
-  XeaCO2 = Ca.Xco2;
-  XeaH2O = Ca.Xh2o;
-  XeaO2 = Ca.Xo2;
-  XeaSO2 = Ca.Xso2;
-
-  /* Fuel inlet */
-  Qfuel = Cfuel.Q;
-  Tfuel = Cfuel.T;
-  XCfuel = Cfuel.Xc;
-  XHfuel = Cfuel.Xh;
-  XOfuel = Cfuel.Xo;
-  XSfuel = Cfuel.Xs;
-  Xwfuel = Cfuel.hum;
-  XCDfuel = Cfuel.Xashes;
-  LHVfuel = Cfuel.LHV;
-  Cpfuel = Cfuel.cp;
-
-  /* Water inlet */
-  Qews = Cws.Q;
-  Hews = Cws.h;
-  Cws.h = Cws.h_vol;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Tsf = Cfg.T;
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Air specific enthalpy at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-
-  /* Flue gases specific enthalpy at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Air density at the inlet */
-  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-  Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1;
-
-  /* Flue gases density at the outlet */
-  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-  Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1;
-
-  amCO2 = amC + 2*amO;
-  amH2O = 2*amH + amO;
-  amSO2 = amS + 2*amO;
-
-  /* Mass balance equation */
-  Qsf = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF;
-  Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV);
-  Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF);
-
-  /* CO2 flue gases mass fraction */
-  XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC);
-
-  /* H2O flue gases mass fraction */
-  XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2 /amH);
-
-  /* O2 flue gases mass fraction */
-  XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
-
-  /* SO2 flue gases mass fraction */
-  XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
-
-  /* Fuel thermal power */
-  HHVfuel = LHVfuel + 224.3e5*XHfuel + 25.1e5*Xwfuel;
-  Wfuel = Qfuel*HHVfuel;
-  Wpth = Qfuel*LHVfuel*Xpth;
-
-  /* Combusiton air ratio */
-  exc = Qea*(1 - XeaH2O)/
-        ((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO) -
-         Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O)));
-
-  /* Pressure losses */
-  Pea - Psf = deltaPccb;
-  Qm = Qea + (Qfuel + Qews)/2;
-  Vccbm = (Vea + Vsf)/2;
-  v = Qm*Vccbm/Acham;
-  deltaPccb = (kcham*(v^2))/(2*Vccbm);
-
-  /* Energy balance equation */
-  ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone)
-    - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) = 0;
-
-  Hfuel = Cpfuel*(Tfuel - 273.16);
-  Hcv = Cpcd*(Tsf - 273.16);
-  Hbf = Cpcd*(Tbf - 273.16);
-
- /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrfuel = 0;
-  Hrws = 2501.569e3;
-  Hrfg = 2501.569e3*XsfH2O;
-  Hrcd = 0;
-
-    annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44},
-              {38,-80},{-34,-80},{-50,-36}},
-          lineColor={0,0,0},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72},
-              {16,-80},{-16,-80},{-32,-36}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-                             Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44},
-              {38,-80},{-34,-80},{-50,-36}},
-          lineColor={0,0,0},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72},
-              {16,-80},{-16,-80},{-32,-36}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end GenericCombustion;
+within ThermoSysPro.Combustion.CombustionChambers;
+model GenericCombustion "Generic combustion chamber"
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=1
+    "Pressure loss coefficient in the combustion chamber";
+  parameter Units.SI.Area Acham=1
+    "Average corss-sectional area of the combusiton chamber";
+  parameter Real Xpth=0.01
+    "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)";
+  parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)";
+  parameter Real ImbBF=0
+    "Unburnt particle ratio in the low furnace ashes (0-1)";
+  parameter Units.SI.SpecificHeatCapacity Cpcd=500
+    "Ashes specific heat capacity";
+  parameter Units.SI.Temperature Tbf=500
+    "Ashes temperature at the outlet of the low furnace";
+  parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)";
+
+protected
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Units.SI.SpecificEnergy HHVcarbone=32.8e6
+    "Unburnt carbon higher heating value";
+  Real amCO2 "CO2 molecular mass";
+  Real amH2O "H2O molecular mass";
+  Real amSO2 "SO2 molecular mass";
+
+public
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
+  Units.SI.SpecificEnthalpy Hea(start=50e3)
+    "Air specific enthalpy at the inlet";
+  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
+  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
+  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
+  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
+  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
+  Real XCfuel(start=0.8) "C mass fraction in the fuel";
+  Real XHfuel(start=0.2) "H mass fraction in the fuel";
+  Real XOfuel(start=0) "O mass fraction in the fuel";
+  Real XSfuel(start=0) "S mass fraction in the fuel";
+  Real Xwfuel(start=0) "H2O mass fraction in the fuel";
+  Real XCDfuel(start=0) "Ashes mass fraction in the fuel";
+  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value";
+  Units.SI.SpecificHeatCapacity Cpfuel(start=1000)
+    "Fuel specific heat capacity";
+  Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value";
+  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
+  Units.SI.SpecificEnthalpy Hews(start=10e3)
+    "Water/steam specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
+  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4)
+    "Flue gases specific enthalpy at the outlet";
+  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
+  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
+  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
+  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
+  Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel";
+  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
+  Real exc(start=1) "Combustion air ratio";
+  Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate";
+  Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate";
+  Units.SI.SpecificEnthalpy Hcv(start=10e3)
+    "Volatile ashes specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hbf(start=10e3)
+    "Low furnace ashes specific enthalpy at the outlet";
+  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3)
+    "Pressure loss in the combustion chamber";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrws(start=10e4)
+    "Water/steam reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfuel(start=10e3)
+    "Fuel reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrcd(start=10e3)
+    "Ashes reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfg(start=10e3)
+    "Flue gases reference specific enthalpy";
+  Real Vea(start=0.001) "Air volume mass (m3/kg)";
+  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
+  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
+  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
+  Units.SI.MassFlowRate Qm(start=400)
+    "Average mlass flow rate in the combusiton chamber";
+  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
+  Units.SI.Velocity v(start=100)
+    "Flue gases reference velocity in the combusiton chamber";
+public
+  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{20,-100},{40,-80}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca "Air inlet"
+    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg "Flue gases outlet"
+    annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws "Water/steam inlet"
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+equation
+  /* Air inlet */
+  Qea = Ca.Q;
+  Pea = Ca.P;
+  Tea = Ca.T;
+  XeaCO2 = Ca.Xco2;
+  XeaH2O = Ca.Xh2o;
+  XeaO2 = Ca.Xo2;
+  XeaSO2 = Ca.Xso2;
+
+  /* Fuel inlet */
+  Qfuel = Cfuel.Q;
+  Tfuel = Cfuel.T;
+  XCfuel = Cfuel.Xc;
+  XHfuel = Cfuel.Xh;
+  XOfuel = Cfuel.Xo;
+  XSfuel = Cfuel.Xs;
+  Xwfuel = Cfuel.hum;
+  XCDfuel = Cfuel.Xashes;
+  LHVfuel = Cfuel.LHV;
+  Cpfuel = Cfuel.cp;
+
+  /* Water inlet */
+  Qews = Cws.Q;
+  Hews = Cws.h;
+  Cws.h = Cws.h_vol;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Tsf = Cfg.T;
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Air specific enthalpy at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+
+  /* Flue gases specific enthalpy at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Air density at the inlet */
+  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+  Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1;
+
+  /* Flue gases density at the outlet */
+  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+  Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1;
+
+  amCO2 = amC + 2*amO;
+  amH2O = 2*amH + amO;
+  amSO2 = amS + 2*amO;
+
+  /* Mass balance equation */
+  Qsf = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF;
+  Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV);
+  Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF);
+
+  /* CO2 flue gases mass fraction */
+  XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC);
+
+  /* H2O flue gases mass fraction */
+  XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2 /amH);
+
+  /* O2 flue gases mass fraction */
+  XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
+
+  /* SO2 flue gases mass fraction */
+  XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
+
+  /* Fuel thermal power */
+  HHVfuel = LHVfuel + 224.3e5*XHfuel + 25.1e5*Xwfuel;
+  Wfuel = Qfuel*HHVfuel;
+  Wpth = Qfuel*LHVfuel*Xpth;
+
+  /* Combusiton air ratio */
+  exc = Qea*(1 - XeaH2O)/
+        ((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO) -
+         Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O)));
+
+  /* Pressure losses */
+  Pea - Psf = deltaPccb;
+  Qm = Qea + (Qfuel + Qews)/2;
+  Vccbm = (Vea + Vsf)/2;
+  v = Qm*Vccbm/Acham;
+  deltaPccb = (kcham*(v^2))/(2*Vccbm);
+
+  /* Energy balance equation */
+  ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone)
+    - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) = 0;
+
+  Hfuel = Cpfuel*(Tfuel - 273.16);
+  Hcv = Cpcd*(Tsf - 273.16);
+  Hbf = Cpcd*(Tbf - 273.16);
+
+ /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrfuel = 0;
+  Hrws = 2501.569e3;
+  Hrfg = 2501.569e3*XsfH2O;
+  Hrcd = 0;
+
+    annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44},
+              {38,-80},{-34,-80},{-50,-36}},
+          lineColor={0,0,0},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72},
+              {16,-80},{-16,-80},{-32,-36}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+                             Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44},
+              {38,-80},{-34,-80},{-50,-36}},
+          lineColor={0,0,0},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72},
+              {16,-80},{-16,-80},{-32,-36}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end GenericCombustion;
diff --git a/ThermoSysPro/Combustion/CombustionChambers/GenericCombustion1D.mo b/ThermoSysPro/Combustion/CombustionChambers/GenericCombustion1D.mo
index 406f87d3b10210c7f0a88c73058cfcff31933fc9..33060d271449f4252c9b29186300b7d063dcc02e 100644
--- a/ThermoSysPro/Combustion/CombustionChambers/GenericCombustion1D.mo
+++ b/ThermoSysPro/Combustion/CombustionChambers/GenericCombustion1D.mo
@@ -1,379 +1,379 @@
-within ThermoSysPro.Combustion.CombustionChambers;
-model GenericCombustion1D "Generic combustion chamber 1D"
-
-  parameter Integer NCEL = 7;
-
-  parameter Units.SI.Area Acham=1
-    "Average cross-sectional area of the combusition chamber";
-  //parameter Modelica.SIunits.Area SM[NCEL] = {639.92,198.58,466.48,466.48,466.48,523.79,523.79}
-  parameter Units.SI.Area SM[NCEL]=fill(100, NCEL)
-    "Heat exchange area for the node i = projetee )";
-  parameter Real RSURF[NCEL] = cat(1,{1.321},fill(1.409,NCEL - 1))
-    "Reel surface/projetee surface ";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=0.01
-    "Pressure loss coefficient in the combustion chamber";
-  parameter Real Xpth=0.00
-    "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)";
-  parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)";
-  parameter Real ImbBF=0
-    "Unburnt particle ratio in the low furnace ashes (0-1)";
-  parameter Units.SI.SpecificHeatCapacity Cpcd=500
-    "Ashes specific heat capacity";
-  parameter Units.SI.Temperature Tbf=500
-    "Ashes temperature at the outlet of the low furnace";
-  parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)";
-  parameter Units.SI.CoefficientOfHeatTransfer Kec=50
-    "Convection and conduction(fouling) heat exchange coefficient";
-  parameter Real EPSPAR = 0.6 "Combustion chamber walls emissivity";
-  //parameter Real hrCorr=1.00 "Corrective term for ratiation heat exchange";
-
-protected
-  constant Real SIGMA = 5.669e-8 "Boltzman constant W/m^2/K^4";
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Units.SI.SpecificEnergy HHVcarbone=32.8e6
-    "Unburnt carbon higher heating value, CO2 = 3.2791664E+07";
-  constant Real RAD = 0.017453293 "pi/180";
-  Real amCO2 "CO2 molecular mass";
-  Real amH2O "H2O molecular mass";
-  Real amSO2 "SO2 molecular mass";
-
-public
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
-  Units.SI.SpecificEnthalpy Hea(start=50e3)
-    "Air specific enthalpy at the inlet";
-  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
-  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
-  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
-  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
-  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
-  Real XCfuel(start=0.8) "C mass fraction in the fuel /pur";
-  Real XHfuel(start=0.2) "H mass fraction in the fuel /pur";
-  Real XOfuel(start=0) "O mass fraction in the fuel /pur";
-  Real XSfuel(start=0) "S mass fraction in the fuel /pur";
-  Real Xwfuel(start=0) "H2O mass fraction in the fuel";
-  Real XCDfuel(start=0) "Ashes mass fraction in the fuel /Dryer";
-  Units.SI.SpecificEnergy LHVfuel_D(start=5e7)
-    "Fuel lower heating value /Dryer";
-  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value /Brut";
-  Units.SI.SpecificHeatCapacity Cpfuel(start=1000)
-    "Fuel specific heat capacity";
-  Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value";
-  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
-  Units.SI.SpecificEnthalpy Hews(start=10e3)
-    "Water/steam specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
-  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4)
-    "Flue gases specific enthalpy at the outlet";
-  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
-  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
-  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
-  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
-  //////////////////////Modelica.SIunits.Power Wfuel(start=5e8) "LHV power available in the fuel";
-  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
-  Real exc(start=1) "Combustion air ratio";
-  Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate";
-  Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate";
-  Units.SI.SpecificEnthalpy Hcv(start=10e3)
-    "Volatile ashes specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hbf(start=10e3)
-    "Low furnace ashes specific enthalpy at the outlet";
-  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3)
-    "Pressure loss in the combustion chamber";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrws(start=10e4)
-    "Water/steam reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfuel(start=10e3)
-    "Fuel reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrcd(start=10e3)
-    "Ashes reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfg(start=10e3)
-    "Flue gases reference specific enthalpy";
-  Real Vea(start=0.001) "Air volume mass (m3/kg)";
-  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
-  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
-  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
-  Units.SI.MassFlowRate Qm(start=400)
-    "Average mlass flow rate in the combusiton chamber";
-  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
-  Units.SI.Velocity v(start=100)
-    "Flue gases reference velocity in the combusiton chamber";
-  Units.SI.Temperature Tpi[NCEL](start=fill(400, NCEL))
-    "Wall temperature for node i";
-  Units.SI.Power Ws[NCEL](start=fill(10e6, NCEL))
-    "Power delivered to each segment";
-  Units.SI.Power Wst(start=50.e6) "Total power exchanged on all segment";
-
-public
-  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca "Air inlet"
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg "Flue gases outlet"
-    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws "Water/steam inlet"
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
-            0)));
-  Thermal.Connectors.ThermalPort Cth[NCEL] "Thermal W T"
-    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-equation
-
-  /* Heat transfer */
-  Cth.W = - Ws;
-  Cth.T = Tpi;
-
-  /* Air inlet */
-  Qea = Ca.Q;
-  Pea = Ca.P;
-  Tea = Ca.T;
-  XeaCO2 = Ca.Xco2;
-  XeaH2O = Ca.Xh2o;
-  XeaO2 = Ca.Xo2;
-  XeaSO2 = Ca.Xso2;
-
-  /* Fuel inlet */
-  Qfuel = Cfuel.Q;
-  Tfuel = Cfuel.T;
-  XCfuel = Cfuel.Xc;
-  XHfuel = Cfuel.Xh;
-  XOfuel = Cfuel.Xo;
-  XSfuel = Cfuel.Xs;
-  Xwfuel = Cfuel.hum;
-  XCDfuel = Cfuel.Xashes;
-  LHVfuel_D = Cfuel.LHV;
-  Cpfuel = Cfuel.cp;
-
-  /* Water inlet */
-  Qews = Cws.Q;
-  Hews = Cws.h;
-  Cws.h = Cws.h_vol;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Tsf = Cfg.T;
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Air specific enthalpy at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-
-  /* Flue gases specific enthalpy at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Air density at the inlet */
-  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-  Vea = if (rhoea >0.001) then
-                              1/rhoea else 1/1.1;
-
-  /* Flue gases density at the outlet */
-  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-  Vsf = if (rhosf >0.001) then
-                              1/rhosf else 1/0.1;
-
-  amCO2 = amC + 2*amO;
-  amH2O = 2*amH + amO;
-  amSO2 = amS + 2*amO;
-
-  /* Mass balance equation */
-  Qsf = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF;
-  Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV);
-  Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF);
-
-  /* CO2 flue gases mass fraction */
-  XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC);
-
-  /* H2O flue gases mass fraction */
-  //XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH);
-  XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH)+Xwfuel*Qfuel;
-
-  /* O2 flue gases mass fraction */
-  XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
-
-  /* SO2 flue gases mass fraction */
-  XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
-
-  /* LHV conversion from dryer to crude*/
-  LHVfuel = -2510000.0*Xwfuel + LHVfuel_D*(1-Xwfuel);
-
-  /* Fuel higher heating value */
-  HHVfuel = LHVfuel_D + 224.3e5*XHfuel + 25.1e5*Xwfuel;
-
-  /* Thermal losses power */
-  Wpth = Qfuel*LHVfuel*Xpth;
-
-  /* Combusiton air ratio */
-  exc = Qea*(1 - XeaH2O)/
-        ((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO) -
-         Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O)));
-//  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O)));
-
-  /* Pressure losses */
-  Pea - Psf = deltaPccb;
-  Qm = (Qea + Qfuel + Qews)/2;
-  Vccbm = (Vea + Vsf)/2;
-  v = Qm*Vccbm/Acham;
-  deltaPccb = (kcham*(v^2))/(2*Vccbm);
-
-  /* Power delivered to each segment*/
-  for i in 1:NCEL loop
-    Ws[i] = SIGMA*EPSPAR*RSURF[i]*SM[i]*(Tsf^4 - Tpi[i]^4) +  Kec*RSURF[i]*SM[i]*(Tsf - Tpi[i]);
-  end for;
-
-  Wst = sum(Ws);
-
-  /* Energy balance equation */
-  ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone)
-   + Wst - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) = 0;
-
-  Hfuel = Cpfuel*(Tfuel-273.16);
-  Hcv = Cpcd*(Tsf-273.16);
-  Hbf = Cpcd*(Tbf-273.16);
-
- /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrfuel = 0;
-  Hrws = 2501.569e3;
-  Hrfg = 2501.569e3*XsfH2O;
-  Hrcd = 0;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-56,45},{-54,53},{-50,57},{-44,59},{-36,61},{-26,61},{-16,59},
-              {-8,55},{0,51},{2,48},{0,46},{-2,45},{-6,43},{-6,42},{-4,42},{4,
-              44},{10,44},{16,43},{28,41},{44,37},{28,29},{16,25},{2,21},{-8,19},
-              {-16,17},{-28,17},{-42,19},{-50,21},{-56,27},{-56,33},{-52,37},{
-              -56,45}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-56,45},{-54,51},{-48,55},{-40,57},{-32,57},{-22,55},{-14,51},
-              {-10,47},{-14,43},{-18,41},{-22,39},{-22,37},{-18,35},{-12,36},{
-              -8,36},{-2,37},{2,37},{10,37},{22,35},{-4,25},{-18,21},{-26,19},{
-              -36,19},{-42,21},{-50,23},{-54,27},{-56,33},{-54,39},{-56,45}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,213,170}),
-        Polygon(
-          points={{-51,39},{-53,45},{-49,49},{-45,51},{-41,51},{-36,47},{-33,43},
-              {-33,39},{-34,35},{-37,31},{-39,29},{-43,27},{-47,27},{-51,29},{
-              -53,31},{-53,33},{-51,39}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,170}),
-        Polygon(
-          points={{-56,-30},{-54,-22},{-50,-18},{-44,-16},{-36,-14},{-26,-14},{
-              -16,-16},{-8,-20},{-2,-24},{0,-26},{0,-28},{0,-28},{-2,-30},{-6,
-              -32},{-4,-32},{4,-30},{10,-30},{20,-32},{28,-34},{44,-38},{28,-46},
-              {16,-50},{2,-54},{-8,-56},{-16,-58},{-28,-58},{-42,-56},{-50,-54},
-              {-56,-48},{-56,-42},{-52,-38},{-56,-30}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-56,-30},{-54,-24},{-48,-20},{-40,-18},{-32,-18},{-22,-20},{
-              -14,-24},{-10,-28},{-14,-32},{-18,-34},{-22,-36},{-22,-38},{-18,
-              -40},{-12,-40},{-8,-40},{-2,-38},{2,-38},{10,-38},{22,-40},{-4,
-              -50},{-18,-54},{-26,-56},{-36,-56},{-42,-54},{-50,-52},{-54,-48},
-              {-56,-42},{-54,-36},{-56,-30}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,213,170}),
-        Polygon(
-          points={{-51,-36},{-53,-30},{-49,-26},{-45,-24},{-41,-24},{-36,-28},{
-              -33,-32},{-33,-36},{-34,-40},{-37,-44},{-39,-46},{-43,-48},{-47,
-              -48},{-51,-46},{-53,-44},{-53,-42},{-51,-36}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,170})}),    Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-54,45},{-52,53},{-48,57},{-42,59},{-34,61},{-24,61},{-14,59},
-              {-6,55},{2,51},{4,48},{2,46},{0,45},{-4,43},{-4,42},{-2,42},{6,44},
-              {12,44},{18,43},{30,41},{46,37},{30,29},{18,25},{4,21},{-6,19},{
-              -14,17},{-26,17},{-40,19},{-48,21},{-54,27},{-54,33},{-50,37},{
-              -54,45}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-54,45},{-52,51},{-46,55},{-38,57},{-30,57},{-20,55},{-12,51},
-              {-8,47},{-12,43},{-16,41},{-20,39},{-20,37},{-16,35},{-10,36},{-6,
-              36},{0,37},{4,37},{12,37},{24,35},{-2,25},{-16,21},{-24,19},{-34,
-              19},{-40,21},{-48,23},{-52,27},{-54,33},{-52,39},{-54,45}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,213,170}),
-        Polygon(
-          points={{-49,39},{-51,45},{-47,49},{-43,51},{-39,51},{-34,47},{-31,43},
-              {-31,39},{-32,35},{-35,31},{-37,29},{-41,27},{-45,27},{-49,29},{
-              -51,31},{-51,33},{-49,39}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,170}),
-        Polygon(
-          points={{-54,-30},{-52,-22},{-48,-18},{-42,-16},{-34,-14},{-24,-14},{
-              -14,-16},{-6,-20},{0,-24},{2,-26},{2,-28},{2,-28},{0,-30},{-4,-32},
-              {-2,-32},{6,-30},{12,-30},{22,-32},{30,-34},{46,-38},{30,-46},{18,
-              -50},{4,-54},{-6,-56},{-14,-58},{-26,-58},{-40,-56},{-48,-54},{
-              -54,-48},{-54,-42},{-50,-38},{-54,-30}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-54,-30},{-52,-24},{-46,-20},{-38,-18},{-30,-18},{-20,-20},{
-              -12,-24},{-8,-28},{-12,-32},{-16,-34},{-20,-36},{-20,-38},{-16,
-              -40},{-10,-40},{-6,-40},{0,-38},{4,-38},{12,-38},{24,-40},{-2,-50},
-              {-16,-54},{-24,-56},{-34,-56},{-40,-54},{-48,-52},{-52,-48},{-54,
-              -42},{-52,-36},{-54,-30}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,213,170}),
-        Polygon(
-          points={{-49,-36},{-51,-30},{-47,-26},{-43,-24},{-39,-24},{-34,-28},{
-              -31,-32},{-31,-36},{-32,-40},{-35,-44},{-37,-46},{-41,-48},{-45,
-              -48},{-49,-46},{-51,-44},{-51,-42},{-49,-36}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,170})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 8.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>"));
-end GenericCombustion1D;
+within ThermoSysPro.Combustion.CombustionChambers;
+model GenericCombustion1D "Generic combustion chamber 1D"
+
+  parameter Integer NCEL = 7;
+
+  parameter Units.SI.Area Acham=1
+    "Average cross-sectional area of the combusition chamber";
+  //parameter Modelica.SIunits.Area SM[NCEL] = {639.92,198.58,466.48,466.48,466.48,523.79,523.79}
+  parameter Units.SI.Area SM[NCEL]=fill(100, NCEL)
+    "Heat exchange area for the node i = projetee )";
+  parameter Real RSURF[NCEL] = cat(1,{1.321},fill(1.409,NCEL - 1))
+    "Reel surface/projetee surface ";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=0.01
+    "Pressure loss coefficient in the combustion chamber";
+  parameter Real Xpth=0.00
+    "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)";
+  parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)";
+  parameter Real ImbBF=0
+    "Unburnt particle ratio in the low furnace ashes (0-1)";
+  parameter Units.SI.SpecificHeatCapacity Cpcd=500
+    "Ashes specific heat capacity";
+  parameter Units.SI.Temperature Tbf=500
+    "Ashes temperature at the outlet of the low furnace";
+  parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)";
+  parameter Units.SI.CoefficientOfHeatTransfer Kec=50
+    "Convection and conduction(fouling) heat exchange coefficient";
+  parameter Real EPSPAR = 0.6 "Combustion chamber walls emissivity";
+  //parameter Real hrCorr=1.00 "Corrective term for ratiation heat exchange";
+
+protected
+  constant Real SIGMA = 5.669e-8 "Boltzman constant W/m^2/K^4";
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Units.SI.SpecificEnergy HHVcarbone=32.8e6
+    "Unburnt carbon higher heating value, CO2 = 3.2791664E+07";
+  constant Real RAD = 0.017453293 "pi/180";
+  Real amCO2 "CO2 molecular mass";
+  Real amH2O "H2O molecular mass";
+  Real amSO2 "SO2 molecular mass";
+
+public
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
+  Units.SI.SpecificEnthalpy Hea(start=50e3)
+    "Air specific enthalpy at the inlet";
+  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
+  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
+  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
+  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
+  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
+  Real XCfuel(start=0.8) "C mass fraction in the fuel /pur";
+  Real XHfuel(start=0.2) "H mass fraction in the fuel /pur";
+  Real XOfuel(start=0) "O mass fraction in the fuel /pur";
+  Real XSfuel(start=0) "S mass fraction in the fuel /pur";
+  Real Xwfuel(start=0) "H2O mass fraction in the fuel";
+  Real XCDfuel(start=0) "Ashes mass fraction in the fuel /Dryer";
+  Units.SI.SpecificEnergy LHVfuel_D(start=5e7)
+    "Fuel lower heating value /Dryer";
+  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value /Brut";
+  Units.SI.SpecificHeatCapacity Cpfuel(start=1000)
+    "Fuel specific heat capacity";
+  Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value";
+  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
+  Units.SI.SpecificEnthalpy Hews(start=10e3)
+    "Water/steam specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
+  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4)
+    "Flue gases specific enthalpy at the outlet";
+  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
+  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
+  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
+  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
+  //////////////////////Modelica.SIunits.Power Wfuel(start=5e8) "LHV power available in the fuel";
+  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
+  Real exc(start=1) "Combustion air ratio";
+  Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate";
+  Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate";
+  Units.SI.SpecificEnthalpy Hcv(start=10e3)
+    "Volatile ashes specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hbf(start=10e3)
+    "Low furnace ashes specific enthalpy at the outlet";
+  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3)
+    "Pressure loss in the combustion chamber";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrws(start=10e4)
+    "Water/steam reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfuel(start=10e3)
+    "Fuel reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrcd(start=10e3)
+    "Ashes reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfg(start=10e3)
+    "Flue gases reference specific enthalpy";
+  Real Vea(start=0.001) "Air volume mass (m3/kg)";
+  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
+  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
+  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
+  Units.SI.MassFlowRate Qm(start=400)
+    "Average mlass flow rate in the combusiton chamber";
+  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
+  Units.SI.Velocity v(start=100)
+    "Flue gases reference velocity in the combusiton chamber";
+  Units.SI.Temperature Tpi[NCEL](start=fill(400, NCEL))
+    "Wall temperature for node i";
+  Units.SI.Power Ws[NCEL](start=fill(10e6, NCEL))
+    "Power delivered to each segment";
+  Units.SI.Power Wst(start=50.e6) "Total power exchanged on all segment";
+
+public
+  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca "Air inlet"
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg "Flue gases outlet"
+    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws "Water/steam inlet"
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
+            0)));
+  Thermal.Connectors.ThermalPort Cth[NCEL] "Thermal W T"
+    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+equation
+
+  /* Heat transfer */
+  Cth.W = - Ws;
+  Cth.T = Tpi;
+
+  /* Air inlet */
+  Qea = Ca.Q;
+  Pea = Ca.P;
+  Tea = Ca.T;
+  XeaCO2 = Ca.Xco2;
+  XeaH2O = Ca.Xh2o;
+  XeaO2 = Ca.Xo2;
+  XeaSO2 = Ca.Xso2;
+
+  /* Fuel inlet */
+  Qfuel = Cfuel.Q;
+  Tfuel = Cfuel.T;
+  XCfuel = Cfuel.Xc;
+  XHfuel = Cfuel.Xh;
+  XOfuel = Cfuel.Xo;
+  XSfuel = Cfuel.Xs;
+  Xwfuel = Cfuel.hum;
+  XCDfuel = Cfuel.Xashes;
+  LHVfuel_D = Cfuel.LHV;
+  Cpfuel = Cfuel.cp;
+
+  /* Water inlet */
+  Qews = Cws.Q;
+  Hews = Cws.h;
+  Cws.h = Cws.h_vol;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Tsf = Cfg.T;
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Air specific enthalpy at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+
+  /* Flue gases specific enthalpy at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Air density at the inlet */
+  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+  Vea = if (rhoea >0.001) then
+                              1/rhoea else 1/1.1;
+
+  /* Flue gases density at the outlet */
+  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+  Vsf = if (rhosf >0.001) then
+                              1/rhosf else 1/0.1;
+
+  amCO2 = amC + 2*amO;
+  amH2O = 2*amH + amO;
+  amSO2 = amS + 2*amO;
+
+  /* Mass balance equation */
+  Qsf = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF;
+  Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV);
+  Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF);
+
+  /* CO2 flue gases mass fraction */
+  XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC);
+
+  /* H2O flue gases mass fraction */
+  //XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH);
+  XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH)+Xwfuel*Qfuel;
+
+  /* O2 flue gases mass fraction */
+  XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
+
+  /* SO2 flue gases mass fraction */
+  XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
+
+  /* LHV conversion from dryer to crude*/
+  LHVfuel = -2510000.0*Xwfuel + LHVfuel_D*(1-Xwfuel);
+
+  /* Fuel higher heating value */
+  HHVfuel = LHVfuel_D + 224.3e5*XHfuel + 25.1e5*Xwfuel;
+
+  /* Thermal losses power */
+  Wpth = Qfuel*LHVfuel*Xpth;
+
+  /* Combusiton air ratio */
+  exc = Qea*(1 - XeaH2O)/
+        ((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO) -
+         Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O)));
+//  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O)));
+
+  /* Pressure losses */
+  Pea - Psf = deltaPccb;
+  Qm = (Qea + Qfuel + Qews)/2;
+  Vccbm = (Vea + Vsf)/2;
+  v = Qm*Vccbm/Acham;
+  deltaPccb = (kcham*(v^2))/(2*Vccbm);
+
+  /* Power delivered to each segment*/
+  for i in 1:NCEL loop
+    Ws[i] = SIGMA*EPSPAR*RSURF[i]*SM[i]*(Tsf^4 - Tpi[i]^4) +  Kec*RSURF[i]*SM[i]*(Tsf - Tpi[i]);
+  end for;
+
+  Wst = sum(Ws);
+
+  /* Energy balance equation */
+  ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone)
+   + Wst - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) = 0;
+
+  Hfuel = Cpfuel*(Tfuel-273.16);
+  Hcv = Cpcd*(Tsf-273.16);
+  Hbf = Cpcd*(Tbf-273.16);
+
+ /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrfuel = 0;
+  Hrws = 2501.569e3;
+  Hrfg = 2501.569e3*XsfH2O;
+  Hrcd = 0;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-56,45},{-54,53},{-50,57},{-44,59},{-36,61},{-26,61},{-16,59},
+              {-8,55},{0,51},{2,48},{0,46},{-2,45},{-6,43},{-6,42},{-4,42},{4,
+              44},{10,44},{16,43},{28,41},{44,37},{28,29},{16,25},{2,21},{-8,19},
+              {-16,17},{-28,17},{-42,19},{-50,21},{-56,27},{-56,33},{-52,37},{
+              -56,45}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-56,45},{-54,51},{-48,55},{-40,57},{-32,57},{-22,55},{-14,51},
+              {-10,47},{-14,43},{-18,41},{-22,39},{-22,37},{-18,35},{-12,36},{
+              -8,36},{-2,37},{2,37},{10,37},{22,35},{-4,25},{-18,21},{-26,19},{
+              -36,19},{-42,21},{-50,23},{-54,27},{-56,33},{-54,39},{-56,45}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,213,170}),
+        Polygon(
+          points={{-51,39},{-53,45},{-49,49},{-45,51},{-41,51},{-36,47},{-33,43},
+              {-33,39},{-34,35},{-37,31},{-39,29},{-43,27},{-47,27},{-51,29},{
+              -53,31},{-53,33},{-51,39}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,170}),
+        Polygon(
+          points={{-56,-30},{-54,-22},{-50,-18},{-44,-16},{-36,-14},{-26,-14},{
+              -16,-16},{-8,-20},{-2,-24},{0,-26},{0,-28},{0,-28},{-2,-30},{-6,
+              -32},{-4,-32},{4,-30},{10,-30},{20,-32},{28,-34},{44,-38},{28,-46},
+              {16,-50},{2,-54},{-8,-56},{-16,-58},{-28,-58},{-42,-56},{-50,-54},
+              {-56,-48},{-56,-42},{-52,-38},{-56,-30}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-56,-30},{-54,-24},{-48,-20},{-40,-18},{-32,-18},{-22,-20},{
+              -14,-24},{-10,-28},{-14,-32},{-18,-34},{-22,-36},{-22,-38},{-18,
+              -40},{-12,-40},{-8,-40},{-2,-38},{2,-38},{10,-38},{22,-40},{-4,
+              -50},{-18,-54},{-26,-56},{-36,-56},{-42,-54},{-50,-52},{-54,-48},
+              {-56,-42},{-54,-36},{-56,-30}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,213,170}),
+        Polygon(
+          points={{-51,-36},{-53,-30},{-49,-26},{-45,-24},{-41,-24},{-36,-28},{
+              -33,-32},{-33,-36},{-34,-40},{-37,-44},{-39,-46},{-43,-48},{-47,
+              -48},{-51,-46},{-53,-44},{-53,-42},{-51,-36}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,170})}),    Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-54,45},{-52,53},{-48,57},{-42,59},{-34,61},{-24,61},{-14,59},
+              {-6,55},{2,51},{4,48},{2,46},{0,45},{-4,43},{-4,42},{-2,42},{6,44},
+              {12,44},{18,43},{30,41},{46,37},{30,29},{18,25},{4,21},{-6,19},{
+              -14,17},{-26,17},{-40,19},{-48,21},{-54,27},{-54,33},{-50,37},{
+              -54,45}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-54,45},{-52,51},{-46,55},{-38,57},{-30,57},{-20,55},{-12,51},
+              {-8,47},{-12,43},{-16,41},{-20,39},{-20,37},{-16,35},{-10,36},{-6,
+              36},{0,37},{4,37},{12,37},{24,35},{-2,25},{-16,21},{-24,19},{-34,
+              19},{-40,21},{-48,23},{-52,27},{-54,33},{-52,39},{-54,45}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,213,170}),
+        Polygon(
+          points={{-49,39},{-51,45},{-47,49},{-43,51},{-39,51},{-34,47},{-31,43},
+              {-31,39},{-32,35},{-35,31},{-37,29},{-41,27},{-45,27},{-49,29},{
+              -51,31},{-51,33},{-49,39}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,170}),
+        Polygon(
+          points={{-54,-30},{-52,-22},{-48,-18},{-42,-16},{-34,-14},{-24,-14},{
+              -14,-16},{-6,-20},{0,-24},{2,-26},{2,-28},{2,-28},{0,-30},{-4,-32},
+              {-2,-32},{6,-30},{12,-30},{22,-32},{30,-34},{46,-38},{30,-46},{18,
+              -50},{4,-54},{-6,-56},{-14,-58},{-26,-58},{-40,-56},{-48,-54},{
+              -54,-48},{-54,-42},{-50,-38},{-54,-30}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-54,-30},{-52,-24},{-46,-20},{-38,-18},{-30,-18},{-20,-20},{
+              -12,-24},{-8,-28},{-12,-32},{-16,-34},{-20,-36},{-20,-38},{-16,
+              -40},{-10,-40},{-6,-40},{0,-38},{4,-38},{12,-38},{24,-40},{-2,-50},
+              {-16,-54},{-24,-56},{-34,-56},{-40,-54},{-48,-52},{-52,-48},{-54,
+              -42},{-52,-36},{-54,-30}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,213,170}),
+        Polygon(
+          points={{-49,-36},{-51,-30},{-47,-26},{-43,-24},{-39,-24},{-34,-28},{
+              -31,-32},{-31,-36},{-32,-40},{-35,-44},{-37,-46},{-41,-48},{-45,
+              -48},{-49,-46},{-51,-44},{-51,-42},{-49,-36}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,170})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 8.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>"));
+end GenericCombustion1D;
diff --git a/ThermoSysPro/Combustion/CombustionChambers/GridFurnace.mo b/ThermoSysPro/Combustion/CombustionChambers/GridFurnace.mo
index 34d3cf8a24e6bc7d55f3a652615d62d0551e5a68..0188cf9392ade624ff671cf6409d11e10387a3d9 100644
--- a/ThermoSysPro/Combustion/CombustionChambers/GridFurnace.mo
+++ b/ThermoSysPro/Combustion/CombustionChambers/GridFurnace.mo
@@ -1,873 +1,873 @@
-within ThermoSysPro.Combustion.CombustionChambers;
-model GridFurnace "Combustion furnace"
-  parameter Real X2eap=0.1 "Primary air fraction in zone 2";
-  parameter Real X3eap=0.1 "Primary air fraction in zone 3";
-  parameter Real XCleom=0 "Cl mass fraction in the biomass";
-  parameter Real XFeom=0 "F mass fraction in the biomass";
-  parameter Real XMACHeom=0 "machefers mass fraction in the biomass";
-  parameter Units.SI.Density rhoCENDom=0.5
-    "Density of the ashes in the biomass";
-  parameter Units.SI.Temperature Tfrecirc=600
-    "Temperature of the recirculated flue gases";
-  parameter Real XfCO2recirc=0.3
-    "CO2 mass fraction in the recirculated flue gases";
-  parameter Real XfH2Orecirc=0.1
-    "H2O mass fraction in the recirculated flue gases";
-  parameter Real XfO2recirc=0.2
-    "O2 mass fraction in the recirculated flue gases";
-  parameter Real XfSO2recirc=0
-    "SO2 mass fraction in the recirculated flue gases";
-  parameter Real Xrecirc=0.1 "Recirculated flue gases fraction in Qsf";
-  parameter Units.SI.SpecificHeatCapacity CpMACH=500
-    "Clinker average specific heat capacity";
-  parameter Units.SI.SpecificHeatCapacity CpMACHs2=500
-    "Clinker specific heat capacity at the outlet of zone 2";
-  parameter Units.SI.SpecificHeatCapacity CpMACHs3=500
-    "Clinker specific heat capacity at the outlet of zone 3";
-  parameter Units.SI.SpecificHeatCapacity CpMACHs4=500
-    "Clinker specific heat capacity at the outlet of zone 4";
-  parameter Units.SI.Temperature TsjeMACH=293
-    "Clinker temperature at the outlet of the water seal";
-  parameter Units.SI.Temperature Teeje=293
-    "Water temperature at the outlet of the water seal";
-  parameter Real XsjeH2OMACH=0.2
-    "Clinker humidity at the outlet of the water seal";
-  parameter Real rendje=1 "Water seal efficiency";
-  parameter Integer jointeau=0 "1: with water seal - 0: without water seal";
-  parameter Real XCvol=0 "Volatile carbon fraction";
-  parameter Real XCimb=0 "Unburnt carbon fraction";
-  parameter Units.SI.Temperature T1sfm=500
-    "Flue gases temperature at the outlet of zone 1";
-  parameter Real Eray2=0.1
-    "Energy fraction radiated towards zone 2 of the furnace";
-  parameter Real Eray5=0.1
-    "Energy fraction radiated towards zone 5 of the furnac";
-  parameter Real perte=0 "Loss percent of LHV";
-  parameter Units.SI.SpecificHeatCapacity Cp3CO=500
-    "CO specific heat capacity in zone 3";
-
-public
-  Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet";
-  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1000) "Flue gases temperature at the outlet";
-  Real XsfN2(start=0.6) "Flue gases N2 mass fraction at the outlet";
-  Real XsfCO2(start=0.1) "Flue gases CO2 mass fraction at the outlet";
-  Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet";
-  Real XsfO2(start=0.1) "Flue gases O2 mass fraction at the outlet";
-  Real XsfSO2(start=0.1) "Flue gases SO2 mass fraction at the outlet";
-  Units.SI.MassFlowRate Qeap(start=10) "Primary air mass flow rate";
-  Units.SI.AbsolutePressure Peap(start=1e5) "Primary air pressure";
-  Units.SI.Temperature Teap(start=300) "Primary air temperature";
-  Real XeapN2(start=0.6) "Primary air N2 mass fraction";
-  Real XeapCO2(start=0.1) "Primary air CO2 mass fraction";
-  Real XeapH2O(start=0.1) "Primary air H2O mass fraction";
-  Real XeapO2(start=0.1) "Primary air O2 mass fraction";
-  Real XeapSO2(start=0.1) "Primary air SO2 mass fraction";
-  Units.SI.MassFlowRate Qeas(start=10) "Secondary air mass flow rate";
-  Units.SI.AbsolutePressure Peas(start=1e5) "Secondary air pressure";
-  Units.SI.Temperature Teas(start=300) "Secondary air temperature";
-  Real XeasN2(start=0.6) "Secondary air N2 mass fraction";
-  Real XeasCO2(start=0.1) "Secondary air CO2 mass fraction";
-  Real XeasH2O(start=0.1) "Secondary air H2O mass fraction";
-  Real XeasO2(start=0.1) "Secondaryr O2 mass fraction";
-  Real XeasSO2(start=0.1) "Secondary SO2 mass fraction";
-  Units.SI.MassFlowRate Qeom(start=10) "Biomass mass flow rate";
-  Units.SI.Temperature Teom(start=300) "Biomass temperature";
-  Real PCIom(start=1e6) "Biomass LHV (J/kg)";
-  Real XCeom(start=0.1) "Biomass C mass fraction";
-  Real XHeom(start=0.1) "Biomass H mass fraction";
-  Real XOeom(start=0.1) "Biomass O mass fraction";
-  Real XNeom(start=0.01) "Biomass N mass fraction";
-  Real XSeom(start=0.1) "Biomass S mass fraction";
-  Real XCENDeom(start=0.1) "Biomass ashes mass fraction";
-  Real XH2Oeom(start=0.1) "Biomass humidity";
-  Units.SI.SpecificHeatCapacity Cpom(start=1000)
-    "Biomass specific heat capacity";
-  Units.SI.MassFlowRate Qerefo(start=10) "Cooling water mass flow rate";
-  Units.SI.SpecificEnthalpy Herefo(start=10e3)
-    "Cooling water specific enthalpy";
-  Units.SI.MassFlowRate Qfrecirc(start=10)
-    "Recirculated flue gases mass flow rate";
-  Real XsfN2recirc(start=0.1) "Recirculated flue gases N2 mass fraction";
-  Real PCIMACH(start=10e6) "Clinker LHV";
-  Units.SI.MassFlowRate QsMACH(start=10) "Clinker mass flow rate";
-  Units.SI.Temperature TsMACH(start=500) "Clinket temperature";
-  Real FVN(start=0.1) "Volatile ashes mass fraction";
-  Units.SI.Density rhocend(start=500) "Ashes density in the flue gases";
-  Units.SI.Power Wsr(start=10e6) "Radiated power";
-  Real excair(start=0.1) "Combustion excess air";
-
-protected
-  constant Units.SI.SpecificEnthalpy H0v=2501551.43
-    "Vaporisation energy at 0°C";
-  constant Units.SI.SpecificEnthalpy HfCO2=3.2791664e7 "CO2 formation enthalpy";
-  constant Units.SI.SpecificEnthalpy HfCO=9.201e6 "CO formation enthalpy";
-  constant Units.SI.SpecificEnthalpy HfH2Og=13.433333e6
-    "H2Og formation enthalpy";
-  constant Units.SI.SpecificEnthalpy HfSO2=4.6302650e6 "SO2 formation enthalpy";
-  constant Units.SI.SpecificEnthalpy HfH2Ol=15.883300e6
-    "H2Ol formation enthalpy";
-
-public
-  Real X1eap(start=0.1) "Primary air fraction in zone 1";
-  Units.SI.MassFlowRate Q1eap(start=10) "Primary mass flow rate in zone 1";
-  Units.SI.MassFlowRate Q2eap(start=10) "Primary mass flow rate in zone 2";
-  Units.SI.MassFlowRate Q3eap(start=10) "Primary mass flow rate in zone 3";
-  Real XCvol2(start=0.1) "C mass fraction burnt in zone 2";
-  Real XMACHimb(start=0.1) "C mass raction unburnt in the clinker";
-  Real XCvol3(start=0.1) "C mass fraction burnt in zone 3";
-
-//Zone1
-  Units.SI.SpecificEnthalpy Heap(start=1e3)
-    "Humid air specific enthalpy at the primary air temperature";
-  Units.SI.SpecificEnthalpy Heas(start=1e3)
-    "Humid air specific enthalpy at the secondary air temperature";
-  Units.SI.SpecificEnthalpy H1a(start=1e3)
-    "Primary air specific enthalpy at T1sfm";
-  Units.SI.SpecificEnthalpy Hefrecirc(start=1e3)
-    "Specific enthalpy of the incoming recirculated flue gases";
-  Units.SI.MassFlowRate Qeasm(start=10)
-    "Mass flow rate of the secondary air / recirculated flue gases mixture";
-  Units.SI.SpecificEnthalpy Heasm(start=1e3)
-    "Specific enthalpy of the secondary air / recirculated flue gases mixture";
-  Units.SI.Temperature Teasm(start=500)
-    "Temperature of the secondary air / recirculated flue gases mixture";
-  Real XeasmO2(start=0.1)
-    "O2 mass fraction in the secondary air / recirculated flue gases mixture";
-  Real XeasmCO2(start=0.1)
-    "CO2 mass fraction in the secondary air / recirculated flue gases mixture";
-  Real XeasmH2O(start=0.1)
-    "H2O mass fraction in the secondary air / recirculated flue gases mixture";
-  Real XeasmSO2(start=0.1)
-    "SO2 mass fraction in the secondary air / recirculated flue gases mixture";
-  Real XeasmN2(start=0.1)
-    "N2 mass fraction in the secondary air / recirculated flue gases mixture";
-  Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  Units.SI.SpecificEnthalpy Heauom(start=1e3) "Biomass water specific enthalpy";
-  Units.SI.AbsolutePressure Psateom(start=1e5)
-    "Water saturation presure at Teom";
-  Units.SI.SpecificEnthalpy Hvteom(start=10e3)
-    "Steam saturation specific enthalpy at Teom";
-  Units.SI.SpecificEnthalpy Hlteom(start=10e3)
-    "Water saturation specific enthalpy at Teom";
-  Units.SI.SpecificEnthalpy Hvapteom(start=10e3)
-    "Phase transition energy at Teom";
-  Units.SI.SpecificEnthalpy Hs1vom(start=1e3)
-    "Water specific enthalpy of the outgoing biomass at T1sfm vapor";
-  Units.SI.SpecificEnthalpy Heom(start=1e3)
-    "Biomass specific enthalpy at the inlet";
-  Units.SI.Power Wff(start=1e6) "Flue gases formation energy";
-  Units.SI.Power Wp(start=1e6) "Biomass pyrolysis power";
-  Units.SI.Power Wimbp(start=1e6)
-    "Power saved in the combustion flue gases due to the non-destruction of unburnt C";
-  Units.SI.Power Wimbm(start=1e6)
-    "Power lost by the combustion flue gases due to the non-combustion of unburnt C";
-  Units.SI.SpecificEnthalpy Hpyr(start=1e3) "Pyrolysis specific enthalpy";
-  Units.SI.SpecificEnthalpy H1om(start=1e3)
-    "Specific enthalpy of the dry biomass at the pyrolysis temperature of the biomass";
-  Units.SI.MassFlowRate Q1H2O(start=10)
-    "H2O mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1O2(start=10)
-    "O2 mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1N2(start=10)
-    "N2 mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1CO2(start=10)
-    "CO2 mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1SO2(start=10)
-    "SO2 mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1g(start=10)
-    "Total mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q2eom(start=10)
-    "Biomass mass flow rate at the inlet of zone 2";
-  Real PCI1om(start=1e6) "LHV after drying";
-  Real X1MACHom(start=0.1) "Clinker mass fraction in the biomass after drying";
-  Real XC1vol2(start=0.1) "Burnt C mass fraction in zone 2 after drying";
-  Real XC1vol3(start=0.1) "Burnt C mass fraction in zone 3 after drying";
-  Real X1MACHimb(start=0.1)
-    "Unburnt C mass fraction in the clinker after drying";
-  Real X1H(start=0.1) "H mass fraction in the biomass after drying";
-  Real X1O(start=0.1) "O mass fraction in the biomass after drying";
-  Real X1N(start=0.1) "N mass fraction in the biomass after drying";
-  Real X1Cl(start=0.1) "Cl mass fraction in the biomass after drying";
-  Real X1F(start=0.1) "F mass fraction in the biomass after drying";
-  Real X1S(start=0.1) "S mass fraction in the biomass after drying";
-  Real X1CEND(start=0.1) "Ashes mass fraction in the biomass after drying";
-  Units.SI.MassFlowRate Qcendom(start=10) "Ashes mass flow rate";
-  Real Xfcend(start=0.1) "Ashes mass fraction in the flue gases";
-  Units.SI.Power P1g(start=1e6) "Power saved in zone 1";
-
-//Zone 2
-  Units.SI.MassFlowRate Q2eo(start=10)
-    "Mass flow rate of the oxygen carried by the air and the biomass at the inlet of zone 2";
-  Units.SI.MassFlowRate Q2HCl(start=10)
-    "Combustion HCl mass fraction in zone 2";
-  Units.SI.MassFlowRate Q2HF(start=10)
-    "Combustion HF mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2SO2(start=10)
-    "Combustion SO2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2H2O(start=10)
-    "Combustion H2O mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2CO(start=10)
-    "Combustion CO mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2N2(start=10)
-    "Combustion N2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2O2(start=10)
-    "Combustion O2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2cend(start=10)
-    "Combustion ashes mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2CO2(start=10)
-    "Combustion CO2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2g(start=10)
-    "Elements total mass flow rate after combustion";
-  Real Epsivol(start=0.1) "Volatile matter mass fraction produced in zone 2";
-  Units.SI.MassFlowRate Q3eom(start=10) "Solid matter at the inlet of zone 3";
-  Real X2MACHom(start=0.1)
-    "Clinker mass fraction of the biomass after volatilisation";
-  Real XC2vol3(start=0.1)
-    "C mass fraction burnt in zone 3 after volatilisation";
-  Real X2MACHimb(start=0.1)
-    "Unburnt C mas fraction in the clinker after volatilisation";
-  Real PCICsol(start=1e6) "LHV of the solid outgoing carbon";
-  Real PCICvol(start=1e6) "LHV of the volatile carbon transformed into CO";
-  Units.SI.SpecificEnthalpy H2(start=1e3) "Enthalpy released in zone 2";
-  Units.SI.Power P2g(start=1e6) "Power released by the combustion in zone 2";
-  Units.SI.Power P1o(start=1e6) "Power captured by the biomass";
-  Units.SI.Power P1v(start=1e6) "Power captured by the steam";
-  Units.SI.Power P1a(start=1e6) "Power captured by the air";
-  Units.SI.Power P1r(start=1e6) "Power captured by the cooling water";
-  Real Eray0(start=0.2)
-    "Fraction of the radiated power from zone 2 unused for the drying";
-  Real X2O2(start=0.1) "O2 mass fraction at the oultet of zone 2";
-  Real X2SO2(start=0.1) "SO2 mass fraction at the oultet of zone 2";
-  Real X2CO2(start=0.1) "CO2 mass fraction at the oultet of zone 2";
-  Real X2H2O(start=0.1) "H2O mass fraction at the oultet of zone 2";
-  Real X2N2(start=0.1) "N2 mass fraction at the oultet of zone 2";
-  Units.SI.SpecificEnthalpy H2g(start=1200000)
-    "Flue gases specific enthalpy at the oultet of zone 2";
-  Units.SI.Temperature T2(start=1000)
-    "Flue gases temperature at the oultet of zone 2";
-
-//Zone 3
-  Units.SI.MassFlowRate Q3od(start=10)
-    "O mass flow rate available for the oxydation of the clinker in CO and/or CO2";
-  Units.SI.MassFlowRate Q3cd(start=10)
-    "C mass flow rate available for the oxydation of the clinker in CO and/or CO2";
-  Real taux3oc(start=0.1)
-    "Ratio of the mass flow rates O/C available for the oxydation of the clinker";
-  Units.SI.MassFlowRate Q3CO2(start=10)
-    "CO2 mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3CO(start=10)
-    "CO mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3O2(start=10)
-    "O2 mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3N2(start=10)
-    "N2 mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3H2O(start=10)
-    "H2O mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3SO2(start=10)
-    "SO2 mass flow rate at the outlet of zone 3";
-  Units.SI.Power P3s(start=1e6) "Power captured by solid matter in zone 3";
-  Units.SI.Power P3g(start=1e6) "Power captured by gaseous matter in zone 3";
-  Units.SI.SpecificEnthalpy H3s(start=1e3)
-    "Gaseous matter specific enthalpy at T3g";
-  Units.SI.SpecificEnthalpy H3g(start=1e3)
-    "Solid matter specific enthalpy at T3o";
-  Real XC2vol31(start=0.1)
-    "C mass fraction burnt in zone 3 after volatilisation";
-  Real XC2vol4(start=0.1) "C mass fraction burnt at the inlet of zone 4";
-  Units.SI.MassFlowRate Q3g(start=10)
-    "Flue gases mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q4eom(start=10)
-    "Clinker mass flow rate at the inlet of zone 4";
-  Real X4MACHom(start=0.1)
-    "Mass flow rate of the biomass clinker after C volatilisation in zone 3";
-  Real X4MACHimb(start=0.1)
-    "Unburnt C mass fraction in the clinker after C volatilisation in zone 3";
-  Units.SI.SpecificHeatCapacity Cp3a(start=1000)
-    "Average specific heat capacity at the inlet of zone 3";
-  Units.SI.Temperature T3o(start=500)
-    "Clinker temperature at the outlet of zone 3";
-  constant Units.SI.SpecificHeatCapacity Cp3g=1100
-    "Average flue gases specific heat capacity at T3g";
-  Units.SI.Power P3ac(start=1e6) "Air power heated at (T2 + T3o)/2";
-  Units.SI.Power P3co(start=1e6) "CO power heated at (T2 + T3o)/2";
-  Units.SI.Power P3(start=1e6) "Total flue gases power at the outlet of zone 3";
-
-//Zone 4
-  Units.SI.Temperature T4o(start=600)
-    "Clinker temperature at the outlet for the water seal";
-  Units.SI.Temperature T4er(start=600)
-    "Water temperature at the inlet of the water seal";
-  Real X4H2O(start=0.1)
-    "H2O mass fraction in the clinker at the outlet of the water seal";
-  Units.SI.SpecificHeatCapacity Cp4liq(start=1000)
-    "Water specific heat capacity at TEej";
-  Units.SI.Power P4m(start=1e6) "Power lost by the clinker during vaporisation";
-  Units.SI.Power P4h(start=1e6) "Power associated to the clinker humidity";
-  Units.SI.MassFlowRate Q4v(start=10)
-    "Steam mass flow rate generated by the water seal";
-  Units.SI.SpecificEnthalpy H4(start=1e3) "Enthalpy in zone 4";
-  Units.SI.Power P4v(start=1e6) "Power captured by the steam in zone 4";
-  constant Units.SI.SpecificEnthalpy Hvapo=2501600 "Vaporisation energy";
-
-//Zone 5
-  Units.SI.MassFlowRate QO2p(start=10)
-    "Flue gases O2 mass flow rate at the outlet";
-  Units.SI.MassFlowRate Qairp(start=10)
-    "Excess air mass flow rate for data Qo2p";
-  Units.SI.MassFlowRate Qairs(start=10) "Stoechiometric air mass flow rate";
-  Units.SI.MassFlowRate Q5eH2O(start=10)
-    "Steam mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eCO(start=10)
-    "CO mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eCO2(start=10)
-    "CO2 mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eO2(start=10)
-    "O2 mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eN2(start=10)
-    "N2 mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eSO2(start=10)
-    "SO2 mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eHCl(start=10)
-    "HCl mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eHF(start=10)
-    "HF mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5ecend(start=10)
-    "Ashes mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eam(start=10)
-    "Total mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5od(start=10) "O mass flow rate available in zone 5";
-  Units.SI.MassFlowRate Q5cd(start=10) "C mass flow rate available in zone 5";
-  Units.SI.MassFlowRate Q5hd(start=10) "H mass flow rate available in zone 5";
-  Units.SI.MassFlowRate Q5ost(start=10)
-    "Stoechiométrique O mass flow rate for zone 5";
-  Real exc5(start=0.1) "Air excess for zone 5";
-  Units.SI.Power P5(start=1e6) "Power released by oxydation in zone 5";
-  Units.SI.MassFlowRate Q5sCO2(start=10)
-    "CO2 mass flow rate at the outlet of zone 5";
-  Units.SI.MassFlowRate Q5sO2(start=10)
-    "O2 mass flow rate at the outlet of zone 5";
-  Units.SI.MassFlowRate Q5sCO(start=10)
-    "CO mass flow rate at the outlet of zone 5";
-  Units.SI.Power P5s(start=1e6) "Power released by oxydation in zone 5";
-  Real XsfCO(start=0.1) "Flue gases CO mass fraction at the outlet of zone 5";
-  Real XsfN21(start=0.1) "Flue gases N2 mass fraction at the outlet of zone 5";
-  Real XsfHCl(start=0.1) "Flue gases HCl mass fraction at the outlet of zone 5";
-  Real XsfHF(start=0.1) "Flue gases HF mass fraction at the outlet of zone 5";
-  Real XsfCEND(start=0.1) "Ashes mass fraction at the outlet of zone 5";
-  Units.SI.Power P5a(start=1e6) "Power brought by secondary air";
-  Units.SI.Power P5t(start=1e6) "Power accumulated in the flue gases";
-  Real Xcor(start=0.1) "Corrective factor for the flue gases mass fractions";
-  Real X5sH2OC(start=0.1) "Corrected flue gases H2O mass fraction";
-  Real X5sCO2C(start=0.1) "Corrected flue gases CO2 mass fraction";
-  Real X5sO2C(start=0.1) "Corrected flue gases O2 mass fraction";
-  Real X5sSO2C(start=0.1) "Corrected flue gases SO2 mass fraction";
-  Real X5sN2C(start=0.1) "Corrected flue gases N2 mass fraction";
-  Units.SI.Density rhonorm(start=1000)
-    "Density of the outgoing flue gases Masse at 0 deg C and 1 atm";
-  Real FVN0(start=0.1)
-    "Ashes normal volume fraction for the computation of FVN";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca2
-    annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0)));
-  ThermoSysPro.Combustion.Connectors.FuelInlet Com
-    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet port_eau_refroid
-    annotation (Placement(transformation(extent={{70,20},{90,40}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro2
-    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro3
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro4
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro5
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca1
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg "Flue gases outlet"
-    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
-equation
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Tsf = Cfg.T;
-  Psf = Cfg.P;
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Primary air inlet */
-  Qeap = Ca1.Q;
-  Peap = Ca1.P;
-  Peap = Psf;
-  Teap = Ca1.T;
-  XeapCO2 = Ca1.Xco2;
-  XeapH2O = Ca1.Xh2o;
-  XeapO2 = Ca1.Xo2;
-  XeapN2 = 1 - Ca1.Xco2 - Ca1.Xh2o - Ca1.Xo2 - Ca1.Xso2;
-  XeapSO2 = Ca1.Xso2;
-
-  /* Secondary air inlet */
-  Qeas = Ca2.Q;
-  Peas = Ca2.P;
-  Peas = Psf;
-  Teas = Ca2.T;
-  XeasCO2 = Ca2.Xco2;
-  XeasH2O = Ca2.Xh2o;
-  XeasO2 = Ca2.Xo2;
-  XeasN2 = 1 - Ca2.Xco2 - Ca2.Xh2o - Ca2.Xo2 - Ca2.Xso2;
-  XeasSO2 = Ca2.Xso2;
-
-  /* Biomass */
-  Qeom = Com.Q;
-  Teom = Com.T;
-  PCIom = Com.LHV;
-  XCeom = Com.Xc;
-  XHeom = Com.Xh;
-  XOeom = Com.Xo;
-  XNeom = Com.Xn;
-  XSeom = Com.Xs;
-  XCENDeom = Com.Xashes;
-  XH2Oeom = Com.hum;
-  Cpom = Com.cp;
-
-  /* Cooling water */
-  Qerefo = port_eau_refroid.Q;
-  Herefo = port_eau_refroid.h;
-  port_eau_refroid.h = port_eau_refroid.h_vol;
-
-  /* Primary air mass flow rates */
-  X1eap = 1 - X2eap - X3eap;
-  Q1eap = Qeap*X1eap;
-  Q2eap = Qeap*X2eap;
-  Q3eap = Qeap*X3eap;
-
-  /* Recirculated flue gases fow rates */
-  Qfrecirc = Qsf*Xrecirc;
-
-  /* Carbon distribution */
-  XCvol2 = XCeom*XCvol;
-  XMACHimb = XCeom*XCimb;
-  XCvol3 = XCeom*(1 - XCvol - XCimb);
-
-  //--------------------------------------------------------------------
-  // 1st zone : Drying
-  //------------------
-
-  /* Primary air specific enthalpy at Teap */
-  Heap = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teap, XeapCO2, XeapH2O, XeapO2, XeapSO2);
-
-  /* Secondary air specific enthalpy at à Teas */
-  Heas = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teas, XeasCO2, XeasH2O, XeasO2, XeasSO2);
-
-  /* Primary air specific enthalpy at T1sfm */
-  H1a = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T1sfm, XeapCO2, XeapH2O, XeapO2, XeapSO2);
-
-  /* Specific enthalpy of the incoming recirculated flue gases */
-  XsfN2recirc = 1 - XfCO2recirc - XfH2Orecirc - XfO2recirc - XfSO2recirc;
-  Hefrecirc = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfrecirc, XfCO2recirc, XfH2Orecirc, XfO2recirc, XfSO2recirc);
-
-  /* Mass flow rate of the secondary air / flue gases recirculated mixture */
-  Qeasm = Qeas + Qfrecirc;
-
-  /* Mixture */
-  if (Qeasm <= 0) then
-    XeasmO2 = 0;
-    XeasmCO2 = 0;
-    XeasmH2O = 0;
-    XeasmSO2 = 0;
-    XeasmN2 = 0;
-    Heasm = 1e3;
-    Teasm = 274.15;
-  else
-    XeasmO2 = (XfO2recirc*Qfrecirc + XeasO2*Qeas)/Qeasm;
-    XeasmCO2 = (XfCO2recirc*Qfrecirc)/Qeasm;
-    XeasmH2O = (XfH2Orecirc*Qfrecirc + XeasH2O*Qeas)/Qeasm;
-    XeasmSO2 = (XfSO2recirc*Qfrecirc)/Qeasm;
-    XeasmN2 = 1 - XeasmO2 - XeasmSO2 - XeasmH2O - XeasmSO2;
-    Heasm = (Qeasm*Heas+Qfrecirc*Hefrecirc)/Qeasm;
-    // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-    Heasm = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Teasm, XeasmCO2, XeasmH2O, XeasmO2, XeasmSO2);
-  end if;
-
-  /* Specific enthalpy of the water in the biomass */
-  pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, Teom, mode);
-  Heauom = pro1.h;
-
-  /* Water phase transition energy at Teom */
-  Psateom = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Teom);
-  pro2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 2);
-  Hvteom = pro2.h;
-  pro3 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 1);
-  Hlteom = pro3.h;
-
-  Hvapteom = Hvteom - Hlteom;
-
-  /* Specific enthalpy of the water in the biomass */
-  pro4 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psf, T1sfm, 0);
-  Hs1vom = pro4.h;
-
-  /* Specific enthalpy of the biomass at Teom */
-  Heom = Cpom*(Teom - 273.15);
-
-  /* Flue gases formation energy */
-  Wff = Qeom*(HfCO2*XCeom + HfH2Og*XHeom*9 + HfSO2*XSeom/32.1*64.1 + HfH2Og*XH2Oeom);
-
-  /* Pyrolisis power of the biomass */
-  Wp = Wff - Qeom*PCIom/(1 - perte) - Qeom*HfH2Ol*XH2Oeom;
-
-  /* Power saved by the combustion gases due to the non-destruction of unburnty particles */
-  Wimbp = Wp*XCimb;
-
-  /* Power lost by the combustion gases due to the non-combusiton of C */
-  Wimbm = Qeom*XCeom*HfCO2*XCimb;
-
-  /* Pyrolisis enthalpy */
-  Hpyr = Wp/(Qeom*(1 - XH2Oeom));
-
-  /* Specific enthalpy of the dry biomasss at the biomass pyrolysis temperature */
-  H1om = Hpyr + Heom;
-
-  /* Mass flow rates at the outlet of zone 1 */
-  Q1H2O = Qeom*XH2Oeom + Q1eap*XeapH2O + Qerefo;
-  Q1O2 = Q1eap*XeapO2;
-  Q1N2 = Q1eap*XeapN2;
-  Q1CO2 = Q1eap*XeapCO2;
-  Q1SO2 = Q1eap*XeapSO2;
-  Q1g = Q1H2O + Q1O2 + Q1N2 + Q1CO2 + Q1SO2;
-  Q2eom = Qeom*(1 - XH2Oeom);
-
-  /* Correction after drying */
-  PCI1om = PCIom/(1 - XH2Oeom);
-  X1MACHom = XMACHeom/(1 - XH2Oeom);
-  XC1vol2 = XCvol2/(1 - XH2Oeom);
-  XC1vol3 = XCvol3/(1 - XH2Oeom);
-  X1MACHimb = XMACHimb/(1 - XH2Oeom);
-  X1H = XHeom/(1 - XH2Oeom);
-  X1O = XOeom/(1 - XH2Oeom);
-  X1N = XNeom/(1 - XH2Oeom);
-  X1Cl = XCleom/(1 - XH2Oeom);
-  X1F = XFeom/(1 - XH2Oeom);
-  X1S = XSeom/(1 - XH2Oeom);
-  X1CEND = XCENDeom/(1 - XH2Oeom);
-
-  /* Ashes mass flow rate in the biomass */
-  Qcendom = XCENDeom*Qeom;
-
-  /* Ashes mass fraction in the flue gases */
-  Xfcend = Qcendom/Qsf;
-
-  /* Power captured in zone 1 */
-  P1g = Qeom*XH2Oeom*Hs1vom + Qeom*XH2Oeom*Hvapteom + Q1eap*H1a + Qerefo*Hs1vom;
-
-  //--------------------------------------------------------------------
-  // 2nd zone : Combustion
-  //----------------------
-
-  /* Outgoing flue gases mass flow rate after combustion */
-  /* Oxygen brought by air and the biomass */
-  Q2eo = Q2eom*X1O + Q2eap*XeapO2;
-
-  /* Outgoing mass flow rates */
-  Q2HCl = 36.5/35.5*Q2eom*X1Cl;
-  Q2HF = 20/19*Q2eom*X1F;
-  Q2SO2 = 64/32*Q2eom*X1S + Q2eap*XeapSO2;
-  Q2H2O = 18/2*Q2eom*(X1H - 1/35.5*X1Cl - 1/19*X1F) + Q2eap*XeapH2O;
-  Q2CO = 28/12*Q2eom*XC1vol2;
-  Q2N2 = Q2eo*X1N + Q2eap*XeapN2;
-  Q2O2 = Q2eo - Q2eom*(X1S + 16/2*(X1H - 1/35.5*X1Cl - 1/19*X1F) + 16/12*XC1vol2);
-  Q2cend = Q2eom*X1CEND;
-  Q2CO2 = Q2eap*XeapCO2;
-
-  /* Total mass flow rate after combustion */
-  Q2g = Q2HCl + Q2HF + Q2SO2 + Q2H2O + Q2CO + Q2N2 + Q2O2 + Q2cend + Q2CO2;
-
-  /* Correction after combustion */
-  Epsivol = XC1vol2 + X1H + X1O + X1S + X1Cl + X1F + X1N + X1CEND;
-  Q3eom = Q2eom*(1 - Epsivol);
-  X2MACHom = X1MACHom/(1 - Epsivol);
-  XC2vol3 = XC1vol3/(1 - Epsivol);
-  X2MACHimb = X1MACHimb/(1 - Epsivol);
-
-  /* Power released by the combustion */
-  PCICsol = (XC1vol3 + X1MACHimb)*HfCO2;
-  PCICvol = XC1vol2*(HfCO2 - HfCO);
-  H2 = PCI1om - PCICsol - PCICvol;
-  P2g = H2*Q2eom+(Q2H2O - (Q2eap*XeapH2O))*H0v + Wimbp;
-
-  P1o = Qeom*(1 - XH2Oeom)*(H1om - Heom);
-  P1v = Qeom*XH2Oeom*(Hs1vom - Hlteom);
-  P1a = Q1eap*(H1a - Heap);
-  P1r = Qerefo*(Hs1vom - Herefo);
-
-  Eray0 = (P1o + P1v + P1a + P1r)/P2g;
-
-  /* Temperature at the outlet of zone 2 */
-  /* Mass fraction at the outlet */
-  X2O2 = Q2O2/Q2g;
-  X2SO2 = Q2SO2/Q2g;
-  X2CO2 = Q2CO/Q2g;
-  X2H2O = Q2H2O/Q2g;
-  X2N2 = 1 - (X2O2 + X2SO2 + X2CO2 + X2H2O);
-
-  /* Specific enthalpy and temperature at the outlet of zone 2 */
-  H2g = (Q2eap*Heap + Q2eom*H1om + P2g*(1 - Eray0 - Eray2) - Q3eom*CpMACHs2*(T2 - 273.15))/Q2g;
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  H2g = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T2, X2CO2, X2H2O, X2O2, X2SO2);
-
-  //--------------------------------------------------------------------
-  // 3rd zone : Clinker cooling
-  //---------------------------
-
-  /* Oxydation of the clinkler carbon into CO and/or CO2 */
-  Q3od = Q3eap*XeapO2;
-  Q3cd = Q3eom*XC2vol3;
-  taux3oc = Q3od/Q3cd;
-
-  /* taux3oc >= 32/12 => all C is transformed into CO2 */
-  if (taux3oc >= 32/12) then
-    /* Mass flow rates */
-    Q3CO2 = 44/12*Q3cd + Q3eap*XeapCO2;
-    Q3CO = 0;
-    Q3O2 = Q3od - 32/12*Q3cd;
-    Q3N2 = Q3eap*XeapN2;
-    Q3H2O = Q3eap*XeapH2O;
-    Q3SO2 = Q3eap*XeapSO2;
-
-    /* Power released */
-    P3s = Q3cd*HfCO;
-    P3g = Q3cd*(HfCO2 - HfCO);
-
-    /* Enthalpy released */
-    H3s = P3s/Q3eom;
-    H3g = P3g/Q3eom;
-    XC2vol31 = XC2vol3;
-    XC2vol4 = XC2vol3;
-
-  /* 16/12 <= taux3oc <= 32/12 => all C is transformed into CO plus a fraction into CO2 */
-  elseif ((taux3oc >= 16/12) and (taux3oc < 32/12)) then
-    /* Mass flow rates */
-    Q3CO2 = 44/12*(Q3od - 16/12*Q3cd) + Q3eap*XeapCO2;
-    Q3CO = 28/12*Q3cd - 28/16*(Q3od - 16/12*Q3cd);
-    Q3O2 = 0;
-    Q3N2 = Q3eap*XeapN2;
-    Q3H2O = Q3eap*XeapH2O;
-    Q3SO2 = Q3eap*XeapSO2;
-
-    /* Power released */
-    P3s = Q3cd*HfCO;
-    P3g = (12/16*Q3od - Q3cd)*(HfCO2 - HfCO);
-
-    /* Enthalpy released */
-    H3s = P3s/Q3eom;
-    H3g = P3g/Q3eom;
-    XC2vol31 = XC2vol3;
-    XC2vol4 = XC2vol3;
-
-  /* taux3oc < 16/12 => partial oxydation into CO */
-  else
-    /* Mass flow rates */
-    Q3CO2 = 0;
-    Q3CO = 28/16*Q3od;
-    Q3O2 = 0;
-    Q3N2 = Q3eap*XeapN2;
-    Q3H2O = Q3eap*XeapH2O;
-    Q3SO2 = Q3eap*XeapSO2;
-
-    /* Power released */
-    P3s = 12/16*Q3od*HfCO;
-    P3g = 0;
-
-    /* Enthalpy released */
-    H3s = P3s/Q3eom;
-    H3g = P3g/Q3eom;
-    XC2vol31 = XC2vol3*12/16*taux3oc;
-    XC2vol4 = XC2vol3;
-end if;
-
-  /* Correction after coke combustion */
-  Q3g = Q3CO2 + Q3CO + Q3H2O + Q3O2 + Q3N2 + Q3SO2;
-  Q4eom = Q3eom*(1 - XC2vol31);
-  X4MACHom = X2MACHom/(1 - XC2vol31);
-  X4MACHimb = X2MACHimb/(1 - XC2vol31) + (XC2vol4 - XC2vol31)/(1 - XC2vol31);
-
-  /* Clinker temperature at the outlet of zone 3 */
-  Cp3a = (ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, (T2 + Teap)/2, X2CO2, X2H2O, X2O2, X2SO2))/((T2 + Teap)/2);
-  T3o - 273.15 = (Q3eap*Heap + Q3eom*CpMACHs2*(T2 - 273.15)-
-      (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*(T2 - 273.15)/2-
-      (28/12)*Q3eom*XC2vol31*Cp3CO*(T2 - 273.15)/2 + P3s)/
-      (Q3eap*Cp3a/2 + (28/12)*Q3eom*XC2vol31*Cp3CO/2 + Q4eom*CpMACHs3);
-  P3ac = (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*((T2 - 273.15) + (T3o - 273.15))/2;
-  P3co = (28/12)*Q3eom*XC2vol31*Cp3CO*((T2 - 273.15) + (T3o - 273.15))/2;
-  P3 = P3g + P3ac + P3co;
-
-  //--------------------------------------------------------------------
-  // 4th zone : Water seal
-  //----------------------
-
-  /* Steam mass flow rate generated by the water seal */
-  if (jointeau == 1) then
-    T4o = TsjeMACH;
-    TsMACH = TsjeMACH;
-    T4er = Teeje;
-    X4H2O = XsjeH2OMACH;
-    Cp4liq = 4180;
-    P4m = Q4eom*CpMACHs4*((T3o - 273.15) - (T4o - 273.15));
-    P4h = Q4eom*X4H2O*Cp4liq*((T4o - 273.15) - (T4er - 273.15));
-    Q4v = rendje*(P4m - P4h)/(Cp4liq*(373.15 - (T4er - 273.15)) + Hvapo);
-    pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2);
-    H4 = pro5.h;
-    P4v = Q4v*pro5.h;
-  else
-    T4o = 273.15;
-    TsMACH = T3o;
-    T4er = 273.15;
-    X4H2O = 0;
-    Cp4liq = 0;
-    P4m = 0;
-    P4h = 0;
-    Q4v = 0;
-    pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2);
-    H4 = pro5.h;
-    P4v = 0;
-  end if;
-
-  /* Clinker mass flow rate at the outlet */
-  QsMACH = Q4eom;
-
-  /* Clinker LHV at the outlet */
-  PCIMACH = (Wimbm - Wimbp)/QsMACH;
-
-  //--------------------------------------------------------------------
-  // 5th zone : Post-combustion
-  //---------------------------
-
-  /* Excess air of the combustion */
-  QO2p = Qsf*XsfO2;
-  Qairp = QO2p/XeapO2*(1 - XeapH2O);
-  Qairs = (Qeap + Qeas) - Qairp;
-  excair = (Qairp/Qairs)*100;
-
-  /* Gases mass flow rates before mixing in zone 5 */
-  Q5eH2O = Q1H2O + Q2H2O + Q3H2O + Q4v + Qeasm*XeasmH2O;
-  Q5eCO = Q2CO + Q3CO;
-  Q5eCO2 = Q3CO2 + Q1CO2 + Q2CO2 + Qeasm*XeasmCO2;
-  Q5eO2 = Q1O2 + Q2O2 + Q3O2 + Qeasm*XeasmO2;
-  Q5eN2 = Q1N2 + Q2N2 + Q3N2 + Qeasm*XeasmN2;
-  Q5eSO2 = Q1SO2 + Q2SO2 + Q3SO2 + Qeasm*XeasmSO2;
-  Q5eHCl = Q2HCl;
-  Q5eHF = Q2HF;
-  Q5ecend = Q2cend;
-  Q5eam = Q5eH2O + Q5eCO + Q5eCO2 + Q5eO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend;
-
-  /* Oxydation of the CO remaining in zone 5 */
-  Q5od = Q5eO2 + 16/18*Q5eH2O + 32/44*Q5eCO2 + 16/28*Q5eCO;
-  Q5cd = 12/44*Q5eCO2 + 12/28*Q5eCO;
-  Q5hd = 2/18*Q5eH2O;
-  Q5ost = 16/2*Q5hd + 32/12*Q5cd;
-  exc5 = Q5od/Q5ost;
-
-  /* Total oxydation of the remaining CO */
-  if (exc5 > 1) then
-    P5 = 12/28*Q5eCO*(HfCO2 - HfCO);
-    Q5sCO2 = Q5eCO2 + 44/28*Q5eCO;
-    Q5sO2 = Q5eO2 - 16/28*Q5eCO;
-    Q5sCO = 0;
-
-  /* Partial oxydation of the remaining CO */
-  else
-    P5 = Q5eO2*12/16*(HfCO2 - HfCO);
-    Q5sCO2 = Q5eCO2 + 44/16*Q5eO2;
-    Q5sO2 = 0;
-    Q5sCO = Q5eCO - 28/16*Q5eO2;
-  end if;
-
-  /* Flue gases total mass flow rate at the outlet */
-  Qsf = Q5eH2O + Q5sCO + Q5sCO2 + Q5sO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend;
-
-  /* Power available in the flue gases */
-  P5s = P5*(1 - Eray5);
-
-  /* Flue gases mass fractions at the outlet */
-  XsfH2O = Q5eH2O/Qsf;
-  XsfCO = Q5sCO/Qsf;
-  XsfCO2 = Q5sCO2/Qsf;
-  XsfO2 = Q5sO2/Qsf;
-  XsfSO2 = Q5eSO2/Qsf;
-  XsfN21 = Q5eN2/Qsf;
-  XsfHCl = Q5eHCl/Qsf;
-  XsfHF = Q5eHF/Qsf;
-  XsfCEND = Q5ecend/Qsf;
-  XsfN2 = 1 - (XsfCO2 + XsfH2O + XsfO2 + XsfSO2);
-
-  /* Power accumulated by the flue gases in zone 5 */
-  P5a = Qeasm*Heasm;
-  P5t = P1g + H2g*Q2g + P3 + P4v + P5s + P5a;
-
-  /* Power radiated */
-  Wsr = P5s*Eray5/(1 - Eray5) + P2g*Eray2;
-
-  /* Flue gases temperature at the outlet */
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  P5t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Ashes volume mass */
-  rhocend = rhoCENDom;
-
-  /* Normal voulme fraction of the volatile ashes */
-  Xcor = 1/(1 - XsfH2O);
-  X5sH2OC = 0;
-  X5sCO2C = XsfCO2*Xcor;
-  X5sO2C = XsfO2*Xcor;
-  X5sSO2C = XsfSO2*Xcor;
-  X5sN2C = 1 - (X5sH2OC + X5sCO2C + X5sO2C + X5sSO2C);
-  rhonorm = ThermoSysPro.Properties.FlueGases.FlueGases_rho(1.01325e5, 273.15, X5sCO2C, X5sH2OC, X5sO2C, X5sSO2C);
-  FVN0 = (Qcendom/rhocend)/(Qsf/rhonorm);
-  0 = if ((FVN0 < 0) or (FVN0 > 0.1)) then (FVN - 0.001) else (FVN - FVN0);
-
-  annotation (Diagram(graphics={Polygon(
-          points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80},
-              {-40,80},{-40,40},{-80,20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}},
-          lineColor={0,0,255},
-          fillColor={175,175,175},
-          fillPattern=FillPattern.Solid)}),
-                            Icon(graphics={Polygon(
-          points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80},
-              {-40,80},{-40,40},{-80,20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}},
-          lineColor={0,0,255},
-          fillColor={175,175,175},
-          fillPattern=FillPattern.Solid)}),
-    DymolaStoredErrors,
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-end GridFurnace;
+within ThermoSysPro.Combustion.CombustionChambers;
+model GridFurnace "Combustion furnace"
+  parameter Real X2eap=0.1 "Primary air fraction in zone 2";
+  parameter Real X3eap=0.1 "Primary air fraction in zone 3";
+  parameter Real XCleom=0 "Cl mass fraction in the biomass";
+  parameter Real XFeom=0 "F mass fraction in the biomass";
+  parameter Real XMACHeom=0 "machefers mass fraction in the biomass";
+  parameter Units.SI.Density rhoCENDom=0.5
+    "Density of the ashes in the biomass";
+  parameter Units.SI.Temperature Tfrecirc=600
+    "Temperature of the recirculated flue gases";
+  parameter Real XfCO2recirc=0.3
+    "CO2 mass fraction in the recirculated flue gases";
+  parameter Real XfH2Orecirc=0.1
+    "H2O mass fraction in the recirculated flue gases";
+  parameter Real XfO2recirc=0.2
+    "O2 mass fraction in the recirculated flue gases";
+  parameter Real XfSO2recirc=0
+    "SO2 mass fraction in the recirculated flue gases";
+  parameter Real Xrecirc=0.1 "Recirculated flue gases fraction in Qsf";
+  parameter Units.SI.SpecificHeatCapacity CpMACH=500
+    "Clinker average specific heat capacity";
+  parameter Units.SI.SpecificHeatCapacity CpMACHs2=500
+    "Clinker specific heat capacity at the outlet of zone 2";
+  parameter Units.SI.SpecificHeatCapacity CpMACHs3=500
+    "Clinker specific heat capacity at the outlet of zone 3";
+  parameter Units.SI.SpecificHeatCapacity CpMACHs4=500
+    "Clinker specific heat capacity at the outlet of zone 4";
+  parameter Units.SI.Temperature TsjeMACH=293
+    "Clinker temperature at the outlet of the water seal";
+  parameter Units.SI.Temperature Teeje=293
+    "Water temperature at the outlet of the water seal";
+  parameter Real XsjeH2OMACH=0.2
+    "Clinker humidity at the outlet of the water seal";
+  parameter Real rendje=1 "Water seal efficiency";
+  parameter Integer jointeau=0 "1: with water seal - 0: without water seal";
+  parameter Real XCvol=0 "Volatile carbon fraction";
+  parameter Real XCimb=0 "Unburnt carbon fraction";
+  parameter Units.SI.Temperature T1sfm=500
+    "Flue gases temperature at the outlet of zone 1";
+  parameter Real Eray2=0.1
+    "Energy fraction radiated towards zone 2 of the furnace";
+  parameter Real Eray5=0.1
+    "Energy fraction radiated towards zone 5 of the furnac";
+  parameter Real perte=0 "Loss percent of LHV";
+  parameter Units.SI.SpecificHeatCapacity Cp3CO=500
+    "CO specific heat capacity in zone 3";
+
+public
+  Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet";
+  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1000) "Flue gases temperature at the outlet";
+  Real XsfN2(start=0.6) "Flue gases N2 mass fraction at the outlet";
+  Real XsfCO2(start=0.1) "Flue gases CO2 mass fraction at the outlet";
+  Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet";
+  Real XsfO2(start=0.1) "Flue gases O2 mass fraction at the outlet";
+  Real XsfSO2(start=0.1) "Flue gases SO2 mass fraction at the outlet";
+  Units.SI.MassFlowRate Qeap(start=10) "Primary air mass flow rate";
+  Units.SI.AbsolutePressure Peap(start=1e5) "Primary air pressure";
+  Units.SI.Temperature Teap(start=300) "Primary air temperature";
+  Real XeapN2(start=0.6) "Primary air N2 mass fraction";
+  Real XeapCO2(start=0.1) "Primary air CO2 mass fraction";
+  Real XeapH2O(start=0.1) "Primary air H2O mass fraction";
+  Real XeapO2(start=0.1) "Primary air O2 mass fraction";
+  Real XeapSO2(start=0.1) "Primary air SO2 mass fraction";
+  Units.SI.MassFlowRate Qeas(start=10) "Secondary air mass flow rate";
+  Units.SI.AbsolutePressure Peas(start=1e5) "Secondary air pressure";
+  Units.SI.Temperature Teas(start=300) "Secondary air temperature";
+  Real XeasN2(start=0.6) "Secondary air N2 mass fraction";
+  Real XeasCO2(start=0.1) "Secondary air CO2 mass fraction";
+  Real XeasH2O(start=0.1) "Secondary air H2O mass fraction";
+  Real XeasO2(start=0.1) "Secondaryr O2 mass fraction";
+  Real XeasSO2(start=0.1) "Secondary SO2 mass fraction";
+  Units.SI.MassFlowRate Qeom(start=10) "Biomass mass flow rate";
+  Units.SI.Temperature Teom(start=300) "Biomass temperature";
+  Real PCIom(start=1e6) "Biomass LHV (J/kg)";
+  Real XCeom(start=0.1) "Biomass C mass fraction";
+  Real XHeom(start=0.1) "Biomass H mass fraction";
+  Real XOeom(start=0.1) "Biomass O mass fraction";
+  Real XNeom(start=0.01) "Biomass N mass fraction";
+  Real XSeom(start=0.1) "Biomass S mass fraction";
+  Real XCENDeom(start=0.1) "Biomass ashes mass fraction";
+  Real XH2Oeom(start=0.1) "Biomass humidity";
+  Units.SI.SpecificHeatCapacity Cpom(start=1000)
+    "Biomass specific heat capacity";
+  Units.SI.MassFlowRate Qerefo(start=10) "Cooling water mass flow rate";
+  Units.SI.SpecificEnthalpy Herefo(start=10e3)
+    "Cooling water specific enthalpy";
+  Units.SI.MassFlowRate Qfrecirc(start=10)
+    "Recirculated flue gases mass flow rate";
+  Real XsfN2recirc(start=0.1) "Recirculated flue gases N2 mass fraction";
+  Real PCIMACH(start=10e6) "Clinker LHV";
+  Units.SI.MassFlowRate QsMACH(start=10) "Clinker mass flow rate";
+  Units.SI.Temperature TsMACH(start=500) "Clinket temperature";
+  Real FVN(start=0.1) "Volatile ashes mass fraction";
+  Units.SI.Density rhocend(start=500) "Ashes density in the flue gases";
+  Units.SI.Power Wsr(start=10e6) "Radiated power";
+  Real excair(start=0.1) "Combustion excess air";
+
+protected
+  constant Units.SI.SpecificEnthalpy H0v=2501551.43
+    "Vaporisation energy at 0°C";
+  constant Units.SI.SpecificEnthalpy HfCO2=3.2791664e7 "CO2 formation enthalpy";
+  constant Units.SI.SpecificEnthalpy HfCO=9.201e6 "CO formation enthalpy";
+  constant Units.SI.SpecificEnthalpy HfH2Og=13.433333e6
+    "H2Og formation enthalpy";
+  constant Units.SI.SpecificEnthalpy HfSO2=4.6302650e6 "SO2 formation enthalpy";
+  constant Units.SI.SpecificEnthalpy HfH2Ol=15.883300e6
+    "H2Ol formation enthalpy";
+
+public
+  Real X1eap(start=0.1) "Primary air fraction in zone 1";
+  Units.SI.MassFlowRate Q1eap(start=10) "Primary mass flow rate in zone 1";
+  Units.SI.MassFlowRate Q2eap(start=10) "Primary mass flow rate in zone 2";
+  Units.SI.MassFlowRate Q3eap(start=10) "Primary mass flow rate in zone 3";
+  Real XCvol2(start=0.1) "C mass fraction burnt in zone 2";
+  Real XMACHimb(start=0.1) "C mass raction unburnt in the clinker";
+  Real XCvol3(start=0.1) "C mass fraction burnt in zone 3";
+
+//Zone1
+  Units.SI.SpecificEnthalpy Heap(start=1e3)
+    "Humid air specific enthalpy at the primary air temperature";
+  Units.SI.SpecificEnthalpy Heas(start=1e3)
+    "Humid air specific enthalpy at the secondary air temperature";
+  Units.SI.SpecificEnthalpy H1a(start=1e3)
+    "Primary air specific enthalpy at T1sfm";
+  Units.SI.SpecificEnthalpy Hefrecirc(start=1e3)
+    "Specific enthalpy of the incoming recirculated flue gases";
+  Units.SI.MassFlowRate Qeasm(start=10)
+    "Mass flow rate of the secondary air / recirculated flue gases mixture";
+  Units.SI.SpecificEnthalpy Heasm(start=1e3)
+    "Specific enthalpy of the secondary air / recirculated flue gases mixture";
+  Units.SI.Temperature Teasm(start=500)
+    "Temperature of the secondary air / recirculated flue gases mixture";
+  Real XeasmO2(start=0.1)
+    "O2 mass fraction in the secondary air / recirculated flue gases mixture";
+  Real XeasmCO2(start=0.1)
+    "CO2 mass fraction in the secondary air / recirculated flue gases mixture";
+  Real XeasmH2O(start=0.1)
+    "H2O mass fraction in the secondary air / recirculated flue gases mixture";
+  Real XeasmSO2(start=0.1)
+    "SO2 mass fraction in the secondary air / recirculated flue gases mixture";
+  Real XeasmN2(start=0.1)
+    "N2 mass fraction in the secondary air / recirculated flue gases mixture";
+  Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  Units.SI.SpecificEnthalpy Heauom(start=1e3) "Biomass water specific enthalpy";
+  Units.SI.AbsolutePressure Psateom(start=1e5)
+    "Water saturation presure at Teom";
+  Units.SI.SpecificEnthalpy Hvteom(start=10e3)
+    "Steam saturation specific enthalpy at Teom";
+  Units.SI.SpecificEnthalpy Hlteom(start=10e3)
+    "Water saturation specific enthalpy at Teom";
+  Units.SI.SpecificEnthalpy Hvapteom(start=10e3)
+    "Phase transition energy at Teom";
+  Units.SI.SpecificEnthalpy Hs1vom(start=1e3)
+    "Water specific enthalpy of the outgoing biomass at T1sfm vapor";
+  Units.SI.SpecificEnthalpy Heom(start=1e3)
+    "Biomass specific enthalpy at the inlet";
+  Units.SI.Power Wff(start=1e6) "Flue gases formation energy";
+  Units.SI.Power Wp(start=1e6) "Biomass pyrolysis power";
+  Units.SI.Power Wimbp(start=1e6)
+    "Power saved in the combustion flue gases due to the non-destruction of unburnt C";
+  Units.SI.Power Wimbm(start=1e6)
+    "Power lost by the combustion flue gases due to the non-combustion of unburnt C";
+  Units.SI.SpecificEnthalpy Hpyr(start=1e3) "Pyrolysis specific enthalpy";
+  Units.SI.SpecificEnthalpy H1om(start=1e3)
+    "Specific enthalpy of the dry biomass at the pyrolysis temperature of the biomass";
+  Units.SI.MassFlowRate Q1H2O(start=10)
+    "H2O mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1O2(start=10)
+    "O2 mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1N2(start=10)
+    "N2 mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1CO2(start=10)
+    "CO2 mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1SO2(start=10)
+    "SO2 mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1g(start=10)
+    "Total mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q2eom(start=10)
+    "Biomass mass flow rate at the inlet of zone 2";
+  Real PCI1om(start=1e6) "LHV after drying";
+  Real X1MACHom(start=0.1) "Clinker mass fraction in the biomass after drying";
+  Real XC1vol2(start=0.1) "Burnt C mass fraction in zone 2 after drying";
+  Real XC1vol3(start=0.1) "Burnt C mass fraction in zone 3 after drying";
+  Real X1MACHimb(start=0.1)
+    "Unburnt C mass fraction in the clinker after drying";
+  Real X1H(start=0.1) "H mass fraction in the biomass after drying";
+  Real X1O(start=0.1) "O mass fraction in the biomass after drying";
+  Real X1N(start=0.1) "N mass fraction in the biomass after drying";
+  Real X1Cl(start=0.1) "Cl mass fraction in the biomass after drying";
+  Real X1F(start=0.1) "F mass fraction in the biomass after drying";
+  Real X1S(start=0.1) "S mass fraction in the biomass after drying";
+  Real X1CEND(start=0.1) "Ashes mass fraction in the biomass after drying";
+  Units.SI.MassFlowRate Qcendom(start=10) "Ashes mass flow rate";
+  Real Xfcend(start=0.1) "Ashes mass fraction in the flue gases";
+  Units.SI.Power P1g(start=1e6) "Power saved in zone 1";
+
+//Zone 2
+  Units.SI.MassFlowRate Q2eo(start=10)
+    "Mass flow rate of the oxygen carried by the air and the biomass at the inlet of zone 2";
+  Units.SI.MassFlowRate Q2HCl(start=10)
+    "Combustion HCl mass fraction in zone 2";
+  Units.SI.MassFlowRate Q2HF(start=10)
+    "Combustion HF mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2SO2(start=10)
+    "Combustion SO2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2H2O(start=10)
+    "Combustion H2O mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2CO(start=10)
+    "Combustion CO mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2N2(start=10)
+    "Combustion N2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2O2(start=10)
+    "Combustion O2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2cend(start=10)
+    "Combustion ashes mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2CO2(start=10)
+    "Combustion CO2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2g(start=10)
+    "Elements total mass flow rate after combustion";
+  Real Epsivol(start=0.1) "Volatile matter mass fraction produced in zone 2";
+  Units.SI.MassFlowRate Q3eom(start=10) "Solid matter at the inlet of zone 3";
+  Real X2MACHom(start=0.1)
+    "Clinker mass fraction of the biomass after volatilisation";
+  Real XC2vol3(start=0.1)
+    "C mass fraction burnt in zone 3 after volatilisation";
+  Real X2MACHimb(start=0.1)
+    "Unburnt C mas fraction in the clinker after volatilisation";
+  Real PCICsol(start=1e6) "LHV of the solid outgoing carbon";
+  Real PCICvol(start=1e6) "LHV of the volatile carbon transformed into CO";
+  Units.SI.SpecificEnthalpy H2(start=1e3) "Enthalpy released in zone 2";
+  Units.SI.Power P2g(start=1e6) "Power released by the combustion in zone 2";
+  Units.SI.Power P1o(start=1e6) "Power captured by the biomass";
+  Units.SI.Power P1v(start=1e6) "Power captured by the steam";
+  Units.SI.Power P1a(start=1e6) "Power captured by the air";
+  Units.SI.Power P1r(start=1e6) "Power captured by the cooling water";
+  Real Eray0(start=0.2)
+    "Fraction of the radiated power from zone 2 unused for the drying";
+  Real X2O2(start=0.1) "O2 mass fraction at the oultet of zone 2";
+  Real X2SO2(start=0.1) "SO2 mass fraction at the oultet of zone 2";
+  Real X2CO2(start=0.1) "CO2 mass fraction at the oultet of zone 2";
+  Real X2H2O(start=0.1) "H2O mass fraction at the oultet of zone 2";
+  Real X2N2(start=0.1) "N2 mass fraction at the oultet of zone 2";
+  Units.SI.SpecificEnthalpy H2g(start=1200000)
+    "Flue gases specific enthalpy at the oultet of zone 2";
+  Units.SI.Temperature T2(start=1000)
+    "Flue gases temperature at the oultet of zone 2";
+
+//Zone 3
+  Units.SI.MassFlowRate Q3od(start=10)
+    "O mass flow rate available for the oxydation of the clinker in CO and/or CO2";
+  Units.SI.MassFlowRate Q3cd(start=10)
+    "C mass flow rate available for the oxydation of the clinker in CO and/or CO2";
+  Real taux3oc(start=0.1)
+    "Ratio of the mass flow rates O/C available for the oxydation of the clinker";
+  Units.SI.MassFlowRate Q3CO2(start=10)
+    "CO2 mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3CO(start=10)
+    "CO mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3O2(start=10)
+    "O2 mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3N2(start=10)
+    "N2 mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3H2O(start=10)
+    "H2O mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3SO2(start=10)
+    "SO2 mass flow rate at the outlet of zone 3";
+  Units.SI.Power P3s(start=1e6) "Power captured by solid matter in zone 3";
+  Units.SI.Power P3g(start=1e6) "Power captured by gaseous matter in zone 3";
+  Units.SI.SpecificEnthalpy H3s(start=1e3)
+    "Gaseous matter specific enthalpy at T3g";
+  Units.SI.SpecificEnthalpy H3g(start=1e3)
+    "Solid matter specific enthalpy at T3o";
+  Real XC2vol31(start=0.1)
+    "C mass fraction burnt in zone 3 after volatilisation";
+  Real XC2vol4(start=0.1) "C mass fraction burnt at the inlet of zone 4";
+  Units.SI.MassFlowRate Q3g(start=10)
+    "Flue gases mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q4eom(start=10)
+    "Clinker mass flow rate at the inlet of zone 4";
+  Real X4MACHom(start=0.1)
+    "Mass flow rate of the biomass clinker after C volatilisation in zone 3";
+  Real X4MACHimb(start=0.1)
+    "Unburnt C mass fraction in the clinker after C volatilisation in zone 3";
+  Units.SI.SpecificHeatCapacity Cp3a(start=1000)
+    "Average specific heat capacity at the inlet of zone 3";
+  Units.SI.Temperature T3o(start=500)
+    "Clinker temperature at the outlet of zone 3";
+  constant Units.SI.SpecificHeatCapacity Cp3g=1100
+    "Average flue gases specific heat capacity at T3g";
+  Units.SI.Power P3ac(start=1e6) "Air power heated at (T2 + T3o)/2";
+  Units.SI.Power P3co(start=1e6) "CO power heated at (T2 + T3o)/2";
+  Units.SI.Power P3(start=1e6) "Total flue gases power at the outlet of zone 3";
+
+//Zone 4
+  Units.SI.Temperature T4o(start=600)
+    "Clinker temperature at the outlet for the water seal";
+  Units.SI.Temperature T4er(start=600)
+    "Water temperature at the inlet of the water seal";
+  Real X4H2O(start=0.1)
+    "H2O mass fraction in the clinker at the outlet of the water seal";
+  Units.SI.SpecificHeatCapacity Cp4liq(start=1000)
+    "Water specific heat capacity at TEej";
+  Units.SI.Power P4m(start=1e6) "Power lost by the clinker during vaporisation";
+  Units.SI.Power P4h(start=1e6) "Power associated to the clinker humidity";
+  Units.SI.MassFlowRate Q4v(start=10)
+    "Steam mass flow rate generated by the water seal";
+  Units.SI.SpecificEnthalpy H4(start=1e3) "Enthalpy in zone 4";
+  Units.SI.Power P4v(start=1e6) "Power captured by the steam in zone 4";
+  constant Units.SI.SpecificEnthalpy Hvapo=2501600 "Vaporisation energy";
+
+//Zone 5
+  Units.SI.MassFlowRate QO2p(start=10)
+    "Flue gases O2 mass flow rate at the outlet";
+  Units.SI.MassFlowRate Qairp(start=10)
+    "Excess air mass flow rate for data Qo2p";
+  Units.SI.MassFlowRate Qairs(start=10) "Stoechiometric air mass flow rate";
+  Units.SI.MassFlowRate Q5eH2O(start=10)
+    "Steam mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eCO(start=10)
+    "CO mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eCO2(start=10)
+    "CO2 mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eO2(start=10)
+    "O2 mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eN2(start=10)
+    "N2 mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eSO2(start=10)
+    "SO2 mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eHCl(start=10)
+    "HCl mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eHF(start=10)
+    "HF mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5ecend(start=10)
+    "Ashes mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eam(start=10)
+    "Total mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5od(start=10) "O mass flow rate available in zone 5";
+  Units.SI.MassFlowRate Q5cd(start=10) "C mass flow rate available in zone 5";
+  Units.SI.MassFlowRate Q5hd(start=10) "H mass flow rate available in zone 5";
+  Units.SI.MassFlowRate Q5ost(start=10)
+    "Stoechiométrique O mass flow rate for zone 5";
+  Real exc5(start=0.1) "Air excess for zone 5";
+  Units.SI.Power P5(start=1e6) "Power released by oxydation in zone 5";
+  Units.SI.MassFlowRate Q5sCO2(start=10)
+    "CO2 mass flow rate at the outlet of zone 5";
+  Units.SI.MassFlowRate Q5sO2(start=10)
+    "O2 mass flow rate at the outlet of zone 5";
+  Units.SI.MassFlowRate Q5sCO(start=10)
+    "CO mass flow rate at the outlet of zone 5";
+  Units.SI.Power P5s(start=1e6) "Power released by oxydation in zone 5";
+  Real XsfCO(start=0.1) "Flue gases CO mass fraction at the outlet of zone 5";
+  Real XsfN21(start=0.1) "Flue gases N2 mass fraction at the outlet of zone 5";
+  Real XsfHCl(start=0.1) "Flue gases HCl mass fraction at the outlet of zone 5";
+  Real XsfHF(start=0.1) "Flue gases HF mass fraction at the outlet of zone 5";
+  Real XsfCEND(start=0.1) "Ashes mass fraction at the outlet of zone 5";
+  Units.SI.Power P5a(start=1e6) "Power brought by secondary air";
+  Units.SI.Power P5t(start=1e6) "Power accumulated in the flue gases";
+  Real Xcor(start=0.1) "Corrective factor for the flue gases mass fractions";
+  Real X5sH2OC(start=0.1) "Corrected flue gases H2O mass fraction";
+  Real X5sCO2C(start=0.1) "Corrected flue gases CO2 mass fraction";
+  Real X5sO2C(start=0.1) "Corrected flue gases O2 mass fraction";
+  Real X5sSO2C(start=0.1) "Corrected flue gases SO2 mass fraction";
+  Real X5sN2C(start=0.1) "Corrected flue gases N2 mass fraction";
+  Units.SI.Density rhonorm(start=1000)
+    "Density of the outgoing flue gases Masse at 0 deg C and 1 atm";
+  Real FVN0(start=0.1)
+    "Ashes normal volume fraction for the computation of FVN";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca2
+    annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0)));
+  ThermoSysPro.Combustion.Connectors.FuelInlet Com
+    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet port_eau_refroid
+    annotation (Placement(transformation(extent={{70,20},{90,40}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro2
+    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro3
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro4
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro5
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca1
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg "Flue gases outlet"
+    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+equation
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Tsf = Cfg.T;
+  Psf = Cfg.P;
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Primary air inlet */
+  Qeap = Ca1.Q;
+  Peap = Ca1.P;
+  Peap = Psf;
+  Teap = Ca1.T;
+  XeapCO2 = Ca1.Xco2;
+  XeapH2O = Ca1.Xh2o;
+  XeapO2 = Ca1.Xo2;
+  XeapN2 = 1 - Ca1.Xco2 - Ca1.Xh2o - Ca1.Xo2 - Ca1.Xso2;
+  XeapSO2 = Ca1.Xso2;
+
+  /* Secondary air inlet */
+  Qeas = Ca2.Q;
+  Peas = Ca2.P;
+  Peas = Psf;
+  Teas = Ca2.T;
+  XeasCO2 = Ca2.Xco2;
+  XeasH2O = Ca2.Xh2o;
+  XeasO2 = Ca2.Xo2;
+  XeasN2 = 1 - Ca2.Xco2 - Ca2.Xh2o - Ca2.Xo2 - Ca2.Xso2;
+  XeasSO2 = Ca2.Xso2;
+
+  /* Biomass */
+  Qeom = Com.Q;
+  Teom = Com.T;
+  PCIom = Com.LHV;
+  XCeom = Com.Xc;
+  XHeom = Com.Xh;
+  XOeom = Com.Xo;
+  XNeom = Com.Xn;
+  XSeom = Com.Xs;
+  XCENDeom = Com.Xashes;
+  XH2Oeom = Com.hum;
+  Cpom = Com.cp;
+
+  /* Cooling water */
+  Qerefo = port_eau_refroid.Q;
+  Herefo = port_eau_refroid.h;
+  port_eau_refroid.h = port_eau_refroid.h_vol;
+
+  /* Primary air mass flow rates */
+  X1eap = 1 - X2eap - X3eap;
+  Q1eap = Qeap*X1eap;
+  Q2eap = Qeap*X2eap;
+  Q3eap = Qeap*X3eap;
+
+  /* Recirculated flue gases fow rates */
+  Qfrecirc = Qsf*Xrecirc;
+
+  /* Carbon distribution */
+  XCvol2 = XCeom*XCvol;
+  XMACHimb = XCeom*XCimb;
+  XCvol3 = XCeom*(1 - XCvol - XCimb);
+
+  //--------------------------------------------------------------------
+  // 1st zone : Drying
+  //------------------
+
+  /* Primary air specific enthalpy at Teap */
+  Heap = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teap, XeapCO2, XeapH2O, XeapO2, XeapSO2);
+
+  /* Secondary air specific enthalpy at à Teas */
+  Heas = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teas, XeasCO2, XeasH2O, XeasO2, XeasSO2);
+
+  /* Primary air specific enthalpy at T1sfm */
+  H1a = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T1sfm, XeapCO2, XeapH2O, XeapO2, XeapSO2);
+
+  /* Specific enthalpy of the incoming recirculated flue gases */
+  XsfN2recirc = 1 - XfCO2recirc - XfH2Orecirc - XfO2recirc - XfSO2recirc;
+  Hefrecirc = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfrecirc, XfCO2recirc, XfH2Orecirc, XfO2recirc, XfSO2recirc);
+
+  /* Mass flow rate of the secondary air / flue gases recirculated mixture */
+  Qeasm = Qeas + Qfrecirc;
+
+  /* Mixture */
+  if (Qeasm <= 0) then
+    XeasmO2 = 0;
+    XeasmCO2 = 0;
+    XeasmH2O = 0;
+    XeasmSO2 = 0;
+    XeasmN2 = 0;
+    Heasm = 1e3;
+    Teasm = 274.15;
+  else
+    XeasmO2 = (XfO2recirc*Qfrecirc + XeasO2*Qeas)/Qeasm;
+    XeasmCO2 = (XfCO2recirc*Qfrecirc)/Qeasm;
+    XeasmH2O = (XfH2Orecirc*Qfrecirc + XeasH2O*Qeas)/Qeasm;
+    XeasmSO2 = (XfSO2recirc*Qfrecirc)/Qeasm;
+    XeasmN2 = 1 - XeasmO2 - XeasmSO2 - XeasmH2O - XeasmSO2;
+    Heasm = (Qeasm*Heas+Qfrecirc*Hefrecirc)/Qeasm;
+    // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+    Heasm = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Teasm, XeasmCO2, XeasmH2O, XeasmO2, XeasmSO2);
+  end if;
+
+  /* Specific enthalpy of the water in the biomass */
+  pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, Teom, mode);
+  Heauom = pro1.h;
+
+  /* Water phase transition energy at Teom */
+  Psateom = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Teom);
+  pro2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 2);
+  Hvteom = pro2.h;
+  pro3 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 1);
+  Hlteom = pro3.h;
+
+  Hvapteom = Hvteom - Hlteom;
+
+  /* Specific enthalpy of the water in the biomass */
+  pro4 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psf, T1sfm, 0);
+  Hs1vom = pro4.h;
+
+  /* Specific enthalpy of the biomass at Teom */
+  Heom = Cpom*(Teom - 273.15);
+
+  /* Flue gases formation energy */
+  Wff = Qeom*(HfCO2*XCeom + HfH2Og*XHeom*9 + HfSO2*XSeom/32.1*64.1 + HfH2Og*XH2Oeom);
+
+  /* Pyrolisis power of the biomass */
+  Wp = Wff - Qeom*PCIom/(1 - perte) - Qeom*HfH2Ol*XH2Oeom;
+
+  /* Power saved by the combustion gases due to the non-destruction of unburnty particles */
+  Wimbp = Wp*XCimb;
+
+  /* Power lost by the combustion gases due to the non-combusiton of C */
+  Wimbm = Qeom*XCeom*HfCO2*XCimb;
+
+  /* Pyrolisis enthalpy */
+  Hpyr = Wp/(Qeom*(1 - XH2Oeom));
+
+  /* Specific enthalpy of the dry biomasss at the biomass pyrolysis temperature */
+  H1om = Hpyr + Heom;
+
+  /* Mass flow rates at the outlet of zone 1 */
+  Q1H2O = Qeom*XH2Oeom + Q1eap*XeapH2O + Qerefo;
+  Q1O2 = Q1eap*XeapO2;
+  Q1N2 = Q1eap*XeapN2;
+  Q1CO2 = Q1eap*XeapCO2;
+  Q1SO2 = Q1eap*XeapSO2;
+  Q1g = Q1H2O + Q1O2 + Q1N2 + Q1CO2 + Q1SO2;
+  Q2eom = Qeom*(1 - XH2Oeom);
+
+  /* Correction after drying */
+  PCI1om = PCIom/(1 - XH2Oeom);
+  X1MACHom = XMACHeom/(1 - XH2Oeom);
+  XC1vol2 = XCvol2/(1 - XH2Oeom);
+  XC1vol3 = XCvol3/(1 - XH2Oeom);
+  X1MACHimb = XMACHimb/(1 - XH2Oeom);
+  X1H = XHeom/(1 - XH2Oeom);
+  X1O = XOeom/(1 - XH2Oeom);
+  X1N = XNeom/(1 - XH2Oeom);
+  X1Cl = XCleom/(1 - XH2Oeom);
+  X1F = XFeom/(1 - XH2Oeom);
+  X1S = XSeom/(1 - XH2Oeom);
+  X1CEND = XCENDeom/(1 - XH2Oeom);
+
+  /* Ashes mass flow rate in the biomass */
+  Qcendom = XCENDeom*Qeom;
+
+  /* Ashes mass fraction in the flue gases */
+  Xfcend = Qcendom/Qsf;
+
+  /* Power captured in zone 1 */
+  P1g = Qeom*XH2Oeom*Hs1vom + Qeom*XH2Oeom*Hvapteom + Q1eap*H1a + Qerefo*Hs1vom;
+
+  //--------------------------------------------------------------------
+  // 2nd zone : Combustion
+  //----------------------
+
+  /* Outgoing flue gases mass flow rate after combustion */
+  /* Oxygen brought by air and the biomass */
+  Q2eo = Q2eom*X1O + Q2eap*XeapO2;
+
+  /* Outgoing mass flow rates */
+  Q2HCl = 36.5/35.5*Q2eom*X1Cl;
+  Q2HF = 20/19*Q2eom*X1F;
+  Q2SO2 = 64/32*Q2eom*X1S + Q2eap*XeapSO2;
+  Q2H2O = 18/2*Q2eom*(X1H - 1/35.5*X1Cl - 1/19*X1F) + Q2eap*XeapH2O;
+  Q2CO = 28/12*Q2eom*XC1vol2;
+  Q2N2 = Q2eo*X1N + Q2eap*XeapN2;
+  Q2O2 = Q2eo - Q2eom*(X1S + 16/2*(X1H - 1/35.5*X1Cl - 1/19*X1F) + 16/12*XC1vol2);
+  Q2cend = Q2eom*X1CEND;
+  Q2CO2 = Q2eap*XeapCO2;
+
+  /* Total mass flow rate after combustion */
+  Q2g = Q2HCl + Q2HF + Q2SO2 + Q2H2O + Q2CO + Q2N2 + Q2O2 + Q2cend + Q2CO2;
+
+  /* Correction after combustion */
+  Epsivol = XC1vol2 + X1H + X1O + X1S + X1Cl + X1F + X1N + X1CEND;
+  Q3eom = Q2eom*(1 - Epsivol);
+  X2MACHom = X1MACHom/(1 - Epsivol);
+  XC2vol3 = XC1vol3/(1 - Epsivol);
+  X2MACHimb = X1MACHimb/(1 - Epsivol);
+
+  /* Power released by the combustion */
+  PCICsol = (XC1vol3 + X1MACHimb)*HfCO2;
+  PCICvol = XC1vol2*(HfCO2 - HfCO);
+  H2 = PCI1om - PCICsol - PCICvol;
+  P2g = H2*Q2eom+(Q2H2O - (Q2eap*XeapH2O))*H0v + Wimbp;
+
+  P1o = Qeom*(1 - XH2Oeom)*(H1om - Heom);
+  P1v = Qeom*XH2Oeom*(Hs1vom - Hlteom);
+  P1a = Q1eap*(H1a - Heap);
+  P1r = Qerefo*(Hs1vom - Herefo);
+
+  Eray0 = (P1o + P1v + P1a + P1r)/P2g;
+
+  /* Temperature at the outlet of zone 2 */
+  /* Mass fraction at the outlet */
+  X2O2 = Q2O2/Q2g;
+  X2SO2 = Q2SO2/Q2g;
+  X2CO2 = Q2CO/Q2g;
+  X2H2O = Q2H2O/Q2g;
+  X2N2 = 1 - (X2O2 + X2SO2 + X2CO2 + X2H2O);
+
+  /* Specific enthalpy and temperature at the outlet of zone 2 */
+  H2g = (Q2eap*Heap + Q2eom*H1om + P2g*(1 - Eray0 - Eray2) - Q3eom*CpMACHs2*(T2 - 273.15))/Q2g;
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  H2g = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T2, X2CO2, X2H2O, X2O2, X2SO2);
+
+  //--------------------------------------------------------------------
+  // 3rd zone : Clinker cooling
+  //---------------------------
+
+  /* Oxydation of the clinkler carbon into CO and/or CO2 */
+  Q3od = Q3eap*XeapO2;
+  Q3cd = Q3eom*XC2vol3;
+  taux3oc = Q3od/Q3cd;
+
+  /* taux3oc >= 32/12 => all C is transformed into CO2 */
+  if (taux3oc >= 32/12) then
+    /* Mass flow rates */
+    Q3CO2 = 44/12*Q3cd + Q3eap*XeapCO2;
+    Q3CO = 0;
+    Q3O2 = Q3od - 32/12*Q3cd;
+    Q3N2 = Q3eap*XeapN2;
+    Q3H2O = Q3eap*XeapH2O;
+    Q3SO2 = Q3eap*XeapSO2;
+
+    /* Power released */
+    P3s = Q3cd*HfCO;
+    P3g = Q3cd*(HfCO2 - HfCO);
+
+    /* Enthalpy released */
+    H3s = P3s/Q3eom;
+    H3g = P3g/Q3eom;
+    XC2vol31 = XC2vol3;
+    XC2vol4 = XC2vol3;
+
+  /* 16/12 <= taux3oc <= 32/12 => all C is transformed into CO plus a fraction into CO2 */
+  elseif ((taux3oc >= 16/12) and (taux3oc < 32/12)) then
+    /* Mass flow rates */
+    Q3CO2 = 44/12*(Q3od - 16/12*Q3cd) + Q3eap*XeapCO2;
+    Q3CO = 28/12*Q3cd - 28/16*(Q3od - 16/12*Q3cd);
+    Q3O2 = 0;
+    Q3N2 = Q3eap*XeapN2;
+    Q3H2O = Q3eap*XeapH2O;
+    Q3SO2 = Q3eap*XeapSO2;
+
+    /* Power released */
+    P3s = Q3cd*HfCO;
+    P3g = (12/16*Q3od - Q3cd)*(HfCO2 - HfCO);
+
+    /* Enthalpy released */
+    H3s = P3s/Q3eom;
+    H3g = P3g/Q3eom;
+    XC2vol31 = XC2vol3;
+    XC2vol4 = XC2vol3;
+
+  /* taux3oc < 16/12 => partial oxydation into CO */
+  else
+    /* Mass flow rates */
+    Q3CO2 = 0;
+    Q3CO = 28/16*Q3od;
+    Q3O2 = 0;
+    Q3N2 = Q3eap*XeapN2;
+    Q3H2O = Q3eap*XeapH2O;
+    Q3SO2 = Q3eap*XeapSO2;
+
+    /* Power released */
+    P3s = 12/16*Q3od*HfCO;
+    P3g = 0;
+
+    /* Enthalpy released */
+    H3s = P3s/Q3eom;
+    H3g = P3g/Q3eom;
+    XC2vol31 = XC2vol3*12/16*taux3oc;
+    XC2vol4 = XC2vol3;
+end if;
+
+  /* Correction after coke combustion */
+  Q3g = Q3CO2 + Q3CO + Q3H2O + Q3O2 + Q3N2 + Q3SO2;
+  Q4eom = Q3eom*(1 - XC2vol31);
+  X4MACHom = X2MACHom/(1 - XC2vol31);
+  X4MACHimb = X2MACHimb/(1 - XC2vol31) + (XC2vol4 - XC2vol31)/(1 - XC2vol31);
+
+  /* Clinker temperature at the outlet of zone 3 */
+  Cp3a = (ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, (T2 + Teap)/2, X2CO2, X2H2O, X2O2, X2SO2))/((T2 + Teap)/2);
+  T3o - 273.15 = (Q3eap*Heap + Q3eom*CpMACHs2*(T2 - 273.15)-
+      (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*(T2 - 273.15)/2-
+      (28/12)*Q3eom*XC2vol31*Cp3CO*(T2 - 273.15)/2 + P3s)/
+      (Q3eap*Cp3a/2 + (28/12)*Q3eom*XC2vol31*Cp3CO/2 + Q4eom*CpMACHs3);
+  P3ac = (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*((T2 - 273.15) + (T3o - 273.15))/2;
+  P3co = (28/12)*Q3eom*XC2vol31*Cp3CO*((T2 - 273.15) + (T3o - 273.15))/2;
+  P3 = P3g + P3ac + P3co;
+
+  //--------------------------------------------------------------------
+  // 4th zone : Water seal
+  //----------------------
+
+  /* Steam mass flow rate generated by the water seal */
+  if (jointeau == 1) then
+    T4o = TsjeMACH;
+    TsMACH = TsjeMACH;
+    T4er = Teeje;
+    X4H2O = XsjeH2OMACH;
+    Cp4liq = 4180;
+    P4m = Q4eom*CpMACHs4*((T3o - 273.15) - (T4o - 273.15));
+    P4h = Q4eom*X4H2O*Cp4liq*((T4o - 273.15) - (T4er - 273.15));
+    Q4v = rendje*(P4m - P4h)/(Cp4liq*(373.15 - (T4er - 273.15)) + Hvapo);
+    pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2);
+    H4 = pro5.h;
+    P4v = Q4v*pro5.h;
+  else
+    T4o = 273.15;
+    TsMACH = T3o;
+    T4er = 273.15;
+    X4H2O = 0;
+    Cp4liq = 0;
+    P4m = 0;
+    P4h = 0;
+    Q4v = 0;
+    pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2);
+    H4 = pro5.h;
+    P4v = 0;
+  end if;
+
+  /* Clinker mass flow rate at the outlet */
+  QsMACH = Q4eom;
+
+  /* Clinker LHV at the outlet */
+  PCIMACH = (Wimbm - Wimbp)/QsMACH;
+
+  //--------------------------------------------------------------------
+  // 5th zone : Post-combustion
+  //---------------------------
+
+  /* Excess air of the combustion */
+  QO2p = Qsf*XsfO2;
+  Qairp = QO2p/XeapO2*(1 - XeapH2O);
+  Qairs = (Qeap + Qeas) - Qairp;
+  excair = (Qairp/Qairs)*100;
+
+  /* Gases mass flow rates before mixing in zone 5 */
+  Q5eH2O = Q1H2O + Q2H2O + Q3H2O + Q4v + Qeasm*XeasmH2O;
+  Q5eCO = Q2CO + Q3CO;
+  Q5eCO2 = Q3CO2 + Q1CO2 + Q2CO2 + Qeasm*XeasmCO2;
+  Q5eO2 = Q1O2 + Q2O2 + Q3O2 + Qeasm*XeasmO2;
+  Q5eN2 = Q1N2 + Q2N2 + Q3N2 + Qeasm*XeasmN2;
+  Q5eSO2 = Q1SO2 + Q2SO2 + Q3SO2 + Qeasm*XeasmSO2;
+  Q5eHCl = Q2HCl;
+  Q5eHF = Q2HF;
+  Q5ecend = Q2cend;
+  Q5eam = Q5eH2O + Q5eCO + Q5eCO2 + Q5eO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend;
+
+  /* Oxydation of the CO remaining in zone 5 */
+  Q5od = Q5eO2 + 16/18*Q5eH2O + 32/44*Q5eCO2 + 16/28*Q5eCO;
+  Q5cd = 12/44*Q5eCO2 + 12/28*Q5eCO;
+  Q5hd = 2/18*Q5eH2O;
+  Q5ost = 16/2*Q5hd + 32/12*Q5cd;
+  exc5 = Q5od/Q5ost;
+
+  /* Total oxydation of the remaining CO */
+  if (exc5 > 1) then
+    P5 = 12/28*Q5eCO*(HfCO2 - HfCO);
+    Q5sCO2 = Q5eCO2 + 44/28*Q5eCO;
+    Q5sO2 = Q5eO2 - 16/28*Q5eCO;
+    Q5sCO = 0;
+
+  /* Partial oxydation of the remaining CO */
+  else
+    P5 = Q5eO2*12/16*(HfCO2 - HfCO);
+    Q5sCO2 = Q5eCO2 + 44/16*Q5eO2;
+    Q5sO2 = 0;
+    Q5sCO = Q5eCO - 28/16*Q5eO2;
+  end if;
+
+  /* Flue gases total mass flow rate at the outlet */
+  Qsf = Q5eH2O + Q5sCO + Q5sCO2 + Q5sO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend;
+
+  /* Power available in the flue gases */
+  P5s = P5*(1 - Eray5);
+
+  /* Flue gases mass fractions at the outlet */
+  XsfH2O = Q5eH2O/Qsf;
+  XsfCO = Q5sCO/Qsf;
+  XsfCO2 = Q5sCO2/Qsf;
+  XsfO2 = Q5sO2/Qsf;
+  XsfSO2 = Q5eSO2/Qsf;
+  XsfN21 = Q5eN2/Qsf;
+  XsfHCl = Q5eHCl/Qsf;
+  XsfHF = Q5eHF/Qsf;
+  XsfCEND = Q5ecend/Qsf;
+  XsfN2 = 1 - (XsfCO2 + XsfH2O + XsfO2 + XsfSO2);
+
+  /* Power accumulated by the flue gases in zone 5 */
+  P5a = Qeasm*Heasm;
+  P5t = P1g + H2g*Q2g + P3 + P4v + P5s + P5a;
+
+  /* Power radiated */
+  Wsr = P5s*Eray5/(1 - Eray5) + P2g*Eray2;
+
+  /* Flue gases temperature at the outlet */
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  P5t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Ashes volume mass */
+  rhocend = rhoCENDom;
+
+  /* Normal voulme fraction of the volatile ashes */
+  Xcor = 1/(1 - XsfH2O);
+  X5sH2OC = 0;
+  X5sCO2C = XsfCO2*Xcor;
+  X5sO2C = XsfO2*Xcor;
+  X5sSO2C = XsfSO2*Xcor;
+  X5sN2C = 1 - (X5sH2OC + X5sCO2C + X5sO2C + X5sSO2C);
+  rhonorm = ThermoSysPro.Properties.FlueGases.FlueGases_rho(1.01325e5, 273.15, X5sCO2C, X5sH2OC, X5sO2C, X5sSO2C);
+  FVN0 = (Qcendom/rhocend)/(Qsf/rhonorm);
+  0 = if ((FVN0 < 0) or (FVN0 > 0.1)) then (FVN - 0.001) else (FVN - FVN0);
+
+  annotation (Diagram(graphics={Polygon(
+          points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80},
+              {-40,80},{-40,40},{-80,20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}},
+          lineColor={0,0,255},
+          fillColor={175,175,175},
+          fillPattern=FillPattern.Solid)}),
+                            Icon(graphics={Polygon(
+          points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80},
+              {-40,80},{-40,40},{-80,20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}},
+          lineColor={0,0,255},
+          fillColor={175,175,175},
+          fillPattern=FillPattern.Solid)}),
+    DymolaStoredErrors,
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+end GridFurnace;
diff --git a/ThermoSysPro/Combustion/CombustionChambers/PostCombustionGas.mo b/ThermoSysPro/Combustion/CombustionChambers/PostCombustionGas.mo
index eb0d562ea53a38e47d3b010c0b84a47e14efb35a..ec8757b03f084f4a56d9a011d8fdb7f959612324 100644
--- a/ThermoSysPro/Combustion/CombustionChambers/PostCombustionGas.mo
+++ b/ThermoSysPro/Combustion/CombustionChambers/PostCombustionGas.mo
@@ -1,479 +1,479 @@
-within ThermoSysPro.Combustion.CombustionChambers;
-model PostCombustionGas "Post-combustion"
-  parameter Real XClfuel=0 "Chloride mass fraction in fuel";
-  parameter Real XFfuel=0 "Fluoride mass fraction in fuel";
-  parameter Real Xrad=0 "Fraction of radiated power";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real HfCO2=3.275e+07 "CO2 formation specific enthalpy";
-  constant Real HfCO=9.201e+06 "CO formation specific enthalpy";
-  constant Real HfH2O=2.418e+08 "H2O steam formation specific enthalpy";
-  constant Units.SI.SpecificEnthalpy H0v=2501551.43
-    "Vaporisation specific enthalpy at 0°C";
-  constant Units.SI.MassFlowRate Qeps=0.0001 "Minimum value for Qmel";
-  Units.SI.MassFlowRate Qmelc(start=10)
-    "Intermediate variable for the computation of Qmel";
-  Real Keq0(start=0.1) "Intermediate variable for the compuation of Keq";
-  Real delta(start=0.1)
-    "Intermediate variable to compute the progress of stage 4";
-
-public
-  Units.SI.MassFlowRate Qef(start=10) "Flue gases mass flow rate at the inlet";
-  Units.SI.Temperature Tef(start=1700) "Flue gases temperature at the inlet";
-  Real XefCO2(start=0.5) "CO2 mass fraction at the flue gases inlet";
-  Real XefH2O(start=0) "H2O mass fraction at the flue gases inlet";
-  Real XefO2(start=0.5) "O2 mass fraction at the flue gases inlet";
-  Real XefSO2(start=0) "SO2 mass fraction at the flue gases inlet";
-  Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet";
-  Units.SI.Temperature Tsf(start=1700) "Flue gases temperature at the outlet";
-  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
-  Real XsfCO2(start=0.2) "CO2 mass fraction at the flue gases outlet";
-  Real XsfCO(start=0.1) "CO mass fraction at the flue gases outlet";
-  Real XsfH2O(start=0.2) "H2O mass fraction at the flue gases outlet";
-  Real XsfH2(start=0.1) "H2 mass fraction at the flue gases outlet";
-  Real XsfO2(start=0.1) "O2 mass fraction at the flue gases outlet";
-  Real XsfN2(start=0.2) "N2 mass fraction at the flue gases outlet";
-  Real XsfSO2(start=0.1) "SO2 mass fraction at the flue gases outlet";
-  Units.SI.MassFlowRate Qea(start=0.2) "Air mass flow rate at the inlet";
-  Units.SI.Temperature Tea(start=300) "Air temperature at the inlet";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Real XeaCO2(start=0.2) "CO2 mass fraction at the air inlet";
-  Real XeaH2O(start=0.2) "H20 mass fraction at the air inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
-  Real XeaSO2(start=0.2) "SO2 mass fraction at the air inlet";
-  Units.SI.MassFlowRate Qec(start=0.1) "Fuel mass flow rate at the inlet";
-  Units.SI.Temperature Tec(start=1700) "Fuel temperature at the inlet";
-  Units.SI.SpecificHeatCapacity Cpfuel(start=1000)
-    "Fuel specific heat capacity";
-  Units.SI.SpecificEnergy LHVfuel(start=1e6) "Fuel LHV";
-  Real XH2Ofuel(start=0) "H2O mass fraction in fuel";
-  Real XCfuel(start=0.25) "C mass fraction in fuel";
-  Real XHfuel(start=0.75) "H mass fraction in fuel";
-  Real XOfuel(start=0) "O mass fraction in fuel";
-  Real XNfuel(start=0) "N mass fraction in fuel";
-  Real XSfuel(start=0) "S mass fraction in fuel";
-  Units.SI.Power Wrad(start=1e6) "Power radiated";
-  Units.SI.SpecificEnthalpy Hea(start=1e3)
-    "Humid air specific enthalpy at the temperature of the input air";
-  Units.SI.SpecificEnthalpy Hef(start=1e3)
-    "Flue gases specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qmel(start=10)
-    "Mass flow rate of the air/flue gases mixture";
-  Real XmelO2(start=0.1) "O2 pass fraction in the air/flue gases mixture";
-  Real XmelCO2(start=0.1) "CO2 pass fraction in the air/flue gases mixture";
-  Real XmelH2O(start=0.1) "H2O pass fraction in the air/flue gases mixture";
-  Real XmelSO2(start=0.1) "SO2 pass fraction in the air/flue gases mixture";
-  Real XmelN2(start=0.1) "N2 pass fraction in the air/flue gases mixture";
-  Units.SI.SpecificEnthalpy Hmel(start=1e3)
-    "Specific enthalpy of the air/flue gases mixture";
-  Units.SI.Temperature Tmel(start=500)
-    "Temperature of the air/flue gases mixture";
-  Units.SI.SpecificEnthalpy Hwfuel(start=1e3)
-    "Specific enthalpy of the water in fuel";
-  Units.SI.SpecificEnthalpy Hfuel(start=1e3) "Fuel specific enthalpy";
-  Units.SI.MassFlowRate Q1H2O(start=10)
-    "H2O mass flow rate at the outlet of zone 1";
-  Units.SI.MassFlowRate Q1O2(start=10)
-    "O2 mass flow rate at the outlet of zone 1";
-  Units.SI.MassFlowRate Q1N2(start=10)
-    "N2 mass flow rate at the outlet of zone 1";
-  Units.SI.MassFlowRate Q1CO2(start=10)
-    "CO2 mass flow rate at the outlet of zone 1";
-  Units.SI.MassFlowRate Q1SO2(start=10)
-    "SO2 mass flow rate at the outlet of zone 1";
-  Real X1Cfuel(start=0.1) "C mass fraction in fuel after drying";
-  Real X1Hfuel(start=0.1) "H mass fraction in fuel after drying";
-  Real X1Ofuel(start=0.1) "O mass fraction in fuel after drying";
-  Real X1Nfuel(start=0.1) "N mass fraction in fuel after drying";
-  Real X1Clfuel(start=0.1) "Cl mass fraction in fuel after drying";
-  Real X1Ffuel(start=0.1) "F mass fraction in fuel after drying";
-  Real X1Sfuel(start=0.1) "S mass fraction in fuel after drying";
-  Units.SI.MassFlowRate Q1ec(start=10) "Fuel mass flow rate after drying";
-  Units.SI.SpecificEnergy LHVfuel1(start=1e6) "Fuel LHV after drying";
-  Units.SI.MassFlowRate Q2eO(start=10)
-    "O2 mass flow rate at the inlet of zone 2";
-  Units.SI.MassFlowRate Q21HCl(start=10)
-    "HCl mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q21HF(start=10)
-    "HF mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q21SO2(start=10)
-    "SO2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q21N2(start=10)
-    "N2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q22CO(start=10) "CO mass flow rate produced in stage 2";
-  Units.SI.MassFlowRate Q22O2(start=10) "O2 mass flow rate left after stage 2";
-  Units.SI.MassFlowRate Q22H2(start=10) "H2 mass flow rate produced at stage 2";
-  Real etaO2(start=0.1) "O2 fraction at the end of the combustion";
-  Units.SI.MassFlowRate Q23CO2(start=10)
-    "CO2 mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q23H2O(start=10)
-    "H2O mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q23CO(start=10)
-    "CO mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q23H2(start=10)
-    "H2 mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q23O2(start=10)
-    "O2 mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q24eg(start=10)
-    "Mass flow rate of the volatile elements at the end of zone 2";
-  Units.SI.MassFlowRate Q24sg(start=10)
-    "Mass flow rate of the volatile elements at the outlet of zone 2";
-  Real X24O2(start=0.1) "O2 mass fraction in flue gases of zone 4";
-  Real X24SO2(start=0.1) "SO2 mass fraction in flue gases of zone 4";
-  Real X24H2O(start=0.1) "H2O mass fraction in flue gases of zone 4";
-  Real X24CO(start=0.1) "CO mass fraction in flue gases of zone 4";
-  Real X24CO2(start=0.1) "CO2 mass fraction in flue gases of zone 4";
-  Real X24C(start=0.1) "C mass fraction in flue gases of zone 4";
-  Real X24N2(start=0.1) "N2 mass fraction in flue gases of zone 4";
-  Real Keq(start=0.1) "Equilibrium constant for stage 4";
-  Real Mm4e(start=0.1) "Molar mass of the gases entering stage 4";
-  Real Mm4s(start=0.1) "Molar mass of the gases leaving stage 4";
-  Real X24eCOvol(start=0.1) "CO volume fraction before stage 4";
-  Real X24eCO2vol(start=0.1) "CO2 volume fraction before stage 4";
-  Real X24eH2vol(start=0.1) "H2 volume fraction before stage 4";
-  Real X24eH2Ovol(start=0.1) "H2 volume fraction before stage 4";
-  Real X24eN2vol(start=0.1) "N2 volume fraction before stage 4";
-  Real X24eHClvol(start=0.1) "HCl volume fraction before stage 4";
-  Real X24eHFvol(start=0.1) "HF volume fraction before stage 4";
-  Real X24eSO2vol(start=0.1) "SO2 volume fraction before stage 4";
-  Real X24sCOvol(start=0.1) "CO volume fraction after stage 4";
-  Real X24sCO2vol(start=0.1) "CO2 volume fraction after stage 4";
-  Real X24sH2vol(start=0.1) "H2 volume fraction after stage 4";
-  Real X24sH2Ovol(start=0.1) "H2O volume fraction after stage 4";
-  Real AVE(start=0.1) "Progress of stage 4";
-  Units.SI.MassFlowRate Q24H2O(start=10)
-    "H2O mass flow rate at the ned of stage 4";
-  Units.SI.MassFlowRate Q24H2(start=10)
-    "H2 mass flow rate at the ned of stage 4";
-  Units.SI.MassFlowRate Q24CO(start=10)
-    "CO mass flow rate at the ned of stage 4";
-  Units.SI.MassFlowRate Q24CO2(start=10)
-    "CO2 mass flow rate at the ned of stage 4";
-  Real PciCvol(start=1e6) "Power released by the combustion";
-  Units.SI.Power P2g(start=1e6) "Power released by the combustion";
-  Real XsfC(start=0.1) "C mass fraction in the flue gases";
-  Units.SI.Power P2t(start=1e6) "Total flue gases power at the outlet";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca "Air inlet"
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg2 "Flue gases outlet"
-    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cfg1 "Flue gases inlet"
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-  /* Flue gases outlet */
-  Qsf = Cfg2.Q;
-  Tsf = Cfg2.T;
-  Psf = Cfg2.P;
-  XsfCO2 = Cfg2.Xco2;
-  XsfH2O = Cfg2.Xh2o;
-  XsfO2 = Cfg2.Xo2;
-  XsfSO2 = Cfg2.Xso2;
-
-  /* Air inlet */
-  Qea = Ca.Q;
-  Pea = Ca.P;
-  Pea = 1.01e+5;
-  Tea = Ca.T;
-  XeaCO2 = Ca.Xco2;
-  XeaH2O = Ca.Xh2o;
-  XeaO2 = Ca.Xo2;
-  XeaSO2 = Ca.Xso2;
-
-  /* Flue gases inlet */
-  Qef = Cfg1.Q;
-  Tef = Cfg1.T;
-  Cfg1.P = Cfg2.P;
-  XefCO2 = Cfg1.Xco2;
-  XefH2O = Cfg1.Xh2o;
-  XefO2 = Cfg1.Xo2;
-  XefSO2 = Cfg1.Xso2;
-
-  /* Fuel inlet */
-  Qec = Cfuel.Q;
-  Tec = Cfuel.T;
-  LHVfuel = Cfuel.LHV;
-  XH2Ofuel = Cfuel.hum;
-  XCfuel = Cfuel.Xc;
-  XHfuel = Cfuel.Xh;
-  XOfuel = Cfuel.Xo;
-  XNfuel = Cfuel.Xn;
-  XSfuel = Cfuel.Xs;
-  Cpfuel = Cfuel.cp;
-
-  // 1st zone : Mixing air - flue gases - water in fuel
-  // --------------------------------------------------
-
-  /* Humid air specific enthalpy at the temperature of the input air */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-
-  /* Flue gases specific enthalpy at the inlet */
-  Hef = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tef, XefCO2, XefH2O, XefO2, XefSO2);
-
-  // Air - flue gases mixing
-  // - - - - - - - - - - - -
-
-  /* Mixture flow rate */
-  Qmelc = Qea + Qef;
-  0 = if (Qmelc - Qeps <= 0) then (Qmel - Qeps) else (Qmelc - Qmel);
-
-  /* Mixture composition */
-  XmelO2 = (XefO2*Qef + XeaO2*Qea)/Qmel;
-  XmelCO2 = (XefCO2*Qef)/Qmel;
-  XmelH2O = (XefH2O*Qef + XeaH2O*Qea)/Qmel;
-  XmelSO2 = (XefSO2*Qef)/Qmel;
-  XmelN2 = 1 - XmelO2 - XmelCO2 - XmelH2O - XmelSO2;
-
-  /* Mixture specific enthalpy */
-  Hmel = (Qea*Hea + Hef*Qef)/Qmel;
-
-  /* Mixture temperature */
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  Hmel = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tmel, XmelCO2, XmelH2O, XmelO2, XmelSO2);
-
-  // Fuel
-  // - -
-
-  /* Specific entahlpy of the water in fuel */
-  pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pea, Tec, mode);
-  Hwfuel = pro1.h;
-
-  /* Fuel specific enthalpy */
-  Hfuel = Cpfuel*(Tec - 273.16);
-
-  // Mass flow rates leaving zone 1
-  // - - - - - - - - - - - - - - - -
-  Q1H2O = Qec*XH2Ofuel + Qmel*XmelH2O;
-  Q1O2 = Qmel*XmelO2;
-  Q1N2 = Qmel*XmelN2;
-  Q1CO2 = Qmel*XmelCO2;
-  Q1SO2 = Qmel*XmelSO2;
-
-  /* After fuel drying */
-  Q1ec = Qec*(1 - XH2Ofuel);
-  LHVfuel1 = LHVfuel*(1 - XH2Ofuel);
-  X1Cfuel = XCfuel*(1 - XH2Ofuel);
-  X1Hfuel = XHfuel*(1 - XH2Ofuel);
-  X1Ofuel = XOfuel*(1 - XH2Ofuel);
-  X1Nfuel = XNfuel*(1 - XH2Ofuel);
-  X1Clfuel = XClfuel*(1 - XH2Ofuel);
-  X1Ffuel = XFfuel*(1 - XH2Ofuel);
-  X1Sfuel = XSfuel*(1 - XH2Ofuel);
-
-  // 2nd zone : Combustion
-  // ---------------------
-
-  // Stage 1 : Combustion of trace elements
-  // - - - - - - - - - - - - - - - - - - - -
-
-  /* Oxygen mass flow rate */
-  Q2eO = Q1ec*X1Ofuel + Qmel*XmelO2;
-
-  /* Other exiting mass flow rates */
-  Q21HCl = 36.5/35.5*Q1ec*X1Clfuel;
-  Q21HF = 20/19*Q1ec*X1Ffuel;
-  Q21SO2 = 64.06/32.06*Q1ec*X1Sfuel + Qmel*XmelSO2;
-  Q21N2 = Q1N2 + Q1ec*X1Nfuel;
-
-  // Etape 2 : CH4 oxydation into CO : CH4+1/2O2=>2H2+CO
-  // - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-  /* Mass flow rate of CO produced */
-  Q22CO = 28/12*Q1ec*X1Cfuel;
-
-  /* Oxygen mass flow rate */
-  Q22O2 = Q2eO - Q1ec*(X1Sfuel/32.06*32.06 + 32/12/2*X1Cfuel);
-
-  /* Mass flow rate of H2 produced */
-  Q22H2 = Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel);
-
-  /* O2 fraction */
-  etaO2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2);
-
-  if (etaO2 < 1e-6) then
-    //---------------
-    // Lack of oxygen
-    //---------------
-
-    // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O
-    // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    Q23CO2 = Q1CO2 + 2/3*Q22O2/32*44;
-    Q23H2O = Qmel*XmelH2O + 4/3*Q22O2/32*18 + Qec*XH2Ofuel;
-    Q23CO = Q22CO - 2/3*Q22O2/32*28;
-    Q23H2 = Q22H2 - 4/3*Q22O2/32*2;
-    Q23O2 = 0;
-
-    // Stage 4 :Equilibrium reaction CO/CO2
-    // - - - - - - - - - - - - - - - - - - -
-
-    /* Total mass flow rate of the volatile elements in zone 2 */
-    Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2;
-
-    /* Composition */
-    X24O2 = Q23O2/Q24eg;
-    X24SO2 = Q21SO2/Q24eg;
-    X24H2O = Q23H2O/Q24eg;
-    X24CO = Q23CO/Q24eg;
-    X24CO2 = Q23CO2/Q24eg;
-    X24C = X24CO + X24CO2;
-    X24N2 = 1 - (X24O2 + X24SO2 + X24H2O + X24CO + X24CO2);
-
-    /* Equilibrium constant */
-    Keq0 = 0.0042*(Tmel - 273.15) - 2.4555;
-    0 = if (Keq0 > 0) then (Keq - Keq0) else Keq;
-
-    /* Molar mass of the incoming gases */
-    Mm4e = (Q23CO/28 + Q23H2O/18 + Q23CO2/44 + Q23H2/2 + Q21N2/28)/Q24eg;
-
-    /* Volume fractions at the inlet of stage 4 */
-    X24eCOvol = Q23CO/Q24eg/Mm4e/28;
-    X24eCO2vol = Q23CO2/Q24eg/Mm4e/44;
-    X24eH2vol = Q23H2/Q24eg/Mm4e/2;
-    X24eH2Ovol = Q23H2O/Q24eg/Mm4e/18;
-    X24eN2vol = Q21N2/Q24eg/Mm4e/28;
-    X24eHClvol = Q21HCl/Q24eg/Mm4e/36.5;
-    X24eHFvol = Q21HF/Q24eg/Mm4e/20;
-    X24eSO2vol = Q21SO2/Q24eg/Mm4e/64.06;
-
-    /* Reaction progress */
-    delta = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol))^2 - 4*(Keq - 1)*(Keq*X24eCO2vol*X24eH2vol - X24eCOvol*X24eH2Ovol);
-    AVE = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol) - (delta)^0.5)/2/(Keq - 1);
-
-    /* Volume fractions at the outlet of stage 4 */
-    X24sCOvol = X24eCOvol + AVE;
-    X24sCO2vol = X24eCO2vol - AVE;
-    X24sH2vol = X24eH2vol - AVE;
-    X24sH2Ovol = X24eH2Ovol + AVE;
-
-    /* Molar mass of the outgoing gases */
-    Mm4s = X24sCOvol*28 + X24sCO2vol*44 + X24sH2vol*2 + X24sH2Ovol*18 + X24eN2vol*28;
-
-    /* Mass flow rates */
-    Q24CO = X24sCOvol*28/Mm4s*Q24eg;
-    Q24CO2 = X24sCO2vol*44/Mm4s*Q24eg;
-    Q24H2O = X24sH2Ovol*18/Mm4s*Q24eg;
-    Q24H2 = X24sH2vol*2/Mm4s*Q24eg;
-
-    Q24sg = Q24H2 + Q21HCl + Q21HF + Q21SO2 + Q24H2O + Q24CO + Q21N2 + Q23O2 + Q24CO2;
-
-  else
-    //-----------------
-    // Excess of oxygen
-    //-----------------
-
-    // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O
-    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    Q23CO2 = Q1CO2 + Q1ec*X1Cfuel/12*44;
-    Q23H2O = Qmel*XmelH2O+Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel)*18/2 + Qec*XH2Ofuel;
-    Q23CO = 0;
-    Q23H2 = 0;
-    Q23O2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2);
-
-    // Stage 4 : Eaquilibrium reaction CO/CO2
-    // - - - - - - - - - - - - - - - - - - -
-    Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2;
-    X24O2 = 0;
-    X24SO2 = 0;
-    X24H2O = 0;
-    X24CO = 0;
-    X24CO2 = 0;
-    X24C = 0;
-    X24N2 = 0;
-    Keq0 = 0;
-    0 = if (Keq0 > 0) then (Keq - Keq0) else Keq;
-    Mm4e = 0;
-    X24eCOvol = 0;
-    X24eCO2vol = 0;
-    X24eH2vol = 0;
-    X24eH2Ovol = 0;
-    X24eN2vol = 0;
-    X24eHClvol = 0;
-    X24eHFvol = 0;
-    X24eSO2vol = 0;
-    delta = 0;
-    AVE = 0;
-    X24sCOvol = 0;
-    X24sCO2vol = 0;
-    X24sH2vol = 0;
-    X24sH2Ovol = 0;
-    Mm4s = 0;
-    Q24CO = Q23CO;
-    Q24CO2 = Q23CO2;
-    Q24H2O = Q23H2O;
-    Q24H2 = Q23H2;
-    Q24sg = Q24eg;
-  end if;
-
-  /* Mass flow rate at the outlet */
-  Qsf = Q24sg;
-
-  /* Power released by the combustion */
-  0 = if (Q1ec >= 1e-6) then PciCvol - (Q24CO/28/Q1ec*12*(HfCO2 - HfCO) + Q24H2/2*(HfH2O)/Q1ec) else PciCvol;
-
-  /* Power released by the combustion in zone 2 */
-  P2g = (LHVfuel1 - PciCvol)*Q1ec;
-
-  /* Composition at the outlet */
-  XsfO2 = Q23O2/Qsf;
-  XsfSO2 = Q21SO2/Qsf;
-  XsfH2O = Q24H2O/Qsf;
-  XsfH2 = Q24H2/Qsf;
-  XsfCO = Q24CO/Qsf;
-  XsfCO2 = Q24CO2/Qsf;
-  XsfC = XsfCO2 + XsfCO;
-  XsfN2 = 1 - (XsfO2 + XsfSO2 + XsfH2O + XsfCO2 + XsfCO);
-
-  /* Power accumukated by the gases in zone 2 */
-  P2t = ((Q24H2O - (Qmel*XmelH2O))*H0v + Qmel*Hmel + Q1ec*Hfuel + P2g)*(1 - Xrad);
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  P2t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfC, XsfH2O, XsfO2, XsfSO2);
-
-  Wrad = P2t*Xrad;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
-              -44},{-20,-60},{-20,62}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.CrossDiag),
-        Line(points={{-20,80},{-20,-80}}, color={0,0,255})}),
-                                       Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
-              -44},{-20,-60},{-20,62}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.CrossDiag),
-        Line(points={{-20,80},{-20,-80}}, color={0,0,255})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>"));
-end PostCombustionGas;
+within ThermoSysPro.Combustion.CombustionChambers;
+model PostCombustionGas "Post-combustion"
+  parameter Real XClfuel=0 "Chloride mass fraction in fuel";
+  parameter Real XFfuel=0 "Fluoride mass fraction in fuel";
+  parameter Real Xrad=0 "Fraction of radiated power";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real HfCO2=3.275e+07 "CO2 formation specific enthalpy";
+  constant Real HfCO=9.201e+06 "CO formation specific enthalpy";
+  constant Real HfH2O=2.418e+08 "H2O steam formation specific enthalpy";
+  constant Units.SI.SpecificEnthalpy H0v=2501551.43
+    "Vaporisation specific enthalpy at 0°C";
+  constant Units.SI.MassFlowRate Qeps=0.0001 "Minimum value for Qmel";
+  Units.SI.MassFlowRate Qmelc(start=10)
+    "Intermediate variable for the computation of Qmel";
+  Real Keq0(start=0.1) "Intermediate variable for the compuation of Keq";
+  Real delta(start=0.1)
+    "Intermediate variable to compute the progress of stage 4";
+
+public
+  Units.SI.MassFlowRate Qef(start=10) "Flue gases mass flow rate at the inlet";
+  Units.SI.Temperature Tef(start=1700) "Flue gases temperature at the inlet";
+  Real XefCO2(start=0.5) "CO2 mass fraction at the flue gases inlet";
+  Real XefH2O(start=0) "H2O mass fraction at the flue gases inlet";
+  Real XefO2(start=0.5) "O2 mass fraction at the flue gases inlet";
+  Real XefSO2(start=0) "SO2 mass fraction at the flue gases inlet";
+  Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet";
+  Units.SI.Temperature Tsf(start=1700) "Flue gases temperature at the outlet";
+  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
+  Real XsfCO2(start=0.2) "CO2 mass fraction at the flue gases outlet";
+  Real XsfCO(start=0.1) "CO mass fraction at the flue gases outlet";
+  Real XsfH2O(start=0.2) "H2O mass fraction at the flue gases outlet";
+  Real XsfH2(start=0.1) "H2 mass fraction at the flue gases outlet";
+  Real XsfO2(start=0.1) "O2 mass fraction at the flue gases outlet";
+  Real XsfN2(start=0.2) "N2 mass fraction at the flue gases outlet";
+  Real XsfSO2(start=0.1) "SO2 mass fraction at the flue gases outlet";
+  Units.SI.MassFlowRate Qea(start=0.2) "Air mass flow rate at the inlet";
+  Units.SI.Temperature Tea(start=300) "Air temperature at the inlet";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Real XeaCO2(start=0.2) "CO2 mass fraction at the air inlet";
+  Real XeaH2O(start=0.2) "H20 mass fraction at the air inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
+  Real XeaSO2(start=0.2) "SO2 mass fraction at the air inlet";
+  Units.SI.MassFlowRate Qec(start=0.1) "Fuel mass flow rate at the inlet";
+  Units.SI.Temperature Tec(start=1700) "Fuel temperature at the inlet";
+  Units.SI.SpecificHeatCapacity Cpfuel(start=1000)
+    "Fuel specific heat capacity";
+  Units.SI.SpecificEnergy LHVfuel(start=1e6) "Fuel LHV";
+  Real XH2Ofuel(start=0) "H2O mass fraction in fuel";
+  Real XCfuel(start=0.25) "C mass fraction in fuel";
+  Real XHfuel(start=0.75) "H mass fraction in fuel";
+  Real XOfuel(start=0) "O mass fraction in fuel";
+  Real XNfuel(start=0) "N mass fraction in fuel";
+  Real XSfuel(start=0) "S mass fraction in fuel";
+  Units.SI.Power Wrad(start=1e6) "Power radiated";
+  Units.SI.SpecificEnthalpy Hea(start=1e3)
+    "Humid air specific enthalpy at the temperature of the input air";
+  Units.SI.SpecificEnthalpy Hef(start=1e3)
+    "Flue gases specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qmel(start=10)
+    "Mass flow rate of the air/flue gases mixture";
+  Real XmelO2(start=0.1) "O2 pass fraction in the air/flue gases mixture";
+  Real XmelCO2(start=0.1) "CO2 pass fraction in the air/flue gases mixture";
+  Real XmelH2O(start=0.1) "H2O pass fraction in the air/flue gases mixture";
+  Real XmelSO2(start=0.1) "SO2 pass fraction in the air/flue gases mixture";
+  Real XmelN2(start=0.1) "N2 pass fraction in the air/flue gases mixture";
+  Units.SI.SpecificEnthalpy Hmel(start=1e3)
+    "Specific enthalpy of the air/flue gases mixture";
+  Units.SI.Temperature Tmel(start=500)
+    "Temperature of the air/flue gases mixture";
+  Units.SI.SpecificEnthalpy Hwfuel(start=1e3)
+    "Specific enthalpy of the water in fuel";
+  Units.SI.SpecificEnthalpy Hfuel(start=1e3) "Fuel specific enthalpy";
+  Units.SI.MassFlowRate Q1H2O(start=10)
+    "H2O mass flow rate at the outlet of zone 1";
+  Units.SI.MassFlowRate Q1O2(start=10)
+    "O2 mass flow rate at the outlet of zone 1";
+  Units.SI.MassFlowRate Q1N2(start=10)
+    "N2 mass flow rate at the outlet of zone 1";
+  Units.SI.MassFlowRate Q1CO2(start=10)
+    "CO2 mass flow rate at the outlet of zone 1";
+  Units.SI.MassFlowRate Q1SO2(start=10)
+    "SO2 mass flow rate at the outlet of zone 1";
+  Real X1Cfuel(start=0.1) "C mass fraction in fuel after drying";
+  Real X1Hfuel(start=0.1) "H mass fraction in fuel after drying";
+  Real X1Ofuel(start=0.1) "O mass fraction in fuel after drying";
+  Real X1Nfuel(start=0.1) "N mass fraction in fuel after drying";
+  Real X1Clfuel(start=0.1) "Cl mass fraction in fuel after drying";
+  Real X1Ffuel(start=0.1) "F mass fraction in fuel after drying";
+  Real X1Sfuel(start=0.1) "S mass fraction in fuel after drying";
+  Units.SI.MassFlowRate Q1ec(start=10) "Fuel mass flow rate after drying";
+  Units.SI.SpecificEnergy LHVfuel1(start=1e6) "Fuel LHV after drying";
+  Units.SI.MassFlowRate Q2eO(start=10)
+    "O2 mass flow rate at the inlet of zone 2";
+  Units.SI.MassFlowRate Q21HCl(start=10)
+    "HCl mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q21HF(start=10)
+    "HF mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q21SO2(start=10)
+    "SO2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q21N2(start=10)
+    "N2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q22CO(start=10) "CO mass flow rate produced in stage 2";
+  Units.SI.MassFlowRate Q22O2(start=10) "O2 mass flow rate left after stage 2";
+  Units.SI.MassFlowRate Q22H2(start=10) "H2 mass flow rate produced at stage 2";
+  Real etaO2(start=0.1) "O2 fraction at the end of the combustion";
+  Units.SI.MassFlowRate Q23CO2(start=10)
+    "CO2 mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q23H2O(start=10)
+    "H2O mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q23CO(start=10)
+    "CO mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q23H2(start=10)
+    "H2 mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q23O2(start=10)
+    "O2 mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q24eg(start=10)
+    "Mass flow rate of the volatile elements at the end of zone 2";
+  Units.SI.MassFlowRate Q24sg(start=10)
+    "Mass flow rate of the volatile elements at the outlet of zone 2";
+  Real X24O2(start=0.1) "O2 mass fraction in flue gases of zone 4";
+  Real X24SO2(start=0.1) "SO2 mass fraction in flue gases of zone 4";
+  Real X24H2O(start=0.1) "H2O mass fraction in flue gases of zone 4";
+  Real X24CO(start=0.1) "CO mass fraction in flue gases of zone 4";
+  Real X24CO2(start=0.1) "CO2 mass fraction in flue gases of zone 4";
+  Real X24C(start=0.1) "C mass fraction in flue gases of zone 4";
+  Real X24N2(start=0.1) "N2 mass fraction in flue gases of zone 4";
+  Real Keq(start=0.1) "Equilibrium constant for stage 4";
+  Real Mm4e(start=0.1) "Molar mass of the gases entering stage 4";
+  Real Mm4s(start=0.1) "Molar mass of the gases leaving stage 4";
+  Real X24eCOvol(start=0.1) "CO volume fraction before stage 4";
+  Real X24eCO2vol(start=0.1) "CO2 volume fraction before stage 4";
+  Real X24eH2vol(start=0.1) "H2 volume fraction before stage 4";
+  Real X24eH2Ovol(start=0.1) "H2 volume fraction before stage 4";
+  Real X24eN2vol(start=0.1) "N2 volume fraction before stage 4";
+  Real X24eHClvol(start=0.1) "HCl volume fraction before stage 4";
+  Real X24eHFvol(start=0.1) "HF volume fraction before stage 4";
+  Real X24eSO2vol(start=0.1) "SO2 volume fraction before stage 4";
+  Real X24sCOvol(start=0.1) "CO volume fraction after stage 4";
+  Real X24sCO2vol(start=0.1) "CO2 volume fraction after stage 4";
+  Real X24sH2vol(start=0.1) "H2 volume fraction after stage 4";
+  Real X24sH2Ovol(start=0.1) "H2O volume fraction after stage 4";
+  Real AVE(start=0.1) "Progress of stage 4";
+  Units.SI.MassFlowRate Q24H2O(start=10)
+    "H2O mass flow rate at the ned of stage 4";
+  Units.SI.MassFlowRate Q24H2(start=10)
+    "H2 mass flow rate at the ned of stage 4";
+  Units.SI.MassFlowRate Q24CO(start=10)
+    "CO mass flow rate at the ned of stage 4";
+  Units.SI.MassFlowRate Q24CO2(start=10)
+    "CO2 mass flow rate at the ned of stage 4";
+  Real PciCvol(start=1e6) "Power released by the combustion";
+  Units.SI.Power P2g(start=1e6) "Power released by the combustion";
+  Real XsfC(start=0.1) "C mass fraction in the flue gases";
+  Units.SI.Power P2t(start=1e6) "Total flue gases power at the outlet";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ca "Air inlet"
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg2 "Flue gases outlet"
+    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cfg1 "Flue gases inlet"
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+  /* Flue gases outlet */
+  Qsf = Cfg2.Q;
+  Tsf = Cfg2.T;
+  Psf = Cfg2.P;
+  XsfCO2 = Cfg2.Xco2;
+  XsfH2O = Cfg2.Xh2o;
+  XsfO2 = Cfg2.Xo2;
+  XsfSO2 = Cfg2.Xso2;
+
+  /* Air inlet */
+  Qea = Ca.Q;
+  Pea = Ca.P;
+  Pea = 1.01e+5;
+  Tea = Ca.T;
+  XeaCO2 = Ca.Xco2;
+  XeaH2O = Ca.Xh2o;
+  XeaO2 = Ca.Xo2;
+  XeaSO2 = Ca.Xso2;
+
+  /* Flue gases inlet */
+  Qef = Cfg1.Q;
+  Tef = Cfg1.T;
+  Cfg1.P = Cfg2.P;
+  XefCO2 = Cfg1.Xco2;
+  XefH2O = Cfg1.Xh2o;
+  XefO2 = Cfg1.Xo2;
+  XefSO2 = Cfg1.Xso2;
+
+  /* Fuel inlet */
+  Qec = Cfuel.Q;
+  Tec = Cfuel.T;
+  LHVfuel = Cfuel.LHV;
+  XH2Ofuel = Cfuel.hum;
+  XCfuel = Cfuel.Xc;
+  XHfuel = Cfuel.Xh;
+  XOfuel = Cfuel.Xo;
+  XNfuel = Cfuel.Xn;
+  XSfuel = Cfuel.Xs;
+  Cpfuel = Cfuel.cp;
+
+  // 1st zone : Mixing air - flue gases - water in fuel
+  // --------------------------------------------------
+
+  /* Humid air specific enthalpy at the temperature of the input air */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+
+  /* Flue gases specific enthalpy at the inlet */
+  Hef = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tef, XefCO2, XefH2O, XefO2, XefSO2);
+
+  // Air - flue gases mixing
+  // - - - - - - - - - - - -
+
+  /* Mixture flow rate */
+  Qmelc = Qea + Qef;
+  0 = if (Qmelc - Qeps <= 0) then (Qmel - Qeps) else (Qmelc - Qmel);
+
+  /* Mixture composition */
+  XmelO2 = (XefO2*Qef + XeaO2*Qea)/Qmel;
+  XmelCO2 = (XefCO2*Qef)/Qmel;
+  XmelH2O = (XefH2O*Qef + XeaH2O*Qea)/Qmel;
+  XmelSO2 = (XefSO2*Qef)/Qmel;
+  XmelN2 = 1 - XmelO2 - XmelCO2 - XmelH2O - XmelSO2;
+
+  /* Mixture specific enthalpy */
+  Hmel = (Qea*Hea + Hef*Qef)/Qmel;
+
+  /* Mixture temperature */
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  Hmel = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tmel, XmelCO2, XmelH2O, XmelO2, XmelSO2);
+
+  // Fuel
+  // - -
+
+  /* Specific entahlpy of the water in fuel */
+  pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pea, Tec, mode);
+  Hwfuel = pro1.h;
+
+  /* Fuel specific enthalpy */
+  Hfuel = Cpfuel*(Tec - 273.16);
+
+  // Mass flow rates leaving zone 1
+  // - - - - - - - - - - - - - - - -
+  Q1H2O = Qec*XH2Ofuel + Qmel*XmelH2O;
+  Q1O2 = Qmel*XmelO2;
+  Q1N2 = Qmel*XmelN2;
+  Q1CO2 = Qmel*XmelCO2;
+  Q1SO2 = Qmel*XmelSO2;
+
+  /* After fuel drying */
+  Q1ec = Qec*(1 - XH2Ofuel);
+  LHVfuel1 = LHVfuel*(1 - XH2Ofuel);
+  X1Cfuel = XCfuel*(1 - XH2Ofuel);
+  X1Hfuel = XHfuel*(1 - XH2Ofuel);
+  X1Ofuel = XOfuel*(1 - XH2Ofuel);
+  X1Nfuel = XNfuel*(1 - XH2Ofuel);
+  X1Clfuel = XClfuel*(1 - XH2Ofuel);
+  X1Ffuel = XFfuel*(1 - XH2Ofuel);
+  X1Sfuel = XSfuel*(1 - XH2Ofuel);
+
+  // 2nd zone : Combustion
+  // ---------------------
+
+  // Stage 1 : Combustion of trace elements
+  // - - - - - - - - - - - - - - - - - - - -
+
+  /* Oxygen mass flow rate */
+  Q2eO = Q1ec*X1Ofuel + Qmel*XmelO2;
+
+  /* Other exiting mass flow rates */
+  Q21HCl = 36.5/35.5*Q1ec*X1Clfuel;
+  Q21HF = 20/19*Q1ec*X1Ffuel;
+  Q21SO2 = 64.06/32.06*Q1ec*X1Sfuel + Qmel*XmelSO2;
+  Q21N2 = Q1N2 + Q1ec*X1Nfuel;
+
+  // Etape 2 : CH4 oxydation into CO : CH4+1/2O2=>2H2+CO
+  // - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+  /* Mass flow rate of CO produced */
+  Q22CO = 28/12*Q1ec*X1Cfuel;
+
+  /* Oxygen mass flow rate */
+  Q22O2 = Q2eO - Q1ec*(X1Sfuel/32.06*32.06 + 32/12/2*X1Cfuel);
+
+  /* Mass flow rate of H2 produced */
+  Q22H2 = Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel);
+
+  /* O2 fraction */
+  etaO2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2);
+
+  if (etaO2 < 1e-6) then
+    //---------------
+    // Lack of oxygen
+    //---------------
+
+    // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O
+    // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    Q23CO2 = Q1CO2 + 2/3*Q22O2/32*44;
+    Q23H2O = Qmel*XmelH2O + 4/3*Q22O2/32*18 + Qec*XH2Ofuel;
+    Q23CO = Q22CO - 2/3*Q22O2/32*28;
+    Q23H2 = Q22H2 - 4/3*Q22O2/32*2;
+    Q23O2 = 0;
+
+    // Stage 4 :Equilibrium reaction CO/CO2
+    // - - - - - - - - - - - - - - - - - - -
+
+    /* Total mass flow rate of the volatile elements in zone 2 */
+    Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2;
+
+    /* Composition */
+    X24O2 = Q23O2/Q24eg;
+    X24SO2 = Q21SO2/Q24eg;
+    X24H2O = Q23H2O/Q24eg;
+    X24CO = Q23CO/Q24eg;
+    X24CO2 = Q23CO2/Q24eg;
+    X24C = X24CO + X24CO2;
+    X24N2 = 1 - (X24O2 + X24SO2 + X24H2O + X24CO + X24CO2);
+
+    /* Equilibrium constant */
+    Keq0 = 0.0042*(Tmel - 273.15) - 2.4555;
+    0 = if (Keq0 > 0) then (Keq - Keq0) else Keq;
+
+    /* Molar mass of the incoming gases */
+    Mm4e = (Q23CO/28 + Q23H2O/18 + Q23CO2/44 + Q23H2/2 + Q21N2/28)/Q24eg;
+
+    /* Volume fractions at the inlet of stage 4 */
+    X24eCOvol = Q23CO/Q24eg/Mm4e/28;
+    X24eCO2vol = Q23CO2/Q24eg/Mm4e/44;
+    X24eH2vol = Q23H2/Q24eg/Mm4e/2;
+    X24eH2Ovol = Q23H2O/Q24eg/Mm4e/18;
+    X24eN2vol = Q21N2/Q24eg/Mm4e/28;
+    X24eHClvol = Q21HCl/Q24eg/Mm4e/36.5;
+    X24eHFvol = Q21HF/Q24eg/Mm4e/20;
+    X24eSO2vol = Q21SO2/Q24eg/Mm4e/64.06;
+
+    /* Reaction progress */
+    delta = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol))^2 - 4*(Keq - 1)*(Keq*X24eCO2vol*X24eH2vol - X24eCOvol*X24eH2Ovol);
+    AVE = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol) - (delta)^0.5)/2/(Keq - 1);
+
+    /* Volume fractions at the outlet of stage 4 */
+    X24sCOvol = X24eCOvol + AVE;
+    X24sCO2vol = X24eCO2vol - AVE;
+    X24sH2vol = X24eH2vol - AVE;
+    X24sH2Ovol = X24eH2Ovol + AVE;
+
+    /* Molar mass of the outgoing gases */
+    Mm4s = X24sCOvol*28 + X24sCO2vol*44 + X24sH2vol*2 + X24sH2Ovol*18 + X24eN2vol*28;
+
+    /* Mass flow rates */
+    Q24CO = X24sCOvol*28/Mm4s*Q24eg;
+    Q24CO2 = X24sCO2vol*44/Mm4s*Q24eg;
+    Q24H2O = X24sH2Ovol*18/Mm4s*Q24eg;
+    Q24H2 = X24sH2vol*2/Mm4s*Q24eg;
+
+    Q24sg = Q24H2 + Q21HCl + Q21HF + Q21SO2 + Q24H2O + Q24CO + Q21N2 + Q23O2 + Q24CO2;
+
+  else
+    //-----------------
+    // Excess of oxygen
+    //-----------------
+
+    // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O
+    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    Q23CO2 = Q1CO2 + Q1ec*X1Cfuel/12*44;
+    Q23H2O = Qmel*XmelH2O+Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel)*18/2 + Qec*XH2Ofuel;
+    Q23CO = 0;
+    Q23H2 = 0;
+    Q23O2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2);
+
+    // Stage 4 : Eaquilibrium reaction CO/CO2
+    // - - - - - - - - - - - - - - - - - - -
+    Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2;
+    X24O2 = 0;
+    X24SO2 = 0;
+    X24H2O = 0;
+    X24CO = 0;
+    X24CO2 = 0;
+    X24C = 0;
+    X24N2 = 0;
+    Keq0 = 0;
+    0 = if (Keq0 > 0) then (Keq - Keq0) else Keq;
+    Mm4e = 0;
+    X24eCOvol = 0;
+    X24eCO2vol = 0;
+    X24eH2vol = 0;
+    X24eH2Ovol = 0;
+    X24eN2vol = 0;
+    X24eHClvol = 0;
+    X24eHFvol = 0;
+    X24eSO2vol = 0;
+    delta = 0;
+    AVE = 0;
+    X24sCOvol = 0;
+    X24sCO2vol = 0;
+    X24sH2vol = 0;
+    X24sH2Ovol = 0;
+    Mm4s = 0;
+    Q24CO = Q23CO;
+    Q24CO2 = Q23CO2;
+    Q24H2O = Q23H2O;
+    Q24H2 = Q23H2;
+    Q24sg = Q24eg;
+  end if;
+
+  /* Mass flow rate at the outlet */
+  Qsf = Q24sg;
+
+  /* Power released by the combustion */
+  0 = if (Q1ec >= 1e-6) then PciCvol - (Q24CO/28/Q1ec*12*(HfCO2 - HfCO) + Q24H2/2*(HfH2O)/Q1ec) else PciCvol;
+
+  /* Power released by the combustion in zone 2 */
+  P2g = (LHVfuel1 - PciCvol)*Q1ec;
+
+  /* Composition at the outlet */
+  XsfO2 = Q23O2/Qsf;
+  XsfSO2 = Q21SO2/Qsf;
+  XsfH2O = Q24H2O/Qsf;
+  XsfH2 = Q24H2/Qsf;
+  XsfCO = Q24CO/Qsf;
+  XsfCO2 = Q24CO2/Qsf;
+  XsfC = XsfCO2 + XsfCO;
+  XsfN2 = 1 - (XsfO2 + XsfSO2 + XsfH2O + XsfCO2 + XsfCO);
+
+  /* Power accumukated by the gases in zone 2 */
+  P2t = ((Q24H2O - (Qmel*XmelH2O))*H0v + Qmel*Hmel + Q1ec*Hfuel + P2g)*(1 - Xrad);
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  P2t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfC, XsfH2O, XsfO2, XsfSO2);
+
+  Wrad = P2t*Xrad;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
+              -44},{-20,-60},{-20,62}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.CrossDiag),
+        Line(points={{-20,80},{-20,-80}}, color={0,0,255})}),
+                                       Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
+              -44},{-20,-60},{-20,62}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.CrossDiag),
+        Line(points={{-20,80},{-20,-80}}, color={0,0,255})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>"));
+end PostCombustionGas;
diff --git a/ThermoSysPro/Combustion/CombustionChambers/package.mo b/ThermoSysPro/Combustion/CombustionChambers/package.mo
index 3ca1d8a5c353593758ed43ef53136b95821a7004..57095ac4ffa685450df45bc4a99d78a0209906be 100644
--- a/ThermoSysPro/Combustion/CombustionChambers/package.mo
+++ b/ThermoSysPro/Combustion/CombustionChambers/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Combustion;
-package CombustionChambers "Combustion chambers"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end CombustionChambers;
+within ThermoSysPro.Combustion;
+package CombustionChambers "Combustion chambers"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end CombustionChambers;
diff --git a/ThermoSysPro/Combustion/CombustionChambers/package.order b/ThermoSysPro/Combustion/CombustionChambers/package.order
index acf3e76bccaf8fa4950e14a304ab3498c6da7dd8..217d41630fee5a8176de7a81fc4172f7d855a096 100644
--- a/ThermoSysPro/Combustion/CombustionChambers/package.order
+++ b/ThermoSysPro/Combustion/CombustionChambers/package.order
@@ -1,5 +1,5 @@
-GenericCombustion
-GenericCombustion1D
-GridFurnace
-GTCombustionChamber
-PostCombustionGas
+GenericCombustion
+GenericCombustion1D
+GridFurnace
+GTCombustionChamber
+PostCombustionGas
diff --git a/ThermoSysPro/Combustion/Connectors.mo b/ThermoSysPro/Combustion/Connectors.mo
index a6ec5a99bc8cf18e4c1700a6ae979377e2d6f88f..07544a853ba1433f21358e1755b1a9c91131336d 100644
--- a/ThermoSysPro/Combustion/Connectors.mo
+++ b/ThermoSysPro/Combustion/Connectors.mo
@@ -1,276 +1,276 @@
-within ThermoSysPro.Combustion;
-package Connectors "Connectors"
-
-  connector FuelInlet "Fuel inlet connector"
-    Units.SI.MassFlowRate Q "Fuel mass flow rate";
-    Units.SI.Temperature T "Fuel temperature";
-    Units.SI.AbsolutePressure P "Fuel pressure";
-    Units.SI.SpecificEnergy LHV "Lower heating value";
-    Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
-    Real hum "Fuel humidity (%)";
-    Real Xc "C mass fraction";
-    Real Xh "H mass fraction";
-    Real Xo "O mass fraction";
-    Real Xn "N mass fraction";
-    Real Xs "S mass fraction";
-    Real Xashes "Ashes mass fraction";
-    Real VolM "Percentage of volatile matter";
-    Units.SI.Density rho "Fuel density";
-
-    input Boolean a=true
-      "Pseudo-variable for the verification of the connection orientation";
-    output Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-    annotation (Icon(graphics={Rectangle(
-            extent={{-100,-100},{100,100}},
-            lineColor={0,0,0},
-            fillPattern=FillPattern.VerticalCylinder,
-            fillColor={0,0,0}), Ellipse(
-            extent={{-100,100},{100,-100}},
-            lineColor={0,0,0},
-            fillPattern=FillPattern.Sphere,
-            fillColor={0,128,255})}),    Documentation(revisions="",
-          info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-  end FuelInlet;
-
-  connector FuelOutlet "Fuel outlet connector"
-    Units.SI.MassFlowRate Q "Fuel mass flow rate";
-    Units.SI.Temperature T "Fuel temperature";
-    Units.SI.AbsolutePressure P "Fuel pressure";
-    Units.SI.SpecificEnergy LHV "Lower heating value";
-    Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
-    Real hum "Fuel humidity (%)";
-    Real Xc "C mass fraction";
-    Real Xh "H mass fraction";
-    Real Xo "O mass fraction";
-    Real Xn "N mass fraction";
-    Real Xs "S mass fraction";
-    Real Xashes "Ashes mass fraction";
-    Real VolM "Percentage of volatile matter";
-    Units.SI.Density rho "Fuel density";
-
-    output Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    input Boolean b=true
-      "Pseudo-variable for the verification of the connection orientation";
-    annotation (Icon(graphics={Rectangle(
-            extent={{-100,-100},{100,100}},
-            lineColor={0,0,0},
-            fillColor={0,0,0},
-            fillPattern=FillPattern.Forward), Ellipse(
-            extent={{-100,100},{100,-100}},
-            lineColor={0,0,0},
-            fillPattern=FillPattern.Sphere,
-            fillColor={255,0,0})}),    Documentation(revisions="",
-          info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-  end FuelOutlet;
-
-  connector FuelInletI "Internal fuel inlet connector"
-    Units.SI.MassFlowRate Q "Fuel mass flow rate";
-    Units.SI.Temperature T "Fuel temperature";
-    Units.SI.AbsolutePressure P "Fuel pressure";
-    Units.SI.SpecificEnergy LHV "Lower heating value";
-    Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
-    Real hum "Fuel humidity (%)";
-    Real Xc "C mass fraction";
-    Real Xh "H mass fraction";
-    Real Xo "O mass fraction";
-    Real Xn "N mass fraction";
-    Real Xs "S mass fraction";
-    Real Xashes "Ashes mass fraction";
-    Real VolM "Percentage of volatile matter";
-    Units.SI.Density rho "Fuel density";
-
-    input Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    output Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-    annotation (Icon(graphics={Rectangle(
-            extent={{-100,-100},{100,100}},
-            lineColor={0,0,0},
-            fillPattern=FillPattern.VerticalCylinder,
-            fillColor={0,0,0}), Ellipse(
-            extent={{-100,100},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={0,128,255},
-            fillPattern=FillPattern.Backward)}),
-                              Documentation(revisions="",
-          info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-  end FuelInletI;
-
-  connector FuelOutletI "Internal fuel outlet connector"
-    Units.SI.MassFlowRate Q "Fuel mass flow rate";
-    Units.SI.Temperature T "Fuel temperature";
-    Units.SI.AbsolutePressure P "Fuel pressure";
-    Units.SI.SpecificEnergy LHV "Lower heating value";
-    Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
-    Real hum "Fuel humidity (%)";
-    Real Xc "C mass fraction";
-    Real Xh "H mass fraction";
-    Real Xo "O mass fraction";
-    Real Xn "N mass fraction";
-    Real Xs "S mass fraction";
-    Real Xashes "Ashes mass fraction";
-    Real VolM "Percentage of volatile matter";
-    Units.SI.Density rho "Fuel density";
-
-    output Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    input Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-    annotation (Icon(graphics={Rectangle(
-            extent={{-100,-100},{100,100}},
-            lineColor={0,0,0},
-            fillPattern=FillPattern.VerticalCylinder,
-            fillColor={0,0,0}), Ellipse(
-            extent={{-100,100},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,0,0},
-            fillPattern=FillPattern.Backward)}),
-                              Documentation(revisions="",
-          info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-  end FuelOutletI;
-  annotation (Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end Connectors;
+within ThermoSysPro.Combustion;
+package Connectors "Connectors"
+
+  connector FuelInlet "Fuel inlet connector"
+    Units.SI.MassFlowRate Q "Fuel mass flow rate";
+    Units.SI.Temperature T "Fuel temperature";
+    Units.SI.AbsolutePressure P "Fuel pressure";
+    Units.SI.SpecificEnergy LHV "Lower heating value";
+    Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
+    Real hum "Fuel humidity (%)";
+    Real Xc "C mass fraction";
+    Real Xh "H mass fraction";
+    Real Xo "O mass fraction";
+    Real Xn "N mass fraction";
+    Real Xs "S mass fraction";
+    Real Xashes "Ashes mass fraction";
+    Real VolM "Percentage of volatile matter";
+    Units.SI.Density rho "Fuel density";
+
+    input Boolean a=true
+      "Pseudo-variable for the verification of the connection orientation";
+    output Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+    annotation (Icon(graphics={Rectangle(
+            extent={{-100,-100},{100,100}},
+            lineColor={0,0,0},
+            fillPattern=FillPattern.VerticalCylinder,
+            fillColor={0,0,0}), Ellipse(
+            extent={{-100,100},{100,-100}},
+            lineColor={0,0,0},
+            fillPattern=FillPattern.Sphere,
+            fillColor={0,128,255})}),    Documentation(revisions="",
+          info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+  end FuelInlet;
+
+  connector FuelOutlet "Fuel outlet connector"
+    Units.SI.MassFlowRate Q "Fuel mass flow rate";
+    Units.SI.Temperature T "Fuel temperature";
+    Units.SI.AbsolutePressure P "Fuel pressure";
+    Units.SI.SpecificEnergy LHV "Lower heating value";
+    Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
+    Real hum "Fuel humidity (%)";
+    Real Xc "C mass fraction";
+    Real Xh "H mass fraction";
+    Real Xo "O mass fraction";
+    Real Xn "N mass fraction";
+    Real Xs "S mass fraction";
+    Real Xashes "Ashes mass fraction";
+    Real VolM "Percentage of volatile matter";
+    Units.SI.Density rho "Fuel density";
+
+    output Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    input Boolean b=true
+      "Pseudo-variable for the verification of the connection orientation";
+    annotation (Icon(graphics={Rectangle(
+            extent={{-100,-100},{100,100}},
+            lineColor={0,0,0},
+            fillColor={0,0,0},
+            fillPattern=FillPattern.Forward), Ellipse(
+            extent={{-100,100},{100,-100}},
+            lineColor={0,0,0},
+            fillPattern=FillPattern.Sphere,
+            fillColor={255,0,0})}),    Documentation(revisions="",
+          info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+  end FuelOutlet;
+
+  connector FuelInletI "Internal fuel inlet connector"
+    Units.SI.MassFlowRate Q "Fuel mass flow rate";
+    Units.SI.Temperature T "Fuel temperature";
+    Units.SI.AbsolutePressure P "Fuel pressure";
+    Units.SI.SpecificEnergy LHV "Lower heating value";
+    Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
+    Real hum "Fuel humidity (%)";
+    Real Xc "C mass fraction";
+    Real Xh "H mass fraction";
+    Real Xo "O mass fraction";
+    Real Xn "N mass fraction";
+    Real Xs "S mass fraction";
+    Real Xashes "Ashes mass fraction";
+    Real VolM "Percentage of volatile matter";
+    Units.SI.Density rho "Fuel density";
+
+    input Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    output Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+    annotation (Icon(graphics={Rectangle(
+            extent={{-100,-100},{100,100}},
+            lineColor={0,0,0},
+            fillPattern=FillPattern.VerticalCylinder,
+            fillColor={0,0,0}), Ellipse(
+            extent={{-100,100},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={0,128,255},
+            fillPattern=FillPattern.Backward)}),
+                              Documentation(revisions="",
+          info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+  end FuelInletI;
+
+  connector FuelOutletI "Internal fuel outlet connector"
+    Units.SI.MassFlowRate Q "Fuel mass flow rate";
+    Units.SI.Temperature T "Fuel temperature";
+    Units.SI.AbsolutePressure P "Fuel pressure";
+    Units.SI.SpecificEnergy LHV "Lower heating value";
+    Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
+    Real hum "Fuel humidity (%)";
+    Real Xc "C mass fraction";
+    Real Xh "H mass fraction";
+    Real Xo "O mass fraction";
+    Real Xn "N mass fraction";
+    Real Xs "S mass fraction";
+    Real Xashes "Ashes mass fraction";
+    Real VolM "Percentage of volatile matter";
+    Units.SI.Density rho "Fuel density";
+
+    output Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    input Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+    annotation (Icon(graphics={Rectangle(
+            extent={{-100,-100},{100,100}},
+            lineColor={0,0,0},
+            fillPattern=FillPattern.VerticalCylinder,
+            fillColor={0,0,0}), Ellipse(
+            extent={{-100,100},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,0,0},
+            fillPattern=FillPattern.Backward)}),
+                              Documentation(revisions="",
+          info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+  end FuelOutletI;
+  annotation (Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end Connectors;
diff --git a/ThermoSysPro/Combustion/Sensors/FuelMassFlowSensor.mo b/ThermoSysPro/Combustion/Sensors/FuelMassFlowSensor.mo
index b111ff3f1d82163b89fdc51f33c6aa3693529f7b..aacb36c694bfe17e3cfa79f6d0bceffd78674f12 100644
--- a/ThermoSysPro/Combustion/Sensors/FuelMassFlowSensor.mo
+++ b/ThermoSysPro/Combustion/Sensors/FuelMassFlowSensor.mo
@@ -1,85 +1,85 @@
-within ThermoSysPro.Combustion.Sensors;
-model FuelMassFlowSensor "Fuel mass flow rate sensor"
-
-public
-  Units.SI.MassFlowRate Q(start=20) "Mass flow rate";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Mesure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.Combustion.Connectors.FuelInlet C1
-    annotation (Placement(transformation(extent={{-110,-90},{-90,-70}},
-          rotation=0)));
-  ThermoSysPro.Combustion.Connectors.FuelOutlet C2
-    annotation (Placement(transformation(extent={{92,-90},{112,-70}}, rotation=
-            0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.T = C2.T;
-  C1.P = C2.P;
-  C1.LHV = C2.LHV;
-  C1.cp = C2.cp;
-  C1.hum = C2.hum;
-  C1.Xc = C2.Xc;
-  C1.Xh = C2.Xh;
-  C1.Xo = C2.Xo;
-  C1.Xn = C2.Xn;
-  C1.Xs = C2.Xs;
-  C1.Xashes = C2.Xashes;
-  C1.VolM = C2.VolM;
-  C1.rho = C2.rho;
-
-  Q = C1.Q;
-
-  /* Sensor signal */
-  Mesure.signal = Q;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.CrossDiag),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "Q")}),
-    Window(
-      x=0.25,
-      y=0.19,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,-28},{0,-80}}, color={0,0,255}),
-        Line(points={{-98,-80},{102,-80}}),
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.CrossDiag),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "Q")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Salimou Gassama </li>
-</ul>
-</html>"));
-end FuelMassFlowSensor;
+within ThermoSysPro.Combustion.Sensors;
+model FuelMassFlowSensor "Fuel mass flow rate sensor"
+
+public
+  Units.SI.MassFlowRate Q(start=20) "Mass flow rate";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Mesure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.Combustion.Connectors.FuelInlet C1
+    annotation (Placement(transformation(extent={{-110,-90},{-90,-70}},
+          rotation=0)));
+  ThermoSysPro.Combustion.Connectors.FuelOutlet C2
+    annotation (Placement(transformation(extent={{92,-90},{112,-70}}, rotation=
+            0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.T = C2.T;
+  C1.P = C2.P;
+  C1.LHV = C2.LHV;
+  C1.cp = C2.cp;
+  C1.hum = C2.hum;
+  C1.Xc = C2.Xc;
+  C1.Xh = C2.Xh;
+  C1.Xo = C2.Xo;
+  C1.Xn = C2.Xn;
+  C1.Xs = C2.Xs;
+  C1.Xashes = C2.Xashes;
+  C1.VolM = C2.VolM;
+  C1.rho = C2.rho;
+
+  Q = C1.Q;
+
+  /* Sensor signal */
+  Mesure.signal = Q;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.CrossDiag),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "Q")}),
+    Window(
+      x=0.25,
+      y=0.19,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,-28},{0,-80}}, color={0,0,255}),
+        Line(points={{-98,-80},{102,-80}}),
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.CrossDiag),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "Q")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Salimou Gassama </li>
+</ul>
+</html>"));
+end FuelMassFlowSensor;
diff --git a/ThermoSysPro/Combustion/Sensors/package.mo b/ThermoSysPro/Combustion/Sensors/package.mo
index 675c210bcec1e3182642dc4e33017717217ab2df..7797f77b20859f23970fd2525e79f57c3afd7b07 100644
--- a/ThermoSysPro/Combustion/Sensors/package.mo
+++ b/ThermoSysPro/Combustion/Sensors/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.Combustion;
-package Sensors "Sensors"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Sensors;
+within ThermoSysPro.Combustion;
+package Sensors "Sensors"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Sensors;
diff --git a/ThermoSysPro/Combustion/package.mo b/ThermoSysPro/Combustion/package.mo
index 3add9e5ae557d5210bf0b7d8cebc1503613041fd..a1813d83002194a42291c98afc3170db35754ce7 100644
--- a/ThermoSysPro/Combustion/package.mo
+++ b/ThermoSysPro/Combustion/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro;
-package Combustion "Combustion library"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Combustion;
+within ThermoSysPro;
+package Combustion "Combustion library"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Combustion;
diff --git a/ThermoSysPro/ConvertFromThermoSysPro_4.0.mos b/ThermoSysPro/ConvertFromThermoSysPro_4.0.mos
index decb9617a3ffecc7458fc9c647ae3f4d420524e8..e0c351ce6862d4bfa0290eb8b49306d7bc85e0fc 100644
--- a/ThermoSysPro/ConvertFromThermoSysPro_4.0.mos
+++ b/ThermoSysPro/ConvertFromThermoSysPro_4.0.mos
@@ -1,4 +1,4 @@
-// Generated by conversion of ThermoSysPro
-// Since this file is empty there is no reference to it.
-// If you want to add conversions to this you also have to add a reference to it.
-// This is done by removing noneFromVersion and adding a script etc.
+// Generated by conversion of ThermoSysPro
+// Since this file is empty there is no reference to it.
+// If you want to add conversions to this you also have to add a reference to it.
+// This is done by removing noneFromVersion and adding a script etc.
diff --git a/ThermoSysPro/Correlations/Misc/Function_FM.mo b/ThermoSysPro/Correlations/Misc/Function_FM.mo
index 33efbe7dc7cf5d899b2b80f1dbe7519550d6c487..899c3e56219c576c4f6d796ac675bd8e3d8c40a0 100644
--- a/ThermoSysPro/Correlations/Misc/Function_FM.mo
+++ b/ThermoSysPro/Correlations/Misc/Function_FM.mo
@@ -1,95 +1,95 @@
-within ThermoSysPro.Correlations.Misc;
-function Function_FM
-  "Calculation of the correction factor for material and gauge"
-  input Units.SI.Thickness e_tubes "Weight average thickness of tubes";
-  input Integer Tube_Material "Material of the tubes. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-
-public
-  output Real FM "Correction factor for material and gauge";
-
-algorithm
-  if Tube_Material==1 then
-    FM :=2.315302E-03*(e_tubes*1000)^4 - 1.463925E-02*(e_tubes*1000)^3 + 3.110868E-02*(e_tubes*1000)
-      ^2 - 4.539741E-02*(e_tubes*1000) + 1.058871E+00;
-  else
-      if Tube_Material == 2 then
-        FM :=1.157434E-03*(e_tubes*1000)^4 - 7.121250E-03*(e_tubes*1000)^3 + 1.364947E-02*
-        (e_tubes*1000)^2 - 3.449694E-02*(e_tubes*1000) + 1.052996E+00;
-      else
-        if Tube_Material == 3 then
-          FM :=-5.199660E-05*(e_tubes*1000)^3 - 3.573278E-04*(e_tubes*1000)^2 - 4.132974E-02*
-         (e_tubes*1000) + 1.050264E+00;
-        else
-          if Tube_Material == 4 then
-            FM :=6.698826E-04*(e_tubes*1000)^3 - 3.663560E-03*(e_tubes*1000)^2 - 4.115372E-02
-            *(e_tubes*1000) + 1.048801E+00;
-          else
-            if Tube_Material == 5 then
-              FM :=-4.847211E-04*(e_tubes*1000)^3 + 2.243464E-03*(e_tubes*1000)^2 -
-              5.989998E-02*(e_tubes*1000) + 1.050915E+00;
-            else
-              if Tube_Material == 6 then
-                FM :=-6.633831E-04*(e_tubes*1000)^3 + 6.392384E-03*(e_tubes*1000)^2 -
-                9.975868E-02*(e_tubes*1000) + 1.051240E+00;
-              else
-                if Tube_Material == 7 then
-                  FM :=-2.216250E-04*(e_tubes*1000)^3 + 5.447765E-03*(e_tubes*1000)^2 -
-                  1.041923E-01*(e_tubes*1000) + 1.051423E+00;
-                else
-                  if Tube_Material == 8 then
-                    FM :=-9.966165E-04*(e_tubes*1000)^3 + 1.501534E-02*(e_tubes*1000)^2 -
-                    1.568190E-01*(e_tubes*1000) + 1.050232E+00;
-                  else
-                    if Tube_Material == 9 then
-                      FM :=-2.019135E-03*(e_tubes*1000)^3 + 2.416873E-02*(e_tubes*1000)^2 -
-                      1.909330E-01*(e_tubes*1000) + 1.050183E+00;
-                    else
-                      if Tube_Material == 10 then
-                        FM :=-2.205027E-03*(e_tubes*1000)^3 + 2.776231E-02*(e_tubes*1000)^2
-                         - 2.079415E-01*(e_tubes*1000) + 1.049684E+00;
-                      else
-                        if Tube_Material == 11 then
-                          FM :=-3.337646E-03*(e_tubes*1000)^3 + 3.826354E-02*(e_tubes*1000)^2
-                           - 2.451577E-01*(e_tubes*1000) + 1.047242E+00;
-                        else
-                          if Tube_Material == 12 then
-                            FM :=-3.111927E-03*(e_tubes*1000)^3 + 3.866531E-02*(e_tubes*1000)^2
-                            - 2.511187E-01*(e_tubes*1000) + 1.045886E+00;
-                          else
-                            if Tube_Material == 13 then
-                              FM :=-5.461198E-03*(e_tubes*1000)^3 + 5.599292E-02*
-                              (e_tubes*1000)^2 - 2.964332E-01*(e_tubes*1000) + 1.046373E+00;
-                            else
-                              if Tube_Material == 14 then
-                                FM :=-5.744495E-03*(e_tubes*1000)^3 + 5.902780E-02*
-                                (e_tubes*1000)^2 - 3.063905E-01*(e_tubes*1000) + 1.044663E+00;
-                              else
-                                if Tube_Material == 15 then
-                                  FM :=-8.268350E-03*(e_tubes*1000)^3 + 7.823031E-02*
-                                  (e_tubes*1000)^2 - 3.567748E-01*(e_tubes*1000) +
-                                  1.040474E+00;
-                                else
-                                 FM :=0;
-                                end if;
-                              end if;
-                            end if;
-                          end if;
-                        end if;
-                      end if;
-                    end if;
-                  end if;
-                end if;
-              end if;
-            end if;
-          end if;
-        end if;
-      end if;
-    end if;
-
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end Function_FM;
+within ThermoSysPro.Correlations.Misc;
+function Function_FM
+  "Calculation of the correction factor for material and gauge"
+  input Units.SI.Thickness e_tubes "Weight average thickness of tubes";
+  input Integer Tube_Material "Material of the tubes. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+
+public
+  output Real FM "Correction factor for material and gauge";
+
+algorithm
+  if Tube_Material==1 then
+    FM :=2.315302E-03*(e_tubes*1000)^4 - 1.463925E-02*(e_tubes*1000)^3 + 3.110868E-02*(e_tubes*1000)
+      ^2 - 4.539741E-02*(e_tubes*1000) + 1.058871E+00;
+  else
+      if Tube_Material == 2 then
+        FM :=1.157434E-03*(e_tubes*1000)^4 - 7.121250E-03*(e_tubes*1000)^3 + 1.364947E-02*
+        (e_tubes*1000)^2 - 3.449694E-02*(e_tubes*1000) + 1.052996E+00;
+      else
+        if Tube_Material == 3 then
+          FM :=-5.199660E-05*(e_tubes*1000)^3 - 3.573278E-04*(e_tubes*1000)^2 - 4.132974E-02*
+         (e_tubes*1000) + 1.050264E+00;
+        else
+          if Tube_Material == 4 then
+            FM :=6.698826E-04*(e_tubes*1000)^3 - 3.663560E-03*(e_tubes*1000)^2 - 4.115372E-02
+            *(e_tubes*1000) + 1.048801E+00;
+          else
+            if Tube_Material == 5 then
+              FM :=-4.847211E-04*(e_tubes*1000)^3 + 2.243464E-03*(e_tubes*1000)^2 -
+              5.989998E-02*(e_tubes*1000) + 1.050915E+00;
+            else
+              if Tube_Material == 6 then
+                FM :=-6.633831E-04*(e_tubes*1000)^3 + 6.392384E-03*(e_tubes*1000)^2 -
+                9.975868E-02*(e_tubes*1000) + 1.051240E+00;
+              else
+                if Tube_Material == 7 then
+                  FM :=-2.216250E-04*(e_tubes*1000)^3 + 5.447765E-03*(e_tubes*1000)^2 -
+                  1.041923E-01*(e_tubes*1000) + 1.051423E+00;
+                else
+                  if Tube_Material == 8 then
+                    FM :=-9.966165E-04*(e_tubes*1000)^3 + 1.501534E-02*(e_tubes*1000)^2 -
+                    1.568190E-01*(e_tubes*1000) + 1.050232E+00;
+                  else
+                    if Tube_Material == 9 then
+                      FM :=-2.019135E-03*(e_tubes*1000)^3 + 2.416873E-02*(e_tubes*1000)^2 -
+                      1.909330E-01*(e_tubes*1000) + 1.050183E+00;
+                    else
+                      if Tube_Material == 10 then
+                        FM :=-2.205027E-03*(e_tubes*1000)^3 + 2.776231E-02*(e_tubes*1000)^2
+                         - 2.079415E-01*(e_tubes*1000) + 1.049684E+00;
+                      else
+                        if Tube_Material == 11 then
+                          FM :=-3.337646E-03*(e_tubes*1000)^3 + 3.826354E-02*(e_tubes*1000)^2
+                           - 2.451577E-01*(e_tubes*1000) + 1.047242E+00;
+                        else
+                          if Tube_Material == 12 then
+                            FM :=-3.111927E-03*(e_tubes*1000)^3 + 3.866531E-02*(e_tubes*1000)^2
+                            - 2.511187E-01*(e_tubes*1000) + 1.045886E+00;
+                          else
+                            if Tube_Material == 13 then
+                              FM :=-5.461198E-03*(e_tubes*1000)^3 + 5.599292E-02*
+                              (e_tubes*1000)^2 - 2.964332E-01*(e_tubes*1000) + 1.046373E+00;
+                            else
+                              if Tube_Material == 14 then
+                                FM :=-5.744495E-03*(e_tubes*1000)^3 + 5.902780E-02*
+                                (e_tubes*1000)^2 - 3.063905E-01*(e_tubes*1000) + 1.044663E+00;
+                              else
+                                if Tube_Material == 15 then
+                                  FM :=-8.268350E-03*(e_tubes*1000)^3 + 7.823031E-02*
+                                  (e_tubes*1000)^2 - 3.567748E-01*(e_tubes*1000) +
+                                  1.040474E+00;
+                                else
+                                 FM :=0;
+                                end if;
+                              end if;
+                            end if;
+                          end if;
+                        end if;
+                      end if;
+                    end if;
+                  end if;
+                end if;
+              end if;
+            end if;
+          end if;
+        end if;
+      end if;
+    end if;
+
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end Function_FM;
diff --git a/ThermoSysPro/Correlations/Misc/Pro_FlueGases.mo b/ThermoSysPro/Correlations/Misc/Pro_FlueGases.mo
index 1ef3ead2d6dfe38ec662f2c8e13174b00222d40d..8e48eb474364e63ee09a6f2e74aba235480aca07 100644
--- a/ThermoSysPro/Correlations/Misc/Pro_FlueGases.mo
+++ b/ThermoSysPro/Correlations/Misc/Pro_FlueGases.mo
@@ -1,50 +1,50 @@
-within ThermoSysPro.Correlations.Misc;
-record Pro_FlueGases
-  "Flue gases properties for the computation of correlations"
-  Units.SI.Density rhoMF(start=0.5) "Flue gases average density";
-  Units.SI.SpecificHeatCapacity cpMF(start=500)
-    "Flue gases average specific heat capacity";
-  Units.SI.DynamicViscosity muMF(start=1.e-5)
-    "Flue gases average dynamic viscosity";
-  Units.SI.ThermalConductivity kMF(start=0.10)
-    "Flue gases average thermal conductivity";
-  Units.SI.SpecificHeatCapacity cpMFF(start=500) "Film specific heat capacity";
-  Units.SI.DynamicViscosity muMFF(start=1.e-5) "Film dynamic viscosity";
-  Units.SI.ThermalConductivity kMFF(start=0.10) "Film thermal conductivity";
-  Real Xtot " ";
-
-  annotation (
-    Window(
-      x=0.11,
-      y=0.17,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,50},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,127},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-127,115},{127,55}}, textString=
-                                               "%name"),
-        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-        Line(points={{-100,0},{100,0}}, color={0,0,0}),
-        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-
-end Pro_FlueGases;
+within ThermoSysPro.Correlations.Misc;
+record Pro_FlueGases
+  "Flue gases properties for the computation of correlations"
+  Units.SI.Density rhoMF(start=0.5) "Flue gases average density";
+  Units.SI.SpecificHeatCapacity cpMF(start=500)
+    "Flue gases average specific heat capacity";
+  Units.SI.DynamicViscosity muMF(start=1.e-5)
+    "Flue gases average dynamic viscosity";
+  Units.SI.ThermalConductivity kMF(start=0.10)
+    "Flue gases average thermal conductivity";
+  Units.SI.SpecificHeatCapacity cpMFF(start=500) "Film specific heat capacity";
+  Units.SI.DynamicViscosity muMFF(start=1.e-5) "Film dynamic viscosity";
+  Units.SI.ThermalConductivity kMFF(start=0.10) "Film thermal conductivity";
+  Real Xtot " ";
+
+  annotation (
+    Window(
+      x=0.11,
+      y=0.17,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,50},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,127},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-127,115},{127,55}}, textString=
+                                               "%name"),
+        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+        Line(points={{-100,0},{100,0}}, color={0,0,0}),
+        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+
+end Pro_FlueGases;
diff --git a/ThermoSysPro/Correlations/Misc/Pro_TwoPhaseWaterSteam.mo b/ThermoSysPro/Correlations/Misc/Pro_TwoPhaseWaterSteam.mo
index 5e29fc1fdae0383ff420ec585723423743865bb4..a3ca16d3b03f3a621422c49aab85cfec57ebcd66 100644
--- a/ThermoSysPro/Correlations/Misc/Pro_TwoPhaseWaterSteam.mo
+++ b/ThermoSysPro/Correlations/Misc/Pro_TwoPhaseWaterSteam.mo
@@ -1,44 +1,44 @@
-within ThermoSysPro.Correlations.Misc;
-record Pro_TwoPhaseWaterSteam
-  "Water/steam properties for the computation of correlations"
-  Units.SI.Density rhol "Density of the liquid phase";
-  Units.SI.Density rhov "Density of the vapor phase";
-  Units.SI.SpecificEnthalpy hl "Specific enthalpy of the liquid phase";
-  Units.SI.SpecificEnthalpy hv "Specific enthalpy of the vapor phase";
-  Units.SI.SpecificEnergy lv "Phase transition energy";
-  Units.SI.SpecificHeatCapacity cpl
-    "Specific heat capacity of the liquid phase";
-  Units.SI.SpecificHeatCapacity cpv "Specific heat capacity of the vapor phase";
-  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
-  Units.SI.DynamicViscosity muv "Dynamic viscosity of the vapor phase";
-  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
-  Units.SI.ThermalConductivity kv "Thermal conductivity of the vapor phase";
-  Units.SI.SurfaceTension tsl "Surface tension of the liquid phase";
-  Units.SI.Density rholv "Density of the water/steam mixture";
-  Units.SI.SpecificEnthalpy hlv "Specific enthalpy of the water/steam mixture";
-
-  annotation (Icon(graphics={
-        Rectangle(
-          extent={{-100,50},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,127},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-127,115},{127,55}}, textString=
-                                               "%name"),
-        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-        Line(points={{-100,0},{100,0}}, color={0,0,0}),
-        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-                                                      Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-end Pro_TwoPhaseWaterSteam;
+within ThermoSysPro.Correlations.Misc;
+record Pro_TwoPhaseWaterSteam
+  "Water/steam properties for the computation of correlations"
+  Units.SI.Density rhol "Density of the liquid phase";
+  Units.SI.Density rhov "Density of the vapor phase";
+  Units.SI.SpecificEnthalpy hl "Specific enthalpy of the liquid phase";
+  Units.SI.SpecificEnthalpy hv "Specific enthalpy of the vapor phase";
+  Units.SI.SpecificEnergy lv "Phase transition energy";
+  Units.SI.SpecificHeatCapacity cpl
+    "Specific heat capacity of the liquid phase";
+  Units.SI.SpecificHeatCapacity cpv "Specific heat capacity of the vapor phase";
+  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
+  Units.SI.DynamicViscosity muv "Dynamic viscosity of the vapor phase";
+  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
+  Units.SI.ThermalConductivity kv "Thermal conductivity of the vapor phase";
+  Units.SI.SurfaceTension tsl "Surface tension of the liquid phase";
+  Units.SI.Density rholv "Density of the water/steam mixture";
+  Units.SI.SpecificEnthalpy hlv "Specific enthalpy of the water/steam mixture";
+
+  annotation (Icon(graphics={
+        Rectangle(
+          extent={{-100,50},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,127},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-127,115},{127,55}}, textString=
+                                               "%name"),
+        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+        Line(points={{-100,0},{100,0}}, color={0,0,0}),
+        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+                                                      Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+end Pro_TwoPhaseWaterSteam;
diff --git a/ThermoSysPro/Correlations/Misc/Pro_WaterSteam.mo b/ThermoSysPro/Correlations/Misc/Pro_WaterSteam.mo
index 64a225fc71a8497fd2870798765dde9abb82c2fd..60dda638cd16d9826b7db9cec0808a54e872b38b 100644
--- a/ThermoSysPro/Correlations/Misc/Pro_WaterSteam.mo
+++ b/ThermoSysPro/Correlations/Misc/Pro_WaterSteam.mo
@@ -1,50 +1,50 @@
-within ThermoSysPro.Correlations.Misc;
-record Pro_WaterSteam
-  "Water/steam properties for the computation of correlations"
-  Units.SI.Temperature TEE
-    "Water/steam temperature at the inlet of the exchanger";
-  Units.SI.Temperature TME "Average water/steam temperature";
-  Units.SI.Density rhoME "Average water/steam density";
-  Units.SI.Density rhoSE "Water/steam density at the outlet of the exchanger";
-  Units.SI.AbsolutePressure PME(start=100e5) "Average water/steam pressure";
-  Units.SI.SpecificEntropy SME "Average water/steam specific entropy";
-  Real xm "Average steam mass fraction";
-  Units.SI.SpecificHeatCapacity cpME "Water/steam specific heat capacity";
-  Units.SI.DynamicViscosity muME "Water/steam dynamic viscosity";
-  Units.SI.ThermalConductivity kME "Water/steam thermal conductivity";
-
-  annotation (
-    Window(
-      x=0.11,
-      y=0.17,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,50},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,127},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-127,115},{127,55}}, textString=
-                                               "%name"),
-        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-        Line(points={{-100,0},{100,0}}, color={0,0,0}),
-        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-
-end Pro_WaterSteam;
+within ThermoSysPro.Correlations.Misc;
+record Pro_WaterSteam
+  "Water/steam properties for the computation of correlations"
+  Units.SI.Temperature TEE
+    "Water/steam temperature at the inlet of the exchanger";
+  Units.SI.Temperature TME "Average water/steam temperature";
+  Units.SI.Density rhoME "Average water/steam density";
+  Units.SI.Density rhoSE "Water/steam density at the outlet of the exchanger";
+  Units.SI.AbsolutePressure PME(start=100e5) "Average water/steam pressure";
+  Units.SI.SpecificEntropy SME "Average water/steam specific entropy";
+  Real xm "Average steam mass fraction";
+  Units.SI.SpecificHeatCapacity cpME "Water/steam specific heat capacity";
+  Units.SI.DynamicViscosity muME "Water/steam dynamic viscosity";
+  Units.SI.ThermalConductivity kME "Water/steam thermal conductivity";
+
+  annotation (
+    Window(
+      x=0.11,
+      y=0.17,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,50},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,127},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-127,115},{127,55}}, textString=
+                                               "%name"),
+        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+        Line(points={{-100,0},{100,0}}, color={0,0,0}),
+        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+
+end Pro_WaterSteam;
diff --git a/ThermoSysPro/Correlations/Misc/PropFlueGases.mo b/ThermoSysPro/Correlations/Misc/PropFlueGases.mo
index b6870de28112107acc4a07e1b671e473cbc11f61..50bd4c3eaf3a1060da8fe3bcadebd221bcd3db78 100644
--- a/ThermoSysPro/Correlations/Misc/PropFlueGases.mo
+++ b/ThermoSysPro/Correlations/Misc/PropFlueGases.mo
@@ -1,45 +1,45 @@
-within ThermoSysPro.Correlations.Misc;
-function PropFlueGases "Computation of the flue gases properties"
-  input Units.SI.AbsolutePressure Pmf "Flue gases average pressure";
-  input Units.SI.Temperature Tmf "Flue gases average temperature";
-  input Real XefCO2 "CO2 mass fraction";
-  input Real XefH2O "H2O mass fraction";
-  input Real XefO2 "O2 mass fraction";
-  input Real XefN2 "N2 mass fraction";
-  input Real XefSO2 "SO2 mass fraction";
-
-  output Real propf[4] "Flue gases physical properties vector";
-
-protected
-  Units.SI.ThermalConductivity condf "Flue gases thermal conductivity";
-  Units.SI.SpecificHeatCapacity cpf "Flue gases specific heat capacity";
-  Units.SI.DynamicViscosity muf "Flue gases dynamic viscosity";
-  Units.SI.Density rhof "Flue gases density";
-
-algorithm
-  condf := ThermoSysPro.Properties.FlueGases.FlueGases_k(Pmf, Tmf, XefCO2, XefH2O, XefO2, XefSO2);
-  cpf := ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pmf, Tmf, XefCO2, XefH2O, XefO2, XefSO2);
-  muf := ThermoSysPro.Properties.FlueGases.FlueGases_mu(Pmf, Tmf, XefCO2, XefH2O, XefO2, XefSO2);
-  rhof := ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pmf, Tmf, XefCO2, XefH2O, XefO2, XefSO2);
-
-  propf[1] := condf;
-  propf[2] := cpf;
-  propf[3] := muf;
-  propf[4] := rhof;
-
-  annotation (
-    smoothOrder=2,
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-end PropFlueGases;
+within ThermoSysPro.Correlations.Misc;
+function PropFlueGases "Computation of the flue gases properties"
+  input Units.SI.AbsolutePressure Pmf "Flue gases average pressure";
+  input Units.SI.Temperature Tmf "Flue gases average temperature";
+  input Real XefCO2 "CO2 mass fraction";
+  input Real XefH2O "H2O mass fraction";
+  input Real XefO2 "O2 mass fraction";
+  input Real XefN2 "N2 mass fraction";
+  input Real XefSO2 "SO2 mass fraction";
+
+  output Real propf[4] "Flue gases physical properties vector";
+
+protected
+  Units.SI.ThermalConductivity condf "Flue gases thermal conductivity";
+  Units.SI.SpecificHeatCapacity cpf "Flue gases specific heat capacity";
+  Units.SI.DynamicViscosity muf "Flue gases dynamic viscosity";
+  Units.SI.Density rhof "Flue gases density";
+
+algorithm
+  condf := ThermoSysPro.Properties.FlueGases.FlueGases_k(Pmf, Tmf, XefCO2, XefH2O, XefO2, XefSO2);
+  cpf := ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pmf, Tmf, XefCO2, XefH2O, XefO2, XefSO2);
+  muf := ThermoSysPro.Properties.FlueGases.FlueGases_mu(Pmf, Tmf, XefCO2, XefH2O, XefO2, XefSO2);
+  rhof := ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pmf, Tmf, XefCO2, XefH2O, XefO2, XefSO2);
+
+  propf[1] := condf;
+  propf[2] := cpf;
+  propf[3] := muf;
+  propf[4] := rhof;
+
+  annotation (
+    smoothOrder=2,
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+end PropFlueGases;
diff --git a/ThermoSysPro/Correlations/Misc/PropWaterSteam.mo b/ThermoSysPro/Correlations/Misc/PropWaterSteam.mo
index dd649a4111785b889483100793f8b619c65f9ca8..e28b2158285c9ea9eb78d95aab3c016bbd3b68b4 100644
--- a/ThermoSysPro/Correlations/Misc/PropWaterSteam.mo
+++ b/ThermoSysPro/Correlations/Misc/PropWaterSteam.mo
@@ -1,111 +1,111 @@
-within ThermoSysPro.Correlations.Misc;
-function PropWaterSteam "Computation of the water/steam properties"
-  input Units.SI.AbsolutePressure Pmc "Water/steam average pressure";
-  input Units.SI.SpecificEnthalpy Hmc "Water/steam average specific enthalpy";
-  input Real Xmc "Steam average mass fraction";
-
-protected
-  constant Units.SI.AbsolutePressure Pc=221.2e5 "Critical pressure";
-  Units.SI.Temperature Tsat1 "Saturation temperature at Pmc";
-  Units.SI.Temperature T "Water/steam mixture temperature";
-  Units.SI.SpecificEnthalpy hlv "Water/steam mixture specific enthalpy";
-  Units.SI.Density rholv "Water/steam mixture density";
-  Units.SI.Density rhol "Water density";
-  Units.SI.Density rhov "Steam density";
-  Units.SI.SpecificEnthalpy hl "Water specific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Steam specific enthalpy";
-  Units.SI.SpecificEnergy lv "Phase transition energy";
-  Units.SI.SpecificHeatCapacity cpl "Water specific heat capacity";
-  Units.SI.SpecificHeatCapacity cpv "Steam specific heat capacity";
-  Units.SI.DynamicViscosity mul "Water dynamic viscosity";
-  Units.SI.DynamicViscosity muv "Steam dynamic viscosity";
-  Units.SI.ThermalConductivity kl "Water thermal conductivity";
-  Units.SI.ThermalConductivity kv "Steam thermal conductivity";
-  Units.SI.SurfaceTension tsl "Water surface tensiton";
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsatm
-                                   annotation (Placement(transformation(extent=
-            {{-40,40},{-20,60}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsatm
-                                   annotation (Placement(transformation(extent=
-            {{0,40},{20,60}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0)));
-public
-  output ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
-                                           annotation (Placement(transformation(
-          extent={{0,0},{20,20}}, rotation=0)));
-algorithm
-
-  /* Saturation temperature at Pmc */
-  Tsat1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Pmc);
-  (lsatm, vsatm) := ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Pmc);
-  prol := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmc, Hmc, 0);
-
-  if ((0 < Xmc) and (Xmc < 1) and (Pmc < Pc)) then
-    T := Tsat1;
-    hlv := Hmc;
-    rholv := prol.d;
-    rhol := lsatm.rho;
-    rhov := vsatm.rho;
-    hl := lsatm.h;
-    hv := vsatm.h;
-    cpl := lsatm.cp;
-    cpv := vsatm.cp;
-  else
-    T := prol.T;
-    rhol := prol.d;
-    rhov := rhol;
-    hl := Hmc;
-    hv := hl;
-    cpl := prol.cp;
-    cpv := cpl;
-  end if;
-
-  /* Water/steam properties */
-  lv := hv - hl;
-  mul := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol, T);
-  muv := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov, T);
-  kl := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol, T, Pmc, 0);
-  kv := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhov, T, Pmc, 0);
-
-  if (Pmc > 220e5) then
-    tsl := 6e-6;
-  elseif (abs(Pmc) < 1e-6) then
-    tsl := 5e-2;
-  else
-    tsl := ThermoSysPro.Properties.WaterSteam.IF97.SurfaceTension_T(Tsat1);
-  end if;
-
-  hy.rhol := rhol;
-  hy.rhov := rhov;
-  hy.hl := hl;
-  hy.hl := hv;
-  hy.lv := lv;
-  hy.cpl := cpl;
-  hy.cpv := cpv;
-  hy.mul := mul;
-  hy.muv := muv;
-  hy.kl := kl;
-  hy.kv := kv;
-  hy.tsl := tsl;
-  hy.rholv := rholv;
-  hy.hlv := hlv;
-
-  annotation (
-    smoothOrder=2,
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-end PropWaterSteam;
+within ThermoSysPro.Correlations.Misc;
+function PropWaterSteam "Computation of the water/steam properties"
+  input Units.SI.AbsolutePressure Pmc "Water/steam average pressure";
+  input Units.SI.SpecificEnthalpy Hmc "Water/steam average specific enthalpy";
+  input Real Xmc "Steam average mass fraction";
+
+protected
+  constant Units.SI.AbsolutePressure Pc=221.2e5 "Critical pressure";
+  Units.SI.Temperature Tsat1 "Saturation temperature at Pmc";
+  Units.SI.Temperature T "Water/steam mixture temperature";
+  Units.SI.SpecificEnthalpy hlv "Water/steam mixture specific enthalpy";
+  Units.SI.Density rholv "Water/steam mixture density";
+  Units.SI.Density rhol "Water density";
+  Units.SI.Density rhov "Steam density";
+  Units.SI.SpecificEnthalpy hl "Water specific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Steam specific enthalpy";
+  Units.SI.SpecificEnergy lv "Phase transition energy";
+  Units.SI.SpecificHeatCapacity cpl "Water specific heat capacity";
+  Units.SI.SpecificHeatCapacity cpv "Steam specific heat capacity";
+  Units.SI.DynamicViscosity mul "Water dynamic viscosity";
+  Units.SI.DynamicViscosity muv "Steam dynamic viscosity";
+  Units.SI.ThermalConductivity kl "Water thermal conductivity";
+  Units.SI.ThermalConductivity kv "Steam thermal conductivity";
+  Units.SI.SurfaceTension tsl "Water surface tensiton";
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsatm
+                                   annotation (Placement(transformation(extent=
+            {{-40,40},{-20,60}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsatm
+                                   annotation (Placement(transformation(extent=
+            {{0,40},{20,60}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0)));
+public
+  output ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
+                                           annotation (Placement(transformation(
+          extent={{0,0},{20,20}}, rotation=0)));
+algorithm
+
+  /* Saturation temperature at Pmc */
+  Tsat1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Pmc);
+  (lsatm, vsatm) := ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Pmc);
+  prol := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmc, Hmc, 0);
+
+  if ((0 < Xmc) and (Xmc < 1) and (Pmc < Pc)) then
+    T := Tsat1;
+    hlv := Hmc;
+    rholv := prol.d;
+    rhol := lsatm.rho;
+    rhov := vsatm.rho;
+    hl := lsatm.h;
+    hv := vsatm.h;
+    cpl := lsatm.cp;
+    cpv := vsatm.cp;
+  else
+    T := prol.T;
+    rhol := prol.d;
+    rhov := rhol;
+    hl := Hmc;
+    hv := hl;
+    cpl := prol.cp;
+    cpv := cpl;
+  end if;
+
+  /* Water/steam properties */
+  lv := hv - hl;
+  mul := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol, T);
+  muv := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov, T);
+  kl := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol, T, Pmc, 0);
+  kv := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhov, T, Pmc, 0);
+
+  if (Pmc > 220e5) then
+    tsl := 6e-6;
+  elseif (abs(Pmc) < 1e-6) then
+    tsl := 5e-2;
+  else
+    tsl := ThermoSysPro.Properties.WaterSteam.IF97.SurfaceTension_T(Tsat1);
+  end if;
+
+  hy.rhol := rhol;
+  hy.rhov := rhov;
+  hy.hl := hl;
+  hy.hl := hv;
+  hy.lv := lv;
+  hy.cpl := cpl;
+  hy.cpv := cpv;
+  hy.mul := mul;
+  hy.muv := muv;
+  hy.kl := kl;
+  hy.kv := kv;
+  hy.tsl := tsl;
+  hy.rholv := rholv;
+  hy.hlv := hlv;
+
+  annotation (
+    smoothOrder=2,
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+end PropWaterSteam;
diff --git a/ThermoSysPro/Correlations/Misc/WBCorrectiveDiameterCoefficient.mo b/ThermoSysPro/Correlations/Misc/WBCorrectiveDiameterCoefficient.mo
index b5e840ae94ff82b8e4432543fdef10175c282228..7049b8fc6c5329e4b42c9c04513ad91f6c8d747a 100644
--- a/ThermoSysPro/Correlations/Misc/WBCorrectiveDiameterCoefficient.mo
+++ b/ThermoSysPro/Correlations/Misc/WBCorrectiveDiameterCoefficient.mo
@@ -1,43 +1,43 @@
-within ThermoSysPro.Correlations.Misc;
-function WBCorrectiveDiameterCoefficient "Corrective diameter coefficient"
-  input Real PasTD "Transverse step on the diameter";
-  input Real PasLD "Longitudinal steap on the diameter";
-  input Units.SI.Diameter Dext "Pipes external diameter";
-  input Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation";
-
-  output Real Optl;
-
-protected
-  constant Real TabTD[6]={1.,1.6,2.2,3.,3.6,6.};
-  constant Real TabLD[4]={1.,2.,3.,4.};
-  constant Real TabOpt[4, 6]=[0.4, 1., 2.3, 5.1, 6.8, 12.; 1.7, 3.1, 5., 7.1,
-      8.5, 13.1; 5.1, 6.3, 7.5, 9.1, 10.2, 14.3; 7.7, 8.7, 9.7, 11., 11.9, 16.];
-  Real Opt "Interpolated parameter";
-algorithm
-
-  if (PasLD > 0) then
-    if (option_interpolation == 1) then
-      Opt := ThermoSysPro.Functions.TableLinearInterpolation(TabLD, TabTD, TabOpt, PasLD, PasTD);
-    elseif (option_interpolation == 2) then
-      Opt := ThermoSysPro.Functions.TableSplineInterpolation(TabLD, TabTD, TabOpt, PasLD, PasTD);
-    else
-      assert(false, "WBCorrectiveDiameterCoefficient: incorrect interpolation option");
-    end if;
-    Optl := Opt*Dext;
-  else
-    Optl := 0;
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Icon(graphics),        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end WBCorrectiveDiameterCoefficient;
+within ThermoSysPro.Correlations.Misc;
+function WBCorrectiveDiameterCoefficient "Corrective diameter coefficient"
+  input Real PasTD "Transverse step on the diameter";
+  input Real PasLD "Longitudinal steap on the diameter";
+  input Units.SI.Diameter Dext "Pipes external diameter";
+  input Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation";
+
+  output Real Optl;
+
+protected
+  constant Real TabTD[6]={1.,1.6,2.2,3.,3.6,6.};
+  constant Real TabLD[4]={1.,2.,3.,4.};
+  constant Real TabOpt[4, 6]=[0.4, 1., 2.3, 5.1, 6.8, 12.; 1.7, 3.1, 5., 7.1,
+      8.5, 13.1; 5.1, 6.3, 7.5, 9.1, 10.2, 14.3; 7.7, 8.7, 9.7, 11., 11.9, 16.];
+  Real Opt "Interpolated parameter";
+algorithm
+
+  if (PasLD > 0) then
+    if (option_interpolation == 1) then
+      Opt := ThermoSysPro.Functions.TableLinearInterpolation(TabLD, TabTD, TabOpt, PasLD, PasTD);
+    elseif (option_interpolation == 2) then
+      Opt := ThermoSysPro.Functions.TableSplineInterpolation(TabLD, TabTD, TabOpt, PasLD, PasTD);
+    else
+      assert(false, "WBCorrectiveDiameterCoefficient: incorrect interpolation option");
+    end if;
+    Optl := Opt*Dext;
+  else
+    Optl := 0;
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Icon(graphics),        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end WBCorrectiveDiameterCoefficient;
diff --git a/ThermoSysPro/Correlations/Misc/package.mo b/ThermoSysPro/Correlations/Misc/package.mo
index 1082513b38592373df3e4f57d47af73d17290fe4..224f86f732eba70e990edfc58209d643858ac10c 100644
--- a/ThermoSysPro/Correlations/Misc/package.mo
+++ b/ThermoSysPro/Correlations/Misc/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Correlations;
-package Misc "Miscelleanous correlations"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Misc;
+within ThermoSysPro.Correlations;
+package Misc "Miscelleanous correlations"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Misc;
diff --git a/ThermoSysPro/Correlations/Misc/package.order b/ThermoSysPro/Correlations/Misc/package.order
index 99a6811cfca8b108d1f9f62ce083c20094ba278c..b086bbb81dc373fdf1b3c7d72193ac665b08bf2c 100644
--- a/ThermoSysPro/Correlations/Misc/package.order
+++ b/ThermoSysPro/Correlations/Misc/package.order
@@ -1,7 +1,7 @@
-Function_FM
-Pro_FlueGases
-Pro_TwoPhaseWaterSteam
-Pro_WaterSteam
-PropFlueGases
-PropWaterSteam
-WBCorrectiveDiameterCoefficient
+Function_FM
+Pro_FlueGases
+Pro_TwoPhaseWaterSteam
+Pro_WaterSteam
+PropFlueGases
+PropWaterSteam
+WBCorrectiveDiameterCoefficient
diff --git a/ThermoSysPro/Correlations/Thermal/Function_U1.mo b/ThermoSysPro/Correlations/Thermal/Function_U1.mo
index a35b08186175246c5f44e325714e3535770deb1c..a36ca6701ebc4a74a18dc07f16067c96031dd86d 100644
--- a/ThermoSysPro/Correlations/Thermal/Function_U1.mo
+++ b/ThermoSysPro/Correlations/Thermal/Function_U1.mo
@@ -1,81 +1,81 @@
-within ThermoSysPro.Correlations.Thermal;
-function Function_U1 "Calculation of the uncorrected heat transfer coefficient"
-  input Units.SI.Diameter D_tubes "Weight average thickness of tubes";
-  input Units.SI.Velocity Vf "Velocity of cold water";
-
-protected
-  Real U11;
-  Real U12;
-  Real U13;
-  Real U14;
-  Real U15;
-  Real U16;
-
-public
-  output Real U1 "Uncorrected heat transfer coefficient";
-
-algorithm
-  U11 :=1.348357E+01*Vf^3 - 2.483302E+02*Vf^2 + 1.791513E+03*Vf + 1.184589E+03;
-  U12 :=1.339090E+01*Vf^3 - 2.476065E+02*Vf^2 + 1.774936E+03*Vf + 1.157884E+03;
-  U13 :=1.193064E+01*Vf^3 - 2.382921E+02*Vf^2 + 1.738812E+03*Vf + 1.146127E+03;
-  U14 :=1.119801E+01*Vf^3 - 2.319792E+02*Vf^2 + 1.707795E+03*Vf + 1.130690E+03;
-  U15 :=1.249170E+01*Vf^3 - 2.405850E+02*Vf^2 + 1.707789E+03*Vf + 1.096353E+03;
-  U16 :=1.139964E+01*Vf^3 - 2.309074E+02*Vf^2 + 1.669797E+03*Vf + 1.084915E+03;
-
-   if (D_tubes >= 0.01588) and (D_tubes <= 0.01905) then
-    U1 :=1.348357E+01*Vf^3 - 2.483302E+02*Vf^2 + 1.791513E+03*Vf + 1.184589E+03;
-   else
-    if (D_tubes > 0.01905) and (D_tubes < 0.0223) then
-      U1 := U11 - (U11 - U12)/(0.0223 - 0.01905)*(D_tubes - 0.01905);
-    else
-      if (D_tubes >= 0.0223) and (D_tubes <= 0.0254) then
-        U1 :=1.339090E+01*Vf^3 - 2.476065E+02*Vf^2 + 1.774936E+03*Vf +
-          1.157884E+03;
-      else
-        if (D_tubes > 0.0254) and (D_tubes <0.02858) then
-          U1 :=U12 - (U12 - U13)/(0.02858 - 0.0254)*(D_tubes - 0.0254);
-        else
-          if (D_tubes >= 0.02858) and (D_tubes <= 0.03175) then
-            U1 :=1.193064E+01*Vf^3 - 2.382921E+02*Vf^2 + 1.738812E+03*Vf +
-              1.146127E+03;
-          else
-            if (D_tubes > 0.03175) and (D_tubes <0.03493) then
-              U1 :=U13 - (U13 - U14)/(0.03493 - 0.03175)*(D_tubes - 0.03175);
-            else
-              if (D_tubes >= 0.03493) and (D_tubes <= 0.0381) then
-                U1 :=1.119801E+01*Vf^3 - 2.319792E+02*Vf^2 + 1.707795E+03*Vf +
-                  1.130690E+03;
-              else
-                if (D_tubes > 0.0381) and (D_tubes <0.04128) then
-                  U1 :=U14 - (U14 - U15)/(0.04128 - 0.0381)*(D_tubes - 0.0381);
-                else
-                  if (D_tubes >= 0.04128) and (D_tubes <= 0.04445) then
-                    U1 :=1.249170E+01*Vf^3 - 2.405850E+02*Vf^2 + 1.707789E+03*
-                      Vf + 1.096353E+03;
-                  else
-                    if (D_tubes > 0.04445) and (D_tubes <0.04763) then
-                      U1 :=U15 - (U15 - U16)/(0.04763 - 0.04445)*(D_tubes -
-                        0.04445);
-                    else
-                      if (D_tubes >= 0.04763) and (D_tubes <= 0.0508) then
-                         U1 :=1.139964E+01*Vf^3 - 2.309074E+02*Vf^2 +
-                          1.669797E+03*Vf + 1.084915E+03;
-                      else
-                              U1 :=0;
-                      end if;
-                    end if;
-                  end if;
-                end if;
-              end if;
-            end if;
-          end if;
-        end if;
-      end if;
-    end if;
-  end if;
-
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end Function_U1;
+within ThermoSysPro.Correlations.Thermal;
+function Function_U1 "Calculation of the uncorrected heat transfer coefficient"
+  input Units.SI.Diameter D_tubes "Weight average thickness of tubes";
+  input Units.SI.Velocity Vf "Velocity of cold water";
+
+protected
+  Real U11;
+  Real U12;
+  Real U13;
+  Real U14;
+  Real U15;
+  Real U16;
+
+public
+  output Real U1 "Uncorrected heat transfer coefficient";
+
+algorithm
+  U11 :=1.348357E+01*Vf^3 - 2.483302E+02*Vf^2 + 1.791513E+03*Vf + 1.184589E+03;
+  U12 :=1.339090E+01*Vf^3 - 2.476065E+02*Vf^2 + 1.774936E+03*Vf + 1.157884E+03;
+  U13 :=1.193064E+01*Vf^3 - 2.382921E+02*Vf^2 + 1.738812E+03*Vf + 1.146127E+03;
+  U14 :=1.119801E+01*Vf^3 - 2.319792E+02*Vf^2 + 1.707795E+03*Vf + 1.130690E+03;
+  U15 :=1.249170E+01*Vf^3 - 2.405850E+02*Vf^2 + 1.707789E+03*Vf + 1.096353E+03;
+  U16 :=1.139964E+01*Vf^3 - 2.309074E+02*Vf^2 + 1.669797E+03*Vf + 1.084915E+03;
+
+   if (D_tubes >= 0.01588) and (D_tubes <= 0.01905) then
+    U1 :=1.348357E+01*Vf^3 - 2.483302E+02*Vf^2 + 1.791513E+03*Vf + 1.184589E+03;
+   else
+    if (D_tubes > 0.01905) and (D_tubes < 0.0223) then
+      U1 := U11 - (U11 - U12)/(0.0223 - 0.01905)*(D_tubes - 0.01905);
+    else
+      if (D_tubes >= 0.0223) and (D_tubes <= 0.0254) then
+        U1 :=1.339090E+01*Vf^3 - 2.476065E+02*Vf^2 + 1.774936E+03*Vf +
+          1.157884E+03;
+      else
+        if (D_tubes > 0.0254) and (D_tubes <0.02858) then
+          U1 :=U12 - (U12 - U13)/(0.02858 - 0.0254)*(D_tubes - 0.0254);
+        else
+          if (D_tubes >= 0.02858) and (D_tubes <= 0.03175) then
+            U1 :=1.193064E+01*Vf^3 - 2.382921E+02*Vf^2 + 1.738812E+03*Vf +
+              1.146127E+03;
+          else
+            if (D_tubes > 0.03175) and (D_tubes <0.03493) then
+              U1 :=U13 - (U13 - U14)/(0.03493 - 0.03175)*(D_tubes - 0.03175);
+            else
+              if (D_tubes >= 0.03493) and (D_tubes <= 0.0381) then
+                U1 :=1.119801E+01*Vf^3 - 2.319792E+02*Vf^2 + 1.707795E+03*Vf +
+                  1.130690E+03;
+              else
+                if (D_tubes > 0.0381) and (D_tubes <0.04128) then
+                  U1 :=U14 - (U14 - U15)/(0.04128 - 0.0381)*(D_tubes - 0.0381);
+                else
+                  if (D_tubes >= 0.04128) and (D_tubes <= 0.04445) then
+                    U1 :=1.249170E+01*Vf^3 - 2.405850E+02*Vf^2 + 1.707789E+03*
+                      Vf + 1.096353E+03;
+                  else
+                    if (D_tubes > 0.04445) and (D_tubes <0.04763) then
+                      U1 :=U15 - (U15 - U16)/(0.04763 - 0.04445)*(D_tubes -
+                        0.04445);
+                    else
+                      if (D_tubes >= 0.04763) and (D_tubes <= 0.0508) then
+                         U1 :=1.139964E+01*Vf^3 - 2.309074E+02*Vf^2 +
+                          1.669797E+03*Vf + 1.084915E+03;
+                      else
+                              U1 :=0;
+                      end if;
+                    end if;
+                  end if;
+                end if;
+              end if;
+            end if;
+          end if;
+        end if;
+      end if;
+    end if;
+  end if;
+
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end Function_U1;
diff --git a/ThermoSysPro/Correlations/Thermal/WBCrossedCurrentConvectiveHeatTransferCoefficient.mo b/ThermoSysPro/Correlations/Thermal/WBCrossedCurrentConvectiveHeatTransferCoefficient.mo
index 90a430276ff65aa45b8d8de3cbe07af53c98e2b0..510c3b24e7b33ec78b9d1500f8b0a322b7e8b16f 100644
--- a/ThermoSysPro/Correlations/Thermal/WBCrossedCurrentConvectiveHeatTransferCoefficient.mo
+++ b/ThermoSysPro/Correlations/Thermal/WBCrossedCurrentConvectiveHeatTransferCoefficient.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.Correlations.Thermal;
-function WBCrossedCurrentConvectiveHeatTransferCoefficient
-  "Convective heat transfer coefficient for crossed current heat exchangers"
-  input Units.SI.Temperature TFilm "Film temperature";
-  input Units.SI.MassFlowRate Qf "Flue gases mass flow rate";
-  input Real Xh2o "H2O mass fraction in the flue gases";
-  input Units.SI.Area Sgaz "Geometrical parameter";
-  input Units.SI.Diameter Dext "Pipes external diameter";
-  input Real Fa "Pipes position coefficient";
-  input Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation";
-
-  output Units.SI.CoefficientOfHeatTransfer Kcfc
-    "Convective heat transfer coefficient for crossed current heat exchanger";
-
-protected
-  Real Dextb "Pipes external diameter in feet";
-  Real Qfb "Flue gases mass flow rate in pound/hour";
-  Real Sgazb "Sgaz in feet^2";
-  Real TFilmb "Film temperature in Farenheit";
-
-  //**********************************************************************************
-  //   Values of "Physical properties factor" for cross-current combustion flue gases
-  //   taken from "The Babcock & Wilcox Company - STEAM/its generation and use"
-  //**********************************************************************************/
-  constant Real TabUm[5]={0,5,10,15,20};
-  constant Real TabTFilm[6]={0,600,1200,1800,2400,3000};
-  constant Real TabFpp[5, 6]=[0.0825, 0.11, 0.129, 0.142, 0.155, 0.165; 0.085,
-      0.112, 0.132, 0.148, 0.161, 0.172; 0.087, 0.114, 0.136, 0.152, 0.167,
-      0.18; 0.0885, 0.117, 0.139, 0.158, 0.173, 0.1872; 0.09, 0.1183, 0.1422,
-      0.163, 0.18, 0.195];
-
-  Real CondConv "Base convective conductance";
-  Real MassFlow "Mass flow rate";
-  Real Fpp "Physical properties factor";
-  Real Kcb "Heat transfer coefficient in English units";
-algorithm
-
-  /* Conversion from SI units to English units */
-  Dextb := 3.28084*Dext;
-  Qfb := 2.20462*3600.*Qf + 0.5;
-  Sgazb := 10.7369*Sgaz;
-  TFilmb := 9/5*TFilm - 459.69;
-
-  /* Mass flow rate */
-  MassFlow := abs(Qfb)/Sgazb;
-
-  /* Base convective conductance */
-  CondConv := 0.287*MassFlow^0.61/Dextb^0.39;
-
-  /* Physical properties factor */
-  if (option_interpolation == 1) then
-    Fpp := ThermoSysPro.Functions.TableLinearInterpolation(TabUm, TabTFilm, TabFpp, Xh2o, TFilmb);
-  elseif (option_interpolation == 2) then
-    Fpp := ThermoSysPro.Functions.TableSplineInterpolation(TabUm, TabTFilm, TabFpp, Xh2o, TFilmb);
-  else
-    assert(false, "WBCrossedCurrentConvectiveHeatTransferCoefficient: incorrect interpolation option");
-  end if;
-
-  /* Heat transfer coefficient for crossed-current flue gases */
-  Kcb := CondConv*Fpp*Fa;
-
-  /* Conversion from English units to SI units */
-  Kcfc := 5.67826*Kcb;
-
-  annotation (
-      smoothOrder=2,
-      Icon(graphics),      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end WBCrossedCurrentConvectiveHeatTransferCoefficient;
+within ThermoSysPro.Correlations.Thermal;
+function WBCrossedCurrentConvectiveHeatTransferCoefficient
+  "Convective heat transfer coefficient for crossed current heat exchangers"
+  input Units.SI.Temperature TFilm "Film temperature";
+  input Units.SI.MassFlowRate Qf "Flue gases mass flow rate";
+  input Real Xh2o "H2O mass fraction in the flue gases";
+  input Units.SI.Area Sgaz "Geometrical parameter";
+  input Units.SI.Diameter Dext "Pipes external diameter";
+  input Real Fa "Pipes position coefficient";
+  input Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation";
+
+  output Units.SI.CoefficientOfHeatTransfer Kcfc
+    "Convective heat transfer coefficient for crossed current heat exchanger";
+
+protected
+  Real Dextb "Pipes external diameter in feet";
+  Real Qfb "Flue gases mass flow rate in pound/hour";
+  Real Sgazb "Sgaz in feet^2";
+  Real TFilmb "Film temperature in Farenheit";
+
+  //**********************************************************************************
+  //   Values of "Physical properties factor" for cross-current combustion flue gases
+  //   taken from "The Babcock & Wilcox Company - STEAM/its generation and use"
+  //**********************************************************************************/
+  constant Real TabUm[5]={0,5,10,15,20};
+  constant Real TabTFilm[6]={0,600,1200,1800,2400,3000};
+  constant Real TabFpp[5, 6]=[0.0825, 0.11, 0.129, 0.142, 0.155, 0.165; 0.085,
+      0.112, 0.132, 0.148, 0.161, 0.172; 0.087, 0.114, 0.136, 0.152, 0.167,
+      0.18; 0.0885, 0.117, 0.139, 0.158, 0.173, 0.1872; 0.09, 0.1183, 0.1422,
+      0.163, 0.18, 0.195];
+
+  Real CondConv "Base convective conductance";
+  Real MassFlow "Mass flow rate";
+  Real Fpp "Physical properties factor";
+  Real Kcb "Heat transfer coefficient in English units";
+algorithm
+
+  /* Conversion from SI units to English units */
+  Dextb := 3.28084*Dext;
+  Qfb := 2.20462*3600.*Qf + 0.5;
+  Sgazb := 10.7369*Sgaz;
+  TFilmb := 9/5*TFilm - 459.69;
+
+  /* Mass flow rate */
+  MassFlow := abs(Qfb)/Sgazb;
+
+  /* Base convective conductance */
+  CondConv := 0.287*MassFlow^0.61/Dextb^0.39;
+
+  /* Physical properties factor */
+  if (option_interpolation == 1) then
+    Fpp := ThermoSysPro.Functions.TableLinearInterpolation(TabUm, TabTFilm, TabFpp, Xh2o, TFilmb);
+  elseif (option_interpolation == 2) then
+    Fpp := ThermoSysPro.Functions.TableSplineInterpolation(TabUm, TabTFilm, TabFpp, Xh2o, TFilmb);
+  else
+    assert(false, "WBCrossedCurrentConvectiveHeatTransferCoefficient: incorrect interpolation option");
+  end if;
+
+  /* Heat transfer coefficient for crossed-current flue gases */
+  Kcb := CondConv*Fpp*Fa;
+
+  /* Conversion from English units to SI units */
+  Kcfc := 5.67826*Kcb;
+
+  annotation (
+      smoothOrder=2,
+      Icon(graphics),      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end WBCrossedCurrentConvectiveHeatTransferCoefficient;
diff --git a/ThermoSysPro/Correlations/Thermal/WBFlueGasesHeatTransferCoefficient.mo b/ThermoSysPro/Correlations/Thermal/WBFlueGasesHeatTransferCoefficient.mo
index 5aab2a4cef1da0c4ff530c47952235a4752d9a8c..48038f9804c1084ca8495014b621b0a8c7e0c2a8 100644
--- a/ThermoSysPro/Correlations/Thermal/WBFlueGasesHeatTransferCoefficient.mo
+++ b/ThermoSysPro/Correlations/Thermal/WBFlueGasesHeatTransferCoefficient.mo
@@ -1,93 +1,93 @@
-within ThermoSysPro.Correlations.Thermal;
-function WBFlueGasesHeatTransferCoefficient
-  "Flue gases heat transfer coefficient"
-  input Real propf[4] "Flue gases properties vector";
-  input Units.SI.MassFlowRate Qef "Flue gases mass flow rate at the inlet";
-  input Units.SI.AbsolutePressure Pmf "Flue gases average pressure";
-  input Units.SI.Temperature Tmf "Flue gases average temperature";
-  input Real XefCO2 "CO2 mass fraction at the inlet";
-  input Real XefH2O "H2O mass fraction at the inlet";
-  input Units.SI.PathLength dz "Step in the z direction";
-  input Units.SI.Length long "Wall zone length";
-  input Units.SI.Length prof "Wall zone width";
-  input Units.SI.Temperature Tpext "External wall temperature";
-  input Real fvd=0 "Particles volume fraction";
-  input Real emimur=0.1 "Wall emissivity";
-
-  output Units.SI.CoefficientOfHeatTransfer hf
-    "Global heat transfer coefficient";
-
-protected
-  Units.SI.ThermalConductivity condf "Flue gases thermal conductivity";
-  Units.SI.SpecificHeatCapacity cpf "Flue gases specific heat capacity";
-  Units.SI.DynamicViscosity muf "Flue gases dynamic viscosity";
-  Real Ref "Flue gases Reynolds number";
-  Real Prf "Flue gases Prandtl number";
-  Units.SI.CoefficientOfHeatTransfer hc
-    "Flue gases convective heat transfer coefficient";
-  Units.SI.Volume volumg "Gas volume";
-  Units.SI.Area senveng "Gas total envelope surface";
-  Units.SI.Radius rop "Average optical radius between pipes";
-  Real EG " ";
-  Real ES " ";
-  Real emigaz "Gas emissivity";
-  Real emigaz0 "Gas emissivity";
-  Units.SI.CoefficientOfHeatTransfer hr "Radiation heat transfer coefficient";
-
-algorithm
-  condf := propf[1];
-  cpf := propf[2];
-  muf := propf[3];
-
-  /* Reynolds number */
-  Ref := Qef*dz/(muf*prof*long);
-
-  /* Prandtl number */
-  Prf:=muf*cpf/condf;
-
-  /* Convective heat transfer coefficient */
-  if (Ref <= 3e5) then
-    /* Laminar regime */
-    hc := 0.66*(Ref^0.5)*(Prf^0.333)*condf/dz;
-  else
-    /* Turbulent regime */
-    hc := 0.036*(Ref^0.8)*(Prf^0.333)*condf/dz;
-  end if;
-
-  /* Flue gases radiation */
-  volumg := dz*long*prof;
-  senveng := 2*dz*long + 2*dz*prof + 2*long*prof;
-  rop := 3.6*volumg/senveng;
-
-  (EG, ES, emigaz0) := ThermoSysPro.Properties.FlueGases.FlueGases_Absorb(XefCO2*Pmf, XefH2O*Pmf, fvd,rop, Tmf);
-
-  if (emigaz0 < 0.0001) then
-    emigaz := 0.0001;
-  elseif (emigaz0 > 1) then
-    emigaz := 0.99;
-  else
-    emigaz := emigaz0;
-  end if;
-
-  /* Radiation heat transfer coefficient */
-  hr := 5.68e-8/(1/emigaz + (1 - emimur)/emimur)*(Tmf^2 + Tpext^2)*(Tmf + Tpext);
-
-  /* Flue gases heat transfer coefficient */
-  hf := hc + hr;
-
-  annotation (
-    smoothOrder=2,
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-end WBFlueGasesHeatTransferCoefficient;
+within ThermoSysPro.Correlations.Thermal;
+function WBFlueGasesHeatTransferCoefficient
+  "Flue gases heat transfer coefficient"
+  input Real propf[4] "Flue gases properties vector";
+  input Units.SI.MassFlowRate Qef "Flue gases mass flow rate at the inlet";
+  input Units.SI.AbsolutePressure Pmf "Flue gases average pressure";
+  input Units.SI.Temperature Tmf "Flue gases average temperature";
+  input Real XefCO2 "CO2 mass fraction at the inlet";
+  input Real XefH2O "H2O mass fraction at the inlet";
+  input Units.SI.PathLength dz "Step in the z direction";
+  input Units.SI.Length long "Wall zone length";
+  input Units.SI.Length prof "Wall zone width";
+  input Units.SI.Temperature Tpext "External wall temperature";
+  input Real fvd=0 "Particles volume fraction";
+  input Real emimur=0.1 "Wall emissivity";
+
+  output Units.SI.CoefficientOfHeatTransfer hf
+    "Global heat transfer coefficient";
+
+protected
+  Units.SI.ThermalConductivity condf "Flue gases thermal conductivity";
+  Units.SI.SpecificHeatCapacity cpf "Flue gases specific heat capacity";
+  Units.SI.DynamicViscosity muf "Flue gases dynamic viscosity";
+  Real Ref "Flue gases Reynolds number";
+  Real Prf "Flue gases Prandtl number";
+  Units.SI.CoefficientOfHeatTransfer hc
+    "Flue gases convective heat transfer coefficient";
+  Units.SI.Volume volumg "Gas volume";
+  Units.SI.Area senveng "Gas total envelope surface";
+  Units.SI.Radius rop "Average optical radius between pipes";
+  Real EG " ";
+  Real ES " ";
+  Real emigaz "Gas emissivity";
+  Real emigaz0 "Gas emissivity";
+  Units.SI.CoefficientOfHeatTransfer hr "Radiation heat transfer coefficient";
+
+algorithm
+  condf := propf[1];
+  cpf := propf[2];
+  muf := propf[3];
+
+  /* Reynolds number */
+  Ref := Qef*dz/(muf*prof*long);
+
+  /* Prandtl number */
+  Prf:=muf*cpf/condf;
+
+  /* Convective heat transfer coefficient */
+  if (Ref <= 3e5) then
+    /* Laminar regime */
+    hc := 0.66*(Ref^0.5)*(Prf^0.333)*condf/dz;
+  else
+    /* Turbulent regime */
+    hc := 0.036*(Ref^0.8)*(Prf^0.333)*condf/dz;
+  end if;
+
+  /* Flue gases radiation */
+  volumg := dz*long*prof;
+  senveng := 2*dz*long + 2*dz*prof + 2*long*prof;
+  rop := 3.6*volumg/senveng;
+
+  (EG, ES, emigaz0) := ThermoSysPro.Properties.FlueGases.FlueGases_Absorb(XefCO2*Pmf, XefH2O*Pmf, fvd,rop, Tmf);
+
+  if (emigaz0 < 0.0001) then
+    emigaz := 0.0001;
+  elseif (emigaz0 > 1) then
+    emigaz := 0.99;
+  else
+    emigaz := emigaz0;
+  end if;
+
+  /* Radiation heat transfer coefficient */
+  hr := 5.68e-8/(1/emigaz + (1 - emimur)/emimur)*(Tmf^2 + Tpext^2)*(Tmf + Tpext);
+
+  /* Flue gases heat transfer coefficient */
+  hf := hc + hr;
+
+  annotation (
+    smoothOrder=2,
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+end WBFlueGasesHeatTransferCoefficient;
diff --git a/ThermoSysPro/Correlations/Thermal/WBHeatExchangerEfficiency.mo b/ThermoSysPro/Correlations/Thermal/WBHeatExchangerEfficiency.mo
index 7ffbe815f5f4baac22e165903e52513577fcb0a6..c023b771802532c59ead5d67d63c24d1d0ff55f1 100644
--- a/ThermoSysPro/Correlations/Thermal/WBHeatExchangerEfficiency.mo
+++ b/ThermoSysPro/Correlations/Thermal/WBHeatExchangerEfficiency.mo
@@ -1,74 +1,74 @@
-within ThermoSysPro.Correlations.Thermal;
-function WBHeatExchangerEfficiency "Heat exchanger efficiency"
-  input Units.SI.MassFlowRate QevC "Steam mass flow rate at the inlet";
-  input Units.SI.MassFlowRate QeeF "Water mass flow rate at the inlet";
-  input Units.SI.SpecificHeatCapacity Cc "Hot fluid specific heat capacity";
-  input Units.SI.SpecificHeatCapacity Cf "Cold fluid specific heat capacity";
-  input Units.SI.CoefficientOfHeatTransfer KEG0
-    "Global heat transfer coefficient";
-  input Units.SI.Area S0 "External exchange surface";
-  input Real Phase " = 0 ou 1 one-phase flow - otherwise two-phase flow";
-
-  output Real EC0 "Heat exchanger efficiency";
-
-protected
-  Real NUT "Number of transfer units";
-  Real CpMIN "Minimum heat capacity for the two fluids";
-  Real CpMAX "Maximum heat capacity for the two fluids";
-  Integer TYP2 "0 = co-current, 1 = counter-current";
-  Units.SI.CoefficientOfHeatTransfer KEG "Global heat exchange coefficient";
-  Units.SI.Area S "External exchange surface";
-  Real EC "Exchnager efficiency";
-
-algorithm
-  TYP2 := 1;
-
-  /* Verification of the inputs */
-  KEG := if (KEG0 > 0) then KEG0 else 10;
-  S := if (S0 > 0) then S0 else 1;
-
-  //  NTU method
-  //  ----------
-
-  /* Minimum and maximum heat capacities */
-  if (QevC*Cc < QeeF*Cf) then
-    CpMIN := noEvent(abs(QevC*Cc));
-    CpMAX := noEvent(abs(QeeF*Cf));
-  else
-    CpMIN := noEvent(abs(QeeF*Cf));
-    CpMAX := noEvent(abs(QevC*Cc));
-  end if;
-
-  /* Heat exchanger efficiency */
-  if ((Phase > 0) and (Phase < 1)) then
-    /* Two-phase flow */
-    NUT := KEG*S/noEvent(abs(QeeF*Cf));
-    EC := 1 - Modelica.Math.exp(-NUT);
-  else
-    NUT := KEG*S/CpMIN;
-    /* One-phase flow */
-    /* Crossed currents */
-    if (abs(QevC*Cc) < abs(QeeF*Cf)) then
-      /* CpMIN is associated to the flue gases (fluide brasse) */
-      EC := 1. - Modelica.Math.exp(-(abs(QeeF*Cf)/abs(QevC*Cc))*(1. - Modelica.Math.exp(-NUT*abs(QevC*Cc)/abs(QeeF*Cf))));
-    else
-      /* CpMIN is associated to water (fluide non brasse) */
-      EC := abs(QevC*Cc)/abs(QeeF*Cf)*(1. - Modelica.Math.exp(-abs(QeeF*Cf)/abs(QevC*Cc)*(1 - Modelica.Math.exp(-NUT))));
-    end if;
-  end if;
-
-  EC0 := if (EC > 0.) then EC else 1.e-2;
-
-  annotation (
-    smoothOrder=2,
-    Icon(graphics),        Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2014</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>"));
-end WBHeatExchangerEfficiency;
+within ThermoSysPro.Correlations.Thermal;
+function WBHeatExchangerEfficiency "Heat exchanger efficiency"
+  input Units.SI.MassFlowRate QevC "Steam mass flow rate at the inlet";
+  input Units.SI.MassFlowRate QeeF "Water mass flow rate at the inlet";
+  input Units.SI.SpecificHeatCapacity Cc "Hot fluid specific heat capacity";
+  input Units.SI.SpecificHeatCapacity Cf "Cold fluid specific heat capacity";
+  input Units.SI.CoefficientOfHeatTransfer KEG0
+    "Global heat transfer coefficient";
+  input Units.SI.Area S0 "External exchange surface";
+  input Real Phase " = 0 ou 1 one-phase flow - otherwise two-phase flow";
+
+  output Real EC0 "Heat exchanger efficiency";
+
+protected
+  Real NUT "Number of transfer units";
+  Real CpMIN "Minimum heat capacity for the two fluids";
+  Real CpMAX "Maximum heat capacity for the two fluids";
+  Integer TYP2 "0 = co-current, 1 = counter-current";
+  Units.SI.CoefficientOfHeatTransfer KEG "Global heat exchange coefficient";
+  Units.SI.Area S "External exchange surface";
+  Real EC "Exchnager efficiency";
+
+algorithm
+  TYP2 := 1;
+
+  /* Verification of the inputs */
+  KEG := if (KEG0 > 0) then KEG0 else 10;
+  S := if (S0 > 0) then S0 else 1;
+
+  //  NTU method
+  //  ----------
+
+  /* Minimum and maximum heat capacities */
+  if (QevC*Cc < QeeF*Cf) then
+    CpMIN := noEvent(abs(QevC*Cc));
+    CpMAX := noEvent(abs(QeeF*Cf));
+  else
+    CpMIN := noEvent(abs(QeeF*Cf));
+    CpMAX := noEvent(abs(QevC*Cc));
+  end if;
+
+  /* Heat exchanger efficiency */
+  if ((Phase > 0) and (Phase < 1)) then
+    /* Two-phase flow */
+    NUT := KEG*S/noEvent(abs(QeeF*Cf));
+    EC := 1 - Modelica.Math.exp(-NUT);
+  else
+    NUT := KEG*S/CpMIN;
+    /* One-phase flow */
+    /* Crossed currents */
+    if (abs(QevC*Cc) < abs(QeeF*Cf)) then
+      /* CpMIN is associated to the flue gases (fluide brasse) */
+      EC := 1. - Modelica.Math.exp(-(abs(QeeF*Cf)/abs(QevC*Cc))*(1. - Modelica.Math.exp(-NUT*abs(QevC*Cc)/abs(QeeF*Cf))));
+    else
+      /* CpMIN is associated to water (fluide non brasse) */
+      EC := abs(QevC*Cc)/abs(QeeF*Cf)*(1. - Modelica.Math.exp(-abs(QeeF*Cf)/abs(QevC*Cc)*(1 - Modelica.Math.exp(-NUT))));
+    end if;
+  end if;
+
+  EC0 := if (EC > 0.) then EC else 1.e-2;
+
+  annotation (
+    smoothOrder=2,
+    Icon(graphics),        Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2014</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>"));
+end WBHeatExchangerEfficiency;
diff --git a/ThermoSysPro/Correlations/Thermal/WBInternalHeatTransferCoefficient.mo b/ThermoSysPro/Correlations/Thermal/WBInternalHeatTransferCoefficient.mo
index 363f7c21dafd910b923e59166846db1ef17a005c..2ba5c6fcf6a11bef9e1326739d9089fe45af9060 100644
--- a/ThermoSysPro/Correlations/Thermal/WBInternalHeatTransferCoefficient.mo
+++ b/ThermoSysPro/Correlations/Thermal/WBInternalHeatTransferCoefficient.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Correlations.Thermal;
-function WBInternalHeatTransferCoefficient
-  "Internal water/steam flow heat transfer coefficient"
-
-  input ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
-                                                            annotation (Placement(
-        transformation(extent={{-26,-74},{-6,-54}}, rotation=0)));
-  input Real geomt[6] "Geometrical data vector";
-  input Real Gm "Water mass velocity at the inlet (kg/m2s)";
-  input Real Xmc "Steam average mass fraction";
-  input Units.SI.Power flux "Heat flux";
-  input Units.SI.AbsolutePressure Pmc "Water average pressure";
-  input Units.SI.Area Si "Internal exchnage surface over dz";
-
-  output Units.SI.CoefficientOfHeatTransfer hi
-    "Internal heat transfer coefficient";
-
-protected
-  constant Units.SI.AbsolutePressure Pc=221.2e5 "Critical pressure";
-  Units.SI.Density rhol "Density of the liquid phase";
-  Units.SI.Density rhov "Density of the steam phase";
-  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
-  Units.SI.DynamicViscosity muv "Dynamic viscosity of the vapor phase";
-  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
-  Units.SI.ThermalConductivity kv "Thermal conductivity of the vapor phase";
-  Units.SI.SpecificHeatCapacity cpl
-    "Specific heat capacity of the liquid phase";
-  Units.SI.SpecificHeatCapacity cpv "Specific heat capacity of the vapor phase";
-  Units.SI.SpecificEnergy lv "Phase transition change energy";
-  Units.SI.Diameter dtin "Pipes internal diameter";
-  Real Xmc0 "Steam average mass fraction";
-  Real Frl "Froude number for the computation of hi";
-  Real Frl0 "Froude number for the computation of hi";
-  Real Xtt "Martinelli number";
-  Real Rel "Reynolds number for the computation of hi";
-  Real Prl "Prandtl number for the computation of hi";
-  Units.SI.CoefficientOfHeatTransfer hc
-    "Convective heat transfer coefficient for the compuation of hi";
-  Real Bo "Boiling number";
-  Real E "Variable for the compuation of hi";
-  Real pred "Variable for the compuation of hi";
-  Units.SI.CoefficientOfHeatTransfer heb "Boiling heat transfer coefficient";
-  Real S "Corrective term for the removal of nucleation";
-  Real Rev "Reynolds number for the computation of hi";
-  Real Prv "Prandtl number for the computation of hi";
-  Units.SI.CoefficientOfHeatTransfer hvi
-    "Heat transfer coefficient for the drying of the wall";
-
-algorithm
-  rhol := hy.rhol;
-  rhov := hy.rhov;
-  lv := hy.lv;
-  cpl := hy.cpl;
-  cpv := hy.cpv;
-  mul := hy.mul;
-  muv := hy.muv;
-  kl := hy.kl;
-  kv := hy.kv;
-  dtin := geomt[2];
-
-  if (Xmc > 0.85) then
-    Xmc0 := 0.85;
-  else
-    Xmc0 := Xmc;
-  end if;
-
-  if ((0.0 < Xmc) and (Xmc < 1)) then
-    /* Froude number */
-    Frl0 := Gm^2/(Modelica.Constants.g_n*dtin*rhol^2);
-    if (Frl0 <= 0.05) then
-      Frl := 0.1;
-    else
-      Frl := Frl0;
-    end if;
-
-    /* Martinelli number */
-    Xtt := (((1 - Xmc0)/Xmc0)^0.9)*((rhov/rhol)^0.5)*((mul/muv)^0.1);
-
-    /* Convection heat transfer coefficient */
-    Rel := Gm*dtin*(1 - Xmc0)/mul;
-    Prl := mul*cpl/kl;
-    hc := (0.023*kl/dtin)*(Rel^0.8)*(Prl^0.4);
-
-    /* Boiling number */
-    Bo := max(flux/Si/(lv*Gm),0);
-    E := 1 + (24000*(Bo^1.16)) + (1.37*((1/Xtt)^0.86));
-
-    /* Boiling heat transfer coefficient */
-    pred := -Modelica.Math.log10(Pmc/Pc);
-    heb := 55*(((Pmc/Pc)^0.12)*(pred^(-0.55))*(18.015^(-0.5))*(max((flux/Si),0)^(0.67)));
-
-    /* Corrective term for the removal of nucleation */
-    S := 1/(1 + (1.15e-6*E^2*Rel^1.17));
-
-    /* Internal heat transfer coefficient */
-    hi := (E*hc) + (S*heb);
-
-    if (Xmc > 0.85) then
-      /* Wall drying zone */
-      Rev := Gm*dtin/muv;
-      Prv := muv*cpv/kv;
-      hvi := (0.023*kv/dtin)*(Rev^0.8)*(Prv^0.4);
-      hi := hi*((1 - Xmc)/0.15) + hvi*((Xmc - 0.85)/0.15);
-    end if;
-  else
-    /* Reynolds number */
-    Rel := Gm*dtin/mul;
-
-    /* Prandl number */
-    Prl := mul*cpl/kl;
-
-    /* Internal heat transfer coefficient */
-    hi := (0.023*kl/dtin)*(Rel^0.8)*(Prl^0.4);
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.0</h4>
-</html>"));
-end WBInternalHeatTransferCoefficient;
+within ThermoSysPro.Correlations.Thermal;
+function WBInternalHeatTransferCoefficient
+  "Internal water/steam flow heat transfer coefficient"
+
+  input ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
+                                                            annotation (Placement(
+        transformation(extent={{-26,-74},{-6,-54}}, rotation=0)));
+  input Real geomt[6] "Geometrical data vector";
+  input Real Gm "Water mass velocity at the inlet (kg/m2s)";
+  input Real Xmc "Steam average mass fraction";
+  input Units.SI.Power flux "Heat flux";
+  input Units.SI.AbsolutePressure Pmc "Water average pressure";
+  input Units.SI.Area Si "Internal exchnage surface over dz";
+
+  output Units.SI.CoefficientOfHeatTransfer hi
+    "Internal heat transfer coefficient";
+
+protected
+  constant Units.SI.AbsolutePressure Pc=221.2e5 "Critical pressure";
+  Units.SI.Density rhol "Density of the liquid phase";
+  Units.SI.Density rhov "Density of the steam phase";
+  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
+  Units.SI.DynamicViscosity muv "Dynamic viscosity of the vapor phase";
+  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
+  Units.SI.ThermalConductivity kv "Thermal conductivity of the vapor phase";
+  Units.SI.SpecificHeatCapacity cpl
+    "Specific heat capacity of the liquid phase";
+  Units.SI.SpecificHeatCapacity cpv "Specific heat capacity of the vapor phase";
+  Units.SI.SpecificEnergy lv "Phase transition change energy";
+  Units.SI.Diameter dtin "Pipes internal diameter";
+  Real Xmc0 "Steam average mass fraction";
+  Real Frl "Froude number for the computation of hi";
+  Real Frl0 "Froude number for the computation of hi";
+  Real Xtt "Martinelli number";
+  Real Rel "Reynolds number for the computation of hi";
+  Real Prl "Prandtl number for the computation of hi";
+  Units.SI.CoefficientOfHeatTransfer hc
+    "Convective heat transfer coefficient for the compuation of hi";
+  Real Bo "Boiling number";
+  Real E "Variable for the compuation of hi";
+  Real pred "Variable for the compuation of hi";
+  Units.SI.CoefficientOfHeatTransfer heb "Boiling heat transfer coefficient";
+  Real S "Corrective term for the removal of nucleation";
+  Real Rev "Reynolds number for the computation of hi";
+  Real Prv "Prandtl number for the computation of hi";
+  Units.SI.CoefficientOfHeatTransfer hvi
+    "Heat transfer coefficient for the drying of the wall";
+
+algorithm
+  rhol := hy.rhol;
+  rhov := hy.rhov;
+  lv := hy.lv;
+  cpl := hy.cpl;
+  cpv := hy.cpv;
+  mul := hy.mul;
+  muv := hy.muv;
+  kl := hy.kl;
+  kv := hy.kv;
+  dtin := geomt[2];
+
+  if (Xmc > 0.85) then
+    Xmc0 := 0.85;
+  else
+    Xmc0 := Xmc;
+  end if;
+
+  if ((0.0 < Xmc) and (Xmc < 1)) then
+    /* Froude number */
+    Frl0 := Gm^2/(Modelica.Constants.g_n*dtin*rhol^2);
+    if (Frl0 <= 0.05) then
+      Frl := 0.1;
+    else
+      Frl := Frl0;
+    end if;
+
+    /* Martinelli number */
+    Xtt := (((1 - Xmc0)/Xmc0)^0.9)*((rhov/rhol)^0.5)*((mul/muv)^0.1);
+
+    /* Convection heat transfer coefficient */
+    Rel := Gm*dtin*(1 - Xmc0)/mul;
+    Prl := mul*cpl/kl;
+    hc := (0.023*kl/dtin)*(Rel^0.8)*(Prl^0.4);
+
+    /* Boiling number */
+    Bo := max(flux/Si/(lv*Gm),0);
+    E := 1 + (24000*(Bo^1.16)) + (1.37*((1/Xtt)^0.86));
+
+    /* Boiling heat transfer coefficient */
+    pred := -Modelica.Math.log10(Pmc/Pc);
+    heb := 55*(((Pmc/Pc)^0.12)*(pred^(-0.55))*(18.015^(-0.5))*(max((flux/Si),0)^(0.67)));
+
+    /* Corrective term for the removal of nucleation */
+    S := 1/(1 + (1.15e-6*E^2*Rel^1.17));
+
+    /* Internal heat transfer coefficient */
+    hi := (E*hc) + (S*heb);
+
+    if (Xmc > 0.85) then
+      /* Wall drying zone */
+      Rev := Gm*dtin/muv;
+      Prv := muv*cpv/kv;
+      hvi := (0.023*kv/dtin)*(Rev^0.8)*(Prv^0.4);
+      hi := hi*((1 - Xmc)/0.15) + hvi*((Xmc - 0.85)/0.15);
+    end if;
+  else
+    /* Reynolds number */
+    Rel := Gm*dtin/mul;
+
+    /* Prandl number */
+    Prl := mul*cpl/kl;
+
+    /* Internal heat transfer coefficient */
+    hi := (0.023*kl/dtin)*(Rel^0.8)*(Prl^0.4);
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.0</h4>
+</html>"));
+end WBInternalHeatTransferCoefficient;
diff --git a/ThermoSysPro/Correlations/Thermal/WBInternalOnePhaseFlowHeatTransferCoefficient.mo b/ThermoSysPro/Correlations/Thermal/WBInternalOnePhaseFlowHeatTransferCoefficient.mo
index 21c66e3e781a5e5fc5e11f5b4ef6b953e5346ded..9dc3d2273a2947a6515aa26d73162f06ed472d08 100644
--- a/ThermoSysPro/Correlations/Thermal/WBInternalOnePhaseFlowHeatTransferCoefficient.mo
+++ b/ThermoSysPro/Correlations/Thermal/WBInternalOnePhaseFlowHeatTransferCoefficient.mo
@@ -1,53 +1,53 @@
-within ThermoSysPro.Correlations.Thermal;
-function WBInternalOnePhaseFlowHeatTransferCoefficient
-  "Internal one-phase water or steam flow heat transfer coefficient"
-
-  input ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
-                                                            annotation (Placement(
-        transformation(extent={{-26,-74},{-6,-54}}, rotation=0)));
-  input Real geomt[6] "Geometrical data vector";
-  input Real Gm "Water mass velocity at the inlet (kg/m2s)";
-
-  output Units.SI.CoefficientOfHeatTransfer hi
-    "Internal heat transfer coefficient";
-
-protected
-  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
-  Units.SI.SpecificHeatCapacity cpl
-    "Specific heat capacity of the liquid phase";
-  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
-  Units.SI.Diameter dtin "Pipes internal diameter";
-  Real Re "Reynolds number for the computation of hi";
-  Real Pr "Prandtl Reynolds number for the computation of hi";
-
-algorithm
-  cpl := hy.cpl;
-  mul := hy.mul;
-  kl := hy.kl;
-  dtin := geomt[2];
-
-  /* Reynolds number */
-  Re := Gm*dtin/mul;
-
-  /* Prandtl number */
-  Pr := mul*cpl/kl;
-
-  /* Internal heat transfer coefficient */
-  hi := (0.023*kl/dtin)*(Re^0.8)*(Pr^0.4);
-
-  annotation (
-    smoothOrder=2,
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-end WBInternalOnePhaseFlowHeatTransferCoefficient;
+within ThermoSysPro.Correlations.Thermal;
+function WBInternalOnePhaseFlowHeatTransferCoefficient
+  "Internal one-phase water or steam flow heat transfer coefficient"
+
+  input ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
+                                                            annotation (Placement(
+        transformation(extent={{-26,-74},{-6,-54}}, rotation=0)));
+  input Real geomt[6] "Geometrical data vector";
+  input Real Gm "Water mass velocity at the inlet (kg/m2s)";
+
+  output Units.SI.CoefficientOfHeatTransfer hi
+    "Internal heat transfer coefficient";
+
+protected
+  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
+  Units.SI.SpecificHeatCapacity cpl
+    "Specific heat capacity of the liquid phase";
+  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
+  Units.SI.Diameter dtin "Pipes internal diameter";
+  Real Re "Reynolds number for the computation of hi";
+  Real Pr "Prandtl Reynolds number for the computation of hi";
+
+algorithm
+  cpl := hy.cpl;
+  mul := hy.mul;
+  kl := hy.kl;
+  dtin := geomt[2];
+
+  /* Reynolds number */
+  Re := Gm*dtin/mul;
+
+  /* Prandtl number */
+  Pr := mul*cpl/kl;
+
+  /* Internal heat transfer coefficient */
+  hi := (0.023*kl/dtin)*(Re^0.8)*(Pr^0.4);
+
+  annotation (
+    smoothOrder=2,
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+end WBInternalOnePhaseFlowHeatTransferCoefficient;
diff --git a/ThermoSysPro/Correlations/Thermal/WBInternalSuperCriticalFlowHeatTransferCoefficient.mo b/ThermoSysPro/Correlations/Thermal/WBInternalSuperCriticalFlowHeatTransferCoefficient.mo
index e73e62eef03de5f9f2c3fac2314e6e0a33b00384..c15a30bd0f4a69e02fa2f04c5b7d627e2e3036c9 100644
--- a/ThermoSysPro/Correlations/Thermal/WBInternalSuperCriticalFlowHeatTransferCoefficient.mo
+++ b/ThermoSysPro/Correlations/Thermal/WBInternalSuperCriticalFlowHeatTransferCoefficient.mo
@@ -1,74 +1,74 @@
-within ThermoSysPro.Correlations.Thermal;
-function WBInternalSuperCriticalFlowHeatTransferCoefficient
-  "Internal supercritical water flow heat transfer coefficient"
-
-  input ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
-                                                            annotation (Placement(
-        transformation(extent={{-26,-74},{-6,-54}}, rotation=0)));
-  input Real geomt[6] "Geometrical data vector";
-  input Real Gm "Water mass velocity at the inlet (kg/m2s)";
-  input Units.SI.AbsolutePressure Pmc "Water average pressure";
-  input Units.SI.Temperature Tmc "Water average temperature";
-  input Units.SI.Temperature Tpint "Wall temperature";
-
-  output Units.SI.CoefficientOfHeatTransfer hi
-    "Internal heat transfer coefficient";
-
-protected
-  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
-  Units.SI.SpecificHeatCapacity cpl
-    "Specific heat capacity of the liquid phase";
-  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
-  Units.SI.Diameter dtin "Pipes internal diameter";
-  Real Re "Reynolds number for the computation of hi";
-  Real Pr "Prandtl number for the computation of hi";
-  Real cor1 "Corrective coefficient for hi in the supercritical case";
-  Real cor2 "Corrective coefficient for hi in the supercritical case";
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT protpint
-    annotation (Placement(transformation(extent={{-96,40},{-84,52}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT protmc
-    annotation (Placement(transformation(extent={{-96,22},{-84,34}}, rotation=0)));
-algorithm
-  cpl := hy.cpl;
-  mul := hy.mul;
-  kl := hy.kl;
-  dtin := geomt[2];
-
-  protmc := ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pmc, Tmc, 2);
-  protpint := ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pmc, Tpint, 2);
-
-  /* Reynolds number */
-  Re := Gm*dtin*mul;
-
-  /* Prandtl number */
-  Pr := mul*cpl/kl;
-
-  /* HARWELL formulation */
-  if (abs(Tmc - Tpint) > 1e-13) then
-    cor1 := (1/(1/protpint.d)/(1/protmc.d))^0.3;
-    cor2 := (((protpint.h - protmc.h)/(Tpint - Tmc))/cpl)^0.5;
-  else
-    cor1 := 1;
-    cor2 := 1;
-  end if;
-
-  hi := (0.0183*kl/dtin)*(Re^0.82)*(Pr^0.5)*cor1*cor2;
-
-  annotation (
-    smoothOrder=2,
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-end WBInternalSuperCriticalFlowHeatTransferCoefficient;
+within ThermoSysPro.Correlations.Thermal;
+function WBInternalSuperCriticalFlowHeatTransferCoefficient
+  "Internal supercritical water flow heat transfer coefficient"
+
+  input ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
+                                                            annotation (Placement(
+        transformation(extent={{-26,-74},{-6,-54}}, rotation=0)));
+  input Real geomt[6] "Geometrical data vector";
+  input Real Gm "Water mass velocity at the inlet (kg/m2s)";
+  input Units.SI.AbsolutePressure Pmc "Water average pressure";
+  input Units.SI.Temperature Tmc "Water average temperature";
+  input Units.SI.Temperature Tpint "Wall temperature";
+
+  output Units.SI.CoefficientOfHeatTransfer hi
+    "Internal heat transfer coefficient";
+
+protected
+  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
+  Units.SI.SpecificHeatCapacity cpl
+    "Specific heat capacity of the liquid phase";
+  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
+  Units.SI.Diameter dtin "Pipes internal diameter";
+  Real Re "Reynolds number for the computation of hi";
+  Real Pr "Prandtl number for the computation of hi";
+  Real cor1 "Corrective coefficient for hi in the supercritical case";
+  Real cor2 "Corrective coefficient for hi in the supercritical case";
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT protpint
+    annotation (Placement(transformation(extent={{-96,40},{-84,52}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT protmc
+    annotation (Placement(transformation(extent={{-96,22},{-84,34}}, rotation=0)));
+algorithm
+  cpl := hy.cpl;
+  mul := hy.mul;
+  kl := hy.kl;
+  dtin := geomt[2];
+
+  protmc := ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pmc, Tmc, 2);
+  protpint := ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pmc, Tpint, 2);
+
+  /* Reynolds number */
+  Re := Gm*dtin*mul;
+
+  /* Prandtl number */
+  Pr := mul*cpl/kl;
+
+  /* HARWELL formulation */
+  if (abs(Tmc - Tpint) > 1e-13) then
+    cor1 := (1/(1/protpint.d)/(1/protmc.d))^0.3;
+    cor2 := (((protpint.h - protmc.h)/(Tpint - Tmc))/cpl)^0.5;
+  else
+    cor1 := 1;
+    cor2 := 1;
+  end if;
+
+  hi := (0.0183*kl/dtin)*(Re^0.82)*(Pr^0.5)*cor1*cor2;
+
+  annotation (
+    smoothOrder=2,
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+end WBInternalSuperCriticalFlowHeatTransferCoefficient;
diff --git a/ThermoSysPro/Correlations/Thermal/WBInternalTwoPhaseFlowHeatTransferCoefficient.mo b/ThermoSysPro/Correlations/Thermal/WBInternalTwoPhaseFlowHeatTransferCoefficient.mo
index 782ba5196c978f38b24fedd5b2b3764762e3180c..01ca92ff5ed0c29601af8b7fd6894ff75fc65eb3 100644
--- a/ThermoSysPro/Correlations/Thermal/WBInternalTwoPhaseFlowHeatTransferCoefficient.mo
+++ b/ThermoSysPro/Correlations/Thermal/WBInternalTwoPhaseFlowHeatTransferCoefficient.mo
@@ -1,120 +1,120 @@
-within ThermoSysPro.Correlations.Thermal;
-function WBInternalTwoPhaseFlowHeatTransferCoefficient
-  "Internal two-phase water/steam flow heat transfer coefficient"
-
-  input ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
-                                                            annotation (Placement(
-        transformation(extent={{-26,-74},{-6,-54}}, rotation=0)));
-  input Real geomt[6] "Geometrical data vector";
-  input Real Gm "Water mass velocity at the inlet (kg/m2s)";
-  input Real Xmc "Steam average mass fraction";
-  input Units.SI.Power flux "Heat flux";
-  input Units.SI.AbsolutePressure Pmc "Water average pressure";
-  input Units.SI.Area Si "Internal exchnage surface over dz";
-
-  output Units.SI.CoefficientOfHeatTransfer hi
-    "Internal heat transfer coefficient";
-
-protected
-  constant Units.SI.AbsolutePressure Pc=221.2e5 "Critical pressure";
-  Units.SI.Density rhol "Density of the liquid phase";
-  Units.SI.Density rhov "Density of the steam phase";
-  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
-  Units.SI.DynamicViscosity muv "Dynamic viscosity of the vapor phase";
-  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
-  Units.SI.ThermalConductivity kv "Thermal conductivity of the vapor phase";
-  Units.SI.SpecificHeatCapacity cpl
-    "Specific heat capacity of the liquid phase";
-  Units.SI.SpecificHeatCapacity cpv "Specific heat capacity of the vapor phase";
-  Units.SI.SpecificEnergy lv "Phase transition change energy";
-  Units.SI.Diameter dtin "Pipes internal diameter";
-  Real Xmc0 "Steam average mass fraction";
-  Real Frl "Froude number for the computation of hi";
-  Real Frl0 "Froude number for the computation of hi";
-  Real Xtt "Martinelli number";
-  Real Rel "Reynolds number for the computation of hi";
-  Real Prl "Prandtl number for the computation of hi";
-  Units.SI.CoefficientOfHeatTransfer hc
-    "Convective heat transfer coefficient for the compuation of hi";
-  Real Bo "Boiling number";
-  Real E "Variable for the compuation of hi";
-  Real pred "Variable for the compuation of hi";
-  Units.SI.CoefficientOfHeatTransfer heb "Boiling heat transfer coefficient";
-  Real S "Corrective term for the removal of nucleation";
-  Real Rev "Reynolds number for the computation of hi";
-  Real Prv "Prandtl number for the computation of hi";
-  Units.SI.CoefficientOfHeatTransfer hvi
-    "Heat transfer coefficient for the drying of the wall";
-
-algorithm
-  rhol := hy.rhol;
-  rhov := hy.rhov;
-  lv := hy.lv;
-  cpl := hy.cpl;
-  cpv := hy.cpv;
-  mul := hy.mul;
-  muv := hy.muv;
-  kl := hy.kl;
-  kv := hy.kv;
-  dtin := geomt[2];
-
-  if (Xmc > 0.85) then
-    Xmc0 := 0.85;
-  else
-    Xmc0 := Xmc;
-  end if;
-
-  /* Froude number */
-  Frl0 := Gm^2/(Modelica.Constants.g_n*dtin*rhol^2);
-  if (Frl0 <= 0.05) then
-    Frl := 0.1;
-  else
-    Frl := Frl0;
-  end if;
-
-  /* Martinelli number */
-  Xtt := (((1 - Xmc0)/Xmc0)^0.9)*((rhov/rhol)^0.5)*((mul/muv)^0.1);
-
-  /* Convection heat transfer coefficient */
-  Rel := Gm*dtin*(1 - Xmc0)/mul;
-  Prl := mul*cpl/kl;
-  hc := (0.023*kl/dtin)*(Rel^0.8)*(Prl^0.4);
-
-  /* Boiling number */
-  Bo := max(flux/Si/(lv*Gm),0);
-  E := 1 + (24000*(Bo^1.16)) + (1.37*((1/Xtt)^0.86));
-
-  /* Boiling heat transfer coefficient */
-  pred := -Modelica.Math.log10(Pmc/Pc);
-  heb := 55*(((Pmc/Pc)^0.12)*(pred^(-0.55))*(18.015^(-0.5))*(max((flux/Si),0)^(0.67)));
-
- /* Corrective term for the removal of nucleation */
-  S := 1/(1 + (1.15e-6*E^2*Rel^1.17));
-
-  /* Internal heat transfer coefficient */
-  hi := (E*hc) + (S*heb);
-
-  if (Xmc > 0.85) then
-  /* Wall drying zone */
-    Rev := Gm*dtin/muv;
-    Prv := muv*cpv/kv;
-    hvi := (0.023*kv/dtin)*(Rev^0.8)*(Prv^0.4);
-    hi := hi*((1 - Xmc)/0.15) + hvi*((Xmc - 0.85)/0.15);
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</h4>
-</HTML>
-"));
-end WBInternalTwoPhaseFlowHeatTransferCoefficient;
+within ThermoSysPro.Correlations.Thermal;
+function WBInternalTwoPhaseFlowHeatTransferCoefficient
+  "Internal two-phase water/steam flow heat transfer coefficient"
+
+  input ThermoSysPro.Correlations.Misc.Pro_TwoPhaseWaterSteam hy
+                                                            annotation (Placement(
+        transformation(extent={{-26,-74},{-6,-54}}, rotation=0)));
+  input Real geomt[6] "Geometrical data vector";
+  input Real Gm "Water mass velocity at the inlet (kg/m2s)";
+  input Real Xmc "Steam average mass fraction";
+  input Units.SI.Power flux "Heat flux";
+  input Units.SI.AbsolutePressure Pmc "Water average pressure";
+  input Units.SI.Area Si "Internal exchnage surface over dz";
+
+  output Units.SI.CoefficientOfHeatTransfer hi
+    "Internal heat transfer coefficient";
+
+protected
+  constant Units.SI.AbsolutePressure Pc=221.2e5 "Critical pressure";
+  Units.SI.Density rhol "Density of the liquid phase";
+  Units.SI.Density rhov "Density of the steam phase";
+  Units.SI.DynamicViscosity mul "Dynamic viscosity of the liquid phase";
+  Units.SI.DynamicViscosity muv "Dynamic viscosity of the vapor phase";
+  Units.SI.ThermalConductivity kl "Thermal conductivity of the liquid phase";
+  Units.SI.ThermalConductivity kv "Thermal conductivity of the vapor phase";
+  Units.SI.SpecificHeatCapacity cpl
+    "Specific heat capacity of the liquid phase";
+  Units.SI.SpecificHeatCapacity cpv "Specific heat capacity of the vapor phase";
+  Units.SI.SpecificEnergy lv "Phase transition change energy";
+  Units.SI.Diameter dtin "Pipes internal diameter";
+  Real Xmc0 "Steam average mass fraction";
+  Real Frl "Froude number for the computation of hi";
+  Real Frl0 "Froude number for the computation of hi";
+  Real Xtt "Martinelli number";
+  Real Rel "Reynolds number for the computation of hi";
+  Real Prl "Prandtl number for the computation of hi";
+  Units.SI.CoefficientOfHeatTransfer hc
+    "Convective heat transfer coefficient for the compuation of hi";
+  Real Bo "Boiling number";
+  Real E "Variable for the compuation of hi";
+  Real pred "Variable for the compuation of hi";
+  Units.SI.CoefficientOfHeatTransfer heb "Boiling heat transfer coefficient";
+  Real S "Corrective term for the removal of nucleation";
+  Real Rev "Reynolds number for the computation of hi";
+  Real Prv "Prandtl number for the computation of hi";
+  Units.SI.CoefficientOfHeatTransfer hvi
+    "Heat transfer coefficient for the drying of the wall";
+
+algorithm
+  rhol := hy.rhol;
+  rhov := hy.rhov;
+  lv := hy.lv;
+  cpl := hy.cpl;
+  cpv := hy.cpv;
+  mul := hy.mul;
+  muv := hy.muv;
+  kl := hy.kl;
+  kv := hy.kv;
+  dtin := geomt[2];
+
+  if (Xmc > 0.85) then
+    Xmc0 := 0.85;
+  else
+    Xmc0 := Xmc;
+  end if;
+
+  /* Froude number */
+  Frl0 := Gm^2/(Modelica.Constants.g_n*dtin*rhol^2);
+  if (Frl0 <= 0.05) then
+    Frl := 0.1;
+  else
+    Frl := Frl0;
+  end if;
+
+  /* Martinelli number */
+  Xtt := (((1 - Xmc0)/Xmc0)^0.9)*((rhov/rhol)^0.5)*((mul/muv)^0.1);
+
+  /* Convection heat transfer coefficient */
+  Rel := Gm*dtin*(1 - Xmc0)/mul;
+  Prl := mul*cpl/kl;
+  hc := (0.023*kl/dtin)*(Rel^0.8)*(Prl^0.4);
+
+  /* Boiling number */
+  Bo := max(flux/Si/(lv*Gm),0);
+  E := 1 + (24000*(Bo^1.16)) + (1.37*((1/Xtt)^0.86));
+
+  /* Boiling heat transfer coefficient */
+  pred := -Modelica.Math.log10(Pmc/Pc);
+  heb := 55*(((Pmc/Pc)^0.12)*(pred^(-0.55))*(18.015^(-0.5))*(max((flux/Si),0)^(0.67)));
+
+ /* Corrective term for the removal of nucleation */
+  S := 1/(1 + (1.15e-6*E^2*Rel^1.17));
+
+  /* Internal heat transfer coefficient */
+  hi := (E*hc) + (S*heb);
+
+  if (Xmc > 0.85) then
+  /* Wall drying zone */
+    Rev := Gm*dtin/muv;
+    Prv := muv*cpv/kv;
+    hvi := (0.023*kv/dtin)*(Rev^0.8)*(Prv^0.4);
+    hi := hi*((1 - Xmc)/0.15) + hvi*((Xmc - 0.85)/0.15);
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</h4>
+</HTML>
+"));
+end WBInternalTwoPhaseFlowHeatTransferCoefficient;
diff --git a/ThermoSysPro/Correlations/Thermal/WBLongitudinalCurrentConvectiveHeatTransferCoefficient.mo b/ThermoSysPro/Correlations/Thermal/WBLongitudinalCurrentConvectiveHeatTransferCoefficient.mo
index 0f2b0f6c499c9c364300d1ab550724dbce7609e6..07af3e51e3830ba89a7d53437c0f74c68a7fba40 100644
--- a/ThermoSysPro/Correlations/Thermal/WBLongitudinalCurrentConvectiveHeatTransferCoefficient.mo
+++ b/ThermoSysPro/Correlations/Thermal/WBLongitudinalCurrentConvectiveHeatTransferCoefficient.mo
@@ -1,87 +1,87 @@
-within ThermoSysPro.Correlations.Thermal;
-function WBLongitudinalCurrentConvectiveHeatTransferCoefficient
-  "Convective heat transfer coefficient for co- or counter-current heat exchangers"
-  input Units.SI.Temperature TFilm "Film temperature";
-  input Units.SI.Temperature Tmf "Flue gases average temperature";
-  input Units.SI.MassFlowRate Qf "Flue gases mass flow rate";
-  input Real Xh2o "H2O mass fraction";
-  input Units.SI.Area Sgaz "Geometrical parameter";
-  input Units.SI.Diameter Dext "Pipes external diameter";
-  input Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation";
-
-  output Units.SI.CoefficientOfHeatTransfer Kcfl
-    "Convective heat transfer coefficient for longitudinal flows";
-
-protected
-  Real Dextb "Pipes external diameter in feet";
-  Real Qfb "Flue gases mass flow rate in pound/hour";
-  Real Sgazb "Geometrical parameter Sgaz in feet^2";
-  Real TFilmb "Film temperature in Farenheit";
-  Real Tmfb "Température moyenne des fumées en °F";
-
-  //**********************************************************************************
-  //   Values of "Physical properties factor" for transverse flow combustion flue gases
-  //   taken from "The Babcock & Wilcox Company - STEAM/its generation and use"
-  //**********************************************************************************/
-  constant Real TabUm[5]={0,5,10,15,20};
-  constant Real TabTFilm[12]={0,200,400,600,800,1000,1200,1400,1600,2000,2400,
-      2800};
-  constant Real TabFpp[5, 12]=[0.152, 0.166, 0.180, 0.190, 0.198, 0.205, 0.212,
-       0.217, 0.221, 0.229, 0.236, 0.242; 0.158, 0.171, 0.184, 0.195, 0.204,
-      0.211, 0.218, 0.222, 0.228, 0.236, 0.244, 0.251; 0.163, 0.176, 0.189,
-      0.200, 0.209, 0.216, 0.224, 0.229, 0.234, 0.244, 0.252, 0.260; 0.170,
-      0.183, 0.194, 0.205, 0.214, 0.222, 0.229, 0.237, 0.240, 0.250, 0.260,
-      0.268; 0.178, 0.189, 0.200, 0.211, 0.220, 0.228, 0.234, 0.241, 0.247,
-      0.256, 0.266, 0.275];
-
-  Real CondConv "Base convective conductance";
-  Real MassFlow "Mass flow rate";
-  Real Fpp "Physical properties factor";
-  Real FT "Temperature factor";
-  Real Kcb "Heat transfer coefficient in English units";
-algorithm
-
-  /* Conversion from SI units to English units */
-  Dextb := 3.28084*Dext;
-  Qfb := 2.20462*3600*Qf;
-  Sgazb := 10.7369*Sgaz;
-  Tmfb := 9./5.*Tmf - 459.69;
-  TFilmb := 9./5.*TFilm - 459.69;
-
-  /* Mass flow rate */
-  MassFlow := abs(Qfb)/Sgazb;
-
-  /* Base convective conductance */
-  CondConv := 0.023*MassFlow^0.6/Dextb^0.2;
-
-  /* Physical properties factor */
-  if (option_interpolation == 1) then
-    Fpp := ThermoSysPro.Functions.TableLinearInterpolation(TabUm, TabTFilm, TabFpp, Xh2o, TFilmb);
-  elseif (option_interpolation == 2) then
-    Fpp := ThermoSysPro.Functions.TableSplineInterpolation(TabUm, TabTFilm, TabFpp, Xh2o, TFilmb);
-  else
-    assert(false, "WBLongitudinalCurrentConvectiveHeatTransferCoefficient: incorrect interpolation option");
-  end if;
-
-  /* Temperature coefficient */
-  FT := (Tmfb/TFilmb)^0.8;
-
-  /* Heat transfer coefficient for longitudinal flow flue gases */
-  Kcb := CondConv*Fpp*FT;
-
-  /* Conversion from English units to SI units */
-  Kcfl := 5.67826*Kcb;
-
-  annotation (
-    smoothOrder=2,
-    Icon(graphics),        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end WBLongitudinalCurrentConvectiveHeatTransferCoefficient;
+within ThermoSysPro.Correlations.Thermal;
+function WBLongitudinalCurrentConvectiveHeatTransferCoefficient
+  "Convective heat transfer coefficient for co- or counter-current heat exchangers"
+  input Units.SI.Temperature TFilm "Film temperature";
+  input Units.SI.Temperature Tmf "Flue gases average temperature";
+  input Units.SI.MassFlowRate Qf "Flue gases mass flow rate";
+  input Real Xh2o "H2O mass fraction";
+  input Units.SI.Area Sgaz "Geometrical parameter";
+  input Units.SI.Diameter Dext "Pipes external diameter";
+  input Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation";
+
+  output Units.SI.CoefficientOfHeatTransfer Kcfl
+    "Convective heat transfer coefficient for longitudinal flows";
+
+protected
+  Real Dextb "Pipes external diameter in feet";
+  Real Qfb "Flue gases mass flow rate in pound/hour";
+  Real Sgazb "Geometrical parameter Sgaz in feet^2";
+  Real TFilmb "Film temperature in Farenheit";
+  Real Tmfb "Température moyenne des fumées en °F";
+
+  //**********************************************************************************
+  //   Values of "Physical properties factor" for transverse flow combustion flue gases
+  //   taken from "The Babcock & Wilcox Company - STEAM/its generation and use"
+  //**********************************************************************************/
+  constant Real TabUm[5]={0,5,10,15,20};
+  constant Real TabTFilm[12]={0,200,400,600,800,1000,1200,1400,1600,2000,2400,
+      2800};
+  constant Real TabFpp[5, 12]=[0.152, 0.166, 0.180, 0.190, 0.198, 0.205, 0.212,
+       0.217, 0.221, 0.229, 0.236, 0.242; 0.158, 0.171, 0.184, 0.195, 0.204,
+      0.211, 0.218, 0.222, 0.228, 0.236, 0.244, 0.251; 0.163, 0.176, 0.189,
+      0.200, 0.209, 0.216, 0.224, 0.229, 0.234, 0.244, 0.252, 0.260; 0.170,
+      0.183, 0.194, 0.205, 0.214, 0.222, 0.229, 0.237, 0.240, 0.250, 0.260,
+      0.268; 0.178, 0.189, 0.200, 0.211, 0.220, 0.228, 0.234, 0.241, 0.247,
+      0.256, 0.266, 0.275];
+
+  Real CondConv "Base convective conductance";
+  Real MassFlow "Mass flow rate";
+  Real Fpp "Physical properties factor";
+  Real FT "Temperature factor";
+  Real Kcb "Heat transfer coefficient in English units";
+algorithm
+
+  /* Conversion from SI units to English units */
+  Dextb := 3.28084*Dext;
+  Qfb := 2.20462*3600*Qf;
+  Sgazb := 10.7369*Sgaz;
+  Tmfb := 9./5.*Tmf - 459.69;
+  TFilmb := 9./5.*TFilm - 459.69;
+
+  /* Mass flow rate */
+  MassFlow := abs(Qfb)/Sgazb;
+
+  /* Base convective conductance */
+  CondConv := 0.023*MassFlow^0.6/Dextb^0.2;
+
+  /* Physical properties factor */
+  if (option_interpolation == 1) then
+    Fpp := ThermoSysPro.Functions.TableLinearInterpolation(TabUm, TabTFilm, TabFpp, Xh2o, TFilmb);
+  elseif (option_interpolation == 2) then
+    Fpp := ThermoSysPro.Functions.TableSplineInterpolation(TabUm, TabTFilm, TabFpp, Xh2o, TFilmb);
+  else
+    assert(false, "WBLongitudinalCurrentConvectiveHeatTransferCoefficient: incorrect interpolation option");
+  end if;
+
+  /* Temperature coefficient */
+  FT := (Tmfb/TFilmb)^0.8;
+
+  /* Heat transfer coefficient for longitudinal flow flue gases */
+  Kcb := CondConv*Fpp*FT;
+
+  /* Conversion from English units to SI units */
+  Kcfl := 5.67826*Kcb;
+
+  annotation (
+    smoothOrder=2,
+    Icon(graphics),        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end WBLongitudinalCurrentConvectiveHeatTransferCoefficient;
diff --git a/ThermoSysPro/Correlations/Thermal/WBRadiativeHeatTransferCoefficient.mo b/ThermoSysPro/Correlations/Thermal/WBRadiativeHeatTransferCoefficient.mo
index 7a231cac182764959bde95e0d738081f5271894c..dfcabd69e36a45cdde6812420d8145fdd3fc7ad0 100644
--- a/ThermoSysPro/Correlations/Thermal/WBRadiativeHeatTransferCoefficient.mo
+++ b/ThermoSysPro/Correlations/Thermal/WBRadiativeHeatTransferCoefficient.mo
@@ -1,94 +1,94 @@
-within ThermoSysPro.Correlations.Thermal;
-function WBRadiativeHeatTransferCoefficient
-  "Radiative heat transfer coefficient for the wall heat exchanger"
-  input ThermoSysPro.Units.SI.TemperatureDifference DeltaT
-    "Temperature difference between the flue gases and the walls";
-  input Units.SI.Temperature Tp "Surface temperature";
-  input Real Pph2o "H20 fraction";
-  input Real Ppco2 "CO2 fraction";
-  input Real Beaml "Geometrical parameter";
-  input Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation";
-
-  output Units.SI.CoefficientOfHeatTransfer Kr
-    "Radiative heat transgfer coefficient";
-
-protected
-  Units.SI.AbsolutePressure Pgaz "CO2+H2O partial pressure";
-  Real Rap "H20/C02 partial pressure";
-  Real Kprim "Interpolation result over TabKr";
-  Real Ak "Interpolation result over TabK2";
-  Real Pperl "Intermediate variable";
-
-  /****************************************************************************
-        Valeurs du coefficient de rayonnement de base tirées de :
-                D. Annaratone - GENERATORI DI VAPORE - fig. 9.8.6
-                The Babcock & Wilcox Company - STEAM - fig 26.
-        Les valeurs correspondantes à une température de paroi de 1366.483
-        (2000. F) (tirées de STEAM) sont obtenues en supposant la courbe
-        une droite et en actionnant une conversion d'unités de mesure
-                                7.75      9
-          Kr = 5.67826*[15.5 + ------- * --- DeltaT(°K)]
-                                1500.     5
-
-  ******************************************************************************/
-  constant Real TabDeltaT[20]={-1100,-1000,-900,-800,-700,-600,-500,-400,-300,-200,
-      -100,0,100,200,400,600,800,1000,1400,1500};
-  constant Real TabTp[4]={273.15,523.15,773.15,1366.483333};
-  constant Real TabKr[4, 20]=[1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.E-04,
-      1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.163, 1.977, 2.56, 6.63, 12.793,
-       22.446, 35.82, 59.89, 65.94; 1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.E-04,
-      1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.72, 2.15, 6.98, 10.23, 14.54, 25.586,
-      37.216, 49.08, 61.06, 84.9, 90.714; 1.E-04, 1.E-04, 1.E-04, 1.E-04,
-      1.E-04, 1.E-04, 1.63, 1.977, 2.56, 8.47, 12.38, 30.59, 36.64, 42.22,
-      54.08, 65.128, 76.76, 88.39, 110.48, 116.3; 1.E-04, 1.84, 2.52, 8.23,
-      12.1, 16.64, 36.13, 41.96, 47.76, 53.55, 59.33, 88.01, 93.29, 98.57,
-      109.14, 119.7, 130.26, 140.82, 161.94, 167.23];
-
-  /******************************************************************************
-        Modification to take into account the influence of different fuels
-  ********************************************************************************/
-  constant Real TabPl[6]={0.,0.06,0.12,0.18,0.24,0.30};
-  constant Real TabRap[4]={0.3,0.4,0.76,2.};
-  constant Real TabK2[4, 6]=[0.13, 0.372, 0.517, 0.626, 0.725, 0.815; 0.13,
-      0.38, 0.545, 0.675, 0.792, 0.882; 0.13, 0.392, 0.592, 0.75, 0.875, 0.985;
-       0.13, 0.429, 0.67, 0.862, 1.027, 1.1647];
-
-algorithm
-  Pgaz := Ppco2 + Pph2o;
-  Rap := Pph2o/Ppco2;
-
-  if Beaml <= 0 then
-    Kr := 0;
-  else
-    if (option_interpolation == 1) then
-      Kprim := ThermoSysPro.Functions.TableLinearInterpolation(TabTp, TabDeltaT, TabKr, Tp, DeltaT);
-    elseif (option_interpolation == 2) then
-      Kprim := ThermoSysPro.Functions.TableSplineInterpolation(TabTp, TabDeltaT, TabKr, Tp, DeltaT);
-    else
-      assert(false, "WBRadiativeHeatTransferCoefficient: incorrect interpolation option");
-    end if;
-    Pperl := Pgaz*Beaml;
-
-    if (option_interpolation == 1) then
-      Ak := ThermoSysPro.Functions.TableLinearInterpolation(TabRap, TabPl, TabK2, Rap, Pperl);
-    elseif (option_interpolation == 2) then
-      Ak := ThermoSysPro.Functions.TableSplineInterpolation(TabRap, TabPl, TabK2, Rap, Pperl);
-    else
-      assert(false, "WBRadiativeHeatTransferCoefficient: incorrect interpolation option");
-    end if;
-    Kr := Kprim*Ak;
-  end if;
-
-  annotation (
-      smoothOrder=2,
-      Icon(graphics),      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end WBRadiativeHeatTransferCoefficient;
+within ThermoSysPro.Correlations.Thermal;
+function WBRadiativeHeatTransferCoefficient
+  "Radiative heat transfer coefficient for the wall heat exchanger"
+  input ThermoSysPro.Units.SI.TemperatureDifference DeltaT
+    "Temperature difference between the flue gases and the walls";
+  input Units.SI.Temperature Tp "Surface temperature";
+  input Real Pph2o "H20 fraction";
+  input Real Ppco2 "CO2 fraction";
+  input Real Beaml "Geometrical parameter";
+  input Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation";
+
+  output Units.SI.CoefficientOfHeatTransfer Kr
+    "Radiative heat transgfer coefficient";
+
+protected
+  Units.SI.AbsolutePressure Pgaz "CO2+H2O partial pressure";
+  Real Rap "H20/C02 partial pressure";
+  Real Kprim "Interpolation result over TabKr";
+  Real Ak "Interpolation result over TabK2";
+  Real Pperl "Intermediate variable";
+
+  /****************************************************************************
+        Valeurs du coefficient de rayonnement de base tirées de :
+                D. Annaratone - GENERATORI DI VAPORE - fig. 9.8.6
+                The Babcock & Wilcox Company - STEAM - fig 26.
+        Les valeurs correspondantes à une température de paroi de 1366.483
+        (2000. F) (tirées de STEAM) sont obtenues en supposant la courbe
+        une droite et en actionnant une conversion d'unités de mesure
+                                7.75      9
+          Kr = 5.67826*[15.5 + ------- * --- DeltaT(°K)]
+                                1500.     5
+
+  ******************************************************************************/
+  constant Real TabDeltaT[20]={-1100,-1000,-900,-800,-700,-600,-500,-400,-300,-200,
+      -100,0,100,200,400,600,800,1000,1400,1500};
+  constant Real TabTp[4]={273.15,523.15,773.15,1366.483333};
+  constant Real TabKr[4, 20]=[1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.E-04,
+      1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.163, 1.977, 2.56, 6.63, 12.793,
+       22.446, 35.82, 59.89, 65.94; 1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.E-04,
+      1.E-04, 1.E-04, 1.E-04, 1.E-04, 1.72, 2.15, 6.98, 10.23, 14.54, 25.586,
+      37.216, 49.08, 61.06, 84.9, 90.714; 1.E-04, 1.E-04, 1.E-04, 1.E-04,
+      1.E-04, 1.E-04, 1.63, 1.977, 2.56, 8.47, 12.38, 30.59, 36.64, 42.22,
+      54.08, 65.128, 76.76, 88.39, 110.48, 116.3; 1.E-04, 1.84, 2.52, 8.23,
+      12.1, 16.64, 36.13, 41.96, 47.76, 53.55, 59.33, 88.01, 93.29, 98.57,
+      109.14, 119.7, 130.26, 140.82, 161.94, 167.23];
+
+  /******************************************************************************
+        Modification to take into account the influence of different fuels
+  ********************************************************************************/
+  constant Real TabPl[6]={0.,0.06,0.12,0.18,0.24,0.30};
+  constant Real TabRap[4]={0.3,0.4,0.76,2.};
+  constant Real TabK2[4, 6]=[0.13, 0.372, 0.517, 0.626, 0.725, 0.815; 0.13,
+      0.38, 0.545, 0.675, 0.792, 0.882; 0.13, 0.392, 0.592, 0.75, 0.875, 0.985;
+       0.13, 0.429, 0.67, 0.862, 1.027, 1.1647];
+
+algorithm
+  Pgaz := Ppco2 + Pph2o;
+  Rap := Pph2o/Ppco2;
+
+  if Beaml <= 0 then
+    Kr := 0;
+  else
+    if (option_interpolation == 1) then
+      Kprim := ThermoSysPro.Functions.TableLinearInterpolation(TabTp, TabDeltaT, TabKr, Tp, DeltaT);
+    elseif (option_interpolation == 2) then
+      Kprim := ThermoSysPro.Functions.TableSplineInterpolation(TabTp, TabDeltaT, TabKr, Tp, DeltaT);
+    else
+      assert(false, "WBRadiativeHeatTransferCoefficient: incorrect interpolation option");
+    end if;
+    Pperl := Pgaz*Beaml;
+
+    if (option_interpolation == 1) then
+      Ak := ThermoSysPro.Functions.TableLinearInterpolation(TabRap, TabPl, TabK2, Rap, Pperl);
+    elseif (option_interpolation == 2) then
+      Ak := ThermoSysPro.Functions.TableSplineInterpolation(TabRap, TabPl, TabK2, Rap, Pperl);
+    else
+      assert(false, "WBRadiativeHeatTransferCoefficient: incorrect interpolation option");
+    end if;
+    Kr := Kprim*Ak;
+  end if;
+
+  annotation (
+      smoothOrder=2,
+      Icon(graphics),      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end WBRadiativeHeatTransferCoefficient;
diff --git a/ThermoSysPro/Correlations/Thermal/package.mo b/ThermoSysPro/Correlations/Thermal/package.mo
index 7cc5ccf4a4865e261e866b5df202e1061ba9b963..48ce2a5731bde56de80534bb51aac66f7b04cba6 100644
--- a/ThermoSysPro/Correlations/Thermal/package.mo
+++ b/ThermoSysPro/Correlations/Thermal/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Correlations;
-package Thermal "Thermal exchange correlations"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Thermal;
+within ThermoSysPro.Correlations;
+package Thermal "Thermal exchange correlations"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Thermal;
diff --git a/ThermoSysPro/Correlations/Thermal/package.order b/ThermoSysPro/Correlations/Thermal/package.order
index 87c8069faca241ddb0bad5437f2eb247a7445f52..1de7bb8f78188442d5cbb5f41f8b61e9ed4bf982 100644
--- a/ThermoSysPro/Correlations/Thermal/package.order
+++ b/ThermoSysPro/Correlations/Thermal/package.order
@@ -1,10 +1,10 @@
-Function_U1
-WBCrossedCurrentConvectiveHeatTransferCoefficient
-WBFlueGasesHeatTransferCoefficient
-WBHeatExchangerEfficiency
-WBInternalHeatTransferCoefficient
-WBInternalOnePhaseFlowHeatTransferCoefficient
-WBInternalSuperCriticalFlowHeatTransferCoefficient
-WBInternalTwoPhaseFlowHeatTransferCoefficient
-WBLongitudinalCurrentConvectiveHeatTransferCoefficient
-WBRadiativeHeatTransferCoefficient
+Function_U1
+WBCrossedCurrentConvectiveHeatTransferCoefficient
+WBFlueGasesHeatTransferCoefficient
+WBHeatExchangerEfficiency
+WBInternalHeatTransferCoefficient
+WBInternalOnePhaseFlowHeatTransferCoefficient
+WBInternalSuperCriticalFlowHeatTransferCoefficient
+WBInternalTwoPhaseFlowHeatTransferCoefficient
+WBLongitudinalCurrentConvectiveHeatTransferCoefficient
+WBRadiativeHeatTransferCoefficient
diff --git a/ThermoSysPro/Correlations/package.mo b/ThermoSysPro/Correlations/package.mo
index b0b076837fd1f5530f86cb2b10be2cf12cb6845f..0f82b13900bf1ac26ec442d01b2ccc1cb59c50e4 100644
--- a/ThermoSysPro/Correlations/package.mo
+++ b/ThermoSysPro/Correlations/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro;
-package Correlations "Fluid correlation library"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Correlations;
+within ThermoSysPro;
+package Correlations "Fluid correlation library"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Correlations;
diff --git a/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceAngularVelocity.mo b/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceAngularVelocity.mo
index 53d5f86d4067b0edb45714139422021aa9845880..1b117e161fea959f3c07cff7d38b57492fc45d6f 100644
--- a/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceAngularVelocity.mo
+++ b/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceAngularVelocity.mo
@@ -1,72 +1,72 @@
-within ThermoSysPro.ElectroMechanics.BoundaryConditions;
-model SourceAngularVelocity "Angular velocity source"
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N0=1400;
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-
-public
-  Units.SI.AngularVelocity w "Angular velocity";
-
-  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
-    annotation (Placement(transformation(
-        origin={110,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IAngularVelocity
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-equation
-
-  if (cardinality(IAngularVelocity) == 0) then
-    IAngularVelocity.signal = N0;
-  end if;
-
-  w = pi/30*IAngularVelocity.signal;
-
-  M.w = w;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "V"),
-        Line(points={{40,0},{100,0}}, color={0,0,255}),
-        Line(points={{100,0},{80,-20}}, color={0,0,255}),
-        Line(points={{100,0},{80,20}}, color={0,0,255})}),
-                            Icon(graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "V"),
-        Line(points={{40,0},{100,0}}, color={0,0,255}),
-        Line(points={{100,0},{80,-20}}, color={0,0,255}),
-        Line(points={{100,0},{80,20}}, color={0,0,255})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u> </p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SourceAngularVelocity;
+within ThermoSysPro.ElectroMechanics.BoundaryConditions;
+model SourceAngularVelocity "Angular velocity source"
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N0=1400;
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+
+public
+  Units.SI.AngularVelocity w "Angular velocity";
+
+  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
+    annotation (Placement(transformation(
+        origin={110,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IAngularVelocity
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+equation
+
+  if (cardinality(IAngularVelocity) == 0) then
+    IAngularVelocity.signal = N0;
+  end if;
+
+  w = pi/30*IAngularVelocity.signal;
+
+  M.w = w;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "V"),
+        Line(points={{40,0},{100,0}}, color={0,0,255}),
+        Line(points={{100,0},{80,-20}}, color={0,0,255}),
+        Line(points={{100,0},{80,20}}, color={0,0,255})}),
+                            Icon(graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "V"),
+        Line(points={{40,0},{100,0}}, color={0,0,255}),
+        Line(points={{100,0},{80,-20}}, color={0,0,255}),
+        Line(points={{100,0},{80,20}}, color={0,0,255})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u> </p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SourceAngularVelocity;
diff --git a/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceMechanicalPower.mo b/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceMechanicalPower.mo
index 707c9ee6631c14645cd567ca1580d894757b46fe..94bb9df51485bbd2833ba1e731cc06f92a80b973 100644
--- a/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceMechanicalPower.mo
+++ b/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceMechanicalPower.mo
@@ -1,64 +1,64 @@
-within ThermoSysPro.ElectroMechanics.BoundaryConditions;
-model SourceMechanicalPower "Mechanical power source"
-  parameter Units.SI.Power W0=150000;
-
-  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
-    annotation (Placement(transformation(
-        origin={110,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPower
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-equation
-
-  if (cardinality(IPower) == 0) then
-    IPower.signal = W0;
-  end if;
-
-  M.Ctr*M.w = IPower.signal;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "W"),
-        Line(points={{40,0},{100,0}}, color={0,0,255}),
-        Line(points={{100,0},{80,-20}}, color={0,0,255}),
-        Line(points={{100,0},{80,20}}, color={0,0,255})}),
-                            Icon(graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "W"),
-        Line(points={{40,0},{100,0}}, color={0,0,255}),
-        Line(points={{100,0},{80,-20}}, color={0,0,255}),
-        Line(points={{100,0},{80,20}}, color={0,0,255})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SourceMechanicalPower;
+within ThermoSysPro.ElectroMechanics.BoundaryConditions;
+model SourceMechanicalPower "Mechanical power source"
+  parameter Units.SI.Power W0=150000;
+
+  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
+    annotation (Placement(transformation(
+        origin={110,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPower
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+equation
+
+  if (cardinality(IPower) == 0) then
+    IPower.signal = W0;
+  end if;
+
+  M.Ctr*M.w = IPower.signal;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "W"),
+        Line(points={{40,0},{100,0}}, color={0,0,255}),
+        Line(points={{100,0},{80,-20}}, color={0,0,255}),
+        Line(points={{100,0},{80,20}}, color={0,0,255})}),
+                            Icon(graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "W"),
+        Line(points={{40,0},{100,0}}, color={0,0,255}),
+        Line(points={{100,0},{80,-20}}, color={0,0,255}),
+        Line(points={{100,0},{80,20}}, color={0,0,255})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SourceMechanicalPower;
diff --git a/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceTorque.mo b/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceTorque.mo
index aae6b15cc01b95be4aa19b1daefe08f61784ee55..6686038ebe0b573a47b0e8cbc109eb56fc6e5ccc 100644
--- a/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceTorque.mo
+++ b/ThermoSysPro/ElectroMechanics/BoundaryConditions/SourceTorque.mo
@@ -1,64 +1,64 @@
-within ThermoSysPro.ElectroMechanics.BoundaryConditions;
-model SourceTorque "Torque source"
-  parameter Units.SI.Torque T0=0;
-
-  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
-    annotation (Placement(transformation(
-        origin={110,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITorque
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-equation
-
-  if (cardinality(ITorque) == 0) then
-    ITorque.signal = T0;
-  end if;
-
-  M.Ctr = ITorque.signal;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T"),
-        Line(points={{40,0},{100,0}}, color={0,0,255}),
-        Line(points={{100,0},{80,-20}}, color={0,0,255}),
-        Line(points={{100,0},{80,20}}, color={0,0,255})}),
-                            Icon(graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T"),
-        Line(points={{40,0},{100,0}}, color={0,0,255}),
-        Line(points={{100,0},{80,-20}}, color={0,0,255}),
-        Line(points={{100,0},{80,20}}, color={0,0,255})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SourceTorque;
+within ThermoSysPro.ElectroMechanics.BoundaryConditions;
+model SourceTorque "Torque source"
+  parameter Units.SI.Torque T0=0;
+
+  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
+    annotation (Placement(transformation(
+        origin={110,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITorque
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+equation
+
+  if (cardinality(ITorque) == 0) then
+    ITorque.signal = T0;
+  end if;
+
+  M.Ctr = ITorque.signal;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T"),
+        Line(points={{40,0},{100,0}}, color={0,0,255}),
+        Line(points={{100,0},{80,-20}}, color={0,0,255}),
+        Line(points={{100,0},{80,20}}, color={0,0,255})}),
+                            Icon(graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T"),
+        Line(points={{40,0},{100,0}}, color={0,0,255}),
+        Line(points={{100,0},{80,-20}}, color={0,0,255}),
+        Line(points={{100,0},{80,20}}, color={0,0,255})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SourceTorque;
diff --git a/ThermoSysPro/ElectroMechanics/BoundaryConditions/package.mo b/ThermoSysPro/ElectroMechanics/BoundaryConditions/package.mo
index e2e7bc564090e520217dd3bceff3e3f7e656270b..d84d2bd341594a4a1ae1745a61fa80eedf49cd3e 100644
--- a/ThermoSysPro/ElectroMechanics/BoundaryConditions/package.mo
+++ b/ThermoSysPro/ElectroMechanics/BoundaryConditions/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.ElectroMechanics;
-package BoundaryConditions "Boundary conditions"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end BoundaryConditions;
+within ThermoSysPro.ElectroMechanics;
+package BoundaryConditions "Boundary conditions"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end BoundaryConditions;
diff --git a/ThermoSysPro/ElectroMechanics/BoundaryConditions/package.order b/ThermoSysPro/ElectroMechanics/BoundaryConditions/package.order
index 0b5a4ceba89d134104b913edf8732081388ff551..4d007ccff2d4e8f5b58396bad1b5ee1f668a612f 100644
--- a/ThermoSysPro/ElectroMechanics/BoundaryConditions/package.order
+++ b/ThermoSysPro/ElectroMechanics/BoundaryConditions/package.order
@@ -1,3 +1,3 @@
-SourceAngularVelocity
-SourceMechanicalPower
-SourceTorque
+SourceAngularVelocity
+SourceMechanicalPower
+SourceTorque
diff --git a/ThermoSysPro/ElectroMechanics/Connectors.mo b/ThermoSysPro/ElectroMechanics/Connectors.mo
index fe933ff4a012654c44d1a1ed558680ec73352cfb..e0a2333a3fae92ba82f053f3d15eec6193fd4ee4 100644
--- a/ThermoSysPro/ElectroMechanics/Connectors.mo
+++ b/ThermoSysPro/ElectroMechanics/Connectors.mo
@@ -1,156 +1,156 @@
-within ThermoSysPro.ElectroMechanics;
-package Connectors "Connectors"
-  connector MechanichalTorque "Mechanical torque"
-    Units.SI.Torque Ctr "Torque";
-    Units.SI.AngularVelocity w "Angular velocity";
-    annotation (
-      Window(
-        x=0.25,
-        y=0.14,
-        width=0.6,
-        height=0.6),
-      Diagram(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Polygon(
-            points={{-100,60},{0,60},{100,0},{0,-60},{-100,-60},{-100,60}},
-            lineColor={0,0,255},
-            fillColor={255,255,0},
-            fillPattern=FillPattern.Solid)}),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-  end MechanichalTorque;
-  annotation (Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end Connectors;
+within ThermoSysPro.ElectroMechanics;
+package Connectors "Connectors"
+  connector MechanichalTorque "Mechanical torque"
+    Units.SI.Torque Ctr "Torque";
+    Units.SI.AngularVelocity w "Angular velocity";
+    annotation (
+      Window(
+        x=0.25,
+        y=0.14,
+        width=0.6,
+        height=0.6),
+      Diagram(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Polygon(
+            points={{-100,60},{0,60},{100,0},{0,-60},{-100,-60},{-100,60}},
+            lineColor={0,0,255},
+            fillColor={255,255,0},
+            fillPattern=FillPattern.Solid)}),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+  end MechanichalTorque;
+  annotation (Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end Connectors;
diff --git a/ThermoSysPro/ElectroMechanics/Machines/Generator.mo b/ThermoSysPro/ElectroMechanics/Machines/Generator.mo
index c08ebbe573b4f64249554a8f1e16b5ac65174c2b..fc6ea3d147d0074dd088a8e57e95dd2160682118 100644
--- a/ThermoSysPro/ElectroMechanics/Machines/Generator.mo
+++ b/ThermoSysPro/ElectroMechanics/Machines/Generator.mo
@@ -1,183 +1,183 @@
-within ThermoSysPro.ElectroMechanics.Machines;
-model Generator "Eletrical generator"
-  parameter Real eta = 99.8 "Efficiency (percent)";
-
-public
-  Units.SI.Power Welec "Electrical power produced by the generator";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
-    annotation (Placement(transformation(extent={{-116,26},{-84,54}}, rotation=
-            0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
-    annotation (Placement(transformation(extent={{-116,66},{-84,94}}, rotation=
-            0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
-    annotation (Placement(transformation(extent={{-116,-14},{-84,14}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
-    annotation (Placement(transformation(extent={{-116,-54},{-84,-26}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
-    annotation (Placement(transformation(extent={{-116,-94},{-84,-66}},
-          rotation=0)));
-equation
-  /* Hnadling of unconnected connectors */
-  if (cardinality(Wmec1) == 0) then
-    Wmec1.signal = 0;
-  end if;
-  if (cardinality(Wmec2) == 0) then
-   Wmec2.signal = 0;
-  end if;
-  if (cardinality(Wmec3) == 0) then
-   Wmec3.signal = 0;
-  end if;
-  if (cardinality(Wmec4) == 0) then
-   Wmec4.signal = 0;
-  end if;
-  if (cardinality(Wmec5) == 0) then
-   Wmec5.signal = 0;
-  end if;
-
-  assert(eta <= 100, "Generator : efficiency over 100%");
-  assert(eta >= 0, "Generator : efficiency below 0%");
-
-  /* Electrical power produced by the generator */
-  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal)*eta/100;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
-        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
-        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
-        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
-        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
-                                Icon(graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
-        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
-        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
-        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
-        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
-        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 4.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Generator;
+within ThermoSysPro.ElectroMechanics.Machines;
+model Generator "Eletrical generator"
+  parameter Real eta = 99.8 "Efficiency (percent)";
+
+public
+  Units.SI.Power Welec "Electrical power produced by the generator";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
+    annotation (Placement(transformation(extent={{-116,26},{-84,54}}, rotation=
+            0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
+    annotation (Placement(transformation(extent={{-116,66},{-84,94}}, rotation=
+            0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
+    annotation (Placement(transformation(extent={{-116,-14},{-84,14}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
+    annotation (Placement(transformation(extent={{-116,-54},{-84,-26}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
+    annotation (Placement(transformation(extent={{-116,-94},{-84,-66}},
+          rotation=0)));
+equation
+  /* Hnadling of unconnected connectors */
+  if (cardinality(Wmec1) == 0) then
+    Wmec1.signal = 0;
+  end if;
+  if (cardinality(Wmec2) == 0) then
+   Wmec2.signal = 0;
+  end if;
+  if (cardinality(Wmec3) == 0) then
+   Wmec3.signal = 0;
+  end if;
+  if (cardinality(Wmec4) == 0) then
+   Wmec4.signal = 0;
+  end if;
+  if (cardinality(Wmec5) == 0) then
+   Wmec5.signal = 0;
+  end if;
+
+  assert(eta <= 100, "Generator : efficiency over 100%");
+  assert(eta >= 0, "Generator : efficiency below 0%");
+
+  /* Electrical power produced by the generator */
+  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal)*eta/100;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
+        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
+        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
+        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
+        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
+                                Icon(graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
+        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
+        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
+        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
+        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
+        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 4.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Generator;
diff --git a/ThermoSysPro/ElectroMechanics/Machines/Generator11.mo b/ThermoSysPro/ElectroMechanics/Machines/Generator11.mo
index 8c8748cb608f9b2dfb5d6d160be17352d0537d0a..1036a96c64d01368f8355d92e546e30cfb3b0b52 100644
--- a/ThermoSysPro/ElectroMechanics/Machines/Generator11.mo
+++ b/ThermoSysPro/ElectroMechanics/Machines/Generator11.mo
@@ -1,232 +1,232 @@
-within ThermoSysPro.ElectroMechanics.Machines;
-model Generator11 "Electrical generator with eleven inputs"
-  parameter Real eta = 99.8 "Efficiency (percent)";
-
-public
-  Units.SI.Power Welec "Electrical power produced by the generator";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
-    annotation (Placement(transformation(extent={{-116,78},{-84,106}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
-    annotation (Placement(transformation(extent={{-116,116},{-84,144}},
-          rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
-    annotation (Placement(transformation(extent={{-116,40},{-84,68}}, rotation=
-            0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
-    annotation (Placement(transformation(extent={{-116,3},{-84,31}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
-    annotation (Placement(transformation(extent={{-116,-34},{-84,-6}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec6
-    annotation (Placement(transformation(extent={{-116,-71},{-84,-43}},
-          rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec7
-    annotation (Placement(transformation(extent={{-116,-108},{-84,-80}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec8
-    annotation (Placement(transformation(extent={{-116,-144},{-84,-116}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
-                              annotation (Placement(transformation(
-        origin={88,134},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec9
-    annotation (Placement(transformation(
-        origin={-20,-142},
-        extent={{-14,-16},{14,16}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec10
-    annotation (Placement(transformation(
-        origin={34,-142},
-        extent={{-14,-16},{14,16}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec11
-    annotation (Placement(transformation(
-        origin={98,-144},
-        extent={{-14,-16},{14,16}},
-        rotation=90)));
-equation
-
-  /* Handling of unconnected connectors */
-  if (cardinality(Wmec1) == 0) then
-    Wmec1.signal = 0;
-  end if;
-  if (cardinality(Wmec2) == 0) then
-   Wmec2.signal = 0;
-  end if;
-  if (cardinality(Wmec3) == 0) then
-   Wmec3.signal = 0;
-  end if;
-  if (cardinality(Wmec4) == 0) then
-   Wmec4.signal = 0;
-  end if;
-  if (cardinality(Wmec5) == 0) then
-   Wmec5.signal = 0;
-  end if;
-  if (cardinality(Wmec6) == 0) then
-   Wmec6.signal = 0;
-  end if;
-  if (cardinality(Wmec7) == 0) then
-   Wmec7.signal = 0;
-  end if;
-  if (cardinality(Wmec8) == 0) then
-   Wmec8.signal = 0;
-  end if;
-  if (cardinality(Wmec9) == 0) then
-   Wmec9.signal = 0;
-  end if;
-  if (cardinality(Wmec10) == 0) then
-   Wmec10.signal = 0;
-  end if;
-  if (cardinality(Wmec11) == 0) then
-   Wmec11.signal = 0;
-  end if;
-
-  assert(eta <= 100, "Generator : efficiency over 100%");
-  assert(eta >= 0, "Generator : efficiency below 0%");
-
-  /* Electrical power produced by the generator */
-  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal + Wmec6.signal + Wmec7.signal + Wmec8.signal + Wmec9.signal+ Wmec10.signal+ Wmec11.signal)*eta/100;
-
-  MechPower.signal = Welec;
-
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-130},{100,130}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={28,108,200},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={28,108,200},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={28,108,200},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-84,130},{-84,-130}},
-          color={0,0,255},
-          thickness=0.5)}),     Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-130},{100,130}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={28,108,200},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={28,108,200},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={28,108,200},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
-        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
-        Line(
-          points={{-83,130},{-83,-130}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Generator11;
+within ThermoSysPro.ElectroMechanics.Machines;
+model Generator11 "Electrical generator with eleven inputs"
+  parameter Real eta = 99.8 "Efficiency (percent)";
+
+public
+  Units.SI.Power Welec "Electrical power produced by the generator";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
+    annotation (Placement(transformation(extent={{-116,78},{-84,106}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
+    annotation (Placement(transformation(extent={{-116,116},{-84,144}},
+          rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
+    annotation (Placement(transformation(extent={{-116,40},{-84,68}}, rotation=
+            0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
+    annotation (Placement(transformation(extent={{-116,3},{-84,31}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
+    annotation (Placement(transformation(extent={{-116,-34},{-84,-6}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec6
+    annotation (Placement(transformation(extent={{-116,-71},{-84,-43}},
+          rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec7
+    annotation (Placement(transformation(extent={{-116,-108},{-84,-80}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec8
+    annotation (Placement(transformation(extent={{-116,-144},{-84,-116}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
+                              annotation (Placement(transformation(
+        origin={88,134},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec9
+    annotation (Placement(transformation(
+        origin={-20,-142},
+        extent={{-14,-16},{14,16}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec10
+    annotation (Placement(transformation(
+        origin={34,-142},
+        extent={{-14,-16},{14,16}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec11
+    annotation (Placement(transformation(
+        origin={98,-144},
+        extent={{-14,-16},{14,16}},
+        rotation=90)));
+equation
+
+  /* Handling of unconnected connectors */
+  if (cardinality(Wmec1) == 0) then
+    Wmec1.signal = 0;
+  end if;
+  if (cardinality(Wmec2) == 0) then
+   Wmec2.signal = 0;
+  end if;
+  if (cardinality(Wmec3) == 0) then
+   Wmec3.signal = 0;
+  end if;
+  if (cardinality(Wmec4) == 0) then
+   Wmec4.signal = 0;
+  end if;
+  if (cardinality(Wmec5) == 0) then
+   Wmec5.signal = 0;
+  end if;
+  if (cardinality(Wmec6) == 0) then
+   Wmec6.signal = 0;
+  end if;
+  if (cardinality(Wmec7) == 0) then
+   Wmec7.signal = 0;
+  end if;
+  if (cardinality(Wmec8) == 0) then
+   Wmec8.signal = 0;
+  end if;
+  if (cardinality(Wmec9) == 0) then
+   Wmec9.signal = 0;
+  end if;
+  if (cardinality(Wmec10) == 0) then
+   Wmec10.signal = 0;
+  end if;
+  if (cardinality(Wmec11) == 0) then
+   Wmec11.signal = 0;
+  end if;
+
+  assert(eta <= 100, "Generator : efficiency over 100%");
+  assert(eta >= 0, "Generator : efficiency below 0%");
+
+  /* Electrical power produced by the generator */
+  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal + Wmec6.signal + Wmec7.signal + Wmec8.signal + Wmec9.signal+ Wmec10.signal+ Wmec11.signal)*eta/100;
+
+  MechPower.signal = Welec;
+
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-130},{100,130}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={28,108,200},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={28,108,200},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={28,108,200},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-84,130},{-84,-130}},
+          color={0,0,255},
+          thickness=0.5)}),     Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-130},{100,130}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={28,108,200},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={28,108,200},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={28,108,200},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
+        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
+        Line(
+          points={{-83,130},{-83,-130}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Generator11;
diff --git a/ThermoSysPro/ElectroMechanics/Machines/Generator8.mo b/ThermoSysPro/ElectroMechanics/Machines/Generator8.mo
index 625ff3e5a4067b15fd2410400132dfa5beb350dc..0d6f026e423e5fb690186550cb73653949129dac 100644
--- a/ThermoSysPro/ElectroMechanics/Machines/Generator8.mo
+++ b/ThermoSysPro/ElectroMechanics/Machines/Generator8.mo
@@ -1,204 +1,204 @@
-within ThermoSysPro.ElectroMechanics.Machines;
-model Generator8 "Eletrical generator with eight inputs"
-  parameter Real eta = 99.8 "Efficiency (percent)";
-
-public
-  Units.SI.Power Welec "Electrical power produced by the generator";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
-    annotation (Placement(transformation(extent={{-116,78},{-84,106}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
-    annotation (Placement(transformation(extent={{-116,116},{-84,144}},
-          rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
-    annotation (Placement(transformation(extent={{-116,40},{-84,68}}, rotation=
-            0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
-    annotation (Placement(transformation(extent={{-116,3},{-84,31}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
-    annotation (Placement(transformation(extent={{-116,-34},{-84,-6}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec6
-    annotation (Placement(transformation(extent={{-116,-71},{-84,-43}},
-          rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec7
-    annotation (Placement(transformation(extent={{-116,-108},{-84,-80}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec8
-    annotation (Placement(transformation(extent={{-116,-144},{-84,-116}},
-          rotation=0)));
-equation
-  /* Hnadling of unconnected connectors */
-  if (cardinality(Wmec1) == 0) then
-    Wmec1.signal = 0;
-  end if;
-  if (cardinality(Wmec2) == 0) then
-   Wmec2.signal = 0;
-  end if;
-  if (cardinality(Wmec3) == 0) then
-   Wmec3.signal = 0;
-  end if;
-  if (cardinality(Wmec4) == 0) then
-   Wmec4.signal = 0;
-  end if;
-  if (cardinality(Wmec5) == 0) then
-   Wmec5.signal = 0;
-  end if;
-  if (cardinality(Wmec6) == 0) then
-   Wmec3.signal = 0;
-  end if;
-  if (cardinality(Wmec7) == 0) then
-   Wmec4.signal = 0;
-  end if;
-  if (cardinality(Wmec8) == 0) then
-   Wmec5.signal = 0;
-  end if;
-
-  assert(eta <= 100, "Generator : efficiency over 100%");
-  assert(eta >= 0, "Generator : efficiency below 0%");
-
-  /* Electrical power produced by the generator */
-  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal + Wmec6.signal + Wmec7.signal + Wmec8.signal)*eta/100;
-
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-130},{100,130}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-84,130},{-84,-130}},
-          color={0,0,255},
-          thickness=0.5)}),     Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-130},{100,130}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
-        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
-        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
-        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
-        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
-        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 4.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Generator8;
+within ThermoSysPro.ElectroMechanics.Machines;
+model Generator8 "Eletrical generator with eight inputs"
+  parameter Real eta = 99.8 "Efficiency (percent)";
+
+public
+  Units.SI.Power Welec "Electrical power produced by the generator";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
+    annotation (Placement(transformation(extent={{-116,78},{-84,106}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
+    annotation (Placement(transformation(extent={{-116,116},{-84,144}},
+          rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
+    annotation (Placement(transformation(extent={{-116,40},{-84,68}}, rotation=
+            0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
+    annotation (Placement(transformation(extent={{-116,3},{-84,31}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
+    annotation (Placement(transformation(extent={{-116,-34},{-84,-6}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec6
+    annotation (Placement(transformation(extent={{-116,-71},{-84,-43}},
+          rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec7
+    annotation (Placement(transformation(extent={{-116,-108},{-84,-80}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec8
+    annotation (Placement(transformation(extent={{-116,-144},{-84,-116}},
+          rotation=0)));
+equation
+  /* Hnadling of unconnected connectors */
+  if (cardinality(Wmec1) == 0) then
+    Wmec1.signal = 0;
+  end if;
+  if (cardinality(Wmec2) == 0) then
+   Wmec2.signal = 0;
+  end if;
+  if (cardinality(Wmec3) == 0) then
+   Wmec3.signal = 0;
+  end if;
+  if (cardinality(Wmec4) == 0) then
+   Wmec4.signal = 0;
+  end if;
+  if (cardinality(Wmec5) == 0) then
+   Wmec5.signal = 0;
+  end if;
+  if (cardinality(Wmec6) == 0) then
+   Wmec3.signal = 0;
+  end if;
+  if (cardinality(Wmec7) == 0) then
+   Wmec4.signal = 0;
+  end if;
+  if (cardinality(Wmec8) == 0) then
+   Wmec5.signal = 0;
+  end if;
+
+  assert(eta <= 100, "Generator : efficiency over 100%");
+  assert(eta >= 0, "Generator : efficiency below 0%");
+
+  /* Electrical power produced by the generator */
+  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal + Wmec6.signal + Wmec7.signal + Wmec8.signal)*eta/100;
+
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-130},{100,130}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-84,130},{-84,-130}},
+          color={0,0,255},
+          thickness=0.5)}),     Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-130},{100,130}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
+        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
+        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
+        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
+        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
+        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 4.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Generator8;
diff --git a/ThermoSysPro/ElectroMechanics/Machines/Shaft.mo b/ThermoSysPro/ElectroMechanics/Machines/Shaft.mo
index 63fb2d03ce3a64d4e1ef6b416e6accd34eff62e6..5ea523c6a592c93774fb2f9843794d4acf9fdf83 100644
--- a/ThermoSysPro/ElectroMechanics/Machines/Shaft.mo
+++ b/ThermoSysPro/ElectroMechanics/Machines/Shaft.mo
@@ -1,91 +1,91 @@
-within ThermoSysPro.ElectroMechanics.Machines;
-model Shaft "Mechanical coupling"
-  parameter Real Ke=0.2 "Elasticity coefficient (s.u.)";
-  parameter Real D=0.3 "Damping coefficient (n.u.)";
-  parameter Boolean steady_state_mech=true
-    "true: start from steady state - false: start from delta=0";
-
-public
-  Units.SI.Angle delta(start=0) "Torsion angle";
-  Units.SI.AngularVelocity w_rel
-    "Relative angular speed between the two extremities of the shaft";
-  Units.SI.Torque Ctr "Transmitted torque";
-  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque C2
-                                  annotation (Placement(transformation(extent={
-            {100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque C1
-                                  annotation (Placement(transformation(extent={
-            {-120,-10},{-100,10}}, rotation=0)));
-initial equation
-  if steady_state_mech then
-    der(delta) = 0;
-  else
-    delta = 0;
-  end if;
-
-equation
-  w_rel = C1.w - C2.w;
-
-  der(delta) = w_rel;
-
-  Ctr = Ke*delta + D*w_rel;
-
-  C1.Ctr = Ctr;
-  C2.Ctr = Ctr;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-80,20},{80,-20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={160,160,164}),
-        Polygon(
-          points={{-100,10},{-100,-8},{-80,-14},{-80,14},{-100,10}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{80,14},{100,10},{100,-12},{80,-14},{80,14}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-80,20},{80,-20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={160,160,164}),
-        Polygon(
-          points={{-100,10},{-100,-8},{-80,-14},{-80,14},{-100,10}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{80,14},{100,10},{100,-12},{80,-14},{80,14}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.06,
-      y=0.13,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Shaft;
+within ThermoSysPro.ElectroMechanics.Machines;
+model Shaft "Mechanical coupling"
+  parameter Real Ke=0.2 "Elasticity coefficient (s.u.)";
+  parameter Real D=0.3 "Damping coefficient (n.u.)";
+  parameter Boolean steady_state_mech=true
+    "true: start from steady state - false: start from delta=0";
+
+public
+  Units.SI.Angle delta(start=0) "Torsion angle";
+  Units.SI.AngularVelocity w_rel
+    "Relative angular speed between the two extremities of the shaft";
+  Units.SI.Torque Ctr "Transmitted torque";
+  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque C2
+                                  annotation (Placement(transformation(extent={
+            {100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque C1
+                                  annotation (Placement(transformation(extent={
+            {-120,-10},{-100,10}}, rotation=0)));
+initial equation
+  if steady_state_mech then
+    der(delta) = 0;
+  else
+    delta = 0;
+  end if;
+
+equation
+  w_rel = C1.w - C2.w;
+
+  der(delta) = w_rel;
+
+  Ctr = Ke*delta + D*w_rel;
+
+  C1.Ctr = Ctr;
+  C2.Ctr = Ctr;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-80,20},{80,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={160,160,164}),
+        Polygon(
+          points={{-100,10},{-100,-8},{-80,-14},{-80,14},{-100,10}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{80,14},{100,10},{100,-12},{80,-14},{80,14}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-80,20},{80,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={160,160,164}),
+        Polygon(
+          points={{-100,10},{-100,-8},{-80,-14},{-80,14},{-100,10}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{80,14},{100,10},{100,-12},{80,-14},{80,14}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.06,
+      y=0.13,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Shaft;
diff --git a/ThermoSysPro/ElectroMechanics/Machines/SynchronousMotor.mo b/ThermoSysPro/ElectroMechanics/Machines/SynchronousMotor.mo
index 553204e2f1f1459aa4fb0ed90fef53b10c183e46..fd361b1e4fbb00bb6c4d480458343d40618af7ad 100644
--- a/ThermoSysPro/ElectroMechanics/Machines/SynchronousMotor.mo
+++ b/ThermoSysPro/ElectroMechanics/Machines/SynchronousMotor.mo
@@ -1,174 +1,174 @@
-within ThermoSysPro.ElectroMechanics.Machines;
-model SynchronousMotor "Synchronous electrical motor"
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vrot=1400.
-    "Nominal rotational speed";
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vrot0=0
-    "Initial rotational speed (active if steady_state_mech=true)";
-  parameter Units.SI.Voltage Ualim=380. "Voltage";
-  parameter Real D=10.0 "Damping coefficient (mechanical losses) (n.u.)";
-  parameter Units.SI.Inductance Lm=1. "Motor nductance";
-  parameter Units.SI.Resistance Rm=0.00001 "Motor resistance";
-  parameter Real Ki=1. "Proportionnality coef. between Cm and Im (N.m/A)";
-  parameter Units.SI.MomentOfInertia J=4. "Motor moment of inertia";
-  parameter Boolean steady_state_mech=true
-    "true: start from steady state - false : start from Vrot0";
-  parameter Boolean mech_coupling=true "Use mechanical coupling component";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real Km=30*Ualim/(pi*Vrot)
-    "Voltage in rotor under stationary state";
-
-public
-  Units.SI.AngularVelocity w "Angular speed";
-  Units.SI.Torque Cm "Motor torque";
-  Units.SI.Torque Ctr "Mechanical torque";
-  Units.SI.Current Im "Current";
-  Units.SI.Voltage Um "Voltage";
-
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical marche
-    annotation (Placement(transformation(
-        origin={0,44},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque C
-                                 annotation (Placement(transformation(extent={{
-            92,-10},{112,10}}, rotation=0)));
-initial equation
-  if steady_state_mech then
-    if mech_coupling then
-      der(w) = 0;
-    end if;
-    der(Im) = 0;
-  else
-    if mech_coupling then
-      w = (pi/30)*Vrot0;
-    end if;
-    Im = 0;
-  end if;
-
-equation
-  C.w = w;
-  C.Ctr = Ctr;
-
-  J*der(w) = Cm - D*w - Ctr;
-  Lm*der(Im) = Um - Km*w - Rm*Im;
-
-  Um = if marche.signal then Ualim else 0;
-  Cm = Ki*Im;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-60,32},{62,-34}},
-          lineColor={0,0,255},
-          fillColor={0,128,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-60,-4},{62,0}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-60,16},{62,20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-60,-22},{62,-18}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{62,12},{92,-12}},
-          lineColor={0,0,255},
-          fillColor={0,128,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-90,12},{-60,-12}},
-          lineColor={0,0,255},
-          fillColor={0,128,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{92,-22},{90,-26},{88,-28},{84,-30},{80,-30},{76,-28},{72,
-              -22},{70,-14},{70,-6},{70,16},{72,22},{74,26},{76,28},{80,30},{82,
-              30},{86,28},{88,26},{90,22},{90,28},{86,24},{90,22}}),
-        Rectangle(
-          extent={{-60,30},{62,34}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-60,-36},{62,-32}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-60,32},{62,-34}},
-          lineColor={0,0,255},
-          fillColor={0,128,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-60,-4},{62,0}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-60,16},{62,20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-60,-22},{62,-18}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{62,12},{92,-12}},
-          lineColor={0,0,255},
-          fillColor={0,128,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-90,12},{-60,-12}},
-          lineColor={0,0,255},
-          fillColor={0,128,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{92,-22},{90,-26},{88,-28},{84,-30},{80,-30},{76,-28},{72,
-              -22},{70,-14},{70,-6},{70,16},{72,22},{74,26},{76,28},{80,30},{82,
-              30},{86,28},{88,26},{90,22},{90,28},{86,24},{90,22}}),
-        Rectangle(
-          extent={{-60,30},{62,34}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-60,-36},{62,-32}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0})}),
-    Window(
-      x=0.07,
-      y=0.04,
-      width=0.79,
-      height=0.78),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SynchronousMotor;
+within ThermoSysPro.ElectroMechanics.Machines;
+model SynchronousMotor "Synchronous electrical motor"
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vrot=1400.
+    "Nominal rotational speed";
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vrot0=0
+    "Initial rotational speed (active if steady_state_mech=true)";
+  parameter Units.SI.Voltage Ualim=380. "Voltage";
+  parameter Real D=10.0 "Damping coefficient (mechanical losses) (n.u.)";
+  parameter Units.SI.Inductance Lm=1. "Motor nductance";
+  parameter Units.SI.Resistance Rm=0.00001 "Motor resistance";
+  parameter Real Ki=1. "Proportionnality coef. between Cm and Im (N.m/A)";
+  parameter Units.SI.MomentOfInertia J=4. "Motor moment of inertia";
+  parameter Boolean steady_state_mech=true
+    "true: start from steady state - false : start from Vrot0";
+  parameter Boolean mech_coupling=true "Use mechanical coupling component";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real Km=30*Ualim/(pi*Vrot)
+    "Voltage in rotor under stationary state";
+
+public
+  Units.SI.AngularVelocity w "Angular speed";
+  Units.SI.Torque Cm "Motor torque";
+  Units.SI.Torque Ctr "Mechanical torque";
+  Units.SI.Current Im "Current";
+  Units.SI.Voltage Um "Voltage";
+
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical marche
+    annotation (Placement(transformation(
+        origin={0,44},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque C
+                                 annotation (Placement(transformation(extent={{
+            92,-10},{112,10}}, rotation=0)));
+initial equation
+  if steady_state_mech then
+    if mech_coupling then
+      der(w) = 0;
+    end if;
+    der(Im) = 0;
+  else
+    if mech_coupling then
+      w = (pi/30)*Vrot0;
+    end if;
+    Im = 0;
+  end if;
+
+equation
+  C.w = w;
+  C.Ctr = Ctr;
+
+  J*der(w) = Cm - D*w - Ctr;
+  Lm*der(Im) = Um - Km*w - Rm*Im;
+
+  Um = if marche.signal then Ualim else 0;
+  Cm = Ki*Im;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-60,32},{62,-34}},
+          lineColor={0,0,255},
+          fillColor={0,128,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-60,-4},{62,0}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-60,16},{62,20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-60,-22},{62,-18}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{62,12},{92,-12}},
+          lineColor={0,0,255},
+          fillColor={0,128,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-90,12},{-60,-12}},
+          lineColor={0,0,255},
+          fillColor={0,128,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{92,-22},{90,-26},{88,-28},{84,-30},{80,-30},{76,-28},{72,
+              -22},{70,-14},{70,-6},{70,16},{72,22},{74,26},{76,28},{80,30},{82,
+              30},{86,28},{88,26},{90,22},{90,28},{86,24},{90,22}}),
+        Rectangle(
+          extent={{-60,30},{62,34}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-60,-36},{62,-32}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-60,32},{62,-34}},
+          lineColor={0,0,255},
+          fillColor={0,128,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-60,-4},{62,0}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-60,16},{62,20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-60,-22},{62,-18}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{62,12},{92,-12}},
+          lineColor={0,0,255},
+          fillColor={0,128,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-90,12},{-60,-12}},
+          lineColor={0,0,255},
+          fillColor={0,128,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{92,-22},{90,-26},{88,-28},{84,-30},{80,-30},{76,-28},{72,
+              -22},{70,-14},{70,-6},{70,16},{72,22},{74,26},{76,28},{80,30},{82,
+              30},{86,28},{88,26},{90,22},{90,28},{86,24},{90,22}}),
+        Rectangle(
+          extent={{-60,30},{62,34}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-60,-36},{62,-32}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0})}),
+    Window(
+      x=0.07,
+      y=0.04,
+      width=0.79,
+      height=0.78),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SynchronousMotor;
diff --git a/ThermoSysPro/ElectroMechanics/Machines/package.mo b/ThermoSysPro/ElectroMechanics/Machines/package.mo
index 20f458ac093ee0872265938947d1c3673ca4d6a2..51a1bf34ce2f270de4ca060660ca70ececc0a34b 100644
--- a/ThermoSysPro/ElectroMechanics/Machines/package.mo
+++ b/ThermoSysPro/ElectroMechanics/Machines/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.ElectroMechanics;
-package Machines "Machines"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Machines;
+within ThermoSysPro.ElectroMechanics;
+package Machines "Machines"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Machines;
diff --git a/ThermoSysPro/ElectroMechanics/Machines/package.order b/ThermoSysPro/ElectroMechanics/Machines/package.order
index 6e31e6a247e07d362d534dacaa1c1b59c962b0a4..68b6745a8d32db01ce59c3c807ef60ddd2437c7a 100644
--- a/ThermoSysPro/ElectroMechanics/Machines/package.order
+++ b/ThermoSysPro/ElectroMechanics/Machines/package.order
@@ -1,5 +1,5 @@
-Generator
-Generator8
-Generator11
-Shaft
-SynchronousMotor
+Generator
+Generator8
+Generator11
+Shaft
+SynchronousMotor
diff --git a/ThermoSysPro/ElectroMechanics/package.mo b/ThermoSysPro/ElectroMechanics/package.mo
index 9143a078b517565daa5ff5ad8ef92762b33e3c94..dbf3d8d1e43e68ecf4c90c986730e0f6673e26c7 100644
--- a/ThermoSysPro/ElectroMechanics/package.mo
+++ b/ThermoSysPro/ElectroMechanics/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro;
-package ElectroMechanics "Electro-mechanics components library"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end ElectroMechanics;
+within ThermoSysPro;
+package ElectroMechanics "Electro-mechanics components library"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end ElectroMechanics;
diff --git a/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/GasTurbineTrip.mo b/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/GasTurbineTrip.mo
index 363db2b00d97123494c33e31de1cff263ffde64e..5b15e9200f0d7771746f15373018a71aedb07f41 100644
--- a/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/GasTurbineTrip.mo
+++ b/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/GasTurbineTrip.mo
@@ -1,1840 +1,1840 @@
-within ThermoSysPro.Examples.Book.PowerPlants.CombinedCyclePowerPlant;
-model GasTurbineTrip "CCPP model to simulate a gas turbine trip"
-  parameter Real CstHP(fixed=false,start=7618660.65374636)
-    "Stodola's ellipse coefficient HP";
-  parameter Real EtaIsNomHP(fixed=false,start=0.875)
-    "Turbine HP: Nominal isentropic efficiency ";
-  parameter Real CstMP(fixed=false,start=278905.664031036)
-    "Stodola's ellipse coefficient MP";
-  //parameter Real EtaIsNomMP(fixed=false,start=0.96)
-  //  "Turbine MP: Nominal isentropic efficiency ";
-  parameter Real CstBP(fixed=false,start=13491.6445678148)
-    "Stodola's ellipse coefficient BP";
-  parameter Real EtaIsNomBP(fixed=false,start=0.92)
-    "Turbine MP: Nominal isentropic efficiency ";
-// //
-  //parameter Modelica.SIunits.AbsolutePressure PoutPumpEx(fixed=false,start=22e5)"Flow pressure at the outlet of the pump";
-  //parameter Modelica.SIunits.Length zc(fixed=false,start=1.5) "Condenser water level";
-
-  parameter Real LP_Pump_a1(fixed=false,start=-6000)
-    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-
-  //parameter Real a3_PumpBP(fixed=false,start=400)"Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVHP(fixed=false, start=47829.4)
-    "Maximum CV: steame valve HP Drum  ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVMP(fixed=false, start=47829.4)
-    "Maximum CV: steame valve  Drum MP";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
-    "Maximum CV: steame valve BP Drum ";
-
-  //parameter ThermoSysPro.Units.Cv CvmaxValveWBP(fixed=false,start=10000)
-  //  "Maximum CV: Water valve BP Drum ";
-
-  parameter Real Fouling_SHP(fixed=false,start=0.075)
-    "Sur HP: heat exchange fouling coefficient";
-
-  //parameter Real Fouling_EHP(fixed=false,start=1)
-  //  "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP1(fixed=false,start=0.07)
-    "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP2(fixed=false,start=0.11)
-    "Eco HP2: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP3(fixed=false,start=0.06)
-    "Eco HP3: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP4(fixed=false,start=0.03)
-    "Eco HP4: heat exchange fouling coefficient";
-
-  parameter Real Fouling_SMP(fixed=false,start=0.1358)
-    "Sur MP1: heat exchange fouling coefficient";
-
-  //parameter Real Fouling_SMP(fixed=true,start=0.065)
-  //  "Sur MP1: heat exchange fouling coefficient";
-
-  parameter Real Fouling_EMP(fixed=false,start=0.09)
-    "Eco MP: heat exchange fouling coefficient";
-
-  parameter Real Fouling_EvHP(fixed=false,start=0.24)
-    "Evapo HP: heat exchange fouling coefficient";
-  parameter Real Fouling_EvMP(fixed=false,start=0.08)
-    "Evapo MP: heat exchange fouling coefficient";
-  parameter Real Fouling_EvBP(fixed=false,start=0.09)
-    "Evapo BP: heat exchange fouling coefficient";
-
-  parameter Real Fouling_SBP(fixed=false,start=0.05)
-    "Sur BP: heat exchange fouling coefficient";
-  parameter Real Fouling_EBP(fixed=false,start=0.06)
-    "Eco BP: heat exchange fouling coefficient";
-
-  parameter Real K_HP_DownComer(fixed=false,start=720.183)
-    "HP: Friction pressure loss coefficient";
-  parameter Real K_IP_DownComer(fixed=false,start=1090.9)
-    "MP: Friction pressure loss coefficient";
-  parameter Real K_Dp_HP_2(fixed=false,start=10.)
-    "SMPin: Friction pressure loss coefficient";
-
-  //parameter Real K_PerteChargeZero2(fixed=true,start=1e-4)
-  //  "TurbineMP out: Friction pressure loss coefficient";
-  parameter Real K_Dp_HP_IP(fixed=false,start=1.)
-    "Outlet THP: Friction pressure loss coefficient";
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
-    "Maximum CV input Turbine HP ";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
-    "Maximum CV input Turbine MP ";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum HP_Drum(
-    L=16.27,
-    Vertical=false,
-    hl(fixed=false, start=1474422.14552527),
-    hv(fixed=false, start=2666558.75582585),
-    Vv(fixed=false),
-    R=1.05,
-    xmv(fixed=false),
-    P(fixed=false, start=12703151.2960688),
-    zl(start=1.05, fixed=true),
-    Mp=5000,
-    Kpa=5,
-    Kvl=1000,
-    Pfond(start=12703151.3),
-    Tp(start=596.924860294475),
-    Cv(Q(fixed=true, start=76.58)))
-                     annotation (Placement(transformation(extent={{38,10},{-2,
-            50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_FeedValve(
-    Cvmax=CvmaxValveAHP,
-    C1(P(start=12721657.0), h_vol(start=1396865.59043578)),
-    h(start=1398000),
-    Cv(start=178),
-    Pm(start=13050700))
-                 annotation (Placement(transformation(extent={{78,46},{58,66}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    HP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_SteamValve(
-    mode=0,
-    C2(h_vol(start=2666558.75582585),P(start=12700000.0)),
-    h(start=2674000),
-    Cv(start=23914.7),
-    Pm(start=12721657.16928),
-    C1(P(start=132.1e5, fixed=true)),
-    Cvmax=CvmaxValveVHP)
-                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_DownComer(
-    z2=0,
-    mode=1,
-    Q(start=150, fixed=true),
-    z1=10.83,
-    K=K_HP_DownComer,
-    C2(P(start=12768600.0)),
-    h(start=1474422.14552527),
-    Pm(start=12704000))
-            annotation (Placement(transformation(
-        origin={28,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,     h(start=1474422.14552527))
-                                           annotation (Placement(transformation(
-          extent={{8,-100},{-12,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Evaporator(
-    Dint=32.8e-3,
-    Ntubes=1476,
-    L=20.7,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
-      Tp(start={607.668721736158,605.187884376142,603.825778846274}),
-      Tp1(start={606.357,604.602,603.578})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=10.83,
-      option_temperature=2,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={5.74e7,2.67e7,1.24e7}),
-      Tp1(start={606.2,604.6,603.7}),
-      h(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134,
-            1459929.875}),
-      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
-      P(start={12758125,12740000,12734000,12730000,12726787})),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.092,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.86442072,
-      p_rho=1.05,
-      Encras(start=0.24)=Fouling_EvHP,
-      K(fixed=false, start=407),      DeltaT(start={106,49,23}),
-      T(start={755.54821777344,673.68082608925,635.57157972092,618.19360351563}),
-      Tm(start={643.15,633.15,626.621}),
-      Tp(start={609.11670087771,605.86035558168,604.13687003529})))
-                          annotation (Placement(transformation(
-        origin={-14,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_4(
-    Ns=3,
-    L=20.726,
-    Dint=0.0266,
-    Ntubes=246,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-3.5e6,-2.63e6,-2e6}),
-      Tp(start={576.803345033827,581.933438017921,585.694098500999}),
-      Tp1(start={575.762,580.856,584.579})),
-    Cws1(P(start=13703700.0), h_vol(start=1306078.18827954)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      z2=0,
-      option_temperature=2,
-inertia=true,
-      dW1(start={3.5e6,2.63e6,2e6}),
-      Tp1(start={577.5,582.6,586.4}),
-      h(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578,
-            1398251.0}),
-      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
-      P(start={13301176,13320000,13338000,13357000,13374658})),
-    Cws2(h(fixed=false, start=1500e3)),
-    ExchangerFlueGasesMetal(
-      Dext=0.0318,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.39069779,
-      p_rho=1.06,
-      Encras(start=0.03)=Fouling_EHP4,
-      K(fixed=true, start=47.53),DeltaT(start={38,29,22}),
-      T(start={618.19360351563,612.7722894387,608.97249438439,606.41162109375}),
-      Tm(start={623.15,613.15,607.844}),
-      Tp(start={577.44979072627,582.41942947968,586.06092597683})))
-                          annotation (Placement(transformation(
-        origin={86,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_1(
-    Ns=3,
-    L=20.4,
-    Dint=0.0324,
-    Ntubes=246,
-    ExchangerWall(e=0.0028, lambda=37.61,
-    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
-      Tp(start={629.445777860324,651.664976699235,671.075818762815}),
-      Tp1(start={629,651,670.})),
-    Cws1(h_vol(start=2665000.0)),
-    Cws2(P(start=12720900.0), h_vol(start=2981170.0)),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=10.25056,
-      p_rho=1.04,
-      Encras(start=0.075)=Fouling_SHP,
-      K(fixed=false, start=34.71),      DeltaT(start={138,108,84}),
-      T(start={788.2431640625,774.65344332519,763.17487871399,755.54821777344}),
-      Tm(start={778.15,768.15,759.527}),
-      Tp(start={631.68675322573,653.38616970968,672.36458008039})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      option_temperature=2,
-      inertia=true,
-      dpfCorr=2,      dW1(start={9.8e6,7.7e6,5.9e6}),
-      Tp1(start={639.5,657,673}),
-      h(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983,
-            2973076.25}),
-      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
-      P(start={12723762,12723600,12723500,12720000,12719000})))
-         annotation (Placement(transformation(
-        origin={-64,-50},
-        extent={{-20,20},{20,-20}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_3(
-    Dint=26.6e-3,
-    Ntubes=1476,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
-      Tp(start={556.530623976228,563.226831750573,565.575075374951}),
-      Tp1(start={555.49,562.473,564.857})),
-    L=20.726,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.6e7,5.6e6,2.1e6}),
-      Tp1(start={558,565,567}),
-      h(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855,
-            1291418.875}),
-      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
-      P(start={13219333,13241000,13261000,13282000,13301176})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=12.451,
-      p_rho=1.08,
-      Encras(start=0.06)=Fouling_EHP3,
-      K(fixed=true, start=36.03),
-      St=5, DeltaT(start={34,12,4.4}),
-      T(start={602.67193603516,579.67183226637,571.50875350574,568.81030273438}),
-      Tm(start={593.15,583.15,571.919}),
-      Tp(start={557.01185690541,563.39937105652,565.63731055685})))      annotation (Placement(
-        transformation(
-        origin={206,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_2(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-5e6,-3e6,-2.e6}),
-      Tp(start={490.631370193221,498.229397165878,502.978053774656}),
-      Tp1(start={490,497.024,501.871})),
-    L=20.767,
-    Ntubes=1107,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={5e6,3e6,2.e6}),
-      Tp1(start={499,503,507}),
-      h(start={854494.5625,915007.018247822,957243.396653824,983786.364226731,
-            986348.9375}),
-      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
-      P(start={13129352,13152000,13175000,13197000,13219333})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=111e-3,
-      CSailettes=2.76134577,
-      p_rho=1.11,
-      Encras(start=0.11)=Fouling_EHP2,
-      K(fixed=true, start=65),
-      St=5, DeltaT(start={36,23,14}),
-      T(start={531.16070556641,523.74706132958,519.01561663699,516.31256103516}),
-      Tm(start={538.15,528.15,521.399}),
-      Tp(start={490.84070882241,498.36081646341,503.06064272486})))      annotation (Placement(
-        transformation(
-        origin={406,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_1(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-9.9999e6,-5e6,-2.4e6}),
-      Tp(start={458.958585923538,468.506814782426,473.132256983258}),
-      Tp1(start={458.001,467.576,472.607})),
-    L=20.726,
-    Ntubes=1107,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={9.9999e6,5e6,2.4e6}),
-      Tp1(start={467.4,476.5,480.9}),
-      h(start={618651.9375,752176.893518976,816707.727773953,847728.424287614,
-            854494.5625}),
-      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
-      dynamic_mass_balance=true,
-      P(start={13034956,13060000,13080000,13100000,13129352})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=8.30057632,
-      p_rho=1.13,
-      Encras(start=0.07)=Fouling_EHP1,
-      K(fixed=true, start=40.),
-      St=5,   DeltaT(start={41,20,10}),
-      T(start={509.31488037109,491.44087131458,484.15889910859,482.59533691406}),
-      Tm(start={503.15,498.15,494.131}),
-      Tp(start={459.37586976399,468.70800090382,473.22896941053})))      annotation (Placement(
-        transformation(
-        origin={526,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_2(
-    Ns=3,
-    L=20.4,
-    Dint=32e-3,
-    Ntubes=246,
-    ExchangerWall(e=3e-3, lambda=27,
-          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
-      Tp(start={714.604505161814,740.492493660215,759.200099714419}),
-      Tp1(start={710.485,734.082,752.527})),
-    Cws2(P(start=127113000.0), h_vol(start=3254970.0)),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.83,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={8.8e6,6.6e6,4.9e6}),
-      Tp1(start={714,735.6,752}),
-      h(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722,
-            3240813.5}),
-      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
-      P(start={12720371,12718000,12716000,12714000,12711007})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      CSailettes=10.2505424803872,
-      p_rho=1.02,
-      Encras(start=0.075)=Fouling_SHP,
-      K(fixed=false, start=34.74),
-      St=5,
-      DeltaT(start={124,93,70}),
-      T(start={850.64624023438,839.40882309811,830.36536707939,822.68170166016}),
-      Tm(start={843.15,833.15,825.24}),
-      Tp(start={717.48312916257,742.56566858011,760.69152533026})))      annotation (Placement(
-        transformation(
-        origin={-174,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_3(
-    Ns=3,
-    L=20.4,
-    Ntubes=246,
-    ExchangerWall(lambda=27,e=5e-3,
-    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
-      Tp(start={793.335674512128,811.477076678823,824.721389633254}),
-      Tp1(start={783.815,803.639,818.56})),
-    Dint=28e-3,
-    Cws2(h(fixed=true, start=3511e3)),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.726,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={6.3e6,4.7e6,3.6e6}),
-      Tp1(start={783.6,801.6,815}),
-      h(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987,
-            3433271.25}),
-      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
-      P(start={12711007,12704000,12697000,12689000,12681000})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      p_rho=1,
-      Encras(start=0.075)=Fouling_SHP,
-      CSailettes=6.59672846,
-      K(fixed=false, start=49.33),
-      St=5,
-      DeltaT(start={97,73,55}),
-      T(start={894.21850585938,885.5393240412,879.47464880089,874.32891845703}),
-      Tm(start={893.15,883.15,875.939}),
-      Tp(start={796.82789474964,814.05266276572,826.6253996051})))      annotation (Placement(
-        transformation(
-        origin={-294,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum IP_Drum(
-    L=16.27,
-    Vertical=false,
-    P0=27.29e5,
-    hl(fixed=false, start=978914.570821827),
-    hv(fixed=false, start=2799158.13966473),
-    Vv(fixed=false),
-    R=1.05,
-    P(fixed=false, start=28.3e5),
-    zl(start=1.05, fixed=true),
-    Kvl=0,
-    Kpa=5,
-    Mp=5000,
-    Cv(Q(fixed=true, start=10.9)),
-    Pfond(start=2732995.0),
-    Tp(start=500.955757665063))
-                     annotation (Placement(transformation(extent={{358,10},{320,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    IP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_FeedValve(
-      Cvmax=CvmaxValveAMP,
-    C1(P(start=2952995.0), h_vol(start=892414.570867188)),
-    h(start=944000),
-    Cv(start=28),
-    Pm(start=2945000))
-                 annotation (Placement(transformation(extent={{398,46},{378,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_SteamValve(
-    Pm(fixed=false, start=2731689.4244255),
-    C2(h_vol(start=2798000),P(start=27.3e5)),
-    h(fixed=false, start=2798000),
-    mode=0,
-    Cv(start=27829.4),
-    Cvmax=CvmaxValveVMP,
-    C1(P(start=28.3e5, fixed=true)))
-                 annotation (Placement(transformation(extent={{298,46},{278,66}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_Evaporator(
-    Dint=32.8e-3,
-    L=20.767,
-    Ntubes=738,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
-      Tp(start={504.957792851478,504.19488464586,503.59993822766}),
-      Tp1(start={504.427,503.806,503.304})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.83,
-      continuous_flow_reversal=true,
-      inertia=true,
-          dW1(start={9.7e7,7.6e6,5.8e6}),
-      Tp1(start={504.5,503.9,503.4}),
-      P(start={2773367.5,2754933.93610513,2745233.82043873,2738517.46232967,2733824.75}),
-      h(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464,980708.125}),
-      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=10.0676093,
-      p_rho=1.1,
-      Encras(start=0.08)=Fouling_EvMP,
-      K(fixed=false, start=46.9),
-      St=5,
-      DeltaT(start={53,41,32}),
-      T(start={565.24822998047,551.20973998682,539.98034586472,531.16070556641}),
-      Tm(start={553.15,543.15,536.901}),
-      Tp(start={505.45492567199,504.57970000924,503.89762940507})))              annotation (Placement(
-        transformation(
-        origin={306,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss IP_DownComer(
-    z2=0,
-    z1=10.83,
-    mode=1,
-    K=K_IP_DownComer,
-    Q(start=22, fixed=true),
-    Pm(start=2734000),
-    h(start=978914.570821827))
-            annotation (Placement(transformation(
-        origin={348,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
-    h(start=978914.570821827),
-    P(start=2834000))                      annotation (Placement(transformation(
-          extent={{328,-100},{308,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_Economizer(
-    ExchangerWall(e=2.6e-3, lambda=47,
-        dW1(start={-3e6,-1.4e6,-740379}),
-      Tp(start={457.584681885759,475.409334769727,486.332585528225}),
-      Tp1(start={456.76,474.926,485.122})),
-    L=20.726,
-    Ns=3,
-    Dint=26.6e-3,
-    Ntubes=246,
-    Cws1(h_vol(start=671235.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.767,
-      z2=0,
-      inertia=true,
-      dW1(start={3e6,1.4e6,740379}),
-      Tp1(start={474,491,499.9}),
-      h(start={565108.5,727745.440528479,829820.124314816,892414.570867187,
-            944505.4375}),
-      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
-      P(start={3124229.75,3148000,3172000,3195000,3216977.75})),
-    Cws2(h(fixed=false, start=990e3)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      CSailettes=7.16188651,
-      p_rho=1.12,
-      Encras(start=0.09)=Fouling_EMP,
-      K(fixed=true, start=50),
-      St=5,
-      DeltaT(start={45,24,13}),
-      T(start={516.31256103516,511.25046295073,508.31162431247,509.31488037109}),
-      Tm(start={533.15,523.15,514.647}),
-      Tp(start={458.18343678065,475.77644311925,486.55770446184})))              annotation (Placement(
-        transformation(
-        origin={466,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_1(
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.3e6,-0.80263e6,
-                                -501864}),
-      Tp(start={557.102699668877,574.070651369638,584.64928514972}),
-      Tp1(start={556.102699668877,573.070651369638,583.64928514972})),
-    L=20.726,
-    Ns=3,
-    Dint=32.8e-3,
-    Ntubes=123,
-    Cws1(h_vol(start=2800000.0),P(start=2.73467e+06)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      CSailettes=14.46509765,
-      p_rho=1.07,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=22.09),
-      St=5,
-      DeltaT(start={45,30,19}),
-      T(start={606.41162109375,604.22099235915,603.06310204059,602.67193603516}),
-      Tm(start={623.15,613.15,603.024}),
-      Tp(start={557.49575399383,574.31250418519,584.79699207547})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.77,
-      dpfCorr=2,
-      inertia=false,
-      dW1(start={1.3e6,0.80263e6,501864}),
-      Tp1(start={557,573,583}),
-      h(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156,
-            3040562.25}),
-      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
-      P(start={2731326.25,2729591.6901521,2728654.3204706,2727686.1714029,
-            2726700})))     annotation (Placement(transformation(
-        origin={146,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB VolumeLP(
-    Ce1(h(start=3091610.0)),
-    h(start=3042573.51976705),
-    P(start=2726000))
-    annotation (Placement(transformation(
-        origin={146,-110},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_2(
-    Ns=3,
-    L=20.4,
-    Dint=39.3e-3,
-    Ntubes=369,
-    ExchangerWall(e=2.6e-3, lambda=36.86,
-    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
-      Tp(start={689.66516778766,716.376344387713,734.591437191304}),
-      Tp1(start={687.7,713.5,731.5})),
-    Cws1(P(start=2576650.0), h_vol(start=3078800.0)),
-    Cws2(P(start=2558540.0), h_vol(start=3342910.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={1.15e7,7.9e6,5.5e6}),
-      Tp1(start={685.6,711,729}),
-      h(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389,
-            3321940.75}),
-      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
-      P(start={2575582.5,2572000,2568000,2563000,2558239})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=92e-3,
-      CSailettes=5.814209831,
-      p_rho=1.03,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=45.22),
-      St=5,
-      DeltaT(start={125,86,60}),
-      T(start={822.68170166016,807.90772072705,797.00284433443,788.2431640625}),
-      Tm(start={813.15,803.15,792.527}),
-      Tp(start={690.93545553661,717.24269857866,735.18209370035})))              annotation (Placement(
-        transformation(
-        origin={-114,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_3(
-    Ns=3,
-    L=20.4,
-    Ntubes=369,
-    Dint=45.6e-3,
-    ExchangerWall(e=2.6e-3, lambda=27,
-    dW1(start={-8e6,-5.5e6,-3.8e6}),
-      Tp(start={788.901616786331,805.674094596818,817.083010473709}),
-      Tp1(start={786.717,804.102,815.901})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={8e6,5.5e6,3.8e6}),
-      Tp1(start={782,798.7,810}),
-      h(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916,
-            3517975.25}),
-      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
-      P(start={2558239,2556000,2554000,2552000,2548600})),
-    Cws2(h(fixed=true, start=3606e3)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=92e-3,
-      Dext=50.8e-3,
-      p_rho=1.01,
-      CSailettes=5.695842178,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=43.23),
-      St=5,
-      DeltaT(start={82,56,38}),
-      T(start={874.32891845703,864.2444076086,856.92248545484,850.64624023438}),
-      Tm(start={873.15,863.15,853.059}),
-      Tp(start={789.92521486539,806.37044583028,817.55662835373})))              annotation (Placement(
-        transformation(
-        origin={-234,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum LP_Drum(
-    Vertical=false,
-    P0=5e5,
-    Vv(fixed=false),
-    L=8,
-    hl(fixed=false, start=549249.519022482),
-    hv(fixed=false, start=2709858.97470349),
-    R=2,
-    zl(start=1.75, fixed=true),
-    Kvl=0,
-    Kpa=5,
-    Mp=5000,
-    P(fixed=false, start=520000),
-    Cv(Q(fixed=true, start=9.23)),
-    Pfond(start=564775.0),
-    Tp(start=406.411032587651))
-                     annotation (Placement(transformation(extent={{618,10},{578,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    LP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_SteamValve(
-    p_rho=3, Cvmax=CvmaxValveVBP,
-    C2(P(start=503542.0), h_vol(start=2709858.97470349)),
-    h(start=2685000),
-    Cv(start=7555),
-    Pm(start=498000))
-                 annotation (Placement(transformation(extent={{558,46},{538,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_FeedValve(
-    C1(h_vol(start=511900.0)),
-    h(fixed=false, start=509000),
-    Pm(fixed=false, start=5.0698e5),
-    Cvmax=250,
-    Cv(start=142.5),
-    C2(P(fixed=true, start=5.2e5)))
-                 annotation (Placement(transformation(extent={{650,46},{630,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss LP_DownComer(
-    z2=0,
-    z1=10.767,
-    K=32766,
-    mode=1,
-    Q(start=20, fixed=false),
-    pro(d(start=934.452746556487)),
-    Pm(start=564000),
-    h(start=549249.519022482))
-            annotation (Placement(transformation(
-        origin={610,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=549249.519022482),
-                                                                       mode=1,
-    V=5,
-    P(start=523000))                                   annotation (Placement(
-        transformation(extent={{592,-100},{572,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_Evaporator(
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
-      Tp(start={433.127441964236,432.076030201586,431.28112439162}),
-      Tp1(start={432.956,431.127,430.61})),
-    L=20.726,
-    Ntubes=984,
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={1.24e7,8.5e6,5.8e6}),
-      Tp1(start={442.5,441.7,441}),
-      h(start={550075.0,765243.011613326,912673.256542569,1013555.73710231,
-            550075.0}),
-      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
-      Q(start={49.787311368631,49.787311368631,49.787311368631,49.787311368631}),
-      P(start={522583.375,488000,487000,486000,485588.46875})),
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=138e-3,
-      CSailettes=11.07985,
-      p_rho=1.14,
-      Encras(start=0.09)=Fouling_EvBP,
-      K(fixed=false, start=46.7),
-      St=5,
-      DeltaT(start={45,31,21}),
-      T(start={482.59533691406,464.53146753441,453.496360082,442.5893859863}),
-      Tm(start={483.15,478.15,472.098}),
-      Tp(start={433.5360639938,432.3549425205,431.471976456})))              annotation (Placement(
-        transformation(
-        origin={566,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_LP_Drum(k=0.25)
-    annotation (Placement(transformation(extent={{742,32},{728,44}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve(
-      Pm(start=5.0698e5), mode=1,
-    C1(h_vol(start=549249.519022482)),
-    h(start=550000),
-    Cv(start=308.931))
-                 annotation (Placement(transformation(extent={{710,12},{730,32}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_SuperHeater(
-    Ns=3,
-    L=20.726,
-    Dint=39.3e-3,
-    Ntubes=123,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.1e6,-782901,-559798}),
-      Tp(start={489.606851797367,513.610203520748,530.080624448955}),
-      Tp1(start={488.486,512.197,529.53})),
-    Cws1(h_vol(start=2642240.0),P(start=484264)),
-    Cws2(h_vol(start=2979330.0)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=222.1e-3,
-      K(fixed=true, start=30.46),
-      CSailettes=3.25763059984175,
-      p_rho=1.09,
-      Encras(start=0.05)=Fouling_SBP,
-      St=5,
-      DeltaT(start={92,66,47}),
-      T(start={568.81030273438,567.21003420557,566.29303411055,565.24822998047}),
-      Tm(start={583.15,573.15,568.703}),
-      Tp(start={489.84170505864,513.76963980951,530.18834052149})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      rugosrel=1e-5,
-      z1=10.767,
-      inertia=false,
-      dpfCorr=0.25,
-      dW1(start={1.1e6,782901,559798}),
-      Tp1(start={485,511,529}),
-      h(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762,
-            2914520.25}),
-      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
-      P(start={510622.6875,505757.57962259,504477.27858572,503172.36919354,501850})))      annotation (Placement(
-        transformation(
-        origin={266,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkP SinkP_Gas(P0=104400)
-    annotation (Placement(transformation(
-        origin={722,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_Economizer(
-    Ns=3,
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
-      Tp(start={398.142807363473,393.825926964772,392.943738968771}),
-      Tp1(start={397.622,392.348,391.516})),
-    Ntubes=3444,
-    L=20.726,
-    Cws1(h_vol(start=195526.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      inertia=true,
-      dpfCorr=0.5,
-      dW1(start={2.45e7,5.5e6,1.17e6}),
-      Tp1(start={409,404.7,404}),
-      h(start={194584.515625,462556.370989432,494648.45288738,501287.069880104,
-            509237.875}),
-      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
-      P(start={1540571.25,1500000,1480000,1450000,1429595.375})),
-    Cws2(h(fixed=false, start=500e3)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=92e-3,
-      CSailettes=11.673758598919,
-      p_rho=1.15,
-      Encras(start=0.06)=Fouling_EBP,
-      K(fixed=true, start=30),
-      St=5,
-      DeltaT(start={23.5,5.3,1.1}),
-      T(start={442.5893859863,403.9873508455,395.0465605839,395.464630127}),
-      Tm(start={423.15,418.15,414.742}),
-      Tp(start={398.4437772187,393.8897987349,392.9569515805})))              annotation (Placement(
-        transformation(
-        origin={680,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine HP_Turbine(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.88057),
-    eta_is_min=0.75,
-    Cst(start=8182844.56002535)=
-        CstHP,
-    Pe(fixed=true, start=125.20e5),
-    Ps(fixed=false, start=2726700),
-    eta_is_nom=EtaIsNomHP,
-    Cs(h(fixed=true, start=3106e3)),
-    pros(d(start=10.0)),
-    Hrs(start=3046260),
-    Qmax=151,
-    a=-1.20211,
-    b=2.32571,
-    c=-0.25) annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
-          rotation=0)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine IP_Turbine(
-    W_fric=1,
-    Ps(fixed=false, start=476800),
-    eta_stato=1,
-    eta_is(start=0.9625),
-    eta_is_min=0.75,
-    Cst(start=256335.364995961)=
-        CstMP,
-    Pe(fixed=true, start=25.13e5),
-    pros(d(start=30.0)),
-    Hrs(start=3029780),
-    Cs(h(fixed=false, start=2990e3)),
-    eta_is_nom=0.96,
-    b=2.4957,
-    Qmax=170,
-    a=-1.2728,
-    c=-0.26202)   annotation (Placement(transformation(extent={{318,-250},{358,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP1(
-    h(start=2997231.36734756),
-    P(start=476799.99999954),
-    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
-        origin={418,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine LP_Turbine(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9538),
-    eta_is_min=0.75,
-    Cst(start=11944.9445735985)=
-        CstBP,
-    Hrs(start=2401030),
-    Pe(fixed=true, start=4.77e5),
-        Ps(start=10053),
-    Cs(h(fixed=true, start=2399.9e3)),
-    eta_is_nom=EtaIsNomBP,
-    Qmax=192,
-    a=-1.22335,
-    b=2.2957,
-    c=-0.14)   annotation (Placement(transformation(extent={{576,-250},{616,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-292,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-232,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(Cs(h(start=3000000)),
-                                                    alpha=0.5)
-    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
-    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    Vf0=0.15,
-    steady_state=false,
-    yNiveau(signal(start=1.5)),
-    Cse(h(start=128076)),
-    P0=6100,
-    P(fixed=false, start=6136),
-    Pfond(start=6200)) annotation (Placement(transformation(extent={{639,-384},{
-            719,-304}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
-    h0=113.38e3, Q0=17224)       annotation (Placement(transformation(extent={{
-            572,-377},{620,-329}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_In(
-    K=1e-4,
-    h(start=2400000),
-    C1(h_vol(start=2400000), h(start=2400000)),
-    Q(start=190.55),
-    Pm(start=10026)) annotation (Placement(transformation(extent={{640,-240},{660,
-            -220}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
-    Ce3(h(start=163768.700887002)),
-    h(start=163768.700887002),
-    P(start=1540500))
-    annotation (Placement(transformation(
-        origin={902,-318},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out2(
-    K=1e-4,
-    mode=1,
-    pro(d(start=993.470128235971)),
-    Pm(start=1540000)) annotation (Placement(transformation(
-        origin={902,-270},
-        extent={{12,-12},{-12,12}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
-    h(start=549249.519022482),
-    P(start=322430))                       annotation (Placement(transformation(
-          extent={{742,6},{762,26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump IP_Pump(
-    a3=350,
-    mode=1,
-    Q(fixed=false, start=10.9),
-    a1=-244551,
-    C1(h_vol(start=576000.0)),
-    C2(h_vol(start=561000.0)),
-    h(start=571000.0),
-    hn(start=317),
-    Qv(start=0.0207237016869104),
-    pro(d(start=930.0)),
-    Pm(start=1725850))
-            annotation (Placement(transformation(extent={{804,6},{824,26}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump HP_Pump(
-    a3=1600,
-    a1=-28056.2,
-    Q(fixed=false),
-    mode=1,
-    C1(h_vol(start=561000.0)),
-    C2(h_vol(start=630000.0)),
-    h(start=630000),
-    hn(start=1413),
-    Qv(start=0.0810383142105344),
-    pro(d(start=929.0)),
-    Pm(start=6774000))  annotation (Placement(transformation(extent={{804,-46},
-            {824,-26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
-                                                    alpha=0.5,
-    h(start=194585),
-    P(start=1540500),
-    Cs(h(start=194585)))
-    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={266,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_LP_Turbine(
-    z2=0,
-    mode=0,
-    z1=0,
-    h(start=3000000),
-    C1(
-      h_vol(start=3000000),
-      h(start=3000000),
-      P(fixed=false, start=5.0185e5)),
-    K=1e-4,
-    Pm(start=490000)) annotation (Placement(transformation(
-        origin={344,-278},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_HP_Pump(
-    K=1e-4,
-    mode=1,
-    C2(h_vol(start=599600)),
-    Pm(start=372718)) annotation (Placement(transformation(
-        origin={780,-36},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_IP_Pump(
-    K=1e-4,
-    mode=1,
-    C2(h_vol(start=599600)),
-    Pm(start=372718)) annotation (Placement(transformation(
-        origin={780,16},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
-    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out(
-    K=1e-4,
-    mode=1,
-    C1(h_vol(start=153206.462779274)),
-    C2(h_vol(start=153206.462779274)),
-    pro(d(start=993.441492649513)),
-    Pm(start=6200)) annotation (Placement(transformation(extent={{702,-446},{722,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump LP_Pump(
-    Qv(start=0.1934),
-    mode=1,
-    a3=400,
-    C2(P(fixed=false, start=16.7e5), h_vol(start=194669.0)),
-    h(start=193000),
-    hn(start=183),
-    a1=LP_Pump_a1,
-    Q(start=193.43, fixed=false),
-    Pm(start=1103065, fixed=false)) annotation (Placement(transformation(extent=
-           {{742,-446},{762,-426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out1(
-    K=1e-4,
-    mode=1,
-    pro(d(start=994.045785814739)),
-    C1(h_vol(start=194585), h(start=194585)),
-    Pm(start=1546000)) annotation (Placement(transformation(extent={{840,-446},{
-            860,-426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ExtractionValve(
-    mode=1,
-    Cvmax=2500,
-    h(start=195000),
-    Cv(start=2000),
-    C1(h_vol(start=195000)),
-    C2(h_vol(start=195000)),
-    Pm(start=1549000)) annotation (Placement(transformation(extent={{802,-440},{
-            822,-420}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamHP(C1(h_vol(start=2674000),
-        h(start=2674000)))
-    annotation (Placement(transformation(
-        origin={-58,8},
-        extent={{-6,6},{6,-6}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterHP(C2(h_vol(start=1398000),
-        h(start=1398000)))
-    annotation (Placement(transformation(
-        origin={91.5,32},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterMP(C2(h_vol(start=944000),
-        h(start=944000)))
-    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamMP(C1(h_vol(start=2798000),
-        h(start=2798000)),C2(h_vol(start=2798000)))
-    annotation (Placement(transformation(
-        origin={236,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamBP(C2(h_vol(start=2685000),
-        h(start=2685000)))
-    annotation (Placement(transformation(
-        origin={514,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP(C2(h_vol(start=550000),
-        h(start=550000)))
-    annotation (Placement(transformation(
-        origin={663.5,34},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP_Out(C2(h_vol(start=550000),
-        h(start=550000))) annotation (Placement(transformation(extent={{687,15},
-            {700,27}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterCondenser(C2(h_vol(start=
-           194585), h(start=194585))) annotation (Placement(transformation(
-        origin={685.5,-412},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamCondenser(C2(h_vol(start=
-           2401000), h(start=2401000))) annotation (Placement(transformation(
-        origin={684.5,-264},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_2(
-    C1(
-      P(fixed=true, start=27.267e5),
-      h_vol(start=3046000),
-      h(start=3046000)),
-    K=K_Dp_HP_2,
-    Pm(start=2651000)) annotation (Placement(transformation(extent={{114,-120},{
-            94,-100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_Turbine_Valve(
-    mode=0,
-    h(fixed=false, start=3433000),
-    Cv(start=10875),
-    Pm(fixed=false, start=12550000),
-    C1(P(fixed=true, start=126.81e5)),
-    Cvmax=Cvmax_THP)
-                 annotation (Placement(transformation(extent={{-124,-234},{-104,
-            -214}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauHP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500,
-    minval=0.007) annotation (Placement(transformation(extent={{-40,106},{-20,
-            126}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauMP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500) annotation (Placement(transformation(extent={{262,106},{282,126}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauBP(                                                              k=1.75)
-    annotation (Placement(transformation(extent={{470,114},{504,132}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
-    add(k1=-1, k2=+1),
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauCondenseur1(                                 k=1.5)
-    annotation (Placement(transformation(extent={{704,-246},{740,-230}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-      add(k1=+1, k2=-1)) annotation (Placement(transformation(extent={{758,-282},
-            {778,-262}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneHP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
-            -138,-142}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp(
-    Initialvalue=1400,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=1300)
-                   annotation (Placement(transformation(extent={{944,-16},{906,
-            16}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP(
-    Initialvalue=1400,
-    Starttime=2000,
-    Duration=1000,
-    Finalvalue=700)
-                   annotation (Placement(transformation(extent={{945,-82},{907,
-            -50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingBP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{945,-458},{907,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
-    mode=1,
-    V=1,
-    h0=988332,
-    h(start=988332),
-    P0=70.1e5,
-    P(start=13129000),
-    dynamic_mass_balance=true)            annotation (Placement(transformation(
-          extent={{456,-98},{436,-78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
-    mode=1,
-    V=1,
-    h0=983786,
-    h(start=983786),
-    P0=70.0e5,
-    P(start=13219000),
-    dynamic_mass_balance=true)            annotation (Placement(transformation(
-          extent={{252,-20},{232,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve1(
-                          mode=1,
-    Cvmax=308.931,
-    h(start=618600),
-    Cv(start=308.931),
-    C1(h_vol(start=618600)),
-    Pm(start=13130000))
-                 annotation (Placement(transformation(extent={{754,-98},{730,
-            -122}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve2(
-      Pm(start=3126000), mode=1,
-    Q(start=10.9, fixed=false),
-    h(start=565000),
-    C1(h_vol(start=565000)),
-    Cv(start=308.931),
-    Cvmax=308.931)
-                 annotation (Placement(transformation(extent={{804,-138},{780,
-            -162}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp1(
-    Initialvalue=0.8,
-    Duration=800,
-    Starttime=2000,
-    Finalvalue=0.01) annotation (Placement(transformation(extent={{946,-150},{
-            908,-118}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP1(
-    Initialvalue=0.8,
-    Duration=800,
-    Starttime=2000,
-    Finalvalue=0.01) annotation (Placement(transformation(extent={{946,-194},{
-            908,-162}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
-    P0=127e5,
-    h0=3e6,
-    P(start=127e5),
-    h(start=3450835.48993987),
-    dynamic_mass_balance=true)        annotation (Placement(transformation(
-        origin={-52,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP(
-    h0=3523910,
-    h(start=3523910),
-    dynamic_mass_balance=true,
-    P0=2400000,
-    P(start=24e5))                        annotation (Placement(transformation(
-        origin={-50,-314},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_Turbine_Valve(
-    h(fixed=false, start=3518000),
-    mode=0,
-    Pm(fixed=false, start=2547000),
-    Cv(start=3.312e6),
-    C1(P(fixed=true, start=25.486e5)),
-    Cvmax=Cvmax_TMP)
-                 annotation (Placement(transformation(extent={{-124,-318},{-104,
-            -298}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneIP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
-            -138,-226}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
-    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
-    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
-    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
-
-  WaterSteam.Volumes.VolumeA SeparateurMP(h(start=3106000), P(start=27.26e+005),
-    rho(start=10))
-    annotation (Placement(transformation(
-        origin={74,-200},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_1(
-    K=1e-4,
-    pro(d(start=10)),
-    h(start=3106000),
-    C1(
-      P(start=27.26e+005),
-      h_vol(start=3106000),
-      Q(start=153),
-      h(start=3106000)),
-    C2(
-      P(start=27.259e+005),
-      h_vol(start=3106000),
-      Q(start=153),
-      h(start=3106000)),
-    Pm(start=2726000)) annotation (Placement(transformation(extent={{88,-182},{102,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_IP_PressureLoss(
-    Q(fixed=true, start=3.09),
-    continuous_flow_reversal=true,
-    h(start=3106000),
-    C1(
-      P(start=27.26e+005),
-      h_vol(start=3106000),
-      h(start=3106000),
-      Q(start=3.09)),
-    C2(
-      P(start=27.259e+005),
-      h_vol(start=3106000),
-      h(start=3106000),
-      Q(start=3.09)),
-    K=K_Dp_HP_IP,
-    Pm(start=2726000)) annotation (Placement(transformation(extent={{134,-210},{
-            154,-190}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe Q_water(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=21000,
-    Finalvalue=15000)
-                   annotation (Placement(transformation(extent={{555,-364},{575,
-            -344}}, rotation=0)));
-  FlueGases.BoundaryConditions.SourceQ SourceFumees(
-    Xso2=0,
-    T0=893.75,
-    Q0=606.94,
-    Xco2=0.0604033,
-    Xh2o=0.076375,
-    Xo2=0.111559)
-    annotation (Placement(transformation(extent={{-451,-92},{-349,-8}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps FuelMassFlowRate(Table=[0,
-        606.941; 10,606.941; 600,50; 650,50]) annotation (Placement(
-        transformation(extent={{-505,-26},{-435,48}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps GasTemperature(Table=[0,
-        893.76; 10,893.76; 600,423.16; 650,423.16]) annotation (Placement(
-        transformation(extent={{-505,-164},{-435,-90}}, rotation=0)));
-equation
-  connect(HP_SuperHeater_3.Cws1, HP_SuperHeater_2.Cws2)
-    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
-        color={255,0,0}));
-  connect(HP_SuperHeater_2.Cws1, HP_SuperHeater_1.Cws2)
-    annotation (Line(points={{-174,-70},{-174,-90},{-64,-90},{-64,-70}}, color=
-          {255,0,0}));
-  connect(HP_SteamValve_Constante.y, HP_SteamValve.Ouv)
-    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
-  connect(HP_SteamValve.C1, HP_Drum.Cv)
-    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
-  connect(HP_DownComer.C1, HP_Drum.Cd)
-    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={0,0,0}));
-  connect(HP_Drum.Cm, HP_Evaporator.Cws2)
-    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}, color={0,0,0}));
-  connect(VolumeEvapHP.Cs, HP_Evaporator.Cws1)
-    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={0,0,0}));
-  connect(VolumeEvapHP.Ce1, HP_DownComer.C2)
-                                      annotation (Line(points={{8,-90},{18,-90}},
-        color={0,0,0}));
-  connect(HP_Economizer_4.Cws1, HP_Economizer_3.Cws2)
-    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
-  connect(IP_Drum.Cm, IP_Evaporator.Cws2)
-    annotation (Line(points={{320,10},{306,10},{306,-30}}, color={0,0,0}));
-  connect(IP_Evaporator.Cws1, VolumeEvapMP.Cs)
-    annotation (Line(points={{306,-70},{306,-90},{308,-90}}, color={0,0,0}));
-  connect(VolumeEvapMP.Ce1, IP_DownComer.C2)
-    annotation (Line(points={{328,-90},{338,-90}}, color={0,0,0}));
-  connect(IP_SteamValve_Constante.y, IP_SteamValve.Ouv)
-    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
-  connect(HP_SuperHeater_1.Cfg2, HP_Evaporator.Cfg1)        annotation (Line(
-      points={{-54,-50},{-54,-50},{-24,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Evaporator.Cfg2, HP_Economizer_4.Cfg1)        annotation (Line(
-      points={{-4,-50},{96,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_4.Cfg2, IP_SuperHeater_1.Cfg1)          annotation (Line(
-      points={{76,-50},{136,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_1.Cfg2, HP_Economizer_3.Cfg1)           annotation (Line(
-      points={{156,-50},{196,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_Evaporator.Cfg2, HP_Economizer_2.Cfg1)           annotation (Line(
-      points={{316,-50},{396,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_2.Cfg2, IP_Economizer.Cfg1)           annotation (Line(
-      points={{416,-50},{456,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_Economizer.Cfg2, HP_Economizer_1.Cfg1)           annotation (Line(
-      points={{476,-50},{516,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_DownComer.C1, IP_Drum.Cd)
-    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={0,0,
-          0}));
-  connect(IP_SuperHeater_2.Cfg2, HP_SuperHeater_1.Cfg1)          annotation (Line(
-      points={{-104,-50},{-74,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_2.Cfg1, HP_SuperHeater_2.Cfg2)           annotation (Line(
-      points={{-124,-50},{-164,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_3.Cfg2, HP_SuperHeater_2.Cfg1)           annotation (Line(
-      points={{-224,-50},{-184,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_SuperHeater_3.Cfg2, IP_SuperHeater_3.Cfg1)           annotation (Line(
-      points={{-284,-50},{-244,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_3.Cws1,IP_SuperHeater_2. Cws2)
-    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
-          {255,0,0}));
-  connect(IP_SuperHeater_1.Cws2, VolumeLP.Ce2) annotation (Line(
-      points={{146,-70},{146,-100}},
-      color={255,0,0},
-      pattern=LinePattern.None));
-  connect(LP_SteamValve.C1, LP_Drum.Cv)
-    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
-  connect(LP_Evaporator.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
-          -70},{566,-90},{572,-90}}, color={0,0,0}));
-  connect(VolumeEvapBP.Ce1, LP_DownComer.C2)
-                                        annotation (Line(points={{592,-90},{600,
-          -90}}, color={0,0,0}));
-  connect(LP_Drum.Cd, LP_DownComer.C1) annotation (Line(points={{618,10},{628,
-          10},{628,-90},{620,-90}}, color={0,0,0}));
-  connect(LP_Economizer.Cfg2, SinkP_Gas.C)     annotation (Line(
-      points={{690,-50},{712.2,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_3.Cfg2, LP_SuperHeater.Cfg1)  annotation (Line(
-      points={{216,-50},{256,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_SuperHeater.Cfg2, IP_Evaporator.Cfg1)  annotation (Line(
-      points={{276,-50},{296,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_1.Cfg2, LP_Evaporator.Cfg1) annotation (Line(
-      points={{536,-50},{556,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_Evaporator.Cfg2, LP_Economizer.Cfg1) annotation (Line(
-      points={{576,-50},{670,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_Drum.Cm, LP_Evaporator.Cws2)
-    annotation (Line(points={{578,10},{566,10},{566,-30}}, color={0,0,0}));
-  connect(IP_SteamValve.C1, IP_Drum.Cv)   annotation (Line(points={{298,50},{
-          320,50}}, color={255,0,0}));
-  connect(HPIP_FeedValve.Ouv, constante_LP_Drum.y)
-    annotation (Line(points={{720,33},{720,38},{727.3,38}}));
-  connect(HP_SuperHeater_3.Cws2, DoubleDebitHP.Ce)
-    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
-        color={255,0,0}));
-  connect(IP_SuperHeater_3.Cws2, DoubleDebitMP.Ce)
-    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
-        color={255,0,0}));
-  connect(VolumeCond1.Cs, Dp_Cond_Out2.C1)
-    annotation (Line(points={{902,-308},{902,-282}}, color={0,0,255}));
-  connect(HPIP_FeedValve.C2, VolumeAlimMPHP.Ce1)
-                                               annotation (Line(points={{730,16},
-          {742,16}}, color={0,0,255}));
-  connect(LP_SuperHeater.Cws2, DoubleDebitBP.Ce)
-    annotation (Line(points={{266,-70},{266,-90}}, color={255,0,0}));
-  connect(DP_IP_Pump.C2, IP_Pump.C1)
-    annotation (Line(points={{790,16},{798,15},{804,16}}, color={0,0,255}));
-  connect(VolumeAlimMPHP.Cs1, DP_IP_Pump.C1) annotation (Line(points={{762,16},{
-          766,15},{766,16},{770,16}}, color={0,0,255}));
-  connect(VolumeAlimMPHP.Cs2, DP_HP_Pump.C1)
-    annotation (Line(points={{752,6},{752,-36},{770,-36}}, color={0,0,255}));
-  connect(DP_HP_Pump.C2, HP_Pump.C1)
-    annotation (Line(points={{790,-36},{804,-36}}, color={0,0,255}));
-  connect(VolumeIP1.Ce2, Dp_LP_Turbine.C2) annotation (Line(points={{418,-239},{
-          418,-278},{354,-278}}, color={255,0,0}));
-  connect(Dp_Cond_Out.C2, LP_Pump.C1)
-    annotation (Line(points={{722,-436},{742,-436}}, color={0,0,255}));
-  connect(ExtractionValve.C2, Dp_Cond_Out1.C1)
-    annotation (Line(points={{822,-436},{840,-436}}, color={0,0,255}));
-  connect(HP_FeedValve.C1, SensorQ_WaterHP.C2)
-    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
-  connect(HP_SteamValve.C2, SensorQ_SteamHP.C1) annotation (Line(points={{
-          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
-  connect(SensorQ_SteamHP.C2, HP_SuperHeater_1.Cws1) annotation (Line(points={{-53.2,
-          1.88},{-53.2,-3.06},{-64,-3.06},{-64,-30}},        color={255,0,0}));
-  connect(IP_FeedValve.C1, SensorQ_WaterMP.C2)
-    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
-  connect(SensorQ_SteamMP.C1, IP_SteamValve.C2) annotation (Line(points={{
-          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
-  connect(SensorQ_SteamMP.C2, IP_SuperHeater_1.Cws1) annotation (Line(points={
-          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
-  connect(SensorQ_SteamBP.C2, LP_SuperHeater.Cws1) annotation (Line(points={{
-          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
-  connect(SensorQ_SteamBP.C1, LP_SteamValve.C2) annotation (Line(points={{
-          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
-  connect(SensorQ_WaterBP.C2, LP_FeedValve.C1) annotation (Line(
-        points={{658.3,40.12},{658.3,50},{650,50}}, color={0,0,255}));
-  connect(SensorQ_WaterBP_Out.C2, HPIP_FeedValve.C1) annotation (Line(points={{700.13,
-          16.2},{705.065,16.2},{705.065,16},{710,16}}, color={0,0,255}));
-  connect(SensorQ_WaterCondenser.C2, Dp_Cond_Out.C1) annotation (Line(points={{680.3,
-          -422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
-  connect(Dp_Cond_In.C2, SensorQ_SteamCondenser.C1) annotation (Line(points={{660,
-          -230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
-  connect(VolumeLP.Ce1, MoitieDebitHP.Cs)
-    annotation (Line(points={{146,-120},{146,-170},{134,-170}}, color={255,0,0}));
-  connect(Dp_Cond_Out1.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,-436},
-          {862,-436},{862,-318},{872,-318}}, color={0,0,255}));
-  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
-          {892,-318}}, color={0,0,255}));
-  connect(IP_SuperHeater_2.Cws1, HP_PressureLoss_2.C2) annotation (Line(points={{-114,-70},
-          {-114,-110},{94,-110}}, color={255,0,0}));
-  connect(HP_PressureLoss_2.C1, VolumeLP.Cs2)
-    annotation (Line(points={{114,-110},{136.2,-110}}, color={255,0,0}));
-  connect(DoubleDebitHP.Cs, HP_Turbine_Valve.C1) annotation (Line(points=
-          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
-  connect(DoubleDebitBP.Cs, Dp_LP_Turbine.C1) annotation (Line(points={{266,-110},
-          {266,-278},{334,-278}}, color={255,0,0}));
-  connect(LP_Pump.C2, ExtractionValve.C1)
-    annotation (Line(points={{762,-436},{802,-436}}, color={0,0,255}));
-  connect(HP_Drum.yLevel,regulation_Niveau_HP. MesureNiveauEau)
-    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
-  connect(regulation_Niveau_HP.SortieReelle1, HP_FeedValve.Ouv)
-    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
-  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
-    annotation (Line(
-      points={{208.7,122},{234,122},{234,110},{261.5,110}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(IP_Drum.yLevel,regulation_Niveau_MP. MesureNiveauEau)
-    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
-  connect(regulation_Niveau_MP.SortieReelle1, IP_FeedValve.Ouv)
-    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
-  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
-    annotation (Line(
-      points={{505.7,123},{529.85,123},{529.85,112},{567.5,112}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(LP_Drum.yLevel,regulation_Niveau_BP. MesureNiveauEau)
-    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
-  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
-    annotation (Line(
-      points={{741.8,-238},{752,-238},{752,-269},{757.5,-269}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(regulation_Niveau_Condenseur.SortieReelle1, ExtractionValve.Ouv)
-    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
-  connect(SensorQ_WaterBP.C1, LP_Economizer.Cws2)
-    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
-  connect(LP_Economizer.Cws1, Dp_Cond_Out2.C2)
-    annotation (Line(points={{680,-70},{680,-186},{902,-186},{902,-258}}));
-  connect(SensorQ_SteamCondenser.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
-    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,-280.9}}));
-  connect(regulation_Niveau_Condenseur.MesureDebitEau, SensorQ_WaterCondenser.Measure)
-    annotation (Line(points={{757.45,-274.95},{750,-274.95},{750,-310},{792,-310},
-          {792,-412},{692.13,-412}}));
-  connect(ConstantVanneHP_Turbine.y, HP_Turbine_Valve.Ouv)
-    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
-  connect(regulation_Niveau_BP.SortieReelle1, LP_SteamValve.Ouv)
-    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
-  connect(LP_FeedValve.Ouv, LP_SteamValve_Constante.y)
-    annotation (Line(points={{640,67},{640,81},{653.4,81}}));
-  connect(HP_Economizer_1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
-          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
-  connect(VolumeECO_HP1_2.Cs, HP_Economizer_2.Cws1) annotation (Line(points={{
-          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
-  connect(HP_Economizer_2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
-          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
-  connect(VolumeECO_HP2_3.Cs, HP_Economizer_3.Cws1) annotation (Line(points={{
-          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
-  connect(HPIP_FeedValve1.C1, HP_Pump.C2)
-    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-36},{824,-36}}));
-  connect(IP_Pump.C2, HPIP_FeedValve2.C1) annotation (Line(points={
-          {824,16},{870,16},{870,-142.8},{804,-142.8}}, color={0,0,255}));
-  connect(StopPumpingMp1.y, HPIP_FeedValve1.Ouv)
-    annotation (Line(
-      points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,-123.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(StopPumpingHP1.y, HPIP_FeedValve2.Ouv)
-    annotation (Line(
-      points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,-163.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(HPIP_FeedValve1.C2, HP_Economizer_1.Cws1) annotation (Line(
-        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
-          -6},{526,-30}}, color={0,0,255}));
-  connect(IP_Economizer.Cws1, HPIP_FeedValve2.C2)
-    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
-  connect(ConstantVanneIP_Turbine.y, IP_Turbine_Valve.Ouv)
-    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
-  connect(HP_Turbine_Valve.C2, VolumePreTHP.Ce) annotation (Line(points={
-          {-104,-230},{-62,-230}}, color={255,0,0}));
-  connect(DoubleDebitMP.Cs, IP_Turbine_Valve.C1) annotation (Line(points=
-          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
-  connect(IP_Turbine_Valve.C2, VolumeIP.Ce1) annotation (Line(
-        points={{-104,-314},{-60,-314}}, color={255,0,0}));
-  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(points={{620,-353},
-          {638,-353},{638,-352},{639,-352.8}}, color={0,0,255}));
-  connect(Condenser.Cse, PuitsCaloporteur.C)
-    annotation (Line(points={{719,-352},{736,-352}}, color={0,0,255}));
-  connect(SensorQ_SteamCondenser.C2, Condenser.Cv) annotation (Line(points={{679.3,
-          -274.2},{679.3,-288.1},{679,-288.1},{679,-304}}, color={0,0,255}));
-  connect(SensorQ_WaterCondenser.C1, Condenser.Cl)
-    annotation (Line(points={{680.3,-402},{679.8,-402},{679.8,-384}}));
-  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
-    annotation (Line(
-      points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(Condenser.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
-    annotation (Line(points={{723,-372.8},{780,-372.8},{780,-326},{732,-326},{732,
-          -263},{757.5,-263}}));
-  connect(LP_Drum.Cs, SensorQ_WaterBP_Out.C1) annotation (Line(points={{578,22},
-          {564,22},{564,16},{642,16},{642,16.2},{687,16.2}}, color={0,0,255}));
-  connect(LP_Drum.Ce1, LP_FeedValve.C2)
-    annotation (Line(points={{618,50},{630,50}}));
-  connect(IP_Drum.Ce1, IP_FeedValve.C2)
-    annotation (Line(points={{358,50},{378,50}}));
-  connect(HP_Drum.Ce1, HP_FeedValve.C2)
-    annotation (Line(points={{38,50},{58,50}}));
-  connect(VolumePreTHP.Cs3, HP_Turbine.Ce) annotation (Line(points={{-42,-230},{
-          -2.2,-230}}, color={255,0,0}));
-  connect(VolumeIP.Cs, IP_Turbine.Ce) annotation (Line(points={{-40,-314},
-          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
-  connect(IP_Turbine.Cs, VolumeIP1.Ce1) annotation (Line(points={{358.2,
-          -230},{408,-230}}, color={255,0,0}));
-  connect(VolumeIP1.Cs, LP_Turbine.Ce) annotation (Line(points={{428,
-          -230},{575.8,-230}}, color={255,0,0}));
-  connect(LP_Turbine.Cs, Dp_Cond_In.C1)
-    annotation (Line(points={{616.2,-230},{640,-230}}, color={255,0,0}));
-  connect(IP_Economizer.Cws2, SensorQ_WaterMP.C1) annotation (Line(points={{
-          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
-  connect(IP_Turbine.MechPower, Alternateur.Wmec2)
-    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
-  connect(LP_Turbine.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
-          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
-  connect(HP_Turbine.MechPower, Alternateur.Wmec3)
-    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
-  connect(heatSource.C[1], HP_Drum.Cex) annotation (Line(points={{18,68.3},{18,
-          50}}, color={191,95,0}));
-  connect(heatSource1.C[1], IP_Drum.Cex) annotation (Line(points={{339,68.3},{
-          339,50}}, color={191,95,0}));
-  connect(heatSource2.C[1], LP_Drum.Cex) annotation (Line(points={{598,64.3},{
-          598,50}}, color={191,95,0}));
-  connect(SensorQ_WaterHP.C1, HP_Economizer_4.Cws2)
-    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
-  connect(IP_Pump.rpm_or_mpower, StopPumpingMp.y)
-    annotation (Line(
-      points={{814,5},{814,0},{904.1,0}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-  connect(HP_Pump.rpm_or_mpower, StopPumpingHP.y)
-    annotation (Line(
-      points={{814,-47},{814,-66},{905.1,-66}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-  connect(LP_Pump.rpm_or_mpower, StopPumpingBP.y) annotation (Line(
-      points={{752,-447},{754,-447},{754,-456},{878,-456},{878,-442},{905.1,-442}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-
-  connect(HP_Turbine.Cs,SeparateurMP. Ce1)   annotation (Line(points={{38.2,-230},
-          {74,-230},{74,-210}}, color={255,0,0}));
-  connect(SeparateurMP.Cs1, HP_PressureLoss_1.C1)
-    annotation (Line(points={{74,-190},{74,-170},{88,-170}}, color={255,0,0}));
-  connect(HP_PressureLoss_1.C2, MoitieDebitHP.Ce)
-    annotation (Line(points={{102,-170},{114,-170}}, color={0,0,255}));
-  connect(SeparateurMP.Cs2, HP_IP_PressureLoss.C1)
-    annotation (Line(points={{84,-200},{134,-200}}, color={255,0,0}));
-  connect(HP_IP_PressureLoss.C2, VolumeIP1.Ce3) annotation (Line(points={{154,-200},
-          {418,-200},{418,-220}}, color={255,0,0}));
-  connect(Q_water.y, SourceCaloporteur.IMassFlow)
-    annotation (Line(points={{576,-354},{582,-354},{582,-341},{596,-341}}));
-  connect(GasTemperature.y, SourceFumees.ITemperature)
-    annotation (Line(points={{-431.5,-127},{-400,-127},{-400,-71}}));
-  connect(FuelMassFlowRate.y, SourceFumees.IMassFlow)
-    annotation (Line(points={{-431.5,11},{-400,11},{-400,-29}}));
-  connect(SourceFumees.C, HP_SuperHeater_3.Cfg1) annotation (Line(
-      points={{-349,-50},{-327.5,-50},{-327.5,-50},{-304,-50}},
-      color={0,0,0},
-      thickness=1));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-550,
-            -460},{950,150}},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-507,-25},{-469,-51}},
-          lineColor={255,0,0},
-          textString=
-               "GT"),
-        Text(
-          extent={{-517,-45},{-411,-72}},
-          lineColor={255,0,0},
-          textString=
-               "Exhaust")}), experiment(StopTime=10000),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end GasTurbineTrip;
+within ThermoSysPro.Examples.Book.PowerPlants.CombinedCyclePowerPlant;
+model GasTurbineTrip "CCPP model to simulate a gas turbine trip"
+  parameter Real CstHP(fixed=false,start=7618660.65374636)
+    "Stodola's ellipse coefficient HP";
+  parameter Real EtaIsNomHP(fixed=false,start=0.875)
+    "Turbine HP: Nominal isentropic efficiency ";
+  parameter Real CstMP(fixed=false,start=278905.664031036)
+    "Stodola's ellipse coefficient MP";
+  //parameter Real EtaIsNomMP(fixed=false,start=0.96)
+  //  "Turbine MP: Nominal isentropic efficiency ";
+  parameter Real CstBP(fixed=false,start=13491.6445678148)
+    "Stodola's ellipse coefficient BP";
+  parameter Real EtaIsNomBP(fixed=false,start=0.92)
+    "Turbine MP: Nominal isentropic efficiency ";
+// //
+  //parameter Modelica.SIunits.AbsolutePressure PoutPumpEx(fixed=false,start=22e5)"Flow pressure at the outlet of the pump";
+  //parameter Modelica.SIunits.Length zc(fixed=false,start=1.5) "Condenser water level";
+
+  parameter Real LP_Pump_a1(fixed=false,start=-6000)
+    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+
+  //parameter Real a3_PumpBP(fixed=false,start=400)"Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVHP(fixed=false, start=47829.4)
+    "Maximum CV: steame valve HP Drum  ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVMP(fixed=false, start=47829.4)
+    "Maximum CV: steame valve  Drum MP";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
+    "Maximum CV: steame valve BP Drum ";
+
+  //parameter ThermoSysPro.Units.Cv CvmaxValveWBP(fixed=false,start=10000)
+  //  "Maximum CV: Water valve BP Drum ";
+
+  parameter Real Fouling_SHP(fixed=false,start=0.075)
+    "Sur HP: heat exchange fouling coefficient";
+
+  //parameter Real Fouling_EHP(fixed=false,start=1)
+  //  "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP1(fixed=false,start=0.07)
+    "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP2(fixed=false,start=0.11)
+    "Eco HP2: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP3(fixed=false,start=0.06)
+    "Eco HP3: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP4(fixed=false,start=0.03)
+    "Eco HP4: heat exchange fouling coefficient";
+
+  parameter Real Fouling_SMP(fixed=false,start=0.1358)
+    "Sur MP1: heat exchange fouling coefficient";
+
+  //parameter Real Fouling_SMP(fixed=true,start=0.065)
+  //  "Sur MP1: heat exchange fouling coefficient";
+
+  parameter Real Fouling_EMP(fixed=false,start=0.09)
+    "Eco MP: heat exchange fouling coefficient";
+
+  parameter Real Fouling_EvHP(fixed=false,start=0.24)
+    "Evapo HP: heat exchange fouling coefficient";
+  parameter Real Fouling_EvMP(fixed=false,start=0.08)
+    "Evapo MP: heat exchange fouling coefficient";
+  parameter Real Fouling_EvBP(fixed=false,start=0.09)
+    "Evapo BP: heat exchange fouling coefficient";
+
+  parameter Real Fouling_SBP(fixed=false,start=0.05)
+    "Sur BP: heat exchange fouling coefficient";
+  parameter Real Fouling_EBP(fixed=false,start=0.06)
+    "Eco BP: heat exchange fouling coefficient";
+
+  parameter Real K_HP_DownComer(fixed=false,start=720.183)
+    "HP: Friction pressure loss coefficient";
+  parameter Real K_IP_DownComer(fixed=false,start=1090.9)
+    "MP: Friction pressure loss coefficient";
+  parameter Real K_Dp_HP_2(fixed=false,start=10.)
+    "SMPin: Friction pressure loss coefficient";
+
+  //parameter Real K_PerteChargeZero2(fixed=true,start=1e-4)
+  //  "TurbineMP out: Friction pressure loss coefficient";
+  parameter Real K_Dp_HP_IP(fixed=false,start=1.)
+    "Outlet THP: Friction pressure loss coefficient";
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
+    "Maximum CV input Turbine HP ";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
+    "Maximum CV input Turbine MP ";
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum HP_Drum(
+    L=16.27,
+    Vertical=false,
+    hl(fixed=false, start=1474422.14552527),
+    hv(fixed=false, start=2666558.75582585),
+    Vv(fixed=false),
+    R=1.05,
+    xmv(fixed=false),
+    P(fixed=false, start=12703151.2960688),
+    zl(start=1.05, fixed=true),
+    Mp=5000,
+    Kpa=5,
+    Kvl=1000,
+    Pfond(start=12703151.3),
+    Tp(start=596.924860294475),
+    Cv(Q(fixed=true, start=76.58)))
+                     annotation (Placement(transformation(extent={{38,10},{-2,
+            50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_FeedValve(
+    Cvmax=CvmaxValveAHP,
+    C1(P(start=12721657.0), h_vol(start=1396865.59043578)),
+    h(start=1398000),
+    Cv(start=178),
+    Pm(start=13050700))
+                 annotation (Placement(transformation(extent={{78,46},{58,66}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    HP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_SteamValve(
+    mode=0,
+    C2(h_vol(start=2666558.75582585),P(start=12700000.0)),
+    h(start=2674000),
+    Cv(start=23914.7),
+    Pm(start=12721657.16928),
+    C1(P(start=132.1e5, fixed=true)),
+    Cvmax=CvmaxValveVHP)
+                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_DownComer(
+    z2=0,
+    mode=1,
+    Q(start=150, fixed=true),
+    z1=10.83,
+    K=K_HP_DownComer,
+    C2(P(start=12768600.0)),
+    h(start=1474422.14552527),
+    Pm(start=12704000))
+            annotation (Placement(transformation(
+        origin={28,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,     h(start=1474422.14552527))
+                                           annotation (Placement(transformation(
+          extent={{8,-100},{-12,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Evaporator(
+    Dint=32.8e-3,
+    Ntubes=1476,
+    L=20.7,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
+      Tp(start={607.668721736158,605.187884376142,603.825778846274}),
+      Tp1(start={606.357,604.602,603.578})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=10.83,
+      option_temperature=2,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={5.74e7,2.67e7,1.24e7}),
+      Tp1(start={606.2,604.6,603.7}),
+      h(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134,
+            1459929.875}),
+      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
+      P(start={12758125,12740000,12734000,12730000,12726787})),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.092,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.86442072,
+      p_rho=1.05,
+      Encras(start=0.24)=Fouling_EvHP,
+      K(fixed=false, start=407),      DeltaT(start={106,49,23}),
+      T(start={755.54821777344,673.68082608925,635.57157972092,618.19360351563}),
+      Tm(start={643.15,633.15,626.621}),
+      Tp(start={609.11670087771,605.86035558168,604.13687003529})))
+                          annotation (Placement(transformation(
+        origin={-14,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_4(
+    Ns=3,
+    L=20.726,
+    Dint=0.0266,
+    Ntubes=246,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-3.5e6,-2.63e6,-2e6}),
+      Tp(start={576.803345033827,581.933438017921,585.694098500999}),
+      Tp1(start={575.762,580.856,584.579})),
+    Cws1(P(start=13703700.0), h_vol(start=1306078.18827954)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      z2=0,
+      option_temperature=2,
+inertia=true,
+      dW1(start={3.5e6,2.63e6,2e6}),
+      Tp1(start={577.5,582.6,586.4}),
+      h(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578,
+            1398251.0}),
+      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
+      P(start={13301176,13320000,13338000,13357000,13374658})),
+    Cws2(h(fixed=false, start=1500e3)),
+    ExchangerFlueGasesMetal(
+      Dext=0.0318,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.39069779,
+      p_rho=1.06,
+      Encras(start=0.03)=Fouling_EHP4,
+      K(fixed=true, start=47.53),DeltaT(start={38,29,22}),
+      T(start={618.19360351563,612.7722894387,608.97249438439,606.41162109375}),
+      Tm(start={623.15,613.15,607.844}),
+      Tp(start={577.44979072627,582.41942947968,586.06092597683})))
+                          annotation (Placement(transformation(
+        origin={86,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_1(
+    Ns=3,
+    L=20.4,
+    Dint=0.0324,
+    Ntubes=246,
+    ExchangerWall(e=0.0028, lambda=37.61,
+    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
+      Tp(start={629.445777860324,651.664976699235,671.075818762815}),
+      Tp1(start={629,651,670.})),
+    Cws1(h_vol(start=2665000.0)),
+    Cws2(P(start=12720900.0), h_vol(start=2981170.0)),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=10.25056,
+      p_rho=1.04,
+      Encras(start=0.075)=Fouling_SHP,
+      K(fixed=false, start=34.71),      DeltaT(start={138,108,84}),
+      T(start={788.2431640625,774.65344332519,763.17487871399,755.54821777344}),
+      Tm(start={778.15,768.15,759.527}),
+      Tp(start={631.68675322573,653.38616970968,672.36458008039})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      option_temperature=2,
+      inertia=true,
+      dpfCorr=2,      dW1(start={9.8e6,7.7e6,5.9e6}),
+      Tp1(start={639.5,657,673}),
+      h(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983,
+            2973076.25}),
+      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
+      P(start={12723762,12723600,12723500,12720000,12719000})))
+         annotation (Placement(transformation(
+        origin={-64,-50},
+        extent={{-20,20},{20,-20}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_3(
+    Dint=26.6e-3,
+    Ntubes=1476,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
+      Tp(start={556.530623976228,563.226831750573,565.575075374951}),
+      Tp1(start={555.49,562.473,564.857})),
+    L=20.726,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.6e7,5.6e6,2.1e6}),
+      Tp1(start={558,565,567}),
+      h(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855,
+            1291418.875}),
+      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
+      P(start={13219333,13241000,13261000,13282000,13301176})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=12.451,
+      p_rho=1.08,
+      Encras(start=0.06)=Fouling_EHP3,
+      K(fixed=true, start=36.03),
+      St=5, DeltaT(start={34,12,4.4}),
+      T(start={602.67193603516,579.67183226637,571.50875350574,568.81030273438}),
+      Tm(start={593.15,583.15,571.919}),
+      Tp(start={557.01185690541,563.39937105652,565.63731055685})))      annotation (Placement(
+        transformation(
+        origin={206,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_2(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-5e6,-3e6,-2.e6}),
+      Tp(start={490.631370193221,498.229397165878,502.978053774656}),
+      Tp1(start={490,497.024,501.871})),
+    L=20.767,
+    Ntubes=1107,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={5e6,3e6,2.e6}),
+      Tp1(start={499,503,507}),
+      h(start={854494.5625,915007.018247822,957243.396653824,983786.364226731,
+            986348.9375}),
+      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
+      P(start={13129352,13152000,13175000,13197000,13219333})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=111e-3,
+      CSailettes=2.76134577,
+      p_rho=1.11,
+      Encras(start=0.11)=Fouling_EHP2,
+      K(fixed=true, start=65),
+      St=5, DeltaT(start={36,23,14}),
+      T(start={531.16070556641,523.74706132958,519.01561663699,516.31256103516}),
+      Tm(start={538.15,528.15,521.399}),
+      Tp(start={490.84070882241,498.36081646341,503.06064272486})))      annotation (Placement(
+        transformation(
+        origin={406,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_1(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-9.9999e6,-5e6,-2.4e6}),
+      Tp(start={458.958585923538,468.506814782426,473.132256983258}),
+      Tp1(start={458.001,467.576,472.607})),
+    L=20.726,
+    Ntubes=1107,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={9.9999e6,5e6,2.4e6}),
+      Tp1(start={467.4,476.5,480.9}),
+      h(start={618651.9375,752176.893518976,816707.727773953,847728.424287614,
+            854494.5625}),
+      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
+      dynamic_mass_balance=true,
+      P(start={13034956,13060000,13080000,13100000,13129352})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=8.30057632,
+      p_rho=1.13,
+      Encras(start=0.07)=Fouling_EHP1,
+      K(fixed=true, start=40.),
+      St=5,   DeltaT(start={41,20,10}),
+      T(start={509.31488037109,491.44087131458,484.15889910859,482.59533691406}),
+      Tm(start={503.15,498.15,494.131}),
+      Tp(start={459.37586976399,468.70800090382,473.22896941053})))      annotation (Placement(
+        transformation(
+        origin={526,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_2(
+    Ns=3,
+    L=20.4,
+    Dint=32e-3,
+    Ntubes=246,
+    ExchangerWall(e=3e-3, lambda=27,
+          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
+      Tp(start={714.604505161814,740.492493660215,759.200099714419}),
+      Tp1(start={710.485,734.082,752.527})),
+    Cws2(P(start=127113000.0), h_vol(start=3254970.0)),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.83,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={8.8e6,6.6e6,4.9e6}),
+      Tp1(start={714,735.6,752}),
+      h(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722,
+            3240813.5}),
+      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
+      P(start={12720371,12718000,12716000,12714000,12711007})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      CSailettes=10.2505424803872,
+      p_rho=1.02,
+      Encras(start=0.075)=Fouling_SHP,
+      K(fixed=false, start=34.74),
+      St=5,
+      DeltaT(start={124,93,70}),
+      T(start={850.64624023438,839.40882309811,830.36536707939,822.68170166016}),
+      Tm(start={843.15,833.15,825.24}),
+      Tp(start={717.48312916257,742.56566858011,760.69152533026})))      annotation (Placement(
+        transformation(
+        origin={-174,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_3(
+    Ns=3,
+    L=20.4,
+    Ntubes=246,
+    ExchangerWall(lambda=27,e=5e-3,
+    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
+      Tp(start={793.335674512128,811.477076678823,824.721389633254}),
+      Tp1(start={783.815,803.639,818.56})),
+    Dint=28e-3,
+    Cws2(h(fixed=true, start=3511e3)),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.726,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={6.3e6,4.7e6,3.6e6}),
+      Tp1(start={783.6,801.6,815}),
+      h(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987,
+            3433271.25}),
+      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
+      P(start={12711007,12704000,12697000,12689000,12681000})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      p_rho=1,
+      Encras(start=0.075)=Fouling_SHP,
+      CSailettes=6.59672846,
+      K(fixed=false, start=49.33),
+      St=5,
+      DeltaT(start={97,73,55}),
+      T(start={894.21850585938,885.5393240412,879.47464880089,874.32891845703}),
+      Tm(start={893.15,883.15,875.939}),
+      Tp(start={796.82789474964,814.05266276572,826.6253996051})))      annotation (Placement(
+        transformation(
+        origin={-294,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum IP_Drum(
+    L=16.27,
+    Vertical=false,
+    P0=27.29e5,
+    hl(fixed=false, start=978914.570821827),
+    hv(fixed=false, start=2799158.13966473),
+    Vv(fixed=false),
+    R=1.05,
+    P(fixed=false, start=28.3e5),
+    zl(start=1.05, fixed=true),
+    Kvl=0,
+    Kpa=5,
+    Mp=5000,
+    Cv(Q(fixed=true, start=10.9)),
+    Pfond(start=2732995.0),
+    Tp(start=500.955757665063))
+                     annotation (Placement(transformation(extent={{358,10},{320,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    IP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_FeedValve(
+      Cvmax=CvmaxValveAMP,
+    C1(P(start=2952995.0), h_vol(start=892414.570867188)),
+    h(start=944000),
+    Cv(start=28),
+    Pm(start=2945000))
+                 annotation (Placement(transformation(extent={{398,46},{378,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_SteamValve(
+    Pm(fixed=false, start=2731689.4244255),
+    C2(h_vol(start=2798000),P(start=27.3e5)),
+    h(fixed=false, start=2798000),
+    mode=0,
+    Cv(start=27829.4),
+    Cvmax=CvmaxValveVMP,
+    C1(P(start=28.3e5, fixed=true)))
+                 annotation (Placement(transformation(extent={{298,46},{278,66}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_Evaporator(
+    Dint=32.8e-3,
+    L=20.767,
+    Ntubes=738,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
+      Tp(start={504.957792851478,504.19488464586,503.59993822766}),
+      Tp1(start={504.427,503.806,503.304})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.83,
+      continuous_flow_reversal=true,
+      inertia=true,
+          dW1(start={9.7e7,7.6e6,5.8e6}),
+      Tp1(start={504.5,503.9,503.4}),
+      P(start={2773367.5,2754933.93610513,2745233.82043873,2738517.46232967,2733824.75}),
+      h(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464,980708.125}),
+      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=10.0676093,
+      p_rho=1.1,
+      Encras(start=0.08)=Fouling_EvMP,
+      K(fixed=false, start=46.9),
+      St=5,
+      DeltaT(start={53,41,32}),
+      T(start={565.24822998047,551.20973998682,539.98034586472,531.16070556641}),
+      Tm(start={553.15,543.15,536.901}),
+      Tp(start={505.45492567199,504.57970000924,503.89762940507})))              annotation (Placement(
+        transformation(
+        origin={306,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss IP_DownComer(
+    z2=0,
+    z1=10.83,
+    mode=1,
+    K=K_IP_DownComer,
+    Q(start=22, fixed=true),
+    Pm(start=2734000),
+    h(start=978914.570821827))
+            annotation (Placement(transformation(
+        origin={348,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
+    h(start=978914.570821827),
+    P(start=2834000))                      annotation (Placement(transformation(
+          extent={{328,-100},{308,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_Economizer(
+    ExchangerWall(e=2.6e-3, lambda=47,
+        dW1(start={-3e6,-1.4e6,-740379}),
+      Tp(start={457.584681885759,475.409334769727,486.332585528225}),
+      Tp1(start={456.76,474.926,485.122})),
+    L=20.726,
+    Ns=3,
+    Dint=26.6e-3,
+    Ntubes=246,
+    Cws1(h_vol(start=671235.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.767,
+      z2=0,
+      inertia=true,
+      dW1(start={3e6,1.4e6,740379}),
+      Tp1(start={474,491,499.9}),
+      h(start={565108.5,727745.440528479,829820.124314816,892414.570867187,
+            944505.4375}),
+      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
+      P(start={3124229.75,3148000,3172000,3195000,3216977.75})),
+    Cws2(h(fixed=false, start=990e3)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      CSailettes=7.16188651,
+      p_rho=1.12,
+      Encras(start=0.09)=Fouling_EMP,
+      K(fixed=true, start=50),
+      St=5,
+      DeltaT(start={45,24,13}),
+      T(start={516.31256103516,511.25046295073,508.31162431247,509.31488037109}),
+      Tm(start={533.15,523.15,514.647}),
+      Tp(start={458.18343678065,475.77644311925,486.55770446184})))              annotation (Placement(
+        transformation(
+        origin={466,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_1(
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.3e6,-0.80263e6,
+                                -501864}),
+      Tp(start={557.102699668877,574.070651369638,584.64928514972}),
+      Tp1(start={556.102699668877,573.070651369638,583.64928514972})),
+    L=20.726,
+    Ns=3,
+    Dint=32.8e-3,
+    Ntubes=123,
+    Cws1(h_vol(start=2800000.0),P(start=2.73467e+06)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      CSailettes=14.46509765,
+      p_rho=1.07,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=22.09),
+      St=5,
+      DeltaT(start={45,30,19}),
+      T(start={606.41162109375,604.22099235915,603.06310204059,602.67193603516}),
+      Tm(start={623.15,613.15,603.024}),
+      Tp(start={557.49575399383,574.31250418519,584.79699207547})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.77,
+      dpfCorr=2,
+      inertia=false,
+      dW1(start={1.3e6,0.80263e6,501864}),
+      Tp1(start={557,573,583}),
+      h(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156,
+            3040562.25}),
+      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
+      P(start={2731326.25,2729591.6901521,2728654.3204706,2727686.1714029,
+            2726700})))     annotation (Placement(transformation(
+        origin={146,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB VolumeLP(
+    Ce1(h(start=3091610.0)),
+    h(start=3042573.51976705),
+    P(start=2726000))
+    annotation (Placement(transformation(
+        origin={146,-110},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_2(
+    Ns=3,
+    L=20.4,
+    Dint=39.3e-3,
+    Ntubes=369,
+    ExchangerWall(e=2.6e-3, lambda=36.86,
+    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
+      Tp(start={689.66516778766,716.376344387713,734.591437191304}),
+      Tp1(start={687.7,713.5,731.5})),
+    Cws1(P(start=2576650.0), h_vol(start=3078800.0)),
+    Cws2(P(start=2558540.0), h_vol(start=3342910.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={1.15e7,7.9e6,5.5e6}),
+      Tp1(start={685.6,711,729}),
+      h(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389,
+            3321940.75}),
+      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
+      P(start={2575582.5,2572000,2568000,2563000,2558239})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=92e-3,
+      CSailettes=5.814209831,
+      p_rho=1.03,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=45.22),
+      St=5,
+      DeltaT(start={125,86,60}),
+      T(start={822.68170166016,807.90772072705,797.00284433443,788.2431640625}),
+      Tm(start={813.15,803.15,792.527}),
+      Tp(start={690.93545553661,717.24269857866,735.18209370035})))              annotation (Placement(
+        transformation(
+        origin={-114,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_3(
+    Ns=3,
+    L=20.4,
+    Ntubes=369,
+    Dint=45.6e-3,
+    ExchangerWall(e=2.6e-3, lambda=27,
+    dW1(start={-8e6,-5.5e6,-3.8e6}),
+      Tp(start={788.901616786331,805.674094596818,817.083010473709}),
+      Tp1(start={786.717,804.102,815.901})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={8e6,5.5e6,3.8e6}),
+      Tp1(start={782,798.7,810}),
+      h(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916,
+            3517975.25}),
+      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
+      P(start={2558239,2556000,2554000,2552000,2548600})),
+    Cws2(h(fixed=true, start=3606e3)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=92e-3,
+      Dext=50.8e-3,
+      p_rho=1.01,
+      CSailettes=5.695842178,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=43.23),
+      St=5,
+      DeltaT(start={82,56,38}),
+      T(start={874.32891845703,864.2444076086,856.92248545484,850.64624023438}),
+      Tm(start={873.15,863.15,853.059}),
+      Tp(start={789.92521486539,806.37044583028,817.55662835373})))              annotation (Placement(
+        transformation(
+        origin={-234,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum LP_Drum(
+    Vertical=false,
+    P0=5e5,
+    Vv(fixed=false),
+    L=8,
+    hl(fixed=false, start=549249.519022482),
+    hv(fixed=false, start=2709858.97470349),
+    R=2,
+    zl(start=1.75, fixed=true),
+    Kvl=0,
+    Kpa=5,
+    Mp=5000,
+    P(fixed=false, start=520000),
+    Cv(Q(fixed=true, start=9.23)),
+    Pfond(start=564775.0),
+    Tp(start=406.411032587651))
+                     annotation (Placement(transformation(extent={{618,10},{578,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    LP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_SteamValve(
+    p_rho=3, Cvmax=CvmaxValveVBP,
+    C2(P(start=503542.0), h_vol(start=2709858.97470349)),
+    h(start=2685000),
+    Cv(start=7555),
+    Pm(start=498000))
+                 annotation (Placement(transformation(extent={{558,46},{538,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_FeedValve(
+    C1(h_vol(start=511900.0)),
+    h(fixed=false, start=509000),
+    Pm(fixed=false, start=5.0698e5),
+    Cvmax=250,
+    Cv(start=142.5),
+    C2(P(fixed=true, start=5.2e5)))
+                 annotation (Placement(transformation(extent={{650,46},{630,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss LP_DownComer(
+    z2=0,
+    z1=10.767,
+    K=32766,
+    mode=1,
+    Q(start=20, fixed=false),
+    pro(d(start=934.452746556487)),
+    Pm(start=564000),
+    h(start=549249.519022482))
+            annotation (Placement(transformation(
+        origin={610,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=549249.519022482),
+                                                                       mode=1,
+    V=5,
+    P(start=523000))                                   annotation (Placement(
+        transformation(extent={{592,-100},{572,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_Evaporator(
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
+      Tp(start={433.127441964236,432.076030201586,431.28112439162}),
+      Tp1(start={432.956,431.127,430.61})),
+    L=20.726,
+    Ntubes=984,
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={1.24e7,8.5e6,5.8e6}),
+      Tp1(start={442.5,441.7,441}),
+      h(start={550075.0,765243.011613326,912673.256542569,1013555.73710231,
+            550075.0}),
+      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
+      Q(start={49.787311368631,49.787311368631,49.787311368631,49.787311368631}),
+      P(start={522583.375,488000,487000,486000,485588.46875})),
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=138e-3,
+      CSailettes=11.07985,
+      p_rho=1.14,
+      Encras(start=0.09)=Fouling_EvBP,
+      K(fixed=false, start=46.7),
+      St=5,
+      DeltaT(start={45,31,21}),
+      T(start={482.59533691406,464.53146753441,453.496360082,442.5893859863}),
+      Tm(start={483.15,478.15,472.098}),
+      Tp(start={433.5360639938,432.3549425205,431.471976456})))              annotation (Placement(
+        transformation(
+        origin={566,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_LP_Drum(k=0.25)
+    annotation (Placement(transformation(extent={{742,32},{728,44}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve(
+      Pm(start=5.0698e5), mode=1,
+    C1(h_vol(start=549249.519022482)),
+    h(start=550000),
+    Cv(start=308.931))
+                 annotation (Placement(transformation(extent={{710,12},{730,32}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_SuperHeater(
+    Ns=3,
+    L=20.726,
+    Dint=39.3e-3,
+    Ntubes=123,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.1e6,-782901,-559798}),
+      Tp(start={489.606851797367,513.610203520748,530.080624448955}),
+      Tp1(start={488.486,512.197,529.53})),
+    Cws1(h_vol(start=2642240.0),P(start=484264)),
+    Cws2(h_vol(start=2979330.0)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=222.1e-3,
+      K(fixed=true, start=30.46),
+      CSailettes=3.25763059984175,
+      p_rho=1.09,
+      Encras(start=0.05)=Fouling_SBP,
+      St=5,
+      DeltaT(start={92,66,47}),
+      T(start={568.81030273438,567.21003420557,566.29303411055,565.24822998047}),
+      Tm(start={583.15,573.15,568.703}),
+      Tp(start={489.84170505864,513.76963980951,530.18834052149})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      rugosrel=1e-5,
+      z1=10.767,
+      inertia=false,
+      dpfCorr=0.25,
+      dW1(start={1.1e6,782901,559798}),
+      Tp1(start={485,511,529}),
+      h(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762,
+            2914520.25}),
+      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
+      P(start={510622.6875,505757.57962259,504477.27858572,503172.36919354,501850})))      annotation (Placement(
+        transformation(
+        origin={266,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkP SinkP_Gas(P0=104400)
+    annotation (Placement(transformation(
+        origin={722,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_Economizer(
+    Ns=3,
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
+      Tp(start={398.142807363473,393.825926964772,392.943738968771}),
+      Tp1(start={397.622,392.348,391.516})),
+    Ntubes=3444,
+    L=20.726,
+    Cws1(h_vol(start=195526.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      inertia=true,
+      dpfCorr=0.5,
+      dW1(start={2.45e7,5.5e6,1.17e6}),
+      Tp1(start={409,404.7,404}),
+      h(start={194584.515625,462556.370989432,494648.45288738,501287.069880104,
+            509237.875}),
+      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
+      P(start={1540571.25,1500000,1480000,1450000,1429595.375})),
+    Cws2(h(fixed=false, start=500e3)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=92e-3,
+      CSailettes=11.673758598919,
+      p_rho=1.15,
+      Encras(start=0.06)=Fouling_EBP,
+      K(fixed=true, start=30),
+      St=5,
+      DeltaT(start={23.5,5.3,1.1}),
+      T(start={442.5893859863,403.9873508455,395.0465605839,395.464630127}),
+      Tm(start={423.15,418.15,414.742}),
+      Tp(start={398.4437772187,393.8897987349,392.9569515805})))              annotation (Placement(
+        transformation(
+        origin={680,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine HP_Turbine(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.88057),
+    eta_is_min=0.75,
+    Cst(start=8182844.56002535)=
+        CstHP,
+    Pe(fixed=true, start=125.20e5),
+    Ps(fixed=false, start=2726700),
+    eta_is_nom=EtaIsNomHP,
+    Cs(h(fixed=true, start=3106e3)),
+    pros(d(start=10.0)),
+    Hrs(start=3046260),
+    Qmax=151,
+    a=-1.20211,
+    b=2.32571,
+    c=-0.25) annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
+          rotation=0)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine IP_Turbine(
+    W_fric=1,
+    Ps(fixed=false, start=476800),
+    eta_stato=1,
+    eta_is(start=0.9625),
+    eta_is_min=0.75,
+    Cst(start=256335.364995961)=
+        CstMP,
+    Pe(fixed=true, start=25.13e5),
+    pros(d(start=30.0)),
+    Hrs(start=3029780),
+    Cs(h(fixed=false, start=2990e3)),
+    eta_is_nom=0.96,
+    b=2.4957,
+    Qmax=170,
+    a=-1.2728,
+    c=-0.26202)   annotation (Placement(transformation(extent={{318,-250},{358,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP1(
+    h(start=2997231.36734756),
+    P(start=476799.99999954),
+    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
+        origin={418,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine LP_Turbine(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9538),
+    eta_is_min=0.75,
+    Cst(start=11944.9445735985)=
+        CstBP,
+    Hrs(start=2401030),
+    Pe(fixed=true, start=4.77e5),
+        Ps(start=10053),
+    Cs(h(fixed=true, start=2399.9e3)),
+    eta_is_nom=EtaIsNomBP,
+    Qmax=192,
+    a=-1.22335,
+    b=2.2957,
+    c=-0.14)   annotation (Placement(transformation(extent={{576,-250},{616,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-292,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-232,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(Cs(h(start=3000000)),
+                                                    alpha=0.5)
+    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
+    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    Vf0=0.15,
+    steady_state=false,
+    yNiveau(signal(start=1.5)),
+    Cse(h(start=128076)),
+    P0=6100,
+    P(fixed=false, start=6136),
+    Pfond(start=6200)) annotation (Placement(transformation(extent={{639,-384},{
+            719,-304}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
+    h0=113.38e3, Q0=17224)       annotation (Placement(transformation(extent={{
+            572,-377},{620,-329}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_In(
+    K=1e-4,
+    h(start=2400000),
+    C1(h_vol(start=2400000), h(start=2400000)),
+    Q(start=190.55),
+    Pm(start=10026)) annotation (Placement(transformation(extent={{640,-240},{660,
+            -220}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
+    Ce3(h(start=163768.700887002)),
+    h(start=163768.700887002),
+    P(start=1540500))
+    annotation (Placement(transformation(
+        origin={902,-318},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out2(
+    K=1e-4,
+    mode=1,
+    pro(d(start=993.470128235971)),
+    Pm(start=1540000)) annotation (Placement(transformation(
+        origin={902,-270},
+        extent={{12,-12},{-12,12}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
+    h(start=549249.519022482),
+    P(start=322430))                       annotation (Placement(transformation(
+          extent={{742,6},{762,26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump IP_Pump(
+    a3=350,
+    mode=1,
+    Q(fixed=false, start=10.9),
+    a1=-244551,
+    C1(h_vol(start=576000.0)),
+    C2(h_vol(start=561000.0)),
+    h(start=571000.0),
+    hn(start=317),
+    Qv(start=0.0207237016869104),
+    pro(d(start=930.0)),
+    Pm(start=1725850))
+            annotation (Placement(transformation(extent={{804,6},{824,26}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump HP_Pump(
+    a3=1600,
+    a1=-28056.2,
+    Q(fixed=false),
+    mode=1,
+    C1(h_vol(start=561000.0)),
+    C2(h_vol(start=630000.0)),
+    h(start=630000),
+    hn(start=1413),
+    Qv(start=0.0810383142105344),
+    pro(d(start=929.0)),
+    Pm(start=6774000))  annotation (Placement(transformation(extent={{804,-46},
+            {824,-26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
+                                                    alpha=0.5,
+    h(start=194585),
+    P(start=1540500),
+    Cs(h(start=194585)))
+    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={266,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_LP_Turbine(
+    z2=0,
+    mode=0,
+    z1=0,
+    h(start=3000000),
+    C1(
+      h_vol(start=3000000),
+      h(start=3000000),
+      P(fixed=false, start=5.0185e5)),
+    K=1e-4,
+    Pm(start=490000)) annotation (Placement(transformation(
+        origin={344,-278},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_HP_Pump(
+    K=1e-4,
+    mode=1,
+    C2(h_vol(start=599600)),
+    Pm(start=372718)) annotation (Placement(transformation(
+        origin={780,-36},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_IP_Pump(
+    K=1e-4,
+    mode=1,
+    C2(h_vol(start=599600)),
+    Pm(start=372718)) annotation (Placement(transformation(
+        origin={780,16},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
+    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out(
+    K=1e-4,
+    mode=1,
+    C1(h_vol(start=153206.462779274)),
+    C2(h_vol(start=153206.462779274)),
+    pro(d(start=993.441492649513)),
+    Pm(start=6200)) annotation (Placement(transformation(extent={{702,-446},{722,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump LP_Pump(
+    Qv(start=0.1934),
+    mode=1,
+    a3=400,
+    C2(P(fixed=false, start=16.7e5), h_vol(start=194669.0)),
+    h(start=193000),
+    hn(start=183),
+    a1=LP_Pump_a1,
+    Q(start=193.43, fixed=false),
+    Pm(start=1103065, fixed=false)) annotation (Placement(transformation(extent=
+           {{742,-446},{762,-426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out1(
+    K=1e-4,
+    mode=1,
+    pro(d(start=994.045785814739)),
+    C1(h_vol(start=194585), h(start=194585)),
+    Pm(start=1546000)) annotation (Placement(transformation(extent={{840,-446},{
+            860,-426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ExtractionValve(
+    mode=1,
+    Cvmax=2500,
+    h(start=195000),
+    Cv(start=2000),
+    C1(h_vol(start=195000)),
+    C2(h_vol(start=195000)),
+    Pm(start=1549000)) annotation (Placement(transformation(extent={{802,-440},{
+            822,-420}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamHP(C1(h_vol(start=2674000),
+        h(start=2674000)))
+    annotation (Placement(transformation(
+        origin={-58,8},
+        extent={{-6,6},{6,-6}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterHP(C2(h_vol(start=1398000),
+        h(start=1398000)))
+    annotation (Placement(transformation(
+        origin={91.5,32},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterMP(C2(h_vol(start=944000),
+        h(start=944000)))
+    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamMP(C1(h_vol(start=2798000),
+        h(start=2798000)),C2(h_vol(start=2798000)))
+    annotation (Placement(transformation(
+        origin={236,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamBP(C2(h_vol(start=2685000),
+        h(start=2685000)))
+    annotation (Placement(transformation(
+        origin={514,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP(C2(h_vol(start=550000),
+        h(start=550000)))
+    annotation (Placement(transformation(
+        origin={663.5,34},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP_Out(C2(h_vol(start=550000),
+        h(start=550000))) annotation (Placement(transformation(extent={{687,15},
+            {700,27}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterCondenser(C2(h_vol(start=
+           194585), h(start=194585))) annotation (Placement(transformation(
+        origin={685.5,-412},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamCondenser(C2(h_vol(start=
+           2401000), h(start=2401000))) annotation (Placement(transformation(
+        origin={684.5,-264},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_2(
+    C1(
+      P(fixed=true, start=27.267e5),
+      h_vol(start=3046000),
+      h(start=3046000)),
+    K=K_Dp_HP_2,
+    Pm(start=2651000)) annotation (Placement(transformation(extent={{114,-120},{
+            94,-100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_Turbine_Valve(
+    mode=0,
+    h(fixed=false, start=3433000),
+    Cv(start=10875),
+    Pm(fixed=false, start=12550000),
+    C1(P(fixed=true, start=126.81e5)),
+    Cvmax=Cvmax_THP)
+                 annotation (Placement(transformation(extent={{-124,-234},{-104,
+            -214}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauHP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500,
+    minval=0.007) annotation (Placement(transformation(extent={{-40,106},{-20,
+            126}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauMP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500) annotation (Placement(transformation(extent={{262,106},{282,126}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauBP(                                                              k=1.75)
+    annotation (Placement(transformation(extent={{470,114},{504,132}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
+    add(k1=-1, k2=+1),
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauCondenseur1(                                 k=1.5)
+    annotation (Placement(transformation(extent={{704,-246},{740,-230}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+      add(k1=+1, k2=-1)) annotation (Placement(transformation(extent={{758,-282},
+            {778,-262}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneHP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
+            -138,-142}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp(
+    Initialvalue=1400,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=1300)
+                   annotation (Placement(transformation(extent={{944,-16},{906,
+            16}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP(
+    Initialvalue=1400,
+    Starttime=2000,
+    Duration=1000,
+    Finalvalue=700)
+                   annotation (Placement(transformation(extent={{945,-82},{907,
+            -50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingBP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{945,-458},{907,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
+    mode=1,
+    V=1,
+    h0=988332,
+    h(start=988332),
+    P0=70.1e5,
+    P(start=13129000),
+    dynamic_mass_balance=true)            annotation (Placement(transformation(
+          extent={{456,-98},{436,-78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
+    mode=1,
+    V=1,
+    h0=983786,
+    h(start=983786),
+    P0=70.0e5,
+    P(start=13219000),
+    dynamic_mass_balance=true)            annotation (Placement(transformation(
+          extent={{252,-20},{232,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve1(
+                          mode=1,
+    Cvmax=308.931,
+    h(start=618600),
+    Cv(start=308.931),
+    C1(h_vol(start=618600)),
+    Pm(start=13130000))
+                 annotation (Placement(transformation(extent={{754,-98},{730,
+            -122}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve2(
+      Pm(start=3126000), mode=1,
+    Q(start=10.9, fixed=false),
+    h(start=565000),
+    C1(h_vol(start=565000)),
+    Cv(start=308.931),
+    Cvmax=308.931)
+                 annotation (Placement(transformation(extent={{804,-138},{780,
+            -162}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp1(
+    Initialvalue=0.8,
+    Duration=800,
+    Starttime=2000,
+    Finalvalue=0.01) annotation (Placement(transformation(extent={{946,-150},{
+            908,-118}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP1(
+    Initialvalue=0.8,
+    Duration=800,
+    Starttime=2000,
+    Finalvalue=0.01) annotation (Placement(transformation(extent={{946,-194},{
+            908,-162}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
+    P0=127e5,
+    h0=3e6,
+    P(start=127e5),
+    h(start=3450835.48993987),
+    dynamic_mass_balance=true)        annotation (Placement(transformation(
+        origin={-52,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP(
+    h0=3523910,
+    h(start=3523910),
+    dynamic_mass_balance=true,
+    P0=2400000,
+    P(start=24e5))                        annotation (Placement(transformation(
+        origin={-50,-314},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_Turbine_Valve(
+    h(fixed=false, start=3518000),
+    mode=0,
+    Pm(fixed=false, start=2547000),
+    Cv(start=3.312e6),
+    C1(P(fixed=true, start=25.486e5)),
+    Cvmax=Cvmax_TMP)
+                 annotation (Placement(transformation(extent={{-124,-318},{-104,
+            -298}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneIP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
+            -138,-226}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
+    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
+    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
+    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
+
+  WaterSteam.Volumes.VolumeA SeparateurMP(h(start=3106000), P(start=27.26e+005),
+    rho(start=10))
+    annotation (Placement(transformation(
+        origin={74,-200},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_1(
+    K=1e-4,
+    pro(d(start=10)),
+    h(start=3106000),
+    C1(
+      P(start=27.26e+005),
+      h_vol(start=3106000),
+      Q(start=153),
+      h(start=3106000)),
+    C2(
+      P(start=27.259e+005),
+      h_vol(start=3106000),
+      Q(start=153),
+      h(start=3106000)),
+    Pm(start=2726000)) annotation (Placement(transformation(extent={{88,-182},{102,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_IP_PressureLoss(
+    Q(fixed=true, start=3.09),
+    continuous_flow_reversal=true,
+    h(start=3106000),
+    C1(
+      P(start=27.26e+005),
+      h_vol(start=3106000),
+      h(start=3106000),
+      Q(start=3.09)),
+    C2(
+      P(start=27.259e+005),
+      h_vol(start=3106000),
+      h(start=3106000),
+      Q(start=3.09)),
+    K=K_Dp_HP_IP,
+    Pm(start=2726000)) annotation (Placement(transformation(extent={{134,-210},{
+            154,-190}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe Q_water(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=21000,
+    Finalvalue=15000)
+                   annotation (Placement(transformation(extent={{555,-364},{575,
+            -344}}, rotation=0)));
+  FlueGases.BoundaryConditions.SourceQ SourceFumees(
+    Xso2=0,
+    T0=893.75,
+    Q0=606.94,
+    Xco2=0.0604033,
+    Xh2o=0.076375,
+    Xo2=0.111559)
+    annotation (Placement(transformation(extent={{-451,-92},{-349,-8}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps FuelMassFlowRate(Table=[0,
+        606.941; 10,606.941; 600,50; 650,50]) annotation (Placement(
+        transformation(extent={{-505,-26},{-435,48}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps GasTemperature(Table=[0,
+        893.76; 10,893.76; 600,423.16; 650,423.16]) annotation (Placement(
+        transformation(extent={{-505,-164},{-435,-90}}, rotation=0)));
+equation
+  connect(HP_SuperHeater_3.Cws1, HP_SuperHeater_2.Cws2)
+    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
+        color={255,0,0}));
+  connect(HP_SuperHeater_2.Cws1, HP_SuperHeater_1.Cws2)
+    annotation (Line(points={{-174,-70},{-174,-90},{-64,-90},{-64,-70}}, color=
+          {255,0,0}));
+  connect(HP_SteamValve_Constante.y, HP_SteamValve.Ouv)
+    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
+  connect(HP_SteamValve.C1, HP_Drum.Cv)
+    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
+  connect(HP_DownComer.C1, HP_Drum.Cd)
+    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={0,0,0}));
+  connect(HP_Drum.Cm, HP_Evaporator.Cws2)
+    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}, color={0,0,0}));
+  connect(VolumeEvapHP.Cs, HP_Evaporator.Cws1)
+    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={0,0,0}));
+  connect(VolumeEvapHP.Ce1, HP_DownComer.C2)
+                                      annotation (Line(points={{8,-90},{18,-90}},
+        color={0,0,0}));
+  connect(HP_Economizer_4.Cws1, HP_Economizer_3.Cws2)
+    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
+  connect(IP_Drum.Cm, IP_Evaporator.Cws2)
+    annotation (Line(points={{320,10},{306,10},{306,-30}}, color={0,0,0}));
+  connect(IP_Evaporator.Cws1, VolumeEvapMP.Cs)
+    annotation (Line(points={{306,-70},{306,-90},{308,-90}}, color={0,0,0}));
+  connect(VolumeEvapMP.Ce1, IP_DownComer.C2)
+    annotation (Line(points={{328,-90},{338,-90}}, color={0,0,0}));
+  connect(IP_SteamValve_Constante.y, IP_SteamValve.Ouv)
+    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
+  connect(HP_SuperHeater_1.Cfg2, HP_Evaporator.Cfg1)        annotation (Line(
+      points={{-54,-50},{-54,-50},{-24,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Evaporator.Cfg2, HP_Economizer_4.Cfg1)        annotation (Line(
+      points={{-4,-50},{96,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_4.Cfg2, IP_SuperHeater_1.Cfg1)          annotation (Line(
+      points={{76,-50},{136,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_1.Cfg2, HP_Economizer_3.Cfg1)           annotation (Line(
+      points={{156,-50},{196,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_Evaporator.Cfg2, HP_Economizer_2.Cfg1)           annotation (Line(
+      points={{316,-50},{396,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_2.Cfg2, IP_Economizer.Cfg1)           annotation (Line(
+      points={{416,-50},{456,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_Economizer.Cfg2, HP_Economizer_1.Cfg1)           annotation (Line(
+      points={{476,-50},{516,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_DownComer.C1, IP_Drum.Cd)
+    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={0,0,
+          0}));
+  connect(IP_SuperHeater_2.Cfg2, HP_SuperHeater_1.Cfg1)          annotation (Line(
+      points={{-104,-50},{-74,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_2.Cfg1, HP_SuperHeater_2.Cfg2)           annotation (Line(
+      points={{-124,-50},{-164,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_3.Cfg2, HP_SuperHeater_2.Cfg1)           annotation (Line(
+      points={{-224,-50},{-184,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_SuperHeater_3.Cfg2, IP_SuperHeater_3.Cfg1)           annotation (Line(
+      points={{-284,-50},{-244,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_3.Cws1,IP_SuperHeater_2. Cws2)
+    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
+          {255,0,0}));
+  connect(IP_SuperHeater_1.Cws2, VolumeLP.Ce2) annotation (Line(
+      points={{146,-70},{146,-100}},
+      color={255,0,0},
+      pattern=LinePattern.None));
+  connect(LP_SteamValve.C1, LP_Drum.Cv)
+    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
+  connect(LP_Evaporator.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
+          -70},{566,-90},{572,-90}}, color={0,0,0}));
+  connect(VolumeEvapBP.Ce1, LP_DownComer.C2)
+                                        annotation (Line(points={{592,-90},{600,
+          -90}}, color={0,0,0}));
+  connect(LP_Drum.Cd, LP_DownComer.C1) annotation (Line(points={{618,10},{628,
+          10},{628,-90},{620,-90}}, color={0,0,0}));
+  connect(LP_Economizer.Cfg2, SinkP_Gas.C)     annotation (Line(
+      points={{690,-50},{712.2,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_3.Cfg2, LP_SuperHeater.Cfg1)  annotation (Line(
+      points={{216,-50},{256,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_SuperHeater.Cfg2, IP_Evaporator.Cfg1)  annotation (Line(
+      points={{276,-50},{296,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_1.Cfg2, LP_Evaporator.Cfg1) annotation (Line(
+      points={{536,-50},{556,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_Evaporator.Cfg2, LP_Economizer.Cfg1) annotation (Line(
+      points={{576,-50},{670,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_Drum.Cm, LP_Evaporator.Cws2)
+    annotation (Line(points={{578,10},{566,10},{566,-30}}, color={0,0,0}));
+  connect(IP_SteamValve.C1, IP_Drum.Cv)   annotation (Line(points={{298,50},{
+          320,50}}, color={255,0,0}));
+  connect(HPIP_FeedValve.Ouv, constante_LP_Drum.y)
+    annotation (Line(points={{720,33},{720,38},{727.3,38}}));
+  connect(HP_SuperHeater_3.Cws2, DoubleDebitHP.Ce)
+    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
+        color={255,0,0}));
+  connect(IP_SuperHeater_3.Cws2, DoubleDebitMP.Ce)
+    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
+        color={255,0,0}));
+  connect(VolumeCond1.Cs, Dp_Cond_Out2.C1)
+    annotation (Line(points={{902,-308},{902,-282}}, color={0,0,255}));
+  connect(HPIP_FeedValve.C2, VolumeAlimMPHP.Ce1)
+                                               annotation (Line(points={{730,16},
+          {742,16}}, color={0,0,255}));
+  connect(LP_SuperHeater.Cws2, DoubleDebitBP.Ce)
+    annotation (Line(points={{266,-70},{266,-90}}, color={255,0,0}));
+  connect(DP_IP_Pump.C2, IP_Pump.C1)
+    annotation (Line(points={{790,16},{798,15},{804,16}}, color={0,0,255}));
+  connect(VolumeAlimMPHP.Cs1, DP_IP_Pump.C1) annotation (Line(points={{762,16},{
+          766,15},{766,16},{770,16}}, color={0,0,255}));
+  connect(VolumeAlimMPHP.Cs2, DP_HP_Pump.C1)
+    annotation (Line(points={{752,6},{752,-36},{770,-36}}, color={0,0,255}));
+  connect(DP_HP_Pump.C2, HP_Pump.C1)
+    annotation (Line(points={{790,-36},{804,-36}}, color={0,0,255}));
+  connect(VolumeIP1.Ce2, Dp_LP_Turbine.C2) annotation (Line(points={{418,-239},{
+          418,-278},{354,-278}}, color={255,0,0}));
+  connect(Dp_Cond_Out.C2, LP_Pump.C1)
+    annotation (Line(points={{722,-436},{742,-436}}, color={0,0,255}));
+  connect(ExtractionValve.C2, Dp_Cond_Out1.C1)
+    annotation (Line(points={{822,-436},{840,-436}}, color={0,0,255}));
+  connect(HP_FeedValve.C1, SensorQ_WaterHP.C2)
+    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
+  connect(HP_SteamValve.C2, SensorQ_SteamHP.C1) annotation (Line(points={{
+          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
+  connect(SensorQ_SteamHP.C2, HP_SuperHeater_1.Cws1) annotation (Line(points={{-53.2,
+          1.88},{-53.2,-3.06},{-64,-3.06},{-64,-30}},        color={255,0,0}));
+  connect(IP_FeedValve.C1, SensorQ_WaterMP.C2)
+    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
+  connect(SensorQ_SteamMP.C1, IP_SteamValve.C2) annotation (Line(points={{
+          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
+  connect(SensorQ_SteamMP.C2, IP_SuperHeater_1.Cws1) annotation (Line(points={
+          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
+  connect(SensorQ_SteamBP.C2, LP_SuperHeater.Cws1) annotation (Line(points={{
+          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
+  connect(SensorQ_SteamBP.C1, LP_SteamValve.C2) annotation (Line(points={{
+          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
+  connect(SensorQ_WaterBP.C2, LP_FeedValve.C1) annotation (Line(
+        points={{658.3,40.12},{658.3,50},{650,50}}, color={0,0,255}));
+  connect(SensorQ_WaterBP_Out.C2, HPIP_FeedValve.C1) annotation (Line(points={{700.13,
+          16.2},{705.065,16.2},{705.065,16},{710,16}}, color={0,0,255}));
+  connect(SensorQ_WaterCondenser.C2, Dp_Cond_Out.C1) annotation (Line(points={{680.3,
+          -422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
+  connect(Dp_Cond_In.C2, SensorQ_SteamCondenser.C1) annotation (Line(points={{660,
+          -230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
+  connect(VolumeLP.Ce1, MoitieDebitHP.Cs)
+    annotation (Line(points={{146,-120},{146,-170},{134,-170}}, color={255,0,0}));
+  connect(Dp_Cond_Out1.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,-436},
+          {862,-436},{862,-318},{872,-318}}, color={0,0,255}));
+  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
+          {892,-318}}, color={0,0,255}));
+  connect(IP_SuperHeater_2.Cws1, HP_PressureLoss_2.C2) annotation (Line(points={{-114,-70},
+          {-114,-110},{94,-110}}, color={255,0,0}));
+  connect(HP_PressureLoss_2.C1, VolumeLP.Cs2)
+    annotation (Line(points={{114,-110},{136.2,-110}}, color={255,0,0}));
+  connect(DoubleDebitHP.Cs, HP_Turbine_Valve.C1) annotation (Line(points=
+          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
+  connect(DoubleDebitBP.Cs, Dp_LP_Turbine.C1) annotation (Line(points={{266,-110},
+          {266,-278},{334,-278}}, color={255,0,0}));
+  connect(LP_Pump.C2, ExtractionValve.C1)
+    annotation (Line(points={{762,-436},{802,-436}}, color={0,0,255}));
+  connect(HP_Drum.yLevel,regulation_Niveau_HP. MesureNiveauEau)
+    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
+  connect(regulation_Niveau_HP.SortieReelle1, HP_FeedValve.Ouv)
+    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
+  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
+    annotation (Line(
+      points={{208.7,122},{234,122},{234,110},{261.5,110}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(IP_Drum.yLevel,regulation_Niveau_MP. MesureNiveauEau)
+    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
+  connect(regulation_Niveau_MP.SortieReelle1, IP_FeedValve.Ouv)
+    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
+  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
+    annotation (Line(
+      points={{505.7,123},{529.85,123},{529.85,112},{567.5,112}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(LP_Drum.yLevel,regulation_Niveau_BP. MesureNiveauEau)
+    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
+  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
+    annotation (Line(
+      points={{741.8,-238},{752,-238},{752,-269},{757.5,-269}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(regulation_Niveau_Condenseur.SortieReelle1, ExtractionValve.Ouv)
+    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
+  connect(SensorQ_WaterBP.C1, LP_Economizer.Cws2)
+    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
+  connect(LP_Economizer.Cws1, Dp_Cond_Out2.C2)
+    annotation (Line(points={{680,-70},{680,-186},{902,-186},{902,-258}}));
+  connect(SensorQ_SteamCondenser.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
+    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,-280.9}}));
+  connect(regulation_Niveau_Condenseur.MesureDebitEau, SensorQ_WaterCondenser.Measure)
+    annotation (Line(points={{757.45,-274.95},{750,-274.95},{750,-310},{792,-310},
+          {792,-412},{692.13,-412}}));
+  connect(ConstantVanneHP_Turbine.y, HP_Turbine_Valve.Ouv)
+    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
+  connect(regulation_Niveau_BP.SortieReelle1, LP_SteamValve.Ouv)
+    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
+  connect(LP_FeedValve.Ouv, LP_SteamValve_Constante.y)
+    annotation (Line(points={{640,67},{640,81},{653.4,81}}));
+  connect(HP_Economizer_1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
+          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
+  connect(VolumeECO_HP1_2.Cs, HP_Economizer_2.Cws1) annotation (Line(points={{
+          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
+  connect(HP_Economizer_2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
+          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
+  connect(VolumeECO_HP2_3.Cs, HP_Economizer_3.Cws1) annotation (Line(points={{
+          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
+  connect(HPIP_FeedValve1.C1, HP_Pump.C2)
+    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-36},{824,-36}}));
+  connect(IP_Pump.C2, HPIP_FeedValve2.C1) annotation (Line(points={
+          {824,16},{870,16},{870,-142.8},{804,-142.8}}, color={0,0,255}));
+  connect(StopPumpingMp1.y, HPIP_FeedValve1.Ouv)
+    annotation (Line(
+      points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,-123.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(StopPumpingHP1.y, HPIP_FeedValve2.Ouv)
+    annotation (Line(
+      points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,-163.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(HPIP_FeedValve1.C2, HP_Economizer_1.Cws1) annotation (Line(
+        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
+          -6},{526,-30}}, color={0,0,255}));
+  connect(IP_Economizer.Cws1, HPIP_FeedValve2.C2)
+    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
+  connect(ConstantVanneIP_Turbine.y, IP_Turbine_Valve.Ouv)
+    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
+  connect(HP_Turbine_Valve.C2, VolumePreTHP.Ce) annotation (Line(points={
+          {-104,-230},{-62,-230}}, color={255,0,0}));
+  connect(DoubleDebitMP.Cs, IP_Turbine_Valve.C1) annotation (Line(points=
+          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
+  connect(IP_Turbine_Valve.C2, VolumeIP.Ce1) annotation (Line(
+        points={{-104,-314},{-60,-314}}, color={255,0,0}));
+  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(points={{620,-353},
+          {638,-353},{638,-352},{639,-352.8}}, color={0,0,255}));
+  connect(Condenser.Cse, PuitsCaloporteur.C)
+    annotation (Line(points={{719,-352},{736,-352}}, color={0,0,255}));
+  connect(SensorQ_SteamCondenser.C2, Condenser.Cv) annotation (Line(points={{679.3,
+          -274.2},{679.3,-288.1},{679,-288.1},{679,-304}}, color={0,0,255}));
+  connect(SensorQ_WaterCondenser.C1, Condenser.Cl)
+    annotation (Line(points={{680.3,-402},{679.8,-402},{679.8,-384}}));
+  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
+    annotation (Line(
+      points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(Condenser.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
+    annotation (Line(points={{723,-372.8},{780,-372.8},{780,-326},{732,-326},{732,
+          -263},{757.5,-263}}));
+  connect(LP_Drum.Cs, SensorQ_WaterBP_Out.C1) annotation (Line(points={{578,22},
+          {564,22},{564,16},{642,16},{642,16.2},{687,16.2}}, color={0,0,255}));
+  connect(LP_Drum.Ce1, LP_FeedValve.C2)
+    annotation (Line(points={{618,50},{630,50}}));
+  connect(IP_Drum.Ce1, IP_FeedValve.C2)
+    annotation (Line(points={{358,50},{378,50}}));
+  connect(HP_Drum.Ce1, HP_FeedValve.C2)
+    annotation (Line(points={{38,50},{58,50}}));
+  connect(VolumePreTHP.Cs3, HP_Turbine.Ce) annotation (Line(points={{-42,-230},{
+          -2.2,-230}}, color={255,0,0}));
+  connect(VolumeIP.Cs, IP_Turbine.Ce) annotation (Line(points={{-40,-314},
+          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
+  connect(IP_Turbine.Cs, VolumeIP1.Ce1) annotation (Line(points={{358.2,
+          -230},{408,-230}}, color={255,0,0}));
+  connect(VolumeIP1.Cs, LP_Turbine.Ce) annotation (Line(points={{428,
+          -230},{575.8,-230}}, color={255,0,0}));
+  connect(LP_Turbine.Cs, Dp_Cond_In.C1)
+    annotation (Line(points={{616.2,-230},{640,-230}}, color={255,0,0}));
+  connect(IP_Economizer.Cws2, SensorQ_WaterMP.C1) annotation (Line(points={{
+          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
+  connect(IP_Turbine.MechPower, Alternateur.Wmec2)
+    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
+  connect(LP_Turbine.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
+          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
+  connect(HP_Turbine.MechPower, Alternateur.Wmec3)
+    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
+  connect(heatSource.C[1], HP_Drum.Cex) annotation (Line(points={{18,68.3},{18,
+          50}}, color={191,95,0}));
+  connect(heatSource1.C[1], IP_Drum.Cex) annotation (Line(points={{339,68.3},{
+          339,50}}, color={191,95,0}));
+  connect(heatSource2.C[1], LP_Drum.Cex) annotation (Line(points={{598,64.3},{
+          598,50}}, color={191,95,0}));
+  connect(SensorQ_WaterHP.C1, HP_Economizer_4.Cws2)
+    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
+  connect(IP_Pump.rpm_or_mpower, StopPumpingMp.y)
+    annotation (Line(
+      points={{814,5},{814,0},{904.1,0}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+  connect(HP_Pump.rpm_or_mpower, StopPumpingHP.y)
+    annotation (Line(
+      points={{814,-47},{814,-66},{905.1,-66}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+  connect(LP_Pump.rpm_or_mpower, StopPumpingBP.y) annotation (Line(
+      points={{752,-447},{754,-447},{754,-456},{878,-456},{878,-442},{905.1,-442}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+
+  connect(HP_Turbine.Cs,SeparateurMP. Ce1)   annotation (Line(points={{38.2,-230},
+          {74,-230},{74,-210}}, color={255,0,0}));
+  connect(SeparateurMP.Cs1, HP_PressureLoss_1.C1)
+    annotation (Line(points={{74,-190},{74,-170},{88,-170}}, color={255,0,0}));
+  connect(HP_PressureLoss_1.C2, MoitieDebitHP.Ce)
+    annotation (Line(points={{102,-170},{114,-170}}, color={0,0,255}));
+  connect(SeparateurMP.Cs2, HP_IP_PressureLoss.C1)
+    annotation (Line(points={{84,-200},{134,-200}}, color={255,0,0}));
+  connect(HP_IP_PressureLoss.C2, VolumeIP1.Ce3) annotation (Line(points={{154,-200},
+          {418,-200},{418,-220}}, color={255,0,0}));
+  connect(Q_water.y, SourceCaloporteur.IMassFlow)
+    annotation (Line(points={{576,-354},{582,-354},{582,-341},{596,-341}}));
+  connect(GasTemperature.y, SourceFumees.ITemperature)
+    annotation (Line(points={{-431.5,-127},{-400,-127},{-400,-71}}));
+  connect(FuelMassFlowRate.y, SourceFumees.IMassFlow)
+    annotation (Line(points={{-431.5,11},{-400,11},{-400,-29}}));
+  connect(SourceFumees.C, HP_SuperHeater_3.Cfg1) annotation (Line(
+      points={{-349,-50},{-327.5,-50},{-327.5,-50},{-304,-50}},
+      color={0,0,0},
+      thickness=1));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-550,
+            -460},{950,150}},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-507,-25},{-469,-51}},
+          lineColor={255,0,0},
+          textString=
+               "GT"),
+        Text(
+          extent={{-517,-45},{-411,-72}},
+          lineColor={255,0,0},
+          textString=
+               "Exhaust")}), experiment(StopTime=10000),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end GasTurbineTrip;
diff --git a/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/LoadVariation.mo b/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/LoadVariation.mo
index b15508c8c527f0d56b13e589aae9857f8145eafc..59432051d3696017990860bd9b3eaca4b2a03081 100644
--- a/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/LoadVariation.mo
+++ b/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/LoadVariation.mo
@@ -1,1962 +1,1962 @@
-within ThermoSysPro.Examples.Book.PowerPlants.CombinedCyclePowerPlant;
-model LoadVariation "CCPP model to simulate a load variation from 100% to 50%"
-  parameter Real CstHP(fixed=false,start=7618660.65374636)
-    "Stodola's ellipse coefficient HP";
-  parameter Real EtaIsNomHP(fixed=false,start=0.875)
-    "Turbine HP: Nominal isentropic efficiency ";
-  parameter Real CstMP(fixed=false,start=278905.664031036)
-    "Stodola's ellipse coefficient MP";
-  //parameter Real EtaIsNomMP(fixed=false,start=0.96)
-  //  "Turbine MP: Nominal isentropic efficiency ";
-  parameter Real CstBP(fixed=false,start=13491.6445678148)
-    "Stodola's ellipse coefficient BP";
-  parameter Real EtaIsNomBP(fixed=false,start=0.92)
-    "Turbine MP: Nominal isentropic efficiency ";
-// //
-  //parameter Modelica.SIunits.AbsolutePressure PoutPumpEx(fixed=false,start=22e5)"Flow pressure at the outlet of the pump";
-  //parameter Modelica.SIunits.Length zc(fixed=false,start=1.5) "Condenser water level";
-
-  parameter Real LP_Pump_a1(fixed=false,start=-6000)
-    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-
-  //parameter Real a3_PumpBP(fixed=false,start=400)"Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVHP(fixed=false, start=47829.4)
-    "Maximum CV: steame valve HP Drum  ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVMP(fixed=false, start=47829.4)
-    "Maximum CV: steame valve  Drum MP";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
-    "Maximum CV: steame valve BP Drum ";
-
-  //parameter ThermoSysPro.Units.Cv CvmaxValveWBP(fixed=false,start=10000)
-  //  "Maximum CV: Water valve BP Drum ";
-
-  parameter Real Fouling_SHP(fixed=false,start=0.075)
-    "Sur HP: heat exchange fouling coefficient";
-
-  //parameter Real Fouling_EHP(fixed=false,start=1)
-  //  "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP1(fixed=false,start=0.07)
-    "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP2(fixed=false,start=0.11)
-    "Eco HP2: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP3(fixed=false,start=0.06)
-    "Eco HP3: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP4(fixed=false,start=0.03)
-    "Eco HP4: heat exchange fouling coefficient";
-
-  parameter Real Fouling_SMP(fixed=false,start=0.1358)
-    "Sur MP1: heat exchange fouling coefficient";
-
-  //parameter Real Fouling_SMP(fixed=true,start=0.065)
-  //  "Sur MP1: heat exchange fouling coefficient";
-
-  parameter Real Fouling_EMP(fixed=false,start=0.09)
-    "Eco MP: heat exchange fouling coefficient";
-
-  parameter Real Fouling_EvHP(fixed=false,start=0.24)
-    "Evapo HP: heat exchange fouling coefficient";
-  parameter Real Fouling_EvMP(fixed=false,start=0.08)
-    "Evapo MP: heat exchange fouling coefficient";
-  parameter Real Fouling_EvBP(fixed=false,start=0.09)
-    "Evapo BP: heat exchange fouling coefficient";
-
-  parameter Real Fouling_SBP(fixed=false,start=0.05)
-    "Sur BP: heat exchange fouling coefficient";
-  parameter Real Fouling_EBP(fixed=false,start=0.06)
-    "Eco BP: heat exchange fouling coefficient";
-
-  parameter Real K_HP_DownComer(fixed=false,start=720.183)
-    "HP: Friction pressure loss coefficient";
-  parameter Real K_IP_DownComer(fixed=false,start=1090.9)
-    "MP: Friction pressure loss coefficient";
-  parameter Real K_Dp_HP_2(fixed=false,start=10.)
-    "SMPin: Friction pressure loss coefficient";
-
-  //parameter Real K_PerteChargeZero2(fixed=true,start=1e-4)
-  //  "TurbineMP out: Friction pressure loss coefficient";
-  parameter Real K_Dp_HP_IP(fixed=false,start=1.)
-    "Outlet THP: Friction pressure loss coefficient";
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
-    "Maximum CV input Turbine HP ";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
-    "Maximum CV input Turbine MP ";
-
-  parameter Real C_tau_n(fixed=false,start=14)
-    "Compressor: Nominal compression rate";
-  parameter Real C_is_eff_n(fixed=false,start=0.92)
-    "Compressor: Nominal isentropic efficiency";
-
-  parameter Real T_Qred(fixed=false,start=0.0178)
-    "GazTurbine: reduced mass flow rate";
-  parameter Real T_is_eff_n(fixed=false,start=0.92)
-    "GazTurbine: Nominal isentropic efficiency";
-
-  parameter Real C_Kcham(fixed=false,start=5.05)
-    "CombustionChamber: pressure loss coefficient";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum HP_Drum(
-    L=16.27,
-    Vertical=false,
-    hl(fixed=false, start=1474422.14552527),
-    hv(fixed=false, start=2666558.75582585),
-    Vv(fixed=false),
-    R=1.05,
-    xmv(fixed=false),
-    P(fixed=false, start=12703151.2960688),
-    zl(start=1.05, fixed=true),
-    Mp=5000,
-    Kpa=5,
-    Kvl=1000,
-    Pfond(start=12703151.3),
-    Tp(start=596.924860294475),
-    Cv(Q(fixed=true, start=76.58)))
-                     annotation (Placement(transformation(extent={{38,10},{-2,
-            50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_FeedValve(
-    Cvmax=CvmaxValveAHP,
-    C1(P(start=12721657.0), h_vol(start=1396865.59043578)),
-    h(start=1398000),
-    Cv(start=178),
-    Pm(start=13050700))
-                 annotation (Placement(transformation(extent={{78,46},{58,66}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    HP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_SteamValve(
-    mode=0,
-    C2(h_vol(start=2666558.75582585),P(start=12700000.0)),
-    h(start=2674000),
-    Cv(start=23914.7),
-    Pm(start=12721657.16928),
-    C1(P(start=132.1e5, fixed=true)),
-    Cvmax=CvmaxValveVHP)
-                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_DownComer(
-    z2=0,
-    mode=1,
-    Q(start=150, fixed=true),
-    z1=10.83,
-    K=K_HP_DownComer,
-    C2(P(start=12768600.0)),
-    h(start=1474422.14552527),
-    Pm(start=12704000))
-            annotation (Placement(transformation(
-        origin={28,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,     h(start=1474422.14552527))
-                                           annotation (Placement(transformation(
-          extent={{8,-100},{-12,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Evaporator(
-    Dint=32.8e-3,
-    Ntubes=1476,
-    L=20.7,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
-      Tp(start={607.668721736158,605.187884376142,603.825778846274}),
-      Tp1(start={606.357,604.602,603.578})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=10.83,
-      option_temperature=2,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={5.74e7,2.67e7,1.24e7}),
-      Tp1(start={606.2,604.6,603.7}),
-      h(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134,
-            1459929.875}),
-      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
-      P(start={12758125,12740000,12734000,12730000,12726787})),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.092,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.86442072,
-      p_rho=1.05,
-      Encras(start=0.24)=Fouling_EvHP,
-      K(fixed=false, start=407),      DeltaT(start={106,49,23}),
-      T(start={755.54821777344,673.68082608925,635.57157972092,618.19360351563}),
-      Tm(start={643.15,633.15,626.621}),
-      Tp(start={609.11670087771,605.86035558168,604.13687003529})))
-                          annotation (Placement(transformation(
-        origin={-14,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_4(
-    Ns=3,
-    L=20.726,
-    Dint=0.0266,
-    Ntubes=246,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-3.5e6,-2.63e6,-2e6}),
-      Tp(start={576.803345033827,581.933438017921,585.694098500999}),
-      Tp1(start={575.762,580.856,584.579})),
-    Cws1(P(start=13703700.0), h_vol(start=1306078.18827954)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      z2=0,
-      option_temperature=2,
-inertia=true,
-      dW1(start={3.5e6,2.63e6,2e6}),
-      Tp1(start={577.5,582.6,586.4}),
-      h(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578,
-            1398251.0}),
-      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
-      P(start={13301176,13320000,13338000,13357000,13374658})),
-    Cws2(h(fixed=false, start=1500e3)),
-    ExchangerFlueGasesMetal(
-      Dext=0.0318,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.39069779,
-      p_rho=1.06,
-      Encras(start=0.03)=Fouling_EHP4,
-      K(fixed=true, start=47.53),DeltaT(start={38,29,22}),
-      T(start={618.19360351563,612.7722894387,608.97249438439,606.41162109375}),
-      Tm(start={623.15,613.15,607.844}),
-      Tp(start={577.44979072627,582.41942947968,586.06092597683})))
-                          annotation (Placement(transformation(
-        origin={86,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_1(
-    Ns=3,
-    L=20.4,
-    Dint=0.0324,
-    Ntubes=246,
-    ExchangerWall(e=0.0028, lambda=37.61,
-    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
-      Tp(start={629.445777860324,651.664976699235,671.075818762815}),
-      Tp1(start={629,651,670.})),
-    Cws1(h_vol(start=2665000.0)),
-    Cws2(P(start=12720900.0), h_vol(start=2981170.0)),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=10.25056,
-      p_rho=1.04,
-      Encras(start=0.075)=Fouling_SHP,
-      K(fixed=false, start=34.71),      DeltaT(start={138,108,84}),
-      T(start={788.2431640625,774.65344332519,763.17487871399,755.54821777344}),
-      Tm(start={778.15,768.15,759.527}),
-      Tp(start={631.68675322573,653.38616970968,672.36458008039})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      option_temperature=2,
-      inertia=true,
-      dpfCorr=2,      dW1(start={9.8e6,7.7e6,5.9e6}),
-      Tp1(start={639.5,657,673}),
-      h(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983,
-            2973076.25}),
-      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
-      P(start={12723762,12723600,12723500,12720000,12719000})))
-         annotation (Placement(transformation(
-        origin={-63,-50},
-        extent={{-20,20},{20,-20}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_3(
-    Dint=26.6e-3,
-    Ntubes=1476,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
-      Tp(start={556.530623976228,563.226831750573,565.575075374951}),
-      Tp1(start={555.49,562.473,564.857})),
-    L=20.726,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.6e7,5.6e6,2.1e6}),
-      Tp1(start={558,565,567}),
-      h(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855,
-            1291418.875}),
-      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
-      P(start={13219333,13241000,13261000,13282000,13301176})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=12.451,
-      p_rho=1.08,
-      Encras(start=0.06)=Fouling_EHP3,
-      K(fixed=true, start=36.03),
-      St=5, DeltaT(start={34,12,4.4}),
-      T(start={602.67193603516,579.67183226637,571.50875350574,568.81030273438}),
-      Tm(start={593.15,583.15,571.919}),
-      Tp(start={557.01185690541,563.39937105652,565.63731055685})))      annotation (Placement(
-        transformation(
-        origin={206,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_2(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-5e6,-3e6,-2.e6}),
-      Tp(start={490.631370193221,498.229397165878,502.978053774656}),
-      Tp1(start={490,497.024,501.871})),
-    L=20.767,
-    Ntubes=1107,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={5e6,3e6,2.e6}),
-      Tp1(start={499,503,507}),
-      h(start={854494.5625,915007.018247822,957243.396653824,983786.364226731,
-            986348.9375}),
-      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
-      P(start={13129352,13152000,13175000,13197000,13219333})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=111e-3,
-      CSailettes=2.76134577,
-      p_rho=1.11,
-      Encras(start=0.11)=Fouling_EHP2,
-      K(fixed=true, start=65),
-      St=5, DeltaT(start={36,23,14}),
-      T(start={531.16070556641,523.74706132958,519.01561663699,516.31256103516}),
-      Tm(start={538.15,528.15,521.399}),
-      Tp(start={490.84070882241,498.36081646341,503.06064272486})))      annotation (Placement(
-        transformation(
-        origin={406,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_1(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-9.9999e6,-5e6,-2.4e6}),
-      Tp(start={458.958585923538,468.506814782426,473.132256983258}),
-      Tp1(start={458.001,467.576,472.607})),
-    L=20.726,
-    Ntubes=1107,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={9.9999e6,5e6,2.4e6}),
-      Tp1(start={467.4,476.5,480.9}),
-      h(start={618651.9375,752176.893518976,816707.727773953,847728.424287614,
-            854494.5625}),
-      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
-      dynamic_mass_balance=true,
-      P(start={13034956,13060000,13080000,13100000,13129352})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=8.30057632,
-      p_rho=1.13,
-      Encras(start=0.07)=Fouling_EHP1,
-      K(fixed=true, start=40.),
-      St=5,   DeltaT(start={41,20,10}),
-      T(start={509.31488037109,491.44087131458,484.15889910859,482.59533691406}),
-      Tm(start={503.15,498.15,494.131}),
-      Tp(start={459.37586976399,468.70800090382,473.22896941053})))      annotation (Placement(
-        transformation(
-        origin={526,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_2(
-    Ns=3,
-    L=20.4,
-    Dint=32e-3,
-    Ntubes=246,
-    ExchangerWall(e=3e-3, lambda=27,
-          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
-      Tp(start={714.604505161814,740.492493660215,759.200099714419}),
-      Tp1(start={710.485,734.082,752.527})),
-    Cws2(P(start=127113000.0), h_vol(start=3254970.0)),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.83,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={8.8e6,6.6e6,4.9e6}),
-      Tp1(start={714,735.6,752}),
-      h(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722,
-            3240813.5}),
-      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
-      P(start={12720371,12718000,12716000,12714000,12711007})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      CSailettes=10.2505424803872,
-      p_rho=1.02,
-      Encras(start=0.075)=Fouling_SHP,
-      K(fixed=false, start=34.74),
-      St=5,
-      DeltaT(start={124,93,70}),
-      T(start={850.64624023438,839.40882309811,830.36536707939,822.68170166016}),
-      Tm(start={843.15,833.15,825.24}),
-      Tp(start={717.48312916257,742.56566858011,760.69152533026})))      annotation (Placement(
-        transformation(
-        origin={-174,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_3(
-    Ns=3,
-    L=20.4,
-    Ntubes=246,
-    ExchangerWall(lambda=27,e=5e-3,
-    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
-      Tp(start={793.335674512128,811.477076678823,824.721389633254}),
-      Tp1(start={783.815,803.639,818.56})),
-    Dint=28e-3,
-    Cws2(h(fixed=true, start=3511e3)),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.726,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={6.3e6,4.7e6,3.6e6}),
-      Tp1(start={783.6,801.6,815}),
-      h(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987,
-            3433271.25}),
-      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
-      P(start={12711007,12704000,12697000,12689000,12681000})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      p_rho=1,
-      Encras(start=0.075)=Fouling_SHP,
-      CSailettes=6.59672846,
-      K(fixed=false, start=49.33),
-      St=5,
-      DeltaT(start={97,73,55}),
-      T(start={894.21850585938,885.5393240412,879.47464880089,874.32891845703}),
-      Tm(start={893.15,883.15,875.939}),
-      Tp(start={796.82789474964,814.05266276572,826.6253996051})))      annotation (Placement(
-        transformation(
-        origin={-294,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum IP_Drum(
-    L=16.27,
-    Vertical=false,
-    P0=27.29e5,
-    hl(fixed=false, start=978914.570821827),
-    hv(fixed=false, start=2799158.13966473),
-    Vv(fixed=false),
-    R=1.05,
-    P(fixed=false, start=28.3e5),
-    zl(start=1.05, fixed=true),
-    Kvl=0,
-    Kpa=5,
-    Mp=5000,
-    Cv(Q(fixed=true, start=10.9)),
-    Pfond(start=2732995.0),
-    Tp(start=500.955757665063))
-                     annotation (Placement(transformation(extent={{358,10},{320,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    IP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_FeedValve(
-      Cvmax=CvmaxValveAMP,
-    C1(P(start=2952995.0), h_vol(start=892414.570867188)),
-    h(start=944000),
-    Cv(start=28),
-    Pm(start=2945000))
-                 annotation (Placement(transformation(extent={{398,46},{378,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_SteamValve(
-    Pm(fixed=false, start=2731689.4244255),
-    C2(h_vol(start=2798000),P(start=27.3e5)),
-    h(fixed=false, start=2798000),
-    mode=0,
-    Cv(start=27829.4),
-    Cvmax=CvmaxValveVMP,
-    C1(P(start=28.3e5, fixed=true)))
-                 annotation (Placement(transformation(extent={{298,46},{278,66}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_Evaporator(
-    Dint=32.8e-3,
-    L=20.767,
-    Ntubes=738,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
-      Tp(start={504.957792851478,504.19488464586,503.59993822766}),
-      Tp1(start={504.427,503.806,503.304})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.83,
-      continuous_flow_reversal=true,
-      inertia=true,
-          dW1(start={9.7e7,7.6e6,5.8e6}),
-      Tp1(start={504.5,503.9,503.4}),
-      P(start={2773367.5,2754933.93610513,2745233.82043873,2738517.46232967,2733824.75}),
-      h(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464,980708.125}),
-      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=10.0676093,
-      p_rho=1.1,
-      Encras(start=0.08)=Fouling_EvMP,
-      K(fixed=false, start=46.9),
-      St=5,
-      DeltaT(start={53,41,32}),
-      T(start={565.24822998047,551.20973998682,539.98034586472,531.16070556641}),
-      Tm(start={553.15,543.15,536.901}),
-      Tp(start={505.45492567199,504.57970000924,503.89762940507})))              annotation (Placement(
-        transformation(
-        origin={306,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss IP_DownComer(
-    z2=0,
-    z1=10.83,
-    mode=1,
-    K=K_IP_DownComer,
-    Q(start=22, fixed=true),
-    Pm(start=2734000),
-    h(start=978914.570821827))
-            annotation (Placement(transformation(
-        origin={348,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
-    h(start=978914.570821827),
-    P(start=2834000))                      annotation (Placement(transformation(
-          extent={{328,-100},{308,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_Economizer(
-    ExchangerWall(e=2.6e-3, lambda=47,
-        dW1(start={-3e6,-1.4e6,-740379}),
-      Tp(start={457.584681885759,475.409334769727,486.332585528225}),
-      Tp1(start={456.76,474.926,485.122})),
-    L=20.726,
-    Ns=3,
-    Dint=26.6e-3,
-    Ntubes=246,
-    Cws1(h_vol(start=671235.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.767,
-      z2=0,
-      inertia=true,
-      dW1(start={3e6,1.4e6,740379}),
-      Tp1(start={474,491,499.9}),
-      h(start={565108.5,727745.440528479,829820.124314816,892414.570867187,
-            944505.4375}),
-      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
-      P(start={3124229.75,3148000,3172000,3195000,3216977.75})),
-    Cws2(h(fixed=false, start=990e3)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      CSailettes=7.16188651,
-      p_rho=1.12,
-      Encras(start=0.09)=Fouling_EMP,
-      K(fixed=true, start=50),
-      St=5,
-      DeltaT(start={45,24,13}),
-      T(start={516.31256103516,511.25046295073,508.31162431247,509.31488037109}),
-      Tm(start={533.15,523.15,514.647}),
-      Tp(start={458.18343678065,475.77644311925,486.55770446184})))              annotation (Placement(
-        transformation(
-        origin={466,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_1(
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.3e6,-0.80263e6,
-                                -501864}),
-      Tp(start={557.102699668877,574.070651369638,584.64928514972}),
-      Tp1(start={556.102699668877,573.070651369638,583.64928514972})),
-    L=20.726,
-    Ns=3,
-    Dint=32.8e-3,
-    Ntubes=123,
-    Cws1(h_vol(start=2800000.0),P(start=2.73467e+06)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      CSailettes=14.46509765,
-      p_rho=1.07,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=22.09),
-      St=5,
-      DeltaT(start={45,30,19}),
-      T(start={606.41162109375,604.22099235915,603.06310204059,602.67193603516}),
-      Tm(start={623.15,613.15,603.024}),
-      Tp(start={557.49575399383,574.31250418519,584.79699207547})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.77,
-      dpfCorr=2,
-      inertia=false,
-      dW1(start={1.3e6,0.80263e6,501864}),
-      Tp1(start={557,573,583}),
-      h(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156,
-            3040562.25}),
-      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
-      P(start={2731326.25,2729591.6901521,2728654.3204706,2727686.1714029,
-            2726700})))     annotation (Placement(transformation(
-        origin={146,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB VolumeLP(
-    Ce1(h(start=3091610.0)),
-    h(start=3042573.51976705),
-    P(start=2726000))
-    annotation (Placement(transformation(
-        origin={146,-110},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_2(
-    Ns=3,
-    L=20.4,
-    Dint=39.3e-3,
-    Ntubes=369,
-    ExchangerWall(e=2.6e-3, lambda=36.86,
-    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
-      Tp(start={689.66516778766,716.376344387713,734.591437191304}),
-      Tp1(start={687.7,713.5,731.5})),
-    Cws1(P(start=2576650.0), h_vol(start=3078800.0)),
-    Cws2(P(start=2558540.0), h_vol(start=3342910.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={1.15e7,7.9e6,5.5e6}),
-      Tp1(start={685.6,711,729}),
-      h(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389,
-            3321940.75}),
-      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
-      P(start={2575582.5,2572000,2568000,2563000,2558239})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=92e-3,
-      CSailettes=5.814209831,
-      p_rho=1.03,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=45.22),
-      St=5,
-      DeltaT(start={125,86,60}),
-      T(start={822.68170166016,807.90772072705,797.00284433443,788.2431640625}),
-      Tm(start={813.15,803.15,792.527}),
-      Tp(start={690.93545553661,717.24269857866,735.18209370035})))              annotation (Placement(
-        transformation(
-        origin={-114,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_3(
-    Ns=3,
-    L=20.4,
-    Ntubes=369,
-    Dint=45.6e-3,
-    ExchangerWall(e=2.6e-3, lambda=27,
-    dW1(start={-8e6,-5.5e6,-3.8e6}),
-      Tp(start={788.901616786331,805.674094596818,817.083010473709}),
-      Tp1(start={786.717,804.102,815.901})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={8e6,5.5e6,3.8e6}),
-      Tp1(start={782,798.7,810}),
-      h(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916,
-            3517975.25}),
-      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
-      P(start={2558239,2556000,2554000,2552000,2548600})),
-    Cws2(h(fixed=true, start=3606e3)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=92e-3,
-      Dext=50.8e-3,
-      p_rho=1.01,
-      CSailettes=5.695842178,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=43.23),
-      St=5,
-      DeltaT(start={82,56,38}),
-      T(start={874.32891845703,864.2444076086,856.92248545484,850.64624023438}),
-      Tm(start={873.15,863.15,853.059}),
-      Tp(start={789.92521486539,806.37044583028,817.55662835373})))              annotation (Placement(
-        transformation(
-        origin={-234,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum LP_Drum(
-    Vertical=false,
-    P0=5e5,
-    Vv(fixed=false),
-    L=8,
-    hl(fixed=false, start=549249.519022482),
-    hv(fixed=false, start=2709858.97470349),
-    R=2,
-    zl(start=1.75, fixed=true),
-    Kvl=0,
-    Kpa=5,
-    Mp=5000,
-    P(fixed=false, start=520000),
-    Cv(Q(fixed=true, start=9.23)),
-    Pfond(start=564775.0),
-    Tp(start=406.411032587651))
-                     annotation (Placement(transformation(extent={{618,10},{578,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    LP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_SteamValve(
-    p_rho=3, Cvmax=CvmaxValveVBP,
-    C2(P(start=503542.0), h_vol(start=2709858.97470349)),
-    h(start=2685000),
-    Cv(start=7555),
-    Pm(start=498000))
-                 annotation (Placement(transformation(extent={{558,46},{538,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_FeedValve(
-    C1(h_vol(start=511900.0)),
-    h(fixed=false, start=509000),
-    Pm(fixed=false, start=5.0698e5),
-    Cvmax=250,
-    Cv(start=142.5),
-    C2(P(fixed=true, start=5.2e5)))
-                 annotation (Placement(transformation(extent={{650,46},{630,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss LP_DownComer(
-    z2=0,
-    z1=10.767,
-    K=32766,
-    mode=1,
-    Q(start=20, fixed=false),
-    pro(d(start=934.452746556487)),
-    Pm(start=564000),
-    h(start=549249.519022482))
-            annotation (Placement(transformation(
-        origin={610,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=549249.519022482),
-                                                                       mode=1,
-    V=5,
-    P(start=523000))                                   annotation (Placement(
-        transformation(extent={{592,-100},{572,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_Evaporator(
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
-      Tp(start={433.127441964236,432.076030201586,431.28112439162}),
-      Tp1(start={432.956,431.127,430.61})),
-    L=20.726,
-    Ntubes=984,
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={1.24e7,8.5e6,5.8e6}),
-      Tp1(start={442.5,441.7,441}),
-      h(start={550075.0,765243.011613326,912673.256542569,1013555.73710231,
-            550075.0}),
-      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
-      Q(start={49.787311368631,49.787311368631,49.787311368631,49.787311368631}),
-      P(start={522583.375,488000,487000,486000,485588.46875})),
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=138e-3,
-      CSailettes=11.07985,
-      p_rho=1.14,
-      Encras(start=0.09)=Fouling_EvBP,
-      K(fixed=false, start=46.7),
-      St=5,
-      DeltaT(start={45,31,21}),
-      T(start={482.59533691406,464.53146753441,453.496360082,442.5893859863}),
-      Tm(start={483.15,478.15,472.098}),
-      Tp(start={433.5360639938,432.3549425205,431.471976456})))              annotation (Placement(
-        transformation(
-        origin={566,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_LP_Drum(k=0.25)
-    annotation (Placement(transformation(extent={{742,32},{728,44}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve(
-      Pm(start=5.0698e5), mode=1,
-    C1(h_vol(start=549249.519022482)),
-    h(start=550000),
-    Cv(start=308.931))
-                 annotation (Placement(transformation(extent={{710,12},{730,32}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_SuperHeater(
-    Ns=3,
-    L=20.726,
-    Dint=39.3e-3,
-    Ntubes=123,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.1e6,-782901,-559798}),
-      Tp(start={489.606851797367,513.610203520748,530.080624448955}),
-      Tp1(start={488.486,512.197,529.53})),
-    Cws1(h_vol(start=2642240.0),P(start=484264)),
-    Cws2(h_vol(start=2979330.0)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=222.1e-3,
-      K(fixed=true, start=30.46),
-      CSailettes=3.25763059984175,
-      p_rho=1.09,
-      Encras(start=0.05)=Fouling_SBP,
-      St=5,
-      DeltaT(start={92,66,47}),
-      T(start={568.81030273438,567.21003420557,566.29303411055,565.24822998047}),
-      Tm(start={583.15,573.15,568.703}),
-      Tp(start={489.84170505864,513.76963980951,530.18834052149})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      rugosrel=1e-5,
-      z1=10.767,
-      inertia=false,
-      dpfCorr=0.25,
-      dW1(start={1.1e6,782901,559798}),
-      Tp1(start={485,511,529}),
-      h(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762,
-            2914520.25}),
-      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
-      P(start={510622.6875,505757.57962259,504477.27858572,503172.36919354,501850})))      annotation (Placement(
-        transformation(
-        origin={266,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkP SinkP_Gas(P0=1.044e5)
-    annotation (Placement(transformation(
-        origin={722,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_Economizer(
-    Ns=3,
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
-      Tp(start={398.142807363473,393.825926964772,392.943738968771}),
-      Tp1(start={397.622,392.348,391.516})),
-    Ntubes=3444,
-    L=20.726,
-    Cws1(h_vol(start=195526.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      inertia=true,
-      dpfCorr=0.5,
-      dW1(start={2.45e7,5.5e6,1.17e6}),
-      Tp1(start={409,404.7,404}),
-      h(start={194584.515625,462556.370989432,494648.45288738,501287.069880104,
-            509237.875}),
-      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
-      P(start={1540571.25,1500000,1480000,1450000,1429595.375})),
-    Cws2(h(fixed=false, start=500e3)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=92e-3,
-      CSailettes=11.673758598919,
-      p_rho=1.15,
-      Encras(start=0.06)=Fouling_EBP,
-      K(fixed=true, start=30),
-      St=5,
-      DeltaT(start={23.5,5.3,1.1}),
-      T(start={442.5893859863,403.9873508455,395.0465605839,395.464630127}),
-      Tm(start={423.15,418.15,414.742}),
-      Tp(start={398.4437772187,393.8897987349,392.9569515805})))              annotation (Placement(
-        transformation(
-        origin={680,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine HP_Turbine(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.88057),
-    eta_is_min=0.75,
-    Cst(start=8182844.56002535)=
-        CstHP,
-    Pe(fixed=true, start=125.20e5),
-    Ps(fixed=false, start=2726700),
-    eta_is_nom=EtaIsNomHP,
-    Cs(h(fixed=true, start=3106e3)),
-    pros(d(start=10.0)),
-    Hrs(start=3046260),
-    Qmax=151,
-    a=-1.20211,
-    b=2.32571,
-    c=-0.25) annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
-          rotation=0)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine IP_Turbine(
-    W_fric=1,
-    Ps(fixed=false, start=476800),
-    eta_stato=1,
-    eta_is(start=0.9625),
-    eta_is_min=0.75,
-    Cst(start=256335.364995961)=
-        CstMP,
-    Pe(fixed=true, start=25.13e5),
-    pros(d(start=30.0)),
-    Hrs(start=3029780),
-    Cs(h(fixed=false, start=2990e3)),
-    eta_is_nom=0.96,
-    b=2.4957,
-    Qmax=170,
-    a=-1.2728,
-    c=-0.26202)   annotation (Placement(transformation(extent={{318,-250},{358,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP1(
-    h(start=2997231.36734756),
-    P(start=476799.99999954),
-    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
-        origin={418,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine LP_Turbine(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9538),
-    eta_is_min=0.75,
-    Cst(start=11944.9445735985)=
-        CstBP,
-    Hrs(start=2401030),
-    Pe(fixed=true, start=4.77e5),
-        Ps(start=10053),
-    Cs(h(fixed=true, start=2399.9e3)),
-    eta_is_nom=EtaIsNomBP,
-    Qmax=192,
-    a=-1.22335,
-    b=2.2957,
-    c=-0.14)   annotation (Placement(transformation(extent={{576,-250},{616,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-292,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-232,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(Cs(h(start=3000000)),
-                                                    alpha=0.5)
-    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
-    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    Vf0=0.15,
-    steady_state=false,
-    yNiveau(signal(start=1.5)),
-    Cse(h(start=128076)),
-    P0=6100,
-    P(fixed=false, start=6136),
-    Pfond(start=6200)) annotation (Placement(transformation(extent={{639,-384},
-            {719,-304}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
-    h0=113.38e3, Q0=17224)       annotation (Placement(transformation(extent={{
-            572,-377},{620,-329}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_In(
-    K=1e-4,
-    h(start=2400000),
-    C1(h_vol(start=2400000), h(start=2400000)),
-    Q(start=190.55),
-    Pm(start=10026)) annotation (Placement(transformation(extent={{640,-240},{660,
-            -220}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
-    Ce3(h(start=163768.700887002)),
-    h(start=163768.700887002),
-    P(start=1540500))
-    annotation (Placement(transformation(
-        origin={902,-318},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out2(
-    K=1e-4,
-    mode=1,
-    pro(d(start=993.470128235971)),
-    Pm(start=1540000)) annotation (Placement(transformation(
-        origin={902,-270},
-        extent={{12,-12},{-12,12}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
-    h(start=549249.519022482),
-    P(start=322430))                       annotation (Placement(transformation(
-          extent={{742,6},{762,26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump IP_Pump(
-    a3=350,
-    mode=1,
-    Q(fixed=false, start=10.9),
-    a1=-244551,
-    C1(h_vol(start=576000.0)),
-    C2(h_vol(start=561000.0)),
-    h(start=571000.0),
-    hn(start=317),
-    Qv(start=0.0207237016869104),
-    pro(d(start=930.0)),
-    Pm(start=1725850))
-            annotation (Placement(transformation(extent={{804,6},{824,26}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump HP_Pump(
-    a3=1600,
-    a1=-28056.2,
-    Q(fixed=false),
-    mode=1,
-    C1(h_vol(start=561000.0)),
-    C2(h_vol(start=630000.0)),
-    h(start=630000),
-    hn(start=1413),
-    Qv(start=0.0810383142105344),
-    pro(d(start=929.0)),
-    Pm(start=6774000))  annotation (Placement(transformation(extent={{804,-46},
-            {824,-26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
-                                                    alpha=0.5,
-    h(start=194585),
-    P(start=1540500),
-    Cs(h(start=194585)))
-    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={266,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_LP_Turbine(
-    z2=0,
-    mode=0,
-    z1=0,
-    h(start=3000000),
-    C1(
-      h_vol(start=3000000),
-      h(start=3000000),
-      P(fixed=false, start=5.0185e5)),
-    K=1e-4,
-    Pm(start=490000)) annotation (Placement(transformation(
-        origin={344,-278},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_HP_Pump(
-    K=1e-4,
-    mode=1,
-    C2(h_vol(start=599600)),
-    Pm(start=372718)) annotation (Placement(transformation(
-        origin={780,-36},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_IP_Pump(
-    K=1e-4,
-    mode=1,
-    C2(h_vol(start=599600)),
-    Pm(start=372718)) annotation (Placement(transformation(
-        origin={780,16},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
-    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out(
-    K=1e-4,
-    mode=1,
-    C1(h_vol(start=153206.462779274)),
-    C2(h_vol(start=153206.462779274)),
-    pro(d(start=993.441492649513)),
-    Pm(start=6200)) annotation (Placement(transformation(extent={{702,-446},{722,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump LP_Pump(
-    Qv(start=0.1934),
-    mode=1,
-    a3=400,
-    C2(P(fixed=false, start=16.7e5), h_vol(start=194669.0)),
-    h(start=193000),
-    hn(start=183),
-    a1=LP_Pump_a1,
-    Q(start=193.43, fixed=false),
-    Pm(start=1103065, fixed=false)) annotation (Placement(transformation(extent=
-           {{742,-446},{762,-426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out1(
-    K=1e-4,
-    mode=1,
-    pro(d(start=994.045785814739)),
-    C1(h_vol(start=194585), h(start=194585)),
-    Pm(start=1546000)) annotation (Placement(transformation(extent={{840,-446},{
-            860,-426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ExtractionValve(
-    mode=1,
-    Cvmax=2500,
-    h(start=195000),
-    Cv(start=2000),
-    C1(h_vol(start=195000)),
-    C2(h_vol(start=195000)),
-    Pm(start=1549000)) annotation (Placement(transformation(extent={{802,-440},{
-            822,-420}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamHP(C1(h_vol(start=2674000),
-        h(start=2674000)))
-    annotation (Placement(transformation(
-        origin={-58,8},
-        extent={{-6,6},{6,-6}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterHP(C2(h_vol(start=1398000),
-        h(start=1398000)))
-    annotation (Placement(transformation(
-        origin={91.5,32},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterMP(C2(h_vol(start=944000),
-        h(start=944000)))
-    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamMP(C1(h_vol(start=2798000),
-        h(start=2798000)),C2(h_vol(start=2798000)))
-    annotation (Placement(transformation(
-        origin={236,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamBP(C2(h_vol(start=2685000),
-        h(start=2685000)))
-    annotation (Placement(transformation(
-        origin={514,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP(C2(h_vol(start=550000),
-        h(start=550000)))
-    annotation (Placement(transformation(
-        origin={663.5,34},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP_Out(C2(h_vol(start=
-            550000), h(start=550000))) annotation (Placement(transformation(
-          extent={{687,15},{700,27}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterCondenser(C2(h_vol(start=
-           194585), h(start=194585))) annotation (Placement(transformation(
-        origin={685.5,-412},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamCondenser(C2(h_vol(start=
-           2401000), h(start=2401000))) annotation (Placement(transformation(
-        origin={684.5,-264},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_2(
-    C1(
-      P(fixed=true, start=27.267e5),
-      h_vol(start=3046000),
-      h(start=3046000)),
-    K=K_Dp_HP_2,
-    Pm(start=2651000)) annotation (Placement(transformation(extent={{114,-120},{
-            94,-100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_Turbine_Valve(
-    mode=0,
-    h(fixed=false, start=3433000),
-    Cv(start=10875),
-    Pm(fixed=false, start=12550000),
-    C1(P(fixed=true, start=126.81e5)),
-    Cvmax=Cvmax_THP)
-                 annotation (Placement(transformation(extent={{-124,-234},{-104,
-            -214}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauHP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500,
-    minval=0.007) annotation (Placement(transformation(extent={{-40,106},{-20,
-            126}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauMP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500) annotation (Placement(transformation(extent={{262,106},{282,126}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauBP(                                                              k=1.75)
-    annotation (Placement(transformation(extent={{470,114},{504,132}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
-    add(k1=-1, k2=+1),
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauCondenseur1(                                 k=1.5)
-    annotation (Placement(transformation(extent={{704,-246},{740,-230}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-      add(k1=+1, k2=-1)) annotation (Placement(transformation(extent={{758,-282},
-            {778,-262}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneHP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
-            -138,-142}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp(
-    Initialvalue=1400,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=1300)
-                   annotation (Placement(transformation(extent={{944,-16},{906,
-            16}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP(
-    Initialvalue=1400,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=1300)
-                   annotation (Placement(transformation(extent={{945,-82},{907,
-            -50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingBP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{945,-458},{907,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
-    mode=1,
-    V=1,
-    h0=988332,
-    h(start=988332),
-    P0=70.1e5,
-    P(start=13129000),
-    dynamic_mass_balance=true)            annotation (Placement(transformation(
-          extent={{456,-98},{436,-78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
-    mode=1,
-    V=1,
-    h0=983786,
-    h(start=983786),
-    P0=70.0e5,
-    P(start=13219000),
-    dynamic_mass_balance=true)            annotation (Placement(transformation(
-          extent={{252,-20},{232,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve1(
-                          mode=1,
-    Cvmax=308.931,
-    h(start=618600),
-    Cv(start=308.931),
-    C1(h_vol(start=618600)),
-    Pm(start=13130000))
-                 annotation (Placement(transformation(extent={{754,-98},{730,
-            -122}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve2(
-      Pm(start=3126000), mode=1,
-    Q(start=10.9, fixed=false),
-    h(start=565000),
-    C1(h_vol(start=565000)),
-    Cv(start=308.931),
-    Cvmax=308.931)
-                 annotation (Placement(transformation(extent={{804,-138},{780,
-            -162}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp1(
-    Initialvalue=0.8,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=0.4)  annotation (Placement(transformation(extent={{946,-150},{
-            908,-118}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP1(
-    Initialvalue=0.8,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=0.4)  annotation (Placement(transformation(extent={{946,-194},{
-            908,-162}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
-    P0=127e5,
-    h0=3e6,
-    P(start=127e5),
-    h(start=3450835.48993987),
-    dynamic_mass_balance=true)        annotation (Placement(transformation(
-        origin={-52,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP(
-    h0=3523910,
-    h(start=3523910),
-    dynamic_mass_balance=true,
-    P0=2400000,
-    P(start=24e5))                        annotation (Placement(transformation(
-        origin={-50,-314},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_Turbine_Valve(
-    h(fixed=false, start=3518000),
-    mode=0,
-    Pm(fixed=false, start=2547000),
-    Cv(start=3.312e6),
-    C1(P(fixed=true, start=25.486e5)),
-    Cvmax=Cvmax_TMP)
-                 annotation (Placement(transformation(extent={{-124,-318},{-104,
-            -298}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneIP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
-            -138,-226}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
-    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
-    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
-    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Gain Gain_2GasTurbine(Gain=
-       2) annotation (Placement(transformation(extent={{-18,-448},{2,-428}},
-          rotation=0)));
-  Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible(
-    Hum=0,
-    rho=0.838,
-    T0=185 + 273.16,
-    Cp=2255,
-    LHV=46989e3,
-    Xo=0.000,
-    Xn=0.000,
-    Xs=0.000,
-    Xc=0.74,
-    Xh=0.25,
-    Q0=13.521)
-          annotation (Placement(transformation(extent={{-421,24},{-385,60}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ sourceEau(             Q0=0.0)
-          annotation (Placement(transformation(extent={{-473,27},{-445,57}},
-          rotation=0)));
-  FlueGases.BoundaryConditions.SourcePQ SourceFumees(
-    Xso2=0,
-    Xco2=0,
-    Xh2o=0,
-    Xo2=0.20994,
-    T0=29.4 + 273.16,
-    P0=1.003e5,
-    Q0=592.76 + 0.66)
-    annotation (Placement(transformation(extent={{-539,-74},{-495,-28}},
-          rotation=0)));
-  FlueGases.TAC.GasTurbine GasTurbine(
-    Kcham=1.114801,
-    exp_eff_n=0.90,
-    comp_eff_n=0.9,
-    TurbQred=0.01731,
-    comp_tau_n=14.0,
-    Wpth=1.2707e6,
-    exp_tau_n=0.079,
-    chambreCombustionTAC(
-      Psf(fixed=false, start=13.16e5),
-      Pea(fixed=true, start=14.042e5),
-      kcham=C_Kcham,
-      Tea(start=680)),
-    TurbineAgaz(
-      Ps(fixed=false),
-      A3=0,
-      A2=-0.04778,
-      A1=0.09555,
-      A0=0.95223,
-      Wmech(fixed=false, start=227.3e6),
-      Pe(fixed=false, start=13.3e5),
-      is_eff(fixed=false, start=0.92),
-      Ts(fixed=true, start=893.76),
-      is_eff_n=T_is_eff_n,
-      Qred=T_Qred,
-      tau_n=0.079094,
-      tau(fixed=true, start=0.079094),
-      Tis(start=828)),
-    Compresseur(
-      tau(fixed=false, start=14),
-      is_eff_n=C_is_eff_n,
-      is_eff(fixed=true, start=0.76),
-      Xtau(fixed=true, start=1),
-      Tis(start=630),
-      Ts(start=680),
-      tau_n(start=14)=C_tau_n))
-    annotation (Placement(transformation(extent={{-471,-115},{-341,13}},
-          rotation=0)));
-
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeQfuel(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=13.521,
-    Finalvalue=7.804)
-                     annotation (Placement(transformation(extent={{-538,80},{
-            -518,100}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe Humidite(
-    Starttime=200,
-    Initialvalue=1,
-    Finalvalue=0.8,
-    Duration=800)
-    annotation (Placement(transformation(extent={{-538,20},{-517,40}}, rotation=
-           0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeIQair(
-    Starttime=200,
-    Initialvalue=592.76 + 0.66,
-    Finalvalue=384.3,
-    Duration=800)  annotation (Placement(transformation(extent={{-539,-20},{
-            -519,0}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeTair(
-    Starttime=200,
-    Initialvalue=302.56,
-    Finalvalue=305.16,
-    Duration=800)  annotation (Placement(transformation(extent={{-539,-100},{
-            -519,-80}}, rotation=0)));
-  WaterSteam.Volumes.VolumeA SeparateurMP(h(start=3106000), P(start=27.26e+005),
-    rho(start=10))
-    annotation (Placement(transformation(
-        origin={74,-200},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_1(
-    K=1e-4,
-    pro(d(start=10)),
-    h(start=3106000),
-    C1(
-      P(start=27.26e+005),
-      h_vol(start=3106000),
-      Q(start=153),
-      h(start=3106000)),
-    C2(
-      P(start=27.259e+005),
-      h_vol(start=3106000),
-      Q(start=153),
-      h(start=3106000)),
-    Pm(start=2726000)) annotation (Placement(transformation(extent={{88,-182},{102,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_IP_PressureLoss(
-    Q(fixed=true, start=3.09),
-    continuous_flow_reversal=true,
-    h(start=3106000),
-    C1(
-      P(start=27.26e+005),
-      h_vol(start=3106000),
-      h(start=3106000),
-      Q(start=3.09)),
-    C2(
-      P(start=27.259e+005),
-      h_vol(start=3106000),
-      h(start=3106000),
-      Q(start=3.09)),
-    K=K_Dp_HP_IP,
-    Pm(start=2726000)) annotation (Placement(transformation(extent={{134,-210},{
-            154,-190}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe Q_water(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=21000,
-    Finalvalue=15000)
-                   annotation (Placement(transformation(extent={{555,-364},{575,
-            -344}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampePout(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=1.044e5,
-    Finalvalue=1.028e5)
-                   annotation (Placement(transformation(extent={{711,-84},{731,
-            -64}}, rotation=0)));
-equation
-  connect(HP_SuperHeater_3.Cws1, HP_SuperHeater_2.Cws2)
-    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
-        color={255,0,0}));
-  connect(HP_SuperHeater_2.Cws1, HP_SuperHeater_1.Cws2)
-    annotation (Line(points={{-174,-70},{-174,-90},{-63,-90},{-63,-70}}, color=
-          {255,0,0}));
-  connect(HP_SteamValve_Constante.y, HP_SteamValve.Ouv)
-    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
-  connect(HP_SteamValve.C1, HP_Drum.Cv)
-    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
-  connect(HP_DownComer.C1, HP_Drum.Cd)
-    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={0,0,0}));
-  connect(HP_Drum.Cm, HP_Evaporator.Cws2)
-    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}, color={0,0,0}));
-  connect(VolumeEvapHP.Cs, HP_Evaporator.Cws1)
-    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={0,0,0}));
-  connect(VolumeEvapHP.Ce1, HP_DownComer.C2)
-                                      annotation (Line(points={{8,-90},{18,-90}},
-        color={0,0,0}));
-  connect(HP_Economizer_4.Cws1, HP_Economizer_3.Cws2)
-    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
-  connect(IP_Drum.Cm, IP_Evaporator.Cws2)
-    annotation (Line(points={{320,10},{306,10},{306,-30}}, color={0,0,0}));
-  connect(IP_Evaporator.Cws1, VolumeEvapMP.Cs)
-    annotation (Line(points={{306,-70},{306,-90},{308,-90}}, color={0,0,0}));
-  connect(VolumeEvapMP.Ce1, IP_DownComer.C2)
-    annotation (Line(points={{328,-90},{338,-90}}, color={0,0,0}));
-  connect(IP_SteamValve_Constante.y, IP_SteamValve.Ouv)
-    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
-  connect(HP_SuperHeater_1.Cfg2, HP_Evaporator.Cfg1)        annotation (Line(
-      points={{-53,-50},{-53,-50},{-24,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Evaporator.Cfg2, HP_Economizer_4.Cfg1)        annotation (Line(
-      points={{-4,-50},{96,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_4.Cfg2, IP_SuperHeater_1.Cfg1)          annotation (Line(
-      points={{76,-50},{136,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_1.Cfg2, HP_Economizer_3.Cfg1)           annotation (Line(
-      points={{156,-50},{196,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_Evaporator.Cfg2, HP_Economizer_2.Cfg1)           annotation (Line(
-      points={{316,-50},{396,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_2.Cfg2, IP_Economizer.Cfg1)           annotation (Line(
-      points={{416,-50},{456,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_Economizer.Cfg2, HP_Economizer_1.Cfg1)           annotation (Line(
-      points={{476,-50},{516,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_DownComer.C1, IP_Drum.Cd)
-    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={0,0,
-          0}));
-  connect(IP_SuperHeater_2.Cfg2, HP_SuperHeater_1.Cfg1)          annotation (Line(
-      points={{-104,-50},{-73,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_2.Cfg1, HP_SuperHeater_2.Cfg2)           annotation (Line(
-      points={{-124,-50},{-164,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_3.Cfg2, HP_SuperHeater_2.Cfg1)           annotation (Line(
-      points={{-224,-50},{-184,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_SuperHeater_3.Cfg2, IP_SuperHeater_3.Cfg1)           annotation (Line(
-      points={{-284,-50},{-244,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_3.Cws1,IP_SuperHeater_2. Cws2)
-    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
-          {255,0,0}));
-  connect(IP_SuperHeater_1.Cws2, VolumeLP.Ce2) annotation (Line(
-      points={{146,-70},{146,-100}},
-      color={255,0,0},
-      pattern=LinePattern.None));
-  connect(LP_SteamValve.C1, LP_Drum.Cv)
-    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
-  connect(LP_Evaporator.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
-          -70},{566,-90},{572,-90}}, color={0,0,0}));
-  connect(VolumeEvapBP.Ce1, LP_DownComer.C2)
-                                        annotation (Line(points={{592,-90},{600,
-          -90}}, color={0,0,0}));
-  connect(LP_Drum.Cd, LP_DownComer.C1) annotation (Line(points={{618,10},{628,
-          10},{628,-90},{620,-90}}, color={0,0,0}));
-  connect(LP_Economizer.Cfg2, SinkP_Gas.C)     annotation (Line(
-      points={{690,-50},{712.2,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_3.Cfg2, LP_SuperHeater.Cfg1)  annotation (Line(
-      points={{216,-50},{256,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_SuperHeater.Cfg2, IP_Evaporator.Cfg1)  annotation (Line(
-      points={{276,-50},{296,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_1.Cfg2, LP_Evaporator.Cfg1) annotation (Line(
-      points={{536,-50},{556,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_Evaporator.Cfg2, LP_Economizer.Cfg1) annotation (Line(
-      points={{576,-50},{670,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_Drum.Cm, LP_Evaporator.Cws2)
-    annotation (Line(points={{578,10},{566,10},{566,-30}}, color={0,0,0}));
-  connect(IP_SteamValve.C1, IP_Drum.Cv)   annotation (Line(points={{298,50},{
-          320,50}}, color={255,0,0}));
-  connect(HPIP_FeedValve.Ouv, constante_LP_Drum.y)
-    annotation (Line(points={{720,33},{720,38},{727.3,38}}));
-  connect(HP_SuperHeater_3.Cws2, DoubleDebitHP.Ce)
-    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
-        color={255,0,0}));
-  connect(IP_SuperHeater_3.Cws2, DoubleDebitMP.Ce)
-    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
-        color={255,0,0}));
-  connect(VolumeCond1.Cs, Dp_Cond_Out2.C1)
-    annotation (Line(points={{902,-308},{902,-282}}, color={0,0,255}));
-  connect(HPIP_FeedValve.C2, VolumeAlimMPHP.Ce1)
-                                               annotation (Line(points={{730,16},
-          {742,16}}, color={0,0,255}));
-  connect(LP_SuperHeater.Cws2, DoubleDebitBP.Ce)
-    annotation (Line(points={{266,-70},{266,-90}}, color={255,0,0}));
-  connect(DP_IP_Pump.C2, IP_Pump.C1)
-    annotation (Line(points={{790,16},{798,15},{804,16}}, color={0,0,255}));
-  connect(VolumeAlimMPHP.Cs1, DP_IP_Pump.C1) annotation (Line(points={{762,16},{
-          766,15},{766,16},{770,16}}, color={0,0,255}));
-  connect(VolumeAlimMPHP.Cs2, DP_HP_Pump.C1)
-    annotation (Line(points={{752,6},{752,-36},{770,-36}}, color={0,0,255}));
-  connect(DP_HP_Pump.C2, HP_Pump.C1)
-    annotation (Line(points={{790,-36},{804,-36}}, color={0,0,255}));
-  connect(VolumeIP1.Ce2, Dp_LP_Turbine.C2) annotation (Line(points={{418,-239},{
-          418,-278},{354,-278}}, color={255,0,0}));
-  connect(Dp_Cond_Out.C2, LP_Pump.C1)
-    annotation (Line(points={{722,-436},{742,-436}}, color={0,0,255}));
-  connect(ExtractionValve.C2, Dp_Cond_Out1.C1)
-    annotation (Line(points={{822,-436},{840,-436}}, color={0,0,255}));
-  connect(HP_FeedValve.C1, SensorQ_WaterHP.C2)
-    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
-  connect(HP_SteamValve.C2, SensorQ_SteamHP.C1) annotation (Line(points={{
-          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
-  connect(SensorQ_SteamHP.C2, HP_SuperHeater_1.Cws1) annotation (Line(points={{-53.2,
-          1.88},{-53.2,-3.06},{-63,-3.06},{-63,-30}},        color={255,0,0}));
-  connect(IP_FeedValve.C1, SensorQ_WaterMP.C2)
-    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
-  connect(SensorQ_SteamMP.C1, IP_SteamValve.C2) annotation (Line(points={{
-          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
-  connect(SensorQ_SteamMP.C2, IP_SuperHeater_1.Cws1) annotation (Line(points={
-          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
-  connect(SensorQ_SteamBP.C2, LP_SuperHeater.Cws1) annotation (Line(points={{
-          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
-  connect(SensorQ_SteamBP.C1, LP_SteamValve.C2) annotation (Line(points={{
-          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
-  connect(SensorQ_WaterBP.C2, LP_FeedValve.C1) annotation (Line(
-        points={{658.3,40.12},{658.3,50},{650,50}}, color={0,0,255}));
-  connect(SensorQ_WaterBP_Out.C2, HPIP_FeedValve.C1) annotation (Line(points={{
-          700.13,16.2},{705.065,16.2},{705.065,16},{710,16}}, color={0,0,255}));
-  connect(SensorQ_WaterCondenser.C2, Dp_Cond_Out.C1) annotation (Line(points={{
-          680.3,-422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
-  connect(Dp_Cond_In.C2, SensorQ_SteamCondenser.C1) annotation (Line(points={{
-          660,-230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
-  connect(VolumeLP.Ce1, MoitieDebitHP.Cs)
-    annotation (Line(points={{146,-120},{146,-170},{134,-170}}, color={255,0,0}));
-  connect(Dp_Cond_Out1.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,-436},
-          {862,-436},{862,-318},{872,-318}}, color={0,0,255}));
-  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
-          {892,-318}}, color={0,0,255}));
-  connect(IP_SuperHeater_2.Cws1, HP_PressureLoss_2.C2) annotation (Line(points={{-114,-70},
-          {-114,-110},{94,-110}}, color={255,0,0}));
-  connect(HP_PressureLoss_2.C1, VolumeLP.Cs2)
-    annotation (Line(points={{114,-110},{136.2,-110}}, color={255,0,0}));
-  connect(DoubleDebitHP.Cs, HP_Turbine_Valve.C1) annotation (Line(points=
-          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
-  connect(DoubleDebitBP.Cs, Dp_LP_Turbine.C1) annotation (Line(points={{266,-110},
-          {266,-278},{334,-278}}, color={255,0,0}));
-  connect(LP_Pump.C2, ExtractionValve.C1)
-    annotation (Line(points={{762,-436},{802,-436}}, color={0,0,255}));
-  connect(HP_Drum.yLevel,regulation_Niveau_HP. MesureNiveauEau)
-    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
-  connect(regulation_Niveau_HP.SortieReelle1, HP_FeedValve.Ouv)
-    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
-  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
-    annotation (Line(
-      points={{208.7,122},{234,122},{234,110},{261.5,110}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(IP_Drum.yLevel,regulation_Niveau_MP. MesureNiveauEau)
-    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
-  connect(regulation_Niveau_MP.SortieReelle1, IP_FeedValve.Ouv)
-    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
-  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
-    annotation (Line(
-      points={{505.7,123},{529.85,123},{529.85,112},{567.5,112}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(LP_Drum.yLevel,regulation_Niveau_BP. MesureNiveauEau)
-    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
-  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
-    annotation (Line(
-      points={{741.8,-238},{752,-238},{752,-269},{757.5,-269}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(regulation_Niveau_Condenseur.SortieReelle1, ExtractionValve.Ouv)
-    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
-  connect(SensorQ_WaterBP.C1, LP_Economizer.Cws2)
-    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
-  connect(LP_Economizer.Cws1, Dp_Cond_Out2.C2)
-    annotation (Line(points={{680,-70},{680,-186},{902,-186},{902,-258}}));
-  connect(SensorQ_SteamCondenser.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
-    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,-280.9}}));
-  connect(regulation_Niveau_Condenseur.MesureDebitEau, SensorQ_WaterCondenser.Measure)
-    annotation (Line(points={{757.45,-274.95},{750,-274.95},{750,-310},{792,-310},
-          {792,-412},{692.13,-412}}));
-  connect(ConstantVanneHP_Turbine.y, HP_Turbine_Valve.Ouv)
-    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
-  connect(regulation_Niveau_BP.SortieReelle1, LP_SteamValve.Ouv)
-    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
-  connect(LP_FeedValve.Ouv, LP_SteamValve_Constante.y)
-    annotation (Line(points={{640,67},{640,81},{653.4,81}}));
-  connect(HP_Economizer_1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
-          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
-  connect(VolumeECO_HP1_2.Cs, HP_Economizer_2.Cws1) annotation (Line(points={{
-          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
-  connect(HP_Economizer_2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
-          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
-  connect(VolumeECO_HP2_3.Cs, HP_Economizer_3.Cws1) annotation (Line(points={{
-          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
-  connect(HPIP_FeedValve1.C1, HP_Pump.C2)
-    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-36},{824,-36}}));
-  connect(IP_Pump.C2, HPIP_FeedValve2.C1) annotation (Line(points={
-          {824,16},{870,16},{870,-142.8},{804,-142.8}}, color={0,0,255}));
-  connect(StopPumpingMp1.y, HPIP_FeedValve1.Ouv)
-    annotation (Line(
-      points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,-123.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(StopPumpingHP1.y, HPIP_FeedValve2.Ouv)
-    annotation (Line(
-      points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,-163.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(HPIP_FeedValve1.C2, HP_Economizer_1.Cws1) annotation (Line(
-        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
-          -6},{526,-30}}, color={0,0,255}));
-  connect(IP_Economizer.Cws1, HPIP_FeedValve2.C2)
-    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
-  connect(ConstantVanneIP_Turbine.y, IP_Turbine_Valve.Ouv)
-    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
-  connect(HP_Turbine_Valve.C2, VolumePreTHP.Ce) annotation (Line(points={
-          {-104,-230},{-62,-230}}, color={255,0,0}));
-  connect(DoubleDebitMP.Cs, IP_Turbine_Valve.C1) annotation (Line(points=
-          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
-  connect(IP_Turbine_Valve.C2, VolumeIP.Ce1) annotation (Line(
-        points={{-104,-314},{-60,-314}}, color={255,0,0}));
-  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(points={{620,-353},
-          {638,-353},{638,-352},{639,-352.8}}, color={0,0,255}));
-  connect(Condenser.Cse, PuitsCaloporteur.C)
-    annotation (Line(points={{719,-352},{736,-352}}, color={0,0,255}));
-  connect(SensorQ_SteamCondenser.C2, Condenser.Cv) annotation (Line(points={{
-          679.3,-274.2},{679.3,-288.1},{679,-288.1},{679,-304}}, color={0,0,255}));
-  connect(SensorQ_WaterCondenser.C1, Condenser.Cl)
-    annotation (Line(points={{680.3,-402},{679.8,-402},{679.8,-384}}));
-  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
-    annotation (Line(
-      points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(Condenser.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
-    annotation (Line(points={{723,-372.8},{780,-372.8},{780,-326},{732,-326},{
-          732,-263},{757.5,-263}}));
-  connect(LP_Drum.Cs, SensorQ_WaterBP_Out.C1) annotation (Line(points={{578,22},
-          {564,22},{564,16},{642,16},{642,16.2},{687,16.2}}, color={0,0,255}));
-  connect(LP_Drum.Ce1, LP_FeedValve.C2)
-    annotation (Line(points={{618,50},{630,50}}));
-  connect(IP_Drum.Ce1, IP_FeedValve.C2)
-    annotation (Line(points={{358,50},{378,50}}));
-  connect(HP_Drum.Ce1, HP_FeedValve.C2)
-    annotation (Line(points={{38,50},{58,50}}));
-  connect(VolumePreTHP.Cs3, HP_Turbine.Ce) annotation (Line(points={{-42,-230},{
-          -2.2,-230}}, color={255,0,0}));
-  connect(VolumeIP.Cs, IP_Turbine.Ce) annotation (Line(points={{-40,-314},
-          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
-  connect(IP_Turbine.Cs, VolumeIP1.Ce1) annotation (Line(points={{358.2,
-          -230},{408,-230}}, color={255,0,0}));
-  connect(VolumeIP1.Cs, LP_Turbine.Ce) annotation (Line(points={{428,
-          -230},{575.8,-230}}, color={255,0,0}));
-  connect(LP_Turbine.Cs, Dp_Cond_In.C1)
-    annotation (Line(points={{616.2,-230},{640,-230}}, color={255,0,0}));
-  connect(IP_Economizer.Cws2, SensorQ_WaterMP.C1) annotation (Line(points={{
-          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
-  connect(IP_Turbine.MechPower, Alternateur.Wmec2)
-    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
-  connect(LP_Turbine.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
-          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
-  connect(HP_Turbine.MechPower, Alternateur.Wmec3)
-    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
-  connect(heatSource.C[1], HP_Drum.Cex) annotation (Line(points={{18,68.3},{18,
-          50}}, color={191,95,0}));
-  connect(heatSource1.C[1], IP_Drum.Cex) annotation (Line(points={{339,68.3},{
-          339,50}}, color={191,95,0}));
-  connect(heatSource2.C[1], LP_Drum.Cex) annotation (Line(points={{598,64.3},{
-          598,50}}, color={191,95,0}));
-  connect(Gain_2GasTurbine.y, Alternateur.Wmec5)
-    annotation (Line(points={{3,-438},{402,-438}}));
-  connect(SensorQ_WaterHP.C1, HP_Economizer_4.Cws2)
-    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
-  connect(IP_Pump.rpm_or_mpower, StopPumpingMp.y)
-    annotation (Line(
-      points={{814,5},{814,0},{904.1,0}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-  connect(HP_Pump.rpm_or_mpower, StopPumpingHP.y)
-    annotation (Line(
-      points={{814,-47},{814,-66},{905.1,-66}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-  connect(LP_Pump.rpm_or_mpower, StopPumpingBP.y) annotation (Line(
-      points={{752,-447},{754,-447},{754,-456},{878,-456},{878,-442},{905.1,-442}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-
-  connect(SourceFumees.C,GasTurbine. Entree_air)
-                                                annotation (Line(
-      points={{-495,-51},{-471,-51}},
-      color={0,0,0},
-      thickness=1));
-  connect(sourceCombustible.C,GasTurbine. Entree_combustible) annotation (Line(
-        points={{-385,42},{-367,42},{-367,13}}, color={0,0,0}));
-  connect(sourceEau.C,GasTurbine. Entree_eau_combustion)
-    annotation (Line(points={{-445,42},{-445,13}}, color={0,0,255}));
-  connect(GasTurbine.Sortie_fumees, HP_SuperHeater_3.Cfg1) annotation (Line(
-      points={{-341,-51},{-290,-50},{-304,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(GasTurbine.PuissanceMeca, Gain_2GasTurbine.u)
-    annotation (Line(points={{-338.4,-76.6},{-326,-76.6},{-326,-438},{-19,-438}},
-        color={0,0,255}));
-  connect(sourceCombustible.IMassFlow,rampeQfuel. y)
-    annotation (Line(
-      points={{-403,51},{-403,90},{-517,90}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(Humidite.y, GasTurbine.Huminide)
-    annotation (Line(
-      points={{-515.95,30},{-492,30},{-492,-12.6},{-473.6,-12.6}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(rampeIQair.y,SourceFumees. IMassFlow)
-    annotation (Line(
-      points={{-518,-10},{-518,-36},{-517,-36},{-517,-39.5}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(rampeTair.y, SourceFumees.ITemperature)
-    annotation (Line(
-      points={{-518,-90},{-516,-90},{-516,-88},{-517,-88},{-517,-62.5}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(HP_Turbine.Cs,SeparateurMP. Ce1)   annotation (Line(points={{38.2,-230},
-          {74,-230},{74,-210}}, color={255,0,0}));
-  connect(SeparateurMP.Cs1, HP_PressureLoss_1.C1)
-    annotation (Line(points={{74,-190},{74,-170},{88,-170}}, color={255,0,0}));
-  connect(HP_PressureLoss_1.C2, MoitieDebitHP.Ce)
-    annotation (Line(points={{102,-170},{114,-170}}, color={0,0,255}));
-  connect(SeparateurMP.Cs2, HP_IP_PressureLoss.C1)
-    annotation (Line(points={{84,-200},{134,-200}}, color={255,0,0}));
-  connect(HP_IP_PressureLoss.C2, VolumeIP1.Ce3) annotation (Line(points={{154,-200},
-          {418,-200},{418,-220}}, color={255,0,0}));
-  connect(Q_water.y, SourceCaloporteur.IMassFlow)
-    annotation (Line(points={{576,-354},{582,-354},{582,-341},{596,-341}}));
-  connect(rampePout.y, SinkP_Gas.IPressure)
-    annotation (Line(points={{732,-74},{752,-74},{752,-50},{727,-50}}));
-  annotation (Diagram(graphics,
-                      coordinateSystem(preserveAspectRatio=false,extent={{-550,
-            -460},{950,150}},
-        initialScale=0.1)), Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    experiment(StopTime=2500),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end LoadVariation;
+within ThermoSysPro.Examples.Book.PowerPlants.CombinedCyclePowerPlant;
+model LoadVariation "CCPP model to simulate a load variation from 100% to 50%"
+  parameter Real CstHP(fixed=false,start=7618660.65374636)
+    "Stodola's ellipse coefficient HP";
+  parameter Real EtaIsNomHP(fixed=false,start=0.875)
+    "Turbine HP: Nominal isentropic efficiency ";
+  parameter Real CstMP(fixed=false,start=278905.664031036)
+    "Stodola's ellipse coefficient MP";
+  //parameter Real EtaIsNomMP(fixed=false,start=0.96)
+  //  "Turbine MP: Nominal isentropic efficiency ";
+  parameter Real CstBP(fixed=false,start=13491.6445678148)
+    "Stodola's ellipse coefficient BP";
+  parameter Real EtaIsNomBP(fixed=false,start=0.92)
+    "Turbine MP: Nominal isentropic efficiency ";
+// //
+  //parameter Modelica.SIunits.AbsolutePressure PoutPumpEx(fixed=false,start=22e5)"Flow pressure at the outlet of the pump";
+  //parameter Modelica.SIunits.Length zc(fixed=false,start=1.5) "Condenser water level";
+
+  parameter Real LP_Pump_a1(fixed=false,start=-6000)
+    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+
+  //parameter Real a3_PumpBP(fixed=false,start=400)"Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVHP(fixed=false, start=47829.4)
+    "Maximum CV: steame valve HP Drum  ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVMP(fixed=false, start=47829.4)
+    "Maximum CV: steame valve  Drum MP";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
+    "Maximum CV: steame valve BP Drum ";
+
+  //parameter ThermoSysPro.Units.Cv CvmaxValveWBP(fixed=false,start=10000)
+  //  "Maximum CV: Water valve BP Drum ";
+
+  parameter Real Fouling_SHP(fixed=false,start=0.075)
+    "Sur HP: heat exchange fouling coefficient";
+
+  //parameter Real Fouling_EHP(fixed=false,start=1)
+  //  "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP1(fixed=false,start=0.07)
+    "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP2(fixed=false,start=0.11)
+    "Eco HP2: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP3(fixed=false,start=0.06)
+    "Eco HP3: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP4(fixed=false,start=0.03)
+    "Eco HP4: heat exchange fouling coefficient";
+
+  parameter Real Fouling_SMP(fixed=false,start=0.1358)
+    "Sur MP1: heat exchange fouling coefficient";
+
+  //parameter Real Fouling_SMP(fixed=true,start=0.065)
+  //  "Sur MP1: heat exchange fouling coefficient";
+
+  parameter Real Fouling_EMP(fixed=false,start=0.09)
+    "Eco MP: heat exchange fouling coefficient";
+
+  parameter Real Fouling_EvHP(fixed=false,start=0.24)
+    "Evapo HP: heat exchange fouling coefficient";
+  parameter Real Fouling_EvMP(fixed=false,start=0.08)
+    "Evapo MP: heat exchange fouling coefficient";
+  parameter Real Fouling_EvBP(fixed=false,start=0.09)
+    "Evapo BP: heat exchange fouling coefficient";
+
+  parameter Real Fouling_SBP(fixed=false,start=0.05)
+    "Sur BP: heat exchange fouling coefficient";
+  parameter Real Fouling_EBP(fixed=false,start=0.06)
+    "Eco BP: heat exchange fouling coefficient";
+
+  parameter Real K_HP_DownComer(fixed=false,start=720.183)
+    "HP: Friction pressure loss coefficient";
+  parameter Real K_IP_DownComer(fixed=false,start=1090.9)
+    "MP: Friction pressure loss coefficient";
+  parameter Real K_Dp_HP_2(fixed=false,start=10.)
+    "SMPin: Friction pressure loss coefficient";
+
+  //parameter Real K_PerteChargeZero2(fixed=true,start=1e-4)
+  //  "TurbineMP out: Friction pressure loss coefficient";
+  parameter Real K_Dp_HP_IP(fixed=false,start=1.)
+    "Outlet THP: Friction pressure loss coefficient";
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
+    "Maximum CV input Turbine HP ";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
+    "Maximum CV input Turbine MP ";
+
+  parameter Real C_tau_n(fixed=false,start=14)
+    "Compressor: Nominal compression rate";
+  parameter Real C_is_eff_n(fixed=false,start=0.92)
+    "Compressor: Nominal isentropic efficiency";
+
+  parameter Real T_Qred(fixed=false,start=0.0178)
+    "GazTurbine: reduced mass flow rate";
+  parameter Real T_is_eff_n(fixed=false,start=0.92)
+    "GazTurbine: Nominal isentropic efficiency";
+
+  parameter Real C_Kcham(fixed=false,start=5.05)
+    "CombustionChamber: pressure loss coefficient";
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum HP_Drum(
+    L=16.27,
+    Vertical=false,
+    hl(fixed=false, start=1474422.14552527),
+    hv(fixed=false, start=2666558.75582585),
+    Vv(fixed=false),
+    R=1.05,
+    xmv(fixed=false),
+    P(fixed=false, start=12703151.2960688),
+    zl(start=1.05, fixed=true),
+    Mp=5000,
+    Kpa=5,
+    Kvl=1000,
+    Pfond(start=12703151.3),
+    Tp(start=596.924860294475),
+    Cv(Q(fixed=true, start=76.58)))
+                     annotation (Placement(transformation(extent={{38,10},{-2,
+            50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_FeedValve(
+    Cvmax=CvmaxValveAHP,
+    C1(P(start=12721657.0), h_vol(start=1396865.59043578)),
+    h(start=1398000),
+    Cv(start=178),
+    Pm(start=13050700))
+                 annotation (Placement(transformation(extent={{78,46},{58,66}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    HP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_SteamValve(
+    mode=0,
+    C2(h_vol(start=2666558.75582585),P(start=12700000.0)),
+    h(start=2674000),
+    Cv(start=23914.7),
+    Pm(start=12721657.16928),
+    C1(P(start=132.1e5, fixed=true)),
+    Cvmax=CvmaxValveVHP)
+                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_DownComer(
+    z2=0,
+    mode=1,
+    Q(start=150, fixed=true),
+    z1=10.83,
+    K=K_HP_DownComer,
+    C2(P(start=12768600.0)),
+    h(start=1474422.14552527),
+    Pm(start=12704000))
+            annotation (Placement(transformation(
+        origin={28,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,     h(start=1474422.14552527))
+                                           annotation (Placement(transformation(
+          extent={{8,-100},{-12,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Evaporator(
+    Dint=32.8e-3,
+    Ntubes=1476,
+    L=20.7,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
+      Tp(start={607.668721736158,605.187884376142,603.825778846274}),
+      Tp1(start={606.357,604.602,603.578})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=10.83,
+      option_temperature=2,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={5.74e7,2.67e7,1.24e7}),
+      Tp1(start={606.2,604.6,603.7}),
+      h(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134,
+            1459929.875}),
+      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
+      P(start={12758125,12740000,12734000,12730000,12726787})),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.092,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.86442072,
+      p_rho=1.05,
+      Encras(start=0.24)=Fouling_EvHP,
+      K(fixed=false, start=407),      DeltaT(start={106,49,23}),
+      T(start={755.54821777344,673.68082608925,635.57157972092,618.19360351563}),
+      Tm(start={643.15,633.15,626.621}),
+      Tp(start={609.11670087771,605.86035558168,604.13687003529})))
+                          annotation (Placement(transformation(
+        origin={-14,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_4(
+    Ns=3,
+    L=20.726,
+    Dint=0.0266,
+    Ntubes=246,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-3.5e6,-2.63e6,-2e6}),
+      Tp(start={576.803345033827,581.933438017921,585.694098500999}),
+      Tp1(start={575.762,580.856,584.579})),
+    Cws1(P(start=13703700.0), h_vol(start=1306078.18827954)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      z2=0,
+      option_temperature=2,
+inertia=true,
+      dW1(start={3.5e6,2.63e6,2e6}),
+      Tp1(start={577.5,582.6,586.4}),
+      h(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578,
+            1398251.0}),
+      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
+      P(start={13301176,13320000,13338000,13357000,13374658})),
+    Cws2(h(fixed=false, start=1500e3)),
+    ExchangerFlueGasesMetal(
+      Dext=0.0318,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.39069779,
+      p_rho=1.06,
+      Encras(start=0.03)=Fouling_EHP4,
+      K(fixed=true, start=47.53),DeltaT(start={38,29,22}),
+      T(start={618.19360351563,612.7722894387,608.97249438439,606.41162109375}),
+      Tm(start={623.15,613.15,607.844}),
+      Tp(start={577.44979072627,582.41942947968,586.06092597683})))
+                          annotation (Placement(transformation(
+        origin={86,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_1(
+    Ns=3,
+    L=20.4,
+    Dint=0.0324,
+    Ntubes=246,
+    ExchangerWall(e=0.0028, lambda=37.61,
+    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
+      Tp(start={629.445777860324,651.664976699235,671.075818762815}),
+      Tp1(start={629,651,670.})),
+    Cws1(h_vol(start=2665000.0)),
+    Cws2(P(start=12720900.0), h_vol(start=2981170.0)),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=10.25056,
+      p_rho=1.04,
+      Encras(start=0.075)=Fouling_SHP,
+      K(fixed=false, start=34.71),      DeltaT(start={138,108,84}),
+      T(start={788.2431640625,774.65344332519,763.17487871399,755.54821777344}),
+      Tm(start={778.15,768.15,759.527}),
+      Tp(start={631.68675322573,653.38616970968,672.36458008039})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      option_temperature=2,
+      inertia=true,
+      dpfCorr=2,      dW1(start={9.8e6,7.7e6,5.9e6}),
+      Tp1(start={639.5,657,673}),
+      h(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983,
+            2973076.25}),
+      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
+      P(start={12723762,12723600,12723500,12720000,12719000})))
+         annotation (Placement(transformation(
+        origin={-63,-50},
+        extent={{-20,20},{20,-20}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_3(
+    Dint=26.6e-3,
+    Ntubes=1476,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
+      Tp(start={556.530623976228,563.226831750573,565.575075374951}),
+      Tp1(start={555.49,562.473,564.857})),
+    L=20.726,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.6e7,5.6e6,2.1e6}),
+      Tp1(start={558,565,567}),
+      h(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855,
+            1291418.875}),
+      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
+      P(start={13219333,13241000,13261000,13282000,13301176})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=12.451,
+      p_rho=1.08,
+      Encras(start=0.06)=Fouling_EHP3,
+      K(fixed=true, start=36.03),
+      St=5, DeltaT(start={34,12,4.4}),
+      T(start={602.67193603516,579.67183226637,571.50875350574,568.81030273438}),
+      Tm(start={593.15,583.15,571.919}),
+      Tp(start={557.01185690541,563.39937105652,565.63731055685})))      annotation (Placement(
+        transformation(
+        origin={206,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_2(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-5e6,-3e6,-2.e6}),
+      Tp(start={490.631370193221,498.229397165878,502.978053774656}),
+      Tp1(start={490,497.024,501.871})),
+    L=20.767,
+    Ntubes=1107,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={5e6,3e6,2.e6}),
+      Tp1(start={499,503,507}),
+      h(start={854494.5625,915007.018247822,957243.396653824,983786.364226731,
+            986348.9375}),
+      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
+      P(start={13129352,13152000,13175000,13197000,13219333})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=111e-3,
+      CSailettes=2.76134577,
+      p_rho=1.11,
+      Encras(start=0.11)=Fouling_EHP2,
+      K(fixed=true, start=65),
+      St=5, DeltaT(start={36,23,14}),
+      T(start={531.16070556641,523.74706132958,519.01561663699,516.31256103516}),
+      Tm(start={538.15,528.15,521.399}),
+      Tp(start={490.84070882241,498.36081646341,503.06064272486})))      annotation (Placement(
+        transformation(
+        origin={406,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_1(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-9.9999e6,-5e6,-2.4e6}),
+      Tp(start={458.958585923538,468.506814782426,473.132256983258}),
+      Tp1(start={458.001,467.576,472.607})),
+    L=20.726,
+    Ntubes=1107,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={9.9999e6,5e6,2.4e6}),
+      Tp1(start={467.4,476.5,480.9}),
+      h(start={618651.9375,752176.893518976,816707.727773953,847728.424287614,
+            854494.5625}),
+      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
+      dynamic_mass_balance=true,
+      P(start={13034956,13060000,13080000,13100000,13129352})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=8.30057632,
+      p_rho=1.13,
+      Encras(start=0.07)=Fouling_EHP1,
+      K(fixed=true, start=40.),
+      St=5,   DeltaT(start={41,20,10}),
+      T(start={509.31488037109,491.44087131458,484.15889910859,482.59533691406}),
+      Tm(start={503.15,498.15,494.131}),
+      Tp(start={459.37586976399,468.70800090382,473.22896941053})))      annotation (Placement(
+        transformation(
+        origin={526,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_2(
+    Ns=3,
+    L=20.4,
+    Dint=32e-3,
+    Ntubes=246,
+    ExchangerWall(e=3e-3, lambda=27,
+          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
+      Tp(start={714.604505161814,740.492493660215,759.200099714419}),
+      Tp1(start={710.485,734.082,752.527})),
+    Cws2(P(start=127113000.0), h_vol(start=3254970.0)),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.83,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={8.8e6,6.6e6,4.9e6}),
+      Tp1(start={714,735.6,752}),
+      h(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722,
+            3240813.5}),
+      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
+      P(start={12720371,12718000,12716000,12714000,12711007})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      CSailettes=10.2505424803872,
+      p_rho=1.02,
+      Encras(start=0.075)=Fouling_SHP,
+      K(fixed=false, start=34.74),
+      St=5,
+      DeltaT(start={124,93,70}),
+      T(start={850.64624023438,839.40882309811,830.36536707939,822.68170166016}),
+      Tm(start={843.15,833.15,825.24}),
+      Tp(start={717.48312916257,742.56566858011,760.69152533026})))      annotation (Placement(
+        transformation(
+        origin={-174,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_3(
+    Ns=3,
+    L=20.4,
+    Ntubes=246,
+    ExchangerWall(lambda=27,e=5e-3,
+    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
+      Tp(start={793.335674512128,811.477076678823,824.721389633254}),
+      Tp1(start={783.815,803.639,818.56})),
+    Dint=28e-3,
+    Cws2(h(fixed=true, start=3511e3)),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.726,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={6.3e6,4.7e6,3.6e6}),
+      Tp1(start={783.6,801.6,815}),
+      h(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987,
+            3433271.25}),
+      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
+      P(start={12711007,12704000,12697000,12689000,12681000})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      p_rho=1,
+      Encras(start=0.075)=Fouling_SHP,
+      CSailettes=6.59672846,
+      K(fixed=false, start=49.33),
+      St=5,
+      DeltaT(start={97,73,55}),
+      T(start={894.21850585938,885.5393240412,879.47464880089,874.32891845703}),
+      Tm(start={893.15,883.15,875.939}),
+      Tp(start={796.82789474964,814.05266276572,826.6253996051})))      annotation (Placement(
+        transformation(
+        origin={-294,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum IP_Drum(
+    L=16.27,
+    Vertical=false,
+    P0=27.29e5,
+    hl(fixed=false, start=978914.570821827),
+    hv(fixed=false, start=2799158.13966473),
+    Vv(fixed=false),
+    R=1.05,
+    P(fixed=false, start=28.3e5),
+    zl(start=1.05, fixed=true),
+    Kvl=0,
+    Kpa=5,
+    Mp=5000,
+    Cv(Q(fixed=true, start=10.9)),
+    Pfond(start=2732995.0),
+    Tp(start=500.955757665063))
+                     annotation (Placement(transformation(extent={{358,10},{320,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    IP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_FeedValve(
+      Cvmax=CvmaxValveAMP,
+    C1(P(start=2952995.0), h_vol(start=892414.570867188)),
+    h(start=944000),
+    Cv(start=28),
+    Pm(start=2945000))
+                 annotation (Placement(transformation(extent={{398,46},{378,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_SteamValve(
+    Pm(fixed=false, start=2731689.4244255),
+    C2(h_vol(start=2798000),P(start=27.3e5)),
+    h(fixed=false, start=2798000),
+    mode=0,
+    Cv(start=27829.4),
+    Cvmax=CvmaxValveVMP,
+    C1(P(start=28.3e5, fixed=true)))
+                 annotation (Placement(transformation(extent={{298,46},{278,66}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_Evaporator(
+    Dint=32.8e-3,
+    L=20.767,
+    Ntubes=738,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
+      Tp(start={504.957792851478,504.19488464586,503.59993822766}),
+      Tp1(start={504.427,503.806,503.304})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.83,
+      continuous_flow_reversal=true,
+      inertia=true,
+          dW1(start={9.7e7,7.6e6,5.8e6}),
+      Tp1(start={504.5,503.9,503.4}),
+      P(start={2773367.5,2754933.93610513,2745233.82043873,2738517.46232967,2733824.75}),
+      h(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464,980708.125}),
+      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=10.0676093,
+      p_rho=1.1,
+      Encras(start=0.08)=Fouling_EvMP,
+      K(fixed=false, start=46.9),
+      St=5,
+      DeltaT(start={53,41,32}),
+      T(start={565.24822998047,551.20973998682,539.98034586472,531.16070556641}),
+      Tm(start={553.15,543.15,536.901}),
+      Tp(start={505.45492567199,504.57970000924,503.89762940507})))              annotation (Placement(
+        transformation(
+        origin={306,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss IP_DownComer(
+    z2=0,
+    z1=10.83,
+    mode=1,
+    K=K_IP_DownComer,
+    Q(start=22, fixed=true),
+    Pm(start=2734000),
+    h(start=978914.570821827))
+            annotation (Placement(transformation(
+        origin={348,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
+    h(start=978914.570821827),
+    P(start=2834000))                      annotation (Placement(transformation(
+          extent={{328,-100},{308,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_Economizer(
+    ExchangerWall(e=2.6e-3, lambda=47,
+        dW1(start={-3e6,-1.4e6,-740379}),
+      Tp(start={457.584681885759,475.409334769727,486.332585528225}),
+      Tp1(start={456.76,474.926,485.122})),
+    L=20.726,
+    Ns=3,
+    Dint=26.6e-3,
+    Ntubes=246,
+    Cws1(h_vol(start=671235.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.767,
+      z2=0,
+      inertia=true,
+      dW1(start={3e6,1.4e6,740379}),
+      Tp1(start={474,491,499.9}),
+      h(start={565108.5,727745.440528479,829820.124314816,892414.570867187,
+            944505.4375}),
+      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
+      P(start={3124229.75,3148000,3172000,3195000,3216977.75})),
+    Cws2(h(fixed=false, start=990e3)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      CSailettes=7.16188651,
+      p_rho=1.12,
+      Encras(start=0.09)=Fouling_EMP,
+      K(fixed=true, start=50),
+      St=5,
+      DeltaT(start={45,24,13}),
+      T(start={516.31256103516,511.25046295073,508.31162431247,509.31488037109}),
+      Tm(start={533.15,523.15,514.647}),
+      Tp(start={458.18343678065,475.77644311925,486.55770446184})))              annotation (Placement(
+        transformation(
+        origin={466,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_1(
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.3e6,-0.80263e6,
+                                -501864}),
+      Tp(start={557.102699668877,574.070651369638,584.64928514972}),
+      Tp1(start={556.102699668877,573.070651369638,583.64928514972})),
+    L=20.726,
+    Ns=3,
+    Dint=32.8e-3,
+    Ntubes=123,
+    Cws1(h_vol(start=2800000.0),P(start=2.73467e+06)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      CSailettes=14.46509765,
+      p_rho=1.07,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=22.09),
+      St=5,
+      DeltaT(start={45,30,19}),
+      T(start={606.41162109375,604.22099235915,603.06310204059,602.67193603516}),
+      Tm(start={623.15,613.15,603.024}),
+      Tp(start={557.49575399383,574.31250418519,584.79699207547})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.77,
+      dpfCorr=2,
+      inertia=false,
+      dW1(start={1.3e6,0.80263e6,501864}),
+      Tp1(start={557,573,583}),
+      h(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156,
+            3040562.25}),
+      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
+      P(start={2731326.25,2729591.6901521,2728654.3204706,2727686.1714029,
+            2726700})))     annotation (Placement(transformation(
+        origin={146,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB VolumeLP(
+    Ce1(h(start=3091610.0)),
+    h(start=3042573.51976705),
+    P(start=2726000))
+    annotation (Placement(transformation(
+        origin={146,-110},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_2(
+    Ns=3,
+    L=20.4,
+    Dint=39.3e-3,
+    Ntubes=369,
+    ExchangerWall(e=2.6e-3, lambda=36.86,
+    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
+      Tp(start={689.66516778766,716.376344387713,734.591437191304}),
+      Tp1(start={687.7,713.5,731.5})),
+    Cws1(P(start=2576650.0), h_vol(start=3078800.0)),
+    Cws2(P(start=2558540.0), h_vol(start=3342910.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={1.15e7,7.9e6,5.5e6}),
+      Tp1(start={685.6,711,729}),
+      h(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389,
+            3321940.75}),
+      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
+      P(start={2575582.5,2572000,2568000,2563000,2558239})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=92e-3,
+      CSailettes=5.814209831,
+      p_rho=1.03,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=45.22),
+      St=5,
+      DeltaT(start={125,86,60}),
+      T(start={822.68170166016,807.90772072705,797.00284433443,788.2431640625}),
+      Tm(start={813.15,803.15,792.527}),
+      Tp(start={690.93545553661,717.24269857866,735.18209370035})))              annotation (Placement(
+        transformation(
+        origin={-114,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_3(
+    Ns=3,
+    L=20.4,
+    Ntubes=369,
+    Dint=45.6e-3,
+    ExchangerWall(e=2.6e-3, lambda=27,
+    dW1(start={-8e6,-5.5e6,-3.8e6}),
+      Tp(start={788.901616786331,805.674094596818,817.083010473709}),
+      Tp1(start={786.717,804.102,815.901})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={8e6,5.5e6,3.8e6}),
+      Tp1(start={782,798.7,810}),
+      h(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916,
+            3517975.25}),
+      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
+      P(start={2558239,2556000,2554000,2552000,2548600})),
+    Cws2(h(fixed=true, start=3606e3)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=92e-3,
+      Dext=50.8e-3,
+      p_rho=1.01,
+      CSailettes=5.695842178,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=43.23),
+      St=5,
+      DeltaT(start={82,56,38}),
+      T(start={874.32891845703,864.2444076086,856.92248545484,850.64624023438}),
+      Tm(start={873.15,863.15,853.059}),
+      Tp(start={789.92521486539,806.37044583028,817.55662835373})))              annotation (Placement(
+        transformation(
+        origin={-234,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum LP_Drum(
+    Vertical=false,
+    P0=5e5,
+    Vv(fixed=false),
+    L=8,
+    hl(fixed=false, start=549249.519022482),
+    hv(fixed=false, start=2709858.97470349),
+    R=2,
+    zl(start=1.75, fixed=true),
+    Kvl=0,
+    Kpa=5,
+    Mp=5000,
+    P(fixed=false, start=520000),
+    Cv(Q(fixed=true, start=9.23)),
+    Pfond(start=564775.0),
+    Tp(start=406.411032587651))
+                     annotation (Placement(transformation(extent={{618,10},{578,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    LP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_SteamValve(
+    p_rho=3, Cvmax=CvmaxValveVBP,
+    C2(P(start=503542.0), h_vol(start=2709858.97470349)),
+    h(start=2685000),
+    Cv(start=7555),
+    Pm(start=498000))
+                 annotation (Placement(transformation(extent={{558,46},{538,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_FeedValve(
+    C1(h_vol(start=511900.0)),
+    h(fixed=false, start=509000),
+    Pm(fixed=false, start=5.0698e5),
+    Cvmax=250,
+    Cv(start=142.5),
+    C2(P(fixed=true, start=5.2e5)))
+                 annotation (Placement(transformation(extent={{650,46},{630,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss LP_DownComer(
+    z2=0,
+    z1=10.767,
+    K=32766,
+    mode=1,
+    Q(start=20, fixed=false),
+    pro(d(start=934.452746556487)),
+    Pm(start=564000),
+    h(start=549249.519022482))
+            annotation (Placement(transformation(
+        origin={610,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=549249.519022482),
+                                                                       mode=1,
+    V=5,
+    P(start=523000))                                   annotation (Placement(
+        transformation(extent={{592,-100},{572,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_Evaporator(
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
+      Tp(start={433.127441964236,432.076030201586,431.28112439162}),
+      Tp1(start={432.956,431.127,430.61})),
+    L=20.726,
+    Ntubes=984,
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={1.24e7,8.5e6,5.8e6}),
+      Tp1(start={442.5,441.7,441}),
+      h(start={550075.0,765243.011613326,912673.256542569,1013555.73710231,
+            550075.0}),
+      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
+      Q(start={49.787311368631,49.787311368631,49.787311368631,49.787311368631}),
+      P(start={522583.375,488000,487000,486000,485588.46875})),
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=138e-3,
+      CSailettes=11.07985,
+      p_rho=1.14,
+      Encras(start=0.09)=Fouling_EvBP,
+      K(fixed=false, start=46.7),
+      St=5,
+      DeltaT(start={45,31,21}),
+      T(start={482.59533691406,464.53146753441,453.496360082,442.5893859863}),
+      Tm(start={483.15,478.15,472.098}),
+      Tp(start={433.5360639938,432.3549425205,431.471976456})))              annotation (Placement(
+        transformation(
+        origin={566,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_LP_Drum(k=0.25)
+    annotation (Placement(transformation(extent={{742,32},{728,44}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve(
+      Pm(start=5.0698e5), mode=1,
+    C1(h_vol(start=549249.519022482)),
+    h(start=550000),
+    Cv(start=308.931))
+                 annotation (Placement(transformation(extent={{710,12},{730,32}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_SuperHeater(
+    Ns=3,
+    L=20.726,
+    Dint=39.3e-3,
+    Ntubes=123,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.1e6,-782901,-559798}),
+      Tp(start={489.606851797367,513.610203520748,530.080624448955}),
+      Tp1(start={488.486,512.197,529.53})),
+    Cws1(h_vol(start=2642240.0),P(start=484264)),
+    Cws2(h_vol(start=2979330.0)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=222.1e-3,
+      K(fixed=true, start=30.46),
+      CSailettes=3.25763059984175,
+      p_rho=1.09,
+      Encras(start=0.05)=Fouling_SBP,
+      St=5,
+      DeltaT(start={92,66,47}),
+      T(start={568.81030273438,567.21003420557,566.29303411055,565.24822998047}),
+      Tm(start={583.15,573.15,568.703}),
+      Tp(start={489.84170505864,513.76963980951,530.18834052149})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      rugosrel=1e-5,
+      z1=10.767,
+      inertia=false,
+      dpfCorr=0.25,
+      dW1(start={1.1e6,782901,559798}),
+      Tp1(start={485,511,529}),
+      h(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762,
+            2914520.25}),
+      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
+      P(start={510622.6875,505757.57962259,504477.27858572,503172.36919354,501850})))      annotation (Placement(
+        transformation(
+        origin={266,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkP SinkP_Gas(P0=1.044e5)
+    annotation (Placement(transformation(
+        origin={722,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_Economizer(
+    Ns=3,
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
+      Tp(start={398.142807363473,393.825926964772,392.943738968771}),
+      Tp1(start={397.622,392.348,391.516})),
+    Ntubes=3444,
+    L=20.726,
+    Cws1(h_vol(start=195526.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      inertia=true,
+      dpfCorr=0.5,
+      dW1(start={2.45e7,5.5e6,1.17e6}),
+      Tp1(start={409,404.7,404}),
+      h(start={194584.515625,462556.370989432,494648.45288738,501287.069880104,
+            509237.875}),
+      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
+      P(start={1540571.25,1500000,1480000,1450000,1429595.375})),
+    Cws2(h(fixed=false, start=500e3)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=92e-3,
+      CSailettes=11.673758598919,
+      p_rho=1.15,
+      Encras(start=0.06)=Fouling_EBP,
+      K(fixed=true, start=30),
+      St=5,
+      DeltaT(start={23.5,5.3,1.1}),
+      T(start={442.5893859863,403.9873508455,395.0465605839,395.464630127}),
+      Tm(start={423.15,418.15,414.742}),
+      Tp(start={398.4437772187,393.8897987349,392.9569515805})))              annotation (Placement(
+        transformation(
+        origin={680,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine HP_Turbine(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.88057),
+    eta_is_min=0.75,
+    Cst(start=8182844.56002535)=
+        CstHP,
+    Pe(fixed=true, start=125.20e5),
+    Ps(fixed=false, start=2726700),
+    eta_is_nom=EtaIsNomHP,
+    Cs(h(fixed=true, start=3106e3)),
+    pros(d(start=10.0)),
+    Hrs(start=3046260),
+    Qmax=151,
+    a=-1.20211,
+    b=2.32571,
+    c=-0.25) annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
+          rotation=0)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine IP_Turbine(
+    W_fric=1,
+    Ps(fixed=false, start=476800),
+    eta_stato=1,
+    eta_is(start=0.9625),
+    eta_is_min=0.75,
+    Cst(start=256335.364995961)=
+        CstMP,
+    Pe(fixed=true, start=25.13e5),
+    pros(d(start=30.0)),
+    Hrs(start=3029780),
+    Cs(h(fixed=false, start=2990e3)),
+    eta_is_nom=0.96,
+    b=2.4957,
+    Qmax=170,
+    a=-1.2728,
+    c=-0.26202)   annotation (Placement(transformation(extent={{318,-250},{358,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP1(
+    h(start=2997231.36734756),
+    P(start=476799.99999954),
+    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
+        origin={418,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine LP_Turbine(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9538),
+    eta_is_min=0.75,
+    Cst(start=11944.9445735985)=
+        CstBP,
+    Hrs(start=2401030),
+    Pe(fixed=true, start=4.77e5),
+        Ps(start=10053),
+    Cs(h(fixed=true, start=2399.9e3)),
+    eta_is_nom=EtaIsNomBP,
+    Qmax=192,
+    a=-1.22335,
+    b=2.2957,
+    c=-0.14)   annotation (Placement(transformation(extent={{576,-250},{616,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-292,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-232,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(Cs(h(start=3000000)),
+                                                    alpha=0.5)
+    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
+    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    Vf0=0.15,
+    steady_state=false,
+    yNiveau(signal(start=1.5)),
+    Cse(h(start=128076)),
+    P0=6100,
+    P(fixed=false, start=6136),
+    Pfond(start=6200)) annotation (Placement(transformation(extent={{639,-384},
+            {719,-304}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
+    h0=113.38e3, Q0=17224)       annotation (Placement(transformation(extent={{
+            572,-377},{620,-329}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_In(
+    K=1e-4,
+    h(start=2400000),
+    C1(h_vol(start=2400000), h(start=2400000)),
+    Q(start=190.55),
+    Pm(start=10026)) annotation (Placement(transformation(extent={{640,-240},{660,
+            -220}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
+    Ce3(h(start=163768.700887002)),
+    h(start=163768.700887002),
+    P(start=1540500))
+    annotation (Placement(transformation(
+        origin={902,-318},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out2(
+    K=1e-4,
+    mode=1,
+    pro(d(start=993.470128235971)),
+    Pm(start=1540000)) annotation (Placement(transformation(
+        origin={902,-270},
+        extent={{12,-12},{-12,12}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
+    h(start=549249.519022482),
+    P(start=322430))                       annotation (Placement(transformation(
+          extent={{742,6},{762,26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump IP_Pump(
+    a3=350,
+    mode=1,
+    Q(fixed=false, start=10.9),
+    a1=-244551,
+    C1(h_vol(start=576000.0)),
+    C2(h_vol(start=561000.0)),
+    h(start=571000.0),
+    hn(start=317),
+    Qv(start=0.0207237016869104),
+    pro(d(start=930.0)),
+    Pm(start=1725850))
+            annotation (Placement(transformation(extent={{804,6},{824,26}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump HP_Pump(
+    a3=1600,
+    a1=-28056.2,
+    Q(fixed=false),
+    mode=1,
+    C1(h_vol(start=561000.0)),
+    C2(h_vol(start=630000.0)),
+    h(start=630000),
+    hn(start=1413),
+    Qv(start=0.0810383142105344),
+    pro(d(start=929.0)),
+    Pm(start=6774000))  annotation (Placement(transformation(extent={{804,-46},
+            {824,-26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
+                                                    alpha=0.5,
+    h(start=194585),
+    P(start=1540500),
+    Cs(h(start=194585)))
+    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={266,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_LP_Turbine(
+    z2=0,
+    mode=0,
+    z1=0,
+    h(start=3000000),
+    C1(
+      h_vol(start=3000000),
+      h(start=3000000),
+      P(fixed=false, start=5.0185e5)),
+    K=1e-4,
+    Pm(start=490000)) annotation (Placement(transformation(
+        origin={344,-278},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_HP_Pump(
+    K=1e-4,
+    mode=1,
+    C2(h_vol(start=599600)),
+    Pm(start=372718)) annotation (Placement(transformation(
+        origin={780,-36},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_IP_Pump(
+    K=1e-4,
+    mode=1,
+    C2(h_vol(start=599600)),
+    Pm(start=372718)) annotation (Placement(transformation(
+        origin={780,16},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
+    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out(
+    K=1e-4,
+    mode=1,
+    C1(h_vol(start=153206.462779274)),
+    C2(h_vol(start=153206.462779274)),
+    pro(d(start=993.441492649513)),
+    Pm(start=6200)) annotation (Placement(transformation(extent={{702,-446},{722,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump LP_Pump(
+    Qv(start=0.1934),
+    mode=1,
+    a3=400,
+    C2(P(fixed=false, start=16.7e5), h_vol(start=194669.0)),
+    h(start=193000),
+    hn(start=183),
+    a1=LP_Pump_a1,
+    Q(start=193.43, fixed=false),
+    Pm(start=1103065, fixed=false)) annotation (Placement(transformation(extent=
+           {{742,-446},{762,-426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out1(
+    K=1e-4,
+    mode=1,
+    pro(d(start=994.045785814739)),
+    C1(h_vol(start=194585), h(start=194585)),
+    Pm(start=1546000)) annotation (Placement(transformation(extent={{840,-446},{
+            860,-426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ExtractionValve(
+    mode=1,
+    Cvmax=2500,
+    h(start=195000),
+    Cv(start=2000),
+    C1(h_vol(start=195000)),
+    C2(h_vol(start=195000)),
+    Pm(start=1549000)) annotation (Placement(transformation(extent={{802,-440},{
+            822,-420}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamHP(C1(h_vol(start=2674000),
+        h(start=2674000)))
+    annotation (Placement(transformation(
+        origin={-58,8},
+        extent={{-6,6},{6,-6}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterHP(C2(h_vol(start=1398000),
+        h(start=1398000)))
+    annotation (Placement(transformation(
+        origin={91.5,32},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterMP(C2(h_vol(start=944000),
+        h(start=944000)))
+    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamMP(C1(h_vol(start=2798000),
+        h(start=2798000)),C2(h_vol(start=2798000)))
+    annotation (Placement(transformation(
+        origin={236,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamBP(C2(h_vol(start=2685000),
+        h(start=2685000)))
+    annotation (Placement(transformation(
+        origin={514,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP(C2(h_vol(start=550000),
+        h(start=550000)))
+    annotation (Placement(transformation(
+        origin={663.5,34},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP_Out(C2(h_vol(start=
+            550000), h(start=550000))) annotation (Placement(transformation(
+          extent={{687,15},{700,27}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterCondenser(C2(h_vol(start=
+           194585), h(start=194585))) annotation (Placement(transformation(
+        origin={685.5,-412},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamCondenser(C2(h_vol(start=
+           2401000), h(start=2401000))) annotation (Placement(transformation(
+        origin={684.5,-264},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_2(
+    C1(
+      P(fixed=true, start=27.267e5),
+      h_vol(start=3046000),
+      h(start=3046000)),
+    K=K_Dp_HP_2,
+    Pm(start=2651000)) annotation (Placement(transformation(extent={{114,-120},{
+            94,-100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_Turbine_Valve(
+    mode=0,
+    h(fixed=false, start=3433000),
+    Cv(start=10875),
+    Pm(fixed=false, start=12550000),
+    C1(P(fixed=true, start=126.81e5)),
+    Cvmax=Cvmax_THP)
+                 annotation (Placement(transformation(extent={{-124,-234},{-104,
+            -214}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauHP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500,
+    minval=0.007) annotation (Placement(transformation(extent={{-40,106},{-20,
+            126}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauMP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500) annotation (Placement(transformation(extent={{262,106},{282,126}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauBP(                                                              k=1.75)
+    annotation (Placement(transformation(extent={{470,114},{504,132}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
+    add(k1=-1, k2=+1),
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauCondenseur1(                                 k=1.5)
+    annotation (Placement(transformation(extent={{704,-246},{740,-230}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+      add(k1=+1, k2=-1)) annotation (Placement(transformation(extent={{758,-282},
+            {778,-262}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneHP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
+            -138,-142}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp(
+    Initialvalue=1400,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=1300)
+                   annotation (Placement(transformation(extent={{944,-16},{906,
+            16}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP(
+    Initialvalue=1400,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=1300)
+                   annotation (Placement(transformation(extent={{945,-82},{907,
+            -50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingBP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{945,-458},{907,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
+    mode=1,
+    V=1,
+    h0=988332,
+    h(start=988332),
+    P0=70.1e5,
+    P(start=13129000),
+    dynamic_mass_balance=true)            annotation (Placement(transformation(
+          extent={{456,-98},{436,-78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
+    mode=1,
+    V=1,
+    h0=983786,
+    h(start=983786),
+    P0=70.0e5,
+    P(start=13219000),
+    dynamic_mass_balance=true)            annotation (Placement(transformation(
+          extent={{252,-20},{232,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve1(
+                          mode=1,
+    Cvmax=308.931,
+    h(start=618600),
+    Cv(start=308.931),
+    C1(h_vol(start=618600)),
+    Pm(start=13130000))
+                 annotation (Placement(transformation(extent={{754,-98},{730,
+            -122}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve2(
+      Pm(start=3126000), mode=1,
+    Q(start=10.9, fixed=false),
+    h(start=565000),
+    C1(h_vol(start=565000)),
+    Cv(start=308.931),
+    Cvmax=308.931)
+                 annotation (Placement(transformation(extent={{804,-138},{780,
+            -162}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp1(
+    Initialvalue=0.8,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=0.4)  annotation (Placement(transformation(extent={{946,-150},{
+            908,-118}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP1(
+    Initialvalue=0.8,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=0.4)  annotation (Placement(transformation(extent={{946,-194},{
+            908,-162}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
+    P0=127e5,
+    h0=3e6,
+    P(start=127e5),
+    h(start=3450835.48993987),
+    dynamic_mass_balance=true)        annotation (Placement(transformation(
+        origin={-52,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP(
+    h0=3523910,
+    h(start=3523910),
+    dynamic_mass_balance=true,
+    P0=2400000,
+    P(start=24e5))                        annotation (Placement(transformation(
+        origin={-50,-314},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_Turbine_Valve(
+    h(fixed=false, start=3518000),
+    mode=0,
+    Pm(fixed=false, start=2547000),
+    Cv(start=3.312e6),
+    C1(P(fixed=true, start=25.486e5)),
+    Cvmax=Cvmax_TMP)
+                 annotation (Placement(transformation(extent={{-124,-318},{-104,
+            -298}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneIP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
+            -138,-226}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
+    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
+    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
+    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Gain Gain_2GasTurbine(Gain=
+       2) annotation (Placement(transformation(extent={{-18,-448},{2,-428}},
+          rotation=0)));
+  Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible(
+    Hum=0,
+    rho=0.838,
+    T0=185 + 273.16,
+    Cp=2255,
+    LHV=46989e3,
+    Xo=0.000,
+    Xn=0.000,
+    Xs=0.000,
+    Xc=0.74,
+    Xh=0.25,
+    Q0=13.521)
+          annotation (Placement(transformation(extent={{-421,24},{-385,60}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ sourceEau(             Q0=0.0)
+          annotation (Placement(transformation(extent={{-473,27},{-445,57}},
+          rotation=0)));
+  FlueGases.BoundaryConditions.SourcePQ SourceFumees(
+    Xso2=0,
+    Xco2=0,
+    Xh2o=0,
+    Xo2=0.20994,
+    T0=29.4 + 273.16,
+    P0=1.003e5,
+    Q0=592.76 + 0.66)
+    annotation (Placement(transformation(extent={{-539,-74},{-495,-28}},
+          rotation=0)));
+  FlueGases.TAC.GasTurbine GasTurbine(
+    Kcham=1.114801,
+    exp_eff_n=0.90,
+    comp_eff_n=0.9,
+    TurbQred=0.01731,
+    comp_tau_n=14.0,
+    Wpth=1.2707e6,
+    exp_tau_n=0.079,
+    chambreCombustionTAC(
+      Psf(fixed=false, start=13.16e5),
+      Pea(fixed=true, start=14.042e5),
+      kcham=C_Kcham,
+      Tea(start=680)),
+    TurbineAgaz(
+      Ps(fixed=false),
+      A3=0,
+      A2=-0.04778,
+      A1=0.09555,
+      A0=0.95223,
+      Wmech(fixed=false, start=227.3e6),
+      Pe(fixed=false, start=13.3e5),
+      is_eff(fixed=false, start=0.92),
+      Ts(fixed=true, start=893.76),
+      is_eff_n=T_is_eff_n,
+      Qred=T_Qred,
+      tau_n=0.079094,
+      tau(fixed=true, start=0.079094),
+      Tis(start=828)),
+    Compresseur(
+      tau(fixed=false, start=14),
+      is_eff_n=C_is_eff_n,
+      is_eff(fixed=true, start=0.76),
+      Xtau(fixed=true, start=1),
+      Tis(start=630),
+      Ts(start=680),
+      tau_n(start=14)=C_tau_n))
+    annotation (Placement(transformation(extent={{-471,-115},{-341,13}},
+          rotation=0)));
+
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeQfuel(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=13.521,
+    Finalvalue=7.804)
+                     annotation (Placement(transformation(extent={{-538,80},{
+            -518,100}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe Humidite(
+    Starttime=200,
+    Initialvalue=1,
+    Finalvalue=0.8,
+    Duration=800)
+    annotation (Placement(transformation(extent={{-538,20},{-517,40}}, rotation=
+           0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeIQair(
+    Starttime=200,
+    Initialvalue=592.76 + 0.66,
+    Finalvalue=384.3,
+    Duration=800)  annotation (Placement(transformation(extent={{-539,-20},{
+            -519,0}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeTair(
+    Starttime=200,
+    Initialvalue=302.56,
+    Finalvalue=305.16,
+    Duration=800)  annotation (Placement(transformation(extent={{-539,-100},{
+            -519,-80}}, rotation=0)));
+  WaterSteam.Volumes.VolumeA SeparateurMP(h(start=3106000), P(start=27.26e+005),
+    rho(start=10))
+    annotation (Placement(transformation(
+        origin={74,-200},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_1(
+    K=1e-4,
+    pro(d(start=10)),
+    h(start=3106000),
+    C1(
+      P(start=27.26e+005),
+      h_vol(start=3106000),
+      Q(start=153),
+      h(start=3106000)),
+    C2(
+      P(start=27.259e+005),
+      h_vol(start=3106000),
+      Q(start=153),
+      h(start=3106000)),
+    Pm(start=2726000)) annotation (Placement(transformation(extent={{88,-182},{102,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_IP_PressureLoss(
+    Q(fixed=true, start=3.09),
+    continuous_flow_reversal=true,
+    h(start=3106000),
+    C1(
+      P(start=27.26e+005),
+      h_vol(start=3106000),
+      h(start=3106000),
+      Q(start=3.09)),
+    C2(
+      P(start=27.259e+005),
+      h_vol(start=3106000),
+      h(start=3106000),
+      Q(start=3.09)),
+    K=K_Dp_HP_IP,
+    Pm(start=2726000)) annotation (Placement(transformation(extent={{134,-210},{
+            154,-190}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe Q_water(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=21000,
+    Finalvalue=15000)
+                   annotation (Placement(transformation(extent={{555,-364},{575,
+            -344}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampePout(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=1.044e5,
+    Finalvalue=1.028e5)
+                   annotation (Placement(transformation(extent={{711,-84},{731,
+            -64}}, rotation=0)));
+equation
+  connect(HP_SuperHeater_3.Cws1, HP_SuperHeater_2.Cws2)
+    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
+        color={255,0,0}));
+  connect(HP_SuperHeater_2.Cws1, HP_SuperHeater_1.Cws2)
+    annotation (Line(points={{-174,-70},{-174,-90},{-63,-90},{-63,-70}}, color=
+          {255,0,0}));
+  connect(HP_SteamValve_Constante.y, HP_SteamValve.Ouv)
+    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
+  connect(HP_SteamValve.C1, HP_Drum.Cv)
+    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
+  connect(HP_DownComer.C1, HP_Drum.Cd)
+    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={0,0,0}));
+  connect(HP_Drum.Cm, HP_Evaporator.Cws2)
+    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}, color={0,0,0}));
+  connect(VolumeEvapHP.Cs, HP_Evaporator.Cws1)
+    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={0,0,0}));
+  connect(VolumeEvapHP.Ce1, HP_DownComer.C2)
+                                      annotation (Line(points={{8,-90},{18,-90}},
+        color={0,0,0}));
+  connect(HP_Economizer_4.Cws1, HP_Economizer_3.Cws2)
+    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
+  connect(IP_Drum.Cm, IP_Evaporator.Cws2)
+    annotation (Line(points={{320,10},{306,10},{306,-30}}, color={0,0,0}));
+  connect(IP_Evaporator.Cws1, VolumeEvapMP.Cs)
+    annotation (Line(points={{306,-70},{306,-90},{308,-90}}, color={0,0,0}));
+  connect(VolumeEvapMP.Ce1, IP_DownComer.C2)
+    annotation (Line(points={{328,-90},{338,-90}}, color={0,0,0}));
+  connect(IP_SteamValve_Constante.y, IP_SteamValve.Ouv)
+    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
+  connect(HP_SuperHeater_1.Cfg2, HP_Evaporator.Cfg1)        annotation (Line(
+      points={{-53,-50},{-53,-50},{-24,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Evaporator.Cfg2, HP_Economizer_4.Cfg1)        annotation (Line(
+      points={{-4,-50},{96,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_4.Cfg2, IP_SuperHeater_1.Cfg1)          annotation (Line(
+      points={{76,-50},{136,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_1.Cfg2, HP_Economizer_3.Cfg1)           annotation (Line(
+      points={{156,-50},{196,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_Evaporator.Cfg2, HP_Economizer_2.Cfg1)           annotation (Line(
+      points={{316,-50},{396,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_2.Cfg2, IP_Economizer.Cfg1)           annotation (Line(
+      points={{416,-50},{456,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_Economizer.Cfg2, HP_Economizer_1.Cfg1)           annotation (Line(
+      points={{476,-50},{516,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_DownComer.C1, IP_Drum.Cd)
+    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={0,0,
+          0}));
+  connect(IP_SuperHeater_2.Cfg2, HP_SuperHeater_1.Cfg1)          annotation (Line(
+      points={{-104,-50},{-73,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_2.Cfg1, HP_SuperHeater_2.Cfg2)           annotation (Line(
+      points={{-124,-50},{-164,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_3.Cfg2, HP_SuperHeater_2.Cfg1)           annotation (Line(
+      points={{-224,-50},{-184,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_SuperHeater_3.Cfg2, IP_SuperHeater_3.Cfg1)           annotation (Line(
+      points={{-284,-50},{-244,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_3.Cws1,IP_SuperHeater_2. Cws2)
+    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
+          {255,0,0}));
+  connect(IP_SuperHeater_1.Cws2, VolumeLP.Ce2) annotation (Line(
+      points={{146,-70},{146,-100}},
+      color={255,0,0},
+      pattern=LinePattern.None));
+  connect(LP_SteamValve.C1, LP_Drum.Cv)
+    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
+  connect(LP_Evaporator.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
+          -70},{566,-90},{572,-90}}, color={0,0,0}));
+  connect(VolumeEvapBP.Ce1, LP_DownComer.C2)
+                                        annotation (Line(points={{592,-90},{600,
+          -90}}, color={0,0,0}));
+  connect(LP_Drum.Cd, LP_DownComer.C1) annotation (Line(points={{618,10},{628,
+          10},{628,-90},{620,-90}}, color={0,0,0}));
+  connect(LP_Economizer.Cfg2, SinkP_Gas.C)     annotation (Line(
+      points={{690,-50},{712.2,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_3.Cfg2, LP_SuperHeater.Cfg1)  annotation (Line(
+      points={{216,-50},{256,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_SuperHeater.Cfg2, IP_Evaporator.Cfg1)  annotation (Line(
+      points={{276,-50},{296,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_1.Cfg2, LP_Evaporator.Cfg1) annotation (Line(
+      points={{536,-50},{556,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_Evaporator.Cfg2, LP_Economizer.Cfg1) annotation (Line(
+      points={{576,-50},{670,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_Drum.Cm, LP_Evaporator.Cws2)
+    annotation (Line(points={{578,10},{566,10},{566,-30}}, color={0,0,0}));
+  connect(IP_SteamValve.C1, IP_Drum.Cv)   annotation (Line(points={{298,50},{
+          320,50}}, color={255,0,0}));
+  connect(HPIP_FeedValve.Ouv, constante_LP_Drum.y)
+    annotation (Line(points={{720,33},{720,38},{727.3,38}}));
+  connect(HP_SuperHeater_3.Cws2, DoubleDebitHP.Ce)
+    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
+        color={255,0,0}));
+  connect(IP_SuperHeater_3.Cws2, DoubleDebitMP.Ce)
+    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
+        color={255,0,0}));
+  connect(VolumeCond1.Cs, Dp_Cond_Out2.C1)
+    annotation (Line(points={{902,-308},{902,-282}}, color={0,0,255}));
+  connect(HPIP_FeedValve.C2, VolumeAlimMPHP.Ce1)
+                                               annotation (Line(points={{730,16},
+          {742,16}}, color={0,0,255}));
+  connect(LP_SuperHeater.Cws2, DoubleDebitBP.Ce)
+    annotation (Line(points={{266,-70},{266,-90}}, color={255,0,0}));
+  connect(DP_IP_Pump.C2, IP_Pump.C1)
+    annotation (Line(points={{790,16},{798,15},{804,16}}, color={0,0,255}));
+  connect(VolumeAlimMPHP.Cs1, DP_IP_Pump.C1) annotation (Line(points={{762,16},{
+          766,15},{766,16},{770,16}}, color={0,0,255}));
+  connect(VolumeAlimMPHP.Cs2, DP_HP_Pump.C1)
+    annotation (Line(points={{752,6},{752,-36},{770,-36}}, color={0,0,255}));
+  connect(DP_HP_Pump.C2, HP_Pump.C1)
+    annotation (Line(points={{790,-36},{804,-36}}, color={0,0,255}));
+  connect(VolumeIP1.Ce2, Dp_LP_Turbine.C2) annotation (Line(points={{418,-239},{
+          418,-278},{354,-278}}, color={255,0,0}));
+  connect(Dp_Cond_Out.C2, LP_Pump.C1)
+    annotation (Line(points={{722,-436},{742,-436}}, color={0,0,255}));
+  connect(ExtractionValve.C2, Dp_Cond_Out1.C1)
+    annotation (Line(points={{822,-436},{840,-436}}, color={0,0,255}));
+  connect(HP_FeedValve.C1, SensorQ_WaterHP.C2)
+    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
+  connect(HP_SteamValve.C2, SensorQ_SteamHP.C1) annotation (Line(points={{
+          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
+  connect(SensorQ_SteamHP.C2, HP_SuperHeater_1.Cws1) annotation (Line(points={{-53.2,
+          1.88},{-53.2,-3.06},{-63,-3.06},{-63,-30}},        color={255,0,0}));
+  connect(IP_FeedValve.C1, SensorQ_WaterMP.C2)
+    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
+  connect(SensorQ_SteamMP.C1, IP_SteamValve.C2) annotation (Line(points={{
+          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
+  connect(SensorQ_SteamMP.C2, IP_SuperHeater_1.Cws1) annotation (Line(points={
+          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
+  connect(SensorQ_SteamBP.C2, LP_SuperHeater.Cws1) annotation (Line(points={{
+          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
+  connect(SensorQ_SteamBP.C1, LP_SteamValve.C2) annotation (Line(points={{
+          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
+  connect(SensorQ_WaterBP.C2, LP_FeedValve.C1) annotation (Line(
+        points={{658.3,40.12},{658.3,50},{650,50}}, color={0,0,255}));
+  connect(SensorQ_WaterBP_Out.C2, HPIP_FeedValve.C1) annotation (Line(points={{
+          700.13,16.2},{705.065,16.2},{705.065,16},{710,16}}, color={0,0,255}));
+  connect(SensorQ_WaterCondenser.C2, Dp_Cond_Out.C1) annotation (Line(points={{
+          680.3,-422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
+  connect(Dp_Cond_In.C2, SensorQ_SteamCondenser.C1) annotation (Line(points={{
+          660,-230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
+  connect(VolumeLP.Ce1, MoitieDebitHP.Cs)
+    annotation (Line(points={{146,-120},{146,-170},{134,-170}}, color={255,0,0}));
+  connect(Dp_Cond_Out1.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,-436},
+          {862,-436},{862,-318},{872,-318}}, color={0,0,255}));
+  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
+          {892,-318}}, color={0,0,255}));
+  connect(IP_SuperHeater_2.Cws1, HP_PressureLoss_2.C2) annotation (Line(points={{-114,-70},
+          {-114,-110},{94,-110}}, color={255,0,0}));
+  connect(HP_PressureLoss_2.C1, VolumeLP.Cs2)
+    annotation (Line(points={{114,-110},{136.2,-110}}, color={255,0,0}));
+  connect(DoubleDebitHP.Cs, HP_Turbine_Valve.C1) annotation (Line(points=
+          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
+  connect(DoubleDebitBP.Cs, Dp_LP_Turbine.C1) annotation (Line(points={{266,-110},
+          {266,-278},{334,-278}}, color={255,0,0}));
+  connect(LP_Pump.C2, ExtractionValve.C1)
+    annotation (Line(points={{762,-436},{802,-436}}, color={0,0,255}));
+  connect(HP_Drum.yLevel,regulation_Niveau_HP. MesureNiveauEau)
+    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
+  connect(regulation_Niveau_HP.SortieReelle1, HP_FeedValve.Ouv)
+    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
+  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
+    annotation (Line(
+      points={{208.7,122},{234,122},{234,110},{261.5,110}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(IP_Drum.yLevel,regulation_Niveau_MP. MesureNiveauEau)
+    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
+  connect(regulation_Niveau_MP.SortieReelle1, IP_FeedValve.Ouv)
+    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
+  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
+    annotation (Line(
+      points={{505.7,123},{529.85,123},{529.85,112},{567.5,112}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(LP_Drum.yLevel,regulation_Niveau_BP. MesureNiveauEau)
+    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
+  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
+    annotation (Line(
+      points={{741.8,-238},{752,-238},{752,-269},{757.5,-269}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(regulation_Niveau_Condenseur.SortieReelle1, ExtractionValve.Ouv)
+    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
+  connect(SensorQ_WaterBP.C1, LP_Economizer.Cws2)
+    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
+  connect(LP_Economizer.Cws1, Dp_Cond_Out2.C2)
+    annotation (Line(points={{680,-70},{680,-186},{902,-186},{902,-258}}));
+  connect(SensorQ_SteamCondenser.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
+    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,-280.9}}));
+  connect(regulation_Niveau_Condenseur.MesureDebitEau, SensorQ_WaterCondenser.Measure)
+    annotation (Line(points={{757.45,-274.95},{750,-274.95},{750,-310},{792,-310},
+          {792,-412},{692.13,-412}}));
+  connect(ConstantVanneHP_Turbine.y, HP_Turbine_Valve.Ouv)
+    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
+  connect(regulation_Niveau_BP.SortieReelle1, LP_SteamValve.Ouv)
+    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
+  connect(LP_FeedValve.Ouv, LP_SteamValve_Constante.y)
+    annotation (Line(points={{640,67},{640,81},{653.4,81}}));
+  connect(HP_Economizer_1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
+          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
+  connect(VolumeECO_HP1_2.Cs, HP_Economizer_2.Cws1) annotation (Line(points={{
+          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
+  connect(HP_Economizer_2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
+          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
+  connect(VolumeECO_HP2_3.Cs, HP_Economizer_3.Cws1) annotation (Line(points={{
+          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
+  connect(HPIP_FeedValve1.C1, HP_Pump.C2)
+    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-36},{824,-36}}));
+  connect(IP_Pump.C2, HPIP_FeedValve2.C1) annotation (Line(points={
+          {824,16},{870,16},{870,-142.8},{804,-142.8}}, color={0,0,255}));
+  connect(StopPumpingMp1.y, HPIP_FeedValve1.Ouv)
+    annotation (Line(
+      points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,-123.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(StopPumpingHP1.y, HPIP_FeedValve2.Ouv)
+    annotation (Line(
+      points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,-163.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(HPIP_FeedValve1.C2, HP_Economizer_1.Cws1) annotation (Line(
+        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
+          -6},{526,-30}}, color={0,0,255}));
+  connect(IP_Economizer.Cws1, HPIP_FeedValve2.C2)
+    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
+  connect(ConstantVanneIP_Turbine.y, IP_Turbine_Valve.Ouv)
+    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
+  connect(HP_Turbine_Valve.C2, VolumePreTHP.Ce) annotation (Line(points={
+          {-104,-230},{-62,-230}}, color={255,0,0}));
+  connect(DoubleDebitMP.Cs, IP_Turbine_Valve.C1) annotation (Line(points=
+          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
+  connect(IP_Turbine_Valve.C2, VolumeIP.Ce1) annotation (Line(
+        points={{-104,-314},{-60,-314}}, color={255,0,0}));
+  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(points={{620,-353},
+          {638,-353},{638,-352},{639,-352.8}}, color={0,0,255}));
+  connect(Condenser.Cse, PuitsCaloporteur.C)
+    annotation (Line(points={{719,-352},{736,-352}}, color={0,0,255}));
+  connect(SensorQ_SteamCondenser.C2, Condenser.Cv) annotation (Line(points={{
+          679.3,-274.2},{679.3,-288.1},{679,-288.1},{679,-304}}, color={0,0,255}));
+  connect(SensorQ_WaterCondenser.C1, Condenser.Cl)
+    annotation (Line(points={{680.3,-402},{679.8,-402},{679.8,-384}}));
+  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
+    annotation (Line(
+      points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(Condenser.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
+    annotation (Line(points={{723,-372.8},{780,-372.8},{780,-326},{732,-326},{
+          732,-263},{757.5,-263}}));
+  connect(LP_Drum.Cs, SensorQ_WaterBP_Out.C1) annotation (Line(points={{578,22},
+          {564,22},{564,16},{642,16},{642,16.2},{687,16.2}}, color={0,0,255}));
+  connect(LP_Drum.Ce1, LP_FeedValve.C2)
+    annotation (Line(points={{618,50},{630,50}}));
+  connect(IP_Drum.Ce1, IP_FeedValve.C2)
+    annotation (Line(points={{358,50},{378,50}}));
+  connect(HP_Drum.Ce1, HP_FeedValve.C2)
+    annotation (Line(points={{38,50},{58,50}}));
+  connect(VolumePreTHP.Cs3, HP_Turbine.Ce) annotation (Line(points={{-42,-230},{
+          -2.2,-230}}, color={255,0,0}));
+  connect(VolumeIP.Cs, IP_Turbine.Ce) annotation (Line(points={{-40,-314},
+          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
+  connect(IP_Turbine.Cs, VolumeIP1.Ce1) annotation (Line(points={{358.2,
+          -230},{408,-230}}, color={255,0,0}));
+  connect(VolumeIP1.Cs, LP_Turbine.Ce) annotation (Line(points={{428,
+          -230},{575.8,-230}}, color={255,0,0}));
+  connect(LP_Turbine.Cs, Dp_Cond_In.C1)
+    annotation (Line(points={{616.2,-230},{640,-230}}, color={255,0,0}));
+  connect(IP_Economizer.Cws2, SensorQ_WaterMP.C1) annotation (Line(points={{
+          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
+  connect(IP_Turbine.MechPower, Alternateur.Wmec2)
+    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
+  connect(LP_Turbine.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
+          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
+  connect(HP_Turbine.MechPower, Alternateur.Wmec3)
+    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
+  connect(heatSource.C[1], HP_Drum.Cex) annotation (Line(points={{18,68.3},{18,
+          50}}, color={191,95,0}));
+  connect(heatSource1.C[1], IP_Drum.Cex) annotation (Line(points={{339,68.3},{
+          339,50}}, color={191,95,0}));
+  connect(heatSource2.C[1], LP_Drum.Cex) annotation (Line(points={{598,64.3},{
+          598,50}}, color={191,95,0}));
+  connect(Gain_2GasTurbine.y, Alternateur.Wmec5)
+    annotation (Line(points={{3,-438},{402,-438}}));
+  connect(SensorQ_WaterHP.C1, HP_Economizer_4.Cws2)
+    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
+  connect(IP_Pump.rpm_or_mpower, StopPumpingMp.y)
+    annotation (Line(
+      points={{814,5},{814,0},{904.1,0}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+  connect(HP_Pump.rpm_or_mpower, StopPumpingHP.y)
+    annotation (Line(
+      points={{814,-47},{814,-66},{905.1,-66}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+  connect(LP_Pump.rpm_or_mpower, StopPumpingBP.y) annotation (Line(
+      points={{752,-447},{754,-447},{754,-456},{878,-456},{878,-442},{905.1,-442}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+
+  connect(SourceFumees.C,GasTurbine. Entree_air)
+                                                annotation (Line(
+      points={{-495,-51},{-471,-51}},
+      color={0,0,0},
+      thickness=1));
+  connect(sourceCombustible.C,GasTurbine. Entree_combustible) annotation (Line(
+        points={{-385,42},{-367,42},{-367,13}}, color={0,0,0}));
+  connect(sourceEau.C,GasTurbine. Entree_eau_combustion)
+    annotation (Line(points={{-445,42},{-445,13}}, color={0,0,255}));
+  connect(GasTurbine.Sortie_fumees, HP_SuperHeater_3.Cfg1) annotation (Line(
+      points={{-341,-51},{-290,-50},{-304,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(GasTurbine.PuissanceMeca, Gain_2GasTurbine.u)
+    annotation (Line(points={{-338.4,-76.6},{-326,-76.6},{-326,-438},{-19,-438}},
+        color={0,0,255}));
+  connect(sourceCombustible.IMassFlow,rampeQfuel. y)
+    annotation (Line(
+      points={{-403,51},{-403,90},{-517,90}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(Humidite.y, GasTurbine.Huminide)
+    annotation (Line(
+      points={{-515.95,30},{-492,30},{-492,-12.6},{-473.6,-12.6}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(rampeIQair.y,SourceFumees. IMassFlow)
+    annotation (Line(
+      points={{-518,-10},{-518,-36},{-517,-36},{-517,-39.5}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(rampeTair.y, SourceFumees.ITemperature)
+    annotation (Line(
+      points={{-518,-90},{-516,-90},{-516,-88},{-517,-88},{-517,-62.5}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(HP_Turbine.Cs,SeparateurMP. Ce1)   annotation (Line(points={{38.2,-230},
+          {74,-230},{74,-210}}, color={255,0,0}));
+  connect(SeparateurMP.Cs1, HP_PressureLoss_1.C1)
+    annotation (Line(points={{74,-190},{74,-170},{88,-170}}, color={255,0,0}));
+  connect(HP_PressureLoss_1.C2, MoitieDebitHP.Ce)
+    annotation (Line(points={{102,-170},{114,-170}}, color={0,0,255}));
+  connect(SeparateurMP.Cs2, HP_IP_PressureLoss.C1)
+    annotation (Line(points={{84,-200},{134,-200}}, color={255,0,0}));
+  connect(HP_IP_PressureLoss.C2, VolumeIP1.Ce3) annotation (Line(points={{154,-200},
+          {418,-200},{418,-220}}, color={255,0,0}));
+  connect(Q_water.y, SourceCaloporteur.IMassFlow)
+    annotation (Line(points={{576,-354},{582,-354},{582,-341},{596,-341}}));
+  connect(rampePout.y, SinkP_Gas.IPressure)
+    annotation (Line(points={{732,-74},{752,-74},{752,-50},{727,-50}}));
+  annotation (Diagram(graphics,
+                      coordinateSystem(preserveAspectRatio=false,extent={{-550,
+            -460},{950,150}},
+        initialScale=0.1)), Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    experiment(StopTime=2500),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end LoadVariation;
diff --git a/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.mo b/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.mo
index ebb0e4d7cd0a1c3bd69b8b8113ca6e995226b728..0fd08b9b6ced822250305ec23925f12206e84977 100644
--- a/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.mo
+++ b/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.mo
@@ -1,131 +1,131 @@
-within ThermoSysPro.Examples.Book.PowerPlants;
-package CombinedCyclePowerPlant "Models of a combined cycle power plant"
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This package contains two models for a real combined cycle power plant:</p>
-<ul>
-<li>LoadVariation to simulate a load variation from 100&percnt; to 50&percnt;</li>
-<li>GasTurbineTrip to simulate a full gas turbine trip</li>
-</ul>
-<p><br>The two models are documented in Sect. 6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end CombinedCyclePowerPlant;
+within ThermoSysPro.Examples.Book.PowerPlants;
+package CombinedCyclePowerPlant "Models of a combined cycle power plant"
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This package contains two models for a real combined cycle power plant:</p>
+<ul>
+<li>LoadVariation to simulate a load variation from 100&percnt; to 50&percnt;</li>
+<li>GasTurbineTrip to simulate a full gas turbine trip</li>
+</ul>
+<p><br>The two models are documented in Sect. 6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end CombinedCyclePowerPlant;
diff --git a/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.order b/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.order
index 58c337c9a58da48e6197e99a4be3ac0034ef2a8f..9ed870f71163cde96309f1ec54001b36a161a43b 100644
--- a/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.order
+++ b/ThermoSysPro/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.order
@@ -1,2 +1,2 @@
-LoadVariation
-GasTurbineTrip
+LoadVariation
+GasTurbineTrip
diff --git a/ThermoSysPro/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo b/ThermoSysPro/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo
index 4d5283623430c8cd94ba78e4e80c1813b1a022a1..1028bc6d5329a0dfd58245d7172e72d4453af8e6 100644
--- a/ThermoSysPro/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo
+++ b/ThermoSysPro/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo
@@ -1,880 +1,880 @@
-within ThermoSysPro.Examples.Book.PowerPlants;
-model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plant with PTSC"
-  import ThermoSysPro;
-
-//parameter Real L1 = 500 "Longueur de la première chaine de capteurs";
-parameter Real L1 = 500 "Longueur de la première chaine de capteurs";
-parameter Integer Ns1 = 20
-    "Nombre de mailles de la première chaine de capteurs";
-
-parameter Real L2 = 80 "Longueur de la deuxième chaine de capteurs";
-parameter Integer Ns2 = 5 "Nombre de mailles de la deuxième échangeur";
-
-parameter Real L3 = 450 "Longueur de la première chaine de capteurs";
-parameter Integer Ns3 = 80 "Nombre de mailles de la première échangeur";
-
-//parameter Real L4 = 7.9254 "Longueur de la première chaine de capteurs";
-parameter Real L4 = 20 "Longueur de la première chaine de capteurs";
-parameter Integer Ns4 = 3 "Nombre de mailles de la première échangeur";
-
-  WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_2(
-    option_temperature=2,
-    L=L2,
-    Ns=Ns2,
-    T0={659.137,684.387,693.983,697.543,698.861},
-    h0=fill(650e3, Ns2),
-    D=0.04,
-    hcCorr=2,
-    ntubes=3,
-    inertia=false,
-    advection=false,
-    P(start={100000.0,8120050.0,8098500.0,8074750.0,8050150.0,8025170.0,8000000.0}),
-    h(start={2756570.0,3040300.0,3147840.0,3187560.0,3202330.0,3208020.0,3208020.0}),
-    mu2(start={1.94524E-005,0.0002,0.0002,0.0002,0.0002,0.0002}),
-    pro2(d(start={43.2944,998.0,998.0,998.0,998.0,998.0})))
-                     annotation (                        Placement(
-        transformation(extent={{-31,34},{25,78}}, rotation=0)));
-
-  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi2(
-    cpw=1000,
-    steady_state=true,
-    lambda=26,
-    L=L2,
-    Ns=Ns2,
-    D=0.04,
-    ntubes=3,
-    e=0.003,
-    Tp2(start={699.6,697.841,694.783,686.553,664.851}),
-    Tp(start={662.094,685.508,694.397,697.697,698.921}))
-                     annotation (                         Placement(
-        transformation(extent={{-34,54},{26,102}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss PerteCharge_Huile_3(K=1e-6,
-      p_rho=900,
-    C1(h_vol(start=462620.0)),
-    C2(h_vol(start=462620.0)))
-    annotation (
-    Placement(transformation(
-        origin={-134,138.5},
-        extent={{6,-9.5},{-6,9.5}},
-        rotation=180)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Tatm(             Table=
-        [0,300; 1,300])
-    annotation (                             Placement(transformation(extent={{-322,
-            186},{-306,202}},      rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Incidence(
-      Table=[0,0; 1,0])
-    annotation (                             Placement(transformation(extent={{-322,
-            146},{-306,162}},      rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall Paroi3(
-    cpw=1000,
-    steady_state=true,
-    lambda=26,
-    L=L3,
-    Ns=Ns3,
-    D=0.06,
-    e=0.006,
-    Tp1(start={540.2,541.953,544.376,546.789,549.192,551.586,553.969,556.344,
-          558.708,561.063,563.408,565.743,568.068,570.384,572.69,574.986,
-          577.273,579.55,581.817,584.074,586.322,588.559,590.787,593.006,
-          595.214,597.413,599.602,601.782,603.952,606.112,608.262,610.403,
-          612.534,614.656,616.768,618.871,620.965,623.048,625.123,627.188,
-          629.244,631.291,633.329,635.357,637.377,639.387,641.389,643.382,
-          645.366,647.342,649.309,651.268,653.218,655.16,657.095,659.021,660.94,
-          662.851,664.755,666.651,668.54,670.423,672.298,674.167,676.029,
-          677.885,679.735,681.578,683.416,685.248,687.074,688.894,690.709,
-          692.518,694.322,696.121,697.914,699.701,701.483,703.26}),
-    Tp2(start={543.606,546.033,548.45,550.857,553.254,555.642,558.02,560.389,
-          562.747,565.096,567.435,569.765,572.084,574.394,576.694,578.984,
-          581.265,583.536,585.797,588.048,590.289,592.521,594.742,596.954,
-          599.157,601.349,603.532,605.705,607.869,610.022,612.166,614.301,
-          616.426,618.541,620.647,622.743,624.83,626.907,628.975,631.033,
-          633.082,635.122,637.153,639.175,641.188,643.191,645.186,647.172,
-          649.15,651.118,653.079,655.03,656.974,658.909,660.837,662.756,664.668,
-          666.572,668.468,670.357,672.239,674.114,675.982,677.844,679.699,
-          681.547,683.39,685.226,687.056,688.88,690.699,692.512,694.319,696.121,
-          697.917,699.708,701.493,703.273,705.048,706.816}),
-    Tp(start={541.71,544.139,546.559,548.969,551.369,553.759,556.14,558.511,
-          560.872,563.224,565.566,567.898,570.22,572.533,574.836,577.129,
-          579.412,581.685,583.949,586.203,588.447,590.682,592.907,595.122,
-          597.327,599.522,601.708,603.884,606.05,608.207,610.354,612.492,614.62,
-          616.738,618.847,620.946,623.036,625.116,627.187,629.249,631.301,
-          633.344,635.378,637.403,639.419,641.426,643.424,645.413,647.393,
-          649.365,651.329,653.284,655.231,657.169,659.1,661.022,662.937,664.845,
-          666.745,668.637,670.522,672.401,674.272,676.137,677.995,679.847,
-          681.693,683.533,685.366,687.194,689.016,690.833,692.643,694.449,
-          696.249,698.043,699.832,701.615,703.393,705.165}))
-                     annotation (                            Placement(
-        transformation(extent={{-105,134},{-45,182}}, rotation=0)));
-  ThermoSysPro.Solar.Collectors.SolarCollector SolarCollector1(
-    EpsGlass=0.86,
-    Gamma=0.83,
-    h=3.06,
-    AlphaGlass=0.0302,
-    RimAngle=70,
-    TauN=0.95,
-    AlphaN=0.96,
-    EpsTube=0.14,
-    R=0.93,
-    Lambda=2.891407518e-2,
-    f=1.78518,
-    AReflector(fixed=false, start=2750),
-    DGlass=0.115,
-    L=L3,
-    Ns=Ns3,
-    DTube=0.07,
-    e=1.e-3,
-    Tglass(start={364.716,365.398,366.082,366.767,367.453,368.14,368.829,
-          369.519,370.209,370.901,371.594,372.288,372.982,373.678,374.374,
-          375.071,375.768,376.466,377.165,377.864,378.564,379.264,379.964,
-          380.665,381.366,382.067,382.769,383.47,384.172,384.873,385.575,
-          386.276,386.978,387.679,388.38,389.081,389.782,390.482,391.182,
-          391.882,392.581,393.28,393.979,394.677,395.375,396.072,396.769,
-          397.465,398.161,398.856,399.551,400.245,400.939,401.632,402.324,
-          403.017,403.708,404.399,405.09,405.78,406.47,407.16,407.849,408.538,
-          409.226,409.915,410.603,411.29,411.978,412.665,413.352,414.039,
-          414.726,415.413,416.099,416.786,417.472,418.158,418.843,419.528}))
-    annotation (Placement(transformation(extent={{-108,166},{-43,200}},
-          rotation=0)));
-  Solar.HeatExchangers.DynamicOnePhaseFlowPipe_Oil
-                                    TubeEcran_3(
-    option_temperature=2,
-    L=L3,
-    Ns=Ns3,
-    T0={539.521,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0},
-    h0=fill(800e3, Ns3),
-    advection=false,
-    dpfCorr=0.4,
-    hcCorr=2,
-    D=0.06,
-    h(start={463696.125,468056.0,473485.0,478907.0,484321.0,489728.0,495127.0,500518.0,
-          505902.0,511278.0,516646.0,522007.0,527360.0,532705.0,538041.0,543370.0,
-          548691.0,554004.0,559309.0,564606.0,569895.0,575175.0,580447.0,585711.0,
-          590967.0,596214.0,601453.0,606683.0,611905.0,617118.0,622323.0,627519.0,
-          632707.0,637886.0,643056.0,648217.0,653370.0,658514.0,663649.0,668775.0,
-          673893.0,679001.0,684100.0,689191.0,694272.0,699345.0,704408.0,709462.0,
-          714507.0,719542.0,724569.0,729586.0,734594.0,739593.0,744582.0,749562.0,
-          754532.0,759493.0,764445.0,769387.0,774320.0,779242.0,784156.0,789059.0,
-          793953.0,798837.0,803712.0,808577.0,813431.0,818276.0,823111.0,827936.0,
-          832752.0,837557.0,842352.0,847137.0,851911.0,856676.0,861430.0,866175.0,
-          870908.0,870908.0}))
-                     annotation (                            Placement(
-        transformation(extent={{-103,117},{-47,161}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss PerteCharge_Huile_4(K=1e-6,
-      p_rho=650,
-    C2(h_vol(start=870908.0)))
-    annotation (
-    Placement(transformation(
-        origin={-5,139},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  Solar.HeatExchangers.DynamicOnePhaseFlowPipe_Oil
-                                    TubeEcran_22(
-    option_temperature=2,
-    Ns=Ns2,
-    T0={698.976,700.0,700.0,700.0,700.0},
-    h0=fill(800e3, Ns2),
-    L=L2,
-    D=0.04,
-    advection=false,
-    hcCorr=2,
-    dpfCorr=0.4,
-    ntubes=3,
-    h(start={871999.6875,870017.0,867699.0,861464.0,844586.0,800057.0,800057.0}))
-                     annotation (                         Placement(
-        transformation(extent={{24,122},{-33,78}}, rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi1(
-    cpw=1000,
-    steady_state=true,
-    lambda=26,
-    L=L1,
-    Ns=Ns1,
-    D=0.04,
-    ntubes=3,
-    e=0.003,
-    Tp1(start={532.912,533.493,534.161,534.93,535.816,536.836,538.01,539.364,
-          540.926,542.728,544.809,547.216,550.002,553.232,556.986,561.36,
-          566.473,572.131,573.043,574.577}),
-    Tp2(start={589.9,577.664,573.793,567.743,562.426,557.888,553.999,550.657,
-          547.777,545.292,543.143,541.284,539.674,538.278,537.068,536.017,
-          535.105,534.312,533.624,533.026}),
-    Tp(start={532.971,533.561,534.239,535.021,535.92,536.956,538.149,539.525,
-          541.111,542.943,545.059,547.506,550.341,553.629,557.453,561.912,
-          567.13,572.991,575.434,581.427}))
-                     annotation (                            Placement(
-        transformation(extent={{-174,54},{-114,102}}, rotation=0)));
-  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_1(
-    option_temperature=2,
-    L=L1,
-    Ns=Ns1,
-    T0=fill(300, Ns1),
-    h0=fill(650e3, Ns1),
-    D=0.04,
-    ntubes=3,
-    inertia=false,
-    advection=false,
-    P(start={8716030.0,8695070.0,8674080.0,8653070.0,8632030.0,8610950.0,8589840.0,
-          8568690.0,8547480.0,8526210.0,8504870.0,8483450.0,8461930.0,8440290.0,
-          8418510.0,8396570.0,8374420.0,8352020.0,8329300.0,8305110.0,8256160.0,
-          8135653.0}),
-    h(start={1130270.0,1132680.0,1135470.0,1138670.0,1142370.0,1146630.0,1151550.0,
-          1157240.0,1163810.0,1171420.0,1180240.0,1190480.0,1202400.0,1216300.0,
-          1232580.0,1251720.0,1274350.0,1301310.0,1336580.0,1434650.0,1715580.0,
-          2756578.25}))
-                     annotation (                           Placement(
-        transformation(extent={{-171,34},{-115,78}}, rotation=0)));
-  Solar.HeatExchangers.DynamicOnePhaseFlowPipe_Oil
-                                    TubeEcran_11(
-    option_temperature=2,
-    L=L1,
-    Ns=Ns1,
-    T0={587.815,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,
-        550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0},
-    h0=fill(650e3, Ns1),
-    D=0.04,
-    advection=false,
-    hcCorr=2,
-    dpfCorr=0.4,
-    ntubes=3,
-    h(start={801122.25,638880.0,582613.0,562383.0,546913.0,533929.0,522949.0,513609.0,
-          505631.0,498794.0,492917.0,487857.0,483492.0,479721.0,476460.0,473637.0,
-          471191.0,469070.0,467231.0,465634.0,464248.0,464248.0}))
-                     annotation (                            Placement(
-        transformation(extent={{-116,122},{-173,78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.SteamDryer Secheur(proe(x(start=0.273553)))
-    annotation (Placement(transformation(extent={{-86,39},{-62,63}}, rotation=0)));
-  WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenseur(
-    A=5,
-    Kvl=100,
-    e=0.0005,
-    L=3.5,
-    Vf0=0.15,
-    ntubes=300,
-    steady_state=false,
-    V=30,
-    P0=5000,
-    Cv(Q(start=1.13)),
-    Pfond(start=5000.53),
-    proe(d(start=995.533)))
-                     annotation (                           Placement(
-        transformation(extent={{116,-51},{156,-11}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP puitsPCaloporteur(
-                    mode=0, P0=1e5,
-    option_temperature=2) annotation (                           Placement(
-        transformation(extent={{178,-48},{206,-22}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss PerteChargeCondPompe(             K=1e-6,
-    C2(h_vol(start=137765.0)),
-    Pm(start=5000.53))
-    annotation (
-    Placement(transformation(
-        origin={117,-82.5},
-        extent={{-6,-9.5},{6,9.5}},
-        rotation=180)));
-  WaterSteam.PressureLosses.InvSingularPressureLoss
-    Connection_HQ_Secheur_Ballon(Q(start=1))
-    annotation (
-    Placement(transformation(
-        origin={-73,-15},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  WaterSteam.Machines.StaticCentrifugalPump Pompe(
-    Pm(fixed=false, start=3502560.0),
-    a1(fixed=false) = -4.9345734425e8,
-    hn(start=716.167),
-    a3=2000,
-    b1=-3500,
-    b2=510,
-    Q(fixed=true, start=1.13),
-    C2(h_vol(start=150161.0)),
-    Qv(start=0.00113454),
-    h(start=143963.0))           annotation (                         Placement(
-        transformation(extent={{84,-91},{64,-71}}, rotation=0)));
-  WaterSteam.Volumes.VolumeC Ballon(
-    V=1,
-    h0=3e5,
-    h(start=1125640.0),
-    P0=7000000,
-    dynamic_mass_balance=true,
-    P(start=7000000))
-    annotation (                           Placement(transformation(extent={{-63,-91},
-            {-83,-71}},          rotation=0)));
-  WaterSteam.PressureLosses.ControlValve ControlValveBallon(             Cvmax(
-        fixed=true) = 300, C2(P(fixed=false, start=70e5)),
-    Pm(start=7000060.0))
-    annotation (
-    Placement(transformation(
-        origin={-30,-75},
-        extent={{-10,10},{10,-10}},
-        rotation=180)));
-  WaterSteam.PressureLosses.ControlValve ControlValveBallon1(             Cvmax=
-       10,
-    C1(P(start=10618800.0), h_vol(start=1127430.0)),
-    C2(h_vol(start=1127430.0)),
-    Pm(start=9676220.0))
-    annotation (
-    Placement(transformation(
-        origin={-212,-75},
-        extent={{-10,10},{10,-10}},
-        rotation=180)));
-  WaterSteam.BoundaryConditions.SourceP sourcePCaloporteur(
-    option_temperature=2,
-    h0=63.03e3,
-    P0(fixed=false) = 500000,
-    Q(fixed=true, start=14.9263))
-                                annotation (                         Placement(
-        transformation(extent={{66,-49},{94,-22}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(            K=1e-6)
-    annotation (
-    Placement(transformation(
-        origin={171,-35},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  WaterSteam.PressureLosses.SingularPressureLoss PerteChargeCondPompe2(            K=1e-6, pro(d(
-          start=999.099)))
-    annotation (
-    Placement(transformation(
-        origin={101,-36},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  InstrumentationAndControl.Blocks.Sources.Constante Ouv(             k=0.5)
-    annotation (                           Placement(transformation(extent={{-48,-62},
-            {-38,-52}},          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Ouv1(             k=0.5)
-    annotation (                             Placement(transformation(extent={{-231,
-            -62},{-221,-52}},      rotation=0)));
-  WaterSteam.Machines.StaticCentrifugalPump Pompe1(
-    Pm(fixed=false),
-    hn(start=466.292),
-    a3=2000,
-    b2=510,
-    b1=-3500,
-    a1(fixed=false) = -9.5e8,
-    Q(fixed=false, start=0.65),
-    C2(P(fixed=false, start=75e5)),
-    C1(P(fixed=true, start=70e5), h_vol(start=1125640.0)),
-    Qv(start=0.00521975),
-    h(start=1126540.0))          annotation (
-      Placement(transformation(extent={{-158,-91},{-178,-71}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(            K=1e-6)
-    annotation (
-    Placement(transformation(
-        origin={-120,-81},
-        extent={{-6,-10},{6,10}},
-        rotation=180)));
-  WaterSteam.Machines.StodolaTurbine Turbine(
-    W_fric=1,
-    Cst(fixed=false,
-      start=68143000000.0)=
-                       6.19323e6,
-    Qmax=0.001,
-    eta_is_min=0.80,
-    rhos(start=10),
-    eta_is_nom=0.92,
-    Pe(fixed=true, start=8000000),
-    Ps(fixed=false, start=1800000),
-    pros(d(start=8.36949)))
-                      annotation (                       Placement(
-        transformation(extent={{47,72},{73,40}}, rotation=0)));
-  WaterSteam.Machines.Generator Alternateur
-    annotation (                          Placement(transformation(extent={{168,90},
-            {198,130}},     rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi4(
-    cpw=1000,
-    steady_state=true,
-    lambda=26,
-    D=0.04,
-    L=L4,
-    Ns=Ns4,
-    ntubes=3,
-    e=0.003,
-    Tp1(start={532.06,532.262,532.478}),
-    Tp2(start={533.3,532.429,532.217}),
-    Tp(start={532.141,532.349,532.57}))
-                     annotation (
-    Placement(transformation(
-        origin={-269,-12},
-        extent={{-24,-30},{24,30}},
-        rotation=90)));
-  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(
-    option_temperature=2,
-    D=0.04,
-    L=L4,
-    Ns=Ns4,
-    T0=fill(300, Ns4),
-    h0=fill(650e3, Ns4),
-    ntubes=3,
-    inertia=false,
-    advection=false,
-    P(start={8751668.0,8729230.0,8724830.0,8720430.0,8733863.0}),
-    h(start={1128519.5,1128310.0,1129260.0,1130270.0,1131729.0}))
-                     annotation (
-    Placement(transformation(
-        origin={-245.5,-11.5},
-        extent={{-23.5,-23.5},{23.5,23.5}},
-        rotation=90)));
-  Solar.HeatExchangers.DynamicOnePhaseFlowPipe_Oil
-                                    TubeEcran_44(
-    option_temperature=2,
-    L=L4,
-    Ns=Ns4,
-    T0={532.656,550.0,550.0},
-    h0=fill(650e3, Ns4),
-    advection=false,
-    D(fixed=true) = 0.04,
-    C2(P(fixed=false, start=16.99e5), Q(fixed=false, start=2)),
-    hcCorr=2,
-    dpfCorr=0.4,
-    ntubes=3,
-    h(start={465547.78125,463670.0,463128.0,462620.0,462620.0}))
-                     annotation (
-    Placement(transformation(
-        origin={-293,-12},
-        extent={{23,24},{-23,-24}},
-        rotation=90)));
-  WaterSteam.Machines.StaticCentrifugalPump Pompe2(
-    Pm(fixed=false),
-    b2=510,
-    b1=-3500,
-    hn(start=350),
-    adiabatic_compression=true,
-    C1(P(fixed=false, start=17e5), h_vol(start=462620.0)),
-    a3(fixed=true) = 500,
-    C2(P(fixed=false, start=24.5146e5)),
-    p_rho=900,
-    Q(fixed=true, start=7.2),
-    a1(fixed=false) = -1e8)      annotation (
-      Placement(transformation(extent={{-184,129},{-164,149}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss PerteCharge_Huile_2(K=1e-6,
-      p_rho=900)
-    annotation (
-    Placement(transformation(
-        origin={-212,138.5},
-        extent={{6,-9.5},{-6,9.5}},
-        rotation=180)));
-  WaterSteam.PressureLosses.SingularPressureLoss PerteCharge_Huile_1(K=1e-6,
-      p_rho=900)
-    annotation (
-    Placement(transformation(
-        origin={-286,138.5},
-        extent={{6,-9.5},{-6,9.5}},
-        rotation=180)));
-  WaterSteam.Machines.StodolaTurbine TurbineMp(
-    W_fric=1,
-    Cst(fixed=false,
-      start=8378550000.0)=
-                       6.19323e6,
-    Qmax=0.001,
-    eta_is_min=0.80,
-    rhos(start=10),
-    eta_is_nom=0.94,
-    Pe(fixed=true, start=1800000),
-    Ps(fixed=false, start=5000),
-    pros(d(start=0.0434309)),
-    xm(start=0.908482))
-                      annotation (                         Placement(
-        transformation(extent={{105,72},{131,40}}, rotation=0)));
-  WaterSteam.Volumes.Tank Tank(
-    p_rho=895,
-    A=0.1,
-    z0=1,
-    h0=423600,
-    steady_state=true,
-    h(start=462620.0),
-    rho(start=895),
-    Patm=1670000,
-    P(start=1699000))
-    annotation (
-    Placement(transformation(
-        origin={-248,142},
-        extent={{6,6},{-6,-6}},
-        rotation=180)));
-  WaterSteam.Volumes.VolumeA VolumeMP(
-    V=1,
-    rho(start=10),
-    h0=2.4e6,
-    h(start=2868560.0),
-    P0=1800000,
-    dynamic_mass_balance=true,
-    P(start=1800000),
-    Cs2(Q(start=0.255955)))
-    annotation (                       Placement(transformation(extent={{84,50},
-            {94,62}}, rotation=0)));
-  WaterSteam.Volumes.VolumeA VolumeCond(
-    V=1,
-    rho(start=10),
-    h(start=1837610.0),
-    h0=2.1e6,
-    P0=5000,
-    dynamic_mass_balance=false,
-    P(start=5000))
-    annotation (                         Placement(transformation(extent={{141,24},
-            {130,34}},     rotation=0)));
-  WaterSteam.HeatExchangers.NTUWaterHeating Re_1(
-    KPurge=10,
-    SPurge=0.3,
-    Se(h(fixed=true, start=600e3)),
-    SCondDes(fixed=false,
-      start=9.57697) =      3,
-    HDesF(start=583561.0),
-    HeiF(start=150619.0),
-    Hep(start=884611.0),
-    SDes(start=0.932441),
-    h(start=882589.0),
-    lambdaE=1,
-    KCond=500)  annotation (                         Placement(transformation(
-          extent={{42,-106},{0,-56}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss Dp_Re_1(
-    rho(start=10),
-    h(start=2400e3),
-    Q(start=0.1),
-    K=1e-4,
-    Pm(start=1800000))
-    annotation (
-    Placement(transformation(
-        origin={31.5,-13.5},
-        extent={{5.5,-5.5},{-5.5,5.5}},
-        rotation=90)));
-  WaterSteam.PressureLosses.InvSingularPressureLoss invSingularPressureLoss
-    annotation (                            Placement(transformation(extent={{108,
-            -106},{122,-90}},     rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss Dp_Cond_2(
-    K=1e-4,
-    rho(start=10),
-    Q(start=0.35),
-    Pm(start=5000.53),
-    h(start=2100e3))
-    annotation (
-    Placement(transformation(
-        origin={135.5,8.5},
-        extent={{5.5,-5.5},{-5.5,5.5}},
-        rotation=90)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Rayonnement(Table=[0,700;
-        200,2; 1200,2; 1800,2; 2400,0.1; 3000,0.1; 3600,0.1; 4200,327; 4800,287;
-        5400,176; 6000,410; 6600,299; 7200,26; 7800,168; 8400,485; 9000,482;
-        9600,664; 10200,344; 10800,684; 11400,564; 12000,460; 12600,560; 13200,
-        611; 13800,557; 14400,682; 15000,785; 15600,321; 16200,850; 16800,330;
-        17400,619; 18000,480; 18600,192; 19200,750; 19800,650; 20400,450; 21000,
-        350; 21600,763; 22200,455; 22800,290; 23400,494; 24000,800; 24600,565;
-        25200,320; 25800,110; 26400,479; 27000,263; 27600,747; 28200,805; 28800,
-        576; 29400,550; 30000,470; 30600,395; 31200,315; 31800,657; 32400,670;
-        33000,381; 33600,209; 34200,457; 34800,320; 35400,13; 36000,0.1; 36600,
-        0.1; 37200,0.1; 37800,0.1; 38400,0.1; 39000,0.1; 39600,0.1; 40200,0.1;
-        40800,0; 41400,0; 42000,0; 42600,0; 43200,0; 43800,0])
-    annotation (Placement(transformation(extent={{-322,166},{-306,182}},
-          rotation=0)));
-equation
-
-public
-  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=3, P(start=
-          2300000))
-    annotation (Placement(transformation(extent={{21,128},{37,150}})));
-  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=1/3, P(start=
-          2400000))                              annotation (Placement(
-        transformation(
-        extent={{-7.75,-9.75},{7.75,9.75}},
-        rotation=0,
-        origin={-158.25,139.75})));
-equation
-  connect(TubeEcran_2.CTh, Paroi2.WT1) annotation (
-    Line(points={{-3,62.6},{-4,64},{-4,73.2}}, color={191,95,0}));
-  connect(SolarCollector1.ITemperature,Paroi3. WT2)
-                                                   annotation (
-    Line(points={{-74.3026,166.992},{-75,166.992},{-75,162.8}}, color={191,95,0}));
-  connect(Incidence.y,SolarCollector1. IncidenceAngle)
-    annotation (
-              Line(points={{-305.2,154},{-262,154},{-262,182},{-106.289,182},{
-          -106.289,183}}));
-  connect(TubeEcran_3.CTh,Paroi3. WT1) annotation (
-    Line(points={{-75,145.6},{-75,153.2}}, color={191,95,0}));
-  connect(Tatm.y,SolarCollector1. AtmTemp) annotation (
-    Line(points={{-305.2,194},{-282,194},{-282,197.167},{-106.289,197.167}}));
-  connect(PerteCharge_Huile_3.C2, TubeEcran_3.C1)   annotation (
-    Line(
-      points={{-128,138.5},{-102,138.5},{-102,140},{-103,139}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(TubeEcran_3.C2, PerteCharge_Huile_4.C1)
-    annotation (
-    Line(
-      points={{-47,139},{-11,139}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(Paroi2.WT2, TubeEcran_22.CTh) annotation (
-    Line(points={{-4,82.8},{-4,93.4},{-4.5,93.4}}, color={191,95,0}));
-  connect(TubeEcran_1.CTh,Paroi1. WT1) annotation (
-    Line(points={{-143,62.6},{-144,64},{-144,73.2}}, color={191,95,0}));
-  connect(Paroi1.WT2,TubeEcran_11. CTh) annotation (
-    Line(points={{-144,82.8},{-144,93.4},{-144.5,93.4}}, color={191,95,0}));
-  connect(TubeEcran_11.C1, TubeEcran_22.C2)
-    annotation (
-    Line(
-      points={{-116,100},{-33,100}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(TubeEcran_1.C2, Secheur.Cev) annotation (
-    Line(
-      points={{-115,56},{-85.88,56},{-85.88,55.8}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Secheur.Csv, TubeEcran_2.C1) annotation (
-    Line(
-      points={{-62.12,55.8},{-60,55.8},{-60,56},{-31,56}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pompe.C1,PerteChargeCondPompe. C2)
-    annotation (
-    Line(
-      points={{84,-81},{84,-82},{111,-82},{111,-82.5}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Ballon.Ce1,ControlValveBallon. C2)
-    annotation (
-    Line(
-      points={{-63,-81},{-40,-81}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Secheur.Csl,Connection_HQ_Secheur_Ballon. C1) annotation (
-    Line(
-      points={{-73.88,39},{-73.88,-5},{-73,-5}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Connection_HQ_Secheur_Ballon.C2,Ballon. Ce2) annotation (
-    Line(
-      points={{-73,-25},{-73,-72}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(sourcePCaloporteur.C,PerteChargeCondPompe2. C1) annotation (
-    Line(points={{94,-35.5},{94,-36},{95,-36}}, color={0,0,255}));
-  connect(PerteChargeCondPompe1.C2,puitsPCaloporteur. C) annotation (
-    Line(points={{177,-35},{178,-36},{178,-35}}, color={0,0,255}));
-  connect(Pompe1.C2,ControlValveBallon1. C1) annotation (
-    Line(
-      points={{-178,-81},{-202,-81}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(PerteChargeCondPompe3.C1,Ballon. Cs)
-    annotation (
-    Line(
-      points={{-114,-81},{-83,-81}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Ouv1.y,ControlValveBallon1. Ouv)
-    annotation (                                         Line(points={{-220.5,
-          -57},{-212,-57},{-212,-64}}));
-  connect(Ouv.y,ControlValveBallon. Ouv)
-    annotation (                                      Line(points={{-37.5,-57},
-          {-30,-57},{-30,-64}}));
-  connect(PerteChargeCondPompe2.C2,Condenseur. Cee) annotation (
-    Line(points={{107,-36},{109.25,-36},{109.25,-35.4},{116,-35.4}}, color={0,0,255}));
-  connect(Condenseur.Cse,PerteChargeCondPompe1. C1) annotation (
-    Line(points={{156,-35},{160,-34},{160,-35},{165,-35}}, color={0,0,255}));
-  connect(Condenseur.Cl,PerteChargeCondPompe. C1) annotation (
-    Line(
-      points={{136.4,-51},{136.4,-82.5},{123,-82.5}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(PerteChargeCondPompe3.C2, Pompe1.C1) annotation (
-    Line(
-      points={{-126,-81},{-158,-81}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Turbine.MechPower,Alternateur. Wmec5)
-    annotation (                                            Line(points={{74.3,
-          70.4},{76,70.4},{76,94},{168,94}}));
-  connect(TubeEcran_2.C2, Turbine.Ce) annotation (
-    Line(
-      points={{25,56},{46.87,56}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(TubeEcran_4.CTh,Paroi4. WT1) annotation (
-    Line(points={{-252.55,-11.5},{-257,-11.5},{-257,-12},{-263,-12}}, color={191,95,0}));
-  connect(Paroi4.WT2, TubeEcran_44.CTh) annotation (
-    Line(points={{-275,-12},{-285.8,-12},{-285.8,-12}},
-                                                      color={191,95,0}));
-  connect(ControlValveBallon1.C2, TubeEcran_4.C1) annotation (
-    Line(
-      points={{-222,-81},{-245.5,-81},{-245.5,-35}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(TubeEcran_4.C2, TubeEcran_1.C1) annotation (
-    Line(
-      points={{-245.5,12},{-245.5,56},{-171,56}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(TubeEcran_11.C2, TubeEcran_44.C1) annotation (
-    Line(
-      points={{-173,100},{-293,100},{-293,11}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(PerteCharge_Huile_2.C2, Pompe2.C1)   annotation (
-    Line(
-      points={{-206,138.5},{-184,138.5},{-184,139}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(Tank.Cs2, PerteCharge_Huile_2.C1)                    annotation (
-    Line(
-      points={{-242,138.4},{-230,138.4},{-230,138.5},{-218,138.5}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(PerteCharge_Huile_1.C2, Tank.Ce2) annotation (
-    Line(
-      points={{-280,138.5},{-268,138.5},{-268,138.4},{-254,138.4}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(Turbine.Cs, VolumeMP.Ce1) annotation (
-    Line(
-      points={{73.13,56},{84,56}},
-      color={255,0,0},
-      thickness=0.5));
-
-  connect(VolumeMP.Cs1, TurbineMp.Ce) annotation (
-    Line(
-      points={{94,56},{104.87,56}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(TurbineMp.MechPower, Alternateur.Wmec4)
-    annotation (                                                 Line(points={{132.3,
-          70.4},{142,70.4},{142,102},{168,102}}));
-  connect(TurbineMp.Cs, VolumeCond.Ce2) annotation (
-    Line(
-      points={{131.13,56},{135.5,56},{135.5,33.9}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Re_1.Ee, Pompe.C2)
-    annotation (
-    Line(points={{42.42,-81},{64,-81}}, thickness=0.5));
-  connect(VolumeMP.Cs2, Dp_Re_1.C1) annotation (
-    Line(
-      points={{89,50},{90,50},{90,22},{31.5,22},{31.5,-8}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Dp_Re_1.C2, Re_1.Ev) annotation (
-    Line(
-      points={{31.5,-19},{31.5,-36},{8.4,-36},{8.4,-73}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(ControlValveBallon.C1, Re_1.Se)
-    annotation (
-    Line(points={{-20,-81},{0,-81}}, thickness=0.5));
-  connect(Re_1.Sp, invSingularPressureLoss.C1) annotation (
-    Line(
-      points={{33.6,-89.25},{33.6,-98},{108,-98}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(invSingularPressureLoss.C2, VolumeCond.Ce1) annotation (
-    Line(
-      points={{122,-98},{202,-98},{202,29},{141,29}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Dp_Cond_2.C1, VolumeCond.Cs2) annotation (
-    Line(
-      points={{135.5,14},{135.5,24}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Condenseur.Cv, Dp_Cond_2.C2) annotation (
-    Line(
-      points={{136,-11},{136,3},{135.5,3}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(PerteCharge_Huile_4.C2, massFlowMultiplier.Ce) annotation (Line(
-      points={{1,139},{21,139}},
-      color={0,140,72},
-      thickness=0.5));
-  connect(massFlowMultiplier.Cs, TubeEcran_22.C1) annotation (Line(
-      points={{37,139},{63,139},{63,100},{24,100}},
-      color={0,140,72},
-      thickness=0.5));
-  connect(Pompe2.C2, massFlowMultiplier2.Ce) annotation (Line(
-      points={{-164,139},{-166,139},{-166,139.75}},
-      color={0,140,72},
-      thickness=0.5));
-  connect(massFlowMultiplier2.Cs, PerteCharge_Huile_3.C1) annotation (Line(
-      points={{-150.5,139.75},{-140,139.75},{-140,138.5}},
-      color={0,140,72},
-      thickness=0.5));
-  connect(PerteCharge_Huile_1.C1, TubeEcran_44.C2) annotation (Line(
-      points={{-292,138.5},{-319,138.5},{-319,-80},{-293,-80},{-293,-35}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(Rayonnement.y, SolarCollector1.ISun) annotation (Line(points={{-305.2,
-          174},{-280,174},{-280,190.083},{-106.289,190.083}}, color={0,0,255}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(
-      coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-320,-100},{200,200}},
-        grid={2,2},
-        initialScale=0.1),
-      graphics={
-        Text(
-          extent={{-237,-8},{-217,-18}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Eco"),
-        Text(
-          extent={{-164,48},{-126,34}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Evaporator"),
-        Text(
-          extent={{-23,49},{21,33}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Super-heater"),
-        Text(
-          extent={{151,-53},{194,-68}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Condenser"),
-        Text(
-          extent={{-115,215},{-37,197}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Parabolic solar receiver")}),
-    experiment(StopTime=40000),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </h4>
-<p><b>ThermoSysPro Version 3.2 </h4>
-<p>This is the dynamic model of a 1 MWe concentrated solar power plant with a parabolic trough collector. </p>
-<p>It is documented in a<a href=\"https://www.sciencedirect.com/science/article/pii/S1876610214005761\"> conference paper</a> and in Sect. 6.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end ConcentratedSolarPowerPlant_PTSC;
+within ThermoSysPro.Examples.Book.PowerPlants;
+model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plant with PTSC"
+  import ThermoSysPro;
+
+//parameter Real L1 = 500 "Longueur de la première chaine de capteurs";
+parameter Real L1 = 500 "Longueur de la première chaine de capteurs";
+parameter Integer Ns1 = 20
+    "Nombre de mailles de la première chaine de capteurs";
+
+parameter Real L2 = 80 "Longueur de la deuxième chaine de capteurs";
+parameter Integer Ns2 = 5 "Nombre de mailles de la deuxième échangeur";
+
+parameter Real L3 = 450 "Longueur de la première chaine de capteurs";
+parameter Integer Ns3 = 80 "Nombre de mailles de la première échangeur";
+
+//parameter Real L4 = 7.9254 "Longueur de la première chaine de capteurs";
+parameter Real L4 = 20 "Longueur de la première chaine de capteurs";
+parameter Integer Ns4 = 3 "Nombre de mailles de la première échangeur";
+
+  WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_2(
+    option_temperature=2,
+    L=L2,
+    Ns=Ns2,
+    T0={659.137,684.387,693.983,697.543,698.861},
+    h0=fill(650e3, Ns2),
+    D=0.04,
+    hcCorr=2,
+    ntubes=3,
+    inertia=false,
+    advection=false,
+    P(start={100000.0,8120050.0,8098500.0,8074750.0,8050150.0,8025170.0,8000000.0}),
+    h(start={2756570.0,3040300.0,3147840.0,3187560.0,3202330.0,3208020.0,3208020.0}),
+    mu2(start={1.94524E-005,0.0002,0.0002,0.0002,0.0002,0.0002}),
+    pro2(d(start={43.2944,998.0,998.0,998.0,998.0,998.0})))
+                     annotation (                        Placement(
+        transformation(extent={{-31,34},{25,78}}, rotation=0)));
+
+  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi2(
+    cpw=1000,
+    steady_state=true,
+    lambda=26,
+    L=L2,
+    Ns=Ns2,
+    D=0.04,
+    ntubes=3,
+    e=0.003,
+    Tp2(start={699.6,697.841,694.783,686.553,664.851}),
+    Tp(start={662.094,685.508,694.397,697.697,698.921}))
+                     annotation (                         Placement(
+        transformation(extent={{-34,54},{26,102}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss PerteCharge_Huile_3(K=1e-6,
+      p_rho=900,
+    C1(h_vol(start=462620.0)),
+    C2(h_vol(start=462620.0)))
+    annotation (
+    Placement(transformation(
+        origin={-134,138.5},
+        extent={{6,-9.5},{-6,9.5}},
+        rotation=180)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Tatm(             Table=
+        [0,300; 1,300])
+    annotation (                             Placement(transformation(extent={{-322,
+            186},{-306,202}},      rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Incidence(
+      Table=[0,0; 1,0])
+    annotation (                             Placement(transformation(extent={{-322,
+            146},{-306,162}},      rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall Paroi3(
+    cpw=1000,
+    steady_state=true,
+    lambda=26,
+    L=L3,
+    Ns=Ns3,
+    D=0.06,
+    e=0.006,
+    Tp1(start={540.2,541.953,544.376,546.789,549.192,551.586,553.969,556.344,
+          558.708,561.063,563.408,565.743,568.068,570.384,572.69,574.986,
+          577.273,579.55,581.817,584.074,586.322,588.559,590.787,593.006,
+          595.214,597.413,599.602,601.782,603.952,606.112,608.262,610.403,
+          612.534,614.656,616.768,618.871,620.965,623.048,625.123,627.188,
+          629.244,631.291,633.329,635.357,637.377,639.387,641.389,643.382,
+          645.366,647.342,649.309,651.268,653.218,655.16,657.095,659.021,660.94,
+          662.851,664.755,666.651,668.54,670.423,672.298,674.167,676.029,
+          677.885,679.735,681.578,683.416,685.248,687.074,688.894,690.709,
+          692.518,694.322,696.121,697.914,699.701,701.483,703.26}),
+    Tp2(start={543.606,546.033,548.45,550.857,553.254,555.642,558.02,560.389,
+          562.747,565.096,567.435,569.765,572.084,574.394,576.694,578.984,
+          581.265,583.536,585.797,588.048,590.289,592.521,594.742,596.954,
+          599.157,601.349,603.532,605.705,607.869,610.022,612.166,614.301,
+          616.426,618.541,620.647,622.743,624.83,626.907,628.975,631.033,
+          633.082,635.122,637.153,639.175,641.188,643.191,645.186,647.172,
+          649.15,651.118,653.079,655.03,656.974,658.909,660.837,662.756,664.668,
+          666.572,668.468,670.357,672.239,674.114,675.982,677.844,679.699,
+          681.547,683.39,685.226,687.056,688.88,690.699,692.512,694.319,696.121,
+          697.917,699.708,701.493,703.273,705.048,706.816}),
+    Tp(start={541.71,544.139,546.559,548.969,551.369,553.759,556.14,558.511,
+          560.872,563.224,565.566,567.898,570.22,572.533,574.836,577.129,
+          579.412,581.685,583.949,586.203,588.447,590.682,592.907,595.122,
+          597.327,599.522,601.708,603.884,606.05,608.207,610.354,612.492,614.62,
+          616.738,618.847,620.946,623.036,625.116,627.187,629.249,631.301,
+          633.344,635.378,637.403,639.419,641.426,643.424,645.413,647.393,
+          649.365,651.329,653.284,655.231,657.169,659.1,661.022,662.937,664.845,
+          666.745,668.637,670.522,672.401,674.272,676.137,677.995,679.847,
+          681.693,683.533,685.366,687.194,689.016,690.833,692.643,694.449,
+          696.249,698.043,699.832,701.615,703.393,705.165}))
+                     annotation (                            Placement(
+        transformation(extent={{-105,134},{-45,182}}, rotation=0)));
+  ThermoSysPro.Solar.Collectors.SolarCollector SolarCollector1(
+    EpsGlass=0.86,
+    Gamma=0.83,
+    h=3.06,
+    AlphaGlass=0.0302,
+    RimAngle=70,
+    TauN=0.95,
+    AlphaN=0.96,
+    EpsTube=0.14,
+    R=0.93,
+    Lambda=2.891407518e-2,
+    f=1.78518,
+    AReflector(fixed=false, start=2750),
+    DGlass=0.115,
+    L=L3,
+    Ns=Ns3,
+    DTube=0.07,
+    e=1.e-3,
+    Tglass(start={364.716,365.398,366.082,366.767,367.453,368.14,368.829,
+          369.519,370.209,370.901,371.594,372.288,372.982,373.678,374.374,
+          375.071,375.768,376.466,377.165,377.864,378.564,379.264,379.964,
+          380.665,381.366,382.067,382.769,383.47,384.172,384.873,385.575,
+          386.276,386.978,387.679,388.38,389.081,389.782,390.482,391.182,
+          391.882,392.581,393.28,393.979,394.677,395.375,396.072,396.769,
+          397.465,398.161,398.856,399.551,400.245,400.939,401.632,402.324,
+          403.017,403.708,404.399,405.09,405.78,406.47,407.16,407.849,408.538,
+          409.226,409.915,410.603,411.29,411.978,412.665,413.352,414.039,
+          414.726,415.413,416.099,416.786,417.472,418.158,418.843,419.528}))
+    annotation (Placement(transformation(extent={{-108,166},{-43,200}},
+          rotation=0)));
+  Solar.HeatExchangers.DynamicOnePhaseFlowPipe_Oil
+                                    TubeEcran_3(
+    option_temperature=2,
+    L=L3,
+    Ns=Ns3,
+    T0={539.521,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0},
+    h0=fill(800e3, Ns3),
+    advection=false,
+    dpfCorr=0.4,
+    hcCorr=2,
+    D=0.06,
+    h(start={463696.125,468056.0,473485.0,478907.0,484321.0,489728.0,495127.0,500518.0,
+          505902.0,511278.0,516646.0,522007.0,527360.0,532705.0,538041.0,543370.0,
+          548691.0,554004.0,559309.0,564606.0,569895.0,575175.0,580447.0,585711.0,
+          590967.0,596214.0,601453.0,606683.0,611905.0,617118.0,622323.0,627519.0,
+          632707.0,637886.0,643056.0,648217.0,653370.0,658514.0,663649.0,668775.0,
+          673893.0,679001.0,684100.0,689191.0,694272.0,699345.0,704408.0,709462.0,
+          714507.0,719542.0,724569.0,729586.0,734594.0,739593.0,744582.0,749562.0,
+          754532.0,759493.0,764445.0,769387.0,774320.0,779242.0,784156.0,789059.0,
+          793953.0,798837.0,803712.0,808577.0,813431.0,818276.0,823111.0,827936.0,
+          832752.0,837557.0,842352.0,847137.0,851911.0,856676.0,861430.0,866175.0,
+          870908.0,870908.0}))
+                     annotation (                            Placement(
+        transformation(extent={{-103,117},{-47,161}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss PerteCharge_Huile_4(K=1e-6,
+      p_rho=650,
+    C2(h_vol(start=870908.0)))
+    annotation (
+    Placement(transformation(
+        origin={-5,139},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  Solar.HeatExchangers.DynamicOnePhaseFlowPipe_Oil
+                                    TubeEcran_22(
+    option_temperature=2,
+    Ns=Ns2,
+    T0={698.976,700.0,700.0,700.0,700.0},
+    h0=fill(800e3, Ns2),
+    L=L2,
+    D=0.04,
+    advection=false,
+    hcCorr=2,
+    dpfCorr=0.4,
+    ntubes=3,
+    h(start={871999.6875,870017.0,867699.0,861464.0,844586.0,800057.0,800057.0}))
+                     annotation (                         Placement(
+        transformation(extent={{24,122},{-33,78}}, rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi1(
+    cpw=1000,
+    steady_state=true,
+    lambda=26,
+    L=L1,
+    Ns=Ns1,
+    D=0.04,
+    ntubes=3,
+    e=0.003,
+    Tp1(start={532.912,533.493,534.161,534.93,535.816,536.836,538.01,539.364,
+          540.926,542.728,544.809,547.216,550.002,553.232,556.986,561.36,
+          566.473,572.131,573.043,574.577}),
+    Tp2(start={589.9,577.664,573.793,567.743,562.426,557.888,553.999,550.657,
+          547.777,545.292,543.143,541.284,539.674,538.278,537.068,536.017,
+          535.105,534.312,533.624,533.026}),
+    Tp(start={532.971,533.561,534.239,535.021,535.92,536.956,538.149,539.525,
+          541.111,542.943,545.059,547.506,550.341,553.629,557.453,561.912,
+          567.13,572.991,575.434,581.427}))
+                     annotation (                            Placement(
+        transformation(extent={{-174,54},{-114,102}}, rotation=0)));
+  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_1(
+    option_temperature=2,
+    L=L1,
+    Ns=Ns1,
+    T0=fill(300, Ns1),
+    h0=fill(650e3, Ns1),
+    D=0.04,
+    ntubes=3,
+    inertia=false,
+    advection=false,
+    P(start={8716030.0,8695070.0,8674080.0,8653070.0,8632030.0,8610950.0,8589840.0,
+          8568690.0,8547480.0,8526210.0,8504870.0,8483450.0,8461930.0,8440290.0,
+          8418510.0,8396570.0,8374420.0,8352020.0,8329300.0,8305110.0,8256160.0,
+          8135653.0}),
+    h(start={1130270.0,1132680.0,1135470.0,1138670.0,1142370.0,1146630.0,1151550.0,
+          1157240.0,1163810.0,1171420.0,1180240.0,1190480.0,1202400.0,1216300.0,
+          1232580.0,1251720.0,1274350.0,1301310.0,1336580.0,1434650.0,1715580.0,
+          2756578.25}))
+                     annotation (                           Placement(
+        transformation(extent={{-171,34},{-115,78}}, rotation=0)));
+  Solar.HeatExchangers.DynamicOnePhaseFlowPipe_Oil
+                                    TubeEcran_11(
+    option_temperature=2,
+    L=L1,
+    Ns=Ns1,
+    T0={587.815,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,
+        550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0},
+    h0=fill(650e3, Ns1),
+    D=0.04,
+    advection=false,
+    hcCorr=2,
+    dpfCorr=0.4,
+    ntubes=3,
+    h(start={801122.25,638880.0,582613.0,562383.0,546913.0,533929.0,522949.0,513609.0,
+          505631.0,498794.0,492917.0,487857.0,483492.0,479721.0,476460.0,473637.0,
+          471191.0,469070.0,467231.0,465634.0,464248.0,464248.0}))
+                     annotation (                            Placement(
+        transformation(extent={{-116,122},{-173,78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.SteamDryer Secheur(proe(x(start=0.273553)))
+    annotation (Placement(transformation(extent={{-86,39},{-62,63}}, rotation=0)));
+  WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenseur(
+    A=5,
+    Kvl=100,
+    e=0.0005,
+    L=3.5,
+    Vf0=0.15,
+    ntubes=300,
+    steady_state=false,
+    V=30,
+    P0=5000,
+    Cv(Q(start=1.13)),
+    Pfond(start=5000.53),
+    proe(d(start=995.533)))
+                     annotation (                           Placement(
+        transformation(extent={{116,-51},{156,-11}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP puitsPCaloporteur(
+                    mode=0, P0=1e5,
+    option_temperature=2) annotation (                           Placement(
+        transformation(extent={{178,-48},{206,-22}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss PerteChargeCondPompe(             K=1e-6,
+    C2(h_vol(start=137765.0)),
+    Pm(start=5000.53))
+    annotation (
+    Placement(transformation(
+        origin={117,-82.5},
+        extent={{-6,-9.5},{6,9.5}},
+        rotation=180)));
+  WaterSteam.PressureLosses.InvSingularPressureLoss
+    Connection_HQ_Secheur_Ballon(Q(start=1))
+    annotation (
+    Placement(transformation(
+        origin={-73,-15},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  WaterSteam.Machines.StaticCentrifugalPump Pompe(
+    Pm(fixed=false, start=3502560.0),
+    a1(fixed=false) = -4.9345734425e8,
+    hn(start=716.167),
+    a3=2000,
+    b1=-3500,
+    b2=510,
+    Q(fixed=true, start=1.13),
+    C2(h_vol(start=150161.0)),
+    Qv(start=0.00113454),
+    h(start=143963.0))           annotation (                         Placement(
+        transformation(extent={{84,-91},{64,-71}}, rotation=0)));
+  WaterSteam.Volumes.VolumeC Ballon(
+    V=1,
+    h0=3e5,
+    h(start=1125640.0),
+    P0=7000000,
+    dynamic_mass_balance=true,
+    P(start=7000000))
+    annotation (                           Placement(transformation(extent={{-63,-91},
+            {-83,-71}},          rotation=0)));
+  WaterSteam.PressureLosses.ControlValve ControlValveBallon(             Cvmax(
+        fixed=true) = 300, C2(P(fixed=false, start=70e5)),
+    Pm(start=7000060.0))
+    annotation (
+    Placement(transformation(
+        origin={-30,-75},
+        extent={{-10,10},{10,-10}},
+        rotation=180)));
+  WaterSteam.PressureLosses.ControlValve ControlValveBallon1(             Cvmax=
+       10,
+    C1(P(start=10618800.0), h_vol(start=1127430.0)),
+    C2(h_vol(start=1127430.0)),
+    Pm(start=9676220.0))
+    annotation (
+    Placement(transformation(
+        origin={-212,-75},
+        extent={{-10,10},{10,-10}},
+        rotation=180)));
+  WaterSteam.BoundaryConditions.SourceP sourcePCaloporteur(
+    option_temperature=2,
+    h0=63.03e3,
+    P0(fixed=false) = 500000,
+    Q(fixed=true, start=14.9263))
+                                annotation (                         Placement(
+        transformation(extent={{66,-49},{94,-22}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(            K=1e-6)
+    annotation (
+    Placement(transformation(
+        origin={171,-35},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  WaterSteam.PressureLosses.SingularPressureLoss PerteChargeCondPompe2(            K=1e-6, pro(d(
+          start=999.099)))
+    annotation (
+    Placement(transformation(
+        origin={101,-36},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  InstrumentationAndControl.Blocks.Sources.Constante Ouv(             k=0.5)
+    annotation (                           Placement(transformation(extent={{-48,-62},
+            {-38,-52}},          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Ouv1(             k=0.5)
+    annotation (                             Placement(transformation(extent={{-231,
+            -62},{-221,-52}},      rotation=0)));
+  WaterSteam.Machines.StaticCentrifugalPump Pompe1(
+    Pm(fixed=false),
+    hn(start=466.292),
+    a3=2000,
+    b2=510,
+    b1=-3500,
+    a1(fixed=false) = -9.5e8,
+    Q(fixed=false, start=0.65),
+    C2(P(fixed=false, start=75e5)),
+    C1(P(fixed=true, start=70e5), h_vol(start=1125640.0)),
+    Qv(start=0.00521975),
+    h(start=1126540.0))          annotation (
+      Placement(transformation(extent={{-158,-91},{-178,-71}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(            K=1e-6)
+    annotation (
+    Placement(transformation(
+        origin={-120,-81},
+        extent={{-6,-10},{6,10}},
+        rotation=180)));
+  WaterSteam.Machines.StodolaTurbine Turbine(
+    W_fric=1,
+    Cst(fixed=false,
+      start=68143000000.0)=
+                       6.19323e6,
+    Qmax=0.001,
+    eta_is_min=0.80,
+    rhos(start=10),
+    eta_is_nom=0.92,
+    Pe(fixed=true, start=8000000),
+    Ps(fixed=false, start=1800000),
+    pros(d(start=8.36949)))
+                      annotation (                       Placement(
+        transformation(extent={{47,72},{73,40}}, rotation=0)));
+  WaterSteam.Machines.Generator Alternateur
+    annotation (                          Placement(transformation(extent={{168,90},
+            {198,130}},     rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi4(
+    cpw=1000,
+    steady_state=true,
+    lambda=26,
+    D=0.04,
+    L=L4,
+    Ns=Ns4,
+    ntubes=3,
+    e=0.003,
+    Tp1(start={532.06,532.262,532.478}),
+    Tp2(start={533.3,532.429,532.217}),
+    Tp(start={532.141,532.349,532.57}))
+                     annotation (
+    Placement(transformation(
+        origin={-269,-12},
+        extent={{-24,-30},{24,30}},
+        rotation=90)));
+  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(
+    option_temperature=2,
+    D=0.04,
+    L=L4,
+    Ns=Ns4,
+    T0=fill(300, Ns4),
+    h0=fill(650e3, Ns4),
+    ntubes=3,
+    inertia=false,
+    advection=false,
+    P(start={8751668.0,8729230.0,8724830.0,8720430.0,8733863.0}),
+    h(start={1128519.5,1128310.0,1129260.0,1130270.0,1131729.0}))
+                     annotation (
+    Placement(transformation(
+        origin={-245.5,-11.5},
+        extent={{-23.5,-23.5},{23.5,23.5}},
+        rotation=90)));
+  Solar.HeatExchangers.DynamicOnePhaseFlowPipe_Oil
+                                    TubeEcran_44(
+    option_temperature=2,
+    L=L4,
+    Ns=Ns4,
+    T0={532.656,550.0,550.0},
+    h0=fill(650e3, Ns4),
+    advection=false,
+    D(fixed=true) = 0.04,
+    C2(P(fixed=false, start=16.99e5), Q(fixed=false, start=2)),
+    hcCorr=2,
+    dpfCorr=0.4,
+    ntubes=3,
+    h(start={465547.78125,463670.0,463128.0,462620.0,462620.0}))
+                     annotation (
+    Placement(transformation(
+        origin={-293,-12},
+        extent={{23,24},{-23,-24}},
+        rotation=90)));
+  WaterSteam.Machines.StaticCentrifugalPump Pompe2(
+    Pm(fixed=false),
+    b2=510,
+    b1=-3500,
+    hn(start=350),
+    adiabatic_compression=true,
+    C1(P(fixed=false, start=17e5), h_vol(start=462620.0)),
+    a3(fixed=true) = 500,
+    C2(P(fixed=false, start=24.5146e5)),
+    p_rho=900,
+    Q(fixed=true, start=7.2),
+    a1(fixed=false) = -1e8)      annotation (
+      Placement(transformation(extent={{-184,129},{-164,149}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss PerteCharge_Huile_2(K=1e-6,
+      p_rho=900)
+    annotation (
+    Placement(transformation(
+        origin={-212,138.5},
+        extent={{6,-9.5},{-6,9.5}},
+        rotation=180)));
+  WaterSteam.PressureLosses.SingularPressureLoss PerteCharge_Huile_1(K=1e-6,
+      p_rho=900)
+    annotation (
+    Placement(transformation(
+        origin={-286,138.5},
+        extent={{6,-9.5},{-6,9.5}},
+        rotation=180)));
+  WaterSteam.Machines.StodolaTurbine TurbineMp(
+    W_fric=1,
+    Cst(fixed=false,
+      start=8378550000.0)=
+                       6.19323e6,
+    Qmax=0.001,
+    eta_is_min=0.80,
+    rhos(start=10),
+    eta_is_nom=0.94,
+    Pe(fixed=true, start=1800000),
+    Ps(fixed=false, start=5000),
+    pros(d(start=0.0434309)),
+    xm(start=0.908482))
+                      annotation (                         Placement(
+        transformation(extent={{105,72},{131,40}}, rotation=0)));
+  WaterSteam.Volumes.Tank Tank(
+    p_rho=895,
+    A=0.1,
+    z0=1,
+    h0=423600,
+    steady_state=true,
+    h(start=462620.0),
+    rho(start=895),
+    Patm=1670000,
+    P(start=1699000))
+    annotation (
+    Placement(transformation(
+        origin={-248,142},
+        extent={{6,6},{-6,-6}},
+        rotation=180)));
+  WaterSteam.Volumes.VolumeA VolumeMP(
+    V=1,
+    rho(start=10),
+    h0=2.4e6,
+    h(start=2868560.0),
+    P0=1800000,
+    dynamic_mass_balance=true,
+    P(start=1800000),
+    Cs2(Q(start=0.255955)))
+    annotation (                       Placement(transformation(extent={{84,50},
+            {94,62}}, rotation=0)));
+  WaterSteam.Volumes.VolumeA VolumeCond(
+    V=1,
+    rho(start=10),
+    h(start=1837610.0),
+    h0=2.1e6,
+    P0=5000,
+    dynamic_mass_balance=false,
+    P(start=5000))
+    annotation (                         Placement(transformation(extent={{141,24},
+            {130,34}},     rotation=0)));
+  WaterSteam.HeatExchangers.NTUWaterHeating Re_1(
+    KPurge=10,
+    SPurge=0.3,
+    Se(h(fixed=true, start=600e3)),
+    SCondDes(fixed=false,
+      start=9.57697) =      3,
+    HDesF(start=583561.0),
+    HeiF(start=150619.0),
+    Hep(start=884611.0),
+    SDes(start=0.932441),
+    h(start=882589.0),
+    lambdaE=1,
+    KCond=500)  annotation (                         Placement(transformation(
+          extent={{42,-106},{0,-56}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss Dp_Re_1(
+    rho(start=10),
+    h(start=2400e3),
+    Q(start=0.1),
+    K=1e-4,
+    Pm(start=1800000))
+    annotation (
+    Placement(transformation(
+        origin={31.5,-13.5},
+        extent={{5.5,-5.5},{-5.5,5.5}},
+        rotation=90)));
+  WaterSteam.PressureLosses.InvSingularPressureLoss invSingularPressureLoss
+    annotation (                            Placement(transformation(extent={{108,
+            -106},{122,-90}},     rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss Dp_Cond_2(
+    K=1e-4,
+    rho(start=10),
+    Q(start=0.35),
+    Pm(start=5000.53),
+    h(start=2100e3))
+    annotation (
+    Placement(transformation(
+        origin={135.5,8.5},
+        extent={{5.5,-5.5},{-5.5,5.5}},
+        rotation=90)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Rayonnement(Table=[0,700;
+        200,2; 1200,2; 1800,2; 2400,0.1; 3000,0.1; 3600,0.1; 4200,327; 4800,287;
+        5400,176; 6000,410; 6600,299; 7200,26; 7800,168; 8400,485; 9000,482;
+        9600,664; 10200,344; 10800,684; 11400,564; 12000,460; 12600,560; 13200,
+        611; 13800,557; 14400,682; 15000,785; 15600,321; 16200,850; 16800,330;
+        17400,619; 18000,480; 18600,192; 19200,750; 19800,650; 20400,450; 21000,
+        350; 21600,763; 22200,455; 22800,290; 23400,494; 24000,800; 24600,565;
+        25200,320; 25800,110; 26400,479; 27000,263; 27600,747; 28200,805; 28800,
+        576; 29400,550; 30000,470; 30600,395; 31200,315; 31800,657; 32400,670;
+        33000,381; 33600,209; 34200,457; 34800,320; 35400,13; 36000,0.1; 36600,
+        0.1; 37200,0.1; 37800,0.1; 38400,0.1; 39000,0.1; 39600,0.1; 40200,0.1;
+        40800,0; 41400,0; 42000,0; 42600,0; 43200,0; 43800,0])
+    annotation (Placement(transformation(extent={{-322,166},{-306,182}},
+          rotation=0)));
+equation
+
+public
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=3, P(start=
+          2300000))
+    annotation (Placement(transformation(extent={{21,128},{37,150}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=1/3, P(start=
+          2400000))                              annotation (Placement(
+        transformation(
+        extent={{-7.75,-9.75},{7.75,9.75}},
+        rotation=0,
+        origin={-158.25,139.75})));
+equation
+  connect(TubeEcran_2.CTh, Paroi2.WT1) annotation (
+    Line(points={{-3,62.6},{-4,64},{-4,73.2}}, color={191,95,0}));
+  connect(SolarCollector1.ITemperature,Paroi3. WT2)
+                                                   annotation (
+    Line(points={{-74.3026,166.992},{-75,166.992},{-75,162.8}}, color={191,95,0}));
+  connect(Incidence.y,SolarCollector1. IncidenceAngle)
+    annotation (
+              Line(points={{-305.2,154},{-262,154},{-262,182},{-106.289,182},{
+          -106.289,183}}));
+  connect(TubeEcran_3.CTh,Paroi3. WT1) annotation (
+    Line(points={{-75,145.6},{-75,153.2}}, color={191,95,0}));
+  connect(Tatm.y,SolarCollector1. AtmTemp) annotation (
+    Line(points={{-305.2,194},{-282,194},{-282,197.167},{-106.289,197.167}}));
+  connect(PerteCharge_Huile_3.C2, TubeEcran_3.C1)   annotation (
+    Line(
+      points={{-128,138.5},{-102,138.5},{-102,140},{-103,139}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(TubeEcran_3.C2, PerteCharge_Huile_4.C1)
+    annotation (
+    Line(
+      points={{-47,139},{-11,139}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(Paroi2.WT2, TubeEcran_22.CTh) annotation (
+    Line(points={{-4,82.8},{-4,93.4},{-4.5,93.4}}, color={191,95,0}));
+  connect(TubeEcran_1.CTh,Paroi1. WT1) annotation (
+    Line(points={{-143,62.6},{-144,64},{-144,73.2}}, color={191,95,0}));
+  connect(Paroi1.WT2,TubeEcran_11. CTh) annotation (
+    Line(points={{-144,82.8},{-144,93.4},{-144.5,93.4}}, color={191,95,0}));
+  connect(TubeEcran_11.C1, TubeEcran_22.C2)
+    annotation (
+    Line(
+      points={{-116,100},{-33,100}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(TubeEcran_1.C2, Secheur.Cev) annotation (
+    Line(
+      points={{-115,56},{-85.88,56},{-85.88,55.8}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Secheur.Csv, TubeEcran_2.C1) annotation (
+    Line(
+      points={{-62.12,55.8},{-60,55.8},{-60,56},{-31,56}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pompe.C1,PerteChargeCondPompe. C2)
+    annotation (
+    Line(
+      points={{84,-81},{84,-82},{111,-82},{111,-82.5}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Ballon.Ce1,ControlValveBallon. C2)
+    annotation (
+    Line(
+      points={{-63,-81},{-40,-81}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Secheur.Csl,Connection_HQ_Secheur_Ballon. C1) annotation (
+    Line(
+      points={{-73.88,39},{-73.88,-5},{-73,-5}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Connection_HQ_Secheur_Ballon.C2,Ballon. Ce2) annotation (
+    Line(
+      points={{-73,-25},{-73,-72}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(sourcePCaloporteur.C,PerteChargeCondPompe2. C1) annotation (
+    Line(points={{94,-35.5},{94,-36},{95,-36}}, color={0,0,255}));
+  connect(PerteChargeCondPompe1.C2,puitsPCaloporteur. C) annotation (
+    Line(points={{177,-35},{178,-36},{178,-35}}, color={0,0,255}));
+  connect(Pompe1.C2,ControlValveBallon1. C1) annotation (
+    Line(
+      points={{-178,-81},{-202,-81}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(PerteChargeCondPompe3.C1,Ballon. Cs)
+    annotation (
+    Line(
+      points={{-114,-81},{-83,-81}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Ouv1.y,ControlValveBallon1. Ouv)
+    annotation (                                         Line(points={{-220.5,
+          -57},{-212,-57},{-212,-64}}));
+  connect(Ouv.y,ControlValveBallon. Ouv)
+    annotation (                                      Line(points={{-37.5,-57},
+          {-30,-57},{-30,-64}}));
+  connect(PerteChargeCondPompe2.C2,Condenseur. Cee) annotation (
+    Line(points={{107,-36},{109.25,-36},{109.25,-35.4},{116,-35.4}}, color={0,0,255}));
+  connect(Condenseur.Cse,PerteChargeCondPompe1. C1) annotation (
+    Line(points={{156,-35},{160,-34},{160,-35},{165,-35}}, color={0,0,255}));
+  connect(Condenseur.Cl,PerteChargeCondPompe. C1) annotation (
+    Line(
+      points={{136.4,-51},{136.4,-82.5},{123,-82.5}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(PerteChargeCondPompe3.C2, Pompe1.C1) annotation (
+    Line(
+      points={{-126,-81},{-158,-81}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Turbine.MechPower,Alternateur. Wmec5)
+    annotation (                                            Line(points={{74.3,
+          70.4},{76,70.4},{76,94},{168,94}}));
+  connect(TubeEcran_2.C2, Turbine.Ce) annotation (
+    Line(
+      points={{25,56},{46.87,56}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(TubeEcran_4.CTh,Paroi4. WT1) annotation (
+    Line(points={{-252.55,-11.5},{-257,-11.5},{-257,-12},{-263,-12}}, color={191,95,0}));
+  connect(Paroi4.WT2, TubeEcran_44.CTh) annotation (
+    Line(points={{-275,-12},{-285.8,-12},{-285.8,-12}},
+                                                      color={191,95,0}));
+  connect(ControlValveBallon1.C2, TubeEcran_4.C1) annotation (
+    Line(
+      points={{-222,-81},{-245.5,-81},{-245.5,-35}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(TubeEcran_4.C2, TubeEcran_1.C1) annotation (
+    Line(
+      points={{-245.5,12},{-245.5,56},{-171,56}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(TubeEcran_11.C2, TubeEcran_44.C1) annotation (
+    Line(
+      points={{-173,100},{-293,100},{-293,11}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(PerteCharge_Huile_2.C2, Pompe2.C1)   annotation (
+    Line(
+      points={{-206,138.5},{-184,138.5},{-184,139}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(Tank.Cs2, PerteCharge_Huile_2.C1)                    annotation (
+    Line(
+      points={{-242,138.4},{-230,138.4},{-230,138.5},{-218,138.5}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(PerteCharge_Huile_1.C2, Tank.Ce2) annotation (
+    Line(
+      points={{-280,138.5},{-268,138.5},{-268,138.4},{-254,138.4}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(Turbine.Cs, VolumeMP.Ce1) annotation (
+    Line(
+      points={{73.13,56},{84,56}},
+      color={255,0,0},
+      thickness=0.5));
+
+  connect(VolumeMP.Cs1, TurbineMp.Ce) annotation (
+    Line(
+      points={{94,56},{104.87,56}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(TurbineMp.MechPower, Alternateur.Wmec4)
+    annotation (                                                 Line(points={{132.3,
+          70.4},{142,70.4},{142,102},{168,102}}));
+  connect(TurbineMp.Cs, VolumeCond.Ce2) annotation (
+    Line(
+      points={{131.13,56},{135.5,56},{135.5,33.9}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Re_1.Ee, Pompe.C2)
+    annotation (
+    Line(points={{42.42,-81},{64,-81}}, thickness=0.5));
+  connect(VolumeMP.Cs2, Dp_Re_1.C1) annotation (
+    Line(
+      points={{89,50},{90,50},{90,22},{31.5,22},{31.5,-8}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Dp_Re_1.C2, Re_1.Ev) annotation (
+    Line(
+      points={{31.5,-19},{31.5,-36},{8.4,-36},{8.4,-73}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(ControlValveBallon.C1, Re_1.Se)
+    annotation (
+    Line(points={{-20,-81},{0,-81}}, thickness=0.5));
+  connect(Re_1.Sp, invSingularPressureLoss.C1) annotation (
+    Line(
+      points={{33.6,-89.25},{33.6,-98},{108,-98}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(invSingularPressureLoss.C2, VolumeCond.Ce1) annotation (
+    Line(
+      points={{122,-98},{202,-98},{202,29},{141,29}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Dp_Cond_2.C1, VolumeCond.Cs2) annotation (
+    Line(
+      points={{135.5,14},{135.5,24}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Condenseur.Cv, Dp_Cond_2.C2) annotation (
+    Line(
+      points={{136,-11},{136,3},{135.5,3}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(PerteCharge_Huile_4.C2, massFlowMultiplier.Ce) annotation (Line(
+      points={{1,139},{21,139}},
+      color={0,140,72},
+      thickness=0.5));
+  connect(massFlowMultiplier.Cs, TubeEcran_22.C1) annotation (Line(
+      points={{37,139},{63,139},{63,100},{24,100}},
+      color={0,140,72},
+      thickness=0.5));
+  connect(Pompe2.C2, massFlowMultiplier2.Ce) annotation (Line(
+      points={{-164,139},{-166,139},{-166,139.75}},
+      color={0,140,72},
+      thickness=0.5));
+  connect(massFlowMultiplier2.Cs, PerteCharge_Huile_3.C1) annotation (Line(
+      points={{-150.5,139.75},{-140,139.75},{-140,138.5}},
+      color={0,140,72},
+      thickness=0.5));
+  connect(PerteCharge_Huile_1.C1, TubeEcran_44.C2) annotation (Line(
+      points={{-292,138.5},{-319,138.5},{-319,-80},{-293,-80},{-293,-35}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(Rayonnement.y, SolarCollector1.ISun) annotation (Line(points={{-305.2,
+          174},{-280,174},{-280,190.083},{-106.289,190.083}}, color={0,0,255}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(
+      coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-320,-100},{200,200}},
+        grid={2,2},
+        initialScale=0.1),
+      graphics={
+        Text(
+          extent={{-237,-8},{-217,-18}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Eco"),
+        Text(
+          extent={{-164,48},{-126,34}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Evaporator"),
+        Text(
+          extent={{-23,49},{21,33}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Super-heater"),
+        Text(
+          extent={{151,-53},{194,-68}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Condenser"),
+        Text(
+          extent={{-115,215},{-37,197}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Parabolic solar receiver")}),
+    experiment(StopTime=40000),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </h4>
+<p><b>ThermoSysPro Version 3.2 </h4>
+<p>This is the dynamic model of a 1 MWe concentrated solar power plant with a parabolic trough collector. </p>
+<p>It is documented in a<a href=\"https://www.sciencedirect.com/science/article/pii/S1876610214005761\"> conference paper</a> and in Sect. 6.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end ConcentratedSolarPowerPlant_PTSC;
diff --git a/ThermoSysPro/Examples/Book/PowerPlants/SupercriticalPulverizedCoalPowerPlant.mo b/ThermoSysPro/Examples/Book/PowerPlants/SupercriticalPulverizedCoalPowerPlant.mo
index 7ac255a1792f50aabe0eeff7bd9859b959a39037..f2f5ed43d90a73b204891d1854f696635707b842 100644
--- a/ThermoSysPro/Examples/Book/PowerPlants/SupercriticalPulverizedCoalPowerPlant.mo
+++ b/ThermoSysPro/Examples/Book/PowerPlants/SupercriticalPulverizedCoalPowerPlant.mo
@@ -1,1992 +1,1992 @@
-within ThermoSysPro.Examples.Book.PowerPlants;
-model SupercriticalPulverizedCoalPowerPlant
-  "Model of a supercritical pulverized coal power plant"
-
-  parameter Integer NCEL = 7;
-
-  parameter Real dpfCorr=1.00
-    "Corrective term for the friction pressure loss (dpf) for each node";
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine    Turbine_HP(
-    eta_is_min=0.75,
-    W_fric=1,
-    Qmax=50,
-    eta_is(start=0.96),
-    eta_is_nom=0.94,
-    pros(d(start=35.19870673587873)),
-    Cst(fixed=false,
-      start=2001324.343046339)=
-                       2.00537e6,
-    Pe(start=26999999.985564, fixed=true))
-    annotation (Placement(transformation(extent={{-24,136},{60,214}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD splitter_Turbine_HP1(h(start=
-          3071530.861772407),
-    dynamic_mass_balance=true,
-    P(start=6401000),
-    Ce(Q(start=549.193976505918)))
-    annotation (Placement(transformation(extent={{272,185},{294,167}})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP2(
-    eta_stato=1,
-    mode_e=2,
-    mode_s=2,
-    mode_ps=2,
-    W_fric=1,
-    eta_is(start=0.94),
-    eta_is_nom=0.94,
-    Qmax=50,
-    pros(d(start=6.887350366974513)),
-    Cst(fixed=false,
-      start=53978.86314853486)=
-                       53802.6,
-    Pe(start=3799997.860026793,
-                      fixed=true))
-    annotation (Placement(transformation(extent={{602,38},{656,97}})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP2(
-    W_fric=1,
-    eta_stato=1,
-    eta_is_min=0.75,
-    Qmax=50,
-    eta_is_nom=0.91,
-    eta_is(start=0.91),
-    pros(d(start=0.3736533771704811)),
-    xm(start=0.9898250653294598),
-    Cst(fixed=false,
-      start=1220.138716068697)=
-                       1215.75,
-    Pe(start=299998.1114947147,
-                     fixed=true))
-                annotation (Placement(transformation(extent={{1182,38},{1236,96}},
-                    rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP1(
-    eta_stato=1,
-    eta_is_min=0.75,
-    mode_e=2,
-    mode_s=2,
-    mode_ps=2,
-    eta_is_nom=0.94,
-    eta_is(start=0.94),
-    W_fric=1,
-    Qmax=50,
-    pros(d(start=10.384234361858882)),
-    Cst(fixed=false,
-      start=102744.34781655352)=
-                       102478,
-    Pe(start=5999998.330854355,
-                             fixed=true))
-    annotation (Placement(transformation(extent={{396,38},{450,96}})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP1(
-    W_fric=1,
-    eta_stato=1,
-    eta_is_min=0.75,
-    Qmax=50,
-    eta_is_nom=0.91,
-    eta_is(start=0.91),
-    pros(d(start=1.390561376459253)),
-    Cst(fixed=false,
-      start=4501.927059584096)=
-                       4485.97,
-    Pe(start=729997.7575424919,
-                     fixed=true))
-                annotation (Placement(transformation(extent={{1004,38},{1058,96}},
-                    rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP3(
-    eta_stato=1,
-    eta_is_min=0.75,
-    mode_e=2,
-    mode_s=2,
-    mode_ps=2,
-    W_fric=1,
-    Qmax=50,
-    eta_is(start=0.94),
-    eta_is_nom=0.94,
-    pros(d(start=2.8084284519008316)),
-    Cst(fixed=false,
-      start=34193.21955188417)=
-                       34076.9,
-    Pe(start=2270000, fixed=true))
-    annotation (Placement(transformation(extent={{802,38},{856,96}})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP3(
-    W_fric=1,
-    eta_stato=1,
-    eta_is_min=0.75,
-    Qmax=50,
-    eta_is_nom=0.91,
-    eta_is(start=0.91),
-    pros(d(start=0.17053836551218424)),
-    xm(start=0.9624448460730977),
-    Cst(fixed=false,
-      start=59.44671753933515)=
-                       59.4076,
-    Pe(start=59999.53282881782,
-                    fixed=true),
-    Ps(start=25000))
-                annotation (Placement(transformation(extent={{1358,38},{1412,96}},
-                    rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Echappement(
-    W_fric=1,
-    eta_stato=1,
-    xm(start=0.9213019144264654),
-    Qmax=50,
-    Cst(fixed=false,
-      start=14.295718727368532)=
-                       14.7,
-    eta_is(start=0.8),
-    eta_is_nom=0.91,
-    pros(d(start=0.04238683084570735)),
-    Pe(start=24999.77493390328,
-                    fixed=true),
-    Ps(start=5000))
-                annotation (Placement(transformation(extent={{1514,37},{1568,97}},
-                    rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP1(h(start=
-          3537588.8079320663))
-    annotation (Placement(transformation(extent={{518,79},{542,55}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP2(h(start=
-          3369888.816557468),
-      dynamic_mass_balance=true)
-    annotation (Placement(transformation(extent={{732,80},{760,54}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_IP3(
-                                                                       K(fixed=
-          false) = 10, Q(start=19.00114371733354,
-                                   fixed=true),
-    C2(P(start=580155.4529087848),h_vol(start=311761.22672647523)))
-    annotation (Placement(transformation(extent={{27,-21},{-27,21}}, rotation=270,
-        origin={945,290})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP3(
-      h(start=3059443.3348694695),
-                          P(start=774340))
-    annotation (Placement(transformation(extent={{932,78},{958,56}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP1(
-      h(start=2869360.296898901),
-                          P(start=190280))
-    annotation (Placement(transformation(extent={{1112,79},{1136,55}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP1(
-                                                                       K(fixed=
-          false) = 10, Q(start=28.001397928754212,
-                                   fixed=true),
-    C2(P(start=236489.70540554097)))
-    annotation (Placement(transformation(extent={{27,-20},{-27,20}}, rotation=270,
-        origin={1124,291})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP2(h(start=
-          2606190.1863981914))
-    annotation (Placement(transformation(extent={{1284,79},{1308,55}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP2(
-                     K(fixed=false) = 10, Q(start=9.0003750371771,
-                                                     fixed=true),
-    C2(P(start=44661.45635759075)))
-    annotation (Placement(transformation(extent={{-27,-21},{27,21}}, rotation=90,
-        origin={1296,291})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP3(                h(
-        start=2489005.0530445203),
-                          P(start=23000))
-    annotation (Placement(transformation(extent={{1460,81},{1486,53}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP3(
-    h(start=3.048e6),
-    K(fixed=false) = 10,
-    Q(start=16.000569587384174,
-                fixed=true),
-    C2(P(start=19457.45212821197),h_vol(start=225941.66047852393)))
-    annotation (Placement(transformation(extent={{27,-22},{-27,22}}, rotation=270,
-        origin={1474,291})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{1764,-54},{1826,-4}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
-                 Q0=16400, h0=121652)
-                                 annotation (Placement(transformation(extent={{1562,
-            -54},{1614,-4}},       rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Condenser2(K=1e-4,
-      Pm(start=4999.990549904409),
-    C1(h_vol(start=137765.1189884895)),
-    C2(P(start=4999.981099808819),h_vol(start=137765.1189884895)))
-    annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=270,
-        origin={1694,-164})));
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
-    Vf0=0.15,
-    A=100,
-    ntubes=28700,
-    lambda=0.018,
-    Kvl=1,
-    V=1000,
-    steady_state=false,
-    continuous_flow_reversal=true,
-    yNiveau(signal(start=1.5, fixed=false)),
-    P0=5000,
-    P(start=5000),
-    Cv(Q(start=433.2001545496264)),
-    proe(d(start=994.1205995939429)))
-    annotation (Placement(transformation(extent={{1636,-72},{1746,30}})));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump(
-    C1(P(start=5000)),
-    a1(fixed=false) = -390,
-    a3=350,
-    C2(P(start=2699869.622037593,
-                        fixed=true), h_vol(start=140956.11701829222)),
-    Qv(start=0.43524240668307135),
-    h(start=139360.61800339087),
-    hn(start=276.1071665616722))
-    annotation (Placement(transformation(extent={{1760,-226},{1796,-188}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff ReDrum(
-    DTfroid(displayUnit="K") = 5,
-    Kf=305,
-    DPf(start=57524.2563411452),
-    Ec(h(start=311761.22672647523)),
-    Ef(h_vol(start=140956.11701829222)),
-    Sc(h_vol(start=150272.7724602458)),
-    Sf(h_vol(start=161833.76268010825)),
-    promc(d(start=985.5919033987386)))
-    annotation (Placement(transformation(extent={{1798,440},{1666,548}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP3(
-    SPurge=200,
-    KCond=1535.50,
-    KPurge=100,
-    Ep(Q(start=0.001)),
-    SCondDes=3255,
-    lambdaE=256,
-    Ee(P(start=2650000)),
-    P(start=25000),
-    HDesF(start=245425.15364009212),
-    HeiF(start=162682.43852863708),
-    Hep(start=248917.79589378808),
-    SDes(start=1E-009),
-    Se(
-      P(start=2511836.0997127844),
-      h(start=245425.15364009212),
-      h_vol(start=245425.15364009212)))
-    annotation (Placement(transformation(extent={{1568,552},{1452,434}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP2(
-    KCond=1530.50,
-    SPurge=482.5,
-    KPurge=109.55,
-    Se(P(start=2413894.9462802503),
-      h(start=306860.7316879813),
-      h_vol(start=306860.7316879813)),
-    lambdaE=512.2,
-    Ee(P(start=2600000)),
-    SCondDes=1477,
-    P(start=60000),
-    Ep(h(start=438607.090332969)),
-    HDesF(start=306860.7316879813),
-    HeiF(start=247625.18923762313),
-    Hep(start=328778.4878550007),
-    SDes(start=1E-009))
-    annotation (Placement(transformation(extent={{1390,552},{1272,434}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP1(
-    KCond=1530.50,
-    SPurge=504,
-    KPurge=155.7,
-    lambdaE=1258,
-    Ee(P(start=2500000)),
-    SCondDes=1408,
-    P(start=300000),
-    Ep(h(start=464182.2380411874)),
-    HDesF(start=455062.8963466834),
-    HeiF(start=313734.293691341),
-    Hep(start=501954.8282730701),
-    SDes(start=131.63162125559273),
-    Se(
-      P(start=2169310.5330650215),
-      h(start=465109.255940298),
-      h_vol(start=465109.255940298)))
-    annotation (Placement(transformation(extent={{1214,551},{1106,437}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterIP(
-    KCond=1730.50,
-    SPurge=239,
-    KPurge=2795,
-    lambdaE=885,
-    Ee(P(start=2250000)),
-    SCondDes=795,
-    P(start=730000),
-    HDesF(start=565579.5385524093),
-    HeiF(start=473909.76996909064),
-    Hep(start=664813.6284480324),
-    SDes(start=98.33315286951769),
-    Se(h(start=578948.0240115122), P(start=1992791.4733867273)))
-    annotation (Placement(transformation(extent={{1030,551},{924,437}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss pipePressureLoss_LP3_Drum(K=1e-4, pro(d(
-          start=986.1624696132673)))
-    annotation (Placement(transformation(extent={{1562,555},{1602,605}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeI Drum_1(h(start=167087.86591036225),
-                                                                  V=10)
-    annotation (Placement(transformation(extent={{1872,493},{1926,555}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_IP1(
-    h(start=3463.4e3),
-    K(fixed=false) = 10,
-    Q(start=25.00040036422368,
-                fixed=true),
-    Pm(start=3900000),
-    C2(h_vol(start=3537588.8079320663)))
-    annotation (Placement(transformation(extent={{26.5,-22},{-26.5,22}},
-                                                                     rotation=270,
-        origin={530,290.5})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeI Drum_2(
-    h(start=778321.3350751515),
-    V=200,
-    P(start=2070000))
-    annotation (Placement(transformation(extent={{774,433},{712,503}})));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1(
-                                                                               rm=0.7,
-    C2(Q(start=599.993976505918,
-                    fixed=true), P(start=32854107.921229515),
-      h_vol(start=827111.4901416934)),
-    C1(P(start=2070000)),
-    a1(fixed=false) = -3050,
-    a3=5000,
-    Qv(start=0.6740415564019792),
-    h(start=821565.0),
-    hn(start=3535.3592725080375))
-    annotation (Placement(transformation(extent={{683,509},{655,483}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP3(
-    Se(P(start=32900000), h(start=932438.8978014372)),
-    KPurge=1200,
-    lambdaE=1712,
-    SPurge=1098,
-    Ee(P(start=33600000), h_vol(start=827111.4901416933)),
-    KCond=1588,
-    SCondDes=750,
-    P(start=3771567.571218525),
-    HDesF(start=927325.1475293547),
-    HeiF(start=855187.674900425),
-    Hep(start=964242.0430144744),
-    SDes(start=79.82059037582069),
-    h(start=841102.4802107343))
-    annotation (Placement(transformation(extent={{572,546},{474,448}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Desu(
-    C2(P(start=3800000)),
-    C1(h_vol(start=2924612.095560695)),
-    K=1e-4,
-    Pm(start=3771567.5730999485))
-    annotation (Placement(transformation(extent={{22.5,-14.5},{-22.5,14.5}},
-                                                                     rotation=180,
-        origin={274.5,375.5})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP2(
-    lambdaE=1157,
-    Se(P(start=32400000), h(start=1168614.317235736)),
-    KCond=1588,
-    KPurge=1200,
-    SPurge=849,
-    SCondDes=1667.5,
-    P(start=5568798.758801826),
-    Ee(Q(start=299.99698825295724),
-                       h(start=932438.8978014372)),
-    Ep(P(start=8930425.05990273), h(start=1170923.9907383516)),
-    HDesF(start=1139894.576035795),
-    HeiF(start=977219.550756442),
-    Hep(start=1180774.7250052856),
-    SDes(start=337.2006466251369),
-    h(start=940451.6341612964))
-    annotation (Placement(transformation(extent={{404,482},{302,376}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP1(
-    h(start=3.07903e6),
-    K(fixed=false) = 10,
-    Q(start=61, fixed=true),
-    Pm(start=6401000))
-    annotation (Placement(transformation(extent={{27,-20},{-27,20}}, rotation=270,
-        origin={322,291})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP1(
-    KPurge=1279,
-    lambdaE=750,
-    Se(h(start=1338936.264843952),
-                         P(start=32050000)),
-    KCond=1588,
-    SCondDes=1692.5,
-    SPurge=1049,
-    P(start=10000000),
-    Ee(h(start=1168614.317235733)),
-    HDesF(start=1301805.3904686682),
-    HeiF(start=1184664.7287055368),
-    Hep(start=1360493.8691474798),
-    SDes(start=416.53928018645576))
-    annotation (Placement(transformation(extent={{208,480},{104,378}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff Desuperheater(
-    Sf(
-      Q(start=600),
-      h(start=1.369E6),
-      P(start=31940231.739229403),
-      h_vol(start=1364477.62662973)),
-    Ef(h(start=1338936.2648439475)),
-    promc(d(start=12.67201785254116)),
-    DTfroid(displayUnit="K") = 5,
-    Kf=10,
-    Tsf(start=580.3334486723465))
-    annotation (Placement(transformation(extent={{34,545},{-70,447}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP(
-    h(start=3.19e6),
-    Q(fixed=true, start=50.8),
-    K(fixed=false) = 10,
-    Pm(start=10000000))
-    annotation (Placement(transformation(extent={{21.5,-18},{-21.5,18}},
-                                                                     rotation=270,
-        origin={128,296.5})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP_IP(
-    h(start=3.07903e6),
-    K(fixed=false) = 10,
-    Q(fixed=true, start=3),
-    Pm(start=6401000))
-    annotation (Placement(transformation(extent={{-15.5,-16.5},{15.5,16.5}},
-                                                                     rotation=0,
-        origin={883.5,-8.5})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine   Turbine_HP1(
-    eta_is_min=0.75,
-    W_fric=1,
-    Qmax=50,
-    eta_is(start=0.96),
-    eta_is_nom=0.92,
-    pros(d(start=24.64344118791907)),
-    Cst(fixed=false,
-      start=278836.9406128902)=
-                       279474,
-    Pe(start=10000000, fixed=true),
-    Ps(start=6401000))
-    annotation (Placement(transformation(extent={{172,136},{256,214}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD splitter_Turbine_HP(h(start=
-          3182580.38391812),
-    dynamic_mass_balance=true,
-    P(start=10000000))
-    annotation (Placement(transformation(extent={{116,184},{140,166}})));
-  ThermoSysPro.WaterSteam.Machines.Generator generator(eta=99.7)
-    annotation (Placement(transformation(extent={{48,-194},{-84,-314}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add
-                                          annotation (Placement(transformation(
-          extent={{94,-218},{76,-200}},
-                                    rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add3 add1
-                                          annotation (Placement(transformation(
-          extent={{96,-240},{76,-220}},
-                                    rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add3 add2
-                                          annotation (Placement(transformation(
-          extent={{94,-264},{76,-244}},
-                                    rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT(C1(h_vol(start=
-            3474803.0992788016)),
-                                C2(h_vol(start=3474803.0992788034)))
-    annotation (Placement(transformation(extent={{-202,170},{-180,200}})));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveHP(
-                             C1(P(fixed=true, start=27019900)),
-    h(start=3.4756e6),
-    Cvmax(fixed=false) = 8005,
-    T(displayUnit="K", start=873.1))
-    annotation (Placement(transformation(extent={{-157,166},{-121,204}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constantHP(k=0.5)
-    annotation (Placement(transformation(extent={{-84,200},{-114,230}})));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveIP(Cvmax(
-        fixed=false) = 8005,
-    h(start=3.70545e6),
-    C1(P(fixed=true, start=6009998.640295431),
-                                     h_vol(start=3701594.2696911553)))
-    annotation (Placement(transformation(extent={{-158,245},{-122,285}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constantIP(k=0.5)
-    annotation (Placement(transformation(extent={{-84,274},{-120,310}})));
-  ThermoSysPro.Combustion.CombustionChambers.GenericCombustion1D
-    genericCombustion(
-    EPSPAR=0.4,
-    ImbCV=0.01,
-    ImbBF=0.007,
-    Kec=15,
-    SM={635.7,635.7,635.7,635.7,635.7,635.7,635.7},
-    Psf,
-    Tea(start=577.3294631233695),
-    Tpi(start={662.130125894802,685.614566355283,696.9408592330145,
-          703.5449672340172,712.7782107613066,727.9340239141302,
-          750.6768400836096}),
-    Tsf(start=1501.2484101541468),
-    deltaPccb(start=2223.1944617307236))
-                      annotation (Placement(transformation(extent={{-238,-102},
-            {-436,68}},
-                      rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe Wall_screen(
-    Ns=NCEL,
-    L=65,
-    ntubes=912,
-    mode=0,
-    z2=65,
-    D=0.034,
-    option_temperature=2,
-    P(start={30342043.891952675,30282117.04096996,30227397.738711014,
-          30178994.328953177,30137426.097264428,30101658.687952235,
-          30069281.864402287,30038017.722720534,30006184.603574578}),
-    Q(start={597.6590942672652,597.6590942672652,597.6590942672652,
-          597.6590942672652,597.6590942672652,597.6590942672652,
-          597.6590942672652,597.6590942672652}),
-    h(start={1479747.0728819133,1653147.2981052676,1836593.6418651666,
-          2019276.7199909666,2201503.0794841815,2383076.101933648,
-          2563538.204063644,2742239.471375197,2742239.471375197}),
-    mu2(start={8.337682531388398E-05,7.290904575803869E-05,6.19675832347849E-05,
-          5.107649475602911E-05,4.1856937780558395E-05,3.577140353596319E-05,
-          3.242959431491525E-05,3.102497852505804E-05}),
-    pro2(d(start={696.792093597009,625.1171632839697,535.5755100207667,
-            432.7397163943108,333.50837586843403,256.1304727342381,
-            200.77652123807803,161.8541988249301})))
-                  annotation (Placement(transformation(extent={{-66,44},{66,-44}},
-                   rotation=90,
-        origin={-520,-18})));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    Ns=NCEL,
-    lambda=40,
-    L=65,
-    e=0.008,
-    ntubes=912,
-    D=0.034,
-    Tp(start={653.6406823320823,676.633278239129,687.9969395834568,
-          694.6234079190576,703.8886379558984,719.0988402846453,
-          741.927864576376}))
-              annotation (Placement(transformation(
-        extent={{-66,37},{66,-37}},
-        rotation=90,
-        origin={-465,-18})));
-  ThermoSysPro.FlueGases.Junctions.Splitter2 splitter2_1 annotation (Placement(
-        transformation(
-        extent={{-12,-19},{12,19}},
-        rotation=90,
-        origin={-335,102})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    Boiler_walls(
-    Ns=3,
-    ExchangerWall(lambda=40, e=8e-3,
-      Tp(start={718.6571040634899,718.1194034334801,717.724499487972}),
-      Tp1(start={717.5714868892015,717.6719267649172,717.5487415294846})),
-    Dint=34e-3,
-    Ntubes=912,
-    L=40,
-    z2=40,
-    ExchangerFlueGasesMetal(St=292.41, Dext=50e-3,
-      DeltaT(start={554.0628991212207,228.3772089692427,89.70101646279409}),
-      T(start={1501.2484130859375,1045.9831048360795,847.7485555139816,
-            767.3925170898438}),
-      Tm(start={1273.6157574951133,946.8658301750306,807.5705357170625})),
-    TwoPhaseFlowPipe(rugosrel=0.0014,
-      P(start={30006184.0,29959265.487962805,29911856.28834493,
-            29864219.536209688,29816476.0}),
-      h(start={2742239.5,2768510.843637918,2779339.5468098293,2783592.798199836,
-            2783592.75})),
-    Cws2(P(start=29816475.42940753),h_vol(start=2783592.798199836)))
-    annotation (Placement(transformation(extent={{202,-27},{-202,27}},
-        rotation=-90,
-        origin={-521,308})));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink puitsFumeesPTQXA1(T(start=
-          398.86640471653106))
-    annotation (Placement(transformation(extent={{-392,-166},{-446,-110}},
-                                                                     rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases RMT_RHT(
-    Ns=3,
-    L=17.1,
-    ExchangerWall(lambda=40, e=6e-3,
-      Tp(start={908.5197253834301,914.4577273376398,917.7248494787165}),
-      Tp1(start={906.7665349453516,913.5361998085987,917.2460906463742})),
-    Dint=54.5e-3,
-    Ntubes=4900,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=66.5e-3,
-      step_T=0.22,
-      step_L=0.9619,
-      DeltaT(start={215.99646104532553,113.53397822935688,58.984016359030534}),
-      T(start={1189.486083984375,1062.720872868754,994.9311731733584,
-            959.3534545898438}),
-      Tm(start={1126.1034611836415,1028.8260230210562,977.1423166436323})),
-    Cws2(h(start=3.7057e6), P(start=6000000)),
-    TwoPhaseFlowPipe(rugosrel=0.0015,
-      P(start={6010948.5,6010749.460821071,6010514.567152408,6010261.309075393,
-            6009998.5}),
-      h(start={3264769.75,3507624.3814902483,3635275.8367294283,
-            3701594.2696911553,3701594.25})),
-    Cws1(P(start=6010948.472475457),h_vol(start=3264769.660736534)))
-    annotation (Placement(transformation(extent={{-348,288},{-246,218}})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases SBT(
-    Ns=3,
-    L=17.1,
-    Dint=38.3e-3,
-    TwoPhaseFlowPipe(rugosrel=0.0145,
-      P(start={29816474.0,29814038.312406328,29811347.95808922,
-            29808483.096597232,29805500.0}),
-      h(start={2783592.75,2877312.3915758613,2940320.6561487615,
-            2982465.835108181,2982465.75})),
-    ExchangerWall(lambda=40, e=6.5e-3,
-      Tp(start={749.7844520576,755.6415626459205,759.6971986304427}),
-      Tp1(start={747.8691146804046,754.3538694340593,758.8358820836914})),
-    Ntubes=3200,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=51.3e-3,
-      step_L=0.7,
-      DeltaT(start={176.62815353948065,118.74820438652762,79.42869651947797}),
-      T(start={959.3534545898438,896.7825168405388,854.222865602998,
-            825.5177612304688}),
-      Tm(start={928.0679884772226,875.5026912217684,839.8703116077473})),
-    Cws2(h_vol(start=2982465.835108181)))
-    annotation (Placement(transformation(extent={{-244,368},{-348,302}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_SBT(K(fixed=
-          false) = 910.878, C1(P(fixed=true, start=29805500)))
-    annotation (Placement(transformation(extent={{-376,321},{-400,350}})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases RBT(
-    Ns=3,
-    L=17.1,
-    TwoPhaseFlowPipe(rugosrel=0.0028,
-      P(start={6401069.0,6400829.006029598,6400559.967505192,6400281.512735571,
-            6400000.0}),
-      h(start={3071530.75,3206249.001381632,3250421.0375270667,
-            3264769.6607365347,3264769.75})),
-    ExchangerWall(lambda=40, e=7.5e-3,
-      Tp(start={731.5611188100817,719.1011974452427,714.9322174305115}),
-      Tp1(start={730.6241511341694,718.7939799453013,714.8324224349741})),
-    Dint=45.7e-3,
-    Ntubes=7400,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=60.7e-3,
-      step_L=0.7,
-      DeltaT(start={55.41873058878309,18.170961815555074,5.902564318895884}),
-      T(start={825.5177612304688,750.0683189765095,725.0092641729291,
-            716.83349609375}),
-      Tm(start={787.793038294503,737.5387915747193,720.9213932561836})),
-    Cws1(P(start=6401069.169670619),
-                             h_vol(start=3071530.861772407)),
-    Cws2(h_vol(start=3264769.660736535)))
-    annotation (Placement(transformation(extent={{-244,445},{-348,385}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_RBT(K(fixed=
-          false) = 34.39, C1(P(fixed=true, start=6400000)))
-    annotation (Placement(transformation(extent={{-390,401},{-416,429}})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases Economiseur(
-    Ns=3,
-    L=17.1,
-    ExchangerWall(lambda=40, e=7e-3,
-      Tp(start={597.8632830911926,601.9643838890306,604.4388143032807}),
-      Tp1(start={597.0798518240282,601.4765869344108,604.1356180309247})),
-    TwoPhaseFlowPipe(rugosrel=0.0015,
-      P(start={31940232.0,31940175.652893864,31940118.025039315,
-            31940059.354486804,31940000.0}),
-      h(start={1364477.625,1421835.5302184983,1457548.9512506293,
-            1479747.0728819133,1479747.125})),
-    Dint=37.1e-3,
-    Ntubes=5300,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=48.3e-3,
-      step_L=0.7,
-      DeltaT(start={97.96280056397143,60.995722003917535,37.91265067585584}),
-      T(start={716.83349609375,676.15417968096,650.5975916707414,
-            634.6221923828125}),
-      Tm(start={696.493851010199,663.3758856758507,642.6098980814818})))
-    annotation (Placement(transformation(extent={{-244,527},{-348,465}})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases SMT_SHT(
-    L=17.1,
-    TwoPhaseFlowPipe(rugosrel=0.0015,
-      P(start={27030444.0,27028361.67511348,27025839.239372097,
-            27022989.150393303,27019900.0}),
-      h(start={2976603.0,3194812.5584599497,3356176.887995873,3474803.099278803,
-            3474803.0})),
-    ExchangerWall(lambda=40, e=8e-3,
-      Tp(start={854.8283610087926,887.434475626394,912.4750108334613}),
-      Tp1(start={846.3932984841808,881.1968091408571,907.8894202971029})),
-    Dint=37.9e-3,
-    Ntubes=2075,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=53.9e-3,
-      step_T=0.22,
-      step_L=1.016,
-      DeltaT(start={571.7995516807581,422.84154854302676,310.84993208179515}),
-      T(start={1501.2484130859375,1366.1601385670497,1264.857744235079,
-            1189.486083984375})),
-    Cws2(P(start=27000000), h(start=3.4751e6)),
-    Ns=3)
-    annotation (Placement(transformation(extent={{-348,206},{-246,140}})));
-  ThermoSysPro.FlueGases.PressureLosses.InvSingularPressureLoss singularPressureLoss
-                          annotation (Placement(transformation(extent={{-496,
-            551},{-472,579}},
-                       rotation=0)));
-  ThermoSysPro.FlueGases.Junctions.Mixer2 mixer2_1(T(start=639.3587532777143))
-                                                   annotation (Placement(
-        transformation(
-        extent={{-18,-20},{18,20}},
-        rotation=90,
-        origin={-336,572})));
-  ThermoSysPro.FlueGases.HeatExchangers.StaticFluegasesFluegasesExchangerKS RA(
-    DPc(displayUnit="bar") = 0.01,
-    K=350,
-    S=7475,
-    DPf=0.01,
-    Tsc(displayUnit="degC", start=401.15),
-    Tsf(start=573.15, displayUnit="degC"))
-    annotation (Placement(transformation(extent={{-37,34},{37,-34}},
-        rotation=90,
-        origin={-338,-159})));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ sourceAir(
-    Xh2o=0.016,
-    Xo2=0.206,
-    Xco2=0,
-    Q0=708,
-    P0=101000,
-    T0=288.15)
-    annotation (Placement(transformation(extent={{-444,-260},{-394,-204}})));
-  ThermoSysPro.FlueGases.Volumes.VolumeATh AirPreheater(h(start=72890))
-    annotation (Placement(transformation(extent={{-368,-242},{-348,-222}})));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={305.15})
-    annotation (Placement(transformation(extent={{-368,-222},{-348,-202}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA1(                   h(start=
-          1479747.0728819133),
-                      P(start=32000000),
-    Cs2(Q(start=2.340852247894304)))
-    annotation (Placement(transformation(extent={{-366,484},{-394,508}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(
-    h(start=2976603.0385964634),
-    dynamic_mass_balance=true,
-    P(start=27030443.91251134))
-    annotation (Placement(transformation(extent={{-390,162},{-370,184}})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceQ(
-                                                             Q0=0, P0=100000)
-    annotation (Placement(transformation(extent={{-144,-8},{-206,60}}, rotation=
-           0)));
-  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    rho=1200,
-    Hum=0.03,
-    T0(displayUnit="K") = 288.15,
-    Xc=0.6652,
-    Xh=0.0378,
-    Xo=0.0546,
-    Xn=0.0156,
-    Xs=0.0052,
-    Xashes=0.1415,
-    Vol=0.229,
-    Q0=65.765,
-    LHV=26030e3)
-    annotation (Placement(transformation(extent={{-140,-94},{-208,-26}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveEco(
-    T(displayUnit="K"),
-    Cvmax(fixed=true) = 200,
-    Q(start=2.35, fixed=false))
-                             annotation (Placement(transformation(
-        extent={{14,14},{-14,-14}},
-        rotation=90,
-        origin={-372,443})));
-  ThermoSysPro.Examples.Control.TemperatureControl TemperatureControl(
-    Ti=5,
-    pIsat(Ti=20, Limiteur1(u(signal(start=-0.028450421536047304)))),
-    add(k1=+1, k2=-1))
-    annotation (Placement(transformation(extent={{-148,441},{-180,477}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constant_Temperature(k=873.15)
-    annotation (Placement(transformation(extent={{-104,435},{-132,461}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Q_flueGases_wall(k=
-        0.03506165)
-    annotation (Placement(transformation(extent={{-422,60},{-380,92}})));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_Drum_2
-                                                                 annotation (
-      Placement(transformation(
-        extent={{22,-20},{-22,20}},
-        rotation=180,
-        origin={764,594})));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_ReDrum
-                                                                 annotation (
-      Placement(transformation(
-        extent={{19,-19},{-19,19}},
-        rotation=180,
-        origin={1795,550})));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_Cond
-                                                                 annotation (
-      Placement(transformation(
-        extent={{26,-26},{-26,26}},
-        rotation=90,
-        origin={1930,285})));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ Sensor_Qvap_Cond(C1(h_vol(start=
-            1957787.8431100189)))
-    annotation (Placement(transformation(
-        origin={1704,53},
-        extent={{-13,-18},{13,18}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ Sensor_Qvap_Cond2
-    annotation (Placement(transformation(
-        origin={1706,-113},
-        extent={{-15,-16},{15,16}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Low(mode=1, K=
-       1e-4,
-    C1(h_vol(start=140956.11701829222), P(start=2617886.004032243)),
-    Pm(start=2617885.994610223))
-                 annotation (Placement(transformation(extent={{-27,-24},{27,24}},
-                    rotation=90,
-        origin={1830,290})));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve_Condenser(
-    mode=1,
-    Cvmax=2000,
-    C2(P(start=2696400)))
-    annotation (Placement(transformation(
-        extent={{-18,-17},{18,17}},
-        rotation=90,
-        origin={1819,-160})));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneLevelCondenser1(k=1.5)
-    annotation (Placement(transformation(extent={{1932,-38},{1896,-2}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Level_Condenser(
-    add(k1=+1, k2=-1),
-    pIsat(
-      Ti=200,
-      minval=0.3,
-      Limiteur1(u(signal(start=0.8)))),
-    pIsat1(Ti=100, minval=0.3),
-    edge(uL(signal(start=true))))
-                                annotation (Placement(transformation(extent={{
-            1896,-98},{1940,-54}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Condenser1(
-                                                                                       K=1e-4, Pm(start=
-          5191.555663955529))
-    annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=0,
-        origin={1661,67})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP2(
-    h(start=3.07903e6),
-    K(fixed=false) = 1e-4,
-    Pm(start=6401000),
-    C1(P(fixed=true, start=6401100)))
-    annotation (Placement(transformation(extent={{28,-19},{-28,19}}, rotation=270,
-        origin={285,291})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_condenser(h(start=
-          1957787.8431100189),
-    h0=1.959e6,
-    P0=538300000,
-    P(start=5000))
-    annotation (Placement(transformation(extent={{1600,53},{1628,81}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_Eco(K(fixed=
-          false) = 3867, C1(P(fixed=true, start=31940000)))
-    annotation (Placement(transformation(extent={{-416,482},{-442,510}})));
-  ThermoSysPro.WaterSteam.PressureLosses.CheckValve CheckValve(
-    Qmin=1,
-    Q(fixed=true, start=30.011367796945933),
-    k(fixed=false) = 100,
-    touvert(start=true))
-    annotation (Placement(transformation(
-        extent={{-18,-16},{18,16}},
-        rotation=90,
-        origin={745,288})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps V_staticCentrifugalPump(Table=[0,
-        1400; 100,1400; 700,1000; 800,950; 900,950; 1000,950])
-                   annotation (Placement(transformation(extent={{1670,-310},{
-            1738,-244}}, rotation=0)));
-  ThermoSysPro.Examples.Control.MassFlowControl Pump_VelocityControl(
-    pT1_1(k=1, Ti=1),
-    Ti=5,
-    maxval=1400,
-    pIsat(Limiteur1(u(signal(start=1400.006776094082)))))
-    annotation (Placement(transformation(extent={{628,637},{694,699}})));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ sensorQ
-    annotation (Placement(transformation(extent={{626,494},{606,514}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(
-    k=1,
-    U0=1400,
-    permanent=true,
-    Ti=10)
-    annotation (Placement(transformation(extent={{712,631},{732,651}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp_Kcor(
-    Starttime=100,
-    Duration=600,
-    Initialvalue=1,
-    Finalvalue=0.5)
-    annotation (Placement(transformation(extent={{-244,-170},{-274,-148}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP1(
-    h0=850000,
-    dynamic_mass_balance=true,
-    P0=32200000,
-    P(start=31945061.30060599),
-    h(start=1338936.2648439475),
-    Ce1(h(start=1338936.264843952)))
-                     annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=-90,
-        origin={86,496})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterHP1_1(
-    KPurge=1279,
-    lambdaE=750,
-    Se(h(start=1.369e6), P(start=32050000)),
-    KCond=1588,
-    SCondDes=1692.5,
-    SPurge=1049,
-    P(start=8930425.05990273),
-    Ee(h(start=1168614.3172357369)),
-    Ev(Q(start=25.40000000000056)),
-    HDesF(start=1301805.3904686691),
-    HeiF(start=1184664.7287055398),
-    Hep(start=1360493.8691474795),
-    SDes(start=416.5392801864518),
-    Sp(h(start=1170923.990738357)),
-    h(start=940451.6341612969))
-    annotation (Placement(transformation(extent={{208,610},{104,508}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterHP2_1(
-    lambdaE=1157,
-    Se(P(start=32400000), h(start=1168614.317235736)),
-    KCond=1588,
-    KPurge=1200,
-    SCondDes=1667.5,
-    SPurge=849,
-    P(start=5568798.758801826),
-    Ee(h(start=932438.8978014372)),
-    Ev(Q(start=30.499999999999968)),
-    HDesF(start=1139894.576035795),
-    HeiF(start=977219.5507564419),
-    Hep(start=1180774.725005288),
-    SDes(start=337.20064662513767))
-    annotation (Placement(transformation(extent={{404,612},{302,506}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP2(
-    h0=820000,
-    h(start=932438.8978014372),
-    dynamic_mass_balance=true,
-    P0=32400000,
-    P(start=32156093.56417011))
-    annotation (Placement(transformation(extent={{416,487},{436,507}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP3(
-    h0=990400,
-    h(start=940451.6341612943),
-    P0=6400171,
-    P(start=5568798.758431694))
-                      annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={498,565})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP1Vap(
-    h0=990400,
-    dynamic_mass_balance=true,
-    h(start=3182580.38391812),
-    P0=10000000,
-    P(start=8930425.061957654))
-                       annotation (Placement(transformation(
-        extent={{-10,10},{10,-10}},
-        rotation=90,
-        origin={128,342})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP1Vap1(
-    h0=990400,
-    dynamic_mass_balance=true,
-    h(start=3071530.861772407),
-    P0=6400171,
-    P(start=5568798.763146943))
-                      annotation (Placement(transformation(
-        extent={{-10,10},{10,-10}},
-        rotation=90,
-        origin={322,342})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=1e-4, pro(d(start=844.2396226650313)))
-    annotation (Placement(transformation(extent={{524,555},{544,575}})));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP singularPressureLoss2
-    annotation (Placement(transformation(extent={{433,592},{453,612}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={384,470})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={292,470})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={322,382})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss6(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={128,389})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss7(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={70,470})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP21(
-    h0=1168600,
-    h(start=1168614.3172357369),
-    P0=32060000,
-    dynamic_mass_balance=true,
-    P(start=32031852.891034454))
-    annotation (Placement(transformation(extent={{266,549},{246,569}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP22(
-    h0=1168600,
-    h(start=1168614.317235733),
-    P0=32060000,
-    dynamic_mass_balance=true,
-    P(start=32031852.513327856))
-    annotation (Placement(transformation(extent={{264,419},{244,439}})));
-  ThermoSysPro.Examples.Control.MassFlowRateAirCoalWater
-    MassFlowRateAirCoalWater
-    annotation (Placement(transformation(extent={{-408,620},{-488,708}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Power_MW(
-    Starttime=100,
-    Duration=600,
-    Initialvalue=804.461,
-    Finalvalue=399.8)
-    annotation (Placement(transformation(extent={{-340,678},{-370,700}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_2(
-    k=1,
-    permanent=true,
-    U0=708,
-    Ti=5)
-    annotation (Placement(transformation(extent={{-554,648},{-582,671}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_3(
-    k=1,
-    permanent=true,
-    U0=804,
-    Ti=5)
-    annotation (Placement(transformation(extent={{-556,684},{-580,709}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_4(
-    k=1,
-    permanent=true,
-    U0=600,
-    Ti=5)
-    annotation (Placement(transformation(extent={{-370,636},{-344,662}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_5(
-    k=1,
-    permanent=true,
-    U0=0.8,
-    Ti=10)
-    annotation (Placement(transformation(extent={{1766,-170},{1786,-150}})));
-equation
-
-  connect(lumpedStraightPipe_IP3.C1, splitter_TurbineIP3.Cs2) annotation (Line(
-      points={{945,263},{945,78}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_LP2.Cs, splitter_TurbineLP2.Ce1) annotation (Line(
-      points={{1236.27,67},{1284,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_TurbineLP2.Cs1, Turbine_LP3.Ce) annotation (Line(
-      points={{1308,67},{1357.73,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_LP2.C1, splitter_TurbineLP2.Cs2) annotation (Line(
-      points={{1296,264},{1296,79}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_LP3.Cs, splitter_TurbineLP3.Ce1) annotation (Line(
-      points={{1412.27,67},{1460,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(
-      points={{1614,-29},{1616,-29},{1616,-32.22},{1636,-32.22}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Condenser.Cse, PuitsCaloporteur.C) annotation (Line(
-      points={{1746,-31.2},{1741,-31.2},{1741,-29},{1764,-29}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(lumpedStraightPipe_LP3.C2, ReheaterLP3.Ev) annotation (Line(
-      points={{1474,318},{1474,474.12},{1475.2,474.12}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_LP1.C2, ReheaterLP1.Ev) annotation (Line(
-      points={{1124,318},{1124,475.76},{1127.6,475.76}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterLP1.Sp, ReheaterLP2.Ep) annotation (Line(
-      points={{1192.4,512.81},{1192.4,555},{1248,555},{1248,453},{1366.4,453},{
-          1366.4,472.94}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(lumpedStraightPipe_LP1.C1, splitter_TurbineLP1.Cs2) annotation (Line(
-      points={{1124,264},{1124,79}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Drum_1.Ce3, pipePressureLoss_LP3_Drum.C2)
-                                             annotation (Line(
-      points={{1872,499.2},{1852,499.2},{1852,580},{1602,580}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(pipePressureLoss_LP3_Drum.C1, ReheaterLP3.Sp)
-                                                annotation (Line(
-      points={{1562,580},{1544.8,580},{1544.8,512.47}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterIP.Sp, ReheaterLP1.Ep)  annotation (Line(
-      points={{1008.8,512.81},{1008.8,549},{1072,549},{1072,451},{1192.4,451},{
-          1192.4,474.62}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(lumpedStraightPipe_LP3.C1, splitter_TurbineLP3.Cs2) annotation (Line(
-      points={{1474,264},{1474,81},{1473,81}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-
-  connect(ReheaterHP3.Ev, lumpedStraightPipe_Desu.C2)
-                                                     annotation (Line(
-      points={{493.6,481.32},{493.6,375.5},{297,375.5}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Desuperheater.Sc, lumpedStraightPipe_Desu.C1)
-    annotation (Line(
-      points={{-38.8,475.91},{-38.8,376},{252,376},{252,375.5}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Desuperheater.Ec, lumpedStraightPipe_IP1.C2)
-    annotation (Line(
-      points={{2.8,475.91},{2.8,364},{530,364},{530,317}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_HP1.Cs, splitter_Turbine_HP1.Ce)
-                                             annotation (Line(
-      points={{256.42,175},{256.42,173.5},{272,173.5},{272,176}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_Turbine_HP.Cs2, lumpedStraightPipe_HP.C1)
-                                                   annotation (Line(
-      points={{128,183.82},{128,275}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterHP1.Sp, ReheaterHP2.Ep) annotation (Line(
-      points={{187.2,445.83},{188,460},{188,474},{242,474},{242,392},{383.6,392},
-          {383.6,410.98}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterLP2.Ev, lumpedStraightPipe_LP2.C2) annotation (Line(
-      points={{1295.6,474.12},{1295.6,418.38},{1296,418.38},{1296,318}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_HP_IP.C2, splitter_TurbineIP3.Ce2) annotation (
-      Line(
-      points={{899,-8.5},{945,-8.5},{945,56.22}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_Turbine_HP1.Cs3, lumpedStraightPipe_HP_IP.C1) annotation (
-      Line(
-      points={{294,176},{294,-8.5},{868,-8.5}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_Turbine_HP1.Cs1, lumpedStraightPipe_HP1.C1) annotation (Line(
-      points={{283,167},{322,167},{322,264}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(generator.Wmec5,add. y) annotation (Line(
-      points={{48,-206},{48,-209},{75.1,-209}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Turbine_HP.MechPower,add. u1) annotation (Line(
-      points={{64.2,139.9},{64.2,-198.05},{94.9,-198.05},{94.9,-203.6}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_HP1.MechPower,add. u2) annotation (Line(
-      points={{260.2,139.9},{260.2,-214.4},{94.9,-214.4}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(generator.Wmec4,add1. y) annotation (Line(
-      points={{48,-230},{75,-230}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Turbine_IP1.MechPower,add1. u1) annotation (Line(
-      points={{452.7,40.9},{452.7,-222},{97,-222}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_IP2.MechPower,add1. u2) annotation (Line(
-      points={{658.7,40.95},{658.7,-230},{97,-230}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_IP3.MechPower,add1. u3) annotation (Line(
-      points={{858.7,40.9},{858.7,-238},{97,-238}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(generator.Wmec3,add2. y) annotation (Line(
-      points={{48,-254},{75.1,-254}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Turbine_LP1.MechPower,add2. u1) annotation (Line(
-      points={{1060.7,40.9},{1060.7,-246},{94.9,-246}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_LP2.MechPower,add2. u2) annotation (Line(
-      points={{1238.7,40.9},{1238.7,-254},{94.9,-254}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_LP3.MechPower,add2. u3) annotation (Line(
-      points={{1414.7,40.9},{1414.7,-262},{94.9,-262}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Echappement.MechPower,generator. Wmec2) annotation (Line(
-      points={{1570.7,40},{1570.7,-278},{48,-278}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(controlValveHP.C2, Turbine_HP.Ce) annotation (Line(
-      points={{-121,173.6},{-34,173.6},{-34,175},{-24.42,175}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(sensorT.C2, controlValveHP.C1) annotation (Line(
-      points={{-179.78,173},{-151.89,173},{-151.89,173.6},{-157,173.6}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(constantIP.y, controlValveIP.Ouv)  annotation (Line(
-      points={{-121.8,292},{-140,292},{-140,287}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(controlValveIP.C2, Turbine_IP1.Ce) annotation (Line(
-      points={{-122,253},{-36,253},{-36,67},{395.73,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(genericCombustion.Cfg,splitter2_1. Ce) annotation (Line(
-      points={{-337,59.5},{-336,76},{-336,90},{-335,90}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(Boiler_walls.Cws1, Wall_screen.C2)          annotation (Line(
-      points={{-521,106},{-522,82},{-520,48}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter2_1.Cs1, Boiler_walls.Cfg1)   annotation (Line(
-      points={{-354,106.8},{-472,106.8},{-472,308},{-507.5,308}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(genericCombustion.Cth,heatExchangerWall. WT2) annotation (Line(
-      points={{-426.1,-17},{-454,-17},{-454,-18},{-457.6,-18}},
-      color={0,0,0},
-      smooth=Smooth.None));
-  connect(heatExchangerWall.WT1, Wall_screen.CTh)        annotation (Line(
-      points={{-472.4,-18},{-506.8,-18}},
-      color={0,0,0},
-      smooth=Smooth.None));
-  connect(SBT.Cfg1,RMT_RHT. Cfg2) annotation (Line(
-      points={{-296,318.5},{-296,270.5},{-297,270.5}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(RBT.Cfg1,SBT. Cfg2)      annotation (Line(
-      points={{-296,400},{-296,351.5}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(singularPressureLoss_RBT.C2,RMT_RHT. Cws1) annotation (Line(
-      points={{-416,415},{-418,415},{-418,253},{-348,253}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(SBT.Cws1, Boiler_walls.Cws2)   annotation (Line(
-      points={{-244,335},{-234,335},{-234,538},{-520,538},{-520,510},{-521,510}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(SMT_SHT.Cfg1,splitter2_1. Cs2) annotation (Line(
-      points={{-297,156.5},{-298,132},{-298,108},{-316,108},{-316,106.8}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(RMT_RHT.Cfg1,SMT_SHT. Cfg2) annotation (Line(
-      points={{-297,235.5},{-297,189.5}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(singularPressureLoss.C1, Boiler_walls.Cfg2)    annotation (Line(
-      points={{-496,565},{-550,565},{-550,308},{-534.5,308}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(Economiseur.Cfg2,mixer2_1. Ce2) annotation (Line(
-      points={{-296,511.5},{-296,564.8},{-316,564.8}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(RA.Sc,puitsFumeesPTQXA1. C)
-    annotation (Line(
-      points={{-358.4,-136.8},{-358.4,-138},{-392.54,-138}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(RA.Sf,genericCombustion. Ca)
-    annotation (Line(
-      points={{-338,-122},{-338,-93.5},{-337,-93.5}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(singularPressureLoss.C2, mixer2_1.Ce1)  annotation (Line(
-      points={{-472,565},{-458,565},{-458,564.8},{-356,564.8}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(mixer2_1.Cs,RA. Ec) annotation (Line(
-      points={{-336,590},{-564,590},{-564,-184},{-358.4,-184},{-358.4,-181.2}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(AirPreheater.Cs1,RA. Ef) annotation (Line(
-      points={{-348,-232},{-338,-232},{-338,-196}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(sourceAir.C, AirPreheater.Ce1)  annotation (Line(
-      points={{-394,-232},{-368,-232}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(heatSource.C[1],AirPreheater. Cth) annotation (Line(
-      points={{-358,-221.8},{-358,-232}},
-      color={0,0,0},
-      smooth=Smooth.None));
-  connect(singularPressureLoss_SBT.C2,volumeA. Ce1) annotation (Line(
-      points={{-400,335.5},{-400,173},{-390,173}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(volumeA1.Ce1,Economiseur. Cws2) annotation (Line(
-      points={{-366,496},{-348,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(fuelSourcePQ.C,genericCombustion. Cfuel) annotation (Line(
-      points={{-208,-60},{-208,-59.5},{-247.9,-59.5}},
-      color={0,0,0},
-      smooth=Smooth.None));
-
-  connect(Economiseur.Cfg1, RBT.Cfg2) annotation (Line(
-      points={{-296,480.5},{-296,430}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(controlValveEco.C1,volumeA1. Cs2) annotation (Line(
-      points={{-380.4,457},{-380.4,484},{-380,484}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(controlValveEco.C2,volumeA. Ce2) annotation (Line(
-      points={{-380.4,429},{-380.4,280},{-380,280},{-380,183.78}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TemperatureControl.MesureNiveauEau, sensorT.Measure) annotation (Line(
-      points={{-147.2,475.2},{-191,475.2},{-191,200}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TemperatureControl.ConsigneNiveauEau, constant_Temperature.y)
-    annotation (Line(
-      points={{-147.2,448.2},{-136,448.2},{-136,448},{-133.4,448}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(controlValveEco.Ouv, TemperatureControl.SortieReelle1) annotation (
-      Line(
-      points={{-356.6,443},{-276.625,443},{-276.625,442.8},{-180.8,442.8}},
-      color={0,0,255},
-      smooth=Smooth.None));
-
-  connect(genericCombustion.Cws, sourceQ.C) annotation (Line(
-      points={{-247.9,25.5},{-203.95,25.5},{-203.95,26},{-206,26}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(splitter_TurbineIP1.Cs2, lumpedStraightPipe_IP1.C1) annotation (Line(
-      points={{530,79},{530,264}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterIP.Ev, lumpedStraightPipe_IP3.C2) annotation (Line(
-      points={{945.2,475.76},{945.2,428.04},{945,428.04},{945,317}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterIP.Ee, ReheaterLP1.Se) annotation (Line(
-      points={{1031.06,494},{1040,496},{1040,493},{1100,493},{1106,494}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterLP1.Ee, ReheaterLP2.Se) annotation (Line(
-      points={{1215.08,494},{1222,496},{1222,493},{1272,493}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterLP2.Ee, ReheaterLP3.Se) annotation (Line(
-      points={{1391.18,493},{1396,496},{1396,493},{1452,493}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Q_flueGases_wall.y, splitter2_1.Ialpha1)
-                                              annotation (Line(
-      points={{-377.9,76},{-346.4,76},{-346.4,103.2}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterLP2.Sp, ReDrum.Ec)
-                                   annotation (Line(
-      points={{1366.4,512.47},{1366.4,605},{1758.4,605},{1758.4,516.14}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(loopBreakerP_ReDrum.C1, ReDrum.Sc)
-                                     annotation (Line(
-      points={{1776,550},{1706,550},{1706,545},{1705.6,545},{1705.6,516.14}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(loopBreakerP_ReDrum.C2, Drum_1.Ce1)
-                                         annotation (Line(
-      points={{1814,550},{1814,549},{1834,549},{1834,548.8},{1872,548.8}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(staticCentrifugalPump1.C1, Drum_2.Cs1)  annotation (Line(
-      points={{683,496},{712,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(loopBreakerP_Drum_2.C1, ReheaterHP3.Sp)
-                                            annotation (Line(
-      points={{742,594},{552,594},{552,513.17},{552.4,513.17}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(loopBreakerP_Drum_2.C2, Drum_2.Ce2)
-                                         annotation (Line(
-      points={{786,594},{834,594},{834,468},{774,468}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Drum_1.Cs1, loopBreakerP_Cond.C1)
-                                         annotation (Line(
-      points={{1926,548.8},{1928,548.8},{1928,311},{1930,311}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Sensor_Qvap_Cond.C2, Condenser.Cv)          annotation (Line(
-      points={{1689.6,39.74},{1689.6,45.87},{1691,45.87},{1691,30}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReDrum.Ef, lumpedStraightPipe_Low.C2)
-                                        annotation (Line(
-      points={{1798,494},{1830,494},{1830,317}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_Low.C1, controlValve_Condenser.C2)
-                                                annotation (Line(
-      points={{1830,263},{1830,-142},{1829.2,-142}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(controlValve_Condenser.C1, staticCentrifugalPump.C2)
-                                                     annotation (Line(
-      points={{1829.2,-178},{1829.2,-206},{1796,-206},{1796,-207}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ConsigneLevelCondenser1.y, regulation_Level_Condenser.ConsigneNiveauEau)
-    annotation (Line(points={{1894.2,-20},{1852,-20},{1852,-69.4},{1894.9,-69.4}}));
-  connect(Sensor_Qvap_Cond.Measure, regulation_Level_Condenser.MesureDebitVapeur)
-    annotation (Line(points={{1722.36,53},{1816,53},{1816,-96},{1856,-96},{
-          1895.12,-95.58}}));
-
-  connect(regulation_Level_Condenser.MesureDebitEau, Sensor_Qvap_Cond2.Measure)
-                                        annotation (Line(
-      points={{1894.79,-82.49},{1774,-82.49},{1774,-113},{1722.32,-113}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Condenser.yNiveau, regulation_Level_Condenser.MesureNiveauEau)
-    annotation (Line(
-      points={{1751.5,-57.72},{1860,-57.72},{1860,-56.2},{1894.9,-56.2}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Sensor_Qvap_Cond2.C2, lumpedStraightPipe_Condenser2.C1)
-    annotation (Line(
-      points={{1693.2,-128.3},{1693.2,-125.13},{1694,-125.13},{1694,-148}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Sensor_Qvap_Cond2.C1, Condenser.Cl)          annotation (Line(
-      points={{1693.2,-98},{1694,-98},{1694,-72},{1692.1,-72}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_TurbineIP2.Cs1, Turbine_IP3.Ce) annotation (Line(
-      points={{760,67},{801.73,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_IP3.Cs, splitter_TurbineIP3.Ce1) annotation (Line(
-      points={{856.27,67},{932,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_TurbineLP3.Cs1, Echappement.Ce) annotation (Line(
-      points={{1486,67},{1513.73,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_Condenser1.C2, Sensor_Qvap_Cond.C1)
-    annotation (Line(
-      points={{1677,67},{1688,67},{1688,66},{1689.6,66}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Economiseur.Cws1, Desuperheater.Sf)
-                                     annotation (Line(
-      points={{-244,496},{-162,496},{-162,495.51},{-70,495.51}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(RBT.Cws1, lumpedStraightPipe_HP2.C2) annotation (Line(
-      points={{-244,415},{285,415},{285,319}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Echappement.Cs, splitter_condenser.Ce1) annotation (Line(
-      points={{1568.27,67},{1600,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_condenser.Cs1, lumpedStraightPipe_Condenser1.C1) annotation (
-     Line(
-      points={{1628,67},{1645,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(loopBreakerP_Cond.C2, splitter_condenser.Ce2)
-                                                    annotation (Line(
-      points={{1930,259},{1927,259},{1927,80.72},{1614,80.72}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(singularPressureLoss_Eco.C1, volumeA1.Cs1) annotation (Line(
-      points={{-416,496},{-412,496},{-412,497},{-406,497},{-406,496},{-394,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Wall_screen.C1, singularPressureLoss_Eco.C2)        annotation (Line(
-      points={{-520,-84},{-442,-84},{-442,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterLP3.Ee, ReDrum.Sf)
-                                   annotation (Line(
-      points={{1569.16,493},{1615.55,493},{1615.55,494.54},{1666,494.54}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(volumeA.Cs1, SMT_SHT.Cws1) annotation (Line(
-      points={{-370,173},{-352,174},{-352,172},{-350,174},{-348,173}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_Turbine_HP.Cs3, Turbine_HP1.Ce) annotation (Line(
-      points={{140,175},{171.58,175}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_HP.Cs, splitter_Turbine_HP.Ce) annotation (Line(
-      points={{60.42,175},{116,175}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Drum_2.Ce1, ReheaterIP.Se) annotation (Line(
-      points={{774,496},{918,497},{918,495},{922,495},{924,494}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_HP2.C1, splitter_Turbine_HP1.Cs2) annotation (Line(
-      points={{285,263},{284,263},{284,184.82},{283,184.82}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_TurbineIP1.Cs1, Turbine_IP2.Ce) annotation (Line(
-      points={{542,67},{570,67},{570,67.5},{601.73,67.5}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_IP1.Cs, splitter_TurbineIP1.Ce1) annotation (Line(
-      points={{450.27,67},{518,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_IP2.Cs, splitter_TurbineIP2.Ce1) annotation (Line(
-      points={{656.27,67.5},{694.14,67.5},{694.14,67},{732,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_Condenser2.C2, staticCentrifugalPump.C1)
-    annotation (Line(
-      points={{1694,-180},{1694,-207},{1760,-207}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(controlValveIP.C1, RMT_RHT.Cws2) annotation (Line(
-      points={{-158,253},{-246,253}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(singularPressureLoss_RBT.C1, RBT.Cws2) annotation (Line(
-      points={{-390,415},{-348,415}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(singularPressureLoss_SBT.C1, SBT.Cws2) annotation (Line(
-      points={{-376,335.5},{-362,335.5},{-362,335},{-348,335}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(sensorT.C1, SMT_SHT.Cws2) annotation (Line(
-      points={{-202,173},{-246,173}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(controlValveHP.Ouv, constantHP.y) annotation (Line(
-      points={{-139,205.9},{-139,215},{-115.5,215}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(CheckValve.C1, splitter_TurbineIP2.Cs2)      annotation (Line(
-      points={{745,268.2},{746,268.2},{746,80}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(V_staticCentrifugalPump.y, staticCentrifugalPump.rpm_or_mpower)
-    annotation (Line(
-      points={{1741.4,-277},{1778,-277},{1778,-227.9}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(sensorQ.C2, ReheaterHP3.Ee) annotation (Line(
-      points={{605.8,496},{590,496},{590,497},{572.98,497}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(sensorQ.C1, staticCentrifugalPump1.C2) annotation (Line(
-      points={{626,496},{655,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(sensorQ.Measure,Pump_VelocityControl. Mesure_Q_water) annotation (
-      Line(
-      points={{616,514.2},{616,614},{528,614},{528,694},{626.35,694},{626.35,
-          695.9}},
-      color={127,0,0},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash,
-      thickness=0.5));
-  connect(Pump_VelocityControl.SortieReelle1, pT1_1.u) annotation (Line(
-      points={{695.65,640.1},{704.825,640.1},{704.825,641},{711,641}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(pT1_1.y, staticCentrifugalPump1.rpm_or_mpower) annotation (Line(
-      points={{733,641},{733,642},{732,614},{670,614},{669,510.3}},
-      color={127,0,0},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash,
-      thickness=0.5));
-  connect(splitter_TurbineIP3.Cs1, Turbine_LP1.Ce) annotation (Line(
-      points={{958,67},{1003.73,67}},
-      color={255,0,0},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(Turbine_LP1.Cs, splitter_TurbineLP1.Ce1) annotation (Line(
-      points={{1058.27,67},{1112,67}},
-      color={255,0,0},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(splitter_TurbineLP1.Cs1, Turbine_LP2.Ce) annotation (Line(
-      points={{1136,67},{1181.73,67}},
-      color={255,0,0},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(RA.Kcorr, ramp_Kcor.y) annotation (Line(
-      points={{-314.2,-159},{-275.5,-159}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterHP3.Se, volume_HP2.Ce2) annotation (Line(
-      points={{474,497},{436,497}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP2.Cs2, ReheaterHP2.Ee) annotation (Line(
-      points={{426,487.2},{428,487.2},{428,429},{405.02,429}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP2.Cs1, ReheaterHP2_1.Ee) annotation (Line(
-      points={{426,506},{426,560},{405.02,560},{405.02,559}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1_1.Se, volume_HP1.Ce1) annotation (Line(
-      points={{104,559},{86,559},{86,506}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1.Se, volume_HP1.Ce2) annotation (Line(
-      points={{104,429},{86,429},{86,486}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP1.Cs2, Desuperheater.Ef) annotation (Line(
-      points={{76.2,496},{34,496}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1_1.Sp, ReheaterHP2_1.Ep) annotation (Line(
-      points={{187.2,575.83},{187.2,602},{244,602},{244,518},{383.6,518},{383.6,
-          540.98}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(lumpedStraightPipe_HP.C2, volume_HP1Vap.Ce1) annotation (Line(
-      points={{128,318},{128,332}},
-      color={255,0,0},
-      thickness=0.5,
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(lumpedStraightPipe_HP1.C2, volume_HP1Vap1.Ce1) annotation (Line(
-      points={{322,318},{322,332}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP3.Cs2, singularPressureLoss1.C1) annotation (Line(
-      points={{507.8,565},{524,565}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(singularPressureLoss1.C2, ReheaterHP3.Ep) annotation (Line(
-      points={{544,565},{588,565},{588,461},{552.4,461},{552.4,480.34}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterHP2_1.Sp, singularPressureLoss2.C1) annotation (Line(
-      points={{383.6,576.49},{383.6,602},{433,602}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(singularPressureLoss2.C2, volume_HP3.Ce2) annotation (Line(
-      points={{453,602},{498,602},{498,575}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterHP2.Sp, singularPressureLoss3.C1) annotation (Line(
-      points={{383.6,446.49},{383.6,460},{384,460}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(singularPressureLoss3.C2, volume_HP3.Ce1) annotation (Line(
-      points={{384,480},{400,480},{400,516},{416,516},{416,528},{498,528},{498,
-          555}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(volume_HP1Vap1.Cs1, singularPressureLoss5.C1) annotation (Line(
-      points={{322,352},{322,372}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash,
-      thickness=0.5));
-  connect(singularPressureLoss5.C2, ReheaterHP2.Ev) annotation (Line(
-      points={{322,392},{322,412.04},{322.4,412.04}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash,
-      thickness=0.5));
-  connect(volume_HP1Vap1.Cs2, singularPressureLoss4.C1) annotation (Line(
-      points={{312,342},{292,342},{292,460}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(singularPressureLoss4.C2, ReheaterHP2_1.Ev) annotation (Line(
-      points={{292,480},{290,480},{290,524},{322.4,524},{322.4,542.04}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP1Vap.Cs1, singularPressureLoss6.C1) annotation (Line(
-      points={{128,352},{128,379}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(singularPressureLoss6.C2, ReheaterHP1.Ev) annotation (Line(
-      points={{128,399},{128,412.68},{124.8,412.68}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP1Vap.Cs2, singularPressureLoss7.C1) annotation (Line(
-      points={{118,342},{70,342},{70,460}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(singularPressureLoss7.C2, ReheaterHP1_1.Ev) annotation (Line(
-      points={{70,480},{70,526},{124.8,526},{124.8,542.68}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP21.Ce1, ReheaterHP2_1.Se) annotation (Line(
-      points={{266,559},{302,559}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1_1.Ee, volume_HP21.Cs1) annotation (Line(
-      points={{209.04,559},{246,559}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1.Ee, volume_HP22.Cs1) annotation (Line(
-      points={{209.04,429},{244,429}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP22.Ce1, ReheaterHP2.Se) annotation (Line(
-      points={{264,429},{302,429}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(Power_MW.y, MassFlowRateAirCoalWater.Electrical_power_MW) annotation (
-     Line(
-      points={{-371.5,689},{-384,689},{-384,706.24},{-444,706.24}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_3.y, fuelSourcePQ.IMassFlow) annotation (Line(
-      points={{-581.2,696.5},{-590,688},{-600,688},{-600,-272},{-174,-272},{
-          -174,-43}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_3.u, MassFlowRateAirCoalWater.Q_coal) annotation (Line(
-      points={{-554.8,696.5},{-523.4,696.5},{-523.4,697},{-492,697}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_2.y, sourceAir.IMassFlow) annotation (Line(
-      points={{-583.4,659.5},{-592,659.5},{-592,-218},{-419,-218}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_2.u, MassFlowRateAirCoalWater.Q_air) annotation (Line(
-      points={{-552.6,659.5},{-522.3,659.5},{-522.3,660.04},{-492,660.04}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_4.y,Pump_VelocityControl. Consigne_Q_water) annotation (Line(
-      points={{-342.7,649},{141.65,649},{141.65,649.4},{626.35,649.4}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(MassFlowRateAirCoalWater.Q_water, pT1_4.u) annotation (Line(
-      points={{-492,624.84},{-508,624.84},{-508,610},{-392,610},{-392,649},{-371.3,
-          649}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(CheckValve.C2, Drum_2.Ce4) annotation (Line(
-      points={{745,307.8},{745,296.9},{743,296.9},{743,433}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(regulation_Level_Condenser.SortieReelle1, pT1_5.u) annotation (Line(
-      points={{1941.1,-95.8},{1954,-95.8},{1954,-128},{1752,-128},{1752,-160},{
-          1765,-160}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(pT1_5.y, controlValve_Condenser.Ouv) annotation (Line(
-      points={{1787,-160},{1800.3,-160}},
-      color={0,0,255},
-      smooth=Smooth.None));
-annotation (
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </h4>
-<p><b>ThermoSysPro Version 3.2 </h4>
-<p>This is the dynamic model of a once-through supercritical coal-fired power plant. </p>
-<p>It is documented in Sect. 6.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Cecilia Rioual</li>
-</ul>
-</html>"),
-   Diagram(coordinateSystem(
-        preserveAspectRatio=true,
-        extent={{-600,-400},{2000,800}},
-        initialScale=0.1), graphics={Text(
-          extent={{80,134},{188,114}},
-          lineColor={0,0,255},
-          textString="Turbine_HP"),  Text(
-          extent={{385,18},{489,-2}},
-          lineColor={0,0,255},
-          textString="Turbine_IP"),  Text(
-          extent={{990,22},{1104,2}},
-          lineColor={0,0,255},
-          textString="Turbine_LP"),  Text(
-          extent={{-543,-104},{-492,-112}},
-          lineColor={0,0,255},
-          textString="Wall_screen"), Text(
-          extent={{-394,204},{-308,194}},
-          lineColor={0,0,255},
-          textString="SMT_SHT"),     Text(
-          extent={{-566,514},{-408,524}},
-          lineColor={0,0,255},
-          textString="Boiler_walls"),Text(
-          extent={{-394,282},{-306,272}},
-          lineColor={0,0,255},
-          textString="RMT_RHT"),     Text(
-          extent={{-384,354},{-334,344}},
-          lineColor={0,0,255},
-          textString="SBT"),         Text(
-          extent={{-384,432},{-334,422}},
-          lineColor={0,0,255},
-          textString="RBT"),         Text(
-          extent={{-382,526},{-332,513}},
-          lineColor={0,0,255},
-          textString="Eco"),         Text(
-          extent={{1426,542},{1540,522}},
-          lineColor={0,0,255},
-          textString="LP_RH3"),      Text(
-          extent={{1256,538},{1370,518}},
-          lineColor={0,0,255},
-          textString="LP_RH2"),      Text(
-          extent={{1088,538},{1202,518}},
-          lineColor={0,0,255},
-          textString="LP_RH1"),      Text(
-          extent={{902,540},{1016,520}},
-          lineColor={0,0,255},
-          textString="IP_RH"),       Text(
-          extent={{466,468},{580,448}},
-          lineColor={0,0,255},
-          textString="HP_RH3"),      Text(
-          extent={{290,502},{404,482}},
-          lineColor={0,0,255},
-          textString="HP_RH2"),      Text(
-          extent={{98,502},{212,482}},
-          lineColor={0,0,255},
-          textString="HP_RH1"),      Text(
-          extent={{-74,546},{40,526}},
-          lineColor={0,0,255},
-          textString="Desu"),
-        Text(
-          extent={{6,-226},{1248,-540}},
-          lineColor={28,108,200},
-          textString="New model DynamicExchangerWaterSteamFlueGases_New_hi
-Dp; h convectif")}),
-    experiment(StopTime=1200),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end SupercriticalPulverizedCoalPowerPlant;
+within ThermoSysPro.Examples.Book.PowerPlants;
+model SupercriticalPulverizedCoalPowerPlant
+  "Model of a supercritical pulverized coal power plant"
+
+  parameter Integer NCEL = 7;
+
+  parameter Real dpfCorr=1.00
+    "Corrective term for the friction pressure loss (dpf) for each node";
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine    Turbine_HP(
+    eta_is_min=0.75,
+    W_fric=1,
+    Qmax=50,
+    eta_is(start=0.96),
+    eta_is_nom=0.94,
+    pros(d(start=35.19870673587873)),
+    Cst(fixed=false,
+      start=2001324.343046339)=
+                       2.00537e6,
+    Pe(start=26999999.985564, fixed=true))
+    annotation (Placement(transformation(extent={{-24,136},{60,214}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD splitter_Turbine_HP1(h(start=
+          3071530.861772407),
+    dynamic_mass_balance=true,
+    P(start=6401000),
+    Ce(Q(start=549.193976505918)))
+    annotation (Placement(transformation(extent={{272,185},{294,167}})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP2(
+    eta_stato=1,
+    mode_e=2,
+    mode_s=2,
+    mode_ps=2,
+    W_fric=1,
+    eta_is(start=0.94),
+    eta_is_nom=0.94,
+    Qmax=50,
+    pros(d(start=6.887350366974513)),
+    Cst(fixed=false,
+      start=53978.86314853486)=
+                       53802.6,
+    Pe(start=3799997.860026793,
+                      fixed=true))
+    annotation (Placement(transformation(extent={{602,38},{656,97}})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP2(
+    W_fric=1,
+    eta_stato=1,
+    eta_is_min=0.75,
+    Qmax=50,
+    eta_is_nom=0.91,
+    eta_is(start=0.91),
+    pros(d(start=0.3736533771704811)),
+    xm(start=0.9898250653294598),
+    Cst(fixed=false,
+      start=1220.138716068697)=
+                       1215.75,
+    Pe(start=299998.1114947147,
+                     fixed=true))
+                annotation (Placement(transformation(extent={{1182,38},{1236,96}},
+                    rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP1(
+    eta_stato=1,
+    eta_is_min=0.75,
+    mode_e=2,
+    mode_s=2,
+    mode_ps=2,
+    eta_is_nom=0.94,
+    eta_is(start=0.94),
+    W_fric=1,
+    Qmax=50,
+    pros(d(start=10.384234361858882)),
+    Cst(fixed=false,
+      start=102744.34781655352)=
+                       102478,
+    Pe(start=5999998.330854355,
+                             fixed=true))
+    annotation (Placement(transformation(extent={{396,38},{450,96}})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP1(
+    W_fric=1,
+    eta_stato=1,
+    eta_is_min=0.75,
+    Qmax=50,
+    eta_is_nom=0.91,
+    eta_is(start=0.91),
+    pros(d(start=1.390561376459253)),
+    Cst(fixed=false,
+      start=4501.927059584096)=
+                       4485.97,
+    Pe(start=729997.7575424919,
+                     fixed=true))
+                annotation (Placement(transformation(extent={{1004,38},{1058,96}},
+                    rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP3(
+    eta_stato=1,
+    eta_is_min=0.75,
+    mode_e=2,
+    mode_s=2,
+    mode_ps=2,
+    W_fric=1,
+    Qmax=50,
+    eta_is(start=0.94),
+    eta_is_nom=0.94,
+    pros(d(start=2.8084284519008316)),
+    Cst(fixed=false,
+      start=34193.21955188417)=
+                       34076.9,
+    Pe(start=2270000, fixed=true))
+    annotation (Placement(transformation(extent={{802,38},{856,96}})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP3(
+    W_fric=1,
+    eta_stato=1,
+    eta_is_min=0.75,
+    Qmax=50,
+    eta_is_nom=0.91,
+    eta_is(start=0.91),
+    pros(d(start=0.17053836551218424)),
+    xm(start=0.9624448460730977),
+    Cst(fixed=false,
+      start=59.44671753933515)=
+                       59.4076,
+    Pe(start=59999.53282881782,
+                    fixed=true),
+    Ps(start=25000))
+                annotation (Placement(transformation(extent={{1358,38},{1412,96}},
+                    rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Echappement(
+    W_fric=1,
+    eta_stato=1,
+    xm(start=0.9213019144264654),
+    Qmax=50,
+    Cst(fixed=false,
+      start=14.295718727368532)=
+                       14.7,
+    eta_is(start=0.8),
+    eta_is_nom=0.91,
+    pros(d(start=0.04238683084570735)),
+    Pe(start=24999.77493390328,
+                    fixed=true),
+    Ps(start=5000))
+                annotation (Placement(transformation(extent={{1514,37},{1568,97}},
+                    rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP1(h(start=
+          3537588.8079320663))
+    annotation (Placement(transformation(extent={{518,79},{542,55}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP2(h(start=
+          3369888.816557468),
+      dynamic_mass_balance=true)
+    annotation (Placement(transformation(extent={{732,80},{760,54}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_IP3(
+                                                                       K(fixed=
+          false) = 10, Q(start=19.00114371733354,
+                                   fixed=true),
+    C2(P(start=580155.4529087848),h_vol(start=311761.22672647523)))
+    annotation (Placement(transformation(extent={{27,-21},{-27,21}}, rotation=270,
+        origin={945,290})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP3(
+      h(start=3059443.3348694695),
+                          P(start=774340))
+    annotation (Placement(transformation(extent={{932,78},{958,56}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP1(
+      h(start=2869360.296898901),
+                          P(start=190280))
+    annotation (Placement(transformation(extent={{1112,79},{1136,55}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP1(
+                                                                       K(fixed=
+          false) = 10, Q(start=28.001397928754212,
+                                   fixed=true),
+    C2(P(start=236489.70540554097)))
+    annotation (Placement(transformation(extent={{27,-20},{-27,20}}, rotation=270,
+        origin={1124,291})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP2(h(start=
+          2606190.1863981914))
+    annotation (Placement(transformation(extent={{1284,79},{1308,55}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP2(
+                     K(fixed=false) = 10, Q(start=9.0003750371771,
+                                                     fixed=true),
+    C2(P(start=44661.45635759075)))
+    annotation (Placement(transformation(extent={{-27,-21},{27,21}}, rotation=90,
+        origin={1296,291})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP3(                h(
+        start=2489005.0530445203),
+                          P(start=23000))
+    annotation (Placement(transformation(extent={{1460,81},{1486,53}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP3(
+    h(start=3.048e6),
+    K(fixed=false) = 10,
+    Q(start=16.000569587384174,
+                fixed=true),
+    C2(P(start=19457.45212821197),h_vol(start=225941.66047852393)))
+    annotation (Placement(transformation(extent={{27,-22},{-27,22}}, rotation=270,
+        origin={1474,291})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{1764,-54},{1826,-4}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
+                 Q0=16400, h0=121652)
+                                 annotation (Placement(transformation(extent={{1562,
+            -54},{1614,-4}},       rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Condenser2(K=1e-4,
+      Pm(start=4999.990549904409),
+    C1(h_vol(start=137765.1189884895)),
+    C2(P(start=4999.981099808819),h_vol(start=137765.1189884895)))
+    annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=270,
+        origin={1694,-164})));
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
+    Vf0=0.15,
+    A=100,
+    ntubes=28700,
+    lambda=0.018,
+    Kvl=1,
+    V=1000,
+    steady_state=false,
+    continuous_flow_reversal=true,
+    yNiveau(signal(start=1.5, fixed=false)),
+    P0=5000,
+    P(start=5000),
+    Cv(Q(start=433.2001545496264)),
+    proe(d(start=994.1205995939429)))
+    annotation (Placement(transformation(extent={{1636,-72},{1746,30}})));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump(
+    C1(P(start=5000)),
+    a1(fixed=false) = -390,
+    a3=350,
+    C2(P(start=2699869.622037593,
+                        fixed=true), h_vol(start=140956.11701829222)),
+    Qv(start=0.43524240668307135),
+    h(start=139360.61800339087),
+    hn(start=276.1071665616722))
+    annotation (Placement(transformation(extent={{1760,-226},{1796,-188}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff ReDrum(
+    DTfroid(displayUnit="K") = 5,
+    Kf=305,
+    DPf(start=57524.2563411452),
+    Ec(h(start=311761.22672647523)),
+    Ef(h_vol(start=140956.11701829222)),
+    Sc(h_vol(start=150272.7724602458)),
+    Sf(h_vol(start=161833.76268010825)),
+    promc(d(start=985.5919033987386)))
+    annotation (Placement(transformation(extent={{1798,440},{1666,548}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP3(
+    SPurge=200,
+    KCond=1535.50,
+    KPurge=100,
+    Ep(Q(start=0.001)),
+    SCondDes=3255,
+    lambdaE=256,
+    Ee(P(start=2650000)),
+    P(start=25000),
+    HDesF(start=245425.15364009212),
+    HeiF(start=162682.43852863708),
+    Hep(start=248917.79589378808),
+    SDes(start=1E-009),
+    Se(
+      P(start=2511836.0997127844),
+      h(start=245425.15364009212),
+      h_vol(start=245425.15364009212)))
+    annotation (Placement(transformation(extent={{1568,552},{1452,434}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP2(
+    KCond=1530.50,
+    SPurge=482.5,
+    KPurge=109.55,
+    Se(P(start=2413894.9462802503),
+      h(start=306860.7316879813),
+      h_vol(start=306860.7316879813)),
+    lambdaE=512.2,
+    Ee(P(start=2600000)),
+    SCondDes=1477,
+    P(start=60000),
+    Ep(h(start=438607.090332969)),
+    HDesF(start=306860.7316879813),
+    HeiF(start=247625.18923762313),
+    Hep(start=328778.4878550007),
+    SDes(start=1E-009))
+    annotation (Placement(transformation(extent={{1390,552},{1272,434}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP1(
+    KCond=1530.50,
+    SPurge=504,
+    KPurge=155.7,
+    lambdaE=1258,
+    Ee(P(start=2500000)),
+    SCondDes=1408,
+    P(start=300000),
+    Ep(h(start=464182.2380411874)),
+    HDesF(start=455062.8963466834),
+    HeiF(start=313734.293691341),
+    Hep(start=501954.8282730701),
+    SDes(start=131.63162125559273),
+    Se(
+      P(start=2169310.5330650215),
+      h(start=465109.255940298),
+      h_vol(start=465109.255940298)))
+    annotation (Placement(transformation(extent={{1214,551},{1106,437}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterIP(
+    KCond=1730.50,
+    SPurge=239,
+    KPurge=2795,
+    lambdaE=885,
+    Ee(P(start=2250000)),
+    SCondDes=795,
+    P(start=730000),
+    HDesF(start=565579.5385524093),
+    HeiF(start=473909.76996909064),
+    Hep(start=664813.6284480324),
+    SDes(start=98.33315286951769),
+    Se(h(start=578948.0240115122), P(start=1992791.4733867273)))
+    annotation (Placement(transformation(extent={{1030,551},{924,437}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss pipePressureLoss_LP3_Drum(K=1e-4, pro(d(
+          start=986.1624696132673)))
+    annotation (Placement(transformation(extent={{1562,555},{1602,605}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeI Drum_1(h(start=167087.86591036225),
+                                                                  V=10)
+    annotation (Placement(transformation(extent={{1872,493},{1926,555}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_IP1(
+    h(start=3463.4e3),
+    K(fixed=false) = 10,
+    Q(start=25.00040036422368,
+                fixed=true),
+    Pm(start=3900000),
+    C2(h_vol(start=3537588.8079320663)))
+    annotation (Placement(transformation(extent={{26.5,-22},{-26.5,22}},
+                                                                     rotation=270,
+        origin={530,290.5})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeI Drum_2(
+    h(start=778321.3350751515),
+    V=200,
+    P(start=2070000))
+    annotation (Placement(transformation(extent={{774,433},{712,503}})));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1(
+                                                                               rm=0.7,
+    C2(Q(start=599.993976505918,
+                    fixed=true), P(start=32854107.921229515),
+      h_vol(start=827111.4901416934)),
+    C1(P(start=2070000)),
+    a1(fixed=false) = -3050,
+    a3=5000,
+    Qv(start=0.6740415564019792),
+    h(start=821565.0),
+    hn(start=3535.3592725080375))
+    annotation (Placement(transformation(extent={{683,509},{655,483}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP3(
+    Se(P(start=32900000), h(start=932438.8978014372)),
+    KPurge=1200,
+    lambdaE=1712,
+    SPurge=1098,
+    Ee(P(start=33600000), h_vol(start=827111.4901416933)),
+    KCond=1588,
+    SCondDes=750,
+    P(start=3771567.571218525),
+    HDesF(start=927325.1475293547),
+    HeiF(start=855187.674900425),
+    Hep(start=964242.0430144744),
+    SDes(start=79.82059037582069),
+    h(start=841102.4802107343))
+    annotation (Placement(transformation(extent={{572,546},{474,448}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Desu(
+    C2(P(start=3800000)),
+    C1(h_vol(start=2924612.095560695)),
+    K=1e-4,
+    Pm(start=3771567.5730999485))
+    annotation (Placement(transformation(extent={{22.5,-14.5},{-22.5,14.5}},
+                                                                     rotation=180,
+        origin={274.5,375.5})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP2(
+    lambdaE=1157,
+    Se(P(start=32400000), h(start=1168614.317235736)),
+    KCond=1588,
+    KPurge=1200,
+    SPurge=849,
+    SCondDes=1667.5,
+    P(start=5568798.758801826),
+    Ee(Q(start=299.99698825295724),
+                       h(start=932438.8978014372)),
+    Ep(P(start=8930425.05990273), h(start=1170923.9907383516)),
+    HDesF(start=1139894.576035795),
+    HeiF(start=977219.550756442),
+    Hep(start=1180774.7250052856),
+    SDes(start=337.2006466251369),
+    h(start=940451.6341612964))
+    annotation (Placement(transformation(extent={{404,482},{302,376}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP1(
+    h(start=3.07903e6),
+    K(fixed=false) = 10,
+    Q(start=61, fixed=true),
+    Pm(start=6401000))
+    annotation (Placement(transformation(extent={{27,-20},{-27,20}}, rotation=270,
+        origin={322,291})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP1(
+    KPurge=1279,
+    lambdaE=750,
+    Se(h(start=1338936.264843952),
+                         P(start=32050000)),
+    KCond=1588,
+    SCondDes=1692.5,
+    SPurge=1049,
+    P(start=10000000),
+    Ee(h(start=1168614.317235733)),
+    HDesF(start=1301805.3904686682),
+    HeiF(start=1184664.7287055368),
+    Hep(start=1360493.8691474798),
+    SDes(start=416.53928018645576))
+    annotation (Placement(transformation(extent={{208,480},{104,378}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff Desuperheater(
+    Sf(
+      Q(start=600),
+      h(start=1.369E6),
+      P(start=31940231.739229403),
+      h_vol(start=1364477.62662973)),
+    Ef(h(start=1338936.2648439475)),
+    promc(d(start=12.67201785254116)),
+    DTfroid(displayUnit="K") = 5,
+    Kf=10,
+    Tsf(start=580.3334486723465))
+    annotation (Placement(transformation(extent={{34,545},{-70,447}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP(
+    h(start=3.19e6),
+    Q(fixed=true, start=50.8),
+    K(fixed=false) = 10,
+    Pm(start=10000000))
+    annotation (Placement(transformation(extent={{21.5,-18},{-21.5,18}},
+                                                                     rotation=270,
+        origin={128,296.5})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP_IP(
+    h(start=3.07903e6),
+    K(fixed=false) = 10,
+    Q(fixed=true, start=3),
+    Pm(start=6401000))
+    annotation (Placement(transformation(extent={{-15.5,-16.5},{15.5,16.5}},
+                                                                     rotation=0,
+        origin={883.5,-8.5})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine   Turbine_HP1(
+    eta_is_min=0.75,
+    W_fric=1,
+    Qmax=50,
+    eta_is(start=0.96),
+    eta_is_nom=0.92,
+    pros(d(start=24.64344118791907)),
+    Cst(fixed=false,
+      start=278836.9406128902)=
+                       279474,
+    Pe(start=10000000, fixed=true),
+    Ps(start=6401000))
+    annotation (Placement(transformation(extent={{172,136},{256,214}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD splitter_Turbine_HP(h(start=
+          3182580.38391812),
+    dynamic_mass_balance=true,
+    P(start=10000000))
+    annotation (Placement(transformation(extent={{116,184},{140,166}})));
+  ThermoSysPro.WaterSteam.Machines.Generator generator(eta=99.7)
+    annotation (Placement(transformation(extent={{48,-194},{-84,-314}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add
+                                          annotation (Placement(transformation(
+          extent={{94,-218},{76,-200}},
+                                    rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add3 add1
+                                          annotation (Placement(transformation(
+          extent={{96,-240},{76,-220}},
+                                    rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add3 add2
+                                          annotation (Placement(transformation(
+          extent={{94,-264},{76,-244}},
+                                    rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT(C1(h_vol(start=
+            3474803.0992788016)),
+                                C2(h_vol(start=3474803.0992788034)))
+    annotation (Placement(transformation(extent={{-202,170},{-180,200}})));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveHP(
+                             C1(P(fixed=true, start=27019900)),
+    h(start=3.4756e6),
+    Cvmax(fixed=false) = 8005,
+    T(displayUnit="K", start=873.1))
+    annotation (Placement(transformation(extent={{-157,166},{-121,204}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constantHP(k=0.5)
+    annotation (Placement(transformation(extent={{-84,200},{-114,230}})));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveIP(Cvmax(
+        fixed=false) = 8005,
+    h(start=3.70545e6),
+    C1(P(fixed=true, start=6009998.640295431),
+                                     h_vol(start=3701594.2696911553)))
+    annotation (Placement(transformation(extent={{-158,245},{-122,285}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constantIP(k=0.5)
+    annotation (Placement(transformation(extent={{-84,274},{-120,310}})));
+  ThermoSysPro.Combustion.CombustionChambers.GenericCombustion1D
+    genericCombustion(
+    EPSPAR=0.4,
+    ImbCV=0.01,
+    ImbBF=0.007,
+    Kec=15,
+    SM={635.7,635.7,635.7,635.7,635.7,635.7,635.7},
+    Psf,
+    Tea(start=577.3294631233695),
+    Tpi(start={662.130125894802,685.614566355283,696.9408592330145,
+          703.5449672340172,712.7782107613066,727.9340239141302,
+          750.6768400836096}),
+    Tsf(start=1501.2484101541468),
+    deltaPccb(start=2223.1944617307236))
+                      annotation (Placement(transformation(extent={{-238,-102},
+            {-436,68}},
+                      rotation=0)));
+
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe Wall_screen(
+    Ns=NCEL,
+    L=65,
+    ntubes=912,
+    mode=0,
+    z2=65,
+    D=0.034,
+    option_temperature=2,
+    P(start={30342043.891952675,30282117.04096996,30227397.738711014,
+          30178994.328953177,30137426.097264428,30101658.687952235,
+          30069281.864402287,30038017.722720534,30006184.603574578}),
+    Q(start={597.6590942672652,597.6590942672652,597.6590942672652,
+          597.6590942672652,597.6590942672652,597.6590942672652,
+          597.6590942672652,597.6590942672652}),
+    h(start={1479747.0728819133,1653147.2981052676,1836593.6418651666,
+          2019276.7199909666,2201503.0794841815,2383076.101933648,
+          2563538.204063644,2742239.471375197,2742239.471375197}),
+    mu2(start={8.337682531388398E-05,7.290904575803869E-05,6.19675832347849E-05,
+          5.107649475602911E-05,4.1856937780558395E-05,3.577140353596319E-05,
+          3.242959431491525E-05,3.102497852505804E-05}),
+    pro2(d(start={696.792093597009,625.1171632839697,535.5755100207667,
+            432.7397163943108,333.50837586843403,256.1304727342381,
+            200.77652123807803,161.8541988249301})))
+                  annotation (Placement(transformation(extent={{-66,44},{66,-44}},
+                   rotation=90,
+        origin={-520,-18})));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    Ns=NCEL,
+    lambda=40,
+    L=65,
+    e=0.008,
+    ntubes=912,
+    D=0.034,
+    Tp(start={653.6406823320823,676.633278239129,687.9969395834568,
+          694.6234079190576,703.8886379558984,719.0988402846453,
+          741.927864576376}))
+              annotation (Placement(transformation(
+        extent={{-66,37},{66,-37}},
+        rotation=90,
+        origin={-465,-18})));
+  ThermoSysPro.FlueGases.Junctions.Splitter2 splitter2_1 annotation (Placement(
+        transformation(
+        extent={{-12,-19},{12,19}},
+        rotation=90,
+        origin={-335,102})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    Boiler_walls(
+    Ns=3,
+    ExchangerWall(lambda=40, e=8e-3,
+      Tp(start={718.6571040634899,718.1194034334801,717.724499487972}),
+      Tp1(start={717.5714868892015,717.6719267649172,717.5487415294846})),
+    Dint=34e-3,
+    Ntubes=912,
+    L=40,
+    z2=40,
+    ExchangerFlueGasesMetal(St=292.41, Dext=50e-3,
+      DeltaT(start={554.0628991212207,228.3772089692427,89.70101646279409}),
+      T(start={1501.2484130859375,1045.9831048360795,847.7485555139816,
+            767.3925170898438}),
+      Tm(start={1273.6157574951133,946.8658301750306,807.5705357170625})),
+    TwoPhaseFlowPipe(rugosrel=0.0014,
+      P(start={30006184.0,29959265.487962805,29911856.28834493,
+            29864219.536209688,29816476.0}),
+      h(start={2742239.5,2768510.843637918,2779339.5468098293,2783592.798199836,
+            2783592.75})),
+    Cws2(P(start=29816475.42940753),h_vol(start=2783592.798199836)))
+    annotation (Placement(transformation(extent={{202,-27},{-202,27}},
+        rotation=-90,
+        origin={-521,308})));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink puitsFumeesPTQXA1(T(start=
+          398.86640471653106))
+    annotation (Placement(transformation(extent={{-392,-166},{-446,-110}},
+                                                                     rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases RMT_RHT(
+    Ns=3,
+    L=17.1,
+    ExchangerWall(lambda=40, e=6e-3,
+      Tp(start={908.5197253834301,914.4577273376398,917.7248494787165}),
+      Tp1(start={906.7665349453516,913.5361998085987,917.2460906463742})),
+    Dint=54.5e-3,
+    Ntubes=4900,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=66.5e-3,
+      step_T=0.22,
+      step_L=0.9619,
+      DeltaT(start={215.99646104532553,113.53397822935688,58.984016359030534}),
+      T(start={1189.486083984375,1062.720872868754,994.9311731733584,
+            959.3534545898438}),
+      Tm(start={1126.1034611836415,1028.8260230210562,977.1423166436323})),
+    Cws2(h(start=3.7057e6), P(start=6000000)),
+    TwoPhaseFlowPipe(rugosrel=0.0015,
+      P(start={6010948.5,6010749.460821071,6010514.567152408,6010261.309075393,
+            6009998.5}),
+      h(start={3264769.75,3507624.3814902483,3635275.8367294283,
+            3701594.2696911553,3701594.25})),
+    Cws1(P(start=6010948.472475457),h_vol(start=3264769.660736534)))
+    annotation (Placement(transformation(extent={{-348,288},{-246,218}})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases SBT(
+    Ns=3,
+    L=17.1,
+    Dint=38.3e-3,
+    TwoPhaseFlowPipe(rugosrel=0.0145,
+      P(start={29816474.0,29814038.312406328,29811347.95808922,
+            29808483.096597232,29805500.0}),
+      h(start={2783592.75,2877312.3915758613,2940320.6561487615,
+            2982465.835108181,2982465.75})),
+    ExchangerWall(lambda=40, e=6.5e-3,
+      Tp(start={749.7844520576,755.6415626459205,759.6971986304427}),
+      Tp1(start={747.8691146804046,754.3538694340593,758.8358820836914})),
+    Ntubes=3200,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=51.3e-3,
+      step_L=0.7,
+      DeltaT(start={176.62815353948065,118.74820438652762,79.42869651947797}),
+      T(start={959.3534545898438,896.7825168405388,854.222865602998,
+            825.5177612304688}),
+      Tm(start={928.0679884772226,875.5026912217684,839.8703116077473})),
+    Cws2(h_vol(start=2982465.835108181)))
+    annotation (Placement(transformation(extent={{-244,368},{-348,302}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_SBT(K(fixed=
+          false) = 910.878, C1(P(fixed=true, start=29805500)))
+    annotation (Placement(transformation(extent={{-376,321},{-400,350}})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases RBT(
+    Ns=3,
+    L=17.1,
+    TwoPhaseFlowPipe(rugosrel=0.0028,
+      P(start={6401069.0,6400829.006029598,6400559.967505192,6400281.512735571,
+            6400000.0}),
+      h(start={3071530.75,3206249.001381632,3250421.0375270667,
+            3264769.6607365347,3264769.75})),
+    ExchangerWall(lambda=40, e=7.5e-3,
+      Tp(start={731.5611188100817,719.1011974452427,714.9322174305115}),
+      Tp1(start={730.6241511341694,718.7939799453013,714.8324224349741})),
+    Dint=45.7e-3,
+    Ntubes=7400,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=60.7e-3,
+      step_L=0.7,
+      DeltaT(start={55.41873058878309,18.170961815555074,5.902564318895884}),
+      T(start={825.5177612304688,750.0683189765095,725.0092641729291,
+            716.83349609375}),
+      Tm(start={787.793038294503,737.5387915747193,720.9213932561836})),
+    Cws1(P(start=6401069.169670619),
+                             h_vol(start=3071530.861772407)),
+    Cws2(h_vol(start=3264769.660736535)))
+    annotation (Placement(transformation(extent={{-244,445},{-348,385}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_RBT(K(fixed=
+          false) = 34.39, C1(P(fixed=true, start=6400000)))
+    annotation (Placement(transformation(extent={{-390,401},{-416,429}})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases Economiseur(
+    Ns=3,
+    L=17.1,
+    ExchangerWall(lambda=40, e=7e-3,
+      Tp(start={597.8632830911926,601.9643838890306,604.4388143032807}),
+      Tp1(start={597.0798518240282,601.4765869344108,604.1356180309247})),
+    TwoPhaseFlowPipe(rugosrel=0.0015,
+      P(start={31940232.0,31940175.652893864,31940118.025039315,
+            31940059.354486804,31940000.0}),
+      h(start={1364477.625,1421835.5302184983,1457548.9512506293,
+            1479747.0728819133,1479747.125})),
+    Dint=37.1e-3,
+    Ntubes=5300,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=48.3e-3,
+      step_L=0.7,
+      DeltaT(start={97.96280056397143,60.995722003917535,37.91265067585584}),
+      T(start={716.83349609375,676.15417968096,650.5975916707414,
+            634.6221923828125}),
+      Tm(start={696.493851010199,663.3758856758507,642.6098980814818})))
+    annotation (Placement(transformation(extent={{-244,527},{-348,465}})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases SMT_SHT(
+    L=17.1,
+    TwoPhaseFlowPipe(rugosrel=0.0015,
+      P(start={27030444.0,27028361.67511348,27025839.239372097,
+            27022989.150393303,27019900.0}),
+      h(start={2976603.0,3194812.5584599497,3356176.887995873,3474803.099278803,
+            3474803.0})),
+    ExchangerWall(lambda=40, e=8e-3,
+      Tp(start={854.8283610087926,887.434475626394,912.4750108334613}),
+      Tp1(start={846.3932984841808,881.1968091408571,907.8894202971029})),
+    Dint=37.9e-3,
+    Ntubes=2075,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=53.9e-3,
+      step_T=0.22,
+      step_L=1.016,
+      DeltaT(start={571.7995516807581,422.84154854302676,310.84993208179515}),
+      T(start={1501.2484130859375,1366.1601385670497,1264.857744235079,
+            1189.486083984375})),
+    Cws2(P(start=27000000), h(start=3.4751e6)),
+    Ns=3)
+    annotation (Placement(transformation(extent={{-348,206},{-246,140}})));
+  ThermoSysPro.FlueGases.PressureLosses.InvSingularPressureLoss singularPressureLoss
+                          annotation (Placement(transformation(extent={{-496,
+            551},{-472,579}},
+                       rotation=0)));
+  ThermoSysPro.FlueGases.Junctions.Mixer2 mixer2_1(T(start=639.3587532777143))
+                                                   annotation (Placement(
+        transformation(
+        extent={{-18,-20},{18,20}},
+        rotation=90,
+        origin={-336,572})));
+  ThermoSysPro.FlueGases.HeatExchangers.StaticFluegasesFluegasesExchangerKS RA(
+    DPc(displayUnit="bar") = 0.01,
+    K=350,
+    S=7475,
+    DPf=0.01,
+    Tsc(displayUnit="degC", start=401.15),
+    Tsf(start=573.15, displayUnit="degC"))
+    annotation (Placement(transformation(extent={{-37,34},{37,-34}},
+        rotation=90,
+        origin={-338,-159})));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ sourceAir(
+    Xh2o=0.016,
+    Xo2=0.206,
+    Xco2=0,
+    Q0=708,
+    P0=101000,
+    T0=288.15)
+    annotation (Placement(transformation(extent={{-444,-260},{-394,-204}})));
+  ThermoSysPro.FlueGases.Volumes.VolumeATh AirPreheater(h(start=72890))
+    annotation (Placement(transformation(extent={{-368,-242},{-348,-222}})));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={305.15})
+    annotation (Placement(transformation(extent={{-368,-222},{-348,-202}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA1(                   h(start=
+          1479747.0728819133),
+                      P(start=32000000),
+    Cs2(Q(start=2.340852247894304)))
+    annotation (Placement(transformation(extent={{-366,484},{-394,508}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(
+    h(start=2976603.0385964634),
+    dynamic_mass_balance=true,
+    P(start=27030443.91251134))
+    annotation (Placement(transformation(extent={{-390,162},{-370,184}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceQ(
+                                                             Q0=0, P0=100000)
+    annotation (Placement(transformation(extent={{-144,-8},{-206,60}}, rotation=
+           0)));
+  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    rho=1200,
+    Hum=0.03,
+    T0(displayUnit="K") = 288.15,
+    Xc=0.6652,
+    Xh=0.0378,
+    Xo=0.0546,
+    Xn=0.0156,
+    Xs=0.0052,
+    Xashes=0.1415,
+    Vol=0.229,
+    Q0=65.765,
+    LHV=26030e3)
+    annotation (Placement(transformation(extent={{-140,-94},{-208,-26}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveEco(
+    T(displayUnit="K"),
+    Cvmax(fixed=true) = 200,
+    Q(start=2.35, fixed=false))
+                             annotation (Placement(transformation(
+        extent={{14,14},{-14,-14}},
+        rotation=90,
+        origin={-372,443})));
+  ThermoSysPro.Examples.Control.TemperatureControl TemperatureControl(
+    Ti=5,
+    pIsat(Ti=20, Limiteur1(u(signal(start=-0.028450421536047304)))),
+    add(k1=+1, k2=-1))
+    annotation (Placement(transformation(extent={{-148,441},{-180,477}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constant_Temperature(k=873.15)
+    annotation (Placement(transformation(extent={{-104,435},{-132,461}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Q_flueGases_wall(k=
+        0.03506165)
+    annotation (Placement(transformation(extent={{-422,60},{-380,92}})));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_Drum_2
+                                                                 annotation (
+      Placement(transformation(
+        extent={{22,-20},{-22,20}},
+        rotation=180,
+        origin={764,594})));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_ReDrum
+                                                                 annotation (
+      Placement(transformation(
+        extent={{19,-19},{-19,19}},
+        rotation=180,
+        origin={1795,550})));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_Cond
+                                                                 annotation (
+      Placement(transformation(
+        extent={{26,-26},{-26,26}},
+        rotation=90,
+        origin={1930,285})));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ Sensor_Qvap_Cond(C1(h_vol(start=
+            1957787.8431100189)))
+    annotation (Placement(transformation(
+        origin={1704,53},
+        extent={{-13,-18},{13,18}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ Sensor_Qvap_Cond2
+    annotation (Placement(transformation(
+        origin={1706,-113},
+        extent={{-15,-16},{15,16}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Low(mode=1, K=
+       1e-4,
+    C1(h_vol(start=140956.11701829222), P(start=2617886.004032243)),
+    Pm(start=2617885.994610223))
+                 annotation (Placement(transformation(extent={{-27,-24},{27,24}},
+                    rotation=90,
+        origin={1830,290})));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve_Condenser(
+    mode=1,
+    Cvmax=2000,
+    C2(P(start=2696400)))
+    annotation (Placement(transformation(
+        extent={{-18,-17},{18,17}},
+        rotation=90,
+        origin={1819,-160})));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneLevelCondenser1(k=1.5)
+    annotation (Placement(transformation(extent={{1932,-38},{1896,-2}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Level_Condenser(
+    add(k1=+1, k2=-1),
+    pIsat(
+      Ti=200,
+      minval=0.3,
+      Limiteur1(u(signal(start=0.8)))),
+    pIsat1(Ti=100, minval=0.3),
+    edge(uL(signal(start=true))))
+                                annotation (Placement(transformation(extent={{
+            1896,-98},{1940,-54}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Condenser1(
+                                                                                       K=1e-4, Pm(start=
+          5191.555663955529))
+    annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=0,
+        origin={1661,67})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP2(
+    h(start=3.07903e6),
+    K(fixed=false) = 1e-4,
+    Pm(start=6401000),
+    C1(P(fixed=true, start=6401100)))
+    annotation (Placement(transformation(extent={{28,-19},{-28,19}}, rotation=270,
+        origin={285,291})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_condenser(h(start=
+          1957787.8431100189),
+    h0=1.959e6,
+    P0=538300000,
+    P(start=5000))
+    annotation (Placement(transformation(extent={{1600,53},{1628,81}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_Eco(K(fixed=
+          false) = 3867, C1(P(fixed=true, start=31940000)))
+    annotation (Placement(transformation(extent={{-416,482},{-442,510}})));
+  ThermoSysPro.WaterSteam.PressureLosses.CheckValve CheckValve(
+    Qmin=1,
+    Q(fixed=true, start=30.011367796945933),
+    k(fixed=false) = 100,
+    touvert(start=true))
+    annotation (Placement(transformation(
+        extent={{-18,-16},{18,16}},
+        rotation=90,
+        origin={745,288})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps V_staticCentrifugalPump(Table=[0,
+        1400; 100,1400; 700,1000; 800,950; 900,950; 1000,950])
+                   annotation (Placement(transformation(extent={{1670,-310},{
+            1738,-244}}, rotation=0)));
+  ThermoSysPro.Examples.Control.MassFlowControl Pump_VelocityControl(
+    pT1_1(k=1, Ti=1),
+    Ti=5,
+    maxval=1400,
+    pIsat(Limiteur1(u(signal(start=1400.006776094082)))))
+    annotation (Placement(transformation(extent={{628,637},{694,699}})));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ sensorQ
+    annotation (Placement(transformation(extent={{626,494},{606,514}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(
+    k=1,
+    U0=1400,
+    permanent=true,
+    Ti=10)
+    annotation (Placement(transformation(extent={{712,631},{732,651}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp_Kcor(
+    Starttime=100,
+    Duration=600,
+    Initialvalue=1,
+    Finalvalue=0.5)
+    annotation (Placement(transformation(extent={{-244,-170},{-274,-148}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP1(
+    h0=850000,
+    dynamic_mass_balance=true,
+    P0=32200000,
+    P(start=31945061.30060599),
+    h(start=1338936.2648439475),
+    Ce1(h(start=1338936.264843952)))
+                     annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=-90,
+        origin={86,496})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterHP1_1(
+    KPurge=1279,
+    lambdaE=750,
+    Se(h(start=1.369e6), P(start=32050000)),
+    KCond=1588,
+    SCondDes=1692.5,
+    SPurge=1049,
+    P(start=8930425.05990273),
+    Ee(h(start=1168614.3172357369)),
+    Ev(Q(start=25.40000000000056)),
+    HDesF(start=1301805.3904686691),
+    HeiF(start=1184664.7287055398),
+    Hep(start=1360493.8691474795),
+    SDes(start=416.5392801864518),
+    Sp(h(start=1170923.990738357)),
+    h(start=940451.6341612969))
+    annotation (Placement(transformation(extent={{208,610},{104,508}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterHP2_1(
+    lambdaE=1157,
+    Se(P(start=32400000), h(start=1168614.317235736)),
+    KCond=1588,
+    KPurge=1200,
+    SCondDes=1667.5,
+    SPurge=849,
+    P(start=5568798.758801826),
+    Ee(h(start=932438.8978014372)),
+    Ev(Q(start=30.499999999999968)),
+    HDesF(start=1139894.576035795),
+    HeiF(start=977219.5507564419),
+    Hep(start=1180774.725005288),
+    SDes(start=337.20064662513767))
+    annotation (Placement(transformation(extent={{404,612},{302,506}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP2(
+    h0=820000,
+    h(start=932438.8978014372),
+    dynamic_mass_balance=true,
+    P0=32400000,
+    P(start=32156093.56417011))
+    annotation (Placement(transformation(extent={{416,487},{436,507}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP3(
+    h0=990400,
+    h(start=940451.6341612943),
+    P0=6400171,
+    P(start=5568798.758431694))
+                      annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={498,565})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP1Vap(
+    h0=990400,
+    dynamic_mass_balance=true,
+    h(start=3182580.38391812),
+    P0=10000000,
+    P(start=8930425.061957654))
+                       annotation (Placement(transformation(
+        extent={{-10,10},{10,-10}},
+        rotation=90,
+        origin={128,342})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP1Vap1(
+    h0=990400,
+    dynamic_mass_balance=true,
+    h(start=3071530.861772407),
+    P0=6400171,
+    P(start=5568798.763146943))
+                      annotation (Placement(transformation(
+        extent={{-10,10},{10,-10}},
+        rotation=90,
+        origin={322,342})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=1e-4, pro(d(start=844.2396226650313)))
+    annotation (Placement(transformation(extent={{524,555},{544,575}})));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP singularPressureLoss2
+    annotation (Placement(transformation(extent={{433,592},{453,612}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={384,470})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={292,470})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={322,382})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss6(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={128,389})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss7(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={70,470})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP21(
+    h0=1168600,
+    h(start=1168614.3172357369),
+    P0=32060000,
+    dynamic_mass_balance=true,
+    P(start=32031852.891034454))
+    annotation (Placement(transformation(extent={{266,549},{246,569}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP22(
+    h0=1168600,
+    h(start=1168614.317235733),
+    P0=32060000,
+    dynamic_mass_balance=true,
+    P(start=32031852.513327856))
+    annotation (Placement(transformation(extent={{264,419},{244,439}})));
+  ThermoSysPro.Examples.Control.MassFlowRateAirCoalWater
+    MassFlowRateAirCoalWater
+    annotation (Placement(transformation(extent={{-408,620},{-488,708}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Power_MW(
+    Starttime=100,
+    Duration=600,
+    Initialvalue=804.461,
+    Finalvalue=399.8)
+    annotation (Placement(transformation(extent={{-340,678},{-370,700}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_2(
+    k=1,
+    permanent=true,
+    U0=708,
+    Ti=5)
+    annotation (Placement(transformation(extent={{-554,648},{-582,671}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_3(
+    k=1,
+    permanent=true,
+    U0=804,
+    Ti=5)
+    annotation (Placement(transformation(extent={{-556,684},{-580,709}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_4(
+    k=1,
+    permanent=true,
+    U0=600,
+    Ti=5)
+    annotation (Placement(transformation(extent={{-370,636},{-344,662}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_5(
+    k=1,
+    permanent=true,
+    U0=0.8,
+    Ti=10)
+    annotation (Placement(transformation(extent={{1766,-170},{1786,-150}})));
+equation
+
+  connect(lumpedStraightPipe_IP3.C1, splitter_TurbineIP3.Cs2) annotation (Line(
+      points={{945,263},{945,78}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_LP2.Cs, splitter_TurbineLP2.Ce1) annotation (Line(
+      points={{1236.27,67},{1284,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_TurbineLP2.Cs1, Turbine_LP3.Ce) annotation (Line(
+      points={{1308,67},{1357.73,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_LP2.C1, splitter_TurbineLP2.Cs2) annotation (Line(
+      points={{1296,264},{1296,79}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_LP3.Cs, splitter_TurbineLP3.Ce1) annotation (Line(
+      points={{1412.27,67},{1460,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(
+      points={{1614,-29},{1616,-29},{1616,-32.22},{1636,-32.22}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Condenser.Cse, PuitsCaloporteur.C) annotation (Line(
+      points={{1746,-31.2},{1741,-31.2},{1741,-29},{1764,-29}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(lumpedStraightPipe_LP3.C2, ReheaterLP3.Ev) annotation (Line(
+      points={{1474,318},{1474,474.12},{1475.2,474.12}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_LP1.C2, ReheaterLP1.Ev) annotation (Line(
+      points={{1124,318},{1124,475.76},{1127.6,475.76}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterLP1.Sp, ReheaterLP2.Ep) annotation (Line(
+      points={{1192.4,512.81},{1192.4,555},{1248,555},{1248,453},{1366.4,453},{
+          1366.4,472.94}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(lumpedStraightPipe_LP1.C1, splitter_TurbineLP1.Cs2) annotation (Line(
+      points={{1124,264},{1124,79}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Drum_1.Ce3, pipePressureLoss_LP3_Drum.C2)
+                                             annotation (Line(
+      points={{1872,499.2},{1852,499.2},{1852,580},{1602,580}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(pipePressureLoss_LP3_Drum.C1, ReheaterLP3.Sp)
+                                                annotation (Line(
+      points={{1562,580},{1544.8,580},{1544.8,512.47}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterIP.Sp, ReheaterLP1.Ep)  annotation (Line(
+      points={{1008.8,512.81},{1008.8,549},{1072,549},{1072,451},{1192.4,451},{
+          1192.4,474.62}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(lumpedStraightPipe_LP3.C1, splitter_TurbineLP3.Cs2) annotation (Line(
+      points={{1474,264},{1474,81},{1473,81}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+
+  connect(ReheaterHP3.Ev, lumpedStraightPipe_Desu.C2)
+                                                     annotation (Line(
+      points={{493.6,481.32},{493.6,375.5},{297,375.5}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Desuperheater.Sc, lumpedStraightPipe_Desu.C1)
+    annotation (Line(
+      points={{-38.8,475.91},{-38.8,376},{252,376},{252,375.5}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Desuperheater.Ec, lumpedStraightPipe_IP1.C2)
+    annotation (Line(
+      points={{2.8,475.91},{2.8,364},{530,364},{530,317}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_HP1.Cs, splitter_Turbine_HP1.Ce)
+                                             annotation (Line(
+      points={{256.42,175},{256.42,173.5},{272,173.5},{272,176}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_Turbine_HP.Cs2, lumpedStraightPipe_HP.C1)
+                                                   annotation (Line(
+      points={{128,183.82},{128,275}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterHP1.Sp, ReheaterHP2.Ep) annotation (Line(
+      points={{187.2,445.83},{188,460},{188,474},{242,474},{242,392},{383.6,392},
+          {383.6,410.98}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterLP2.Ev, lumpedStraightPipe_LP2.C2) annotation (Line(
+      points={{1295.6,474.12},{1295.6,418.38},{1296,418.38},{1296,318}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_HP_IP.C2, splitter_TurbineIP3.Ce2) annotation (
+      Line(
+      points={{899,-8.5},{945,-8.5},{945,56.22}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_Turbine_HP1.Cs3, lumpedStraightPipe_HP_IP.C1) annotation (
+      Line(
+      points={{294,176},{294,-8.5},{868,-8.5}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_Turbine_HP1.Cs1, lumpedStraightPipe_HP1.C1) annotation (Line(
+      points={{283,167},{322,167},{322,264}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(generator.Wmec5,add. y) annotation (Line(
+      points={{48,-206},{48,-209},{75.1,-209}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Turbine_HP.MechPower,add. u1) annotation (Line(
+      points={{64.2,139.9},{64.2,-198.05},{94.9,-198.05},{94.9,-203.6}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_HP1.MechPower,add. u2) annotation (Line(
+      points={{260.2,139.9},{260.2,-214.4},{94.9,-214.4}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(generator.Wmec4,add1. y) annotation (Line(
+      points={{48,-230},{75,-230}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Turbine_IP1.MechPower,add1. u1) annotation (Line(
+      points={{452.7,40.9},{452.7,-222},{97,-222}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_IP2.MechPower,add1. u2) annotation (Line(
+      points={{658.7,40.95},{658.7,-230},{97,-230}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_IP3.MechPower,add1. u3) annotation (Line(
+      points={{858.7,40.9},{858.7,-238},{97,-238}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(generator.Wmec3,add2. y) annotation (Line(
+      points={{48,-254},{75.1,-254}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Turbine_LP1.MechPower,add2. u1) annotation (Line(
+      points={{1060.7,40.9},{1060.7,-246},{94.9,-246}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_LP2.MechPower,add2. u2) annotation (Line(
+      points={{1238.7,40.9},{1238.7,-254},{94.9,-254}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_LP3.MechPower,add2. u3) annotation (Line(
+      points={{1414.7,40.9},{1414.7,-262},{94.9,-262}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Echappement.MechPower,generator. Wmec2) annotation (Line(
+      points={{1570.7,40},{1570.7,-278},{48,-278}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(controlValveHP.C2, Turbine_HP.Ce) annotation (Line(
+      points={{-121,173.6},{-34,173.6},{-34,175},{-24.42,175}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(sensorT.C2, controlValveHP.C1) annotation (Line(
+      points={{-179.78,173},{-151.89,173},{-151.89,173.6},{-157,173.6}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(constantIP.y, controlValveIP.Ouv)  annotation (Line(
+      points={{-121.8,292},{-140,292},{-140,287}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(controlValveIP.C2, Turbine_IP1.Ce) annotation (Line(
+      points={{-122,253},{-36,253},{-36,67},{395.73,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(genericCombustion.Cfg,splitter2_1. Ce) annotation (Line(
+      points={{-337,59.5},{-336,76},{-336,90},{-335,90}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(Boiler_walls.Cws1, Wall_screen.C2)          annotation (Line(
+      points={{-521,106},{-522,82},{-520,48}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter2_1.Cs1, Boiler_walls.Cfg1)   annotation (Line(
+      points={{-354,106.8},{-472,106.8},{-472,308},{-507.5,308}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(genericCombustion.Cth,heatExchangerWall. WT2) annotation (Line(
+      points={{-426.1,-17},{-454,-17},{-454,-18},{-457.6,-18}},
+      color={0,0,0},
+      smooth=Smooth.None));
+  connect(heatExchangerWall.WT1, Wall_screen.CTh)        annotation (Line(
+      points={{-472.4,-18},{-506.8,-18}},
+      color={0,0,0},
+      smooth=Smooth.None));
+  connect(SBT.Cfg1,RMT_RHT. Cfg2) annotation (Line(
+      points={{-296,318.5},{-296,270.5},{-297,270.5}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(RBT.Cfg1,SBT. Cfg2)      annotation (Line(
+      points={{-296,400},{-296,351.5}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(singularPressureLoss_RBT.C2,RMT_RHT. Cws1) annotation (Line(
+      points={{-416,415},{-418,415},{-418,253},{-348,253}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(SBT.Cws1, Boiler_walls.Cws2)   annotation (Line(
+      points={{-244,335},{-234,335},{-234,538},{-520,538},{-520,510},{-521,510}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(SMT_SHT.Cfg1,splitter2_1. Cs2) annotation (Line(
+      points={{-297,156.5},{-298,132},{-298,108},{-316,108},{-316,106.8}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(RMT_RHT.Cfg1,SMT_SHT. Cfg2) annotation (Line(
+      points={{-297,235.5},{-297,189.5}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(singularPressureLoss.C1, Boiler_walls.Cfg2)    annotation (Line(
+      points={{-496,565},{-550,565},{-550,308},{-534.5,308}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(Economiseur.Cfg2,mixer2_1. Ce2) annotation (Line(
+      points={{-296,511.5},{-296,564.8},{-316,564.8}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(RA.Sc,puitsFumeesPTQXA1. C)
+    annotation (Line(
+      points={{-358.4,-136.8},{-358.4,-138},{-392.54,-138}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(RA.Sf,genericCombustion. Ca)
+    annotation (Line(
+      points={{-338,-122},{-338,-93.5},{-337,-93.5}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(singularPressureLoss.C2, mixer2_1.Ce1)  annotation (Line(
+      points={{-472,565},{-458,565},{-458,564.8},{-356,564.8}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(mixer2_1.Cs,RA. Ec) annotation (Line(
+      points={{-336,590},{-564,590},{-564,-184},{-358.4,-184},{-358.4,-181.2}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(AirPreheater.Cs1,RA. Ef) annotation (Line(
+      points={{-348,-232},{-338,-232},{-338,-196}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(sourceAir.C, AirPreheater.Ce1)  annotation (Line(
+      points={{-394,-232},{-368,-232}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(heatSource.C[1],AirPreheater. Cth) annotation (Line(
+      points={{-358,-221.8},{-358,-232}},
+      color={0,0,0},
+      smooth=Smooth.None));
+  connect(singularPressureLoss_SBT.C2,volumeA. Ce1) annotation (Line(
+      points={{-400,335.5},{-400,173},{-390,173}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(volumeA1.Ce1,Economiseur. Cws2) annotation (Line(
+      points={{-366,496},{-348,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(fuelSourcePQ.C,genericCombustion. Cfuel) annotation (Line(
+      points={{-208,-60},{-208,-59.5},{-247.9,-59.5}},
+      color={0,0,0},
+      smooth=Smooth.None));
+
+  connect(Economiseur.Cfg1, RBT.Cfg2) annotation (Line(
+      points={{-296,480.5},{-296,430}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(controlValveEco.C1,volumeA1. Cs2) annotation (Line(
+      points={{-380.4,457},{-380.4,484},{-380,484}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(controlValveEco.C2,volumeA. Ce2) annotation (Line(
+      points={{-380.4,429},{-380.4,280},{-380,280},{-380,183.78}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TemperatureControl.MesureNiveauEau, sensorT.Measure) annotation (Line(
+      points={{-147.2,475.2},{-191,475.2},{-191,200}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TemperatureControl.ConsigneNiveauEau, constant_Temperature.y)
+    annotation (Line(
+      points={{-147.2,448.2},{-136,448.2},{-136,448},{-133.4,448}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(controlValveEco.Ouv, TemperatureControl.SortieReelle1) annotation (
+      Line(
+      points={{-356.6,443},{-276.625,443},{-276.625,442.8},{-180.8,442.8}},
+      color={0,0,255},
+      smooth=Smooth.None));
+
+  connect(genericCombustion.Cws, sourceQ.C) annotation (Line(
+      points={{-247.9,25.5},{-203.95,25.5},{-203.95,26},{-206,26}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(splitter_TurbineIP1.Cs2, lumpedStraightPipe_IP1.C1) annotation (Line(
+      points={{530,79},{530,264}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterIP.Ev, lumpedStraightPipe_IP3.C2) annotation (Line(
+      points={{945.2,475.76},{945.2,428.04},{945,428.04},{945,317}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterIP.Ee, ReheaterLP1.Se) annotation (Line(
+      points={{1031.06,494},{1040,496},{1040,493},{1100,493},{1106,494}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterLP1.Ee, ReheaterLP2.Se) annotation (Line(
+      points={{1215.08,494},{1222,496},{1222,493},{1272,493}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterLP2.Ee, ReheaterLP3.Se) annotation (Line(
+      points={{1391.18,493},{1396,496},{1396,493},{1452,493}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Q_flueGases_wall.y, splitter2_1.Ialpha1)
+                                              annotation (Line(
+      points={{-377.9,76},{-346.4,76},{-346.4,103.2}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterLP2.Sp, ReDrum.Ec)
+                                   annotation (Line(
+      points={{1366.4,512.47},{1366.4,605},{1758.4,605},{1758.4,516.14}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(loopBreakerP_ReDrum.C1, ReDrum.Sc)
+                                     annotation (Line(
+      points={{1776,550},{1706,550},{1706,545},{1705.6,545},{1705.6,516.14}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(loopBreakerP_ReDrum.C2, Drum_1.Ce1)
+                                         annotation (Line(
+      points={{1814,550},{1814,549},{1834,549},{1834,548.8},{1872,548.8}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(staticCentrifugalPump1.C1, Drum_2.Cs1)  annotation (Line(
+      points={{683,496},{712,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(loopBreakerP_Drum_2.C1, ReheaterHP3.Sp)
+                                            annotation (Line(
+      points={{742,594},{552,594},{552,513.17},{552.4,513.17}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(loopBreakerP_Drum_2.C2, Drum_2.Ce2)
+                                         annotation (Line(
+      points={{786,594},{834,594},{834,468},{774,468}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Drum_1.Cs1, loopBreakerP_Cond.C1)
+                                         annotation (Line(
+      points={{1926,548.8},{1928,548.8},{1928,311},{1930,311}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Sensor_Qvap_Cond.C2, Condenser.Cv)          annotation (Line(
+      points={{1689.6,39.74},{1689.6,45.87},{1691,45.87},{1691,30}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReDrum.Ef, lumpedStraightPipe_Low.C2)
+                                        annotation (Line(
+      points={{1798,494},{1830,494},{1830,317}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_Low.C1, controlValve_Condenser.C2)
+                                                annotation (Line(
+      points={{1830,263},{1830,-142},{1829.2,-142}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(controlValve_Condenser.C1, staticCentrifugalPump.C2)
+                                                     annotation (Line(
+      points={{1829.2,-178},{1829.2,-206},{1796,-206},{1796,-207}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ConsigneLevelCondenser1.y, regulation_Level_Condenser.ConsigneNiveauEau)
+    annotation (Line(points={{1894.2,-20},{1852,-20},{1852,-69.4},{1894.9,-69.4}}));
+  connect(Sensor_Qvap_Cond.Measure, regulation_Level_Condenser.MesureDebitVapeur)
+    annotation (Line(points={{1722.36,53},{1816,53},{1816,-96},{1856,-96},{
+          1895.12,-95.58}}));
+
+  connect(regulation_Level_Condenser.MesureDebitEau, Sensor_Qvap_Cond2.Measure)
+                                        annotation (Line(
+      points={{1894.79,-82.49},{1774,-82.49},{1774,-113},{1722.32,-113}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Condenser.yNiveau, regulation_Level_Condenser.MesureNiveauEau)
+    annotation (Line(
+      points={{1751.5,-57.72},{1860,-57.72},{1860,-56.2},{1894.9,-56.2}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Sensor_Qvap_Cond2.C2, lumpedStraightPipe_Condenser2.C1)
+    annotation (Line(
+      points={{1693.2,-128.3},{1693.2,-125.13},{1694,-125.13},{1694,-148}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Sensor_Qvap_Cond2.C1, Condenser.Cl)          annotation (Line(
+      points={{1693.2,-98},{1694,-98},{1694,-72},{1692.1,-72}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_TurbineIP2.Cs1, Turbine_IP3.Ce) annotation (Line(
+      points={{760,67},{801.73,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_IP3.Cs, splitter_TurbineIP3.Ce1) annotation (Line(
+      points={{856.27,67},{932,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_TurbineLP3.Cs1, Echappement.Ce) annotation (Line(
+      points={{1486,67},{1513.73,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_Condenser1.C2, Sensor_Qvap_Cond.C1)
+    annotation (Line(
+      points={{1677,67},{1688,67},{1688,66},{1689.6,66}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Economiseur.Cws1, Desuperheater.Sf)
+                                     annotation (Line(
+      points={{-244,496},{-162,496},{-162,495.51},{-70,495.51}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(RBT.Cws1, lumpedStraightPipe_HP2.C2) annotation (Line(
+      points={{-244,415},{285,415},{285,319}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Echappement.Cs, splitter_condenser.Ce1) annotation (Line(
+      points={{1568.27,67},{1600,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_condenser.Cs1, lumpedStraightPipe_Condenser1.C1) annotation (
+     Line(
+      points={{1628,67},{1645,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(loopBreakerP_Cond.C2, splitter_condenser.Ce2)
+                                                    annotation (Line(
+      points={{1930,259},{1927,259},{1927,80.72},{1614,80.72}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(singularPressureLoss_Eco.C1, volumeA1.Cs1) annotation (Line(
+      points={{-416,496},{-412,496},{-412,497},{-406,497},{-406,496},{-394,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Wall_screen.C1, singularPressureLoss_Eco.C2)        annotation (Line(
+      points={{-520,-84},{-442,-84},{-442,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterLP3.Ee, ReDrum.Sf)
+                                   annotation (Line(
+      points={{1569.16,493},{1615.55,493},{1615.55,494.54},{1666,494.54}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(volumeA.Cs1, SMT_SHT.Cws1) annotation (Line(
+      points={{-370,173},{-352,174},{-352,172},{-350,174},{-348,173}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_Turbine_HP.Cs3, Turbine_HP1.Ce) annotation (Line(
+      points={{140,175},{171.58,175}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_HP.Cs, splitter_Turbine_HP.Ce) annotation (Line(
+      points={{60.42,175},{116,175}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Drum_2.Ce1, ReheaterIP.Se) annotation (Line(
+      points={{774,496},{918,497},{918,495},{922,495},{924,494}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_HP2.C1, splitter_Turbine_HP1.Cs2) annotation (Line(
+      points={{285,263},{284,263},{284,184.82},{283,184.82}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_TurbineIP1.Cs1, Turbine_IP2.Ce) annotation (Line(
+      points={{542,67},{570,67},{570,67.5},{601.73,67.5}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_IP1.Cs, splitter_TurbineIP1.Ce1) annotation (Line(
+      points={{450.27,67},{518,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_IP2.Cs, splitter_TurbineIP2.Ce1) annotation (Line(
+      points={{656.27,67.5},{694.14,67.5},{694.14,67},{732,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_Condenser2.C2, staticCentrifugalPump.C1)
+    annotation (Line(
+      points={{1694,-180},{1694,-207},{1760,-207}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(controlValveIP.C1, RMT_RHT.Cws2) annotation (Line(
+      points={{-158,253},{-246,253}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(singularPressureLoss_RBT.C1, RBT.Cws2) annotation (Line(
+      points={{-390,415},{-348,415}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(singularPressureLoss_SBT.C1, SBT.Cws2) annotation (Line(
+      points={{-376,335.5},{-362,335.5},{-362,335},{-348,335}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(sensorT.C1, SMT_SHT.Cws2) annotation (Line(
+      points={{-202,173},{-246,173}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(controlValveHP.Ouv, constantHP.y) annotation (Line(
+      points={{-139,205.9},{-139,215},{-115.5,215}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(CheckValve.C1, splitter_TurbineIP2.Cs2)      annotation (Line(
+      points={{745,268.2},{746,268.2},{746,80}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(V_staticCentrifugalPump.y, staticCentrifugalPump.rpm_or_mpower)
+    annotation (Line(
+      points={{1741.4,-277},{1778,-277},{1778,-227.9}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(sensorQ.C2, ReheaterHP3.Ee) annotation (Line(
+      points={{605.8,496},{590,496},{590,497},{572.98,497}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(sensorQ.C1, staticCentrifugalPump1.C2) annotation (Line(
+      points={{626,496},{655,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(sensorQ.Measure,Pump_VelocityControl. Mesure_Q_water) annotation (
+      Line(
+      points={{616,514.2},{616,614},{528,614},{528,694},{626.35,694},{626.35,
+          695.9}},
+      color={127,0,0},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash,
+      thickness=0.5));
+  connect(Pump_VelocityControl.SortieReelle1, pT1_1.u) annotation (Line(
+      points={{695.65,640.1},{704.825,640.1},{704.825,641},{711,641}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(pT1_1.y, staticCentrifugalPump1.rpm_or_mpower) annotation (Line(
+      points={{733,641},{733,642},{732,614},{670,614},{669,510.3}},
+      color={127,0,0},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash,
+      thickness=0.5));
+  connect(splitter_TurbineIP3.Cs1, Turbine_LP1.Ce) annotation (Line(
+      points={{958,67},{1003.73,67}},
+      color={255,0,0},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(Turbine_LP1.Cs, splitter_TurbineLP1.Ce1) annotation (Line(
+      points={{1058.27,67},{1112,67}},
+      color={255,0,0},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(splitter_TurbineLP1.Cs1, Turbine_LP2.Ce) annotation (Line(
+      points={{1136,67},{1181.73,67}},
+      color={255,0,0},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(RA.Kcorr, ramp_Kcor.y) annotation (Line(
+      points={{-314.2,-159},{-275.5,-159}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterHP3.Se, volume_HP2.Ce2) annotation (Line(
+      points={{474,497},{436,497}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP2.Cs2, ReheaterHP2.Ee) annotation (Line(
+      points={{426,487.2},{428,487.2},{428,429},{405.02,429}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP2.Cs1, ReheaterHP2_1.Ee) annotation (Line(
+      points={{426,506},{426,560},{405.02,560},{405.02,559}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1_1.Se, volume_HP1.Ce1) annotation (Line(
+      points={{104,559},{86,559},{86,506}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1.Se, volume_HP1.Ce2) annotation (Line(
+      points={{104,429},{86,429},{86,486}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP1.Cs2, Desuperheater.Ef) annotation (Line(
+      points={{76.2,496},{34,496}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1_1.Sp, ReheaterHP2_1.Ep) annotation (Line(
+      points={{187.2,575.83},{187.2,602},{244,602},{244,518},{383.6,518},{383.6,
+          540.98}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(lumpedStraightPipe_HP.C2, volume_HP1Vap.Ce1) annotation (Line(
+      points={{128,318},{128,332}},
+      color={255,0,0},
+      thickness=0.5,
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(lumpedStraightPipe_HP1.C2, volume_HP1Vap1.Ce1) annotation (Line(
+      points={{322,318},{322,332}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP3.Cs2, singularPressureLoss1.C1) annotation (Line(
+      points={{507.8,565},{524,565}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(singularPressureLoss1.C2, ReheaterHP3.Ep) annotation (Line(
+      points={{544,565},{588,565},{588,461},{552.4,461},{552.4,480.34}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterHP2_1.Sp, singularPressureLoss2.C1) annotation (Line(
+      points={{383.6,576.49},{383.6,602},{433,602}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(singularPressureLoss2.C2, volume_HP3.Ce2) annotation (Line(
+      points={{453,602},{498,602},{498,575}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterHP2.Sp, singularPressureLoss3.C1) annotation (Line(
+      points={{383.6,446.49},{383.6,460},{384,460}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(singularPressureLoss3.C2, volume_HP3.Ce1) annotation (Line(
+      points={{384,480},{400,480},{400,516},{416,516},{416,528},{498,528},{498,
+          555}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(volume_HP1Vap1.Cs1, singularPressureLoss5.C1) annotation (Line(
+      points={{322,352},{322,372}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash,
+      thickness=0.5));
+  connect(singularPressureLoss5.C2, ReheaterHP2.Ev) annotation (Line(
+      points={{322,392},{322,412.04},{322.4,412.04}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash,
+      thickness=0.5));
+  connect(volume_HP1Vap1.Cs2, singularPressureLoss4.C1) annotation (Line(
+      points={{312,342},{292,342},{292,460}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(singularPressureLoss4.C2, ReheaterHP2_1.Ev) annotation (Line(
+      points={{292,480},{290,480},{290,524},{322.4,524},{322.4,542.04}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP1Vap.Cs1, singularPressureLoss6.C1) annotation (Line(
+      points={{128,352},{128,379}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(singularPressureLoss6.C2, ReheaterHP1.Ev) annotation (Line(
+      points={{128,399},{128,412.68},{124.8,412.68}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP1Vap.Cs2, singularPressureLoss7.C1) annotation (Line(
+      points={{118,342},{70,342},{70,460}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(singularPressureLoss7.C2, ReheaterHP1_1.Ev) annotation (Line(
+      points={{70,480},{70,526},{124.8,526},{124.8,542.68}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP21.Ce1, ReheaterHP2_1.Se) annotation (Line(
+      points={{266,559},{302,559}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1_1.Ee, volume_HP21.Cs1) annotation (Line(
+      points={{209.04,559},{246,559}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1.Ee, volume_HP22.Cs1) annotation (Line(
+      points={{209.04,429},{244,429}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP22.Ce1, ReheaterHP2.Se) annotation (Line(
+      points={{264,429},{302,429}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(Power_MW.y, MassFlowRateAirCoalWater.Electrical_power_MW) annotation (
+     Line(
+      points={{-371.5,689},{-384,689},{-384,706.24},{-444,706.24}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_3.y, fuelSourcePQ.IMassFlow) annotation (Line(
+      points={{-581.2,696.5},{-590,688},{-600,688},{-600,-272},{-174,-272},{
+          -174,-43}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_3.u, MassFlowRateAirCoalWater.Q_coal) annotation (Line(
+      points={{-554.8,696.5},{-523.4,696.5},{-523.4,697},{-492,697}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_2.y, sourceAir.IMassFlow) annotation (Line(
+      points={{-583.4,659.5},{-592,659.5},{-592,-218},{-419,-218}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_2.u, MassFlowRateAirCoalWater.Q_air) annotation (Line(
+      points={{-552.6,659.5},{-522.3,659.5},{-522.3,660.04},{-492,660.04}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_4.y,Pump_VelocityControl. Consigne_Q_water) annotation (Line(
+      points={{-342.7,649},{141.65,649},{141.65,649.4},{626.35,649.4}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(MassFlowRateAirCoalWater.Q_water, pT1_4.u) annotation (Line(
+      points={{-492,624.84},{-508,624.84},{-508,610},{-392,610},{-392,649},{-371.3,
+          649}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(CheckValve.C2, Drum_2.Ce4) annotation (Line(
+      points={{745,307.8},{745,296.9},{743,296.9},{743,433}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(regulation_Level_Condenser.SortieReelle1, pT1_5.u) annotation (Line(
+      points={{1941.1,-95.8},{1954,-95.8},{1954,-128},{1752,-128},{1752,-160},{
+          1765,-160}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(pT1_5.y, controlValve_Condenser.Ouv) annotation (Line(
+      points={{1787,-160},{1800.3,-160}},
+      color={0,0,255},
+      smooth=Smooth.None));
+annotation (
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </h4>
+<p><b>ThermoSysPro Version 3.2 </h4>
+<p>This is the dynamic model of a once-through supercritical coal-fired power plant. </p>
+<p>It is documented in Sect. 6.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Cecilia Rioual</li>
+</ul>
+</html>"),
+   Diagram(coordinateSystem(
+        preserveAspectRatio=true,
+        extent={{-600,-400},{2000,800}},
+        initialScale=0.1), graphics={Text(
+          extent={{80,134},{188,114}},
+          lineColor={0,0,255},
+          textString="Turbine_HP"),  Text(
+          extent={{385,18},{489,-2}},
+          lineColor={0,0,255},
+          textString="Turbine_IP"),  Text(
+          extent={{990,22},{1104,2}},
+          lineColor={0,0,255},
+          textString="Turbine_LP"),  Text(
+          extent={{-543,-104},{-492,-112}},
+          lineColor={0,0,255},
+          textString="Wall_screen"), Text(
+          extent={{-394,204},{-308,194}},
+          lineColor={0,0,255},
+          textString="SMT_SHT"),     Text(
+          extent={{-566,514},{-408,524}},
+          lineColor={0,0,255},
+          textString="Boiler_walls"),Text(
+          extent={{-394,282},{-306,272}},
+          lineColor={0,0,255},
+          textString="RMT_RHT"),     Text(
+          extent={{-384,354},{-334,344}},
+          lineColor={0,0,255},
+          textString="SBT"),         Text(
+          extent={{-384,432},{-334,422}},
+          lineColor={0,0,255},
+          textString="RBT"),         Text(
+          extent={{-382,526},{-332,513}},
+          lineColor={0,0,255},
+          textString="Eco"),         Text(
+          extent={{1426,542},{1540,522}},
+          lineColor={0,0,255},
+          textString="LP_RH3"),      Text(
+          extent={{1256,538},{1370,518}},
+          lineColor={0,0,255},
+          textString="LP_RH2"),      Text(
+          extent={{1088,538},{1202,518}},
+          lineColor={0,0,255},
+          textString="LP_RH1"),      Text(
+          extent={{902,540},{1016,520}},
+          lineColor={0,0,255},
+          textString="IP_RH"),       Text(
+          extent={{466,468},{580,448}},
+          lineColor={0,0,255},
+          textString="HP_RH3"),      Text(
+          extent={{290,502},{404,482}},
+          lineColor={0,0,255},
+          textString="HP_RH2"),      Text(
+          extent={{98,502},{212,482}},
+          lineColor={0,0,255},
+          textString="HP_RH1"),      Text(
+          extent={{-74,546},{40,526}},
+          lineColor={0,0,255},
+          textString="Desu"),
+        Text(
+          extent={{6,-226},{1248,-540}},
+          lineColor={28,108,200},
+          textString="New model DynamicExchangerWaterSteamFlueGases_New_hi
+Dp; h convectif")}),
+    experiment(StopTime=1200),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end SupercriticalPulverizedCoalPowerPlant;
diff --git a/ThermoSysPro/Examples/Book/PowerPlants/package.mo b/ThermoSysPro/Examples/Book/PowerPlants/package.mo
index 133cd3ff4633c6bb4b05fad3573f0e44eb217a62..dd76b765cf2e2c3a3ffce1d6d584cd5c268cf65c 100644
--- a/ThermoSysPro/Examples/Book/PowerPlants/package.mo
+++ b/ThermoSysPro/Examples/Book/PowerPlants/package.mo
@@ -1,147 +1,147 @@
-within ThermoSysPro.Examples.Book;
-package PowerPlants "PowerPlants"
-
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains models of three different types of power plants:</p>
-<ul>
-<li>Combined cycle power plant</li>
-<li>Concentrated solar power plant</li>
-<li>Pulverized coal power plant</li>
-</ul>
-</html>"));
-end PowerPlants;
+within ThermoSysPro.Examples.Book;
+package PowerPlants "PowerPlants"
+
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains models of three different types of power plants:</p>
+<ul>
+<li>Combined cycle power plant</li>
+<li>Concentrated solar power plant</li>
+<li>Pulverized coal power plant</li>
+</ul>
+</html>"));
+end PowerPlants;
diff --git a/ThermoSysPro/Examples/Book/PowerPlants/package.order b/ThermoSysPro/Examples/Book/PowerPlants/package.order
index 19cc3efabfe90dd5edaf2d7b38886fb1bca9cf96..455f15fa4d09f7295808b3362dae5c635ec331a7 100644
--- a/ThermoSysPro/Examples/Book/PowerPlants/package.order
+++ b/ThermoSysPro/Examples/Book/PowerPlants/package.order
@@ -1,3 +1,3 @@
-CombinedCyclePowerPlant
-SupercriticalPulverizedCoalPowerPlant
-ConcentratedSolarPowerPlant_PTSC
+CombinedCyclePowerPlant
+SupercriticalPulverizedCoalPowerPlant
+ConcentratedSolarPowerPlant_PTSC
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo
index bbfd0d80899750391be5f12bb73ee5d71ca66585..227c90974369fc9e6bf21cc0f1050287f1d86ff6 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo
@@ -1,79 +1,79 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.Boiler;
-model TestFossilFuelBoiler
-  MultiFluids.Boilers.FossilFuelBoiler FossilFuelBoiler(
-    Wloss=0,
-    Ke=1.e6,
-    Tsf=386.16)
-    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
-  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    T0=338.16,
-    Cp=1282,
-    Xh=0.24403,
-    Xc=0.75323,
-    Q0=1.45)
-    annotation (Placement(transformation(extent={{-36,-78},{0,-41}}, rotation=0)));
-  FlueGases.BoundaryConditions.SourceQ sourceQ(
-    Xco2=0,
-    Xh2o=0.01,
-    Q0=27.,
-    T0=298.16,
-    Xo2=0.233) annotation (Placement(transformation(extent={{-110,-50},{-71,-13}},
-          rotation=0)));
-  FlueGases.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
-          extent={{68,-51},{110,-12}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ sourcePQ(
-    P0=140e5,
-    Q0=24.,
-    h0=600e3)
-    annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=
-            0)));
-  WaterSteam.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{74,13},{110,49}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3)
-    annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3)
-    annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0)));
-equation
-  connect(sourceQ.C, FossilFuelBoiler.Cair)     annotation (Line(
-      points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}},
-      color={0,0,0},
-      thickness=1));
-  connect(FossilFuelBoiler.Cfg, sinkP.C)     annotation (Line(
-      points={{45,-31.62},{62,-31.62},{62,-31.5},{68.42,-31.5}},
-      color={0,0,0},
-      thickness=1));
-  connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel)     annotation (Line(points={
-          {0,-59.5},{0,-40.8}}, color={0,0,0}));
-  connect(sourcePQ.C, singularPressureLoss.C1)
-    annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation (Line(
-        points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sink.C)
-    annotation (Line(points={{65,31},{74,31}}, color={0,0,255}));
-  connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation (Line(
-        points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255}));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestFossilFuelBoiler;
+within ThermoSysPro.Examples.Book.SimpleExamples.Boiler;
+model TestFossilFuelBoiler
+  MultiFluids.Boilers.FossilFuelBoiler FossilFuelBoiler(
+    Wloss=0,
+    Ke=1.e6,
+    Tsf=386.16)
+    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
+  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    T0=338.16,
+    Cp=1282,
+    Xh=0.24403,
+    Xc=0.75323,
+    Q0=1.45)
+    annotation (Placement(transformation(extent={{-36,-78},{0,-41}}, rotation=0)));
+  FlueGases.BoundaryConditions.SourceQ sourceQ(
+    Xco2=0,
+    Xh2o=0.01,
+    Q0=27.,
+    T0=298.16,
+    Xo2=0.233) annotation (Placement(transformation(extent={{-110,-50},{-71,-13}},
+          rotation=0)));
+  FlueGases.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
+          extent={{68,-51},{110,-12}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ sourcePQ(
+    P0=140e5,
+    Q0=24.,
+    h0=600e3)
+    annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=
+            0)));
+  WaterSteam.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{74,13},{110,49}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3)
+    annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3)
+    annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0)));
+equation
+  connect(sourceQ.C, FossilFuelBoiler.Cair)     annotation (Line(
+      points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}},
+      color={0,0,0},
+      thickness=1));
+  connect(FossilFuelBoiler.Cfg, sinkP.C)     annotation (Line(
+      points={{45,-31.62},{62,-31.62},{62,-31.5},{68.42,-31.5}},
+      color={0,0,0},
+      thickness=1));
+  connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel)     annotation (Line(points={
+          {0,-59.5},{0,-40.8}}, color={0,0,0}));
+  connect(sourcePQ.C, singularPressureLoss.C1)
+    annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation (Line(
+        points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sink.C)
+    annotation (Line(points={{65,31},{74,31}}, color={0,0,255}));
+  connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation (Line(
+        points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255}));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestFossilFuelBoiler;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/package.mo
index 51bdcf8a463ac7988a3a46fdafa6c8419d6e6cf5..2c9d4f50852176b49f8e9708c2fcf7b5ad9dc903 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package Boiler "Boiler modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end Boiler;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package Boiler "Boiler modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end Boiler;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/package.order
index 2ad86130dac64702cf98deb99048699e00179cae..6eae21c6a515eb2e4577c344a72d7ea192014d8a 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Boiler/package.order
@@ -1 +1 @@
-TestFossilFuelBoiler
+TestFossilFuelBoiler
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo
index 7c89607f3127c8c9c62295f24646a7e667c45d32..bbdaf676f05a18114cd25c40c5a8f92ba01150d2 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo
@@ -1,72 +1,72 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
-model Scenario_1
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    mode_car=1,
-    mode_car_hn=1,
-    mode_car_Cr=1,
-    dynamic_mech_equation=false)
-                     annotation (Placement(transformation(extent={{-20,20},{0,
-            40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=10,
-    Duration=100,
-    Initialvalue=1400,
-    Finalvalue=0) annotation (Placement(transformation(extent={{-100,-20},{-80,
-            0}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
-    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-20},
-            {-40,0}}, rotation=0)));
-equation
-  connect(sourcePQ.C, centrifugalPump.C1)
-    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sink.C)
-    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
-  connect(sourceAngularVelocity.M, centrifugalPump.M)
-    annotation (Line(points={{-39,-10},{-10,-10},{-10,19}}));
-  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
-    annotation (Line(points={{-79,-10},{-55,-10}}));
-  annotation (experiment(StopTime=200),
-    Diagram(graphics={
-        Text(
-          extent={{-96,98},{-58,82}},
-          lineColor={0,0,255},
-          textString=
-               "w=1 ==> w=0"),
-        Text(
-          extent={{-102,74},{-80,68}},
-          lineColor={0,0,255},
-          textString="q=0"),
-        Text(
-          extent={{-96,60},{-56,40}},
-          lineColor={0,0,255},
-          textString="theta=0 ==> theta=-180")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;1.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end Scenario_1;
+within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
+model Scenario_1
+
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    mode_car=1,
+    mode_car_hn=1,
+    mode_car_Cr=1,
+    dynamic_mech_equation=false)
+                     annotation (Placement(transformation(extent={{-20,20},{0,
+            40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=10,
+    Duration=100,
+    Initialvalue=1400,
+    Finalvalue=0) annotation (Placement(transformation(extent={{-100,-20},{-80,
+            0}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
+    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-20},
+            {-40,0}}, rotation=0)));
+equation
+  connect(sourcePQ.C, centrifugalPump.C1)
+    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sink.C)
+    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
+  connect(sourceAngularVelocity.M, centrifugalPump.M)
+    annotation (Line(points={{-39,-10},{-10,-10},{-10,19}}));
+  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
+    annotation (Line(points={{-79,-10},{-55,-10}}));
+  annotation (experiment(StopTime=200),
+    Diagram(graphics={
+        Text(
+          extent={{-96,98},{-58,82}},
+          lineColor={0,0,255},
+          textString=
+               "w=1 ==> w=0"),
+        Text(
+          extent={{-102,74},{-80,68}},
+          lineColor={0,0,255},
+          textString="q=0"),
+        Text(
+          extent={{-96,60},{-56,40}},
+          lineColor={0,0,255},
+          textString="theta=0 ==> theta=-180")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;1.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end Scenario_1;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo
index bd9f6ae816dcbbd3a8d0961bbfc0fe6a9b2e3976..f7246f889191bc26f4243dd9b04a8d28ee608fc0 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo
@@ -1,69 +1,69 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
-model Scenario_2
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
-        1, mode_car_Cr=1,
-    mode_car=1)      annotation (Placement(transformation(extent={{-20,20},{0,
-            40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=100)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=10,
-    Duration=100,
-    Initialvalue=1400,
-    Finalvalue=0) annotation (Placement(transformation(extent={{-80,-20},{-60,0}},
-          rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
-    sourceAngularVelocity annotation (Placement(transformation(extent={{-40,-20},
-            {-20,0}}, rotation=0)));
-equation
-  connect(sourcePQ.C, centrifugalPump.C1)
-    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sink.C)
-    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
-  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
-    annotation (Line(points={{-59,-10},{-35,-10}}));
-  connect(sourceAngularVelocity.M, centrifugalPump.M)
-    annotation (Line(points={{-19,-10},{-10,-10},{-10,19}}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-96,98},{-58,82}},
-          lineColor={0,0,255},
-          textString=
-               "w=1 ==> w=0"),
-        Text(
-          extent={{-100,74},{-78,68}},
-          lineColor={0,0,255},
-          textString="q=0.21"),
-        Text(
-          extent={{-96,60},{-56,40}},
-          lineColor={0,0,255},
-          textString="theta=12 ==> theta=90")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.  It corresponds to scenario n&deg;2.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end Scenario_2;
+within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
+model Scenario_2
+
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
+        1, mode_car_Cr=1,
+    mode_car=1)      annotation (Placement(transformation(extent={{-20,20},{0,
+            40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=100)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=10,
+    Duration=100,
+    Initialvalue=1400,
+    Finalvalue=0) annotation (Placement(transformation(extent={{-80,-20},{-60,0}},
+          rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
+    sourceAngularVelocity annotation (Placement(transformation(extent={{-40,-20},
+            {-20,0}}, rotation=0)));
+equation
+  connect(sourcePQ.C, centrifugalPump.C1)
+    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sink.C)
+    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
+  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
+    annotation (Line(points={{-59,-10},{-35,-10}}));
+  connect(sourceAngularVelocity.M, centrifugalPump.M)
+    annotation (Line(points={{-19,-10},{-10,-10},{-10,19}}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-96,98},{-58,82}},
+          lineColor={0,0,255},
+          textString=
+               "w=1 ==> w=0"),
+        Text(
+          extent={{-100,74},{-78,68}},
+          lineColor={0,0,255},
+          textString="q=0.21"),
+        Text(
+          extent={{-96,60},{-56,40}},
+          lineColor={0,0,255},
+          textString="theta=12 ==> theta=90")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.  It corresponds to scenario n&deg;2.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end Scenario_2;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo
index c440db1de9e789ab6992494db457c807d5f3758f..a2b19a92d71a61e1466ed9f5b3be24dd3e1dbad1 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo
@@ -1,75 +1,75 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
-model Scenario_3
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    continuous_flow_reversal=false,
-    hn_nom_p=10,
-    mode_car=1,
-    V=0.01,
-    dynamic_energy_balance=false,
-    mode_car_Cr=1,
-    mode_car_hn=1)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=300000)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=100,
-    Starttime=100,
-    Finalvalue=4800000,
-    Initialvalue=400000)                       annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-      lambda=0, inertia=true)
-              annotation (Placement(transformation(extent={{20,20},{40,40}},
-          rotation=0)));
-equation
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255}));
-  connect(rampe2.y, sinkP.IPressure)
-    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
-  connect(lumpedStraightPipe.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, lumpedStraightPipe.C1)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-100,94},{-80,86}},
-          lineColor={0,0,255},
-          textString=
-               "w=1"),
-        Text(
-          extent={{-96,80},{-56,60}},
-          lineColor={0,0,255},
-          textString="q=0.95 ==> q=-7.77"),
-        Text(
-          extent={{-96,60},{-54,40}},
-          lineColor={0,0,255},
-          textString="theta=44 ==> theta=-83")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.  It corresponds to scenario n&deg;3.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end Scenario_3;
+within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
+model Scenario_3
+
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    continuous_flow_reversal=false,
+    hn_nom_p=10,
+    mode_car=1,
+    V=0.01,
+    dynamic_energy_balance=false,
+    mode_car_Cr=1,
+    mode_car_hn=1)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=300000)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=100,
+    Starttime=100,
+    Finalvalue=4800000,
+    Initialvalue=400000)                       annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+      lambda=0, inertia=true)
+              annotation (Placement(transformation(extent={{20,20},{40,40}},
+          rotation=0)));
+equation
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255}));
+  connect(rampe2.y, sinkP.IPressure)
+    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
+  connect(lumpedStraightPipe.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, lumpedStraightPipe.C1)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-100,94},{-80,86}},
+          lineColor={0,0,255},
+          textString=
+               "w=1"),
+        Text(
+          extent={{-96,80},{-56,60}},
+          lineColor={0,0,255},
+          textString="q=0.95 ==> q=-7.77"),
+        Text(
+          extent={{-96,60},{-54,40}},
+          lineColor={0,0,255},
+          textString="theta=44 ==> theta=-83")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.  It corresponds to scenario n&deg;3.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end Scenario_3;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo
index 8ba70133d8712c92636e374edb92af369321460d..0db82c9952847088f1fb3a6083c14c85a6266382 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo
@@ -1,81 +1,81 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
-model Scenario_4
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    J=5.685,
-    dynamic_mech_equation=true,
-    hn_coef={-165.23,774.95},
-    rh_coef={-0.704,1.46},
-    N_nom=4809,
-    hn_nom_p=662,
-    Qv_nom_p=0.921,
-    mode_car_Cr=1,
-    w_a(start=0.003569900907740773),
-    mode=0,
-    C1(h(start=650000.0)),
-    Qv(start=0.010949905982587188),
-    pro(d(start=913.2498503550851)))
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceP(
-    Q0=10,
-    h0=650e3,
-    P0=100000)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
-    Duration=1000,
-    Starttime=0,
-    Initialvalue=7.2e5,
-    Finalvalue=2.0e5)                          annotation (Placement(
-        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceTorque sourceTorque
-    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
-equation
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(sourceTorque.M, centrifugalPump.M)
-    annotation (Line(points={{1,-10},{30,-10},{30,19}}));
-  connect(rampe3.y, sourceP.IPressure)
-    annotation (Line(points={{-39,30},{-15,30}}));
-  annotation (Diagram(graphics={
-        Text(
-          extent={{-100,94},{-80,86}},
-          lineColor={0,0,255},
-          textString="w=0 "),
-        Text(
-          extent={{-96,74},{-82,66}},
-          lineColor={0,0,255},
-          textString="q=0.57"),
-        Text(
-          extent={{-96,60},{-54,40}},
-          lineColor={0,0,255},
-          textString="theta=71 ==> theta=74")}),
-                                 experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.  It corresponds to scenario n&deg;4.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end Scenario_4;
+within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
+model Scenario_4
+
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    J=5.685,
+    dynamic_mech_equation=true,
+    hn_coef={-165.23,774.95},
+    rh_coef={-0.704,1.46},
+    N_nom=4809,
+    hn_nom_p=662,
+    Qv_nom_p=0.921,
+    mode_car_Cr=1,
+    w_a(start=0.003569900907740773),
+    mode=0,
+    C1(h(start=650000.0)),
+    Qv(start=0.010949905982587188),
+    pro(d(start=913.2498503550851)))
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceP(
+    Q0=10,
+    h0=650e3,
+    P0=100000)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
+    Duration=1000,
+    Starttime=0,
+    Initialvalue=7.2e5,
+    Finalvalue=2.0e5)                          annotation (Placement(
+        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceTorque sourceTorque
+    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
+equation
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(sourceTorque.M, centrifugalPump.M)
+    annotation (Line(points={{1,-10},{30,-10},{30,19}}));
+  connect(rampe3.y, sourceP.IPressure)
+    annotation (Line(points={{-39,30},{-15,30}}));
+  annotation (Diagram(graphics={
+        Text(
+          extent={{-100,94},{-80,86}},
+          lineColor={0,0,255},
+          textString="w=0 "),
+        Text(
+          extent={{-96,74},{-82,66}},
+          lineColor={0,0,255},
+          textString="q=0.57"),
+        Text(
+          extent={{-96,60},{-54,40}},
+          lineColor={0,0,255},
+          textString="theta=71 ==> theta=74")}),
+                                 experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.  It corresponds to scenario n&deg;4.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end Scenario_4;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.mo
index b2f17f4e158eec3792b394e102c7ebc83aa5cd32..20ce1ddc5c208e1525ca0ccb34cbd57dd50a6fd8 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump;
-package TestCentrifugalPump
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end TestCentrifugalPump;
+within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump;
+package TestCentrifugalPump
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end TestCentrifugalPump;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.order
index d4ec0e216cdd2c8afc5068e1f2aa6b52df0af5cd..ff38607ad0ddd0f6a6f7f4b95ac7ec81e39e81e6 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.order
@@ -1,4 +1,4 @@
-Scenario_1
-Scenario_2
-Scenario_3
-Scenario_4
+Scenario_1
+Scenario_2
+Scenario_3
+Scenario_4
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo
index b9c2e354abf2b26c5e6473346f55cf3ad43876ac..67a633ccbd3dcdc030a5e3a65123d2de365efdab 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo
@@ -1,71 +1,71 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump;
-model TestStaticCentrifugalPump
-
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump StaticCentrifugalPump1
-    annotation (Placement(transformation(extent={{-10,-50},{-30,-30}},
-                                                                     rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
-                                        ze2=10, zs2=10)
-    annotation (Placement(transformation(extent={{-30,10},{-10,30}},
-                                                                   rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
-    annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
-                                                  k=0.5) annotation (Placement(
-        transformation(extent={{-10,50},{10,70}},
-                                                rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    width=200,
-    period=500,
-    amplitude=1400,
-    offset=0)   annotation (Placement(transformation(extent={{-50,-80},{-30,-60}},
-          rotation=0)));
-equation
-  connect(StaticCentrifugalPump1.C2, Bache1.Ce2)
-    annotation (Line(points={{-30,-40},{-70,-40},{-70,14},{-30,14}}, color={0,0,
-          255}));
-  connect(Bache1.Cs2, VanneReglante1.C1)
-    annotation (Line(points={{-10,14},{30,14}},
-                                              color={0,0,255}));
-  connect(VanneReglante1.C2, StaticCentrifugalPump1.C1)
-    annotation (Line(points={{50,14},{70,14},{70,-40},{-10,-40}},
-                                                                color={0,0,255}));
-  connect(Constante1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{11,60},{40,60},{40,31}}, color={0,0,255}));
-  connect(pulse.y, StaticCentrifugalPump1.rpm_or_mpower)
-    annotation (Line(points={{-29,-70},{-20,-70},{-20,-51}}, smooth=Smooth.None));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 12.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestStaticCentrifugalPump;
+within ThermoSysPro.Examples.Book.SimpleExamples.CentrifugalPump;
+model TestStaticCentrifugalPump
+
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump StaticCentrifugalPump1
+    annotation (Placement(transformation(extent={{-10,-50},{-30,-30}},
+                                                                     rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
+                                        ze2=10, zs2=10)
+    annotation (Placement(transformation(extent={{-30,10},{-10,30}},
+                                                                   rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
+    annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
+                                                  k=0.5) annotation (Placement(
+        transformation(extent={{-10,50},{10,70}},
+                                                rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    width=200,
+    period=500,
+    amplitude=1400,
+    offset=0)   annotation (Placement(transformation(extent={{-50,-80},{-30,-60}},
+          rotation=0)));
+equation
+  connect(StaticCentrifugalPump1.C2, Bache1.Ce2)
+    annotation (Line(points={{-30,-40},{-70,-40},{-70,14},{-30,14}}, color={0,0,
+          255}));
+  connect(Bache1.Cs2, VanneReglante1.C1)
+    annotation (Line(points={{-10,14},{30,14}},
+                                              color={0,0,255}));
+  connect(VanneReglante1.C2, StaticCentrifugalPump1.C1)
+    annotation (Line(points={{50,14},{70,14},{70,-40},{-10,-40}},
+                                                                color={0,0,255}));
+  connect(Constante1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{11,60},{40,60},{40,31}}, color={0,0,255}));
+  connect(pulse.y, StaticCentrifugalPump1.rpm_or_mpower)
+    annotation (Line(points={{-29,-70},{-20,-70},{-20,-51}}, smooth=Smooth.None));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 12.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestStaticCentrifugalPump;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/package.mo
index 6b6ea97e4d84239002fbc2aaced3a2b10cc90b5d..7e36a882b7bd6e4ad594e1445fff0be6e3ad4bd6 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package CentrifugalPump "Centrifugal pump modeling"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 12 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end CentrifugalPump;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package CentrifugalPump "Centrifugal pump modeling"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 12 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end CentrifugalPump;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/package.order
index 910268a123209d6684825a1c92a7e6c4cabd113f..cdb4b7af22dc32a89dde464404374229145b4030 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CentrifugalPump/package.order
@@ -1,2 +1,2 @@
-TestStaticCentrifugalPump
-TestCentrifugalPump
+TestStaticCentrifugalPump
+TestCentrifugalPump
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo
index 90d1453583e05fa0cd30950b24dc26d47694961f..bc75c0553d3441a69bda852df67232189e5b83c1 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo
@@ -1,85 +1,85 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.CombustionChamber;
-model TestGTCombustionChamber
-
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees2
-    annotation (Placement(transformation(
-        origin={149,-2},
-        extent={{23,-24},{-23,24}},
-        rotation=180)));
-  Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(
-                          Cfg(P(fixed=true, start=14.1e5)), kcham(fixed=false,
-        start=1))
-               annotation (Placement(transformation(extent={{-67,-68},{67,64}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ sourcePQ2(
-    Q0=0,
-    P0=15e5,
-    h0=300e3)
-    annotation (Placement(transformation(extent={{-112,48},{-72,88}},
-          rotation=0)));
-  Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(
-    Hum=0,
-    Xo=0,
-    Xn=0,
-    Xs=0,
-    rho=0.838,
-    Xc=0.755,
-    Xh=0.245,
-    Cp=2255,
-    T0=410,
-    Q0=9.30,
-    LHV=47500e3)
-          annotation (Placement(transformation(extent={{-107,-93},{-71,-57}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees2(
-    Xso2=0,
-    Xco2=0.0,
-    Xo2=0.23,
-    Xh2o=0.01,
-    P0=15e5,
-    Q0=415,
-    T0=680)
-    annotation (Placement(transformation(extent={{-174,-26},{-128,22}},
-          rotation=0)));
-equation
-  connect(GTCombustionChamber2.Cws, sourcePQ2.C)
-    annotation (Line(points={{-40.2,57.4},{-40.2,68},{-72,68}}));
-  connect(GTCombustionChamber2.Cfuel, sourceCombustible2.C) annotation (Line(
-        points={{0,-61.4},{0,-75},{-71,-75}},    color={0,0,0}));
-  connect(GTCombustionChamber2.Cfg, Puits_Fumees2.C) annotation (Line(
-      points={{60.3,-2},{126.46,-2}},
-      color={0,0,0},
-      thickness=1));
-  connect(Source_Fumees2.C, GTCombustionChamber2.Ca) annotation (Line(
-      points={{-128,-2},{-60.3,-2}},
-      color={0,0,0},
-      thickness=1));
-  annotation (Diagram(graphics,
-                      coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1)), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 8.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestGTCombustionChamber;
+within ThermoSysPro.Examples.Book.SimpleExamples.CombustionChamber;
+model TestGTCombustionChamber
+
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees2
+    annotation (Placement(transformation(
+        origin={149,-2},
+        extent={{23,-24},{-23,24}},
+        rotation=180)));
+  Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(
+                          Cfg(P(fixed=true, start=14.1e5)), kcham(fixed=false,
+        start=1))
+               annotation (Placement(transformation(extent={{-67,-68},{67,64}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ sourcePQ2(
+    Q0=0,
+    P0=15e5,
+    h0=300e3)
+    annotation (Placement(transformation(extent={{-112,48},{-72,88}},
+          rotation=0)));
+  Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(
+    Hum=0,
+    Xo=0,
+    Xn=0,
+    Xs=0,
+    rho=0.838,
+    Xc=0.755,
+    Xh=0.245,
+    Cp=2255,
+    T0=410,
+    Q0=9.30,
+    LHV=47500e3)
+          annotation (Placement(transformation(extent={{-107,-93},{-71,-57}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees2(
+    Xso2=0,
+    Xco2=0.0,
+    Xo2=0.23,
+    Xh2o=0.01,
+    P0=15e5,
+    Q0=415,
+    T0=680)
+    annotation (Placement(transformation(extent={{-174,-26},{-128,22}},
+          rotation=0)));
+equation
+  connect(GTCombustionChamber2.Cws, sourcePQ2.C)
+    annotation (Line(points={{-40.2,57.4},{-40.2,68},{-72,68}}));
+  connect(GTCombustionChamber2.Cfuel, sourceCombustible2.C) annotation (Line(
+        points={{0,-61.4},{0,-75},{-71,-75}},    color={0,0,0}));
+  connect(GTCombustionChamber2.Cfg, Puits_Fumees2.C) annotation (Line(
+      points={{60.3,-2},{126.46,-2}},
+      color={0,0,0},
+      thickness=1));
+  connect(Source_Fumees2.C, GTCombustionChamber2.Ca) annotation (Line(
+      points={{-128,-2},{-60.3,-2}},
+      color={0,0,0},
+      thickness=1));
+  annotation (Diagram(graphics,
+                      coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1)), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 8.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestGTCombustionChamber;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo
index 6b0e1af13dc5c87a7ac13cc1e3af296ad030a15c..8b1542399301d0dcb383146e9d9d40aa39142f09 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo
@@ -1,149 +1,149 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.CombustionChamber;
-model TestGenericCombustion1D "TestGenericCombustion1D"
-
-  parameter Integer NCEL = 7;
-
-  Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(
-    NCEL=7,
-    Qm(fixed=false),
-    Qsf(fixed=false),
-    kcham(fixed=true) = 0.1,
-    Acham=275,
-    Xbf=0,
-    ImbCV=0.05,
-    EPSPAR=0.7,
-    Kec=8.8,
-    SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56},
-    ImbBF=0.0,
-    Psf(start=113275))
-    annotation (Placement(transformation(extent={{-62,-56},{62,72}}, rotation=0)));
-  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Xn=0.0208,
-    Xashes=0.136,
-    Cp=1200,
-    rho=1100,
-    LHV=29245e3,
-    Xc=0.719,
-    Xh=0.0414,
-    Xo=0.086,
-    Xs=0.0044,
-    Vol=0.286,
-    Q0=57.20,
-    T0=358.15,
-    Hum=0.08)
-    annotation (Placement(transformation(extent={{-106,-43},{-72,-5}}, rotation=
-           0)));
-  FlueGases.BoundaryConditions.SourcePQ sourceAir(
-    Xso2=0,
-    Q0=609.29,
-    Xh2o=0.01,
-    Xo2=0.230,
-    Xco2=0,
-    P0=191000,
-    T0=524.89)
-    annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0)));
-  FlueGases.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{0,70},{44,112}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
-    annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=
-            0)));
-  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe              PipeWaterSteam(
-    Ns=7,
-    z2=56,
-    rugosrel=5e-5,
-    ntubes=403,
-    L=58,
-    D=0.0327,
-    C2(Q(fixed=false, start=486.69), P(
-        fixed=false,
-        start=1.96318e+07,
-        displayUnit="Pa")),
-    dpfCorr=3.5)
-    annotation (Placement(transformation(
-        origin={91,8},
-        extent={{49,16},{-49,-16}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall              paroiEcrans(
-    Ns=7,
-    lambda=40,
-    steady_state=true,
-    ntubes=403,
-    L=58,
-    D=0.0327,
-    e=0.001)
-    annotation (Placement(transformation(
-        origin={73,7.5},
-        extent={{51.5,-15},{-51.5,15}},
-        rotation=270)));
-  WaterSteam.BoundaryConditions.SinkP              sinkWaterSteam2(
-    option_temperature=2,
-    Q(start=486.69, fixed=true),
-    h0=2.5e+06,
-    mode=0,
-    P0(fixed=false) = 19621600)
-    annotation (Placement(transformation(
-        origin={90,90.5},
-        extent={{14.5,-15},{-14.5,15}},
-        rotation=270)));
-  WaterSteam.BoundaryConditions.SourceP              sourceEcrans(
-    h0=1.292e+06,
-    option_temperature=2,
-    mode=0,
-    P0=20112000)
-    annotation (Placement(transformation(
-        origin={91,-81},
-        extent={{15,-15},{-15,15}},
-        rotation=270)));
-equation
-  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel)
-    annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0}));
-  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
-      points={{0,65.6},{0,91},{0.44,91}},
-      color={0,0,0},
-      thickness=1));
-  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
-      points={{0,-49.6},{0,-78}},
-      color={0,0,0},
-      thickness=1));
-  connect(SourcePQ_Water.C, genericCombustionCCS.Cws)
-    annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255}));
-  connect(genericCombustionCCS.Cth,paroiEcrans. WT2) annotation (Line(points={{55.8,8},
-          {68,8},{68,7.5},{76,7.5}},         color={191,95,0}));
-  connect(paroiEcrans.WT1,PipeWaterSteam. CTh) annotation (Line(points={{70,7.5},
-          {71,7.5},{71,8},{86.2,8}}, color={191,95,0}));
-  connect(sourceEcrans.C,PipeWaterSteam. C1)
-    annotation (Line(points={{91,-66},{91,-41}},   color={0,0,255}));
-  connect(PipeWaterSteam.C2,sinkWaterSteam2. C) annotation (Line(points={{91,57},
-          {91,76},{90,76}},       color={0,0,255}));
-  annotation (Diagram(graphics),
-                       Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-        info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 8.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestGenericCombustion1D;
+within ThermoSysPro.Examples.Book.SimpleExamples.CombustionChamber;
+model TestGenericCombustion1D "TestGenericCombustion1D"
+
+  parameter Integer NCEL = 7;
+
+  Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(
+    NCEL=7,
+    Qm(fixed=false),
+    Qsf(fixed=false),
+    kcham(fixed=true) = 0.1,
+    Acham=275,
+    Xbf=0,
+    ImbCV=0.05,
+    EPSPAR=0.7,
+    Kec=8.8,
+    SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56},
+    ImbBF=0.0,
+    Psf(start=113275))
+    annotation (Placement(transformation(extent={{-62,-56},{62,72}}, rotation=0)));
+  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Xn=0.0208,
+    Xashes=0.136,
+    Cp=1200,
+    rho=1100,
+    LHV=29245e3,
+    Xc=0.719,
+    Xh=0.0414,
+    Xo=0.086,
+    Xs=0.0044,
+    Vol=0.286,
+    Q0=57.20,
+    T0=358.15,
+    Hum=0.08)
+    annotation (Placement(transformation(extent={{-106,-43},{-72,-5}}, rotation=
+           0)));
+  FlueGases.BoundaryConditions.SourcePQ sourceAir(
+    Xso2=0,
+    Q0=609.29,
+    Xh2o=0.01,
+    Xo2=0.230,
+    Xco2=0,
+    P0=191000,
+    T0=524.89)
+    annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0)));
+  FlueGases.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{0,70},{44,112}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
+    annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=
+            0)));
+  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe              PipeWaterSteam(
+    Ns=7,
+    z2=56,
+    rugosrel=5e-5,
+    ntubes=403,
+    L=58,
+    D=0.0327,
+    C2(Q(fixed=false, start=486.69), P(
+        fixed=false,
+        start=1.96318e+07,
+        displayUnit="Pa")),
+    dpfCorr=3.5)
+    annotation (Placement(transformation(
+        origin={91,8},
+        extent={{49,16},{-49,-16}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall              paroiEcrans(
+    Ns=7,
+    lambda=40,
+    steady_state=true,
+    ntubes=403,
+    L=58,
+    D=0.0327,
+    e=0.001)
+    annotation (Placement(transformation(
+        origin={73,7.5},
+        extent={{51.5,-15},{-51.5,15}},
+        rotation=270)));
+  WaterSteam.BoundaryConditions.SinkP              sinkWaterSteam2(
+    option_temperature=2,
+    Q(start=486.69, fixed=true),
+    h0=2.5e+06,
+    mode=0,
+    P0(fixed=false) = 19621600)
+    annotation (Placement(transformation(
+        origin={90,90.5},
+        extent={{14.5,-15},{-14.5,15}},
+        rotation=270)));
+  WaterSteam.BoundaryConditions.SourceP              sourceEcrans(
+    h0=1.292e+06,
+    option_temperature=2,
+    mode=0,
+    P0=20112000)
+    annotation (Placement(transformation(
+        origin={91,-81},
+        extent={{15,-15},{-15,15}},
+        rotation=270)));
+equation
+  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel)
+    annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0}));
+  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
+      points={{0,65.6},{0,91},{0.44,91}},
+      color={0,0,0},
+      thickness=1));
+  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
+      points={{0,-49.6},{0,-78}},
+      color={0,0,0},
+      thickness=1));
+  connect(SourcePQ_Water.C, genericCombustionCCS.Cws)
+    annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255}));
+  connect(genericCombustionCCS.Cth,paroiEcrans. WT2) annotation (Line(points={{55.8,8},
+          {68,8},{68,7.5},{76,7.5}},         color={191,95,0}));
+  connect(paroiEcrans.WT1,PipeWaterSteam. CTh) annotation (Line(points={{70,7.5},
+          {71,7.5},{71,8},{86.2,8}}, color={191,95,0}));
+  connect(sourceEcrans.C,PipeWaterSteam. C1)
+    annotation (Line(points={{91,-66},{91,-41}},   color={0,0,255}));
+  connect(PipeWaterSteam.C2,sinkWaterSteam2. C) annotation (Line(points={{91,57},
+          {91,76},{90,76}},       color={0,0,255}));
+  annotation (Diagram(graphics),
+                       Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+        info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 8.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestGenericCombustion1D;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/package.mo
index 867b3a1caa9476af237e61d9c2462b0ca51115f7..641150c617da58eaba2780afa4b45b03d8364a60 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/package.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package CombustionChamber "Combustion chamber modeling"
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end CombustionChamber;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package CombustionChamber "Combustion chamber modeling"
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end CombustionChamber;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/package.order
index c07b17fcb0a09f47783a9f5c324e1ebd3e2f9d29..76da96b0773d7ec9560d326c489ed69d96ea38b9 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/CombustionChamber/package.order
@@ -1,2 +1,2 @@
-TestGTCombustionChamber
-TestGenericCombustion1D
+TestGTCombustionChamber
+TestGenericCombustion1D
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo b/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo
index 977fc54530d6cd2f6b6fd54f233a34000d1289f7..31a6d82aa5332501a7557ba8a26fef6ef23af525 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo
@@ -1,65 +1,65 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.GasTurbine;
-model TestCombustionTurbine
-  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
-  parameter Real Qred1(fixed=false,start=0.01) "Reduced mass flow rate";
-
-  FlueGases.Machines.CombustionTurbine CombustionTurbine(
-    tau_n=0.065,
-    is_eff_n=is_eff_n1,
-    Qred=Qred1,
-    Pe(fixed=true, start=1500000),
-    Ts(fixed=true, start=830)) annotation (Placement(transformation(extent={{
-            -42,-42},{36,42}}, rotation=0)));
-  FlueGases.BoundaryConditions.SourceQ SourceQ1(
-    Xso2=0,
-    Q0=430,
-    Xco2=0.06,
-    Xh2o=0.06,
-    Xo2=0.14,
-    T0=1500)
-    annotation (Placement(transformation(extent={{-106,-10},{-86,10}},
-          rotation=0)));
-  FlueGases.BoundaryConditions.SinkP SinkP1(P0=1e5)
-    annotation (Placement(transformation(
-        origin={94,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8)
-    annotation (Placement(transformation(extent={{-100,-42},{-80,-22}},
-          rotation=0)));
-equation
-  connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line(
-      points={{-86,0},{-42,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line(
-      points={{36,0},{84.2,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Wc1.y, CombustionTurbine.CompressorPower)
-    annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}}));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 11.4.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestCombustionTurbine;
+within ThermoSysPro.Examples.Book.SimpleExamples.GasTurbine;
+model TestCombustionTurbine
+  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
+  parameter Real Qred1(fixed=false,start=0.01) "Reduced mass flow rate";
+
+  FlueGases.Machines.CombustionTurbine CombustionTurbine(
+    tau_n=0.065,
+    is_eff_n=is_eff_n1,
+    Qred=Qred1,
+    Pe(fixed=true, start=1500000),
+    Ts(fixed=true, start=830)) annotation (Placement(transformation(extent={{
+            -42,-42},{36,42}}, rotation=0)));
+  FlueGases.BoundaryConditions.SourceQ SourceQ1(
+    Xso2=0,
+    Q0=430,
+    Xco2=0.06,
+    Xh2o=0.06,
+    Xo2=0.14,
+    T0=1500)
+    annotation (Placement(transformation(extent={{-106,-10},{-86,10}},
+          rotation=0)));
+  FlueGases.BoundaryConditions.SinkP SinkP1(P0=1e5)
+    annotation (Placement(transformation(
+        origin={94,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8)
+    annotation (Placement(transformation(extent={{-100,-42},{-80,-22}},
+          rotation=0)));
+equation
+  connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line(
+      points={{-86,0},{-42,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line(
+      points={{36,0},{84.2,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Wc1.y, CombustionTurbine.CompressorPower)
+    annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}}));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 11.4.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestCombustionTurbine;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo b/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo
index 823fff1dba1869fe68c125f89badaead80b43088..e1ceb616892707e0fbf3a17b47f1c5148d6de9c1 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo
@@ -1,60 +1,60 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.GasTurbine;
-model TestCompressor
-  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
-
-  FlueGases.Machines.Compressor Compressor(
-    Ps(fixed=false),
-    tau_n=16,
-    is_eff_n=is_eff_n1,
-    Pe(fixed=false, start=100000),
-    Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{
-            -52,-52},{48,52}}, rotation=0)));
-  FlueGases.BoundaryConditions.SourcePQ SourceQ1(
-    Xso2=0,
-    T0=288,
-    Xco2=0.0,
-    Xh2o=0.003,
-    Xo2=0.23,
-    P0=1e5,
-    Q0=420)
-    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},
-          rotation=0)));
-  FlueGases.BoundaryConditions.SinkP SinkP1(P0=15.8e5)
-    annotation (Placement(transformation(
-        origin={96,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-equation
-  connect(SourceQ1.C, Compressor.Ce) annotation (Line(
-      points={{-84,0},{-39.5,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Compressor.Cs, SinkP1.C) annotation (Line(
-      points={{35.5,0},{86.2,0}},
-      color={0,0,0},
-      thickness=1));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 11.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestCompressor;
+within ThermoSysPro.Examples.Book.SimpleExamples.GasTurbine;
+model TestCompressor
+  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
+
+  FlueGases.Machines.Compressor Compressor(
+    Ps(fixed=false),
+    tau_n=16,
+    is_eff_n=is_eff_n1,
+    Pe(fixed=false, start=100000),
+    Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{
+            -52,-52},{48,52}}, rotation=0)));
+  FlueGases.BoundaryConditions.SourcePQ SourceQ1(
+    Xso2=0,
+    T0=288,
+    Xco2=0.0,
+    Xh2o=0.003,
+    Xo2=0.23,
+    P0=1e5,
+    Q0=420)
+    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},
+          rotation=0)));
+  FlueGases.BoundaryConditions.SinkP SinkP1(P0=15.8e5)
+    annotation (Placement(transformation(
+        origin={96,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+equation
+  connect(SourceQ1.C, Compressor.Ce) annotation (Line(
+      points={{-84,0},{-39.5,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Compressor.Cs, SinkP1.C) annotation (Line(
+      points={{35.5,0},{86.2,0}},
+      color={0,0,0},
+      thickness=1));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 11.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestCompressor;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/package.mo
index 731fcdb6f4d863c52351b93f4fb96d67be6ad21f..bf19436158c623314db5ed42d7546be4bdb5c468 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package GasTurbine "Gas turbine modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 11 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end GasTurbine;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package GasTurbine "Gas turbine modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 11 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end GasTurbine;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/package.order
index 4733fa08d342d04ec7bc03fe9fa0a68f53d5bb6a..e128234aa4f9034c65383964004c765812d6f35c 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/GasTurbine/package.order
@@ -1,2 +1,2 @@
-TestCompressor
-TestCombustionTurbine
+TestCompressor
+TestCombustionTurbine
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo
index 104ebd4bedafda2b50162ab76a0d024229937f2c..d82838d57fd0bae5748f898a63f40d5009e33418 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo
@@ -1,292 +1,292 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
-model Islanding
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    P0=22.733e5,
-    h0=2650.6e3)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=2, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
-    Q(fixed=false, start=56),
-    Cvmax(fixed=false) = 354.534,
-    mode_caract=0,
-    Cv(start=70, fixed=false),
-    C1(h_vol(start=800e3), h(start=800e3)))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
-    Dc=0.016,
-    Lc=2.56,
-    PasL=0.027,
-    PasT=0.02338,
-    ec=2e-3,
-    Rv=1.130514,
-    Ns=10,
-    DpfCorr=1.1136,
-    cp=506,
-    rho=7780,
-    lambda=35,
-    COP0l(fixed=false) = 1.23,
-    C2ex(P(start=2220000)),
-    ntubes1=351,
-    ntubes2=351,
-    ntubes3=1319,
-    L3=26.4,
-    L2=13.2,
-    L1=13.2,
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1000.65e3), P(start=68.48e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      zl(fixed=true, start=0.43),
-      Kvl=1,
-      V=53,
-      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
-      Mp=53227,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      P(fixed=true, start=2216584),
-      hl(start=806345),
-      hv(start=1063490),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
-            519,519.4}),
-      Tp(start=509)),
-    Ce1(P(start=7100000)),
-    pipe_1(
-      z2=0.3,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000}),
-      Tp(start={500,501,502,503,504,505,506,507,508,510})),
-    pipe_2(
-      z2=0.4,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
-            6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    volumeD1(h(start=953939), P(start=6848000)),
-    volumeD(
-      h(start=812750),
-      dynamic_mass_balance=false,
-      P(start=6872000)),
-    P0c=2200000,
-    pipe_3(
-      steady_state=true,
-      mode=1,
-      z2=0.7,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-            492,492,492,492,132}),
-      advection=false,
-      inertia=true,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
-            6854000,6853000,6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4})))
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
-                         annotation (Placement(transformation(extent={{-99,-48},
-            {-79,-28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
-    C2(h_vol(start=927700), h(start=927700)))
-                         annotation (Placement(transformation(extent={{-80,34},
-            {-100,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1000,
-        72.06e5; 1533,69.8e5; 1863,69.39e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-194,-8},{-172,
-            14}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
-                   annotation (Placement(transformation(extent={{-196,-88},{
-            -176,-68}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    P0=71.29e5,
-    h0=772.09e3,
-    T0=454.46,
-    option_temperature=1)
-    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
-      Table=[0,624.97; 378,624.97; 390,592; 438,699; 507,353; 936,252; 1404,176;
-        1872,116; 2340,88; 2500,88])
-                   annotation (Placement(transformation(extent={{-196,78},{-176,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
-        2000,3.e5])
-                   annotation (Placement(transformation(extent={{-194,154},{
-            -174,174}}, rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
-      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
-      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
-                          annotation (Placement(transformation(extent={{191,
-            -140},{169,-118}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
-    T(fixed=true, start=461.56),
-    Pm(start=2220000))   annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=650),
-    lambda(fixed=false) = 0.03,
-    L=48.72,
-    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pression_eauA.y, sourceP1.IPressure)
-                                              annotation (Line(points={{-170.9,
-          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
-          -124,88},{-124,55},{-125,55}}));
-  connect(Pression_Turbine.y, sourceP.IPressure)
-                                             annotation (Line(points={{-173,164},
-          {-166,164},{-166,152},{-194,152},{-194,130},{-181.5,130}}));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
-         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
-  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
-    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
-          -111.8}}));
-  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
-    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Temperature_eauA.y, sourceP1.ITemperature)
-                                                    annotation (Line(points={{
-          -175,-78},{-170,-78},{-170,-49},{-171,-49}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})), experiment(StopTime=3000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 9.5.2.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end Islanding;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
+model Islanding
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    P0=22.733e5,
+    h0=2650.6e3)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=2, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
+    Q(fixed=false, start=56),
+    Cvmax(fixed=false) = 354.534,
+    mode_caract=0,
+    Cv(start=70, fixed=false),
+    C1(h_vol(start=800e3), h(start=800e3)))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
+    Dc=0.016,
+    Lc=2.56,
+    PasL=0.027,
+    PasT=0.02338,
+    ec=2e-3,
+    Rv=1.130514,
+    Ns=10,
+    DpfCorr=1.1136,
+    cp=506,
+    rho=7780,
+    lambda=35,
+    COP0l(fixed=false) = 1.23,
+    C2ex(P(start=2220000)),
+    ntubes1=351,
+    ntubes2=351,
+    ntubes3=1319,
+    L3=26.4,
+    L2=13.2,
+    L1=13.2,
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1000.65e3), P(start=68.48e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      zl(fixed=true, start=0.43),
+      Kvl=1,
+      V=53,
+      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
+      Mp=53227,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      P(fixed=true, start=2216584),
+      hl(start=806345),
+      hv(start=1063490),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
+            519,519.4}),
+      Tp(start=509)),
+    Ce1(P(start=7100000)),
+    pipe_1(
+      z2=0.3,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000}),
+      Tp(start={500,501,502,503,504,505,506,507,508,510})),
+    pipe_2(
+      z2=0.4,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
+            6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    volumeD1(h(start=953939), P(start=6848000)),
+    volumeD(
+      h(start=812750),
+      dynamic_mass_balance=false,
+      P(start=6872000)),
+    P0c=2200000,
+    pipe_3(
+      steady_state=true,
+      mode=1,
+      z2=0.7,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+            492,492,492,492,132}),
+      advection=false,
+      inertia=true,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
+            6854000,6853000,6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4})))
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
+                         annotation (Placement(transformation(extent={{-99,-48},
+            {-79,-28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
+    C2(h_vol(start=927700), h(start=927700)))
+                         annotation (Placement(transformation(extent={{-80,34},
+            {-100,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1000,
+        72.06e5; 1533,69.8e5; 1863,69.39e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-194,-8},{-172,
+            14}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
+                   annotation (Placement(transformation(extent={{-196,-88},{
+            -176,-68}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    P0=71.29e5,
+    h0=772.09e3,
+    T0=454.46,
+    option_temperature=1)
+    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
+      Table=[0,624.97; 378,624.97; 390,592; 438,699; 507,353; 936,252; 1404,176;
+        1872,116; 2340,88; 2500,88])
+                   annotation (Placement(transformation(extent={{-196,78},{-176,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
+        2000,3.e5])
+                   annotation (Placement(transformation(extent={{-194,154},{
+            -174,174}}, rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
+      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
+      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
+                          annotation (Placement(transformation(extent={{191,
+            -140},{169,-118}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
+    T(fixed=true, start=461.56),
+    Pm(start=2220000))   annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=650),
+    lambda(fixed=false) = 0.03,
+    L=48.72,
+    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pression_eauA.y, sourceP1.IPressure)
+                                              annotation (Line(points={{-170.9,
+          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
+          -124,88},{-124,55},{-125,55}}));
+  connect(Pression_Turbine.y, sourceP.IPressure)
+                                             annotation (Line(points={{-173,164},
+          {-166,164},{-166,152},{-194,152},{-194,130},{-181.5,130}}));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
+         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
+  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
+    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
+          -111.8}}));
+  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
+    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Temperature_eauA.y, sourceP1.ITemperature)
+                                                    annotation (Line(points={{
+          -175,-78},{-170,-78},{-170,-49},{-171,-49}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})), experiment(StopTime=3000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 9.5.2.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end Islanding;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo
index 59626f15a94c9e8e4304fc6b64de9bf88ac30784..9c830a980f90075f6be04a7eac105d9cdfec7408 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo
@@ -1,309 +1,309 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
-model NegativeFlow
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    P0=22.733e5,
-    h0=2650.6e3)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=2, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
-    Q(fixed=false, start=56),
-    Cvmax(fixed=false) = 354.534,
-    mode_caract=0,
-    Cv(start=70, fixed=false),
-    C1(h_vol(start=800e3), h(start=800e3)))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
-    Dc=0.016,
-    Lc=2.56,
-    PasL=0.027,
-    PasT=0.02338,
-    ec=2e-3,
-    Rv=1.130514,
-    Ns=10,
-    DpfCorr=1.1136,
-    cp=506,
-    rho=7780,
-    lambda=35,
-    COP0l(fixed=false) = 1.23,
-    C2ex(P(start=2220000)),
-    ntubes1=351,
-    ntubes2=351,
-    ntubes3=1319,
-    L3=26.4,
-    L2=13.2,
-    L1=13.2,
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1000.65e3), P(start=68.48e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      zl(fixed=true, start=0.43),
-      Kvl=1,
-      V=53,
-      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
-      Mp=53227,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      P(fixed=true, start=2216584),
-      hl(start=806345),
-      hv(start=1063490),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
-            519,519.4}),
-      Tp(start=509)),
-    Ce1(P(start=7100000)),
-    pipe_1(
-      z2=0.3,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000}),
-      Tp(start={500,501,502,503,504,505,506,507,508,510})),
-    pipe_2(
-      z2=0.4,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
-            6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    volumeD1(h(start=953939), P(start=6848000)),
-    volumeD(
-      h(start=812750),
-      dynamic_mass_balance=false,
-      P(start=6872000)),
-    P0c=2200000,
-    pipe_3(
-      steady_state=true,
-      mode=1,
-      z2=0.7,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-            492,492,492,492,132}),
-      advection=false,
-      inertia=true,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
-            6854000,6853000,6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4})))
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
-                         annotation (Placement(transformation(extent={{-99,-48},
-            {-79,-28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
-    C2(h_vol(start=927700), h(start=927700)))
-                         annotation (Placement(transformation(extent={{-80,34},
-            {-100,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
-                   annotation (Placement(transformation(extent={{-194,-8},{-172,
-            14}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
-                   annotation (Placement(transformation(extent={{-196,-88},{
-            -176,-68}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    P0=71.29e5,
-    h0=772.09e3,
-    T0=454.46,
-    option_temperature=1)
-    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
-        624.97; 300,624.97; 2000,-200; 3000,-200])
-                   annotation (Placement(transformation(extent={{-196,78},{-176,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
-        2000,3.e5])
-                   annotation (Placement(transformation(extent={{-194,154},{
-            -174,174}}, rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
-      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
-      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
-                          annotation (Placement(transformation(extent={{191,
-            -140},{169,-118}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
-    T(fixed=true, start=461.56),
-    Pm(start=2220000))   annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=650),
-    lambda(fixed=false) = 0.03,
-    L=48.72,
-    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
-        69.8e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-196,-154},{
-            -174,-132}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pression_eauA.y, sourceP1.IPressure)
-                                              annotation (Line(points={{-170.9,
-          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
-          -124,88},{-124,55},{-125,55}}));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
-         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
-  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
-    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
-          -111.8}}));
-  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
-    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics={
-        Text(
-          extent={{-130,218},{124,158}},
-          lineColor={0,0,255},
-          textString=
-               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-90,-188},{102,-220}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-202,-196},{-100,-210}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{-118,152},{-62,138}},
-          lineColor={0,0,255},
-          textString=
-               "Qmin = 0")}), experiment(StopTime=3000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end NegativeFlow;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
+model NegativeFlow
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    P0=22.733e5,
+    h0=2650.6e3)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=2, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
+    Q(fixed=false, start=56),
+    Cvmax(fixed=false) = 354.534,
+    mode_caract=0,
+    Cv(start=70, fixed=false),
+    C1(h_vol(start=800e3), h(start=800e3)))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
+    Dc=0.016,
+    Lc=2.56,
+    PasL=0.027,
+    PasT=0.02338,
+    ec=2e-3,
+    Rv=1.130514,
+    Ns=10,
+    DpfCorr=1.1136,
+    cp=506,
+    rho=7780,
+    lambda=35,
+    COP0l(fixed=false) = 1.23,
+    C2ex(P(start=2220000)),
+    ntubes1=351,
+    ntubes2=351,
+    ntubes3=1319,
+    L3=26.4,
+    L2=13.2,
+    L1=13.2,
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1000.65e3), P(start=68.48e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      zl(fixed=true, start=0.43),
+      Kvl=1,
+      V=53,
+      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
+      Mp=53227,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      P(fixed=true, start=2216584),
+      hl(start=806345),
+      hv(start=1063490),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
+            519,519.4}),
+      Tp(start=509)),
+    Ce1(P(start=7100000)),
+    pipe_1(
+      z2=0.3,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000}),
+      Tp(start={500,501,502,503,504,505,506,507,508,510})),
+    pipe_2(
+      z2=0.4,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
+            6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    volumeD1(h(start=953939), P(start=6848000)),
+    volumeD(
+      h(start=812750),
+      dynamic_mass_balance=false,
+      P(start=6872000)),
+    P0c=2200000,
+    pipe_3(
+      steady_state=true,
+      mode=1,
+      z2=0.7,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+            492,492,492,492,132}),
+      advection=false,
+      inertia=true,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
+            6854000,6853000,6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4})))
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
+                         annotation (Placement(transformation(extent={{-99,-48},
+            {-79,-28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
+    C2(h_vol(start=927700), h(start=927700)))
+                         annotation (Placement(transformation(extent={{-80,34},
+            {-100,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
+                   annotation (Placement(transformation(extent={{-194,-8},{-172,
+            14}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
+                   annotation (Placement(transformation(extent={{-196,-88},{
+            -176,-68}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    P0=71.29e5,
+    h0=772.09e3,
+    T0=454.46,
+    option_temperature=1)
+    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
+        624.97; 300,624.97; 2000,-200; 3000,-200])
+                   annotation (Placement(transformation(extent={{-196,78},{-176,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
+        2000,3.e5])
+                   annotation (Placement(transformation(extent={{-194,154},{
+            -174,174}}, rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
+      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
+      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
+                          annotation (Placement(transformation(extent={{191,
+            -140},{169,-118}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
+    T(fixed=true, start=461.56),
+    Pm(start=2220000))   annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=650),
+    lambda(fixed=false) = 0.03,
+    L=48.72,
+    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
+        69.8e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-196,-154},{
+            -174,-132}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pression_eauA.y, sourceP1.IPressure)
+                                              annotation (Line(points={{-170.9,
+          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
+          -124,88},{-124,55},{-125,55}}));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
+         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
+  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
+    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
+          -111.8}}));
+  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
+    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics={
+        Text(
+          extent={{-130,218},{124,158}},
+          lineColor={0,0,255},
+          textString=
+               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-90,-188},{102,-220}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-202,-196},{-100,-210}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{-118,152},{-62,138}},
+          lineColor={0,0,255},
+          textString=
+               "Qmin = 0")}), experiment(StopTime=3000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end NegativeFlow;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo
index 7dfb88712429880b56843945f1ba626a00f30573..d046b36baa9f9fc03d3c68616d63bb3a2f49ebe1 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo
@@ -1,309 +1,309 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
-model ZeroFlow
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    P0=22.733e5,
-    h0=2650.6e3)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=2, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
-    Q(fixed=false, start=56),
-    Cvmax(fixed=false) = 354.534,
-    mode_caract=0,
-    Cv(start=70, fixed=false),
-    C1(h_vol(start=800e3), h(start=800e3)))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
-    Dc=0.016,
-    Lc=2.56,
-    PasL=0.027,
-    PasT=0.02338,
-    ec=2e-3,
-    Rv=1.130514,
-    Ns=10,
-    DpfCorr=1.1136,
-    cp=506,
-    rho=7780,
-    lambda=35,
-    COP0l(fixed=false) = 1.23,
-    C2ex(P(start=2220000)),
-    ntubes1=351,
-    ntubes2=351,
-    ntubes3=1319,
-    L3=26.4,
-    L2=13.2,
-    L1=13.2,
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1000.65e3), P(start=68.48e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      zl(fixed=true, start=0.43),
-      Kvl=1,
-      V=53,
-      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
-      Mp=53227,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      P(fixed=true, start=2216584),
-      hl(start=806345),
-      hv(start=1063490),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
-            519,519.4}),
-      Tp(start=509)),
-    Ce1(P(start=7100000)),
-    pipe_1(
-      z2=0.3,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000}),
-      Tp(start={500,501,502,503,504,505,506,507,508,510})),
-    pipe_2(
-      z2=0.4,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
-            6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    volumeD1(h(start=953939), P(start=6848000)),
-    volumeD(
-      h(start=812750),
-      dynamic_mass_balance=false,
-      P(start=6872000)),
-    P0c=2200000,
-    pipe_3(
-      steady_state=true,
-      mode=1,
-      z2=0.7,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-            492,492,492,492,132}),
-      advection=false,
-      inertia=true,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
-            6854000,6853000,6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4})))
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
-                         annotation (Placement(transformation(extent={{-99,-48},
-            {-79,-28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
-    C2(h_vol(start=927700), h(start=927700)))
-                         annotation (Placement(transformation(extent={{-80,34},
-            {-100,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
-                   annotation (Placement(transformation(extent={{-194,-8},{-172,
-            14}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
-                   annotation (Placement(transformation(extent={{-196,-88},{
-            -176,-68}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    P0=71.29e5,
-    h0=772.09e3,
-    T0=454.46,
-    option_temperature=1)
-    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
-        624.97; 300,624.97; 2000,0; 3000,0])
-                   annotation (Placement(transformation(extent={{-196,78},{-176,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
-        2000,3.e5])
-                   annotation (Placement(transformation(extent={{-194,154},{
-            -174,174}}, rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
-      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
-      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
-                          annotation (Placement(transformation(extent={{191,
-            -140},{169,-118}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
-    T(fixed=true, start=461.56),
-    Pm(start=2220000))   annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=650),
-    lambda(fixed=false) = 0.03,
-    L=48.72,
-    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
-        69.8e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-196,-154},{
-            -174,-132}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pression_eauA.y, sourceP1.IPressure)
-                                              annotation (Line(points={{-170.9,
-          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
-          -124,88},{-124,55},{-125,55}}));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
-         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
-  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
-    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
-          -111.8}}));
-  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
-    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics={
-        Text(
-          extent={{-130,218},{124,158}},
-          lineColor={0,0,255},
-          textString=
-               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-90,-188},{102,-220}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-202,-196},{-100,-210}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{-118,152},{-62,138}},
-          lineColor={0,0,255},
-          textString=
-               "Qmin = 0")}), experiment(StopTime=3000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end ZeroFlow;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
+model ZeroFlow
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    P0=22.733e5,
+    h0=2650.6e3)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=2, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
+    Q(fixed=false, start=56),
+    Cvmax(fixed=false) = 354.534,
+    mode_caract=0,
+    Cv(start=70, fixed=false),
+    C1(h_vol(start=800e3), h(start=800e3)))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
+    Dc=0.016,
+    Lc=2.56,
+    PasL=0.027,
+    PasT=0.02338,
+    ec=2e-3,
+    Rv=1.130514,
+    Ns=10,
+    DpfCorr=1.1136,
+    cp=506,
+    rho=7780,
+    lambda=35,
+    COP0l(fixed=false) = 1.23,
+    C2ex(P(start=2220000)),
+    ntubes1=351,
+    ntubes2=351,
+    ntubes3=1319,
+    L3=26.4,
+    L2=13.2,
+    L1=13.2,
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1000.65e3), P(start=68.48e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      zl(fixed=true, start=0.43),
+      Kvl=1,
+      V=53,
+      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
+      Mp=53227,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      P(fixed=true, start=2216584),
+      hl(start=806345),
+      hv(start=1063490),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
+            519,519.4}),
+      Tp(start=509)),
+    Ce1(P(start=7100000)),
+    pipe_1(
+      z2=0.3,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000}),
+      Tp(start={500,501,502,503,504,505,506,507,508,510})),
+    pipe_2(
+      z2=0.4,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
+            6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    volumeD1(h(start=953939), P(start=6848000)),
+    volumeD(
+      h(start=812750),
+      dynamic_mass_balance=false,
+      P(start=6872000)),
+    P0c=2200000,
+    pipe_3(
+      steady_state=true,
+      mode=1,
+      z2=0.7,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+            492,492,492,492,132}),
+      advection=false,
+      inertia=true,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
+            6854000,6853000,6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4})))
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
+                         annotation (Placement(transformation(extent={{-99,-48},
+            {-79,-28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
+    C2(h_vol(start=927700), h(start=927700)))
+                         annotation (Placement(transformation(extent={{-80,34},
+            {-100,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
+                   annotation (Placement(transformation(extent={{-194,-8},{-172,
+            14}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
+                   annotation (Placement(transformation(extent={{-196,-88},{
+            -176,-68}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    P0=71.29e5,
+    h0=772.09e3,
+    T0=454.46,
+    option_temperature=1)
+    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
+        624.97; 300,624.97; 2000,0; 3000,0])
+                   annotation (Placement(transformation(extent={{-196,78},{-176,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
+        2000,3.e5])
+                   annotation (Placement(transformation(extent={{-194,154},{
+            -174,174}}, rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
+      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
+      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
+                          annotation (Placement(transformation(extent={{191,
+            -140},{169,-118}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
+    T(fixed=true, start=461.56),
+    Pm(start=2220000))   annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=650),
+    lambda(fixed=false) = 0.03,
+    L=48.72,
+    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
+        69.8e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-196,-154},{
+            -174,-132}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pression_eauA.y, sourceP1.IPressure)
+                                              annotation (Line(points={{-170.9,
+          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
+          -124,88},{-124,55},{-125,55}}));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
+         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
+  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
+    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
+          -111.8}}));
+  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
+    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics={
+        Text(
+          extent={{-130,218},{124,158}},
+          lineColor={0,0,255},
+          textString=
+               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-90,-188},{102,-220}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-202,-196},{-100,-210}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{-118,152},{-62,138}},
+          lineColor={0,0,255},
+          textString=
+               "Qmin = 0")}), experiment(StopTime=3000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end ZeroFlow;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.mo
index ef6a3c90039bcaf53cbe9957925003397666fce7..d8b3e3e7b1c9ba7ac448586239dbf0dd58d30561 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
-package DynamicWaterHeater
-
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>The models in this package are documented in Sect. 9.5.2.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"),
-         Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end DynamicWaterHeater;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
+package DynamicWaterHeater
+
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>The models in this package are documented in Sect. 9.5.2.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"),
+         Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end DynamicWaterHeater;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.order
index 64770142c3f866d91b6b7fa9fa5424ccb708d7b2..04139c4f7ed7bee6668cdbeda4eeeccc79fe60df 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.order
@@ -1,3 +1,3 @@
-Islanding
-NegativeFlow
-ZeroFlow
+Islanding
+NegativeFlow
+ZeroFlow
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo
index 56d8dd6f7f187efa526bc702478b15c8f3773fbd..4d0a2c9870d4229ac2f36898f5e396f062d16b6c 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo
@@ -1,199 +1,199 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
-model TestDynamicCondenser
-
-  parameter Real COP1( fixed=false,start=0.7)
-    "Corrective terme for heat exchange coefficient or Fouling coefficient";
-
-  //parameter Modelica.SIunits.MassFlowRate QCRF = 20000 "CRF mass flow rate";
-  //parameter Modelica.SIunits.Position z=1.05 "Liquid level in Cavity";
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ Source_Eau(
-                h0=50000, Q0=19000)
-          annotation (Placement(transformation(extent={{-191,-27},{-133,29}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ Source_vapeur(Q0=310, h0=
-        2400e3)
-            annotation (Placement(transformation(extent={{-192,144},{-134,200}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ Puit_condenseur1(Q0=310)
-             annotation (Placement(transformation(extent={{151,-187},{213,-133}},
-          rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicCondenser DynamicCondenser(
-    Dc=0.016,
-    ec=0.5e-3,
-    ntubest=52176,
-    cp=506,
-    rho=7780,
-    lambda=20,
-    Ns=5,
-    Rv=8.15,
-    Vf0=140/2500,
-    Lv=12,
-    L2=12,
-    Ce2(h_vol(fixed=false, start=55390), h(fixed=false, start=55390)),
-    ntubesV=223,
-    pipe_3(
-      mode=1,
-      dynamic_mass_balance=false,
-      inertia=false,
-      simplified_dynamic_energy_balance=true,
-      C2(h(start=55390, fixed=false)),
-      P(start={110000,109000,108000,107000,106000,105000,104000}),
-      h(start={50000,65000,80000,95000,115000,140000,160000})),
-    P0c=3199.2,
-    DynamicCondenser(
-      steady_state=true,
-      Cal_hcond=true,
-      Mp=50e3,
-      Vertical=true,
-      Kpa=0.01,
-      zl(fixed=false, start=0.65),
-      Qcond(start=380),
-      hl(start=105e3),
-      hcond=2e3,
-      COP=COP1,
-      hv(start=115.1e3),
-      P(fixed=true, start=3199.2)))
-                annotation (Placement(transformation(extent={{-47,-52},{71,64}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_Eau(
-    option_temperature=2,
-    mode=0,
-    P0=100000)
-             annotation (Placement(transformation(extent={{181,-8},{201,12}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    PressureLoss_VapeurIn(
-    Q(start=900),
-    K=1e-4,
-    Pm(start=10000))      annotation (Placement(transformation(extent={{-100,
-            162},{-80,182}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve_ext(
-    mode=1,
-    Q(fixed=false, start=927),
-    C1(P(start=10000), Q(start=927)),
-    Cvmax=15000,
-    Pm(start=10000))      annotation (                          Placement(
-        transformation(extent={{50,-164},{70,-144}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.8)
-                          annotation (Placement(transformation(extent={{113,
-            -123},{91,-101}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    PressureLoss_VapeurIn_in4(K=1e-4, Q(fixed=false, start=0.01))
-                         annotation (Placement(transformation(extent={{-102,83},
-            {-82,102}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ Source_Vsup1(Q0=0.00001,
-      h0=2759.6e3)
-          annotation (                           Placement(transformation(
-          extent={{-191,65},{-134,119}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_BP(
-      Table=[0,310; 22,310; 24,150; 25,80; 28,15; 31,0.000001; 35,0.000001;
-        1000,0.000001])
-    annotation (Placement(transformation(extent={{-202,182},{-182,202}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    PressureLoss_EauOut(
-    K=1e-4,
-    Q(start=20000),
-    mode=1)              annotation (Placement(transformation(extent={{112,-8},
-            {132,12}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve PressureLoss_VapeurIn1(
-     Q(start=1000))       annotation (Placement(transformation(
-        origin={12,96},
-        extent={{-6,-9},{6,9}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_Eau(Table=[0,
-        19000; 8,3000; 9,1500; 9.6,0.000001; 100,0.000001])
-    annotation (Placement(transformation(extent={{-202,22},{-182,42}}, rotation=
-           0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_GCT1(Table=[0,
-        0.0001; 22,0.0001; 24,2.02; 25,100; 26,150; 28,300; 29.7,590; 30.2,600;
-        30.5,590; 31,570; 35,250; 40,100; 45,15; 47,0.000001; 200,0.000001;
-        1000,0.000001])
-    annotation (Placement(transformation(extent={{-202,110},{-182,130}},
-          rotation=0)));
-equation
-  connect(Source_vapeur.C, PressureLoss_VapeurIn.C1)
-                                               annotation (Line(
-      points={{-134,172},{-100,172}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(DynamicCondenser.C2ex, Valve_ext.C1)
-    annotation (Line(points={{12,-52},{12,-160},{50,-160}}, color={0,0,255}));
-  connect(Valve_ext.C2, Puit_condenseur1.C)
-    annotation (Line(points={{70,-160},{151,-160}}, color={0,0,255}));
-
-  connect(Source_Vsup1.C,PressureLoss_VapeurIn_in4. C1)
-                                           annotation (Line(
-      points={{-134,92},{-100,92},{-100,92.5},{-102,92.5}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(DynamicCondenser.Ce2, PressureLoss_EauOut.C1) annotation (Line(
-      points={{70.41,5.42},{112,5.42},{112,2}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(PressureLoss_EauOut.C2, Puit_Eau.C) annotation (Line(
-      points={{132,2},{181,2}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(DynamicCondenser.C1vap, PressureLoss_VapeurIn1.C2) annotation (Line(
-      points={{12,64},{12,90}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Source_vapeur.IMassFlow, Vapeur_BP.y)
-    annotation (Line(points={{-163,186},{-163,192},{-181,192}}, thickness=0.5));
-  connect(Source_Eau.C, DynamicCondenser.Ce1) annotation (Line(
-      points={{-133,1},{-49.5,1},{-49.5,5.42},{-47,5.42}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(DynamicCondenser.C2vap, PressureLoss_VapeurIn_in4.C2) annotation (
-      Line(
-      points={{-19.27,64},{-18,64},{-18,92.5},{-82,92.5}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Level.y, Valve_ext.Ouv)
-    annotation (Line(points={{89.9,-112},{60,-112},{60,-143}}));
-  connect(Debit_Eau.y, Source_Eau.IMassFlow)
-    annotation (Line(points={{-181,32},{-162,32},{-162,15}}, thickness=0.5));
-  connect(PressureLoss_VapeurIn.C2, PressureLoss_VapeurIn1.C1) annotation (Line(
-      points={{-80,172},{12,172},{12,102}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Source_Vsup1.IMassFlow, Vapeur_GCT1.y) annotation (Line(points={{
-          -162.5,105.5},{-162.5,120},{-181,120}}, thickness=0.5));
-  annotation (Diagram(graphics,
-                      coordinateSystem(preserveAspectRatio=false,extent={{-200,
-            -200},{200,200}})),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-        info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 9.5.4.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    experiment(StopTime=500),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestDynamicCondenser;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
+model TestDynamicCondenser
+
+  parameter Real COP1( fixed=false,start=0.7)
+    "Corrective terme for heat exchange coefficient or Fouling coefficient";
+
+  //parameter Modelica.SIunits.MassFlowRate QCRF = 20000 "CRF mass flow rate";
+  //parameter Modelica.SIunits.Position z=1.05 "Liquid level in Cavity";
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ Source_Eau(
+                h0=50000, Q0=19000)
+          annotation (Placement(transformation(extent={{-191,-27},{-133,29}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ Source_vapeur(Q0=310, h0=
+        2400e3)
+            annotation (Placement(transformation(extent={{-192,144},{-134,200}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ Puit_condenseur1(Q0=310)
+             annotation (Placement(transformation(extent={{151,-187},{213,-133}},
+          rotation=0)));
+
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicCondenser DynamicCondenser(
+    Dc=0.016,
+    ec=0.5e-3,
+    ntubest=52176,
+    cp=506,
+    rho=7780,
+    lambda=20,
+    Ns=5,
+    Rv=8.15,
+    Vf0=140/2500,
+    Lv=12,
+    L2=12,
+    Ce2(h_vol(fixed=false, start=55390), h(fixed=false, start=55390)),
+    ntubesV=223,
+    pipe_3(
+      mode=1,
+      dynamic_mass_balance=false,
+      inertia=false,
+      simplified_dynamic_energy_balance=true,
+      C2(h(start=55390, fixed=false)),
+      P(start={110000,109000,108000,107000,106000,105000,104000}),
+      h(start={50000,65000,80000,95000,115000,140000,160000})),
+    P0c=3199.2,
+    DynamicCondenser(
+      steady_state=true,
+      Cal_hcond=true,
+      Mp=50e3,
+      Vertical=true,
+      Kpa=0.01,
+      zl(fixed=false, start=0.65),
+      Qcond(start=380),
+      hl(start=105e3),
+      hcond=2e3,
+      COP=COP1,
+      hv(start=115.1e3),
+      P(fixed=true, start=3199.2)))
+                annotation (Placement(transformation(extent={{-47,-52},{71,64}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_Eau(
+    option_temperature=2,
+    mode=0,
+    P0=100000)
+             annotation (Placement(transformation(extent={{181,-8},{201,12}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    PressureLoss_VapeurIn(
+    Q(start=900),
+    K=1e-4,
+    Pm(start=10000))      annotation (Placement(transformation(extent={{-100,
+            162},{-80,182}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve_ext(
+    mode=1,
+    Q(fixed=false, start=927),
+    C1(P(start=10000), Q(start=927)),
+    Cvmax=15000,
+    Pm(start=10000))      annotation (                          Placement(
+        transformation(extent={{50,-164},{70,-144}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.8)
+                          annotation (Placement(transformation(extent={{113,
+            -123},{91,-101}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    PressureLoss_VapeurIn_in4(K=1e-4, Q(fixed=false, start=0.01))
+                         annotation (Placement(transformation(extent={{-102,83},
+            {-82,102}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ Source_Vsup1(Q0=0.00001,
+      h0=2759.6e3)
+          annotation (                           Placement(transformation(
+          extent={{-191,65},{-134,119}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_BP(
+      Table=[0,310; 22,310; 24,150; 25,80; 28,15; 31,0.000001; 35,0.000001;
+        1000,0.000001])
+    annotation (Placement(transformation(extent={{-202,182},{-182,202}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    PressureLoss_EauOut(
+    K=1e-4,
+    Q(start=20000),
+    mode=1)              annotation (Placement(transformation(extent={{112,-8},
+            {132,12}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve PressureLoss_VapeurIn1(
+     Q(start=1000))       annotation (Placement(transformation(
+        origin={12,96},
+        extent={{-6,-9},{6,9}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_Eau(Table=[0,
+        19000; 8,3000; 9,1500; 9.6,0.000001; 100,0.000001])
+    annotation (Placement(transformation(extent={{-202,22},{-182,42}}, rotation=
+           0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_GCT1(Table=[0,
+        0.0001; 22,0.0001; 24,2.02; 25,100; 26,150; 28,300; 29.7,590; 30.2,600;
+        30.5,590; 31,570; 35,250; 40,100; 45,15; 47,0.000001; 200,0.000001;
+        1000,0.000001])
+    annotation (Placement(transformation(extent={{-202,110},{-182,130}},
+          rotation=0)));
+equation
+  connect(Source_vapeur.C, PressureLoss_VapeurIn.C1)
+                                               annotation (Line(
+      points={{-134,172},{-100,172}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(DynamicCondenser.C2ex, Valve_ext.C1)
+    annotation (Line(points={{12,-52},{12,-160},{50,-160}}, color={0,0,255}));
+  connect(Valve_ext.C2, Puit_condenseur1.C)
+    annotation (Line(points={{70,-160},{151,-160}}, color={0,0,255}));
+
+  connect(Source_Vsup1.C,PressureLoss_VapeurIn_in4. C1)
+                                           annotation (Line(
+      points={{-134,92},{-100,92},{-100,92.5},{-102,92.5}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(DynamicCondenser.Ce2, PressureLoss_EauOut.C1) annotation (Line(
+      points={{70.41,5.42},{112,5.42},{112,2}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(PressureLoss_EauOut.C2, Puit_Eau.C) annotation (Line(
+      points={{132,2},{181,2}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(DynamicCondenser.C1vap, PressureLoss_VapeurIn1.C2) annotation (Line(
+      points={{12,64},{12,90}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Source_vapeur.IMassFlow, Vapeur_BP.y)
+    annotation (Line(points={{-163,186},{-163,192},{-181,192}}, thickness=0.5));
+  connect(Source_Eau.C, DynamicCondenser.Ce1) annotation (Line(
+      points={{-133,1},{-49.5,1},{-49.5,5.42},{-47,5.42}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(DynamicCondenser.C2vap, PressureLoss_VapeurIn_in4.C2) annotation (
+      Line(
+      points={{-19.27,64},{-18,64},{-18,92.5},{-82,92.5}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Level.y, Valve_ext.Ouv)
+    annotation (Line(points={{89.9,-112},{60,-112},{60,-143}}));
+  connect(Debit_Eau.y, Source_Eau.IMassFlow)
+    annotation (Line(points={{-181,32},{-162,32},{-162,15}}, thickness=0.5));
+  connect(PressureLoss_VapeurIn.C2, PressureLoss_VapeurIn1.C1) annotation (Line(
+      points={{-80,172},{12,172},{12,102}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Source_Vsup1.IMassFlow, Vapeur_GCT1.y) annotation (Line(points={{
+          -162.5,105.5},{-162.5,120},{-181,120}}, thickness=0.5));
+  annotation (Diagram(graphics,
+                      coordinateSystem(preserveAspectRatio=false,extent={{-200,
+            -200},{200,200}})),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+        info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 9.5.4.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    experiment(StopTime=500),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestDynamicCondenser;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo
index 24aad9d48f4b0af2f22e0964246364f079948376..c9834c7221c472305db3fdab76c5c6174514d1a8 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo
@@ -1,83 +1,83 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
-model TestDynamicOnePhaseFlowShell
-
-  WaterSteam.HeatExchangers.DynamicOnePhaseFlowShell
-    dynamicOnePhaseFlowPipeShell(
-    Q(start={30,30,30,30,30,30,30,30,30,30,30}),
-    Ds=1,
-    ntubes=520,
-    L=12,
-    P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000,
-          1973000,1965000,1955000,1950000})) annotation (Placement(
-        transformation(extent={{-48,-36},{48,36}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(option_temperature=2, P0(fixed=
-         false) = 1900000)
-                 annotation (Placement(transformation(extent={{74,-15},{102,15}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    h0=600e3,
-    Q(start=500, fixed=true),
-    P0=2000000)
-             annotation (Placement(transformation(extent={{-103,-15},{-75,15}},
-          rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    lambda=10,
-    Ns=10,
-    cpw=460,
-    rhow=7900,
-    D=0.017,
-    e=0.002,
-    ntubes=520,
-    L=12) annotation (Placement(transformation(extent={{-54,30},{54,58}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    option_temperature=2,
-    W0={-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6},
-    T0={300,300,300,300,300,300,300,300,300,300})
-                  annotation (Placement(transformation(extent={{-12,76},{12,98}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Initialvalue=20e5,
-    Starttime=300,
-    Duration=600,
-    Finalvalue=19.8e5)
-                     annotation (Placement(transformation(extent={{-100,32},{
-            -80,52}}, rotation=0)));
-equation
-  connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1)
-    annotation (Line(points={{-75,0},{-48,0}}, color={0,0,255}));
-  connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C)
-    annotation (Line(points={{48,0},{74,0}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh)
-    annotation (Line(points={{0,41.2},{0,10.8}}, color={191,95,0}));
-  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,
-          76.22},{0,46.8}}, color={191,95,0}));
-  connect(rampe.y, sourceP.IPressure)
-    annotation (Line(points={{-79,42},{-70,42},{-70,24},{-98,24},{-98,0},{-96,0}}));
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 9.4.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    experiment(StopTime=2000));
-end TestDynamicOnePhaseFlowShell;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
+model TestDynamicOnePhaseFlowShell
+
+  WaterSteam.HeatExchangers.DynamicOnePhaseFlowShell
+    dynamicOnePhaseFlowPipeShell(
+    Q(start={30,30,30,30,30,30,30,30,30,30,30}),
+    Ds=1,
+    ntubes=520,
+    L=12,
+    P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000,
+          1973000,1965000,1955000,1950000})) annotation (Placement(
+        transformation(extent={{-48,-36},{48,36}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(option_temperature=2, P0(fixed=
+         false) = 1900000)
+                 annotation (Placement(transformation(extent={{74,-15},{102,15}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    h0=600e3,
+    Q(start=500, fixed=true),
+    P0=2000000)
+             annotation (Placement(transformation(extent={{-103,-15},{-75,15}},
+          rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    lambda=10,
+    Ns=10,
+    cpw=460,
+    rhow=7900,
+    D=0.017,
+    e=0.002,
+    ntubes=520,
+    L=12) annotation (Placement(transformation(extent={{-54,30},{54,58}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    option_temperature=2,
+    W0={-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6},
+    T0={300,300,300,300,300,300,300,300,300,300})
+                  annotation (Placement(transformation(extent={{-12,76},{12,98}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Initialvalue=20e5,
+    Starttime=300,
+    Duration=600,
+    Finalvalue=19.8e5)
+                     annotation (Placement(transformation(extent={{-100,32},{
+            -80,52}}, rotation=0)));
+equation
+  connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1)
+    annotation (Line(points={{-75,0},{-48,0}}, color={0,0,255}));
+  connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C)
+    annotation (Line(points={{48,0},{74,0}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh)
+    annotation (Line(points={{0,41.2},{0,10.8}}, color={191,95,0}));
+  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,
+          76.22},{0,46.8}}, color={191,95,0}));
+  connect(rampe.y, sourceP.IPressure)
+    annotation (Line(points={{-79,42},{-70,42},{-70,24},{-98,24},{-98,0},{-96,0}}));
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 9.4.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    experiment(StopTime=2000));
+end TestDynamicOnePhaseFlowShell;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo
index 5f72eb5d16d62472ac1122e4b42e30637da3a234..c2ddf30caa2b195d9c056abb2e16964c4c140fa3 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo
@@ -1,64 +1,64 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
-model TestDynamicPlateHeatExchanger
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterWaterExchanger
-    echangeurAPlaques1D1(
-    modec=1,
-    modef=1,
-    N=5,
-    Sc(Q(fixed=true, start=1036)))
-         annotation (Placement(transformation(extent={{-14,6},{6,26}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(T0=340)
-    annotation (Placement(transformation(extent={{-74,6},{-54,26}},   rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
-                                            annotation (Placement(
-        transformation(extent={{-54,-14},{-34,6}},   rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2(P0(fixed=false)=
-      100000)                            annotation (Placement(transformation(
-          extent={{46,6},{66,26}},   rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP3
-                                          annotation (Placement(transformation(
-          extent={{26,-14},{46,6}},   rotation=0)));
-equation
-  connect(sourceP2.C, echangeurAPlaques1D1.Ec)
-    annotation (Line(points={{-54,16},{-14,16}},   color={0,0,255}));
-  connect(sourceP3.C, echangeurAPlaques1D1.Ef)
-                                              annotation (Line(points={{-34,-4},
-          {-9,-4},{-9,10}},     color={0,0,255}));
-  connect(echangeurAPlaques1D1.Sc, puitsP2.C)
-                                            annotation (Line(points={{6,16},{46,
-          16}},     color={0,0,255}));
-  connect(echangeurAPlaques1D1.Sf, puitsP3.C)
-                                             annotation (Line(points={{1,10},{0,
-          10},{0,-4},{26,-4}},         color={0,0,255}));
-  annotation (Diagram(graphics={Text(
-          extent={{72,24},{92,6}},
-          lineColor={0,0,255},
-          textString=
-               "Qc=true")}), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 9.6.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestDynamicPlateHeatExchanger;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
+model TestDynamicPlateHeatExchanger
+
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterWaterExchanger
+    echangeurAPlaques1D1(
+    modec=1,
+    modef=1,
+    N=5,
+    Sc(Q(fixed=true, start=1036)))
+         annotation (Placement(transformation(extent={{-14,6},{6,26}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(T0=340)
+    annotation (Placement(transformation(extent={{-74,6},{-54,26}},   rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
+                                            annotation (Placement(
+        transformation(extent={{-54,-14},{-34,6}},   rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2(P0(fixed=false)=
+      100000)                            annotation (Placement(transformation(
+          extent={{46,6},{66,26}},   rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP3
+                                          annotation (Placement(transformation(
+          extent={{26,-14},{46,6}},   rotation=0)));
+equation
+  connect(sourceP2.C, echangeurAPlaques1D1.Ec)
+    annotation (Line(points={{-54,16},{-14,16}},   color={0,0,255}));
+  connect(sourceP3.C, echangeurAPlaques1D1.Ef)
+                                              annotation (Line(points={{-34,-4},
+          {-9,-4},{-9,10}},     color={0,0,255}));
+  connect(echangeurAPlaques1D1.Sc, puitsP2.C)
+                                            annotation (Line(points={{6,16},{46,
+          16}},     color={0,0,255}));
+  connect(echangeurAPlaques1D1.Sf, puitsP3.C)
+                                             annotation (Line(points={{1,10},{0,
+          10},{0,-4},{26,-4}},         color={0,0,255}));
+  annotation (Diagram(graphics={Text(
+          extent={{72,24},{92,6}},
+          lineColor={0,0,255},
+          textString=
+               "Qc=true")}), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 9.6.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestDynamicPlateHeatExchanger;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo
index 825e596e636da237ff999ce11d4f8eb498b9dc46..9d1220508dde10122b1262d7baae3fa4f48f5984 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo
@@ -1,86 +1,86 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
-model TestDynamicTwoPhaseFlowPipe
-
-  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(
-    L=10,
-    D=0.03,
-    dpfCorr(fixed=false,
-      start=0.23963336533422905)=
-                           1,
-    P(start={2000000.0,1999571.707027408,1999140.94021676,1998707.6248918818,
-          1998271.6837222823,1997833.0364982954,1997391.599890757,
-          1996715.8221090273,1995640.018272837,1994163.014585635,
-          1992283.4952231126,1990000.0}))
-                            annotation (Placement(transformation(extent={{-40,-48},
-            {40,10}},      rotation=0)));
-  WaterSteam.BoundaryConditions.SourceP sourceP1(
-    C(Q(fixed=true, start=1)),
-    option_temperature=2,
-    mode=0,
-    h0=800e3,
-    P0=2000000)
-    annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=
-            0)));
-  WaterSteam.BoundaryConditions.SinkP sinkP1(
-    option_temperature=2,
-    h0=2000e3,
-    mode=0,
-    P0=19.9e5)
-    annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0)));
-  Thermal.BoundaryConditions.HeatSource heatSource1(
-    option_temperature=2,
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4})
-    annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(            Ns=10,
-    L=10,
-    lambda=10,
-    cpw=460,
-    rhow=7900,
-    e=0.005,
-    D=0.03)
-    annotation (Placement(transformation(extent={{-40,-28},{40,52}},rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Initialvalue=20e5,
-    Starttime=300,
-    Duration=600,
-    Finalvalue=19.8e5)
-                     annotation (Placement(transformation(extent={{-74,-4},{-86,
-            7}}, rotation=0)));
-equation
-  connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1) annotation (Line(points={{-70,-18},
-          {-42,-18},{-42,-22},{-42,-20},{-42,-19},{-40,-19}},          color={0,
-          0,255}));
-  connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C) annotation (Line(points={{40,-19},
-          {40,-19},{40,-18},{70,-18}},      color={0,0,255}));
-  connect(heatSource1.C, heatExchangerWall1.WT2)
-    annotation (Line(points={{0,31.2},{0,18},{0,20}},    color={191,95,0}));
-  connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh)
-    annotation (Line(points={{0,4},{0,-10.3}},   color={191,95,0}));
-  connect(rampe.y, sourceP1.IPressure)
-    annotation (Line(points={{-86.6,1.5},{-92,1.5},{-92,-18},{-85,-18}}));
-  annotation (experiment(StopTime=1500), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 9.4.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestDynamicTwoPhaseFlowPipe;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
+model TestDynamicTwoPhaseFlowPipe
+
+  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(
+    L=10,
+    D=0.03,
+    dpfCorr(fixed=false,
+      start=0.23963336533422905)=
+                           1,
+    P(start={2000000.0,1999571.707027408,1999140.94021676,1998707.6248918818,
+          1998271.6837222823,1997833.0364982954,1997391.599890757,
+          1996715.8221090273,1995640.018272837,1994163.014585635,
+          1992283.4952231126,1990000.0}))
+                            annotation (Placement(transformation(extent={{-40,-48},
+            {40,10}},      rotation=0)));
+  WaterSteam.BoundaryConditions.SourceP sourceP1(
+    C(Q(fixed=true, start=1)),
+    option_temperature=2,
+    mode=0,
+    h0=800e3,
+    P0=2000000)
+    annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=
+            0)));
+  WaterSteam.BoundaryConditions.SinkP sinkP1(
+    option_temperature=2,
+    h0=2000e3,
+    mode=0,
+    P0=19.9e5)
+    annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0)));
+  Thermal.BoundaryConditions.HeatSource heatSource1(
+    option_temperature=2,
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4})
+    annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(            Ns=10,
+    L=10,
+    lambda=10,
+    cpw=460,
+    rhow=7900,
+    e=0.005,
+    D=0.03)
+    annotation (Placement(transformation(extent={{-40,-28},{40,52}},rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Initialvalue=20e5,
+    Starttime=300,
+    Duration=600,
+    Finalvalue=19.8e5)
+                     annotation (Placement(transformation(extent={{-74,-4},{-86,
+            7}}, rotation=0)));
+equation
+  connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1) annotation (Line(points={{-70,-18},
+          {-42,-18},{-42,-22},{-42,-20},{-42,-19},{-40,-19}},          color={0,
+          0,255}));
+  connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C) annotation (Line(points={{40,-19},
+          {40,-19},{40,-18},{70,-18}},      color={0,0,255}));
+  connect(heatSource1.C, heatExchangerWall1.WT2)
+    annotation (Line(points={{0,31.2},{0,18},{0,20}},    color={191,95,0}));
+  connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh)
+    annotation (Line(points={{0,4},{0,-10.3}},   color={191,95,0}));
+  connect(rampe.y, sourceP1.IPressure)
+    annotation (Line(points={{-86.6,1.5},{-92,1.5},{-92,-18},{-85,-18}}));
+  annotation (experiment(StopTime=1500), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 9.4.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestDynamicTwoPhaseFlowPipe;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo
index 24c6fd9fc512865ea4af67c23042f88f934a99e9..813b8152cf20c76158ae1aee14e1be9a64316c9e 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo
@@ -1,119 +1,119 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
-model TestNTUWaterHeater
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Water_inlet1(
-    Q0=1788.90,
-    h0=760.83e3,
-    P0=8270000)
-          annotation (Placement(transformation(extent={{-174,-16},{-154,4}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2
-             annotation (Placement(transformation(extent={{137,-16},{157,4}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP Steam_inlet1(
-    option_temperature=2,
-    mode=0,
-    P0=17.49e5,
-    h0=2432.50e3)
-            annotation (Placement(transformation(extent={{-174,84},{-154,104}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss6(K=1e-4)
-                          annotation (Placement(transformation(extent={{-111,
-            -16},{-91,4}},     rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss7(K=1e-4)
-                          annotation (Placement(transformation(extent={{-110,84},
-            {-90,104}},      rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur3
-             annotation (Placement(transformation(extent={{136,-75},{156,-55}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss8(K=1e-4)
-                          annotation (Placement(transformation(extent={{75,-16},
-            {95,4}},    rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss9(K=1e-4)
-                          annotation (Placement(transformation(extent={{75,-75},
-            {95,-55}},  rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating1(
-    HeiF(start=900000),
-    HDesF(start=900000),
-    Hep(start=500000),
-    SCondDes=5752,
-    Ee(
-      P(start=82e5),
-      h_vol(start=760000),
-      Q(start=1790),
-      h(start=780000)),
-    Ep(Q(start=118)),
-    Ev(P(start=27.22e5), h_vol(start=2430000)),
-    KCond(fixed=false) = 5024,
-    KPurge(fixed=false) = 1767,
-    Sp(h_vol(start=780.13e3), h(fixed=true, start=780.13e3)),
-    lambdaE(fixed=false) = 67.1,
-    SPurge=1458,
-    Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true)))
-                      annotation (Placement(transformation(extent={{-66,-77},{
-            50,65}},  rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss10(
-                          K=1e-4)
-                          annotation (Placement(transformation(extent={{-110,35},
-            {-90,55}},       rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Drain_inlet1(
-    P0=27.79e5,
-    Q0=118.02,
-    h0=889.89e3)
-          annotation (Placement(transformation(extent={{-174,35},{-154,55}},
-          rotation=0)));
-equation
-  connect(Water_inlet1.C, singularPressureLoss6.C1)
-    annotation (Line(points={{-154,-6},{-111,-6}},     color={0,0,255}));
-  connect(Steam_inlet1.C, singularPressureLoss7.C1)
-    annotation (Line(points={{-154,94},{-110,94}},   color={0,0,255}));
-  connect(singularPressureLoss8.C2, Puit_condenseur2.C)
-    annotation (Line(points={{95,-6},{137,-6}},     color={0,0,255}));
-  connect(singularPressureLoss9.C2,Puit_condenseur3. C)
-    annotation (Line(points={{95,-65},{136,-65}},   color={0,0,255}));
-  connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev)
-                                                        annotation (Line(points={{-90,94},
-          {26.8,94},{26.8,16.72}},              color={0,0,255}));
-  connect(nTUWaterHeating1.Se, singularPressureLoss8.C1)
-    annotation (Line(points={{50,-6},{75,-6}},     color={0,0,255}));
-  connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp)
-    annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}));
-  connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee)
-    annotation (Line(points={{-91,-6},{-67.16,-6}},     color={0,0,255}));
-  connect(Drain_inlet1.C, singularPressureLoss10.C1)
-    annotation (Line(points={{-154,45},{-110,45}},   color={0,0,255}));
-  connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep)
-                                                        annotation (Line(points={{-90,45},
-          {-42.8,45},{-42.8,18.14}},              color={0,0,255}));
-  annotation (Diagram(graphics,
-                      coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 9.5.5.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestNTUWaterHeater;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
+model TestNTUWaterHeater
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Water_inlet1(
+    Q0=1788.90,
+    h0=760.83e3,
+    P0=8270000)
+          annotation (Placement(transformation(extent={{-174,-16},{-154,4}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2
+             annotation (Placement(transformation(extent={{137,-16},{157,4}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP Steam_inlet1(
+    option_temperature=2,
+    mode=0,
+    P0=17.49e5,
+    h0=2432.50e3)
+            annotation (Placement(transformation(extent={{-174,84},{-154,104}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss6(K=1e-4)
+                          annotation (Placement(transformation(extent={{-111,
+            -16},{-91,4}},     rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss7(K=1e-4)
+                          annotation (Placement(transformation(extent={{-110,84},
+            {-90,104}},      rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur3
+             annotation (Placement(transformation(extent={{136,-75},{156,-55}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss8(K=1e-4)
+                          annotation (Placement(transformation(extent={{75,-16},
+            {95,4}},    rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss9(K=1e-4)
+                          annotation (Placement(transformation(extent={{75,-75},
+            {95,-55}},  rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating1(
+    HeiF(start=900000),
+    HDesF(start=900000),
+    Hep(start=500000),
+    SCondDes=5752,
+    Ee(
+      P(start=82e5),
+      h_vol(start=760000),
+      Q(start=1790),
+      h(start=780000)),
+    Ep(Q(start=118)),
+    Ev(P(start=27.22e5), h_vol(start=2430000)),
+    KCond(fixed=false) = 5024,
+    KPurge(fixed=false) = 1767,
+    Sp(h_vol(start=780.13e3), h(fixed=true, start=780.13e3)),
+    lambdaE(fixed=false) = 67.1,
+    SPurge=1458,
+    Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true)))
+                      annotation (Placement(transformation(extent={{-66,-77},{
+            50,65}},  rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss10(
+                          K=1e-4)
+                          annotation (Placement(transformation(extent={{-110,35},
+            {-90,55}},       rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Drain_inlet1(
+    P0=27.79e5,
+    Q0=118.02,
+    h0=889.89e3)
+          annotation (Placement(transformation(extent={{-174,35},{-154,55}},
+          rotation=0)));
+equation
+  connect(Water_inlet1.C, singularPressureLoss6.C1)
+    annotation (Line(points={{-154,-6},{-111,-6}},     color={0,0,255}));
+  connect(Steam_inlet1.C, singularPressureLoss7.C1)
+    annotation (Line(points={{-154,94},{-110,94}},   color={0,0,255}));
+  connect(singularPressureLoss8.C2, Puit_condenseur2.C)
+    annotation (Line(points={{95,-6},{137,-6}},     color={0,0,255}));
+  connect(singularPressureLoss9.C2,Puit_condenseur3. C)
+    annotation (Line(points={{95,-65},{136,-65}},   color={0,0,255}));
+  connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev)
+                                                        annotation (Line(points={{-90,94},
+          {26.8,94},{26.8,16.72}},              color={0,0,255}));
+  connect(nTUWaterHeating1.Se, singularPressureLoss8.C1)
+    annotation (Line(points={{50,-6},{75,-6}},     color={0,0,255}));
+  connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp)
+    annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}));
+  connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee)
+    annotation (Line(points={{-91,-6},{-67.16,-6}},     color={0,0,255}));
+  connect(Drain_inlet1.C, singularPressureLoss10.C1)
+    annotation (Line(points={{-154,45},{-110,45}},   color={0,0,255}));
+  connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep)
+                                                        annotation (Line(points={{-90,45},
+          {-42.8,45},{-42.8,18.14}},              color={0,0,255}));
+  annotation (Diagram(graphics,
+                      coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 9.5.5.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestNTUWaterHeater;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo
index 71382d4511e440df27efb3b0620933dbdcfe6617..a258d6a4737c7bff50c08ca8dda5e3a6e655f7f5 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo
@@ -1,117 +1,117 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
-model TestSimpleDynamicCondenser
-
-parameter Real L1 = 425 "Longueur de la première chaine de capteurs";
-parameter Integer Ns1 = 80
-    "Nombre de mailles de la première chaine de capteurs";
-
-parameter Real L2 = 75 "Longueur de la deuxième chaine de capteurs";
-parameter Integer Ns2 = 1 "Nombre de mailles de la deuxième chaine de capteurs";
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsPCaloporteur(
-                    mode=0, P0=1e5,
-    option_temperature=2) annotation (Placement(transformation(extent={{48,30},
-            {88,70}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe(                                                          K=1e-6, Q(start=
-          0.598447))
-    annotation (Placement(transformation(
-        origin={-90,-38},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceRechauffeurEau(
-    option_temperature=2,
-    h0=2401e3,
-    P0=15050)                   annotation (Placement(transformation(extent={{-207,
-            148},{-183,170}},      rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ PuitsRechauffeurEau(
-                  h0=191812, Q0=192)
-                          annotation (Placement(transformation(extent={{-184,
-            -52},{-208,-24}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourceQ sourcePCaloporteur(Q0=29804.5, h0=113e3)
-                                annotation (Placement(transformation(extent={{-212,30},
-            {-172,68}},          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe1(                                                         K=1e-6)
-    annotation (Placement(transformation(
-        origin={36,50},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe2(                                                         K=1e-6)
-    annotation (Placement(transformation(
-        origin={-154,49},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe3(K(fixed=false) = 1e-3, Q(start=192, fixed=true))
-    annotation (Placement(transformation(
-        origin={-120,159},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenseur(    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    yNiveau(signal(fixed=false, start=1.5)),
-    Vf0=0.15,
-    steady_state=false,
-    P(fixed=false, start=10000))
-                     annotation (Placement(transformation(extent={{-118,6},{1,
-            116}}, rotation=0)));
-equation
-
-  connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(
-        points={{-172,49},{-160,49}}, color={0,0,255}));
-  connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(
-        points={{42,50},{48,50}}, color={0,0,255}));
-  connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(
-        points={{-183,159},{-130,159}}, color={0,0,255}));
-  connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2)
-    annotation (Line(points={{-184,-38},{-100,-38}}));
-  connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{
-          -148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255}));
-  connect(PerteChargeCondPompe.C1, Condenseur.Cl)
-    annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}}));
-  connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{
-          -110,159},{-58.5,159},{-58.5,116}}, color={0,0,255}));
-  connect(PerteChargeCondPompe1.C1, Condenseur.Cse)
-    annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-60},{130,180}},
-        grid={2,2},
-        initialScale=0.1), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 9.5.3.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestSimpleDynamicCondenser;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
+model TestSimpleDynamicCondenser
+
+parameter Real L1 = 425 "Longueur de la première chaine de capteurs";
+parameter Integer Ns1 = 80
+    "Nombre de mailles de la première chaine de capteurs";
+
+parameter Real L2 = 75 "Longueur de la deuxième chaine de capteurs";
+parameter Integer Ns2 = 1 "Nombre de mailles de la deuxième chaine de capteurs";
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsPCaloporteur(
+                    mode=0, P0=1e5,
+    option_temperature=2) annotation (Placement(transformation(extent={{48,30},
+            {88,70}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe(                                                          K=1e-6, Q(start=
+          0.598447))
+    annotation (Placement(transformation(
+        origin={-90,-38},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceRechauffeurEau(
+    option_temperature=2,
+    h0=2401e3,
+    P0=15050)                   annotation (Placement(transformation(extent={{-207,
+            148},{-183,170}},      rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ PuitsRechauffeurEau(
+                  h0=191812, Q0=192)
+                          annotation (Placement(transformation(extent={{-184,
+            -52},{-208,-24}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourceQ sourcePCaloporteur(Q0=29804.5, h0=113e3)
+                                annotation (Placement(transformation(extent={{-212,30},
+            {-172,68}},          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe1(                                                         K=1e-6)
+    annotation (Placement(transformation(
+        origin={36,50},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe2(                                                         K=1e-6)
+    annotation (Placement(transformation(
+        origin={-154,49},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe3(K(fixed=false) = 1e-3, Q(start=192, fixed=true))
+    annotation (Placement(transformation(
+        origin={-120,159},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenseur(    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    yNiveau(signal(fixed=false, start=1.5)),
+    Vf0=0.15,
+    steady_state=false,
+    P(fixed=false, start=10000))
+                     annotation (Placement(transformation(extent={{-118,6},{1,
+            116}}, rotation=0)));
+equation
+
+  connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(
+        points={{-172,49},{-160,49}}, color={0,0,255}));
+  connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(
+        points={{42,50},{48,50}}, color={0,0,255}));
+  connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(
+        points={{-183,159},{-130,159}}, color={0,0,255}));
+  connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2)
+    annotation (Line(points={{-184,-38},{-100,-38}}));
+  connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{
+          -148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255}));
+  connect(PerteChargeCondPompe.C1, Condenseur.Cl)
+    annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}}));
+  connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{
+          -110,159},{-58.5,159},{-58.5,116}}, color={0,0,255}));
+  connect(PerteChargeCondPompe1.C1, Condenseur.Cse)
+    annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-60},{130,180}},
+        grid={2,2},
+        initialScale=0.1), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 9.5.3.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestSimpleDynamicCondenser;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo
index d3bcb42811dd912b1712bcb2d686eeb63ed58027..ef86da01af3efe020c29e32b2663f948fd014b95 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo
@@ -1,132 +1,132 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
-model TestStaticCondenser
-
-  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000)
-    "Flow pressure at inlet 1 (sourceP)";
-  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000)
-    "Flow pressure at inlet 2 (sourceP1)";
-  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000)
-    "Flow pressure at inlet 3 (sourceP2)";
-
-  WaterSteam.BoundaryConditions.SinkP Puit_condenseur(P0(fixed=false) = 100000)
-             annotation (Placement(transformation(extent={{158,-15},{178,5}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    P0=Pin_1,
-    C(Q(fixed=true, start=832.66)),
-    h0=2275.10e3)
-            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    option_temperature=2,
-    mode=0,
-    h0=2.5481e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_2)                     annotation (Placement(transformation(extent={
-            {-182,80},{-162,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
-    option_temperature=2,
-    mode=0,
-    h0=2.5055e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_3)                      annotation (Placement(transformation(extent=
-            {{-180,40},{-160,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss(K=10)
-                         annotation (Placement(transformation(extent={{-100,80},
-            {-80,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=10)
-                          annotation (Placement(transformation(extent={{-100,40},
-            {-80,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=10)
-                          annotation (Placement(transformation(extent={{-40,140},
-            {-20,160}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4)
-                          annotation (Placement(transformation(extent={{98,-15},
-            {118,5}},  rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4)
-                          annotation (Placement(transformation(extent={{40,-100},
-            {60,-80}}, rotation=0)));
-
-  WaterSteam.HeatExchangers.StaticCondenser              condenseur(
-    SCO=47786,
-    z=0,
-    mode_ee=1,
-    mode_se=1,
-    mode_ex=1,
-    CPCE=0,
-    KCO=3400.57,
-    QC0=37700)     annotation (Placement(transformation(
-          extent={{-24,-24},{68,74}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourceQ Source_condenseur(
-    h0=60e3,
-    C(P(fixed=true, start=328800)),
-    Q0(fixed=true) = 42261)
-          annotation (Placement(transformation(extent={{-189,-25},{-146,15}},
-          rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss              singularPressureLoss2(K=1e-3)
-                          annotation (Placement(transformation(extent={{-101,
-            -15},{-81,5}},
-                       rotation=0)));
-equation
-  connect(sourceP1.C, singularPressureLoss.C1)
-    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
-  connect(sourceP2.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, Puit_condenseur.C)
-    annotation (Line(points={{118,-5},{158,-5}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
-    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, condenseur.Cvt)
-    annotation (Line(points={{-20,150},{22,150},{22,74.49}}, color={0,0,255}));
-  connect(Source_condenseur.C,singularPressureLoss2. C1)
-    annotation (Line(points={{-146,-5},{-101,-5}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2,condenseur. Cee) annotation (Line(points={{-81,-5},
-          {-54,-5},{-54,-4.89},{-24,-4.89}},       color={0,0,255}));
-  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
-          -80,50},{-54,50},{-54,34.31},{-24,34.31}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
-          -80,90},{-62,90},{-40,90},{-40,54.89},{-24,54.89}}, color={0,0,255}));
-  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
-          68.92,-4.89},{83.46,-4.89},{83.46,-5},{98,-5}}, color={0,0,255}));
-  connect(condenseur.Cex, singularPressureLoss5.C1) annotation (Line(points={{
-          22.46,-24.98},{22.46,-90},{40,-90}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics,
-                                                 coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 9.7.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestStaticCondenser;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
+model TestStaticCondenser
+
+  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000)
+    "Flow pressure at inlet 1 (sourceP)";
+  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000)
+    "Flow pressure at inlet 2 (sourceP1)";
+  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000)
+    "Flow pressure at inlet 3 (sourceP2)";
+
+  WaterSteam.BoundaryConditions.SinkP Puit_condenseur(P0(fixed=false) = 100000)
+             annotation (Placement(transformation(extent={{158,-15},{178,5}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    P0=Pin_1,
+    C(Q(fixed=true, start=832.66)),
+    h0=2275.10e3)
+            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    option_temperature=2,
+    mode=0,
+    h0=2.5481e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_2)                     annotation (Placement(transformation(extent={
+            {-182,80},{-162,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
+    option_temperature=2,
+    mode=0,
+    h0=2.5055e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_3)                      annotation (Placement(transformation(extent=
+            {{-180,40},{-160,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss(K=10)
+                         annotation (Placement(transformation(extent={{-100,80},
+            {-80,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=10)
+                          annotation (Placement(transformation(extent={{-100,40},
+            {-80,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=10)
+                          annotation (Placement(transformation(extent={{-40,140},
+            {-20,160}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4)
+                          annotation (Placement(transformation(extent={{98,-15},
+            {118,5}},  rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4)
+                          annotation (Placement(transformation(extent={{40,-100},
+            {60,-80}}, rotation=0)));
+
+  WaterSteam.HeatExchangers.StaticCondenser              condenseur(
+    SCO=47786,
+    z=0,
+    mode_ee=1,
+    mode_se=1,
+    mode_ex=1,
+    CPCE=0,
+    KCO=3400.57,
+    QC0=37700)     annotation (Placement(transformation(
+          extent={{-24,-24},{68,74}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourceQ Source_condenseur(
+    h0=60e3,
+    C(P(fixed=true, start=328800)),
+    Q0(fixed=true) = 42261)
+          annotation (Placement(transformation(extent={{-189,-25},{-146,15}},
+          rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss              singularPressureLoss2(K=1e-3)
+                          annotation (Placement(transformation(extent={{-101,
+            -15},{-81,5}},
+                       rotation=0)));
+equation
+  connect(sourceP1.C, singularPressureLoss.C1)
+    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
+  connect(sourceP2.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, Puit_condenseur.C)
+    annotation (Line(points={{118,-5},{158,-5}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
+    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, condenseur.Cvt)
+    annotation (Line(points={{-20,150},{22,150},{22,74.49}}, color={0,0,255}));
+  connect(Source_condenseur.C,singularPressureLoss2. C1)
+    annotation (Line(points={{-146,-5},{-101,-5}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2,condenseur. Cee) annotation (Line(points={{-81,-5},
+          {-54,-5},{-54,-4.89},{-24,-4.89}},       color={0,0,255}));
+  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
+          -80,50},{-54,50},{-54,34.31},{-24,34.31}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
+          -80,90},{-62,90},{-40,90},{-40,54.89},{-24,54.89}}, color={0,0,255}));
+  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
+          68.92,-4.89},{83.46,-4.89},{83.46,-5},{98,-5}}, color={0,0,255}));
+  connect(condenseur.Cex, singularPressureLoss5.C1) annotation (Line(points={{
+          22.46,-24.98},{22.46,-90},{40,-90}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics,
+                                                 coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 9.7.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestStaticCondenser;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo
index 43d50a528e6dfe7a7f6ed0ecb347f64b5443f5d6..0bfbc5cfd6d49b226af09526dc1004d6f7bd6542 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo
@@ -1,90 +1,90 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
-model TestStaticPlateHeatExchanger
-
-  WaterSteam.HeatExchangers.StaticWaterWaterExchanger echangeurAPlaques1(
-    modec=1,
-    modef=1,
-    Sp=2,
-    Sc(Q(fixed=true, start=1036.78)))
-         annotation (Placement(transformation(extent={{-10,30},{10,50}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
-                                           T0=340)
-    annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
-                                            annotation (Placement(
-        transformation(extent={{-50,10},{-30,30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2(P0(fixed=false)=
-      100000)                            annotation (Placement(transformation(
-          extent={{50,30},{70,50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP3
-                                          annotation (Placement(transformation(
-          extent={{30,10},{50,30}}, rotation=0)));
-  WaterSteam.HeatExchangers.StaticWaterWaterExchanger echangeurAPlaques(modec=1,
-      modef=1) annotation (Placement(transformation(extent={{-10,-34},{10,-14}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SourceP              sourceP6(
-                                           T0=340)
-    annotation (Placement(transformation(extent={{-70,-34},{-50,-14}}, rotation=
-           0)));
-  WaterSteam.BoundaryConditions.SourceP              sourceP7
-                                            annotation (Placement(
-        transformation(extent={{-50,-54},{-30,-34}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP              puitsP6
-                                         annotation (Placement(transformation(
-          extent={{50,-34},{70,-14}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP              puitsP7
-                                          annotation (Placement(transformation(
-          extent={{30,-54},{50,-34}}, rotation=0)));
-equation
-  connect(sourceP2.C, echangeurAPlaques1.Ec)
-    annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255}));
-  connect(sourceP3.C, echangeurAPlaques1.Ef)  annotation (Line(points={{-30,20},
-          {-5,20},{-5,34}},   color={0,0,255}));
-  connect(echangeurAPlaques1.Sc, puitsP2.C) annotation (Line(points={{10,40.2},
-          {30,40.2},{30,40},{50,40}}, color={0,0,255}));
-  connect(echangeurAPlaques1.Sf, puitsP3.C)  annotation (Line(points={{5,34},{4,
-          34},{4,20},{30,20}},       color={0,0,255}));
-  connect(sourceP6.C, echangeurAPlaques.Ec)
-    annotation (Line(points={{-50,-24},{-10,-24}}, color={0,0,255}));
-  connect(sourceP7.C, echangeurAPlaques.Ef)
-    annotation (Line(points={{-30,-44},{-5,-44},{-5,-30}}, color={0,0,255}));
-  connect(echangeurAPlaques.Sc, puitsP6.C) annotation (Line(points={{10,-23.8},
-          {30,-23.8},{30,-24},{50,-24}}, color={0,0,255}));
-  connect(echangeurAPlaques.Sf, puitsP7.C) annotation (Line(points={{5,-30},{4,
-          -30},{4,-44},{30,-44}}, color={0,0,255}));
-  annotation (Diagram(graphics={
-        Text(
-          extent={{72,48},{92,30}},
-          lineColor={0,0,255},
-          textString=
-               "Qc=true"),
-        Text(
-          extent={{-28,-52},{26,-60}},
-          lineColor={0,0,255},
-          textString="Crossing error")}),
-                                        Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 9.6.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestStaticPlateHeatExchanger;
+within ThermoSysPro.Examples.Book.SimpleExamples.HeatExchanger;
+model TestStaticPlateHeatExchanger
+
+  WaterSteam.HeatExchangers.StaticWaterWaterExchanger echangeurAPlaques1(
+    modec=1,
+    modef=1,
+    Sp=2,
+    Sc(Q(fixed=true, start=1036.78)))
+         annotation (Placement(transformation(extent={{-10,30},{10,50}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
+                                           T0=340)
+    annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
+                                            annotation (Placement(
+        transformation(extent={{-50,10},{-30,30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2(P0(fixed=false)=
+      100000)                            annotation (Placement(transformation(
+          extent={{50,30},{70,50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP3
+                                          annotation (Placement(transformation(
+          extent={{30,10},{50,30}}, rotation=0)));
+  WaterSteam.HeatExchangers.StaticWaterWaterExchanger echangeurAPlaques(modec=1,
+      modef=1) annotation (Placement(transformation(extent={{-10,-34},{10,-14}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SourceP              sourceP6(
+                                           T0=340)
+    annotation (Placement(transformation(extent={{-70,-34},{-50,-14}}, rotation=
+           0)));
+  WaterSteam.BoundaryConditions.SourceP              sourceP7
+                                            annotation (Placement(
+        transformation(extent={{-50,-54},{-30,-34}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP              puitsP6
+                                         annotation (Placement(transformation(
+          extent={{50,-34},{70,-14}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP              puitsP7
+                                          annotation (Placement(transformation(
+          extent={{30,-54},{50,-34}}, rotation=0)));
+equation
+  connect(sourceP2.C, echangeurAPlaques1.Ec)
+    annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255}));
+  connect(sourceP3.C, echangeurAPlaques1.Ef)  annotation (Line(points={{-30,20},
+          {-5,20},{-5,34}},   color={0,0,255}));
+  connect(echangeurAPlaques1.Sc, puitsP2.C) annotation (Line(points={{10,40.2},
+          {30,40.2},{30,40},{50,40}}, color={0,0,255}));
+  connect(echangeurAPlaques1.Sf, puitsP3.C)  annotation (Line(points={{5,34},{4,
+          34},{4,20},{30,20}},       color={0,0,255}));
+  connect(sourceP6.C, echangeurAPlaques.Ec)
+    annotation (Line(points={{-50,-24},{-10,-24}}, color={0,0,255}));
+  connect(sourceP7.C, echangeurAPlaques.Ef)
+    annotation (Line(points={{-30,-44},{-5,-44},{-5,-30}}, color={0,0,255}));
+  connect(echangeurAPlaques.Sc, puitsP6.C) annotation (Line(points={{10,-23.8},
+          {30,-23.8},{30,-24},{50,-24}}, color={0,0,255}));
+  connect(echangeurAPlaques.Sf, puitsP7.C) annotation (Line(points={{5,-30},{4,
+          -30},{4,-44},{30,-44}}, color={0,0,255}));
+  annotation (Diagram(graphics={
+        Text(
+          extent={{72,48},{92,30}},
+          lineColor={0,0,255},
+          textString=
+               "Qc=true"),
+        Text(
+          extent={{-28,-52},{26,-60}},
+          lineColor={0,0,255},
+          textString="Crossing error")}),
+                                        Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 9.6.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestStaticPlateHeatExchanger;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/package.mo
index d8aae9d752f6f2950619734f0d0b7e33f3831110..1675fce0c02643f8ec93b29b7aaf607d4b1aa428 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package HeatExchanger "Heat exchanger modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end HeatExchanger;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package HeatExchanger "Heat exchanger modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end HeatExchanger;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/package.order
index c754feb7d3939a5db34a0c18a09d159d325eb2b4..7f3a864c294f252cb3160efb937e04832f86d11f 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/HeatExchanger/package.order
@@ -1,9 +1,9 @@
-TestDynamicTwoPhaseFlowPipe
-TestDynamicOnePhaseFlowShell
-DynamicWaterHeater
-TestSimpleDynamicCondenser
-TestDynamicCondenser
-TestNTUWaterHeater
-TestDynamicPlateHeatExchanger
-TestStaticPlateHeatExchanger
-TestStaticCondenser
+TestDynamicTwoPhaseFlowPipe
+TestDynamicOnePhaseFlowShell
+DynamicWaterHeater
+TestSimpleDynamicCondenser
+TestDynamicCondenser
+TestNTUWaterHeater
+TestDynamicPlateHeatExchanger
+TestStaticPlateHeatExchanger
+TestStaticCondenser
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo b/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo
index 505ce53ab02c5aaeecd111891a46040e3a319eab..3b603d85e27f1de83ba8140bbd0d366916826a56 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo
@@ -1,111 +1,111 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.InternalCombustionEngine;
-model TestInternalCombustionEngine
-  import ThermoSysPro;
-
-  parameter Integer NCEL = 7;
-
-  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Hum=0,
-    Xh=0.25,
-    Xs=0,
-    Xashes=0,
-    Xc=0.75,
-    Xo=0,
-    Xn=0,
-    Q0=0.0676,
-    rho=0.744,
-    LHV=50e6,
-    T0(displayUnit="K") = 299,
-    P0=210300,
-    Vol=100) annotation (Placement(transformation(extent={{-106,-79},{-72,-41}},
-          rotation=0)));
-  FlueGases.BoundaryConditions.SourcePQ sourceAir(
-    Xso2=0,
-    Xco2=0,
-    Xh2o=0.005,
-    Xo2=0.23,
-    Q0=1.9627,
-    P0=191000,
-    T0=30 + 273.16)
-    annotation (Placement(transformation(extent={{111,-77},{73,-43}},rotation=0)));
-  FlueGases.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{0,46},{44,88}},  rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ SourcePQ_Water(
-    Q0=15.3,
-    h0=334.41e3,
-    P0=410000)
-    annotation (Placement(transformation(extent={{-107,-17},{-71,17}},rotation=
-            0)));
-  MultiFluids.Machines.AlternatingEngine alternatingEngine(
-    mechanical_efficiency_type=2,
-    Rmeca_nom=0.41,
-    Coef_Rm_a=-5.4727e-9,
-    Coef_Rm_b=4.9359e-5,
-    Coef_Rm_c=0.30814,
-    Xpth=0.05,
-    MMg=20,
-    DPe=1,
-    RV=6.45,
-    Kc=1.28,
-    Kd=1.33,
-    Wmeca(start=1400e3),
-    Welec(start=1358e3),
-    Wcomb(start=3.4942e6),
-    exc(start=1.8),
-    Gamma=1.2085,
-    Tsf(start=1088.15))
-    annotation (Placement(transformation(extent={{-44,-44},{44,44}})));
-  WaterSteam.BoundaryConditions.Sink Sink_Water1 annotation (Placement(
-        transformation(extent={{75,-17},{111,17}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss
-    annotation (Placement(transformation(extent={{-63,-6},{-51,6}})));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1
-    annotation (Placement(transformation(extent={{51,-7},{65,7}})));
-equation
-  connect(alternatingEngine.Cair, sourceAir.C) annotation (Line(
-      points={{17.6,-39.6},{17.6,-60},{73,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(alternatingEngine.Cfuel, fuelSourcePQ.C) annotation (Line(points={{-17.6,
-          -39.6},{-17.6,-60},{-72,-60}}, color={0,0,0}));
-  connect(SourcePQ_Water.C, singularPressureLoss.C1)
-    annotation (Line(points={{-71,0},{-63,0}}, color={0,0,255}));
-  connect(alternatingEngine.Cws1, singularPressureLoss.C2) annotation (Line(
-        points={{-39.6,0},{-51,0}},                       color={0,0,255}));
-  connect(alternatingEngine.Cws2, singularPressureLoss1.C1)
-    annotation (Line(points={{39.6,0},{51,0}},           color={0,0,255}));
-  connect(Sink_Water1.C, singularPressureLoss1.C2)
-    annotation (Line(points={{75,0},{65,0}},           color={0,0,255}));
-  connect(alternatingEngine.Cfg, sink.C) annotation (Line(
-      points={{0,39.6},{0,67},{0.44,67}},
-      color={0,0,0},
-      thickness=1));
-  annotation (         Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 15.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestInternalCombustionEngine;
+within ThermoSysPro.Examples.Book.SimpleExamples.InternalCombustionEngine;
+model TestInternalCombustionEngine
+  import ThermoSysPro;
+
+  parameter Integer NCEL = 7;
+
+  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Hum=0,
+    Xh=0.25,
+    Xs=0,
+    Xashes=0,
+    Xc=0.75,
+    Xo=0,
+    Xn=0,
+    Q0=0.0676,
+    rho=0.744,
+    LHV=50e6,
+    T0(displayUnit="K") = 299,
+    P0=210300,
+    Vol=100) annotation (Placement(transformation(extent={{-106,-79},{-72,-41}},
+          rotation=0)));
+  FlueGases.BoundaryConditions.SourcePQ sourceAir(
+    Xso2=0,
+    Xco2=0,
+    Xh2o=0.005,
+    Xo2=0.23,
+    Q0=1.9627,
+    P0=191000,
+    T0=30 + 273.16)
+    annotation (Placement(transformation(extent={{111,-77},{73,-43}},rotation=0)));
+  FlueGases.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{0,46},{44,88}},  rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ SourcePQ_Water(
+    Q0=15.3,
+    h0=334.41e3,
+    P0=410000)
+    annotation (Placement(transformation(extent={{-107,-17},{-71,17}},rotation=
+            0)));
+  MultiFluids.Machines.AlternatingEngine alternatingEngine(
+    mechanical_efficiency_type=2,
+    Rmeca_nom=0.41,
+    Coef_Rm_a=-5.4727e-9,
+    Coef_Rm_b=4.9359e-5,
+    Coef_Rm_c=0.30814,
+    Xpth=0.05,
+    MMg=20,
+    DPe=1,
+    RV=6.45,
+    Kc=1.28,
+    Kd=1.33,
+    Wmeca(start=1400e3),
+    Welec(start=1358e3),
+    Wcomb(start=3.4942e6),
+    exc(start=1.8),
+    Gamma=1.2085,
+    Tsf(start=1088.15))
+    annotation (Placement(transformation(extent={{-44,-44},{44,44}})));
+  WaterSteam.BoundaryConditions.Sink Sink_Water1 annotation (Placement(
+        transformation(extent={{75,-17},{111,17}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss
+    annotation (Placement(transformation(extent={{-63,-6},{-51,6}})));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1
+    annotation (Placement(transformation(extent={{51,-7},{65,7}})));
+equation
+  connect(alternatingEngine.Cair, sourceAir.C) annotation (Line(
+      points={{17.6,-39.6},{17.6,-60},{73,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(alternatingEngine.Cfuel, fuelSourcePQ.C) annotation (Line(points={{-17.6,
+          -39.6},{-17.6,-60},{-72,-60}}, color={0,0,0}));
+  connect(SourcePQ_Water.C, singularPressureLoss.C1)
+    annotation (Line(points={{-71,0},{-63,0}}, color={0,0,255}));
+  connect(alternatingEngine.Cws1, singularPressureLoss.C2) annotation (Line(
+        points={{-39.6,0},{-51,0}},                       color={0,0,255}));
+  connect(alternatingEngine.Cws2, singularPressureLoss1.C1)
+    annotation (Line(points={{39.6,0},{51,0}},           color={0,0,255}));
+  connect(Sink_Water1.C, singularPressureLoss1.C2)
+    annotation (Line(points={{75,0},{65,0}},           color={0,0,255}));
+  connect(alternatingEngine.Cfg, sink.C) annotation (Line(
+      points={{0,39.6},{0,67},{0.44,67}},
+      color={0,0,0},
+      thickness=1));
+  annotation (         Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 15.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestInternalCombustionEngine;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/package.mo
index 207c2330be26fb538d58ef5cd0e24780ca4c6dfc..7e470cfca26de98ccc663922d2a78ce2d484b0a1 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package InternalCombustionEngine "Internal combustion engine modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 15 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end InternalCombustionEngine;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package InternalCombustionEngine "Internal combustion engine modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 15 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end InternalCombustionEngine;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/package.order
index fa6254a35d6235cd8271924df2597ebbd87bf0dd..a4fd463dc96ee495a49d3487aaf59abbc3bfa833 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/InternalCombustionEngine/package.order
@@ -1 +1 @@
-TestInternalCombustionEngine
+TestInternalCombustionEngine
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo
index 8e76163cb05b2d2193b456f52f0364adc87aef1b..f8ffe546b09e91502803f7b772b2aa841dba873b 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestBend
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-62,-6},{-42,14}},  rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP SinkP1
-                                          annotation (Placement(transformation(
-          extent={{41,-34},{61,-14}},
-                                   rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.Bend Bend   annotation (Placement(
-        transformation(extent={{-8,-6},{12,14}}, rotation=0)));
-equation
-  connect(Bend.C2, SinkP1.C)
-    annotation (Line(points={{2,-6},{2,-24},{41,-24}},   color={0,0,255}));
-  connect(SourceP1.C, Bend.C1)
-    annotation (Line(points={{-42,4},{-8,4}},    color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestBend;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestBend
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-62,-6},{-42,14}},  rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP SinkP1
+                                          annotation (Placement(transformation(
+          extent={{41,-34},{61,-14}},
+                                   rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.Bend Bend   annotation (Placement(
+        transformation(extent={{-8,-6},{12,14}}, rotation=0)));
+equation
+  connect(Bend.C2, SinkP1.C)
+    annotation (Line(points={{2,-6},{2,-24},{41,-24}},   color={0,0,255}));
+  connect(SourceP1.C, Bend.C1)
+    annotation (Line(points={{-42,4},{-8,4}},    color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestBend;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo
index 6fd15314c8c91682f504506006446c8268f9e084..6e83c696adf1b1bcc6a516185e6042cff1c0f983 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo
@@ -1,58 +1,58 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestCheckValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-40,-10},{-20,10}},  rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{40,-10},{60,10}},  rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    amplitude=6e5,
-    width=50,
-    period=100,
-    offset=3e5) annotation (Placement(transformation(extent={{-80,-10},{-60,10}},
-                   rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.CheckValve checkValve3
-    annotation (Placement(transformation(extent={{0,-10},{20,10}},   rotation=0)));
-equation
-  connect(sourceP1.C, checkValve3.C1)
-    annotation (Line(points={{-20,0},{-1,0}},      color={0,0,255}));
-  connect(checkValve3.C2, puitsP1.C)
-    annotation (Line(points={{21,0},{40,0}},    color={0,0,255}));
-  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-59,0},{-35,0}}));
-  annotation (experiment(StopTime=200),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.11.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestCheckValve;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestCheckValve
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-40,-10},{-20,10}},  rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{40,-10},{60,10}},  rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    amplitude=6e5,
+    width=50,
+    period=100,
+    offset=3e5) annotation (Placement(transformation(extent={{-80,-10},{-60,10}},
+                   rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.CheckValve checkValve3
+    annotation (Placement(transformation(extent={{0,-10},{20,10}},   rotation=0)));
+equation
+  connect(sourceP1.C, checkValve3.C1)
+    annotation (Line(points={{-20,0},{-1,0}},      color={0,0,255}));
+  connect(checkValve3.C2, puitsP1.C)
+    annotation (Line(points={{21,0},{40,0}},    color={0,0,255}));
+  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-59,0},{-35,0}}));
+  annotation (experiment(StopTime=200),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.11.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestCheckValve;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo
index d32e710ed53912d78d86d5d93cc069ebcbb50573..c9281c21749d479870288c190b7320f6467777ba 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo
@@ -1,59 +1,59 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestControlValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-64,-10},{-44,10}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{44,-10},{64,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve(mode_caract=1, caract=[
-        0,0; 0.5,3000; 0.75,7000; 1,8000])
-                                          annotation (Placement(transformation(
-          extent={{-10,-4},{10,16}},rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(           Table=[0,
-        0.9; 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2])
-    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
-equation
-  connect(ControlValve.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
-  connect(Constante1.y, ControlValve.Ouv)
-    annotation (Line(points={{-9,40},{0,40},{0,17}},      color={0,0,255}));
-  connect(SourceP1.C, ControlValve.C1)
-    annotation (Line(points={{-44,0},{-44,0},{-10,0}},
-                                                 color={0,0,255}));
-  annotation (experiment(StopTime=80),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.8.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestControlValve;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestControlValve
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-64,-10},{-44,10}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{44,-10},{64,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve(mode_caract=1, caract=[
+        0,0; 0.5,3000; 0.75,7000; 1,8000])
+                                          annotation (Placement(transformation(
+          extent={{-10,-4},{10,16}},rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(           Table=[0,
+        0.9; 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2])
+    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
+equation
+  connect(ControlValve.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
+  connect(Constante1.y, ControlValve.Ouv)
+    annotation (Line(points={{-9,40},{0,40},{0,17}},      color={0,0,255}));
+  connect(SourceP1.C, ControlValve.C1)
+    annotation (Line(points={{-44,0},{-44,0},{-10,0}},
+                                                 color={0,0,255}));
+  annotation (experiment(StopTime=80),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.8.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestControlValve;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo
index 68c7934ced87ff4b5b45c0742b96cfdd8387925d..78814b4a0fcf63e21e42941a2eba1cc037158d40 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestDiaphragm
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{44,-10},{64,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.Diaphragm Diaphragm
-                                          annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}},
-                                    rotation=0)));
-equation
-  connect(Diaphragm.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
-  connect(SourceP1.C, Diaphragm.C1)
-    annotation (Line(points={{-44,0},{-10,0}},   color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.7.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestDiaphragm;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestDiaphragm
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{44,-10},{64,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.Diaphragm Diaphragm
+                                          annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}},
+                                    rotation=0)));
+equation
+  connect(Diaphragm.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
+  connect(SourceP1.C, Diaphragm.C1)
+    annotation (Line(points={{-44,0},{-10,0}},   color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.7.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestDiaphragm;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo
index b002c89c7afffc996ae4193b81b617460707d237..e954fc4e2859f5f7be0b62d7e4cd931259732b81 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo
@@ -1,60 +1,60 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestDynamicCheckValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-38,-10},{-18,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{42,-10},{62,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.DynamicCheckValve checkValve(J=10)
-    annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(
-    period=100,
-    amplitude=3e5,
-    offset=6e5) annotation (Placement(transformation(extent={{-78,-10},{-58,10}},
-          rotation=0)));
-equation
-  connect(sourceP1.C, checkValve.C1)
-    annotation (Line(points={{-18,0},{2,0}},   color={0,0,255}));
-  connect(checkValve.C2, puitsP1.C) annotation (Line(points={{22,0},{32,0},{42,
-          0}},             color={0,0,255}));
-  connect(sourceP1.IPressure, pulse.y)
-    annotation (Line(points={{-33,0},{-57,0}},   color={28,108,200}));
-  annotation (
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    experiment(StopTime=300),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.12.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestDynamicCheckValve;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestDynamicCheckValve
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-38,-10},{-18,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{42,-10},{62,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.DynamicCheckValve checkValve(J=10)
+    annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(
+    period=100,
+    amplitude=3e5,
+    offset=6e5) annotation (Placement(transformation(extent={{-78,-10},{-58,10}},
+          rotation=0)));
+equation
+  connect(sourceP1.C, checkValve.C1)
+    annotation (Line(points={{-18,0},{2,0}},   color={0,0,255}));
+  connect(checkValve.C2, puitsP1.C) annotation (Line(points={{22,0},{32,0},{42,
+          0}},             color={0,0,255}));
+  connect(sourceP1.IPressure, pulse.y)
+    annotation (Line(points={{-33,0},{-57,0}},   color={28,108,200}));
+  annotation (
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    experiment(StopTime=300),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.12.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestDynamicCheckValve;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo
index 9f0dea5d6dfe62d70797cc5a6dab0f214f31b4e8..f1090f35cc2696f78d8e3ae8fba959f78635f207 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo
@@ -1,94 +1,94 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestDynamicReliefValve
-  import ThermoSysPro;
-
-  ThermoSysPro.WaterSteam.PressureLosses.DynamicReliefValve ReliefValve(
-    mech_steady_state=false,
-    caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351;
-        0.7,8625; 0.8,8818; 0.9,8958; 1,9063],
-    Cvmax=9063,
-    mode_caract=1,
-    A1=0.125,
-    A2=0.125,
-    z_max=0.6,
-    m=100,
-    Popen=2000000,
-    Q(start=1.4404060369658185E-32))
-    annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe Pipe2(
-                   continuous_flow_reversal=true, Pm(start=199283),
-    Q(start=1335.993983016864))          annotation (Placement(transformation(
-          extent={{40,-20},{60,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Sink2
-                                   annotation (Placement(transformation(extent=
-            {{80,-20},{100,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe Pipe1(
-                   continuous_flow_reversal=true,
-    D=0.4,
-    Pm(start=1478795.1075221882))        annotation (Placement(transformation(
-          extent={{-40,-20},{-20,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumeD1(P(start=298566), h(start=
-          72156.6431966866))         annotation (Placement(transformation(
-          extent={{0,-20},{20,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Sink1
-                                   annotation (Placement(transformation(extent=
-            {{40,20},{60,40}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-80,-20},{-60,0}})));
-  InstrumentationAndControl.Blocks.Sources.Rampe ramp(
-    Duration=200,
-    Finalvalue=30e5,
-    Initialvalue=15e5)
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}})));
-equation
-  connect(Pipe2.C2, Sink2.C)
-    annotation (Line(points={{60,-10},{80,-10}}, color={0,0,255}));
-  connect(Pipe1.C2, VolumeD1.Ce)
-    annotation (Line(points={{-20,-10},{0,-10}}, color={0,0,255}));
-  connect(VolumeD1.Cs3, Pipe2.C1)
-    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
-  connect(ReliefValve.C1, VolumeD1.Cs1)
-                                     annotation (Line(points={{10,20.2},{10,0}}));
-  connect(ReliefValve.C2, Sink1.C)
-    annotation (Line(points={{20,30},{30,30},{30,30},{40,30}},     color={0,0,
-          255}));
-  connect(sourceP.C, Pipe1.C1)
-    annotation (Line(points={{-60,-10},{-40,-10}}, color={0,0,255}));
-  connect(ramp.y, sourceP.IPressure) annotation (Line(points={{-79,30},{-60,30},
-          {-60,8},{-80,8},{-80,-10},{-75,-10}}, color={28,108,200}));
-  annotation (
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false, initialScale=0.1)),
-    Window(
-      x=0.1,
-      y=0.08,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
-         coordinateSystem(preserveAspectRatio=false, initialScale=0.1)),
-    experiment(StopTime=300),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.13.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestDynamicReliefValve;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestDynamicReliefValve
+  import ThermoSysPro;
+
+  ThermoSysPro.WaterSteam.PressureLosses.DynamicReliefValve ReliefValve(
+    mech_steady_state=false,
+    caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351;
+        0.7,8625; 0.8,8818; 0.9,8958; 1,9063],
+    Cvmax=9063,
+    mode_caract=1,
+    A1=0.125,
+    A2=0.125,
+    z_max=0.6,
+    m=100,
+    Popen=2000000,
+    Q(start=1.4404060369658185E-32))
+    annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe Pipe2(
+                   continuous_flow_reversal=true, Pm(start=199283),
+    Q(start=1335.993983016864))          annotation (Placement(transformation(
+          extent={{40,-20},{60,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Sink2
+                                   annotation (Placement(transformation(extent=
+            {{80,-20},{100,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe Pipe1(
+                   continuous_flow_reversal=true,
+    D=0.4,
+    Pm(start=1478795.1075221882))        annotation (Placement(transformation(
+          extent={{-40,-20},{-20,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumeD1(P(start=298566), h(start=
+          72156.6431966866))         annotation (Placement(transformation(
+          extent={{0,-20},{20,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Sink1
+                                   annotation (Placement(transformation(extent=
+            {{40,20},{60,40}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-80,-20},{-60,0}})));
+  InstrumentationAndControl.Blocks.Sources.Rampe ramp(
+    Duration=200,
+    Finalvalue=30e5,
+    Initialvalue=15e5)
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}})));
+equation
+  connect(Pipe2.C2, Sink2.C)
+    annotation (Line(points={{60,-10},{80,-10}}, color={0,0,255}));
+  connect(Pipe1.C2, VolumeD1.Ce)
+    annotation (Line(points={{-20,-10},{0,-10}}, color={0,0,255}));
+  connect(VolumeD1.Cs3, Pipe2.C1)
+    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
+  connect(ReliefValve.C1, VolumeD1.Cs1)
+                                     annotation (Line(points={{10,20.2},{10,0}}));
+  connect(ReliefValve.C2, Sink1.C)
+    annotation (Line(points={{20,30},{30,30},{30,30},{40,30}},     color={0,0,
+          255}));
+  connect(sourceP.C, Pipe1.C1)
+    annotation (Line(points={{-60,-10},{-40,-10}}, color={0,0,255}));
+  connect(ramp.y, sourceP.IPressure) annotation (Line(points={{-79,30},{-60,30},
+          {-60,8},{-80,8},{-80,-10},{-75,-10}}, color={28,108,200}));
+  annotation (
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false, initialScale=0.1)),
+    Window(
+      x=0.1,
+      y=0.08,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
+         coordinateSystem(preserveAspectRatio=false, initialScale=0.1)),
+    experiment(StopTime=300),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.13.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestDynamicReliefValve;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo
index 27e8b587e3b269ecba81c66b2a45668e9875451d..80dc8a474cd8e40c43dd60e84755cfb613fd4c2d 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestLumpedStraightPipe
-
-  ThermoSysPro.WaterSteam.Volumes.Tank tank1(h0=2e5) annotation (Placement(
-        transformation(extent={{-50,16},{-30,36}},   rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank tank2(z0=10) annotation (Placement(
-        transformation(extent={{30,16},{50,36}},   rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    inertia=true,
-    lambda=0.012,
-    lambda_fixed=true) annotation (Placement(transformation(extent={{-10,-24},{
-            10,-4}}, rotation=0)));
-equation
-  connect(tank1.Cs2, lumpedStraightPipe.C1) annotation (Line(points={{-30,20},{
-          -20,20},{-20,-14},{-10,-14}},   color={0,0,255}));
-  connect(lumpedStraightPipe.C2, tank2.Ce2) annotation (Line(points={{10,-14},{
-          20,-14},{20,20},{30,20}},   color={0,0,255}));
-  annotation (experiment(StopTime=100),
-   Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestLumpedStraightPipe;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestLumpedStraightPipe
+
+  ThermoSysPro.WaterSteam.Volumes.Tank tank1(h0=2e5) annotation (Placement(
+        transformation(extent={{-50,16},{-30,36}},   rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank tank2(z0=10) annotation (Placement(
+        transformation(extent={{30,16},{50,36}},   rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    inertia=true,
+    lambda=0.012,
+    lambda_fixed=true) annotation (Placement(transformation(extent={{-10,-24},{
+            10,-4}}, rotation=0)));
+equation
+  connect(tank1.Cs2, lumpedStraightPipe.C1) annotation (Line(points={{-30,20},{
+          -20,20},{-20,-14},{-10,-14}},   color={0,0,255}));
+  connect(lumpedStraightPipe.C2, tank2.Ce2) annotation (Line(points={{10,-14},{
+          20,-14},{20,20},{30,20}},   color={0,0,255}));
+  annotation (experiment(StopTime=100),
+   Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestLumpedStraightPipe;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo
index e4b86a975acac87e8030c4ab7340e092a95496b4..e6ddd35d5437ea131e7d8b52a5af5f7f69fbec0a 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo
@@ -1,56 +1,56 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestPipePressureLoss
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-85,-10},{-65,10}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{64,-10},{84,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss pipePressureLoss
-                                          annotation (Placement(transformation(
-          extent={{-40,-53},{38,53}},
-                                    rotation=0)));
-equation
-  connect(pipePressureLoss.C2, PuitsP1.C)
-    annotation (Line(points={{38,0},{49,0},{64,0}},
-                                              color={0,0,255}));
-  connect(SourceP1.C, pipePressureLoss.C1)
-    annotation (Line(points={{-65,0},{-65,0},{-40,0}},
-                                                 color={0,0,255}));
-  annotation (
-    experiment(StopTime=1000),
-     Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.4.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestPipePressureLoss;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestPipePressureLoss
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-85,-10},{-65,10}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{64,-10},{84,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss pipePressureLoss
+                                          annotation (Placement(transformation(
+          extent={{-40,-53},{38,53}},
+                                    rotation=0)));
+equation
+  connect(pipePressureLoss.C2, PuitsP1.C)
+    annotation (Line(points={{38,0},{49,0},{64,0}},
+                                              color={0,0,255}));
+  connect(SourceP1.C, pipePressureLoss.C1)
+    annotation (Line(points={{-65,0},{-65,0},{-40,0}},
+                                                 color={0,0,255}));
+  annotation (
+    experiment(StopTime=1000),
+     Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.4.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestPipePressureLoss;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo
index 917462899dc468cd566f26a4871f1a2ed344826e..b2a2571b42b6d3515873fa5a4ef541b4882cae3e 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestSwitchValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-10},{90,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SwitchValve SwitchValve
-                                          annotation (Placement(transformation(
-          extent={{-18,-9},{18,37}},rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
-                                         width=10, period=20)
-    annotation (Placement(transformation(extent={{-50,31},{-30,51}}, rotation=0)));
-  WaterSteam.PressureLosses.LumpedStraightPipe              perteDP2
-                                        annotation (Placement(transformation(
-          extent={{-55,-10},{-35,10}},rotation=0)));
-  WaterSteam.PressureLosses.LumpedStraightPipe              perteDP1
-                                        annotation (Placement(transformation(
-          extent={{34,-10},{54,10}},rotation=0)));
-equation
-  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-29,41},{0,41},{
-          0,30.56}}));
-  connect(SourceP1.C, perteDP2.C1)
-    annotation (Line(points={{-70,0},{-55,0}},   color={0,0,255}));
-  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-35,0},{-20,0},
-          {-20,0.2},{-18,0.2}},       color={0,0,255}));
-  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{18,0.66},{20,
-          0.66},{20,0},{34,0}},    color={0,0,255}));
-  connect(perteDP1.C2, PuitsP1.C)
-    annotation (Line(points={{54,0},{54,0},{70,0}},    color={0,0,255}));
-  annotation (experiment(StopTime=100),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.10.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestSwitchValve;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestSwitchValve
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-10},{90,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SwitchValve SwitchValve
+                                          annotation (Placement(transformation(
+          extent={{-18,-9},{18,37}},rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
+                                         width=10, period=20)
+    annotation (Placement(transformation(extent={{-50,31},{-30,51}}, rotation=0)));
+  WaterSteam.PressureLosses.LumpedStraightPipe              perteDP2
+                                        annotation (Placement(transformation(
+          extent={{-55,-10},{-35,10}},rotation=0)));
+  WaterSteam.PressureLosses.LumpedStraightPipe              perteDP1
+                                        annotation (Placement(transformation(
+          extent={{34,-10},{54,10}},rotation=0)));
+equation
+  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-29,41},{0,41},{
+          0,30.56}}));
+  connect(SourceP1.C, perteDP2.C1)
+    annotation (Line(points={{-70,0},{-55,0}},   color={0,0,255}));
+  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-35,0},{-20,0},
+          {-20,0.2},{-18,0.2}},       color={0,0,255}));
+  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{18,0.66},{20,
+          0.66},{20,0},{34,0}},    color={0,0,255}));
+  connect(perteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{54,0},{54,0},{70,0}},    color={0,0,255}));
+  annotation (experiment(StopTime=100),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.10.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestSwitchValve;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo
index 4d290223de6183e19e49bd2c1934259e964e83ad..e60a829e55648050300241dd3d9206162c727215 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo
@@ -1,66 +1,66 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
-model TestThreeWayValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-10},{90,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ThreeWayValve threeWayValve(
-    C2(Q(start=-7.902947109890763E-33)),
-    C3(Q(start=2716.4138702433384)),
-    Valve1(Pm(start=200000.0)),
-    VolumeA1(h(start=71016.12237181117)))
-    annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP2
-                                          annotation (Placement(transformation(
-          extent={{70,-50},{90,-30}},
-                                    rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe
-                                         annotation (Placement(transformation(
-          extent={{-50,30},{-30,50}}, rotation=0)));
-equation
-  connect(SourceP1.C, threeWayValve.C1)
-    annotation (Line(points={{-70,0},{-10,0}},   color={0,0,255}));
-  connect(threeWayValve.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{70,0}},  color={255,0,0}));
-  connect(threeWayValve.C3, PuitsP2.C) annotation (Line(points={{0,-6},{0,-40},
-          {70,-40}},      color={255,0,0}));
-  connect(rampe.y, threeWayValve.Ouv)
-    annotation (Line(points={{-29,40},{0,40},{0,15}}));
-  annotation (experiment(StopTime=5),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 13.9.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestThreeWayValve;
+within ThermoSysPro.Examples.Book.SimpleExamples.PressureLoss;
+model TestThreeWayValve
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-10},{90,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ThreeWayValve threeWayValve(
+    C2(Q(start=-7.902947109890763E-33)),
+    C3(Q(start=2716.4138702433384)),
+    Valve1(Pm(start=200000.0)),
+    VolumeA1(h(start=71016.12237181117)))
+    annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP2
+                                          annotation (Placement(transformation(
+          extent={{70,-50},{90,-30}},
+                                    rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe
+                                         annotation (Placement(transformation(
+          extent={{-50,30},{-30,50}}, rotation=0)));
+equation
+  connect(SourceP1.C, threeWayValve.C1)
+    annotation (Line(points={{-70,0},{-10,0}},   color={0,0,255}));
+  connect(threeWayValve.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{70,0}},  color={255,0,0}));
+  connect(threeWayValve.C3, PuitsP2.C) annotation (Line(points={{0,-6},{0,-40},
+          {70,-40}},      color={255,0,0}));
+  connect(rampe.y, threeWayValve.Ouv)
+    annotation (Line(points={{-29,40},{0,40},{0,15}}));
+  annotation (experiment(StopTime=5),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 13.9.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestThreeWayValve;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/package.mo
index e651396ead2007f7be005ce3c2864e65bbe19088..7b1896e7b1a7c163ecb7ff8e32a3f8e873aa7193 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package PressureLoss "Pressure loss modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 13 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end PressureLoss;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package PressureLoss "Pressure loss modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 13 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end PressureLoss;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/package.order
index 34aac4a6c7d1b2c74b5f98840e5fab80aa930a80..2672eecac426c668fefb4c436f2e7c7bd62a7cad 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/PressureLoss/package.order
@@ -1,10 +1,10 @@
-TestPipePressureLoss
-TestLumpedStraightPipe
-TestBend
-TestDiaphragm
-TestControlValve
-TestThreeWayValve
-TestSwitchValve
-TestCheckValve
-TestDynamicCheckValve
-TestDynamicReliefValve
+TestPipePressureLoss
+TestLumpedStraightPipe
+TestBend
+TestDiaphragm
+TestControlValve
+TestThreeWayValve
+TestSwitchValve
+TestCheckValve
+TestDynamicCheckValve
+TestDynamicReliefValve
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo b/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo
index a869d5000094d9740ab24e0cd3e6bf51a6be1e43..6ea056124b2a9487fdafc246abc3363e01668687 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo
@@ -1,161 +1,161 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.SolarCollector;
-model TestFresnelField
-
-public
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    ntubes=1,
-    steady_state=true,
-    D=0.07,
-    e=0.004,
-    Ns=30,
-    T0=500,
-    lambda=20,
-    cpw=500,
-    rhow=8000,
-    Tp(start={628.0843201819387,627.9310075597404,627.8220175907211,
-          627.7368992018166,627.6679716601412,627.6112649113921,
-          627.5643995456558,627.5258238160011,627.4944728950805,
-          627.4695948757801,627.4506537300122,627.4372716636091,
-          627.4291939746797,627.426267226699,627.428426585461,627.4356896138493,
-          627.4481553612113,627.4660085346942,627.4895290639054,
-          627.5191082002851,627.5552734790091,627.5987264837852,
-          627.6504001032708,627.7115474128314,627.7838847016081,
-          627.8698331666657,627.9729350144038,629.4253815385038,
-          633.135688507217,636.2622387488283}),
-    Tp1(start={610.2709965207655,610.0984334604643,609.9757644369477,
-          609.8799665740102,609.8023932206363,609.7385750723525,
-          609.6858335131916,609.6424216866362,609.6071408778737,
-          609.5791446660139,609.5578296140685,609.5427704711935,
-          609.533680491646,609.5303869740989,609.5328169418054,609.540990157294,
-          609.5550181389947,609.5751088339957,609.6015773714007,
-          609.6348642175905,609.6755632868924,609.7244644309128,
-          609.7826179283193,609.8514345863706,609.9328467812495,
-          610.0295806069864,610.1456244663702,611.7808730290952,
-          615.9622431406954,619.4903247027197}),
-    Tp2(start={644.9596553467713,644.824579502235,644.7285482944553,
-          644.6535470354397,644.592810046145,644.5428402353538,
-          644.5015416419557,644.4675473586904,644.4399193877858,
-          644.4179953736024,644.4013031238645,644.3895098327511,
-          644.3823911261306,644.3798118348441,644.3817148399042,644.38811560583,
-          644.3991013774125,644.4148348525065,644.4355626048274,
-          644.4616292617266,644.4934994867675,644.531791236838,
-          644.5773261834961,644.6312079828199,644.6949482231629,
-          644.7706792525222,644.8615205623447,646.1407907783827,
-          649.404839172216,652.1510013554424}),
-    L=1e4/11.46)
-    annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    dynamicTwoPhaseFlowPipe(
-    ntubes=1,
-    mode=0,
-    steady_state=true,
-    rugosrel=0.00005,
-    dpfCorr=1,
-    Ns=30,
-    P(start={12512365.778485337,12512269.4730028,12512159.010926897,
-          12512028.619141866,12511878.28140543,12511707.984695798,
-          12511517.718132183,12511307.472416837,12511077.239500606,
-          12510827.012364838,12510556.784871727,12510266.551658653,
-          12509956.30806284,12509626.050068311,12509275.774270097,
-          12508905.477852736,12508515.15858121,12508104.814803492,
-          12507674.445464557,12507224.050132478,12506753.629037917,
-          12506263.183129327,12505752.714147368,12505222.224723859,
-          12504671.718513375,12504101.200370008,12503510.676589508,
-          12502896.415784404,12502231.48634808,12501522.52554151,
-          12500776.553197166,12500000.0}),
-    h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266,
-          1645211.676359884,1681572.2077847784,1717947.2125321354,
-          1754334.1766730088,1790730.9833788855,1827135.788296852,
-          1863546.9394607474,1899962.9220483964,1936382.3178860326,
-          1972803.7739566958,2009225.9764870608,2045647.6282789519,
-          2082067.4276265746,2118484.0474634594,2154896.1134394333,
-          2191302.179544121,2227700.6996020116,2264089.9923674623,
-          2300468.196934767,2336833.213464297,2373182.6211112435,
-          2409513.559261445,2445822.5467506223,2482105.1942732874,
-          2518015.7979130256,2552967.680496474,2587102.355161259,
-          82548.43470391157}),
-    D=0.07,
-    inertia=false,
-    L=1e4/11.46)            annotation (Placement(transformation(extent={{-36,
-            -67},{36,-20}}, rotation=0)));
-  Solar.Collectors.FresnelField champThermosolaireLFR_N(
-    Ns=30,
-    T(start=fill(500, 30)),
-    F12=0.6366,
-    A=1e4,
-    T0=303)
-    annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP sinkP(
-    h0=2000e3, P0=125e5)          annotation (Placement(transformation(extent={
-            {48,-54},{68,-34}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3)
-               annotation (Placement(transformation(extent={{-69,-53},{-49,-33}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe DNI(
-    Starttime=100,
-    Initialvalue=100,
-    Duration=3600,
-    Finalvalue=900) annotation (Placement(transformation(extent={{72,39},{58,53}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe Angles(
-    Starttime=100,
-    Initialvalue=45,
-    Finalvalue=45,
-    Duration=3600)  annotation (Placement(transformation(extent={{-10,59},{4,72}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe Q(
-    Starttime=100,
-    Duration=3600,
-    Initialvalue=2,
-    Finalvalue=3)   annotation (Placement(transformation(extent={{-65,-32},{-51,
-            -19}}, rotation=0)));
-equation
-  connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2)
-    annotation (Line(points={{0,1.6},{0,-15.6}}, color={191,95,0}));
-  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(
-        points={{0,-22.4},{0,-36.45}}, color={191,95,0}));
-  connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{36,
-          -43.5},{47,-43.5},{47,-44},{48,-44}}, color={0,0,255}));
-  connect(champThermosolaireLFR_N.SunDNI, DNI.y)
-    annotation (Line(points={{44,45.6},{51,45.6},{51,46},{57.3,46}}));
-  connect(champThermosolaireLFR_N.SunG, Angles.y)
-    annotation (Line(points={{27.2,58.8},{27.2,65.5},{4.7,65.5}}));
-  connect(champThermosolaireLFR_N.SunA, Angles.y)
-    annotation (Line(points={{36.8,58.8},{36.8,70},{6,70},{6,65.5},{4.7,65.5}}));
-  connect(Q.y, sourceP.IMassFlow)
-    annotation (Line(points={{-50.3,-25.5},{-50,-25.5},{-50,-38},{-59,-38}}));
-  connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-49,
-          -43},{-47.5,-43},{-47.5,-43.5},{-36,-43.5}}, color={0,0,255}));
-  annotation (
-      Diagram(graphics),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 16.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    experiment(StopTime=5000));
-end TestFresnelField;
+within ThermoSysPro.Examples.Book.SimpleExamples.SolarCollector;
+model TestFresnelField
+
+public
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    ntubes=1,
+    steady_state=true,
+    D=0.07,
+    e=0.004,
+    Ns=30,
+    T0=500,
+    lambda=20,
+    cpw=500,
+    rhow=8000,
+    Tp(start={628.0843201819387,627.9310075597404,627.8220175907211,
+          627.7368992018166,627.6679716601412,627.6112649113921,
+          627.5643995456558,627.5258238160011,627.4944728950805,
+          627.4695948757801,627.4506537300122,627.4372716636091,
+          627.4291939746797,627.426267226699,627.428426585461,627.4356896138493,
+          627.4481553612113,627.4660085346942,627.4895290639054,
+          627.5191082002851,627.5552734790091,627.5987264837852,
+          627.6504001032708,627.7115474128314,627.7838847016081,
+          627.8698331666657,627.9729350144038,629.4253815385038,
+          633.135688507217,636.2622387488283}),
+    Tp1(start={610.2709965207655,610.0984334604643,609.9757644369477,
+          609.8799665740102,609.8023932206363,609.7385750723525,
+          609.6858335131916,609.6424216866362,609.6071408778737,
+          609.5791446660139,609.5578296140685,609.5427704711935,
+          609.533680491646,609.5303869740989,609.5328169418054,609.540990157294,
+          609.5550181389947,609.5751088339957,609.6015773714007,
+          609.6348642175905,609.6755632868924,609.7244644309128,
+          609.7826179283193,609.8514345863706,609.9328467812495,
+          610.0295806069864,610.1456244663702,611.7808730290952,
+          615.9622431406954,619.4903247027197}),
+    Tp2(start={644.9596553467713,644.824579502235,644.7285482944553,
+          644.6535470354397,644.592810046145,644.5428402353538,
+          644.5015416419557,644.4675473586904,644.4399193877858,
+          644.4179953736024,644.4013031238645,644.3895098327511,
+          644.3823911261306,644.3798118348441,644.3817148399042,644.38811560583,
+          644.3991013774125,644.4148348525065,644.4355626048274,
+          644.4616292617266,644.4934994867675,644.531791236838,
+          644.5773261834961,644.6312079828199,644.6949482231629,
+          644.7706792525222,644.8615205623447,646.1407907783827,
+          649.404839172216,652.1510013554424}),
+    L=1e4/11.46)
+    annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    dynamicTwoPhaseFlowPipe(
+    ntubes=1,
+    mode=0,
+    steady_state=true,
+    rugosrel=0.00005,
+    dpfCorr=1,
+    Ns=30,
+    P(start={12512365.778485337,12512269.4730028,12512159.010926897,
+          12512028.619141866,12511878.28140543,12511707.984695798,
+          12511517.718132183,12511307.472416837,12511077.239500606,
+          12510827.012364838,12510556.784871727,12510266.551658653,
+          12509956.30806284,12509626.050068311,12509275.774270097,
+          12508905.477852736,12508515.15858121,12508104.814803492,
+          12507674.445464557,12507224.050132478,12506753.629037917,
+          12506263.183129327,12505752.714147368,12505222.224723859,
+          12504671.718513375,12504101.200370008,12503510.676589508,
+          12502896.415784404,12502231.48634808,12501522.52554151,
+          12500776.553197166,12500000.0}),
+    h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266,
+          1645211.676359884,1681572.2077847784,1717947.2125321354,
+          1754334.1766730088,1790730.9833788855,1827135.788296852,
+          1863546.9394607474,1899962.9220483964,1936382.3178860326,
+          1972803.7739566958,2009225.9764870608,2045647.6282789519,
+          2082067.4276265746,2118484.0474634594,2154896.1134394333,
+          2191302.179544121,2227700.6996020116,2264089.9923674623,
+          2300468.196934767,2336833.213464297,2373182.6211112435,
+          2409513.559261445,2445822.5467506223,2482105.1942732874,
+          2518015.7979130256,2552967.680496474,2587102.355161259,
+          82548.43470391157}),
+    D=0.07,
+    inertia=false,
+    L=1e4/11.46)            annotation (Placement(transformation(extent={{-36,
+            -67},{36,-20}}, rotation=0)));
+  Solar.Collectors.FresnelField champThermosolaireLFR_N(
+    Ns=30,
+    T(start=fill(500, 30)),
+    F12=0.6366,
+    A=1e4,
+    T0=303)
+    annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP sinkP(
+    h0=2000e3, P0=125e5)          annotation (Placement(transformation(extent={
+            {48,-54},{68,-34}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3)
+               annotation (Placement(transformation(extent={{-69,-53},{-49,-33}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe DNI(
+    Starttime=100,
+    Initialvalue=100,
+    Duration=3600,
+    Finalvalue=900) annotation (Placement(transformation(extent={{72,39},{58,53}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe Angles(
+    Starttime=100,
+    Initialvalue=45,
+    Finalvalue=45,
+    Duration=3600)  annotation (Placement(transformation(extent={{-10,59},{4,72}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe Q(
+    Starttime=100,
+    Duration=3600,
+    Initialvalue=2,
+    Finalvalue=3)   annotation (Placement(transformation(extent={{-65,-32},{-51,
+            -19}}, rotation=0)));
+equation
+  connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2)
+    annotation (Line(points={{0,1.6},{0,-15.6}}, color={191,95,0}));
+  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(
+        points={{0,-22.4},{0,-36.45}}, color={191,95,0}));
+  connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{36,
+          -43.5},{47,-43.5},{47,-44},{48,-44}}, color={0,0,255}));
+  connect(champThermosolaireLFR_N.SunDNI, DNI.y)
+    annotation (Line(points={{44,45.6},{51,45.6},{51,46},{57.3,46}}));
+  connect(champThermosolaireLFR_N.SunG, Angles.y)
+    annotation (Line(points={{27.2,58.8},{27.2,65.5},{4.7,65.5}}));
+  connect(champThermosolaireLFR_N.SunA, Angles.y)
+    annotation (Line(points={{36.8,58.8},{36.8,70},{6,70},{6,65.5},{4.7,65.5}}));
+  connect(Q.y, sourceP.IMassFlow)
+    annotation (Line(points={{-50.3,-25.5},{-50,-25.5},{-50,-38},{-59,-38}}));
+  connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-49,
+          -43},{-47.5,-43},{-47.5,-43.5},{-36,-43.5}}, color={0,0,255}));
+  annotation (
+      Diagram(graphics),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 16.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    experiment(StopTime=5000));
+end TestFresnelField;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/package.mo
index 8f98e9968e3b36c34077fd5185fd32962a67f6e3..47851424baabeaba0a20bf3d72c791b3d1a00901 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package SolarCollector "Solar collector modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 16 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end SolarCollector;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package SolarCollector "Solar collector modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 16 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end SolarCollector;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/package.order
index 8e8e585557f2e3661273b13408b7dfc4be053888..3c7132cdabff784e9876a016cde07417026c7c63 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/SolarCollector/package.order
@@ -1 +1 @@
-TestFresnelField
+TestFresnelField
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo b/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo
index dbbd73e619b2904acc0d93ace626754c3944f983..1d72a93962a5035beb57e4172d5222af4b4ec158 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo
@@ -1,60 +1,60 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.SteamTurbine;
-model TestStodolaTurbine
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine(Cst=2e6,
-      eta_is_nom=0.94)
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=
-        10000000)
-    annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=2,
-    P0=27000000,
-    h0=3475.e3)
-             annotation (Placement(transformation(extent={{-50,-10},{-30,10}},
-          rotation=0)));
-equation
-  connect(sourceP.C, stodolaTurbine.Ce)
-    annotation (Line(points={{-30,0},{-10.1,0}},   color={0,0,255}));
-  connect(stodolaTurbine.Cs, puitsP.C)
-    annotation (Line(points={{10.1,0},{30,0}},     color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Text(
-          extent={{-64,-14},{-16,-26}},
-          lineColor={0,0,255},
-          textString=
-               "Supercritrical at the inlet")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 10.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestStodolaTurbine;
+within ThermoSysPro.Examples.Book.SimpleExamples.SteamTurbine;
+model TestStodolaTurbine
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine(Cst=2e6,
+      eta_is_nom=0.94)
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=
+        10000000)
+    annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=2,
+    P0=27000000,
+    h0=3475.e3)
+             annotation (Placement(transformation(extent={{-50,-10},{-30,10}},
+          rotation=0)));
+equation
+  connect(sourceP.C, stodolaTurbine.Ce)
+    annotation (Line(points={{-30,0},{-10.1,0}},   color={0,0,255}));
+  connect(stodolaTurbine.Cs, puitsP.C)
+    annotation (Line(points={{10.1,0},{30,0}},     color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Text(
+          extent={{-64,-14},{-16,-26}},
+          lineColor={0,0,255},
+          textString=
+               "Supercritrical at the inlet")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 10.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestStodolaTurbine;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/package.mo
index 2415833f9cee42c7ce62a7c989394227104f8a8a..0a108ef858f1122cd6a94fd0f70d88adf03786ae 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package SteamTurbine "Steam turbine modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 10 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end SteamTurbine;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package SteamTurbine "Steam turbine modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 10 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end SteamTurbine;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/package.order
index 957d3bddc540367f9269e973838d06032b2e7a0a..4bf87c1ac0f271da4f809036a3cb44a63730eb5c 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/SteamTurbine/package.order
@@ -1 +1 @@
-TestStodolaTurbine
+TestStodolaTurbine
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo
index be4c4d2c29869e7909466e684dd945c683a8c752..75b5199e76a2b1fdf7e9130029991d887fd96351 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo
@@ -1,193 +1,193 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
-model TestDynamicDrum
-  //parameter Modelica.SIunits.MassFlowRate Qin(fixed=false,start=80)
-  //  "Mass flow rate";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.085)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  WaterSteam.Volumes.DynamicDrum              Drum(
-    Vv(start=39),
-    Vertical=false,
-    hl(start=1454400),
-    hv(start=2.658e6),
-    xv(start=0.01),
-    rhol(start=670),
-    rhov(start=78),
-    zl(fixed=true, start=1.05),
-    P0=13000000,
-    P(start=13000000, fixed=false),
-    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,16},{1,
-            78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=335),
-    Q(start=79.5),
-    rho(start=888),
-    h(start=1400000),
-    C1(
-      h_vol(start=1400e3),
-      h(start=1400e3),
-      Q(start=79.5),
-      P(start=13300000)),
-    Cvmax=CvmaxWater,
-    Pm(start=13100000))
-                     annotation (Placement(transformation(extent={{-120,74},{
-            -100,94}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Q(start=79.5),
-    rho(start=78.5),
-    h(start=2657930),
-    Cvmax=10000,
-    Pm(start=12900000))
-    annotation (Placement(transformation(extent={{40,74},{60,94}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    TubeEcranBoucleEvaporatoire(
-    T0=fill(400, 10),
-    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
-    advection=false,
-    z2=10,
-    simplified_dynamic_energy_balance=false,
-    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
-          13002000,13001000,13000000,12999990}),
-    D=0.03,
-    ntubes=1400,
-    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
-          1900e3,1950e3}),
-    L=20,
-    Q(start=fill(130, 11)))
-                     annotation (Placement(transformation(
-        origin={6,-28},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
-    option_temperature=2,
-    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
-    T0={290,290,290,290,290,290,290,290,290,290})
-    annotation (Placement(transformation(
-        origin={36,-28},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
-    D=0.03,
-    ntubes=1400)
-    annotation (Placement(transformation(
-        origin={18,-28},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=20,
-    z1=20,
-    C1(P(start=130e5)),
-    mode=1,
-    Q(fixed=true, start=130),
-    lambda=LambdaPipe)
-             annotation (Placement(transformation(
-        origin={-66,-28},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  WaterSteam.BoundaryConditions.SourceP              sourceQ(h0=1400000,
-    option_temperature=2,
-    mode=0,
-    P0=13300000)
-           annotation (Placement(transformation(extent={{-196,68},{-176,88}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP              sinkP(
-    option_temperature=2,
-    mode=0,
-    h0=2.650e6,
-    P0=12700000)
-    annotation (Placement(transformation(extent={{115,68},{135,88}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k=0.5)
-    annotation (Placement(transformation(extent={{20,100},{40,119}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
-        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
-        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
-    annotation (Placement(transformation(extent={{96,97},{120,121}},  rotation=
-            0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
-    add(k1=-1, k2=+1),
-    Ti=50,
-    pIsat(
-      ureset0=0.5,
-      Limiteur1(u(signal(start=0.5))),
-      Ti=2000)) annotation (Placement(transformation(extent={{-56,104},{-84,130}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Level(k=1.05) annotation (
-      Placement(transformation(extent={{-21,100},{-40,119}}, rotation=0)));
-equation
-  connect(Drum.Cv, SteamValve.C1)
-    annotation (Line(points={{1,78},{40,78}}, color={0,0,255}));
-  connect(FeedwaterValve.C2, Drum.Ce1)
-    annotation (Line(points={{-100,78},{-61,78}}, color={0,0,255}));
-  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,16},{
-          -66,16},{-66,-18}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-28},
-          {26.2,-28}}, color={191,95,0}));
-  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
-    annotation (Line(points={{1,16},{6,16},{6,-18}}));
-  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
-        points={{9,-28},{16,-28}}, color={191,95,0}));
-  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
-      points={{-176,78},{-120,78}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(SteamValve.C2,sinkP. C) annotation (Line(
-      points={{60,78},{115,78}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{6,-38},{6,-70},{-66,-70},{-66,-38}}));
-  connect(SteamValve_O.y, SteamValve.Ouv)
-    annotation (Line(points={{41,109.5},{50,109.5},{50,95}}, color={0,0,255}));
-  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
-          109},{130,109},{130,78}}, color={0,0,255}));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
-      points={{-40.95,109.5},{-44,109.5},{-44,110},{-44,108},{-44,109.2},{-50,
-          109.2},{-55.3,109.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-
-  connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(
-      points={{4.1,47},{10,47},{10,128.7},{-55.3,128.7}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-  connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation (Line(
-        points={{-84.7,105.3},{-110,105.3},{-110,95}}, color={0,0,255}));
-  annotation (experiment(StopTime=3000),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 14.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestDynamicDrum;
+within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
+model TestDynamicDrum
+  //parameter Modelica.SIunits.MassFlowRate Qin(fixed=false,start=80)
+  //  "Mass flow rate";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.085)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+
+  WaterSteam.Volumes.DynamicDrum              Drum(
+    Vv(start=39),
+    Vertical=false,
+    hl(start=1454400),
+    hv(start=2.658e6),
+    xv(start=0.01),
+    rhol(start=670),
+    rhov(start=78),
+    zl(fixed=true, start=1.05),
+    P0=13000000,
+    P(start=13000000, fixed=false),
+    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,16},{1,
+            78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=335),
+    Q(start=79.5),
+    rho(start=888),
+    h(start=1400000),
+    C1(
+      h_vol(start=1400e3),
+      h(start=1400e3),
+      Q(start=79.5),
+      P(start=13300000)),
+    Cvmax=CvmaxWater,
+    Pm(start=13100000))
+                     annotation (Placement(transformation(extent={{-120,74},{
+            -100,94}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Q(start=79.5),
+    rho(start=78.5),
+    h(start=2657930),
+    Cvmax=10000,
+    Pm(start=12900000))
+    annotation (Placement(transformation(extent={{40,74},{60,94}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    TubeEcranBoucleEvaporatoire(
+    T0=fill(400, 10),
+    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
+    advection=false,
+    z2=10,
+    simplified_dynamic_energy_balance=false,
+    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
+          13002000,13001000,13000000,12999990}),
+    D=0.03,
+    ntubes=1400,
+    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
+          1900e3,1950e3}),
+    L=20,
+    Q(start=fill(130, 11)))
+                     annotation (Placement(transformation(
+        origin={6,-28},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
+    option_temperature=2,
+    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
+    T0={290,290,290,290,290,290,290,290,290,290})
+    annotation (Placement(transformation(
+        origin={36,-28},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
+    D=0.03,
+    ntubes=1400)
+    annotation (Placement(transformation(
+        origin={18,-28},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=20,
+    z1=20,
+    C1(P(start=130e5)),
+    mode=1,
+    Q(fixed=true, start=130),
+    lambda=LambdaPipe)
+             annotation (Placement(transformation(
+        origin={-66,-28},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  WaterSteam.BoundaryConditions.SourceP              sourceQ(h0=1400000,
+    option_temperature=2,
+    mode=0,
+    P0=13300000)
+           annotation (Placement(transformation(extent={{-196,68},{-176,88}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP              sinkP(
+    option_temperature=2,
+    mode=0,
+    h0=2.650e6,
+    P0=12700000)
+    annotation (Placement(transformation(extent={{115,68},{135,88}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k=0.5)
+    annotation (Placement(transformation(extent={{20,100},{40,119}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
+        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
+        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
+    annotation (Placement(transformation(extent={{96,97},{120,121}},  rotation=
+            0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
+    add(k1=-1, k2=+1),
+    Ti=50,
+    pIsat(
+      ureset0=0.5,
+      Limiteur1(u(signal(start=0.5))),
+      Ti=2000)) annotation (Placement(transformation(extent={{-56,104},{-84,130}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Level(k=1.05) annotation (
+      Placement(transformation(extent={{-21,100},{-40,119}}, rotation=0)));
+equation
+  connect(Drum.Cv, SteamValve.C1)
+    annotation (Line(points={{1,78},{40,78}}, color={0,0,255}));
+  connect(FeedwaterValve.C2, Drum.Ce1)
+    annotation (Line(points={{-100,78},{-61,78}}, color={0,0,255}));
+  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,16},{
+          -66,16},{-66,-18}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-28},
+          {26.2,-28}}, color={191,95,0}));
+  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
+    annotation (Line(points={{1,16},{6,16},{6,-18}}));
+  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
+        points={{9,-28},{16,-28}}, color={191,95,0}));
+  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
+      points={{-176,78},{-120,78}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(SteamValve.C2,sinkP. C) annotation (Line(
+      points={{60,78},{115,78}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{6,-38},{6,-70},{-66,-70},{-66,-38}}));
+  connect(SteamValve_O.y, SteamValve.Ouv)
+    annotation (Line(points={{41,109.5},{50,109.5},{50,95}}, color={0,0,255}));
+  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
+          109},{130,109},{130,78}}, color={0,0,255}));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
+      points={{-40.95,109.5},{-44,109.5},{-44,110},{-44,108},{-44,109.2},{-50,
+          109.2},{-55.3,109.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+
+  connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(
+      points={{4.1,47},{10,47},{10,128.7},{-55.3,128.7}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+  connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation (Line(
+        points={{-84.7,105.3},{-110,105.3},{-110,95}}, color={0,0,255}));
+  annotation (experiment(StopTime=3000),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 14.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestDynamicDrum;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestMixer3.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestMixer3.mo
index 45379dda5ad188c1fc45a48bdee5968372acb8a4..1bd4a1ac8c1daf726b8fcdc32690eb79cba59299 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestMixer3.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestMixer3.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
-model TestMixer3
-
-  ThermoSysPro.WaterSteam.Junctions.Mixer3 mixer2_2
-    annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3 annotation (Placement(transformation(extent={{34,-10},
-            {54,10}},  rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4 annotation (Placement(transformation(extent={{-46,10},
-            {-26,30}},  rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5 annotation (Placement(transformation(extent={{-46,-30},
-            {-26,-10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Source sourceP2
-    annotation (Placement(transformation(extent={{-86,10},{-66,30}},   rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
-    annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP1
-    annotation (Placement(transformation(extent={{74,-10},{94,10}},   rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
-        0.5) annotation (Placement(transformation(extent={{-46,30},{-26,50}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ
-    annotation (Placement(transformation(extent={{-86,-10},{-66,10}},  rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss6 annotation (Placement(transformation(extent={{-46,-10},
-            {-26,10}},  rotation=0)));
-equation
-  connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-26,20},
-          {0,20},{0,10}},        color={0,0,255}));
-  connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation (Line(points={{-26,-20},
-          {0,-20},{0,-10}},      color={0,0,255}));
-  connect(mixer2_2.Cs, singularPressureLoss3.C1)
-    annotation (Line(points={{14,0},{34,0}},     color={0,0,255}));
-  connect(sourceP2.C, singularPressureLoss4.C1)
-    annotation (Line(points={{-66,20},{-46,20}},   color={0,0,255}));
-  connect(sourceP3.C, singularPressureLoss5.C1)
-    annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, sinkP1.C)
-    annotation (Line(points={{54,0},{74,0}},     color={0,0,255}));
-  connect(sourceQ.C, singularPressureLoss6.C1)
-    annotation (Line(points={{-66,0},{-46,0}},     color={0,0,255}));
-  connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation (Line(points={{-26,0},
-          {-16,0},{-6,0}},                   color={0,0,255}));
-  connect(constante1.y, mixer2_2.Ialpha1)
-    annotation (Line(points={{-25,40},{-14,40},{-14,6},{-3,6}}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 14.7.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestMixer3;
+within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
+model TestMixer3
+
+  ThermoSysPro.WaterSteam.Junctions.Mixer3 mixer2_2
+    annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3 annotation (Placement(transformation(extent={{34,-10},
+            {54,10}},  rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4 annotation (Placement(transformation(extent={{-46,10},
+            {-26,30}},  rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5 annotation (Placement(transformation(extent={{-46,-30},
+            {-26,-10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Source sourceP2
+    annotation (Placement(transformation(extent={{-86,10},{-66,30}},   rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
+    annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP1
+    annotation (Placement(transformation(extent={{74,-10},{94,10}},   rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
+        0.5) annotation (Placement(transformation(extent={{-46,30},{-26,50}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ
+    annotation (Placement(transformation(extent={{-86,-10},{-66,10}},  rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss6 annotation (Placement(transformation(extent={{-46,-10},
+            {-26,10}},  rotation=0)));
+equation
+  connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-26,20},
+          {0,20},{0,10}},        color={0,0,255}));
+  connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation (Line(points={{-26,-20},
+          {0,-20},{0,-10}},      color={0,0,255}));
+  connect(mixer2_2.Cs, singularPressureLoss3.C1)
+    annotation (Line(points={{14,0},{34,0}},     color={0,0,255}));
+  connect(sourceP2.C, singularPressureLoss4.C1)
+    annotation (Line(points={{-66,20},{-46,20}},   color={0,0,255}));
+  connect(sourceP3.C, singularPressureLoss5.C1)
+    annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, sinkP1.C)
+    annotation (Line(points={{54,0},{74,0}},     color={0,0,255}));
+  connect(sourceQ.C, singularPressureLoss6.C1)
+    annotation (Line(points={{-66,0},{-46,0}},     color={0,0,255}));
+  connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation (Line(points={{-26,0},
+          {-16,0},{-6,0}},                   color={0,0,255}));
+  connect(constante1.y, mixer2_2.Ialpha1)
+    annotation (Line(points={{-25,40},{-14,40},{-14,6},{-3,6}}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 14.7.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestMixer3;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo
index f16d7bb3380b39e7d964da260d059f0c154302d6..c9530f7cd505312677e07427aa15816c70c51eb7 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo
@@ -1,181 +1,181 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
-model TestPressurizer
-
-  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
-    "Power released by the electrical heaters";
-  parameter Real OUVfeedwaterValve( fixed=false)=0.01
-    "OUV feed water valve";
-
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve_Spray(
-    Cv(start=100),
-    C1(
-      P(start=160e5),
-      h_vol(start=1270e3),
-      Q(start=0.3),
-      h(start=1270e3)),
-    Q(fixed=false, start=0.32),
-    Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{-90,
-            150}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Cvmax(fixed=true) = 5000,
-    Pm(start=15500000))
-    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=1,
-    D=1,
-    z1=1,
-    z2=0,
-    mode=0,
-    C1(P(start=160e5)),
-    C2(P(start=160e5)),
-    Q(fixed=false, start=0))
-             annotation (Placement(transformation(
-        origin={-30,-42},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=
-          true) = 0.5) annotation (Placement(transformation(extent={{0,156},{20,
-            176}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    h0=1270e3,
-    mode=0,
-    P0=16000000)
-           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
-    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
-           0)));
-  WaterSteam.Volumes.Pressurizer     pressurizer(
-    Zm=10.15,
-    Klv=0.5e6,
-    cpp=600,
-    hl(start=1629887.98290107),
-    hv(start=2596216.59571565),
-    Zl(start=5.5900717167325),
-    Yw0=60,
-    steady_state=true,
-    V=61.12,
-    Rp=1.27,
-    Ae=96.23,
-    Klp=1780,
-    Kvp=7500,
-    Mp=107e3,
-    Kpa=5.63,
-    Ccond=0.02,
-    Cevap=0.05,
-    Yw(start=32.92),
-    y(start=0.3292, fixed=true),
-    P0=15500000,
-    P(start=15500000, fixed=true),
-    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
-            -12},{32,118}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
-           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
-    option_temperature=2,
-    T0={310},
-    W0={1e5})
-    annotation (Placement(transformation(
-        origin={-133,32},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
-    T0={310},
-    W0={0.286e6},
-    option_temperature=1)
-    annotation (Placement(transformation(
-        origin={-133,55},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,
-        Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,
-        Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(
-          extent={{-175,19},{-149,45}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,
-        OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005;
-        300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(
-        transformation(extent={{-134,154},{-108,180}}, rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
-    Ti=50,
-    add(k1=+1, k2=-1),
-    minval=-100,
-    pIsat(
-      Limiteur1(u(signal(start=0.001))),
-      ureset0=0.0,
-      maxval=100,
-      Ti=2000)) annotation (Placement(transformation(extent={{52,-52},{24,-26}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92)
-    annotation (Placement(transformation(extent={{87,-56},{68,-37}}, rotation=0)));
-equation
-  connect(sourceP.C, FeedwaterValve_Spray.C1)
-    annotation (Line(points={{-148,134},{-110,134}}, color={0,0,255}));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
-        color={0,0,255}));
-  connect(SteamrValve_O.y, SteamValve.Ouv)
-    annotation (Line(points={{21,166},{68,166},{68,151}}));
-  connect(FeedwaterValve_Spray.C2, pressurizer.Cas)
-    annotation (Line(points={{-90,134},{-30,134},{-30,118}}, color={0,0,255}));
-  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
-          32,134},{58,134}}, color={0,0,255}));
-  connect(sinkQ1.C, lumpedStraightPipe.C2)
-    annotation (Line(points={{-30,-66},{-30,-52}}));
-  connect(lumpedStraightPipe.C1, pressurizer.Cex)
-    annotation (Line(points={{-30,-32},{-30,-12}}));
-  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
-          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
-  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
-          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
-  connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(
-        points={{-106.7,167},{-100,167},{-100,151}}, color={0,0,255}));
-  connect(ElectricalHeaters.y, SourceC1.ISignal)
-    annotation (Line(points={{-147.7,32},{-141.5,32}}, color={0,0,255}));
-  connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
-      points={{67.05,-46.5},{64,-46.5},{64,-46},{64,-48},{64,-46.8},{58,-46.8},
-          {52.7,-46.8}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-  connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (
-      Line(points={{25.8,53},{78,53},{78,-27.3},{52.7,-27.3}}, color={0,0,255}));
-  connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(
-        points={{23.3,-50.7},{-20,-50.7},{-20,-61}}, color={0,0,255}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    experiment(StopTime=3000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 14.3.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestPressurizer;
+within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
+model TestPressurizer
+
+  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
+    "Power released by the electrical heaters";
+  parameter Real OUVfeedwaterValve( fixed=false)=0.01
+    "OUV feed water valve";
+
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve_Spray(
+    Cv(start=100),
+    C1(
+      P(start=160e5),
+      h_vol(start=1270e3),
+      Q(start=0.3),
+      h(start=1270e3)),
+    Q(fixed=false, start=0.32),
+    Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{-90,
+            150}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Cvmax(fixed=true) = 5000,
+    Pm(start=15500000))
+    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=1,
+    D=1,
+    z1=1,
+    z2=0,
+    mode=0,
+    C1(P(start=160e5)),
+    C2(P(start=160e5)),
+    Q(fixed=false, start=0))
+             annotation (Placement(transformation(
+        origin={-30,-42},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=
+          true) = 0.5) annotation (Placement(transformation(extent={{0,156},{20,
+            176}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    h0=1270e3,
+    mode=0,
+    P0=16000000)
+           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
+    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
+           0)));
+  WaterSteam.Volumes.Pressurizer     pressurizer(
+    Zm=10.15,
+    Klv=0.5e6,
+    cpp=600,
+    hl(start=1629887.98290107),
+    hv(start=2596216.59571565),
+    Zl(start=5.5900717167325),
+    Yw0=60,
+    steady_state=true,
+    V=61.12,
+    Rp=1.27,
+    Ae=96.23,
+    Klp=1780,
+    Kvp=7500,
+    Mp=107e3,
+    Kpa=5.63,
+    Ccond=0.02,
+    Cevap=0.05,
+    Yw(start=32.92),
+    y(start=0.3292, fixed=true),
+    P0=15500000,
+    P(start=15500000, fixed=true),
+    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
+            -12},{32,118}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
+           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
+    option_temperature=2,
+    T0={310},
+    W0={1e5})
+    annotation (Placement(transformation(
+        origin={-133,32},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
+    T0={310},
+    W0={0.286e6},
+    option_temperature=1)
+    annotation (Placement(transformation(
+        origin={-133,55},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,
+        Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,
+        Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(
+          extent={{-175,19},{-149,45}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,
+        OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005;
+        300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(
+        transformation(extent={{-134,154},{-108,180}}, rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
+    Ti=50,
+    add(k1=+1, k2=-1),
+    minval=-100,
+    pIsat(
+      Limiteur1(u(signal(start=0.001))),
+      ureset0=0.0,
+      maxval=100,
+      Ti=2000)) annotation (Placement(transformation(extent={{52,-52},{24,-26}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92)
+    annotation (Placement(transformation(extent={{87,-56},{68,-37}}, rotation=0)));
+equation
+  connect(sourceP.C, FeedwaterValve_Spray.C1)
+    annotation (Line(points={{-148,134},{-110,134}}, color={0,0,255}));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
+        color={0,0,255}));
+  connect(SteamrValve_O.y, SteamValve.Ouv)
+    annotation (Line(points={{21,166},{68,166},{68,151}}));
+  connect(FeedwaterValve_Spray.C2, pressurizer.Cas)
+    annotation (Line(points={{-90,134},{-30,134},{-30,118}}, color={0,0,255}));
+  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
+          32,134},{58,134}}, color={0,0,255}));
+  connect(sinkQ1.C, lumpedStraightPipe.C2)
+    annotation (Line(points={{-30,-66},{-30,-52}}));
+  connect(lumpedStraightPipe.C1, pressurizer.Cex)
+    annotation (Line(points={{-30,-32},{-30,-12}}));
+  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
+          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
+  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
+          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
+  connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(
+        points={{-106.7,167},{-100,167},{-100,151}}, color={0,0,255}));
+  connect(ElectricalHeaters.y, SourceC1.ISignal)
+    annotation (Line(points={{-147.7,32},{-141.5,32}}, color={0,0,255}));
+  connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
+      points={{67.05,-46.5},{64,-46.5},{64,-46},{64,-48},{64,-46.8},{58,-46.8},
+          {52.7,-46.8}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+  connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (
+      Line(points={{25.8,53},{78,53},{78,-27.3},{52.7,-27.3}}, color={0,0,255}));
+  connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(
+        points={{23.3,-50.7},{-20,-50.7},{-20,-61}}, color={0,0,255}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    experiment(StopTime=3000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 14.3.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestPressurizer;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo
index 5fba9d0853c040df84476cfbf104bd677773f08e..fe86d2cdc26cddc7179d3bd797bf5764b5928108 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo
@@ -1,76 +1,76 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
-model TestSplitter3
-
-  ThermoSysPro.WaterSteam.Junctions.Splitter3 splitter3
-    annotation (Placement(transformation(extent={{-16,-10},{4,10}},  rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceP1(Q0=100)
-    annotation (Placement(transformation(extent={{-96,-10},{-76,10}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3 annotation (Placement(transformation(extent={{-56,-10},
-            {-36,10}},  rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP2
-    annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP3
-    annotation (Placement(transformation(extent={{84,-50},{104,-30}},  rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4 annotation (Placement(transformation(extent={{44,30},
-            {64,50}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5 annotation (Placement(transformation(extent={{44,-50},
-            {64,-30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
-        0) annotation (Placement(transformation(extent={{-36,10},{-16,30}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP4
-    annotation (Placement(transformation(extent={{84,-10},{104,10}},  rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=
-        0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}},
-          rotation=0)));
-equation
-  connect(sourceP1.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-76,0},{-56,0}},     color={0,0,255}));
-  connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},
-          {-15.8,0}},        color={0,0,255}));
-  connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},
-          {-2,40},{44,40}},        color={0,0,255}));
-  connect(singularPressureLoss4.C2, sinkP2.C)
-    annotation (Line(points={{64,40},{84,40}},   color={0,0,255}));
-  connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},
-          {-2,-40},{44,-40}},      color={0,0,255}));
-  connect(singularPressureLoss5.C2, sinkP3.C)
-    annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255}));
-  connect(constante1.y, splitter3.Ialpha1)
-    annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}}));
-  connect(splitter3.Cs3, sinkP4.C)
-    annotation (Line(points={{4,0},{84,0}},     color={0,0,255}));
-  connect(splitter3.Ialpha2, constante2.y)
-    annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 14.8.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestSplitter3;
+within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
+model TestSplitter3
+
+  ThermoSysPro.WaterSteam.Junctions.Splitter3 splitter3
+    annotation (Placement(transformation(extent={{-16,-10},{4,10}},  rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceP1(Q0=100)
+    annotation (Placement(transformation(extent={{-96,-10},{-76,10}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3 annotation (Placement(transformation(extent={{-56,-10},
+            {-36,10}},  rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP2
+    annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP3
+    annotation (Placement(transformation(extent={{84,-50},{104,-30}},  rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4 annotation (Placement(transformation(extent={{44,30},
+            {64,50}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5 annotation (Placement(transformation(extent={{44,-50},
+            {64,-30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
+        0) annotation (Placement(transformation(extent={{-36,10},{-16,30}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP4
+    annotation (Placement(transformation(extent={{84,-10},{104,10}},  rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=
+        0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}},
+          rotation=0)));
+equation
+  connect(sourceP1.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-76,0},{-56,0}},     color={0,0,255}));
+  connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},
+          {-15.8,0}},        color={0,0,255}));
+  connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},
+          {-2,40},{44,40}},        color={0,0,255}));
+  connect(singularPressureLoss4.C2, sinkP2.C)
+    annotation (Line(points={{64,40},{84,40}},   color={0,0,255}));
+  connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},
+          {-2,-40},{44,-40}},      color={0,0,255}));
+  connect(singularPressureLoss5.C2, sinkP3.C)
+    annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255}));
+  connect(constante1.y, splitter3.Ialpha1)
+    annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}}));
+  connect(splitter3.Cs3, sinkP4.C)
+    annotation (Line(points={{4,0},{84,0}},     color={0,0,255}));
+  connect(splitter3.Ialpha2, constante2.y)
+    annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 14.8.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestSplitter3;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo
index e0b1859c9872f94fa20b88b77967b1f10879ee6d..d6f163b52e8610922e8fc6b39688e2be9dbeb2b1 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo
@@ -1,113 +1,113 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
-model TestStaticDrum3
-
-  ThermoSysPro.WaterSteam.Junctions.StaticDrum StaticDrumTh1
-    annotation (Placement(transformation(extent={{-30,1},{20,51}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI1(K=1e-4)
-    annotation (Placement(transformation(extent={{38,7},{58,27}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI2(K=1e-4)
-    annotation (Placement(transformation(extent={{-58,-8},{-38,12}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=10)
-    annotation (Placement(transformation(extent={{74,7},{94,27}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(
-    Q0=100,
-    h0=1400e3,
-    P0=10000000)
-    annotation (Placement(transformation(extent={{-86,-8},{-66,12}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
-                                    annotation (Placement(transformation(
-        origin={-76,26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI3(K=1e-4)
-    annotation (Placement(transformation(extent={{38,52},{58,72}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{74,52},{94,72}}, rotation=0)));
-  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(
-    z1=0,
-    rugosrel=0.0001,
-    D=0.05,
-    ntubes=10,
-    L=10,
-    z2=10)           annotation (Placement(transformation(
-        origin={-28.5,-45.5},
-        extent={{13.5,11.5},{-13.5,-11.5}},
-        rotation=270)));
-  WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    lambda(fixed=false) = 0.03,
-    D=0.05,
-    ntubes=10,
-    L=10,
-    z1=10,
-    Q(fixed=true, start=30)) annotation (Placement(transformation(
-        origin={20,-45},
-        extent={{-14,-12},{14,12}},
-        rotation=270)));
-  WaterSteam.Volumes.VolumeA volumeA annotation (Placement(transformation(
-          extent={{1,-72},{-9,-62}}, rotation=0)));
-  Thermal.BoundaryConditions.HeatSource heatSource1(
-    option_temperature=2,
-    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6},
-    T0={300,300,300,300,300,300,300,300,300,300})
-    annotation (Placement(transformation(
-        origin={-76,-45},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
-                                                          annotation (Line(
-        points={{-38,2},{-15,2},{-15,2.5}}, color={0,0,255}));
-  connect(singularPressureLossVALI1.C2, sinkQ.C)  annotation (Line(points={{58,
-          17},{74,17}}, color={0,0,255}));
-  connect(heatSource.C[1], StaticDrumTh1.Cth)
-                                          annotation (Line(points={{-66.2,26},{
-          -5,26}}, color={191,95,0}));
-  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
-                                                          annotation (Line(
-        points={{4.5,49.5},{4.5,62},{38,62}}, color={0,0,255}));
-  connect(singularPressureLossVALI3.C2, sink.C)
-    annotation (Line(points={{58,62},{74,62}}, color={0,0,255}));
-  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(
-        points={{18.5,17.5},{38,17.5},{38,17}}, color={0,0,255}));
-  connect(sourcePQ.C, singularPressureLossVALI2.C1)
-    annotation (Line(points={{-66,2},{-58,2}}, color={0,0,255}));
-  connect(dynamicTwoPhaseFlowPipe.C2, StaticDrumTh1.Ce_eva) annotation (Line(
-        points={{-28.5,-32},{-28.5,-6},{-28.5,17.5}},
-                                           color={0,0,255}));
-  connect(StaticDrumTh1.Cs_eva, lumpedStraightPipe.C1) annotation (Line(points=
-          {{5,2.5},{20,2.5},{20,-31}}, color={0,0,255}));
-  connect(dynamicTwoPhaseFlowPipe.C1, volumeA.Cs1)
-    annotation (Line(points={{-28.5,-59},{-28,-59},{-28,-67},{-9,-67}}));
-  connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{20,-59},
-          {20,-67},{1,-67}}, color={0,0,255}));
-  connect(heatSource1.C, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{-66.2,
-          -45},{-31.95,-45},{-31.95,-45.5}},
-                                     color={191,95,0}));
-  annotation (experiment(StopTime=20), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 14.6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestStaticDrum3;
+within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
+model TestStaticDrum3
+
+  ThermoSysPro.WaterSteam.Junctions.StaticDrum StaticDrumTh1
+    annotation (Placement(transformation(extent={{-30,1},{20,51}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI1(K=1e-4)
+    annotation (Placement(transformation(extent={{38,7},{58,27}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI2(K=1e-4)
+    annotation (Placement(transformation(extent={{-58,-8},{-38,12}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=10)
+    annotation (Placement(transformation(extent={{74,7},{94,27}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(
+    Q0=100,
+    h0=1400e3,
+    P0=10000000)
+    annotation (Placement(transformation(extent={{-86,-8},{-66,12}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
+                                    annotation (Placement(transformation(
+        origin={-76,26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI3(K=1e-4)
+    annotation (Placement(transformation(extent={{38,52},{58,72}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{74,52},{94,72}}, rotation=0)));
+  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(
+    z1=0,
+    rugosrel=0.0001,
+    D=0.05,
+    ntubes=10,
+    L=10,
+    z2=10)           annotation (Placement(transformation(
+        origin={-28.5,-45.5},
+        extent={{13.5,11.5},{-13.5,-11.5}},
+        rotation=270)));
+  WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    lambda(fixed=false) = 0.03,
+    D=0.05,
+    ntubes=10,
+    L=10,
+    z1=10,
+    Q(fixed=true, start=30)) annotation (Placement(transformation(
+        origin={20,-45},
+        extent={{-14,-12},{14,12}},
+        rotation=270)));
+  WaterSteam.Volumes.VolumeA volumeA annotation (Placement(transformation(
+          extent={{1,-72},{-9,-62}}, rotation=0)));
+  Thermal.BoundaryConditions.HeatSource heatSource1(
+    option_temperature=2,
+    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6},
+    T0={300,300,300,300,300,300,300,300,300,300})
+    annotation (Placement(transformation(
+        origin={-76,-45},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
+                                                          annotation (Line(
+        points={{-38,2},{-15,2},{-15,2.5}}, color={0,0,255}));
+  connect(singularPressureLossVALI1.C2, sinkQ.C)  annotation (Line(points={{58,
+          17},{74,17}}, color={0,0,255}));
+  connect(heatSource.C[1], StaticDrumTh1.Cth)
+                                          annotation (Line(points={{-66.2,26},{
+          -5,26}}, color={191,95,0}));
+  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
+                                                          annotation (Line(
+        points={{4.5,49.5},{4.5,62},{38,62}}, color={0,0,255}));
+  connect(singularPressureLossVALI3.C2, sink.C)
+    annotation (Line(points={{58,62},{74,62}}, color={0,0,255}));
+  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(
+        points={{18.5,17.5},{38,17.5},{38,17}}, color={0,0,255}));
+  connect(sourcePQ.C, singularPressureLossVALI2.C1)
+    annotation (Line(points={{-66,2},{-58,2}}, color={0,0,255}));
+  connect(dynamicTwoPhaseFlowPipe.C2, StaticDrumTh1.Ce_eva) annotation (Line(
+        points={{-28.5,-32},{-28.5,-6},{-28.5,17.5}},
+                                           color={0,0,255}));
+  connect(StaticDrumTh1.Cs_eva, lumpedStraightPipe.C1) annotation (Line(points=
+          {{5,2.5},{20,2.5},{20,-31}}, color={0,0,255}));
+  connect(dynamicTwoPhaseFlowPipe.C1, volumeA.Cs1)
+    annotation (Line(points={{-28.5,-59},{-28,-59},{-28,-67},{-9,-67}}));
+  connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{20,-59},
+          {20,-67},{1,-67}}, color={0,0,255}));
+  connect(heatSource1.C, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{-66.2,
+          -45},{-31.95,-45},{-31.95,-45.5}},
+                                     color={191,95,0}));
+  annotation (experiment(StopTime=20), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 14.6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestStaticDrum3;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo
index f0accd32fcaba5289dc01d236a731d674f3f7a06..45e9342ab2d07b7fafac4252c3953a7222b38e75 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo
@@ -1,65 +1,65 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
-model TestSteamDryer
-  import ThermoSysPro;
-
-  ThermoSysPro.WaterSteam.Junctions.SteamDryer steamDryer(eta=0.9, P(start=
-          10000000)) annotation (Placement(transformation(extent={{-10,-8},{10,
-            12}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0=
-        2400000)
-    annotation (Placement(transformation(extent={{-90,-4},{-70,16}},  rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4},
-            {-30,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4},
-            {50,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1.e-4)
-                          annotation (Placement(transformation(extent={{30,-44},
-            {50,-24}},
-                     rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{70,-44},{90,-24}},
-                                                                   rotation=0)));
-equation
-  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-70,6},
-          {-50,6}},  color={0,0,255}));
-  connect(singularPressureLoss1.C2,sinkP. C)
-    annotation (Line(points={{50,6},{70,6}},   color={0,0,255}));
-  connect(singularPressureLoss3.C2,sink. C)
-    annotation (Line(points={{50,-34},{70,-34}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{-30,6},
-          {-20,6},{-9.9,6}},                     color={0,0,255}));
-  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{9.9,6},
-          {20,6},{30,6}},                    color={0,0,255}));
-  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{0.1,-8},
-          {0,-8},{0,-34},{30,-34}},             color={0,0,255}));
-  annotation (experiment(StopTime=10), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 14.9.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestSteamDryer;
+within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
+model TestSteamDryer
+  import ThermoSysPro;
+
+  ThermoSysPro.WaterSteam.Junctions.SteamDryer steamDryer(eta=0.9, P(start=
+          10000000)) annotation (Placement(transformation(extent={{-10,-8},{10,
+            12}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0=
+        2400000)
+    annotation (Placement(transformation(extent={{-90,-4},{-70,16}},  rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4},
+            {-30,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4},
+            {50,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1.e-4)
+                          annotation (Placement(transformation(extent={{30,-44},
+            {50,-24}},
+                     rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{70,-44},{90,-24}},
+                                                                   rotation=0)));
+equation
+  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-70,6},
+          {-50,6}},  color={0,0,255}));
+  connect(singularPressureLoss1.C2,sinkP. C)
+    annotation (Line(points={{50,6},{70,6}},   color={0,0,255}));
+  connect(singularPressureLoss3.C2,sink. C)
+    annotation (Line(points={{50,-34},{70,-34}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{-30,6},
+          {-20,6},{-9.9,6}},                     color={0,0,255}));
+  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{9.9,6},
+          {20,6},{30,6}},                    color={0,0,255}));
+  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{0.1,-8},
+          {0,-8},{0,-34},{30,-34}},             color={0,0,255}));
+  annotation (experiment(StopTime=10), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 14.9.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestSteamDryer;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestTank.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestTank.mo
index 622420c5d33a12786f3bb0aa88d8d77103fb6daf..ee36d3aacbbad7f94e917c3c96196bf502863b1d 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestTank.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestTank.mo
@@ -1,65 +1,65 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
-model TestTank
-
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PerteDP1
-    annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
-    annotation (Placement(transformation(extent={{-50,2},{-30,22}},  rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-                                            annotation (Placement(
-        transformation(extent={{-90,-4},{-70,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-50},{90,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Tank1(z(fixed=false, start=5))
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}},
-                                                                  rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
-    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PerteDP2
-    annotation (Placement(transformation(extent={{30,-4},{50,16}},   rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP2
-                                          annotation (Placement(transformation(
-          extent={{70,-4},{90,16}},   rotation=0)));
-equation
-  connect(PerteDP1.C2, PuitsP1.C)
-    annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255}));
-  connect(SourceP1.C, VanneReglante1.C1)
-    annotation (Line(points={{-70,6},{-50,6}},   color={0,0,255}));
-  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{10,-6},{20,-6},{20,
-          -40},{30,-40}}, color={0,0,255}));
-  connect(Rampe1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{-69,40},{-40,40},{-40,23}}));
-  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},
-          {-10,6}},               color={0,0,255}));
-  connect(Tank1.Cs1, PerteDP2.C1)
-    annotation (Line(points={{10.2,6},{20,6},{30,6}},   color={0,0,255}));
-  connect(PerteDP2.C2, PuitsP2.C)
-    annotation (Line(points={{50,6},{50,6},{70,6}},    color={0,0,255}));
-  annotation (experiment(StopTime=20),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 14.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestTank;
+within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
+model TestTank
+
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PerteDP1
+    annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
+    annotation (Placement(transformation(extent={{-50,2},{-30,22}},  rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+                                            annotation (Placement(
+        transformation(extent={{-90,-4},{-70,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-50},{90,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Tank1(z(fixed=false, start=5))
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}},
+                                                                  rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
+    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PerteDP2
+    annotation (Placement(transformation(extent={{30,-4},{50,16}},   rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP2
+                                          annotation (Placement(transformation(
+          extent={{70,-4},{90,16}},   rotation=0)));
+equation
+  connect(PerteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255}));
+  connect(SourceP1.C, VanneReglante1.C1)
+    annotation (Line(points={{-70,6},{-50,6}},   color={0,0,255}));
+  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{10,-6},{20,-6},{20,
+          -40},{30,-40}}, color={0,0,255}));
+  connect(Rampe1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{-69,40},{-40,40},{-40,23}}));
+  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},
+          {-10,6}},               color={0,0,255}));
+  connect(Tank1.Cs1, PerteDP2.C1)
+    annotation (Line(points={{10.2,6},{20,6},{30,6}},   color={0,0,255}));
+  connect(PerteDP2.C2, PuitsP2.C)
+    annotation (Line(points={{50,6},{50,6},{70,6}},    color={0,0,255}));
+  annotation (experiment(StopTime=20),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 14.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestTank;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo
index e1401d8210e88916222bcc7593ef48498c38c165..ab263b59e7f98a563098f81c2d251ab4f711436a 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo
@@ -1,83 +1,83 @@
-within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
-model TestVolumeATh
-
-  WaterSteam.Volumes.VolumeATh volumeATh(
-    h0=1.2e5,
-    V=1,
-    P0=300000,
-    P(start=300000))
-                   annotation (Placement(transformation(extent={{-15,21},{15,-9}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sink(
-    T0=320,
-    option_temperature=2,
-    h0=200000)
-    annotation (Placement(transformation(extent={{64,-4},{84,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1(Cvmax=80)
-    annotation (Placement(transformation(extent={{-47,-58},{-27,-38}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe(Finalvalue=
-        0, Initialvalue=1)           annotation (Placement(transformation(
-          extent={{-89,-38},{-73,-22}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2
-    annotation (Placement(transformation(extent={{28,2},{48,22}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourceQ sourceQ
-    annotation (Placement(transformation(extent={{-83,-6},{-59,18}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Constant
-                                     annotation (Placement(transformation(
-          extent={{10,18},{26,34}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
-      option_temperature=2)
-    annotation (Placement(transformation(extent={{-79,-64},{-59,-44}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
-     L=0.1, D=1)
-    annotation (Placement(transformation(extent={{-47,-4},{-27,16}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Table1DTemps(Table=[0,10;
-        5,-10; 8,0; 9,0]) annotation (Placement(transformation(extent={{-93,16},
-            {-73,36}}, rotation=0)));
-equation
-  connect(Rampe.y, controlValve1.Ouv)
-    annotation (Line(points={{-72.2,-30},{-37,-30},{-37,-37}}));
-  connect(Constant.y, controlValve2.Ouv)
-    annotation (Line(points={{26.8,26},{38,26},{38,23}}));
-  connect(volumeATh.Cs1, controlValve2.C1)
-    annotation (Line(points={{15,6},{28,6}}, color={0,0,255}));
-  connect(sourceP2.C, controlValve1.C1)
-    annotation (Line(points={{-59,-54},{-47,-54}}, color={0,0,255}));
-  connect(controlValve1.C2, volumeATh.Ce2)
-                                          annotation (Line(points={{-27,-54},{0,
-          -54},{0,-9}}, color={0,0,255}));
-  connect(sourceQ.C, lumpedStraightPipe1.C1)
-    annotation (Line(points={{-59,6},{-47,6}}, color={0,0,255}));
-  connect(lumpedStraightPipe1.C2, volumeATh.Ce1)
-    annotation (Line(points={{-27,6},{-15,6}}, color={0,0,255}));
-  connect(controlValve2.C2, sink.C)
-    annotation (Line(points={{48,6},{64,6}}, color={0,0,255}));
-  connect(Table1DTemps.y, sourceQ.IMassFlow)
-    annotation (Line(points={{-72,26},{-71,26},{-71,12}}));
-  annotation (experiment(StopTime=10), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This model is documented in Sect. 14.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestVolumeATh;
+within ThermoSysPro.Examples.Book.SimpleExamples.Volume;
+model TestVolumeATh
+
+  WaterSteam.Volumes.VolumeATh volumeATh(
+    h0=1.2e5,
+    V=1,
+    P0=300000,
+    P(start=300000))
+                   annotation (Placement(transformation(extent={{-15,21},{15,-9}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sink(
+    T0=320,
+    option_temperature=2,
+    h0=200000)
+    annotation (Placement(transformation(extent={{64,-4},{84,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1(Cvmax=80)
+    annotation (Placement(transformation(extent={{-47,-58},{-27,-38}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe(Finalvalue=
+        0, Initialvalue=1)           annotation (Placement(transformation(
+          extent={{-89,-38},{-73,-22}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2
+    annotation (Placement(transformation(extent={{28,2},{48,22}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourceQ sourceQ
+    annotation (Placement(transformation(extent={{-83,-6},{-59,18}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Constant
+                                     annotation (Placement(transformation(
+          extent={{10,18},{26,34}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
+      option_temperature=2)
+    annotation (Placement(transformation(extent={{-79,-64},{-59,-44}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
+     L=0.1, D=1)
+    annotation (Placement(transformation(extent={{-47,-4},{-27,16}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Table1DTemps(Table=[0,10;
+        5,-10; 8,0; 9,0]) annotation (Placement(transformation(extent={{-93,16},
+            {-73,36}}, rotation=0)));
+equation
+  connect(Rampe.y, controlValve1.Ouv)
+    annotation (Line(points={{-72.2,-30},{-37,-30},{-37,-37}}));
+  connect(Constant.y, controlValve2.Ouv)
+    annotation (Line(points={{26.8,26},{38,26},{38,23}}));
+  connect(volumeATh.Cs1, controlValve2.C1)
+    annotation (Line(points={{15,6},{28,6}}, color={0,0,255}));
+  connect(sourceP2.C, controlValve1.C1)
+    annotation (Line(points={{-59,-54},{-47,-54}}, color={0,0,255}));
+  connect(controlValve1.C2, volumeATh.Ce2)
+                                          annotation (Line(points={{-27,-54},{0,
+          -54},{0,-9}}, color={0,0,255}));
+  connect(sourceQ.C, lumpedStraightPipe1.C1)
+    annotation (Line(points={{-59,6},{-47,6}}, color={0,0,255}));
+  connect(lumpedStraightPipe1.C2, volumeATh.Ce1)
+    annotation (Line(points={{-27,6},{-15,6}}, color={0,0,255}));
+  connect(controlValve2.C2, sink.C)
+    annotation (Line(points={{48,6},{64,6}}, color={0,0,255}));
+  connect(Table1DTemps.y, sourceQ.IMassFlow)
+    annotation (Line(points={{-72,26},{-71,26},{-71,12}}));
+  annotation (experiment(StopTime=10), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This model is documented in Sect. 14.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestVolumeATh;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/package.mo
index b124d67afda2412f0aac3d1bc931290d51916e4a..19c5ef6ae005f4703f02083fc401d02a9c00b32f 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Examples.Book.SimpleExamples;
-package Volume "Volume modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple examples for Chapter 14 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end Volume;
+within ThermoSysPro.Examples.Book.SimpleExamples;
+package Volume "Volume modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple examples for Chapter 14 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end Volume;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/package.order
index b26c0f155dbca181518952e6f50677de224c6253..5e9d856999743ffd3c5eaf8ab8a586b00e633d9a 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/Volume/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/Volume/package.order
@@ -1,8 +1,8 @@
-TestVolumeATh
-TestDynamicDrum
-TestPressurizer
-TestTank
-TestStaticDrum3
-TestMixer3
-TestSplitter3
-TestSteamDryer
+TestVolumeATh
+TestDynamicDrum
+TestPressurizer
+TestTank
+TestStaticDrum3
+TestMixer3
+TestSplitter3
+TestSteamDryer
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/package.mo b/ThermoSysPro/Examples/Book/SimpleExamples/package.mo
index 327467a98e9b4a06a51fdc756347121d14f3e1c0..f07018fe7054d0887eb296933ef1f7a922505104 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/package.mo
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/package.mo
@@ -1,142 +1,142 @@
-within ThermoSysPro.Examples.Book;
-package SimpleExamples
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This package contains the simple <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a> examples.</p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end SimpleExamples;
+within ThermoSysPro.Examples.Book;
+package SimpleExamples
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This package contains the simple <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a> examples.</p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end SimpleExamples;
diff --git a/ThermoSysPro/Examples/Book/SimpleExamples/package.order b/ThermoSysPro/Examples/Book/SimpleExamples/package.order
index 0e3844d8124ec4cb9849a0ac6754e09ced3f5391..97339dc6d348582f8f0eabebd069adf6e615283f 100644
--- a/ThermoSysPro/Examples/Book/SimpleExamples/package.order
+++ b/ThermoSysPro/Examples/Book/SimpleExamples/package.order
@@ -1,10 +1,10 @@
-Boiler
-CombustionChamber
-HeatExchanger
-SteamTurbine
-GasTurbine
-CentrifugalPump
-PressureLoss
-Volume
-InternalCombustionEngine
-SolarCollector
+Boiler
+CombustionChamber
+HeatExchanger
+SteamTurbine
+GasTurbine
+CentrifugalPump
+PressureLoss
+Volume
+InternalCombustionEngine
+SolarCollector
diff --git a/ThermoSysPro/Examples/Book/package.mo b/ThermoSysPro/Examples/Book/package.mo
index e90779168805dd7c752705675ffc254da36546cc..eae6ec077c396a39f5f75eeaaeaf85344bba9d1a 100644
--- a/ThermoSysPro/Examples/Book/package.mo
+++ b/ThermoSysPro/Examples/Book/package.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.Examples;
-package Book "Examples of the ThermoSysPro book"
-  annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This package contains the examples of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"));
-end Book;
+within ThermoSysPro.Examples;
+package Book "Examples of the ThermoSysPro book"
+  annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This package contains the examples of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"));
+end Book;
diff --git a/ThermoSysPro/Examples/Book/package.order b/ThermoSysPro/Examples/Book/package.order
index ba9f03ebce8730a4cdaead0be73bbc6572fd35b4..68ac16d816376e1fc821b4310e359408ef8838cb 100644
--- a/ThermoSysPro/Examples/Book/package.order
+++ b/ThermoSysPro/Examples/Book/package.order
@@ -1,2 +1,2 @@
-PowerPlants
-SimpleExamples
+PowerPlants
+SimpleExamples
diff --git a/ThermoSysPro/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo b/ThermoSysPro/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo
index afa5d465c13aea74c3c2ade827942fa259734feb..c571e7ae192e7ddee3814e4c44d7922a5d667777 100644
--- a/ThermoSysPro/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo
+++ b/ThermoSysPro/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo
@@ -1,1837 +1,1837 @@
-within ThermoSysPro.Examples.CombinedCyclePowerPlant;
-model CombinedCycle_Load_100_50
-  "CCPP model to simulate a load variation from 100% to 50%"
-  parameter Real CstHP(fixed=false,start=7872243.329137064)
-    "Stodola's ellipse coefficient HP";
-  parameter Real CstMP(fixed=false,start=250346.99234192327)
-    "Stodola's ellipse coefficient MP";
-  parameter Real CstBP(fixed=false,start=10510.769959447052)
-    "Stodola's ellipse coefficient BP";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
-    "Maximum CV: alim. valve HP Drum  ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
-    "Maximum CV: steam valve BP Drum ";
-  parameter Real Encras_SHP1(fixed=false,start=1)
-    "Sur HP1: heat exchange fouling coefficient";
-  parameter Real Encras_SHP2(fixed=false,start=1)
-    "Sur HP2: heat exchange fouling coefficient";
-  parameter Real Encras_SHP3(fixed=false,start=1)
-    "Sur HP3: heat exchange fouling coefficient";
-  parameter Real Encras_EHP1(fixed=false,start=1)
-    "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Encras_EHP2(fixed=false,start=1)
-    "Eco HP2: heat exchange fouling coefficient";
-  parameter Real Encras_EHP3(fixed=false,start=1)
-    "Eco HP3: heat exchange fouling coefficient";
-  parameter Real Encras_EHP4(fixed=false,start=1)
-    "Eco HP4: heat exchange fouling coefficient";
-
-  parameter Real Encras_SMP1(fixed=false,start=1)
-    "Sur MP1: heat exchange fouling coefficient";
-  parameter Real Encras_SMP2(fixed=false,start=1)
-    "Sur MP2: heat exchange fouling coefficient";
-  parameter Real Encras_SMP3(fixed=false,start=1)
-    "Sur MP3: heat exchange fouling coefficient";
-  parameter Real Encras_EMP(fixed=false,start=1)
-    "Eco MP: heat exchange fouling coefficient";
-
-  parameter Real Encras_EvHP(fixed=false,start=1)
-    "Evapo HP: heat exchange fouling coefficient";
-  parameter Real Encras_EvMP(fixed=false,start=1)
-    "Evapo MP: heat exchange fouling coefficient";
-  parameter Real Encras_EvBP(fixed=false,start=1)
-    "Evapo BP: heat exchange fouling coefficient";
-
-  parameter Real Encras_SBP(fixed=false,start=1)
-    "Sur BP: heat exchange fouling coefficient";
-  parameter Real Encras_EBP(fixed=false,start=1)
-    "Eco BP: heat exchange fouling coefficient";
-
-  parameter Real KgainChargeHP(fixed=false,start=720.183)
-    "HP: Friction pressure loss coefficient";
-  parameter Real KgainChargeMP(fixed=false,start=1090.9)
-    "MP: Friction pressure loss coefficient";
-  parameter Real Kin_SMP2(fixed=false,start=10.)
-    "SMPin: Friction pressure loss coefficient";
-  parameter Real K_PerteChargeZero2(fixed=false,start=1e-4)
-    "TurbineMP out: Friction pressure loss coefficient";
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
-    "Maximum CV input Turbine HP ";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
-    "Maximum CV input Turbine MP ";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonHP(
-    L=16.27,
-    Vertical=false,
-    hl(fixed=false, start=1459929.6557225615),
-    hv(fixed=false, start=2664756.9335524077),
-    Vv(fixed=false),
-    R=1.05,
-    xmv(fixed=false),
-    P(fixed=false, start=12726786.684064418),
-    zl(start=1.05, fixed=true),
-    Mp=5000,
-    Kpa=5,
-    Kvl=1000,
-    Pfond(start=12733698.15963666),
-    Tp(start=589.4448369021196))
-                     annotation (Placement(transformation(extent={{38,10},{-2,
-            50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationHP(
-      Cvmax=CvmaxValveAHP,
-    C1(P(start=13374652.64958711),
-                            h_vol(start=1398250.7267619045)),
-    h(start=1398000),
-    Cv(start=178),
-    Pm(start=13050700))
-                 annotation (Placement(transformation(extent={{78,46},{58,66}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurHP(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurHP(
-    Cvmax=47829.4,
-    mode=0,
-    C2(h_vol(start=2664756.9335524077)),
-    h(start=2674000),
-    Cv(start=23914.7),
-    Pm(start=12725274.444912266))
-                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeHP(
-    z2=0,
-    mode=1,
-    Q(start=150, fixed=true),
-    z1=10.83,
-    K=KgainChargeHP,
-    C2(P(start=12758125.131063813)),
-    h(start=1474422.14552527),
-    Pm(start=12704000))
-            annotation (Placement(transformation(
-        origin={28,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,
-    h(start=1459929.6557225615),
-    P(start=12704000))                     annotation (Placement(transformation(
-          extent={{8,-100},{-12,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EvaporateurHP(
-    Dint=32.8e-3,
-    Ntubes=1476,
-    L=20.7,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
-      Tp(start={607.9743232022095,605.444949344346,604.0557720629383}),
-      Tp1(start={606.517435991606,604.7669177434965,603.7415072757717})),
-    Ns=3,
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.092,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      K(fixed=true, start=37.69),
-      CSailettes=11.86442072,
-      p_rho=1.05,
-      Encras=Encras_EvHP,
-      DeltaT(start={106,49,23}),
-      T(start={755.54833984375,674.4067359457392,636.0812177546504,
-            618.193603515625}),
-      Tm(start={714.9775457406769,655.2439768501948,627.1374112677474}),
-      Tp(start={609.3279079642047,606.0749042484599,604.3477535039484})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=10.83,
-      option_temperature=2,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={5.74e7,2.67e7,1.24e7}),
-      h(start={1459929.625,1842858.7345266847,2021072.953461077,
-            2103674.4922587443,1459929.625}),
-      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
-      P(start={12758125.0,12740268.20023451,12734647.766847359,
-            12730499.45519915,12726787.0})))
-                          annotation (Placement(transformation(
-        origin={-14,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurHP4(
-    Ns=3,
-    L=20.726,
-    Dint=0.0266,
-    Ntubes=246,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-3.5e6,-2.63e6,-2e6}),
-      Tp(start={576.9773977809047,582.0830364334571,585.8301318496927}),
-      Tp1(start={576.3268547206692,581.5931147025063,585.4596791589167})),
-    Cws1(P(start=13301170.910895599),
-                              h_vol(start=1291418.4097512758)),
-    Cws2(h_vol(start=1398250.726761905)),
-    ExchangerFlueGasesMetal(
-      Dext=0.0318,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.39069779,
-      K(fixed=true, start=47.53),
-      p_rho=1.06,
-      Encras=Encras_EHP4,
-      DeltaT(start={38,29,22}),
-      T(start={618.193603515625,613.1248964422501,609.3035158562986,
-            606.41162109375}),
-      Tm(start={615.6592506115472,611.2142061492743,607.857569142044}),
-      Tp(start={577.5724142989593,582.5311413173429,586.1689648703535})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      z2=0,
-      option_temperature=2,
-      inertia=true,
-      dW1(start={3.5e6,2.63e6,2e6}),
-      h(start={1291418.375,1337416.303924748,1372057.1590979556,
-            1398250.726761905,1398250.75}),
-      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
-      P(start={13301171.0,13320152.543490017,13338662.827011712,
-            13356802.623346366,13374653.0})))
-                          annotation (Placement(transformation(
-        origin={86,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=270)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurHP1(
-    Ns=3,
-    L=20.4,
-    Dint=0.0324,
-    Ntubes=246,
-    ExchangerWall(e=0.0028, lambda=37.61,
-    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
-      Tp(start={641.773975889456,659.2620935819541,674.5601453613823}),
-      Tp1(start={639.7214032623475,657.645496743186,673.3086347868172})),
-    Cws1(h_vol(start=2664756.9335524077)),
-    Cws2(P(start=12720371.43140221),
-                              h_vol(start=2973076.465167672)),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=10.25056,
-      K(fixed=true, start=34.71),
-      p_rho=1.04,
-      Encras=Encras_SHP1,
-      DeltaT(start={138,108,84}),
-      T(start={788.2433471679688,774.636330839027,763.888258455914,
-            755.54833984375}),
-      Tm(start={781.4398445109163,769.2622946474705,759.7183069957642}),
-      Tp(start={643.6693613731671,660.754890543465,675.715814566568})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      option_temperature=2,
-      inertia=true,
-      dW1(start={9.8e6,7.7e6,5.9e6}),
-      h(start={2664757.0,2793366.8463525265,2894659.427023337,2973076.465167672,
-            2973076.5}),
-      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
-      P(start={12723762.0,12723704.875007024,12723025.392511783,
-            12721873.859626876,12720371.0})))
-                          annotation (Placement(transformation(
-        origin={-54,-50},
-        extent={{-20,20},{20,-20}},
-        rotation=270)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurHP3(
-    Dint=26.6e-3,
-    Ntubes=1476,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
-      Tp(start={556.7923625573021,563.4515089057426,565.7949884705216}),
-      Tp1(start={556.3098450461794,563.2778280617686,565.7320909419939})),
-    L=20.726,
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=12.451,
-      K(fixed=true, start=36.0300000000857),
-      p_rho=1.08,
-      Encras=Encras_EHP3,
-      St=5, DeltaT(start={34,12,4.4}),
-      T(start={602.6719360351563,579.980900946576,571.7829862725544,
-            568.8102416992188}),
-      Tm(start={591.3264094805266,575.8819436095652,570.2965996068247}),
-      Tp(start={557.2336952021615,563.6103653709807,565.8525174347154})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.6e7,5.6e6,2.1e6}),
-      h(start={986348.0625,1191052.0456419336,1264734.6677716642,
-            1291418.4097512758,1291418.375}),
-      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
-      P(start={13219328.0,13241437.958285147,13261883.227869928,
-            13281654.651763307,13301171.0})))
-                  annotation (Placement(transformation(
-        origin={206,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurHP2(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-5e6,-3e6,-2.e6}),
-      Tp(start={491.54343078281,498.9069980271022,503.5184174104173}),
-      Tp1(start={491.3392380231037,498.7785262547952,503.4374982277421})),
-    L=20.767,
-    Ntubes=1107,
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=111e-3,
-      CSailettes=2.76134577,
-      K(fixed=true, start=65.5300000000393),
-      p_rho=1.11,
-      Encras=Encras_EHP2,
-      St=5, DeltaT(start={36,23,14}),
-      T(start={531.16064453125,523.8360138077611,519.2214124321695,
-            516.3124389648438}),
-      Tm(start={527.4983362936189,521.5287131199652,517.7669224567446}),
-      Tp(start={491.73019484551236,499.02450420201814,503.5924298060023})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={5e6,3e6,2.e6}),
-      h(start={854493.25,919592.0464622772,960550.2028257779,986348.0919441726,
-            986348.0625}),
-      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
-      P(start={13129347.0,13152374.515059257,13174952.371260952,
-            13197235.505730344,13219328.0})))
-                  annotation (Placement(transformation(
-        origin={406,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurHP1(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-9.9999e6,-5e6,-2.4e6}),
-      Tp(start={460.16002911133717,469.99835357411166,474.7738719222592}),
-      Tp1(start={459.7281425156256,469.7896188414262,474.67326898241726})),
-    L=20.726,
-    Ntubes=1107,
-    Cws1(h_vol(start=618649.6677733721)),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=8.30057632,
-      K(fixed=true, start=40.24),
-      p_rho=1.13,
-      Encras=Encras_EHP1,
-      St=5,   DeltaT(start={41,20,10}),
-      T(start={509.31475830078125,493.76452187742854,486.23046610566547,
-            482.5950622558594}),
-      Tm(start={501.5396335543568,489.997493991547,484.4127676365523}),
-      Tp(start={460.5550523989298,470.18927193360446,474.8658879848841})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.767,
-      inertia=true,
-      dW1(start={9.9999e6,5e6,2.4e6}),
-      h(start={618649.6875,756067.8313424552,822483.2837402308,854493.240474255,
-            854493.25}),
-      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
-      advection=true,
-      dynamic_mass_balance=true,
-      P(start={13034952.0,13059418.53296798,13083081.248541538,
-            13106320.315256517,13129347.0})))
-                  annotation (Placement(transformation(
-        origin={526,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurHP2(
-    Ns=3,
-    L=20.4,
-    Dint=32e-3,
-    Ntubes=246,
-    ExchangerWall(e=3e-3, lambda=27,
-          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
-      Tp(start={718.0864855457228,738.9518857688491,755.2055454298172}),
-      Tp1(start={715.3026673550778,736.860075660393,753.6461561287115})),
-    Cws2(P(start=12711006.754972342),
-                               h_vol(start=3240813.8516343245)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      K(fixed=true, start=34.74),
-      CSailettes=10.2505424803872,
-      p_rho=1.02,
-      Encras=Encras_SHP2,
-      St=5,
-      DeltaT(start={124,93,70}),
-      T(start={850.646484375,838.5707346201303,829.4749488031354,
-            822.6819458007813}),
-      Tm(start={844.6086089059804,834.0228417116329,826.0784372242802}),
-      Tp(start={720.6412271937046,740.871563720893,756.6366147445857})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.83,
-      inertia=true,
-      dW1(start={8.8e6,6.6e6,4.9e6}),
-      h(start={2973076.5,3088900.88921149,3175933.4050769014,3240813.8516343245,
-            3240813.75}),
-      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
-      P(start={12720371.0,12718678.034082344,12716464.21434507,
-            12713872.892207509,12711007.0})))
-                  annotation (Placement(transformation(
-        origin={-174,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurHP3(
-    Ns=3,
-    L=20.4,
-    Ntubes=246,
-    ExchangerWall(lambda=27, e=5e-3,
-    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
-      Tp(start={789.3906813408935,806.8419831862884,820.1561431707274}),
-      Tp1(start={785.7263795421367,804.0878954218736,818.093373707382})),
-    Dint=28e-3,
-    Cws2(h_vol(start=3433271.775819776)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      K(fixed=true, start=49.33),
-      CSailettes=6.59672842597229,
-      p_rho=1,
-      Encras=Encras_SHP3,
-      St=5,
-      DeltaT(start={97,73,55}),
-      T(start={894.2188110351563,885.636025090525,879.1746662824661,
-            874.3292236328125}),
-      Tm(start={889.9274067093704,882.4053456864956,876.7519418617093}),
-      Tp(start={792.5370292454647,809.2067770105702,821.927337447906})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.726,
-      inertia=true,
-      dW1(start={6.3e6,4.7e6,3.6e6}),
-      h(start={3240813.75,3323965.684475156,3386462.568744374,3433271.775819776,
-            3433271.75}),
-      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
-      P(start={12711007.0,12704270.150400551,12696927.059489354,
-            12689132.094962938,12681000.0})),
-    Cfg1(T(start=894.218788328216)))
-                  annotation (Placement(transformation(
-        origin={-294,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonMP(
-    L=16.27,
-    Vertical=false,
-    P0=27.29e5,
-    hl(fixed=false, start=980708.0463805634),
-    hv(fixed=false, start=2798574.7604119307),
-    Vv(fixed=false),
-    R=1.05,
-    P(fixed=false, start=2733824.789876998),
-    zl(start=1.05, fixed=true),
-    Kpa=5,
-    Mp=5000,
-    Kvl=1000,
-    Pfond(start=2742370.2498246767),
-    Tp(start=497.3822823273814))
-                     annotation (Placement(transformation(extent={{358,10},{320,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurMP(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationMP(
-      Cvmax=CvmaxValveAMP,
-    C1(P(start=3216971.701899643),
-                           h_vol(start=944504.749093579)),
-    h(start=944000),
-    Cv(start=28),
-    Pm(start=2975000))
-                 annotation (Placement(transformation(extent={{398,46},{378,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurMP(
-    Cvmax=47829.4,
-    mode=0,
-    C2(h_vol(start=2798574.7604119307)),
-    h(fixed=false, start=2798000),
-    Cv(start=23914.7),
-    Pm(fixed=false, start=2732575.5179918623))
-                 annotation (Placement(transformation(extent={{298,46},{278,66}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EvaporateurMP(
-    Dint=32.8e-3,
-    L=20.767,
-    Ntubes=738,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
-      Tp(start={504.98976100715464,504.26964479130794,503.6922361659351}),
-      Tp1(start={504.4959569394237,503.8875506396794,503.39662949233303})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.83,
-      continuous_flow_reversal=true,
-      inertia=true,
-          dW1(start={9.7e7,7.6e6,5.8e6}),
-      P(start={2773367.25,2751227.106127094,2743473.7578241928,
-            2738204.9403230133,2733824.75}),
-      h(start={980708.0625,1045813.9695051656,1096191.4250344052,
-            1135165.8819583436,980708.0625}),
-      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
-    Cws1(P(start=2773367.372876323)),
-    ExchangerFlueGasesMetal(
-      K(fixed=true, start=30.22),
-      Dext=38e-3,
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=10.0676093,
-      p_rho=1.1,
-      Encras=Encras_EvMP,
-      St=5,
-      DeltaT(start={53,41,32}),
-      T(start={565.2481689453125,550.9126306026692,539.787269523939,
-            531.16064453125}),
-      Tm(start={558.0803978580261,545.349950063304,535.4739641517078}),
-      Tp(start={505.44855126670757,504.624646069051,503.9668824707551})))
-                          annotation (Placement(transformation(
-        origin={306,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeMP(
-    z2=0,
-    z1=10.83,
-    mode=1,
-    Q(start=150, fixed=true),
-    K=KgainChargeMP,
-    Pm(start=2734000),
-    h(start=978914.570821827))
-            annotation (Placement(transformation(
-        origin={348,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
-    h(start=980708.0463805634),
-    P(start=2734000))                      annotation (Placement(transformation(
-          extent={{328,-100},{308,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurMP(
-    ExchangerWall(e=2.6e-3, lambda=47,
-        dW1(start={-3e6,-1.4e6,-740379}),
-      Tp(start={469.31277462346344,487.36995421739016,497.00024549998545}),
-      Tp1(start={468.830886627779,487.11263557868836,496.8627293559427})),
-    L=20.726,
-    Ns=3,
-    Dint=26.6e-3,
-    Ntubes=246,
-    Cws1(h_vol(start=565106.2802015315)),
-    Cws2(h_vol(start=944504.7490935794)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      K(fixed=true, start=47.78),
-      CSailettes=7.16188651,
-      p_rho=1.12,
-      Encras=Encras_EMP,
-      St=5,
-      DeltaT(start={45,24,13}),
-      T(start={516.3124389648438,512.4675048876576,510.41305969109146,
-            509.31475830078125}),
-      Tm(start={514.3899686844887,511.4402822893745,509.8639024611882}),
-      Tp(start={469.75353148474505,487.6053096442755,497.12602407127685})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.767,
-      z2=0,
-      inertia=true,
-      dW1(start={3e6,1.4e6,740379}),
-      h(start={565106.25,773641.4896138782,884995.1575722523,944504.7490935792,
-            944504.75}),
-      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
-      P(start={3124223.75,3148825.327098676,3172192.2961615147,
-            3194799.9976396263,3216971.75})))
-                          annotation (Placement(transformation(
-        origin={466,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurMP1(
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.3e6,-0.80263e6,
-                                -501864}),
-      Tp(start={558.2379692767729,574.1762943611731,584.4002179866045}),
-      Tp1(start={557.8513010794924,573.9323757073441,584.2477131820202})),
-    L=20.726,
-    Ns=3,
-    Dint=32.8e-3,
-    Ntubes=123,
-    Cws1(h_vol(start=2798574.7604119307)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      K(fixed=true, start=22.09),
-      CSailettes=14.46509765,
-      p_rho=1.07,
-      Encras=Encras_SMP1,
-      St=5,
-      DeltaT(start={45,30,19}),
-      T(start={606.41162109375,604.5654891969185,603.4004814494892,
-            602.6719360351563}),
-      Tm(start={605.488555812354,603.9829853232038,603.0361997319833}),
-      Tp(start={558.5972202716488,574.4029176513201,584.54190924323})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.77,
-      inertia=true,
-      dW1(start={1.3e6,0.80263e6,501864}),
-      h(start={2798574.75,2900855.9998369273,2965377.215724287,
-            3005717.6950751985,3040562.75}),
-      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
-      P(start={2731326.25,2730394.924575977,2729276.921848465,
-            2728029.2082540947,2726700.0})))
-                          annotation (Placement(transformation(
-        origin={146,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Volumes.VolumeB MelangeurHPMP(
-    Ce1(h(start=3046256.0341363903)),
-    h(start=3040562.6721177064),
-    P(start=2726000))
-    annotation (Placement(transformation(
-        origin={148,-110},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurMP2(
-    Ns=3,
-    L=20.4,
-    Dint=39.3e-3,
-    Ntubes=369,
-    ExchangerWall(e=2.6e-3, lambda=36.86,
-    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
-      Tp(start={689.1325590707521,714.3255084496102,731.974510062409}),
-      Tp1(start={687.8673243896432,713.4490802987744,731.369523912658})),
-    Cws1(P(start=2575582.5771302995),
-                             h_vol(start=3040562.6721177064)),
-    Cws2(P(start=2558239.090625735),
-                             h_vol(start=3321940.994604838)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=92e-3,
-      K(fixed=true, start=45.22),
-      CSailettes=5.814209831,
-      p_rho=1.03,
-      Encras=Encras_SMP2,
-      St=5,
-      DeltaT(start={125,86,60}),
-      T(start={822.6819458007813,806.8523532375756,795.852828640494,
-            788.2433471679688}),
-      Tm(start={814.7671394415003,801.3525909390348,792.0480934116497}),
-      Tp(start={690.3215978858725,715.1491557188672,732.5430623045928})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dW1(start={1.15e7,7.9e6,5.5e6}),
-      h(start={3040562.75,3170178.6567147295,3259963.658181113,
-            3321940.994604838,3321941.0}),
-      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
-      P(start={2575582.5,2571900.999964748,2567682.4202753096,
-            2563090.6820579167,2558239.0})))
-                          annotation (Placement(transformation(
-        origin={-114,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurMP3(
-    Ns=3,
-    L=20.4,
-    Ntubes=369,
-    Dint=45.6e-3,
-    ExchangerWall(e=2.6e-3, lambda=27,
-    dW1(start={-8e6,-5.5e6,-3.8e6}),
-      Tp(start={786.239853752146,802.8777020553458,814.3692554800219}),
-      Tp1(start={785.1915402608809,802.1579544921993,813.8760433493436})),
-    Cws2(h_vol(start=3517975.7051807973)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=92e-3,
-      Dext=50.8e-3,
-      K(fixed=true, start=43.23),
-      CSailettes=5.695842178,
-      p_rho=1.01,
-      Encras=Encras_SMP3,
-      St=5,
-      DeltaT(start={82,56,38}),
-      T(start={874.3292236328125,863.3655435931397,855.822658205448,
-            850.646484375}),
-      Tm(start={868.8473805170461,859.5941008992938,853.2345706986391}),
-      Tp(start={787.2330782757132,803.5596268196659,814.8365492691358})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dW1(start={8e6,5.5e6,3.8e6}),
-      h(start={3321941.0,3412821.580454202,3475218.0684875553,
-            3517975.7051807973,3517975.75}),
-      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
-      P(start={2558239.0,2556052.5796892336,2553681.6710159215,
-            2551184.3906656993,2548600.0})))
-                          annotation (Placement(transformation(
-        origin={-234,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonBP(
-    Vertical=false,
-    P0=5e5,
-    Vv(fixed=false),
-    L=8,
-    hl(fixed=false, start=550072.7232069891),
-    hv(fixed=false, start=2684673.580149807),
-    R=2,
-    P(fixed=false, start=485579.1243268126),
-    zl(start=1.75, fixed=true),
-    Kpa=5,
-    Mp=5000,
-    Kvl=1000,
-    Pfond(start=501612.0798822072),
-    Tp(start=406.2632923392337))
-                     annotation (Placement(transformation(extent={{618,10},{578,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurBP(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurBP(
-    p_rho=3, Cvmax=CvmaxValveVBP,
-    C2(P(start=510622.8582477031),
-                          h_vol(start=2684673.580149807)),
-    h(start=2685000),
-    Cv(start=1),
-    Pm(start=498000))
-                 annotation (Placement(transformation(extent={{558,46},{538,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationBP(
-    Cvmax=285,
-    C1(h_vol(start=509236.1596958067)),
-    h(fixed=false, start=509000),
-    Cv(start=142.5),
-    Pm(fixed=false, start=957583.6711025466))
-                 annotation (Placement(transformation(extent={{650,44},{630,64}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeBP(
-    z2=0,
-    z1=10.767,
-    Q(start=50, fixed=false),
-    K=32766,
-    mode=1,
-    pro(d(start=934.2358753989836)),
-    Pm(start=564000),
-    h(start=549249.519022482))
-            annotation (Placement(transformation(
-        origin={610,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=
-          550072.7232069891),                                          mode=1,
-    V=5,
-    P(start=564000))                       annotation (Placement(transformation(
-          extent={{592,-100},{572,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EvaporateurBP(
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
-      Tp(start={427.75117227047275,426.57196634952743,425.692416702357}),
-      Tp1(start={427.2791524733697,426.249857647769,425.4722112637204})),
-    L=20.726,
-    Ntubes=984,
-    Ns=3,
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=138e-3,
-      K(fixed=true, start=30.62),
-      CSailettes=11.07985,
-      p_rho=1.14,
-      Encras=Encras_EvBP,
-      St=5,
-      DeltaT(start={45,31,21}),
-      T(start={482.5950622558594,464.01748118772224,451.30051770870455,
-            442.58880615234375}),
-      Tm(start={473.3062751775807,457.6589994482134,446.94466391603106}),
-      Tp(start={428.18972290092955,426.87123552234135,425.89700819308825})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={1.24e7,8.5e6,5.8e6}),
-      h(start={550072.75,798514.7797723989,968052.8982857756,1083955.4353773424,
-            550072.75}),
-      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
-      Q(start={50.00030606442327,50.00030606442327,50.00030606442327,
-            50.00030606442327}),
-      P(start={512574.0,487903.6002327947,486912.76813325885,486233.0185244784,
-            485579.125})))
-                          annotation (Placement(transformation(
-        origin={566,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_ballonBP(k=1)
-    annotation (Placement(transformation(extent={{742,6},{728,18}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP(
-                          mode=1,
-    Cvmax=308.931,
-    C1(h_vol(start=550072.7232069891)),
-    h(start=550000),
-    Cv(start=308.931),
-    Pm(start=404001.70325999695))
-                 annotation (Placement(transformation(extent={{710,-14},{730,6}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurBP(
-    Ns=3,
-    L=20.726,
-    Dint=39.3e-3,
-    Ntubes=123,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.1e6,-782901,-559798}),
-      Tp(start={475.35471340675434,500.0471952971929,518.0415300925415}),
-      Tp1(start={475.07666786714793,499.8473601819379,517.8986430965637})),
-    Cws1(h_vol(start=2684673.580149807)),
-    Cws2(h_vol(start=2914519.282601244)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=222.1e-3,
-      K(fixed=true, start=30.46),
-      CSailettes=3.25763059984175,
-      p_rho=1.09,
-      Encras=Encras_SBP,
-      St=5,
-      DeltaT(start={92,66,47}),
-      T(start={568.8102416992188,567.2151210721856,566.0683353396659,
-            565.2481689453125}),
-      Tm(start={568.0126670066404,566.6417282059258,565.6582502265244}),
-      Tp(start={475.61601428945164,500.234995799533,518.1758120458845})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      rugosrel=1e-5,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.1e6,782901,559798}),
-      h(start={2684673.5,2787622.843498506,2861613.8808508525,2914519.282601244,
-            2914519.25}),
-      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
-      P(start={510622.84375,508733.6061914782,506650.25202074344,
-            504336.5353393364,501850.0})))
-                          annotation (Placement(transformation(
-        origin={266,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5)
-    annotation (Placement(transformation(
-        origin={722,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurBP(
-    Ns=3,
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
-      Tp(start={400.3519750836609,396.09689492479714,395.2201421057111}),
-      Tp1(start={400.0855824116385,396.0373810697358,395.20741736846634})),
-    Ntubes=3444,
-    L=20.726,
-    Cws1(h_vol(start=194584.50261459063)),
-    Cws2(h_vol(start=509236.15969580685)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=92e-3,
-      K(fixed=true, start=31.53),
-      CSailettes=11.673758598919,
-      p_rho=1.15,
-      Encras=Encras_EBP,
-      St=5,
-      DeltaT(start={23.5,5.3,1.1}),
-      T(start={442.58880615234375,405.54898708865323,397.2418326138536,
-            395.4642028808594}),
-      Tm(start={424.0688986060054,401.3954098512534,396.353024695102}),
-      Tp(start={400.59947884299936,396.1521888739459,395.23196457920767})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      inertia=true,
-      dW1(start={2.45e7,5.5e6,1.17e6}),
-      h(start={194584.5,442113.0226180337,497412.50346040993,509236.1596958068,
-            509236.15625}),
-      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
-      P(start={1540564.125,1504650.386070031,1479432.0451056722,
-            1454480.269096047,1429588.25})))
-                          annotation (Placement(transformation(
-        origin={680,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineHP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.88057),
-    Qmax=140,
-    eta_is_nom=0.88057,
-    eta_is_min=0.75,
-    Cst(start=8182844.56002535)=
-        CstHP,
-    pros(d(start=10.66426189633104)),
-    Hrs(start=3046256.0341363903),
-    Pe(fixed=true, start=12431000),
-    Ps(fixed=false, start=2726700))
-              annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineMP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9625),
-    Qmax=150,
-    eta_is_nom=0.9625,
-    eta_is_min=0.75,
-    Cst(start=256335.364995961)=
-        CstMP,
-    pros(d(start=1.8827680646065352)),
-    Hrs(start=3029781.976396904),
-    Pe(fixed=true, start=2548500),
-    Ps(fixed=false, start=476800))
-                annotation (Placement(transformation(extent={{318,-250},{358,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC MelangeurPostTMP1(
-    h(start=3017480.4191624634),
-    P(start=476799.99999954),
-    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
-        origin={418,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineBP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9538),
-    Qmax=150,
-    eta_is_nom=0.9538,
-    eta_is_min=0.75,
-    Cst(start=11944.9445735985)=
-        CstBP,
-    Cs(h(start=2401033.111118852)),
-    Hrs(start=2401030),
-    Pe(fixed=true, start=476799.99999954),
-    Ps(start=10053))
-                annotation (Placement(transformation(extent={{576,-250},{616,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-292,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-232,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(
-                                                    alpha=0.5,
-    Ce(h(start=3046260)),
-    P(start=2726700))
-    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenseur(
-    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    Vf0=0.15,
-    steady_state=false,
-    yNiveau(signal(start=1.5)),
-    Cse(h(start=128076)),
-    P(fixed=false, start=6136),
-    Pfond(start=10000.0),
-    Cl(h(start=191812.29519356362)),
-    proe(d(start=996.0186965963143)))
-    annotation (Placement(transformation(extent={{637,-384},{717,-304}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
-    h0=113.38e3, Q0=29804.5)     annotation (Placement(transformation(extent={{
-            572,-377},{620,-329}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK1(    K=1e-4,
-    h(start=2400000),
-    C1(h_vol(start=2400000), h(start=2400000)),
-    Pm(start=10026.561030835077))
-    annotation (Placement(transformation(extent={{640,-240},{660,-220}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
-    Ce3(h(start=194584.50261452305)),
-    h(start=194584.50261459063),
-    P(start=1540500))
-    annotation (Placement(transformation(
-        origin={902,-318},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeKCond1(    K=1e-4, mode=1,
-    pro(d(start=990.3586687482405)),
-    Pm(start=1540000))
-    annotation (Placement(transformation(
-        origin={902,-270},
-        extent={{12,-12},{-12,12}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
-    h(start=550072.7232069891),
-    P(start=322430))                       annotation (Placement(transformation(
-          extent={{742,-20},{762,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimMP(
-    a3=350,
-    b1(fixed=true) = -3.7751,
-    a1=-244551,
-    Q(fixed=false),
-    mode=1,
-    C1(h_vol(start=550072.7232069891)),
-    C2(h_vol(start=565106.2802015315)),
-    Qv(start=0.01332183238847357),
-    pro(d(start=933.5252816181976)),
-    Pm(start=1725850))
-            annotation (Placement(transformation(extent={{804,-20},{824,0}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimHP(
-    a3=1600,
-    a1=-28056.2,
-    b1=-12.7952660447433,
-    Q(fixed=false),
-    mode=1,
-    C1(h_vol(start=550072.7232069891)),
-    C2(h_vol(start=618649.6677733721)),
-    Qv(start=0.08171817156952406),
-    pro(d(start=931.4140647908531)),
-    Pm(start=6774000))
-             annotation (Placement(transformation(extent={{804,-60},{824,-40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
-                                                    alpha=0.5,
-    h(start=194585),
-    P(start=1540500),
-    Cs(h(start=194585)))
-    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={268,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss PerteChargeZero2(
-    z2=0,
-    mode=0,
-    z1=0,
-    K=K_PerteChargeZero2,
-    h(start=3000000),
-    C1(
-      h_vol(start=3000000),
-      h(start=3000000),
-      P(fixed=true, start=501850)),
-    Pm(start=490000))
-            annotation (Placement(transformation(
-        origin={344,-278},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK3(    K=1e-4, mode=1,
-    Pm(start=322424.2818830876))
-    annotation (Placement(transformation(
-        origin={780,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK8(    K=1e-4, mode=1,
-    Pm(start=322424.28218490275))
-    annotation (Placement(transformation(
-        origin={780,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
-    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK(
-                                                         K=1e-4, mode=1,
-    C1(h_vol(start=191812.29519356362)),
-    C2(h_vol(start=191812.29519356362)),
-    pro(d(start=989.8383588386498)),
-    Pm(start=6200))
-    annotation (Placement(transformation(extent={{702,-446},{722,-426}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimBP(
-    Qv(start=0.2002405532484127),
-    mode=1,
-    a3=400,
-    a1(fixed=true) = -6000,
-    Q(start=194.502, fixed=false),
-    C2(h_vol(start=194584.50261452305)),
-    Pm(start=783963.3809799375))
-            annotation (Placement(transformation(extent={{742,-446},{762,-426}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK2(
-                                                         K=1e-4, mode=1,
-    pro(d(start=990.3586687495459)),
-    C1(h_vol(start=194584.50261452305),
-                            h(start=194585)),
-    Pm(start=1546000))
-    annotation (Placement(transformation(extent={{840,-446},{860,-426}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_extraction(            mode=1, Cvmax=
-        2000,
-    h(start=194500),
-    Cv(start=2000),
-    Pm(start=1549245.4644062065))
-                 annotation (Placement(transformation(extent={{802,-440},{822,
-            -420}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol(start=2674000),
-        h(start=2674000)))
-    annotation (Placement(transformation(
-        origin={-58,8},
-        extent={{-6,6},{6,-6}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol(start=1398000),
-        h(start=1398000))) " "
-    annotation (Placement(transformation(
-        origin={91.5,32},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol(start=944000),
-        h(start=944000)))
-    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol(start=2798000),
-        h(start=2798000)))
-    annotation (Placement(transformation(
-        origin={236,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol(start=2685000),
-        h(start=2685000)))
-    annotation (Placement(transformation(
-        origin={514,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol(start=550000),
-        h(start=550000)))
-    annotation (Placement(transformation(
-        origin={663.5,34},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol(
-          start=550000), h(start=550000)))
-    annotation (Placement(transformation(extent={{687,-11},{700,1}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol(
-          start=194585), h(start=194585)))
-    annotation (Placement(transformation(
-        origin={685.5,-412},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol(
-          start=2401000), h(start=2401000)))
-    annotation (Placement(transformation(
-        origin={684.5,-264},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipeK2(
-                                                          K=Kin_SMP2,
-    Pm(start=2651000),
-    C1(
-      P(fixed=true, start=2726700),
-      h_vol(start=3046000),
-      h(start=3046000)))
-    annotation (Placement(transformation(extent={{114,-120},{94,-100}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_entree_TurbineHP(
-    mode=0,
-    C1(P(fixed=true, start=12680999.9999969)),
-    Cvmax=Cvmax_THP,
-    h(fixed=false, start=3433000),
-    Cv(start=10875),
-    Pm(fixed=false, start=12550000))
-                 annotation (Placement(transformation(extent={{-124,-234},{-104,
-            -214}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauHP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl
-    regulation_Niveau_HP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500)
-    annotation (Placement(transformation(extent={{-40,106},{-20,126}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauMP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl
-    regulation_Niveau_MP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500)
-    annotation (Placement(transformation(extent={{262,106},{282,126}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauBP(                                                              k=1.75)
-    annotation (Placement(transformation(extent={{470,126},{504,144}}, rotation=
-           0)));
-  Control.Drum_LevelControl regulation_Niveau_BP(
-                     add(k1=-1, k2=+1), pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    Ti=10)
-    annotation (Placement(transformation(extent={{568,108},{588,128}}, rotation=
-           0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauCondenseur1(                                 k=1.5)
-    annotation (Placement(transformation(extent={{716,-246},{740,-230}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-                                                add(k1=+1, k2=-1),
-    edge(uL(signal(start=true))))
-                                 annotation (Placement(transformation(extent={{
-            758,-282},{778,-262}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneTurbineHP(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
-            -138,-142}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{944,-42},{906,
-            -10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{945,-96},{907,
-            -64}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{945,-458},{907,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
-    mode=1,
-    V=1,
-    h0=988332,
-    h(start=854493.2404741034),
-    dynamic_mass_balance=true,
-    P0=7010000,
-    P(start=13129347.20636851))           annotation (Placement(transformation(
-          extent={{456,-98},{436,-78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
-    mode=1,
-    V=1,
-    h0=983786,
-    h(start=986348.0919441726),
-    dynamic_mass_balance=true,
-    P0=7000000,
-    P(start=13219328.239579093))          annotation (Placement(transformation(
-          extent={{252,-20},{232,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP1(
-                          mode=1,
-    Cvmax=308.931,
-    h(start=618600),
-    Cv(start=308.931),
-    Pm(start=13130272.672059398))
-                 annotation (Placement(transformation(extent={{754,-98},{730,
-            -122}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP2(
-                          mode=1,
-    Cvmax=308.931,
-    h(start=565000),
-    Cv(start=308.931),
-    Pm(start=3126744.5275077047))
-                 annotation (Placement(transformation(extent={{804,-138},{780,
-            -162}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(
-    Initialvalue=0.8,
-    Finalvalue=0.01,
-    Duration=1000,
-    Starttime=200000)
-                     annotation (Placement(transformation(extent={{946,-150},{
-            908,-118}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(
-    Initialvalue=0.8,
-    Finalvalue=0.01,
-    Duration=1000,
-    Starttime=200000)
-                     annotation (Placement(transformation(extent={{946,-194},{
-            908,-162}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
-    h0=3e6,
-    h(start=3433271.775819776),
-    dynamic_mass_balance=true,
-    P0=12700000,
-    P(start=12700000))                annotation (Placement(transformation(
-        origin={-52,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC MelangeurPreTMP(
-    h0=3523910,
-    h(start=3517975.7051812997),
-    dynamic_mass_balance=true,
-    P0=2400000,
-    P(start=2400000))                     annotation (Placement(transformation(
-        origin={-50,-314},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_entree_TurbineMP(
-    mode=0,
-    C1(P(fixed=true, start=25.486e5)),
-    Cvmax=Cvmax_TMP,
-    h(fixed=false, start=3518000),
-    Cv(start=3.312e6),
-    Pm(fixed=false, start=2547000))
-                 annotation (Placement(transformation(extent={{-124,-318},{-104,
-            -298}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneTurbineMP(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
-            -138,-226}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
-    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
-    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
-    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Gain Gain_2GasTurbine(Gain=
-       2) annotation (Placement(transformation(extent={{-18,-448},{2,-428}},
-          rotation=0)));
-  Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible(
-    Hum=0,
-    Xo=0,
-    Xn=0,
-    Xs=0,
-    rho=0.838,
-    Q0=13.4368286133,
-    T0=185 + 273.16,
-    Xc=0.755,
-    Xh=0.245,
-    Cp=2255,
-    LHV=46989e3)
-          annotation (Placement(transformation(extent={{-421,24},{-385,60}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ sourceEau(             Q0=0.0)
-          annotation (Placement(transformation(extent={{-473,27},{-445,57}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Humidite(k=0.93)
-    annotation (Placement(transformation(extent={{-539,23},{-518,43}}, rotation=
-           0)));
-  FlueGases.BoundaryConditions.SourcePQ SourceFumees(
-    Xso2=0,
-    Xco2=0,
-    Xh2o=0,
-    Xo2=0.20994,
-    Q0=600,
-    T0=29.4 + 273.16,
-    P0=1.013e5)
-    annotation (Placement(transformation(extent={{-539,-74},{-495,-28}},
-          rotation=0)));
-  FlueGases.TAC.GasTurbine GasTurbine(
-    comp_tau_n=14.0178,
-    comp_eff_n=0.87004,
-    exp_tau_n=0.06458,
-    exp_eff_n=0.89045,
-    TurbQred=0.0175634,
-    Kcham=2.02088,
-    chambreCombustionTAC(Pea(fixed=false, start=14.0e5),
-      Psf(start=1333898.05061735),
-      Tsf(start=1493.5527523474145)),
-    Wpth=1e6,
-    Compresseur(
-      is_eff(fixed=false, start=0.88),
-      Xtau(fixed=false, start=1.00),
-      Ps(start=1419889.7074729432),
-      Ts(start=678.0795840911329),
-      Tis(start=630.7876402069812)),
-    TurbineAgaz(
-      Ps(fixed=false),
-      is_eff(fixed=false, start=0.87),
-      Pe(fixed=false, start=1333900),
-      Te(start=1493.59),
-      Ts(fixed=false, start=893.16),
-      Tis(start=814.7448743706253)),
-    xAIR(rho_air(start=1.099457970518182)))
-    annotation (Placement(transformation(extent={{-471,-115},{-341,13}},
-          rotation=0)));
-
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeQfuel(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=13.507,
-    Finalvalue=8.756)
-                     annotation (Placement(transformation(extent={{-539,64},{
-            -519,84}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeIQair(
-    Starttime=200,
-    Duration=800,
-    Finalvalue=415.70,
-    Initialvalue=592.7)
-                   annotation (Placement(transformation(extent={{-541,-20},{
-            -521,0}}, rotation=0)));
-equation
-  connect(SurchauffeurHP3.Cws1, SurchauffeurHP2.Cws2)
-    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
-        color={255,0,0}));
-  connect(SurchauffeurHP2.Cws1, SurchauffeurHP1.Cws2)
-    annotation (Line(points={{-174,-70},{-174,-90},{-54,-90},{-54,-70}}, color=
-          {255,0,0}));
-  connect(constante_vanne_vapeurHP.y, vanne_vapeurHP.Ouv)
-    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
-  connect(vanne_vapeurHP.C1, BallonHP.Cv)
-    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
-  connect(GainChargeHP.C1, BallonHP.Cd)
-    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={255,128,
-          0}));
-  connect(BallonHP.Cm, EvaporateurHP.Cws2)
-    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}));
-  connect(VolumeEvapHP.Cs, EvaporateurHP.Cws1)
-    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={255,128,0}));
-  connect(VolumeEvapHP.Ce1, GainChargeHP.C2)
-                                      annotation (Line(points={{8,-90},{18,-90}},
-        color={255,128,0}));
-  connect(EconomiseurHP4.Cws1, EconomiseurHP3.Cws2)
-    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
-  connect(BallonMP.Cm, EvaporateurMP.Cws2)
-    annotation (Line(points={{320,10},{306,10},{306,-30}}));
-  connect(EvaporateurMP.Cws1, VolumeEvapMP.Cs)
-    annotation (Line(points={{306,-70},{306,-80},{308,-80},{308,-90}}, color={
-          255,128,0}));
-  connect(VolumeEvapMP.Ce1, GainChargeMP.C2)
-    annotation (Line(points={{328,-90},{338,-90}}, color={255,128,0}));
-  connect(constante_vanne_vapeurMP.y, vanne_vapeurMP.Ouv)
-    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
-  connect(SurchauffeurHP1.Cfg2, EvaporateurHP.Cfg1)        annotation (Line(
-      points={{-44,-50},{-24,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurHP.Cfg2, EconomiseurHP4.Cfg1)        annotation (Line(
-      points={{-4,-50},{96,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP4.Cfg2, SurchauffeurMP1.Cfg1)          annotation (Line(
-      points={{76,-50},{136,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP1.Cfg2, EconomiseurHP3.Cfg1)           annotation (Line(
-      points={{156,-50},{196,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurMP.Cfg2, EconomiseurHP2.Cfg1)           annotation (Line(
-      points={{316,-50},{396,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP2.Cfg2, EconomiseurMP.Cfg1)           annotation (Line(
-      points={{416,-50},{456,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurMP.Cfg2, EconomiseurHP1.Cfg1)           annotation (Line(
-      points={{476,-50},{516,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(GainChargeMP.C1, BallonMP.Cd)
-    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={255,
-          128,0}));
-  connect(SurchauffeurMP2.Cfg2, SurchauffeurHP1.Cfg1)          annotation (Line(
-      points={{-104,-50},{-64,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP2.Cfg1, SurchauffeurHP2.Cfg2)           annotation (Line(
-      points={{-124,-50},{-164,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP3.Cfg2, SurchauffeurHP2.Cfg1)           annotation (Line(
-      points={{-224,-50},{-184,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurHP3.Cfg2, SurchauffeurMP3.Cfg1)           annotation (Line(
-      points={{-284,-50},{-244,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP3.Cws1,SurchauffeurMP2. Cws2)
-    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
-          {255,0,0}));
-  connect(SurchauffeurMP1.Cws2, MelangeurHPMP.Ce2) annotation (Line(
-      points={{146,-70},{146,-85},{148,-85},{148,-100}},
-      color={255,0,0},
-      pattern=LinePattern.None));
-  connect(vanne_vapeurBP.C1, BallonBP.Cv)
-    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
-  connect(EvaporateurBP.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
-          -70},{566,-90},{572,-90}}, color={255,128,0}));
-  connect(VolumeEvapBP.Ce1, GainChargeBP.C2)
-                                        annotation (Line(points={{592,-90},{600,
-          -90}}, color={255,128,0}));
-  connect(BallonBP.Cd, GainChargeBP.C1)
-                                       annotation (Line(points={{618,10},{628,
-          10},{628,-90},{620,-90}}, color={255,128,0}));
-  connect(EconomiseurBP.Cfg2, PuitsFumees.C)     annotation (Line(
-      points={{690,-50},{712.2,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP3.Cfg2, SurchauffeurBP.Cfg1)  annotation (Line(
-      points={{216,-50},{256,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurBP.Cfg2, EvaporateurMP.Cfg1)  annotation (Line(
-      points={{276,-50},{296,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP1.Cfg2, EvaporateurBP.Cfg1) annotation (Line(
-      points={{536,-50},{556,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurBP.Cfg2, EconomiseurBP.Cfg1) annotation (Line(
-      points={{576,-50},{670,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(BallonBP.Cm, EvaporateurBP.Cws2)
-    annotation (Line(points={{578,10},{566,10},{566,-30}}));
-  connect(vanne_vapeurMP.C1, BallonMP.Cv)   annotation (Line(points={{298,50},{
-          320,50}}, color={255,0,0}));
-  connect(Vanne_alimentationMPHP.Ouv, constante_ballonBP.y)
-    annotation (Line(points={{720,7},{720,12},{727.3,12}}));
-  connect(SurchauffeurHP3.Cws2, DoubleDebitHP.Ce)
-    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
-        color={255,0,0}));
-  connect(SurchauffeurMP3.Cws2, DoubleDebitMP.Ce)
-    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
-        color={255,0,0}));
-  connect(VolumeCond1.Cs, perteChargeKCond1.C1) annotation (Line(points={{902,
-          -308},{902,-282}}, color={0,0,255}));
-  connect(Vanne_alimentationMPHP.C2, VolumeAlimMPHP.Ce1)
-                                               annotation (Line(points={{730,
-          -10},{742,-10}}, color={0,0,255}));
-  connect(SurchauffeurBP.Cws2, DoubleDebitBP.Ce)
-    annotation (Line(points={{266,-70},{266,-80},{268,-80},{268,-90}}, color={
-          255,0,0}));
-  connect(perteChargeK8.C2, PompeAlimMP.C1)
-    annotation (Line(points={{790,-10},{797,-10},{804,-10}},           color={0,
-          0,255}));
-  connect(VolumeAlimMPHP.Cs1, perteChargeK8.C1)
-    annotation (Line(points={{762,-10},{766,-10},{770,-10}},           color={0,
-          0,255}));
-  connect(VolumeAlimMPHP.Cs2, perteChargeK3.C1)
-                                         annotation (Line(points={{752,-20},{
-          752,-50},{770,-50}}, color={0,0,255}));
-  connect(perteChargeK3.C2, PompeAlimHP.C1)
-    annotation (Line(points={{790,-50},{804,-50}}, color={0,0,255}));
-  connect(MelangeurPostTMP1.Ce2, PerteChargeZero2.C2) annotation (Line(points={
-          {418,-239},{418,-278},{354,-278}}, color={255,0,0}));
-  connect(perteChargeK.C2,PompeAlimBP. C1)
-                                         annotation (Line(points={{722,-436},{
-          742,-436}}, color={0,0,255}));
-  connect(vanne_extraction.C2, perteChargeK2.C1) annotation (Line(points={{822,
-          -436},{840,-436}}, color={0,0,255}));
-  connect(vanne_alimentationHP.C1, CapteurDebitEauHP.C2)
-    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
-  connect(vanne_vapeurHP.C2, CapteurDebitVapHP.C1) annotation (Line(points={{
-          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
-  connect(CapteurDebitVapHP.C2, SurchauffeurHP1.Cws1) annotation (Line(points={
-          {-53.2,1.88},{-53.2,-3.06},{-54,-3.06},{-54,-30}}, color={255,0,0}));
-  connect(vanne_alimentationMP.C1, CapteurDebitEauMP.C2)
-    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
-  connect(CapteurDebitVapMP.C1, vanne_vapeurMP.C2) annotation (Line(points={{
-          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
-  connect(CapteurDebitVapMP.C2, SurchauffeurMP1.Cws1) annotation (Line(points={
-          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
-  connect(CapteurDebitVapBP.C2, SurchauffeurBP.Cws1) annotation (Line(points={{
-          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
-  connect(CapteurDebitVapBP.C1, vanne_vapeurBP.C2) annotation (Line(points={{
-          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
-  connect(CapteurDebitEauBP.C2, vanne_alimentationBP.C1) annotation (Line(
-        points={{658.3,40.12},{658.3,48},{650,48}}, color={0,0,255}));
-  connect(CapteurDebitEauBPsortie.C2, Vanne_alimentationMPHP.C1) annotation (Line(
-        points={{700.13,-9.8},{705.065,-9.8},{705.065,-10},{710,-10}}, color={0,
-          0,255}));
-  connect(CapteurDebitEauCondenseur.C2, perteChargeK.C1) annotation (Line(
-        points={{680.3,-422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
-  connect(perteChargeK1.C2, CapteurDebitVapCondenseur.C1) annotation (Line(
-        points={{660,-230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
-  connect(MelangeurHPMP.Ce1, MoitieDebitHP.Cs)
-    annotation (Line(points={{148,-120},{148,-170},{134,-170}}, color={255,0,0}));
-  connect(perteChargeK2.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,
-          -436},{862,-436},{862,-318},{872,-318}}, color={0,0,255}));
-  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
-          {892,-318}}, color={0,0,255}));
-  connect(SurchauffeurMP2.Cws1, lumpedStraightPipeK2.C2)
-    annotation (Line(points={{-114,-70},{-114,-110},{94,-110}}, color={255,0,0}));
-  connect(lumpedStraightPipeK2.C1, MelangeurHPMP.Cs2)
-    annotation (Line(points={{114,-110},{138.2,-110}}, color={255,0,0}));
-  connect(DoubleDebitHP.Cs, vanne_entree_TurbineHP.C1) annotation (Line(points=
-          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
-  connect(DoubleDebitBP.Cs, PerteChargeZero2.C1) annotation (Line(points={{268,
-          -110},{268,-278},{334,-278}}, color={255,0,0}));
-  connect(PompeAlimBP.C2, vanne_extraction.C1) annotation (Line(points={{762,
-          -436},{802,-436}}, color={0,0,255}));
-  connect(BallonHP.yLevel,regulation_Niveau_HP. MesureNiveauEau)
-    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
-  connect(regulation_Niveau_HP.SortieReelle1, vanne_alimentationHP.Ouv)
-    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
-  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
-    annotation (Line(points={{208.7,122},{234,122},{234,110},{261.5,110}}));
-  connect(BallonMP.yLevel,regulation_Niveau_MP. MesureNiveauEau)
-    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
-  connect(regulation_Niveau_MP.SortieReelle1, vanne_alimentationMP.Ouv)
-    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
-  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
-    annotation (Line(points={{505.7,135},{529.85,135},{529.85,112},{567.5,112}}));
-  connect(BallonBP.yLevel,regulation_Niveau_BP. MesureNiveauEau)
-    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
-  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
-    annotation (Line(points={{741.2,-238},{752,-238},{752,-269},{757.5,-269}}));
-  connect(regulation_Niveau_Condenseur.SortieReelle1, vanne_extraction.Ouv)
-    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
-  connect(CapteurDebitEauBP.C1, EconomiseurBP.Cws2)
-    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
-  connect(EconomiseurBP.Cws1, perteChargeKCond1.C2) annotation (Line(points={{
-          680,-70},{680,-186},{902,-186},{902,-258}}));
-  connect(CapteurDebitVapCondenseur.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
-    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,
-          -280.9}}));
-  connect(regulation_Niveau_Condenseur.MesureDebitEau,
-    CapteurDebitEauCondenseur.Measure) annotation (Line(points={{757.45,-274.95},
-          {750,-274.95},{750,-310},{792,-310},{792,-412},{692.13,-412}}));
-  connect(ConstantVanneTurbineHP.y, vanne_entree_TurbineHP.Ouv)
-    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
-  connect(regulation_Niveau_BP.SortieReelle1, vanne_vapeurBP.Ouv)
-    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
-  connect(vanne_alimentationBP.Ouv, constante_vanne_vapeurBP.y)
-    annotation (Line(points={{640,65},{640,81},{653.4,81}}));
-  connect(EconomiseurHP1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
-          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
-  connect(VolumeECO_HP1_2.Cs, EconomiseurHP2.Cws1) annotation (Line(points={{
-          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
-  connect(EconomiseurHP2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
-          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
-  connect(VolumeECO_HP2_3.Cs, EconomiseurHP3.Cws1) annotation (Line(points={{
-          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
-  connect(Vanne_alimentationMPHP1.C1, PompeAlimHP.C2)
-    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-50},{824,-50}}));
-  connect(PompeAlimMP.C2, Vanne_alimentationMPHP2.C1) annotation (Line(points={
-          {824,-10},{870,-10},{870,-142.8},{804,-142.8}}, color={0,0,255}));
-  connect(arretPomesMp1.y, Vanne_alimentationMPHP1.Ouv)
-    annotation (Line(points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,
-          -123.2}}));
-  connect(arretPomesHP1.y, Vanne_alimentationMPHP2.Ouv)
-    annotation (Line(points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,
-          -163.2}}));
-  connect(Vanne_alimentationMPHP1.C2, EconomiseurHP1.Cws1) annotation (Line(
-        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
-          -6},{526,-30}}, color={0,0,255}));
-  connect(EconomiseurMP.Cws1, Vanne_alimentationMPHP2.C2)
-    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
-  connect(ConstantVanneTurbineMP.y, vanne_entree_TurbineMP.Ouv)
-    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
-  connect(vanne_entree_TurbineHP.C2, VolumePreTHP.Ce) annotation (Line(points={
-          {-104,-230},{-62,-230}}, color={255,0,0}));
-  connect(DoubleDebitMP.Cs, vanne_entree_TurbineMP.C1) annotation (Line(points=
-          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
-  connect(vanne_entree_TurbineMP.C2, MelangeurPreTMP.Ce1) annotation (Line(
-        points={{-104,-314},{-60,-314}}, color={255,0,0}));
-  connect(SourceCaloporteur.C, Condenseur.Cee) annotation (Line(points={{620,-353},
-          {638,-353},{638,-352.8},{637,-352.8}},     color={0,0,255}));
-  connect(Condenseur.Cse, PuitsCaloporteur.C) annotation (Line(points={{717,-352},
-          {736,-352}},       color={0,0,255}));
-  connect(CapteurDebitVapCondenseur.C2, Condenseur.Cv) annotation (Line(points={{679.3,
-          -274.2},{679.3,-288.1},{677,-288.1},{677,-304}},         color={0,0,
-          255}));
-  connect(CapteurDebitEauCondenseur.C1, Condenseur.Cl)
-    annotation (Line(points={{680.3,-402},{677.8,-402},{677.8,-384}}));
-  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
-    annotation (Line(points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}}));
-  connect(Condenseur.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
-    annotation (Line(points={{721,-372.8},{780,-372.8},{780,-326},{732,-326},{732,
-          -263},{757.5,-263}}));
-  connect(BallonBP.Cs, CapteurDebitEauBPsortie.C1) annotation (Line(points={{
-          578,22},{564,22},{564,16},{642,16},{642,-9.8},{687,-9.8}}, color={0,0,
-          255}));
-  connect(BallonBP.Ce1, vanne_alimentationBP.C2)
-    annotation (Line(points={{618,50},{624,50},{624,48},{630,48}}));
-  connect(BallonMP.Ce1, vanne_alimentationMP.C2)
-    annotation (Line(points={{358,50},{378,50}}));
-  connect(BallonHP.Ce1, vanne_alimentationHP.C2)
-    annotation (Line(points={{38,50},{58,50}}));
-  connect(TurbineHP.Cs, MoitieDebitHP.Ce) annotation (Line(points={{38.2,-230},
-          {74,-230},{74,-170},{114,-170}}, color={255,0,0}));
-  connect(VolumePreTHP.Cs3, TurbineHP.Ce) annotation (Line(points={{-42,-230},{
-          -2.2,-230}}, color={255,0,0}));
-  connect(MelangeurPreTMP.Cs, TurbineMP.Ce) annotation (Line(points={{-40,-314},
-          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
-  connect(TurbineMP.Cs, MelangeurPostTMP1.Ce1) annotation (Line(points={{358.2,
-          -230},{408,-230}}, color={255,0,0}));
-  connect(MelangeurPostTMP1.Cs, TurbineBP.Ce) annotation (Line(points={{428,
-          -230},{575.8,-230}}, color={255,0,0}));
-  connect(TurbineBP.Cs, perteChargeK1.C1) annotation (Line(points={{616.2,-230},
-          {640,-230}}, color={255,0,0}));
-  connect(EconomiseurMP.Cws2, CapteurDebitEauMP.C1) annotation (Line(points={{
-          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
-  connect(TurbineMP.MechPower, Alternateur.Wmec2)
-    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
-  connect(TurbineBP.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
-          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
-  connect(TurbineHP.MechPower, Alternateur.Wmec3)
-    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
-  connect(heatSource.C[1], BallonHP.Cex) annotation (Line(points={{18,68.3},{18,
-          50}}, color={191,95,0}));
-  connect(heatSource1.C[1], BallonMP.Cex) annotation (Line(points={{339,68.3},{
-          339,50}}, color={191,95,0}));
-  connect(heatSource2.C[1], BallonBP.Cex) annotation (Line(points={{598,64.3},{
-          598,50}}, color={191,95,0}));
-  connect(Gain_2GasTurbine.y, Alternateur.Wmec5)
-    annotation (Line(points={{3,-438},{402,-438}}));
-  connect(CapteurDebitEauHP.C1, EconomiseurHP4.Cws2)
-    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
-  connect(PompeAlimMP.rpm_or_mpower, arretPomesMp.y)
-    annotation (Line(points={{814,-21},{814,-26},{904.1,-26}}, smooth=Smooth.None));
-  connect(PompeAlimHP.rpm_or_mpower, arretPomesHP.y)
-    annotation (Line(points={{814,-61},{814,-80},{905.1,-80}}, smooth=Smooth.None));
-  connect(PompeAlimBP.rpm_or_mpower, arretPomesBP.y) annotation (Line(points={{
-          752,-447},{754,-447},{754,-460},{878,-460},{878,-442},{905.1,-442}},
-        smooth=Smooth.None));
-  connect(SourceFumees.C,GasTurbine. Entree_air)
-                                                annotation (Line(
-      points={{-495,-51},{-471,-51}},
-      color={0,0,0},
-      thickness=1));
-  connect(sourceCombustible.C,GasTurbine. Entree_combustible) annotation (Line(
-        points={{-385,42},{-367,42},{-367,13}}, color={0,0,0}));
-  connect(sourceEau.C,GasTurbine. Entree_eau_combustion)
-    annotation (Line(points={{-445,42},{-445,13}}, color={0,0,255}));
-  connect(sourceCombustible.IMassFlow,rampeQfuel. y)
-    annotation (Line(points={{-403,51},{-403,74},{-518,74}}));
-  connect(rampeIQair.y,SourceFumees. IMassFlow)
-    annotation (Line(points={{-520,-10},{-520,-36},{-517,-36},{-517,-39.5}}));
-  connect(Humidite.y, GasTurbine.Huminide)
-    annotation (Line(points={{-516.95,33},{-487,33},{-487,-12.6},{-473.6,-12.6}}));
-  connect(GasTurbine.Sortie_fumees, SurchauffeurHP3.Cfg1) annotation (Line(
-      points={{-341,-51},{-290,-50},{-304,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(GasTurbine.PuissanceMeca, Gain_2GasTurbine.u)
-    annotation (Line(points={{-338.4,-76.6},{-326,-76.6},{-326,-438},{-19,-438}}));
-  annotation (Diagram(graphics,
-                      coordinateSystem(preserveAspectRatio=false,extent={{-550,
-            -460},{950,150}},
-        initialScale=0.1)),
-    experiment(StopTime=2500, Tolerance=0.001),
-    experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end CombinedCycle_Load_100_50;
+within ThermoSysPro.Examples.CombinedCyclePowerPlant;
+model CombinedCycle_Load_100_50
+  "CCPP model to simulate a load variation from 100% to 50%"
+  parameter Real CstHP(fixed=false,start=7872243.329137064)
+    "Stodola's ellipse coefficient HP";
+  parameter Real CstMP(fixed=false,start=250346.99234192327)
+    "Stodola's ellipse coefficient MP";
+  parameter Real CstBP(fixed=false,start=10510.769959447052)
+    "Stodola's ellipse coefficient BP";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
+    "Maximum CV: alim. valve HP Drum  ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
+    "Maximum CV: steam valve BP Drum ";
+  parameter Real Encras_SHP1(fixed=false,start=1)
+    "Sur HP1: heat exchange fouling coefficient";
+  parameter Real Encras_SHP2(fixed=false,start=1)
+    "Sur HP2: heat exchange fouling coefficient";
+  parameter Real Encras_SHP3(fixed=false,start=1)
+    "Sur HP3: heat exchange fouling coefficient";
+  parameter Real Encras_EHP1(fixed=false,start=1)
+    "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Encras_EHP2(fixed=false,start=1)
+    "Eco HP2: heat exchange fouling coefficient";
+  parameter Real Encras_EHP3(fixed=false,start=1)
+    "Eco HP3: heat exchange fouling coefficient";
+  parameter Real Encras_EHP4(fixed=false,start=1)
+    "Eco HP4: heat exchange fouling coefficient";
+
+  parameter Real Encras_SMP1(fixed=false,start=1)
+    "Sur MP1: heat exchange fouling coefficient";
+  parameter Real Encras_SMP2(fixed=false,start=1)
+    "Sur MP2: heat exchange fouling coefficient";
+  parameter Real Encras_SMP3(fixed=false,start=1)
+    "Sur MP3: heat exchange fouling coefficient";
+  parameter Real Encras_EMP(fixed=false,start=1)
+    "Eco MP: heat exchange fouling coefficient";
+
+  parameter Real Encras_EvHP(fixed=false,start=1)
+    "Evapo HP: heat exchange fouling coefficient";
+  parameter Real Encras_EvMP(fixed=false,start=1)
+    "Evapo MP: heat exchange fouling coefficient";
+  parameter Real Encras_EvBP(fixed=false,start=1)
+    "Evapo BP: heat exchange fouling coefficient";
+
+  parameter Real Encras_SBP(fixed=false,start=1)
+    "Sur BP: heat exchange fouling coefficient";
+  parameter Real Encras_EBP(fixed=false,start=1)
+    "Eco BP: heat exchange fouling coefficient";
+
+  parameter Real KgainChargeHP(fixed=false,start=720.183)
+    "HP: Friction pressure loss coefficient";
+  parameter Real KgainChargeMP(fixed=false,start=1090.9)
+    "MP: Friction pressure loss coefficient";
+  parameter Real Kin_SMP2(fixed=false,start=10.)
+    "SMPin: Friction pressure loss coefficient";
+  parameter Real K_PerteChargeZero2(fixed=false,start=1e-4)
+    "TurbineMP out: Friction pressure loss coefficient";
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
+    "Maximum CV input Turbine HP ";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
+    "Maximum CV input Turbine MP ";
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonHP(
+    L=16.27,
+    Vertical=false,
+    hl(fixed=false, start=1459929.6557225615),
+    hv(fixed=false, start=2664756.9335524077),
+    Vv(fixed=false),
+    R=1.05,
+    xmv(fixed=false),
+    P(fixed=false, start=12726786.684064418),
+    zl(start=1.05, fixed=true),
+    Mp=5000,
+    Kpa=5,
+    Kvl=1000,
+    Pfond(start=12733698.15963666),
+    Tp(start=589.4448369021196))
+                     annotation (Placement(transformation(extent={{38,10},{-2,
+            50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationHP(
+      Cvmax=CvmaxValveAHP,
+    C1(P(start=13374652.64958711),
+                            h_vol(start=1398250.7267619045)),
+    h(start=1398000),
+    Cv(start=178),
+    Pm(start=13050700))
+                 annotation (Placement(transformation(extent={{78,46},{58,66}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurHP(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurHP(
+    Cvmax=47829.4,
+    mode=0,
+    C2(h_vol(start=2664756.9335524077)),
+    h(start=2674000),
+    Cv(start=23914.7),
+    Pm(start=12725274.444912266))
+                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeHP(
+    z2=0,
+    mode=1,
+    Q(start=150, fixed=true),
+    z1=10.83,
+    K=KgainChargeHP,
+    C2(P(start=12758125.131063813)),
+    h(start=1474422.14552527),
+    Pm(start=12704000))
+            annotation (Placement(transformation(
+        origin={28,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,
+    h(start=1459929.6557225615),
+    P(start=12704000))                     annotation (Placement(transformation(
+          extent={{8,-100},{-12,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EvaporateurHP(
+    Dint=32.8e-3,
+    Ntubes=1476,
+    L=20.7,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
+      Tp(start={607.9743232022095,605.444949344346,604.0557720629383}),
+      Tp1(start={606.517435991606,604.7669177434965,603.7415072757717})),
+    Ns=3,
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.092,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      K(fixed=true, start=37.69),
+      CSailettes=11.86442072,
+      p_rho=1.05,
+      Encras=Encras_EvHP,
+      DeltaT(start={106,49,23}),
+      T(start={755.54833984375,674.4067359457392,636.0812177546504,
+            618.193603515625}),
+      Tm(start={714.9775457406769,655.2439768501948,627.1374112677474}),
+      Tp(start={609.3279079642047,606.0749042484599,604.3477535039484})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=10.83,
+      option_temperature=2,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={5.74e7,2.67e7,1.24e7}),
+      h(start={1459929.625,1842858.7345266847,2021072.953461077,
+            2103674.4922587443,1459929.625}),
+      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
+      P(start={12758125.0,12740268.20023451,12734647.766847359,
+            12730499.45519915,12726787.0})))
+                          annotation (Placement(transformation(
+        origin={-14,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurHP4(
+    Ns=3,
+    L=20.726,
+    Dint=0.0266,
+    Ntubes=246,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-3.5e6,-2.63e6,-2e6}),
+      Tp(start={576.9773977809047,582.0830364334571,585.8301318496927}),
+      Tp1(start={576.3268547206692,581.5931147025063,585.4596791589167})),
+    Cws1(P(start=13301170.910895599),
+                              h_vol(start=1291418.4097512758)),
+    Cws2(h_vol(start=1398250.726761905)),
+    ExchangerFlueGasesMetal(
+      Dext=0.0318,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.39069779,
+      K(fixed=true, start=47.53),
+      p_rho=1.06,
+      Encras=Encras_EHP4,
+      DeltaT(start={38,29,22}),
+      T(start={618.193603515625,613.1248964422501,609.3035158562986,
+            606.41162109375}),
+      Tm(start={615.6592506115472,611.2142061492743,607.857569142044}),
+      Tp(start={577.5724142989593,582.5311413173429,586.1689648703535})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      z2=0,
+      option_temperature=2,
+      inertia=true,
+      dW1(start={3.5e6,2.63e6,2e6}),
+      h(start={1291418.375,1337416.303924748,1372057.1590979556,
+            1398250.726761905,1398250.75}),
+      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
+      P(start={13301171.0,13320152.543490017,13338662.827011712,
+            13356802.623346366,13374653.0})))
+                          annotation (Placement(transformation(
+        origin={86,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=270)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurHP1(
+    Ns=3,
+    L=20.4,
+    Dint=0.0324,
+    Ntubes=246,
+    ExchangerWall(e=0.0028, lambda=37.61,
+    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
+      Tp(start={641.773975889456,659.2620935819541,674.5601453613823}),
+      Tp1(start={639.7214032623475,657.645496743186,673.3086347868172})),
+    Cws1(h_vol(start=2664756.9335524077)),
+    Cws2(P(start=12720371.43140221),
+                              h_vol(start=2973076.465167672)),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=10.25056,
+      K(fixed=true, start=34.71),
+      p_rho=1.04,
+      Encras=Encras_SHP1,
+      DeltaT(start={138,108,84}),
+      T(start={788.2433471679688,774.636330839027,763.888258455914,
+            755.54833984375}),
+      Tm(start={781.4398445109163,769.2622946474705,759.7183069957642}),
+      Tp(start={643.6693613731671,660.754890543465,675.715814566568})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      option_temperature=2,
+      inertia=true,
+      dW1(start={9.8e6,7.7e6,5.9e6}),
+      h(start={2664757.0,2793366.8463525265,2894659.427023337,2973076.465167672,
+            2973076.5}),
+      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
+      P(start={12723762.0,12723704.875007024,12723025.392511783,
+            12721873.859626876,12720371.0})))
+                          annotation (Placement(transformation(
+        origin={-54,-50},
+        extent={{-20,20},{20,-20}},
+        rotation=270)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurHP3(
+    Dint=26.6e-3,
+    Ntubes=1476,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
+      Tp(start={556.7923625573021,563.4515089057426,565.7949884705216}),
+      Tp1(start={556.3098450461794,563.2778280617686,565.7320909419939})),
+    L=20.726,
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=12.451,
+      K(fixed=true, start=36.0300000000857),
+      p_rho=1.08,
+      Encras=Encras_EHP3,
+      St=5, DeltaT(start={34,12,4.4}),
+      T(start={602.6719360351563,579.980900946576,571.7829862725544,
+            568.8102416992188}),
+      Tm(start={591.3264094805266,575.8819436095652,570.2965996068247}),
+      Tp(start={557.2336952021615,563.6103653709807,565.8525174347154})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.6e7,5.6e6,2.1e6}),
+      h(start={986348.0625,1191052.0456419336,1264734.6677716642,
+            1291418.4097512758,1291418.375}),
+      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
+      P(start={13219328.0,13241437.958285147,13261883.227869928,
+            13281654.651763307,13301171.0})))
+                  annotation (Placement(transformation(
+        origin={206,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurHP2(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-5e6,-3e6,-2.e6}),
+      Tp(start={491.54343078281,498.9069980271022,503.5184174104173}),
+      Tp1(start={491.3392380231037,498.7785262547952,503.4374982277421})),
+    L=20.767,
+    Ntubes=1107,
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=111e-3,
+      CSailettes=2.76134577,
+      K(fixed=true, start=65.5300000000393),
+      p_rho=1.11,
+      Encras=Encras_EHP2,
+      St=5, DeltaT(start={36,23,14}),
+      T(start={531.16064453125,523.8360138077611,519.2214124321695,
+            516.3124389648438}),
+      Tm(start={527.4983362936189,521.5287131199652,517.7669224567446}),
+      Tp(start={491.73019484551236,499.02450420201814,503.5924298060023})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={5e6,3e6,2.e6}),
+      h(start={854493.25,919592.0464622772,960550.2028257779,986348.0919441726,
+            986348.0625}),
+      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
+      P(start={13129347.0,13152374.515059257,13174952.371260952,
+            13197235.505730344,13219328.0})))
+                  annotation (Placement(transformation(
+        origin={406,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurHP1(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-9.9999e6,-5e6,-2.4e6}),
+      Tp(start={460.16002911133717,469.99835357411166,474.7738719222592}),
+      Tp1(start={459.7281425156256,469.7896188414262,474.67326898241726})),
+    L=20.726,
+    Ntubes=1107,
+    Cws1(h_vol(start=618649.6677733721)),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=8.30057632,
+      K(fixed=true, start=40.24),
+      p_rho=1.13,
+      Encras=Encras_EHP1,
+      St=5,   DeltaT(start={41,20,10}),
+      T(start={509.31475830078125,493.76452187742854,486.23046610566547,
+            482.5950622558594}),
+      Tm(start={501.5396335543568,489.997493991547,484.4127676365523}),
+      Tp(start={460.5550523989298,470.18927193360446,474.8658879848841})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.767,
+      inertia=true,
+      dW1(start={9.9999e6,5e6,2.4e6}),
+      h(start={618649.6875,756067.8313424552,822483.2837402308,854493.240474255,
+            854493.25}),
+      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
+      advection=true,
+      dynamic_mass_balance=true,
+      P(start={13034952.0,13059418.53296798,13083081.248541538,
+            13106320.315256517,13129347.0})))
+                  annotation (Placement(transformation(
+        origin={526,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurHP2(
+    Ns=3,
+    L=20.4,
+    Dint=32e-3,
+    Ntubes=246,
+    ExchangerWall(e=3e-3, lambda=27,
+          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
+      Tp(start={718.0864855457228,738.9518857688491,755.2055454298172}),
+      Tp1(start={715.3026673550778,736.860075660393,753.6461561287115})),
+    Cws2(P(start=12711006.754972342),
+                               h_vol(start=3240813.8516343245)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      K(fixed=true, start=34.74),
+      CSailettes=10.2505424803872,
+      p_rho=1.02,
+      Encras=Encras_SHP2,
+      St=5,
+      DeltaT(start={124,93,70}),
+      T(start={850.646484375,838.5707346201303,829.4749488031354,
+            822.6819458007813}),
+      Tm(start={844.6086089059804,834.0228417116329,826.0784372242802}),
+      Tp(start={720.6412271937046,740.871563720893,756.6366147445857})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.83,
+      inertia=true,
+      dW1(start={8.8e6,6.6e6,4.9e6}),
+      h(start={2973076.5,3088900.88921149,3175933.4050769014,3240813.8516343245,
+            3240813.75}),
+      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
+      P(start={12720371.0,12718678.034082344,12716464.21434507,
+            12713872.892207509,12711007.0})))
+                  annotation (Placement(transformation(
+        origin={-174,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurHP3(
+    Ns=3,
+    L=20.4,
+    Ntubes=246,
+    ExchangerWall(lambda=27, e=5e-3,
+    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
+      Tp(start={789.3906813408935,806.8419831862884,820.1561431707274}),
+      Tp1(start={785.7263795421367,804.0878954218736,818.093373707382})),
+    Dint=28e-3,
+    Cws2(h_vol(start=3433271.775819776)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      K(fixed=true, start=49.33),
+      CSailettes=6.59672842597229,
+      p_rho=1,
+      Encras=Encras_SHP3,
+      St=5,
+      DeltaT(start={97,73,55}),
+      T(start={894.2188110351563,885.636025090525,879.1746662824661,
+            874.3292236328125}),
+      Tm(start={889.9274067093704,882.4053456864956,876.7519418617093}),
+      Tp(start={792.5370292454647,809.2067770105702,821.927337447906})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.726,
+      inertia=true,
+      dW1(start={6.3e6,4.7e6,3.6e6}),
+      h(start={3240813.75,3323965.684475156,3386462.568744374,3433271.775819776,
+            3433271.75}),
+      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
+      P(start={12711007.0,12704270.150400551,12696927.059489354,
+            12689132.094962938,12681000.0})),
+    Cfg1(T(start=894.218788328216)))
+                  annotation (Placement(transformation(
+        origin={-294,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonMP(
+    L=16.27,
+    Vertical=false,
+    P0=27.29e5,
+    hl(fixed=false, start=980708.0463805634),
+    hv(fixed=false, start=2798574.7604119307),
+    Vv(fixed=false),
+    R=1.05,
+    P(fixed=false, start=2733824.789876998),
+    zl(start=1.05, fixed=true),
+    Kpa=5,
+    Mp=5000,
+    Kvl=1000,
+    Pfond(start=2742370.2498246767),
+    Tp(start=497.3822823273814))
+                     annotation (Placement(transformation(extent={{358,10},{320,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurMP(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationMP(
+      Cvmax=CvmaxValveAMP,
+    C1(P(start=3216971.701899643),
+                           h_vol(start=944504.749093579)),
+    h(start=944000),
+    Cv(start=28),
+    Pm(start=2975000))
+                 annotation (Placement(transformation(extent={{398,46},{378,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurMP(
+    Cvmax=47829.4,
+    mode=0,
+    C2(h_vol(start=2798574.7604119307)),
+    h(fixed=false, start=2798000),
+    Cv(start=23914.7),
+    Pm(fixed=false, start=2732575.5179918623))
+                 annotation (Placement(transformation(extent={{298,46},{278,66}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EvaporateurMP(
+    Dint=32.8e-3,
+    L=20.767,
+    Ntubes=738,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
+      Tp(start={504.98976100715464,504.26964479130794,503.6922361659351}),
+      Tp1(start={504.4959569394237,503.8875506396794,503.39662949233303})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.83,
+      continuous_flow_reversal=true,
+      inertia=true,
+          dW1(start={9.7e7,7.6e6,5.8e6}),
+      P(start={2773367.25,2751227.106127094,2743473.7578241928,
+            2738204.9403230133,2733824.75}),
+      h(start={980708.0625,1045813.9695051656,1096191.4250344052,
+            1135165.8819583436,980708.0625}),
+      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
+    Cws1(P(start=2773367.372876323)),
+    ExchangerFlueGasesMetal(
+      K(fixed=true, start=30.22),
+      Dext=38e-3,
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=10.0676093,
+      p_rho=1.1,
+      Encras=Encras_EvMP,
+      St=5,
+      DeltaT(start={53,41,32}),
+      T(start={565.2481689453125,550.9126306026692,539.787269523939,
+            531.16064453125}),
+      Tm(start={558.0803978580261,545.349950063304,535.4739641517078}),
+      Tp(start={505.44855126670757,504.624646069051,503.9668824707551})))
+                          annotation (Placement(transformation(
+        origin={306,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeMP(
+    z2=0,
+    z1=10.83,
+    mode=1,
+    Q(start=150, fixed=true),
+    K=KgainChargeMP,
+    Pm(start=2734000),
+    h(start=978914.570821827))
+            annotation (Placement(transformation(
+        origin={348,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
+    h(start=980708.0463805634),
+    P(start=2734000))                      annotation (Placement(transformation(
+          extent={{328,-100},{308,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurMP(
+    ExchangerWall(e=2.6e-3, lambda=47,
+        dW1(start={-3e6,-1.4e6,-740379}),
+      Tp(start={469.31277462346344,487.36995421739016,497.00024549998545}),
+      Tp1(start={468.830886627779,487.11263557868836,496.8627293559427})),
+    L=20.726,
+    Ns=3,
+    Dint=26.6e-3,
+    Ntubes=246,
+    Cws1(h_vol(start=565106.2802015315)),
+    Cws2(h_vol(start=944504.7490935794)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      K(fixed=true, start=47.78),
+      CSailettes=7.16188651,
+      p_rho=1.12,
+      Encras=Encras_EMP,
+      St=5,
+      DeltaT(start={45,24,13}),
+      T(start={516.3124389648438,512.4675048876576,510.41305969109146,
+            509.31475830078125}),
+      Tm(start={514.3899686844887,511.4402822893745,509.8639024611882}),
+      Tp(start={469.75353148474505,487.6053096442755,497.12602407127685})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.767,
+      z2=0,
+      inertia=true,
+      dW1(start={3e6,1.4e6,740379}),
+      h(start={565106.25,773641.4896138782,884995.1575722523,944504.7490935792,
+            944504.75}),
+      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
+      P(start={3124223.75,3148825.327098676,3172192.2961615147,
+            3194799.9976396263,3216971.75})))
+                          annotation (Placement(transformation(
+        origin={466,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurMP1(
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.3e6,-0.80263e6,
+                                -501864}),
+      Tp(start={558.2379692767729,574.1762943611731,584.4002179866045}),
+      Tp1(start={557.8513010794924,573.9323757073441,584.2477131820202})),
+    L=20.726,
+    Ns=3,
+    Dint=32.8e-3,
+    Ntubes=123,
+    Cws1(h_vol(start=2798574.7604119307)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      K(fixed=true, start=22.09),
+      CSailettes=14.46509765,
+      p_rho=1.07,
+      Encras=Encras_SMP1,
+      St=5,
+      DeltaT(start={45,30,19}),
+      T(start={606.41162109375,604.5654891969185,603.4004814494892,
+            602.6719360351563}),
+      Tm(start={605.488555812354,603.9829853232038,603.0361997319833}),
+      Tp(start={558.5972202716488,574.4029176513201,584.54190924323})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.77,
+      inertia=true,
+      dW1(start={1.3e6,0.80263e6,501864}),
+      h(start={2798574.75,2900855.9998369273,2965377.215724287,
+            3005717.6950751985,3040562.75}),
+      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
+      P(start={2731326.25,2730394.924575977,2729276.921848465,
+            2728029.2082540947,2726700.0})))
+                          annotation (Placement(transformation(
+        origin={146,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Volumes.VolumeB MelangeurHPMP(
+    Ce1(h(start=3046256.0341363903)),
+    h(start=3040562.6721177064),
+    P(start=2726000))
+    annotation (Placement(transformation(
+        origin={148,-110},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurMP2(
+    Ns=3,
+    L=20.4,
+    Dint=39.3e-3,
+    Ntubes=369,
+    ExchangerWall(e=2.6e-3, lambda=36.86,
+    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
+      Tp(start={689.1325590707521,714.3255084496102,731.974510062409}),
+      Tp1(start={687.8673243896432,713.4490802987744,731.369523912658})),
+    Cws1(P(start=2575582.5771302995),
+                             h_vol(start=3040562.6721177064)),
+    Cws2(P(start=2558239.090625735),
+                             h_vol(start=3321940.994604838)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=92e-3,
+      K(fixed=true, start=45.22),
+      CSailettes=5.814209831,
+      p_rho=1.03,
+      Encras=Encras_SMP2,
+      St=5,
+      DeltaT(start={125,86,60}),
+      T(start={822.6819458007813,806.8523532375756,795.852828640494,
+            788.2433471679688}),
+      Tm(start={814.7671394415003,801.3525909390348,792.0480934116497}),
+      Tp(start={690.3215978858725,715.1491557188672,732.5430623045928})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dW1(start={1.15e7,7.9e6,5.5e6}),
+      h(start={3040562.75,3170178.6567147295,3259963.658181113,
+            3321940.994604838,3321941.0}),
+      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
+      P(start={2575582.5,2571900.999964748,2567682.4202753096,
+            2563090.6820579167,2558239.0})))
+                          annotation (Placement(transformation(
+        origin={-114,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurMP3(
+    Ns=3,
+    L=20.4,
+    Ntubes=369,
+    Dint=45.6e-3,
+    ExchangerWall(e=2.6e-3, lambda=27,
+    dW1(start={-8e6,-5.5e6,-3.8e6}),
+      Tp(start={786.239853752146,802.8777020553458,814.3692554800219}),
+      Tp1(start={785.1915402608809,802.1579544921993,813.8760433493436})),
+    Cws2(h_vol(start=3517975.7051807973)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=92e-3,
+      Dext=50.8e-3,
+      K(fixed=true, start=43.23),
+      CSailettes=5.695842178,
+      p_rho=1.01,
+      Encras=Encras_SMP3,
+      St=5,
+      DeltaT(start={82,56,38}),
+      T(start={874.3292236328125,863.3655435931397,855.822658205448,
+            850.646484375}),
+      Tm(start={868.8473805170461,859.5941008992938,853.2345706986391}),
+      Tp(start={787.2330782757132,803.5596268196659,814.8365492691358})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dW1(start={8e6,5.5e6,3.8e6}),
+      h(start={3321941.0,3412821.580454202,3475218.0684875553,
+            3517975.7051807973,3517975.75}),
+      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
+      P(start={2558239.0,2556052.5796892336,2553681.6710159215,
+            2551184.3906656993,2548600.0})))
+                          annotation (Placement(transformation(
+        origin={-234,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonBP(
+    Vertical=false,
+    P0=5e5,
+    Vv(fixed=false),
+    L=8,
+    hl(fixed=false, start=550072.7232069891),
+    hv(fixed=false, start=2684673.580149807),
+    R=2,
+    P(fixed=false, start=485579.1243268126),
+    zl(start=1.75, fixed=true),
+    Kpa=5,
+    Mp=5000,
+    Kvl=1000,
+    Pfond(start=501612.0798822072),
+    Tp(start=406.2632923392337))
+                     annotation (Placement(transformation(extent={{618,10},{578,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurBP(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurBP(
+    p_rho=3, Cvmax=CvmaxValveVBP,
+    C2(P(start=510622.8582477031),
+                          h_vol(start=2684673.580149807)),
+    h(start=2685000),
+    Cv(start=1),
+    Pm(start=498000))
+                 annotation (Placement(transformation(extent={{558,46},{538,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationBP(
+    Cvmax=285,
+    C1(h_vol(start=509236.1596958067)),
+    h(fixed=false, start=509000),
+    Cv(start=142.5),
+    Pm(fixed=false, start=957583.6711025466))
+                 annotation (Placement(transformation(extent={{650,44},{630,64}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeBP(
+    z2=0,
+    z1=10.767,
+    Q(start=50, fixed=false),
+    K=32766,
+    mode=1,
+    pro(d(start=934.2358753989836)),
+    Pm(start=564000),
+    h(start=549249.519022482))
+            annotation (Placement(transformation(
+        origin={610,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=
+          550072.7232069891),                                          mode=1,
+    V=5,
+    P(start=564000))                       annotation (Placement(transformation(
+          extent={{592,-100},{572,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EvaporateurBP(
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
+      Tp(start={427.75117227047275,426.57196634952743,425.692416702357}),
+      Tp1(start={427.2791524733697,426.249857647769,425.4722112637204})),
+    L=20.726,
+    Ntubes=984,
+    Ns=3,
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=138e-3,
+      K(fixed=true, start=30.62),
+      CSailettes=11.07985,
+      p_rho=1.14,
+      Encras=Encras_EvBP,
+      St=5,
+      DeltaT(start={45,31,21}),
+      T(start={482.5950622558594,464.01748118772224,451.30051770870455,
+            442.58880615234375}),
+      Tm(start={473.3062751775807,457.6589994482134,446.94466391603106}),
+      Tp(start={428.18972290092955,426.87123552234135,425.89700819308825})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={1.24e7,8.5e6,5.8e6}),
+      h(start={550072.75,798514.7797723989,968052.8982857756,1083955.4353773424,
+            550072.75}),
+      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
+      Q(start={50.00030606442327,50.00030606442327,50.00030606442327,
+            50.00030606442327}),
+      P(start={512574.0,487903.6002327947,486912.76813325885,486233.0185244784,
+            485579.125})))
+                          annotation (Placement(transformation(
+        origin={566,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_ballonBP(k=1)
+    annotation (Placement(transformation(extent={{742,6},{728,18}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP(
+                          mode=1,
+    Cvmax=308.931,
+    C1(h_vol(start=550072.7232069891)),
+    h(start=550000),
+    Cv(start=308.931),
+    Pm(start=404001.70325999695))
+                 annotation (Placement(transformation(extent={{710,-14},{730,6}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurBP(
+    Ns=3,
+    L=20.726,
+    Dint=39.3e-3,
+    Ntubes=123,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.1e6,-782901,-559798}),
+      Tp(start={475.35471340675434,500.0471952971929,518.0415300925415}),
+      Tp1(start={475.07666786714793,499.8473601819379,517.8986430965637})),
+    Cws1(h_vol(start=2684673.580149807)),
+    Cws2(h_vol(start=2914519.282601244)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=222.1e-3,
+      K(fixed=true, start=30.46),
+      CSailettes=3.25763059984175,
+      p_rho=1.09,
+      Encras=Encras_SBP,
+      St=5,
+      DeltaT(start={92,66,47}),
+      T(start={568.8102416992188,567.2151210721856,566.0683353396659,
+            565.2481689453125}),
+      Tm(start={568.0126670066404,566.6417282059258,565.6582502265244}),
+      Tp(start={475.61601428945164,500.234995799533,518.1758120458845})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      rugosrel=1e-5,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.1e6,782901,559798}),
+      h(start={2684673.5,2787622.843498506,2861613.8808508525,2914519.282601244,
+            2914519.25}),
+      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
+      P(start={510622.84375,508733.6061914782,506650.25202074344,
+            504336.5353393364,501850.0})))
+                          annotation (Placement(transformation(
+        origin={266,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5)
+    annotation (Placement(transformation(
+        origin={722,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurBP(
+    Ns=3,
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
+      Tp(start={400.3519750836609,396.09689492479714,395.2201421057111}),
+      Tp1(start={400.0855824116385,396.0373810697358,395.20741736846634})),
+    Ntubes=3444,
+    L=20.726,
+    Cws1(h_vol(start=194584.50261459063)),
+    Cws2(h_vol(start=509236.15969580685)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=92e-3,
+      K(fixed=true, start=31.53),
+      CSailettes=11.673758598919,
+      p_rho=1.15,
+      Encras=Encras_EBP,
+      St=5,
+      DeltaT(start={23.5,5.3,1.1}),
+      T(start={442.58880615234375,405.54898708865323,397.2418326138536,
+            395.4642028808594}),
+      Tm(start={424.0688986060054,401.3954098512534,396.353024695102}),
+      Tp(start={400.59947884299936,396.1521888739459,395.23196457920767})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      inertia=true,
+      dW1(start={2.45e7,5.5e6,1.17e6}),
+      h(start={194584.5,442113.0226180337,497412.50346040993,509236.1596958068,
+            509236.15625}),
+      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
+      P(start={1540564.125,1504650.386070031,1479432.0451056722,
+            1454480.269096047,1429588.25})))
+                          annotation (Placement(transformation(
+        origin={680,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineHP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.88057),
+    Qmax=140,
+    eta_is_nom=0.88057,
+    eta_is_min=0.75,
+    Cst(start=8182844.56002535)=
+        CstHP,
+    pros(d(start=10.66426189633104)),
+    Hrs(start=3046256.0341363903),
+    Pe(fixed=true, start=12431000),
+    Ps(fixed=false, start=2726700))
+              annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineMP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9625),
+    Qmax=150,
+    eta_is_nom=0.9625,
+    eta_is_min=0.75,
+    Cst(start=256335.364995961)=
+        CstMP,
+    pros(d(start=1.8827680646065352)),
+    Hrs(start=3029781.976396904),
+    Pe(fixed=true, start=2548500),
+    Ps(fixed=false, start=476800))
+                annotation (Placement(transformation(extent={{318,-250},{358,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC MelangeurPostTMP1(
+    h(start=3017480.4191624634),
+    P(start=476799.99999954),
+    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
+        origin={418,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineBP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9538),
+    Qmax=150,
+    eta_is_nom=0.9538,
+    eta_is_min=0.75,
+    Cst(start=11944.9445735985)=
+        CstBP,
+    Cs(h(start=2401033.111118852)),
+    Hrs(start=2401030),
+    Pe(fixed=true, start=476799.99999954),
+    Ps(start=10053))
+                annotation (Placement(transformation(extent={{576,-250},{616,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-292,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-232,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(
+                                                    alpha=0.5,
+    Ce(h(start=3046260)),
+    P(start=2726700))
+    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenseur(
+    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    Vf0=0.15,
+    steady_state=false,
+    yNiveau(signal(start=1.5)),
+    Cse(h(start=128076)),
+    P(fixed=false, start=6136),
+    Pfond(start=10000.0),
+    Cl(h(start=191812.29519356362)),
+    proe(d(start=996.0186965963143)))
+    annotation (Placement(transformation(extent={{637,-384},{717,-304}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
+    h0=113.38e3, Q0=29804.5)     annotation (Placement(transformation(extent={{
+            572,-377},{620,-329}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK1(    K=1e-4,
+    h(start=2400000),
+    C1(h_vol(start=2400000), h(start=2400000)),
+    Pm(start=10026.561030835077))
+    annotation (Placement(transformation(extent={{640,-240},{660,-220}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
+    Ce3(h(start=194584.50261452305)),
+    h(start=194584.50261459063),
+    P(start=1540500))
+    annotation (Placement(transformation(
+        origin={902,-318},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeKCond1(    K=1e-4, mode=1,
+    pro(d(start=990.3586687482405)),
+    Pm(start=1540000))
+    annotation (Placement(transformation(
+        origin={902,-270},
+        extent={{12,-12},{-12,12}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
+    h(start=550072.7232069891),
+    P(start=322430))                       annotation (Placement(transformation(
+          extent={{742,-20},{762,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimMP(
+    a3=350,
+    b1(fixed=true) = -3.7751,
+    a1=-244551,
+    Q(fixed=false),
+    mode=1,
+    C1(h_vol(start=550072.7232069891)),
+    C2(h_vol(start=565106.2802015315)),
+    Qv(start=0.01332183238847357),
+    pro(d(start=933.5252816181976)),
+    Pm(start=1725850))
+            annotation (Placement(transformation(extent={{804,-20},{824,0}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimHP(
+    a3=1600,
+    a1=-28056.2,
+    b1=-12.7952660447433,
+    Q(fixed=false),
+    mode=1,
+    C1(h_vol(start=550072.7232069891)),
+    C2(h_vol(start=618649.6677733721)),
+    Qv(start=0.08171817156952406),
+    pro(d(start=931.4140647908531)),
+    Pm(start=6774000))
+             annotation (Placement(transformation(extent={{804,-60},{824,-40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
+                                                    alpha=0.5,
+    h(start=194585),
+    P(start=1540500),
+    Cs(h(start=194585)))
+    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={268,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss PerteChargeZero2(
+    z2=0,
+    mode=0,
+    z1=0,
+    K=K_PerteChargeZero2,
+    h(start=3000000),
+    C1(
+      h_vol(start=3000000),
+      h(start=3000000),
+      P(fixed=true, start=501850)),
+    Pm(start=490000))
+            annotation (Placement(transformation(
+        origin={344,-278},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK3(    K=1e-4, mode=1,
+    Pm(start=322424.2818830876))
+    annotation (Placement(transformation(
+        origin={780,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK8(    K=1e-4, mode=1,
+    Pm(start=322424.28218490275))
+    annotation (Placement(transformation(
+        origin={780,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
+    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK(
+                                                         K=1e-4, mode=1,
+    C1(h_vol(start=191812.29519356362)),
+    C2(h_vol(start=191812.29519356362)),
+    pro(d(start=989.8383588386498)),
+    Pm(start=6200))
+    annotation (Placement(transformation(extent={{702,-446},{722,-426}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimBP(
+    Qv(start=0.2002405532484127),
+    mode=1,
+    a3=400,
+    a1(fixed=true) = -6000,
+    Q(start=194.502, fixed=false),
+    C2(h_vol(start=194584.50261452305)),
+    Pm(start=783963.3809799375))
+            annotation (Placement(transformation(extent={{742,-446},{762,-426}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK2(
+                                                         K=1e-4, mode=1,
+    pro(d(start=990.3586687495459)),
+    C1(h_vol(start=194584.50261452305),
+                            h(start=194585)),
+    Pm(start=1546000))
+    annotation (Placement(transformation(extent={{840,-446},{860,-426}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_extraction(            mode=1, Cvmax=
+        2000,
+    h(start=194500),
+    Cv(start=2000),
+    Pm(start=1549245.4644062065))
+                 annotation (Placement(transformation(extent={{802,-440},{822,
+            -420}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol(start=2674000),
+        h(start=2674000)))
+    annotation (Placement(transformation(
+        origin={-58,8},
+        extent={{-6,6},{6,-6}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol(start=1398000),
+        h(start=1398000))) " "
+    annotation (Placement(transformation(
+        origin={91.5,32},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol(start=944000),
+        h(start=944000)))
+    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol(start=2798000),
+        h(start=2798000)))
+    annotation (Placement(transformation(
+        origin={236,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol(start=2685000),
+        h(start=2685000)))
+    annotation (Placement(transformation(
+        origin={514,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol(start=550000),
+        h(start=550000)))
+    annotation (Placement(transformation(
+        origin={663.5,34},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol(
+          start=550000), h(start=550000)))
+    annotation (Placement(transformation(extent={{687,-11},{700,1}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol(
+          start=194585), h(start=194585)))
+    annotation (Placement(transformation(
+        origin={685.5,-412},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol(
+          start=2401000), h(start=2401000)))
+    annotation (Placement(transformation(
+        origin={684.5,-264},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipeK2(
+                                                          K=Kin_SMP2,
+    Pm(start=2651000),
+    C1(
+      P(fixed=true, start=2726700),
+      h_vol(start=3046000),
+      h(start=3046000)))
+    annotation (Placement(transformation(extent={{114,-120},{94,-100}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_entree_TurbineHP(
+    mode=0,
+    C1(P(fixed=true, start=12680999.9999969)),
+    Cvmax=Cvmax_THP,
+    h(fixed=false, start=3433000),
+    Cv(start=10875),
+    Pm(fixed=false, start=12550000))
+                 annotation (Placement(transformation(extent={{-124,-234},{-104,
+            -214}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauHP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl
+    regulation_Niveau_HP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500)
+    annotation (Placement(transformation(extent={{-40,106},{-20,126}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauMP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl
+    regulation_Niveau_MP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500)
+    annotation (Placement(transformation(extent={{262,106},{282,126}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauBP(                                                              k=1.75)
+    annotation (Placement(transformation(extent={{470,126},{504,144}}, rotation=
+           0)));
+  Control.Drum_LevelControl regulation_Niveau_BP(
+                     add(k1=-1, k2=+1), pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    Ti=10)
+    annotation (Placement(transformation(extent={{568,108},{588,128}}, rotation=
+           0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauCondenseur1(                                 k=1.5)
+    annotation (Placement(transformation(extent={{716,-246},{740,-230}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+                                                add(k1=+1, k2=-1),
+    edge(uL(signal(start=true))))
+                                 annotation (Placement(transformation(extent={{
+            758,-282},{778,-262}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneTurbineHP(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
+            -138,-142}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{944,-42},{906,
+            -10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{945,-96},{907,
+            -64}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{945,-458},{907,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
+    mode=1,
+    V=1,
+    h0=988332,
+    h(start=854493.2404741034),
+    dynamic_mass_balance=true,
+    P0=7010000,
+    P(start=13129347.20636851))           annotation (Placement(transformation(
+          extent={{456,-98},{436,-78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
+    mode=1,
+    V=1,
+    h0=983786,
+    h(start=986348.0919441726),
+    dynamic_mass_balance=true,
+    P0=7000000,
+    P(start=13219328.239579093))          annotation (Placement(transformation(
+          extent={{252,-20},{232,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP1(
+                          mode=1,
+    Cvmax=308.931,
+    h(start=618600),
+    Cv(start=308.931),
+    Pm(start=13130272.672059398))
+                 annotation (Placement(transformation(extent={{754,-98},{730,
+            -122}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP2(
+                          mode=1,
+    Cvmax=308.931,
+    h(start=565000),
+    Cv(start=308.931),
+    Pm(start=3126744.5275077047))
+                 annotation (Placement(transformation(extent={{804,-138},{780,
+            -162}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(
+    Initialvalue=0.8,
+    Finalvalue=0.01,
+    Duration=1000,
+    Starttime=200000)
+                     annotation (Placement(transformation(extent={{946,-150},{
+            908,-118}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(
+    Initialvalue=0.8,
+    Finalvalue=0.01,
+    Duration=1000,
+    Starttime=200000)
+                     annotation (Placement(transformation(extent={{946,-194},{
+            908,-162}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
+    h0=3e6,
+    h(start=3433271.775819776),
+    dynamic_mass_balance=true,
+    P0=12700000,
+    P(start=12700000))                annotation (Placement(transformation(
+        origin={-52,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC MelangeurPreTMP(
+    h0=3523910,
+    h(start=3517975.7051812997),
+    dynamic_mass_balance=true,
+    P0=2400000,
+    P(start=2400000))                     annotation (Placement(transformation(
+        origin={-50,-314},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_entree_TurbineMP(
+    mode=0,
+    C1(P(fixed=true, start=25.486e5)),
+    Cvmax=Cvmax_TMP,
+    h(fixed=false, start=3518000),
+    Cv(start=3.312e6),
+    Pm(fixed=false, start=2547000))
+                 annotation (Placement(transformation(extent={{-124,-318},{-104,
+            -298}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneTurbineMP(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
+            -138,-226}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
+    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
+    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
+    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Gain Gain_2GasTurbine(Gain=
+       2) annotation (Placement(transformation(extent={{-18,-448},{2,-428}},
+          rotation=0)));
+  Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible(
+    Hum=0,
+    Xo=0,
+    Xn=0,
+    Xs=0,
+    rho=0.838,
+    Q0=13.4368286133,
+    T0=185 + 273.16,
+    Xc=0.755,
+    Xh=0.245,
+    Cp=2255,
+    LHV=46989e3)
+          annotation (Placement(transformation(extent={{-421,24},{-385,60}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ sourceEau(             Q0=0.0)
+          annotation (Placement(transformation(extent={{-473,27},{-445,57}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Humidite(k=0.93)
+    annotation (Placement(transformation(extent={{-539,23},{-518,43}}, rotation=
+           0)));
+  FlueGases.BoundaryConditions.SourcePQ SourceFumees(
+    Xso2=0,
+    Xco2=0,
+    Xh2o=0,
+    Xo2=0.20994,
+    Q0=600,
+    T0=29.4 + 273.16,
+    P0=1.013e5)
+    annotation (Placement(transformation(extent={{-539,-74},{-495,-28}},
+          rotation=0)));
+  FlueGases.TAC.GasTurbine GasTurbine(
+    comp_tau_n=14.0178,
+    comp_eff_n=0.87004,
+    exp_tau_n=0.06458,
+    exp_eff_n=0.89045,
+    TurbQred=0.0175634,
+    Kcham=2.02088,
+    chambreCombustionTAC(Pea(fixed=false, start=14.0e5),
+      Psf(start=1333898.05061735),
+      Tsf(start=1493.5527523474145)),
+    Wpth=1e6,
+    Compresseur(
+      is_eff(fixed=false, start=0.88),
+      Xtau(fixed=false, start=1.00),
+      Ps(start=1419889.7074729432),
+      Ts(start=678.0795840911329),
+      Tis(start=630.7876402069812)),
+    TurbineAgaz(
+      Ps(fixed=false),
+      is_eff(fixed=false, start=0.87),
+      Pe(fixed=false, start=1333900),
+      Te(start=1493.59),
+      Ts(fixed=false, start=893.16),
+      Tis(start=814.7448743706253)),
+    xAIR(rho_air(start=1.099457970518182)))
+    annotation (Placement(transformation(extent={{-471,-115},{-341,13}},
+          rotation=0)));
+
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeQfuel(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=13.507,
+    Finalvalue=8.756)
+                     annotation (Placement(transformation(extent={{-539,64},{
+            -519,84}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeIQair(
+    Starttime=200,
+    Duration=800,
+    Finalvalue=415.70,
+    Initialvalue=592.7)
+                   annotation (Placement(transformation(extent={{-541,-20},{
+            -521,0}}, rotation=0)));
+equation
+  connect(SurchauffeurHP3.Cws1, SurchauffeurHP2.Cws2)
+    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
+        color={255,0,0}));
+  connect(SurchauffeurHP2.Cws1, SurchauffeurHP1.Cws2)
+    annotation (Line(points={{-174,-70},{-174,-90},{-54,-90},{-54,-70}}, color=
+          {255,0,0}));
+  connect(constante_vanne_vapeurHP.y, vanne_vapeurHP.Ouv)
+    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
+  connect(vanne_vapeurHP.C1, BallonHP.Cv)
+    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
+  connect(GainChargeHP.C1, BallonHP.Cd)
+    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={255,128,
+          0}));
+  connect(BallonHP.Cm, EvaporateurHP.Cws2)
+    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}));
+  connect(VolumeEvapHP.Cs, EvaporateurHP.Cws1)
+    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={255,128,0}));
+  connect(VolumeEvapHP.Ce1, GainChargeHP.C2)
+                                      annotation (Line(points={{8,-90},{18,-90}},
+        color={255,128,0}));
+  connect(EconomiseurHP4.Cws1, EconomiseurHP3.Cws2)
+    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
+  connect(BallonMP.Cm, EvaporateurMP.Cws2)
+    annotation (Line(points={{320,10},{306,10},{306,-30}}));
+  connect(EvaporateurMP.Cws1, VolumeEvapMP.Cs)
+    annotation (Line(points={{306,-70},{306,-80},{308,-80},{308,-90}}, color={
+          255,128,0}));
+  connect(VolumeEvapMP.Ce1, GainChargeMP.C2)
+    annotation (Line(points={{328,-90},{338,-90}}, color={255,128,0}));
+  connect(constante_vanne_vapeurMP.y, vanne_vapeurMP.Ouv)
+    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
+  connect(SurchauffeurHP1.Cfg2, EvaporateurHP.Cfg1)        annotation (Line(
+      points={{-44,-50},{-24,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurHP.Cfg2, EconomiseurHP4.Cfg1)        annotation (Line(
+      points={{-4,-50},{96,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP4.Cfg2, SurchauffeurMP1.Cfg1)          annotation (Line(
+      points={{76,-50},{136,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP1.Cfg2, EconomiseurHP3.Cfg1)           annotation (Line(
+      points={{156,-50},{196,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurMP.Cfg2, EconomiseurHP2.Cfg1)           annotation (Line(
+      points={{316,-50},{396,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP2.Cfg2, EconomiseurMP.Cfg1)           annotation (Line(
+      points={{416,-50},{456,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurMP.Cfg2, EconomiseurHP1.Cfg1)           annotation (Line(
+      points={{476,-50},{516,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(GainChargeMP.C1, BallonMP.Cd)
+    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={255,
+          128,0}));
+  connect(SurchauffeurMP2.Cfg2, SurchauffeurHP1.Cfg1)          annotation (Line(
+      points={{-104,-50},{-64,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP2.Cfg1, SurchauffeurHP2.Cfg2)           annotation (Line(
+      points={{-124,-50},{-164,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP3.Cfg2, SurchauffeurHP2.Cfg1)           annotation (Line(
+      points={{-224,-50},{-184,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurHP3.Cfg2, SurchauffeurMP3.Cfg1)           annotation (Line(
+      points={{-284,-50},{-244,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP3.Cws1,SurchauffeurMP2. Cws2)
+    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
+          {255,0,0}));
+  connect(SurchauffeurMP1.Cws2, MelangeurHPMP.Ce2) annotation (Line(
+      points={{146,-70},{146,-85},{148,-85},{148,-100}},
+      color={255,0,0},
+      pattern=LinePattern.None));
+  connect(vanne_vapeurBP.C1, BallonBP.Cv)
+    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
+  connect(EvaporateurBP.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
+          -70},{566,-90},{572,-90}}, color={255,128,0}));
+  connect(VolumeEvapBP.Ce1, GainChargeBP.C2)
+                                        annotation (Line(points={{592,-90},{600,
+          -90}}, color={255,128,0}));
+  connect(BallonBP.Cd, GainChargeBP.C1)
+                                       annotation (Line(points={{618,10},{628,
+          10},{628,-90},{620,-90}}, color={255,128,0}));
+  connect(EconomiseurBP.Cfg2, PuitsFumees.C)     annotation (Line(
+      points={{690,-50},{712.2,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP3.Cfg2, SurchauffeurBP.Cfg1)  annotation (Line(
+      points={{216,-50},{256,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurBP.Cfg2, EvaporateurMP.Cfg1)  annotation (Line(
+      points={{276,-50},{296,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP1.Cfg2, EvaporateurBP.Cfg1) annotation (Line(
+      points={{536,-50},{556,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurBP.Cfg2, EconomiseurBP.Cfg1) annotation (Line(
+      points={{576,-50},{670,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(BallonBP.Cm, EvaporateurBP.Cws2)
+    annotation (Line(points={{578,10},{566,10},{566,-30}}));
+  connect(vanne_vapeurMP.C1, BallonMP.Cv)   annotation (Line(points={{298,50},{
+          320,50}}, color={255,0,0}));
+  connect(Vanne_alimentationMPHP.Ouv, constante_ballonBP.y)
+    annotation (Line(points={{720,7},{720,12},{727.3,12}}));
+  connect(SurchauffeurHP3.Cws2, DoubleDebitHP.Ce)
+    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
+        color={255,0,0}));
+  connect(SurchauffeurMP3.Cws2, DoubleDebitMP.Ce)
+    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
+        color={255,0,0}));
+  connect(VolumeCond1.Cs, perteChargeKCond1.C1) annotation (Line(points={{902,
+          -308},{902,-282}}, color={0,0,255}));
+  connect(Vanne_alimentationMPHP.C2, VolumeAlimMPHP.Ce1)
+                                               annotation (Line(points={{730,
+          -10},{742,-10}}, color={0,0,255}));
+  connect(SurchauffeurBP.Cws2, DoubleDebitBP.Ce)
+    annotation (Line(points={{266,-70},{266,-80},{268,-80},{268,-90}}, color={
+          255,0,0}));
+  connect(perteChargeK8.C2, PompeAlimMP.C1)
+    annotation (Line(points={{790,-10},{797,-10},{804,-10}},           color={0,
+          0,255}));
+  connect(VolumeAlimMPHP.Cs1, perteChargeK8.C1)
+    annotation (Line(points={{762,-10},{766,-10},{770,-10}},           color={0,
+          0,255}));
+  connect(VolumeAlimMPHP.Cs2, perteChargeK3.C1)
+                                         annotation (Line(points={{752,-20},{
+          752,-50},{770,-50}}, color={0,0,255}));
+  connect(perteChargeK3.C2, PompeAlimHP.C1)
+    annotation (Line(points={{790,-50},{804,-50}}, color={0,0,255}));
+  connect(MelangeurPostTMP1.Ce2, PerteChargeZero2.C2) annotation (Line(points={
+          {418,-239},{418,-278},{354,-278}}, color={255,0,0}));
+  connect(perteChargeK.C2,PompeAlimBP. C1)
+                                         annotation (Line(points={{722,-436},{
+          742,-436}}, color={0,0,255}));
+  connect(vanne_extraction.C2, perteChargeK2.C1) annotation (Line(points={{822,
+          -436},{840,-436}}, color={0,0,255}));
+  connect(vanne_alimentationHP.C1, CapteurDebitEauHP.C2)
+    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
+  connect(vanne_vapeurHP.C2, CapteurDebitVapHP.C1) annotation (Line(points={{
+          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
+  connect(CapteurDebitVapHP.C2, SurchauffeurHP1.Cws1) annotation (Line(points={
+          {-53.2,1.88},{-53.2,-3.06},{-54,-3.06},{-54,-30}}, color={255,0,0}));
+  connect(vanne_alimentationMP.C1, CapteurDebitEauMP.C2)
+    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
+  connect(CapteurDebitVapMP.C1, vanne_vapeurMP.C2) annotation (Line(points={{
+          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
+  connect(CapteurDebitVapMP.C2, SurchauffeurMP1.Cws1) annotation (Line(points={
+          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
+  connect(CapteurDebitVapBP.C2, SurchauffeurBP.Cws1) annotation (Line(points={{
+          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
+  connect(CapteurDebitVapBP.C1, vanne_vapeurBP.C2) annotation (Line(points={{
+          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
+  connect(CapteurDebitEauBP.C2, vanne_alimentationBP.C1) annotation (Line(
+        points={{658.3,40.12},{658.3,48},{650,48}}, color={0,0,255}));
+  connect(CapteurDebitEauBPsortie.C2, Vanne_alimentationMPHP.C1) annotation (Line(
+        points={{700.13,-9.8},{705.065,-9.8},{705.065,-10},{710,-10}}, color={0,
+          0,255}));
+  connect(CapteurDebitEauCondenseur.C2, perteChargeK.C1) annotation (Line(
+        points={{680.3,-422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
+  connect(perteChargeK1.C2, CapteurDebitVapCondenseur.C1) annotation (Line(
+        points={{660,-230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
+  connect(MelangeurHPMP.Ce1, MoitieDebitHP.Cs)
+    annotation (Line(points={{148,-120},{148,-170},{134,-170}}, color={255,0,0}));
+  connect(perteChargeK2.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,
+          -436},{862,-436},{862,-318},{872,-318}}, color={0,0,255}));
+  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
+          {892,-318}}, color={0,0,255}));
+  connect(SurchauffeurMP2.Cws1, lumpedStraightPipeK2.C2)
+    annotation (Line(points={{-114,-70},{-114,-110},{94,-110}}, color={255,0,0}));
+  connect(lumpedStraightPipeK2.C1, MelangeurHPMP.Cs2)
+    annotation (Line(points={{114,-110},{138.2,-110}}, color={255,0,0}));
+  connect(DoubleDebitHP.Cs, vanne_entree_TurbineHP.C1) annotation (Line(points=
+          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
+  connect(DoubleDebitBP.Cs, PerteChargeZero2.C1) annotation (Line(points={{268,
+          -110},{268,-278},{334,-278}}, color={255,0,0}));
+  connect(PompeAlimBP.C2, vanne_extraction.C1) annotation (Line(points={{762,
+          -436},{802,-436}}, color={0,0,255}));
+  connect(BallonHP.yLevel,regulation_Niveau_HP. MesureNiveauEau)
+    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
+  connect(regulation_Niveau_HP.SortieReelle1, vanne_alimentationHP.Ouv)
+    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
+  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
+    annotation (Line(points={{208.7,122},{234,122},{234,110},{261.5,110}}));
+  connect(BallonMP.yLevel,regulation_Niveau_MP. MesureNiveauEau)
+    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
+  connect(regulation_Niveau_MP.SortieReelle1, vanne_alimentationMP.Ouv)
+    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
+  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
+    annotation (Line(points={{505.7,135},{529.85,135},{529.85,112},{567.5,112}}));
+  connect(BallonBP.yLevel,regulation_Niveau_BP. MesureNiveauEau)
+    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
+  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
+    annotation (Line(points={{741.2,-238},{752,-238},{752,-269},{757.5,-269}}));
+  connect(regulation_Niveau_Condenseur.SortieReelle1, vanne_extraction.Ouv)
+    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
+  connect(CapteurDebitEauBP.C1, EconomiseurBP.Cws2)
+    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
+  connect(EconomiseurBP.Cws1, perteChargeKCond1.C2) annotation (Line(points={{
+          680,-70},{680,-186},{902,-186},{902,-258}}));
+  connect(CapteurDebitVapCondenseur.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
+    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,
+          -280.9}}));
+  connect(regulation_Niveau_Condenseur.MesureDebitEau,
+    CapteurDebitEauCondenseur.Measure) annotation (Line(points={{757.45,-274.95},
+          {750,-274.95},{750,-310},{792,-310},{792,-412},{692.13,-412}}));
+  connect(ConstantVanneTurbineHP.y, vanne_entree_TurbineHP.Ouv)
+    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
+  connect(regulation_Niveau_BP.SortieReelle1, vanne_vapeurBP.Ouv)
+    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
+  connect(vanne_alimentationBP.Ouv, constante_vanne_vapeurBP.y)
+    annotation (Line(points={{640,65},{640,81},{653.4,81}}));
+  connect(EconomiseurHP1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
+          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
+  connect(VolumeECO_HP1_2.Cs, EconomiseurHP2.Cws1) annotation (Line(points={{
+          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
+  connect(EconomiseurHP2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
+          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
+  connect(VolumeECO_HP2_3.Cs, EconomiseurHP3.Cws1) annotation (Line(points={{
+          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
+  connect(Vanne_alimentationMPHP1.C1, PompeAlimHP.C2)
+    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-50},{824,-50}}));
+  connect(PompeAlimMP.C2, Vanne_alimentationMPHP2.C1) annotation (Line(points={
+          {824,-10},{870,-10},{870,-142.8},{804,-142.8}}, color={0,0,255}));
+  connect(arretPomesMp1.y, Vanne_alimentationMPHP1.Ouv)
+    annotation (Line(points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,
+          -123.2}}));
+  connect(arretPomesHP1.y, Vanne_alimentationMPHP2.Ouv)
+    annotation (Line(points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,
+          -163.2}}));
+  connect(Vanne_alimentationMPHP1.C2, EconomiseurHP1.Cws1) annotation (Line(
+        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
+          -6},{526,-30}}, color={0,0,255}));
+  connect(EconomiseurMP.Cws1, Vanne_alimentationMPHP2.C2)
+    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
+  connect(ConstantVanneTurbineMP.y, vanne_entree_TurbineMP.Ouv)
+    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
+  connect(vanne_entree_TurbineHP.C2, VolumePreTHP.Ce) annotation (Line(points={
+          {-104,-230},{-62,-230}}, color={255,0,0}));
+  connect(DoubleDebitMP.Cs, vanne_entree_TurbineMP.C1) annotation (Line(points=
+          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
+  connect(vanne_entree_TurbineMP.C2, MelangeurPreTMP.Ce1) annotation (Line(
+        points={{-104,-314},{-60,-314}}, color={255,0,0}));
+  connect(SourceCaloporteur.C, Condenseur.Cee) annotation (Line(points={{620,-353},
+          {638,-353},{638,-352.8},{637,-352.8}},     color={0,0,255}));
+  connect(Condenseur.Cse, PuitsCaloporteur.C) annotation (Line(points={{717,-352},
+          {736,-352}},       color={0,0,255}));
+  connect(CapteurDebitVapCondenseur.C2, Condenseur.Cv) annotation (Line(points={{679.3,
+          -274.2},{679.3,-288.1},{677,-288.1},{677,-304}},         color={0,0,
+          255}));
+  connect(CapteurDebitEauCondenseur.C1, Condenseur.Cl)
+    annotation (Line(points={{680.3,-402},{677.8,-402},{677.8,-384}}));
+  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
+    annotation (Line(points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}}));
+  connect(Condenseur.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
+    annotation (Line(points={{721,-372.8},{780,-372.8},{780,-326},{732,-326},{732,
+          -263},{757.5,-263}}));
+  connect(BallonBP.Cs, CapteurDebitEauBPsortie.C1) annotation (Line(points={{
+          578,22},{564,22},{564,16},{642,16},{642,-9.8},{687,-9.8}}, color={0,0,
+          255}));
+  connect(BallonBP.Ce1, vanne_alimentationBP.C2)
+    annotation (Line(points={{618,50},{624,50},{624,48},{630,48}}));
+  connect(BallonMP.Ce1, vanne_alimentationMP.C2)
+    annotation (Line(points={{358,50},{378,50}}));
+  connect(BallonHP.Ce1, vanne_alimentationHP.C2)
+    annotation (Line(points={{38,50},{58,50}}));
+  connect(TurbineHP.Cs, MoitieDebitHP.Ce) annotation (Line(points={{38.2,-230},
+          {74,-230},{74,-170},{114,-170}}, color={255,0,0}));
+  connect(VolumePreTHP.Cs3, TurbineHP.Ce) annotation (Line(points={{-42,-230},{
+          -2.2,-230}}, color={255,0,0}));
+  connect(MelangeurPreTMP.Cs, TurbineMP.Ce) annotation (Line(points={{-40,-314},
+          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
+  connect(TurbineMP.Cs, MelangeurPostTMP1.Ce1) annotation (Line(points={{358.2,
+          -230},{408,-230}}, color={255,0,0}));
+  connect(MelangeurPostTMP1.Cs, TurbineBP.Ce) annotation (Line(points={{428,
+          -230},{575.8,-230}}, color={255,0,0}));
+  connect(TurbineBP.Cs, perteChargeK1.C1) annotation (Line(points={{616.2,-230},
+          {640,-230}}, color={255,0,0}));
+  connect(EconomiseurMP.Cws2, CapteurDebitEauMP.C1) annotation (Line(points={{
+          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
+  connect(TurbineMP.MechPower, Alternateur.Wmec2)
+    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
+  connect(TurbineBP.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
+          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
+  connect(TurbineHP.MechPower, Alternateur.Wmec3)
+    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
+  connect(heatSource.C[1], BallonHP.Cex) annotation (Line(points={{18,68.3},{18,
+          50}}, color={191,95,0}));
+  connect(heatSource1.C[1], BallonMP.Cex) annotation (Line(points={{339,68.3},{
+          339,50}}, color={191,95,0}));
+  connect(heatSource2.C[1], BallonBP.Cex) annotation (Line(points={{598,64.3},{
+          598,50}}, color={191,95,0}));
+  connect(Gain_2GasTurbine.y, Alternateur.Wmec5)
+    annotation (Line(points={{3,-438},{402,-438}}));
+  connect(CapteurDebitEauHP.C1, EconomiseurHP4.Cws2)
+    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
+  connect(PompeAlimMP.rpm_or_mpower, arretPomesMp.y)
+    annotation (Line(points={{814,-21},{814,-26},{904.1,-26}}, smooth=Smooth.None));
+  connect(PompeAlimHP.rpm_or_mpower, arretPomesHP.y)
+    annotation (Line(points={{814,-61},{814,-80},{905.1,-80}}, smooth=Smooth.None));
+  connect(PompeAlimBP.rpm_or_mpower, arretPomesBP.y) annotation (Line(points={{
+          752,-447},{754,-447},{754,-460},{878,-460},{878,-442},{905.1,-442}},
+        smooth=Smooth.None));
+  connect(SourceFumees.C,GasTurbine. Entree_air)
+                                                annotation (Line(
+      points={{-495,-51},{-471,-51}},
+      color={0,0,0},
+      thickness=1));
+  connect(sourceCombustible.C,GasTurbine. Entree_combustible) annotation (Line(
+        points={{-385,42},{-367,42},{-367,13}}, color={0,0,0}));
+  connect(sourceEau.C,GasTurbine. Entree_eau_combustion)
+    annotation (Line(points={{-445,42},{-445,13}}, color={0,0,255}));
+  connect(sourceCombustible.IMassFlow,rampeQfuel. y)
+    annotation (Line(points={{-403,51},{-403,74},{-518,74}}));
+  connect(rampeIQair.y,SourceFumees. IMassFlow)
+    annotation (Line(points={{-520,-10},{-520,-36},{-517,-36},{-517,-39.5}}));
+  connect(Humidite.y, GasTurbine.Huminide)
+    annotation (Line(points={{-516.95,33},{-487,33},{-487,-12.6},{-473.6,-12.6}}));
+  connect(GasTurbine.Sortie_fumees, SurchauffeurHP3.Cfg1) annotation (Line(
+      points={{-341,-51},{-290,-50},{-304,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(GasTurbine.PuissanceMeca, Gain_2GasTurbine.u)
+    annotation (Line(points={{-338.4,-76.6},{-326,-76.6},{-326,-438},{-19,-438}}));
+  annotation (Diagram(graphics,
+                      coordinateSystem(preserveAspectRatio=false,extent={{-550,
+            -460},{950,150}},
+        initialScale=0.1)),
+    experiment(StopTime=2500, Tolerance=0.001),
+    experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end CombinedCycle_Load_100_50;
diff --git a/ThermoSysPro/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo b/ThermoSysPro/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo
index f8a53b1abc976b1f0b191f68f256efab9dafaa64..2cd587a52a454a45cd0a25283e105836a9ce7401 100644
--- a/ThermoSysPro/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo
+++ b/ThermoSysPro/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo
@@ -1,1769 +1,1769 @@
-within ThermoSysPro.Examples.CombinedCyclePowerPlant;
-model CombinedCycle_TripTAC
-  "CCPP model to simulate a load variation from 100% to 50%"
-  parameter Real CstHP(fixed=false,start=7921079.316566086)
-    "Stodola's ellipse coefficient HP";
-  parameter Real CstMP(fixed=false,start=251309.80339850043)
-    "Stodola's ellipse coefficient MP";
-  parameter Real CstBP(fixed=false,start=10675.291494903773)
-    "Stodola's ellipse coefficient BP";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
-    "Maximum CV: alim. valve HP Drum  ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
-    "Maximum CV: steam valve BP Drum ";
-  parameter Real Encras_SHP1(fixed=false,start=1)
-    "Sur HP1: heat exchange fouling coefficient";
-  parameter Real Encras_SHP2(fixed=false,start=1)
-    "Sur HP2: heat exchange fouling coefficient";
-  parameter Real Encras_SHP3(fixed=false,start=1)
-    "Sur HP3: heat exchange fouling coefficient";
-  parameter Real Encras_EHP1(fixed=false,start=1)
-    "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Encras_EHP2(fixed=false,start=1)
-    "Eco HP2: heat exchange fouling coefficient";
-  parameter Real Encras_EHP3(fixed=false,start=1)
-    "Eco HP3: heat exchange fouling coefficient";
-  parameter Real Encras_EHP4(fixed=false,start=1)
-    "Eco HP4: heat exchange fouling coefficient";
-
-  parameter Real Encras_SMP1(fixed=false,start=1)
-    "Sur MP1: heat exchange fouling coefficient";
-  parameter Real Encras_SMP2(fixed=false,start=1)
-    "Sur MP2: heat exchange fouling coefficient";
-  parameter Real Encras_SMP3(fixed=false,start=1)
-    "Sur MP3: heat exchange fouling coefficient";
-  parameter Real Encras_EMP(fixed=false,start=1)
-    "Eco MP: heat exchange fouling coefficient";
-
-  parameter Real Encras_EvHP(fixed=false,start=1)
-    "Evapo HP: heat exchange fouling coefficient";
-  parameter Real Encras_EvMP(fixed=false,start=1)
-    "Evapo MP: heat exchange fouling coefficient";
-  parameter Real Encras_EvBP(fixed=false,start=1)
-    "Evapo BP: heat exchange fouling coefficient";
-
-  parameter Real Encras_SBP(fixed=false,start=1)
-    "Sur BP: heat exchange fouling coefficient";
-  parameter Real Encras_EBP(fixed=false,start=1)
-    "Eco BP: heat exchange fouling coefficient";
-
-  parameter Real KgainChargeHP(fixed=false,start=720.183)
-    "HP: Friction pressure loss coefficient";
-  parameter Real KgainChargeMP(fixed=false,start=1090.9)
-    "MP: Friction pressure loss coefficient";
-  parameter Real Kin_SMP2(fixed=false,start=10.)
-    "SMPin: Friction pressure loss coefficient";
-  parameter Real K_PerteChargeZero2(fixed=false,start=1e-4)
-    "TurbineMP out: Friction pressure loss coefficient";
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
-    "Maximum CV input Turbine HP ";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
-    "Maximum CV input Turbine MP ";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonHP(
-    L=16.27,
-    Vertical=false,
-    hl(fixed=false, start=1460508.128907675),
-    hv(fixed=false, start=2664791.3052738607),
-    Vv(fixed=false),
-    R=1.05,
-    xmv(fixed=false),
-    zl(start=1.05, fixed=true),
-    Mp=5000,
-    Kpa=5,
-    Kvl=1000,
-    P(fixed=false, start=12726424.235625941),
-    Pfond(start=12733333.038455429),
-    Tp(start=589.5151351323206))
-                     annotation (Placement(transformation(extent={{5,10},{-35,
-            50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationHP(
-      Cvmax=CvmaxValveAHP,
-    C1(P(start=13394232.807871036),
-                            h_vol(start=1399087.0448386343)),
-    h(start=1398000),
-    Cv(start=178),
-    Pm(start=13050700))
-                 annotation (Placement(transformation(extent={{45,46},{25,66}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurHP(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{-51,70},{-61,78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurHP(
-    Cvmax=47829.4,
-    mode=0,
-    C2(h_vol(start=2664791.3052738607)),
-    h(start=2674000),
-    Cv(start=23914.7),
-    Pm(start=12724920.902023433))
-                 annotation (Placement(transformation(extent={{-55,46},{-75,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeHP(
-    z2=0,
-    mode=1,
-    Q(start=150, fixed=true),
-    z1=10.83,
-    K=KgainChargeHP,
-    C2(P(start=12757776.366696326)),
-    h(start=1474422.14552527),
-    Pm(start=12704000))
-            annotation (Placement(transformation(
-        origin={-5,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,
-    h(start=1460508.128907675),
-    P(start=12704000))                     annotation (Placement(transformation(
-          extent={{-25,-100},{-45,-80}},
-                                       rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EvaporateurHP(
-    Dint=32.8e-3,
-    Ntubes=1476,
-    L=20.7,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
-      Tp(start={607.95945081921,605.4313602675011,604.0450760348469}),
-      Tp1(start={606.5065615724875,604.7563153894058,603.7327223072098})),
-    Ns=3,
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.092,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      K(fixed=true, start=37.69),
-      CSailettes=11.86442072,
-      p_rho=1.05,
-      Encras=Encras_EvHP,
-      DeltaT(start={106,49,23}),
-      T(start={755.2099609375,674.1281000784297,635.8939469832528,
-            618.0787353515625}),
-      Tm(start={714.669037024263,655.0110235308413,626.9863546635906}),
-      Tp(start={609.3093210980612,606.0585402262541,604.3352819224443})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=10.83,
-      option_temperature=2,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={5.74e7,2.67e7,1.24e7}),
-      h(start={1460508.125,1842386.3805685563,2019815.5675635953,
-            2101914.802366878,1460508.125}),
-      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
-      P(start={12757776.0,12739926.315661393,12734300.718607338,
-            12730145.067304946,12726424.0})))
-                          annotation (Placement(transformation(
-        origin={-47,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurHP4(
-    Ns=3,
-    L=20.726,
-    Dint=0.0266,
-    Ntubes=246,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-3.5e6,-2.63e6,-2e6}),
-      Tp(start={577.1652678885227,582.2393934514894,585.9616914189281}),
-      Tp1(start={576.5195841307088,581.753378536046,585.5943808718256})),
-    Cws1(P(start=13320777.811415095),
-                              h_vol(start=1292777.0058783418)),
-    Cws2(h_vol(start=1399087.0448386343)),
-    ExchangerFlueGasesMetal(
-      Dext=0.0318,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.39069779,
-      K(fixed=true, start=47.53),
-      p_rho=1.06,
-      Encras=Encras_EHP4,
-      DeltaT(start={38,29,22}),
-      T(start={618.0787353515625,613.037602447671,609.2389186305828,
-            606.3656616210938}),
-      Tm(start={615.5581823957998,611.1382605391269,607.8022941316214}),
-      Tp(start={577.7558398657263,582.6839249827347,586.2976504908789})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      z2=0,
-      option_temperature=2,
-      inertia=true,
-      dW1(start={3.5e6,2.63e6,2e6}),
-      h(start={1292777.0,1338569.0293807227,1373037.3060893763,
-            1399087.0448386343,1399087.0}),
-      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
-      P(start={13320778.0,13339750.403131645,13358253.29250947,
-            13376387.23615858,13394233.0})))
-                          annotation (Placement(transformation(
-        origin={53,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=270)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurHP1(
-    Ns=3,
-    L=20.4,
-    Dint=0.0324,
-    Ntubes=246,
-    ExchangerWall(e=0.0028, lambda=37.61,
-    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
-      Tp(start={641.7766266045941,659.2542181292313,674.5323393956571}),
-      Tp1(start={639.7295258289556,657.6427819154001,673.2854985024741})),
-    Cws1(h_vol(start=2664791.3052738607)),
-    Cws2(P(start=12720084.224503415),
-                              h_vol(start=2973079.185217006)),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=10.25056,
-      K(fixed=true, start=34.71),
-      p_rho=1.04,
-      Encras=Encras_SHP1,
-      DeltaT(start={138,108,84}),
-      T(start={787.8693237304688,774.2709985521502,763.5355376271307,
-            755.2099609375}),
-      Tm(start={781.0701669240514,768.9032680896405,759.3727557986135}),
-      Tp(start={643.6669592742874,660.7422496694279,675.683696525852})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      option_temperature=2,
-      inertia=true,
-      dW1(start={9.8e6,7.7e6,5.9e6}),
-      h(start={2664791.25,2793445.279188231,2894719.078252342,2973079.185217006,
-            2973079.25}),
-      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
-      P(start={12723418.0,12723372.064267773,12722706.076957166,
-            12721569.805902744,12720084.0})))
-                          annotation (Placement(transformation(
-        origin={-87,-50},
-        extent={{-20,20},{20,-20}},
-        rotation=270)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurHP3(
-    Dint=26.6e-3,
-    Ntubes=1476,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
-      Tp(start={557.1357570088924,563.7223638401374,566.037182893163}),
-      Tp1(start={556.657781456147,563.5505466405001,565.9750435970707})),
-    L=20.726,
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=12.451,
-      K(fixed=true, start=36.0300000000857),
-      p_rho=1.08,
-      Encras=Encras_EHP3,
-      St=5, DeltaT(start={34,12,4.4}),
-      T(start={602.606689453125,580.0827929934445,571.956039969206,
-            569.0130004882813}),
-      Tm(start={591.3447334381658,576.0194164813253,570.4845269121585}),
-      Tp(start={557.5729353703138,563.879515730797,566.0940183432008})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.6e7,5.6e6,2.1e6}),
-      h(start={989834.8125,1193223.55215195,1266335.416732016,
-            1292777.0058783418,1292777.0}),
-      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
-      P(start={13239006.0,13261089.90163249,13281516.713631846,
-            13301273.845180616,13320778.0})))
-                  annotation (Placement(transformation(
-        origin={173,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurHP2(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-5e6,-3e6,-2.e6}),
-      Tp(start={492.5265031447411,499.7298617398276,504.2372403374727}),
-      Tp1(start={492.3269425182926,499.6044056390882,504.15828372038055})),
-    L=20.767,
-    Ntubes=1107,
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=111e-3,
-      CSailettes=2.76134577,
-      K(fixed=true, start=65.5300000000393),
-      p_rho=1.11,
-      Encras=Encras_EHP2,
-      St=5, DeltaT(start={36,23,14}),
-      T(start={531.2528686523438,524.0786479337396,519.5624877991071,
-            516.7178344726563}),
-      Tm(start={527.6657680129605,521.8205678664233,518.1401706426662}),
-      Tp(start={492.70903044592376,499.8446096432236,504.3094576805689})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={5e6,3e6,2.e6}),
-      h(start={860655.375,924469.2991480937,964586.6772085332,989834.8113335292,
-            989834.8125}),
-      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
-      P(start={13149154.0,13172140.227906534,13194684.103908138,
-            13216938.318123804,13239006.0})))
-                  annotation (Placement(transformation(
-        origin={373,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurHP1(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-9.9999e6,-5e6,-2.4e6}),
-      Tp(start={461.83700038875077,471.4458881656956,476.1007075853514}),
-      Tp1(start={461.41562496249884,471.24253667400546,476.002824325766})),
-    L=20.726,
-    Ntubes=1107,
-    Cws1(h_vol(start=630040.8772883223)),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=8.30057632,
-      K(fixed=true, start=40.24),
-      p_rho=1.13,
-      Encras=Encras_EHP1,
-      St=5,   DeltaT(start={41,20,10}),
-      T(start={509.81195068359375,494.60709242744036,487.25141439639447,
-            483.7066345214844}),
-      Tm(start={502.2095163065458,490.92925341191744,485.4790272730564}),
-      Tp(start={462.22240967868714,471.63188276609173,476.1902361036878})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.767,
-      inertia=true,
-      dW1(start={9.9999e6,5e6,2.4e6}),
-      h(start={630040.875,764519.0167009356,829416.7979796123,860655.3510811749,
-            860655.375}),
-      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
-      advection=true,
-      dynamic_mass_balance=true,
-      P(start={13054959.0,13079363.233486831,13102973.863543343,
-            13126167.933420062,13149154.0})))
-                  annotation (Placement(transformation(
-        origin={493,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurHP2(
-    Ns=3,
-    L=20.4,
-    Dint=32e-3,
-    Ntubes=246,
-    ExchangerWall(e=3e-3, lambda=27,
-          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
-      Tp(start={718.0595138013858,738.8988421059552,755.1216906441867}),
-      Tp1(start={715.284148781996,736.8146275114044,753.568899547355})),
-    Cws2(P(start=12710803.048741188),
-                               h_vol(start=3240679.101987554)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      K(fixed=true, start=34.74),
-      CSailettes=10.2505424803872,
-      p_rho=1.02,
-      Encras=Encras_SHP2,
-      St=5,
-      DeltaT(start={124,93,70}),
-      T(start={850.2295532226563,838.165359685431,829.0838172755421,
-            822.3056030273438}),
-      Tm(start={844.1974477839519,833.6245884804865,825.6946997760892}),
-      Tp(start={720.6064978764006,740.8115495674804,756.5467047118})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.83,
-      inertia=true,
-      dW1(start={8.8e6,6.6e6,4.9e6}),
-      h(start={2973079.25,3088900.225778996,3175878.2994419048,
-            3240679.101987554,3240679.0}),
-      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
-      P(start={12720084.0,12718408.787041187,12716215.067117244,
-            12713645.694467228,12710803.0})))
-                  annotation (Placement(transformation(
-        origin={-207,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurHP3(
-    Ns=3,
-    L=20.4,
-    Ntubes=246,
-    ExchangerWall(lambda=27, e=5e-3,
-    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
-      Tp(start={789.2881838358564,806.7088039780044,819.9912755140301}),
-      Tp1(start={785.6370057524725,803.9662515359148,817.9384055160485})),
-    Dint=28e-3,
-    Cws2(h_vol(start=3432930.991856911)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      K(fixed=true, start=49.33),
-      CSailettes=6.59672842597229,
-      p_rho=1,
-      Encras=Encras_SHP3,
-      St=5,
-      DeltaT(start={97,73,55}),
-      T(start={893.75,885.1796729176981,878.7316754228791,873.8992309570313}),
-      Tm(start={889.464836458849,881.9556741702886,876.315464574507}),
-      Tp(start={792.4232630808997,809.0636930146954,821.7539696298131})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.726,
-      inertia=true,
-      dW1(start={6.3e6,4.7e6,3.6e6}),
-      h(start={3240679.0,3323783.054261407,3386205.9057494565,3432930.991856911,
-            3432931.0}),
-      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
-      P(start={12710803.0,12704112.803652512,12696819.484746953,
-            12689077.136342296,12681000.0})))
-                  annotation (Placement(transformation(
-        origin={-327,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonMP(
-    L=16.27,
-    Vertical=false,
-    P0=27.29e5,
-    hl(fixed=false, start=980960.1562978515),
-    hv(fixed=false, start=2798761.3254371085),
-    Vv(fixed=false),
-    R=1.05,
-    P(fixed=false, start=2733918.2848144253),
-    zl(start=1.05, fixed=true),
-    Kpa=5,
-    Mp=5000,
-    Kvl=1000,
-    Pfond(start=2742462.980913138),
-    Tp(start=497.4249792990277))
-                     annotation (Placement(transformation(extent={{325,10},{287,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurMP(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{271,70},{259,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationMP(
-      Cvmax=CvmaxValveAMP,
-    C1(P(start=3253417.522956237),
-                           h_vol(start=947830.5281155076)),
-    h(start=944000),
-    Cv(start=28),
-    Pm(start=2975000))
-                 annotation (Placement(transformation(extent={{365,46},{345,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurMP(
-    Cvmax=47829.4,
-    mode=0,
-    C2(h_vol(start=2798761.3254371085)),
-    h(fixed=false, start=2798000),
-    Cv(start=23914.7),
-    Pm(fixed=false, start=2732653.9482791456))
-                 annotation (Placement(transformation(extent={{265,46},{245,66}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EvaporateurMP(
-    Dint=32.8e-3,
-    L=20.767,
-    Ntubes=738,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
-      Tp(start={504.9993271430632,504.2768804788304,503.69756244079724}),
-      Tp1(start={504.503193578626,503.89321384657916,503.40091865289605})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.83,
-      continuous_flow_reversal=true,
-      inertia=true,
-          dW1(start={9.7e7,7.6e6,5.8e6}),
-      P(start={2773378.75,2751240.3575119935,2743530.0500684776,
-            2738283.631137228,2733918.25}),
-      h(start={980960.1875,1046373.213452734,1096957.9937272775,
-            1136069.1896699532,980960.1875}),
-      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
-    Cws1(P(start=2773378.6567335734)),
-    ExchangerFlueGasesMetal(
-      K(fixed=true, start=30.22),
-      Dext=38e-3,
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=10.0676093,
-      p_rho=1.1,
-      Encras=Encras_EvMP,
-      St=5,
-      DeltaT(start={53,41,32}),
-      T(start={565.5570068359375,551.1237970278224,539.9287004763471,
-            531.2528686523438}),
-      Tm(start={558.3404164937012,545.5262487520847,535.5907942842642}),
-      Tp(start={505.4602817233831,504.6333427384495,503.9731723219999})))
-                          annotation (Placement(transformation(
-        origin={273,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeMP(
-    z2=0,
-    z1=10.83,
-    mode=1,
-    Q(start=150, fixed=true),
-    K=KgainChargeMP,
-    Pm(start=2734000),
-    h(start=978914.570821827))
-            annotation (Placement(transformation(
-        origin={315,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
-    h(start=980960.1562978515),
-    P(start=2734000))                      annotation (Placement(transformation(
-          extent={{295,-100},{275,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurMP(
-    ExchangerWall(e=2.6e-3, lambda=47,
-        dW1(start={-3e6,-1.4e6,-740379}),
-      Tp(start={470.48677107325835,488.1938632909576,497.65207032563256}),
-      Tp1(start={470.01280565475304,487.9402946158829,497.51626768286917})),
-    L=20.726,
-    Ns=3,
-    Dint=26.6e-3,
-    Ntubes=246,
-    Cws1(h_vol(start=576430.3612424443)),
-    Cws2(h_vol(start=947830.5281155076)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      K(fixed=true, start=47.78),
-      CSailettes=7.16188651,
-      p_rho=1.12,
-      Encras=Encras_EMP,
-      St=5,
-      DeltaT(start={45,24,13}),
-      T(start={516.7178344726563,512.927875284067,510.89894284399503,
-            509.81195068359375}),
-      Tm(start={514.8228643851462,511.91340906403104,510.35544151482316}),
-      Tp(start={470.920281581991,488.4257888303293,497.7762816508864})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.767,
-      z2=0,
-      inertia=true,
-      dW1(start={3e6,1.4e6,740379}),
-      h(start={576430.375,780326.2782299566,889409.3790325949,947830.5281155076,
-            947830.5}),
-      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
-      P(start={3160828.5,3185369.6108956896,3208693.506993564,
-            3231270.1974957627,3253417.5})))
-                          annotation (Placement(transformation(
-        origin={433,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurMP1(
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.3e6,-0.80263e6,
-                                -501864}),
-      Tp(start={558.0934551632172,574.0136440053798,584.242260992374}),
-      Tp1(start={557.706011115662,573.7688585895307,584.0889760553388})),
-    L=20.726,
-    Ns=3,
-    Dint=32.8e-3,
-    Ntubes=123,
-    Cws1(h_vol(start=2798761.3254371085)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      K(fixed=true, start=22.09),
-      CSailettes=14.46509765,
-      p_rho=1.07,
-      Encras=Encras_SMP1,
-      St=5,
-      DeltaT(start={45,30,19}),
-      T(start={606.3656616210938,604.5120304885253,603.3404748736327,
-            602.606689453125}),
-      Tm(start={605.4388500605926,603.926252681079,602.9735743782599}),
-      Tp(start={558.4534269956265,574.2410725985397,584.3846770655402})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.77,
-      inertia=true,
-      dW1(start={1.3e6,0.80263e6,501864}),
-      h(start={2798761.25,2900642.773718668,2965011.0169332824,
-            3005318.492253628,3040245.5}),
-      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
-      P(start={2731389.5,2730444.2277886732,2729310.613093969,
-            2728046.4038641006,2726700.0})))
-                          annotation (Placement(transformation(
-        origin={113,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Volumes.VolumeB MelangeurHPMP(
-    Ce1(h(start=3046003.380872726)),
-    h(start=3040245.422545259),
-    P(start=2726000))
-    annotation (Placement(transformation(
-        origin={115,-110},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurMP2(
-    Ns=3,
-    L=20.4,
-    Dint=39.3e-3,
-    Ntubes=369,
-    ExchangerWall(e=2.6e-3, lambda=36.86,
-    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
-      Tp(start={688.9747491924221,714.1387227867799,731.7594455240543}),
-      Tp1(start={687.7117385985722,713.2642402785228,731.156085252147})),
-    Cws1(P(start=2575477.4929098235),
-                             h_vol(start=3040245.422545259)),
-    Cws2(P(start=2558200.620927911),
-                             h_vol(start=3321522.540904887)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=92e-3,
-      K(fixed=true, start=45.22),
-      CSailettes=5.814209831,
-      p_rho=1.03,
-      Encras=Encras_SMP2,
-      St=5,
-      DeltaT(start={125,86,60}),
-      T(start={822.3056030273438,806.4713844816748,795.4738313791455,
-            787.8693237304688}),
-      Tm(start={814.3884833791556,800.9726079304102,791.671583337549}),
-      Tp(start={690.1616978609907,714.9605415853846,732.3264698030932})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dW1(start={1.15e7,7.9e6,5.5e6}),
-      h(start={3040245.5,3169860.5211362485,3259603.344415277,3321522.540904887,
-            3321522.5}),
-      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
-      P(start={2575477.5,2571810.3704688977,2567607.9202979314,
-            2563033.661146952,2558200.5})))
-                          annotation (Placement(transformation(
-        origin={-147,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurMP3(
-    Ns=3,
-    L=20.4,
-    Ntubes=369,
-    Dint=45.6e-3,
-    ExchangerWall(e=2.6e-3, lambda=27,
-    dW1(start={-8e6,-5.5e6,-3.8e6}),
-      Tp(start={786.0003533757151,802.6089712721623,814.0750543986999}),
-      Tp1(start={784.9544439166481,801.8912118855588,813.583437630984})),
-    Cws2(h_vol(start=3517381.1285517)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=92e-3,
-      Dext=50.8e-3,
-      K(fixed=true, start=43.23),
-      CSailettes=5.695842178,
-      p_rho=1.01,
-      Encras=Encras_SMP3,
-      St=5,
-      DeltaT(start={82,56,38}),
-      T(start={873.8992309570313,862.9376291442026,855.3997728669909,
-            850.2295532226563}),
-      Tm(start={868.4184414351687,859.1687010055967,852.814654374732}),
-      Tp(start={786.9913001992309,803.2890123388494,814.5408366613608})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dW1(start={8e6,5.5e6,3.8e6}),
-      h(start={3321522.5,3412353.763453483,3474687.0390689597,3517381.1285517,
-            3517381.25}),
-      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
-      P(start={2558200.5,2556022.8892716086,2553661.4076231164,
-            2551174.061990546,2548600.0})))
-                          annotation (Placement(transformation(
-        origin={-267,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonBP(
-    Vertical=false,
-    P0=5e5,
-    Vv(fixed=false),
-    L=8,
-    hl(fixed=false, start=561432.6820300646),
-    hv(fixed=false, start=2682927.2097681486),
-    R=2,
-    P(fixed=false, start=536006.6647383622),
-    zl(start=1.75, fixed=true),
-    Kpa=5,
-    Mp=5000,
-    Kvl=1000,
-    Pfond(start=552000.8087452435),
-    Tp(start=409.09918124890646))
-                     annotation (Placement(transformation(extent={{585,10},{545,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurBP(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{633,76},{621,86}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurBP(
-    p_rho=3, Cvmax=CvmaxValveVBP,
-    C2(P(start=509651.8053666252),
-                          h_vol(start=2682927.2097681486)),
-    h(start=2685000),
-    Cv(start=1),
-    Pm(start=498000))
-                 annotation (Placement(transformation(extent={{525,46},{505,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationBP(
-    Cvmax=285,
-    C1(h_vol(start=517521.1338868904)),
-    h(fixed=false, start=509000),
-    Cv(start=142.5),
-    Pm(fixed=false, start=1001940.4305634197))
-                 annotation (Placement(transformation(extent={{617,44},{597,64}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeBP(
-    z2=0,
-    z1=10.767,
-    Q(start=50, fixed=false),
-    K=32766,
-    mode=1,
-    pro(d(start=931.9744461081724)),
-    Pm(start=564000),
-    h(start=549249.519022482))
-            annotation (Placement(transformation(
-        origin={577,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=561432.682030064),
-                                                                       mode=1,
-    V=5,
-    P(start=564000))                       annotation (Placement(transformation(
-          extent={{559,-100},{539,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EvaporateurBP(
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
-      Tp(start={431.3608522222893,430.24126699702373,429.39686929842486}),
-      Tp1(start={430.9104943759602,429.93425668934924,429.1871126238492})),
-    L=20.726,
-    Ntubes=984,
-    Ns=3,
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=138e-3,
-      K(fixed=true, start=30.62),
-      CSailettes=11.07985,
-      p_rho=1.14,
-      Encras=Encras_EvBP,
-      St=5,
-      DeltaT(start={45,31,21}),
-      T(start={483.7066345214844,465.9440370193418,453.7982409323057,
-            445.483154296875}),
-      Tm(start={474.8253385845301,459.8711389758238,449.6406958379268}),
-      Tp(start={431.7792768702483,430.5265083466735,429.59175290805825})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={1.24e7,8.5e6,5.8e6}),
-      h(start={561432.6875,799363.0194709267,961560.8510406071,
-            1072378.2305328134,561432.6875}),
-      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
-      Q(start={49.81331881379377,49.81331881379377,49.81331881379377,
-            49.81331881379377}),
-      P(start={563167.375,538556.7569255093,537410.7752779912,536682.3739734262,
-            536006.6875})))
-                          annotation (Placement(transformation(
-        origin={533,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_ballonBP(k=1)
-    annotation (Placement(transformation(extent={{709,6},{695,18}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP(
-                          mode=1,
-    Cvmax=308.931,
-    C1(h_vol(start=561432.6820300646)),
-    h(start=550000),
-    Cv(start=308.931),
-    Pm(start=454319.5384961263))
-                 annotation (Placement(transformation(extent={{677,-14},{697,6}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    SurchauffeurBP(
-    Ns=3,
-    L=20.726,
-    Dint=39.3e-3,
-    Ntubes=123,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.1e6,-782901,-559798}),
-      Tp(start={477.52260500819597,502.61487297914,520.6394670364305}),
-      Tp1(start={477.2504107508904,502.4219869045609,520.5035062463255})),
-    Cws1(h_vol(start=2682927.2097681486)),
-    Cws2(h_vol(start=2919992.1127030067)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=222.1e-3,
-      K(fixed=true, start=30.46),
-      CSailettes=3.25763059984175,
-      p_rho=1.09,
-      Encras=Encras_SBP,
-      St=5,
-      DeltaT(start={92,66,47}),
-      T(start={569.0130004882813,567.4482541171128,566.3390581546068,
-            565.5570068359375}),
-      Tm(start={568.2306339861118,566.8936561358598,565.9480470570934}),
-      Tp(start={477.77840698873644,502.79614293098246,520.7672398988061})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      rugosrel=1e-5,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.1e6,782901,559798}),
-      h(start={2682927.25,2790287.093854774,2866365.945824299,
-            2919992.1127030067,2919992.0}),
-      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
-      P(start={509651.8125,507980.5977658856,506129.5447082628,
-            504067.5333025372,501850.0})))
-                          annotation (Placement(transformation(
-        origin={233,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5)
-    annotation (Placement(transformation(
-        origin={689,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    EconomiseurBP(
-    Ns=3,
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
-      Tp(start={402.39147626030376,398.05961040088295,397.171667377241}),
-      Tp1(start={402.1199525074059,397.9993065179613,397.15885396154556})),
-    Ntubes=3444,
-    L=20.726,
-    Cws1(h_vol(start=194669.37425632242)),
-    Cws2(h_vol(start=517521.1338868904)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=92e-3,
-      K(fixed=true, start=31.53),
-      CSailettes=11.673758598919,
-      p_rho=1.15,
-      Encras=Encras_EBP,
-      St=5,
-      DeltaT(start={23.5,5.3,1.1}),
-      T(start={445.483154296875,407.64728846356843,399.20963445670407,
-            397.4152526855469}),
-      Tm(start={426.56521960355815,403.42846146013625,398.31244500376624}),
-      Tp(start={402.64374727467464,398.11563835995787,397.18357224132967})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      inertia=true,
-      dW1(start={2.45e7,5.5e6,1.17e6}),
-      h(start={194669.375,449026.540992922,505517.82265620184,517521.1338868904,
-            517521.125}),
-      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
-      P(start={1578579.375,1542823.2506358635,1517636.5908885582,
-            1492724.792065889,1467874.25})))
-                          annotation (Placement(transformation(
-        origin={647,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineHP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.88057),
-    Qmax=140,
-    eta_is_nom=0.88057,
-    eta_is_min=0.75,
-    Cst(start=8182844.56002535)=
-        CstHP,
-    pros(d(start=10.66670150764929)),
-    Hrs(start=3046003.380872726),
-    Pe(fixed=true, start=12431000),
-    Ps(fixed=false, start=2726700))
-              annotation (Placement(transformation(extent={{-35,-250},{5,-210}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineMP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9625),
-    Qmax=150,
-    eta_is_nom=0.9625,
-    eta_is_min=0.75,
-    Cst(start=256335.364995961)=
-        CstMP,
-    pros(d(start=1.883484197675123)),
-    Hrs(start=3029367.6706168973),
-    Pe(fixed=true, start=2548500),
-    Ps(fixed=false, start=476800))
-                annotation (Placement(transformation(extent={{285,-250},{325,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC MelangeurPostTMP1(
-    h(start=3018320.043117248),
-    P(start=476799.99999954),
-    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
-        origin={385,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineBP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9538),
-    Qmax=150,
-    eta_is_nom=0.9538,
-    eta_is_min=0.75,
-    Cst(start=11944.9445735985)=
-        CstBP,
-    Cs(h(start=2401478.8015108025)),
-    Hrs(start=2401030),
-    Pe(fixed=true, start=476799.99999954),
-    Ps(start=10053))
-                annotation (Placement(transformation(extent={{543,-250},{583,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-325,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-265,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(
-                                                    alpha=0.5,
-    Ce(h(start=3046260)),
-    P(start=2726700))
-    annotation (Placement(transformation(extent={{81,-180},{101,-160}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenseur(
-    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    Vf0=0.15,
-    steady_state=false,
-    yNiveau(signal(start=1.5)),
-    Cse(h(start=128076)),
-    P(fixed=false, start=6136),
-    Pfond(start=10000.0),
-    Cl(h(start=191812.29519356362)),
-    proe(d(start=996.0227362797892)))
-    annotation (Placement(transformation(extent={{604,-384},{684,-304}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
-    h0=113.38e3, Q0=29804.5)     annotation (Placement(transformation(extent={{539,
-            -377},{587,-329}},     rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{703,-374},{747,-330}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK1(    K=1e-4,
-    h(start=2400000),
-    C1(h_vol(start=2400000), h(start=2400000)),
-    Pm(start=10026.138683139128))
-    annotation (Placement(transformation(extent={{607,-240},{627,-220}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
-    Ce3(h(start=194669.37425631672)),
-    h(start=194669.37425632242),
-    P(start=1540500))
-    annotation (Placement(transformation(
-        origin={869,-318},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeKCond1(    K=1e-4, mode=1,
-    pro(d(start=990.3699122081223)),
-    Pm(start=1540000))
-    annotation (Placement(transformation(
-        origin={869,-270},
-        extent={{12,-12},{-12,12}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
-    h(start=561432.6820300613),
-    P(start=322430))                       annotation (Placement(transformation(
-          extent={{709,-20},{729,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimMP(
-    a3=350,
-    b1(fixed=true) = -3.7751,
-    a1=-244551,
-    Q(fixed=false),
-    mode=1,
-    C1(h_vol(start=561432.6820300613)),
-    C2(h_vol(start=576430.3612424443)),
-    Qv(start=0.013433660889458656),
-    pro(d(start=931.2517020786314)),
-    Pm(start=1725850))
-            annotation (Placement(transformation(extent={{771,-20},{791,0}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimHP(
-    a3=1600,
-    a1=-28056.2,
-    b1=-12.7952660447433,
-    Q(fixed=false),
-    mode=1,
-    C1(h_vol(start=561432.6820300613)),
-    C2(h_vol(start=630040.8772883223)),
-    Qv(start=0.08167585768192882),
-    pro(d(start=929.0940034498418)),
-    Pm(start=6774000))
-             annotation (Placement(transformation(extent={{771,-60},{791,-40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
-                                                    alpha=0.5,
-    h(start=194585),
-    P(start=1540500),
-    Cs(h(start=194585)))
-    annotation (Placement(transformation(extent={{839,-328},{853,-308}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={235,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss PerteChargeZero2(
-    z2=0,
-    mode=0,
-    z1=0,
-    K=K_PerteChargeZero2,
-    h(start=3000000),
-    C1(
-      h_vol(start=3000000),
-      h(start=3000000),
-      P(fixed=true, start=501850)),
-    Pm(start=490000))
-            annotation (Placement(transformation(
-        origin={311,-278},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK3(    K=1e-4, mode=1,
-    Pm(start=372632.41194491077))
-    annotation (Placement(transformation(
-        origin={747,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK8(    K=1e-4, mode=1,
-    Pm(start=372632.41224549303))
-    annotation (Placement(transformation(
-        origin={747,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
-    annotation (Placement(transformation(extent={{369,-448},{489,-348}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK(
-                                                         K=1e-4, mode=1,
-    C1(h_vol(start=191812.29519356362)),
-    C2(h_vol(start=191812.29519356362)),
-    pro(d(start=989.8383588386666)),
-    Pm(start=6200))
-    annotation (Placement(transformation(extent={{669,-446},{689,-426}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimBP(
-    Qv(start=0.19861699733512259),
-    mode=1,
-    a3=400,
-    a1(fixed=true) = -6000,
-    Q(start=194.502, fixed=false),
-    C2(h_vol(start=194669.37425631672)),
-    Pm(start=802830.7060548771))
-            annotation (Placement(transformation(extent={{709,-446},{729,-426}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK2(
-                                                         K=1e-4, mode=1,
-    pro(d(start=990.3699122094005)),
-    C1(h_vol(start=194669.37425631672),
-                            h(start=194585)),
-    Pm(start=1546000))
-    annotation (Placement(transformation(extent={{807,-446},{827,-426}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_extraction(            mode=1, Cvmax=
-        2000,
-    h(start=194500),
-    Cv(start=2000),
-    Pm(start=1587120.4167526974))
-                 annotation (Placement(transformation(extent={{769,-440},{789,
-            -420}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol(start=2674000),
-        h(start=2674000)))
-    annotation (Placement(transformation(
-        origin={-91,8},
-        extent={{-6,6},{6,-6}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol(start=1398000),
-        h(start=1398000))) " "
-    annotation (Placement(transformation(
-        origin={58.5,32},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol(start=944000),
-        h(start=944000)))
-    annotation (Placement(transformation(extent={{391,49},{376,63}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol(start=2798000),
-        h(start=2798000)))
-    annotation (Placement(transformation(
-        origin={203,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol(start=2685000),
-        h(start=2685000)))
-    annotation (Placement(transformation(
-        origin={481,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol(start=550000),
-        h(start=550000)))
-    annotation (Placement(transformation(
-        origin={630.5,34},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol(
-          start=550000), h(start=550000)))
-    annotation (Placement(transformation(extent={{654,-11},{667,1}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol(
-          start=194585), h(start=194585)))
-    annotation (Placement(transformation(
-        origin={652.5,-412},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol(
-          start=2401000), h(start=2401000)))
-    annotation (Placement(transformation(
-        origin={651.5,-264},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipeK2(
-                                                          K=Kin_SMP2,
-    Pm(start=2651000),
-    C1(
-      P(fixed=true, start=2726700),
-      h_vol(start=3046000),
-      h(start=3046000)))
-    annotation (Placement(transformation(extent={{81,-120},{61,-100}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_entree_TurbineHP(
-    mode=0,
-    C1(P(fixed=true, start=12680999.9999969)),
-    Cvmax=Cvmax_THP,
-    h(fixed=false, start=3433000),
-    Cv(start=10875),
-    Pm(fixed=false, start=12550000))
-                 annotation (Placement(transformation(extent={{-157,-234},{-137,
-            -214}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauHP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{-191,113},{-157,131}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl
-    regulation_Niveau_HP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500,
-    minval=0.007)
-    annotation (Placement(transformation(extent={{-73,106},{-53,126}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauMP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{140,113},{174,131}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl
-    regulation_Niveau_MP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500)
-    annotation (Placement(transformation(extent={{229,106},{249,126}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauBP(                                                              k=1.75)
-    annotation (Placement(transformation(extent={{437,126},{471,144}}, rotation=
-           0)));
-  Control.Drum_LevelControl regulation_Niveau_BP(
-                     add(k1=-1, k2=+1), pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    Ti=10,
-    minval=0.006)
-    annotation (Placement(transformation(extent={{535,108},{555,128}}, rotation=
-           0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauCondenseur1(                                 k=1.5)
-    annotation (Placement(transformation(extent={{683,-246},{707,-230}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-                                                add(k1=+1, k2=-1),
-    edge(uL(signal(start=true))))
-                                 annotation (Placement(transformation(extent={{725,
-            -282},{745,-262}},     rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneTurbineHP(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-241,-216},{
-            -171,-142}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp(
-    Initialvalue=1400,
-    Duration=1000,
-    Starttime=4000,
-    Finalvalue=1000)
-                   annotation (Placement(transformation(extent={{911,-42},{873,
-            -10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP(
-    Initialvalue=1400,
-    Starttime=4000,
-    Duration=1000,
-    Finalvalue=700)
-                   annotation (Placement(transformation(extent={{912,-96},{874,
-            -64}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{912,-458},{874,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
-    mode=1,
-    V=1,
-    h0=988332,
-    h(start=860655.3510813401),
-    dynamic_mass_balance=true,
-    P0=7010000,
-    P(start=13149153.870557636))          annotation (Placement(transformation(
-          extent={{423,-98},{403,-78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
-    mode=1,
-    V=1,
-    h0=983786,
-    h(start=989834.8113335292),
-    dynamic_mass_balance=true,
-    P0=7000000,
-    P(start=13239005.657249678))          annotation (Placement(transformation(
-          extent={{219,-20},{199,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP1(
-                          mode=1,
-    Cvmax=308.931,
-    h(start=618600),
-    Cv(start=308.931),
-    Pm(start=13150193.68579806))
-                 annotation (Placement(transformation(extent={{721,-98},{697,
-            -122}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP2(
-                          mode=1,
-    Cvmax=308.931,
-    h(start=565000),
-    Cv(start=308.931),
-    Pm(start=3163391.8442005403))
-                 annotation (Placement(transformation(extent={{771,-138},{747,
-            -162}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(
-    Initialvalue=0.8,
-    Duration=1000,
-    Starttime=3000,
-    Finalvalue=0.005)
-                     annotation (Placement(transformation(extent={{913,-150},{
-            875,-118}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(
-    Initialvalue=0.8,
-    Duration=1000,
-    Starttime=3000,
-    Finalvalue=0.005)
-                     annotation (Placement(transformation(extent={{913,-194},{
-            875,-162}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
-    h0=3e6,
-    h(start=3432930.9918569606),
-    dynamic_mass_balance=true,
-    P0=12700000,
-    P(start=12700000))                annotation (Placement(transformation(
-        origin={-85,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC MelangeurPreTMP(
-    h0=3523910,
-    h(start=3517381.1285518324),
-    dynamic_mass_balance=true,
-    P0=2400000,
-    P(start=2400000))                     annotation (Placement(transformation(
-        origin={-83,-314},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_entree_TurbineMP(
-    mode=0,
-    C1(P(fixed=true, start=25.486e5)),
-    Cvmax=Cvmax_TMP,
-    h(fixed=false, start=3518000),
-    Cv(start=3.312e6),
-    Pm(fixed=false, start=2547000))
-                 annotation (Placement(transformation(extent={{-157,-318},{-137,
-            -298}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneTurbineMP(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-241,-300},{
-            -171,-226}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
-    annotation (Placement(transformation(extent={{-28,68},{-2,98}},
-                                                                  rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
-    annotation (Placement(transformation(extent={{293,68},{319,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
-    annotation (Placement(transformation(extent={{552,64},{578,94}}, rotation=0)));
-
-  FlueGases.BoundaryConditions.SourceQ SourceFumees(
-    Xco2=0.0613,
-    Xso2=0,
-    Xh2o=0.0706,
-    T0=893.75,
-    Xo2=0.1380,
-    Q0=606.94)
-    annotation (Placement(transformation(extent={{-473,-91},{-371,-7}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit(             Table=[0,606.94; 10,606.94; 600,
-        50; 650,50])
-                annotation (Placement(transformation(extent={{-527,-19},{-457,
-            55}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature(
-      Table=[0,893.75; 10,893.75; 600,423; 650,423])
-                   annotation (Placement(transformation(extent={{-527,-157},{
-            -457,-83}}, rotation=0)));
-equation
-  connect(SurchauffeurHP3.Cws1, SurchauffeurHP2.Cws2)
-    annotation (Line(points={{-327,-30},{-327,-10},{-207,-10},{-207,-30}},
-        color={255,0,0}));
-  connect(SurchauffeurHP2.Cws1, SurchauffeurHP1.Cws2)
-    annotation (Line(points={{-207,-70},{-207,-90},{-87,-90},{-87,-70}}, color=
-          {255,0,0}));
-  connect(constante_vanne_vapeurHP.y, vanne_vapeurHP.Ouv)
-    annotation (Line(points={{-61.5,74},{-65,74},{-65,67}}));
-  connect(vanne_vapeurHP.C1, BallonHP.Cv)
-    annotation (Line(points={{-55,50},{-35,50}},color={255,0,0}));
-  connect(GainChargeHP.C1, BallonHP.Cd)
-    annotation (Line(points={{5,-90},{15,-90},{15,10},{5,10}},   color={255,128,
-          0}));
-  connect(BallonHP.Cm, EvaporateurHP.Cws2)
-    annotation (Line(points={{-35,10},{-47,10},{-47,-30}}));
-  connect(VolumeEvapHP.Cs, EvaporateurHP.Cws1)
-    annotation (Line(points={{-45,-90},{-45,-70},{-47,-70}}, color={255,128,0}));
-  connect(VolumeEvapHP.Ce1, GainChargeHP.C2)
-                                      annotation (Line(points={{-25,-90},{-15,
-          -90}},
-        color={255,128,0}));
-  connect(EconomiseurHP4.Cws1, EconomiseurHP3.Cws2)
-    annotation (Line(points={{53,-70},{53,-82},{173,-82},{173,-70}}));
-  connect(BallonMP.Cm, EvaporateurMP.Cws2)
-    annotation (Line(points={{287,10},{273,10},{273,-30}}));
-  connect(EvaporateurMP.Cws1, VolumeEvapMP.Cs)
-    annotation (Line(points={{273,-70},{273,-80},{275,-80},{275,-90}}, color={
-          255,128,0}));
-  connect(VolumeEvapMP.Ce1, GainChargeMP.C2)
-    annotation (Line(points={{295,-90},{305,-90}}, color={255,128,0}));
-  connect(constante_vanne_vapeurMP.y, vanne_vapeurMP.Ouv)
-    annotation (Line(points={{258.4,75},{255,75},{255,67}}));
-  connect(SurchauffeurHP1.Cfg2, EvaporateurHP.Cfg1)        annotation (Line(
-      points={{-77,-50},{-57,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurHP.Cfg2, EconomiseurHP4.Cfg1)        annotation (Line(
-      points={{-37,-50},{63,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP4.Cfg2, SurchauffeurMP1.Cfg1)          annotation (Line(
-      points={{43,-50},{103,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP1.Cfg2, EconomiseurHP3.Cfg1)           annotation (Line(
-      points={{123,-50},{163,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurMP.Cfg2, EconomiseurHP2.Cfg1)           annotation (Line(
-      points={{283,-50},{363,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP2.Cfg2, EconomiseurMP.Cfg1)           annotation (Line(
-      points={{383,-50},{423,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurMP.Cfg2, EconomiseurHP1.Cfg1)           annotation (Line(
-      points={{443,-50},{483,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(GainChargeMP.C1, BallonMP.Cd)
-    annotation (Line(points={{325,-90},{335,-90},{335,10},{325,10}}, color={255,
-          128,0}));
-  connect(SurchauffeurMP2.Cfg2, SurchauffeurHP1.Cfg1)          annotation (Line(
-      points={{-137,-50},{-97,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP2.Cfg1, SurchauffeurHP2.Cfg2)           annotation (Line(
-      points={{-157,-50},{-197,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP3.Cfg2, SurchauffeurHP2.Cfg1)           annotation (Line(
-      points={{-257,-50},{-217,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurHP3.Cfg2, SurchauffeurMP3.Cfg1)           annotation (Line(
-      points={{-317,-50},{-277,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP3.Cws1,SurchauffeurMP2. Cws2)
-    annotation (Line(points={{-267,-30},{-267,10},{-147,10},{-147,-30}}, color=
-          {255,0,0}));
-  connect(SurchauffeurMP1.Cws2, MelangeurHPMP.Ce2) annotation (Line(
-      points={{113,-70},{113,-85},{115,-85},{115,-100}},
-      color={255,0,0},
-      pattern=LinePattern.None));
-  connect(vanne_vapeurBP.C1, BallonBP.Cv)
-    annotation (Line(points={{525,50},{545,50}}, color={255,0,0}));
-  connect(EvaporateurBP.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{533,-70},
-          {533,-90},{539,-90}},      color={255,128,0}));
-  connect(VolumeEvapBP.Ce1, GainChargeBP.C2)
-                                        annotation (Line(points={{559,-90},{567,
-          -90}}, color={255,128,0}));
-  connect(BallonBP.Cd, GainChargeBP.C1)
-                                       annotation (Line(points={{585,10},{595,
-          10},{595,-90},{587,-90}}, color={255,128,0}));
-  connect(EconomiseurBP.Cfg2, PuitsFumees.C)     annotation (Line(
-      points={{657,-50},{679.2,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP3.Cfg2, SurchauffeurBP.Cfg1)  annotation (Line(
-      points={{183,-50},{223,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurBP.Cfg2, EvaporateurMP.Cfg1)  annotation (Line(
-      points={{243,-50},{263,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP1.Cfg2, EvaporateurBP.Cfg1) annotation (Line(
-      points={{503,-50},{523,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurBP.Cfg2, EconomiseurBP.Cfg1) annotation (Line(
-      points={{543,-50},{637,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(BallonBP.Cm, EvaporateurBP.Cws2)
-    annotation (Line(points={{545,10},{533,10},{533,-30}}));
-  connect(vanne_vapeurMP.C1, BallonMP.Cv)   annotation (Line(points={{265,50},{
-          287,50}}, color={255,0,0}));
-  connect(Vanne_alimentationMPHP.Ouv, constante_ballonBP.y)
-    annotation (Line(points={{687,7},{687,12},{694.3,12}}));
-  connect(SurchauffeurHP3.Cws2, DoubleDebitHP.Ce)
-    annotation (Line(points={{-327,-70},{-327,-80},{-325,-80},{-325,-90}},
-        color={255,0,0}));
-  connect(SurchauffeurMP3.Cws2, DoubleDebitMP.Ce)
-    annotation (Line(points={{-267,-70},{-267,-80},{-265,-80},{-265,-90}},
-        color={255,0,0}));
-  connect(VolumeCond1.Cs, perteChargeKCond1.C1) annotation (Line(points={{869,
-          -308},{869,-282}}, color={0,0,255}));
-  connect(Vanne_alimentationMPHP.C2, VolumeAlimMPHP.Ce1)
-                                               annotation (Line(points={{697,-10},
-          {709,-10}},      color={0,0,255}));
-  connect(SurchauffeurBP.Cws2, DoubleDebitBP.Ce)
-    annotation (Line(points={{233,-70},{233,-80},{235,-80},{235,-90}}, color={
-          255,0,0}));
-  connect(perteChargeK8.C2, PompeAlimMP.C1)
-    annotation (Line(points={{757,-10},{764,-10},{771,-10}},           color={0,
-          0,255}));
-  connect(VolumeAlimMPHP.Cs1, perteChargeK8.C1)
-    annotation (Line(points={{729,-10},{733,-10},{737,-10}},           color={0,
-          0,255}));
-  connect(VolumeAlimMPHP.Cs2, perteChargeK3.C1)
-                                         annotation (Line(points={{719,-20},{
-          719,-50},{737,-50}}, color={0,0,255}));
-  connect(perteChargeK3.C2, PompeAlimHP.C1)
-    annotation (Line(points={{757,-50},{771,-50}}, color={0,0,255}));
-  connect(MelangeurPostTMP1.Ce2, PerteChargeZero2.C2) annotation (Line(points={{385,
-          -239},{385,-278},{321,-278}},      color={255,0,0}));
-  connect(perteChargeK.C2,PompeAlimBP. C1)
-                                         annotation (Line(points={{689,-436},{
-          709,-436}}, color={0,0,255}));
-  connect(vanne_extraction.C2, perteChargeK2.C1) annotation (Line(points={{789,
-          -436},{807,-436}}, color={0,0,255}));
-  connect(vanne_alimentationHP.C1, CapteurDebitEauHP.C2)
-    annotation (Line(points={{45,50},{53.3,50},{53.3,38.12}}));
-  connect(vanne_vapeurHP.C2, CapteurDebitVapHP.C1) annotation (Line(points={{-75,50},
-          {-86.2,50},{-86.2,14}},         color={255,0,0}));
-  connect(CapteurDebitVapHP.C2, SurchauffeurHP1.Cws1) annotation (Line(points={{-86.2,
-          1.88},{-86.2,-3.06},{-87,-3.06},{-87,-30}},        color={255,0,0}));
-  connect(vanne_alimentationMP.C1, CapteurDebitEauMP.C2)
-    annotation (Line(points={{365,50},{370.425,50},{370.425,50.4},{375.85,50.4}}));
-  connect(CapteurDebitVapMP.C1, vanne_vapeurMP.C2) annotation (Line(points={{211,
-          49.6},{227,49.6},{227,50},{245,50}},     color={255,0,0}));
-  connect(CapteurDebitVapMP.C2, SurchauffeurMP1.Cws1) annotation (Line(points={{194.84,
-          49.6},{113,49.6},{113,-30}},         color={255,0,0}));
-  connect(CapteurDebitVapBP.C2, SurchauffeurBP.Cws1) annotation (Line(points={{472.84,
-          49.6},{457,49.6},{457,-2},{233,-2},{233,-30}},        color={255,0,0}));
-  connect(CapteurDebitVapBP.C1, vanne_vapeurBP.C2) annotation (Line(points={{489,
-          49.6},{497,49.6},{497,50},{505,50}},     color={255,0,0}));
-  connect(CapteurDebitEauBP.C2, vanne_alimentationBP.C1) annotation (Line(
-        points={{625.3,40.12},{625.3,48},{617,48}}, color={0,0,255}));
-  connect(CapteurDebitEauBPsortie.C2, Vanne_alimentationMPHP.C1) annotation (Line(
-        points={{667.13,-9.8},{672.065,-9.8},{672.065,-10},{677,-10}}, color={0,
-          0,255}));
-  connect(CapteurDebitEauCondenseur.C2, perteChargeK.C1) annotation (Line(
-        points={{647.3,-422.2},{647.3,-436},{669,-436}}, color={0,0,255}));
-  connect(perteChargeK1.C2, CapteurDebitVapCondenseur.C1) annotation (Line(
-        points={{627,-230},{646.3,-230},{646.3,-254}}, color={255,0,0}));
-  connect(MelangeurHPMP.Ce1, MoitieDebitHP.Cs)
-    annotation (Line(points={{115,-120},{115,-170},{101,-170}}, color={255,0,0}));
-  connect(perteChargeK2.C2, MoitieDebitBP.Ce) annotation (Line(points={{827,
-          -436},{829,-436},{829,-318},{839,-318}}, color={0,0,255}));
-  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{853,-318},
-          {859,-318}}, color={0,0,255}));
-  connect(SurchauffeurMP2.Cws1, lumpedStraightPipeK2.C2)
-    annotation (Line(points={{-147,-70},{-147,-110},{61,-110}}, color={255,0,0}));
-  connect(lumpedStraightPipeK2.C1, MelangeurHPMP.Cs2)
-    annotation (Line(points={{81,-110},{105.2,-110}},  color={255,0,0}));
-  connect(DoubleDebitHP.Cs, vanne_entree_TurbineHP.C1) annotation (Line(points={{-325,
-          -110},{-325,-230},{-157,-230}},        color={255,0,0}));
-  connect(DoubleDebitBP.Cs, PerteChargeZero2.C1) annotation (Line(points={{235,
-          -110},{235,-278},{301,-278}}, color={255,0,0}));
-  connect(PompeAlimBP.C2, vanne_extraction.C1) annotation (Line(points={{729,
-          -436},{769,-436}}, color={0,0,255}));
-  connect(BallonHP.yLevel,regulation_Niveau_HP. MesureNiveauEau)
-    annotation (Line(points={{-37,30},{-101,30},{-101,125},{-73.5,125}}));
-  connect(regulation_Niveau_HP.SortieReelle1, vanne_alimentationHP.Ouv)
-    annotation (Line(points={{-52.5,107},{35,107},{35,67}}));
-  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
-    annotation (Line(points={{175.7,122},{201,122},{201,110},{228.5,110}}));
-  connect(BallonMP.yLevel,regulation_Niveau_MP. MesureNiveauEau)
-    annotation (Line(points={{285.1,30},{219,30},{219,125},{228.5,125}}));
-  connect(regulation_Niveau_MP.SortieReelle1, vanne_alimentationMP.Ouv)
-    annotation (Line(points={{249.5,107},{344.25,107},{344.25,67},{355,67}}));
-  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
-    annotation (Line(points={{472.7,135},{496.85,135},{496.85,112},{534.5,112}}));
-  connect(BallonBP.yLevel,regulation_Niveau_BP. MesureNiveauEau)
-    annotation (Line(points={{543,30},{485,30},{485,127},{534.5,127}}));
-  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
-    annotation (Line(points={{708.2,-238},{719,-238},{719,-269},{724.5,-269}}));
-  connect(regulation_Niveau_Condenseur.SortieReelle1, vanne_extraction.Ouv)
-    annotation (Line(points={{745.5,-281},{779,-281},{779,-419}}));
-  connect(CapteurDebitEauBP.C1, EconomiseurBP.Cws2)
-    annotation (Line(points={{625.3,28},{627,28},{627,6},{647,6},{647,-30}}));
-  connect(EconomiseurBP.Cws1, perteChargeKCond1.C2) annotation (Line(points={{647,-70},
-          {647,-186},{869,-186},{869,-258}}));
-  connect(CapteurDebitVapCondenseur.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
-    annotation (Line(points={{658.13,-264},{671,-264},{671,-280.9},{724.6,
-          -280.9}}));
-  connect(regulation_Niveau_Condenseur.MesureDebitEau,
-    CapteurDebitEauCondenseur.Measure) annotation (Line(points={{724.45,-274.95},
-          {717,-274.95},{717,-310},{759,-310},{759,-412},{659.13,-412}}));
-  connect(ConstantVanneTurbineHP.y, vanne_entree_TurbineHP.Ouv)
-    annotation (Line(points={{-167.5,-179},{-147,-179},{-147,-213}}));
-  connect(regulation_Niveau_BP.SortieReelle1, vanne_vapeurBP.Ouv)
-    annotation (Line(points={{555.5,109},{567,109},{567,90},{515,90},{515,67}}));
-  connect(vanne_alimentationBP.Ouv, constante_vanne_vapeurBP.y)
-    annotation (Line(points={{607,65},{607,81},{620.4,81}}));
-  connect(EconomiseurHP1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{493,-70},
-          {493,-88},{423,-88}},          color={0,0,255}));
-  connect(VolumeECO_HP1_2.Cs, EconomiseurHP2.Cws1) annotation (Line(points={{403,-88},
-          {373,-88},{373,-70}},          color={0,0,255}));
-  connect(EconomiseurHP2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{373,-30},
-          {373,-10},{219,-10}},          color={0,0,255}));
-  connect(VolumeECO_HP2_3.Cs, EconomiseurHP3.Cws1) annotation (Line(points={{199,-10},
-          {173,-10},{173,-30}},          color={0,0,255}));
-  connect(Vanne_alimentationMPHP1.C1, PompeAlimHP.C2)
-    annotation (Line(points={{721,-102.8},{809,-102.8},{809,-50},{791,-50}}));
-  connect(PompeAlimMP.C2, Vanne_alimentationMPHP2.C1) annotation (Line(points={{791,-10},
-          {837,-10},{837,-142.8},{771,-142.8}},           color={0,0,255}));
-  connect(arretPomesMp1.y, Vanne_alimentationMPHP1.Ouv)
-    annotation (Line(points={{873.1,-134},{823,-134},{823,-122},{709,-122},{709,
-          -123.2}}));
-  connect(arretPomesHP1.y, Vanne_alimentationMPHP2.Ouv)
-    annotation (Line(points={{873.1,-178},{850.05,-178},{850.05,-163.2},{759,
-          -163.2}}));
-  connect(Vanne_alimentationMPHP1.C2, EconomiseurHP1.Cws1) annotation (Line(
-        points={{697,-102.8},{603,-102.8},{603,-106},{515,-106},{515,-6},{493,
-          -6},{493,-30}}, color={0,0,255}));
-  connect(EconomiseurMP.Cws1, Vanne_alimentationMPHP2.C2)
-    annotation (Line(points={{433,-70},{433,-142.8},{747,-142.8}}));
-  connect(ConstantVanneTurbineMP.y, vanne_entree_TurbineMP.Ouv)
-    annotation (Line(points={{-167.5,-263},{-147,-263},{-147,-297}}));
-  connect(vanne_entree_TurbineHP.C2, VolumePreTHP.Ce) annotation (Line(points={{-137,
-          -230},{-95,-230}},       color={255,0,0}));
-  connect(DoubleDebitMP.Cs, vanne_entree_TurbineMP.C1) annotation (Line(points={{-265,
-          -110},{-265,-314},{-157,-314}},        color={255,0,0}));
-  connect(vanne_entree_TurbineMP.C2, MelangeurPreTMP.Ce1) annotation (Line(
-        points={{-137,-314},{-93,-314}}, color={255,0,0}));
-  connect(SourceCaloporteur.C, Condenseur.Cee) annotation (Line(points={{587,
-          -353},{605,-353},{605,-352.8},{604,-352.8}},
-                                                     color={0,0,255}));
-  connect(Condenseur.Cse, PuitsCaloporteur.C) annotation (Line(points={{684,
-          -352},{703,-352}}, color={0,0,255}));
-  connect(CapteurDebitVapCondenseur.C2, Condenseur.Cv) annotation (Line(points={{646.3,
-          -274.2},{646.3,-288.1},{644,-288.1},{644,-304}},         color={0,0,
-          255}));
-  connect(CapteurDebitEauCondenseur.C1, Condenseur.Cl)
-    annotation (Line(points={{647.3,-402},{644.8,-402},{644.8,-384}}));
-  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
-    annotation (Line(points={{-155.3,122},{-133,122},{-133,110},{-73.5,110}}));
-  connect(Condenseur.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
-    annotation (Line(points={{688,-372.8},{747,-372.8},{747,-326},{699,-326},{
-          699,-263},{724.5,-263}}));
-  connect(BallonBP.Cs, CapteurDebitEauBPsortie.C1) annotation (Line(points={{545,22},
-          {531,22},{531,16},{609,16},{609,-9.8},{654,-9.8}},         color={0,0,
-          255}));
-  connect(BallonBP.Ce1, vanne_alimentationBP.C2)
-    annotation (Line(points={{585,50},{591,50},{591,48},{597,48}}));
-  connect(BallonMP.Ce1, vanne_alimentationMP.C2)
-    annotation (Line(points={{325,50},{345,50}}));
-  connect(BallonHP.Ce1, vanne_alimentationHP.C2)
-    annotation (Line(points={{5,50},{25,50}}));
-  connect(TurbineHP.Cs, MoitieDebitHP.Ce) annotation (Line(points={{5.2,-230},{
-          41,-230},{41,-170},{81,-170}},   color={255,0,0}));
-  connect(VolumePreTHP.Cs3, TurbineHP.Ce) annotation (Line(points={{-75,-230},{
-          -35.2,-230}},color={255,0,0}));
-  connect(MelangeurPreTMP.Cs, TurbineMP.Ce) annotation (Line(points={{-73,-314},
-          {73,-314},{73,-230},{284.8,-230}},   color={255,0,0}));
-  connect(TurbineMP.Cs, MelangeurPostTMP1.Ce1) annotation (Line(points={{325.2,
-          -230},{375,-230}}, color={255,0,0}));
-  connect(MelangeurPostTMP1.Cs, TurbineBP.Ce) annotation (Line(points={{395,
-          -230},{542.8,-230}}, color={255,0,0}));
-  connect(TurbineBP.Cs, perteChargeK1.C1) annotation (Line(points={{583.2,-230},
-          {607,-230}}, color={255,0,0}));
-  connect(EconomiseurMP.Cws2, CapteurDebitEauMP.C1) annotation (Line(points={{433,-30},
-          {437,-30},{437,50.4},{391,50.4}},          color={0,0,255}));
-  connect(TurbineMP.MechPower, Alternateur.Wmec2)
-    annotation (Line(points={{327,-248},{335,-248},{335,-378},{369,-378}}));
-  connect(TurbineBP.MechPower, Alternateur.Wmec1) annotation (Line(points={{585,
-          -248},{595,-248},{595,-290},{355,-290},{355,-358},{369,-358}}));
-  connect(TurbineHP.MechPower, Alternateur.Wmec3)
-    annotation (Line(points={{7,-248},{15,-248},{15,-398},{369,-398}}));
-  connect(heatSource.C[1], BallonHP.Cex) annotation (Line(points={{-15,68.3},{
-          -15,50}},
-                color={191,95,0}));
-  connect(heatSource1.C[1], BallonMP.Cex) annotation (Line(points={{306,68.3},{
-          306,50}}, color={191,95,0}));
-  connect(heatSource2.C[1], BallonBP.Cex) annotation (Line(points={{565,64.3},{
-          565,50}}, color={191,95,0}));
-  connect(CapteurDebitEauHP.C1, EconomiseurHP4.Cws2)
-    annotation (Line(points={{53.3,26},{53,26},{53,-30}}, smooth=Smooth.None));
-  connect(PompeAlimMP.rpm_or_mpower, arretPomesMp.y)
-    annotation (Line(points={{781,-21},{781,-26},{871.1,-26}}, smooth=Smooth.None));
-  connect(PompeAlimHP.rpm_or_mpower, arretPomesHP.y)
-    annotation (Line(points={{781,-61},{781,-80},{872.1,-80}}, smooth=Smooth.None));
-  connect(PompeAlimBP.rpm_or_mpower, arretPomesBP.y) annotation (Line(points={{719,
-          -447},{721,-447},{721,-460},{845,-460},{845,-442},{872.1,-442}},
-        smooth=Smooth.None));
-  connect(SourceFumees.C, SurchauffeurHP3.Cfg1) annotation (Line(
-      points={{-371,-49},{-371,-50},{-337,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(Temperature.y,SourceFumees. ITemperature)
-    annotation (Line(points={{-453.5,-120},{-422,-120},{-422,-70}}));
-  connect(Debit.y,SourceFumees. IMassFlow)
-    annotation (Line(points={{-453.5,18},{-422,18},{-422,-28}}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-560,-460},
-            {950,150}},
-        initialScale=0.1),     graphics),
-    experiment(StopTime=10000, Tolerance=0.001),
-    experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end CombinedCycle_TripTAC;
+within ThermoSysPro.Examples.CombinedCyclePowerPlant;
+model CombinedCycle_TripTAC
+  "CCPP model to simulate a load variation from 100% to 50%"
+  parameter Real CstHP(fixed=false,start=7921079.316566086)
+    "Stodola's ellipse coefficient HP";
+  parameter Real CstMP(fixed=false,start=251309.80339850043)
+    "Stodola's ellipse coefficient MP";
+  parameter Real CstBP(fixed=false,start=10675.291494903773)
+    "Stodola's ellipse coefficient BP";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
+    "Maximum CV: alim. valve HP Drum  ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
+    "Maximum CV: steam valve BP Drum ";
+  parameter Real Encras_SHP1(fixed=false,start=1)
+    "Sur HP1: heat exchange fouling coefficient";
+  parameter Real Encras_SHP2(fixed=false,start=1)
+    "Sur HP2: heat exchange fouling coefficient";
+  parameter Real Encras_SHP3(fixed=false,start=1)
+    "Sur HP3: heat exchange fouling coefficient";
+  parameter Real Encras_EHP1(fixed=false,start=1)
+    "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Encras_EHP2(fixed=false,start=1)
+    "Eco HP2: heat exchange fouling coefficient";
+  parameter Real Encras_EHP3(fixed=false,start=1)
+    "Eco HP3: heat exchange fouling coefficient";
+  parameter Real Encras_EHP4(fixed=false,start=1)
+    "Eco HP4: heat exchange fouling coefficient";
+
+  parameter Real Encras_SMP1(fixed=false,start=1)
+    "Sur MP1: heat exchange fouling coefficient";
+  parameter Real Encras_SMP2(fixed=false,start=1)
+    "Sur MP2: heat exchange fouling coefficient";
+  parameter Real Encras_SMP3(fixed=false,start=1)
+    "Sur MP3: heat exchange fouling coefficient";
+  parameter Real Encras_EMP(fixed=false,start=1)
+    "Eco MP: heat exchange fouling coefficient";
+
+  parameter Real Encras_EvHP(fixed=false,start=1)
+    "Evapo HP: heat exchange fouling coefficient";
+  parameter Real Encras_EvMP(fixed=false,start=1)
+    "Evapo MP: heat exchange fouling coefficient";
+  parameter Real Encras_EvBP(fixed=false,start=1)
+    "Evapo BP: heat exchange fouling coefficient";
+
+  parameter Real Encras_SBP(fixed=false,start=1)
+    "Sur BP: heat exchange fouling coefficient";
+  parameter Real Encras_EBP(fixed=false,start=1)
+    "Eco BP: heat exchange fouling coefficient";
+
+  parameter Real KgainChargeHP(fixed=false,start=720.183)
+    "HP: Friction pressure loss coefficient";
+  parameter Real KgainChargeMP(fixed=false,start=1090.9)
+    "MP: Friction pressure loss coefficient";
+  parameter Real Kin_SMP2(fixed=false,start=10.)
+    "SMPin: Friction pressure loss coefficient";
+  parameter Real K_PerteChargeZero2(fixed=false,start=1e-4)
+    "TurbineMP out: Friction pressure loss coefficient";
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
+    "Maximum CV input Turbine HP ";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
+    "Maximum CV input Turbine MP ";
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonHP(
+    L=16.27,
+    Vertical=false,
+    hl(fixed=false, start=1460508.128907675),
+    hv(fixed=false, start=2664791.3052738607),
+    Vv(fixed=false),
+    R=1.05,
+    xmv(fixed=false),
+    zl(start=1.05, fixed=true),
+    Mp=5000,
+    Kpa=5,
+    Kvl=1000,
+    P(fixed=false, start=12726424.235625941),
+    Pfond(start=12733333.038455429),
+    Tp(start=589.5151351323206))
+                     annotation (Placement(transformation(extent={{5,10},{-35,
+            50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationHP(
+      Cvmax=CvmaxValveAHP,
+    C1(P(start=13394232.807871036),
+                            h_vol(start=1399087.0448386343)),
+    h(start=1398000),
+    Cv(start=178),
+    Pm(start=13050700))
+                 annotation (Placement(transformation(extent={{45,46},{25,66}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurHP(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{-51,70},{-61,78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurHP(
+    Cvmax=47829.4,
+    mode=0,
+    C2(h_vol(start=2664791.3052738607)),
+    h(start=2674000),
+    Cv(start=23914.7),
+    Pm(start=12724920.902023433))
+                 annotation (Placement(transformation(extent={{-55,46},{-75,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeHP(
+    z2=0,
+    mode=1,
+    Q(start=150, fixed=true),
+    z1=10.83,
+    K=KgainChargeHP,
+    C2(P(start=12757776.366696326)),
+    h(start=1474422.14552527),
+    Pm(start=12704000))
+            annotation (Placement(transformation(
+        origin={-5,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,
+    h(start=1460508.128907675),
+    P(start=12704000))                     annotation (Placement(transformation(
+          extent={{-25,-100},{-45,-80}},
+                                       rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EvaporateurHP(
+    Dint=32.8e-3,
+    Ntubes=1476,
+    L=20.7,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
+      Tp(start={607.95945081921,605.4313602675011,604.0450760348469}),
+      Tp1(start={606.5065615724875,604.7563153894058,603.7327223072098})),
+    Ns=3,
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.092,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      K(fixed=true, start=37.69),
+      CSailettes=11.86442072,
+      p_rho=1.05,
+      Encras=Encras_EvHP,
+      DeltaT(start={106,49,23}),
+      T(start={755.2099609375,674.1281000784297,635.8939469832528,
+            618.0787353515625}),
+      Tm(start={714.669037024263,655.0110235308413,626.9863546635906}),
+      Tp(start={609.3093210980612,606.0585402262541,604.3352819224443})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=10.83,
+      option_temperature=2,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={5.74e7,2.67e7,1.24e7}),
+      h(start={1460508.125,1842386.3805685563,2019815.5675635953,
+            2101914.802366878,1460508.125}),
+      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
+      P(start={12757776.0,12739926.315661393,12734300.718607338,
+            12730145.067304946,12726424.0})))
+                          annotation (Placement(transformation(
+        origin={-47,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurHP4(
+    Ns=3,
+    L=20.726,
+    Dint=0.0266,
+    Ntubes=246,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-3.5e6,-2.63e6,-2e6}),
+      Tp(start={577.1652678885227,582.2393934514894,585.9616914189281}),
+      Tp1(start={576.5195841307088,581.753378536046,585.5943808718256})),
+    Cws1(P(start=13320777.811415095),
+                              h_vol(start=1292777.0058783418)),
+    Cws2(h_vol(start=1399087.0448386343)),
+    ExchangerFlueGasesMetal(
+      Dext=0.0318,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.39069779,
+      K(fixed=true, start=47.53),
+      p_rho=1.06,
+      Encras=Encras_EHP4,
+      DeltaT(start={38,29,22}),
+      T(start={618.0787353515625,613.037602447671,609.2389186305828,
+            606.3656616210938}),
+      Tm(start={615.5581823957998,611.1382605391269,607.8022941316214}),
+      Tp(start={577.7558398657263,582.6839249827347,586.2976504908789})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      z2=0,
+      option_temperature=2,
+      inertia=true,
+      dW1(start={3.5e6,2.63e6,2e6}),
+      h(start={1292777.0,1338569.0293807227,1373037.3060893763,
+            1399087.0448386343,1399087.0}),
+      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
+      P(start={13320778.0,13339750.403131645,13358253.29250947,
+            13376387.23615858,13394233.0})))
+                          annotation (Placement(transformation(
+        origin={53,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=270)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurHP1(
+    Ns=3,
+    L=20.4,
+    Dint=0.0324,
+    Ntubes=246,
+    ExchangerWall(e=0.0028, lambda=37.61,
+    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
+      Tp(start={641.7766266045941,659.2542181292313,674.5323393956571}),
+      Tp1(start={639.7295258289556,657.6427819154001,673.2854985024741})),
+    Cws1(h_vol(start=2664791.3052738607)),
+    Cws2(P(start=12720084.224503415),
+                              h_vol(start=2973079.185217006)),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=10.25056,
+      K(fixed=true, start=34.71),
+      p_rho=1.04,
+      Encras=Encras_SHP1,
+      DeltaT(start={138,108,84}),
+      T(start={787.8693237304688,774.2709985521502,763.5355376271307,
+            755.2099609375}),
+      Tm(start={781.0701669240514,768.9032680896405,759.3727557986135}),
+      Tp(start={643.6669592742874,660.7422496694279,675.683696525852})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      option_temperature=2,
+      inertia=true,
+      dW1(start={9.8e6,7.7e6,5.9e6}),
+      h(start={2664791.25,2793445.279188231,2894719.078252342,2973079.185217006,
+            2973079.25}),
+      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
+      P(start={12723418.0,12723372.064267773,12722706.076957166,
+            12721569.805902744,12720084.0})))
+                          annotation (Placement(transformation(
+        origin={-87,-50},
+        extent={{-20,20},{20,-20}},
+        rotation=270)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurHP3(
+    Dint=26.6e-3,
+    Ntubes=1476,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
+      Tp(start={557.1357570088924,563.7223638401374,566.037182893163}),
+      Tp1(start={556.657781456147,563.5505466405001,565.9750435970707})),
+    L=20.726,
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=12.451,
+      K(fixed=true, start=36.0300000000857),
+      p_rho=1.08,
+      Encras=Encras_EHP3,
+      St=5, DeltaT(start={34,12,4.4}),
+      T(start={602.606689453125,580.0827929934445,571.956039969206,
+            569.0130004882813}),
+      Tm(start={591.3447334381658,576.0194164813253,570.4845269121585}),
+      Tp(start={557.5729353703138,563.879515730797,566.0940183432008})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.6e7,5.6e6,2.1e6}),
+      h(start={989834.8125,1193223.55215195,1266335.416732016,
+            1292777.0058783418,1292777.0}),
+      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
+      P(start={13239006.0,13261089.90163249,13281516.713631846,
+            13301273.845180616,13320778.0})))
+                  annotation (Placement(transformation(
+        origin={173,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurHP2(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-5e6,-3e6,-2.e6}),
+      Tp(start={492.5265031447411,499.7298617398276,504.2372403374727}),
+      Tp1(start={492.3269425182926,499.6044056390882,504.15828372038055})),
+    L=20.767,
+    Ntubes=1107,
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=111e-3,
+      CSailettes=2.76134577,
+      K(fixed=true, start=65.5300000000393),
+      p_rho=1.11,
+      Encras=Encras_EHP2,
+      St=5, DeltaT(start={36,23,14}),
+      T(start={531.2528686523438,524.0786479337396,519.5624877991071,
+            516.7178344726563}),
+      Tm(start={527.6657680129605,521.8205678664233,518.1401706426662}),
+      Tp(start={492.70903044592376,499.8446096432236,504.3094576805689})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={5e6,3e6,2.e6}),
+      h(start={860655.375,924469.2991480937,964586.6772085332,989834.8113335292,
+            989834.8125}),
+      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
+      P(start={13149154.0,13172140.227906534,13194684.103908138,
+            13216938.318123804,13239006.0})))
+                  annotation (Placement(transformation(
+        origin={373,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurHP1(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-9.9999e6,-5e6,-2.4e6}),
+      Tp(start={461.83700038875077,471.4458881656956,476.1007075853514}),
+      Tp1(start={461.41562496249884,471.24253667400546,476.002824325766})),
+    L=20.726,
+    Ntubes=1107,
+    Cws1(h_vol(start=630040.8772883223)),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=8.30057632,
+      K(fixed=true, start=40.24),
+      p_rho=1.13,
+      Encras=Encras_EHP1,
+      St=5,   DeltaT(start={41,20,10}),
+      T(start={509.81195068359375,494.60709242744036,487.25141439639447,
+            483.7066345214844}),
+      Tm(start={502.2095163065458,490.92925341191744,485.4790272730564}),
+      Tp(start={462.22240967868714,471.63188276609173,476.1902361036878})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.767,
+      inertia=true,
+      dW1(start={9.9999e6,5e6,2.4e6}),
+      h(start={630040.875,764519.0167009356,829416.7979796123,860655.3510811749,
+            860655.375}),
+      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
+      advection=true,
+      dynamic_mass_balance=true,
+      P(start={13054959.0,13079363.233486831,13102973.863543343,
+            13126167.933420062,13149154.0})))
+                  annotation (Placement(transformation(
+        origin={493,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurHP2(
+    Ns=3,
+    L=20.4,
+    Dint=32e-3,
+    Ntubes=246,
+    ExchangerWall(e=3e-3, lambda=27,
+          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
+      Tp(start={718.0595138013858,738.8988421059552,755.1216906441867}),
+      Tp1(start={715.284148781996,736.8146275114044,753.568899547355})),
+    Cws2(P(start=12710803.048741188),
+                               h_vol(start=3240679.101987554)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      K(fixed=true, start=34.74),
+      CSailettes=10.2505424803872,
+      p_rho=1.02,
+      Encras=Encras_SHP2,
+      St=5,
+      DeltaT(start={124,93,70}),
+      T(start={850.2295532226563,838.165359685431,829.0838172755421,
+            822.3056030273438}),
+      Tm(start={844.1974477839519,833.6245884804865,825.6946997760892}),
+      Tp(start={720.6064978764006,740.8115495674804,756.5467047118})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.83,
+      inertia=true,
+      dW1(start={8.8e6,6.6e6,4.9e6}),
+      h(start={2973079.25,3088900.225778996,3175878.2994419048,
+            3240679.101987554,3240679.0}),
+      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
+      P(start={12720084.0,12718408.787041187,12716215.067117244,
+            12713645.694467228,12710803.0})))
+                  annotation (Placement(transformation(
+        origin={-207,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurHP3(
+    Ns=3,
+    L=20.4,
+    Ntubes=246,
+    ExchangerWall(lambda=27, e=5e-3,
+    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
+      Tp(start={789.2881838358564,806.7088039780044,819.9912755140301}),
+      Tp1(start={785.6370057524725,803.9662515359148,817.9384055160485})),
+    Dint=28e-3,
+    Cws2(h_vol(start=3432930.991856911)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      K(fixed=true, start=49.33),
+      CSailettes=6.59672842597229,
+      p_rho=1,
+      Encras=Encras_SHP3,
+      St=5,
+      DeltaT(start={97,73,55}),
+      T(start={893.75,885.1796729176981,878.7316754228791,873.8992309570313}),
+      Tm(start={889.464836458849,881.9556741702886,876.315464574507}),
+      Tp(start={792.4232630808997,809.0636930146954,821.7539696298131})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.726,
+      inertia=true,
+      dW1(start={6.3e6,4.7e6,3.6e6}),
+      h(start={3240679.0,3323783.054261407,3386205.9057494565,3432930.991856911,
+            3432931.0}),
+      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
+      P(start={12710803.0,12704112.803652512,12696819.484746953,
+            12689077.136342296,12681000.0})))
+                  annotation (Placement(transformation(
+        origin={-327,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonMP(
+    L=16.27,
+    Vertical=false,
+    P0=27.29e5,
+    hl(fixed=false, start=980960.1562978515),
+    hv(fixed=false, start=2798761.3254371085),
+    Vv(fixed=false),
+    R=1.05,
+    P(fixed=false, start=2733918.2848144253),
+    zl(start=1.05, fixed=true),
+    Kpa=5,
+    Mp=5000,
+    Kvl=1000,
+    Pfond(start=2742462.980913138),
+    Tp(start=497.4249792990277))
+                     annotation (Placement(transformation(extent={{325,10},{287,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurMP(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{271,70},{259,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationMP(
+      Cvmax=CvmaxValveAMP,
+    C1(P(start=3253417.522956237),
+                           h_vol(start=947830.5281155076)),
+    h(start=944000),
+    Cv(start=28),
+    Pm(start=2975000))
+                 annotation (Placement(transformation(extent={{365,46},{345,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurMP(
+    Cvmax=47829.4,
+    mode=0,
+    C2(h_vol(start=2798761.3254371085)),
+    h(fixed=false, start=2798000),
+    Cv(start=23914.7),
+    Pm(fixed=false, start=2732653.9482791456))
+                 annotation (Placement(transformation(extent={{265,46},{245,66}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EvaporateurMP(
+    Dint=32.8e-3,
+    L=20.767,
+    Ntubes=738,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
+      Tp(start={504.9993271430632,504.2768804788304,503.69756244079724}),
+      Tp1(start={504.503193578626,503.89321384657916,503.40091865289605})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.83,
+      continuous_flow_reversal=true,
+      inertia=true,
+          dW1(start={9.7e7,7.6e6,5.8e6}),
+      P(start={2773378.75,2751240.3575119935,2743530.0500684776,
+            2738283.631137228,2733918.25}),
+      h(start={980960.1875,1046373.213452734,1096957.9937272775,
+            1136069.1896699532,980960.1875}),
+      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
+    Cws1(P(start=2773378.6567335734)),
+    ExchangerFlueGasesMetal(
+      K(fixed=true, start=30.22),
+      Dext=38e-3,
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=10.0676093,
+      p_rho=1.1,
+      Encras=Encras_EvMP,
+      St=5,
+      DeltaT(start={53,41,32}),
+      T(start={565.5570068359375,551.1237970278224,539.9287004763471,
+            531.2528686523438}),
+      Tm(start={558.3404164937012,545.5262487520847,535.5907942842642}),
+      Tp(start={505.4602817233831,504.6333427384495,503.9731723219999})))
+                          annotation (Placement(transformation(
+        origin={273,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeMP(
+    z2=0,
+    z1=10.83,
+    mode=1,
+    Q(start=150, fixed=true),
+    K=KgainChargeMP,
+    Pm(start=2734000),
+    h(start=978914.570821827))
+            annotation (Placement(transformation(
+        origin={315,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
+    h(start=980960.1562978515),
+    P(start=2734000))                      annotation (Placement(transformation(
+          extent={{295,-100},{275,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurMP(
+    ExchangerWall(e=2.6e-3, lambda=47,
+        dW1(start={-3e6,-1.4e6,-740379}),
+      Tp(start={470.48677107325835,488.1938632909576,497.65207032563256}),
+      Tp1(start={470.01280565475304,487.9402946158829,497.51626768286917})),
+    L=20.726,
+    Ns=3,
+    Dint=26.6e-3,
+    Ntubes=246,
+    Cws1(h_vol(start=576430.3612424443)),
+    Cws2(h_vol(start=947830.5281155076)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      K(fixed=true, start=47.78),
+      CSailettes=7.16188651,
+      p_rho=1.12,
+      Encras=Encras_EMP,
+      St=5,
+      DeltaT(start={45,24,13}),
+      T(start={516.7178344726563,512.927875284067,510.89894284399503,
+            509.81195068359375}),
+      Tm(start={514.8228643851462,511.91340906403104,510.35544151482316}),
+      Tp(start={470.920281581991,488.4257888303293,497.7762816508864})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.767,
+      z2=0,
+      inertia=true,
+      dW1(start={3e6,1.4e6,740379}),
+      h(start={576430.375,780326.2782299566,889409.3790325949,947830.5281155076,
+            947830.5}),
+      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
+      P(start={3160828.5,3185369.6108956896,3208693.506993564,
+            3231270.1974957627,3253417.5})))
+                          annotation (Placement(transformation(
+        origin={433,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurMP1(
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.3e6,-0.80263e6,
+                                -501864}),
+      Tp(start={558.0934551632172,574.0136440053798,584.242260992374}),
+      Tp1(start={557.706011115662,573.7688585895307,584.0889760553388})),
+    L=20.726,
+    Ns=3,
+    Dint=32.8e-3,
+    Ntubes=123,
+    Cws1(h_vol(start=2798761.3254371085)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      K(fixed=true, start=22.09),
+      CSailettes=14.46509765,
+      p_rho=1.07,
+      Encras=Encras_SMP1,
+      St=5,
+      DeltaT(start={45,30,19}),
+      T(start={606.3656616210938,604.5120304885253,603.3404748736327,
+            602.606689453125}),
+      Tm(start={605.4388500605926,603.926252681079,602.9735743782599}),
+      Tp(start={558.4534269956265,574.2410725985397,584.3846770655402})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.77,
+      inertia=true,
+      dW1(start={1.3e6,0.80263e6,501864}),
+      h(start={2798761.25,2900642.773718668,2965011.0169332824,
+            3005318.492253628,3040245.5}),
+      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
+      P(start={2731389.5,2730444.2277886732,2729310.613093969,
+            2728046.4038641006,2726700.0})))
+                          annotation (Placement(transformation(
+        origin={113,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Volumes.VolumeB MelangeurHPMP(
+    Ce1(h(start=3046003.380872726)),
+    h(start=3040245.422545259),
+    P(start=2726000))
+    annotation (Placement(transformation(
+        origin={115,-110},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurMP2(
+    Ns=3,
+    L=20.4,
+    Dint=39.3e-3,
+    Ntubes=369,
+    ExchangerWall(e=2.6e-3, lambda=36.86,
+    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
+      Tp(start={688.9747491924221,714.1387227867799,731.7594455240543}),
+      Tp1(start={687.7117385985722,713.2642402785228,731.156085252147})),
+    Cws1(P(start=2575477.4929098235),
+                             h_vol(start=3040245.422545259)),
+    Cws2(P(start=2558200.620927911),
+                             h_vol(start=3321522.540904887)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=92e-3,
+      K(fixed=true, start=45.22),
+      CSailettes=5.814209831,
+      p_rho=1.03,
+      Encras=Encras_SMP2,
+      St=5,
+      DeltaT(start={125,86,60}),
+      T(start={822.3056030273438,806.4713844816748,795.4738313791455,
+            787.8693237304688}),
+      Tm(start={814.3884833791556,800.9726079304102,791.671583337549}),
+      Tp(start={690.1616978609907,714.9605415853846,732.3264698030932})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dW1(start={1.15e7,7.9e6,5.5e6}),
+      h(start={3040245.5,3169860.5211362485,3259603.344415277,3321522.540904887,
+            3321522.5}),
+      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
+      P(start={2575477.5,2571810.3704688977,2567607.9202979314,
+            2563033.661146952,2558200.5})))
+                          annotation (Placement(transformation(
+        origin={-147,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurMP3(
+    Ns=3,
+    L=20.4,
+    Ntubes=369,
+    Dint=45.6e-3,
+    ExchangerWall(e=2.6e-3, lambda=27,
+    dW1(start={-8e6,-5.5e6,-3.8e6}),
+      Tp(start={786.0003533757151,802.6089712721623,814.0750543986999}),
+      Tp1(start={784.9544439166481,801.8912118855588,813.583437630984})),
+    Cws2(h_vol(start=3517381.1285517)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=92e-3,
+      Dext=50.8e-3,
+      K(fixed=true, start=43.23),
+      CSailettes=5.695842178,
+      p_rho=1.01,
+      Encras=Encras_SMP3,
+      St=5,
+      DeltaT(start={82,56,38}),
+      T(start={873.8992309570313,862.9376291442026,855.3997728669909,
+            850.2295532226563}),
+      Tm(start={868.4184414351687,859.1687010055967,852.814654374732}),
+      Tp(start={786.9913001992309,803.2890123388494,814.5408366613608})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dW1(start={8e6,5.5e6,3.8e6}),
+      h(start={3321522.5,3412353.763453483,3474687.0390689597,3517381.1285517,
+            3517381.25}),
+      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
+      P(start={2558200.5,2556022.8892716086,2553661.4076231164,
+            2551174.061990546,2548600.0})))
+                          annotation (Placement(transformation(
+        origin={-267,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum BallonBP(
+    Vertical=false,
+    P0=5e5,
+    Vv(fixed=false),
+    L=8,
+    hl(fixed=false, start=561432.6820300646),
+    hv(fixed=false, start=2682927.2097681486),
+    R=2,
+    P(fixed=false, start=536006.6647383622),
+    zl(start=1.75, fixed=true),
+    Kpa=5,
+    Mp=5000,
+    Kvl=1000,
+    Pfond(start=552000.8087452435),
+    Tp(start=409.09918124890646))
+                     annotation (Placement(transformation(extent={{585,10},{545,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurBP(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{633,76},{621,86}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_vapeurBP(
+    p_rho=3, Cvmax=CvmaxValveVBP,
+    C2(P(start=509651.8053666252),
+                          h_vol(start=2682927.2097681486)),
+    h(start=2685000),
+    Cv(start=1),
+    Pm(start=498000))
+                 annotation (Placement(transformation(extent={{525,46},{505,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_alimentationBP(
+    Cvmax=285,
+    C1(h_vol(start=517521.1338868904)),
+    h(fixed=false, start=509000),
+    Cv(start=142.5),
+    Pm(fixed=false, start=1001940.4305634197))
+                 annotation (Placement(transformation(extent={{617,44},{597,64}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss GainChargeBP(
+    z2=0,
+    z1=10.767,
+    Q(start=50, fixed=false),
+    K=32766,
+    mode=1,
+    pro(d(start=931.9744461081724)),
+    Pm(start=564000),
+    h(start=549249.519022482))
+            annotation (Placement(transformation(
+        origin={577,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=561432.682030064),
+                                                                       mode=1,
+    V=5,
+    P(start=564000))                       annotation (Placement(transformation(
+          extent={{559,-100},{539,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EvaporateurBP(
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
+      Tp(start={431.3608522222893,430.24126699702373,429.39686929842486}),
+      Tp1(start={430.9104943759602,429.93425668934924,429.1871126238492})),
+    L=20.726,
+    Ntubes=984,
+    Ns=3,
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=138e-3,
+      K(fixed=true, start=30.62),
+      CSailettes=11.07985,
+      p_rho=1.14,
+      Encras=Encras_EvBP,
+      St=5,
+      DeltaT(start={45,31,21}),
+      T(start={483.7066345214844,465.9440370193418,453.7982409323057,
+            445.483154296875}),
+      Tm(start={474.8253385845301,459.8711389758238,449.6406958379268}),
+      Tp(start={431.7792768702483,430.5265083466735,429.59175290805825})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={1.24e7,8.5e6,5.8e6}),
+      h(start={561432.6875,799363.0194709267,961560.8510406071,
+            1072378.2305328134,561432.6875}),
+      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
+      Q(start={49.81331881379377,49.81331881379377,49.81331881379377,
+            49.81331881379377}),
+      P(start={563167.375,538556.7569255093,537410.7752779912,536682.3739734262,
+            536006.6875})))
+                          annotation (Placement(transformation(
+        origin={533,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_ballonBP(k=1)
+    annotation (Placement(transformation(extent={{709,6},{695,18}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP(
+                          mode=1,
+    Cvmax=308.931,
+    C1(h_vol(start=561432.6820300646)),
+    h(start=550000),
+    Cv(start=308.931),
+    Pm(start=454319.5384961263))
+                 annotation (Placement(transformation(extent={{677,-14},{697,6}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    SurchauffeurBP(
+    Ns=3,
+    L=20.726,
+    Dint=39.3e-3,
+    Ntubes=123,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.1e6,-782901,-559798}),
+      Tp(start={477.52260500819597,502.61487297914,520.6394670364305}),
+      Tp1(start={477.2504107508904,502.4219869045609,520.5035062463255})),
+    Cws1(h_vol(start=2682927.2097681486)),
+    Cws2(h_vol(start=2919992.1127030067)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=222.1e-3,
+      K(fixed=true, start=30.46),
+      CSailettes=3.25763059984175,
+      p_rho=1.09,
+      Encras=Encras_SBP,
+      St=5,
+      DeltaT(start={92,66,47}),
+      T(start={569.0130004882813,567.4482541171128,566.3390581546068,
+            565.5570068359375}),
+      Tm(start={568.2306339861118,566.8936561358598,565.9480470570934}),
+      Tp(start={477.77840698873644,502.79614293098246,520.7672398988061})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      rugosrel=1e-5,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.1e6,782901,559798}),
+      h(start={2682927.25,2790287.093854774,2866365.945824299,
+            2919992.1127030067,2919992.0}),
+      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
+      P(start={509651.8125,507980.5977658856,506129.5447082628,
+            504067.5333025372,501850.0})))
+                          annotation (Placement(transformation(
+        origin={233,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5)
+    annotation (Placement(transformation(
+        origin={689,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    EconomiseurBP(
+    Ns=3,
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
+      Tp(start={402.39147626030376,398.05961040088295,397.171667377241}),
+      Tp1(start={402.1199525074059,397.9993065179613,397.15885396154556})),
+    Ntubes=3444,
+    L=20.726,
+    Cws1(h_vol(start=194669.37425632242)),
+    Cws2(h_vol(start=517521.1338868904)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=92e-3,
+      K(fixed=true, start=31.53),
+      CSailettes=11.673758598919,
+      p_rho=1.15,
+      Encras=Encras_EBP,
+      St=5,
+      DeltaT(start={23.5,5.3,1.1}),
+      T(start={445.483154296875,407.64728846356843,399.20963445670407,
+            397.4152526855469}),
+      Tm(start={426.56521960355815,403.42846146013625,398.31244500376624}),
+      Tp(start={402.64374727467464,398.11563835995787,397.18357224132967})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      inertia=true,
+      dW1(start={2.45e7,5.5e6,1.17e6}),
+      h(start={194669.375,449026.540992922,505517.82265620184,517521.1338868904,
+            517521.125}),
+      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
+      P(start={1578579.375,1542823.2506358635,1517636.5908885582,
+            1492724.792065889,1467874.25})))
+                          annotation (Placement(transformation(
+        origin={647,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineHP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.88057),
+    Qmax=140,
+    eta_is_nom=0.88057,
+    eta_is_min=0.75,
+    Cst(start=8182844.56002535)=
+        CstHP,
+    pros(d(start=10.66670150764929)),
+    Hrs(start=3046003.380872726),
+    Pe(fixed=true, start=12431000),
+    Ps(fixed=false, start=2726700))
+              annotation (Placement(transformation(extent={{-35,-250},{5,-210}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineMP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9625),
+    Qmax=150,
+    eta_is_nom=0.9625,
+    eta_is_min=0.75,
+    Cst(start=256335.364995961)=
+        CstMP,
+    pros(d(start=1.883484197675123)),
+    Hrs(start=3029367.6706168973),
+    Pe(fixed=true, start=2548500),
+    Ps(fixed=false, start=476800))
+                annotation (Placement(transformation(extent={{285,-250},{325,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC MelangeurPostTMP1(
+    h(start=3018320.043117248),
+    P(start=476799.99999954),
+    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
+        origin={385,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine TurbineBP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9538),
+    Qmax=150,
+    eta_is_nom=0.9538,
+    eta_is_min=0.75,
+    Cst(start=11944.9445735985)=
+        CstBP,
+    Cs(h(start=2401478.8015108025)),
+    Hrs(start=2401030),
+    Pe(fixed=true, start=476799.99999954),
+    Ps(start=10053))
+                annotation (Placement(transformation(extent={{543,-250},{583,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-325,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-265,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(
+                                                    alpha=0.5,
+    Ce(h(start=3046260)),
+    P(start=2726700))
+    annotation (Placement(transformation(extent={{81,-180},{101,-160}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenseur(
+    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    Vf0=0.15,
+    steady_state=false,
+    yNiveau(signal(start=1.5)),
+    Cse(h(start=128076)),
+    P(fixed=false, start=6136),
+    Pfond(start=10000.0),
+    Cl(h(start=191812.29519356362)),
+    proe(d(start=996.0227362797892)))
+    annotation (Placement(transformation(extent={{604,-384},{684,-304}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
+    h0=113.38e3, Q0=29804.5)     annotation (Placement(transformation(extent={{539,
+            -377},{587,-329}},     rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{703,-374},{747,-330}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK1(    K=1e-4,
+    h(start=2400000),
+    C1(h_vol(start=2400000), h(start=2400000)),
+    Pm(start=10026.138683139128))
+    annotation (Placement(transformation(extent={{607,-240},{627,-220}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
+    Ce3(h(start=194669.37425631672)),
+    h(start=194669.37425632242),
+    P(start=1540500))
+    annotation (Placement(transformation(
+        origin={869,-318},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeKCond1(    K=1e-4, mode=1,
+    pro(d(start=990.3699122081223)),
+    Pm(start=1540000))
+    annotation (Placement(transformation(
+        origin={869,-270},
+        extent={{12,-12},{-12,12}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
+    h(start=561432.6820300613),
+    P(start=322430))                       annotation (Placement(transformation(
+          extent={{709,-20},{729,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimMP(
+    a3=350,
+    b1(fixed=true) = -3.7751,
+    a1=-244551,
+    Q(fixed=false),
+    mode=1,
+    C1(h_vol(start=561432.6820300613)),
+    C2(h_vol(start=576430.3612424443)),
+    Qv(start=0.013433660889458656),
+    pro(d(start=931.2517020786314)),
+    Pm(start=1725850))
+            annotation (Placement(transformation(extent={{771,-20},{791,0}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimHP(
+    a3=1600,
+    a1=-28056.2,
+    b1=-12.7952660447433,
+    Q(fixed=false),
+    mode=1,
+    C1(h_vol(start=561432.6820300613)),
+    C2(h_vol(start=630040.8772883223)),
+    Qv(start=0.08167585768192882),
+    pro(d(start=929.0940034498418)),
+    Pm(start=6774000))
+             annotation (Placement(transformation(extent={{771,-60},{791,-40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
+                                                    alpha=0.5,
+    h(start=194585),
+    P(start=1540500),
+    Cs(h(start=194585)))
+    annotation (Placement(transformation(extent={{839,-328},{853,-308}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={235,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss PerteChargeZero2(
+    z2=0,
+    mode=0,
+    z1=0,
+    K=K_PerteChargeZero2,
+    h(start=3000000),
+    C1(
+      h_vol(start=3000000),
+      h(start=3000000),
+      P(fixed=true, start=501850)),
+    Pm(start=490000))
+            annotation (Placement(transformation(
+        origin={311,-278},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK3(    K=1e-4, mode=1,
+    Pm(start=372632.41194491077))
+    annotation (Placement(transformation(
+        origin={747,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK8(    K=1e-4, mode=1,
+    Pm(start=372632.41224549303))
+    annotation (Placement(transformation(
+        origin={747,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
+    annotation (Placement(transformation(extent={{369,-448},{489,-348}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK(
+                                                         K=1e-4, mode=1,
+    C1(h_vol(start=191812.29519356362)),
+    C2(h_vol(start=191812.29519356362)),
+    pro(d(start=989.8383588386666)),
+    Pm(start=6200))
+    annotation (Placement(transformation(extent={{669,-446},{689,-426}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump PompeAlimBP(
+    Qv(start=0.19861699733512259),
+    mode=1,
+    a3=400,
+    a1(fixed=true) = -6000,
+    Q(start=194.502, fixed=false),
+    C2(h_vol(start=194669.37425631672)),
+    Pm(start=802830.7060548771))
+            annotation (Placement(transformation(extent={{709,-446},{729,-426}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss perteChargeK2(
+                                                         K=1e-4, mode=1,
+    pro(d(start=990.3699122094005)),
+    C1(h_vol(start=194669.37425631672),
+                            h(start=194585)),
+    Pm(start=1546000))
+    annotation (Placement(transformation(extent={{807,-446},{827,-426}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_extraction(            mode=1, Cvmax=
+        2000,
+    h(start=194500),
+    Cv(start=2000),
+    Pm(start=1587120.4167526974))
+                 annotation (Placement(transformation(extent={{769,-440},{789,
+            -420}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol(start=2674000),
+        h(start=2674000)))
+    annotation (Placement(transformation(
+        origin={-91,8},
+        extent={{-6,6},{6,-6}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol(start=1398000),
+        h(start=1398000))) " "
+    annotation (Placement(transformation(
+        origin={58.5,32},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol(start=944000),
+        h(start=944000)))
+    annotation (Placement(transformation(extent={{391,49},{376,63}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol(start=2798000),
+        h(start=2798000)))
+    annotation (Placement(transformation(
+        origin={203,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol(start=2685000),
+        h(start=2685000)))
+    annotation (Placement(transformation(
+        origin={481,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol(start=550000),
+        h(start=550000)))
+    annotation (Placement(transformation(
+        origin={630.5,34},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol(
+          start=550000), h(start=550000)))
+    annotation (Placement(transformation(extent={{654,-11},{667,1}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol(
+          start=194585), h(start=194585)))
+    annotation (Placement(transformation(
+        origin={652.5,-412},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol(
+          start=2401000), h(start=2401000)))
+    annotation (Placement(transformation(
+        origin={651.5,-264},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipeK2(
+                                                          K=Kin_SMP2,
+    Pm(start=2651000),
+    C1(
+      P(fixed=true, start=2726700),
+      h_vol(start=3046000),
+      h(start=3046000)))
+    annotation (Placement(transformation(extent={{81,-120},{61,-100}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_entree_TurbineHP(
+    mode=0,
+    C1(P(fixed=true, start=12680999.9999969)),
+    Cvmax=Cvmax_THP,
+    h(fixed=false, start=3433000),
+    Cv(start=10875),
+    Pm(fixed=false, start=12550000))
+                 annotation (Placement(transformation(extent={{-157,-234},{-137,
+            -214}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauHP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{-191,113},{-157,131}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl
+    regulation_Niveau_HP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500,
+    minval=0.007)
+    annotation (Placement(transformation(extent={{-73,106},{-53,126}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauMP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{140,113},{174,131}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl
+    regulation_Niveau_MP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500)
+    annotation (Placement(transformation(extent={{229,106},{249,126}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauBP(                                                              k=1.75)
+    annotation (Placement(transformation(extent={{437,126},{471,144}}, rotation=
+           0)));
+  Control.Drum_LevelControl regulation_Niveau_BP(
+                     add(k1=-1, k2=+1), pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    Ti=10,
+    minval=0.006)
+    annotation (Placement(transformation(extent={{535,108},{555,128}}, rotation=
+           0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauCondenseur1(                                 k=1.5)
+    annotation (Placement(transformation(extent={{683,-246},{707,-230}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+                                                add(k1=+1, k2=-1),
+    edge(uL(signal(start=true))))
+                                 annotation (Placement(transformation(extent={{725,
+            -282},{745,-262}},     rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneTurbineHP(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-241,-216},{
+            -171,-142}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp(
+    Initialvalue=1400,
+    Duration=1000,
+    Starttime=4000,
+    Finalvalue=1000)
+                   annotation (Placement(transformation(extent={{911,-42},{873,
+            -10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP(
+    Initialvalue=1400,
+    Starttime=4000,
+    Duration=1000,
+    Finalvalue=700)
+                   annotation (Placement(transformation(extent={{912,-96},{874,
+            -64}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{912,-458},{874,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
+    mode=1,
+    V=1,
+    h0=988332,
+    h(start=860655.3510813401),
+    dynamic_mass_balance=true,
+    P0=7010000,
+    P(start=13149153.870557636))          annotation (Placement(transformation(
+          extent={{423,-98},{403,-78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
+    mode=1,
+    V=1,
+    h0=983786,
+    h(start=989834.8113335292),
+    dynamic_mass_balance=true,
+    P0=7000000,
+    P(start=13239005.657249678))          annotation (Placement(transformation(
+          extent={{219,-20},{199,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP1(
+                          mode=1,
+    Cvmax=308.931,
+    h(start=618600),
+    Cv(start=308.931),
+    Pm(start=13150193.68579806))
+                 annotation (Placement(transformation(extent={{721,-98},{697,
+            -122}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Vanne_alimentationMPHP2(
+                          mode=1,
+    Cvmax=308.931,
+    h(start=565000),
+    Cv(start=308.931),
+    Pm(start=3163391.8442005403))
+                 annotation (Placement(transformation(extent={{771,-138},{747,
+            -162}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(
+    Initialvalue=0.8,
+    Duration=1000,
+    Starttime=3000,
+    Finalvalue=0.005)
+                     annotation (Placement(transformation(extent={{913,-150},{
+            875,-118}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(
+    Initialvalue=0.8,
+    Duration=1000,
+    Starttime=3000,
+    Finalvalue=0.005)
+                     annotation (Placement(transformation(extent={{913,-194},{
+            875,-162}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
+    h0=3e6,
+    h(start=3432930.9918569606),
+    dynamic_mass_balance=true,
+    P0=12700000,
+    P(start=12700000))                annotation (Placement(transformation(
+        origin={-85,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC MelangeurPreTMP(
+    h0=3523910,
+    h(start=3517381.1285518324),
+    dynamic_mass_balance=true,
+    P0=2400000,
+    P(start=2400000))                     annotation (Placement(transformation(
+        origin={-83,-314},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve vanne_entree_TurbineMP(
+    mode=0,
+    C1(P(fixed=true, start=25.486e5)),
+    Cvmax=Cvmax_TMP,
+    h(fixed=false, start=3518000),
+    Cv(start=3.312e6),
+    Pm(fixed=false, start=2547000))
+                 annotation (Placement(transformation(extent={{-157,-318},{-137,
+            -298}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneTurbineMP(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-241,-300},{
+            -171,-226}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
+    annotation (Placement(transformation(extent={{-28,68},{-2,98}},
+                                                                  rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
+    annotation (Placement(transformation(extent={{293,68},{319,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
+    annotation (Placement(transformation(extent={{552,64},{578,94}}, rotation=0)));
+
+  FlueGases.BoundaryConditions.SourceQ SourceFumees(
+    Xco2=0.0613,
+    Xso2=0,
+    Xh2o=0.0706,
+    T0=893.75,
+    Xo2=0.1380,
+    Q0=606.94)
+    annotation (Placement(transformation(extent={{-473,-91},{-371,-7}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit(             Table=[0,606.94; 10,606.94; 600,
+        50; 650,50])
+                annotation (Placement(transformation(extent={{-527,-19},{-457,
+            55}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature(
+      Table=[0,893.75; 10,893.75; 600,423; 650,423])
+                   annotation (Placement(transformation(extent={{-527,-157},{
+            -457,-83}}, rotation=0)));
+equation
+  connect(SurchauffeurHP3.Cws1, SurchauffeurHP2.Cws2)
+    annotation (Line(points={{-327,-30},{-327,-10},{-207,-10},{-207,-30}},
+        color={255,0,0}));
+  connect(SurchauffeurHP2.Cws1, SurchauffeurHP1.Cws2)
+    annotation (Line(points={{-207,-70},{-207,-90},{-87,-90},{-87,-70}}, color=
+          {255,0,0}));
+  connect(constante_vanne_vapeurHP.y, vanne_vapeurHP.Ouv)
+    annotation (Line(points={{-61.5,74},{-65,74},{-65,67}}));
+  connect(vanne_vapeurHP.C1, BallonHP.Cv)
+    annotation (Line(points={{-55,50},{-35,50}},color={255,0,0}));
+  connect(GainChargeHP.C1, BallonHP.Cd)
+    annotation (Line(points={{5,-90},{15,-90},{15,10},{5,10}},   color={255,128,
+          0}));
+  connect(BallonHP.Cm, EvaporateurHP.Cws2)
+    annotation (Line(points={{-35,10},{-47,10},{-47,-30}}));
+  connect(VolumeEvapHP.Cs, EvaporateurHP.Cws1)
+    annotation (Line(points={{-45,-90},{-45,-70},{-47,-70}}, color={255,128,0}));
+  connect(VolumeEvapHP.Ce1, GainChargeHP.C2)
+                                      annotation (Line(points={{-25,-90},{-15,
+          -90}},
+        color={255,128,0}));
+  connect(EconomiseurHP4.Cws1, EconomiseurHP3.Cws2)
+    annotation (Line(points={{53,-70},{53,-82},{173,-82},{173,-70}}));
+  connect(BallonMP.Cm, EvaporateurMP.Cws2)
+    annotation (Line(points={{287,10},{273,10},{273,-30}}));
+  connect(EvaporateurMP.Cws1, VolumeEvapMP.Cs)
+    annotation (Line(points={{273,-70},{273,-80},{275,-80},{275,-90}}, color={
+          255,128,0}));
+  connect(VolumeEvapMP.Ce1, GainChargeMP.C2)
+    annotation (Line(points={{295,-90},{305,-90}}, color={255,128,0}));
+  connect(constante_vanne_vapeurMP.y, vanne_vapeurMP.Ouv)
+    annotation (Line(points={{258.4,75},{255,75},{255,67}}));
+  connect(SurchauffeurHP1.Cfg2, EvaporateurHP.Cfg1)        annotation (Line(
+      points={{-77,-50},{-57,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurHP.Cfg2, EconomiseurHP4.Cfg1)        annotation (Line(
+      points={{-37,-50},{63,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP4.Cfg2, SurchauffeurMP1.Cfg1)          annotation (Line(
+      points={{43,-50},{103,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP1.Cfg2, EconomiseurHP3.Cfg1)           annotation (Line(
+      points={{123,-50},{163,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurMP.Cfg2, EconomiseurHP2.Cfg1)           annotation (Line(
+      points={{283,-50},{363,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP2.Cfg2, EconomiseurMP.Cfg1)           annotation (Line(
+      points={{383,-50},{423,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurMP.Cfg2, EconomiseurHP1.Cfg1)           annotation (Line(
+      points={{443,-50},{483,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(GainChargeMP.C1, BallonMP.Cd)
+    annotation (Line(points={{325,-90},{335,-90},{335,10},{325,10}}, color={255,
+          128,0}));
+  connect(SurchauffeurMP2.Cfg2, SurchauffeurHP1.Cfg1)          annotation (Line(
+      points={{-137,-50},{-97,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP2.Cfg1, SurchauffeurHP2.Cfg2)           annotation (Line(
+      points={{-157,-50},{-197,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP3.Cfg2, SurchauffeurHP2.Cfg1)           annotation (Line(
+      points={{-257,-50},{-217,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurHP3.Cfg2, SurchauffeurMP3.Cfg1)           annotation (Line(
+      points={{-317,-50},{-277,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP3.Cws1,SurchauffeurMP2. Cws2)
+    annotation (Line(points={{-267,-30},{-267,10},{-147,10},{-147,-30}}, color=
+          {255,0,0}));
+  connect(SurchauffeurMP1.Cws2, MelangeurHPMP.Ce2) annotation (Line(
+      points={{113,-70},{113,-85},{115,-85},{115,-100}},
+      color={255,0,0},
+      pattern=LinePattern.None));
+  connect(vanne_vapeurBP.C1, BallonBP.Cv)
+    annotation (Line(points={{525,50},{545,50}}, color={255,0,0}));
+  connect(EvaporateurBP.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{533,-70},
+          {533,-90},{539,-90}},      color={255,128,0}));
+  connect(VolumeEvapBP.Ce1, GainChargeBP.C2)
+                                        annotation (Line(points={{559,-90},{567,
+          -90}}, color={255,128,0}));
+  connect(BallonBP.Cd, GainChargeBP.C1)
+                                       annotation (Line(points={{585,10},{595,
+          10},{595,-90},{587,-90}}, color={255,128,0}));
+  connect(EconomiseurBP.Cfg2, PuitsFumees.C)     annotation (Line(
+      points={{657,-50},{679.2,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP3.Cfg2, SurchauffeurBP.Cfg1)  annotation (Line(
+      points={{183,-50},{223,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurBP.Cfg2, EvaporateurMP.Cfg1)  annotation (Line(
+      points={{243,-50},{263,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP1.Cfg2, EvaporateurBP.Cfg1) annotation (Line(
+      points={{503,-50},{523,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurBP.Cfg2, EconomiseurBP.Cfg1) annotation (Line(
+      points={{543,-50},{637,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(BallonBP.Cm, EvaporateurBP.Cws2)
+    annotation (Line(points={{545,10},{533,10},{533,-30}}));
+  connect(vanne_vapeurMP.C1, BallonMP.Cv)   annotation (Line(points={{265,50},{
+          287,50}}, color={255,0,0}));
+  connect(Vanne_alimentationMPHP.Ouv, constante_ballonBP.y)
+    annotation (Line(points={{687,7},{687,12},{694.3,12}}));
+  connect(SurchauffeurHP3.Cws2, DoubleDebitHP.Ce)
+    annotation (Line(points={{-327,-70},{-327,-80},{-325,-80},{-325,-90}},
+        color={255,0,0}));
+  connect(SurchauffeurMP3.Cws2, DoubleDebitMP.Ce)
+    annotation (Line(points={{-267,-70},{-267,-80},{-265,-80},{-265,-90}},
+        color={255,0,0}));
+  connect(VolumeCond1.Cs, perteChargeKCond1.C1) annotation (Line(points={{869,
+          -308},{869,-282}}, color={0,0,255}));
+  connect(Vanne_alimentationMPHP.C2, VolumeAlimMPHP.Ce1)
+                                               annotation (Line(points={{697,-10},
+          {709,-10}},      color={0,0,255}));
+  connect(SurchauffeurBP.Cws2, DoubleDebitBP.Ce)
+    annotation (Line(points={{233,-70},{233,-80},{235,-80},{235,-90}}, color={
+          255,0,0}));
+  connect(perteChargeK8.C2, PompeAlimMP.C1)
+    annotation (Line(points={{757,-10},{764,-10},{771,-10}},           color={0,
+          0,255}));
+  connect(VolumeAlimMPHP.Cs1, perteChargeK8.C1)
+    annotation (Line(points={{729,-10},{733,-10},{737,-10}},           color={0,
+          0,255}));
+  connect(VolumeAlimMPHP.Cs2, perteChargeK3.C1)
+                                         annotation (Line(points={{719,-20},{
+          719,-50},{737,-50}}, color={0,0,255}));
+  connect(perteChargeK3.C2, PompeAlimHP.C1)
+    annotation (Line(points={{757,-50},{771,-50}}, color={0,0,255}));
+  connect(MelangeurPostTMP1.Ce2, PerteChargeZero2.C2) annotation (Line(points={{385,
+          -239},{385,-278},{321,-278}},      color={255,0,0}));
+  connect(perteChargeK.C2,PompeAlimBP. C1)
+                                         annotation (Line(points={{689,-436},{
+          709,-436}}, color={0,0,255}));
+  connect(vanne_extraction.C2, perteChargeK2.C1) annotation (Line(points={{789,
+          -436},{807,-436}}, color={0,0,255}));
+  connect(vanne_alimentationHP.C1, CapteurDebitEauHP.C2)
+    annotation (Line(points={{45,50},{53.3,50},{53.3,38.12}}));
+  connect(vanne_vapeurHP.C2, CapteurDebitVapHP.C1) annotation (Line(points={{-75,50},
+          {-86.2,50},{-86.2,14}},         color={255,0,0}));
+  connect(CapteurDebitVapHP.C2, SurchauffeurHP1.Cws1) annotation (Line(points={{-86.2,
+          1.88},{-86.2,-3.06},{-87,-3.06},{-87,-30}},        color={255,0,0}));
+  connect(vanne_alimentationMP.C1, CapteurDebitEauMP.C2)
+    annotation (Line(points={{365,50},{370.425,50},{370.425,50.4},{375.85,50.4}}));
+  connect(CapteurDebitVapMP.C1, vanne_vapeurMP.C2) annotation (Line(points={{211,
+          49.6},{227,49.6},{227,50},{245,50}},     color={255,0,0}));
+  connect(CapteurDebitVapMP.C2, SurchauffeurMP1.Cws1) annotation (Line(points={{194.84,
+          49.6},{113,49.6},{113,-30}},         color={255,0,0}));
+  connect(CapteurDebitVapBP.C2, SurchauffeurBP.Cws1) annotation (Line(points={{472.84,
+          49.6},{457,49.6},{457,-2},{233,-2},{233,-30}},        color={255,0,0}));
+  connect(CapteurDebitVapBP.C1, vanne_vapeurBP.C2) annotation (Line(points={{489,
+          49.6},{497,49.6},{497,50},{505,50}},     color={255,0,0}));
+  connect(CapteurDebitEauBP.C2, vanne_alimentationBP.C1) annotation (Line(
+        points={{625.3,40.12},{625.3,48},{617,48}}, color={0,0,255}));
+  connect(CapteurDebitEauBPsortie.C2, Vanne_alimentationMPHP.C1) annotation (Line(
+        points={{667.13,-9.8},{672.065,-9.8},{672.065,-10},{677,-10}}, color={0,
+          0,255}));
+  connect(CapteurDebitEauCondenseur.C2, perteChargeK.C1) annotation (Line(
+        points={{647.3,-422.2},{647.3,-436},{669,-436}}, color={0,0,255}));
+  connect(perteChargeK1.C2, CapteurDebitVapCondenseur.C1) annotation (Line(
+        points={{627,-230},{646.3,-230},{646.3,-254}}, color={255,0,0}));
+  connect(MelangeurHPMP.Ce1, MoitieDebitHP.Cs)
+    annotation (Line(points={{115,-120},{115,-170},{101,-170}}, color={255,0,0}));
+  connect(perteChargeK2.C2, MoitieDebitBP.Ce) annotation (Line(points={{827,
+          -436},{829,-436},{829,-318},{839,-318}}, color={0,0,255}));
+  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{853,-318},
+          {859,-318}}, color={0,0,255}));
+  connect(SurchauffeurMP2.Cws1, lumpedStraightPipeK2.C2)
+    annotation (Line(points={{-147,-70},{-147,-110},{61,-110}}, color={255,0,0}));
+  connect(lumpedStraightPipeK2.C1, MelangeurHPMP.Cs2)
+    annotation (Line(points={{81,-110},{105.2,-110}},  color={255,0,0}));
+  connect(DoubleDebitHP.Cs, vanne_entree_TurbineHP.C1) annotation (Line(points={{-325,
+          -110},{-325,-230},{-157,-230}},        color={255,0,0}));
+  connect(DoubleDebitBP.Cs, PerteChargeZero2.C1) annotation (Line(points={{235,
+          -110},{235,-278},{301,-278}}, color={255,0,0}));
+  connect(PompeAlimBP.C2, vanne_extraction.C1) annotation (Line(points={{729,
+          -436},{769,-436}}, color={0,0,255}));
+  connect(BallonHP.yLevel,regulation_Niveau_HP. MesureNiveauEau)
+    annotation (Line(points={{-37,30},{-101,30},{-101,125},{-73.5,125}}));
+  connect(regulation_Niveau_HP.SortieReelle1, vanne_alimentationHP.Ouv)
+    annotation (Line(points={{-52.5,107},{35,107},{35,67}}));
+  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
+    annotation (Line(points={{175.7,122},{201,122},{201,110},{228.5,110}}));
+  connect(BallonMP.yLevel,regulation_Niveau_MP. MesureNiveauEau)
+    annotation (Line(points={{285.1,30},{219,30},{219,125},{228.5,125}}));
+  connect(regulation_Niveau_MP.SortieReelle1, vanne_alimentationMP.Ouv)
+    annotation (Line(points={{249.5,107},{344.25,107},{344.25,67},{355,67}}));
+  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
+    annotation (Line(points={{472.7,135},{496.85,135},{496.85,112},{534.5,112}}));
+  connect(BallonBP.yLevel,regulation_Niveau_BP. MesureNiveauEau)
+    annotation (Line(points={{543,30},{485,30},{485,127},{534.5,127}}));
+  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
+    annotation (Line(points={{708.2,-238},{719,-238},{719,-269},{724.5,-269}}));
+  connect(regulation_Niveau_Condenseur.SortieReelle1, vanne_extraction.Ouv)
+    annotation (Line(points={{745.5,-281},{779,-281},{779,-419}}));
+  connect(CapteurDebitEauBP.C1, EconomiseurBP.Cws2)
+    annotation (Line(points={{625.3,28},{627,28},{627,6},{647,6},{647,-30}}));
+  connect(EconomiseurBP.Cws1, perteChargeKCond1.C2) annotation (Line(points={{647,-70},
+          {647,-186},{869,-186},{869,-258}}));
+  connect(CapteurDebitVapCondenseur.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
+    annotation (Line(points={{658.13,-264},{671,-264},{671,-280.9},{724.6,
+          -280.9}}));
+  connect(regulation_Niveau_Condenseur.MesureDebitEau,
+    CapteurDebitEauCondenseur.Measure) annotation (Line(points={{724.45,-274.95},
+          {717,-274.95},{717,-310},{759,-310},{759,-412},{659.13,-412}}));
+  connect(ConstantVanneTurbineHP.y, vanne_entree_TurbineHP.Ouv)
+    annotation (Line(points={{-167.5,-179},{-147,-179},{-147,-213}}));
+  connect(regulation_Niveau_BP.SortieReelle1, vanne_vapeurBP.Ouv)
+    annotation (Line(points={{555.5,109},{567,109},{567,90},{515,90},{515,67}}));
+  connect(vanne_alimentationBP.Ouv, constante_vanne_vapeurBP.y)
+    annotation (Line(points={{607,65},{607,81},{620.4,81}}));
+  connect(EconomiseurHP1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{493,-70},
+          {493,-88},{423,-88}},          color={0,0,255}));
+  connect(VolumeECO_HP1_2.Cs, EconomiseurHP2.Cws1) annotation (Line(points={{403,-88},
+          {373,-88},{373,-70}},          color={0,0,255}));
+  connect(EconomiseurHP2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{373,-30},
+          {373,-10},{219,-10}},          color={0,0,255}));
+  connect(VolumeECO_HP2_3.Cs, EconomiseurHP3.Cws1) annotation (Line(points={{199,-10},
+          {173,-10},{173,-30}},          color={0,0,255}));
+  connect(Vanne_alimentationMPHP1.C1, PompeAlimHP.C2)
+    annotation (Line(points={{721,-102.8},{809,-102.8},{809,-50},{791,-50}}));
+  connect(PompeAlimMP.C2, Vanne_alimentationMPHP2.C1) annotation (Line(points={{791,-10},
+          {837,-10},{837,-142.8},{771,-142.8}},           color={0,0,255}));
+  connect(arretPomesMp1.y, Vanne_alimentationMPHP1.Ouv)
+    annotation (Line(points={{873.1,-134},{823,-134},{823,-122},{709,-122},{709,
+          -123.2}}));
+  connect(arretPomesHP1.y, Vanne_alimentationMPHP2.Ouv)
+    annotation (Line(points={{873.1,-178},{850.05,-178},{850.05,-163.2},{759,
+          -163.2}}));
+  connect(Vanne_alimentationMPHP1.C2, EconomiseurHP1.Cws1) annotation (Line(
+        points={{697,-102.8},{603,-102.8},{603,-106},{515,-106},{515,-6},{493,
+          -6},{493,-30}}, color={0,0,255}));
+  connect(EconomiseurMP.Cws1, Vanne_alimentationMPHP2.C2)
+    annotation (Line(points={{433,-70},{433,-142.8},{747,-142.8}}));
+  connect(ConstantVanneTurbineMP.y, vanne_entree_TurbineMP.Ouv)
+    annotation (Line(points={{-167.5,-263},{-147,-263},{-147,-297}}));
+  connect(vanne_entree_TurbineHP.C2, VolumePreTHP.Ce) annotation (Line(points={{-137,
+          -230},{-95,-230}},       color={255,0,0}));
+  connect(DoubleDebitMP.Cs, vanne_entree_TurbineMP.C1) annotation (Line(points={{-265,
+          -110},{-265,-314},{-157,-314}},        color={255,0,0}));
+  connect(vanne_entree_TurbineMP.C2, MelangeurPreTMP.Ce1) annotation (Line(
+        points={{-137,-314},{-93,-314}}, color={255,0,0}));
+  connect(SourceCaloporteur.C, Condenseur.Cee) annotation (Line(points={{587,
+          -353},{605,-353},{605,-352.8},{604,-352.8}},
+                                                     color={0,0,255}));
+  connect(Condenseur.Cse, PuitsCaloporteur.C) annotation (Line(points={{684,
+          -352},{703,-352}}, color={0,0,255}));
+  connect(CapteurDebitVapCondenseur.C2, Condenseur.Cv) annotation (Line(points={{646.3,
+          -274.2},{646.3,-288.1},{644,-288.1},{644,-304}},         color={0,0,
+          255}));
+  connect(CapteurDebitEauCondenseur.C1, Condenseur.Cl)
+    annotation (Line(points={{647.3,-402},{644.8,-402},{644.8,-384}}));
+  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
+    annotation (Line(points={{-155.3,122},{-133,122},{-133,110},{-73.5,110}}));
+  connect(Condenseur.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
+    annotation (Line(points={{688,-372.8},{747,-372.8},{747,-326},{699,-326},{
+          699,-263},{724.5,-263}}));
+  connect(BallonBP.Cs, CapteurDebitEauBPsortie.C1) annotation (Line(points={{545,22},
+          {531,22},{531,16},{609,16},{609,-9.8},{654,-9.8}},         color={0,0,
+          255}));
+  connect(BallonBP.Ce1, vanne_alimentationBP.C2)
+    annotation (Line(points={{585,50},{591,50},{591,48},{597,48}}));
+  connect(BallonMP.Ce1, vanne_alimentationMP.C2)
+    annotation (Line(points={{325,50},{345,50}}));
+  connect(BallonHP.Ce1, vanne_alimentationHP.C2)
+    annotation (Line(points={{5,50},{25,50}}));
+  connect(TurbineHP.Cs, MoitieDebitHP.Ce) annotation (Line(points={{5.2,-230},{
+          41,-230},{41,-170},{81,-170}},   color={255,0,0}));
+  connect(VolumePreTHP.Cs3, TurbineHP.Ce) annotation (Line(points={{-75,-230},{
+          -35.2,-230}},color={255,0,0}));
+  connect(MelangeurPreTMP.Cs, TurbineMP.Ce) annotation (Line(points={{-73,-314},
+          {73,-314},{73,-230},{284.8,-230}},   color={255,0,0}));
+  connect(TurbineMP.Cs, MelangeurPostTMP1.Ce1) annotation (Line(points={{325.2,
+          -230},{375,-230}}, color={255,0,0}));
+  connect(MelangeurPostTMP1.Cs, TurbineBP.Ce) annotation (Line(points={{395,
+          -230},{542.8,-230}}, color={255,0,0}));
+  connect(TurbineBP.Cs, perteChargeK1.C1) annotation (Line(points={{583.2,-230},
+          {607,-230}}, color={255,0,0}));
+  connect(EconomiseurMP.Cws2, CapteurDebitEauMP.C1) annotation (Line(points={{433,-30},
+          {437,-30},{437,50.4},{391,50.4}},          color={0,0,255}));
+  connect(TurbineMP.MechPower, Alternateur.Wmec2)
+    annotation (Line(points={{327,-248},{335,-248},{335,-378},{369,-378}}));
+  connect(TurbineBP.MechPower, Alternateur.Wmec1) annotation (Line(points={{585,
+          -248},{595,-248},{595,-290},{355,-290},{355,-358},{369,-358}}));
+  connect(TurbineHP.MechPower, Alternateur.Wmec3)
+    annotation (Line(points={{7,-248},{15,-248},{15,-398},{369,-398}}));
+  connect(heatSource.C[1], BallonHP.Cex) annotation (Line(points={{-15,68.3},{
+          -15,50}},
+                color={191,95,0}));
+  connect(heatSource1.C[1], BallonMP.Cex) annotation (Line(points={{306,68.3},{
+          306,50}}, color={191,95,0}));
+  connect(heatSource2.C[1], BallonBP.Cex) annotation (Line(points={{565,64.3},{
+          565,50}}, color={191,95,0}));
+  connect(CapteurDebitEauHP.C1, EconomiseurHP4.Cws2)
+    annotation (Line(points={{53.3,26},{53,26},{53,-30}}, smooth=Smooth.None));
+  connect(PompeAlimMP.rpm_or_mpower, arretPomesMp.y)
+    annotation (Line(points={{781,-21},{781,-26},{871.1,-26}}, smooth=Smooth.None));
+  connect(PompeAlimHP.rpm_or_mpower, arretPomesHP.y)
+    annotation (Line(points={{781,-61},{781,-80},{872.1,-80}}, smooth=Smooth.None));
+  connect(PompeAlimBP.rpm_or_mpower, arretPomesBP.y) annotation (Line(points={{719,
+          -447},{721,-447},{721,-460},{845,-460},{845,-442},{872.1,-442}},
+        smooth=Smooth.None));
+  connect(SourceFumees.C, SurchauffeurHP3.Cfg1) annotation (Line(
+      points={{-371,-49},{-371,-50},{-337,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(Temperature.y,SourceFumees. ITemperature)
+    annotation (Line(points={{-453.5,-120},{-422,-120},{-422,-70}}));
+  connect(Debit.y,SourceFumees. IMassFlow)
+    annotation (Line(points={{-453.5,18},{-422,18},{-422,-28}}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-560,-460},
+            {950,150}},
+        initialScale=0.1),     graphics),
+    experiment(StopTime=10000, Tolerance=0.001),
+    experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end CombinedCycle_TripTAC;
diff --git a/ThermoSysPro/Examples/CombinedCyclePowerPlant/package.mo b/ThermoSysPro/Examples/CombinedCyclePowerPlant/package.mo
index 28dc8b9b53aef7fc226885b35b53a0077e4614ab..0e95df8cb09a71506cdf822c13b242cbc34ec5d1 100644
--- a/ThermoSysPro/Examples/CombinedCyclePowerPlant/package.mo
+++ b/ThermoSysPro/Examples/CombinedCyclePowerPlant/package.mo
@@ -1,146 +1,146 @@
-within ThermoSysPro.Examples;
-package CombinedCyclePowerPlant "Models of a combined cycle power plant"
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This package contains two models of the same combined cycle power plant are provided to simulate two different transients:</p>
-<ul>
-<li>CombinedCycle_Load_100_50, to simulate a load decrease from 100&percnt; to 50&percnt;</li>
-<li>CombinedCycle_TripTAC, to simulate a full combustion turbine trip</li></p>
-</ul>
-<p>The two models are documented in two conference papers, <a href=\"http://www.ep.liu.se/ecp/063/040/ecp11063040.pdf\">1</a> and <a href=\"http://www.ep.liu.se/ecp/132/046/ecp17132407.pdf\">2</a>. </h4>
-</html>"));
-end CombinedCyclePowerPlant;
+within ThermoSysPro.Examples;
+package CombinedCyclePowerPlant "Models of a combined cycle power plant"
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This package contains two models of the same combined cycle power plant are provided to simulate two different transients:</p>
+<ul>
+<li>CombinedCycle_Load_100_50, to simulate a load decrease from 100&percnt; to 50&percnt;</li>
+<li>CombinedCycle_TripTAC, to simulate a full combustion turbine trip</li></p>
+</ul>
+<p>The two models are documented in two conference papers, <a href=\"http://www.ep.liu.se/ecp/063/040/ecp11063040.pdf\">1</a> and <a href=\"http://www.ep.liu.se/ecp/132/046/ecp17132407.pdf\">2</a>. </h4>
+</html>"));
+end CombinedCyclePowerPlant;
diff --git a/ThermoSysPro/Examples/CombinedCyclePowerPlant/package.order b/ThermoSysPro/Examples/CombinedCyclePowerPlant/package.order
index f8e7ec90f1602f7f0ec38b357e0f42bee857783b..0a7c22d5226c090bb0c9402ad947d16f3356b607 100644
--- a/ThermoSysPro/Examples/CombinedCyclePowerPlant/package.order
+++ b/ThermoSysPro/Examples/CombinedCyclePowerPlant/package.order
@@ -1,2 +1,2 @@
-CombinedCycle_Load_100_50
-CombinedCycle_TripTAC
+CombinedCycle_Load_100_50
+CombinedCycle_TripTAC
diff --git a/ThermoSysPro/Examples/Control/Condenser_LevelControl.mo b/ThermoSysPro/Examples/Control/Condenser_LevelControl.mo
index 9b7048c99b4585cc2237b4bef002b5962cd5e634..29049f9528f505b1dc4bcf547a9673e3c315a0e3 100644
--- a/ThermoSysPro/Examples/Control/Condenser_LevelControl.mo
+++ b/ThermoSysPro/Examples/Control/Condenser_LevelControl.mo
@@ -1,152 +1,152 @@
-within ThermoSysPro.Examples.Control;
-model Condenser_LevelControl "Condenser level control"
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitVapeur
-    annotation (Placement(transformation(extent={{-109,-94},{-99,-84}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitEau
-    annotation (Placement(transformation(extent={{-110.5,-34.5},{-100.5,-24.5}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,25},{-100,35}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=+1, k2=-1)
-                                          annotation (Placement(transformation(
-          extent={{63,65},{88,91}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    ureset0=0,
-    Ti=10,
-    k=10)
-    annotation (Placement(transformation(
-        origin={76,-78},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add1(
-                             k1=+1, k2=+1)
-                                          annotation (Placement(transformation(
-        origin={-29,-65},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat1(
-    permanent=false,
-    k=1,
-    Ti=10,
-    ureset0(fixed=true) = 0.8)
-    annotation (Placement(transformation(
-        origin={-63,-65},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true, U0=1.05)
-    annotation (Placement(transformation(extent={{31,71},{51,91}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_2(                              permanent=true, U0=1.05)
-    annotation (Placement(transformation(
-        origin={-17,13},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_3(                              permanent=true, U0=1.05)
-    annotation (Placement(transformation(
-        origin={15,13},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add2(
-                            k1=+1, k2=-1) annotation (Placement(transformation(
-        origin={-11,-29},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Edge edge annotation (Placement(
-        transformation(extent={{-50,-40},{-40,-30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon
-    annotation (Placement(transformation(extent={{-76,-11},{-66,-1}}, rotation=
-            0)));
-equation
-  connect(pIsat.u,add. y) annotation (Line(points={{87,-78},{89,-78},{89,78},{
-          89.25,78}}));
-  connect(pIsat1.u,add1. y) annotation (Line(points={{-52,-65},{-40,-65}}));
-  connect(pT1_1.y,add. u1) annotation (Line(points={{52,81},{57,81},{57,85.8},{
-          61.75,85.8}}));
-  connect(pT1_2.y,add2. u2) annotation (Line(points={{-17,2},{-17,-8},{-17,-8},
-          {-17,-18}}));
-  connect(pT1_3.y,add2. u1)
-    annotation (Line(points={{15,2},{15,-7},{-5,-7},{-5,-18}}));
-  connect(pIsat.y,add1. u1) annotation (Line(points={{65,-78},{19,-78},{19,-71},
-          {-18,-71}}));
-  connect(pIsat1.y, SortieReelle1) annotation (Line(points={{-74,-65},{-79,-65},
-          {-79,-90},{105,-90}}, color={255,0,0}));
-  connect(MesureDebitVapeur, pT1_3.u) annotation (Line(points={{-104,-89},{-91,
-          -89},{-91,-40},{-64,-40},{-64,29},{15,29},{15,24}}, color={255,0,0}));
-  connect(MesureDebitEau, pT1_2.u)
-    annotation (Line(points={{-105.5,-29.5},{-79,-29.5},{-79,37},{-17,37},{-17,
-          24}}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,81},{30,81}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,30},{-93,30},
-          {-93,50},{55,50},{55,70.2},{61.75,70.2}}, color={127,0,0}));
-  connect(add2.y, add1.u2) annotation (Line(points={{-11,-40},{-11,-59},{-18,
-          -59}}));
-  connect(echelon.yL, edge.uL)
-    annotation (Line(points={{-65.5,-6},{-60,-6},{-60,-35},{-50.5,-35}}));
-  connect(edge.yL, pIsat1.reset)
-    annotation (Line(points={{-39.5,-35},{-31,-35},{-31,-46},{-62,-46},{-62,-54}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-117,102},{-79,94}},
-          lineColor={127,0,0},
-          textString="Level"),
-        Text(
-          extent={{-109,56},{-65,28}},
-          lineColor={127,0,0},
-          textString="Level Set point"),
-        Text(
-          extent={{-112,-15},{-63,-30}},
-          lineColor={127,0,0},
-          textString="Water MassFlowrate"),
-        Text(
-          extent={{-109,-89},{-57,-106}},
-          lineColor={127,0,0},
-          textString="Vapour Mass Flowrate"),
-        Text(
-          extent={{62,-93},{100,-101}},
-          lineColor={127,0,0},
-          textString="Valve opening")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-44.5,41.5},{42,-3}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Regulation"),
-        Text(
-          extent={{-29,-5},{20,-38}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Condenser"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}));
-end Condenser_LevelControl;
+within ThermoSysPro.Examples.Control;
+model Condenser_LevelControl "Condenser level control"
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitVapeur
+    annotation (Placement(transformation(extent={{-109,-94},{-99,-84}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitEau
+    annotation (Placement(transformation(extent={{-110.5,-34.5},{-100.5,-24.5}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,25},{-100,35}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=+1, k2=-1)
+                                          annotation (Placement(transformation(
+          extent={{63,65},{88,91}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    ureset0=0,
+    Ti=10,
+    k=10)
+    annotation (Placement(transformation(
+        origin={76,-78},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add1(
+                             k1=+1, k2=+1)
+                                          annotation (Placement(transformation(
+        origin={-29,-65},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat1(
+    permanent=false,
+    k=1,
+    Ti=10,
+    ureset0(fixed=true) = 0.8)
+    annotation (Placement(transformation(
+        origin={-63,-65},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true, U0=1.05)
+    annotation (Placement(transformation(extent={{31,71},{51,91}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_2(                              permanent=true, U0=1.05)
+    annotation (Placement(transformation(
+        origin={-17,13},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_3(                              permanent=true, U0=1.05)
+    annotation (Placement(transformation(
+        origin={15,13},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add2(
+                            k1=+1, k2=-1) annotation (Placement(transformation(
+        origin={-11,-29},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Edge edge annotation (Placement(
+        transformation(extent={{-50,-40},{-40,-30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon
+    annotation (Placement(transformation(extent={{-76,-11},{-66,-1}}, rotation=
+            0)));
+equation
+  connect(pIsat.u,add. y) annotation (Line(points={{87,-78},{89,-78},{89,78},{
+          89.25,78}}));
+  connect(pIsat1.u,add1. y) annotation (Line(points={{-52,-65},{-40,-65}}));
+  connect(pT1_1.y,add. u1) annotation (Line(points={{52,81},{57,81},{57,85.8},{
+          61.75,85.8}}));
+  connect(pT1_2.y,add2. u2) annotation (Line(points={{-17,2},{-17,-8},{-17,-8},
+          {-17,-18}}));
+  connect(pT1_3.y,add2. u1)
+    annotation (Line(points={{15,2},{15,-7},{-5,-7},{-5,-18}}));
+  connect(pIsat.y,add1. u1) annotation (Line(points={{65,-78},{19,-78},{19,-71},
+          {-18,-71}}));
+  connect(pIsat1.y, SortieReelle1) annotation (Line(points={{-74,-65},{-79,-65},
+          {-79,-90},{105,-90}}, color={255,0,0}));
+  connect(MesureDebitVapeur, pT1_3.u) annotation (Line(points={{-104,-89},{-91,
+          -89},{-91,-40},{-64,-40},{-64,29},{15,29},{15,24}}, color={255,0,0}));
+  connect(MesureDebitEau, pT1_2.u)
+    annotation (Line(points={{-105.5,-29.5},{-79,-29.5},{-79,37},{-17,37},{-17,
+          24}}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,81},{30,81}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,30},{-93,30},
+          {-93,50},{55,50},{55,70.2},{61.75,70.2}}, color={127,0,0}));
+  connect(add2.y, add1.u2) annotation (Line(points={{-11,-40},{-11,-59},{-18,
+          -59}}));
+  connect(echelon.yL, edge.uL)
+    annotation (Line(points={{-65.5,-6},{-60,-6},{-60,-35},{-50.5,-35}}));
+  connect(edge.yL, pIsat1.reset)
+    annotation (Line(points={{-39.5,-35},{-31,-35},{-31,-46},{-62,-46},{-62,-54}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-117,102},{-79,94}},
+          lineColor={127,0,0},
+          textString="Level"),
+        Text(
+          extent={{-109,56},{-65,28}},
+          lineColor={127,0,0},
+          textString="Level Set point"),
+        Text(
+          extent={{-112,-15},{-63,-30}},
+          lineColor={127,0,0},
+          textString="Water MassFlowrate"),
+        Text(
+          extent={{-109,-89},{-57,-106}},
+          lineColor={127,0,0},
+          textString="Vapour Mass Flowrate"),
+        Text(
+          extent={{62,-93},{100,-101}},
+          lineColor={127,0,0},
+          textString="Valve opening")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-44.5,41.5},{42,-3}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Regulation"),
+        Text(
+          extent={{-29,-5},{20,-38}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Condenser"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}));
+end Condenser_LevelControl;
diff --git a/ThermoSysPro/Examples/Control/Condenser_LevelControl_RE5.mo b/ThermoSysPro/Examples/Control/Condenser_LevelControl_RE5.mo
index d306a4f45551904d7d4afb96d00c65116b6f737c..02018605503b0156a83971f0b1ea587016859a77 100644
--- a/ThermoSysPro/Examples/Control/Condenser_LevelControl_RE5.mo
+++ b/ThermoSysPro/Examples/Control/Condenser_LevelControl_RE5.mo
@@ -1,113 +1,113 @@
-within ThermoSysPro.Examples.Control;
-model Condenser_LevelControl_RE5 "Condenser level control"
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitVapeur
-    annotation (Placement(transformation(extent={{-109,-94},{-99,-84}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitEau
-    annotation (Placement(transformation(extent={{-110.5,-34.5},{-100.5,-24.5}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,25},{-100,35}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=+1, k2=-1)
-                                          annotation (Placement(transformation(
-          extent={{63,65},{88,91}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat1(
-    minval=0.00010,
-    k=100,
-    Ti=10,
-    permanent=false,
-    ureset0(fixed=true) = 0.3)
-    annotation (Placement(transformation(
-        origin={-63,-66},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true, U0=0.43,
-    k=1,
-    Ti=1)
-    annotation (Placement(transformation(extent={{31,71},{51,91}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Edge edge annotation (Placement(
-        transformation(extent={{-50,-40},{-40,-30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon
-    annotation (Placement(transformation(extent={{-76,-11},{-66,-1}}, rotation=
-            0)));
-equation
-  connect(pT1_1.y,add. u1) annotation (Line(points={{52,81},{57,81},{57,85.8},{
-          61.75,85.8}}));
-  connect(pIsat1.y, SortieReelle1) annotation (Line(points={{-74,-66},{-79,-66},
-          {-79,-90},{105,-90}}, color={255,0,0}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,81},{30,81}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,30},{-93,30},
-          {-93,50},{55,50},{55,70.2},{61.75,70.2}}, color={127,0,0}));
-  connect(echelon.yL, edge.uL)
-    annotation (Line(points={{-65.5,-6},{-60,-6},{-60,-35},{-50.5,-35}}));
-  connect(edge.yL, pIsat1.reset)
-    annotation (Line(points={{-39.5,-35},{-31,-35},{-31,-46},{-62,-46},{-62,-55}}));
-  connect(add.y, pIsat1.u)
-    annotation (Line(points={{89.25,78},{93,78},{93,-66},{-52,-66}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-99,58},{-53,26}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{-103,-21},{-65,-29}},
-          lineColor={127,0,0},
-          textString=
-               "Debit Eau"),
-        Text(
-          extent={{-99,-92},{-61,-100}},
-          lineColor={127,0,0},
-          textString=
-               "Debit Vapeur"),
-        Text(
-          extent={{64,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-58,62},{58,-1}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Regulation
- Niveau "),
-        Text(
-          extent={{-33,-23},{33,-61}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Ballon")}));
-end Condenser_LevelControl_RE5;
+within ThermoSysPro.Examples.Control;
+model Condenser_LevelControl_RE5 "Condenser level control"
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitVapeur
+    annotation (Placement(transformation(extent={{-109,-94},{-99,-84}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitEau
+    annotation (Placement(transformation(extent={{-110.5,-34.5},{-100.5,-24.5}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,25},{-100,35}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=+1, k2=-1)
+                                          annotation (Placement(transformation(
+          extent={{63,65},{88,91}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat1(
+    minval=0.00010,
+    k=100,
+    Ti=10,
+    permanent=false,
+    ureset0(fixed=true) = 0.3)
+    annotation (Placement(transformation(
+        origin={-63,-66},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true, U0=0.43,
+    k=1,
+    Ti=1)
+    annotation (Placement(transformation(extent={{31,71},{51,91}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Edge edge annotation (Placement(
+        transformation(extent={{-50,-40},{-40,-30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon
+    annotation (Placement(transformation(extent={{-76,-11},{-66,-1}}, rotation=
+            0)));
+equation
+  connect(pT1_1.y,add. u1) annotation (Line(points={{52,81},{57,81},{57,85.8},{
+          61.75,85.8}}));
+  connect(pIsat1.y, SortieReelle1) annotation (Line(points={{-74,-66},{-79,-66},
+          {-79,-90},{105,-90}}, color={255,0,0}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,81},{30,81}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,30},{-93,30},
+          {-93,50},{55,50},{55,70.2},{61.75,70.2}}, color={127,0,0}));
+  connect(echelon.yL, edge.uL)
+    annotation (Line(points={{-65.5,-6},{-60,-6},{-60,-35},{-50.5,-35}}));
+  connect(edge.yL, pIsat1.reset)
+    annotation (Line(points={{-39.5,-35},{-31,-35},{-31,-46},{-62,-46},{-62,-55}}));
+  connect(add.y, pIsat1.u)
+    annotation (Line(points={{89.25,78},{93,78},{93,-66},{-52,-66}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-99,58},{-53,26}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{-103,-21},{-65,-29}},
+          lineColor={127,0,0},
+          textString=
+               "Debit Eau"),
+        Text(
+          extent={{-99,-92},{-61,-100}},
+          lineColor={127,0,0},
+          textString=
+               "Debit Vapeur"),
+        Text(
+          extent={{64,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-58,62},{58,-1}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Regulation
+ Niveau "),
+        Text(
+          extent={{-33,-23},{33,-61}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Ballon")}));
+end Condenser_LevelControl_RE5;
diff --git a/ThermoSysPro/Examples/Control/Drum_LevelControl.mo b/ThermoSysPro/Examples/Control/Drum_LevelControl.mo
index 76dd880e6c59d1345811703b9c452b4375708744..235a3a624ab870ab362a6f4f76ae25cb9f65e29d 100644
--- a/ThermoSysPro/Examples/Control/Drum_LevelControl.mo
+++ b/ThermoSysPro/Examples/Control/Drum_LevelControl.mo
@@ -1,80 +1,80 @@
-within ThermoSysPro.Examples.Control;
-model Drum_LevelControl "Drum level control"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=0.01 "Minimum output value";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    ureset0=0.8,
-    k=k,
-    Ti=Ti,
-    minval=minval)
-    annotation (Placement(transformation(
-        origin={-10,-56.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    U0=1.1,
-    Ti=10)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{48,53},{83,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-103,102},{-62,91}},
-          lineColor={127,0,0},
-          textString="Measure"),
-        Text(
-          extent={{-99,-48},{-48.5,-88}},
-          lineColor={127,0,0},
-          textString="Level Set point"),
-        Text(
-          extent={{62,-93},{100,-101}},
-          lineColor={127,0,0},
-          textString="Valve opening")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={127,127,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-35.5,15.5},{29,-14}},
-          lineColor={255,0,0},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Regulation")}));
-end Drum_LevelControl;
+within ThermoSysPro.Examples.Control;
+model Drum_LevelControl "Drum level control"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=0.01 "Minimum output value";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    ureset0=0.8,
+    k=k,
+    Ti=Ti,
+    minval=minval)
+    annotation (Placement(transformation(
+        origin={-10,-56.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    U0=1.1,
+    Ti=10)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{48,53},{83,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-103,102},{-62,91}},
+          lineColor={127,0,0},
+          textString="Measure"),
+        Text(
+          extent={{-99,-48},{-48.5,-88}},
+          lineColor={127,0,0},
+          textString="Level Set point"),
+        Text(
+          extent={{62,-93},{100,-101}},
+          lineColor={127,0,0},
+          textString="Valve opening")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={127,127,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-35.5,15.5},{29,-14}},
+          lineColor={255,0,0},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Regulation")}));
+end Drum_LevelControl;
diff --git a/ThermoSysPro/Examples/Control/LevelControl.mo b/ThermoSysPro/Examples/Control/LevelControl.mo
index b133e55d26be3a13449015a1e9f9dc7d26cd97c8..26e44ba1a8f0449892723fae91414d211320a522 100644
--- a/ThermoSysPro/Examples/Control/LevelControl.mo
+++ b/ThermoSysPro/Examples/Control/LevelControl.mo
@@ -1,104 +1,104 @@
-within ThermoSysPro.Examples.Control;
-model LevelControl "Level control"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=0.01 "Minimum output value";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    ureset0=0.8,
-    k=k,
-    Ti=Ti,
-    minval=minval)
-    annotation (Placement(transformation(
-        origin={-10,-56.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    U0=1.1,
-    Ti=10)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{49,53},{84,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{47.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{47.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{85.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-59},{-55,-91}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={127,127,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,50},{78,8}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Level"),
-        Text(
-          extent={{-98,93},{-60,85}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-31},{-52,-64}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne"),
-        Text(
-          extent={{-70,-11},{63,-48}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Control")}));
-end LevelControl;
+within ThermoSysPro.Examples.Control;
+model LevelControl "Level control"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=0.01 "Minimum output value";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    ureset0=0.8,
+    k=k,
+    Ti=Ti,
+    minval=minval)
+    annotation (Placement(transformation(
+        origin={-10,-56.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    U0=1.1,
+    Ti=10)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{49,53},{84,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{47.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{47.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{85.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-59},{-55,-91}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={127,127,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,50},{78,8}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Level"),
+        Text(
+          extent={{-98,93},{-60,85}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-31},{-52,-64}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne"),
+        Text(
+          extent={{-70,-11},{63,-48}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Control")}));
+end LevelControl;
diff --git a/ThermoSysPro/Examples/Control/MassFlowControl.mo b/ThermoSysPro/Examples/Control/MassFlowControl.mo
index df0d962c4c7661b961814a43e7394c94ac33b54b..9d1aca3a0d94ab6a29eff2bd284cc7f32496bbe5 100644
--- a/ThermoSysPro/Examples/Control/MassFlowControl.mo
+++ b/ThermoSysPro/Examples/Control/MassFlowControl.mo
@@ -1,108 +1,108 @@
-within ThermoSysPro.Examples.Control;
-model MassFlowControl "Pump_MassFlowControl"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=200 "Minimum Speed";
-  parameter Real maxval=2000 "Maximale Speed";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Mesure_Q_water
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Consigne_Q_water
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    k=k,
-    Ti=Ti,
-    ureset0=1400,
-    maxval=maxval,
-    minval=minval)
-    annotation (Placement(transformation(
-        origin={-10,-56.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    U0=600,
-    Ti=10)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{48,53},{83,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(Mesure_Q_water, pT1_1.u)  annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(Consigne_Q_water, add.u2)  annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
-  annotation (
-    Diagram(
-      coordinateSystem(preserveAspectRatio=false,extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1),
-      graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString=
-               "Debit"),
-        Text(
-          extent={{-101,-59},{-55,-91}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne debit"),
-        Text(
-          extent={{64,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString=
-               "Vitesse")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={170,255,213},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-88,65},{74,-26}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Régulation Niveau "),
-        Text(
-          extent={{-41,-9},{38,-58}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Bache"),
-        Text(
-          extent={{-98,93},{-60,85}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-31},{-52,-64}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}));
-end MassFlowControl;
+within ThermoSysPro.Examples.Control;
+model MassFlowControl "Pump_MassFlowControl"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=200 "Minimum Speed";
+  parameter Real maxval=2000 "Maximale Speed";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Mesure_Q_water
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Consigne_Q_water
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    k=k,
+    Ti=Ti,
+    ureset0=1400,
+    maxval=maxval,
+    minval=minval)
+    annotation (Placement(transformation(
+        origin={-10,-56.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    U0=600,
+    Ti=10)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{48,53},{83,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(Mesure_Q_water, pT1_1.u)  annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(Consigne_Q_water, add.u2)  annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
+  annotation (
+    Diagram(
+      coordinateSystem(preserveAspectRatio=false,extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1),
+      graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString=
+               "Debit"),
+        Text(
+          extent={{-101,-59},{-55,-91}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne debit"),
+        Text(
+          extent={{64,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString=
+               "Vitesse")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={170,255,213},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-88,65},{74,-26}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Régulation Niveau "),
+        Text(
+          extent={{-41,-9},{38,-58}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Bache"),
+        Text(
+          extent={{-98,93},{-60,85}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-31},{-52,-64}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}));
+end MassFlowControl;
diff --git a/ThermoSysPro/Examples/Control/MassFlowRateAirCoalWater.mo b/ThermoSysPro/Examples/Control/MassFlowRateAirCoalWater.mo
index 9ed4574d3edad85e2e0201781070ccbac7b6e0da..7d0e40fe39f1fca23fc408a45c3f5874ff606bb8 100644
--- a/ThermoSysPro/Examples/Control/MassFlowRateAirCoalWater.mo
+++ b/ThermoSysPro/Examples/Control/MassFlowRateAirCoalWater.mo
@@ -1,109 +1,109 @@
-within ThermoSysPro.Examples.Control;
-model MassFlowRateAirCoalWater "MassFlowRateAirCoalWater"
- // Modelica.SIunits.Power Welec
- //   "(Percent, max=100)Electrical power produced by the generator";
-  Units.SI.Power Welec(start=804.461)
-    "(MW)Electrical power produced by the generator";
-  Units.SI.MassFlowRate Qair(start=710) "Air mass flow rate";
-  Units.SI.MassFlowRate Qcoal(start=70) "Coal mass flow rate";
-  Units.SI.MassFlowRate Qwater(start=600) "Water mass flow rate";
-
-  InstrumentationAndControl.Connectors.InputReal Electrical_power_MW
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}},   rotation=-90,
-        origin={-10,96})));
-  InstrumentationAndControl.Connectors.OutputReal Q_air
-                              annotation (Placement(transformation(
-        origin={110,-9},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  InstrumentationAndControl.Connectors.OutputReal Q_coal
-                              annotation (Placement(transformation(
-        origin={110,75},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  InstrumentationAndControl.Connectors.OutputReal Q_water
-                              annotation (Placement(transformation(
-        origin={110,-89},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-equation
-  //if (cardinality(Electrical_power_Percent) == 0) then
-  //  Electrical_power_Percent.signal = 100;
-  //end if;
-
-  if (cardinality(Electrical_power_MW) == 0) then
-    Electrical_power_MW.signal = 804.461;
-  end if;
-
-  Welec = Electrical_power_MW.signal;
-  //Qair = 45.38 + 0.8249*Welec;
-  //Qcoal = - 2.4172 + 0.0849*Welec;
-
-  Qair = 46.0 + 0.8229*Welec;
-  Qcoal = - 2.3534 + 0.0847*Welec;
-
-  //Qwater = 23.484 + 0.7166*Welec;
-  Qwater = 23.524 + 0.7166*Welec;
-
-  //Qwater = 23.523 + 0.7166*Welec;
-
-  Q_air.signal = Qair;
-  Q_coal.signal = Qcoal;
-  Q_water.signal = Qwater;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-100,86},{100,-100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-32,92},{144,56}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qcoal"),
-        Text(
-          extent={{10,-72},{96,-102}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qwater"),
-        Text(
-          extent={{30,12},{100,-26}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qair")}), Icon(graphics={
-        Rectangle(
-          extent={{-100,86},{100,-100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-34,91},{142,55}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qcoal"),
-        Text(
-          extent={{22,12},{102,-28}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qair"),
-        Text(
-          extent={{-6,-70},{98,-104}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qwater")}));
-end MassFlowRateAirCoalWater;
+within ThermoSysPro.Examples.Control;
+model MassFlowRateAirCoalWater "MassFlowRateAirCoalWater"
+ // Modelica.SIunits.Power Welec
+ //   "(Percent, max=100)Electrical power produced by the generator";
+  Units.SI.Power Welec(start=804.461)
+    "(MW)Electrical power produced by the generator";
+  Units.SI.MassFlowRate Qair(start=710) "Air mass flow rate";
+  Units.SI.MassFlowRate Qcoal(start=70) "Coal mass flow rate";
+  Units.SI.MassFlowRate Qwater(start=600) "Water mass flow rate";
+
+  InstrumentationAndControl.Connectors.InputReal Electrical_power_MW
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}},   rotation=-90,
+        origin={-10,96})));
+  InstrumentationAndControl.Connectors.OutputReal Q_air
+                              annotation (Placement(transformation(
+        origin={110,-9},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  InstrumentationAndControl.Connectors.OutputReal Q_coal
+                              annotation (Placement(transformation(
+        origin={110,75},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  InstrumentationAndControl.Connectors.OutputReal Q_water
+                              annotation (Placement(transformation(
+        origin={110,-89},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+equation
+  //if (cardinality(Electrical_power_Percent) == 0) then
+  //  Electrical_power_Percent.signal = 100;
+  //end if;
+
+  if (cardinality(Electrical_power_MW) == 0) then
+    Electrical_power_MW.signal = 804.461;
+  end if;
+
+  Welec = Electrical_power_MW.signal;
+  //Qair = 45.38 + 0.8249*Welec;
+  //Qcoal = - 2.4172 + 0.0849*Welec;
+
+  Qair = 46.0 + 0.8229*Welec;
+  Qcoal = - 2.3534 + 0.0847*Welec;
+
+  //Qwater = 23.484 + 0.7166*Welec;
+  Qwater = 23.524 + 0.7166*Welec;
+
+  //Qwater = 23.523 + 0.7166*Welec;
+
+  Q_air.signal = Qair;
+  Q_coal.signal = Qcoal;
+  Q_water.signal = Qwater;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-100,86},{100,-100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-32,92},{144,56}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qcoal"),
+        Text(
+          extent={{10,-72},{96,-102}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qwater"),
+        Text(
+          extent={{30,12},{100,-26}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qair")}), Icon(graphics={
+        Rectangle(
+          extent={{-100,86},{100,-100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-34,91},{142,55}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qcoal"),
+        Text(
+          extent={{22,12},{102,-28}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qair"),
+        Text(
+          extent={{-6,-70},{98,-104}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qwater")}));
+end MassFlowRateAirCoalWater;
diff --git a/ThermoSysPro/Examples/Control/Pump_VelocityControl.mo b/ThermoSysPro/Examples/Control/Pump_VelocityControl.mo
index 37b5b6eae2990296d24ea26d4217e9e0e764bd88..e75a96507511575d734e778d4466f0de6814a28b 100644
--- a/ThermoSysPro/Examples/Control/Pump_VelocityControl.mo
+++ b/ThermoSysPro/Examples/Control/Pump_VelocityControl.mo
@@ -1,107 +1,107 @@
-within ThermoSysPro.Examples.Control;
-model Pump_VelocityControl "Drum level control"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=0.01 "Minimum output value";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Mesure_Vrot
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Consigne_Vrot
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    k=k,
-    Ti=Ti,
-    maxval=2000,
-    minval=1000,
-    ureset0=1400)
-    annotation (Placement(transformation(
-        origin={-10,-56.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    Ti=10,
-    U0=1400)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{48,53},{83,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(Mesure_Vrot, pT1_1.u)     annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(Consigne_Vrot, add.u2)     annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
-  annotation (
-    Diagram(
-      coordinateSystem(preserveAspectRatio=false,extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1),
-      graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString=
-               "Debit"),
-        Text(
-          extent={{-101,-59},{-55,-91}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne debit"),
-        Text(
-          extent={{64,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString=
-               "Vitesse")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={170,255,213},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-88,65},{74,-26}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Régulation Niveau "),
-        Text(
-          extent={{-41,-9},{38,-58}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Bache"),
-        Text(
-          extent={{-98,93},{-60,85}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-31},{-52,-64}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}));
-end Pump_VelocityControl;
+within ThermoSysPro.Examples.Control;
+model Pump_VelocityControl "Drum level control"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=0.01 "Minimum output value";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Mesure_Vrot
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Consigne_Vrot
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    k=k,
+    Ti=Ti,
+    maxval=2000,
+    minval=1000,
+    ureset0=1400)
+    annotation (Placement(transformation(
+        origin={-10,-56.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    Ti=10,
+    U0=1400)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{48,53},{83,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(Mesure_Vrot, pT1_1.u)     annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(Consigne_Vrot, add.u2)     annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
+  annotation (
+    Diagram(
+      coordinateSystem(preserveAspectRatio=false,extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1),
+      graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString=
+               "Debit"),
+        Text(
+          extent={{-101,-59},{-55,-91}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne debit"),
+        Text(
+          extent={{64,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString=
+               "Vitesse")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={170,255,213},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-88,65},{74,-26}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Régulation Niveau "),
+        Text(
+          extent={{-41,-9},{38,-58}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Bache"),
+        Text(
+          extent={{-98,93},{-60,85}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-31},{-52,-64}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}));
+end Pump_VelocityControl;
diff --git a/ThermoSysPro/Examples/Control/TemperatureControl.mo b/ThermoSysPro/Examples/Control/TemperatureControl.mo
index d8ffb6683f89dce326858ab2032ac3dbd849b2d1..b267406371fb8011bde097bef9a264028e9b4f3a 100644
--- a/ThermoSysPro/Examples/Control/TemperatureControl.mo
+++ b/ThermoSysPro/Examples/Control/TemperatureControl.mo
@@ -1,103 +1,103 @@
-within ThermoSysPro.Examples.Control;
-model TemperatureControl "Temperature_Control"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=0.01 "Minimum output value";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    k=k,
-    Ti=Ti,
-    minval=minval,
-    ureset0=0.2)
-    annotation (Placement(transformation(
-        origin={-10,-57.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    Ti=10,
-    U0=620)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{49,53},{84,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-83.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{47.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{47.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{85.75,72.5},{96,72.5},{96,-31.65},{-10,-31.65}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=true,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString="Temperature"),
-        Text(
-          extent={{-101,-62},{-49,-86}},
-          lineColor={127,0,0},
-          textString="Temperature Set Point"),
-        Text(
-          extent={{59,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString="Valve opening")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-77,55},{85,-36}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Régulation Niveau "),
-        Text(
-          extent={{-30,-15},{49,-64}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Bache"),
-        Text(
-          extent={{-98,93},{-60,85}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-31},{-52,-64}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}));
-end TemperatureControl;
+within ThermoSysPro.Examples.Control;
+model TemperatureControl "Temperature_Control"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=0.01 "Minimum output value";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    k=k,
+    Ti=Ti,
+    minval=minval,
+    ureset0=0.2)
+    annotation (Placement(transformation(
+        origin={-10,-57.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    Ti=10,
+    U0=620)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{49,53},{84,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-83.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{47.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{47.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{85.75,72.5},{96,72.5},{96,-31.65},{-10,-31.65}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=true,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString="Temperature"),
+        Text(
+          extent={{-101,-62},{-49,-86}},
+          lineColor={127,0,0},
+          textString="Temperature Set Point"),
+        Text(
+          extent={{59,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString="Valve opening")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-77,55},{85,-36}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Régulation Niveau "),
+        Text(
+          extent={{-30,-15},{49,-64}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Bache"),
+        Text(
+          extent={{-98,93},{-60,85}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-31},{-52,-64}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}));
+end TemperatureControl;
diff --git a/ThermoSysPro/Examples/Control/package.mo b/ThermoSysPro/Examples/Control/package.mo
index b5eb4a97c22595d477a9e1fc5cda42b14cfb1eb8..fe5fb51e3649606dc9e84ae3440faa45691ec6d8 100644
--- a/ThermoSysPro/Examples/Control/package.mo
+++ b/ThermoSysPro/Examples/Control/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Examples;
-package Control "Control library for the power plant models"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p>Copyright &copy; EDF 2002 - 2019 </p>
-<p>ThermoSysPro Version 3.2 </p>
-<p>This package contains control blocks for the examples package.</h4>
-</html>"));
-end Control;
+within ThermoSysPro.Examples;
+package Control "Control library for the power plant models"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p>Copyright &copy; EDF 2002 - 2019 </p>
+<p>ThermoSysPro Version 3.2 </p>
+<p>This package contains control blocks for the examples package.</h4>
+</html>"));
+end Control;
diff --git a/ThermoSysPro/Examples/Control/package.order b/ThermoSysPro/Examples/Control/package.order
index 8bf808ecaaa4925ac44ca9e09be3492a252fd0a9..c0a6d4fba4f11ae3e89e63412560b11496a47299 100644
--- a/ThermoSysPro/Examples/Control/package.order
+++ b/ThermoSysPro/Examples/Control/package.order
@@ -1,8 +1,8 @@
-Condenser_LevelControl
-Condenser_LevelControl_RE5
-Drum_LevelControl
-LevelControl
-MassFlowControl
-MassFlowRateAirCoalWater
-Pump_VelocityControl
-TemperatureControl
+Condenser_LevelControl
+Condenser_LevelControl_RE5
+Drum_LevelControl
+LevelControl
+MassFlowControl
+MassFlowRateAirCoalWater
+Pump_VelocityControl
+TemperatureControl
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestAirHumidity.mo b/ThermoSysPro/Examples/SimpleExamples/TestAirHumidity.mo
index dc1cc7b9c107ecaa5eb6df6b8648242c6be31938..5261cd50cb43560fb6b1f7908481820f4b593d25 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestAirHumidity.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestAirHumidity.mo
@@ -1,50 +1,49 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestAirHumidity
-
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ sourceFlueGasesPQ(P0=100000,
-      T0=293) annotation (Placement(transformation(extent={{-80,0},{-60,20}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.AirHumidity airHumidity(hum0=0.9)
-    annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLoss(K=1.e-5) annotation (Placement(transformation(extent={
-            {0,0},{20,20}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink sinkFlueGases
-    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
-equation
-  connect(sourceFlueGasesPQ.C, airHumidity.C1) annotation (Line(
-      points={{-60,10},{-40,10}},
-      color={0,0,0},
-      thickness=1));
-  connect(airHumidity.C2, singularPressureLoss.C1) annotation (Line(
-      points={{-20,10},{0,10}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLoss.C2, sinkFlueGases.C) annotation (Line(
-      points={{20,10},{40.2,10}},
-      color={0,0,0},
-      thickness=1));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestAirHumidity;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestAirHumidity
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ sourceFlueGasesPQ(P0=100000,
+      T0=293) annotation (Placement(transformation(extent={{-80,0},{-60,20}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.AirHumidity airHumidity(hum0=0.9)
+    annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLoss(K=1.e-5) annotation (Placement(transformation(extent={
+            {0,0},{20,20}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink sinkFlueGases
+    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
+equation
+  connect(sourceFlueGasesPQ.C, airHumidity.C1) annotation (Line(
+      points={{-60,10},{-40,10}},
+      color={0,0,0},
+      thickness=1));
+  connect(airHumidity.C2, singularPressureLoss.C1) annotation (Line(
+      points={{-20,10},{0,10}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLoss.C2, sinkFlueGases.C) annotation (Line(
+      points={{20,10},{40.2,10}},
+      color={0,0,0},
+      thickness=1));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestAirHumidity;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestAlternatingEngine.mo b/ThermoSysPro/Examples/SimpleExamples/TestAlternatingEngine.mo
index 02ba438698febd32cf799bd7ca084d7468499a0a..82bfb7b27b9c34ce7904519c718d614c75439c87 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestAlternatingEngine.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestAlternatingEngine.mo
@@ -1,109 +1,107 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestAlternatingEngine
-
-  parameter Integer NCEL = 7;
-
-  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Hum=0,
-    Xh=0.25,
-    Xs=0,
-    Xashes=0,
-    Xc=0.75,
-    Xo=0,
-    Xn=0,
-    Q0=0.0676,
-    rho=0.744,
-    LHV=50e6,
-    T0(displayUnit="K") = 299,
-    P0=210300,
-    Vol=100)
-    annotation (Placement(transformation(extent={{-106,-81},{-72,-43}},rotation=
-           0)));
-  FlueGases.BoundaryConditions.SourcePQ sourceAir(
-    Xso2=0,
-    Xco2=0,
-    Xh2o=0.005,
-    Xo2=0.23,
-    Q0=1.9627,
-    P0=191000,
-    T0=30 + 273.16)
-    annotation (Placement(transformation(extent={{111,-79},{73,-45}},rotation=0)));
-  FlueGases.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{0,44},{44,86}},  rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ SourcePQ_Water(
-    Q0=15.3,
-    h0=334.41e3,
-    P0=410000)
-    annotation (Placement(transformation(extent={{-107,-17},{-71,17}},rotation=
-            0)));
-  MultiFluids.Machines.AlternatingEngine alternatingEngine(
-    mechanical_efficiency_type=2,
-    Rmeca_nom=0.41,
-    Coef_Rm_a=-5.4727e-9,
-    Coef_Rm_b=4.9359e-5,
-    Coef_Rm_c=0.30814,
-    Xpth=0.05,
-    MMg=20,
-    DPe=1,
-    RV=6.45,
-    Kc=1.28,
-    Kd=1.33,
-    Wmeca(start=1400e3),
-    Welec(start=1358e3),
-    Wcomb(start=3.4942e6),
-    exc(start=1.8),
-    Gamma=1.2085,
-    Tsf(start=1088.15))
-    annotation (Placement(transformation(extent={{-44,-46},{44,42}})));
-  WaterSteam.BoundaryConditions.Sink Sink_Water1 annotation (Placement(
-        transformation(extent={{75,-19},{111,15}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss
-    annotation (Placement(transformation(extent={{-63,-6},{-51,6}})));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1
-    annotation (Placement(transformation(extent={{51,-9},{65,5}})));
-equation
-  connect(alternatingEngine.Cair, sourceAir.C) annotation (Line(
-      points={{17.6,-41.6},{17.6,-62},{73,-62}},
-      color={0,0,0},
-      thickness=1));
-  connect(alternatingEngine.Cfuel, fuelSourcePQ.C) annotation (Line(points={{-17.6,
-          -41.6},{-17.6,-62},{-72,-62}}, color={0,0,0}));
-  connect(SourcePQ_Water.C, singularPressureLoss.C1)
-    annotation (Line(points={{-71,0},{-63,0}}, color={0,0,255}));
-  connect(alternatingEngine.Cws1, singularPressureLoss.C2) annotation (Line(
-        points={{-39.6,-2},{-40.8,-2},{-40.8,0},{-51,0}}, color={0,0,255}));
-  connect(alternatingEngine.Cws2, singularPressureLoss1.C1)
-    annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255}));
-  connect(Sink_Water1.C, singularPressureLoss1.C2)
-    annotation (Line(points={{75,-2},{75,-2},{65,-2}}, color={0,0,255}));
-  connect(alternatingEngine.Cfg, sink.C) annotation (Line(
-      points={{0,37.6},{0,65},{0.44,65}},
-      color={0,0,0},
-      thickness=1));
-  annotation (         Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestAlternatingEngine;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestAlternatingEngine
+  parameter Integer NCEL = 7;
+  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Hum=0,
+    Xh=0.25,
+    Xs=0,
+    Xashes=0,
+    Xc=0.75,
+    Xo=0,
+    Xn=0,
+    Q0=0.0676,
+    rho=0.744,
+    LHV=50e6,
+    T0(displayUnit="K") = 299,
+    P0=210300,
+    Vol=100)
+    annotation (Placement(transformation(extent={{-106,-81},{-72,-43}},rotation=
+           0)));
+  FlueGases.BoundaryConditions.SourcePQ sourceAir(
+    Xso2=0,
+    Xco2=0,
+    Xh2o=0.005,
+    Xo2=0.23,
+    Q0=1.9627,
+    P0=191000,
+    T0=30 + 273.16)
+    annotation (Placement(transformation(extent={{111,-79},{73,-45}},rotation=0)));
+  FlueGases.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{0,44},{44,86}},  rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ SourcePQ_Water(
+    Q0=15.3,
+    h0=334.41e3,
+    P0=410000)
+    annotation (Placement(transformation(extent={{-107,-17},{-71,17}},rotation=
+            0)));
+  MultiFluids.Machines.AlternatingEngine alternatingEngine(
+    mechanical_efficiency_type=2,
+    Rmeca_nom=0.41,
+    Coef_Rm_a=-5.4727e-9,
+    Coef_Rm_b=4.9359e-5,
+    Coef_Rm_c=0.30814,
+    Xpth=0.05,
+    MMg=20,
+    DPe=1,
+    RV=6.45,
+    Kc=1.28,
+    Kd=1.33,
+    Wmeca(start=1400e3),
+    Welec(start=1358e3),
+    Wcomb(start=3.4942e6),
+    exc(start=1.8),
+    Gamma=1.2085,
+    Tsf(start=1088.15))
+    annotation (Placement(transformation(extent={{-44,-46},{44,42}})));
+  WaterSteam.BoundaryConditions.Sink Sink_Water1 annotation (Placement(
+        transformation(extent={{75,-19},{111,15}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss
+    annotation (Placement(transformation(extent={{-63,-6},{-51,6}})));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1
+    annotation (Placement(transformation(extent={{51,-9},{65,5}})));
+equation
+  connect(alternatingEngine.Cair, sourceAir.C) annotation (Line(
+      points={{17.6,-41.6},{17.6,-62},{73,-62}},
+      color={0,0,0},
+      thickness=1));
+  connect(alternatingEngine.Cfuel, fuelSourcePQ.C) annotation (Line(points={{-17.6,
+          -41.6},{-17.6,-62},{-72,-62}}, color={0,0,0}));
+  connect(SourcePQ_Water.C, singularPressureLoss.C1)
+    annotation (Line(points={{-71,0},{-63,0}}, color={0,0,255}));
+  connect(alternatingEngine.Cws1, singularPressureLoss.C2) annotation (Line(
+        points={{-39.6,-2},{-40.8,-2},{-40.8,0},{-51,0}}, color={0,0,255}));
+  connect(alternatingEngine.Cws2, singularPressureLoss1.C1)
+    annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255}));
+  connect(Sink_Water1.C, singularPressureLoss1.C2)
+    annotation (Line(points={{75,-2},{75,-2},{65,-2}}, color={0,0,255}));
+  connect(alternatingEngine.Cfg, sink.C) annotation (Line(
+      points={{0,37.6},{0,65},{0.44,65}},
+      color={0,0,0},
+      thickness=1));
+  annotation (         Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestAlternatingEngine;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestBend.mo b/ThermoSysPro/Examples/SimpleExamples/TestBend.mo
index b06bba7ab403caacbac98ca1916f57a81e389e07..1f28617f369eadeaaa1d2f981e714328bdd87b52 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestBend.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestBend.mo
@@ -1,49 +1,48 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestBend
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-100,26},{-80,46}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP SinkP1
-                                          annotation (Placement(transformation(
-          extent={{60,0},{80,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.Bend Bend   annotation (Placement(
-        transformation(extent={{-20,26},{0,46}}, rotation=0)));
-equation
-  connect(Bend.C2, SinkP1.C)
-    annotation (Line(points={{-10,26},{-10,10},{60,10}}, color={0,0,255}));
-  connect(SourceP1.C, Bend.C1)
-    annotation (Line(points={{-80,36},{-20,36}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestBend;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestBend
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-100,26},{-80,46}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP SinkP1
+                                          annotation (Placement(transformation(
+          extent={{60,0},{80,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.Bend Bend   annotation (Placement(
+        transformation(extent={{-20,26},{0,46}}, rotation=0)));
+equation
+  connect(Bend.C2, SinkP1.C)
+    annotation (Line(points={{-10,26},{-10,10},{60,10}}, color={0,0,255}));
+  connect(SourceP1.C, Bend.C1)
+    annotation (Line(points={{-80,36},{-20,36}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestBend;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump.mo
index a50bfa12d56181dec997628be1eff7878c2b0182..f36313ad4b71c6a7302ac322186ae376ac98d80f 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump.mo
@@ -1,79 +1,78 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump1(mode_car_Cr=
-       2, mode_car_hn=1,
-    mode_car=1,
-    Pm(start=262606),
-    Qv_a(start=0.79311),
-    Q(start=791.06))
-    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
-                                        ze2=10, zs2=10,
-    P(start=248019))
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1(
-    Cv(start=0.79311),
-    Q(start=791.06),
-    C2(P(start=228573)),
-    Pm(start=262593))
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
-                                                  k=0.5) annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    width=200,
-    period=500,
-    amplitude=1400,
-    offset=0)   annotation (Placement(transformation(extent={{-100,-60},{-80,
-            -40}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
-    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-60},
-            {-40,-40}}, rotation=0)));
-equation
-  connect(centrifugalPump1.C2, Bache1.Ce2)
-    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
-          255}));
-  connect(Bache1.Cs2, VanneReglante1.C1)
-    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
-  connect(VanneReglante1.C2, centrifugalPump1.C1)
-    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
-  connect(Constante1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
-  connect(pulse.y, sourceAngularVelocity.IAngularVelocity)
-    annotation (Line(points={{-79,-50},{-55,-50}}));
-  connect(centrifugalPump1.M, sourceAngularVelocity.M)
-    annotation (Line(points={{-10,-41},{-10,-50},{-39,-50}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump1(mode_car_Cr=
+       2, mode_car_hn=1,
+    mode_car=1,
+    Pm(start=262606),
+    Qv_a(start=0.79311),
+    Q(start=791.06))
+    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
+                                        ze2=10, zs2=10,
+    P(start=248019))
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1(
+    Cv(start=0.79311),
+    Q(start=791.06),
+    C2(P(start=228573)),
+    Pm(start=262593))
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
+                                                  k=0.5) annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    width=200,
+    period=500,
+    amplitude=1400,
+    offset=0)   annotation (Placement(transformation(extent={{-100,-60},{-80,
+            -40}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
+    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-60},
+            {-40,-40}}, rotation=0)));
+equation
+  connect(centrifugalPump1.C2, Bache1.Ce2)
+    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
+          255}));
+  connect(Bache1.Cs2, VanneReglante1.C1)
+    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
+  connect(VanneReglante1.C2, centrifugalPump1.C1)
+    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
+  connect(Constante1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
+  connect(pulse.y, sourceAngularVelocity.IAngularVelocity)
+    annotation (Line(points={{-79,-50},{-55,-50}}));
+  connect(centrifugalPump1.M, sourceAngularVelocity.M)
+    annotation (Line(points={{-10,-41},{-10,-50},{-39,-50}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump1.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump1.mo
index 0bb9de12cf78c35883085cb8026550dc93a02215..d6b34acc4fc9b70763103bf023a20680d47b1fc3 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump1.mo
@@ -1,87 +1,86 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump1
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    mode_car=1,
-    mode_car_hn=1,
-    mode_car_Cr=1,
-    dynamic_mech_equation=false)
-                     annotation (Placement(transformation(extent={{-20,20},{0,
-            40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=10,
-    Duration=100,
-    Initialvalue=1400,
-    Finalvalue=0) annotation (Placement(transformation(extent={{-100,-20},{-80,
-            0}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
-    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-20},
-            {-40,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ1(
-                                                               Q0=0)
-    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump1(
-    mode_car=1,
-    mode_car_hn=1,
-    mode_car_Cr=1)   annotation (Placement(transformation(extent={{-20,-60},{0,
-            -40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink1
-    annotation (Placement(transformation(extent={{40,-60},{60,-40}}, rotation=0)));
-equation
-  connect(sourcePQ.C, centrifugalPump.C1)
-    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sink.C)
-    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
-  connect(sourceAngularVelocity.M, centrifugalPump.M)
-    annotation (Line(points={{-39,-10},{-10,-10},{-10,19}}));
-  connect(sourcePQ1.C, centrifugalPump1.C1)
-    annotation (Line(points={{-60,-50},{-20,-50}}, color={0,0,255}));
-  connect(centrifugalPump1.C2, sink1.C)
-    annotation (Line(points={{0,-50},{40,-50}}, color={0,0,255}));
-  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
-    annotation (Line(points={{-79,-10},{-55,-10}}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-100,100},{-60,80}},
-          lineColor={0,0,255},
-          textString=
-               "w=1 ==> w=0"),
-        Text(
-          extent={{-100,80},{-60,60}},
-          lineColor={0,0,255},
-          textString=
-               "q=0"),
-        Text(
-          extent={{-100,60},{-60,40}},
-          lineColor={0,0,255},
-          textString=
-               "theta=0 ==> theta=-180")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump1
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    mode_car=1,
+    mode_car_hn=1,
+    mode_car_Cr=1,
+    dynamic_mech_equation=false)
+                     annotation (Placement(transformation(extent={{-20,20},{0,
+            40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=10,
+    Duration=100,
+    Initialvalue=1400,
+    Finalvalue=0) annotation (Placement(transformation(extent={{-100,-20},{-80,
+            0}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
+    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-20},
+            {-40,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ1(
+                                                               Q0=0)
+    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump1(
+    mode_car=1,
+    mode_car_hn=1,
+    mode_car_Cr=1)   annotation (Placement(transformation(extent={{-20,-60},{0,
+            -40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink1
+    annotation (Placement(transformation(extent={{40,-60},{60,-40}}, rotation=0)));
+equation
+  connect(sourcePQ.C, centrifugalPump.C1)
+    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sink.C)
+    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
+  connect(sourceAngularVelocity.M, centrifugalPump.M)
+    annotation (Line(points={{-39,-10},{-10,-10},{-10,19}}));
+  connect(sourcePQ1.C, centrifugalPump1.C1)
+    annotation (Line(points={{-60,-50},{-20,-50}}, color={0,0,255}));
+  connect(centrifugalPump1.C2, sink1.C)
+    annotation (Line(points={{0,-50},{40,-50}}, color={0,0,255}));
+  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
+    annotation (Line(points={{-79,-10},{-55,-10}}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-100,100},{-60,80}},
+          lineColor={0,0,255},
+          textString=
+               "w=1 ==> w=0"),
+        Text(
+          extent={{-100,80},{-60,60}},
+          lineColor={0,0,255},
+          textString=
+               "q=0"),
+        Text(
+          extent={{-100,60},{-60,40}},
+          lineColor={0,0,255},
+          textString=
+               "theta=0 ==> theta=-180")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump10.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump10.mo
index 74308ec5892c678624c59936d2804ec6263bf80c..893114c9848008052a07880c55241828a7f553fe 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump10.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump10.mo
@@ -1,72 +1,71 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump10
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    continuous_flow_reversal=false,
-    hn_nom_p=10,
-    mode_car_hn=2,
-    mode_car_Cr=2,
-    mode_car=2)
-    annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=300000)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=100,
-    Starttime=100,
-    Initialvalue=400000,
-    Finalvalue=600000)                         annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump centrifugalPump1(
-    continuous_flow_reversal=false, b3=0)
-    annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-                                                             P0=300000)
-    annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{60,-60},{80,-40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
-    Duration=100,
-    Starttime=100,
-    Initialvalue=400000,
-    Finalvalue=600000)                         annotation (Placement(
-        transformation(extent={{0,-20},{20,0}}, rotation=0)));
-equation
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{-40,30},{0,30}}, color={0,0,255}));
-  connect(rampe2.y, sinkP.IPressure)
-    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
-  connect(centrifugalPump.C2, sinkP.C)
-    annotation (Line(points={{20,30},{60,30}}, color={0,0,255}));
-  connect(sourceP1.C, centrifugalPump1.C1)
-    annotation (Line(points={{-40,-50},{0,-50}}, color={0,0,255}));
-  connect(rampe1.y, sinkP1.IPressure)
-    annotation (Line(points={{21,-10},{80,-10},{80,-50},{75,-50}}));
-  connect(centrifugalPump1.C2, sinkP1.C)
-    annotation (Line(points={{20,-50},{60,-50}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump10;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump10
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    continuous_flow_reversal=false,
+    hn_nom_p=10,
+    mode_car_hn=2,
+    mode_car_Cr=2,
+    mode_car=2)
+    annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=300000)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=100,
+    Starttime=100,
+    Initialvalue=400000,
+    Finalvalue=600000)                         annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump centrifugalPump1(
+    continuous_flow_reversal=false, b3=0)
+    annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+                                                             P0=300000)
+    annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{60,-60},{80,-40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
+    Duration=100,
+    Starttime=100,
+    Initialvalue=400000,
+    Finalvalue=600000)                         annotation (Placement(
+        transformation(extent={{0,-20},{20,0}}, rotation=0)));
+equation
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{-40,30},{0,30}}, color={0,0,255}));
+  connect(rampe2.y, sinkP.IPressure)
+    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
+  connect(centrifugalPump.C2, sinkP.C)
+    annotation (Line(points={{20,30},{60,30}}, color={0,0,255}));
+  connect(sourceP1.C, centrifugalPump1.C1)
+    annotation (Line(points={{-40,-50},{0,-50}}, color={0,0,255}));
+  connect(rampe1.y, sinkP1.IPressure)
+    annotation (Line(points={{21,-10},{80,-10},{80,-50},{75,-50}}));
+  connect(centrifugalPump1.C2, sinkP1.C)
+    annotation (Line(points={{20,-50},{60,-50}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump10;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump11.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump11.mo
index 8c41a39eb27bb0dde303c94773f6d97ef8014335..2396d93dc8dd004a065fbf3105fad4bb40e8fab7 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump11.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump11.mo
@@ -1,68 +1,67 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump11
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    mode_car_hn=2,
-    mode_car_Cr=2,
-    mode_car=1,
-    dynamic_energy_balance=true,
-    continuous_flow_reversal=true,
-    hn_nom_p=40,
-    p_rho=500)
-    annotation (Placement(transformation(extent={{-40,20},{-20,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=10000000,
-      option_temperature=2)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(P0=15000000)
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
-    Duration=100,
-    Starttime=10,
-    Initialvalue=290e3,
-    Finalvalue=3000e3)                         annotation (Placement(
-        transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
-    Duration=100,
-    Starttime=200,
-    Initialvalue=100e5,
-    Finalvalue=150e5)                          annotation (Placement(
-        transformation(extent={{40,60},{60,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe
-    dynamicOnePhaseFlowPipe(
-      inertia=true) annotation (Placement(transformation(extent={{0,20},{20,40}},
-          rotation=0)));
-equation
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{-60,30},{-40,30}}, color={0,0,255}));
-  connect(rampe1.y, sinkP.IPressure)
-    annotation (Line(points={{61,70},{80,70},{80,30},{55,30}}));
-  connect(centrifugalPump.C2, dynamicOnePhaseFlowPipe.C1)
-    annotation (Line(points={{-20,30},{0,30}}, color={0,0,255}));
-  connect(dynamicOnePhaseFlowPipe.C2, sinkP.C)
-    annotation (Line(points={{20,30},{40,30}}, color={0,0,255}));
-  connect(rampe3.y, sourceP.ISpecificEnthalpy)
-    annotation (Line(points={{-79,10},{-70,10},{-70,25}}, smooth=Smooth.None));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump11;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump11
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    mode_car_hn=2,
+    mode_car_Cr=2,
+    mode_car=1,
+    dynamic_energy_balance=true,
+    continuous_flow_reversal=true,
+    hn_nom_p=40,
+    p_rho=500)
+    annotation (Placement(transformation(extent={{-40,20},{-20,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=10000000,
+      option_temperature=2)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(P0=15000000)
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
+    Duration=100,
+    Starttime=10,
+    Initialvalue=290e3,
+    Finalvalue=3000e3)                         annotation (Placement(
+        transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
+    Duration=100,
+    Starttime=200,
+    Initialvalue=100e5,
+    Finalvalue=150e5)                          annotation (Placement(
+        transformation(extent={{40,60},{60,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe
+    dynamicOnePhaseFlowPipe(
+      inertia=true) annotation (Placement(transformation(extent={{0,20},{20,40}},
+          rotation=0)));
+equation
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{-60,30},{-40,30}}, color={0,0,255}));
+  connect(rampe1.y, sinkP.IPressure)
+    annotation (Line(points={{61,70},{80,70},{80,30},{55,30}}));
+  connect(centrifugalPump.C2, dynamicOnePhaseFlowPipe.C1)
+    annotation (Line(points={{-20,30},{0,30}}, color={0,0,255}));
+  connect(dynamicOnePhaseFlowPipe.C2, sinkP.C)
+    annotation (Line(points={{20,30},{40,30}}, color={0,0,255}));
+  connect(rampe3.y, sourceP.ISpecificEnthalpy)
+    annotation (Line(points={{-79,10},{-70,10},{-70,25}}, smooth=Smooth.None));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump11;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump12.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump12.mo
index 6d17823a797cd1418b1215c0e5d9c732ce1c3941..82deb7d14662b58cc24c029fc65eed912084ad0f 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump12.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump12.mo
@@ -1,65 +1,64 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump12
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    J=5.685,
-    dynamic_mech_equation=true,
-    hn_coef={-165.23,774.95},
-    rh_coef={-0.704,1.46},
-    N_nom=4809,
-    hn_nom_p=662,
-    Qv_nom_p=0.921,
-    mode_car_Cr=1,
-    w_a(start=0.003569902151486508),
-    C1(h(start=650000.0)),
-    Pm(start=719510.5112740289),
-    Qv(start=0.010949909796284268))
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceP(
-                                                             P0=100000,
-    Q0=10,
-    h0=650e3)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
-    Duration=1000,
-    Initialvalue=7.19555e5,
-    Finalvalue=2.0657e5,
-    Starttime=0)                               annotation (Placement(
-        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceTorque sourceTorque
-    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
-equation
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(sourceTorque.M, centrifugalPump.M)
-    annotation (Line(points={{1,-10},{30,-10},{30,19}}));
-  connect(rampe3.y, sourceP.IPressure)
-    annotation (Line(points={{-39,30},{-15,30}}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump12;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump12
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    J=5.685,
+    dynamic_mech_equation=true,
+    hn_coef={-165.23,774.95},
+    rh_coef={-0.704,1.46},
+    N_nom=4809,
+    hn_nom_p=662,
+    Qv_nom_p=0.921,
+    mode_car_Cr=1,
+    w_a(start=0.003569902151486508),
+    C1(h(start=650000.0)),
+    Pm(start=719510.5112740289),
+    Qv(start=0.010949909796284268))
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceP(
+                                                             P0=100000,
+    Q0=10,
+    h0=650e3)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
+    Duration=1000,
+    Initialvalue=7.19555e5,
+    Finalvalue=2.0657e5,
+    Starttime=0)                               annotation (Placement(
+        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceTorque sourceTorque
+    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
+equation
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(sourceTorque.M, centrifugalPump.M)
+    annotation (Line(points={{1,-10},{30,-10},{30,19}}));
+  connect(rampe3.y, sourceP.IPressure)
+    annotation (Line(points={{-39,30},{-15,30}}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump12;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump13.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump13.mo
index 536bc83698233eb5d93016fc1b024b8df243216a..a03bb4b9b574963707c5e89b92cc2a882dfb37c9 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump13.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump13.mo
@@ -1,58 +1,57 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump13
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    J=5.685,
-    dynamic_mech_equation=true,
-    hn_coef={-165.23,774.95},
-    rh_coef={-0.704,1.46},
-    N_nom=4809,
-    hn_nom_p=662,
-    Qv_nom_p=0.921,
-    mode_car_Cr=1,
-    N=4809)
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceP(
-                                                             P0=100000,
-    Q0=10,
-    h0=650e3)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
-    Duration=1000,
-    Initialvalue=7.19555e5,
-    Finalvalue=2.0657e5,
-    Starttime=0)                               annotation (Placement(
-        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-equation
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(rampe3.y, sourceP.IPressure)
-    annotation (Line(points={{-39,30},{-15,30}}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump13;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump13
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    J=5.685,
+    dynamic_mech_equation=true,
+    hn_coef={-165.23,774.95},
+    rh_coef={-0.704,1.46},
+    N_nom=4809,
+    hn_nom_p=662,
+    Qv_nom_p=0.921,
+    mode_car_Cr=1,
+    N=4809)
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceP(
+                                                             P0=100000,
+    Q0=10,
+    h0=650e3)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
+    Duration=1000,
+    Initialvalue=7.19555e5,
+    Finalvalue=2.0657e5,
+    Starttime=0)                               annotation (Placement(
+        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+equation
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(rampe3.y, sourceP.IPressure)
+    annotation (Line(points={{-39,30},{-15,30}}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump13;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump2.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump2.mo
index df923577433c51c79dafacc534a15bd7087f6d3e..4c9ca8096384fc55757306f7e15dd758d6ff8dd4 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump2.mo
@@ -1,75 +1,74 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump2
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    continuous_flow_reversal=false,
-    hn_nom_p=10,
-    mode_car=1,
-    V=0.01,
-    dynamic_energy_balance=false,
-    mode_car_Cr=1,
-    mode_car_hn=1)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=300000)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=100,
-    Starttime=100,
-    Finalvalue=4800000,
-    Initialvalue=400000)                       annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-      lambda=0, inertia=true)
-              annotation (Placement(transformation(extent={{20,20},{40,40}},
-          rotation=0)));
-equation
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255}));
-  connect(rampe2.y, sinkP.IPressure)
-    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
-  connect(lumpedStraightPipe.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, lumpedStraightPipe.C1)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-100,100},{-60,80}},
-          lineColor={0,0,255},
-          textString=
-               "w=1"),
-        Text(
-          extent={{-100,80},{-60,60}},
-          lineColor={0,0,255},
-          textString=
-               "q=0.8 ==> q=-3.5"),
-        Text(
-          extent={{-100,60},{-60,40}},
-          lineColor={0,0,255},
-          textString=
-               "theta=38 ==> theta=-74")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump2
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    continuous_flow_reversal=false,
+    hn_nom_p=10,
+    mode_car=1,
+    V=0.01,
+    dynamic_energy_balance=false,
+    mode_car_Cr=1,
+    mode_car_hn=1)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=300000)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=100,
+    Starttime=100,
+    Finalvalue=4800000,
+    Initialvalue=400000)                       annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+      lambda=0, inertia=true)
+              annotation (Placement(transformation(extent={{20,20},{40,40}},
+          rotation=0)));
+equation
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255}));
+  connect(rampe2.y, sinkP.IPressure)
+    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
+  connect(lumpedStraightPipe.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, lumpedStraightPipe.C1)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-100,100},{-60,80}},
+          lineColor={0,0,255},
+          textString=
+               "w=1"),
+        Text(
+          extent={{-100,80},{-60,60}},
+          lineColor={0,0,255},
+          textString=
+               "q=0.8 ==> q=-3.5"),
+        Text(
+          extent={{-100,60},{-60,40}},
+          lineColor={0,0,255},
+          textString=
+               "theta=38 ==> theta=-74")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump3.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump3.mo
index c1c0f20e31f01e8a5ea2fec280340cda4f469e45..a367d026e33f93a067432110290b37d6b63b58a2 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump3.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump3.mo
@@ -1,81 +1,80 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump3
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
-                                          width=200, period=500)
-    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
-          rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor Motor1(Im(start=2000))
-                                           annotation (Placement(transformation(
-          extent={{-80,-80},{-60,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump1(mode_car_hn=
-       1, mode_car_Cr=1,
-    mode_car=1,
-    dynamic_mech_equation=true,
-    w_a(start=1),
-    C2(P(start=300000)))
-    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
-  WaterSteam.Volumes.Tank              Tank(
-    ze2=10,
-    zs2=10)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
-                                                  k=0.5) annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-      continuous_flow_reversal=true, inertia=true)
-    annotation (Placement(transformation(
-        origin={50,-30},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-equation
-  connect(Pulse1.yL, Motor1.marche)
-    annotation (Line(points={{-79,-50},{-70,-50},{-70,-65.6}}));
-  connect(centrifugalPump1.C2, Tank.Ce2)
-    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
-          255}));
-  connect(Tank.Cs2, Valve.C1)
-    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
-  connect(Constante1.y, Valve.Ouv)
-    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
-  connect(centrifugalPump1.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{0,-30},{40,-30}}));
-  connect(lumpedStraightPipe.C1, Valve.C2)
-    annotation (Line(points={{60,-30},{80,-30},{80,24},{60,24}}));
-  connect(Motor1.C, centrifugalPump1.M)
-    annotation (Line(points={{-59.8,-70},{-10,-70},{-10,-41}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump3;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump3
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
+                                          width=200, period=500)
+    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
+          rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor Motor1(Im(start=2000))
+                                           annotation (Placement(transformation(
+          extent={{-80,-80},{-60,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump1(mode_car_hn=
+       1, mode_car_Cr=1,
+    mode_car=1,
+    dynamic_mech_equation=true,
+    w_a(start=1),
+    C2(P(start=300000)))
+    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
+  WaterSteam.Volumes.Tank              Tank(
+    ze2=10,
+    zs2=10)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
+                                                  k=0.5) annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+      continuous_flow_reversal=true, inertia=true)
+    annotation (Placement(transformation(
+        origin={50,-30},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+equation
+  connect(Pulse1.yL, Motor1.marche)
+    annotation (Line(points={{-79,-50},{-70,-50},{-70,-65.6}}));
+  connect(centrifugalPump1.C2, Tank.Ce2)
+    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
+          255}));
+  connect(Tank.Cs2, Valve.C1)
+    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
+  connect(Constante1.y, Valve.Ouv)
+    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
+  connect(centrifugalPump1.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{0,-30},{40,-30}}));
+  connect(lumpedStraightPipe.C1, Valve.C2)
+    annotation (Line(points={{60,-30},{80,-30},{80,24},{60,24}}));
+  connect(Motor1.C, centrifugalPump1.M)
+    annotation (Line(points={{-59.8,-70},{-10,-70},{-10,-41}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump3;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump4.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump4.mo
index f9aa222ab2b90e5b0ec90a1215abd15af49f7d35..2ccc7c189bf98e40f42a1aee8f667316771465ee 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump4.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump4.mo
@@ -1,88 +1,87 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump4
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump1(mode_car_hn=
-       1, mode_car_Cr=1,
-    mode_car=1,
-    dynamic_mech_equation=true,
-    w_a(start=1),
-    C2(P(start=297050)),
-    pro(d(start=997.375)),
-    hn(start=22),
-    Pm(start=189095))
-    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
-    ze2=10,
-    zs2=10,
-    Cs2(P(start=296800)))
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve(Pm(start=289870))
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
-                                                  k=0.5) annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-      continuous_flow_reversal=true, inertia=true,
-    C1(P(start=269870)),
-    Q(start=498, fixed=false))
-    annotation (Placement(transformation(
-        origin={50,-30},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceMechanicalPower
-    sourceTorque annotation (Placement(transformation(extent={{-60,-80},{-40,
-            -60}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    width=200,
-    period=500,
-    amplitude=124000) annotation (Placement(transformation(extent={{-100,-80},{
-            -80,-60}}, rotation=0)));
-equation
-  connect(centrifugalPump1.C2,Tank. Ce2)
-    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
-          255}));
-  connect(Tank.Cs2,Valve. C1)
-    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
-  connect(Constante1.y,Valve. Ouv)
-    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
-  connect(centrifugalPump1.C1,lumpedStraightPipe. C2)
-    annotation (Line(points={{0,-30},{40,-30}}));
-  connect(lumpedStraightPipe.C1,Valve. C2)
-    annotation (Line(points={{60,-30},{80,-30},{80,24},{60,24}}));
-  connect(pulse.y, sourceTorque.IPower) annotation (Line(points={{-79,-70},{-55,
-          -70}}));
-  connect(sourceTorque.M, centrifugalPump1.M)
-    annotation (Line(points={{-39,-70},{-10,-70},{-10,-41}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump4;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump4
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump1(mode_car_hn=
+       1, mode_car_Cr=1,
+    mode_car=1,
+    dynamic_mech_equation=true,
+    w_a(start=1),
+    C2(P(start=297050)),
+    pro(d(start=997.375)),
+    hn(start=22),
+    Pm(start=189095))
+    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
+    ze2=10,
+    zs2=10,
+    Cs2(P(start=296800)))
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve(Pm(start=289870))
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
+                                                  k=0.5) annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+      continuous_flow_reversal=true, inertia=true,
+    C1(P(start=269870)),
+    Q(start=498, fixed=false))
+    annotation (Placement(transformation(
+        origin={50,-30},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceMechanicalPower
+    sourceTorque annotation (Placement(transformation(extent={{-60,-80},{-40,
+            -60}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    width=200,
+    period=500,
+    amplitude=124000) annotation (Placement(transformation(extent={{-100,-80},{
+            -80,-60}}, rotation=0)));
+equation
+  connect(centrifugalPump1.C2,Tank. Ce2)
+    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
+          255}));
+  connect(Tank.Cs2,Valve. C1)
+    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
+  connect(Constante1.y,Valve. Ouv)
+    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
+  connect(centrifugalPump1.C1,lumpedStraightPipe. C2)
+    annotation (Line(points={{0,-30},{40,-30}}));
+  connect(lumpedStraightPipe.C1,Valve. C2)
+    annotation (Line(points={{60,-30},{80,-30},{80,24},{60,24}}));
+  connect(pulse.y, sourceTorque.IPower) annotation (Line(points={{-79,-70},{-55,
+          -70}}));
+  connect(sourceTorque.M, centrifugalPump1.M)
+    annotation (Line(points={{-39,-70},{-10,-70},{-10,-41}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump4;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump5.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump5.mo
index 3fe04c18247fba1b750047b147b2e61339480e70..49909512c4be1310af0698c729794419c63fd905 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump5.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump5.mo
@@ -1,76 +1,75 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump5
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
-        1, mode_car_Cr=1,
-    mode_car=1,
-    w_a(start=1))
-           annotation (Placement(transformation(extent={{20,20},{40,40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
-    annotation (Placement(transformation(extent={{-40,20},{-20,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{80,20},{100,40}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.Shaft shaft
-    annotation (Placement(transformation(extent={{0,-20},{20,0}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor synchronousMotor(D=
-        100, Im(start=1500))
-             annotation (Placement(transformation(extent={{-40,-20},{-20,0}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon(
-      startTime=10) annotation (Placement(transformation(extent={{-100,0},{-80,
-            20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.NONL nONL
-    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
-equation
-  connect(sourcePQ.C, centrifugalPump.C1)
-    annotation (Line(points={{-20,30},{20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sink.C)        annotation (Line(points={{40,30},{
-          80,30}}, color={0,0,255}));
-  connect(synchronousMotor.C, shaft.C1) annotation (Line(points={{-19.8,-10},{
-          -1,-10}}));
-  connect(shaft.C2, centrifugalPump.M)
-    annotation (Line(points={{21,-10},{30,-10},{30,19}}));
-  connect(echelon.yL, nONL.uL) annotation (Line(points={{-79,10},{-61,10}}));
-  connect(nONL.yL, synchronousMotor.marche)
-    annotation (Line(points={{-39,10},{-30,10},{-30,-5.6}}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-100,100},{-60,80}},
-          lineColor={0,0,255},
-          textString=
-               "w=1 ==> w=0"),
-        Text(
-          extent={{-100,80},{-60,60}},
-          lineColor={0,0,255},
-          textString=
-               "q=0"),
-        Text(
-          extent={{-100,60},{-60,40}},
-          lineColor={0,0,255},
-          textString=
-               "theta=0 ==> theta=-180")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump5;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump5
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
+        1, mode_car_Cr=1,
+    mode_car=1,
+    w_a(start=1))
+           annotation (Placement(transformation(extent={{20,20},{40,40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
+    annotation (Placement(transformation(extent={{-40,20},{-20,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{80,20},{100,40}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.Shaft shaft
+    annotation (Placement(transformation(extent={{0,-20},{20,0}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor synchronousMotor(D=
+        100, Im(start=1500))
+             annotation (Placement(transformation(extent={{-40,-20},{-20,0}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon(
+      startTime=10) annotation (Placement(transformation(extent={{-100,0},{-80,
+            20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.NONL nONL
+    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
+equation
+  connect(sourcePQ.C, centrifugalPump.C1)
+    annotation (Line(points={{-20,30},{20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sink.C)        annotation (Line(points={{40,30},{
+          80,30}}, color={0,0,255}));
+  connect(synchronousMotor.C, shaft.C1) annotation (Line(points={{-19.8,-10},{
+          -1,-10}}));
+  connect(shaft.C2, centrifugalPump.M)
+    annotation (Line(points={{21,-10},{30,-10},{30,19}}));
+  connect(echelon.yL, nONL.uL) annotation (Line(points={{-79,10},{-61,10}}));
+  connect(nONL.yL, synchronousMotor.marche)
+    annotation (Line(points={{-39,10},{-30,10},{-30,-5.6}}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-100,100},{-60,80}},
+          lineColor={0,0,255},
+          textString=
+               "w=1 ==> w=0"),
+        Text(
+          extent={{-100,80},{-60,60}},
+          lineColor={0,0,255},
+          textString=
+               "q=0"),
+        Text(
+          extent={{-100,60},{-60,40}},
+          lineColor={0,0,255},
+          textString=
+               "theta=0 ==> theta=-180")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump5;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump6.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump6.mo
index 92ee7dcf11df51bc7f60c68e47448635e572c9bc..0874e1d50c85abe2336a8d5c74a7791b58884e41 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump6.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump6.mo
@@ -1,82 +1,81 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump6
-
-  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor synchronousMotor(Im(start=
-          1500))
-    annotation (Placement(transformation(extent={{-40,-20},{-20,0}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante
-    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
-    continuous_flow_reversal=false,
-    hn_nom_p=10,
-    mode_car_hn=1,
-    mode_car_Cr=1,
-    mode_car=1,
-    w_a(start=1))
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=300000)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=100,
-    Starttime=100,
-    Finalvalue=4800000,
-    Initialvalue=200000)                       annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(inertia=
-        true) annotation (Placement(transformation(extent={{20,20},{40,40}},
-          rotation=0)));
-equation
-  connect(constante.yL, synchronousMotor.marche)
-    annotation (Line(points={{-39,10},{-30,10},{-30,-5.6}}));
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255}));
-  connect(rampe2.y,sinkP. IPressure)
-    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
-  connect(lumpedStraightPipe.C2,sinkP. C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(synchronousMotor.C, centrifugalPump.M)
-    annotation (Line(points={{-19.8,-10},{-10,-10},{-10,19}}));
-  connect(centrifugalPump.C2, lumpedStraightPipe.C1)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-100,100},{-60,80}},
-          lineColor={0,0,255},
-          textString=
-               "w=1"),
-        Text(
-          extent={{-100,80},{-60,60}},
-          lineColor={0,0,255},
-          textString=
-               "q=0.8 ==> q=-3.5"),
-        Text(
-          extent={{-100,60},{-60,40}},
-          lineColor={0,0,255},
-          textString=
-               "theta=38 ==> theta=-74")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump6;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump6
+  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor synchronousMotor(Im(start=
+          1500))
+    annotation (Placement(transformation(extent={{-40,-20},{-20,0}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante
+    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(
+    continuous_flow_reversal=false,
+    hn_nom_p=10,
+    mode_car_hn=1,
+    mode_car_Cr=1,
+    mode_car=1,
+    w_a(start=1))
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(P0=300000)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=100,
+    Starttime=100,
+    Finalvalue=4800000,
+    Initialvalue=200000)                       annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(inertia=
+        true) annotation (Placement(transformation(extent={{20,20},{40,40}},
+          rotation=0)));
+equation
+  connect(constante.yL, synchronousMotor.marche)
+    annotation (Line(points={{-39,10},{-30,10},{-30,-5.6}}));
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255}));
+  connect(rampe2.y,sinkP. IPressure)
+    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
+  connect(lumpedStraightPipe.C2,sinkP. C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(synchronousMotor.C, centrifugalPump.M)
+    annotation (Line(points={{-19.8,-10},{-10,-10},{-10,19}}));
+  connect(centrifugalPump.C2, lumpedStraightPipe.C1)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-100,100},{-60,80}},
+          lineColor={0,0,255},
+          textString=
+               "w=1"),
+        Text(
+          extent={{-100,80},{-60,60}},
+          lineColor={0,0,255},
+          textString=
+               "q=0.8 ==> q=-3.5"),
+        Text(
+          extent={{-100,60},{-60,40}},
+          lineColor={0,0,255},
+          textString=
+               "theta=38 ==> theta=-74")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump6;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump7.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump7.mo
index c66a8a2e54a09f0a4f36a1a6778b5ff841492a4e..5dfc79404d6af7453952f53aa92e7d6c4bcddc16 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump7.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump7.mo
@@ -1,127 +1,126 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump7
-  import ThermoSysPro;
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
-                                          width=200, period=400)
-    annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}, rotation=
-           0)));
-  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor Motor1(Im(start=
-          2292.3122440739885))             annotation (Placement(transformation(
-          extent={{-40,-80},{-20,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
-        1, mode_car_Cr=1,
-    mode_car=1,
-    dynamic_energy_balance=true,
-    w_a(start=0.9999396759938389),
-    Qv_a(start=1.658781970010689),
-    Q(start=862.736),
-    Pm(start=330941.1543408615),
-    h(start=100076.56881800787),
-    C2(h_vol(start=100134), h(start=100153.13763601574),
-      P(start=365270.5994503353)))
-    annotation (Placement(transformation(extent={{40,-40},{20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
-    ze2=10,
-    zs2=10,
-    P(start=248019.0454445388),
-    Ce1(Q(start=0.0)),
-    Ce2(Q(start=791.0409047469313)))
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve(
-    Q(start=368.66),
-    Pm(start=331254.83903552557),
-    h(start=100134))
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
-    annotation (Placement(transformation(extent={{0,-80},{20,-60}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=200,
-    Duration=100,
-    Initialvalue=0.5,
-    Finalvalue=0) annotation (Placement(transformation(extent={{-100,60},{-80,
-            80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.DynamicReliefValve dynamicReliefValve(
-      h(start=100134), mech_steady_state=false) annotation (Placement(
-        transformation(extent={{-20,-10},{0,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(P(start=311770), h(start=
-          100153.13763555152))
-    annotation (Placement(transformation(extent={{0,-20},{-20,-40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{20,-10},{40,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve1(Pm(start=200650),
-      Q(start=0.0000001))
-    annotation (Placement(transformation(extent={{-20,32},{0,52}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-60,26},{-40,46}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=
-        15) annotation (Placement(transformation(extent={{-60,80},{-40,100}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Feedback feedback
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-equation
-  connect(Pulse1.yL, Motor1.marche)
-    annotation (Line(points={{-39,-50},{-30,-50},{-30,-65.6}}));
-  connect(Motor1.C, Shaft1.C1)
-    annotation (Line(points={{-19.8,-70},{-1,-70}}));
-  connect(centrifugalPump.M, Shaft1.C2)
-    annotation (Line(points={{30,-41},{30,-70},{21,-70}}));
-  connect(rampe.y, Valve.Ouv) annotation (Line(points={{-79,70},{-70,70},{-70,
-          41}}));
-  connect(centrifugalPump.C2, volumeA.Ce1)         annotation (Line(points={{20,
-          -30},{0,-30}}, color={0,0,255}));
-  connect(dynamicReliefValve.C1, volumeA.Cs2)
-    annotation (Line(points={{-10,-9.8},{-10,-20}}));
-  connect(dynamicReliefValve.C2, sinkP.C) annotation (Line(points={{0,0},{10,0},
-          {20,0}},              color={0,0,255}));
-  connect(volumeA.Cs1, Valve.C1) annotation (Line(points={{-20,-30},{-100,-30},
-          {-100,24},{-80,24}}, color={0,0,255}));
-  connect(Valve.C2, Tank.Ce2)
-    annotation (Line(points={{-60,24},{20,24}}, color={0,0,255}));
-  connect(Valve1.C2, Tank.Ce1)
-    annotation (Line(points={{0,36},{20,36}}, color={0,0,255}));
-  connect(sourceP.C, Valve1.C1)
-    annotation (Line(points={{-40,36},{-20,36}}, color={0,0,255}));
-  connect(constante.y, feedback.u1) annotation (Line(points={{-39,90},{-21,90}}));
-  connect(Tank.yLevel, feedback.u2)
-    annotation (Line(points={{41,32},{60,32},{60,70},{-10,70},{-10,79}}));
-  connect(feedback.y, pIsat.u) annotation (Line(points={{1,90},{19,90}}));
-  connect(pIsat.y, Valve1.Ouv)
-    annotation (Line(points={{41,90},{80,90},{80,60},{-10,60},{-10,53}}));
-  connect(centrifugalPump.C1, Tank.Cs2)
-    annotation (Line(points={{40,-30},{80,-30},{80,24},{40,24}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump7;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump7
+  import ThermoSysPro;
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
+                                          width=200, period=400)
+    annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}, rotation=
+           0)));
+  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor Motor1(Im(start=
+          2292.3122440739885))             annotation (Placement(transformation(
+          extent={{-40,-80},{-20,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
+        1, mode_car_Cr=1,
+    mode_car=1,
+    dynamic_energy_balance=true,
+    w_a(start=0.9999396759938389),
+    Qv_a(start=1.658781970010689),
+    Q(start=862.736),
+    Pm(start=330941.1543408615),
+    h(start=100076.56881800787),
+    C2(h_vol(start=100134), h(start=100153.13763601574),
+      P(start=365270.5994503353)))
+    annotation (Placement(transformation(extent={{40,-40},{20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
+    ze2=10,
+    zs2=10,
+    P(start=248019.0454445388),
+    Ce1(Q(start=0.0)),
+    Ce2(Q(start=791.0409047469313)))
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve(
+    Q(start=368.66),
+    Pm(start=331254.83903552557),
+    h(start=100134))
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
+    annotation (Placement(transformation(extent={{0,-80},{20,-60}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=200,
+    Duration=100,
+    Initialvalue=0.5,
+    Finalvalue=0) annotation (Placement(transformation(extent={{-100,60},{-80,
+            80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.DynamicReliefValve dynamicReliefValve(
+      h(start=100134), mech_steady_state=false) annotation (Placement(
+        transformation(extent={{-20,-10},{0,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(P(start=311770), h(start=
+          100153.13763555152))
+    annotation (Placement(transformation(extent={{0,-20},{-20,-40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{20,-10},{40,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve1(Pm(start=200650),
+      Q(start=0.0000001))
+    annotation (Placement(transformation(extent={{-20,32},{0,52}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-60,26},{-40,46}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=
+        15) annotation (Placement(transformation(extent={{-60,80},{-40,100}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Feedback feedback
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+equation
+  connect(Pulse1.yL, Motor1.marche)
+    annotation (Line(points={{-39,-50},{-30,-50},{-30,-65.6}}));
+  connect(Motor1.C, Shaft1.C1)
+    annotation (Line(points={{-19.8,-70},{-1,-70}}));
+  connect(centrifugalPump.M, Shaft1.C2)
+    annotation (Line(points={{30,-41},{30,-70},{21,-70}}));
+  connect(rampe.y, Valve.Ouv) annotation (Line(points={{-79,70},{-70,70},{-70,
+          41}}));
+  connect(centrifugalPump.C2, volumeA.Ce1)         annotation (Line(points={{20,
+          -30},{0,-30}}, color={0,0,255}));
+  connect(dynamicReliefValve.C1, volumeA.Cs2)
+    annotation (Line(points={{-10,-9.8},{-10,-20}}));
+  connect(dynamicReliefValve.C2, sinkP.C) annotation (Line(points={{0,0},{10,0},
+          {20,0}},              color={0,0,255}));
+  connect(volumeA.Cs1, Valve.C1) annotation (Line(points={{-20,-30},{-100,-30},
+          {-100,24},{-80,24}}, color={0,0,255}));
+  connect(Valve.C2, Tank.Ce2)
+    annotation (Line(points={{-60,24},{20,24}}, color={0,0,255}));
+  connect(Valve1.C2, Tank.Ce1)
+    annotation (Line(points={{0,36},{20,36}}, color={0,0,255}));
+  connect(sourceP.C, Valve1.C1)
+    annotation (Line(points={{-40,36},{-20,36}}, color={0,0,255}));
+  connect(constante.y, feedback.u1) annotation (Line(points={{-39,90},{-21,90}}));
+  connect(Tank.yLevel, feedback.u2)
+    annotation (Line(points={{41,32},{60,32},{60,70},{-10,70},{-10,79}}));
+  connect(feedback.y, pIsat.u) annotation (Line(points={{1,90},{19,90}}));
+  connect(pIsat.y, Valve1.Ouv)
+    annotation (Line(points={{41,90},{80,90},{80,60},{-10,60},{-10,53}}));
+  connect(centrifugalPump.C1, Tank.Cs2)
+    annotation (Line(points={{40,-30},{80,-30},{80,24},{40,24}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump7;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump8.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump8.mo
index 97814bd5dbe079d24491df417b3d356a597de3fd..28a4fe7dcb7d9c2d13790123879daadd7d871674 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump8.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump8.mo
@@ -1,69 +1,68 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump8
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
-        1, mode_car_Cr=1,
-    mode_car=1)      annotation (Placement(transformation(extent={{-20,20},{0,
-            40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=100)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=10,
-    Duration=100,
-    Initialvalue=1400,
-    Finalvalue=0) annotation (Placement(transformation(extent={{-80,-20},{-60,0}},
-          rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
-    sourceAngularVelocity annotation (Placement(transformation(extent={{-40,-20},
-            {-20,0}}, rotation=0)));
-equation
-  connect(sourcePQ.C, centrifugalPump.C1)
-    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sink.C)
-    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
-  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
-    annotation (Line(points={{-59,-10},{-35,-10}}));
-  connect(sourceAngularVelocity.M, centrifugalPump.M)
-    annotation (Line(points={{-19,-10},{-10,-10},{-10,19}}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-100,100},{-60,80}},
-          lineColor={0,0,255},
-          textString=
-               "w=1 ==> w=0"),
-        Text(
-          extent={{-100,80},{-60,60}},
-          lineColor={0,0,255},
-          textString=
-               "q=100"),
-        Text(
-          extent={{-100,60},{-60,40}},
-          lineColor={0,0,255},
-          textString=
-               "theta=8 ==> theta=90")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump8;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump8
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
+        1, mode_car_Cr=1,
+    mode_car=1)      annotation (Placement(transformation(extent={{-20,20},{0,
+            40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=100)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=10,
+    Duration=100,
+    Initialvalue=1400,
+    Finalvalue=0) annotation (Placement(transformation(extent={{-80,-20},{-60,0}},
+          rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
+    sourceAngularVelocity annotation (Placement(transformation(extent={{-40,-20},
+            {-20,0}}, rotation=0)));
+equation
+  connect(sourcePQ.C, centrifugalPump.C1)
+    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sink.C)
+    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
+  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
+    annotation (Line(points={{-59,-10},{-35,-10}}));
+  connect(sourceAngularVelocity.M, centrifugalPump.M)
+    annotation (Line(points={{-19,-10},{-10,-10},{-10,19}}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-100,100},{-60,80}},
+          lineColor={0,0,255},
+          textString=
+               "w=1 ==> w=0"),
+        Text(
+          extent={{-100,80},{-60,60}},
+          lineColor={0,0,255},
+          textString=
+               "q=100"),
+        Text(
+          extent={{-100,60},{-60,40}},
+          lineColor={0,0,255},
+          textString=
+               "theta=8 ==> theta=90")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump8;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump9.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump9.mo
index b7c0d4cc4c2d541126d7d3666123563b18d91336..1513a698e196409b244280e34dbaaa4f07a37372 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump9.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPump9.mo
@@ -1,69 +1,68 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPump9
-
-  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
-        1, mode_car_Cr=1,
-    mode_car=1,
-    dynamic_mech_equation=false,
-    Cm(start=0),
-    w_a(start=0))    annotation (Placement(transformation(extent={{-20,20},{0,
-            40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=100)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceMechanicalPower
-    sourceMechanicalPower(W0=0) annotation (Placement(transformation(extent={{
-            -80,-20},{-60,0}}, rotation=0)));
-equation
-  connect(sourcePQ.C, centrifugalPump.C1)
-    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sink.C)
-    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
-  connect(sourceMechanicalPower.M, centrifugalPump.M)
-    annotation (Line(points={{-59,-10},{-10,-10},{-10,19}}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-100,100},{-60,80}},
-          lineColor={0,0,255},
-          textString=
-               "w=0 ==> w=0.05"),
-        Text(
-          extent={{-100,80},{-80,60}},
-          lineColor={0,0,255},
-          textString=
-               "q=100"),
-        Text(
-          extent={{-100,60},{-60,40}},
-          lineColor={0,0,255},
-          textString=
-               "theta=90 ==> theta=71"),
-        Text(
-          extent={{-40,80},{0,60}},
-          lineColor={0,0,255},
-          textString=
-               "W=0")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPump9;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPump9
+  ThermoSysPro.WaterSteam.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
+        1, mode_car_Cr=1,
+    mode_car=1,
+    dynamic_mech_equation=false,
+    Cm(start=0),
+    w_a(start=0))    annotation (Placement(transformation(extent={{-20,20},{0,
+            40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(Q0=100)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceMechanicalPower
+    sourceMechanicalPower(W0=0) annotation (Placement(transformation(extent={{
+            -80,-20},{-60,0}}, rotation=0)));
+equation
+  connect(sourcePQ.C, centrifugalPump.C1)
+    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sink.C)
+    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
+  connect(sourceMechanicalPower.M, centrifugalPump.M)
+    annotation (Line(points={{-59,-10},{-10,-10},{-10,19}}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-100,100},{-60,80}},
+          lineColor={0,0,255},
+          textString=
+               "w=0 ==> w=0.05"),
+        Text(
+          extent={{-100,80},{-80,60}},
+          lineColor={0,0,255},
+          textString=
+               "q=100"),
+        Text(
+          extent={{-100,60},{-60,40}},
+          lineColor={0,0,255},
+          textString=
+               "theta=90 ==> theta=71"),
+        Text(
+          extent={{-40,80},{0,60}},
+          lineColor={0,0,255},
+          textString=
+               "W=0")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPump9;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPumpWaterSolution.mo b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPumpWaterSolution.mo
index ac9c800bd14a4059f22a19e2110307023d8a6393..37e0e2ca63f05f46f74192a29c6c8613012d78ab 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPumpWaterSolution.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCentrifugalPumpWaterSolution.mo
@@ -1,67 +1,66 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCentrifugalPumpWaterSolution
-
-  ThermoSysPro.WaterSolution.BoundaryConditions.RefP refP
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(
-                                                 k=2.e5)
-    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
-            0)));
-  ThermoSysPro.WaterSolution.Machines.StaticCentrifugalPump pump(C2(T(start=290)))
-    annotation (Placement(transformation(extent={{-20,0},{0,20}}, rotation=0)));
-  ThermoSysPro.WaterSolution.LoopBreakers.LoopBreakerQ loopBreakerQ
-    annotation (Placement(transformation(extent={{10,0},{30,20}}, rotation=0)));
-  ThermoSysPro.WaterSolution.LoopBreakers.LoopBreakerT loopBreakerH
-    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
-  ThermoSysPro.WaterSolution.BoundaryConditions.RefT refT
-    annotation (Placement(transformation(extent={{-70,0},{-50,20}}, rotation=0)));
-  ThermoSysPro.WaterSolution.PressureLosses.SingularPressureLoss
-    lumpedStraightPipe annotation (Placement(transformation(extent={{0,-40},{
-            -20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSolution.LoopBreakers.LoopBreakerXh2o loopBreakerXh20_1
-    annotation (Placement(transformation(extent={{70,0},{90,20}}, rotation=0)));
-  ThermoSysPro.WaterSolution.BoundaryConditions.RefXh2o refXh2o
-    annotation (Placement(transformation(extent={{-44,0},{-24,20}}, rotation=0)));
-equation
-  connect(loopBreakerQ.Cs, loopBreakerH.Ce) annotation (Line(points={{30,10},{
-          40,10}}, color={0,0,255}));
-  connect(refP.C2, refT.C1) annotation (Line(points={{-80,10},{-70,10}}, color=
-          {0,0,255}));
-  connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,
-          70},{-60,34},{-90,34},{-90,21}}));
-  connect(pump.C2, loopBreakerQ.Ce) annotation (Line(points={{0,10},{10,10}},
-        color={0,0,0}));
-  connect(loopBreakerH.Cs, loopBreakerXh20_1.Ce) annotation (Line(points={{60,
-          10},{70,10}}, color={0,0,0}));
-  connect(refT.C2, refXh2o.C1) annotation (Line(points={{-50,10},{-44,10}},
-        color={0,0,0}));
-  connect(refXh2o.C2, pump.C1) annotation (Line(points={{-24,10},{-20,10}},
-        color={0,0,0}));
-  connect(loopBreakerXh20_1.Cs, lumpedStraightPipe.C1) annotation (Line(points=
-          {{90,10},{100,10},{100,-30},{-1,-30}}, color={0,0,0}));
-  connect(lumpedStraightPipe.C2, refP.C1) annotation (Line(points={{-19,-30},{
-          -100,-30},{-100,10}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCentrifugalPumpWaterSolution;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCentrifugalPumpWaterSolution
+  ThermoSysPro.WaterSolution.BoundaryConditions.RefP refP
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(
+                                                 k=2.e5)
+    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
+            0)));
+  ThermoSysPro.WaterSolution.Machines.StaticCentrifugalPump pump(C2(T(start=290)))
+    annotation (Placement(transformation(extent={{-20,0},{0,20}}, rotation=0)));
+  ThermoSysPro.WaterSolution.LoopBreakers.LoopBreakerQ loopBreakerQ
+    annotation (Placement(transformation(extent={{10,0},{30,20}}, rotation=0)));
+  ThermoSysPro.WaterSolution.LoopBreakers.LoopBreakerT loopBreakerH
+    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
+  ThermoSysPro.WaterSolution.BoundaryConditions.RefT refT
+    annotation (Placement(transformation(extent={{-70,0},{-50,20}}, rotation=0)));
+  ThermoSysPro.WaterSolution.PressureLosses.SingularPressureLoss
+    lumpedStraightPipe annotation (Placement(transformation(extent={{0,-40},{
+            -20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSolution.LoopBreakers.LoopBreakerXh2o loopBreakerXh20_1
+    annotation (Placement(transformation(extent={{70,0},{90,20}}, rotation=0)));
+  ThermoSysPro.WaterSolution.BoundaryConditions.RefXh2o refXh2o
+    annotation (Placement(transformation(extent={{-44,0},{-24,20}}, rotation=0)));
+equation
+  connect(loopBreakerQ.Cs, loopBreakerH.Ce) annotation (Line(points={{30,10},{
+          40,10}}, color={0,0,255}));
+  connect(refP.C2, refT.C1) annotation (Line(points={{-80,10},{-70,10}}, color=
+          {0,0,255}));
+  connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,
+          70},{-60,34},{-90,34},{-90,21}}));
+  connect(pump.C2, loopBreakerQ.Ce) annotation (Line(points={{0,10},{10,10}},
+        color={0,0,0}));
+  connect(loopBreakerH.Cs, loopBreakerXh20_1.Ce) annotation (Line(points={{60,
+          10},{70,10}}, color={0,0,0}));
+  connect(refT.C2, refXh2o.C1) annotation (Line(points={{-50,10},{-44,10}},
+        color={0,0,0}));
+  connect(refXh2o.C2, pump.C1) annotation (Line(points={{-24,10},{-20,10}},
+        color={0,0,0}));
+  connect(loopBreakerXh20_1.Cs, lumpedStraightPipe.C1) annotation (Line(points=
+          {{90,10},{100,10},{100,-30},{-1,-30}}, color={0,0,0}));
+  connect(lumpedStraightPipe.C2, refP.C1) annotation (Line(points={{-19,-30},{
+          -100,-30},{-100,10}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCentrifugalPumpWaterSolution;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCheckValve.mo b/ThermoSysPro/Examples/SimpleExamples/TestCheckValve.mo
index a63db03e374f6c0d6bd9486a2b9f210cf495a691..1dde157724afc7a1224571c8419bdb4603898f09 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCheckValve.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCheckValve.mo
@@ -1,101 +1,100 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCheckValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-                                    annotation (Placement(transformation(extent=
-           {{-104,20},{-84,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(
-                                  P0=6e5) annotation (Placement(transformation(
-          extent={{84,20},{104,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1
-    annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump2
-    annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD annotation (Placement(
-        transformation(extent={{-50,20},{-30,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.CheckValve checkValve1
-    annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.CheckValve checkValve2
-    annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC annotation (Placement(
-        transformation(extent={{30,20},{50,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP
-                                        annotation (Placement(transformation(
-          extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1
-                                         annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-60,-80},{-40,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{20,-80},{40,-60}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    amplitude=6e5,
-    width=50,
-    period=100,
-    offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80,
-            -60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.CheckValve checkValve3
-    annotation (Placement(transformation(extent={{-20,-80},{0,-60}}, rotation=0)));
-equation
-  connect(volumeD.Cs1, staticCentrifugalPump1.C1) annotation (Line(points={{-40,
-          40},{-40,70},{-30,70}}, color={0,0,255}));
-  connect(volumeD.Cs2, staticCentrifugalPump2.C1) annotation (Line(points={{-40,
-          20.2},{-40,-10},{-30,-10}}, color={0,0,255}));
-  connect(staticCentrifugalPump1.C2, checkValve1.C1) annotation (Line(points={{
-          -10,70},{-2,70},{-2,70},{9,70}}, color={0,0,255}));
-  connect(checkValve1.C2, volumeC.Ce2) annotation (Line(points={{31,70},{40,70},
-          {40,39}}, color={0,0,255}));
-  connect(checkValve2.C2, volumeC.Ce3) annotation (Line(points={{29,-10},{40,
-          -10},{40,20}}, color={0,0,255}));
-  connect(staticCentrifugalPump2.C2, checkValve2.C1) annotation (Line(points={{
-          -10,-10},{0,-10},{0,-10},{7,-10}}, color={0,0,255}));
-  connect(perteDP.C2, volumeD.Ce)
-    annotation (Line(points={{-60,30},{-50,30}}, color={0,0,255}));
-  connect(volumeC.Cs, perteDP1.C1)
-    annotation (Line(points={{50,30},{60,30}}, color={0,0,255}));
-  connect(perteDP1.C2, puitsP.C)
-    annotation (Line(points={{80,30},{84,30}}, color={0,0,255}));
-  connect(sourceP.C, perteDP.C1)
-    annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255}));
-  connect(sourceP1.C, checkValve3.C1)
-    annotation (Line(points={{-40,-70},{-21,-70}}, color={0,0,255}));
-  connect(checkValve3.C2, puitsP1.C)
-    annotation (Line(points={{1,-70},{20,-70}}, color={0,0,255}));
-  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55,
-          -70}}));
-  annotation (experiment(StopTime=1000),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCheckValve;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCheckValve
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+                                    annotation (Placement(transformation(extent=
+           {{-104,20},{-84,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(
+                                  P0=6e5) annotation (Placement(transformation(
+          extent={{84,20},{104,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1
+    annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump2
+    annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD annotation (Placement(
+        transformation(extent={{-50,20},{-30,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.CheckValve checkValve1
+    annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.CheckValve checkValve2
+    annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC annotation (Placement(
+        transformation(extent={{30,20},{50,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP
+                                        annotation (Placement(transformation(
+          extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1
+                                         annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-60,-80},{-40,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{20,-80},{40,-60}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    amplitude=6e5,
+    width=50,
+    period=100,
+    offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80,
+            -60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.CheckValve checkValve3
+    annotation (Placement(transformation(extent={{-20,-80},{0,-60}}, rotation=0)));
+equation
+  connect(volumeD.Cs1, staticCentrifugalPump1.C1) annotation (Line(points={{-40,
+          40},{-40,70},{-30,70}}, color={0,0,255}));
+  connect(volumeD.Cs2, staticCentrifugalPump2.C1) annotation (Line(points={{-40,
+          20.2},{-40,-10},{-30,-10}}, color={0,0,255}));
+  connect(staticCentrifugalPump1.C2, checkValve1.C1) annotation (Line(points={{
+          -10,70},{-2,70},{-2,70},{9,70}}, color={0,0,255}));
+  connect(checkValve1.C2, volumeC.Ce2) annotation (Line(points={{31,70},{40,70},
+          {40,39}}, color={0,0,255}));
+  connect(checkValve2.C2, volumeC.Ce3) annotation (Line(points={{29,-10},{40,
+          -10},{40,20}}, color={0,0,255}));
+  connect(staticCentrifugalPump2.C2, checkValve2.C1) annotation (Line(points={{
+          -10,-10},{0,-10},{0,-10},{7,-10}}, color={0,0,255}));
+  connect(perteDP.C2, volumeD.Ce)
+    annotation (Line(points={{-60,30},{-50,30}}, color={0,0,255}));
+  connect(volumeC.Cs, perteDP1.C1)
+    annotation (Line(points={{50,30},{60,30}}, color={0,0,255}));
+  connect(perteDP1.C2, puitsP.C)
+    annotation (Line(points={{80,30},{84,30}}, color={0,0,255}));
+  connect(sourceP.C, perteDP.C1)
+    annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255}));
+  connect(sourceP1.C, checkValve3.C1)
+    annotation (Line(points={{-40,-70},{-21,-70}}, color={0,0,255}));
+  connect(checkValve3.C2, puitsP1.C)
+    annotation (Line(points={{1,-70},{20,-70}}, color={0,0,255}));
+  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55,
+          -70}}));
+  annotation (experiment(StopTime=1000),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCheckValve;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestCompressor.mo b/ThermoSysPro/Examples/SimpleExamples/TestCompressor.mo
index f69a3cdaeaafc84c08332df6d8d4963a10426d16..74166426617f8a87de6de091ca25b29326a23a4a 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestCompressor.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestCompressor.mo
@@ -1,60 +1,59 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestCompressor
-
-  ThermoSysPro.WaterSteam.Machines.Compressor compressor(Pe(start=100000))
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink puitsP
-    annotation (Placement(transformation(extent={{60,60},{80,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceP(
-    P0=100000,
-    Q0=1,
-    h0=3.e4) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-      fluid=2) annotation (Placement(transformation(extent={{-60,60},{-40,80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
-     fluid=2) annotation (Placement(transformation(extent={{20,60},{40,80}},
-          rotation=0)));
-equation
-  connect(sourceP.C, lumpedStraightPipe.C1)
-    annotation (Line(points={{-80,70},{-60,70}}, color={0,0,255}));
-  connect(lumpedStraightPipe.C2, compressor.C1)
-    annotation (Line(points={{-40,70},{-20,70}}, color={0,0,255}));
-  connect(compressor.C2, lumpedStraightPipe1.C1)
-    annotation (Line(points={{0,70},{20,70}}, color={0,0,255}));
-  connect(lumpedStraightPipe1.C2, puitsP.C)
-    annotation (Line(points={{40,70},{60,70}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestCompressor;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestCompressor
+  ThermoSysPro.WaterSteam.Machines.Compressor compressor(Pe(start=100000))
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink puitsP
+    annotation (Placement(transformation(extent={{60,60},{80,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceP(
+    P0=100000,
+    Q0=1,
+    h0=3.e4) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+      fluid=2) annotation (Placement(transformation(extent={{-60,60},{-40,80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
+     fluid=2) annotation (Placement(transformation(extent={{20,60},{40,80}},
+          rotation=0)));
+equation
+  connect(sourceP.C, lumpedStraightPipe.C1)
+    annotation (Line(points={{-80,70},{-60,70}}, color={0,0,255}));
+  connect(lumpedStraightPipe.C2, compressor.C1)
+    annotation (Line(points={{-40,70},{-20,70}}, color={0,0,255}));
+  connect(compressor.C2, lumpedStraightPipe1.C1)
+    annotation (Line(points={{0,70},{20,70}}, color={0,0,255}));
+  connect(lumpedStraightPipe1.C2, puitsP.C)
+    annotation (Line(points={{40,70},{60,70}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestCompressor;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestControlValve.mo b/ThermoSysPro/Examples/SimpleExamples/TestControlValve.mo
index 9cab2e6613aa28dd3085de700df1912b3e5f32ea..7323348259e7111579c2d327b65fdfec869e9de8 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestControlValve.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestControlValve.mo
@@ -1,57 +1,56 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestControlValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-64,-10},{-44,10}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{44,-10},{64,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve(mode_caract=1, caract=[
-        0,0; 0.5,3000; 0.75,7000; 1,8000])
-                                          annotation (Placement(transformation(
-          extent={{-10,-4},{10,16}},rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(           Table=[0,
-        0.9; 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2])
-    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
-equation
-  connect(ControlValve.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
-  connect(Constante1.y, ControlValve.Ouv)
-    annotation (Line(points={{-9,40},{0,40},{0,17}},      color={0,0,255}));
-  connect(SourceP1.C, ControlValve.C1)
-    annotation (Line(points={{-44,0},{-44,0},{-10,0}},
-                                                 color={0,0,255}));
-  annotation (experiment(StopTime=80),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestControlValve;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestControlValve
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-64,-10},{-44,10}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{44,-10},{64,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve(mode_caract=1, caract=[
+        0,0; 0.5,3000; 0.75,7000; 1,8000])
+                                          annotation (Placement(transformation(
+          extent={{-10,-4},{10,16}},rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(           Table=[0,
+        0.9; 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2])
+    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
+equation
+  connect(ControlValve.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
+  connect(Constante1.y, ControlValve.Ouv)
+    annotation (Line(points={{-9,40},{0,40},{0,17}},      color={0,0,255}));
+  connect(SourceP1.C, ControlValve.C1)
+    annotation (Line(points={{-44,0},{-44,0},{-10,0}},
+                                                 color={0,0,255}));
+  annotation (experiment(StopTime=80),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestControlValve;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDiaphragm.mo b/ThermoSysPro/Examples/SimpleExamples/TestDiaphragm.mo
index f657409025a24c4c55e5ab99596c4d5d0b98411b..cd41802f12aacb800656e3be64716a2adad4fbb6 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDiaphragm.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDiaphragm.mo
@@ -1,50 +1,49 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDiaphragm
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{44,-10},{64,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.Diaphragm Diaphragm
-                                          annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}},
-                                    rotation=0)));
-equation
-  connect(Diaphragm.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
-  connect(SourceP1.C, Diaphragm.C1)
-    annotation (Line(points={{-44,0},{-10,0}},   color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDiaphragm;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDiaphragm
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{44,-10},{64,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.Diaphragm Diaphragm
+                                          annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}},
+                                    rotation=0)));
+equation
+  connect(Diaphragm.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
+  connect(SourceP1.C, Diaphragm.C1)
+    annotation (Line(points={{-44,0},{-10,0}},   color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDiaphragm;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump.mo
index 49a61153eda0f4e19f75853fcdc7d218ad20ce19..d55612ce627f02dd1d533da01775291d05e3555d 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump.mo
@@ -1,74 +1,73 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicCentrifugalPump
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
-                                          width=200, period=400)
-    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
-          rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor Motor1(Im(start=1800))
-                                           annotation (Placement(transformation(
-          extent={{-80,-80},{-60,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
-    DynamicCentrifugalPump1(Ch(start=300))
-    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
-    ze2=10,
-    zs2=10)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
-                                                  k=0.5) annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
-    annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}, rotation=
-           0)));
-equation
-  connect(Pulse1.yL, Motor1.marche)
-    annotation (Line(points={{-79,-50},{-70,-50},{-70,-65.6}}));
-  connect(DynamicCentrifugalPump1.C2, Tank.Ce2)
-    annotation (Line(points={{-20,-30.2},{-60,-30.2},{-60,24},{-20,24}}, color=
-          {0,0,255}));
-  connect(Tank.Cs2, Valve.C1)
-    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
-  connect(Valve.C2, DynamicCentrifugalPump1.C1)
-    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
-  connect(Constante1.y, Valve.Ouv)
-    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
-  connect(Motor1.C, Shaft1.C1)
-    annotation (Line(points={{-59.8,-70},{-41,-70}}));
-  connect(DynamicCentrifugalPump1.M, Shaft1.C2)
-    annotation (Line(points={{-10,-41},{-10,-70},{-19,-70}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicCentrifugalPump;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicCentrifugalPump
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
+                                          width=200, period=400)
+    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
+          rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor Motor1(Im(start=1800))
+                                           annotation (Placement(transformation(
+          extent={{-80,-80},{-60,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
+    DynamicCentrifugalPump1(Ch(start=300))
+    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
+    ze2=10,
+    zs2=10)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
+                                                  k=0.5) annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
+    annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}, rotation=
+           0)));
+equation
+  connect(Pulse1.yL, Motor1.marche)
+    annotation (Line(points={{-79,-50},{-70,-50},{-70,-65.6}}));
+  connect(DynamicCentrifugalPump1.C2, Tank.Ce2)
+    annotation (Line(points={{-20,-30.2},{-60,-30.2},{-60,24},{-20,24}}, color=
+          {0,0,255}));
+  connect(Tank.Cs2, Valve.C1)
+    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
+  connect(Valve.C2, DynamicCentrifugalPump1.C1)
+    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
+  connect(Constante1.y, Valve.Ouv)
+    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
+  connect(Motor1.C, Shaft1.C1)
+    annotation (Line(points={{-59.8,-70},{-41,-70}}));
+  connect(DynamicCentrifugalPump1.M, Shaft1.C2)
+    annotation (Line(points={{-10,-41},{-10,-70},{-19,-70}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicCentrifugalPump;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump1.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump1.mo
index 092a2cb85665f9a13b7808ae1c5bd91b1cb44939..d25e3a3529432e148355c55e783bd1a0d66d61d7 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump1.mo
@@ -1,78 +1,77 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicCentrifugalPump1
-
-  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
-    DynamicCentrifugalPump1(                                                      C2(P(
-          start=3.e5)), Ch(start=300))
-    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
-    ze2=10,
-    zs2=10,
-    steady_state=false)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
-                                                  k=0.5) annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceMechanicalPower
-    sourceTorque
-    annotation (Placement(transformation(extent={{-70,-80},{-50,-60}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    width=200,
-    period=500,
-    amplitude=150000) annotation (Placement(transformation(extent={{-100,-80},{
-            -80,-60}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
-    annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}, rotation=
-           0)));
-equation
-  connect(DynamicCentrifugalPump1.C2, Tank.Ce2)
-    annotation (Line(points={{-20,-30.2},{-60,-30.2},{-60,24},{-20,24}}, color=
-          {0,0,255}));
-  connect(Tank.Cs2, Valve.C1)
-    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
-  connect(Valve.C2, DynamicCentrifugalPump1.C1)
-    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
-  connect(Constante1.y, Valve.Ouv)
-    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
-  connect(pulse.y, sourceTorque.IPower) annotation (Line(points={{-79,-70},{-65,
-          -70}}));
-  connect(Shaft1.C2, DynamicCentrifugalPump1.M)
-    annotation (Line(points={{-19,-70},{-10,-70},{-10,-41}}));
-  connect(sourceTorque.M, Shaft1.C1) annotation (Line(points={{-49,-70},{-41,
-          -70}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicCentrifugalPump1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicCentrifugalPump1
+  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
+    DynamicCentrifugalPump1(                                                      C2(P(
+          start=3.e5)), Ch(start=300))
+    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
+    ze2=10,
+    zs2=10,
+    steady_state=false)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
+                                                  k=0.5) annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceMechanicalPower
+    sourceTorque
+    annotation (Placement(transformation(extent={{-70,-80},{-50,-60}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    width=200,
+    period=500,
+    amplitude=150000) annotation (Placement(transformation(extent={{-100,-80},{
+            -80,-60}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
+    annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}, rotation=
+           0)));
+equation
+  connect(DynamicCentrifugalPump1.C2, Tank.Ce2)
+    annotation (Line(points={{-20,-30.2},{-60,-30.2},{-60,24},{-20,24}}, color=
+          {0,0,255}));
+  connect(Tank.Cs2, Valve.C1)
+    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
+  connect(Valve.C2, DynamicCentrifugalPump1.C1)
+    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
+  connect(Constante1.y, Valve.Ouv)
+    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
+  connect(pulse.y, sourceTorque.IPower) annotation (Line(points={{-79,-70},{-65,
+          -70}}));
+  connect(Shaft1.C2, DynamicCentrifugalPump1.M)
+    annotation (Line(points={{-19,-70},{-10,-70},{-10,-41}}));
+  connect(sourceTorque.M, Shaft1.C1) annotation (Line(points={{-49,-70},{-41,
+          -70}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicCentrifugalPump1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump2.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump2.mo
index 03083beb0113ed2743ca28047f0cd9edcbdbdb77..107904fe10d2af69dd0565d42cb2dea2d6489049 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicCentrifugalPump2.mo
@@ -1,113 +1,112 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicCentrifugalPump2
-  import ThermoSysPro;
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
-                                          width=200, period=400)
-    annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}, rotation=
-           0)));
-  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor Motor1(Im(start=1800))
-                                           annotation (Placement(transformation(
-          extent={{-40,-80},{-20,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
-    DynamicCentrifugalPump1(         continuous_flow_reversal=true,
-    J=10,
-    Cf0=1000,
-    Ch(start=300))
-    annotation (Placement(transformation(extent={{40,-40},{20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
-    ze2=10,
-    zs2=10)
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
-    annotation (Placement(transformation(extent={{0,-80},{20,-60}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=200,
-    Duration=100,
-    Initialvalue=0.5,
-    Finalvalue=0) annotation (Placement(transformation(extent={{-100,60},{-80,
-            80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.DynamicReliefValve dynamicReliefValve(
-      mech_steady_state=false) annotation (Placement(transformation(extent={{-20,
-            -10},{0,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA
-    annotation (Placement(transformation(extent={{0,-20},{-20,-40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{20,-10},{40,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve1
-    annotation (Placement(transformation(extent={{-20,32},{0,52}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-60,26},{-40,46}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=
-        15) annotation (Placement(transformation(extent={{-60,80},{-40,100}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Feedback feedback
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-equation
-  connect(Pulse1.yL, Motor1.marche)
-    annotation (Line(points={{-39,-50},{-30,-50},{-30,-65.6}}));
-  connect(Motor1.C, Shaft1.C1)
-    annotation (Line(points={{-19.8,-70},{-1,-70}}));
-  connect(DynamicCentrifugalPump1.M, Shaft1.C2)
-    annotation (Line(points={{30,-41},{30,-70},{21,-70}}));
-  connect(rampe.y, Valve.Ouv) annotation (Line(points={{-79,70},{-70,70},{-70,
-          41}}));
-  connect(DynamicCentrifugalPump1.C2, volumeA.Ce1) annotation (Line(points={{20,
-          -30.2},{10,-30.2},{10,-30},{0,-30}}, color={0,0,255}));
-  connect(dynamicReliefValve.C1, volumeA.Cs2)
-    annotation (Line(points={{-10,-9.8},{-10,-20}}));
-  connect(dynamicReliefValve.C2, sinkP.C) annotation (Line(points={{0,0},{10,0},
-          {10,0},{20,0}},       color={0,0,255}));
-  connect(volumeA.Cs1, Valve.C1) annotation (Line(points={{-20,-30},{-100,-30},
-          {-100,24},{-80,24}}, color={0,0,255}));
-  connect(Valve.C2, Tank.Ce2)
-    annotation (Line(points={{-60,24},{20,24}}, color={0,0,255}));
-  connect(Tank.Cs2, DynamicCentrifugalPump1.C1) annotation (Line(points={{40,24},
-          {80,24},{80,-30},{40,-30}}, color={0,0,255}));
-  connect(Valve1.C2, Tank.Ce1)
-    annotation (Line(points={{0,36},{20,36}}, color={0,0,255}));
-  connect(sourceP.C, Valve1.C1)
-    annotation (Line(points={{-40,36},{-20,36}}, color={0,0,255}));
-  connect(constante.y, feedback.u1) annotation (Line(points={{-39,90},{-21,90}}));
-  connect(Tank.yLevel, feedback.u2)
-    annotation (Line(points={{41,32},{60,32},{60,70},{-10,70},{-10,79}}));
-  connect(feedback.y, pIsat.u) annotation (Line(points={{1,90},{19,90}}));
-  connect(pIsat.y, Valve1.Ouv)
-    annotation (Line(points={{41,90},{80,90},{80,60},{-10,60},{-10,53}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicCentrifugalPump2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicCentrifugalPump2
+  import ThermoSysPro;
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
+                                          width=200, period=400)
+    annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}, rotation=
+           0)));
+  ThermoSysPro.ElectroMechanics.Machines.SynchronousMotor Motor1(Im(start=1800))
+                                           annotation (Placement(transformation(
+          extent={{-40,-80},{-20,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
+    DynamicCentrifugalPump1(         continuous_flow_reversal=true,
+    J=10,
+    Cf0=1000,
+    Ch(start=300))
+    annotation (Placement(transformation(extent={{40,-40},{20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Tank(
+    ze2=10,
+    zs2=10)
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
+    annotation (Placement(transformation(extent={{0,-80},{20,-60}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=200,
+    Duration=100,
+    Initialvalue=0.5,
+    Finalvalue=0) annotation (Placement(transformation(extent={{-100,60},{-80,
+            80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.DynamicReliefValve dynamicReliefValve(
+      mech_steady_state=false) annotation (Placement(transformation(extent={{-20,
+            -10},{0,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA
+    annotation (Placement(transformation(extent={{0,-20},{-20,-40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{20,-10},{40,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve1
+    annotation (Placement(transformation(extent={{-20,32},{0,52}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-60,26},{-40,46}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=
+        15) annotation (Placement(transformation(extent={{-60,80},{-40,100}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Feedback feedback
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+equation
+  connect(Pulse1.yL, Motor1.marche)
+    annotation (Line(points={{-39,-50},{-30,-50},{-30,-65.6}}));
+  connect(Motor1.C, Shaft1.C1)
+    annotation (Line(points={{-19.8,-70},{-1,-70}}));
+  connect(DynamicCentrifugalPump1.M, Shaft1.C2)
+    annotation (Line(points={{30,-41},{30,-70},{21,-70}}));
+  connect(rampe.y, Valve.Ouv) annotation (Line(points={{-79,70},{-70,70},{-70,
+          41}}));
+  connect(DynamicCentrifugalPump1.C2, volumeA.Ce1) annotation (Line(points={{20,
+          -30.2},{10,-30.2},{10,-30},{0,-30}}, color={0,0,255}));
+  connect(dynamicReliefValve.C1, volumeA.Cs2)
+    annotation (Line(points={{-10,-9.8},{-10,-20}}));
+  connect(dynamicReliefValve.C2, sinkP.C) annotation (Line(points={{0,0},{10,0},
+          {10,0},{20,0}},       color={0,0,255}));
+  connect(volumeA.Cs1, Valve.C1) annotation (Line(points={{-20,-30},{-100,-30},
+          {-100,24},{-80,24}}, color={0,0,255}));
+  connect(Valve.C2, Tank.Ce2)
+    annotation (Line(points={{-60,24},{20,24}}, color={0,0,255}));
+  connect(Tank.Cs2, DynamicCentrifugalPump1.C1) annotation (Line(points={{40,24},
+          {80,24},{80,-30},{40,-30}}, color={0,0,255}));
+  connect(Valve1.C2, Tank.Ce1)
+    annotation (Line(points={{0,36},{20,36}}, color={0,0,255}));
+  connect(sourceP.C, Valve1.C1)
+    annotation (Line(points={{-40,36},{-20,36}}, color={0,0,255}));
+  connect(constante.y, feedback.u1) annotation (Line(points={{-39,90},{-21,90}}));
+  connect(Tank.yLevel, feedback.u2)
+    annotation (Line(points={{41,32},{60,32},{60,70},{-10,70},{-10,79}}));
+  connect(feedback.y, pIsat.u) annotation (Line(points={{1,90},{19,90}}));
+  connect(pIsat.y, Valve1.Ouv)
+    annotation (Line(points={{41,90},{80,90},{80,60},{-10,60},{-10,53}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicCentrifugalPump2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicCheckValve.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicCheckValve.mo
index 0e3127463ceba99d44af59f429c794f20d2e295d..cdc37ee99e3eeb12d0fd9956ac54e391358b3623 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicCheckValve.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicCheckValve.mo
@@ -1,58 +1,57 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicCheckValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-38,-10},{-18,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{42,-10},{62,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.DynamicCheckValve checkValve(J=10)
-    annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(
-    period=100,
-    amplitude=3e5,
-    offset=6e5) annotation (Placement(transformation(extent={{-78,-10},{-58,10}},
-          rotation=0)));
-equation
-  connect(sourceP1.C, checkValve.C1)
-    annotation (Line(points={{-18,0},{2,0}},   color={0,0,255}));
-  connect(checkValve.C2, puitsP1.C) annotation (Line(points={{22,0},{32,0},{42,
-          0}},             color={0,0,255}));
-  connect(sourceP1.IPressure, pulse.y)
-    annotation (Line(points={{-33,0},{-57,0}},   color={28,108,200}));
-  annotation (
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    experiment(StopTime=300),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicCheckValve;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicCheckValve
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-38,-10},{-18,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{42,-10},{62,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.DynamicCheckValve checkValve(J=10)
+    annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(
+    period=100,
+    amplitude=3e5,
+    offset=6e5) annotation (Placement(transformation(extent={{-78,-10},{-58,10}},
+          rotation=0)));
+equation
+  connect(sourceP1.C, checkValve.C1)
+    annotation (Line(points={{-18,0},{2,0}},   color={0,0,255}));
+  connect(checkValve.C2, puitsP1.C) annotation (Line(points={{22,0},{32,0},{42,
+          0}},             color={0,0,255}));
+  connect(sourceP1.IPressure, pulse.y)
+    annotation (Line(points={{-33,0},{-57,0}},   color={28,108,200}));
+  annotation (
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    experiment(StopTime=300),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicCheckValve;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum.mo
index 45dc640a91ea890af72e3a2535c8c006004eaaa9..84c59c38b531baca5b8d6eeed1ecf0f4b24cbea1 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum.mo
@@ -1,170 +1,169 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicDrum
-  parameter Units.SI.MassFlowRate Qin(fixed=false, start=80) "Mass flow rate";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.085)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum Drum(
-    Vv(start=39),
-    Vertical=false,
-    hl(start=1454400),
-    hv(start=2.658e6),
-    xv(start=0.01),
-    rhol(start=670),
-    rhov(start=78),
-    P0=13000000,
-    P(start=13000000, fixed=true),
-    Tp(start=592.6),
-    zl(fixed=true, start=1.05))
-                     annotation (Placement(transformation(extent={{-61,18},{1,
-            80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=335),
-    C1(
-      h_vol(start=1400e3),
-      h(start=1400e3),
-      P(start=13300000),
-      Q(start=79.5)),
-    Q(start=79.5),
-    rho(start=888),
-    h(start=1400000),
-    Cvmax=CvmaxWater,
-    Pm(start=13100000))
-                     annotation (Placement(transformation(extent={{-120,76},{
-            -100,96}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cvmax(fixed=true) = 50000,
-    Cv(start=25000),
-    Q(start=79.5),
-    rho(start=78.5),
-    Pm(start=12900000),
-    h(start=2657930))
-    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon(k(fixed=true) = 0.5)
-    annotation (Placement(transformation(extent={{-160,122},{-140,142}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    TubeEcranBoucleEvaporatoire(
-    T0=fill(400, 10),
-    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
-    advection=false,
-    z2=10,
-    simplified_dynamic_energy_balance=false,
-    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
-          13002000,13001000,13000000,12999990}),
-    D=0.03,
-    ntubes=1400,
-    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
-          1900e3,1950e3}),
-    L=20,
-    Q(start=fill(130, 11)))
-                     annotation (Placement(transformation(
-        origin={6,-26},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
-    option_temperature=2,
-    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
-    T0={290,290,290,290,290,290,290,290,290,290})
-    annotation (Placement(transformation(
-        origin={36,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
-    D=0.03,
-    ntubes=1400)
-    annotation (Placement(transformation(
-        origin={18,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=20,
-    z1=20,
-    C1(P(start=130e5)),
-    mode=1,
-    Q(fixed=true, start=130),
-    lambda=LambdaPipe)
-             annotation (Placement(transformation(
-        origin={-66,-26},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon1(k(fixed=true) = 0.5)
-    annotation (Placement(transformation(extent={{0,122},{20,142}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(h0=1400000,
-    P0(fixed=true) = 13200000,
-    option_temperature=2)
-           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=75)
-    annotation (Placement(transformation(extent={{126,70},{146,90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    SteamMassFlowRate(k=Qin)
-    annotation (Placement(transformation(extent={{100,122},{120,142}}, rotation=
-           0)));
-equation
-  connect(Drum.Cv, SteamValve.C1)
-    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
-  connect(FeedwaterValve.C2, Drum.Ce1)
-    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
-  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
-          -66,18},{-66,-16}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
-          {26.2,-26}}, color={191,95,0}));
-  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
-    annotation (Line(points={{1,18},{6,18},{6,-16}}));
-  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
-        points={{9,-26},{16,-26}}, color={191,95,0}));
-  connect(ConsigneNiveauBallon.y, FeedwaterValve.Ouv)
-    annotation (Line(points={{-139,132},{-110,132},{-110,97}}, smooth=Smooth.None));
-  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(
-      points={{-176,80},{-120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(
-      points={{60,80},{126,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
-  connect(ConsigneNiveauBallon1.y, SteamValve.Ouv)
-    annotation (Line(points={{21,132},{50,132},{50,97}}, smooth=Smooth.None));
-  connect(SteamMassFlowRate.y, sinkQ.IMassFlow)
-    annotation (Line(points={{121,132},{136,132},{136,85}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicDrum;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicDrum
+  parameter Units.SI.MassFlowRate Qin(fixed=false, start=80) "Mass flow rate";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.085)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum Drum(
+    Vv(start=39),
+    Vertical=false,
+    hl(start=1454400),
+    hv(start=2.658e6),
+    xv(start=0.01),
+    rhol(start=670),
+    rhov(start=78),
+    P0=13000000,
+    P(start=13000000, fixed=true),
+    Tp(start=592.6),
+    zl(fixed=true, start=1.05))
+                     annotation (Placement(transformation(extent={{-61,18},{1,
+            80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=335),
+    C1(
+      h_vol(start=1400e3),
+      h(start=1400e3),
+      P(start=13300000),
+      Q(start=79.5)),
+    Q(start=79.5),
+    rho(start=888),
+    h(start=1400000),
+    Cvmax=CvmaxWater,
+    Pm(start=13100000))
+                     annotation (Placement(transformation(extent={{-120,76},{
+            -100,96}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cvmax(fixed=true) = 50000,
+    Cv(start=25000),
+    Q(start=79.5),
+    rho(start=78.5),
+    Pm(start=12900000),
+    h(start=2657930))
+    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon(k(fixed=true) = 0.5)
+    annotation (Placement(transformation(extent={{-160,122},{-140,142}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    TubeEcranBoucleEvaporatoire(
+    T0=fill(400, 10),
+    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
+    advection=false,
+    z2=10,
+    simplified_dynamic_energy_balance=false,
+    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
+          13002000,13001000,13000000,12999990}),
+    D=0.03,
+    ntubes=1400,
+    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
+          1900e3,1950e3}),
+    L=20,
+    Q(start=fill(130, 11)))
+                     annotation (Placement(transformation(
+        origin={6,-26},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
+    option_temperature=2,
+    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
+    T0={290,290,290,290,290,290,290,290,290,290})
+    annotation (Placement(transformation(
+        origin={36,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
+    D=0.03,
+    ntubes=1400)
+    annotation (Placement(transformation(
+        origin={18,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=20,
+    z1=20,
+    C1(P(start=130e5)),
+    mode=1,
+    Q(fixed=true, start=130),
+    lambda=LambdaPipe)
+             annotation (Placement(transformation(
+        origin={-66,-26},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon1(k(fixed=true) = 0.5)
+    annotation (Placement(transformation(extent={{0,122},{20,142}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(h0=1400000,
+    P0(fixed=true) = 13200000,
+    option_temperature=2)
+           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=75)
+    annotation (Placement(transformation(extent={{126,70},{146,90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    SteamMassFlowRate(k=Qin)
+    annotation (Placement(transformation(extent={{100,122},{120,142}}, rotation=
+           0)));
+equation
+  connect(Drum.Cv, SteamValve.C1)
+    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
+  connect(FeedwaterValve.C2, Drum.Ce1)
+    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
+  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
+          -66,18},{-66,-16}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
+          {26.2,-26}}, color={191,95,0}));
+  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
+    annotation (Line(points={{1,18},{6,18},{6,-16}}));
+  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
+        points={{9,-26},{16,-26}}, color={191,95,0}));
+  connect(ConsigneNiveauBallon.y, FeedwaterValve.Ouv)
+    annotation (Line(points={{-139,132},{-110,132},{-110,97}}, smooth=Smooth.None));
+  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(
+      points={{-176,80},{-120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(
+      points={{60,80},{126,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
+  connect(ConsigneNiveauBallon1.y, SteamValve.Ouv)
+    annotation (Line(points={{21,132},{50,132},{50,97}}, smooth=Smooth.None));
+  connect(SteamMassFlowRate.y, sinkQ.IMassFlow)
+    annotation (Line(points={{121,132},{136,132},{136,85}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicDrum;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum1.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum1.mo
index 57570ca7e2d4eff67f6233e8d89254cec8fc9ce6..ec37cbfef0eea66adeff0a375ed19791858660f2 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum1.mo
@@ -1,166 +1,165 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicDrum1
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670.775)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.085)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-  parameter Real SteamValveOuv(fixed=false,start=0.4933)
-    "Position of the SteamValve (between 0 and 1) ";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum Drum(
-    Vv(start=39),
-    Vertical=false,
-    hl(start=1454400),
-    hv(start=2.658e6),
-    xv(start=0.01),
-    rhol(start=670),
-    rhov(start=78),
-    zl(fixed=true, start=1.05),
-    P0=13000000,
-    P(start=13000000, fixed=true),
-    Tp(start=592.6),
-    Pfond(start=13000690),
-    Vl(start=28.176))  annotation (Placement(transformation(extent={{-61,18},{1,
-            80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=335),
-    C1(
-      h_vol(start=1400e3),
-      h(start=1400e3),
-      P(start=13300000),
-      Q(start=79.5)),
-    Q(start=79.5),
-    rho(start=888),
-    h(start=1400000),
-    Pm(start=13100000),
-    Cvmax=CvmaxWater)
-                     annotation (Placement(transformation(extent={{-120,76},{
-            -100,96}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cvmax(fixed=true) = 50000,
-    Cv(start=25000),
-    Q(start=79.5),
-    rho(start=78.5),
-    Pm(start=12900000),
-    h(start=2657930))
-    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon(k(fixed=true) = 0.5)
-    annotation (Placement(transformation(extent={{-160,122},{-140,142}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    TubeEcranBoucleEvaporatoire(
-    T0=fill(400, 10),
-    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
-    advection=false,
-    z2=10,
-    simplified_dynamic_energy_balance=false,
-    D=0.03,
-    ntubes=1400,
-    L=20,
-    Q(start=fill(130, 11)),
-    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
-          13002000,13001000,13000000,12999990}),
-    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
-          1900e3,1950e3}))
-                     annotation (Placement(transformation(
-        origin={6,-26},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
-    option_temperature=2,
-    T0={290,290,290,290,290,290,290,290,290,290},
-    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7})
-    annotation (Placement(transformation(
-        origin={36,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
-    D=0.03,
-    ntubes=1400)
-    annotation (Placement(transformation(
-        origin={18,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=20,
-    z1=20,
-    C1(P(start=130e5)),
-    mode=1,
-    Q(fixed=true, start=130),
-    lambda=LambdaPipe,
-    Pm(start=13018800))
-             annotation (Placement(transformation(
-        origin={-66,-26},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon1(k=SteamValveOuv)
-    annotation (Placement(transformation(extent={{0,122},{20,142}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(h0=1400000,
-    option_temperature=2,
-    P0=13200000)
-           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP sinkQ(             P0=12700000)
-    annotation (Placement(transformation(extent={{120,70},{140,90}}, rotation=0)));
-equation
-  connect(Drum.Cv, SteamValve.C1)
-    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
-  connect(FeedwaterValve.C2, Drum.Ce1)
-    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
-  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
-          -66,18},{-66,-16}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
-          {26.2,-26}}, color={191,95,0}));
-  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
-    annotation (Line(points={{1,18},{6,18},{6,-16}}));
-  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
-        points={{9,-26},{16,-26}}, color={191,95,0}));
-  connect(ConsigneNiveauBallon.y, FeedwaterValve.Ouv)
-    annotation (Line(points={{-139,132},{-110,132},{-110,97}}, smooth=Smooth.None));
-  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(
-      points={{-176,80},{-120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(
-      points={{60,80},{120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
-  connect(ConsigneNiveauBallon1.y, SteamValve.Ouv)
-    annotation (Line(points={{21,132},{50,132},{50,97}}, smooth=Smooth.None));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicDrum1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicDrum1
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670.775)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.085)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  parameter Real SteamValveOuv(fixed=false,start=0.4933)
+    "Position of the SteamValve (between 0 and 1) ";
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum Drum(
+    Vv(start=39),
+    Vertical=false,
+    hl(start=1454400),
+    hv(start=2.658e6),
+    xv(start=0.01),
+    rhol(start=670),
+    rhov(start=78),
+    zl(fixed=true, start=1.05),
+    P0=13000000,
+    P(start=13000000, fixed=true),
+    Tp(start=592.6),
+    Pfond(start=13000690),
+    Vl(start=28.176))  annotation (Placement(transformation(extent={{-61,18},{1,
+            80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=335),
+    C1(
+      h_vol(start=1400e3),
+      h(start=1400e3),
+      P(start=13300000),
+      Q(start=79.5)),
+    Q(start=79.5),
+    rho(start=888),
+    h(start=1400000),
+    Pm(start=13100000),
+    Cvmax=CvmaxWater)
+                     annotation (Placement(transformation(extent={{-120,76},{
+            -100,96}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cvmax(fixed=true) = 50000,
+    Cv(start=25000),
+    Q(start=79.5),
+    rho(start=78.5),
+    Pm(start=12900000),
+    h(start=2657930))
+    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon(k(fixed=true) = 0.5)
+    annotation (Placement(transformation(extent={{-160,122},{-140,142}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    TubeEcranBoucleEvaporatoire(
+    T0=fill(400, 10),
+    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
+    advection=false,
+    z2=10,
+    simplified_dynamic_energy_balance=false,
+    D=0.03,
+    ntubes=1400,
+    L=20,
+    Q(start=fill(130, 11)),
+    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
+          13002000,13001000,13000000,12999990}),
+    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
+          1900e3,1950e3}))
+                     annotation (Placement(transformation(
+        origin={6,-26},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
+    option_temperature=2,
+    T0={290,290,290,290,290,290,290,290,290,290},
+    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7})
+    annotation (Placement(transformation(
+        origin={36,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
+    D=0.03,
+    ntubes=1400)
+    annotation (Placement(transformation(
+        origin={18,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=20,
+    z1=20,
+    C1(P(start=130e5)),
+    mode=1,
+    Q(fixed=true, start=130),
+    lambda=LambdaPipe,
+    Pm(start=13018800))
+             annotation (Placement(transformation(
+        origin={-66,-26},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon1(k=SteamValveOuv)
+    annotation (Placement(transformation(extent={{0,122},{20,142}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(h0=1400000,
+    option_temperature=2,
+    P0=13200000)
+           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP sinkQ(             P0=12700000)
+    annotation (Placement(transformation(extent={{120,70},{140,90}}, rotation=0)));
+equation
+  connect(Drum.Cv, SteamValve.C1)
+    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
+  connect(FeedwaterValve.C2, Drum.Ce1)
+    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
+  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
+          -66,18},{-66,-16}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
+          {26.2,-26}}, color={191,95,0}));
+  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
+    annotation (Line(points={{1,18},{6,18},{6,-16}}));
+  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
+        points={{9,-26},{16,-26}}, color={191,95,0}));
+  connect(ConsigneNiveauBallon.y, FeedwaterValve.Ouv)
+    annotation (Line(points={{-139,132},{-110,132},{-110,97}}, smooth=Smooth.None));
+  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(
+      points={{-176,80},{-120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(
+      points={{60,80},{120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
+  connect(ConsigneNiveauBallon1.y, SteamValve.Ouv)
+    annotation (Line(points={{21,132},{50,132},{50,97}}, smooth=Smooth.None));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicDrum1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum2.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum2.mo
index 4214114ef356d5b52a61e33d50a2688a0a309576..b53f6d5bd9c04e40032d2ec2c6c6be974d60be22 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum2.mo
@@ -1,177 +1,175 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicDrum2
-  //parameter Modelica.SIunits.MassFlowRate Qin(fixed=false,start=80)
-  //  "Mass flow rate";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.085)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum Drum(
-    Vv(start=39),
-    Vertical=false,
-    hl(start=1454400),
-    hv(start=2.658e6),
-    xv(start=0.01),
-    rhol(start=670),
-    rhov(start=78),
-    zl(fixed=true, start=1.05),
-    P0=13000000,
-    P(start=13000000, fixed=false),
-    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,18},{1,
-            80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=335),
-    Q(start=79.5),
-    rho(start=888),
-    h(start=1400000),
-    C1(
-      h_vol(start=1400e3),
-      h(start=1400e3),
-      Q(start=79.5),
-      P(start=13300000)),
-    Cvmax=CvmaxWater,
-    Pm(start=13100000))
-                     annotation (Placement(transformation(extent={{-120,76},{
-            -100,96}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Q(start=79.5),
-    rho(start=78.5),
-    h(start=2657930),
-    Cvmax=10000,
-    Pm(start=12900000))
-    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    TubeEcranBoucleEvaporatoire(
-    T0=fill(400, 10),
-    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
-    advection=false,
-    z2=10,
-    simplified_dynamic_energy_balance=false,
-    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
-          13002000,13001000,13000000,12999990}),
-    D=0.03,
-    ntubes=1400,
-    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
-          1900e3,1950e3}),
-    L=20,
-    Q(start=fill(130, 11)))
-                     annotation (Placement(transformation(
-        origin={6,-26},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
-    option_temperature=2,
-    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
-    T0={290,290,290,290,290,290,290,290,290,290})
-    annotation (Placement(transformation(
-        origin={36,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
-    D=0.03,
-    ntubes=1400)
-    annotation (Placement(transformation(
-        origin={18,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=20,
-    z1=20,
-    C1(P(start=130e5)),
-    mode=1,
-    Q(fixed=true, start=130),
-    lambda=LambdaPipe)
-             annotation (Placement(transformation(
-        origin={-66,-26},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  WaterSteam.BoundaryConditions.SourceP              sourceQ(h0=1400000,
-    option_temperature=2,
-    mode=0,
-    P0=13300000)
-           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP              sinkP(
-    option_temperature=2,
-    mode=0,
-    h0=2.650e6,
-    P0=12700000)
-    annotation (Placement(transformation(extent={{115,70},{135,90}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante   Ouv_ValveSteam(k=0.5)
-                                 annotation (Placement(transformation(extent={{20,102},
-            {40,121}},         rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
-        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
-        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
-    annotation (Placement(transformation(extent={{96,99},{120,123}},  rotation=
-            0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Ouv_Water(k=0.5)
-    annotation (Placement(transformation(extent={{-83,102},{-102,121}},
-          rotation=0)));
-equation
-  connect(Drum.Cv, SteamValve.C1)
-    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
-  connect(FeedwaterValve.C2, Drum.Ce1)
-    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
-  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
-          -66,18},{-66,-16}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
-          {26.2,-26}}, color={191,95,0}));
-  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
-    annotation (Line(points={{1,18},{6,18},{6,-16}}));
-  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
-        points={{9,-26},{16,-26}}, color={191,95,0}));
-  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
-      points={{-176,80},{-120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(SteamValve.C2,sinkP. C) annotation (Line(
-      points={{60,80},{115,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
-  connect(Ouv_ValveSteam.y, SteamValve.Ouv)
-    annotation (Line(points={{41,111.5},{50,111.5},{50,97}},
-                                                           color={0,0,255}));
-  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
-          111},{130,111},{130,80}}, color={0,0,255}));
-
-  connect(Ouv_Water.y, FeedwaterValve.Ouv) annotation (Line(points={{-102.95,
-          111.5},{-110,111.5},{-110,97}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicDrum2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicDrum2
+  //parameter Modelica.SIunits.MassFlowRate Qin(fixed=false,start=80)
+  //  "Mass flow rate";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.085)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum Drum(
+    Vv(start=39),
+    Vertical=false,
+    hl(start=1454400),
+    hv(start=2.658e6),
+    xv(start=0.01),
+    rhol(start=670),
+    rhov(start=78),
+    zl(fixed=true, start=1.05),
+    P0=13000000,
+    P(start=13000000, fixed=false),
+    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,18},{1,
+            80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=335),
+    Q(start=79.5),
+    rho(start=888),
+    h(start=1400000),
+    C1(
+      h_vol(start=1400e3),
+      h(start=1400e3),
+      Q(start=79.5),
+      P(start=13300000)),
+    Cvmax=CvmaxWater,
+    Pm(start=13100000))
+                     annotation (Placement(transformation(extent={{-120,76},{
+            -100,96}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Q(start=79.5),
+    rho(start=78.5),
+    h(start=2657930),
+    Cvmax=10000,
+    Pm(start=12900000))
+    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    TubeEcranBoucleEvaporatoire(
+    T0=fill(400, 10),
+    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
+    advection=false,
+    z2=10,
+    simplified_dynamic_energy_balance=false,
+    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
+          13002000,13001000,13000000,12999990}),
+    D=0.03,
+    ntubes=1400,
+    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
+          1900e3,1950e3}),
+    L=20,
+    Q(start=fill(130, 11)))
+                     annotation (Placement(transformation(
+        origin={6,-26},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
+    option_temperature=2,
+    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
+    T0={290,290,290,290,290,290,290,290,290,290})
+    annotation (Placement(transformation(
+        origin={36,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
+    D=0.03,
+    ntubes=1400)
+    annotation (Placement(transformation(
+        origin={18,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=20,
+    z1=20,
+    C1(P(start=130e5)),
+    mode=1,
+    Q(fixed=true, start=130),
+    lambda=LambdaPipe)
+             annotation (Placement(transformation(
+        origin={-66,-26},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  WaterSteam.BoundaryConditions.SourceP              sourceQ(h0=1400000,
+    option_temperature=2,
+    mode=0,
+    P0=13300000)
+           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP              sinkP(
+    option_temperature=2,
+    mode=0,
+    h0=2.650e6,
+    P0=12700000)
+    annotation (Placement(transformation(extent={{115,70},{135,90}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante   Ouv_ValveSteam(k=0.5)
+                                 annotation (Placement(transformation(extent={{20,102},
+            {40,121}},         rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
+        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
+        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
+    annotation (Placement(transformation(extent={{96,99},{120,123}},  rotation=
+            0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Ouv_Water(k=0.5)
+    annotation (Placement(transformation(extent={{-83,102},{-102,121}},
+          rotation=0)));
+equation
+  connect(Drum.Cv, SteamValve.C1)
+    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
+  connect(FeedwaterValve.C2, Drum.Ce1)
+    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
+  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
+          -66,18},{-66,-16}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
+          {26.2,-26}}, color={191,95,0}));
+  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
+    annotation (Line(points={{1,18},{6,18},{6,-16}}));
+  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
+        points={{9,-26},{16,-26}}, color={191,95,0}));
+  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
+      points={{-176,80},{-120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(SteamValve.C2,sinkP. C) annotation (Line(
+      points={{60,80},{115,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
+  connect(Ouv_ValveSteam.y, SteamValve.Ouv)
+    annotation (Line(points={{41,111.5},{50,111.5},{50,97}},
+                                                           color={0,0,255}));
+  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
+          111},{130,111},{130,80}}, color={0,0,255}));
+  connect(Ouv_Water.y, FeedwaterValve.Ouv) annotation (Line(points={{-102.95,
+          111.5},{-110,111.5},{-110,97}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicDrum2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum3.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum3.mo
index 1dcbf2adffa1e0ab1eec419518b9648b1d54928e..7a99eaea5b6b4ee7a117d1e628c3eb10d5ec556a 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum3.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum3.mo
@@ -1,170 +1,169 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicDrum3
-  parameter Units.SI.MassFlowRate Qin(fixed=false, start=80) "Mass flow rate";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.085)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum Drum(
-    Vv(start=39),
-    Vertical=false,
-    hl(start=1454400),
-    hv(start=2.658e6),
-    xv(start=0.01),
-    rhol(start=670),
-    rhov(start=78),
-    P0=13000000,
-    P(start=13000000, fixed=true),
-    Tp(start=592.6),
-    zl(fixed=true, start=1.05))
-                     annotation (Placement(transformation(extent={{-61,18},{1,
-            80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=335),
-    C1(
-      h_vol(start=1400e3),
-      h(start=1400e3),
-      P(start=13300000),
-      Q(start=79.5)),
-    Q(start=79.5),
-    rho(start=888),
-    h(start=1400000),
-    Cvmax=CvmaxWater,
-    Pm(start=13100000))
-                     annotation (Placement(transformation(extent={{-120,76},{
-            -100,96}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cvmax(fixed=true) = 50000,
-    Cv(start=25000),
-    Q(start=79.5),
-    rho(start=78.5),
-    Pm(start=12900000),
-    h(start=2657930))
-    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon(k(fixed=true) = 0.5)
-    annotation (Placement(transformation(extent={{-160,122},{-140,142}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    TubeEcranBoucleEvaporatoire(
-    T0=fill(400, 10),
-    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
-    advection=false,
-    z2=10,
-    simplified_dynamic_energy_balance=false,
-    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
-          13002000,13001000,13000000,12999990}),
-    D=0.03,
-    ntubes=1400,
-    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
-          1900e3,1950e3}),
-    L=20,
-    Q(start=fill(130, 11)))
-                     annotation (Placement(transformation(
-        origin={6,-26},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
-    option_temperature=2,
-    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
-    T0={290,290,290,290,290,290,290,290,290,290})
-    annotation (Placement(transformation(
-        origin={36,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
-    D=0.03,
-    ntubes=1400)
-    annotation (Placement(transformation(
-        origin={18,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=20,
-    z1=20,
-    C1(P(start=130e5)),
-    mode=1,
-    Q(fixed=true, start=130),
-    lambda=LambdaPipe)
-             annotation (Placement(transformation(
-        origin={-66,-26},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon1(k(fixed=true) = 0.5)
-    annotation (Placement(transformation(extent={{0,122},{20,142}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(h0=1400000,
-    P0(fixed=true) = 13200000,
-    option_temperature=2)
-           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=75)
-    annotation (Placement(transformation(extent={{126,70},{146,90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    SteamMassFlowRate(k=Qin)
-    annotation (Placement(transformation(extent={{100,122},{120,142}}, rotation=
-           0)));
-equation
-  connect(Drum.Cv, SteamValve.C1)
-    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
-  connect(FeedwaterValve.C2, Drum.Ce1)
-    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
-  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
-          -66,18},{-66,-16}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
-          {26.2,-26}}, color={191,95,0}));
-  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
-    annotation (Line(points={{1,18},{6,18},{6,-16}}));
-  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
-        points={{9,-26},{16,-26}}, color={191,95,0}));
-  connect(ConsigneNiveauBallon.y, FeedwaterValve.Ouv)
-    annotation (Line(points={{-139,132},{-110,132},{-110,97}}, smooth=Smooth.None));
-  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(
-      points={{-176,80},{-120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(
-      points={{60,80},{126,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
-  connect(ConsigneNiveauBallon1.y, SteamValve.Ouv)
-    annotation (Line(points={{21,132},{50,132},{50,97}}, smooth=Smooth.None));
-  connect(SteamMassFlowRate.y, sinkQ.IMassFlow)
-    annotation (Line(points={{121,132},{136,132},{136,85}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicDrum3;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicDrum3
+  parameter Units.SI.MassFlowRate Qin(fixed=false, start=80) "Mass flow rate";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.085)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum Drum(
+    Vv(start=39),
+    Vertical=false,
+    hl(start=1454400),
+    hv(start=2.658e6),
+    xv(start=0.01),
+    rhol(start=670),
+    rhov(start=78),
+    P0=13000000,
+    P(start=13000000, fixed=true),
+    Tp(start=592.6),
+    zl(fixed=true, start=1.05))
+                     annotation (Placement(transformation(extent={{-61,18},{1,
+            80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=335),
+    C1(
+      h_vol(start=1400e3),
+      h(start=1400e3),
+      P(start=13300000),
+      Q(start=79.5)),
+    Q(start=79.5),
+    rho(start=888),
+    h(start=1400000),
+    Cvmax=CvmaxWater,
+    Pm(start=13100000))
+                     annotation (Placement(transformation(extent={{-120,76},{
+            -100,96}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cvmax(fixed=true) = 50000,
+    Cv(start=25000),
+    Q(start=79.5),
+    rho(start=78.5),
+    Pm(start=12900000),
+    h(start=2657930))
+    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon(k(fixed=true) = 0.5)
+    annotation (Placement(transformation(extent={{-160,122},{-140,142}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    TubeEcranBoucleEvaporatoire(
+    T0=fill(400, 10),
+    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
+    advection=false,
+    z2=10,
+    simplified_dynamic_energy_balance=false,
+    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
+          13002000,13001000,13000000,12999990}),
+    D=0.03,
+    ntubes=1400,
+    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
+          1900e3,1950e3}),
+    L=20,
+    Q(start=fill(130, 11)))
+                     annotation (Placement(transformation(
+        origin={6,-26},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
+    option_temperature=2,
+    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
+    T0={290,290,290,290,290,290,290,290,290,290})
+    annotation (Placement(transformation(
+        origin={36,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
+    D=0.03,
+    ntubes=1400)
+    annotation (Placement(transformation(
+        origin={18,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=20,
+    z1=20,
+    C1(P(start=130e5)),
+    mode=1,
+    Q(fixed=true, start=130),
+    lambda=LambdaPipe)
+             annotation (Placement(transformation(
+        origin={-66,-26},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon1(k(fixed=true) = 0.5)
+    annotation (Placement(transformation(extent={{0,122},{20,142}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(h0=1400000,
+    P0(fixed=true) = 13200000,
+    option_temperature=2)
+           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=75)
+    annotation (Placement(transformation(extent={{126,70},{146,90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    SteamMassFlowRate(k=Qin)
+    annotation (Placement(transformation(extent={{100,122},{120,142}}, rotation=
+           0)));
+equation
+  connect(Drum.Cv, SteamValve.C1)
+    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
+  connect(FeedwaterValve.C2, Drum.Ce1)
+    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
+  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
+          -66,18},{-66,-16}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
+          {26.2,-26}}, color={191,95,0}));
+  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
+    annotation (Line(points={{1,18},{6,18},{6,-16}}));
+  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
+        points={{9,-26},{16,-26}}, color={191,95,0}));
+  connect(ConsigneNiveauBallon.y, FeedwaterValve.Ouv)
+    annotation (Line(points={{-139,132},{-110,132},{-110,97}}, smooth=Smooth.None));
+  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(
+      points={{-176,80},{-120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(
+      points={{60,80},{126,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
+  connect(ConsigneNiveauBallon1.y, SteamValve.Ouv)
+    annotation (Line(points={{21,132},{50,132},{50,97}}, smooth=Smooth.None));
+  connect(SteamMassFlowRate.y, sinkQ.IMassFlow)
+    annotation (Line(points={{121,132},{136,132},{136,85}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicDrum3;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum_CC.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum_CC.mo
index fcb0dbe710c3dd6581a1b3663d7cc74cc4d7f71c..d07ab8d08c9b4542d1f238b7a41b1818dd0c8d1b 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum_CC.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicDrum_CC.mo
@@ -1,190 +1,188 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicDrum_CC
-  //parameter Modelica.SIunits.MassFlowRate Qin(fixed=false,start=80)
-  //  "Mass flow rate";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.085)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  WaterSteam.Volumes.DynamicDrum              Drum(
-    Vv(start=39),
-    Vertical=false,
-    hl(start=1454400),
-    hv(start=2.658e6),
-    xv(start=0.01),
-    rhol(start=670),
-    rhov(start=78),
-    zl(fixed=true, start=1.05),
-    P0=13000000,
-    P(start=13000000, fixed=false),
-    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,18},{1,
-            80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=335),
-    Q(start=79.5),
-    rho(start=888),
-    h(start=1400000),
-    C1(
-      h_vol(start=1400e3),
-      h(start=1400e3),
-      Q(start=79.5),
-      P(start=13300000)),
-    Cvmax=CvmaxWater,
-    Pm(start=13100000))
-                     annotation (Placement(transformation(extent={{-120,76},{
-            -100,96}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Q(start=79.5),
-    rho(start=78.5),
-    h(start=2657930),
-    Cvmax=10000,
-    Pm(start=12900000))
-    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    TubeEcranBoucleEvaporatoire(
-    T0=fill(400, 10),
-    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
-    advection=false,
-    z2=10,
-    simplified_dynamic_energy_balance=false,
-    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
-          13002000,13001000,13000000,12999990}),
-    D=0.03,
-    ntubes=1400,
-    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
-          1900e3,1950e3}),
-    L=20,
-    Q(start=fill(130, 11)))
-                     annotation (Placement(transformation(
-        origin={6,-26},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
-    option_temperature=2,
-    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
-    T0={290,290,290,290,290,290,290,290,290,290})
-    annotation (Placement(transformation(
-        origin={36,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
-    D=0.03,
-    ntubes=1400)
-    annotation (Placement(transformation(
-        origin={18,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=20,
-    z1=20,
-    C1(P(start=130e5)),
-    mode=1,
-    Q(fixed=true, start=130),
-    lambda=LambdaPipe)
-             annotation (Placement(transformation(
-        origin={-66,-26},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  WaterSteam.BoundaryConditions.SourceP              sourceQ(h0=1400000,
-    option_temperature=2,
-    mode=0,
-    P0=13300000)
-           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP              sinkP(
-    option_temperature=2,
-    mode=0,
-    h0=2.650e6,
-    P0=12700000)
-    annotation (Placement(transformation(extent={{115,70},{135,90}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k=0.5)
-    annotation (Placement(transformation(extent={{20,102},{40,121}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
-        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
-        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
-    annotation (Placement(transformation(extent={{96,99},{120,123}},  rotation=
-            0)));
-  Control.Drum_LevelControl regulation_Niveau(
-    add(k1=-1, k2=+1),
-    Ti=50,
-    pIsat(
-      ureset0=0.5,
-      Limiteur1(u(signal(start=0.5))),
-      Ti=2000)) annotation (Placement(transformation(extent={{-56,106},{-84,132}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Level(k=1.05) annotation (
-      Placement(transformation(extent={{-21,102},{-40,121}}, rotation=0)));
-equation
-  connect(Drum.Cv, SteamValve.C1)
-    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
-  connect(FeedwaterValve.C2, Drum.Ce1)
-    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
-  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
-          -66,18},{-66,-16}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
-          {26.2,-26}}, color={191,95,0}));
-  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
-    annotation (Line(points={{1,18},{6,18},{6,-16}}));
-  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
-        points={{9,-26},{16,-26}}, color={191,95,0}));
-  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
-      points={{-176,80},{-120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(SteamValve.C2,sinkP. C) annotation (Line(
-      points={{60,80},{115,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
-  connect(SteamValve_O.y, SteamValve.Ouv)
-    annotation (Line(points={{41,111.5},{50,111.5},{50,97}}, color={0,0,255}));
-  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
-          111},{130,111},{130,80}}, color={0,0,255}));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
-      points={{-40.95,111.5},{-44,111.5},{-44,111.2},{-55.3,111.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-
-  connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(
-      points={{4.1,49},{10,49},{10,130.7},{-55.3,130.7}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-  connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation (Line(
-        points={{-84.7,107.3},{-110,107.3},{-110,97}}, color={0,0,255}));
-  annotation (experiment(StopTime=3000),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicDrum_CC;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicDrum_CC
+  //parameter Modelica.SIunits.MassFlowRate Qin(fixed=false,start=80)
+  //  "Mass flow rate";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.085)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  WaterSteam.Volumes.DynamicDrum              Drum(
+    Vv(start=39),
+    Vertical=false,
+    hl(start=1454400),
+    hv(start=2.658e6),
+    xv(start=0.01),
+    rhol(start=670),
+    rhov(start=78),
+    zl(fixed=true, start=1.05),
+    P0=13000000,
+    P(start=13000000, fixed=false),
+    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,18},{1,
+            80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=335),
+    Q(start=79.5),
+    rho(start=888),
+    h(start=1400000),
+    C1(
+      h_vol(start=1400e3),
+      h(start=1400e3),
+      Q(start=79.5),
+      P(start=13300000)),
+    Cvmax=CvmaxWater,
+    Pm(start=13100000))
+                     annotation (Placement(transformation(extent={{-120,76},{
+            -100,96}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Q(start=79.5),
+    rho(start=78.5),
+    h(start=2657930),
+    Cvmax=10000,
+    Pm(start=12900000))
+    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    TubeEcranBoucleEvaporatoire(
+    T0=fill(400, 10),
+    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
+    advection=false,
+    z2=10,
+    simplified_dynamic_energy_balance=false,
+    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
+          13002000,13001000,13000000,12999990}),
+    D=0.03,
+    ntubes=1400,
+    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
+          1900e3,1950e3}),
+    L=20,
+    Q(start=fill(130, 11)))
+                     annotation (Placement(transformation(
+        origin={6,-26},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
+    option_temperature=2,
+    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
+    T0={290,290,290,290,290,290,290,290,290,290})
+    annotation (Placement(transformation(
+        origin={36,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
+    D=0.03,
+    ntubes=1400)
+    annotation (Placement(transformation(
+        origin={18,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=20,
+    z1=20,
+    C1(P(start=130e5)),
+    mode=1,
+    Q(fixed=true, start=130),
+    lambda=LambdaPipe)
+             annotation (Placement(transformation(
+        origin={-66,-26},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  WaterSteam.BoundaryConditions.SourceP              sourceQ(h0=1400000,
+    option_temperature=2,
+    mode=0,
+    P0=13300000)
+           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP              sinkP(
+    option_temperature=2,
+    mode=0,
+    h0=2.650e6,
+    P0=12700000)
+    annotation (Placement(transformation(extent={{115,70},{135,90}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k=0.5)
+    annotation (Placement(transformation(extent={{20,102},{40,121}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
+        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
+        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
+    annotation (Placement(transformation(extent={{96,99},{120,123}},  rotation=
+            0)));
+  Control.Drum_LevelControl regulation_Niveau(
+    add(k1=-1, k2=+1),
+    Ti=50,
+    pIsat(
+      ureset0=0.5,
+      Limiteur1(u(signal(start=0.5))),
+      Ti=2000)) annotation (Placement(transformation(extent={{-56,106},{-84,132}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Level(k=1.05) annotation (
+      Placement(transformation(extent={{-21,102},{-40,121}}, rotation=0)));
+equation
+  connect(Drum.Cv, SteamValve.C1)
+    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
+  connect(FeedwaterValve.C2, Drum.Ce1)
+    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
+  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
+          -66,18},{-66,-16}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
+          {26.2,-26}}, color={191,95,0}));
+  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
+    annotation (Line(points={{1,18},{6,18},{6,-16}}));
+  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
+        points={{9,-26},{16,-26}}, color={191,95,0}));
+  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
+      points={{-176,80},{-120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(SteamValve.C2,sinkP. C) annotation (Line(
+      points={{60,80},{115,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
+  connect(SteamValve_O.y, SteamValve.Ouv)
+    annotation (Line(points={{41,111.5},{50,111.5},{50,97}}, color={0,0,255}));
+  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
+          111},{130,111},{130,80}}, color={0,0,255}));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
+      points={{-40.95,111.5},{-44,111.5},{-44,111.2},{-55.3,111.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+  connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(
+      points={{4.1,49},{10,49},{10,130.7},{-55.3,130.7}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+  connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation (Line(
+        points={{-84.7,107.3},{-110,107.3},{-110,97}}, color={0,0,255}));
+  annotation (experiment(StopTime=3000),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicDrum_CC;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicExchangerWaterSteamFlueGases.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicExchangerWaterSteamFlueGases.mo
index 69458f198dc0157d845d4abae1b665f3ef69962c..8df35c573bc6cf1aad497f8a1e544a754f3d2e15 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicExchangerWaterSteamFlueGases.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicExchangerWaterSteamFlueGases.mo
@@ -1,90 +1,88 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicExchangerWaterSteamFlueGases
-
-  MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases Echangeur(
-    Ns=10,
-    TwoPhaseFlowPipe(P(start={130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5}),h(start={15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5})),
-    z2=10,
-    Ntubes=1480,
-    ExchangerWall(e=0.0026, lambda=47),
-    L=21,
-    Dint=32e-3,
-    ExchangerFlueGasesMetal(
-      step_L=0.092,
-      step_T=0.087,
-      Fa=1,
-      Dext=0.0372,
-      CSailettes=12,
-      Encras(fixed=true) = 1,
-      K(fixed=false, start=40)))
-                annotation (Placement(transformation(extent={{-60,-58},{60,58}},
-          rotation=0)));
-
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
-    Xso2=0,
-    P0=1.1e5,
-    T0=750,
-    Xco2=0.06,
-    Xh2o=0.06,
-    Xo2=0.14,
-    Q0=610)
-    annotation (Placement(transformation(extent={{-20,38},{0,58}},  rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
-    annotation (Placement(transformation(
-        origin={10,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  WaterSteam.BoundaryConditions.SourceP Source_WSteam(
-    option_temperature=2,
-    mode=0,
-    h0=1.46e6,
-    C(Q(fixed=true, start=150)),
-    P0(fixed=false) = 13000000,
-    T0=610)
-    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},rotation=
-            0)));
-  WaterSteam.BoundaryConditions.SinkP Puits_WSteam(
-    option_temperature=2,
-    mode=0,
-    P0=13000000)
-    annotation (Placement(transformation(
-        origin={94,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-equation
-  connect(Source_Fumees.C, Echangeur.Cfg1) annotation (Line(
-      points={{0,48},{0,29}},
-      color={0,0,0},
-      thickness=1));
-  connect(Puits_Fumees.C, Echangeur.Cfg2) annotation (Line(
-      points={{0.2,-50},{0,-50},{0,-29}},
-      color={0,0,0},
-      thickness=1));
-  connect(Source_WSteam.C, Echangeur.Cws1)
-    annotation (Line(points={{-84,0},{-60,0}},                     color={0,0,
-          255}));
-  connect(Echangeur.Cws2, Puits_WSteam.C)
-    annotation (Line(points={{60,0},{84,0}},                   color={255,0,0}));
-  annotation (           Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicExchangerWaterSteamFlueGases;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicExchangerWaterSteamFlueGases
+  MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases Echangeur(
+    Ns=10,
+    TwoPhaseFlowPipe(P(start={130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5,130e5}),h(start={15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5,15e5})),
+    z2=10,
+    Ntubes=1480,
+    ExchangerWall(e=0.0026, lambda=47),
+    L=21,
+    Dint=32e-3,
+    ExchangerFlueGasesMetal(
+      step_L=0.092,
+      step_T=0.087,
+      Fa=1,
+      Dext=0.0372,
+      CSailettes=12,
+      Encras(fixed=true) = 1,
+      K(fixed=false, start=40)))
+                annotation (Placement(transformation(extent={{-60,-58},{60,58}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
+    Xso2=0,
+    P0=1.1e5,
+    T0=750,
+    Xco2=0.06,
+    Xh2o=0.06,
+    Xo2=0.14,
+    Q0=610)
+    annotation (Placement(transformation(extent={{-20,38},{0,58}},  rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
+    annotation (Placement(transformation(
+        origin={10,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  WaterSteam.BoundaryConditions.SourceP Source_WSteam(
+    option_temperature=2,
+    mode=0,
+    h0=1.46e6,
+    C(Q(fixed=true, start=150)),
+    P0(fixed=false) = 13000000,
+    T0=610)
+    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},rotation=
+            0)));
+  WaterSteam.BoundaryConditions.SinkP Puits_WSteam(
+    option_temperature=2,
+    mode=0,
+    P0=13000000)
+    annotation (Placement(transformation(
+        origin={94,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+equation
+  connect(Source_Fumees.C, Echangeur.Cfg1) annotation (Line(
+      points={{0,48},{0,29}},
+      color={0,0,0},
+      thickness=1));
+  connect(Puits_Fumees.C, Echangeur.Cfg2) annotation (Line(
+      points={{0.2,-50},{0,-50},{0,-29}},
+      color={0,0,0},
+      thickness=1));
+  connect(Source_WSteam.C, Echangeur.Cws1)
+    annotation (Line(points={{-84,0},{-60,0}},                     color={0,0,
+          255}));
+  connect(Echangeur.Cws2, Puits_WSteam.C)
+    annotation (Line(points={{60,0},{84,0}},                   color={255,0,0}));
+  annotation (           Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicExchangerWaterSteamFlueGases;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo
index 3ca5991c6e114546f903f611a82cd57a4a90b1b1..5755638fbbe23c7edcecd8823ff97ebeb4427d78 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo
@@ -1,63 +1,62 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicOnePhaseFlowPipe
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe
-    dynamicOnePhaseFlowPipe(
-    P(start={300000.0,281833.41863536794,263664.3047317458,245492.47958308208,
-          227317.76827098028,209139.99948381615,190959.00534677133,
-          172774.6212620022,154586.68575822545,136395.04034905753,
-          118199.52939949898,100000.0}),
-    Q(start={536.5750641592207,536.5750641592207,536.5750641592207,
-          536.5750641592207,536.5750641592207,536.5750641592207,
-          536.5750641592207,536.5750641592207,536.5750641592207,
-          536.5750641592207,536.5750641592207}),
-    h(start={71016.12237181116,74743.46665892199,78470.81094603281,
-          82198.15523314364,85925.49952025448,89652.84380736532,
-          93380.18809447614,97107.53238158698,100834.8766686978,
-          104562.22095580865,108289.56524291947,70825.9016030344}))
-                            annotation (Placement(transformation(extent={{-20,
-            20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    option_temperature=2,
-    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6})
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10)
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-equation
-  connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-40,
-          30},{-20,30}}, color={0,0,255}));
-  connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{0,30},
-          {20,30}}, color={0,0,255}));
-  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{-10,
-          60.2},{-10,52}}, color={191,95,0}));
-  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh)
-    annotation (Line(points={{-10,48},{-10,33}}, color={191,95,0}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicOnePhaseFlowPipe;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicOnePhaseFlowPipe
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe
+    dynamicOnePhaseFlowPipe(
+    P(start={300000.0,281833.41863536794,263664.3047317458,245492.47958308208,
+          227317.76827098028,209139.99948381615,190959.00534677133,
+          172774.6212620022,154586.68575822545,136395.04034905753,
+          118199.52939949898,100000.0}),
+    Q(start={536.5750641592207,536.5750641592207,536.5750641592207,
+          536.5750641592207,536.5750641592207,536.5750641592207,
+          536.5750641592207,536.5750641592207,536.5750641592207,
+          536.5750641592207,536.5750641592207}),
+    h(start={71016.12237181116,74743.46665892199,78470.81094603281,
+          82198.15523314364,85925.49952025448,89652.84380736532,
+          93380.18809447614,97107.53238158698,100834.8766686978,
+          104562.22095580865,108289.56524291947,70825.9016030344}))
+                            annotation (Placement(transformation(extent={{-20,
+            20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    option_temperature=2,
+    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6})
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10)
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+equation
+  connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-40,
+          30},{-20,30}}, color={0,0,255}));
+  connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{0,30},
+          {20,30}}, color={0,0,255}));
+  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{-10,
+          60.2},{-10,52}}, color={191,95,0}));
+  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh)
+    annotation (Line(points={{-10,48},{-10,33}}, color={191,95,0}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicOnePhaseFlowPipe;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipeShell.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipeShell.mo
index 1623c1f86adc65b1243344b136bc0234b90a9a0a..1e441acb1daef3a34e92c98ab0144d4f23d80119 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipeShell.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipeShell.mo
@@ -1,80 +1,79 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicOnePhaseFlowPipeShell
-
-  WaterSteam.HeatExchangers.DynamicOnePhaseFlowShell
-    dynamicOnePhaseFlowPipeShell(
-    Q(start={30,30,30,30,30,30,30,30,30,30,30}),
-    Ds=1,
-    ntubes=520,
-    L=12,
-    P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000,
-          1973000,1965000,1955000,1950000})) annotation (Placement(
-        transformation(extent={{-48,-36},{48,36}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(option_temperature=2, P0(fixed=
-         false) = 1900000)
-                 annotation (Placement(transformation(extent={{74,-15},{102,15}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    h0=600e3,
-    P0=2000000,
-    Q(start=500, fixed=true))
-             annotation (Placement(transformation(extent={{-103,-15},{-75,15}},
-          rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    lambda=10,
-    Ns=10,
-    cpw=460,
-    rhow=7900,
-    D=0.017,
-    e=0.002,
-    ntubes=520,
-    L=12) annotation (Placement(transformation(extent={{-54,30},{54,58}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    option_temperature=2,
-    W0={-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6},
-    T0={300,300,300,300,300,300,300,300,300,300})
-                  annotation (Placement(transformation(extent={{-12,76},{12,98}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Initialvalue=20e5,
-    Starttime=300,
-    Duration=600,
-    Finalvalue=19.8e5)
-                     annotation (Placement(transformation(extent={{-100,32},{
-            -80,52}}, rotation=0)));
-equation
-  connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1)
-    annotation (Line(points={{-75,0},{-48,0}}, color={0,0,255}));
-  connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C)
-    annotation (Line(points={{48,0},{74,0}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh)
-    annotation (Line(points={{0,41.2},{0,10.8}}, color={191,95,0}));
-  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,
-          76.22},{0,46.8}}, color={191,95,0}));
-  connect(rampe.y, sourceP.IPressure)
-    annotation (Line(points={{-79,42},{-70,42},{-70,24},{-98,24},{-98,0},{-96,0}}));
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicOnePhaseFlowPipeShell;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicOnePhaseFlowPipeShell
+  WaterSteam.HeatExchangers.DynamicOnePhaseFlowShell
+    dynamicOnePhaseFlowPipeShell(
+    Q(start={30,30,30,30,30,30,30,30,30,30,30}),
+    Ds=1,
+    ntubes=520,
+    L=12,
+    P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000,
+          1973000,1965000,1955000,1950000})) annotation (Placement(
+        transformation(extent={{-48,-36},{48,36}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(option_temperature=2, P0(fixed=
+         false) = 1900000)
+                 annotation (Placement(transformation(extent={{74,-15},{102,15}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    h0=600e3,
+    P0=2000000,
+    Q(start=500, fixed=true))
+             annotation (Placement(transformation(extent={{-103,-15},{-75,15}},
+          rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    lambda=10,
+    Ns=10,
+    cpw=460,
+    rhow=7900,
+    D=0.017,
+    e=0.002,
+    ntubes=520,
+    L=12) annotation (Placement(transformation(extent={{-54,30},{54,58}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    option_temperature=2,
+    W0={-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6},
+    T0={300,300,300,300,300,300,300,300,300,300})
+                  annotation (Placement(transformation(extent={{-12,76},{12,98}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Initialvalue=20e5,
+    Starttime=300,
+    Duration=600,
+    Finalvalue=19.8e5)
+                     annotation (Placement(transformation(extent={{-100,32},{
+            -80,52}}, rotation=0)));
+equation
+  connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1)
+    annotation (Line(points={{-75,0},{-48,0}}, color={0,0,255}));
+  connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C)
+    annotation (Line(points={{48,0},{74,0}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh)
+    annotation (Line(points={{0,41.2},{0,10.8}}, color={191,95,0}));
+  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,
+          76.22},{0,46.8}}, color={191,95,0}));
+  connect(rampe.y, sourceP.IPressure)
+    annotation (Line(points={{-79,42},{-70,42},{-70,24},{-98,24},{-98,0},{-96,0}}));
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicOnePhaseFlowPipeShell;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicReliefValve.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicReliefValve.mo
index be0497bf65806473b15124b02f3ff1d2c6a86de0..491a291ffaaa6151775f9fe8cb7bdc87530143a4 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicReliefValve.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicReliefValve.mo
@@ -1,103 +1,102 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicReliefValve
-  import ThermoSysPro;
-  parameter ThermoSysPro.Units.SI.AbsolutePressure Pinitial=18e5
-    "Initial pressure";
-  parameter ThermoSysPro.Units.SI.AbsolutePressure Pfinal=Pinitial
-    "Final pressure";
-  parameter ThermoSysPro.Units.SI.AbsolutePressure Pmax=21e5 "Maximum pressure";
-
-  ThermoSysPro.WaterSteam.PressureLosses.DynamicReliefValve reliefValve(
-    mech_steady_state=false,
-    caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351;
-        0.7,8625; 0.8,8818; 0.9,8958; 1,9063],
-    Cvmax=9063,
-    Q(start=0),
-    Pm(start=Pinitial),
-    Pout=sinkP.P0,
-    mode_caract=2,
-    A2=1.1*reliefValve.A1,
-    A1=1.3*Modelica.Constants.pi*pipe.D^2/4,
-    m=50,
-    Cd=0.44,
-    Popen=2000000,
-    z_max=0.05)
-    annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe(
-    Q(start=0),
-    Pm(start=Pinitial),
-    L=2,
-    D=0.2) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(mode=0)
-                                   annotation (Placement(transformation(extent={{80,0},{
-            100,20}},          rotation=0)));
-  WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}})));
-  InstrumentationAndControl.Blocks.Sources.Rampe ramp1(
-    Duration=200,
-    Finalvalue=Pmax,
-    Initialvalue=Pinitial)
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
-  InstrumentationAndControl.Blocks.Sources.Rampe ramp2(
-    Duration=200,
-    Starttime=300,
-    Finalvalue=Pmax - Pfinal)
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}})));
-  InstrumentationAndControl.Blocks.Math.Add add(k2=-1)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}})));
-  WaterSteam.PressureLosses.Bend bend(R0=0.2, D=pipe.D)
-    annotation (Placement(transformation(extent={{0,-20},{20,-40}})));
-  WaterSteam.PressureLosses.Diaphragm diaphragm(Ouv=1, D=0.5)
-    annotation (Placement(transformation(extent={{40,0},{60,20}})));
-equation
-  connect(sourceP.C, pipe.C1)
-    annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255}));
-  connect(ramp1.y, add.u1) annotation (Line(points={{-79,50},{-70,50},{-70,36},{
-          -61,36}}, color={0,0,255}));
-  connect(ramp2.y, add.u2) annotation (Line(points={{-79,10},{-70,10},{-70,24},{
-          -61,24}}, color={0,0,255}));
-  connect(add.y, sourceP.IPressure) annotation (Line(points={{-39,30},{-20,30},{
-          -20,-10},{-90,-10},{-90,-30},{-75,-30}},
-                                                 color={0,0,255}));
-  connect(pipe.C2, bend.C1)
-    annotation (Line(points={{-20,-30},{0,-30}}, color={0,0,255}));
-  connect(bend.C2,reliefValve. C1)
-    annotation (Line(points={{10,-20},{10,0.2}},color={0,0,255}));
-  connect(reliefValve.C2, diaphragm.C1)
-    annotation (Line(points={{20,10},{40,10}}, color={0,0,255}));
-  connect(diaphragm.C2,sinkP. C)
-    annotation (Line(points={{60,10},{80,10}}, color={0,0,255}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false, initialScale=0.1)),
-    Window(
-      x=0.1,
-      y=0.08,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
-         coordinateSystem(preserveAspectRatio=false, initialScale=0.1)),
-    experiment(StopTime=600, Interval=1),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicReliefValve;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicReliefValve
+  import ThermoSysPro;
+  parameter ThermoSysPro.Units.SI.AbsolutePressure Pinitial=18e5
+    "Initial pressure";
+  parameter ThermoSysPro.Units.SI.AbsolutePressure Pfinal=Pinitial
+    "Final pressure";
+  parameter ThermoSysPro.Units.SI.AbsolutePressure Pmax=21e5 "Maximum pressure";
+  ThermoSysPro.WaterSteam.PressureLosses.DynamicReliefValve reliefValve(
+    mech_steady_state=false,
+    caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351;
+        0.7,8625; 0.8,8818; 0.9,8958; 1,9063],
+    Cvmax=9063,
+    Q(start=0),
+    Pm(start=Pinitial),
+    Pout=sinkP.P0,
+    mode_caract=2,
+    A2=1.1*reliefValve.A1,
+    A1=1.3*Modelica.Constants.pi*pipe.D^2/4,
+    m=50,
+    Cd=0.44,
+    Popen=2000000,
+    z_max=0.05)
+    annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe(
+    Q(start=0),
+    Pm(start=Pinitial),
+    L=2,
+    D=0.2) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(mode=0)
+                                   annotation (Placement(transformation(extent={{80,0},{
+            100,20}},          rotation=0)));
+  WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}})));
+  InstrumentationAndControl.Blocks.Sources.Rampe ramp1(
+    Duration=200,
+    Finalvalue=Pmax,
+    Initialvalue=Pinitial)
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
+  InstrumentationAndControl.Blocks.Sources.Rampe ramp2(
+    Duration=200,
+    Starttime=300,
+    Finalvalue=Pmax - Pfinal)
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}})));
+  InstrumentationAndControl.Blocks.Math.Add add(k2=-1)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}})));
+  WaterSteam.PressureLosses.Bend bend(R0=0.2, D=pipe.D)
+    annotation (Placement(transformation(extent={{0,-20},{20,-40}})));
+  WaterSteam.PressureLosses.Diaphragm diaphragm(Ouv=1, D=0.5)
+    annotation (Placement(transformation(extent={{40,0},{60,20}})));
+equation
+  connect(sourceP.C, pipe.C1)
+    annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255}));
+  connect(ramp1.y, add.u1) annotation (Line(points={{-79,50},{-70,50},{-70,36},{
+          -61,36}}, color={0,0,255}));
+  connect(ramp2.y, add.u2) annotation (Line(points={{-79,10},{-70,10},{-70,24},{
+          -61,24}}, color={0,0,255}));
+  connect(add.y, sourceP.IPressure) annotation (Line(points={{-39,30},{-20,30},{
+          -20,-10},{-90,-10},{-90,-30},{-75,-30}},
+                                                 color={0,0,255}));
+  connect(pipe.C2, bend.C1)
+    annotation (Line(points={{-20,-30},{0,-30}}, color={0,0,255}));
+  connect(bend.C2,reliefValve. C1)
+    annotation (Line(points={{10,-20},{10,0.2}},color={0,0,255}));
+  connect(reliefValve.C2, diaphragm.C1)
+    annotation (Line(points={{20,10},{40,10}}, color={0,0,255}));
+  connect(diaphragm.C2,sinkP. C)
+    annotation (Line(points={{60,10},{80,10}}, color={0,0,255}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false, initialScale=0.1)),
+    Window(
+      x=0.1,
+      y=0.08,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
+         coordinateSystem(preserveAspectRatio=false, initialScale=0.1)),
+    experiment(StopTime=600, Interval=1),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicReliefValve;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo
index 38d950cf9b6c148e082d9789fc110228694717d3..3653bc966697267fca257db4e89d371e7538a977 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo
@@ -1,120 +1,119 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicTwoPhaseFlowPipe
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    dynamicTwoPhaseFlowPipe(L=20, advection=false,
-    P(start={300000.0,281934.9410206863,263857.2951934783,245762.87920491621,
-          227647.89301968267,209508.84324088524,191342.48510599748,
-          173145.77779073696,154915.84935981245,136649.96881108306,
-          118345.52340716157,100000.0}),
-    Q(start={378.2555714391421,378.2555714391421,378.2555714391421,
-          378.2555714391421,378.2555714391421,378.2555714391421,
-          378.2555714391421,378.2555714391421,378.2555714391421,
-          378.2555714391421,378.2555714391421}),
-    h(start={71016.12237181116,89522.1287033792,108028.13503495205,
-          126534.14136650086,145040.14769798872,163546.15402957145,
-          182052.16036112772,200558.16669267463,219064.17302421754,
-          237570.17935577242,256076.18568728055,70825.9016030344}))
-                            annotation (Placement(transformation(extent={{-10,20},
-            {10,40}},    rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-50,20},{-30,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{30,20},{50,40}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    option_temperature=2,
-    W0={7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6})
-    annotation (Placement(transformation(extent={{-10,60},{10,80}},rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10)
-    annotation (Placement(transformation(extent={{-10,40},{10,60}},rotation=0)));
-  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(
-    L=10,
-    D=0.03,
-    dpfCorr(fixed=false,
-      start=0.23963336533422905)=
-                           1,
-    P(start={2000000.0,1999571.707027408,1999140.94021676,1998707.6248918818,
-          1998271.6837222823,1997833.0364982954,1997391.599890757,
-          1996715.8221090273,1995640.018272837,1994163.014585635,
-          1992283.4952231126,1990000.0}))
-                            annotation (Placement(transformation(extent={{-40,-94},
-            {40,-36}},     rotation=0)));
-  WaterSteam.BoundaryConditions.SourceP sourceP1(
-    C(Q(fixed=true, start=1)),
-    option_temperature=2,
-    mode=0,
-    h0=800e3,
-    P0=2000000)
-    annotation (Placement(transformation(extent={{-90,-74},{-70,-54}},rotation=
-            0)));
-  WaterSteam.BoundaryConditions.SinkP sinkP1(
-    option_temperature=2,
-    h0=2000e3,
-    mode=0,
-    P0=19.9e5)
-    annotation (Placement(transformation(extent={{70,-74},{90,-54}},rotation=0)));
-  Thermal.BoundaryConditions.HeatSource heatSource1(
-    option_temperature=2,
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4})
-    annotation (Placement(transformation(extent={{-10,-15},{10,5}}, rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(            Ns=10,
-    L=10,
-    lambda=10,
-    cpw=460,
-    rhow=7900,
-    e=0.005,
-    D=0.03)
-    annotation (Placement(transformation(extent={{-40,-74},{40,6}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Initialvalue=20e5,
-    Starttime=300,
-    Duration=600,
-    Finalvalue=19.8e5)
-                     annotation (Placement(transformation(extent={{-74,-50},{
-            -86,-39}},
-                 rotation=0)));
-equation
-  connect(sourceP.C,dynamicTwoPhaseFlowPipe. C1) annotation (Line(points={{-30,30},
-          {-10,30}},     color={0,0,255}));
-  connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,30},
-          {30,30}}, color={0,0,255}));
-  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,60.2},
-          {0,52}},         color={191,95,0}));
-  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh)
-    annotation (Line(points={{0,48},{0,33}},     color={191,95,0}));
-  connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1) annotation (Line(points={{
-          -70,-64},{-42,-64},{-42,-68},{-42,-66},{-42,-65},{-40,-65}}, color={0,
-          0,255}));
-  connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C) annotation (Line(points={{40,
-          -65},{40,-65},{40,-64},{70,-64}}, color={0,0,255}));
-  connect(heatSource1.C, heatExchangerWall1.WT2)
-    annotation (Line(points={{0,-14.8},{0,-28},{0,-26}}, color={191,95,0}));
-  connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh)
-    annotation (Line(points={{0,-42},{0,-56.3}}, color={191,95,0}));
-  connect(rampe.y, sourceP1.IPressure)
-    annotation (Line(points={{-86.6,-44.5},{-92,-44.5},{-92,-64},{-85,-64}}));
-  annotation (experiment(StopTime=1000), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicTwoPhaseFlowPipe;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicTwoPhaseFlowPipe
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    dynamicTwoPhaseFlowPipe(L=20, advection=false,
+    P(start={300000.0,281934.9410206863,263857.2951934783,245762.87920491621,
+          227647.89301968267,209508.84324088524,191342.48510599748,
+          173145.77779073696,154915.84935981245,136649.96881108306,
+          118345.52340716157,100000.0}),
+    Q(start={378.2555714391421,378.2555714391421,378.2555714391421,
+          378.2555714391421,378.2555714391421,378.2555714391421,
+          378.2555714391421,378.2555714391421,378.2555714391421,
+          378.2555714391421,378.2555714391421}),
+    h(start={71016.12237181116,89522.1287033792,108028.13503495205,
+          126534.14136650086,145040.14769798872,163546.15402957145,
+          182052.16036112772,200558.16669267463,219064.17302421754,
+          237570.17935577242,256076.18568728055,70825.9016030344}))
+                            annotation (Placement(transformation(extent={{-10,20},
+            {10,40}},    rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-50,20},{-30,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{30,20},{50,40}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    option_temperature=2,
+    W0={7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6})
+    annotation (Placement(transformation(extent={{-10,60},{10,80}},rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10)
+    annotation (Placement(transformation(extent={{-10,40},{10,60}},rotation=0)));
+  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(
+    L=10,
+    D=0.03,
+    dpfCorr(fixed=false,
+      start=0.23963336533422905)=
+                           1,
+    P(start={2000000.0,1999571.707027408,1999140.94021676,1998707.6248918818,
+          1998271.6837222823,1997833.0364982954,1997391.599890757,
+          1996715.8221090273,1995640.018272837,1994163.014585635,
+          1992283.4952231126,1990000.0}))
+                            annotation (Placement(transformation(extent={{-40,-94},
+            {40,-36}},     rotation=0)));
+  WaterSteam.BoundaryConditions.SourceP sourceP1(
+    C(Q(fixed=true, start=1)),
+    option_temperature=2,
+    mode=0,
+    h0=800e3,
+    P0=2000000)
+    annotation (Placement(transformation(extent={{-90,-74},{-70,-54}},rotation=
+            0)));
+  WaterSteam.BoundaryConditions.SinkP sinkP1(
+    option_temperature=2,
+    h0=2000e3,
+    mode=0,
+    P0=19.9e5)
+    annotation (Placement(transformation(extent={{70,-74},{90,-54}},rotation=0)));
+  Thermal.BoundaryConditions.HeatSource heatSource1(
+    option_temperature=2,
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4})
+    annotation (Placement(transformation(extent={{-10,-15},{10,5}}, rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(            Ns=10,
+    L=10,
+    lambda=10,
+    cpw=460,
+    rhow=7900,
+    e=0.005,
+    D=0.03)
+    annotation (Placement(transformation(extent={{-40,-74},{40,6}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Initialvalue=20e5,
+    Starttime=300,
+    Duration=600,
+    Finalvalue=19.8e5)
+                     annotation (Placement(transformation(extent={{-74,-50},{
+            -86,-39}},
+                 rotation=0)));
+equation
+  connect(sourceP.C,dynamicTwoPhaseFlowPipe. C1) annotation (Line(points={{-30,30},
+          {-10,30}},     color={0,0,255}));
+  connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,30},
+          {30,30}}, color={0,0,255}));
+  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,60.2},
+          {0,52}},         color={191,95,0}));
+  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh)
+    annotation (Line(points={{0,48},{0,33}},     color={191,95,0}));
+  connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1) annotation (Line(points={{
+          -70,-64},{-42,-64},{-42,-68},{-42,-66},{-42,-65},{-40,-65}}, color={0,
+          0,255}));
+  connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C) annotation (Line(points={{40,
+          -65},{40,-65},{40,-64},{70,-64}}, color={0,0,255}));
+  connect(heatSource1.C, heatExchangerWall1.WT2)
+    annotation (Line(points={{0,-14.8},{0,-28},{0,-26}}, color={191,95,0}));
+  connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh)
+    annotation (Line(points={{0,-42},{0,-56.3}}, color={191,95,0}));
+  connect(rampe.y, sourceP1.IPressure)
+    annotation (Line(points={{-86.6,-44.5},{-92,-44.5},{-92,-64},{-85,-64}}));
+  annotation (experiment(StopTime=1000), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicTwoPhaseFlowPipe;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating.mo
index 6d2a702abb5d50811403ce8013b47d2d95ec227a..db48ac825bfa53a85384a4b898594a94d31625af 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating.mo
@@ -1,316 +1,313 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicWaterHeating
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=68.5297)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.003003)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    h0=2750.e3,
-    P0=40e5)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=2, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
-    mode_caract=0,
-    Cvmax=CvmaxWater,
-    Q(fixed=false, start=38.0656),
-    Pm(start=24.771e5),
-    h(start=906345),
-    C1(h_vol(start=906345), h(start=906345)),
-    Cv(start=34.26, fixed=false))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
-    ec=2e-3,
-    Ns=10,
-    P0c=40e5,
-    Rv=1.2,
-    Lc=2.5,
-    PasL=0.028,
-    PasT=0.024,
-    ntubes3=1500,
-    Dc=0.018,
-    ntubes1=400,
-    ntubes2=400,
-    L1=11,
-    L2=11,
-    L3=22,
-    pipe_1(
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      advection=false,
-      z2=0.4,
-         Tp(start={500,501,502,503,504,505,506,507,508,510}),
-         h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-          965e3,980e3}),
-         hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-          965e3}),
-         Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
-          202.4}),
-      P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5,
-      222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5})),
-    pipe_2(
-      z2=0.4,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      advection=false,
-        Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-         h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,1080e3,1080e3}),
-         hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,1080e3}),
-         Q(start={57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57}),
-      P(start={222.600e5,222.590e5,222.580e5,222.570e5,
-      222.560e5,222.550e5,222.540e5,222.530e5,222.520e5,222.51e5,222.50e5,222.48e5})),
-    C2ex(P(start=3900000)),
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1082.65e3), P(start=222.48e5)),
-    volumeD1(h(start=953939), P(start=222.48e5)),
-    volumeD(h(start=812750), P(start=222.72e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      Kvl=1,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      V=70,
-      Mp=50000,
-      zl(fixed=true, start=0.5),
-      P(fixed=true, start=39.5e5),
-      Cv(Q(fixed=false, start=35), P(fixed=false, start=39.5e5)),
-      hv(start=1463490),
-      hl(start=906345),
-      Pfond(start=39.542e5),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp(start=509)),
-    pipe_3(
-      steady_state=true,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      advection=false,
-      z2=1,
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4}),
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
-            202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4}),
-      P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5,
-            222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5,
-            222.580e5,222.570e5,222.560e5,222.550e5,222.540e5,222.530e5,
-            222.520e5,222.51e5,222.50e5,222.48e5}),
-      inertia=true))
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(                           K=35, Q(fixed=false,
-        start=250),
-    Pm(start=227e5))         annotation (Placement(transformation(extent={{-99,
-            -48},{-79,-28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(                           K=30, Q(fixed=false,
-        start=250),
-    Pm(start=222.48e5),
-    C2(h_vol(start=1082650), h(start=1082650)))
-                               annotation (Placement(transformation(extent={{
-            -80,34},{-100,54}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    option_temperature=1,
-    P0=220e5,
-    h0=900e3,
-    T0=482.87)
-    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53, C1(h_vol(start=
-            1082.65e3), h(start=1082.65e3)))
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
-      Table=[0,260; 378,260; 390,238; 438,275; 507,135; 936,65; 1404,50; 1872,
-        50])       annotation (Placement(transformation(extent={{-195,78},{-175,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.50)
-                          annotation (Placement(transformation(extent={{135,
-            -152},{113,-130}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(Qmin=0.5, C2(h_vol(
-          start=2750.e3), h(start=2750.e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(                          K=1e-3,
-    T(fixed=false, start=461.56),
-    Q(fixed=false, start=35),
-    Pm(start=3900000),
-    C2(h_vol(start=906340), h(start=906340)))
-                         annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,3.9e5; 2000,3.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=35),
-    L=10,
-    D=0.1,
-    lambda=LambdaPipe,
-    Pm(start=40.34e5),
-    C1(h_vol(start=2750e3), h(start=2750e3)))
-                         annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table=
-        [0,41.19e5; 378,41.19e5; 418,21.e5; 1145,5.e5; 2000,5.e5])
-                   annotation (Placement(transformation(extent={{-195,160},{
-            -175,180}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2(
-                  Table=[0,222.72e5; 378,222.72e5; 438,230e5; 597,217e5; 1000,
-        216e5; 1533,214e5; 1863,213.5e5; 2340,213e5; 2500,213e5])
-                   annotation (Placement(transformation(extent={{-195,-8},{-175,
-            12}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table=
-        [0,462; 448,462; 1155,420.0; 2000,420.0])
-                   annotation (Placement(transformation(extent={{-196,-84},{
-            -176,-64}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  connect(Pression_Turbine1.y, sourceP.IPressure) annotation (Line(points={{
-          -174,170},{-174,152},{-190,152},{-190,130},{-181.5,130}}));
-  connect(Pression_eauA2.y, sourceP1.IPressure) annotation (Line(points={{-174,
-          2},{-174,-10},{-194,-10},{-194,-38},{-181.5,-38}}));
-  connect(Temperature_eauA1.y, sourceP1.ITemperature)
-    annotation (Line(points={{-175,-74},{-171,-74},{-171,-49}}));
-  connect(Debit_eauA.y, refQ.IMassFlow)
-    annotation (Line(points={{-174,88},{-125,88},{-125,55}}));
-  connect(Level.y, ControlValve_eau.Ouv)
-    annotation (Line(points={{111.9,-141},{98,-141},{98,-165}}));
-  annotation (Diagram(coordinateSystem(extent={{-200,-200},{200,200}}),
-                               graphics={
-        Text(
-          extent={{-124,206},{130,146}},
-          lineColor={0,0,255},
-          textString=
-               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-74,-190},{118,-222}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-186,-198},{-84,-212}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{16,170},{130,156}},
-          lineColor={0,0,255},
-          textString=
-               "checkValve  Qmin =0.5"),
-        Text(
-          extent={{-134,172},{-6,154}},
-          lineColor={0,0,255},
-          textString=
-               "With Gusse Values")}),
-    experiment(StopTime=1000, Tolerance=1e-004),
-    experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-220,-240},{220,240}},
-          radius=25.0),
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicWaterHeating;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicWaterHeating
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=68.5297)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.003003)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    h0=2750.e3,
+    P0=40e5)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=2, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
+    mode_caract=0,
+    Cvmax=CvmaxWater,
+    Q(fixed=false, start=38.0656),
+    Pm(start=24.771e5),
+    h(start=906345),
+    C1(h_vol(start=906345), h(start=906345)),
+    Cv(start=34.26, fixed=false))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
+    ec=2e-3,
+    Ns=10,
+    P0c=40e5,
+    Rv=1.2,
+    Lc=2.5,
+    PasL=0.028,
+    PasT=0.024,
+    ntubes3=1500,
+    Dc=0.018,
+    ntubes1=400,
+    ntubes2=400,
+    L1=11,
+    L2=11,
+    L3=22,
+    pipe_1(
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      advection=false,
+      z2=0.4,
+         Tp(start={500,501,502,503,504,505,506,507,508,510}),
+         h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+          965e3,980e3}),
+         hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+          965e3}),
+         Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
+          202.4}),
+      P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5,
+      222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5})),
+    pipe_2(
+      z2=0.4,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      advection=false,
+        Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+         h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,1080e3,1080e3}),
+         hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,1080e3}),
+         Q(start={57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57}),
+      P(start={222.600e5,222.590e5,222.580e5,222.570e5,
+      222.560e5,222.550e5,222.540e5,222.530e5,222.520e5,222.51e5,222.50e5,222.48e5})),
+    C2ex(P(start=3900000)),
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1082.65e3), P(start=222.48e5)),
+    volumeD1(h(start=953939), P(start=222.48e5)),
+    volumeD(h(start=812750), P(start=222.72e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      Kvl=1,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      V=70,
+      Mp=50000,
+      zl(fixed=true, start=0.5),
+      P(fixed=true, start=39.5e5),
+      Cv(Q(fixed=false, start=35), P(fixed=false, start=39.5e5)),
+      hv(start=1463490),
+      hl(start=906345),
+      Pfond(start=39.542e5),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp(start=509)),
+    pipe_3(
+      steady_state=true,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      advection=false,
+      z2=1,
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4}),
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
+            202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4}),
+      P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5,
+            222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5,
+            222.580e5,222.570e5,222.560e5,222.550e5,222.540e5,222.530e5,
+            222.520e5,222.51e5,222.50e5,222.48e5}),
+      inertia=true))
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(                           K=35, Q(fixed=false,
+        start=250),
+    Pm(start=227e5))         annotation (Placement(transformation(extent={{-99,
+            -48},{-79,-28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(                           K=30, Q(fixed=false,
+        start=250),
+    Pm(start=222.48e5),
+    C2(h_vol(start=1082650), h(start=1082650)))
+                               annotation (Placement(transformation(extent={{
+            -80,34},{-100,54}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    option_temperature=1,
+    P0=220e5,
+    h0=900e3,
+    T0=482.87)
+    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53, C1(h_vol(start=
+            1082.65e3), h(start=1082.65e3)))
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
+      Table=[0,260; 378,260; 390,238; 438,275; 507,135; 936,65; 1404,50; 1872,
+        50])       annotation (Placement(transformation(extent={{-195,78},{-175,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.50)
+                          annotation (Placement(transformation(extent={{135,
+            -152},{113,-130}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(Qmin=0.5, C2(h_vol(
+          start=2750.e3), h(start=2750.e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(                          K=1e-3,
+    T(fixed=false, start=461.56),
+    Q(fixed=false, start=35),
+    Pm(start=3900000),
+    C2(h_vol(start=906340), h(start=906340)))
+                         annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,3.9e5; 2000,3.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=35),
+    L=10,
+    D=0.1,
+    lambda=LambdaPipe,
+    Pm(start=40.34e5),
+    C1(h_vol(start=2750e3), h(start=2750e3)))
+                         annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table=
+        [0,41.19e5; 378,41.19e5; 418,21.e5; 1145,5.e5; 2000,5.e5])
+                   annotation (Placement(transformation(extent={{-195,160},{
+            -175,180}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2(
+                  Table=[0,222.72e5; 378,222.72e5; 438,230e5; 597,217e5; 1000,
+        216e5; 1533,214e5; 1863,213.5e5; 2340,213e5; 2500,213e5])
+                   annotation (Placement(transformation(extent={{-195,-8},{-175,
+            12}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table=
+        [0,462; 448,462; 1155,420.0; 2000,420.0])
+                   annotation (Placement(transformation(extent={{-196,-84},{
+            -176,-64}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  connect(Pression_Turbine1.y, sourceP.IPressure) annotation (Line(points={{
+          -174,170},{-174,152},{-190,152},{-190,130},{-181.5,130}}));
+  connect(Pression_eauA2.y, sourceP1.IPressure) annotation (Line(points={{-174,
+          2},{-174,-10},{-194,-10},{-194,-38},{-181.5,-38}}));
+  connect(Temperature_eauA1.y, sourceP1.ITemperature)
+    annotation (Line(points={{-175,-74},{-171,-74},{-171,-49}}));
+  connect(Debit_eauA.y, refQ.IMassFlow)
+    annotation (Line(points={{-174,88},{-125,88},{-125,55}}));
+  connect(Level.y, ControlValve_eau.Ouv)
+    annotation (Line(points={{111.9,-141},{98,-141},{98,-165}}));
+  annotation (Diagram(coordinateSystem(extent={{-200,-200},{200,200}}),
+                               graphics={
+        Text(
+          extent={{-124,206},{130,146}},
+          lineColor={0,0,255},
+          textString=
+               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-74,-190},{118,-222}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-186,-198},{-84,-212}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{16,170},{130,156}},
+          lineColor={0,0,255},
+          textString=
+               "checkValve  Qmin =0.5"),
+        Text(
+          extent={{-134,172},{-6,154}},
+          lineColor={0,0,255},
+          textString=
+               "With Gusse Values")}),
+    experiment(StopTime=1000, Tolerance=1e-004),
+    experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-220,-240},{220,240}},
+          radius=25.0),
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicWaterHeating;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Islanding.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Islanding.mo
index 71efcd437a58c9fa8d6d87a6e8e6d526042ee0d0..f5a779736434408cdf870a4dd86f1f0610b67422 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Islanding.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Islanding.mo
@@ -1,315 +1,312 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicWaterHeating_Islanding
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    P0=22.733e5,
-    h0=2650.6e3)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=2, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
-    Q(fixed=false, start=56),
-    Cvmax(fixed=false) = 354.534,
-    mode_caract=0,
-    Cv(start=70, fixed=false),
-    C1(h_vol(start=800e3), h(start=800e3)))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
-    Dc=0.016,
-    Lc=2.56,
-    PasL=0.027,
-    PasT=0.02338,
-    ec=2e-3,
-    Rv=1.130514,
-    Ns=10,
-    DpfCorr=1.1136,
-    cp=506,
-    rho=7780,
-    lambda=35,
-    COP0l(fixed=false) = 1.23,
-    C2ex(P(start=2220000)),
-    ntubes1=351,
-    ntubes2=351,
-    ntubes3=1319,
-    L3=26.4,
-    L2=13.2,
-    L1=13.2,
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1000.65e3), P(start=68.48e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      zl(fixed=true, start=0.43),
-      Kvl=1,
-      V=53,
-      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
-      Mp=53227,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      P(fixed=true, start=2216584),
-      hl(start=806345),
-      hv(start=1063490),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
-            519,519.4}),
-      Tp(start=509)),
-    Ce1(P(start=7100000)),
-    pipe_1(
-      z2=0.3,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000}),
-      Tp(start={500,501,502,503,504,505,506,507,508,510})),
-    pipe_2(
-      z2=0.4,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
-            6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    volumeD1(h(start=953939), P(start=6848000)),
-    volumeD(
-      h(start=812750),
-      dynamic_mass_balance=false,
-      P(start=6872000)),
-    P0c=2200000,
-    pipe_3(
-      steady_state=true,
-      mode=1,
-      z2=0.7,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-            492,492,492,492,132}),
-      advection=false,
-      inertia=true,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
-            6854000,6853000,6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4})))
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
-                         annotation (Placement(transformation(extent={{-99,-48},
-            {-79,-28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
-    C2(h_vol(start=927700), h(start=927700)))
-                         annotation (Placement(transformation(extent={{-80,34},
-            {-100,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1000,
-        72.06e5; 1533,69.8e5; 1863,69.39e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-194,-8},{-172,
-            14}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
-                   annotation (Placement(transformation(extent={{-196,-88},{
-            -176,-68}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    P0=71.29e5,
-    h0=772.09e3,
-    T0=454.46,
-    option_temperature=1)
-    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
-      Table=[0,624.97; 378,624.97; 390,592; 438,699; 507,353; 936,252; 1404,176;
-        1872,116; 2340,88; 2500,88])
-                   annotation (Placement(transformation(extent={{-196,78},{-176,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
-        2000,3.e5])
-                   annotation (Placement(transformation(extent={{-194,154},{
-            -174,174}}, rotation=0)));
-  Control.Condenser_LevelControl_RE5 regulation_Niveau(add(k1=+1, k2=-1),
-      pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (Placement(
-        transformation(extent={{140,-146},{102,-110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
-                          annotation (Placement(transformation(extent={{191,
-            -140},{169,-118}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
-    T(fixed=true, start=461.56),
-    Pm(start=2220000))   annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=650),
-    lambda(fixed=false) = 0.03,
-    L=48.72,
-    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
-        69.8e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-196,-154},{
-            -174,-132}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pression_eauA.y, sourceP1.IPressure)
-                                              annotation (Line(points={{-170.9,
-          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
-          -124,88},{-124,55},{-125,55}}));
-  connect(Pression_Turbine.y, sourceP.IPressure)
-                                             annotation (Line(points={{-173,164},
-          {-166,164},{-166,152},{-194,152},{-194,130},{-181.5,130}}));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
-         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
-  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
-    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
-          -111.8}}));
-  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
-    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Temperature_eauA.y, sourceP1.ITemperature)
-                                                    annotation (Line(points={{
-          -175,-78},{-170,-78},{-170,-49},{-171,-49}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics={
-        Text(
-          extent={{-130,218},{124,158}},
-          lineColor={0,0,255},
-          textString=
-               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-90,-188},{102,-220}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-202,-196},{-100,-210}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{-118,152},{-62,138}},
-          lineColor={0,0,255},
-          textString=
-               "Qmin = 0")}), experiment(StopTime=300),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicWaterHeating_Islanding;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicWaterHeating_Islanding
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    P0=22.733e5,
+    h0=2650.6e3)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=2, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
+    Q(fixed=false, start=56),
+    Cvmax(fixed=false) = 354.534,
+    mode_caract=0,
+    Cv(start=70, fixed=false),
+    C1(h_vol(start=800e3), h(start=800e3)))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
+    Dc=0.016,
+    Lc=2.56,
+    PasL=0.027,
+    PasT=0.02338,
+    ec=2e-3,
+    Rv=1.130514,
+    Ns=10,
+    DpfCorr=1.1136,
+    cp=506,
+    rho=7780,
+    lambda=35,
+    COP0l(fixed=false) = 1.23,
+    C2ex(P(start=2220000)),
+    ntubes1=351,
+    ntubes2=351,
+    ntubes3=1319,
+    L3=26.4,
+    L2=13.2,
+    L1=13.2,
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1000.65e3), P(start=68.48e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      zl(fixed=true, start=0.43),
+      Kvl=1,
+      V=53,
+      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
+      Mp=53227,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      P(fixed=true, start=2216584),
+      hl(start=806345),
+      hv(start=1063490),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
+            519,519.4}),
+      Tp(start=509)),
+    Ce1(P(start=7100000)),
+    pipe_1(
+      z2=0.3,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000}),
+      Tp(start={500,501,502,503,504,505,506,507,508,510})),
+    pipe_2(
+      z2=0.4,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
+            6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    volumeD1(h(start=953939), P(start=6848000)),
+    volumeD(
+      h(start=812750),
+      dynamic_mass_balance=false,
+      P(start=6872000)),
+    P0c=2200000,
+    pipe_3(
+      steady_state=true,
+      mode=1,
+      z2=0.7,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+            492,492,492,492,132}),
+      advection=false,
+      inertia=true,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
+            6854000,6853000,6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4})))
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
+                         annotation (Placement(transformation(extent={{-99,-48},
+            {-79,-28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
+    C2(h_vol(start=927700), h(start=927700)))
+                         annotation (Placement(transformation(extent={{-80,34},
+            {-100,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1000,
+        72.06e5; 1533,69.8e5; 1863,69.39e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-194,-8},{-172,
+            14}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
+                   annotation (Placement(transformation(extent={{-196,-88},{
+            -176,-68}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    P0=71.29e5,
+    h0=772.09e3,
+    T0=454.46,
+    option_temperature=1)
+    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
+      Table=[0,624.97; 378,624.97; 390,592; 438,699; 507,353; 936,252; 1404,176;
+        1872,116; 2340,88; 2500,88])
+                   annotation (Placement(transformation(extent={{-196,78},{-176,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
+        2000,3.e5])
+                   annotation (Placement(transformation(extent={{-194,154},{
+            -174,174}}, rotation=0)));
+  Control.Condenser_LevelControl_RE5 regulation_Niveau(add(k1=+1, k2=-1),
+      pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (Placement(
+        transformation(extent={{140,-146},{102,-110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
+                          annotation (Placement(transformation(extent={{191,
+            -140},{169,-118}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
+    T(fixed=true, start=461.56),
+    Pm(start=2220000))   annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=650),
+    lambda(fixed=false) = 0.03,
+    L=48.72,
+    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
+        69.8e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-196,-154},{
+            -174,-132}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pression_eauA.y, sourceP1.IPressure)
+                                              annotation (Line(points={{-170.9,
+          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
+          -124,88},{-124,55},{-125,55}}));
+  connect(Pression_Turbine.y, sourceP.IPressure)
+                                             annotation (Line(points={{-173,164},
+          {-166,164},{-166,152},{-194,152},{-194,130},{-181.5,130}}));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
+         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
+  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
+    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
+          -111.8}}));
+  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
+    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Temperature_eauA.y, sourceP1.ITemperature)
+                                                    annotation (Line(points={{
+          -175,-78},{-170,-78},{-170,-49},{-171,-49}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics={
+        Text(
+          extent={{-130,218},{124,158}},
+          lineColor={0,0,255},
+          textString=
+               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-90,-188},{102,-220}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-202,-196},{-100,-210}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{-118,152},{-62,138}},
+          lineColor={0,0,255},
+          textString=
+               "Qmin = 0")}), experiment(StopTime=300),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicWaterHeating_Islanding;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Qwater_negative.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Qwater_negative.mo
index 23b025899172e1e68b6c08458c581050d731a85d..bdae2c95f7b133a4ae53dc09d4aea7903ba73dd0 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Qwater_negative.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Qwater_negative.mo
@@ -1,306 +1,303 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicWaterHeating_Qwater_negative
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    P0=22.733e5,
-    h0=2650.6e3)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=2, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
-    Q(fixed=false, start=56),
-    Cvmax(fixed=false) = 354.534,
-    mode_caract=0,
-    Cv(start=70, fixed=false),
-    C1(h_vol(start=800e3), h(start=800e3)))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
-    Dc=0.016,
-    Lc=2.56,
-    PasL=0.027,
-    PasT=0.02338,
-    ec=2e-3,
-    Rv=1.130514,
-    Ns=10,
-    DpfCorr=1.1136,
-    cp=506,
-    rho=7780,
-    lambda=35,
-    COP0l(fixed=false) = 1.23,
-    C2ex(P(start=2220000)),
-    ntubes1=351,
-    ntubes2=351,
-    ntubes3=1319,
-    L3=26.4,
-    L2=13.2,
-    L1=13.2,
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1000.65e3), P(start=68.48e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      zl(fixed=true, start=0.43),
-      Kvl=1,
-      V=53,
-      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
-      Mp=53227,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      P(fixed=true, start=2216584),
-      hl(start=806345),
-      hv(start=1063490),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
-            519,519.4}),
-      Tp(start=509)),
-    Ce1(P(start=7100000)),
-    pipe_1(
-      z2=0.3,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000}),
-      Tp(start={500,501,502,503,504,505,506,507,508,510})),
-    pipe_2(
-      z2=0.4,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
-            6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    volumeD1(h(start=953939), P(start=6848000)),
-    volumeD(
-      h(start=812750),
-      dynamic_mass_balance=false,
-      P(start=6872000)),
-    P0c=2200000,
-    pipe_3(
-      steady_state=true,
-      mode=1,
-      z2=0.7,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-            492,492,492,492,132}),
-      advection=false,
-      inertia=true,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
-            6854000,6853000,6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4})))
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
-                         annotation (Placement(transformation(extent={{-99,-48},
-            {-79,-28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
-    C2(h_vol(start=927700), h(start=927700)))
-                         annotation (Placement(transformation(extent={{-80,34},
-            {-100,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
-                   annotation (Placement(transformation(extent={{-194,-8},{-172,
-            14}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
-                   annotation (Placement(transformation(extent={{-196,-88},{
-            -176,-68}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    P0=71.29e5,
-    h0=772.09e3,
-    T0=454.46,
-    option_temperature=1)
-    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
-        624.97; 300,624.97; 2000,-200; 3000,-200])
-                   annotation (Placement(transformation(extent={{-196,78},{-176,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
-        2000,3.e5])
-                   annotation (Placement(transformation(extent={{-194,154},{
-            -174,174}}, rotation=0)));
-  Control.Condenser_LevelControl_RE5 regulation_Niveau(add(k1=+1, k2=-1),
-      pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (Placement(
-        transformation(extent={{140,-146},{102,-110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
-                          annotation (Placement(transformation(extent={{191,
-            -140},{169,-118}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
-    T(fixed=true, start=461.56),
-    Pm(start=2220000))   annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=650),
-    lambda(fixed=false) = 0.03,
-    L=48.72,
-    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
-        69.8e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-196,-154},{
-            -174,-132}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pression_eauA.y, sourceP1.IPressure)
-                                              annotation (Line(points={{-170.9,
-          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
-          -124,88},{-124,55},{-125,55}}));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
-         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
-  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
-    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
-          -111.8}}));
-  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
-    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics={
-        Text(
-          extent={{-130,218},{124,158}},
-          lineColor={0,0,255},
-          textString=
-               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-90,-188},{102,-220}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-202,-196},{-100,-210}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{-118,152},{-62,138}},
-          lineColor={0,0,255},
-          textString=
-               "Qmin = 0")}), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicWaterHeating_Qwater_negative;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicWaterHeating_Qwater_negative
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    P0=22.733e5,
+    h0=2650.6e3)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=2, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
+    Q(fixed=false, start=56),
+    Cvmax(fixed=false) = 354.534,
+    mode_caract=0,
+    Cv(start=70, fixed=false),
+    C1(h_vol(start=800e3), h(start=800e3)))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
+    Dc=0.016,
+    Lc=2.56,
+    PasL=0.027,
+    PasT=0.02338,
+    ec=2e-3,
+    Rv=1.130514,
+    Ns=10,
+    DpfCorr=1.1136,
+    cp=506,
+    rho=7780,
+    lambda=35,
+    COP0l(fixed=false) = 1.23,
+    C2ex(P(start=2220000)),
+    ntubes1=351,
+    ntubes2=351,
+    ntubes3=1319,
+    L3=26.4,
+    L2=13.2,
+    L1=13.2,
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1000.65e3), P(start=68.48e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      zl(fixed=true, start=0.43),
+      Kvl=1,
+      V=53,
+      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
+      Mp=53227,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      P(fixed=true, start=2216584),
+      hl(start=806345),
+      hv(start=1063490),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
+            519,519.4}),
+      Tp(start=509)),
+    Ce1(P(start=7100000)),
+    pipe_1(
+      z2=0.3,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000}),
+      Tp(start={500,501,502,503,504,505,506,507,508,510})),
+    pipe_2(
+      z2=0.4,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
+            6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    volumeD1(h(start=953939), P(start=6848000)),
+    volumeD(
+      h(start=812750),
+      dynamic_mass_balance=false,
+      P(start=6872000)),
+    P0c=2200000,
+    pipe_3(
+      steady_state=true,
+      mode=1,
+      z2=0.7,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+            492,492,492,492,132}),
+      advection=false,
+      inertia=true,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
+            6854000,6853000,6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4})))
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
+                         annotation (Placement(transformation(extent={{-99,-48},
+            {-79,-28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
+    C2(h_vol(start=927700), h(start=927700)))
+                         annotation (Placement(transformation(extent={{-80,34},
+            {-100,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
+                   annotation (Placement(transformation(extent={{-194,-8},{-172,
+            14}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
+                   annotation (Placement(transformation(extent={{-196,-88},{
+            -176,-68}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    P0=71.29e5,
+    h0=772.09e3,
+    T0=454.46,
+    option_temperature=1)
+    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
+        624.97; 300,624.97; 2000,-200; 3000,-200])
+                   annotation (Placement(transformation(extent={{-196,78},{-176,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
+        2000,3.e5])
+                   annotation (Placement(transformation(extent={{-194,154},{
+            -174,174}}, rotation=0)));
+  Control.Condenser_LevelControl_RE5 regulation_Niveau(add(k1=+1, k2=-1),
+      pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (Placement(
+        transformation(extent={{140,-146},{102,-110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
+                          annotation (Placement(transformation(extent={{191,
+            -140},{169,-118}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
+    T(fixed=true, start=461.56),
+    Pm(start=2220000))   annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=650),
+    lambda(fixed=false) = 0.03,
+    L=48.72,
+    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
+        69.8e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-196,-154},{
+            -174,-132}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pression_eauA.y, sourceP1.IPressure)
+                                              annotation (Line(points={{-170.9,
+          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
+          -124,88},{-124,55},{-125,55}}));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
+         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
+  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
+    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
+          -111.8}}));
+  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
+    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics={
+        Text(
+          extent={{-130,218},{124,158}},
+          lineColor={0,0,255},
+          textString=
+               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-90,-188},{102,-220}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-202,-196},{-100,-210}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{-118,152},{-62,138}},
+          lineColor={0,0,255},
+          textString=
+               "Qmin = 0")}), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicWaterHeating_Qwater_negative;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Qwater_zero.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Qwater_zero.mo
index 06836a91056549639b2400c3d47983e7949bc43d..64cc9470ce582fe3beb4385986331a033103d83d 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Qwater_zero.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterHeating_Qwater_zero.mo
@@ -1,306 +1,303 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicWaterHeating_Qwater_zero
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    P0=22.733e5,
-    h0=2650.6e3)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=2, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
-    Q(fixed=false, start=56),
-    Cvmax(fixed=false) = 354.534,
-    mode_caract=0,
-    Cv(start=70, fixed=false),
-    C1(h_vol(start=800e3), h(start=800e3)))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
-    Dc=0.016,
-    Lc=2.56,
-    PasL=0.027,
-    PasT=0.02338,
-    ec=2e-3,
-    Rv=1.130514,
-    Ns=10,
-    DpfCorr=1.1136,
-    cp=506,
-    rho=7780,
-    lambda=35,
-    COP0l(fixed=false) = 1.23,
-    C2ex(P(start=2220000)),
-    ntubes1=351,
-    ntubes2=351,
-    ntubes3=1319,
-    L3=26.4,
-    L2=13.2,
-    L1=13.2,
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1000.65e3), P(start=68.48e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      zl(fixed=true, start=0.43),
-      Kvl=1,
-      V=53,
-      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
-      Mp=53227,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      P(fixed=true, start=2216584),
-      hl(start=806345),
-      hv(start=1063490),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
-            519,519.4}),
-      Tp(start=509)),
-    Ce1(P(start=7100000)),
-    pipe_1(
-      z2=0.3,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000}),
-      Tp(start={500,501,502,503,504,505,506,507,508,510})),
-    pipe_2(
-      z2=0.4,
-      mode=1,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
-            6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    volumeD1(h(start=953939), P(start=6848000)),
-    volumeD(
-      h(start=812750),
-      dynamic_mass_balance=false,
-      P(start=6872000)),
-    P0c=2200000,
-    pipe_3(
-      steady_state=true,
-      mode=1,
-      z2=0.7,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-            492,492,492,492,132}),
-      advection=false,
-      inertia=true,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
-            6854000,6853000,6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4})))
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
-                         annotation (Placement(transformation(extent={{-99,-48},
-            {-79,-28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
-    C2(h_vol(start=927700), h(start=927700)))
-                         annotation (Placement(transformation(extent={{-80,34},
-            {-100,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
-                   annotation (Placement(transformation(extent={{-194,-8},{-172,
-            14}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
-                   annotation (Placement(transformation(extent={{-196,-88},{
-            -176,-68}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    P0=71.29e5,
-    h0=772.09e3,
-    T0=454.46,
-    option_temperature=1)
-    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
-        624.97; 300,624.97; 2000,0; 3000,0])
-                   annotation (Placement(transformation(extent={{-196,78},{-176,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
-        2000,3.e5])
-                   annotation (Placement(transformation(extent={{-194,154},{
-            -174,174}}, rotation=0)));
-  Control.Condenser_LevelControl_RE5 regulation_Niveau(add(k1=+1, k2=-1),
-      pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (Placement(
-        transformation(extent={{140,-146},{102,-110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
-                          annotation (Placement(transformation(extent={{191,
-            -140},{169,-118}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
-    T(fixed=true, start=461.56),
-    Pm(start=2220000))   annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=650),
-    lambda(fixed=false) = 0.03,
-    L=48.72,
-    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
-        69.8e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-196,-154},{
-            -174,-132}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pression_eauA.y, sourceP1.IPressure)
-                                              annotation (Line(points={{-170.9,
-          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
-          -124,88},{-124,55},{-125,55}}));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
-         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
-  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
-    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
-          -111.8}}));
-  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
-    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics={
-        Text(
-          extent={{-130,218},{124,158}},
-          lineColor={0,0,255},
-          textString=
-               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-90,-188},{102,-220}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-202,-196},{-100,-210}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{-118,152},{-62,138}},
-          lineColor={0,0,255},
-          textString=
-               "Qmin = 0")}), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicWaterHeating_Qwater_zero;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicWaterHeating_Qwater_zero
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    P0=22.733e5,
+    h0=2650.6e3)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=2, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ControlValve_eau(
+    Q(fixed=false, start=56),
+    Cvmax(fixed=false) = 354.534,
+    mode_caract=0,
+    Cv(start=70, fixed=false),
+    C1(h_vol(start=800e3), h(start=800e3)))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterHeating WaterHeating(
+    Dc=0.016,
+    Lc=2.56,
+    PasL=0.027,
+    PasT=0.02338,
+    ec=2e-3,
+    Rv=1.130514,
+    Ns=10,
+    DpfCorr=1.1136,
+    cp=506,
+    rho=7780,
+    lambda=35,
+    COP0l(fixed=false) = 1.23,
+    C2ex(P(start=2220000)),
+    ntubes1=351,
+    ntubes2=351,
+    ntubes3=1319,
+    L3=26.4,
+    L2=13.2,
+    L1=13.2,
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1000.65e3), P(start=68.48e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      zl(fixed=true, start=0.43),
+      Kvl=1,
+      V=53,
+      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
+      Mp=53227,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      P(fixed=true, start=2216584),
+      hl(start=806345),
+      hv(start=1063490),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
+            519,519.4}),
+      Tp(start=509)),
+    Ce1(P(start=7100000)),
+    pipe_1(
+      z2=0.3,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000}),
+      Tp(start={500,501,502,503,504,505,506,507,508,510})),
+    pipe_2(
+      z2=0.4,
+      mode=1,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
+            6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    volumeD1(h(start=953939), P(start=6848000)),
+    volumeD(
+      h(start=812750),
+      dynamic_mass_balance=false,
+      P(start=6872000)),
+    P0c=2200000,
+    pipe_3(
+      steady_state=true,
+      mode=1,
+      z2=0.7,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+            492,492,492,492,132}),
+      advection=false,
+      inertia=true,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
+            6854000,6853000,6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4})))
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
+                         annotation (Placement(transformation(extent={{-99,-48},
+            {-79,-28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
+    C2(h_vol(start=927700), h(start=927700)))
+                         annotation (Placement(transformation(extent={{-80,34},
+            {-100,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
+                   annotation (Placement(transformation(extent={{-194,-8},{-172,
+            14}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
+                   annotation (Placement(transformation(extent={{-196,-88},{
+            -176,-68}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    P0=71.29e5,
+    h0=772.09e3,
+    T0=454.46,
+    option_temperature=1)
+    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=53)
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
+        624.97; 300,624.97; 2000,0; 3000,0])
+                   annotation (Placement(transformation(extent={{-196,78},{-176,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
+        2000,3.e5])
+                   annotation (Placement(transformation(extent={{-194,154},{
+            -174,174}}, rotation=0)));
+  Control.Condenser_LevelControl_RE5 regulation_Niveau(add(k1=+1, k2=-1),
+      pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (Placement(
+        transformation(extent={{140,-146},{102,-110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
+                          annotation (Placement(transformation(extent={{191,
+            -140},{169,-118}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve checkValve(C2(h_vol(start=2600e3), h(start=2600e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
+    T(fixed=true, start=461.56),
+    Pm(start=2220000))   annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=650),
+    lambda(fixed=false) = 0.03,
+    L=48.72,
+    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
+        69.8e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-196,-154},{
+            -174,-132}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pression_eauA.y, sourceP1.IPressure)
+                                              annotation (Line(points={{-170.9,
+          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
+          -124,88},{-124,55},{-125,55}}));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
+         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
+  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
+    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
+          -111.8}}));
+  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
+    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics={
+        Text(
+          extent={{-130,218},{124,158}},
+          lineColor={0,0,255},
+          textString=
+               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-90,-188},{102,-220}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-202,-196},{-100,-210}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{-118,152},{-62,138}},
+          lineColor={0,0,255},
+          textString=
+               "Qmin = 0")}), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicWaterHeating_Qwater_zero;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterWaterExchanger.mo b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterWaterExchanger.mo
index b896adb2b91fde4a72c35d5f4d4f185f3e294965..f3aa99c9db2a884ce8625e5459ab26df09a61f30 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterWaterExchanger.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestDynamicWaterWaterExchanger.mo
@@ -1,54 +1,53 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestDynamicWaterWaterExchanger
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterWaterExchanger
-    echangeurAPlaques1D(
-    modec=1,
-    modef=1,
-    N=5) annotation (Placement(transformation(extent={{-20,40},{0,60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-                                           T0=340)
-    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
-                                            annotation (Placement(
-        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
-                                         annotation (Placement(transformation(
-          extent={{40,40},{60,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1
-                                          annotation (Placement(transformation(
-          extent={{20,20},{40,40}}, rotation=0)));
-equation
-  connect(sourceP.C, echangeurAPlaques1D.Ec)
-    annotation (Line(points={{-60,50},{-20,50}}, color={0,0,255}));
-  connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation (Line(points={{-40,30},
-          {-15,30},{-15,44}}, color={0,0,255}));
-  connect(echangeurAPlaques1D.Sc, puitsP.C) annotation (Line(points={{0,50},{20,
-          50},{20,50},{40,50}},      color={0,0,255}));
-  connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation (Line(points={{-5,44},{
-          -6,44},{-6,30},{20,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestDynamicWaterWaterExchanger;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestDynamicWaterWaterExchanger
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterWaterExchanger
+    echangeurAPlaques1D(
+    modec=1,
+    modef=1,
+    N=5) annotation (Placement(transformation(extent={{-20,40},{0,60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+                                           T0=340)
+    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
+                                            annotation (Placement(
+        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
+                                         annotation (Placement(transformation(
+          extent={{40,40},{60,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1
+                                          annotation (Placement(transformation(
+          extent={{20,20},{40,40}}, rotation=0)));
+equation
+  connect(sourceP.C, echangeurAPlaques1D.Ec)
+    annotation (Line(points={{-60,50},{-20,50}}, color={0,0,255}));
+  connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation (Line(points={{-40,30},
+          {-15,30},{-15,44}}, color={0,0,255}));
+  connect(echangeurAPlaques1D.Sc, puitsP.C) annotation (Line(points={{0,50},{20,
+          50},{20,50},{40,50}},      color={0,0,255}));
+  connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation (Line(points={{-5,44},{
+          -6,44},{-6,30},{20,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestDynamicWaterWaterExchanger;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestFan.mo b/ThermoSysPro/Examples/SimpleExamples/TestFan.mo
index 39cd794ab3c7c7983ee21e9f6abbbce160b55d0a..1db1a57c30b54712ef418189534636a58f23e0b8 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestFan.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestFan.mo
@@ -1,219 +1,218 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestFan
-
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
-    Xso2=0,
-    Xco2=0.0,
-    Xh2o=0.006,
-    Xo2=0.23,
-    Q0=4,
-    P0=130000,
-    T0=300)
-    annotation (Placement(transformation(extent={{-210,-24},{-164,24}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
-    annotation (Placement(transformation(
-        origin={182,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.FlueGases.Volumes.VolumeATh dynamicExchanger
-    annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-      option_temperature=2, W0={1e4})
-                            annotation (Placement(transformation(extent={{-48,
-            90},{-28,110}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases(                    Q(fixed=false, start=10), K=10)
-                                  annotation (Placement(transformation(extent={
-            {12,50},{32,70}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases1(                      Q(fixed=false, start=
-          11), K=0.01)            annotation (Placement(transformation(extent={
-            {-108,50},{-88,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=1e4,
-    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,100},{-20,
-            120}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.StaticFan staticFan(
-    VRotn=2700,
-    rm=1,
-    a2=0,
-    b1=-1.315,
-    b2=2.4593,
-    VRot=2700,
-    a1=-263.145,
-    a3=500,
-    Q(start=2),
-    Qv(start=1.4),
-    rho(start=1.4))
-               annotation (Placement(transformation(extent={{52,50},{72,70}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.CheckValve
-    singularPressureLossFlueGases2(                   Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {92,50},{112,70}}, rotation=0)));
-  FlueGases.Volumes.VolumeATh              dynamicExchanger1
-    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
-           0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
-      option_temperature=2, W0={1e4})
-                            annotation (Placement(transformation(extent={{-48,
-            -90},{-28,-110}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases3(                   Q(fixed=false, start=10), K=10)
-                                  annotation (Placement(transformation(extent={
-            {12,-70},{32,-50}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases4(                      Q(fixed=false, start=
-          11), K=0.01)            annotation (Placement(transformation(extent={
-            {-108,-70},{-88,-50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=1e4,
-    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,-120},{-20,
-            -100}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.StaticFan staticFan1(
-    VRotn=2700,
-    rm=1,
-    b2=2.4593,
-    b1=-1.315,
-    VRot=2700,
-    a1=-263.145,
-    a2=0,
-    a3=500,
-    Q(start=2),
-    Qv(start=1.4),
-    rho(start=1.4))
-               annotation (Placement(transformation(extent={{52,-70},{72,-50}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.CheckValve
-    singularPressureLossFlueGases5(                   Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {92,-70},{112,-50}}, rotation=0)));
-  ThermoSysPro.FlueGases.Junctions.Mixer2 mixerFlueGases2_1
-    annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.Volumes.VolumeDTh volume2S(dynamic_mass_balance=true,
-      dynamic_composition_balance=true)
-    annotation (Placement(transformation(extent={{-148,-10},{-128,10}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor
-    annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0)));
-  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor1
-    annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=4,
-    Finalvalue=1)   annotation (Placement(transformation(extent={{-200,40},{
-            -180,60}}, rotation=0)));
-equation
-  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
-      points={{32,60},{52,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
-      points={{72,60},{91,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line(
-      points={{32,-60},{52,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line(
-      points={{72,-60},{91,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line(
-      points={{113,60},{138,60},{138,10}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line(
-      points={{113,-60},{138,-60},{138,-10}},
-      color={0,0,0},
-      thickness=1));
-  connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line(
-      points={{-8,-60},{12,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line(
-      points={{-8,60},{12,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(Source_Fumees.C, volume2S.Ce) annotation (Line(
-      points={{-164,0},{-148,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line(
-      points={{-138,10},{-138,60},{-108,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line(
-      points={{-138,-10},{-138,-60},{-108,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,
-          90.2},{-58,60}}, color={191,95,0}));
-  connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{
-          -38,-90.2},{-58,-60}}, color={191,95,0}));
-  connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line(
-      points={{152,0},{162,0},{162,-1.20011e-015},{172.2,-1.20011e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (Line(
-      points={{-88,60},{-68,60}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line(
-      points={{-48,60},{-28,60}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(Qin.y, Source_Fumees.IMassFlow)
-    annotation (Line(points={{-179,50},{-170,50},{-170,28},{-187,28},{-187,12}}));
-  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (
-     Line(
-      points={{-88,-60},{-68,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(dynamicExchanger1.Cs1, temperatureSensor1.C1) annotation (Line(
-      points={{-48,-60},{-38,-60},{-28,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(rampe.y, heatSource.ISignal)
-    annotation (Line(points={{-21,110},{-38,110},{-38,105}}, color={0,0,255}));
-  connect(rampe1.y, heatSource1.ISignal) annotation (Line(points={{-21,-110},{
-          -38,-110},{-38,-105}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics,
-                                                 coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-150},{200,150}},
-        initialScale=0.1)),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestFan;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestFan
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
+    Xso2=0,
+    Xco2=0.0,
+    Xh2o=0.006,
+    Xo2=0.23,
+    Q0=4,
+    P0=130000,
+    T0=300)
+    annotation (Placement(transformation(extent={{-210,-24},{-164,24}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
+    annotation (Placement(transformation(
+        origin={182,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.FlueGases.Volumes.VolumeATh dynamicExchanger
+    annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+      option_temperature=2, W0={1e4})
+                            annotation (Placement(transformation(extent={{-48,
+            90},{-28,110}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases(                    Q(fixed=false, start=10), K=10)
+                                  annotation (Placement(transformation(extent={
+            {12,50},{32,70}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases1(                      Q(fixed=false, start=
+          11), K=0.01)            annotation (Placement(transformation(extent={
+            {-108,50},{-88,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=1e4,
+    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,100},{-20,
+            120}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.StaticFan staticFan(
+    VRotn=2700,
+    rm=1,
+    a2=0,
+    b1=-1.315,
+    b2=2.4593,
+    VRot=2700,
+    a1=-263.145,
+    a3=500,
+    Q(start=2),
+    Qv(start=1.4),
+    rho(start=1.4))
+               annotation (Placement(transformation(extent={{52,50},{72,70}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.CheckValve
+    singularPressureLossFlueGases2(                   Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {92,50},{112,70}}, rotation=0)));
+  FlueGases.Volumes.VolumeATh              dynamicExchanger1
+    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
+           0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
+      option_temperature=2, W0={1e4})
+                            annotation (Placement(transformation(extent={{-48,
+            -90},{-28,-110}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases3(                   Q(fixed=false, start=10), K=10)
+                                  annotation (Placement(transformation(extent={
+            {12,-70},{32,-50}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases4(                      Q(fixed=false, start=
+          11), K=0.01)            annotation (Placement(transformation(extent={
+            {-108,-70},{-88,-50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=1e4,
+    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,-120},{-20,
+            -100}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.StaticFan staticFan1(
+    VRotn=2700,
+    rm=1,
+    b2=2.4593,
+    b1=-1.315,
+    VRot=2700,
+    a1=-263.145,
+    a2=0,
+    a3=500,
+    Q(start=2),
+    Qv(start=1.4),
+    rho(start=1.4))
+               annotation (Placement(transformation(extent={{52,-70},{72,-50}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.CheckValve
+    singularPressureLossFlueGases5(                   Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {92,-70},{112,-50}}, rotation=0)));
+  ThermoSysPro.FlueGases.Junctions.Mixer2 mixerFlueGases2_1
+    annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.Volumes.VolumeDTh volume2S(dynamic_mass_balance=true,
+      dynamic_composition_balance=true)
+    annotation (Placement(transformation(extent={{-148,-10},{-128,10}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor
+    annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0)));
+  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor1
+    annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=4,
+    Finalvalue=1)   annotation (Placement(transformation(extent={{-200,40},{
+            -180,60}}, rotation=0)));
+equation
+  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
+      points={{32,60},{52,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
+      points={{72,60},{91,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line(
+      points={{32,-60},{52,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line(
+      points={{72,-60},{91,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line(
+      points={{113,60},{138,60},{138,10}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line(
+      points={{113,-60},{138,-60},{138,-10}},
+      color={0,0,0},
+      thickness=1));
+  connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line(
+      points={{-8,-60},{12,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line(
+      points={{-8,60},{12,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(Source_Fumees.C, volume2S.Ce) annotation (Line(
+      points={{-164,0},{-148,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line(
+      points={{-138,10},{-138,60},{-108,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line(
+      points={{-138,-10},{-138,-60},{-108,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,
+          90.2},{-58,60}}, color={191,95,0}));
+  connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{
+          -38,-90.2},{-58,-60}}, color={191,95,0}));
+  connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line(
+      points={{152,0},{162,0},{162,-1.20011e-015},{172.2,-1.20011e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (Line(
+      points={{-88,60},{-68,60}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line(
+      points={{-48,60},{-28,60}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(Qin.y, Source_Fumees.IMassFlow)
+    annotation (Line(points={{-179,50},{-170,50},{-170,28},{-187,28},{-187,12}}));
+  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (
+     Line(
+      points={{-88,-60},{-68,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(dynamicExchanger1.Cs1, temperatureSensor1.C1) annotation (Line(
+      points={{-48,-60},{-38,-60},{-28,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(rampe.y, heatSource.ISignal)
+    annotation (Line(points={{-21,110},{-38,110},{-38,105}}, color={0,0,255}));
+  connect(rampe1.y, heatSource1.ISignal) annotation (Line(points={{-21,-110},{
+          -38,-110},{-38,-105}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics,
+                                                 coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-150},{200,150}},
+        initialScale=0.1)),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestFan;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestFan_Pin.mo b/ThermoSysPro/Examples/SimpleExamples/TestFan_Pin.mo
index 834327ec70a3443a8c5e8c27405079f7151715db..f1d72a98dc60224db59a869c792aa62a4feabcfc 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestFan_Pin.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestFan_Pin.mo
@@ -1,225 +1,224 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestFan_Pin
-
-  FlueGases.BoundaryConditions.SourceP               Source_Fumees(
-    Xso2=0,
-    Xco2=0.0,
-    Xh2o=0.006,
-    Xo2=0.23,
-    P0=130000,
-    T0=300)
-    annotation (Placement(transformation(extent={{-210,-24},{-164,24}},
-          rotation=0)));
-  FlueGases.BoundaryConditions.SinkP             Puits_Fumees(P0=136434, T(start=
-          305.1156884766197))
-    annotation (Placement(transformation(
-        origin={182,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  FlueGases.Volumes.VolumeATh              dynamicExchanger(
-    Ce1(T(start=300.0000000000001)),
-    T(start=304.9170848582274),
-    Xco2(start=1.0717322621381142E-29),
-    Xh2o(start=0.0059999999999999715),
-    Xo2(start=0.23),
-    Xso2(start=2.580512329611796E-16))
-    annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-      option_temperature=2, W0={1e4})
-                            annotation (Placement(transformation(extent={{-48,
-            90},{-28,110}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases(                    Q(fixed=false, start=10), K=10,
-    rho(start=1.473613481083164)) annotation (Placement(transformation(extent={
-            {12,50},{32,70}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases1(                      Q(fixed=false, start=
-          11), K=0.01,
-    rho(start=1.4979229608974243))
-                                  annotation (Placement(transformation(extent={
-            {-108,50},{-88,70}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.StaticFan staticFan(
-    VRotn=2700,
-    rm=1,
-    a2=0,
-    b1=-1.315,
-    b2=2.4593,
-    VRot=2700,
-    a1=-263.145,
-    a3=500,
-    Qv(start=1.3566066051273442),
-    C2(T(start=305.11568847661977)),
-    T(start=305.0163869268126),
-    rho(start=1.4742671713265922))
-               annotation (Placement(transformation(extent={{52,50},{72,70}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.CheckValve
-    singularPressureLossFlueGases2(                   Q(fixed=false, start=10), touvert(
-        start=true))              annotation (Placement(transformation(extent={
-            {92,50},{112,70}}, rotation=0)));
-  FlueGases.Volumes.VolumeCTh              dynamicExchanger1(
-    T(start=304.91708485822744),
-    Xco2(start=1.0708121131984948E-29),
-    Xh2o(start=0.0059999999999999715),
-    Xo2(start=0.23),
-    Xso2(start=2.580512329611796E-16))
-    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
-           0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
-      option_temperature=2, W0={1e4})
-                            annotation (Placement(transformation(extent={{-48,
-            -90},{-28,-110}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases3(                   Q(fixed=false, start=10), K=10,
-    rho(start=1.4736134810831638))
-                                  annotation (Placement(transformation(extent={
-            {12,-70},{32,-50}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases4(                      Q(fixed=false, start=
-          11), K=0.01,
-    rho(start=1.4979229608974243))
-                                  annotation (Placement(transformation(extent={
-            {-108,-70},{-88,-50}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.StaticFan staticFan1(
-    VRotn=2700,
-    rm=1,
-    b2=2.4593,
-    b1=-1.315,
-    VRot=2700,
-    a1=-263.145,
-    a2=0,
-    a3=500,
-    Qv(start=1.356606605127344),
-    C2(T(start=305.1156884766198)),
-    T(start=305.01638692681263),
-    rho(start=1.4742671713265918))
-               annotation (Placement(transformation(extent={{52,-70},{72,-50}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.CheckValve
-    singularPressureLossFlueGases5(                   Q(fixed=false, start=10), touvert(
-        start=true))              annotation (Placement(transformation(extent={
-            {92,-70},{112,-50}}, rotation=0)));
-  ThermoSysPro.FlueGases.Junctions.Mixer2 mixerFlueGases2_1
-    annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=
-            0)));
-  FlueGases.Volumes.VolumeDTh              volume2S(dynamic_mass_balance=true,
-      dynamic_composition_balance=true,
-    Xco2(start=1.0683237791471977E-29),
-    Xh2o(start=0.0059999999999999715),
-    Xo2(start=0.23),
-    Xso2(start=2.580512329611796E-16))
-    annotation (Placement(transformation(extent={{-148,-10},{-128,10}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor
-    annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0)));
-  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor1
-    annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Pin(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=1.28837e5,
-    Finalvalue=1.36434e5)
-                    annotation (Placement(transformation(extent={{156,32},{176,
-            52}},      rotation=0)));
-equation
-  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
-      points={{32,60},{52,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
-      points={{72,60},{91,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line(
-      points={{32,-60},{52,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line(
-      points={{72,-60},{91,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line(
-      points={{113,60},{138,60},{138,10}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line(
-      points={{113,-60},{138,-60},{138,-10}},
-      color={0,0,0},
-      thickness=1));
-  connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line(
-      points={{-8,-60},{12,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line(
-      points={{-8,60},{12,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,
-          90.2},{-58,60}}, color={191,95,0}));
-  connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{
-          -38,-90.2},{-58,-60}}, color={191,95,0}));
-  connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line(
-      points={{152,0},{162,0},{162,-1.20011e-015},{172.2,-1.20011e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (
-      Line(
-      points={{-88,60},{-68,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line(
-      points={{-48,60},{-28,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(Pin.y, Puits_Fumees.IPressure) annotation (Line(points={{177,42},{184,
-          42},{196,42},{196,0},{187,0}}, color={0,0,255}));
-  connect(Source_Fumees.C, volume2S.Ce) annotation (Line(
-      points={{-164,0},{-156,0},{-148,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line(
-      points={{-138,10},{-138,10},{-138,60},{-108,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line(
-      points={{-138,-10},{-138,-10},{-138,-60},{-108,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (
-     Line(
-      points={{-88,-60},{-78,-60},{-68,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(dynamicExchanger1.Cs, temperatureSensor1.C1) annotation (Line(
-      points={{-48,-60},{-28,-60}},
-      color={0,0,0},
-      thickness=1));
-  annotation (experiment(StopTime=1000), Diagram(graphics,
-                                                 coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-150},{200,150}},
-        initialScale=0.1)),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestFan_Pin;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestFan_Pin
+  FlueGases.BoundaryConditions.SourceP               Source_Fumees(
+    Xso2=0,
+    Xco2=0.0,
+    Xh2o=0.006,
+    Xo2=0.23,
+    P0=130000,
+    T0=300)
+    annotation (Placement(transformation(extent={{-210,-24},{-164,24}},
+          rotation=0)));
+  FlueGases.BoundaryConditions.SinkP             Puits_Fumees(P0=136434, T(start=
+          305.1156884766197))
+    annotation (Placement(transformation(
+        origin={182,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  FlueGases.Volumes.VolumeATh              dynamicExchanger(
+    Ce1(T(start=300.0000000000001)),
+    T(start=304.9170848582274),
+    Xco2(start=1.0717322621381142E-29),
+    Xh2o(start=0.0059999999999999715),
+    Xo2(start=0.23),
+    Xso2(start=2.580512329611796E-16))
+    annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+      option_temperature=2, W0={1e4})
+                            annotation (Placement(transformation(extent={{-48,
+            90},{-28,110}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases(                    Q(fixed=false, start=10), K=10,
+    rho(start=1.473613481083164)) annotation (Placement(transformation(extent={
+            {12,50},{32,70}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases1(                      Q(fixed=false, start=
+          11), K=0.01,
+    rho(start=1.4979229608974243))
+                                  annotation (Placement(transformation(extent={
+            {-108,50},{-88,70}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.StaticFan staticFan(
+    VRotn=2700,
+    rm=1,
+    a2=0,
+    b1=-1.315,
+    b2=2.4593,
+    VRot=2700,
+    a1=-263.145,
+    a3=500,
+    Qv(start=1.3566066051273442),
+    C2(T(start=305.11568847661977)),
+    T(start=305.0163869268126),
+    rho(start=1.4742671713265922))
+               annotation (Placement(transformation(extent={{52,50},{72,70}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.CheckValve
+    singularPressureLossFlueGases2(                   Q(fixed=false, start=10), touvert(
+        start=true))              annotation (Placement(transformation(extent={
+            {92,50},{112,70}}, rotation=0)));
+  FlueGases.Volumes.VolumeCTh              dynamicExchanger1(
+    T(start=304.91708485822744),
+    Xco2(start=1.0708121131984948E-29),
+    Xh2o(start=0.0059999999999999715),
+    Xo2(start=0.23),
+    Xso2(start=2.580512329611796E-16))
+    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
+           0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
+      option_temperature=2, W0={1e4})
+                            annotation (Placement(transformation(extent={{-48,
+            -90},{-28,-110}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases3(                   Q(fixed=false, start=10), K=10,
+    rho(start=1.4736134810831638))
+                                  annotation (Placement(transformation(extent={
+            {12,-70},{32,-50}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases4(                      Q(fixed=false, start=
+          11), K=0.01,
+    rho(start=1.4979229608974243))
+                                  annotation (Placement(transformation(extent={
+            {-108,-70},{-88,-50}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.StaticFan staticFan1(
+    VRotn=2700,
+    rm=1,
+    b2=2.4593,
+    b1=-1.315,
+    VRot=2700,
+    a1=-263.145,
+    a2=0,
+    a3=500,
+    Qv(start=1.356606605127344),
+    C2(T(start=305.1156884766198)),
+    T(start=305.01638692681263),
+    rho(start=1.4742671713265918))
+               annotation (Placement(transformation(extent={{52,-70},{72,-50}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.CheckValve
+    singularPressureLossFlueGases5(                   Q(fixed=false, start=10), touvert(
+        start=true))              annotation (Placement(transformation(extent={
+            {92,-70},{112,-50}}, rotation=0)));
+  ThermoSysPro.FlueGases.Junctions.Mixer2 mixerFlueGases2_1
+    annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=
+            0)));
+  FlueGases.Volumes.VolumeDTh              volume2S(dynamic_mass_balance=true,
+      dynamic_composition_balance=true,
+    Xco2(start=1.0683237791471977E-29),
+    Xh2o(start=0.0059999999999999715),
+    Xo2(start=0.23),
+    Xso2(start=2.580512329611796E-16))
+    annotation (Placement(transformation(extent={{-148,-10},{-128,10}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor
+    annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0)));
+  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor1
+    annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Pin(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=1.28837e5,
+    Finalvalue=1.36434e5)
+                    annotation (Placement(transformation(extent={{156,32},{176,
+            52}},      rotation=0)));
+equation
+  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
+      points={{32,60},{52,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
+      points={{72,60},{91,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line(
+      points={{32,-60},{52,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line(
+      points={{72,-60},{91,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line(
+      points={{113,60},{138,60},{138,10}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line(
+      points={{113,-60},{138,-60},{138,-10}},
+      color={0,0,0},
+      thickness=1));
+  connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line(
+      points={{-8,-60},{12,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line(
+      points={{-8,60},{12,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,
+          90.2},{-58,60}}, color={191,95,0}));
+  connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{
+          -38,-90.2},{-58,-60}}, color={191,95,0}));
+  connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line(
+      points={{152,0},{162,0},{162,-1.20011e-015},{172.2,-1.20011e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (
+      Line(
+      points={{-88,60},{-68,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line(
+      points={{-48,60},{-28,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(Pin.y, Puits_Fumees.IPressure) annotation (Line(points={{177,42},{184,
+          42},{196,42},{196,0},{187,0}}, color={0,0,255}));
+  connect(Source_Fumees.C, volume2S.Ce) annotation (Line(
+      points={{-164,0},{-156,0},{-148,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line(
+      points={{-138,10},{-138,10},{-138,60},{-108,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line(
+      points={{-138,-10},{-138,-10},{-138,-60},{-108,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (
+     Line(
+      points={{-88,-60},{-78,-60},{-68,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(dynamicExchanger1.Cs, temperatureSensor1.C1) annotation (Line(
+      points={{-48,-60},{-28,-60}},
+      color={0,0,0},
+      thickness=1));
+  annotation (experiment(StopTime=1000), Diagram(graphics,
+                                                 coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-150},{200,150}},
+        initialScale=0.1)),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestFan_Pin;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestFan_Qin.mo b/ThermoSysPro/Examples/SimpleExamples/TestFan_Qin.mo
index c7578c28fdb1f50756cd063896b923e29ab64386..2589fc11ebee8262a58cd6d1614606efdeee1cc2 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestFan_Qin.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestFan_Qin.mo
@@ -1,212 +1,211 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestFan_Qin
-
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
-    Xso2=0,
-    Xco2=0.0,
-    Xh2o=0.006,
-    Xo2=0.23,
-    P0=130000,
-    Q0=4,
-    T0=300)
-    annotation (Placement(transformation(extent={{-210,-24},{-164,24}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
-    annotation (Placement(transformation(
-        origin={182,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  FlueGases.Volumes.VolumeATh              dynamicExchanger(T0=300, Xh2o0=0.006)
-    annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-      option_temperature=2, W0={1e4})
-                            annotation (Placement(transformation(extent={{-48,
-            90},{-28,110}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases(                    Q(fixed=false, start=10), K=10)
-                                  annotation (Placement(transformation(extent={
-            {12,50},{32,70}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases1(                      Q(fixed=false, start=
-          11), K=0.01)            annotation (Placement(transformation(extent={
-            {-108,50},{-88,70}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.StaticFan staticFan(
-    VRotn=2700,
-    rm=1,
-    a2=0,
-    b1=-1.315,
-    b2=2.4593,
-    VRot=2700,
-    a1=-263.145,
-    a3=500,
-    Q(start=2),
-    Qv(start=2),
-    rho(start=1))
-               annotation (Placement(transformation(extent={{52,50},{72,70}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.CheckValve
-    singularPressureLossFlueGases2(                   Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {92,50},{112,70}}, rotation=0)));
-  FlueGases.Volumes.VolumeCTh              dynamicExchanger1(Xh2o0=0.006, T0=
-        300)
-    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
-           0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
-      option_temperature=2, W0={1e4})
-                            annotation (Placement(transformation(extent={{-48,
-            -90},{-28,-110}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases3(                   Q(fixed=false, start=10), K=10)
-                                  annotation (Placement(transformation(extent={
-            {12,-70},{32,-50}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases4(                      Q(fixed=false, start=
-          11), K=0.01)            annotation (Placement(transformation(extent={
-            {-108,-70},{-88,-50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=1e4,
-    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,-120},{-20,
-            -100}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.StaticFan staticFan1(
-    VRotn=2700,
-    rm=1,
-    b2=2.4593,
-    b1=-1.315,
-    VRot=2700,
-    a1=-263.145,
-    a2=0,
-    a3=500,
-    Q(start=2),
-    Qv(start=2),
-    rho(start=1))
-               annotation (Placement(transformation(extent={{52,-70},{72,-50}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.CheckValve
-    singularPressureLossFlueGases5(                   Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {92,-70},{112,-50}}, rotation=0)));
-  ThermoSysPro.FlueGases.Junctions.Mixer2 mixerFlueGases2_1
-    annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=
-            0)));
-  FlueGases.Volumes.VolumeDTh              volume2S(
-    Xh2o0=0.006,
-    T0=300,
-    dynamic_mass_balance=true,
-    dynamic_composition_balance=true)
-    annotation (Placement(transformation(extent={{-149,-10},{-129,10}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor
-    annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0)));
-  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor1
-    annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=4,
-    Finalvalue=1)   annotation (Placement(transformation(extent={{-200,40},{
-            -180,60}}, rotation=0)));
-equation
-  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
-      points={{32,60},{52,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
-      points={{72,60},{91,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line(
-      points={{32,-60},{52,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line(
-      points={{72,-60},{91,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line(
-      points={{113,60},{138,60},{138,10}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line(
-      points={{113,-60},{138,-60},{138,-10}},
-      color={0,0,0},
-      thickness=1));
-  connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line(
-      points={{-8,-60},{12,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line(
-      points={{-8,60},{12,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,
-          90.2},{-58,60}}, color={191,95,0}));
-  connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{
-          -38,-90.2},{-58,-60}}, color={191,95,0}));
-  connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line(
-      points={{152,0},{162,0},{162,-1.20011e-015},{172.2,-1.20011e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(Qin.y, Source_Fumees.IMassFlow)
-    annotation (Line(points={{-179,50},{-170,50},{-170,28},{-187,28},{-187,12}}));
-  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (
-      Line(
-      points={{-88,60},{-68,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line(
-      points={{-48,60},{-28,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(Source_Fumees.C, volume2S.Ce) annotation (Line(
-      points={{-164,0},{-149,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line(
-      points={{-139,10},{-140,10},{-140,60},{-108,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line(
-      points={{-139,-10},{-140,-10},{-140,-58},{-140,-60},{-108,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (
-     Line(
-      points={{-88,-60},{-78,-60},{-68,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(dynamicExchanger1.Cs, temperatureSensor1.C1) annotation (Line(
-      points={{-48,-60},{-38,-60},{-28,-60}},
-      color={0,0,0},
-      thickness=1));
-  annotation (experiment(StopTime=1000), Diagram(graphics,
-                                                 coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-150},{200,150}},
-        initialScale=0.1)),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestFan_Qin;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestFan_Qin
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
+    Xso2=0,
+    Xco2=0.0,
+    Xh2o=0.006,
+    Xo2=0.23,
+    P0=130000,
+    Q0=4,
+    T0=300)
+    annotation (Placement(transformation(extent={{-210,-24},{-164,24}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
+    annotation (Placement(transformation(
+        origin={182,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  FlueGases.Volumes.VolumeATh              dynamicExchanger(T0=300, Xh2o0=0.006)
+    annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+      option_temperature=2, W0={1e4})
+                            annotation (Placement(transformation(extent={{-48,
+            90},{-28,110}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases(                    Q(fixed=false, start=10), K=10)
+                                  annotation (Placement(transformation(extent={
+            {12,50},{32,70}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases1(                      Q(fixed=false, start=
+          11), K=0.01)            annotation (Placement(transformation(extent={
+            {-108,50},{-88,70}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.StaticFan staticFan(
+    VRotn=2700,
+    rm=1,
+    a2=0,
+    b1=-1.315,
+    b2=2.4593,
+    VRot=2700,
+    a1=-263.145,
+    a3=500,
+    Q(start=2),
+    Qv(start=2),
+    rho(start=1))
+               annotation (Placement(transformation(extent={{52,50},{72,70}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.CheckValve
+    singularPressureLossFlueGases2(                   Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {92,50},{112,70}}, rotation=0)));
+  FlueGases.Volumes.VolumeCTh              dynamicExchanger1(Xh2o0=0.006, T0=
+        300)
+    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
+           0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
+      option_temperature=2, W0={1e4})
+                            annotation (Placement(transformation(extent={{-48,
+            -90},{-28,-110}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases3(                   Q(fixed=false, start=10), K=10)
+                                  annotation (Placement(transformation(extent={
+            {12,-70},{32,-50}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases4(                      Q(fixed=false, start=
+          11), K=0.01)            annotation (Placement(transformation(extent={
+            {-108,-70},{-88,-50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=1e4,
+    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,-120},{-20,
+            -100}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.StaticFan staticFan1(
+    VRotn=2700,
+    rm=1,
+    b2=2.4593,
+    b1=-1.315,
+    VRot=2700,
+    a1=-263.145,
+    a2=0,
+    a3=500,
+    Q(start=2),
+    Qv(start=2),
+    rho(start=1))
+               annotation (Placement(transformation(extent={{52,-70},{72,-50}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.CheckValve
+    singularPressureLossFlueGases5(                   Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {92,-70},{112,-50}}, rotation=0)));
+  ThermoSysPro.FlueGases.Junctions.Mixer2 mixerFlueGases2_1
+    annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=
+            0)));
+  FlueGases.Volumes.VolumeDTh              volume2S(
+    Xh2o0=0.006,
+    T0=300,
+    dynamic_mass_balance=true,
+    dynamic_composition_balance=true)
+    annotation (Placement(transformation(extent={{-149,-10},{-129,10}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor
+    annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0)));
+  ThermoSysPro.FlueGases.Sensors.TemperatureSensor temperatureSensor1
+    annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=4,
+    Finalvalue=1)   annotation (Placement(transformation(extent={{-200,40},{
+            -180,60}}, rotation=0)));
+equation
+  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
+      points={{32,60},{52,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
+      points={{72,60},{91,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line(
+      points={{32,-60},{52,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line(
+      points={{72,-60},{91,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line(
+      points={{113,60},{138,60},{138,10}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line(
+      points={{113,-60},{138,-60},{138,-10}},
+      color={0,0,0},
+      thickness=1));
+  connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line(
+      points={{-8,-60},{12,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line(
+      points={{-8,60},{12,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,
+          90.2},{-58,60}}, color={191,95,0}));
+  connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{
+          -38,-90.2},{-58,-60}}, color={191,95,0}));
+  connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line(
+      points={{152,0},{162,0},{162,-1.20011e-015},{172.2,-1.20011e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(Qin.y, Source_Fumees.IMassFlow)
+    annotation (Line(points={{-179,50},{-170,50},{-170,28},{-187,28},{-187,12}}));
+  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (
+      Line(
+      points={{-88,60},{-68,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line(
+      points={{-48,60},{-28,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(Source_Fumees.C, volume2S.Ce) annotation (Line(
+      points={{-164,0},{-149,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line(
+      points={{-139,10},{-140,10},{-140,60},{-108,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line(
+      points={{-139,-10},{-140,-10},{-140,-58},{-140,-60},{-108,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (
+     Line(
+      points={{-88,-60},{-78,-60},{-68,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(dynamicExchanger1.Cs, temperatureSensor1.C1) annotation (Line(
+      points={{-48,-60},{-38,-60},{-28,-60}},
+      color={0,0,0},
+      thickness=1));
+  annotation (experiment(StopTime=1000), Diagram(graphics,
+                                                 coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-150},{200,150}},
+        initialScale=0.1)),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestFan_Qin;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesJunctions.mo b/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesJunctions.mo
index 8ad93c0299951b5d616c34c26e6529759b75bcae..c3331aa2d598f071e72f04c9a72177063c2f67b5 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesJunctions.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesJunctions.mo
@@ -1,124 +1,123 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestFlueGasesJunctions
-
-  ThermoSysPro.FlueGases.Junctions.Splitter2 splitter2
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceQ sourceP( Q0=200)
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLoss annotation (Placement(transformation(extent={{-60,40},
-            {-40,60}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{40,80},
-            {60,100}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{40,0},{
-            60,20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0)
-             annotation (Placement(transformation(extent={{-40,60},{-20,80}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.Junctions.Mixer2 mixer2_1
-    annotation (Placement(transformation(extent={{-20,-60},{0,-40}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLoss3
-                         annotation (Placement(transformation(extent={{20,-60},
-            {40,-40}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLoss4 annotation (Placement(transformation(extent={{-60,-40},
-            {-40,-20}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLoss5 annotation (Placement(transformation(extent={{-60,-80},
-            {-40,-60}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Source sourceP1
-    annotation (Placement(transformation(extent={{-100,-40},{-80,-20}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceP sourceP2
-    annotation (Placement(transformation(extent={{-100,-80},{-80,-60}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkQ sinkP2
-    annotation (Placement(transformation(extent={{60,-60},{80,-40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0.5)
-             annotation (Placement(transformation(extent={{-60,-60},{-40,-40}},
-          rotation=0)));
-equation
-  connect(constante.y, splitter2.Ialpha1)
-    annotation (Line(points={{-19,70},{-14,70},{-14,56},{-9,56}}));
-  connect(constante1.y, mixer2_1.Ialpha1)
-    annotation (Line(points={{-39,-50},{-28,-50},{-28,-44},{-17,-44}}));
-  connect(sourceP.C, singularPressureLoss.C1) annotation (Line(
-      points={{-80,50},{-60,50}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(
-      points={{-40,50},{-20,50}},
-      color={0,0,0},
-      thickness=1));
-  connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(
-      points={{-6,60},{-6,90},{40,90}},
-      color={0,0,0},
-      thickness=1));
-  connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(
-      points={{-6,40},{-6,10},{40,10}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(
-      points={{60,90},{80.2,90}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(
-      points={{60,10},{80.2,10}},
-      color={0,0,0},
-      thickness=1));
-  connect(sourceP1.C, singularPressureLoss4.C1) annotation (Line(
-      points={{-80,-30},{-60,-30}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLoss4.C2, mixer2_1.Ce1) annotation (Line(
-      points={{-40,-30},{-14,-30},{-14,-40}},
-      color={0,0,0},
-      thickness=1));
-  connect(mixer2_1.Ce2, singularPressureLoss5.C2) annotation (Line(
-      points={{-14,-60},{-14,-70},{-40,-70}},
-      color={0,0,0},
-      thickness=1));
-  connect(mixer2_1.Cs, singularPressureLoss3.C1) annotation (Line(
-      points={{0,-50},{20,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLoss3.C2, sinkP2.C) annotation (Line(
-      points={{40,-50},{60.2,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(sourceP2.C, singularPressureLoss5.C1) annotation (Line(
-      points={{-80,-70},{-60,-70}},
-      color={0,0,0},
-      thickness=1));
-  annotation (experiment(StopTime=200), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestFlueGasesJunctions;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestFlueGasesJunctions
+  ThermoSysPro.FlueGases.Junctions.Splitter2 splitter2
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceQ sourceP( Q0=200)
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLoss annotation (Placement(transformation(extent={{-60,40},
+            {-40,60}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{40,80},
+            {60,100}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{40,0},{
+            60,20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0)
+             annotation (Placement(transformation(extent={{-40,60},{-20,80}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.Junctions.Mixer2 mixer2_1
+    annotation (Placement(transformation(extent={{-20,-60},{0,-40}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLoss3
+                         annotation (Placement(transformation(extent={{20,-60},
+            {40,-40}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLoss4 annotation (Placement(transformation(extent={{-60,-40},
+            {-40,-20}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLoss5 annotation (Placement(transformation(extent={{-60,-80},
+            {-40,-60}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Source sourceP1
+    annotation (Placement(transformation(extent={{-100,-40},{-80,-20}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceP sourceP2
+    annotation (Placement(transformation(extent={{-100,-80},{-80,-60}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkQ sinkP2
+    annotation (Placement(transformation(extent={{60,-60},{80,-40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0.5)
+             annotation (Placement(transformation(extent={{-60,-60},{-40,-40}},
+          rotation=0)));
+equation
+  connect(constante.y, splitter2.Ialpha1)
+    annotation (Line(points={{-19,70},{-14,70},{-14,56},{-9,56}}));
+  connect(constante1.y, mixer2_1.Ialpha1)
+    annotation (Line(points={{-39,-50},{-28,-50},{-28,-44},{-17,-44}}));
+  connect(sourceP.C, singularPressureLoss.C1) annotation (Line(
+      points={{-80,50},{-60,50}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(
+      points={{-40,50},{-20,50}},
+      color={0,0,0},
+      thickness=1));
+  connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(
+      points={{-6,60},{-6,90},{40,90}},
+      color={0,0,0},
+      thickness=1));
+  connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(
+      points={{-6,40},{-6,10},{40,10}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(
+      points={{60,90},{80.2,90}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(
+      points={{60,10},{80.2,10}},
+      color={0,0,0},
+      thickness=1));
+  connect(sourceP1.C, singularPressureLoss4.C1) annotation (Line(
+      points={{-80,-30},{-60,-30}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLoss4.C2, mixer2_1.Ce1) annotation (Line(
+      points={{-40,-30},{-14,-30},{-14,-40}},
+      color={0,0,0},
+      thickness=1));
+  connect(mixer2_1.Ce2, singularPressureLoss5.C2) annotation (Line(
+      points={{-14,-60},{-14,-70},{-40,-70}},
+      color={0,0,0},
+      thickness=1));
+  connect(mixer2_1.Cs, singularPressureLoss3.C1) annotation (Line(
+      points={{0,-50},{20,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLoss3.C2, sinkP2.C) annotation (Line(
+      points={{40,-50},{60.2,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(sourceP2.C, singularPressureLoss5.C1) annotation (Line(
+      points={{-80,-70},{-60,-70}},
+      color={0,0,0},
+      thickness=1));
+  annotation (experiment(StopTime=200), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestFlueGasesJunctions;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesVolumes.mo b/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesVolumes.mo
index 381dd184dbc29675ebf727569f92bcf0dab64a46..ca2953c8dc92611d5c8ae0d38e8ff3a923d09bf0 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesVolumes.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesVolumes.mo
@@ -1,282 +1,281 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestFlueGasesVolumes
-
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
-    Xso2=0,
-    Xco2=0.0,
-    Xh2o=0.006,
-    Xo2=0.23,
-    Q0=2,
-    T0=300,
-    P0=1.3e5)
-    annotation (Placement(transformation(extent={{-120,60},{-100,80}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
-    annotation (Placement(transformation(
-        origin={130,70},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.FlueGases.Volumes.VolumeDTh dynamicExchanger
-    annotation (Placement(transformation(extent={{-40,60},{-20,80}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-      option_temperature=2, W0={2e4})
-                            annotation (Placement(transformation(extent={{-80,
-            102},{-60,122}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases(K(fixed=true) = 10, Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases1(K(fixed=true) = 0.01, Q(fixed=false, start=
-          11))                    annotation (Placement(transformation(extent={
-            {-80,60},{-60,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=1e4,
-    Finalvalue=2e4) annotation (Placement(transformation(extent={{-20,120},{-40,
-            140}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.StaticFan staticFan(
-    VRotn=2700,
-    rm=1,
-    VRot=3000,
-    a1=45.876,
-    a2=-50,
-    b1=-3.0752)
-               annotation (Placement(transformation(extent={{40,60},{60,80}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases2(
-                                  K(fixed=true) = 10, Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {80,60},{100,80}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees1(
-    Xso2=0,
-    Xco2=0.0,
-    Xh2o=0.006,
-    Xo2=0.23,
-    Q0=2,
-    T0=300,
-    P0=1.3e5)
-    annotation (Placement(transformation(extent={{-120,-40},{-100,-20}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees1
-    annotation (Placement(transformation(
-        origin={130,-30},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  FlueGases.Volumes.VolumeATh dynamicExchanger1
-    annotation (Placement(transformation(extent={{-40,-40},{-20,-20}}, rotation=
-           0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
-      option_temperature=2, W0={2e4})
-                            annotation (Placement(transformation(extent={{-80,2},
-            {-60,22}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases3(
-                                  K(fixed=true) = 10, Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {0,-40},{20,-20}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases4(K(fixed=true) = 0.01, Q(fixed=false, start=
-          11))                    annotation (Placement(transformation(extent={
-            {-80,-40},{-60,-20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=1e4,
-    Finalvalue=2e4) annotation (Placement(transformation(extent={{-20,20},{-40,
-            40}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.StaticFan staticFan1(
-    VRotn=2700,
-    rm=1,
-    VRot=3000,
-    a1=45.876,
-    a2=-50,
-    b1=-3.0752)
-               annotation (Placement(transformation(extent={{40,-40},{60,-20}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases5(
-                                  K(fixed=true) = 10, Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {80,-40},{100,-20}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees2(
-    Xso2=0,
-    Xco2=0.0,
-    Xh2o=0.006,
-    Xo2=0.23,
-    Q0=2,
-    T0=300,
-    P0=1.3e5)
-    annotation (Placement(transformation(extent={{-120,-140},{-100,-120}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees2
-    annotation (Placement(transformation(
-        origin={130,-130},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  FlueGases.Volumes.VolumeCTh dynamicExchanger2
-    annotation (Placement(transformation(extent={{-40,-140},{-20,-120}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(
-      option_temperature=2, W0={2e4})
-                            annotation (Placement(transformation(extent={{-80,
-            -98},{-60,-78}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases6(
-                                  K(fixed=true) = 10, Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {0,-140},{20,-120}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases7(K(fixed=true) = 0.01, Q(fixed=false, start=
-          11))                    annotation (Placement(transformation(extent={
-            {-80,-140},{-60,-120}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=1e4,
-    Finalvalue=2e4) annotation (Placement(transformation(extent={{-20,-80},{-40,
-            -60}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.StaticFan staticFan2(
-    VRotn=2700,
-    rm=1,
-    VRot=3000,
-    a1=45.876,
-    a2=-50,
-    b1=-3.0752)
-               annotation (Placement(transformation(extent={{40,-140},{60,-120}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases8(
-                                  K(fixed=true) = 10, Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {80,-140},{100,-120}}, rotation=0)));
-equation
-  connect(Source_Fumees.C, singularPressureLossFlueGases1.C1) annotation (Line(
-      points={{-100,70},{-80,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
-      points={{20,70},{40,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
-      points={{60,70},{80,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce) annotation (Line(
-      points={{-60,70},{-40,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(dynamicExchanger.Cs3, singularPressureLossFlueGases.C1) annotation (Line(
-      points={{-20,70},{0,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases2.C2, Puits_Fumees.C) annotation (Line(
-      points={{100,70},{120.2,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(rampe.y, heatSource.ISignal) annotation (Line(points={{-41,130},{-70,
-          130},{-70,117}}));
-  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-70,
-          102.2},{-30,70}}, color={191,95,0}));
-  connect(Source_Fumees1.C, singularPressureLossFlueGases4.C1)
-                                                              annotation (Line(
-      points={{-100,-30},{-80,-30}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases3.C2, staticFan1.C1)
-                                                          annotation (Line(
-      points={{20,-30},{40,-30}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan1.C2, singularPressureLossFlueGases5.C1)
-                                                           annotation (Line(
-      points={{60,-30},{80,-30}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases5.C2, Puits_Fumees1.C)
-                                                             annotation (Line(
-      points={{100,-30},{120.2,-30}},
-      color={0,0,0},
-      thickness=1));
-  connect(rampe1.y, heatSource1.ISignal)
-                                       annotation (Line(points={{-41,30},{-70,
-          30},{-70,17}}));
-  connect(heatSource1.C[1], dynamicExchanger1.Cth)
-                                                 annotation (Line(points={{-70,
-          2.2},{-30,-30}}, color={191,95,0}));
-  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (Line(
-      points={{-60,-30},{-40,-30}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(dynamicExchanger1.Cs1, singularPressureLossFlueGases3.C1) annotation (Line(
-      points={{-20,-30},{0,-30}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(Source_Fumees2.C, singularPressureLossFlueGases7.C1)
-                                                              annotation (Line(
-      points={{-100,-130},{-80,-130}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases6.C2, staticFan2.C1)
-                                                          annotation (Line(
-      points={{20,-130},{40,-130}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan2.C2, singularPressureLossFlueGases8.C1)
-                                                           annotation (Line(
-      points={{60,-130},{80,-130}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases8.C2, Puits_Fumees2.C)
-                                                             annotation (Line(
-      points={{100,-130},{120.2,-130}},
-      color={0,0,0},
-      thickness=1));
-  connect(rampe2.y, heatSource2.ISignal)
-                                       annotation (Line(points={{-41,-70},{-70,
-          -70},{-70,-83}}));
-  connect(heatSource2.C[1], dynamicExchanger2.Cth)
-                                                 annotation (Line(points={{-70,
-          -97.8},{-30,-130}}, color={191,95,0}));
-  connect(singularPressureLossFlueGases7.C2, dynamicExchanger2.Ce1) annotation (Line(
-      points={{-60,-130},{-40,-130}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(dynamicExchanger2.Cs, singularPressureLossFlueGases6.C1) annotation (Line(
-      points={{-20,-130},{0,-130}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  annotation (experiment(StopTime=200), Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-150},{200,150}},
-        initialScale=0.1), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestFlueGasesVolumes;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestFlueGasesVolumes
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
+    Xso2=0,
+    Xco2=0.0,
+    Xh2o=0.006,
+    Xo2=0.23,
+    Q0=2,
+    T0=300,
+    P0=1.3e5)
+    annotation (Placement(transformation(extent={{-120,60},{-100,80}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
+    annotation (Placement(transformation(
+        origin={130,70},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.FlueGases.Volumes.VolumeDTh dynamicExchanger
+    annotation (Placement(transformation(extent={{-40,60},{-20,80}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+      option_temperature=2, W0={2e4})
+                            annotation (Placement(transformation(extent={{-80,
+            102},{-60,122}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases(K(fixed=true) = 10, Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases1(K(fixed=true) = 0.01, Q(fixed=false, start=
+          11))                    annotation (Placement(transformation(extent={
+            {-80,60},{-60,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=1e4,
+    Finalvalue=2e4) annotation (Placement(transformation(extent={{-20,120},{-40,
+            140}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.StaticFan staticFan(
+    VRotn=2700,
+    rm=1,
+    VRot=3000,
+    a1=45.876,
+    a2=-50,
+    b1=-3.0752)
+               annotation (Placement(transformation(extent={{40,60},{60,80}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases2(
+                                  K(fixed=true) = 10, Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {80,60},{100,80}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees1(
+    Xso2=0,
+    Xco2=0.0,
+    Xh2o=0.006,
+    Xo2=0.23,
+    Q0=2,
+    T0=300,
+    P0=1.3e5)
+    annotation (Placement(transformation(extent={{-120,-40},{-100,-20}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees1
+    annotation (Placement(transformation(
+        origin={130,-30},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  FlueGases.Volumes.VolumeATh dynamicExchanger1
+    annotation (Placement(transformation(extent={{-40,-40},{-20,-20}}, rotation=
+           0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
+      option_temperature=2, W0={2e4})
+                            annotation (Placement(transformation(extent={{-80,2},
+            {-60,22}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases3(
+                                  K(fixed=true) = 10, Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {0,-40},{20,-20}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases4(K(fixed=true) = 0.01, Q(fixed=false, start=
+          11))                    annotation (Placement(transformation(extent={
+            {-80,-40},{-60,-20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=1e4,
+    Finalvalue=2e4) annotation (Placement(transformation(extent={{-20,20},{-40,
+            40}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.StaticFan staticFan1(
+    VRotn=2700,
+    rm=1,
+    VRot=3000,
+    a1=45.876,
+    a2=-50,
+    b1=-3.0752)
+               annotation (Placement(transformation(extent={{40,-40},{60,-20}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases5(
+                                  K(fixed=true) = 10, Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {80,-40},{100,-20}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees2(
+    Xso2=0,
+    Xco2=0.0,
+    Xh2o=0.006,
+    Xo2=0.23,
+    Q0=2,
+    T0=300,
+    P0=1.3e5)
+    annotation (Placement(transformation(extent={{-120,-140},{-100,-120}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees2
+    annotation (Placement(transformation(
+        origin={130,-130},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  FlueGases.Volumes.VolumeCTh dynamicExchanger2
+    annotation (Placement(transformation(extent={{-40,-140},{-20,-120}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(
+      option_temperature=2, W0={2e4})
+                            annotation (Placement(transformation(extent={{-80,
+            -98},{-60,-78}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases6(
+                                  K(fixed=true) = 10, Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {0,-140},{20,-120}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases7(K(fixed=true) = 0.01, Q(fixed=false, start=
+          11))                    annotation (Placement(transformation(extent={
+            {-80,-140},{-60,-120}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=1e4,
+    Finalvalue=2e4) annotation (Placement(transformation(extent={{-20,-80},{-40,
+            -60}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.StaticFan staticFan2(
+    VRotn=2700,
+    rm=1,
+    VRot=3000,
+    a1=45.876,
+    a2=-50,
+    b1=-3.0752)
+               annotation (Placement(transformation(extent={{40,-140},{60,-120}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases8(
+                                  K(fixed=true) = 10, Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {80,-140},{100,-120}}, rotation=0)));
+equation
+  connect(Source_Fumees.C, singularPressureLossFlueGases1.C1) annotation (Line(
+      points={{-100,70},{-80,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
+      points={{20,70},{40,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
+      points={{60,70},{80,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce) annotation (Line(
+      points={{-60,70},{-40,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(dynamicExchanger.Cs3, singularPressureLossFlueGases.C1) annotation (Line(
+      points={{-20,70},{0,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases2.C2, Puits_Fumees.C) annotation (Line(
+      points={{100,70},{120.2,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(rampe.y, heatSource.ISignal) annotation (Line(points={{-41,130},{-70,
+          130},{-70,117}}));
+  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-70,
+          102.2},{-30,70}}, color={191,95,0}));
+  connect(Source_Fumees1.C, singularPressureLossFlueGases4.C1)
+                                                              annotation (Line(
+      points={{-100,-30},{-80,-30}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases3.C2, staticFan1.C1)
+                                                          annotation (Line(
+      points={{20,-30},{40,-30}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan1.C2, singularPressureLossFlueGases5.C1)
+                                                           annotation (Line(
+      points={{60,-30},{80,-30}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases5.C2, Puits_Fumees1.C)
+                                                             annotation (Line(
+      points={{100,-30},{120.2,-30}},
+      color={0,0,0},
+      thickness=1));
+  connect(rampe1.y, heatSource1.ISignal)
+                                       annotation (Line(points={{-41,30},{-70,
+          30},{-70,17}}));
+  connect(heatSource1.C[1], dynamicExchanger1.Cth)
+                                                 annotation (Line(points={{-70,
+          2.2},{-30,-30}}, color={191,95,0}));
+  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (Line(
+      points={{-60,-30},{-40,-30}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(dynamicExchanger1.Cs1, singularPressureLossFlueGases3.C1) annotation (Line(
+      points={{-20,-30},{0,-30}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(Source_Fumees2.C, singularPressureLossFlueGases7.C1)
+                                                              annotation (Line(
+      points={{-100,-130},{-80,-130}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases6.C2, staticFan2.C1)
+                                                          annotation (Line(
+      points={{20,-130},{40,-130}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan2.C2, singularPressureLossFlueGases8.C1)
+                                                           annotation (Line(
+      points={{60,-130},{80,-130}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases8.C2, Puits_Fumees2.C)
+                                                             annotation (Line(
+      points={{100,-130},{120.2,-130}},
+      color={0,0,0},
+      thickness=1));
+  connect(rampe2.y, heatSource2.ISignal)
+                                       annotation (Line(points={{-41,-70},{-70,
+          -70},{-70,-83}}));
+  connect(heatSource2.C[1], dynamicExchanger2.Cth)
+                                                 annotation (Line(points={{-70,
+          -97.8},{-30,-130}}, color={191,95,0}));
+  connect(singularPressureLossFlueGases7.C2, dynamicExchanger2.Ce1) annotation (Line(
+      points={{-60,-130},{-40,-130}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(dynamicExchanger2.Cs, singularPressureLossFlueGases6.C1) annotation (Line(
+      points={{-20,-130},{0,-130}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  annotation (experiment(StopTime=200), Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-150},{200,150}},
+        initialScale=0.1), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestFlueGasesVolumes;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesVolumes1.mo b/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesVolumes1.mo
index c4b86ef26fe07949db00166ee595a6c1f8e21a9f..9c7cb48d5c3c5644239d34645fdf43a77e2929e7 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesVolumes1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestFlueGasesVolumes1.mo
@@ -1,137 +1,136 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestFlueGasesVolumes1
-
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases1(Q(start=8311.592762050328), rho(start=
-          1.5532126714414567))     annotation (Placement(transformation(extent=
-            {{-60,-60},{-40,-40}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceP sourceFlueGasesP
-    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkP sinkFlueGasesP(
-    T(start=400.00000000000006),
-    Xco2(start=0.1),
-    Xo2(start=0.22),
-    Xso2(start=1.8148213653042705E-33))
-    annotation (Placement(transformation(extent={{60,-60},{80,-40}}, rotation=0)));
-  ThermoSysPro.FlueGases.Volumes.VolumeATh volumeFlueGasesATh(Ce2(
-      Q(start=7434.114566895907),
-      T(start=399.99999999999994),
-      Xco2(start=0.1),
-      Xo2(start=0.22),
-      Xso2(start=-2.4077935272517807E-34)), Cs2(Q(start=7872.8536644731175)))
-    annotation (Placement(transformation(extent={{-20,-60},{0,-40}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases2 annotation (Placement(transformation(extent=
-            {{20,-60},{40,-40}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkP sinkFlueGasesP1
-    annotation (Placement(transformation(extent={{60,-100},{80,-80}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases4 annotation (Placement(transformation(extent=
-            {{20,-100},{40,-80}}, rotation=0)));
-  ThermoSysPro.FlueGases.Volumes.VolumeCTh volumeFlueGasesCTh(Ce3(Q(start=
-            3717.0572834479535)))
-    annotation (Placement(transformation(
-        origin={-10,30},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases3(rho(start=1.517960245237922))
-                                   annotation (Placement(transformation(
-        origin={-10,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases5 annotation (Placement(transformation(extent=
-            {{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceP sourceFlueGasesP1
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases6 annotation (Placement(transformation(extent=
-            {{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceP sourceFlueGasesP2
-    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
-            0)));
-equation
-  connect(sourceFlueGasesP.C, singularPressureLossFlueGases1.C1) annotation (Line(
-      points={{-80,-50},{-60,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases1.C2, volumeFlueGasesATh.Ce1)
-    annotation (Line(
-      points={{-40,-50},{-20,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases2.C2, sinkFlueGasesP.C) annotation (Line(
-      points={{40,-50},{60.2,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases4.C2, sinkFlueGasesP1.C) annotation (Line(
-      points={{40,-90},{60.2,-90}},
-      color={0,0,0},
-      thickness=1));
-  connect(volumeFlueGasesATh.Cs1, singularPressureLossFlueGases2.C1)
-    annotation (Line(
-      points={{0,-50},{20,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(volumeFlueGasesATh.Cs2, singularPressureLossFlueGases4.C1)
-    annotation (Line(
-      points={{-10,-60},{-10,-90},{20,-90}},
-      color={0,0,0},
-      thickness=1));
-  connect(volumeFlueGasesCTh.Cs, singularPressureLossFlueGases3.C1) annotation (Line(
-      points={{-10,20},{-10,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases3.C2, volumeFlueGasesATh.Ce2)
-    annotation (Line(
-      points={{-10,-20},{-10,-40}},
-      color={0,0,0},
-      thickness=1));
-  connect(sourceFlueGasesP1.C, singularPressureLossFlueGases5.C1)
-                                                                 annotation (Line(
-      points={{-80,30},{-60,30}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases5.C2, volumeFlueGasesCTh.Ce3)
-    annotation (Line(
-      points={{-40,30},{-20,30}},
-      color={0,0,0},
-      thickness=1));
-  connect(sourceFlueGasesP2.C, singularPressureLossFlueGases6.C1)
-                                                                 annotation (Line(
-      points={{-80,70},{-60,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases6.C2, volumeFlueGasesCTh.Ce1)
-    annotation (Line(
-      points={{-40,70},{-10,70},{-10,40}},
-      color={0,0,0},
-      thickness=1));
-  annotation (experiment(StopTime=200), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestFlueGasesVolumes1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestFlueGasesVolumes1
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases1(Q(start=8311.592762050328), rho(start=
+          1.5532126714414567))     annotation (Placement(transformation(extent=
+            {{-60,-60},{-40,-40}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceP sourceFlueGasesP
+    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkP sinkFlueGasesP(
+    T(start=400.00000000000006),
+    Xco2(start=0.1),
+    Xo2(start=0.22),
+    Xso2(start=1.8148213653042705E-33))
+    annotation (Placement(transformation(extent={{60,-60},{80,-40}}, rotation=0)));
+  ThermoSysPro.FlueGases.Volumes.VolumeATh volumeFlueGasesATh(Ce2(
+      Q(start=7434.114566895907),
+      T(start=399.99999999999994),
+      Xco2(start=0.1),
+      Xo2(start=0.22),
+      Xso2(start=-2.4077935272517807E-34)), Cs2(Q(start=7872.8536644731175)))
+    annotation (Placement(transformation(extent={{-20,-60},{0,-40}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases2 annotation (Placement(transformation(extent=
+            {{20,-60},{40,-40}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkP sinkFlueGasesP1
+    annotation (Placement(transformation(extent={{60,-100},{80,-80}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases4 annotation (Placement(transformation(extent=
+            {{20,-100},{40,-80}}, rotation=0)));
+  ThermoSysPro.FlueGases.Volumes.VolumeCTh volumeFlueGasesCTh(Ce3(Q(start=
+            3717.0572834479535)))
+    annotation (Placement(transformation(
+        origin={-10,30},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases3(rho(start=1.517960245237922))
+                                   annotation (Placement(transformation(
+        origin={-10,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases5 annotation (Placement(transformation(extent=
+            {{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceP sourceFlueGasesP1
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases6 annotation (Placement(transformation(extent=
+            {{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceP sourceFlueGasesP2
+    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
+            0)));
+equation
+  connect(sourceFlueGasesP.C, singularPressureLossFlueGases1.C1) annotation (Line(
+      points={{-80,-50},{-60,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases1.C2, volumeFlueGasesATh.Ce1)
+    annotation (Line(
+      points={{-40,-50},{-20,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases2.C2, sinkFlueGasesP.C) annotation (Line(
+      points={{40,-50},{60.2,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases4.C2, sinkFlueGasesP1.C) annotation (Line(
+      points={{40,-90},{60.2,-90}},
+      color={0,0,0},
+      thickness=1));
+  connect(volumeFlueGasesATh.Cs1, singularPressureLossFlueGases2.C1)
+    annotation (Line(
+      points={{0,-50},{20,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(volumeFlueGasesATh.Cs2, singularPressureLossFlueGases4.C1)
+    annotation (Line(
+      points={{-10,-60},{-10,-90},{20,-90}},
+      color={0,0,0},
+      thickness=1));
+  connect(volumeFlueGasesCTh.Cs, singularPressureLossFlueGases3.C1) annotation (Line(
+      points={{-10,20},{-10,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases3.C2, volumeFlueGasesATh.Ce2)
+    annotation (Line(
+      points={{-10,-20},{-10,-40}},
+      color={0,0,0},
+      thickness=1));
+  connect(sourceFlueGasesP1.C, singularPressureLossFlueGases5.C1)
+                                                                 annotation (Line(
+      points={{-80,30},{-60,30}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases5.C2, volumeFlueGasesCTh.Ce3)
+    annotation (Line(
+      points={{-40,30},{-20,30}},
+      color={0,0,0},
+      thickness=1));
+  connect(sourceFlueGasesP2.C, singularPressureLossFlueGases6.C1)
+                                                                 annotation (Line(
+      points={{-80,70},{-60,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases6.C2, volumeFlueGasesCTh.Ce1)
+    annotation (Line(
+      points={{-40,70},{-10,70},{-10,40}},
+      color={0,0,0},
+      thickness=1));
+  annotation (experiment(StopTime=200), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestFlueGasesVolumes1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestFossilFuelBoiler.mo b/ThermoSysPro/Examples/SimpleExamples/TestFossilFuelBoiler.mo
index f31e6354140b44e96e538f3ef176bb79f483bbdc..d41520c05e669bac2efc37c57dee55d568b5190b 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestFossilFuelBoiler.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestFossilFuelBoiler.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestFossilFuelBoiler
-  MultiFluids.Boilers.FossilFuelBoiler FossilFuelBoiler(
-    Wloss=0,
-    Ke=1.e6,
-    Tsf=386.16)
-    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
-  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    T0=338.16,
-    Cp=1282,
-    Xh=0.24403,
-    Xc=0.75323,
-    Q0=1.45)
-    annotation (Placement(transformation(extent={{-36,-78},{0,-41}}, rotation=0)));
-  FlueGases.BoundaryConditions.SourceQ sourceQ(
-    Xco2=0,
-    Xh2o=0.01,
-    Q0=27.,
-    T0=298.16,
-    Xo2=0.233) annotation (Placement(transformation(extent={{-110,-50},{-71,-13}},
-          rotation=0)));
-  FlueGases.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
-          extent={{68,-51},{110,-12}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ sourcePQ(
-    P0=140e5,
-    Q0=24.,
-    h0=600e3)
-    annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=
-            0)));
-  WaterSteam.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{74,13},{110,49}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3)
-    annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3)
-    annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0)));
-equation
-  connect(sourceQ.C, FossilFuelBoiler.Cair)     annotation (Line(
-      points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}},
-      color={0,0,0},
-      thickness=1));
-  connect(FossilFuelBoiler.Cfg, sinkP.C)     annotation (Line(
-      points={{45,-31.62},{62,-31.62},{62,-31.5},{68.42,-31.5}},
-      color={0,0,0},
-      thickness=1));
-  connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel)     annotation (Line(points={
-          {0,-59.5},{0,-40.8}}, color={0,0,0}));
-  connect(sourcePQ.C, singularPressureLoss.C1)
-    annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation (Line(
-        points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sink.C)
-    annotation (Line(points={{65,31},{74,31}}, color={0,0,255}));
-  connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation (Line(
-        points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255}));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestFossilFuelBoiler;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestFossilFuelBoiler
+  MultiFluids.Boilers.FossilFuelBoiler FossilFuelBoiler(
+    Wloss=0,
+    Ke=1.e6,
+    Tsf=386.16)
+    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
+  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    T0=338.16,
+    Cp=1282,
+    Xh=0.24403,
+    Xc=0.75323,
+    Q0=1.45)
+    annotation (Placement(transformation(extent={{-36,-78},{0,-41}}, rotation=0)));
+  FlueGases.BoundaryConditions.SourceQ sourceQ(
+    Xco2=0,
+    Xh2o=0.01,
+    Q0=27.,
+    T0=298.16,
+    Xo2=0.233) annotation (Placement(transformation(extent={{-110,-50},{-71,-13}},
+          rotation=0)));
+  FlueGases.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
+          extent={{68,-51},{110,-12}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ sourcePQ(
+    P0=140e5,
+    Q0=24.,
+    h0=600e3)
+    annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=
+            0)));
+  WaterSteam.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{74,13},{110,49}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3)
+    annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3)
+    annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0)));
+equation
+  connect(sourceQ.C, FossilFuelBoiler.Cair)     annotation (Line(
+      points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}},
+      color={0,0,0},
+      thickness=1));
+  connect(FossilFuelBoiler.Cfg, sinkP.C)     annotation (Line(
+      points={{45,-31.62},{62,-31.62},{62,-31.5},{68.42,-31.5}},
+      color={0,0,0},
+      thickness=1));
+  connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel)     annotation (Line(points={
+          {0,-59.5},{0,-40.8}}, color={0,0,0}));
+  connect(sourcePQ.C, singularPressureLoss.C1)
+    annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation (Line(
+        points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sink.C)
+    annotation (Line(points={{65,31},{74,31}}, color={0,0,255}));
+  connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation (Line(
+        points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255}));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestFossilFuelBoiler;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestFresnelField.mo b/ThermoSysPro/Examples/SimpleExamples/TestFresnelField.mo
index 0bf1de1200a2ed6ed91159927163354473ee8a87..092d1dbe8db55048493653f7fe367886eba648e3 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestFresnelField.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestFresnelField.mo
@@ -1,174 +1,174 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestFresnelField
-  parameter Integer Nt=3 "Number of trains";
-public
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    ntubes=1,
-    steady_state=true,
-    D=0.07,
-    e=0.004,
-    Ns=30,
-    T0=500,
-    lambda=20,
-    cpw=500,
-    rhow=8000,
-    Tp(start={628.0843201819387,627.9310075597404,627.8220175907211,
-          627.7368992018166,627.6679716601412,627.6112649113921,
-          627.5643995456558,627.5258238160011,627.4944728950805,
-          627.4695948757801,627.4506537300122,627.4372716636091,
-          627.4291939746797,627.426267226699,627.428426585461,627.4356896138493,
-          627.4481553612113,627.4660085346942,627.4895290639054,
-          627.5191082002851,627.5552734790091,627.5987264837852,
-          627.6504001032708,627.7115474128314,627.7838847016081,
-          627.8698331666657,627.9729350144038,629.4253815385038,
-          633.135688507217,636.2622387488283}),
-    Tp1(start={610.2709965207655,610.0984334604643,609.9757644369477,
-          609.8799665740102,609.8023932206363,609.7385750723525,
-          609.6858335131916,609.6424216866362,609.6071408778737,
-          609.5791446660139,609.5578296140685,609.5427704711935,
-          609.533680491646,609.5303869740989,609.5328169418054,609.540990157294,
-          609.5550181389947,609.5751088339957,609.6015773714007,
-          609.6348642175905,609.6755632868924,609.7244644309128,
-          609.7826179283193,609.8514345863706,609.9328467812495,
-          610.0295806069864,610.1456244663702,611.7808730290952,
-          615.9622431406954,619.4903247027197}),
-    Tp2(start={644.9596553467713,644.824579502235,644.7285482944553,
-          644.6535470354397,644.592810046145,644.5428402353538,
-          644.5015416419557,644.4675473586904,644.4399193877858,
-          644.4179953736024,644.4013031238645,644.3895098327511,
-          644.3823911261306,644.3798118348441,644.3817148399042,644.38811560583,
-          644.3991013774125,644.4148348525065,644.4355626048274,
-          644.4616292617266,644.4934994867675,644.531791236838,
-          644.5773261834961,644.6312079828199,644.6949482231629,
-          644.7706792525222,644.8615205623447,646.1407907783827,
-          649.404839172216,652.1510013554424}),
-    L=1e4/11.46)
-    annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3)
-               annotation (Placement(transformation(extent={{-101,-55},{-81,-35}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    dynamicTwoPhaseFlowPipe(
-    ntubes=1,
-    steady_state=true,
-    rugosrel=0.00005,
-    dpfCorr=1,
-    Ns=30,
-    P(start={12512365.778485337,12512269.4730028,12512159.010926897,
-          12512028.619141866,12511878.28140543,12511707.984695798,
-          12511517.718132183,12511307.472416837,12511077.239500606,
-          12510827.012364838,12510556.784871727,12510266.551658653,
-          12509956.30806284,12509626.050068311,12509275.774270097,
-          12508905.477852736,12508515.15858121,12508104.814803492,
-          12507674.445464557,12507224.050132478,12506753.629037917,
-          12506263.183129327,12505752.714147368,12505222.224723859,
-          12504671.718513375,12504101.200370008,12503510.676589508,
-          12502896.415784404,12502231.48634808,12501522.52554151,
-          12500776.553197166,12500000.0}),
-    h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266,
-          1645211.676359884,1681572.2077847784,1717947.2125321354,
-          1754334.1766730088,1790730.9833788855,1827135.788296852,
-          1863546.9394607474,1899962.9220483964,1936382.3178860326,
-          1972803.7739566958,2009225.9764870608,2045647.6282789519,
-          2082067.4276265746,2118484.0474634594,2154896.1134394333,
-          2191302.179544121,2227700.6996020116,2264089.9923674623,
-          2300468.196934767,2336833.213464297,2373182.6211112435,
-          2409513.559261445,2445822.5467506223,2482105.1942732874,
-          2518015.7979130256,2552967.680496474,2587102.355161259,
-          82548.43470391157}),
-    D=0.07,
-    inertia=false,
-    L=1e4/11.46)            annotation (Placement(transformation(extent={{-36,
-            -67},{36,-20}}, rotation=0)));
-  ThermoSysPro.Solar.Collectors.FresnelField champThermosolaireLFR_N(
-    Ns=30,
-    T(start=fill(500, 30)),
-    F12=0.6366,
-    A=1e4,
-    T0=303)
-    annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(
-    h0=2000e3, P0=125e5)          annotation (Placement(transformation(extent={{80,-54},
-            {100,-34}},         rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI(
-    Starttime=100,
-    Initialvalue=100,
-    Duration=3600,
-    Finalvalue=900) annotation (Placement(transformation(extent={{72,39},{58,53}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Angles(
-    Starttime=100,
-    Initialvalue=45,
-    Finalvalue=45,
-    Duration=3600)  annotation (Placement(transformation(extent={{-26,77},{-12,
-            90}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Q(
-    Starttime=100,
-    Duration=3600,
-    Initialvalue=2,
-    Finalvalue=3)   annotation (Placement(transformation(extent={{7,-6.5},{-7,
-            6.5}}, rotation=90,
-        origin={-90,-9.5})));
-  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier1(alpha=1/Nt)
-    annotation (Placement(transformation(extent={{-70,-54},{-50,-34}})));
-  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=Nt)
-    annotation (Placement(transformation(extent={{52,-54},{72,-34}})));
-equation
-  connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2)
-    annotation (Line(points={{0,1.6},{0,-15.6}}, color={191,95,0}));
-  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(
-        points={{0,-22.4},{0,-36.45}}, color={191,95,0}));
-  connect(champThermosolaireLFR_N.SunDNI, DNI.y)
-    annotation (Line(points={{44,45.6},{51,45.6},{51,46},{57.3,46}}));
-  connect(champThermosolaireLFR_N.SunA, Angles.y)
-    annotation (Line(points={{36.8,58.8},{36.8,84},{28,84},{28,83.5},{-11.3,
-          83.5}}));
-  connect(sourceP.C, massFlowMultiplier1.Ce) annotation (Line(points={{-81,-45},
-          {-76.5,-45},{-76.5,-44},{-70,-44}}, color={0,0,0}));
-  connect(massFlowMultiplier1.Cs, dynamicTwoPhaseFlowPipe.C1) annotation (Line(
-        points={{-50,-44},{-44,-44},{-44,-43.5},{-36,-43.5}}, color={0,0,0}));
-  connect(dynamicTwoPhaseFlowPipe.C2, massFlowMultiplier2.Ce) annotation (Line(
-        points={{36,-43.5},{47,-43.5},{47,-44},{52,-44}}, color={0,0,0}));
-  connect(massFlowMultiplier2.Cs, sinkP.C)
-    annotation (Line(points={{72,-44},{80,-44}}, color={0,0,0}));
-  connect(Q.y, sourceP.IMassFlow) annotation (Line(points={{-90,-17.2},{-91,
-          -17.2},{-91,-40}}, color={0,0,255}));
-  connect(Angles.y, champThermosolaireLFR_N.SunG) annotation (Line(points={{
-          -11.3,83.5},{27.2,83.5},{27.2,58.8}}, color={0,0,255}));
-  annotation (
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 16.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    experiment(StopTime=5000),
-    Diagram(graphics={Text(
-          extent={{-36,-64},{54,-82}},
-          lineColor={28,108,200},
-          textString="Fresnel field with Nt=%Nt trains")}));
-end TestFresnelField;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestFresnelField
+  parameter Integer Nt=3 "Number of trains";
+public
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    ntubes=1,
+    steady_state=true,
+    D=0.07,
+    e=0.004,
+    Ns=30,
+    T0=500,
+    lambda=20,
+    cpw=500,
+    rhow=8000,
+    Tp(start={628.0843201819387,627.9310075597404,627.8220175907211,
+          627.7368992018166,627.6679716601412,627.6112649113921,
+          627.5643995456558,627.5258238160011,627.4944728950805,
+          627.4695948757801,627.4506537300122,627.4372716636091,
+          627.4291939746797,627.426267226699,627.428426585461,627.4356896138493,
+          627.4481553612113,627.4660085346942,627.4895290639054,
+          627.5191082002851,627.5552734790091,627.5987264837852,
+          627.6504001032708,627.7115474128314,627.7838847016081,
+          627.8698331666657,627.9729350144038,629.4253815385038,
+          633.135688507217,636.2622387488283}),
+    Tp1(start={610.2709965207655,610.0984334604643,609.9757644369477,
+          609.8799665740102,609.8023932206363,609.7385750723525,
+          609.6858335131916,609.6424216866362,609.6071408778737,
+          609.5791446660139,609.5578296140685,609.5427704711935,
+          609.533680491646,609.5303869740989,609.5328169418054,609.540990157294,
+          609.5550181389947,609.5751088339957,609.6015773714007,
+          609.6348642175905,609.6755632868924,609.7244644309128,
+          609.7826179283193,609.8514345863706,609.9328467812495,
+          610.0295806069864,610.1456244663702,611.7808730290952,
+          615.9622431406954,619.4903247027197}),
+    Tp2(start={644.9596553467713,644.824579502235,644.7285482944553,
+          644.6535470354397,644.592810046145,644.5428402353538,
+          644.5015416419557,644.4675473586904,644.4399193877858,
+          644.4179953736024,644.4013031238645,644.3895098327511,
+          644.3823911261306,644.3798118348441,644.3817148399042,644.38811560583,
+          644.3991013774125,644.4148348525065,644.4355626048274,
+          644.4616292617266,644.4934994867675,644.531791236838,
+          644.5773261834961,644.6312079828199,644.6949482231629,
+          644.7706792525222,644.8615205623447,646.1407907783827,
+          649.404839172216,652.1510013554424}),
+    L=1e4/11.46)
+    annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3)
+               annotation (Placement(transformation(extent={{-101,-55},{-81,-35}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    dynamicTwoPhaseFlowPipe(
+    ntubes=1,
+    steady_state=true,
+    rugosrel=0.00005,
+    dpfCorr=1,
+    Ns=30,
+    P(start={12512365.778485337,12512269.4730028,12512159.010926897,
+          12512028.619141866,12511878.28140543,12511707.984695798,
+          12511517.718132183,12511307.472416837,12511077.239500606,
+          12510827.012364838,12510556.784871727,12510266.551658653,
+          12509956.30806284,12509626.050068311,12509275.774270097,
+          12508905.477852736,12508515.15858121,12508104.814803492,
+          12507674.445464557,12507224.050132478,12506753.629037917,
+          12506263.183129327,12505752.714147368,12505222.224723859,
+          12504671.718513375,12504101.200370008,12503510.676589508,
+          12502896.415784404,12502231.48634808,12501522.52554151,
+          12500776.553197166,12500000.0}),
+    h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266,
+          1645211.676359884,1681572.2077847784,1717947.2125321354,
+          1754334.1766730088,1790730.9833788855,1827135.788296852,
+          1863546.9394607474,1899962.9220483964,1936382.3178860326,
+          1972803.7739566958,2009225.9764870608,2045647.6282789519,
+          2082067.4276265746,2118484.0474634594,2154896.1134394333,
+          2191302.179544121,2227700.6996020116,2264089.9923674623,
+          2300468.196934767,2336833.213464297,2373182.6211112435,
+          2409513.559261445,2445822.5467506223,2482105.1942732874,
+          2518015.7979130256,2552967.680496474,2587102.355161259,
+          82548.43470391157}),
+    D=0.07,
+    inertia=false,
+    L=1e4/11.46)            annotation (Placement(transformation(extent={{-36,
+            -67},{36,-20}}, rotation=0)));
+  ThermoSysPro.Solar.Collectors.FresnelField champThermosolaireLFR_N(
+    Ns=30,
+    T(start=fill(500, 30)),
+    F12=0.6366,
+    A=1e4,
+    T0=303)
+    annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(
+    h0=2000e3, P0=125e5)          annotation (Placement(transformation(extent={{80,-54},
+            {100,-34}},         rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI(
+    Starttime=100,
+    Initialvalue=100,
+    Duration=3600,
+    Finalvalue=900) annotation (Placement(transformation(extent={{72,39},{58,53}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Angles(
+    Starttime=100,
+    Initialvalue=45,
+    Finalvalue=45,
+    Duration=3600)  annotation (Placement(transformation(extent={{-26,77},{-12,
+            90}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Q(
+    Starttime=100,
+    Duration=3600,
+    Initialvalue=2,
+    Finalvalue=3)   annotation (Placement(transformation(extent={{7,-6.5},{-7,
+            6.5}}, rotation=90,
+        origin={-90,-9.5})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier1(alpha=1/Nt)
+    annotation (Placement(transformation(extent={{-70,-54},{-50,-34}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=Nt)
+    annotation (Placement(transformation(extent={{52,-54},{72,-34}})));
+equation
+  connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2)
+    annotation (Line(points={{0,1.6},{0,-15.6}}, color={191,95,0}));
+  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(
+        points={{0,-22.4},{0,-36.45}}, color={191,95,0}));
+  connect(champThermosolaireLFR_N.SunDNI, DNI.y)
+    annotation (Line(points={{44,45.6},{51,45.6},{51,46},{57.3,46}}));
+  connect(champThermosolaireLFR_N.SunA, Angles.y)
+    annotation (Line(points={{36.8,58.8},{36.8,84},{28,84},{28,83.5},{-11.3,
+          83.5}}));
+  connect(sourceP.C, massFlowMultiplier1.Ce) annotation (Line(points={{-81,-45},
+          {-76.5,-45},{-76.5,-44},{-70,-44}}, color={0,0,0}));
+  connect(massFlowMultiplier1.Cs, dynamicTwoPhaseFlowPipe.C1) annotation (Line(
+        points={{-50,-44},{-44,-44},{-44,-43.5},{-36,-43.5}}, color={0,0,0}));
+  connect(dynamicTwoPhaseFlowPipe.C2, massFlowMultiplier2.Ce) annotation (Line(
+        points={{36,-43.5},{47,-43.5},{47,-44},{52,-44}}, color={0,0,0}));
+  connect(massFlowMultiplier2.Cs, sinkP.C)
+    annotation (Line(points={{72,-44},{80,-44}}, color={0,0,0}));
+  connect(Q.y, sourceP.IMassFlow) annotation (Line(points={{-90,-17.2},{-91,
+          -17.2},{-91,-40}}, color={0,0,255}));
+  connect(Angles.y, champThermosolaireLFR_N.SunG) annotation (Line(points={{
+          -11.3,83.5},{27.2,83.5},{27.2,58.8}}, color={0,0,255}));
+  annotation (
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 16.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    experiment(StopTime=5000),
+    Diagram(graphics={Text(
+          extent={{-36,-64},{54,-82}},
+          lineColor={28,108,200},
+          textString="Fresnel field with Nt=%Nt trains")}));
+end TestFresnelField;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestGenericCombustion1D.mo b/ThermoSysPro/Examples/SimpleExamples/TestGenericCombustion1D.mo
index 8c71cfaf044c45fac68a4ce89773fdfb41d231b7..d1c712901d069e74bdf78aa72045ebd7fa00a50c 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestGenericCombustion1D.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestGenericCombustion1D.mo
@@ -1,146 +1,144 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestGenericCombustion1D
-
-  parameter Integer NCEL = 7;
-
-  Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(
-    NCEL=7,
-    Qm(fixed=false),
-    Qsf(fixed=false),
-    kcham(fixed=true) = 0.1,
-    Acham=275,
-    Xbf=0,
-    ImbCV=0.05,
-    EPSPAR=0.7,
-    Kec=8.8,
-    SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56},
-    ImbBF=0.0,
-    Psf(start=113275))
-    annotation (Placement(transformation(extent={{-62,-56},{62,72}}, rotation=0)));
-  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Xn=0.0208,
-    Xashes=0.136,
-    Cp=1200,
-    rho=1100,
-    LHV=29245e3,
-    Xc=0.719,
-    Xh=0.0414,
-    Xo=0.086,
-    Xs=0.0044,
-    Vol=0.286,
-    Q0=57.20,
-    T0=358.15,
-    Hum=0.08)
-    annotation (Placement(transformation(extent={{-106,-43},{-72,-5}}, rotation=
-           0)));
-  FlueGases.BoundaryConditions.SourcePQ sourceAir(
-    Xso2=0,
-    Q0=609.29,
-    Xh2o=0.01,
-    Xo2=0.230,
-    Xco2=0,
-    P0=191000,
-    T0=524.89)
-    annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0)));
-  FlueGases.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{0,70},{44,112}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
-    annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=
-            0)));
-  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe              PipeWaterSteam(
-    Ns=7,
-    z2=56,
-    rugosrel=5e-5,
-    ntubes=403,
-    L=58,
-    D=0.0327,
-    C2(Q(fixed=false, start=486.69), P(
-        fixed=false,
-        start=1.96318e+07,
-        displayUnit="Pa")),
-    dpfCorr=3.5)
-    annotation (Placement(transformation(
-        origin={91,8},
-        extent={{49,16},{-49,-16}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall              paroiEcrans(
-    Ns=7,
-    lambda=40,
-    steady_state=true,
-    ntubes=403,
-    L=58,
-    D=0.0327,
-    e=0.001)
-    annotation (Placement(transformation(
-        origin={73,7.5},
-        extent={{51.5,-15},{-51.5,15}},
-        rotation=270)));
-  WaterSteam.BoundaryConditions.SinkP              sinkWaterSteam2(
-    option_temperature=2,
-    Q(start=486.69, fixed=true),
-    h0=2.5e+06,
-    mode=0,
-    P0(fixed=false) = 19621600)
-    annotation (Placement(transformation(
-        origin={90,90.5},
-        extent={{14.5,-15},{-14.5,15}},
-        rotation=270)));
-  WaterSteam.BoundaryConditions.SourceP              sourceEcrans(
-    h0=1.292e+06,
-    option_temperature=2,
-    mode=0,
-    P0=20112000)
-    annotation (Placement(transformation(
-        origin={91,-81},
-        extent={{15,-15},{-15,15}},
-        rotation=270)));
-equation
-  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel)
-    annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0}));
-  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
-      points={{0,65.6},{0,91},{0.44,91}},
-      color={0,0,0},
-      thickness=1));
-  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
-      points={{0,-49.6},{0,-78}},
-      color={0,0,0},
-      thickness=1));
-  connect(SourcePQ_Water.C, genericCombustionCCS.Cws)
-    annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255}));
-  connect(genericCombustionCCS.Cth,paroiEcrans. WT2) annotation (Line(points={{55.8,8},
-          {68,8},{68,7.5},{76,7.5}},         color={191,95,0}));
-  connect(paroiEcrans.WT1,PipeWaterSteam. CTh) annotation (Line(points={{70,7.5},
-          {71,7.5},{71,8},{86.2,8}}, color={191,95,0}));
-  connect(sourceEcrans.C,PipeWaterSteam. C1)
-    annotation (Line(points={{91,-66},{91,-41}},   color={0,0,255}));
-  connect(PipeWaterSteam.C2,sinkWaterSteam2. C) annotation (Line(points={{91,57},
-          {91,76},{90,76}},       color={0,0,255}));
-  annotation (Diagram(graphics),
-                       Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestGenericCombustion1D;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestGenericCombustion1D
+  parameter Integer NCEL = 7;
+  Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(
+    NCEL=7,
+    Qm(fixed=false),
+    Qsf(fixed=false),
+    kcham(fixed=true) = 0.1,
+    Acham=275,
+    Xbf=0,
+    ImbCV=0.05,
+    EPSPAR=0.7,
+    Kec=8.8,
+    SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56},
+    ImbBF=0.0,
+    Psf(start=113275))
+    annotation (Placement(transformation(extent={{-62,-56},{62,72}}, rotation=0)));
+  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Xn=0.0208,
+    Xashes=0.136,
+    Cp=1200,
+    rho=1100,
+    LHV=29245e3,
+    Xc=0.719,
+    Xh=0.0414,
+    Xo=0.086,
+    Xs=0.0044,
+    Vol=0.286,
+    Q0=57.20,
+    T0=358.15,
+    Hum=0.08)
+    annotation (Placement(transformation(extent={{-106,-43},{-72,-5}}, rotation=
+           0)));
+  FlueGases.BoundaryConditions.SourcePQ sourceAir(
+    Xso2=0,
+    Q0=609.29,
+    Xh2o=0.01,
+    Xo2=0.230,
+    Xco2=0,
+    P0=191000,
+    T0=524.89)
+    annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0)));
+  FlueGases.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{0,70},{44,112}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
+    annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=
+            0)));
+  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe              PipeWaterSteam(
+    Ns=7,
+    z2=56,
+    rugosrel=5e-5,
+    ntubes=403,
+    L=58,
+    D=0.0327,
+    C2(Q(fixed=false, start=486.69), P(
+        fixed=false,
+        start=1.96318e+07,
+        displayUnit="Pa")),
+    dpfCorr=3.5)
+    annotation (Placement(transformation(
+        origin={91,8},
+        extent={{49,16},{-49,-16}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall              paroiEcrans(
+    Ns=7,
+    lambda=40,
+    steady_state=true,
+    ntubes=403,
+    L=58,
+    D=0.0327,
+    e=0.001)
+    annotation (Placement(transformation(
+        origin={73,7.5},
+        extent={{51.5,-15},{-51.5,15}},
+        rotation=270)));
+  WaterSteam.BoundaryConditions.SinkP              sinkWaterSteam2(
+    option_temperature=2,
+    Q(start=486.69, fixed=true),
+    h0=2.5e+06,
+    mode=0,
+    P0(fixed=false) = 19621600)
+    annotation (Placement(transformation(
+        origin={90,90.5},
+        extent={{14.5,-15},{-14.5,15}},
+        rotation=270)));
+  WaterSteam.BoundaryConditions.SourceP              sourceEcrans(
+    h0=1.292e+06,
+    option_temperature=2,
+    mode=0,
+    P0=20112000)
+    annotation (Placement(transformation(
+        origin={91,-81},
+        extent={{15,-15},{-15,15}},
+        rotation=270)));
+equation
+  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel)
+    annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0}));
+  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
+      points={{0,65.6},{0,91},{0.44,91}},
+      color={0,0,0},
+      thickness=1));
+  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
+      points={{0,-49.6},{0,-78}},
+      color={0,0,0},
+      thickness=1));
+  connect(SourcePQ_Water.C, genericCombustionCCS.Cws)
+    annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255}));
+  connect(genericCombustionCCS.Cth,paroiEcrans. WT2) annotation (Line(points={{55.8,8},
+          {68,8},{68,7.5},{76,7.5}},         color={191,95,0}));
+  connect(paroiEcrans.WT1,PipeWaterSteam. CTh) annotation (Line(points={{70,7.5},
+          {71,7.5},{71,8},{86.2,8}}, color={191,95,0}));
+  connect(sourceEcrans.C,PipeWaterSteam. C1)
+    annotation (Line(points={{91,-66},{91,-41}},   color={0,0,255}));
+  connect(PipeWaterSteam.C2,sinkWaterSteam2. C) annotation (Line(points={{91,57},
+          {91,76},{90,76}},       color={0,0,255}));
+  annotation (Diagram(graphics),
+                       Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestGenericCombustion1D;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestHysteresis.mo b/ThermoSysPro/Examples/SimpleExamples/TestHysteresis.mo
new file mode 100644
index 0000000000000000000000000000000000000000..1324115bd2cd2f06d300b315b5440524a4fc9b25
--- /dev/null
+++ b/ThermoSysPro/Examples/SimpleExamples/TestHysteresis.mo
@@ -0,0 +1,36 @@
+within ThermoSysPro.Examples.SimpleExamples;
+model TestHysteresis
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Trapezoide trapezoide(
+    amplitude=2,
+    rising=0.2,
+    largeur=0.2,
+    falling=0.2,
+    n=1,
+    offset=-0.5)
+    annotation (Placement(transformation(extent={{-64,-10},{-44,10}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire.Hysteresis hysteresis
+    annotation (Placement(transformation(extent={{20,-10},{40,10}})));
+equation
+  connect(trapezoide.y, hysteresis.u)
+    annotation (Line(points={{-43,0},{19,0}}, color={0,0,255}));
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100,-100},{100,100}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100,-100},{100,100}},
+          radius=25.0),
+        Polygon(
+          origin={8,14},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+                                                                 Diagram(coordinateSystem(
+          preserveAspectRatio=false)));
+end TestHysteresis;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestIdealCheckValve.mo b/ThermoSysPro/Examples/SimpleExamples/TestIdealCheckValve.mo
index 5b0b7ac37fed81a78d560c11af37fd11fded9359..f92123683d6c8069c6878ea5f4c194fc286b3572 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestIdealCheckValve.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestIdealCheckValve.mo
@@ -1,111 +1,110 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestIdealCheckValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-                                    annotation (Placement(transformation(extent=
-           {{-104,20},{-84,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(
-                                  P0=6e5) annotation (Placement(transformation(
-          extent={{84,20},{104,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1
-    annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump2
-    annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD annotation (Placement(
-        transformation(extent={{-50,20},{-30,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve1
-    annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve2
-    annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC annotation (Placement(
-        transformation(extent={{30,20},{50,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP
-                                        annotation (Placement(transformation(
-          extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1
-                                         annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-60,-80},{-40,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{80,-80},{100,-60}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    amplitude=6e5,
-    width=50,
-    period=100,
-    offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80,
-            -60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve3
-    annotation (Placement(transformation(extent={{10,-80},{30,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP2
-                                        annotation (Placement(transformation(
-          extent={{-30,-80},{-10,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP3
-                                        annotation (Placement(transformation(
-          extent={{50,-80},{70,-60}}, rotation=0)));
-equation
-  connect(volumeD.Cs1, staticCentrifugalPump1.C1) annotation (Line(points={{-40,
-          40},{-40,70},{-30,70}}, color={0,0,255}));
-  connect(volumeD.Cs2, staticCentrifugalPump2.C1) annotation (Line(points={{-40,
-          20.2},{-40,-10},{-30,-10}}, color={0,0,255}));
-  connect(staticCentrifugalPump1.C2, idealCheckValve1.C1) annotation (Line(
-        points={{-10,70},{-2,70},{-2,70},{10,70}}, color={0,0,255}));
-  connect(idealCheckValve1.C2, volumeC.Ce2) annotation (Line(points={{30,70},{
-          40,70},{40,39}}, color={0,0,255}));
-  connect(idealCheckValve2.C2, volumeC.Ce3) annotation (Line(points={{28,-10},{
-          40,-10},{40,20}}, color={0,0,255}));
-  connect(staticCentrifugalPump2.C2, idealCheckValve2.C1) annotation (Line(
-        points={{-10,-10},{0,-10},{0,-10},{8,-10}}, color={0,0,255}));
-  connect(perteDP.C2, volumeD.Ce)
-    annotation (Line(points={{-60,30},{-50,30}}, color={0,0,255}));
-  connect(volumeC.Cs, perteDP1.C1)
-    annotation (Line(points={{50,30},{60,30}}, color={0,0,255}));
-  connect(perteDP1.C2, puitsP.C)
-    annotation (Line(points={{80,30},{84,30}}, color={0,0,255}));
-  connect(sourceP.C, perteDP.C1)
-    annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255}));
-  connect(sourceP1.C, perteDP2.C1)
-    annotation (Line(points={{-40,-70},{-30,-70}}, color={0,0,255}));
-  connect(perteDP2.C2, idealCheckValve3.C1)
-    annotation (Line(points={{-10,-70},{10,-70}}, color={0,0,255}));
-  connect(idealCheckValve3.C2, perteDP3.C1)
-    annotation (Line(points={{30,-70},{50,-70}}, color={0,0,255}));
-  connect(perteDP3.C2, puitsP1.C)
-    annotation (Line(points={{70,-70},{80,-70}}, color={0,0,255}));
-  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55,
-          -70}}));
-  annotation (experiment(StopTime=1000),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestIdealCheckValve;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestIdealCheckValve
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+                                    annotation (Placement(transformation(extent=
+           {{-104,20},{-84,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(
+                                  P0=6e5) annotation (Placement(transformation(
+          extent={{84,20},{104,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1
+    annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump2
+    annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD annotation (Placement(
+        transformation(extent={{-50,20},{-30,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve1
+    annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve2
+    annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC annotation (Placement(
+        transformation(extent={{30,20},{50,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP
+                                        annotation (Placement(transformation(
+          extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1
+                                         annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-60,-80},{-40,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{80,-80},{100,-60}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    amplitude=6e5,
+    width=50,
+    period=100,
+    offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80,
+            -60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve3
+    annotation (Placement(transformation(extent={{10,-80},{30,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP2
+                                        annotation (Placement(transformation(
+          extent={{-30,-80},{-10,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP3
+                                        annotation (Placement(transformation(
+          extent={{50,-80},{70,-60}}, rotation=0)));
+equation
+  connect(volumeD.Cs1, staticCentrifugalPump1.C1) annotation (Line(points={{-40,
+          40},{-40,70},{-30,70}}, color={0,0,255}));
+  connect(volumeD.Cs2, staticCentrifugalPump2.C1) annotation (Line(points={{-40,
+          20.2},{-40,-10},{-30,-10}}, color={0,0,255}));
+  connect(staticCentrifugalPump1.C2, idealCheckValve1.C1) annotation (Line(
+        points={{-10,70},{-2,70},{-2,70},{10,70}}, color={0,0,255}));
+  connect(idealCheckValve1.C2, volumeC.Ce2) annotation (Line(points={{30,70},{
+          40,70},{40,39}}, color={0,0,255}));
+  connect(idealCheckValve2.C2, volumeC.Ce3) annotation (Line(points={{28,-10},{
+          40,-10},{40,20}}, color={0,0,255}));
+  connect(staticCentrifugalPump2.C2, idealCheckValve2.C1) annotation (Line(
+        points={{-10,-10},{0,-10},{0,-10},{8,-10}}, color={0,0,255}));
+  connect(perteDP.C2, volumeD.Ce)
+    annotation (Line(points={{-60,30},{-50,30}}, color={0,0,255}));
+  connect(volumeC.Cs, perteDP1.C1)
+    annotation (Line(points={{50,30},{60,30}}, color={0,0,255}));
+  connect(perteDP1.C2, puitsP.C)
+    annotation (Line(points={{80,30},{84,30}}, color={0,0,255}));
+  connect(sourceP.C, perteDP.C1)
+    annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255}));
+  connect(sourceP1.C, perteDP2.C1)
+    annotation (Line(points={{-40,-70},{-30,-70}}, color={0,0,255}));
+  connect(perteDP2.C2, idealCheckValve3.C1)
+    annotation (Line(points={{-10,-70},{10,-70}}, color={0,0,255}));
+  connect(idealCheckValve3.C2, perteDP3.C1)
+    annotation (Line(points={{30,-70},{50,-70}}, color={0,0,255}));
+  connect(perteDP3.C2, puitsP1.C)
+    annotation (Line(points={{70,-70},{80,-70}}, color={0,0,255}));
+  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55,
+          -70}}));
+  annotation (experiment(StopTime=1000),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestIdealCheckValve;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestIdealSwitchValve.mo b/ThermoSysPro/Examples/SimpleExamples/TestIdealSwitchValve.mo
index ca1fea1957355a5f34c3b37a72c0e808c658a5f7..b3833a6d038900c8815fe217e6969c6c53263720 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestIdealSwitchValve.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestIdealSwitchValve.mo
@@ -1,65 +1,64 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestIdealSwitchValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealSwitchValve SwitchValve
-                                          annotation (Placement(transformation(
-          extent={{-20,26},{0,46}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
-                                         width=10, period=20)
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP2
-                                        annotation (Placement(transformation(
-          extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1
-                                        annotation (Placement(transformation(
-          extent={{20,20},{40,40}}, rotation=0)));
-equation
-  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-39,70},{-10,70},
-          {-10,43}}));
-  connect(SourceP1.C, perteDP2.C1) annotation (Line(points={{-80,30},{-60,30}},
-        color={0,0,255}));
-  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-40,30},{-30,
-          30},{-30,29.8},{-20,29.8}}, color={0,0,255}));
-  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{0,30},{20,30}},
-        color={0,0,255}));
-  connect(perteDP1.C2, PuitsP1.C) annotation (Line(points={{40,30},{60,30}},
-        color={0,0,255}));
-  annotation (experiment(StopTime=100),
-   Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestIdealSwitchValve;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestIdealSwitchValve
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealSwitchValve SwitchValve
+                                          annotation (Placement(transformation(
+          extent={{-20,26},{0,46}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
+                                         width=10, period=20)
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP2
+                                        annotation (Placement(transformation(
+          extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1
+                                        annotation (Placement(transformation(
+          extent={{20,20},{40,40}}, rotation=0)));
+equation
+  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-39,70},{-10,70},
+          {-10,43}}));
+  connect(SourceP1.C, perteDP2.C1) annotation (Line(points={{-80,30},{-60,30}},
+        color={0,0,255}));
+  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-40,30},{-30,
+          30},{-30,29.8},{-20,29.8}}, color={0,0,255}));
+  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{0,30},{20,30}},
+        color={0,0,255}));
+  connect(perteDP1.C2, PuitsP1.C) annotation (Line(points={{40,30},{60,30}},
+        color={0,0,255}));
+  annotation (experiment(StopTime=100),
+   Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestIdealSwitchValve;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestInvSingularPressureLoss.mo b/ThermoSysPro/Examples/SimpleExamples/TestInvSingularPressureLoss.mo
index a9e93d4241fb1a958a7e493b7b657b2b58e69bb8..6cf89bfc6078f5d6a7e7b2a2b5dadee338d9a903 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestInvSingularPressureLoss.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestInvSingularPressureLoss.mo
@@ -1,38 +1,37 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestInvSingularPressureLoss
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ
-    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkQ
-    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.InvSingularPressureLoss
-    invSingularPressureLoss annotation (Placement(transformation(extent={{-20,0},
-            {0,20}}, rotation=0)));
-equation
-  connect(sourcePQ.C, invSingularPressureLoss.C1) annotation (Line(points={{-60,
-          10},{-20,10}}, color={0,0,255}));
-  connect(invSingularPressureLoss.C2, sinkQ.C) annotation (Line(points={{0,10},
-          {40,10}}, color={0,0,255}));
-annotation(experiment(StopTime=1000), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestInvSingularPressureLoss;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestInvSingularPressureLoss
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ
+    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkQ
+    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.InvSingularPressureLoss
+    invSingularPressureLoss annotation (Placement(transformation(extent={{-20,0},
+            {0,20}}, rotation=0)));
+equation
+  connect(sourcePQ.C, invSingularPressureLoss.C1) annotation (Line(points={{-60,
+          10},{-20,10}}, color={0,0,255}));
+  connect(invSingularPressureLoss.C2, sinkQ.C) annotation (Line(points={{0,10},
+          {40,10}}, color={0,0,255}));
+annotation(experiment(StopTime=1000), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestInvSingularPressureLoss;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestJunctions1.mo b/ThermoSysPro/Examples/SimpleExamples/TestJunctions1.mo
index dc157c851594d7f1048c5d57f7eb226542ca79e7..56a605c03be3d39d9275443d5792d52068af1b65 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestJunctions1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestJunctions1.mo
@@ -1,115 +1,114 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestJunctions1
-
-  ThermoSysPro.WaterSteam.Junctions.Splitter2 splitter2
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceP(Q0=200)
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss annotation (Placement(transformation(extent={{-60,40},
-            {-40,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{40,80},
-            {60,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{40,0},{
-            60,20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=
-        0.5) annotation (Placement(transformation(extent={{-40,60},{-20,80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.Splitter3 splitter3
-    annotation (Placement(transformation(extent={{-20,-60},{0,-40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceP1(Q0=400)
-    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3 annotation (Placement(transformation(extent={{-60,-60},
-            {-40,-40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP2
-    annotation (Placement(transformation(extent={{80,-20},{100,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP3
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4 annotation (Placement(transformation(extent={{40,-20},
-            {60,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5 annotation (Placement(transformation(extent={{40,-100},
-            {60,-80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0)
-           annotation (Placement(transformation(extent={{-40,-40},{-20,-20}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP4
-    annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0)
-           annotation (Placement(transformation(extent={{-40,-80},{-20,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss6 annotation (Placement(transformation(extent={{40,-60},
-            {60,-40}},
-                     rotation=0)));
-equation
-  connect(sourceP.C, singularPressureLoss.C1)
-    annotation (Line(points={{-80,50},{-60,50}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, splitter2.Ce)
-    annotation (Line(points={{-40,50},{-20,50}}, color={0,0,255}));
-  connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,
-          60},{-6,90},{40,90}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sinkP.C)
-    annotation (Line(points={{60,90},{80,90}}, color={0,0,255}));
-  connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,
-          40},{-6,10},{40,10}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, sinkP1.C)
-    annotation (Line(points={{60,10},{80,10}}, color={0,0,255}));
-  connect(constante.y, splitter2.Ialpha1)
-    annotation (Line(points={{-19,70},{-14,70},{-14,56},{-9,56}}));
-  connect(sourceP1.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-80,-50},{-60,-50}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-40,
-          -50},{-19.8,-50}}, color={0,0,255}));
-  connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-6,
-          -40},{-6,-10},{40,-10}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, sinkP2.C)
-    annotation (Line(points={{60,-10},{80,-10}}, color={0,0,255}));
-  connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-6,
-          -60},{-6,-90},{40,-90}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, sinkP3.C)
-    annotation (Line(points={{60,-90},{80,-90}}, color={0,0,255}));
-  connect(constante1.y, splitter3.Ialpha1)
-    annotation (Line(points={{-19,-30},{-14,-30},{-14,-44},{-9,-44}}));
-  connect(splitter3.Ialpha2, constante2.y)
-    annotation (Line(points={{-9,-56},{-14,-56},{-14,-70},{-19,-70}}));
-  connect(splitter3.Cs3, singularPressureLoss6.C1)
-    annotation (Line(points={{0,-50},{40,-50}}, color={0,0,255}));
-  connect(singularPressureLoss6.C2, sinkP4.C)
-    annotation (Line(points={{60,-50},{80,-50}}, color={0,0,255}));
-  annotation (experiment(StopTime=10),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestJunctions1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestJunctions1
+  ThermoSysPro.WaterSteam.Junctions.Splitter2 splitter2
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceP(Q0=200)
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss annotation (Placement(transformation(extent={{-60,40},
+            {-40,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{40,80},
+            {60,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{40,0},{
+            60,20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=
+        0.5) annotation (Placement(transformation(extent={{-40,60},{-20,80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.Splitter3 splitter3
+    annotation (Placement(transformation(extent={{-20,-60},{0,-40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceP1(Q0=400)
+    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3 annotation (Placement(transformation(extent={{-60,-60},
+            {-40,-40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP2
+    annotation (Placement(transformation(extent={{80,-20},{100,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP3
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4 annotation (Placement(transformation(extent={{40,-20},
+            {60,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5 annotation (Placement(transformation(extent={{40,-100},
+            {60,-80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0)
+           annotation (Placement(transformation(extent={{-40,-40},{-20,-20}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP4
+    annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0)
+           annotation (Placement(transformation(extent={{-40,-80},{-20,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss6 annotation (Placement(transformation(extent={{40,-60},
+            {60,-40}},
+                     rotation=0)));
+equation
+  connect(sourceP.C, singularPressureLoss.C1)
+    annotation (Line(points={{-80,50},{-60,50}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, splitter2.Ce)
+    annotation (Line(points={{-40,50},{-20,50}}, color={0,0,255}));
+  connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,
+          60},{-6,90},{40,90}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sinkP.C)
+    annotation (Line(points={{60,90},{80,90}}, color={0,0,255}));
+  connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,
+          40},{-6,10},{40,10}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, sinkP1.C)
+    annotation (Line(points={{60,10},{80,10}}, color={0,0,255}));
+  connect(constante.y, splitter2.Ialpha1)
+    annotation (Line(points={{-19,70},{-14,70},{-14,56},{-9,56}}));
+  connect(sourceP1.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-80,-50},{-60,-50}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-40,
+          -50},{-19.8,-50}}, color={0,0,255}));
+  connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-6,
+          -40},{-6,-10},{40,-10}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, sinkP2.C)
+    annotation (Line(points={{60,-10},{80,-10}}, color={0,0,255}));
+  connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-6,
+          -60},{-6,-90},{40,-90}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, sinkP3.C)
+    annotation (Line(points={{60,-90},{80,-90}}, color={0,0,255}));
+  connect(constante1.y, splitter3.Ialpha1)
+    annotation (Line(points={{-19,-30},{-14,-30},{-14,-44},{-9,-44}}));
+  connect(splitter3.Ialpha2, constante2.y)
+    annotation (Line(points={{-9,-56},{-14,-56},{-14,-70},{-19,-70}}));
+  connect(splitter3.Cs3, singularPressureLoss6.C1)
+    annotation (Line(points={{0,-50},{40,-50}}, color={0,0,255}));
+  connect(singularPressureLoss6.C2, sinkP4.C)
+    annotation (Line(points={{60,-50},{80,-50}}, color={0,0,255}));
+  annotation (experiment(StopTime=10),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestJunctions1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestJunctions2.mo b/ThermoSysPro/Examples/SimpleExamples/TestJunctions2.mo
index 1bd67e2c2cb46e40a760a0806d198c94158bfb31..311e4737062a6cf49840a36cfdd311e381933c92 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestJunctions2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestJunctions2.mo
@@ -1,131 +1,130 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestJunctions2
-
-  ThermoSysPro.WaterSteam.Junctions.Mixer2 mixer2_1
-    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss annotation (Placement(transformation(extent={{40,60},{
-            60,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{-40,80},
-            {-20,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-40,40},
-            {-20,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Source sourceP
-    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
-    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP
-    annotation (Placement(transformation(extent={{80,60},{100,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0)
-             annotation (Placement(transformation(extent={{-40,60},{-20,80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.Mixer3 mixer2_2
-    annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3 annotation (Placement(transformation(extent={{40,-60},
-            {60,-40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4 annotation (Placement(transformation(extent={{-40,-40},
-            {-20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5 annotation (Placement(transformation(extent={{-40,-80},
-            {-20,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Source sourceP2
-    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
-    annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP1
-    annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
-        0.5) annotation (Placement(transformation(extent={{-40,-20},{-20,0}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ
-    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss6 annotation (Placement(transformation(extent={{-40,-60},
-            {-20,-40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=
-       2) annotation (Placement(transformation(extent={{0,20},{20,40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ1
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss7 annotation (Placement(transformation(extent={{-40,20},
-            {-20,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss8 annotation (Placement(transformation(extent={{40,20},
-            {60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP2
-    annotation (Placement(transformation(extent={{80,20},{100,40}}, rotation=0)));
-equation
-  connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-20,
-          90},{6,90},{6,80}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-20,
-          50},{6,50},{6,60}}, color={0,0,255}));
-  connect(mixer2_1.Cs, singularPressureLoss.C1)
-    annotation (Line(points={{20,70},{40,70}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-60,90},{-40,90}}, color={0,0,255}));
-  connect(sourceP1.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-60,50},{-40,50}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, sinkP.C)
-    annotation (Line(points={{60,70},{80,70}}, color={0,0,255}));
-  connect(constante.y, mixer2_1.Ialpha1)
-    annotation (Line(points={{-19,70},{-8,70},{-8,76},{3,76}}));
-  connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-20,
-          -30},{6,-30},{6,-40}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation (Line(points={{-20,
-          -70},{6,-70},{6,-60}}, color={0,0,255}));
-  connect(mixer2_2.Cs, singularPressureLoss3.C1)
-    annotation (Line(points={{20,-50},{40,-50}}, color={0,0,255}));
-  connect(sourceP2.C, singularPressureLoss4.C1)
-    annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255}));
-  connect(sourceP3.C, singularPressureLoss5.C1)
-    annotation (Line(points={{-60,-70},{-40,-70}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, sinkP1.C)
-    annotation (Line(points={{60,-50},{80,-50}}, color={0,0,255}));
-  connect(sourceQ.C, singularPressureLoss6.C1)
-    annotation (Line(points={{-60,-50},{-40,-50}}, color={0,0,255}));
-  connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation (Line(points={{-20,-50},
-          {-10,-50},{0,-50}},                color={0,0,255}));
-  connect(constante1.y, mixer2_2.Ialpha1)
-    annotation (Line(points={{-19,-10},{-8,-10},{-8,-44},{3,-44}}));
-  connect(sourceQ1.C, singularPressureLoss7.C1)
-    annotation (Line(points={{-60,30},{-40,30}}, color={0,0,255}));
-  connect(singularPressureLoss7.C2, massFlowMultiplier.Ce)
-    annotation (Line(points={{-20,30},{0,30}}, color={0,0,255}));
-  connect(massFlowMultiplier.Cs, singularPressureLoss8.C1)
-    annotation (Line(points={{20,30},{40,30}}, color={0,0,255}));
-  connect(singularPressureLoss8.C2, sinkP2.C)
-    annotation (Line(points={{60,30},{80,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestJunctions2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestJunctions2
+  ThermoSysPro.WaterSteam.Junctions.Mixer2 mixer2_1
+    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss annotation (Placement(transformation(extent={{40,60},{
+            60,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{-40,80},
+            {-20,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-40,40},
+            {-20,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Source sourceP
+    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
+    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP
+    annotation (Placement(transformation(extent={{80,60},{100,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0)
+             annotation (Placement(transformation(extent={{-40,60},{-20,80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.Mixer3 mixer2_2
+    annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3 annotation (Placement(transformation(extent={{40,-60},
+            {60,-40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4 annotation (Placement(transformation(extent={{-40,-40},
+            {-20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5 annotation (Placement(transformation(extent={{-40,-80},
+            {-20,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Source sourceP2
+    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
+    annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP1
+    annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
+        0.5) annotation (Placement(transformation(extent={{-40,-20},{-20,0}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ
+    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss6 annotation (Placement(transformation(extent={{-40,-60},
+            {-20,-40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=
+       2) annotation (Placement(transformation(extent={{0,20},{20,40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ1
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss7 annotation (Placement(transformation(extent={{-40,20},
+            {-20,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss8 annotation (Placement(transformation(extent={{40,20},
+            {60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP2
+    annotation (Placement(transformation(extent={{80,20},{100,40}}, rotation=0)));
+equation
+  connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-20,
+          90},{6,90},{6,80}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-20,
+          50},{6,50},{6,60}}, color={0,0,255}));
+  connect(mixer2_1.Cs, singularPressureLoss.C1)
+    annotation (Line(points={{20,70},{40,70}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-60,90},{-40,90}}, color={0,0,255}));
+  connect(sourceP1.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-60,50},{-40,50}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, sinkP.C)
+    annotation (Line(points={{60,70},{80,70}}, color={0,0,255}));
+  connect(constante.y, mixer2_1.Ialpha1)
+    annotation (Line(points={{-19,70},{-8,70},{-8,76},{3,76}}));
+  connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-20,
+          -30},{6,-30},{6,-40}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation (Line(points={{-20,
+          -70},{6,-70},{6,-60}}, color={0,0,255}));
+  connect(mixer2_2.Cs, singularPressureLoss3.C1)
+    annotation (Line(points={{20,-50},{40,-50}}, color={0,0,255}));
+  connect(sourceP2.C, singularPressureLoss4.C1)
+    annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255}));
+  connect(sourceP3.C, singularPressureLoss5.C1)
+    annotation (Line(points={{-60,-70},{-40,-70}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, sinkP1.C)
+    annotation (Line(points={{60,-50},{80,-50}}, color={0,0,255}));
+  connect(sourceQ.C, singularPressureLoss6.C1)
+    annotation (Line(points={{-60,-50},{-40,-50}}, color={0,0,255}));
+  connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation (Line(points={{-20,-50},
+          {-10,-50},{0,-50}},                color={0,0,255}));
+  connect(constante1.y, mixer2_2.Ialpha1)
+    annotation (Line(points={{-19,-10},{-8,-10},{-8,-44},{3,-44}}));
+  connect(sourceQ1.C, singularPressureLoss7.C1)
+    annotation (Line(points={{-60,30},{-40,30}}, color={0,0,255}));
+  connect(singularPressureLoss7.C2, massFlowMultiplier.Ce)
+    annotation (Line(points={{-20,30},{0,30}}, color={0,0,255}));
+  connect(massFlowMultiplier.Cs, singularPressureLoss8.C1)
+    annotation (Line(points={{20,30},{40,30}}, color={0,0,255}));
+  connect(singularPressureLoss8.C2, sinkP2.C)
+    annotation (Line(points={{60,30},{80,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestJunctions2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestJunctions3.mo b/ThermoSysPro/Examples/SimpleExamples/TestJunctions3.mo
index ef8e61c3a4ce30b77fd892e90d7bf6ee56bc3ffc..bc8e44adf55d0e5c92afead5b66ece27c2887c3c 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestJunctions3.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestJunctions3.mo
@@ -1,105 +1,104 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestJunctions3
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-                                           annotation (Placement(transformation(
-          extent={{-104,0},{-84,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(                 P0=2e5, Q(start=
-          323.48244470861454))
-    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve1(
-    C1(h_vol(start=71016.12237181116)),
-    C2(h_vol(start=70977.89042837733)),
-    Pm(start=120690.8728732298))
-    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve2(C1(h_vol(start=
-            70921.01678153824)), Pm(start=118970.64778985853))
-    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve3(Q(start=
-          804.6933031325926), Pm(start=108776.21727782265))
-    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
-                                          annotation (Placement(transformation(
-          extent={{82,-30},{102,-10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=1,
-    Initialvalue=1,
-    Finalvalue=0.05)
-                  annotation (Placement(transformation(extent={{32,20},{52,40}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
-                                    Initialvalue=1,
-    Starttime=2,
-    Finalvalue=0.001)
-    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(
-                                    Initialvalue=1,
-    Starttime=1,
-    Finalvalue=0.001)
-    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe1
-    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe2
-    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Junctions.Mixer8 staticVolume
-    annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.Mixer8 staticVolume1
-    annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.Mixer8 staticVolume2
-    annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation=
-           0)));
-equation
-  connect(valve3.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
-          -20}}, color={0,0,255}));
-  connect(rampe2.y, valve3.Ouv)
-    annotation (Line(points={{53,30},{60,30},{60,-3}}));
-  connect(rampe3.y, valve1.Ouv)         annotation (Line(points={{-9,40},{0,40},
-          {0,27}}));
-  connect(rampe4.y, valve2.Ouv)         annotation (Line(points={{-9,-20},{0,
-          -20},{0,-33}}));
-  connect(sourceP.C, pipe1.C1)
-    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
-  connect(sourceP1.C, pipe2.C1)
-    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
-  connect(pipe1.C2, staticVolume.Ce4) annotation (Line(points={{-60,10},{-50,10},
-          {-50,14},{-40.2,14}}, color={0,0,255}));
-  connect(staticVolume.Cs, valve1.C1) annotation (Line(points={{-20,10},{-10,10}},
-        color={0,0,255}));
-  connect(staticVolume1.Cs, valve3.C1) annotation (Line(points={{40,-20},{50,
-          -20}}, color={0,0,255}));
-  connect(valve1.C2, staticVolume1.Ce1) annotation (Line(points={{10,10},{33,10},
-          {33,-9.8}}, color={0,0,255}));
-  connect(valve2.C2, staticVolume1.Ce8) annotation (Line(points={{10,-50},{33,
-          -50},{33,-29.9}}, color={0,0,255}));
-  connect(pipe2.C2, staticVolume2.Ce4) annotation (Line(points={{-60,-50},{-50,
-          -50},{-50,-46},{-40.2,-46}}, color={0,0,255}));
-  connect(staticVolume2.Cs, valve2.C1) annotation (Line(points={{-20,-50},{-10,
-          -50}}, color={0,0,255}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestJunctions3;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestJunctions3
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+                                           annotation (Placement(transformation(
+          extent={{-104,0},{-84,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(                 P0=2e5, Q(start=
+          323.48244470861454))
+    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve1(
+    C1(h_vol(start=71016.12237181116)),
+    C2(h_vol(start=70977.89042837733)),
+    Pm(start=120690.8728732298))
+    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve2(C1(h_vol(start=
+            70921.01678153824)), Pm(start=118970.64778985853))
+    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve3(Q(start=
+          804.6933031325926), Pm(start=108776.21727782265))
+    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
+                                          annotation (Placement(transformation(
+          extent={{82,-30},{102,-10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=1,
+    Initialvalue=1,
+    Finalvalue=0.05)
+                  annotation (Placement(transformation(extent={{32,20},{52,40}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
+                                    Initialvalue=1,
+    Starttime=2,
+    Finalvalue=0.001)
+    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(
+                                    Initialvalue=1,
+    Starttime=1,
+    Finalvalue=0.001)
+    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe1
+    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe2
+    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Junctions.Mixer8 staticVolume
+    annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.Mixer8 staticVolume1
+    annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.Mixer8 staticVolume2
+    annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation=
+           0)));
+equation
+  connect(valve3.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
+          -20}}, color={0,0,255}));
+  connect(rampe2.y, valve3.Ouv)
+    annotation (Line(points={{53,30},{60,30},{60,-3}}));
+  connect(rampe3.y, valve1.Ouv)         annotation (Line(points={{-9,40},{0,40},
+          {0,27}}));
+  connect(rampe4.y, valve2.Ouv)         annotation (Line(points={{-9,-20},{0,
+          -20},{0,-33}}));
+  connect(sourceP.C, pipe1.C1)
+    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
+  connect(sourceP1.C, pipe2.C1)
+    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
+  connect(pipe1.C2, staticVolume.Ce4) annotation (Line(points={{-60,10},{-50,10},
+          {-50,14},{-40.2,14}}, color={0,0,255}));
+  connect(staticVolume.Cs, valve1.C1) annotation (Line(points={{-20,10},{-10,10}},
+        color={0,0,255}));
+  connect(staticVolume1.Cs, valve3.C1) annotation (Line(points={{40,-20},{50,
+          -20}}, color={0,0,255}));
+  connect(valve1.C2, staticVolume1.Ce1) annotation (Line(points={{10,10},{33,10},
+          {33,-9.8}}, color={0,0,255}));
+  connect(valve2.C2, staticVolume1.Ce8) annotation (Line(points={{10,-50},{33,
+          -50},{33,-29.9}}, color={0,0,255}));
+  connect(pipe2.C2, staticVolume2.Ce4) annotation (Line(points={{-60,-50},{-50,
+          -50},{-50,-46},{-40.2,-46}}, color={0,0,255}));
+  connect(staticVolume2.Cs, valve2.C1) annotation (Line(points={{-20,-50},{-10,
+          -50}}, color={0,0,255}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestJunctions3;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestJunctions4.mo b/ThermoSysPro/Examples/SimpleExamples/TestJunctions4.mo
index daa1a26df70ea3a660e0da3167640cc55930cfff..3d2c4a843fc6136da6602cfd05fafc26ec657294 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestJunctions4.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestJunctions4.mo
@@ -1,59 +1,58 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestJunctions4
-
-  ThermoSysPro.WaterSteam.Junctions.DeheaterMixer2 deheaterMixer2_1(Tmax=308)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss annotation (Placement(transformation(extent={{-60,20},
-            {-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
-            {40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,-20},
-            {-40,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(T0=310)
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Source source(h0=30000)
-    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
-            0)));
-equation
-  connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points=
-         {{-40,30},{-30,30},{-30,36},{-20,36}}, color={0,0,255}));
-  connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(
-        points={{0,36},{10,36},{10,30},{20,30}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(
-        points={{-40,-10},{-9.9,-10},{-9.9,20}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss.C1)
-    annotation (Line(points={{-80,30},{-60,30}}, color={0,0,255}));
-  connect(source.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-80,-10},{-60,-10}}, color={0,0,255}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestJunctions4;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestJunctions4
+  ThermoSysPro.WaterSteam.Junctions.DeheaterMixer2 deheaterMixer2_1(Tmax=308)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss annotation (Placement(transformation(extent={{-60,20},
+            {-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
+            {40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,-20},
+            {-40,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(T0=310)
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Source source(h0=30000)
+    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
+            0)));
+equation
+  connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points=
+         {{-40,30},{-30,30},{-30,36},{-20,36}}, color={0,0,255}));
+  connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(
+        points={{0,36},{10,36},{10,30},{20,30}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(
+        points={{-40,-10},{-9.9,-10},{-9.9,20}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss.C1)
+    annotation (Line(points={{-80,30},{-60,30}}, color={0,0,255}));
+  connect(source.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-80,-10},{-60,-10}}, color={0,0,255}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestJunctions4;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestJunctions5.mo b/ThermoSysPro/Examples/SimpleExamples/TestJunctions5.mo
index 5b38fb76185daf9c8d73207b540dceca2d73508f..c84eb1e32a12215203c946fe11901cfc3cadfef4 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestJunctions5.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestJunctions5.mo
@@ -1,132 +1,131 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestJunctions5
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-                                           annotation (Placement(transformation(
-          extent={{-104,0},{-84,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-                                            P0=2e5)
-    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve1(C1(h_vol(start=
-            71016.12237181116)), Q(start=1358.2069351216692))
-    annotation (Placement(transformation(extent={{-10,66},{10,86}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
-                                         annotation (Placement(transformation(
-          extent={{20,60},{40,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve4(
-    C1(h_vol(start=70921.0263406355)),
-    Pm(start=150000.0),
-    Q(start=960.3769597153787))
-    annotation (Placement(transformation(extent={{-10,-94},{10,-74}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1
-                                          annotation (Placement(transformation(
-          extent={{20,-100},{40,-80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-      Initialvalue=0.5)            annotation (Placement(transformation(extent=
-            {{-30,80},{-10,100}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
-      Initialvalue=0.5)             annotation (Placement(transformation(extent=
-           {{-30,-80},{-10,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve2(Pm(start=
-          250000.00130815947), Q(start=1920.8429304679091))
-    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve3(Pm(start=
-          200000.00130815947), Q(start=-0.0965278352866084))
-    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB volumeB1(dynamic_mass_balance=true, h(start=
-          71016.12237180525))
-    annotation (Placement(transformation(
-        origin={30,-20},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve5
-    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
-                                          annotation (Placement(transformation(
-          extent={{82,-30},{102,-10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=1,
-    Initialvalue=1,
-    Finalvalue=0) annotation (Placement(transformation(extent={{32,20},{52,40}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(Initialvalue=1, Finalvalue=0)
-    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(Initialvalue=1, Finalvalue=0)
-    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe1(lambda=0)
-    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe2(lambda=0)
-    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Junctions.Splitter2 splitter2_1
-    annotation (Placement(transformation(extent={{-50,0},{-30,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.Splitter2 splitter2_2
-    annotation (Placement(transformation(extent={{-50,-60},{-30,-40}}, rotation=
-           0)));
-equation
-  connect(valve4.C2, puitsP1.C)         annotation (Line(points={{10,-90},{20,
-          -90}}, color={0,0,255}));
-  connect(rampe.y, valve1.Ouv)        annotation (Line(points={{-9,90},{0,90},{
-          0,87}}));
-  connect(rampe1.y, valve4.Ouv)
-    annotation (Line(points={{-9,-70},{0,-70},{0,-73}}));
-  connect(valve5.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
-          -20}}, color={0,0,255}));
-  connect(rampe2.y, valve5.Ouv)
-    annotation (Line(points={{53,30},{60,30},{60,-3}}));
-  connect(rampe3.y, valve2.Ouv)         annotation (Line(points={{-9,40},{0,40},
-          {0,27}}));
-  connect(rampe4.y, valve3.Ouv)         annotation (Line(points={{-9,-20},{0,
-          -20},{0,-33}}));
-  connect(sourceP.C, pipe1.C1)
-    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
-  connect(sourceP1.C, pipe2.C1)
-    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
-  connect(valve2.C2, volumeB1.Ce2)         annotation (Line(points={{10,10},{30,
-          10},{30,-10}}, color={0,0,255}));
-  connect(valve3.C2, volumeB1.Ce1)         annotation (Line(points={{10,-50},{
-          30,-50},{30,-30}}, color={0,0,255}));
-  connect(volumeB1.Cs2, valve5.C1)
-    annotation (Line(points={{39.8,-20},{50,-20}}, color={0,0,255}));
-  connect(valve1.C2, puitsP.C)        annotation (Line(points={{10,70},{20,70}},
-        color={0,0,255}));
-  connect(pipe1.C2, splitter2_1.Ce)
-    annotation (Line(points={{-60,10},{-50,10}}, color={0,0,255}));
-  connect(splitter2_1.Cs1, valve1.C1) annotation (Line(points={{-36,20},{-36,70},
-          {-10,70}}, color={0,0,255}));
-  connect(splitter2_1.Cs2, valve2.C1) annotation (Line(points={{-36,0},{-36,-4},
-          {-20,-4},{-20,10},{-10,10}}, color={0,0,255}));
-  connect(pipe2.C2, splitter2_2.Ce)
-    annotation (Line(points={{-60,-50},{-50,-50}}, color={0,0,255}));
-  connect(splitter2_2.Cs1, valve3.C1) annotation (Line(points={{-36,-40},{-36,
-          -36},{-20,-36},{-20,-50},{-10,-50}}, color={0,0,255}));
-  connect(splitter2_2.Cs2, valve4.C1) annotation (Line(points={{-36,-60},{-36,
-          -90},{-10,-90}}, color={0,0,255}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestJunctions5;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestJunctions5
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+                                           annotation (Placement(transformation(
+          extent={{-104,0},{-84,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+                                            P0=2e5)
+    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve1(C1(h_vol(start=
+            71016.12237181116)), Q(start=1358.2069351216692))
+    annotation (Placement(transformation(extent={{-10,66},{10,86}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
+                                         annotation (Placement(transformation(
+          extent={{20,60},{40,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve4(
+    C1(h_vol(start=70921.0263406355)),
+    Pm(start=150000.0),
+    Q(start=960.3769597153787))
+    annotation (Placement(transformation(extent={{-10,-94},{10,-74}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1
+                                          annotation (Placement(transformation(
+          extent={{20,-100},{40,-80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+      Initialvalue=0.5)            annotation (Placement(transformation(extent=
+            {{-30,80},{-10,100}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
+      Initialvalue=0.5)             annotation (Placement(transformation(extent=
+           {{-30,-80},{-10,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve2(Pm(start=
+          250000.00130815947), Q(start=1920.8429304679091))
+    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve3(Pm(start=
+          200000.00130815947), Q(start=-0.0965278352866084))
+    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB volumeB1(dynamic_mass_balance=true, h(start=
+          71016.12237180525))
+    annotation (Placement(transformation(
+        origin={30,-20},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve5
+    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
+                                          annotation (Placement(transformation(
+          extent={{82,-30},{102,-10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=1,
+    Initialvalue=1,
+    Finalvalue=0) annotation (Placement(transformation(extent={{32,20},{52,40}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(Initialvalue=1, Finalvalue=0)
+    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(Initialvalue=1, Finalvalue=0)
+    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe1(lambda=0)
+    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe2(lambda=0)
+    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Junctions.Splitter2 splitter2_1
+    annotation (Placement(transformation(extent={{-50,0},{-30,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.Splitter2 splitter2_2
+    annotation (Placement(transformation(extent={{-50,-60},{-30,-40}}, rotation=
+           0)));
+equation
+  connect(valve4.C2, puitsP1.C)         annotation (Line(points={{10,-90},{20,
+          -90}}, color={0,0,255}));
+  connect(rampe.y, valve1.Ouv)        annotation (Line(points={{-9,90},{0,90},{
+          0,87}}));
+  connect(rampe1.y, valve4.Ouv)
+    annotation (Line(points={{-9,-70},{0,-70},{0,-73}}));
+  connect(valve5.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
+          -20}}, color={0,0,255}));
+  connect(rampe2.y, valve5.Ouv)
+    annotation (Line(points={{53,30},{60,30},{60,-3}}));
+  connect(rampe3.y, valve2.Ouv)         annotation (Line(points={{-9,40},{0,40},
+          {0,27}}));
+  connect(rampe4.y, valve3.Ouv)         annotation (Line(points={{-9,-20},{0,
+          -20},{0,-33}}));
+  connect(sourceP.C, pipe1.C1)
+    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
+  connect(sourceP1.C, pipe2.C1)
+    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
+  connect(valve2.C2, volumeB1.Ce2)         annotation (Line(points={{10,10},{30,
+          10},{30,-10}}, color={0,0,255}));
+  connect(valve3.C2, volumeB1.Ce1)         annotation (Line(points={{10,-50},{
+          30,-50},{30,-30}}, color={0,0,255}));
+  connect(volumeB1.Cs2, valve5.C1)
+    annotation (Line(points={{39.8,-20},{50,-20}}, color={0,0,255}));
+  connect(valve1.C2, puitsP.C)        annotation (Line(points={{10,70},{20,70}},
+        color={0,0,255}));
+  connect(pipe1.C2, splitter2_1.Ce)
+    annotation (Line(points={{-60,10},{-50,10}}, color={0,0,255}));
+  connect(splitter2_1.Cs1, valve1.C1) annotation (Line(points={{-36,20},{-36,70},
+          {-10,70}}, color={0,0,255}));
+  connect(splitter2_1.Cs2, valve2.C1) annotation (Line(points={{-36,0},{-36,-4},
+          {-20,-4},{-20,10},{-10,10}}, color={0,0,255}));
+  connect(pipe2.C2, splitter2_2.Ce)
+    annotation (Line(points={{-60,-50},{-50,-50}}, color={0,0,255}));
+  connect(splitter2_2.Cs1, valve3.C1) annotation (Line(points={{-36,-40},{-36,
+          -36},{-20,-36},{-20,-50},{-10,-50}}, color={0,0,255}));
+  connect(splitter2_2.Cs2, valve4.C1) annotation (Line(points={{-36,-60},{-36,
+          -90},{-10,-90}}, color={0,0,255}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestJunctions5;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestLoopBreaker.mo b/ThermoSysPro/Examples/SimpleExamples/TestLoopBreaker.mo
index f070161e798d4204c4cc3e92ca5cfd14e2e159f7..8aff6b6a74d3e2f61db659d894e9f1fe16d35018 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestLoopBreaker.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestLoopBreaker.mo
@@ -1,73 +1,72 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestLoopBreaker
-
-  WaterSteam.BoundaryConditions.SourcePQ sourcePQ
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss2
-    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
-  WaterSteam.Junctions.Splitter2 splitter2_1 annotation (Placement(
-        transformation(extent={{-56,0},{-36,20}}, rotation=0)));
-  WaterSteam.Junctions.Mixer2 mixer2_1 annotation (Placement(transformation(
-          extent={{40,0},{60,20}}, rotation=0)));
-  WaterSteam.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{80,0},{100,20}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5)
-    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
-  WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP
-    annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0)));
-equation
-  connect(sourcePQ.C, splitter2_1.Ce) annotation (Line(
-      points={{-80,10},{-56,10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line(
-      points={{-42,20},{-42,30},{-20,30}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line(
-      points={{-42,0},{-42,-10},{-20,-10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(mixer2_1.Ce1, singularPressureLoss1.C2)
-    annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None));
-  connect(mixer2_1.Cs, sink.C) annotation (Line(
-      points={{60,10},{80,10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(constante.y, splitter2_1.Ialpha1)
-    annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=
-          Smooth.None));
-  connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line(
-      points={{0,-10},{10,-10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line(
-      points={{30,-10},{46,-10},{46,0}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestLoopBreaker;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestLoopBreaker
+  WaterSteam.BoundaryConditions.SourcePQ sourcePQ
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss2
+    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
+  WaterSteam.Junctions.Splitter2 splitter2_1 annotation (Placement(
+        transformation(extent={{-56,0},{-36,20}}, rotation=0)));
+  WaterSteam.Junctions.Mixer2 mixer2_1 annotation (Placement(transformation(
+          extent={{40,0},{60,20}}, rotation=0)));
+  WaterSteam.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{80,0},{100,20}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5)
+    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
+  WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP
+    annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0)));
+equation
+  connect(sourcePQ.C, splitter2_1.Ce) annotation (Line(
+      points={{-80,10},{-56,10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line(
+      points={{-42,20},{-42,30},{-20,30}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line(
+      points={{-42,0},{-42,-10},{-20,-10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(mixer2_1.Ce1, singularPressureLoss1.C2)
+    annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None));
+  connect(mixer2_1.Cs, sink.C) annotation (Line(
+      points={{60,10},{80,10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(constante.y, splitter2_1.Ialpha1)
+    annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=
+          Smooth.None));
+  connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line(
+      points={{0,-10},{10,-10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line(
+      points={{30,-10},{46,-10},{46,0}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestLoopBreaker;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestLumpedStraightPipe.mo b/ThermoSysPro/Examples/SimpleExamples/TestLumpedStraightPipe.mo
index 7a658a1b6080ebd858cb1937528efea78d143ffe..64ba11e20e44d5e794beb6399fd0fe4016c59c19 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestLumpedStraightPipe.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestLumpedStraightPipe.mo
@@ -1,50 +1,49 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestLumpedStraightPipe
-
-  ThermoSysPro.WaterSteam.Volumes.Tank tank1(h0=2e5) annotation (Placement(
-        transformation(extent={{-50,16},{-30,36}},   rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank tank2(z0=10) annotation (Placement(
-        transformation(extent={{30,16},{50,36}},   rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    inertia=true,
-    lambda=0.012,
-    lambda_fixed=true) annotation (Placement(transformation(extent={{-10,-24},{
-            10,-4}}, rotation=0)));
-equation
-  connect(tank1.Cs2, lumpedStraightPipe.C1) annotation (Line(points={{-30,20},{
-          -20,20},{-20,-14},{-10,-14}},   color={0,0,255}));
-  connect(lumpedStraightPipe.C2, tank2.Ce2) annotation (Line(points={{10,-14},{
-          20,-14},{20,20},{30,20}},   color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-   Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestLumpedStraightPipe;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestLumpedStraightPipe
+  ThermoSysPro.WaterSteam.Volumes.Tank tank1(h0=2e5) annotation (Placement(
+        transformation(extent={{-50,16},{-30,36}},   rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank tank2(z0=10) annotation (Placement(
+        transformation(extent={{30,16},{50,36}},   rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    inertia=true,
+    lambda=0.012,
+    lambda_fixed=true) annotation (Placement(transformation(extent={{-10,-24},{
+            10,-4}}, rotation=0)));
+equation
+  connect(tank1.Cs2, lumpedStraightPipe.C1) annotation (Line(points={{-30,20},{
+          -20,20},{-20,-14},{-10,-14}},   color={0,0,255}));
+  connect(lumpedStraightPipe.C2, tank2.Ce2) annotation (Line(points={{10,-14},{
+          20,-14},{20,20},{30,20}},   color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+   Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestLumpedStraightPipe;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestMassFlowMultiplier.mo b/ThermoSysPro/Examples/SimpleExamples/TestMassFlowMultiplier.mo
index b00c58dacc30b3d275cb3c327394d4dab679a531..413b6d07fbaa89c74b4537b284afb5515950df94 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestMassFlowMultiplier.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestMassFlowMultiplier.mo
@@ -1,47 +1,46 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestMassFlowMultiplier
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss annotation (Placement(transformation(extent={{-60,0},{
-            -40,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{20,0},{
-            40,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier
-    annotation (Placement(transformation(extent={{-20,0},{0,20}}, rotation=0)));
-equation
-  connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-80,10},
-          {-60,10}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{40,10},{
-          60,10}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(
-        points={{-40,10},{-20,10}}, color={0,0,255}));
-  connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(
-        points={{0,10},{20,10}}, color={0,0,255}));
-annotation(experiment(StopTime=1000), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestMassFlowMultiplier;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestMassFlowMultiplier
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss annotation (Placement(transformation(extent={{-60,0},{
+            -40,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{20,0},{
+            40,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier
+    annotation (Placement(transformation(extent={{-20,0},{0,20}}, rotation=0)));
+equation
+  connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-80,10},
+          {-60,10}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{40,10},{
+          60,10}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(
+        points={{-40,10},{-20,10}}, color={0,0,255}));
+  connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(
+        points={{0,10},{20,10}}, color={0,0,255}));
+annotation(experiment(StopTime=1000), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestMassFlowMultiplier;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating0.mo b/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating0.mo
index 1635ddec898d589d220ab7ba406b3b64eae7d22a..24a3d9b6dcca15ed0b3798ae4a0988a4c914a3e6 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating0.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating0.mo
@@ -1,95 +1,93 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestNTUWaterHeating0
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur(
-    P0=80.0e5,
-    Q0=1780,
-    h0=872.0e3)
-          annotation (Placement(transformation(extent={{-182,-10},{-162,10}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur
-             annotation (Placement(transformation(extent={{152,-10},{172,10}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    P0=27.e5,
-    h0=2.6e6)
-            annotation (Placement(transformation(extent={{-182,88},{-162,108}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2(K=1e-4)
-                          annotation (Placement(transformation(extent={{-106,
-            -10},{-86,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1e-4)
-                          annotation (Placement(transformation(extent={{-106,88},
-            {-86,108}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{152,-106},{172,-86}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4)
-                          annotation (Placement(transformation(extent={{92,-10},
-            {112,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4)
-                          annotation (Placement(transformation(extent={{34,-106},
-            {54,-86}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating(
-    lambdaE=102.5,
-    SCondDes=6314,
-    KCond=5024,
-    SPurge=656,
-    KPurge=1767,
-    HeiF(start=900000),
-    HDesF(start=900000),
-    Hep(start=500000),
-    Ee(h_vol(start=880000), Q(start=1800), h(start=880000), P(start=80e5)),
-    Ev(h_vol(start=3500000), P(start=27e5)),
-    Ep(Q(start=10)),
-    Se(P(start=80e5)))  annotation (Placement(transformation(extent={{-34,-42},
-            {44,42}}, rotation=0)));
-equation
-  connect(Source_condenseur.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-162,0},{-106,0}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-162,98},{-106,98}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, Puit_condenseur.C)
-    annotation (Line(points={{112,0},{152,0}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
-    annotation (Line(points={{54,-96},{152,-96}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation (Line(points=
-         {{-86,98},{28.4,98},{28.4,13.44}}, color={0,0,255}));
-  connect(nTUWaterHeating.Se, singularPressureLoss4.C1)
-    annotation (Line(points={{44,0},{92,0}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, nTUWaterHeating.Ee)
-    annotation (Line(points={{-86,0},{-34.78,0}}, color={0,0,255}));
-  connect(singularPressureLoss5.C1, nTUWaterHeating.Sp)
-    annotation (Line(points={{34,-96},{-14,-96},{-14,-13.86},{-18.4,-13.86}}));
-    annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestNTUWaterHeating0;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestNTUWaterHeating0
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur(
+    P0=80.0e5,
+    Q0=1780,
+    h0=872.0e3)
+          annotation (Placement(transformation(extent={{-182,-10},{-162,10}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur
+             annotation (Placement(transformation(extent={{152,-10},{172,10}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    P0=27.e5,
+    h0=2.6e6)
+            annotation (Placement(transformation(extent={{-182,88},{-162,108}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2(K=1e-4)
+                          annotation (Placement(transformation(extent={{-106,
+            -10},{-86,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1e-4)
+                          annotation (Placement(transformation(extent={{-106,88},
+            {-86,108}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{152,-106},{172,-86}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4)
+                          annotation (Placement(transformation(extent={{92,-10},
+            {112,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4)
+                          annotation (Placement(transformation(extent={{34,-106},
+            {54,-86}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating(
+    lambdaE=102.5,
+    SCondDes=6314,
+    KCond=5024,
+    SPurge=656,
+    KPurge=1767,
+    HeiF(start=900000),
+    HDesF(start=900000),
+    Hep(start=500000),
+    Ee(h_vol(start=880000), Q(start=1800), h(start=880000), P(start=80e5)),
+    Ev(h_vol(start=3500000), P(start=27e5)),
+    Ep(Q(start=10)),
+    Se(P(start=80e5)))  annotation (Placement(transformation(extent={{-34,-42},
+            {44,42}}, rotation=0)));
+equation
+  connect(Source_condenseur.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-162,0},{-106,0}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-162,98},{-106,98}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, Puit_condenseur.C)
+    annotation (Line(points={{112,0},{152,0}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
+    annotation (Line(points={{54,-96},{152,-96}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation (Line(points=
+         {{-86,98},{28.4,98},{28.4,13.44}}, color={0,0,255}));
+  connect(nTUWaterHeating.Se, singularPressureLoss4.C1)
+    annotation (Line(points={{44,0},{92,0}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, nTUWaterHeating.Ee)
+    annotation (Line(points={{-86,0},{-34.78,0}}, color={0,0,255}));
+  connect(singularPressureLoss5.C1, nTUWaterHeating.Sp)
+    annotation (Line(points={{34,-96},{-14,-96},{-14,-13.86},{-18.4,-13.86}}));
+    annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestNTUWaterHeating0;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating1.mo b/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating1.mo
index 449985af8050b5f4cf56d85e23f0463ccd8452d2..af57265ed11356e925c14d459114b203b77ca2ba 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating1.mo
@@ -1,110 +1,108 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestNTUWaterHeating1
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur(
-    P0=80.0e5,
-    Q0=1780,
-    h0=872.0e3)
-          annotation (Placement(transformation(extent={{-201,-10},{-181,10}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur
-             annotation (Placement(transformation(extent={{182,-10},{202,10}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    P0=27.0e5,
-    h0=2.60e6)
-            annotation (Placement(transformation(extent={{-201,90},{-181,110}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2(K=1e-4)
-                          annotation (Placement(transformation(extent={{-101,
-            -10},{-81,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1e-4)
-                          annotation (Placement(transformation(extent={{-100,90},
-            {-80,110}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{178,-100},{198,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4)
-                          annotation (Placement(transformation(extent={{142,-10},
-            {162,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4)
-                          annotation (Placement(transformation(extent={{140,
-            -100},{160,-80}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating(
-    lambdaE=102.5,
-    SCondDes=6314,
-    KCond=5024,
-    SPurge=656,
-    KPurge=1767,
-    HeiF(start=900000),
-    HDesF(start=900000),
-    Hep(start=500000),
-    Ee(h_vol(start=880000), Q(start=1800), h(start=880000), P(start=80e5)),
-    Ev(h_vol(start=3500000), P(start=27e5)),
-    Ep(Q(start=10)),
-    Se(P(start=80e5)))
-                      annotation (Placement(transformation(extent={{-36,-42},{
-            42,42}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=1e-4)
-                          annotation (Placement(transformation(extent={{-100,50},
-            {-80,70}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur1(
-    Q0=1,
-    h0=1000e3,
-    P0=80e5)
-          annotation (Placement(transformation(extent={{-201,50},{-181,70}},
-          rotation=0)));
-equation
-  connect(Source_condenseur.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-181,0},{-101,0}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-181,100},{-100,100}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, Puit_condenseur.C)
-    annotation (Line(points={{162,0},{182,0}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
-    annotation (Line(points={{160,-90},{178,-90}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation (Line(points=
-         {{-80,100},{26.4,100},{26.4,13.44}}, color={0,0,255}));
-  connect(nTUWaterHeating.Se, singularPressureLoss4.C1)
-    annotation (Line(points={{42,0},{142,0}}, color={0,0,255}));
-  connect(singularPressureLoss5.C1, nTUWaterHeating.Sp)
-    annotation (Line(points={{140,-90},{-20,-90},{-20,-13.86},{-20.4,-13.86}}));
-  connect(singularPressureLoss2.C2, nTUWaterHeating.Ee)
-    annotation (Line(points={{-81,0},{-36.78,0}}, color={0,0,255}));
-  connect(Source_condenseur1.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-181,60},{-100,60}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, nTUWaterHeating.Ep) annotation (Line(points=
-         {{-80,60},{-20.4,60},{-20.4,14.28}}, color={0,0,255}));
-    annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestNTUWaterHeating1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestNTUWaterHeating1
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur(
+    P0=80.0e5,
+    Q0=1780,
+    h0=872.0e3)
+          annotation (Placement(transformation(extent={{-201,-10},{-181,10}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur
+             annotation (Placement(transformation(extent={{182,-10},{202,10}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    P0=27.0e5,
+    h0=2.60e6)
+            annotation (Placement(transformation(extent={{-201,90},{-181,110}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2(K=1e-4)
+                          annotation (Placement(transformation(extent={{-101,
+            -10},{-81,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1e-4)
+                          annotation (Placement(transformation(extent={{-100,90},
+            {-80,110}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{178,-100},{198,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4)
+                          annotation (Placement(transformation(extent={{142,-10},
+            {162,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4)
+                          annotation (Placement(transformation(extent={{140,
+            -100},{160,-80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating(
+    lambdaE=102.5,
+    SCondDes=6314,
+    KCond=5024,
+    SPurge=656,
+    KPurge=1767,
+    HeiF(start=900000),
+    HDesF(start=900000),
+    Hep(start=500000),
+    Ee(h_vol(start=880000), Q(start=1800), h(start=880000), P(start=80e5)),
+    Ev(h_vol(start=3500000), P(start=27e5)),
+    Ep(Q(start=10)),
+    Se(P(start=80e5)))
+                      annotation (Placement(transformation(extent={{-36,-42},{
+            42,42}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=1e-4)
+                          annotation (Placement(transformation(extent={{-100,50},
+            {-80,70}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur1(
+    Q0=1,
+    h0=1000e3,
+    P0=80e5)
+          annotation (Placement(transformation(extent={{-201,50},{-181,70}},
+          rotation=0)));
+equation
+  connect(Source_condenseur.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-181,0},{-101,0}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-181,100},{-100,100}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, Puit_condenseur.C)
+    annotation (Line(points={{162,0},{182,0}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
+    annotation (Line(points={{160,-90},{178,-90}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation (Line(points=
+         {{-80,100},{26.4,100},{26.4,13.44}}, color={0,0,255}));
+  connect(nTUWaterHeating.Se, singularPressureLoss4.C1)
+    annotation (Line(points={{42,0},{142,0}}, color={0,0,255}));
+  connect(singularPressureLoss5.C1, nTUWaterHeating.Sp)
+    annotation (Line(points={{140,-90},{-20,-90},{-20,-13.86},{-20.4,-13.86}}));
+  connect(singularPressureLoss2.C2, nTUWaterHeating.Ee)
+    annotation (Line(points={{-81,0},{-36.78,0}}, color={0,0,255}));
+  connect(Source_condenseur1.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-181,60},{-100,60}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, nTUWaterHeating.Ep) annotation (Line(points=
+         {{-80,60},{-20.4,60},{-20.4,14.28}}, color={0,0,255}));
+    annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestNTUWaterHeating1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating2.mo b/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating2.mo
index ec4fc6e01e1523fb8c2728986dc24e1a354c221a..c1c38e32ae9905855b57a49c1241671589bdbee7 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestNTUWaterHeating2.mo
@@ -1,200 +1,198 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestNTUWaterHeating2
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur(
-    P0=79e5,
-    Q0=1780,
-    h0=760e3)
-          annotation (Placement(transformation(extent={{-201,-10},{-181,10}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur
-             annotation (Placement(transformation(extent={{182,-10},{202,10}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    h0=2.6e6,
-    P0=27e5)
-            annotation (Placement(transformation(extent={{-201,90},{-181,110}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2(
-                       K=1e-4, C2(
-      Q(start=1780),
-      P(start=79e5),
-      h_vol(start=760000),
-      h(start=760000)))   annotation (Placement(transformation(extent={{-160,
-            -10},{-140,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1e-4, h(start=2600e3))
-                          annotation (Placement(transformation(extent={{-100,90},
-            {-80,110}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{178,-100},{198,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4, C1(
-      Q(start=1780),
-      P(start=72.8e5),
-      h_vol(start=9.7e5),
-      h(start=9.7e5)),
-    pro(d(start=838)),
-    Pm(start=72.87e5))    annotation (Placement(transformation(extent={{142,-10},
-            {162,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4,
-    pro(d(start=886)),
-    Pm(start=16.5e5),
-    h(start=765298))      annotation (Placement(transformation(extent={{140,
-            -100},{160,-80}}, rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating(
-    SCondDes=6314,
-    SPurge=656,
-    Ev(h_vol(start=3500000), P(start=27e5)),
-    lambdaE=97,
-    KCond=3260.23,
-    KPurge=1767.8,
-    SDes(start=0),
-    HeiF(start=873550),
-    HDesF(start=973600),
-    Hep(start=873550),
-    Se(
-      Q(start=1780),
-      h_vol(start=970000),
-      h(start=970000),
-      P(start=72.87e5)),
-    P(start=27e5),
-    h(start=879e3),
-    Ee(
-      Q(start=1780),
-      P(start=76.5e5),
-      h_vol(start=860000),
-      h(start=860000)),
-    Ep(
-      Q(start=0),
-      P(start=28e5),
-      h_vol(start=1000e3),
-      h(start=1000e3)))
-                      annotation (Placement(transformation(extent={{22,-42},{
-            100,42}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=1e-4,
-    pro(d(start=858)),
-    Pm(start=28e5))       annotation (Placement(transformation(extent={{18,68},
-            {38,88}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur1(
-    h0=1000e3,
-    P0=28e5,
-    Q0=0) annotation (Placement(transformation(extent={{-43,68},{-23,88}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating1(
-    lambdaE=70,
-    SCondDes=5750,
-    KCond=7200,
-    SPurge=1458,
-    KPurge=2048,
-    SDes(start=0),
-    HeiF(start=772000),
-    HDesF(start=867000),
-    Hep(start=865000),
-    P(start=16.5e5),
-    h(start=765.3e3),
-    Se(
-      P(start=76.5e5),
-      Q(start=1780),
-      h_vol(start=8.67e5),
-      h(start=8.67e5)),
-    Ee(
-      Q(start=1780),
-      P(start=7900000),
-      h_vol(start=767000),
-      h(start=767000)),
-    Ev(
-      Q(start=109.1),
-      h_vol(start=2.4e6),
-      h(start=2.4e6),
-      P(start=16.5e5)),
-    Ep(
-      h_vol(start=765290),
-      Q(start=110),
-      P(start=27.e5),
-      h(start=878290)))
-                      annotation (Placement(transformation(extent={{-118,-42},{
-            -40,42}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    option_temperature=2,
-    mode=0,
-    P0=16.5e5,
-    h0=2.4e6,
-    Q(start=109.11))
-            annotation (Placement(transformation(extent={{-201,70},{-181,90}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss6(K=1e-4,
-    Q(start=109),
-    h(start=2400e3))      annotation (Placement(transformation(extent={{-100,70},
-            {-80,90}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss7(              K=1e-4, Q(start=110),
-    pro(d(start=858)),
-    Pm(start=27e5),
-    h(start=879e3))       annotation (Placement(transformation(extent={{-10,-54},
-            {-30,-34}}, rotation=0)));
-equation
-  connect(Source_condenseur.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-181,0},{-160,0}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-181,100},{-100,100}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, Puit_condenseur.C)
-    annotation (Line(points={{162,0},{182,0}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
-    annotation (Line(points={{160,-90},{178,-90}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation (Line(points=
-         {{-80,100},{84.4,100},{84.4,13.44}}, color={0,0,255}));
-  connect(nTUWaterHeating.Se, singularPressureLoss4.C1)
-    annotation (Line(points={{100,0},{142,0}}, color={0,0,255}));
-  connect(Source_condenseur1.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-23,78},{18,78}}, color={0,0,255}));
-  connect(nTUWaterHeating1.Se, nTUWaterHeating.Ee)
-    annotation (Line(points={{-40,0},{21.22,0}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, nTUWaterHeating1.Ee) annotation (Line(
-        points={{-140,0},{-118.78,0}}, color={0,0,255}));
-  connect(sourceP1.C, singularPressureLoss6.C1)
-    annotation (Line(points={{-181,80},{-100,80}}, color={0,0,255}));
-  connect(singularPressureLoss6.C2, nTUWaterHeating1.Ev) annotation (Line(
-        points={{-80,80},{-55.6,80},{-55.6,13.44}}, color={0,0,255}));
-  connect(nTUWaterHeating.Sp, singularPressureLoss7.C1) annotation (Line(points=
-         {{37.6,-13.86},{37.6,-44},{-10,-44}}, color={0,0,255}));
-  connect(singularPressureLoss7.C2, nTUWaterHeating1.Ep) annotation (Line(
-        points={{-30,-44},{-132,-44},{-132,38},{-102.4,38},{-102.4,14.28}},
-        color={0,0,255}));
-  connect(nTUWaterHeating1.Sp, singularPressureLoss5.C1) annotation (Line(
-        points={{-102.4,-13.86},{-102.4,-90},{140,-90}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, nTUWaterHeating.Ep) annotation (Line(points=
-         {{38,78},{37.6,78},{37.6,14.28}}, color={0,0,255}));
-    annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestNTUWaterHeating2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestNTUWaterHeating2
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur(
+    P0=79e5,
+    Q0=1780,
+    h0=760e3)
+          annotation (Placement(transformation(extent={{-201,-10},{-181,10}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur
+             annotation (Placement(transformation(extent={{182,-10},{202,10}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    h0=2.6e6,
+    P0=27e5)
+            annotation (Placement(transformation(extent={{-201,90},{-181,110}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2(
+                       K=1e-4, C2(
+      Q(start=1780),
+      P(start=79e5),
+      h_vol(start=760000),
+      h(start=760000)))   annotation (Placement(transformation(extent={{-160,
+            -10},{-140,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1e-4, h(start=2600e3))
+                          annotation (Placement(transformation(extent={{-100,90},
+            {-80,110}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{178,-100},{198,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4, C1(
+      Q(start=1780),
+      P(start=72.8e5),
+      h_vol(start=9.7e5),
+      h(start=9.7e5)),
+    pro(d(start=838)),
+    Pm(start=72.87e5))    annotation (Placement(transformation(extent={{142,-10},
+            {162,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4,
+    pro(d(start=886)),
+    Pm(start=16.5e5),
+    h(start=765298))      annotation (Placement(transformation(extent={{140,
+            -100},{160,-80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating(
+    SCondDes=6314,
+    SPurge=656,
+    Ev(h_vol(start=3500000), P(start=27e5)),
+    lambdaE=97,
+    KCond=3260.23,
+    KPurge=1767.8,
+    SDes(start=0),
+    HeiF(start=873550),
+    HDesF(start=973600),
+    Hep(start=873550),
+    Se(
+      Q(start=1780),
+      h_vol(start=970000),
+      h(start=970000),
+      P(start=72.87e5)),
+    P(start=27e5),
+    h(start=879e3),
+    Ee(
+      Q(start=1780),
+      P(start=76.5e5),
+      h_vol(start=860000),
+      h(start=860000)),
+    Ep(
+      Q(start=0),
+      P(start=28e5),
+      h_vol(start=1000e3),
+      h(start=1000e3)))
+                      annotation (Placement(transformation(extent={{22,-42},{
+            100,42}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=1e-4,
+    pro(d(start=858)),
+    Pm(start=28e5))       annotation (Placement(transformation(extent={{18,68},
+            {38,88}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_condenseur1(
+    h0=1000e3,
+    P0=28e5,
+    Q0=0) annotation (Placement(transformation(extent={{-43,68},{-23,88}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating nTUWaterHeating1(
+    lambdaE=70,
+    SCondDes=5750,
+    KCond=7200,
+    SPurge=1458,
+    KPurge=2048,
+    SDes(start=0),
+    HeiF(start=772000),
+    HDesF(start=867000),
+    Hep(start=865000),
+    P(start=16.5e5),
+    h(start=765.3e3),
+    Se(
+      P(start=76.5e5),
+      Q(start=1780),
+      h_vol(start=8.67e5),
+      h(start=8.67e5)),
+    Ee(
+      Q(start=1780),
+      P(start=7900000),
+      h_vol(start=767000),
+      h(start=767000)),
+    Ev(
+      Q(start=109.1),
+      h_vol(start=2.4e6),
+      h(start=2.4e6),
+      P(start=16.5e5)),
+    Ep(
+      h_vol(start=765290),
+      Q(start=110),
+      P(start=27.e5),
+      h(start=878290)))
+                      annotation (Placement(transformation(extent={{-118,-42},{
+            -40,42}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    option_temperature=2,
+    mode=0,
+    P0=16.5e5,
+    h0=2.4e6,
+    Q(start=109.11))
+            annotation (Placement(transformation(extent={{-201,70},{-181,90}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss6(K=1e-4,
+    Q(start=109),
+    h(start=2400e3))      annotation (Placement(transformation(extent={{-100,70},
+            {-80,90}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss7(              K=1e-4, Q(start=110),
+    pro(d(start=858)),
+    Pm(start=27e5),
+    h(start=879e3))       annotation (Placement(transformation(extent={{-10,-54},
+            {-30,-34}}, rotation=0)));
+equation
+  connect(Source_condenseur.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-181,0},{-160,0}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-181,100},{-100,100}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, Puit_condenseur.C)
+    annotation (Line(points={{162,0},{182,0}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
+    annotation (Line(points={{160,-90},{178,-90}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation (Line(points=
+         {{-80,100},{84.4,100},{84.4,13.44}}, color={0,0,255}));
+  connect(nTUWaterHeating.Se, singularPressureLoss4.C1)
+    annotation (Line(points={{100,0},{142,0}}, color={0,0,255}));
+  connect(Source_condenseur1.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-23,78},{18,78}}, color={0,0,255}));
+  connect(nTUWaterHeating1.Se, nTUWaterHeating.Ee)
+    annotation (Line(points={{-40,0},{21.22,0}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, nTUWaterHeating1.Ee) annotation (Line(
+        points={{-140,0},{-118.78,0}}, color={0,0,255}));
+  connect(sourceP1.C, singularPressureLoss6.C1)
+    annotation (Line(points={{-181,80},{-100,80}}, color={0,0,255}));
+  connect(singularPressureLoss6.C2, nTUWaterHeating1.Ev) annotation (Line(
+        points={{-80,80},{-55.6,80},{-55.6,13.44}}, color={0,0,255}));
+  connect(nTUWaterHeating.Sp, singularPressureLoss7.C1) annotation (Line(points=
+         {{37.6,-13.86},{37.6,-44},{-10,-44}}, color={0,0,255}));
+  connect(singularPressureLoss7.C2, nTUWaterHeating1.Ep) annotation (Line(
+        points={{-30,-44},{-132,-44},{-132,38},{-102.4,38},{-102.4,14.28}},
+        color={0,0,255}));
+  connect(nTUWaterHeating1.Sp, singularPressureLoss5.C1) annotation (Line(
+        points={{-102.4,-13.86},{-102.4,-90},{140,-90}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, nTUWaterHeating.Ep) annotation (Line(points=
+         {{38,78},{37.6,78},{37.6,14.28}}, color={0,0,255}));
+    annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestNTUWaterHeating2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestPipePressureLoss.mo b/ThermoSysPro/Examples/SimpleExamples/TestPipePressureLoss.mo
index 57b30dde92eeeec886d4c27042375a6fe0e18aed..62113ce478342e3b75ff8c478cca76f7a8295776 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestPipePressureLoss.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestPipePressureLoss.mo
@@ -1,54 +1,53 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestPipePressureLoss
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-85,-10},{-65,10}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{64,-10},{84,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss pipePressureLoss
-                                          annotation (Placement(transformation(
-          extent={{-40,-53},{38,53}},
-                                    rotation=0)));
-equation
-  connect(pipePressureLoss.C2, PuitsP1.C)
-    annotation (Line(points={{38,0},{49,0},{64,0}},
-                                              color={0,0,255}));
-  connect(SourceP1.C, pipePressureLoss.C1)
-    annotation (Line(points={{-65,0},{-65,0},{-40,0}},
-                                                 color={0,0,255}));
-  annotation (
-    experiment(StopTime=1000),
-     Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestPipePressureLoss;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestPipePressureLoss
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-85,-10},{-65,10}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{64,-10},{84,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss pipePressureLoss
+                                          annotation (Placement(transformation(
+          extent={{-40,-53},{38,53}},
+                                    rotation=0)));
+equation
+  connect(pipePressureLoss.C2, PuitsP1.C)
+    annotation (Line(points={{38,0},{49,0},{64,0}},
+                                              color={0,0,255}));
+  connect(SourceP1.C, pipePressureLoss.C1)
+    annotation (Line(points={{-65,0},{-65,0},{-40,0}},
+                                                 color={0,0,255}));
+  annotation (
+    experiment(StopTime=1000),
+     Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestPipePressureLoss;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestPressurizer.mo b/ThermoSysPro/Examples/SimpleExamples/TestPressurizer.mo
index 94cb872251579b73e17cd18374a51065735dc754..a7a5456ff48e569b2bca8212cdb52aab57a4fba3 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestPressurizer.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestPressurizer.mo
@@ -1,151 +1,149 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestPressurizer
-
-  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
-    "Power released by the electrical heaters";
-  parameter Real OUVfeedwaterValve( fixed=false)=0.01
-    "OUV feed water valve";
-
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=100),
-    C1(
-      P(start=160e5),
-      h_vol(start=1270e3),
-      Q(start=0.3),
-      h(start=1270e3)),
-    Q(fixed=false, start=0.32),
-    Cvmax=5000)      annotation (Placement(transformation(extent={{-110,130},{
-            -90,150}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Cvmax(fixed=true) = 5000,
-    Pm(start=15500000))
-    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvFeedwaterValve1(k=
-        OUVfeedwaterValve)
-    annotation (Placement(transformation(extent={{-140,176},{-120,196}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=1,
-    D=1,
-    z1=1,
-    z2=0,
-    mode=0,
-    C1(P(start=160e5)),
-    C2(P(start=160e5)),
-    Q(fixed=false, start=0))
-             annotation (Placement(transformation(
-        origin={-30,-42},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed=
-          true) = 0.5) annotation (Placement(transformation(extent={{0,176},{20,
-            196}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    h0=1270e3,
-    mode=0,
-    P0=160e5)
-           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
-    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
-           0)));
-  WaterSteam.Volumes.Pressurizer pressurizer(
-    Zm=10.15,
-    Klv=0.5e6,
-    cpp=600,
-    hl(start=1629887.98290107),
-    hv(start=2596216.59571565),
-    Zl(start=5.5900717167325),
-    Yw0=60,
-    steady_state=true,
-    V=61.12,
-    Rp=1.27,
-    Ae=96.23,
-    Klp=1780,
-    Kvp=7500,
-    Mp=107e3,
-    Kpa=5.63,
-    Ccond=0.02,
-    Cevap=0.05,
-    Yw(start=32.92),
-    y(start=0.3292, fixed=true),
-    P0=15500000,
-    P(start=15500000, fixed=true),
-    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
-            -12},{32,118}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
-           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
-    option_temperature=2,
-    T0={310},
-    W0={Wch})
-    annotation (Placement(transformation(
-        origin={-133,32},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
-    T0={310},
-    W0={0.286e6},
-    option_temperature=1)
-    annotation (Placement(transformation(
-        origin={-133,55},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-equation
-  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(points={{-148,134},{
-          -110,134}}, color={0,0,255}));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
-        color={0,0,255}));
-  connect(OuvSteamrValve.y, SteamValve.Ouv)
-    annotation (Line(points={{21,186},{68,186},{68,151}}));
-  connect(FeedwaterValve.C2, pressurizer.Cas) annotation (Line(points={{-90,134},
-          {-30,134},{-30,118}}, color={0,0,255}));
-  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
-          32,134},{58,134}}, color={0,0,255}));
-  connect(sinkQ1.C, lumpedStraightPipe.C2)
-    annotation (Line(points={{-30,-66},{-30,-52}}));
-  connect(lumpedStraightPipe.C1, pressurizer.Cex)
-    annotation (Line(points={{-30,-32},{-30,-12}}));
-  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
-          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
-  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
-          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
-  connect(OuvFeedwaterValve1.y, FeedwaterValve.Ouv) annotation (Line(points={{
-          -119,186},{-100,186},{-100,151}}, color={0,0,255}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestPressurizer;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestPressurizer
+  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
+    "Power released by the electrical heaters";
+  parameter Real OUVfeedwaterValve( fixed=false)=0.01
+    "OUV feed water valve";
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=100),
+    C1(
+      P(start=160e5),
+      h_vol(start=1270e3),
+      Q(start=0.3),
+      h(start=1270e3)),
+    Q(fixed=false, start=0.32),
+    Cvmax=5000)      annotation (Placement(transformation(extent={{-110,130},{
+            -90,150}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Cvmax(fixed=true) = 5000,
+    Pm(start=15500000))
+    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvFeedwaterValve1(k=
+        OUVfeedwaterValve)
+    annotation (Placement(transformation(extent={{-140,176},{-120,196}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=1,
+    D=1,
+    z1=1,
+    z2=0,
+    mode=0,
+    C1(P(start=160e5)),
+    C2(P(start=160e5)),
+    Q(fixed=false, start=0))
+             annotation (Placement(transformation(
+        origin={-30,-42},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed=
+          true) = 0.5) annotation (Placement(transformation(extent={{0,176},{20,
+            196}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    h0=1270e3,
+    mode=0,
+    P0=160e5)
+           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
+    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
+           0)));
+  WaterSteam.Volumes.Pressurizer pressurizer(
+    Zm=10.15,
+    Klv=0.5e6,
+    cpp=600,
+    hl(start=1629887.98290107),
+    hv(start=2596216.59571565),
+    Zl(start=5.5900717167325),
+    Yw0=60,
+    steady_state=true,
+    V=61.12,
+    Rp=1.27,
+    Ae=96.23,
+    Klp=1780,
+    Kvp=7500,
+    Mp=107e3,
+    Kpa=5.63,
+    Ccond=0.02,
+    Cevap=0.05,
+    Yw(start=32.92),
+    y(start=0.3292, fixed=true),
+    P0=15500000,
+    P(start=15500000, fixed=true),
+    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
+            -12},{32,118}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
+           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
+    option_temperature=2,
+    T0={310},
+    W0={Wch})
+    annotation (Placement(transformation(
+        origin={-133,32},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
+    T0={310},
+    W0={0.286e6},
+    option_temperature=1)
+    annotation (Placement(transformation(
+        origin={-133,55},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+equation
+  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(points={{-148,134},{
+          -110,134}}, color={0,0,255}));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
+        color={0,0,255}));
+  connect(OuvSteamrValve.y, SteamValve.Ouv)
+    annotation (Line(points={{21,186},{68,186},{68,151}}));
+  connect(FeedwaterValve.C2, pressurizer.Cas) annotation (Line(points={{-90,134},
+          {-30,134},{-30,118}}, color={0,0,255}));
+  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
+          32,134},{58,134}}, color={0,0,255}));
+  connect(sinkQ1.C, lumpedStraightPipe.C2)
+    annotation (Line(points={{-30,-66},{-30,-52}}));
+  connect(lumpedStraightPipe.C1, pressurizer.Cex)
+    annotation (Line(points={{-30,-32},{-30,-12}}));
+  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
+          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
+  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
+          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
+  connect(OuvFeedwaterValve1.y, FeedwaterValve.Ouv) annotation (Line(points={{
+          -119,186},{-100,186},{-100,151}}, color={0,0,255}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestPressurizer;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestPressurizer1.mo b/ThermoSysPro/Examples/SimpleExamples/TestPressurizer1.mo
index 835ddb2b87212fd6def55064fccfb64382c276a6..fe9b23e39088eb12689cd1561d5bd5d476ff727d 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestPressurizer1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestPressurizer1.mo
@@ -1,153 +1,151 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestPressurizer1
-
-  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
-    "Power released by the electrical heaters";
-  parameter Real OUVfeedwaterValve( fixed=false)=0.01
-    "OUV feed water valve";
-
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=100),
-    C1(
-      P(start=160e5),
-      h_vol(start=1270e3),
-      Q(start=0.3),
-      h(start=1270e3)),
-    Q(fixed=false, start=0.32),
-    Cvmax=5000)      annotation (Placement(transformation(extent={{-110,130},{
-            -90,150}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Cvmax(fixed=true) = 5000,
-    Pm(start=15500000))
-    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvFeedwaterValve1(k=1e-20)
-    annotation (Placement(transformation(extent={{-184,178},{-164,198}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=1,
-    D=1,
-    z1=1,
-    z2=0,
-    mode=0,
-    C1(P(start=160e5)),
-    C2(P(start=160e5)),
-    Q(fixed=false, start=0))
-             annotation (Placement(transformation(
-        origin={-30,-42},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed=
-          true) = 0.5) annotation (Placement(transformation(extent={{0,176},{20,
-            196}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    h0=1270e3,
-    mode=0,
-    P0=160e5)
-           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
-    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
-           0)));
-  WaterSteam.Volumes.Pressurizer     pressurizer(
-    Zm=10.15,
-    Klv=0.5e6,
-    cpp=600,
-    hl(start=1629887.98290107),
-    hv(start=2596216.59571565),
-    Zl(start=5.5900717167325),
-    Yw0=60,
-    steady_state=true,
-    V=61.12,
-    Rp=1.27,
-    Ae=96.23,
-    Klp=1780,
-    Kvp=7500,
-    Mp=107e3,
-    Kpa=5.63,
-    Ccond=0.02,
-    Cevap=0.05,
-    Yw(start=32.92),
-    y(start=0.3292, fixed=true),
-    P0=15500000,
-    P(start=15500000, fixed=true),
-    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
-            -12},{32,118}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
-           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
-    option_temperature=2,
-    T0={310},
-    W0={Wch})
-    annotation (Placement(transformation(
-        origin={-133,32},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
-    T0={310},
-    W0={0.286e6},
-    option_temperature=1)
-    annotation (Placement(transformation(
-        origin={-133,55},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps table1DTemps(Table=[0,
-        OUVfeedwaterValve; 10,OUVfeedwaterValve; 20,0.05; 30,0.05; 50,0; 100,0])
-    annotation (Placement(transformation(extent={{-96,176},{-70,200}})));
-equation
-  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(points={{-148,134},{
-          -110,134}}, color={0,0,255}));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
-        color={0,0,255}));
-  connect(OuvSteamrValve.y, SteamValve.Ouv)
-    annotation (Line(points={{21,186},{68,186},{68,151}}));
-  connect(FeedwaterValve.C2, pressurizer.Cas) annotation (Line(points={{-90,134},
-          {-30,134},{-30,118}}, color={0,0,255}));
-  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
-          32,134},{58,134}}, color={0,0,255}));
-  connect(sinkQ1.C, lumpedStraightPipe.C2)
-    annotation (Line(points={{-30,-66},{-30,-52}}));
-  connect(lumpedStraightPipe.C1, pressurizer.Cex)
-    annotation (Line(points={{-30,-32},{-30,-12}}));
-  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
-          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
-  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
-          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
-  connect(table1DTemps.y, FeedwaterValve.Ouv) annotation (Line(points={{-68.7,
-          188},{-68.7,188},{-58,188},{-58,151},{-100,151}}, color={0,0,255}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestPressurizer1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestPressurizer1
+  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
+    "Power released by the electrical heaters";
+  parameter Real OUVfeedwaterValve( fixed=false)=0.01
+    "OUV feed water valve";
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=100),
+    C1(
+      P(start=160e5),
+      h_vol(start=1270e3),
+      Q(start=0.3),
+      h(start=1270e3)),
+    Q(fixed=false, start=0.32),
+    Cvmax=5000)      annotation (Placement(transformation(extent={{-110,130},{
+            -90,150}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Cvmax(fixed=true) = 5000,
+    Pm(start=15500000))
+    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvFeedwaterValve1(k=1e-20)
+    annotation (Placement(transformation(extent={{-184,178},{-164,198}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=1,
+    D=1,
+    z1=1,
+    z2=0,
+    mode=0,
+    C1(P(start=160e5)),
+    C2(P(start=160e5)),
+    Q(fixed=false, start=0))
+             annotation (Placement(transformation(
+        origin={-30,-42},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed=
+          true) = 0.5) annotation (Placement(transformation(extent={{0,176},{20,
+            196}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    h0=1270e3,
+    mode=0,
+    P0=160e5)
+           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
+    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
+           0)));
+  WaterSteam.Volumes.Pressurizer     pressurizer(
+    Zm=10.15,
+    Klv=0.5e6,
+    cpp=600,
+    hl(start=1629887.98290107),
+    hv(start=2596216.59571565),
+    Zl(start=5.5900717167325),
+    Yw0=60,
+    steady_state=true,
+    V=61.12,
+    Rp=1.27,
+    Ae=96.23,
+    Klp=1780,
+    Kvp=7500,
+    Mp=107e3,
+    Kpa=5.63,
+    Ccond=0.02,
+    Cevap=0.05,
+    Yw(start=32.92),
+    y(start=0.3292, fixed=true),
+    P0=15500000,
+    P(start=15500000, fixed=true),
+    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
+            -12},{32,118}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
+           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
+    option_temperature=2,
+    T0={310},
+    W0={Wch})
+    annotation (Placement(transformation(
+        origin={-133,32},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
+    T0={310},
+    W0={0.286e6},
+    option_temperature=1)
+    annotation (Placement(transformation(
+        origin={-133,55},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps table1DTemps(Table=[0,
+        OUVfeedwaterValve; 10,OUVfeedwaterValve; 20,0.05; 30,0.05; 50,0; 100,0])
+    annotation (Placement(transformation(extent={{-96,176},{-70,200}})));
+equation
+  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(points={{-148,134},{
+          -110,134}}, color={0,0,255}));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
+        color={0,0,255}));
+  connect(OuvSteamrValve.y, SteamValve.Ouv)
+    annotation (Line(points={{21,186},{68,186},{68,151}}));
+  connect(FeedwaterValve.C2, pressurizer.Cas) annotation (Line(points={{-90,134},
+          {-30,134},{-30,118}}, color={0,0,255}));
+  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
+          32,134},{58,134}}, color={0,0,255}));
+  connect(sinkQ1.C, lumpedStraightPipe.C2)
+    annotation (Line(points={{-30,-66},{-30,-52}}));
+  connect(lumpedStraightPipe.C1, pressurizer.Cex)
+    annotation (Line(points={{-30,-32},{-30,-12}}));
+  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
+          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
+  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
+          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
+  connect(table1DTemps.y, FeedwaterValve.Ouv) annotation (Line(points={{-68.7,
+          188},{-68.7,188},{-58,188},{-58,151},{-100,151}}, color={0,0,255}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestPressurizer1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestPressurizer2.mo b/ThermoSysPro/Examples/SimpleExamples/TestPressurizer2.mo
index 29fc9815279170f8013a9ba1b2d5eee1492ec622..237c9238b56888c4cfabcfbdf144efcc6cfbf5f6 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestPressurizer2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestPressurizer2.mo
@@ -1,157 +1,155 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestPressurizer2
-
-  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
-    "Power released by the electrical heaters";
-  parameter Real OUVfeedwaterValve( fixed=false)=0.01
-    "OUV feed water valve";
-
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve_Spray(
-    Cv(start=100),
-    C1(
-      P(start=160e5),
-      h_vol(start=1270e3),
-      Q(start=0.3),
-      h(start=1270e3)),
-    Q(fixed=false, start=0.32),
-    Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{-90,
-            150}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Cvmax(fixed=true) = 5000,
-    Pm(start=15500000))
-    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=1,
-    D=1,
-    z1=1,
-    z2=0,
-    mode=0,
-    C1(P(start=160e5)),
-    C2(P(start=160e5)),
-    Q(fixed=false, start=0))
-             annotation (Placement(transformation(
-        origin={-30,-42},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed=
-          true) = 0.5) annotation (Placement(transformation(extent={{0,156},{20,
-            176}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    h0=1270e3,
-    mode=0,
-    P0=160e5)
-           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
-    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
-           0)));
-  WaterSteam.Volumes.Pressurizer     pressurizer(
-    Zm=10.15,
-    Klv=0.5e6,
-    cpp=600,
-    hl(start=1629887.98290107),
-    hv(start=2596216.59571565),
-    Zl(start=5.5900717167325),
-    Yw0=60,
-    steady_state=true,
-    V=61.12,
-    Rp=1.27,
-    Ae=96.23,
-    Klp=1780,
-    Kvp=7500,
-    Mp=107e3,
-    Kpa=5.63,
-    Ccond=0.02,
-    Cevap=0.05,
-    Yw(start=32.92),
-    y(start=0.3292, fixed=true),
-    P0=15500000,
-    P(start=15500000, fixed=true),
-    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
-            -12},{32,118}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
-           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
-    option_temperature=2,
-    T0={310},
-    W0={1e5})
-    annotation (Placement(transformation(
-        origin={-133,32},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
-    T0={310},
-    W0={0.286e6},
-    option_temperature=1)
-    annotation (Placement(transformation(
-        origin={-133,55},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters_Power(Table=[0,
-        Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.5; 1600,
-        Wch*7.5; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(
-          extent={{-175,19},{-149,45}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Ouv_FeedwaterValve_Spray(Table=[0,
-        OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.01;
-        300,OUVfeedwaterValve + 0.01; 400,0; 1000,0]) annotation (Placement(
-        transformation(extent={{-134,154},{-108,180}}, rotation=0)));
-equation
-  connect(sourceP.C, FeedwaterValve_Spray.C1)
-    annotation (Line(points={{-148,134},{-110,134}}, color={0,0,255}));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
-        color={0,0,255}));
-  connect(OuvSteamrValve.y, SteamValve.Ouv)
-    annotation (Line(points={{21,166},{68,166},{68,151}}));
-  connect(FeedwaterValve_Spray.C2, pressurizer.Cas)
-    annotation (Line(points={{-90,134},{-30,134},{-30,118}}, color={0,0,255}));
-  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
-          32,134},{58,134}}, color={0,0,255}));
-  connect(sinkQ1.C, lumpedStraightPipe.C2)
-    annotation (Line(points={{-30,-66},{-30,-52}}));
-  connect(lumpedStraightPipe.C1, pressurizer.Cex)
-    annotation (Line(points={{-30,-32},{-30,-12}}));
-  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
-          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
-  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
-          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
-  connect(Ouv_FeedwaterValve_Spray.y, FeedwaterValve_Spray.Ouv) annotation (
-      Line(points={{-106.7,167},{-100,167},{-100,151}}, color={0,0,255}));
-  connect(ElectricalHeaters_Power.y, SourceC1.ISignal)
-    annotation (Line(points={{-147.7,32},{-141.5,32}}, color={0,0,255}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestPressurizer2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestPressurizer2
+  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
+    "Power released by the electrical heaters";
+  parameter Real OUVfeedwaterValve( fixed=false)=0.01
+    "OUV feed water valve";
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve_Spray(
+    Cv(start=100),
+    C1(
+      P(start=160e5),
+      h_vol(start=1270e3),
+      Q(start=0.3),
+      h(start=1270e3)),
+    Q(fixed=false, start=0.32),
+    Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{-90,
+            150}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Cvmax(fixed=true) = 5000,
+    Pm(start=15500000))
+    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=1,
+    D=1,
+    z1=1,
+    z2=0,
+    mode=0,
+    C1(P(start=160e5)),
+    C2(P(start=160e5)),
+    Q(fixed=false, start=0))
+             annotation (Placement(transformation(
+        origin={-30,-42},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed=
+          true) = 0.5) annotation (Placement(transformation(extent={{0,156},{20,
+            176}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    h0=1270e3,
+    mode=0,
+    P0=160e5)
+           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
+    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
+           0)));
+  WaterSteam.Volumes.Pressurizer     pressurizer(
+    Zm=10.15,
+    Klv=0.5e6,
+    cpp=600,
+    hl(start=1629887.98290107),
+    hv(start=2596216.59571565),
+    Zl(start=5.5900717167325),
+    Yw0=60,
+    steady_state=true,
+    V=61.12,
+    Rp=1.27,
+    Ae=96.23,
+    Klp=1780,
+    Kvp=7500,
+    Mp=107e3,
+    Kpa=5.63,
+    Ccond=0.02,
+    Cevap=0.05,
+    Yw(start=32.92),
+    y(start=0.3292, fixed=true),
+    P0=15500000,
+    P(start=15500000, fixed=true),
+    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
+            -12},{32,118}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
+           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
+    option_temperature=2,
+    T0={310},
+    W0={1e5})
+    annotation (Placement(transformation(
+        origin={-133,32},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
+    T0={310},
+    W0={0.286e6},
+    option_temperature=1)
+    annotation (Placement(transformation(
+        origin={-133,55},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters_Power(Table=[0,
+        Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.5; 1600,
+        Wch*7.5; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(
+          extent={{-175,19},{-149,45}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Ouv_FeedwaterValve_Spray(Table=[0,
+        OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.01;
+        300,OUVfeedwaterValve + 0.01; 400,0; 1000,0]) annotation (Placement(
+        transformation(extent={{-134,154},{-108,180}}, rotation=0)));
+equation
+  connect(sourceP.C, FeedwaterValve_Spray.C1)
+    annotation (Line(points={{-148,134},{-110,134}}, color={0,0,255}));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
+        color={0,0,255}));
+  connect(OuvSteamrValve.y, SteamValve.Ouv)
+    annotation (Line(points={{21,166},{68,166},{68,151}}));
+  connect(FeedwaterValve_Spray.C2, pressurizer.Cas)
+    annotation (Line(points={{-90,134},{-30,134},{-30,118}}, color={0,0,255}));
+  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
+          32,134},{58,134}}, color={0,0,255}));
+  connect(sinkQ1.C, lumpedStraightPipe.C2)
+    annotation (Line(points={{-30,-66},{-30,-52}}));
+  connect(lumpedStraightPipe.C1, pressurizer.Cex)
+    annotation (Line(points={{-30,-32},{-30,-12}}));
+  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
+          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
+  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
+          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
+  connect(Ouv_FeedwaterValve_Spray.y, FeedwaterValve_Spray.Ouv) annotation (
+      Line(points={{-106.7,167},{-100,167},{-100,151}}, color={0,0,255}));
+  connect(ElectricalHeaters_Power.y, SourceC1.ISignal)
+    annotation (Line(points={{-147.7,32},{-141.5,32}}, color={0,0,255}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestPressurizer2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestPressurizer_CC.mo b/ThermoSysPro/Examples/SimpleExamples/TestPressurizer_CC.mo
index bee24a6f81ec13e9bb65969e152f3829d86e8571..d8afb03c603defea5a4d8a7913bbd58c0ca1d886 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestPressurizer_CC.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestPressurizer_CC.mo
@@ -1,179 +1,177 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestPressurizer_CC
-
-  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
-    "Power released by the electrical heaters";
-  parameter Real OUVfeedwaterValve( fixed=false)=0.01
-    "OUV feed water valve";
-
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve_Spray(
-    Cv(start=100),
-    C1(
-      P(start=160e5),
-      h_vol(start=1270e3),
-      Q(start=0.3),
-      h(start=1270e3)),
-    Q(fixed=false, start=0.32),
-    Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{-90,
-            150}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Cvmax(fixed=true) = 5000,
-    Pm(start=15500000))
-    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=1,
-    D=1,
-    z1=1,
-    z2=0,
-    mode=0,
-    C1(P(start=160e5)),
-    C2(P(start=160e5)),
-    Q(fixed=false, start=0))
-             annotation (Placement(transformation(
-        origin={-30,-42},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=
-          true) = 0.5) annotation (Placement(transformation(extent={{0,156},{20,
-            176}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    h0=1270e3,
-    mode=0,
-    P0=16000000)
-           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
-    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
-           0)));
-  WaterSteam.Volumes.Pressurizer     pressurizer(
-    Zm=10.15,
-    Klv=0.5e6,
-    cpp=600,
-    hl(start=1629887.98290107),
-    hv(start=2596216.59571565),
-    Zl(start=5.5900717167325),
-    Yw0=60,
-    steady_state=true,
-    V=61.12,
-    Rp=1.27,
-    Ae=96.23,
-    Klp=1780,
-    Kvp=7500,
-    Mp=107e3,
-    Kpa=5.63,
-    Ccond=0.02,
-    Cevap=0.05,
-    Yw(start=32.92),
-    y(start=0.3292, fixed=true),
-    P0=15500000,
-    P(start=15500000, fixed=true),
-    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
-            -12},{32,118}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
-           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
-    option_temperature=2,
-    T0={310},
-    W0={1e5})
-    annotation (Placement(transformation(
-        origin={-133,32},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
-    T0={310},
-    W0={0.286e6},
-    option_temperature=1)
-    annotation (Placement(transformation(
-        origin={-133,55},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,
-        Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,
-        Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(
-          extent={{-175,19},{-149,45}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,
-        OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005;
-        300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(
-        transformation(extent={{-134,154},{-108,180}}, rotation=0)));
-  Control.Drum_LevelControl regulation_Niveau(
-    Ti=50,
-    add(k1=+1, k2=-1),
-    minval=-100,
-    pIsat(
-      Limiteur1(u(signal(start=0.001))),
-      ureset0=0.0,
-      maxval=100,
-      Ti=2000)) annotation (Placement(transformation(extent={{52,-52},{24,-26}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92)
-    annotation (Placement(transformation(extent={{87,-56},{68,-37}}, rotation=0)));
-equation
-  connect(sourceP.C, FeedwaterValve_Spray.C1)
-    annotation (Line(points={{-148,134},{-110,134}}, color={0,0,255}));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
-        color={0,0,255}));
-  connect(SteamrValve_O.y, SteamValve.Ouv)
-    annotation (Line(points={{21,166},{68,166},{68,151}}));
-  connect(FeedwaterValve_Spray.C2, pressurizer.Cas)
-    annotation (Line(points={{-90,134},{-30,134},{-30,118}}, color={0,0,255}));
-  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
-          32,134},{58,134}}, color={0,0,255}));
-  connect(sinkQ1.C, lumpedStraightPipe.C2)
-    annotation (Line(points={{-30,-66},{-30,-52}}));
-  connect(lumpedStraightPipe.C1, pressurizer.Cex)
-    annotation (Line(points={{-30,-32},{-30,-12}}));
-  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
-          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
-  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
-          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
-  connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(
-        points={{-106.7,167},{-100,167},{-100,151}}, color={0,0,255}));
-  connect(ElectricalHeaters.y, SourceC1.ISignal)
-    annotation (Line(points={{-147.7,32},{-141.5,32}}, color={0,0,255}));
-  connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
-      points={{67.05,-46.5},{64,-46.5},{64,-46},{64,-48},{64,-46.8},{58,-46.8},
-          {52.7,-46.8}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-  connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (
-      Line(points={{25.8,53},{78,53},{78,-27.3},{52.7,-27.3}}, color={0,0,255}));
-  connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(
-        points={{23.3,-50.7},{-20,-50.7},{-20,-61}}, color={0,0,255}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    experiment(StopTime=3000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestPressurizer_CC;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestPressurizer_CC
+  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
+    "Power released by the electrical heaters";
+  parameter Real OUVfeedwaterValve( fixed=false)=0.01
+    "OUV feed water valve";
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve FeedwaterValve_Spray(
+    Cv(start=100),
+    C1(
+      P(start=160e5),
+      h_vol(start=1270e3),
+      Q(start=0.3),
+      h(start=1270e3)),
+    Q(fixed=false, start=0.32),
+    Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{-90,
+            150}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Cvmax(fixed=true) = 5000,
+    Pm(start=15500000))
+    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=1,
+    D=1,
+    z1=1,
+    z2=0,
+    mode=0,
+    C1(P(start=160e5)),
+    C2(P(start=160e5)),
+    Q(fixed=false, start=0))
+             annotation (Placement(transformation(
+        origin={-30,-42},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=
+          true) = 0.5) annotation (Placement(transformation(extent={{0,156},{20,
+            176}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    h0=1270e3,
+    mode=0,
+    P0=16000000)
+           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
+    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
+           0)));
+  WaterSteam.Volumes.Pressurizer     pressurizer(
+    Zm=10.15,
+    Klv=0.5e6,
+    cpp=600,
+    hl(start=1629887.98290107),
+    hv(start=2596216.59571565),
+    Zl(start=5.5900717167325),
+    Yw0=60,
+    steady_state=true,
+    V=61.12,
+    Rp=1.27,
+    Ae=96.23,
+    Klp=1780,
+    Kvp=7500,
+    Mp=107e3,
+    Kpa=5.63,
+    Ccond=0.02,
+    Cevap=0.05,
+    Yw(start=32.92),
+    y(start=0.3292, fixed=true),
+    P0=15500000,
+    P(start=15500000, fixed=true),
+    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
+            -12},{32,118}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
+           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
+    option_temperature=2,
+    T0={310},
+    W0={1e5})
+    annotation (Placement(transformation(
+        origin={-133,32},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
+    T0={310},
+    W0={0.286e6},
+    option_temperature=1)
+    annotation (Placement(transformation(
+        origin={-133,55},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,
+        Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,
+        Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(
+          extent={{-175,19},{-149,45}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,
+        OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005;
+        300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(
+        transformation(extent={{-134,154},{-108,180}}, rotation=0)));
+  Control.Drum_LevelControl regulation_Niveau(
+    Ti=50,
+    add(k1=+1, k2=-1),
+    minval=-100,
+    pIsat(
+      Limiteur1(u(signal(start=0.001))),
+      ureset0=0.0,
+      maxval=100,
+      Ti=2000)) annotation (Placement(transformation(extent={{52,-52},{24,-26}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92)
+    annotation (Placement(transformation(extent={{87,-56},{68,-37}}, rotation=0)));
+equation
+  connect(sourceP.C, FeedwaterValve_Spray.C1)
+    annotation (Line(points={{-148,134},{-110,134}}, color={0,0,255}));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
+        color={0,0,255}));
+  connect(SteamrValve_O.y, SteamValve.Ouv)
+    annotation (Line(points={{21,166},{68,166},{68,151}}));
+  connect(FeedwaterValve_Spray.C2, pressurizer.Cas)
+    annotation (Line(points={{-90,134},{-30,134},{-30,118}}, color={0,0,255}));
+  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
+          32,134},{58,134}}, color={0,0,255}));
+  connect(sinkQ1.C, lumpedStraightPipe.C2)
+    annotation (Line(points={{-30,-66},{-30,-52}}));
+  connect(lumpedStraightPipe.C1, pressurizer.Cex)
+    annotation (Line(points={{-30,-32},{-30,-12}}));
+  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
+          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
+  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
+          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
+  connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(
+        points={{-106.7,167},{-100,167},{-100,151}}, color={0,0,255}));
+  connect(ElectricalHeaters.y, SourceC1.ISignal)
+    annotation (Line(points={{-147.7,32},{-141.5,32}}, color={0,0,255}));
+  connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
+      points={{67.05,-46.5},{64,-46.5},{64,-46},{64,-48},{64,-46.8},{58,-46.8},
+          {52.7,-46.8}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+  connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (
+      Line(points={{25.8,53},{78,53},{78,-27.3},{52.7,-27.3}}, color={0,0,255}));
+  connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(
+        points={{23.3,-50.7},{-20,-50.7},{-20,-61}}, color={0,0,255}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    experiment(StopTime=3000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestPressurizer_CC;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestRefP.mo b/ThermoSysPro/Examples/SimpleExamples/TestRefP.mo
index d5970d070cbe163f08a72640bb9c04c9125e6b56..087db0474fec6a4ad474c8c18729b70b91c261fe 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestRefP.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestRefP.mo
@@ -1,58 +1,57 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestRefP
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefP refP
-    annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(
-                                                 k=2.e5)
-    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump pump
-    annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerQ loopBreakerQ
-    annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerH loopBreakerH
-    annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefT refT
-    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe
-    annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0)));
-equation
-  connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color=
-          {0,0,255}));
-  connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color=
-          {0,0,255}));
-  connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,
-          70},{-60,34},{-80,34},{-80,21}}));
-  connect(lumpedStraightPipe.C2, refP.C1) annotation (Line(points={{80,10},{100,
-          10},{100,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,255}));
-  connect(pump.C2, loopBreakerQ.C1)
-    annotation (Line(points={{-10,10},{0,10}}, color={0,0,255}));
-  connect(loopBreakerQ.C2, loopBreakerH.C1)
-    annotation (Line(points={{20,10},{30,10}}, color={0,0,255}));
-  connect(loopBreakerH.C2, lumpedStraightPipe.C1)
-    annotation (Line(points={{50,10},{60,10}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestRefP;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestRefP
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefP refP
+    annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(
+                                                 k=2.e5)
+    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump pump
+    annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerQ loopBreakerQ
+    annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerH loopBreakerH
+    annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefT refT
+    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe
+    annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0)));
+equation
+  connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color=
+          {0,0,255}));
+  connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color=
+          {0,0,255}));
+  connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,
+          70},{-60,34},{-80,34},{-80,21}}));
+  connect(lumpedStraightPipe.C2, refP.C1) annotation (Line(points={{80,10},{100,
+          10},{100,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,255}));
+  connect(pump.C2, loopBreakerQ.C1)
+    annotation (Line(points={{-10,10},{0,10}}, color={0,0,255}));
+  connect(loopBreakerQ.C2, loopBreakerH.C1)
+    annotation (Line(points={{20,10},{30,10}}, color={0,0,255}));
+  connect(loopBreakerH.C2, lumpedStraightPipe.C1)
+    annotation (Line(points={{50,10},{60,10}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestRefP;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSensors.mo b/ThermoSysPro/Examples/SimpleExamples/TestSensors.mo
index 3271e0f8d2ede19b8ce65ae28e87cb43eb8941fc..e1cb7e46ba3ff170ddaaac5980ac44ea512d1990 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSensors.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSensors.mo
@@ -1,61 +1,60 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSensors
-
-  ThermoSysPro.WaterSteam.Sensors.SensorH specificEnthalpySensor
-    annotation (Placement(transformation(extent={{-60,8},{-40,28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ massFlowSensor
-    annotation (Placement(transformation(extent={{-20,8},{0,28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQv volumetricFlowSensor
-    annotation (Placement(transformation(extent={{20,8},{40,28}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorP pressureSensor
-    annotation (Placement(transformation(extent={{-60,-32},{-40,-12}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorT temperatureSensor
-    annotation (Placement(transformation(extent={{-20,-32},{0,-12}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
-                                         annotation (Placement(transformation(
-          extent={{60,-40},{80,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-                                           annotation (Placement(transformation(
-          extent={{-100,0},{-80,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP
-    annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0)));
-equation
-  connect(sourceP.C, specificEnthalpySensor.C1)
-    annotation (Line(points={{-80,10},{-60,10}}, color={0,0,255}));
-  connect(specificEnthalpySensor.C2, massFlowSensor.C1)
-    annotation (Line(points={{-39.8,10},{-20,10}}, color={0,0,255}));
-  connect(massFlowSensor.C2, volumetricFlowSensor.C1)
-    annotation (Line(points={{0.2,10},{20,10}}, color={0,0,255}));
-  connect(volumetricFlowSensor.C2, pressureSensor.C1) annotation (Line(points={
-          {40.2,10},{60,10},{60,0},{-80,0},{-80,-30},{-60,-30}}, color={0,0,255}));
-  connect(pressureSensor.C2, temperatureSensor.C1) annotation (Line(points={{
-          -39.8,-30},{-20,-30}}, color={0,0,255}));
-  connect(temperatureSensor.C2, perteDP.C1)
-    annotation (Line(points={{0.2,-30},{20,-30}}, color={0,0,255}));
-  connect(perteDP.C2, puitsP.C)
-    annotation (Line(points={{40,-30},{60,-30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSensors;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSensors
+  ThermoSysPro.WaterSteam.Sensors.SensorH specificEnthalpySensor
+    annotation (Placement(transformation(extent={{-60,8},{-40,28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ massFlowSensor
+    annotation (Placement(transformation(extent={{-20,8},{0,28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQv volumetricFlowSensor
+    annotation (Placement(transformation(extent={{20,8},{40,28}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorP pressureSensor
+    annotation (Placement(transformation(extent={{-60,-32},{-40,-12}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorT temperatureSensor
+    annotation (Placement(transformation(extent={{-20,-32},{0,-12}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
+                                         annotation (Placement(transformation(
+          extent={{60,-40},{80,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+                                           annotation (Placement(transformation(
+          extent={{-100,0},{-80,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP
+    annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0)));
+equation
+  connect(sourceP.C, specificEnthalpySensor.C1)
+    annotation (Line(points={{-80,10},{-60,10}}, color={0,0,255}));
+  connect(specificEnthalpySensor.C2, massFlowSensor.C1)
+    annotation (Line(points={{-39.8,10},{-20,10}}, color={0,0,255}));
+  connect(massFlowSensor.C2, volumetricFlowSensor.C1)
+    annotation (Line(points={{0.2,10},{20,10}}, color={0,0,255}));
+  connect(volumetricFlowSensor.C2, pressureSensor.C1) annotation (Line(points={
+          {40.2,10},{60,10},{60,0},{-80,0},{-80,-30},{-60,-30}}, color={0,0,255}));
+  connect(pressureSensor.C2, temperatureSensor.C1) annotation (Line(points={{
+          -39.8,-30},{-20,-30}}, color={0,0,255}));
+  connect(temperatureSensor.C2, perteDP.C1)
+    annotation (Line(points={{0.2,-30},{20,-30}}, color={0,0,255}));
+  connect(perteDP.C2, puitsP.C)
+    annotation (Line(points={{40,-30},{60,-30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSensors;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo
index 1dc598b4a5c48ac9fe898bac34701d8efb54917c..5298c3ae4809bf0017adc75d43e4d01094b09a4a 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo
@@ -1,68 +1,66 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSimpleEvaporatorWaterSteamFlueGases
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink puits_Eau
-                                          annotation (Placement(transformation(
-          extent={{64,-17},{84,3}}, rotation=0)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases
-    EchangeurEfficacite(Kdpf=1, Kdpe=1)
-                annotation (Placement(transformation(extent={{-44,-35},{44,21}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ source_Eau(
-    P0=65.27e5,
-    Q0=38.92/3.6,
-    h0=1242080)
-              annotation (Placement(transformation(extent={{-84,-17},{-64,3}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
-    Xso2=0,
-    P0=1.01e5,
-    Q0=86.7429,
-    T0=750.54,
-    Xco2=0.04725,
-    Xh2o=0.051874,
-    Xo2=0.15011)
-    annotation (Placement(transformation(extent={{-34,45},{0,75}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
-    annotation (Placement(transformation(
-        origin={16,-70},
-        extent={{16,-15},{-16,15}},
-        rotation=180)));
-equation
-  connect(Source_Fumees.C, EchangeurEfficacite.Cfg1) annotation (Line(
-      points={{0,60},{0,18.2}},
-      color={0,0,0},
-      thickness=1));
-  connect(EchangeurEfficacite.Cfg2, Puits_Fumees.C) annotation (Line(
-      points={{0,-32.2},{0,-70},{0.32,-70}},
-      color={0,0,0},
-      thickness=1));
-  connect(EchangeurEfficacite.Cws2, puits_Eau.C) annotation (Line(points={{44,
-          -7},{54,-7},{54,-7},{64,-7}}, color={0,0,255}));
-  connect(EchangeurEfficacite.Cws1, source_Eau.C)
-    annotation (Line(points={{-44,-7},{-54,-7},{-54,-7},{-64,-7}}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSimpleEvaporatorWaterSteamFlueGases;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSimpleEvaporatorWaterSteamFlueGases
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink puits_Eau
+                                          annotation (Placement(transformation(
+          extent={{64,-17},{84,3}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases
+    EchangeurEfficacite(Kdpf=1, Kdpe=1)
+                annotation (Placement(transformation(extent={{-44,-35},{44,21}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ source_Eau(
+    P0=65.27e5,
+    Q0=38.92/3.6,
+    h0=1242080)
+              annotation (Placement(transformation(extent={{-84,-17},{-64,3}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
+    Xso2=0,
+    P0=1.01e5,
+    Q0=86.7429,
+    T0=750.54,
+    Xco2=0.04725,
+    Xh2o=0.051874,
+    Xo2=0.15011)
+    annotation (Placement(transformation(extent={{-34,45},{0,75}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
+    annotation (Placement(transformation(
+        origin={16,-70},
+        extent={{16,-15},{-16,15}},
+        rotation=180)));
+equation
+  connect(Source_Fumees.C, EchangeurEfficacite.Cfg1) annotation (Line(
+      points={{0,60},{0,18.2}},
+      color={0,0,0},
+      thickness=1));
+  connect(EchangeurEfficacite.Cfg2, Puits_Fumees.C) annotation (Line(
+      points={{0,-32.2},{0,-70},{0.32,-70}},
+      color={0,0,0},
+      thickness=1));
+  connect(EchangeurEfficacite.Cws2, puits_Eau.C) annotation (Line(points={{44,
+          -7},{54,-7},{54,-7},{64,-7}}, color={0,0,255}));
+  connect(EchangeurEfficacite.Cws1, source_Eau.C)
+    annotation (Line(points={{-44,-7},{-54,-7},{-54,-7},{-64,-7}}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSimpleEvaporatorWaterSteamFlueGases;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSimpleStaticCondenser.mo b/ThermoSysPro/Examples/SimpleExamples/TestSimpleStaticCondenser.mo
index f2270856e6c9b418325361f73c6d9b656b263978..25942cba1e6c0f4aa0b8dd61dc5d1cfc16aa8c16 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSimpleStaticCondenser.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSimpleStaticCondenser.mo
@@ -1,53 +1,52 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSimpleStaticCondenser
-
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleStaticCondenser
-    simpleStaticCondenser(
-    Ec(h(start=532983.7176868258)),
-    Ef(h(start=71016.12237181116)),
-    Qc(start=1049.6385508765125),
-    Qf(start=4469.84281279143),
-    Sf(h(start=64330.208038325145)))
-                          annotation (Placement(transformation(extent={{-20,20},
-            {0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(T0=400)
-    annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0)));
-equation
-  connect(sourceP.C, simpleStaticCondenser.Ef) annotation (Line(points={{-40,30},
-          {-20,30}}, color={0,0,255}));
-  connect(sourceP1.C, simpleStaticCondenser.Ec) annotation (Line(points={{-40,
-          -10},{-16,-10},{-16,20}}, color={0,0,255}));
-  connect(simpleStaticCondenser.Sf, sinkP.C) annotation (Line(points={{0,29.9},
-          {10,29.9},{10,30},{20,30}}, color={0,0,255}));
-  connect(simpleStaticCondenser.Sc, sinkP1.C) annotation (Line(points={{-4,20},
-          {-4,-10},{20,-10}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSimpleStaticCondenser;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSimpleStaticCondenser
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleStaticCondenser
+    simpleStaticCondenser(
+    Ec(h(start=532983.7176868258)),
+    Ef(h(start=71016.12237181116)),
+    Qc(start=1049.6385508765125),
+    Qf(start=4469.84281279143),
+    Sf(h(start=64330.208038325145)))
+                          annotation (Placement(transformation(extent={{-20,20},
+            {0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(T0=400)
+    annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0)));
+equation
+  connect(sourceP.C, simpleStaticCondenser.Ef) annotation (Line(points={{-40,30},
+          {-20,30}}, color={0,0,255}));
+  connect(sourceP1.C, simpleStaticCondenser.Ec) annotation (Line(points={{-40,
+          -10},{-16,-10},{-16,20}}, color={0,0,255}));
+  connect(simpleStaticCondenser.Sf, sinkP.C) annotation (Line(points={{0,29.9},
+          {10,29.9},{10,30},{20,30}}, color={0,0,255}));
+  connect(simpleStaticCondenser.Sc, sinkP1.C) annotation (Line(points={{-4,20},
+          {-4,-10},{20,-10}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSimpleStaticCondenser;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSingularPressureLoss.mo b/ThermoSysPro/Examples/SimpleExamples/TestSingularPressureLoss.mo
index d710cef15d4099744c5e0a357d6d0a4fc1c598a3..d0c3e77628adcf815bc5ffed5a70c14c1ac0b439 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSingularPressureLoss.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSingularPressureLoss.mo
@@ -1,51 +1,50 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSingularPressureLoss
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss(                                                          fluid=1)
-                                          annotation (Placement(transformation(
-          extent={{-20,20},{0,40}}, rotation=0)));
-equation
-  connect(singularPressureLoss.C2, PuitsP1.C)
-    annotation (Line(points={{0,30},{60,30}}, color={0,0,255}));
-  connect(SourceP1.C, singularPressureLoss.C1)
-    annotation (Line(points={{-80,30},{-20,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-   Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSingularPressureLoss;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSingularPressureLoss
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss(                                                          fluid=1)
+                                          annotation (Placement(transformation(
+          extent={{-20,20},{0,40}}, rotation=0)));
+equation
+  connect(singularPressureLoss.C2, PuitsP1.C)
+    annotation (Line(points={{0,30},{60,30}}, color={0,0,255}));
+  connect(SourceP1.C, singularPressureLoss.C1)
+    annotation (Line(points={{-80,30},{-20,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+   Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSingularPressureLoss;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump.mo
index 5b7ffd0c3ba6f6a7bb3c56f16277ddebee5cfbbf..0c451f5a5f93cc5a88f6a0901caf0f91d8f51d39 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump.mo
@@ -1,64 +1,63 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticCentrifugalPump
-
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump StaticCentrifugalPump1
-    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
-                                        ze2=10, zs2=10)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
-                                                  k=0.5) annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    width=200,
-    period=500,
-    amplitude=1400,
-    offset=0)   annotation (Placement(transformation(extent={{-40,-70},{-20,-50}},
-          rotation=0)));
-equation
-  connect(StaticCentrifugalPump1.C2, Bache1.Ce2)
-    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
-          255}));
-  connect(Bache1.Cs2, VanneReglante1.C1)
-    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
-  connect(VanneReglante1.C2, StaticCentrifugalPump1.C1)
-    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
-  connect(Constante1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
-  connect(pulse.y, StaticCentrifugalPump1.rpm_or_mpower)
-    annotation (Line(points={{-19,-60},{-10,-60},{-10,-41}}, smooth=Smooth.None));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticCentrifugalPump;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticCentrifugalPump
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump StaticCentrifugalPump1
+    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
+                                        ze2=10, zs2=10)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
+                                                  k=0.5) annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    width=200,
+    period=500,
+    amplitude=1400,
+    offset=0)   annotation (Placement(transformation(extent={{-40,-70},{-20,-50}},
+          rotation=0)));
+equation
+  connect(StaticCentrifugalPump1.C2, Bache1.Ce2)
+    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
+          255}));
+  connect(Bache1.Cs2, VanneReglante1.C1)
+    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
+  connect(VanneReglante1.C2, StaticCentrifugalPump1.C1)
+    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
+  connect(Constante1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
+  connect(pulse.y, StaticCentrifugalPump1.rpm_or_mpower)
+    annotation (Line(points={{-19,-60},{-10,-60},{-10,-41}}, smooth=Smooth.None));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticCentrifugalPump;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo
index b86dd78d1a6c7099d22211b05f91855bb9d7ab8c..deb7cfee75ea41564b89608c3719ba08b18dd362 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo
@@ -1,52 +1,51 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticCentrifugalPump1
-
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump StaticCentrifugalPump1(
-      fixed_rot_or_power=2, MPower=0.15e6)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP sinkP(P0=600000)
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-equation
-  connect(sourceP.C, StaticCentrifugalPump1.C1) annotation (Line(
-      points={{-60,30},{-20,30}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(StaticCentrifugalPump1.C2, sinkP.C) annotation (Line(
-      points={{0,30},{40,30}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticCentrifugalPump1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticCentrifugalPump1
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump StaticCentrifugalPump1(
+      fixed_rot_or_power=2, MPower=0.15e6)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP sinkP(P0=600000)
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+equation
+  connect(sourceP.C, StaticCentrifugalPump1.C1) annotation (Line(
+      points={{-60,30},{-20,30}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(StaticCentrifugalPump1.C2, sinkP.C) annotation (Line(
+      points={{0,30},{40,30}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticCentrifugalPump1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump2.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump2.mo
index c18a2b60231052ada666fb08e600d8f6a8e785c1..655b9643fd6bd886d37f86600e9772a48e81920d 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPump2.mo
@@ -1,67 +1,66 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticCentrifugalPump2
-
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump StaticCentrifugalPump1(
-      fixed_rot_or_power=2)
-    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
-                                        ze2=10, zs2=10)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
-                                                  k=0.5) annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    width=200,
-    period=500,
-    amplitude=0.5e5,
-    startTime=0,
-    offset=1000)
-                annotation (Placement(transformation(extent={{-80,-70},{-60,-50}},
-          rotation=0)));
-equation
-  connect(StaticCentrifugalPump1.C2, Bache1.Ce2)
-    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
-          255}));
-  connect(Bache1.Cs2, VanneReglante1.C1)
-    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
-  connect(VanneReglante1.C2, StaticCentrifugalPump1.C1)
-    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
-  connect(Constante1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
-  connect(pulse.y, StaticCentrifugalPump1.rpm_or_mpower)
-    annotation (Line(points={{-59,-60},{-10,-60},{-10,-41}}, smooth=Smooth.None));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticCentrifugalPump2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticCentrifugalPump2
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump StaticCentrifugalPump1(
+      fixed_rot_or_power=2)
+    annotation (Placement(transformation(extent={{0,-40},{-20,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
+                                        ze2=10, zs2=10)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
+                                                  k=0.5) annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    width=200,
+    period=500,
+    amplitude=0.5e5,
+    startTime=0,
+    offset=1000)
+                annotation (Placement(transformation(extent={{-80,-70},{-60,-50}},
+          rotation=0)));
+equation
+  connect(StaticCentrifugalPump1.C2, Bache1.Ce2)
+    annotation (Line(points={{-20,-30},{-60,-30},{-60,24},{-20,24}}, color={0,0,
+          255}));
+  connect(Bache1.Cs2, VanneReglante1.C1)
+    annotation (Line(points={{0,24},{40,24}}, color={0,0,255}));
+  connect(VanneReglante1.C2, StaticCentrifugalPump1.C1)
+    annotation (Line(points={{60,24},{80,24},{80,-30},{0,-30}}, color={0,0,255}));
+  connect(Constante1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{21,70},{50,70},{50,41}}, color={0,0,255}));
+  connect(pulse.y, StaticCentrifugalPump1.rpm_or_mpower)
+    annotation (Line(points={{-59,-60},{-10,-60},{-10,-41}}, smooth=Smooth.None));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticCentrifugalPump2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPumpWaterSolution.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPumpWaterSolution.mo
index c9dc38991774ab0b178a9833b402132826b118d7..039f91298d90ed9f7b38b561ab5ed6f4d560ef23 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPumpWaterSolution.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticCentrifugalPumpWaterSolution.mo
@@ -1,66 +1,65 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticCentrifugalPumpWaterSolution
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
-                                          width=200, period=400)
-    annotation (Placement(transformation(extent={{-40,60},{-20,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    width=200,
-    period=500,
-    amplitude=1000,
-    offset=400) annotation (Placement(transformation(extent={{-40,0},{-20,20}},
-          rotation=0)));
-  ThermoSysPro.WaterSolution.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterLiBr annotation (Placement(transformation(extent={
-            {40,30},{60,50}}, rotation=0)));
-  ThermoSysPro.WaterSolution.Machines.StaticCentrifugalPump
-    staticCentrifugalPumpWaterLiBr annotation (Placement(transformation(extent=
-            {{0,30},{20,50}}, rotation=0)));
-  ThermoSysPro.WaterSolution.BoundaryConditions.SourcePQ sourceSolution
-    annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0)));
-  ThermoSysPro.WaterSolution.BoundaryConditions.Sink sinkSolution
-    annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0)));
-equation
-  connect(pulse.y, staticCentrifugalPumpWaterLiBr.VRotation) annotation (Line(
-        points={{-19,10},{10,10},{10,29}}));
-  connect(Pulse1.yL, staticCentrifugalPumpWaterLiBr.commandePompe) annotation (Line(
-        points={{-19,70},{10,70},{10,51}}));
-  connect(staticCentrifugalPumpWaterLiBr.C2, singularPressureLossWaterLiBr.C1)
-    annotation (Line(points={{20,40},{30,40},{30,40},{41,40}}, color={0,0,0}));
-  connect(sourceSolution.Cs, staticCentrifugalPumpWaterLiBr.C1)
-    annotation (Line(points={{-60,40},{0,40}}, color={0,0,0}));
-  connect(singularPressureLossWaterLiBr.C2, sinkSolution.Ce)
-    annotation (Line(points={{59,40},{80,40}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticCentrifugalPumpWaterSolution;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticCentrifugalPumpWaterSolution
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse Pulse1(
+                                          width=200, period=400)
+    annotation (Placement(transformation(extent={{-40,60},{-20,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    width=200,
+    period=500,
+    amplitude=1000,
+    offset=400) annotation (Placement(transformation(extent={{-40,0},{-20,20}},
+          rotation=0)));
+  ThermoSysPro.WaterSolution.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterLiBr annotation (Placement(transformation(extent={
+            {40,30},{60,50}}, rotation=0)));
+  ThermoSysPro.WaterSolution.Machines.StaticCentrifugalPump
+    staticCentrifugalPumpWaterLiBr annotation (Placement(transformation(extent=
+            {{0,30},{20,50}}, rotation=0)));
+  ThermoSysPro.WaterSolution.BoundaryConditions.SourcePQ sourceSolution
+    annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0)));
+  ThermoSysPro.WaterSolution.BoundaryConditions.Sink sinkSolution
+    annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0)));
+equation
+  connect(pulse.y, staticCentrifugalPumpWaterLiBr.VRotation) annotation (Line(
+        points={{-19,10},{10,10},{10,29}}));
+  connect(Pulse1.yL, staticCentrifugalPumpWaterLiBr.commandePompe) annotation (Line(
+        points={{-19,70},{10,70},{10,51}}));
+  connect(staticCentrifugalPumpWaterLiBr.C2, singularPressureLossWaterLiBr.C1)
+    annotation (Line(points={{20,40},{30,40},{30,40},{41,40}}, color={0,0,0}));
+  connect(sourceSolution.Cs, staticCentrifugalPumpWaterLiBr.C1)
+    annotation (Line(points={{-60,40},{0,40}}, color={0,0,0}));
+  connect(singularPressureLossWaterLiBr.C2, sinkSolution.Ce)
+    annotation (Line(points={{59,40},{80,40}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticCentrifugalPumpWaterSolution;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticCondenser.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticCondenser.mo
index 3880bb95c158528062cb21f058fb23cbc29db689..1219c262db2ab9b7d1831c38650f7bf190fe86ca 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticCondenser.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticCondenser.mo
@@ -1,127 +1,124 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticCondenser
-
-  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000)
-    "Flow pressure at inlet 1 (sourceP)";
-  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000)
-    "Flow pressure at inlet 2 (sourceP1)";
-  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000)
-    "Flow pressure at inlet 3 (sourceP2)";
-
-  WaterSteam.BoundaryConditions.SourceQ Source_condenseur(
-    h0=60e3, Q0(fixed=true) = 4000)
-          annotation (Placement(transformation(extent={{-180,0},{-160,20}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SinkP Puit_condenseur
-             annotation (Placement(transformation(extent={{160,0},{180,20}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticCondenser condenseur(
-    CPCE=0,
-    KCO=100,
-    QC0=200,
-    z=5,
-    SCO=15e3,
-    Qee(start=4000, fixed=false),
-    Pcond(fixed=false, start=2154.77))     annotation (Placement(transformation(
-          extent={{-20,-16},{72,82}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    option_temperature=2,
-    mode=0,
-    h0=2.5817e6,
-    C(Q(fixed=true, start=100)),
-    P0=Pin_1)
-            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    option_temperature=2,
-    mode=0,
-    h0=2.5481e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_2)                     annotation (Placement(transformation(extent={
-            {-182,80},{-162,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
-    option_temperature=2,
-    mode=0,
-    h0=2.5055e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_3)                      annotation (Placement(transformation(extent=
-            {{-180,40},{-160,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss(K=10)
-                         annotation (Placement(transformation(extent={{-100,80},
-            {-80,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=10)
-                          annotation (Placement(transformation(extent={{-100,40},
-            {-80,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2(K=1e-4)
-                          annotation (Placement(transformation(extent={{-100,0},
-            {-80,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=10)
-                          annotation (Placement(transformation(extent={{-40,140},
-            {-20,160}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4)
-                          annotation (Placement(transformation(extent={{100,0},
-            {120,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4)
-                          annotation (Placement(transformation(extent={{40,-100},
-            {60,-80}}, rotation=0)));
-
-equation
-  connect(sourceP1.C, singularPressureLoss.C1)
-    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
-          -80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255}));
-  connect(sourceP2.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
-          -80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255}));
-  connect(Source_condenseur.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{
-          -80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{
-          -20,150},{26,150},{26,82.49}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, Puit_condenseur.C)
-    annotation (Line(points={{120,10},{160,10}}, color={0,0,255}));
-  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
-          72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
-    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
-  connect(singularPressureLoss5.C1, condenseur.Cex)
-    annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16.98}}));
-  annotation (experiment(StopTime=1000), Diagram(graphics,
-                                                 coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticCondenser;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticCondenser
+  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000)
+    "Flow pressure at inlet 1 (sourceP)";
+  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000)
+    "Flow pressure at inlet 2 (sourceP1)";
+  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000)
+    "Flow pressure at inlet 3 (sourceP2)";
+  WaterSteam.BoundaryConditions.SourceQ Source_condenseur(
+    h0=60e3, Q0(fixed=true) = 4000)
+          annotation (Placement(transformation(extent={{-180,0},{-160,20}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SinkP Puit_condenseur
+             annotation (Placement(transformation(extent={{160,0},{180,20}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticCondenser condenseur(
+    CPCE=0,
+    KCO=100,
+    QC0=200,
+    z=5,
+    SCO=15e3,
+    Qee(start=4000, fixed=false),
+    Pcond(fixed=false, start=2154.77))     annotation (Placement(transformation(
+          extent={{-20,-16},{72,82}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    option_temperature=2,
+    mode=0,
+    h0=2.5817e6,
+    C(Q(fixed=true, start=100)),
+    P0=Pin_1)
+            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    option_temperature=2,
+    mode=0,
+    h0=2.5481e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_2)                     annotation (Placement(transformation(extent={
+            {-182,80},{-162,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
+    option_temperature=2,
+    mode=0,
+    h0=2.5055e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_3)                      annotation (Placement(transformation(extent=
+            {{-180,40},{-160,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss(K=10)
+                         annotation (Placement(transformation(extent={{-100,80},
+            {-80,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=10)
+                          annotation (Placement(transformation(extent={{-100,40},
+            {-80,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2(K=1e-4)
+                          annotation (Placement(transformation(extent={{-100,0},
+            {-80,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=10)
+                          annotation (Placement(transformation(extent={{-40,140},
+            {-20,160}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4)
+                          annotation (Placement(transformation(extent={{100,0},
+            {120,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4)
+                          annotation (Placement(transformation(extent={{40,-100},
+            {60,-80}}, rotation=0)));
+equation
+  connect(sourceP1.C, singularPressureLoss.C1)
+    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
+          -80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255}));
+  connect(sourceP2.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
+          -80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255}));
+  connect(Source_condenseur.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{
+          -80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{
+          -20,150},{26,150},{26,82.49}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, Puit_condenseur.C)
+    annotation (Line(points={{120,10},{160,10}}, color={0,0,255}));
+  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
+          72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
+    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
+  connect(singularPressureLoss5.C1, condenseur.Cex)
+    annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16.98}}));
+  annotation (experiment(StopTime=1000), Diagram(graphics,
+                                                 coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticCondenser;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum1.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum1.mo
index 7c2a84a917a27f79f3c10b3536dcb8abac019c68..72743f06d0966f9095bfd5dd79a78dad1cd092f1 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum1.mo
@@ -1,88 +1,87 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticDrum1
-
-  ThermoSysPro.WaterSteam.Junctions.StaticDrum StaticDrumTh1
-    annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI1(K=1e-4)
-    annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI2(K=1e-4)
-    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP1(Q0=10)
-    annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT
-    annotation (Placement(transformation(extent={{10,-82},{30,-62}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    option_temperature=2,
-    W0={2.4e8},
-    T0={290})   annotation (Placement(transformation(extent={{-80,20},{-60,40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI3(K=1e-4)
-    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP2
-    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT1
-    annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefP refP(P0=3e5)
-    annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=100)
-    annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.PlugA sourcePlug(C(h(fixed=true)))
-    annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=
-           0)));
-equation
-  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
-                                                          annotation (Line(
-        points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255}));
-  connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,
-          0},{40,0}}, color={0,0,255}));
-  connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{
-          30.2,-80},{40,-80},{40,-60},{-80,-60},{-80,-40}}, color={0,0,255}));
-  connect(heatSource.C[1], StaticDrumTh1.Cth)
-                                          annotation (Line(points={{-70,20.2},{
-          -70,10},{-44,10}}, color={191,95,0}));
-  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1)
-                                                           annotation (Line(
-        points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255}));
-  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
-                                                          annotation (Line(
-        points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255}));
-  connect(singularPressureLossVALI3.C2, sensorT1.C1)
-    annotation (Line(points={{0,60},{20,60}}, color={0,0,255}));
-  connect(sensorT1.C2, sinkP2.C)
-    annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255}));
-  connect(refP.C2, sensorT.C1) annotation (Line(points={{-6,-80},{10,-80}},
-        color={0,0,255}));
-  connect(refQ.C2, refP.C1) annotation (Line(points={{-36,-80},{-26,-80}},
-        color={0,0,255}));
-  connect(sourcePlug.C, refQ.C1) annotation (Line(points={{-70,-80},{-56,-80}},
-        color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticDrum1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticDrum1
+  ThermoSysPro.WaterSteam.Junctions.StaticDrum StaticDrumTh1
+    annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI1(K=1e-4)
+    annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI2(K=1e-4)
+    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP1(Q0=10)
+    annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT
+    annotation (Placement(transformation(extent={{10,-82},{30,-62}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    option_temperature=2,
+    W0={2.4e8},
+    T0={290})   annotation (Placement(transformation(extent={{-80,20},{-60,40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI3(K=1e-4)
+    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP2
+    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT1
+    annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefP refP(P0=3e5)
+    annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ refQ(Q0=100)
+    annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.PlugA sourcePlug(C(h(fixed=true)))
+    annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=
+           0)));
+equation
+  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
+                                                          annotation (Line(
+        points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255}));
+  connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,
+          0},{40,0}}, color={0,0,255}));
+  connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{
+          30.2,-80},{40,-80},{40,-60},{-80,-60},{-80,-40}}, color={0,0,255}));
+  connect(heatSource.C[1], StaticDrumTh1.Cth)
+                                          annotation (Line(points={{-70,20.2},{
+          -70,10},{-44,10}}, color={191,95,0}));
+  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1)
+                                                           annotation (Line(
+        points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255}));
+  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
+                                                          annotation (Line(
+        points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255}));
+  connect(singularPressureLossVALI3.C2, sensorT1.C1)
+    annotation (Line(points={{0,60},{20,60}}, color={0,0,255}));
+  connect(sensorT1.C2, sinkP2.C)
+    annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255}));
+  connect(refP.C2, sensorT.C1) annotation (Line(points={{-6,-80},{10,-80}},
+        color={0,0,255}));
+  connect(refQ.C2, refP.C1) annotation (Line(points={{-36,-80},{-26,-80}},
+        color={0,0,255}));
+  connect(sourcePlug.C, refQ.C1) annotation (Line(points={{-70,-80},{-56,-80}},
+        color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticDrum1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum2.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum2.mo
index cfe2a10d115c3a8359899267089be005f9516954..ae718307439722a7f641f04d0cc3ce91c2b21164 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum2.mo
@@ -1,77 +1,76 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticDrum2
-
-  ThermoSysPro.WaterSteam.Junctions.StaticDrum StaticDrumTh1
-    annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI1(K=1e-4)
-    annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI2(K=1e-4)
-    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP1(Q0=10)
-    annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT
-    annotation (Placement(transformation(extent={{-40,-82},{-20,-62}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(P0=100e5)
-    annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=
-           0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
-                                    annotation (Placement(transformation(extent=
-           {{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI3(K=1e-4)
-    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP2
-    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT1
-    annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0)));
-equation
-  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
-                                                          annotation (Line(
-        points={{-60,-40},{-48,-40},{-48,0.6}}, color={0,0,255}));
-  connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,
-          0},{40,0}}, color={0,0,255}));
-  connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{
-          -19.8,-80},{-10,-80},{-10,-54},{-80,-54},{-80,-40}}, color={0,0,255}));
-  connect(sourcePQ.C, sensorT.C1) annotation (Line(points={{-70,-80},{-40,-80}},
-        color={0,0,255}));
-  connect(heatSource.C[1], StaticDrumTh1.Cth)
-                                          annotation (Line(points={{-70,20.2},{
-          -70,10},{-44,10}}, color={191,95,0}));
-  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1)
-                                                           annotation (Line(
-        points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255}));
-  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
-                                                          annotation (Line(
-        points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255}));
-  connect(singularPressureLossVALI3.C2, sensorT1.C1)
-    annotation (Line(points={{0,60},{20,60}}, color={0,0,255}));
-  connect(sensorT1.C2, sinkP2.C)
-    annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticDrum2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticDrum2
+  ThermoSysPro.WaterSteam.Junctions.StaticDrum StaticDrumTh1
+    annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI1(K=1e-4)
+    annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI2(K=1e-4)
+    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkP1(Q0=10)
+    annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT
+    annotation (Placement(transformation(extent={{-40,-82},{-20,-62}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(P0=100e5)
+    annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=
+           0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
+                                    annotation (Placement(transformation(extent=
+           {{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI3(K=1e-4)
+    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP2
+    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT1
+    annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0)));
+equation
+  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
+                                                          annotation (Line(
+        points={{-60,-40},{-48,-40},{-48,0.6}}, color={0,0,255}));
+  connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,
+          0},{40,0}}, color={0,0,255}));
+  connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{
+          -19.8,-80},{-10,-80},{-10,-54},{-80,-54},{-80,-40}}, color={0,0,255}));
+  connect(sourcePQ.C, sensorT.C1) annotation (Line(points={{-70,-80},{-40,-80}},
+        color={0,0,255}));
+  connect(heatSource.C[1], StaticDrumTh1.Cth)
+                                          annotation (Line(points={{-70,20.2},{
+          -70,10},{-44,10}}, color={191,95,0}));
+  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1)
+                                                           annotation (Line(
+        points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255}));
+  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
+                                                          annotation (Line(
+        points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255}));
+  connect(singularPressureLossVALI3.C2, sensorT1.C1)
+    annotation (Line(points={{0,60},{20,60}}, color={0,0,255}));
+  connect(sensorT1.C2, sinkP2.C)
+    annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticDrum2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum3.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum3.mo
index 97704f7635a2736bcbd8807bb88845a958d3829c..ac8ee600f196b40bbb83008768035eadf639eadd 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum3.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticDrum3.mo
@@ -1,111 +1,110 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticDrum3
-
-  ThermoSysPro.WaterSteam.Junctions.StaticDrum StaticDrumTh1
-    annotation (Placement(transformation(extent={{-30,1},{20,51}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI1(K=1e-4)
-    annotation (Placement(transformation(extent={{38,7},{58,27}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI2(K=1e-4)
-    annotation (Placement(transformation(extent={{-58,-8},{-38,12}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=10)
-    annotation (Placement(transformation(extent={{74,7},{94,27}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(
-    Q0=100,
-    h0=1400e3,
-    P0=10000000)
-    annotation (Placement(transformation(extent={{-86,-8},{-66,12}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
-                                    annotation (Placement(transformation(
-        origin={-76,26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI3(K=1e-4)
-    annotation (Placement(transformation(extent={{38,52},{58,72}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{74,52},{94,72}}, rotation=0)));
-  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(
-    z1=0,
-    rugosrel=0.0001,
-    D=0.05,
-    ntubes=10,
-    L=10,
-    z2=10)           annotation (Placement(transformation(
-        origin={-28.5,-45.5},
-        extent={{13.5,11.5},{-13.5,-11.5}},
-        rotation=270)));
-  WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    lambda(fixed=false) = 0.03,
-    D=0.05,
-    ntubes=10,
-    L=10,
-    z1=10,
-    Q(fixed=true, start=30)) annotation (Placement(transformation(
-        origin={20,-45},
-        extent={{-14,-12},{14,12}},
-        rotation=270)));
-  WaterSteam.Volumes.VolumeA volumeA annotation (Placement(transformation(
-          extent={{1,-72},{-9,-62}}, rotation=0)));
-  Thermal.BoundaryConditions.HeatSource heatSource1(
-    option_temperature=2,
-    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6},
-    T0={300,300,300,300,300,300,300,300,300,300})
-    annotation (Placement(transformation(
-        origin={-76,-45},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
-                                                          annotation (Line(
-        points={{-38,2},{-15,2},{-15,2.5}}, color={0,0,255}));
-  connect(singularPressureLossVALI1.C2, sinkQ.C)  annotation (Line(points={{58,
-          17},{74,17}}, color={0,0,255}));
-  connect(heatSource.C[1], StaticDrumTh1.Cth)
-                                          annotation (Line(points={{-66.2,26},{
-          -5,26}}, color={191,95,0}));
-  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
-                                                          annotation (Line(
-        points={{4.5,49.5},{4.5,62},{38,62}}, color={0,0,255}));
-  connect(singularPressureLossVALI3.C2, sink.C)
-    annotation (Line(points={{58,62},{74,62}}, color={0,0,255}));
-  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(
-        points={{18.5,17.5},{38,17.5},{38,17}}, color={0,0,255}));
-  connect(sourcePQ.C, singularPressureLossVALI2.C1)
-    annotation (Line(points={{-66,2},{-58,2}}, color={0,0,255}));
-  connect(dynamicTwoPhaseFlowPipe.C2, StaticDrumTh1.Ce_eva) annotation (Line(
-        points={{-28.5,-32},{-28.5,-6},{-28.5,17.5}},
-                                           color={0,0,255}));
-  connect(StaticDrumTh1.Cs_eva, lumpedStraightPipe.C1) annotation (Line(points=
-          {{5,2.5},{20,2.5},{20,-31}}, color={0,0,255}));
-  connect(dynamicTwoPhaseFlowPipe.C1, volumeA.Cs1)
-    annotation (Line(points={{-28.5,-59},{-28,-59},{-28,-67},{-9,-67}}));
-  connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{20,-59},
-          {20,-67},{1,-67}}, color={0,0,255}));
-  connect(heatSource1.C, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{-66.2,
-          -45},{-31.95,-45},{-31.95,-45.5}},
-                                     color={191,95,0}));
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticDrum3;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticDrum3
+  ThermoSysPro.WaterSteam.Junctions.StaticDrum StaticDrumTh1
+    annotation (Placement(transformation(extent={{-30,1},{20,51}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI1(K=1e-4)
+    annotation (Placement(transformation(extent={{38,7},{58,27}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI2(K=1e-4)
+    annotation (Placement(transformation(extent={{-58,-8},{-38,12}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkQ(Q0=10)
+    annotation (Placement(transformation(extent={{74,7},{94,27}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourcePQ(
+    Q0=100,
+    h0=1400e3,
+    P0=10000000)
+    annotation (Placement(transformation(extent={{-86,-8},{-66,12}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
+                                    annotation (Placement(transformation(
+        origin={-76,26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI3(K=1e-4)
+    annotation (Placement(transformation(extent={{38,52},{58,72}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{74,52},{94,72}}, rotation=0)));
+  WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(
+    z1=0,
+    rugosrel=0.0001,
+    D=0.05,
+    ntubes=10,
+    L=10,
+    z2=10)           annotation (Placement(transformation(
+        origin={-28.5,-45.5},
+        extent={{13.5,11.5},{-13.5,-11.5}},
+        rotation=270)));
+  WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    lambda(fixed=false) = 0.03,
+    D=0.05,
+    ntubes=10,
+    L=10,
+    z1=10,
+    Q(fixed=true, start=30)) annotation (Placement(transformation(
+        origin={20,-45},
+        extent={{-14,-12},{14,12}},
+        rotation=270)));
+  WaterSteam.Volumes.VolumeA volumeA annotation (Placement(transformation(
+          extent={{1,-72},{-9,-62}}, rotation=0)));
+  Thermal.BoundaryConditions.HeatSource heatSource1(
+    option_temperature=2,
+    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6},
+    T0={300,300,300,300,300,300,300,300,300,300})
+    annotation (Placement(transformation(
+        origin={-76,-45},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
+                                                          annotation (Line(
+        points={{-38,2},{-15,2},{-15,2.5}}, color={0,0,255}));
+  connect(singularPressureLossVALI1.C2, sinkQ.C)  annotation (Line(points={{58,
+          17},{74,17}}, color={0,0,255}));
+  connect(heatSource.C[1], StaticDrumTh1.Cth)
+                                          annotation (Line(points={{-66.2,26},{
+          -5,26}}, color={191,95,0}));
+  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
+                                                          annotation (Line(
+        points={{4.5,49.5},{4.5,62},{38,62}}, color={0,0,255}));
+  connect(singularPressureLossVALI3.C2, sink.C)
+    annotation (Line(points={{58,62},{74,62}}, color={0,0,255}));
+  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(
+        points={{18.5,17.5},{38,17.5},{38,17}}, color={0,0,255}));
+  connect(sourcePQ.C, singularPressureLossVALI2.C1)
+    annotation (Line(points={{-66,2},{-58,2}}, color={0,0,255}));
+  connect(dynamicTwoPhaseFlowPipe.C2, StaticDrumTh1.Ce_eva) annotation (Line(
+        points={{-28.5,-32},{-28.5,-6},{-28.5,17.5}},
+                                           color={0,0,255}));
+  connect(StaticDrumTh1.Cs_eva, lumpedStraightPipe.C1) annotation (Line(points=
+          {{5,2.5},{20,2.5},{20,-31}}, color={0,0,255}));
+  connect(dynamicTwoPhaseFlowPipe.C1, volumeA.Cs1)
+    annotation (Line(points={{-28.5,-59},{-28,-59},{-28,-67},{-9,-67}}));
+  connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{20,-59},
+          {20,-67},{1,-67}}, color={0,0,255}));
+  connect(heatSource1.C, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{-66.2,
+          -45},{-31.95,-45},{-31.95,-45.5}},
+                                     color={191,95,0}));
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticDrum3;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticExchangerWaterSteamFlueGases.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticExchangerWaterSteamFlueGases.mo
index 83a9283980cc749b28b849ac443eeec891440c14..07ac03edd18d4a8a52d1c08c91cb77c15b2fb728 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticExchangerWaterSteamFlueGases.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticExchangerWaterSteamFlueGases.mo
@@ -1,72 +1,70 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticExchangerWaterSteamFlueGases
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink puits_Eau
-                                          annotation (Placement(transformation(
-          extent={{60,-10},{80,10}}, rotation=0)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
-    EchangeurEfficacite(                                                                   EffEch=0.9,
-    Kdpf=10,
-    Kdpe=100,
-    W0=1e6,
-    exchanger_conf=1,
-    exchanger_type=1)
-                annotation (Placement(transformation(extent={{-40,-20},{40,20}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ source_Eau(
-    P0=4e5,
-    h0=170000,
-    Q0=15)    annotation (Placement(transformation(extent={{-80,-10},{-60,10}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
-    Xco2=0,
-    Xo2=0.233,
-    Xso2=0,
-    Xh2o=0.01,
-    Q0=20,
-    T0=700,
-    P0=13e5)
-    annotation (Placement(transformation(extent={{-40,40},{-20,60}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
-    annotation (Placement(transformation(
-        origin={30,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-equation
-  connect(source_Eau.C, EchangeurEfficacite.Cws1) annotation (Line(points={{-60,
-          0},{-40,0}}, color={0,0,255}));
-  connect(EchangeurEfficacite.Cws2, puits_Eau.C) annotation (Line(points={{40,0},
-          {60,0}}, color={0,0,255}));
-  connect(Source_Fumees.C, EchangeurEfficacite.Cfg1) annotation (Line(
-      points={{-20,50},{0,50},{0,18}},
-      color={0,0,0},
-      thickness=1));
-  connect(Puits_Fumees.C, EchangeurEfficacite.Cfg2) annotation (Line(
-      points={{20.2,-50},{-0.2,-50},{-0.2,-18}},
-      color={0,0,0},
-      thickness=1));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticExchangerWaterSteamFlueGases;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticExchangerWaterSteamFlueGases
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink puits_Eau
+                                          annotation (Placement(transformation(
+          extent={{60,-10},{80,10}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
+    EchangeurEfficacite(                                                                   EffEch=0.9,
+    Kdpf=10,
+    Kdpe=100,
+    W0=1e6,
+    exchanger_conf=1,
+    exchanger_type=1)
+                annotation (Placement(transformation(extent={{-40,-20},{40,20}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ source_Eau(
+    P0=4e5,
+    h0=170000,
+    Q0=15)    annotation (Placement(transformation(extent={{-80,-10},{-60,10}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ Source_Fumees(
+    Xco2=0,
+    Xo2=0.233,
+    Xso2=0,
+    Xh2o=0.01,
+    Q0=20,
+    T0=700,
+    P0=13e5)
+    annotation (Placement(transformation(extent={{-40,40},{-20,60}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink Puits_Fumees
+    annotation (Placement(transformation(
+        origin={30,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+equation
+  connect(source_Eau.C, EchangeurEfficacite.Cws1) annotation (Line(points={{-60,
+          0},{-40,0}}, color={0,0,255}));
+  connect(EchangeurEfficacite.Cws2, puits_Eau.C) annotation (Line(points={{40,0},
+          {60,0}}, color={0,0,255}));
+  connect(Source_Fumees.C, EchangeurEfficacite.Cfg1) annotation (Line(
+      points={{-20,50},{0,50},{0,18}},
+      color={0,0,0},
+      thickness=1));
+  connect(Puits_Fumees.C, EchangeurEfficacite.Cfg2) annotation (Line(
+      points={{20.2,-50},{-0.2,-50},{-0.2,-18}},
+      color={0,0,0},
+      thickness=1));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticExchangerWaterSteamFlueGases;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticWaterWaterExchanger.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticWaterWaterExchanger.mo
index 0e6b521228fbff7b47fd7ccc026632bc7e855d3f..0941df47425c16ada642b213b44d8614b903fc15 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticWaterWaterExchanger.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticWaterWaterExchanger.mo
@@ -1,54 +1,53 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticWaterWaterExchanger
-
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchanger
-    plateHeatExchanger(modec=1, modef=1)
-               annotation (Placement(transformation(extent={{-20,44},{0,64}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
-                                            T0=340)
-    annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
-    annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
-                                          annotation (Placement(transformation(
-          extent={{40,44},{60,64}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP3
-                                          annotation (Placement(transformation(
-          extent={{20,24},{40,44}}, rotation=0)));
-equation
-  connect(sourceP2.C, plateHeatExchanger.Ec)
-    annotation (Line(points={{-60,54},{-20,54}}, color={0,0,255}));
-  connect(sourceP3.C, plateHeatExchanger.Ef)
-                                            annotation (Line(points={{-40,34},{
-          -15,34},{-15,48}}, color={0,0,255}));
-  connect(plateHeatExchanger.Sc, puitsP2.C)
-                                           annotation (Line(points={{0,54.2},{
-          20,54.2},{20,54},{40,54}}, color={0,0,255}));
-  connect(plateHeatExchanger.Sf, puitsP3.C)
-                                           annotation (Line(points={{-5,48},{-6,
-          48},{-6,34},{20,34}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticWaterWaterExchanger;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticWaterWaterExchanger
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchanger
+    plateHeatExchanger(modec=1, modef=1)
+               annotation (Placement(transformation(extent={{-20,44},{0,64}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
+                                            T0=340)
+    annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP3
+    annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
+                                          annotation (Placement(transformation(
+          extent={{40,44},{60,64}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP3
+                                          annotation (Placement(transformation(
+          extent={{20,24},{40,44}}, rotation=0)));
+equation
+  connect(sourceP2.C, plateHeatExchanger.Ec)
+    annotation (Line(points={{-60,54},{-20,54}}, color={0,0,255}));
+  connect(sourceP3.C, plateHeatExchanger.Ef)
+                                            annotation (Line(points={{-40,34},{
+          -15,34},{-15,48}}, color={0,0,255}));
+  connect(plateHeatExchanger.Sc, puitsP2.C)
+                                           annotation (Line(points={{0,54.2},{
+          20,54.2},{20,54},{40,54}}, color={0,0,255}));
+  connect(plateHeatExchanger.Sf, puitsP3.C)
+                                           annotation (Line(points={{-5,48},{-6,
+          48},{-6,34},{20,34}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticWaterWaterExchanger;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStaticWaterWaterExchangerDTorWorEff.mo b/ThermoSysPro/Examples/SimpleExamples/TestStaticWaterWaterExchangerDTorWorEff.mo
index 95be8477f59a11456f21fdd6ffdf4b6143c56eb5..3e73f8ac2acf9f754bf62fd2d9bbe2c275fa8d3b 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStaticWaterWaterExchangerDTorWorEff.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStaticWaterWaterExchangerDTorWorEff.mo
@@ -1,63 +1,62 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStaticWaterWaterExchangerDTorWorEff
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceWaterSteam_FF(
-    C(P(start=219.E5)),
-    Q0=481.07,
-    h0=1067.9E3)
-    annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkWaterSteam_FF(
-    P0=217.68E5)
-    annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceWaterSteam_FC(
-    C(P(start=24E5)),
-    Q0=23.377,
-    h0=3420.3E3)
-    annotation (Placement(transformation(
-        origin={-30,30},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkWaterSteam_FC(
-    P0=24.13E5)
-    annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
-    exchangerWaterSteamDTorWorEFF(
-    EffEch=1,
-    Kf=597.832,
-    Ec(P(start=23e5)),
-    Ef(P(start=219E5)),
-    exchanger_type=3)   annotation (Placement(transformation(extent={{-20,-20},
-            {0,0}}, rotation=0)));
-equation
-  connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef)
-    annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255}));
-  connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation (Line(
-        points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255}));
-  connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation (Line(
-        points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255}));
-  connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation (Line(
-        points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStaticWaterWaterExchangerDTorWorEff;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStaticWaterWaterExchangerDTorWorEff
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceWaterSteam_FF(
+    C(P(start=219.E5)),
+    Q0=481.07,
+    h0=1067.9E3)
+    annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkWaterSteam_FF(
+    P0=217.68E5)
+    annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceWaterSteam_FC(
+    C(P(start=24E5)),
+    Q0=23.377,
+    h0=3420.3E3)
+    annotation (Placement(transformation(
+        origin={-30,30},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkWaterSteam_FC(
+    P0=24.13E5)
+    annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
+    exchangerWaterSteamDTorWorEFF(
+    EffEch=1,
+    Kf=597.832,
+    Ec(P(start=23e5)),
+    Ef(P(start=219E5)),
+    exchanger_type=3)   annotation (Placement(transformation(extent={{-20,-20},
+            {0,0}}, rotation=0)));
+equation
+  connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef)
+    annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255}));
+  connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation (Line(
+        points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255}));
+  connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation (Line(
+        points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255}));
+  connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation (Line(
+        points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStaticWaterWaterExchangerDTorWorEff;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamDryer1.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamDryer1.mo
index 2a8ad3128451fe9a9c23518640204a18b13bd020..e79f775d3f03e61a69d8d395d798fb06aeb5604a 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSteamDryer1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamDryer1.mo
@@ -1,61 +1,60 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSteamDryer1
-
-  ThermoSysPro.WaterSteam.Junctions.SteamDryer steamDryer(
-    eta=1,
-    P(start=100e5),
-    h(start=3e6)) annotation (Placement(transformation(extent={{-20,20},{0,40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ(h0=3000000)
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20},
-            {-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(P0=100e5)
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
-            {40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=2.e-3)
-                          annotation (Placement(transformation(extent={{0,-20},
-            {20,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0)));
-equation
-  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-80,30},
-          {-60,30}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2,sinkP. C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2,sink. C)
-    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{
-          -40,30},{-30,30},{-30,34},{-19.9,34}}, color={0,0,255}));
-  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{
-          -0.1,34},{10,34},{10,30},{20,30}}, color={0,0,255}));
-  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{
-          -9.9,20},{-10,20},{-10,-10},{0,-10}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSteamDryer1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamDryer1
+  ThermoSysPro.WaterSteam.Junctions.SteamDryer steamDryer(
+    eta=1,
+    P(start=100e5),
+    h(start=3e6)) annotation (Placement(transformation(extent={{-20,20},{0,40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ(h0=3000000)
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20},
+            {-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(P0=100e5)
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
+            {40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=2.e-3)
+                          annotation (Placement(transformation(extent={{0,-20},
+            {20,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0)));
+equation
+  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-80,30},
+          {-60,30}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2,sinkP. C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2,sink. C)
+    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{
+          -40,30},{-30,30},{-30,34},{-19.9,34}}, color={0,0,255}));
+  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{
+          -0.1,34},{10,34},{10,30},{20,30}}, color={0,0,255}));
+  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{
+          -9.9,20},{-10,20},{-10,-10},{0,-10}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSteamDryer1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamDryer2.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamDryer2.mo
index 291d1d507bcff23bb1f2ab5e4580fdfc6e603218..d6539a2097dc12b1697ab8c5460e03aa5049d638 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSteamDryer2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamDryer2.mo
@@ -1,62 +1,61 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSteamDryer2
-
-  ThermoSysPro.WaterSteam.Junctions.SteamDryer steamDryer(eta=0.9, P(start=
-          10000000)) annotation (Placement(transformation(extent={{-10,-8},{10,
-            12}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0=
-        2400000)
-    annotation (Placement(transformation(extent={{-90,-4},{-70,16}},  rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4},
-            {-30,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4},
-            {50,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1.e-4)
-                          annotation (Placement(transformation(extent={{30,-44},
-            {50,-24}},
-                     rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{70,-44},{90,-24}},
-                                                                   rotation=0)));
-equation
-  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-70,6},
-          {-50,6}},  color={0,0,255}));
-  connect(singularPressureLoss1.C2,sinkP. C)
-    annotation (Line(points={{50,6},{70,6}},   color={0,0,255}));
-  connect(singularPressureLoss3.C2,sink. C)
-    annotation (Line(points={{50,-34},{70,-34}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{-30,6},
-          {-20,6},{-9.9,6}},                     color={0,0,255}));
-  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{9.9,6},
-          {20,6},{30,6}},                    color={0,0,255}));
-  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{0.1,-8},
-          {0,-8},{0,-34},{30,-34}},             color={0,0,255}));
-  annotation (experiment(StopTime=10), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSteamDryer2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamDryer2
+  ThermoSysPro.WaterSteam.Junctions.SteamDryer steamDryer(eta=0.9, P(start=
+          10000000)) annotation (Placement(transformation(extent={{-10,-8},{10,
+            12}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0=
+        2400000)
+    annotation (Placement(transformation(extent={{-90,-4},{-70,16}},  rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4},
+            {-30,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4},
+            {50,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1.e-4)
+                          annotation (Placement(transformation(extent={{30,-44},
+            {50,-24}},
+                     rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{70,-44},{90,-24}},
+                                                                   rotation=0)));
+equation
+  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-70,6},
+          {-50,6}},  color={0,0,255}));
+  connect(singularPressureLoss1.C2,sinkP. C)
+    annotation (Line(points={{50,6},{70,6}},   color={0,0,255}));
+  connect(singularPressureLoss3.C2,sink. C)
+    annotation (Line(points={{50,-34},{70,-34}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{-30,6},
+          {-20,6},{-9.9,6}},                     color={0,0,255}));
+  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{9.9,6},
+          {20,6},{30,6}},                    color={0,0,255}));
+  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{0.1,-8},
+          {0,-8},{0,-34},{30,-34}},             color={0,0,255}));
+  annotation (experiment(StopTime=10), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSteamDryer2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamEngine.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamEngine.mo
index 559bfa2b17a9028299c4ca03eba4b62a9e859a9c..a5b3466f59a3aa73c7dff4e72e58f474f20b834b 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSteamEngine.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamEngine.mo
@@ -1,52 +1,51 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSteamEngine
-
-  ThermoSysPro.WaterSteam.Machines.SteamEngine steamEngine1
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=100000)
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    h0=3.e6,
-    option_temperature=2,
-    mode=2,
-    P0=16e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
-          rotation=0)));
-equation
-  connect(sourceP.C, steamEngine1.C1)
-    annotation (Line(points={{-80,70},{-57,70}}, color={0,0,255}));
-  connect(steamEngine1.C2, puitsP.C)
-    annotation (Line(points={{-43,70},{-31.5,70},{-31.5,70},{-20,70}}, color={0,
-          0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSteamEngine;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamEngine
+  ThermoSysPro.WaterSteam.Machines.SteamEngine steamEngine1
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=100000)
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    h0=3.e6,
+    option_temperature=2,
+    mode=2,
+    P0=16e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
+          rotation=0)));
+equation
+  connect(sourceP.C, steamEngine1.C1)
+    annotation (Line(points={{-80,70},{-57,70}}, color={0,0,255}));
+  connect(steamEngine1.C2, puitsP.C)
+    annotation (Line(points={{-43,70},{-31.5,70},{-31.5,70},{-20,70}}, color={0,
+          0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSteamEngine;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamExtractionSplitter.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamExtractionSplitter.mo
index d825edb433b09437f299d605a82d60ea8ef09769..aaf2c751b770d5f56c9018725909a64455e21b89 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSteamExtractionSplitter.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamExtractionSplitter.mo
@@ -1,61 +1,60 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSteamExtractionSplitter
-
-  ThermoSysPro.WaterSteam.Junctions.SteamExtractionSplitter
-    steamExtractionSplitter(alpha=0.9)
-                            annotation (Placement(transformation(extent={{-20,
-            20},{0,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ(h0=2600000)
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20},
-            {-40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(P0=100e5)
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
-            {40,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=2.e-3)
-                          annotation (Placement(transformation(extent={{0,-20},
-            {20,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sink(Q0=10)
-    annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0)));
-equation
-  connect(sourceQ.C, singularPressureLoss2.C1) annotation (Line(points={{-80,30},
-          {-60,30}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation (Line(
-        points={{-40,30},{-20.3,30}}, color={0,0,255}));
-  connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation (Line(
-        points={{0.3,30},{20,30}}, color={0,0,255}));
-  connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation (Line(
-        points={{-6,20},{-6,-10},{0,-10}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, sink.C)
-    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSteamExtractionSplitter;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamExtractionSplitter
+  ThermoSysPro.WaterSteam.Junctions.SteamExtractionSplitter
+    steamExtractionSplitter(alpha=0.9)
+                            annotation (Placement(transformation(extent={{-20,
+            20},{0,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ(h0=2600000)
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20},
+            {-40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(P0=100e5)
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
+            {40,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=2.e-3)
+                          annotation (Placement(transformation(extent={{0,-20},
+            {20,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sink(Q0=10)
+    annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0)));
+equation
+  connect(sourceQ.C, singularPressureLoss2.C1) annotation (Line(points={{-80,30},
+          {-60,30}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation (Line(
+        points={{-40,30},{-20.3,30}}, color={0,0,255}));
+  connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation (Line(
+        points={{0.3,30},{20,30}}, color={0,0,255}));
+  connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation (Line(
+        points={{-6,20},{-6,-10},{0,-10}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, sink.C)
+    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSteamExtractionSplitter;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG.mo
index 39ee10d8f719846efa052f5e7ce0c7703cf98c8a..63b73a3dbae98060ee840b172e108f3dda8d0199 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG.mo
@@ -1,574 +1,573 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSteamGenerator_1SG
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(
-    option_temperature=2,
-    P0(fixed=true) = 15450000,
-    h0=1.27187e6,
-    C(h(start=1271453.0789958118)),
-    Q(start=4756.000000000019))
-    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ(Q0=4756, h0=
-        1.47084e6,
-    C(h(start=1470840.0)),
-    P(start=15603796.298727792))
-    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ1(            h0=
-        991272, Q0=531.242,
-    P(start=6704397.556426741))
-    annotation (Placement(transformation(extent={{96,22},{72,46}})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1(
-    h0=2.77257e6,
-    option_temperature=2,
-    C(Q(start=531.242), h(start=2776304.4264558135)),
-    P0=6600000) annotation (Placement(transformation(extent={{74,56},{94,76}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1(
-    C1(h_vol(start=991272)),
-    C2(h_vol(start=991271.9375)),
-    mode=0,
-    rho(start=34),
-    h(start=2.77257e6),
-    Q(start=531.242),
-    continuous_flow_reversal=true,
-    K(fixed=false),
-    T(start=503.196),
-    Pm(start=669455),
-    pro(
-      T(start=555.5635779732289),
-      cp(start=5183.453852937443),
-      d(start=34.53068824587431),
-      ddhp(start=-2.156841613579318E-05),
-      ddph(start=5.481510930910603E-06),
-      s(start=5838.851085717999),
-      u(start=2583625.398001984),
-      x(start=0.9995688867393426)))
-                      annotation (Placement(transformation(
-        origin={41,66},
-        extent={{9,-10},{-9,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss2(
-    mode=1,
-    C1(h_vol(start=991272)),
-    Q(start=530.891),
-    rho(start=830.88),
-    h(start=991272),
-    K=1e-2,
-    C2(h_vol(start=991272.0), P(start=6704394.159371604)),
-    T(start=503.196),
-    Pm(start=6704395.857899172),
-    deltaP(start=3.3970551367455455),
-    pro(
-      T(start=503.1981380178025),
-      cp(start=4647.872167379586),
-      d(start=830.7726875295028),
-      ddhp(start=-0.00029227872818718767),
-      ddph(start=9.9693370719189E-07),
-      duhp(start=0.9971608232003352),
-      duph(start=-0.0011940145451926898),
-      s(start=2602.778049180844),
-      u(start=983143.9313756793)))
-                       annotation (Placement(transformation(
-        origin={39,35},
-        extent={{-9,-11},{9,11}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_1SG
-    steamGenerator_1SG(DomeGV(zl(fixed=true),
-      Cm(Q(start=3674.543111465144), h(start=1472510.1268426012)),
-      Cs(Q(start=3143.3011114717247), h(start=1252158.8888439273)),
-      P(start=6706678.926114233),
-      Pfond(start=6713155.65634596),
-      Tp(start=556.0857394942999),
-      Wlv(start=-748.4701526083975),
-      Wpl(start=185.7513849789081),
-      hl(start=1252158.8888439273),
-      hv(start=2776304.4264558135),
-      lsat(
-        P(start=6706678.926114233),
-        T(start=556.0979754471518),
-        cp(start=5341.980766557827),
-        h(start=1252159.186054214),
-        rho(start=744.9920451286558)),
-      prod(
-        T(start=295.51270247400157),
-        cp(start=4163.931630049154),
-        d(start=1000.6707309660103),
-        ddhp(start=-5.7612413191868046E-05),
-        ddph(start=5.013387042126168E-07),
-        duhp(start=0.9996137572062725),
-        duph(start=-0.0009959686640933023),
-        s(start=328.5118402659254),
-        u(start=93346.94015574278)),
-      prol(
-        T(start=556.0919019058653),
-        cp(start=5341.843073436941),
-        d(start=745.0040954228513),
-        ddhp(start=-0.00037140817913333907),
-        ddph(start=1.5005173848478167E-06),
-        duhp(start=0.99551211563078),
-        duph(start=-0.0013241431051173875),
-        s(start=3095.2420470602237),
-        u(start=1243124.5376265536),
-        x(start=0.0)),
-      prom(
-        T(start=556.0979754471518),
-        cp(start=5322.793136052821),
-        d(start=188.68359292764998),
-        ddhp(start=-0.0006394536492507623),
-        ddph(start=5.1133513773564396E-05),
-        s(start=3491.54489930648),
-        u(start=1436965.5475707515),
-        x(start=0.14457362014386263)),
-      prov(
-        T(start=556.0789076325113),
-        cp(start=5211.391721748124),
-        d(start=34.82711185326052),
-        ddhp(start=-3.901275006925452E-05),
-        ddph(start=5.273416580142731E-06),
-        duhp(start=0.784285588979114),
-        duph(start=0.00044520376975680856),
-        s(start=5835.901887967359),
-        u(start=2583632.686761629),
-        x(start=1.0)),
-      vsat(
-        P(start=6706678.926114233),
-        T(start=556.0979754471518),
-        cp(start=5209.262014091696),
-        h(start=2776302.667894954),
-        rho(start=34.82323622886482)),
-      xmv(start=0.14457362014386263)),
-    CapteurPAlim(C2(h_vol(start=1214441.5268755828))),
-    DPSeparateurCyclone(
-      Pm(start=6707752.054694749),
-      deltaP(start=2146.25716103334),
-      deltaPf(start=2146.25716103334),
-      pro(
-        T(start=556.1086935353277),
-        cp(start=5323.052716283155),
-        d(start=188.73846727302114),
-        ddhp(start=-0.0006397351053078553),
-        ddph(start=5.114516226384435E-05),
-        s(start=3491.5346735317003),
-        u(start=1436970.1961034606),
-        x(start=0.14454313806934876))),
-    DPnulle_AlimDwnc(
-      Pm(start=6704394.142386328),
-      deltaP(start=0.03397055143729243),
-      pro(
-        T(start=503.1981380947931),
-        cp(start=4647.872182942484),
-        d(start=830.7726858215926),
-        ddhp(start=-0.00029227873038032787),
-        ddph(start=9.969337188465612E-07),
-        duhp(start=0.9971608238938426),
-        duph(start=-0.0011940145499922032),
-        s(start=2602.778053268592),
-        u(start=983143.9334160357))),
-    DPnulle_DomeDwnc(
-      Pm(start=6705536.525757642),
-      deltaP(start=2284.800713180426),
-      pro(
-        T(start=556.0865640531288),
-        cp(start=5341.751445758121),
-        d(start=744.4157218298644),
-        ddhp(start=-0.00995490926717634),
-        ddph(start=0.0005068167393487037),
-        s(start=3095.302614244789),
-        u(start=1243151.1041758733),
-        x(start=3.931424690222598E-05))),
-    DownComerGV(
-      Pm(start=6731634.748061769),
-      deltaP(start=-54481.245321432085),
-      deltaPf(start=25883.401832656895),
-      pro(
-        T(start=548.9248327285786),
-        cp(start=5193.648289919676),
-        d(start=758.7882745673616),
-        ddhp(start=-0.0003571815945850099),
-        ddph(start=1.3973083815380471E-06),
-        duhp(start=0.995823924007589),
-        duph(start=-0.0013015537136234854),
-        s(start=3026.856808580834),
-        u(start=1205504.3315645182))),
-    MixAlimDomeGV(
-      Cs(Q(start=3674.5431114717244), h(start=1214441.5268755828)),
-      P(start=6704394.125401053),
-      h(start=1214441.5268755828)),
-    RiserGV(
-      Bo(start={5.264551982702729E-05,4.24124411076559E-05,
-            3.409050891381302E-05,2.7385279816437412E-05,2.2009213639388002E-05}),
-      E(start={1.5087815666722353,1.760919957987664,1.9476847403074915,
-            2.097116088661417,2.2191758439457385}),
-      P(start={6758875.5,6744780.661967858,6734858.682936351,6727554.331945282,
-            6721071.1962960195,6714893.297883738,6708825.0}),
-      Pb(start={6758875.370722485,6744780.661967858,6734858.682936351,
-            6727554.331945282,6721071.1962960195,6714893.297883738,
-            6708825.183275267}),
-      Prl(start={0.8614060609915553,0.8612177743481639,0.8610795419185651,
-            0.8609571209529038,0.860840700352387}),
-      Prv(start={1.558060122469759,1.5573349629944262,1.5568015066398002,
-            1.5563283028859216,1.5558776204321105}),
-      Q(start={3674.543111473107,3674.54311170587,3674.543111581315,
-            3674.5431115457377,3674.543111529379,3674.5431114738362}),
-      Rel1(start={251532.7450854159,240987.01172095592,232483.9984969632,
-            225629.0583738281,220106.5497190104}),
-      Rel2(start={248927.84623701972,257504.08120653126,257411.52273225,
-            257337.40584396885,257269.3164124718,257203.43335380178}),
-      Rev1(start={126015.47546629705,126045.05144488405,126066.84046334997,
-            155209.85787602403,182019.8146249652}),
-      Rev2(start={1285890.5820611913,1260302.6037093343,1260559.4427392383,
-            1260765.1443104607,1260954.1455479627,1261137.0479626092}),
-      S(start={0.1549634611710962,0.12399319566793483,0.10767347985477606,
-            0.09730316139006305,0.09015797512251608}),
-      Xtt(start={7.311009664045045,2.8439271576801577,1.897054678974084,
-            1.4856019790614363,1.258516343197067}),
-      cpl(start={5349.469481129635,5347.516592209151,5346.080165928101,
-            5344.806120274413,5343.592832739081}),
-      cpv(start={5227.826905277505,5222.985689734148,5219.424745327635,
-            5216.2663179883575,5213.258487155894}),
-      dpf(start={640.5716824740767,987.6792218283877,1565.132025124198,
-            2033.342774898577,2412.0434228872004,2717.9759070918435}),
-      dpg(start={13454.137072152957,8934.299809678538,5739.21896594421,
-            4449.792874364351,3765.854989394447,3350.1387013794383}),
-      filo(start={1.0,1.5127576625518269,2.397698418903442,3.115489764426855,
-            3.69629921982833,4.165735623228427}),
-      h(start={1214441.5,1289758.2348790504,1350993.226176363,
-            1400513.9851121805,1440421.3369830078,1472510.126842601,1472510.125}),
-      hb(start={1214441.5268755823,1289758.2348790504,1350993.226176363,
-            1400513.9851121805,1440421.3369830078,1472510.126842601}),
-      hcl(start={7035.100994857359,6799.356131209278,6607.618400143516,
-            6452.049964861143,6326.112386914556}),
-      hcv(start={566.4591939112424,566.0661558687939,565.7769561570168,
-            667.8050163368257,758.1769879991693}),
-      heb(start={23295.840202370804,20136.327196381662,17383.684434211296,
-            15004.435655175634,12955.702450307694}),
-      hi(start={14224.434729366436,14469.889471006716,14741.319323463362,
-            14990.676810280005,15206.815694336261}),
-      khi(start={2.34544191189234,3.5476325020812607,5.62295229531067,
-            7.306285427856448,8.668378220483625,9.769286547251083}),
-      kl(start={0.5726540836020793,0.5728072487009809,0.5729200372395459,
-            0.573020167674377,0.5731156035260583}),
-      kv(start={0.06323778626765368,0.06319381227590415,0.06316144860435968,
-            0.06313272992044888,0.06310536893560353}),
-      lambdal(start={0.047855836354927225,0.04784973013189612,
-            0.04784979386553329,0.047849844933704144,0.04784989187470238,
-            0.04784993731823128}),
-      lambdav(start={0.04770773819080876,0.047708461262474786,
-            0.047708453858867454,0.04770844793151606,0.04770844248709371,
-            0.04770843721990883}),
-      lsat1(
-        P(start={6744780.661967858,6734858.682936351,6727554.331945282,
-              6721071.1962960195,6714893.297883738}),
-        T(start={556.4777242585986,556.3789929681456,556.3062380340273,
-              556.24161223393,556.1799847947086}),
-        cp(start={5349.469481129635,5347.516592209151,5346.080165928101,
-              5344.806120274413,5343.592832739081}),
-        h(start={1254164.4193918111,1253642.8508641238,1253258.6094974852,
-              1252917.3728564607,1252592.0313789598}),
-        rho(start={744.3038527038548,744.4829488814046,744.6148470020331,
-              744.7319526076345,744.8435767532254})),
-      lsat2(
-        P(start={6751828.016345171,6739819.672452104,6731206.507440817,
-              6724312.764120651,6717982.247089879,6711859.240579503}),
-        T(start={556.5477834490828,556.4283724952538,556.3426230413967,
-              556.2739310847983,556.2108039269156,556.1497027843936}),
-        cp(start={5350.857762973237,5348.492792087017,5346.798246788609,
-              5345.443039065573,5344.19938218037,5342.997245450023}),
-        h(start={1254534.6181015647,1253903.6885891953,1253450.759228525,
-              1253088.0141070336,1252754.7229785018,1252432.1902232456}),
-        rho(start={744.1766933998682,744.393390773562,744.5488924935185,
-              744.6733955012804,744.7877607629224,744.8984085068838})),
-      lv(start={1521663.0060791962,1522308.614823357,1522784.044517484,
-            1523206.1266938604,1523608.4279569504}),
-      mul1(start={9.221245213314675E-05,9.225063173725626E-05,
-            9.227877396345615E-05,9.230377729464815E-05,9.232762543199986E-05}),
-      mul2(start={9.54091599276262E-05,9.223153505875156E-05,
-            9.22646991116657E-05,9.22912726762199E-05,9.231569867567667E-05,
-            9.233934548378382E-05}),
-      muv1(start={1.8846888927678993E-05,1.8842466579145694E-05,
-            1.8839209902747067E-05,1.8836318627906903E-05,1.883356282791608E-05}),
-      muv2(start={1.846968709732503E-05,1.884467795565175E-05,
-            1.8840838351230148E-05,1.883776435263538E-05,1.883494080755032E-05,
-            1.883220918015266E-05}),
-      pro1(
-        T(start={556.4777242585986,556.3789929681456,556.3062380340273,
-              556.24161223393,556.1799847947086}),
-        cp(start={5346.624091984354,5339.552944118439,5333.832407225015,
-              5328.983099309423,5324.780334377812}),
-        d(start={505.1476771686893,324.12933637240366,251.22634915738507,
-              212.58399061849084,189.10395271899358}),
-        ddhp(start={-0.004560382069667427,-0.0018800385426296002,-0.0011305175875149266,
-              -0.0008101742520365192,-0.0006416110037500664}),
-        ddph(start={0.0002526074465431572,0.00011948952669955124,
-              7.932514344963074E-05,6.117892216854974E-05,5.122276521956781E-05}),
-        s(start={3162.775727202852,3272.870886399854,3361.9284629388753,
-              3433.719481764495,3491.4667057518886}),
-        u(start={1276406.1381223714,1330214.9197190963,1373735.1286964042,
-              1408805.26289981,1437001.1213388292}),
-        x(start={0.023391391750366815,0.06394917191185662,0.09670141747601199,
-              0.12309822081239064,0.1443402986150028})),
-      pro2(
-        T(start={548.9265959900218,556.4283724952538,556.3426230413967,
-              556.2739310847983,556.2108039269156,556.1497027843936}),
-        cp(start={5193.192624799688,5345.59313827574,5338.752064316225,
-              5333.091571706786,5328.254175988971,5324.046285875985}),
-        d(start={758.8164659348321,503.89659112471367,323.69328702454266,
-              250.96935499905894,212.3950989164459,188.94860340273425}),
-        ddhp(start={-0.00035713056859328855,-0.0045407754940881,-0.0018758834037291676,
-              -0.0011286868959148294,-0.0008090640434138537,-0.0006408133811349972}),
-        ddph(start={1.3969923267307114E-06,0.00025179538730201796,
-              0.00011931701826041977,7.924917146391011E-05,
-              6.113292003174817E-05,5.118977604478324E-05}),
-        duhp(start={0.9958123063446975,0.0,0.0,0.0,0.0,0.0}),
-        duph(start={-0.0013014606682714325,0.0,0.0,0.0,0.0,0.0}),
-        s(start={3026.808438887448,3162.793397822675,3272.891152212068,
-              3361.951669299596,3433.7456165328513,3491.4955656881084}),
-        u(start={1205478.1102843666,1276382.8324826804,1330198.2119537464,
-              1373720.6231730473,1408791.6888349934,1436987.9842085352}),
-        x(start={0.0,0.023557740628157332,0.06406535291687379,
-              0.09680003145518278,0.12318873499805512,0.1444264764040964})),
-      rhol1(start={744.3038527038548,744.4829488814046,744.6148470020331,
-            744.7319526076345,744.8435767532254}),
-      rhol2(start={758.8164659348321,744.393390773562,744.5488924935185,
-            744.6733955012804,744.7877607629224,744.8984085068838}),
-      rhov1(start={35.04281039746895,34.985594751303,34.943490415577,
-            34.90613158466056,34.87054197829741}),
-      rhov2(start={35.08346516605899,35.01419932328164,34.96454082354485,
-            34.92480961500706,34.888335524811154,34.85306707615831}),
-      vsat1(
-        P(start={6744780.661967858,6734858.682936351,6727554.331945282,
-              6721071.1962960195,6714893.297883738}),
-        T(start={556.4777242585986,556.3789929681456,556.3062380340273,
-              556.24161223393,556.1799847947086}),
-        cp(start={5227.826905277505,5222.985689734148,5219.424745327635,
-              5216.2663179883575,5213.258487155894}),
-        h(start={2775827.4254710074,2775951.4656874808,2776042.6540149692,
-              2776123.499550321,2776200.45933591}),
-        rho(start={35.04281039746895,34.985594751303,34.943490415577,
-              34.90613158466056,34.87054197829741})),
-      vsat2(
-        P(start={6751828.016345171,6739819.672452104,6731206.507440817,
-              6724312.764120651,6717982.247089879,6711859.240579503}),
-        T(start={556.5477834490828,556.4283724952538,556.3426230413967,
-              556.2739310847983,556.2108039269156,556.1497027843936}),
-        cp(start={5231.268420588046,5225.40569909934,5221.204893969272,
-              5217.845277235249,5214.762171938293,5211.781972143657}),
-        h(start={2775739.2015562006,2775889.4704939374,2775997.073371233,
-              2776083.0874444144,2776161.9891337138,2776238.22703045}),
-        rho(start={35.08346516605899,35.01419932328164,34.96454082354485,
-              34.92480961500706,34.888335524811154,34.85306707615831})),
-      xbi(start={0.1,0.1,0.1,0.12309822081239064,0.1443402986150028}),
-      xbs(start={0.023391391750366815,0.06394917191185662,0.09670141747601199,
-            0.12309822081239064,0.1443402986150028}),
-      xv1(start={0.023391391750366815,0.06394917191185662,0.09670141747601199,
-            0.12309822081239064,0.1443402986150028}),
-      xv2(start={0.0,0.023557740628157332,0.06406535291687379,
-            0.09680003145518278,0.12318873499805512,0.1444264764040964})),
-    UtubeColdtLeg(
-      P(start={15447784.0,15447791.72370848,15447988.956335694,
-            15448336.419381844,15448802.873723604,15449363.813566398,15450000.0}),
-      Pr(start={0.848483077540291,0.8437031935743279,0.8401599107455334,
-            0.8374996225903174,0.8354783769371337}),
-      Q(start={4756.0,4755.999999999917,4756.000000000249,4755.999999999868,
-            4756.000000000222,4756.0}),
-      Re1(start={740583.6661554204,733579.2410024012,727989.6956322317,
-            723523.7719978726,719949.083452038}),
-      Re2(start={749362.2436296802,740583.4363275196,733578.847078971,
-            727989.1781243386,723523.160221331,719948.3989712799}),
-      Tp(start={566.7107587234816,564.6165444590515,562.9210253140708,
-            561.5507555369106,560.4439112345017}),
-      dW1(start={-69249119.55799206,-55812352.70639346,-44875175.25275211,-36058712.5154484,
-            -28987599.176050894}),
-      dpf(start={12983.927210121412,12889.366640373046,12815.082130952236,
-            12756.553536106847,12710.273274401074,12673.539690947257}),
-      dpg(start={-12991.184976744373,-13086.599267586045,-13162.545177102518,-13223.007877866754,
-            -13271.213117195162,-13309.726124549381}),
-      h(start={1320860.75,1306300.3959955038,1294565.2503465663,
-            1285129.7635398565,1277548.0325652133,1271453.0789958118,1271870.0}),
-      hb(start={1320860.75,1306300.3959955038,1294565.2503465663,
-            1285129.7635398565,1277548.0325652133,1271453.125}),
-      hc(start={180523.44772428906,179936.1621517401,179471.06777899901,
-            179101.33846240045,178806.39043659117}),
-      k(start={0.569946753359113,0.573722908985942,0.5767222692010983,
-            0.5791085565193318,0.5810115503486866}),
-      khi(start={7.049457985512229,7.049515489164797,7.049562358112466,
-            7.049600406454843,7.04963122860244,7.0496561752247535}),
-      lambda(start={0.0657767456944642,0.06577728224679763,0.06577771956933479,
-            0.0657780745889896,0.06577836218281148,0.06577859495356282}),
-      mu1(start={9.076564447329419E-05,9.163230089927165E-05,
-            9.233585880170094E-05,9.290579846378351E-05,9.336709399321005E-05}),
-      mu2(start={8.970234931960748E-05,9.076567264091691E-05,
-            9.163235010476983E-05,9.233592444077152E-05,9.290587702048174E-05,
-            9.336718276065221E-05}),
-      pro1(
-        T(start={567.3354921625174,565.1217010135307,563.3282422450218,
-              561.8786435198738,560.7079351861411}),
-        cp(start={5327.898877713838,5282.546064954703,5247.57051599579,
-              5220.375967306578,5199.075673302522}),
-        d(start={738.087100783966,742.370361086612,745.7803902544199,
-              748.4991144642266,750.6712084932996}),
-        ddhp(start={-0.0003667150163882106,-0.00036267125202324435,-0.00035949446348235956,
-              -0.0003569875343856488,-0.0003550004903398353}),
-        ddph(start={1.4930262025550521E-06,1.4614963550783731E-06,
-              1.4370805647083529E-06,1.4180340988903081E-06,
-              1.4030766202504239E-06}),
-        duhp(start={0.9896012803795444,0.9898341468247962,0.9900149095023224,
-              0.9901561428863999,0.9902671498899273}),
-        duph(start={-0.0013125167905256381,-0.0013060700764397169,-0.00130096186580618,
-              -0.0012969049288770042,-0.0012936737729170376}),
-        s(start={3170.7342210727907,3149.9924774998135,3133.256064817905,
-              3119.768900323932,3108.9010528430404}),
-        u(start={1285388.1244827309,1273764.296231102,1264416.3343936033,
-              1256903.6453549922,1250863.3161830567})),
-      pro2(
-        T(start={570.0555662247484,567.3355046989993,565.1217212621291,
-              563.3282675173539,561.8786721184558,560.7079660237657}),
-        cp(start={5387.235260232886,5327.896269310702,5282.541730235789,
-              5247.5649580660265,5220.369521796719,5199.068570662013}),
-        d(start={732.7058598772968,738.0872481140804,742.3706151076258,
-              745.7807255196681,748.499512250512,750.6716548395405}),
-        ddhp(start={-0.0003718843818194896,-0.00036671474593060073,-0.0003626707952835976,
-              -0.00035949387041209376,-0.00035698683971734465,-0.0003549997187830147}),
-        ddph(start={1.5340643290419507E-06,1.49302442083723E-06,
-              1.4614933825355711E-06,1.4370767411953497E-06,
-              1.418029653345425E-06,1.403071711285525E-06}),
-        duhp(start={0.9892992328674202,0.9896012258163954,0.989834052257208,
-              0.9900147842057546,0.990155993791931,0.9902669822245412}),
-        duph(start={-0.0013206623008500686,-0.0013125163172357074,-0.0013060692661573865,
-              -0.0013009608024922982,-0.001296903673122904,-0.001293672369146186}),
-        s(start={3196.35777614949,3170.733985118013,3149.9920628368727,
-              3133.255509181626,3119.76823308283,3108.900296920819}),
-        u(start={1299806.4489164315,1285387.9947949746,1273764.0690164426,
-              1264416.0307001695,1256903.2814154255,1250862.9045688016}))),
-    UtubeHotLeg(
-      P(start={15603796.0,15577727.614323026,15551709.344574464,
-            15525716.51949442,15499735.670685165,15473759.57870937,
-            15447784.465941858}),
-      Pr(start={0.9268004226314326,0.8971396347539066,0.8775416482324144,
-            0.8642027240272148,0.8549049826417218}),
-      Q(start={4756.0,4756.000000000027,4756.000000000049,4756.00000000023,
-            4755.999999999889,4756.000000000298}),
-      Re1(start={816995.3279499422,793442.6308189121,775076.3558366023,
-            760661.5616884755,749299.5768554021}),
-      Re2(start={847542.9276429247,817037.1249277274,793480.3047247764,
-            775111.1863511867,760694.370248839,749330.9116737837}),
-      Tp(start={587.1410688151972,581.351590143596,576.5140193067363,
-            572.5233561655502,569.2602531471077}),
-      dW1(start={-207505371.01517224,-169198262.74651945,-137090988.37001908,-110582572.39883913,
-            -88924042.55678439}),
-      dpf(start={14143.81194485569,13764.518632868756,13482.820473560074,
-            13270.392383482202,13108.327493526067,12983.5743541072}),
-      dpg(start={11924.872459909686,12253.751115692325,12510.004606484494,
-            12710.456425773087,12867.764482269038,12991.53841340589}),
-      h(start={1470840.0,1427209.7706023622,1391634.021496701,
-            1362809.1711245335,1339557.9994679198,1320860.765961436,
-            1320860.765961436}),
-      hb(start={1470840.0,1427209.7706023622,1391634.021496701,
-            1362809.1711245335,1339557.9994679198,1320860.765961436}),
-      hc(start={187555.38528948984,185216.582662697,183515.50482115385,
-            182238.61828450867,181260.3808521235}),
-      k(start={0.5284168200072052,0.5411786649657128,0.551197601495285,
-            0.5590597516696791,0.5652344210825633}),
-      khi(start={7.048896016373707,7.049056166801461,7.049188260214804,
-            7.049296834023914,7.049385718832419,7.049458188350117}),
-      lambda(start={0.06577150209968165,0.06577299642363973,0.06577422895454853,
-            0.06577524202985809,0.06577607139198169,0.06577674758709429}),
-      mu1(start={8.22765460772732E-05,8.47188582186634E-05,
-            8.672636345929643E-05,8.836985741172549E-05,8.970985146834447E-05}),
-      mu2(start={7.931109039153023E-05,8.227233707518074E-05,
-            8.471483582482414E-05,8.672246631019158E-05,8.83660460415918E-05,
-            8.970610006578506E-05}),
-      pro1(
-        T(start={588.9428992538874,582.8393407915719,577.7306261648956,
-              573.5115915269528,570.059223059897}),
-        cp(start={5952.327309027776,5730.870788777803,5577.298902252968,
-              5467.259701867626,5386.495630467126}),
-        d(start={691.1393696485393,705.5901911305042,716.894355844004,
-              725.7655801061711,732.7457300092888}),
-        ddhp(start={-0.00041548998270447905,-0.0003994572498629732,-0.00038757428035144335,
-              -0.00037862878142235715,-0.00037180924688829547}),
-        ddph(start={1.91319578865726E-06,1.767277665407395E-06,
-              1.663998785124558E-06,1.5890580790989328E-06,
-              1.5335615339458522E-06}),
-        duhp(start={0.9864501839877983,0.9875220463222908,0.9882916342886477,
-              0.9888584611169464,0.9892845740694509}),
-        duph(start={-0.0013844936953371597,-0.0013620483336613369,-0.0013446373517510808,
-              -0.0013310957092423643,-0.0013205331280377107}),
-        s(start={3379.650823297018,3318.9650580844377,3269.3205658271177,
-              3228.9588862272317,3196.2954342913017}),
-        u(start={1404770.003448196,1369675.1460435805,1341214.065496725,
-              1318245.3532209487,1299772.0586219742})),
-      pro2(
-        T(start={596.0859322328323,588.9394205009859,582.836496418955,
-              577.7282303951965,573.5095216624127,570.0573948474027}),
-        cp(start={6287.424893223906,5953.011747630397,5731.418726272235,
-              5577.762203425434,5467.667497320038,5386.865405832935}),
-        d(start={672.5655854570739,691.1144182780886,705.5671748706197,
-              716.872704187517,725.7449152296059,732.7257937873638}),
-        ddhp(start={-0.0004375544161877137,-0.0004155478210543805,-0.0003995069791889279,
-              -0.00038761845216844966,-0.0003786690912750822,-0.000371846811703855}),
-        ddph(start={2.125515395357024E-06,1.9136349569729935E-06,
-              1.7676396373469588E-06,1.6643091376964355E-06,
-              1.5893335766528007E-06,1.5338129070568418E-06}),
-        duhp(start={0.9849190003473353,0.9864586372445425,0.987530108397677,
-              0.9882993906829337,0.9888659780016286,0.9892919034522494}),
-        duph(start={-0.0014135846194819153,-0.0013845792245474017,-0.0013621258029841872,
-              -0.001344709139399962,-0.001331163363567023,-0.001320597713727444}),
-        s(start={3453.2540402962327,3379.6830272823818,3318.99685723751,
-              3269.3520811919257,3228.9902023965774,3196.326609120125}),
-        u(start={1447760.1167475448,1404788.1563056246,1369692.9611076529,
-              1341231.6190219296,1318262.7055270243,1299789.255762014}))),
-    heatExchangerWall(Tp(start={572.0789891848713,569.0700877693051,
-            566.5630702140578,564.4965590612192,562.8055719815632}), Tp2(start=
-            {558.6506498964086,558.1207245404745,557.6914718731815,
-            557.340405491338,557.0510114671325})),
-    heatExchangerWall1(
-      Tp(start={561.6842105044655,560.5653235354345,559.6636953482239,
-            558.9333813618834,558.339804121777}),
-      Tp2(start={557.2028774753418,556.9535268626199,556.7596785703945,
-            556.5999062157297,556.4639234387017}),
-      dW2(start={-69249119.55796921,-55812352.70606944,-44875175.252391525,-36058712.51509096,
-            -28987599.19303869})),
-    volumeA(P(start=6758875.370722485), h(start=1214441.5268755823)),
-    volumeA1(P(start=6708825.183275267), h(start=1472510.1268426012)))
-    annotation (Placement(transformation(extent={{-34,-32},{32,44}})));
-
-equation
-  connect(sinkP1.C, singularPressureLoss1.C2)
-    annotation (Line(points={{74,66},{52,66},{50,66}}));
-  connect(singularPressureLoss2.C1, sourceQ1.C)
-    annotation (Line(points={{48,35},{72,35},{72,34}}));
-  connect(sourceQ.C, steamGenerator_1SG.fluidInlet1) annotation (Line(points={{-56,-53},
-          {-36,-53},{-36,-24.9067},{-11.12,-24.9067}},            color={0,0,
-          255}));
-  connect(sinkP.C, steamGenerator_1SG.fluidOutletI1) annotation (Line(points={{68,-54},
-          {34,-54},{34,-24.9067},{9.12,-24.9067}},           color={0,0,255}));
-  connect(singularPressureLoss2.C2, steamGenerator_1SG.fluidInlet)
-    annotation (Line(points={{30,35},{26,35},{26,34.3733},{10.44,34.3733}},
-        color={0,0,255}));
-  connect(singularPressureLoss1.C1, steamGenerator_1SG.fluidOutletI)
-    annotation (Line(points={{32,66},{-2,66},{-2,43.7467},{-1,43.7467}},
-        color={0,0,255}));
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-                                                                 Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSteamGenerator_1SG;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamGenerator_1SG
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(
+    option_temperature=2,
+    P0(fixed=true) = 15450000,
+    h0=1.27187e6,
+    C(h(start=1271453.0789958118)),
+    Q(start=4756.000000000019))
+    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ(Q0=4756, h0=
+        1.47084e6,
+    C(h(start=1470840.0)),
+    P(start=15603796.298727792))
+    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ1(            h0=
+        991272, Q0=531.242,
+    P(start=6704397.556426741))
+    annotation (Placement(transformation(extent={{96,22},{72,46}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1(
+    h0=2.77257e6,
+    option_temperature=2,
+    C(Q(start=531.242), h(start=2776304.4264558135)),
+    P0=6600000) annotation (Placement(transformation(extent={{74,56},{94,76}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1(
+    C1(h_vol(start=991272)),
+    C2(h_vol(start=991271.9375)),
+    mode=0,
+    rho(start=34),
+    h(start=2.77257e6),
+    Q(start=531.242),
+    continuous_flow_reversal=true,
+    K(fixed=false),
+    T(start=503.196),
+    Pm(start=669455),
+    pro(
+      T(start=555.5635779732289),
+      cp(start=5183.453852937443),
+      d(start=34.53068824587431),
+      ddhp(start=-2.156841613579318E-05),
+      ddph(start=5.481510930910603E-06),
+      s(start=5838.851085717999),
+      u(start=2583625.398001984),
+      x(start=0.9995688867393426)))
+                      annotation (Placement(transformation(
+        origin={41,66},
+        extent={{9,-10},{-9,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss2(
+    mode=1,
+    C1(h_vol(start=991272)),
+    Q(start=530.891),
+    rho(start=830.88),
+    h(start=991272),
+    K=1e-2,
+    C2(h_vol(start=991272.0), P(start=6704394.159371604)),
+    T(start=503.196),
+    Pm(start=6704395.857899172),
+    deltaP(start=3.3970551367455455),
+    pro(
+      T(start=503.1981380178025),
+      cp(start=4647.872167379586),
+      d(start=830.7726875295028),
+      ddhp(start=-0.00029227872818718767),
+      ddph(start=9.9693370719189E-07),
+      duhp(start=0.9971608232003352),
+      duph(start=-0.0011940145451926898),
+      s(start=2602.778049180844),
+      u(start=983143.9313756793)))
+                       annotation (Placement(transformation(
+        origin={39,35},
+        extent={{-9,-11},{9,11}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_1SG
+    steamGenerator_1SG(DomeGV(zl(fixed=true),
+      Cm(Q(start=3674.543111465144), h(start=1472510.1268426012)),
+      Cs(Q(start=3143.3011114717247), h(start=1252158.8888439273)),
+      P(start=6706678.926114233),
+      Pfond(start=6713155.65634596),
+      Tp(start=556.0857394942999),
+      Wlv(start=-748.4701526083975),
+      Wpl(start=185.7513849789081),
+      hl(start=1252158.8888439273),
+      hv(start=2776304.4264558135),
+      lsat(
+        P(start=6706678.926114233),
+        T(start=556.0979754471518),
+        cp(start=5341.980766557827),
+        h(start=1252159.186054214),
+        rho(start=744.9920451286558)),
+      prod(
+        T(start=295.51270247400157),
+        cp(start=4163.931630049154),
+        d(start=1000.6707309660103),
+        ddhp(start=-5.7612413191868046E-05),
+        ddph(start=5.013387042126168E-07),
+        duhp(start=0.9996137572062725),
+        duph(start=-0.0009959686640933023),
+        s(start=328.5118402659254),
+        u(start=93346.94015574278)),
+      prol(
+        T(start=556.0919019058653),
+        cp(start=5341.843073436941),
+        d(start=745.0040954228513),
+        ddhp(start=-0.00037140817913333907),
+        ddph(start=1.5005173848478167E-06),
+        duhp(start=0.99551211563078),
+        duph(start=-0.0013241431051173875),
+        s(start=3095.2420470602237),
+        u(start=1243124.5376265536),
+        x(start=0.0)),
+      prom(
+        T(start=556.0979754471518),
+        cp(start=5322.793136052821),
+        d(start=188.68359292764998),
+        ddhp(start=-0.0006394536492507623),
+        ddph(start=5.1133513773564396E-05),
+        s(start=3491.54489930648),
+        u(start=1436965.5475707515),
+        x(start=0.14457362014386263)),
+      prov(
+        T(start=556.0789076325113),
+        cp(start=5211.391721748124),
+        d(start=34.82711185326052),
+        ddhp(start=-3.901275006925452E-05),
+        ddph(start=5.273416580142731E-06),
+        duhp(start=0.784285588979114),
+        duph(start=0.00044520376975680856),
+        s(start=5835.901887967359),
+        u(start=2583632.686761629),
+        x(start=1.0)),
+      vsat(
+        P(start=6706678.926114233),
+        T(start=556.0979754471518),
+        cp(start=5209.262014091696),
+        h(start=2776302.667894954),
+        rho(start=34.82323622886482)),
+      xmv(start=0.14457362014386263)),
+    CapteurPAlim(C2(h_vol(start=1214441.5268755828))),
+    DPSeparateurCyclone(
+      Pm(start=6707752.054694749),
+      deltaP(start=2146.25716103334),
+      deltaPf(start=2146.25716103334),
+      pro(
+        T(start=556.1086935353277),
+        cp(start=5323.052716283155),
+        d(start=188.73846727302114),
+        ddhp(start=-0.0006397351053078553),
+        ddph(start=5.114516226384435E-05),
+        s(start=3491.5346735317003),
+        u(start=1436970.1961034606),
+        x(start=0.14454313806934876))),
+    DPnulle_AlimDwnc(
+      Pm(start=6704394.142386328),
+      deltaP(start=0.03397055143729243),
+      pro(
+        T(start=503.1981380947931),
+        cp(start=4647.872182942484),
+        d(start=830.7726858215926),
+        ddhp(start=-0.00029227873038032787),
+        ddph(start=9.969337188465612E-07),
+        duhp(start=0.9971608238938426),
+        duph(start=-0.0011940145499922032),
+        s(start=2602.778053268592),
+        u(start=983143.9334160357))),
+    DPnulle_DomeDwnc(
+      Pm(start=6705536.525757642),
+      deltaP(start=2284.800713180426),
+      pro(
+        T(start=556.0865640531288),
+        cp(start=5341.751445758121),
+        d(start=744.4157218298644),
+        ddhp(start=-0.00995490926717634),
+        ddph(start=0.0005068167393487037),
+        s(start=3095.302614244789),
+        u(start=1243151.1041758733),
+        x(start=3.931424690222598E-05))),
+    DownComerGV(
+      Pm(start=6731634.748061769),
+      deltaP(start=-54481.245321432085),
+      deltaPf(start=25883.401832656895),
+      pro(
+        T(start=548.9248327285786),
+        cp(start=5193.648289919676),
+        d(start=758.7882745673616),
+        ddhp(start=-0.0003571815945850099),
+        ddph(start=1.3973083815380471E-06),
+        duhp(start=0.995823924007589),
+        duph(start=-0.0013015537136234854),
+        s(start=3026.856808580834),
+        u(start=1205504.3315645182))),
+    MixAlimDomeGV(
+      Cs(Q(start=3674.5431114717244), h(start=1214441.5268755828)),
+      P(start=6704394.125401053),
+      h(start=1214441.5268755828)),
+    RiserGV(
+      Bo(start={5.264551982702729E-05,4.24124411076559E-05,
+            3.409050891381302E-05,2.7385279816437412E-05,2.2009213639388002E-05}),
+      E(start={1.5087815666722353,1.760919957987664,1.9476847403074915,
+            2.097116088661417,2.2191758439457385}),
+      P(start={6758875.5,6744780.661967858,6734858.682936351,6727554.331945282,
+            6721071.1962960195,6714893.297883738,6708825.0}),
+      Pb(start={6758875.370722485,6744780.661967858,6734858.682936351,
+            6727554.331945282,6721071.1962960195,6714893.297883738,
+            6708825.183275267}),
+      Prl(start={0.8614060609915553,0.8612177743481639,0.8610795419185651,
+            0.8609571209529038,0.860840700352387}),
+      Prv(start={1.558060122469759,1.5573349629944262,1.5568015066398002,
+            1.5563283028859216,1.5558776204321105}),
+      Q(start={3674.543111473107,3674.54311170587,3674.543111581315,
+            3674.5431115457377,3674.543111529379,3674.5431114738362}),
+      Rel1(start={251532.7450854159,240987.01172095592,232483.9984969632,
+            225629.0583738281,220106.5497190104}),
+      Rel2(start={248927.84623701972,257504.08120653126,257411.52273225,
+            257337.40584396885,257269.3164124718,257203.43335380178}),
+      Rev1(start={126015.47546629705,126045.05144488405,126066.84046334997,
+            155209.85787602403,182019.8146249652}),
+      Rev2(start={1285890.5820611913,1260302.6037093343,1260559.4427392383,
+            1260765.1443104607,1260954.1455479627,1261137.0479626092}),
+      S(start={0.1549634611710962,0.12399319566793483,0.10767347985477606,
+            0.09730316139006305,0.09015797512251608}),
+      Xtt(start={7.311009664045045,2.8439271576801577,1.897054678974084,
+            1.4856019790614363,1.258516343197067}),
+      cpl(start={5349.469481129635,5347.516592209151,5346.080165928101,
+            5344.806120274413,5343.592832739081}),
+      cpv(start={5227.826905277505,5222.985689734148,5219.424745327635,
+            5216.2663179883575,5213.258487155894}),
+      dpf(start={640.5716824740767,987.6792218283877,1565.132025124198,
+            2033.342774898577,2412.0434228872004,2717.9759070918435}),
+      dpg(start={13454.137072152957,8934.299809678538,5739.21896594421,
+            4449.792874364351,3765.854989394447,3350.1387013794383}),
+      filo(start={1.0,1.5127576625518269,2.397698418903442,3.115489764426855,
+            3.69629921982833,4.165735623228427}),
+      h(start={1214441.5,1289758.2348790504,1350993.226176363,
+            1400513.9851121805,1440421.3369830078,1472510.126842601,1472510.125}),
+      hb(start={1214441.5268755823,1289758.2348790504,1350993.226176363,
+            1400513.9851121805,1440421.3369830078,1472510.126842601}),
+      hcl(start={7035.100994857359,6799.356131209278,6607.618400143516,
+            6452.049964861143,6326.112386914556}),
+      hcv(start={566.4591939112424,566.0661558687939,565.7769561570168,
+            667.8050163368257,758.1769879991693}),
+      heb(start={23295.840202370804,20136.327196381662,17383.684434211296,
+            15004.435655175634,12955.702450307694}),
+      hi(start={14224.434729366436,14469.889471006716,14741.319323463362,
+            14990.676810280005,15206.815694336261}),
+      khi(start={2.34544191189234,3.5476325020812607,5.62295229531067,
+            7.306285427856448,8.668378220483625,9.769286547251083}),
+      kl(start={0.5726540836020793,0.5728072487009809,0.5729200372395459,
+            0.573020167674377,0.5731156035260583}),
+      kv(start={0.06323778626765368,0.06319381227590415,0.06316144860435968,
+            0.06313272992044888,0.06310536893560353}),
+      lambdal(start={0.047855836354927225,0.04784973013189612,
+            0.04784979386553329,0.047849844933704144,0.04784989187470238,
+            0.04784993731823128}),
+      lambdav(start={0.04770773819080876,0.047708461262474786,
+            0.047708453858867454,0.04770844793151606,0.04770844248709371,
+            0.04770843721990883}),
+      lsat1(
+        P(start={6744780.661967858,6734858.682936351,6727554.331945282,
+              6721071.1962960195,6714893.297883738}),
+        T(start={556.4777242585986,556.3789929681456,556.3062380340273,
+              556.24161223393,556.1799847947086}),
+        cp(start={5349.469481129635,5347.516592209151,5346.080165928101,
+              5344.806120274413,5343.592832739081}),
+        h(start={1254164.4193918111,1253642.8508641238,1253258.6094974852,
+              1252917.3728564607,1252592.0313789598}),
+        rho(start={744.3038527038548,744.4829488814046,744.6148470020331,
+              744.7319526076345,744.8435767532254})),
+      lsat2(
+        P(start={6751828.016345171,6739819.672452104,6731206.507440817,
+              6724312.764120651,6717982.247089879,6711859.240579503}),
+        T(start={556.5477834490828,556.4283724952538,556.3426230413967,
+              556.2739310847983,556.2108039269156,556.1497027843936}),
+        cp(start={5350.857762973237,5348.492792087017,5346.798246788609,
+              5345.443039065573,5344.19938218037,5342.997245450023}),
+        h(start={1254534.6181015647,1253903.6885891953,1253450.759228525,
+              1253088.0141070336,1252754.7229785018,1252432.1902232456}),
+        rho(start={744.1766933998682,744.393390773562,744.5488924935185,
+              744.6733955012804,744.7877607629224,744.8984085068838})),
+      lv(start={1521663.0060791962,1522308.614823357,1522784.044517484,
+            1523206.1266938604,1523608.4279569504}),
+      mul1(start={9.221245213314675E-05,9.225063173725626E-05,
+            9.227877396345615E-05,9.230377729464815E-05,9.232762543199986E-05}),
+      mul2(start={9.54091599276262E-05,9.223153505875156E-05,
+            9.22646991116657E-05,9.22912726762199E-05,9.231569867567667E-05,
+            9.233934548378382E-05}),
+      muv1(start={1.8846888927678993E-05,1.8842466579145694E-05,
+            1.8839209902747067E-05,1.8836318627906903E-05,1.883356282791608E-05}),
+      muv2(start={1.846968709732503E-05,1.884467795565175E-05,
+            1.8840838351230148E-05,1.883776435263538E-05,1.883494080755032E-05,
+            1.883220918015266E-05}),
+      pro1(
+        T(start={556.4777242585986,556.3789929681456,556.3062380340273,
+              556.24161223393,556.1799847947086}),
+        cp(start={5346.624091984354,5339.552944118439,5333.832407225015,
+              5328.983099309423,5324.780334377812}),
+        d(start={505.1476771686893,324.12933637240366,251.22634915738507,
+              212.58399061849084,189.10395271899358}),
+        ddhp(start={-0.004560382069667427,-0.0018800385426296002,-0.0011305175875149266,
+              -0.0008101742520365192,-0.0006416110037500664}),
+        ddph(start={0.0002526074465431572,0.00011948952669955124,
+              7.932514344963074E-05,6.117892216854974E-05,5.122276521956781E-05}),
+        s(start={3162.775727202852,3272.870886399854,3361.9284629388753,
+              3433.719481764495,3491.4667057518886}),
+        u(start={1276406.1381223714,1330214.9197190963,1373735.1286964042,
+              1408805.26289981,1437001.1213388292}),
+        x(start={0.023391391750366815,0.06394917191185662,0.09670141747601199,
+              0.12309822081239064,0.1443402986150028})),
+      pro2(
+        T(start={548.9265959900218,556.4283724952538,556.3426230413967,
+              556.2739310847983,556.2108039269156,556.1497027843936}),
+        cp(start={5193.192624799688,5345.59313827574,5338.752064316225,
+              5333.091571706786,5328.254175988971,5324.046285875985}),
+        d(start={758.8164659348321,503.89659112471367,323.69328702454266,
+              250.96935499905894,212.3950989164459,188.94860340273425}),
+        ddhp(start={-0.00035713056859328855,-0.0045407754940881,-0.0018758834037291676,
+              -0.0011286868959148294,-0.0008090640434138537,-0.0006408133811349972}),
+        ddph(start={1.3969923267307114E-06,0.00025179538730201796,
+              0.00011931701826041977,7.924917146391011E-05,
+              6.113292003174817E-05,5.118977604478324E-05}),
+        duhp(start={0.9958123063446975,0.0,0.0,0.0,0.0,0.0}),
+        duph(start={-0.0013014606682714325,0.0,0.0,0.0,0.0,0.0}),
+        s(start={3026.808438887448,3162.793397822675,3272.891152212068,
+              3361.951669299596,3433.7456165328513,3491.4955656881084}),
+        u(start={1205478.1102843666,1276382.8324826804,1330198.2119537464,
+              1373720.6231730473,1408791.6888349934,1436987.9842085352}),
+        x(start={0.0,0.023557740628157332,0.06406535291687379,
+              0.09680003145518278,0.12318873499805512,0.1444264764040964})),
+      rhol1(start={744.3038527038548,744.4829488814046,744.6148470020331,
+            744.7319526076345,744.8435767532254}),
+      rhol2(start={758.8164659348321,744.393390773562,744.5488924935185,
+            744.6733955012804,744.7877607629224,744.8984085068838}),
+      rhov1(start={35.04281039746895,34.985594751303,34.943490415577,
+            34.90613158466056,34.87054197829741}),
+      rhov2(start={35.08346516605899,35.01419932328164,34.96454082354485,
+            34.92480961500706,34.888335524811154,34.85306707615831}),
+      vsat1(
+        P(start={6744780.661967858,6734858.682936351,6727554.331945282,
+              6721071.1962960195,6714893.297883738}),
+        T(start={556.4777242585986,556.3789929681456,556.3062380340273,
+              556.24161223393,556.1799847947086}),
+        cp(start={5227.826905277505,5222.985689734148,5219.424745327635,
+              5216.2663179883575,5213.258487155894}),
+        h(start={2775827.4254710074,2775951.4656874808,2776042.6540149692,
+              2776123.499550321,2776200.45933591}),
+        rho(start={35.04281039746895,34.985594751303,34.943490415577,
+              34.90613158466056,34.87054197829741})),
+      vsat2(
+        P(start={6751828.016345171,6739819.672452104,6731206.507440817,
+              6724312.764120651,6717982.247089879,6711859.240579503}),
+        T(start={556.5477834490828,556.4283724952538,556.3426230413967,
+              556.2739310847983,556.2108039269156,556.1497027843936}),
+        cp(start={5231.268420588046,5225.40569909934,5221.204893969272,
+              5217.845277235249,5214.762171938293,5211.781972143657}),
+        h(start={2775739.2015562006,2775889.4704939374,2775997.073371233,
+              2776083.0874444144,2776161.9891337138,2776238.22703045}),
+        rho(start={35.08346516605899,35.01419932328164,34.96454082354485,
+              34.92480961500706,34.888335524811154,34.85306707615831})),
+      xbi(start={0.1,0.1,0.1,0.12309822081239064,0.1443402986150028}),
+      xbs(start={0.023391391750366815,0.06394917191185662,0.09670141747601199,
+            0.12309822081239064,0.1443402986150028}),
+      xv1(start={0.023391391750366815,0.06394917191185662,0.09670141747601199,
+            0.12309822081239064,0.1443402986150028}),
+      xv2(start={0.0,0.023557740628157332,0.06406535291687379,
+            0.09680003145518278,0.12318873499805512,0.1444264764040964})),
+    UtubeColdtLeg(
+      P(start={15447784.0,15447791.72370848,15447988.956335694,
+            15448336.419381844,15448802.873723604,15449363.813566398,15450000.0}),
+      Pr(start={0.848483077540291,0.8437031935743279,0.8401599107455334,
+            0.8374996225903174,0.8354783769371337}),
+      Q(start={4756.0,4755.999999999917,4756.000000000249,4755.999999999868,
+            4756.000000000222,4756.0}),
+      Re1(start={740583.6661554204,733579.2410024012,727989.6956322317,
+            723523.7719978726,719949.083452038}),
+      Re2(start={749362.2436296802,740583.4363275196,733578.847078971,
+            727989.1781243386,723523.160221331,719948.3989712799}),
+      Tp(start={566.7107587234816,564.6165444590515,562.9210253140708,
+            561.5507555369106,560.4439112345017}),
+      dW1(start={-69249119.55799206,-55812352.70639346,-44875175.25275211,-36058712.5154484,
+            -28987599.176050894}),
+      dpf(start={12983.927210121412,12889.366640373046,12815.082130952236,
+            12756.553536106847,12710.273274401074,12673.539690947257}),
+      dpg(start={-12991.184976744373,-13086.599267586045,-13162.545177102518,-13223.007877866754,
+            -13271.213117195162,-13309.726124549381}),
+      h(start={1320860.75,1306300.3959955038,1294565.2503465663,
+            1285129.7635398565,1277548.0325652133,1271453.0789958118,1271870.0}),
+      hb(start={1320860.75,1306300.3959955038,1294565.2503465663,
+            1285129.7635398565,1277548.0325652133,1271453.125}),
+      hc(start={180523.44772428906,179936.1621517401,179471.06777899901,
+            179101.33846240045,178806.39043659117}),
+      k(start={0.569946753359113,0.573722908985942,0.5767222692010983,
+            0.5791085565193318,0.5810115503486866}),
+      khi(start={7.049457985512229,7.049515489164797,7.049562358112466,
+            7.049600406454843,7.04963122860244,7.0496561752247535}),
+      lambda(start={0.0657767456944642,0.06577728224679763,0.06577771956933479,
+            0.0657780745889896,0.06577836218281148,0.06577859495356282}),
+      mu1(start={9.076564447329419E-05,9.163230089927165E-05,
+            9.233585880170094E-05,9.290579846378351E-05,9.336709399321005E-05}),
+      mu2(start={8.970234931960748E-05,9.076567264091691E-05,
+            9.163235010476983E-05,9.233592444077152E-05,9.290587702048174E-05,
+            9.336718276065221E-05}),
+      pro1(
+        T(start={567.3354921625174,565.1217010135307,563.3282422450218,
+              561.8786435198738,560.7079351861411}),
+        cp(start={5327.898877713838,5282.546064954703,5247.57051599579,
+              5220.375967306578,5199.075673302522}),
+        d(start={738.087100783966,742.370361086612,745.7803902544199,
+              748.4991144642266,750.6712084932996}),
+        ddhp(start={-0.0003667150163882106,-0.00036267125202324435,-0.00035949446348235956,
+              -0.0003569875343856488,-0.0003550004903398353}),
+        ddph(start={1.4930262025550521E-06,1.4614963550783731E-06,
+              1.4370805647083529E-06,1.4180340988903081E-06,
+              1.4030766202504239E-06}),
+        duhp(start={0.9896012803795444,0.9898341468247962,0.9900149095023224,
+              0.9901561428863999,0.9902671498899273}),
+        duph(start={-0.0013125167905256381,-0.0013060700764397169,-0.00130096186580618,
+              -0.0012969049288770042,-0.0012936737729170376}),
+        s(start={3170.7342210727907,3149.9924774998135,3133.256064817905,
+              3119.768900323932,3108.9010528430404}),
+        u(start={1285388.1244827309,1273764.296231102,1264416.3343936033,
+              1256903.6453549922,1250863.3161830567})),
+      pro2(
+        T(start={570.0555662247484,567.3355046989993,565.1217212621291,
+              563.3282675173539,561.8786721184558,560.7079660237657}),
+        cp(start={5387.235260232886,5327.896269310702,5282.541730235789,
+              5247.5649580660265,5220.369521796719,5199.068570662013}),
+        d(start={732.7058598772968,738.0872481140804,742.3706151076258,
+              745.7807255196681,748.499512250512,750.6716548395405}),
+        ddhp(start={-0.0003718843818194896,-0.00036671474593060073,-0.0003626707952835976,
+              -0.00035949387041209376,-0.00035698683971734465,-0.0003549997187830147}),
+        ddph(start={1.5340643290419507E-06,1.49302442083723E-06,
+              1.4614933825355711E-06,1.4370767411953497E-06,
+              1.418029653345425E-06,1.403071711285525E-06}),
+        duhp(start={0.9892992328674202,0.9896012258163954,0.989834052257208,
+              0.9900147842057546,0.990155993791931,0.9902669822245412}),
+        duph(start={-0.0013206623008500686,-0.0013125163172357074,-0.0013060692661573865,
+              -0.0013009608024922982,-0.001296903673122904,-0.001293672369146186}),
+        s(start={3196.35777614949,3170.733985118013,3149.9920628368727,
+              3133.255509181626,3119.76823308283,3108.900296920819}),
+        u(start={1299806.4489164315,1285387.9947949746,1273764.0690164426,
+              1264416.0307001695,1256903.2814154255,1250862.9045688016}))),
+    UtubeHotLeg(
+      P(start={15603796.0,15577727.614323026,15551709.344574464,
+            15525716.51949442,15499735.670685165,15473759.57870937,
+            15447784.465941858}),
+      Pr(start={0.9268004226314326,0.8971396347539066,0.8775416482324144,
+            0.8642027240272148,0.8549049826417218}),
+      Q(start={4756.0,4756.000000000027,4756.000000000049,4756.00000000023,
+            4755.999999999889,4756.000000000298}),
+      Re1(start={816995.3279499422,793442.6308189121,775076.3558366023,
+            760661.5616884755,749299.5768554021}),
+      Re2(start={847542.9276429247,817037.1249277274,793480.3047247764,
+            775111.1863511867,760694.370248839,749330.9116737837}),
+      Tp(start={587.1410688151972,581.351590143596,576.5140193067363,
+            572.5233561655502,569.2602531471077}),
+      dW1(start={-207505371.01517224,-169198262.74651945,-137090988.37001908,-110582572.39883913,
+            -88924042.55678439}),
+      dpf(start={14143.81194485569,13764.518632868756,13482.820473560074,
+            13270.392383482202,13108.327493526067,12983.5743541072}),
+      dpg(start={11924.872459909686,12253.751115692325,12510.004606484494,
+            12710.456425773087,12867.764482269038,12991.53841340589}),
+      h(start={1470840.0,1427209.7706023622,1391634.021496701,
+            1362809.1711245335,1339557.9994679198,1320860.765961436,
+            1320860.765961436}),
+      hb(start={1470840.0,1427209.7706023622,1391634.021496701,
+            1362809.1711245335,1339557.9994679198,1320860.765961436}),
+      hc(start={187555.38528948984,185216.582662697,183515.50482115385,
+            182238.61828450867,181260.3808521235}),
+      k(start={0.5284168200072052,0.5411786649657128,0.551197601495285,
+            0.5590597516696791,0.5652344210825633}),
+      khi(start={7.048896016373707,7.049056166801461,7.049188260214804,
+            7.049296834023914,7.049385718832419,7.049458188350117}),
+      lambda(start={0.06577150209968165,0.06577299642363973,0.06577422895454853,
+            0.06577524202985809,0.06577607139198169,0.06577674758709429}),
+      mu1(start={8.22765460772732E-05,8.47188582186634E-05,
+            8.672636345929643E-05,8.836985741172549E-05,8.970985146834447E-05}),
+      mu2(start={7.931109039153023E-05,8.227233707518074E-05,
+            8.471483582482414E-05,8.672246631019158E-05,8.83660460415918E-05,
+            8.970610006578506E-05}),
+      pro1(
+        T(start={588.9428992538874,582.8393407915719,577.7306261648956,
+              573.5115915269528,570.059223059897}),
+        cp(start={5952.327309027776,5730.870788777803,5577.298902252968,
+              5467.259701867626,5386.495630467126}),
+        d(start={691.1393696485393,705.5901911305042,716.894355844004,
+              725.7655801061711,732.7457300092888}),
+        ddhp(start={-0.00041548998270447905,-0.0003994572498629732,-0.00038757428035144335,
+              -0.00037862878142235715,-0.00037180924688829547}),
+        ddph(start={1.91319578865726E-06,1.767277665407395E-06,
+              1.663998785124558E-06,1.5890580790989328E-06,
+              1.5335615339458522E-06}),
+        duhp(start={0.9864501839877983,0.9875220463222908,0.9882916342886477,
+              0.9888584611169464,0.9892845740694509}),
+        duph(start={-0.0013844936953371597,-0.0013620483336613369,-0.0013446373517510808,
+              -0.0013310957092423643,-0.0013205331280377107}),
+        s(start={3379.650823297018,3318.9650580844377,3269.3205658271177,
+              3228.9588862272317,3196.2954342913017}),
+        u(start={1404770.003448196,1369675.1460435805,1341214.065496725,
+              1318245.3532209487,1299772.0586219742})),
+      pro2(
+        T(start={596.0859322328323,588.9394205009859,582.836496418955,
+              577.7282303951965,573.5095216624127,570.0573948474027}),
+        cp(start={6287.424893223906,5953.011747630397,5731.418726272235,
+              5577.762203425434,5467.667497320038,5386.865405832935}),
+        d(start={672.5655854570739,691.1144182780886,705.5671748706197,
+              716.872704187517,725.7449152296059,732.7257937873638}),
+        ddhp(start={-0.0004375544161877137,-0.0004155478210543805,-0.0003995069791889279,
+              -0.00038761845216844966,-0.0003786690912750822,-0.000371846811703855}),
+        ddph(start={2.125515395357024E-06,1.9136349569729935E-06,
+              1.7676396373469588E-06,1.6643091376964355E-06,
+              1.5893335766528007E-06,1.5338129070568418E-06}),
+        duhp(start={0.9849190003473353,0.9864586372445425,0.987530108397677,
+              0.9882993906829337,0.9888659780016286,0.9892919034522494}),
+        duph(start={-0.0014135846194819153,-0.0013845792245474017,-0.0013621258029841872,
+              -0.001344709139399962,-0.001331163363567023,-0.001320597713727444}),
+        s(start={3453.2540402962327,3379.6830272823818,3318.99685723751,
+              3269.3520811919257,3228.9902023965774,3196.326609120125}),
+        u(start={1447760.1167475448,1404788.1563056246,1369692.9611076529,
+              1341231.6190219296,1318262.7055270243,1299789.255762014}))),
+    heatExchangerWall(Tp(start={572.0789891848713,569.0700877693051,
+            566.5630702140578,564.4965590612192,562.8055719815632}), Tp2(start=
+            {558.6506498964086,558.1207245404745,557.6914718731815,
+            557.340405491338,557.0510114671325})),
+    heatExchangerWall1(
+      Tp(start={561.6842105044655,560.5653235354345,559.6636953482239,
+            558.9333813618834,558.339804121777}),
+      Tp2(start={557.2028774753418,556.9535268626199,556.7596785703945,
+            556.5999062157297,556.4639234387017}),
+      dW2(start={-69249119.55796921,-55812352.70606944,-44875175.252391525,-36058712.51509096,
+            -28987599.19303869})),
+    volumeA(P(start=6758875.370722485), h(start=1214441.5268755823)),
+    volumeA1(P(start=6708825.183275267), h(start=1472510.1268426012)))
+    annotation (Placement(transformation(extent={{-34,-32},{32,44}})));
+equation
+  connect(sinkP1.C, singularPressureLoss1.C2)
+    annotation (Line(points={{74,66},{52,66},{50,66}}));
+  connect(singularPressureLoss2.C1, sourceQ1.C)
+    annotation (Line(points={{48,35},{72,35},{72,34}}));
+  connect(sourceQ.C, steamGenerator_1SG.fluidInlet1) annotation (Line(points={{-56,-53},
+          {-36,-53},{-36,-24.9067},{-11.12,-24.9067}},            color={0,0,
+          255}));
+  connect(sinkP.C, steamGenerator_1SG.fluidOutletI1) annotation (Line(points={{68,-54},
+          {34,-54},{34,-24.9067},{9.12,-24.9067}},           color={0,0,255}));
+  connect(singularPressureLoss2.C2, steamGenerator_1SG.fluidInlet)
+    annotation (Line(points={{30,35},{26,35},{26,34.3733},{10.44,34.3733}},
+        color={0,0,255}));
+  connect(singularPressureLoss1.C1, steamGenerator_1SG.fluidOutletI)
+    annotation (Line(points={{32,66},{-2,66},{-2,43.7467},{-1,43.7467}},
+        color={0,0,255}));
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+                                                                 Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSteamGenerator_1SG;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge.mo
new file mode 100644
index 0000000000000000000000000000000000000000..6e108bcc4f834beb440d879771dd94d09fd638a3
--- /dev/null
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge.mo
@@ -0,0 +1,164 @@
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamGenerator_1SG_withClosedPurge
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkPrimaire(
+    option_temperature=2,
+    P0(fixed=true) = 15450000,
+    h0=1.27187e6)
+    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourcePrimaire(h0=
+        1.47084e6, Q0=19024/4)
+    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceGV(
+    P0=7370400,
+    h0=978133.25,
+    option_temperature=2)
+    annotation (Placement(transformation(extent={{98,24},{74,48}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV(Q0=(2147.6 -
+        0.00093930797)/4,
+    h0=2.77090e6)
+    annotation (Placement(transformation(extent={{74,56},{94,76}})));
+
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VV_GV(
+    Cvmax(fixed=false) = 8791.226,
+    Q(fixed=false),
+    Pm(fixed=false),
+    C2(P(fixed=false, start=6880000)))
+    annotation (Placement(transformation(extent={{66,32},{44,52}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{24,62},{44,82}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.7)
+            annotation (Placement(transformation(extent={{26,-12},{46,8}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_1SG_purges
+    steamGenerator_1SG(
+    DomeGV(
+      R=2.2,
+      L=5,
+      zl(start=0.66, fixed=true)),
+    MixAlimDomeGV,
+    DPnulle_DomeDwnc,
+    CapteurPAlim,
+    RiserGV(
+      L=10.8,
+      z2=10.8,
+      dpfCorr(fixed=true) = 5.7,
+      C1(P(fixed=false, start=7070000)),
+      C2(P(fixed=false, start=6880000))),
+    DownComerGV(lambda=0.01))
+    annotation (Placement(transformation(extent={{-46,-26},{10,36}})));
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV_apg(Q0=0.00093930797/
+        4,
+    h0=1199.465e3)
+    annotation (Placement(transformation(extent={{58,-40},{78,-20}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV_apg(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{8,-34},{28,-14}})));
+equation
+  connect(VV_GV.C1, sourceGV.C)
+    annotation (Line(points={{66,36},{74,36}},   color={0,0,255}));
+  connect(DP_GV.C2, sinkGV.C) annotation (Line(points={{44,72},{68,72},{68,66},
+          {74,66}}, color={238,46,47}));
+  connect(constante.y, VV_GV.Ouv) annotation (Line(points={{47,-2},{62,-2},{
+          62,53},{55,53}},     color={0,0,255}));
+  connect(sourcePrimaire.C, steamGenerator_1SG.fluidInlet1) annotation (Line(
+        points={{-56,-53},{-26.5867,-53},{-26.5867,-20.2133}}, color={0,0,255}));
+  connect(steamGenerator_1SG.fluidOutletI1, sinkPrimaire.C) annotation (Line(
+        points={{-9.41333,-20.2133},{-9.41333,-54},{68,-54}}, color={28,108,
+          200}));
+  connect(VV_GV.C2, steamGenerator_1SG.fluidInlet) annotation (Line(points={{44,36},
+          {-8.29333,36},{-8.29333,28.1467}},        color={0,0,255}));
+  connect(DP_GV.C1, steamGenerator_1SG.fluidOutletI) annotation (Line(points={{24,72},
+          {8,72},{8,70},{-18,70},{-18,35.7933}},          color={238,46,47}));
+  connect(DP_GV_apg.C2, sinkGV_apg.C) annotation (Line(points={{28,-24},{52,-24},
+          {52,-30},{58,-30}}, color={238,46,47}));
+  connect(DP_GV_apg.C1, steamGenerator_1SG.fluidOutletI2) annotation (Line(
+        points={{8,-24},{8,-14},{-10.3467,-14},{-10.3467,-14.22}}, color={0,0,
+          255}));
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
+        coordinateSystem(preserveAspectRatio=false), graphics={Text(
+          extent={{-184,104},{-100,-100}},
+          lineColor={28,108,200},
+          textString="// Iteration variables values:
+DP_GV.Pm                                		=		6606527.5;
+DP_GV_apg.Pm                            		=		6684628.0;
+VV_GV.C2.P                              		=		6605371.5;
+VV_GV.C2.h_vol                          		=		978133.25;
+sinkPrimaire.Q                          		=		4756.0;
+sourcePrimaire.P                        		=		15603434.0;
+steamGenerator_1SG.CapteurPAlim.C2.h_vol		=		1194875.2;
+steamGenerator_1SG.DPnulle_AlimDwnc.pro.d		=		834.49225;
+steamGenerator_1SG.DPnulle_DomeDwnc.Pm  		=		6605949.5;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		2775.5164;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		2775.5164;
+steamGenerator_1SG.DomeGV.Cs.Q          		=		2238.6167;
+steamGenerator_1SG.DomeGV.Cs.Q          		=		2238.6167;
+steamGenerator_1SG.DomeGV.Pfond         		=		6613003.5;
+steamGenerator_1SG.DomeGV.Tp            		=		555.0794;
+steamGenerator_1SG.DomeGV.hl            		=		1246857.8;
+steamGenerator_1SG.DomeGV.hv            		=		2777538.2;
+steamGenerator_1SG.DownComerGV.pro.d    		=		765.5975;
+steamGenerator_1SG.MixAlimDomeGV.Cs.Q   		=		2775.5166;
+steamGenerator_1SG.MixAlimDomeGV.P      		=		6605371.5;
+steamGenerator_1SG.MixAlimDomeGV.h      		=		1194875.2;
+steamGenerator_1SG.RiserGV.P[2]         		=		6669056.5;
+steamGenerator_1SG.RiserGV.P[3]         		=		6657418.5;
+steamGenerator_1SG.RiserGV.P[4]         		=		6646543.0;
+steamGenerator_1SG.RiserGV.P[5]         		=		6634788.5;
+steamGenerator_1SG.RiserGV.P[6]         		=		6621947.0;
+steamGenerator_1SG.RiserGV.Q[1]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[2]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[3]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[4]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[5]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[6]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.h[2]         		=		1296133.1;
+steamGenerator_1SG.RiserGV.h[3]         		=		1378483.9;
+steamGenerator_1SG.RiserGV.h[4]         		=		1445231.9;
+steamGenerator_1SG.RiserGV.h[5]         		=		1499247.2;
+steamGenerator_1SG.RiserGV.h[6]         		=		1542954.6;
+steamGenerator_1SG.UtubeColdtLeg.P[2]   		=		15447537.0;
+steamGenerator_1SG.UtubeColdtLeg.P[3]   		=		15447781.0;
+steamGenerator_1SG.UtubeColdtLeg.P[4]   		=		15448178.0;
+steamGenerator_1SG.UtubeColdtLeg.P[5]   		=		15448695.0;
+steamGenerator_1SG.UtubeColdtLeg.P[6]   		=		15449308.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[2]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[3]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[4]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[5]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.h[2]   		=		1303392.5;
+steamGenerator_1SG.UtubeColdtLeg.h[3]   		=		1291469.1;
+steamGenerator_1SG.UtubeColdtLeg.h[4]   		=		1281842.6;
+steamGenerator_1SG.UtubeColdtLeg.h[5]   		=		1274047.8;
+steamGenerator_1SG.UtubeColdtLeg.h[6]   		=		1267707.1;
+steamGenerator_1SG.UtubeHotLeg.P[2]     		=		15577376.0;
+steamGenerator_1SG.UtubeHotLeg.P[3]     		=		15551369.0;
+steamGenerator_1SG.UtubeHotLeg.P[4]     		=		15525387.0;
+steamGenerator_1SG.UtubeHotLeg.P[5]     		=		15499416.0;
+steamGenerator_1SG.UtubeHotLeg.P[6]     		=		15473450.0;
+steamGenerator_1SG.UtubeHotLeg.P[7]     		=		15447485.0;
+steamGenerator_1SG.UtubeHotLeg.Q[2]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[3]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[4]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[5]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[6]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.h[2]     		=		1426528.4;
+steamGenerator_1SG.UtubeHotLeg.h[3]     		=		1390393.4;
+steamGenerator_1SG.UtubeHotLeg.h[4]     		=		1361066.9;
+steamGenerator_1SG.UtubeHotLeg.h[5]     		=		1337339.4;
+steamGenerator_1SG.UtubeHotLeg.h[6]     		=		1318173.1;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1318173.1;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1318173.1;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].T		=		569.5575;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].d		=		733.7242;
+steamGenerator_1SG.heatExchangerWall1.Tp2[1]		=		556.5059;
+steamGenerator_1SG.heatExchangerWall1.Tp2[2]		=		556.2378;
+steamGenerator_1SG.heatExchangerWall1.Tp2[3]		=		556.00116;
+steamGenerator_1SG.heatExchangerWall1.Tp2[4]		=		555.7813;
+steamGenerator_1SG.heatExchangerWall1.Tp2[5]		=		555.5722;
+steamGenerator_1SG.volumeA.P            		=		6684628.0;
+steamGenerator_1SG.volumeA.h            		=		1194875.2;
+steamGenerator_1SG.volumeA1.P           		=		6608082.0;
+steamGenerator_1SG.volumeA1.h           		=		1542954.6;")}));
+end TestSteamGenerator_1SG_withClosedPurge;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge2.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge2.mo
new file mode 100644
index 0000000000000000000000000000000000000000..7b8bb2a855f5726786baf7a5195b47d20beb6172
--- /dev/null
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge2.mo
@@ -0,0 +1,176 @@
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamGenerator_1SG_withClosedPurge2
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkPrimaire(
+    option_temperature=2,
+    P0(fixed=true) = 15450000,
+    h0=1.27187e6)
+    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourcePrimaire(h0=
+        1.47084e6, Q0=19024/4)
+    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceGV(
+    P0=7370400,
+    h0=978133.25,
+    option_temperature=2)
+    annotation (Placement(transformation(extent={{98,24},{74,48}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV(Q0=2147.6 -
+        0.00093930797,
+    h0=2.77090e6)
+    annotation (Placement(transformation(extent={{74,60},{94,80}})));
+
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VV_GV(
+    Cvmax(fixed=false) = 8791.226,
+    Q(fixed=false),
+    Pm(fixed=false),
+    C2(P(fixed=false, start=6880000)))
+    annotation (Placement(transformation(extent={{28,32},{6,52}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{24,60},{44,80}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.7)
+            annotation (Placement(transformation(extent={{2,0},{22,20}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_1SG_purges
+    steamGenerator_1SG(
+    DomeGV(
+      R=2.2,
+      L=5,
+      zl(start=0.66, fixed=true)),
+    MixAlimDomeGV,
+    DPnulle_DomeDwnc,
+    CapteurPAlim,
+    RiserGV(
+      L=10.8,
+      z2=10.8,
+      dpfCorr(fixed=true) = 5.7,
+      C1(P(fixed=false, start=7070000)),
+      C2(P(fixed=false, start=6880000))),
+    DownComerGV(lambda=0.01))
+    annotation (Placement(transformation(extent={{-46,-26},{10,36}})));
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV_apg(Q0=0.00093930797,
+    h0=1199.465e3)
+    annotation (Placement(transformation(extent={{58,-40},{78,-20}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV_apg(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{28,-24},{48,-4}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=4)
+    annotation (Placement(transformation(extent={{-16,60},{4,80}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier1(alpha=0.25)
+    annotation (Placement(transformation(extent={{64,26},{44,46}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=4)
+    annotation (Placement(transformation(extent={{0,-24},{20,-4}})));
+equation
+  connect(DP_GV.C2, sinkGV.C) annotation (Line(points={{44,70},{74,70}},
+                    color={238,46,47}));
+  connect(constante.y, VV_GV.Ouv) annotation (Line(points={{23,10},{36,10},{36,
+          58},{17,58},{17,53}},color={0,0,255}));
+  connect(sourcePrimaire.C, steamGenerator_1SG.fluidInlet1) annotation (Line(
+        points={{-56,-53},{-26.5867,-53},{-26.5867,-20.2133}}, color={0,0,255}));
+  connect(steamGenerator_1SG.fluidOutletI1, sinkPrimaire.C) annotation (Line(
+        points={{-9.41333,-20.2133},{-9.41333,-54},{68,-54}}, color={28,108,
+          200}));
+  connect(VV_GV.C2, steamGenerator_1SG.fluidInlet) annotation (Line(points={{6,36},{
+          -8.29333,36},{-8.29333,28.1467}},         color={0,0,255}));
+  connect(DP_GV_apg.C2, sinkGV_apg.C) annotation (Line(points={{48,-14},{54,-14},
+          {54,-24},{52,-24},{52,-30},{58,-30}},
+                              color={238,46,47}));
+  connect(DP_GV.C1, massFlowMultiplier.Cs)
+    annotation (Line(points={{24,70},{4,70}}, color={0,0,255}));
+  connect(massFlowMultiplier.Ce, steamGenerator_1SG.fluidOutletI) annotation (
+      Line(points={{-16,70},{-18,70},{-18,35.7933}}, color={0,0,255}));
+  connect(VV_GV.C1, massFlowMultiplier1.Cs)
+    annotation (Line(points={{28,36},{44,36}}, color={0,0,255}));
+  connect(massFlowMultiplier1.Ce, sourceGV.C)
+    annotation (Line(points={{64,36},{74,36}}, color={0,0,255}));
+  connect(DP_GV_apg.C1, massFlowMultiplier2.Cs)
+    annotation (Line(points={{28,-14},{20,-14}}, color={0,0,255}));
+  connect(massFlowMultiplier2.Ce, steamGenerator_1SG.fluidOutletI2) annotation (
+     Line(points={{0,-14},{-10.3467,-14},{-10.3467,-14.22}}, color={0,0,255}));
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
+        coordinateSystem(preserveAspectRatio=false), graphics={Text(
+          extent={{-184,104},{-100,-100}},
+          lineColor={28,108,200},
+          textString="// Iteration variables values:
+DP_GV.Pm                                		=		6606527.5;
+DP_GV_apg.Pm                            		=		6684629.0;
+VV_GV.C2.P                              		=		6605373.0;
+VV_GV.C2.h_vol                          		=		978133.25;
+sinkPrimaire.Q                          		=		4756.0;
+sourcePrimaire.P                        		=		15603434.0;
+steamGenerator_1SG.CapteurPAlim.C2.h_vol		=		1194875.4;
+steamGenerator_1SG.DPnulle_AlimDwnc.pro.d		=		834.49225;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		2775.5164;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		2775.5164;
+steamGenerator_1SG.DomeGV.Cs.Q          		=		2238.6167;
+steamGenerator_1SG.DomeGV.P             		=		6606528.5;
+steamGenerator_1SG.DomeGV.Pfond         		=		6613005.0;
+steamGenerator_1SG.DomeGV.Tp            		=		555.09186;
+steamGenerator_1SG.DomeGV.hl            		=		1246857.9;
+steamGenerator_1SG.DomeGV.hv            		=		2777537.8;
+steamGenerator_1SG.DownComerGV.pro.d    		=		765.5974;
+steamGenerator_1SG.MixAlimDomeGV.Cs.Q   		=		2775.5166;
+steamGenerator_1SG.MixAlimDomeGV.P      		=		6605373.0;
+steamGenerator_1SG.MixAlimDomeGV.h      		=		1194875.4;
+steamGenerator_1SG.RiserGV.P[2]         		=		6669057.5;
+steamGenerator_1SG.RiserGV.P[3]         		=		6657419.5;
+steamGenerator_1SG.RiserGV.P[4]         		=		6646544.5;
+steamGenerator_1SG.RiserGV.P[5]         		=		6634789.5;
+steamGenerator_1SG.RiserGV.P[6]         		=		6621948.0;
+steamGenerator_1SG.RiserGV.Q[1]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[2]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[3]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[4]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[5]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.Q[6]         		=		2775.5164;
+steamGenerator_1SG.RiserGV.h[2]         		=		1296133.2;
+steamGenerator_1SG.RiserGV.h[3]         		=		1378483.9;
+steamGenerator_1SG.RiserGV.h[4]         		=		1445231.9;
+steamGenerator_1SG.RiserGV.h[5]         		=		1499247.4;
+steamGenerator_1SG.RiserGV.h[6]         		=		1542954.8;
+steamGenerator_1SG.UtubeColdtLeg.P[2]   		=		15447537.0;
+steamGenerator_1SG.UtubeColdtLeg.P[3]   		=		15447781.0;
+steamGenerator_1SG.UtubeColdtLeg.P[4]   		=		15448178.0;
+steamGenerator_1SG.UtubeColdtLeg.P[5]   		=		15448695.0;
+steamGenerator_1SG.UtubeColdtLeg.P[6]   		=		15449308.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[2]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[3]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[4]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[5]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.h[2]   		=		1303392.6;
+steamGenerator_1SG.UtubeColdtLeg.h[3]   		=		1291469.2;
+steamGenerator_1SG.UtubeColdtLeg.h[4]   		=		1281842.8;
+steamGenerator_1SG.UtubeColdtLeg.h[5]   		=		1274047.8;
+steamGenerator_1SG.UtubeColdtLeg.h[6]   		=		1267707.1;
+steamGenerator_1SG.UtubeHotLeg.P[2]     		=		15577376.0;
+steamGenerator_1SG.UtubeHotLeg.P[3]     		=		15551369.0;
+steamGenerator_1SG.UtubeHotLeg.P[4]     		=		15525387.0;
+steamGenerator_1SG.UtubeHotLeg.P[5]     		=		15499416.0;
+steamGenerator_1SG.UtubeHotLeg.P[6]     		=		15473450.0;
+steamGenerator_1SG.UtubeHotLeg.P[7]     		=		15447485.0;
+steamGenerator_1SG.UtubeHotLeg.Q[2]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[3]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[4]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[5]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[6]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.h[2]     		=		1426528.4;
+steamGenerator_1SG.UtubeHotLeg.h[3]     		=		1390393.4;
+steamGenerator_1SG.UtubeHotLeg.h[4]     		=		1361066.9;
+steamGenerator_1SG.UtubeHotLeg.h[5]     		=		1337339.4;
+steamGenerator_1SG.UtubeHotLeg.h[6]     		=		1318173.2;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1318173.2;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1318173.2;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].T		=		569.5575;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].d		=		733.7242;
+steamGenerator_1SG.fluidOutletI.h       		=		2777537.8;
+steamGenerator_1SG.fluidOutletI2.h      		=		1194875.4;
+steamGenerator_1SG.heatExchangerWall1.Tp2[1]		=		556.5059;
+steamGenerator_1SG.heatExchangerWall1.Tp2[2]		=		556.2378;
+steamGenerator_1SG.heatExchangerWall1.Tp2[3]		=		556.00116;
+steamGenerator_1SG.heatExchangerWall1.Tp2[4]		=		555.7813;
+steamGenerator_1SG.heatExchangerWall1.Tp2[5]		=		555.5722;
+steamGenerator_1SG.volumeA.P            		=		6684629.0;
+steamGenerator_1SG.volumeA.h            		=		1194875.4;
+steamGenerator_1SG.volumeA1.P           		=		6608083.0;
+steamGenerator_1SG.volumeA1.h           		=		1542954.8;")}));
+end TestSteamGenerator_1SG_withClosedPurge2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge3.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge3.mo
new file mode 100644
index 0000000000000000000000000000000000000000..5c8e3949f79e92a6a0a4109581d937b773c56b9e
--- /dev/null
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge3.mo
@@ -0,0 +1,160 @@
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamGenerator_1SG_withClosedPurge3
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkPrimaire(
+    option_temperature=2,
+    P0(fixed=true) = 15450000,
+    h0=1.27187e6)
+    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourcePrimaire(h0=
+        1.47084e6, Q0=19024/4)
+    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceGV(
+    P0=7370400,
+    h0=978133.25,
+    option_temperature=2)
+    annotation (Placement(transformation(extent={{98,24},{74,48}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV(Q0=(2147.6 - 0.00093930797)
+        /4,
+    h0=2.77090e6)
+    annotation (Placement(transformation(extent={{74,56},{94,76}})));
+
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VV_GV(
+    Cvmax(fixed=false) = 8791.226,
+    Q(fixed=false),
+    Pm(fixed=false),
+    C2(P(fixed=false, start=6880000)))
+    annotation (Placement(transformation(extent={{66,32},{44,52}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{24,62},{44,82}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.7)
+            annotation (Placement(transformation(extent={{26,-12},{46,8}})));
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV_apg(Q0=0.00093930797/4,
+    h0=1199.465e3)
+    annotation (Placement(transformation(extent={{58,-40},{78,-20}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV_apg(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{8,-34},{28,-14}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_1SG_purges
+    steamGenerator_1SG(
+    UtubeHotLeg(hcCorr=5.19),
+    UtubeColdtLeg(hcCorr=5.19),
+    DomeGV(zl(start=0.66, fixed=true)),
+    MixAlimDomeGV,
+    DPnulle_DomeDwnc,
+    CapteurPAlim,
+    heatExchangerWall(lambda=150),
+    heatExchangerWall1(lambda=150),
+    RiserGV(
+      dpfCorr(fixed=true) = 50,
+      hcCorr=5.19,
+      C1(P(fixed=false, start=7070000)),
+      C2(P(fixed=false, start=6880000)))) annotation (Placement(
+        transformation(extent={{-50,-6},{2,42}})));
+equation
+  connect(VV_GV.C1, sourceGV.C)
+    annotation (Line(points={{66,36},{74,36}},   color={0,0,255}));
+  connect(DP_GV.C2, sinkGV.C) annotation (Line(points={{44,72},{68,72},{68,66},
+          {74,66}}, color={238,46,47}));
+  connect(constante.y, VV_GV.Ouv) annotation (Line(points={{47,-2},{62,-2},{
+          62,53},{55,53}},     color={0,0,255}));
+  connect(DP_GV_apg.C2, sinkGV_apg.C) annotation (Line(points={{28,-24},{52,-24},
+          {52,-30},{58,-30}}, color={238,46,47}));
+  connect(VV_GV.C2, steamGenerator_1SG.fluidInlet) annotation (Line(points={{44,36},
+          {-14.9867,36},{-14.9867,35.92}},     color={0,0,255}));
+  connect(steamGenerator_1SG.fluidOutletI1, sinkPrimaire.C) annotation (Line(
+        points={{-16.0267,-1.52},{-16.0267,-54},{68,-54}}, color={255,0,0}));
+  connect(steamGenerator_1SG.fluidInlet1, sourcePrimaire.C) annotation (Line(
+        points={{-31.9733,-1.52},{-31.9733,-53},{-56,-53}}, color={0,0,255}));
+  connect(DP_GV_apg.C1, steamGenerator_1SG.fluidOutletI2) annotation (Line(
+        points={{8,-24},{-2,-24},{-2,3.12},{-16.8933,3.12}}, color={0,0,255}));
+  connect(DP_GV.C1, steamGenerator_1SG.fluidOutletI)
+    annotation (Line(points={{24,72},{-24,72},{-24,41.84}}, color={0,0,255}));
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
+        coordinateSystem(preserveAspectRatio=false), graphics={Text(
+          extent={{-184,104},{-100,-100}},
+          lineColor={28,108,200},
+          textString="// Iteration variables values:
+DP_GV.Pm                                                =                7068394.0;
+DP_GV_apg.Pm                                            =                7155291.5;
+VV_GV.C2.P                                              =                7068393.0;
+VV_GV.C2.h_vol                                          =                978133.25;
+sinkPrimaire.Q                                          =                4756.0;
+sourcePrimaire.P                                        =                15602120.0;
+steamGenerator_1SG.CapteurPAlim.C2.h_vol                =                1007554.1;
+steamGenerator_1SG.DPnulle_AlimDwnc.pro.d                =                834.9452;
+steamGenerator_1SG.DPnulle_DomeDwnc.Pm                  =                7068393.5;
+steamGenerator_1SG.DomeGV.Cm.Q                          =                596.8746;
+steamGenerator_1SG.DomeGV.Cm.Q                          =                596.8746;
+steamGenerator_1SG.DomeGV.Cs.Q                          =                59.97482;
+steamGenerator_1SG.DomeGV.Cs.Q                          =                59.97482;
+steamGenerator_1SG.DomeGV.Pfond                         =                7074872.0;
+steamGenerator_1SG.DomeGV.Tp                            =                559.62714;
+steamGenerator_1SG.DomeGV.hl                            =                1270932.5;
+steamGenerator_1SG.DomeGV.hv                            =                2771676.0;
+steamGenerator_1SG.DownComerGV.pro.d                    =                826.39777;
+steamGenerator_1SG.MixAlimDomeGV.Cs.Q                   =                596.8748;
+steamGenerator_1SG.MixAlimDomeGV.P                      =                7068393.0;
+steamGenerator_1SG.MixAlimDomeGV.h                      =                1007554.1;
+steamGenerator_1SG.RiserGV.P[2]                         =                7139844.0;
+steamGenerator_1SG.RiserGV.P[3]                         =                7131381.0;
+steamGenerator_1SG.RiserGV.P[4]                         =                7118790.0;
+steamGenerator_1SG.RiserGV.P[5]                         =                7103591.5;
+steamGenerator_1SG.RiserGV.P[6]                         =                7086486.0;
+steamGenerator_1SG.RiserGV.Q[1]                         =                596.8746;
+steamGenerator_1SG.RiserGV.Q[2]                         =                596.8746;
+steamGenerator_1SG.RiserGV.Q[3]                         =                596.8746;
+steamGenerator_1SG.RiserGV.Q[4]                         =                596.8746;
+steamGenerator_1SG.RiserGV.Q[5]                         =                596.8746;
+steamGenerator_1SG.RiserGV.Q[6]                         =                596.8746;
+steamGenerator_1SG.RiserGV.h[2]                         =                1763458.6;
+steamGenerator_1SG.RiserGV.h[3]                         =                2179319.5;
+steamGenerator_1SG.RiserGV.h[4]                         =                2415660.8;
+steamGenerator_1SG.RiserGV.h[5]                         =                2551510.8;
+steamGenerator_1SG.RiserGV.h[6]                         =                2620879.0;
+steamGenerator_1SG.UtubeColdtLeg.P[2]                   =                15446754.0;
+steamGenerator_1SG.UtubeColdtLeg.P[3]                   =                15447354.0;
+steamGenerator_1SG.UtubeColdtLeg.P[4]                   =                15447989.0;
+steamGenerator_1SG.UtubeColdtLeg.P[5]                   =                15448645.0;
+steamGenerator_1SG.UtubeColdtLeg.P[6]                   =                15449317.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[2]                   =                4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[3]                   =                4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[4]                   =                4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[5]                   =                4756.0;
+steamGenerator_1SG.UtubeColdtLeg.h[2]                   =                1275097.4;
+steamGenerator_1SG.UtubeColdtLeg.h[3]                   =                1272384.6;
+steamGenerator_1SG.UtubeColdtLeg.h[4]                   =                1270610.9;
+steamGenerator_1SG.UtubeColdtLeg.h[5]                   =                1269303.9;
+steamGenerator_1SG.UtubeColdtLeg.h[6]                   =                1268368.9;
+steamGenerator_1SG.UtubeHotLeg.P[2]                     =                15576062.0;
+steamGenerator_1SG.UtubeHotLeg.P[3]                     =                15550085.0;
+steamGenerator_1SG.UtubeHotLeg.P[4]                     =                15524119.0;
+steamGenerator_1SG.UtubeHotLeg.P[5]                     =                15498153.0;
+steamGenerator_1SG.UtubeHotLeg.P[6]                     =                15472183.0;
+steamGenerator_1SG.UtubeHotLeg.P[7]                     =                15446212.0;
+steamGenerator_1SG.UtubeHotLeg.Q[2]                     =                4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[3]                     =                4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[4]                     =                4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[5]                     =                4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[6]                     =                4756.0;
+steamGenerator_1SG.UtubeHotLeg.h[2]                     =                1380702.2;
+steamGenerator_1SG.UtubeHotLeg.h[3]                     =                1331224.9;
+steamGenerator_1SG.UtubeHotLeg.h[4]                     =                1303337.9;
+steamGenerator_1SG.UtubeHotLeg.h[5]                     =                1287595.9;
+steamGenerator_1SG.UtubeHotLeg.h[6]                     =                1279825.1;
+steamGenerator_1SG.UtubeHotLeg.h[7]                     =                1279825.1;
+steamGenerator_1SG.UtubeHotLeg.h[7]                     =                1279825.1;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].T                =                562.3159;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].d                =                747.6996;
+steamGenerator_1SG.heatExchangerWall1.Tp2[1]                =                560.738;
+steamGenerator_1SG.heatExchangerWall1.Tp2[2]                =                560.50226;
+steamGenerator_1SG.heatExchangerWall1.Tp2[3]                =                560.2941;
+steamGenerator_1SG.heatExchangerWall1.Tp2[4]                =                560.1085;
+steamGenerator_1SG.heatExchangerWall1.Tp2[5]                =                559.9811;
+steamGenerator_1SG.volumeA.P                            =                7155291.5;
+steamGenerator_1SG.volumeA.h                            =                1007554.1;
+steamGenerator_1SG.volumeA1.P                           =                7068655.5;
+steamGenerator_1SG.volumeA1.h                           =                2620879.0;")}));
+end TestSteamGenerator_1SG_withClosedPurge3;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge4.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge4.mo
new file mode 100644
index 0000000000000000000000000000000000000000..930ee887a2164fe8838f23d5014a87e3ba6c0e59
--- /dev/null
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge4.mo
@@ -0,0 +1,175 @@
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamGenerator_1SG_withClosedPurge4
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkPrimaire(
+    option_temperature=2,
+    P0(fixed=true) = 15450000,
+    h0=1.27187e6)
+    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourcePrimaire(h0=
+        1.47084e6, Q0=19024/4)
+    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceGV(
+    P0=7370400,
+    h0=978133.25,
+    option_temperature=2)
+    annotation (Placement(transformation(extent={{98,24},{74,48}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV(Q0=2147.6 -
+        0.00093930797,
+    h0=2.77090e6)
+    annotation (Placement(transformation(extent={{74,56},{94,76}})));
+
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VV_GV(
+    Cvmax(fixed=false) = 2200,
+    Q(fixed=false),
+    Pm(fixed=false),
+    C2(P(fixed=false, start=7068393)))
+    annotation (Placement(transformation(extent={{28,32},{6,52}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{24,62},{44,82}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.7)
+            annotation (Placement(transformation(extent={{4,-6},{24,14}})));
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV_apg(Q0=0.00093930797,
+    h0=1199.465e3)
+    annotation (Placement(transformation(extent={{58,-40},{78,-20}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV_apg(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{26,-34},{46,-14}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_1SG_purges
+    steamGenerator_1SG(
+    UtubeHotLeg(hcCorr=5.19),
+    UtubeColdtLeg(hcCorr=5.19),
+    DomeGV(zl(start=0.66, fixed=true)),
+    MixAlimDomeGV,
+    DPnulle_DomeDwnc,
+    CapteurPAlim,
+    heatExchangerWall(lambda=150),
+    heatExchangerWall1(lambda=150),
+    RiserGV(
+      dpfCorr(fixed=true) = 50,
+      hcCorr=5.19,
+      C1(P(fixed=false, start=7070000)),
+      C2(P(fixed=false, start=6880000)))) annotation (Placement(
+        transformation(extent={{-50,-6},{2,42}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=4)
+    annotation (Placement(transformation(extent={{-14,62},{6,82}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier1(alpha=0.25)
+    annotation (Placement(transformation(extent={{62,26},{42,46}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=4)
+    annotation (Placement(transformation(extent={{-2,-34},{18,-14}})));
+equation
+  connect(DP_GV.C2, sinkGV.C) annotation (Line(points={{44,72},{68,72},{68,66},
+          {74,66}}, color={238,46,47}));
+  connect(constante.y, VV_GV.Ouv) annotation (Line(points={{25,4},{34,4},{34,56},
+          {22,56},{22,58},{17,58},{17,53}},
+                               color={0,0,255}));
+  connect(DP_GV_apg.C2, sinkGV_apg.C) annotation (Line(points={{46,-24},{50,-24},
+          {50,-30},{58,-30}}, color={238,46,47}));
+  connect(steamGenerator_1SG.fluidOutletI1, sinkPrimaire.C) annotation (Line(
+        points={{-16.0267,-1.52},{-16.0267,-54},{68,-54}}, color={255,0,0}));
+  connect(steamGenerator_1SG.fluidInlet1, sourcePrimaire.C) annotation (Line(
+        points={{-31.9733,-1.52},{-31.9733,-53},{-56,-53}}, color={0,0,255}));
+  connect(DP_GV.C1, massFlowMultiplier.Cs)
+    annotation (Line(points={{24,72},{6,72}}, color={0,0,255}));
+  connect(massFlowMultiplier.Ce, steamGenerator_1SG.fluidOutletI)
+    annotation (Line(points={{-14,72},{-24,72},{-24,41.84}}, color={0,0,255}));
+  connect(DP_GV_apg.C1, massFlowMultiplier2.Cs)
+    annotation (Line(points={{26,-24},{18,-24}}, color={0,0,255}));
+  connect(massFlowMultiplier2.Ce, steamGenerator_1SG.fluidOutletI2) annotation
+    (Line(points={{-2,-24},{-10,-24},{-10,3.12},{-16.8933,3.12}}, color={0,0,
+          255}));
+  connect(VV_GV.C2, steamGenerator_1SG.fluidInlet) annotation (Line(points={{6,
+          36},{-4.49333,36},{-4.49333,35.92},{-14.9867,35.92}}, color={0,0,255}));
+  connect(VV_GV.C1, massFlowMultiplier1.Cs)
+    annotation (Line(points={{28,36},{42,36}}, color={0,0,255}));
+  connect(massFlowMultiplier1.Ce, sourceGV.C)
+    annotation (Line(points={{62,36},{74,36}}, color={0,0,255}));
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
+        coordinateSystem(preserveAspectRatio=false), graphics={Text(
+          extent={{-182,104},{-98,-100}},
+          lineColor={28,108,200},
+          textString="// Iteration variables values:
+DP_GV.Pm                                		=		7068393.5;
+DP_GV_apg.Pm                            		=		7155291.5;
+VV_GV.C2.P                              		=		7068393.0;
+VV_GV.C2.h_vol                          		=		978133.25;
+sinkPrimaire.Q                          		=		4756.0;
+sourcePrimaire.P                        		=		15602120.0;
+steamGenerator_1SG.CapteurPAlim.C2.h_vol		=		1007554.1;
+steamGenerator_1SG.DPnulle_AlimDwnc.pro.d		=		834.9452;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		596.8746;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		596.8746;
+steamGenerator_1SG.DomeGV.Cs.Q          		=		59.97482;
+steamGenerator_1SG.DomeGV.P             		=		7068394.0;
+steamGenerator_1SG.DomeGV.Pfond         		=		7074872.0;
+steamGenerator_1SG.DomeGV.Tp            		=		559.62714;
+steamGenerator_1SG.DomeGV.hl            		=		1270932.5;
+steamGenerator_1SG.DomeGV.hv            		=		2771676.0;
+steamGenerator_1SG.DownComerGV.pro.d    		=		826.39777;
+steamGenerator_1SG.MixAlimDomeGV.Cs.Q   		=		596.8748;
+steamGenerator_1SG.MixAlimDomeGV.P      		=		7068393.0;
+steamGenerator_1SG.MixAlimDomeGV.h      		=		1007554.1;
+steamGenerator_1SG.RiserGV.P[2]         		=		7139844.0;
+steamGenerator_1SG.RiserGV.P[3]         		=		7131381.0;
+steamGenerator_1SG.RiserGV.P[4]         		=		7118790.0;
+steamGenerator_1SG.RiserGV.P[5]         		=		7103591.5;
+steamGenerator_1SG.RiserGV.P[6]         		=		7086486.0;
+steamGenerator_1SG.RiserGV.Q[1]         		=		596.8746;
+steamGenerator_1SG.RiserGV.Q[2]         		=		596.8746;
+steamGenerator_1SG.RiserGV.Q[3]         		=		596.8746;
+steamGenerator_1SG.RiserGV.Q[4]         		=		596.8746;
+steamGenerator_1SG.RiserGV.Q[5]         		=		596.8746;
+steamGenerator_1SG.RiserGV.Q[6]         		=		596.8746;
+steamGenerator_1SG.RiserGV.h[2]         		=		1763458.6;
+steamGenerator_1SG.RiserGV.h[3]         		=		2179319.5;
+steamGenerator_1SG.RiserGV.h[4]         		=		2415660.8;
+steamGenerator_1SG.RiserGV.h[5]         		=		2551510.8;
+steamGenerator_1SG.RiserGV.h[6]         		=		2620879.0;
+steamGenerator_1SG.UtubeColdtLeg.P[2]   		=		15446754.0;
+steamGenerator_1SG.UtubeColdtLeg.P[3]   		=		15447354.0;
+steamGenerator_1SG.UtubeColdtLeg.P[4]   		=		15447989.0;
+steamGenerator_1SG.UtubeColdtLeg.P[5]   		=		15448645.0;
+steamGenerator_1SG.UtubeColdtLeg.P[6]   		=		15449317.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[2]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[3]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[4]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[5]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.h[2]   		=		1275097.4;
+steamGenerator_1SG.UtubeColdtLeg.h[3]   		=		1272384.6;
+steamGenerator_1SG.UtubeColdtLeg.h[4]   		=		1270610.9;
+steamGenerator_1SG.UtubeColdtLeg.h[5]   		=		1269303.9;
+steamGenerator_1SG.UtubeColdtLeg.h[6]   		=		1268368.9;
+steamGenerator_1SG.UtubeHotLeg.P[2]     		=		15576062.0;
+steamGenerator_1SG.UtubeHotLeg.P[3]     		=		15550085.0;
+steamGenerator_1SG.UtubeHotLeg.P[4]     		=		15524119.0;
+steamGenerator_1SG.UtubeHotLeg.P[5]     		=		15498153.0;
+steamGenerator_1SG.UtubeHotLeg.P[6]     		=		15472183.0;
+steamGenerator_1SG.UtubeHotLeg.P[7]     		=		15446212.0;
+steamGenerator_1SG.UtubeHotLeg.Q[2]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[3]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[4]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[5]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[6]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.h[2]     		=		1380702.2;
+steamGenerator_1SG.UtubeHotLeg.h[3]     		=		1331224.9;
+steamGenerator_1SG.UtubeHotLeg.h[4]     		=		1303337.9;
+steamGenerator_1SG.UtubeHotLeg.h[5]     		=		1287595.9;
+steamGenerator_1SG.UtubeHotLeg.h[6]     		=		1279825.1;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1279825.1;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1279825.1;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].T		=		562.3159;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].d		=		747.6996;
+steamGenerator_1SG.fluidOutletI.h       		=		2771676.0;
+steamGenerator_1SG.fluidOutletI2.h      		=		1007554.1;
+steamGenerator_1SG.heatExchangerWall1.Tp2[1]		=		560.738;
+steamGenerator_1SG.heatExchangerWall1.Tp2[2]		=		560.50226;
+steamGenerator_1SG.heatExchangerWall1.Tp2[3]		=		560.2941;
+steamGenerator_1SG.heatExchangerWall1.Tp2[4]		=		560.1085;
+steamGenerator_1SG.heatExchangerWall1.Tp2[5]		=		559.9811;
+steamGenerator_1SG.volumeA.P            		=		7155291.5;
+steamGenerator_1SG.volumeA.h            		=		1007554.1;
+steamGenerator_1SG.volumeA1.P           		=		7068655.5;
+steamGenerator_1SG.volumeA1.h           		=		2620879.0;")}));
+end TestSteamGenerator_1SG_withClosedPurge4;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge5.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge5.mo
new file mode 100644
index 0000000000000000000000000000000000000000..556d744ba69055ff6e79c03b5ef73845444d2792
--- /dev/null
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withClosedPurge5.mo
@@ -0,0 +1,175 @@
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamGenerator_1SG_withClosedPurge5
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkPrimaire(
+    option_temperature=2,
+    P0(fixed=true) = 15450000,
+    h0=1.27187e6)
+    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourcePrimaire(h0=
+        1.47084e6, Q0=19024/4)
+    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceGV(
+    P0=7370400,
+    h0=978133.25,
+    option_temperature=2)
+    annotation (Placement(transformation(extent={{98,24},{74,48}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV(Q0=2147.6 -
+        0.00093930797,
+    h0=2.77090e6)
+    annotation (Placement(transformation(extent={{74,56},{94,76}})));
+
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VV_GV(
+    Cvmax(fixed=false) = 2200,
+    Q(fixed=false),
+    Pm(fixed=false),
+    C2(P(fixed=false, start=7068393)))
+    annotation (Placement(transformation(extent={{28,32},{6,52}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{24,62},{44,82}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.7)
+            annotation (Placement(transformation(extent={{4,-6},{24,14}})));
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV_apg(Q0=0.00093930797,
+    h0=1199.465e3)
+    annotation (Placement(transformation(extent={{58,-40},{78,-20}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV_apg(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{26,-34},{46,-14}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_1SG_purges
+    steamGenerator_1SG(
+    UtubeHotLeg(hcCorr=5.19),
+    UtubeColdtLeg(hcCorr=5.19),
+    DomeGV(zl(start=0.66, fixed=true)),
+    MixAlimDomeGV,
+    DPnulle_DomeDwnc,
+    CapteurPAlim,
+    heatExchangerWall(lambda=150),
+    heatExchangerWall1(lambda=150),
+    RiserGV(
+      dpfCorr(fixed=true) = 5.7,
+      hcCorr=5.19,
+      C1(P(fixed=false, start=7070000)),
+      C2(P(fixed=false, start=6880000)))) annotation (Placement(
+        transformation(extent={{-50,-6},{2,42}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=4)
+    annotation (Placement(transformation(extent={{-14,62},{6,82}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier1(alpha=0.25)
+    annotation (Placement(transformation(extent={{62,26},{42,46}})));
+  WaterSteam.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=4)
+    annotation (Placement(transformation(extent={{-2,-34},{18,-14}})));
+equation
+  connect(DP_GV.C2, sinkGV.C) annotation (Line(points={{44,72},{68,72},{68,66},
+          {74,66}}, color={238,46,47}));
+  connect(constante.y, VV_GV.Ouv) annotation (Line(points={{25,4},{34,4},{34,56},
+          {22,56},{22,58},{17,58},{17,53}},
+                               color={0,0,255}));
+  connect(DP_GV_apg.C2, sinkGV_apg.C) annotation (Line(points={{46,-24},{50,-24},
+          {50,-30},{58,-30}}, color={238,46,47}));
+  connect(steamGenerator_1SG.fluidOutletI1, sinkPrimaire.C) annotation (Line(
+        points={{-16.0267,-1.52},{-16.0267,-54},{68,-54}}, color={255,0,0}));
+  connect(steamGenerator_1SG.fluidInlet1, sourcePrimaire.C) annotation (Line(
+        points={{-31.9733,-1.52},{-31.9733,-53},{-56,-53}}, color={0,0,255}));
+  connect(DP_GV.C1, massFlowMultiplier.Cs)
+    annotation (Line(points={{24,72},{6,72}}, color={0,0,255}));
+  connect(massFlowMultiplier.Ce, steamGenerator_1SG.fluidOutletI)
+    annotation (Line(points={{-14,72},{-24,72},{-24,41.84}}, color={0,0,255}));
+  connect(DP_GV_apg.C1, massFlowMultiplier2.Cs)
+    annotation (Line(points={{26,-24},{18,-24}}, color={0,0,255}));
+  connect(massFlowMultiplier2.Ce, steamGenerator_1SG.fluidOutletI2) annotation (
+     Line(points={{-2,-24},{-10,-24},{-10,3.12},{-16.8933,3.12}}, color={0,0,
+          255}));
+  connect(VV_GV.C2, steamGenerator_1SG.fluidInlet) annotation (Line(points={{6,36},{
+          -4.49333,36},{-4.49333,35.92},{-14.9867,35.92}},      color={0,0,255}));
+  connect(VV_GV.C1, massFlowMultiplier1.Cs)
+    annotation (Line(points={{28,36},{42,36}}, color={0,0,255}));
+  connect(massFlowMultiplier1.Ce, sourceGV.C)
+    annotation (Line(points={{62,36},{74,36}}, color={0,0,255}));
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
+        coordinateSystem(preserveAspectRatio=false), graphics={Text(
+          extent={{-242,-26},{-158,-230}},
+          lineColor={28,108,200},
+          textString="// Iteration variables values:
+DP_GV.Pm                                		=		7091364.5;
+DP_GV_apg.Pm                            		=		7160126.5;
+VV_GV.C2.P                              		=		7090542.5;
+VV_GV.C2.h_vol                          		=		978133.25;
+sinkPrimaire.Q                          		=		4756.0;
+sourcePrimaire.P                        		=		15602015.0;
+steamGenerator_1SG.CapteurPAlim.C2.h_vol		=		1206752.1;
+steamGenerator_1SG.DPnulle_AlimDwnc.pro.d		=		834.9668;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		2414.568;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		2414.568;
+steamGenerator_1SG.DomeGV.Cs.Q          		=		1877.6683;
+steamGenerator_1SG.DomeGV.P             		=		7091365.0;
+steamGenerator_1SG.DomeGV.Pfond         		=		7097843.0;
+steamGenerator_1SG.DomeGV.Tp            		=		559.849;
+steamGenerator_1SG.DomeGV.hl            		=		1272123.2;
+steamGenerator_1SG.DomeGV.hv            		=		2771373.8;
+steamGenerator_1SG.DownComerGV.pro.d    		=		762.06726;
+steamGenerator_1SG.MixAlimDomeGV.Cs.Q   		=		2414.5684;
+steamGenerator_1SG.MixAlimDomeGV.P      		=		7090542.5;
+steamGenerator_1SG.MixAlimDomeGV.h      		=		1206752.1;
+steamGenerator_1SG.RiserGV.P[2]         		=		7145042.5;
+steamGenerator_1SG.RiserGV.P[3]         		=		7135627.5;
+steamGenerator_1SG.RiserGV.P[4]         		=		7125689.0;
+steamGenerator_1SG.RiserGV.P[5]         		=		7115047.5;
+steamGenerator_1SG.RiserGV.P[6]         		=		7103958.0;
+steamGenerator_1SG.RiserGV.Q[1]         		=		2414.568;
+steamGenerator_1SG.RiserGV.Q[2]         		=		2414.568;
+steamGenerator_1SG.RiserGV.Q[3]         		=		2414.568;
+steamGenerator_1SG.RiserGV.Q[4]         		=		2414.568;
+steamGenerator_1SG.RiserGV.Q[5]         		=		2414.568;
+steamGenerator_1SG.RiserGV.Q[6]         		=		2414.568;
+steamGenerator_1SG.RiserGV.h[2]         		=		1398408.5;
+steamGenerator_1SG.RiserGV.h[3]         		=		1503102.4;
+steamGenerator_1SG.RiserGV.h[4]         		=		1559065.9;
+steamGenerator_1SG.RiserGV.h[5]         		=		1589044.2;
+steamGenerator_1SG.RiserGV.h[6]         		=		1605494.4;
+steamGenerator_1SG.UtubeColdtLeg.P[2]   		=		15446699.0;
+steamGenerator_1SG.UtubeColdtLeg.P[3]   		=		15447328.0;
+steamGenerator_1SG.UtubeColdtLeg.P[4]   		=		15447978.0;
+steamGenerator_1SG.UtubeColdtLeg.P[5]   		=		15448642.0;
+steamGenerator_1SG.UtubeColdtLeg.P[6]   		=		15449317.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[2]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[3]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[4]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[5]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.h[2]   		=		1272811.5;
+steamGenerator_1SG.UtubeColdtLeg.h[3]   		=		1271084.5;
+steamGenerator_1SG.UtubeColdtLeg.h[4]   		=		1269947.2;
+steamGenerator_1SG.UtubeColdtLeg.h[5]   		=		1269104.1;
+steamGenerator_1SG.UtubeColdtLeg.h[6]   		=		1268403.0;
+steamGenerator_1SG.UtubeHotLeg.P[2]     		=		15575957.0;
+steamGenerator_1SG.UtubeHotLeg.P[3]     		=		15549982.0;
+steamGenerator_1SG.UtubeHotLeg.P[4]     		=		15524016.0;
+steamGenerator_1SG.UtubeHotLeg.P[5]     		=		15498049.0;
+steamGenerator_1SG.UtubeHotLeg.P[6]     		=		15472078.0;
+steamGenerator_1SG.UtubeHotLeg.P[7]     		=		15446106.0;
+steamGenerator_1SG.UtubeHotLeg.Q[2]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[3]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[4]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[5]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[6]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.h[2]     		=		1376375.5;
+steamGenerator_1SG.UtubeHotLeg.h[3]     		=		1324950.6;
+steamGenerator_1SG.UtubeHotLeg.h[4]     		=		1297675.8;
+steamGenerator_1SG.UtubeHotLeg.h[5]     		=		1283299.2;
+steamGenerator_1SG.UtubeHotLeg.h[6]     		=		1275648.9;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1275648.9;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1275648.9;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].T		=		561.5154;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].d		=		749.1915;
+steamGenerator_1SG.fluidOutletI.h       		=		2771373.8;
+steamGenerator_1SG.fluidOutletI2.h      		=		1206752.1;
+steamGenerator_1SG.heatExchangerWall1.Tp2[1]		=		560.56665;
+steamGenerator_1SG.heatExchangerWall1.Tp2[2]		=		560.39185;
+steamGenerator_1SG.heatExchangerWall1.Tp2[3]		=		560.25653;
+steamGenerator_1SG.heatExchangerWall1.Tp2[4]		=		560.1358;
+steamGenerator_1SG.heatExchangerWall1.Tp2[5]		=		560.0208;
+steamGenerator_1SG.volumeA.P            		=		7160126.5;
+steamGenerator_1SG.volumeA.h            		=		1206752.1;
+steamGenerator_1SG.volumeA1.P           		=		7092599.0;
+steamGenerator_1SG.volumeA1.h           		=		1605494.4;")}));
+end TestSteamGenerator_1SG_withClosedPurge5;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withOpenPurge.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withOpenPurge.mo
new file mode 100644
index 0000000000000000000000000000000000000000..dbd32ce779e0b8a2963babe2475c12f09a647dd3
--- /dev/null
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_1SG_withOpenPurge.mo
@@ -0,0 +1,165 @@
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamGenerator_1SG_withOpenPurge
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkPrimaire(
+    option_temperature=2,
+    P0(fixed=true) = 15450000,
+    h0=1.27187e6)
+    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourcePrimaire(h0=
+        1.47084e6, Q0=19024/4)
+    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceGV(
+    P0=7370400,
+    h0=978133.25,
+    option_temperature=2)
+    annotation (Placement(transformation(extent={{98,24},{74,48}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV(
+    Q0=(2147.6/4) - 5.8,
+    h0=2.77090e6)
+    annotation (Placement(transformation(extent={{74,56},{94,76}})));
+
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VV_GV(
+    Cvmax(fixed=false) = 8791.226,
+    Q(fixed=false),
+    Pm(fixed=false),
+    C2(P(fixed=false, start=6880000)))
+    annotation (Placement(transformation(extent={{66,32},{44,52}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{24,62},{44,82}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.7)
+            annotation (Placement(transformation(extent={{26,-12},{46,8}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_1SG_purges
+    steamGenerator_1SG(
+    DomeGV(
+      R=2.2,
+      L=5,
+      zl(start=0.66, fixed=true)),
+    MixAlimDomeGV,
+    DPnulle_DomeDwnc,
+    CapteurPAlim,
+    RiserGV(
+      L=10.8,
+      z2=10.8,
+      dpfCorr(fixed=true) = 5.7,
+      C1(P(fixed=false, start=7070000)),
+      C2(P(fixed=false, start=6880000))),
+    DownComerGV(lambda=0.01))
+    annotation (Placement(transformation(extent={{-46,-26},{10,36}})));
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkQ sinkGV_apg(
+    Q0=5.8,
+    h0=1199.465e3)
+    annotation (Placement(transformation(extent={{58,-40},{78,-20}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DP_GV_apg(K(fixed=
+          true) = 1e-5)
+    annotation (Placement(transformation(extent={{8,-34},{28,-14}})));
+equation
+  connect(VV_GV.C1, sourceGV.C)
+    annotation (Line(points={{66,36},{74,36}},   color={0,0,255}));
+  connect(DP_GV.C2, sinkGV.C) annotation (Line(points={{44,72},{68,72},{68,66},
+          {74,66}}, color={238,46,47}));
+  connect(constante.y, VV_GV.Ouv) annotation (Line(points={{47,-2},{62,-2},{
+          62,53},{55,53}},     color={0,0,255}));
+  connect(sourcePrimaire.C, steamGenerator_1SG.fluidInlet1) annotation (Line(
+        points={{-56,-53},{-26.5867,-53},{-26.5867,-20.2133}}, color={0,0,255}));
+  connect(steamGenerator_1SG.fluidOutletI1, sinkPrimaire.C) annotation (Line(
+        points={{-9.41333,-20.2133},{-9.41333,-54},{68,-54}}, color={28,108,
+          200}));
+  connect(VV_GV.C2, steamGenerator_1SG.fluidInlet) annotation (Line(points={{44,36},
+          {-8.29333,36},{-8.29333,28.1467}},        color={0,0,255}));
+  connect(DP_GV.C1, steamGenerator_1SG.fluidOutletI) annotation (Line(points={{24,72},
+          {8,72},{8,70},{-18,70},{-18,35.7933}},          color={238,46,47}));
+  connect(DP_GV_apg.C2, sinkGV_apg.C) annotation (Line(points={{28,-24},{52,-24},
+          {52,-30},{58,-30}}, color={238,46,47}));
+  connect(DP_GV_apg.C1, steamGenerator_1SG.fluidOutletI2) annotation (Line(
+        points={{8,-24},{8,-14},{-10.3467,-14},{-10.3467,-14.22}}, color={0,0,
+          255}));
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
+        coordinateSystem(preserveAspectRatio=false), graphics={Text(
+          extent={{-184,104},{-100,-100}},
+          lineColor={28,108,200},
+          textString="// Iteration variables values:
+DP_GV.Pm                                		=		6648428.0;
+DP_GV_apg.Pm                            		=		6726420.5;
+VV_GV.C2.P                              		=		6647256.0;
+VV_GV.C2.h_vol                          		=		978133.25;
+sinkPrimaire.Q                          		=		4756.0;
+sourcePrimaire.P                        		=		15603571.0;
+steamGenerator_1SG.CapteurPAlim.C2.h_vol		=		1196944.8;
+steamGenerator_1SG.DPnulle_AlimDwnc.pro.d		=		834.53326;
+steamGenerator_1SG.DPnulle_DomeDwnc.Pm  		=		6647842.0;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		2784.4155;
+steamGenerator_1SG.DomeGV.Cm.Q          		=		2784.4155;
+steamGenerator_1SG.DomeGV.Cs.Q          		=		2253.3152;
+steamGenerator_1SG.DomeGV.Cs.Q          		=		2253.3152;
+steamGenerator_1SG.DomeGV.Pfond         		=		6654905.0;
+steamGenerator_1SG.DomeGV.Tp            		=		555.5142;
+steamGenerator_1SG.DomeGV.hl            		=		1249081.2;
+steamGenerator_1SG.DomeGV.hv            		=		2777023.5;
+steamGenerator_1SG.DownComerGV.pro.d    		=		764.9275;
+steamGenerator_1SG.MixAlimDomeGV.Cs.Q   		=		2790.2153;
+steamGenerator_1SG.MixAlimDomeGV.P      		=		6647256.0;
+steamGenerator_1SG.MixAlimDomeGV.h      		=		1196944.8;
+steamGenerator_1SG.RiserGV.P[2]         		=		6710845.5;
+steamGenerator_1SG.RiserGV.P[3]         		=		6699125.5;
+steamGenerator_1SG.RiserGV.P[4]         		=		6688239.5;
+steamGenerator_1SG.RiserGV.P[5]         		=		6676518.5;
+steamGenerator_1SG.RiserGV.P[6]         		=		6663742.5;
+steamGenerator_1SG.RiserGV.Q[1]         		=		2784.4153;
+steamGenerator_1SG.RiserGV.Q[2]         		=		2784.4153;
+steamGenerator_1SG.RiserGV.Q[3]         		=		2784.4153;
+steamGenerator_1SG.RiserGV.Q[4]         		=		2784.4153;
+steamGenerator_1SG.RiserGV.Q[5]         		=		2784.4153;
+steamGenerator_1SG.RiserGV.Q[6]         		=		2784.4153;
+steamGenerator_1SG.RiserGV.h[2]         		=		1296857.6;
+steamGenerator_1SG.RiserGV.h[3]         		=		1378131.0;
+steamGenerator_1SG.RiserGV.h[4]         		=		1444020.8;
+steamGenerator_1SG.RiserGV.h[5]         		=		1497354.8;
+steamGenerator_1SG.RiserGV.h[6]         		=		1540521.2;
+steamGenerator_1SG.UtubeColdtLeg.P[2]   		=		15447653.0;
+steamGenerator_1SG.UtubeColdtLeg.P[3]   		=		15447875.0;
+steamGenerator_1SG.UtubeColdtLeg.P[4]   		=		15448249.0;
+steamGenerator_1SG.UtubeColdtLeg.P[5]   		=		15448743.0;
+steamGenerator_1SG.UtubeColdtLeg.P[6]   		=		15449333.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[2]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[3]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[4]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.Q[5]   		=		4756.0;
+steamGenerator_1SG.UtubeColdtLeg.h[2]   		=		1305069.5;
+steamGenerator_1SG.UtubeColdtLeg.h[3]   		=		1293253.4;
+steamGenerator_1SG.UtubeColdtLeg.h[4]   		=		1283710.5;
+steamGenerator_1SG.UtubeColdtLeg.h[5]   		=		1275981.0;
+steamGenerator_1SG.UtubeColdtLeg.h[6]   		=		1269692.0;
+steamGenerator_1SG.UtubeHotLeg.P[2]     		=		15577513.0;
+steamGenerator_1SG.UtubeHotLeg.P[3]     		=		15551505.0;
+steamGenerator_1SG.UtubeHotLeg.P[4]     		=		15525523.0;
+steamGenerator_1SG.UtubeHotLeg.P[5]     		=		15499552.0;
+steamGenerator_1SG.UtubeHotLeg.P[6]     		=		15473586.0;
+steamGenerator_1SG.UtubeHotLeg.P[7]     		=		15447621.0;
+steamGenerator_1SG.UtubeHotLeg.Q[2]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[3]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[4]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[5]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.Q[6]     		=		4756.0;
+steamGenerator_1SG.UtubeHotLeg.h[2]     		=		1426988.1;
+steamGenerator_1SG.UtubeHotLeg.h[3]     		=		1391222.6;
+steamGenerator_1SG.UtubeHotLeg.h[4]     		=		1362190.1;
+steamGenerator_1SG.UtubeHotLeg.h[5]     		=		1338695.1;
+steamGenerator_1SG.UtubeHotLeg.h[6]     		=		1319712.1;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1319712.1;
+steamGenerator_1SG.UtubeHotLeg.h[7]     		=		1319712.1;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].T		=		569.8439;
+steamGenerator_1SG.UtubeHotLeg.pro2[6].d		=		733.1528;
+steamGenerator_1SG.heatExchangerWall1.Tp2[1]		=		556.9178;
+steamGenerator_1SG.heatExchangerWall1.Tp2[2]		=		556.65125;
+steamGenerator_1SG.heatExchangerWall1.Tp2[3]		=		556.4163;
+steamGenerator_1SG.heatExchangerWall1.Tp2[4]		=		556.19824;
+steamGenerator_1SG.heatExchangerWall1.Tp2[5]		=		555.9911;
+steamGenerator_1SG.volumeA.P            		=		6726420.5;
+steamGenerator_1SG.volumeA.h            		=		1196944.8;
+steamGenerator_1SG.volumeA1.P           		=		6649966.5;
+steamGenerator_1SG.volumeA1.h           		=		1540521.2;
+")}));
+end TestSteamGenerator_1SG_withOpenPurge;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_4SG.mo b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_4SG.mo
index b17eb7f6037306f3187ddb6e89fd8b2aa2997f3f..7d427ef43dcc44cb0563e3844109beffc9fdfa8b 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_4SG.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSteamGenerator_4SG.mo
@@ -1,581 +1,580 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSteamGenerator_4SG
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(
-    option_temperature=2,
-    P0(fixed=true) = 15450000,
-    h0=1.27187e6,
-    C(h(start=1271424.4597844065)),
-    Q(start=19024.00000130063))
-    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ(
-    Q0=4*4756,                                                        h0=
-        1.47084e6,
-    C(h(start=1470840.0)),
-    P(start=15603801.852529446))
-    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ1(            h0=
-        991272,
-    Q0=4*531.242,
-    P(start=6673872.740175724))
-    annotation (Placement(transformation(extent={{96,22},{72,46}})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1(
-    h0=2.77257e6,
-    option_temperature=2,
-    C(Q(start=531.242), h(start=2776560.720023855)),
-    P0=6600000,
-    Q(start=2124.967997982711))
-    annotation (Placement(transformation(extent={{74,56},{94,76}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1(
-    C1(h_vol(start=2776560.720023855), P(start=6685876.945727911)),
-    C2(h_vol(start=991271.9375)),
-    mode=0,
-    rho(start=34),
-    h(start=2.77257e6),
-    Q(start=531.242),
-    continuous_flow_reversal=true,
-    K(fixed=false),
-    T(start=503.196),
-    Pm(start=6642938.472863955),
-    pro(
-      T(start=555.4589914470885),
-      cp(start=5178.413295501618),
-      d(start=34.46817207271038),
-      ddhp(start=-2.1520142215709767E-05),
-      ddph(start=5.479294192996622E-06),
-      s(start=5839.85516347495),
-      u(start=2583833.9789930074),
-      x(start=0.9996529681524343)),
-    deltaP(start=85876.94572791074))
-                      annotation (Placement(transformation(
-        origin={41,66},
-        extent={{9,-10},{-9,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss2(
-    mode=1,
-    C1(h_vol(start=991272)),
-    Q(start=530.891),
-    rho(start=830.88),
-    h(start=991272),
-    K=1e-2,
-    C2(h_vol(start=991272.0), P(start=6673818.385303374)),
-    T(start=503.196),
-    Pm(start=6673845.562739549),
-    deltaP(start=54.35487234956245),
-    pro(
-      T(start=503.1995083327747),
-      cp(start=4648.149394597598),
-      d(start=830.7422694297521),
-      ddhp(start=-0.00029231779424316174),
-      ddph(start=9.971413173056383E-07),
-      duhp(start=0.9971731758797656),
-      duph(start=-0.001194100033979777),
-      s(start=2602.8508462401282),
-      u(start=983180.2679532344)))
-                       annotation (Placement(transformation(
-        origin={39,35},
-        extent={{-9,-11},{9,11}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_4SG
-    steamGenerator_4SG(DomeGV(zl(fixed=true),
-      Cm(Q(start=9339.943394826563),h(start=1598134.5758857883)),
-      Cs(Q(start=7214.973827962692), h(start=1251062.4148712347)),
-      P(start=6685889.957330225),
-      Pfond(start=6692366.620059332),
-      Tp(start=555.8903801780042),
-      Wlv(start=0.0),
-      Wpl(start=0.01902863885510662),
-      hl(start=1251062.4978919562),
-      hv(start=2776560.720023855),
-      lsat(
-        P(start=6685889.957330225),
-        T(start=555.8900824040454),
-        cp(start=5337.906880727062),
-        h(start=1251062.4148712307),
-        rho(start=745.3680386096091)),
-      prod(
-        T(start=295.51736670310515),
-        cp(start=4163.989551321513),
-        d(start=1000.6603016454784),
-        ddhp(start=-5.7615262977097235E-05),
-        ddph(start=5.013535960650664E-07),
-        duhp(start=0.9996149262348192),
-        duph(start=-0.0009959893185528743),
-        s(start=328.5825423752714),
-        u(start=93367.76387974156)),
-      prol(
-        T(start=555.8900824040454),
-        cp(start=5337.906880727062),
-        d(start=745.3680386095695),
-        ddhp(start=-0.010006330439354387),
-        ddph(start=0.0005102688715335737),
-        duhp(start=0.0),
-        duph(start=0.0),
-        s(start=3093.377935628747),
-        u(start=1242092.4971782218),
-        x(start=2.5946413171841244E-15)),
-      prom(
-        T(start=555.8900824040454),
-        cp(start=5306.340536982361),
-        d(start=131.71237026576387),
-        ddhp(start=-0.0003124542516089396),
-        ddph(start=3.0281730893713696E-05),
-        s(start=3717.7313726510624),
-        u(start=1547373.284870831),
-        x(start=0.2275139598264478)),
-      prov(
-        T(start=555.8900824040454),
-        cp(start=5199.16223540131),
-        d(start=34.70359395561105),
-        ddhp(start=-2.169113186741112E-05),
-        ddph(start=5.484240518018201E-06),
-        duhp(start=0.0),
-        duph(start=0.0),
-        s(start=5837.62024883985),
-        u(start=2583903.72991839),
-        x(start=1.0)),
-      vsat(
-        P(start=6685889.957330225),
-        T(start=555.8900824040454),
-        cp(start=5199.162235041228),
-        h(start=2776560.7239829493),
-        rho(start=34.70359386973889)),
-      xmv(start=0.2275139598264478)),
-    CapteurPAlim(C2(h_vol(start=1191956.6286634116))),
-    DPSeparateurCyclone(
-      Pm(start=6695802.348134679),
-      deltaP(start=19824.781608907506),
-      deltaPf(start=19824.781608907506),
-      pro(
-        T(start=555.9892694208781),
-        cp(start=5308.9688136686655),
-        d(start=132.0127276025087),
-        ddhp(start=-0.0003134698378714368),
-        ddph(start=3.032321316899426E-05),
-        s(start=3717.596156712044),
-        u(start=1547413.6849877203),
-        x(start=0.2272672559769073))),
-    DPnulle_AlimDwnc(
-      Pm(start=6673818.113529004),
-      deltaP(start=0.5435487413796104),
-      pro(
-        T(start=503.19950956331274),
-        cp(start=4648.1496437553415),
-        d(start=830.7422420964481),
-        ddhp(start=-0.0002923178293527613),
-        ddph(start=9.971415038963818E-07),
-        duhp(start=0.9971731869808205),
-        duph(start=-0.0011941001108068286),
-        s(start=2602.8509116489927),
-        u(start=983180.30060262))),
-    DPnulle_DomeDwnc(
-      Pm(start=6679855.553702783),
-      deltaP(start=12072.115575592095),
-      pro(
-        T(start=555.8296283466265),
-        cp(start=5336.696269133857),
-        d(start=742.2975474408748),
-        ddhp(start=-0.009931990199185458),
-        ddph(start=0.0005071767377452484),
-        s(start=3093.392533872336),
-        u(start=1242063.5249751657),
-        x(start=0.00020892919505243257))),
-    DownComerGV(
-      Pm(start=6709247.622898575),
-      deltaP(start=-70859.56228788428),
-      deltaPf(start=10343.671891713875),
-      pro(
-        T(start=544.5578995387173),
-        cp(start=5116.701168294162),
-        d(start=766.7060069854156),
-        ddhp(start=-0.00034940206878867106),
-        ddph(start=1.3430230342017287E-06),
-        duhp(start=0.9960121253232749),
-        duph(start=-0.001288952315284096),
-        s(start=2985.7570607121847),
-        u(start=1183124.7626597683))),
-    MixAlimDomeGV(
-      Cs(Q(start=9339.941827962692), h(start=1191956.4712466928)),
-      P(start=6673817.841754633),
-      h(start=1191956.6286634116)),
-    RiserGV(
-      Bo(start={8.36232783213913E-05,6.719031685234453E-05,5.3902580621083615E-05,
-            4.3219450969915566E-05,3.4655421661615915E-05}),
-      E(start={1.8089252979967894,2.168041540755742,2.4495767429686435,2.686214536869773,
-            2.8875474533284047}),
-      P(start={6744679.0,6730844.178675402,6722919.887991146,6717806.760111813,
-            6713513.950414306,6709544.543243809,6705716.5}),
-      Pb(start={6744677.404042517,6730842.014839868,6722917.755797146,6717804.768746651,
-            6713512.17026991,6709542.982511975,6705714.738939133}),
-      Prl(start={0.8611417203162811,0.8609919636211495,0.8608955373580308,0.8608147050118172,
-            0.8607400619251756}),
-      Prv(start={1.5570415739842978,1.5564630566624507,1.5560899850703338,1.5557768983784575,
-            1.5554875013970515}),
-      Q(start={9339.945517283284,9339.957549715728,9339.950467134453,9339.971120571425,
-            9339.99231499105,9339.94573814933}),
-      Rel1(start={152447.92616300168,142335.83437866767,134187.4670116368,127627.13721601243,
-            122352.45830523479}),
-      Rel2(start={150254.8095554807,158381.90435368326,158338.64373732614,158307.8596587163,
-            158280.86327060199,158254.24951013742}),
-      Rev1(start={77575.19134507612,78492.42896087494,118291.45136780897,150350.67441393988,
-            176126.90213191492}),
-      Rev2(start={800781.2331255227,775825.1621067446,775944.3156908562,776032.459340436,
-            776110.1664016051,776177.9976943603}),
-      S(start={0.18646067993756296,0.14741074522742095,0.12672138156071908,0.11344216340597164,
-            0.10421727726182724}),
-      Xtt(start={4.698170701711023,1.8127401059042414,1.188271404248455,0.9152344407112684,
-            0.7640757330368099}),
-      cpl(start={5346.726569359595,5345.168915645627,5344.164527232125,5343.321694007195,
-            5342.542684925076}),
-      cpv(start={5221.027203402077,5217.165709967847,5214.675763895988,5212.586310375188,
-            5210.655071078048}),
-      dpf(start={240.68807268349988,452.0282523273246,796.4016623418449,1075.0791568424715,
-            1300.0141603980285,1481.2392512305416}),
-      dpg(start={13594.701129965273,7472.230790394849,4316.585388153266,3217.51931989806,
-            2669.1735975373467,2347.0043216117883}),
-      filo(start={1.0,1.8244789333783462,3.2149487183763448,4.340397003032226,
-            5.24901975341115,5.981365111705367}),
-      h(start={1191956.625,1310718.2999586433,1407095.2062599964,
-            1484973.8626912842,1547709.5248752024,1598134.6590527825,
-            1598134.625}),
-      hb(start={1191956.470966204,1310718.1635102467,1407095.1037077138,1484973.7864303382,
-            1547709.4688659392,1598134.5693370847}),
-      hcl(start={4714.132382823345,4462.913929306216,4257.719777481008,4090.6834703548934,
-            3955.15054441558}),
-      hcv(start={383.76889659966645,387.121911103175,537.2182885232792,650.5888704015,
-            738.1244350192029}),
-      heb(start={22924.47715828864,19779.433674412754,17055.41562379167,14704.508805435535,
-            12678.83726898374}),
-      hi(start={12802.026923542666,12591.483849674842,12590.89717593426,12656.564694510973,
-            12742.038781076928}),
-      khi(start={2.3513340432056835,4.288569536664796,7.556981589962004,10.202445311916463,
-            12.338247331434427,14.05969876658083}),
-      kl(start={0.5728692678795172,0.5729916458588682,0.5730706248756353,0.5731369417495803,
-            0.5731982704985713}),
-      kv(start={0.06317601452157781,0.06314090911016851,0.0631182627268245,0.06309925287038186,
-            0.06308167756999997}),
-      lambdal(start={0.0479760579943903,0.04796051438183811,0.04796059291079075,
-            0.0479606488177225,0.04796069786367081,0.04796074623080051}),
-      lambdav(start={0.04772930760010263,0.047731146229000085,0.04773113716961201,
-            0.0477311304697349,0.047731124564413474,0.04773111941056356}),
-      lsat1(
-        P(start={6730842.014839868,6722917.755797146,6717804.768746651,6713512.17026991,
-              6709542.982511975}),
-        T(start={556.3389924406671,556.2600241306386,556.209033479274,556.1662014733531,
-              556.1265778709004}),
-        cp(start={5346.726569359595,5345.168915645627,5344.164527232125,5343.321694007195,
-              5342.542684925076}),
-        h(start={1253431.585007418,1253014.584289221,1252745.3765170192,1252519.2753799693,
-              1252310.1372499361}),
-        rho(start={744.5554743628229,744.6985944893112,744.7909675083922,744.8685356754302,
-              744.9402732286163})),
-      lsat2(
-        P(start={6737759.709441192,6726879.8853185065,6720361.262271898,6715658.469508281,
-              6711527.576390943,6707628.860725554}),
-        T(start={556.4078718941712,556.2995171701539,556.2345325100885,556.1876200910507,
-              556.1463919101247,556.1074631772785}),
-        cp(start={5348.087383026628,5345.94758697866,5344.666656791734,5343.743065105156,
-              5342.932150590179,5342.167122646409}),
-        h(start={1253795.3933348258,1253223.1188795213,1252879.9946819467,1252632.3360268243,
-              1252414.714942419,1252209.2567110015}),
-        rho(start={744.4305757562969,744.6270280030437,744.7447783179862,744.8297496988638,
-              744.9044028308721,744.9748729576461})),
-      lv(start={1522570.0385954217,1523085.8971144324,1523418.823481502,1523698.3784384602,
-            1523956.9097721667}),
-      mul1(start={9.226610346696365E-05,9.229665331295747E-05,9.231638379253507E-05,
-            9.233295985096189E-05,9.234829629653449E-05}),
-      mul2(start={9.727263281588834E-05,9.228137398267151E-05,9.230651671343234E-05,
-            9.232467052305553E-05,9.234062696166577E-05,9.235569540519083E-05}),
-      muv1(start={1.8840675839542634E-05,1.8837142206599475E-05,1.8834861638812487E-05,
-            1.8832946655537446E-05,1.883117567538255E-05}),
-      muv2(start={1.8251777531879907E-05,1.8838909153270027E-05,1.8836001977163446E-05,
-            1.8833904185687363E-05,1.883206119848459E-05,1.8830321534172908E-05}),
-      pro1(
-        T(start={556.3389924406671,556.2600241306386,556.209033479274,556.1662014733531,
-              556.1265778709004}),
-        cp(start={5341.997140556225,5332.219678537313,5324.425392368035,5317.993975781659,
-              5312.6140439867995}),
-        d(start={422.1720540531306,243.6497354232064,181.57215015669672,150.61451609815575,
-              132.42973001362074}),
-        ddhp(start={-0.00319108389079441,-0.0010640050423927085,-0.000591292731080987,
-              -0.0004070832851860468,-0.0003148819563620984}),
-        ddph(start={0.00018609324345610672,7.565042805859356E-05,4.8149034231418565E-05,
-              3.654225278798846E-05,3.0380824214989255E-05}),
-        s(start={3200.500205751786,3373.7926661062174,3513.8472477853757,3626.6899332519934,
-              3717.4092556184078}),
-        u(start={1294774.8012004504,1379502.5526872098,1447975.7954777104,1503135.331231724,
-              1547469.639477136}),
-        x(start={0.03762492171176301,0.10116338133680211,0.15243897891625255,0.1937326951732345,
-              0.22692533487633168})),
-      pro2(
-        T(start={544.5598781930121,556.2995171701539,556.2345325100885,556.1876200910507,
-              556.1463919101247,556.1074631772785}),
-        cp(start={5116.124586626926,5341.158251933199,5331.632315888745,5323.901069374985,
-              5317.485956882676,5312.106117666421}),
-        d(start={766.7442573307001,421.4355225067566,243.45646861181493,
-              181.46888508303257,150.5420511017391,132.37160981170285}),
-        ddhp(start={-0.00034933567877009714,-0.0031816163823316693,-0.0010626747818988857,
-              -0.0005907870162234465,-0.00040679782214652157,-0.0003146849446210644}),
-        ddph(start={1.342619521991597E-06,0.00018570017910512666,7.559521377445194E-05,
-              4.812814914753926E-05,3.65305389476637E-05,3.0372791387005017E-05}),
-        duhp(start={0.9959963386360166,0.0,0.0,0.0,0.0,0.0}),
-        duph(start={-0.001288828265754332,0.0,0.0,0.0,0.0,0.0}),
-        s(start={2985.688955141166,3200.517090220022,3373.811536436535,3513.8685062727945,
-              3626.7136311863687,3717.43525191881}),
-        u(start={1183088.112657001,1294756.3402571988,1379491.1439751012,1447966.559777595,
-              1503127.046666921,1547461.8469760437}),
-        x(start={0.0,0.03775544351406177,0.10124068330308128,0.15249918912231897,
-              0.1937848784682335,0.22697296061269584})),
-      rhol1(start={744.5554743628229,744.6985944893112,744.7909675083922,744.8685356754302,
-            744.9402732286163}),
-      rhol2(start={766.7443115494995,744.6270280030437,744.7447783179862,744.8297496988638,
-            744.9044028308721,744.9748729576461}),
-      rhov1(start={34.962439803124745,34.91677118740676,34.88731311261495,34.86258695993451,
-            34.839728028512795}),
-      rhov2(start={35.00233252971344,34.939615804510595,34.902053167740824,
-            34.87496029205291,34.85116659616274,34.82871488826041}),
-      vsat1(
-        P(start={6730842.014839868,6722917.755797146,6717804.768746651,6713512.17026991,
-              6709542.982511975}),
-        T(start={556.3389924406671,556.2600241306386,556.209033479274,556.1662014733531,
-              556.1265778709004}),
-        cp(start={5221.027203402077,5217.165709967847,5214.675763895988,5212.586310375188,
-              5210.655071078048}),
-        h(start={2776001.6236028397,2776100.4814036535,2776164.1999985212,2776217.6538184294,
-              2776267.047022103}),
-        rho(start={34.962439803124745,34.91677118740676,34.88731311261495,34.86258695993451,
-              34.839728028512795})),
-      vsat2(
-        P(start={6737759.709441192,6726879.8853185065,6720361.262271898,6715658.469508281,
-              6711527.576390943,6707628.860725554}),
-        T(start={556.4078718941712,556.2995171701539,556.2345325100885,556.1876200910507,
-              556.1463919101247,556.1074631772785}),
-        cp(start={5224.400687871225,5219.096076316945,5215.920578854191,5213.63092585794,
-              5211.620595691562,5209.7240118069485}),
-        h(start={2775915.218951537,2776051.068425704,2776132.3473364403,2776190.931588626,
-              2776242.354424242,2776290.8552075126}),
-        rho(start={35.00232099234372,34.939603425200005,34.90204128895865,34.87494942975982,
-              34.85115697594991,34.828705899911355})),
-      xbi(start={0.1,0.10116338133680211,0.15243897891625255,0.1937326951732345,
-            0.22692533487633168}),
-      xbs(start={0.03762492171176301,0.10116338133680211,0.15243897891625255,0.1937326951732345,
-            0.22692533487633168}),
-      xv1(start={0.03762492171176301,0.10116338133680211,0.15243897891625255,0.1937326951732345,
-            0.22692533487633168}),
-      xv2(start={0.0,0.037755462355471406,0.10124068828424883,
-            0.15249918627518708,0.1937848713005096,0.22697298063788682})),
-    UtubeColdtLeg(
-      P(start={15447790.0,15447793.435965536,15447988.9417549,15448335.779657947,
-            15448802.227928547,15449363.461882193,15450000.0}),
-      Pr(start={0.8485399987514178,0.8437223731225957,0.8401600873442849,0.8374915591415923,
-            0.8354691402947125}),
-      Q(start={19024.0,19024.000000015938,19024.000000009222,19024.000000008615,
-            19023.999999970874,19024.0}),
-      Re1(start={740663.8508554634,733608.5077475865,727989.9817080003,723509.8311430685,
-            719932.3370803626}),
-      Re2(start={749531.3596003209,740663.622970807,733608.1144879417,727989.4642062903,
-            723509.219077554,719931.6522898132}),
-      Tp(start={566.7297002735512,564.6222622392298,562.9190330221342,
-            561.5451774467969,560.4382106375682}),
-      dW1(start={-279756440.2213714,-224857207.7402948,-180428396.93185326,-144695540.64418706,
-            -116043331.60183546}),
-      dpf(start={12985.764633102444,12890.22304265516,12815.390343383635,12756.556515383141,
-            12710.12948386807,12673.368264480014}),
-      dpg(start={-12989.344769820433,-13085.728832018916,-13162.228246430617,-13223.004785983429,
-            -13271.36343751352,-13309.90638228737}),
-      h(start={1321139.75,1306434.251413758,1294614.597820902,1285130.35135033,
-            1277524.4079718543,1271424.5719925927,1271870.0}),
-      hb(start={1321139.625,1306434.1567753016,1294614.4969952605,1285130.2456888258,
-            1277524.2984409477,1271424.5}),
-      hc(start={180530.2031525729,179938.6049945257,179471.09155340536,179100.18674382113,
-            178805.0107388246}),
-      k(start={0.569903424256179,0.5737071703327904,0.57672211580297,0.5791159895438929,
-            0.5810204484096431}),
-      khi(start={7.049456890976183,7.049514957752702,7.049562160417504,7.049600404492563,
-            7.049631325412611,7.049656292675035}),
-      lambda(start={0.06577673548161958,0.06577727728832305,0.06577771772469208,
-            0.06577807457068005,0.0657783630861232,0.0657785960494623}),
-      mu1(start={9.075581813143527E-05,9.162864529941209E-05,9.233582251683199E-05,
-            9.290758860699127E-05,9.336926581161909E-05}),
-      mu2(start={8.968210987240277E-05,9.075584605522865E-05,9.162869441805722E-05,
-            9.233588815506897E-05,9.290766720372902E-05,9.336935462663355E-05}),
-      pro1(
-        T(start={567.3606167505245,565.1310305469619,563.3283341246621,561.8740936880697,
-              560.7024265549542}),
-        cp(start={5328.428092691793,5282.731984620283,5247.5722853725265,5220.292123376071,
-              5198.976882883934}),
-        d(start={738.0380092688561,742.3524865572139,745.7802158755532,748.5075923732937,
-              750.6813748472894}),
-        ddhp(start={-0.00036676171559905517,-0.00036268799998067465,-0.0003594946257470463,
-              -0.0003569797546577219,-0.00035499122637001624}),
-        ddph(start={1.4933932735181671E-06,1.4616259058594299E-06,1.4370818019756576E-06,
-              1.4179752895616462E-06,1.4030071651800273E-06}),
-        duhp(start={0.989598571415198,0.989833187801047,0.9900149007394048,0.9901565808073962,
-              0.9902676677086574}),
-        duph(start={-0.0013125908630425016,-0.0013060969063559476,-0.0013009621279523138,
-              -0.0012968923057242862,-0.0012936586788916359}),
-        s(start={3170.9701686994877,3150.0796873505356,3133.256922874029,3119.726630464892,
-              3108.8499763175782}),
-        u(start={1285520.5967581493,1273813.0797732072,1264416.8129174528,1256880.128694022,
-              1250834.956032079})),
-      pro2(
-        T(start={570.1073620438502,567.3606291892737,565.1310507666656,563.3283593967624,
-              561.8741222961053,560.7024574022039}),
-        cp(start={5388.406461510192,5328.425505385109,5282.727656653133,5247.56672750207,
-              5220.28567521346,5198.969777271499}),
-        d(start={732.6020394319872,738.0381206169448,742.352703554415,
-              745.7805131286152,748.5079512259089,750.6817815580962}),
-        ddhp(start={-0.00037198509316790397,-0.0003667614473786902,-0.0003626875439828175,
-              -0.0003594940326834898,-0.0003569790596820252,-0.0003549904544619478}),
-        ddph(start={1.5348719848853683E-06,1.4933915062892603E-06,1.4616229379957508E-06,
-              1.4370779785040732E-06,1.4179708421512154E-06,1.4030022541131503E-06}),
-        duhp(start={0.9892932994910214,0.9895985173197178,0.9898330933971353,0.9900147754443821,
-              0.9901564316396775,0.9902674999572604}),
-        duph(start={-0.0013208198886598558,-0.0013125903937424904,-0.0013060960974349875,
-              -0.0013009610646510298,-0.001296891049382636,-0.001293657274439685}),
-        s(start={3196.847283434861,3170.9699348038343,3150.0792734295214,3133.2563672449337,
-              3119.725962876822,3108.849219981283}),
-        u(start={1300082.5210781347,1285520.4681977315,1273812.8529621325,1264416.5092279054,
-              1256879.764567582,1250834.5441956373}))),
-    UtubeHotLeg(
-      P(start={15603802.0,15577733.16816351,15551714.872362692,15525721.988763008,
-            15499741.08610745,15473764.965712622,15447789.855828818}),
-      Pr(start={0.9268274247754805,0.897220182583634,0.8776550489979607,0.8643305290624336,
-            0.8550366643423865}),
-      Q(start={19024.0,19024.000000000367,19023.99999999964,19024.00000000011,
-            19024.00000000002,19023.999999857715}),
-      Re1(start={817014.9631080779,793512.4891762563,775190.750855054,760808.3585747941,
-            749468.6458729169}),
-      Re2(start={847542.9071926117,817056.763761018,793550.1745179154,775225.5981630007,
-            760841.1868977759,749500.0019445078}),
-      Tp(start={587.1471444673728,581.3736997008687,576.5497988489371,572.5694454974841,
-            569.3138535902852}),
-      dW1(start={-829471303.2582991,-675298164.5954175,-546954258.1361314,-441252316.60268044,
-            -354924279.10826033}),
-      dpf(start={14143.81169622979,13764.757653658597,13483.640810563862,13271.695204581403,
-            13109.956929621685,12985.411439622238}),
-      dpg(start={11924.87266970522,12253.538147159534,12509.242789119782,12709.20745097726,
-            12866.163465206111,12989.698444181831}),
-      h(start={1470840.0,1427238.7169755003,1391741.5678048218,
-            1362990.8350133097,1339796.3404456903,1321139.6915852583,
-            1321139.6915852583}),
-      hb(start={1470840.0,1427238.6909545925,1391741.5208216964,1362990.7713406922,
-            1339796.2635364125,1321139.6046708333}),
-      hc(start={187557.424629481,185223.2513470597,183525.84657594314,182251.43681092552,
-            181274.8219651142}),
-      k(start={0.5284062480708878,0.5411405997880095,0.5511350993903698,0.5589797069058337,
-            0.5651426182420888}),
-      khi(start={7.048896016477203,7.0490560598548235,7.049187856831117,7.049296141853237,
-            7.0493847966826495,7.049457093888881}),
-      lambda(start={0.06577150210064735,0.06577299542574716,0.0657742251906753,
-            0.06577523557138501,0.06577606278763069,0.06577673737494769}),
-      mu1(start={8.22745687414035E-05,8.471139983539598E-05,8.671356523648527E-05,
-            8.835280657393318E-05,8.968961425523977E-05}),
-      mu2(start={7.931109230522286E-05,8.227035957155674E-05,8.470737692903291E-05,
-            8.67096673591225E-05,8.834899437958743E-05,8.968586200145771E-05}),
-      pro1(
-        T(start={588.9477609818658,582.858110790298,577.7632097600199,573.5552031604133,
-              570.1110261588411}),
-        cp(start={5952.524694162988,5731.486773782996,5578.210298939806,5468.340447123108,
-              5387.665709033955}),
-        d(start={691.127359877131,705.5472298934878,716.8239215163549,725.6752920941296,
-              732.6419658963861}),
-        ddhp(start={-0.0004155037407332219,-0.00039950364903529664,-0.00038764690462658323,
-              -0.00037871867103524235,-0.00037190987432426687}),
-        ddph(start={1.913324046385813E-06,1.7676886847969924E-06,1.6646162173978048E-06,
-              1.589797767320067E-06,1.5343684730931183E-06}),
-        duhp(start={0.9864492595525407,0.9875190726980947,0.9882871347842476,0.9888530388529411,
-              0.9892786339968481}),
-        duph(start={-0.0013845124644803236,-0.0013621150476988279,-0.0013447458609298535,
-              -0.0013312337168638212,-0.0013206906170049192}),
-        s(start={3379.699931658541,3319.149598936592,3269.6351153218507,3229.3746379138815,
-              3196.7849331292546}),
-        u(start={1404798.5339229864,1369781.3633704544,1341393.6675134916,1318481.1435503685,
-              1300048.1237550098})),
-      pro2(
-        T(start={596.0859341143205,588.9442860448619,582.85527283777,
-              577.7608227333928,573.5531441569481,570.1092105814562}),
-        cp(start={6287.424500337378,5953.2092619090545,5732.035067658993,5578.674078053739,
-              5468.748767250006,5388.036019379184}),
-        d(start={672.5655973062072,691.1023960011623,705.5241894233388,
-              716.8022370268958,725.6545883530431,732.6219867525609}),
-        ddhp(start={-0.00043755438647838607,-0.00041556158626975236,-0.00039955340092966444,
-              -0.0003876911089995012,-0.0003787590182590652,-0.00037194747842221474}),
-        ddph(start={2.125515159248024E-06,1.9137632836338014E-06,1.768050868830993E-06,
-              1.664926867421845E-06,1.5900735967837824E-06,1.5346201866315948E-06}),
-        duhp(start={0.9849189965297267,0.9864577131377691,0.9875271359484448,0.9882948931077569,
-              0.9888605582077337,0.9892859662078309}),
-        duph(start={-0.001413584577942525,-0.0013845980008344576,-0.0013621925396860423,
-              -0.0013448176826787214,-0.001331301412187632,-0.0013207552475314353}),
-        s(start={3453.2540263365545,3379.732135996568,3319.1813992316747,3269.6666323604823,
-              3229.4059560133437,3196.8161099746217}),
-        u(start={1447760.1088342038,1404816.6870605783,1369799.1794393272,1341411.2226579608,
-              1318498.4978916019,1300065.3231918123}))),
-    heatExchangerWall(Tp(start={572.0950631803388,569.1193407405048,
-            566.6244487160184,564.5622289104098,562.8731995116093}),
-                                                   Tp2(start={558.6757500946919,
-            558.1941327385717,557.7756039179028,557.4234616490846,
-            557.1311008891796})),
-    heatExchangerWall1(
-      Tp(start={561.6530707706147,560.5418673218728,559.6448700447268,
-            558.919444369886,558.3324177381908}),
-      Tp2(start={557.1271270652367,556.9040478325486,556.7258249532296,
-            556.5784950152436,556.4550203517163}),
-      dW2(start={-279756444.46082795,-224857217.37124035,-180428416.14701596,-144695586.80142948,
-            -116043366.39102629})),
-    volumeA(P(start=6744677.404042517), h(start=1191956.6337581165)),
-    volumeA1(P(start=6705714.738939133), h(start=1598134.5758857883)),
-    DPnulle_Vapeur(
-      Pm(start=6685883.451529068),
-      deltaP(start=13.01160231452267),
-      pro(
-        T(start=555.8900172677318),
-        cp(start=5199.159085307482),
-        d(start=34.703568752556855),
-        ddhp(start=-2.1691105938244643E-05),
-        ddph(start=5.484239768071665E-06),
-        s(start=5837.62058607886),
-        u(start=2583903.7193358056),
-        x(start=0.9999999445568193))))
-    annotation (Placement(transformation(extent={{-34,-32},{32,44}})));
-
-equation
-  connect(sinkP1.C, singularPressureLoss1.C2)
-    annotation (Line(points={{74,66},{52,66},{50,66}}));
-  connect(singularPressureLoss2.C1, sourceQ1.C)
-    annotation (Line(points={{48,35},{72,35},{72,34}}));
-  connect(sourceQ.C,steamGenerator_4SG. fluidInlet1) annotation (Line(points={{-56,-53},
-          {-36,-53},{-36,-24.9067},{-11.12,-24.9067}},            color={0,0,
-          255}));
-  connect(sinkP.C,steamGenerator_4SG. fluidOutletI1) annotation (Line(points={{68,-54},
-          {34,-54},{34,-24.9067},{9.12,-24.9067}},           color={0,0,255}));
-  connect(singularPressureLoss2.C2,steamGenerator_4SG. fluidInlet)
-    annotation (Line(points={{30,35},{26,35},{26,34.3733},{10.44,34.3733}},
-        color={0,0,255}));
-  connect(singularPressureLoss1.C1,steamGenerator_4SG. fluidOutletI)
-    annotation (Line(points={{32,66},{-2,66},{-2,43.7467},{-1,43.7467}},
-        color={0,0,255}));
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-                                                                 Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSteamGenerator_4SG;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSteamGenerator_4SG
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP(
+    option_temperature=2,
+    P0(fixed=true) = 15450000,
+    h0=1.27187e6,
+    C(h(start=1271424.4597844065)),
+    Q(start=19024.00000130063))
+    annotation (Placement(transformation(extent={{68,-64},{88,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ(
+    Q0=4*4756,                                                        h0=
+        1.47084e6,
+    C(h(start=1470840.0)),
+    P(start=15603801.852529446))
+    annotation (Placement(transformation(extent={{-74,-62},{-56,-44}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ sourceQ1(            h0=
+        991272,
+    Q0=4*531.242,
+    P(start=6673872.740175724))
+    annotation (Placement(transformation(extent={{96,22},{72,46}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1(
+    h0=2.77257e6,
+    option_temperature=2,
+    C(Q(start=531.242), h(start=2776560.720023855)),
+    P0=6600000,
+    Q(start=2124.967997982711))
+    annotation (Placement(transformation(extent={{74,56},{94,76}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss1(
+    C1(h_vol(start=2776560.720023855), P(start=6685876.945727911)),
+    C2(h_vol(start=991271.9375)),
+    mode=0,
+    rho(start=34),
+    h(start=2.77257e6),
+    Q(start=531.242),
+    continuous_flow_reversal=true,
+    K(fixed=false),
+    T(start=503.196),
+    Pm(start=6642938.472863955),
+    pro(
+      T(start=555.4589914470885),
+      cp(start=5178.413295501618),
+      d(start=34.46817207271038),
+      ddhp(start=-2.1520142215709767E-05),
+      ddph(start=5.479294192996622E-06),
+      s(start=5839.85516347495),
+      u(start=2583833.9789930074),
+      x(start=0.9996529681524343)),
+    deltaP(start=85876.94572791074))
+                      annotation (Placement(transformation(
+        origin={41,66},
+        extent={{9,-10},{-9,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss2(
+    mode=1,
+    C1(h_vol(start=991272)),
+    Q(start=530.891),
+    rho(start=830.88),
+    h(start=991272),
+    K=1e-2,
+    C2(h_vol(start=991272.0), P(start=6673818.385303374)),
+    T(start=503.196),
+    Pm(start=6673845.562739549),
+    deltaP(start=54.35487234956245),
+    pro(
+      T(start=503.1995083327747),
+      cp(start=4648.149394597598),
+      d(start=830.7422694297521),
+      ddhp(start=-0.00029231779424316174),
+      ddph(start=9.971413173056383E-07),
+      duhp(start=0.9971731758797656),
+      duph(start=-0.001194100033979777),
+      s(start=2602.8508462401282),
+      u(start=983180.2679532344)))
+                       annotation (Placement(transformation(
+        origin={39,35},
+        extent={{-9,-11},{9,11}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.HeatExchangers.SteamGenerator_4SG
+    steamGenerator_4SG(DomeGV(zl(fixed=true),
+      Cm(Q(start=9339.943394826563),h(start=1598134.5758857883)),
+      Cs(Q(start=7214.973827962692), h(start=1251062.4148712347)),
+      P(start=6685889.957330225),
+      Pfond(start=6692366.620059332),
+      Tp(start=555.8903801780042),
+      Wlv(start=0.0),
+      Wpl(start=0.01902863885510662),
+      hl(start=1251062.4978919562),
+      hv(start=2776560.720023855),
+      lsat(
+        P(start=6685889.957330225),
+        T(start=555.8900824040454),
+        cp(start=5337.906880727062),
+        h(start=1251062.4148712307),
+        rho(start=745.3680386096091)),
+      prod(
+        T(start=295.51736670310515),
+        cp(start=4163.989551321513),
+        d(start=1000.6603016454784),
+        ddhp(start=-5.7615262977097235E-05),
+        ddph(start=5.013535960650664E-07),
+        duhp(start=0.9996149262348192),
+        duph(start=-0.0009959893185528743),
+        s(start=328.5825423752714),
+        u(start=93367.76387974156)),
+      prol(
+        T(start=555.8900824040454),
+        cp(start=5337.906880727062),
+        d(start=745.3680386095695),
+        ddhp(start=-0.010006330439354387),
+        ddph(start=0.0005102688715335737),
+        duhp(start=0.0),
+        duph(start=0.0),
+        s(start=3093.377935628747),
+        u(start=1242092.4971782218),
+        x(start=2.5946413171841244E-15)),
+      prom(
+        T(start=555.8900824040454),
+        cp(start=5306.340536982361),
+        d(start=131.71237026576387),
+        ddhp(start=-0.0003124542516089396),
+        ddph(start=3.0281730893713696E-05),
+        s(start=3717.7313726510624),
+        u(start=1547373.284870831),
+        x(start=0.2275139598264478)),
+      prov(
+        T(start=555.8900824040454),
+        cp(start=5199.16223540131),
+        d(start=34.70359395561105),
+        ddhp(start=-2.169113186741112E-05),
+        ddph(start=5.484240518018201E-06),
+        duhp(start=0.0),
+        duph(start=0.0),
+        s(start=5837.62024883985),
+        u(start=2583903.72991839),
+        x(start=1.0)),
+      vsat(
+        P(start=6685889.957330225),
+        T(start=555.8900824040454),
+        cp(start=5199.162235041228),
+        h(start=2776560.7239829493),
+        rho(start=34.70359386973889)),
+      xmv(start=0.2275139598264478)),
+    CapteurPAlim(C2(h_vol(start=1191956.6286634116))),
+    DPSeparateurCyclone(
+      Pm(start=6695802.348134679),
+      deltaP(start=19824.781608907506),
+      deltaPf(start=19824.781608907506),
+      pro(
+        T(start=555.9892694208781),
+        cp(start=5308.9688136686655),
+        d(start=132.0127276025087),
+        ddhp(start=-0.0003134698378714368),
+        ddph(start=3.032321316899426E-05),
+        s(start=3717.596156712044),
+        u(start=1547413.6849877203),
+        x(start=0.2272672559769073))),
+    DPnulle_AlimDwnc(
+      Pm(start=6673818.113529004),
+      deltaP(start=0.5435487413796104),
+      pro(
+        T(start=503.19950956331274),
+        cp(start=4648.1496437553415),
+        d(start=830.7422420964481),
+        ddhp(start=-0.0002923178293527613),
+        ddph(start=9.971415038963818E-07),
+        duhp(start=0.9971731869808205),
+        duph(start=-0.0011941001108068286),
+        s(start=2602.8509116489927),
+        u(start=983180.30060262))),
+    DPnulle_DomeDwnc(
+      Pm(start=6679855.553702783),
+      deltaP(start=12072.115575592095),
+      pro(
+        T(start=555.8296283466265),
+        cp(start=5336.696269133857),
+        d(start=742.2975474408748),
+        ddhp(start=-0.009931990199185458),
+        ddph(start=0.0005071767377452484),
+        s(start=3093.392533872336),
+        u(start=1242063.5249751657),
+        x(start=0.00020892919505243257))),
+    DownComerGV(
+      Pm(start=6709247.622898575),
+      deltaP(start=-70859.56228788428),
+      deltaPf(start=10343.671891713875),
+      pro(
+        T(start=544.5578995387173),
+        cp(start=5116.701168294162),
+        d(start=766.7060069854156),
+        ddhp(start=-0.00034940206878867106),
+        ddph(start=1.3430230342017287E-06),
+        duhp(start=0.9960121253232749),
+        duph(start=-0.001288952315284096),
+        s(start=2985.7570607121847),
+        u(start=1183124.7626597683))),
+    MixAlimDomeGV(
+      Cs(Q(start=9339.941827962692), h(start=1191956.4712466928)),
+      P(start=6673817.841754633),
+      h(start=1191956.6286634116)),
+    RiserGV(
+      Bo(start={8.36232783213913E-05,6.719031685234453E-05,5.3902580621083615E-05,
+            4.3219450969915566E-05,3.4655421661615915E-05}),
+      E(start={1.8089252979967894,2.168041540755742,2.4495767429686435,2.686214536869773,
+            2.8875474533284047}),
+      P(start={6744679.0,6730844.178675402,6722919.887991146,6717806.760111813,
+            6713513.950414306,6709544.543243809,6705716.5}),
+      Pb(start={6744677.404042517,6730842.014839868,6722917.755797146,6717804.768746651,
+            6713512.17026991,6709542.982511975,6705714.738939133}),
+      Prl(start={0.8611417203162811,0.8609919636211495,0.8608955373580308,0.8608147050118172,
+            0.8607400619251756}),
+      Prv(start={1.5570415739842978,1.5564630566624507,1.5560899850703338,1.5557768983784575,
+            1.5554875013970515}),
+      Q(start={9339.945517283284,9339.957549715728,9339.950467134453,9339.971120571425,
+            9339.99231499105,9339.94573814933}),
+      Rel1(start={152447.92616300168,142335.83437866767,134187.4670116368,127627.13721601243,
+            122352.45830523479}),
+      Rel2(start={150254.8095554807,158381.90435368326,158338.64373732614,158307.8596587163,
+            158280.86327060199,158254.24951013742}),
+      Rev1(start={77575.19134507612,78492.42896087494,118291.45136780897,150350.67441393988,
+            176126.90213191492}),
+      Rev2(start={800781.2331255227,775825.1621067446,775944.3156908562,776032.459340436,
+            776110.1664016051,776177.9976943603}),
+      S(start={0.18646067993756296,0.14741074522742095,0.12672138156071908,0.11344216340597164,
+            0.10421727726182724}),
+      Xtt(start={4.698170701711023,1.8127401059042414,1.188271404248455,0.9152344407112684,
+            0.7640757330368099}),
+      cpl(start={5346.726569359595,5345.168915645627,5344.164527232125,5343.321694007195,
+            5342.542684925076}),
+      cpv(start={5221.027203402077,5217.165709967847,5214.675763895988,5212.586310375188,
+            5210.655071078048}),
+      dpf(start={240.68807268349988,452.0282523273246,796.4016623418449,1075.0791568424715,
+            1300.0141603980285,1481.2392512305416}),
+      dpg(start={13594.701129965273,7472.230790394849,4316.585388153266,3217.51931989806,
+            2669.1735975373467,2347.0043216117883}),
+      filo(start={1.0,1.8244789333783462,3.2149487183763448,4.340397003032226,
+            5.24901975341115,5.981365111705367}),
+      h(start={1191956.625,1310718.2999586433,1407095.2062599964,
+            1484973.8626912842,1547709.5248752024,1598134.6590527825,
+            1598134.625}),
+      hb(start={1191956.470966204,1310718.1635102467,1407095.1037077138,1484973.7864303382,
+            1547709.4688659392,1598134.5693370847}),
+      hcl(start={4714.132382823345,4462.913929306216,4257.719777481008,4090.6834703548934,
+            3955.15054441558}),
+      hcv(start={383.76889659966645,387.121911103175,537.2182885232792,650.5888704015,
+            738.1244350192029}),
+      heb(start={22924.47715828864,19779.433674412754,17055.41562379167,14704.508805435535,
+            12678.83726898374}),
+      hi(start={12802.026923542666,12591.483849674842,12590.89717593426,12656.564694510973,
+            12742.038781076928}),
+      khi(start={2.3513340432056835,4.288569536664796,7.556981589962004,10.202445311916463,
+            12.338247331434427,14.05969876658083}),
+      kl(start={0.5728692678795172,0.5729916458588682,0.5730706248756353,0.5731369417495803,
+            0.5731982704985713}),
+      kv(start={0.06317601452157781,0.06314090911016851,0.0631182627268245,0.06309925287038186,
+            0.06308167756999997}),
+      lambdal(start={0.0479760579943903,0.04796051438183811,0.04796059291079075,
+            0.0479606488177225,0.04796069786367081,0.04796074623080051}),
+      lambdav(start={0.04772930760010263,0.047731146229000085,0.04773113716961201,
+            0.0477311304697349,0.047731124564413474,0.04773111941056356}),
+      lsat1(
+        P(start={6730842.014839868,6722917.755797146,6717804.768746651,6713512.17026991,
+              6709542.982511975}),
+        T(start={556.3389924406671,556.2600241306386,556.209033479274,556.1662014733531,
+              556.1265778709004}),
+        cp(start={5346.726569359595,5345.168915645627,5344.164527232125,5343.321694007195,
+              5342.542684925076}),
+        h(start={1253431.585007418,1253014.584289221,1252745.3765170192,1252519.2753799693,
+              1252310.1372499361}),
+        rho(start={744.5554743628229,744.6985944893112,744.7909675083922,744.8685356754302,
+              744.9402732286163})),
+      lsat2(
+        P(start={6737759.709441192,6726879.8853185065,6720361.262271898,6715658.469508281,
+              6711527.576390943,6707628.860725554}),
+        T(start={556.4078718941712,556.2995171701539,556.2345325100885,556.1876200910507,
+              556.1463919101247,556.1074631772785}),
+        cp(start={5348.087383026628,5345.94758697866,5344.666656791734,5343.743065105156,
+              5342.932150590179,5342.167122646409}),
+        h(start={1253795.3933348258,1253223.1188795213,1252879.9946819467,1252632.3360268243,
+              1252414.714942419,1252209.2567110015}),
+        rho(start={744.4305757562969,744.6270280030437,744.7447783179862,744.8297496988638,
+              744.9044028308721,744.9748729576461})),
+      lv(start={1522570.0385954217,1523085.8971144324,1523418.823481502,1523698.3784384602,
+            1523956.9097721667}),
+      mul1(start={9.226610346696365E-05,9.229665331295747E-05,9.231638379253507E-05,
+            9.233295985096189E-05,9.234829629653449E-05}),
+      mul2(start={9.727263281588834E-05,9.228137398267151E-05,9.230651671343234E-05,
+            9.232467052305553E-05,9.234062696166577E-05,9.235569540519083E-05}),
+      muv1(start={1.8840675839542634E-05,1.8837142206599475E-05,1.8834861638812487E-05,
+            1.8832946655537446E-05,1.883117567538255E-05}),
+      muv2(start={1.8251777531879907E-05,1.8838909153270027E-05,1.8836001977163446E-05,
+            1.8833904185687363E-05,1.883206119848459E-05,1.8830321534172908E-05}),
+      pro1(
+        T(start={556.3389924406671,556.2600241306386,556.209033479274,556.1662014733531,
+              556.1265778709004}),
+        cp(start={5341.997140556225,5332.219678537313,5324.425392368035,5317.993975781659,
+              5312.6140439867995}),
+        d(start={422.1720540531306,243.6497354232064,181.57215015669672,150.61451609815575,
+              132.42973001362074}),
+        ddhp(start={-0.00319108389079441,-0.0010640050423927085,-0.000591292731080987,
+              -0.0004070832851860468,-0.0003148819563620984}),
+        ddph(start={0.00018609324345610672,7.565042805859356E-05,4.8149034231418565E-05,
+              3.654225278798846E-05,3.0380824214989255E-05}),
+        s(start={3200.500205751786,3373.7926661062174,3513.8472477853757,3626.6899332519934,
+              3717.4092556184078}),
+        u(start={1294774.8012004504,1379502.5526872098,1447975.7954777104,1503135.331231724,
+              1547469.639477136}),
+        x(start={0.03762492171176301,0.10116338133680211,0.15243897891625255,0.1937326951732345,
+              0.22692533487633168})),
+      pro2(
+        T(start={544.5598781930121,556.2995171701539,556.2345325100885,556.1876200910507,
+              556.1463919101247,556.1074631772785}),
+        cp(start={5116.124586626926,5341.158251933199,5331.632315888745,5323.901069374985,
+              5317.485956882676,5312.106117666421}),
+        d(start={766.7442573307001,421.4355225067566,243.45646861181493,
+              181.46888508303257,150.5420511017391,132.37160981170285}),
+        ddhp(start={-0.00034933567877009714,-0.0031816163823316693,-0.0010626747818988857,
+              -0.0005907870162234465,-0.00040679782214652157,-0.0003146849446210644}),
+        ddph(start={1.342619521991597E-06,0.00018570017910512666,7.559521377445194E-05,
+              4.812814914753926E-05,3.65305389476637E-05,3.0372791387005017E-05}),
+        duhp(start={0.9959963386360166,0.0,0.0,0.0,0.0,0.0}),
+        duph(start={-0.001288828265754332,0.0,0.0,0.0,0.0,0.0}),
+        s(start={2985.688955141166,3200.517090220022,3373.811536436535,3513.8685062727945,
+              3626.7136311863687,3717.43525191881}),
+        u(start={1183088.112657001,1294756.3402571988,1379491.1439751012,1447966.559777595,
+              1503127.046666921,1547461.8469760437}),
+        x(start={0.0,0.03775544351406177,0.10124068330308128,0.15249918912231897,
+              0.1937848784682335,0.22697296061269584})),
+      rhol1(start={744.5554743628229,744.6985944893112,744.7909675083922,744.8685356754302,
+            744.9402732286163}),
+      rhol2(start={766.7443115494995,744.6270280030437,744.7447783179862,744.8297496988638,
+            744.9044028308721,744.9748729576461}),
+      rhov1(start={34.962439803124745,34.91677118740676,34.88731311261495,34.86258695993451,
+            34.839728028512795}),
+      rhov2(start={35.00233252971344,34.939615804510595,34.902053167740824,
+            34.87496029205291,34.85116659616274,34.82871488826041}),
+      vsat1(
+        P(start={6730842.014839868,6722917.755797146,6717804.768746651,6713512.17026991,
+              6709542.982511975}),
+        T(start={556.3389924406671,556.2600241306386,556.209033479274,556.1662014733531,
+              556.1265778709004}),
+        cp(start={5221.027203402077,5217.165709967847,5214.675763895988,5212.586310375188,
+              5210.655071078048}),
+        h(start={2776001.6236028397,2776100.4814036535,2776164.1999985212,2776217.6538184294,
+              2776267.047022103}),
+        rho(start={34.962439803124745,34.91677118740676,34.88731311261495,34.86258695993451,
+              34.839728028512795})),
+      vsat2(
+        P(start={6737759.709441192,6726879.8853185065,6720361.262271898,6715658.469508281,
+              6711527.576390943,6707628.860725554}),
+        T(start={556.4078718941712,556.2995171701539,556.2345325100885,556.1876200910507,
+              556.1463919101247,556.1074631772785}),
+        cp(start={5224.400687871225,5219.096076316945,5215.920578854191,5213.63092585794,
+              5211.620595691562,5209.7240118069485}),
+        h(start={2775915.218951537,2776051.068425704,2776132.3473364403,2776190.931588626,
+              2776242.354424242,2776290.8552075126}),
+        rho(start={35.00232099234372,34.939603425200005,34.90204128895865,34.87494942975982,
+              34.85115697594991,34.828705899911355})),
+      xbi(start={0.1,0.10116338133680211,0.15243897891625255,0.1937326951732345,
+            0.22692533487633168}),
+      xbs(start={0.03762492171176301,0.10116338133680211,0.15243897891625255,0.1937326951732345,
+            0.22692533487633168}),
+      xv1(start={0.03762492171176301,0.10116338133680211,0.15243897891625255,0.1937326951732345,
+            0.22692533487633168}),
+      xv2(start={0.0,0.037755462355471406,0.10124068828424883,
+            0.15249918627518708,0.1937848713005096,0.22697298063788682})),
+    UtubeColdtLeg(
+      P(start={15447790.0,15447793.435965536,15447988.9417549,15448335.779657947,
+            15448802.227928547,15449363.461882193,15450000.0}),
+      Pr(start={0.8485399987514178,0.8437223731225957,0.8401600873442849,0.8374915591415923,
+            0.8354691402947125}),
+      Q(start={19024.0,19024.000000015938,19024.000000009222,19024.000000008615,
+            19023.999999970874,19024.0}),
+      Re1(start={740663.8508554634,733608.5077475865,727989.9817080003,723509.8311430685,
+            719932.3370803626}),
+      Re2(start={749531.3596003209,740663.622970807,733608.1144879417,727989.4642062903,
+            723509.219077554,719931.6522898132}),
+      Tp(start={566.7297002735512,564.6222622392298,562.9190330221342,
+            561.5451774467969,560.4382106375682}),
+      dW1(start={-279756440.2213714,-224857207.7402948,-180428396.93185326,-144695540.64418706,
+            -116043331.60183546}),
+      dpf(start={12985.764633102444,12890.22304265516,12815.390343383635,12756.556515383141,
+            12710.12948386807,12673.368264480014}),
+      dpg(start={-12989.344769820433,-13085.728832018916,-13162.228246430617,-13223.004785983429,
+            -13271.36343751352,-13309.90638228737}),
+      h(start={1321139.75,1306434.251413758,1294614.597820902,1285130.35135033,
+            1277524.4079718543,1271424.5719925927,1271870.0}),
+      hb(start={1321139.625,1306434.1567753016,1294614.4969952605,1285130.2456888258,
+            1277524.2984409477,1271424.5}),
+      hc(start={180530.2031525729,179938.6049945257,179471.09155340536,179100.18674382113,
+            178805.0107388246}),
+      k(start={0.569903424256179,0.5737071703327904,0.57672211580297,0.5791159895438929,
+            0.5810204484096431}),
+      khi(start={7.049456890976183,7.049514957752702,7.049562160417504,7.049600404492563,
+            7.049631325412611,7.049656292675035}),
+      lambda(start={0.06577673548161958,0.06577727728832305,0.06577771772469208,
+            0.06577807457068005,0.0657783630861232,0.0657785960494623}),
+      mu1(start={9.075581813143527E-05,9.162864529941209E-05,9.233582251683199E-05,
+            9.290758860699127E-05,9.336926581161909E-05}),
+      mu2(start={8.968210987240277E-05,9.075584605522865E-05,9.162869441805722E-05,
+            9.233588815506897E-05,9.290766720372902E-05,9.336935462663355E-05}),
+      pro1(
+        T(start={567.3606167505245,565.1310305469619,563.3283341246621,561.8740936880697,
+              560.7024265549542}),
+        cp(start={5328.428092691793,5282.731984620283,5247.5722853725265,5220.292123376071,
+              5198.976882883934}),
+        d(start={738.0380092688561,742.3524865572139,745.7802158755532,748.5075923732937,
+              750.6813748472894}),
+        ddhp(start={-0.00036676171559905517,-0.00036268799998067465,-0.0003594946257470463,
+              -0.0003569797546577219,-0.00035499122637001624}),
+        ddph(start={1.4933932735181671E-06,1.4616259058594299E-06,1.4370818019756576E-06,
+              1.4179752895616462E-06,1.4030071651800273E-06}),
+        duhp(start={0.989598571415198,0.989833187801047,0.9900149007394048,0.9901565808073962,
+              0.9902676677086574}),
+        duph(start={-0.0013125908630425016,-0.0013060969063559476,-0.0013009621279523138,
+              -0.0012968923057242862,-0.0012936586788916359}),
+        s(start={3170.9701686994877,3150.0796873505356,3133.256922874029,3119.726630464892,
+              3108.8499763175782}),
+        u(start={1285520.5967581493,1273813.0797732072,1264416.8129174528,1256880.128694022,
+              1250834.956032079})),
+      pro2(
+        T(start={570.1073620438502,567.3606291892737,565.1310507666656,563.3283593967624,
+              561.8741222961053,560.7024574022039}),
+        cp(start={5388.406461510192,5328.425505385109,5282.727656653133,5247.56672750207,
+              5220.28567521346,5198.969777271499}),
+        d(start={732.6020394319872,738.0381206169448,742.352703554415,
+              745.7805131286152,748.5079512259089,750.6817815580962}),
+        ddhp(start={-0.00037198509316790397,-0.0003667614473786902,-0.0003626875439828175,
+              -0.0003594940326834898,-0.0003569790596820252,-0.0003549904544619478}),
+        ddph(start={1.5348719848853683E-06,1.4933915062892603E-06,1.4616229379957508E-06,
+              1.4370779785040732E-06,1.4179708421512154E-06,1.4030022541131503E-06}),
+        duhp(start={0.9892932994910214,0.9895985173197178,0.9898330933971353,0.9900147754443821,
+              0.9901564316396775,0.9902674999572604}),
+        duph(start={-0.0013208198886598558,-0.0013125903937424904,-0.0013060960974349875,
+              -0.0013009610646510298,-0.001296891049382636,-0.001293657274439685}),
+        s(start={3196.847283434861,3170.9699348038343,3150.0792734295214,3133.2563672449337,
+              3119.725962876822,3108.849219981283}),
+        u(start={1300082.5210781347,1285520.4681977315,1273812.8529621325,1264416.5092279054,
+              1256879.764567582,1250834.5441956373}))),
+    UtubeHotLeg(
+      P(start={15603802.0,15577733.16816351,15551714.872362692,15525721.988763008,
+            15499741.08610745,15473764.965712622,15447789.855828818}),
+      Pr(start={0.9268274247754805,0.897220182583634,0.8776550489979607,0.8643305290624336,
+            0.8550366643423865}),
+      Q(start={19024.0,19024.000000000367,19023.99999999964,19024.00000000011,
+            19024.00000000002,19023.999999857715}),
+      Re1(start={817014.9631080779,793512.4891762563,775190.750855054,760808.3585747941,
+            749468.6458729169}),
+      Re2(start={847542.9071926117,817056.763761018,793550.1745179154,775225.5981630007,
+            760841.1868977759,749500.0019445078}),
+      Tp(start={587.1471444673728,581.3736997008687,576.5497988489371,572.5694454974841,
+            569.3138535902852}),
+      dW1(start={-829471303.2582991,-675298164.5954175,-546954258.1361314,-441252316.60268044,
+            -354924279.10826033}),
+      dpf(start={14143.81169622979,13764.757653658597,13483.640810563862,13271.695204581403,
+            13109.956929621685,12985.411439622238}),
+      dpg(start={11924.87266970522,12253.538147159534,12509.242789119782,12709.20745097726,
+            12866.163465206111,12989.698444181831}),
+      h(start={1470840.0,1427238.7169755003,1391741.5678048218,
+            1362990.8350133097,1339796.3404456903,1321139.6915852583,
+            1321139.6915852583}),
+      hb(start={1470840.0,1427238.6909545925,1391741.5208216964,1362990.7713406922,
+            1339796.2635364125,1321139.6046708333}),
+      hc(start={187557.424629481,185223.2513470597,183525.84657594314,182251.43681092552,
+            181274.8219651142}),
+      k(start={0.5284062480708878,0.5411405997880095,0.5511350993903698,0.5589797069058337,
+            0.5651426182420888}),
+      khi(start={7.048896016477203,7.0490560598548235,7.049187856831117,7.049296141853237,
+            7.0493847966826495,7.049457093888881}),
+      lambda(start={0.06577150210064735,0.06577299542574716,0.0657742251906753,
+            0.06577523557138501,0.06577606278763069,0.06577673737494769}),
+      mu1(start={8.22745687414035E-05,8.471139983539598E-05,8.671356523648527E-05,
+            8.835280657393318E-05,8.968961425523977E-05}),
+      mu2(start={7.931109230522286E-05,8.227035957155674E-05,8.470737692903291E-05,
+            8.67096673591225E-05,8.834899437958743E-05,8.968586200145771E-05}),
+      pro1(
+        T(start={588.9477609818658,582.858110790298,577.7632097600199,573.5552031604133,
+              570.1110261588411}),
+        cp(start={5952.524694162988,5731.486773782996,5578.210298939806,5468.340447123108,
+              5387.665709033955}),
+        d(start={691.127359877131,705.5472298934878,716.8239215163549,725.6752920941296,
+              732.6419658963861}),
+        ddhp(start={-0.0004155037407332219,-0.00039950364903529664,-0.00038764690462658323,
+              -0.00037871867103524235,-0.00037190987432426687}),
+        ddph(start={1.913324046385813E-06,1.7676886847969924E-06,1.6646162173978048E-06,
+              1.589797767320067E-06,1.5343684730931183E-06}),
+        duhp(start={0.9864492595525407,0.9875190726980947,0.9882871347842476,0.9888530388529411,
+              0.9892786339968481}),
+        duph(start={-0.0013845124644803236,-0.0013621150476988279,-0.0013447458609298535,
+              -0.0013312337168638212,-0.0013206906170049192}),
+        s(start={3379.699931658541,3319.149598936592,3269.6351153218507,3229.3746379138815,
+              3196.7849331292546}),
+        u(start={1404798.5339229864,1369781.3633704544,1341393.6675134916,1318481.1435503685,
+              1300048.1237550098})),
+      pro2(
+        T(start={596.0859341143205,588.9442860448619,582.85527283777,
+              577.7608227333928,573.5531441569481,570.1092105814562}),
+        cp(start={6287.424500337378,5953.2092619090545,5732.035067658993,5578.674078053739,
+              5468.748767250006,5388.036019379184}),
+        d(start={672.5655973062072,691.1023960011623,705.5241894233388,
+              716.8022370268958,725.6545883530431,732.6219867525609}),
+        ddhp(start={-0.00043755438647838607,-0.00041556158626975236,-0.00039955340092966444,
+              -0.0003876911089995012,-0.0003787590182590652,-0.00037194747842221474}),
+        ddph(start={2.125515159248024E-06,1.9137632836338014E-06,1.768050868830993E-06,
+              1.664926867421845E-06,1.5900735967837824E-06,1.5346201866315948E-06}),
+        duhp(start={0.9849189965297267,0.9864577131377691,0.9875271359484448,0.9882948931077569,
+              0.9888605582077337,0.9892859662078309}),
+        duph(start={-0.001413584577942525,-0.0013845980008344576,-0.0013621925396860423,
+              -0.0013448176826787214,-0.001331301412187632,-0.0013207552475314353}),
+        s(start={3453.2540263365545,3379.732135996568,3319.1813992316747,3269.6666323604823,
+              3229.4059560133437,3196.8161099746217}),
+        u(start={1447760.1088342038,1404816.6870605783,1369799.1794393272,1341411.2226579608,
+              1318498.4978916019,1300065.3231918123}))),
+    heatExchangerWall(Tp(start={572.0950631803388,569.1193407405048,
+            566.6244487160184,564.5622289104098,562.8731995116093}),
+                                                   Tp2(start={558.6757500946919,
+            558.1941327385717,557.7756039179028,557.4234616490846,
+            557.1311008891796})),
+    heatExchangerWall1(
+      Tp(start={561.6530707706147,560.5418673218728,559.6448700447268,
+            558.919444369886,558.3324177381908}),
+      Tp2(start={557.1271270652367,556.9040478325486,556.7258249532296,
+            556.5784950152436,556.4550203517163}),
+      dW2(start={-279756444.46082795,-224857217.37124035,-180428416.14701596,-144695586.80142948,
+            -116043366.39102629})),
+    volumeA(P(start=6744677.404042517), h(start=1191956.6337581165)),
+    volumeA1(P(start=6705714.738939133), h(start=1598134.5758857883)),
+    DPnulle_Vapeur(
+      Pm(start=6685883.451529068),
+      deltaP(start=13.01160231452267),
+      pro(
+        T(start=555.8900172677318),
+        cp(start=5199.159085307482),
+        d(start=34.703568752556855),
+        ddhp(start=-2.1691105938244643E-05),
+        ddph(start=5.484239768071665E-06),
+        s(start=5837.62058607886),
+        u(start=2583903.7193358056),
+        x(start=0.9999999445568193))))
+    annotation (Placement(transformation(extent={{-34,-32},{32,44}})));
+equation
+  connect(sinkP1.C, singularPressureLoss1.C2)
+    annotation (Line(points={{74,66},{52,66},{50,66}}));
+  connect(singularPressureLoss2.C1, sourceQ1.C)
+    annotation (Line(points={{48,35},{72,35},{72,34}}));
+  connect(sourceQ.C,steamGenerator_4SG. fluidInlet1) annotation (Line(points={{-56,-53},
+          {-36,-53},{-36,-24.9067},{-11.12,-24.9067}},            color={0,0,
+          255}));
+  connect(sinkP.C,steamGenerator_4SG. fluidOutletI1) annotation (Line(points={{68,-54},
+          {34,-54},{34,-24.9067},{9.12,-24.9067}},           color={0,0,255}));
+  connect(singularPressureLoss2.C2,steamGenerator_4SG. fluidInlet)
+    annotation (Line(points={{30,35},{26,35},{26,34.3733},{10.44,34.3733}},
+        color={0,0,255}));
+  connect(singularPressureLoss1.C1,steamGenerator_4SG. fluidOutletI)
+    annotation (Line(points={{32,66},{-2,66},{-2,43.7467},{-1,43.7467}},
+        color={0,0,255}));
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+                                                                 Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSteamGenerator_4SG;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine.mo b/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine.mo
index 83330ce390b670b5349ae3b111bc73de887f3642..f31e54c321c2a5dce516a7e94daed9cbe1b4997f 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine.mo
@@ -1,85 +1,84 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStodolaTurbine
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine(fluid=1, Hrs(
-        start=2987.37e3))
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=45e5,
-    C(h_vol(start=2987.37e3), h(start=2987.37e3)))
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    h0=3.e6,
-    option_temperature=2,
-    mode=2,
-    P0=48.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
-    DynamicCentrifugalPump1(
-    Qv(start=1.221),
-    Ch(start=993.869),
-    C1(P(start=134969)),
-    Pm(start=216319),
-    h(start=100111),
-    R(start=1.857))
-    annotation (Placement(transformation(extent={{20,-40},{0,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
-                                        ze2=10, zs2=10,
-    P(start=248019))
-    annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1(Pm(start=
-          215576))
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
-                                                  k=0.5) annotation (Placement(
-        transformation(extent={{20,60},{40,80}}, rotation=0)));
-equation
-  connect(DynamicCentrifugalPump1.C2,Bache1. Ce2)
-    annotation (Line(points={{0,-30.2},{-10,-30},{-20,-30},{-20,24},{0,24}},
-        color={0,0,255}));
-  connect(Bache1.Cs2,VanneReglante1. C1)
-    annotation (Line(points={{20,24},{60,24}}, color={0,0,255}));
-  connect(VanneReglante1.C2,DynamicCentrifugalPump1. C1)
-    annotation (Line(points={{80,24},{100,24},{100,-30},{20,-30}}, color={0,0,
-          255}));
-  connect(Constante1.y,VanneReglante1. Ouv)
-    annotation (Line(points={{41,70},{70,70},{70,41}}, color={0,0,255}));
-  connect(sourceP.C, stodolaTurbine.Ce)
-    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
-  connect(stodolaTurbine.Cs, puitsP.C)
-    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
-  connect(stodolaTurbine.M, DynamicCentrifugalPump1.M)
-    annotation (Line(points={{-50,60},{-50,-60},{10,-60},{10,-41}}, smooth=
-          Smooth.None));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStodolaTurbine;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStodolaTurbine
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine(fluid=1, Hrs(
+        start=2987.37e3))
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=45e5,
+    C(h_vol(start=2987.37e3), h(start=2987.37e3)))
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    h0=3.e6,
+    option_temperature=2,
+    mode=2,
+    P0=48.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
+    DynamicCentrifugalPump1(
+    Qv(start=1.221),
+    Ch(start=993.869),
+    C1(P(start=134969)),
+    Pm(start=216319),
+    h(start=100111),
+    R(start=1.857))
+    annotation (Placement(transformation(extent={{20,-40},{0,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Bache1(
+                                        ze2=10, zs2=10,
+    P(start=248019))
+    annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1(Pm(start=
+          215576))
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(
+                                                  k=0.5) annotation (Placement(
+        transformation(extent={{20,60},{40,80}}, rotation=0)));
+equation
+  connect(DynamicCentrifugalPump1.C2,Bache1. Ce2)
+    annotation (Line(points={{0,-30.2},{-10,-30},{-20,-30},{-20,24},{0,24}},
+        color={0,0,255}));
+  connect(Bache1.Cs2,VanneReglante1. C1)
+    annotation (Line(points={{20,24},{60,24}}, color={0,0,255}));
+  connect(VanneReglante1.C2,DynamicCentrifugalPump1. C1)
+    annotation (Line(points={{80,24},{100,24},{100,-30},{20,-30}}, color={0,0,
+          255}));
+  connect(Constante1.y,VanneReglante1. Ouv)
+    annotation (Line(points={{41,70},{70,70},{70,41}}, color={0,0,255}));
+  connect(sourceP.C, stodolaTurbine.Ce)
+    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
+  connect(stodolaTurbine.Cs, puitsP.C)
+    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
+  connect(stodolaTurbine.M, DynamicCentrifugalPump1.M)
+    annotation (Line(points={{-50,60},{-50,-60},{10,-60},{10,-41}}, smooth=
+          Smooth.None));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStodolaTurbine;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine1.mo b/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine1.mo
index a6e922a639f6cf398807cdd42794410f7cfea18c..5a52ccf82b5bcde00a2a42c87f03e7e03b7fe63c 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine1.mo
@@ -1,88 +1,88 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStodolaTurbine1
-  parameter Units.SI.AbsolutePressure PoutPump(fixed=false, start=13e5)
-    "Flow pressure at the outlet of the pump";
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine(pros1(x(start=
-            1)), Hrs(start=2931e3),
-    pros(d(start=19.715136086827403)))
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=45e5,
-    C(h_vol(start=75002)))
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    h0=3.e6,
-    option_temperature=2,
-    mode=2,
-    P0=65e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
-    DynamicCentrifugalPump1(
-                        Q(fixed=true, start=50),
-    R(start=3.1196162550258855),
-    Qv(start=0.03654547625832159),
-    Ch(start=9001.678648281353),
-    Pm(start=3816357.071499178),
-    h(start=3041170.0441966015),
-    C1(P(start=10e5)),
-    C2(P(start=3.e6), h(start=3082340.088393203)))
-    annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
-    annotation (Placement(transformation(extent={{-20,-90},{0,-70}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(                 mode=0, P0=13e5)
-    annotation (Placement(transformation(extent={{60,-40},{80,-20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    h0=3.e6,
-    option_temperature=2,
-    mode=2,
-    P0=10e5) annotation (Placement(transformation(extent={{-20,-40},{0,-20}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Pout(k=PoutPump)
-    annotation (Placement(transformation(extent={{56,-12},{68,0}}, rotation=0)));
-equation
-  connect(Shaft1.C2, DynamicCentrifugalPump1.M)
-    annotation (Line(points={{1,-80},{30,-80},{30,-41}}));
-  connect(stodolaTurbine.M, Shaft1.C1)
-    annotation (Line(points={{-50,60},{-50,-80},{-21,-80}}));
-  connect(sourceP1.C, DynamicCentrifugalPump1.C1)
-    annotation (Line(points={{0,-30},{20,-30}}, color={0,0,255}));
-  connect(DynamicCentrifugalPump1.C2, puitsP1.C) annotation (Line(points={{40,
-          -30.2},{50,-30.2},{50,-30},{60,-30}}, color={0,0,255}));
-  connect(sourceP.C, stodolaTurbine.Ce)
-    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
-  connect(stodolaTurbine.Cs, puitsP.C)
-    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
-  connect(Pout.y, puitsP1.IPressure)
-    annotation (Line(points={{68.6,-6},{88,-6},{88,-30},{75,-30}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStodolaTurbine1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStodolaTurbine1
+  parameter Units.SI.AbsolutePressure PoutPump(fixed=false, start=13e5)
+    "Flow pressure at the outlet of the pump";
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine(pros1(x(start=
+            1)), Hrs(start=2931e3),
+    pros(d(start=19.715136086827403)))
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=45e5,
+    C(h_vol(start=75002)))
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    h0=3.e6,
+    option_temperature=2,
+    mode=2,
+    P0=65e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.DynamicCentrifugalPump
+    DynamicCentrifugalPump1(
+                        Q(fixed=true, start=50),
+    R(start=3.1196162550258855),
+    Qv(start=0.03654547625832159),
+    Ch(start=9001.678648281353),
+    Pm(start=3816357.071499178),
+    h(start=3041170.0441966015),
+    C1(P(start=10e5)),
+    C2(P(start=3.e6), h(start=3082340.088393203)))
+    annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
+    annotation (Placement(transformation(extent={{-20,-90},{0,-70}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(                 mode=0, P0=13e5)
+    annotation (Placement(transformation(extent={{60,-40},{80,-20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    h0=3.e6,
+    option_temperature=2,
+    mode=2,
+    P0=10e5) annotation (Placement(transformation(extent={{-20,-40},{0,-20}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Pout(k=PoutPump)
+    annotation (Placement(transformation(extent={{56,-12},{68,0}}, rotation=0)));
+equation
+  connect(Shaft1.C2, DynamicCentrifugalPump1.M)
+    annotation (Line(points={{1,-80},{30,-80},{30,-41}}));
+  connect(stodolaTurbine.M, Shaft1.C1)
+    annotation (Line(points={{-50,60},{-50,-80},{-21,-80}}));
+  connect(sourceP1.C, DynamicCentrifugalPump1.C1)
+    annotation (Line(points={{0,-30},{20,-30}}, color={0,0,255}));
+  connect(DynamicCentrifugalPump1.C2, puitsP1.C) annotation (Line(points={{40,
+          -30.2},{50,-30.2},{50,-30},{60,-30}}, color={0,0,255}));
+  connect(sourceP.C, stodolaTurbine.Ce)
+    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
+  connect(stodolaTurbine.Cs, puitsP.C)
+    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
+  connect(Pout.y, puitsP1.IPressure)
+    annotation (Line(points={{68.6,-6},{88,-6},{88,-30},{75,-30}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStodolaTurbine1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine2.mo b/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine2.mo
index 2682de23f4148840ad80ecc549f84093438b72cd..5e0d259ec75371e4166d93989816b9e45b1a454a 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine2.mo
@@ -1,51 +1,50 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStodolaTurbine2
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=5000)
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    h0=3.e6,
-    option_temperature=2,
-    mode=2,
-    P0=3e5)  annotation (Placement(transformation(extent={{-100,60},{-80,80}},
-          rotation=0)));
-equation
-  connect(sourceP.C, stodolaTurbine.Ce)
-    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
-  connect(stodolaTurbine.Cs, puitsP.C)
-    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStodolaTurbine2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStodolaTurbine2
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=5000)
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    h0=3.e6,
+    option_temperature=2,
+    mode=2,
+    P0=3e5)  annotation (Placement(transformation(extent={{-100,60},{-80,80}},
+          rotation=0)));
+equation
+  connect(sourceP.C, stodolaTurbine.Ce)
+    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
+  connect(stodolaTurbine.Cs, puitsP.C)
+    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStodolaTurbine2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine3.mo b/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine3.mo
index 84cf0844324e3f08315421949c2ea96e044c8169..84224bfb5e1ef78eeef6c7ac6c7c7ee95adef0e8 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine3.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestStodolaTurbine3.mo
@@ -1,77 +1,76 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestStodolaTurbine3
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=
-        5000000)
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
-    h0=3.e6,
-    option_temperature=2,
-    mode=2,
-    P0=23000000)
-             annotation (Placement(transformation(extent={{-100,60},{-80,80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine1
-    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(                mode=0, P0=
-        22500000)
-    annotation (Placement(transformation(extent={{-20,0},{0,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-    h0=3.e6,
-    option_temperature=2,
-    mode=2,
-    P0=30000000)
-             annotation (Placement(transformation(extent={{-100,0},{-80,20}},
-          rotation=0)));
-equation
-  connect(sourceP.C, stodolaTurbine.Ce)
-    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
-  connect(stodolaTurbine.Cs, puitsP.C)
-    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
-  connect(sourceP1.C, stodolaTurbine1.Ce)
-    annotation (Line(points={{-80,10},{-60.1,10}}, color={0,0,255}));
-  connect(stodolaTurbine1.Cs, puitsP1.C)
-    annotation (Line(points={{-39.9,10},{-20,10}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Text(
-          extent={{34,76},{82,64}},
-          lineColor={0,0,255},
-          textString=
-               "Supercritrical at the inlet"), Text(
-          extent={{20,18},{92,2}},
-          lineColor={0,0,255},
-          textString=
-               "Supercritrical at the inlet and the outlet")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestStodolaTurbine3;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestStodolaTurbine3
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(                 mode=0, P0=
+        5000000)
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(
+    h0=3.e6,
+    option_temperature=2,
+    mode=2,
+    P0=23000000)
+             annotation (Placement(transformation(extent={{-100,60},{-80,80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine stodolaTurbine1
+    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1(                mode=0, P0=
+        22500000)
+    annotation (Placement(transformation(extent={{-20,0},{0,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+    h0=3.e6,
+    option_temperature=2,
+    mode=2,
+    P0=30000000)
+             annotation (Placement(transformation(extent={{-100,0},{-80,20}},
+          rotation=0)));
+equation
+  connect(sourceP.C, stodolaTurbine.Ce)
+    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
+  connect(stodolaTurbine.Cs, puitsP.C)
+    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
+  connect(sourceP1.C, stodolaTurbine1.Ce)
+    annotation (Line(points={{-80,10},{-60.1,10}}, color={0,0,255}));
+  connect(stodolaTurbine1.Cs, puitsP1.C)
+    annotation (Line(points={{-39.9,10},{-20,10}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Text(
+          extent={{34,76},{82,64}},
+          lineColor={0,0,255},
+          textString=
+               "Supercritrical at the inlet"), Text(
+          extent={{20,18},{92,2}},
+          lineColor={0,0,255},
+          textString=
+               "Supercritrical at the inlet and the outlet")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestStodolaTurbine3;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestSwitchValve.mo b/ThermoSysPro/Examples/SimpleExamples/TestSwitchValve.mo
index 8077efbaf348842c22947d79d30d42734f894d2f..61db6ec92235e2dc057f9c0fecbe2e874c52a482 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestSwitchValve.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestSwitchValve.mo
@@ -1,66 +1,65 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestSwitchValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-10},{90,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.SwitchValve SwitchValve
-                                          annotation (Placement(transformation(
-          extent={{-18,-9},{18,37}},rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
-                                         width=10, period=20)
-    annotation (Placement(transformation(extent={{-50,31},{-30,51}}, rotation=0)));
-  WaterSteam.PressureLosses.LumpedStraightPipe              perteDP2
-                                        annotation (Placement(transformation(
-          extent={{-55,-10},{-35,10}},rotation=0)));
-  WaterSteam.PressureLosses.LumpedStraightPipe              perteDP1
-                                        annotation (Placement(transformation(
-          extent={{34,-10},{54,10}},rotation=0)));
-equation
-  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-29,41},{0,41},{
-          0,30.56}}));
-  connect(SourceP1.C, perteDP2.C1)
-    annotation (Line(points={{-70,0},{-55,0}},   color={0,0,255}));
-  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-35,0},{-20,0},
-          {-20,0.2},{-18,0.2}},       color={0,0,255}));
-  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{18,0.66},{20,
-          0.66},{20,0},{34,0}},    color={0,0,255}));
-  connect(perteDP1.C2, PuitsP1.C)
-    annotation (Line(points={{54,0},{54,0},{70,0}},    color={0,0,255}));
-  annotation (experiment(StopTime=100),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestSwitchValve;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestSwitchValve
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-10},{90,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.SwitchValve SwitchValve
+                                          annotation (Placement(transformation(
+          extent={{-18,-9},{18,37}},rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
+                                         width=10, period=20)
+    annotation (Placement(transformation(extent={{-50,31},{-30,51}}, rotation=0)));
+  WaterSteam.PressureLosses.LumpedStraightPipe              perteDP2
+                                        annotation (Placement(transformation(
+          extent={{-55,-10},{-35,10}},rotation=0)));
+  WaterSteam.PressureLosses.LumpedStraightPipe              perteDP1
+                                        annotation (Placement(transformation(
+          extent={{34,-10},{54,10}},rotation=0)));
+equation
+  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-29,41},{0,41},{
+          0,30.56}}));
+  connect(SourceP1.C, perteDP2.C1)
+    annotation (Line(points={{-70,0},{-55,0}},   color={0,0,255}));
+  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-35,0},{-20,0},
+          {-20,0.2},{-18,0.2}},       color={0,0,255}));
+  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{18,0.66},{20,
+          0.66},{20,0},{34,0}},    color={0,0,255}));
+  connect(perteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{54,0},{54,0},{70,0}},    color={0,0,255}));
+  annotation (experiment(StopTime=100),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestSwitchValve;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestTank.mo b/ThermoSysPro/Examples/SimpleExamples/TestTank.mo
index 3dee4bfba28a78b559159fac137ccfc6245e2740..746aa6b37540dd9e244302fe44c507591d6b8522 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestTank.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestTank.mo
@@ -1,63 +1,62 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestTank
-
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PerteDP1
-    annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
-    annotation (Placement(transformation(extent={{-50,2},{-30,22}},  rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-                                            annotation (Placement(
-        transformation(extent={{-90,-4},{-70,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-50},{90,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.Tank Tank1(z(fixed=false, start=5))
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}},
-                                                                  rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
-    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PerteDP2
-    annotation (Placement(transformation(extent={{30,-4},{50,16}},   rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP2
-                                          annotation (Placement(transformation(
-          extent={{70,-4},{90,16}},   rotation=0)));
-equation
-  connect(PerteDP1.C2, PuitsP1.C)
-    annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255}));
-  connect(SourceP1.C, VanneReglante1.C1)
-    annotation (Line(points={{-70,6},{-50,6}},   color={0,0,255}));
-  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{10,-6},{20,-6},{20,
-          -40},{30,-40}}, color={0,0,255}));
-  connect(Rampe1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{-69,40},{-40,40},{-40,23}}));
-  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},
-          {-10,6}},               color={0,0,255}));
-  connect(Tank1.Cs1, PerteDP2.C1)
-    annotation (Line(points={{10.2,6},{20,6},{30,6}},   color={0,0,255}));
-  connect(PerteDP2.C2, PuitsP2.C)
-    annotation (Line(points={{50,6},{50,6},{70,6}},    color={0,0,255}));
-  annotation (experiment(StopTime=20),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestTank;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestTank
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PerteDP1
+    annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1
+    annotation (Placement(transformation(extent={{-50,2},{-30,22}},  rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+                                            annotation (Placement(
+        transformation(extent={{-90,-4},{-70,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-50},{90,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Tank1(z(fixed=false, start=5))
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}},
+                                                                  rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
+    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PerteDP2
+    annotation (Placement(transformation(extent={{30,-4},{50,16}},   rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP2
+                                          annotation (Placement(transformation(
+          extent={{70,-4},{90,16}},   rotation=0)));
+equation
+  connect(PerteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255}));
+  connect(SourceP1.C, VanneReglante1.C1)
+    annotation (Line(points={{-70,6},{-50,6}},   color={0,0,255}));
+  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{10,-6},{20,-6},{20,
+          -40},{30,-40}}, color={0,0,255}));
+  connect(Rampe1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{-69,40},{-40,40},{-40,23}}));
+  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},
+          {-10,6}},               color={0,0,255}));
+  connect(Tank1.Cs1, PerteDP2.C1)
+    annotation (Line(points={{10.2,6},{20,6},{30,6}},   color={0,0,255}));
+  connect(PerteDP2.C2, PuitsP2.C)
+    annotation (Line(points={{50,6},{50,6},{70,6}},    color={0,0,255}));
+  annotation (experiment(StopTime=20),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestTank;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestThreeWayValve.mo b/ThermoSysPro/Examples/SimpleExamples/TestThreeWayValve.mo
index 4aaafaf24917abe263962c6d62d6cae611c66883..bfbb7ed0ff4b9bb756e2ad1ba1eb2477bf476d48 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestThreeWayValve.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestThreeWayValve.mo
@@ -1,64 +1,63 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestThreeWayValve
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-10},{90,10}},rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ThreeWayValve threeWayValve(
-    C2(Q(start=-7.902947109890763E-33)),
-    C3(Q(start=2716.4138702433384)),
-    Valve1(Pm(start=200000.0)),
-    VolumeA1(h(start=71016.12237181117)))
-    annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP2
-                                          annotation (Placement(transformation(
-          extent={{70,-50},{90,-30}},
-                                    rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe
-                                         annotation (Placement(transformation(
-          extent={{-50,30},{-30,50}}, rotation=0)));
-equation
-  connect(SourceP1.C, threeWayValve.C1)
-    annotation (Line(points={{-70,0},{-10,0}},   color={0,0,255}));
-  connect(threeWayValve.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{70,0}},  color={255,0,0}));
-  connect(threeWayValve.C3, PuitsP2.C) annotation (Line(points={{0,-6},{0,-40},
-          {70,-40}},      color={255,0,0}));
-  connect(rampe.y, threeWayValve.Ouv)
-    annotation (Line(points={{-29,40},{0,40},{0,15}}));
-  annotation (experiment(StopTime=5),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestThreeWayValve;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestThreeWayValve
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-10},{90,10}},rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ThreeWayValve threeWayValve(
+    C2(Q(start=-7.902947109890763E-33)),
+    C3(Q(start=2716.4138702433384)),
+    Valve1(Pm(start=200000.0)),
+    VolumeA1(h(start=71016.12237181117)))
+    annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP2
+                                          annotation (Placement(transformation(
+          extent={{70,-50},{90,-30}},
+                                    rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe
+                                         annotation (Placement(transformation(
+          extent={{-50,30},{-30,50}}, rotation=0)));
+equation
+  connect(SourceP1.C, threeWayValve.C1)
+    annotation (Line(points={{-70,0},{-10,0}},   color={0,0,255}));
+  connect(threeWayValve.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{70,0}},  color={255,0,0}));
+  connect(threeWayValve.C3, PuitsP2.C) annotation (Line(points={{0,-6},{0,-40},
+          {70,-40}},      color={255,0,0}));
+  connect(rampe.y, threeWayValve.Ouv)
+    annotation (Line(points={{-29,40},{0,40},{0,15}}));
+  annotation (experiment(StopTime=5),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestThreeWayValve;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestVolumeATh.mo b/ThermoSysPro/Examples/SimpleExamples/TestVolumeATh.mo
index 8c5d0041736d2d0d91669a4558c96b0ff42df31b..0fc3ea7cb83f313d9978e68d7ebf59de6c150fd8 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestVolumeATh.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestVolumeATh.mo
@@ -1,81 +1,80 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestVolumeATh
-
-  WaterSteam.Volumes.VolumeATh volumeATh(
-    h0=1.2e5,
-    V=1,
-    P0=300000,
-    P(start=300000))
-                   annotation (Placement(transformation(extent={{-15,21},{15,-9}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sink(
-    T0=320,
-    option_temperature=2,
-    h0=200000)
-    annotation (Placement(transformation(extent={{64,-4},{84,16}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1(Cvmax=80)
-    annotation (Placement(transformation(extent={{-47,-58},{-27,-38}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe(Finalvalue=
-        0, Initialvalue=1)           annotation (Placement(transformation(
-          extent={{-89,-38},{-73,-22}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2
-    annotation (Placement(transformation(extent={{28,2},{48,22}}, rotation=0)));
-  WaterSteam.BoundaryConditions.SourceQ sourceQ
-    annotation (Placement(transformation(extent={{-83,-6},{-59,18}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Constant
-                                     annotation (Placement(transformation(
-          extent={{10,18},{26,34}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
-      option_temperature=2)
-    annotation (Placement(transformation(extent={{-79,-64},{-59,-44}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
-     L=0.1, D=1)
-    annotation (Placement(transformation(extent={{-47,-4},{-27,16}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Table1DTemps(Table=[0,10;
-        5,-10; 8,0; 9,0]) annotation (Placement(transformation(extent={{-93,16},
-            {-73,36}}, rotation=0)));
-equation
-  connect(Rampe.y, controlValve1.Ouv)
-    annotation (Line(points={{-72.2,-30},{-37,-30},{-37,-37}}));
-  connect(Constant.y, controlValve2.Ouv)
-    annotation (Line(points={{26.8,26},{38,26},{38,23}}));
-  connect(volumeATh.Cs1, controlValve2.C1)
-    annotation (Line(points={{15,6},{28,6}}, color={0,0,255}));
-  connect(sourceP2.C, controlValve1.C1)
-    annotation (Line(points={{-59,-54},{-47,-54}}, color={0,0,255}));
-  connect(controlValve1.C2, volumeATh.Ce2)
-                                          annotation (Line(points={{-27,-54},{0,
-          -54},{0,-9}}, color={0,0,255}));
-  connect(sourceQ.C, lumpedStraightPipe1.C1)
-    annotation (Line(points={{-59,6},{-47,6}}, color={0,0,255}));
-  connect(lumpedStraightPipe1.C2, volumeATh.Ce1)
-    annotation (Line(points={{-27,6},{-15,6}}, color={0,0,255}));
-  connect(controlValve2.C2, sink.C)
-    annotation (Line(points={{48,6},{64,6}}, color={0,0,255}));
-  connect(Table1DTemps.y, sourceQ.IMassFlow)
-    annotation (Line(points={{-72,26},{-71,26},{-71,12}}));
-  annotation (experiment(StopTime=10), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestVolumeATh;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestVolumeATh
+  WaterSteam.Volumes.VolumeATh volumeATh(
+    h0=1.2e5,
+    V=1,
+    P0=300000,
+    P(start=300000))
+                   annotation (Placement(transformation(extent={{-15,21},{15,-9}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sink(
+    T0=320,
+    option_temperature=2,
+    h0=200000)
+    annotation (Placement(transformation(extent={{64,-4},{84,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1(Cvmax=80)
+    annotation (Placement(transformation(extent={{-47,-58},{-27,-38}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe(Finalvalue=
+        0, Initialvalue=1)           annotation (Placement(transformation(
+          extent={{-89,-38},{-73,-22}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2
+    annotation (Placement(transformation(extent={{28,2},{48,22}}, rotation=0)));
+  WaterSteam.BoundaryConditions.SourceQ sourceQ
+    annotation (Placement(transformation(extent={{-83,-6},{-59,18}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Constant
+                                     annotation (Placement(transformation(
+          extent={{10,18},{26,34}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP2(
+      option_temperature=2)
+    annotation (Placement(transformation(extent={{-79,-64},{-59,-44}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
+     L=0.1, D=1)
+    annotation (Placement(transformation(extent={{-47,-4},{-27,16}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Table1DTemps(Table=[0,10;
+        5,-10; 8,0; 9,0]) annotation (Placement(transformation(extent={{-93,16},
+            {-73,36}}, rotation=0)));
+equation
+  connect(Rampe.y, controlValve1.Ouv)
+    annotation (Line(points={{-72.2,-30},{-37,-30},{-37,-37}}));
+  connect(Constant.y, controlValve2.Ouv)
+    annotation (Line(points={{26.8,26},{38,26},{38,23}}));
+  connect(volumeATh.Cs1, controlValve2.C1)
+    annotation (Line(points={{15,6},{28,6}}, color={0,0,255}));
+  connect(sourceP2.C, controlValve1.C1)
+    annotation (Line(points={{-59,-54},{-47,-54}}, color={0,0,255}));
+  connect(controlValve1.C2, volumeATh.Ce2)
+                                          annotation (Line(points={{-27,-54},{0,
+          -54},{0,-9}}, color={0,0,255}));
+  connect(sourceQ.C, lumpedStraightPipe1.C1)
+    annotation (Line(points={{-59,6},{-47,6}}, color={0,0,255}));
+  connect(lumpedStraightPipe1.C2, volumeATh.Ce1)
+    annotation (Line(points={{-27,6},{-15,6}}, color={0,0,255}));
+  connect(controlValve2.C2, sink.C)
+    annotation (Line(points={{48,6},{64,6}}, color={0,0,255}));
+  connect(Table1DTemps.y, sourceQ.IMassFlow)
+    annotation (Line(points={{-72,26},{-71,26},{-71,12}}));
+  annotation (experiment(StopTime=10), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestVolumeATh;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestVolume_SteamCavitiesPipeValve.mo b/ThermoSysPro/Examples/SimpleExamples/TestVolume_SteamCavitiesPipeValve.mo
index a9b7f337c17b9a135eaea377ea57470710d71db9..a52034bc08e901f555a7682562162fde648f9b9f 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestVolume_SteamCavitiesPipeValve.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestVolume_SteamCavitiesPipeValve.mo
@@ -1,61 +1,60 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestVolume_SteamCavitiesPipeValve
-
-  WaterSteam.Volumes.VolumeA   volumeATh(
-    steady_state=false,
-    dynamic_mass_balance=true,
-    V=10,
-    P0=1000000,
-    h0=35e5,
-    P(start=1000000))
-                   annotation (Placement(transformation(extent={{-92,21},{-62,
-            -9}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2
-    annotation (Placement(transformation(extent={{16,2},{36,22}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Constant
-                                     annotation (Placement(transformation(
-          extent={{-2,18},{14,34}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(D=0.1)
-    annotation (Placement(transformation(extent={{-34,-4},{-14,16}}, rotation=0)));
-  WaterSteam.Volumes.VolumeA   volumeATh1(
-    V=10,
-    dynamic_mass_balance=true,
-    steady_state=false,
-    P0=500000,
-    h0=30e5,
-    P(start=500000))
-                   annotation (Placement(transformation(extent={{66,21},{96,-9}},
-          rotation=0)));
-equation
-  connect(Constant.y, controlValve2.Ouv)
-    annotation (Line(points={{14.8,26},{26,26},{26,23}}));
-  connect(volumeATh.Cs1, lumpedStraightPipe1.C1)
-    annotation (Line(points={{-62,6},{-34,6}}, color={0,0,255}));
-  connect(lumpedStraightPipe1.C2, controlValve2.C1)
-    annotation (Line(points={{-14,6},{16,6}}, color={0,0,255}));
-  connect(controlValve2.C2, volumeATh1.Ce1)
-    annotation (Line(points={{36,6},{66,6}}, color={0,0,255}));
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestVolume_SteamCavitiesPipeValve;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestVolume_SteamCavitiesPipeValve
+  WaterSteam.Volumes.VolumeA   volumeATh(
+    steady_state=false,
+    dynamic_mass_balance=true,
+    V=10,
+    P0=1000000,
+    h0=35e5,
+    P(start=1000000))
+                   annotation (Placement(transformation(extent={{-92,21},{-62,
+            -9}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2
+    annotation (Placement(transformation(extent={{16,2},{36,22}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Constant
+                                     annotation (Placement(transformation(
+          extent={{-2,18},{14,34}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(D=0.1)
+    annotation (Placement(transformation(extent={{-34,-4},{-14,16}}, rotation=0)));
+  WaterSteam.Volumes.VolumeA   volumeATh1(
+    V=10,
+    dynamic_mass_balance=true,
+    steady_state=false,
+    P0=500000,
+    h0=30e5,
+    P(start=500000))
+                   annotation (Placement(transformation(extent={{66,21},{96,-9}},
+          rotation=0)));
+equation
+  connect(Constant.y, controlValve2.Ouv)
+    annotation (Line(points={{14.8,26},{26,26},{26,23}}));
+  connect(volumeATh.Cs1, lumpedStraightPipe1.C1)
+    annotation (Line(points={{-62,6},{-34,6}}, color={0,0,255}));
+  connect(lumpedStraightPipe1.C2, controlValve2.C1)
+    annotation (Line(points={{-14,6},{16,6}}, color={0,0,255}));
+  connect(controlValve2.C2, volumeATh1.Ce1)
+    annotation (Line(points={{36,6},{66,6}}, color={0,0,255}));
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestVolume_SteamCavitiesPipeValve;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestVolumes.mo b/ThermoSysPro/Examples/SimpleExamples/TestVolumes.mo
index b925e50860d58d2033a364160706c9c0826a5286..92113fd24a5e3a7596dba22fe3aba8caa9c6fea9 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestVolumes.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestVolumes.mo
@@ -1,130 +1,129 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestVolumes
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(Q(start=
-          3279.049865590057))              annotation (Placement(transformation(
-          extent={{-104,0},{-84,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-                                            P0=2e5, Q(start=960.2804335809483))
-    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve1(Pm(start=200000.0),
-      Q(start=1358.2069351216844))
-    annotation (Placement(transformation(extent={{-10,66},{10,86}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(h(start=71016.12237154081))
-                                                      annotation (Placement(
-        transformation(extent={{-50,20},{-30,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
-                                         annotation (Placement(transformation(
-          extent={{20,60},{40,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA1(Cs2(Q(start=
-            960.3769597153802)), h(start=70921.02634059396))
-    annotation (Placement(transformation(extent={{-50,-60},{-30,-40}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve4(Pm(start=150000.0))
-    annotation (Placement(transformation(extent={{-10,-94},{10,-74}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1
-                                          annotation (Placement(transformation(
-          extent={{20,-100},{40,-80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-      Initialvalue=0.5)            annotation (Placement(transformation(extent=
-            {{-30,80},{-10,100}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
-      Initialvalue=0.5)             annotation (Placement(transformation(extent=
-           {{-30,-80},{-10,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve2(Pm(start=
-          250000.00130813642))
-    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve3
-    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB volumeB1(dynamic_mass_balance=true, h(start=
-          71016.12237174365))
-    annotation (Placement(transformation(
-        origin={30,-20},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve5
-    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
-                                          annotation (Placement(transformation(
-          extent={{82,-30},{102,-10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=1,
-    Initialvalue=1,
-    Finalvalue=0) annotation (Placement(transformation(extent={{32,20},{52,40}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(Initialvalue=1, Finalvalue=0)
-    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(Initialvalue=1, Finalvalue=0)
-    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe1(lambda=0)
-    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe2(lambda=0)
-    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
-           0)));
-equation
-  connect(valve4.C2, puitsP1.C)         annotation (Line(points={{10,-90},{20,
-          -90}}, color={0,0,255}));
-  connect(rampe.y, valve1.Ouv)        annotation (Line(points={{-9,90},{0,90},{
-          0,87}}));
-  connect(rampe1.y, valve4.Ouv)
-    annotation (Line(points={{-9,-70},{0,-70},{0,-73}}));
-  connect(volumeA1.Cs2, valve4.C1)         annotation (Line(points={{-40,-60},{
-          -40,-90},{-10,-90}}, color={0,0,255}));
-  connect(volumeA1.Cs1, valve3.C1)         annotation (Line(points={{-30,-50},{
-          -10,-50}}, color={0,0,255}));
-  connect(valve5.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
-          -20}}, color={0,0,255}));
-  connect(rampe2.y, valve5.Ouv)
-    annotation (Line(points={{53,30},{60,30},{60,-3}}));
-  connect(rampe3.y, valve2.Ouv)         annotation (Line(points={{-9,40},{0,40},
-          {0,27}}));
-  connect(rampe4.y, valve3.Ouv)         annotation (Line(points={{-9,-20},{0,
-          -20},{0,-33}}));
-  connect(sourceP.C, pipe1.C1)
-    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
-  connect(pipe1.C2, volumeA.Ce1)
-    annotation (Line(points={{-60,10},{-50,10}}, color={0,0,255}));
-  connect(sourceP1.C, pipe2.C1)
-    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
-  connect(pipe2.C2, volumeA1.Ce1)    annotation (Line(points={{-60,-50},{-50,
-          -50}}, color={0,0,255}));
-  connect(volumeA.Cs2, valve1.C1)        annotation (Line(points={{-40,20},{-40,
-          70},{-10,70}}, color={0,0,255}));
-  connect(volumeA.Cs1, valve2.C1)
-    annotation (Line(points={{-30,10},{-10,10}}, color={0,0,255}));
-  connect(valve2.C2, volumeB1.Ce2)         annotation (Line(points={{10,10},{30,
-          10},{30,-10}}, color={0,0,255}));
-  connect(valve3.C2, volumeB1.Ce1)         annotation (Line(points={{10,-50},{
-          30,-50},{30,-30}}, color={0,0,255}));
-  connect(volumeB1.Cs2, valve5.C1)
-    annotation (Line(points={{39.8,-20},{50,-20}}, color={0,0,255}));
-  connect(valve1.C2, puitsP.C)        annotation (Line(points={{10,70},{20,70}},
-        color={0,0,255}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestVolumes;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestVolumes
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(Q(start=
+          3279.049865590057))              annotation (Placement(transformation(
+          extent={{-104,0},{-84,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+                                            P0=2e5, Q(start=960.2804335809483))
+    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve1(Pm(start=200000.0),
+      Q(start=1358.2069351216844))
+    annotation (Placement(transformation(extent={{-10,66},{10,86}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(h(start=71016.12237154081))
+                                                      annotation (Placement(
+        transformation(extent={{-50,20},{-30,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
+                                         annotation (Placement(transformation(
+          extent={{20,60},{40,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA1(Cs2(Q(start=
+            960.3769597153802)), h(start=70921.02634059396))
+    annotation (Placement(transformation(extent={{-50,-60},{-30,-40}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve4(Pm(start=150000.0))
+    annotation (Placement(transformation(extent={{-10,-94},{10,-74}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1
+                                          annotation (Placement(transformation(
+          extent={{20,-100},{40,-80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+      Initialvalue=0.5)            annotation (Placement(transformation(extent=
+            {{-30,80},{-10,100}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
+      Initialvalue=0.5)             annotation (Placement(transformation(extent=
+           {{-30,-80},{-10,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve2(Pm(start=
+          250000.00130813642))
+    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve3
+    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB volumeB1(dynamic_mass_balance=true, h(start=
+          71016.12237174365))
+    annotation (Placement(transformation(
+        origin={30,-20},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve5
+    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
+                                          annotation (Placement(transformation(
+          extent={{82,-30},{102,-10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=1,
+    Initialvalue=1,
+    Finalvalue=0) annotation (Placement(transformation(extent={{32,20},{52,40}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(Initialvalue=1, Finalvalue=0)
+    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(Initialvalue=1, Finalvalue=0)
+    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe1(lambda=0)
+    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe2(lambda=0)
+    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
+           0)));
+equation
+  connect(valve4.C2, puitsP1.C)         annotation (Line(points={{10,-90},{20,
+          -90}}, color={0,0,255}));
+  connect(rampe.y, valve1.Ouv)        annotation (Line(points={{-9,90},{0,90},{
+          0,87}}));
+  connect(rampe1.y, valve4.Ouv)
+    annotation (Line(points={{-9,-70},{0,-70},{0,-73}}));
+  connect(volumeA1.Cs2, valve4.C1)         annotation (Line(points={{-40,-60},{
+          -40,-90},{-10,-90}}, color={0,0,255}));
+  connect(volumeA1.Cs1, valve3.C1)         annotation (Line(points={{-30,-50},{
+          -10,-50}}, color={0,0,255}));
+  connect(valve5.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
+          -20}}, color={0,0,255}));
+  connect(rampe2.y, valve5.Ouv)
+    annotation (Line(points={{53,30},{60,30},{60,-3}}));
+  connect(rampe3.y, valve2.Ouv)         annotation (Line(points={{-9,40},{0,40},
+          {0,27}}));
+  connect(rampe4.y, valve3.Ouv)         annotation (Line(points={{-9,-20},{0,
+          -20},{0,-33}}));
+  connect(sourceP.C, pipe1.C1)
+    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
+  connect(pipe1.C2, volumeA.Ce1)
+    annotation (Line(points={{-60,10},{-50,10}}, color={0,0,255}));
+  connect(sourceP1.C, pipe2.C1)
+    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
+  connect(pipe2.C2, volumeA1.Ce1)    annotation (Line(points={{-60,-50},{-50,
+          -50}}, color={0,0,255}));
+  connect(volumeA.Cs2, valve1.C1)        annotation (Line(points={{-40,20},{-40,
+          70},{-10,70}}, color={0,0,255}));
+  connect(volumeA.Cs1, valve2.C1)
+    annotation (Line(points={{-30,10},{-10,10}}, color={0,0,255}));
+  connect(valve2.C2, volumeB1.Ce2)         annotation (Line(points={{10,10},{30,
+          10},{30,-10}}, color={0,0,255}));
+  connect(valve3.C2, volumeB1.Ce1)         annotation (Line(points={{10,-50},{
+          30,-50},{30,-30}}, color={0,0,255}));
+  connect(volumeB1.Cs2, valve5.C1)
+    annotation (Line(points={{39.8,-20},{50,-20}}, color={0,0,255}));
+  connect(valve1.C2, puitsP.C)        annotation (Line(points={{10,70},{20,70}},
+        color={0,0,255}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestVolumes;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestVolumes1.mo b/ThermoSysPro/Examples/SimpleExamples/TestVolumes1.mo
index 425e43f631843832bdcd7d166319b477ca760e73..f888a5867ee0e665053eb1e3006a029882eca055 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestVolumes1.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestVolumes1.mo
@@ -1,143 +1,142 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestVolumes1
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(Q(start=
-          3279.049865589647))              annotation (Placement(transformation(
-          extent={{-104,0},{-84,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
-                                            P0=2e5, Q(start=960.280432146387))
-    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve1(Q(start=
-          1358.2069351216692))
-    annotation (Placement(transformation(extent={{-10,66},{10,86}}, rotation=0)));
-  WaterSteam.Volumes.VolumeD volumeD(h(start=71016.12237181232))
-                                                      annotation (Placement(
-        transformation(extent={{-50,20},{-30,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
-                                         annotation (Placement(transformation(
-          extent={{20,60},{40,80}}, rotation=0)));
-  WaterSteam.Volumes.VolumeD volumeD1(h(start=70921.02634064404))
-    annotation (Placement(transformation(extent={{-50,-60},{-30,-40}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve4
-    annotation (Placement(transformation(extent={{-10,-94},{10,-74}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1
-                                          annotation (Placement(transformation(
-          extent={{20,-100},{40,-80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-      Initialvalue=0.5)            annotation (Placement(transformation(extent=
-            {{-30,80},{-10,100}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
-      Initialvalue=0.5)             annotation (Placement(transformation(extent=
-           {{-30,-80},{-10,-60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve2(Pm(start=
-          250000.00130815586))
-    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve3(Pm(start=
-          200000.00130815586))
-    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
-            0)));
-  WaterSteam.Volumes.VolumeC volumeB1(             dynamic_mass_balance=true,
-    Cs(Q(start=1920.746402632812)),
-    h(start=71016.12237180043))
-    annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve5(Pm(start=
-          150000.00130815586))
-    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
-                                          annotation (Placement(transformation(
-          extent={{82,-30},{102,-10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=1,
-    Initialvalue=1,
-    Finalvalue=0) annotation (Placement(transformation(extent={{32,20},{52,40}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(Initialvalue=1, Finalvalue=0)
-    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(Initialvalue=1, Finalvalue=0)
-    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe1(lambda=0)
-    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe2(lambda=0)
-    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
-           0)));
-equation
-  connect(valve4.C2, puitsP1.C)         annotation (Line(points={{10,-90},{20,
-          -90}}, color={0,0,255}));
-  connect(rampe.y, valve1.Ouv)        annotation (Line(points={{-9,90},{0,90},{
-          0,87}}));
-  connect(rampe1.y, valve4.Ouv)
-    annotation (Line(points={{-9,-70},{0,-70},{0,-73}}));
-  connect(volumeD1.Cs2, valve4.C1)         annotation (Line(points={{-40,-59.8},
-          {-40,-90},{-10,-90}}, color={0,0,255}));
-  connect(valve5.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
-          -20}}, color={0,0,255}));
-  connect(rampe2.y, valve5.Ouv)
-    annotation (Line(points={{53,30},{60,30},{60,-3}}));
-  connect(rampe3.y, valve2.Ouv)         annotation (Line(points={{-9,40},{0,40},
-          {0,27}}));
-  connect(rampe4.y, valve3.Ouv)         annotation (Line(points={{-9,-20},{0,
-          -20},{0,-33}}));
-  connect(sourceP.C, pipe1.C1)
-    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
-  connect(sourceP1.C, pipe2.C1)
-    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
-  connect(volumeD.Cs2, valve1.C1)        annotation (Line(points={{-40,19.8},{
-          -40,70},{-10,70}}, color={0,0,255}));
-  connect(valve1.C2, puitsP.C)        annotation (Line(points={{10,70},{20,70}},
-        color={0,0,255}));
-  connect(volumeD.Cs3, valve2.C1) annotation (Line(
-      points={{-30,10},{-10,10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(pipe1.C2, volumeD.Ce) annotation (Line(
-      points={{-60,10},{-50,10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(volumeD1.Cs3, valve3.C1) annotation (Line(
-      points={{-30,-50},{-10,-50}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(pipe2.C2, volumeD1.Ce) annotation (Line(
-      points={{-60,-50},{-50,-50}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(valve2.C2, volumeB1.Ce2) annotation (Line(
-      points={{10,10},{30,10},{30,-11}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(volumeB1.Cs, valve5.C1) annotation (Line(
-      points={{40,-20},{50,-20}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(valve3.C2, volumeB1.Ce3) annotation (Line(
-      points={{10,-50},{30,-50},{30,-30}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestVolumes1;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestVolumes1
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(Q(start=
+          3279.049865589647))              annotation (Placement(transformation(
+          extent={{-104,0},{-84,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(
+                                            P0=2e5, Q(start=960.280432146387))
+    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve1(Q(start=
+          1358.2069351216692))
+    annotation (Placement(transformation(extent={{-10,66},{10,86}}, rotation=0)));
+  WaterSteam.Volumes.VolumeD volumeD(h(start=71016.12237181232))
+                                                      annotation (Placement(
+        transformation(extent={{-50,20},{-30,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP
+                                         annotation (Placement(transformation(
+          extent={{20,60},{40,80}}, rotation=0)));
+  WaterSteam.Volumes.VolumeD volumeD1(h(start=70921.02634064404))
+    annotation (Placement(transformation(extent={{-50,-60},{-30,-40}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve4
+    annotation (Placement(transformation(extent={{-10,-94},{10,-74}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP1
+                                          annotation (Placement(transformation(
+          extent={{20,-100},{40,-80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+      Initialvalue=0.5)            annotation (Placement(transformation(extent=
+            {{-30,80},{-10,100}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
+      Initialvalue=0.5)             annotation (Placement(transformation(extent=
+           {{-30,-80},{-10,-60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve2(Pm(start=
+          250000.00130815586))
+    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve3(Pm(start=
+          200000.00130815586))
+    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
+            0)));
+  WaterSteam.Volumes.VolumeC volumeB1(             dynamic_mass_balance=true,
+    Cs(Q(start=1920.746402632812)),
+    h(start=71016.12237180043))
+    annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve valve5(Pm(start=
+          150000.00130815586))
+    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP2
+                                          annotation (Placement(transformation(
+          extent={{82,-30},{102,-10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=1,
+    Initialvalue=1,
+    Finalvalue=0) annotation (Placement(transformation(extent={{32,20},{52,40}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(Initialvalue=1, Finalvalue=0)
+    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(Initialvalue=1, Finalvalue=0)
+    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe1(lambda=0)
+    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe pipe2(lambda=0)
+    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
+           0)));
+equation
+  connect(valve4.C2, puitsP1.C)         annotation (Line(points={{10,-90},{20,
+          -90}}, color={0,0,255}));
+  connect(rampe.y, valve1.Ouv)        annotation (Line(points={{-9,90},{0,90},{
+          0,87}}));
+  connect(rampe1.y, valve4.Ouv)
+    annotation (Line(points={{-9,-70},{0,-70},{0,-73}}));
+  connect(volumeD1.Cs2, valve4.C1)         annotation (Line(points={{-40,-59.8},
+          {-40,-90},{-10,-90}}, color={0,0,255}));
+  connect(valve5.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
+          -20}}, color={0,0,255}));
+  connect(rampe2.y, valve5.Ouv)
+    annotation (Line(points={{53,30},{60,30},{60,-3}}));
+  connect(rampe3.y, valve2.Ouv)         annotation (Line(points={{-9,40},{0,40},
+          {0,27}}));
+  connect(rampe4.y, valve3.Ouv)         annotation (Line(points={{-9,-20},{0,
+          -20},{0,-33}}));
+  connect(sourceP.C, pipe1.C1)
+    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
+  connect(sourceP1.C, pipe2.C1)
+    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
+  connect(volumeD.Cs2, valve1.C1)        annotation (Line(points={{-40,19.8},{
+          -40,70},{-10,70}}, color={0,0,255}));
+  connect(valve1.C2, puitsP.C)        annotation (Line(points={{10,70},{20,70}},
+        color={0,0,255}));
+  connect(volumeD.Cs3, valve2.C1) annotation (Line(
+      points={{-30,10},{-10,10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(pipe1.C2, volumeD.Ce) annotation (Line(
+      points={{-60,10},{-50,10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(volumeD1.Cs3, valve3.C1) annotation (Line(
+      points={{-30,-50},{-10,-50}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(pipe2.C2, volumeD1.Ce) annotation (Line(
+      points={{-60,-50},{-50,-50}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(valve2.C2, volumeB1.Ce2) annotation (Line(
+      points={{10,10},{30,10},{30,-11}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(volumeB1.Cs, valve5.C1) annotation (Line(
+      points={{40,-20},{50,-20}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(valve3.C2, volumeB1.Ce3) annotation (Line(
+      points={{10,-50},{30,-50},{30,-30}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestVolumes1;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestVolumes2.mo b/ThermoSysPro/Examples/SimpleExamples/TestVolumes2.mo
index d8e578e0e3ebe901796c9862404e92d450c34d4c..03d815ff3fdad2e1b329057a55ec24a6511d9239 100644
--- a/ThermoSysPro/Examples/SimpleExamples/TestVolumes2.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/TestVolumes2.mo
@@ -1,137 +1,136 @@
-within ThermoSysPro.Examples.SimpleExamples;
-model TestVolumes2
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-98,40},{-78,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(Q(start=-3.0336524914069486E-68))
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-      h(start=70990))
-    annotation (Placement(transformation(extent={{-70,40},{-50,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
-     Pm(start=3e5), h(start=71016),
-    C2(h_vol(start=71028.65153712753)))
-    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve(Q(start=0.0),  h(start=
-         70897),
-    Pm(start=200000.0))
-    annotation (Placement(transformation(
-        origin={-46,-10},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1(Pm(start=
-          2e5),
-    C1(h_vol(start=71016), h(start=71016)),
-    h(start=71016))
-    annotation (Placement(transformation(
-        origin={-46,-70},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2(Q(start=-1.4149498560666738E-73),
-                 Pm(start=2e5),
-    h(start=70990),
-    C2(h_vol(start=71029.67205985432),
-                           h(start=70990)))
-    annotation (Placement(transformation(extent={{-20,16},{0,36}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve3(Pm(start=
-          1e5),
-    h(start=70990),
-    C2(h_vol(start=71029.67205985427),
-                           h(start=70990)))
-    annotation (Placement(transformation(extent={{20,16},{40,36}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve4(h(start=
-          70826))
-    annotation (Placement(transformation(extent={{0,-44},{20,-24}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(
-     Pm(start=100000.0))
-    annotation (Placement(transformation(extent={{50,10},{70,30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{80,10},{100,30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V4(Starttime=4, Duration=
-       2)         annotation (Placement(transformation(extent={{-40,60},{-20,80}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V5(Initialvalue=1)
-    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V3(
-    Initialvalue=1,
-    Finalvalue=0,
-    Starttime=4,
-    Duration=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V1
-    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V2
-    annotation (Placement(transformation(extent={{-100,-80},{-80,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(         P(start=3e5),
-    h(start=71029.6720598543),
-    V=1e-3)
-    annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(         h(start=
-          71028.65153712753),                                              V=1e-3)
-    annotation (Placement(transformation(extent={{-50,-30},{-30,-50}}, rotation=
-           0)));
-equation
-  connect(sourceP.C, lumpedStraightPipe.C1)
-    annotation (Line(points={{-78,50},{-70,50}}, color={0,0,255}));
-  connect(sourceP1.C, lumpedStraightPipe1.C1)
-    annotation (Line(points={{-80,-90},{-70,-90}}, color={0,0,255}));
-  connect(lumpedStraightPipe1.C2, controlValve1.C1) annotation (Line(points={{
-          -50,-90},{-40,-90},{-40,-80}}, color={0,0,255}));
-  connect(controlValve4.C2, sinkP.C)
-    annotation (Line(points={{20,-40},{40,-40}}, color={0,0,255}));
-  connect(controlValve2.C2, controlValve3.C1)
-    annotation (Line(points={{0,20},{20,20}}, color={0,0,255}));
-  connect(controlValve3.C2, lumpedStraightPipe2.C1)
-    annotation (Line(points={{40,20},{50,20}}, color={0,0,255}));
-  connect(lumpedStraightPipe2.C2, sinkP1.C)
-    annotation (Line(points={{70,20},{80,20}}, color={0,0,255}));
-  connect(V4.y, controlValve2.Ouv) annotation (Line(points={{-19,70},{-10,70},{
-          -10,37}}));
-  connect(V5.y, controlValve3.Ouv) annotation (Line(points={{21,70},{30,70},{30,
-          37}}));
-  connect(V3.y, controlValve4.Ouv) annotation (Line(points={{1,-10},{10,-10},{
-          10,-23}}));
-  connect(V1.y, controlValve.Ouv) annotation (Line(points={{-79,-10},{-57,-10}}));
-  connect(V2.y, controlValve1.Ouv) annotation (Line(points={{-79,-70},{-57,-70}}));
-  connect(volumeC.Cs, controlValve2.C1)
-    annotation (Line(points={{-30,20},{-20,20}}, color={0,0,255}));
-  connect(lumpedStraightPipe.C2, volumeC.Ce2) annotation (Line(points={{-50,50},
-          {-40,50},{-40,29}}, color={0,0,255}));
-  connect(volumeC.Ce3, controlValve.C2) annotation (Line(points={{-40,10},{-40,
-          0}}));
-  connect(controlValve.C1, volumeA.Cs2) annotation (Line(points={{-40,-20},{-40,
-          -30}}));
-  connect(volumeA.Cs1, controlValve4.C1)
-    annotation (Line(points={{-30,-40},{0,-40}}, color={0,0,255}));
-  connect(volumeA.Ce2, controlValve1.C2)
-    annotation (Line(points={{-40,-49.8},{-40,-60}}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </h4>
-</html>"));
-end TestVolumes2;
+within ThermoSysPro.Examples.SimpleExamples;
+model TestVolumes2
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-98,40},{-78,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1(Q(start=-3.0336524914069486E-68))
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+      h(start=70990))
+    annotation (Placement(transformation(extent={{-70,40},{-50,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
+     Pm(start=3e5), h(start=71016),
+    C2(h_vol(start=71028.65153712753)))
+    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve(Q(start=0.0),  h(start=
+         70897),
+    Pm(start=200000.0))
+    annotation (Placement(transformation(
+        origin={-46,-10},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1(Pm(start=
+          2e5),
+    C1(h_vol(start=71016), h(start=71016)),
+    h(start=71016))
+    annotation (Placement(transformation(
+        origin={-46,-70},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2(Q(start=-1.4149498560666738E-73),
+                 Pm(start=2e5),
+    h(start=70990),
+    C2(h_vol(start=71029.67205985432),
+                           h(start=70990)))
+    annotation (Placement(transformation(extent={{-20,16},{0,36}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve3(Pm(start=
+          1e5),
+    h(start=70990),
+    C2(h_vol(start=71029.67205985427),
+                           h(start=70990)))
+    annotation (Placement(transformation(extent={{20,16},{40,36}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve4(h(start=
+          70826))
+    annotation (Placement(transformation(extent={{0,-44},{20,-24}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(
+     Pm(start=100000.0))
+    annotation (Placement(transformation(extent={{50,10},{70,30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{80,10},{100,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V4(Starttime=4, Duration=
+       2)         annotation (Placement(transformation(extent={{-40,60},{-20,80}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V5(Initialvalue=1)
+    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V3(
+    Initialvalue=1,
+    Finalvalue=0,
+    Starttime=4,
+    Duration=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V1
+    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V2
+    annotation (Placement(transformation(extent={{-100,-80},{-80,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(         P(start=3e5),
+    h(start=71029.6720598543),
+    V=1e-3)
+    annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(         h(start=
+          71028.65153712753),                                              V=1e-3)
+    annotation (Placement(transformation(extent={{-50,-30},{-30,-50}}, rotation=
+           0)));
+equation
+  connect(sourceP.C, lumpedStraightPipe.C1)
+    annotation (Line(points={{-78,50},{-70,50}}, color={0,0,255}));
+  connect(sourceP1.C, lumpedStraightPipe1.C1)
+    annotation (Line(points={{-80,-90},{-70,-90}}, color={0,0,255}));
+  connect(lumpedStraightPipe1.C2, controlValve1.C1) annotation (Line(points={{
+          -50,-90},{-40,-90},{-40,-80}}, color={0,0,255}));
+  connect(controlValve4.C2, sinkP.C)
+    annotation (Line(points={{20,-40},{40,-40}}, color={0,0,255}));
+  connect(controlValve2.C2, controlValve3.C1)
+    annotation (Line(points={{0,20},{20,20}}, color={0,0,255}));
+  connect(controlValve3.C2, lumpedStraightPipe2.C1)
+    annotation (Line(points={{40,20},{50,20}}, color={0,0,255}));
+  connect(lumpedStraightPipe2.C2, sinkP1.C)
+    annotation (Line(points={{70,20},{80,20}}, color={0,0,255}));
+  connect(V4.y, controlValve2.Ouv) annotation (Line(points={{-19,70},{-10,70},{
+          -10,37}}));
+  connect(V5.y, controlValve3.Ouv) annotation (Line(points={{21,70},{30,70},{30,
+          37}}));
+  connect(V3.y, controlValve4.Ouv) annotation (Line(points={{1,-10},{10,-10},{
+          10,-23}}));
+  connect(V1.y, controlValve.Ouv) annotation (Line(points={{-79,-10},{-57,-10}}));
+  connect(V2.y, controlValve1.Ouv) annotation (Line(points={{-79,-70},{-57,-70}}));
+  connect(volumeC.Cs, controlValve2.C1)
+    annotation (Line(points={{-30,20},{-20,20}}, color={0,0,255}));
+  connect(lumpedStraightPipe.C2, volumeC.Ce2) annotation (Line(points={{-50,50},
+          {-40,50},{-40,29}}, color={0,0,255}));
+  connect(volumeC.Ce3, controlValve.C2) annotation (Line(points={{-40,10},{-40,
+          0}}));
+  connect(controlValve.C1, volumeA.Cs2) annotation (Line(points={{-40,-20},{-40,
+          -30}}));
+  connect(volumeA.Cs1, controlValve4.C1)
+    annotation (Line(points={{-30,-40},{0,-40}}, color={0,0,255}));
+  connect(volumeA.Ce2, controlValve1.C2)
+    annotation (Line(points={{-40,-49.8},{-40,-60}}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </h4>
+</html>"));
+end TestVolumes2;
diff --git a/ThermoSysPro/Examples/SimpleExamples/TestWirelessSensor.mo b/ThermoSysPro/Examples/SimpleExamples/TestWirelessSensor.mo
new file mode 100644
index 0000000000000000000000000000000000000000..ebc84a19633634481c9f4de3437233ace1421aeb
--- /dev/null
+++ b/ThermoSysPro/Examples/SimpleExamples/TestWirelessSensor.mo
@@ -0,0 +1,65 @@
+within ThermoSysPro.Examples.SimpleExamples;
+model TestWirelessSensor
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PerteDP1
+    annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve VanneReglante1(Cvmax=1000)
+    annotation (Placement(transformation(extent={{-50,2},{-30,22}},  rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP SourceP1(P0=120000)
+                                            annotation (Placement(
+        transformation(extent={{-88,-4},{-68,16}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-50},{90,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.Tank Tank1(z(fixed=false, start=5))
+    annotation (Placement(transformation(extent={{-10,-8},{10,12}},
+                                                                  rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe annotation (
+     Placement(transformation(extent={{-90,30},{-70,50}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.WirelessSensor wirelessSensor_ramp(
+    m=PerteDP1.C1.Q,
+    min_range=0,
+    max_range=1000,
+    significantDigits=5)
+    annotation (Placement(transformation(extent={{-14,64},{22,94}})));
+  InstrumentationAndControl.Blocks.Sources.WirelessSensor wirelessSensor_tank(
+    m=Tank1.yLevel.signal,
+    ValidityRange=true,
+    min_range=Tank1.zs2,
+    max_range=40,
+    m_nominal=5)
+    annotation (Placement(transformation(origin = {2, -2}, extent = {{-16, 32}, {20, 62}})));
+equation
+  connect(PerteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255}));
+  connect(SourceP1.C, VanneReglante1.C1)
+    annotation (Line(points={{-68,6},{-50,6}},   color={0,0,255}));
+  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{10,-4},{20,-4},{20,
+          -40},{30,-40}}, color={0,0,255}));
+  connect(Rampe.y, VanneReglante1.Ouv)
+    annotation (Line(points={{-69,40},{-40,40},{-40,23}}));
+  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-10,6},
+          {-10,8}},               color={0,0,255}));
+  annotation (experiment(StopTime=400, __Dymola_Algorithm="Dassl"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 4.0 </h4>
+</html>"));
+end TestWirelessSensor;
\ No newline at end of file
diff --git a/ThermoSysPro/Examples/SimpleExamples/package.mo b/ThermoSysPro/Examples/SimpleExamples/package.mo
index c7c7223e7cbb291151adda41a12437b658066f67..0c78018e890654c9a565968093d6f71ce20c6250 100644
--- a/ThermoSysPro/Examples/SimpleExamples/package.mo
+++ b/ThermoSysPro/Examples/SimpleExamples/package.mo
@@ -1,141 +1,138 @@
-within ThermoSysPro.Examples;
-package SimpleExamples
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This package contains simple examples for testing ThermoSysPro component models.</h4>
-</html>"));
-end SimpleExamples;
+within ThermoSysPro.Examples;
+package SimpleExamples
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This package contains simple examples for testing ThermoSysPro component models.</h4>
+</html>"));
+end SimpleExamples;
diff --git a/ThermoSysPro/Examples/SimpleExamples/package.order b/ThermoSysPro/Examples/SimpleExamples/package.order
index 78cf064d83b446e8f347c2febf842e27c9c0e701..8bd430faf6e0c67c5f75c9010394200b7ecc3be6 100644
--- a/ThermoSysPro/Examples/SimpleExamples/package.order
+++ b/ThermoSysPro/Examples/SimpleExamples/package.order
@@ -1,103 +1,111 @@
-TestAirHumidity
-TestAlternatingEngine
-TestBend
-TestCentrifugalPump
-TestCentrifugalPump1
-TestCentrifugalPump2
-TestCentrifugalPump3
-TestCentrifugalPump4
-TestCentrifugalPump5
-TestCentrifugalPump6
-TestCentrifugalPump7
-TestCentrifugalPump8
-TestCentrifugalPump9
-TestCentrifugalPump10
-TestCentrifugalPump11
-TestCentrifugalPump12
-TestCentrifugalPump13
-TestCentrifugalPumpWaterSolution
-TestCheckValve
-TestCompressor
-TestControlValve
-TestDiaphragm
-TestDynamicCentrifugalPump
-TestDynamicCentrifugalPump1
-TestDynamicCentrifugalPump2
-TestDynamicCheckValve
-TestDynamicDrum
-TestDynamicDrum1
-TestDynamicDrum2
-TestDynamicDrum3
-TestDynamicDrum_CC
-TestDynamicExchangerWaterSteamFlueGases
-TestDynamicOnePhaseFlowPipe
-TestDynamicOnePhaseFlowPipeShell
-TestDynamicReliefValve
-TestDynamicTwoPhaseFlowPipe
-TestDynamicWaterHeating
-TestDynamicWaterHeating_Islanding
-TestDynamicWaterHeating_Qwater_negative
-TestDynamicWaterHeating_Qwater_zero
-TestDynamicWaterWaterExchanger
-TestFan
-TestFan_Pin
-TestFan_Qin
-TestFlueGasesJunctions
-TestFlueGasesVolumes
-TestFlueGasesVolumes1
-TestFossilFuelBoiler
-TestFresnelField
-TestGenericCombustion1D
-TestIdealCheckValve
-TestIdealSwitchValve
-TestInvSingularPressureLoss
-TestJunctions1
-TestJunctions2
-TestJunctions3
-TestJunctions4
-TestJunctions5
-TestLoopBreaker
-TestLumpedStraightPipe
-TestMassFlowMultiplier
-TestNTUWaterHeating0
-TestNTUWaterHeating1
-TestNTUWaterHeating2
-TestPipePressureLoss
-TestPressurizer
-TestPressurizer1
-TestPressurizer2
-TestPressurizer_CC
-TestRefP
-TestSensors
-TestSimpleEvaporatorWaterSteamFlueGases
-TestSimpleStaticCondenser
-TestSingularPressureLoss
-TestStaticCentrifugalPump
-TestStaticCentrifugalPump1
-TestStaticCentrifugalPump2
-TestStaticCentrifugalPumpWaterSolution
-TestStaticCondenser
-TestStaticDrum1
-TestStaticDrum2
-TestStaticDrum3
-TestStaticExchangerWaterSteamFlueGases
-TestStaticWaterWaterExchanger
-TestStaticWaterWaterExchangerDTorWorEff
-TestSteamDryer1
-TestSteamDryer2
-TestSteamEngine
-TestSteamExtractionSplitter
-TestSteamGenerator_1SG
-TestSteamGenerator_4SG
-TestStodolaTurbine
-TestStodolaTurbine1
-TestStodolaTurbine2
-TestStodolaTurbine3
-TestSwitchValve
-TestTank
-TestThreeWayValve
-TestVolumes
-TestVolumes1
-TestVolumes2
-TestVolumeATh
-TestVolume_SteamCavitiesPipeValve
+TestAirHumidity
+TestAlternatingEngine
+TestBend
+TestCentrifugalPump
+TestCentrifugalPump1
+TestCentrifugalPump2
+TestCentrifugalPump3
+TestCentrifugalPump4
+TestCentrifugalPump5
+TestCentrifugalPump6
+TestCentrifugalPump7
+TestCentrifugalPump8
+TestCentrifugalPump9
+TestCentrifugalPump10
+TestCentrifugalPump11
+TestCentrifugalPump12
+TestCentrifugalPump13
+TestCentrifugalPumpWaterSolution
+TestCheckValve
+TestCompressor
+TestControlValve
+TestDiaphragm
+TestDynamicCentrifugalPump
+TestDynamicCentrifugalPump1
+TestDynamicCentrifugalPump2
+TestDynamicCheckValve
+TestDynamicDrum
+TestDynamicDrum1
+TestDynamicDrum2
+TestDynamicDrum3
+TestDynamicDrum_CC
+TestDynamicExchangerWaterSteamFlueGases
+TestDynamicOnePhaseFlowPipe
+TestDynamicOnePhaseFlowPipeShell
+TestDynamicReliefValve
+TestDynamicTwoPhaseFlowPipe
+TestDynamicWaterHeating
+TestDynamicWaterHeating_Islanding
+TestDynamicWaterHeating_Qwater_negative
+TestDynamicWaterHeating_Qwater_zero
+TestDynamicWaterWaterExchanger
+TestFan
+TestFan_Pin
+TestFan_Qin
+TestFlueGasesJunctions
+TestFlueGasesVolumes
+TestFlueGasesVolumes1
+TestFossilFuelBoiler
+TestFresnelField
+TestGenericCombustion1D
+TestIdealCheckValve
+TestIdealSwitchValve
+TestInvSingularPressureLoss
+TestJunctions1
+TestJunctions2
+TestJunctions3
+TestJunctions4
+TestJunctions5
+TestLoopBreaker
+TestLumpedStraightPipe
+TestMassFlowMultiplier
+TestNTUWaterHeating0
+TestNTUWaterHeating1
+TestNTUWaterHeating2
+TestPipePressureLoss
+TestPressurizer
+TestPressurizer1
+TestPressurizer2
+TestPressurizer_CC
+TestRefP
+TestSensors
+TestSimpleEvaporatorWaterSteamFlueGases
+TestSimpleStaticCondenser
+TestSingularPressureLoss
+TestStaticCentrifugalPump
+TestStaticCentrifugalPump1
+TestStaticCentrifugalPump2
+TestStaticCentrifugalPumpWaterSolution
+TestStaticCondenser
+TestStaticDrum1
+TestStaticDrum2
+TestStaticDrum3
+TestStaticExchangerWaterSteamFlueGases
+TestStaticWaterWaterExchanger
+TestStaticWaterWaterExchangerDTorWorEff
+TestSteamDryer1
+TestSteamDryer2
+TestSteamEngine
+TestSteamExtractionSplitter
+TestSteamGenerator_1SG
+TestSteamGenerator_4SG
+TestStodolaTurbine
+TestStodolaTurbine1
+TestStodolaTurbine2
+TestStodolaTurbine3
+TestSwitchValve
+TestTank
+TestThreeWayValve
+TestVolumes
+TestVolumes1
+TestVolumes2
+TestVolumeATh
+TestVolume_SteamCavitiesPipeValve
+TestHysteresis
+TestWirelessSensor
+TestSteamGenerator_1SG_withOpenPurge
+TestSteamGenerator_1SG_withClosedPurge
+TestSteamGenerator_1SG_withClosedPurge2
+TestSteamGenerator_1SG_withClosedPurge3
+TestSteamGenerator_1SG_withClosedPurge4
+TestSteamGenerator_1SG_withClosedPurge5
diff --git a/ThermoSysPro/Examples/package.mo b/ThermoSysPro/Examples/package.mo
index 489ffa26f8cbacf693c6f3db2ccb76397d18a3ae..45fee0147271482e5eb83d83428b003a7676b072 100644
--- a/ThermoSysPro/Examples/package.mo
+++ b/ThermoSysPro/Examples/package.mo
@@ -1,141 +1,141 @@
-within ThermoSysPro;
-package Examples
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019 </p>
-<p><b>ThermoSysPro Version 3.2 </p>
-<p>This package contains examples for the ThermoSysPro library.</h4>
-</html>"));
-end Examples;
+within ThermoSysPro;
+package Examples
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019 </p>
+<p><b>ThermoSysPro Version 3.2 </p>
+<p>This package contains examples for the ThermoSysPro library.</h4>
+</html>"));
+end Examples;
diff --git a/ThermoSysPro/Examples/package.order b/ThermoSysPro/Examples/package.order
index 677ba0965f846c6798994522aca9d2145c41fd01..bef4659248e4c935a3c5b60ffeb3062deec08f07 100644
--- a/ThermoSysPro/Examples/package.order
+++ b/ThermoSysPro/Examples/package.order
@@ -1,4 +1,4 @@
-CombinedCyclePowerPlant
-SimpleExamples
-Book
-Control
+CombinedCyclePowerPlant
+SimpleExamples
+Book
+Control
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/AirHumidity.mo b/ThermoSysPro/FlueGases/BoundaryConditions/AirHumidity.mo
index 696009a11fa6198b97dacf9b517262737a990be6..684515c4341c04eefecf7b27f83de1998b3322fe 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/AirHumidity.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/AirHumidity.mo
@@ -1,139 +1,139 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model AirHumidity "Air humidity"
-  parameter Real hum0=0.5 "Air humidiy";
-  parameter Integer mode=2
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  Units.SI.AbsolutePressure ppvap0(start=1e4)
-    "Intermediate vapor partial pressure";
-  Units.SI.Density rho_vap0(start=200) "Intermediate H2O density";
-
-public
-  Units.SI.AbsolutePressure P "Air pressure";
-  Units.SI.Temperature T "Air temperature";
-  Units.SI.Density rho_vap(start=200) "H20 density";
-  Units.SI.Density rho_air(start=0.8) "Air density";
-  Units.SI.AbsolutePressure psvap(start=1e5)
-    "Vapor stauration pressure in the air";
-  Units.SI.AbsolutePressure ppvap(start=1e4) "Vapor partial pressure";
-  Units.SI.AbsolutePressure ppair "Air partial pressure";
-  Real hum "Air relative humidity";
-  Real Xo2as(start=0.2) "O2 mass fraction in dry air";
-  Real Xco2 "CO2 mass fraction at the outlet";
-  Real Xh2o "H2O mass fraction at the outlet";
-  Real Xo2 "O2 mass fraction at the outlet";
-  Real Xso2 "SO2 mas fraction at the outlet";
-  Real Xn2 "N2 mass fraction at the outlet";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal humidity
-    "Air humidity"
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-  if (cardinality(humidity) == 0) then
-    humidity.signal = hum0;
-  end if;
-
-  hum = humidity.signal;
-
-  C1.P = C2.P;
-  C1.T = C2.T;
-  C1.Q = C2.Q;
-
-  P = C1.P;
-  T = C1.T;
-
-  /* O2 mass fraction at the inlet */
-  Xo2as = C1.Xo2;
-
-  /* Flue gas composition at the outlet. The sole constituents for air are O2 and N2 */
-  Xco2 = 0;
-  Xso2 = 0;
-  Xh2o = rho_vap/(rho_vap + rho_air);
-  Xo2 = Xo2as*(1 - Xh2o);
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  C2.Xco2 = Xco2;
-  C2.Xso2 = Xso2;
-  C2.Xh2o = Xh2o;
-  C2.Xo2 = Xo2;
-
-  /* Vapor partial pressure */
-  ppvap = psvap*hum;
-  0 = if (ppvap < 0.061080e-4) then ppvap0 - 0.061080e-4 else ppvap - ppvap0;
-
-  /* Air partial pressure */
-  ppair = P - ppvap;
-
-  /* Vapor saturation pressure */
-  psvap = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T);
-
-  /* H2O density */
-  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(ppvap, T, mode);
-
-  rho_vap0 = pro.d;
-
-  0 = if (ppvap < 0.061080e-4) then rho_vap - (rho_vap0*ppvap/ppvap0) else rho_vap - rho_vap0;
-
-  /* Air density */
-  rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(ppair, T, Xco2, Xh2o, Xo2as, Xso2);
-
-  annotation (Diagram(graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "H2O")}),                 Icon(graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "H2O")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end AirHumidity;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model AirHumidity "Air humidity"
+  parameter Real hum0=0.5 "Air humidiy";
+  parameter Integer mode=2
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  Units.SI.AbsolutePressure ppvap0(start=1e4)
+    "Intermediate vapor partial pressure";
+  Units.SI.Density rho_vap0(start=200) "Intermediate H2O density";
+
+public
+  Units.SI.AbsolutePressure P "Air pressure";
+  Units.SI.Temperature T "Air temperature";
+  Units.SI.Density rho_vap(start=200) "H20 density";
+  Units.SI.Density rho_air(start=0.8) "Air density";
+  Units.SI.AbsolutePressure psvap(start=1e5)
+    "Vapor stauration pressure in the air";
+  Units.SI.AbsolutePressure ppvap(start=1e4) "Vapor partial pressure";
+  Units.SI.AbsolutePressure ppair "Air partial pressure";
+  Real hum "Air relative humidity";
+  Real Xo2as(start=0.2) "O2 mass fraction in dry air";
+  Real Xco2 "CO2 mass fraction at the outlet";
+  Real Xh2o "H2O mass fraction at the outlet";
+  Real Xo2 "O2 mass fraction at the outlet";
+  Real Xso2 "SO2 mas fraction at the outlet";
+  Real Xn2 "N2 mass fraction at the outlet";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal humidity
+    "Air humidity"
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+  if (cardinality(humidity) == 0) then
+    humidity.signal = hum0;
+  end if;
+
+  hum = humidity.signal;
+
+  C1.P = C2.P;
+  C1.T = C2.T;
+  C1.Q = C2.Q;
+
+  P = C1.P;
+  T = C1.T;
+
+  /* O2 mass fraction at the inlet */
+  Xo2as = C1.Xo2;
+
+  /* Flue gas composition at the outlet. The sole constituents for air are O2 and N2 */
+  Xco2 = 0;
+  Xso2 = 0;
+  Xh2o = rho_vap/(rho_vap + rho_air);
+  Xo2 = Xo2as*(1 - Xh2o);
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  C2.Xco2 = Xco2;
+  C2.Xso2 = Xso2;
+  C2.Xh2o = Xh2o;
+  C2.Xo2 = Xo2;
+
+  /* Vapor partial pressure */
+  ppvap = psvap*hum;
+  0 = if (ppvap < 0.061080e-4) then ppvap0 - 0.061080e-4 else ppvap - ppvap0;
+
+  /* Air partial pressure */
+  ppair = P - ppvap;
+
+  /* Vapor saturation pressure */
+  psvap = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T);
+
+  /* H2O density */
+  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(ppvap, T, mode);
+
+  rho_vap0 = pro.d;
+
+  0 = if (ppvap < 0.061080e-4) then rho_vap - (rho_vap0*ppvap/ppvap0) else rho_vap - rho_vap0;
+
+  /* Air density */
+  rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(ppair, T, Xco2, Xh2o, Xo2as, Xso2);
+
+  annotation (Diagram(graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "H2O")}),                 Icon(graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "H2O")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end AirHumidity;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/Sink.mo b/ThermoSysPro/FlueGases/BoundaryConditions/Sink.mo
index 9ea727c5de46ef71ca5ff70c15618ca4e4b9fac6..eb21b5d8ad43bd471b938f463c3cb1f5a8f3388a 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/Sink.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/Sink.mo
@@ -1,72 +1,72 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model Sink "Flue gas sink"
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H2O mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
-    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
-           0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}})}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end Sink;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model Sink "Flue gas sink"
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H2O mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
+    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
+           0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}})}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end Sink;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/SinkG.mo b/ThermoSysPro/FlueGases/BoundaryConditions/SinkG.mo
index ba9d51a7be3851002e4a26c41e8ef74866ab9194..c1eb6a079ca711c4e192c5958c508c07ce5d45ad 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/SinkG.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/SinkG.mo
@@ -1,134 +1,134 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model SinkG "General flue gas sink"
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H2O mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{60,-10},{40,10}}, rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
-    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
-           0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Mass flow rate */
-  if (cardinality(IMassFlow) == 1) then
-    C.Q = IMassFlow.signal;
-  end if;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 1) then
-    C.P = IPressure.signal;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Rectangle(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-40,30},{40,-32}},
-          lineColor={0,0,255},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "G"),
-        Text(
-          extent={{40,28},{64,6}},
-          lineColor={0,0,255},
-          textString=
-               "P"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Rectangle(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-40,30},{40,-32}},
-          lineColor={0,0,255},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "G"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{40,28},{64,6}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SinkG;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model SinkG "General flue gas sink"
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H2O mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{60,-10},{40,10}}, rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
+    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
+           0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Mass flow rate */
+  if (cardinality(IMassFlow) == 1) then
+    C.Q = IMassFlow.signal;
+  end if;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 1) then
+    C.P = IPressure.signal;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Rectangle(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-40,30},{40,-32}},
+          lineColor={0,0,255},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "G"),
+        Text(
+          extent={{40,28},{64,6}},
+          lineColor={0,0,255},
+          textString=
+               "P"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Rectangle(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-40,30},{40,-32}},
+          lineColor={0,0,255},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "G"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{40,28},{64,6}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SinkG;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/SinkP.mo b/ThermoSysPro/FlueGases/BoundaryConditions/SinkP.mo
index 948cc0157b12e51181787dea3b1ff20c0f3601fa..fbe369f35ff36b3487a87f07fa37b86b71a7294e 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/SinkP.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/SinkP.mo
@@ -1,100 +1,100 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model SinkP "Flue gas sink with fixed pressure"
-  parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H2O mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
-    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
-           0)));
-  InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{60,-10},{40,10}}, rotation=0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-94,28},{98,-28}},
-          lineColor={0,0,255},
-          textString =                     "P"),
-        Text(
-          extent={{40,28},{64,6}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-94,28},{98,-28}},
-          lineColor={0,0,255},
-          textString =                     "P"),
-        Text(
-          extent={{40,28},{64,6}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SinkP;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model SinkP "Flue gas sink with fixed pressure"
+  parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H2O mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
+    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
+           0)));
+  InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{60,-10},{40,10}}, rotation=0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-94,28},{98,-28}},
+          lineColor={0,0,255},
+          textString =                     "P"),
+        Text(
+          extent={{40,28},{64,6}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-94,28},{98,-28}},
+          lineColor={0,0,255},
+          textString =                     "P"),
+        Text(
+          extent={{40,28},{64,6}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SinkP;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/SinkPQ.mo b/ThermoSysPro/FlueGases/BoundaryConditions/SinkPQ.mo
index 2faa9416d2730db6bc55bca65ffe4a24a541d13f..2c2ec40c78cefea4fd33ca214df005adf26f3903 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/SinkPQ.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/SinkPQ.mo
@@ -1,130 +1,130 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model SinkPQ "Flue gas sink with fixed pressure and mass flow rate"
-  parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure";
-  parameter Units.SI.MassFlowRate Q0=100 "Sink mass flow rate";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H2O mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
-    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{60,-9},{40,9}}, rotation=0)));
-public
-  InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Mass flow rate */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "PQ"),
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Text(
-          extent={{40,28},{64,6}},
-          lineColor={0,0,255},
-          textString=
-               "P"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "PQ"),
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Text(
-          extent={{40,28},{64,6}},
-          lineColor={0,0,255},
-          textString=
-               "P"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SinkPQ;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model SinkPQ "Flue gas sink with fixed pressure and mass flow rate"
+  parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure";
+  parameter Units.SI.MassFlowRate Q0=100 "Sink mass flow rate";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H2O mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
+    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{60,-9},{40,9}}, rotation=0)));
+public
+  InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Mass flow rate */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "PQ"),
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Text(
+          extent={{40,28},{64,6}},
+          lineColor={0,0,255},
+          textString=
+               "P"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "PQ"),
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Text(
+          extent={{40,28},{64,6}},
+          lineColor={0,0,255},
+          textString=
+               "P"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SinkPQ;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/SinkQ.mo b/ThermoSysPro/FlueGases/BoundaryConditions/SinkQ.mo
index 237aac7c5e843351fe88c697e719356486e3845e..1cd9ef965e45a857cdb88a3dd251f1ea246daea5 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/SinkQ.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/SinkQ.mo
@@ -1,106 +1,106 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model SinkQ "Flue gas sink with fixed mass flow rate"
-  parameter Units.SI.MassFlowRate Q0=100 "Sink mass flow rate";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H2O mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
-    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
-           0)));
-public
-  InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Mass flow rate */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-94,28},{98,-28}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-94,28},{98,-28}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SinkQ;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model SinkQ "Flue gas sink with fixed mass flow rate"
+  parameter Units.SI.MassFlowRate Q0=100 "Sink mass flow rate";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H2O mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C
+    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
+           0)));
+public
+  InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Mass flow rate */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-94,28},{98,-28}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-94,28},{98,-28}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SinkQ;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/Source.mo b/ThermoSysPro/FlueGases/BoundaryConditions/Source.mo
index 6cd6ded55d8a41d7cf0acacbd57ecd9e21594dd8..30307af6fc86864dc45335f29ac1a616b0f240e6 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/Source.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/Source.mo
@@ -1,94 +1,94 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model Source "Flue gas source"
-  parameter Units.SI.Temperature T0=400 "Source temperature";
-  parameter Real Xco2=0.10 "CO2 mass fraction";
-  parameter Real Xh2o=0.05 "H2O mass fraction";
-  parameter Real Xo2=0.22 "O2 mass fraction";
-  parameter Real Xso2=0.00 "SO2 mass fraction";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xn2 "N2 mas fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Temperature */
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  T = ITemperature.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end Source;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model Source "Flue gas source"
+  parameter Units.SI.Temperature T0=400 "Source temperature";
+  parameter Real Xco2=0.10 "CO2 mass fraction";
+  parameter Real Xh2o=0.05 "H2O mass fraction";
+  parameter Real Xo2=0.22 "O2 mass fraction";
+  parameter Real Xso2=0.00 "SO2 mass fraction";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xn2 "N2 mas fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Temperature */
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  T = ITemperature.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end Source;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/SourceG.mo b/ThermoSysPro/FlueGases/BoundaryConditions/SourceG.mo
index 0ffc8055fd50e9c3286d20676dd74c1de8acaf89..00483fb7248f6851ce04829a65433ead74689745 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/SourceG.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/SourceG.mo
@@ -1,154 +1,154 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model SourceG "General flue gas source"
-  parameter Real Xco2=0.10 "CO2 mass fraction";
-  parameter Real Xh2o=0.05 "H2O mass fraction";
-  parameter Real Xo2=0.22 "O2 mass fraction";
-  parameter Real Xso2=0.00 "SO2 mass fraction";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xn2 "N2 mas fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Mass flow rate */
-  if (cardinality(IMassFlow) == 1) then
-    C.Q = IMassFlow.signal;
-  end if;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 1) then
-    C.P = IPressure.signal;
-  end if;
-
-  /* Temperature */
-  if (cardinality(ITemperature) == 1) then
-    C.T = ITemperature.signal;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-40,30},{40,-32}},
-          lineColor={0,0,255},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "G"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P"),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Rectangle(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-40,30},{40,-32}},
-          lineColor={0,0,255},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "G"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P"),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SourceG;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model SourceG "General flue gas source"
+  parameter Real Xco2=0.10 "CO2 mass fraction";
+  parameter Real Xh2o=0.05 "H2O mass fraction";
+  parameter Real Xo2=0.22 "O2 mass fraction";
+  parameter Real Xso2=0.00 "SO2 mass fraction";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xn2 "N2 mas fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Mass flow rate */
+  if (cardinality(IMassFlow) == 1) then
+    C.Q = IMassFlow.signal;
+  end if;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 1) then
+    C.P = IPressure.signal;
+  end if;
+
+  /* Temperature */
+  if (cardinality(ITemperature) == 1) then
+    C.T = ITemperature.signal;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-40,30},{40,-32}},
+          lineColor={0,0,255},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "G"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P"),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Rectangle(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-40,30},{40,-32}},
+          lineColor={0,0,255},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "G"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P"),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SourceG;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/SourceP.mo b/ThermoSysPro/FlueGases/BoundaryConditions/SourceP.mo
index 7d03c3fedcee23e29f4b8e8c5f450628e85cec32..4198b4cc51867b17a1e8737fa38c0f03d19bcee7 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/SourceP.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/SourceP.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model SourceP "Flue gas source with fixed pressure"
-  parameter Units.SI.AbsolutePressure P0=200000 "Source pressure";
-  parameter Units.SI.Temperature T0=400 "Source temperature";
-  parameter Real Xco2=0.10 "CO2 mass fraction";
-  parameter Real Xh2o=0.05 "H2O mass fraction";
-  parameter Real Xo2=0.22 "O2 mass fraction";
-  parameter Real Xso2=0.00 "SO2 mass fraction";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xn2 "N2 mas fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-public
-  InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Temperature */
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  T = ITemperature.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-94,28},{98,-28}},
-          lineColor={0,0,255},
-          textString =                     "P"),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P"),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-92,30},{100,-26}},
-          lineColor={0,0,255},
-          textString =                     "P"),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P"),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SourceP;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model SourceP "Flue gas source with fixed pressure"
+  parameter Units.SI.AbsolutePressure P0=200000 "Source pressure";
+  parameter Units.SI.Temperature T0=400 "Source temperature";
+  parameter Real Xco2=0.10 "CO2 mass fraction";
+  parameter Real Xh2o=0.05 "H2O mass fraction";
+  parameter Real Xo2=0.22 "O2 mass fraction";
+  parameter Real Xso2=0.00 "SO2 mass fraction";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xn2 "N2 mas fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+public
+  InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Temperature */
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  T = ITemperature.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-94,28},{98,-28}},
+          lineColor={0,0,255},
+          textString =                     "P"),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P"),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-92,30},{100,-26}},
+          lineColor={0,0,255},
+          textString =                     "P"),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P"),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SourceP;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/SourcePQ.mo b/ThermoSysPro/FlueGases/BoundaryConditions/SourcePQ.mo
index 2314d13d79076a41208520a93e537179c0e57198..3956059f6f27ed4da064d4bb8fabdd773a793619 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/SourcePQ.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/SourcePQ.mo
@@ -1,153 +1,153 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model SourcePQ "Flue gas source with fixed pressure and mass flow rate"
-  parameter Units.SI.AbsolutePressure P0=200000 "Source pressure";
-  parameter Units.SI.MassFlowRate Q0=100 "Sink mass flow rate";
-  parameter Units.SI.Temperature T0=400 "Source temperature";
-  parameter Real Xco2=0.10 "CO2 mass fraction";
-  parameter Real Xh2o=0.05 "H2O mass fraction";
-  parameter Real Xo2=0.22 "O2 mass fraction";
-  parameter Real Xso2=0.00 "SO2 mass fraction";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xn2 "N2 mas fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Mass flow rate */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Temperature */
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  T = ITemperature.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "PQ"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P"),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "PQ"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P"),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SourcePQ;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model SourcePQ "Flue gas source with fixed pressure and mass flow rate"
+  parameter Units.SI.AbsolutePressure P0=200000 "Source pressure";
+  parameter Units.SI.MassFlowRate Q0=100 "Sink mass flow rate";
+  parameter Units.SI.Temperature T0=400 "Source temperature";
+  parameter Real Xco2=0.10 "CO2 mass fraction";
+  parameter Real Xh2o=0.05 "H2O mass fraction";
+  parameter Real Xo2=0.22 "O2 mass fraction";
+  parameter Real Xso2=0.00 "SO2 mass fraction";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xn2 "N2 mas fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Mass flow rate */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Temperature */
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  T = ITemperature.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "PQ"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P"),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "PQ"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P"),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SourcePQ;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/SourceQ.mo b/ThermoSysPro/FlueGases/BoundaryConditions/SourceQ.mo
index de5abbd205101770213aabe6c3b9c83224fb0596..50e011e127adf0e2bf76bad074790939ae94a32c 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/SourceQ.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/SourceQ.mo
@@ -1,132 +1,132 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model SourceQ "Flue gas source with fixed mass flow rate"
-  parameter Units.SI.MassFlowRate Q0=100 "Source mass flow rate";
-  parameter Units.SI.Temperature T0=400 "Source temperature";
-  parameter Real Xco2=0.10 "CO2 mass fraction";
-  parameter Real Xh2o=0.05 "H2O mass fraction";
-  parameter Real Xo2=0.22 "O2 mass fraction";
-  parameter Real Xso2=0.00 "SO2 mass fraction";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xn2 "N2 mas fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-public
-  InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* Flue gas composition */
-  C.Xco2 = Xco2;
-  C.Xh2o = Xh2o;
-  C.Xo2 = Xo2;
-  C.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Mass flow rate */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Temperature */
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  T = ITemperature.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Q"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward,
-          textString=
-               "Q"),
-        Text(
-          extent={{-40,60},{-6,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{-40,-40},{-2,-60}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SourceQ;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model SourceQ "Flue gas source with fixed mass flow rate"
+  parameter Units.SI.MassFlowRate Q0=100 "Source mass flow rate";
+  parameter Units.SI.Temperature T0=400 "Source temperature";
+  parameter Real Xco2=0.10 "CO2 mass fraction";
+  parameter Real Xh2o=0.05 "H2O mass fraction";
+  parameter Real Xo2=0.22 "O2 mass fraction";
+  parameter Real Xso2=0.00 "SO2 mass fraction";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xn2 "N2 mas fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+public
+  InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* Flue gas composition */
+  C.Xco2 = Xco2;
+  C.Xh2o = Xh2o;
+  C.Xo2 = Xo2;
+  C.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Mass flow rate */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Temperature */
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  T = ITemperature.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Q"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward,
+          textString=
+               "Q"),
+        Text(
+          extent={{-40,60},{-6,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{-40,-40},{-2,-60}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SourceQ;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/SourceQX.mo b/ThermoSysPro/FlueGases/BoundaryConditions/SourceQX.mo
index ac4a384c37ec1110965b1a780cb084e398445bcc..e1fccecb9ed3545067b14ff8d298e15c7a906853 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/SourceQX.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/SourceQX.mo
@@ -1,209 +1,209 @@
-within ThermoSysPro.FlueGases.BoundaryConditions;
-model SourceQX "Flue gas source with fixed mass flow rate"
-  parameter Units.SI.MassFlowRate Q0=100 "Source mass flow rate";
-  parameter Units.SI.Temperature T0=400 "Source temperature";
-  parameter Real Xco2=0.10 "CO2 mass fraction";
-  parameter Real Xh2o=0.05 "H2O mass fraction";
-  parameter Real Xo2=0.22 "O2 mass fraction";
-  parameter Real Xso2=0.00 "SO2 mass fraction";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xn2 "N2 mas fraction";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-public
-  InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={39,90},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={40,-90},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  InstrumentationAndControl.Connectors.InputReal ICO2 annotation (Placement(
-        transformation(
-        origin={-90,-90},
-        extent={{10,-10},{-10,10}},
-        rotation=0), iconTransformation(extent={{-10,-10},{10,10}}, origin={-70,
-            -90})));
-  InstrumentationAndControl.Connectors.InputReal IH2O annotation (Placement(
-        transformation(
-        origin={-90,-30},
-        extent={{10,-10},{-10,10}},
-        rotation=0), iconTransformation(extent={{-10,-10},{10,10}}, origin={-70,
-            -30})));
-  InstrumentationAndControl.Connectors.InputReal IO2 annotation (Placement(
-        transformation(
-        origin={-90,30},
-        extent={{10,-10},{-10,10}},
-        rotation=0), iconTransformation(extent={{-11,-10},{11,10}}, origin={-69,
-            30})));
-  InstrumentationAndControl.Connectors.InputReal ISO2 annotation (Placement(
-        transformation(
-        origin={-90,90},
-        extent={{10,-10},{-10,10}},
-        rotation=0), iconTransformation(extent={{-10,-10},{10,10}}, origin={-70,
-            90})));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-
-  /* CO2 mass fraction */
-  if (cardinality(ICO2) == 0) then
-    ICO2.signal = Xco2;
-  end if;
-
-  C.Xco2 = ICO2.signal;
-
-  /* H2O mass fraction */
-  if (cardinality(IH2O) == 0) then
-    IH2O.signal = Xh2o;
-  end if;
-
-  C.Xh2o = IH2O.signal;
-
-  /* O2 mass fraction */
-  if (cardinality(ICO2) == 0) then
-    IO2.signal = Xo2;
-  end if;
-
-  C.Xo2 = IO2.signal;
-
-  /* SO2 mass fraction */
-  if (cardinality(ISO2) == 0) then
-    ISO2.signal = Xso2;
-  end if;
-
-  C.Xso2 = ISO2.signal;
-
-
-  Xn2 = 1 - C.Xco2 - C.Xh2o - C.Xo2 - C.Xso2;
-
-  /* Mass flow rate */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Temperature */
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  T = ITemperature.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Q"),
-        Text(
-          extent={{4,100},{38,80}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(
-          extent={{0,-80},{38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "T"),
-        Text(
-          extent={{-114,-58},{-76,-78}},
-          lineColor={0,0,255},
-          textString="CO2"),
-        Text(
-          extent={{-114,2},{-76,-18}},
-          lineColor={0,0,255},
-          textString="H2O"),
-        Text(
-          extent={{-114,54},{-76,34}},
-          lineColor={0,0,255},
-          textString="O2"),
-        Text(
-          extent={{-108,116},{-70,96}},
-          lineColor={0,0,255},
-          textString="SO2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward,
-          textString=
-               "Q"),
-        Text(
-          extent={{-118,112},{-80,92}},
-          lineColor={0,0,255},
-          textString="SO2"),
-        Text(
-          extent={{-126,60},{-88,40}},
-          lineColor={0,0,255},
-          textString="O2"),
-        Text(
-          extent={{-116,4},{-84,-16}},
-          lineColor={0,0,255},
-          textString="H2O"),
-        Text(
-          extent={{-124,-60},{-86,-80}},
-          lineColor={0,0,255},
-          textString="CO2"),
-        Text(
-          extent={{-10,-84},{28,-104}},
-          lineColor={0,0,255},
-          textString=
-               "T"),
-        Text(
-          extent={{-6,96},{28,76}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SourceQX;
+within ThermoSysPro.FlueGases.BoundaryConditions;
+model SourceQX "Flue gas source with fixed mass flow rate"
+  parameter Units.SI.MassFlowRate Q0=100 "Source mass flow rate";
+  parameter Units.SI.Temperature T0=400 "Source temperature";
+  parameter Real Xco2=0.10 "CO2 mass fraction";
+  parameter Real Xh2o=0.05 "H2O mass fraction";
+  parameter Real Xo2=0.22 "O2 mass fraction";
+  parameter Real Xso2=0.00 "SO2 mass fraction";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xn2 "N2 mas fraction";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+public
+  InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={39,90},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={40,-90},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  InstrumentationAndControl.Connectors.InputReal ICO2 annotation (Placement(
+        transformation(
+        origin={-90,-90},
+        extent={{10,-10},{-10,10}},
+        rotation=0), iconTransformation(extent={{-10,-10},{10,10}}, origin={-70,
+            -90})));
+  InstrumentationAndControl.Connectors.InputReal IH2O annotation (Placement(
+        transformation(
+        origin={-90,-30},
+        extent={{10,-10},{-10,10}},
+        rotation=0), iconTransformation(extent={{-10,-10},{10,10}}, origin={-70,
+            -30})));
+  InstrumentationAndControl.Connectors.InputReal IO2 annotation (Placement(
+        transformation(
+        origin={-90,30},
+        extent={{10,-10},{-10,10}},
+        rotation=0), iconTransformation(extent={{-11,-10},{11,10}}, origin={-69,
+            30})));
+  InstrumentationAndControl.Connectors.InputReal ISO2 annotation (Placement(
+        transformation(
+        origin={-90,90},
+        extent={{10,-10},{-10,10}},
+        rotation=0), iconTransformation(extent={{-10,-10},{10,10}}, origin={-70,
+            90})));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+
+  /* CO2 mass fraction */
+  if (cardinality(ICO2) == 0) then
+    ICO2.signal = Xco2;
+  end if;
+
+  C.Xco2 = ICO2.signal;
+
+  /* H2O mass fraction */
+  if (cardinality(IH2O) == 0) then
+    IH2O.signal = Xh2o;
+  end if;
+
+  C.Xh2o = IH2O.signal;
+
+  /* O2 mass fraction */
+  if (cardinality(ICO2) == 0) then
+    IO2.signal = Xo2;
+  end if;
+
+  C.Xo2 = IO2.signal;
+
+  /* SO2 mass fraction */
+  if (cardinality(ISO2) == 0) then
+    ISO2.signal = Xso2;
+  end if;
+
+  C.Xso2 = ISO2.signal;
+
+
+  Xn2 = 1 - C.Xco2 - C.Xh2o - C.Xo2 - C.Xso2;
+
+  /* Mass flow rate */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Temperature */
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  T = ITemperature.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Q"),
+        Text(
+          extent={{4,100},{38,80}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(
+          extent={{0,-80},{38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "T"),
+        Text(
+          extent={{-114,-58},{-76,-78}},
+          lineColor={0,0,255},
+          textString="CO2"),
+        Text(
+          extent={{-114,2},{-76,-18}},
+          lineColor={0,0,255},
+          textString="H2O"),
+        Text(
+          extent={{-114,54},{-76,34}},
+          lineColor={0,0,255},
+          textString="O2"),
+        Text(
+          extent={{-108,116},{-70,96}},
+          lineColor={0,0,255},
+          textString="SO2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward,
+          textString=
+               "Q"),
+        Text(
+          extent={{-118,112},{-80,92}},
+          lineColor={0,0,255},
+          textString="SO2"),
+        Text(
+          extent={{-126,60},{-88,40}},
+          lineColor={0,0,255},
+          textString="O2"),
+        Text(
+          extent={{-116,4},{-84,-16}},
+          lineColor={0,0,255},
+          textString="H2O"),
+        Text(
+          extent={{-124,-60},{-86,-80}},
+          lineColor={0,0,255},
+          textString="CO2"),
+        Text(
+          extent={{-10,-84},{28,-104}},
+          lineColor={0,0,255},
+          textString=
+               "T"),
+        Text(
+          extent={{-6,96},{28,76}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SourceQX;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/package.mo b/ThermoSysPro/FlueGases/BoundaryConditions/package.mo
index 74995b5c2a74475ed5094fe4ca5df65865b15f68..cdba447f973dccbed0ddaea64547d78b7a91ce4d 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/package.mo
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.FlueGases;
-package BoundaryConditions "Boundary conditions"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end BoundaryConditions;
+within ThermoSysPro.FlueGases;
+package BoundaryConditions "Boundary conditions"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end BoundaryConditions;
diff --git a/ThermoSysPro/FlueGases/BoundaryConditions/package.order b/ThermoSysPro/FlueGases/BoundaryConditions/package.order
index 5371bdad29649e3fcf67572964f061fcd830ae9a..2f3784446ba25a4301966ef083e91454c9efda73 100644
--- a/ThermoSysPro/FlueGases/BoundaryConditions/package.order
+++ b/ThermoSysPro/FlueGases/BoundaryConditions/package.order
@@ -1,12 +1,12 @@
-AirHumidity
-Sink
-SinkG
-SinkP
-SinkPQ
-SinkQ
-Source
-SourceG
-SourceP
-SourcePQ
-SourceQ
-SourceQX
+AirHumidity
+Sink
+SinkG
+SinkP
+SinkPQ
+SinkQ
+Source
+SourceG
+SourceP
+SourcePQ
+SourceQ
+SourceQX
diff --git a/ThermoSysPro/FlueGases/Connectors.mo b/ThermoSysPro/FlueGases/Connectors.mo
index 0a1e289add4d860b4cfd1766486cf2fc4a6e9383..a4dc580b9938e0d350204f1cc139f03a78072235 100644
--- a/ThermoSysPro/FlueGases/Connectors.mo
+++ b/ThermoSysPro/FlueGases/Connectors.mo
@@ -1,317 +1,317 @@
-within ThermoSysPro.FlueGases;
-package Connectors "Connectors"
-  connector FlueGasesOutlet "Flue gases outlet fluid connector"
-    Units.SI.AbsolutePressure P(start=1.e5)
-      "Fluid pressure in the control volume";
-    Units.SI.Temperature T(start=300) "Fluid temperature in the control volume";
-    Units.SI.MassFlowRate Q(start=100)
-      "Mass flow of the fluid crossing the boundary of the control volume";
-    Real Xco2(start=0.01)
-      "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xh2o(start=0.05)
-      "H2O mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xo2(start=0.2)
-      "O2 mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xso2(start=0)
-      "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-
-    output Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    input Boolean b=true
-      "Pseudo-variable for the verification of the connection orientation";
-
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,-100},{102,100}},
-            lineColor={0,0,0},
-            lineThickness=1,
-            fillPattern=FillPattern.Sphere,
-            fillColor={191,0,0})}),
-      Window(
-        x=0.31,
-        y=0.13,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u> </p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-  end FlueGasesOutlet;
-
-  connector FlueGasesInlet "Flue gases inlet fluid connector"
-    Units.SI.AbsolutePressure P(start=1.e5)
-      "Fluid pressure in the control volume";
-    Units.SI.Temperature T(start=300) "Fluid temperature in the control volume";
-    Units.SI.MassFlowRate Q(start=100)
-      "Mass flow of the fluid crossing the boundary of the control volume";
-    Real Xco2(start=0.01)
-      "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xh2o(start=0.05)
-      "H2O mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xo2(start=0.2)
-      "O2 mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xso2(start=0)
-      "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-
-    input Boolean a=true
-      "Pseudo-variable for the verification of the connection orientation";
-    output Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,-100},{100,100}},
-            lineColor={0,0,0},
-            lineThickness=1,
-            fillPattern=FillPattern.Sphere,
-            fillColor={127,127,255})}),
-      Window(
-        x=0.31,
-        y=0.13,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-  end FlueGasesInlet;
-
-  connector FlueGasesInletI "Internal flue gases inlet fluid connector"
-    Units.SI.AbsolutePressure P(start=1.e5)
-      "Fluid pressure in the control volume";
-    Units.SI.Temperature T(start=300) "Fluid temperature in the control volume";
-    Units.SI.MassFlowRate Q(start=100)
-      "Mass flow of the fluid crossing the boundary of the control volume";
-    Real Xco2(start=0.01)
-      "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xh2o(start=0.05)
-      "H2O mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xo2(start=0.2)
-      "O2 mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xso2(start=0)
-      "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-
-    input Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    output Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-
-      annotation (
-        Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,-100},{100,100}},
-            lineColor={0,0,0},
-            lineThickness=1,
-            fillColor={127,127,255},
-            fillPattern=FillPattern.Forward)}),
-        Window(
-          x=0.31,
-          y=0.13,
-          width=0.6,
-          height=0.6),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-  end FlueGasesInletI;
-
-  connector FlueGasesOutletI "Internal flue gases outlet fluid connector"
-    Units.SI.AbsolutePressure P(start=1.e5)
-      "Fluid pressure in the control volume";
-    Units.SI.Temperature T(start=300) "Fluid temperature in the control volume";
-    Units.SI.MassFlowRate Q(start=100)
-      "Mass flow of the fluid crossing the boundary of the control volume";
-    Real Xco2(start=0.01)
-      "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xh2o(start=0.05)
-      "H2O mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xo2(start=0.2)
-      "O2 mass fraction of the fluid crossing the boundary of the control volume";
-    Real Xso2(start=0)
-      "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-
-    output Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    input Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-
-      annotation (
-        Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,-100},{100,100}},
-            lineColor={0,0,0},
-            lineThickness=1,
-            fillColor={255,0,0},
-            fillPattern=FillPattern.Forward)}),
-        Window(
-          x=0.31,
-          y=0.13,
-          width=0.6,
-          height=0.6),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-  end FlueGasesOutletI;
-  annotation (Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end Connectors;
+within ThermoSysPro.FlueGases;
+package Connectors "Connectors"
+  connector FlueGasesOutlet "Flue gases outlet fluid connector"
+    Units.SI.AbsolutePressure P(start=1.e5)
+      "Fluid pressure in the control volume";
+    Units.SI.Temperature T(start=300) "Fluid temperature in the control volume";
+    Units.SI.MassFlowRate Q(start=100)
+      "Mass flow of the fluid crossing the boundary of the control volume";
+    Real Xco2(start=0.01)
+      "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xh2o(start=0.05)
+      "H2O mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xo2(start=0.2)
+      "O2 mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xso2(start=0)
+      "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+
+    output Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    input Boolean b=true
+      "Pseudo-variable for the verification of the connection orientation";
+
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,-100},{102,100}},
+            lineColor={0,0,0},
+            lineThickness=1,
+            fillPattern=FillPattern.Sphere,
+            fillColor={191,0,0})}),
+      Window(
+        x=0.31,
+        y=0.13,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u> </p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+  end FlueGasesOutlet;
+
+  connector FlueGasesInlet "Flue gases inlet fluid connector"
+    Units.SI.AbsolutePressure P(start=1.e5)
+      "Fluid pressure in the control volume";
+    Units.SI.Temperature T(start=300) "Fluid temperature in the control volume";
+    Units.SI.MassFlowRate Q(start=100)
+      "Mass flow of the fluid crossing the boundary of the control volume";
+    Real Xco2(start=0.01)
+      "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xh2o(start=0.05)
+      "H2O mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xo2(start=0.2)
+      "O2 mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xso2(start=0)
+      "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+
+    input Boolean a=true
+      "Pseudo-variable for the verification of the connection orientation";
+    output Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,-100},{100,100}},
+            lineColor={0,0,0},
+            lineThickness=1,
+            fillPattern=FillPattern.Sphere,
+            fillColor={127,127,255})}),
+      Window(
+        x=0.31,
+        y=0.13,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+  end FlueGasesInlet;
+
+  connector FlueGasesInletI "Internal flue gases inlet fluid connector"
+    Units.SI.AbsolutePressure P(start=1.e5)
+      "Fluid pressure in the control volume";
+    Units.SI.Temperature T(start=300) "Fluid temperature in the control volume";
+    Units.SI.MassFlowRate Q(start=100)
+      "Mass flow of the fluid crossing the boundary of the control volume";
+    Real Xco2(start=0.01)
+      "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xh2o(start=0.05)
+      "H2O mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xo2(start=0.2)
+      "O2 mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xso2(start=0)
+      "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+
+    input Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    output Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+
+      annotation (
+        Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,-100},{100,100}},
+            lineColor={0,0,0},
+            lineThickness=1,
+            fillColor={127,127,255},
+            fillPattern=FillPattern.Forward)}),
+        Window(
+          x=0.31,
+          y=0.13,
+          width=0.6,
+          height=0.6),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+  end FlueGasesInletI;
+
+  connector FlueGasesOutletI "Internal flue gases outlet fluid connector"
+    Units.SI.AbsolutePressure P(start=1.e5)
+      "Fluid pressure in the control volume";
+    Units.SI.Temperature T(start=300) "Fluid temperature in the control volume";
+    Units.SI.MassFlowRate Q(start=100)
+      "Mass flow of the fluid crossing the boundary of the control volume";
+    Real Xco2(start=0.01)
+      "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xh2o(start=0.05)
+      "H2O mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xo2(start=0.2)
+      "O2 mass fraction of the fluid crossing the boundary of the control volume";
+    Real Xso2(start=0)
+      "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+
+    output Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    input Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+
+      annotation (
+        Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,-100},{100,100}},
+            lineColor={0,0,0},
+            lineThickness=1,
+            fillColor={255,0,0},
+            fillPattern=FillPattern.Forward)}),
+        Window(
+          x=0.31,
+          y=0.13,
+          width=0.6,
+          height=0.6),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+  end FlueGasesOutletI;
+  annotation (Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end Connectors;
diff --git a/ThermoSysPro/FlueGases/HeatExchangers/FlueGasesChamberEvaporator.mo b/ThermoSysPro/FlueGases/HeatExchangers/FlueGasesChamberEvaporator.mo
index 22eeba674cad4ced5233c1460e27c169422cadb5..d0181dc9733c9bcebad7c9af7177aaba1934860c 100644
--- a/ThermoSysPro/FlueGases/HeatExchangers/FlueGasesChamberEvaporator.mo
+++ b/ThermoSysPro/FlueGases/HeatExchangers/FlueGasesChamberEvaporator.mo
@@ -1,452 +1,452 @@
-within ThermoSysPro.FlueGases.HeatExchangers;
-model FlueGasesChamberEvaporator "Flue gases chamber  for water evaporation"
-  parameter Units.SI.Area Se=400 "Heat exchange surface on the flue gases side";
-  parameter Units.SI.Length rugosi=1e-5 "Pipe roughness";
-  parameter Real rencrf=0.1
-    "Fouling resistance on the flue gases side (m².K/m)";
-  parameter Real rencrc=0.1 "Fouling resistance on the coolant side (m².K/m)";
-  parameter Real FVN=0 "Ashes volume fraction";
-  parameter Units.SI.Height haut=15 "Flux wall height";
-  parameter Real alpha=1 "Chamber width/depth ratio";
-  parameter Units.SI.Diameter dtex=0.06 "Pipe external diameter";
-  parameter Units.SI.Diameter dtin=0.05 "Pipe internal diameter";
-  parameter Units.SI.Length lailet=0.05 "Membrane length";
-  parameter Units.SI.Length eailet=0.001 "Membrane thickness";
-  parameter Units.SI.Length ebeton=0.01 "Concrete thickness";
-  parameter Units.SI.ThermalConductivity condt=10 "Pipes thermal conductivity";
-  parameter Units.SI.ThermalConductivity condm=10
-    "Membrane thermal conductivity";
-  parameter Units.SI.ThermalConductivity condb=10
-    "Concret thermal conductivity";
-  parameter Real emimur=0.1 "Walls emissitivity";
-  parameter Units.SI.CoefficientOfHeatTransfer hi=10000
-    "Coolant heat exchange coefficient";
-
-protected
-  Units.SI.ThermalConductivity c1(start=0.1)
-    "Variable for the computation of the flue gases thermal conductivity";
-  Units.SI.ThermalConductivity c2(start=0.1)
-    "Variable for the computation of the flue gases thermal conductivity";
-  Real bb(start=0.1e-5)
-    "Variable for the computation of the friction coefficient";
-
-public
-  Units.SI.Temperature Tef(start=800) "Flue gases temperature at the inlet";
-  Units.SI.Temperature Tsf(start=800) "Flue gases temperature at the outlet";
-  Units.SI.AbsolutePressure Pef(start=1e5) "Flue gases pressure at the inlet";
-  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
-  Units.SI.MassFlowRate Qf(start=10) "Flue gases mass flow rate";
-  Real XfCO2(start=0.1) "CO2 mass fraction";
-  Real XfH2O(start=0.1) "H2O mass fraction";
-  Real XfO2(start=0.1) "O2 mass fraction";
-  Real XfN2(start=0.1) "N2 mass fraction";
-  Real XfSO2(start=0.6) "SO2 mass fraction";
-  Units.SI.Power Wer(start=10e5) "Radiation power received";
-  Units.SI.Power Wech(start=1e6) "Power exchanged";
-  Units.SI.Temperature Ts(start=600)
-    "Average surface temperature on the flue gases side";
-  Units.SI.Temperature Tpet(start=600) "Average external fin wall temperature";
-  Units.SI.AbsolutePressure Pec0(start=1e5) "Coolant pressure";
-  Units.SI.AbsolutePressure Pec(start=1e5) "Coolant pressure";
-  Units.SI.Angle anglb(start=1.5)
-    "Angle of the junction between the pipe and the membrane";
-  Units.SI.Angle angla(start=1.5) "Angle of the pipe exposed to the flue gases";
-  Real rtube(start=100) "Number of coressponding pipes";
-  Units.SI.Length long(start=100) "Chamber length";
-  Units.SI.Length prof(start=10) "Chamber depth";
-  Units.SI.Temperature Tc(start=800) "Coolant saturation temperature";
-  Units.SI.AbsolutePressure Pmf(start=1e5) "Flue gases average pressure";
-  Units.SI.Temperature Tmf(start=800) "Flue gases average temperature";
-  Real Xcor(start=0.1)
-    "Corrective coefficient for the flue gases mass fractions";
-  Real XfH2O0(start=0.1) "H2O corrected mass fraction";
-  Real XfCO20(start=0.1) "CO2 corrected mass fraction";
-  Real XfO20(start=0.1) "O2 corrected mass fraction";
-  Real XfSO20(start=0.1) "SO2 corrected mass fraction";
-  Real XfN20(start=0.1) "N2 corrected mass fraction";
-  constant Units.SI.AbsolutePressure Pnorm=1.01325e5 "Normal pressure";
-  constant Units.SI.Temperature Tnorm=273.15 "Normal temperature";
-  Units.SI.Density rhonorm(start=100) "Flue gases density at (Pnorm,Tnorm)";
-  Units.SI.ThermalConductivity condf(start=100)
-    "Flue gases thermal conductivity";
-  Units.SI.SpecificHeatCapacity cpf(start=1000)
-    "Flue gases specific heat capacity";
-  Units.SI.DynamicViscosity muf(start=1e-5) "Flue gases dynamic viscosity";
-  Units.SI.Density rhof(start=100) "Flue gases density";
-  Real fvd(start=0.5) "Ashes volume fraction";
-  Units.SI.Area Surf(start=50) "Flue gases cross-sectional area";
-  Units.SI.Length Perim(start=50) "Chamber perimeter";
-  Units.SI.Diameter Dh(start=50) "Chamber hydraulic diameter";
-  Real Ref(start=10000) "Reynolds number";
-  Real Prf(start=1) "Prandtl number";
-  Units.SI.CoefficientOfHeatTransfer hc(start=1)
-    "Convection heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer hr(start=50)
-    "Radiation heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer hf(start=50)
-    "Global heat exchange coefficient";
-  Units.SI.Volume volumg(start=500) "Gas volume";
-  Units.SI.Area senveng(start=500) "Gas envelope surface";
-  Units.SI.Length rop(start=5) "Average optical radius between the pipes";
-  Real Masmol(start=0.1) "Mixture molar mass";
-  Units.SI.AbsolutePressure PCO2R(start=0.5e5) "CO2 partial pressure";
-  Units.SI.AbsolutePressure PH2OR(start=0.5e5) "H2O partial pressure";
-  Real EG(start=0.5);
-  Real ES(start=0.5);
-  Real emigaz(start=0.5) "Gases emissivity";
-  Real emigaz0(start=0.5) "Gases emissivity";
-  Real rugos(start=0.1e-5) "Pipe roughness on the flue gases side";
-  Real kfrot(start=0.05) "Pressure losses friction coefficient";
-  ThermoSysPro.Units.SI.PressureDifference dpd(start=1000)
-    "Dynamical pressure losses";
-  ThermoSysPro.Units.SI.PressureDifference dps(start=1000)
-    "Static pressure losses";
-  ThermoSysPro.Units.SI.PressureDifference Pdf(start=1000)
-    "Total pressure losses";
-  Real R1(start=0.1) "Thermal resistance";
-  Real R2(start=0.1) "Thermal resistance";
-  Real R3(start=0.1) "Thermal resistance";
-  Real R4(start=0.1) "Thermal resistance";
-  Real R5(start=0.1) "Thermal resistance";
-  Real R6(start=0.1) "Thermal resistance";
-  Real R7(start=0.1) "Thermal resistance";
-  Real R8(start=0.1) "Thermal resistance";
-  Real R9(start=0.1) "Thermal resistance";
-  Real R10(start=0.1) "Thermal resistance";
-  Real R789(start=0.1) "Thermal resistance";
-  Real R01(start=0.1) "Fouling resistance";
-  Real R02(start=0.1) "Fouling resistance";
-  Real R03(start=0.1) "Fouling resistance";
-  Real R04(start=0.1) "Fouling resistance";
-  Real R05(start=0.1) "Fouling resistancet";
-  Real Rb1(start=0.1) "Concrete surface thermal resistance";
-  Real Rb2(start=0.1) "Concrete surface thermal resistance";
-  Real Rt(start=0.1) "Total surface thermal resistance (K/W)";
-  Real U(start=50)
-    "Global heat exchange coefficient per external surface unit (W/m²/K)";
-  Units.SI.Area Set(start=500) "Total external surface";
-  Units.SI.Velocity vit(start=1) "Gases veolicity";
-
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
-    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    "Water/steam pressure"
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-equation
-  /* Flue gases inlet */
-  Qf = C1.Q;
-  Pef = C1.P;
-  Tef = C1.T;
-
-  XfCO2 = C1.Xco2;
-  XfH2O = C1.Xh2o;
-  XfO2 = C1.Xo2;
-  XfN2 = 1 - XfCO2 - XfH2O - XfO2 - XfSO2;
-  XfSO2 = C1.Xso2;
-
-  /* Flue gases outlet */
-  Qf = C2.Q;
-  Psf = C2.P;
-  Tsf = C2.T;
-
-  XfCO2 = C2.Xco2;
-  XfH2O = C2.Xh2o;
-  XfO2 = C2.Xo2;
-  XfSO2 = C2.Xso2;
-
-  /* Power input */
-  Wer = CTh.W;
-  CTh.T = Tsf;
-
-  /* Input coolant pressure */
-  Pec0 = IPressure.signal;
-
-  0 = if (Pec0 >= 0) then (Pec - Pec0) else (Pec - 10e5);
-
-  /* Angle at the junction pipe/membrane */
-  anglb = 2*Modelica.Math.asin(eailet/dtex);
-
-  /* Angle of the pipe exposed to the flue gases*/
-  angla = (Modelica.Constants.pi - anglb)/2;
-
-  /* Number of corresponding pipes */
-  rtube = Se/haut/(angla*dtex + lailet);
-
-  /* Chamber length*/
-  long = alpha/(1 + alpha)*rtube*(dtex + lailet)/2;
-
-  /* Chamber depth */
-  prof = 1/(1 + alpha)*rtube*(dtex + lailet)/2;
-
-  /* Coolant saturation temperature */
-  Tc = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Pec);
-
-  /* Average flue gases pressure an temperature */
-  Pmf = 0.5*(Pef + Psf);
-  Tmf = 0.5*(Tef + Tsf);
-
-  /* Flue gases density at 273.15K and 1 atm */
-  Xcor = 1/(1 - XfH2O);
-  XfH2O0 = 0;
-  XfCO20 = XfCO2*Xcor;
-  XfO20 = XfO2*Xcor;
-  XfSO20 = XfSO2*Xcor;
-  XfN20 = 1 - (XfCO20 + XfO20 + XfSO20);
-
-  rhonorm = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pnorm, Tnorm, XfCO20, XfH2O0, XfO20, XfSO20);
-
-  /* Flue gases thermodynamic properties at Tmf and Pmf */
-  if (Tmf > 973.15) then
-    c1 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Pmf, 923.15, XfCO2, XfH2O, XfO2, XfSO2);
-    c2 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Pmf, 973.15, XfCO2, XfH2O, XfO2, XfSO2);
-    condf = (Tmf - 973.15)*(c2 - c1)/50 + c2;
-  else
-    c1 = 0;
-    c2 = 0;
-    condf = ThermoSysPro.Properties.FlueGases.FlueGases_k(Pmf, Tmf, XfCO2, XfH2O, XfO2, XfSO2);
-  end if;
-
-  cpf = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pmf, Tmf, XfCO2, XfH2O, XfO2, XfSO2);
-  muf = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Pmf, Tmf, XfCO2, XfH2O, XfO2, XfSO2);
-  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pmf, Tmf, XfCO2, XfH2O, XfO2, XfSO2);
-
-  /* Ashes volume fraction */
-  fvd = FVN*rhof/rhonorm;
-
-  // Flue gases heat exchange coefficient
-  // ------------------------------------
-
-  // Convection
-
-  /* Geometry */
-  Surf = prof*long;
-  Perim = 2*(long + prof);
-  Dh = 4*Surf/Perim;
-
-  /* Reynolds number */
-  Ref = (Qf/Surf)*Dh/muf;
-
-  /* Prandtl number */
-  Prf = muf*cpf/condf;
-
-  /* Heat exchange coefficient (turbulent regime, Mac Adams correlation, pipe flow, hydraulic diameter analogy)*/
-  hc = 0.023*(Ref^0.8)*(Prf^0.4)*condf/Dh;
-
-  // Radiation
-
-  /* Gas volume */
-  volumg = Dh*long*prof;
-
-  /* Total surface of the gase envelope */
-  senveng = 2*Dh*long + 2*Dh*prof + 2*long*prof;
-
-  /* Average optical raius between the pipes */
-  rop = 3.6*volumg/senveng;
-
-  /* Mixture molar mass */
-  Masmol = XfCO2/44 + XfO2/32 + XfSO2/64 + XfH2O/18 + XfN2/28;
-
-  /* CO2 partial pressure*/
-  PCO2R = XfCO2/44/Masmol*Pef;
-
-  /* H2O partial pressure */
-  PH2OR = XfH2O/18/Masmol*Pef;
-
-  /* Gas emissivity */
-  (EG,ES,emigaz0) = ThermoSysPro.Properties.FlueGases.FlueGases_Absorb(PCO2R, PH2OR, fvd, rop, Tmf);
-
-  if (emigaz0 < 0.0001) then
-    emigaz = 0.0001;
-  elseif (emigaz0 > 1) then
-    emigaz = 0.99;
-  else
-    emigaz = emigaz0;
-  end if;
-
-  /* Heat exchange coefficient (take into account the CO2 and H2O radiation) */
-  hr = 5.68e-8/(1/emigaz + (1 - emimur)/emimur)*(Tmf^2 + Ts^2)*(Tmf + Ts);
-
-  /* Global heat exchange coefficient */
-  hf = hc + hr;
-
-  // Pressure losses
-  //----------------
-
-  rugos = 0.15e-3;
-
-  /* Dynamic pressure losses */
-
-  /* Friction pressure losses coefficient */
-  if (Ref < 2000) then
-    /* Laminar regime */
-    bb = 0;
-    kfrot = 64/Ref;
-  else
-    /* Turburlent regime */
-    bb = (13/Ref + rugos/3.7/Dh);
-    kfrot = 0.25*Modelica.Math.log10(bb)^(-2);
-  end if;
-
-  /* Friction pressure losses */
-  dpd = kfrot*haut*(Qf^2)/(2*(Surf^2)*Dh*rhof);
-
-  /* Static pressure losses */
-  dps = rhof*Modelica.Constants.g_n*haut;
-
-  /* Total pressure losses */
-  Pdf = dpd + dps;
-
-  // Global heat exchange coefficient between the flue gaases and the coolant
-  //-------------------------------------------------------------------------
-
-  /* Thermal resistance for a half (pipe + membrane) */
-  if (hf <= 0) then
-    R1 = 0;
-    R4 = 0;
-    Rb1 = 0;
-  else
-    R1 = 1/(hf*angla*dtex/2*haut);
-    R4 = 1/(hf*lailet/2*haut);
-    Rb1 = 1/(hf*(lailet + dtex)/2*haut);
-  end if;
-
-  R3 = 1/(hi*angla*dtin/2*haut);
-  R8 = 1/(hi*anglb*dtin/2*haut);
-  R9 = R3;
-  R2= Modelica.Math.log(dtex/dtin)/(condt*angla*haut);
-  R5 = lailet/4/(eailet*condm*haut);
-  R6 = Modelica.Math.log(dtex/(dtin + (dtex - dtin)/2))/(condt*anglb*haut);
-  R7 = Modelica.Math.log((dtin + (dtex - dtin)/2)/dtin)/(condt*anglb*haut);
-  R10 = angla/4*(dtin + dtex)/(dtex - dtin)/(condt*haut);
-  Rb2 = ebeton/(condb*(lailet + dtex)/2*haut);
-
-  R01 = rencrc/(angla*dtin/2*haut);
-  R02 = rencrc/(anglb*dtin/2*haut);
-  R03 = rencrf/(angla*dtex/2*haut);
-  R04 = rencrf/(lailet/2*haut);
-  R05 = rencrf/((angla*dtex/2 + lailet/2)*haut);
-
-  R789=1/(1/(R7+R8+R02)+1/(R9+R10+R01));
-
-  /* Equivalent thermal resistance and global heat exchange coefficient per external surface unit */
-  if (ebeton <= 0) then
-    /* No concrete surface */
-    Rt = 1/(1/(R1 + R03 + R2 + R3 + R01) + 1/(R4 + R04 + R5 + R6 + R789));
-    U = 1/((angla*dtex/2 + lailet/2)*haut*Rt);
-    Se = rtube*(angla*dtex + lailet)*haut;
-  else
-    /* Existence of a concrete surface */
-    Rt = (1/(1/(R3 + R2 + R01) + 1/(R5 + R6 + R789))) + Rb1 + Rb2 + R05;
-    U = 1/((lailet + dtex)/2*haut*Rt);
-    Set = rtube*(dtex + lailet)*haut;
-  end if;
-
-  /* Gas velocity */
-  vit = Qf/(long*prof*rhof);
-
-  /* Tempretaure at the outlet */
-  Tsf = Tef - (Wech - Wer)/(Qf*cpf);
-
-  /* Power exchanged */
-  U*Set*(Tsf - Tef)/Modelica.Math.log((Tsf - Tc)/(Tef - Tc)) = Wech - Wer;
-
-  /* External surface temperature on the flue gases side*/
-  Ts = Tmf - ((Wech - Wer)/hf/Set);
-
-  /* Fin temperature */
-  Tpet = Ts - ((Wech - Wer)*rencrf/Set);
-
-  /* Pressure */
-  Psf + Pdf = Pef;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,100},{80,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-80,100},{-74,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-44,100},{-36,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{36,100},{44,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,100},{4,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{74,100},{80,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid)}),
-                                       Icon(graphics={
-        Rectangle(
-          extent={{-80,100},{80,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-80,100},{-74,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-44,100},{-36,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{36,100},{44,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,100},{4,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{74,100},{80,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-2,118},{34,94}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGasesChamberEvaporator;
+within ThermoSysPro.FlueGases.HeatExchangers;
+model FlueGasesChamberEvaporator "Flue gases chamber  for water evaporation"
+  parameter Units.SI.Area Se=400 "Heat exchange surface on the flue gases side";
+  parameter Units.SI.Length rugosi=1e-5 "Pipe roughness";
+  parameter Real rencrf=0.1
+    "Fouling resistance on the flue gases side (m².K/m)";
+  parameter Real rencrc=0.1 "Fouling resistance on the coolant side (m².K/m)";
+  parameter Real FVN=0 "Ashes volume fraction";
+  parameter Units.SI.Height haut=15 "Flux wall height";
+  parameter Real alpha=1 "Chamber width/depth ratio";
+  parameter Units.SI.Diameter dtex=0.06 "Pipe external diameter";
+  parameter Units.SI.Diameter dtin=0.05 "Pipe internal diameter";
+  parameter Units.SI.Length lailet=0.05 "Membrane length";
+  parameter Units.SI.Length eailet=0.001 "Membrane thickness";
+  parameter Units.SI.Length ebeton=0.01 "Concrete thickness";
+  parameter Units.SI.ThermalConductivity condt=10 "Pipes thermal conductivity";
+  parameter Units.SI.ThermalConductivity condm=10
+    "Membrane thermal conductivity";
+  parameter Units.SI.ThermalConductivity condb=10
+    "Concret thermal conductivity";
+  parameter Real emimur=0.1 "Walls emissitivity";
+  parameter Units.SI.CoefficientOfHeatTransfer hi=10000
+    "Coolant heat exchange coefficient";
+
+protected
+  Units.SI.ThermalConductivity c1(start=0.1)
+    "Variable for the computation of the flue gases thermal conductivity";
+  Units.SI.ThermalConductivity c2(start=0.1)
+    "Variable for the computation of the flue gases thermal conductivity";
+  Real bb(start=0.1e-5)
+    "Variable for the computation of the friction coefficient";
+
+public
+  Units.SI.Temperature Tef(start=800) "Flue gases temperature at the inlet";
+  Units.SI.Temperature Tsf(start=800) "Flue gases temperature at the outlet";
+  Units.SI.AbsolutePressure Pef(start=1e5) "Flue gases pressure at the inlet";
+  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
+  Units.SI.MassFlowRate Qf(start=10) "Flue gases mass flow rate";
+  Real XfCO2(start=0.1) "CO2 mass fraction";
+  Real XfH2O(start=0.1) "H2O mass fraction";
+  Real XfO2(start=0.1) "O2 mass fraction";
+  Real XfN2(start=0.1) "N2 mass fraction";
+  Real XfSO2(start=0.6) "SO2 mass fraction";
+  Units.SI.Power Wer(start=10e5) "Radiation power received";
+  Units.SI.Power Wech(start=1e6) "Power exchanged";
+  Units.SI.Temperature Ts(start=600)
+    "Average surface temperature on the flue gases side";
+  Units.SI.Temperature Tpet(start=600) "Average external fin wall temperature";
+  Units.SI.AbsolutePressure Pec0(start=1e5) "Coolant pressure";
+  Units.SI.AbsolutePressure Pec(start=1e5) "Coolant pressure";
+  Units.SI.Angle anglb(start=1.5)
+    "Angle of the junction between the pipe and the membrane";
+  Units.SI.Angle angla(start=1.5) "Angle of the pipe exposed to the flue gases";
+  Real rtube(start=100) "Number of coressponding pipes";
+  Units.SI.Length long(start=100) "Chamber length";
+  Units.SI.Length prof(start=10) "Chamber depth";
+  Units.SI.Temperature Tc(start=800) "Coolant saturation temperature";
+  Units.SI.AbsolutePressure Pmf(start=1e5) "Flue gases average pressure";
+  Units.SI.Temperature Tmf(start=800) "Flue gases average temperature";
+  Real Xcor(start=0.1)
+    "Corrective coefficient for the flue gases mass fractions";
+  Real XfH2O0(start=0.1) "H2O corrected mass fraction";
+  Real XfCO20(start=0.1) "CO2 corrected mass fraction";
+  Real XfO20(start=0.1) "O2 corrected mass fraction";
+  Real XfSO20(start=0.1) "SO2 corrected mass fraction";
+  Real XfN20(start=0.1) "N2 corrected mass fraction";
+  constant Units.SI.AbsolutePressure Pnorm=1.01325e5 "Normal pressure";
+  constant Units.SI.Temperature Tnorm=273.15 "Normal temperature";
+  Units.SI.Density rhonorm(start=100) "Flue gases density at (Pnorm,Tnorm)";
+  Units.SI.ThermalConductivity condf(start=100)
+    "Flue gases thermal conductivity";
+  Units.SI.SpecificHeatCapacity cpf(start=1000)
+    "Flue gases specific heat capacity";
+  Units.SI.DynamicViscosity muf(start=1e-5) "Flue gases dynamic viscosity";
+  Units.SI.Density rhof(start=100) "Flue gases density";
+  Real fvd(start=0.5) "Ashes volume fraction";
+  Units.SI.Area Surf(start=50) "Flue gases cross-sectional area";
+  Units.SI.Length Perim(start=50) "Chamber perimeter";
+  Units.SI.Diameter Dh(start=50) "Chamber hydraulic diameter";
+  Real Ref(start=10000) "Reynolds number";
+  Real Prf(start=1) "Prandtl number";
+  Units.SI.CoefficientOfHeatTransfer hc(start=1)
+    "Convection heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer hr(start=50)
+    "Radiation heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer hf(start=50)
+    "Global heat exchange coefficient";
+  Units.SI.Volume volumg(start=500) "Gas volume";
+  Units.SI.Area senveng(start=500) "Gas envelope surface";
+  Units.SI.Length rop(start=5) "Average optical radius between the pipes";
+  Real Masmol(start=0.1) "Mixture molar mass";
+  Units.SI.AbsolutePressure PCO2R(start=0.5e5) "CO2 partial pressure";
+  Units.SI.AbsolutePressure PH2OR(start=0.5e5) "H2O partial pressure";
+  Real EG(start=0.5);
+  Real ES(start=0.5);
+  Real emigaz(start=0.5) "Gases emissivity";
+  Real emigaz0(start=0.5) "Gases emissivity";
+  Real rugos(start=0.1e-5) "Pipe roughness on the flue gases side";
+  Real kfrot(start=0.05) "Pressure losses friction coefficient";
+  ThermoSysPro.Units.SI.PressureDifference dpd(start=1000)
+    "Dynamical pressure losses";
+  ThermoSysPro.Units.SI.PressureDifference dps(start=1000)
+    "Static pressure losses";
+  ThermoSysPro.Units.SI.PressureDifference Pdf(start=1000)
+    "Total pressure losses";
+  Real R1(start=0.1) "Thermal resistance";
+  Real R2(start=0.1) "Thermal resistance";
+  Real R3(start=0.1) "Thermal resistance";
+  Real R4(start=0.1) "Thermal resistance";
+  Real R5(start=0.1) "Thermal resistance";
+  Real R6(start=0.1) "Thermal resistance";
+  Real R7(start=0.1) "Thermal resistance";
+  Real R8(start=0.1) "Thermal resistance";
+  Real R9(start=0.1) "Thermal resistance";
+  Real R10(start=0.1) "Thermal resistance";
+  Real R789(start=0.1) "Thermal resistance";
+  Real R01(start=0.1) "Fouling resistance";
+  Real R02(start=0.1) "Fouling resistance";
+  Real R03(start=0.1) "Fouling resistance";
+  Real R04(start=0.1) "Fouling resistance";
+  Real R05(start=0.1) "Fouling resistancet";
+  Real Rb1(start=0.1) "Concrete surface thermal resistance";
+  Real Rb2(start=0.1) "Concrete surface thermal resistance";
+  Real Rt(start=0.1) "Total surface thermal resistance (K/W)";
+  Real U(start=50)
+    "Global heat exchange coefficient per external surface unit (W/m²/K)";
+  Units.SI.Area Set(start=500) "Total external surface";
+  Units.SI.Velocity vit(start=1) "Gases veolicity";
+
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
+    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    "Water/steam pressure"
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+equation
+  /* Flue gases inlet */
+  Qf = C1.Q;
+  Pef = C1.P;
+  Tef = C1.T;
+
+  XfCO2 = C1.Xco2;
+  XfH2O = C1.Xh2o;
+  XfO2 = C1.Xo2;
+  XfN2 = 1 - XfCO2 - XfH2O - XfO2 - XfSO2;
+  XfSO2 = C1.Xso2;
+
+  /* Flue gases outlet */
+  Qf = C2.Q;
+  Psf = C2.P;
+  Tsf = C2.T;
+
+  XfCO2 = C2.Xco2;
+  XfH2O = C2.Xh2o;
+  XfO2 = C2.Xo2;
+  XfSO2 = C2.Xso2;
+
+  /* Power input */
+  Wer = CTh.W;
+  CTh.T = Tsf;
+
+  /* Input coolant pressure */
+  Pec0 = IPressure.signal;
+
+  0 = if (Pec0 >= 0) then (Pec - Pec0) else (Pec - 10e5);
+
+  /* Angle at the junction pipe/membrane */
+  anglb = 2*Modelica.Math.asin(eailet/dtex);
+
+  /* Angle of the pipe exposed to the flue gases*/
+  angla = (Modelica.Constants.pi - anglb)/2;
+
+  /* Number of corresponding pipes */
+  rtube = Se/haut/(angla*dtex + lailet);
+
+  /* Chamber length*/
+  long = alpha/(1 + alpha)*rtube*(dtex + lailet)/2;
+
+  /* Chamber depth */
+  prof = 1/(1 + alpha)*rtube*(dtex + lailet)/2;
+
+  /* Coolant saturation temperature */
+  Tc = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Pec);
+
+  /* Average flue gases pressure an temperature */
+  Pmf = 0.5*(Pef + Psf);
+  Tmf = 0.5*(Tef + Tsf);
+
+  /* Flue gases density at 273.15K and 1 atm */
+  Xcor = 1/(1 - XfH2O);
+  XfH2O0 = 0;
+  XfCO20 = XfCO2*Xcor;
+  XfO20 = XfO2*Xcor;
+  XfSO20 = XfSO2*Xcor;
+  XfN20 = 1 - (XfCO20 + XfO20 + XfSO20);
+
+  rhonorm = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pnorm, Tnorm, XfCO20, XfH2O0, XfO20, XfSO20);
+
+  /* Flue gases thermodynamic properties at Tmf and Pmf */
+  if (Tmf > 973.15) then
+    c1 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Pmf, 923.15, XfCO2, XfH2O, XfO2, XfSO2);
+    c2 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Pmf, 973.15, XfCO2, XfH2O, XfO2, XfSO2);
+    condf = (Tmf - 973.15)*(c2 - c1)/50 + c2;
+  else
+    c1 = 0;
+    c2 = 0;
+    condf = ThermoSysPro.Properties.FlueGases.FlueGases_k(Pmf, Tmf, XfCO2, XfH2O, XfO2, XfSO2);
+  end if;
+
+  cpf = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pmf, Tmf, XfCO2, XfH2O, XfO2, XfSO2);
+  muf = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Pmf, Tmf, XfCO2, XfH2O, XfO2, XfSO2);
+  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pmf, Tmf, XfCO2, XfH2O, XfO2, XfSO2);
+
+  /* Ashes volume fraction */
+  fvd = FVN*rhof/rhonorm;
+
+  // Flue gases heat exchange coefficient
+  // ------------------------------------
+
+  // Convection
+
+  /* Geometry */
+  Surf = prof*long;
+  Perim = 2*(long + prof);
+  Dh = 4*Surf/Perim;
+
+  /* Reynolds number */
+  Ref = (Qf/Surf)*Dh/muf;
+
+  /* Prandtl number */
+  Prf = muf*cpf/condf;
+
+  /* Heat exchange coefficient (turbulent regime, Mac Adams correlation, pipe flow, hydraulic diameter analogy)*/
+  hc = 0.023*(Ref^0.8)*(Prf^0.4)*condf/Dh;
+
+  // Radiation
+
+  /* Gas volume */
+  volumg = Dh*long*prof;
+
+  /* Total surface of the gase envelope */
+  senveng = 2*Dh*long + 2*Dh*prof + 2*long*prof;
+
+  /* Average optical raius between the pipes */
+  rop = 3.6*volumg/senveng;
+
+  /* Mixture molar mass */
+  Masmol = XfCO2/44 + XfO2/32 + XfSO2/64 + XfH2O/18 + XfN2/28;
+
+  /* CO2 partial pressure*/
+  PCO2R = XfCO2/44/Masmol*Pef;
+
+  /* H2O partial pressure */
+  PH2OR = XfH2O/18/Masmol*Pef;
+
+  /* Gas emissivity */
+  (EG,ES,emigaz0) = ThermoSysPro.Properties.FlueGases.FlueGases_Absorb(PCO2R, PH2OR, fvd, rop, Tmf);
+
+  if (emigaz0 < 0.0001) then
+    emigaz = 0.0001;
+  elseif (emigaz0 > 1) then
+    emigaz = 0.99;
+  else
+    emigaz = emigaz0;
+  end if;
+
+  /* Heat exchange coefficient (take into account the CO2 and H2O radiation) */
+  hr = 5.68e-8/(1/emigaz + (1 - emimur)/emimur)*(Tmf^2 + Ts^2)*(Tmf + Ts);
+
+  /* Global heat exchange coefficient */
+  hf = hc + hr;
+
+  // Pressure losses
+  //----------------
+
+  rugos = 0.15e-3;
+
+  /* Dynamic pressure losses */
+
+  /* Friction pressure losses coefficient */
+  if (Ref < 2000) then
+    /* Laminar regime */
+    bb = 0;
+    kfrot = 64/Ref;
+  else
+    /* Turburlent regime */
+    bb = (13/Ref + rugos/3.7/Dh);
+    kfrot = 0.25*Modelica.Math.log10(bb)^(-2);
+  end if;
+
+  /* Friction pressure losses */
+  dpd = kfrot*haut*(Qf^2)/(2*(Surf^2)*Dh*rhof);
+
+  /* Static pressure losses */
+  dps = rhof*Modelica.Constants.g_n*haut;
+
+  /* Total pressure losses */
+  Pdf = dpd + dps;
+
+  // Global heat exchange coefficient between the flue gaases and the coolant
+  //-------------------------------------------------------------------------
+
+  /* Thermal resistance for a half (pipe + membrane) */
+  if (hf <= 0) then
+    R1 = 0;
+    R4 = 0;
+    Rb1 = 0;
+  else
+    R1 = 1/(hf*angla*dtex/2*haut);
+    R4 = 1/(hf*lailet/2*haut);
+    Rb1 = 1/(hf*(lailet + dtex)/2*haut);
+  end if;
+
+  R3 = 1/(hi*angla*dtin/2*haut);
+  R8 = 1/(hi*anglb*dtin/2*haut);
+  R9 = R3;
+  R2= Modelica.Math.log(dtex/dtin)/(condt*angla*haut);
+  R5 = lailet/4/(eailet*condm*haut);
+  R6 = Modelica.Math.log(dtex/(dtin + (dtex - dtin)/2))/(condt*anglb*haut);
+  R7 = Modelica.Math.log((dtin + (dtex - dtin)/2)/dtin)/(condt*anglb*haut);
+  R10 = angla/4*(dtin + dtex)/(dtex - dtin)/(condt*haut);
+  Rb2 = ebeton/(condb*(lailet + dtex)/2*haut);
+
+  R01 = rencrc/(angla*dtin/2*haut);
+  R02 = rencrc/(anglb*dtin/2*haut);
+  R03 = rencrf/(angla*dtex/2*haut);
+  R04 = rencrf/(lailet/2*haut);
+  R05 = rencrf/((angla*dtex/2 + lailet/2)*haut);
+
+  R789=1/(1/(R7+R8+R02)+1/(R9+R10+R01));
+
+  /* Equivalent thermal resistance and global heat exchange coefficient per external surface unit */
+  if (ebeton <= 0) then
+    /* No concrete surface */
+    Rt = 1/(1/(R1 + R03 + R2 + R3 + R01) + 1/(R4 + R04 + R5 + R6 + R789));
+    U = 1/((angla*dtex/2 + lailet/2)*haut*Rt);
+    Se = rtube*(angla*dtex + lailet)*haut;
+  else
+    /* Existence of a concrete surface */
+    Rt = (1/(1/(R3 + R2 + R01) + 1/(R5 + R6 + R789))) + Rb1 + Rb2 + R05;
+    U = 1/((lailet + dtex)/2*haut*Rt);
+    Set = rtube*(dtex + lailet)*haut;
+  end if;
+
+  /* Gas velocity */
+  vit = Qf/(long*prof*rhof);
+
+  /* Tempretaure at the outlet */
+  Tsf = Tef - (Wech - Wer)/(Qf*cpf);
+
+  /* Power exchanged */
+  U*Set*(Tsf - Tef)/Modelica.Math.log((Tsf - Tc)/(Tef - Tc)) = Wech - Wer;
+
+  /* External surface temperature on the flue gases side*/
+  Ts = Tmf - ((Wech - Wer)/hf/Set);
+
+  /* Fin temperature */
+  Tpet = Ts - ((Wech - Wer)*rencrf/Set);
+
+  /* Pressure */
+  Psf + Pdf = Pef;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,100},{80,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-80,100},{-74,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-44,100},{-36,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{36,100},{44,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,100},{4,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{74,100},{80,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid)}),
+                                       Icon(graphics={
+        Rectangle(
+          extent={{-80,100},{80,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-80,100},{-74,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-44,100},{-36,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{36,100},{44,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,100},{4,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{74,100},{80,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-2,118},{34,94}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGasesChamberEvaporator;
diff --git a/ThermoSysPro/FlueGases/HeatExchangers/StaticFluegasesFluegasesExchangerKS.mo b/ThermoSysPro/FlueGases/HeatExchangers/StaticFluegasesFluegasesExchangerKS.mo
index 2a121cce66aff914d9aa0eb07fd322626e5fe496..b11df59d8e6fc825edbf9d123cc00af6cb237aaf 100644
--- a/ThermoSysPro/FlueGases/HeatExchangers/StaticFluegasesFluegasesExchangerKS.mo
+++ b/ThermoSysPro/FlueGases/HeatExchangers/StaticFluegasesFluegasesExchangerKS.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro.FlueGases.HeatExchangers;
-model StaticFluegasesFluegasesExchangerKS
-  "Static flue gases/flue gases heat exchanger with fixed K and S"
-  parameter Units.SI.CoefficientOfHeatTransfer K=100
-    "Global heat exchange coefficient";
-  parameter Units.SI.Area S=10 "Heat exchange surface";
-  parameter Real DPc= 0.1
-    "Pressure losses in the hot fluid as a percent of the pressure at the inlet";
-  parameter Real DPf= 0.1
-    "Pressure losses in the cold fluid as a percent of the pressure at the inlet";
-
-public
-  Units.SI.Power W "Power exchanged";
-  Units.SI.Temperature Tec(start=400)
-    "Temperature of the hot fluid at the inlet";
-  Units.SI.Temperature Tsc(start=300)
-    "Temperature of the hot fluid at the outlet";
-  Units.SI.Temperature Tef(start=300)
-    "Temperature of the cold fluid at the inlet";
-  Units.SI.Temperature Tsf(start=400)
-    "Temperature of the cold fluid at the outlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DT1 "Delta T at the inlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DT2 "Delta T at the outlet";
-  Units.SI.SpecificHeatCapacity Cpf "Specific heat capacity of the cold fluid";
-  Units.SI.SpecificHeatCapacity Cpc "Specific heat capacity of the hot fluid";
-  Units.SI.MassFlowRate Qc(start=100) "Mass flow rate of the hot fluid";
-  Units.SI.MassFlowRate Qf(start=100) "Mass flow rate of the cold fluid";
-  Real Kcor "Corrective term for the global heat exchange coefficient";
-
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Sc
-    annotation (Placement(transformation(extent={{50,-70},{70,-50}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ec
-    annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ef
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Sf
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal Kcorr "K_correction"
-    annotation (Placement(transformation(
-        origin={0,70},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-equation
-
-  if (cardinality(Kcorr) == 0) then
-    Kcorr.signal = 1;
-  end if;
-
-  Kcor = Kcorr.signal;
-
-  /* Flue gases temperature at both ends of the exchanger */
-  Tec = Ec.T;
-  Tsc = Sc.T;
-  Tef = Ef.T;
-  Tsf = Sf.T;
-
-  /* Flue gases mass flow rates at both ends of the exchanger */
-  Qc = Ec.Q;
-  Qf = Ef.Q;
-  Sc.Q = Ec.Q;
-  Sf.Q = Ef.Q;
-
-  /* Hot flue gases composition */
-  Sc.Xco2 = Ec.Xco2;
-  Sc.Xh2o = Ec.Xh2o;
-  Sc.Xo2 = Ec.Xo2;
-  Sc.Xso2 = Ec.Xso2;
-
-  /* Cold flue gases composition */
-  Sf.Xco2 = Ef.Xco2;
-  Sf.Xh2o = Ef.Xh2o;
-  Sf.Xo2 = Ef.Xo2;
-  Sf.Xso2 = Ef.Xso2;
-
-  /* Presure losses */
-  Sc.P = if (Qc > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
-  Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100;
-
- /* Hypothesis : counter-current exchanger */
-  DT1 = Tec - Tsf;
-  DT2 = Tsc - Tef;
-  DT2 = DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) - 1/(Qf*Cpf)));
-
-  /* Power exchanged */
-  W = Qc*Cpc*(Tec-Tsc);
-  W = Qf*Cpf*(Tsf-Tef);
-
- /* Average specific heat capacities */
-  Cpf = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Ef.P, (Tef + Tsf)/2, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-  Cpc = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Ec.P, (Tec + Tsc)/2, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=true,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StaticFluegasesFluegasesExchangerKS;
+within ThermoSysPro.FlueGases.HeatExchangers;
+model StaticFluegasesFluegasesExchangerKS
+  "Static flue gases/flue gases heat exchanger with fixed K and S"
+  parameter Units.SI.CoefficientOfHeatTransfer K=100
+    "Global heat exchange coefficient";
+  parameter Units.SI.Area S=10 "Heat exchange surface";
+  parameter Real DPc= 0.1
+    "Pressure losses in the hot fluid as a percent of the pressure at the inlet";
+  parameter Real DPf= 0.1
+    "Pressure losses in the cold fluid as a percent of the pressure at the inlet";
+
+public
+  Units.SI.Power W "Power exchanged";
+  Units.SI.Temperature Tec(start=400)
+    "Temperature of the hot fluid at the inlet";
+  Units.SI.Temperature Tsc(start=300)
+    "Temperature of the hot fluid at the outlet";
+  Units.SI.Temperature Tef(start=300)
+    "Temperature of the cold fluid at the inlet";
+  Units.SI.Temperature Tsf(start=400)
+    "Temperature of the cold fluid at the outlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DT1 "Delta T at the inlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DT2 "Delta T at the outlet";
+  Units.SI.SpecificHeatCapacity Cpf "Specific heat capacity of the cold fluid";
+  Units.SI.SpecificHeatCapacity Cpc "Specific heat capacity of the hot fluid";
+  Units.SI.MassFlowRate Qc(start=100) "Mass flow rate of the hot fluid";
+  Units.SI.MassFlowRate Qf(start=100) "Mass flow rate of the cold fluid";
+  Real Kcor "Corrective term for the global heat exchange coefficient";
+
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Sc
+    annotation (Placement(transformation(extent={{50,-70},{70,-50}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ec
+    annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ef
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Sf
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal Kcorr "K_correction"
+    annotation (Placement(transformation(
+        origin={0,70},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+equation
+
+  if (cardinality(Kcorr) == 0) then
+    Kcorr.signal = 1;
+  end if;
+
+  Kcor = Kcorr.signal;
+
+  /* Flue gases temperature at both ends of the exchanger */
+  Tec = Ec.T;
+  Tsc = Sc.T;
+  Tef = Ef.T;
+  Tsf = Sf.T;
+
+  /* Flue gases mass flow rates at both ends of the exchanger */
+  Qc = Ec.Q;
+  Qf = Ef.Q;
+  Sc.Q = Ec.Q;
+  Sf.Q = Ef.Q;
+
+  /* Hot flue gases composition */
+  Sc.Xco2 = Ec.Xco2;
+  Sc.Xh2o = Ec.Xh2o;
+  Sc.Xo2 = Ec.Xo2;
+  Sc.Xso2 = Ec.Xso2;
+
+  /* Cold flue gases composition */
+  Sf.Xco2 = Ef.Xco2;
+  Sf.Xh2o = Ef.Xh2o;
+  Sf.Xo2 = Ef.Xo2;
+  Sf.Xso2 = Ef.Xso2;
+
+  /* Presure losses */
+  Sc.P = if (Qc > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
+  Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100;
+
+ /* Hypothesis : counter-current exchanger */
+  DT1 = Tec - Tsf;
+  DT2 = Tsc - Tef;
+  DT2 = DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) - 1/(Qf*Cpf)));
+
+  /* Power exchanged */
+  W = Qc*Cpc*(Tec-Tsc);
+  W = Qf*Cpf*(Tsf-Tef);
+
+ /* Average specific heat capacities */
+  Cpf = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Ef.P, (Tef + Tsf)/2, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+  Cpc = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Ec.P, (Tec + Tsc)/2, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=true,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StaticFluegasesFluegasesExchangerKS;
diff --git a/ThermoSysPro/FlueGases/HeatExchangers/StaticWallFlueGasesExchanger.mo b/ThermoSysPro/FlueGases/HeatExchangers/StaticWallFlueGasesExchanger.mo
index 1b206f6f482a1a3d78b2159e76010508d5c76880..e966419545f91595d6b80e953d7fa5846c556d15 100644
--- a/ThermoSysPro/FlueGases/HeatExchangers/StaticWallFlueGasesExchanger.mo
+++ b/ThermoSysPro/FlueGases/HeatExchangers/StaticWallFlueGasesExchanger.mo
@@ -1,222 +1,222 @@
-within ThermoSysPro.FlueGases.HeatExchangers;
-model StaticWallFlueGasesExchanger "Static wall/flue gases exchanger"
-  parameter Integer Ns=1 "Number of segments";
-  parameter Integer NbTub=100 "Number of pipes";
-  parameter Real DPc=0 "Pressure loss coefficient";
-  parameter Units.SI.Length L=2 "Exchanger length";
-  parameter Units.SI.Diameter Dext=0.022 "External pipe diameter";
-  parameter Units.SI.PathLength step_L=0.033 "Longitudinal length step";
-  parameter Units.SI.PathLength step_T=0.066 "Transverse length step";
-  parameter Units.SI.Area St=100 "Cross-sectional area";
-  parameter Units.SI.Area Surf_ext=pi*Dext*Ls*NbTub*CSailettes
-    "Heat exchange surface for one section";
-  parameter Real Encras=1.00 "Corrective term for the heat exchange coefficient";
-  parameter Real Fa=0.7 "Fouling factor (0.3 - 1.1)";
-  parameter Units.SI.MassFlowRate Qmin=1e-3 "Minimum flue gases mass flow rate";
-  parameter Integer exchanger_type=1
-    "Exchanger type - 1:crossed flux - 2:longitudinal flux";
-  parameter Units.SI.Temperature Tp0=500
-    "Wall temperature (active if the thermal connector is not connected)";
-  parameter Real CSailettes=1
-    "Increase factor of the heat exchange surface to to the fins";
-  parameter Real Coeff=1 "Corrective coeffeicient";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-
-protected
-  parameter Real eps=1.e-1
-    "Small number for the computation of the pressure losses";
-  constant Real Mco2=44.009 "CO2 molar mass";
-  constant Real Mh2o=18.0148 "H2O molar mass";
-  constant Real Mo2=31.998 "O2 molar mass";
-  constant Real Mn2=28.014 "N2 molar mass";
-  constant Real Mso2=64.063 "SO2 molar mass";
-  constant Real pi=Modelica.Constants.pi;
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Units.SI.PathLength Ls=L/Ns "Section length";
-  parameter Units.SI.Area Surf_tot=Ns*Surf_ext "Total heat exchange surface";
-  parameter Units.SI.Area Sgaz=St*(1 - Dext/step_T) "Geometrical parameter";
-  parameter Real PasLD=step_L/Dext "Geometrical parameter";
-  parameter Real PasTD=step_T/Dext "Geometrical parameter";
-  parameter Real Optl=ThermoSysPro.Correlations.Misc.WBCorrectiveDiameterCoefficient(PasTD,PasLD,Dext)
-    "Geometrical parameter";
-  parameter Units.SI.Length Deq=4*Sgaz/Perb
-    "Equivalent diameter for longitudinal flux";
-  parameter Units.SI.Length Perb=Surf_ext/Ls "Geometrical parameter";
-  parameter Units.SI.CoefficientOfHeatTransfer Kdef=50
-    "Heat exchange coefficient in case of zero flow";
-
-public
-  Units.SI.Density rho(start=1) "Flue gases density";
-  Units.SI.Temperature T[Ns + 1](start=fill(900, Ns + 1))
-    "Flue gases temperature at the inlet of section i";
-  Units.SI.Temperature Tm[Ns](start=fill(900, Ns))
-    "Average flue gases temperature in section i";
-  Units.SI.SpecificEnthalpy h[Ns + 1](start=fill(1e6, Ns + 1))
-    "Flue gases specific enthalpy at the inlet of section i";
-  Units.SI.Temperature Tp[Ns](start=fill(500, Ns)) "Wall temperature";
-  Units.SI.AbsolutePressure Pe(start=1e5)
-    "Flue gases partial pressure at the inlet";
-  Units.SI.AbsolutePressure Pco2 "CO2 partial pressure";
-  Units.SI.AbsolutePressure Ph2o "H2O partial pressure";
-  Real Xh2o "H2O mass fraction";
-  Real Xco2 "CO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-  Real Xvh2o "H2O volume fraction";
-  Real Xvco2 "CO2 volume fraction";
-  Real Xvo2 "O2 volume fraction";
-  Real Xvn2 "N2 volume fraction";
-  Real Xvso2 "SO2 volume fraction";
-  Units.SI.MassFlowRate Q(start=1) "Flue gases mass flow rate";
-  Units.SI.CoefficientOfHeatTransfer K(start=0)
-    "Total heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer Kc(start=0)
-    "Convective heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer Kr(start=0)
-    "Radiative heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer Kcc[Ns](start=fill(0, Ns))
-    "Intermedaite variable for the computation of the convective heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer Krr[Ns](start=fill(0, Ns))
-    "Intermedaite variable for the computation of the radiative heat exchange coefficient";
-  Units.SI.Power dW[Ns](start=fill(0, Ns))
-    "Power exchange between the wall and the fluid in each section";
-  Units.SI.Power W(start=0) "Total power exchanged";
-  ThermoSysPro.Units.SI.TemperatureDifference DeltaT[Ns](start=fill(50, Ns))
-    "Temperature difference between the fluid and the wall";
-  Units.SI.Temperature TFilm[Ns] "Film temperature";
-  Real Mmt "Total flue gases molar mass";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  /* Wall boundary */
-  CTh.W = -dW;
-  CTh.T = Tp;
-
-  /* Pipe boundaries */
-  C2.Q = C1.Q;
-
-  Xh2o = C1.Xh2o;
-  Xco2 = C1.Xco2;
-
-  T[1] = C1.T;
-  T[Ns+1] = C2.T;
-
-  Pe = C1.P;
-  Q = C1.Q;
-
-  /* Flue gases composition */
-  C2.Xco2 = C1.Xco2;
-  C2.Xh2o = C1.Xh2o;
-  C2.Xo2 = C1.Xo2;
-  C2.Xso2 = C1.Xso2;
-  Xn2 = 1 - C1.Xco2 - C1.Xh2o - C1.Xo2 - C1.Xso2;
-
-  /* Volume fractions */
-  Xvco2 = (C1.Xco2/Mco2)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
-  Xvh2o = (C1.Xh2o/Mh2o)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
-  Xvo2 = (C1.Xo2/Mo2)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
-  Xvn2 = (Xn2/Mn2)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
-  Xvso2 = (C1.Xso2/Mso2)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
-
-  /* Total molar mass */
-  Mmt = Xvco2*Mco2 + Xvh2o*Mh2o + Xvo2*Mo2 + Xvn2*Mn2 + Xvso2*Mso2;
-
-  /* Partial gas pressures */
-  Ph2o = Pe*Xh2o*Mmt/Mh2o;
-  Pco2 = Pe*Xco2*Mmt/Mco2;
-
-  /* Pressure losses */
-  Pe - C2.P = DPc*ThermoSysPro.Functions.ThermoSquare(Q,eps)/rho;
-
-  /* Specific enthalpy at the inlet */
-  h[1] = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, T[1], C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  for i in 1:Ns loop
-    /* Specific enthalpy at the inlet of section i */
-    h[i+1] = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, T[i + 1], C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-    /* Average temperature in section i */
-    Tm[i] = 0.5*(T[i] + T[i+1]);
-    0 = noEvent(if (abs(Q) < Qmin) then Tm[i] - Tp[i] else Q*(h[i] - h[i + 1]) - Coeff*K*(Tm[i] - Tp[i])*Surf_ext);
-
-    /* Temperature difference between the fluid and the wall */
-    DeltaT[i] = Tm[i] - Tp[i];
-
-    if (abs(Q) >= Qmin) then
-      /* Convective heat exchange coefficient */
-      if (exchanger_type == 1) then
-        /* Crossed flux */
-        Kcc[i] = ThermoSysPro.Correlations.Thermal.WBCrossedCurrentConvectiveHeatTransferCoefficient(TFilm[i], abs(Q), Xh2o*100, Sgaz, Dext, Fa);
-      else
-        /* Longitudinal flux */
-        Kcc[i] = ThermoSysPro.Correlations.Thermal.WBLongitudinalCurrentConvectiveHeatTransferCoefficient(TFilm[i], Tm[i], abs(Q), Xh2o*100, Sgaz, Deq);
-      end if;
-
-      /* Radiative heat exchange coefficient */
-      Krr[i] = ThermoSysPro.Correlations.Thermal.WBRadiativeHeatTransferCoefficient(DeltaT[i], Tp[i], Ph2o/Pe, Pco2/Pe, Optl);
-    else
-      Krr[i] = 0;
-      Kcc[i] = 0;
-    end if;
-
-    /* Film temperature */
-    TFilm[i] = 0.5*(Tm[i] + Tp[i]);
-
-    /* Power exchanged for each section */
-    dW[i] = Coeff*K*(Tm[i] - Tp[i])*Surf_ext;
-  end for;
-
-  /* Thermal exchange */
-  0 = noEvent(if (abs(Q) >= Qmin) then K - (Kc + Kr)*Encras else K - Kdef);
-
-  /* Convective and radiative heat exchange coefficients */
-  Kc = sum(Kcc)*Surf_ext/Surf_tot;
-  Kr = sum(Krr)*Surf_ext/Surf_tot;
-
-  /* Total power exchanged */
-  W = sum(dW);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pe,0.5*(T[1]+T[Ns+1]), C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-                           Icon(graphics={
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end StaticWallFlueGasesExchanger;
+within ThermoSysPro.FlueGases.HeatExchangers;
+model StaticWallFlueGasesExchanger "Static wall/flue gases exchanger"
+  parameter Integer Ns=1 "Number of segments";
+  parameter Integer NbTub=100 "Number of pipes";
+  parameter Real DPc=0 "Pressure loss coefficient";
+  parameter Units.SI.Length L=2 "Exchanger length";
+  parameter Units.SI.Diameter Dext=0.022 "External pipe diameter";
+  parameter Units.SI.PathLength step_L=0.033 "Longitudinal length step";
+  parameter Units.SI.PathLength step_T=0.066 "Transverse length step";
+  parameter Units.SI.Area St=100 "Cross-sectional area";
+  parameter Units.SI.Area Surf_ext=pi*Dext*Ls*NbTub*CSailettes
+    "Heat exchange surface for one section";
+  parameter Real Encras=1.00 "Corrective term for the heat exchange coefficient";
+  parameter Real Fa=0.7 "Fouling factor (0.3 - 1.1)";
+  parameter Units.SI.MassFlowRate Qmin=1e-3 "Minimum flue gases mass flow rate";
+  parameter Integer exchanger_type=1
+    "Exchanger type - 1:crossed flux - 2:longitudinal flux";
+  parameter Units.SI.Temperature Tp0=500
+    "Wall temperature (active if the thermal connector is not connected)";
+  parameter Real CSailettes=1
+    "Increase factor of the heat exchange surface to to the fins";
+  parameter Real Coeff=1 "Corrective coeffeicient";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+
+protected
+  parameter Real eps=1.e-1
+    "Small number for the computation of the pressure losses";
+  constant Real Mco2=44.009 "CO2 molar mass";
+  constant Real Mh2o=18.0148 "H2O molar mass";
+  constant Real Mo2=31.998 "O2 molar mass";
+  constant Real Mn2=28.014 "N2 molar mass";
+  constant Real Mso2=64.063 "SO2 molar mass";
+  constant Real pi=Modelica.Constants.pi;
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Units.SI.PathLength Ls=L/Ns "Section length";
+  parameter Units.SI.Area Surf_tot=Ns*Surf_ext "Total heat exchange surface";
+  parameter Units.SI.Area Sgaz=St*(1 - Dext/step_T) "Geometrical parameter";
+  parameter Real PasLD=step_L/Dext "Geometrical parameter";
+  parameter Real PasTD=step_T/Dext "Geometrical parameter";
+  parameter Real Optl=ThermoSysPro.Correlations.Misc.WBCorrectiveDiameterCoefficient(PasTD,PasLD,Dext)
+    "Geometrical parameter";
+  parameter Units.SI.Length Deq=4*Sgaz/Perb
+    "Equivalent diameter for longitudinal flux";
+  parameter Units.SI.Length Perb=Surf_ext/Ls "Geometrical parameter";
+  parameter Units.SI.CoefficientOfHeatTransfer Kdef=50
+    "Heat exchange coefficient in case of zero flow";
+
+public
+  Units.SI.Density rho(start=1) "Flue gases density";
+  Units.SI.Temperature T[Ns + 1](start=fill(900, Ns + 1))
+    "Flue gases temperature at the inlet of section i";
+  Units.SI.Temperature Tm[Ns](start=fill(900, Ns))
+    "Average flue gases temperature in section i";
+  Units.SI.SpecificEnthalpy h[Ns + 1](start=fill(1e6, Ns + 1))
+    "Flue gases specific enthalpy at the inlet of section i";
+  Units.SI.Temperature Tp[Ns](start=fill(500, Ns)) "Wall temperature";
+  Units.SI.AbsolutePressure Pe(start=1e5)
+    "Flue gases partial pressure at the inlet";
+  Units.SI.AbsolutePressure Pco2 "CO2 partial pressure";
+  Units.SI.AbsolutePressure Ph2o "H2O partial pressure";
+  Real Xh2o "H2O mass fraction";
+  Real Xco2 "CO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+  Real Xvh2o "H2O volume fraction";
+  Real Xvco2 "CO2 volume fraction";
+  Real Xvo2 "O2 volume fraction";
+  Real Xvn2 "N2 volume fraction";
+  Real Xvso2 "SO2 volume fraction";
+  Units.SI.MassFlowRate Q(start=1) "Flue gases mass flow rate";
+  Units.SI.CoefficientOfHeatTransfer K(start=0)
+    "Total heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer Kc(start=0)
+    "Convective heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer Kr(start=0)
+    "Radiative heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer Kcc[Ns](start=fill(0, Ns))
+    "Intermedaite variable for the computation of the convective heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer Krr[Ns](start=fill(0, Ns))
+    "Intermedaite variable for the computation of the radiative heat exchange coefficient";
+  Units.SI.Power dW[Ns](start=fill(0, Ns))
+    "Power exchange between the wall and the fluid in each section";
+  Units.SI.Power W(start=0) "Total power exchanged";
+  ThermoSysPro.Units.SI.TemperatureDifference DeltaT[Ns](start=fill(50, Ns))
+    "Temperature difference between the fluid and the wall";
+  Units.SI.Temperature TFilm[Ns] "Film temperature";
+  Real Mmt "Total flue gases molar mass";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  /* Wall boundary */
+  CTh.W = -dW;
+  CTh.T = Tp;
+
+  /* Pipe boundaries */
+  C2.Q = C1.Q;
+
+  Xh2o = C1.Xh2o;
+  Xco2 = C1.Xco2;
+
+  T[1] = C1.T;
+  T[Ns+1] = C2.T;
+
+  Pe = C1.P;
+  Q = C1.Q;
+
+  /* Flue gases composition */
+  C2.Xco2 = C1.Xco2;
+  C2.Xh2o = C1.Xh2o;
+  C2.Xo2 = C1.Xo2;
+  C2.Xso2 = C1.Xso2;
+  Xn2 = 1 - C1.Xco2 - C1.Xh2o - C1.Xo2 - C1.Xso2;
+
+  /* Volume fractions */
+  Xvco2 = (C1.Xco2/Mco2)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
+  Xvh2o = (C1.Xh2o/Mh2o)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
+  Xvo2 = (C1.Xo2/Mo2)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
+  Xvn2 = (Xn2/Mn2)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
+  Xvso2 = (C1.Xso2/Mso2)/(C1.Xco2/Mco2 + C1.Xh2o/Mh2o + C1.Xo2/Mo2 + Xn2/Mn2 + C1.Xso2/Mso2);
+
+  /* Total molar mass */
+  Mmt = Xvco2*Mco2 + Xvh2o*Mh2o + Xvo2*Mo2 + Xvn2*Mn2 + Xvso2*Mso2;
+
+  /* Partial gas pressures */
+  Ph2o = Pe*Xh2o*Mmt/Mh2o;
+  Pco2 = Pe*Xco2*Mmt/Mco2;
+
+  /* Pressure losses */
+  Pe - C2.P = DPc*ThermoSysPro.Functions.ThermoSquare(Q,eps)/rho;
+
+  /* Specific enthalpy at the inlet */
+  h[1] = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, T[1], C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  for i in 1:Ns loop
+    /* Specific enthalpy at the inlet of section i */
+    h[i+1] = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, T[i + 1], C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+    /* Average temperature in section i */
+    Tm[i] = 0.5*(T[i] + T[i+1]);
+    0 = noEvent(if (abs(Q) < Qmin) then Tm[i] - Tp[i] else Q*(h[i] - h[i + 1]) - Coeff*K*(Tm[i] - Tp[i])*Surf_ext);
+
+    /* Temperature difference between the fluid and the wall */
+    DeltaT[i] = Tm[i] - Tp[i];
+
+    if (abs(Q) >= Qmin) then
+      /* Convective heat exchange coefficient */
+      if (exchanger_type == 1) then
+        /* Crossed flux */
+        Kcc[i] = ThermoSysPro.Correlations.Thermal.WBCrossedCurrentConvectiveHeatTransferCoefficient(TFilm[i], abs(Q), Xh2o*100, Sgaz, Dext, Fa);
+      else
+        /* Longitudinal flux */
+        Kcc[i] = ThermoSysPro.Correlations.Thermal.WBLongitudinalCurrentConvectiveHeatTransferCoefficient(TFilm[i], Tm[i], abs(Q), Xh2o*100, Sgaz, Deq);
+      end if;
+
+      /* Radiative heat exchange coefficient */
+      Krr[i] = ThermoSysPro.Correlations.Thermal.WBRadiativeHeatTransferCoefficient(DeltaT[i], Tp[i], Ph2o/Pe, Pco2/Pe, Optl);
+    else
+      Krr[i] = 0;
+      Kcc[i] = 0;
+    end if;
+
+    /* Film temperature */
+    TFilm[i] = 0.5*(Tm[i] + Tp[i]);
+
+    /* Power exchanged for each section */
+    dW[i] = Coeff*K*(Tm[i] - Tp[i])*Surf_ext;
+  end for;
+
+  /* Thermal exchange */
+  0 = noEvent(if (abs(Q) >= Qmin) then K - (Kc + Kr)*Encras else K - Kdef);
+
+  /* Convective and radiative heat exchange coefficients */
+  Kc = sum(Kcc)*Surf_ext/Surf_tot;
+  Kr = sum(Krr)*Surf_ext/Surf_tot;
+
+  /* Total power exchanged */
+  W = sum(dW);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pe,0.5*(T[1]+T[Ns+1]), C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+                           Icon(graphics={
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end StaticWallFlueGasesExchanger;
diff --git a/ThermoSysPro/FlueGases/HeatExchangers/package.mo b/ThermoSysPro/FlueGases/HeatExchangers/package.mo
index 4d677896c007332a9b970cb6cfcb5f0ee106b813..3e35fa0e09893ef3b055fda5c792319a5456b5d8 100644
--- a/ThermoSysPro/FlueGases/HeatExchangers/package.mo
+++ b/ThermoSysPro/FlueGases/HeatExchangers/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.FlueGases;
-package HeatExchangers "Heat exchangers"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end HeatExchangers;
+within ThermoSysPro.FlueGases;
+package HeatExchangers "Heat exchangers"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end HeatExchangers;
diff --git a/ThermoSysPro/FlueGases/Junctions/Mixer2.mo b/ThermoSysPro/FlueGases/Junctions/Mixer2.mo
index d5b5f8b059b2c8dc0f1de34b59425debc7521970..e5dd1fbc1476ef34003669a85f756e00f57a9032 100644
--- a/ThermoSysPro/FlueGases/Junctions/Mixer2.mo
+++ b/ThermoSysPro/FlueGases/Junctions/Mixer2.mo
@@ -1,133 +1,133 @@
-within ThermoSysPro.FlueGases.Junctions;
-model Mixer2 "Flue gases mixer with two inlets"
-  parameter Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-
-public
-  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
-  Units.SI.AbsolutePressure P(start=1e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H20 mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-  Units.SI.SpecificEnthalpy he1(start=100000)
-    "Fluid specific enthalpy at inlet #1";
-  Units.SI.SpecificEnthalpy he2(start=100000)
-    "Fluid specific enthalpy at inlet #2";
-  Units.SI.SpecificEnthalpy hs(start=100000)
-    "Fluid specific enthalpy at the outlet";
-
-public
-  Connectors.FlueGasesInlet Ce2
-    annotation (Placement(transformation(extent={{-50,-110},{-30,-90}},
-          rotation=0)));
-  Connectors.FlueGasesOutlet Cs            annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-public
-  Connectors.FlueGasesInlet Ce1
-    annotation (Placement(transformation(extent={{-50,90},{-30,110}}, rotation=
-            0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for inlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
-equation
-
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.5;
-  end if;
-
-  /* Fluid pressure */
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs.P;
-
-  /* Fluid temperature (singular if all flows = 0) */
-  Cs.T = T;
-
-  /* Fluid composition */
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2 = Xo2;
-  Cs.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Mass balance equation */
-  0 = Ce1.Q + Ce2.Q - Cs.Q;
-
-  /* Energy balance equation */
-  //0 = Ce1.Q*he1 + Ce2.Q*he2 - Cs.Q*hs;
-  0 = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) - Cs.Q*(hs - Cs.Xh2o*hr);
-
-  /* Fluid composition balance equations */
-  0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs.Xco2*Cs.Q;
-  0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs.Xh2o*Cs.Q;
-  0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs.Xo2*Cs.Q;
-  0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs.Xso2*Cs.Q;
-
-  /* Mass flow at outlet 1 */
-  if (cardinality(Ialpha1) <> 0) then
-    Ce1.Q = Ialpha1.signal*Cs.Q;
-  end if;
-
-  alpha1 = Ce1.Q/Cs.Q;
-  Oalpha1.signal = alpha1;
-
-  /* Fluid thermodynamic properties */
-  he1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce1.T, Ce1.Xco2, Ce1.Xh2o, Ce1.Xo2, Ce1.Xso2);
-  he2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce2.T, Ce2.Xco2, Ce2.Xh2o, Ce2.Xo2, Ce2.Xso2);
-  hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs.T, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
-
-  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
-              -20,100},{-60,100},{-60,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(extent={{-60,80},{-20,40}}, textString=
-                                     "1"),
-        Text(extent={{-60,-40},{-20,-80}}, textString=
-                             "2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
-              -20,100},{-60,100},{-60,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(extent={{-60,80},{-20,40}}, textString=
-                                     "1"),
-        Text(extent={{-60,-40},{-20,-80}}, textString=
-                             "2")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Mixer2;
+within ThermoSysPro.FlueGases.Junctions;
+model Mixer2 "Flue gases mixer with two inlets"
+  parameter Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+
+public
+  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
+  Units.SI.AbsolutePressure P(start=1e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H20 mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+  Units.SI.SpecificEnthalpy he1(start=100000)
+    "Fluid specific enthalpy at inlet #1";
+  Units.SI.SpecificEnthalpy he2(start=100000)
+    "Fluid specific enthalpy at inlet #2";
+  Units.SI.SpecificEnthalpy hs(start=100000)
+    "Fluid specific enthalpy at the outlet";
+
+public
+  Connectors.FlueGasesInlet Ce2
+    annotation (Placement(transformation(extent={{-50,-110},{-30,-90}},
+          rotation=0)));
+  Connectors.FlueGasesOutlet Cs            annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+public
+  Connectors.FlueGasesInlet Ce1
+    annotation (Placement(transformation(extent={{-50,90},{-30,110}}, rotation=
+            0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for inlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
+equation
+
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.5;
+  end if;
+
+  /* Fluid pressure */
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs.P;
+
+  /* Fluid temperature (singular if all flows = 0) */
+  Cs.T = T;
+
+  /* Fluid composition */
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2 = Xo2;
+  Cs.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Mass balance equation */
+  0 = Ce1.Q + Ce2.Q - Cs.Q;
+
+  /* Energy balance equation */
+  //0 = Ce1.Q*he1 + Ce2.Q*he2 - Cs.Q*hs;
+  0 = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) - Cs.Q*(hs - Cs.Xh2o*hr);
+
+  /* Fluid composition balance equations */
+  0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs.Xco2*Cs.Q;
+  0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs.Xh2o*Cs.Q;
+  0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs.Xo2*Cs.Q;
+  0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs.Xso2*Cs.Q;
+
+  /* Mass flow at outlet 1 */
+  if (cardinality(Ialpha1) <> 0) then
+    Ce1.Q = Ialpha1.signal*Cs.Q;
+  end if;
+
+  alpha1 = Ce1.Q/Cs.Q;
+  Oalpha1.signal = alpha1;
+
+  /* Fluid thermodynamic properties */
+  he1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce1.T, Ce1.Xco2, Ce1.Xh2o, Ce1.Xo2, Ce1.Xso2);
+  he2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce2.T, Ce2.Xco2, Ce2.Xh2o, Ce2.Xo2, Ce2.Xso2);
+  hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs.T, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
+
+  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
+              -20,100},{-60,100},{-60,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(extent={{-60,80},{-20,40}}, textString=
+                                     "1"),
+        Text(extent={{-60,-40},{-20,-80}}, textString=
+                             "2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
+              -20,100},{-60,100},{-60,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(extent={{-60,80},{-20,40}}, textString=
+                                     "1"),
+        Text(extent={{-60,-40},{-20,-80}}, textString=
+                             "2")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Mixer2;
diff --git a/ThermoSysPro/FlueGases/Junctions/Splitter2.mo b/ThermoSysPro/FlueGases/Junctions/Splitter2.mo
index 49a6387593733af68d4061d92a1554648e2ba5ea..f30b7483557b9f749c80452d2bdb9a4c9bccf39f 100644
--- a/ThermoSysPro/FlueGases/Junctions/Splitter2.mo
+++ b/ThermoSysPro/FlueGases/Junctions/Splitter2.mo
@@ -1,138 +1,138 @@
-within ThermoSysPro.FlueGases.Junctions;
-model Splitter2 "Flue gases splitter with two outlets"
-  parameter Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-
-public
-  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
-  Units.SI.AbsolutePressure P(start=1e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=1e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H20 mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-  Units.SI.SpecificEnthalpy he(start=100000)
-    "Fluid specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy hs1(start=100000)
-    "Fluid specific enthalpy at outlet #1";
-  Units.SI.SpecificEnthalpy hs2(start=100000)
-    "Fluid specific enthalpy at outlet #2";
-
-public
-  Connectors.FlueGasesInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FlueGasesOutlet Cs1
-    annotation (Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
-  Connectors.FlueGasesOutlet Cs2
-    annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=
-            0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for outlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
-equation
-
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.5;
-  end if;
-
-  /* Fluid pressure */
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Fluid temperature (singular if all flows = 0) */
-  Cs1.T = T;
-  Cs2.T = T;
-
-  /* Fluid composition */
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2 = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2 = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Mass balance equation */
-  0 = Ce.Q - Cs1.Q - Cs2.Q;
-
-  /* Energy balance equation */
-  0 = Ce.Q*(he - Ce.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr);
-
-  /* Fluid composition balance equations */
-  0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  /* Mass flow at outlet 1 */
-  if (cardinality(Ialpha1) <> 0) then
-    Cs1.Q = Ialpha1.signal*Ce.Q;
-  end if;
-
-  alpha1 = Cs1.Q/Ce.Q;
-  Oalpha1.signal = alpha1;
-
-  /* Fluid thermodynamic properties */
-  he = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce.T, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs1.T, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-  hs2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs2.T, Cs2.Xco2, Cs2.Xh2o, Cs2.Xo2, Cs2.Xso2);
-
-  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
-              20,20},{20,100},{60,100}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(extent={{20,80},{60,40}}, textString=
-                                     "1"),
-        Text(extent={{20,-40},{60,-80}}, textString=
-                             "2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
-              20,20},{20,100},{60,100}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(extent={{20,80},{60,40}}, textString=
-                                     "1"),
-        Text(extent={{20,-40},{60,-80}}, textString=
-                             "2")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end Splitter2;
+within ThermoSysPro.FlueGases.Junctions;
+model Splitter2 "Flue gases splitter with two outlets"
+  parameter Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+
+public
+  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
+  Units.SI.AbsolutePressure P(start=1e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=1e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H20 mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+  Units.SI.SpecificEnthalpy he(start=100000)
+    "Fluid specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy hs1(start=100000)
+    "Fluid specific enthalpy at outlet #1";
+  Units.SI.SpecificEnthalpy hs2(start=100000)
+    "Fluid specific enthalpy at outlet #2";
+
+public
+  Connectors.FlueGasesInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FlueGasesOutlet Cs1
+    annotation (Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
+  Connectors.FlueGasesOutlet Cs2
+    annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=
+            0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for outlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
+equation
+
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.5;
+  end if;
+
+  /* Fluid pressure */
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Fluid temperature (singular if all flows = 0) */
+  Cs1.T = T;
+  Cs2.T = T;
+
+  /* Fluid composition */
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2 = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2 = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Mass balance equation */
+  0 = Ce.Q - Cs1.Q - Cs2.Q;
+
+  /* Energy balance equation */
+  0 = Ce.Q*(he - Ce.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr);
+
+  /* Fluid composition balance equations */
+  0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  /* Mass flow at outlet 1 */
+  if (cardinality(Ialpha1) <> 0) then
+    Cs1.Q = Ialpha1.signal*Ce.Q;
+  end if;
+
+  alpha1 = Cs1.Q/Ce.Q;
+  Oalpha1.signal = alpha1;
+
+  /* Fluid thermodynamic properties */
+  he = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce.T, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs1.T, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+  hs2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs2.T, Cs2.Xco2, Cs2.Xh2o, Cs2.Xo2, Cs2.Xso2);
+
+  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
+              20,20},{20,100},{60,100}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(extent={{20,80},{60,40}}, textString=
+                                     "1"),
+        Text(extent={{20,-40},{60,-80}}, textString=
+                             "2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
+              20,20},{20,100},{60,100}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(extent={{20,80},{60,40}}, textString=
+                                     "1"),
+        Text(extent={{20,-40},{60,-80}}, textString=
+                             "2")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end Splitter2;
diff --git a/ThermoSysPro/FlueGases/Junctions/package.mo b/ThermoSysPro/FlueGases/Junctions/package.mo
index 84c04c1db01e338eadc1425e9afbdf159f6d5031..fbe7c81d55e4a471c24dad8c8640e4d707e1be82 100644
--- a/ThermoSysPro/FlueGases/Junctions/package.mo
+++ b/ThermoSysPro/FlueGases/Junctions/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.FlueGases;
-package Junctions "Junctions"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Junctions;
+within ThermoSysPro.FlueGases;
+package Junctions "Junctions"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Junctions;
diff --git a/ThermoSysPro/FlueGases/Junctions/package.order b/ThermoSysPro/FlueGases/Junctions/package.order
index c9ef38d34d5818e1f19366c8d65c0423681cdae2..9a67c9561533ea39a1ea215904cbde1f1f5c06c0 100644
--- a/ThermoSysPro/FlueGases/Junctions/package.order
+++ b/ThermoSysPro/FlueGases/Junctions/package.order
@@ -1,2 +1,2 @@
-Mixer2
-Splitter2
+Mixer2
+Splitter2
diff --git a/ThermoSysPro/FlueGases/Machines/CombustionTurbine.mo b/ThermoSysPro/FlueGases/Machines/CombustionTurbine.mo
index 2fd965347287666b2a7218a6ab033dcc1a16989f..282c59cbcc3d6f6d1d38ca8dd3399ff8e7cce75c 100644
--- a/ThermoSysPro/FlueGases/Machines/CombustionTurbine.mo
+++ b/ThermoSysPro/FlueGases/Machines/CombustionTurbine.mo
@@ -1,133 +1,133 @@
-within ThermoSysPro.FlueGases.Machines;
-model CombustionTurbine "Combustion turbine"
-  parameter Real A3=0 "X^3 coefficient of the efficiency curve";
-  parameter Real A2=-0.04778 "X^2 coefficient of the efficiency curve";
-  parameter Real A1=0.09555 "X^1 coefficient of the efficiency curve";
-  parameter Real A0=0.95223 "X^0 coefficient of the efficiency curve";
-  parameter Real tau_n=0.07 "Nominal expansion rate";
-  parameter Real is_eff_n=0.8600 "Nominal isentropic efficiency";
-  parameter Real Qred=0.01 "Reduced mass flow rate";
-
-public
-  Real tau(start=0.07) "Expansion rate";
-  Real is_eff(start=0.85) "Isentropic efficiency";
-  Units.SI.Power Wcp(start=1e9) "Compressor power";
-  Units.SI.Power Wturb(start=2e9) "Turbine power";
-  Units.SI.Power Wmech(start=1e9) "Mechanical power";
-  Units.SI.AbsolutePressure Pe(start=1e5) "Flue gases pressure at the inlet";
-  Units.SI.AbsolutePressure Ps(start=1e5) "Flue gases pressure at the outlet";
-  Real Xtau(start=1) "Ratio between the actual and nominal expansion rate";
-  Units.SI.MassFlowRate Q(start=500) "Flue gases mass flow rate";
-  Units.SI.Temperature Te(start=1.4e3) "Flue gases temperature at the inlet";
-  Units.SI.Temperature Ts(start=900) "Flue gases temperature at the outlet";
-  Units.SI.Temperature Tis(start=750)
-    "Isentropic air temperature at the outlet";
-  Units.SI.SpecificEnthalpy He(start=1.2e6)
-    "Flue gases specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hs(start=6e5)
-    "Flue gases specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy His(start=6e5)
-    "Flue gases specific enthalpy after the isentropic expansion";
-  Units.SI.SpecificEntropy Se "Flue gases specific entropy at the inlet";
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cs
-                                           annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower
-    annotation (Placement(transformation(extent={{-120,-50},{-100,-30}},
-          rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
-    annotation (Placement(transformation(extent={{100,-100},{120,-80}},
-          rotation=0)));
-equation
-  /* Connector at the inlet */
-  Pe = Ce.P;
-  Q = Ce.Q;
-  Te = Ce.T;
-
-  /* Connector at the outlet */
-  Ps = Cs.P;
-  Q = Cs.Q;
-  Ts = Cs.T;
-
-  /* Input compressor power (negative value) */
-  Wcp = CompressorPower.signal;
-
-  /* Flue gases composition */
-  Cs.Xco2 = Ce.Xco2;
-  Cs.Xh2o = Ce.Xh2o;
-  Cs.Xo2  = Ce.Xo2;
-  Cs.Xso2 = Ce.Xso2;
-
-  /* Expansion rate */
-  tau = Ps/Pe;
-
-  /* Expansion rates ratio */
-  Xtau = tau/tau_n;
-
-  /* Isentropic efficiency */
-  is_eff = (A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
-
-  /* Reduced mass flow rate */
-  Qred = (Q*sqrt(Te))/Pe;
-
-  /* Turbine power */
-  Wturb = Q*(He - Hs);
-
-  /* Mechanical power */
-  Wmech = Wturb + Wcp;
-  MechPower.signal = Wmech;
-
-  /* Specific enthalpy at the inlet */
-  He =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific entropy at the inlet */
-  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific enthalpy after the isentropic expansion */
-  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific enthalpy at the outlet */
-  Hs = is_eff*(His - He) +  He;
-
-  /* Temperature at the outlet */
-//  Ts = ThermoSysPro.Properties.FlueGases.FlueGases_T(Ps, Hs, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  // replace by a function that can be differentiated and call with unknown variable on right-hand side
-  Hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Ts, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={Polygon(
-          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={Polygon(
-          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 11.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-"));
-end CombustionTurbine;
+within ThermoSysPro.FlueGases.Machines;
+model CombustionTurbine "Combustion turbine"
+  parameter Real A3=0 "X^3 coefficient of the efficiency curve";
+  parameter Real A2=-0.04778 "X^2 coefficient of the efficiency curve";
+  parameter Real A1=0.09555 "X^1 coefficient of the efficiency curve";
+  parameter Real A0=0.95223 "X^0 coefficient of the efficiency curve";
+  parameter Real tau_n=0.07 "Nominal expansion rate";
+  parameter Real is_eff_n=0.8600 "Nominal isentropic efficiency";
+  parameter Real Qred=0.01 "Reduced mass flow rate";
+
+public
+  Real tau(start=0.07) "Expansion rate";
+  Real is_eff(start=0.85) "Isentropic efficiency";
+  Units.SI.Power Wcp(start=1e9) "Compressor power";
+  Units.SI.Power Wturb(start=2e9) "Turbine power";
+  Units.SI.Power Wmech(start=1e9) "Mechanical power";
+  Units.SI.AbsolutePressure Pe(start=1e5) "Flue gases pressure at the inlet";
+  Units.SI.AbsolutePressure Ps(start=1e5) "Flue gases pressure at the outlet";
+  Real Xtau(start=1) "Ratio between the actual and nominal expansion rate";
+  Units.SI.MassFlowRate Q(start=500) "Flue gases mass flow rate";
+  Units.SI.Temperature Te(start=1.4e3) "Flue gases temperature at the inlet";
+  Units.SI.Temperature Ts(start=900) "Flue gases temperature at the outlet";
+  Units.SI.Temperature Tis(start=750)
+    "Isentropic air temperature at the outlet";
+  Units.SI.SpecificEnthalpy He(start=1.2e6)
+    "Flue gases specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hs(start=6e5)
+    "Flue gases specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy His(start=6e5)
+    "Flue gases specific enthalpy after the isentropic expansion";
+  Units.SI.SpecificEntropy Se "Flue gases specific entropy at the inlet";
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cs
+                                           annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower
+    annotation (Placement(transformation(extent={{-120,-50},{-100,-30}},
+          rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
+    annotation (Placement(transformation(extent={{100,-100},{120,-80}},
+          rotation=0)));
+equation
+  /* Connector at the inlet */
+  Pe = Ce.P;
+  Q = Ce.Q;
+  Te = Ce.T;
+
+  /* Connector at the outlet */
+  Ps = Cs.P;
+  Q = Cs.Q;
+  Ts = Cs.T;
+
+  /* Input compressor power (negative value) */
+  Wcp = CompressorPower.signal;
+
+  /* Flue gases composition */
+  Cs.Xco2 = Ce.Xco2;
+  Cs.Xh2o = Ce.Xh2o;
+  Cs.Xo2  = Ce.Xo2;
+  Cs.Xso2 = Ce.Xso2;
+
+  /* Expansion rate */
+  tau = Ps/Pe;
+
+  /* Expansion rates ratio */
+  Xtau = tau/tau_n;
+
+  /* Isentropic efficiency */
+  is_eff = (A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
+
+  /* Reduced mass flow rate */
+  Qred = (Q*sqrt(Te))/Pe;
+
+  /* Turbine power */
+  Wturb = Q*(He - Hs);
+
+  /* Mechanical power */
+  Wmech = Wturb + Wcp;
+  MechPower.signal = Wmech;
+
+  /* Specific enthalpy at the inlet */
+  He =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific entropy at the inlet */
+  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific enthalpy after the isentropic expansion */
+  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific enthalpy at the outlet */
+  Hs = is_eff*(His - He) +  He;
+
+  /* Temperature at the outlet */
+//  Ts = ThermoSysPro.Properties.FlueGases.FlueGases_T(Ps, Hs, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  // replace by a function that can be differentiated and call with unknown variable on right-hand side
+  Hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Ts, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={Polygon(
+          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={Polygon(
+          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 11.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+"));
+end CombustionTurbine;
diff --git a/ThermoSysPro/FlueGases/Machines/Compressor.mo b/ThermoSysPro/FlueGases/Machines/Compressor.mo
index 30e90fce948894dd6a4b8bde3e995159c04e3d1e..4e975e8330ef0d7373304758c7d99efc978a53f9 100644
--- a/ThermoSysPro/FlueGases/Machines/Compressor.mo
+++ b/ThermoSysPro/FlueGases/Machines/Compressor.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.FlueGases.Machines;
-model Compressor "Gas compressor"
-  parameter Integer mass_flow_rate_comp=1
-    "Ways for computing the mass flow rate - 1: Q = rho*Qv - 2: Q = rho*f(T)";
-  parameter Units.SI.Temperature Tmax=284.16
-    "Air transition temperature between f1 = a*x + b and f2 = c*x + d for the computation of Q (active if mass_flow_rate_comp == 2)";
-  parameter Real coef1_1=0.1164 "Coefficient a for f1 = a*x + b";
-   parameter Real coef2_1=38.643 "Coefficient b for f1 = a*x + b";
-  parameter Real coef1_2=-0.2324 "Coefficient c for f2 = c*x + d";
-  parameter Real coef2_2=137.49 "Coefficient d for f2 = c*x + d";
-  parameter Real A4=-1.2362
-    "Coefficient of X^4 for the computation of the isentropic efficiency";
-  parameter Real A3=3.6721
-    "Coefficient of X^3 for the computation of the isentropic efficiency";
-  parameter Real A2=-4.2434
-    "Coefficient of X^2 for the computation of the isentropic efficiency";
-  parameter Real A1=2.3957
-    "Coefficient of X^1 for the computation of the isentropic efficiency";
-  parameter Real A0=0.4118
-    "Coefficient of X^0 for the computation of the isentropic efficiency";
-  parameter Real tau_n=14.149 "Nominal compression rate";
-  parameter Real is_eff_n=0.84752 "Nominal isentropic efficiency";
-
-protected
-  Units.SI.VolumeFlowRate Qv_cal(start=500)
-    "Intermediate variable for the computation of Qv";
-
-public
-  Real tau(start=15) "Compression rate";
-  Real is_eff(start=0.85) "Isentropic efficiency";
-  Units.SI.Power Wcp(start=1e9) "Compressor power";
-  Units.SI.AbsolutePressure Pe(start=1e5) "Air pressure at the inlet";
-  Units.SI.AbsolutePressure Ps(start=15e5) "Air pressure at the outlet";
-  Real Xtau( start=1) "Normal and nominal compression rates ratio";
-  Units.SI.MassFlowRate Q(start=500) "Air mass flow rate";
-  Units.SI.VolumeFlowRate Qv(start=500) "Air volumetric flow rate";
-  Units.SI.Temperature Te(start=300) "Air temperature at the inlet";
-  Units.SI.Temperature Ts(start=750) "Air temperature at the outlet";
-  Units.SI.Temperature Tis(start=750)
-    "Isentropic air temperature at the outlet";
-  Units.SI.SpecificEnthalpy He(start=80e3) "Air specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hs(start=500e3)
-    "Air specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy His(start=450e3)
-    "Air specific enthalpy after the isentropic compression";
-  Units.SI.SpecificEntropy Se "Air specific entropy at the inlet";
-  Units.SI.Density rho_e(start=1) "Air density at the inlet";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ce
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cs
-                                           annotation (Placement(transformation(
-          extent={{80,-10},{100,10}}, rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power
-    annotation (Placement(transformation(extent={{80,-40},{100,-20}}, rotation=
-            0)));
-equation
-  /* Connector at the inlet */
-  Pe = Ce.P;
-  Q = Ce.Q;
-  Te = Ce.T;
-
-  /* Connector at the outlet */
-  Ps = Cs.P;
-  Q = Cs.Q;
-  Ts = Cs.T;
-
-  /* Flue gases composition */
-  Cs.Xco2 = Ce.Xco2;
-  Cs.Xh2o = Ce.Xh2o;
-  Cs.Xo2  = Ce.Xo2;
-  Cs.Xso2 = Ce.Xso2;
-
-  /* Compression rate */
-  tau = Ps/Pe;
-
-  /* Compression rates ratio */
-  Xtau = tau/tau_n;
-
-  /* Isentropic efficiency */
-  is_eff = (A4*Xtau^4 + A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
-
-  /* Compressor power */
-  Wcp = Q*(He - Hs);
-  Power.signal = Wcp;
-
-  /* Volume flow rate at the inlet */
-  Qv_cal = if (Te < Tmax) then coef1_1*Te + coef2_1 else coef1_2*Te + coef2_2;
-  Q = if (mass_flow_rate_comp == 1) then Qv*rho_e else Qv_cal*rho_e;
-
-  /* Specific enthalpy at the inlet */
-  He = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific entropy at the inlet */
-  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific enthalpy after the isentropic compression */
-  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Fluid density at the inlet */
-  rho_e = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific enthalpy at the outlet */
-  Hs = (His - He + is_eff*He)/is_eff;
-
-  /* Temperature at the outlet */
-  //Ts = ThermoSysPro.Properties.FlueGases.FlueGases_T(Ps, Hs, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  // call implicitly to avoid function that can not be differentiated.
-  Hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Ts, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{
-            120,100}}), graphics={Polygon(
-          points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}},
-          lineColor={0,0,0},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,
-            100}}), graphics={Polygon(
-          points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}},
-          lineColor={0,0,0},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 11.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-"));
-end Compressor;
+within ThermoSysPro.FlueGases.Machines;
+model Compressor "Gas compressor"
+  parameter Integer mass_flow_rate_comp=1
+    "Ways for computing the mass flow rate - 1: Q = rho*Qv - 2: Q = rho*f(T)";
+  parameter Units.SI.Temperature Tmax=284.16
+    "Air transition temperature between f1 = a*x + b and f2 = c*x + d for the computation of Q (active if mass_flow_rate_comp == 2)";
+  parameter Real coef1_1=0.1164 "Coefficient a for f1 = a*x + b";
+   parameter Real coef2_1=38.643 "Coefficient b for f1 = a*x + b";
+  parameter Real coef1_2=-0.2324 "Coefficient c for f2 = c*x + d";
+  parameter Real coef2_2=137.49 "Coefficient d for f2 = c*x + d";
+  parameter Real A4=-1.2362
+    "Coefficient of X^4 for the computation of the isentropic efficiency";
+  parameter Real A3=3.6721
+    "Coefficient of X^3 for the computation of the isentropic efficiency";
+  parameter Real A2=-4.2434
+    "Coefficient of X^2 for the computation of the isentropic efficiency";
+  parameter Real A1=2.3957
+    "Coefficient of X^1 for the computation of the isentropic efficiency";
+  parameter Real A0=0.4118
+    "Coefficient of X^0 for the computation of the isentropic efficiency";
+  parameter Real tau_n=14.149 "Nominal compression rate";
+  parameter Real is_eff_n=0.84752 "Nominal isentropic efficiency";
+
+protected
+  Units.SI.VolumeFlowRate Qv_cal(start=500)
+    "Intermediate variable for the computation of Qv";
+
+public
+  Real tau(start=15) "Compression rate";
+  Real is_eff(start=0.85) "Isentropic efficiency";
+  Units.SI.Power Wcp(start=1e9) "Compressor power";
+  Units.SI.AbsolutePressure Pe(start=1e5) "Air pressure at the inlet";
+  Units.SI.AbsolutePressure Ps(start=15e5) "Air pressure at the outlet";
+  Real Xtau( start=1) "Normal and nominal compression rates ratio";
+  Units.SI.MassFlowRate Q(start=500) "Air mass flow rate";
+  Units.SI.VolumeFlowRate Qv(start=500) "Air volumetric flow rate";
+  Units.SI.Temperature Te(start=300) "Air temperature at the inlet";
+  Units.SI.Temperature Ts(start=750) "Air temperature at the outlet";
+  Units.SI.Temperature Tis(start=750)
+    "Isentropic air temperature at the outlet";
+  Units.SI.SpecificEnthalpy He(start=80e3) "Air specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hs(start=500e3)
+    "Air specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy His(start=450e3)
+    "Air specific enthalpy after the isentropic compression";
+  Units.SI.SpecificEntropy Se "Air specific entropy at the inlet";
+  Units.SI.Density rho_e(start=1) "Air density at the inlet";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Ce
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cs
+                                           annotation (Placement(transformation(
+          extent={{80,-10},{100,10}}, rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power
+    annotation (Placement(transformation(extent={{80,-40},{100,-20}}, rotation=
+            0)));
+equation
+  /* Connector at the inlet */
+  Pe = Ce.P;
+  Q = Ce.Q;
+  Te = Ce.T;
+
+  /* Connector at the outlet */
+  Ps = Cs.P;
+  Q = Cs.Q;
+  Ts = Cs.T;
+
+  /* Flue gases composition */
+  Cs.Xco2 = Ce.Xco2;
+  Cs.Xh2o = Ce.Xh2o;
+  Cs.Xo2  = Ce.Xo2;
+  Cs.Xso2 = Ce.Xso2;
+
+  /* Compression rate */
+  tau = Ps/Pe;
+
+  /* Compression rates ratio */
+  Xtau = tau/tau_n;
+
+  /* Isentropic efficiency */
+  is_eff = (A4*Xtau^4 + A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
+
+  /* Compressor power */
+  Wcp = Q*(He - Hs);
+  Power.signal = Wcp;
+
+  /* Volume flow rate at the inlet */
+  Qv_cal = if (Te < Tmax) then coef1_1*Te + coef2_1 else coef1_2*Te + coef2_2;
+  Q = if (mass_flow_rate_comp == 1) then Qv*rho_e else Qv_cal*rho_e;
+
+  /* Specific enthalpy at the inlet */
+  He = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific entropy at the inlet */
+  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific enthalpy after the isentropic compression */
+  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Fluid density at the inlet */
+  rho_e = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific enthalpy at the outlet */
+  Hs = (His - He + is_eff*He)/is_eff;
+
+  /* Temperature at the outlet */
+  //Ts = ThermoSysPro.Properties.FlueGases.FlueGases_T(Ps, Hs, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  // call implicitly to avoid function that can not be differentiated.
+  Hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Ts, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{
+            120,100}}), graphics={Polygon(
+          points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}},
+          lineColor={0,0,0},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,
+            100}}), graphics={Polygon(
+          points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}},
+          lineColor={0,0,0},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 11.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+"));
+end Compressor;
diff --git a/ThermoSysPro/FlueGases/Machines/StaticFan.mo b/ThermoSysPro/FlueGases/Machines/StaticFan.mo
index da9d2f25f968092190bdfad99758f0971171ae65..f7e50d5458036b94c788ffe3752eb1fc7e71b454 100644
--- a/ThermoSysPro/FlueGases/Machines/StaticFan.mo
+++ b/ThermoSysPro/FlueGases/Machines/StaticFan.mo
@@ -1,175 +1,175 @@
-within ThermoSysPro.FlueGases.Machines;
-model StaticFan "Static fan"
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
-    "Rotational speed";
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
-    "Nominal rotational speed";
-  parameter Real rm=0.85
-    "Product of the pump mechanical and electrical efficiencies";
-  parameter Boolean adiabatic_compression=false
-    "true: adiabatic compression - false: non adiabatic compression";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-
-  parameter Real a1=-52.04
-    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-  parameter Real a2=-71.735
-    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
-  parameter Real a3=45.59
-    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter Real b1=-8.4818
-    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
-  parameter Real b2=4.6593
-    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
-  parameter Real b3=-0.1533
-    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Real eps=1.e-6 "Small number";
-  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
-
-public
-  Real rh( start=0.5) "Hydraulic efficiency";
-  Units.SI.Length hn(start=10) "Pump head";
-  Real R "Ratio VRot/VRotn (s.u.)";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow";
-  Units.SI.Power Wh "Hydraulic power";
-  Units.SI.Power Wm "Motor power";
-  Units.SI.Density rho(start=998) "Fluid density";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Pressure variation between the outlet and the inlet";
-  Units.SI.SpecificEnthalpy deltaH
-    "Specific enthalpy variation between the outlet and the inlet";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
-  Units.SI.SpecificEnthalpy h1(start=100000) "Fluid specific enthalpy in";
-  Units.SI.SpecificEnthalpy h2(start=100000) "Fluid specific enthalpy out";
-  Units.SI.Temperature T(start=500) "Fluid temperature";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandeFan
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Connectors.FlueGasesInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FlueGasesOutlet C2
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal VRotation
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  if (cardinality(commandeFan) == 0) then
-    commandeFan.signal = true;
-  end if;
-
-  if (cardinality(VRotation) == 0) then
-    VRotation.signal = VRot;
-  end if;
-
-  /* Flue gas composition */
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  deltaP = C2.P - C1.P;
-  deltaH = h2 - h1;
-
-  deltaP = rho*g*hn;
-
-  if adiabatic_compression then
-    deltaH = 0;
-  else
-    deltaH = g*hn/rh;
-  end if;
-
-  C1.Q = C2.Q;
-  Q = C1.Q;
-  Q = Qv*rho;
-
-  /* Pump position (started or stopped) */
-  R = if commandeFan.signal then VRotation.signal/VRotn else 0;
-
-  /* Pump characteristics */
-  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
-  rh = noEvent(max(if (abs(R) > eps) then b1*Qv^2/R^2 + b2*Qv/R + b3 else b3, rhmin));
-
-  /* Mechanical power */
-  Wm = Q*deltaH/rm;
-
-  /* Hydraulic power */
-  Wh = Qv*deltaP/rh;
-
-  /* Fluid thermodynamic properties */
-  P = (C1.P + C2.P)/2;
-  h = (h1 + h2)/2;
-
-  // Temperature
-  h =  ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-  h2 =  ThermoSysPro.Properties.FlueGases.FlueGases_h(P, C2.T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-
-  // Enthalpy
-  h1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, C1.T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}),
-        Polygon(
-          points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Window(
-      x=0.03,
-      y=0.02,
-      width=0.95,
-      height=0.95),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}),
-        Polygon(
-          points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u> </p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end StaticFan;
+within ThermoSysPro.FlueGases.Machines;
+model StaticFan "Static fan"
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
+    "Rotational speed";
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
+    "Nominal rotational speed";
+  parameter Real rm=0.85
+    "Product of the pump mechanical and electrical efficiencies";
+  parameter Boolean adiabatic_compression=false
+    "true: adiabatic compression - false: non adiabatic compression";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+
+  parameter Real a1=-52.04
+    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+  parameter Real a2=-71.735
+    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
+  parameter Real a3=45.59
+    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter Real b1=-8.4818
+    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
+  parameter Real b2=4.6593
+    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
+  parameter Real b3=-0.1533
+    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Real eps=1.e-6 "Small number";
+  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
+
+public
+  Real rh( start=0.5) "Hydraulic efficiency";
+  Units.SI.Length hn(start=10) "Pump head";
+  Real R "Ratio VRot/VRotn (s.u.)";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow";
+  Units.SI.Power Wh "Hydraulic power";
+  Units.SI.Power Wm "Motor power";
+  Units.SI.Density rho(start=998) "Fluid density";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Pressure variation between the outlet and the inlet";
+  Units.SI.SpecificEnthalpy deltaH
+    "Specific enthalpy variation between the outlet and the inlet";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
+  Units.SI.SpecificEnthalpy h1(start=100000) "Fluid specific enthalpy in";
+  Units.SI.SpecificEnthalpy h2(start=100000) "Fluid specific enthalpy out";
+  Units.SI.Temperature T(start=500) "Fluid temperature";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandeFan
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Connectors.FlueGasesInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FlueGasesOutlet C2
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal VRotation
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  if (cardinality(commandeFan) == 0) then
+    commandeFan.signal = true;
+  end if;
+
+  if (cardinality(VRotation) == 0) then
+    VRotation.signal = VRot;
+  end if;
+
+  /* Flue gas composition */
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  deltaP = C2.P - C1.P;
+  deltaH = h2 - h1;
+
+  deltaP = rho*g*hn;
+
+  if adiabatic_compression then
+    deltaH = 0;
+  else
+    deltaH = g*hn/rh;
+  end if;
+
+  C1.Q = C2.Q;
+  Q = C1.Q;
+  Q = Qv*rho;
+
+  /* Pump position (started or stopped) */
+  R = if commandeFan.signal then VRotation.signal/VRotn else 0;
+
+  /* Pump characteristics */
+  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
+  rh = noEvent(max(if (abs(R) > eps) then b1*Qv^2/R^2 + b2*Qv/R + b3 else b3, rhmin));
+
+  /* Mechanical power */
+  Wm = Q*deltaH/rm;
+
+  /* Hydraulic power */
+  Wh = Qv*deltaP/rh;
+
+  /* Fluid thermodynamic properties */
+  P = (C1.P + C2.P)/2;
+  h = (h1 + h2)/2;
+
+  // Temperature
+  h =  ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+  h2 =  ThermoSysPro.Properties.FlueGases.FlueGases_h(P, C2.T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+
+  // Enthalpy
+  h1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, C1.T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}),
+        Polygon(
+          points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Window(
+      x=0.03,
+      y=0.02,
+      width=0.95,
+      height=0.95),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}),
+        Polygon(
+          points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u> </p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end StaticFan;
diff --git a/ThermoSysPro/FlueGases/Machines/package.mo b/ThermoSysPro/FlueGases/Machines/package.mo
index f50952be00a9f77792c9c11a5f9ef0b042ce10e6..e329e8aff31ede5ec993161953ca41b86d94e520 100644
--- a/ThermoSysPro/FlueGases/Machines/package.mo
+++ b/ThermoSysPro/FlueGases/Machines/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.FlueGases;
-package Machines "Machines"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Machines;
+within ThermoSysPro.FlueGases;
+package Machines "Machines"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Machines;
diff --git a/ThermoSysPro/FlueGases/PressureLosses/CheckValve.mo b/ThermoSysPro/FlueGases/PressureLosses/CheckValve.mo
index fbbc51a182e7754cccf64be3fd2598fd3e2b104b..1cdce2531ebfe9563c04fd1ae91a534ffaa658f3 100644
--- a/ThermoSysPro/FlueGases/PressureLosses/CheckValve.mo
+++ b/ThermoSysPro/FlueGases/PressureLosses/CheckValve.mo
@@ -1,116 +1,116 @@
-within ThermoSysPro.FlueGases.PressureLosses;
-model CheckValve "Check valve"
-  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=10
-    "Pressure difference when the valve opens";
-  parameter ThermoSysPro.Units.SI.PressureDifference dPFerme=0
-    "Pressure difference when the valve closes";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
-    "Pressure loss coefficient";
-  parameter Units.SI.MassFlowRate Qmin=1.e-6
-    "Mass flow when the valve is closed";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-
-protected
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  Boolean ouvert(start=true, fixed=true) "Valve state";
-  discrete Boolean touvert(start=false, fixed=true);
-  discrete Boolean tferme(start=false, fixed=true);
-  Units.SI.MassFlowRate Q(start=100) "Mass flow";
-  ThermoSysPro.Units.SI.PressureDifference deltaP(start=10)
-    "Singular pressure loss";
-  Units.SI.Density rho(start=1) "Fluid density";
-  Units.SI.Temperature T(start=300) "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
-
-  Connectors.FlueGasesInlet C1      annotation (Placement(transformation(extent=
-           {{-120,-10},{-100,10}}, rotation=0)));
-  Connectors.FlueGasesOutlet C2     annotation (Placement(transformation(extent=
-           {{100,-10},{120,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.T = C2.T; // Because the behaviour of the flue gas is close to an ideal gas
-  Q = C1.Q;
-  deltaP = C1.P - C2.P;
-
-  C2.Xco2 = C1.Xco2;
-  C2.Xh2o = C1.Xh2o;
-  C2.Xo2  = C1.Xo2;
-  C2.Xso2 = C1.Xso2;
-
-  /* Pressure loss */
-  if ouvert then
-    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
-  else
-    Q - Qmin = 0;
-  end if;
-
-  touvert = (deltaP > dPOuvert);
-  tferme = (deltaP < dPFerme);
-
-  when {pre(tferme),pre(touvert)} then
-    ouvert = pre(touvert);
-  end when;
-
-  /* Fluid thermodynamic properties */
-  P = (C1.P + C2.P)/2;
-  T = C1.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,0},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,0},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5)}),
-    Window(
-      x=0.09,
-      y=0.05,
-      width=0.91,
-      height=0.92),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end CheckValve;
+within ThermoSysPro.FlueGases.PressureLosses;
+model CheckValve "Check valve"
+  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=10
+    "Pressure difference when the valve opens";
+  parameter ThermoSysPro.Units.SI.PressureDifference dPFerme=0
+    "Pressure difference when the valve closes";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
+    "Pressure loss coefficient";
+  parameter Units.SI.MassFlowRate Qmin=1.e-6
+    "Mass flow when the valve is closed";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+
+protected
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  Boolean ouvert(start=true, fixed=true) "Valve state";
+  discrete Boolean touvert(start=false, fixed=true);
+  discrete Boolean tferme(start=false, fixed=true);
+  Units.SI.MassFlowRate Q(start=100) "Mass flow";
+  ThermoSysPro.Units.SI.PressureDifference deltaP(start=10)
+    "Singular pressure loss";
+  Units.SI.Density rho(start=1) "Fluid density";
+  Units.SI.Temperature T(start=300) "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
+
+  Connectors.FlueGasesInlet C1      annotation (Placement(transformation(extent=
+           {{-120,-10},{-100,10}}, rotation=0)));
+  Connectors.FlueGasesOutlet C2     annotation (Placement(transformation(extent=
+           {{100,-10},{120,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.T = C2.T; // Because the behaviour of the flue gas is close to an ideal gas
+  Q = C1.Q;
+  deltaP = C1.P - C2.P;
+
+  C2.Xco2 = C1.Xco2;
+  C2.Xh2o = C1.Xh2o;
+  C2.Xo2  = C1.Xo2;
+  C2.Xso2 = C1.Xso2;
+
+  /* Pressure loss */
+  if ouvert then
+    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
+  else
+    Q - Qmin = 0;
+  end if;
+
+  touvert = (deltaP > dPOuvert);
+  tferme = (deltaP < dPFerme);
+
+  when {pre(tferme),pre(touvert)} then
+    ouvert = pre(touvert);
+  end when;
+
+  /* Fluid thermodynamic properties */
+  P = (C1.P + C2.P)/2;
+  T = C1.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,0},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,0},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5)}),
+    Window(
+      x=0.09,
+      y=0.05,
+      width=0.91,
+      height=0.92),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end CheckValve;
diff --git a/ThermoSysPro/FlueGases/PressureLosses/ControlValve.mo b/ThermoSysPro/FlueGases/PressureLosses/ControlValve.mo
index cf8f01f17a9981badce66e7477d91daf5a9a1d1a..8f96a0fe9f8f9144bd28f505bceebcfb12a3acc7 100644
--- a/ThermoSysPro/FlueGases/PressureLosses/ControlValve.mo
+++ b/ThermoSysPro/FlueGases/PressureLosses/ControlValve.mo
@@ -1,144 +1,144 @@
-within ThermoSysPro.FlueGases.PressureLosses;
-model ControlValve "Control valve"
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax=5000
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
-    "Position vs. Cv characteristics (active if mode_caract=1)";
-  parameter Integer mode_caract=0
-    "0:linear characteristics - 1:characteristics is given by caract[]";
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-
-protected
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  ThermoSysPro.Units.xSI.Cv Cv(start=100) "Cv";
-  Units.SI.MassFlowRate Q(start=100) "Mass flow";
-  ThermoSysPro.Units.SI.PressureDifference deltaP(start=10)
-    "Singular pressure loss";
-  Units.SI.Density rho(start=1) "Fluid density";
-  Units.SI.Temperature T(start=300) "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Connectors.FlueGasesInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -70},{-90,-50}}, rotation=0)));
-  Connectors.FlueGasesOutlet C2
-                          annotation (Placement(transformation(extent={{90,-70},
-            {110,-50}}, rotation=0)));
-equation
-
-  C1.T = C2.T; // Because the behaviour of the flue gas is close to an ideal gas
-  C1.Q = C2.Q;
-  Q = C1.Q;
-  deltaP = C1.P - C2.P;
-
-  C2.Xco2 = C1.Xco2;
-  C2.Xh2o = C1.Xh2o;
-  C2.Xo2  = C1.Xo2;
-  C2.Xso2 = C1.Xso2;
-
-  /* Pressure loss */
-  deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho^2;
-
-  /* Cv as a function of the valve position */
-  if (mode_caract == 0) then
-    Cv = Ouv.signal*Cvmax;
-  elseif (mode_caract == 1) then
-    if (option_interpolation == 1) then
-      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
-    elseif (option_interpolation == 2) then
-      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
-    else
-      assert(false, "ControlValve: incorrect interpolation option");
-    end if;
-  else
-    assert(false, "ControlValve : incorrect option for the computation of Cv");
-  end if;
-
-  /* Fluid thermodynamic properties */
-  P = (C1.P + C2.P)/2;
-  T = C1.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-  end if;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
-              {20,94},{32,84},{38,72},{40,54},{40,40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={128,255,0}),
-        Polygon(
-          points={{0,-60},{40,40},{-40,40},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{0,-60},{40,40},{-40,40},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
-              {20,94},{32,84},{38,72},{40,54},{40,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Window(
-      x=0.07,
-      y=0.13,
-      width=0.8,
-      height=0.77),
-    Documentation(info="<html>
-<p><h4>Copyright &copy; EDF 2002 - 2013</h4></p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end ControlValve;
+within ThermoSysPro.FlueGases.PressureLosses;
+model ControlValve "Control valve"
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax=5000
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
+    "Position vs. Cv characteristics (active if mode_caract=1)";
+  parameter Integer mode_caract=0
+    "0:linear characteristics - 1:characteristics is given by caract[]";
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+
+protected
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  ThermoSysPro.Units.xSI.Cv Cv(start=100) "Cv";
+  Units.SI.MassFlowRate Q(start=100) "Mass flow";
+  ThermoSysPro.Units.SI.PressureDifference deltaP(start=10)
+    "Singular pressure loss";
+  Units.SI.Density rho(start=1) "Fluid density";
+  Units.SI.Temperature T(start=300) "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Connectors.FlueGasesInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -70},{-90,-50}}, rotation=0)));
+  Connectors.FlueGasesOutlet C2
+                          annotation (Placement(transformation(extent={{90,-70},
+            {110,-50}}, rotation=0)));
+equation
+
+  C1.T = C2.T; // Because the behaviour of the flue gas is close to an ideal gas
+  C1.Q = C2.Q;
+  Q = C1.Q;
+  deltaP = C1.P - C2.P;
+
+  C2.Xco2 = C1.Xco2;
+  C2.Xh2o = C1.Xh2o;
+  C2.Xo2  = C1.Xo2;
+  C2.Xso2 = C1.Xso2;
+
+  /* Pressure loss */
+  deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho^2;
+
+  /* Cv as a function of the valve position */
+  if (mode_caract == 0) then
+    Cv = Ouv.signal*Cvmax;
+  elseif (mode_caract == 1) then
+    if (option_interpolation == 1) then
+      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
+    elseif (option_interpolation == 2) then
+      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
+    else
+      assert(false, "ControlValve: incorrect interpolation option");
+    end if;
+  else
+    assert(false, "ControlValve : incorrect option for the computation of Cv");
+  end if;
+
+  /* Fluid thermodynamic properties */
+  P = (C1.P + C2.P)/2;
+  T = C1.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+  end if;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
+              {20,94},{32,84},{38,72},{40,54},{40,40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={128,255,0}),
+        Polygon(
+          points={{0,-60},{40,40},{-40,40},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{0,-60},{40,40},{-40,40},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
+              {20,94},{32,84},{38,72},{40,54},{40,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Window(
+      x=0.07,
+      y=0.13,
+      width=0.8,
+      height=0.77),
+    Documentation(info="<html>
+<p><h4>Copyright &copy; EDF 2002 - 2013</h4></p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end ControlValve;
diff --git a/ThermoSysPro/FlueGases/PressureLosses/InvSingularPressureLoss.mo b/ThermoSysPro/FlueGases/PressureLosses/InvSingularPressureLoss.mo
index 3919b1c1735530c45e7dd5924ca6e04ab51344d6..9a08897be52eb72c59b793d6d7cad49902b874de 100644
--- a/ThermoSysPro/FlueGases/PressureLosses/InvSingularPressureLoss.mo
+++ b/ThermoSysPro/FlueGases/PressureLosses/InvSingularPressureLoss.mo
@@ -1,97 +1,97 @@
-within ThermoSysPro.FlueGases.PressureLosses;
-model InvSingularPressureLoss "Inverse singular pressure loss"
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-
-protected
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3 "Small mass flow";
-
-public
-  Real K(start=10) "Pressure loss coefficient";
-  ThermoSysPro.Units.SI.PressureDifference deltaP(start=1.e2)
-    "Singular pressure loss";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow";
-  Units.SI.Density rho(start=1) "Fluid density";
-  Units.SI.Temperature T(start=300) "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-equation
-
-  C1.P - C2.P = deltaP;
-  C1.T = C2.T;
-  C1.Q = C2.Q;
-
-  C2.Xco2 = C1.Xco2;
-  C2.Xh2o = C1.Xh2o;
-  C2.Xo2  = C1.Xo2;
-  C2.Xso2 = C1.Xso2;
-
-  Q = C1.Q;
-
-  /* Pressure loss */
-  deltaP = if noEvent(abs(Q) < Qeps) then 1.e10 else K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-
-  /* Fluid thermodynamic properties */
-  P = (C1.P + C2.P)/2;
-  T = C1.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Window(
-      x=0.11,
-      y=0.04,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end InvSingularPressureLoss;
+within ThermoSysPro.FlueGases.PressureLosses;
+model InvSingularPressureLoss "Inverse singular pressure loss"
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+
+protected
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3 "Small mass flow";
+
+public
+  Real K(start=10) "Pressure loss coefficient";
+  ThermoSysPro.Units.SI.PressureDifference deltaP(start=1.e2)
+    "Singular pressure loss";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow";
+  Units.SI.Density rho(start=1) "Fluid density";
+  Units.SI.Temperature T(start=300) "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+equation
+
+  C1.P - C2.P = deltaP;
+  C1.T = C2.T;
+  C1.Q = C2.Q;
+
+  C2.Xco2 = C1.Xco2;
+  C2.Xh2o = C1.Xh2o;
+  C2.Xo2  = C1.Xo2;
+  C2.Xso2 = C1.Xso2;
+
+  Q = C1.Q;
+
+  /* Pressure loss */
+  deltaP = if noEvent(abs(Q) < Qeps) then 1.e10 else K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
+
+  /* Fluid thermodynamic properties */
+  P = (C1.P + C2.P)/2;
+  T = C1.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Window(
+      x=0.11,
+      y=0.04,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end InvSingularPressureLoss;
diff --git a/ThermoSysPro/FlueGases/PressureLosses/SingularPressureLoss.mo b/ThermoSysPro/FlueGases/PressureLosses/SingularPressureLoss.mo
index 0e182c64d51919162f81e0cdd589187555e27c41..36caca24383e7471c6a5035ed959d943731759d7 100644
--- a/ThermoSysPro/FlueGases/PressureLosses/SingularPressureLoss.mo
+++ b/ThermoSysPro/FlueGases/PressureLosses/SingularPressureLoss.mo
@@ -1,95 +1,95 @@
-within ThermoSysPro.FlueGases.PressureLosses;
-model SingularPressureLoss "Singular pressure loss for flue gases"
-  parameter Real K=1.e-3 "Friction pressure loss coefficient";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-
-protected
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  ThermoSysPro.Units.SI.PressureDifference deltaPf(start=1.e2)
-    "Friction pressure loss";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow";
-  Units.SI.Density rho(start=1) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Average fluid pressure";
-
-public
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-
-equation
-  C1.P - C2.P = deltaPf;
-  C1.T = C2.T; // Because the behaviour of the flue gas is close to an ideal gas
-  C1.Q = C2.Q;
-
-  C2.Xco2 = C1.Xco2;
-  C2.Xh2o = C1.Xh2o;
-  C2.Xo2  = C1.Xo2;
-  C2.Xso2 = C1.Xso2;
-
-  Q = C1.Q;
-
-  /* Pressure loss */
-  deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-
-  /* Fluid thermodynamic properties */
-  P = (C1.P + C2.P)/2;
-  T = C2.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Window(
-      x=0.11,
-      y=0.04,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SingularPressureLoss;
+within ThermoSysPro.FlueGases.PressureLosses;
+model SingularPressureLoss "Singular pressure loss for flue gases"
+  parameter Real K=1.e-3 "Friction pressure loss coefficient";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+
+protected
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  ThermoSysPro.Units.SI.PressureDifference deltaPf(start=1.e2)
+    "Friction pressure loss";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow";
+  Units.SI.Density rho(start=1) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Average fluid pressure";
+
+public
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet C2
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+
+equation
+  C1.P - C2.P = deltaPf;
+  C1.T = C2.T; // Because the behaviour of the flue gas is close to an ideal gas
+  C1.Q = C2.Q;
+
+  C2.Xco2 = C1.Xco2;
+  C2.Xh2o = C1.Xh2o;
+  C2.Xo2  = C1.Xo2;
+  C2.Xso2 = C1.Xso2;
+
+  Q = C1.Q;
+
+  /* Pressure loss */
+  deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
+
+  /* Fluid thermodynamic properties */
+  P = (C1.P + C2.P)/2;
+  T = C2.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Window(
+      x=0.11,
+      y=0.04,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SingularPressureLoss;
diff --git a/ThermoSysPro/FlueGases/PressureLosses/package.mo b/ThermoSysPro/FlueGases/PressureLosses/package.mo
index dd3b282b49e4258471d67f7aa1e9bbb87c8ab206..7bb995377bbf7a80e8885dfde786141f24cc3765 100644
--- a/ThermoSysPro/FlueGases/PressureLosses/package.mo
+++ b/ThermoSysPro/FlueGases/PressureLosses/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.FlueGases;
-package PressureLosses "Pressure losses"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end PressureLosses;
+within ThermoSysPro.FlueGases;
+package PressureLosses "Pressure losses"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end PressureLosses;
diff --git a/ThermoSysPro/FlueGases/Sensors/package.mo b/ThermoSysPro/FlueGases/Sensors/package.mo
index 07cbe3c3684b26a503af9217675c122de2c85636..94f43f31d4a3556dbe39ac167ad72434f12b1d97 100644
--- a/ThermoSysPro/FlueGases/Sensors/package.mo
+++ b/ThermoSysPro/FlueGases/Sensors/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.FlueGases;
-package Sensors "Sensors"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Sensors;
+within ThermoSysPro.FlueGases;
+package Sensors "Sensors"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Sensors;
diff --git a/ThermoSysPro/FlueGases/TAC/GTCICOBarilla.mo b/ThermoSysPro/FlueGases/TAC/GTCICOBarilla.mo
index 5bb8cbcd9bc28e716f1a3c4101e52ce48cdd3dac..be942529e90c99d8858a17a5db4420a0a9339a52 100644
--- a/ThermoSysPro/FlueGases/TAC/GTCICOBarilla.mo
+++ b/ThermoSysPro/FlueGases/TAC/GTCICOBarilla.mo
@@ -1,208 +1,208 @@
-within ThermoSysPro.FlueGases.TAC;
-model GTCICOBarilla "Combustion turbine for CICO and Barilla plants"
-
-  parameter Real comp_tau_n=11.5 "Nominal compression nominal rate";
-  parameter Real comp_eff_n=0.79257 "Compressor nominal efficiency";
-  parameter Real exp_tau_n=0.079255386 "Turbine nominal expansion rate";
-  parameter Real exp_eff_n=0.881225 "Turbine nominal efficiency";
-  parameter Real TurbQred=0.00449194 "Turbine reduced mass flow rate";
-  parameter Units.SI.Power Wpth=50000 "Combustion chamber thermal losses";
-
-  BoundaryConditions.AirHumidity xAIR
-                    annotation (Placement(transformation(
-        origin={-84,30},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.FlueGases.Machines.Compressor Compresseur(
-    tau_n=comp_tau_n,
-    is_eff_n=comp_eff_n,
-    tau(start=12.92),
-    Ps(start=12.92e5, fixed=false),
-    Te(start=660.36))                      annotation (Placement(transformation(
-          extent={{-80,-10},{-60,10}}, rotation=0)));
-  Junctions.Splitter2 separateur_Fumees
-    annotation (Placement(transformation(extent={{-40,-10},{-20,10}}, rotation=
-            0)));
-  ThermoSysPro.Combustion.CombustionChambers.GTCombustionChamber
-    chambreCombustionTAC(
-    Acham=1,
-    eta_comb=1,
-    Pea(start=11e5),
-    Qsf(start=150),
-    Qea(start=151),
-    Psf(start=12.6616e5),
-    Tsf(start=1350),
-    XsfH2O(start=4.59e-2),
-    XsfO2(start=1.56e-1),
-    XsfSO2(start=5.55e-10),
-    exc(start=3.35728),
-    Wpth=Wpth)         annotation (Placement(transformation(extent={{-10,40},{
-            10,60}}, rotation=0)));
-  Junctions.Mixer2 melangeur2_fumees2_1
-    annotation (Placement(transformation(extent={{20,-10},{40,10}}, rotation=0)));
-  ThermoSysPro.FlueGases.PressureLosses.InvSingularPressureLoss tub_fumees
-                                             annotation (Placement(
-        transformation(
-        origin={26,-30},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.FlueGases.Machines.CombustionTurbine TurbineAgaz(
-                    Q(start=160),
-    Wmech(start=42.3e6),
-    Ps(start=1.003e5),
-    Ts(start=800.16),
-    Qred=TurbQred,
-    is_eff_n=exp_eff_n,
-    tau_n=exp_tau_n)               annotation (Placement(transformation(extent=
-            {{60,-10},{80,10}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
-    KettleBoiler(
-    Kdpe=1,
-    W(start=1e6),
-    Hse(start=2000e3),
-    Kdpf=1000,
-    EffEch=0.9,
-    Tse(start=435),
-    Hee(start=4.71e5),
-    Qe(start=0.52))
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{-10,10},{10,-10}},
-        rotation=270)));
-  Connectors.FlueGasesInletI Entree_air
-    annotation (Placement(transformation(extent={{-104,-4},{-96,4}}, rotation=0)));
-  Connectors.FlueGasesOutletI Sortie_fumees
-    annotation (Placement(transformation(extent={{96,-4},{104,4}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI Entree_KB
-    annotation (Placement(transformation(extent={{-104,-84},{-96,-76}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI Sortie_KB
-    annotation (Placement(transformation(extent={{96,-84},{104,-76}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI Entree_eau_combustion
-    annotation (Placement(transformation(extent={{-64,96},{-56,104}}, rotation=
-            0)));
-  ThermoSysPro.Combustion.Connectors.FuelInletI Entree_combustible
-    annotation (Placement(transformation(extent={{56,96},{64,104}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Huminide
-    annotation (Placement(transformation(extent={{-108,56},{-100,64}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal PuissanceMeca
-    annotation (Placement(transformation(extent={{100,-44},{108,-36}}, rotation=
-           0)));
-  InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.90)
-    annotation (Placement(transformation(extent={{-50,10},{-40,20}}, rotation=0)));
-equation
-  connect(xAIR.C1, Entree_air) annotation (Line(
-      points={{-84,40},{-100,40},{-100,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Huminide, xAIR.humidity) annotation (Line(points={{-104,60},{-56,60},
-          {-56,30},{-73,30}}));
-  connect(tub_fumees.C2, melangeur2_fumees2_1.Ce2) annotation (Line(
-      points={{26,-20},{26,-10}},
-      color={0,0,0},
-      thickness=1));
-  connect(constante.y, separateur_Fumees.Ialpha1)
-    annotation (Line(points={{-39.5,15},{-34,15},{-34,6},{-29,6}}));
-  connect(Entree_KB, KettleBoiler.Cws1) annotation (Line(points={{-100,-80},{
-          -40,-80},{-40,-30},{6.12323e-016,-30},{6.12323e-016,-40}}));
-  connect(KettleBoiler.Cws2, Sortie_KB) annotation (Line(points={{-6.12323e-016,
-          -60},{0,-60},{0,-80},{100,-80}}, color={0,0,255}));
-  connect(KettleBoiler.Cfg1, separateur_Fumees.Cs2) annotation (Line(
-      points={{-9,-50},{-26,-50},{-26,-10}},
-      color={0,0,0},
-      thickness=1));
-  connect(KettleBoiler.Cfg2, tub_fumees.C1) annotation (Line(
-      points={{9,-49.95},{26,-49.95},{26,-40}},
-      color={0,0,0},
-      thickness=1));
-  connect(melangeur2_fumees2_1.Cs, TurbineAgaz.Ce) annotation (Line(
-      points={{40,0},{60,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(TurbineAgaz.Cs, Sortie_fumees) annotation (Line(
-      points={{80,0},{100,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(TurbineAgaz.MechPower, PuissanceMeca) annotation (Line(points={{81,-9},
-          {90,-9},{90,-40},{104,-40}}));
-  connect(Compresseur.Ce, xAIR.C2) annotation (Line(
-      points={{-77.5,0},{-84,0},{-84,20}},
-      color={0,0,0},
-      thickness=1));
-  connect(separateur_Fumees.Ce, Compresseur.Cs) annotation (Line(
-      points={{-40,0},{-62.5,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Compresseur.Power, TurbineAgaz.CompressorPower)
-    annotation (Line(points={{-62.5,-3},{-60,-3},{-60,-20},{56,-20},{56,-4},{59,
-          -4}}));
-  connect(separateur_Fumees.Cs1, chambreCombustionTAC.Ca) annotation (Line(
-      points={{-26,10},{-26,50},{-9,50}},
-      color={0,0,0},
-      thickness=1));
-  connect(chambreCombustionTAC.Cfg, melangeur2_fumees2_1.Ce1) annotation (Line(
-      points={{9,50},{26,50},{26,10}},
-      color={0,0,0},
-      thickness=1));
-  connect(chambreCombustionTAC.Cfuel, Entree_combustible) annotation (Line(
-        points={{0,41},{0,20},{60,20},{60,100}}, color={0,0,0}));
-  connect(Entree_eau_combustion, chambreCombustionTAC.Cws)
-    annotation (Line(points={{-60,100},{-60,80},{-6,80},{-6,59}}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics),
-                       Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Polygon(
-          points={{-100,72},{-100,-70},{-20,-20},{-20,20},{-100,72}},
-          lineColor={0,0,0},
-          fillColor={170,255,85},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,0},
-          fillColor={255,170,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{20,20},{20,-20},{100,-70},{100,70},{20,20}},
-          lineColor={0,0,0},
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-60},{20,-100}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-96,-80},{-20,-80},{-10,-68},{10,-94},{20,-80},{96,-80}},
-            color={0,0,255}),
-        Line(points={{-60,96},{-60,60},{-10,60},{-10,20}}, color={0,0,255}),
-        Text(
-          extent={{-12,-72},{12,-88}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "KB"),
-        Line(points={{-20,-20},{-20,-60}}, color={0,0,255}),
-        Line(points={{20,-20},{20,-60}}, color={0,0,255}),
-        Line(points={{60,96},{60,60},{8,60},{8,20}}, color={0,0,127})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end GTCICOBarilla;
+within ThermoSysPro.FlueGases.TAC;
+model GTCICOBarilla "Combustion turbine for CICO and Barilla plants"
+
+  parameter Real comp_tau_n=11.5 "Nominal compression nominal rate";
+  parameter Real comp_eff_n=0.79257 "Compressor nominal efficiency";
+  parameter Real exp_tau_n=0.079255386 "Turbine nominal expansion rate";
+  parameter Real exp_eff_n=0.881225 "Turbine nominal efficiency";
+  parameter Real TurbQred=0.00449194 "Turbine reduced mass flow rate";
+  parameter Units.SI.Power Wpth=50000 "Combustion chamber thermal losses";
+
+  BoundaryConditions.AirHumidity xAIR
+                    annotation (Placement(transformation(
+        origin={-84,30},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.FlueGases.Machines.Compressor Compresseur(
+    tau_n=comp_tau_n,
+    is_eff_n=comp_eff_n,
+    tau(start=12.92),
+    Ps(start=12.92e5, fixed=false),
+    Te(start=660.36))                      annotation (Placement(transformation(
+          extent={{-80,-10},{-60,10}}, rotation=0)));
+  Junctions.Splitter2 separateur_Fumees
+    annotation (Placement(transformation(extent={{-40,-10},{-20,10}}, rotation=
+            0)));
+  ThermoSysPro.Combustion.CombustionChambers.GTCombustionChamber
+    chambreCombustionTAC(
+    Acham=1,
+    eta_comb=1,
+    Pea(start=11e5),
+    Qsf(start=150),
+    Qea(start=151),
+    Psf(start=12.6616e5),
+    Tsf(start=1350),
+    XsfH2O(start=4.59e-2),
+    XsfO2(start=1.56e-1),
+    XsfSO2(start=5.55e-10),
+    exc(start=3.35728),
+    Wpth=Wpth)         annotation (Placement(transformation(extent={{-10,40},{
+            10,60}}, rotation=0)));
+  Junctions.Mixer2 melangeur2_fumees2_1
+    annotation (Placement(transformation(extent={{20,-10},{40,10}}, rotation=0)));
+  ThermoSysPro.FlueGases.PressureLosses.InvSingularPressureLoss tub_fumees
+                                             annotation (Placement(
+        transformation(
+        origin={26,-30},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.FlueGases.Machines.CombustionTurbine TurbineAgaz(
+                    Q(start=160),
+    Wmech(start=42.3e6),
+    Ps(start=1.003e5),
+    Ts(start=800.16),
+    Qred=TurbQred,
+    is_eff_n=exp_eff_n,
+    tau_n=exp_tau_n)               annotation (Placement(transformation(extent=
+            {{60,-10},{80,10}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
+    KettleBoiler(
+    Kdpe=1,
+    W(start=1e6),
+    Hse(start=2000e3),
+    Kdpf=1000,
+    EffEch=0.9,
+    Tse(start=435),
+    Hee(start=4.71e5),
+    Qe(start=0.52))
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{-10,10},{10,-10}},
+        rotation=270)));
+  Connectors.FlueGasesInletI Entree_air
+    annotation (Placement(transformation(extent={{-104,-4},{-96,4}}, rotation=0)));
+  Connectors.FlueGasesOutletI Sortie_fumees
+    annotation (Placement(transformation(extent={{96,-4},{104,4}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI Entree_KB
+    annotation (Placement(transformation(extent={{-104,-84},{-96,-76}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI Sortie_KB
+    annotation (Placement(transformation(extent={{96,-84},{104,-76}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI Entree_eau_combustion
+    annotation (Placement(transformation(extent={{-64,96},{-56,104}}, rotation=
+            0)));
+  ThermoSysPro.Combustion.Connectors.FuelInletI Entree_combustible
+    annotation (Placement(transformation(extent={{56,96},{64,104}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Huminide
+    annotation (Placement(transformation(extent={{-108,56},{-100,64}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal PuissanceMeca
+    annotation (Placement(transformation(extent={{100,-44},{108,-36}}, rotation=
+           0)));
+  InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.90)
+    annotation (Placement(transformation(extent={{-50,10},{-40,20}}, rotation=0)));
+equation
+  connect(xAIR.C1, Entree_air) annotation (Line(
+      points={{-84,40},{-100,40},{-100,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Huminide, xAIR.humidity) annotation (Line(points={{-104,60},{-56,60},
+          {-56,30},{-73,30}}));
+  connect(tub_fumees.C2, melangeur2_fumees2_1.Ce2) annotation (Line(
+      points={{26,-20},{26,-10}},
+      color={0,0,0},
+      thickness=1));
+  connect(constante.y, separateur_Fumees.Ialpha1)
+    annotation (Line(points={{-39.5,15},{-34,15},{-34,6},{-29,6}}));
+  connect(Entree_KB, KettleBoiler.Cws1) annotation (Line(points={{-100,-80},{
+          -40,-80},{-40,-30},{6.12323e-016,-30},{6.12323e-016,-40}}));
+  connect(KettleBoiler.Cws2, Sortie_KB) annotation (Line(points={{-6.12323e-016,
+          -60},{0,-60},{0,-80},{100,-80}}, color={0,0,255}));
+  connect(KettleBoiler.Cfg1, separateur_Fumees.Cs2) annotation (Line(
+      points={{-9,-50},{-26,-50},{-26,-10}},
+      color={0,0,0},
+      thickness=1));
+  connect(KettleBoiler.Cfg2, tub_fumees.C1) annotation (Line(
+      points={{9,-49.95},{26,-49.95},{26,-40}},
+      color={0,0,0},
+      thickness=1));
+  connect(melangeur2_fumees2_1.Cs, TurbineAgaz.Ce) annotation (Line(
+      points={{40,0},{60,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(TurbineAgaz.Cs, Sortie_fumees) annotation (Line(
+      points={{80,0},{100,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(TurbineAgaz.MechPower, PuissanceMeca) annotation (Line(points={{81,-9},
+          {90,-9},{90,-40},{104,-40}}));
+  connect(Compresseur.Ce, xAIR.C2) annotation (Line(
+      points={{-77.5,0},{-84,0},{-84,20}},
+      color={0,0,0},
+      thickness=1));
+  connect(separateur_Fumees.Ce, Compresseur.Cs) annotation (Line(
+      points={{-40,0},{-62.5,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Compresseur.Power, TurbineAgaz.CompressorPower)
+    annotation (Line(points={{-62.5,-3},{-60,-3},{-60,-20},{56,-20},{56,-4},{59,
+          -4}}));
+  connect(separateur_Fumees.Cs1, chambreCombustionTAC.Ca) annotation (Line(
+      points={{-26,10},{-26,50},{-9,50}},
+      color={0,0,0},
+      thickness=1));
+  connect(chambreCombustionTAC.Cfg, melangeur2_fumees2_1.Ce1) annotation (Line(
+      points={{9,50},{26,50},{26,10}},
+      color={0,0,0},
+      thickness=1));
+  connect(chambreCombustionTAC.Cfuel, Entree_combustible) annotation (Line(
+        points={{0,41},{0,20},{60,20},{60,100}}, color={0,0,0}));
+  connect(Entree_eau_combustion, chambreCombustionTAC.Cws)
+    annotation (Line(points={{-60,100},{-60,80},{-6,80},{-6,59}}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics),
+                       Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Polygon(
+          points={{-100,72},{-100,-70},{-20,-20},{-20,20},{-100,72}},
+          lineColor={0,0,0},
+          fillColor={170,255,85},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,0},
+          fillColor={255,170,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{20,20},{20,-20},{100,-70},{100,70},{20,20}},
+          lineColor={0,0,0},
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-60},{20,-100}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-96,-80},{-20,-80},{-10,-68},{10,-94},{20,-80},{96,-80}},
+            color={0,0,255}),
+        Line(points={{-60,96},{-60,60},{-10,60},{-10,20}}, color={0,0,255}),
+        Text(
+          extent={{-12,-72},{12,-88}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "KB"),
+        Line(points={{-20,-20},{-20,-60}}, color={0,0,255}),
+        Line(points={{20,-20},{20,-60}}, color={0,0,255}),
+        Line(points={{60,96},{60,60},{8,60},{8,20}}, color={0,0,127})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end GTCICOBarilla;
diff --git a/ThermoSysPro/FlueGases/TAC/GasTurbine.mo b/ThermoSysPro/FlueGases/TAC/GasTurbine.mo
index 0912e7fc6e88f381dea2cc3b86d801cb47d69269..f2cd7a18a3011d89ffd0742c7710991e702995e5 100644
--- a/ThermoSysPro/FlueGases/TAC/GasTurbine.mo
+++ b/ThermoSysPro/FlueGases/TAC/GasTurbine.mo
@@ -1,147 +1,147 @@
-within ThermoSysPro.FlueGases.TAC;
-model GasTurbine "Combustion turbine for CICO and Barilla plants"
-
-  parameter Real comp_tau_n=15 "Nominal compression nominal rate";
-  parameter Real comp_eff_n=0.9 "Compressor nominal efficiency";
-  parameter Real A0 = 0.1725914;
-  parameter Real A1 = 1.46222;
-  parameter Real A2 = -0.634857;
-  parameter Real A3 = 0;
-  parameter Real A4 = 0;
-  parameter Real exp_tau_n=0.05 "Turbine nominal expansion rate";
-  parameter Real exp_eff_n=0.9 "Turbine nominal efficiency";
-  parameter Real TurbQred=0.01 "Turbine reduced mass flow rate";
-////old
-  //parameter Real B0 = 0.3735955;
-  //parameter Real B1 = 1.42460674;
-  //parameter Real B2 = -0.80865168;
-  parameter Real B0 = 0.95223;
-  parameter Real B1 = 0.09555;
-  parameter Real B2 = -0.04778;
-
-  parameter Real Kcham = 1 "Chamber pressure loss coefficient";
-  parameter Units.SI.Power Wpth=1e5 "Combustion chamber thermal losses";
-
-  BoundaryConditions.AirHumidity xAIR
-                    annotation (Placement(transformation(
-        origin={-84,30},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.FlueGases.Machines.Compressor Compresseur(
-    A4=A4,
-    A3=A3,
-    A2=A2,
-    A1=A1,
-    A0=A0,
-    tau_n=comp_tau_n,
-    is_eff_n=comp_eff_n)                   annotation (Placement(transformation(
-          extent={{-82,-28},{-32,28}}, rotation=0)));
-  Combustion.CombustionChambers.GTCombustionChamber chambreCombustionTAC(
-    Acham=1,
-    eta_comb=1,
-    kcham=Kcham,
-    Pea(start=13.8e5),
-    Wpth=Wpth,
-    Qsf(start=500),
-    Qfuel(start=10),
-    Psf(start=13.2e5),
-    Tsf(start=1495))   annotation (Placement(transformation(extent={{-25,31},{
-            25,83}}, rotation=0)));
-  ThermoSysPro.FlueGases.Machines.CombustionTurbine TurbineAgaz(
-    Te(start=1495),
-    Pe(start=13.2e5),
-    A2=B2,
-    A1=B1,
-    A0=B0,
-    tau_n=exp_tau_n,
-    Qred=TurbQred,
-    Ps(fixed=false, start=1.013e5),
-    is_eff_n=exp_eff_n,
-    Ts(start=894.518, fixed=false))
-                                   annotation (Placement(transformation(extent=
-            {{47,-22},{79,22}}, rotation=0)));
-  Connectors.FlueGasesInletI Entree_air
-    annotation (Placement(transformation(extent={{-104,-4},{-96,4}}, rotation=0)));
-  Connectors.FlueGasesOutletI Sortie_fumees
-    annotation (Placement(transformation(extent={{96,-4},{104,4}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI Entree_eau_combustion
-    annotation (Placement(transformation(extent={{-64,96},{-56,104}}, rotation=
-            0)));
-  ThermoSysPro.Combustion.Connectors.FuelInletI Entree_combustible
-    annotation (Placement(transformation(extent={{56,96},{64,104}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Huminide
-    annotation (Placement(transformation(extent={{-108,56},{-100,64}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal PuissanceMeca
-    annotation (Placement(transformation(extent={{100,-44},{108,-36}}, rotation=
-           0)));
-equation
-  connect(Huminide, xAIR.humidity) annotation (Line(points={{-104,60},{-56,60},
-          {-56,30},{-73,30}}));
-  connect(TurbineAgaz.MechPower, PuissanceMeca) annotation (Line(points={{80.6,
-          -19.8},{90,-19.8},{90,-40},{104,-40}}));
-  connect(Compresseur.Power, TurbineAgaz.CompressorPower)
-    annotation (Line(points={{-38.25,-8.4},{46,-8.4},{46,-8},{45.4,-8.8}}));
-  connect(xAIR.C2, Compresseur.Ce) annotation (Line(
-      points={{-84,20},{-84,3.55271e-015},{-75.75,3.55271e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(TurbineAgaz.Cs, Sortie_fumees) annotation (Line(
-      points={{79,0},{100,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(xAIR.C1, Entree_air) annotation (Line(
-      points={{-84,40},{-100,40},{-100,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Compresseur.Cs, chambreCombustionTAC.Ca) annotation (Line(
-      points={{-38.25,3.55271e-015},{-32,3.55271e-015},{-32,57},{-22.5,57}},
-      color={0,0,0},
-      thickness=1));
-  connect(chambreCombustionTAC.Cfg, TurbineAgaz.Ce) annotation (Line(
-      points={{22.5,57},{32,57},{32,0},{47,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Entree_eau_combustion, chambreCombustionTAC.Cws)
-    annotation (Line(points={{-60,100},{-60,90},{-15,90},{-15,80.4}}));
-  connect(chambreCombustionTAC.Cfuel, Entree_combustible) annotation (Line(
-        points={{0,33.6},{0,20},{60,20},{60,100}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics),
-                       Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Polygon(
-          points={{-100,72},{-100,-70},{-20,-20},{-20,20},{-100,72}},
-          lineColor={0,0,0},
-          fillColor={170,255,85},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,0},
-          fillColor={170,255,213},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{20,20},{20,-20},{100,-70},{100,70},{20,20}},
-          lineColor={0,0,0},
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,96},{-60,60},{-10,60},{-10,20}}, color={0,0,255}),
-        Line(points={{60,96},{60,60},{8,60},{8,20}}, color={0,0,127})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end GasTurbine;
+within ThermoSysPro.FlueGases.TAC;
+model GasTurbine "Combustion turbine for CICO and Barilla plants"
+
+  parameter Real comp_tau_n=15 "Nominal compression nominal rate";
+  parameter Real comp_eff_n=0.9 "Compressor nominal efficiency";
+  parameter Real A0 = 0.1725914;
+  parameter Real A1 = 1.46222;
+  parameter Real A2 = -0.634857;
+  parameter Real A3 = 0;
+  parameter Real A4 = 0;
+  parameter Real exp_tau_n=0.05 "Turbine nominal expansion rate";
+  parameter Real exp_eff_n=0.9 "Turbine nominal efficiency";
+  parameter Real TurbQred=0.01 "Turbine reduced mass flow rate";
+////old
+  //parameter Real B0 = 0.3735955;
+  //parameter Real B1 = 1.42460674;
+  //parameter Real B2 = -0.80865168;
+  parameter Real B0 = 0.95223;
+  parameter Real B1 = 0.09555;
+  parameter Real B2 = -0.04778;
+
+  parameter Real Kcham = 1 "Chamber pressure loss coefficient";
+  parameter Units.SI.Power Wpth=1e5 "Combustion chamber thermal losses";
+
+  BoundaryConditions.AirHumidity xAIR
+                    annotation (Placement(transformation(
+        origin={-84,30},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.FlueGases.Machines.Compressor Compresseur(
+    A4=A4,
+    A3=A3,
+    A2=A2,
+    A1=A1,
+    A0=A0,
+    tau_n=comp_tau_n,
+    is_eff_n=comp_eff_n)                   annotation (Placement(transformation(
+          extent={{-82,-28},{-32,28}}, rotation=0)));
+  Combustion.CombustionChambers.GTCombustionChamber chambreCombustionTAC(
+    Acham=1,
+    eta_comb=1,
+    kcham=Kcham,
+    Pea(start=13.8e5),
+    Wpth=Wpth,
+    Qsf(start=500),
+    Qfuel(start=10),
+    Psf(start=13.2e5),
+    Tsf(start=1495))   annotation (Placement(transformation(extent={{-25,31},{
+            25,83}}, rotation=0)));
+  ThermoSysPro.FlueGases.Machines.CombustionTurbine TurbineAgaz(
+    Te(start=1495),
+    Pe(start=13.2e5),
+    A2=B2,
+    A1=B1,
+    A0=B0,
+    tau_n=exp_tau_n,
+    Qred=TurbQred,
+    Ps(fixed=false, start=1.013e5),
+    is_eff_n=exp_eff_n,
+    Ts(start=894.518, fixed=false))
+                                   annotation (Placement(transformation(extent=
+            {{47,-22},{79,22}}, rotation=0)));
+  Connectors.FlueGasesInletI Entree_air
+    annotation (Placement(transformation(extent={{-104,-4},{-96,4}}, rotation=0)));
+  Connectors.FlueGasesOutletI Sortie_fumees
+    annotation (Placement(transformation(extent={{96,-4},{104,4}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI Entree_eau_combustion
+    annotation (Placement(transformation(extent={{-64,96},{-56,104}}, rotation=
+            0)));
+  ThermoSysPro.Combustion.Connectors.FuelInletI Entree_combustible
+    annotation (Placement(transformation(extent={{56,96},{64,104}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Huminide
+    annotation (Placement(transformation(extent={{-108,56},{-100,64}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal PuissanceMeca
+    annotation (Placement(transformation(extent={{100,-44},{108,-36}}, rotation=
+           0)));
+equation
+  connect(Huminide, xAIR.humidity) annotation (Line(points={{-104,60},{-56,60},
+          {-56,30},{-73,30}}));
+  connect(TurbineAgaz.MechPower, PuissanceMeca) annotation (Line(points={{80.6,
+          -19.8},{90,-19.8},{90,-40},{104,-40}}));
+  connect(Compresseur.Power, TurbineAgaz.CompressorPower)
+    annotation (Line(points={{-38.25,-8.4},{46,-8.4},{46,-8},{45.4,-8.8}}));
+  connect(xAIR.C2, Compresseur.Ce) annotation (Line(
+      points={{-84,20},{-84,3.55271e-015},{-75.75,3.55271e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(TurbineAgaz.Cs, Sortie_fumees) annotation (Line(
+      points={{79,0},{100,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(xAIR.C1, Entree_air) annotation (Line(
+      points={{-84,40},{-100,40},{-100,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Compresseur.Cs, chambreCombustionTAC.Ca) annotation (Line(
+      points={{-38.25,3.55271e-015},{-32,3.55271e-015},{-32,57},{-22.5,57}},
+      color={0,0,0},
+      thickness=1));
+  connect(chambreCombustionTAC.Cfg, TurbineAgaz.Ce) annotation (Line(
+      points={{22.5,57},{32,57},{32,0},{47,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Entree_eau_combustion, chambreCombustionTAC.Cws)
+    annotation (Line(points={{-60,100},{-60,90},{-15,90},{-15,80.4}}));
+  connect(chambreCombustionTAC.Cfuel, Entree_combustible) annotation (Line(
+        points={{0,33.6},{0,20},{60,20},{60,100}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics),
+                       Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Polygon(
+          points={{-100,72},{-100,-70},{-20,-20},{-20,20},{-100,72}},
+          lineColor={0,0,0},
+          fillColor={170,255,85},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,0},
+          fillColor={170,255,213},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{20,20},{20,-20},{100,-70},{100,70},{20,20}},
+          lineColor={0,0,0},
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,96},{-60,60},{-10,60},{-10,20}}, color={0,0,255}),
+        Line(points={{60,96},{60,60},{8,60},{8,20}}, color={0,0,127})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end GasTurbine;
diff --git a/ThermoSysPro/FlueGases/TAC/package.mo b/ThermoSysPro/FlueGases/TAC/package.mo
index 985b078385fc26d587bcd3e7c8aba3ba95e43822..34586bfafb371be7edd04fbdf0b9ac6a81b79cc6 100644
--- a/ThermoSysPro/FlueGases/TAC/package.mo
+++ b/ThermoSysPro/FlueGases/TAC/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.FlueGases;
-package TAC "Combustion turbines"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end TAC;
+within ThermoSysPro.FlueGases;
+package TAC "Combustion turbines"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end TAC;
diff --git a/ThermoSysPro/FlueGases/Volumes/VolumeATh.mo b/ThermoSysPro/FlueGases/Volumes/VolumeATh.mo
index 80f5712d4ccd43e2b894f68d3c37a41756a411dc..7dc6dc8cc8433e8809a7bfec16b2d6f24418b444 100644
--- a/ThermoSysPro/FlueGases/Volumes/VolumeATh.mo
+++ b/ThermoSysPro/FlueGases/Volumes/VolumeATh.mo
@@ -1,244 +1,244 @@
-within ThermoSysPro.FlueGases.Volumes;
-model VolumeATh
-  "Mixing flue gases volume with 2 inlets and 2 outlets and thermal input"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.Temperature T0=400
-    "Initial fluid temperature (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean dynamic_composition_balance=false
-    "true: dynamic fluid composition balance equation - false: static fluid composition balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Real Xco20 = 0.0  "CO2 mass fraction (active if steady_state=false)";
-  parameter Real Xh2o0 = 0.05 "H20 mass fraction (active if steady_state=false)";
-  parameter Real Xo20 = 0.23 "O2 mass fraction (active if steady_state=false)";
-  parameter Real Xso20 = 0 "SO2 mass fraction (active if steady_state=false)";
-
-public
-  Units.SI.Temperature T(start=500) "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=1) "Fluid density";
-  Units.SI.SpecificHeatCapacity cp(start=1000) "Fluid spécific heat capacity";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H20 mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  Units.SI.SpecificEnthalpy he1(start=100000)
-    "Fluid specific enthalpy at inlet #1";
-  Units.SI.SpecificEnthalpy he2(start=100000)
-    "Fluid specific enthalpy at inlet #2";
-  Units.SI.SpecificEnthalpy hs1(start=100000)
-    "Fluid specific enthalpy at outlet #1";
-  Units.SI.SpecificEnthalpy hs2(start=100000)
-    "Fluid specific enthalpy at outlet #2";
-
-  Connectors.FlueGasesInlet Ce1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FlueGasesOutlet Cs2
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Connectors.FlueGasesOutlet Cs1
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Connectors.FlueGasesInlet Ce2
-    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P0, T0, Xco20, Xh2o0, Xo20, Xso20);
-  end if;
-
-  if dynamic_composition_balance then
-    if steady_state then
-      der(Xco2) = 0;
-      der(Xh2o) = 0;
-      der(Xo2) = 0;
-      der(Xso2) = 0;
-    else
-      Xco2 = Xco20;
-      Xh2o = Xh2o0;
-      Xo2 = Xo20;
-      Xso2 = Xso20;
-    end if;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.T = 400;
-    Ce1.Xco2 = 0.20;
-    Ce1.Xh2o = 0.05;
-    Ce1.Xo2 = 0.25;
-    Ce1.Xso2 = 0;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.T = 400;
-    Ce2.Xco2 = 0.20;
-    Ce2.Xh2o = 0.05;
-    Ce2.Xo2 = 0.25;
-    Ce2.Xso2 = 0;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-
-  if dynamic_mass_balance then
-    V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2)*der(P)
-     + ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2)*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr) + Cth.W;
-
-  if dynamic_mass_balance then
-    V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P)
-     + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH;
-  else
-    V*rho*der(h - Xh2o*hr) = BH;
-  end if;
-
-  Cs1.T = T;
-  Cs2.T = T;
-  Cth.T = T;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  if dynamic_composition_balance then
-    V*rho*der(Xco2) + Xco2*BQ = BXco2;
-    V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-    V*rho*der(Xo2) + Xo2*BQ = BXo2;
-    V*rho*der(Xso2) + Xso2*BQ = BXso2;
-  else
-    Xco2*BQ = BXco2;
-    Xh2o*BQ = BXh2o;
-    Xo2*BQ = BXo2;
-    Xso2*BQ = BXso2;
-  end if;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2 = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2 = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  /* Fluid thermodynamic properties */
-  he1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce1.T, Ce1.Xco2, Ce1.Xh2o, Ce1.Xo2, Ce1.Xso2);
-  he2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce2.T, Ce2.Xco2, Ce2.Xh2o, Ce2.Xo2, Ce2.Xso2);
-  hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs1.T, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-  hs2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs2.T, Cs2.Xco2, Cs2.Xh2o, Cs2.Xo2, Cs2.Xso2);
-
-  //T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2, Xso2);
-  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  cp = ThermoSysPro.Properties.FlueGases.FlueGases_cp(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
-        Line(points={{60,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,60}}, color={0,0,255}),
-        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
-        Line(points={{60,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,60}}, color={0,0,255}),
-        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
-    Window(
-      x=0.16,
-      y=0.27,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeATh;
+within ThermoSysPro.FlueGases.Volumes;
+model VolumeATh
+  "Mixing flue gases volume with 2 inlets and 2 outlets and thermal input"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.Temperature T0=400
+    "Initial fluid temperature (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean dynamic_composition_balance=false
+    "true: dynamic fluid composition balance equation - false: static fluid composition balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Real Xco20 = 0.0  "CO2 mass fraction (active if steady_state=false)";
+  parameter Real Xh2o0 = 0.05 "H20 mass fraction (active if steady_state=false)";
+  parameter Real Xo20 = 0.23 "O2 mass fraction (active if steady_state=false)";
+  parameter Real Xso20 = 0 "SO2 mass fraction (active if steady_state=false)";
+
+public
+  Units.SI.Temperature T(start=500) "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=1) "Fluid density";
+  Units.SI.SpecificHeatCapacity cp(start=1000) "Fluid spécific heat capacity";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H20 mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  Units.SI.SpecificEnthalpy he1(start=100000)
+    "Fluid specific enthalpy at inlet #1";
+  Units.SI.SpecificEnthalpy he2(start=100000)
+    "Fluid specific enthalpy at inlet #2";
+  Units.SI.SpecificEnthalpy hs1(start=100000)
+    "Fluid specific enthalpy at outlet #1";
+  Units.SI.SpecificEnthalpy hs2(start=100000)
+    "Fluid specific enthalpy at outlet #2";
+
+  Connectors.FlueGasesInlet Ce1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FlueGasesOutlet Cs2
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Connectors.FlueGasesOutlet Cs1
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Connectors.FlueGasesInlet Ce2
+    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P0, T0, Xco20, Xh2o0, Xo20, Xso20);
+  end if;
+
+  if dynamic_composition_balance then
+    if steady_state then
+      der(Xco2) = 0;
+      der(Xh2o) = 0;
+      der(Xo2) = 0;
+      der(Xso2) = 0;
+    else
+      Xco2 = Xco20;
+      Xh2o = Xh2o0;
+      Xo2 = Xo20;
+      Xso2 = Xso20;
+    end if;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.T = 400;
+    Ce1.Xco2 = 0.20;
+    Ce1.Xh2o = 0.05;
+    Ce1.Xo2 = 0.25;
+    Ce1.Xso2 = 0;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.T = 400;
+    Ce2.Xco2 = 0.20;
+    Ce2.Xh2o = 0.05;
+    Ce2.Xo2 = 0.25;
+    Ce2.Xso2 = 0;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+
+  if dynamic_mass_balance then
+    V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2)*der(P)
+     + ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2)*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr) + Cth.W;
+
+  if dynamic_mass_balance then
+    V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P)
+     + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH;
+  else
+    V*rho*der(h - Xh2o*hr) = BH;
+  end if;
+
+  Cs1.T = T;
+  Cs2.T = T;
+  Cth.T = T;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  if dynamic_composition_balance then
+    V*rho*der(Xco2) + Xco2*BQ = BXco2;
+    V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+    V*rho*der(Xo2) + Xo2*BQ = BXo2;
+    V*rho*der(Xso2) + Xso2*BQ = BXso2;
+  else
+    Xco2*BQ = BXco2;
+    Xh2o*BQ = BXh2o;
+    Xo2*BQ = BXo2;
+    Xso2*BQ = BXso2;
+  end if;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2 = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2 = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  /* Fluid thermodynamic properties */
+  he1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce1.T, Ce1.Xco2, Ce1.Xh2o, Ce1.Xo2, Ce1.Xso2);
+  he2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce2.T, Ce2.Xco2, Ce2.Xh2o, Ce2.Xo2, Ce2.Xso2);
+  hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs1.T, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+  hs2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs2.T, Cs2.Xco2, Cs2.Xh2o, Cs2.Xo2, Cs2.Xso2);
+
+  //T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2, Xso2);
+  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  cp = ThermoSysPro.Properties.FlueGases.FlueGases_cp(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
+        Line(points={{60,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,60}}, color={0,0,255}),
+        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
+        Line(points={{60,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,60}}, color={0,0,255}),
+        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
+    Window(
+      x=0.16,
+      y=0.27,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeATh;
diff --git a/ThermoSysPro/FlueGases/Volumes/VolumeBTh.mo b/ThermoSysPro/FlueGases/Volumes/VolumeBTh.mo
index 248de1f5e96ec8eb4aa7ebd376a24bf3f4fe18f6..607b2a1ee8cc2a3d96b385a1826b83d3347efafc 100644
--- a/ThermoSysPro/FlueGases/Volumes/VolumeBTh.mo
+++ b/ThermoSysPro/FlueGases/Volumes/VolumeBTh.mo
@@ -1,244 +1,244 @@
-within ThermoSysPro.FlueGases.Volumes;
-model VolumeBTh
-  "Mixing flue gases volume with 2 inlets and 2 outlets and thermal input"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.Temperature T0=400
-    "Initial fluid temperature (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean dynamic_composition_balance=false
-    "true: dynamic fluid composition balance equation - false: static fluid composition balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Real Xco20 = 0.0  "CO2 mass fraction (active if steady_state=false)";
-  parameter Real Xh2o0 = 0.05 "H20 mass fraction (active if steady_state=false)";
-  parameter Real Xo20 = 0.23 "O2 mass fraction (active if steady_state=false)";
-  parameter Real Xso20 = 0 "SO2 mass fraction (active if steady_state=false)";
-
-public
-  Units.SI.Temperature T(start=500) "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=1) "Fluid density";
-  Units.SI.SpecificHeatCapacity cp(start=1000) "Fluid spécific heat capacity";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H20 mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  Units.SI.SpecificEnthalpy he1(start=100000)
-    "Fluid specific enthalpy at inlet #1";
-  Units.SI.SpecificEnthalpy he2(start=100000)
-    "Fluid specific enthalpy at inlet #2";
-  Units.SI.SpecificEnthalpy hs1(start=100000)
-    "Fluid specific enthalpy at outlet #1";
-  Units.SI.SpecificEnthalpy hs2(start=100000)
-    "Fluid specific enthalpy at outlet #2";
-
-  Connectors.FlueGasesInlet Ce1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FlueGasesOutlet Cs2
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Connectors.FlueGasesOutlet Cs1
-    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Connectors.FlueGasesInlet Ce2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P0, T0, Xco20, Xh2o0, Xo20, Xso20);
-  end if;
-
-  if dynamic_composition_balance then
-    if steady_state then
-      der(Xco2) = 0;
-      der(Xh2o) = 0;
-      der(Xo2) = 0;
-      der(Xso2) = 0;
-    else
-      Xco2 = Xco20;
-      Xh2o = Xh2o0;
-      Xo2 = Xo20;
-      Xso2 = Xso20;
-    end if;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.T = 400;
-    Ce1.Xco2 = 0.20;
-    Ce1.Xh2o = 0.05;
-    Ce1.Xo2 = 0.25;
-    Ce1.Xso2 = 0;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.T = 400;
-    Ce2.Xco2 = 0.20;
-    Ce2.Xh2o = 0.05;
-    Ce2.Xo2 = 0.25;
-    Ce2.Xso2 = 0;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-
-  if dynamic_mass_balance then
-    V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2)*der(P)
-     + ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2)*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr) + Cth.W;
-
-  if dynamic_mass_balance then
-    V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P)
-     + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH;
-  else
-    V*rho*der(h - Xh2o*hr) = BH;
-  end if;
-
-  Cs1.T = T;
-  Cs2.T = T;
-  Cth.T = T;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  if dynamic_composition_balance then
-    V*rho*der(Xco2) + Xco2*BQ = BXco2;
-    V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-    V*rho*der(Xo2) + Xo2*BQ = BXo2;
-    V*rho*der(Xso2) + Xso2*BQ = BXso2;
-  else
-    Xco2*BQ = BXco2;
-    Xh2o*BQ = BXh2o;
-    Xo2*BQ = BXo2;
-    Xso2*BQ = BXso2;
-  end if;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2 = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2 = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  /* Fluid thermodynamic properties */
-  he1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce1.T, Ce1.Xco2, Ce1.Xh2o, Ce1.Xo2, Ce1.Xso2);
-  he2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce2.T, Ce2.Xco2, Ce2.Xh2o, Ce2.Xo2, Ce2.Xso2);
-  hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs1.T, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-  hs2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs2.T, Cs2.Xco2, Cs2.Xh2o, Cs2.Xo2, Cs2.Xso2);
-
-  //T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2, Xso2);
-  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  cp = ThermoSysPro.Properties.FlueGases.FlueGases_cp(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
-        Line(points={{60,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,60}}, color={0,0,255}),
-        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
-        Line(points={{60,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,60}}, color={0,0,255}),
-        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
-    Window(
-      x=0.16,
-      y=0.27,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeBTh;
+within ThermoSysPro.FlueGases.Volumes;
+model VolumeBTh
+  "Mixing flue gases volume with 2 inlets and 2 outlets and thermal input"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.Temperature T0=400
+    "Initial fluid temperature (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean dynamic_composition_balance=false
+    "true: dynamic fluid composition balance equation - false: static fluid composition balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Real Xco20 = 0.0  "CO2 mass fraction (active if steady_state=false)";
+  parameter Real Xh2o0 = 0.05 "H20 mass fraction (active if steady_state=false)";
+  parameter Real Xo20 = 0.23 "O2 mass fraction (active if steady_state=false)";
+  parameter Real Xso20 = 0 "SO2 mass fraction (active if steady_state=false)";
+
+public
+  Units.SI.Temperature T(start=500) "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=1) "Fluid density";
+  Units.SI.SpecificHeatCapacity cp(start=1000) "Fluid spécific heat capacity";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H20 mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  Units.SI.SpecificEnthalpy he1(start=100000)
+    "Fluid specific enthalpy at inlet #1";
+  Units.SI.SpecificEnthalpy he2(start=100000)
+    "Fluid specific enthalpy at inlet #2";
+  Units.SI.SpecificEnthalpy hs1(start=100000)
+    "Fluid specific enthalpy at outlet #1";
+  Units.SI.SpecificEnthalpy hs2(start=100000)
+    "Fluid specific enthalpy at outlet #2";
+
+  Connectors.FlueGasesInlet Ce1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FlueGasesOutlet Cs2
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Connectors.FlueGasesOutlet Cs1
+    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Connectors.FlueGasesInlet Ce2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P0, T0, Xco20, Xh2o0, Xo20, Xso20);
+  end if;
+
+  if dynamic_composition_balance then
+    if steady_state then
+      der(Xco2) = 0;
+      der(Xh2o) = 0;
+      der(Xo2) = 0;
+      der(Xso2) = 0;
+    else
+      Xco2 = Xco20;
+      Xh2o = Xh2o0;
+      Xo2 = Xo20;
+      Xso2 = Xso20;
+    end if;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.T = 400;
+    Ce1.Xco2 = 0.20;
+    Ce1.Xh2o = 0.05;
+    Ce1.Xo2 = 0.25;
+    Ce1.Xso2 = 0;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.T = 400;
+    Ce2.Xco2 = 0.20;
+    Ce2.Xh2o = 0.05;
+    Ce2.Xo2 = 0.25;
+    Ce2.Xso2 = 0;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+
+  if dynamic_mass_balance then
+    V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2)*der(P)
+     + ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2)*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr) + Cth.W;
+
+  if dynamic_mass_balance then
+    V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P)
+     + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH;
+  else
+    V*rho*der(h - Xh2o*hr) = BH;
+  end if;
+
+  Cs1.T = T;
+  Cs2.T = T;
+  Cth.T = T;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  if dynamic_composition_balance then
+    V*rho*der(Xco2) + Xco2*BQ = BXco2;
+    V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+    V*rho*der(Xo2) + Xo2*BQ = BXo2;
+    V*rho*der(Xso2) + Xso2*BQ = BXso2;
+  else
+    Xco2*BQ = BXco2;
+    Xh2o*BQ = BXh2o;
+    Xo2*BQ = BXo2;
+    Xso2*BQ = BXso2;
+  end if;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2 = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2 = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  /* Fluid thermodynamic properties */
+  he1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce1.T, Ce1.Xco2, Ce1.Xh2o, Ce1.Xo2, Ce1.Xso2);
+  he2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce2.T, Ce2.Xco2, Ce2.Xh2o, Ce2.Xo2, Ce2.Xso2);
+  hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs1.T, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+  hs2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs2.T, Cs2.Xco2, Cs2.Xh2o, Cs2.Xo2, Cs2.Xso2);
+
+  //T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2, Xso2);
+  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  cp = ThermoSysPro.Properties.FlueGases.FlueGases_cp(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
+        Line(points={{60,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,60}}, color={0,0,255}),
+        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
+        Line(points={{60,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,60}}, color={0,0,255}),
+        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
+    Window(
+      x=0.16,
+      y=0.27,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeBTh;
diff --git a/ThermoSysPro/FlueGases/Volumes/VolumeCTh.mo b/ThermoSysPro/FlueGases/Volumes/VolumeCTh.mo
index b9dcf5975b368f0551dff96191fb1382454fd1c9..40eaa14ff7b3210b6f203b805873b6b930e9b2a8 100644
--- a/ThermoSysPro/FlueGases/Volumes/VolumeCTh.mo
+++ b/ThermoSysPro/FlueGases/Volumes/VolumeCTh.mo
@@ -1,243 +1,243 @@
-within ThermoSysPro.FlueGases.Volumes;
-model VolumeCTh
-  "Mixing flue gases volume with 3 inlets and 1 outlet and thermal input"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.Temperature T0=400
-    "Initial fluid temperature (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean dynamic_composition_balance=false
-    "true: dynamic fluid composition balance equation - false: static fluid composition balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Real Xco20 = 0.0  "CO2 mass fraction (active if steady_state=false)";
-  parameter Real Xh2o0 = 0.05 "H20 mass fraction (active if steady_state=false)";
-  parameter Real Xo20 = 0.23 "O2 mass fraction (active if steady_state=false)";
-  parameter Real Xso20 = 0 "SO2 mass fraction (active if steady_state=false)";
-
-public
-  Units.SI.Temperature T(start=500) "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=1) "Fluid density";
-  Units.SI.SpecificHeatCapacity cp(start=1000) "Fluid spécific heat capacity";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H20 mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  Units.SI.SpecificEnthalpy he1(start=100000)
-    "Fluid specific enthalpy at inlet #1";
-  Units.SI.SpecificEnthalpy he2(start=100000)
-    "Fluid specific enthalpy at inlet #2";
-  Units.SI.SpecificEnthalpy he3(start=100000)
-    "Fluid specific enthalpy at inlet #3";
-  Units.SI.SpecificEnthalpy hs(start=100000)
-    "Fluid specific enthalpy at the outlet";
-
-  Connectors.FlueGasesInlet Ce1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FlueGasesOutlet Cs
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Connectors.FlueGasesInlet Ce2
-    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Connectors.FlueGasesInlet Ce3
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P0, T0, Xco20, Xh2o0, Xo20, Xso20);
-  end if;
-
-  if dynamic_composition_balance then
-    if steady_state then
-      der(Xco2) = 0;
-      der(Xh2o) = 0;
-      der(Xo2) = 0;
-      der(Xso2) = 0;
-    else
-      Xco2 = Xco20;
-      Xh2o = Xh2o0;
-      Xo2 = Xo20;
-      Xso2 = Xso20;
-    end if;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.T = 400;
-    Ce1.Xco2 = 0.20;
-    Ce1.Xh2o = 0.05;
-    Ce1.Xo2 = 0.25;
-    Ce1.Xso2 = 0;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.T = 400;
-    Ce2.Xco2 = 0.20;
-    Ce2.Xh2o = 0.05;
-    Ce2.Xo2 = 0.25;
-    Ce2.Xso2 = 0;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.T = 400;
-    Ce3.Xco2 = 0.20;
-    Ce3.Xh2o = 0.05;
-    Ce3.Xo2 = 0.25;
-    Ce3.Xso2 = 0;
-    Ce3.b = true;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q  + Ce3.Q - Cs.Q;
-
-  if dynamic_mass_balance then
-    V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2)*der(P)
-     + ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2)*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) + Ce3.Q*(he3 - Ce3.Xh2o*hr) - Cs.Q*(hs - Cs.Xh2o*hr) + Cth.W;
-
-  if dynamic_mass_balance then
-    V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P)
-     + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH;
-  else
-    V*rho*der(h - Xh2o*hr) = BH;
-  end if;
-
-  Cs.T = T;
-  Cth.T = T;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q;
-
-  if dynamic_composition_balance then
-    V*rho*der(Xco2) + Xco2*BQ = BXco2;
-    V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-    V*rho*der(Xo2) + Xo2*BQ = BXo2;
-    V*rho*der(Xso2) + Xso2*BQ = BXso2;
-  else
-    Xco2*BQ = BXco2;
-    Xh2o*BQ = BXh2o;
-    Xo2*BQ = BXo2;
-    Xso2*BQ = BXso2;
-  end if;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2 = Xo2;
-  Cs.Xso2 = Xso2;
-
-  /* Fluid thermodynamic properties */
-  he1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce1.T, Ce1.Xco2, Ce1.Xh2o, Ce1.Xo2, Ce1.Xso2);
-  he2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce2.T, Ce2.Xco2, Ce2.Xh2o, Ce2.Xo2, Ce2.Xso2);
-  he3 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce3.T, Ce3.Xco2, Ce3.Xh2o, Ce3.Xo2, Ce3.Xso2);
-  hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs.T, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
-
-  //T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2, Xso2);
-  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  cp = ThermoSysPro.Properties.FlueGases.FlueGases_cp(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
-        Line(points={{60,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,60}}, color={0,0,255}),
-        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
-        Line(points={{60,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,60}}, color={0,0,255}),
-        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
-    Window(
-      x=0.16,
-      y=0.27,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeCTh;
+within ThermoSysPro.FlueGases.Volumes;
+model VolumeCTh
+  "Mixing flue gases volume with 3 inlets and 1 outlet and thermal input"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.Temperature T0=400
+    "Initial fluid temperature (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean dynamic_composition_balance=false
+    "true: dynamic fluid composition balance equation - false: static fluid composition balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Real Xco20 = 0.0  "CO2 mass fraction (active if steady_state=false)";
+  parameter Real Xh2o0 = 0.05 "H20 mass fraction (active if steady_state=false)";
+  parameter Real Xo20 = 0.23 "O2 mass fraction (active if steady_state=false)";
+  parameter Real Xso20 = 0 "SO2 mass fraction (active if steady_state=false)";
+
+public
+  Units.SI.Temperature T(start=500) "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=1) "Fluid density";
+  Units.SI.SpecificHeatCapacity cp(start=1000) "Fluid spécific heat capacity";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H20 mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  Units.SI.SpecificEnthalpy he1(start=100000)
+    "Fluid specific enthalpy at inlet #1";
+  Units.SI.SpecificEnthalpy he2(start=100000)
+    "Fluid specific enthalpy at inlet #2";
+  Units.SI.SpecificEnthalpy he3(start=100000)
+    "Fluid specific enthalpy at inlet #3";
+  Units.SI.SpecificEnthalpy hs(start=100000)
+    "Fluid specific enthalpy at the outlet";
+
+  Connectors.FlueGasesInlet Ce1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FlueGasesOutlet Cs
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Connectors.FlueGasesInlet Ce2
+    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Connectors.FlueGasesInlet Ce3
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P0, T0, Xco20, Xh2o0, Xo20, Xso20);
+  end if;
+
+  if dynamic_composition_balance then
+    if steady_state then
+      der(Xco2) = 0;
+      der(Xh2o) = 0;
+      der(Xo2) = 0;
+      der(Xso2) = 0;
+    else
+      Xco2 = Xco20;
+      Xh2o = Xh2o0;
+      Xo2 = Xo20;
+      Xso2 = Xso20;
+    end if;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.T = 400;
+    Ce1.Xco2 = 0.20;
+    Ce1.Xh2o = 0.05;
+    Ce1.Xo2 = 0.25;
+    Ce1.Xso2 = 0;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.T = 400;
+    Ce2.Xco2 = 0.20;
+    Ce2.Xh2o = 0.05;
+    Ce2.Xo2 = 0.25;
+    Ce2.Xso2 = 0;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.T = 400;
+    Ce3.Xco2 = 0.20;
+    Ce3.Xh2o = 0.05;
+    Ce3.Xo2 = 0.25;
+    Ce3.Xso2 = 0;
+    Ce3.b = true;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q  + Ce3.Q - Cs.Q;
+
+  if dynamic_mass_balance then
+    V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2)*der(P)
+     + ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2)*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) + Ce3.Q*(he3 - Ce3.Xh2o*hr) - Cs.Q*(hs - Cs.Xh2o*hr) + Cth.W;
+
+  if dynamic_mass_balance then
+    V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P)
+     + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH;
+  else
+    V*rho*der(h - Xh2o*hr) = BH;
+  end if;
+
+  Cs.T = T;
+  Cth.T = T;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q;
+
+  if dynamic_composition_balance then
+    V*rho*der(Xco2) + Xco2*BQ = BXco2;
+    V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+    V*rho*der(Xo2) + Xo2*BQ = BXo2;
+    V*rho*der(Xso2) + Xso2*BQ = BXso2;
+  else
+    Xco2*BQ = BXco2;
+    Xh2o*BQ = BXh2o;
+    Xo2*BQ = BXo2;
+    Xso2*BQ = BXso2;
+  end if;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2 = Xo2;
+  Cs.Xso2 = Xso2;
+
+  /* Fluid thermodynamic properties */
+  he1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce1.T, Ce1.Xco2, Ce1.Xh2o, Ce1.Xo2, Ce1.Xso2);
+  he2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce2.T, Ce2.Xco2, Ce2.Xh2o, Ce2.Xo2, Ce2.Xso2);
+  he3 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce3.T, Ce3.Xco2, Ce3.Xh2o, Ce3.Xo2, Ce3.Xso2);
+  hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs.T, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
+
+  //T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2, Xso2);
+  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  cp = ThermoSysPro.Properties.FlueGases.FlueGases_cp(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
+        Line(points={{60,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,60}}, color={0,0,255}),
+        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
+        Line(points={{60,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,60}}, color={0,0,255}),
+        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
+    Window(
+      x=0.16,
+      y=0.27,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeCTh;
diff --git a/ThermoSysPro/FlueGases/Volumes/VolumeDTh.mo b/ThermoSysPro/FlueGases/Volumes/VolumeDTh.mo
index be0d2ca54d3e2405451c99815f1dad6d4974fd1f..4d29966a238c5cce1f144d1f260aa5573b7b29b5 100644
--- a/ThermoSysPro/FlueGases/Volumes/VolumeDTh.mo
+++ b/ThermoSysPro/FlueGases/Volumes/VolumeDTh.mo
@@ -1,244 +1,244 @@
-within ThermoSysPro.FlueGases.Volumes;
-model VolumeDTh
-  "Mixing flue gases volume with 1 inlets and 3 outlets and thermal input"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.Temperature T0=400
-    "Initial fluid temperature (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean dynamic_composition_balance=false
-    "true: dynamic fluid composition balance equation - false: static fluid composition balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Real Xco20 = 0.0  "CO2 mass fraction (active if steady_state=false)";
-  parameter Real Xh2o0 = 0.05 "H20 mass fraction (active if steady_state=false)";
-  parameter Real Xo20 = 0.23 "O2 mass fraction (active if steady_state=false)";
-  parameter Real Xso20 = 0 "SO2 mass fraction (active if steady_state=false)";
-
-public
-  Units.SI.Temperature T(start=500) "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=1) "Fluid density";
-  Units.SI.SpecificHeatCapacity cp(start=1000) "Fluid specific heat capacity";
-  Real Xco2 "CO2 mass fraction";
-  Real Xh2o "H20 mass fraction";
-  Real Xo2 "O2 mass fraction";
-  Real Xso2 "SO2 mass fraction";
-  Real Xn2 "N2 mass fraction";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  Units.SI.SpecificEnthalpy he(start=100000) "Fluid specific enthalpy at inlet";
-  Units.SI.SpecificEnthalpy hs1(start=100000)
-    "Fluid specific enthalpy at outlet #1";
-  Units.SI.SpecificEnthalpy hs2(start=100000)
-    "Fluid specific enthalpy at outlet #2";
-  Units.SI.SpecificEnthalpy hs3(start=100000)
-    "Fluid specific enthalpy at outlet #3";
-
-  Connectors.FlueGasesInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FlueGasesOutlet Cs1
-    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Connectors.FlueGasesOutlet Cs2
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Connectors.FlueGasesOutlet Cs3
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P0, T0, Xco20, Xh2o0, Xo20, Xso20);
-  end if;
-
-  if dynamic_composition_balance then
-    if steady_state then
-      der(Xco2) = 0;
-      der(Xh2o) = 0;
-      der(Xo2) = 0;
-      der(Xso2) = 0;
-    else
-      Xco2 = Xco20;
-      Xh2o = Xh2o0;
-      Xo2 = Xo20;
-      Xso2 = Xso20;
-    end if;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.T = 400;
-    Ce.Xco2 = 0.20;
-    Ce.Xh2o = 0.05;
-    Ce.Xo2 = 0.25;
-    Ce.Xso2 = 0;
-    Ce.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.a = true;
-  end if;
-
-  if (cardinality(Cs3) == 0) then
-    Cs3.Q = 0;
-    Cs3.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
-
-  if dynamic_mass_balance then
-    V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2)*der(P)
-     + ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2)*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-
-  /* Energy balance equation */
-  BH = Ce.Q*(he - Ce.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr) - Cs3.Q*(hs3 - Cs3.Xh2o*hr) + Cth.W;
-
-  if dynamic_mass_balance then
-    V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P)
-     + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH;
-  else
-    V*rho*der(h - Xh2o*hr) = BH;
-  end if;
-
-  Cs1.T = T;
-  Cs2.T = T;
-  Cs3.T = T;
-  Cth.T = T;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q;
-  BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q;
-  BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q;
-  BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q;
-
-  if dynamic_composition_balance then
-    V*rho*der(Xco2) + Xco2*BQ = BXco2;
-    V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-    V*rho*der(Xo2) + Xo2*BQ = BXo2;
-    V*rho*der(Xso2) + Xso2*BQ = BXso2;
-  else
-    Xco2*BQ = BXco2;
-    Xh2o*BQ = BXh2o;
-    Xo2*BQ = BXo2;
-    Xso2*BQ = BXso2;
-  end if;
-
-  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2 = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2 = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  Cs3.Xco2 = Xco2;
-  Cs3.Xh2o = Xh2o;
-  Cs3.Xo2 = Xo2;
-  Cs3.Xso2 = Xso2;
-
-  /* Fluid thermodynamic properties */
-  he = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce.T, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs1.T, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-  hs2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs2.T, Cs2.Xco2, Cs2.Xh2o, Cs2.Xo2, Cs2.Xso2);
-  hs3 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs3.T, Cs3.Xco2, Cs3.Xh2o, Cs3.Xo2, Cs3.Xso2);
-
-  //T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2, Xso2);
-  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  cp = ThermoSysPro.Properties.FlueGases.FlueGases_cp(P, T, Xco2, Xh2o, Xo2, Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
-        Line(points={{60,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,60}}, color={0,0,255}),
-        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
-        Line(points={{60,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,60}}, color={0,0,255}),
-        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
-    Window(
-      x=0.16,
-      y=0.27,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeDTh;
+within ThermoSysPro.FlueGases.Volumes;
+model VolumeDTh
+  "Mixing flue gases volume with 1 inlets and 3 outlets and thermal input"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.Temperature T0=400
+    "Initial fluid temperature (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean dynamic_composition_balance=false
+    "true: dynamic fluid composition balance equation - false: static fluid composition balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Real Xco20 = 0.0  "CO2 mass fraction (active if steady_state=false)";
+  parameter Real Xh2o0 = 0.05 "H20 mass fraction (active if steady_state=false)";
+  parameter Real Xo20 = 0.23 "O2 mass fraction (active if steady_state=false)";
+  parameter Real Xso20 = 0 "SO2 mass fraction (active if steady_state=false)";
+
+public
+  Units.SI.Temperature T(start=500) "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=1) "Fluid density";
+  Units.SI.SpecificHeatCapacity cp(start=1000) "Fluid specific heat capacity";
+  Real Xco2 "CO2 mass fraction";
+  Real Xh2o "H20 mass fraction";
+  Real Xo2 "O2 mass fraction";
+  Real Xso2 "SO2 mass fraction";
+  Real Xn2 "N2 mass fraction";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  Units.SI.SpecificEnthalpy he(start=100000) "Fluid specific enthalpy at inlet";
+  Units.SI.SpecificEnthalpy hs1(start=100000)
+    "Fluid specific enthalpy at outlet #1";
+  Units.SI.SpecificEnthalpy hs2(start=100000)
+    "Fluid specific enthalpy at outlet #2";
+  Units.SI.SpecificEnthalpy hs3(start=100000)
+    "Fluid specific enthalpy at outlet #3";
+
+  Connectors.FlueGasesInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FlueGasesOutlet Cs1
+    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Connectors.FlueGasesOutlet Cs2
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Connectors.FlueGasesOutlet Cs3
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P0, T0, Xco20, Xh2o0, Xo20, Xso20);
+  end if;
+
+  if dynamic_composition_balance then
+    if steady_state then
+      der(Xco2) = 0;
+      der(Xh2o) = 0;
+      der(Xo2) = 0;
+      der(Xso2) = 0;
+    else
+      Xco2 = Xco20;
+      Xh2o = Xh2o0;
+      Xo2 = Xo20;
+      Xso2 = Xso20;
+    end if;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.T = 400;
+    Ce.Xco2 = 0.20;
+    Ce.Xh2o = 0.05;
+    Ce.Xo2 = 0.25;
+    Ce.Xso2 = 0;
+    Ce.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.a = true;
+  end if;
+
+  if (cardinality(Cs3) == 0) then
+    Cs3.Q = 0;
+    Cs3.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
+
+  if dynamic_mass_balance then
+    V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2)*der(P)
+     + ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2)*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+
+  /* Energy balance equation */
+  BH = Ce.Q*(he - Ce.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr) - Cs3.Q*(hs3 - Cs3.Xh2o*hr) + Cth.W;
+
+  if dynamic_mass_balance then
+    V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P)
+     + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH;
+  else
+    V*rho*der(h - Xh2o*hr) = BH;
+  end if;
+
+  Cs1.T = T;
+  Cs2.T = T;
+  Cs3.T = T;
+  Cth.T = T;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q;
+  BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q;
+  BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q;
+  BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q;
+
+  if dynamic_composition_balance then
+    V*rho*der(Xco2) + Xco2*BQ = BXco2;
+    V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+    V*rho*der(Xo2) + Xo2*BQ = BXo2;
+    V*rho*der(Xso2) + Xso2*BQ = BXso2;
+  else
+    Xco2*BQ = BXco2;
+    Xh2o*BQ = BXh2o;
+    Xo2*BQ = BXo2;
+    Xso2*BQ = BXso2;
+  end if;
+
+  Xn2 = 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2 = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2 = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  Cs3.Xco2 = Xco2;
+  Cs3.Xh2o = Xh2o;
+  Cs3.Xo2 = Xo2;
+  Cs3.Xso2 = Xso2;
+
+  /* Fluid thermodynamic properties */
+  he = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Ce.T, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs1.T, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+  hs2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs2.T, Cs2.Xco2, Cs2.Xh2o, Cs2.Xo2, Cs2.Xso2);
+  hs3 = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, Cs3.T, Cs3.Xco2, Cs3.Xh2o, Cs3.Xo2, Cs3.Xso2);
+
+  //T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2, Xso2);
+  h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  cp = ThermoSysPro.Properties.FlueGases.FlueGases_cp(P, T, Xco2, Xh2o, Xo2, Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
+        Line(points={{60,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,60}}, color={0,0,255}),
+        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,0},{-90,0}}, color={0,0,255}),
+        Line(points={{60,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,60}}, color={0,0,255}),
+        Line(points={{0,-60},{0,-92}}, color={0,0,255})}),
+    Window(
+      x=0.16,
+      y=0.27,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeDTh;
diff --git a/ThermoSysPro/FlueGases/Volumes/package.mo b/ThermoSysPro/FlueGases/Volumes/package.mo
index d6a771e925ec4be33c30f028854658352796ecdb..4bfa2a5a9e91792c0ed84c3d085d7d02dd0a076b 100644
--- a/ThermoSysPro/FlueGases/Volumes/package.mo
+++ b/ThermoSysPro/FlueGases/Volumes/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.FlueGases;
-package Volumes "Volumes"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Volumes;
+within ThermoSysPro.FlueGases;
+package Volumes "Volumes"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Volumes;
diff --git a/ThermoSysPro/FlueGases/Volumes/package.order b/ThermoSysPro/FlueGases/Volumes/package.order
index 082d39694af9ea30197a94a68446a9a1531a65c6..f6e275da4f6bf920a9e5c4684a4922d33f238609 100644
--- a/ThermoSysPro/FlueGases/Volumes/package.order
+++ b/ThermoSysPro/FlueGases/Volumes/package.order
@@ -1,4 +1,4 @@
-VolumeATh
-VolumeBTh
-VolumeCTh
-VolumeDTh
+VolumeATh
+VolumeBTh
+VolumeCTh
+VolumeDTh
diff --git a/ThermoSysPro/FlueGases/package.mo b/ThermoSysPro/FlueGases/package.mo
index a9104b4a650d7fdb734707d0cf030967b34399c9..c0f40ecf19935499e338e87e5330cd7b5ffb6c09 100644
--- a/ThermoSysPro/FlueGases/package.mo
+++ b/ThermoSysPro/FlueGases/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro;
-package FlueGases "Flue gases components library"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end FlueGases;
+within ThermoSysPro;
+package FlueGases "Flue gases components library"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end FlueGases;
diff --git a/ThermoSysPro/FlueGases/package.order b/ThermoSysPro/FlueGases/package.order
index 106e1694417c9264e7afd514b90b9c2311ad1b0c..d6d6e1a83554a2880e7c97776aa4ae18e4ea1427 100644
--- a/ThermoSysPro/FlueGases/package.order
+++ b/ThermoSysPro/FlueGases/package.order
@@ -1,9 +1,9 @@
-BoundaryConditions
-Connectors
-HeatExchangers
-Junctions
-Machines
-PressureLosses
-Sensors
-TAC
-Volumes
+BoundaryConditions
+Connectors
+HeatExchangers
+Junctions
+Machines
+PressureLosses
+Sensors
+TAC
+Volumes
diff --git a/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo b/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo
index 0a2416e8dceb6b6e90a8669067b9977a582fe3fe..d26edace4e7a27876a42817c49318eed250b1b26 100644
--- a/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo
+++ b/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo
@@ -1,154 +1,154 @@
-within ThermoSysPro.Fluid.Boilers;
-model BoilerSystem "Boiler"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Temperature Tsf=423.16
-    "Flue gases temperature at the outlet";
-  parameter Integer Boiler_efficiency_type = 1 "1: Taking into account LHV only - 2: Using the total incoming power";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf=0.05
-    "Flue gases pressure loss coefficient";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke=1e4
-    "Water/steam pressure loss coefficient";
-  parameter Real etacomb=1 "Combustion efficiency (between 0 and 1)";
-  parameter Units.SI.Power Wloss=1e5 "Thermal losses";
-  parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4
-    "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)";
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
-    Xashes=0.011,
-    rho=1000,
-    Hum=0.50,
-    Xc=0.2479,
-    Xh=0.0297,
-    Xo=0.2088,
-    Xn=0.0017,
-    Xs=0.0003,
-    LHV=1.5e7,
-    Q0=0.0407331,
-    T0=294.45)
-    annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Boilers.FossilFuelBoiler Boiler(
-    Qsf(start=45.8744, fixed=false),
-    Pee(fixed=false),
-    Qe(fixed=false, start=6),
-    Hee(fixed=false, start=293.1e3),
-    Hse(fixed=false, start=377e3),
-    Tsf=Tsf,
-    exc_air(fixed=false, start=10),
-    Wloss=Wloss,
-    Wboil(start=1600e3, fixed=false),
-    gamma_diff_ws=gamma_diff_ws,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    Boiler_efficiency_type=Boiler_efficiency_type,
-    Kf=Kf,
-    Ke=Ke,
-    etacomb=etacomb,
-    Pse(fixed=false, start=200000),
-    Tse(fixed=false, start=363.16),
-    Tf(fixed=false, start=1600))
-    annotation (Placement(transformation(
-        origin={-10,0},
-        extent={{20,-20},{-20,20}},
-        rotation=270)));
-  Interfaces.Connectors.FluidInlet InletWaterSteam "Water inlet" annotation (
-      Placement(transformation(extent={{40,-110},{60,-90}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet OutletWaterSteam "Water/steam outlet"
-    annotation (Placement(transformation(extent={{40,90},{60,110}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet OutletFlueGases "Flue gases outlet"
-                                                    annotation (Placement(
-        transformation(extent={{-80,90},{-60,110}}, rotation=0),
-        iconTransformation(extent={{-80,90},{-60,110}})));
-  Interfaces.Connectors.FluidInlet InletFlueGases "Flue gases inlet"
-                                                  annotation (Placement(
-        transformation(extent={{-80,-110},{-60,-90}}, rotation=0)));
-equation
-  connect(OutletWaterSteam, Boiler.Cws2) annotation (Line(points={{50,100},{50,100},
-          {2,100},{2,20}}, color={255,0,0}));
-  connect(Boiler.Cws1, InletWaterSteam)
-    annotation (Line(points={{2,-20},{2,-100},{50,-100}}));
-  connect(Boiler.Cfuel, Fuel.C) annotation (Line(points={{-26,9.79685e-016},{
-          -32,9.79685e-016},{-32,0},{-36,0}}, color={0,0,0}));
-  connect(Boiler.Cfg, OutletFlueGases) annotation (Line(points={{-22.4,20},{-22,
-          20},{-22,100},{-70,100}},
-                               color={255,0,0}));
-  connect(Boiler.Cair, InletFlueGases) annotation (Line(points={{-22.4,-20},{
-          -22,-20},{-22,-100},{-70,-100}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-80,-100},{60,100}},
-        initialScale=0.3)),
-                          Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-80,-100},{60,100}},
-        initialScale=0.3), graphics={
-        Rectangle(
-          extent={{-80,100},{60,-100}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Dash,
-          lineThickness=0),
-        Rectangle(
-          extent={{-60,80},{40,-80}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-12,-46},{0,-50},{10,-38},{14,-24},{12,-10},{10,-2},{6,8},{2,
-              18},{0,26},{-2,32},{-6,50},{-10,40},{-14,32},{-18,20},{-18,16},{
-              -20,12},{-22,20},{-24,22},{-26,18},{-30,10},{-32,4},{-36,-4},{-38,
-              -14},{-40,-24},{-40,-32},{-34,-40},{-30,-46},{-20,-52},{-12,-46}},
-          lineColor={255,0,128},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,-28},{-18,-24},{-14,-22},{-10,-22},{-6,-24},{-4,-26},{-2,
-              -32},{-2,-36},{-4,-34},{-6,-30},{-8,-26},{-14,-26},{-16,-28},{-20,
-              -32},{-22,-34},{-22,-34},{-20,-28}},
-          lineColor={127,0,0},
-          fillColor={127,0,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-109,-90},{-88,-106}},
-          lineColor={28,108,200},
-          textString="Air"),
-        Text(
-          extent={{-116,110},{-84,88}},
-          lineColor={238,46,47},
-          textString="FlueGases"),
-        Text(
-          extent={{65,-88},{95,-108}},
-          lineColor={28,108,200},
-          textString="WaterSteam"),
-        Text(
-          extent={{65,112},{95,92}},
-          lineColor={238,46,47},
-          textString="WaterSteam"),
-        Line(
-          points={{-100,-90},{-100,90}},
-          color={255,0,0},
-          arrow={Arrow.None,Arrow.Open}),
-        Line(
-          points={{80,-86},{80,94}},
-          color={28,108,200},
-          arrow={Arrow.None,Arrow.Open})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end BoilerSystem;
+within ThermoSysPro.Fluid.Boilers;
+model BoilerSystem "Boiler"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Temperature Tsf=423.16
+    "Flue gases temperature at the outlet";
+  parameter Integer Boiler_efficiency_type = 1 "1: Taking into account LHV only - 2: Using the total incoming power";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf=0.05
+    "Flue gases pressure loss coefficient";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke=1e4
+    "Water/steam pressure loss coefficient";
+  parameter Real etacomb=1 "Combustion efficiency (between 0 and 1)";
+  parameter Units.SI.Power Wloss=1e5 "Thermal losses";
+  parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4
+    "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)";
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
+    Xashes=0.011,
+    rho=1000,
+    Hum=0.50,
+    Xc=0.2479,
+    Xh=0.0297,
+    Xo=0.2088,
+    Xn=0.0017,
+    Xs=0.0003,
+    LHV=1.5e7,
+    Q0=0.0407331,
+    T0=294.45)
+    annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Boilers.FossilFuelBoiler Boiler(
+    Qsf(start=45.8744, fixed=false),
+    Pee(fixed=false),
+    Qe(fixed=false, start=6),
+    Hee(fixed=false, start=293.1e3),
+    Hse(fixed=false, start=377e3),
+    Tsf=Tsf,
+    exc_air(fixed=false, start=10),
+    Wloss=Wloss,
+    Wboil(start=1600e3, fixed=false),
+    gamma_diff_ws=gamma_diff_ws,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    Boiler_efficiency_type=Boiler_efficiency_type,
+    Kf=Kf,
+    Ke=Ke,
+    etacomb=etacomb,
+    Pse(fixed=false, start=200000),
+    Tse(fixed=false, start=363.16),
+    Tf(fixed=false, start=1600))
+    annotation (Placement(transformation(
+        origin={-10,0},
+        extent={{20,-20},{-20,20}},
+        rotation=270)));
+  Interfaces.Connectors.FluidInlet InletWaterSteam "Water inlet" annotation (
+      Placement(transformation(extent={{40,-110},{60,-90}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet OutletWaterSteam "Water/steam outlet"
+    annotation (Placement(transformation(extent={{40,90},{60,110}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet OutletFlueGases "Flue gases outlet"
+                                                    annotation (Placement(
+        transformation(extent={{-80,90},{-60,110}}, rotation=0),
+        iconTransformation(extent={{-80,90},{-60,110}})));
+  Interfaces.Connectors.FluidInlet InletFlueGases "Flue gases inlet"
+                                                  annotation (Placement(
+        transformation(extent={{-80,-110},{-60,-90}}, rotation=0)));
+equation
+  connect(OutletWaterSteam, Boiler.Cws2) annotation (Line(points={{50,100},{50,100},
+          {2,100},{2,20}}, color={255,0,0}));
+  connect(Boiler.Cws1, InletWaterSteam)
+    annotation (Line(points={{2,-20},{2,-100},{50,-100}}));
+  connect(Boiler.Cfuel, Fuel.C) annotation (Line(points={{-26,9.79685e-016},{
+          -32,9.79685e-016},{-32,0},{-36,0}}, color={0,0,0}));
+  connect(Boiler.Cfg, OutletFlueGases) annotation (Line(points={{-22.4,20},{-22,
+          20},{-22,100},{-70,100}},
+                               color={255,0,0}));
+  connect(Boiler.Cair, InletFlueGases) annotation (Line(points={{-22.4,-20},{
+          -22,-20},{-22,-100},{-70,-100}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-80,-100},{60,100}},
+        initialScale=0.3)),
+                          Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-80,-100},{60,100}},
+        initialScale=0.3), graphics={
+        Rectangle(
+          extent={{-80,100},{60,-100}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Dash,
+          lineThickness=0),
+        Rectangle(
+          extent={{-60,80},{40,-80}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-12,-46},{0,-50},{10,-38},{14,-24},{12,-10},{10,-2},{6,8},{2,
+              18},{0,26},{-2,32},{-6,50},{-10,40},{-14,32},{-18,20},{-18,16},{
+              -20,12},{-22,20},{-24,22},{-26,18},{-30,10},{-32,4},{-36,-4},{-38,
+              -14},{-40,-24},{-40,-32},{-34,-40},{-30,-46},{-20,-52},{-12,-46}},
+          lineColor={255,0,128},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,-28},{-18,-24},{-14,-22},{-10,-22},{-6,-24},{-4,-26},{-2,
+              -32},{-2,-36},{-4,-34},{-6,-30},{-8,-26},{-14,-26},{-16,-28},{-20,
+              -32},{-22,-34},{-22,-34},{-20,-28}},
+          lineColor={127,0,0},
+          fillColor={127,0,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-109,-90},{-88,-106}},
+          lineColor={28,108,200},
+          textString="Air"),
+        Text(
+          extent={{-116,110},{-84,88}},
+          lineColor={238,46,47},
+          textString="FlueGases"),
+        Text(
+          extent={{65,-88},{95,-108}},
+          lineColor={28,108,200},
+          textString="WaterSteam"),
+        Text(
+          extent={{65,112},{95,92}},
+          lineColor={238,46,47},
+          textString="WaterSteam"),
+        Line(
+          points={{-100,-90},{-100,90}},
+          color={255,0,0},
+          arrow={Arrow.None,Arrow.Open}),
+        Line(
+          points={{80,-86},{80,94}},
+          color={28,108,200},
+          arrow={Arrow.None,Arrow.Open})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end BoilerSystem;
diff --git a/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo b/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo
index e0452355098131f0dc2b38c7e67b0604ad971414..b6d0413503ab6338672ca3daafdbec9343260f4f 100644
--- a/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo
+++ b/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo
@@ -1,389 +1,389 @@
-within ThermoSysPro.Fluid.Boilers;
-model FossilFuelBoiler "Fossil fuel boiler"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Temperature Tsf=400 "Flue gases temperature at the outlet";
-  parameter Integer Boiler_efficiency_type = 1 "1: Taking into account LHV only - 2: Using the total incoming power";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf=0.05
-    "Flue gases pressure loss coefficient";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke=1e4
-    "Water/steam pressure loss coefficient";
-  parameter Real etacomb=1 "Combustion efficiency (between 0 and 1)";
-  parameter Units.SI.Power Wloss=1e5 "Thermal losses";
-  parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4
-    "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)";
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Real amCO2 = amC + 2*amO "CO2 molecular mass";
-  constant Real amH2O = 2*amH + amO "H2O molecular mass";
-  constant Real amSO2 = amS + 2*amO "SO2 molecular mass";
-  constant Real teps=1e-6 "Small number";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=400) "Air temperature at the inlet";
-  Units.SI.SpecificEnthalpy Hea(start=50e3)
-    "Air specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Real XeaCO2(start=0) "CO2 mass fraction at the inlet";
-  Real XeaH2O(start=0.1) "H2O mass fraction at the inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the inlet";
-  Real XeaSO2(start=0) "SO2 mass fraction at the inlet";
-  Real XeaO2c(start=0.2) "Intermediate variable for the computation of the O2 mass fraction";
-
-  Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tcomb(start=300) "Fuel temperature";
-  Units.SI.SpecificEnthalpy Hcomb(start=10e3) "Fuel specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrcomb(start=10e3)
-    "Fuel reference specific enthalpy";
-  Real XCcomb(start=0.8) "Carbon mass fraction";
-  Real XHcomb(start=0.2) "Hydrogen mass fraction";
-  Real XOcomb(start=0) "Oxygen mass fraction";
-  Real XScomb(start=0) "Sulfur mass fraction";
-  Real PCIcomb(start=5e7) "Fuel PCI (J/kg)";
-  Units.SI.SpecificHeatCapacity Cpcomb(start=2000)
-    "Fuel specific heat capacity";
-
-  Units.SI.MassFlowRate Qe(start=100) "Water/steam mass flow rate";
-  Units.SI.AbsolutePressure Pee(start=50e5) "Water/steam pressure at the inlet";
-  Units.SI.AbsolutePressure Pse(start=50e5)
-    "Water/steam pressure at the outlet";
-  ThermoSysPro.Units.SI.PressureDifference deltaPe(start=1e5)
-    "Water/steam pressure losses";
-  Units.SI.Temperature Tse(start=500) "Water/steam temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hee(start=400e3)
-    "Water/steam specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hse(start=400e3)
-    "Water/steam specific enthalpy at the outlet";
-  Units.SI.Density rhoe(start=998) "Average water/steam density";
-
-  Units.SI.MassFlowRate Qsf(start=400)
-    "Flue gases mass flow rate at the outlet";
-  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tf(start=1500) "Flue gases temperature after combustion";
-  Units.SI.SpecificEnthalpy Hsf(start=50e3)
-    "Flue gases specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hf(start=100e3)
-    "Flue gases specific enthalpy after combustion";
-  Units.SI.SpecificEnthalpy Hrfum(start=10e3)
-    "Flue gases reference specific enthalpy";
-  ThermoSysPro.Units.SI.PressureDifference deltaPf(start=1e3)
-    "Pressure losses in the combusiton chamber";
-  Units.SI.Density rhof(start=0.05) "Flue gases density";
-  Real XsfCO2(start=0.2) "CO2 mass fraction at the outlet";
-  Real XsfH2O(start=0.15) "H2O mass fraction at the outlet";
-  Real XsfO2(start=0) "O2 mass fraction at the outlet";
-  Real XsfSO2(start=0) "SO2 mass fraction at the outlet";
-
-  Units.SI.Power Wfuel(start=5e8) "Fuel available power PCI";
-  Units.SI.Power Wtot(start=5e8) "Total incoming power";
-  Units.SI.Power Wboil(start=5e9) "Power exchanged in the boiler";
-  Real eta_boil(start=90) "Boiler efficiency (%) ";
-  Real exc(start=1) "Air combustion ratio";
-  Real exc_air(start=0.1) "Pertcentage of air in excess";
-
-  FluidType fluids[2] "Fluids mixing in volume";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Flue gases specific enthalpy";
-  Units.SI.Power Jair "Thermal power diffusion from inlet Cair";
-  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_air "Diffusion conductance for inlet Cair";
-  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
-  Real rair "Value of r(Q/gamma) for inlet Cair";
-  Real rfg "Value of r(Q/gamma) for outlet Cfg";
-  FluidType ftype_ws "Water/steam fluid type";
-  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
-
-public
-  Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{-10,-90},{10,-70}}, rotation=
-            0)));
-  Interfaces.Connectors.FluidInlet Cair "Air inlet"
-                                        annotation (Placement(transformation(
-          extent={{-110,-72},{-90,-52}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
-                                        annotation (Placement(transformation(
-          extent={{90,-72},{110,-52}}, rotation=0)));
-public
-  Interfaces.Connectors.FluidInlet Cws1 "Water inlet"
-                                        annotation (Placement(transformation(
-          extent={{-110,50},{-90,70}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cws2 "Water/steam outlet"
-                                         annotation (Placement(transformation(
-          extent={{90,50},{110,70}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    annotation (Placement(transformation(extent={{-100,84},{-80,104}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom
-    annotation (Placement(transformation(extent={{80,84},{100,104}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Cair.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "InternalCombustionEngine: fluids mixing in volume are not compatible with each other");
-
-  // ----------------
-  // Water/steam side
-
-  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "InternalCombustionEngine: the fluid type for the water/steam side must be water/steam");
-
-  Cws1.Q = Cws2.Q;
-
-  Cws1.h_vol_1 = Cws2.h_vol_1;
-  Cws1.h_vol_2 = Cws2.h_vol_2;
-
-  Cws2.diff_on_1 = if (gamma_diff_ws > 0) then Cws1.diff_on_1 else false;
-  Cws1.diff_on_2 = if (gamma_diff_ws > 0) then Cws2.diff_on_2 else false;
-
-  Cws2.diff_res_1 = Cws1.diff_res_1 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0);
-  Cws1.diff_res_2 = Cws2.diff_res_2 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0);
-
-  Cws1.ftype = Cws2.ftype;
-
-  Cws1.Xco2 = Cws2.Xco2;
-  Cws1.Xh2o = Cws2.Xh2o;
-  Cws1.Xo2  = Cws2.Xo2;
-  Cws1.Xso2 = Cws2.Xso2;
-
-  ftype_ws = Cws1.ftype;
-
-  Qe = Cws1.Q;
-
-  Pee = Cws1.P;
-  Hee = Cws1.h;
-
-  Pse = Cws2.P;
-  Hse = Cws2.h;
-
-  // ---------------
-  // Combustion side
-
-  /* Fuel inlet */
-  Qcomb = Cfuel.Q;
-  Tcomb = Cfuel.T;
-  XCcomb = Cfuel.Xc;
-  XHcomb = Cfuel.Xh;
-  XOcomb = Cfuel.Xo;
-  XScomb = Cfuel.Xs;
-  PCIcomb = Cfuel.LHV;
-  Cpcomb = Cfuel.cp;
-
-  /* Air inlet */
-  Qea = Cair.Q;
-  Pea = Cair.P;
-  Hea = Cair.h;
-
-  XeaCO2 = Cair.Xco2;
-  XeaH2O = Cair.Xh2o;
-  XeaO2 = Cair.Xo2;
-  XeaSO2 = Cair.Xso2;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Hsf = Cfg.h;
-
-  /* Mass balance equation for the flue gases */
-  0 = Qcomb + Qea - Qsf;
-
-  /* Energy balance equation for the flue gases */
-  0 = Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair) - Qsf*(Hf - Hrfum) - Wloss + J;
-
-  Hcomb = Cpcomb*Tcomb;
-
-  Cair.h_vol_2 = h;
-  Cfg.h_vol_1 = h;
-
-  /* Fuel power */
-  Wfuel = Qcomb*PCIcomb;
-
-  /* Total incoming power */
-  Wtot = Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair);
-
-  /* Power exchanged in the boiler */
-  Wboil = Wtot - Qsf*(Hsf - Hrfum) - Wloss;
-
-  /* Water/steam specific enthalpy at the outlet */
-  Hse = Wboil/Qe + Hee;
-
-  /* Boiler efficiency*/
-  if (Boiler_efficiency_type == 1) then
-     eta_boil = 100*Wboil/Wfuel;
-  else
-     eta_boil = 100*Wboil/Wtot;
-  end if;
-
-  /* Flue gases composition balance equations */
-  0 = Qcomb*XCcomb*amCO2/amC + Qea*XeaCO2 - Qsf*XsfCO2;
-  0 = Qcomb*XHcomb*(amH2O/2)/amH + Qea*XeaH2O - Qsf*XsfH2O;
-  0 = Qea*XeaO2c - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb - Qsf*XsfO2;
-  0 = Qcomb*XScomb*amSO2/amS + Qea*XeaSO2 - Qsf*XsfSO2;
-
-  Cfg.ftype = ftype;
-
-  Cfg.Xco2 = XsfCO2;
-  Cfg.Xh2o = XsfH2O;
-  Cfg.Xo2  = XsfO2;
-  Cfg.Xso2 = XsfSO2;
-
-  /* Combustion air ratio */
-  exc = Qea*(1 - XeaH2O) / ((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO)) / (XeaO2c/(1 - XeaH2O)));
-
-  /* Air excess */
-  exc_air = (exc - 1)*100;
-
-  /* Flue gases pressure losses */
-  Pea - Psf = deltaPf;
-  deltaPf = Kf*ThermoSysPro.Functions.ThermoSquare(Qsf, eps)/rhof;
-
-  /* Water/steam pressure losses */
-  Pee - Pse = deltaPe;
-  deltaPe = Ke*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe;
-
-  /* No flow reversal */
-  Cfg.h = Cfg.h_vol_1;
-
-  /* Diffusion power */
-  if diffusion then
-    rair = if Cair.diff_on_1 then exp(-0.033*(Cair.Q*Cair.diff_res_1)^2) else 0;
-    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
-
-    gamma_air = if Cair.diff_on_1 then 1/Cair.diff_res_1 else gamma0;
-    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
-
-    Jair = if Cair.diff_on_1 then rair*gamma_air*(Cair.h_vol_1 - Cair.h_vol_2) else 0;
-    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
-  else
-    rair = 0;
-    rfg = 0;
-
-    gamma_air = gamma0;
-    gamma_fg = gamma0;
-
-    Jair = 0;
-    Jfg = 0;
-  end if;
-
-  J = Jair + Jfg;
-
-  Cair.diff_res_2 = 0;
-  Cfg.diff_res_1 = 0;
-
-  Cair.diff_on_2 = diffusion;
-  Cfg.diff_on_1 = diffusion;
-
-  /* Air specific enthalpy at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-
-  /* Flue gases tempretaure after combustion */
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  Hf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Flue gases specific enthalpy at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Flue gases density */
-  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, (Tea + Tf)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  0 = if (XeaO2 > teps) then (XeaO2c - XeaO2) else (XeaO2c - teps);
-
-  /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrcomb = 0;
-  Hrfum = 2501.569e3*XsfH2O;
-
-  /* Water/steam thermodynamic properties */
-  prom = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2, (Hee + Hse)/2, mode);
-  rhoe = prom.d;
-
-  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode);
-  Tse = pros.T;
-
-    annotation (             Icon(graphics={
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,-42},{10,-46},{20,-34},{24,-20},{22,-6},{20,2},{16,12},{
-              12,22},{10,30},{8,36},{4,54},{0,44},{-4,36},{-8,24},{-8,20},{-10,
-              16},{-12,24},{-14,26},{-16,22},{-20,14},{-22,8},{-26,0},{-28,-10},
-              {-30,-20},{-30,-28},{-24,-36},{-20,-42},{-10,-48},{-2,-42}},
-          lineColor={255,0,128},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-10,-24},{-8,-20},{-4,-18},{0,-18},{4,-20},{6,-22},{8,-28},{
-              8,-32},{6,-30},{4,-26},{2,-22},{-4,-22},{-6,-24},{-10,-28},{-12,
-              -30},{-12,-30},{-10,-24}},
-          lineColor={127,0,0},
-          fillColor={127,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-92,60},{92,60},{88,60},{80,60}}, color={28,108,200}),
-        Line(points={{-92,-62},{92,-62},{88,-62},{80,-62}},
-                                                        color={255,0,0})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 7.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"),
-    Diagram(graphics={
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={0,0,255},
-          fillColor= {127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,-42},{10,-46},{20,-34},{24,-20},{22,-6},{20,2},{16,12},{
-              12,22},{10,30},{8,36},{4,54},{0,44},{-4,36},{-8,24},{-8,20},{-10,
-              16},{-12,24},{-14,26},{-16,22},{-20,14},{-22,8},{-26,0},{-28,-10},
-              {-30,-20},{-30,-28},{-24,-36},{-20,-42},{-10,-48},{-2,-42}},
-          lineColor={255,0,128},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-10,-24},{-8,-20},{-4,-18},{0,-18},{4,-20},{6,-22},{8,-28},{
-              8,-32},{6,-30},{4,-26},{2,-22},{-4,-22},{-6,-24},{-10,-28},{-12,
-              -30},{-12,-30},{-10,-24}},
-          lineColor={127,0,0},
-          fillColor={127,0,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{68,-30},{108,-56}},
-          lineColor={238,46,47},
-          textString="Flue Gases"),
-        Line(points={{-92,60},{92,60},{88,60},{80,60}}, color={28,108,200}),
-        Line(points={{-92,-62},{92,-62},{88,-62},{80,-62}},
-                                                        color={255,0,0}),
-        Text(
-          extent={{-112,-36},{-86,-52}},
-          lineColor={28,108,200},
-          textString="Air")}));
-end FossilFuelBoiler;
+within ThermoSysPro.Fluid.Boilers;
+model FossilFuelBoiler "Fossil fuel boiler"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Temperature Tsf=400 "Flue gases temperature at the outlet";
+  parameter Integer Boiler_efficiency_type = 1 "1: Taking into account LHV only - 2: Using the total incoming power";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf=0.05
+    "Flue gases pressure loss coefficient";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke=1e4
+    "Water/steam pressure loss coefficient";
+  parameter Real etacomb=1 "Combustion efficiency (between 0 and 1)";
+  parameter Units.SI.Power Wloss=1e5 "Thermal losses";
+  parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4
+    "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)";
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Real amCO2 = amC + 2*amO "CO2 molecular mass";
+  constant Real amH2O = 2*amH + amO "H2O molecular mass";
+  constant Real amSO2 = amS + 2*amO "SO2 molecular mass";
+  constant Real teps=1e-6 "Small number";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=400) "Air temperature at the inlet";
+  Units.SI.SpecificEnthalpy Hea(start=50e3)
+    "Air specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Real XeaCO2(start=0) "CO2 mass fraction at the inlet";
+  Real XeaH2O(start=0.1) "H2O mass fraction at the inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the inlet";
+  Real XeaSO2(start=0) "SO2 mass fraction at the inlet";
+  Real XeaO2c(start=0.2) "Intermediate variable for the computation of the O2 mass fraction";
+
+  Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tcomb(start=300) "Fuel temperature";
+  Units.SI.SpecificEnthalpy Hcomb(start=10e3) "Fuel specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrcomb(start=10e3)
+    "Fuel reference specific enthalpy";
+  Real XCcomb(start=0.8) "Carbon mass fraction";
+  Real XHcomb(start=0.2) "Hydrogen mass fraction";
+  Real XOcomb(start=0) "Oxygen mass fraction";
+  Real XScomb(start=0) "Sulfur mass fraction";
+  Real PCIcomb(start=5e7) "Fuel PCI (J/kg)";
+  Units.SI.SpecificHeatCapacity Cpcomb(start=2000)
+    "Fuel specific heat capacity";
+
+  Units.SI.MassFlowRate Qe(start=100) "Water/steam mass flow rate";
+  Units.SI.AbsolutePressure Pee(start=50e5) "Water/steam pressure at the inlet";
+  Units.SI.AbsolutePressure Pse(start=50e5)
+    "Water/steam pressure at the outlet";
+  ThermoSysPro.Units.SI.PressureDifference deltaPe(start=1e5)
+    "Water/steam pressure losses";
+  Units.SI.Temperature Tse(start=500) "Water/steam temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hee(start=400e3)
+    "Water/steam specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hse(start=400e3)
+    "Water/steam specific enthalpy at the outlet";
+  Units.SI.Density rhoe(start=998) "Average water/steam density";
+
+  Units.SI.MassFlowRate Qsf(start=400)
+    "Flue gases mass flow rate at the outlet";
+  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tf(start=1500) "Flue gases temperature after combustion";
+  Units.SI.SpecificEnthalpy Hsf(start=50e3)
+    "Flue gases specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hf(start=100e3)
+    "Flue gases specific enthalpy after combustion";
+  Units.SI.SpecificEnthalpy Hrfum(start=10e3)
+    "Flue gases reference specific enthalpy";
+  ThermoSysPro.Units.SI.PressureDifference deltaPf(start=1e3)
+    "Pressure losses in the combusiton chamber";
+  Units.SI.Density rhof(start=0.05) "Flue gases density";
+  Real XsfCO2(start=0.2) "CO2 mass fraction at the outlet";
+  Real XsfH2O(start=0.15) "H2O mass fraction at the outlet";
+  Real XsfO2(start=0) "O2 mass fraction at the outlet";
+  Real XsfSO2(start=0) "SO2 mass fraction at the outlet";
+
+  Units.SI.Power Wfuel(start=5e8) "Fuel available power PCI";
+  Units.SI.Power Wtot(start=5e8) "Total incoming power";
+  Units.SI.Power Wboil(start=5e9) "Power exchanged in the boiler";
+  Real eta_boil(start=90) "Boiler efficiency (%) ";
+  Real exc(start=1) "Air combustion ratio";
+  Real exc_air(start=0.1) "Pertcentage of air in excess";
+
+  FluidType fluids[2] "Fluids mixing in volume";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Flue gases specific enthalpy";
+  Units.SI.Power Jair "Thermal power diffusion from inlet Cair";
+  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_air "Diffusion conductance for inlet Cair";
+  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
+  Real rair "Value of r(Q/gamma) for inlet Cair";
+  Real rfg "Value of r(Q/gamma) for outlet Cfg";
+  FluidType ftype_ws "Water/steam fluid type";
+  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
+
+public
+  Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{-10,-90},{10,-70}}, rotation=
+            0)));
+  Interfaces.Connectors.FluidInlet Cair "Air inlet"
+                                        annotation (Placement(transformation(
+          extent={{-110,-72},{-90,-52}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
+                                        annotation (Placement(transformation(
+          extent={{90,-72},{110,-52}}, rotation=0)));
+public
+  Interfaces.Connectors.FluidInlet Cws1 "Water inlet"
+                                        annotation (Placement(transformation(
+          extent={{-110,50},{-90,70}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cws2 "Water/steam outlet"
+                                         annotation (Placement(transformation(
+          extent={{90,50},{110,70}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    annotation (Placement(transformation(extent={{-100,84},{-80,104}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom
+    annotation (Placement(transformation(extent={{80,84},{100,104}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Cair.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "InternalCombustionEngine: fluids mixing in volume are not compatible with each other");
+
+  // ----------------
+  // Water/steam side
+
+  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "InternalCombustionEngine: the fluid type for the water/steam side must be water/steam");
+
+  Cws1.Q = Cws2.Q;
+
+  Cws1.h_vol_1 = Cws2.h_vol_1;
+  Cws1.h_vol_2 = Cws2.h_vol_2;
+
+  Cws2.diff_on_1 = if (gamma_diff_ws > 0) then Cws1.diff_on_1 else false;
+  Cws1.diff_on_2 = if (gamma_diff_ws > 0) then Cws2.diff_on_2 else false;
+
+  Cws2.diff_res_1 = Cws1.diff_res_1 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0);
+  Cws1.diff_res_2 = Cws2.diff_res_2 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0);
+
+  Cws1.ftype = Cws2.ftype;
+
+  Cws1.Xco2 = Cws2.Xco2;
+  Cws1.Xh2o = Cws2.Xh2o;
+  Cws1.Xo2  = Cws2.Xo2;
+  Cws1.Xso2 = Cws2.Xso2;
+
+  ftype_ws = Cws1.ftype;
+
+  Qe = Cws1.Q;
+
+  Pee = Cws1.P;
+  Hee = Cws1.h;
+
+  Pse = Cws2.P;
+  Hse = Cws2.h;
+
+  // ---------------
+  // Combustion side
+
+  /* Fuel inlet */
+  Qcomb = Cfuel.Q;
+  Tcomb = Cfuel.T;
+  XCcomb = Cfuel.Xc;
+  XHcomb = Cfuel.Xh;
+  XOcomb = Cfuel.Xo;
+  XScomb = Cfuel.Xs;
+  PCIcomb = Cfuel.LHV;
+  Cpcomb = Cfuel.cp;
+
+  /* Air inlet */
+  Qea = Cair.Q;
+  Pea = Cair.P;
+  Hea = Cair.h;
+
+  XeaCO2 = Cair.Xco2;
+  XeaH2O = Cair.Xh2o;
+  XeaO2 = Cair.Xo2;
+  XeaSO2 = Cair.Xso2;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Hsf = Cfg.h;
+
+  /* Mass balance equation for the flue gases */
+  0 = Qcomb + Qea - Qsf;
+
+  /* Energy balance equation for the flue gases */
+  0 = Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair) - Qsf*(Hf - Hrfum) - Wloss + J;
+
+  Hcomb = Cpcomb*Tcomb;
+
+  Cair.h_vol_2 = h;
+  Cfg.h_vol_1 = h;
+
+  /* Fuel power */
+  Wfuel = Qcomb*PCIcomb;
+
+  /* Total incoming power */
+  Wtot = Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair);
+
+  /* Power exchanged in the boiler */
+  Wboil = Wtot - Qsf*(Hsf - Hrfum) - Wloss;
+
+  /* Water/steam specific enthalpy at the outlet */
+  Hse = Wboil/Qe + Hee;
+
+  /* Boiler efficiency*/
+  if (Boiler_efficiency_type == 1) then
+     eta_boil = 100*Wboil/Wfuel;
+  else
+     eta_boil = 100*Wboil/Wtot;
+  end if;
+
+  /* Flue gases composition balance equations */
+  0 = Qcomb*XCcomb*amCO2/amC + Qea*XeaCO2 - Qsf*XsfCO2;
+  0 = Qcomb*XHcomb*(amH2O/2)/amH + Qea*XeaH2O - Qsf*XsfH2O;
+  0 = Qea*XeaO2c - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb - Qsf*XsfO2;
+  0 = Qcomb*XScomb*amSO2/amS + Qea*XeaSO2 - Qsf*XsfSO2;
+
+  Cfg.ftype = ftype;
+
+  Cfg.Xco2 = XsfCO2;
+  Cfg.Xh2o = XsfH2O;
+  Cfg.Xo2  = XsfO2;
+  Cfg.Xso2 = XsfSO2;
+
+  /* Combustion air ratio */
+  exc = Qea*(1 - XeaH2O) / ((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO)) / (XeaO2c/(1 - XeaH2O)));
+
+  /* Air excess */
+  exc_air = (exc - 1)*100;
+
+  /* Flue gases pressure losses */
+  Pea - Psf = deltaPf;
+  deltaPf = Kf*ThermoSysPro.Functions.ThermoSquare(Qsf, eps)/rhof;
+
+  /* Water/steam pressure losses */
+  Pee - Pse = deltaPe;
+  deltaPe = Ke*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe;
+
+  /* No flow reversal */
+  Cfg.h = Cfg.h_vol_1;
+
+  /* Diffusion power */
+  if diffusion then
+    rair = if Cair.diff_on_1 then exp(-0.033*(Cair.Q*Cair.diff_res_1)^2) else 0;
+    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
+
+    gamma_air = if Cair.diff_on_1 then 1/Cair.diff_res_1 else gamma0;
+    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
+
+    Jair = if Cair.diff_on_1 then rair*gamma_air*(Cair.h_vol_1 - Cair.h_vol_2) else 0;
+    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
+  else
+    rair = 0;
+    rfg = 0;
+
+    gamma_air = gamma0;
+    gamma_fg = gamma0;
+
+    Jair = 0;
+    Jfg = 0;
+  end if;
+
+  J = Jair + Jfg;
+
+  Cair.diff_res_2 = 0;
+  Cfg.diff_res_1 = 0;
+
+  Cair.diff_on_2 = diffusion;
+  Cfg.diff_on_1 = diffusion;
+
+  /* Air specific enthalpy at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+
+  /* Flue gases tempretaure after combustion */
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  Hf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Flue gases specific enthalpy at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Flue gases density */
+  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, (Tea + Tf)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  0 = if (XeaO2 > teps) then (XeaO2c - XeaO2) else (XeaO2c - teps);
+
+  /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrcomb = 0;
+  Hrfum = 2501.569e3*XsfH2O;
+
+  /* Water/steam thermodynamic properties */
+  prom = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2, (Hee + Hse)/2, mode);
+  rhoe = prom.d;
+
+  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode);
+  Tse = pros.T;
+
+    annotation (             Icon(graphics={
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,-42},{10,-46},{20,-34},{24,-20},{22,-6},{20,2},{16,12},{
+              12,22},{10,30},{8,36},{4,54},{0,44},{-4,36},{-8,24},{-8,20},{-10,
+              16},{-12,24},{-14,26},{-16,22},{-20,14},{-22,8},{-26,0},{-28,-10},
+              {-30,-20},{-30,-28},{-24,-36},{-20,-42},{-10,-48},{-2,-42}},
+          lineColor={255,0,128},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-10,-24},{-8,-20},{-4,-18},{0,-18},{4,-20},{6,-22},{8,-28},{
+              8,-32},{6,-30},{4,-26},{2,-22},{-4,-22},{-6,-24},{-10,-28},{-12,
+              -30},{-12,-30},{-10,-24}},
+          lineColor={127,0,0},
+          fillColor={127,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-92,60},{92,60},{88,60},{80,60}}, color={28,108,200}),
+        Line(points={{-92,-62},{92,-62},{88,-62},{80,-62}},
+                                                        color={255,0,0})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 7.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"),
+    Diagram(graphics={
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={0,0,255},
+          fillColor= {127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,-42},{10,-46},{20,-34},{24,-20},{22,-6},{20,2},{16,12},{
+              12,22},{10,30},{8,36},{4,54},{0,44},{-4,36},{-8,24},{-8,20},{-10,
+              16},{-12,24},{-14,26},{-16,22},{-20,14},{-22,8},{-26,0},{-28,-10},
+              {-30,-20},{-30,-28},{-24,-36},{-20,-42},{-10,-48},{-2,-42}},
+          lineColor={255,0,128},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-10,-24},{-8,-20},{-4,-18},{0,-18},{4,-20},{6,-22},{8,-28},{
+              8,-32},{6,-30},{4,-26},{2,-22},{-4,-22},{-6,-24},{-10,-28},{-12,
+              -30},{-12,-30},{-10,-24}},
+          lineColor={127,0,0},
+          fillColor={127,0,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{68,-30},{108,-56}},
+          lineColor={238,46,47},
+          textString="Flue Gases"),
+        Line(points={{-92,60},{92,60},{88,60},{80,60}}, color={28,108,200}),
+        Line(points={{-92,-62},{92,-62},{88,-62},{80,-62}},
+                                                        color={255,0,0}),
+        Text(
+          extent={{-112,-36},{-86,-52}},
+          lineColor={28,108,200},
+          textString="Air")}));
+end FossilFuelBoiler;
diff --git a/ThermoSysPro/Fluid/Boilers/package.mo b/ThermoSysPro/Fluid/Boilers/package.mo
index c532b7c32286825c22aa3562df0fe2fdca1f5b24..c448b1d026253ffe8bcc24e4c425230b0faa378a 100644
--- a/ThermoSysPro/Fluid/Boilers/package.mo
+++ b/ThermoSysPro/Fluid/Boilers/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.Fluid;
-package Boilers "Boilers"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Boilers;
+within ThermoSysPro.Fluid;
+package Boilers "Boilers"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Boilers;
diff --git a/ThermoSysPro/Fluid/Boilers/package.order b/ThermoSysPro/Fluid/Boilers/package.order
index 5696276609231e95dd484899411862223f9a55ad..de93662aa0bd980535147989a115474025a5fe4b 100644
--- a/ThermoSysPro/Fluid/Boilers/package.order
+++ b/ThermoSysPro/Fluid/Boilers/package.order
@@ -1,2 +1,2 @@
-BoilerSystem
-FossilFuelBoiler
+BoilerSystem
+FossilFuelBoiler
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo b/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo
index 4b7aaa582b3dccdf3556fa329dcd24d1eeb8d54c..eacab3fb252aeee082170bf06458cffb220443ce 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo
@@ -1,160 +1,161 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model AirHumidity "Air humidity"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real hum0=0.5 "Air humidiy";
-  parameter Units.SI.Temperature T0=290 "Fixed fluid temperature";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  Units.SI.AbsolutePressure ppvap0(start=1e4)
-    "Intermediate vapor partial pressure";
-  Units.SI.Density rho_vap0(start=200) "Intermediate H2O density";
-  Units.SI.AbsolutePressure P "Air pressure";
-  Units.SI.MassFlowRate Q "Air mass flow rate";
-  Units.SI.SpecificEnthalpy h "Air specific enthalpy";
-  Units.SI.Temperature T "Air temperature";
-  Units.SI.Density rho_vap(start=200) "H20 density";
-  Units.SI.Density rho_air(start=0.8) "Air density";
-  Units.SI.AbsolutePressure psvap(start=1e5) "Vapor saturation pressure in the air";
-  Units.SI.AbsolutePressure ppvap(start=1e4) "Vapor partial pressure";
-  Units.SI.AbsolutePressure ppair "Air partial pressure";
-  Real hum "Air relative humidity";
-  Real Xo2as(start=0.2) "O2 mass fraction in dry air";
-  Real Xco2 "CO2 mass fraction at the outlet";
-  Real Xh2o "H2O mass fraction at the outlet";
-  Real Xo2 "O2 mass fraction at the outlet";
-  Real Xso2 "SO2 mas fraction at the outlet";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal humidity
-    "Air humidity"
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-equation
-  /* The fluid type must be flue gases */
-  assert(ftype == FluidType.FlueGases, "AirHumidity: the fluid type must be flue gases");
-
-  if (cardinality(humidity) == 0) then
-    humidity.signal = hum0;
-  end if;
-
-  hum = humidity.signal;
-
-  C1.P = C2.P;
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  P = C1.P;
-  Q = C1.Q;
-  h = C1.h;
-
-  ftype = C1.ftype;
-
-  /* O2 mass fraction at the inlet */
-  Xo2as = C1.Xo2;
-
-  /* Temperature at the outlet */
-  T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2as, Xso2);
-
-  /* Flue gas composition at the outlet. The sole constituents for air are O2 and N2 */
-  Xco2 = 0;
-  Xso2 = 0;
-  Xh2o = rho_vap/(rho_vap + rho_air);
-  Xo2 = Xo2as*(1 - Xh2o);
-
-  C2.Xco2 = Xco2;
-  C2.Xso2 = Xso2;
-  C2.Xh2o = Xh2o;
-  C2.Xo2 = Xo2;
-
-  /* Vapor partial pressure */
-  ppvap = psvap*hum;
-  0 = if (ppvap < 0.061080e-4) then ppvap0 - 0.061080e-4 else ppvap - ppvap0;
-
-  /* Air partial pressure */
-  ppair = P - ppvap;
-
-  /* Vapor saturation pressure */
-  psvap = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T);
-
-  /* H2O density */
-  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(ppvap, T, mode);
-
-  rho_vap0 = pro.d;
-
-  0 = if (ppvap < 0.061080e-4) then rho_vap - (rho_vap0*ppvap/ppvap0) else rho_vap - rho_vap0;
-
-  /* Air density */
-  rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(ppair, T, Xco2, Xh2o, Xo2as, Xso2);
-
-  annotation (Diagram(graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "H2O")}),                 Icon(graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({255,255,0}, fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "H2O")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end AirHumidity;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model AirHumidity "Air humidity"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real hum0=0.5 "Air humidiy";
+  parameter Units.SI.Temperature T0=290 "Fixed fluid temperature";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  Units.SI.AbsolutePressure ppvap0(start=1e4)
+    "Intermediate vapor partial pressure";
+  Units.SI.Density rho_vap0(start=200) "Intermediate H2O density";
+  Units.SI.AbsolutePressure P "Air pressure";
+  Units.SI.MassFlowRate Q "Air mass flow rate";
+  Units.SI.SpecificEnthalpy h "Air specific enthalpy";
+  Units.SI.Temperature T "Air temperature";
+  Units.SI.Density rho_vap(start=200) "H20 density";
+  Units.SI.Density rho_air(start=0.8) "Air density";
+  Units.SI.AbsolutePressure psvap(start=1e5) "Vapor saturation pressure in the air";
+  Units.SI.AbsolutePressure ppvap(start=1e4) "Vapor partial pressure";
+  Units.SI.AbsolutePressure ppair "Air partial pressure";
+  Real hum "Air relative humidity";
+  Real Xo2as(start=0.2) "O2 mass fraction in dry air";
+  Real Xco2 "CO2 mass fraction at the outlet";
+  Real Xh2o "H2O mass fraction at the outlet";
+  Real Xo2 "O2 mass fraction at the outlet";
+  Real Xso2 "SO2 mas fraction at the outlet";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal humidity
+    "Air humidity"
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+equation
+  /* The fluid type must be flue gases */
+  assert(ftype == FluidType.FlueGases, "AirHumidity: the fluid type must be flue gases");
+
+  if (cardinality(humidity) == 0) then
+    humidity.signal = hum0;
+  end if;
+
+  hum = humidity.signal;
+
+  C1.P = C2.P;
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  P = C1.P;
+  Q = C1.Q;
+  h = C1.h;
+
+  ftype = C1.ftype;
+
+  /* O2 mass fraction at the inlet */
+  Xo2as = C1.Xo2;
+
+  /* Temperature at the outlet */
+  T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2as, Xso2);
+
+  /* Flue gas composition at the outlet. The sole constituents for air are O2 and N2 */
+  Xco2 = 0;
+  Xso2 = 0;
+  Xh2o = rho_vap/(rho_vap + rho_air);
+  Xo2 = Xo2as*(1 - Xh2o);
+
+  C2.Xco2 = Xco2;
+  C2.Xso2 = Xso2;
+  C2.Xh2o = Xh2o;
+  C2.Xo2 = Xo2;
+
+  /* Vapor partial pressure */
+  ppvap = psvap*hum;
+  0 = if (ppvap < 0.061080e-4) then ppvap0 - 0.061080e-4 else ppvap - ppvap0;
+
+  /* Air partial pressure */
+  ppair = P - ppvap;
+
+  /* Vapor saturation pressure */
+  psvap = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T);
+
+  /* H2O density */
+  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(ppvap, T, mode);
+
+  rho_vap0 = pro.d;
+
+  0 = if (ppvap < 0.061080e-4) then rho_vap - (rho_vap0*ppvap/ppvap0) else rho_vap - rho_vap0;
+
+  /* Air density */
+  rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(ppair, T, Xco2, Xh2o, Xo2as, Xso2);
+
+  annotation (Diagram(graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "H2O")}),                 Icon(graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({255,255,0}, fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "H2O")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end AirHumidity;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo
index b018332b4fa19a78627190707ac09d1ffd06154d..2b80830d3147a72fd7d3eb4c86b23bc7eefdb9d7 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo
@@ -1,77 +1,78 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model PlugA "Plug"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  Q = C.Q;
-  P = C.P;
-
-  C.h_vol_1 = h;
-  C.diff_res_1 = 0;
-  C.diff_on_1 = diffusion;
-
-  ftype = C.ftype;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
-  else
-    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={128,255,0})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular))}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end PlugA;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model PlugA "Plug"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  Q = C.Q;
+  P = C.P;
+
+  C.h_vol_1 = h;
+  C.diff_res_1 = 0;
+  C.diff_on_1 = diffusion;
+
+  ftype = C.ftype;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
+  else
+    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={128,255,0})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular))}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end PlugA;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo b/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo
index 3f2d1315a1e553202fbcff93e7720346291e9d69..f98d27ec6f040468afb676584026f14a4f9084f0 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo
@@ -1,77 +1,78 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model PlugB "Plug"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Real Xco2(start=0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xh2o(start=0.05) "H2O mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xo2(start=0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xso2(start=0) "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-equation
-
-  Q = C.Q;
-  P = C.P;
-  h = C.h;
-
-  C.h_vol_2 = h;
-  C.diff_res_2 = 0;
-  C.diff_on_2 = diffusion;
-
-  ftype = C.ftype;
-
-  Xco2 = C.Xco2;
-  Xh2o = C.Xh2o;
-  Xo2 = C.Xo2;
-  Xso2 = C.Xso2;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={128,255,0})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-92,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular))}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end PlugB;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model PlugB "Plug"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Real Xco2(start=0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xh2o "H2O mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xo2(start=0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xso2(start=0) "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+equation
+
+  Q = C.Q;
+  P = C.P;
+  h = C.h;
+
+  C.h_vol_2 = h;
+  C.diff_res_2 = 0;
+  C.diff_on_2 = diffusion;
+
+  ftype = C.ftype;
+
+  Xco2 = C.Xco2;
+  Xh2o = C.Xh2o;
+  Xo2 = C.Xo2;
+  Xso2 = C.Xso2;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={128,255,0})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-92,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular))}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end PlugB;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo
index 12ff97128c547b2afaa6850959aef69caf8a2263..e8908f09acaafd8d28680be2344c3fcf8e35c441 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo
@@ -1,107 +1,108 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model RefH "Fixed specific enthalpy reference"
-  parameter Units.SI.SpecificEnthalpy h0=1.e5 "Fixed fluid specific enthalpy";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(ISpecificEnthalpy) == 0) then
-    ISpecificEnthalpy.signal = h0;
-  end if;
-
-  C1.Q = C2.Q;
-  C1.P = C2.P;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  P = C1.P;
-  h = C1.h;
-
-  h = ISpecificEnthalpy.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString="h")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString="h")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefH;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model RefH "Fixed specific enthalpy reference"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  parameter Units.SI.SpecificEnthalpy h0=1.e5 "Fixed fluid specific enthalpy";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(ISpecificEnthalpy) == 0) then
+    ISpecificEnthalpy.signal = h0;
+  end if;
+
+  C1.Q = C2.Q;
+  C1.P = C2.P;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  P = C1.P;
+  h = C1.h;
+
+  h = ISpecificEnthalpy.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString="h")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString="h")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefH;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo
index f3cf9bedf24bc63a9f6d34d5fc5d4d592b6efc97..e109484eb443d97f6165c9fa7142cf7c80c44484 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo
@@ -1,109 +1,110 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model RefP "Fixed pressure reference"
-  parameter Units.SI.AbsolutePressure P0=1.e5 "Fixed fluid pressure";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  C1.Q = C2.Q;
-  C1.P = C2.P;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  P = C1.P;
-  h = C1.h;
-
-  P = IPressure.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "P")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "P")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefP;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model RefP "Fixed pressure reference"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  parameter Units.SI.AbsolutePressure P0=1.e5 "Fixed fluid pressure";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  C1.Q = C2.Q;
+  C1.P = C2.P;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  P = C1.P;
+  h = C1.h;
+
+  P = IPressure.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "P")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "P")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefP;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo
index 1c6aa22ea89d75067939e8a0edbed720de145c35..30f65f1d448a9eb0206aaf29cd466eddc0599620 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo
@@ -1,109 +1,110 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model RefQ "Fixed mass flow reference"
-  parameter Units.SI.MassFlowRate Q0=10 "Fixed fluid mass flow";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  C1.Q = C2.Q;
-  C1.P = C2.P;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  P = C1.P;
-  h = C1.h;
-
-  Q = IMassFlow.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({255,255,0}, fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Q")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefQ;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model RefQ "Fixed mass flow reference"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  parameter Units.SI.MassFlowRate Q0=10 "Fixed fluid mass flow";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  C1.Q = C2.Q;
+  C1.P = C2.P;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  P = C1.P;
+  h = C1.h;
+
+  Q = IMassFlow.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({255,255,0}, fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Q")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefQ;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo
index 047dc79e266d7fa15bd4a36a1848cfb6e0f92f0b..fb4ba7b2fb2fcd00243ced141871a37b873db031 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo
@@ -1,121 +1,122 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model RefT "Fixed temperature reference"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Temperature T0=290 "Fixed fluid temperature";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  C1.Q = C2.Q;
-  C1.P = C2.P;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  P = C1.P;
-  h = C1.h;
-
-  ftype = C1.ftype;
-
-  /* Computation of the fluid specific enthalpy */
-  h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, ITemperature.signal, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={128,255,0}),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor= {0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefT;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model RefT "Fixed temperature reference"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Temperature T0=290 "Fixed fluid temperature";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  C1.Q = C2.Q;
+  C1.P = C2.P;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  P = C1.P;
+  h = C1.h;
+
+  ftype = C1.ftype;
+
+  /* Computation of the fluid specific enthalpy */
+  h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, ITemperature.signal, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={128,255,0}),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor= {0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefT;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo
index 65597a95338e75a1a809f7b2ecd067d68933c533..fc59688d33f0882577d8596996c46d32972d1723 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo
@@ -1,170 +1,171 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model RefXgas "Fixed gas composition"
-
-  parameter Real Xco2=0.05 "CO2 mass fraction at the outlet";
-  parameter Real Xh2o=0.01 "H2O mass fraction at the outlet";
-  parameter Real Xo2=0.1 "O2 mass fraction at the outlet";
-  parameter Real Xso2=0 "SO2 mas fraction at the outlet";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-
-  InstrumentationAndControl.Connectors.InputReal IXco2 annotation (Placement(
-        transformation(
-        origin={-90,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  InstrumentationAndControl.Connectors.InputReal IXh2o annotation (Placement(
-        transformation(
-        origin={-30,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  InstrumentationAndControl.Connectors.InputReal IXo2 annotation (Placement(
-        transformation(
-        origin={30,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  InstrumentationAndControl.Connectors.InputReal IXso2 annotation (Placement(
-        transformation(
-        origin={90,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-equation
-  if (cardinality(IXco2) == 0) then
-    IXco2.signal = Xco2;
-  end if;
-
-  if (cardinality(IXh2o) == 0) then
-    IXh2o.signal = Xh2o;
-  end if;
-
-  if (cardinality(IXo2) == 0) then
-    IXo2.signal = Xo2;
-  end if;
-
-  if (cardinality(IXso2) == 0) then
-    IXso2.signal = Xso2;
-  end if;
-
-  C1.Q = C2.Q;
-  C1.P = C2.P;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  P = C1.P;
-  h = C1.h;
-
-  C1.Xco2 = Xco2;
-  C1.Xso2 = Xso2;
-  C1.Xh2o = Xh2o;
-  C1.Xo2 = Xo2;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={128,255,0}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString="X"),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,27},{28,-29}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString="X"),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Rectangle(
-          extent={{-100,100},{100,90}},
-          lineColor={28,108,200},
-          fillColor={28,108,200},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-100,90},{-80,80}},
-          lineColor={28,108,200},
-          fillColor={28,108,200},
-          fillPattern=FillPattern.None,
-          textString="CO2"),
-        Text(
-          extent={{-40,90},{-20,80}},
-          lineColor={28,108,200},
-          fillColor={28,108,200},
-          fillPattern=FillPattern.None,
-          textString="H2O"),
-        Text(
-          extent={{20,90},{40,80}},
-          lineColor={28,108,200},
-          fillColor={28,108,200},
-          fillPattern=FillPattern.None,
-          textString="O2"),
-        Text(
-          extent={{80,90},{100,80}},
-          lineColor={28,108,200},
-          fillColor={28,108,200},
-          fillPattern=FillPattern.None,
-          textString="SO2")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefXgas;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model RefXgas "Fixed gas composition"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+  parameter Real Xco2=0.05 "CO2 mass fraction at the outlet";
+  parameter Real Xh2o=0.01 "H2O mass fraction at the outlet";
+  parameter Real Xo2=0.1 "O2 mass fraction at the outlet";
+  parameter Real Xso2=0 "SO2 mas fraction at the outlet";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+
+  InstrumentationAndControl.Connectors.InputReal IXco2 annotation (Placement(
+        transformation(
+        origin={-90,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  InstrumentationAndControl.Connectors.InputReal IXh2o annotation (Placement(
+        transformation(
+        origin={-30,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  InstrumentationAndControl.Connectors.InputReal IXo2 annotation (Placement(
+        transformation(
+        origin={30,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  InstrumentationAndControl.Connectors.InputReal IXso2 annotation (Placement(
+        transformation(
+        origin={90,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+equation
+  if (cardinality(IXco2) == 0) then
+    IXco2.signal = Xco2;
+  end if;
+
+  if (cardinality(IXh2o) == 0) then
+    IXh2o.signal = Xh2o;
+  end if;
+
+  if (cardinality(IXo2) == 0) then
+    IXo2.signal = Xo2;
+  end if;
+
+  if (cardinality(IXso2) == 0) then
+    IXso2.signal = Xso2;
+  end if;
+
+  C1.Q = C2.Q;
+  C1.P = C2.P;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  P = C1.P;
+  h = C1.h;
+
+  C1.Xco2 = Xco2;
+  C1.Xso2 = Xso2;
+  C1.Xh2o = Xh2o;
+  C1.Xo2 = Xo2;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={128,255,0}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString="X"),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,27},{28,-29}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString="X"),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Rectangle(
+          extent={{-100,100},{100,90}},
+          lineColor={28,108,200},
+          fillColor={28,108,200},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-100,90},{-80,80}},
+          lineColor={28,108,200},
+          fillColor={28,108,200},
+          fillPattern=FillPattern.None,
+          textString="CO2"),
+        Text(
+          extent={{-40,90},{-20,80}},
+          lineColor={28,108,200},
+          fillColor={28,108,200},
+          fillPattern=FillPattern.None,
+          textString="H2O"),
+        Text(
+          extent={{20,90},{40,80}},
+          lineColor={28,108,200},
+          fillColor={28,108,200},
+          fillPattern=FillPattern.None,
+          textString="O2"),
+        Text(
+          extent={{80,90},{100,80}},
+          lineColor={28,108,200},
+          fillColor={28,108,200},
+          fillPattern=FillPattern.None,
+          textString="SO2")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefXgas;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo
index 4c51f09c0586cfa540b561cbd31cd22e025a873a..d8cebb3f49f8d5ae178008a281a81db629001fb7 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo
@@ -1,123 +1,124 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model Sink "MultiFluids sink"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Units.SI.Temperature T0=290
-    "Source temperature (active if option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Source specific enthalpy (active if option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not option_temperature));
-  parameter Boolean option_temperature=false
-    "true:temperature fixed - false:specific enthalpy fixed";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  Real Xco2(start=0.01)
-    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xh2o(start=0.05)
-    "H2O mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xo2(start=0.2)
-    "O2 mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xso2(start=0)
-    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
-    "Fixed specific enthalpy or temperature according to option_temperature"
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  Q = C.Q;
-  P = C.P;
-
-  C.h_vol_2 = h;
-  C.diff_res_2 = 0;
-  C.diff_on_2 = diffusion;
-
-  ftype = C.ftype;
-
-  Xco2 = C.Xco2;
-  Xh2o = C.Xh2o;
-  Xo2 = C.Xo2;
-  Xso2 = C.Xso2;
-
-  /* Specific enthalpy or temperature */
-  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
-    if option_temperature then
-      ISpecificEnthalpyOrTemperature.signal = T0;
-    else
-      ISpecificEnthalpyOrTemperature.signal = h0;
-    end if;
-  end if;
-
-  if option_temperature then
-    T = ISpecificEnthalpyOrTemperature.signal;
-    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    h = ISpecificEnthalpyOrTemperature.signal;
-    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={255,255,0}),
-        Text(extent={{12,-42},{42,-62}},   textString=
-                                             "h / T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
-        Line(points={{-92,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(extent={{12,-42},{42,-62}},   textString=
-                                             "h / T")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Sink;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model Sink "MultiFluids sink"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Units.SI.Temperature T0=290
+    "Source temperature (active if option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Source specific enthalpy (active if option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not option_temperature));
+  parameter Boolean option_temperature=false
+    "true:temperature fixed - false:specific enthalpy fixed";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  Real Xco2(start=0.01)
+    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xh2o
+    "H2O mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xo2(start=0.2)
+    "O2 mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xso2(start=0)
+    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
+    "Fixed specific enthalpy or temperature according to option_temperature"
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  Q = C.Q;
+  P = C.P;
+
+  C.h_vol_2 = h;
+  C.diff_res_2 = 0;
+  C.diff_on_2 = diffusion;
+
+  ftype = C.ftype;
+
+  Xco2 = C.Xco2;
+  Xh2o = C.Xh2o;
+  Xo2 = C.Xo2;
+  Xso2 = C.Xso2;
+
+  /* Specific enthalpy or temperature */
+  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
+    if option_temperature then
+      ISpecificEnthalpyOrTemperature.signal = T0;
+    else
+      ISpecificEnthalpyOrTemperature.signal = h0;
+    end if;
+  end if;
+
+  if option_temperature then
+    T = ISpecificEnthalpyOrTemperature.signal;
+    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    h = ISpecificEnthalpyOrTemperature.signal;
+    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={255,255,0}),
+        Text(extent={{12,-42},{42,-62}},   textString=
+                                             "h / T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
+        Line(points={{-92,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(extent={{12,-42},{42,-62}},   textString=
+                                             "h / T")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Sink;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo
index 674039a6c30d5e3b4ab93309cd12c7c4bd2d4864..c8256ae612fd598de24c7077171a4ff79a5b8080 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo
@@ -1,142 +1,143 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model SinkP "Multi-fluid sink with fixed pressure"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure";
-  parameter Units.SI.Temperature T0=290
-    "Source temperature (active if option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Source specific enthalpy (active if option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not option_temperature));
-  parameter Boolean option_temperature=true
-    "true:temperature fixed - false:specific enthalpy fixed";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  ThermoSysPro.Units.SI.MassFraction Xco2(start=0.01)
-    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-  ThermoSysPro.Units.SI.MassFraction Xh2o(start=0.05)
-    "H2O mass fraction of the fluid crossing the boundary of the control volume";
-  ThermoSysPro.Units.SI.MassFraction Xo2(start=0.2)
-    "O2 mass fraction of the fluid crossing the boundary of the control volume";
-  ThermoSysPro.Units.SI.MassFraction Xso2(start=0)
-    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    "Fixed pressure"
-    annotation (Placement(transformation(
-        origin={50,0},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
-    "Fixed specific enthalpy or temperature according to option_temperature"
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  Q = C.Q;
-  C.P = P;
-
-  C.h_vol_2 = h;
-  C.diff_res_2 = 0;
-  C.diff_on_2 = diffusion;
-
-  ftype = C.ftype;
-
-  Xco2 = C.Xco2;
-  Xh2o = C.Xh2o;
-  Xo2 = C.Xo2;
-  Xso2 = C.Xso2;
-
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Specific enthalpy or temperature */
-  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
-    if option_temperature then
-      ISpecificEnthalpyOrTemperature.signal = T0;
-    else
-      ISpecificEnthalpyOrTemperature.signal = h0;
-    end if;
-  end if;
-
-  if option_temperature then
-    T = ISpecificEnthalpyOrTemperature.signal;
-    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    h = ISpecificEnthalpyOrTemperature.signal;
-    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Text(extent={{40,28},{58,8}}, textString="P"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0}),
-        Text(
-          extent={{-94,26},{98,-30}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString = "P"),
-        Text(extent={{12,-42},{42,-62}}, textString="h / T")}),
-    Window(
-      x=0.06,
-      y=0.16,
-      width=0.67,
-      height=0.71),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{-40,0},{-58,-10}}),
-        Text(extent={{-94,26},{98,-30}}, textString="P"),
-        Text(extent={{40,28},{58,8}}, textString="P"),
-        Text(extent={{12,-42},{42,-62}}, textString="h / T")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SinkP;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model SinkP "Multi-fluid sink with fixed pressure"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure";
+  parameter Units.SI.Temperature T0=290
+    "Source temperature (active if option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Source specific enthalpy (active if option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not option_temperature));
+  parameter Boolean option_temperature=true
+    "true:temperature fixed - false:specific enthalpy fixed";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  ThermoSysPro.Units.SI.MassFraction Xco2(start=0.01)
+    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+  ThermoSysPro.Units.SI.MassFraction Xh2o
+    "H2O mass fraction of the fluid crossing the boundary of the control volume";
+  ThermoSysPro.Units.SI.MassFraction Xo2(start=0.2)
+    "O2 mass fraction of the fluid crossing the boundary of the control volume";
+  ThermoSysPro.Units.SI.MassFraction Xso2(start=0)
+    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    "Fixed pressure"
+    annotation (Placement(transformation(
+        origin={50,0},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
+    "Fixed specific enthalpy or temperature according to option_temperature"
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  Q = C.Q;
+  C.P = P;
+
+  C.h_vol_2 = h;
+  C.diff_res_2 = 0;
+  C.diff_on_2 = diffusion;
+
+  ftype = C.ftype;
+
+  Xco2 = C.Xco2;
+  Xh2o = C.Xh2o;
+  Xo2 = C.Xo2;
+  Xso2 = C.Xso2;
+
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Specific enthalpy or temperature */
+  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
+    if option_temperature then
+      ISpecificEnthalpyOrTemperature.signal = T0;
+    else
+      ISpecificEnthalpyOrTemperature.signal = h0;
+    end if;
+  end if;
+
+  if option_temperature then
+    T = ISpecificEnthalpyOrTemperature.signal;
+    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    h = ISpecificEnthalpyOrTemperature.signal;
+    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Text(extent={{40,28},{58,8}}, textString="P"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0}),
+        Text(
+          extent={{-94,26},{98,-30}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          textString = "P"),
+        Text(extent={{12,-42},{42,-62}}, textString="h / T")}),
+    Window(
+      x=0.06,
+      y=0.16,
+      width=0.67,
+      height=0.71),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{-40,0},{-58,-10}}),
+        Text(extent={{-94,26},{98,-30}}, textString="P"),
+        Text(extent={{40,28},{58,8}}, textString="P"),
+        Text(extent={{12,-42},{42,-62}}, textString="h / T")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SinkP;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo
index 21cc7089e6bb1c303df4d8371ba64c8c91d96aa3..777a980015c936f6bc34ef0bfd992d7630e3aef6 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo
@@ -1,170 +1,171 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model SinkPQ "MultiFluids sink with fixed pressure and mass flow rate"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Units.SI.AbsolutePressure P0=100000
-    "Fluid pressure (active if IPressure connector is not connected)";
-  parameter Units.SI.MassFlowRate Q0=100
-    "Mass flow (active if IMassFlow connector is not connected)";
-  parameter Units.SI.Temperature T0=290
-    "Source temperature (active if option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Source specific enthalpy (active if option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not option_temperature));
-  parameter Boolean option_temperature=false
-    "true:temperature fixed - false:specific enthalpy fixed";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  Real Xco2(start=0.01)
-    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xh2o(start=0.05)
-    "H2O mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xo2(start=0.2)
-    "O2 mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xso2(start=0)
-    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    "Fixed mass flow rate"
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    "Fixed pressure"
-    annotation (Placement(transformation(
-        origin={50,0},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
-    "Fixed specific enthalpy or temperature according to option_temperature"
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  C.Q = Q;
-  P = C.P;
-
-  C.h_vol_2 = h;
-  C.diff_res_2 = 0;
-  C.diff_on_2 = diffusion;
-
-  ftype = C.ftype;
-
-  Xco2 = C.Xco2;
-  Xh2o = C.Xh2o;
-  Xo2 = C.Xo2;
-  Xso2 = C.Xso2;
-
-  /* Mass flow */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Specific enthalpy or temperature */
-  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
-    if option_temperature then
-      ISpecificEnthalpyOrTemperature.signal = T0;
-    else
-      ISpecificEnthalpyOrTemperature.signal = h0;
-    end if;
-  end if;
-
-  if option_temperature then
-    T = ISpecificEnthalpyOrTemperature.signal;
-    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    h = ISpecificEnthalpyOrTemperature.signal;
-    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(extent={{40,30},{60,10}}, textString=
-                                           "P"),
-        Text(extent={{12,60},{32,40}}, textString=
-                                           "Q"),
-        Text(extent={{10,-40},{30,-60}}, textString=
-                                           "h"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-20,20},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "P Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
-        Text(extent={{12,60},{32,40}}, textString=
-                                           "Q"),
-        Text(extent={{40,32},{60,12}}, textString=
-                                           "P"),
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(
-          extent={{-20,22},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "P Q"),
-        Text(extent={{12,-42},{42,-62}},   textString=
-                                             "h / T")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SinkPQ;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model SinkPQ "MultiFluids sink with fixed pressure and mass flow rate"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Units.SI.AbsolutePressure P0=100000
+    "Fluid pressure (active if IPressure connector is not connected)";
+  parameter Units.SI.MassFlowRate Q0=100
+    "Mass flow (active if IMassFlow connector is not connected)";
+  parameter Units.SI.Temperature T0=290
+    "Source temperature (active if option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Source specific enthalpy (active if option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not option_temperature));
+  parameter Boolean option_temperature=false
+    "true:temperature fixed - false:specific enthalpy fixed";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  Real Xco2(start=0.01)
+    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xh2o
+    "H2O mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xo2(start=0.2)
+    "O2 mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xso2(start=0)
+    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    "Fixed mass flow rate"
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    "Fixed pressure"
+    annotation (Placement(transformation(
+        origin={50,0},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
+    "Fixed specific enthalpy or temperature according to option_temperature"
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  C.Q = Q;
+  P = C.P;
+
+  C.h_vol_2 = h;
+  C.diff_res_2 = 0;
+  C.diff_on_2 = diffusion;
+
+  ftype = C.ftype;
+
+  Xco2 = C.Xco2;
+  Xh2o = C.Xh2o;
+  Xo2 = C.Xo2;
+  Xso2 = C.Xso2;
+
+  /* Mass flow */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Specific enthalpy or temperature */
+  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
+    if option_temperature then
+      ISpecificEnthalpyOrTemperature.signal = T0;
+    else
+      ISpecificEnthalpyOrTemperature.signal = h0;
+    end if;
+  end if;
+
+  if option_temperature then
+    T = ISpecificEnthalpyOrTemperature.signal;
+    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    h = ISpecificEnthalpyOrTemperature.signal;
+    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(extent={{40,30},{60,10}}, textString=
+                                           "P"),
+        Text(extent={{12,60},{32,40}}, textString=
+                                           "Q"),
+        Text(extent={{10,-40},{30,-60}}, textString=
+                                           "h"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-20,20},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "P Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
+        Text(extent={{12,60},{32,40}}, textString=
+                                           "Q"),
+        Text(extent={{40,32},{60,12}}, textString=
+                                           "P"),
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(
+          extent={{-20,22},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "P Q"),
+        Text(extent={{12,-42},{42,-62}},   textString=
+                                             "h / T")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SinkPQ;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo
index 15742a92371976ac6475a88c53b1fa4da40905cd..0ffa9739c7ce839750aac06455a014822bfb7b4c 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo
@@ -1,151 +1,152 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model SinkQ "Multi-fluids sink with fixed mass flow rate"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Units.SI.MassFlowRate Q0=100
-    "Mass flow (active if IMassFlow connector is not connected)";
-  parameter Units.SI.Temperature T0=290
-    "Source temperature (active if option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Source specific enthalpy (active if option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not option_temperature));
-  parameter Boolean option_temperature=false
-    "true:temperature fixed - false:specific enthalpy fixed";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  Real Xco2(start=0.01)
-    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xh2o(start=0.05)
-    "H2O mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xo2(start=0.2)
-    "O2 mass fraction of the fluid crossing the boundary of the control volume";
-  Real Xso2(start=0)
-    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    "Fixed mass flow rate"
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
-    "Fixed specific enthalpy or temperature according to option_temperature"
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  C.Q = Q;
-  P = C.P;
-
-  C.h_vol_2 = h;
-  C.diff_res_2 = 0;
-  C.diff_on_2 = diffusion;
-
-  ftype = C.ftype;
-
-  Xco2 = C.Xco2;
-  Xh2o = C.Xh2o;
-  Xo2 = C.Xo2;
-  Xso2 = C.Xso2;
-
-  /* Mass flow */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Specific enthalpy or temperature */
-  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
-    if option_temperature then
-      ISpecificEnthalpyOrTemperature.signal = T0;
-    else
-      ISpecificEnthalpyOrTemperature.signal = h0;
-    end if;
-  end if;
-
-  if option_temperature then
-    T = ISpecificEnthalpyOrTemperature.signal;
-    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    h = ISpecificEnthalpyOrTemperature.signal;
-    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(extent={{16,60},{36,40}}, textString=
-                                           "Q"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-20,20},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(extent={{12,-42},{42,-62}},   textString=
-                                             "h / T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
-        Text(extent={{12,60},{32,40}}, textString=
-                                           "Q"),
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(
-          extent={{-20,20},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(extent={{12,-42},{42,-62}},   textString=
-                                             "h / T")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SinkQ;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model SinkQ "Multi-fluids sink with fixed mass flow rate"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Units.SI.MassFlowRate Q0=100
+    "Mass flow (active if IMassFlow connector is not connected)";
+  parameter Units.SI.Temperature T0=290
+    "Source temperature (active if option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Source specific enthalpy (active if option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not option_temperature));
+  parameter Boolean option_temperature=false
+    "true:temperature fixed - false:specific enthalpy fixed";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  Real Xco2(start=0.01)
+    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xh2o
+    "H2O mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xo2(start=0.2)
+    "O2 mass fraction of the fluid crossing the boundary of the control volume";
+  Real Xso2(start=0)
+    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    "Fixed mass flow rate"
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
+    "Fixed specific enthalpy or temperature according to option_temperature"
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  C.Q = Q;
+  P = C.P;
+
+  C.h_vol_2 = h;
+  C.diff_res_2 = 0;
+  C.diff_on_2 = diffusion;
+
+  ftype = C.ftype;
+
+  Xco2 = C.Xco2;
+  Xh2o = C.Xh2o;
+  Xo2 = C.Xo2;
+  Xso2 = C.Xso2;
+
+  /* Mass flow */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Specific enthalpy or temperature */
+  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
+    if option_temperature then
+      ISpecificEnthalpyOrTemperature.signal = T0;
+    else
+      ISpecificEnthalpyOrTemperature.signal = h0;
+    end if;
+  end if;
+
+  if option_temperature then
+    T = ISpecificEnthalpyOrTemperature.signal;
+    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    h = ISpecificEnthalpyOrTemperature.signal;
+    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(extent={{16,60},{36,40}}, textString=
+                                           "Q"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-20,20},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(extent={{12,-42},{42,-62}},   textString=
+                                             "h / T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
+        Text(extent={{12,60},{32,40}}, textString=
+                                           "Q"),
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(
+          extent={{-20,20},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(extent={{12,-42},{42,-62}},   textString=
+                                             "h / T")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SinkQ;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo
index ccd4bde14e399c6e5375498d7f2fbbc2897aa3c6..8c9b2234a147a89f217f93b4137961b95db9c476 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo
@@ -1,149 +1,150 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model Source "MultiFluids Source"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Temperature T0=290
-    "Source temperature (active if option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Source specific enthalpy (active if option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not option_temperature));
-  parameter Boolean option_temperature=false
-    "true:temperature fixed - false:specific enthalpy fixed";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco2=0.01 "CO2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o=0.05 "H2O mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo2=0.22 "O2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso2=0 "SO2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-
-protected
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Temperature T(start=300) "Fluid temperature";
-
-  Interfaces.Connectors.FluidOutlet C annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
-    "Fixed specific enthalpy or temperature according to option_temperature"
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  Q = C.Q;
-  P = C.P;
-
-  C.h_vol_1 = h;
-  C.diff_res_1 = 0;
-  C.diff_on_1 = diffusion;
-
-  ftype = C.ftype;
-
-  if flue_gases then
-    C.Xco2 = Xco2;
-    C.Xh2o = Xh2o;
-    C.Xo2 = Xo2;
-    C.Xso2 = Xso2;
-  else
-    C.Xco2 = 0;
-    C.Xh2o = 0;
-    C.Xo2 = 0;
-    C.Xso2 = 0;
-  end if;
-
-  /* Specific enthalpy or temperature */
-  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
-    if option_temperature then
-      ISpecificEnthalpyOrTemperature.signal = T0;
-    else
-      ISpecificEnthalpyOrTemperature.signal = h0;
-    end if;
-  end if;
-
-  if option_temperature then
-    T = ISpecificEnthalpyOrTemperature.signal;
-    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    h = ISpecificEnthalpyOrTemperature.signal;
-    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
-  else
-    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{76,10}}),
-        Line(points={{76,-10},{90,0}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={255,255,0}),
-        Text(extent={{-40,-40},{-10,-60}}, textString="h / T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
-        Text(extent={{10,-40},{30,-60}}, textString="h"),
-        Line(points={{38,0},{90,0},{76,10}}),
-        Line(points={{76,-10},{90,0}})}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Source;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model Source "MultiFluids Source"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Temperature T0=290
+    "Source temperature (active if option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Source specific enthalpy (active if option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not option_temperature));
+  parameter Boolean option_temperature=false
+    "true:temperature fixed - false:specific enthalpy fixed";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco2= 0.01 "CO2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o=if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo2= 0.22 "O2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso2= 0 "SO2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+
+protected
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Temperature T(start=300) "Fluid temperature";
+
+  Interfaces.Connectors.FluidOutlet C annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
+    "Fixed specific enthalpy or temperature according to option_temperature"
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  Q = C.Q;
+  P = C.P;
+
+  C.h_vol_1 = h;
+  C.diff_res_1 = 0;
+  C.diff_on_1 = diffusion;
+
+  ftype = C.ftype;
+
+  if flue_gases then
+    C.Xco2 = Xco2;
+    C.Xh2o = Xh2o;
+    C.Xo2 = Xo2;
+    C.Xso2 = Xso2;
+  else
+    C.Xco2 = 0;
+    C.Xh2o = 0;
+    C.Xo2 = 0;
+    C.Xso2 = 0;
+  end if;
+
+  /* Specific enthalpy or temperature */
+  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
+    if option_temperature then
+      ISpecificEnthalpyOrTemperature.signal = T0;
+    else
+      ISpecificEnthalpyOrTemperature.signal = h0;
+    end if;
+  end if;
+
+  if option_temperature then
+    T = ISpecificEnthalpyOrTemperature.signal;
+    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    h = ISpecificEnthalpyOrTemperature.signal;
+    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
+  else
+    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{76,10}}),
+        Line(points={{76,-10},{90,0}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={255,255,0}),
+        Text(extent={{-40,-40},{-10,-60}}, textString="h / T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
+        Text(extent={{10,-40},{30,-60}}, textString="h"),
+        Line(points={{38,0},{90,0},{76,10}}),
+        Line(points={{76,-10},{90,0}})}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Source;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo
index f9c30fec728b93385b2a079ecbc8d3914640d8fe..9e020ffd09d189875e654307749d429021942a4b 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo
@@ -1,164 +1,165 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model SourceP "Multi-fluid source with fixed pressure"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.AbsolutePressure P0=300000 "Source pressure";
-  parameter Units.SI.Temperature T0=290
-    "Source temperature (active if option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Source specific enthalpy (active if option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not option_temperature));
-  parameter Boolean option_temperature=true
-    "true: temperature is fixed - false: specific enthalpy is fixed";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco2=0.01 "CO2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o=0.05 "H2O mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo2=0.22 "O2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso2=0 "SO2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-
-protected
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Temperature T(start=300) "Fluid temperature";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    "Fixed pressure"
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
-    "Fixed specific enthalpy or temperature according to option_temperature"
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  Q = C.Q;
-  C.P = P;
-
-  C.h_vol_1 = h;
-  C.diff_res_1 = 0;
-  C.diff_on_1 = diffusion;
-
-  C.ftype = ftype;
-
-  if flue_gases then
-    C.Xco2 = Xco2;
-    C.Xh2o = Xh2o;
-    C.Xo2 = Xo2;
-    C.Xso2 = Xso2;
-  else
-    C.Xco2 = 0;
-    C.Xh2o = 0;
-    C.Xo2 = 0;
-    C.Xso2 = 0;
-  end if;
-
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Specific enthalpy or temperature */
-  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
-    if option_temperature then
-      ISpecificEnthalpyOrTemperature.signal = T0;
-    else
-      ISpecificEnthalpyOrTemperature.signal = h0;
-    end if;
-  end if;
-
-  if option_temperature then
-    T = ISpecificEnthalpyOrTemperature.signal;
-    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    h = ISpecificEnthalpyOrTemperature.signal;
-    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
-  else
-    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-58,30},{-40,10}}, textString="P"),
-        Text(extent={{-40,-40},{-10,-60}}, textString="h / T"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0}),
-        Text(extent={{-94,28},{98,-28}}, textString="P")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-94,28},{98,-28}}, textString="P"),
-        Text(extent={{-58,30},{-40,10}}, textString="P"),
-        Text(extent={{-40,-40},{-10,-60}}, textString="h / T")}),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SourceP;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model SourceP "Multi-fluid source with fixed pressure"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.AbsolutePressure P0=300000 "Source pressure";
+  parameter Units.SI.Temperature T0=290
+    "Source temperature (active if option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Source specific enthalpy (active if option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not option_temperature));
+  parameter Boolean option_temperature=true
+    "true: temperature is fixed - false: specific enthalpy is fixed";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco2=0.01 "CO2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o=if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo2=0.22 "O2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso2=0 "SO2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+
+protected
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Temperature T(start=300) "Fluid temperature";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    "Fixed pressure"
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
+    "Fixed specific enthalpy or temperature according to option_temperature"
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  Q = C.Q;
+  C.P = P;
+
+  C.h_vol_1 = h;
+  C.diff_res_1 = 0;
+  C.diff_on_1 = diffusion;
+
+  C.ftype = ftype;
+
+  if flue_gases then
+    C.Xco2 = Xco2;
+    C.Xh2o = Xh2o;
+    C.Xo2 = Xo2;
+    C.Xso2 = Xso2;
+  else
+    C.Xco2 = 0;
+    C.Xh2o = 0;
+    C.Xo2 = 0;
+    C.Xso2 = 0;
+  end if;
+
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Specific enthalpy or temperature */
+  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
+    if option_temperature then
+      ISpecificEnthalpyOrTemperature.signal = T0;
+    else
+      ISpecificEnthalpyOrTemperature.signal = h0;
+    end if;
+  end if;
+
+  if option_temperature then
+    T = ISpecificEnthalpyOrTemperature.signal;
+    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    h = ISpecificEnthalpyOrTemperature.signal;
+    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
+  else
+    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-58,30},{-40,10}}, textString="P"),
+        Text(extent={{-40,-40},{-10,-60}}, textString="h / T"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0}),
+        Text(extent={{-94,28},{98,-28}}, textString="P")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-94,28},{98,-28}}, textString="P"),
+        Text(extent={{-58,30},{-40,10}}, textString="P"),
+        Text(extent={{-40,-40},{-10,-60}}, textString="h / T")}),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SourceP;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo
index 321d5ff0be39543c3459299a3a287079ced846a4..724d0f1d994f87243c06f245fdd1ad5a6628128b 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo
@@ -1,192 +1,193 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model SourcePQ "MultiFluids source with fixed pressure and mass flow rate"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.AbsolutePressure P0=300000
-    "Fluid pressure (active if IPressure connector is not connected)";
-  parameter Units.SI.MassFlowRate Q0=100
-    "Mass flow (active if IMassFlow connector is not connected)";
-  parameter Units.SI.Temperature T0=290
-    "Source temperature (active if option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Source specific enthalpy (active if option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not option_temperature));
-  parameter Boolean option_temperature=false
-    "true:temperature fixed - false:specific enthalpy fixed";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco2=0.01 "CO2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o=0.05 "H2O mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo2=0.22 "O2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso2=0 "SO2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-
-protected
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Units.SI.Temperature T(start=300) "Fluid temperature";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    "Fixed mass flow rate"
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    "Fixed pressure"
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature
-    "Fixed specific enthalpy or temperature according to option_temperature"
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C.Q = Q;
-  C.P = P;
-
-  C.h_vol_1 = h;
-  C.diff_res_1 = 0;
-  C.diff_on_1 = diffusion;
-
-  ftype = C.ftype;
-
-  if flue_gases then
-    C.Xco2 = Xco2;
-    C.Xh2o = Xh2o;
-    C.Xo2 = Xo2;
-    C.Xso2 = Xso2;
-  else
-    C.Xco2 = 0;
-    C.Xh2o = 0;
-    C.Xo2 = 0;
-    C.Xso2 = 0;
-  end if;
-
-  /* Mass flow */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Specific enthalpy or temperature */
-  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
-    if option_temperature then
-      ISpecificEnthalpyOrTemperature.signal = T0;
-    else
-      ISpecificEnthalpyOrTemperature.signal = h0;
-    end if;
-  end if;
-
-  if option_temperature then
-    T = ISpecificEnthalpyOrTemperature.signal;
-    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    h = ISpecificEnthalpyOrTemperature.signal;
-    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
-  else
-    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-58,30},{-40,10}}, textString="P"),
-        Text(extent={{-28,60},{-10,40}}, textString="Q"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-22,20},{20,-24}},
-          lineColor={0,0,255},
-          textString=
-               "P Q"),
-        Text(extent={{-40,-40},{-10,-60}}, textString="h / T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-30,60},{-10,40}}, textString="Q"),
-        Text(extent={{-60,30},{-40,10}}, textString="P"),
-        Text(
-          extent={{-22,20},{20,-24}},
-          lineColor={0,0,255},
-          textString=
-               "P Q"),
-        Text(extent={{-40,-40},{-10,-60}}, textString="h / T")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SourcePQ;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model SourcePQ "MultiFluids source with fixed pressure and mass flow rate"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.AbsolutePressure P0=300000
+    "Fluid pressure (active if IPressure connector is not connected)";
+  parameter Units.SI.MassFlowRate Q0=100
+    "Mass flow (active if IMassFlow connector is not connected)";
+  parameter Units.SI.Temperature T0=290
+    "Source temperature (active if option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Source specific enthalpy (active if option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not option_temperature));
+  parameter Boolean option_temperature=false
+    "true:temperature fixed - false:specific enthalpy fixed";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco2= 0.01 "CO2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o=if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo2= 0.22 "O2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso2= 0 "SO2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+
+protected
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Units.SI.Temperature T(start=300) "Fluid temperature";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    "Fixed mass flow rate"
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    "Fixed pressure"
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature
+    "Fixed specific enthalpy or temperature according to option_temperature"
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C.Q = Q;
+  C.P = P;
+
+  C.h_vol_1 = h;
+  C.diff_res_1 = 0;
+  C.diff_on_1 = diffusion;
+
+  ftype = C.ftype;
+
+  if flue_gases then
+    C.Xco2 = Xco2;
+    C.Xh2o = Xh2o;
+    C.Xo2 = Xo2;
+    C.Xso2 = Xso2;
+  else
+    C.Xco2 = 0;
+    C.Xh2o = 0;
+    C.Xo2 = 0;
+    C.Xso2 = 0;
+  end if;
+
+  /* Mass flow */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Specific enthalpy or temperature */
+  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
+    if option_temperature then
+      ISpecificEnthalpyOrTemperature.signal = T0;
+    else
+      ISpecificEnthalpyOrTemperature.signal = h0;
+    end if;
+  end if;
+
+  if option_temperature then
+    T = ISpecificEnthalpyOrTemperature.signal;
+    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    h = ISpecificEnthalpyOrTemperature.signal;
+    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
+  else
+    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-58,30},{-40,10}}, textString="P"),
+        Text(extent={{-28,60},{-10,40}}, textString="Q"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-22,20},{20,-24}},
+          lineColor={0,0,255},
+          textString=
+               "P Q"),
+        Text(extent={{-40,-40},{-10,-60}}, textString="h / T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-30,60},{-10,40}}, textString="Q"),
+        Text(extent={{-60,30},{-40,10}}, textString="P"),
+        Text(
+          extent={{-22,20},{20,-24}},
+          lineColor={0,0,255},
+          textString=
+               "P Q"),
+        Text(extent={{-40,-40},{-10,-60}}, textString="h / T")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SourcePQ;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo
index 7e18217170d09f8ee10681ef10d7938be525eb47..5f3d8c5cdaeb9d59c24bfd7f95eb63d6d7f49b77 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo
@@ -1,181 +1,182 @@
-within ThermoSysPro.Fluid.BoundaryConditions;
-model SourceQ "Multi-fluid source with fixed mass flow rate"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.MassFlowRate Q0=100
-    "Mass flow (active if IMassFlow connector is not connected)";
-  parameter Units.SI.Temperature T0=290
-    "Source temperature (active if option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Source specific enthalpy (active if option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not option_temperature));
-  parameter Boolean option_temperature=false
-    "true:temperature fixed - false:specific enthalpy fixed";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco2=0.01 "CO2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o=0.05 "H2O mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo2=0.22 "O2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso2=0 "SO2 mass fraction"
-    annotation (Evaluate=true, Dialog(
-      enable=(ftype == FluidType.FlueGases),
-      tab="Fluid",
-      group="Composition values (active for flue gases only)"));
-
-protected
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Fluid mass flow rate";
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Units.SI.Temperature T(start=300) "Fluid temperature";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    "Fixed mass flow rate"
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
-    "Fixed specific enthalpy or temperature according to option_temperature"
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-
-  C.Q = Q;
-  P = C.P;
-
-  C.h_vol_1 = h;
-  C.diff_res_1 = 0;
-  C.diff_on_1 = diffusion;
-
-  ftype = C.ftype;
-
-  if flue_gases then
-    C.Xco2 = Xco2;
-    C.Xh2o = Xh2o;
-    C.Xo2 = Xo2;
-    C.Xso2 = Xso2;
-  else
-    C.Xco2 = 0;
-    C.Xh2o = 0;
-    C.Xo2 = 0;
-    C.Xso2 = 0;
-  end if;
-
-  /* Mass flow rate */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Specific enthalpy or temperature */
-  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
-    if option_temperature then
-      ISpecificEnthalpyOrTemperature.signal = T0;
-    else
-      ISpecificEnthalpyOrTemperature.signal = h0;
-    end if;
-  end if;
-
-  if option_temperature then
-    T = ISpecificEnthalpyOrTemperature.signal;
-    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    h = ISpecificEnthalpyOrTemperature.signal;
-    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
-  else
-    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-28,60},{-10,40}}, textString=
-                                             "Q"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-20,20},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(extent={{-40,-40},{-10,-60}}, textString=
-                                             "h / T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-30,60},{-10,40}}, textString=
-                                             "Q"),
-        Text(
-          extent={{-20,20},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Text(extent={{-40,-40},{-10,-60}}, textString=
-                                             "h / T")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SourceQ;
+within ThermoSysPro.Fluid.BoundaryConditions;
+model SourceQ "Multi-fluid source with fixed mass flow rate"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.MassFlowRate Q0=100
+    "Mass flow (active if IMassFlow connector is not connected)";
+  parameter Units.SI.Temperature T0=290
+    "Source temperature (active if option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Source specific enthalpy (active if option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not option_temperature));
+  parameter Boolean option_temperature=false
+    "true:temperature fixed - false:specific enthalpy fixed";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco2= 0.01 "CO2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o=if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo2= 0.22 "O2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso2= 0 "SO2 mass fraction"
+    annotation (Evaluate=true, Dialog(
+      enable=(ftype == FluidType.FlueGases),
+      tab="Fluid",
+      group="Composition values (active for flue gases only)"));
+
+protected
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Fluid mass flow rate";
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Units.SI.Temperature T(start=300) "Fluid temperature";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    "Fixed mass flow rate"
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal              ISpecificEnthalpyOrTemperature
+    "Fixed specific enthalpy or temperature according to option_temperature"
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+
+  C.Q = Q;
+  P = C.P;
+
+  C.h_vol_1 = h;
+  C.diff_res_1 = 0;
+  C.diff_on_1 = diffusion;
+
+  ftype = C.ftype;
+
+  if flue_gases then
+    C.Xco2 = Xco2;
+    C.Xh2o = Xh2o;
+    C.Xo2 = Xo2;
+    C.Xso2 = Xso2;
+  else
+    C.Xco2 = 0;
+    C.Xh2o = 0;
+    C.Xo2 = 0;
+    C.Xso2 = 0;
+  end if;
+
+  /* Mass flow rate */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Specific enthalpy or temperature */
+  if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then
+    if option_temperature then
+      ISpecificEnthalpyOrTemperature.signal = T0;
+    else
+      ISpecificEnthalpyOrTemperature.signal = h0;
+    end if;
+  end if;
+
+  if option_temperature then
+    T = ISpecificEnthalpyOrTemperature.signal;
+    h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    h = ISpecificEnthalpyOrTemperature.signal;
+    T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1);
+  else
+    C.h = if (C.Q > 0) then C.h_vol_1 else C.h_vol_2;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-28,60},{-10,40}}, textString=
+                                             "Q"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-20,20},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(extent={{-40,-40},{-10,-60}}, textString=
+                                             "h / T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-30,60},{-10,40}}, textString=
+                                             "Q"),
+        Text(
+          extent={{-20,20},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Text(extent={{-40,-40},{-10,-60}}, textString=
+                                             "h / T")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SourceQ;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/package.mo b/ThermoSysPro/Fluid/BoundaryConditions/package.mo
index 0fac2006cdc6656c888b695fcf5b34cd4afbdcb5..aa043c7fa608d45ae9498ab3b20e4ec8477e0fc2 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/package.mo
+++ b/ThermoSysPro/Fluid/BoundaryConditions/package.mo
@@ -1,120 +1,120 @@
-within ThermoSysPro.Fluid;
-package BoundaryConditions "Boundary conditions"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end BoundaryConditions;
+within ThermoSysPro.Fluid;
+package BoundaryConditions "Boundary conditions"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end BoundaryConditions;
diff --git a/ThermoSysPro/Fluid/BoundaryConditions/package.order b/ThermoSysPro/Fluid/BoundaryConditions/package.order
index 030943a180e61917950ff268e5bbf0c5bb48280c..6583266e9db5ada56527d0e5447682e9c54dd24e 100644
--- a/ThermoSysPro/Fluid/BoundaryConditions/package.order
+++ b/ThermoSysPro/Fluid/BoundaryConditions/package.order
@@ -1,16 +1,16 @@
-AirHumidity
-PlugA
-PlugB
-RefP
-RefQ
-RefH
-RefT
-RefXgas
-SourceP
-SourceQ
-SourcePQ
-Source
-SinkP
-SinkQ
-SinkPQ
-Sink
+AirHumidity
+PlugA
+PlugB
+RefP
+RefQ
+RefH
+RefT
+RefXgas
+SourceP
+SourceQ
+SourcePQ
+Source
+SinkP
+SinkQ
+SinkPQ
+Sink
diff --git a/ThermoSysPro/Fluid/Combustion/BoundaryConditions/FuelSourcePQ.mo b/ThermoSysPro/Fluid/Combustion/BoundaryConditions/FuelSourcePQ.mo
index 047f45a6f0c369b318a7c9657f7678001d9efb5d..3969aa8d1ec51c8f4472759d8c5a61ad14931700 100644
--- a/ThermoSysPro/Fluid/Combustion/BoundaryConditions/FuelSourcePQ.mo
+++ b/ThermoSysPro/Fluid/Combustion/BoundaryConditions/FuelSourcePQ.mo
@@ -1,116 +1,116 @@
-within ThermoSysPro.Fluid.Combustion.BoundaryConditions;
-model FuelSourcePQ "Fuel source with fixed pressure and mass flow rate"
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Fuel pressure (active if pressure input port is not connected)";
-  parameter Units.SI.MassFlowRate Q0=10
-    "Fuel mass flow rate (active if mass flow input port is not connected)";
-  parameter Units.SI.Temperature T0=300 "Fuel temperature";
-  parameter Units.SI.SpecificEnergy LHV=48e6 "Lower heating value";
-  parameter Units.SI.SpecificHeatCapacity Cp=1e3
-    "Fuel specific heat capacity at 273.15K";
-  parameter Real Hum=0.0 "Fuel humidity (%)";
-  parameter Real Xc=0.75 "C mass fraction";
-  parameter Real Xh=0.25 "H mass fraction";
-  parameter Real Xo=0 "O mass fraction";
-  parameter Real Xn=0 "N mass fraction";
-  parameter Real Xs=0 "S mass fraction";
-  parameter Real Xashes=0 "Ashes mass fraction";
-  parameter Real Vol=0 "Volatile matter mass fraction";
-  parameter Units.SI.Density rho=0.72 "Fuel density";
-
-public
-  Units.SI.MassFlowRate Q "Fuel mass flow rate";
-  Units.SI.AbsolutePressure P "Fuel pressure";
-  Units.SI.Temperature T(start=300) "Fuel temperature";
-
-  Interfaces.Connectors.FuelOutlet C annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=90,
-        origin={100,0})));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-equation
-
-  Q = C.Q;
-  C.P = P;
-  C.T = T;
-  C.LHV = LHV;
-  C.cp = Cp;
-  C.rho = rho;
-
-  /* Fuel composition */
-  C.hum = Hum;
-  C.Xc = Xc;
-  C.Xh = Xh;
-  C.Xo = Xo;
-  C.Xn = Xn;
-  C.Xs = Xs;
-  C.Xashes = Xashes;
-  C.VolM = Vol;
-
-  /* Mass flow rate */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Temperature */
-  T = T0;
-
-  annotation (Diagram(graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.CrossDiag),
-        Text(extent={{-30,60},{-12,40}}, textString=
-                                             "Q"),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),Icon(graphics={
-        Text(
-          extent={{-38,60},{-4,40}},
-          lineColor={0,0,255},
-          textString=
-               "Q"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.CrossDiag),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(
-          extent={{-64,26},{-40,6}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end FuelSourcePQ;
+within ThermoSysPro.Fluid.Combustion.BoundaryConditions;
+model FuelSourcePQ "Fuel source with fixed pressure and mass flow rate"
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Fuel pressure (active if pressure input port is not connected)";
+  parameter Units.SI.MassFlowRate Q0=10
+    "Fuel mass flow rate (active if mass flow input port is not connected)";
+  parameter Units.SI.Temperature T0=300 "Fuel temperature";
+  parameter Units.SI.SpecificEnergy LHV=48e6 "Lower heating value";
+  parameter Units.SI.SpecificHeatCapacity Cp=1e3
+    "Fuel specific heat capacity at 273.15K";
+  parameter Real Hum=0.0 "Fuel humidity (%)";
+  parameter Real Xc=0.75 "C mass fraction";
+  parameter Real Xh=0.25 "H mass fraction";
+  parameter Real Xo=0 "O mass fraction";
+  parameter Real Xn=0 "N mass fraction";
+  parameter Real Xs=0 "S mass fraction";
+  parameter Real Xashes=0 "Ashes mass fraction";
+  parameter Real Vol=0 "Volatile matter mass fraction";
+  parameter Units.SI.Density rho=0.72 "Fuel density";
+
+public
+  Units.SI.MassFlowRate Q "Fuel mass flow rate";
+  Units.SI.AbsolutePressure P "Fuel pressure";
+  Units.SI.Temperature T(start=300) "Fuel temperature";
+
+  Interfaces.Connectors.FuelOutlet C annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=90,
+        origin={100,0})));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+equation
+
+  Q = C.Q;
+  C.P = P;
+  C.T = T;
+  C.LHV = LHV;
+  C.cp = Cp;
+  C.rho = rho;
+
+  /* Fuel composition */
+  C.hum = Hum;
+  C.Xc = Xc;
+  C.Xh = Xh;
+  C.Xo = Xo;
+  C.Xn = Xn;
+  C.Xs = Xs;
+  C.Xashes = Xashes;
+  C.VolM = Vol;
+
+  /* Mass flow rate */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Temperature */
+  T = T0;
+
+  annotation (Diagram(graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.CrossDiag),
+        Text(extent={{-30,60},{-12,40}}, textString=
+                                             "Q"),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),Icon(graphics={
+        Text(
+          extent={{-38,60},{-4,40}},
+          lineColor={0,0,255},
+          textString=
+               "Q"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.CrossDiag),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(
+          extent={{-64,26},{-40,6}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end FuelSourcePQ;
diff --git a/ThermoSysPro/Fluid/Combustion/BoundaryConditions/package.mo b/ThermoSysPro/Fluid/Combustion/BoundaryConditions/package.mo
index 01a4599de5f15639662d0f3f8ac17fc7f746c7ff..a5468f171116a4ec1173580d80bd4a36165a6b52 100644
--- a/ThermoSysPro/Fluid/Combustion/BoundaryConditions/package.mo
+++ b/ThermoSysPro/Fluid/Combustion/BoundaryConditions/package.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.Fluid.Combustion;
-package BoundaryConditions "Boundary conditions"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end BoundaryConditions;
+within ThermoSysPro.Fluid.Combustion;
+package BoundaryConditions "Boundary conditions"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end BoundaryConditions;
diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo
index c0db982c39431667371ecb666dc4585b06db2b94..83a003340f645f7eedcda4d8a909af22aaf679e3 100644
--- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo
+++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo
@@ -1,352 +1,352 @@
-within ThermoSysPro.Fluid.Combustion.CombustionChambers;
-model GTCombustionChamber "Gas turbine combustion chamber"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real kcham=1 "Pressure loss coefficient in the combustion chamber";
-  parameter Units.SI.Area Acham=1 "Average cross-sectional area of the combustion chamber";
-  parameter Real eta_comb=1 "Combustion efficiency";
-  parameter Units.SI.Power Wpth=1e6 "Thermal loss fraction in the body of the combustion chamber";
-  parameter Boolean air_atomisation=false "true: computation with air atomisation - false: computation without air atomisation";
-  parameter Units.SI.Temperature Tecpat=293 "Temperature at the inlet of the atomisation compressor";
-  parameter Real kat=0 "Atomisation pressure loss coefficient";
-  parameter Real XQat=0 "Atomisation air mass flow rate coefficient";
-  parameter Real Xspat=0 "Atomisation over-pressure coefficient";
-  parameter Real eta_is=1 "Atomisation compressor isentropic efficiency";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Real eps_a=1e-6 "Zero criterion for a-dimensional numbers";
-  constant Real eps_s=1e-6 "Zero criterion for surface numbers";
-  constant Real amCO2 = amC + 2*amO "CO2 molecular mass";
-  constant Real amH2O = 2*amH + amO "H2O molecular mass";
-  constant Real amSO2 = amS + 2*amO "SO2 molecular mass";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-
-public
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
-  Units.SI.SpecificEnthalpy Hea(start=50e3) "Air specific enthalpy at the inlet";
-  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
-  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
-  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
-  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
-  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
-  Real XCfuel(start=0.8) "C mass fraction in the fuel";
-  Real XHfuel(start=0.2) "H mass fraction in the fuel";
-  Real XOfuel(start=0) "O mass fraction in the fuel";
-  Real XSfuel(start=0) "S mass fraction in the fuel";
-  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value";
-  Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity";
-  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
-  Units.SI.SpecificEnthalpy Hews(start=10e3) "Water/steam specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
-  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
-  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
-  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
-  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
-  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
-  Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel";
-  Real exc(start=1) "Combustion air ratio";
-  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3) "Pressure loss in the combusiton chamber";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrws(start=10e4) "Water/steam reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfuel(start=10e3) "Fuel reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfg(start=10e3) "Flue gases reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hecpat(start=10e3) "Air specific enthalpy at the inlet of the atomisaiton compressor";
-  Units.SI.SpecificEnthalpy Hiscpat(start=10e3) "Air specific enthalpy after isentropic expansion at the outlet of the atomisaiotn compressor";
-  Units.SI.AbsolutePressure Pecpat(start=1e5) "Pressure at the inlet of the atomisation compressor";
-  Units.SI.AbsolutePressure Pscpat(start=1e5) "Pressure at the outlet of the atomisation compressor";
-  Units.SI.SpecificEntropy Secpat(start=1e3) "Entropy at the inlet of the atomisation compressor";
-  Units.SI.MassFlowRate Qm(start=400) "Average mass flow rate in the combustion chamber";
-  Real Vea(start=0.001) "Air volume mass (m3/kg)";
-  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
-  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
-  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
-  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
-  Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber";
-  Units.SI.Power Wcpat(start=1e3) "Power of the atomisation compressor";
-  Units.SI.Power Wrfat(start=1e3) "Thermal power extracted by the atomisaiton refrigerant";
-  Real eta_isc(start=1) "Intermediate variable for the computation of the isentropic efficiency of the atomisaiton compressor";
-  Units.SI.Area Achamc(start=1) "Intermediate variable for the computation of the average corss-section aera of the combusion chamber";
-  Real XeaO2c(start=0.2) "Intermediate variable for the computation of the O2 mass fraction";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  FluidType fluids[3] "Fluids mixing in volume";
-  Units.SI.Power Ja "Thermal power diffusion from inlet Ca";
-  Units.SI.Power Jws "Thermal power diffusion from inlet Cws";
-  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_a "Diffusion conductance for inlet Ca";
-  Units.SI.MassFlowRate gamma_ws "Diffusion conductance for inlet Cws";
-  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
-  Real ra "Value of r(Q/gamma) for inlet Ca";
-  Real rws "Value of r(Q/gamma) for inlet Cws";
-  Real rfg "Value of r(Q/gamma) for outlet Cfg";
-  FluidType ftype_ws "Water/steam fluid type";
-  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet"
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
-    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet"
-    annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation=
-            0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ca.ftype;
-  fluids[3] = Cfg.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "GenericCombustion1D: fluids mixing in volume are not compatible with each other");
-
-  /* Fuel inlet */
-  Qfuel = Cfuel.Q;
-  Tfuel = Cfuel.T;
-  XCfuel = Cfuel.Xc;
-  XHfuel = Cfuel.Xh;
-  XOfuel = Cfuel.Xo;
-  XSfuel = Cfuel.Xs;
-  LHVfuel = Cfuel.LHV;
-  Cpfuel = Cfuel.cp;
-
-  /* Water inlet */
-  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam");
-
-  Cws.diff_res_2 = 0;
-  Cws.diff_on_2 = diffusion;
-
-  ftype_ws = Cws.ftype;
-
-  Qews = Cws.Q;
-  Hews = Cws.h;
-
-  /* Air inlet */
-  Qea = Ca.Q;
-  Pea = Ca.P;
-  Hea = Ca.h;
-
-  XeaCO2 = Ca.Xco2;
-  XeaH2O = Ca.Xh2o;
-  XeaO2 = Ca.Xo2;
-  XeaSO2 = Ca.Xso2;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Hsf = Cfg.h;
-
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Mass balance equation */
-  0 = Qea + Qews + Qfuel - Qsf;
-
-  /* Energy balance equation */
-  if air_atomisation then
-    0 = ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wrfat + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws) + Wcpat) + J;
-
-    /* Atomisation power */
-    Pecpat = Pea*(1 - kat);
-    Pscpat = (1 + Xspat)*Pea;
-    Wcpat = Qea*XQat*(Hiscpat - Hecpat)*eta_isc;
-
-    /* Heat extracted by the atomisation refrigerant */
-    Wrfat = Qea*XQat*(Hea - Hecpat);
-  else
-    0 = ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + J;
-
-    /* Atomisation power */
-    Pecpat = Pea;
-    Pscpat = Pea;
-    Wcpat = 0;
-
-    /* Heat extracted by the atomisation refrigerant */
-    Wrfat = 0;
-  end if;
-
-  Cws.h_vol_2 = h;
-  Ca.h_vol_2 = h;
-  Cfg.h_vol_1 = h;
-
-  Cfg.ftype = ftype;
-
-  /* No flow reversal */
-  Cfg.h = Cfg.h_vol_1;
-
-  /* Diffusion power */
-  if diffusion then
-    ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0;
-    rws = if Cws.diff_on_1 then exp(-0.033*(Cws.Q*Cws.diff_res_1)^2) else 0;
-    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
-
-    gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0;
-    gamma_ws = if Cws.diff_on_1 then 1/Cws.diff_res_1 else gamma0;
-    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
-
-    Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0;
-    Jws = if Cws.diff_on_1 then rws*gamma_ws*(Cws.h_vol_1 - Cws.h_vol_2) else 0;
-    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
-  else
-    ra = 0;
-    rws = 0;
-    rfg = 0;
-
-    gamma_a = gamma0;
-    gamma_ws = gamma0;
-    gamma_fg = gamma0;
-
-    Ja = 0;
-    Jws = 0;
-    Jfg = 0;
-  end if;
-
-  J = Ja + Jws + Jfg;
-
-  Ca.diff_res_2 = 0;
-  Cfg.diff_res_1 = 0;
-
-  Ca.diff_on_2 = diffusion;
-  Cfg.diff_on_1 = diffusion;
-
-  /* Specific enthalpy and entropy at the inlet of the atomisation compressor */
-  if air_atomisation then
-     Hecpat  = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-     Secpat  = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-     Hiscpat = ThermoSysPro.Properties.FlueGases.FlueGases_h_Ps(Pscpat, Secpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-  else
-     Hecpat =  60000;
-     Secpat = -2000;
-     Hiscpat = 60000;
-  end if;
-
-  /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrfuel = 0;
-  Hrws = 2501.569e3;
-  Hrfg = 2501.569e3*XsfH2O;
-
-  /* Air specific enthalpy at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-
-  /* Flue gases specific enthalpy at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Air density at the inlet */
-  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-  Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1;
-
-  /* Flue gases density at the outlet */
-  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-  Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1;
-
-  0 = if (eta_is > eps_a) then (eta_isc - eta_is) else (eta_isc - eps_a);
-  0 = if (Acham > eps_s) then (Achamc - Acham) else (Achamc - eps_s);
-  0 = if (XeaO2 > eps_a) then (XeaO2c - XeaO2) else (XeaO2c - eps_a);
-
-  /* CO2 flue gases mass fraction */
-  XsfCO2*(Qea + Qews + Qfuel) = (Qea*XeaCO2) + (Qfuel*XCfuel*amCO2/amC);
-
-  /* H2O flue gases mass fraction */
-  XsfH2O*(Qea + Qews + Qfuel) = (Qews) + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2/amH);
-
-  /* O2 flue gases mass fraction */
-  XsfO2*(Qea + Qews + Qfuel) = (Qea*XeaO2c) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
-
-  /* SO2 flue gases mass fraction */
-  XsfSO2*(Qea + Qews + Qfuel) = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
-
-  /* Fuel thermal power */
-  Wfuel = Qfuel*LHVfuel;
-
-  /* Combustion air ratio */
-  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O)));
-
-  /* Pressure losses */
-  Pea - Psf = deltaPccb;
-  Qm = Qea + (Qfuel + Qews)/2;
-  Vccbm = (Vea + Vsf)/2;
-  v = Qm*Vccbm/Achamc;
-  deltaPccb = (kcham*(v^2))/(2*Vccbm);
-
-  /* Fuel specific enthalpy at the inlet */
-  Hfuel = Cpfuel*(Tfuel - 273.16);
-
-    annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
-        Polygon(
-          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
-              -44},{-20,-60},{-20,62}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.CrossDiag)}),
-                             Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
-        Polygon(
-          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
-              -44},{-20,-60},{-20,62}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.CrossDiag),
-        Text(
-          extent={{-98,104},{-72,76}},
-          lineColor={28,108,200},
-          textString="Water in"),
-        Text(
-          extent={{62,34},{110,-2}},
-          lineColor={238,46,47},
-          textString="Flue gases out"),
-        Text(
-          extent={{18,-78},{44,-106}},
-          lineColor={28,108,200},
-          textString="Fuel in"),
-        Text(
-          extent={{-100,-6},{-74,-30}},
-          lineColor={28,108,200},
-          textString="Air in")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 8.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end GTCombustionChamber;
+within ThermoSysPro.Fluid.Combustion.CombustionChambers;
+model GTCombustionChamber "Gas turbine combustion chamber"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real kcham=1 "Pressure loss coefficient in the combustion chamber";
+  parameter Units.SI.Area Acham=1 "Average cross-sectional area of the combustion chamber";
+  parameter Real eta_comb=1 "Combustion efficiency";
+  parameter Units.SI.Power Wpth=1e6 "Thermal loss fraction in the body of the combustion chamber";
+  parameter Boolean air_atomisation=false "true: computation with air atomisation - false: computation without air atomisation";
+  parameter Units.SI.Temperature Tecpat=293 "Temperature at the inlet of the atomisation compressor";
+  parameter Real kat=0 "Atomisation pressure loss coefficient";
+  parameter Real XQat=0 "Atomisation air mass flow rate coefficient";
+  parameter Real Xspat=0 "Atomisation over-pressure coefficient";
+  parameter Real eta_is=1 "Atomisation compressor isentropic efficiency";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Real eps_a=1e-6 "Zero criterion for a-dimensional numbers";
+  constant Real eps_s=1e-6 "Zero criterion for surface numbers";
+  constant Real amCO2 = amC + 2*amO "CO2 molecular mass";
+  constant Real amH2O = 2*amH + amO "H2O molecular mass";
+  constant Real amSO2 = amS + 2*amO "SO2 molecular mass";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+
+public
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
+  Units.SI.SpecificEnthalpy Hea(start=50e3) "Air specific enthalpy at the inlet";
+  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
+  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
+  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
+  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
+  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
+  Real XCfuel(start=0.8) "C mass fraction in the fuel";
+  Real XHfuel(start=0.2) "H mass fraction in the fuel";
+  Real XOfuel(start=0) "O mass fraction in the fuel";
+  Real XSfuel(start=0) "S mass fraction in the fuel";
+  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value";
+  Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity";
+  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
+  Units.SI.SpecificEnthalpy Hews(start=10e3) "Water/steam specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
+  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
+  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
+  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
+  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
+  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
+  Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel";
+  Real exc(start=1) "Combustion air ratio";
+  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3) "Pressure loss in the combusiton chamber";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrws(start=10e4) "Water/steam reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfuel(start=10e3) "Fuel reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfg(start=10e3) "Flue gases reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hecpat(start=10e3) "Air specific enthalpy at the inlet of the atomisaiton compressor";
+  Units.SI.SpecificEnthalpy Hiscpat(start=10e3) "Air specific enthalpy after isentropic expansion at the outlet of the atomisaiotn compressor";
+  Units.SI.AbsolutePressure Pecpat(start=1e5) "Pressure at the inlet of the atomisation compressor";
+  Units.SI.AbsolutePressure Pscpat(start=1e5) "Pressure at the outlet of the atomisation compressor";
+  Units.SI.SpecificEntropy Secpat(start=1e3) "Entropy at the inlet of the atomisation compressor";
+  Units.SI.MassFlowRate Qm(start=400) "Average mass flow rate in the combustion chamber";
+  Real Vea(start=0.001) "Air volume mass (m3/kg)";
+  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
+  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
+  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
+  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
+  Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber";
+  Units.SI.Power Wcpat(start=1e3) "Power of the atomisation compressor";
+  Units.SI.Power Wrfat(start=1e3) "Thermal power extracted by the atomisaiton refrigerant";
+  Real eta_isc(start=1) "Intermediate variable for the computation of the isentropic efficiency of the atomisaiton compressor";
+  Units.SI.Area Achamc(start=1) "Intermediate variable for the computation of the average corss-section aera of the combusion chamber";
+  Real XeaO2c(start=0.2) "Intermediate variable for the computation of the O2 mass fraction";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  FluidType fluids[3] "Fluids mixing in volume";
+  Units.SI.Power Ja "Thermal power diffusion from inlet Ca";
+  Units.SI.Power Jws "Thermal power diffusion from inlet Cws";
+  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_a "Diffusion conductance for inlet Ca";
+  Units.SI.MassFlowRate gamma_ws "Diffusion conductance for inlet Cws";
+  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
+  Real ra "Value of r(Q/gamma) for inlet Ca";
+  Real rws "Value of r(Q/gamma) for inlet Cws";
+  Real rfg "Value of r(Q/gamma) for outlet Cfg";
+  FluidType ftype_ws "Water/steam fluid type";
+  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet"
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
+    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet"
+    annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation=
+            0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ca.ftype;
+  fluids[3] = Cfg.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "GenericCombustion1D: fluids mixing in volume are not compatible with each other");
+
+  /* Fuel inlet */
+  Qfuel = Cfuel.Q;
+  Tfuel = Cfuel.T;
+  XCfuel = Cfuel.Xc;
+  XHfuel = Cfuel.Xh;
+  XOfuel = Cfuel.Xo;
+  XSfuel = Cfuel.Xs;
+  LHVfuel = Cfuel.LHV;
+  Cpfuel = Cfuel.cp;
+
+  /* Water inlet */
+  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam");
+
+  Cws.diff_res_2 = 0;
+  Cws.diff_on_2 = diffusion;
+
+  ftype_ws = Cws.ftype;
+
+  Qews = Cws.Q;
+  Hews = Cws.h;
+
+  /* Air inlet */
+  Qea = Ca.Q;
+  Pea = Ca.P;
+  Hea = Ca.h;
+
+  XeaCO2 = Ca.Xco2;
+  XeaH2O = Ca.Xh2o;
+  XeaO2 = Ca.Xo2;
+  XeaSO2 = Ca.Xso2;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Hsf = Cfg.h;
+
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Mass balance equation */
+  0 = Qea + Qews + Qfuel - Qsf;
+
+  /* Energy balance equation */
+  if air_atomisation then
+    0 = ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wrfat + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws) + Wcpat) + J;
+
+    /* Atomisation power */
+    Pecpat = Pea*(1 - kat);
+    Pscpat = (1 + Xspat)*Pea;
+    Wcpat = Qea*XQat*(Hiscpat - Hecpat)*eta_isc;
+
+    /* Heat extracted by the atomisation refrigerant */
+    Wrfat = Qea*XQat*(Hea - Hecpat);
+  else
+    0 = ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + J;
+
+    /* Atomisation power */
+    Pecpat = Pea;
+    Pscpat = Pea;
+    Wcpat = 0;
+
+    /* Heat extracted by the atomisation refrigerant */
+    Wrfat = 0;
+  end if;
+
+  Cws.h_vol_2 = h;
+  Ca.h_vol_2 = h;
+  Cfg.h_vol_1 = h;
+
+  Cfg.ftype = ftype;
+
+  /* No flow reversal */
+  Cfg.h = Cfg.h_vol_1;
+
+  /* Diffusion power */
+  if diffusion then
+    ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0;
+    rws = if Cws.diff_on_1 then exp(-0.033*(Cws.Q*Cws.diff_res_1)^2) else 0;
+    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
+
+    gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0;
+    gamma_ws = if Cws.diff_on_1 then 1/Cws.diff_res_1 else gamma0;
+    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
+
+    Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0;
+    Jws = if Cws.diff_on_1 then rws*gamma_ws*(Cws.h_vol_1 - Cws.h_vol_2) else 0;
+    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
+  else
+    ra = 0;
+    rws = 0;
+    rfg = 0;
+
+    gamma_a = gamma0;
+    gamma_ws = gamma0;
+    gamma_fg = gamma0;
+
+    Ja = 0;
+    Jws = 0;
+    Jfg = 0;
+  end if;
+
+  J = Ja + Jws + Jfg;
+
+  Ca.diff_res_2 = 0;
+  Cfg.diff_res_1 = 0;
+
+  Ca.diff_on_2 = diffusion;
+  Cfg.diff_on_1 = diffusion;
+
+  /* Specific enthalpy and entropy at the inlet of the atomisation compressor */
+  if air_atomisation then
+     Hecpat  = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+     Secpat  = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+     Hiscpat = ThermoSysPro.Properties.FlueGases.FlueGases_h_Ps(Pscpat, Secpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+  else
+     Hecpat =  60000;
+     Secpat = -2000;
+     Hiscpat = 60000;
+  end if;
+
+  /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrfuel = 0;
+  Hrws = 2501.569e3;
+  Hrfg = 2501.569e3*XsfH2O;
+
+  /* Air specific enthalpy at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+
+  /* Flue gases specific enthalpy at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Air density at the inlet */
+  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+  Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1;
+
+  /* Flue gases density at the outlet */
+  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+  Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1;
+
+  0 = if (eta_is > eps_a) then (eta_isc - eta_is) else (eta_isc - eps_a);
+  0 = if (Acham > eps_s) then (Achamc - Acham) else (Achamc - eps_s);
+  0 = if (XeaO2 > eps_a) then (XeaO2c - XeaO2) else (XeaO2c - eps_a);
+
+  /* CO2 flue gases mass fraction */
+  XsfCO2*(Qea + Qews + Qfuel) = (Qea*XeaCO2) + (Qfuel*XCfuel*amCO2/amC);
+
+  /* H2O flue gases mass fraction */
+  XsfH2O*(Qea + Qews + Qfuel) = (Qews) + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2/amH);
+
+  /* O2 flue gases mass fraction */
+  XsfO2*(Qea + Qews + Qfuel) = (Qea*XeaO2c) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
+
+  /* SO2 flue gases mass fraction */
+  XsfSO2*(Qea + Qews + Qfuel) = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
+
+  /* Fuel thermal power */
+  Wfuel = Qfuel*LHVfuel;
+
+  /* Combustion air ratio */
+  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O)));
+
+  /* Pressure losses */
+  Pea - Psf = deltaPccb;
+  Qm = Qea + (Qfuel + Qews)/2;
+  Vccbm = (Vea + Vsf)/2;
+  v = Qm*Vccbm/Achamc;
+  deltaPccb = (kcham*(v^2))/(2*Vccbm);
+
+  /* Fuel specific enthalpy at the inlet */
+  Hfuel = Cpfuel*(Tfuel - 273.16);
+
+    annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
+        Polygon(
+          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
+              -44},{-20,-60},{-20,62}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.CrossDiag)}),
+                             Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
+        Polygon(
+          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
+              -44},{-20,-60},{-20,62}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.CrossDiag),
+        Text(
+          extent={{-98,104},{-72,76}},
+          lineColor={28,108,200},
+          textString="Water in"),
+        Text(
+          extent={{62,34},{110,-2}},
+          lineColor={238,46,47},
+          textString="Flue gases out"),
+        Text(
+          extent={{18,-78},{44,-106}},
+          lineColor={28,108,200},
+          textString="Fuel in"),
+        Text(
+          extent={{-100,-6},{-74,-30}},
+          lineColor={28,108,200},
+          textString="Air in")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 8.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end GTCombustionChamber;
diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo
index 1fa3bad9ecd9ac4089e6c1dfd3c7d58e0f2dd87e..597985e26c1a5a9b388d489c904dfa701530209d 100644
--- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo
+++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo
@@ -1,338 +1,338 @@
-within ThermoSysPro.Fluid.Combustion.CombustionChambers;
-model GenericCombustion "Generic combustion chamber"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=1 "Pressure loss coefficient in the combustion chamber";
-  parameter Units.SI.Area Acham=1 "Average corss-sectional area of the combusiton chamber";
-  parameter Real Xpth=0.01 "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)";
-  parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)";
-  parameter Real ImbBF=0 "Unburnt particle ratio in the low furnace ashes (0-1)";
-  parameter Units.SI.SpecificHeatCapacity Cpcd=500 "Ashes specific heat capacity";
-  parameter Units.SI.Temperature Tbf=500 "Ashes temperature at the outlet of the low furnace";
-  parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Units.SI.SpecificEnergy HHVcarbone=32.8e6 "Unburnt carbon higher heating value";
-  constant Real amCO2=amC + 2*amO "CO2 molecular mass";
-  constant Real amH2O=2*amH + amO "H2O molecular mass";
-  constant Real amSO2=amS + 2*amO "SO2 molecular mass";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-
-public
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
-  Units.SI.SpecificEnthalpy Hea(start=50e3) "Air specific enthalpy at the inlet";
-  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
-  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
-  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
-  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
-  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
-  Real XCfuel(start=0.8) "C mass fraction in the fuel";
-  Real XHfuel(start=0.2) "H mass fraction in the fuel";
-  Real XOfuel(start=0) "O mass fraction in the fuel";
-  Real XSfuel(start=0) "S mass fraction in the fuel";
-  Real Xwfuel(start=0) "H2O mass fraction in the fuel";
-  Real XCDfuel(start=0) "Ashes mass fraction in the fuel";
-  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value";
-  Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity";
-  Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value";
-  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
-  Units.SI.SpecificEnthalpy Hews(start=10e3) "Water/steam specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
-  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
-  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
-  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
-  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
-  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
-  Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel";
-  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
-  Real exc(start=1) "Combustion air ratio";
-  Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate";
-  Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate";
-  Units.SI.SpecificEnthalpy Hcv(start=10e3)
-    "Volatile ashes specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hbf(start=10e3)
-    "Low furnace ashes specific enthalpy at the outlet";
-  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3) "Pressure loss in the combustion chamber";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrws(start=10e4) "Water/steam reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfuel(start=10e3) "Fuel reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrcd(start=10e3) "Ashes reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfg(start=10e3) "Flue gases reference specific enthalpy";
-  Real Vea(start=0.001) "Air volume mass (m3/kg)";
-  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
-  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
-  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
-  Units.SI.MassFlowRate Qm(start=400) "Average mlass flow rate in the combusiton chamber";
-  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
-  Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  FluidType fluids[3] "Fluids mixing in volume";
-  Units.SI.Power Ja "Thermal power diffusion from inlet Ca";
-  Units.SI.Power Jws "Thermal power diffusion from inlet Cws";
-  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_a "Diffusion conductance for inlet Ca";
-  Units.SI.MassFlowRate gamma_ws "Diffusion conductance for inlet Cws";
-  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
-  Real ra "Value of r(Q/gamma) for inlet Ca";
-  Real rws "Value of r(Q/gamma) for inlet Cws";
-  Real rfg "Value of r(Q/gamma) for outlet Cfg";
-  FluidType ftype_ws "Water/steam fluid type";
-  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{60,-100},{80,-80}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet"
-    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
-    annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet"
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ca.ftype;
-  fluids[3] = Cfg.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "GenericCombustion1D: fluids mixing in volume are not compatible with each other");
-
-  /* Fuel inlet */
-  Qfuel = Cfuel.Q;
-  Tfuel = Cfuel.T;
-
-  XCfuel = Cfuel.Xc;
-  XHfuel = Cfuel.Xh;
-  XOfuel = Cfuel.Xo;
-  XSfuel = Cfuel.Xs;
-  Xwfuel = Cfuel.hum;
-  XCDfuel = Cfuel.Xashes;
-
-  LHVfuel = Cfuel.LHV;
-  Cpfuel = Cfuel.cp;
-
-  /* Water inlet */
-  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam");
-
-  Cws.diff_res_2 = 0;
-  Cws.diff_on_2 = diffusion;
-
-  ftype_ws = Cws.ftype;
-
-  Qews = Cws.Q;
-  Hews = Cws.h;
-
-  /* Air inlet */
-  Qea = Ca.Q;
-  Pea = Ca.P;
-  Hea = Ca.h;
-
-  XeaCO2 = Ca.Xco2;
-  XeaH2O = Ca.Xh2o;
-  XeaO2 = Ca.Xo2;
-  XeaSO2 = Ca.Xso2;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Hsf = Cfg.h;
-
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Mass balance equation */
-  0 = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF - Qsf;
-
-  Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV);
-  Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF);
-
-  /* Energy balance equation */
-  0 = ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone)
-      - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + J;
-
-  Hfuel = Cpfuel*(Tfuel - 273.16);
-  Hcv = Cpcd*(Tsf - 273.16);
-  Hbf = Cpcd*(Tbf - 273.16);
-
-  Cws.h_vol_2 = h;
-  Ca.h_vol_2 = h;
-  Cfg.h_vol_1 = h;
-
-  Cfg.ftype = ftype;
-
-  /* No flow reversal */
-  Cfg.h = Cfg.h_vol_1;
-
-  /* Diffusion power */
-  if diffusion then
-    ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0;
-    rws = if Cws.diff_on_1 then exp(-0.033*(Cws.Q*Cws.diff_res_1)^2) else 0;
-    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
-
-    gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0;
-    gamma_ws = if Cws.diff_on_1 then 1/Cws.diff_res_1 else gamma0;
-    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
-
-    Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0;
-    Jws = if Cws.diff_on_1 then rws*gamma_ws*(Cws.h_vol_1 - Cws.h_vol_2) else 0;
-    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
-  else
-    ra = 0;
-    rws = 0;
-    rfg = 0;
-
-    gamma_a = gamma0;
-    gamma_ws = gamma0;
-    gamma_fg = gamma0;
-
-    Ja = 0;
-    Jws = 0;
-    Jfg = 0;
-  end if;
-
-  J = Ja + Jws + Jfg;
-
-  Ca.diff_res_2 = 0;
-  Cfg.diff_res_1 = 0;
-
-  Ca.diff_on_2 = diffusion;
-  Cfg.diff_on_1 = diffusion;
-
- /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrfuel = 0;
-  Hrws = 2501.569e3;
-  Hrfg = 2501.569e3*XsfH2O;
-  Hrcd = 0;
-
-  /* Air specific enthalpy at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-
-  /* Flue gases specific enthalpy at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Air density at the inlet */
-  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-  Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1;
-
-  /* Flue gases density at the outlet */
-  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-  Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1;
-
-  /* CO2 flue gases mass fraction */
-  XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC);
-
-  /* H2O flue gases mass fraction */
-  XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2 /amH);
-
-  /* O2 flue gases mass fraction */
-  XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
-
-  /* SO2 flue gases mass fraction */
-  XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
-
-  /* Fuel thermal power */
-  HHVfuel = LHVfuel + 224.3e5*XHfuel + 25.1e5*Xwfuel;
-  Wfuel = Qfuel*HHVfuel;
-  Wpth = Qfuel*LHVfuel*Xpth;
-
-  /* Combustion air ratio */
-  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO)
-        - Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O)));
-
-  /* Pressure losses */
-  Pea - Psf = deltaPccb;
-  Qm = Qea + (Qfuel + Qews)/2;
-  Vccbm = (Vea + Vsf)/2;
-  v = Qm*Vccbm/Acham;
-  deltaPccb = (kcham*(v^2))/(2*Vccbm);
-
-    annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44},
-              {38,-80},{-34,-80},{-50,-36}},
-          lineColor={0,0,0},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72},
-              {16,-80},{-16,-80},{-32,-36}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-                             Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44},
-              {38,-80},{-34,-80},{-50,-36}},
-          lineColor={0,0,0},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72},
-              {16,-80},{-16,-80},{-32,-36}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{82,-76},{108,-104}},
-          lineColor={28,108,200},
-          textString="Fuel inlet"),
-        Text(
-          extent={{-66,-78},{-42,-102}},
-          lineColor={28,108,200},
-          textString="Air inlet"),
-        Text(
-          extent={{-110,42},{-82,14}},
-          lineColor={28,108,200},
-          textString="Water inlet"),
-        Text(
-          extent={{-18,106},{30,70}},
-          lineColor={238,46,47},
-          textString="Flue gases outlet")}),
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end GenericCombustion;
+within ThermoSysPro.Fluid.Combustion.CombustionChambers;
+model GenericCombustion "Generic combustion chamber"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=1 "Pressure loss coefficient in the combustion chamber";
+  parameter Units.SI.Area Acham=1 "Average corss-sectional area of the combusiton chamber";
+  parameter Real Xpth=0.01 "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)";
+  parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)";
+  parameter Real ImbBF=0 "Unburnt particle ratio in the low furnace ashes (0-1)";
+  parameter Units.SI.SpecificHeatCapacity Cpcd=500 "Ashes specific heat capacity";
+  parameter Units.SI.Temperature Tbf=500 "Ashes temperature at the outlet of the low furnace";
+  parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Units.SI.SpecificEnergy HHVcarbone=32.8e6 "Unburnt carbon higher heating value";
+  constant Real amCO2=amC + 2*amO "CO2 molecular mass";
+  constant Real amH2O=2*amH + amO "H2O molecular mass";
+  constant Real amSO2=amS + 2*amO "SO2 molecular mass";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+
+public
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
+  Units.SI.SpecificEnthalpy Hea(start=50e3) "Air specific enthalpy at the inlet";
+  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
+  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
+  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
+  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
+  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
+  Real XCfuel(start=0.8) "C mass fraction in the fuel";
+  Real XHfuel(start=0.2) "H mass fraction in the fuel";
+  Real XOfuel(start=0) "O mass fraction in the fuel";
+  Real XSfuel(start=0) "S mass fraction in the fuel";
+  Real Xwfuel(start=0) "H2O mass fraction in the fuel";
+  Real XCDfuel(start=0) "Ashes mass fraction in the fuel";
+  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value";
+  Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity";
+  Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value";
+  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
+  Units.SI.SpecificEnthalpy Hews(start=10e3) "Water/steam specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
+  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
+  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
+  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
+  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
+  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
+  Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel";
+  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
+  Real exc(start=1) "Combustion air ratio";
+  Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate";
+  Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate";
+  Units.SI.SpecificEnthalpy Hcv(start=10e3)
+    "Volatile ashes specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hbf(start=10e3)
+    "Low furnace ashes specific enthalpy at the outlet";
+  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3) "Pressure loss in the combustion chamber";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrws(start=10e4) "Water/steam reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfuel(start=10e3) "Fuel reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrcd(start=10e3) "Ashes reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfg(start=10e3) "Flue gases reference specific enthalpy";
+  Real Vea(start=0.001) "Air volume mass (m3/kg)";
+  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
+  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
+  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
+  Units.SI.MassFlowRate Qm(start=400) "Average mlass flow rate in the combusiton chamber";
+  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
+  Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  FluidType fluids[3] "Fluids mixing in volume";
+  Units.SI.Power Ja "Thermal power diffusion from inlet Ca";
+  Units.SI.Power Jws "Thermal power diffusion from inlet Cws";
+  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_a "Diffusion conductance for inlet Ca";
+  Units.SI.MassFlowRate gamma_ws "Diffusion conductance for inlet Cws";
+  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
+  Real ra "Value of r(Q/gamma) for inlet Ca";
+  Real rws "Value of r(Q/gamma) for inlet Cws";
+  Real rfg "Value of r(Q/gamma) for outlet Cfg";
+  FluidType ftype_ws "Water/steam fluid type";
+  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{60,-100},{80,-80}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet"
+    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
+    annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet"
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ca.ftype;
+  fluids[3] = Cfg.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "GenericCombustion1D: fluids mixing in volume are not compatible with each other");
+
+  /* Fuel inlet */
+  Qfuel = Cfuel.Q;
+  Tfuel = Cfuel.T;
+
+  XCfuel = Cfuel.Xc;
+  XHfuel = Cfuel.Xh;
+  XOfuel = Cfuel.Xo;
+  XSfuel = Cfuel.Xs;
+  Xwfuel = Cfuel.hum;
+  XCDfuel = Cfuel.Xashes;
+
+  LHVfuel = Cfuel.LHV;
+  Cpfuel = Cfuel.cp;
+
+  /* Water inlet */
+  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam");
+
+  Cws.diff_res_2 = 0;
+  Cws.diff_on_2 = diffusion;
+
+  ftype_ws = Cws.ftype;
+
+  Qews = Cws.Q;
+  Hews = Cws.h;
+
+  /* Air inlet */
+  Qea = Ca.Q;
+  Pea = Ca.P;
+  Hea = Ca.h;
+
+  XeaCO2 = Ca.Xco2;
+  XeaH2O = Ca.Xh2o;
+  XeaO2 = Ca.Xo2;
+  XeaSO2 = Ca.Xso2;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Hsf = Cfg.h;
+
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Mass balance equation */
+  0 = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF - Qsf;
+
+  Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV);
+  Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF);
+
+  /* Energy balance equation */
+  0 = ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone)
+      - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + J;
+
+  Hfuel = Cpfuel*(Tfuel - 273.16);
+  Hcv = Cpcd*(Tsf - 273.16);
+  Hbf = Cpcd*(Tbf - 273.16);
+
+  Cws.h_vol_2 = h;
+  Ca.h_vol_2 = h;
+  Cfg.h_vol_1 = h;
+
+  Cfg.ftype = ftype;
+
+  /* No flow reversal */
+  Cfg.h = Cfg.h_vol_1;
+
+  /* Diffusion power */
+  if diffusion then
+    ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0;
+    rws = if Cws.diff_on_1 then exp(-0.033*(Cws.Q*Cws.diff_res_1)^2) else 0;
+    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
+
+    gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0;
+    gamma_ws = if Cws.diff_on_1 then 1/Cws.diff_res_1 else gamma0;
+    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
+
+    Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0;
+    Jws = if Cws.diff_on_1 then rws*gamma_ws*(Cws.h_vol_1 - Cws.h_vol_2) else 0;
+    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
+  else
+    ra = 0;
+    rws = 0;
+    rfg = 0;
+
+    gamma_a = gamma0;
+    gamma_ws = gamma0;
+    gamma_fg = gamma0;
+
+    Ja = 0;
+    Jws = 0;
+    Jfg = 0;
+  end if;
+
+  J = Ja + Jws + Jfg;
+
+  Ca.diff_res_2 = 0;
+  Cfg.diff_res_1 = 0;
+
+  Ca.diff_on_2 = diffusion;
+  Cfg.diff_on_1 = diffusion;
+
+ /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrfuel = 0;
+  Hrws = 2501.569e3;
+  Hrfg = 2501.569e3*XsfH2O;
+  Hrcd = 0;
+
+  /* Air specific enthalpy at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+
+  /* Flue gases specific enthalpy at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Air density at the inlet */
+  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+  Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1;
+
+  /* Flue gases density at the outlet */
+  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+  Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1;
+
+  /* CO2 flue gases mass fraction */
+  XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC);
+
+  /* H2O flue gases mass fraction */
+  XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2 /amH);
+
+  /* O2 flue gases mass fraction */
+  XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
+
+  /* SO2 flue gases mass fraction */
+  XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
+
+  /* Fuel thermal power */
+  HHVfuel = LHVfuel + 224.3e5*XHfuel + 25.1e5*Xwfuel;
+  Wfuel = Qfuel*HHVfuel;
+  Wpth = Qfuel*LHVfuel*Xpth;
+
+  /* Combustion air ratio */
+  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO)
+        - Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O)));
+
+  /* Pressure losses */
+  Pea - Psf = deltaPccb;
+  Qm = Qea + (Qfuel + Qews)/2;
+  Vccbm = (Vea + Vsf)/2;
+  v = Qm*Vccbm/Acham;
+  deltaPccb = (kcham*(v^2))/(2*Vccbm);
+
+    annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44},
+              {38,-80},{-34,-80},{-50,-36}},
+          lineColor={0,0,0},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72},
+              {16,-80},{-16,-80},{-32,-36}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+                             Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44},
+              {38,-80},{-34,-80},{-50,-36}},
+          lineColor={0,0,0},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72},
+              {16,-80},{-16,-80},{-32,-36}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{82,-76},{108,-104}},
+          lineColor={28,108,200},
+          textString="Fuel inlet"),
+        Text(
+          extent={{-66,-78},{-42,-102}},
+          lineColor={28,108,200},
+          textString="Air inlet"),
+        Text(
+          extent={{-110,42},{-82,14}},
+          lineColor={28,108,200},
+          textString="Water inlet"),
+        Text(
+          extent={{-18,106},{30,70}},
+          lineColor={238,46,47},
+          textString="Flue gases outlet")}),
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end GenericCombustion;
diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo
index c644e4e865a0947a5f7a9b7fe4973f70c72fe7c4..62299a36ca3ef6fe67310f3de17a4d7bc56d1842 100644
--- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo
+++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo
@@ -1,446 +1,446 @@
-within ThermoSysPro.Fluid.Combustion.CombustionChambers;
-model GenericCombustion1D "Generic combustion chamber 1D"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Integer NCEL = 7;
-  parameter Units.SI.Area Acham=1 "Average cross-sectional area of the combustion chamber";
-  // parameter Modelica.SIunits.Area SM[NCEL] = {639.92,198.58,466.48,466.48,466.48,523.79,523.79}
-  parameter Units.SI.Area SM[NCEL]=fill(100, NCEL) "Heat exchange area for the node i = projetee )";
-  parameter Real RSURF[NCEL] = cat(1,{1.321},fill(1.409,NCEL - 1)) "Real surface/projected surface";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=0.01 "Pressure loss coefficient in the combustion chamber";
-  parameter Real Xpth=0.00 "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)";
-  parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)";
-  parameter Real ImbBF=0 "Unburnt particle ratio in the low furnace ashes (0-1)";
-  parameter Units.SI.SpecificHeatCapacity Cpcd=500 "Ashes specific heat capacity";
-  parameter Units.SI.Temperature Tbf=500 "Ashes temperature at the outlet of the low furnace";
-  parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)";
-  parameter Units.SI.CoefficientOfHeatTransfer Kec=50 "Convection and conduction(fouling) heat exchange coefficient";
-  parameter Real EPSPAR = 0.6 "Combustion chamber walls emissivity";
-  //parameter Real hrCorr=1.00 "Corrective term for ratiation heat exchange";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Real SIGMA = 5.669e-8 "Boltzman constant W/m^2/K^4";
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Units.SI.SpecificEnergy HHVcarbone=32.8e6 "Unburnt carbon higher heating value, CO2 = 3.2791664E+07";
-  constant Real RAD = 0.017453293 "pi/180";
-  constant Real amCO2 = amC + 2*amO "CO2 molecular mass";
-  constant Real amH2O = 2*amH + amO "H2O molecular mass";
-  constant Real amSO2 = amS + 2*amO "SO2 molecular mass";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-
-public
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
-  Units.SI.SpecificEnthalpy Hea(start=50e3) "Air specific enthalpy at the inlet";
-  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
-  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
-  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
-  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
-  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
-  Real XCfuel(start=0.8) "C mass fraction in the fuel /pur";
-  Real XHfuel(start=0.2) "H mass fraction in the fuel /pur";
-  Real XOfuel(start=0) "O mass fraction in the fuel /pur";
-  Real XSfuel(start=0) "S mass fraction in the fuel /pur";
-  Real Xwfuel(start=0) "H2O mass fraction in the fuel";
-  Real XCDfuel(start=0) "Ashes mass fraction in the fuel /Dryer";
-  Units.SI.SpecificEnergy LHVfuel_D(start=5e7) "Fuel lower heating value /Dryer";
-  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value /Brut";
-  Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity";
-  Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value";
-  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
-  Units.SI.SpecificEnthalpy Hews(start=10e3) "Water/steam specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
-  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
-  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
-  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
-  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
-  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
-  //////////////////////Modelica.SIunits.Power Wfuel(start=5e8) "LHV power available in the fuel";
-  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
-  Real exc(start=1) "Combustion air ratio";
-  Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate";
-  Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate";
-  Units.SI.SpecificEnthalpy Hcv(start=10e3) "Volatile ashes specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hbf(start=10e3) "Low furnace ashes specific enthalpy at the outlet";
-  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3) "Pressure loss in the combustion chamber";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrws(start=10e4) "Water/steam reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfuel(start=10e3) "Fuel reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrcd(start=10e3) "Ashes reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrfg(start=10e3) "Flue gases reference specific enthalpy";
-  Real Vea(start=0.001) "Air volume mass (m3/kg)";
-  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
-  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
-  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
-  Units.SI.MassFlowRate Qm(start=400) "Average mlass flow rate in the combusiton chamber";
-  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
-  Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber";
-  Units.SI.Temperature Tpi[NCEL](start=fill(400, NCEL)) "Wall temperature for node i";
-  Units.SI.Power Ws[NCEL](start=fill(10e6, NCEL)) "Power delivered to each segment";
-  Units.SI.Power Wst(start=50.e6) "Total power exchanged on all segment";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  FluidType fluids[3] "Fluids mixing in volume";
-  Units.SI.Power Ja "Thermal power diffusion from inlet Ca";
-  Units.SI.Power Jws "Thermal power diffusion from inlet Cws";
-  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_a "Diffusion conductance for inlet Ca";
-  Units.SI.MassFlowRate gamma_ws "Diffusion conductance for inlet Cws";
-  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
-  Real ra "Value of r(Q/gamma) for inlet Ca";
-  Real rws "Value of r(Q/gamma) for inlet Cws";
-  Real rfg "Value of r(Q/gamma) for outlet Cfg";
-  FluidType ftype_ws "Water/steam fluid type";
-  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet"
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
-    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet"
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
-            0)));
-  Thermal.Connectors.ThermalPort Cth[NCEL] "Thermal W T"
-    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ca.ftype;
-  fluids[3] = Cfg.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "GenericCombustion1D: fluids mixing in volume are not compatible with each other");
-
-  /* Heat transfer */
-  Cth.W = -Ws;
-  Cth.T = Tpi;
-
-  /* Fuel inlet */
-  Qfuel = Cfuel.Q;
-  Tfuel = Cfuel.T;
-  XCfuel = Cfuel.Xc;
-  XHfuel = Cfuel.Xh;
-  XOfuel = Cfuel.Xo;
-  XSfuel = Cfuel.Xs;
-  Xwfuel = Cfuel.hum;
-  XCDfuel = Cfuel.Xashes;
-  LHVfuel_D = Cfuel.LHV;
-  Cpfuel = Cfuel.cp;
-
-  /* Water inlet */
-  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam");
-
-  Cws.diff_res_2 = 0;
-  Cws.diff_on_2 = diffusion;
-
-  ftype_ws = Cws.ftype;
-
-  Qews = Cws.Q;
-  Hews = Cws.h;
-
-  /* Air inlet */
-  Qea = Ca.Q;
-  Pea = Ca.P;
-  Hea = Ca.h;
-
-  XeaCO2 = Ca.Xco2;
-  XeaH2O = Ca.Xh2o;
-  XeaO2 = Ca.Xo2;
-  XeaSO2 = Ca.Xso2;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Hsf = Cfg.h;
-
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Mass balance equation */
-  0 = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF - Qsf;
-
-  Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV);
-  Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF);
-
-  /* Energy balance equation */
-  0 = ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone)
-      - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + Wst + J;
-
-  Hfuel = Cpfuel*(Tfuel-273.16);
-  Hcv = Cpcd*(Tsf-273.16);
-  Hbf = Cpcd*(Tbf-273.16);
-
-  Cws.h_vol_2 = h;
-  Ca.h_vol_2 = h;
-  Cfg.h_vol_1 = h;
-
-  Cfg.ftype = ftype;
-
-  /* No flow reversal */
-  Cfg.h = Cfg.h_vol_1;
-
-  /* Diffusion power */
-  if diffusion then
-    ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0;
-    rws = if Cws.diff_on_1 then exp(-0.033*(Cws.Q*Cws.diff_res_1)^2) else 0;
-    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
-
-    gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0;
-    gamma_ws = if Cws.diff_on_1 then 1/Cws.diff_res_1 else gamma0;
-    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
-
-    Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0;
-    Jws = if Cws.diff_on_1 then rws*gamma_ws*(Cws.h_vol_1 - Cws.h_vol_2) else 0;
-    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
-  else
-    ra = 0;
-    rws = 0;
-    rfg = 0;
-
-    gamma_a = gamma0;
-    gamma_ws = gamma0;
-    gamma_fg = gamma0;
-
-    Ja = 0;
-    Jws = 0;
-    Jfg = 0;
-  end if;
-
-  J = Ja + Jws + Jfg;
-
-  Ca.diff_res_2 = 0;
-  Cfg.diff_res_1 = 0;
-
-  Ca.diff_on_2 = diffusion;
-  Cfg.diff_on_1 = diffusion;
-
- /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrfuel = 0;
-  Hrws = 2501.569e3;
-  Hrfg = 2501.569e3*XsfH2O;
-  Hrcd = 0;
-
-  /* Air specific enthalpy at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-
-  /* Flue gases specific enthalpy at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Air density at the inlet */
-  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-  Vea = if (rhoea >0.001) then 1/rhoea else 1/1.1;
-
-  /* Flue gases density at the outlet */
-  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-  Vsf = if (rhosf >0.001) then 1/rhosf else 1/0.1;
-
-  /* CO2 flue gases mass fraction */
-  XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC);
-
-  /* H2O flue gases mass fraction */
-  //XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH);
-  XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH)+Xwfuel*Qfuel;
-
-  /* O2 flue gases mass fraction */
-  XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
-
-  /* SO2 flue gases mass fraction */
-  XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
-
-  /* LHV conversion from dryer to crude*/
-  LHVfuel = -2510000.0*Xwfuel + LHVfuel_D*(1-Xwfuel);
-
-  /* Fuel higher heating value */
-  HHVfuel = LHVfuel_D + 224.3e5*XHfuel + 25.1e5*Xwfuel;
-
-  /* Thermal losses power */
-  Wpth = Qfuel*LHVfuel*Xpth;
-
-  /* Combustion air ratio */
-  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO)
-        - Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O)));
-//  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O)));
-
-  /* Pressure losses */
-  Pea - Psf = deltaPccb;
-  Qm = (Qea + Qfuel + Qews)/2;
-  Vccbm = (Vea + Vsf)/2;
-  v = Qm*Vccbm/Acham;
-  deltaPccb = (kcham*(v^2))/(2*Vccbm);
-
-  /* Power delivered to each segment*/
-  for i in 1:NCEL loop
-    Ws[i] = SIGMA*EPSPAR*RSURF[i]*SM[i]*(Tsf^4 - Tpi[i]^4) +  Kec*RSURF[i]*SM[i]*(Tsf - Tpi[i]);
-  end for;
-
-  Wst = sum(Ws);
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-56,45},{-54,53},{-50,57},{-44,59},{-36,61},{-26,61},{-16,59},
-              {-8,55},{0,51},{2,48},{0,46},{-2,45},{-6,43},{-6,42},{-4,42},{4,
-              44},{10,44},{16,43},{28,41},{44,37},{28,29},{16,25},{2,21},{-8,19},
-              {-16,17},{-28,17},{-42,19},{-50,21},{-56,27},{-56,33},{-52,37},{
-              -56,45}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-56,45},{-54,51},{-48,55},{-40,57},{-32,57},{-22,55},{-14,51},
-              {-10,47},{-14,43},{-18,41},{-22,39},{-22,37},{-18,35},{-12,36},{
-              -8,36},{-2,37},{2,37},{10,37},{22,35},{-4,25},{-18,21},{-26,19},{
-              -36,19},{-42,21},{-50,23},{-54,27},{-56,33},{-54,39},{-56,45}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,213,170}),
-        Polygon(
-          points={{-51,39},{-53,45},{-49,49},{-45,51},{-41,51},{-36,47},{-33,43},
-              {-33,39},{-34,35},{-37,31},{-39,29},{-43,27},{-47,27},{-51,29},{
-              -53,31},{-53,33},{-51,39}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,170}),
-        Polygon(
-          points={{-56,-30},{-54,-22},{-50,-18},{-44,-16},{-36,-14},{-26,-14},{
-              -16,-16},{-8,-20},{-2,-24},{0,-26},{0,-28},{0,-28},{-2,-30},{-6,
-              -32},{-4,-32},{4,-30},{10,-30},{20,-32},{28,-34},{44,-38},{28,-46},
-              {16,-50},{2,-54},{-8,-56},{-16,-58},{-28,-58},{-42,-56},{-50,-54},
-              {-56,-48},{-56,-42},{-52,-38},{-56,-30}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-56,-30},{-54,-24},{-48,-20},{-40,-18},{-32,-18},{-22,-20},{
-              -14,-24},{-10,-28},{-14,-32},{-18,-34},{-22,-36},{-22,-38},{-18,
-              -40},{-12,-40},{-8,-40},{-2,-38},{2,-38},{10,-38},{22,-40},{-4,
-              -50},{-18,-54},{-26,-56},{-36,-56},{-42,-54},{-50,-52},{-54,-48},
-              {-56,-42},{-54,-36},{-56,-30}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,213,170}),
-        Polygon(
-          points={{-51,-36},{-53,-30},{-49,-26},{-45,-24},{-41,-24},{-36,-28},{
-              -33,-32},{-33,-36},{-34,-40},{-37,-44},{-39,-46},{-43,-48},{-47,
-              -48},{-51,-46},{-53,-44},{-53,-42},{-51,-36}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,170})}),    Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor=DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-54,45},{-52,53},{-48,57},{-42,59},{-34,61},{-24,61},{-14,59},
-              {-6,55},{2,51},{4,48},{2,46},{0,45},{-4,43},{-4,42},{-2,42},{6,44},
-              {12,44},{18,43},{30,41},{46,37},{30,29},{18,25},{4,21},{-6,19},{
-              -14,17},{-26,17},{-40,19},{-48,21},{-54,27},{-54,33},{-50,37},{
-              -54,45}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-54,45},{-52,51},{-46,55},{-38,57},{-30,57},{-20,55},{-12,51},
-              {-8,47},{-12,43},{-16,41},{-20,39},{-20,37},{-16,35},{-10,36},{-6,
-              36},{0,37},{4,37},{12,37},{24,35},{-2,25},{-16,21},{-24,19},{-34,
-              19},{-40,21},{-48,23},{-52,27},{-54,33},{-52,39},{-54,45}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,213,170}),
-        Polygon(
-          points={{-49,39},{-51,45},{-47,49},{-43,51},{-39,51},{-34,47},{-31,43},
-              {-31,39},{-32,35},{-35,31},{-37,29},{-41,27},{-45,27},{-49,29},{
-              -51,31},{-51,33},{-49,39}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,170}),
-        Polygon(
-          points={{-54,-30},{-52,-22},{-48,-18},{-42,-16},{-34,-14},{-24,-14},{
-              -14,-16},{-6,-20},{0,-24},{2,-26},{2,-28},{2,-28},{0,-30},{-4,-32},
-              {-2,-32},{6,-30},{12,-30},{22,-32},{30,-34},{46,-38},{30,-46},{18,
-              -50},{4,-54},{-6,-56},{-14,-58},{-26,-58},{-40,-56},{-48,-54},{
-              -54,-48},{-54,-42},{-50,-38},{-54,-30}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-54,-30},{-52,-24},{-46,-20},{-38,-18},{-30,-18},{-20,-20},{
-              -12,-24},{-8,-28},{-12,-32},{-16,-34},{-20,-36},{-20,-38},{-16,
-              -40},{-10,-40},{-6,-40},{0,-38},{4,-38},{12,-38},{24,-40},{-2,-50},
-              {-16,-54},{-24,-56},{-34,-56},{-40,-54},{-48,-52},{-52,-48},{-54,
-              -42},{-52,-36},{-54,-30}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,213,170}),
-        Polygon(
-          points={{-49,-36},{-51,-30},{-47,-26},{-43,-24},{-39,-24},{-34,-28},{
-              -31,-32},{-31,-36},{-32,-40},{-35,-44},{-37,-46},{-41,-48},{-45,
-              -48},{-49,-46},{-51,-44},{-51,-42},{-49,-36}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,170}),
-        Text(
-          extent={{-114,46},{-82,18}},
-          lineColor={28,108,200},
-          textString="Water inlet"),
-        Text(
-          extent={{14,104},{62,68}},
-          lineColor={238,46,47},
-          textString="Flue gases outlet"),
-        Text(
-          extent={{-108,-54},{-82,-82}},
-          lineColor={28,108,200},
-          textString="Fuel inlet"),
-        Text(
-          extent={{-40,-80},{-14,-104}},
-          lineColor={28,108,200},
-          textString="Air inlet")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 8.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end GenericCombustion1D;
+within ThermoSysPro.Fluid.Combustion.CombustionChambers;
+model GenericCombustion1D "Generic combustion chamber 1D"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Integer NCEL = 7;
+  parameter Units.SI.Area Acham=1 "Average cross-sectional area of the combustion chamber";
+  // parameter Modelica.SIunits.Area SM[NCEL] = {639.92,198.58,466.48,466.48,466.48,523.79,523.79}
+  parameter Units.SI.Area SM[NCEL]=fill(100, NCEL) "Heat exchange area for the node i = projetee )";
+  parameter Real RSURF[NCEL] = cat(1,{1.321},fill(1.409,NCEL - 1)) "Real surface/projected surface";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=0.01 "Pressure loss coefficient in the combustion chamber";
+  parameter Real Xpth=0.00 "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)";
+  parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)";
+  parameter Real ImbBF=0 "Unburnt particle ratio in the low furnace ashes (0-1)";
+  parameter Units.SI.SpecificHeatCapacity Cpcd=500 "Ashes specific heat capacity";
+  parameter Units.SI.Temperature Tbf=500 "Ashes temperature at the outlet of the low furnace";
+  parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)";
+  parameter Units.SI.CoefficientOfHeatTransfer Kec=50 "Convection and conduction(fouling) heat exchange coefficient";
+  parameter Real EPSPAR = 0.6 "Combustion chamber walls emissivity";
+  //parameter Real hrCorr=1.00 "Corrective term for ratiation heat exchange";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Real SIGMA = 5.669e-8 "Boltzman constant W/m^2/K^4";
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Units.SI.SpecificEnergy HHVcarbone=32.8e6 "Unburnt carbon higher heating value, CO2 = 3.2791664E+07";
+  constant Real RAD = 0.017453293 "pi/180";
+  constant Real amCO2 = amC + 2*amO "CO2 molecular mass";
+  constant Real amH2O = 2*amH + amO "H2O molecular mass";
+  constant Real amSO2 = amS + 2*amO "SO2 molecular mass";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+
+public
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
+  Units.SI.SpecificEnthalpy Hea(start=50e3) "Air specific enthalpy at the inlet";
+  Real XeaCO2(start=0) "CO2 mass fraction at the air inlet";
+  Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
+  Real XeaSO2(start=0) "SO2 mass fraction at the air inlet";
+  Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tfuel(start=300) "Fuel temperature";
+  Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy";
+  Real XCfuel(start=0.8) "C mass fraction in the fuel /pur";
+  Real XHfuel(start=0.2) "H mass fraction in the fuel /pur";
+  Real XOfuel(start=0) "O mass fraction in the fuel /pur";
+  Real XSfuel(start=0) "S mass fraction in the fuel /pur";
+  Real Xwfuel(start=0) "H2O mass fraction in the fuel";
+  Real XCDfuel(start=0) "Ashes mass fraction in the fuel /Dryer";
+  Units.SI.SpecificEnergy LHVfuel_D(start=5e7) "Fuel lower heating value /Dryer";
+  Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value /Brut";
+  Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity";
+  Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value";
+  Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate";
+  Units.SI.SpecificEnthalpy Hews(start=10e3) "Water/steam specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate";
+  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
+  Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases";
+  Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases";
+  Real XsfO2(start=0) "O2 mass fraction in the flue gases";
+  Real XsfSO2(start=0) "SO2 mass fraction in the flue gases";
+  //////////////////////Modelica.SIunits.Power Wfuel(start=5e8) "LHV power available in the fuel";
+  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
+  Real exc(start=1) "Combustion air ratio";
+  Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate";
+  Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate";
+  Units.SI.SpecificEnthalpy Hcv(start=10e3) "Volatile ashes specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hbf(start=10e3) "Low furnace ashes specific enthalpy at the outlet";
+  ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3) "Pressure loss in the combustion chamber";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrws(start=10e4) "Water/steam reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfuel(start=10e3) "Fuel reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrcd(start=10e3) "Ashes reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrfg(start=10e3) "Flue gases reference specific enthalpy";
+  Real Vea(start=0.001) "Air volume mass (m3/kg)";
+  Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)";
+  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
+  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
+  Units.SI.MassFlowRate Qm(start=400) "Average mlass flow rate in the combusiton chamber";
+  Real Vccbm(start=0.001) "Average volume mass in the combustion chamber";
+  Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber";
+  Units.SI.Temperature Tpi[NCEL](start=fill(400, NCEL)) "Wall temperature for node i";
+  Units.SI.Power Ws[NCEL](start=fill(10e6, NCEL)) "Power delivered to each segment";
+  Units.SI.Power Wst(start=50.e6) "Total power exchanged on all segment";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  FluidType fluids[3] "Fluids mixing in volume";
+  Units.SI.Power Ja "Thermal power diffusion from inlet Ca";
+  Units.SI.Power Jws "Thermal power diffusion from inlet Cws";
+  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_a "Diffusion conductance for inlet Ca";
+  Units.SI.MassFlowRate gamma_ws "Diffusion conductance for inlet Cws";
+  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
+  Real ra "Value of r(Q/gamma) for inlet Ca";
+  Real rws "Value of r(Q/gamma) for inlet Cws";
+  Real rfg "Value of r(Q/gamma) for outlet Cfg";
+  FluidType ftype_ws "Water/steam fluid type";
+  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet"
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
+    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet"
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
+            0)));
+  Thermal.Connectors.ThermalPort Cth[NCEL] "Thermal W T"
+    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ca.ftype;
+  fluids[3] = Cfg.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "GenericCombustion1D: fluids mixing in volume are not compatible with each other");
+
+  /* Heat transfer */
+  Cth.W = -Ws;
+  Cth.T = Tpi;
+
+  /* Fuel inlet */
+  Qfuel = Cfuel.Q;
+  Tfuel = Cfuel.T;
+  XCfuel = Cfuel.Xc;
+  XHfuel = Cfuel.Xh;
+  XOfuel = Cfuel.Xo;
+  XSfuel = Cfuel.Xs;
+  Xwfuel = Cfuel.hum;
+  XCDfuel = Cfuel.Xashes;
+  LHVfuel_D = Cfuel.LHV;
+  Cpfuel = Cfuel.cp;
+
+  /* Water inlet */
+  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam");
+
+  Cws.diff_res_2 = 0;
+  Cws.diff_on_2 = diffusion;
+
+  ftype_ws = Cws.ftype;
+
+  Qews = Cws.Q;
+  Hews = Cws.h;
+
+  /* Air inlet */
+  Qea = Ca.Q;
+  Pea = Ca.P;
+  Hea = Ca.h;
+
+  XeaCO2 = Ca.Xco2;
+  XeaH2O = Ca.Xh2o;
+  XeaO2 = Ca.Xo2;
+  XeaSO2 = Ca.Xso2;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Hsf = Cfg.h;
+
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Mass balance equation */
+  0 = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF - Qsf;
+
+  Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV);
+  Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF);
+
+  /* Energy balance equation */
+  0 = ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone)
+      - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + Wst + J;
+
+  Hfuel = Cpfuel*(Tfuel-273.16);
+  Hcv = Cpcd*(Tsf-273.16);
+  Hbf = Cpcd*(Tbf-273.16);
+
+  Cws.h_vol_2 = h;
+  Ca.h_vol_2 = h;
+  Cfg.h_vol_1 = h;
+
+  Cfg.ftype = ftype;
+
+  /* No flow reversal */
+  Cfg.h = Cfg.h_vol_1;
+
+  /* Diffusion power */
+  if diffusion then
+    ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0;
+    rws = if Cws.diff_on_1 then exp(-0.033*(Cws.Q*Cws.diff_res_1)^2) else 0;
+    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
+
+    gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0;
+    gamma_ws = if Cws.diff_on_1 then 1/Cws.diff_res_1 else gamma0;
+    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
+
+    Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0;
+    Jws = if Cws.diff_on_1 then rws*gamma_ws*(Cws.h_vol_1 - Cws.h_vol_2) else 0;
+    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
+  else
+    ra = 0;
+    rws = 0;
+    rfg = 0;
+
+    gamma_a = gamma0;
+    gamma_ws = gamma0;
+    gamma_fg = gamma0;
+
+    Ja = 0;
+    Jws = 0;
+    Jfg = 0;
+  end if;
+
+  J = Ja + Jws + Jfg;
+
+  Ca.diff_res_2 = 0;
+  Cfg.diff_res_1 = 0;
+
+  Ca.diff_on_2 = diffusion;
+  Cfg.diff_on_1 = diffusion;
+
+ /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrfuel = 0;
+  Hrws = 2501.569e3;
+  Hrfg = 2501.569e3*XsfH2O;
+  Hrcd = 0;
+
+  /* Air specific enthalpy at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+
+  /* Flue gases specific enthalpy at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Air density at the inlet */
+  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+  Vea = if (rhoea >0.001) then 1/rhoea else 1/1.1;
+
+  /* Flue gases density at the outlet */
+  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+  Vsf = if (rhosf >0.001) then 1/rhosf else 1/0.1;
+
+  /* CO2 flue gases mass fraction */
+  XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC);
+
+  /* H2O flue gases mass fraction */
+  //XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH);
+  XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH)+Xwfuel*Qfuel;
+
+  /* O2 flue gases mass fraction */
+  XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel);
+
+  /* SO2 flue gases mass fraction */
+  XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS);
+
+  /* LHV conversion from dryer to crude*/
+  LHVfuel = -2510000.0*Xwfuel + LHVfuel_D*(1-Xwfuel);
+
+  /* Fuel higher heating value */
+  HHVfuel = LHVfuel_D + 224.3e5*XHfuel + 25.1e5*Xwfuel;
+
+  /* Thermal losses power */
+  Wpth = Qfuel*LHVfuel*Xpth;
+
+  /* Combustion air ratio */
+  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO)
+        - Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O)));
+//  exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O)));
+
+  /* Pressure losses */
+  Pea - Psf = deltaPccb;
+  Qm = (Qea + Qfuel + Qews)/2;
+  Vccbm = (Vea + Vsf)/2;
+  v = Qm*Vccbm/Acham;
+  deltaPccb = (kcham*(v^2))/(2*Vccbm);
+
+  /* Power delivered to each segment*/
+  for i in 1:NCEL loop
+    Ws[i] = SIGMA*EPSPAR*RSURF[i]*SM[i]*(Tsf^4 - Tpi[i]^4) +  Kec*RSURF[i]*SM[i]*(Tsf - Tpi[i]);
+  end for;
+
+  Wst = sum(Ws);
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-56,45},{-54,53},{-50,57},{-44,59},{-36,61},{-26,61},{-16,59},
+              {-8,55},{0,51},{2,48},{0,46},{-2,45},{-6,43},{-6,42},{-4,42},{4,
+              44},{10,44},{16,43},{28,41},{44,37},{28,29},{16,25},{2,21},{-8,19},
+              {-16,17},{-28,17},{-42,19},{-50,21},{-56,27},{-56,33},{-52,37},{
+              -56,45}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-56,45},{-54,51},{-48,55},{-40,57},{-32,57},{-22,55},{-14,51},
+              {-10,47},{-14,43},{-18,41},{-22,39},{-22,37},{-18,35},{-12,36},{
+              -8,36},{-2,37},{2,37},{10,37},{22,35},{-4,25},{-18,21},{-26,19},{
+              -36,19},{-42,21},{-50,23},{-54,27},{-56,33},{-54,39},{-56,45}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,213,170}),
+        Polygon(
+          points={{-51,39},{-53,45},{-49,49},{-45,51},{-41,51},{-36,47},{-33,43},
+              {-33,39},{-34,35},{-37,31},{-39,29},{-43,27},{-47,27},{-51,29},{
+              -53,31},{-53,33},{-51,39}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,170}),
+        Polygon(
+          points={{-56,-30},{-54,-22},{-50,-18},{-44,-16},{-36,-14},{-26,-14},{
+              -16,-16},{-8,-20},{-2,-24},{0,-26},{0,-28},{0,-28},{-2,-30},{-6,
+              -32},{-4,-32},{4,-30},{10,-30},{20,-32},{28,-34},{44,-38},{28,-46},
+              {16,-50},{2,-54},{-8,-56},{-16,-58},{-28,-58},{-42,-56},{-50,-54},
+              {-56,-48},{-56,-42},{-52,-38},{-56,-30}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-56,-30},{-54,-24},{-48,-20},{-40,-18},{-32,-18},{-22,-20},{
+              -14,-24},{-10,-28},{-14,-32},{-18,-34},{-22,-36},{-22,-38},{-18,
+              -40},{-12,-40},{-8,-40},{-2,-38},{2,-38},{10,-38},{22,-40},{-4,
+              -50},{-18,-54},{-26,-56},{-36,-56},{-42,-54},{-50,-52},{-54,-48},
+              {-56,-42},{-54,-36},{-56,-30}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,213,170}),
+        Polygon(
+          points={{-51,-36},{-53,-30},{-49,-26},{-45,-24},{-41,-24},{-36,-28},{
+              -33,-32},{-33,-36},{-34,-40},{-37,-44},{-39,-46},{-43,-48},{-47,
+              -48},{-51,-46},{-53,-44},{-53,-42},{-51,-36}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,170})}),    Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor=DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-54,45},{-52,53},{-48,57},{-42,59},{-34,61},{-24,61},{-14,59},
+              {-6,55},{2,51},{4,48},{2,46},{0,45},{-4,43},{-4,42},{-2,42},{6,44},
+              {12,44},{18,43},{30,41},{46,37},{30,29},{18,25},{4,21},{-6,19},{
+              -14,17},{-26,17},{-40,19},{-48,21},{-54,27},{-54,33},{-50,37},{
+              -54,45}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-54,45},{-52,51},{-46,55},{-38,57},{-30,57},{-20,55},{-12,51},
+              {-8,47},{-12,43},{-16,41},{-20,39},{-20,37},{-16,35},{-10,36},{-6,
+              36},{0,37},{4,37},{12,37},{24,35},{-2,25},{-16,21},{-24,19},{-34,
+              19},{-40,21},{-48,23},{-52,27},{-54,33},{-52,39},{-54,45}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,213,170}),
+        Polygon(
+          points={{-49,39},{-51,45},{-47,49},{-43,51},{-39,51},{-34,47},{-31,43},
+              {-31,39},{-32,35},{-35,31},{-37,29},{-41,27},{-45,27},{-49,29},{
+              -51,31},{-51,33},{-49,39}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,170}),
+        Polygon(
+          points={{-54,-30},{-52,-22},{-48,-18},{-42,-16},{-34,-14},{-24,-14},{
+              -14,-16},{-6,-20},{0,-24},{2,-26},{2,-28},{2,-28},{0,-30},{-4,-32},
+              {-2,-32},{6,-30},{12,-30},{22,-32},{30,-34},{46,-38},{30,-46},{18,
+              -50},{4,-54},{-6,-56},{-14,-58},{-26,-58},{-40,-56},{-48,-54},{
+              -54,-48},{-54,-42},{-50,-38},{-54,-30}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-54,-30},{-52,-24},{-46,-20},{-38,-18},{-30,-18},{-20,-20},{
+              -12,-24},{-8,-28},{-12,-32},{-16,-34},{-20,-36},{-20,-38},{-16,
+              -40},{-10,-40},{-6,-40},{0,-38},{4,-38},{12,-38},{24,-40},{-2,-50},
+              {-16,-54},{-24,-56},{-34,-56},{-40,-54},{-48,-52},{-52,-48},{-54,
+              -42},{-52,-36},{-54,-30}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,213,170}),
+        Polygon(
+          points={{-49,-36},{-51,-30},{-47,-26},{-43,-24},{-39,-24},{-34,-28},{
+              -31,-32},{-31,-36},{-32,-40},{-35,-44},{-37,-46},{-41,-48},{-45,
+              -48},{-49,-46},{-51,-44},{-51,-42},{-49,-36}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,170}),
+        Text(
+          extent={{-114,46},{-82,18}},
+          lineColor={28,108,200},
+          textString="Water inlet"),
+        Text(
+          extent={{14,104},{62,68}},
+          lineColor={238,46,47},
+          textString="Flue gases outlet"),
+        Text(
+          extent={{-108,-54},{-82,-82}},
+          lineColor={28,108,200},
+          textString="Fuel inlet"),
+        Text(
+          extent={{-40,-80},{-14,-104}},
+          lineColor={28,108,200},
+          textString="Air inlet")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 8.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end GenericCombustion1D;
diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo
index 694412753f650022687ec254d996be5c2bb8f5c8..1997673d0942f902bb5204da2bb4f933ea4cc1cd 100644
--- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo
+++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo
@@ -1,828 +1,828 @@
-within ThermoSysPro.Fluid.Combustion.CombustionChambers;
-model GridFurnace "Combustion furnace"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real X2eap=0.1 "Primary air fraction in zone 2";
-  parameter Real X3eap=0.1 "Primary air fraction in zone 3";
-  parameter Real XCleom=0 "Cl mass fraction in the biomass";
-  parameter Real XFeom=0 "F mass fraction in the biomass";
-  parameter Real XMACHeom=0 "machefers mass fraction in the biomass";
-  parameter Units.SI.Density rhoCENDom=0.5 "Density of the ashes in the biomass";
-  parameter Units.SI.Temperature Tfrecirc=600 "Temperature of the recirculated flue gases";
-  parameter Real XfCO2recirc=0.3 "CO2 mass fraction in the recirculated flue gases";
-  parameter Real XfH2Orecirc=0.1 "H2O mass fraction in the recirculated flue gases";
-  parameter Real XfO2recirc=0.2 "O2 mass fraction in the recirculated flue gases";
-  parameter Real XfSO2recirc=0 "SO2 mass fraction in the recirculated flue gases";
-  parameter Real Xrecirc=0.1 "Recirculated flue gases fraction in Qsf";
-  parameter Units.SI.SpecificHeatCapacity CpMACH=500 "Clinker average specific heat capacity";
-  parameter Units.SI.SpecificHeatCapacity CpMACHs2=500 "Clinker specific heat capacity at the outlet of zone 2";
-  parameter Units.SI.SpecificHeatCapacity CpMACHs3=500 "Clinker specific heat capacity at the outlet of zone 3";
-  parameter Units.SI.SpecificHeatCapacity CpMACHs4=500 "Clinker specific heat capacity at the outlet of zone 4";
-  parameter Units.SI.Temperature TsjeMACH=293 "Clinker temperature at the outlet of the water seal";
-  parameter Units.SI.Temperature Teeje=293 "Water temperature at the outlet of the water seal";
-  parameter Real XsjeH2OMACH=0.2 "Clinker humidity at the outlet of the water seal";
-  parameter Real rendje=1 "Water seal efficiency";
-  parameter Integer jointeau=0 "1: with water seal - 0: without water seal";
-  parameter Real XCvol=0 "Volatile carbon fraction";
-  parameter Real XCimb=0 "Unburnt carbon fraction";
-  parameter Units.SI.Temperature T1sfm=500 "Flue gases temperature at the outlet of zone 1";
-  parameter Real Eray2=0.1 "Energy fraction radiated towards zone 2 of the furnace";
-  parameter Real Eray5=0.1 "Energy fraction radiated towards zone 5 of the furnac";
-  parameter Real perte=0 "Loss percent of LHV";
-  parameter Units.SI.SpecificHeatCapacity Cp3CO=500 "CO specific heat capacity in zone 3";
-
-protected
-  constant Units.SI.SpecificEnthalpy H0v=2501551.43 "Vaporisation energy at 0°C";
-  constant Units.SI.SpecificEnthalpy HfCO2=3.2791664e7 "CO2 formation enthalpy";
-  constant Units.SI.SpecificEnthalpy HfCO=9.201e6 "CO formation enthalpy";
-  constant Units.SI.SpecificEnthalpy HfH2Og=13.433333e6 "H2Og formation enthalpy";
-  constant Units.SI.SpecificEnthalpy HfSO2=4.6302650e6 "SO2 formation enthalpy";
-  constant Units.SI.SpecificEnthalpy HfH2Ol=15.883300e6 "H2Ol formation enthalpy";
-  constant Units.SI.SpecificHeatCapacity Cp3g=1100 "Average flue gases specific heat capacity at T3g";
-  parameter Integer mode=0 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-
-public
-  Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet";
-  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1000) "Flue gases temperature at the outlet";
-  Real XsfN2(start=0.6) "Flue gases N2 mass fraction at the outlet";
-  Real XsfCO2(start=0.1) "Flue gases CO2 mass fraction at the outlet";
-  Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet";
-  Real XsfO2(start=0.1) "Flue gases O2 mass fraction at the outlet";
-  Real XsfSO2(start=0.1) "Flue gases SO2 mass fraction at the outlet";
-  Units.SI.MassFlowRate Qeap(start=10) "Primary air mass flow rate";
-  Units.SI.AbsolutePressure Peap(start=1e5) "Primary air pressure";
-  Units.SI.Temperature Teap(start=300) "Primary air temperature";
-  Real XeapN2(start=0.6) "Primary air N2 mass fraction";
-  Real XeapCO2(start=0.1) "Primary air CO2 mass fraction";
-  Real XeapH2O(start=0.1) "Primary air H2O mass fraction";
-  Real XeapO2(start=0.1) "Primary air O2 mass fraction";
-  Real XeapSO2(start=0.1) "Primary air SO2 mass fraction";
-  Units.SI.MassFlowRate Qeas(start=10) "Secondary air mass flow rate";
-  Units.SI.AbsolutePressure Peas(start=1e5) "Secondary air pressure";
-  Units.SI.Temperature Teas(start=300) "Secondary air temperature";
-  Real XeasN2(start=0.6) "Secondary air N2 mass fraction";
-  Real XeasCO2(start=0.1) "Secondary air CO2 mass fraction";
-  Real XeasH2O(start=0.1) "Secondary air H2O mass fraction";
-  Real XeasO2(start=0.1) "Secondaryr O2 mass fraction";
-  Real XeasSO2(start=0.1) "Secondary SO2 mass fraction";
-  Units.SI.MassFlowRate Qeom(start=10) "Biomass mass flow rate";
-  Units.SI.Temperature Teom(start=300) "Biomass temperature";
-  Real PCIom(start=1e6) "Biomass LHV (J/kg)";
-  Real XCeom(start=0.1) "Biomass C mass fraction";
-  Real XHeom(start=0.1) "Biomass H mass fraction";
-  Real XOeom(start=0.1) "Biomass O mass fraction";
-  Real XNeom(start=0.01) "Biomass N mass fraction";
-  Real XSeom(start=0.1) "Biomass S mass fraction";
-  Real XCENDeom(start=0.1) "Biomass ashes mass fraction";
-  Real XH2Oeom(start=0.1) "Biomass humidity";
-  Units.SI.SpecificHeatCapacity Cpom(start=1000) "Biomass specific heat capacity";
-  Units.SI.MassFlowRate Qerefo(start=10) "Cooling water mass flow rate";
-  Units.SI.SpecificEnthalpy Herefo(start=10e3) "Cooling water specific enthalpy";
-  Units.SI.MassFlowRate Qfrecirc(start=10) "Recirculated flue gases mass flow rate";
-  Real XsfN2recirc(start=0.1) "Recirculated flue gases N2 mass fraction";
-  Real PCIMACH(start=10e6) "Clinker LHV";
-  Units.SI.MassFlowRate QsMACH(start=10) "Clinker mass flow rate";
-  Units.SI.Temperature TsMACH(start=500) "Clinket temperature";
-  Real FVN(start=0.1) "Volatile ashes mass fraction";
-  Units.SI.Density rhocend(start=500) "Ashes density in the flue gases";
-  Units.SI.Power Wsr(start=10e6) "Radiated power";
-  Real excair(start=0.1) "Combustion excess air";
-  Real X1eap(start=0.1) "Primary air fraction in zone 1";
-  Units.SI.MassFlowRate Q1eap(start=10) "Primary mass flow rate in zone 1";
-  Units.SI.MassFlowRate Q2eap(start=10) "Primary mass flow rate in zone 2";
-  Units.SI.MassFlowRate Q3eap(start=10) "Primary mass flow rate in zone 3";
-  Real XCvol2(start=0.1) "C mass fraction burnt in zone 2";
-  Real XMACHimb(start=0.1) "C mass raction unburnt in the clinker";
-  Real XCvol3(start=0.1) "C mass fraction burnt in zone 3";
-
-//Zone1
-  Units.SI.SpecificEnthalpy Heap(start=1e3) "Humid air specific enthalpy at the primary air temperature";
-  Units.SI.SpecificEnthalpy Heas(start=1e3) "Humid air specific enthalpy at the secondary air temperature";
-  Units.SI.SpecificEnthalpy H1a(start=1e3) "Primary air specific enthalpy at T1sfm";
-  Units.SI.SpecificEnthalpy Hefrecirc(start=1e3) "Specific enthalpy of the incoming recirculated flue gases";
-  Units.SI.MassFlowRate Qeasm(start=10) "Mass flow rate of the secondary air / recirculated flue gases mixture";
-  Units.SI.SpecificEnthalpy Heasm(start=1e3) "Specific enthalpy of the secondary air / recirculated flue gases mixture";
-  Units.SI.Temperature Teasm(start=500) "Temperature of the secondary air / recirculated flue gases mixture";
-  Real XeasmO2(start=0.1) "O2 mass fraction in the secondary air / recirculated flue gases mixture";
-  Real XeasmCO2(start=0.1) "CO2 mass fraction in the secondary air / recirculated flue gases mixture";
-  Real XeasmH2O(start=0.1) "H2O mass fraction in the secondary air / recirculated flue gases mixture";
-  Real XeasmSO2(start=0.1) "SO2 mass fraction in the secondary air / recirculated flue gases mixture";
-  Real XeasmN2(start=0.1) "N2 mass fraction in the secondary air / recirculated flue gases mixture";
-  Units.SI.SpecificEnthalpy Heauom(start=1e3) "Biomass water specific enthalpy";
-  Units.SI.AbsolutePressure Psateom(start=1e5) "Water saturation presure at Teom";
-  Units.SI.SpecificEnthalpy Hvteom(start=10e3) "Steam saturation specific enthalpy at Teom";
-  Units.SI.SpecificEnthalpy Hlteom(start=10e3) "Water saturation specific enthalpy at Teom";
-  Units.SI.SpecificEnthalpy Hvapteom(start=10e3) "Phase transition energy at Teom";
-  Units.SI.SpecificEnthalpy Hs1vom(start=1e3) "Water specific enthalpy of the outgoing biomass at T1sfm vapor";
-  Units.SI.SpecificEnthalpy Heom(start=1e3) "Biomass specific enthalpy at the inlet";
-  Units.SI.Power Wff(start=1e6) "Flue gases formation energy";
-  Units.SI.Power Wp(start=1e6) "Biomass pyrolysis power";
-  Units.SI.Power Wimbp(start=1e6) "Power saved in the combustion flue gases due to the non-destruction of unburnt C";
-  Units.SI.Power Wimbm(start=1e6) "Power lost by the combustion flue gases due to the non-combustion of unburnt C";
-  Units.SI.SpecificEnthalpy Hpyr(start=1e3) "Pyrolysis specific enthalpy";
-  Units.SI.SpecificEnthalpy H1om(start=1e3) "Specific enthalpy of the dry biomass at the pyrolysis temperature of the biomass";
-  Units.SI.MassFlowRate Q1H2O(start=10) "H2O mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1O2(start=10) "O2 mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1N2(start=10) "N2 mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1CO2(start=10) "CO2 mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1SO2(start=10) "SO2 mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q1g(start=10) "Total mass flow rate at the oultet of zone 1";
-  Units.SI.MassFlowRate Q2eom(start=10) "Biomass mass flow rate at the inlet of zone 2";
-  Real PCI1om(start=1e6) "LHV after drying";
-  Real X1MACHom(start=0.1) "Clinker mass fraction in the biomass after drying";
-  Real XC1vol2(start=0.1) "Burnt C mass fraction in zone 2 after drying";
-  Real XC1vol3(start=0.1) "Burnt C mass fraction in zone 3 after drying";
-  Real X1MACHimb(start=0.1) "Unburnt C mass fraction in the clinker after drying";
-  Real X1H(start=0.1) "H mass fraction in the biomass after drying";
-  Real X1O(start=0.1) "O mass fraction in the biomass after drying";
-  Real X1N(start=0.1) "N mass fraction in the biomass after drying";
-  Real X1Cl(start=0.1) "Cl mass fraction in the biomass after drying";
-  Real X1F(start=0.1) "F mass fraction in the biomass after drying";
-  Real X1S(start=0.1) "S mass fraction in the biomass after drying";
-  Real X1CEND(start=0.1) "Ashes mass fraction in the biomass after drying";
-  Units.SI.MassFlowRate Qcendom(start=10) "Ashes mass flow rate";
-  Real Xfcend(start=0.1) "Ashes mass fraction in the flue gases";
-  Units.SI.Power P1g(start=1e6) "Power saved in zone 1";
-
-//Zone 2
-  Units.SI.MassFlowRate Q2eo(start=10) "Mass flow rate of the oxygen carried by the air and the biomass at the inlet of zone 2";
-  Units.SI.MassFlowRate Q2HCl(start=10) "Combustion HCl mass fraction in zone 2";
-  Units.SI.MassFlowRate Q2HF(start=10) "Combustion HF mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2SO2(start=10) "Combustion SO2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2H2O(start=10) "Combustion H2O mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2CO(start=10) "Combustion CO mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2N2(start=10) "Combustion N2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2O2(start=10) "Combustion O2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2cend(start=10) "Combustion ashes mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2CO2(start=10) "Combustion CO2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q2g(start=10) "Elements total mass flow rate after combustion";
-  Real Epsivol(start=0.1) "Volatile matter mass fraction produced in zone 2";
-  Units.SI.MassFlowRate Q3eom(start=10) "Solid matter at the inlet of zone 3";
-  Real X2MACHom(start=0.1) "Clinker mass fraction of the biomass after volatilisation";
-  Real XC2vol3(start=0.1) "C mass fraction burnt in zone 3 after volatilisation";
-  Real X2MACHimb(start=0.1) "Unburnt C mas fraction in the clinker after volatilisation";
-  Real PCICsol(start=1e6) "LHV of the solid outgoing carbon";
-  Real PCICvol(start=1e6) "LHV of the volatile carbon transformed into CO";
-  Units.SI.SpecificEnthalpy H2(start=1e3) "Enthalpy released in zone 2";
-  Units.SI.Power P2g(start=1e6) "Power released by the combustion in zone 2";
-  Units.SI.Power P1o(start=1e6) "Power captured by the biomass";
-  Units.SI.Power P1v(start=1e6) "Power captured by the steam";
-  Units.SI.Power P1a(start=1e6) "Power captured by the air";
-  Units.SI.Power P1r(start=1e6) "Power captured by the cooling water";
-  Real Eray0(start=0.2) "Fraction of the radiated power from zone 2 unused for the drying";
-  Real X2O2(start=0.1) "O2 mass fraction at the oultet of zone 2";
-  Real X2SO2(start=0.1) "SO2 mass fraction at the oultet of zone 2";
-  Real X2CO2(start=0.1) "CO2 mass fraction at the oultet of zone 2";
-  Real X2H2O(start=0.1) "H2O mass fraction at the oultet of zone 2";
-  Real X2N2(start=0.1) "N2 mass fraction at the oultet of zone 2";
-  Units.SI.SpecificEnthalpy H2g(start=1200000) "Flue gases specific enthalpy at the oultet of zone 2";
-  Units.SI.Temperature T2(start=1000) "Flue gases temperature at the oultet of zone 2";
-
-//Zone 3
-  Units.SI.MassFlowRate Q3od(start=10) "O mass flow rate available for the oxydation of the clinker in CO and/or CO2";
-  Units.SI.MassFlowRate Q3cd(start=10) "C mass flow rate available for the oxydation of the clinker in CO and/or CO2";
-  Real taux3oc(start=0.1) "Ratio of the mass flow rates O/C available for the oxydation of the clinker";
-  Units.SI.MassFlowRate Q3CO2(start=10) "CO2 mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3CO(start=10) "CO mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3O2(start=10) "O2 mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3N2(start=10) "N2 mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3H2O(start=10) "H2O mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q3SO2(start=10) "SO2 mass flow rate at the outlet of zone 3";
-  Units.SI.Power P3s(start=1e6) "Power captured by solid matter in zone 3";
-  Units.SI.Power P3g(start=1e6) "Power captured by gaseous matter in zone 3";
-  Units.SI.SpecificEnthalpy H3s(start=1e3) "Gaseous matter specific enthalpy at T3g";
-  Units.SI.SpecificEnthalpy H3g(start=1e3) "Solid matter specific enthalpy at T3o";
-  Real XC2vol31(start=0.1) "C mass fraction burnt in zone 3 after volatilisation";
-  Real XC2vol4(start=0.1) "C mass fraction burnt at the inlet of zone 4";
-  Units.SI.MassFlowRate Q3g(start=10) "Flue gases mass flow rate at the outlet of zone 3";
-  Units.SI.MassFlowRate Q4eom(start=10) "Clinker mass flow rate at the inlet of zone 4";
-  Real X4MACHom(start=0.1) "Mass flow rate of the biomass clinker after C volatilisation in zone 3";
-  Real X4MACHimb(start=0.1) "Unburnt C mass fraction in the clinker after C volatilisation in zone 3";
-  Units.SI.SpecificHeatCapacity Cp3a(start=1000) "Average specific heat capacity at the inlet of zone 3";
-  Units.SI.Temperature T3o(start=500) "Clinker temperature at the outlet of zone 3";
-  Units.SI.Power P3ac(start=1e6) "Air power heated at (T2 + T3o)/2";
-  Units.SI.Power P3co(start=1e6) "CO power heated at (T2 + T3o)/2";
-  Units.SI.Power P3(start=1e6) "Total flue gases power at the outlet of zone 3";
-
-//Zone 4
-  Units.SI.Temperature T4o(start=600) "Clinker temperature at the outlet for the water seal";
-  Units.SI.Temperature T4er(start=600) "Water temperature at the inlet of the water seal";
-  Real X4H2O(start=0.1) "H2O mass fraction in the clinker at the outlet of the water seal";
-  Units.SI.SpecificHeatCapacity Cp4liq(start=1000) "Water specific heat capacity at TEej";
-  Units.SI.Power P4m(start=1e6) "Power lost by the clinker during vaporisation";
-  Units.SI.Power P4h(start=1e6) "Power associated to the clinker humidity";
-  Units.SI.MassFlowRate Q4v(start=10) "Steam mass flow rate generated by the water seal";
-  Units.SI.SpecificEnthalpy H4(start=1e3) "Enthalpy in zone 4";
-  Units.SI.Power P4v(start=1e6) "Power captured by the steam in zone 4";
-  constant Units.SI.SpecificEnthalpy Hvapo=2501600 "Vaporisation energy";
-
-//Zone 5
-  Units.SI.MassFlowRate QO2p(start=10) "Flue gases O2 mass flow rate at the outlet";
-  Units.SI.MassFlowRate Qairp(start=10) "Excess air mass flow rate for data Qo2p";
-  Units.SI.MassFlowRate Qairs(start=10) "Stoechiometric air mass flow rate";
-  Units.SI.MassFlowRate Q5eH2O(start=10) "Steam mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eCO(start=10) "CO mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eCO2(start=10) "CO2 mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eO2(start=10) "O2 mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eN2(start=10) "N2 mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eSO2(start=10) "SO2 mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eHCl(start=10) "HCl mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eHF(start=10) "HF mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5ecend(start=10) "Ashes mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5eam(start=10) "Total mass flow rate at the inlet of zone 5";
-  Units.SI.MassFlowRate Q5od(start=10) "O mass flow rate available in zone 5";
-  Units.SI.MassFlowRate Q5cd(start=10) "C mass flow rate available in zone 5";
-  Units.SI.MassFlowRate Q5hd(start=10) "H mass flow rate available in zone 5";
-  Units.SI.MassFlowRate Q5ost(start=10) "Stoechiometric O mass flow rate for zone 5";
-  Real exc5(start=0.1) "Air excess for zone 5";
-  Units.SI.Power P5(start=1e6) "Power released by oxydation in zone 5";
-  Units.SI.MassFlowRate Q5sCO2(start=10) "CO2 mass flow rate at the outlet of zone 5";
-  Units.SI.MassFlowRate Q5sO2(start=10) "O2 mass flow rate at the outlet of zone 5";
-  Units.SI.MassFlowRate Q5sCO(start=10) "CO mass flow rate at the outlet of zone 5";
-  Units.SI.Power P5s(start=1e6) "Power released by oxydation in zone 5";
-  Real XsfCO(start=0.1) "Flue gases CO mass fraction at the outlet of zone 5";
-  Real XsfN21(start=0.1) "Flue gases N2 mass fraction at the outlet of zone 5";
-  Real XsfHCl(start=0.1) "Flue gases HCl mass fraction at the outlet of zone 5";
-  Real XsfHF(start=0.1) "Flue gases HF mass fraction at the outlet of zone 5";
-  Real XsfCEND(start=0.1) "Ashes mass fraction at the outlet of zone 5";
-  Units.SI.Power P5a(start=1e6) "Power brought by secondary air";
-  Units.SI.Power P5t(start=1e6) "Power accumulated in the flue gases";
-  Real Xcor(start=0.1) "Corrective factor for the flue gases mass fractions";
-  Real X5sH2OC(start=0.1) "Corrected flue gases H2O mass fraction";
-  Real X5sCO2C(start=0.1) "Corrected flue gases CO2 mass fraction";
-  Real X5sO2C(start=0.1) "Corrected flue gases O2 mass fraction";
-  Real X5sSO2C(start=0.1) "Corrected flue gases SO2 mass fraction";
-  Real X5sN2C(start=0.1) "Corrected flue gases N2 mass fraction";
-  Units.SI.Density rhonorm(start=1000) "Density of the outgoing flue gases mass at 0 deg C and 1 atm";
-  Real FVN0(start=0.1) "Ashes normal volume fraction for the computation of FVN";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  FluidType fluids[4] "Fluids mixing in volume";
-  FluidType ftype_ws "Water/steam fluid type";
-  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca2 annotation (Placement(
-        transformation(extent={{-60,50},{-40,70}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Com
-    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet port_eau_refroid
-    annotation (Placement(transformation(extent={{70,20},{90,40}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro2
-    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro3
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro4
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro5
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca1 annotation (Placement(
-        transformation(extent={{-10,-100},{10,-80}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
-    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ca1.ftype;
-  fluids[3] = Ca2.ftype;
-  fluids[4] = Cfg.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "GenericCombustion1D: fluids mixing in volume are not compatible with each other");
-
-  /* Mixing specific enthalpy */
-  port_eau_refroid.h_vol_2 = h;
-  Ca1.h_vol_2 = h;
-  Ca2.h_vol_2 = h;
-  Cfg.h_vol_1 = h;
-
-  Cfg.ftype = ftype;
-
-  /* No flow reversal */
-  Cfg.h = Cfg.h_vol_1;
-
-  Ca1.diff_res_2 = 0;
-  Ca2.diff_res_2 = 0;
-  Cfg.diff_res_1 = 0;
-
-  Ca1.diff_on_2 = diffusion;
-  Ca2.diff_on_2 = diffusion;
-  Cfg.diff_on_1 = diffusion;
-
-  /* Fuel inlet (biomass) */
-  Qeom = Com.Q;
-  Teom = Com.T;
-  PCIom = Com.LHV;
-  XCeom = Com.Xc;
-  XHeom = Com.Xh;
-  XOeom = Com.Xo;
-  XNeom = Com.Xn;
-  XSeom = Com.Xs;
-  XCENDeom = Com.Xashes;
-  XH2Oeom = Com.hum;
-  Cpom = Com.cp;
-
-  /* Cooling water inlet */
-  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GridFurnace: the fluid type for the water/steam inlet must be water/steam");
-
-  port_eau_refroid.diff_res_2 = 0;
-  port_eau_refroid.diff_on_2 = diffusion;
-
-  ftype_ws = port_eau_refroid.ftype;
-
-  Qerefo = port_eau_refroid.Q;
-  Herefo = port_eau_refroid.h;
-
-  /* Primary air inlet */
-  Qeap = Ca1.Q;
-  Peap = Ca1.P;
-  Peap = Psf;
-  Heap = Ca1.h;
-
-  XeapCO2 = Ca1.Xco2;
-  XeapH2O = Ca1.Xh2o;
-  XeapO2 = Ca1.Xo2;
-  XeapSO2 = Ca1.Xso2;
-  XeapN2 = 1 - Ca1.Xco2 - Ca1.Xh2o - Ca1.Xo2 - Ca1.Xso2;
-
-  /* Secondary air inlet */
-  Qeas = Ca2.Q;
-  Peas = Ca2.P;
-  Peas = Psf;
-  Heas = Ca2.h;
-
-  XeasCO2 = Ca2.Xco2;
-  XeasH2O = Ca2.Xh2o;
-  XeasO2 = Ca2.Xo2;
-  XeasSO2 = Ca2.Xso2;
-  XeasN2 = 1 - Ca2.Xco2 - Ca2.Xh2o - Ca2.Xo2 - Ca2.Xso2;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Hsf = Cfg.h;
-  Psf = Cfg.P;
-
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Primary air mass flow rates */
-  X1eap = 1 - X2eap - X3eap;
-  Q1eap = Qeap*X1eap;
-  Q2eap = Qeap*X2eap;
-  Q3eap = Qeap*X3eap;
-
-  /* Recirculated flue gases fow rates */
-  Qfrecirc = Qsf*Xrecirc;
-
-  /* Carbon distribution */
-  XCvol2 = XCeom*XCvol;
-  XMACHimb = XCeom*XCimb;
-  XCvol3 = XCeom*(1 - XCvol - XCimb);
-
-  //--------------------------------------------------------------------
-  // 1st zone : Drying
-  //------------------
-
-  /* Primary air specific enthalpy at Teap */
-  Heap = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teap, XeapCO2, XeapH2O, XeapO2, XeapSO2);
-
-  /* Secondary air specific enthalpy at Teas */
-  Heas = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teas, XeasCO2, XeasH2O, XeasO2, XeasSO2);
-
-  /* Primary air specific enthalpy at T1sfm */
-  H1a = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T1sfm, XeapCO2, XeapH2O, XeapO2, XeapSO2);
-
-  /* Specific enthalpy of the incoming recirculated flue gases */
-  XsfN2recirc = 1 - XfCO2recirc - XfH2Orecirc - XfO2recirc - XfSO2recirc;
-  Hefrecirc = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfrecirc, XfCO2recirc, XfH2Orecirc, XfO2recirc, XfSO2recirc);
-
-  /* Mass flow rate of the secondary air / flue gases recirculated mixture */
-  Qeasm = Qeas + Qfrecirc;
-
-  /* Mixture */
-  if (Qeasm <= 0) then
-    XeasmO2 = 0;
-    XeasmCO2 = 0;
-    XeasmH2O = 0;
-    XeasmSO2 = 0;
-    XeasmN2 = 0;
-    Heasm = 1e3;
-    Teasm = 274.15;
-  else
-    XeasmO2 = (XfO2recirc*Qfrecirc + XeasO2*Qeas)/Qeasm;
-    XeasmCO2 = (XfCO2recirc*Qfrecirc)/Qeasm;
-    XeasmH2O = (XfH2Orecirc*Qfrecirc + XeasH2O*Qeas)/Qeasm;
-    XeasmSO2 = (XfSO2recirc*Qfrecirc)/Qeasm;
-    XeasmN2 = 1 - XeasmO2 - XeasmSO2 - XeasmH2O - XeasmSO2;
-    Heasm = (Qeasm*Heas+Qfrecirc*Hefrecirc)/Qeasm;
-    // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-    Heasm = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Teasm, XeasmCO2, XeasmH2O, XeasmO2, XeasmSO2);
-  end if;
-
-  /* Specific enthalpy of the water in the biomass */
-  pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, Teom, mode);
-  Heauom = pro1.h;
-
-  /* Water phase transition energy at Teom */
-  Psateom = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Teom);
-  pro2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 2);
-  Hvteom = pro2.h;
-  pro3 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 1);
-  Hlteom = pro3.h;
-
-  Hvapteom = Hvteom - Hlteom;
-
-  /* Specific enthalpy of the water in the biomass */
-  pro4 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psf, T1sfm, 0);
-  Hs1vom = pro4.h;
-
-  /* Specific enthalpy of the biomass at Teom */
-  Heom = Cpom*(Teom - 273.15);
-
-  /* Flue gases formation energy */
-  Wff = Qeom*(HfCO2*XCeom + HfH2Og*XHeom*9 + HfSO2*XSeom/32.1*64.1 + HfH2Og*XH2Oeom);
-
-  /* Pyrolisis power of the biomass */
-  Wp = Wff - Qeom*PCIom/(1 - perte) - Qeom*HfH2Ol*XH2Oeom;
-
-  /* Power saved by the combustion gases due to the non-destruction of unburnty particles */
-  Wimbp = Wp*XCimb;
-
-  /* Power lost by the combustion gases due to the non-combusiton of C */
-  Wimbm = Qeom*XCeom*HfCO2*XCimb;
-
-  /* Pyrolisis enthalpy */
-  Hpyr = Wp/(Qeom*(1 - XH2Oeom));
-
-  /* Specific enthalpy of the dry biomasss at the biomass pyrolysis temperature */
-  H1om = Hpyr + Heom;
-
-  /* Mass flow rates at the outlet of zone 1 */
-  Q1H2O = Qeom*XH2Oeom + Q1eap*XeapH2O + Qerefo;
-  Q1O2 = Q1eap*XeapO2;
-  Q1N2 = Q1eap*XeapN2;
-  Q1CO2 = Q1eap*XeapCO2;
-  Q1SO2 = Q1eap*XeapSO2;
-  Q1g = Q1H2O + Q1O2 + Q1N2 + Q1CO2 + Q1SO2;
-  Q2eom = Qeom*(1 - XH2Oeom);
-
-  /* Correction after drying */
-  PCI1om = PCIom/(1 - XH2Oeom);
-  X1MACHom = XMACHeom/(1 - XH2Oeom);
-  XC1vol2 = XCvol2/(1 - XH2Oeom);
-  XC1vol3 = XCvol3/(1 - XH2Oeom);
-  X1MACHimb = XMACHimb/(1 - XH2Oeom);
-  X1H = XHeom/(1 - XH2Oeom);
-  X1O = XOeom/(1 - XH2Oeom);
-  X1N = XNeom/(1 - XH2Oeom);
-  X1Cl = XCleom/(1 - XH2Oeom);
-  X1F = XFeom/(1 - XH2Oeom);
-  X1S = XSeom/(1 - XH2Oeom);
-  X1CEND = XCENDeom/(1 - XH2Oeom);
-
-  /* Ashes mass flow rate in the biomass */
-  Qcendom = XCENDeom*Qeom;
-
-  /* Ashes mass fraction in the flue gases */
-  Xfcend = Qcendom/Qsf;
-
-  /* Power captured in zone 1 */
-  P1g = Qeom*XH2Oeom*Hs1vom + Qeom*XH2Oeom*Hvapteom + Q1eap*H1a + Qerefo*Hs1vom;
-
-  //--------------------------------------------------------------------
-  // 2nd zone : Combustion
-  //----------------------
-
-  /* Outgoing flue gases mass flow rate after combustion */
-  /* Oxygen brought by air and the biomass */
-  Q2eo = Q2eom*X1O + Q2eap*XeapO2;
-
-  /* Outgoing mass flow rates */
-  Q2HCl = 36.5/35.5*Q2eom*X1Cl;
-  Q2HF = 20/19*Q2eom*X1F;
-  Q2SO2 = 64/32*Q2eom*X1S + Q2eap*XeapSO2;
-  Q2H2O = 18/2*Q2eom*(X1H - 1/35.5*X1Cl - 1/19*X1F) + Q2eap*XeapH2O;
-  Q2CO = 28/12*Q2eom*XC1vol2;
-  Q2N2 = Q2eo*X1N + Q2eap*XeapN2;
-  Q2O2 = Q2eo - Q2eom*(X1S + 16/2*(X1H - 1/35.5*X1Cl - 1/19*X1F) + 16/12*XC1vol2);
-  Q2cend = Q2eom*X1CEND;
-  Q2CO2 = Q2eap*XeapCO2;
-
-  /* Total mass flow rate after combustion */
-  Q2g = Q2HCl + Q2HF + Q2SO2 + Q2H2O + Q2CO + Q2N2 + Q2O2 + Q2cend + Q2CO2;
-
-  /* Correction after combustion */
-  Epsivol = XC1vol2 + X1H + X1O + X1S + X1Cl + X1F + X1N + X1CEND;
-  Q3eom = Q2eom*(1 - Epsivol);
-  X2MACHom = X1MACHom/(1 - Epsivol);
-  XC2vol3 = XC1vol3/(1 - Epsivol);
-  X2MACHimb = X1MACHimb/(1 - Epsivol);
-
-  /* Power released by the combustion */
-  PCICsol = (XC1vol3 + X1MACHimb)*HfCO2;
-  PCICvol = XC1vol2*(HfCO2 - HfCO);
-  H2 = PCI1om - PCICsol - PCICvol;
-  P2g = H2*Q2eom+(Q2H2O - (Q2eap*XeapH2O))*H0v + Wimbp;
-
-  P1o = Qeom*(1 - XH2Oeom)*(H1om - Heom);
-  P1v = Qeom*XH2Oeom*(Hs1vom - Hlteom);
-  P1a = Q1eap*(H1a - Heap);
-  P1r = Qerefo*(Hs1vom - Herefo);
-
-  Eray0 = (P1o + P1v + P1a + P1r)/P2g;
-
-  /* Temperature at the outlet of zone 2 */
-  /* Mass fraction at the outlet */
-  X2O2 = Q2O2/Q2g;
-  X2SO2 = Q2SO2/Q2g;
-  X2CO2 = Q2CO/Q2g;
-  X2H2O = Q2H2O/Q2g;
-  X2N2 = 1 - (X2O2 + X2SO2 + X2CO2 + X2H2O);
-
-  /* Specific enthalpy and temperature at the outlet of zone 2 */
-  H2g = (Q2eap*Heap + Q2eom*H1om + P2g*(1 - Eray0 - Eray2) - Q3eom*CpMACHs2*(T2 - 273.15))/Q2g;
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  H2g = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T2, X2CO2, X2H2O, X2O2, X2SO2);
-
-  //--------------------------------------------------------------------
-  // 3rd zone : Clinker cooling
-  //---------------------------
-
-  /* Oxydation of the clinkler carbon into CO and/or CO2 */
-  Q3od = Q3eap*XeapO2;
-  Q3cd = Q3eom*XC2vol3;
-  taux3oc = Q3od/Q3cd;
-
-  /* taux3oc >= 32/12 => all C is transformed into CO2 */
-  if (taux3oc >= 32/12) then
-    /* Mass flow rates */
-    Q3CO2 = 44/12*Q3cd + Q3eap*XeapCO2;
-    Q3CO = 0;
-    Q3O2 = Q3od - 32/12*Q3cd;
-    Q3N2 = Q3eap*XeapN2;
-    Q3H2O = Q3eap*XeapH2O;
-    Q3SO2 = Q3eap*XeapSO2;
-
-    /* Power released */
-    P3s = Q3cd*HfCO;
-    P3g = Q3cd*(HfCO2 - HfCO);
-
-    /* Enthalpy released */
-    H3s = P3s/Q3eom;
-    H3g = P3g/Q3eom;
-    XC2vol31 = XC2vol3;
-    XC2vol4 = XC2vol3;
-
-  /* 16/12 <= taux3oc <= 32/12 => all C is transformed into CO plus a fraction into CO2 */
-  elseif ((taux3oc >= 16/12) and (taux3oc < 32/12)) then
-    /* Mass flow rates */
-    Q3CO2 = 44/12*(Q3od - 16/12*Q3cd) + Q3eap*XeapCO2;
-    Q3CO = 28/12*Q3cd - 28/16*(Q3od - 16/12*Q3cd);
-    Q3O2 = 0;
-    Q3N2 = Q3eap*XeapN2;
-    Q3H2O = Q3eap*XeapH2O;
-    Q3SO2 = Q3eap*XeapSO2;
-
-    /* Power released */
-    P3s = Q3cd*HfCO;
-    P3g = (12/16*Q3od - Q3cd)*(HfCO2 - HfCO);
-
-    /* Enthalpy released */
-    H3s = P3s/Q3eom;
-    H3g = P3g/Q3eom;
-    XC2vol31 = XC2vol3;
-    XC2vol4 = XC2vol3;
-
-  /* taux3oc < 16/12 => partial oxydation into CO */
-  else
-    /* Mass flow rates */
-    Q3CO2 = 0;
-    Q3CO = 28/16*Q3od;
-    Q3O2 = 0;
-    Q3N2 = Q3eap*XeapN2;
-    Q3H2O = Q3eap*XeapH2O;
-    Q3SO2 = Q3eap*XeapSO2;
-
-    /* Power released */
-    P3s = 12/16*Q3od*HfCO;
-    P3g = 0;
-
-    /* Enthalpy released */
-    H3s = P3s/Q3eom;
-    H3g = P3g/Q3eom;
-    XC2vol31 = XC2vol3*12/16*taux3oc;
-    XC2vol4 = XC2vol3;
-end if;
-
-  /* Correction after coke combustion */
-  Q3g = Q3CO2 + Q3CO + Q3H2O + Q3O2 + Q3N2 + Q3SO2;
-  Q4eom = Q3eom*(1 - XC2vol31);
-  X4MACHom = X2MACHom/(1 - XC2vol31);
-  X4MACHimb = X2MACHimb/(1 - XC2vol31) + (XC2vol4 - XC2vol31)/(1 - XC2vol31);
-
-  /* Clinker temperature at the outlet of zone 3 */
-  Cp3a = (ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, (T2 + Teap)/2, X2CO2, X2H2O, X2O2, X2SO2))/((T2 + Teap)/2);
-  T3o - 273.15 = (Q3eap*Heap + Q3eom*CpMACHs2*(T2 - 273.15)-
-      (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*(T2 - 273.15)/2-
-      (28/12)*Q3eom*XC2vol31*Cp3CO*(T2 - 273.15)/2 + P3s)/
-      (Q3eap*Cp3a/2 + (28/12)*Q3eom*XC2vol31*Cp3CO/2 + Q4eom*CpMACHs3);
-  P3ac = (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*((T2 - 273.15) + (T3o - 273.15))/2;
-  P3co = (28/12)*Q3eom*XC2vol31*Cp3CO*((T2 - 273.15) + (T3o - 273.15))/2;
-  P3 = P3g + P3ac + P3co;
-
-  //--------------------------------------------------------------------
-  // 4th zone : Water seal
-  //----------------------
-
-  /* Steam mass flow rate generated by the water seal */
-  if (jointeau == 1) then
-    T4o = TsjeMACH;
-    TsMACH = TsjeMACH;
-    T4er = Teeje;
-    X4H2O = XsjeH2OMACH;
-    Cp4liq = 4180;
-    P4m = Q4eom*CpMACHs4*((T3o - 273.15) - (T4o - 273.15));
-    P4h = Q4eom*X4H2O*Cp4liq*((T4o - 273.15) - (T4er - 273.15));
-    Q4v = rendje*(P4m - P4h)/(Cp4liq*(373.15 - (T4er - 273.15)) + Hvapo);
-    pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2);
-    H4 = pro5.h;
-    P4v = Q4v*pro5.h;
-  else
-    T4o = 273.15;
-    TsMACH = T3o;
-    T4er = 273.15;
-    X4H2O = 0;
-    Cp4liq = 0;
-    P4m = 0;
-    P4h = 0;
-    Q4v = 0;
-    pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2);
-    H4 = pro5.h;
-    P4v = 0;
-  end if;
-
-  /* Clinker mass flow rate at the outlet */
-  QsMACH = Q4eom;
-
-  /* Clinker LHV at the outlet */
-  PCIMACH = (Wimbm - Wimbp)/QsMACH;
-
-  //--------------------------------------------------------------------
-  // 5th zone : Post-combustion
-  //---------------------------
-
-  /* Excess air of the combustion */
-  QO2p = Qsf*XsfO2;
-  Qairp = QO2p/XeapO2*(1 - XeapH2O);
-  Qairs = (Qeap + Qeas) - Qairp;
-  excair = (Qairp/Qairs)*100;
-
-  /* Gases mass flow rates before mixing in zone 5 */
-  Q5eH2O = Q1H2O + Q2H2O + Q3H2O + Q4v + Qeasm*XeasmH2O;
-  Q5eCO = Q2CO + Q3CO;
-  Q5eCO2 = Q3CO2 + Q1CO2 + Q2CO2 + Qeasm*XeasmCO2;
-  Q5eO2 = Q1O2 + Q2O2 + Q3O2 + Qeasm*XeasmO2;
-  Q5eN2 = Q1N2 + Q2N2 + Q3N2 + Qeasm*XeasmN2;
-  Q5eSO2 = Q1SO2 + Q2SO2 + Q3SO2 + Qeasm*XeasmSO2;
-  Q5eHCl = Q2HCl;
-  Q5eHF = Q2HF;
-  Q5ecend = Q2cend;
-  Q5eam = Q5eH2O + Q5eCO + Q5eCO2 + Q5eO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend;
-
-  /* Oxydation of the CO remaining in zone 5 */
-  Q5od = Q5eO2 + 16/18*Q5eH2O + 32/44*Q5eCO2 + 16/28*Q5eCO;
-  Q5cd = 12/44*Q5eCO2 + 12/28*Q5eCO;
-  Q5hd = 2/18*Q5eH2O;
-  Q5ost = 16/2*Q5hd + 32/12*Q5cd;
-  exc5 = Q5od/Q5ost;
-
-  /* Total oxydation of the remaining CO */
-  if (exc5 > 1) then
-    P5 = 12/28*Q5eCO*(HfCO2 - HfCO);
-    Q5sCO2 = Q5eCO2 + 44/28*Q5eCO;
-    Q5sO2 = Q5eO2 - 16/28*Q5eCO;
-    Q5sCO = 0;
-
-  /* Partial oxydation of the remaining CO */
-  else
-    P5 = Q5eO2*12/16*(HfCO2 - HfCO);
-    Q5sCO2 = Q5eCO2 + 44/16*Q5eO2;
-    Q5sO2 = 0;
-    Q5sCO = Q5eCO - 28/16*Q5eO2;
-  end if;
-
-  /* Flue gases total mass flow rate at the outlet */
-  Qsf = Q5eH2O + Q5sCO + Q5sCO2 + Q5sO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend;
-
-  /* Power available in the flue gases */
-  P5s = P5*(1 - Eray5);
-
-  /* Flue gases mass fractions at the outlet */
-  XsfH2O = Q5eH2O/Qsf;
-  XsfCO = Q5sCO/Qsf;
-  XsfCO2 = Q5sCO2/Qsf;
-  XsfO2 = Q5sO2/Qsf;
-  XsfSO2 = Q5eSO2/Qsf;
-  XsfN21 = Q5eN2/Qsf;
-  XsfHCl = Q5eHCl/Qsf;
-  XsfHF = Q5eHF/Qsf;
-  XsfCEND = Q5ecend/Qsf;
-  XsfN2 = 1 - (XsfCO2 + XsfH2O + XsfO2 + XsfSO2);
-
-  /* Power accumulated by the flue gases in zone 5 */
-  P5a = Qeasm*Heasm;
-  P5t = P1g + H2g*Q2g + P3 + P4v + P5s + P5a;
-
-  /* Power radiated */
-  Wsr = P5s*Eray5/(1 - Eray5) + P2g*Eray2;
-
-  /* Flue gases temperature at the outlet */
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  P5t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-  P5t/Qsf = Hsf;
-
-  /* Ashes volume mass */
-  rhocend = rhoCENDom;
-
-  /* Normal voulme fraction of the volatile ashes */
-  Xcor = 1/(1 - XsfH2O);
-  X5sH2OC = 0;
-  X5sCO2C = XsfCO2*Xcor;
-  X5sO2C = XsfO2*Xcor;
-  X5sSO2C = XsfSO2*Xcor;
-  X5sN2C = 1 - (X5sH2OC + X5sCO2C + X5sO2C + X5sSO2C);
-  rhonorm = ThermoSysPro.Properties.FlueGases.FlueGases_rho(1.01325e5, 273.15, X5sCO2C, X5sH2OC, X5sO2C, X5sSO2C);
-  FVN0 = (Qcendom/rhocend)/(Qsf/rhonorm);
-  0 = if ((FVN0 < 0) or (FVN0 > 0.1)) then (FVN - 0.001) else (FVN - FVN0);
-
-  annotation (Diagram(graphics={Polygon(
-          points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80},
-              {-40,80},{-40,40},{-80,20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}},
-          lineColor={0,0,255},
-          fillColor={175,175,175},
-          fillPattern=FillPattern.Solid)}),
-                            Icon(graphics={Polygon(
-          points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80},
-              {-40,80},{-40,40},{-80,20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}},
-          lineColor={0,0,255},
-          fillColor={175,175,175},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{66,60},{92,32}},
-          lineColor={28,108,200},
-          textString="Water inlet"),
-        Text(
-          extent={{14,106},{62,70}},
-          lineColor={238,46,47},
-          textString="Flue gases outlet"),
-        Text(
-          extent={{-98,-14},{-72,-42}},
-          lineColor={28,108,200},
-          textString="Fuel inlet"),
-        Text(
-          extent={{12,-70},{54,-114}},
-          lineColor={28,108,200},
-          textString="Primary air inlet"),
-        Text(
-          extent={{-100,100},{-54,52}},
-          lineColor={28,108,200},
-          textString="Secondary air inlet")}),
-    DymolaStoredErrors,
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end GridFurnace;
+within ThermoSysPro.Fluid.Combustion.CombustionChambers;
+model GridFurnace "Combustion furnace"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real X2eap=0.1 "Primary air fraction in zone 2";
+  parameter Real X3eap=0.1 "Primary air fraction in zone 3";
+  parameter Real XCleom=0 "Cl mass fraction in the biomass";
+  parameter Real XFeom=0 "F mass fraction in the biomass";
+  parameter Real XMACHeom=0 "machefers mass fraction in the biomass";
+  parameter Units.SI.Density rhoCENDom=0.5 "Density of the ashes in the biomass";
+  parameter Units.SI.Temperature Tfrecirc=600 "Temperature of the recirculated flue gases";
+  parameter Real XfCO2recirc=0.3 "CO2 mass fraction in the recirculated flue gases";
+  parameter Real XfH2Orecirc=0.1 "H2O mass fraction in the recirculated flue gases";
+  parameter Real XfO2recirc=0.2 "O2 mass fraction in the recirculated flue gases";
+  parameter Real XfSO2recirc=0 "SO2 mass fraction in the recirculated flue gases";
+  parameter Real Xrecirc=0.1 "Recirculated flue gases fraction in Qsf";
+  parameter Units.SI.SpecificHeatCapacity CpMACH=500 "Clinker average specific heat capacity";
+  parameter Units.SI.SpecificHeatCapacity CpMACHs2=500 "Clinker specific heat capacity at the outlet of zone 2";
+  parameter Units.SI.SpecificHeatCapacity CpMACHs3=500 "Clinker specific heat capacity at the outlet of zone 3";
+  parameter Units.SI.SpecificHeatCapacity CpMACHs4=500 "Clinker specific heat capacity at the outlet of zone 4";
+  parameter Units.SI.Temperature TsjeMACH=293 "Clinker temperature at the outlet of the water seal";
+  parameter Units.SI.Temperature Teeje=293 "Water temperature at the outlet of the water seal";
+  parameter Real XsjeH2OMACH=0.2 "Clinker humidity at the outlet of the water seal";
+  parameter Real rendje=1 "Water seal efficiency";
+  parameter Integer jointeau=0 "1: with water seal - 0: without water seal";
+  parameter Real XCvol=0 "Volatile carbon fraction";
+  parameter Real XCimb=0 "Unburnt carbon fraction";
+  parameter Units.SI.Temperature T1sfm=500 "Flue gases temperature at the outlet of zone 1";
+  parameter Real Eray2=0.1 "Energy fraction radiated towards zone 2 of the furnace";
+  parameter Real Eray5=0.1 "Energy fraction radiated towards zone 5 of the furnac";
+  parameter Real perte=0 "Loss percent of LHV";
+  parameter Units.SI.SpecificHeatCapacity Cp3CO=500 "CO specific heat capacity in zone 3";
+
+protected
+  constant Units.SI.SpecificEnthalpy H0v=2501551.43 "Vaporisation energy at 0°C";
+  constant Units.SI.SpecificEnthalpy HfCO2=3.2791664e7 "CO2 formation enthalpy";
+  constant Units.SI.SpecificEnthalpy HfCO=9.201e6 "CO formation enthalpy";
+  constant Units.SI.SpecificEnthalpy HfH2Og=13.433333e6 "H2Og formation enthalpy";
+  constant Units.SI.SpecificEnthalpy HfSO2=4.6302650e6 "SO2 formation enthalpy";
+  constant Units.SI.SpecificEnthalpy HfH2Ol=15.883300e6 "H2Ol formation enthalpy";
+  constant Units.SI.SpecificHeatCapacity Cp3g=1100 "Average flue gases specific heat capacity at T3g";
+  parameter Integer mode=0 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+
+public
+  Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet";
+  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1000) "Flue gases temperature at the outlet";
+  Real XsfN2(start=0.6) "Flue gases N2 mass fraction at the outlet";
+  Real XsfCO2(start=0.1) "Flue gases CO2 mass fraction at the outlet";
+  Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet";
+  Real XsfO2(start=0.1) "Flue gases O2 mass fraction at the outlet";
+  Real XsfSO2(start=0.1) "Flue gases SO2 mass fraction at the outlet";
+  Units.SI.MassFlowRate Qeap(start=10) "Primary air mass flow rate";
+  Units.SI.AbsolutePressure Peap(start=1e5) "Primary air pressure";
+  Units.SI.Temperature Teap(start=300) "Primary air temperature";
+  Real XeapN2(start=0.6) "Primary air N2 mass fraction";
+  Real XeapCO2(start=0.1) "Primary air CO2 mass fraction";
+  Real XeapH2O(start=0.1) "Primary air H2O mass fraction";
+  Real XeapO2(start=0.1) "Primary air O2 mass fraction";
+  Real XeapSO2(start=0.1) "Primary air SO2 mass fraction";
+  Units.SI.MassFlowRate Qeas(start=10) "Secondary air mass flow rate";
+  Units.SI.AbsolutePressure Peas(start=1e5) "Secondary air pressure";
+  Units.SI.Temperature Teas(start=300) "Secondary air temperature";
+  Real XeasN2(start=0.6) "Secondary air N2 mass fraction";
+  Real XeasCO2(start=0.1) "Secondary air CO2 mass fraction";
+  Real XeasH2O(start=0.1) "Secondary air H2O mass fraction";
+  Real XeasO2(start=0.1) "Secondaryr O2 mass fraction";
+  Real XeasSO2(start=0.1) "Secondary SO2 mass fraction";
+  Units.SI.MassFlowRate Qeom(start=10) "Biomass mass flow rate";
+  Units.SI.Temperature Teom(start=300) "Biomass temperature";
+  Real PCIom(start=1e6) "Biomass LHV (J/kg)";
+  Real XCeom(start=0.1) "Biomass C mass fraction";
+  Real XHeom(start=0.1) "Biomass H mass fraction";
+  Real XOeom(start=0.1) "Biomass O mass fraction";
+  Real XNeom(start=0.01) "Biomass N mass fraction";
+  Real XSeom(start=0.1) "Biomass S mass fraction";
+  Real XCENDeom(start=0.1) "Biomass ashes mass fraction";
+  Real XH2Oeom(start=0.1) "Biomass humidity";
+  Units.SI.SpecificHeatCapacity Cpom(start=1000) "Biomass specific heat capacity";
+  Units.SI.MassFlowRate Qerefo(start=10) "Cooling water mass flow rate";
+  Units.SI.SpecificEnthalpy Herefo(start=10e3) "Cooling water specific enthalpy";
+  Units.SI.MassFlowRate Qfrecirc(start=10) "Recirculated flue gases mass flow rate";
+  Real XsfN2recirc(start=0.1) "Recirculated flue gases N2 mass fraction";
+  Real PCIMACH(start=10e6) "Clinker LHV";
+  Units.SI.MassFlowRate QsMACH(start=10) "Clinker mass flow rate";
+  Units.SI.Temperature TsMACH(start=500) "Clinket temperature";
+  Real FVN(start=0.1) "Volatile ashes mass fraction";
+  Units.SI.Density rhocend(start=500) "Ashes density in the flue gases";
+  Units.SI.Power Wsr(start=10e6) "Radiated power";
+  Real excair(start=0.1) "Combustion excess air";
+  Real X1eap(start=0.1) "Primary air fraction in zone 1";
+  Units.SI.MassFlowRate Q1eap(start=10) "Primary mass flow rate in zone 1";
+  Units.SI.MassFlowRate Q2eap(start=10) "Primary mass flow rate in zone 2";
+  Units.SI.MassFlowRate Q3eap(start=10) "Primary mass flow rate in zone 3";
+  Real XCvol2(start=0.1) "C mass fraction burnt in zone 2";
+  Real XMACHimb(start=0.1) "C mass raction unburnt in the clinker";
+  Real XCvol3(start=0.1) "C mass fraction burnt in zone 3";
+
+//Zone1
+  Units.SI.SpecificEnthalpy Heap(start=1e3) "Humid air specific enthalpy at the primary air temperature";
+  Units.SI.SpecificEnthalpy Heas(start=1e3) "Humid air specific enthalpy at the secondary air temperature";
+  Units.SI.SpecificEnthalpy H1a(start=1e3) "Primary air specific enthalpy at T1sfm";
+  Units.SI.SpecificEnthalpy Hefrecirc(start=1e3) "Specific enthalpy of the incoming recirculated flue gases";
+  Units.SI.MassFlowRate Qeasm(start=10) "Mass flow rate of the secondary air / recirculated flue gases mixture";
+  Units.SI.SpecificEnthalpy Heasm(start=1e3) "Specific enthalpy of the secondary air / recirculated flue gases mixture";
+  Units.SI.Temperature Teasm(start=500) "Temperature of the secondary air / recirculated flue gases mixture";
+  Real XeasmO2(start=0.1) "O2 mass fraction in the secondary air / recirculated flue gases mixture";
+  Real XeasmCO2(start=0.1) "CO2 mass fraction in the secondary air / recirculated flue gases mixture";
+  Real XeasmH2O(start=0.1) "H2O mass fraction in the secondary air / recirculated flue gases mixture";
+  Real XeasmSO2(start=0.1) "SO2 mass fraction in the secondary air / recirculated flue gases mixture";
+  Real XeasmN2(start=0.1) "N2 mass fraction in the secondary air / recirculated flue gases mixture";
+  Units.SI.SpecificEnthalpy Heauom(start=1e3) "Biomass water specific enthalpy";
+  Units.SI.AbsolutePressure Psateom(start=1e5) "Water saturation presure at Teom";
+  Units.SI.SpecificEnthalpy Hvteom(start=10e3) "Steam saturation specific enthalpy at Teom";
+  Units.SI.SpecificEnthalpy Hlteom(start=10e3) "Water saturation specific enthalpy at Teom";
+  Units.SI.SpecificEnthalpy Hvapteom(start=10e3) "Phase transition energy at Teom";
+  Units.SI.SpecificEnthalpy Hs1vom(start=1e3) "Water specific enthalpy of the outgoing biomass at T1sfm vapor";
+  Units.SI.SpecificEnthalpy Heom(start=1e3) "Biomass specific enthalpy at the inlet";
+  Units.SI.Power Wff(start=1e6) "Flue gases formation energy";
+  Units.SI.Power Wp(start=1e6) "Biomass pyrolysis power";
+  Units.SI.Power Wimbp(start=1e6) "Power saved in the combustion flue gases due to the non-destruction of unburnt C";
+  Units.SI.Power Wimbm(start=1e6) "Power lost by the combustion flue gases due to the non-combustion of unburnt C";
+  Units.SI.SpecificEnthalpy Hpyr(start=1e3) "Pyrolysis specific enthalpy";
+  Units.SI.SpecificEnthalpy H1om(start=1e3) "Specific enthalpy of the dry biomass at the pyrolysis temperature of the biomass";
+  Units.SI.MassFlowRate Q1H2O(start=10) "H2O mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1O2(start=10) "O2 mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1N2(start=10) "N2 mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1CO2(start=10) "CO2 mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1SO2(start=10) "SO2 mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q1g(start=10) "Total mass flow rate at the oultet of zone 1";
+  Units.SI.MassFlowRate Q2eom(start=10) "Biomass mass flow rate at the inlet of zone 2";
+  Real PCI1om(start=1e6) "LHV after drying";
+  Real X1MACHom(start=0.1) "Clinker mass fraction in the biomass after drying";
+  Real XC1vol2(start=0.1) "Burnt C mass fraction in zone 2 after drying";
+  Real XC1vol3(start=0.1) "Burnt C mass fraction in zone 3 after drying";
+  Real X1MACHimb(start=0.1) "Unburnt C mass fraction in the clinker after drying";
+  Real X1H(start=0.1) "H mass fraction in the biomass after drying";
+  Real X1O(start=0.1) "O mass fraction in the biomass after drying";
+  Real X1N(start=0.1) "N mass fraction in the biomass after drying";
+  Real X1Cl(start=0.1) "Cl mass fraction in the biomass after drying";
+  Real X1F(start=0.1) "F mass fraction in the biomass after drying";
+  Real X1S(start=0.1) "S mass fraction in the biomass after drying";
+  Real X1CEND(start=0.1) "Ashes mass fraction in the biomass after drying";
+  Units.SI.MassFlowRate Qcendom(start=10) "Ashes mass flow rate";
+  Real Xfcend(start=0.1) "Ashes mass fraction in the flue gases";
+  Units.SI.Power P1g(start=1e6) "Power saved in zone 1";
+
+//Zone 2
+  Units.SI.MassFlowRate Q2eo(start=10) "Mass flow rate of the oxygen carried by the air and the biomass at the inlet of zone 2";
+  Units.SI.MassFlowRate Q2HCl(start=10) "Combustion HCl mass fraction in zone 2";
+  Units.SI.MassFlowRate Q2HF(start=10) "Combustion HF mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2SO2(start=10) "Combustion SO2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2H2O(start=10) "Combustion H2O mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2CO(start=10) "Combustion CO mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2N2(start=10) "Combustion N2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2O2(start=10) "Combustion O2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2cend(start=10) "Combustion ashes mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2CO2(start=10) "Combustion CO2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q2g(start=10) "Elements total mass flow rate after combustion";
+  Real Epsivol(start=0.1) "Volatile matter mass fraction produced in zone 2";
+  Units.SI.MassFlowRate Q3eom(start=10) "Solid matter at the inlet of zone 3";
+  Real X2MACHom(start=0.1) "Clinker mass fraction of the biomass after volatilisation";
+  Real XC2vol3(start=0.1) "C mass fraction burnt in zone 3 after volatilisation";
+  Real X2MACHimb(start=0.1) "Unburnt C mas fraction in the clinker after volatilisation";
+  Real PCICsol(start=1e6) "LHV of the solid outgoing carbon";
+  Real PCICvol(start=1e6) "LHV of the volatile carbon transformed into CO";
+  Units.SI.SpecificEnthalpy H2(start=1e3) "Enthalpy released in zone 2";
+  Units.SI.Power P2g(start=1e6) "Power released by the combustion in zone 2";
+  Units.SI.Power P1o(start=1e6) "Power captured by the biomass";
+  Units.SI.Power P1v(start=1e6) "Power captured by the steam";
+  Units.SI.Power P1a(start=1e6) "Power captured by the air";
+  Units.SI.Power P1r(start=1e6) "Power captured by the cooling water";
+  Real Eray0(start=0.2) "Fraction of the radiated power from zone 2 unused for the drying";
+  Real X2O2(start=0.1) "O2 mass fraction at the oultet of zone 2";
+  Real X2SO2(start=0.1) "SO2 mass fraction at the oultet of zone 2";
+  Real X2CO2(start=0.1) "CO2 mass fraction at the oultet of zone 2";
+  Real X2H2O(start=0.1) "H2O mass fraction at the oultet of zone 2";
+  Real X2N2(start=0.1) "N2 mass fraction at the oultet of zone 2";
+  Units.SI.SpecificEnthalpy H2g(start=1200000) "Flue gases specific enthalpy at the oultet of zone 2";
+  Units.SI.Temperature T2(start=1000) "Flue gases temperature at the oultet of zone 2";
+
+//Zone 3
+  Units.SI.MassFlowRate Q3od(start=10) "O mass flow rate available for the oxydation of the clinker in CO and/or CO2";
+  Units.SI.MassFlowRate Q3cd(start=10) "C mass flow rate available for the oxydation of the clinker in CO and/or CO2";
+  Real taux3oc(start=0.1) "Ratio of the mass flow rates O/C available for the oxydation of the clinker";
+  Units.SI.MassFlowRate Q3CO2(start=10) "CO2 mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3CO(start=10) "CO mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3O2(start=10) "O2 mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3N2(start=10) "N2 mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3H2O(start=10) "H2O mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q3SO2(start=10) "SO2 mass flow rate at the outlet of zone 3";
+  Units.SI.Power P3s(start=1e6) "Power captured by solid matter in zone 3";
+  Units.SI.Power P3g(start=1e6) "Power captured by gaseous matter in zone 3";
+  Units.SI.SpecificEnthalpy H3s(start=1e3) "Gaseous matter specific enthalpy at T3g";
+  Units.SI.SpecificEnthalpy H3g(start=1e3) "Solid matter specific enthalpy at T3o";
+  Real XC2vol31(start=0.1) "C mass fraction burnt in zone 3 after volatilisation";
+  Real XC2vol4(start=0.1) "C mass fraction burnt at the inlet of zone 4";
+  Units.SI.MassFlowRate Q3g(start=10) "Flue gases mass flow rate at the outlet of zone 3";
+  Units.SI.MassFlowRate Q4eom(start=10) "Clinker mass flow rate at the inlet of zone 4";
+  Real X4MACHom(start=0.1) "Mass flow rate of the biomass clinker after C volatilisation in zone 3";
+  Real X4MACHimb(start=0.1) "Unburnt C mass fraction in the clinker after C volatilisation in zone 3";
+  Units.SI.SpecificHeatCapacity Cp3a(start=1000) "Average specific heat capacity at the inlet of zone 3";
+  Units.SI.Temperature T3o(start=500) "Clinker temperature at the outlet of zone 3";
+  Units.SI.Power P3ac(start=1e6) "Air power heated at (T2 + T3o)/2";
+  Units.SI.Power P3co(start=1e6) "CO power heated at (T2 + T3o)/2";
+  Units.SI.Power P3(start=1e6) "Total flue gases power at the outlet of zone 3";
+
+//Zone 4
+  Units.SI.Temperature T4o(start=600) "Clinker temperature at the outlet for the water seal";
+  Units.SI.Temperature T4er(start=600) "Water temperature at the inlet of the water seal";
+  Real X4H2O(start=0.1) "H2O mass fraction in the clinker at the outlet of the water seal";
+  Units.SI.SpecificHeatCapacity Cp4liq(start=1000) "Water specific heat capacity at TEej";
+  Units.SI.Power P4m(start=1e6) "Power lost by the clinker during vaporisation";
+  Units.SI.Power P4h(start=1e6) "Power associated to the clinker humidity";
+  Units.SI.MassFlowRate Q4v(start=10) "Steam mass flow rate generated by the water seal";
+  Units.SI.SpecificEnthalpy H4(start=1e3) "Enthalpy in zone 4";
+  Units.SI.Power P4v(start=1e6) "Power captured by the steam in zone 4";
+  constant Units.SI.SpecificEnthalpy Hvapo=2501600 "Vaporisation energy";
+
+//Zone 5
+  Units.SI.MassFlowRate QO2p(start=10) "Flue gases O2 mass flow rate at the outlet";
+  Units.SI.MassFlowRate Qairp(start=10) "Excess air mass flow rate for data Qo2p";
+  Units.SI.MassFlowRate Qairs(start=10) "Stoechiometric air mass flow rate";
+  Units.SI.MassFlowRate Q5eH2O(start=10) "Steam mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eCO(start=10) "CO mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eCO2(start=10) "CO2 mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eO2(start=10) "O2 mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eN2(start=10) "N2 mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eSO2(start=10) "SO2 mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eHCl(start=10) "HCl mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eHF(start=10) "HF mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5ecend(start=10) "Ashes mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5eam(start=10) "Total mass flow rate at the inlet of zone 5";
+  Units.SI.MassFlowRate Q5od(start=10) "O mass flow rate available in zone 5";
+  Units.SI.MassFlowRate Q5cd(start=10) "C mass flow rate available in zone 5";
+  Units.SI.MassFlowRate Q5hd(start=10) "H mass flow rate available in zone 5";
+  Units.SI.MassFlowRate Q5ost(start=10) "Stoechiometric O mass flow rate for zone 5";
+  Real exc5(start=0.1) "Air excess for zone 5";
+  Units.SI.Power P5(start=1e6) "Power released by oxydation in zone 5";
+  Units.SI.MassFlowRate Q5sCO2(start=10) "CO2 mass flow rate at the outlet of zone 5";
+  Units.SI.MassFlowRate Q5sO2(start=10) "O2 mass flow rate at the outlet of zone 5";
+  Units.SI.MassFlowRate Q5sCO(start=10) "CO mass flow rate at the outlet of zone 5";
+  Units.SI.Power P5s(start=1e6) "Power released by oxydation in zone 5";
+  Real XsfCO(start=0.1) "Flue gases CO mass fraction at the outlet of zone 5";
+  Real XsfN21(start=0.1) "Flue gases N2 mass fraction at the outlet of zone 5";
+  Real XsfHCl(start=0.1) "Flue gases HCl mass fraction at the outlet of zone 5";
+  Real XsfHF(start=0.1) "Flue gases HF mass fraction at the outlet of zone 5";
+  Real XsfCEND(start=0.1) "Ashes mass fraction at the outlet of zone 5";
+  Units.SI.Power P5a(start=1e6) "Power brought by secondary air";
+  Units.SI.Power P5t(start=1e6) "Power accumulated in the flue gases";
+  Real Xcor(start=0.1) "Corrective factor for the flue gases mass fractions";
+  Real X5sH2OC(start=0.1) "Corrected flue gases H2O mass fraction";
+  Real X5sCO2C(start=0.1) "Corrected flue gases CO2 mass fraction";
+  Real X5sO2C(start=0.1) "Corrected flue gases O2 mass fraction";
+  Real X5sSO2C(start=0.1) "Corrected flue gases SO2 mass fraction";
+  Real X5sN2C(start=0.1) "Corrected flue gases N2 mass fraction";
+  Units.SI.Density rhonorm(start=1000) "Density of the outgoing flue gases mass at 0 deg C and 1 atm";
+  Real FVN0(start=0.1) "Ashes normal volume fraction for the computation of FVN";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  FluidType fluids[4] "Fluids mixing in volume";
+  FluidType ftype_ws "Water/steam fluid type";
+  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca2 annotation (Placement(
+        transformation(extent={{-60,50},{-40,70}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Com
+    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet port_eau_refroid
+    annotation (Placement(transformation(extent={{70,20},{90,40}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro2
+    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro3
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro4
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro5
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca1 annotation (Placement(
+        transformation(extent={{-10,-100},{10,-80}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
+    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ca1.ftype;
+  fluids[3] = Ca2.ftype;
+  fluids[4] = Cfg.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "GenericCombustion1D: fluids mixing in volume are not compatible with each other");
+
+  /* Mixing specific enthalpy */
+  port_eau_refroid.h_vol_2 = h;
+  Ca1.h_vol_2 = h;
+  Ca2.h_vol_2 = h;
+  Cfg.h_vol_1 = h;
+
+  Cfg.ftype = ftype;
+
+  /* No flow reversal */
+  Cfg.h = Cfg.h_vol_1;
+
+  Ca1.diff_res_2 = 0;
+  Ca2.diff_res_2 = 0;
+  Cfg.diff_res_1 = 0;
+
+  Ca1.diff_on_2 = diffusion;
+  Ca2.diff_on_2 = diffusion;
+  Cfg.diff_on_1 = diffusion;
+
+  /* Fuel inlet (biomass) */
+  Qeom = Com.Q;
+  Teom = Com.T;
+  PCIom = Com.LHV;
+  XCeom = Com.Xc;
+  XHeom = Com.Xh;
+  XOeom = Com.Xo;
+  XNeom = Com.Xn;
+  XSeom = Com.Xs;
+  XCENDeom = Com.Xashes;
+  XH2Oeom = Com.hum;
+  Cpom = Com.cp;
+
+  /* Cooling water inlet */
+  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GridFurnace: the fluid type for the water/steam inlet must be water/steam");
+
+  port_eau_refroid.diff_res_2 = 0;
+  port_eau_refroid.diff_on_2 = diffusion;
+
+  ftype_ws = port_eau_refroid.ftype;
+
+  Qerefo = port_eau_refroid.Q;
+  Herefo = port_eau_refroid.h;
+
+  /* Primary air inlet */
+  Qeap = Ca1.Q;
+  Peap = Ca1.P;
+  Peap = Psf;
+  Heap = Ca1.h;
+
+  XeapCO2 = Ca1.Xco2;
+  XeapH2O = Ca1.Xh2o;
+  XeapO2 = Ca1.Xo2;
+  XeapSO2 = Ca1.Xso2;
+  XeapN2 = 1 - Ca1.Xco2 - Ca1.Xh2o - Ca1.Xo2 - Ca1.Xso2;
+
+  /* Secondary air inlet */
+  Qeas = Ca2.Q;
+  Peas = Ca2.P;
+  Peas = Psf;
+  Heas = Ca2.h;
+
+  XeasCO2 = Ca2.Xco2;
+  XeasH2O = Ca2.Xh2o;
+  XeasO2 = Ca2.Xo2;
+  XeasSO2 = Ca2.Xso2;
+  XeasN2 = 1 - Ca2.Xco2 - Ca2.Xh2o - Ca2.Xo2 - Ca2.Xso2;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Hsf = Cfg.h;
+  Psf = Cfg.P;
+
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Primary air mass flow rates */
+  X1eap = 1 - X2eap - X3eap;
+  Q1eap = Qeap*X1eap;
+  Q2eap = Qeap*X2eap;
+  Q3eap = Qeap*X3eap;
+
+  /* Recirculated flue gases fow rates */
+  Qfrecirc = Qsf*Xrecirc;
+
+  /* Carbon distribution */
+  XCvol2 = XCeom*XCvol;
+  XMACHimb = XCeom*XCimb;
+  XCvol3 = XCeom*(1 - XCvol - XCimb);
+
+  //--------------------------------------------------------------------
+  // 1st zone : Drying
+  //------------------
+
+  /* Primary air specific enthalpy at Teap */
+  Heap = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teap, XeapCO2, XeapH2O, XeapO2, XeapSO2);
+
+  /* Secondary air specific enthalpy at Teas */
+  Heas = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teas, XeasCO2, XeasH2O, XeasO2, XeasSO2);
+
+  /* Primary air specific enthalpy at T1sfm */
+  H1a = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T1sfm, XeapCO2, XeapH2O, XeapO2, XeapSO2);
+
+  /* Specific enthalpy of the incoming recirculated flue gases */
+  XsfN2recirc = 1 - XfCO2recirc - XfH2Orecirc - XfO2recirc - XfSO2recirc;
+  Hefrecirc = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfrecirc, XfCO2recirc, XfH2Orecirc, XfO2recirc, XfSO2recirc);
+
+  /* Mass flow rate of the secondary air / flue gases recirculated mixture */
+  Qeasm = Qeas + Qfrecirc;
+
+  /* Mixture */
+  if (Qeasm <= 0) then
+    XeasmO2 = 0;
+    XeasmCO2 = 0;
+    XeasmH2O = 0;
+    XeasmSO2 = 0;
+    XeasmN2 = 0;
+    Heasm = 1e3;
+    Teasm = 274.15;
+  else
+    XeasmO2 = (XfO2recirc*Qfrecirc + XeasO2*Qeas)/Qeasm;
+    XeasmCO2 = (XfCO2recirc*Qfrecirc)/Qeasm;
+    XeasmH2O = (XfH2Orecirc*Qfrecirc + XeasH2O*Qeas)/Qeasm;
+    XeasmSO2 = (XfSO2recirc*Qfrecirc)/Qeasm;
+    XeasmN2 = 1 - XeasmO2 - XeasmSO2 - XeasmH2O - XeasmSO2;
+    Heasm = (Qeasm*Heas+Qfrecirc*Hefrecirc)/Qeasm;
+    // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+    Heasm = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Teasm, XeasmCO2, XeasmH2O, XeasmO2, XeasmSO2);
+  end if;
+
+  /* Specific enthalpy of the water in the biomass */
+  pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, Teom, mode);
+  Heauom = pro1.h;
+
+  /* Water phase transition energy at Teom */
+  Psateom = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Teom);
+  pro2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 2);
+  Hvteom = pro2.h;
+  pro3 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 1);
+  Hlteom = pro3.h;
+
+  Hvapteom = Hvteom - Hlteom;
+
+  /* Specific enthalpy of the water in the biomass */
+  pro4 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psf, T1sfm, 0);
+  Hs1vom = pro4.h;
+
+  /* Specific enthalpy of the biomass at Teom */
+  Heom = Cpom*(Teom - 273.15);
+
+  /* Flue gases formation energy */
+  Wff = Qeom*(HfCO2*XCeom + HfH2Og*XHeom*9 + HfSO2*XSeom/32.1*64.1 + HfH2Og*XH2Oeom);
+
+  /* Pyrolisis power of the biomass */
+  Wp = Wff - Qeom*PCIom/(1 - perte) - Qeom*HfH2Ol*XH2Oeom;
+
+  /* Power saved by the combustion gases due to the non-destruction of unburnty particles */
+  Wimbp = Wp*XCimb;
+
+  /* Power lost by the combustion gases due to the non-combusiton of C */
+  Wimbm = Qeom*XCeom*HfCO2*XCimb;
+
+  /* Pyrolisis enthalpy */
+  Hpyr = Wp/(Qeom*(1 - XH2Oeom));
+
+  /* Specific enthalpy of the dry biomasss at the biomass pyrolysis temperature */
+  H1om = Hpyr + Heom;
+
+  /* Mass flow rates at the outlet of zone 1 */
+  Q1H2O = Qeom*XH2Oeom + Q1eap*XeapH2O + Qerefo;
+  Q1O2 = Q1eap*XeapO2;
+  Q1N2 = Q1eap*XeapN2;
+  Q1CO2 = Q1eap*XeapCO2;
+  Q1SO2 = Q1eap*XeapSO2;
+  Q1g = Q1H2O + Q1O2 + Q1N2 + Q1CO2 + Q1SO2;
+  Q2eom = Qeom*(1 - XH2Oeom);
+
+  /* Correction after drying */
+  PCI1om = PCIom/(1 - XH2Oeom);
+  X1MACHom = XMACHeom/(1 - XH2Oeom);
+  XC1vol2 = XCvol2/(1 - XH2Oeom);
+  XC1vol3 = XCvol3/(1 - XH2Oeom);
+  X1MACHimb = XMACHimb/(1 - XH2Oeom);
+  X1H = XHeom/(1 - XH2Oeom);
+  X1O = XOeom/(1 - XH2Oeom);
+  X1N = XNeom/(1 - XH2Oeom);
+  X1Cl = XCleom/(1 - XH2Oeom);
+  X1F = XFeom/(1 - XH2Oeom);
+  X1S = XSeom/(1 - XH2Oeom);
+  X1CEND = XCENDeom/(1 - XH2Oeom);
+
+  /* Ashes mass flow rate in the biomass */
+  Qcendom = XCENDeom*Qeom;
+
+  /* Ashes mass fraction in the flue gases */
+  Xfcend = Qcendom/Qsf;
+
+  /* Power captured in zone 1 */
+  P1g = Qeom*XH2Oeom*Hs1vom + Qeom*XH2Oeom*Hvapteom + Q1eap*H1a + Qerefo*Hs1vom;
+
+  //--------------------------------------------------------------------
+  // 2nd zone : Combustion
+  //----------------------
+
+  /* Outgoing flue gases mass flow rate after combustion */
+  /* Oxygen brought by air and the biomass */
+  Q2eo = Q2eom*X1O + Q2eap*XeapO2;
+
+  /* Outgoing mass flow rates */
+  Q2HCl = 36.5/35.5*Q2eom*X1Cl;
+  Q2HF = 20/19*Q2eom*X1F;
+  Q2SO2 = 64/32*Q2eom*X1S + Q2eap*XeapSO2;
+  Q2H2O = 18/2*Q2eom*(X1H - 1/35.5*X1Cl - 1/19*X1F) + Q2eap*XeapH2O;
+  Q2CO = 28/12*Q2eom*XC1vol2;
+  Q2N2 = Q2eo*X1N + Q2eap*XeapN2;
+  Q2O2 = Q2eo - Q2eom*(X1S + 16/2*(X1H - 1/35.5*X1Cl - 1/19*X1F) + 16/12*XC1vol2);
+  Q2cend = Q2eom*X1CEND;
+  Q2CO2 = Q2eap*XeapCO2;
+
+  /* Total mass flow rate after combustion */
+  Q2g = Q2HCl + Q2HF + Q2SO2 + Q2H2O + Q2CO + Q2N2 + Q2O2 + Q2cend + Q2CO2;
+
+  /* Correction after combustion */
+  Epsivol = XC1vol2 + X1H + X1O + X1S + X1Cl + X1F + X1N + X1CEND;
+  Q3eom = Q2eom*(1 - Epsivol);
+  X2MACHom = X1MACHom/(1 - Epsivol);
+  XC2vol3 = XC1vol3/(1 - Epsivol);
+  X2MACHimb = X1MACHimb/(1 - Epsivol);
+
+  /* Power released by the combustion */
+  PCICsol = (XC1vol3 + X1MACHimb)*HfCO2;
+  PCICvol = XC1vol2*(HfCO2 - HfCO);
+  H2 = PCI1om - PCICsol - PCICvol;
+  P2g = H2*Q2eom+(Q2H2O - (Q2eap*XeapH2O))*H0v + Wimbp;
+
+  P1o = Qeom*(1 - XH2Oeom)*(H1om - Heom);
+  P1v = Qeom*XH2Oeom*(Hs1vom - Hlteom);
+  P1a = Q1eap*(H1a - Heap);
+  P1r = Qerefo*(Hs1vom - Herefo);
+
+  Eray0 = (P1o + P1v + P1a + P1r)/P2g;
+
+  /* Temperature at the outlet of zone 2 */
+  /* Mass fraction at the outlet */
+  X2O2 = Q2O2/Q2g;
+  X2SO2 = Q2SO2/Q2g;
+  X2CO2 = Q2CO/Q2g;
+  X2H2O = Q2H2O/Q2g;
+  X2N2 = 1 - (X2O2 + X2SO2 + X2CO2 + X2H2O);
+
+  /* Specific enthalpy and temperature at the outlet of zone 2 */
+  H2g = (Q2eap*Heap + Q2eom*H1om + P2g*(1 - Eray0 - Eray2) - Q3eom*CpMACHs2*(T2 - 273.15))/Q2g;
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  H2g = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T2, X2CO2, X2H2O, X2O2, X2SO2);
+
+  //--------------------------------------------------------------------
+  // 3rd zone : Clinker cooling
+  //---------------------------
+
+  /* Oxydation of the clinkler carbon into CO and/or CO2 */
+  Q3od = Q3eap*XeapO2;
+  Q3cd = Q3eom*XC2vol3;
+  taux3oc = Q3od/Q3cd;
+
+  /* taux3oc >= 32/12 => all C is transformed into CO2 */
+  if (taux3oc >= 32/12) then
+    /* Mass flow rates */
+    Q3CO2 = 44/12*Q3cd + Q3eap*XeapCO2;
+    Q3CO = 0;
+    Q3O2 = Q3od - 32/12*Q3cd;
+    Q3N2 = Q3eap*XeapN2;
+    Q3H2O = Q3eap*XeapH2O;
+    Q3SO2 = Q3eap*XeapSO2;
+
+    /* Power released */
+    P3s = Q3cd*HfCO;
+    P3g = Q3cd*(HfCO2 - HfCO);
+
+    /* Enthalpy released */
+    H3s = P3s/Q3eom;
+    H3g = P3g/Q3eom;
+    XC2vol31 = XC2vol3;
+    XC2vol4 = XC2vol3;
+
+  /* 16/12 <= taux3oc <= 32/12 => all C is transformed into CO plus a fraction into CO2 */
+  elseif ((taux3oc >= 16/12) and (taux3oc < 32/12)) then
+    /* Mass flow rates */
+    Q3CO2 = 44/12*(Q3od - 16/12*Q3cd) + Q3eap*XeapCO2;
+    Q3CO = 28/12*Q3cd - 28/16*(Q3od - 16/12*Q3cd);
+    Q3O2 = 0;
+    Q3N2 = Q3eap*XeapN2;
+    Q3H2O = Q3eap*XeapH2O;
+    Q3SO2 = Q3eap*XeapSO2;
+
+    /* Power released */
+    P3s = Q3cd*HfCO;
+    P3g = (12/16*Q3od - Q3cd)*(HfCO2 - HfCO);
+
+    /* Enthalpy released */
+    H3s = P3s/Q3eom;
+    H3g = P3g/Q3eom;
+    XC2vol31 = XC2vol3;
+    XC2vol4 = XC2vol3;
+
+  /* taux3oc < 16/12 => partial oxydation into CO */
+  else
+    /* Mass flow rates */
+    Q3CO2 = 0;
+    Q3CO = 28/16*Q3od;
+    Q3O2 = 0;
+    Q3N2 = Q3eap*XeapN2;
+    Q3H2O = Q3eap*XeapH2O;
+    Q3SO2 = Q3eap*XeapSO2;
+
+    /* Power released */
+    P3s = 12/16*Q3od*HfCO;
+    P3g = 0;
+
+    /* Enthalpy released */
+    H3s = P3s/Q3eom;
+    H3g = P3g/Q3eom;
+    XC2vol31 = XC2vol3*12/16*taux3oc;
+    XC2vol4 = XC2vol3;
+end if;
+
+  /* Correction after coke combustion */
+  Q3g = Q3CO2 + Q3CO + Q3H2O + Q3O2 + Q3N2 + Q3SO2;
+  Q4eom = Q3eom*(1 - XC2vol31);
+  X4MACHom = X2MACHom/(1 - XC2vol31);
+  X4MACHimb = X2MACHimb/(1 - XC2vol31) + (XC2vol4 - XC2vol31)/(1 - XC2vol31);
+
+  /* Clinker temperature at the outlet of zone 3 */
+  Cp3a = (ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, (T2 + Teap)/2, X2CO2, X2H2O, X2O2, X2SO2))/((T2 + Teap)/2);
+  T3o - 273.15 = (Q3eap*Heap + Q3eom*CpMACHs2*(T2 - 273.15)-
+      (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*(T2 - 273.15)/2-
+      (28/12)*Q3eom*XC2vol31*Cp3CO*(T2 - 273.15)/2 + P3s)/
+      (Q3eap*Cp3a/2 + (28/12)*Q3eom*XC2vol31*Cp3CO/2 + Q4eom*CpMACHs3);
+  P3ac = (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*((T2 - 273.15) + (T3o - 273.15))/2;
+  P3co = (28/12)*Q3eom*XC2vol31*Cp3CO*((T2 - 273.15) + (T3o - 273.15))/2;
+  P3 = P3g + P3ac + P3co;
+
+  //--------------------------------------------------------------------
+  // 4th zone : Water seal
+  //----------------------
+
+  /* Steam mass flow rate generated by the water seal */
+  if (jointeau == 1) then
+    T4o = TsjeMACH;
+    TsMACH = TsjeMACH;
+    T4er = Teeje;
+    X4H2O = XsjeH2OMACH;
+    Cp4liq = 4180;
+    P4m = Q4eom*CpMACHs4*((T3o - 273.15) - (T4o - 273.15));
+    P4h = Q4eom*X4H2O*Cp4liq*((T4o - 273.15) - (T4er - 273.15));
+    Q4v = rendje*(P4m - P4h)/(Cp4liq*(373.15 - (T4er - 273.15)) + Hvapo);
+    pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2);
+    H4 = pro5.h;
+    P4v = Q4v*pro5.h;
+  else
+    T4o = 273.15;
+    TsMACH = T3o;
+    T4er = 273.15;
+    X4H2O = 0;
+    Cp4liq = 0;
+    P4m = 0;
+    P4h = 0;
+    Q4v = 0;
+    pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2);
+    H4 = pro5.h;
+    P4v = 0;
+  end if;
+
+  /* Clinker mass flow rate at the outlet */
+  QsMACH = Q4eom;
+
+  /* Clinker LHV at the outlet */
+  PCIMACH = (Wimbm - Wimbp)/QsMACH;
+
+  //--------------------------------------------------------------------
+  // 5th zone : Post-combustion
+  //---------------------------
+
+  /* Excess air of the combustion */
+  QO2p = Qsf*XsfO2;
+  Qairp = QO2p/XeapO2*(1 - XeapH2O);
+  Qairs = (Qeap + Qeas) - Qairp;
+  excair = (Qairp/Qairs)*100;
+
+  /* Gases mass flow rates before mixing in zone 5 */
+  Q5eH2O = Q1H2O + Q2H2O + Q3H2O + Q4v + Qeasm*XeasmH2O;
+  Q5eCO = Q2CO + Q3CO;
+  Q5eCO2 = Q3CO2 + Q1CO2 + Q2CO2 + Qeasm*XeasmCO2;
+  Q5eO2 = Q1O2 + Q2O2 + Q3O2 + Qeasm*XeasmO2;
+  Q5eN2 = Q1N2 + Q2N2 + Q3N2 + Qeasm*XeasmN2;
+  Q5eSO2 = Q1SO2 + Q2SO2 + Q3SO2 + Qeasm*XeasmSO2;
+  Q5eHCl = Q2HCl;
+  Q5eHF = Q2HF;
+  Q5ecend = Q2cend;
+  Q5eam = Q5eH2O + Q5eCO + Q5eCO2 + Q5eO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend;
+
+  /* Oxydation of the CO remaining in zone 5 */
+  Q5od = Q5eO2 + 16/18*Q5eH2O + 32/44*Q5eCO2 + 16/28*Q5eCO;
+  Q5cd = 12/44*Q5eCO2 + 12/28*Q5eCO;
+  Q5hd = 2/18*Q5eH2O;
+  Q5ost = 16/2*Q5hd + 32/12*Q5cd;
+  exc5 = Q5od/Q5ost;
+
+  /* Total oxydation of the remaining CO */
+  if (exc5 > 1) then
+    P5 = 12/28*Q5eCO*(HfCO2 - HfCO);
+    Q5sCO2 = Q5eCO2 + 44/28*Q5eCO;
+    Q5sO2 = Q5eO2 - 16/28*Q5eCO;
+    Q5sCO = 0;
+
+  /* Partial oxydation of the remaining CO */
+  else
+    P5 = Q5eO2*12/16*(HfCO2 - HfCO);
+    Q5sCO2 = Q5eCO2 + 44/16*Q5eO2;
+    Q5sO2 = 0;
+    Q5sCO = Q5eCO - 28/16*Q5eO2;
+  end if;
+
+  /* Flue gases total mass flow rate at the outlet */
+  Qsf = Q5eH2O + Q5sCO + Q5sCO2 + Q5sO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend;
+
+  /* Power available in the flue gases */
+  P5s = P5*(1 - Eray5);
+
+  /* Flue gases mass fractions at the outlet */
+  XsfH2O = Q5eH2O/Qsf;
+  XsfCO = Q5sCO/Qsf;
+  XsfCO2 = Q5sCO2/Qsf;
+  XsfO2 = Q5sO2/Qsf;
+  XsfSO2 = Q5eSO2/Qsf;
+  XsfN21 = Q5eN2/Qsf;
+  XsfHCl = Q5eHCl/Qsf;
+  XsfHF = Q5eHF/Qsf;
+  XsfCEND = Q5ecend/Qsf;
+  XsfN2 = 1 - (XsfCO2 + XsfH2O + XsfO2 + XsfSO2);
+
+  /* Power accumulated by the flue gases in zone 5 */
+  P5a = Qeasm*Heasm;
+  P5t = P1g + H2g*Q2g + P3 + P4v + P5s + P5a;
+
+  /* Power radiated */
+  Wsr = P5s*Eray5/(1 - Eray5) + P2g*Eray2;
+
+  /* Flue gases temperature at the outlet */
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  P5t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+  P5t/Qsf = Hsf;
+
+  /* Ashes volume mass */
+  rhocend = rhoCENDom;
+
+  /* Normal voulme fraction of the volatile ashes */
+  Xcor = 1/(1 - XsfH2O);
+  X5sH2OC = 0;
+  X5sCO2C = XsfCO2*Xcor;
+  X5sO2C = XsfO2*Xcor;
+  X5sSO2C = XsfSO2*Xcor;
+  X5sN2C = 1 - (X5sH2OC + X5sCO2C + X5sO2C + X5sSO2C);
+  rhonorm = ThermoSysPro.Properties.FlueGases.FlueGases_rho(1.01325e5, 273.15, X5sCO2C, X5sH2OC, X5sO2C, X5sSO2C);
+  FVN0 = (Qcendom/rhocend)/(Qsf/rhonorm);
+  0 = if ((FVN0 < 0) or (FVN0 > 0.1)) then (FVN - 0.001) else (FVN - FVN0);
+
+  annotation (Diagram(graphics={Polygon(
+          points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80},
+              {-40,80},{-40,40},{-80,20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}},
+          lineColor={0,0,255},
+          fillColor={175,175,175},
+          fillPattern=FillPattern.Solid)}),
+                            Icon(graphics={Polygon(
+          points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80},
+              {-40,80},{-40,40},{-80,20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}},
+          lineColor={0,0,255},
+          fillColor={175,175,175},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{66,60},{92,32}},
+          lineColor={28,108,200},
+          textString="Water inlet"),
+        Text(
+          extent={{14,106},{62,70}},
+          lineColor={238,46,47},
+          textString="Flue gases outlet"),
+        Text(
+          extent={{-98,-14},{-72,-42}},
+          lineColor={28,108,200},
+          textString="Fuel inlet"),
+        Text(
+          extent={{12,-70},{54,-114}},
+          lineColor={28,108,200},
+          textString="Primary air inlet"),
+        Text(
+          extent={{-100,100},{-54,52}},
+          lineColor={28,108,200},
+          textString="Secondary air inlet")}),
+    DymolaStoredErrors,
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end GridFurnace;
diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo
index e78a126e34c45e9bb750c427614ede3cb84b4b4b..a5e752e1421a8f799f4e447d83bfb02039c09dc0 100644
--- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo
+++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo
@@ -1,548 +1,548 @@
-within ThermoSysPro.Fluid.Combustion.CombustionChambers;
-model PostCombustionGas "Post-combustion"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real XClfuel=0 "Chloride mass fraction in fuel";
-  parameter Real XFfuel=0 "Fluoride mass fraction in fuel";
-  parameter Real Xrad=0 "Fraction of radiated power";
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Real HfCO2=3.275e+07 "CO2 formation specific enthalpy";
-  constant Real HfCO=9.201e+06 "CO formation specific enthalpy";
-  constant Real HfH2O=2.418e+08 "H2O steam formation specific enthalpy";
-  constant Units.SI.SpecificEnthalpy H0v=2501551.43 "Vaporisation specific enthalpy at 0°C";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-
-public
-  Units.SI.MassFlowRate Qef(start=10) "Flue gases mass flow rate at the inlet";
-  Units.SI.Temperature Tef(start=1700) "Flue gases temperature at the inlet";
-  Real XefCO2(start=0.5) "CO2 mass fraction at the flue gases inlet";
-  Real XefH2O(start=0) "H2O mass fraction at the flue gases inlet";
-  Real XefO2(start=0.5) "O2 mass fraction at the flue gases inlet";
-  Real XefSO2(start=0) "SO2 mass fraction at the flue gases inlet";
-  Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet";
-  Units.SI.Temperature Tsf(start=1700) "Flue gases temperature at the outlet";
-  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
-  Real XsfCO2(start=0.2) "CO2 mass fraction at the flue gases outlet";
-  Real XsfCO(start=0.1) "CO mass fraction at the flue gases outlet";
-  Real XsfH2O(start=0.2) "H2O mass fraction at the flue gases outlet";
-  Real XsfH2(start=0.1) "H2 mass fraction at the flue gases outlet";
-  Real XsfO2(start=0.1) "O2 mass fraction at the flue gases outlet";
-  Real XsfN2(start=0.2) "N2 mass fraction at the flue gases outlet";
-  Real XsfSO2(start=0.1) "SO2 mass fraction at the flue gases outlet";
-  Units.SI.MassFlowRate Qea(start=0.2) "Air mass flow rate at the inlet";
-  Units.SI.Temperature Tea(start=300) "Air temperature at the inlet";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Real XeaCO2(start=0.2) "CO2 mass fraction at the air inlet";
-  Real XeaH2O(start=0.2) "H20 mass fraction at the air inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
-  Real XeaSO2(start=0.2) "SO2 mass fraction at the air inlet";
-  Units.SI.MassFlowRate Qec(start=0.1) "Fuel mass flow rate at the inlet";
-  Units.SI.Temperature Tec(start=1700) "Fuel temperature at the inlet";
-  Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity";
-  Units.SI.SpecificEnergy LHVfuel(start=1e6) "Fuel LHV";
-  Real XH2Ofuel(start=0) "H2O mass fraction in fuel";
-  Real XCfuel(start=0.25) "C mass fraction in fuel";
-  Real XHfuel(start=0.75) "H mass fraction in fuel";
-  Real XOfuel(start=0) "O mass fraction in fuel";
-  Real XNfuel(start=0) "N mass fraction in fuel";
-  Real XSfuel(start=0) "S mass fraction in fuel";
-  Units.SI.Power Wrad(start=1e6) "Power radiated";
-  Units.SI.SpecificEnthalpy Hea(start=1e3) "Humid air specific enthalpy at the temperature of the input air";
-  Units.SI.SpecificEnthalpy Hef(start=1e3) "Flue gases specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qmel(start=10) "Mass flow rate of the air/flue gas mixture";
-  Real XmelO2(start=0.1) "O2 pass fraction in the air/flue gas mixture";
-  Real XmelCO2(start=0.1) "CO2 pass fraction in the air/flue gas mixture";
-  Real XmelH2O(start=0.1) "H2O pass fraction in the air/flue gas mixture";
-  Real XmelSO2(start=0.1) "SO2 pass fraction in the air/flue gas mixture";
-  Real XmelN2(start=0.1) "N2 pass fraction in the air/flue gas mixture";
-  Units.SI.SpecificEnthalpy Hmel(start=1e3) "Specific enthalpy of the air/flue gas mixture";
-  Units.SI.Temperature Tmel(start=500) "Temperature of the air/flue gas mixture";
-  Units.SI.SpecificEnthalpy Hwfuel(start=1e3) "Specific enthalpy of the water in fuel";
-  Units.SI.SpecificEnthalpy Hfuel(start=1e3) "Fuel specific enthalpy";
-  Units.SI.MassFlowRate Q1H2O(start=10) "H2O mass flow rate at the outlet of zone 1";
-  Units.SI.MassFlowRate Q1O2(start=10) "O2 mass flow rate at the outlet of zone 1";
-  Units.SI.MassFlowRate Q1N2(start=10) "N2 mass flow rate at the outlet of zone 1";
-  Units.SI.MassFlowRate Q1CO2(start=10) "CO2 mass flow rate at the outlet of zone 1";
-  Units.SI.MassFlowRate Q1SO2(start=10) "SO2 mass flow rate at the outlet of zone 1";
-  Real X1Cfuel(start=0.1) "C mass fraction in fuel after drying";
-  Real X1Hfuel(start=0.1) "H mass fraction in fuel after drying";
-  Real X1Ofuel(start=0.1) "O mass fraction in fuel after drying";
-  Real X1Nfuel(start=0.1) "N mass fraction in fuel after drying";
-  Real X1Clfuel(start=0.1) "Cl mass fraction in fuel after drying";
-  Real X1Ffuel(start=0.1) "F mass fraction in fuel after drying";
-  Real X1Sfuel(start=0.1) "S mass fraction in fuel after drying";
-  Units.SI.MassFlowRate Q1ec(start=10) "Fuel mass flow rate after drying";
-  Units.SI.SpecificEnergy LHVfuel1(start=1e6) "Fuel LHV after drying";
-  Units.SI.MassFlowRate Q2eO(start=10) "O2 mass flow rate at the inlet of zone 2";
-  Units.SI.MassFlowRate Q21HCl(start=10) "HCl mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q21HF(start=10) "HF mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q21SO2(start=10) "SO2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q21N2(start=10) "N2 mass flow rate at the outlet of zone 2";
-  Units.SI.MassFlowRate Q22CO(start=10) "CO mass flow rate produced in stage 2";
-  Units.SI.MassFlowRate Q22O2(start=10) "O2 mass flow rate left after stage 2";
-  Units.SI.MassFlowRate Q22H2(start=10) "H2 mass flow rate produced at stage 2";
-  Real etaO2(start=0.1) "O2 fraction at the end of the combustion";
-  Units.SI.MassFlowRate Q23CO2(start=10) "CO2 mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q23H2O(start=10) "H2O mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q23CO(start=10) "CO mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q23H2(start=10) "H2 mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q23O2(start=10) "O2 mass flow rate at the end of stage 3";
-  Units.SI.MassFlowRate Q24eg(start=10) "Mass flow rate of the volatile elements at the end of zone 2";
-  Units.SI.MassFlowRate Q24sg(start=10) "Mass flow rate of the volatile elements at the outlet of zone 2";
-  Real X24O2(start=0.1) "O2 mass fraction in flue gases of zone 4";
-  Real X24SO2(start=0.1) "SO2 mass fraction in flue gases of zone 4";
-  Real X24H2O(start=0.1) "H2O mass fraction in flue gases of zone 4";
-  Real X24CO(start=0.1) "CO mass fraction in flue gases of zone 4";
-  Real X24CO2(start=0.1) "CO2 mass fraction in flue gases of zone 4";
-  Real X24C(start=0.1) "C mass fraction in flue gases of zone 4";
-  Real X24N2(start=0.1) "N2 mass fraction in flue gases of zone 4";
-  Real Keq(start=0.1) "Equilibrium constant for stage 4";
-  Real Mm4e(start=0.1) "Molar mass of the gases entering stage 4";
-  Real Mm4s(start=0.1) "Molar mass of the gases leaving stage 4";
-  Real X24eCOvol(start=0.1) "CO volume fraction before stage 4";
-  Real X24eCO2vol(start=0.1) "CO2 volume fraction before stage 4";
-  Real X24eH2vol(start=0.1) "H2 volume fraction before stage 4";
-  Real X24eH2Ovol(start=0.1) "H2 volume fraction before stage 4";
-  Real X24eN2vol(start=0.1) "N2 volume fraction before stage 4";
-  Real X24eHClvol(start=0.1) "HCl volume fraction before stage 4";
-  Real X24eHFvol(start=0.1) "HF volume fraction before stage 4";
-  Real X24eSO2vol(start=0.1) "SO2 volume fraction before stage 4";
-  Real X24sCOvol(start=0.1) "CO volume fraction after stage 4";
-  Real X24sCO2vol(start=0.1) "CO2 volume fraction after stage 4";
-  Real X24sH2vol(start=0.1) "H2 volume fraction after stage 4";
-  Real X24sH2Ovol(start=0.1) "H2O volume fraction after stage 4";
-  Real AVE(start=0.1) "Progress of stage 4";
-  Units.SI.MassFlowRate Q24H2O(start=10) "H2O mass flow rate at the ned of stage 4";
-  Units.SI.MassFlowRate Q24H2(start=10) "H2 mass flow rate at the ned of stage 4";
-  Units.SI.MassFlowRate Q24CO(start=10) "CO mass flow rate at the ned of stage 4";
-  Units.SI.MassFlowRate Q24CO2(start=10) "CO2 mass flow rate at the ned of stage 4";
-  Real PciCvol(start=1e6) "Power released by the combustion";
-  Units.SI.Power P2g(start=1e6) "Power released by the combustion";
-  Real XsfC(start=0.1) "C mass fraction in the flue gases";
-  Units.SI.Power P2t(start=1e6) "Total flue gases power at the outlet";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
-  Real Keq0(start=0.1) "Intermediate variable for the compuation of Keq";
-  Real delta(start=0.1) "Intermediate variable to compute the progress of stage 4";
-  FluidType fluids[4] "Fluids mixing in volume";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid mixture specific enthalpy";
-  Units.SI.Power Ja "Thermal power diffusion from inlet Ca";
-  Units.SI.Power Jfg1 "Thermal power diffusion from inlet Cfg1";
-  Units.SI.Power Jfg2 "Thermal power diffusion from outlet Cfg2";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_a "Diffusion conductance for inlet Ca";
-  Units.SI.MassFlowRate gamma_fg1 "Diffusion conductance for inlet Cfg1";
-  Units.SI.MassFlowRate gamma_fg2 "Diffusion conductance for outlet Cfg2";
-  Real ra "Value of r(Q/gamma) for inlet Ca";
-  Real rfg1 "Value of r(Q/gamma) for inlet Cfg1";
-  Real rfg2 "Value of r(Q/gamma) for outlet Cfg2";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet"
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 "Flue gases outlet"
-    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 "Flue gases inlet"
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ca.ftype;
-  fluids[3] = Cfg1.ftype;
-  fluids[4] = Cfg2.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "PostCombustionGas: fluids mixing in volume are not compatible with each other");
-
-  /* Fuel inlet */
-  Qec = Cfuel.Q;
-  Tec = Cfuel.T;
-  LHVfuel = Cfuel.LHV;
-  XH2Ofuel = Cfuel.hum;
-  XCfuel = Cfuel.Xc;
-  XHfuel = Cfuel.Xh;
-  XOfuel = Cfuel.Xo;
-  XNfuel = Cfuel.Xn;
-  XSfuel = Cfuel.Xs;
-  Cpfuel = Cfuel.cp;
-
-  /* Air inlet */
-  Qea = Ca.Q;
-  Pea = Ca.P;
-  Pea = 1.01e+5;
-  Hea = Ca.h;
-
-  XeaCO2 = Ca.Xco2;
-  XeaH2O = Ca.Xh2o;
-  XeaO2 = Ca.Xo2;
-  XeaSO2 = Ca.Xso2;
-
-  /* Flue gases inlet */
-  Qef = Cfg1.Q;
-  Hef = Cfg1.h;
-  Cfg1.P = Cfg2.P;
-
-  XefCO2 = Cfg1.Xco2;
-  XefH2O = Cfg1.Xh2o;
-  XefO2 = Cfg1.Xo2;
-  XefSO2 = Cfg1.Xso2;
-
-  /* Flue gases outlet */
-  Qsf = Cfg2.Q;
-  Hsf = Cfg2.h;
-  Psf = Cfg2.P;
-
-  XsfCO2 = Cfg2.Xco2;
-  XsfH2O = Cfg2.Xh2o;
-  XsfO2 = Cfg2.Xo2;
-  XsfSO2 = Cfg2.Xso2;
-
-  // 1st zone : Mixing air - flue gases - water in fuel
-  // --------------------------------------------------
-
-  /* Humid air specific enthalpy at the temperature of the input air */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-
-  /* Flue gases specific enthalpy at the inlet */
-  Hef = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tef, XefCO2, XefH2O, XefO2, XefSO2);
-
-  // Air - flue gases mixing
-  // - - - - - - - - - - - -
-
-  /* Mass balance equation */
-  0 = Qea + Qef - Qmel;
-
-  /* Energy balance equation */
-  0 = Qea*Hea + Hef*Qef - Qmel*Hmel + J;
-
-  Ca.h_vol_2 = h;
-  Cfg1.h_vol_2 = h;
-  Cfg2.h_vol_1 = h;
-
-  Cfg2.ftype = ftype;
-
-  /* Mixture composition */
-  XmelO2 = (XefO2*Qef + XeaO2*Qea)/Qmel;
-  XmelCO2 = (XefCO2*Qef)/Qmel;
-  XmelH2O = (XefH2O*Qef + XeaH2O*Qea)/Qmel;
-  XmelSO2 = (XefSO2*Qef)/Qmel;
-  XmelN2 = 1 - XmelO2 - XmelCO2 - XmelH2O - XmelSO2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cfg2.h = ThermoSysPro.Functions.SmoothCond(Cfg2.Q/gamma_fg2, Cfg2.h_vol_1, Cfg2.h_vol_2, 1);
-  else
-    Cfg2.h = if (Cfg2.Q > 0) then Cfg2.h_vol_1 else Cfg2.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0;
-    rfg1 = if Cfg1.diff_on_1 then exp(-0.033*(Cfg1.Q*Cfg1.diff_res_1)^2) else 0;
-    rfg2 = if Cfg2.diff_on_2 then exp(-0.033*(Cfg2.Q*Cfg2.diff_res_2)^2) else 0;
-
-    gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0;
-    gamma_fg1 = if Cfg1.diff_on_1 then 1/Cfg1.diff_res_1 else gamma0;
-    gamma_fg2 = if Cfg2.diff_on_2 then 1/Cfg2.diff_res_2 else gamma0;
-
-    Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0;
-    Jfg1 = if Cfg1.diff_on_1 then rfg1*gamma_fg1*(Cfg1.h_vol_1 - Cfg1.h_vol_2) else 0;
-    Jfg2 = if Cfg2.diff_on_2 then rfg2*gamma_fg2*(Cfg2.h_vol_2 - Cfg2.h_vol_1) else 0;
-  else
-    ra = 0;
-    rfg1 = 0;
-    rfg2 = 0;
-
-    gamma_a = gamma0;
-    gamma_fg1 = gamma0;
-    gamma_fg2 = gamma0;
-
-    Ja = 0;
-    Jfg1 = 0;
-    Jfg2 = 0;
-  end if;
-
-  J = Ja + Jfg1 + Jfg2;
-
-  Ca.diff_res_2 = 0;
-  Cfg1.diff_res_2 = 0;
-  Cfg2.diff_res_1 = 0;
-
-  Ca.diff_on_2 = diffusion;
-  Cfg1.diff_on_2 = diffusion;
-  Cfg2.diff_on_1 = diffusion;
-
-  /* Mixture temperature */
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  Hmel = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tmel, XmelCO2, XmelH2O, XmelO2, XmelSO2);
-
-  // Fuel
-  // - -
-
-  /* Specific enthalpy of the water in fuel */
-  pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pea, Tec, mode);
-  Hwfuel = pro1.h;
-
-  /* Fuel specific enthalpy */
-  Hfuel = Cpfuel*(Tec - 273.16);
-
-  // Mass flow rates leaving zone 1
-  // - - - - - - - - - - - - - - - -
-  Q1H2O = Qec*XH2Ofuel + Qmel*XmelH2O;
-  Q1O2 = Qmel*XmelO2;
-  Q1N2 = Qmel*XmelN2;
-  Q1CO2 = Qmel*XmelCO2;
-  Q1SO2 = Qmel*XmelSO2;
-
-  /* After fuel drying */
-  Q1ec = Qec*(1 - XH2Ofuel);
-  LHVfuel1 = LHVfuel*(1 - XH2Ofuel);
-  X1Cfuel = XCfuel*(1 - XH2Ofuel);
-  X1Hfuel = XHfuel*(1 - XH2Ofuel);
-  X1Ofuel = XOfuel*(1 - XH2Ofuel);
-  X1Nfuel = XNfuel*(1 - XH2Ofuel);
-  X1Clfuel = XClfuel*(1 - XH2Ofuel);
-  X1Ffuel = XFfuel*(1 - XH2Ofuel);
-  X1Sfuel = XSfuel*(1 - XH2Ofuel);
-
-  // 2nd zone : Combustion
-  // ---------------------
-
-  // Stage 1 : Combustion of trace elements
-  // - - - - - - - - - - - - - - - - - - - -
-
-  /* Oxygen mass flow rate */
-  Q2eO = Q1ec*X1Ofuel + Qmel*XmelO2;
-
-  /* Other exiting mass flow rates */
-  Q21HCl = 36.5/35.5*Q1ec*X1Clfuel;
-  Q21HF = 20/19*Q1ec*X1Ffuel;
-  Q21SO2 = 64.06/32.06*Q1ec*X1Sfuel + Qmel*XmelSO2;
-  Q21N2 = Q1N2 + Q1ec*X1Nfuel;
-
-  // Etape 2 : CH4 oxydation into CO : CH4+1/2O2=>2H2+CO
-  // - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-  /* Mass flow rate of CO produced */
-  Q22CO = 28/12*Q1ec*X1Cfuel;
-
-  /* Oxygen mass flow rate */
-  Q22O2 = Q2eO - Q1ec*(X1Sfuel/32.06*32.06 + 32/12/2*X1Cfuel);
-
-  /* Mass flow rate of H2 produced */
-  Q22H2 = Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel);
-
-  /* O2 fraction */
-  etaO2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2);
-
-  if (etaO2 < 1e-6) then
-    //---------------
-    // Lack of oxygen
-    //---------------
-
-    // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O
-    // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    Q23CO2 = Q1CO2 + 2/3*Q22O2/32*44;
-    Q23H2O = Qmel*XmelH2O + 4/3*Q22O2/32*18 + Qec*XH2Ofuel;
-    Q23CO = Q22CO - 2/3*Q22O2/32*28;
-    Q23H2 = Q22H2 - 4/3*Q22O2/32*2;
-    Q23O2 = 0;
-
-    // Stage 4 :Equilibrium reaction CO/CO2
-    // - - - - - - - - - - - - - - - - - - -
-
-    /* Total mass flow rate of the volatile elements in zone 2 */
-    Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2;
-
-    /* Composition */
-    X24O2 = Q23O2/Q24eg;
-    X24SO2 = Q21SO2/Q24eg;
-    X24H2O = Q23H2O/Q24eg;
-    X24CO = Q23CO/Q24eg;
-    X24CO2 = Q23CO2/Q24eg;
-    X24C = X24CO + X24CO2;
-    X24N2 = 1 - (X24O2 + X24SO2 + X24H2O + X24CO + X24CO2);
-
-    /* Equilibrium constant */
-    Keq0 = 0.0042*(Tmel - 273.15) - 2.4555;
-    0 = if (Keq0 > 0) then (Keq - Keq0) else Keq;
-
-    /* Molar mass of the incoming gases */
-    Mm4e = (Q23CO/28 + Q23H2O/18 + Q23CO2/44 + Q23H2/2 + Q21N2/28)/Q24eg;
-
-    /* Volume fractions at the inlet of stage 4 */
-    X24eCOvol = Q23CO/Q24eg/Mm4e/28;
-    X24eCO2vol = Q23CO2/Q24eg/Mm4e/44;
-    X24eH2vol = Q23H2/Q24eg/Mm4e/2;
-    X24eH2Ovol = Q23H2O/Q24eg/Mm4e/18;
-    X24eN2vol = Q21N2/Q24eg/Mm4e/28;
-    X24eHClvol = Q21HCl/Q24eg/Mm4e/36.5;
-    X24eHFvol = Q21HF/Q24eg/Mm4e/20;
-    X24eSO2vol = Q21SO2/Q24eg/Mm4e/64.06;
-
-    /* Reaction progress */
-    delta = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol))^2 - 4*(Keq - 1)*(Keq*X24eCO2vol*X24eH2vol - X24eCOvol*X24eH2Ovol);
-    AVE = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol) - (delta)^0.5)/2/(Keq - 1);
-
-    /* Volume fractions at the outlet of stage 4 */
-    X24sCOvol = X24eCOvol + AVE;
-    X24sCO2vol = X24eCO2vol - AVE;
-    X24sH2vol = X24eH2vol - AVE;
-    X24sH2Ovol = X24eH2Ovol + AVE;
-
-    /* Molar mass of the outgoing gases */
-    Mm4s = X24sCOvol*28 + X24sCO2vol*44 + X24sH2vol*2 + X24sH2Ovol*18 + X24eN2vol*28;
-
-    /* Mass flow rates */
-    Q24CO = X24sCOvol*28/Mm4s*Q24eg;
-    Q24CO2 = X24sCO2vol*44/Mm4s*Q24eg;
-    Q24H2O = X24sH2Ovol*18/Mm4s*Q24eg;
-    Q24H2 = X24sH2vol*2/Mm4s*Q24eg;
-
-    Q24sg = Q24H2 + Q21HCl + Q21HF + Q21SO2 + Q24H2O + Q24CO + Q21N2 + Q23O2 + Q24CO2;
-  else
-    //-----------------
-    // Excess of oxygen
-    //-----------------
-
-    // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O
-    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    Q23CO2 = Q1CO2 + Q1ec*X1Cfuel/12*44;
-    Q23H2O = Qmel*XmelH2O+Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel)*18/2 + Qec*XH2Ofuel;
-    Q23CO = 0;
-    Q23H2 = 0;
-    Q23O2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2);
-
-    // Stage 4 : Eaquilibrium reaction CO/CO2
-    // - - - - - - - - - - - - - - - - - - -
-    Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2;
-    X24O2 = 0;
-    X24SO2 = 0;
-    X24H2O = 0;
-    X24CO = 0;
-    X24CO2 = 0;
-    X24C = 0;
-    X24N2 = 0;
-    Keq0 = 0;
-    0 = if (Keq0 > 0) then (Keq - Keq0) else Keq;
-    Mm4e = 0;
-    X24eCOvol = 0;
-    X24eCO2vol = 0;
-    X24eH2vol = 0;
-    X24eH2Ovol = 0;
-    X24eN2vol = 0;
-    X24eHClvol = 0;
-    X24eHFvol = 0;
-    X24eSO2vol = 0;
-    delta = 0;
-    AVE = 0;
-    X24sCOvol = 0;
-    X24sCO2vol = 0;
-    X24sH2vol = 0;
-    X24sH2Ovol = 0;
-    Mm4s = 0;
-    Q24CO = Q23CO;
-    Q24CO2 = Q23CO2;
-    Q24H2O = Q23H2O;
-    Q24H2 = Q23H2;
-    Q24sg = Q24eg;
-  end if;
-
-  /* Mass flow rate at the outlet */
-  Qsf = Q24sg;
-
-  /* Power released by the combustion */
-  0 = if (Q1ec >= 1e-6) then PciCvol - (Q24CO/28/Q1ec*12*(HfCO2 - HfCO) + Q24H2/2*(HfH2O)/Q1ec) else PciCvol;
-
-  /* Power released by the combustion in zone 2 */
-  P2g = (LHVfuel1 - PciCvol)*Q1ec;
-
-  /* Composition at the outlet */
-  XsfO2 = Q23O2/Qsf;
-  XsfSO2 = Q21SO2/Qsf;
-  XsfH2O = Q24H2O/Qsf;
-  XsfH2 = Q24H2/Qsf;
-  XsfCO = Q24CO/Qsf;
-  XsfCO2 = Q24CO2/Qsf;
-  XsfC = XsfCO2 + XsfCO;
-  XsfN2 = 1 - (XsfO2 + XsfSO2 + XsfH2O + XsfCO2 + XsfCO);
-
-  /* Power accumukated by the gases in zone 2 */
-  P2t = ((Q24H2O - (Qmel*XmelH2O))*H0v + Qmel*Hmel + Q1ec*Hfuel + P2g)*(1 - Xrad);
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  P2t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfC, XsfH2O, XsfO2, XsfSO2);
-  P2t/Qsf = Hsf;
-
-  Wrad = P2t*Xrad;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
-              -44},{-20,-60},{-20,62}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.CrossDiag),
-        Line(points={{-20,80},{-20,-80}}, color={0,0,255})}),
-                                       Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
-              -44},{-20,-60},{-20,62}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.CrossDiag),
-        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
-        Text(
-          extent={{-92,100},{-66,76}},
-          lineColor={28,108,200},
-          textString="Air inlet"),
-        Text(
-          extent={{52,44},{100,8}},
-          lineColor={238,46,47},
-          textString="Flue gases outlet"),
-        Text(
-          extent={{-12,-78},{20,-108}},
-          lineColor={28,108,200},
-          textString="Fuel inlet"),
-        Text(
-          extent={{-100,44},{-52,8}},
-          lineColor={238,46,47},
-          textString="Flue gases inlet")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end PostCombustionGas;
+within ThermoSysPro.Fluid.Combustion.CombustionChambers;
+model PostCombustionGas "Post-combustion"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real XClfuel=0 "Chloride mass fraction in fuel";
+  parameter Real XFfuel=0 "Fluoride mass fraction in fuel";
+  parameter Real Xrad=0 "Fraction of radiated power";
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Real HfCO2=3.275e+07 "CO2 formation specific enthalpy";
+  constant Real HfCO=9.201e+06 "CO formation specific enthalpy";
+  constant Real HfH2O=2.418e+08 "H2O steam formation specific enthalpy";
+  constant Units.SI.SpecificEnthalpy H0v=2501551.43 "Vaporisation specific enthalpy at 0°C";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+
+public
+  Units.SI.MassFlowRate Qef(start=10) "Flue gases mass flow rate at the inlet";
+  Units.SI.Temperature Tef(start=1700) "Flue gases temperature at the inlet";
+  Real XefCO2(start=0.5) "CO2 mass fraction at the flue gases inlet";
+  Real XefH2O(start=0) "H2O mass fraction at the flue gases inlet";
+  Real XefO2(start=0.5) "O2 mass fraction at the flue gases inlet";
+  Real XefSO2(start=0) "SO2 mass fraction at the flue gases inlet";
+  Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet";
+  Units.SI.Temperature Tsf(start=1700) "Flue gases temperature at the outlet";
+  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
+  Real XsfCO2(start=0.2) "CO2 mass fraction at the flue gases outlet";
+  Real XsfCO(start=0.1) "CO mass fraction at the flue gases outlet";
+  Real XsfH2O(start=0.2) "H2O mass fraction at the flue gases outlet";
+  Real XsfH2(start=0.1) "H2 mass fraction at the flue gases outlet";
+  Real XsfO2(start=0.1) "O2 mass fraction at the flue gases outlet";
+  Real XsfN2(start=0.2) "N2 mass fraction at the flue gases outlet";
+  Real XsfSO2(start=0.1) "SO2 mass fraction at the flue gases outlet";
+  Units.SI.MassFlowRate Qea(start=0.2) "Air mass flow rate at the inlet";
+  Units.SI.Temperature Tea(start=300) "Air temperature at the inlet";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Real XeaCO2(start=0.2) "CO2 mass fraction at the air inlet";
+  Real XeaH2O(start=0.2) "H20 mass fraction at the air inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the air inlet";
+  Real XeaSO2(start=0.2) "SO2 mass fraction at the air inlet";
+  Units.SI.MassFlowRate Qec(start=0.1) "Fuel mass flow rate at the inlet";
+  Units.SI.Temperature Tec(start=1700) "Fuel temperature at the inlet";
+  Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity";
+  Units.SI.SpecificEnergy LHVfuel(start=1e6) "Fuel LHV";
+  Real XH2Ofuel(start=0) "H2O mass fraction in fuel";
+  Real XCfuel(start=0.25) "C mass fraction in fuel";
+  Real XHfuel(start=0.75) "H mass fraction in fuel";
+  Real XOfuel(start=0) "O mass fraction in fuel";
+  Real XNfuel(start=0) "N mass fraction in fuel";
+  Real XSfuel(start=0) "S mass fraction in fuel";
+  Units.SI.Power Wrad(start=1e6) "Power radiated";
+  Units.SI.SpecificEnthalpy Hea(start=1e3) "Humid air specific enthalpy at the temperature of the input air";
+  Units.SI.SpecificEnthalpy Hef(start=1e3) "Flue gases specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qmel(start=10) "Mass flow rate of the air/flue gas mixture";
+  Real XmelO2(start=0.1) "O2 pass fraction in the air/flue gas mixture";
+  Real XmelCO2(start=0.1) "CO2 pass fraction in the air/flue gas mixture";
+  Real XmelH2O(start=0.1) "H2O pass fraction in the air/flue gas mixture";
+  Real XmelSO2(start=0.1) "SO2 pass fraction in the air/flue gas mixture";
+  Real XmelN2(start=0.1) "N2 pass fraction in the air/flue gas mixture";
+  Units.SI.SpecificEnthalpy Hmel(start=1e3) "Specific enthalpy of the air/flue gas mixture";
+  Units.SI.Temperature Tmel(start=500) "Temperature of the air/flue gas mixture";
+  Units.SI.SpecificEnthalpy Hwfuel(start=1e3) "Specific enthalpy of the water in fuel";
+  Units.SI.SpecificEnthalpy Hfuel(start=1e3) "Fuel specific enthalpy";
+  Units.SI.MassFlowRate Q1H2O(start=10) "H2O mass flow rate at the outlet of zone 1";
+  Units.SI.MassFlowRate Q1O2(start=10) "O2 mass flow rate at the outlet of zone 1";
+  Units.SI.MassFlowRate Q1N2(start=10) "N2 mass flow rate at the outlet of zone 1";
+  Units.SI.MassFlowRate Q1CO2(start=10) "CO2 mass flow rate at the outlet of zone 1";
+  Units.SI.MassFlowRate Q1SO2(start=10) "SO2 mass flow rate at the outlet of zone 1";
+  Real X1Cfuel(start=0.1) "C mass fraction in fuel after drying";
+  Real X1Hfuel(start=0.1) "H mass fraction in fuel after drying";
+  Real X1Ofuel(start=0.1) "O mass fraction in fuel after drying";
+  Real X1Nfuel(start=0.1) "N mass fraction in fuel after drying";
+  Real X1Clfuel(start=0.1) "Cl mass fraction in fuel after drying";
+  Real X1Ffuel(start=0.1) "F mass fraction in fuel after drying";
+  Real X1Sfuel(start=0.1) "S mass fraction in fuel after drying";
+  Units.SI.MassFlowRate Q1ec(start=10) "Fuel mass flow rate after drying";
+  Units.SI.SpecificEnergy LHVfuel1(start=1e6) "Fuel LHV after drying";
+  Units.SI.MassFlowRate Q2eO(start=10) "O2 mass flow rate at the inlet of zone 2";
+  Units.SI.MassFlowRate Q21HCl(start=10) "HCl mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q21HF(start=10) "HF mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q21SO2(start=10) "SO2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q21N2(start=10) "N2 mass flow rate at the outlet of zone 2";
+  Units.SI.MassFlowRate Q22CO(start=10) "CO mass flow rate produced in stage 2";
+  Units.SI.MassFlowRate Q22O2(start=10) "O2 mass flow rate left after stage 2";
+  Units.SI.MassFlowRate Q22H2(start=10) "H2 mass flow rate produced at stage 2";
+  Real etaO2(start=0.1) "O2 fraction at the end of the combustion";
+  Units.SI.MassFlowRate Q23CO2(start=10) "CO2 mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q23H2O(start=10) "H2O mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q23CO(start=10) "CO mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q23H2(start=10) "H2 mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q23O2(start=10) "O2 mass flow rate at the end of stage 3";
+  Units.SI.MassFlowRate Q24eg(start=10) "Mass flow rate of the volatile elements at the end of zone 2";
+  Units.SI.MassFlowRate Q24sg(start=10) "Mass flow rate of the volatile elements at the outlet of zone 2";
+  Real X24O2(start=0.1) "O2 mass fraction in flue gases of zone 4";
+  Real X24SO2(start=0.1) "SO2 mass fraction in flue gases of zone 4";
+  Real X24H2O(start=0.1) "H2O mass fraction in flue gases of zone 4";
+  Real X24CO(start=0.1) "CO mass fraction in flue gases of zone 4";
+  Real X24CO2(start=0.1) "CO2 mass fraction in flue gases of zone 4";
+  Real X24C(start=0.1) "C mass fraction in flue gases of zone 4";
+  Real X24N2(start=0.1) "N2 mass fraction in flue gases of zone 4";
+  Real Keq(start=0.1) "Equilibrium constant for stage 4";
+  Real Mm4e(start=0.1) "Molar mass of the gases entering stage 4";
+  Real Mm4s(start=0.1) "Molar mass of the gases leaving stage 4";
+  Real X24eCOvol(start=0.1) "CO volume fraction before stage 4";
+  Real X24eCO2vol(start=0.1) "CO2 volume fraction before stage 4";
+  Real X24eH2vol(start=0.1) "H2 volume fraction before stage 4";
+  Real X24eH2Ovol(start=0.1) "H2 volume fraction before stage 4";
+  Real X24eN2vol(start=0.1) "N2 volume fraction before stage 4";
+  Real X24eHClvol(start=0.1) "HCl volume fraction before stage 4";
+  Real X24eHFvol(start=0.1) "HF volume fraction before stage 4";
+  Real X24eSO2vol(start=0.1) "SO2 volume fraction before stage 4";
+  Real X24sCOvol(start=0.1) "CO volume fraction after stage 4";
+  Real X24sCO2vol(start=0.1) "CO2 volume fraction after stage 4";
+  Real X24sH2vol(start=0.1) "H2 volume fraction after stage 4";
+  Real X24sH2Ovol(start=0.1) "H2O volume fraction after stage 4";
+  Real AVE(start=0.1) "Progress of stage 4";
+  Units.SI.MassFlowRate Q24H2O(start=10) "H2O mass flow rate at the ned of stage 4";
+  Units.SI.MassFlowRate Q24H2(start=10) "H2 mass flow rate at the ned of stage 4";
+  Units.SI.MassFlowRate Q24CO(start=10) "CO mass flow rate at the ned of stage 4";
+  Units.SI.MassFlowRate Q24CO2(start=10) "CO2 mass flow rate at the ned of stage 4";
+  Real PciCvol(start=1e6) "Power released by the combustion";
+  Units.SI.Power P2g(start=1e6) "Power released by the combustion";
+  Real XsfC(start=0.1) "C mass fraction in the flue gases";
+  Units.SI.Power P2t(start=1e6) "Total flue gases power at the outlet";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet";
+  Real Keq0(start=0.1) "Intermediate variable for the compuation of Keq";
+  Real delta(start=0.1) "Intermediate variable to compute the progress of stage 4";
+  FluidType fluids[4] "Fluids mixing in volume";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid mixture specific enthalpy";
+  Units.SI.Power Ja "Thermal power diffusion from inlet Ca";
+  Units.SI.Power Jfg1 "Thermal power diffusion from inlet Cfg1";
+  Units.SI.Power Jfg2 "Thermal power diffusion from outlet Cfg2";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_a "Diffusion conductance for inlet Ca";
+  Units.SI.MassFlowRate gamma_fg1 "Diffusion conductance for inlet Cfg1";
+  Units.SI.MassFlowRate gamma_fg2 "Diffusion conductance for outlet Cfg2";
+  Real ra "Value of r(Q/gamma) for inlet Ca";
+  Real rfg1 "Value of r(Q/gamma) for inlet Cfg1";
+  Real rfg2 "Value of r(Q/gamma) for outlet Cfg2";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet"
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 "Flue gases outlet"
+    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 "Flue gases inlet"
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ca.ftype;
+  fluids[3] = Cfg1.ftype;
+  fluids[4] = Cfg2.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "PostCombustionGas: fluids mixing in volume are not compatible with each other");
+
+  /* Fuel inlet */
+  Qec = Cfuel.Q;
+  Tec = Cfuel.T;
+  LHVfuel = Cfuel.LHV;
+  XH2Ofuel = Cfuel.hum;
+  XCfuel = Cfuel.Xc;
+  XHfuel = Cfuel.Xh;
+  XOfuel = Cfuel.Xo;
+  XNfuel = Cfuel.Xn;
+  XSfuel = Cfuel.Xs;
+  Cpfuel = Cfuel.cp;
+
+  /* Air inlet */
+  Qea = Ca.Q;
+  Pea = Ca.P;
+  Pea = 1.01e+5;
+  Hea = Ca.h;
+
+  XeaCO2 = Ca.Xco2;
+  XeaH2O = Ca.Xh2o;
+  XeaO2 = Ca.Xo2;
+  XeaSO2 = Ca.Xso2;
+
+  /* Flue gases inlet */
+  Qef = Cfg1.Q;
+  Hef = Cfg1.h;
+  Cfg1.P = Cfg2.P;
+
+  XefCO2 = Cfg1.Xco2;
+  XefH2O = Cfg1.Xh2o;
+  XefO2 = Cfg1.Xo2;
+  XefSO2 = Cfg1.Xso2;
+
+  /* Flue gases outlet */
+  Qsf = Cfg2.Q;
+  Hsf = Cfg2.h;
+  Psf = Cfg2.P;
+
+  XsfCO2 = Cfg2.Xco2;
+  XsfH2O = Cfg2.Xh2o;
+  XsfO2 = Cfg2.Xo2;
+  XsfSO2 = Cfg2.Xso2;
+
+  // 1st zone : Mixing air - flue gases - water in fuel
+  // --------------------------------------------------
+
+  /* Humid air specific enthalpy at the temperature of the input air */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+
+  /* Flue gases specific enthalpy at the inlet */
+  Hef = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tef, XefCO2, XefH2O, XefO2, XefSO2);
+
+  // Air - flue gases mixing
+  // - - - - - - - - - - - -
+
+  /* Mass balance equation */
+  0 = Qea + Qef - Qmel;
+
+  /* Energy balance equation */
+  0 = Qea*Hea + Hef*Qef - Qmel*Hmel + J;
+
+  Ca.h_vol_2 = h;
+  Cfg1.h_vol_2 = h;
+  Cfg2.h_vol_1 = h;
+
+  Cfg2.ftype = ftype;
+
+  /* Mixture composition */
+  XmelO2 = (XefO2*Qef + XeaO2*Qea)/Qmel;
+  XmelCO2 = (XefCO2*Qef)/Qmel;
+  XmelH2O = (XefH2O*Qef + XeaH2O*Qea)/Qmel;
+  XmelSO2 = (XefSO2*Qef)/Qmel;
+  XmelN2 = 1 - XmelO2 - XmelCO2 - XmelH2O - XmelSO2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cfg2.h = ThermoSysPro.Functions.SmoothCond(Cfg2.Q/gamma_fg2, Cfg2.h_vol_1, Cfg2.h_vol_2, 1);
+  else
+    Cfg2.h = if (Cfg2.Q > 0) then Cfg2.h_vol_1 else Cfg2.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0;
+    rfg1 = if Cfg1.diff_on_1 then exp(-0.033*(Cfg1.Q*Cfg1.diff_res_1)^2) else 0;
+    rfg2 = if Cfg2.diff_on_2 then exp(-0.033*(Cfg2.Q*Cfg2.diff_res_2)^2) else 0;
+
+    gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0;
+    gamma_fg1 = if Cfg1.diff_on_1 then 1/Cfg1.diff_res_1 else gamma0;
+    gamma_fg2 = if Cfg2.diff_on_2 then 1/Cfg2.diff_res_2 else gamma0;
+
+    Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0;
+    Jfg1 = if Cfg1.diff_on_1 then rfg1*gamma_fg1*(Cfg1.h_vol_1 - Cfg1.h_vol_2) else 0;
+    Jfg2 = if Cfg2.diff_on_2 then rfg2*gamma_fg2*(Cfg2.h_vol_2 - Cfg2.h_vol_1) else 0;
+  else
+    ra = 0;
+    rfg1 = 0;
+    rfg2 = 0;
+
+    gamma_a = gamma0;
+    gamma_fg1 = gamma0;
+    gamma_fg2 = gamma0;
+
+    Ja = 0;
+    Jfg1 = 0;
+    Jfg2 = 0;
+  end if;
+
+  J = Ja + Jfg1 + Jfg2;
+
+  Ca.diff_res_2 = 0;
+  Cfg1.diff_res_2 = 0;
+  Cfg2.diff_res_1 = 0;
+
+  Ca.diff_on_2 = diffusion;
+  Cfg1.diff_on_2 = diffusion;
+  Cfg2.diff_on_1 = diffusion;
+
+  /* Mixture temperature */
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  Hmel = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tmel, XmelCO2, XmelH2O, XmelO2, XmelSO2);
+
+  // Fuel
+  // - -
+
+  /* Specific enthalpy of the water in fuel */
+  pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pea, Tec, mode);
+  Hwfuel = pro1.h;
+
+  /* Fuel specific enthalpy */
+  Hfuel = Cpfuel*(Tec - 273.16);
+
+  // Mass flow rates leaving zone 1
+  // - - - - - - - - - - - - - - - -
+  Q1H2O = Qec*XH2Ofuel + Qmel*XmelH2O;
+  Q1O2 = Qmel*XmelO2;
+  Q1N2 = Qmel*XmelN2;
+  Q1CO2 = Qmel*XmelCO2;
+  Q1SO2 = Qmel*XmelSO2;
+
+  /* After fuel drying */
+  Q1ec = Qec*(1 - XH2Ofuel);
+  LHVfuel1 = LHVfuel*(1 - XH2Ofuel);
+  X1Cfuel = XCfuel*(1 - XH2Ofuel);
+  X1Hfuel = XHfuel*(1 - XH2Ofuel);
+  X1Ofuel = XOfuel*(1 - XH2Ofuel);
+  X1Nfuel = XNfuel*(1 - XH2Ofuel);
+  X1Clfuel = XClfuel*(1 - XH2Ofuel);
+  X1Ffuel = XFfuel*(1 - XH2Ofuel);
+  X1Sfuel = XSfuel*(1 - XH2Ofuel);
+
+  // 2nd zone : Combustion
+  // ---------------------
+
+  // Stage 1 : Combustion of trace elements
+  // - - - - - - - - - - - - - - - - - - - -
+
+  /* Oxygen mass flow rate */
+  Q2eO = Q1ec*X1Ofuel + Qmel*XmelO2;
+
+  /* Other exiting mass flow rates */
+  Q21HCl = 36.5/35.5*Q1ec*X1Clfuel;
+  Q21HF = 20/19*Q1ec*X1Ffuel;
+  Q21SO2 = 64.06/32.06*Q1ec*X1Sfuel + Qmel*XmelSO2;
+  Q21N2 = Q1N2 + Q1ec*X1Nfuel;
+
+  // Etape 2 : CH4 oxydation into CO : CH4+1/2O2=>2H2+CO
+  // - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+  /* Mass flow rate of CO produced */
+  Q22CO = 28/12*Q1ec*X1Cfuel;
+
+  /* Oxygen mass flow rate */
+  Q22O2 = Q2eO - Q1ec*(X1Sfuel/32.06*32.06 + 32/12/2*X1Cfuel);
+
+  /* Mass flow rate of H2 produced */
+  Q22H2 = Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel);
+
+  /* O2 fraction */
+  etaO2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2);
+
+  if (etaO2 < 1e-6) then
+    //---------------
+    // Lack of oxygen
+    //---------------
+
+    // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O
+    // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    Q23CO2 = Q1CO2 + 2/3*Q22O2/32*44;
+    Q23H2O = Qmel*XmelH2O + 4/3*Q22O2/32*18 + Qec*XH2Ofuel;
+    Q23CO = Q22CO - 2/3*Q22O2/32*28;
+    Q23H2 = Q22H2 - 4/3*Q22O2/32*2;
+    Q23O2 = 0;
+
+    // Stage 4 :Equilibrium reaction CO/CO2
+    // - - - - - - - - - - - - - - - - - - -
+
+    /* Total mass flow rate of the volatile elements in zone 2 */
+    Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2;
+
+    /* Composition */
+    X24O2 = Q23O2/Q24eg;
+    X24SO2 = Q21SO2/Q24eg;
+    X24H2O = Q23H2O/Q24eg;
+    X24CO = Q23CO/Q24eg;
+    X24CO2 = Q23CO2/Q24eg;
+    X24C = X24CO + X24CO2;
+    X24N2 = 1 - (X24O2 + X24SO2 + X24H2O + X24CO + X24CO2);
+
+    /* Equilibrium constant */
+    Keq0 = 0.0042*(Tmel - 273.15) - 2.4555;
+    0 = if (Keq0 > 0) then (Keq - Keq0) else Keq;
+
+    /* Molar mass of the incoming gases */
+    Mm4e = (Q23CO/28 + Q23H2O/18 + Q23CO2/44 + Q23H2/2 + Q21N2/28)/Q24eg;
+
+    /* Volume fractions at the inlet of stage 4 */
+    X24eCOvol = Q23CO/Q24eg/Mm4e/28;
+    X24eCO2vol = Q23CO2/Q24eg/Mm4e/44;
+    X24eH2vol = Q23H2/Q24eg/Mm4e/2;
+    X24eH2Ovol = Q23H2O/Q24eg/Mm4e/18;
+    X24eN2vol = Q21N2/Q24eg/Mm4e/28;
+    X24eHClvol = Q21HCl/Q24eg/Mm4e/36.5;
+    X24eHFvol = Q21HF/Q24eg/Mm4e/20;
+    X24eSO2vol = Q21SO2/Q24eg/Mm4e/64.06;
+
+    /* Reaction progress */
+    delta = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol))^2 - 4*(Keq - 1)*(Keq*X24eCO2vol*X24eH2vol - X24eCOvol*X24eH2Ovol);
+    AVE = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol) - (delta)^0.5)/2/(Keq - 1);
+
+    /* Volume fractions at the outlet of stage 4 */
+    X24sCOvol = X24eCOvol + AVE;
+    X24sCO2vol = X24eCO2vol - AVE;
+    X24sH2vol = X24eH2vol - AVE;
+    X24sH2Ovol = X24eH2Ovol + AVE;
+
+    /* Molar mass of the outgoing gases */
+    Mm4s = X24sCOvol*28 + X24sCO2vol*44 + X24sH2vol*2 + X24sH2Ovol*18 + X24eN2vol*28;
+
+    /* Mass flow rates */
+    Q24CO = X24sCOvol*28/Mm4s*Q24eg;
+    Q24CO2 = X24sCO2vol*44/Mm4s*Q24eg;
+    Q24H2O = X24sH2Ovol*18/Mm4s*Q24eg;
+    Q24H2 = X24sH2vol*2/Mm4s*Q24eg;
+
+    Q24sg = Q24H2 + Q21HCl + Q21HF + Q21SO2 + Q24H2O + Q24CO + Q21N2 + Q23O2 + Q24CO2;
+  else
+    //-----------------
+    // Excess of oxygen
+    //-----------------
+
+    // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O
+    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    Q23CO2 = Q1CO2 + Q1ec*X1Cfuel/12*44;
+    Q23H2O = Qmel*XmelH2O+Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel)*18/2 + Qec*XH2Ofuel;
+    Q23CO = 0;
+    Q23H2 = 0;
+    Q23O2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2);
+
+    // Stage 4 : Eaquilibrium reaction CO/CO2
+    // - - - - - - - - - - - - - - - - - - -
+    Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2;
+    X24O2 = 0;
+    X24SO2 = 0;
+    X24H2O = 0;
+    X24CO = 0;
+    X24CO2 = 0;
+    X24C = 0;
+    X24N2 = 0;
+    Keq0 = 0;
+    0 = if (Keq0 > 0) then (Keq - Keq0) else Keq;
+    Mm4e = 0;
+    X24eCOvol = 0;
+    X24eCO2vol = 0;
+    X24eH2vol = 0;
+    X24eH2Ovol = 0;
+    X24eN2vol = 0;
+    X24eHClvol = 0;
+    X24eHFvol = 0;
+    X24eSO2vol = 0;
+    delta = 0;
+    AVE = 0;
+    X24sCOvol = 0;
+    X24sCO2vol = 0;
+    X24sH2vol = 0;
+    X24sH2Ovol = 0;
+    Mm4s = 0;
+    Q24CO = Q23CO;
+    Q24CO2 = Q23CO2;
+    Q24H2O = Q23H2O;
+    Q24H2 = Q23H2;
+    Q24sg = Q24eg;
+  end if;
+
+  /* Mass flow rate at the outlet */
+  Qsf = Q24sg;
+
+  /* Power released by the combustion */
+  0 = if (Q1ec >= 1e-6) then PciCvol - (Q24CO/28/Q1ec*12*(HfCO2 - HfCO) + Q24H2/2*(HfH2O)/Q1ec) else PciCvol;
+
+  /* Power released by the combustion in zone 2 */
+  P2g = (LHVfuel1 - PciCvol)*Q1ec;
+
+  /* Composition at the outlet */
+  XsfO2 = Q23O2/Qsf;
+  XsfSO2 = Q21SO2/Qsf;
+  XsfH2O = Q24H2O/Qsf;
+  XsfH2 = Q24H2/Qsf;
+  XsfCO = Q24CO/Qsf;
+  XsfCO2 = Q24CO2/Qsf;
+  XsfC = XsfCO2 + XsfCO;
+  XsfN2 = 1 - (XsfO2 + XsfSO2 + XsfH2O + XsfCO2 + XsfCO);
+
+  /* Power accumukated by the gases in zone 2 */
+  P2t = ((Q24H2O - (Qmel*XmelH2O))*H0v + Qmel*Hmel + Q1ec*Hfuel + P2g)*(1 - Xrad);
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  P2t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfC, XsfH2O, XsfO2, XsfSO2);
+  P2t/Qsf = Hsf;
+
+  Wrad = P2t*Xrad;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
+              -44},{-20,-60},{-20,62}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.CrossDiag),
+        Line(points={{-20,80},{-20,-80}}, color={0,0,255})}),
+                                       Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54,
+              -44},{-20,-60},{-20,62}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.CrossDiag),
+        Line(points={{-20,80},{-20,-80}}, color={0,0,255}),
+        Text(
+          extent={{-92,100},{-66,76}},
+          lineColor={28,108,200},
+          textString="Air inlet"),
+        Text(
+          extent={{52,44},{100,8}},
+          lineColor={238,46,47},
+          textString="Flue gases outlet"),
+        Text(
+          extent={{-12,-78},{20,-108}},
+          lineColor={28,108,200},
+          textString="Fuel inlet"),
+        Text(
+          extent={{-100,44},{-52,8}},
+          lineColor={238,46,47},
+          textString="Flue gases inlet")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end PostCombustionGas;
diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/package.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/package.mo
index 2d2013b58e58a528903031a278e3b0903fe76748..619e75362e2896041695335cd417a51241aeb144 100644
--- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/package.mo
+++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/package.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.Fluid.Combustion;
-package CombustionChambers "Combustion chambers"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end CombustionChambers;
+within ThermoSysPro.Fluid.Combustion;
+package CombustionChambers "Combustion chambers"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end CombustionChambers;
diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/package.order b/ThermoSysPro/Fluid/Combustion/CombustionChambers/package.order
index acf3e76bccaf8fa4950e14a304ab3498c6da7dd8..217d41630fee5a8176de7a81fc4172f7d855a096 100644
--- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/package.order
+++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/package.order
@@ -1,5 +1,5 @@
-GenericCombustion
-GenericCombustion1D
-GridFurnace
-GTCombustionChamber
-PostCombustionGas
+GenericCombustion
+GenericCombustion1D
+GridFurnace
+GTCombustionChamber
+PostCombustionGas
diff --git a/ThermoSysPro/Fluid/Combustion/Sensors/FuelMassFlowSensor.mo b/ThermoSysPro/Fluid/Combustion/Sensors/FuelMassFlowSensor.mo
index b363f26a51dec23c6151d80cb46c43a55c2d5c82..7e1faee1783bd4cf912bb0a3c000d6261ab8e902 100644
--- a/ThermoSysPro/Fluid/Combustion/Sensors/FuelMassFlowSensor.mo
+++ b/ThermoSysPro/Fluid/Combustion/Sensors/FuelMassFlowSensor.mo
@@ -1,83 +1,83 @@
-within ThermoSysPro.Fluid.Combustion.Sensors;
-model FuelMassFlowSensor "Fuel mass flow rate sensor"
-
-public
-  Units.SI.MassFlowRate Q(start=20) "Mass flow rate";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Mesure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet C1
-    annotation (Placement(transformation(extent={{-110,-90},{-90,-70}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FuelOutlet C2
-    annotation (Placement(transformation(extent={{92,-90},{112,-70}}, rotation=
-            0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.T = C2.T;
-  C1.P = C2.P;
-  C1.LHV = C2.LHV;
-  C1.cp = C2.cp;
-  C1.hum = C2.hum;
-  C1.Xc = C2.Xc;
-  C1.Xh = C2.Xh;
-  C1.Xo = C2.Xo;
-  C1.Xn = C2.Xn;
-  C1.Xs = C2.Xs;
-  C1.Xashes = C2.Xashes;
-  C1.VolM = C2.VolM;
-  C1.rho = C2.rho;
-
-  Q = C1.Q;
-
-  /* Sensor signal */
-  Mesure.signal = Q;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.CrossDiag),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "Q")}),
-    Window(
-      x=0.25,
-      y=0.19,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,-28},{0,-80}}, color={0,0,255}),
-        Line(points={{-98,-80},{102,-80}}),
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.CrossDiag),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "Q")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Salimou Gassama </li>
-</ul>
-</html>"));
-end FuelMassFlowSensor;
+within ThermoSysPro.Fluid.Combustion.Sensors;
+model FuelMassFlowSensor "Fuel mass flow rate sensor"
+
+public
+  Units.SI.MassFlowRate Q(start=20) "Mass flow rate";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Mesure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet C1
+    annotation (Placement(transformation(extent={{-110,-90},{-90,-70}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FuelOutlet C2
+    annotation (Placement(transformation(extent={{92,-90},{112,-70}}, rotation=
+            0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.T = C2.T;
+  C1.P = C2.P;
+  C1.LHV = C2.LHV;
+  C1.cp = C2.cp;
+  C1.hum = C2.hum;
+  C1.Xc = C2.Xc;
+  C1.Xh = C2.Xh;
+  C1.Xo = C2.Xo;
+  C1.Xn = C2.Xn;
+  C1.Xs = C2.Xs;
+  C1.Xashes = C2.Xashes;
+  C1.VolM = C2.VolM;
+  C1.rho = C2.rho;
+
+  Q = C1.Q;
+
+  /* Sensor signal */
+  Mesure.signal = Q;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.CrossDiag),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "Q")}),
+    Window(
+      x=0.25,
+      y=0.19,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,-28},{0,-80}}, color={0,0,255}),
+        Line(points={{-98,-80},{102,-80}}),
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.CrossDiag),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "Q")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Salimou Gassama </li>
+</ul>
+</html>"));
+end FuelMassFlowSensor;
diff --git a/ThermoSysPro/Fluid/Combustion/Sensors/package.mo b/ThermoSysPro/Fluid/Combustion/Sensors/package.mo
index a37c17f2f6ea9dd7abbd2b4d5fb7baa773127f9b..b20092224b0fcf3285ad5170423ee2fc4b2aafe6 100644
--- a/ThermoSysPro/Fluid/Combustion/Sensors/package.mo
+++ b/ThermoSysPro/Fluid/Combustion/Sensors/package.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.Fluid.Combustion;
-package Sensors "Sensors"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Sensors;
+within ThermoSysPro.Fluid.Combustion;
+package Sensors "Sensors"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Sensors;
diff --git a/ThermoSysPro/Fluid/Combustion/package.mo b/ThermoSysPro/Fluid/Combustion/package.mo
index 4b8a3bc14565a884a91b661e584cbe241ccd7989..e72271fb498798d80f2a36d36efcf0215ba0e2c2 100644
--- a/ThermoSysPro/Fluid/Combustion/package.mo
+++ b/ThermoSysPro/Fluid/Combustion/package.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.Fluid;
-package Combustion "Combustion"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Combustion;
+within ThermoSysPro.Fluid;
+package Combustion "Combustion"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Combustion;
diff --git a/ThermoSysPro/Fluid/Combustion/package.order b/ThermoSysPro/Fluid/Combustion/package.order
index 34e389b16e4a5c02dedf95ff8389427a17a88120..fa27f74214366a6ee0d6cbf694d5781a74c8c98a 100644
--- a/ThermoSysPro/Fluid/Combustion/package.order
+++ b/ThermoSysPro/Fluid/Combustion/package.order
@@ -1,3 +1,3 @@
-BoundaryConditions
-CombustionChambers
-Sensors
+BoundaryConditions
+CombustionChambers
+Sensors
diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/GasTurbineTrip.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/GasTurbineTrip.mo
index 978f9ecd61193310b6fa9c4e75377a40ca2c474b..f8cbf61e7ca65b3b8766bd5c902119795d79e67c 100644
--- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/GasTurbineTrip.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/GasTurbineTrip.mo
@@ -1,1840 +1,1840 @@
-within ThermoSysPro.Fluid.Examples.Book.PowerPlants.CombinedCyclePowerPlant;
-model GasTurbineTrip "CCPP model to simulate a gas turbine trip"
-  parameter Real CstHP(fixed=false,start=7618660.65374636)
-    "Stodola's ellipse coefficient HP";
-  parameter Real EtaIsNomHP(fixed=false,start=0.875)
-    "Turbine HP: Nominal isentropic efficiency ";
-  parameter Real CstMP(fixed=false,start=278905.664031036)
-    "Stodola's ellipse coefficient MP";
-  //parameter Real EtaIsNomMP(fixed=false,start=0.96)
-  //  "Turbine MP: Nominal isentropic efficiency ";
-  parameter Real CstBP(fixed=false,start=13491.6445678148)
-    "Stodola's ellipse coefficient BP";
-  parameter Real EtaIsNomBP(fixed=false,start=0.92)
-    "Turbine MP: Nominal isentropic efficiency ";
-// //
-  //parameter Modelica.SIunits.AbsolutePressure PoutPumpEx(fixed=false,start=22e5)"Flow pressure at the outlet of the pump";
-  //parameter Modelica.SIunits.Length zc(fixed=false,start=1.5) "Condenser water level";
-
-  parameter Real LP_Pump_a1(fixed=false,start=-6000)
-    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-
-  //parameter Real a3_PumpBP(fixed=false,start=400)"Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVHP(fixed=false, start=47829.4)
-    "Maximum CV: steame valve HP Drum  ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVMP(fixed=false, start=47829.4)
-    "Maximum CV: steame valve  Drum MP";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
-    "Maximum CV: steame valve BP Drum ";
-
-  //parameter ThermoSysPro.Units.Cv CvmaxValveWBP(fixed=false,start=10000)
-  //  "Maximum CV: Water valve BP Drum ";
-
-  parameter Real Fouling_SHP(fixed=false,start=0.075)
-    "Sur HP: heat exchange fouling coefficient";
-
-  //parameter Real Fouling_EHP(fixed=false,start=1)
-  //  "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP1(fixed=false,start=0.07)
-    "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP2(fixed=false,start=0.11)
-    "Eco HP2: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP3(fixed=false,start=0.06)
-    "Eco HP3: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP4(fixed=false,start=0.03)
-    "Eco HP4: heat exchange fouling coefficient";
-
-  parameter Real Fouling_SMP(fixed=false,start=0.1358)
-    "Sur MP1: heat exchange fouling coefficient";
-
-  //parameter Real Fouling_SMP(fixed=true,start=0.065)
-  //  "Sur MP1: heat exchange fouling coefficient";
-
-  parameter Real Fouling_EMP(fixed=false,start=0.09)
-    "Eco MP: heat exchange fouling coefficient";
-
-  parameter Real Fouling_EvHP(fixed=false,start=0.24)
-    "Evapo HP: heat exchange fouling coefficient";
-  parameter Real Fouling_EvMP(fixed=false,start=0.08)
-    "Evapo MP: heat exchange fouling coefficient";
-  parameter Real Fouling_EvBP(fixed=false,start=0.09)
-    "Evapo BP: heat exchange fouling coefficient";
-
-  parameter Real Fouling_SBP(fixed=false,start=0.05)
-    "Sur BP: heat exchange fouling coefficient";
-  parameter Real Fouling_EBP(fixed=false,start=0.06)
-    "Eco BP: heat exchange fouling coefficient";
-
-  parameter Real K_HP_DownComer(fixed=false,start=720.183)
-    "HP: Friction pressure loss coefficient";
-  parameter Real K_IP_DownComer(fixed=false,start=1090.9)
-    "MP: Friction pressure loss coefficient";
-  parameter Real K_Dp_HP_2(fixed=false,start=10.)
-    "SMPin: Friction pressure loss coefficient";
-
-  //parameter Real K_PerteChargeZero2(fixed=true,start=1e-4)
-  //  "TurbineMP out: Friction pressure loss coefficient";
-  parameter Real K_Dp_HP_IP(fixed=false,start=1.)
-    "Outlet THP: Friction pressure loss coefficient";
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
-    "Maximum CV input Turbine HP ";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
-    "Maximum CV input Turbine MP ";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum HP_Drum(
-    L=16.27,
-    Vertical=false,
-    hl(fixed=false, start=1474422.14552527),
-    hv(fixed=false, start=2666558.75582585),
-    Vv(fixed=false),
-    R=1.05,
-    xmv(fixed=false),
-    P(fixed=false, start=12703151.2960688),
-    zl(start=1.05, fixed=true),
-    Mp=5000,
-    Kpa=5,
-    Kvl=1000,
-    Pfond(start=12703151.3),
-    Tp(start=596.924860294475),
-    Cv(Q(fixed=true, start=76.58)))
-                     annotation (Placement(transformation(extent={{38,10},{-2,
-            50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_FeedValve(
-    Cvmax=CvmaxValveAHP,
-    C1(P(start=12721657.0), h_vol(start=1396865.59043578)),
-    h(start=1398000),
-    Cv(start=178),
-    Pm(start=13050700))
-                 annotation (Placement(transformation(extent={{78,46},{58,66}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    HP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_SteamValve(
-    mode=0,
-    C2(h_vol(start=2666558.75582585),P(start=12700000.0)),
-    h(start=2674000),
-    Cv(start=23914.7),
-    Pm(start=12721657.16928),
-    C1(P(start=132.1e5, fixed=true)),
-    Cvmax=CvmaxValveVHP)
-                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_DownComer(
-    z2=0,
-    mode=1,
-    Q(start=150, fixed=true),
-    z1=10.83,
-    K=K_HP_DownComer,
-    C2(P(start=12768600.0)),
-    h(start=1474422.14552527),
-    Pm(start=12704000))
-            annotation (Placement(transformation(
-        origin={28,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,     h(start=1474422.14552527))
-                                           annotation (Placement(transformation(
-          extent={{8,-100},{-12,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Evaporator(
-    Dint=32.8e-3,
-    Ntubes=1476,
-    L=20.7,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
-      Tp(start={607.668721736158,605.187884376142,603.825778846274}),
-      Tp1(start={606.357,604.602,603.578})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=10.83,
-      option_temperature=2,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={5.74e7,2.67e7,1.24e7}),
-      Tp1(start={606.2,604.6,603.7}),
-      h(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134,
-            1459929.875}),
-      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
-      P(start={12758125,12740000,12734000,12730000,12726787})),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.092,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.86442072,
-      p_rho=1.05,
-      Encras(start=0.24)=Fouling_EvHP,
-      K(fixed=false, start=407),      DeltaT(start={106,49,23}),
-      T(start={755.54821777344,673.68082608925,635.57157972092,618.19360351563}),
-      Tm(start={643.15,633.15,626.621}),
-      Tp(start={609.11670087771,605.86035558168,604.13687003529})))
-                          annotation (Placement(transformation(
-        origin={-14,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_4(
-    Ns=3,
-    L=20.726,
-    Dint=0.0266,
-    Ntubes=246,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-3.5e6,-2.63e6,-2e6}),
-      Tp(start={576.803345033827,581.933438017921,585.694098500999}),
-      Tp1(start={575.762,580.856,584.579})),
-    Cws1(P(start=13703700.0), h_vol(start=1306078.18827954)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      z2=0,
-      option_temperature=2,
-inertia=true,
-      dW1(start={3.5e6,2.63e6,2e6}),
-      Tp1(start={577.5,582.6,586.4}),
-      h(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578,
-            1398251.0}),
-      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
-      P(start={13301176,13320000,13338000,13357000,13374658})),
-    Cws2(h(fixed=false, start=1500e3)),
-    ExchangerFlueGasesMetal(
-      Dext=0.0318,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.39069779,
-      p_rho=1.06,
-      Encras(start=0.03)=Fouling_EHP4,
-      K(fixed=true, start=47.53),DeltaT(start={38,29,22}),
-      T(start={618.19360351563,612.7722894387,608.97249438439,606.41162109375}),
-      Tm(start={623.15,613.15,607.844}),
-      Tp(start={577.44979072627,582.41942947968,586.06092597683})))
-                          annotation (Placement(transformation(
-        origin={86,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_1(
-    Ns=3,
-    L=20.4,
-    Dint=0.0324,
-    Ntubes=246,
-    ExchangerWall(e=0.0028, lambda=37.61,
-    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
-      Tp(start={629.445777860324,651.664976699235,671.075818762815}),
-      Tp1(start={629,651,670.})),
-    Cws1(h_vol(start=2665000.0)),
-    Cws2(P(start=12720900.0), h_vol(start=2981170.0)),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=10.25056,
-      p_rho=1.04,
-      Encras(start=0.075)=Fouling_SHP,
-      K(fixed=false, start=34.71),      DeltaT(start={138,108,84}),
-      T(start={788.2431640625,774.65344332519,763.17487871399,755.54821777344}),
-      Tm(start={778.15,768.15,759.527}),
-      Tp(start={631.68675322573,653.38616970968,672.36458008039})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      option_temperature=2,
-      inertia=true,
-      dpfCorr=2,      dW1(start={9.8e6,7.7e6,5.9e6}),
-      Tp1(start={639.5,657,673}),
-      h(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983,
-            2973076.25}),
-      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
-      P(start={12723762,12723600,12723500,12720000,12719000})))
-         annotation (Placement(transformation(
-        origin={-64,-50},
-        extent={{-20,20},{20,-20}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_3(
-    Dint=26.6e-3,
-    Ntubes=1476,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
-      Tp(start={556.530623976228,563.226831750573,565.575075374951}),
-      Tp1(start={555.49,562.473,564.857})),
-    L=20.726,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.6e7,5.6e6,2.1e6}),
-      Tp1(start={558,565,567}),
-      h(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855,
-            1291418.875}),
-      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
-      P(start={13219333,13241000,13261000,13282000,13301176})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=12.451,
-      p_rho=1.08,
-      Encras(start=0.06)=Fouling_EHP3,
-      K(fixed=true, start=36.03),
-      St=5, DeltaT(start={34,12,4.4}),
-      T(start={602.67193603516,579.67183226637,571.50875350574,568.81030273438}),
-      Tm(start={593.15,583.15,571.919}),
-      Tp(start={557.01185690541,563.39937105652,565.63731055685})))      annotation (Placement(
-        transformation(
-        origin={206,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_2(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-5e6,-3e6,-2.e6}),
-      Tp(start={490.631370193221,498.229397165878,502.978053774656}),
-      Tp1(start={490,497.024,501.871})),
-    L=20.767,
-    Ntubes=1107,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={5e6,3e6,2.e6}),
-      Tp1(start={499,503,507}),
-      h(start={854494.5625,915007.018247822,957243.396653824,983786.364226731,
-            986348.9375}),
-      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
-      P(start={13129352,13152000,13175000,13197000,13219333})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=111e-3,
-      CSailettes=2.76134577,
-      p_rho=1.11,
-      Encras(start=0.11)=Fouling_EHP2,
-      K(fixed=true, start=65),
-      St=5, DeltaT(start={36,23,14}),
-      T(start={531.16070556641,523.74706132958,519.01561663699,516.31256103516}),
-      Tm(start={538.15,528.15,521.399}),
-      Tp(start={490.84070882241,498.36081646341,503.06064272486})))      annotation (Placement(
-        transformation(
-        origin={406,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_1(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-9.9999e6,-5e6,-2.4e6}),
-      Tp(start={458.958585923538,468.506814782426,473.132256983258}),
-      Tp1(start={458.001,467.576,472.607})),
-    L=20.726,
-    Ntubes=1107,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={9.9999e6,5e6,2.4e6}),
-      Tp1(start={467.4,476.5,480.9}),
-      h(start={618651.9375,752176.893518976,816707.727773953,847728.424287614,
-            854494.5625}),
-      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
-      dynamic_mass_balance=true,
-      P(start={13034956,13060000,13080000,13100000,13129352})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=8.30057632,
-      p_rho=1.13,
-      Encras(start=0.07)=Fouling_EHP1,
-      K(fixed=true, start=40.),
-      St=5,   DeltaT(start={41,20,10}),
-      T(start={509.31488037109,491.44087131458,484.15889910859,482.59533691406}),
-      Tm(start={503.15,498.15,494.131}),
-      Tp(start={459.37586976399,468.70800090382,473.22896941053})))      annotation (Placement(
-        transformation(
-        origin={526,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_2(
-    Ns=3,
-    L=20.4,
-    Dint=32e-3,
-    Ntubes=246,
-    ExchangerWall(e=3e-3, lambda=27,
-          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
-      Tp(start={714.604505161814,740.492493660215,759.200099714419}),
-      Tp1(start={710.485,734.082,752.527})),
-    Cws2(P(start=127113000.0), h_vol(start=3254970.0)),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.83,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={8.8e6,6.6e6,4.9e6}),
-      Tp1(start={714,735.6,752}),
-      h(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722,
-            3240813.5}),
-      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
-      P(start={12720371,12718000,12716000,12714000,12711007})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      CSailettes=10.2505424803872,
-      p_rho=1.02,
-      Encras(start=0.075)=Fouling_SHP,
-      K(fixed=false, start=34.74),
-      St=5,
-      DeltaT(start={124,93,70}),
-      T(start={850.64624023438,839.40882309811,830.36536707939,822.68170166016}),
-      Tm(start={843.15,833.15,825.24}),
-      Tp(start={717.48312916257,742.56566858011,760.69152533026})))      annotation (Placement(
-        transformation(
-        origin={-174,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_3(
-    Ns=3,
-    L=20.4,
-    Ntubes=246,
-    ExchangerWall(lambda=27,e=5e-3,
-    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
-      Tp(start={793.335674512128,811.477076678823,824.721389633254}),
-      Tp1(start={783.815,803.639,818.56})),
-    Dint=28e-3,
-    Cws2(h(fixed=true, start=3511e3)),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.726,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={6.3e6,4.7e6,3.6e6}),
-      Tp1(start={783.6,801.6,815}),
-      h(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987,
-            3433271.25}),
-      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
-      P(start={12711007,12704000,12697000,12689000,12681000})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      p_rho=1,
-      Encras(start=0.075)=Fouling_SHP,
-      CSailettes=6.59672846,
-      K(fixed=false, start=49.33),
-      St=5,
-      DeltaT(start={97,73,55}),
-      T(start={894.21850585938,885.5393240412,879.47464880089,874.32891845703}),
-      Tm(start={893.15,883.15,875.939}),
-      Tp(start={796.82789474964,814.05266276572,826.6253996051})))      annotation (Placement(
-        transformation(
-        origin={-294,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum IP_Drum(
-    L=16.27,
-    Vertical=false,
-    P0=27.29e5,
-    hl(fixed=false, start=978914.570821827),
-    hv(fixed=false, start=2799158.13966473),
-    Vv(fixed=false),
-    R=1.05,
-    P(fixed=false, start=28.3e5),
-    zl(start=1.05, fixed=true),
-    Kvl=0,
-    Kpa=5,
-    Mp=5000,
-    Cv(Q(fixed=true, start=10.9)),
-    Pfond(start=2732995.0),
-    Tp(start=500.955757665063))
-                     annotation (Placement(transformation(extent={{358,10},{320,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    IP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_FeedValve(
-      Cvmax=CvmaxValveAMP,
-    C1(P(start=2952995.0), h_vol(start=892414.570867188)),
-    h(start=944000),
-    Cv(start=28),
-    Pm(start=2945000))
-                 annotation (Placement(transformation(extent={{398,46},{378,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_SteamValve(
-    Pm(fixed=false, start=2731689.4244255),
-    C2(h_vol(start=2798000),P(start=27.3e5)),
-    h(fixed=false, start=2798000),
-    mode=0,
-    Cv(start=27829.4),
-    Cvmax=CvmaxValveVMP,
-    C1(P(start=28.3e5, fixed=true)))
-                 annotation (Placement(transformation(extent={{298,46},{278,66}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_Evaporator(
-    Dint=32.8e-3,
-    L=20.767,
-    Ntubes=738,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
-      Tp(start={504.957792851478,504.19488464586,503.59993822766}),
-      Tp1(start={504.427,503.806,503.304})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.83,
-      continuous_flow_reversal=true,
-      inertia=true,
-          dW1(start={9.7e7,7.6e6,5.8e6}),
-      Tp1(start={504.5,503.9,503.4}),
-      P(start={2773367.5,2754933.93610513,2745233.82043873,2738517.46232967,2733824.75}),
-      h(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464,980708.125}),
-      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=10.0676093,
-      p_rho=1.1,
-      Encras(start=0.08)=Fouling_EvMP,
-      K(fixed=false, start=46.9),
-      St=5,
-      DeltaT(start={53,41,32}),
-      T(start={565.24822998047,551.20973998682,539.98034586472,531.16070556641}),
-      Tm(start={553.15,543.15,536.901}),
-      Tp(start={505.45492567199,504.57970000924,503.89762940507})))              annotation (Placement(
-        transformation(
-        origin={306,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss IP_DownComer(
-    z2=0,
-    z1=10.83,
-    mode=1,
-    K=K_IP_DownComer,
-    Q(start=22, fixed=true),
-    Pm(start=2734000),
-    h(start=978914.570821827))
-            annotation (Placement(transformation(
-        origin={348,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
-    h(start=978914.570821827),
-    P(start=2834000))                      annotation (Placement(transformation(
-          extent={{328,-100},{308,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_Economizer(
-    ExchangerWall(e=2.6e-3, lambda=47,
-        dW1(start={-3e6,-1.4e6,-740379}),
-      Tp(start={457.584681885759,475.409334769727,486.332585528225}),
-      Tp1(start={456.76,474.926,485.122})),
-    L=20.726,
-    Ns=3,
-    Dint=26.6e-3,
-    Ntubes=246,
-    Cws1(h_vol(start=671235.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.767,
-      z2=0,
-      inertia=true,
-      dW1(start={3e6,1.4e6,740379}),
-      Tp1(start={474,491,499.9}),
-      h(start={565108.5,727745.440528479,829820.124314816,892414.570867187,
-            944505.4375}),
-      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
-      P(start={3124229.75,3148000,3172000,3195000,3216977.75})),
-    Cws2(h(fixed=false, start=990e3)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      CSailettes=7.16188651,
-      p_rho=1.12,
-      Encras(start=0.09)=Fouling_EMP,
-      K(fixed=true, start=50),
-      St=5,
-      DeltaT(start={45,24,13}),
-      T(start={516.31256103516,511.25046295073,508.31162431247,509.31488037109}),
-      Tm(start={533.15,523.15,514.647}),
-      Tp(start={458.18343678065,475.77644311925,486.55770446184})))              annotation (Placement(
-        transformation(
-        origin={466,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_1(
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.3e6,-0.80263e6,
-                                -501864}),
-      Tp(start={557.102699668877,574.070651369638,584.64928514972}),
-      Tp1(start={556.102699668877,573.070651369638,583.64928514972})),
-    L=20.726,
-    Ns=3,
-    Dint=32.8e-3,
-    Ntubes=123,
-    Cws1(h_vol(start=2800000.0),P(start=2.73467e+06)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      CSailettes=14.46509765,
-      p_rho=1.07,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=22.09),
-      St=5,
-      DeltaT(start={45,30,19}),
-      T(start={606.41162109375,604.22099235915,603.06310204059,602.67193603516}),
-      Tm(start={623.15,613.15,603.024}),
-      Tp(start={557.49575399383,574.31250418519,584.79699207547})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.77,
-      dpfCorr=2,
-      inertia=false,
-      dW1(start={1.3e6,0.80263e6,501864}),
-      Tp1(start={557,573,583}),
-      h(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156,
-            3040562.25}),
-      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
-      P(start={2731326.25,2729591.6901521,2728654.3204706,2727686.1714029,
-            2726700})))     annotation (Placement(transformation(
-        origin={146,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB VolumeLP(
-    Ce1(h(start=3091610.0)),
-    h(start=3042573.51976705),
-    P(start=2726000))
-    annotation (Placement(transformation(
-        origin={146,-110},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_2(
-    Ns=3,
-    L=20.4,
-    Dint=39.3e-3,
-    Ntubes=369,
-    ExchangerWall(e=2.6e-3, lambda=36.86,
-    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
-      Tp(start={689.66516778766,716.376344387713,734.591437191304}),
-      Tp1(start={687.7,713.5,731.5})),
-    Cws1(P(start=2576650.0), h_vol(start=3078800.0)),
-    Cws2(P(start=2558540.0), h_vol(start=3342910.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={1.15e7,7.9e6,5.5e6}),
-      Tp1(start={685.6,711,729}),
-      h(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389,
-            3321940.75}),
-      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
-      P(start={2575582.5,2572000,2568000,2563000,2558239})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=92e-3,
-      CSailettes=5.814209831,
-      p_rho=1.03,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=45.22),
-      St=5,
-      DeltaT(start={125,86,60}),
-      T(start={822.68170166016,807.90772072705,797.00284433443,788.2431640625}),
-      Tm(start={813.15,803.15,792.527}),
-      Tp(start={690.93545553661,717.24269857866,735.18209370035})))              annotation (Placement(
-        transformation(
-        origin={-114,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_3(
-    Ns=3,
-    L=20.4,
-    Ntubes=369,
-    Dint=45.6e-3,
-    ExchangerWall(e=2.6e-3, lambda=27,
-    dW1(start={-8e6,-5.5e6,-3.8e6}),
-      Tp(start={788.901616786331,805.674094596818,817.083010473709}),
-      Tp1(start={786.717,804.102,815.901})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={8e6,5.5e6,3.8e6}),
-      Tp1(start={782,798.7,810}),
-      h(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916,
-            3517975.25}),
-      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
-      P(start={2558239,2556000,2554000,2552000,2548600})),
-    Cws2(h(fixed=true, start=3606e3)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=92e-3,
-      Dext=50.8e-3,
-      p_rho=1.01,
-      CSailettes=5.695842178,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=43.23),
-      St=5,
-      DeltaT(start={82,56,38}),
-      T(start={874.32891845703,864.2444076086,856.92248545484,850.64624023438}),
-      Tm(start={873.15,863.15,853.059}),
-      Tp(start={789.92521486539,806.37044583028,817.55662835373})))              annotation (Placement(
-        transformation(
-        origin={-234,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum LP_Drum(
-    Vertical=false,
-    P0=5e5,
-    Vv(fixed=false),
-    L=8,
-    hl(fixed=false, start=549249.519022482),
-    hv(fixed=false, start=2709858.97470349),
-    R=2,
-    zl(start=1.75, fixed=true),
-    Kvl=0,
-    Kpa=5,
-    Mp=5000,
-    P(fixed=false, start=520000),
-    Cv(Q(fixed=true, start=9.23)),
-    Pfond(start=564775.0),
-    Tp(start=406.411032587651))
-                     annotation (Placement(transformation(extent={{618,10},{578,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    LP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_SteamValve(
-    p_rho=3, Cvmax=CvmaxValveVBP,
-    C2(P(start=503542.0), h_vol(start=2709858.97470349)),
-    h(start=2685000),
-    Cv(start=7555),
-    Pm(start=498000))
-                 annotation (Placement(transformation(extent={{558,46},{538,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_FeedValve(
-    C1(h_vol(start=511900.0)),
-    h(fixed=false, start=509000),
-    Pm(fixed=false, start=5.0698e5),
-    Cvmax=250,
-    Cv(start=142.5),
-    C2(P(fixed=true, start=5.2e5)))
-                 annotation (Placement(transformation(extent={{650,46},{630,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss LP_DownComer(
-    z2=0,
-    z1=10.767,
-    K=32766,
-    mode=1,
-    Q(start=20, fixed=false),
-    pro(d(start=934.452746556487)),
-    Pm(start=564000),
-    h(start=549249.519022482))
-            annotation (Placement(transformation(
-        origin={610,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=549249.519022482),
-                                                                       mode=1,
-    V=5,
-    P(start=523000))                                   annotation (Placement(
-        transformation(extent={{592,-100},{572,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_Evaporator(
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
-      Tp(start={433.127441964236,432.076030201586,431.28112439162}),
-      Tp1(start={432.956,431.127,430.61})),
-    L=20.726,
-    Ntubes=984,
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={1.24e7,8.5e6,5.8e6}),
-      Tp1(start={442.5,441.7,441}),
-      h(start={550075.0,765243.011613326,912673.256542569,1013555.73710231,
-            550075.0}),
-      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
-      Q(start={49.787311368631,49.787311368631,49.787311368631,49.787311368631}),
-      P(start={522583.375,488000,487000,486000,485588.46875})),
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=138e-3,
-      CSailettes=11.07985,
-      p_rho=1.14,
-      Encras(start=0.09)=Fouling_EvBP,
-      K(fixed=false, start=46.7),
-      St=5,
-      DeltaT(start={45,31,21}),
-      T(start={482.59533691406,464.53146753441,453.496360082,442.5893859863}),
-      Tm(start={483.15,478.15,472.098}),
-      Tp(start={433.5360639938,432.3549425205,431.471976456})))              annotation (Placement(
-        transformation(
-        origin={566,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_LP_Drum(k=0.25)
-    annotation (Placement(transformation(extent={{742,32},{728,44}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve(
-      Pm(start=5.0698e5), mode=1,
-    C1(h_vol(start=549249.519022482)),
-    h(start=550000),
-    Cv(start=308.931))
-                 annotation (Placement(transformation(extent={{710,12},{730,32}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_SuperHeater(
-    Ns=3,
-    L=20.726,
-    Dint=39.3e-3,
-    Ntubes=123,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.1e6,-782901,-559798}),
-      Tp(start={489.606851797367,513.610203520748,530.080624448955}),
-      Tp1(start={488.486,512.197,529.53})),
-    Cws1(h_vol(start=2642240.0),P(start=484264)),
-    Cws2(h_vol(start=2979330.0)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=222.1e-3,
-      K(fixed=true, start=30.46),
-      CSailettes=3.25763059984175,
-      p_rho=1.09,
-      Encras(start=0.05)=Fouling_SBP,
-      St=5,
-      DeltaT(start={92,66,47}),
-      T(start={568.81030273438,567.21003420557,566.29303411055,565.24822998047}),
-      Tm(start={583.15,573.15,568.703}),
-      Tp(start={489.84170505864,513.76963980951,530.18834052149})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      rugosrel=1e-5,
-      z1=10.767,
-      inertia=false,
-      dpfCorr=0.25,
-      dW1(start={1.1e6,782901,559798}),
-      Tp1(start={485,511,529}),
-      h(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762,
-            2914520.25}),
-      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
-      P(start={510622.6875,505757.57962259,504477.27858572,503172.36919354,501850})))      annotation (Placement(
-        transformation(
-        origin={266,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkP SinkP_Gas(P0=104400)
-    annotation (Placement(transformation(
-        origin={722,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_Economizer(
-    Ns=3,
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
-      Tp(start={398.142807363473,393.825926964772,392.943738968771}),
-      Tp1(start={397.622,392.348,391.516})),
-    Ntubes=3444,
-    L=20.726,
-    Cws1(h_vol(start=195526.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      inertia=true,
-      dpfCorr=0.5,
-      dW1(start={2.45e7,5.5e6,1.17e6}),
-      Tp1(start={409,404.7,404}),
-      h(start={194584.515625,462556.370989432,494648.45288738,501287.069880104,
-            509237.875}),
-      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
-      P(start={1540571.25,1500000,1480000,1450000,1429595.375})),
-    Cws2(h(fixed=false, start=500e3)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=92e-3,
-      CSailettes=11.673758598919,
-      p_rho=1.15,
-      Encras(start=0.06)=Fouling_EBP,
-      K(fixed=true, start=30),
-      St=5,
-      DeltaT(start={23.5,5.3,1.1}),
-      T(start={442.5893859863,403.9873508455,395.0465605839,395.464630127}),
-      Tm(start={423.15,418.15,414.742}),
-      Tp(start={398.4437772187,393.8897987349,392.9569515805})))              annotation (Placement(
-        transformation(
-        origin={680,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine HP_Turbine(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.88057),
-    eta_is_min=0.75,
-    Cst(start=8182844.56002535)=
-        CstHP,
-    Pe(fixed=true, start=125.20e5),
-    Ps(fixed=false, start=2726700),
-    eta_is_nom=EtaIsNomHP,
-    Cs(h(fixed=true, start=3106e3)),
-    pros(d(start=10.0)),
-    Hrs(start=3046260),
-    Qmax=151,
-    a=-1.20211,
-    b=2.32571,
-    c=-0.25) annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
-          rotation=0)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine IP_Turbine(
-    W_fric=1,
-    Ps(fixed=false, start=476800),
-    eta_stato=1,
-    eta_is(start=0.9625),
-    eta_is_min=0.75,
-    Cst(start=256335.364995961)=
-        CstMP,
-    Pe(fixed=true, start=25.13e5),
-    pros(d(start=30.0)),
-    Hrs(start=3029780),
-    Cs(h(fixed=false, start=2990e3)),
-    eta_is_nom=0.96,
-    b=2.4957,
-    Qmax=170,
-    a=-1.2728,
-    c=-0.26202)   annotation (Placement(transformation(extent={{318,-250},{358,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP1(
-    h(start=2997231.36734756),
-    P(start=476799.99999954),
-    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
-        origin={418,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine LP_Turbine(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9538),
-    eta_is_min=0.75,
-    Cst(start=11944.9445735985)=
-        CstBP,
-    Hrs(start=2401030),
-    Pe(fixed=true, start=4.77e5),
-        Ps(start=10053),
-    Cs(h(fixed=true, start=2399.9e3)),
-    eta_is_nom=EtaIsNomBP,
-    Qmax=192,
-    a=-1.22335,
-    b=2.2957,
-    c=-0.14)   annotation (Placement(transformation(extent={{576,-250},{616,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-292,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-232,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(Cs(h(start=3000000)),
-                                                    alpha=0.5)
-    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
-    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    Vf0=0.15,
-    steady_state=false,
-    yNiveau(signal(start=1.5)),
-    Cse(h(start=128076)),
-    P0=6100,
-    P(fixed=false, start=6136),
-    Pfond(start=6200)) annotation (Placement(transformation(extent={{639,-384},{
-            719,-304}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
-    h0=113.38e3, Q0=17224)       annotation (Placement(transformation(extent={{
-            572,-377},{620,-329}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_In(
-    K=1e-4,
-    h(start=2400000),
-    C1(h_vol(start=2400000), h(start=2400000)),
-    Q(start=190.55),
-    Pm(start=10026)) annotation (Placement(transformation(extent={{640,-240},{660,
-            -220}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
-    Ce3(h(start=163768.700887002)),
-    h(start=163768.700887002),
-    P(start=1540500))
-    annotation (Placement(transformation(
-        origin={902,-318},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out2(
-    K=1e-4,
-    mode=1,
-    pro(d(start=993.470128235971)),
-    Pm(start=1540000)) annotation (Placement(transformation(
-        origin={902,-270},
-        extent={{12,-12},{-12,12}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
-    h(start=549249.519022482),
-    P(start=322430))                       annotation (Placement(transformation(
-          extent={{742,6},{762,26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump IP_Pump(
-    a3=350,
-    mode=1,
-    Q(fixed=false, start=10.9),
-    a1=-244551,
-    C1(h_vol(start=576000.0)),
-    C2(h_vol(start=561000.0)),
-    h(start=571000.0),
-    hn(start=317),
-    Qv(start=0.0207237016869104),
-    pro(d(start=930.0)),
-    Pm(start=1725850))
-            annotation (Placement(transformation(extent={{804,6},{824,26}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump HP_Pump(
-    a3=1600,
-    a1=-28056.2,
-    Q(fixed=false),
-    mode=1,
-    C1(h_vol(start=561000.0)),
-    C2(h_vol(start=630000.0)),
-    h(start=630000),
-    hn(start=1413),
-    Qv(start=0.0810383142105344),
-    pro(d(start=929.0)),
-    Pm(start=6774000))  annotation (Placement(transformation(extent={{804,-46},
-            {824,-26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
-                                                    alpha=0.5,
-    h(start=194585),
-    P(start=1540500),
-    Cs(h(start=194585)))
-    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={266,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_LP_Turbine(
-    z2=0,
-    mode=0,
-    z1=0,
-    h(start=3000000),
-    C1(
-      h_vol(start=3000000),
-      h(start=3000000),
-      P(fixed=false, start=5.0185e5)),
-    K=1e-4,
-    Pm(start=490000)) annotation (Placement(transformation(
-        origin={344,-278},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_HP_Pump(
-    K=1e-4,
-    mode=1,
-    C2(h_vol(start=599600)),
-    Pm(start=372718)) annotation (Placement(transformation(
-        origin={780,-36},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_IP_Pump(
-    K=1e-4,
-    mode=1,
-    C2(h_vol(start=599600)),
-    Pm(start=372718)) annotation (Placement(transformation(
-        origin={780,16},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
-    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out(
-    K=1e-4,
-    mode=1,
-    C1(h_vol(start=153206.462779274)),
-    C2(h_vol(start=153206.462779274)),
-    pro(d(start=993.441492649513)),
-    Pm(start=6200)) annotation (Placement(transformation(extent={{702,-446},{722,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump LP_Pump(
-    Qv(start=0.1934),
-    mode=1,
-    a3=400,
-    C2(P(fixed=false, start=16.7e5), h_vol(start=194669.0)),
-    h(start=193000),
-    hn(start=183),
-    a1=LP_Pump_a1,
-    Q(start=193.43, fixed=false),
-    Pm(start=1103065, fixed=false)) annotation (Placement(transformation(extent=
-           {{742,-446},{762,-426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out1(
-    K=1e-4,
-    mode=1,
-    pro(d(start=994.045785814739)),
-    C1(h_vol(start=194585), h(start=194585)),
-    Pm(start=1546000)) annotation (Placement(transformation(extent={{840,-446},{
-            860,-426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ExtractionValve(
-    mode=1,
-    Cvmax=2500,
-    h(start=195000),
-    Cv(start=2000),
-    C1(h_vol(start=195000)),
-    C2(h_vol(start=195000)),
-    Pm(start=1549000)) annotation (Placement(transformation(extent={{802,-440},{
-            822,-420}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamHP(C1(h_vol(start=2674000),
-        h(start=2674000)))
-    annotation (Placement(transformation(
-        origin={-58,8},
-        extent={{-6,6},{6,-6}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterHP(C2(h_vol(start=1398000),
-        h(start=1398000)))
-    annotation (Placement(transformation(
-        origin={91.5,32},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterMP(C2(h_vol(start=944000),
-        h(start=944000)))
-    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamMP(C1(h_vol(start=2798000),
-        h(start=2798000)),C2(h_vol(start=2798000)))
-    annotation (Placement(transformation(
-        origin={236,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamBP(C2(h_vol(start=2685000),
-        h(start=2685000)))
-    annotation (Placement(transformation(
-        origin={514,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP(C2(h_vol(start=550000),
-        h(start=550000)))
-    annotation (Placement(transformation(
-        origin={663.5,34},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP_Out(C2(h_vol(start=550000),
-        h(start=550000))) annotation (Placement(transformation(extent={{687,15},
-            {700,27}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterCondenser(C2(h_vol(start=
-           194585), h(start=194585))) annotation (Placement(transformation(
-        origin={685.5,-412},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamCondenser(C2(h_vol(start=
-           2401000), h(start=2401000))) annotation (Placement(transformation(
-        origin={684.5,-264},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_2(
-    C1(
-      P(fixed=true, start=27.267e5),
-      h_vol(start=3046000),
-      h(start=3046000)),
-    K=K_Dp_HP_2,
-    Pm(start=2651000)) annotation (Placement(transformation(extent={{114,-120},{
-            94,-100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_Turbine_Valve(
-    mode=0,
-    h(fixed=false, start=3433000),
-    Cv(start=10875),
-    Pm(fixed=false, start=12550000),
-    C1(P(fixed=true, start=126.81e5)),
-    Cvmax=Cvmax_THP)
-                 annotation (Placement(transformation(extent={{-124,-234},{-104,
-            -214}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauHP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500,
-    minval=0.007) annotation (Placement(transformation(extent={{-40,106},{-20,
-            126}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauMP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500) annotation (Placement(transformation(extent={{262,106},{282,126}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauBP(                                                              k=1.75)
-    annotation (Placement(transformation(extent={{470,114},{504,132}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
-    add(k1=-1, k2=+1),
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauCondenseur1(                                 k=1.5)
-    annotation (Placement(transformation(extent={{704,-246},{740,-230}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-      add(k1=+1, k2=-1)) annotation (Placement(transformation(extent={{758,-282},
-            {778,-262}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneHP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
-            -138,-142}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp(
-    Initialvalue=1400,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=1300)
-                   annotation (Placement(transformation(extent={{944,-16},{906,
-            16}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP(
-    Initialvalue=1400,
-    Starttime=2000,
-    Duration=1000,
-    Finalvalue=700)
-                   annotation (Placement(transformation(extent={{945,-82},{907,
-            -50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingBP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{945,-458},{907,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
-    mode=1,
-    V=1,
-    h0=988332,
-    h(start=988332),
-    P0=70.1e5,
-    P(start=13129000),
-    dynamic_mass_balance=true)            annotation (Placement(transformation(
-          extent={{456,-98},{436,-78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
-    mode=1,
-    V=1,
-    h0=983786,
-    h(start=983786),
-    P0=70.0e5,
-    P(start=13219000),
-    dynamic_mass_balance=true)            annotation (Placement(transformation(
-          extent={{252,-20},{232,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve1(
-                          mode=1,
-    Cvmax=308.931,
-    h(start=618600),
-    Cv(start=308.931),
-    C1(h_vol(start=618600)),
-    Pm(start=13130000))
-                 annotation (Placement(transformation(extent={{754,-98},{730,
-            -122}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve2(
-      Pm(start=3126000), mode=1,
-    Q(start=10.9, fixed=false),
-    h(start=565000),
-    C1(h_vol(start=565000)),
-    Cv(start=308.931),
-    Cvmax=308.931)
-                 annotation (Placement(transformation(extent={{804,-138},{780,
-            -162}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp1(
-    Initialvalue=0.8,
-    Duration=800,
-    Starttime=2000,
-    Finalvalue=0.01) annotation (Placement(transformation(extent={{946,-150},{
-            908,-118}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP1(
-    Initialvalue=0.8,
-    Duration=800,
-    Starttime=2000,
-    Finalvalue=0.01) annotation (Placement(transformation(extent={{946,-194},{
-            908,-162}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
-    P0=127e5,
-    h0=3e6,
-    P(start=127e5),
-    h(start=3450835.48993987),
-    dynamic_mass_balance=true)        annotation (Placement(transformation(
-        origin={-52,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP(
-    h0=3523910,
-    h(start=3523910),
-    dynamic_mass_balance=true,
-    P0=2400000,
-    P(start=24e5))                        annotation (Placement(transformation(
-        origin={-50,-314},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_Turbine_Valve(
-    h(fixed=false, start=3518000),
-    mode=0,
-    Pm(fixed=false, start=2547000),
-    Cv(start=3.312e6),
-    C1(P(fixed=true, start=25.486e5)),
-    Cvmax=Cvmax_TMP)
-                 annotation (Placement(transformation(extent={{-124,-318},{-104,
-            -298}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneIP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
-            -138,-226}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
-    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
-    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
-    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
-
-  WaterSteam.Volumes.VolumeA SeparateurMP(h(start=3106000), P(start=27.26e+005),
-    rho(start=10))
-    annotation (Placement(transformation(
-        origin={74,-200},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_1(
-    K=1e-4,
-    pro(d(start=10)),
-    h(start=3106000),
-    C1(
-      P(start=27.26e+005),
-      h_vol(start=3106000),
-      Q(start=153),
-      h(start=3106000)),
-    C2(
-      P(start=27.259e+005),
-      h_vol(start=3106000),
-      Q(start=153),
-      h(start=3106000)),
-    Pm(start=2726000)) annotation (Placement(transformation(extent={{88,-182},{102,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_IP_PressureLoss(
-    Q(fixed=true, start=3.09),
-    continuous_flow_reversal=true,
-    h(start=3106000),
-    C1(
-      P(start=27.26e+005),
-      h_vol(start=3106000),
-      h(start=3106000),
-      Q(start=3.09)),
-    C2(
-      P(start=27.259e+005),
-      h_vol(start=3106000),
-      h(start=3106000),
-      Q(start=3.09)),
-    K=K_Dp_HP_IP,
-    Pm(start=2726000)) annotation (Placement(transformation(extent={{134,-210},{
-            154,-190}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe Q_water(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=21000,
-    Finalvalue=15000)
-                   annotation (Placement(transformation(extent={{555,-364},{575,
-            -344}}, rotation=0)));
-  FlueGases.BoundaryConditions.SourceQ SourceFumees(
-    Xso2=0,
-    T0=893.75,
-    Q0=606.94,
-    Xco2=0.0604033,
-    Xh2o=0.076375,
-    Xo2=0.111559)
-    annotation (Placement(transformation(extent={{-451,-92},{-349,-8}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps FuelMassFlowRate(Table=[0,
-        606.941; 10,606.941; 600,50; 650,50]) annotation (Placement(
-        transformation(extent={{-505,-26},{-435,48}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps GasTemperature(Table=[0,
-        893.76; 10,893.76; 600,423.16; 650,423.16]) annotation (Placement(
-        transformation(extent={{-505,-164},{-435,-90}}, rotation=0)));
-equation
-  connect(HP_SuperHeater_3.Cws1, HP_SuperHeater_2.Cws2)
-    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
-        color={255,0,0}));
-  connect(HP_SuperHeater_2.Cws1, HP_SuperHeater_1.Cws2)
-    annotation (Line(points={{-174,-70},{-174,-90},{-64,-90},{-64,-70}}, color=
-          {255,0,0}));
-  connect(HP_SteamValve_Constante.y, HP_SteamValve.Ouv)
-    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
-  connect(HP_SteamValve.C1, HP_Drum.Cv)
-    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
-  connect(HP_DownComer.C1, HP_Drum.Cd)
-    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={0,0,0}));
-  connect(HP_Drum.Cm, HP_Evaporator.Cws2)
-    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}, color={0,0,0}));
-  connect(VolumeEvapHP.Cs, HP_Evaporator.Cws1)
-    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={0,0,0}));
-  connect(VolumeEvapHP.Ce1, HP_DownComer.C2)
-                                      annotation (Line(points={{8,-90},{18,-90}},
-        color={0,0,0}));
-  connect(HP_Economizer_4.Cws1, HP_Economizer_3.Cws2)
-    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
-  connect(IP_Drum.Cm, IP_Evaporator.Cws2)
-    annotation (Line(points={{320,10},{306,10},{306,-30}}, color={0,0,0}));
-  connect(IP_Evaporator.Cws1, VolumeEvapMP.Cs)
-    annotation (Line(points={{306,-70},{306,-90},{308,-90}}, color={0,0,0}));
-  connect(VolumeEvapMP.Ce1, IP_DownComer.C2)
-    annotation (Line(points={{328,-90},{338,-90}}, color={0,0,0}));
-  connect(IP_SteamValve_Constante.y, IP_SteamValve.Ouv)
-    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
-  connect(HP_SuperHeater_1.Cfg2, HP_Evaporator.Cfg1)        annotation (Line(
-      points={{-54,-50},{-54,-50},{-24,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Evaporator.Cfg2, HP_Economizer_4.Cfg1)        annotation (Line(
-      points={{-4,-50},{96,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_4.Cfg2, IP_SuperHeater_1.Cfg1)          annotation (Line(
-      points={{76,-50},{136,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_1.Cfg2, HP_Economizer_3.Cfg1)           annotation (Line(
-      points={{156,-50},{196,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_Evaporator.Cfg2, HP_Economizer_2.Cfg1)           annotation (Line(
-      points={{316,-50},{396,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_2.Cfg2, IP_Economizer.Cfg1)           annotation (Line(
-      points={{416,-50},{456,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_Economizer.Cfg2, HP_Economizer_1.Cfg1)           annotation (Line(
-      points={{476,-50},{516,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_DownComer.C1, IP_Drum.Cd)
-    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={0,0,
-          0}));
-  connect(IP_SuperHeater_2.Cfg2, HP_SuperHeater_1.Cfg1)          annotation (Line(
-      points={{-104,-50},{-74,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_2.Cfg1, HP_SuperHeater_2.Cfg2)           annotation (Line(
-      points={{-124,-50},{-164,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_3.Cfg2, HP_SuperHeater_2.Cfg1)           annotation (Line(
-      points={{-224,-50},{-184,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_SuperHeater_3.Cfg2, IP_SuperHeater_3.Cfg1)           annotation (Line(
-      points={{-284,-50},{-244,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_3.Cws1,IP_SuperHeater_2. Cws2)
-    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
-          {255,0,0}));
-  connect(IP_SuperHeater_1.Cws2, VolumeLP.Ce2) annotation (Line(
-      points={{146,-70},{146,-100}},
-      color={255,0,0},
-      pattern=LinePattern.None));
-  connect(LP_SteamValve.C1, LP_Drum.Cv)
-    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
-  connect(LP_Evaporator.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
-          -70},{566,-90},{572,-90}}, color={0,0,0}));
-  connect(VolumeEvapBP.Ce1, LP_DownComer.C2)
-                                        annotation (Line(points={{592,-90},{600,
-          -90}}, color={0,0,0}));
-  connect(LP_Drum.Cd, LP_DownComer.C1) annotation (Line(points={{618,10},{628,
-          10},{628,-90},{620,-90}}, color={0,0,0}));
-  connect(LP_Economizer.Cfg2, SinkP_Gas.C)     annotation (Line(
-      points={{690,-50},{712.2,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_3.Cfg2, LP_SuperHeater.Cfg1)  annotation (Line(
-      points={{216,-50},{256,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_SuperHeater.Cfg2, IP_Evaporator.Cfg1)  annotation (Line(
-      points={{276,-50},{296,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_1.Cfg2, LP_Evaporator.Cfg1) annotation (Line(
-      points={{536,-50},{556,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_Evaporator.Cfg2, LP_Economizer.Cfg1) annotation (Line(
-      points={{576,-50},{670,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_Drum.Cm, LP_Evaporator.Cws2)
-    annotation (Line(points={{578,10},{566,10},{566,-30}}, color={0,0,0}));
-  connect(IP_SteamValve.C1, IP_Drum.Cv)   annotation (Line(points={{298,50},{
-          320,50}}, color={255,0,0}));
-  connect(HPIP_FeedValve.Ouv, constante_LP_Drum.y)
-    annotation (Line(points={{720,33},{720,38},{727.3,38}}));
-  connect(HP_SuperHeater_3.Cws2, DoubleDebitHP.Ce)
-    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
-        color={255,0,0}));
-  connect(IP_SuperHeater_3.Cws2, DoubleDebitMP.Ce)
-    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
-        color={255,0,0}));
-  connect(VolumeCond1.Cs, Dp_Cond_Out2.C1)
-    annotation (Line(points={{902,-308},{902,-282}}, color={0,0,255}));
-  connect(HPIP_FeedValve.C2, VolumeAlimMPHP.Ce1)
-                                               annotation (Line(points={{730,16},
-          {742,16}}, color={0,0,255}));
-  connect(LP_SuperHeater.Cws2, DoubleDebitBP.Ce)
-    annotation (Line(points={{266,-70},{266,-90}}, color={255,0,0}));
-  connect(DP_IP_Pump.C2, IP_Pump.C1)
-    annotation (Line(points={{790,16},{798,15},{804,16}}, color={0,0,255}));
-  connect(VolumeAlimMPHP.Cs1, DP_IP_Pump.C1) annotation (Line(points={{762,16},{
-          766,15},{766,16},{770,16}}, color={0,0,255}));
-  connect(VolumeAlimMPHP.Cs2, DP_HP_Pump.C1)
-    annotation (Line(points={{752,6},{752,-36},{770,-36}}, color={0,0,255}));
-  connect(DP_HP_Pump.C2, HP_Pump.C1)
-    annotation (Line(points={{790,-36},{804,-36}}, color={0,0,255}));
-  connect(VolumeIP1.Ce2, Dp_LP_Turbine.C2) annotation (Line(points={{418,-239},{
-          418,-278},{354,-278}}, color={255,0,0}));
-  connect(Dp_Cond_Out.C2, LP_Pump.C1)
-    annotation (Line(points={{722,-436},{742,-436}}, color={0,0,255}));
-  connect(ExtractionValve.C2, Dp_Cond_Out1.C1)
-    annotation (Line(points={{822,-436},{840,-436}}, color={0,0,255}));
-  connect(HP_FeedValve.C1, SensorQ_WaterHP.C2)
-    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
-  connect(HP_SteamValve.C2, SensorQ_SteamHP.C1) annotation (Line(points={{
-          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
-  connect(SensorQ_SteamHP.C2, HP_SuperHeater_1.Cws1) annotation (Line(points={{-53.2,
-          1.88},{-53.2,-3.06},{-64,-3.06},{-64,-30}},        color={255,0,0}));
-  connect(IP_FeedValve.C1, SensorQ_WaterMP.C2)
-    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
-  connect(SensorQ_SteamMP.C1, IP_SteamValve.C2) annotation (Line(points={{
-          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
-  connect(SensorQ_SteamMP.C2, IP_SuperHeater_1.Cws1) annotation (Line(points={
-          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
-  connect(SensorQ_SteamBP.C2, LP_SuperHeater.Cws1) annotation (Line(points={{
-          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
-  connect(SensorQ_SteamBP.C1, LP_SteamValve.C2) annotation (Line(points={{
-          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
-  connect(SensorQ_WaterBP.C2, LP_FeedValve.C1) annotation (Line(
-        points={{658.3,40.12},{658.3,50},{650,50}}, color={0,0,255}));
-  connect(SensorQ_WaterBP_Out.C2, HPIP_FeedValve.C1) annotation (Line(points={{700.13,
-          16.2},{705.065,16.2},{705.065,16},{710,16}}, color={0,0,255}));
-  connect(SensorQ_WaterCondenser.C2, Dp_Cond_Out.C1) annotation (Line(points={{680.3,
-          -422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
-  connect(Dp_Cond_In.C2, SensorQ_SteamCondenser.C1) annotation (Line(points={{660,
-          -230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
-  connect(VolumeLP.Ce1, MoitieDebitHP.Cs)
-    annotation (Line(points={{146,-120},{146,-170},{134,-170}}, color={255,0,0}));
-  connect(Dp_Cond_Out1.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,-436},
-          {862,-436},{862,-318},{872,-318}}, color={0,0,255}));
-  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
-          {892,-318}}, color={0,0,255}));
-  connect(IP_SuperHeater_2.Cws1, HP_PressureLoss_2.C2) annotation (Line(points={{-114,-70},
-          {-114,-110},{94,-110}}, color={255,0,0}));
-  connect(HP_PressureLoss_2.C1, VolumeLP.Cs2)
-    annotation (Line(points={{114,-110},{136.2,-110}}, color={255,0,0}));
-  connect(DoubleDebitHP.Cs, HP_Turbine_Valve.C1) annotation (Line(points=
-          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
-  connect(DoubleDebitBP.Cs, Dp_LP_Turbine.C1) annotation (Line(points={{266,-110},
-          {266,-278},{334,-278}}, color={255,0,0}));
-  connect(LP_Pump.C2, ExtractionValve.C1)
-    annotation (Line(points={{762,-436},{802,-436}}, color={0,0,255}));
-  connect(HP_Drum.yLevel,regulation_Niveau_HP. MesureNiveauEau)
-    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
-  connect(regulation_Niveau_HP.SortieReelle1, HP_FeedValve.Ouv)
-    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
-  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
-    annotation (Line(
-      points={{208.7,122},{234,122},{234,110},{261.5,110}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(IP_Drum.yLevel,regulation_Niveau_MP. MesureNiveauEau)
-    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
-  connect(regulation_Niveau_MP.SortieReelle1, IP_FeedValve.Ouv)
-    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
-  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
-    annotation (Line(
-      points={{505.7,123},{529.85,123},{529.85,112},{567.5,112}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(LP_Drum.yLevel,regulation_Niveau_BP. MesureNiveauEau)
-    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
-  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
-    annotation (Line(
-      points={{741.8,-238},{752,-238},{752,-269},{757.5,-269}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(regulation_Niveau_Condenseur.SortieReelle1, ExtractionValve.Ouv)
-    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
-  connect(SensorQ_WaterBP.C1, LP_Economizer.Cws2)
-    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
-  connect(LP_Economizer.Cws1, Dp_Cond_Out2.C2)
-    annotation (Line(points={{680,-70},{680,-186},{902,-186},{902,-258}}));
-  connect(SensorQ_SteamCondenser.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
-    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,-280.9}}));
-  connect(regulation_Niveau_Condenseur.MesureDebitEau, SensorQ_WaterCondenser.Measure)
-    annotation (Line(points={{757.45,-274.95},{750,-274.95},{750,-310},{792,-310},
-          {792,-412},{692.13,-412}}));
-  connect(ConstantVanneHP_Turbine.y, HP_Turbine_Valve.Ouv)
-    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
-  connect(regulation_Niveau_BP.SortieReelle1, LP_SteamValve.Ouv)
-    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
-  connect(LP_FeedValve.Ouv, LP_SteamValve_Constante.y)
-    annotation (Line(points={{640,67},{640,81},{653.4,81}}));
-  connect(HP_Economizer_1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
-          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
-  connect(VolumeECO_HP1_2.Cs, HP_Economizer_2.Cws1) annotation (Line(points={{
-          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
-  connect(HP_Economizer_2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
-          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
-  connect(VolumeECO_HP2_3.Cs, HP_Economizer_3.Cws1) annotation (Line(points={{
-          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
-  connect(HPIP_FeedValve1.C1, HP_Pump.C2)
-    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-36},{824,-36}}));
-  connect(IP_Pump.C2, HPIP_FeedValve2.C1) annotation (Line(points={
-          {824,16},{870,16},{870,-142.8},{804,-142.8}}, color={0,0,255}));
-  connect(StopPumpingMp1.y, HPIP_FeedValve1.Ouv)
-    annotation (Line(
-      points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,-123.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(StopPumpingHP1.y, HPIP_FeedValve2.Ouv)
-    annotation (Line(
-      points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,-163.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(HPIP_FeedValve1.C2, HP_Economizer_1.Cws1) annotation (Line(
-        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
-          -6},{526,-30}}, color={0,0,255}));
-  connect(IP_Economizer.Cws1, HPIP_FeedValve2.C2)
-    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
-  connect(ConstantVanneIP_Turbine.y, IP_Turbine_Valve.Ouv)
-    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
-  connect(HP_Turbine_Valve.C2, VolumePreTHP.Ce) annotation (Line(points={
-          {-104,-230},{-62,-230}}, color={255,0,0}));
-  connect(DoubleDebitMP.Cs, IP_Turbine_Valve.C1) annotation (Line(points=
-          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
-  connect(IP_Turbine_Valve.C2, VolumeIP.Ce1) annotation (Line(
-        points={{-104,-314},{-60,-314}}, color={255,0,0}));
-  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(points={{620,-353},
-          {638,-353},{638,-352},{639,-352.8}}, color={0,0,255}));
-  connect(Condenser.Cse, PuitsCaloporteur.C)
-    annotation (Line(points={{719,-352},{736,-352}}, color={0,0,255}));
-  connect(SensorQ_SteamCondenser.C2, Condenser.Cv) annotation (Line(points={{679.3,
-          -274.2},{679.3,-288.1},{679,-288.1},{679,-304}}, color={0,0,255}));
-  connect(SensorQ_WaterCondenser.C1, Condenser.Cl)
-    annotation (Line(points={{680.3,-402},{679.8,-402},{679.8,-384}}));
-  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
-    annotation (Line(
-      points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(Condenser.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
-    annotation (Line(points={{723,-372.8},{780,-372.8},{780,-326},{732,-326},{732,
-          -263},{757.5,-263}}));
-  connect(LP_Drum.Cs, SensorQ_WaterBP_Out.C1) annotation (Line(points={{578,22},
-          {564,22},{564,16},{642,16},{642,16.2},{687,16.2}}, color={0,0,255}));
-  connect(LP_Drum.Ce1, LP_FeedValve.C2)
-    annotation (Line(points={{618,50},{630,50}}));
-  connect(IP_Drum.Ce1, IP_FeedValve.C2)
-    annotation (Line(points={{358,50},{378,50}}));
-  connect(HP_Drum.Ce1, HP_FeedValve.C2)
-    annotation (Line(points={{38,50},{58,50}}));
-  connect(VolumePreTHP.Cs3, HP_Turbine.Ce) annotation (Line(points={{-42,-230},{
-          -2.2,-230}}, color={255,0,0}));
-  connect(VolumeIP.Cs, IP_Turbine.Ce) annotation (Line(points={{-40,-314},
-          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
-  connect(IP_Turbine.Cs, VolumeIP1.Ce1) annotation (Line(points={{358.2,
-          -230},{408,-230}}, color={255,0,0}));
-  connect(VolumeIP1.Cs, LP_Turbine.Ce) annotation (Line(points={{428,
-          -230},{575.8,-230}}, color={255,0,0}));
-  connect(LP_Turbine.Cs, Dp_Cond_In.C1)
-    annotation (Line(points={{616.2,-230},{640,-230}}, color={255,0,0}));
-  connect(IP_Economizer.Cws2, SensorQ_WaterMP.C1) annotation (Line(points={{
-          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
-  connect(IP_Turbine.MechPower, Alternateur.Wmec2)
-    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
-  connect(LP_Turbine.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
-          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
-  connect(HP_Turbine.MechPower, Alternateur.Wmec3)
-    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
-  connect(heatSource.C[1], HP_Drum.Cex) annotation (Line(points={{18,68.3},{18,
-          50}}, color={191,95,0}));
-  connect(heatSource1.C[1], IP_Drum.Cex) annotation (Line(points={{339,68.3},{
-          339,50}}, color={191,95,0}));
-  connect(heatSource2.C[1], LP_Drum.Cex) annotation (Line(points={{598,64.3},{
-          598,50}}, color={191,95,0}));
-  connect(SensorQ_WaterHP.C1, HP_Economizer_4.Cws2)
-    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
-  connect(IP_Pump.rpm_or_mpower, StopPumpingMp.y)
-    annotation (Line(
-      points={{814,5},{814,0},{904.1,0}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-  connect(HP_Pump.rpm_or_mpower, StopPumpingHP.y)
-    annotation (Line(
-      points={{814,-47},{814,-66},{905.1,-66}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-  connect(LP_Pump.rpm_or_mpower, StopPumpingBP.y) annotation (Line(
-      points={{752,-447},{754,-447},{754,-456},{878,-456},{878,-442},{905.1,-442}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-
-  connect(HP_Turbine.Cs,SeparateurMP. Ce1)   annotation (Line(points={{38.2,-230},
-          {74,-230},{74,-210}}, color={255,0,0}));
-  connect(SeparateurMP.Cs1, HP_PressureLoss_1.C1)
-    annotation (Line(points={{74,-190},{74,-170},{88,-170}}, color={255,0,0}));
-  connect(HP_PressureLoss_1.C2, MoitieDebitHP.Ce)
-    annotation (Line(points={{102,-170},{114,-170}}, color={0,0,255}));
-  connect(SeparateurMP.Cs2, HP_IP_PressureLoss.C1)
-    annotation (Line(points={{84,-200},{134,-200}}, color={255,0,0}));
-  connect(HP_IP_PressureLoss.C2, VolumeIP1.Ce3) annotation (Line(points={{154,-200},
-          {418,-200},{418,-220}}, color={255,0,0}));
-  connect(Q_water.y, SourceCaloporteur.IMassFlow)
-    annotation (Line(points={{576,-354},{582,-354},{582,-341},{596,-341}}));
-  connect(GasTemperature.y, SourceFumees.ITemperature)
-    annotation (Line(points={{-431.5,-127},{-400,-127},{-400,-71}}));
-  connect(FuelMassFlowRate.y, SourceFumees.IMassFlow)
-    annotation (Line(points={{-431.5,11},{-400,11},{-400,-29}}));
-  connect(SourceFumees.C, HP_SuperHeater_3.Cfg1) annotation (Line(
-      points={{-349,-50},{-327.5,-50},{-327.5,-50},{-304,-50}},
-      color={0,0,0},
-      thickness=1));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-550,
-            -460},{950,150}},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-507,-25},{-469,-51}},
-          lineColor={255,0,0},
-          textString=
-               "GT"),
-        Text(
-          extent={{-517,-45},{-411,-72}},
-          lineColor={255,0,0},
-          textString=
-               "Exhaust")}), experiment(StopTime=10000),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end GasTurbineTrip;
+within ThermoSysPro.Fluid.Examples.Book.PowerPlants.CombinedCyclePowerPlant;
+model GasTurbineTrip "CCPP model to simulate a gas turbine trip"
+  parameter Real CstHP(fixed=false,start=7618660.65374636)
+    "Stodola's ellipse coefficient HP";
+  parameter Real EtaIsNomHP(fixed=false,start=0.875)
+    "Turbine HP: Nominal isentropic efficiency ";
+  parameter Real CstMP(fixed=false,start=278905.664031036)
+    "Stodola's ellipse coefficient MP";
+  //parameter Real EtaIsNomMP(fixed=false,start=0.96)
+  //  "Turbine MP: Nominal isentropic efficiency ";
+  parameter Real CstBP(fixed=false,start=13491.6445678148)
+    "Stodola's ellipse coefficient BP";
+  parameter Real EtaIsNomBP(fixed=false,start=0.92)
+    "Turbine MP: Nominal isentropic efficiency ";
+// //
+  //parameter Modelica.SIunits.AbsolutePressure PoutPumpEx(fixed=false,start=22e5)"Flow pressure at the outlet of the pump";
+  //parameter Modelica.SIunits.Length zc(fixed=false,start=1.5) "Condenser water level";
+
+  parameter Real LP_Pump_a1(fixed=false,start=-6000)
+    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+
+  //parameter Real a3_PumpBP(fixed=false,start=400)"Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVHP(fixed=false, start=47829.4)
+    "Maximum CV: steame valve HP Drum  ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVMP(fixed=false, start=47829.4)
+    "Maximum CV: steame valve  Drum MP";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
+    "Maximum CV: steame valve BP Drum ";
+
+  //parameter ThermoSysPro.Units.Cv CvmaxValveWBP(fixed=false,start=10000)
+  //  "Maximum CV: Water valve BP Drum ";
+
+  parameter Real Fouling_SHP(fixed=false,start=0.075)
+    "Sur HP: heat exchange fouling coefficient";
+
+  //parameter Real Fouling_EHP(fixed=false,start=1)
+  //  "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP1(fixed=false,start=0.07)
+    "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP2(fixed=false,start=0.11)
+    "Eco HP2: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP3(fixed=false,start=0.06)
+    "Eco HP3: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP4(fixed=false,start=0.03)
+    "Eco HP4: heat exchange fouling coefficient";
+
+  parameter Real Fouling_SMP(fixed=false,start=0.1358)
+    "Sur MP1: heat exchange fouling coefficient";
+
+  //parameter Real Fouling_SMP(fixed=true,start=0.065)
+  //  "Sur MP1: heat exchange fouling coefficient";
+
+  parameter Real Fouling_EMP(fixed=false,start=0.09)
+    "Eco MP: heat exchange fouling coefficient";
+
+  parameter Real Fouling_EvHP(fixed=false,start=0.24)
+    "Evapo HP: heat exchange fouling coefficient";
+  parameter Real Fouling_EvMP(fixed=false,start=0.08)
+    "Evapo MP: heat exchange fouling coefficient";
+  parameter Real Fouling_EvBP(fixed=false,start=0.09)
+    "Evapo BP: heat exchange fouling coefficient";
+
+  parameter Real Fouling_SBP(fixed=false,start=0.05)
+    "Sur BP: heat exchange fouling coefficient";
+  parameter Real Fouling_EBP(fixed=false,start=0.06)
+    "Eco BP: heat exchange fouling coefficient";
+
+  parameter Real K_HP_DownComer(fixed=false,start=720.183)
+    "HP: Friction pressure loss coefficient";
+  parameter Real K_IP_DownComer(fixed=false,start=1090.9)
+    "MP: Friction pressure loss coefficient";
+  parameter Real K_Dp_HP_2(fixed=false,start=10.)
+    "SMPin: Friction pressure loss coefficient";
+
+  //parameter Real K_PerteChargeZero2(fixed=true,start=1e-4)
+  //  "TurbineMP out: Friction pressure loss coefficient";
+  parameter Real K_Dp_HP_IP(fixed=false,start=1.)
+    "Outlet THP: Friction pressure loss coefficient";
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
+    "Maximum CV input Turbine HP ";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
+    "Maximum CV input Turbine MP ";
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum HP_Drum(
+    L=16.27,
+    Vertical=false,
+    hl(fixed=false, start=1474422.14552527),
+    hv(fixed=false, start=2666558.75582585),
+    Vv(fixed=false),
+    R=1.05,
+    xmv(fixed=false),
+    P(fixed=false, start=12703151.2960688),
+    zl(start=1.05, fixed=true),
+    Mp=5000,
+    Kpa=5,
+    Kvl=1000,
+    Pfond(start=12703151.3),
+    Tp(start=596.924860294475),
+    Cv(Q(fixed=true, start=76.58)))
+                     annotation (Placement(transformation(extent={{38,10},{-2,
+            50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_FeedValve(
+    Cvmax=CvmaxValveAHP,
+    C1(P(start=12721657.0), h_vol(start=1396865.59043578)),
+    h(start=1398000),
+    Cv(start=178),
+    Pm(start=13050700))
+                 annotation (Placement(transformation(extent={{78,46},{58,66}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    HP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_SteamValve(
+    mode=0,
+    C2(h_vol(start=2666558.75582585),P(start=12700000.0)),
+    h(start=2674000),
+    Cv(start=23914.7),
+    Pm(start=12721657.16928),
+    C1(P(start=132.1e5, fixed=true)),
+    Cvmax=CvmaxValveVHP)
+                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_DownComer(
+    z2=0,
+    mode=1,
+    Q(start=150, fixed=true),
+    z1=10.83,
+    K=K_HP_DownComer,
+    C2(P(start=12768600.0)),
+    h(start=1474422.14552527),
+    Pm(start=12704000))
+            annotation (Placement(transformation(
+        origin={28,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,     h(start=1474422.14552527))
+                                           annotation (Placement(transformation(
+          extent={{8,-100},{-12,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Evaporator(
+    Dint=32.8e-3,
+    Ntubes=1476,
+    L=20.7,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
+      Tp(start={607.668721736158,605.187884376142,603.825778846274}),
+      Tp1(start={606.357,604.602,603.578})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=10.83,
+      option_temperature=2,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={5.74e7,2.67e7,1.24e7}),
+      Tp1(start={606.2,604.6,603.7}),
+      h(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134,
+            1459929.875}),
+      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
+      P(start={12758125,12740000,12734000,12730000,12726787})),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.092,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.86442072,
+      p_rho=1.05,
+      Encras(start=0.24)=Fouling_EvHP,
+      K(fixed=false, start=407),      DeltaT(start={106,49,23}),
+      T(start={755.54821777344,673.68082608925,635.57157972092,618.19360351563}),
+      Tm(start={643.15,633.15,626.621}),
+      Tp(start={609.11670087771,605.86035558168,604.13687003529})))
+                          annotation (Placement(transformation(
+        origin={-14,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_4(
+    Ns=3,
+    L=20.726,
+    Dint=0.0266,
+    Ntubes=246,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-3.5e6,-2.63e6,-2e6}),
+      Tp(start={576.803345033827,581.933438017921,585.694098500999}),
+      Tp1(start={575.762,580.856,584.579})),
+    Cws1(P(start=13703700.0), h_vol(start=1306078.18827954)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      z2=0,
+      option_temperature=2,
+inertia=true,
+      dW1(start={3.5e6,2.63e6,2e6}),
+      Tp1(start={577.5,582.6,586.4}),
+      h(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578,
+            1398251.0}),
+      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
+      P(start={13301176,13320000,13338000,13357000,13374658})),
+    Cws2(h(fixed=false, start=1500e3)),
+    ExchangerFlueGasesMetal(
+      Dext=0.0318,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.39069779,
+      p_rho=1.06,
+      Encras(start=0.03)=Fouling_EHP4,
+      K(fixed=true, start=47.53),DeltaT(start={38,29,22}),
+      T(start={618.19360351563,612.7722894387,608.97249438439,606.41162109375}),
+      Tm(start={623.15,613.15,607.844}),
+      Tp(start={577.44979072627,582.41942947968,586.06092597683})))
+                          annotation (Placement(transformation(
+        origin={86,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_1(
+    Ns=3,
+    L=20.4,
+    Dint=0.0324,
+    Ntubes=246,
+    ExchangerWall(e=0.0028, lambda=37.61,
+    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
+      Tp(start={629.445777860324,651.664976699235,671.075818762815}),
+      Tp1(start={629,651,670.})),
+    Cws1(h_vol(start=2665000.0)),
+    Cws2(P(start=12720900.0), h_vol(start=2981170.0)),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=10.25056,
+      p_rho=1.04,
+      Encras(start=0.075)=Fouling_SHP,
+      K(fixed=false, start=34.71),      DeltaT(start={138,108,84}),
+      T(start={788.2431640625,774.65344332519,763.17487871399,755.54821777344}),
+      Tm(start={778.15,768.15,759.527}),
+      Tp(start={631.68675322573,653.38616970968,672.36458008039})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      option_temperature=2,
+      inertia=true,
+      dpfCorr=2,      dW1(start={9.8e6,7.7e6,5.9e6}),
+      Tp1(start={639.5,657,673}),
+      h(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983,
+            2973076.25}),
+      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
+      P(start={12723762,12723600,12723500,12720000,12719000})))
+         annotation (Placement(transformation(
+        origin={-64,-50},
+        extent={{-20,20},{20,-20}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_3(
+    Dint=26.6e-3,
+    Ntubes=1476,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
+      Tp(start={556.530623976228,563.226831750573,565.575075374951}),
+      Tp1(start={555.49,562.473,564.857})),
+    L=20.726,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.6e7,5.6e6,2.1e6}),
+      Tp1(start={558,565,567}),
+      h(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855,
+            1291418.875}),
+      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
+      P(start={13219333,13241000,13261000,13282000,13301176})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=12.451,
+      p_rho=1.08,
+      Encras(start=0.06)=Fouling_EHP3,
+      K(fixed=true, start=36.03),
+      St=5, DeltaT(start={34,12,4.4}),
+      T(start={602.67193603516,579.67183226637,571.50875350574,568.81030273438}),
+      Tm(start={593.15,583.15,571.919}),
+      Tp(start={557.01185690541,563.39937105652,565.63731055685})))      annotation (Placement(
+        transformation(
+        origin={206,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_2(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-5e6,-3e6,-2.e6}),
+      Tp(start={490.631370193221,498.229397165878,502.978053774656}),
+      Tp1(start={490,497.024,501.871})),
+    L=20.767,
+    Ntubes=1107,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={5e6,3e6,2.e6}),
+      Tp1(start={499,503,507}),
+      h(start={854494.5625,915007.018247822,957243.396653824,983786.364226731,
+            986348.9375}),
+      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
+      P(start={13129352,13152000,13175000,13197000,13219333})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=111e-3,
+      CSailettes=2.76134577,
+      p_rho=1.11,
+      Encras(start=0.11)=Fouling_EHP2,
+      K(fixed=true, start=65),
+      St=5, DeltaT(start={36,23,14}),
+      T(start={531.16070556641,523.74706132958,519.01561663699,516.31256103516}),
+      Tm(start={538.15,528.15,521.399}),
+      Tp(start={490.84070882241,498.36081646341,503.06064272486})))      annotation (Placement(
+        transformation(
+        origin={406,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_1(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-9.9999e6,-5e6,-2.4e6}),
+      Tp(start={458.958585923538,468.506814782426,473.132256983258}),
+      Tp1(start={458.001,467.576,472.607})),
+    L=20.726,
+    Ntubes=1107,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={9.9999e6,5e6,2.4e6}),
+      Tp1(start={467.4,476.5,480.9}),
+      h(start={618651.9375,752176.893518976,816707.727773953,847728.424287614,
+            854494.5625}),
+      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
+      dynamic_mass_balance=true,
+      P(start={13034956,13060000,13080000,13100000,13129352})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=8.30057632,
+      p_rho=1.13,
+      Encras(start=0.07)=Fouling_EHP1,
+      K(fixed=true, start=40.),
+      St=5,   DeltaT(start={41,20,10}),
+      T(start={509.31488037109,491.44087131458,484.15889910859,482.59533691406}),
+      Tm(start={503.15,498.15,494.131}),
+      Tp(start={459.37586976399,468.70800090382,473.22896941053})))      annotation (Placement(
+        transformation(
+        origin={526,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_2(
+    Ns=3,
+    L=20.4,
+    Dint=32e-3,
+    Ntubes=246,
+    ExchangerWall(e=3e-3, lambda=27,
+          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
+      Tp(start={714.604505161814,740.492493660215,759.200099714419}),
+      Tp1(start={710.485,734.082,752.527})),
+    Cws2(P(start=127113000.0), h_vol(start=3254970.0)),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.83,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={8.8e6,6.6e6,4.9e6}),
+      Tp1(start={714,735.6,752}),
+      h(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722,
+            3240813.5}),
+      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
+      P(start={12720371,12718000,12716000,12714000,12711007})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      CSailettes=10.2505424803872,
+      p_rho=1.02,
+      Encras(start=0.075)=Fouling_SHP,
+      K(fixed=false, start=34.74),
+      St=5,
+      DeltaT(start={124,93,70}),
+      T(start={850.64624023438,839.40882309811,830.36536707939,822.68170166016}),
+      Tm(start={843.15,833.15,825.24}),
+      Tp(start={717.48312916257,742.56566858011,760.69152533026})))      annotation (Placement(
+        transformation(
+        origin={-174,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_3(
+    Ns=3,
+    L=20.4,
+    Ntubes=246,
+    ExchangerWall(lambda=27,e=5e-3,
+    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
+      Tp(start={793.335674512128,811.477076678823,824.721389633254}),
+      Tp1(start={783.815,803.639,818.56})),
+    Dint=28e-3,
+    Cws2(h(fixed=true, start=3511e3)),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.726,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={6.3e6,4.7e6,3.6e6}),
+      Tp1(start={783.6,801.6,815}),
+      h(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987,
+            3433271.25}),
+      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
+      P(start={12711007,12704000,12697000,12689000,12681000})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      p_rho=1,
+      Encras(start=0.075)=Fouling_SHP,
+      CSailettes=6.59672846,
+      K(fixed=false, start=49.33),
+      St=5,
+      DeltaT(start={97,73,55}),
+      T(start={894.21850585938,885.5393240412,879.47464880089,874.32891845703}),
+      Tm(start={893.15,883.15,875.939}),
+      Tp(start={796.82789474964,814.05266276572,826.6253996051})))      annotation (Placement(
+        transformation(
+        origin={-294,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum IP_Drum(
+    L=16.27,
+    Vertical=false,
+    P0=27.29e5,
+    hl(fixed=false, start=978914.570821827),
+    hv(fixed=false, start=2799158.13966473),
+    Vv(fixed=false),
+    R=1.05,
+    P(fixed=false, start=28.3e5),
+    zl(start=1.05, fixed=true),
+    Kvl=0,
+    Kpa=5,
+    Mp=5000,
+    Cv(Q(fixed=true, start=10.9)),
+    Pfond(start=2732995.0),
+    Tp(start=500.955757665063))
+                     annotation (Placement(transformation(extent={{358,10},{320,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    IP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_FeedValve(
+      Cvmax=CvmaxValveAMP,
+    C1(P(start=2952995.0), h_vol(start=892414.570867188)),
+    h(start=944000),
+    Cv(start=28),
+    Pm(start=2945000))
+                 annotation (Placement(transformation(extent={{398,46},{378,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_SteamValve(
+    Pm(fixed=false, start=2731689.4244255),
+    C2(h_vol(start=2798000),P(start=27.3e5)),
+    h(fixed=false, start=2798000),
+    mode=0,
+    Cv(start=27829.4),
+    Cvmax=CvmaxValveVMP,
+    C1(P(start=28.3e5, fixed=true)))
+                 annotation (Placement(transformation(extent={{298,46},{278,66}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_Evaporator(
+    Dint=32.8e-3,
+    L=20.767,
+    Ntubes=738,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
+      Tp(start={504.957792851478,504.19488464586,503.59993822766}),
+      Tp1(start={504.427,503.806,503.304})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.83,
+      continuous_flow_reversal=true,
+      inertia=true,
+          dW1(start={9.7e7,7.6e6,5.8e6}),
+      Tp1(start={504.5,503.9,503.4}),
+      P(start={2773367.5,2754933.93610513,2745233.82043873,2738517.46232967,2733824.75}),
+      h(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464,980708.125}),
+      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=10.0676093,
+      p_rho=1.1,
+      Encras(start=0.08)=Fouling_EvMP,
+      K(fixed=false, start=46.9),
+      St=5,
+      DeltaT(start={53,41,32}),
+      T(start={565.24822998047,551.20973998682,539.98034586472,531.16070556641}),
+      Tm(start={553.15,543.15,536.901}),
+      Tp(start={505.45492567199,504.57970000924,503.89762940507})))              annotation (Placement(
+        transformation(
+        origin={306,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss IP_DownComer(
+    z2=0,
+    z1=10.83,
+    mode=1,
+    K=K_IP_DownComer,
+    Q(start=22, fixed=true),
+    Pm(start=2734000),
+    h(start=978914.570821827))
+            annotation (Placement(transformation(
+        origin={348,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
+    h(start=978914.570821827),
+    P(start=2834000))                      annotation (Placement(transformation(
+          extent={{328,-100},{308,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_Economizer(
+    ExchangerWall(e=2.6e-3, lambda=47,
+        dW1(start={-3e6,-1.4e6,-740379}),
+      Tp(start={457.584681885759,475.409334769727,486.332585528225}),
+      Tp1(start={456.76,474.926,485.122})),
+    L=20.726,
+    Ns=3,
+    Dint=26.6e-3,
+    Ntubes=246,
+    Cws1(h_vol(start=671235.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.767,
+      z2=0,
+      inertia=true,
+      dW1(start={3e6,1.4e6,740379}),
+      Tp1(start={474,491,499.9}),
+      h(start={565108.5,727745.440528479,829820.124314816,892414.570867187,
+            944505.4375}),
+      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
+      P(start={3124229.75,3148000,3172000,3195000,3216977.75})),
+    Cws2(h(fixed=false, start=990e3)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      CSailettes=7.16188651,
+      p_rho=1.12,
+      Encras(start=0.09)=Fouling_EMP,
+      K(fixed=true, start=50),
+      St=5,
+      DeltaT(start={45,24,13}),
+      T(start={516.31256103516,511.25046295073,508.31162431247,509.31488037109}),
+      Tm(start={533.15,523.15,514.647}),
+      Tp(start={458.18343678065,475.77644311925,486.55770446184})))              annotation (Placement(
+        transformation(
+        origin={466,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_1(
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.3e6,-0.80263e6,
+                                -501864}),
+      Tp(start={557.102699668877,574.070651369638,584.64928514972}),
+      Tp1(start={556.102699668877,573.070651369638,583.64928514972})),
+    L=20.726,
+    Ns=3,
+    Dint=32.8e-3,
+    Ntubes=123,
+    Cws1(h_vol(start=2800000.0),P(start=2.73467e+06)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      CSailettes=14.46509765,
+      p_rho=1.07,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=22.09),
+      St=5,
+      DeltaT(start={45,30,19}),
+      T(start={606.41162109375,604.22099235915,603.06310204059,602.67193603516}),
+      Tm(start={623.15,613.15,603.024}),
+      Tp(start={557.49575399383,574.31250418519,584.79699207547})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.77,
+      dpfCorr=2,
+      inertia=false,
+      dW1(start={1.3e6,0.80263e6,501864}),
+      Tp1(start={557,573,583}),
+      h(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156,
+            3040562.25}),
+      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
+      P(start={2731326.25,2729591.6901521,2728654.3204706,2727686.1714029,
+            2726700})))     annotation (Placement(transformation(
+        origin={146,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB VolumeLP(
+    Ce1(h(start=3091610.0)),
+    h(start=3042573.51976705),
+    P(start=2726000))
+    annotation (Placement(transformation(
+        origin={146,-110},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_2(
+    Ns=3,
+    L=20.4,
+    Dint=39.3e-3,
+    Ntubes=369,
+    ExchangerWall(e=2.6e-3, lambda=36.86,
+    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
+      Tp(start={689.66516778766,716.376344387713,734.591437191304}),
+      Tp1(start={687.7,713.5,731.5})),
+    Cws1(P(start=2576650.0), h_vol(start=3078800.0)),
+    Cws2(P(start=2558540.0), h_vol(start=3342910.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={1.15e7,7.9e6,5.5e6}),
+      Tp1(start={685.6,711,729}),
+      h(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389,
+            3321940.75}),
+      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
+      P(start={2575582.5,2572000,2568000,2563000,2558239})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=92e-3,
+      CSailettes=5.814209831,
+      p_rho=1.03,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=45.22),
+      St=5,
+      DeltaT(start={125,86,60}),
+      T(start={822.68170166016,807.90772072705,797.00284433443,788.2431640625}),
+      Tm(start={813.15,803.15,792.527}),
+      Tp(start={690.93545553661,717.24269857866,735.18209370035})))              annotation (Placement(
+        transformation(
+        origin={-114,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_3(
+    Ns=3,
+    L=20.4,
+    Ntubes=369,
+    Dint=45.6e-3,
+    ExchangerWall(e=2.6e-3, lambda=27,
+    dW1(start={-8e6,-5.5e6,-3.8e6}),
+      Tp(start={788.901616786331,805.674094596818,817.083010473709}),
+      Tp1(start={786.717,804.102,815.901})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={8e6,5.5e6,3.8e6}),
+      Tp1(start={782,798.7,810}),
+      h(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916,
+            3517975.25}),
+      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
+      P(start={2558239,2556000,2554000,2552000,2548600})),
+    Cws2(h(fixed=true, start=3606e3)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=92e-3,
+      Dext=50.8e-3,
+      p_rho=1.01,
+      CSailettes=5.695842178,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=43.23),
+      St=5,
+      DeltaT(start={82,56,38}),
+      T(start={874.32891845703,864.2444076086,856.92248545484,850.64624023438}),
+      Tm(start={873.15,863.15,853.059}),
+      Tp(start={789.92521486539,806.37044583028,817.55662835373})))              annotation (Placement(
+        transformation(
+        origin={-234,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum LP_Drum(
+    Vertical=false,
+    P0=5e5,
+    Vv(fixed=false),
+    L=8,
+    hl(fixed=false, start=549249.519022482),
+    hv(fixed=false, start=2709858.97470349),
+    R=2,
+    zl(start=1.75, fixed=true),
+    Kvl=0,
+    Kpa=5,
+    Mp=5000,
+    P(fixed=false, start=520000),
+    Cv(Q(fixed=true, start=9.23)),
+    Pfond(start=564775.0),
+    Tp(start=406.411032587651))
+                     annotation (Placement(transformation(extent={{618,10},{578,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    LP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_SteamValve(
+    p_rho=3, Cvmax=CvmaxValveVBP,
+    C2(P(start=503542.0), h_vol(start=2709858.97470349)),
+    h(start=2685000),
+    Cv(start=7555),
+    Pm(start=498000))
+                 annotation (Placement(transformation(extent={{558,46},{538,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_FeedValve(
+    C1(h_vol(start=511900.0)),
+    h(fixed=false, start=509000),
+    Pm(fixed=false, start=5.0698e5),
+    Cvmax=250,
+    Cv(start=142.5),
+    C2(P(fixed=true, start=5.2e5)))
+                 annotation (Placement(transformation(extent={{650,46},{630,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss LP_DownComer(
+    z2=0,
+    z1=10.767,
+    K=32766,
+    mode=1,
+    Q(start=20, fixed=false),
+    pro(d(start=934.452746556487)),
+    Pm(start=564000),
+    h(start=549249.519022482))
+            annotation (Placement(transformation(
+        origin={610,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=549249.519022482),
+                                                                       mode=1,
+    V=5,
+    P(start=523000))                                   annotation (Placement(
+        transformation(extent={{592,-100},{572,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_Evaporator(
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
+      Tp(start={433.127441964236,432.076030201586,431.28112439162}),
+      Tp1(start={432.956,431.127,430.61})),
+    L=20.726,
+    Ntubes=984,
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={1.24e7,8.5e6,5.8e6}),
+      Tp1(start={442.5,441.7,441}),
+      h(start={550075.0,765243.011613326,912673.256542569,1013555.73710231,
+            550075.0}),
+      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
+      Q(start={49.787311368631,49.787311368631,49.787311368631,49.787311368631}),
+      P(start={522583.375,488000,487000,486000,485588.46875})),
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=138e-3,
+      CSailettes=11.07985,
+      p_rho=1.14,
+      Encras(start=0.09)=Fouling_EvBP,
+      K(fixed=false, start=46.7),
+      St=5,
+      DeltaT(start={45,31,21}),
+      T(start={482.59533691406,464.53146753441,453.496360082,442.5893859863}),
+      Tm(start={483.15,478.15,472.098}),
+      Tp(start={433.5360639938,432.3549425205,431.471976456})))              annotation (Placement(
+        transformation(
+        origin={566,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_LP_Drum(k=0.25)
+    annotation (Placement(transformation(extent={{742,32},{728,44}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve(
+      Pm(start=5.0698e5), mode=1,
+    C1(h_vol(start=549249.519022482)),
+    h(start=550000),
+    Cv(start=308.931))
+                 annotation (Placement(transformation(extent={{710,12},{730,32}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_SuperHeater(
+    Ns=3,
+    L=20.726,
+    Dint=39.3e-3,
+    Ntubes=123,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.1e6,-782901,-559798}),
+      Tp(start={489.606851797367,513.610203520748,530.080624448955}),
+      Tp1(start={488.486,512.197,529.53})),
+    Cws1(h_vol(start=2642240.0),P(start=484264)),
+    Cws2(h_vol(start=2979330.0)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=222.1e-3,
+      K(fixed=true, start=30.46),
+      CSailettes=3.25763059984175,
+      p_rho=1.09,
+      Encras(start=0.05)=Fouling_SBP,
+      St=5,
+      DeltaT(start={92,66,47}),
+      T(start={568.81030273438,567.21003420557,566.29303411055,565.24822998047}),
+      Tm(start={583.15,573.15,568.703}),
+      Tp(start={489.84170505864,513.76963980951,530.18834052149})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      rugosrel=1e-5,
+      z1=10.767,
+      inertia=false,
+      dpfCorr=0.25,
+      dW1(start={1.1e6,782901,559798}),
+      Tp1(start={485,511,529}),
+      h(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762,
+            2914520.25}),
+      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
+      P(start={510622.6875,505757.57962259,504477.27858572,503172.36919354,501850})))      annotation (Placement(
+        transformation(
+        origin={266,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkP SinkP_Gas(P0=104400)
+    annotation (Placement(transformation(
+        origin={722,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_Economizer(
+    Ns=3,
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
+      Tp(start={398.142807363473,393.825926964772,392.943738968771}),
+      Tp1(start={397.622,392.348,391.516})),
+    Ntubes=3444,
+    L=20.726,
+    Cws1(h_vol(start=195526.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      inertia=true,
+      dpfCorr=0.5,
+      dW1(start={2.45e7,5.5e6,1.17e6}),
+      Tp1(start={409,404.7,404}),
+      h(start={194584.515625,462556.370989432,494648.45288738,501287.069880104,
+            509237.875}),
+      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
+      P(start={1540571.25,1500000,1480000,1450000,1429595.375})),
+    Cws2(h(fixed=false, start=500e3)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=92e-3,
+      CSailettes=11.673758598919,
+      p_rho=1.15,
+      Encras(start=0.06)=Fouling_EBP,
+      K(fixed=true, start=30),
+      St=5,
+      DeltaT(start={23.5,5.3,1.1}),
+      T(start={442.5893859863,403.9873508455,395.0465605839,395.464630127}),
+      Tm(start={423.15,418.15,414.742}),
+      Tp(start={398.4437772187,393.8897987349,392.9569515805})))              annotation (Placement(
+        transformation(
+        origin={680,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine HP_Turbine(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.88057),
+    eta_is_min=0.75,
+    Cst(start=8182844.56002535)=
+        CstHP,
+    Pe(fixed=true, start=125.20e5),
+    Ps(fixed=false, start=2726700),
+    eta_is_nom=EtaIsNomHP,
+    Cs(h(fixed=true, start=3106e3)),
+    pros(d(start=10.0)),
+    Hrs(start=3046260),
+    Qmax=151,
+    a=-1.20211,
+    b=2.32571,
+    c=-0.25) annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
+          rotation=0)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine IP_Turbine(
+    W_fric=1,
+    Ps(fixed=false, start=476800),
+    eta_stato=1,
+    eta_is(start=0.9625),
+    eta_is_min=0.75,
+    Cst(start=256335.364995961)=
+        CstMP,
+    Pe(fixed=true, start=25.13e5),
+    pros(d(start=30.0)),
+    Hrs(start=3029780),
+    Cs(h(fixed=false, start=2990e3)),
+    eta_is_nom=0.96,
+    b=2.4957,
+    Qmax=170,
+    a=-1.2728,
+    c=-0.26202)   annotation (Placement(transformation(extent={{318,-250},{358,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP1(
+    h(start=2997231.36734756),
+    P(start=476799.99999954),
+    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
+        origin={418,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine LP_Turbine(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9538),
+    eta_is_min=0.75,
+    Cst(start=11944.9445735985)=
+        CstBP,
+    Hrs(start=2401030),
+    Pe(fixed=true, start=4.77e5),
+        Ps(start=10053),
+    Cs(h(fixed=true, start=2399.9e3)),
+    eta_is_nom=EtaIsNomBP,
+    Qmax=192,
+    a=-1.22335,
+    b=2.2957,
+    c=-0.14)   annotation (Placement(transformation(extent={{576,-250},{616,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-292,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-232,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(Cs(h(start=3000000)),
+                                                    alpha=0.5)
+    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
+    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    Vf0=0.15,
+    steady_state=false,
+    yNiveau(signal(start=1.5)),
+    Cse(h(start=128076)),
+    P0=6100,
+    P(fixed=false, start=6136),
+    Pfond(start=6200)) annotation (Placement(transformation(extent={{639,-384},{
+            719,-304}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
+    h0=113.38e3, Q0=17224)       annotation (Placement(transformation(extent={{
+            572,-377},{620,-329}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_In(
+    K=1e-4,
+    h(start=2400000),
+    C1(h_vol(start=2400000), h(start=2400000)),
+    Q(start=190.55),
+    Pm(start=10026)) annotation (Placement(transformation(extent={{640,-240},{660,
+            -220}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
+    Ce3(h(start=163768.700887002)),
+    h(start=163768.700887002),
+    P(start=1540500))
+    annotation (Placement(transformation(
+        origin={902,-318},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out2(
+    K=1e-4,
+    mode=1,
+    pro(d(start=993.470128235971)),
+    Pm(start=1540000)) annotation (Placement(transformation(
+        origin={902,-270},
+        extent={{12,-12},{-12,12}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
+    h(start=549249.519022482),
+    P(start=322430))                       annotation (Placement(transformation(
+          extent={{742,6},{762,26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump IP_Pump(
+    a3=350,
+    mode=1,
+    Q(fixed=false, start=10.9),
+    a1=-244551,
+    C1(h_vol(start=576000.0)),
+    C2(h_vol(start=561000.0)),
+    h(start=571000.0),
+    hn(start=317),
+    Qv(start=0.0207237016869104),
+    pro(d(start=930.0)),
+    Pm(start=1725850))
+            annotation (Placement(transformation(extent={{804,6},{824,26}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump HP_Pump(
+    a3=1600,
+    a1=-28056.2,
+    Q(fixed=false),
+    mode=1,
+    C1(h_vol(start=561000.0)),
+    C2(h_vol(start=630000.0)),
+    h(start=630000),
+    hn(start=1413),
+    Qv(start=0.0810383142105344),
+    pro(d(start=929.0)),
+    Pm(start=6774000))  annotation (Placement(transformation(extent={{804,-46},
+            {824,-26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
+                                                    alpha=0.5,
+    h(start=194585),
+    P(start=1540500),
+    Cs(h(start=194585)))
+    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={266,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_LP_Turbine(
+    z2=0,
+    mode=0,
+    z1=0,
+    h(start=3000000),
+    C1(
+      h_vol(start=3000000),
+      h(start=3000000),
+      P(fixed=false, start=5.0185e5)),
+    K=1e-4,
+    Pm(start=490000)) annotation (Placement(transformation(
+        origin={344,-278},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_HP_Pump(
+    K=1e-4,
+    mode=1,
+    C2(h_vol(start=599600)),
+    Pm(start=372718)) annotation (Placement(transformation(
+        origin={780,-36},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_IP_Pump(
+    K=1e-4,
+    mode=1,
+    C2(h_vol(start=599600)),
+    Pm(start=372718)) annotation (Placement(transformation(
+        origin={780,16},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
+    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out(
+    K=1e-4,
+    mode=1,
+    C1(h_vol(start=153206.462779274)),
+    C2(h_vol(start=153206.462779274)),
+    pro(d(start=993.441492649513)),
+    Pm(start=6200)) annotation (Placement(transformation(extent={{702,-446},{722,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump LP_Pump(
+    Qv(start=0.1934),
+    mode=1,
+    a3=400,
+    C2(P(fixed=false, start=16.7e5), h_vol(start=194669.0)),
+    h(start=193000),
+    hn(start=183),
+    a1=LP_Pump_a1,
+    Q(start=193.43, fixed=false),
+    Pm(start=1103065, fixed=false)) annotation (Placement(transformation(extent=
+           {{742,-446},{762,-426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out1(
+    K=1e-4,
+    mode=1,
+    pro(d(start=994.045785814739)),
+    C1(h_vol(start=194585), h(start=194585)),
+    Pm(start=1546000)) annotation (Placement(transformation(extent={{840,-446},{
+            860,-426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ExtractionValve(
+    mode=1,
+    Cvmax=2500,
+    h(start=195000),
+    Cv(start=2000),
+    C1(h_vol(start=195000)),
+    C2(h_vol(start=195000)),
+    Pm(start=1549000)) annotation (Placement(transformation(extent={{802,-440},{
+            822,-420}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamHP(C1(h_vol(start=2674000),
+        h(start=2674000)))
+    annotation (Placement(transformation(
+        origin={-58,8},
+        extent={{-6,6},{6,-6}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterHP(C2(h_vol(start=1398000),
+        h(start=1398000)))
+    annotation (Placement(transformation(
+        origin={91.5,32},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterMP(C2(h_vol(start=944000),
+        h(start=944000)))
+    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamMP(C1(h_vol(start=2798000),
+        h(start=2798000)),C2(h_vol(start=2798000)))
+    annotation (Placement(transformation(
+        origin={236,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamBP(C2(h_vol(start=2685000),
+        h(start=2685000)))
+    annotation (Placement(transformation(
+        origin={514,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP(C2(h_vol(start=550000),
+        h(start=550000)))
+    annotation (Placement(transformation(
+        origin={663.5,34},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP_Out(C2(h_vol(start=550000),
+        h(start=550000))) annotation (Placement(transformation(extent={{687,15},
+            {700,27}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterCondenser(C2(h_vol(start=
+           194585), h(start=194585))) annotation (Placement(transformation(
+        origin={685.5,-412},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamCondenser(C2(h_vol(start=
+           2401000), h(start=2401000))) annotation (Placement(transformation(
+        origin={684.5,-264},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_2(
+    C1(
+      P(fixed=true, start=27.267e5),
+      h_vol(start=3046000),
+      h(start=3046000)),
+    K=K_Dp_HP_2,
+    Pm(start=2651000)) annotation (Placement(transformation(extent={{114,-120},{
+            94,-100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_Turbine_Valve(
+    mode=0,
+    h(fixed=false, start=3433000),
+    Cv(start=10875),
+    Pm(fixed=false, start=12550000),
+    C1(P(fixed=true, start=126.81e5)),
+    Cvmax=Cvmax_THP)
+                 annotation (Placement(transformation(extent={{-124,-234},{-104,
+            -214}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauHP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500,
+    minval=0.007) annotation (Placement(transformation(extent={{-40,106},{-20,
+            126}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauMP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500) annotation (Placement(transformation(extent={{262,106},{282,126}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauBP(                                                              k=1.75)
+    annotation (Placement(transformation(extent={{470,114},{504,132}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
+    add(k1=-1, k2=+1),
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauCondenseur1(                                 k=1.5)
+    annotation (Placement(transformation(extent={{704,-246},{740,-230}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+      add(k1=+1, k2=-1)) annotation (Placement(transformation(extent={{758,-282},
+            {778,-262}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneHP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
+            -138,-142}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp(
+    Initialvalue=1400,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=1300)
+                   annotation (Placement(transformation(extent={{944,-16},{906,
+            16}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP(
+    Initialvalue=1400,
+    Starttime=2000,
+    Duration=1000,
+    Finalvalue=700)
+                   annotation (Placement(transformation(extent={{945,-82},{907,
+            -50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingBP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{945,-458},{907,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
+    mode=1,
+    V=1,
+    h0=988332,
+    h(start=988332),
+    P0=70.1e5,
+    P(start=13129000),
+    dynamic_mass_balance=true)            annotation (Placement(transformation(
+          extent={{456,-98},{436,-78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
+    mode=1,
+    V=1,
+    h0=983786,
+    h(start=983786),
+    P0=70.0e5,
+    P(start=13219000),
+    dynamic_mass_balance=true)            annotation (Placement(transformation(
+          extent={{252,-20},{232,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve1(
+                          mode=1,
+    Cvmax=308.931,
+    h(start=618600),
+    Cv(start=308.931),
+    C1(h_vol(start=618600)),
+    Pm(start=13130000))
+                 annotation (Placement(transformation(extent={{754,-98},{730,
+            -122}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve2(
+      Pm(start=3126000), mode=1,
+    Q(start=10.9, fixed=false),
+    h(start=565000),
+    C1(h_vol(start=565000)),
+    Cv(start=308.931),
+    Cvmax=308.931)
+                 annotation (Placement(transformation(extent={{804,-138},{780,
+            -162}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp1(
+    Initialvalue=0.8,
+    Duration=800,
+    Starttime=2000,
+    Finalvalue=0.01) annotation (Placement(transformation(extent={{946,-150},{
+            908,-118}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP1(
+    Initialvalue=0.8,
+    Duration=800,
+    Starttime=2000,
+    Finalvalue=0.01) annotation (Placement(transformation(extent={{946,-194},{
+            908,-162}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
+    P0=127e5,
+    h0=3e6,
+    P(start=127e5),
+    h(start=3450835.48993987),
+    dynamic_mass_balance=true)        annotation (Placement(transformation(
+        origin={-52,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP(
+    h0=3523910,
+    h(start=3523910),
+    dynamic_mass_balance=true,
+    P0=2400000,
+    P(start=24e5))                        annotation (Placement(transformation(
+        origin={-50,-314},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_Turbine_Valve(
+    h(fixed=false, start=3518000),
+    mode=0,
+    Pm(fixed=false, start=2547000),
+    Cv(start=3.312e6),
+    C1(P(fixed=true, start=25.486e5)),
+    Cvmax=Cvmax_TMP)
+                 annotation (Placement(transformation(extent={{-124,-318},{-104,
+            -298}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneIP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
+            -138,-226}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
+    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
+    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
+    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
+
+  WaterSteam.Volumes.VolumeA SeparateurMP(h(start=3106000), P(start=27.26e+005),
+    rho(start=10))
+    annotation (Placement(transformation(
+        origin={74,-200},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_1(
+    K=1e-4,
+    pro(d(start=10)),
+    h(start=3106000),
+    C1(
+      P(start=27.26e+005),
+      h_vol(start=3106000),
+      Q(start=153),
+      h(start=3106000)),
+    C2(
+      P(start=27.259e+005),
+      h_vol(start=3106000),
+      Q(start=153),
+      h(start=3106000)),
+    Pm(start=2726000)) annotation (Placement(transformation(extent={{88,-182},{102,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_IP_PressureLoss(
+    Q(fixed=true, start=3.09),
+    continuous_flow_reversal=true,
+    h(start=3106000),
+    C1(
+      P(start=27.26e+005),
+      h_vol(start=3106000),
+      h(start=3106000),
+      Q(start=3.09)),
+    C2(
+      P(start=27.259e+005),
+      h_vol(start=3106000),
+      h(start=3106000),
+      Q(start=3.09)),
+    K=K_Dp_HP_IP,
+    Pm(start=2726000)) annotation (Placement(transformation(extent={{134,-210},{
+            154,-190}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe Q_water(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=21000,
+    Finalvalue=15000)
+                   annotation (Placement(transformation(extent={{555,-364},{575,
+            -344}}, rotation=0)));
+  FlueGases.BoundaryConditions.SourceQ SourceFumees(
+    Xso2=0,
+    T0=893.75,
+    Q0=606.94,
+    Xco2=0.0604033,
+    Xh2o=0.076375,
+    Xo2=0.111559)
+    annotation (Placement(transformation(extent={{-451,-92},{-349,-8}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps FuelMassFlowRate(Table=[0,
+        606.941; 10,606.941; 600,50; 650,50]) annotation (Placement(
+        transformation(extent={{-505,-26},{-435,48}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps GasTemperature(Table=[0,
+        893.76; 10,893.76; 600,423.16; 650,423.16]) annotation (Placement(
+        transformation(extent={{-505,-164},{-435,-90}}, rotation=0)));
+equation
+  connect(HP_SuperHeater_3.Cws1, HP_SuperHeater_2.Cws2)
+    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
+        color={255,0,0}));
+  connect(HP_SuperHeater_2.Cws1, HP_SuperHeater_1.Cws2)
+    annotation (Line(points={{-174,-70},{-174,-90},{-64,-90},{-64,-70}}, color=
+          {255,0,0}));
+  connect(HP_SteamValve_Constante.y, HP_SteamValve.Ouv)
+    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
+  connect(HP_SteamValve.C1, HP_Drum.Cv)
+    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
+  connect(HP_DownComer.C1, HP_Drum.Cd)
+    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={0,0,0}));
+  connect(HP_Drum.Cm, HP_Evaporator.Cws2)
+    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}, color={0,0,0}));
+  connect(VolumeEvapHP.Cs, HP_Evaporator.Cws1)
+    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={0,0,0}));
+  connect(VolumeEvapHP.Ce1, HP_DownComer.C2)
+                                      annotation (Line(points={{8,-90},{18,-90}},
+        color={0,0,0}));
+  connect(HP_Economizer_4.Cws1, HP_Economizer_3.Cws2)
+    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
+  connect(IP_Drum.Cm, IP_Evaporator.Cws2)
+    annotation (Line(points={{320,10},{306,10},{306,-30}}, color={0,0,0}));
+  connect(IP_Evaporator.Cws1, VolumeEvapMP.Cs)
+    annotation (Line(points={{306,-70},{306,-90},{308,-90}}, color={0,0,0}));
+  connect(VolumeEvapMP.Ce1, IP_DownComer.C2)
+    annotation (Line(points={{328,-90},{338,-90}}, color={0,0,0}));
+  connect(IP_SteamValve_Constante.y, IP_SteamValve.Ouv)
+    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
+  connect(HP_SuperHeater_1.Cfg2, HP_Evaporator.Cfg1)        annotation (Line(
+      points={{-54,-50},{-54,-50},{-24,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Evaporator.Cfg2, HP_Economizer_4.Cfg1)        annotation (Line(
+      points={{-4,-50},{96,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_4.Cfg2, IP_SuperHeater_1.Cfg1)          annotation (Line(
+      points={{76,-50},{136,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_1.Cfg2, HP_Economizer_3.Cfg1)           annotation (Line(
+      points={{156,-50},{196,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_Evaporator.Cfg2, HP_Economizer_2.Cfg1)           annotation (Line(
+      points={{316,-50},{396,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_2.Cfg2, IP_Economizer.Cfg1)           annotation (Line(
+      points={{416,-50},{456,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_Economizer.Cfg2, HP_Economizer_1.Cfg1)           annotation (Line(
+      points={{476,-50},{516,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_DownComer.C1, IP_Drum.Cd)
+    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={0,0,
+          0}));
+  connect(IP_SuperHeater_2.Cfg2, HP_SuperHeater_1.Cfg1)          annotation (Line(
+      points={{-104,-50},{-74,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_2.Cfg1, HP_SuperHeater_2.Cfg2)           annotation (Line(
+      points={{-124,-50},{-164,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_3.Cfg2, HP_SuperHeater_2.Cfg1)           annotation (Line(
+      points={{-224,-50},{-184,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_SuperHeater_3.Cfg2, IP_SuperHeater_3.Cfg1)           annotation (Line(
+      points={{-284,-50},{-244,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_3.Cws1,IP_SuperHeater_2. Cws2)
+    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
+          {255,0,0}));
+  connect(IP_SuperHeater_1.Cws2, VolumeLP.Ce2) annotation (Line(
+      points={{146,-70},{146,-100}},
+      color={255,0,0},
+      pattern=LinePattern.None));
+  connect(LP_SteamValve.C1, LP_Drum.Cv)
+    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
+  connect(LP_Evaporator.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
+          -70},{566,-90},{572,-90}}, color={0,0,0}));
+  connect(VolumeEvapBP.Ce1, LP_DownComer.C2)
+                                        annotation (Line(points={{592,-90},{600,
+          -90}}, color={0,0,0}));
+  connect(LP_Drum.Cd, LP_DownComer.C1) annotation (Line(points={{618,10},{628,
+          10},{628,-90},{620,-90}}, color={0,0,0}));
+  connect(LP_Economizer.Cfg2, SinkP_Gas.C)     annotation (Line(
+      points={{690,-50},{712.2,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_3.Cfg2, LP_SuperHeater.Cfg1)  annotation (Line(
+      points={{216,-50},{256,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_SuperHeater.Cfg2, IP_Evaporator.Cfg1)  annotation (Line(
+      points={{276,-50},{296,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_1.Cfg2, LP_Evaporator.Cfg1) annotation (Line(
+      points={{536,-50},{556,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_Evaporator.Cfg2, LP_Economizer.Cfg1) annotation (Line(
+      points={{576,-50},{670,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_Drum.Cm, LP_Evaporator.Cws2)
+    annotation (Line(points={{578,10},{566,10},{566,-30}}, color={0,0,0}));
+  connect(IP_SteamValve.C1, IP_Drum.Cv)   annotation (Line(points={{298,50},{
+          320,50}}, color={255,0,0}));
+  connect(HPIP_FeedValve.Ouv, constante_LP_Drum.y)
+    annotation (Line(points={{720,33},{720,38},{727.3,38}}));
+  connect(HP_SuperHeater_3.Cws2, DoubleDebitHP.Ce)
+    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
+        color={255,0,0}));
+  connect(IP_SuperHeater_3.Cws2, DoubleDebitMP.Ce)
+    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
+        color={255,0,0}));
+  connect(VolumeCond1.Cs, Dp_Cond_Out2.C1)
+    annotation (Line(points={{902,-308},{902,-282}}, color={0,0,255}));
+  connect(HPIP_FeedValve.C2, VolumeAlimMPHP.Ce1)
+                                               annotation (Line(points={{730,16},
+          {742,16}}, color={0,0,255}));
+  connect(LP_SuperHeater.Cws2, DoubleDebitBP.Ce)
+    annotation (Line(points={{266,-70},{266,-90}}, color={255,0,0}));
+  connect(DP_IP_Pump.C2, IP_Pump.C1)
+    annotation (Line(points={{790,16},{798,15},{804,16}}, color={0,0,255}));
+  connect(VolumeAlimMPHP.Cs1, DP_IP_Pump.C1) annotation (Line(points={{762,16},{
+          766,15},{766,16},{770,16}}, color={0,0,255}));
+  connect(VolumeAlimMPHP.Cs2, DP_HP_Pump.C1)
+    annotation (Line(points={{752,6},{752,-36},{770,-36}}, color={0,0,255}));
+  connect(DP_HP_Pump.C2, HP_Pump.C1)
+    annotation (Line(points={{790,-36},{804,-36}}, color={0,0,255}));
+  connect(VolumeIP1.Ce2, Dp_LP_Turbine.C2) annotation (Line(points={{418,-239},{
+          418,-278},{354,-278}}, color={255,0,0}));
+  connect(Dp_Cond_Out.C2, LP_Pump.C1)
+    annotation (Line(points={{722,-436},{742,-436}}, color={0,0,255}));
+  connect(ExtractionValve.C2, Dp_Cond_Out1.C1)
+    annotation (Line(points={{822,-436},{840,-436}}, color={0,0,255}));
+  connect(HP_FeedValve.C1, SensorQ_WaterHP.C2)
+    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
+  connect(HP_SteamValve.C2, SensorQ_SteamHP.C1) annotation (Line(points={{
+          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
+  connect(SensorQ_SteamHP.C2, HP_SuperHeater_1.Cws1) annotation (Line(points={{-53.2,
+          1.88},{-53.2,-3.06},{-64,-3.06},{-64,-30}},        color={255,0,0}));
+  connect(IP_FeedValve.C1, SensorQ_WaterMP.C2)
+    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
+  connect(SensorQ_SteamMP.C1, IP_SteamValve.C2) annotation (Line(points={{
+          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
+  connect(SensorQ_SteamMP.C2, IP_SuperHeater_1.Cws1) annotation (Line(points={
+          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
+  connect(SensorQ_SteamBP.C2, LP_SuperHeater.Cws1) annotation (Line(points={{
+          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
+  connect(SensorQ_SteamBP.C1, LP_SteamValve.C2) annotation (Line(points={{
+          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
+  connect(SensorQ_WaterBP.C2, LP_FeedValve.C1) annotation (Line(
+        points={{658.3,40.12},{658.3,50},{650,50}}, color={0,0,255}));
+  connect(SensorQ_WaterBP_Out.C2, HPIP_FeedValve.C1) annotation (Line(points={{700.13,
+          16.2},{705.065,16.2},{705.065,16},{710,16}}, color={0,0,255}));
+  connect(SensorQ_WaterCondenser.C2, Dp_Cond_Out.C1) annotation (Line(points={{680.3,
+          -422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
+  connect(Dp_Cond_In.C2, SensorQ_SteamCondenser.C1) annotation (Line(points={{660,
+          -230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
+  connect(VolumeLP.Ce1, MoitieDebitHP.Cs)
+    annotation (Line(points={{146,-120},{146,-170},{134,-170}}, color={255,0,0}));
+  connect(Dp_Cond_Out1.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,-436},
+          {862,-436},{862,-318},{872,-318}}, color={0,0,255}));
+  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
+          {892,-318}}, color={0,0,255}));
+  connect(IP_SuperHeater_2.Cws1, HP_PressureLoss_2.C2) annotation (Line(points={{-114,-70},
+          {-114,-110},{94,-110}}, color={255,0,0}));
+  connect(HP_PressureLoss_2.C1, VolumeLP.Cs2)
+    annotation (Line(points={{114,-110},{136.2,-110}}, color={255,0,0}));
+  connect(DoubleDebitHP.Cs, HP_Turbine_Valve.C1) annotation (Line(points=
+          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
+  connect(DoubleDebitBP.Cs, Dp_LP_Turbine.C1) annotation (Line(points={{266,-110},
+          {266,-278},{334,-278}}, color={255,0,0}));
+  connect(LP_Pump.C2, ExtractionValve.C1)
+    annotation (Line(points={{762,-436},{802,-436}}, color={0,0,255}));
+  connect(HP_Drum.yLevel,regulation_Niveau_HP. MesureNiveauEau)
+    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
+  connect(regulation_Niveau_HP.SortieReelle1, HP_FeedValve.Ouv)
+    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
+  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
+    annotation (Line(
+      points={{208.7,122},{234,122},{234,110},{261.5,110}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(IP_Drum.yLevel,regulation_Niveau_MP. MesureNiveauEau)
+    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
+  connect(regulation_Niveau_MP.SortieReelle1, IP_FeedValve.Ouv)
+    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
+  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
+    annotation (Line(
+      points={{505.7,123},{529.85,123},{529.85,112},{567.5,112}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(LP_Drum.yLevel,regulation_Niveau_BP. MesureNiveauEau)
+    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
+  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
+    annotation (Line(
+      points={{741.8,-238},{752,-238},{752,-269},{757.5,-269}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(regulation_Niveau_Condenseur.SortieReelle1, ExtractionValve.Ouv)
+    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
+  connect(SensorQ_WaterBP.C1, LP_Economizer.Cws2)
+    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
+  connect(LP_Economizer.Cws1, Dp_Cond_Out2.C2)
+    annotation (Line(points={{680,-70},{680,-186},{902,-186},{902,-258}}));
+  connect(SensorQ_SteamCondenser.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
+    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,-280.9}}));
+  connect(regulation_Niveau_Condenseur.MesureDebitEau, SensorQ_WaterCondenser.Measure)
+    annotation (Line(points={{757.45,-274.95},{750,-274.95},{750,-310},{792,-310},
+          {792,-412},{692.13,-412}}));
+  connect(ConstantVanneHP_Turbine.y, HP_Turbine_Valve.Ouv)
+    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
+  connect(regulation_Niveau_BP.SortieReelle1, LP_SteamValve.Ouv)
+    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
+  connect(LP_FeedValve.Ouv, LP_SteamValve_Constante.y)
+    annotation (Line(points={{640,67},{640,81},{653.4,81}}));
+  connect(HP_Economizer_1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
+          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
+  connect(VolumeECO_HP1_2.Cs, HP_Economizer_2.Cws1) annotation (Line(points={{
+          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
+  connect(HP_Economizer_2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
+          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
+  connect(VolumeECO_HP2_3.Cs, HP_Economizer_3.Cws1) annotation (Line(points={{
+          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
+  connect(HPIP_FeedValve1.C1, HP_Pump.C2)
+    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-36},{824,-36}}));
+  connect(IP_Pump.C2, HPIP_FeedValve2.C1) annotation (Line(points={
+          {824,16},{870,16},{870,-142.8},{804,-142.8}}, color={0,0,255}));
+  connect(StopPumpingMp1.y, HPIP_FeedValve1.Ouv)
+    annotation (Line(
+      points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,-123.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(StopPumpingHP1.y, HPIP_FeedValve2.Ouv)
+    annotation (Line(
+      points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,-163.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(HPIP_FeedValve1.C2, HP_Economizer_1.Cws1) annotation (Line(
+        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
+          -6},{526,-30}}, color={0,0,255}));
+  connect(IP_Economizer.Cws1, HPIP_FeedValve2.C2)
+    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
+  connect(ConstantVanneIP_Turbine.y, IP_Turbine_Valve.Ouv)
+    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
+  connect(HP_Turbine_Valve.C2, VolumePreTHP.Ce) annotation (Line(points={
+          {-104,-230},{-62,-230}}, color={255,0,0}));
+  connect(DoubleDebitMP.Cs, IP_Turbine_Valve.C1) annotation (Line(points=
+          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
+  connect(IP_Turbine_Valve.C2, VolumeIP.Ce1) annotation (Line(
+        points={{-104,-314},{-60,-314}}, color={255,0,0}));
+  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(points={{620,-353},
+          {638,-353},{638,-352},{639,-352.8}}, color={0,0,255}));
+  connect(Condenser.Cse, PuitsCaloporteur.C)
+    annotation (Line(points={{719,-352},{736,-352}}, color={0,0,255}));
+  connect(SensorQ_SteamCondenser.C2, Condenser.Cv) annotation (Line(points={{679.3,
+          -274.2},{679.3,-288.1},{679,-288.1},{679,-304}}, color={0,0,255}));
+  connect(SensorQ_WaterCondenser.C1, Condenser.Cl)
+    annotation (Line(points={{680.3,-402},{679.8,-402},{679.8,-384}}));
+  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
+    annotation (Line(
+      points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(Condenser.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
+    annotation (Line(points={{723,-372.8},{780,-372.8},{780,-326},{732,-326},{732,
+          -263},{757.5,-263}}));
+  connect(LP_Drum.Cs, SensorQ_WaterBP_Out.C1) annotation (Line(points={{578,22},
+          {564,22},{564,16},{642,16},{642,16.2},{687,16.2}}, color={0,0,255}));
+  connect(LP_Drum.Ce1, LP_FeedValve.C2)
+    annotation (Line(points={{618,50},{630,50}}));
+  connect(IP_Drum.Ce1, IP_FeedValve.C2)
+    annotation (Line(points={{358,50},{378,50}}));
+  connect(HP_Drum.Ce1, HP_FeedValve.C2)
+    annotation (Line(points={{38,50},{58,50}}));
+  connect(VolumePreTHP.Cs3, HP_Turbine.Ce) annotation (Line(points={{-42,-230},{
+          -2.2,-230}}, color={255,0,0}));
+  connect(VolumeIP.Cs, IP_Turbine.Ce) annotation (Line(points={{-40,-314},
+          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
+  connect(IP_Turbine.Cs, VolumeIP1.Ce1) annotation (Line(points={{358.2,
+          -230},{408,-230}}, color={255,0,0}));
+  connect(VolumeIP1.Cs, LP_Turbine.Ce) annotation (Line(points={{428,
+          -230},{575.8,-230}}, color={255,0,0}));
+  connect(LP_Turbine.Cs, Dp_Cond_In.C1)
+    annotation (Line(points={{616.2,-230},{640,-230}}, color={255,0,0}));
+  connect(IP_Economizer.Cws2, SensorQ_WaterMP.C1) annotation (Line(points={{
+          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
+  connect(IP_Turbine.MechPower, Alternateur.Wmec2)
+    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
+  connect(LP_Turbine.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
+          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
+  connect(HP_Turbine.MechPower, Alternateur.Wmec3)
+    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
+  connect(heatSource.C[1], HP_Drum.Cex) annotation (Line(points={{18,68.3},{18,
+          50}}, color={191,95,0}));
+  connect(heatSource1.C[1], IP_Drum.Cex) annotation (Line(points={{339,68.3},{
+          339,50}}, color={191,95,0}));
+  connect(heatSource2.C[1], LP_Drum.Cex) annotation (Line(points={{598,64.3},{
+          598,50}}, color={191,95,0}));
+  connect(SensorQ_WaterHP.C1, HP_Economizer_4.Cws2)
+    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
+  connect(IP_Pump.rpm_or_mpower, StopPumpingMp.y)
+    annotation (Line(
+      points={{814,5},{814,0},{904.1,0}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+  connect(HP_Pump.rpm_or_mpower, StopPumpingHP.y)
+    annotation (Line(
+      points={{814,-47},{814,-66},{905.1,-66}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+  connect(LP_Pump.rpm_or_mpower, StopPumpingBP.y) annotation (Line(
+      points={{752,-447},{754,-447},{754,-456},{878,-456},{878,-442},{905.1,-442}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+
+  connect(HP_Turbine.Cs,SeparateurMP. Ce1)   annotation (Line(points={{38.2,-230},
+          {74,-230},{74,-210}}, color={255,0,0}));
+  connect(SeparateurMP.Cs1, HP_PressureLoss_1.C1)
+    annotation (Line(points={{74,-190},{74,-170},{88,-170}}, color={255,0,0}));
+  connect(HP_PressureLoss_1.C2, MoitieDebitHP.Ce)
+    annotation (Line(points={{102,-170},{114,-170}}, color={0,0,255}));
+  connect(SeparateurMP.Cs2, HP_IP_PressureLoss.C1)
+    annotation (Line(points={{84,-200},{134,-200}}, color={255,0,0}));
+  connect(HP_IP_PressureLoss.C2, VolumeIP1.Ce3) annotation (Line(points={{154,-200},
+          {418,-200},{418,-220}}, color={255,0,0}));
+  connect(Q_water.y, SourceCaloporteur.IMassFlow)
+    annotation (Line(points={{576,-354},{582,-354},{582,-341},{596,-341}}));
+  connect(GasTemperature.y, SourceFumees.ITemperature)
+    annotation (Line(points={{-431.5,-127},{-400,-127},{-400,-71}}));
+  connect(FuelMassFlowRate.y, SourceFumees.IMassFlow)
+    annotation (Line(points={{-431.5,11},{-400,11},{-400,-29}}));
+  connect(SourceFumees.C, HP_SuperHeater_3.Cfg1) annotation (Line(
+      points={{-349,-50},{-327.5,-50},{-327.5,-50},{-304,-50}},
+      color={0,0,0},
+      thickness=1));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-550,
+            -460},{950,150}},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-507,-25},{-469,-51}},
+          lineColor={255,0,0},
+          textString=
+               "GT"),
+        Text(
+          extent={{-517,-45},{-411,-72}},
+          lineColor={255,0,0},
+          textString=
+               "Exhaust")}), experiment(StopTime=10000),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end GasTurbineTrip;
diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/LoadVariation.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/LoadVariation.mo
index 074937eb15d999361d6a9efa7c01aab25e0e9dcf..c9ee471b5d5ce7a46c14c1a57bb5cb23fb19edec 100644
--- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/LoadVariation.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/LoadVariation.mo
@@ -1,1962 +1,1962 @@
-within ThermoSysPro.Fluid.Examples.Book.PowerPlants.CombinedCyclePowerPlant;
-model LoadVariation "CCPP model to simulate a load variation from 100% to 50%"
-  import ThermoSysPro;
-  parameter Real CstHP(fixed=false,start=7618660.65374636)
-    "Stodola's ellipse coefficient HP";
-  parameter Real EtaIsNomHP(fixed=false,start=0.875)
-    "Turbine HP: Nominal isentropic efficiency ";
-  parameter Real CstMP(fixed=false,start=278905.664031036)
-    "Stodola's ellipse coefficient MP";
-  //parameter Real EtaIsNomMP(fixed=false,start=0.96)
-  //  "Turbine MP: Nominal isentropic efficiency ";
-  parameter Real CstBP(fixed=false,start=13491.6445678148)
-    "Stodola's ellipse coefficient BP";
-  parameter Real EtaIsNomBP(fixed=false,start=0.92)
-    "Turbine MP: Nominal isentropic efficiency ";
-// //
-  //parameter Modelica.SIunits.AbsolutePressure PoutPumpEx(fixed=false,start=22e5)"Flow pressure at the outlet of the pump";
-  //parameter Modelica.SIunits.Length zc(fixed=false,start=1.5) "Condenser water level";
-
-  parameter Real LP_Pump_a1(fixed=false,start=-6000)
-    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-
-  //parameter Real a3_PumpBP(fixed=false,start=400)"Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVHP(fixed=false, start=47829.4)
-    "Maximum CV: steame valve HP Drum  ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVMP(fixed=false, start=47829.4)
-    "Maximum CV: steame valve  Drum MP";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
-    "Maximum CV: steame valve BP Drum ";
-
-  //parameter ThermoSysPro.Units.Cv CvmaxValveWBP(fixed=false,start=10000)
-  //  "Maximum CV: Water valve BP Drum ";
-
-  parameter Real Fouling_SHP(fixed=false,start=0.075)
-    "Sur HP: heat exchange fouling coefficient";
-
-  //parameter Real Fouling_EHP(fixed=false,start=1)
-  //  "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP1(fixed=false,start=0.07)
-    "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP2(fixed=false,start=0.11)
-    "Eco HP2: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP3(fixed=false,start=0.06)
-    "Eco HP3: heat exchange fouling coefficient";
-  parameter Real Fouling_EHP4(fixed=false,start=0.03)
-    "Eco HP4: heat exchange fouling coefficient";
-
-  parameter Real Fouling_SMP(fixed=false,start=0.1358)
-    "Sur MP1: heat exchange fouling coefficient";
-
-  //parameter Real Fouling_SMP(fixed=true,start=0.065)
-  //  "Sur MP1: heat exchange fouling coefficient";
-
-  parameter Real Fouling_EMP(fixed=false,start=0.09)
-    "Eco MP: heat exchange fouling coefficient";
-
-  parameter Real Fouling_EvHP(fixed=false,start=0.24)
-    "Evapo HP: heat exchange fouling coefficient";
-  parameter Real Fouling_EvMP(fixed=false,start=0.08)
-    "Evapo MP: heat exchange fouling coefficient";
-  parameter Real Fouling_EvBP(fixed=false,start=0.09)
-    "Evapo BP: heat exchange fouling coefficient";
-
-  parameter Real Fouling_SBP(fixed=false,start=0.05)
-    "Sur BP: heat exchange fouling coefficient";
-  parameter Real Fouling_EBP(fixed=false,start=0.06)
-    "Eco BP: heat exchange fouling coefficient";
-
-  parameter Real K_HP_DownComer(fixed=false,start=720.183)
-    "HP: Friction pressure loss coefficient";
-  parameter Real K_IP_DownComer(fixed=false,start=1090.9)
-    "MP: Friction pressure loss coefficient";
-  parameter Real K_Dp_HP_2(fixed=false,start=10.)
-    "SMPin: Friction pressure loss coefficient";
-
-  //parameter Real K_PerteChargeZero2(fixed=true,start=1e-4)
-  //  "TurbineMP out: Friction pressure loss coefficient";
-  parameter Real K_Dp_HP_IP(fixed=false,start=1.)
-    "Outlet THP: Friction pressure loss coefficient";
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
-    "Maximum CV input Turbine HP ";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
-    "Maximum CV input Turbine MP ";
-
-  parameter Real C_tau_n(fixed=false,start=14)
-    "Compressor: Nominal compression rate";
-  parameter Real C_is_eff_n(fixed=false,start=0.92)
-    "Compressor: Nominal isentropic efficiency";
-
-  parameter Real T_Qred(fixed=false,start=0.0178)
-    "GazTurbine: reduced mass flow rate";
-  parameter Real T_is_eff_n(fixed=false,start=0.92)
-    "GazTurbine: Nominal isentropic efficiency";
-
-  parameter Real C_Kcham(fixed=false,start=5.05)
-    "CombustionChamber: pressure loss coefficient";
-
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum HP_Drum(
-    L=16.27,
-    Vertical=false,
-    hl(fixed=false, start=1474422.14552527),
-    hv(fixed=false, start=2666558.75582585),
-    Vv(fixed=false),
-    R=1.05,
-    xmv(fixed=false),
-    P(fixed=false, start=12703151.2960688),
-    zl(start=1.05, fixed=true),
-    Mp=5000,
-    Kpa=5,
-    Kvl=1000,
-    Pfond(start=12703151.3),
-    Tp(start=596.924860294475),
-    Cv(Q(fixed=true, start=76.58)))
-                     annotation (Placement(transformation(extent={{38,10},{-2,
-            50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_FeedValve(
-    Cvmax=CvmaxValveAHP,
-    C1(P(start=12721657.0), h_vol(start=1396865.59043578)),
-    h(start=1398000),
-    Cv(start=178),
-    Pm(start=13050700))
-                 annotation (Placement(transformation(extent={{78,46},{58,66}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    HP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_SteamValve(
-    mode=0,
-    C2(h_vol(start=2666558.75582585),P(start=12700000.0)),
-    h(start=2674000),
-    Cv(start=23914.7),
-    Pm(start=12721657.16928),
-    C1(P(start=132.1e5, fixed=true)),
-    Cvmax=CvmaxValveVHP)
-                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_DownComer(
-    z2=0,
-    mode=1,
-    Q(start=150, fixed=true),
-    z1=10.83,
-    K=K_HP_DownComer,
-    C2(P(start=12768600.0)),
-    h(start=1474422.14552527),
-    Pm(start=12704000))
-            annotation (Placement(transformation(
-        origin={28,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,     h(start=1474422.14552527))
-                                           annotation (Placement(transformation(
-          extent={{8,-100},{-12,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Evaporator(
-    Dint=32.8e-3,
-    Ntubes=1476,
-    L=20.7,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
-      Tp(start={607.668721736158,605.187884376142,603.825778846274}),
-      Tp1(start={606.357,604.602,603.578})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=10.83,
-      option_temperature=2,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={5.74e7,2.67e7,1.24e7}),
-      Tp1(start={606.2,604.6,603.7}),
-      h(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134,
-            1459929.875}),
-      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
-      P(start={12758125,12740000,12734000,12730000,12726787})),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.092,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.86442072,
-      p_rho=1.05,
-      Encras(start=0.24)=Fouling_EvHP,
-      K(fixed=false, start=407),      DeltaT(start={106,49,23}),
-      T(start={755.54821777344,673.68082608925,635.57157972092,618.19360351563}),
-      Tm(start={643.15,633.15,626.621}),
-      Tp(start={609.11670087771,605.86035558168,604.13687003529})))
-                          annotation (Placement(transformation(
-        origin={-14,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_4(
-    Ns=3,
-    L=20.726,
-    Dint=0.0266,
-    Ntubes=246,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-3.5e6,-2.63e6,-2e6}),
-      Tp(start={576.803345033827,581.933438017921,585.694098500999}),
-      Tp1(start={575.762,580.856,584.579})),
-    Cws1(P(start=13703700.0), h_vol(start=1306078.18827954)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      z2=0,
-      option_temperature=2,
-inertia=true,
-      dW1(start={3.5e6,2.63e6,2e6}),
-      Tp1(start={577.5,582.6,586.4}),
-      h(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578,
-            1398251.0}),
-      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
-      P(start={13301176,13320000,13338000,13357000,13374658})),
-    Cws2(h(fixed=false, start=1500e3)),
-    ExchangerFlueGasesMetal(
-      Dext=0.0318,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.39069779,
-      p_rho=1.06,
-      Encras(start=0.03)=Fouling_EHP4,
-      K(fixed=true, start=47.53),DeltaT(start={38,29,22}),
-      T(start={618.19360351563,612.7722894387,608.97249438439,606.41162109375}),
-      Tm(start={623.15,613.15,607.844}),
-      Tp(start={577.44979072627,582.41942947968,586.06092597683})))
-                          annotation (Placement(transformation(
-        origin={86,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_1(
-    Ns=3,
-    L=20.4,
-    Dint=0.0324,
-    Ntubes=246,
-    ExchangerWall(e=0.0028, lambda=37.61,
-    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
-      Tp(start={629.445777860324,651.664976699235,671.075818762815}),
-      Tp1(start={629,651,670.})),
-    Cws1(h_vol(start=2665000.0)),
-    Cws2(P(start=12720900.0), h_vol(start=2981170.0)),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=10.25056,
-      p_rho=1.04,
-      Encras(start=0.075)=Fouling_SHP,
-      K(fixed=false, start=34.71),      DeltaT(start={138,108,84}),
-      T(start={788.2431640625,774.65344332519,763.17487871399,755.54821777344}),
-      Tm(start={778.15,768.15,759.527}),
-      Tp(start={631.68675322573,653.38616970968,672.36458008039})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      option_temperature=2,
-      inertia=true,
-      dpfCorr=2,      dW1(start={9.8e6,7.7e6,5.9e6}),
-      Tp1(start={639.5,657,673}),
-      h(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983,
-            2973076.25}),
-      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
-      P(start={12723762,12723600,12723500,12720000,12719000})))
-         annotation (Placement(transformation(
-        origin={-63,-50},
-        extent={{-20,20},{20,-20}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_3(
-    Dint=26.6e-3,
-    Ntubes=1476,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
-      Tp(start={556.530623976228,563.226831750573,565.575075374951}),
-      Tp1(start={555.49,562.473,564.857})),
-    L=20.726,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.6e7,5.6e6,2.1e6}),
-      Tp1(start={558,565,567}),
-      h(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855,
-            1291418.875}),
-      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
-      P(start={13219333,13241000,13261000,13282000,13301176})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=12.451,
-      p_rho=1.08,
-      Encras(start=0.06)=Fouling_EHP3,
-      K(fixed=true, start=36.03),
-      St=5, DeltaT(start={34,12,4.4}),
-      T(start={602.67193603516,579.67183226637,571.50875350574,568.81030273438}),
-      Tm(start={593.15,583.15,571.919}),
-      Tp(start={557.01185690541,563.39937105652,565.63731055685})))      annotation (Placement(
-        transformation(
-        origin={206,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_2(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-5e6,-3e6,-2.e6}),
-      Tp(start={490.631370193221,498.229397165878,502.978053774656}),
-      Tp1(start={490,497.024,501.871})),
-    L=20.767,
-    Ntubes=1107,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={5e6,3e6,2.e6}),
-      Tp1(start={499,503,507}),
-      h(start={854494.5625,915007.018247822,957243.396653824,983786.364226731,
-            986348.9375}),
-      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
-      P(start={13129352,13152000,13175000,13197000,13219333})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=111e-3,
-      CSailettes=2.76134577,
-      p_rho=1.11,
-      Encras(start=0.11)=Fouling_EHP2,
-      K(fixed=true, start=65),
-      St=5, DeltaT(start={36,23,14}),
-      T(start={531.16070556641,523.74706132958,519.01561663699,516.31256103516}),
-      Tm(start={538.15,528.15,521.399}),
-      Tp(start={490.84070882241,498.36081646341,503.06064272486})))      annotation (Placement(
-        transformation(
-        origin={406,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_Economizer_1(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-9.9999e6,-5e6,-2.4e6}),
-      Tp(start={458.958585923538,468.506814782426,473.132256983258}),
-      Tp1(start={458.001,467.576,472.607})),
-    L=20.726,
-    Ntubes=1107,
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={9.9999e6,5e6,2.4e6}),
-      Tp1(start={467.4,476.5,480.9}),
-      h(start={618651.9375,752176.893518976,816707.727773953,847728.424287614,
-            854494.5625}),
-      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
-      dynamic_mass_balance=true,
-      P(start={13034956,13060000,13080000,13100000,13129352})),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=8.30057632,
-      p_rho=1.13,
-      Encras(start=0.07)=Fouling_EHP1,
-      K(fixed=true, start=40.),
-      St=5,   DeltaT(start={41,20,10}),
-      T(start={509.31488037109,491.44087131458,484.15889910859,482.59533691406}),
-      Tm(start={503.15,498.15,494.131}),
-      Tp(start={459.37586976399,468.70800090382,473.22896941053})))      annotation (Placement(
-        transformation(
-        origin={526,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_2(
-    Ns=3,
-    L=20.4,
-    Dint=32e-3,
-    Ntubes=246,
-    ExchangerWall(e=3e-3, lambda=27,
-          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
-      Tp(start={714.604505161814,740.492493660215,759.200099714419}),
-      Tp1(start={710.485,734.082,752.527})),
-    Cws2(P(start=127113000.0), h_vol(start=3254970.0)),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.83,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={8.8e6,6.6e6,4.9e6}),
-      Tp1(start={714,735.6,752}),
-      h(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722,
-            3240813.5}),
-      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
-      P(start={12720371,12718000,12716000,12714000,12711007})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      CSailettes=10.2505424803872,
-      p_rho=1.02,
-      Encras(start=0.075)=Fouling_SHP,
-      K(fixed=false, start=34.74),
-      St=5,
-      DeltaT(start={124,93,70}),
-      T(start={850.64624023438,839.40882309811,830.36536707939,822.68170166016}),
-      Tm(start={843.15,833.15,825.24}),
-      Tp(start={717.48312916257,742.56566858011,760.69152533026})))      annotation (Placement(
-        transformation(
-        origin={-174,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    HP_SuperHeater_3(
-    Ns=3,
-    L=20.4,
-    Ntubes=246,
-    ExchangerWall(lambda=27,e=5e-3,
-    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
-      Tp(start={793.335674512128,811.477076678823,824.721389633254}),
-      Tp1(start={783.815,803.639,818.56})),
-    Dint=28e-3,
-    Cws2(h(fixed=true, start=3511e3)),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.726,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={6.3e6,4.7e6,3.6e6}),
-      Tp1(start={783.6,801.6,815}),
-      h(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987,
-            3433271.25}),
-      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
-      P(start={12711007,12704000,12697000,12689000,12681000})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      p_rho=1,
-      Encras(start=0.075)=Fouling_SHP,
-      CSailettes=6.59672846,
-      K(fixed=false, start=49.33),
-      St=5,
-      DeltaT(start={97,73,55}),
-      T(start={894.21850585938,885.5393240412,879.47464880089,874.32891845703}),
-      Tm(start={893.15,883.15,875.939}),
-      Tp(start={796.82789474964,814.05266276572,826.6253996051})))      annotation (Placement(
-        transformation(
-        origin={-294,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum IP_Drum(
-    L=16.27,
-    Vertical=false,
-    P0=27.29e5,
-    hl(fixed=false, start=978914.570821827),
-    hv(fixed=false, start=2799158.13966473),
-    Vv(fixed=false),
-    R=1.05,
-    P(fixed=false, start=28.3e5),
-    zl(start=1.05, fixed=true),
-    Kvl=0,
-    Kpa=5,
-    Mp=5000,
-    Cv(Q(fixed=true, start=10.9)),
-    Pfond(start=2732995.0),
-    Tp(start=500.955757665063))
-                     annotation (Placement(transformation(extent={{358,10},{320,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    IP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_FeedValve(
-      Cvmax=CvmaxValveAMP,
-    C1(P(start=2952995.0), h_vol(start=892414.570867188)),
-    h(start=944000),
-    Cv(start=28),
-    Pm(start=2945000))
-                 annotation (Placement(transformation(extent={{398,46},{378,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_SteamValve(
-    Pm(fixed=false, start=2731689.4244255),
-    C2(h_vol(start=2798000),P(start=27.3e5)),
-    h(fixed=false, start=2798000),
-    mode=0,
-    Cv(start=27829.4),
-    Cvmax=CvmaxValveVMP,
-    C1(P(start=28.3e5, fixed=true)))
-                 annotation (Placement(transformation(extent={{298,46},{278,66}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_Evaporator(
-    Dint=32.8e-3,
-    L=20.767,
-    Ntubes=738,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
-      Tp(start={504.957792851478,504.19488464586,503.59993822766}),
-      Tp1(start={504.427,503.806,503.304})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.83,
-      continuous_flow_reversal=true,
-      inertia=true,
-          dW1(start={9.7e7,7.6e6,5.8e6}),
-      Tp1(start={504.5,503.9,503.4}),
-      P(start={2773367.5,2754933.93610513,2745233.82043873,2738517.46232967,2733824.75}),
-      h(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464,980708.125}),
-      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=10.0676093,
-      p_rho=1.1,
-      Encras(start=0.08)=Fouling_EvMP,
-      K(fixed=false, start=46.9),
-      St=5,
-      DeltaT(start={53,41,32}),
-      T(start={565.24822998047,551.20973998682,539.98034586472,531.16070556641}),
-      Tm(start={553.15,543.15,536.901}),
-      Tp(start={505.45492567199,504.57970000924,503.89762940507})))              annotation (Placement(
-        transformation(
-        origin={306,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss IP_DownComer(
-    z2=0,
-    z1=10.83,
-    mode=1,
-    K=K_IP_DownComer,
-    Q(start=22, fixed=true),
-    Pm(start=2734000),
-    h(start=978914.570821827))
-            annotation (Placement(transformation(
-        origin={348,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
-    h(start=978914.570821827),
-    P(start=2834000))                      annotation (Placement(transformation(
-          extent={{328,-100},{308,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_Economizer(
-    ExchangerWall(e=2.6e-3, lambda=47,
-        dW1(start={-3e6,-1.4e6,-740379}),
-      Tp(start={457.584681885759,475.409334769727,486.332585528225}),
-      Tp1(start={456.76,474.926,485.122})),
-    L=20.726,
-    Ns=3,
-    Dint=26.6e-3,
-    Ntubes=246,
-    Cws1(h_vol(start=671235.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.767,
-      z2=0,
-      inertia=true,
-      dW1(start={3e6,1.4e6,740379}),
-      Tp1(start={474,491,499.9}),
-      h(start={565108.5,727745.440528479,829820.124314816,892414.570867187,
-            944505.4375}),
-      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
-      P(start={3124229.75,3148000,3172000,3195000,3216977.75})),
-    Cws2(h(fixed=false, start=990e3)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      CSailettes=7.16188651,
-      p_rho=1.12,
-      Encras(start=0.09)=Fouling_EMP,
-      K(fixed=true, start=50),
-      St=5,
-      DeltaT(start={45,24,13}),
-      T(start={516.31256103516,511.25046295073,508.31162431247,509.31488037109}),
-      Tm(start={533.15,523.15,514.647}),
-      Tp(start={458.18343678065,475.77644311925,486.55770446184})))              annotation (Placement(
-        transformation(
-        origin={466,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_1(
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.3e6,-0.80263e6,
-                                -501864}),
-      Tp(start={557.102699668877,574.070651369638,584.64928514972}),
-      Tp1(start={556.102699668877,573.070651369638,583.64928514972})),
-    L=20.726,
-    Ns=3,
-    Dint=32.8e-3,
-    Ntubes=123,
-    Cws1(h_vol(start=2800000.0),P(start=2.73467e+06)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      CSailettes=14.46509765,
-      p_rho=1.07,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=22.09),
-      St=5,
-      DeltaT(start={45,30,19}),
-      T(start={606.41162109375,604.22099235915,603.06310204059,602.67193603516}),
-      Tm(start={623.15,613.15,603.024}),
-      Tp(start={557.49575399383,574.31250418519,584.79699207547})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.77,
-      dpfCorr=2,
-      inertia=false,
-      dW1(start={1.3e6,0.80263e6,501864}),
-      Tp1(start={557,573,583}),
-      h(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156,
-            3040562.25}),
-      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
-      P(start={2731326.25,2729591.6901521,2728654.3204706,2727686.1714029,
-            2726700})))     annotation (Placement(transformation(
-        origin={146,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB VolumeLP(
-    Ce1(h(start=3091610.0)),
-    h(start=3042573.51976705),
-    P(start=2726000))
-    annotation (Placement(transformation(
-        origin={146,-110},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_2(
-    Ns=3,
-    L=20.4,
-    Dint=39.3e-3,
-    Ntubes=369,
-    ExchangerWall(e=2.6e-3, lambda=36.86,
-    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
-      Tp(start={689.66516778766,716.376344387713,734.591437191304}),
-      Tp1(start={687.7,713.5,731.5})),
-    Cws1(P(start=2576650.0), h_vol(start=3078800.0)),
-    Cws2(P(start=2558540.0), h_vol(start=3342910.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={1.15e7,7.9e6,5.5e6}),
-      Tp1(start={685.6,711,729}),
-      h(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389,
-            3321940.75}),
-      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
-      P(start={2575582.5,2572000,2568000,2563000,2558239})),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=92e-3,
-      CSailettes=5.814209831,
-      p_rho=1.03,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=45.22),
-      St=5,
-      DeltaT(start={125,86,60}),
-      T(start={822.68170166016,807.90772072705,797.00284433443,788.2431640625}),
-      Tm(start={813.15,803.15,792.527}),
-      Tp(start={690.93545553661,717.24269857866,735.18209370035})))              annotation (Placement(
-        transformation(
-        origin={-114,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    IP_SuperHeater_3(
-    Ns=3,
-    L=20.4,
-    Ntubes=369,
-    Dint=45.6e-3,
-    ExchangerWall(e=2.6e-3, lambda=27,
-    dW1(start={-8e6,-5.5e6,-3.8e6}),
-      Tp(start={788.901616786331,805.674094596818,817.083010473709}),
-      Tp1(start={786.717,804.102,815.901})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dpfCorr=2,
-      dW1(start={8e6,5.5e6,3.8e6}),
-      Tp1(start={782,798.7,810}),
-      h(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916,
-            3517975.25}),
-      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
-      P(start={2558239,2556000,2554000,2552000,2548600})),
-    Cws2(h(fixed=true, start=3606e3)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=92e-3,
-      Dext=50.8e-3,
-      p_rho=1.01,
-      CSailettes=5.695842178,
-      Encras(start=0.1385)=Fouling_SMP,
-      K(fixed=false, start=43.23),
-      St=5,
-      DeltaT(start={82,56,38}),
-      T(start={874.32891845703,864.2444076086,856.92248545484,850.64624023438}),
-      Tm(start={873.15,863.15,853.059}),
-      Tp(start={789.92521486539,806.37044583028,817.55662835373})))              annotation (Placement(
-        transformation(
-        origin={-234,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum LP_Drum(
-    Vertical=false,
-    P0=5e5,
-    Vv(fixed=false),
-    L=8,
-    hl(fixed=false, start=549249.519022482),
-    hv(fixed=false, start=2709858.97470349),
-    R=2,
-    zl(start=1.75, fixed=true),
-    Kvl=0,
-    Kpa=5,
-    Mp=5000,
-    P(fixed=false, start=520000),
-    Cv(Q(fixed=true, start=9.23)),
-    Pfond(start=564775.0),
-    Tp(start=406.411032587651))
-                     annotation (Placement(transformation(extent={{618,10},{578,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    LP_SteamValve_Constante(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_SteamValve(
-    p_rho=3, Cvmax=CvmaxValveVBP,
-    C2(P(start=503542.0), h_vol(start=2709858.97470349)),
-    h(start=2685000),
-    Cv(start=7555),
-    Pm(start=498000))
-                 annotation (Placement(transformation(extent={{558,46},{538,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_FeedValve(
-    C1(h_vol(start=511900.0)),
-    h(fixed=false, start=509000),
-    Pm(fixed=false, start=5.0698e5),
-    Cvmax=250,
-    Cv(start=142.5),
-    C2(P(fixed=true, start=5.2e5)))
-                 annotation (Placement(transformation(extent={{650,46},{630,66}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss LP_DownComer(
-    z2=0,
-    z1=10.767,
-    K=32766,
-    mode=1,
-    Q(start=20, fixed=false),
-    pro(d(start=934.452746556487)),
-    Pm(start=564000),
-    h(start=549249.519022482))
-            annotation (Placement(transformation(
-        origin={610,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=549249.519022482),
-                                                                       mode=1,
-    V=5,
-    P(start=523000))                                   annotation (Placement(
-        transformation(extent={{592,-100},{572,-80}}, rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_Evaporator(
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
-      Tp(start={433.127441964236,432.076030201586,431.28112439162}),
-      Tp1(start={432.956,431.127,430.61})),
-    L=20.726,
-    Ntubes=984,
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={1.24e7,8.5e6,5.8e6}),
-      Tp1(start={442.5,441.7,441}),
-      h(start={550075.0,765243.011613326,912673.256542569,1013555.73710231,
-            550075.0}),
-      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
-      Q(start={49.787311368631,49.787311368631,49.787311368631,49.787311368631}),
-      P(start={522583.375,488000,487000,486000,485588.46875})),
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=138e-3,
-      CSailettes=11.07985,
-      p_rho=1.14,
-      Encras(start=0.09)=Fouling_EvBP,
-      K(fixed=false, start=46.7),
-      St=5,
-      DeltaT(start={45,31,21}),
-      T(start={482.59533691406,464.53146753441,453.496360082,442.5893859863}),
-      Tm(start={483.15,478.15,472.098}),
-      Tp(start={433.5360639938,432.3549425205,431.471976456})))              annotation (Placement(
-        transformation(
-        origin={566,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_LP_Drum(k=0.25)
-    annotation (Placement(transformation(extent={{742,32},{728,44}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve(
-      Pm(start=5.0698e5), mode=1,
-    C1(h_vol(start=549249.519022482)),
-    h(start=550000),
-    Cv(start=308.931))
-                 annotation (Placement(transformation(extent={{710,12},{730,32}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_SuperHeater(
-    Ns=3,
-    L=20.726,
-    Dint=39.3e-3,
-    Ntubes=123,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.1e6,-782901,-559798}),
-      Tp(start={489.606851797367,513.610203520748,530.080624448955}),
-      Tp1(start={488.486,512.197,529.53})),
-    Cws1(h_vol(start=2642240.0),P(start=484264)),
-    Cws2(h_vol(start=2979330.0)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=222.1e-3,
-      K(fixed=true, start=30.46),
-      CSailettes=3.25763059984175,
-      p_rho=1.09,
-      Encras(start=0.05)=Fouling_SBP,
-      St=5,
-      DeltaT(start={92,66,47}),
-      T(start={568.81030273438,567.21003420557,566.29303411055,565.24822998047}),
-      Tm(start={583.15,573.15,568.703}),
-      Tp(start={489.84170505864,513.76963980951,530.18834052149})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      rugosrel=1e-5,
-      z1=10.767,
-      inertia=false,
-      dpfCorr=0.25,
-      dW1(start={1.1e6,782901,559798}),
-      Tp1(start={485,511,529}),
-      h(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762,
-            2914520.25}),
-      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
-      P(start={510622.6875,505757.57962259,504477.27858572,503172.36919354,501850})))      annotation (Placement(
-        transformation(
-        origin={266,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkP SinkP_Gas(P0=1.044e5)
-    annotation (Placement(transformation(
-        origin={722,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    LP_Economizer(
-    Ns=3,
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
-      Tp(start={398.142807363473,393.825926964772,392.943738968771}),
-      Tp1(start={397.622,392.348,391.516})),
-    Ntubes=3444,
-    L=20.726,
-    Cws1(h_vol(start=195526.0)),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      inertia=true,
-      dpfCorr=0.5,
-      dW1(start={2.45e7,5.5e6,1.17e6}),
-      Tp1(start={409,404.7,404}),
-      h(start={194584.515625,462556.370989432,494648.45288738,501287.069880104,
-            509237.875}),
-      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
-      P(start={1540571.25,1500000,1480000,1450000,1429595.375})),
-    Cws2(h(fixed=false, start=500e3)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=92e-3,
-      CSailettes=11.673758598919,
-      p_rho=1.15,
-      Encras(start=0.06)=Fouling_EBP,
-      K(fixed=true, start=30),
-      St=5,
-      DeltaT(start={23.5,5.3,1.1}),
-      T(start={442.5893859863,403.9873508455,395.0465605839,395.464630127}),
-      Tm(start={423.15,418.15,414.742}),
-      Tp(start={398.4437772187,393.8897987349,392.9569515805})))              annotation (Placement(
-        transformation(
-        origin={680,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine HP_Turbine(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.88057),
-    eta_is_min=0.75,
-    Cst(start=8182844.56002535)=
-        CstHP,
-    Pe(fixed=true, start=125.20e5),
-    Ps(fixed=false, start=2726700),
-    eta_is_nom=EtaIsNomHP,
-    Cs(h(fixed=true, start=3106e3)),
-    pros(d(start=10.0)),
-    Hrs(start=3046260),
-    Qmax=151,
-    a=-1.20211,
-    b=2.32571,
-    c=-0.25) annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
-          rotation=0)));
-
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine IP_Turbine(
-    W_fric=1,
-    Ps(fixed=false, start=476800),
-    eta_stato=1,
-    eta_is(start=0.9625),
-    eta_is_min=0.75,
-    Cst(start=256335.364995961)=
-        CstMP,
-    Pe(fixed=true, start=25.13e5),
-    pros(d(start=30.0)),
-    Hrs(start=3029780),
-    Cs(h(fixed=false, start=2990e3)),
-    eta_is_nom=0.96,
-    b=2.4957,
-    Qmax=170,
-    a=-1.2728,
-    c=-0.26202)   annotation (Placement(transformation(extent={{318,-250},{358,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP1(
-    h(start=2997231.36734756),
-    P(start=476799.99999954),
-    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
-        origin={418,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine LP_Turbine(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9538),
-    eta_is_min=0.75,
-    Cst(start=11944.9445735985)=
-        CstBP,
-    Hrs(start=2401030),
-    Pe(fixed=true, start=4.77e5),
-        Ps(start=10053),
-    Cs(h(fixed=true, start=2399.9e3)),
-    eta_is_nom=EtaIsNomBP,
-    Qmax=192,
-    a=-1.22335,
-    b=2.2957,
-    c=-0.14)   annotation (Placement(transformation(extent={{576,-250},{616,
-            -210}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-292,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-232,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(Cs(h(start=3000000)),
-                                                    alpha=0.5)
-    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
-    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    Vf0=0.15,
-    steady_state=false,
-    yNiveau(signal(start=1.5)),
-    Cse(h(start=128076)),
-    P0=6100,
-    P(fixed=false, start=6136),
-    Pfond(start=6200)) annotation (Placement(transformation(extent={{639,-384},
-            {719,-304}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
-    h0=113.38e3, Q0=17224)       annotation (Placement(transformation(extent={{
-            572,-377},{620,-329}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_In(
-    K=1e-4,
-    h(start=2400000),
-    C1(h_vol(start=2400000), h(start=2400000)),
-    Q(start=190.55),
-    Pm(start=10026)) annotation (Placement(transformation(extent={{640,-240},{660,
-            -220}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
-    Ce3(h(start=163768.700887002)),
-    h(start=163768.700887002),
-    P(start=1540500))
-    annotation (Placement(transformation(
-        origin={902,-318},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out2(
-    K=1e-4,
-    mode=1,
-    pro(d(start=993.470128235971)),
-    Pm(start=1540000)) annotation (Placement(transformation(
-        origin={902,-270},
-        extent={{12,-12},{-12,12}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
-    h(start=549249.519022482),
-    P(start=322430))                       annotation (Placement(transformation(
-          extent={{742,6},{762,26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump IP_Pump(
-    a3=350,
-    mode=1,
-    Q(fixed=false, start=10.9),
-    a1=-244551,
-    C1(h_vol(start=576000.0)),
-    C2(h_vol(start=561000.0)),
-    h(start=571000.0),
-    hn(start=317),
-    Qv(start=0.0207237016869104),
-    pro(d(start=930.0)),
-    Pm(start=1725850))
-            annotation (Placement(transformation(extent={{804,6},{824,26}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump HP_Pump(
-    a3=1600,
-    a1=-28056.2,
-    Q(fixed=false),
-    mode=1,
-    C1(h_vol(start=561000.0)),
-    C2(h_vol(start=630000.0)),
-    h(start=630000),
-    hn(start=1413),
-    Qv(start=0.0810383142105344),
-    pro(d(start=929.0)),
-    Pm(start=6774000))  annotation (Placement(transformation(extent={{804,-46},
-            {824,-26}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
-                                                    alpha=0.5,
-    h(start=194585),
-    P(start=1540500),
-    Cs(h(start=194585)))
-    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={266,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_LP_Turbine(
-    z2=0,
-    mode=0,
-    z1=0,
-    h(start=3000000),
-    C1(
-      h_vol(start=3000000),
-      h(start=3000000),
-      P(fixed=false, start=5.0185e5)),
-    K=1e-4,
-    Pm(start=490000)) annotation (Placement(transformation(
-        origin={344,-278},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_HP_Pump(
-    K=1e-4,
-    mode=1,
-    C2(h_vol(start=599600)),
-    Pm(start=372718)) annotation (Placement(transformation(
-        origin={780,-36},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_IP_Pump(
-    K=1e-4,
-    mode=1,
-    C2(h_vol(start=599600)),
-    Pm(start=372718)) annotation (Placement(transformation(
-        origin={780,16},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
-    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out(
-    K=1e-4,
-    mode=1,
-    C1(h_vol(start=153206.462779274)),
-    C2(h_vol(start=153206.462779274)),
-    pro(d(start=993.441492649513)),
-    Pm(start=6200)) annotation (Placement(transformation(extent={{702,-446},{722,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump LP_Pump(
-    Qv(start=0.1934),
-    mode=1,
-    a3=400,
-    C2(P(fixed=false, start=16.7e5), h_vol(start=194669.0)),
-    h(start=193000),
-    hn(start=183),
-    a1=LP_Pump_a1,
-    Q(start=193.43, fixed=false),
-    Pm(start=1103065, fixed=false)) annotation (Placement(transformation(extent=
-           {{742,-446},{762,-426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out1(
-    K=1e-4,
-    mode=1,
-    pro(d(start=994.045785814739)),
-    C1(h_vol(start=194585), h(start=194585)),
-    Pm(start=1546000)) annotation (Placement(transformation(extent={{840,-446},{
-            860,-426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ExtractionValve(
-    mode=1,
-    Cvmax=2500,
-    h(start=195000),
-    Cv(start=2000),
-    C1(h_vol(start=195000)),
-    C2(h_vol(start=195000)),
-    Pm(start=1549000)) annotation (Placement(transformation(extent={{802,-440},{
-            822,-420}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamHP(C1(h_vol(start=2674000),
-        h(start=2674000)))
-    annotation (Placement(transformation(
-        origin={-58,8},
-        extent={{-6,6},{6,-6}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterHP(C2(h_vol(start=1398000),
-        h(start=1398000)))
-    annotation (Placement(transformation(
-        origin={91.5,32},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterMP(C2(h_vol(start=944000),
-        h(start=944000)))
-    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamMP(C1(h_vol(start=2798000),
-        h(start=2798000)),C2(h_vol(start=2798000)))
-    annotation (Placement(transformation(
-        origin={236,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamBP(C2(h_vol(start=2685000),
-        h(start=2685000)))
-    annotation (Placement(transformation(
-        origin={514,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP(C2(h_vol(start=550000),
-        h(start=550000)))
-    annotation (Placement(transformation(
-        origin={663.5,34},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP_Out(C2(h_vol(start=
-            550000), h(start=550000))) annotation (Placement(transformation(
-          extent={{687,15},{700,27}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterCondenser(C2(h_vol(start=
-           194585), h(start=194585))) annotation (Placement(transformation(
-        origin={685.5,-412},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamCondenser(C2(h_vol(start=
-           2401000), h(start=2401000))) annotation (Placement(transformation(
-        origin={684.5,-264},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_2(
-    C1(
-      P(fixed=true, start=27.267e5),
-      h_vol(start=3046000),
-      h(start=3046000)),
-    K=K_Dp_HP_2,
-    Pm(start=2651000)) annotation (Placement(transformation(extent={{114,-120},{
-            94,-100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_Turbine_Valve(
-    mode=0,
-    h(fixed=false, start=3433000),
-    Cv(start=10875),
-    Pm(fixed=false, start=12550000),
-    C1(P(fixed=true, start=126.81e5)),
-    Cvmax=Cvmax_THP)
-                 annotation (Placement(transformation(extent={{-124,-234},{-104,
-            -214}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauHP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500,
-    minval=0.007) annotation (Placement(transformation(extent={{-40,106},{-20,
-            126}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauMP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500) annotation (Placement(transformation(extent={{262,106},{282,126}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauBP(                                                              k=1.75)
-    annotation (Placement(transformation(extent={{470,114},{504,132}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
-    add(k1=-1, k2=+1),
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauCondenseur1(                                 k=1.5)
-    annotation (Placement(transformation(extent={{704,-246},{740,-230}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-      add(k1=+1, k2=-1)) annotation (Placement(transformation(extent={{758,-282},
-            {778,-262}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneHP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
-            -138,-142}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp(
-    Initialvalue=1400,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=1300)
-                   annotation (Placement(transformation(extent={{944,-16},{906,
-            16}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP(
-    Initialvalue=1400,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=1300)
-                   annotation (Placement(transformation(extent={{945,-82},{907,
-            -50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingBP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{945,-458},{907,
-            -426}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
-    mode=1,
-    V=1,
-    h0=988332,
-    h(start=988332),
-    P0=70.1e5,
-    P(start=13129000),
-    dynamic_mass_balance=true)            annotation (Placement(transformation(
-          extent={{456,-98},{436,-78}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
-    mode=1,
-    V=1,
-    h0=983786,
-    h(start=983786),
-    P0=70.0e5,
-    P(start=13219000),
-    dynamic_mass_balance=true)            annotation (Placement(transformation(
-          extent={{252,-20},{232,0}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve1(
-                          mode=1,
-    Cvmax=308.931,
-    h(start=618600),
-    Cv(start=308.931),
-    C1(h_vol(start=618600)),
-    Pm(start=13130000))
-                 annotation (Placement(transformation(extent={{754,-98},{730,
-            -122}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve2(
-      Pm(start=3126000), mode=1,
-    Q(start=10.9, fixed=false),
-    h(start=565000),
-    C1(h_vol(start=565000)),
-    Cv(start=308.931),
-    Cvmax=308.931)
-                 annotation (Placement(transformation(extent={{804,-138},{780,
-            -162}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp1(
-    Initialvalue=0.8,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=0.4)  annotation (Placement(transformation(extent={{946,-150},{
-            908,-118}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP1(
-    Initialvalue=0.8,
-    Starttime=200000,
-    Duration=800,
-    Finalvalue=0.4)  annotation (Placement(transformation(extent={{946,-194},{
-            908,-162}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
-    P0=127e5,
-    h0=3e6,
-    P(start=127e5),
-    h(start=3450835.48993987),
-    dynamic_mass_balance=true)        annotation (Placement(transformation(
-        origin={-52,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP(
-    h0=3523910,
-    h(start=3523910),
-    dynamic_mass_balance=true,
-    P0=2400000,
-    P(start=24e5))                        annotation (Placement(transformation(
-        origin={-50,-314},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_Turbine_Valve(
-    h(fixed=false, start=3518000),
-    mode=0,
-    Pm(fixed=false, start=2547000),
-    Cv(start=3.312e6),
-    C1(P(fixed=true, start=25.486e5)),
-    Cvmax=Cvmax_TMP)
-                 annotation (Placement(transformation(extent={{-124,-318},{-104,
-            -298}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneIP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
-            -138,-226}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
-    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
-    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
-    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Gain Gain_2GasTurbine(Gain=
-       2) annotation (Placement(transformation(extent={{-18,-448},{2,-428}},
-          rotation=0)));
-  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible(
-    Hum=0,
-    rho=0.838,
-    T0=185 + 273.16,
-    Cp=2255,
-    LHV=46989e3,
-    Xo=0.000,
-    Xn=0.000,
-    Xs=0.000,
-    Xc=0.74,
-    Xh=0.25,
-    Q0=13.521) annotation (Placement(transformation(extent={{-421,24},{-385,60}},
-          rotation=0)));
-  WaterSteam.BoundaryConditions.SourcePQ sourceEau(             Q0=0.0)
-          annotation (Placement(transformation(extent={{-473,27},{-445,57}},
-          rotation=0)));
-  FlueGases.BoundaryConditions.SourcePQ SourceFumees(
-    Xso2=0,
-    Xco2=0,
-    Xh2o=0,
-    Xo2=0.20994,
-    T0=29.4 + 273.16,
-    P0=1.003e5,
-    Q0=592.76 + 0.66)
-    annotation (Placement(transformation(extent={{-539,-74},{-495,-28}},
-          rotation=0)));
-  FlueGases.TAC.GasTurbine GasTurbine(
-    Kcham=1.114801,
-    exp_eff_n=0.90,
-    comp_eff_n=0.9,
-    TurbQred=0.01731,
-    comp_tau_n=14.0,
-    Wpth=1.2707e6,
-    exp_tau_n=0.079,
-    chambreCombustionTAC(
-      Psf(fixed=false, start=13.16e5),
-      Pea(fixed=true, start=14.042e5),
-      kcham=C_Kcham,
-      Tea(start=680)),
-    TurbineAgaz(
-      Ps(fixed=false),
-      A3=0,
-      A2=-0.04778,
-      A1=0.09555,
-      A0=0.95223,
-      Wmech(fixed=false, start=227.3e6),
-      Pe(fixed=false, start=13.3e5),
-      is_eff(fixed=false, start=0.92),
-      Ts(fixed=true, start=893.76),
-      is_eff_n=T_is_eff_n,
-      Qred=T_Qred,
-      tau_n=0.079094,
-      tau(fixed=true, start=0.079094),
-      Tis(start=828)),
-    Compresseur(
-      tau(fixed=false, start=14),
-      is_eff_n=C_is_eff_n,
-      is_eff(fixed=true, start=0.76),
-      Xtau(fixed=true, start=1),
-      Tis(start=630),
-      Ts(start=680),
-      tau_n(start=14)=C_tau_n))
-    annotation (Placement(transformation(extent={{-471,-115},{-341,13}},
-          rotation=0)));
-
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeQfuel(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=13.521,
-    Finalvalue=7.804)
-                     annotation (Placement(transformation(extent={{-538,80},{
-            -518,100}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe Humidite(
-    Starttime=200,
-    Initialvalue=1,
-    Finalvalue=0.8,
-    Duration=800)
-    annotation (Placement(transformation(extent={{-538,20},{-517,40}}, rotation=
-           0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeIQair(
-    Starttime=200,
-    Initialvalue=592.76 + 0.66,
-    Finalvalue=384.3,
-    Duration=800)  annotation (Placement(transformation(extent={{-539,-20},{
-            -519,0}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeTair(
-    Starttime=200,
-    Initialvalue=302.56,
-    Finalvalue=305.16,
-    Duration=800)  annotation (Placement(transformation(extent={{-539,-100},{
-            -519,-80}}, rotation=0)));
-  WaterSteam.Volumes.VolumeA SeparateurMP(h(start=3106000), P(start=27.26e+005),
-    rho(start=10))
-    annotation (Placement(transformation(
-        origin={74,-200},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_1(
-    K=1e-4,
-    pro(d(start=10)),
-    h(start=3106000),
-    C1(
-      P(start=27.26e+005),
-      h_vol(start=3106000),
-      Q(start=153),
-      h(start=3106000)),
-    C2(
-      P(start=27.259e+005),
-      h_vol(start=3106000),
-      Q(start=153),
-      h(start=3106000)),
-    Pm(start=2726000)) annotation (Placement(transformation(extent={{88,-182},{102,
-            -158}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_IP_PressureLoss(
-    Q(fixed=true, start=3.09),
-    continuous_flow_reversal=true,
-    h(start=3106000),
-    C1(
-      P(start=27.26e+005),
-      h_vol(start=3106000),
-      h(start=3106000),
-      Q(start=3.09)),
-    C2(
-      P(start=27.259e+005),
-      h_vol(start=3106000),
-      h(start=3106000),
-      Q(start=3.09)),
-    K=K_Dp_HP_IP,
-    Pm(start=2726000)) annotation (Placement(transformation(extent={{134,-210},{
-            154,-190}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe Q_water(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=21000,
-    Finalvalue=15000)
-                   annotation (Placement(transformation(extent={{555,-364},{575,
-            -344}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampePout(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=1.044e5,
-    Finalvalue=1.028e5)
-                   annotation (Placement(transformation(extent={{711,-84},{731,
-            -64}}, rotation=0)));
-equation
-  connect(HP_SuperHeater_3.Cws1, HP_SuperHeater_2.Cws2)
-    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
-        color={255,0,0}));
-  connect(HP_SuperHeater_2.Cws1, HP_SuperHeater_1.Cws2)
-    annotation (Line(points={{-174,-70},{-174,-90},{-63,-90},{-63,-70}}, color=
-          {255,0,0}));
-  connect(HP_SteamValve_Constante.y, HP_SteamValve.Ouv)
-    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
-  connect(HP_SteamValve.C1, HP_Drum.Cv)
-    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
-  connect(HP_DownComer.C1, HP_Drum.Cd)
-    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={0,0,0}));
-  connect(HP_Drum.Cm, HP_Evaporator.Cws2)
-    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}, color={0,0,0}));
-  connect(VolumeEvapHP.Cs, HP_Evaporator.Cws1)
-    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={0,0,0}));
-  connect(VolumeEvapHP.Ce1, HP_DownComer.C2)
-                                      annotation (Line(points={{8,-90},{18,-90}},
-        color={0,0,0}));
-  connect(HP_Economizer_4.Cws1, HP_Economizer_3.Cws2)
-    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
-  connect(IP_Drum.Cm, IP_Evaporator.Cws2)
-    annotation (Line(points={{320,10},{306,10},{306,-30}}, color={0,0,0}));
-  connect(IP_Evaporator.Cws1, VolumeEvapMP.Cs)
-    annotation (Line(points={{306,-70},{306,-90},{308,-90}}, color={0,0,0}));
-  connect(VolumeEvapMP.Ce1, IP_DownComer.C2)
-    annotation (Line(points={{328,-90},{338,-90}}, color={0,0,0}));
-  connect(IP_SteamValve_Constante.y, IP_SteamValve.Ouv)
-    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
-  connect(HP_SuperHeater_1.Cfg2, HP_Evaporator.Cfg1)        annotation (Line(
-      points={{-53,-50},{-53,-50},{-24,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Evaporator.Cfg2, HP_Economizer_4.Cfg1)        annotation (Line(
-      points={{-4,-50},{96,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_4.Cfg2, IP_SuperHeater_1.Cfg1)          annotation (Line(
-      points={{76,-50},{136,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_1.Cfg2, HP_Economizer_3.Cfg1)           annotation (Line(
-      points={{156,-50},{196,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_Evaporator.Cfg2, HP_Economizer_2.Cfg1)           annotation (Line(
-      points={{316,-50},{396,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_2.Cfg2, IP_Economizer.Cfg1)           annotation (Line(
-      points={{416,-50},{456,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_Economizer.Cfg2, HP_Economizer_1.Cfg1)           annotation (Line(
-      points={{476,-50},{516,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_DownComer.C1, IP_Drum.Cd)
-    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={0,0,
-          0}));
-  connect(IP_SuperHeater_2.Cfg2, HP_SuperHeater_1.Cfg1)          annotation (Line(
-      points={{-104,-50},{-73,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_2.Cfg1, HP_SuperHeater_2.Cfg2)           annotation (Line(
-      points={{-124,-50},{-164,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_3.Cfg2, HP_SuperHeater_2.Cfg1)           annotation (Line(
-      points={{-224,-50},{-184,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_SuperHeater_3.Cfg2, IP_SuperHeater_3.Cfg1)           annotation (Line(
-      points={{-284,-50},{-244,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(IP_SuperHeater_3.Cws1,IP_SuperHeater_2. Cws2)
-    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
-          {255,0,0}));
-  connect(IP_SuperHeater_1.Cws2, VolumeLP.Ce2) annotation (Line(
-      points={{146,-70},{146,-100}},
-      color={255,0,0},
-      pattern=LinePattern.None));
-  connect(LP_SteamValve.C1, LP_Drum.Cv)
-    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
-  connect(LP_Evaporator.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
-          -70},{566,-90},{572,-90}}, color={0,0,0}));
-  connect(VolumeEvapBP.Ce1, LP_DownComer.C2)
-                                        annotation (Line(points={{592,-90},{600,
-          -90}}, color={0,0,0}));
-  connect(LP_Drum.Cd, LP_DownComer.C1) annotation (Line(points={{618,10},{628,
-          10},{628,-90},{620,-90}}, color={0,0,0}));
-  connect(LP_Economizer.Cfg2, SinkP_Gas.C)     annotation (Line(
-      points={{690,-50},{712.2,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_3.Cfg2, LP_SuperHeater.Cfg1)  annotation (Line(
-      points={{216,-50},{256,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_SuperHeater.Cfg2, IP_Evaporator.Cfg1)  annotation (Line(
-      points={{276,-50},{296,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(HP_Economizer_1.Cfg2, LP_Evaporator.Cfg1) annotation (Line(
-      points={{536,-50},{556,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_Evaporator.Cfg2, LP_Economizer.Cfg1) annotation (Line(
-      points={{576,-50},{670,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(LP_Drum.Cm, LP_Evaporator.Cws2)
-    annotation (Line(points={{578,10},{566,10},{566,-30}}, color={0,0,0}));
-  connect(IP_SteamValve.C1, IP_Drum.Cv)   annotation (Line(points={{298,50},{
-          320,50}}, color={255,0,0}));
-  connect(HPIP_FeedValve.Ouv, constante_LP_Drum.y)
-    annotation (Line(points={{720,33},{720,38},{727.3,38}}));
-  connect(HP_SuperHeater_3.Cws2, DoubleDebitHP.Ce)
-    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
-        color={255,0,0}));
-  connect(IP_SuperHeater_3.Cws2, DoubleDebitMP.Ce)
-    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
-        color={255,0,0}));
-  connect(VolumeCond1.Cs, Dp_Cond_Out2.C1)
-    annotation (Line(points={{902,-308},{902,-282}}, color={0,0,255}));
-  connect(HPIP_FeedValve.C2, VolumeAlimMPHP.Ce1)
-                                               annotation (Line(points={{730,16},
-          {742,16}}, color={0,0,255}));
-  connect(LP_SuperHeater.Cws2, DoubleDebitBP.Ce)
-    annotation (Line(points={{266,-70},{266,-90}}, color={255,0,0}));
-  connect(DP_IP_Pump.C2, IP_Pump.C1)
-    annotation (Line(points={{790,16},{798,15},{804,16}}, color={0,0,255}));
-  connect(VolumeAlimMPHP.Cs1, DP_IP_Pump.C1) annotation (Line(points={{762,16},{
-          766,15},{766,16},{770,16}}, color={0,0,255}));
-  connect(VolumeAlimMPHP.Cs2, DP_HP_Pump.C1)
-    annotation (Line(points={{752,6},{752,-36},{770,-36}}, color={0,0,255}));
-  connect(DP_HP_Pump.C2, HP_Pump.C1)
-    annotation (Line(points={{790,-36},{804,-36}}, color={0,0,255}));
-  connect(VolumeIP1.Ce2, Dp_LP_Turbine.C2) annotation (Line(points={{418,-239},{
-          418,-278},{354,-278}}, color={255,0,0}));
-  connect(Dp_Cond_Out.C2, LP_Pump.C1)
-    annotation (Line(points={{722,-436},{742,-436}}, color={0,0,255}));
-  connect(ExtractionValve.C2, Dp_Cond_Out1.C1)
-    annotation (Line(points={{822,-436},{840,-436}}, color={0,0,255}));
-  connect(HP_FeedValve.C1, SensorQ_WaterHP.C2)
-    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
-  connect(HP_SteamValve.C2, SensorQ_SteamHP.C1) annotation (Line(points={{
-          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
-  connect(SensorQ_SteamHP.C2, HP_SuperHeater_1.Cws1) annotation (Line(points={{-53.2,
-          1.88},{-53.2,-3.06},{-63,-3.06},{-63,-30}},        color={255,0,0}));
-  connect(IP_FeedValve.C1, SensorQ_WaterMP.C2)
-    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
-  connect(SensorQ_SteamMP.C1, IP_SteamValve.C2) annotation (Line(points={{
-          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
-  connect(SensorQ_SteamMP.C2, IP_SuperHeater_1.Cws1) annotation (Line(points={
-          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
-  connect(SensorQ_SteamBP.C2, LP_SuperHeater.Cws1) annotation (Line(points={{
-          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
-  connect(SensorQ_SteamBP.C1, LP_SteamValve.C2) annotation (Line(points={{
-          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
-  connect(SensorQ_WaterBP.C2, LP_FeedValve.C1) annotation (Line(
-        points={{658.3,40.12},{658.3,50},{650,50}}, color={0,0,255}));
-  connect(SensorQ_WaterBP_Out.C2, HPIP_FeedValve.C1) annotation (Line(points={{
-          700.13,16.2},{705.065,16.2},{705.065,16},{710,16}}, color={0,0,255}));
-  connect(SensorQ_WaterCondenser.C2, Dp_Cond_Out.C1) annotation (Line(points={{
-          680.3,-422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
-  connect(Dp_Cond_In.C2, SensorQ_SteamCondenser.C1) annotation (Line(points={{
-          660,-230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
-  connect(VolumeLP.Ce1, MoitieDebitHP.Cs)
-    annotation (Line(points={{146,-120},{146,-170},{134,-170}}, color={255,0,0}));
-  connect(Dp_Cond_Out1.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,-436},
-          {862,-436},{862,-318},{872,-318}}, color={0,0,255}));
-  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
-          {892,-318}}, color={0,0,255}));
-  connect(IP_SuperHeater_2.Cws1, HP_PressureLoss_2.C2) annotation (Line(points={{-114,-70},
-          {-114,-110},{94,-110}}, color={255,0,0}));
-  connect(HP_PressureLoss_2.C1, VolumeLP.Cs2)
-    annotation (Line(points={{114,-110},{136.2,-110}}, color={255,0,0}));
-  connect(DoubleDebitHP.Cs, HP_Turbine_Valve.C1) annotation (Line(points=
-          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
-  connect(DoubleDebitBP.Cs, Dp_LP_Turbine.C1) annotation (Line(points={{266,-110},
-          {266,-278},{334,-278}}, color={255,0,0}));
-  connect(LP_Pump.C2, ExtractionValve.C1)
-    annotation (Line(points={{762,-436},{802,-436}}, color={0,0,255}));
-  connect(HP_Drum.yLevel,regulation_Niveau_HP. MesureNiveauEau)
-    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
-  connect(regulation_Niveau_HP.SortieReelle1, HP_FeedValve.Ouv)
-    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
-  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
-    annotation (Line(
-      points={{208.7,122},{234,122},{234,110},{261.5,110}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(IP_Drum.yLevel,regulation_Niveau_MP. MesureNiveauEau)
-    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
-  connect(regulation_Niveau_MP.SortieReelle1, IP_FeedValve.Ouv)
-    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
-  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
-    annotation (Line(
-      points={{505.7,123},{529.85,123},{529.85,112},{567.5,112}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(LP_Drum.yLevel,regulation_Niveau_BP. MesureNiveauEau)
-    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
-  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
-    annotation (Line(
-      points={{741.8,-238},{752,-238},{752,-269},{757.5,-269}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(regulation_Niveau_Condenseur.SortieReelle1, ExtractionValve.Ouv)
-    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
-  connect(SensorQ_WaterBP.C1, LP_Economizer.Cws2)
-    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
-  connect(LP_Economizer.Cws1, Dp_Cond_Out2.C2)
-    annotation (Line(points={{680,-70},{680,-186},{902,-186},{902,-258}}));
-  connect(SensorQ_SteamCondenser.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
-    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,-280.9}}));
-  connect(regulation_Niveau_Condenseur.MesureDebitEau, SensorQ_WaterCondenser.Measure)
-    annotation (Line(points={{757.45,-274.95},{750,-274.95},{750,-310},{792,-310},
-          {792,-412},{692.13,-412}}));
-  connect(ConstantVanneHP_Turbine.y, HP_Turbine_Valve.Ouv)
-    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
-  connect(regulation_Niveau_BP.SortieReelle1, LP_SteamValve.Ouv)
-    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
-  connect(LP_FeedValve.Ouv, LP_SteamValve_Constante.y)
-    annotation (Line(points={{640,67},{640,81},{653.4,81}}));
-  connect(HP_Economizer_1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
-          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
-  connect(VolumeECO_HP1_2.Cs, HP_Economizer_2.Cws1) annotation (Line(points={{
-          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
-  connect(HP_Economizer_2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
-          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
-  connect(VolumeECO_HP2_3.Cs, HP_Economizer_3.Cws1) annotation (Line(points={{
-          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
-  connect(HPIP_FeedValve1.C1, HP_Pump.C2)
-    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-36},{824,-36}}));
-  connect(IP_Pump.C2, HPIP_FeedValve2.C1) annotation (Line(points={
-          {824,16},{870,16},{870,-142.8},{804,-142.8}}, color={0,0,255}));
-  connect(StopPumpingMp1.y, HPIP_FeedValve1.Ouv)
-    annotation (Line(
-      points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,-123.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(StopPumpingHP1.y, HPIP_FeedValve2.Ouv)
-    annotation (Line(
-      points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,-163.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(HPIP_FeedValve1.C2, HP_Economizer_1.Cws1) annotation (Line(
-        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
-          -6},{526,-30}}, color={0,0,255}));
-  connect(IP_Economizer.Cws1, HPIP_FeedValve2.C2)
-    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
-  connect(ConstantVanneIP_Turbine.y, IP_Turbine_Valve.Ouv)
-    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
-  connect(HP_Turbine_Valve.C2, VolumePreTHP.Ce) annotation (Line(points={
-          {-104,-230},{-62,-230}}, color={255,0,0}));
-  connect(DoubleDebitMP.Cs, IP_Turbine_Valve.C1) annotation (Line(points=
-          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
-  connect(IP_Turbine_Valve.C2, VolumeIP.Ce1) annotation (Line(
-        points={{-104,-314},{-60,-314}}, color={255,0,0}));
-  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(points={{620,-353},
-          {638,-353},{638,-352},{639,-352.8}}, color={0,0,255}));
-  connect(Condenser.Cse, PuitsCaloporteur.C)
-    annotation (Line(points={{719,-352},{736,-352}}, color={0,0,255}));
-  connect(SensorQ_SteamCondenser.C2, Condenser.Cv) annotation (Line(points={{
-          679.3,-274.2},{679.3,-288.1},{679,-288.1},{679,-304}}, color={0,0,255}));
-  connect(SensorQ_WaterCondenser.C1, Condenser.Cl)
-    annotation (Line(points={{680.3,-402},{679.8,-402},{679.8,-384}}));
-  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
-    annotation (Line(
-      points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(Condenser.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
-    annotation (Line(points={{723,-372.8},{780,-372.8},{780,-326},{732,-326},{
-          732,-263},{757.5,-263}}));
-  connect(LP_Drum.Cs, SensorQ_WaterBP_Out.C1) annotation (Line(points={{578,22},
-          {564,22},{564,16},{642,16},{642,16.2},{687,16.2}}, color={0,0,255}));
-  connect(LP_Drum.Ce1, LP_FeedValve.C2)
-    annotation (Line(points={{618,50},{630,50}}));
-  connect(IP_Drum.Ce1, IP_FeedValve.C2)
-    annotation (Line(points={{358,50},{378,50}}));
-  connect(HP_Drum.Ce1, HP_FeedValve.C2)
-    annotation (Line(points={{38,50},{58,50}}));
-  connect(VolumePreTHP.Cs3, HP_Turbine.Ce) annotation (Line(points={{-42,-230},{
-          -2.2,-230}}, color={255,0,0}));
-  connect(VolumeIP.Cs, IP_Turbine.Ce) annotation (Line(points={{-40,-314},
-          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
-  connect(IP_Turbine.Cs, VolumeIP1.Ce1) annotation (Line(points={{358.2,
-          -230},{408,-230}}, color={255,0,0}));
-  connect(VolumeIP1.Cs, LP_Turbine.Ce) annotation (Line(points={{428,
-          -230},{575.8,-230}}, color={255,0,0}));
-  connect(LP_Turbine.Cs, Dp_Cond_In.C1)
-    annotation (Line(points={{616.2,-230},{640,-230}}, color={255,0,0}));
-  connect(IP_Economizer.Cws2, SensorQ_WaterMP.C1) annotation (Line(points={{
-          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
-  connect(IP_Turbine.MechPower, Alternateur.Wmec2)
-    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
-  connect(LP_Turbine.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
-          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
-  connect(HP_Turbine.MechPower, Alternateur.Wmec3)
-    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
-  connect(heatSource.C[1], HP_Drum.Cex) annotation (Line(points={{18,68.3},{18,
-          50}}, color={191,95,0}));
-  connect(heatSource1.C[1], IP_Drum.Cex) annotation (Line(points={{339,68.3},{
-          339,50}}, color={191,95,0}));
-  connect(heatSource2.C[1], LP_Drum.Cex) annotation (Line(points={{598,64.3},{
-          598,50}}, color={191,95,0}));
-  connect(Gain_2GasTurbine.y, Alternateur.Wmec5)
-    annotation (Line(points={{3,-438},{402,-438}}));
-  connect(SensorQ_WaterHP.C1, HP_Economizer_4.Cws2)
-    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
-  connect(IP_Pump.rpm_or_mpower, StopPumpingMp.y)
-    annotation (Line(
-      points={{814,5},{814,0},{904.1,0}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-  connect(HP_Pump.rpm_or_mpower, StopPumpingHP.y)
-    annotation (Line(
-      points={{814,-47},{814,-66},{905.1,-66}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-  connect(LP_Pump.rpm_or_mpower, StopPumpingBP.y) annotation (Line(
-      points={{752,-447},{754,-447},{754,-456},{878,-456},{878,-442},{905.1,-442}},
-      color={0,0,0},
-      pattern=LinePattern.Dot,
-      smooth=Smooth.None));
-
-  connect(SourceFumees.C,GasTurbine. Entree_air)
-                                                annotation (Line(
-      points={{-495,-51},{-471,-51}},
-      color={0,0,0},
-      thickness=1));
-  connect(sourceCombustible.C,GasTurbine. Entree_combustible) annotation (Line(
-        points={{-385,42},{-367,42},{-367,13}}, color={0,0,0}));
-  connect(sourceEau.C,GasTurbine. Entree_eau_combustion)
-    annotation (Line(points={{-445,42},{-445,13}}, color={0,0,255}));
-  connect(GasTurbine.Sortie_fumees, HP_SuperHeater_3.Cfg1) annotation (Line(
-      points={{-341,-51},{-290,-50},{-304,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(GasTurbine.PuissanceMeca, Gain_2GasTurbine.u)
-    annotation (Line(points={{-338.4,-76.6},{-326,-76.6},{-326,-438},{-19,-438}},
-        color={0,0,255}));
-  connect(sourceCombustible.IMassFlow,rampeQfuel. y)
-    annotation (Line(
-      points={{-403,51},{-403,90},{-517,90}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(Humidite.y, GasTurbine.Huminide)
-    annotation (Line(
-      points={{-515.95,30},{-492,30},{-492,-12.6},{-473.6,-12.6}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(rampeIQair.y,SourceFumees. IMassFlow)
-    annotation (Line(
-      points={{-518,-10},{-518,-36},{-517,-36},{-517,-39.5}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(rampeTair.y, SourceFumees.ITemperature)
-    annotation (Line(
-      points={{-518,-90},{-516,-90},{-516,-88},{-517,-88},{-517,-62.5}},
-      color={0,0,0},
-      pattern=LinePattern.Dot));
-  connect(HP_Turbine.Cs,SeparateurMP. Ce1)   annotation (Line(points={{38.2,-230},
-          {74,-230},{74,-210}}, color={255,0,0}));
-  connect(SeparateurMP.Cs1, HP_PressureLoss_1.C1)
-    annotation (Line(points={{74,-190},{74,-170},{88,-170}}, color={255,0,0}));
-  connect(HP_PressureLoss_1.C2, MoitieDebitHP.Ce)
-    annotation (Line(points={{102,-170},{114,-170}}, color={0,0,255}));
-  connect(SeparateurMP.Cs2, HP_IP_PressureLoss.C1)
-    annotation (Line(points={{84,-200},{134,-200}}, color={255,0,0}));
-  connect(HP_IP_PressureLoss.C2, VolumeIP1.Ce3) annotation (Line(points={{154,-200},
-          {418,-200},{418,-220}}, color={255,0,0}));
-  connect(Q_water.y, SourceCaloporteur.IMassFlow)
-    annotation (Line(points={{576,-354},{582,-354},{582,-341},{596,-341}}));
-  connect(rampePout.y, SinkP_Gas.IPressure)
-    annotation (Line(points={{732,-74},{752,-74},{752,-50},{727,-50}}));
-  annotation (Diagram(graphics,
-                      coordinateSystem(preserveAspectRatio=false,extent={{-550,
-            -460},{950,150}},
-        initialScale=0.1)), Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"),
-    experiment(StopTime=2500),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end LoadVariation;
+within ThermoSysPro.Fluid.Examples.Book.PowerPlants.CombinedCyclePowerPlant;
+model LoadVariation "CCPP model to simulate a load variation from 100% to 50%"
+  import ThermoSysPro;
+  parameter Real CstHP(fixed=false,start=7618660.65374636)
+    "Stodola's ellipse coefficient HP";
+  parameter Real EtaIsNomHP(fixed=false,start=0.875)
+    "Turbine HP: Nominal isentropic efficiency ";
+  parameter Real CstMP(fixed=false,start=278905.664031036)
+    "Stodola's ellipse coefficient MP";
+  //parameter Real EtaIsNomMP(fixed=false,start=0.96)
+  //  "Turbine MP: Nominal isentropic efficiency ";
+  parameter Real CstBP(fixed=false,start=13491.6445678148)
+    "Stodola's ellipse coefficient BP";
+  parameter Real EtaIsNomBP(fixed=false,start=0.92)
+    "Turbine MP: Nominal isentropic efficiency ";
+// //
+  //parameter Modelica.SIunits.AbsolutePressure PoutPumpEx(fixed=false,start=22e5)"Flow pressure at the outlet of the pump";
+  //parameter Modelica.SIunits.Length zc(fixed=false,start=1.5) "Condenser water level";
+
+  parameter Real LP_Pump_a1(fixed=false,start=-6000)
+    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+
+  //parameter Real a3_PumpBP(fixed=false,start=400)"Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVHP(fixed=false, start=47829.4)
+    "Maximum CV: steame valve HP Drum  ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVMP(fixed=false, start=47829.4)
+    "Maximum CV: steame valve  Drum MP";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
+    "Maximum CV: steame valve BP Drum ";
+
+  //parameter ThermoSysPro.Units.Cv CvmaxValveWBP(fixed=false,start=10000)
+  //  "Maximum CV: Water valve BP Drum ";
+
+  parameter Real Fouling_SHP(fixed=false,start=0.075)
+    "Sur HP: heat exchange fouling coefficient";
+
+  //parameter Real Fouling_EHP(fixed=false,start=1)
+  //  "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP1(fixed=false,start=0.07)
+    "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP2(fixed=false,start=0.11)
+    "Eco HP2: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP3(fixed=false,start=0.06)
+    "Eco HP3: heat exchange fouling coefficient";
+  parameter Real Fouling_EHP4(fixed=false,start=0.03)
+    "Eco HP4: heat exchange fouling coefficient";
+
+  parameter Real Fouling_SMP(fixed=false,start=0.1358)
+    "Sur MP1: heat exchange fouling coefficient";
+
+  //parameter Real Fouling_SMP(fixed=true,start=0.065)
+  //  "Sur MP1: heat exchange fouling coefficient";
+
+  parameter Real Fouling_EMP(fixed=false,start=0.09)
+    "Eco MP: heat exchange fouling coefficient";
+
+  parameter Real Fouling_EvHP(fixed=false,start=0.24)
+    "Evapo HP: heat exchange fouling coefficient";
+  parameter Real Fouling_EvMP(fixed=false,start=0.08)
+    "Evapo MP: heat exchange fouling coefficient";
+  parameter Real Fouling_EvBP(fixed=false,start=0.09)
+    "Evapo BP: heat exchange fouling coefficient";
+
+  parameter Real Fouling_SBP(fixed=false,start=0.05)
+    "Sur BP: heat exchange fouling coefficient";
+  parameter Real Fouling_EBP(fixed=false,start=0.06)
+    "Eco BP: heat exchange fouling coefficient";
+
+  parameter Real K_HP_DownComer(fixed=false,start=720.183)
+    "HP: Friction pressure loss coefficient";
+  parameter Real K_IP_DownComer(fixed=false,start=1090.9)
+    "MP: Friction pressure loss coefficient";
+  parameter Real K_Dp_HP_2(fixed=false,start=10.)
+    "SMPin: Friction pressure loss coefficient";
+
+  //parameter Real K_PerteChargeZero2(fixed=true,start=1e-4)
+  //  "TurbineMP out: Friction pressure loss coefficient";
+  parameter Real K_Dp_HP_IP(fixed=false,start=1.)
+    "Outlet THP: Friction pressure loss coefficient";
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
+    "Maximum CV input Turbine HP ";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
+    "Maximum CV input Turbine MP ";
+
+  parameter Real C_tau_n(fixed=false,start=14)
+    "Compressor: Nominal compression rate";
+  parameter Real C_is_eff_n(fixed=false,start=0.92)
+    "Compressor: Nominal isentropic efficiency";
+
+  parameter Real T_Qred(fixed=false,start=0.0178)
+    "GazTurbine: reduced mass flow rate";
+  parameter Real T_is_eff_n(fixed=false,start=0.92)
+    "GazTurbine: Nominal isentropic efficiency";
+
+  parameter Real C_Kcham(fixed=false,start=5.05)
+    "CombustionChamber: pressure loss coefficient";
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum HP_Drum(
+    L=16.27,
+    Vertical=false,
+    hl(fixed=false, start=1474422.14552527),
+    hv(fixed=false, start=2666558.75582585),
+    Vv(fixed=false),
+    R=1.05,
+    xmv(fixed=false),
+    P(fixed=false, start=12703151.2960688),
+    zl(start=1.05, fixed=true),
+    Mp=5000,
+    Kpa=5,
+    Kvl=1000,
+    Pfond(start=12703151.3),
+    Tp(start=596.924860294475),
+    Cv(Q(fixed=true, start=76.58)))
+                     annotation (Placement(transformation(extent={{38,10},{-2,
+            50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_FeedValve(
+    Cvmax=CvmaxValveAHP,
+    C1(P(start=12721657.0), h_vol(start=1396865.59043578)),
+    h(start=1398000),
+    Cv(start=178),
+    Pm(start=13050700))
+                 annotation (Placement(transformation(extent={{78,46},{58,66}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    HP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_SteamValve(
+    mode=0,
+    C2(h_vol(start=2666558.75582585),P(start=12700000.0)),
+    h(start=2674000),
+    Cv(start=23914.7),
+    Pm(start=12721657.16928),
+    C1(P(start=132.1e5, fixed=true)),
+    Cvmax=CvmaxValveVHP)
+                 annotation (Placement(transformation(extent={{-22,46},{-42,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_DownComer(
+    z2=0,
+    mode=1,
+    Q(start=150, fixed=true),
+    z1=10.83,
+    K=K_HP_DownComer,
+    C2(P(start=12768600.0)),
+    h(start=1474422.14552527),
+    Pm(start=12704000))
+            annotation (Placement(transformation(
+        origin={28,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapHP(mode=1, V=5,     h(start=1474422.14552527))
+                                           annotation (Placement(transformation(
+          extent={{8,-100},{-12,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Evaporator(
+    Dint=32.8e-3,
+    Ntubes=1476,
+    L=20.7,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
+      Tp(start={607.668721736158,605.187884376142,603.825778846274}),
+      Tp1(start={606.357,604.602,603.578})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=10.83,
+      option_temperature=2,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={5.74e7,2.67e7,1.24e7}),
+      Tp1(start={606.2,604.6,603.7}),
+      h(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134,
+            1459929.875}),
+      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
+      P(start={12758125,12740000,12734000,12730000,12726787})),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.092,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.86442072,
+      p_rho=1.05,
+      Encras(start=0.24)=Fouling_EvHP,
+      K(fixed=false, start=407),      DeltaT(start={106,49,23}),
+      T(start={755.54821777344,673.68082608925,635.57157972092,618.19360351563}),
+      Tm(start={643.15,633.15,626.621}),
+      Tp(start={609.11670087771,605.86035558168,604.13687003529})))
+                          annotation (Placement(transformation(
+        origin={-14,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_4(
+    Ns=3,
+    L=20.726,
+    Dint=0.0266,
+    Ntubes=246,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-3.5e6,-2.63e6,-2e6}),
+      Tp(start={576.803345033827,581.933438017921,585.694098500999}),
+      Tp1(start={575.762,580.856,584.579})),
+    Cws1(P(start=13703700.0), h_vol(start=1306078.18827954)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      z2=0,
+      option_temperature=2,
+inertia=true,
+      dW1(start={3.5e6,2.63e6,2e6}),
+      Tp1(start={577.5,582.6,586.4}),
+      h(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578,
+            1398251.0}),
+      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
+      P(start={13301176,13320000,13338000,13357000,13374658})),
+    Cws2(h(fixed=false, start=1500e3)),
+    ExchangerFlueGasesMetal(
+      Dext=0.0318,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.39069779,
+      p_rho=1.06,
+      Encras(start=0.03)=Fouling_EHP4,
+      K(fixed=true, start=47.53),DeltaT(start={38,29,22}),
+      T(start={618.19360351563,612.7722894387,608.97249438439,606.41162109375}),
+      Tm(start={623.15,613.15,607.844}),
+      Tp(start={577.44979072627,582.41942947968,586.06092597683})))
+                          annotation (Placement(transformation(
+        origin={86,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_1(
+    Ns=3,
+    L=20.4,
+    Dint=0.0324,
+    Ntubes=246,
+    ExchangerWall(e=0.0028, lambda=37.61,
+    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
+      Tp(start={629.445777860324,651.664976699235,671.075818762815}),
+      Tp1(start={629,651,670.})),
+    Cws1(h_vol(start=2665000.0)),
+    Cws2(P(start=12720900.0), h_vol(start=2981170.0)),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=10.25056,
+      p_rho=1.04,
+      Encras(start=0.075)=Fouling_SHP,
+      K(fixed=false, start=34.71),      DeltaT(start={138,108,84}),
+      T(start={788.2431640625,774.65344332519,763.17487871399,755.54821777344}),
+      Tm(start={778.15,768.15,759.527}),
+      Tp(start={631.68675322573,653.38616970968,672.36458008039})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      option_temperature=2,
+      inertia=true,
+      dpfCorr=2,      dW1(start={9.8e6,7.7e6,5.9e6}),
+      Tp1(start={639.5,657,673}),
+      h(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983,
+            2973076.25}),
+      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
+      P(start={12723762,12723600,12723500,12720000,12719000})))
+         annotation (Placement(transformation(
+        origin={-63,-50},
+        extent={{-20,20},{20,-20}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_3(
+    Dint=26.6e-3,
+    Ntubes=1476,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
+      Tp(start={556.530623976228,563.226831750573,565.575075374951}),
+      Tp1(start={555.49,562.473,564.857})),
+    L=20.726,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.6e7,5.6e6,2.1e6}),
+      Tp1(start={558,565,567}),
+      h(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855,
+            1291418.875}),
+      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
+      P(start={13219333,13241000,13261000,13282000,13301176})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=12.451,
+      p_rho=1.08,
+      Encras(start=0.06)=Fouling_EHP3,
+      K(fixed=true, start=36.03),
+      St=5, DeltaT(start={34,12,4.4}),
+      T(start={602.67193603516,579.67183226637,571.50875350574,568.81030273438}),
+      Tm(start={593.15,583.15,571.919}),
+      Tp(start={557.01185690541,563.39937105652,565.63731055685})))      annotation (Placement(
+        transformation(
+        origin={206,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_2(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-5e6,-3e6,-2.e6}),
+      Tp(start={490.631370193221,498.229397165878,502.978053774656}),
+      Tp1(start={490,497.024,501.871})),
+    L=20.767,
+    Ntubes=1107,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={5e6,3e6,2.e6}),
+      Tp1(start={499,503,507}),
+      h(start={854494.5625,915007.018247822,957243.396653824,983786.364226731,
+            986348.9375}),
+      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
+      P(start={13129352,13152000,13175000,13197000,13219333})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=111e-3,
+      CSailettes=2.76134577,
+      p_rho=1.11,
+      Encras(start=0.11)=Fouling_EHP2,
+      K(fixed=true, start=65),
+      St=5, DeltaT(start={36,23,14}),
+      T(start={531.16070556641,523.74706132958,519.01561663699,516.31256103516}),
+      Tm(start={538.15,528.15,521.399}),
+      Tp(start={490.84070882241,498.36081646341,503.06064272486})))      annotation (Placement(
+        transformation(
+        origin={406,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_Economizer_1(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-9.9999e6,-5e6,-2.4e6}),
+      Tp(start={458.958585923538,468.506814782426,473.132256983258}),
+      Tp1(start={458.001,467.576,472.607})),
+    L=20.726,
+    Ntubes=1107,
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={9.9999e6,5e6,2.4e6}),
+      Tp1(start={467.4,476.5,480.9}),
+      h(start={618651.9375,752176.893518976,816707.727773953,847728.424287614,
+            854494.5625}),
+      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
+      dynamic_mass_balance=true,
+      P(start={13034956,13060000,13080000,13100000,13129352})),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=8.30057632,
+      p_rho=1.13,
+      Encras(start=0.07)=Fouling_EHP1,
+      K(fixed=true, start=40.),
+      St=5,   DeltaT(start={41,20,10}),
+      T(start={509.31488037109,491.44087131458,484.15889910859,482.59533691406}),
+      Tm(start={503.15,498.15,494.131}),
+      Tp(start={459.37586976399,468.70800090382,473.22896941053})))      annotation (Placement(
+        transformation(
+        origin={526,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_2(
+    Ns=3,
+    L=20.4,
+    Dint=32e-3,
+    Ntubes=246,
+    ExchangerWall(e=3e-3, lambda=27,
+          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
+      Tp(start={714.604505161814,740.492493660215,759.200099714419}),
+      Tp1(start={710.485,734.082,752.527})),
+    Cws2(P(start=127113000.0), h_vol(start=3254970.0)),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.83,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={8.8e6,6.6e6,4.9e6}),
+      Tp1(start={714,735.6,752}),
+      h(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722,
+            3240813.5}),
+      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
+      P(start={12720371,12718000,12716000,12714000,12711007})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      CSailettes=10.2505424803872,
+      p_rho=1.02,
+      Encras(start=0.075)=Fouling_SHP,
+      K(fixed=false, start=34.74),
+      St=5,
+      DeltaT(start={124,93,70}),
+      T(start={850.64624023438,839.40882309811,830.36536707939,822.68170166016}),
+      Tm(start={843.15,833.15,825.24}),
+      Tp(start={717.48312916257,742.56566858011,760.69152533026})))      annotation (Placement(
+        transformation(
+        origin={-174,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    HP_SuperHeater_3(
+    Ns=3,
+    L=20.4,
+    Ntubes=246,
+    ExchangerWall(lambda=27,e=5e-3,
+    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
+      Tp(start={793.335674512128,811.477076678823,824.721389633254}),
+      Tp1(start={783.815,803.639,818.56})),
+    Dint=28e-3,
+    Cws2(h(fixed=true, start=3511e3)),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.726,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={6.3e6,4.7e6,3.6e6}),
+      Tp1(start={783.6,801.6,815}),
+      h(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987,
+            3433271.25}),
+      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
+      P(start={12711007,12704000,12697000,12689000,12681000})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      p_rho=1,
+      Encras(start=0.075)=Fouling_SHP,
+      CSailettes=6.59672846,
+      K(fixed=false, start=49.33),
+      St=5,
+      DeltaT(start={97,73,55}),
+      T(start={894.21850585938,885.5393240412,879.47464880089,874.32891845703}),
+      Tm(start={893.15,883.15,875.939}),
+      Tp(start={796.82789474964,814.05266276572,826.6253996051})))      annotation (Placement(
+        transformation(
+        origin={-294,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum IP_Drum(
+    L=16.27,
+    Vertical=false,
+    P0=27.29e5,
+    hl(fixed=false, start=978914.570821827),
+    hv(fixed=false, start=2799158.13966473),
+    Vv(fixed=false),
+    R=1.05,
+    P(fixed=false, start=28.3e5),
+    zl(start=1.05, fixed=true),
+    Kvl=0,
+    Kpa=5,
+    Mp=5000,
+    Cv(Q(fixed=true, start=10.9)),
+    Pfond(start=2732995.0),
+    Tp(start=500.955757665063))
+                     annotation (Placement(transformation(extent={{358,10},{320,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    IP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_FeedValve(
+      Cvmax=CvmaxValveAMP,
+    C1(P(start=2952995.0), h_vol(start=892414.570867188)),
+    h(start=944000),
+    Cv(start=28),
+    Pm(start=2945000))
+                 annotation (Placement(transformation(extent={{398,46},{378,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_SteamValve(
+    Pm(fixed=false, start=2731689.4244255),
+    C2(h_vol(start=2798000),P(start=27.3e5)),
+    h(fixed=false, start=2798000),
+    mode=0,
+    Cv(start=27829.4),
+    Cvmax=CvmaxValveVMP,
+    C1(P(start=28.3e5, fixed=true)))
+                 annotation (Placement(transformation(extent={{298,46},{278,66}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_Evaporator(
+    Dint=32.8e-3,
+    L=20.767,
+    Ntubes=738,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
+      Tp(start={504.957792851478,504.19488464586,503.59993822766}),
+      Tp1(start={504.427,503.806,503.304})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.83,
+      continuous_flow_reversal=true,
+      inertia=true,
+          dW1(start={9.7e7,7.6e6,5.8e6}),
+      Tp1(start={504.5,503.9,503.4}),
+      P(start={2773367.5,2754933.93610513,2745233.82043873,2738517.46232967,2733824.75}),
+      h(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464,980708.125}),
+      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=10.0676093,
+      p_rho=1.1,
+      Encras(start=0.08)=Fouling_EvMP,
+      K(fixed=false, start=46.9),
+      St=5,
+      DeltaT(start={53,41,32}),
+      T(start={565.24822998047,551.20973998682,539.98034586472,531.16070556641}),
+      Tm(start={553.15,543.15,536.901}),
+      Tp(start={505.45492567199,504.57970000924,503.89762940507})))              annotation (Placement(
+        transformation(
+        origin={306,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss IP_DownComer(
+    z2=0,
+    z1=10.83,
+    mode=1,
+    K=K_IP_DownComer,
+    Q(start=22, fixed=true),
+    Pm(start=2734000),
+    h(start=978914.570821827))
+            annotation (Placement(transformation(
+        origin={348,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapMP(mode=1, V=5,
+    h(start=978914.570821827),
+    P(start=2834000))                      annotation (Placement(transformation(
+          extent={{328,-100},{308,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_Economizer(
+    ExchangerWall(e=2.6e-3, lambda=47,
+        dW1(start={-3e6,-1.4e6,-740379}),
+      Tp(start={457.584681885759,475.409334769727,486.332585528225}),
+      Tp1(start={456.76,474.926,485.122})),
+    L=20.726,
+    Ns=3,
+    Dint=26.6e-3,
+    Ntubes=246,
+    Cws1(h_vol(start=671235.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.767,
+      z2=0,
+      inertia=true,
+      dW1(start={3e6,1.4e6,740379}),
+      Tp1(start={474,491,499.9}),
+      h(start={565108.5,727745.440528479,829820.124314816,892414.570867187,
+            944505.4375}),
+      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
+      P(start={3124229.75,3148000,3172000,3195000,3216977.75})),
+    Cws2(h(fixed=false, start=990e3)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      CSailettes=7.16188651,
+      p_rho=1.12,
+      Encras(start=0.09)=Fouling_EMP,
+      K(fixed=true, start=50),
+      St=5,
+      DeltaT(start={45,24,13}),
+      T(start={516.31256103516,511.25046295073,508.31162431247,509.31488037109}),
+      Tm(start={533.15,523.15,514.647}),
+      Tp(start={458.18343678065,475.77644311925,486.55770446184})))              annotation (Placement(
+        transformation(
+        origin={466,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_1(
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.3e6,-0.80263e6,
+                                -501864}),
+      Tp(start={557.102699668877,574.070651369638,584.64928514972}),
+      Tp1(start={556.102699668877,573.070651369638,583.64928514972})),
+    L=20.726,
+    Ns=3,
+    Dint=32.8e-3,
+    Ntubes=123,
+    Cws1(h_vol(start=2800000.0),P(start=2.73467e+06)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      CSailettes=14.46509765,
+      p_rho=1.07,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=22.09),
+      St=5,
+      DeltaT(start={45,30,19}),
+      T(start={606.41162109375,604.22099235915,603.06310204059,602.67193603516}),
+      Tm(start={623.15,613.15,603.024}),
+      Tp(start={557.49575399383,574.31250418519,584.79699207547})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.77,
+      dpfCorr=2,
+      inertia=false,
+      dW1(start={1.3e6,0.80263e6,501864}),
+      Tp1(start={557,573,583}),
+      h(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156,
+            3040562.25}),
+      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
+      P(start={2731326.25,2729591.6901521,2728654.3204706,2727686.1714029,
+            2726700})))     annotation (Placement(transformation(
+        origin={146,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB VolumeLP(
+    Ce1(h(start=3091610.0)),
+    h(start=3042573.51976705),
+    P(start=2726000))
+    annotation (Placement(transformation(
+        origin={146,-110},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_2(
+    Ns=3,
+    L=20.4,
+    Dint=39.3e-3,
+    Ntubes=369,
+    ExchangerWall(e=2.6e-3, lambda=36.86,
+    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
+      Tp(start={689.66516778766,716.376344387713,734.591437191304}),
+      Tp1(start={687.7,713.5,731.5})),
+    Cws1(P(start=2576650.0), h_vol(start=3078800.0)),
+    Cws2(P(start=2558540.0), h_vol(start=3342910.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={1.15e7,7.9e6,5.5e6}),
+      Tp1(start={685.6,711,729}),
+      h(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389,
+            3321940.75}),
+      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
+      P(start={2575582.5,2572000,2568000,2563000,2558239})),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=92e-3,
+      CSailettes=5.814209831,
+      p_rho=1.03,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=45.22),
+      St=5,
+      DeltaT(start={125,86,60}),
+      T(start={822.68170166016,807.90772072705,797.00284433443,788.2431640625}),
+      Tm(start={813.15,803.15,792.527}),
+      Tp(start={690.93545553661,717.24269857866,735.18209370035})))              annotation (Placement(
+        transformation(
+        origin={-114,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    IP_SuperHeater_3(
+    Ns=3,
+    L=20.4,
+    Ntubes=369,
+    Dint=45.6e-3,
+    ExchangerWall(e=2.6e-3, lambda=27,
+    dW1(start={-8e6,-5.5e6,-3.8e6}),
+      Tp(start={788.901616786331,805.674094596818,817.083010473709}),
+      Tp1(start={786.717,804.102,815.901})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dpfCorr=2,
+      dW1(start={8e6,5.5e6,3.8e6}),
+      Tp1(start={782,798.7,810}),
+      h(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916,
+            3517975.25}),
+      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
+      P(start={2558239,2556000,2554000,2552000,2548600})),
+    Cws2(h(fixed=true, start=3606e3)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=92e-3,
+      Dext=50.8e-3,
+      p_rho=1.01,
+      CSailettes=5.695842178,
+      Encras(start=0.1385)=Fouling_SMP,
+      K(fixed=false, start=43.23),
+      St=5,
+      DeltaT(start={82,56,38}),
+      T(start={874.32891845703,864.2444076086,856.92248545484,850.64624023438}),
+      Tm(start={873.15,863.15,853.059}),
+      Tp(start={789.92521486539,806.37044583028,817.55662835373})))              annotation (Placement(
+        transformation(
+        origin={-234,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum LP_Drum(
+    Vertical=false,
+    P0=5e5,
+    Vv(fixed=false),
+    L=8,
+    hl(fixed=false, start=549249.519022482),
+    hv(fixed=false, start=2709858.97470349),
+    R=2,
+    zl(start=1.75, fixed=true),
+    Kvl=0,
+    Kpa=5,
+    Mp=5000,
+    P(fixed=false, start=520000),
+    Cv(Q(fixed=true, start=9.23)),
+    Pfond(start=564775.0),
+    Tp(start=406.411032587651))
+                     annotation (Placement(transformation(extent={{618,10},{578,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    LP_SteamValve_Constante(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_SteamValve(
+    p_rho=3, Cvmax=CvmaxValveVBP,
+    C2(P(start=503542.0), h_vol(start=2709858.97470349)),
+    h(start=2685000),
+    Cv(start=7555),
+    Pm(start=498000))
+                 annotation (Placement(transformation(extent={{558,46},{538,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve LP_FeedValve(
+    C1(h_vol(start=511900.0)),
+    h(fixed=false, start=509000),
+    Pm(fixed=false, start=5.0698e5),
+    Cvmax=250,
+    Cv(start=142.5),
+    C2(P(fixed=true, start=5.2e5)))
+                 annotation (Placement(transformation(extent={{650,46},{630,66}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss LP_DownComer(
+    z2=0,
+    z1=10.767,
+    K=32766,
+    mode=1,
+    Q(start=20, fixed=false),
+    pro(d(start=934.452746556487)),
+    Pm(start=564000),
+    h(start=549249.519022482))
+            annotation (Placement(transformation(
+        origin={610,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeEvapBP(h(start=549249.519022482),
+                                                                       mode=1,
+    V=5,
+    P(start=523000))                                   annotation (Placement(
+        transformation(extent={{592,-100},{572,-80}}, rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_Evaporator(
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
+      Tp(start={433.127441964236,432.076030201586,431.28112439162}),
+      Tp1(start={432.956,431.127,430.61})),
+    L=20.726,
+    Ntubes=984,
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={1.24e7,8.5e6,5.8e6}),
+      Tp1(start={442.5,441.7,441}),
+      h(start={550075.0,765243.011613326,912673.256542569,1013555.73710231,
+            550075.0}),
+      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
+      Q(start={49.787311368631,49.787311368631,49.787311368631,49.787311368631}),
+      P(start={522583.375,488000,487000,486000,485588.46875})),
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=138e-3,
+      CSailettes=11.07985,
+      p_rho=1.14,
+      Encras(start=0.09)=Fouling_EvBP,
+      K(fixed=false, start=46.7),
+      St=5,
+      DeltaT(start={45,31,21}),
+      T(start={482.59533691406,464.53146753441,453.496360082,442.5893859863}),
+      Tm(start={483.15,478.15,472.098}),
+      Tp(start={433.5360639938,432.3549425205,431.471976456})))              annotation (Placement(
+        transformation(
+        origin={566,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_LP_Drum(k=0.25)
+    annotation (Placement(transformation(extent={{742,32},{728,44}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve(
+      Pm(start=5.0698e5), mode=1,
+    C1(h_vol(start=549249.519022482)),
+    h(start=550000),
+    Cv(start=308.931))
+                 annotation (Placement(transformation(extent={{710,12},{730,32}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_SuperHeater(
+    Ns=3,
+    L=20.726,
+    Dint=39.3e-3,
+    Ntubes=123,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.1e6,-782901,-559798}),
+      Tp(start={489.606851797367,513.610203520748,530.080624448955}),
+      Tp1(start={488.486,512.197,529.53})),
+    Cws1(h_vol(start=2642240.0),P(start=484264)),
+    Cws2(h_vol(start=2979330.0)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=222.1e-3,
+      K(fixed=true, start=30.46),
+      CSailettes=3.25763059984175,
+      p_rho=1.09,
+      Encras(start=0.05)=Fouling_SBP,
+      St=5,
+      DeltaT(start={92,66,47}),
+      T(start={568.81030273438,567.21003420557,566.29303411055,565.24822998047}),
+      Tm(start={583.15,573.15,568.703}),
+      Tp(start={489.84170505864,513.76963980951,530.18834052149})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      rugosrel=1e-5,
+      z1=10.767,
+      inertia=false,
+      dpfCorr=0.25,
+      dW1(start={1.1e6,782901,559798}),
+      Tp1(start={485,511,529}),
+      h(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762,
+            2914520.25}),
+      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
+      P(start={510622.6875,505757.57962259,504477.27858572,503172.36919354,501850})))      annotation (Placement(
+        transformation(
+        origin={266,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkP SinkP_Gas(P0=1.044e5)
+    annotation (Placement(transformation(
+        origin={722,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    LP_Economizer(
+    Ns=3,
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
+      Tp(start={398.142807363473,393.825926964772,392.943738968771}),
+      Tp1(start={397.622,392.348,391.516})),
+    Ntubes=3444,
+    L=20.726,
+    Cws1(h_vol(start=195526.0)),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      inertia=true,
+      dpfCorr=0.5,
+      dW1(start={2.45e7,5.5e6,1.17e6}),
+      Tp1(start={409,404.7,404}),
+      h(start={194584.515625,462556.370989432,494648.45288738,501287.069880104,
+            509237.875}),
+      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
+      P(start={1540571.25,1500000,1480000,1450000,1429595.375})),
+    Cws2(h(fixed=false, start=500e3)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=92e-3,
+      CSailettes=11.673758598919,
+      p_rho=1.15,
+      Encras(start=0.06)=Fouling_EBP,
+      K(fixed=true, start=30),
+      St=5,
+      DeltaT(start={23.5,5.3,1.1}),
+      T(start={442.5893859863,403.9873508455,395.0465605839,395.464630127}),
+      Tm(start={423.15,418.15,414.742}),
+      Tp(start={398.4437772187,393.8897987349,392.9569515805})))              annotation (Placement(
+        transformation(
+        origin={680,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine HP_Turbine(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.88057),
+    eta_is_min=0.75,
+    Cst(start=8182844.56002535)=
+        CstHP,
+    Pe(fixed=true, start=125.20e5),
+    Ps(fixed=false, start=2726700),
+    eta_is_nom=EtaIsNomHP,
+    Cs(h(fixed=true, start=3106e3)),
+    pros(d(start=10.0)),
+    Hrs(start=3046260),
+    Qmax=151,
+    a=-1.20211,
+    b=2.32571,
+    c=-0.25) annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
+          rotation=0)));
+
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine IP_Turbine(
+    W_fric=1,
+    Ps(fixed=false, start=476800),
+    eta_stato=1,
+    eta_is(start=0.9625),
+    eta_is_min=0.75,
+    Cst(start=256335.364995961)=
+        CstMP,
+    Pe(fixed=true, start=25.13e5),
+    pros(d(start=30.0)),
+    Hrs(start=3029780),
+    Cs(h(fixed=false, start=2990e3)),
+    eta_is_nom=0.96,
+    b=2.4957,
+    Qmax=170,
+    a=-1.2728,
+    c=-0.26202)   annotation (Placement(transformation(extent={{318,-250},{358,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP1(
+    h(start=2997231.36734756),
+    P(start=476799.99999954),
+    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
+        origin={418,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine LP_Turbine(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9538),
+    eta_is_min=0.75,
+    Cst(start=11944.9445735985)=
+        CstBP,
+    Hrs(start=2401030),
+    Pe(fixed=true, start=4.77e5),
+        Ps(start=10053),
+    Cs(h(fixed=true, start=2399.9e3)),
+    eta_is_nom=EtaIsNomBP,
+    Qmax=192,
+    a=-1.22335,
+    b=2.2957,
+    c=-0.14)   annotation (Placement(transformation(extent={{576,-250},{616,
+            -210}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitHP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-292,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitMP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-232,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitHP(Cs(h(start=3000000)),
+                                                    alpha=0.5)
+    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
+    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    Vf0=0.15,
+    steady_state=false,
+    yNiveau(signal(start=1.5)),
+    Cse(h(start=128076)),
+    P0=6100,
+    P(fixed=false, start=6136),
+    Pfond(start=6200)) annotation (Placement(transformation(extent={{639,-384},
+            {719,-304}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
+    h0=113.38e3, Q0=17224)       annotation (Placement(transformation(extent={{
+            572,-377},{620,-329}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_In(
+    K=1e-4,
+    h(start=2400000),
+    C1(h_vol(start=2400000), h(start=2400000)),
+    Q(start=190.55),
+    Pm(start=10026)) annotation (Placement(transformation(extent={{640,-240},{660,
+            -220}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeCond1(mode=1,
+    Ce3(h(start=163768.700887002)),
+    h(start=163768.700887002),
+    P(start=1540500))
+    annotation (Placement(transformation(
+        origin={902,-318},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out2(
+    K=1e-4,
+    mode=1,
+    pro(d(start=993.470128235971)),
+    Pm(start=1540000)) annotation (Placement(transformation(
+        origin={902,-270},
+        extent={{12,-12},{-12,12}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeAlimMPHP(mode=1,
+    h(start=549249.519022482),
+    P(start=322430))                       annotation (Placement(transformation(
+          extent={{742,6},{762,26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump IP_Pump(
+    a3=350,
+    mode=1,
+    Q(fixed=false, start=10.9),
+    a1=-244551,
+    C1(h_vol(start=576000.0)),
+    C2(h_vol(start=561000.0)),
+    h(start=571000.0),
+    hn(start=317),
+    Qv(start=0.0207237016869104),
+    pro(d(start=930.0)),
+    Pm(start=1725850))
+            annotation (Placement(transformation(extent={{804,6},{824,26}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump HP_Pump(
+    a3=1600,
+    a1=-28056.2,
+    Q(fixed=false),
+    mode=1,
+    C1(h_vol(start=561000.0)),
+    C2(h_vol(start=630000.0)),
+    h(start=630000),
+    hn(start=1413),
+    Qv(start=0.0810383142105344),
+    pro(d(start=929.0)),
+    Pm(start=6774000))  annotation (Placement(transformation(extent={{804,-46},
+            {824,-26}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier MoitieDebitBP(
+                                                    alpha=0.5,
+    h(start=194585),
+    P(start=1540500),
+    Cs(h(start=194585)))
+    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Junctions.MassFlowMultiplier DoubleDebitBP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={266,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_LP_Turbine(
+    z2=0,
+    mode=0,
+    z1=0,
+    h(start=3000000),
+    C1(
+      h_vol(start=3000000),
+      h(start=3000000),
+      P(fixed=false, start=5.0185e5)),
+    K=1e-4,
+    Pm(start=490000)) annotation (Placement(transformation(
+        origin={344,-278},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_HP_Pump(
+    K=1e-4,
+    mode=1,
+    C2(h_vol(start=599600)),
+    Pm(start=372718)) annotation (Placement(transformation(
+        origin={780,-36},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss DP_IP_Pump(
+    K=1e-4,
+    mode=1,
+    C2(h_vol(start=599600)),
+    Pm(start=372718)) annotation (Placement(transformation(
+        origin={780,16},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Machines.Generator Alternateur
+    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out(
+    K=1e-4,
+    mode=1,
+    C1(h_vol(start=153206.462779274)),
+    C2(h_vol(start=153206.462779274)),
+    pro(d(start=993.441492649513)),
+    Pm(start=6200)) annotation (Placement(transformation(extent={{702,-446},{722,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump LP_Pump(
+    Qv(start=0.1934),
+    mode=1,
+    a3=400,
+    C2(P(fixed=false, start=16.7e5), h_vol(start=194669.0)),
+    h(start=193000),
+    hn(start=183),
+    a1=LP_Pump_a1,
+    Q(start=193.43, fixed=false),
+    Pm(start=1103065, fixed=false)) annotation (Placement(transformation(extent=
+           {{742,-446},{762,-426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss Dp_Cond_Out1(
+    K=1e-4,
+    mode=1,
+    pro(d(start=994.045785814739)),
+    C1(h_vol(start=194585), h(start=194585)),
+    Pm(start=1546000)) annotation (Placement(transformation(extent={{840,-446},{
+            860,-426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve ExtractionValve(
+    mode=1,
+    Cvmax=2500,
+    h(start=195000),
+    Cv(start=2000),
+    C1(h_vol(start=195000)),
+    C2(h_vol(start=195000)),
+    Pm(start=1549000)) annotation (Placement(transformation(extent={{802,-440},{
+            822,-420}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamHP(C1(h_vol(start=2674000),
+        h(start=2674000)))
+    annotation (Placement(transformation(
+        origin={-58,8},
+        extent={{-6,6},{6,-6}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterHP(C2(h_vol(start=1398000),
+        h(start=1398000)))
+    annotation (Placement(transformation(
+        origin={91.5,32},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterMP(C2(h_vol(start=944000),
+        h(start=944000)))
+    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamMP(C1(h_vol(start=2798000),
+        h(start=2798000)),C2(h_vol(start=2798000)))
+    annotation (Placement(transformation(
+        origin={236,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamBP(C2(h_vol(start=2685000),
+        h(start=2685000)))
+    annotation (Placement(transformation(
+        origin={514,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP(C2(h_vol(start=550000),
+        h(start=550000)))
+    annotation (Placement(transformation(
+        origin={663.5,34},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterBP_Out(C2(h_vol(start=
+            550000), h(start=550000))) annotation (Placement(transformation(
+          extent={{687,15},{700,27}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_WaterCondenser(C2(h_vol(start=
+           194585), h(start=194585))) annotation (Placement(transformation(
+        origin={685.5,-412},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ SensorQ_SteamCondenser(C2(h_vol(start=
+           2401000), h(start=2401000))) annotation (Placement(transformation(
+        origin={684.5,-264},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_2(
+    C1(
+      P(fixed=true, start=27.267e5),
+      h_vol(start=3046000),
+      h(start=3046000)),
+    K=K_Dp_HP_2,
+    Pm(start=2651000)) annotation (Placement(transformation(extent={{114,-120},{
+            94,-100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HP_Turbine_Valve(
+    mode=0,
+    h(fixed=false, start=3433000),
+    Cv(start=10875),
+    Pm(fixed=false, start=12550000),
+    C1(P(fixed=true, start=126.81e5)),
+    Cvmax=Cvmax_THP)
+                 annotation (Placement(transformation(extent={{-124,-234},{-104,
+            -214}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauHP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500,
+    minval=0.007) annotation (Placement(transformation(extent={{-40,106},{-20,
+            126}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauMP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500) annotation (Placement(transformation(extent={{262,106},{282,126}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauBP(                                                              k=1.75)
+    annotation (Placement(transformation(extent={{470,114},{504,132}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
+    add(k1=-1, k2=+1),
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauCondenseur1(                                 k=1.5)
+    annotation (Placement(transformation(extent={{704,-246},{740,-230}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+      add(k1=+1, k2=-1)) annotation (Placement(transformation(extent={{758,-282},
+            {778,-262}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneHP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
+            -138,-142}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp(
+    Initialvalue=1400,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=1300)
+                   annotation (Placement(transformation(extent={{944,-16},{906,
+            16}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP(
+    Initialvalue=1400,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=1300)
+                   annotation (Placement(transformation(extent={{945,-82},{907,
+            -50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingBP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{945,-458},{907,
+            -426}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP1_2(
+    mode=1,
+    V=1,
+    h0=988332,
+    h(start=988332),
+    P0=70.1e5,
+    P(start=13129000),
+    dynamic_mass_balance=true)            annotation (Placement(transformation(
+          extent={{456,-98},{436,-78}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeECO_HP2_3(
+    mode=1,
+    V=1,
+    h0=983786,
+    h(start=983786),
+    P0=70.0e5,
+    P(start=13219000),
+    dynamic_mass_balance=true)            annotation (Placement(transformation(
+          extent={{252,-20},{232,0}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve1(
+                          mode=1,
+    Cvmax=308.931,
+    h(start=618600),
+    Cv(start=308.931),
+    C1(h_vol(start=618600)),
+    Pm(start=13130000))
+                 annotation (Placement(transformation(extent={{754,-98},{730,
+            -122}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve HPIP_FeedValve2(
+      Pm(start=3126000), mode=1,
+    Q(start=10.9, fixed=false),
+    h(start=565000),
+    C1(h_vol(start=565000)),
+    Cv(start=308.931),
+    Cvmax=308.931)
+                 annotation (Placement(transformation(extent={{804,-138},{780,
+            -162}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingMp1(
+    Initialvalue=0.8,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=0.4)  annotation (Placement(transformation(extent={{946,-150},{
+            908,-118}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe StopPumpingHP1(
+    Initialvalue=0.8,
+    Starttime=200000,
+    Duration=800,
+    Finalvalue=0.4)  annotation (Placement(transformation(extent={{946,-194},{
+            908,-162}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD VolumePreTHP(
+    P0=127e5,
+    h0=3e6,
+    P(start=127e5),
+    h(start=3450835.48993987),
+    dynamic_mass_balance=true)        annotation (Placement(transformation(
+        origin={-52,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC VolumeIP(
+    h0=3523910,
+    h(start=3523910),
+    dynamic_mass_balance=true,
+    P0=2400000,
+    P(start=24e5))                        annotation (Placement(transformation(
+        origin={-50,-314},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve IP_Turbine_Valve(
+    h(fixed=false, start=3518000),
+    mode=0,
+    Pm(fixed=false, start=2547000),
+    Cv(start=3.312e6),
+    C1(P(fixed=true, start=25.486e5)),
+    Cvmax=Cvmax_TMP)
+                 annotation (Placement(transformation(extent={{-124,-318},{-104,
+            -298}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneIP_Turbine(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
+            -138,-226}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
+    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
+    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
+    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Gain Gain_2GasTurbine(Gain=
+       2) annotation (Placement(transformation(extent={{-18,-448},{2,-428}},
+          rotation=0)));
+  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible(
+    Hum=0,
+    rho=0.838,
+    T0=185 + 273.16,
+    Cp=2255,
+    LHV=46989e3,
+    Xo=0.000,
+    Xn=0.000,
+    Xs=0.000,
+    Xc=0.74,
+    Xh=0.25,
+    Q0=13.521) annotation (Placement(transformation(extent={{-421,24},{-385,60}},
+          rotation=0)));
+  WaterSteam.BoundaryConditions.SourcePQ sourceEau(             Q0=0.0)
+          annotation (Placement(transformation(extent={{-473,27},{-445,57}},
+          rotation=0)));
+  FlueGases.BoundaryConditions.SourcePQ SourceFumees(
+    Xso2=0,
+    Xco2=0,
+    Xh2o=0,
+    Xo2=0.20994,
+    T0=29.4 + 273.16,
+    P0=1.003e5,
+    Q0=592.76 + 0.66)
+    annotation (Placement(transformation(extent={{-539,-74},{-495,-28}},
+          rotation=0)));
+  FlueGases.TAC.GasTurbine GasTurbine(
+    Kcham=1.114801,
+    exp_eff_n=0.90,
+    comp_eff_n=0.9,
+    TurbQred=0.01731,
+    comp_tau_n=14.0,
+    Wpth=1.2707e6,
+    exp_tau_n=0.079,
+    chambreCombustionTAC(
+      Psf(fixed=false, start=13.16e5),
+      Pea(fixed=true, start=14.042e5),
+      kcham=C_Kcham,
+      Tea(start=680)),
+    TurbineAgaz(
+      Ps(fixed=false),
+      A3=0,
+      A2=-0.04778,
+      A1=0.09555,
+      A0=0.95223,
+      Wmech(fixed=false, start=227.3e6),
+      Pe(fixed=false, start=13.3e5),
+      is_eff(fixed=false, start=0.92),
+      Ts(fixed=true, start=893.76),
+      is_eff_n=T_is_eff_n,
+      Qred=T_Qred,
+      tau_n=0.079094,
+      tau(fixed=true, start=0.079094),
+      Tis(start=828)),
+    Compresseur(
+      tau(fixed=false, start=14),
+      is_eff_n=C_is_eff_n,
+      is_eff(fixed=true, start=0.76),
+      Xtau(fixed=true, start=1),
+      Tis(start=630),
+      Ts(start=680),
+      tau_n(start=14)=C_tau_n))
+    annotation (Placement(transformation(extent={{-471,-115},{-341,13}},
+          rotation=0)));
+
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeQfuel(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=13.521,
+    Finalvalue=7.804)
+                     annotation (Placement(transformation(extent={{-538,80},{
+            -518,100}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe Humidite(
+    Starttime=200,
+    Initialvalue=1,
+    Finalvalue=0.8,
+    Duration=800)
+    annotation (Placement(transformation(extent={{-538,20},{-517,40}}, rotation=
+           0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeIQair(
+    Starttime=200,
+    Initialvalue=592.76 + 0.66,
+    Finalvalue=384.3,
+    Duration=800)  annotation (Placement(transformation(extent={{-539,-20},{
+            -519,0}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeTair(
+    Starttime=200,
+    Initialvalue=302.56,
+    Finalvalue=305.16,
+    Duration=800)  annotation (Placement(transformation(extent={{-539,-100},{
+            -519,-80}}, rotation=0)));
+  WaterSteam.Volumes.VolumeA SeparateurMP(h(start=3106000), P(start=27.26e+005),
+    rho(start=10))
+    annotation (Placement(transformation(
+        origin={74,-200},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_PressureLoss_1(
+    K=1e-4,
+    pro(d(start=10)),
+    h(start=3106000),
+    C1(
+      P(start=27.26e+005),
+      h_vol(start=3106000),
+      Q(start=153),
+      h(start=3106000)),
+    C2(
+      P(start=27.259e+005),
+      h_vol(start=3106000),
+      Q(start=153),
+      h(start=3106000)),
+    Pm(start=2726000)) annotation (Placement(transformation(extent={{88,-182},{102,
+            -158}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss HP_IP_PressureLoss(
+    Q(fixed=true, start=3.09),
+    continuous_flow_reversal=true,
+    h(start=3106000),
+    C1(
+      P(start=27.26e+005),
+      h_vol(start=3106000),
+      h(start=3106000),
+      Q(start=3.09)),
+    C2(
+      P(start=27.259e+005),
+      h_vol(start=3106000),
+      h(start=3106000),
+      Q(start=3.09)),
+    K=K_Dp_HP_IP,
+    Pm(start=2726000)) annotation (Placement(transformation(extent={{134,-210},{
+            154,-190}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe Q_water(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=21000,
+    Finalvalue=15000)
+                   annotation (Placement(transformation(extent={{555,-364},{575,
+            -344}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampePout(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=1.044e5,
+    Finalvalue=1.028e5)
+                   annotation (Placement(transformation(extent={{711,-84},{731,
+            -64}}, rotation=0)));
+equation
+  connect(HP_SuperHeater_3.Cws1, HP_SuperHeater_2.Cws2)
+    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
+        color={255,0,0}));
+  connect(HP_SuperHeater_2.Cws1, HP_SuperHeater_1.Cws2)
+    annotation (Line(points={{-174,-70},{-174,-90},{-63,-90},{-63,-70}}, color=
+          {255,0,0}));
+  connect(HP_SteamValve_Constante.y, HP_SteamValve.Ouv)
+    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
+  connect(HP_SteamValve.C1, HP_Drum.Cv)
+    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
+  connect(HP_DownComer.C1, HP_Drum.Cd)
+    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={0,0,0}));
+  connect(HP_Drum.Cm, HP_Evaporator.Cws2)
+    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}, color={0,0,0}));
+  connect(VolumeEvapHP.Cs, HP_Evaporator.Cws1)
+    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={0,0,0}));
+  connect(VolumeEvapHP.Ce1, HP_DownComer.C2)
+                                      annotation (Line(points={{8,-90},{18,-90}},
+        color={0,0,0}));
+  connect(HP_Economizer_4.Cws1, HP_Economizer_3.Cws2)
+    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
+  connect(IP_Drum.Cm, IP_Evaporator.Cws2)
+    annotation (Line(points={{320,10},{306,10},{306,-30}}, color={0,0,0}));
+  connect(IP_Evaporator.Cws1, VolumeEvapMP.Cs)
+    annotation (Line(points={{306,-70},{306,-90},{308,-90}}, color={0,0,0}));
+  connect(VolumeEvapMP.Ce1, IP_DownComer.C2)
+    annotation (Line(points={{328,-90},{338,-90}}, color={0,0,0}));
+  connect(IP_SteamValve_Constante.y, IP_SteamValve.Ouv)
+    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
+  connect(HP_SuperHeater_1.Cfg2, HP_Evaporator.Cfg1)        annotation (Line(
+      points={{-53,-50},{-53,-50},{-24,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Evaporator.Cfg2, HP_Economizer_4.Cfg1)        annotation (Line(
+      points={{-4,-50},{96,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_4.Cfg2, IP_SuperHeater_1.Cfg1)          annotation (Line(
+      points={{76,-50},{136,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_1.Cfg2, HP_Economizer_3.Cfg1)           annotation (Line(
+      points={{156,-50},{196,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_Evaporator.Cfg2, HP_Economizer_2.Cfg1)           annotation (Line(
+      points={{316,-50},{396,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_2.Cfg2, IP_Economizer.Cfg1)           annotation (Line(
+      points={{416,-50},{456,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_Economizer.Cfg2, HP_Economizer_1.Cfg1)           annotation (Line(
+      points={{476,-50},{516,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_DownComer.C1, IP_Drum.Cd)
+    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={0,0,
+          0}));
+  connect(IP_SuperHeater_2.Cfg2, HP_SuperHeater_1.Cfg1)          annotation (Line(
+      points={{-104,-50},{-73,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_2.Cfg1, HP_SuperHeater_2.Cfg2)           annotation (Line(
+      points={{-124,-50},{-164,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_3.Cfg2, HP_SuperHeater_2.Cfg1)           annotation (Line(
+      points={{-224,-50},{-184,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_SuperHeater_3.Cfg2, IP_SuperHeater_3.Cfg1)           annotation (Line(
+      points={{-284,-50},{-244,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(IP_SuperHeater_3.Cws1,IP_SuperHeater_2. Cws2)
+    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
+          {255,0,0}));
+  connect(IP_SuperHeater_1.Cws2, VolumeLP.Ce2) annotation (Line(
+      points={{146,-70},{146,-100}},
+      color={255,0,0},
+      pattern=LinePattern.None));
+  connect(LP_SteamValve.C1, LP_Drum.Cv)
+    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
+  connect(LP_Evaporator.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
+          -70},{566,-90},{572,-90}}, color={0,0,0}));
+  connect(VolumeEvapBP.Ce1, LP_DownComer.C2)
+                                        annotation (Line(points={{592,-90},{600,
+          -90}}, color={0,0,0}));
+  connect(LP_Drum.Cd, LP_DownComer.C1) annotation (Line(points={{618,10},{628,
+          10},{628,-90},{620,-90}}, color={0,0,0}));
+  connect(LP_Economizer.Cfg2, SinkP_Gas.C)     annotation (Line(
+      points={{690,-50},{712.2,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_3.Cfg2, LP_SuperHeater.Cfg1)  annotation (Line(
+      points={{216,-50},{256,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_SuperHeater.Cfg2, IP_Evaporator.Cfg1)  annotation (Line(
+      points={{276,-50},{296,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(HP_Economizer_1.Cfg2, LP_Evaporator.Cfg1) annotation (Line(
+      points={{536,-50},{556,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_Evaporator.Cfg2, LP_Economizer.Cfg1) annotation (Line(
+      points={{576,-50},{670,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(LP_Drum.Cm, LP_Evaporator.Cws2)
+    annotation (Line(points={{578,10},{566,10},{566,-30}}, color={0,0,0}));
+  connect(IP_SteamValve.C1, IP_Drum.Cv)   annotation (Line(points={{298,50},{
+          320,50}}, color={255,0,0}));
+  connect(HPIP_FeedValve.Ouv, constante_LP_Drum.y)
+    annotation (Line(points={{720,33},{720,38},{727.3,38}}));
+  connect(HP_SuperHeater_3.Cws2, DoubleDebitHP.Ce)
+    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
+        color={255,0,0}));
+  connect(IP_SuperHeater_3.Cws2, DoubleDebitMP.Ce)
+    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
+        color={255,0,0}));
+  connect(VolumeCond1.Cs, Dp_Cond_Out2.C1)
+    annotation (Line(points={{902,-308},{902,-282}}, color={0,0,255}));
+  connect(HPIP_FeedValve.C2, VolumeAlimMPHP.Ce1)
+                                               annotation (Line(points={{730,16},
+          {742,16}}, color={0,0,255}));
+  connect(LP_SuperHeater.Cws2, DoubleDebitBP.Ce)
+    annotation (Line(points={{266,-70},{266,-90}}, color={255,0,0}));
+  connect(DP_IP_Pump.C2, IP_Pump.C1)
+    annotation (Line(points={{790,16},{798,15},{804,16}}, color={0,0,255}));
+  connect(VolumeAlimMPHP.Cs1, DP_IP_Pump.C1) annotation (Line(points={{762,16},{
+          766,15},{766,16},{770,16}}, color={0,0,255}));
+  connect(VolumeAlimMPHP.Cs2, DP_HP_Pump.C1)
+    annotation (Line(points={{752,6},{752,-36},{770,-36}}, color={0,0,255}));
+  connect(DP_HP_Pump.C2, HP_Pump.C1)
+    annotation (Line(points={{790,-36},{804,-36}}, color={0,0,255}));
+  connect(VolumeIP1.Ce2, Dp_LP_Turbine.C2) annotation (Line(points={{418,-239},{
+          418,-278},{354,-278}}, color={255,0,0}));
+  connect(Dp_Cond_Out.C2, LP_Pump.C1)
+    annotation (Line(points={{722,-436},{742,-436}}, color={0,0,255}));
+  connect(ExtractionValve.C2, Dp_Cond_Out1.C1)
+    annotation (Line(points={{822,-436},{840,-436}}, color={0,0,255}));
+  connect(HP_FeedValve.C1, SensorQ_WaterHP.C2)
+    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
+  connect(HP_SteamValve.C2, SensorQ_SteamHP.C1) annotation (Line(points={{
+          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
+  connect(SensorQ_SteamHP.C2, HP_SuperHeater_1.Cws1) annotation (Line(points={{-53.2,
+          1.88},{-53.2,-3.06},{-63,-3.06},{-63,-30}},        color={255,0,0}));
+  connect(IP_FeedValve.C1, SensorQ_WaterMP.C2)
+    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
+  connect(SensorQ_SteamMP.C1, IP_SteamValve.C2) annotation (Line(points={{
+          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
+  connect(SensorQ_SteamMP.C2, IP_SuperHeater_1.Cws1) annotation (Line(points={
+          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
+  connect(SensorQ_SteamBP.C2, LP_SuperHeater.Cws1) annotation (Line(points={{
+          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
+  connect(SensorQ_SteamBP.C1, LP_SteamValve.C2) annotation (Line(points={{
+          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
+  connect(SensorQ_WaterBP.C2, LP_FeedValve.C1) annotation (Line(
+        points={{658.3,40.12},{658.3,50},{650,50}}, color={0,0,255}));
+  connect(SensorQ_WaterBP_Out.C2, HPIP_FeedValve.C1) annotation (Line(points={{
+          700.13,16.2},{705.065,16.2},{705.065,16},{710,16}}, color={0,0,255}));
+  connect(SensorQ_WaterCondenser.C2, Dp_Cond_Out.C1) annotation (Line(points={{
+          680.3,-422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
+  connect(Dp_Cond_In.C2, SensorQ_SteamCondenser.C1) annotation (Line(points={{
+          660,-230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
+  connect(VolumeLP.Ce1, MoitieDebitHP.Cs)
+    annotation (Line(points={{146,-120},{146,-170},{134,-170}}, color={255,0,0}));
+  connect(Dp_Cond_Out1.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,-436},
+          {862,-436},{862,-318},{872,-318}}, color={0,0,255}));
+  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
+          {892,-318}}, color={0,0,255}));
+  connect(IP_SuperHeater_2.Cws1, HP_PressureLoss_2.C2) annotation (Line(points={{-114,-70},
+          {-114,-110},{94,-110}}, color={255,0,0}));
+  connect(HP_PressureLoss_2.C1, VolumeLP.Cs2)
+    annotation (Line(points={{114,-110},{136.2,-110}}, color={255,0,0}));
+  connect(DoubleDebitHP.Cs, HP_Turbine_Valve.C1) annotation (Line(points=
+          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
+  connect(DoubleDebitBP.Cs, Dp_LP_Turbine.C1) annotation (Line(points={{266,-110},
+          {266,-278},{334,-278}}, color={255,0,0}));
+  connect(LP_Pump.C2, ExtractionValve.C1)
+    annotation (Line(points={{762,-436},{802,-436}}, color={0,0,255}));
+  connect(HP_Drum.yLevel,regulation_Niveau_HP. MesureNiveauEau)
+    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
+  connect(regulation_Niveau_HP.SortieReelle1, HP_FeedValve.Ouv)
+    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
+  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
+    annotation (Line(
+      points={{208.7,122},{234,122},{234,110},{261.5,110}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(IP_Drum.yLevel,regulation_Niveau_MP. MesureNiveauEau)
+    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
+  connect(regulation_Niveau_MP.SortieReelle1, IP_FeedValve.Ouv)
+    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
+  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
+    annotation (Line(
+      points={{505.7,123},{529.85,123},{529.85,112},{567.5,112}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(LP_Drum.yLevel,regulation_Niveau_BP. MesureNiveauEau)
+    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
+  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
+    annotation (Line(
+      points={{741.8,-238},{752,-238},{752,-269},{757.5,-269}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(regulation_Niveau_Condenseur.SortieReelle1, ExtractionValve.Ouv)
+    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
+  connect(SensorQ_WaterBP.C1, LP_Economizer.Cws2)
+    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
+  connect(LP_Economizer.Cws1, Dp_Cond_Out2.C2)
+    annotation (Line(points={{680,-70},{680,-186},{902,-186},{902,-258}}));
+  connect(SensorQ_SteamCondenser.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
+    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,-280.9}}));
+  connect(regulation_Niveau_Condenseur.MesureDebitEau, SensorQ_WaterCondenser.Measure)
+    annotation (Line(points={{757.45,-274.95},{750,-274.95},{750,-310},{792,-310},
+          {792,-412},{692.13,-412}}));
+  connect(ConstantVanneHP_Turbine.y, HP_Turbine_Valve.Ouv)
+    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
+  connect(regulation_Niveau_BP.SortieReelle1, LP_SteamValve.Ouv)
+    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
+  connect(LP_FeedValve.Ouv, LP_SteamValve_Constante.y)
+    annotation (Line(points={{640,67},{640,81},{653.4,81}}));
+  connect(HP_Economizer_1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
+          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
+  connect(VolumeECO_HP1_2.Cs, HP_Economizer_2.Cws1) annotation (Line(points={{
+          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
+  connect(HP_Economizer_2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
+          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
+  connect(VolumeECO_HP2_3.Cs, HP_Economizer_3.Cws1) annotation (Line(points={{
+          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
+  connect(HPIP_FeedValve1.C1, HP_Pump.C2)
+    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-36},{824,-36}}));
+  connect(IP_Pump.C2, HPIP_FeedValve2.C1) annotation (Line(points={
+          {824,16},{870,16},{870,-142.8},{804,-142.8}}, color={0,0,255}));
+  connect(StopPumpingMp1.y, HPIP_FeedValve1.Ouv)
+    annotation (Line(
+      points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,-123.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(StopPumpingHP1.y, HPIP_FeedValve2.Ouv)
+    annotation (Line(
+      points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,-163.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(HPIP_FeedValve1.C2, HP_Economizer_1.Cws1) annotation (Line(
+        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
+          -6},{526,-30}}, color={0,0,255}));
+  connect(IP_Economizer.Cws1, HPIP_FeedValve2.C2)
+    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
+  connect(ConstantVanneIP_Turbine.y, IP_Turbine_Valve.Ouv)
+    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
+  connect(HP_Turbine_Valve.C2, VolumePreTHP.Ce) annotation (Line(points={
+          {-104,-230},{-62,-230}}, color={255,0,0}));
+  connect(DoubleDebitMP.Cs, IP_Turbine_Valve.C1) annotation (Line(points=
+          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
+  connect(IP_Turbine_Valve.C2, VolumeIP.Ce1) annotation (Line(
+        points={{-104,-314},{-60,-314}}, color={255,0,0}));
+  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(points={{620,-353},
+          {638,-353},{638,-352},{639,-352.8}}, color={0,0,255}));
+  connect(Condenser.Cse, PuitsCaloporteur.C)
+    annotation (Line(points={{719,-352},{736,-352}}, color={0,0,255}));
+  connect(SensorQ_SteamCondenser.C2, Condenser.Cv) annotation (Line(points={{
+          679.3,-274.2},{679.3,-288.1},{679,-288.1},{679,-304}}, color={0,0,255}));
+  connect(SensorQ_WaterCondenser.C1, Condenser.Cl)
+    annotation (Line(points={{680.3,-402},{679.8,-402},{679.8,-384}}));
+  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
+    annotation (Line(
+      points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(Condenser.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
+    annotation (Line(points={{723,-372.8},{780,-372.8},{780,-326},{732,-326},{
+          732,-263},{757.5,-263}}));
+  connect(LP_Drum.Cs, SensorQ_WaterBP_Out.C1) annotation (Line(points={{578,22},
+          {564,22},{564,16},{642,16},{642,16.2},{687,16.2}}, color={0,0,255}));
+  connect(LP_Drum.Ce1, LP_FeedValve.C2)
+    annotation (Line(points={{618,50},{630,50}}));
+  connect(IP_Drum.Ce1, IP_FeedValve.C2)
+    annotation (Line(points={{358,50},{378,50}}));
+  connect(HP_Drum.Ce1, HP_FeedValve.C2)
+    annotation (Line(points={{38,50},{58,50}}));
+  connect(VolumePreTHP.Cs3, HP_Turbine.Ce) annotation (Line(points={{-42,-230},{
+          -2.2,-230}}, color={255,0,0}));
+  connect(VolumeIP.Cs, IP_Turbine.Ce) annotation (Line(points={{-40,-314},
+          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
+  connect(IP_Turbine.Cs, VolumeIP1.Ce1) annotation (Line(points={{358.2,
+          -230},{408,-230}}, color={255,0,0}));
+  connect(VolumeIP1.Cs, LP_Turbine.Ce) annotation (Line(points={{428,
+          -230},{575.8,-230}}, color={255,0,0}));
+  connect(LP_Turbine.Cs, Dp_Cond_In.C1)
+    annotation (Line(points={{616.2,-230},{640,-230}}, color={255,0,0}));
+  connect(IP_Economizer.Cws2, SensorQ_WaterMP.C1) annotation (Line(points={{
+          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
+  connect(IP_Turbine.MechPower, Alternateur.Wmec2)
+    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
+  connect(LP_Turbine.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
+          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
+  connect(HP_Turbine.MechPower, Alternateur.Wmec3)
+    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
+  connect(heatSource.C[1], HP_Drum.Cex) annotation (Line(points={{18,68.3},{18,
+          50}}, color={191,95,0}));
+  connect(heatSource1.C[1], IP_Drum.Cex) annotation (Line(points={{339,68.3},{
+          339,50}}, color={191,95,0}));
+  connect(heatSource2.C[1], LP_Drum.Cex) annotation (Line(points={{598,64.3},{
+          598,50}}, color={191,95,0}));
+  connect(Gain_2GasTurbine.y, Alternateur.Wmec5)
+    annotation (Line(points={{3,-438},{402,-438}}));
+  connect(SensorQ_WaterHP.C1, HP_Economizer_4.Cws2)
+    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
+  connect(IP_Pump.rpm_or_mpower, StopPumpingMp.y)
+    annotation (Line(
+      points={{814,5},{814,0},{904.1,0}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+  connect(HP_Pump.rpm_or_mpower, StopPumpingHP.y)
+    annotation (Line(
+      points={{814,-47},{814,-66},{905.1,-66}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+  connect(LP_Pump.rpm_or_mpower, StopPumpingBP.y) annotation (Line(
+      points={{752,-447},{754,-447},{754,-456},{878,-456},{878,-442},{905.1,-442}},
+      color={0,0,0},
+      pattern=LinePattern.Dot,
+      smooth=Smooth.None));
+
+  connect(SourceFumees.C,GasTurbine. Entree_air)
+                                                annotation (Line(
+      points={{-495,-51},{-471,-51}},
+      color={0,0,0},
+      thickness=1));
+  connect(sourceCombustible.C,GasTurbine. Entree_combustible) annotation (Line(
+        points={{-385,42},{-367,42},{-367,13}}, color={0,0,0}));
+  connect(sourceEau.C,GasTurbine. Entree_eau_combustion)
+    annotation (Line(points={{-445,42},{-445,13}}, color={0,0,255}));
+  connect(GasTurbine.Sortie_fumees, HP_SuperHeater_3.Cfg1) annotation (Line(
+      points={{-341,-51},{-290,-50},{-304,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(GasTurbine.PuissanceMeca, Gain_2GasTurbine.u)
+    annotation (Line(points={{-338.4,-76.6},{-326,-76.6},{-326,-438},{-19,-438}},
+        color={0,0,255}));
+  connect(sourceCombustible.IMassFlow,rampeQfuel. y)
+    annotation (Line(
+      points={{-403,51},{-403,90},{-517,90}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(Humidite.y, GasTurbine.Huminide)
+    annotation (Line(
+      points={{-515.95,30},{-492,30},{-492,-12.6},{-473.6,-12.6}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(rampeIQair.y,SourceFumees. IMassFlow)
+    annotation (Line(
+      points={{-518,-10},{-518,-36},{-517,-36},{-517,-39.5}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(rampeTair.y, SourceFumees.ITemperature)
+    annotation (Line(
+      points={{-518,-90},{-516,-90},{-516,-88},{-517,-88},{-517,-62.5}},
+      color={0,0,0},
+      pattern=LinePattern.Dot));
+  connect(HP_Turbine.Cs,SeparateurMP. Ce1)   annotation (Line(points={{38.2,-230},
+          {74,-230},{74,-210}}, color={255,0,0}));
+  connect(SeparateurMP.Cs1, HP_PressureLoss_1.C1)
+    annotation (Line(points={{74,-190},{74,-170},{88,-170}}, color={255,0,0}));
+  connect(HP_PressureLoss_1.C2, MoitieDebitHP.Ce)
+    annotation (Line(points={{102,-170},{114,-170}}, color={0,0,255}));
+  connect(SeparateurMP.Cs2, HP_IP_PressureLoss.C1)
+    annotation (Line(points={{84,-200},{134,-200}}, color={255,0,0}));
+  connect(HP_IP_PressureLoss.C2, VolumeIP1.Ce3) annotation (Line(points={{154,-200},
+          {418,-200},{418,-220}}, color={255,0,0}));
+  connect(Q_water.y, SourceCaloporteur.IMassFlow)
+    annotation (Line(points={{576,-354},{582,-354},{582,-341},{596,-341}}));
+  connect(rampePout.y, SinkP_Gas.IPressure)
+    annotation (Line(points={{732,-74},{752,-74},{752,-50},{727,-50}}));
+  annotation (Diagram(graphics,
+                      coordinateSystem(preserveAspectRatio=false,extent={{-550,
+            -460},{950,150}},
+        initialScale=0.1)), Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"),
+    experiment(StopTime=2500),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end LoadVariation;
diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.mo
index daec17cc4f0b03bed451eb5f20f9b12ee05a962b..c3a35d02152e4a12b4f676ce2f62972b60020458 100644
--- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.mo
@@ -1,131 +1,131 @@
-within ThermoSysPro.Fluid.Examples.Book.PowerPlants;
-package CombinedCyclePowerPlant "Models of a combined cycle power plant"
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains two models for a real combined cycle power plant:</p>
-<ul>
-<li>LoadVariation to simulate a load variation from 100&percnt; to 50&percnt;</li>
-<li>GasTurbineTrip to simulate a full gas turbine trip</li>
-</ul>
-<p><br>The two models are documented in Sect. 6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end CombinedCyclePowerPlant;
+within ThermoSysPro.Fluid.Examples.Book.PowerPlants;
+package CombinedCyclePowerPlant "Models of a combined cycle power plant"
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains two models for a real combined cycle power plant:</p>
+<ul>
+<li>LoadVariation to simulate a load variation from 100&percnt; to 50&percnt;</li>
+<li>GasTurbineTrip to simulate a full gas turbine trip</li>
+</ul>
+<p><br>The two models are documented in Sect. 6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end CombinedCyclePowerPlant;
diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.order b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.order
index 58c337c9a58da48e6197e99a4be3ac0034ef2a8f..9ed870f71163cde96309f1ec54001b36a161a43b 100644
--- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/CombinedCyclePowerPlant/package.order
@@ -1,2 +1,2 @@
-LoadVariation
-GasTurbineTrip
+LoadVariation
+GasTurbineTrip
diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo
index d978291d04d86bea1ef8b642a2eeaa38a8d7ab16..c6030e6e4444be5ca91f5ad61932e71c4f36d7ce 100644
--- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo
@@ -1,894 +1,894 @@
-within ThermoSysPro.Fluid.Examples.Book.PowerPlants;
-model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plant with PTSC"
-
-parameter Real L1 = 500 "Longueur de la première chaine de capteurs";
-parameter Integer Ns1 = 20 "Nombre de mailles de la première chaine de capteurs";
-
-parameter Real L2 = 80 "Longueur de la deuxième chaine de capteurs";
-parameter Integer Ns2 = 5 "Nombre de mailles de la deuxième échangeur";
-
-parameter Real L3 = 450 "Longueur de la première chaine de capteurs";
-parameter Integer Ns3 = 80 "Nombre de mailles de la première échangeur";
-
-//parameter Real L4 = 7.9254 "Longueur de la première chaine de capteurs";
-parameter Real L4 = 20 "Longueur de la première chaine de capteurs";
-parameter Integer Ns4 = 3 "Nombre de mailles de la première échangeur";
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_2(
-    option_temperature=false,
-    L=L2,
-    Ns=Ns2,
-    T0={659.137,684.387,693.983,697.543,698.861},
-    h0=fill(650e3, Ns2),
-    D=0.04,
-    hcCorr=2,
-    ntubes=3,
-    inertia=false,
-    advection=false,
-    P(start={100000.0,8120050.0,8098500.0,8074750.0,8050150.0,8025170.0,8000000.0}),
-    h(start={2756570.0,3040300.0,3147840.0,3187560.0,3202330.0,3208020.0,3208020.0}),
-    mu2(start={1.94524E-005,0.0002,0.0002,0.0002,0.0002,0.0002}),
-    rho2(start={43.2944,998.0,998.0,998.0,998.0,998.0}))
-                     annotation (                        Placement(
-        transformation(extent={{-31,34},{25,78}}, rotation=0)));
-
-  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi2(
-    cpw=1000,
-    steady_state=true,
-    lambda=26,
-    L=L2,
-    Ns=Ns2,
-    D=0.04,
-    ntubes=3,
-    e=0.003,
-    Tp2(start={699.6,697.841,694.783,686.553,664.851}),
-    Tp(start={662.094,685.508,694.397,697.697,698.921}))
-                     annotation (                         Placement(
-        transformation(extent={{-34,54},{26,102}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_3(K=1e-6,
-      p_rho=900,
-    C1(h_vol_2(start=462620.0)),
-    C2(h_vol_1(start=462620.0)))
-    annotation (
-    Placement(transformation(
-        origin={-134,138.5},
-        extent={{6,-9.5},{-6,9.5}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Tatm(             Table=
-        [0,300; 1,300])
-    annotation (                             Placement(transformation(extent={{-322,
-            186},{-306,202}},      rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Incidence(
-      Table=[0,0; 1,0])
-    annotation (                             Placement(transformation(extent={{-322,
-            146},{-306,162}},      rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall Paroi3(
-    cpw=1000,
-    steady_state=true,
-    lambda=26,
-    L=L3,
-    Ns=Ns3,
-    D=0.06,
-    e=0.006,
-    Tp1(start={540.2,541.953,544.376,546.789,549.192,551.586,553.969,556.344,
-          558.708,561.063,563.408,565.743,568.068,570.384,572.69,574.986,
-          577.273,579.55,581.817,584.074,586.322,588.559,590.787,593.006,
-          595.214,597.413,599.602,601.782,603.952,606.112,608.262,610.403,
-          612.534,614.656,616.768,618.871,620.965,623.048,625.123,627.188,
-          629.244,631.291,633.329,635.357,637.377,639.387,641.389,643.382,
-          645.366,647.342,649.309,651.268,653.218,655.16,657.095,659.021,660.94,
-          662.851,664.755,666.651,668.54,670.423,672.298,674.167,676.029,
-          677.885,679.735,681.578,683.416,685.248,687.074,688.894,690.709,
-          692.518,694.322,696.121,697.914,699.701,701.483,703.26}),
-    Tp2(start={543.606,546.033,548.45,550.857,553.254,555.642,558.02,560.389,
-          562.747,565.096,567.435,569.765,572.084,574.394,576.694,578.984,
-          581.265,583.536,585.797,588.048,590.289,592.521,594.742,596.954,
-          599.157,601.349,603.532,605.705,607.869,610.022,612.166,614.301,
-          616.426,618.541,620.647,622.743,624.83,626.907,628.975,631.033,
-          633.082,635.122,637.153,639.175,641.188,643.191,645.186,647.172,
-          649.15,651.118,653.079,655.03,656.974,658.909,660.837,662.756,664.668,
-          666.572,668.468,670.357,672.239,674.114,675.982,677.844,679.699,
-          681.547,683.39,685.226,687.056,688.88,690.699,692.512,694.319,696.121,
-          697.917,699.708,701.493,703.273,705.048,706.816}),
-    Tp(start={541.71,544.139,546.559,548.969,551.369,553.759,556.14,558.511,
-          560.872,563.224,565.566,567.898,570.22,572.533,574.836,577.129,
-          579.412,581.685,583.949,586.203,588.447,590.682,592.907,595.122,
-          597.327,599.522,601.708,603.884,606.05,608.207,610.354,612.492,614.62,
-          616.738,618.847,620.946,623.036,625.116,627.187,629.249,631.301,
-          633.344,635.378,637.403,639.419,641.426,643.424,645.413,647.393,
-          649.365,651.329,653.284,655.231,657.169,659.1,661.022,662.937,664.845,
-          666.745,668.637,670.522,672.401,674.272,676.137,677.995,679.847,
-          681.693,683.533,685.366,687.194,689.016,690.833,692.643,694.449,
-          696.249,698.043,699.832,701.615,703.393,705.165}))
-                     annotation (                            Placement(
-        transformation(extent={{-105,134},{-45,182}}, rotation=0)));
-  ThermoSysPro.Solar.Collectors.SolarCollector SolarCollector1(
-    EpsGlass=0.86,
-    Gamma=0.83,
-    h=3.06,
-    AlphaGlass=0.0302,
-    RimAngle=70,
-    TauN=0.95,
-    AlphaN=0.96,
-    EpsTube=0.14,
-    R=0.93,
-    Lambda=2.891407518e-2,
-    f=1.78518,
-    AReflector(fixed=false, start=2750),
-    DGlass=0.115,
-    L=L3,
-    Ns=Ns3,
-    DTube=0.07,
-    e=1.e-3,
-    Tglass(start={364.716,365.398,366.082,366.767,367.453,368.14,368.829,
-          369.519,370.209,370.901,371.594,372.288,372.982,373.678,374.374,
-          375.071,375.768,376.466,377.165,377.864,378.564,379.264,379.964,
-          380.665,381.366,382.067,382.769,383.47,384.172,384.873,385.575,
-          386.276,386.978,387.679,388.38,389.081,389.782,390.482,391.182,
-          391.882,392.581,393.28,393.979,394.677,395.375,396.072,396.769,
-          397.465,398.161,398.856,399.551,400.245,400.939,401.632,402.324,
-          403.017,403.708,404.399,405.09,405.78,406.47,407.16,407.849,408.538,
-          409.226,409.915,410.603,411.29,411.978,412.665,413.352,414.039,
-          414.726,415.413,416.099,416.786,417.472,418.158,418.843,419.528}))
-    annotation (Placement(transformation(extent={{-108,166},{-43,200}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
-                                    TubeEcran_3(
-    P(each start=2.3e6),
-    option_temperature=false,
-    L=L3,
-    Ns=Ns3,
-    T0={539.521,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
-        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0},
-    h0=fill(800e3, Ns3),
-    advection=false,
-    dpfCorr=0.4,
-    hcCorr=2,
-    D=0.06,
-    h(start={463696.125,468056.0,473485.0,478907.0,484321.0,489728.0,495127.0,500518.0,
-          505902.0,511278.0,516646.0,522007.0,527360.0,532705.0,538041.0,543370.0,
-          548691.0,554004.0,559309.0,564606.0,569895.0,575175.0,580447.0,585711.0,
-          590967.0,596214.0,601453.0,606683.0,611905.0,617118.0,622323.0,627519.0,
-          632707.0,637886.0,643056.0,648217.0,653370.0,658514.0,663649.0,668775.0,
-          673893.0,679001.0,684100.0,689191.0,694272.0,699345.0,704408.0,709462.0,
-          714507.0,719542.0,724569.0,729586.0,734594.0,739593.0,744582.0,749562.0,
-          754532.0,759493.0,764445.0,769387.0,774320.0,779242.0,784156.0,789059.0,
-          793953.0,798837.0,803712.0,808577.0,813431.0,818276.0,823111.0,827936.0,
-          832752.0,837557.0,842352.0,847137.0,851911.0,856676.0,861430.0,866175.0,
-          870908.0,870908.0}))
-                     annotation (                            Placement(
-        transformation(extent={{-103,117},{-47,161}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_4(K=1e-6,
-      p_rho=650,
-    C2(h_vol_1(start=870908.0)))
-    annotation (
-    Placement(transformation(
-        origin={-5,139},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
-                                    TubeEcran_22(
-    P(each start=2.3e6),
-    option_temperature=false,
-    Ns=Ns2,
-    T0={698.976,700.0,700.0,700.0,700.0},
-    h0=fill(800e3, Ns2),
-    L=L2,
-    D=0.04,
-    advection=false,
-    hcCorr=2,
-    dpfCorr=0.4,
-    ntubes=3,
-    h(start={871999.6875,870017.0,867699.0,861464.0,844586.0,800057.0,800057.0}))
-                     annotation (                         Placement(
-        transformation(extent={{24,122},{-33,78}}, rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi1(
-    cpw=1000,
-    steady_state=true,
-    lambda=26,
-    L=L1,
-    Ns=Ns1,
-    D=0.04,
-    ntubes=3,
-    e=0.003,
-    Tp1(start={532.912,533.493,534.161,534.93,535.816,536.836,538.01,539.364,
-          540.926,542.728,544.809,547.216,550.002,553.232,556.986,561.36,
-          566.473,572.131,573.043,574.577}),
-    Tp2(start={589.9,577.664,573.793,567.743,562.426,557.888,553.999,550.657,
-          547.777,545.292,543.143,541.284,539.674,538.278,537.068,536.017,
-          535.105,534.312,533.624,533.026}),
-    Tp(start={532.971,533.561,534.239,535.021,535.92,536.956,538.149,539.525,
-          541.111,542.943,545.059,547.506,550.341,553.629,557.453,561.912,
-          567.13,572.991,575.434,581.427}))
-                     annotation (                            Placement(
-        transformation(extent={{-174,54},{-114,102}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_1(
-    option_temperature=false,
-    L=L1,
-    Ns=Ns1,
-    T0=fill(300, Ns1),
-    h0=fill(650e3, Ns1),
-    D=0.04,
-    ntubes=3,
-    inertia=false,
-    advection=false,
-    P(start={8716030.0,8695070.0,8674080.0,8653070.0,8632030.0,8610950.0,8589840.0,
-          8568690.0,8547480.0,8526210.0,8504870.0,8483450.0,8461930.0,8440290.0,
-          8418510.0,8396570.0,8374420.0,8352020.0,8329300.0,8305110.0,8256160.0,
-          8135653.0}),
-    h(start={1130270.0,1132680.0,1135470.0,1138670.0,1142370.0,1146630.0,1151550.0,
-          1157240.0,1163810.0,1171420.0,1180240.0,1190480.0,1202400.0,1216300.0,
-          1232580.0,1251720.0,1274350.0,1301310.0,1336580.0,1434650.0,1715580.0,
-          2756578.25}))
-                     annotation (                           Placement(
-        transformation(extent={{-171,34},{-115,78}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
-                                    TubeEcran_11(
-    P(each start=2.2e6),
-    option_temperature=false,
-    L=L1,
-    Ns=Ns1,
-    T0={587.815,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,
-        550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0},
-    h0=fill(650e3, Ns1),
-    D=0.04,
-    advection=false,
-    hcCorr=2,
-    dpfCorr=0.4,
-    ntubes=3,
-    h(start={801122.25,638880.0,582613.0,562383.0,546913.0,533929.0,522949.0,513609.0,
-          505631.0,498794.0,492917.0,487857.0,483492.0,479721.0,476460.0,473637.0,
-          471191.0,469070.0,467231.0,465634.0,464248.0,464248.0}))
-                     annotation (                            Placement(
-        transformation(extent={{-116,122},{-173,78}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.SteamDryer Secheur(proe(x(start=0.273553)))
-    annotation (Placement(transformation(extent={{-86,39},{-62,63}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(
-    A=5,
-    Kvl=100,
-    e=0.0005,
-    L=3.5,
-    Vf0=0.15,
-    ntubes=300,
-    steady_state=false,
-    V=30,
-    P0=5000,
-    Cv(Q(start=1.13)),
-    Pfond(start=5000.53),
-    proe(d(start=995.533)))
-                     annotation (                           Placement(
-        transformation(extent={{116,-51},{156,-11}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(
-    P0=1e5,
-    option_temperature=false) annotation (                           Placement(
-        transformation(extent={{178,-48},{206,-22}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(             K=1e-6,
-    C2(h_vol_1(start=137765.0)),
-    Pm(start=5000.53),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (
-    Placement(transformation(
-        origin={117,-82.5},
-        extent={{-6,-9.5},{6,9.5}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss
-    Connection_HQ_Secheur_Ballon(Q(start=1))
-    annotation (
-    Placement(transformation(
-        origin={-73,-15},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe(
-    Pm(fixed=false, start=3502560.0),
-    a1(fixed=false) = -4.9345734425e8,
-    hn(start=716.167),
-    a3=2000,
-    b1=-3500,
-    b2=510,
-    Q(fixed=true, start=1.13),
-    C2(h_vol_1(start=150161.0)),
-    Qv(start=0.00113454),
-    h(start=143963.0),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                 annotation (                         Placement(
-        transformation(extent={{84,-91},{64,-71}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC Ballon(
-    V=1,
-    h0=3e5,
-    h(start=1125640.0),
-    P0=7000000,
-    dynamic_mass_balance=true,
-    P(start=7000000),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (                           Placement(transformation(extent={{-63,-91},
-            {-83,-71}},          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(             Cvmax(
-        fixed=true) = 300, C2(P(fixed=false, start=70e5)),
-    Pm(start=7000060.0),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (
-    Placement(transformation(
-        origin={-30,-75},
-        extent={{-10,10},{10,-10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(             Cvmax=
-       10,
-    C1(P(start=10618800.0), h_vol_2(start=1127430.0)),
-    C2(h_vol_1(start=1127430.0)),
-    Pm(start=9676220.0),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (
-    Placement(transformation(
-        origin={-212,-75},
-        extent={{-10,10},{10,-10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePCaloporteur(
-    option_temperature=false,
-    h0=63.03e3,
-    P0(fixed=false) = 500000,
-    Q(fixed=true, start=14.9263))
-                                annotation (                         Placement(
-        transformation(extent={{66,-49},{94,-22}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(K=1e-6)
-    annotation (
-    Placement(transformation(
-        origin={171,-35},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2(K=1e-6,
-   rho(start=999.099))
-    annotation (
-    Placement(transformation(
-        origin={101,-36},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Ouv(             k=0.5)
-    annotation (                           Placement(transformation(extent={{-48,-62},
-            {-38,-52}},          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Ouv1(             k=0.5)
-    annotation (                             Placement(transformation(extent={{-231,
-            -62},{-221,-52}},      rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe1(
-    Pm(fixed=false),
-    hn(start=466.292),
-    a3=2000,
-    b2=510,
-    b1=-3500,
-    a1(fixed=false) = -9.5e8,
-    Q(fixed=false, start=0.65),
-    C2(P(fixed=false, start=75e5)),
-    C1(P(fixed=true, start=70e5), h_vol_2(start=1125640.0)),
-    Qv(start=0.00521975),
-    h(start=1126540.0),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                 annotation (
-      Placement(transformation(extent={{-158,-91},{-178,-71}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(            K=1e-6, region=
-        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (
-    Placement(transformation(
-        origin={-120,-81},
-        extent={{-6,-10},{6,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Machines.StodolaTurbine Turbine(
-    W_fric=1,
-    Cst(fixed=false,
-      start=6.8e10)=6.19323e6,
-    Qmax=0.001,
-    eta_is_min=0.80,
-    rhos(start=10),
-    eta_is_nom=0.92,
-    Pe(fixed=true, start=8000000),
-    Ps(fixed=false, start=1800000),
-    pros(d(start=8.36949)))
-                      annotation (                       Placement(
-        transformation(extent={{47,72},{73,40}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur
-    annotation (                          Placement(transformation(extent={{168,90},
-            {198,130}},     rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi4(
-    cpw=1000,
-    steady_state=true,
-    lambda=26,
-    D=0.04,
-    L=L4,
-    Ns=Ns4,
-    ntubes=3,
-    e=0.003,
-    Tp1(start={532.06,532.262,532.478}),
-    Tp2(start={533.3,532.429,532.217}),
-    Tp(start={532.141,532.349,532.57}))
-                     annotation (
-    Placement(transformation(
-        origin={-269,-12},
-        extent={{-24,-30},{24,30}},
-        rotation=90)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(
-    option_temperature=false,
-    D=0.04,
-    L=L4,
-    Ns=Ns4,
-    T0=fill(300, Ns4),
-    h0=fill(650e3, Ns4),
-    ntubes=3,
-    inertia=false,
-    advection=false,
-    P(start={8751668.0,8729230.0,8724830.0,8720430.0,8733863.0}),
-    h(start={1128519.5,1128310.0,1129260.0,1130270.0,1131729.0}),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                     annotation (
-    Placement(transformation(
-        origin={-245.5,-11.5},
-        extent={{-23.5,-23.5},{23.5,23.5}},
-        rotation=90)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
-                                    TubeEcran_44(
-    P(each start=1.6e6),
-    option_temperature=false,
-    L=L4,
-    Ns=Ns4,
-    T0={532.656,550.0,550.0},
-    h0=fill(650e3, Ns4),
-    advection=false,
-    D(fixed=true) = 0.04,
-    C2(P(fixed=false, start=16.99e5), Q(fixed=false, start=2)),
-    hcCorr=2,
-    dpfCorr=0.4,
-    ntubes=3,
-    h(start={465547.78125,463670.0,463128.0,462620.0,462620.0}))
-                     annotation (
-    Placement(transformation(
-        origin={-293,-12},
-        extent={{23,24},{-23,-24}},
-        rotation=90)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe2(
-    Pm(fixed=false),
-    b2=510,
-    b1=-3500,
-    hn(start=350),
-    adiabatic_compression=true,
-    C1(P(fixed=false, start=17e5), h_vol_2(start=462620.0)),
-    a3(fixed=true) = 500,
-    C2(P(fixed=false, start=24.5146e5)),
-    p_rho=900,
-    Q(fixed=true, start=7.2),
-    a1(fixed=false) = -1e8)      annotation (
-      Placement(transformation(extent={{-184,129},{-164,149}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_2(K=1e-6,
-      p_rho=900)
-    annotation (
-    Placement(transformation(
-        origin={-212,138.5},
-        extent={{6,-9.5},{-6,9.5}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_1(K=1e-6,
-      p_rho=900)
-    annotation (
-    Placement(transformation(
-        origin={-286,138.5},
-        extent={{6,-9.5},{-6,9.5}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMp(
-    W_fric=1,
-    Cst(fixed=false,
-      start=8.3e9)=6.19323e6,
-    Qmax=0.001,
-    eta_is_min=0.80,
-    rhos(start=10),
-    eta_is_nom=0.94,
-    Pe(fixed=true, start=1800000),
-    Ps(fixed=false, start=5000),
-    pros(d(start=0.0434309)),
-    xm(start=0.908482))
-                      annotation (                         Placement(
-        transformation(extent={{105,72},{131,40}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.Tank Tank(
-    p_rho=895,
-    A=0.1,
-    z0=1,
-    h0=423600,
-    steady_state=true,
-    h(start=462620.0),
-    rho(start=895),
-    Patm=1670000,
-    P(start=1699000),
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.Oil_TherminolVP1)
-    annotation (
-    Placement(transformation(
-        origin={-248,142},
-        extent={{6,6},{-6,-6}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeA VolumeMP(
-    V=1,
-    rho(start=10),
-    h0=2.4e6,
-    h(start=2868560.0),
-    P0=1800000,
-    dynamic_mass_balance=true,
-    P(start=1800000),
-    Cs2(Q(start=0.255955),h_vol_2(start=2.87e6)))
-    annotation (                       Placement(transformation(extent={{84,50},
-            {94,62}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeA VolumeCond(
-    V=1,
-    rho(start=10),
-    h(start=1837610.0),
-    h0=2.1e6,
-    P0=5000,
-    dynamic_mass_balance=false,
-    P(start=5000))
-    annotation (                         Placement(transformation(extent={{141,24},
-            {130,34}},     rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater Re_1(
-    KPurge=10,
-    SPurge=0.3,
-    Se(h(fixed=true, start=600e3)),
-    SCondDes(fixed=false,
-      start=9.57697) =      3,
-    HDesF(start=583561.0),
-    HeiF(start=150619.0),
-    Hep(start=884611.0),
-    SDes(start=0.932441),
-    h(start=882589.0),
-    lambdaE=1,
-    KCond=500,
-    region_eeF=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    region_seF=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                annotation (                         Placement(transformation(
-          extent={{42,-106},{0,-56}}, rotation=0)));
-
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Re_1(
-    rho(start=10),
-    h(start=2400e3),
-    Q(start=0.1),
-    K=1e-4,
-    Pm(start=1800000))
-    annotation (
-    Placement(transformation(
-        origin={31.5,-13.5},
-        extent={{5.5,-5.5},{-5.5,5.5}},
-        rotation=90)));
-  ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss
-    annotation (                            Placement(transformation(extent={{108,
-            -106},{122,-90}},     rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Cond_2(
-    K=1e-4,
-    rho(start=10),
-    Q(start=0.35),
-    Pm(start=5000.53),
-    h(start=2100e3))
-    annotation (
-    Placement(transformation(
-        origin={135.5,8.5},
-        extent={{5.5,-5.5},{-5.5,5.5}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Rayonnement(Table=[0,700;
-        200,2; 1200,2; 1800,2; 2400,0.1; 3000,0.1; 3600,0.1; 4200,327; 4800,287;
-        5400,176; 6000,410; 6600,299; 7200,26; 7800,168; 8400,485; 9000,482;
-        9600,664; 10200,344; 10800,684; 11400,564; 12000,460; 12600,560; 13200,
-        611; 13800,557; 14400,682; 15000,785; 15600,321; 16200,850; 16800,330;
-        17400,619; 18000,480; 18600,192; 19200,750; 19800,650; 20400,450; 21000,
-        350; 21600,763; 22200,455; 22800,290; 23400,494; 24000,800; 24600,565;
-        25200,320; 25800,110; 26400,479; 27000,263; 27600,747; 28200,805; 28800,
-        576; 29400,550; 30000,470; 30600,395; 31200,315; 31800,657; 32400,670;
-        33000,381; 33600,209; 34200,457; 34800,320; 35400,13; 36000,0.1; 36600,
-        0.1; 37200,0.1; 37800,0.1; 38400,0.1; 39000,0.1; 39600,0.1; 40200,0.1;
-        40800,0; 41400,0; 42000,0; 42600,0; 43200,0; 43800,0])
-    annotation (Placement(transformation(extent={{-322,166},{-306,182}},
-          rotation=0)));
-equation
-
-public
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=3, P(start=
-          2300000))
-    annotation (Placement(transformation(extent={{21,128},{37,150}})));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=1/3, P(start=
-          2400000))                              annotation (Placement(
-        transformation(
-        extent={{-7.75,-9.75},{7.75,9.75}},
-        rotation=0,
-        origin={-158.25,139.75})));
-equation
-  connect(TubeEcran_2.CTh, Paroi2.WT1) annotation (
-    Line(points={{-3,62.6},{-4,64},{-4,73.2}}, color={191,95,0}));
-  connect(SolarCollector1.ITemperature,Paroi3. WT2)
-                                                   annotation (
-    Line(points={{-74.3026,166.992},{-75,166.992},{-75,162.8}}, color={191,95,0}));
-  connect(Incidence.y,SolarCollector1. IncidenceAngle)
-    annotation (
-              Line(points={{-305.2,154},{-262,154},{-262,182},{-106.289,182},{
-          -106.289,183}}));
-  connect(TubeEcran_3.CTh,Paroi3. WT1) annotation (
-    Line(points={{-75,145.6},{-75,153.2}}, color={191,95,0}));
-  connect(Tatm.y,SolarCollector1. AtmTemp) annotation (
-    Line(points={{-305.2,194},{-282,194},{-282,197.167},{-106.289,197.167}}));
-  connect(PerteCharge_Huile_3.C2, TubeEcran_3.C1)   annotation (
-    Line(
-      points={{-128,138.5},{-102,138.5},{-102,140},{-103,139}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(TubeEcran_3.C2, PerteCharge_Huile_4.C1)
-    annotation (
-    Line(
-      points={{-47,139},{-11,139}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(Paroi2.WT2, TubeEcran_22.CTh) annotation (
-    Line(points={{-4,82.8},{-4,93.4},{-4.5,93.4}}, color={191,95,0}));
-  connect(TubeEcran_1.CTh,Paroi1. WT1) annotation (
-    Line(points={{-143,62.6},{-144,64},{-144,73.2}}, color={191,95,0}));
-  connect(Paroi1.WT2,TubeEcran_11. CTh) annotation (
-    Line(points={{-144,82.8},{-144,93.4},{-144.5,93.4}}, color={191,95,0}));
-  connect(TubeEcran_11.C1, TubeEcran_22.C2)
-    annotation (
-    Line(
-      points={{-116,100},{-33,100}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(TubeEcran_1.C2, Secheur.Cev) annotation (
-    Line(
-      points={{-115,56},{-85.88,56},{-85.88,55.8}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Secheur.Csv, TubeEcran_2.C1) annotation (
-    Line(
-      points={{-62.12,55.8},{-60,55.8},{-60,56},{-31,56}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pompe.C1,PerteChargeCondPompe. C2)
-    annotation (
-    Line(
-      points={{84,-81},{84,-82},{111,-82},{111,-82.5}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Ballon.Ce1,ControlValveBallon. C2)
-    annotation (
-    Line(
-      points={{-63,-81},{-40,-81}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Secheur.Csl,Connection_HQ_Secheur_Ballon. C1) annotation (
-    Line(
-      points={{-73.88,39},{-73.88,-5},{-73,-5}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Connection_HQ_Secheur_Ballon.C2,Ballon. Ce2) annotation (
-    Line(
-      points={{-73,-25},{-73,-71}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(sourcePCaloporteur.C,PerteChargeCondPompe2. C1) annotation (
-    Line(points={{94,-35.5},{94,-36},{95,-36}}, color={0,0,255}));
-  connect(PerteChargeCondPompe1.C2,puitsPCaloporteur. C) annotation (
-    Line(points={{177,-35},{178,-36},{178,-35}}, color={0,0,255}));
-  connect(Pompe1.C2,ControlValveBallon1. C1) annotation (
-    Line(
-      points={{-178,-81},{-202,-81}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(PerteChargeCondPompe3.C1,Ballon. Cs)
-    annotation (
-    Line(
-      points={{-114,-81},{-83,-81}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Ouv1.y,ControlValveBallon1. Ouv)
-    annotation (                                         Line(points={{-220.5,
-          -57},{-212,-57},{-212,-64}}));
-  connect(Ouv.y,ControlValveBallon. Ouv)
-    annotation (                                      Line(points={{-37.5,-57},
-          {-30,-57},{-30,-64}}));
-  connect(PerteChargeCondPompe2.C2,Condenseur. Cee) annotation (
-    Line(points={{107,-36},{109.25,-36},{109.25,-35.4},{116,-35.4}}, color={0,0,255}));
-  connect(Condenseur.Cse,PerteChargeCondPompe1. C1) annotation (
-    Line(points={{156,-35},{160,-34},{160,-35},{165,-35}}, color={0,0,255}));
-  connect(Condenseur.Cl,PerteChargeCondPompe. C1) annotation (
-    Line(
-      points={{136.4,-51},{136.4,-82.5},{123,-82.5}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(PerteChargeCondPompe3.C2, Pompe1.C1) annotation (
-    Line(
-      points={{-126,-81},{-158,-81}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Turbine.MechPower,Alternateur. Wmec5)
-    annotation (                                            Line(points={{74.3,
-          70.4},{76,70.4},{76,94},{168,94}}));
-  connect(TubeEcran_2.C2, Turbine.Ce) annotation (
-    Line(
-      points={{25,56},{46.87,56}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(TubeEcran_4.CTh,Paroi4. WT1) annotation (
-    Line(points={{-252.55,-11.5},{-257,-11.5},{-257,-12},{-263,-12}}, color={191,95,0}));
-  connect(Paroi4.WT2, TubeEcran_44.CTh) annotation (
-    Line(points={{-275,-12},{-285.8,-12},{-285.8,-12}},
-                                                      color={191,95,0}));
-  connect(ControlValveBallon1.C2, TubeEcran_4.C1) annotation (
-    Line(
-      points={{-222,-81},{-245.5,-81},{-245.5,-35}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(TubeEcran_4.C2, TubeEcran_1.C1) annotation (
-    Line(
-      points={{-245.5,12},{-245.5,56},{-171,56}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(TubeEcran_11.C2, TubeEcran_44.C1) annotation (
-    Line(
-      points={{-173,100},{-293,100},{-293,11}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(PerteCharge_Huile_2.C2, Pompe2.C1)   annotation (
-    Line(
-      points={{-206,138.5},{-184,138.5},{-184,139}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(Tank.Cs2, PerteCharge_Huile_2.C1)                    annotation (
-    Line(
-      points={{-242,138.4},{-230,138.4},{-230,138.5},{-218,138.5}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(PerteCharge_Huile_1.C2, Tank.Ce2) annotation (
-    Line(
-      points={{-280,138.5},{-268,138.5},{-268,138.4},{-254,138.4}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(Turbine.Cs, VolumeMP.Ce1) annotation (
-    Line(
-      points={{73.13,56},{84,56}},
-      color={255,0,0},
-      thickness=0.5));
-
-  connect(VolumeMP.Cs1, TurbineMp.Ce) annotation (
-    Line(
-      points={{94,56},{104.87,56}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(TurbineMp.MechPower, Alternateur.Wmec4)
-    annotation (                                                 Line(points={{132.3,
-          70.4},{142,70.4},{142,102},{168,102}}));
-  connect(TurbineMp.Cs, VolumeCond.Ce2) annotation (
-    Line(
-      points={{131.13,56},{135.5,56},{135.5,34}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Re_1.Ee, Pompe.C2)
-    annotation (
-    Line(points={{42,-81},{64,-81}},    thickness=0.5));
-  connect(VolumeMP.Cs2, Dp_Re_1.C1) annotation (
-    Line(
-      points={{89,50},{90,50},{90,22},{31.5,22},{31.5,-8}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Dp_Re_1.C2, Re_1.Ev) annotation (
-    Line(
-      points={{31.5,-19},{31.5,-36},{8.4,-36},{8.4,-72.5}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(ControlValveBallon.C1, Re_1.Se)
-    annotation (
-    Line(points={{-20,-81},{0,-81}}, thickness=0.5));
-  connect(Re_1.Sp, invSingularPressureLoss.C1) annotation (
-    Line(
-      points={{33.6,-89.25},{33.6,-98},{108,-98}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(invSingularPressureLoss.C2, VolumeCond.Ce1) annotation (
-    Line(
-      points={{122,-98},{202,-98},{202,29},{141,29}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Dp_Cond_2.C1, VolumeCond.Cs2) annotation (
-    Line(
-      points={{135.5,14},{135.5,24}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Condenseur.Cv, Dp_Cond_2.C2) annotation (
-    Line(
-      points={{136,-11},{136,3},{135.5,3}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(PerteCharge_Huile_4.C2, massFlowMultiplier.Ce) annotation (Line(
-      points={{1,139},{21,139}},
-      color={0,140,72},
-      thickness=0.5));
-  connect(massFlowMultiplier.Cs, TubeEcran_22.C1) annotation (Line(
-      points={{37,139},{63,139},{63,100},{24,100}},
-      color={0,140,72},
-      thickness=0.5));
-  connect(Pompe2.C2, massFlowMultiplier2.Ce) annotation (Line(
-      points={{-164,139},{-166,139},{-166,139.75}},
-      color={0,140,72},
-      thickness=0.5));
-  connect(massFlowMultiplier2.Cs, PerteCharge_Huile_3.C1) annotation (Line(
-      points={{-150.5,139.75},{-140,139.75},{-140,138.5}},
-      color={0,140,72},
-      thickness=0.5));
-  connect(PerteCharge_Huile_1.C1, TubeEcran_44.C2) annotation (Line(
-      points={{-292,138.5},{-319,138.5},{-319,-80},{-293,-80},{-293,-35}},
-      color={0,127,0},
-      thickness=0.5));
-  connect(Rayonnement.y, SolarCollector1.ISun) annotation (Line(points={{-305.2,
-          174},{-280,174},{-280,190.083},{-106.289,190.083}}, color={0,0,255}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(
-      coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-320,-100},{200,200}},
-        grid={2,2},
-        initialScale=0.1),
-      graphics={
-        Text(
-          extent={{-237,-8},{-217,-18}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Eco"),
-        Text(
-          extent={{-164,48},{-126,34}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Evaporator"),
-        Text(
-          extent={{-23,49},{21,33}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Super-heater"),
-        Text(
-          extent={{151,-53},{194,-68}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Condenser"),
-        Text(
-          extent={{-115,215},{-37,197}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Parabolic solar receiver")}),
-    experiment(StopTime=40000),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </h4>
-<p><b>ThermoSysPro Version 4.0 </h4>
-<p>This is the dynamic model of a 1 MWe concentrated solar power plant with a parabolic trough collector. </p>
-<p>It is documented in a<a href=\"https://www.sciencedirect.com/science/article/pii/S1876610214005761\"> conference paper</a> and in Sect. 6.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end ConcentratedSolarPowerPlant_PTSC;
+within ThermoSysPro.Fluid.Examples.Book.PowerPlants;
+model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plant with PTSC"
+
+parameter Real L1 = 500 "Longueur de la première chaine de capteurs";
+parameter Integer Ns1 = 20 "Nombre de mailles de la première chaine de capteurs";
+
+parameter Real L2 = 80 "Longueur de la deuxième chaine de capteurs";
+parameter Integer Ns2 = 5 "Nombre de mailles de la deuxième échangeur";
+
+parameter Real L3 = 450 "Longueur de la première chaine de capteurs";
+parameter Integer Ns3 = 80 "Nombre de mailles de la première échangeur";
+
+//parameter Real L4 = 7.9254 "Longueur de la première chaine de capteurs";
+parameter Real L4 = 20 "Longueur de la première chaine de capteurs";
+parameter Integer Ns4 = 3 "Nombre de mailles de la première échangeur";
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_2(
+    option_temperature=false,
+    L=L2,
+    Ns=Ns2,
+    T0={659.137,684.387,693.983,697.543,698.861},
+    h0=fill(650e3, Ns2),
+    D=0.04,
+    hcCorr=2,
+    ntubes=3,
+    inertia=false,
+    advection=false,
+    P(start={100000.0,8120050.0,8098500.0,8074750.0,8050150.0,8025170.0,8000000.0}),
+    h(start={2756570.0,3040300.0,3147840.0,3187560.0,3202330.0,3208020.0,3208020.0}),
+    mu2(start={1.94524E-005,0.0002,0.0002,0.0002,0.0002,0.0002}),
+    rho2(start={43.2944,998.0,998.0,998.0,998.0,998.0}))
+                     annotation (                        Placement(
+        transformation(extent={{-31,34},{25,78}}, rotation=0)));
+
+  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi2(
+    cpw=1000,
+    steady_state=true,
+    lambda=26,
+    L=L2,
+    Ns=Ns2,
+    D=0.04,
+    ntubes=3,
+    e=0.003,
+    Tp2(start={699.6,697.841,694.783,686.553,664.851}),
+    Tp(start={662.094,685.508,694.397,697.697,698.921}))
+                     annotation (                         Placement(
+        transformation(extent={{-34,54},{26,102}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_3(K=1e-6,
+      p_rho=900,
+    C1(h_vol_2(start=462620.0)),
+    C2(h_vol_1(start=462620.0)))
+    annotation (
+    Placement(transformation(
+        origin={-134,138.5},
+        extent={{6,-9.5},{-6,9.5}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Tatm(             Table=
+        [0,300; 1,300])
+    annotation (                             Placement(transformation(extent={{-322,
+            186},{-306,202}},      rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Incidence(
+      Table=[0,0; 1,0])
+    annotation (                             Placement(transformation(extent={{-322,
+            146},{-306,162}},      rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall Paroi3(
+    cpw=1000,
+    steady_state=true,
+    lambda=26,
+    L=L3,
+    Ns=Ns3,
+    D=0.06,
+    e=0.006,
+    Tp1(start={540.2,541.953,544.376,546.789,549.192,551.586,553.969,556.344,
+          558.708,561.063,563.408,565.743,568.068,570.384,572.69,574.986,
+          577.273,579.55,581.817,584.074,586.322,588.559,590.787,593.006,
+          595.214,597.413,599.602,601.782,603.952,606.112,608.262,610.403,
+          612.534,614.656,616.768,618.871,620.965,623.048,625.123,627.188,
+          629.244,631.291,633.329,635.357,637.377,639.387,641.389,643.382,
+          645.366,647.342,649.309,651.268,653.218,655.16,657.095,659.021,660.94,
+          662.851,664.755,666.651,668.54,670.423,672.298,674.167,676.029,
+          677.885,679.735,681.578,683.416,685.248,687.074,688.894,690.709,
+          692.518,694.322,696.121,697.914,699.701,701.483,703.26}),
+    Tp2(start={543.606,546.033,548.45,550.857,553.254,555.642,558.02,560.389,
+          562.747,565.096,567.435,569.765,572.084,574.394,576.694,578.984,
+          581.265,583.536,585.797,588.048,590.289,592.521,594.742,596.954,
+          599.157,601.349,603.532,605.705,607.869,610.022,612.166,614.301,
+          616.426,618.541,620.647,622.743,624.83,626.907,628.975,631.033,
+          633.082,635.122,637.153,639.175,641.188,643.191,645.186,647.172,
+          649.15,651.118,653.079,655.03,656.974,658.909,660.837,662.756,664.668,
+          666.572,668.468,670.357,672.239,674.114,675.982,677.844,679.699,
+          681.547,683.39,685.226,687.056,688.88,690.699,692.512,694.319,696.121,
+          697.917,699.708,701.493,703.273,705.048,706.816}),
+    Tp(start={541.71,544.139,546.559,548.969,551.369,553.759,556.14,558.511,
+          560.872,563.224,565.566,567.898,570.22,572.533,574.836,577.129,
+          579.412,581.685,583.949,586.203,588.447,590.682,592.907,595.122,
+          597.327,599.522,601.708,603.884,606.05,608.207,610.354,612.492,614.62,
+          616.738,618.847,620.946,623.036,625.116,627.187,629.249,631.301,
+          633.344,635.378,637.403,639.419,641.426,643.424,645.413,647.393,
+          649.365,651.329,653.284,655.231,657.169,659.1,661.022,662.937,664.845,
+          666.745,668.637,670.522,672.401,674.272,676.137,677.995,679.847,
+          681.693,683.533,685.366,687.194,689.016,690.833,692.643,694.449,
+          696.249,698.043,699.832,701.615,703.393,705.165}))
+                     annotation (                            Placement(
+        transformation(extent={{-105,134},{-45,182}}, rotation=0)));
+  ThermoSysPro.Solar.Collectors.SolarCollector SolarCollector1(
+    EpsGlass=0.86,
+    Gamma=0.83,
+    h=3.06,
+    AlphaGlass=0.0302,
+    RimAngle=70,
+    TauN=0.95,
+    AlphaN=0.96,
+    EpsTube=0.14,
+    R=0.93,
+    Lambda=2.891407518e-2,
+    f=1.78518,
+    AReflector(fixed=false, start=2750),
+    DGlass=0.115,
+    L=L3,
+    Ns=Ns3,
+    DTube=0.07,
+    e=1.e-3,
+    Tglass(start={364.716,365.398,366.082,366.767,367.453,368.14,368.829,
+          369.519,370.209,370.901,371.594,372.288,372.982,373.678,374.374,
+          375.071,375.768,376.466,377.165,377.864,378.564,379.264,379.964,
+          380.665,381.366,382.067,382.769,383.47,384.172,384.873,385.575,
+          386.276,386.978,387.679,388.38,389.081,389.782,390.482,391.182,
+          391.882,392.581,393.28,393.979,394.677,395.375,396.072,396.769,
+          397.465,398.161,398.856,399.551,400.245,400.939,401.632,402.324,
+          403.017,403.708,404.399,405.09,405.78,406.47,407.16,407.849,408.538,
+          409.226,409.915,410.603,411.29,411.978,412.665,413.352,414.039,
+          414.726,415.413,416.099,416.786,417.472,418.158,418.843,419.528}))
+    annotation (Placement(transformation(extent={{-108,166},{-43,200}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
+                                    TubeEcran_3(
+    P(each start=2.3e6),
+    option_temperature=false,
+    L=L3,
+    Ns=Ns3,
+    T0={539.521,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0,
+        700.0,700.0,700.0,700.0,700.0,700.0,700.0,700.0},
+    h0=fill(800e3, Ns3),
+    advection=false,
+    dpfCorr=0.4,
+    hcCorr=2,
+    D=0.06,
+    h(start={463696.125,468056.0,473485.0,478907.0,484321.0,489728.0,495127.0,500518.0,
+          505902.0,511278.0,516646.0,522007.0,527360.0,532705.0,538041.0,543370.0,
+          548691.0,554004.0,559309.0,564606.0,569895.0,575175.0,580447.0,585711.0,
+          590967.0,596214.0,601453.0,606683.0,611905.0,617118.0,622323.0,627519.0,
+          632707.0,637886.0,643056.0,648217.0,653370.0,658514.0,663649.0,668775.0,
+          673893.0,679001.0,684100.0,689191.0,694272.0,699345.0,704408.0,709462.0,
+          714507.0,719542.0,724569.0,729586.0,734594.0,739593.0,744582.0,749562.0,
+          754532.0,759493.0,764445.0,769387.0,774320.0,779242.0,784156.0,789059.0,
+          793953.0,798837.0,803712.0,808577.0,813431.0,818276.0,823111.0,827936.0,
+          832752.0,837557.0,842352.0,847137.0,851911.0,856676.0,861430.0,866175.0,
+          870908.0,870908.0}))
+                     annotation (                            Placement(
+        transformation(extent={{-103,117},{-47,161}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_4(K=1e-6,
+      p_rho=650,
+    C2(h_vol_1(start=870908.0)))
+    annotation (
+    Placement(transformation(
+        origin={-5,139},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
+                                    TubeEcran_22(
+    P(each start=2.3e6),
+    option_temperature=false,
+    Ns=Ns2,
+    T0={698.976,700.0,700.0,700.0,700.0},
+    h0=fill(800e3, Ns2),
+    L=L2,
+    D=0.04,
+    advection=false,
+    hcCorr=2,
+    dpfCorr=0.4,
+    ntubes=3,
+    h(start={871999.6875,870017.0,867699.0,861464.0,844586.0,800057.0,800057.0}))
+                     annotation (                         Placement(
+        transformation(extent={{24,122},{-33,78}}, rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi1(
+    cpw=1000,
+    steady_state=true,
+    lambda=26,
+    L=L1,
+    Ns=Ns1,
+    D=0.04,
+    ntubes=3,
+    e=0.003,
+    Tp1(start={532.912,533.493,534.161,534.93,535.816,536.836,538.01,539.364,
+          540.926,542.728,544.809,547.216,550.002,553.232,556.986,561.36,
+          566.473,572.131,573.043,574.577}),
+    Tp2(start={589.9,577.664,573.793,567.743,562.426,557.888,553.999,550.657,
+          547.777,545.292,543.143,541.284,539.674,538.278,537.068,536.017,
+          535.105,534.312,533.624,533.026}),
+    Tp(start={532.971,533.561,534.239,535.021,535.92,536.956,538.149,539.525,
+          541.111,542.943,545.059,547.506,550.341,553.629,557.453,561.912,
+          567.13,572.991,575.434,581.427}))
+                     annotation (                            Placement(
+        transformation(extent={{-174,54},{-114,102}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_1(
+    option_temperature=false,
+    L=L1,
+    Ns=Ns1,
+    T0=fill(300, Ns1),
+    h0=fill(650e3, Ns1),
+    D=0.04,
+    ntubes=3,
+    inertia=false,
+    advection=false,
+    P(start={8716030.0,8695070.0,8674080.0,8653070.0,8632030.0,8610950.0,8589840.0,
+          8568690.0,8547480.0,8526210.0,8504870.0,8483450.0,8461930.0,8440290.0,
+          8418510.0,8396570.0,8374420.0,8352020.0,8329300.0,8305110.0,8256160.0,
+          8135653.0}),
+    h(start={1130270.0,1132680.0,1135470.0,1138670.0,1142370.0,1146630.0,1151550.0,
+          1157240.0,1163810.0,1171420.0,1180240.0,1190480.0,1202400.0,1216300.0,
+          1232580.0,1251720.0,1274350.0,1301310.0,1336580.0,1434650.0,1715580.0,
+          2756578.25}))
+                     annotation (                           Placement(
+        transformation(extent={{-171,34},{-115,78}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
+                                    TubeEcran_11(
+    P(each start=2.2e6),
+    option_temperature=false,
+    L=L1,
+    Ns=Ns1,
+    T0={587.815,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0,
+        550.0,550.0,550.0,550.0,550.0,550.0,550.0,550.0},
+    h0=fill(650e3, Ns1),
+    D=0.04,
+    advection=false,
+    hcCorr=2,
+    dpfCorr=0.4,
+    ntubes=3,
+    h(start={801122.25,638880.0,582613.0,562383.0,546913.0,533929.0,522949.0,513609.0,
+          505631.0,498794.0,492917.0,487857.0,483492.0,479721.0,476460.0,473637.0,
+          471191.0,469070.0,467231.0,465634.0,464248.0,464248.0}))
+                     annotation (                            Placement(
+        transformation(extent={{-116,122},{-173,78}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.SteamDryer Secheur(proe(x(start=0.273553)))
+    annotation (Placement(transformation(extent={{-86,39},{-62,63}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(
+    A=5,
+    Kvl=100,
+    e=0.0005,
+    L=3.5,
+    Vf0=0.15,
+    ntubes=300,
+    steady_state=false,
+    V=30,
+    P0=5000,
+    Cv(Q(start=1.13)),
+    Pfond(start=5000.53),
+    proe(d(start=995.533)))
+                     annotation (                           Placement(
+        transformation(extent={{116,-51},{156,-11}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(
+    P0=1e5,
+    option_temperature=false) annotation (                           Placement(
+        transformation(extent={{178,-48},{206,-22}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(             K=1e-6,
+    C2(h_vol_1(start=137765.0)),
+    Pm(start=5000.53),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (
+    Placement(transformation(
+        origin={117,-82.5},
+        extent={{-6,-9.5},{6,9.5}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss
+    Connection_HQ_Secheur_Ballon(Q(start=1))
+    annotation (
+    Placement(transformation(
+        origin={-73,-15},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe(
+    Pm(fixed=false, start=3502560.0),
+    a1(fixed=false) = -4.9345734425e8,
+    hn(start=716.167),
+    a3=2000,
+    b1=-3500,
+    b2=510,
+    Q(fixed=true, start=1.13),
+    C2(h_vol_1(start=150161.0)),
+    Qv(start=0.00113454),
+    h(start=143963.0),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                 annotation (                         Placement(
+        transformation(extent={{84,-91},{64,-71}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC Ballon(
+    V=1,
+    h0=3e5,
+    h(start=1125640.0),
+    P0=7000000,
+    dynamic_mass_balance=true,
+    P(start=7000000),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (                           Placement(transformation(extent={{-63,-91},
+            {-83,-71}},          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(             Cvmax(
+        fixed=true) = 300, C2(P(fixed=false, start=70e5)),
+    Pm(start=7000060.0),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (
+    Placement(transformation(
+        origin={-30,-75},
+        extent={{-10,10},{10,-10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(             Cvmax=
+       10,
+    C1(P(start=10618800.0), h_vol_2(start=1127430.0)),
+    C2(h_vol_1(start=1127430.0)),
+    Pm(start=9676220.0),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (
+    Placement(transformation(
+        origin={-212,-75},
+        extent={{-10,10},{10,-10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePCaloporteur(
+    option_temperature=false,
+    h0=63.03e3,
+    P0(fixed=false) = 500000,
+    Q(fixed=true, start=14.9263))
+                                annotation (                         Placement(
+        transformation(extent={{66,-49},{94,-22}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(K=1e-6)
+    annotation (
+    Placement(transformation(
+        origin={171,-35},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2(K=1e-6,
+   rho(start=999.099))
+    annotation (
+    Placement(transformation(
+        origin={101,-36},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Ouv(             k=0.5)
+    annotation (                           Placement(transformation(extent={{-48,-62},
+            {-38,-52}},          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Ouv1(             k=0.5)
+    annotation (                             Placement(transformation(extent={{-231,
+            -62},{-221,-52}},      rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe1(
+    Pm(fixed=false),
+    hn(start=466.292),
+    a3=2000,
+    b2=510,
+    b1=-3500,
+    a1(fixed=false) = -9.5e8,
+    Q(fixed=false, start=0.65),
+    C2(P(fixed=false, start=75e5)),
+    C1(P(fixed=true, start=70e5), h_vol_2(start=1125640.0)),
+    Qv(start=0.00521975),
+    h(start=1126540.0),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                 annotation (
+      Placement(transformation(extent={{-158,-91},{-178,-71}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(            K=1e-6, region=
+        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (
+    Placement(transformation(
+        origin={-120,-81},
+        extent={{-6,-10},{6,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Machines.StodolaTurbine Turbine(
+    W_fric=1,
+    Cst(fixed=false,
+      start=6.8e10)=6.19323e6,
+    Qmax=0.001,
+    eta_is_min=0.80,
+    rhos(start=10),
+    eta_is_nom=0.92,
+    Pe(fixed=true, start=8000000),
+    Ps(fixed=false, start=1800000),
+    pros(d(start=8.36949)))
+                      annotation (                       Placement(
+        transformation(extent={{47,72},{73,40}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur
+    annotation (                          Placement(transformation(extent={{168,90},
+            {198,130}},     rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi4(
+    cpw=1000,
+    steady_state=true,
+    lambda=26,
+    D=0.04,
+    L=L4,
+    Ns=Ns4,
+    ntubes=3,
+    e=0.003,
+    Tp1(start={532.06,532.262,532.478}),
+    Tp2(start={533.3,532.429,532.217}),
+    Tp(start={532.141,532.349,532.57}))
+                     annotation (
+    Placement(transformation(
+        origin={-269,-12},
+        extent={{-24,-30},{24,30}},
+        rotation=90)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(
+    option_temperature=false,
+    D=0.04,
+    L=L4,
+    Ns=Ns4,
+    T0=fill(300, Ns4),
+    h0=fill(650e3, Ns4),
+    ntubes=3,
+    inertia=false,
+    advection=false,
+    P(start={8751668.0,8729230.0,8724830.0,8720430.0,8733863.0}),
+    h(start={1128519.5,1128310.0,1129260.0,1130270.0,1131729.0}),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                     annotation (
+    Placement(transformation(
+        origin={-245.5,-11.5},
+        extent={{-23.5,-23.5},{23.5,23.5}},
+        rotation=90)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
+                                    TubeEcran_44(
+    P(each start=1.6e6),
+    option_temperature=false,
+    L=L4,
+    Ns=Ns4,
+    T0={532.656,550.0,550.0},
+    h0=fill(650e3, Ns4),
+    advection=false,
+    D(fixed=true) = 0.04,
+    C2(P(fixed=false, start=16.99e5), Q(fixed=false, start=2)),
+    hcCorr=2,
+    dpfCorr=0.4,
+    ntubes=3,
+    h(start={465547.78125,463670.0,463128.0,462620.0,462620.0}))
+                     annotation (
+    Placement(transformation(
+        origin={-293,-12},
+        extent={{23,24},{-23,-24}},
+        rotation=90)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe2(
+    Pm(fixed=false),
+    b2=510,
+    b1=-3500,
+    hn(start=350),
+    adiabatic_compression=true,
+    C1(P(fixed=false, start=17e5), h_vol_2(start=462620.0)),
+    a3(fixed=true) = 500,
+    C2(P(fixed=false, start=24.5146e5)),
+    p_rho=900,
+    Q(fixed=true, start=7.2),
+    a1(fixed=false) = -1e8)      annotation (
+      Placement(transformation(extent={{-184,129},{-164,149}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_2(K=1e-6,
+      p_rho=900)
+    annotation (
+    Placement(transformation(
+        origin={-212,138.5},
+        extent={{6,-9.5},{-6,9.5}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_1(K=1e-6,
+      p_rho=900)
+    annotation (
+    Placement(transformation(
+        origin={-286,138.5},
+        extent={{6,-9.5},{-6,9.5}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMp(
+    W_fric=1,
+    Cst(fixed=false,
+      start=8.3e9)=6.19323e6,
+    Qmax=0.001,
+    eta_is_min=0.80,
+    rhos(start=10),
+    eta_is_nom=0.94,
+    Pe(fixed=true, start=1800000),
+    Ps(fixed=false, start=5000),
+    pros(d(start=0.0434309)),
+    xm(start=0.908482))
+                      annotation (                         Placement(
+        transformation(extent={{105,72},{131,40}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.Tank Tank(
+    p_rho=895,
+    A=0.1,
+    z0=1,
+    h0=423600,
+    steady_state=true,
+    h(start=462620.0),
+    rho(start=895),
+    Patm=1670000,
+    P(start=1699000),
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.Oil_TherminolVP1)
+    annotation (
+    Placement(transformation(
+        origin={-248,142},
+        extent={{6,6},{-6,-6}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeA VolumeMP(
+    V=1,
+    rho(start=10),
+    h0=2.4e6,
+    h(start=2868560.0),
+    P0=1800000,
+    dynamic_mass_balance=true,
+    P(start=1800000),
+    Cs2(Q(start=0.255955),h_vol_2(start=2.87e6)))
+    annotation (                       Placement(transformation(extent={{84,50},
+            {94,62}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeA VolumeCond(
+    V=1,
+    rho(start=10),
+    h(start=1837610.0),
+    h0=2.1e6,
+    P0=5000,
+    dynamic_mass_balance=false,
+    P(start=5000))
+    annotation (                         Placement(transformation(extent={{141,24},
+            {130,34}},     rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater Re_1(
+    KPurge=10,
+    SPurge=0.3,
+    Se(h(fixed=true, start=600e3)),
+    SCondDes(fixed=false,
+      start=9.57697) =      3,
+    HDesF(start=583561.0),
+    HeiF(start=150619.0),
+    Hep(start=884611.0),
+    SDes(start=0.932441),
+    h(start=882589.0),
+    lambdaE=1,
+    KCond=500,
+    region_eeF=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    region_seF=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                annotation (                         Placement(transformation(
+          extent={{42,-106},{0,-56}}, rotation=0)));
+
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Re_1(
+    rho(start=10),
+    h(start=2400e3),
+    Q(start=0.1),
+    K=1e-4,
+    Pm(start=1800000))
+    annotation (
+    Placement(transformation(
+        origin={31.5,-13.5},
+        extent={{5.5,-5.5},{-5.5,5.5}},
+        rotation=90)));
+  ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss
+    annotation (                            Placement(transformation(extent={{108,
+            -106},{122,-90}},     rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Cond_2(
+    K=1e-4,
+    rho(start=10),
+    Q(start=0.35),
+    Pm(start=5000.53),
+    h(start=2100e3))
+    annotation (
+    Placement(transformation(
+        origin={135.5,8.5},
+        extent={{5.5,-5.5},{-5.5,5.5}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Rayonnement(Table=[0,700;
+        200,2; 1200,2; 1800,2; 2400,0.1; 3000,0.1; 3600,0.1; 4200,327; 4800,287;
+        5400,176; 6000,410; 6600,299; 7200,26; 7800,168; 8400,485; 9000,482;
+        9600,664; 10200,344; 10800,684; 11400,564; 12000,460; 12600,560; 13200,
+        611; 13800,557; 14400,682; 15000,785; 15600,321; 16200,850; 16800,330;
+        17400,619; 18000,480; 18600,192; 19200,750; 19800,650; 20400,450; 21000,
+        350; 21600,763; 22200,455; 22800,290; 23400,494; 24000,800; 24600,565;
+        25200,320; 25800,110; 26400,479; 27000,263; 27600,747; 28200,805; 28800,
+        576; 29400,550; 30000,470; 30600,395; 31200,315; 31800,657; 32400,670;
+        33000,381; 33600,209; 34200,457; 34800,320; 35400,13; 36000,0.1; 36600,
+        0.1; 37200,0.1; 37800,0.1; 38400,0.1; 39000,0.1; 39600,0.1; 40200,0.1;
+        40800,0; 41400,0; 42000,0; 42600,0; 43200,0; 43800,0])
+    annotation (Placement(transformation(extent={{-322,166},{-306,182}},
+          rotation=0)));
+equation
+
+public
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=3, P(start=
+          2300000))
+    annotation (Placement(transformation(extent={{21,128},{37,150}})));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=1/3, P(start=
+          2400000))                              annotation (Placement(
+        transformation(
+        extent={{-7.75,-9.75},{7.75,9.75}},
+        rotation=0,
+        origin={-158.25,139.75})));
+equation
+  connect(TubeEcran_2.CTh, Paroi2.WT1) annotation (
+    Line(points={{-3,62.6},{-4,64},{-4,73.2}}, color={191,95,0}));
+  connect(SolarCollector1.ITemperature,Paroi3. WT2)
+                                                   annotation (
+    Line(points={{-74.3026,166.992},{-75,166.992},{-75,162.8}}, color={191,95,0}));
+  connect(Incidence.y,SolarCollector1. IncidenceAngle)
+    annotation (
+              Line(points={{-305.2,154},{-262,154},{-262,182},{-106.289,182},{
+          -106.289,183}}));
+  connect(TubeEcran_3.CTh,Paroi3. WT1) annotation (
+    Line(points={{-75,145.6},{-75,153.2}}, color={191,95,0}));
+  connect(Tatm.y,SolarCollector1. AtmTemp) annotation (
+    Line(points={{-305.2,194},{-282,194},{-282,197.167},{-106.289,197.167}}));
+  connect(PerteCharge_Huile_3.C2, TubeEcran_3.C1)   annotation (
+    Line(
+      points={{-128,138.5},{-102,138.5},{-102,140},{-103,139}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(TubeEcran_3.C2, PerteCharge_Huile_4.C1)
+    annotation (
+    Line(
+      points={{-47,139},{-11,139}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(Paroi2.WT2, TubeEcran_22.CTh) annotation (
+    Line(points={{-4,82.8},{-4,93.4},{-4.5,93.4}}, color={191,95,0}));
+  connect(TubeEcran_1.CTh,Paroi1. WT1) annotation (
+    Line(points={{-143,62.6},{-144,64},{-144,73.2}}, color={191,95,0}));
+  connect(Paroi1.WT2,TubeEcran_11. CTh) annotation (
+    Line(points={{-144,82.8},{-144,93.4},{-144.5,93.4}}, color={191,95,0}));
+  connect(TubeEcran_11.C1, TubeEcran_22.C2)
+    annotation (
+    Line(
+      points={{-116,100},{-33,100}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(TubeEcran_1.C2, Secheur.Cev) annotation (
+    Line(
+      points={{-115,56},{-85.88,56},{-85.88,55.8}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Secheur.Csv, TubeEcran_2.C1) annotation (
+    Line(
+      points={{-62.12,55.8},{-60,55.8},{-60,56},{-31,56}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pompe.C1,PerteChargeCondPompe. C2)
+    annotation (
+    Line(
+      points={{84,-81},{84,-82},{111,-82},{111,-82.5}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Ballon.Ce1,ControlValveBallon. C2)
+    annotation (
+    Line(
+      points={{-63,-81},{-40,-81}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Secheur.Csl,Connection_HQ_Secheur_Ballon. C1) annotation (
+    Line(
+      points={{-73.88,39},{-73.88,-5},{-73,-5}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Connection_HQ_Secheur_Ballon.C2,Ballon. Ce2) annotation (
+    Line(
+      points={{-73,-25},{-73,-71}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(sourcePCaloporteur.C,PerteChargeCondPompe2. C1) annotation (
+    Line(points={{94,-35.5},{94,-36},{95,-36}}, color={0,0,255}));
+  connect(PerteChargeCondPompe1.C2,puitsPCaloporteur. C) annotation (
+    Line(points={{177,-35},{178,-36},{178,-35}}, color={0,0,255}));
+  connect(Pompe1.C2,ControlValveBallon1. C1) annotation (
+    Line(
+      points={{-178,-81},{-202,-81}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(PerteChargeCondPompe3.C1,Ballon. Cs)
+    annotation (
+    Line(
+      points={{-114,-81},{-83,-81}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Ouv1.y,ControlValveBallon1. Ouv)
+    annotation (                                         Line(points={{-220.5,
+          -57},{-212,-57},{-212,-64}}));
+  connect(Ouv.y,ControlValveBallon. Ouv)
+    annotation (                                      Line(points={{-37.5,-57},
+          {-30,-57},{-30,-64}}));
+  connect(PerteChargeCondPompe2.C2,Condenseur. Cee) annotation (
+    Line(points={{107,-36},{109.25,-36},{109.25,-35.4},{116,-35.4}}, color={0,0,255}));
+  connect(Condenseur.Cse,PerteChargeCondPompe1. C1) annotation (
+    Line(points={{156,-35},{160,-34},{160,-35},{165,-35}}, color={0,0,255}));
+  connect(Condenseur.Cl,PerteChargeCondPompe. C1) annotation (
+    Line(
+      points={{136.4,-51},{136.4,-82.5},{123,-82.5}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(PerteChargeCondPompe3.C2, Pompe1.C1) annotation (
+    Line(
+      points={{-126,-81},{-158,-81}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Turbine.MechPower,Alternateur. Wmec5)
+    annotation (                                            Line(points={{74.3,
+          70.4},{76,70.4},{76,94},{168,94}}));
+  connect(TubeEcran_2.C2, Turbine.Ce) annotation (
+    Line(
+      points={{25,56},{46.87,56}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(TubeEcran_4.CTh,Paroi4. WT1) annotation (
+    Line(points={{-252.55,-11.5},{-257,-11.5},{-257,-12},{-263,-12}}, color={191,95,0}));
+  connect(Paroi4.WT2, TubeEcran_44.CTh) annotation (
+    Line(points={{-275,-12},{-285.8,-12},{-285.8,-12}},
+                                                      color={191,95,0}));
+  connect(ControlValveBallon1.C2, TubeEcran_4.C1) annotation (
+    Line(
+      points={{-222,-81},{-245.5,-81},{-245.5,-35}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(TubeEcran_4.C2, TubeEcran_1.C1) annotation (
+    Line(
+      points={{-245.5,12},{-245.5,56},{-171,56}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(TubeEcran_11.C2, TubeEcran_44.C1) annotation (
+    Line(
+      points={{-173,100},{-293,100},{-293,11}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(PerteCharge_Huile_2.C2, Pompe2.C1)   annotation (
+    Line(
+      points={{-206,138.5},{-184,138.5},{-184,139}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(Tank.Cs2, PerteCharge_Huile_2.C1)                    annotation (
+    Line(
+      points={{-242,138.4},{-230,138.4},{-230,138.5},{-218,138.5}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(PerteCharge_Huile_1.C2, Tank.Ce2) annotation (
+    Line(
+      points={{-280,138.5},{-268,138.5},{-268,138.4},{-254,138.4}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(Turbine.Cs, VolumeMP.Ce1) annotation (
+    Line(
+      points={{73.13,56},{84,56}},
+      color={255,0,0},
+      thickness=0.5));
+
+  connect(VolumeMP.Cs1, TurbineMp.Ce) annotation (
+    Line(
+      points={{94,56},{104.87,56}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(TurbineMp.MechPower, Alternateur.Wmec4)
+    annotation (                                                 Line(points={{132.3,
+          70.4},{142,70.4},{142,102},{168,102}}));
+  connect(TurbineMp.Cs, VolumeCond.Ce2) annotation (
+    Line(
+      points={{131.13,56},{135.5,56},{135.5,34}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Re_1.Ee, Pompe.C2)
+    annotation (
+    Line(points={{42,-81},{64,-81}},    thickness=0.5));
+  connect(VolumeMP.Cs2, Dp_Re_1.C1) annotation (
+    Line(
+      points={{89,50},{90,50},{90,22},{31.5,22},{31.5,-8}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Dp_Re_1.C2, Re_1.Ev) annotation (
+    Line(
+      points={{31.5,-19},{31.5,-36},{8.4,-36},{8.4,-72.5}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(ControlValveBallon.C1, Re_1.Se)
+    annotation (
+    Line(points={{-20,-81},{0,-81}}, thickness=0.5));
+  connect(Re_1.Sp, invSingularPressureLoss.C1) annotation (
+    Line(
+      points={{33.6,-89.25},{33.6,-98},{108,-98}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(invSingularPressureLoss.C2, VolumeCond.Ce1) annotation (
+    Line(
+      points={{122,-98},{202,-98},{202,29},{141,29}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Dp_Cond_2.C1, VolumeCond.Cs2) annotation (
+    Line(
+      points={{135.5,14},{135.5,24}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Condenseur.Cv, Dp_Cond_2.C2) annotation (
+    Line(
+      points={{136,-11},{136,3},{135.5,3}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(PerteCharge_Huile_4.C2, massFlowMultiplier.Ce) annotation (Line(
+      points={{1,139},{21,139}},
+      color={0,140,72},
+      thickness=0.5));
+  connect(massFlowMultiplier.Cs, TubeEcran_22.C1) annotation (Line(
+      points={{37,139},{63,139},{63,100},{24,100}},
+      color={0,140,72},
+      thickness=0.5));
+  connect(Pompe2.C2, massFlowMultiplier2.Ce) annotation (Line(
+      points={{-164,139},{-166,139},{-166,139.75}},
+      color={0,140,72},
+      thickness=0.5));
+  connect(massFlowMultiplier2.Cs, PerteCharge_Huile_3.C1) annotation (Line(
+      points={{-150.5,139.75},{-140,139.75},{-140,138.5}},
+      color={0,140,72},
+      thickness=0.5));
+  connect(PerteCharge_Huile_1.C1, TubeEcran_44.C2) annotation (Line(
+      points={{-292,138.5},{-319,138.5},{-319,-80},{-293,-80},{-293,-35}},
+      color={0,127,0},
+      thickness=0.5));
+  connect(Rayonnement.y, SolarCollector1.ISun) annotation (Line(points={{-305.2,
+          174},{-280,174},{-280,190.083},{-106.289,190.083}}, color={0,0,255}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(
+      coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-320,-100},{200,200}},
+        grid={2,2},
+        initialScale=0.1),
+      graphics={
+        Text(
+          extent={{-237,-8},{-217,-18}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Eco"),
+        Text(
+          extent={{-164,48},{-126,34}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Evaporator"),
+        Text(
+          extent={{-23,49},{21,33}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Super-heater"),
+        Text(
+          extent={{151,-53},{194,-68}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Condenser"),
+        Text(
+          extent={{-115,215},{-37,197}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Parabolic solar receiver")}),
+    experiment(StopTime=40000),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </h4>
+<p><b>ThermoSysPro Version 4.0 </h4>
+<p>This is the dynamic model of a 1 MWe concentrated solar power plant with a parabolic trough collector. </p>
+<p>It is documented in a<a href=\"https://www.sciencedirect.com/science/article/pii/S1876610214005761\"> conference paper</a> and in Sect. 6.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end ConcentratedSolarPowerPlant_PTSC;
diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/SupercriticalPulverizedCoalPowerPlant.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/SupercriticalPulverizedCoalPowerPlant.mo
index 8acf94c00e5b25c2a29510c075629c62564f0615..b70581457ba00adc2035a396913432a2ee87b2ac 100644
--- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/SupercriticalPulverizedCoalPowerPlant.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/SupercriticalPulverizedCoalPowerPlant.mo
@@ -1,1992 +1,1992 @@
-within ThermoSysPro.Fluid.Examples.Book.PowerPlants;
-model SupercriticalPulverizedCoalPowerPlant
-  "Model of a supercritical pulverized coal power plant"
-
-  parameter Integer NCEL = 7;
-
-  parameter Real dpfCorr=1.00
-    "Corrective term for the friction pressure loss (dpf) for each node";
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine    Turbine_HP(
-    eta_is_min=0.75,
-    W_fric=1,
-    Qmax=50,
-    eta_is(start=0.96),
-    eta_is_nom=0.94,
-    pros(d(start=35.19870673587873)),
-    Cst(fixed=false,
-      start=2001324.343046339)=
-                       2.00537e6,
-    Pe(start=26999999.985564, fixed=true))
-    annotation (Placement(transformation(extent={{-24,136},{60,214}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD splitter_Turbine_HP1(h(start=
-          3071530.861772407),
-    dynamic_mass_balance=true,
-    P(start=6401000),
-    Ce(Q(start=549.193976505918)))
-    annotation (Placement(transformation(extent={{272,185},{294,167}})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP2(
-    eta_stato=1,
-    mode_e=2,
-    mode_s=2,
-    mode_ps=2,
-    W_fric=1,
-    eta_is(start=0.94),
-    eta_is_nom=0.94,
-    Qmax=50,
-    pros(d(start=6.887350366974513)),
-    Cst(fixed=false,
-      start=53978.86314853486)=
-                       53802.6,
-    Pe(start=3799997.860026793,
-                      fixed=true))
-    annotation (Placement(transformation(extent={{602,38},{656,97}})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP2(
-    W_fric=1,
-    eta_stato=1,
-    eta_is_min=0.75,
-    Qmax=50,
-    eta_is_nom=0.91,
-    eta_is(start=0.91),
-    pros(d(start=0.3736533771704811)),
-    xm(start=0.9898250653294598),
-    Cst(fixed=false,
-      start=1220.138716068697)=
-                       1215.75,
-    Pe(start=299998.1114947147,
-                     fixed=true))
-                annotation (Placement(transformation(extent={{1182,38},{1236,96}},
-                    rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP1(
-    eta_stato=1,
-    eta_is_min=0.75,
-    mode_e=2,
-    mode_s=2,
-    mode_ps=2,
-    eta_is_nom=0.94,
-    eta_is(start=0.94),
-    W_fric=1,
-    Qmax=50,
-    pros(d(start=10.384234361858882)),
-    Cst(fixed=false,
-      start=102744.34781655352)=
-                       102478,
-    Pe(start=5999998.330854355,
-                             fixed=true))
-    annotation (Placement(transformation(extent={{396,38},{450,96}})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP1(
-    W_fric=1,
-    eta_stato=1,
-    eta_is_min=0.75,
-    Qmax=50,
-    eta_is_nom=0.91,
-    eta_is(start=0.91),
-    pros(d(start=1.390561376459253)),
-    Cst(fixed=false,
-      start=4501.927059584096)=
-                       4485.97,
-    Pe(start=729997.7575424919,
-                     fixed=true))
-                annotation (Placement(transformation(extent={{1004,38},{1058,96}},
-                    rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP3(
-    eta_stato=1,
-    eta_is_min=0.75,
-    mode_e=2,
-    mode_s=2,
-    mode_ps=2,
-    W_fric=1,
-    Qmax=50,
-    eta_is(start=0.94),
-    eta_is_nom=0.94,
-    pros(d(start=2.8084284519008316)),
-    Cst(fixed=false,
-      start=34193.21955188417)=
-                       34076.9,
-    Pe(start=2270000, fixed=true))
-    annotation (Placement(transformation(extent={{802,38},{856,96}})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP3(
-    W_fric=1,
-    eta_stato=1,
-    eta_is_min=0.75,
-    Qmax=50,
-    eta_is_nom=0.91,
-    eta_is(start=0.91),
-    pros(d(start=0.17053836551218424)),
-    xm(start=0.9624448460730977),
-    Cst(fixed=false,
-      start=59.44671753933515)=
-                       59.4076,
-    Pe(start=59999.53282881782,
-                    fixed=true),
-    Ps(start=25000))
-                annotation (Placement(transformation(extent={{1358,38},{1412,96}},
-                    rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Echappement(
-    W_fric=1,
-    eta_stato=1,
-    xm(start=0.9213019144264654),
-    Qmax=50,
-    Cst(fixed=false,
-      start=14.295718727368532)=
-                       14.7,
-    eta_is(start=0.8),
-    eta_is_nom=0.91,
-    pros(d(start=0.04238683084570735)),
-    Pe(start=24999.77493390328,
-                    fixed=true),
-    Ps(start=5000))
-                annotation (Placement(transformation(extent={{1514,37},{1568,97}},
-                    rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP1(h(start=
-          3537588.8079320663))
-    annotation (Placement(transformation(extent={{518,79},{542,55}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP2(h(start=
-          3369888.816557468),
-      dynamic_mass_balance=true)
-    annotation (Placement(transformation(extent={{732,80},{760,54}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_IP3(
-                                                                       K(fixed=
-          false) = 10, Q(start=19.00114371733354,
-                                   fixed=true),
-    C2(P(start=580155.4529087848),h_vol(start=311761.22672647523)))
-    annotation (Placement(transformation(extent={{27,-21},{-27,21}}, rotation=270,
-        origin={945,290})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP3(
-      h(start=3059443.3348694695),
-                          P(start=774340))
-    annotation (Placement(transformation(extent={{932,78},{958,56}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP1(
-      h(start=2869360.296898901),
-                          P(start=190280))
-    annotation (Placement(transformation(extent={{1112,79},{1136,55}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP1(
-                                                                       K(fixed=
-          false) = 10, Q(start=28.001397928754212,
-                                   fixed=true),
-    C2(P(start=236489.70540554097)))
-    annotation (Placement(transformation(extent={{27,-20},{-27,20}}, rotation=270,
-        origin={1124,291})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP2(h(start=
-          2606190.1863981914))
-    annotation (Placement(transformation(extent={{1284,79},{1308,55}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP2(
-                     K(fixed=false) = 10, Q(start=9.0003750371771,
-                                                     fixed=true),
-    C2(P(start=44661.45635759075)))
-    annotation (Placement(transformation(extent={{-27,-21},{27,21}}, rotation=90,
-        origin={1296,291})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP3(                h(
-        start=2489005.0530445203),
-                          P(start=23000))
-    annotation (Placement(transformation(extent={{1460,81},{1486,53}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP3(
-    h(start=3.048e6),
-    K(fixed=false) = 10,
-    Q(start=16.000569587384174,
-                fixed=true),
-    C2(P(start=19457.45212821197),h_vol(start=225941.66047852393)))
-    annotation (Placement(transformation(extent={{27,-22},{-27,22}}, rotation=270,
-        origin={1474,291})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{1764,-54},{1826,-4}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
-                 Q0=16400, h0=121652)
-                                 annotation (Placement(transformation(extent={{1562,
-            -54},{1614,-4}},       rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Condenser2(K=1e-4,
-      Pm(start=4999.990549904409),
-    C1(h_vol(start=137765.1189884895)),
-    C2(P(start=4999.981099808819),h_vol(start=137765.1189884895)))
-    annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=270,
-        origin={1694,-164})));
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
-    Vf0=0.15,
-    A=100,
-    ntubes=28700,
-    lambda=0.018,
-    Kvl=1,
-    V=1000,
-    steady_state=false,
-    continuous_flow_reversal=true,
-    yNiveau(signal(start=1.5, fixed=false)),
-    P0=5000,
-    P(start=5000),
-    Cv(Q(start=433.2001545496264)),
-    proe(d(start=994.1205995939429)))
-    annotation (Placement(transformation(extent={{1636,-72},{1746,30}})));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump(
-    C1(P(start=5000)),
-    a1(fixed=false) = -390,
-    a3=350,
-    C2(P(start=2699869.622037593,
-                        fixed=true), h_vol(start=140956.11701829222)),
-    Qv(start=0.43524240668307135),
-    h(start=139360.61800339087),
-    hn(start=276.1071665616722))
-    annotation (Placement(transformation(extent={{1760,-226},{1796,-188}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff ReDrum(
-    DTfroid(displayUnit="K") = 5,
-    Kf=305,
-    DPf(start=57524.2563411452),
-    Ec(h(start=311761.22672647523)),
-    Ef(h_vol(start=140956.11701829222)),
-    Sc(h_vol(start=150272.7724602458)),
-    Sf(h_vol(start=161833.76268010825)),
-    promc(d(start=985.5919033987386)))
-    annotation (Placement(transformation(extent={{1798,440},{1666,548}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP3(
-    SPurge=200,
-    KCond=1535.50,
-    KPurge=100,
-    Ep(Q(start=0.001)),
-    SCondDes=3255,
-    lambdaE=256,
-    Ee(P(start=2650000)),
-    P(start=25000),
-    HDesF(start=245425.15364009212),
-    HeiF(start=162682.43852863708),
-    Hep(start=248917.79589378808),
-    SDes(start=1E-009),
-    Se(
-      P(start=2511836.0997127844),
-      h(start=245425.15364009212),
-      h_vol(start=245425.15364009212)))
-    annotation (Placement(transformation(extent={{1568,552},{1452,434}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP2(
-    KCond=1530.50,
-    SPurge=482.5,
-    KPurge=109.55,
-    Se(P(start=2413894.9462802503),
-      h(start=306860.7316879813),
-      h_vol(start=306860.7316879813)),
-    lambdaE=512.2,
-    Ee(P(start=2600000)),
-    SCondDes=1477,
-    P(start=60000),
-    Ep(h(start=438607.090332969)),
-    HDesF(start=306860.7316879813),
-    HeiF(start=247625.18923762313),
-    Hep(start=328778.4878550007),
-    SDes(start=1E-009))
-    annotation (Placement(transformation(extent={{1390,552},{1272,434}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP1(
-    KCond=1530.50,
-    SPurge=504,
-    KPurge=155.7,
-    lambdaE=1258,
-    Ee(P(start=2500000)),
-    SCondDes=1408,
-    P(start=300000),
-    Ep(h(start=464182.2380411874)),
-    HDesF(start=455062.8963466834),
-    HeiF(start=313734.293691341),
-    Hep(start=501954.8282730701),
-    SDes(start=131.63162125559273),
-    Se(
-      P(start=2169310.5330650215),
-      h(start=465109.255940298),
-      h_vol(start=465109.255940298)))
-    annotation (Placement(transformation(extent={{1214,551},{1106,437}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterIP(
-    KCond=1730.50,
-    SPurge=239,
-    KPurge=2795,
-    lambdaE=885,
-    Ee(P(start=2250000)),
-    SCondDes=795,
-    P(start=730000),
-    HDesF(start=565579.5385524093),
-    HeiF(start=473909.76996909064),
-    Hep(start=664813.6284480324),
-    SDes(start=98.33315286951769),
-    Se(h(start=578948.0240115122), P(start=1992791.4733867273)))
-    annotation (Placement(transformation(extent={{1030,551},{924,437}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss pipePressureLoss_LP3_Drum(K=1e-4, pro(d(
-          start=986.1624696132673)))
-    annotation (Placement(transformation(extent={{1562,555},{1602,605}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeI Drum_1(h(start=167087.86591036225),
-                                                                  V=10)
-    annotation (Placement(transformation(extent={{1872,493},{1926,555}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_IP1(
-    h(start=3463.4e3),
-    K(fixed=false) = 10,
-    Q(start=25.00040036422368,
-                fixed=true),
-    Pm(start=3900000),
-    C2(h_vol(start=3537588.8079320663)))
-    annotation (Placement(transformation(extent={{26.5,-22},{-26.5,22}},
-                                                                     rotation=270,
-        origin={530,290.5})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeI Drum_2(
-    h(start=778321.3350751515),
-    V=200,
-    P(start=2070000))
-    annotation (Placement(transformation(extent={{774,433},{712,503}})));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1(
-                                                                               rm=0.7,
-    C2(Q(start=599.993976505918,
-                    fixed=true), P(start=32854107.921229515),
-      h_vol(start=827111.4901416934)),
-    C1(P(start=2070000)),
-    a1(fixed=false) = -3050,
-    a3=5000,
-    Qv(start=0.6740415564019792),
-    h(start=821565.0),
-    hn(start=3535.3592725080375))
-    annotation (Placement(transformation(extent={{683,509},{655,483}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP3(
-    Se(P(start=32900000), h(start=932438.8978014372)),
-    KPurge=1200,
-    lambdaE=1712,
-    SPurge=1098,
-    Ee(P(start=33600000), h_vol(start=827111.4901416933)),
-    KCond=1588,
-    SCondDes=750,
-    P(start=3771567.571218525),
-    HDesF(start=927325.1475293547),
-    HeiF(start=855187.674900425),
-    Hep(start=964242.0430144744),
-    SDes(start=79.82059037582069),
-    h(start=841102.4802107343))
-    annotation (Placement(transformation(extent={{572,546},{474,448}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Desu(
-    C2(P(start=3800000)),
-    C1(h_vol(start=2924612.095560695)),
-    K=1e-4,
-    Pm(start=3771567.5730999485))
-    annotation (Placement(transformation(extent={{22.5,-14.5},{-22.5,14.5}},
-                                                                     rotation=180,
-        origin={274.5,375.5})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP2(
-    lambdaE=1157,
-    Se(P(start=32400000), h(start=1168614.317235736)),
-    KCond=1588,
-    KPurge=1200,
-    SPurge=849,
-    SCondDes=1667.5,
-    P(start=5568798.758801826),
-    Ee(Q(start=299.99698825295724),
-                       h(start=932438.8978014372)),
-    Ep(P(start=8930425.05990273), h(start=1170923.9907383516)),
-    HDesF(start=1139894.576035795),
-    HeiF(start=977219.550756442),
-    Hep(start=1180774.7250052856),
-    SDes(start=337.2006466251369),
-    h(start=940451.6341612964))
-    annotation (Placement(transformation(extent={{404,482},{302,376}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP1(
-    h(start=3.07903e6),
-    K(fixed=false) = 10,
-    Q(start=61, fixed=true),
-    Pm(start=6401000))
-    annotation (Placement(transformation(extent={{27,-20},{-27,20}}, rotation=270,
-        origin={322,291})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP1(
-    KPurge=1279,
-    lambdaE=750,
-    Se(h(start=1338936.264843952),
-                         P(start=32050000)),
-    KCond=1588,
-    SCondDes=1692.5,
-    SPurge=1049,
-    P(start=10000000),
-    Ee(h(start=1168614.317235733)),
-    HDesF(start=1301805.3904686682),
-    HeiF(start=1184664.7287055368),
-    Hep(start=1360493.8691474798),
-    SDes(start=416.53928018645576))
-    annotation (Placement(transformation(extent={{208,480},{104,378}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff Desuperheater(
-    Sf(
-      Q(start=600),
-      h(start=1.369E6),
-      P(start=31940231.739229403),
-      h_vol(start=1364477.62662973)),
-    Ef(h(start=1338936.2648439475)),
-    promc(d(start=12.67201785254116)),
-    DTfroid(displayUnit="K") = 5,
-    Kf=10,
-    Tsf(start=580.3334486723465))
-    annotation (Placement(transformation(extent={{34,545},{-70,447}})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP(
-    h(start=3.19e6),
-    Q(fixed=true, start=50.8),
-    K(fixed=false) = 10,
-    Pm(start=10000000))
-    annotation (Placement(transformation(extent={{21.5,-18},{-21.5,18}},
-                                                                     rotation=270,
-        origin={128,296.5})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP_IP(
-    h(start=3.07903e6),
-    K(fixed=false) = 10,
-    Q(fixed=true, start=3),
-    Pm(start=6401000))
-    annotation (Placement(transformation(extent={{-15.5,-16.5},{15.5,16.5}},
-                                                                     rotation=0,
-        origin={883.5,-8.5})));
-  ThermoSysPro.WaterSteam.Machines.StodolaTurbine   Turbine_HP1(
-    eta_is_min=0.75,
-    W_fric=1,
-    Qmax=50,
-    eta_is(start=0.96),
-    eta_is_nom=0.92,
-    pros(d(start=24.64344118791907)),
-    Cst(fixed=false,
-      start=278836.9406128902)=
-                       279474,
-    Pe(start=10000000, fixed=true),
-    Ps(start=6401000))
-    annotation (Placement(transformation(extent={{172,136},{256,214}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD splitter_Turbine_HP(h(start=
-          3182580.38391812),
-    dynamic_mass_balance=true,
-    P(start=10000000))
-    annotation (Placement(transformation(extent={{116,184},{140,166}})));
-  ThermoSysPro.WaterSteam.Machines.Generator generator(eta=99.7)
-    annotation (Placement(transformation(extent={{48,-194},{-84,-314}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add
-                                          annotation (Placement(transformation(
-          extent={{94,-218},{76,-200}},
-                                    rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add3 add1
-                                          annotation (Placement(transformation(
-          extent={{96,-240},{76,-220}},
-                                    rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add3 add2
-                                          annotation (Placement(transformation(
-          extent={{94,-264},{76,-244}},
-                                    rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT(C1(h_vol(start=
-            3474803.0992788016)),
-                                C2(h_vol(start=3474803.0992788034)))
-    annotation (Placement(transformation(extent={{-202,170},{-180,200}})));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveHP(
-                             C1(P(fixed=true, start=27019900)),
-    h(start=3.4756e6),
-    Cvmax(fixed=false) = 8005,
-    T(displayUnit="K", start=873.1))
-    annotation (Placement(transformation(extent={{-157,166},{-121,204}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constantHP(k=0.5)
-    annotation (Placement(transformation(extent={{-84,200},{-114,230}})));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveIP(Cvmax(
-        fixed=false) = 8005,
-    h(start=3.70545e6),
-    C1(P(fixed=true, start=6009998.640295431),
-                                     h_vol(start=3701594.2696911553)))
-    annotation (Placement(transformation(extent={{-158,245},{-122,285}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constantIP(k=0.5)
-    annotation (Placement(transformation(extent={{-84,274},{-120,310}})));
-  ThermoSysPro.Combustion.CombustionChambers.GenericCombustion1D
-    genericCombustion(
-    EPSPAR=0.4,
-    ImbCV=0.01,
-    ImbBF=0.007,
-    Kec=15,
-    SM={635.7,635.7,635.7,635.7,635.7,635.7,635.7},
-    Psf,
-    Tea(start=577.3294631233695),
-    Tpi(start={662.130125894802,685.614566355283,696.9408592330145,
-          703.5449672340172,712.7782107613066,727.9340239141302,
-          750.6768400836096}),
-    Tsf(start=1501.2484101541468),
-    deltaPccb(start=2223.1944617307236))
-                      annotation (Placement(transformation(extent={{-238,-102},
-            {-436,68}},
-                      rotation=0)));
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe Wall_screen(
-    Ns=NCEL,
-    L=65,
-    ntubes=912,
-    mode=0,
-    z2=65,
-    D=0.034,
-    option_temperature=2,
-    P(start={30342043.891952675,30282117.04096996,30227397.738711014,
-          30178994.328953177,30137426.097264428,30101658.687952235,
-          30069281.864402287,30038017.722720534,30006184.603574578}),
-    Q(start={597.6590942672652,597.6590942672652,597.6590942672652,
-          597.6590942672652,597.6590942672652,597.6590942672652,
-          597.6590942672652,597.6590942672652}),
-    h(start={1479747.0728819133,1653147.2981052676,1836593.6418651666,
-          2019276.7199909666,2201503.0794841815,2383076.101933648,
-          2563538.204063644,2742239.471375197,2742239.471375197}),
-    mu2(start={8.337682531388398E-05,7.290904575803869E-05,6.19675832347849E-05,
-          5.107649475602911E-05,4.1856937780558395E-05,3.577140353596319E-05,
-          3.242959431491525E-05,3.102497852505804E-05}),
-    pro2(d(start={696.792093597009,625.1171632839697,535.5755100207667,
-            432.7397163943108,333.50837586843403,256.1304727342381,
-            200.77652123807803,161.8541988249301})))
-                  annotation (Placement(transformation(extent={{-66,44},{66,-44}},
-                   rotation=90,
-        origin={-520,-18})));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    Ns=NCEL,
-    lambda=40,
-    L=65,
-    e=0.008,
-    ntubes=912,
-    D=0.034,
-    Tp(start={653.6406823320823,676.633278239129,687.9969395834568,
-          694.6234079190576,703.8886379558984,719.0988402846453,
-          741.927864576376}))
-              annotation (Placement(transformation(
-        extent={{-66,37},{66,-37}},
-        rotation=90,
-        origin={-465,-18})));
-  ThermoSysPro.FlueGases.Junctions.Splitter2 splitter2_1 annotation (Placement(
-        transformation(
-        extent={{-12,-19},{12,19}},
-        rotation=90,
-        origin={-335,102})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
-    Boiler_walls(
-    Ns=3,
-    ExchangerWall(lambda=40, e=8e-3,
-      Tp(start={718.6571040634899,718.1194034334801,717.724499487972}),
-      Tp1(start={717.5714868892015,717.6719267649172,717.5487415294846})),
-    Dint=34e-3,
-    Ntubes=912,
-    L=40,
-    z2=40,
-    ExchangerFlueGasesMetal(St=292.41, Dext=50e-3,
-      DeltaT(start={554.0628991212207,228.3772089692427,89.70101646279409}),
-      T(start={1501.2484130859375,1045.9831048360795,847.7485555139816,
-            767.3925170898438}),
-      Tm(start={1273.6157574951133,946.8658301750306,807.5705357170625})),
-    TwoPhaseFlowPipe(rugosrel=0.0014,
-      P(start={30006184.0,29959265.487962805,29911856.28834493,
-            29864219.536209688,29816476.0}),
-      h(start={2742239.5,2768510.843637918,2779339.5468098293,2783592.798199836,
-            2783592.75})),
-    Cws2(P(start=29816475.42940753),h_vol(start=2783592.798199836)))
-    annotation (Placement(transformation(extent={{202,-27},{-202,27}},
-        rotation=-90,
-        origin={-521,308})));
-  ThermoSysPro.FlueGases.BoundaryConditions.Sink puitsFumeesPTQXA1(T(start=
-          398.86640471653106))
-    annotation (Placement(transformation(extent={{-392,-166},{-446,-110}},
-                                                                     rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases RMT_RHT(
-    Ns=3,
-    L=17.1,
-    ExchangerWall(lambda=40, e=6e-3,
-      Tp(start={908.5197253834301,914.4577273376398,917.7248494787165}),
-      Tp1(start={906.7665349453516,913.5361998085987,917.2460906463742})),
-    Dint=54.5e-3,
-    Ntubes=4900,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=66.5e-3,
-      step_T=0.22,
-      step_L=0.9619,
-      DeltaT(start={215.99646104532553,113.53397822935688,58.984016359030534}),
-      T(start={1189.486083984375,1062.720872868754,994.9311731733584,
-            959.3534545898438}),
-      Tm(start={1126.1034611836415,1028.8260230210562,977.1423166436323})),
-    Cws2(h(start=3.7057e6), P(start=6000000)),
-    TwoPhaseFlowPipe(rugosrel=0.0015,
-      P(start={6010948.5,6010749.460821071,6010514.567152408,6010261.309075393,
-            6009998.5}),
-      h(start={3264769.75,3507624.3814902483,3635275.8367294283,
-            3701594.2696911553,3701594.25})),
-    Cws1(P(start=6010948.472475457),h_vol(start=3264769.660736534)))
-    annotation (Placement(transformation(extent={{-348,288},{-246,218}})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases SBT(
-    Ns=3,
-    L=17.1,
-    Dint=38.3e-3,
-    TwoPhaseFlowPipe(rugosrel=0.0145,
-      P(start={29816474.0,29814038.312406328,29811347.95808922,
-            29808483.096597232,29805500.0}),
-      h(start={2783592.75,2877312.3915758613,2940320.6561487615,
-            2982465.835108181,2982465.75})),
-    ExchangerWall(lambda=40, e=6.5e-3,
-      Tp(start={749.7844520576,755.6415626459205,759.6971986304427}),
-      Tp1(start={747.8691146804046,754.3538694340593,758.8358820836914})),
-    Ntubes=3200,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=51.3e-3,
-      step_L=0.7,
-      DeltaT(start={176.62815353948065,118.74820438652762,79.42869651947797}),
-      T(start={959.3534545898438,896.7825168405388,854.222865602998,
-            825.5177612304688}),
-      Tm(start={928.0679884772226,875.5026912217684,839.8703116077473})),
-    Cws2(h_vol(start=2982465.835108181)))
-    annotation (Placement(transformation(extent={{-244,368},{-348,302}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_SBT(K(fixed=
-          false) = 910.878, C1(P(fixed=true, start=29805500)))
-    annotation (Placement(transformation(extent={{-376,321},{-400,350}})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases RBT(
-    Ns=3,
-    L=17.1,
-    TwoPhaseFlowPipe(rugosrel=0.0028,
-      P(start={6401069.0,6400829.006029598,6400559.967505192,6400281.512735571,
-            6400000.0}),
-      h(start={3071530.75,3206249.001381632,3250421.0375270667,
-            3264769.6607365347,3264769.75})),
-    ExchangerWall(lambda=40, e=7.5e-3,
-      Tp(start={731.5611188100817,719.1011974452427,714.9322174305115}),
-      Tp1(start={730.6241511341694,718.7939799453013,714.8324224349741})),
-    Dint=45.7e-3,
-    Ntubes=7400,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=60.7e-3,
-      step_L=0.7,
-      DeltaT(start={55.41873058878309,18.170961815555074,5.902564318895884}),
-      T(start={825.5177612304688,750.0683189765095,725.0092641729291,
-            716.83349609375}),
-      Tm(start={787.793038294503,737.5387915747193,720.9213932561836})),
-    Cws1(P(start=6401069.169670619),
-                             h_vol(start=3071530.861772407)),
-    Cws2(h_vol(start=3264769.660736535)))
-    annotation (Placement(transformation(extent={{-244,445},{-348,385}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_RBT(K(fixed=
-          false) = 34.39, C1(P(fixed=true, start=6400000)))
-    annotation (Placement(transformation(extent={{-390,401},{-416,429}})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases Economiseur(
-    Ns=3,
-    L=17.1,
-    ExchangerWall(lambda=40, e=7e-3,
-      Tp(start={597.8632830911926,601.9643838890306,604.4388143032807}),
-      Tp1(start={597.0798518240282,601.4765869344108,604.1356180309247})),
-    TwoPhaseFlowPipe(rugosrel=0.0015,
-      P(start={31940232.0,31940175.652893864,31940118.025039315,
-            31940059.354486804,31940000.0}),
-      h(start={1364477.625,1421835.5302184983,1457548.9512506293,
-            1479747.0728819133,1479747.125})),
-    Dint=37.1e-3,
-    Ntubes=5300,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=48.3e-3,
-      step_L=0.7,
-      DeltaT(start={97.96280056397143,60.995722003917535,37.91265067585584}),
-      T(start={716.83349609375,676.15417968096,650.5975916707414,
-            634.6221923828125}),
-      Tm(start={696.493851010199,663.3758856758507,642.6098980814818})))
-    annotation (Placement(transformation(extent={{-244,527},{-348,465}})));
-  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases SMT_SHT(
-    L=17.1,
-    TwoPhaseFlowPipe(rugosrel=0.0015,
-      P(start={27030444.0,27028361.67511348,27025839.239372097,
-            27022989.150393303,27019900.0}),
-      h(start={2976603.0,3194812.5584599497,3356176.887995873,3474803.099278803,
-            3474803.0})),
-    ExchangerWall(lambda=40, e=8e-3,
-      Tp(start={854.8283610087926,887.434475626394,912.4750108334613}),
-      Tp1(start={846.3932984841808,881.1968091408571,907.8894202971029})),
-    Dint=37.9e-3,
-    Ntubes=2075,
-    ExchangerFlueGasesMetal(
-      St=292.41,
-      Dext=53.9e-3,
-      step_T=0.22,
-      step_L=1.016,
-      DeltaT(start={571.7995516807581,422.84154854302676,310.84993208179515}),
-      T(start={1501.2484130859375,1366.1601385670497,1264.857744235079,
-            1189.486083984375})),
-    Cws2(P(start=27000000), h(start=3.4751e6)),
-    Ns=3)
-    annotation (Placement(transformation(extent={{-348,206},{-246,140}})));
-  ThermoSysPro.FlueGases.PressureLosses.InvSingularPressureLoss singularPressureLoss
-                          annotation (Placement(transformation(extent={{-496,
-            551},{-472,579}},
-                       rotation=0)));
-  ThermoSysPro.FlueGases.Junctions.Mixer2 mixer2_1(T(start=639.3587532777143))
-                                                   annotation (Placement(
-        transformation(
-        extent={{-18,-20},{18,20}},
-        rotation=90,
-        origin={-336,572})));
-  ThermoSysPro.FlueGases.HeatExchangers.StaticFluegasesFluegasesExchangerKS RA(
-    DPc(displayUnit="bar") = 0.01,
-    K=350,
-    S=7475,
-    DPf=0.01,
-    Tsc(displayUnit="degC", start=401.15),
-    Tsf(start=573.15, displayUnit="degC"))
-    annotation (Placement(transformation(extent={{-37,34},{37,-34}},
-        rotation=90,
-        origin={-338,-159})));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ sourceAir(
-    Xh2o=0.016,
-    Xo2=0.206,
-    Xco2=0,
-    Q0=708,
-    P0=101000,
-    T0=288.15)
-    annotation (Placement(transformation(extent={{-444,-260},{-394,-204}})));
-  ThermoSysPro.FlueGases.Volumes.VolumeATh AirPreheater(h(start=72890))
-    annotation (Placement(transformation(extent={{-368,-242},{-348,-222}})));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={305.15})
-    annotation (Placement(transformation(extent={{-368,-222},{-348,-202}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA1(                   h(start=
-          1479747.0728819133),
-                      P(start=32000000),
-    Cs2(Q(start=2.340852247894304)))
-    annotation (Placement(transformation(extent={{-366,484},{-394,508}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(
-    h(start=2976603.0385964634),
-    dynamic_mass_balance=true,
-    P(start=27030443.91251134))
-    annotation (Placement(transformation(extent={{-390,162},{-370,184}})));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceQ(
-                                                             Q0=0, P0=100000)
-    annotation (Placement(transformation(extent={{-144,-8},{-206,60}}, rotation=
-           0)));
-  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    rho=1200,
-    Hum=0.03,
-    T0(displayUnit="K") = 288.15,
-    Xc=0.6652,
-    Xh=0.0378,
-    Xo=0.0546,
-    Xn=0.0156,
-    Xs=0.0052,
-    Xashes=0.1415,
-    Vol=0.229,
-    Q0=65.765,
-    LHV=26030e3)
-    annotation (Placement(transformation(extent={{-140,-94},{-208,-26}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveEco(
-    T(displayUnit="K"),
-    Cvmax(fixed=true) = 200,
-    Q(start=2.35, fixed=false))
-                             annotation (Placement(transformation(
-        extent={{14,14},{-14,-14}},
-        rotation=90,
-        origin={-372,443})));
-  ThermoSysPro.Examples.Control.TemperatureControl TemperatureControl(
-    Ti=5,
-    pIsat(Ti=20, Limiteur1(u(signal(start=-0.028450421536047304)))),
-    add(k1=+1, k2=-1))
-    annotation (Placement(transformation(extent={{-148,441},{-180,477}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constant_Temperature(k=873.15)
-    annotation (Placement(transformation(extent={{-104,435},{-132,461}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Q_flueGases_wall(k=
-        0.03506165)
-    annotation (Placement(transformation(extent={{-422,60},{-380,92}})));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_Drum_2
-                                                                 annotation (
-      Placement(transformation(
-        extent={{22,-20},{-22,20}},
-        rotation=180,
-        origin={764,594})));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_ReDrum
-                                                                 annotation (
-      Placement(transformation(
-        extent={{19,-19},{-19,19}},
-        rotation=180,
-        origin={1795,550})));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_Cond
-                                                                 annotation (
-      Placement(transformation(
-        extent={{26,-26},{-26,26}},
-        rotation=90,
-        origin={1930,285})));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ Sensor_Qvap_Cond(C1(h_vol(start=
-            1957787.8431100189)))
-    annotation (Placement(transformation(
-        origin={1704,53},
-        extent={{-13,-18},{13,18}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ Sensor_Qvap_Cond2
-    annotation (Placement(transformation(
-        origin={1706,-113},
-        extent={{-15,-16},{15,16}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Low(mode=1, K=
-       1e-4,
-    C1(h_vol(start=140956.11701829222), P(start=2617886.004032243)),
-    Pm(start=2617885.994610223))
-                 annotation (Placement(transformation(extent={{-27,-24},{27,24}},
-                    rotation=90,
-        origin={1830,290})));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve_Condenser(
-    mode=1,
-    Cvmax=2000,
-    C2(P(start=2696400)))
-    annotation (Placement(transformation(
-        extent={{-18,-17},{18,17}},
-        rotation=90,
-        origin={1819,-160})));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneLevelCondenser1(k=1.5)
-    annotation (Placement(transformation(extent={{1932,-38},{1896,-2}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Level_Condenser(
-    add(k1=+1, k2=-1),
-    pIsat(
-      Ti=200,
-      minval=0.3,
-      Limiteur1(u(signal(start=0.8)))),
-    pIsat1(Ti=100, minval=0.3),
-    edge(uL(signal(start=true))))
-                                annotation (Placement(transformation(extent={{
-            1896,-98},{1940,-54}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Condenser1(
-                                                                                       K=1e-4, Pm(start=
-          5191.555663955529))
-    annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=0,
-        origin={1661,67})));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP2(
-    h(start=3.07903e6),
-    K(fixed=false) = 1e-4,
-    Pm(start=6401000),
-    C1(P(fixed=true, start=6401100)))
-    annotation (Placement(transformation(extent={{28,-19},{-28,19}}, rotation=270,
-        origin={285,291})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_condenser(h(start=
-          1957787.8431100189),
-    h0=1.959e6,
-    P0=538300000,
-    P(start=5000))
-    annotation (Placement(transformation(extent={{1600,53},{1628,81}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_Eco(K(fixed=
-          false) = 3867, C1(P(fixed=true, start=31940000)))
-    annotation (Placement(transformation(extent={{-416,482},{-442,510}})));
-  ThermoSysPro.WaterSteam.PressureLosses.CheckValve CheckValve(
-    Qmin=1,
-    Q(fixed=true, start=30.011367796945933),
-    k(fixed=false) = 100,
-    touvert(start=true))
-    annotation (Placement(transformation(
-        extent={{-18,-16},{18,16}},
-        rotation=90,
-        origin={745,288})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps V_staticCentrifugalPump(Table=[0,
-        1400; 100,1400; 700,1000; 800,950; 900,950; 1000,950])
-                   annotation (Placement(transformation(extent={{1670,-310},{
-            1738,-244}}, rotation=0)));
-  ThermoSysPro.Examples.Control.MassFlowControl Pump_VelocityControl(
-    pT1_1(k=1, Ti=1),
-    Ti=5,
-    maxval=1400,
-    pIsat(Limiteur1(u(signal(start=1400.006776094082)))))
-    annotation (Placement(transformation(extent={{628,637},{694,699}})));
-  ThermoSysPro.WaterSteam.Sensors.SensorQ sensorQ
-    annotation (Placement(transformation(extent={{626,494},{606,514}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(
-    k=1,
-    U0=1400,
-    permanent=true,
-    Ti=10)
-    annotation (Placement(transformation(extent={{712,631},{732,651}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp_Kcor(
-    Starttime=100,
-    Duration=600,
-    Initialvalue=1,
-    Finalvalue=0.5)
-    annotation (Placement(transformation(extent={{-244,-170},{-274,-148}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP1(
-    h0=850000,
-    dynamic_mass_balance=true,
-    P0=32200000,
-    P(start=31945061.30060599),
-    h(start=1338936.2648439475),
-    Ce1(h(start=1338936.264843952)))
-                     annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=-90,
-        origin={86,496})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterHP1_1(
-    KPurge=1279,
-    lambdaE=750,
-    Se(h(start=1.369e6), P(start=32050000)),
-    KCond=1588,
-    SCondDes=1692.5,
-    SPurge=1049,
-    P(start=8930425.05990273),
-    Ee(h(start=1168614.3172357369)),
-    Ev(Q(start=25.40000000000056)),
-    HDesF(start=1301805.3904686691),
-    HeiF(start=1184664.7287055398),
-    Hep(start=1360493.8691474795),
-    SDes(start=416.5392801864518),
-    Sp(h(start=1170923.990738357)),
-    h(start=940451.6341612969))
-    annotation (Placement(transformation(extent={{208,610},{104,508}})));
-  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterHP2_1(
-    lambdaE=1157,
-    Se(P(start=32400000), h(start=1168614.317235736)),
-    KCond=1588,
-    KPurge=1200,
-    SCondDes=1667.5,
-    SPurge=849,
-    P(start=5568798.758801826),
-    Ee(h(start=932438.8978014372)),
-    Ev(Q(start=30.499999999999968)),
-    HDesF(start=1139894.576035795),
-    HeiF(start=977219.5507564419),
-    Hep(start=1180774.725005288),
-    SDes(start=337.20064662513767))
-    annotation (Placement(transformation(extent={{404,612},{302,506}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP2(
-    h0=820000,
-    h(start=932438.8978014372),
-    dynamic_mass_balance=true,
-    P0=32400000,
-    P(start=32156093.56417011))
-    annotation (Placement(transformation(extent={{416,487},{436,507}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP3(
-    h0=990400,
-    h(start=940451.6341612943),
-    P0=6400171,
-    P(start=5568798.758431694))
-                      annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={498,565})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP1Vap(
-    h0=990400,
-    dynamic_mass_balance=true,
-    h(start=3182580.38391812),
-    P0=10000000,
-    P(start=8930425.061957654))
-                       annotation (Placement(transformation(
-        extent={{-10,10},{10,-10}},
-        rotation=90,
-        origin={128,342})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP1Vap1(
-    h0=990400,
-    dynamic_mass_balance=true,
-    h(start=3071530.861772407),
-    P0=6400171,
-    P(start=5568798.763146943))
-                      annotation (Placement(transformation(
-        extent={{-10,10},{10,-10}},
-        rotation=90,
-        origin={322,342})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=1e-4, pro(d(start=844.2396226650313)))
-    annotation (Placement(transformation(extent={{524,555},{544,575}})));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP singularPressureLoss2
-    annotation (Placement(transformation(extent={{433,592},{453,612}})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={384,470})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={292,470})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={322,382})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss6(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={128,389})));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
-    singularPressureLoss7(K=1e-4) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={70,470})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP21(
-    h0=1168600,
-    h(start=1168614.3172357369),
-    P0=32060000,
-    dynamic_mass_balance=true,
-    P(start=32031852.891034454))
-    annotation (Placement(transformation(extent={{266,549},{246,569}})));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP22(
-    h0=1168600,
-    h(start=1168614.317235733),
-    P0=32060000,
-    dynamic_mass_balance=true,
-    P(start=32031852.513327856))
-    annotation (Placement(transformation(extent={{264,419},{244,439}})));
-  ThermoSysPro.Examples.Control.MassFlowRateAirCoalWater
-    MassFlowRateAirCoalWater
-    annotation (Placement(transformation(extent={{-408,620},{-488,708}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Power_MW(
-    Starttime=100,
-    Duration=600,
-    Initialvalue=804.461,
-    Finalvalue=399.8)
-    annotation (Placement(transformation(extent={{-340,678},{-370,700}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_2(
-    k=1,
-    permanent=true,
-    U0=708,
-    Ti=5)
-    annotation (Placement(transformation(extent={{-554,648},{-582,671}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_3(
-    k=1,
-    permanent=true,
-    U0=804,
-    Ti=5)
-    annotation (Placement(transformation(extent={{-556,684},{-580,709}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_4(
-    k=1,
-    permanent=true,
-    U0=600,
-    Ti=5)
-    annotation (Placement(transformation(extent={{-370,636},{-344,662}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_5(
-    k=1,
-    permanent=true,
-    U0=0.8,
-    Ti=10)
-    annotation (Placement(transformation(extent={{1766,-170},{1786,-150}})));
-equation
-
-  connect(lumpedStraightPipe_IP3.C1, splitter_TurbineIP3.Cs2) annotation (Line(
-      points={{945,263},{945,78}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_LP2.Cs, splitter_TurbineLP2.Ce1) annotation (Line(
-      points={{1236.27,67},{1284,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_TurbineLP2.Cs1, Turbine_LP3.Ce) annotation (Line(
-      points={{1308,67},{1357.73,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_LP2.C1, splitter_TurbineLP2.Cs2) annotation (Line(
-      points={{1296,264},{1296,79}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_LP3.Cs, splitter_TurbineLP3.Ce1) annotation (Line(
-      points={{1412.27,67},{1460,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(
-      points={{1614,-29},{1616,-29},{1616,-32.22},{1636,-32.22}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Condenser.Cse, PuitsCaloporteur.C) annotation (Line(
-      points={{1746,-31.2},{1741,-31.2},{1741,-29},{1764,-29}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(lumpedStraightPipe_LP3.C2, ReheaterLP3.Ev) annotation (Line(
-      points={{1474,318},{1474,474.12},{1475.2,474.12}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_LP1.C2, ReheaterLP1.Ev) annotation (Line(
-      points={{1124,318},{1124,475.76},{1127.6,475.76}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterLP1.Sp, ReheaterLP2.Ep) annotation (Line(
-      points={{1192.4,512.81},{1192.4,555},{1248,555},{1248,453},{1366.4,453},{
-          1366.4,472.94}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(lumpedStraightPipe_LP1.C1, splitter_TurbineLP1.Cs2) annotation (Line(
-      points={{1124,264},{1124,79}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Drum_1.Ce3, pipePressureLoss_LP3_Drum.C2)
-                                             annotation (Line(
-      points={{1872,499.2},{1852,499.2},{1852,580},{1602,580}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(pipePressureLoss_LP3_Drum.C1, ReheaterLP3.Sp)
-                                                annotation (Line(
-      points={{1562,580},{1544.8,580},{1544.8,512.47}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterIP.Sp, ReheaterLP1.Ep)  annotation (Line(
-      points={{1008.8,512.81},{1008.8,549},{1072,549},{1072,451},{1192.4,451},{
-          1192.4,474.62}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(lumpedStraightPipe_LP3.C1, splitter_TurbineLP3.Cs2) annotation (Line(
-      points={{1474,264},{1474,81},{1473,81}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-
-  connect(ReheaterHP3.Ev, lumpedStraightPipe_Desu.C2)
-                                                     annotation (Line(
-      points={{493.6,481.32},{493.6,375.5},{297,375.5}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Desuperheater.Sc, lumpedStraightPipe_Desu.C1)
-    annotation (Line(
-      points={{-38.8,475.91},{-38.8,376},{252,376},{252,375.5}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Desuperheater.Ec, lumpedStraightPipe_IP1.C2)
-    annotation (Line(
-      points={{2.8,475.91},{2.8,364},{530,364},{530,317}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_HP1.Cs, splitter_Turbine_HP1.Ce)
-                                             annotation (Line(
-      points={{256.42,175},{256.42,173.5},{272,173.5},{272,176}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_Turbine_HP.Cs2, lumpedStraightPipe_HP.C1)
-                                                   annotation (Line(
-      points={{128,183.82},{128,275}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterHP1.Sp, ReheaterHP2.Ep) annotation (Line(
-      points={{187.2,445.83},{188,460},{188,474},{242,474},{242,392},{383.6,392},
-          {383.6,410.98}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterLP2.Ev, lumpedStraightPipe_LP2.C2) annotation (Line(
-      points={{1295.6,474.12},{1295.6,418.38},{1296,418.38},{1296,318}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_HP_IP.C2, splitter_TurbineIP3.Ce2) annotation (
-      Line(
-      points={{899,-8.5},{945,-8.5},{945,56.22}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_Turbine_HP1.Cs3, lumpedStraightPipe_HP_IP.C1) annotation (
-      Line(
-      points={{294,176},{294,-8.5},{868,-8.5}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_Turbine_HP1.Cs1, lumpedStraightPipe_HP1.C1) annotation (Line(
-      points={{283,167},{322,167},{322,264}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(generator.Wmec5,add. y) annotation (Line(
-      points={{48,-206},{48,-209},{75.1,-209}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Turbine_HP.MechPower,add. u1) annotation (Line(
-      points={{64.2,139.9},{64.2,-198.05},{94.9,-198.05},{94.9,-203.6}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_HP1.MechPower,add. u2) annotation (Line(
-      points={{260.2,139.9},{260.2,-214.4},{94.9,-214.4}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(generator.Wmec4,add1. y) annotation (Line(
-      points={{48,-230},{75,-230}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Turbine_IP1.MechPower,add1. u1) annotation (Line(
-      points={{452.7,40.9},{452.7,-222},{97,-222}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_IP2.MechPower,add1. u2) annotation (Line(
-      points={{658.7,40.95},{658.7,-230},{97,-230}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_IP3.MechPower,add1. u3) annotation (Line(
-      points={{858.7,40.9},{858.7,-238},{97,-238}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(generator.Wmec3,add2. y) annotation (Line(
-      points={{48,-254},{75.1,-254}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Turbine_LP1.MechPower,add2. u1) annotation (Line(
-      points={{1060.7,40.9},{1060.7,-246},{94.9,-246}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_LP2.MechPower,add2. u2) annotation (Line(
-      points={{1238.7,40.9},{1238.7,-254},{94.9,-254}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Turbine_LP3.MechPower,add2. u3) annotation (Line(
-      points={{1414.7,40.9},{1414.7,-262},{94.9,-262}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(Echappement.MechPower,generator. Wmec2) annotation (Line(
-      points={{1570.7,40},{1570.7,-278},{48,-278}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(controlValveHP.C2, Turbine_HP.Ce) annotation (Line(
-      points={{-121,173.6},{-34,173.6},{-34,175},{-24.42,175}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(sensorT.C2, controlValveHP.C1) annotation (Line(
-      points={{-179.78,173},{-151.89,173},{-151.89,173.6},{-157,173.6}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(constantIP.y, controlValveIP.Ouv)  annotation (Line(
-      points={{-121.8,292},{-140,292},{-140,287}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(controlValveIP.C2, Turbine_IP1.Ce) annotation (Line(
-      points={{-122,253},{-36,253},{-36,67},{395.73,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(genericCombustion.Cfg,splitter2_1. Ce) annotation (Line(
-      points={{-337,59.5},{-336,76},{-336,90},{-335,90}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(Boiler_walls.Cws1, Wall_screen.C2)          annotation (Line(
-      points={{-521,106},{-522,82},{-520,48}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter2_1.Cs1, Boiler_walls.Cfg1)   annotation (Line(
-      points={{-354,106.8},{-472,106.8},{-472,308},{-507.5,308}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(genericCombustion.Cth,heatExchangerWall. WT2) annotation (Line(
-      points={{-426.1,-17},{-454,-17},{-454,-18},{-457.6,-18}},
-      color={0,0,0},
-      smooth=Smooth.None));
-  connect(heatExchangerWall.WT1, Wall_screen.CTh)        annotation (Line(
-      points={{-472.4,-18},{-506.8,-18}},
-      color={0,0,0},
-      smooth=Smooth.None));
-  connect(SBT.Cfg1,RMT_RHT. Cfg2) annotation (Line(
-      points={{-296,318.5},{-296,270.5},{-297,270.5}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(RBT.Cfg1,SBT. Cfg2)      annotation (Line(
-      points={{-296,400},{-296,351.5}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(singularPressureLoss_RBT.C2,RMT_RHT. Cws1) annotation (Line(
-      points={{-416,415},{-418,415},{-418,253},{-348,253}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(SBT.Cws1, Boiler_walls.Cws2)   annotation (Line(
-      points={{-244,335},{-234,335},{-234,538},{-520,538},{-520,510},{-521,510}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(SMT_SHT.Cfg1,splitter2_1. Cs2) annotation (Line(
-      points={{-297,156.5},{-298,132},{-298,108},{-316,108},{-316,106.8}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(RMT_RHT.Cfg1,SMT_SHT. Cfg2) annotation (Line(
-      points={{-297,235.5},{-297,189.5}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(singularPressureLoss.C1, Boiler_walls.Cfg2)    annotation (Line(
-      points={{-496,565},{-550,565},{-550,308},{-534.5,308}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(Economiseur.Cfg2,mixer2_1. Ce2) annotation (Line(
-      points={{-296,511.5},{-296,564.8},{-316,564.8}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(RA.Sc,puitsFumeesPTQXA1. C)
-    annotation (Line(
-      points={{-358.4,-136.8},{-358.4,-138},{-392.54,-138}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(RA.Sf,genericCombustion. Ca)
-    annotation (Line(
-      points={{-338,-122},{-338,-93.5},{-337,-93.5}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(singularPressureLoss.C2, mixer2_1.Ce1)  annotation (Line(
-      points={{-472,565},{-458,565},{-458,564.8},{-356,564.8}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(mixer2_1.Cs,RA. Ec) annotation (Line(
-      points={{-336,590},{-564,590},{-564,-184},{-358.4,-184},{-358.4,-181.2}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(AirPreheater.Cs1,RA. Ef) annotation (Line(
-      points={{-348,-232},{-338,-232},{-338,-196}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(sourceAir.C, AirPreheater.Ce1)  annotation (Line(
-      points={{-394,-232},{-368,-232}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(heatSource.C[1],AirPreheater. Cth) annotation (Line(
-      points={{-358,-221.8},{-358,-232}},
-      color={0,0,0},
-      smooth=Smooth.None));
-  connect(singularPressureLoss_SBT.C2,volumeA. Ce1) annotation (Line(
-      points={{-400,335.5},{-400,173},{-390,173}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(volumeA1.Ce1,Economiseur. Cws2) annotation (Line(
-      points={{-366,496},{-348,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(fuelSourcePQ.C,genericCombustion. Cfuel) annotation (Line(
-      points={{-208,-60},{-208,-59.5},{-247.9,-59.5}},
-      color={0,0,0},
-      smooth=Smooth.None));
-
-  connect(Economiseur.Cfg1, RBT.Cfg2) annotation (Line(
-      points={{-296,480.5},{-296,430}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(controlValveEco.C1,volumeA1. Cs2) annotation (Line(
-      points={{-380.4,457},{-380.4,484},{-380,484}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(controlValveEco.C2,volumeA. Ce2) annotation (Line(
-      points={{-380.4,429},{-380.4,280},{-380,280},{-380,183.78}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TemperatureControl.MesureNiveauEau, sensorT.Measure) annotation (Line(
-      points={{-147.2,475.2},{-191,475.2},{-191,200}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TemperatureControl.ConsigneNiveauEau, constant_Temperature.y)
-    annotation (Line(
-      points={{-147.2,448.2},{-136,448.2},{-136,448},{-133.4,448}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(controlValveEco.Ouv, TemperatureControl.SortieReelle1) annotation (
-      Line(
-      points={{-356.6,443},{-276.625,443},{-276.625,442.8},{-180.8,442.8}},
-      color={0,0,255},
-      smooth=Smooth.None));
-
-  connect(genericCombustion.Cws, sourceQ.C) annotation (Line(
-      points={{-247.9,25.5},{-203.95,25.5},{-203.95,26},{-206,26}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(splitter_TurbineIP1.Cs2, lumpedStraightPipe_IP1.C1) annotation (Line(
-      points={{530,79},{530,264}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterIP.Ev, lumpedStraightPipe_IP3.C2) annotation (Line(
-      points={{945.2,475.76},{945.2,428.04},{945,428.04},{945,317}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterIP.Ee, ReheaterLP1.Se) annotation (Line(
-      points={{1031.06,494},{1040,496},{1040,493},{1100,493},{1106,494}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterLP1.Ee, ReheaterLP2.Se) annotation (Line(
-      points={{1215.08,494},{1222,496},{1222,493},{1272,493}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterLP2.Ee, ReheaterLP3.Se) annotation (Line(
-      points={{1391.18,493},{1396,496},{1396,493},{1452,493}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Q_flueGases_wall.y, splitter2_1.Ialpha1)
-                                              annotation (Line(
-      points={{-377.9,76},{-346.4,76},{-346.4,103.2}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterLP2.Sp, ReDrum.Ec)
-                                   annotation (Line(
-      points={{1366.4,512.47},{1366.4,605},{1758.4,605},{1758.4,516.14}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(loopBreakerP_ReDrum.C1, ReDrum.Sc)
-                                     annotation (Line(
-      points={{1776,550},{1706,550},{1706,545},{1705.6,545},{1705.6,516.14}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(loopBreakerP_ReDrum.C2, Drum_1.Ce1)
-                                         annotation (Line(
-      points={{1814,550},{1814,549},{1834,549},{1834,548.8},{1872,548.8}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(staticCentrifugalPump1.C1, Drum_2.Cs1)  annotation (Line(
-      points={{683,496},{712,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(loopBreakerP_Drum_2.C1, ReheaterHP3.Sp)
-                                            annotation (Line(
-      points={{742,594},{552,594},{552,513.17},{552.4,513.17}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(loopBreakerP_Drum_2.C2, Drum_2.Ce2)
-                                         annotation (Line(
-      points={{786,594},{834,594},{834,468},{774,468}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Drum_1.Cs1, loopBreakerP_Cond.C1)
-                                         annotation (Line(
-      points={{1926,548.8},{1928,548.8},{1928,311},{1930,311}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Sensor_Qvap_Cond.C2, Condenser.Cv)          annotation (Line(
-      points={{1689.6,39.74},{1689.6,45.87},{1691,45.87},{1691,30}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReDrum.Ef, lumpedStraightPipe_Low.C2)
-                                        annotation (Line(
-      points={{1798,494},{1830,494},{1830,317}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_Low.C1, controlValve_Condenser.C2)
-                                                annotation (Line(
-      points={{1830,263},{1830,-142},{1829.2,-142}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(controlValve_Condenser.C1, staticCentrifugalPump.C2)
-                                                     annotation (Line(
-      points={{1829.2,-178},{1829.2,-206},{1796,-206},{1796,-207}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ConsigneLevelCondenser1.y, regulation_Level_Condenser.ConsigneNiveauEau)
-    annotation (Line(points={{1894.2,-20},{1852,-20},{1852,-69.4},{1894.9,-69.4}}));
-  connect(Sensor_Qvap_Cond.Measure, regulation_Level_Condenser.MesureDebitVapeur)
-    annotation (Line(points={{1722.36,53},{1816,53},{1816,-96},{1856,-96},{
-          1895.12,-95.58}}));
-
-  connect(regulation_Level_Condenser.MesureDebitEau, Sensor_Qvap_Cond2.Measure)
-                                        annotation (Line(
-      points={{1894.79,-82.49},{1774,-82.49},{1774,-113},{1722.32,-113}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Condenser.yNiveau, regulation_Level_Condenser.MesureNiveauEau)
-    annotation (Line(
-      points={{1751.5,-57.72},{1860,-57.72},{1860,-56.2},{1894.9,-56.2}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(Sensor_Qvap_Cond2.C2, lumpedStraightPipe_Condenser2.C1)
-    annotation (Line(
-      points={{1693.2,-128.3},{1693.2,-125.13},{1694,-125.13},{1694,-148}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Sensor_Qvap_Cond2.C1, Condenser.Cl)          annotation (Line(
-      points={{1693.2,-98},{1694,-98},{1694,-72},{1692.1,-72}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_TurbineIP2.Cs1, Turbine_IP3.Ce) annotation (Line(
-      points={{760,67},{801.73,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_IP3.Cs, splitter_TurbineIP3.Ce1) annotation (Line(
-      points={{856.27,67},{932,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_TurbineLP3.Cs1, Echappement.Ce) annotation (Line(
-      points={{1486,67},{1513.73,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_Condenser1.C2, Sensor_Qvap_Cond.C1)
-    annotation (Line(
-      points={{1677,67},{1688,67},{1688,66},{1689.6,66}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Economiseur.Cws1, Desuperheater.Sf)
-                                     annotation (Line(
-      points={{-244,496},{-162,496},{-162,495.51},{-70,495.51}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(RBT.Cws1, lumpedStraightPipe_HP2.C2) annotation (Line(
-      points={{-244,415},{285,415},{285,319}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Echappement.Cs, splitter_condenser.Ce1) annotation (Line(
-      points={{1568.27,67},{1600,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_condenser.Cs1, lumpedStraightPipe_Condenser1.C1) annotation (
-     Line(
-      points={{1628,67},{1645,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(loopBreakerP_Cond.C2, splitter_condenser.Ce2)
-                                                    annotation (Line(
-      points={{1930,259},{1927,259},{1927,80.72},{1614,80.72}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(singularPressureLoss_Eco.C1, volumeA1.Cs1) annotation (Line(
-      points={{-416,496},{-412,496},{-412,497},{-406,497},{-406,496},{-394,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Wall_screen.C1, singularPressureLoss_Eco.C2)        annotation (Line(
-      points={{-520,-84},{-442,-84},{-442,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(ReheaterLP3.Ee, ReDrum.Sf)
-                                   annotation (Line(
-      points={{1569.16,493},{1615.55,493},{1615.55,494.54},{1666,494.54}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(volumeA.Cs1, SMT_SHT.Cws1) annotation (Line(
-      points={{-370,173},{-352,174},{-352,172},{-350,174},{-348,173}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_Turbine_HP.Cs3, Turbine_HP1.Ce) annotation (Line(
-      points={{140,175},{171.58,175}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_HP.Cs, splitter_Turbine_HP.Ce) annotation (Line(
-      points={{60.42,175},{116,175}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Drum_2.Ce1, ReheaterIP.Se) annotation (Line(
-      points={{774,496},{918,497},{918,495},{922,495},{924,494}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_HP2.C1, splitter_Turbine_HP1.Cs2) annotation (Line(
-      points={{285,263},{284,263},{284,184.82},{283,184.82}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(splitter_TurbineIP1.Cs1, Turbine_IP2.Ce) annotation (Line(
-      points={{542,67},{570,67},{570,67.5},{601.73,67.5}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_IP1.Cs, splitter_TurbineIP1.Ce1) annotation (Line(
-      points={{450.27,67},{518,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(Turbine_IP2.Cs, splitter_TurbineIP2.Ce1) annotation (Line(
-      points={{656.27,67.5},{694.14,67.5},{694.14,67},{732,67}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(lumpedStraightPipe_Condenser2.C2, staticCentrifugalPump.C1)
-    annotation (Line(
-      points={{1694,-180},{1694,-207},{1760,-207}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(controlValveIP.C1, RMT_RHT.Cws2) annotation (Line(
-      points={{-158,253},{-246,253}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(singularPressureLoss_RBT.C1, RBT.Cws2) annotation (Line(
-      points={{-390,415},{-348,415}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(singularPressureLoss_SBT.C1, SBT.Cws2) annotation (Line(
-      points={{-376,335.5},{-362,335.5},{-362,335},{-348,335}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(sensorT.C1, SMT_SHT.Cws2) annotation (Line(
-      points={{-202,173},{-246,173}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(controlValveHP.Ouv, constantHP.y) annotation (Line(
-      points={{-139,205.9},{-139,215},{-115.5,215}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(CheckValve.C1, splitter_TurbineIP2.Cs2)      annotation (Line(
-      points={{745,268.2},{746,268.2},{746,80}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(V_staticCentrifugalPump.y, staticCentrifugalPump.rpm_or_mpower)
-    annotation (Line(
-      points={{1741.4,-277},{1778,-277},{1778,-227.9}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(sensorQ.C2, ReheaterHP3.Ee) annotation (Line(
-      points={{605.8,496},{590,496},{590,497},{572.98,497}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(sensorQ.C1, staticCentrifugalPump1.C2) annotation (Line(
-      points={{626,496},{655,496}},
-      color={0,0,255},
-      smooth=Smooth.None,
-      thickness=0.5));
-  connect(sensorQ.Measure,Pump_VelocityControl. Mesure_Q_water) annotation (
-      Line(
-      points={{616,514.2},{616,614},{528,614},{528,694},{626.35,694},{626.35,
-          695.9}},
-      color={127,0,0},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash,
-      thickness=0.5));
-  connect(Pump_VelocityControl.SortieReelle1, pT1_1.u) annotation (Line(
-      points={{695.65,640.1},{704.825,640.1},{704.825,641},{711,641}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(pT1_1.y, staticCentrifugalPump1.rpm_or_mpower) annotation (Line(
-      points={{733,641},{733,642},{732,614},{670,614},{669,510.3}},
-      color={127,0,0},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash,
-      thickness=0.5));
-  connect(splitter_TurbineIP3.Cs1, Turbine_LP1.Ce) annotation (Line(
-      points={{958,67},{1003.73,67}},
-      color={255,0,0},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(Turbine_LP1.Cs, splitter_TurbineLP1.Ce1) annotation (Line(
-      points={{1058.27,67},{1112,67}},
-      color={255,0,0},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(splitter_TurbineLP1.Cs1, Turbine_LP2.Ce) annotation (Line(
-      points={{1136,67},{1181.73,67}},
-      color={255,0,0},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(RA.Kcorr, ramp_Kcor.y) annotation (Line(
-      points={{-314.2,-159},{-275.5,-159}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterHP3.Se, volume_HP2.Ce2) annotation (Line(
-      points={{474,497},{436,497}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP2.Cs2, ReheaterHP2.Ee) annotation (Line(
-      points={{426,487.2},{428,487.2},{428,429},{405.02,429}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP2.Cs1, ReheaterHP2_1.Ee) annotation (Line(
-      points={{426,506},{426,560},{405.02,560},{405.02,559}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1_1.Se, volume_HP1.Ce1) annotation (Line(
-      points={{104,559},{86,559},{86,506}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1.Se, volume_HP1.Ce2) annotation (Line(
-      points={{104,429},{86,429},{86,486}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP1.Cs2, Desuperheater.Ef) annotation (Line(
-      points={{76.2,496},{34,496}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1_1.Sp, ReheaterHP2_1.Ep) annotation (Line(
-      points={{187.2,575.83},{187.2,602},{244,602},{244,518},{383.6,518},{383.6,
-          540.98}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(lumpedStraightPipe_HP.C2, volume_HP1Vap.Ce1) annotation (Line(
-      points={{128,318},{128,332}},
-      color={255,0,0},
-      thickness=0.5,
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash));
-  connect(lumpedStraightPipe_HP1.C2, volume_HP1Vap1.Ce1) annotation (Line(
-      points={{322,318},{322,332}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP3.Cs2, singularPressureLoss1.C1) annotation (Line(
-      points={{507.8,565},{524,565}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(singularPressureLoss1.C2, ReheaterHP3.Ep) annotation (Line(
-      points={{544,565},{588,565},{588,461},{552.4,461},{552.4,480.34}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterHP2_1.Sp, singularPressureLoss2.C1) annotation (Line(
-      points={{383.6,576.49},{383.6,602},{433,602}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(singularPressureLoss2.C2, volume_HP3.Ce2) annotation (Line(
-      points={{453,602},{498,602},{498,575}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ReheaterHP2.Sp, singularPressureLoss3.C1) annotation (Line(
-      points={{383.6,446.49},{383.6,460},{384,460}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(singularPressureLoss3.C2, volume_HP3.Ce1) annotation (Line(
-      points={{384,480},{400,480},{400,516},{416,516},{416,528},{498,528},{498,
-          555}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(volume_HP1Vap1.Cs1, singularPressureLoss5.C1) annotation (Line(
-      points={{322,352},{322,372}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash,
-      thickness=0.5));
-  connect(singularPressureLoss5.C2, ReheaterHP2.Ev) annotation (Line(
-      points={{322,392},{322,412.04},{322.4,412.04}},
-      color={255,0,0},
-      smooth=Smooth.None,
-      pattern=LinePattern.Dash,
-      thickness=0.5));
-  connect(volume_HP1Vap1.Cs2, singularPressureLoss4.C1) annotation (Line(
-      points={{312,342},{292,342},{292,460}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(singularPressureLoss4.C2, ReheaterHP2_1.Ev) annotation (Line(
-      points={{292,480},{290,480},{290,524},{322.4,524},{322.4,542.04}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP1Vap.Cs1, singularPressureLoss6.C1) annotation (Line(
-      points={{128,352},{128,379}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(singularPressureLoss6.C2, ReheaterHP1.Ev) annotation (Line(
-      points={{128,399},{128,412.68},{124.8,412.68}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP1Vap.Cs2, singularPressureLoss7.C1) annotation (Line(
-      points={{118,342},{70,342},{70,460}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(singularPressureLoss7.C2, ReheaterHP1_1.Ev) annotation (Line(
-      points={{70,480},{70,526},{124.8,526},{124.8,542.68}},
-      color={255,0,0},
-      pattern=LinePattern.Dash,
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP21.Ce1, ReheaterHP2_1.Se) annotation (Line(
-      points={{266,559},{302,559}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1_1.Ee, volume_HP21.Cs1) annotation (Line(
-      points={{209.04,559},{246,559}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(ReheaterHP1.Ee, volume_HP22.Cs1) annotation (Line(
-      points={{209.04,429},{244,429}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(volume_HP22.Ce1, ReheaterHP2.Se) annotation (Line(
-      points={{264,429},{302,429}},
-      color={0,0,255},
-      thickness=0.5,
-      smooth=Smooth.None));
-  connect(Power_MW.y, MassFlowRateAirCoalWater.Electrical_power_MW) annotation (
-     Line(
-      points={{-371.5,689},{-384,689},{-384,706.24},{-444,706.24}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_3.y, fuelSourcePQ.IMassFlow) annotation (Line(
-      points={{-581.2,696.5},{-590,688},{-600,688},{-600,-272},{-174,-272},{
-          -174,-43}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_3.u, MassFlowRateAirCoalWater.Q_coal) annotation (Line(
-      points={{-554.8,696.5},{-523.4,696.5},{-523.4,697},{-492,697}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_2.y, sourceAir.IMassFlow) annotation (Line(
-      points={{-583.4,659.5},{-592,659.5},{-592,-218},{-419,-218}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_2.u, MassFlowRateAirCoalWater.Q_air) annotation (Line(
-      points={{-552.6,659.5},{-522.3,659.5},{-522.3,660.04},{-492,660.04}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(pT1_4.y,Pump_VelocityControl. Consigne_Q_water) annotation (Line(
-      points={{-342.7,649},{141.65,649},{141.65,649.4},{626.35,649.4}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(MassFlowRateAirCoalWater.Q_water, pT1_4.u) annotation (Line(
-      points={{-492,624.84},{-508,624.84},{-508,610},{-392,610},{-392,649},{-371.3,
-          649}},
-      color={0,0,255},
-      pattern=LinePattern.Dash,
-      smooth=Smooth.None));
-  connect(CheckValve.C2, Drum_2.Ce4) annotation (Line(
-      points={{745,307.8},{745,296.9},{743,296.9},{743,433}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(regulation_Level_Condenser.SortieReelle1, pT1_5.u) annotation (Line(
-      points={{1941.1,-95.8},{1954,-95.8},{1954,-128},{1752,-128},{1752,-160},{
-          1765,-160}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(pT1_5.y, controlValve_Condenser.Ouv) annotation (Line(
-      points={{1787,-160},{1800.3,-160}},
-      color={0,0,255},
-      smooth=Smooth.None));
-annotation (
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This is the dynamic model of a once-through supercritical coal-fired power plant. </p>
-<p>It is documented in Sect. 6.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Cecilia Rioual</li>
-</ul>
-</html>"),
-   Diagram(coordinateSystem(
-        preserveAspectRatio=true,
-        extent={{-600,-400},{2000,800}},
-        initialScale=0.1), graphics={Text(
-          extent={{80,134},{188,114}},
-          lineColor={0,0,255},
-          textString="Turbine_HP"),  Text(
-          extent={{385,18},{489,-2}},
-          lineColor={0,0,255},
-          textString="Turbine_IP"),  Text(
-          extent={{990,22},{1104,2}},
-          lineColor={0,0,255},
-          textString="Turbine_LP"),  Text(
-          extent={{-543,-104},{-492,-112}},
-          lineColor={0,0,255},
-          textString="Wall_screen"), Text(
-          extent={{-394,204},{-308,194}},
-          lineColor={0,0,255},
-          textString="SMT_SHT"),     Text(
-          extent={{-566,514},{-408,524}},
-          lineColor={0,0,255},
-          textString="Boiler_walls"),Text(
-          extent={{-394,282},{-306,272}},
-          lineColor={0,0,255},
-          textString="RMT_RHT"),     Text(
-          extent={{-384,354},{-334,344}},
-          lineColor={0,0,255},
-          textString="SBT"),         Text(
-          extent={{-384,432},{-334,422}},
-          lineColor={0,0,255},
-          textString="RBT"),         Text(
-          extent={{-382,526},{-332,513}},
-          lineColor={0,0,255},
-          textString="Eco"),         Text(
-          extent={{1426,542},{1540,522}},
-          lineColor={0,0,255},
-          textString="LP_RH3"),      Text(
-          extent={{1256,538},{1370,518}},
-          lineColor={0,0,255},
-          textString="LP_RH2"),      Text(
-          extent={{1088,538},{1202,518}},
-          lineColor={0,0,255},
-          textString="LP_RH1"),      Text(
-          extent={{902,540},{1016,520}},
-          lineColor={0,0,255},
-          textString="IP_RH"),       Text(
-          extent={{466,468},{580,448}},
-          lineColor={0,0,255},
-          textString="HP_RH3"),      Text(
-          extent={{290,502},{404,482}},
-          lineColor={0,0,255},
-          textString="HP_RH2"),      Text(
-          extent={{98,502},{212,482}},
-          lineColor={0,0,255},
-          textString="HP_RH1"),      Text(
-          extent={{-74,546},{40,526}},
-          lineColor={0,0,255},
-          textString="Desu"),
-        Text(
-          extent={{6,-226},{1248,-540}},
-          lineColor={28,108,200},
-          textString="New model DynamicExchangerWaterSteamFlueGases_New_hi
-Dp; h convectif")}),
-    experiment(StopTime=1200),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end SupercriticalPulverizedCoalPowerPlant;
+within ThermoSysPro.Fluid.Examples.Book.PowerPlants;
+model SupercriticalPulverizedCoalPowerPlant
+  "Model of a supercritical pulverized coal power plant"
+
+  parameter Integer NCEL = 7;
+
+  parameter Real dpfCorr=1.00
+    "Corrective term for the friction pressure loss (dpf) for each node";
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine    Turbine_HP(
+    eta_is_min=0.75,
+    W_fric=1,
+    Qmax=50,
+    eta_is(start=0.96),
+    eta_is_nom=0.94,
+    pros(d(start=35.19870673587873)),
+    Cst(fixed=false,
+      start=2001324.343046339)=
+                       2.00537e6,
+    Pe(start=26999999.985564, fixed=true))
+    annotation (Placement(transformation(extent={{-24,136},{60,214}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD splitter_Turbine_HP1(h(start=
+          3071530.861772407),
+    dynamic_mass_balance=true,
+    P(start=6401000),
+    Ce(Q(start=549.193976505918)))
+    annotation (Placement(transformation(extent={{272,185},{294,167}})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP2(
+    eta_stato=1,
+    mode_e=2,
+    mode_s=2,
+    mode_ps=2,
+    W_fric=1,
+    eta_is(start=0.94),
+    eta_is_nom=0.94,
+    Qmax=50,
+    pros(d(start=6.887350366974513)),
+    Cst(fixed=false,
+      start=53978.86314853486)=
+                       53802.6,
+    Pe(start=3799997.860026793,
+                      fixed=true))
+    annotation (Placement(transformation(extent={{602,38},{656,97}})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP2(
+    W_fric=1,
+    eta_stato=1,
+    eta_is_min=0.75,
+    Qmax=50,
+    eta_is_nom=0.91,
+    eta_is(start=0.91),
+    pros(d(start=0.3736533771704811)),
+    xm(start=0.9898250653294598),
+    Cst(fixed=false,
+      start=1220.138716068697)=
+                       1215.75,
+    Pe(start=299998.1114947147,
+                     fixed=true))
+                annotation (Placement(transformation(extent={{1182,38},{1236,96}},
+                    rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP1(
+    eta_stato=1,
+    eta_is_min=0.75,
+    mode_e=2,
+    mode_s=2,
+    mode_ps=2,
+    eta_is_nom=0.94,
+    eta_is(start=0.94),
+    W_fric=1,
+    Qmax=50,
+    pros(d(start=10.384234361858882)),
+    Cst(fixed=false,
+      start=102744.34781655352)=
+                       102478,
+    Pe(start=5999998.330854355,
+                             fixed=true))
+    annotation (Placement(transformation(extent={{396,38},{450,96}})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP1(
+    W_fric=1,
+    eta_stato=1,
+    eta_is_min=0.75,
+    Qmax=50,
+    eta_is_nom=0.91,
+    eta_is(start=0.91),
+    pros(d(start=1.390561376459253)),
+    Cst(fixed=false,
+      start=4501.927059584096)=
+                       4485.97,
+    Pe(start=729997.7575424919,
+                     fixed=true))
+                annotation (Placement(transformation(extent={{1004,38},{1058,96}},
+                    rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_IP3(
+    eta_stato=1,
+    eta_is_min=0.75,
+    mode_e=2,
+    mode_s=2,
+    mode_ps=2,
+    W_fric=1,
+    Qmax=50,
+    eta_is(start=0.94),
+    eta_is_nom=0.94,
+    pros(d(start=2.8084284519008316)),
+    Cst(fixed=false,
+      start=34193.21955188417)=
+                       34076.9,
+    Pe(start=2270000, fixed=true))
+    annotation (Placement(transformation(extent={{802,38},{856,96}})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Turbine_LP3(
+    W_fric=1,
+    eta_stato=1,
+    eta_is_min=0.75,
+    Qmax=50,
+    eta_is_nom=0.91,
+    eta_is(start=0.91),
+    pros(d(start=0.17053836551218424)),
+    xm(start=0.9624448460730977),
+    Cst(fixed=false,
+      start=59.44671753933515)=
+                       59.4076,
+    Pe(start=59999.53282881782,
+                    fixed=true),
+    Ps(start=25000))
+                annotation (Placement(transformation(extent={{1358,38},{1412,96}},
+                    rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine Echappement(
+    W_fric=1,
+    eta_stato=1,
+    xm(start=0.9213019144264654),
+    Qmax=50,
+    Cst(fixed=false,
+      start=14.295718727368532)=
+                       14.7,
+    eta_is(start=0.8),
+    eta_is_nom=0.91,
+    pros(d(start=0.04238683084570735)),
+    Pe(start=24999.77493390328,
+                    fixed=true),
+    Ps(start=5000))
+                annotation (Placement(transformation(extent={{1514,37},{1568,97}},
+                    rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP1(h(start=
+          3537588.8079320663))
+    annotation (Placement(transformation(extent={{518,79},{542,55}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP2(h(start=
+          3369888.816557468),
+      dynamic_mass_balance=true)
+    annotation (Placement(transformation(extent={{732,80},{760,54}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_IP3(
+                                                                       K(fixed=
+          false) = 10, Q(start=19.00114371733354,
+                                   fixed=true),
+    C2(P(start=580155.4529087848),h_vol(start=311761.22672647523)))
+    annotation (Placement(transformation(extent={{27,-21},{-27,21}}, rotation=270,
+        origin={945,290})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineIP3(
+      h(start=3059443.3348694695),
+                          P(start=774340))
+    annotation (Placement(transformation(extent={{932,78},{958,56}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP1(
+      h(start=2869360.296898901),
+                          P(start=190280))
+    annotation (Placement(transformation(extent={{1112,79},{1136,55}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP1(
+                                                                       K(fixed=
+          false) = 10, Q(start=28.001397928754212,
+                                   fixed=true),
+    C2(P(start=236489.70540554097)))
+    annotation (Placement(transformation(extent={{27,-20},{-27,20}}, rotation=270,
+        origin={1124,291})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP2(h(start=
+          2606190.1863981914))
+    annotation (Placement(transformation(extent={{1284,79},{1308,55}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP2(
+                     K(fixed=false) = 10, Q(start=9.0003750371771,
+                                                     fixed=true),
+    C2(P(start=44661.45635759075)))
+    annotation (Placement(transformation(extent={{-27,-21},{27,21}}, rotation=90,
+        origin={1296,291})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_TurbineLP3(                h(
+        start=2489005.0530445203),
+                          P(start=23000))
+    annotation (Placement(transformation(extent={{1460,81},{1486,53}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_LP3(
+    h(start=3.048e6),
+    K(fixed=false) = 10,
+    Q(start=16.000569587384174,
+                fixed=true),
+    C2(P(start=19457.45212821197),h_vol(start=225941.66047852393)))
+    annotation (Placement(transformation(extent={{27,-22},{-27,22}}, rotation=270,
+        origin={1474,291})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{1764,-54},{1826,-4}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceQ SourceCaloporteur(
+                 Q0=16400, h0=121652)
+                                 annotation (Placement(transformation(extent={{1562,
+            -54},{1614,-4}},       rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Condenser2(K=1e-4,
+      Pm(start=4999.990549904409),
+    C1(h_vol(start=137765.1189884895)),
+    C2(P(start=4999.981099808819),h_vol(start=137765.1189884895)))
+    annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=270,
+        origin={1694,-164})));
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleDynamicCondenser Condenser(
+    Vf0=0.15,
+    A=100,
+    ntubes=28700,
+    lambda=0.018,
+    Kvl=1,
+    V=1000,
+    steady_state=false,
+    continuous_flow_reversal=true,
+    yNiveau(signal(start=1.5, fixed=false)),
+    P0=5000,
+    P(start=5000),
+    Cv(Q(start=433.2001545496264)),
+    proe(d(start=994.1205995939429)))
+    annotation (Placement(transformation(extent={{1636,-72},{1746,30}})));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump(
+    C1(P(start=5000)),
+    a1(fixed=false) = -390,
+    a3=350,
+    C2(P(start=2699869.622037593,
+                        fixed=true), h_vol(start=140956.11701829222)),
+    Qv(start=0.43524240668307135),
+    h(start=139360.61800339087),
+    hn(start=276.1071665616722))
+    annotation (Placement(transformation(extent={{1760,-226},{1796,-188}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff ReDrum(
+    DTfroid(displayUnit="K") = 5,
+    Kf=305,
+    DPf(start=57524.2563411452),
+    Ec(h(start=311761.22672647523)),
+    Ef(h_vol(start=140956.11701829222)),
+    Sc(h_vol(start=150272.7724602458)),
+    Sf(h_vol(start=161833.76268010825)),
+    promc(d(start=985.5919033987386)))
+    annotation (Placement(transformation(extent={{1798,440},{1666,548}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP3(
+    SPurge=200,
+    KCond=1535.50,
+    KPurge=100,
+    Ep(Q(start=0.001)),
+    SCondDes=3255,
+    lambdaE=256,
+    Ee(P(start=2650000)),
+    P(start=25000),
+    HDesF(start=245425.15364009212),
+    HeiF(start=162682.43852863708),
+    Hep(start=248917.79589378808),
+    SDes(start=1E-009),
+    Se(
+      P(start=2511836.0997127844),
+      h(start=245425.15364009212),
+      h_vol(start=245425.15364009212)))
+    annotation (Placement(transformation(extent={{1568,552},{1452,434}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP2(
+    KCond=1530.50,
+    SPurge=482.5,
+    KPurge=109.55,
+    Se(P(start=2413894.9462802503),
+      h(start=306860.7316879813),
+      h_vol(start=306860.7316879813)),
+    lambdaE=512.2,
+    Ee(P(start=2600000)),
+    SCondDes=1477,
+    P(start=60000),
+    Ep(h(start=438607.090332969)),
+    HDesF(start=306860.7316879813),
+    HeiF(start=247625.18923762313),
+    Hep(start=328778.4878550007),
+    SDes(start=1E-009))
+    annotation (Placement(transformation(extent={{1390,552},{1272,434}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterLP1(
+    KCond=1530.50,
+    SPurge=504,
+    KPurge=155.7,
+    lambdaE=1258,
+    Ee(P(start=2500000)),
+    SCondDes=1408,
+    P(start=300000),
+    Ep(h(start=464182.2380411874)),
+    HDesF(start=455062.8963466834),
+    HeiF(start=313734.293691341),
+    Hep(start=501954.8282730701),
+    SDes(start=131.63162125559273),
+    Se(
+      P(start=2169310.5330650215),
+      h(start=465109.255940298),
+      h_vol(start=465109.255940298)))
+    annotation (Placement(transformation(extent={{1214,551},{1106,437}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterIP(
+    KCond=1730.50,
+    SPurge=239,
+    KPurge=2795,
+    lambdaE=885,
+    Ee(P(start=2250000)),
+    SCondDes=795,
+    P(start=730000),
+    HDesF(start=565579.5385524093),
+    HeiF(start=473909.76996909064),
+    Hep(start=664813.6284480324),
+    SDes(start=98.33315286951769),
+    Se(h(start=578948.0240115122), P(start=1992791.4733867273)))
+    annotation (Placement(transformation(extent={{1030,551},{924,437}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss pipePressureLoss_LP3_Drum(K=1e-4, pro(d(
+          start=986.1624696132673)))
+    annotation (Placement(transformation(extent={{1562,555},{1602,605}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeI Drum_1(h(start=167087.86591036225),
+                                                                  V=10)
+    annotation (Placement(transformation(extent={{1872,493},{1926,555}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_IP1(
+    h(start=3463.4e3),
+    K(fixed=false) = 10,
+    Q(start=25.00040036422368,
+                fixed=true),
+    Pm(start=3900000),
+    C2(h_vol(start=3537588.8079320663)))
+    annotation (Placement(transformation(extent={{26.5,-22},{-26.5,22}},
+                                                                     rotation=270,
+        origin={530,290.5})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeI Drum_2(
+    h(start=778321.3350751515),
+    V=200,
+    P(start=2070000))
+    annotation (Placement(transformation(extent={{774,433},{712,503}})));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1(
+                                                                               rm=0.7,
+    C2(Q(start=599.993976505918,
+                    fixed=true), P(start=32854107.921229515),
+      h_vol(start=827111.4901416934)),
+    C1(P(start=2070000)),
+    a1(fixed=false) = -3050,
+    a3=5000,
+    Qv(start=0.6740415564019792),
+    h(start=821565.0),
+    hn(start=3535.3592725080375))
+    annotation (Placement(transformation(extent={{683,509},{655,483}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP3(
+    Se(P(start=32900000), h(start=932438.8978014372)),
+    KPurge=1200,
+    lambdaE=1712,
+    SPurge=1098,
+    Ee(P(start=33600000), h_vol(start=827111.4901416933)),
+    KCond=1588,
+    SCondDes=750,
+    P(start=3771567.571218525),
+    HDesF(start=927325.1475293547),
+    HeiF(start=855187.674900425),
+    Hep(start=964242.0430144744),
+    SDes(start=79.82059037582069),
+    h(start=841102.4802107343))
+    annotation (Placement(transformation(extent={{572,546},{474,448}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Desu(
+    C2(P(start=3800000)),
+    C1(h_vol(start=2924612.095560695)),
+    K=1e-4,
+    Pm(start=3771567.5730999485))
+    annotation (Placement(transformation(extent={{22.5,-14.5},{-22.5,14.5}},
+                                                                     rotation=180,
+        origin={274.5,375.5})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP2(
+    lambdaE=1157,
+    Se(P(start=32400000), h(start=1168614.317235736)),
+    KCond=1588,
+    KPurge=1200,
+    SPurge=849,
+    SCondDes=1667.5,
+    P(start=5568798.758801826),
+    Ee(Q(start=299.99698825295724),
+                       h(start=932438.8978014372)),
+    Ep(P(start=8930425.05990273), h(start=1170923.9907383516)),
+    HDesF(start=1139894.576035795),
+    HeiF(start=977219.550756442),
+    Hep(start=1180774.7250052856),
+    SDes(start=337.2006466251369),
+    h(start=940451.6341612964))
+    annotation (Placement(transformation(extent={{404,482},{302,376}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP1(
+    h(start=3.07903e6),
+    K(fixed=false) = 10,
+    Q(start=61, fixed=true),
+    Pm(start=6401000))
+    annotation (Placement(transformation(extent={{27,-20},{-27,20}}, rotation=270,
+        origin={322,291})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating  ReheaterHP1(
+    KPurge=1279,
+    lambdaE=750,
+    Se(h(start=1338936.264843952),
+                         P(start=32050000)),
+    KCond=1588,
+    SCondDes=1692.5,
+    SPurge=1049,
+    P(start=10000000),
+    Ee(h(start=1168614.317235733)),
+    HDesF(start=1301805.3904686682),
+    HeiF(start=1184664.7287055368),
+    Hep(start=1360493.8691474798),
+    SDes(start=416.53928018645576))
+    annotation (Placement(transformation(extent={{208,480},{104,378}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff Desuperheater(
+    Sf(
+      Q(start=600),
+      h(start=1.369E6),
+      P(start=31940231.739229403),
+      h_vol(start=1364477.62662973)),
+    Ef(h(start=1338936.2648439475)),
+    promc(d(start=12.67201785254116)),
+    DTfroid(displayUnit="K") = 5,
+    Kf=10,
+    Tsf(start=580.3334486723465))
+    annotation (Placement(transformation(extent={{34,545},{-70,447}})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP(
+    h(start=3.19e6),
+    Q(fixed=true, start=50.8),
+    K(fixed=false) = 10,
+    Pm(start=10000000))
+    annotation (Placement(transformation(extent={{21.5,-18},{-21.5,18}},
+                                                                     rotation=270,
+        origin={128,296.5})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP_IP(
+    h(start=3.07903e6),
+    K(fixed=false) = 10,
+    Q(fixed=true, start=3),
+    Pm(start=6401000))
+    annotation (Placement(transformation(extent={{-15.5,-16.5},{15.5,16.5}},
+                                                                     rotation=0,
+        origin={883.5,-8.5})));
+  ThermoSysPro.WaterSteam.Machines.StodolaTurbine   Turbine_HP1(
+    eta_is_min=0.75,
+    W_fric=1,
+    Qmax=50,
+    eta_is(start=0.96),
+    eta_is_nom=0.92,
+    pros(d(start=24.64344118791907)),
+    Cst(fixed=false,
+      start=278836.9406128902)=
+                       279474,
+    Pe(start=10000000, fixed=true),
+    Ps(start=6401000))
+    annotation (Placement(transformation(extent={{172,136},{256,214}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD splitter_Turbine_HP(h(start=
+          3182580.38391812),
+    dynamic_mass_balance=true,
+    P(start=10000000))
+    annotation (Placement(transformation(extent={{116,184},{140,166}})));
+  ThermoSysPro.WaterSteam.Machines.Generator generator(eta=99.7)
+    annotation (Placement(transformation(extent={{48,-194},{-84,-314}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add
+                                          annotation (Placement(transformation(
+          extent={{94,-218},{76,-200}},
+                                    rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add3 add1
+                                          annotation (Placement(transformation(
+          extent={{96,-240},{76,-220}},
+                                    rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add3 add2
+                                          annotation (Placement(transformation(
+          extent={{94,-264},{76,-244}},
+                                    rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorT sensorT(C1(h_vol(start=
+            3474803.0992788016)),
+                                C2(h_vol(start=3474803.0992788034)))
+    annotation (Placement(transformation(extent={{-202,170},{-180,200}})));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveHP(
+                             C1(P(fixed=true, start=27019900)),
+    h(start=3.4756e6),
+    Cvmax(fixed=false) = 8005,
+    T(displayUnit="K", start=873.1))
+    annotation (Placement(transformation(extent={{-157,166},{-121,204}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constantHP(k=0.5)
+    annotation (Placement(transformation(extent={{-84,200},{-114,230}})));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveIP(Cvmax(
+        fixed=false) = 8005,
+    h(start=3.70545e6),
+    C1(P(fixed=true, start=6009998.640295431),
+                                     h_vol(start=3701594.2696911553)))
+    annotation (Placement(transformation(extent={{-158,245},{-122,285}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constantIP(k=0.5)
+    annotation (Placement(transformation(extent={{-84,274},{-120,310}})));
+  ThermoSysPro.Combustion.CombustionChambers.GenericCombustion1D
+    genericCombustion(
+    EPSPAR=0.4,
+    ImbCV=0.01,
+    ImbBF=0.007,
+    Kec=15,
+    SM={635.7,635.7,635.7,635.7,635.7,635.7,635.7},
+    Psf,
+    Tea(start=577.3294631233695),
+    Tpi(start={662.130125894802,685.614566355283,696.9408592330145,
+          703.5449672340172,712.7782107613066,727.9340239141302,
+          750.6768400836096}),
+    Tsf(start=1501.2484101541468),
+    deltaPccb(start=2223.1944617307236))
+                      annotation (Placement(transformation(extent={{-238,-102},
+            {-436,68}},
+                      rotation=0)));
+
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe Wall_screen(
+    Ns=NCEL,
+    L=65,
+    ntubes=912,
+    mode=0,
+    z2=65,
+    D=0.034,
+    option_temperature=2,
+    P(start={30342043.891952675,30282117.04096996,30227397.738711014,
+          30178994.328953177,30137426.097264428,30101658.687952235,
+          30069281.864402287,30038017.722720534,30006184.603574578}),
+    Q(start={597.6590942672652,597.6590942672652,597.6590942672652,
+          597.6590942672652,597.6590942672652,597.6590942672652,
+          597.6590942672652,597.6590942672652}),
+    h(start={1479747.0728819133,1653147.2981052676,1836593.6418651666,
+          2019276.7199909666,2201503.0794841815,2383076.101933648,
+          2563538.204063644,2742239.471375197,2742239.471375197}),
+    mu2(start={8.337682531388398E-05,7.290904575803869E-05,6.19675832347849E-05,
+          5.107649475602911E-05,4.1856937780558395E-05,3.577140353596319E-05,
+          3.242959431491525E-05,3.102497852505804E-05}),
+    pro2(d(start={696.792093597009,625.1171632839697,535.5755100207667,
+            432.7397163943108,333.50837586843403,256.1304727342381,
+            200.77652123807803,161.8541988249301})))
+                  annotation (Placement(transformation(extent={{-66,44},{66,-44}},
+                   rotation=90,
+        origin={-520,-18})));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    Ns=NCEL,
+    lambda=40,
+    L=65,
+    e=0.008,
+    ntubes=912,
+    D=0.034,
+    Tp(start={653.6406823320823,676.633278239129,687.9969395834568,
+          694.6234079190576,703.8886379558984,719.0988402846453,
+          741.927864576376}))
+              annotation (Placement(transformation(
+        extent={{-66,37},{66,-37}},
+        rotation=90,
+        origin={-465,-18})));
+  ThermoSysPro.FlueGases.Junctions.Splitter2 splitter2_1 annotation (Placement(
+        transformation(
+        extent={{-12,-19},{12,19}},
+        rotation=90,
+        origin={-335,102})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases
+    Boiler_walls(
+    Ns=3,
+    ExchangerWall(lambda=40, e=8e-3,
+      Tp(start={718.6571040634899,718.1194034334801,717.724499487972}),
+      Tp1(start={717.5714868892015,717.6719267649172,717.5487415294846})),
+    Dint=34e-3,
+    Ntubes=912,
+    L=40,
+    z2=40,
+    ExchangerFlueGasesMetal(St=292.41, Dext=50e-3,
+      DeltaT(start={554.0628991212207,228.3772089692427,89.70101646279409}),
+      T(start={1501.2484130859375,1045.9831048360795,847.7485555139816,
+            767.3925170898438}),
+      Tm(start={1273.6157574951133,946.8658301750306,807.5705357170625})),
+    TwoPhaseFlowPipe(rugosrel=0.0014,
+      P(start={30006184.0,29959265.487962805,29911856.28834493,
+            29864219.536209688,29816476.0}),
+      h(start={2742239.5,2768510.843637918,2779339.5468098293,2783592.798199836,
+            2783592.75})),
+    Cws2(P(start=29816475.42940753),h_vol(start=2783592.798199836)))
+    annotation (Placement(transformation(extent={{202,-27},{-202,27}},
+        rotation=-90,
+        origin={-521,308})));
+  ThermoSysPro.FlueGases.BoundaryConditions.Sink puitsFumeesPTQXA1(T(start=
+          398.86640471653106))
+    annotation (Placement(transformation(extent={{-392,-166},{-446,-110}},
+                                                                     rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases RMT_RHT(
+    Ns=3,
+    L=17.1,
+    ExchangerWall(lambda=40, e=6e-3,
+      Tp(start={908.5197253834301,914.4577273376398,917.7248494787165}),
+      Tp1(start={906.7665349453516,913.5361998085987,917.2460906463742})),
+    Dint=54.5e-3,
+    Ntubes=4900,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=66.5e-3,
+      step_T=0.22,
+      step_L=0.9619,
+      DeltaT(start={215.99646104532553,113.53397822935688,58.984016359030534}),
+      T(start={1189.486083984375,1062.720872868754,994.9311731733584,
+            959.3534545898438}),
+      Tm(start={1126.1034611836415,1028.8260230210562,977.1423166436323})),
+    Cws2(h(start=3.7057e6), P(start=6000000)),
+    TwoPhaseFlowPipe(rugosrel=0.0015,
+      P(start={6010948.5,6010749.460821071,6010514.567152408,6010261.309075393,
+            6009998.5}),
+      h(start={3264769.75,3507624.3814902483,3635275.8367294283,
+            3701594.2696911553,3701594.25})),
+    Cws1(P(start=6010948.472475457),h_vol(start=3264769.660736534)))
+    annotation (Placement(transformation(extent={{-348,288},{-246,218}})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases SBT(
+    Ns=3,
+    L=17.1,
+    Dint=38.3e-3,
+    TwoPhaseFlowPipe(rugosrel=0.0145,
+      P(start={29816474.0,29814038.312406328,29811347.95808922,
+            29808483.096597232,29805500.0}),
+      h(start={2783592.75,2877312.3915758613,2940320.6561487615,
+            2982465.835108181,2982465.75})),
+    ExchangerWall(lambda=40, e=6.5e-3,
+      Tp(start={749.7844520576,755.6415626459205,759.6971986304427}),
+      Tp1(start={747.8691146804046,754.3538694340593,758.8358820836914})),
+    Ntubes=3200,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=51.3e-3,
+      step_L=0.7,
+      DeltaT(start={176.62815353948065,118.74820438652762,79.42869651947797}),
+      T(start={959.3534545898438,896.7825168405388,854.222865602998,
+            825.5177612304688}),
+      Tm(start={928.0679884772226,875.5026912217684,839.8703116077473})),
+    Cws2(h_vol(start=2982465.835108181)))
+    annotation (Placement(transformation(extent={{-244,368},{-348,302}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_SBT(K(fixed=
+          false) = 910.878, C1(P(fixed=true, start=29805500)))
+    annotation (Placement(transformation(extent={{-376,321},{-400,350}})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases RBT(
+    Ns=3,
+    L=17.1,
+    TwoPhaseFlowPipe(rugosrel=0.0028,
+      P(start={6401069.0,6400829.006029598,6400559.967505192,6400281.512735571,
+            6400000.0}),
+      h(start={3071530.75,3206249.001381632,3250421.0375270667,
+            3264769.6607365347,3264769.75})),
+    ExchangerWall(lambda=40, e=7.5e-3,
+      Tp(start={731.5611188100817,719.1011974452427,714.9322174305115}),
+      Tp1(start={730.6241511341694,718.7939799453013,714.8324224349741})),
+    Dint=45.7e-3,
+    Ntubes=7400,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=60.7e-3,
+      step_L=0.7,
+      DeltaT(start={55.41873058878309,18.170961815555074,5.902564318895884}),
+      T(start={825.5177612304688,750.0683189765095,725.0092641729291,
+            716.83349609375}),
+      Tm(start={787.793038294503,737.5387915747193,720.9213932561836})),
+    Cws1(P(start=6401069.169670619),
+                             h_vol(start=3071530.861772407)),
+    Cws2(h_vol(start=3264769.660736535)))
+    annotation (Placement(transformation(extent={{-244,445},{-348,385}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_RBT(K(fixed=
+          false) = 34.39, C1(P(fixed=true, start=6400000)))
+    annotation (Placement(transformation(extent={{-390,401},{-416,429}})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases Economiseur(
+    Ns=3,
+    L=17.1,
+    ExchangerWall(lambda=40, e=7e-3,
+      Tp(start={597.8632830911926,601.9643838890306,604.4388143032807}),
+      Tp1(start={597.0798518240282,601.4765869344108,604.1356180309247})),
+    TwoPhaseFlowPipe(rugosrel=0.0015,
+      P(start={31940232.0,31940175.652893864,31940118.025039315,
+            31940059.354486804,31940000.0}),
+      h(start={1364477.625,1421835.5302184983,1457548.9512506293,
+            1479747.0728819133,1479747.125})),
+    Dint=37.1e-3,
+    Ntubes=5300,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=48.3e-3,
+      step_L=0.7,
+      DeltaT(start={97.96280056397143,60.995722003917535,37.91265067585584}),
+      T(start={716.83349609375,676.15417968096,650.5975916707414,
+            634.6221923828125}),
+      Tm(start={696.493851010199,663.3758856758507,642.6098980814818})))
+    annotation (Placement(transformation(extent={{-244,527},{-348,465}})));
+  ThermoSysPro.MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases SMT_SHT(
+    L=17.1,
+    TwoPhaseFlowPipe(rugosrel=0.0015,
+      P(start={27030444.0,27028361.67511348,27025839.239372097,
+            27022989.150393303,27019900.0}),
+      h(start={2976603.0,3194812.5584599497,3356176.887995873,3474803.099278803,
+            3474803.0})),
+    ExchangerWall(lambda=40, e=8e-3,
+      Tp(start={854.8283610087926,887.434475626394,912.4750108334613}),
+      Tp1(start={846.3932984841808,881.1968091408571,907.8894202971029})),
+    Dint=37.9e-3,
+    Ntubes=2075,
+    ExchangerFlueGasesMetal(
+      St=292.41,
+      Dext=53.9e-3,
+      step_T=0.22,
+      step_L=1.016,
+      DeltaT(start={571.7995516807581,422.84154854302676,310.84993208179515}),
+      T(start={1501.2484130859375,1366.1601385670497,1264.857744235079,
+            1189.486083984375})),
+    Cws2(P(start=27000000), h(start=3.4751e6)),
+    Ns=3)
+    annotation (Placement(transformation(extent={{-348,206},{-246,140}})));
+  ThermoSysPro.FlueGases.PressureLosses.InvSingularPressureLoss singularPressureLoss
+                          annotation (Placement(transformation(extent={{-496,
+            551},{-472,579}},
+                       rotation=0)));
+  ThermoSysPro.FlueGases.Junctions.Mixer2 mixer2_1(T(start=639.3587532777143))
+                                                   annotation (Placement(
+        transformation(
+        extent={{-18,-20},{18,20}},
+        rotation=90,
+        origin={-336,572})));
+  ThermoSysPro.FlueGases.HeatExchangers.StaticFluegasesFluegasesExchangerKS RA(
+    DPc(displayUnit="bar") = 0.01,
+    K=350,
+    S=7475,
+    DPf=0.01,
+    Tsc(displayUnit="degC", start=401.15),
+    Tsf(start=573.15, displayUnit="degC"))
+    annotation (Placement(transformation(extent={{-37,34},{37,-34}},
+        rotation=90,
+        origin={-338,-159})));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourcePQ sourceAir(
+    Xh2o=0.016,
+    Xo2=0.206,
+    Xco2=0,
+    Q0=708,
+    P0=101000,
+    T0=288.15)
+    annotation (Placement(transformation(extent={{-444,-260},{-394,-204}})));
+  ThermoSysPro.FlueGases.Volumes.VolumeATh AirPreheater(h(start=72890))
+    annotation (Placement(transformation(extent={{-368,-242},{-348,-222}})));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={305.15})
+    annotation (Placement(transformation(extent={{-368,-222},{-348,-202}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA1(                   h(start=
+          1479747.0728819133),
+                      P(start=32000000),
+    Cs2(Q(start=2.340852247894304)))
+    annotation (Placement(transformation(extent={{-366,484},{-394,508}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(
+    h(start=2976603.0385964634),
+    dynamic_mass_balance=true,
+    P(start=27030443.91251134))
+    annotation (Placement(transformation(extent={{-390,162},{-370,184}})));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ sourceQ(
+                                                             Q0=0, P0=100000)
+    annotation (Placement(transformation(extent={{-144,-8},{-206,60}}, rotation=
+           0)));
+  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    rho=1200,
+    Hum=0.03,
+    T0(displayUnit="K") = 288.15,
+    Xc=0.6652,
+    Xh=0.0378,
+    Xo=0.0546,
+    Xn=0.0156,
+    Xs=0.0052,
+    Xashes=0.1415,
+    Vol=0.229,
+    Q0=65.765,
+    LHV=26030e3)
+    annotation (Placement(transformation(extent={{-140,-94},{-208,-26}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValveEco(
+    T(displayUnit="K"),
+    Cvmax(fixed=true) = 200,
+    Q(start=2.35, fixed=false))
+                             annotation (Placement(transformation(
+        extent={{14,14},{-14,-14}},
+        rotation=90,
+        origin={-372,443})));
+  ThermoSysPro.Examples.Control.TemperatureControl TemperatureControl(
+    Ti=5,
+    pIsat(Ti=20, Limiteur1(u(signal(start=-0.028450421536047304)))),
+    add(k1=+1, k2=-1))
+    annotation (Placement(transformation(extent={{-148,441},{-180,477}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constant_Temperature(k=873.15)
+    annotation (Placement(transformation(extent={{-104,435},{-132,461}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Q_flueGases_wall(k=
+        0.03506165)
+    annotation (Placement(transformation(extent={{-422,60},{-380,92}})));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_Drum_2
+                                                                 annotation (
+      Placement(transformation(
+        extent={{22,-20},{-22,20}},
+        rotation=180,
+        origin={764,594})));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_ReDrum
+                                                                 annotation (
+      Placement(transformation(
+        extent={{19,-19},{-19,19}},
+        rotation=180,
+        origin={1795,550})));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP loopBreakerP_Cond
+                                                                 annotation (
+      Placement(transformation(
+        extent={{26,-26},{-26,26}},
+        rotation=90,
+        origin={1930,285})));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ Sensor_Qvap_Cond(C1(h_vol(start=
+            1957787.8431100189)))
+    annotation (Placement(transformation(
+        origin={1704,53},
+        extent={{-13,-18},{13,18}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ Sensor_Qvap_Cond2
+    annotation (Placement(transformation(
+        origin={1706,-113},
+        extent={{-15,-16},{15,16}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Low(mode=1, K=
+       1e-4,
+    C1(h_vol(start=140956.11701829222), P(start=2617886.004032243)),
+    Pm(start=2617885.994610223))
+                 annotation (Placement(transformation(extent={{-27,-24},{27,24}},
+                    rotation=90,
+        origin={1830,290})));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve_Condenser(
+    mode=1,
+    Cvmax=2000,
+    C2(P(start=2696400)))
+    annotation (Placement(transformation(
+        extent={{-18,-17},{18,17}},
+        rotation=90,
+        origin={1819,-160})));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneLevelCondenser1(k=1.5)
+    annotation (Placement(transformation(extent={{1932,-38},{1896,-2}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Level_Condenser(
+    add(k1=+1, k2=-1),
+    pIsat(
+      Ti=200,
+      minval=0.3,
+      Limiteur1(u(signal(start=0.8)))),
+    pIsat1(Ti=100, minval=0.3),
+    edge(uL(signal(start=true))))
+                                annotation (Placement(transformation(extent={{
+            1896,-98},{1940,-54}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_Condenser1(
+                                                                                       K=1e-4, Pm(start=
+          5191.555663955529))
+    annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=0,
+        origin={1661,67})));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss lumpedStraightPipe_HP2(
+    h(start=3.07903e6),
+    K(fixed=false) = 1e-4,
+    Pm(start=6401000),
+    C1(P(fixed=true, start=6401100)))
+    annotation (Placement(transformation(extent={{28,-19},{-28,19}}, rotation=270,
+        origin={285,291})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA splitter_condenser(h(start=
+          1957787.8431100189),
+    h0=1.959e6,
+    P0=538300000,
+    P(start=5000))
+    annotation (Placement(transformation(extent={{1600,53},{1628,81}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss singularPressureLoss_Eco(K(fixed=
+          false) = 3867, C1(P(fixed=true, start=31940000)))
+    annotation (Placement(transformation(extent={{-416,482},{-442,510}})));
+  ThermoSysPro.WaterSteam.PressureLosses.CheckValve CheckValve(
+    Qmin=1,
+    Q(fixed=true, start=30.011367796945933),
+    k(fixed=false) = 100,
+    touvert(start=true))
+    annotation (Placement(transformation(
+        extent={{-18,-16},{18,16}},
+        rotation=90,
+        origin={745,288})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps V_staticCentrifugalPump(Table=[0,
+        1400; 100,1400; 700,1000; 800,950; 900,950; 1000,950])
+                   annotation (Placement(transformation(extent={{1670,-310},{
+            1738,-244}}, rotation=0)));
+  ThermoSysPro.Examples.Control.MassFlowControl Pump_VelocityControl(
+    pT1_1(k=1, Ti=1),
+    Ti=5,
+    maxval=1400,
+    pIsat(Limiteur1(u(signal(start=1400.006776094082)))))
+    annotation (Placement(transformation(extent={{628,637},{694,699}})));
+  ThermoSysPro.WaterSteam.Sensors.SensorQ sensorQ
+    annotation (Placement(transformation(extent={{626,494},{606,514}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(
+    k=1,
+    U0=1400,
+    permanent=true,
+    Ti=10)
+    annotation (Placement(transformation(extent={{712,631},{732,651}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp_Kcor(
+    Starttime=100,
+    Duration=600,
+    Initialvalue=1,
+    Finalvalue=0.5)
+    annotation (Placement(transformation(extent={{-244,-170},{-274,-148}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP1(
+    h0=850000,
+    dynamic_mass_balance=true,
+    P0=32200000,
+    P(start=31945061.30060599),
+    h(start=1338936.2648439475),
+    Ce1(h(start=1338936.264843952)))
+                     annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=-90,
+        origin={86,496})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterHP1_1(
+    KPurge=1279,
+    lambdaE=750,
+    Se(h(start=1.369e6), P(start=32050000)),
+    KCond=1588,
+    SCondDes=1692.5,
+    SPurge=1049,
+    P(start=8930425.05990273),
+    Ee(h(start=1168614.3172357369)),
+    Ev(Q(start=25.40000000000056)),
+    HDesF(start=1301805.3904686691),
+    HeiF(start=1184664.7287055398),
+    Hep(start=1360493.8691474795),
+    SDes(start=416.5392801864518),
+    Sp(h(start=1170923.990738357)),
+    h(start=940451.6341612969))
+    annotation (Placement(transformation(extent={{208,610},{104,508}})));
+  ThermoSysPro.WaterSteam.HeatExchangers.NTUWaterHeating ReheaterHP2_1(
+    lambdaE=1157,
+    Se(P(start=32400000), h(start=1168614.317235736)),
+    KCond=1588,
+    KPurge=1200,
+    SCondDes=1667.5,
+    SPurge=849,
+    P(start=5568798.758801826),
+    Ee(h(start=932438.8978014372)),
+    Ev(Q(start=30.499999999999968)),
+    HDesF(start=1139894.576035795),
+    HeiF(start=977219.5507564419),
+    Hep(start=1180774.725005288),
+    SDes(start=337.20064662513767))
+    annotation (Placement(transformation(extent={{404,612},{302,506}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP2(
+    h0=820000,
+    h(start=932438.8978014372),
+    dynamic_mass_balance=true,
+    P0=32400000,
+    P(start=32156093.56417011))
+    annotation (Placement(transformation(extent={{416,487},{436,507}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeB volume_HP3(
+    h0=990400,
+    h(start=940451.6341612943),
+    P0=6400171,
+    P(start=5568798.758431694))
+                      annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={498,565})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP1Vap(
+    h0=990400,
+    dynamic_mass_balance=true,
+    h(start=3182580.38391812),
+    P0=10000000,
+    P(start=8930425.061957654))
+                       annotation (Placement(transformation(
+        extent={{-10,10},{10,-10}},
+        rotation=90,
+        origin={128,342})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP1Vap1(
+    h0=990400,
+    dynamic_mass_balance=true,
+    h(start=3071530.861772407),
+    P0=6400171,
+    P(start=5568798.763146943))
+                      annotation (Placement(transformation(
+        extent={{-10,10},{10,-10}},
+        rotation=90,
+        origin={322,342})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=1e-4, pro(d(start=844.2396226650313)))
+    annotation (Placement(transformation(extent={{524,555},{544,575}})));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerP singularPressureLoss2
+    annotation (Placement(transformation(extent={{433,592},{453,612}})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={384,470})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={292,470})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={322,382})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss6(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={128,389})));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss
+    singularPressureLoss7(K=1e-4) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={70,470})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP21(
+    h0=1168600,
+    h(start=1168614.3172357369),
+    P0=32060000,
+    dynamic_mass_balance=true,
+    P(start=32031852.891034454))
+    annotation (Placement(transformation(extent={{266,549},{246,569}})));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volume_HP22(
+    h0=1168600,
+    h(start=1168614.317235733),
+    P0=32060000,
+    dynamic_mass_balance=true,
+    P(start=32031852.513327856))
+    annotation (Placement(transformation(extent={{264,419},{244,439}})));
+  ThermoSysPro.Examples.Control.MassFlowRateAirCoalWater
+    MassFlowRateAirCoalWater
+    annotation (Placement(transformation(extent={{-408,620},{-488,708}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Power_MW(
+    Starttime=100,
+    Duration=600,
+    Initialvalue=804.461,
+    Finalvalue=399.8)
+    annotation (Placement(transformation(extent={{-340,678},{-370,700}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_2(
+    k=1,
+    permanent=true,
+    U0=708,
+    Ti=5)
+    annotation (Placement(transformation(extent={{-554,648},{-582,671}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_3(
+    k=1,
+    permanent=true,
+    U0=804,
+    Ti=5)
+    annotation (Placement(transformation(extent={{-556,684},{-580,709}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_4(
+    k=1,
+    permanent=true,
+    U0=600,
+    Ti=5)
+    annotation (Placement(transformation(extent={{-370,636},{-344,662}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_5(
+    k=1,
+    permanent=true,
+    U0=0.8,
+    Ti=10)
+    annotation (Placement(transformation(extent={{1766,-170},{1786,-150}})));
+equation
+
+  connect(lumpedStraightPipe_IP3.C1, splitter_TurbineIP3.Cs2) annotation (Line(
+      points={{945,263},{945,78}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_LP2.Cs, splitter_TurbineLP2.Ce1) annotation (Line(
+      points={{1236.27,67},{1284,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_TurbineLP2.Cs1, Turbine_LP3.Ce) annotation (Line(
+      points={{1308,67},{1357.73,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_LP2.C1, splitter_TurbineLP2.Cs2) annotation (Line(
+      points={{1296,264},{1296,79}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_LP3.Cs, splitter_TurbineLP3.Ce1) annotation (Line(
+      points={{1412.27,67},{1460,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(SourceCaloporteur.C, Condenser.Cee) annotation (Line(
+      points={{1614,-29},{1616,-29},{1616,-32.22},{1636,-32.22}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Condenser.Cse, PuitsCaloporteur.C) annotation (Line(
+      points={{1746,-31.2},{1741,-31.2},{1741,-29},{1764,-29}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(lumpedStraightPipe_LP3.C2, ReheaterLP3.Ev) annotation (Line(
+      points={{1474,318},{1474,474.12},{1475.2,474.12}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_LP1.C2, ReheaterLP1.Ev) annotation (Line(
+      points={{1124,318},{1124,475.76},{1127.6,475.76}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterLP1.Sp, ReheaterLP2.Ep) annotation (Line(
+      points={{1192.4,512.81},{1192.4,555},{1248,555},{1248,453},{1366.4,453},{
+          1366.4,472.94}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(lumpedStraightPipe_LP1.C1, splitter_TurbineLP1.Cs2) annotation (Line(
+      points={{1124,264},{1124,79}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Drum_1.Ce3, pipePressureLoss_LP3_Drum.C2)
+                                             annotation (Line(
+      points={{1872,499.2},{1852,499.2},{1852,580},{1602,580}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(pipePressureLoss_LP3_Drum.C1, ReheaterLP3.Sp)
+                                                annotation (Line(
+      points={{1562,580},{1544.8,580},{1544.8,512.47}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterIP.Sp, ReheaterLP1.Ep)  annotation (Line(
+      points={{1008.8,512.81},{1008.8,549},{1072,549},{1072,451},{1192.4,451},{
+          1192.4,474.62}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(lumpedStraightPipe_LP3.C1, splitter_TurbineLP3.Cs2) annotation (Line(
+      points={{1474,264},{1474,81},{1473,81}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+
+  connect(ReheaterHP3.Ev, lumpedStraightPipe_Desu.C2)
+                                                     annotation (Line(
+      points={{493.6,481.32},{493.6,375.5},{297,375.5}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Desuperheater.Sc, lumpedStraightPipe_Desu.C1)
+    annotation (Line(
+      points={{-38.8,475.91},{-38.8,376},{252,376},{252,375.5}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Desuperheater.Ec, lumpedStraightPipe_IP1.C2)
+    annotation (Line(
+      points={{2.8,475.91},{2.8,364},{530,364},{530,317}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_HP1.Cs, splitter_Turbine_HP1.Ce)
+                                             annotation (Line(
+      points={{256.42,175},{256.42,173.5},{272,173.5},{272,176}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_Turbine_HP.Cs2, lumpedStraightPipe_HP.C1)
+                                                   annotation (Line(
+      points={{128,183.82},{128,275}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterHP1.Sp, ReheaterHP2.Ep) annotation (Line(
+      points={{187.2,445.83},{188,460},{188,474},{242,474},{242,392},{383.6,392},
+          {383.6,410.98}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterLP2.Ev, lumpedStraightPipe_LP2.C2) annotation (Line(
+      points={{1295.6,474.12},{1295.6,418.38},{1296,418.38},{1296,318}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_HP_IP.C2, splitter_TurbineIP3.Ce2) annotation (
+      Line(
+      points={{899,-8.5},{945,-8.5},{945,56.22}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_Turbine_HP1.Cs3, lumpedStraightPipe_HP_IP.C1) annotation (
+      Line(
+      points={{294,176},{294,-8.5},{868,-8.5}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_Turbine_HP1.Cs1, lumpedStraightPipe_HP1.C1) annotation (Line(
+      points={{283,167},{322,167},{322,264}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(generator.Wmec5,add. y) annotation (Line(
+      points={{48,-206},{48,-209},{75.1,-209}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Turbine_HP.MechPower,add. u1) annotation (Line(
+      points={{64.2,139.9},{64.2,-198.05},{94.9,-198.05},{94.9,-203.6}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_HP1.MechPower,add. u2) annotation (Line(
+      points={{260.2,139.9},{260.2,-214.4},{94.9,-214.4}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(generator.Wmec4,add1. y) annotation (Line(
+      points={{48,-230},{75,-230}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Turbine_IP1.MechPower,add1. u1) annotation (Line(
+      points={{452.7,40.9},{452.7,-222},{97,-222}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_IP2.MechPower,add1. u2) annotation (Line(
+      points={{658.7,40.95},{658.7,-230},{97,-230}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_IP3.MechPower,add1. u3) annotation (Line(
+      points={{858.7,40.9},{858.7,-238},{97,-238}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(generator.Wmec3,add2. y) annotation (Line(
+      points={{48,-254},{75.1,-254}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Turbine_LP1.MechPower,add2. u1) annotation (Line(
+      points={{1060.7,40.9},{1060.7,-246},{94.9,-246}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_LP2.MechPower,add2. u2) annotation (Line(
+      points={{1238.7,40.9},{1238.7,-254},{94.9,-254}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Turbine_LP3.MechPower,add2. u3) annotation (Line(
+      points={{1414.7,40.9},{1414.7,-262},{94.9,-262}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(Echappement.MechPower,generator. Wmec2) annotation (Line(
+      points={{1570.7,40},{1570.7,-278},{48,-278}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(controlValveHP.C2, Turbine_HP.Ce) annotation (Line(
+      points={{-121,173.6},{-34,173.6},{-34,175},{-24.42,175}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(sensorT.C2, controlValveHP.C1) annotation (Line(
+      points={{-179.78,173},{-151.89,173},{-151.89,173.6},{-157,173.6}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(constantIP.y, controlValveIP.Ouv)  annotation (Line(
+      points={{-121.8,292},{-140,292},{-140,287}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(controlValveIP.C2, Turbine_IP1.Ce) annotation (Line(
+      points={{-122,253},{-36,253},{-36,67},{395.73,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(genericCombustion.Cfg,splitter2_1. Ce) annotation (Line(
+      points={{-337,59.5},{-336,76},{-336,90},{-335,90}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(Boiler_walls.Cws1, Wall_screen.C2)          annotation (Line(
+      points={{-521,106},{-522,82},{-520,48}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter2_1.Cs1, Boiler_walls.Cfg1)   annotation (Line(
+      points={{-354,106.8},{-472,106.8},{-472,308},{-507.5,308}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(genericCombustion.Cth,heatExchangerWall. WT2) annotation (Line(
+      points={{-426.1,-17},{-454,-17},{-454,-18},{-457.6,-18}},
+      color={0,0,0},
+      smooth=Smooth.None));
+  connect(heatExchangerWall.WT1, Wall_screen.CTh)        annotation (Line(
+      points={{-472.4,-18},{-506.8,-18}},
+      color={0,0,0},
+      smooth=Smooth.None));
+  connect(SBT.Cfg1,RMT_RHT. Cfg2) annotation (Line(
+      points={{-296,318.5},{-296,270.5},{-297,270.5}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(RBT.Cfg1,SBT. Cfg2)      annotation (Line(
+      points={{-296,400},{-296,351.5}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(singularPressureLoss_RBT.C2,RMT_RHT. Cws1) annotation (Line(
+      points={{-416,415},{-418,415},{-418,253},{-348,253}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(SBT.Cws1, Boiler_walls.Cws2)   annotation (Line(
+      points={{-244,335},{-234,335},{-234,538},{-520,538},{-520,510},{-521,510}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(SMT_SHT.Cfg1,splitter2_1. Cs2) annotation (Line(
+      points={{-297,156.5},{-298,132},{-298,108},{-316,108},{-316,106.8}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(RMT_RHT.Cfg1,SMT_SHT. Cfg2) annotation (Line(
+      points={{-297,235.5},{-297,189.5}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(singularPressureLoss.C1, Boiler_walls.Cfg2)    annotation (Line(
+      points={{-496,565},{-550,565},{-550,308},{-534.5,308}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(Economiseur.Cfg2,mixer2_1. Ce2) annotation (Line(
+      points={{-296,511.5},{-296,564.8},{-316,564.8}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(RA.Sc,puitsFumeesPTQXA1. C)
+    annotation (Line(
+      points={{-358.4,-136.8},{-358.4,-138},{-392.54,-138}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(RA.Sf,genericCombustion. Ca)
+    annotation (Line(
+      points={{-338,-122},{-338,-93.5},{-337,-93.5}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(singularPressureLoss.C2, mixer2_1.Ce1)  annotation (Line(
+      points={{-472,565},{-458,565},{-458,564.8},{-356,564.8}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(mixer2_1.Cs,RA. Ec) annotation (Line(
+      points={{-336,590},{-564,590},{-564,-184},{-358.4,-184},{-358.4,-181.2}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(AirPreheater.Cs1,RA. Ef) annotation (Line(
+      points={{-348,-232},{-338,-232},{-338,-196}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(sourceAir.C, AirPreheater.Ce1)  annotation (Line(
+      points={{-394,-232},{-368,-232}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(heatSource.C[1],AirPreheater. Cth) annotation (Line(
+      points={{-358,-221.8},{-358,-232}},
+      color={0,0,0},
+      smooth=Smooth.None));
+  connect(singularPressureLoss_SBT.C2,volumeA. Ce1) annotation (Line(
+      points={{-400,335.5},{-400,173},{-390,173}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(volumeA1.Ce1,Economiseur. Cws2) annotation (Line(
+      points={{-366,496},{-348,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(fuelSourcePQ.C,genericCombustion. Cfuel) annotation (Line(
+      points={{-208,-60},{-208,-59.5},{-247.9,-59.5}},
+      color={0,0,0},
+      smooth=Smooth.None));
+
+  connect(Economiseur.Cfg1, RBT.Cfg2) annotation (Line(
+      points={{-296,480.5},{-296,430}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(controlValveEco.C1,volumeA1. Cs2) annotation (Line(
+      points={{-380.4,457},{-380.4,484},{-380,484}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(controlValveEco.C2,volumeA. Ce2) annotation (Line(
+      points={{-380.4,429},{-380.4,280},{-380,280},{-380,183.78}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TemperatureControl.MesureNiveauEau, sensorT.Measure) annotation (Line(
+      points={{-147.2,475.2},{-191,475.2},{-191,200}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TemperatureControl.ConsigneNiveauEau, constant_Temperature.y)
+    annotation (Line(
+      points={{-147.2,448.2},{-136,448.2},{-136,448},{-133.4,448}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(controlValveEco.Ouv, TemperatureControl.SortieReelle1) annotation (
+      Line(
+      points={{-356.6,443},{-276.625,443},{-276.625,442.8},{-180.8,442.8}},
+      color={0,0,255},
+      smooth=Smooth.None));
+
+  connect(genericCombustion.Cws, sourceQ.C) annotation (Line(
+      points={{-247.9,25.5},{-203.95,25.5},{-203.95,26},{-206,26}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(splitter_TurbineIP1.Cs2, lumpedStraightPipe_IP1.C1) annotation (Line(
+      points={{530,79},{530,264}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterIP.Ev, lumpedStraightPipe_IP3.C2) annotation (Line(
+      points={{945.2,475.76},{945.2,428.04},{945,428.04},{945,317}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterIP.Ee, ReheaterLP1.Se) annotation (Line(
+      points={{1031.06,494},{1040,496},{1040,493},{1100,493},{1106,494}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterLP1.Ee, ReheaterLP2.Se) annotation (Line(
+      points={{1215.08,494},{1222,496},{1222,493},{1272,493}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterLP2.Ee, ReheaterLP3.Se) annotation (Line(
+      points={{1391.18,493},{1396,496},{1396,493},{1452,493}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Q_flueGases_wall.y, splitter2_1.Ialpha1)
+                                              annotation (Line(
+      points={{-377.9,76},{-346.4,76},{-346.4,103.2}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterLP2.Sp, ReDrum.Ec)
+                                   annotation (Line(
+      points={{1366.4,512.47},{1366.4,605},{1758.4,605},{1758.4,516.14}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(loopBreakerP_ReDrum.C1, ReDrum.Sc)
+                                     annotation (Line(
+      points={{1776,550},{1706,550},{1706,545},{1705.6,545},{1705.6,516.14}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(loopBreakerP_ReDrum.C2, Drum_1.Ce1)
+                                         annotation (Line(
+      points={{1814,550},{1814,549},{1834,549},{1834,548.8},{1872,548.8}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(staticCentrifugalPump1.C1, Drum_2.Cs1)  annotation (Line(
+      points={{683,496},{712,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(loopBreakerP_Drum_2.C1, ReheaterHP3.Sp)
+                                            annotation (Line(
+      points={{742,594},{552,594},{552,513.17},{552.4,513.17}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(loopBreakerP_Drum_2.C2, Drum_2.Ce2)
+                                         annotation (Line(
+      points={{786,594},{834,594},{834,468},{774,468}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Drum_1.Cs1, loopBreakerP_Cond.C1)
+                                         annotation (Line(
+      points={{1926,548.8},{1928,548.8},{1928,311},{1930,311}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Sensor_Qvap_Cond.C2, Condenser.Cv)          annotation (Line(
+      points={{1689.6,39.74},{1689.6,45.87},{1691,45.87},{1691,30}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReDrum.Ef, lumpedStraightPipe_Low.C2)
+                                        annotation (Line(
+      points={{1798,494},{1830,494},{1830,317}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_Low.C1, controlValve_Condenser.C2)
+                                                annotation (Line(
+      points={{1830,263},{1830,-142},{1829.2,-142}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(controlValve_Condenser.C1, staticCentrifugalPump.C2)
+                                                     annotation (Line(
+      points={{1829.2,-178},{1829.2,-206},{1796,-206},{1796,-207}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ConsigneLevelCondenser1.y, regulation_Level_Condenser.ConsigneNiveauEau)
+    annotation (Line(points={{1894.2,-20},{1852,-20},{1852,-69.4},{1894.9,-69.4}}));
+  connect(Sensor_Qvap_Cond.Measure, regulation_Level_Condenser.MesureDebitVapeur)
+    annotation (Line(points={{1722.36,53},{1816,53},{1816,-96},{1856,-96},{
+          1895.12,-95.58}}));
+
+  connect(regulation_Level_Condenser.MesureDebitEau, Sensor_Qvap_Cond2.Measure)
+                                        annotation (Line(
+      points={{1894.79,-82.49},{1774,-82.49},{1774,-113},{1722.32,-113}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Condenser.yNiveau, regulation_Level_Condenser.MesureNiveauEau)
+    annotation (Line(
+      points={{1751.5,-57.72},{1860,-57.72},{1860,-56.2},{1894.9,-56.2}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(Sensor_Qvap_Cond2.C2, lumpedStraightPipe_Condenser2.C1)
+    annotation (Line(
+      points={{1693.2,-128.3},{1693.2,-125.13},{1694,-125.13},{1694,-148}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Sensor_Qvap_Cond2.C1, Condenser.Cl)          annotation (Line(
+      points={{1693.2,-98},{1694,-98},{1694,-72},{1692.1,-72}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_TurbineIP2.Cs1, Turbine_IP3.Ce) annotation (Line(
+      points={{760,67},{801.73,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_IP3.Cs, splitter_TurbineIP3.Ce1) annotation (Line(
+      points={{856.27,67},{932,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_TurbineLP3.Cs1, Echappement.Ce) annotation (Line(
+      points={{1486,67},{1513.73,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_Condenser1.C2, Sensor_Qvap_Cond.C1)
+    annotation (Line(
+      points={{1677,67},{1688,67},{1688,66},{1689.6,66}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Economiseur.Cws1, Desuperheater.Sf)
+                                     annotation (Line(
+      points={{-244,496},{-162,496},{-162,495.51},{-70,495.51}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(RBT.Cws1, lumpedStraightPipe_HP2.C2) annotation (Line(
+      points={{-244,415},{285,415},{285,319}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Echappement.Cs, splitter_condenser.Ce1) annotation (Line(
+      points={{1568.27,67},{1600,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_condenser.Cs1, lumpedStraightPipe_Condenser1.C1) annotation (
+     Line(
+      points={{1628,67},{1645,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(loopBreakerP_Cond.C2, splitter_condenser.Ce2)
+                                                    annotation (Line(
+      points={{1930,259},{1927,259},{1927,80.72},{1614,80.72}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(singularPressureLoss_Eco.C1, volumeA1.Cs1) annotation (Line(
+      points={{-416,496},{-412,496},{-412,497},{-406,497},{-406,496},{-394,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Wall_screen.C1, singularPressureLoss_Eco.C2)        annotation (Line(
+      points={{-520,-84},{-442,-84},{-442,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(ReheaterLP3.Ee, ReDrum.Sf)
+                                   annotation (Line(
+      points={{1569.16,493},{1615.55,493},{1615.55,494.54},{1666,494.54}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(volumeA.Cs1, SMT_SHT.Cws1) annotation (Line(
+      points={{-370,173},{-352,174},{-352,172},{-350,174},{-348,173}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_Turbine_HP.Cs3, Turbine_HP1.Ce) annotation (Line(
+      points={{140,175},{171.58,175}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_HP.Cs, splitter_Turbine_HP.Ce) annotation (Line(
+      points={{60.42,175},{116,175}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Drum_2.Ce1, ReheaterIP.Se) annotation (Line(
+      points={{774,496},{918,497},{918,495},{922,495},{924,494}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_HP2.C1, splitter_Turbine_HP1.Cs2) annotation (Line(
+      points={{285,263},{284,263},{284,184.82},{283,184.82}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(splitter_TurbineIP1.Cs1, Turbine_IP2.Ce) annotation (Line(
+      points={{542,67},{570,67},{570,67.5},{601.73,67.5}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_IP1.Cs, splitter_TurbineIP1.Ce1) annotation (Line(
+      points={{450.27,67},{518,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(Turbine_IP2.Cs, splitter_TurbineIP2.Ce1) annotation (Line(
+      points={{656.27,67.5},{694.14,67.5},{694.14,67},{732,67}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(lumpedStraightPipe_Condenser2.C2, staticCentrifugalPump.C1)
+    annotation (Line(
+      points={{1694,-180},{1694,-207},{1760,-207}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(controlValveIP.C1, RMT_RHT.Cws2) annotation (Line(
+      points={{-158,253},{-246,253}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(singularPressureLoss_RBT.C1, RBT.Cws2) annotation (Line(
+      points={{-390,415},{-348,415}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(singularPressureLoss_SBT.C1, SBT.Cws2) annotation (Line(
+      points={{-376,335.5},{-362,335.5},{-362,335},{-348,335}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(sensorT.C1, SMT_SHT.Cws2) annotation (Line(
+      points={{-202,173},{-246,173}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(controlValveHP.Ouv, constantHP.y) annotation (Line(
+      points={{-139,205.9},{-139,215},{-115.5,215}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(CheckValve.C1, splitter_TurbineIP2.Cs2)      annotation (Line(
+      points={{745,268.2},{746,268.2},{746,80}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(V_staticCentrifugalPump.y, staticCentrifugalPump.rpm_or_mpower)
+    annotation (Line(
+      points={{1741.4,-277},{1778,-277},{1778,-227.9}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(sensorQ.C2, ReheaterHP3.Ee) annotation (Line(
+      points={{605.8,496},{590,496},{590,497},{572.98,497}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(sensorQ.C1, staticCentrifugalPump1.C2) annotation (Line(
+      points={{626,496},{655,496}},
+      color={0,0,255},
+      smooth=Smooth.None,
+      thickness=0.5));
+  connect(sensorQ.Measure,Pump_VelocityControl. Mesure_Q_water) annotation (
+      Line(
+      points={{616,514.2},{616,614},{528,614},{528,694},{626.35,694},{626.35,
+          695.9}},
+      color={127,0,0},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash,
+      thickness=0.5));
+  connect(Pump_VelocityControl.SortieReelle1, pT1_1.u) annotation (Line(
+      points={{695.65,640.1},{704.825,640.1},{704.825,641},{711,641}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(pT1_1.y, staticCentrifugalPump1.rpm_or_mpower) annotation (Line(
+      points={{733,641},{733,642},{732,614},{670,614},{669,510.3}},
+      color={127,0,0},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash,
+      thickness=0.5));
+  connect(splitter_TurbineIP3.Cs1, Turbine_LP1.Ce) annotation (Line(
+      points={{958,67},{1003.73,67}},
+      color={255,0,0},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(Turbine_LP1.Cs, splitter_TurbineLP1.Ce1) annotation (Line(
+      points={{1058.27,67},{1112,67}},
+      color={255,0,0},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(splitter_TurbineLP1.Cs1, Turbine_LP2.Ce) annotation (Line(
+      points={{1136,67},{1181.73,67}},
+      color={255,0,0},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(RA.Kcorr, ramp_Kcor.y) annotation (Line(
+      points={{-314.2,-159},{-275.5,-159}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterHP3.Se, volume_HP2.Ce2) annotation (Line(
+      points={{474,497},{436,497}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP2.Cs2, ReheaterHP2.Ee) annotation (Line(
+      points={{426,487.2},{428,487.2},{428,429},{405.02,429}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP2.Cs1, ReheaterHP2_1.Ee) annotation (Line(
+      points={{426,506},{426,560},{405.02,560},{405.02,559}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1_1.Se, volume_HP1.Ce1) annotation (Line(
+      points={{104,559},{86,559},{86,506}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1.Se, volume_HP1.Ce2) annotation (Line(
+      points={{104,429},{86,429},{86,486}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP1.Cs2, Desuperheater.Ef) annotation (Line(
+      points={{76.2,496},{34,496}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1_1.Sp, ReheaterHP2_1.Ep) annotation (Line(
+      points={{187.2,575.83},{187.2,602},{244,602},{244,518},{383.6,518},{383.6,
+          540.98}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(lumpedStraightPipe_HP.C2, volume_HP1Vap.Ce1) annotation (Line(
+      points={{128,318},{128,332}},
+      color={255,0,0},
+      thickness=0.5,
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash));
+  connect(lumpedStraightPipe_HP1.C2, volume_HP1Vap1.Ce1) annotation (Line(
+      points={{322,318},{322,332}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP3.Cs2, singularPressureLoss1.C1) annotation (Line(
+      points={{507.8,565},{524,565}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(singularPressureLoss1.C2, ReheaterHP3.Ep) annotation (Line(
+      points={{544,565},{588,565},{588,461},{552.4,461},{552.4,480.34}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterHP2_1.Sp, singularPressureLoss2.C1) annotation (Line(
+      points={{383.6,576.49},{383.6,602},{433,602}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(singularPressureLoss2.C2, volume_HP3.Ce2) annotation (Line(
+      points={{453,602},{498,602},{498,575}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ReheaterHP2.Sp, singularPressureLoss3.C1) annotation (Line(
+      points={{383.6,446.49},{383.6,460},{384,460}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(singularPressureLoss3.C2, volume_HP3.Ce1) annotation (Line(
+      points={{384,480},{400,480},{400,516},{416,516},{416,528},{498,528},{498,
+          555}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(volume_HP1Vap1.Cs1, singularPressureLoss5.C1) annotation (Line(
+      points={{322,352},{322,372}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash,
+      thickness=0.5));
+  connect(singularPressureLoss5.C2, ReheaterHP2.Ev) annotation (Line(
+      points={{322,392},{322,412.04},{322.4,412.04}},
+      color={255,0,0},
+      smooth=Smooth.None,
+      pattern=LinePattern.Dash,
+      thickness=0.5));
+  connect(volume_HP1Vap1.Cs2, singularPressureLoss4.C1) annotation (Line(
+      points={{312,342},{292,342},{292,460}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(singularPressureLoss4.C2, ReheaterHP2_1.Ev) annotation (Line(
+      points={{292,480},{290,480},{290,524},{322.4,524},{322.4,542.04}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP1Vap.Cs1, singularPressureLoss6.C1) annotation (Line(
+      points={{128,352},{128,379}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(singularPressureLoss6.C2, ReheaterHP1.Ev) annotation (Line(
+      points={{128,399},{128,412.68},{124.8,412.68}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP1Vap.Cs2, singularPressureLoss7.C1) annotation (Line(
+      points={{118,342},{70,342},{70,460}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(singularPressureLoss7.C2, ReheaterHP1_1.Ev) annotation (Line(
+      points={{70,480},{70,526},{124.8,526},{124.8,542.68}},
+      color={255,0,0},
+      pattern=LinePattern.Dash,
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP21.Ce1, ReheaterHP2_1.Se) annotation (Line(
+      points={{266,559},{302,559}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1_1.Ee, volume_HP21.Cs1) annotation (Line(
+      points={{209.04,559},{246,559}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(ReheaterHP1.Ee, volume_HP22.Cs1) annotation (Line(
+      points={{209.04,429},{244,429}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(volume_HP22.Ce1, ReheaterHP2.Se) annotation (Line(
+      points={{264,429},{302,429}},
+      color={0,0,255},
+      thickness=0.5,
+      smooth=Smooth.None));
+  connect(Power_MW.y, MassFlowRateAirCoalWater.Electrical_power_MW) annotation (
+     Line(
+      points={{-371.5,689},{-384,689},{-384,706.24},{-444,706.24}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_3.y, fuelSourcePQ.IMassFlow) annotation (Line(
+      points={{-581.2,696.5},{-590,688},{-600,688},{-600,-272},{-174,-272},{
+          -174,-43}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_3.u, MassFlowRateAirCoalWater.Q_coal) annotation (Line(
+      points={{-554.8,696.5},{-523.4,696.5},{-523.4,697},{-492,697}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_2.y, sourceAir.IMassFlow) annotation (Line(
+      points={{-583.4,659.5},{-592,659.5},{-592,-218},{-419,-218}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_2.u, MassFlowRateAirCoalWater.Q_air) annotation (Line(
+      points={{-552.6,659.5},{-522.3,659.5},{-522.3,660.04},{-492,660.04}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(pT1_4.y,Pump_VelocityControl. Consigne_Q_water) annotation (Line(
+      points={{-342.7,649},{141.65,649},{141.65,649.4},{626.35,649.4}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(MassFlowRateAirCoalWater.Q_water, pT1_4.u) annotation (Line(
+      points={{-492,624.84},{-508,624.84},{-508,610},{-392,610},{-392,649},{-371.3,
+          649}},
+      color={0,0,255},
+      pattern=LinePattern.Dash,
+      smooth=Smooth.None));
+  connect(CheckValve.C2, Drum_2.Ce4) annotation (Line(
+      points={{745,307.8},{745,296.9},{743,296.9},{743,433}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(regulation_Level_Condenser.SortieReelle1, pT1_5.u) annotation (Line(
+      points={{1941.1,-95.8},{1954,-95.8},{1954,-128},{1752,-128},{1752,-160},{
+          1765,-160}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(pT1_5.y, controlValve_Condenser.Ouv) annotation (Line(
+      points={{1787,-160},{1800.3,-160}},
+      color={0,0,255},
+      smooth=Smooth.None));
+annotation (
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This is the dynamic model of a once-through supercritical coal-fired power plant. </p>
+<p>It is documented in Sect. 6.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Cecilia Rioual</li>
+</ul>
+</html>"),
+   Diagram(coordinateSystem(
+        preserveAspectRatio=true,
+        extent={{-600,-400},{2000,800}},
+        initialScale=0.1), graphics={Text(
+          extent={{80,134},{188,114}},
+          lineColor={0,0,255},
+          textString="Turbine_HP"),  Text(
+          extent={{385,18},{489,-2}},
+          lineColor={0,0,255},
+          textString="Turbine_IP"),  Text(
+          extent={{990,22},{1104,2}},
+          lineColor={0,0,255},
+          textString="Turbine_LP"),  Text(
+          extent={{-543,-104},{-492,-112}},
+          lineColor={0,0,255},
+          textString="Wall_screen"), Text(
+          extent={{-394,204},{-308,194}},
+          lineColor={0,0,255},
+          textString="SMT_SHT"),     Text(
+          extent={{-566,514},{-408,524}},
+          lineColor={0,0,255},
+          textString="Boiler_walls"),Text(
+          extent={{-394,282},{-306,272}},
+          lineColor={0,0,255},
+          textString="RMT_RHT"),     Text(
+          extent={{-384,354},{-334,344}},
+          lineColor={0,0,255},
+          textString="SBT"),         Text(
+          extent={{-384,432},{-334,422}},
+          lineColor={0,0,255},
+          textString="RBT"),         Text(
+          extent={{-382,526},{-332,513}},
+          lineColor={0,0,255},
+          textString="Eco"),         Text(
+          extent={{1426,542},{1540,522}},
+          lineColor={0,0,255},
+          textString="LP_RH3"),      Text(
+          extent={{1256,538},{1370,518}},
+          lineColor={0,0,255},
+          textString="LP_RH2"),      Text(
+          extent={{1088,538},{1202,518}},
+          lineColor={0,0,255},
+          textString="LP_RH1"),      Text(
+          extent={{902,540},{1016,520}},
+          lineColor={0,0,255},
+          textString="IP_RH"),       Text(
+          extent={{466,468},{580,448}},
+          lineColor={0,0,255},
+          textString="HP_RH3"),      Text(
+          extent={{290,502},{404,482}},
+          lineColor={0,0,255},
+          textString="HP_RH2"),      Text(
+          extent={{98,502},{212,482}},
+          lineColor={0,0,255},
+          textString="HP_RH1"),      Text(
+          extent={{-74,546},{40,526}},
+          lineColor={0,0,255},
+          textString="Desu"),
+        Text(
+          extent={{6,-226},{1248,-540}},
+          lineColor={28,108,200},
+          textString="New model DynamicExchangerWaterSteamFlueGases_New_hi
+Dp; h convectif")}),
+    experiment(StopTime=1200),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end SupercriticalPulverizedCoalPowerPlant;
diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/package.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/package.mo
index 4a1d99115e96357b80503e431e3c17cbafeffd02..ac9f4809c6c6e9e500715eb2efa0ec929e75c33d 100644
--- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/package.mo
@@ -1,147 +1,147 @@
-within ThermoSysPro.Fluid.Examples.Book;
-package PowerPlants "PowerPlants"
-
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains models of three different types of power plants:</p>
-<ul>
-<li>Combined cycle power plant</li>
-<li>Concentrated solar power plant</li>
-<li>Pulverized coal power plant</li>
-</ul>
-</html>"));
-end PowerPlants;
+within ThermoSysPro.Fluid.Examples.Book;
+package PowerPlants "PowerPlants"
+
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains models of three different types of power plants:</p>
+<ul>
+<li>Combined cycle power plant</li>
+<li>Concentrated solar power plant</li>
+<li>Pulverized coal power plant</li>
+</ul>
+</html>"));
+end PowerPlants;
diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/package.order b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/package.order
index 19cc3efabfe90dd5edaf2d7b38886fb1bca9cf96..455f15fa4d09f7295808b3362dae5c635ec331a7 100644
--- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/package.order
@@ -1,3 +1,3 @@
-CombinedCyclePowerPlant
-SupercriticalPulverizedCoalPowerPlant
-ConcentratedSolarPowerPlant_PTSC
+CombinedCyclePowerPlant
+SupercriticalPulverizedCoalPowerPlant
+ConcentratedSolarPowerPlant_PTSC
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo
index c88675046f389c02f22f37a763fd0ddb352a1e09..a90acba0a6e8b25dc356bfd22c5a13a9e6fbf525 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo
@@ -1,89 +1,89 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Boiler;
-model TestFossilFuelBoiler
-  ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler(
-    Wloss=0,
-    Ke=1.e6,
-    Tsf=386.16,
-    Tea(start=298.15999999999923),
-    Tf(start=2138.3201722145304),
-    deltaPe(start=4028755.599053718),
-    rhof(start=0.2733355904203506))
-    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    T0=338.16,
-    Cp=1282,
-    Xh=0.24403,
-    Xc=0.75323,
-    Q0=1.45) annotation (Placement(transformation(extent={{-36,-78},{0,-41}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
-    Xco2=0,
-    Xh2o=0.01,
-    Q0=27.,
-    T0=298.16,
-    Xo2=0.233,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    option_temperature=true)
-               annotation (Placement(transformation(extent={{-110,-50},{-71,-13}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
-          extent={{68,-51},{110,-12}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
-    P0=140e5,
-    Q0=24.,
-    h0=600e3)
-    annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{74,13},{110,49}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3, rho(
-        start=932.9612394321883))
-    annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3, rho(
-        start=29.766102492862515))
-    annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0)));
-equation
-  connect(sourceQ.C, FossilFuelBoiler.Cair)     annotation (Line(
-      points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}},
-      color={0,0,0},
-      thickness=1));
-  connect(FossilFuelBoiler.Cfg, sinkP.C)     annotation (Line(
-      points={{45,-31.62},{62,-31.62},{62,-31.5},{68,-31.5}},
-      color={0,0,0},
-      thickness=1));
-  connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel)     annotation (Line(points={
-          {0,-59.5},{0,-40.8}}, color={0,0,0}));
-  connect(sourcePQ.C, singularPressureLoss.C1)
-    annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation (Line(
-        points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sink.C)
-    annotation (Line(points={{65,31},{74,31}}, color={0,0,255}));
-  connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation (Line(
-        points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255}));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestFossilFuelBoiler;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Boiler;
+model TestFossilFuelBoiler
+  ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler(
+    Wloss=0,
+    Ke=1.e6,
+    Tsf=386.16,
+    Tea(start=298.15999999999923),
+    Tf(start=2138.3201722145304),
+    deltaPe(start=4028755.599053718),
+    rhof(start=0.2733355904203506))
+    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    T0=338.16,
+    Cp=1282,
+    Xh=0.24403,
+    Xc=0.75323,
+    Q0=1.45) annotation (Placement(transformation(extent={{-36,-78},{0,-41}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+    Xco2=0,
+    Xh2o=0.01,
+    Q0=27.,
+    T0=298.16,
+    Xo2=0.233,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    option_temperature=true)
+               annotation (Placement(transformation(extent={{-110,-50},{-71,-13}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
+          extent={{68,-51},{110,-12}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+    P0=140e5,
+    Q0=24.,
+    h0=600e3)
+    annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{74,13},{110,49}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3, rho(
+        start=932.9612394321883))
+    annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3, rho(
+        start=29.766102492862515))
+    annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0)));
+equation
+  connect(sourceQ.C, FossilFuelBoiler.Cair)     annotation (Line(
+      points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}},
+      color={0,0,0},
+      thickness=1));
+  connect(FossilFuelBoiler.Cfg, sinkP.C)     annotation (Line(
+      points={{45,-31.62},{62,-31.62},{62,-31.5},{68,-31.5}},
+      color={0,0,0},
+      thickness=1));
+  connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel)     annotation (Line(points={
+          {0,-59.5},{0,-40.8}}, color={0,0,0}));
+  connect(sourcePQ.C, singularPressureLoss.C1)
+    annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation (Line(
+        points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sink.C)
+    annotation (Line(points={{65,31},{74,31}}, color={0,0,255}));
+  connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation (Line(
+        points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255}));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestFossilFuelBoiler;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/package.mo
index fcaddf293ef76a6d6afe02cfbb7775b36e66d969..95e3027b309928a8f9057588bec6b8c2b0c4ceb3 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package Boiler "Boiler modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end Boiler;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package Boiler "Boiler modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end Boiler;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/package.order
index 2ad86130dac64702cf98deb99048699e00179cae..6eae21c6a515eb2e4577c344a72d7ea192014d8a 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/package.order
@@ -1 +1 @@
-TestFossilFuelBoiler
+TestFossilFuelBoiler
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo
index 3d79656eac220c009a33fa374e3ac535e26d9c2c..e51b08b44e8b639320c3e3024b0e47ac448fdf68 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo
@@ -1,72 +1,72 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
-model Scenario_1
-
-  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(
-    mode_car=1,
-    mode_car_hn=1,
-    mode_car_Cr=1,
-    dynamic_mech_equation=false)
-                     annotation (Placement(transformation(extent={{-20,20},{0,
-            40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=10,
-    Duration=100,
-    Initialvalue=1400,
-    Finalvalue=0) annotation (Placement(transformation(extent={{-100,-20},{-80,
-            0}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
-    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-20},
-            {-40,0}}, rotation=0)));
-equation
-  connect(sourcePQ.C, centrifugalPump.C1)
-    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sink.C)
-    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
-  connect(sourceAngularVelocity.M, centrifugalPump.M)
-    annotation (Line(points={{-39,-10},{-10,-10},{-10,19}}));
-  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
-    annotation (Line(points={{-79,-10},{-55,-10}}));
-  annotation (experiment(StopTime=200),
-    Diagram(graphics={
-        Text(
-          extent={{-96,98},{-58,82}},
-          lineColor={0,0,255},
-          textString=
-               "w=1 ==> w=0"),
-        Text(
-          extent={{-102,74},{-80,68}},
-          lineColor={0,0,255},
-          textString="q=0"),
-        Text(
-          extent={{-96,60},{-56,40}},
-          lineColor={0,0,255},
-          textString="theta=0 ==> theta=-180")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;1. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end Scenario_1;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
+model Scenario_1
+
+  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(
+    mode_car=1,
+    mode_car_hn=1,
+    mode_car_Cr=1,
+    dynamic_mech_equation=false)
+                     annotation (Placement(transformation(extent={{-20,20},{0,
+            40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=10,
+    Duration=100,
+    Initialvalue=1400,
+    Finalvalue=0) annotation (Placement(transformation(extent={{-100,-20},{-80,
+            0}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
+    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-20},
+            {-40,0}}, rotation=0)));
+equation
+  connect(sourcePQ.C, centrifugalPump.C1)
+    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sink.C)
+    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
+  connect(sourceAngularVelocity.M, centrifugalPump.M)
+    annotation (Line(points={{-39,-10},{-10,-10},{-10,19}}));
+  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
+    annotation (Line(points={{-79,-10},{-55,-10}}));
+  annotation (experiment(StopTime=200),
+    Diagram(graphics={
+        Text(
+          extent={{-96,98},{-58,82}},
+          lineColor={0,0,255},
+          textString=
+               "w=1 ==> w=0"),
+        Text(
+          extent={{-102,74},{-80,68}},
+          lineColor={0,0,255},
+          textString="q=0"),
+        Text(
+          extent={{-96,60},{-56,40}},
+          lineColor={0,0,255},
+          textString="theta=0 ==> theta=-180")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;1. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end Scenario_1;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo
index d6644c37aeb664f8ef7a5181889ff3d44be41393..eb7b7d0cdf5b1a69b39fa64d34d4355dcba1c6ea 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo
@@ -1,69 +1,69 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
-model Scenario_2
-
-  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
-        1, mode_car_Cr=1,
-    mode_car=1)      annotation (Placement(transformation(extent={{-20,20},{0,
-            40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0=100)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=10,
-    Duration=100,
-    Initialvalue=1400,
-    Finalvalue=0) annotation (Placement(transformation(extent={{-80,-20},{-60,0}},
-          rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
-    sourceAngularVelocity annotation (Placement(transformation(extent={{-40,-20},
-            {-20,0}}, rotation=0)));
-equation
-  connect(sourcePQ.C, centrifugalPump.C1)
-    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sink.C)
-    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
-  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
-    annotation (Line(points={{-59,-10},{-35,-10}}));
-  connect(sourceAngularVelocity.M, centrifugalPump.M)
-    annotation (Line(points={{-19,-10},{-10,-10},{-10,19}}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-96,98},{-58,82}},
-          lineColor={0,0,255},
-          textString=
-               "w=1 ==> w=0"),
-        Text(
-          extent={{-100,74},{-78,68}},
-          lineColor={0,0,255},
-          textString="q=0.21"),
-        Text(
-          extent={{-96,60},{-56,40}},
-          lineColor={0,0,255},
-          textString="theta=12 ==> theta=90")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;2. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end Scenario_2;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
+model Scenario_2
+
+  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(mode_car_hn=
+        1, mode_car_Cr=1,
+    mode_car=1)      annotation (Placement(transformation(extent={{-20,20},{0,
+            40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0=100)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=10,
+    Duration=100,
+    Initialvalue=1400,
+    Finalvalue=0) annotation (Placement(transformation(extent={{-80,-20},{-60,0}},
+          rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
+    sourceAngularVelocity annotation (Placement(transformation(extent={{-40,-20},
+            {-20,0}}, rotation=0)));
+equation
+  connect(sourcePQ.C, centrifugalPump.C1)
+    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sink.C)
+    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
+  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
+    annotation (Line(points={{-59,-10},{-35,-10}}));
+  connect(sourceAngularVelocity.M, centrifugalPump.M)
+    annotation (Line(points={{-19,-10},{-10,-10},{-10,19}}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-96,98},{-58,82}},
+          lineColor={0,0,255},
+          textString=
+               "w=1 ==> w=0"),
+        Text(
+          extent={{-100,74},{-78,68}},
+          lineColor={0,0,255},
+          textString="q=0.21"),
+        Text(
+          extent={{-96,60},{-56,40}},
+          lineColor={0,0,255},
+          textString="theta=12 ==> theta=90")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;2. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end Scenario_2;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo
index d2856b920312ac45867734550a03a5289fddaaca..8ba35d99a56e45f480215951cc69e7b12e17dd33 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo
@@ -1,74 +1,74 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
-model Scenario_3
-
-  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(
-    hn_nom_p=10,
-    mode_car=1,
-    V=0.01,
-    dynamic_energy_balance=false,
-    mode_car_Cr=1,
-    mode_car_hn=1)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(P0=300000)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=100,
-    Starttime=100,
-    Finalvalue=4800000,
-    Initialvalue=400000)                       annotation (Placement(
-        transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-      lambda=0, inertia=true)
-              annotation (Placement(transformation(extent={{20,20},{40,40}},
-          rotation=0)));
-equation
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255}));
-  connect(rampe2.y, sinkP.IPressure)
-    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
-  connect(lumpedStraightPipe.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, lumpedStraightPipe.C1)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-100,94},{-80,86}},
-          lineColor={0,0,255},
-          textString=
-               "w=1"),
-        Text(
-          extent={{-96,80},{-56,60}},
-          lineColor={0,0,255},
-          textString="q=0.95 ==> q=-7.77"),
-        Text(
-          extent={{-96,60},{-54,40}},
-          lineColor={0,0,255},
-          textString="theta=44 ==> theta=-83")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;3. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end Scenario_3;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
+model Scenario_3
+
+  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(
+    hn_nom_p=10,
+    mode_car=1,
+    V=0.01,
+    dynamic_energy_balance=false,
+    mode_car_Cr=1,
+    mode_car_hn=1)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(P0=300000)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=100,
+    Starttime=100,
+    Finalvalue=4800000,
+    Initialvalue=400000)                       annotation (Placement(
+        transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+      lambda=0, inertia=true)
+              annotation (Placement(transformation(extent={{20,20},{40,40}},
+          rotation=0)));
+equation
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255}));
+  connect(rampe2.y, sinkP.IPressure)
+    annotation (Line(points={{21,70},{80,70},{80,30},{75,30}}));
+  connect(lumpedStraightPipe.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, lumpedStraightPipe.C1)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-100,94},{-80,86}},
+          lineColor={0,0,255},
+          textString=
+               "w=1"),
+        Text(
+          extent={{-96,80},{-56,60}},
+          lineColor={0,0,255},
+          textString="q=0.95 ==> q=-7.77"),
+        Text(
+          extent={{-96,60},{-54,40}},
+          lineColor={0,0,255},
+          textString="theta=44 ==> theta=-83")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;3. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end Scenario_3;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo
index 1a5b90146256a6ef1cd1df815379ff130cdf6002..1b737961453d44f95352515ce9ff02ea0c2befc2 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo
@@ -1,79 +1,79 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
-model Scenario_4
-
-  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(
-    J=5.685,
-    dynamic_mech_equation=true,
-    hn_coef={-165.23,774.95},
-    rh_coef={-0.704,1.46},
-    N_nom=4809,
-    hn_nom_p=662,
-    Qv_nom_p=0.921,
-    mode_car_Cr=1,
-    w_a(start=0.003569900907740773),
-    C1(h(start=650000.0)),
-    Qv(start=0.010949905982587188))
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceP(
-    Q0=10,
-    h0=650e3,
-    P0=100000)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
-    Duration=1000,
-    Starttime=0,
-    Initialvalue=7.2e5,
-    Finalvalue=2.0e5)                          annotation (Placement(
-        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceTorque sourceTorque
-    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
-equation
-  connect(sourceP.C, centrifugalPump.C1)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(sourceTorque.M, centrifugalPump.M)
-    annotation (Line(points={{1,-10},{30,-10},{30,19}}));
-  connect(rampe3.y, sourceP.IPressure)
-    annotation (Line(points={{-39,30},{-15,30}}));
-  annotation (Diagram(graphics={
-        Text(
-          extent={{-100,94},{-80,86}},
-          lineColor={0,0,255},
-          textString="w=0 "),
-        Text(
-          extent={{-96,74},{-82,66}},
-          lineColor={0,0,255},
-          textString="q=0.57"),
-        Text(
-          extent={{-96,60},{-54,40}},
-          lineColor={0,0,255},
-          textString="theta=71 ==> theta=74")}),
-                                 experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;4. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end Scenario_4;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump;
+model Scenario_4
+
+  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(
+    J=5.685,
+    dynamic_mech_equation=true,
+    hn_coef={-165.23,774.95},
+    rh_coef={-0.704,1.46},
+    N_nom=4809,
+    hn_nom_p=662,
+    Qv_nom_p=0.921,
+    mode_car_Cr=1,
+    w_a(start=0.003569900907740773),
+    C1(h(start=650000.0)),
+    Qv(start=0.010949905982587188))
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceP(
+    Q0=10,
+    h0=650e3,
+    P0=100000)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
+    Duration=1000,
+    Starttime=0,
+    Initialvalue=7.2e5,
+    Finalvalue=2.0e5)                          annotation (Placement(
+        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceTorque sourceTorque
+    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
+equation
+  connect(sourceP.C, centrifugalPump.C1)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(sourceTorque.M, centrifugalPump.M)
+    annotation (Line(points={{1,-10},{30,-10},{30,19}}));
+  connect(rampe3.y, sourceP.IPressure)
+    annotation (Line(points={{-39,30},{-15,30}}));
+  annotation (Diagram(graphics={
+        Text(
+          extent={{-100,94},{-80,86}},
+          lineColor={0,0,255},
+          textString="w=0 "),
+        Text(
+          extent={{-96,74},{-82,66}},
+          lineColor={0,0,255},
+          textString="q=0.57"),
+        Text(
+          extent={{-96,60},{-54,40}},
+          lineColor={0,0,255},
+          textString="theta=71 ==> theta=74")}),
+                                 experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. It corresponds to scenario n&deg;4. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end Scenario_4;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.mo
index dae079fb616617a56db3054b2087288f9e8e699c..859ae380e1fe34de644522ec5ec1d20d4ed91c3e 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump;
-package TestCentrifugalPump
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end TestCentrifugalPump;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump;
+package TestCentrifugalPump
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 12.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end TestCentrifugalPump;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.order
index d4ec0e216cdd2c8afc5068e1f2aa6b52df0af5cd..ff38607ad0ddd0f6a6f7f4b95ac7ec81e39e81e6 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/package.order
@@ -1,4 +1,4 @@
-Scenario_1
-Scenario_2
-Scenario_3
-Scenario_4
+Scenario_1
+Scenario_2
+Scenario_3
+Scenario_4
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo
index 809b244fbea63a07d7b4d6a9868733920b64c0dc..60625b074c2e25cfe6f0c48dd0a04c7c37325f3b 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo
@@ -1,69 +1,69 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump;
-model TestStaticCentrifugalPump
-
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1
-    annotation (Placement(transformation(extent={{-10,-50},{-30,-30}},
-                                                                     rotation=0)));
-  ThermoSysPro.Fluid.Volumes.Tank Bache1(ze2=10, zs2=10)
-    annotation (Placement(transformation(extent={{-30,10},{-10,30}},
-                                                                   rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1
-    annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(k=0.5) annotation (Placement(
-        transformation(extent={{-10,50},{10,70}},
-                                                rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    width=200,
-    period=500,
-    amplitude=1400,
-    offset=0)   annotation (Placement(transformation(extent={{-50,-80},{-30,-60}},
-          rotation=0)));
-equation
-  connect(StaticCentrifugalPump1.C2, Bache1.Ce2)
-    annotation (Line(points={{-30,-40},{-70,-40},{-70,14},{-30,14}}, color={0,0,
-          255}));
-  connect(Bache1.Cs2, VanneReglante1.C1)
-    annotation (Line(points={{-10,14},{30,14}},
-                                              color={0,0,255}));
-  connect(VanneReglante1.C2, StaticCentrifugalPump1.C1)
-    annotation (Line(points={{50,14},{70,14},{70,-40},{-10,-40}},
-                                                                color={0,0,255}));
-  connect(Constante1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{11,60},{40,60},{40,31}}, color={0,0,255}));
-  connect(pulse.y, StaticCentrifugalPump1.rpm_or_mpower)
-    annotation (Line(points={{-29,-70},{-20,-70},{-20,-51}}, smooth=Smooth.None));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0</h4>
-<p>This model is documented in Sect. 12.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestStaticCentrifugalPump;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump;
+model TestStaticCentrifugalPump
+
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1
+    annotation (Placement(transformation(extent={{-10,-50},{-30,-30}},
+                                                                     rotation=0)));
+  ThermoSysPro.Fluid.Volumes.Tank Bache1(ze2=10, zs2=10)
+    annotation (Placement(transformation(extent={{-30,10},{-10,30}},
+                                                                   rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1
+    annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(k=0.5) annotation (Placement(
+        transformation(extent={{-10,50},{10,70}},
+                                                rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    width=200,
+    period=500,
+    amplitude=1400,
+    offset=0)   annotation (Placement(transformation(extent={{-50,-80},{-30,-60}},
+          rotation=0)));
+equation
+  connect(StaticCentrifugalPump1.C2, Bache1.Ce2)
+    annotation (Line(points={{-30,-40},{-70,-40},{-70,14},{-30,14}}, color={0,0,
+          255}));
+  connect(Bache1.Cs2, VanneReglante1.C1)
+    annotation (Line(points={{-10,14},{30,14}},
+                                              color={0,0,255}));
+  connect(VanneReglante1.C2, StaticCentrifugalPump1.C1)
+    annotation (Line(points={{50,14},{70,14},{70,-40},{-10,-40}},
+                                                                color={0,0,255}));
+  connect(Constante1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{11,60},{40,60},{40,31}}, color={0,0,255}));
+  connect(pulse.y, StaticCentrifugalPump1.rpm_or_mpower)
+    annotation (Line(points={{-29,-70},{-20,-70},{-20,-51}}, smooth=Smooth.None));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0</h4>
+<p>This model is documented in Sect. 12.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestStaticCentrifugalPump;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/package.mo
index 399f1cf4a06663654882d2c2ffb1dfceb208bdcc..63bec38409c2a51b9aa01725c92abc8f0fcfdcb8 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package CentrifugalPump "Centrifugal pump modeling"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 12 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end CentrifugalPump;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package CentrifugalPump "Centrifugal pump modeling"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 12 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end CentrifugalPump;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/package.order
index 910268a123209d6684825a1c92a7e6c4cabd113f..cdb4b7af22dc32a89dde464404374229145b4030 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/package.order
@@ -1,2 +1,2 @@
-TestStaticCentrifugalPump
-TestCentrifugalPump
+TestStaticCentrifugalPump
+TestCentrifugalPump
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo
index 66b83df8c77d52fac3720de3b4e50726923c4c55..e51440863d0ff3757dceb33c4ba3db57efc11fa2 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo
@@ -1,84 +1,84 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CombustionChamber;
-model TestGTCombustionChamber
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2
-    annotation (Placement(transformation(
-        origin={149,-2},
-        extent={{23,-24},{-23,24}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(Cfg(P(
-          fixed=true, start=14.1e5)), kcham(fixed=false, start=1)) annotation (
-      Placement(transformation(extent={{-67,-68},{67,64}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2(
-    Q0=0,
-    P0=15e5,
-    h0=300e3)
-    annotation (Placement(transformation(extent={{-112,48},{-72,88}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(
-    Hum=0,
-    Xo=0,
-    Xn=0,
-    Xs=0,
-    rho=0.838,
-    Xc=0.755,
-    Xh=0.245,
-    Cp=2255,
-    T0=410,
-    Q0=9.30,
-    LHV=47500e3) annotation (Placement(transformation(extent={{-107,-93},{-71,-57}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2(
-    Xso2=0,
-    Xco2=0.0,
-    Xo2=0.23,
-    Xh2o=0.01,
-    P0=15e5,
-    Q0=415,
-    T0=680,
-    option_temperature=true,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-174,-26},{-128,22}},
-          rotation=0)));
-equation
-  connect(GTCombustionChamber2.Cws, sourcePQ2.C)
-    annotation (Line(points={{-40.2,57.4},{-40.2,68},{-72,68}}));
-  connect(GTCombustionChamber2.Cfuel, sourceCombustible2.C) annotation (Line(
-        points={{0,-61.4},{0,-75},{-71,-75}},    color={0,0,0}));
-  connect(GTCombustionChamber2.Cfg, Puits_Fumees2.C) annotation (Line(
-      points={{60.3,-2},{126,-2}},
-      color={0,0,0},
-      thickness=1));
-  connect(Source_Fumees2.C, GTCombustionChamber2.Ca) annotation (Line(
-      points={{-128,-2},{-60.3,-2}},
-      color={0,0,0},
-      thickness=1));
-  annotation (Diagram(graphics,
-                      coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1)), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 8.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestGTCombustionChamber;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CombustionChamber;
+model TestGTCombustionChamber
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2
+    annotation (Placement(transformation(
+        origin={149,-2},
+        extent={{23,-24},{-23,24}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(Cfg(P(
+          fixed=true, start=14.1e5)), kcham(fixed=false, start=1)) annotation (
+      Placement(transformation(extent={{-67,-68},{67,64}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2(
+    Q0=0,
+    P0=15e5,
+    h0=300e3)
+    annotation (Placement(transformation(extent={{-112,48},{-72,88}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(
+    Hum=0,
+    Xo=0,
+    Xn=0,
+    Xs=0,
+    rho=0.838,
+    Xc=0.755,
+    Xh=0.245,
+    Cp=2255,
+    T0=410,
+    Q0=9.30,
+    LHV=47500e3) annotation (Placement(transformation(extent={{-107,-93},{-71,-57}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2(
+    Xso2=0,
+    Xco2=0.0,
+    Xo2=0.23,
+    Xh2o=0.01,
+    P0=15e5,
+    Q0=415,
+    T0=680,
+    option_temperature=true,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-174,-26},{-128,22}},
+          rotation=0)));
+equation
+  connect(GTCombustionChamber2.Cws, sourcePQ2.C)
+    annotation (Line(points={{-40.2,57.4},{-40.2,68},{-72,68}}));
+  connect(GTCombustionChamber2.Cfuel, sourceCombustible2.C) annotation (Line(
+        points={{0,-61.4},{0,-75},{-71,-75}},    color={0,0,0}));
+  connect(GTCombustionChamber2.Cfg, Puits_Fumees2.C) annotation (Line(
+      points={{60.3,-2},{126,-2}},
+      color={0,0,0},
+      thickness=1));
+  connect(Source_Fumees2.C, GTCombustionChamber2.Ca) annotation (Line(
+      points={{-128,-2},{-60.3,-2}},
+      color={0,0,0},
+      thickness=1));
+  annotation (Diagram(graphics,
+                      coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1)), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 8.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestGTCombustionChamber;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo
index faedc9a995056e1f28dcd0597fa3d5d4a846976f..70636ca94e4f6e70eb9d13de20b1ad40989a299c 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo
@@ -1,147 +1,147 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CombustionChamber;
-model TestGenericCombustion1D "TestGenericCombustion1D"
-
-  ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(
-    NCEL=7,
-    Qm(fixed=false),
-    Qsf(fixed=false),
-    kcham(fixed=true) = 0.1,
-    Acham=275,
-    Xbf=0,
-    ImbCV=0.05,
-    EPSPAR=0.7,
-    Kec=8.8,
-    SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56},
-    ImbBF=0.0,
-    Psf(start=113275)) annotation (Placement(transformation(extent={{-62,-56},{
-            62,72}}, rotation=0)));
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Xn=0.0208,
-    Xashes=0.136,
-    Cp=1200,
-    rho=1100,
-    LHV=29245e3,
-    Xc=0.719,
-    Xh=0.0414,
-    Xo=0.086,
-    Xs=0.0044,
-    Vol=0.286,
-    Q0=57.20,
-    T0=358.15,
-    Hum=0.08) annotation (Placement(transformation(extent={{-106,-43},{-72,-5}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
-    Xso2=0,
-    Q0=609.29,
-    Xh2o=0.01,
-    Xo2=0.230,
-    Xco2=0,
-    P0=191000,
-    T0=524.89,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{0,70},{44,112}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
-    annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe              PipeWaterSteam(
-    Ns=7,
-    z2=56,
-    rugosrel=5e-5,
-    ntubes=403,
-    L=58,
-    D=0.0327,
-    C2(Q(fixed=false, start=486.69), P(
-        fixed=false,
-        start=1.96318e+07,
-        displayUnit="Pa")),
-    dpfCorr=3.5)
-    annotation (Placement(transformation(
-        origin={91,8},
-        extent={{49,16},{-49,-16}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall              paroiEcrans(
-    Ns=7,
-    lambda=40,
-    steady_state=true,
-    ntubes=403,
-    L=58,
-    D=0.0327,
-    e=0.001)
-    annotation (Placement(transformation(
-        origin={73,7.5},
-        extent={{51.5,-15},{-51.5,15}},
-        rotation=270)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkWaterSteam2(
-    option_temperature=false,
-    Q(start=486.69, fixed=true),
-    h0=2.5e+06,
-    P0(fixed=false) = 19621600)
-    annotation (Placement(transformation(
-        origin={90,90.5},
-        extent={{14.5,-15},{-14.5,15}},
-        rotation=270)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceEcrans(
-    h0=1.292e+06,
-    option_temperature=false,
-    P0=20112000)
-    annotation (Placement(transformation(
-        origin={91,-81},
-        extent={{15,-15},{-15,15}},
-        rotation=270)));
-equation
-  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel)
-    annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0}));
-  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
-      points={{0,65.6},{0,91},{0,91}},
-      color={0,0,0},
-      thickness=1));
-  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
-      points={{0,-49.6},{0,-78}},
-      color={0,0,0},
-      thickness=1));
-  connect(SourcePQ_Water.C, genericCombustionCCS.Cws)
-    annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255}));
-  connect(genericCombustionCCS.Cth,paroiEcrans. WT2) annotation (Line(points={{55.8,8},
-          {68,8},{68,7.5},{76,7.5}},         color={191,95,0}));
-  connect(paroiEcrans.WT1,PipeWaterSteam. CTh) annotation (Line(points={{70,7.5},
-          {71,7.5},{71,8},{86.2,8}}, color={191,95,0}));
-  connect(sourceEcrans.C,PipeWaterSteam. C1)
-    annotation (Line(points={{91,-66},{91,-41}},   color={0,0,255}));
-  connect(PipeWaterSteam.C2,sinkWaterSteam2. C) annotation (Line(points={{91,57},
-          {91,76},{90,76}},       color={0,0,255}));
-  annotation (Diagram(graphics),
-                       Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-        info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 8.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestGenericCombustion1D;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CombustionChamber;
+model TestGenericCombustion1D "TestGenericCombustion1D"
+
+  ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(
+    NCEL=7,
+    Qm(fixed=false),
+    Qsf(fixed=false),
+    kcham(fixed=true) = 0.1,
+    Acham=275,
+    Xbf=0,
+    ImbCV=0.05,
+    EPSPAR=0.7,
+    Kec=8.8,
+    SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56},
+    ImbBF=0.0,
+    Psf(start=113275)) annotation (Placement(transformation(extent={{-62,-56},{
+            62,72}}, rotation=0)));
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Xn=0.0208,
+    Xashes=0.136,
+    Cp=1200,
+    rho=1100,
+    LHV=29245e3,
+    Xc=0.719,
+    Xh=0.0414,
+    Xo=0.086,
+    Xs=0.0044,
+    Vol=0.286,
+    Q0=57.20,
+    T0=358.15,
+    Hum=0.08) annotation (Placement(transformation(extent={{-106,-43},{-72,-5}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
+    Xso2=0,
+    Q0=609.29,
+    Xh2o=0.01,
+    Xo2=0.230,
+    Xco2=0,
+    P0=191000,
+    T0=524.89,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{0,70},{44,112}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
+    annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe              PipeWaterSteam(
+    Ns=7,
+    z2=56,
+    rugosrel=5e-5,
+    ntubes=403,
+    L=58,
+    D=0.0327,
+    C2(Q(fixed=false, start=486.69), P(
+        fixed=false,
+        start=1.96318e+07,
+        displayUnit="Pa")),
+    dpfCorr=3.5)
+    annotation (Placement(transformation(
+        origin={91,8},
+        extent={{49,16},{-49,-16}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall              paroiEcrans(
+    Ns=7,
+    lambda=40,
+    steady_state=true,
+    ntubes=403,
+    L=58,
+    D=0.0327,
+    e=0.001)
+    annotation (Placement(transformation(
+        origin={73,7.5},
+        extent={{51.5,-15},{-51.5,15}},
+        rotation=270)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkWaterSteam2(
+    option_temperature=false,
+    Q(start=486.69, fixed=true),
+    h0=2.5e+06,
+    P0(fixed=false) = 19621600)
+    annotation (Placement(transformation(
+        origin={90,90.5},
+        extent={{14.5,-15},{-14.5,15}},
+        rotation=270)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceEcrans(
+    h0=1.292e+06,
+    option_temperature=false,
+    P0=20112000)
+    annotation (Placement(transformation(
+        origin={91,-81},
+        extent={{15,-15},{-15,15}},
+        rotation=270)));
+equation
+  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel)
+    annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0}));
+  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
+      points={{0,65.6},{0,91},{0,91}},
+      color={0,0,0},
+      thickness=1));
+  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
+      points={{0,-49.6},{0,-78}},
+      color={0,0,0},
+      thickness=1));
+  connect(SourcePQ_Water.C, genericCombustionCCS.Cws)
+    annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255}));
+  connect(genericCombustionCCS.Cth,paroiEcrans. WT2) annotation (Line(points={{55.8,8},
+          {68,8},{68,7.5},{76,7.5}},         color={191,95,0}));
+  connect(paroiEcrans.WT1,PipeWaterSteam. CTh) annotation (Line(points={{70,7.5},
+          {71,7.5},{71,8},{86.2,8}}, color={191,95,0}));
+  connect(sourceEcrans.C,PipeWaterSteam. C1)
+    annotation (Line(points={{91,-66},{91,-41}},   color={0,0,255}));
+  connect(PipeWaterSteam.C2,sinkWaterSteam2. C) annotation (Line(points={{91,57},
+          {91,76},{90,76}},       color={0,0,255}));
+  annotation (Diagram(graphics),
+                       Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+        info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 8.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestGenericCombustion1D;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/package.mo
index 151e1b4e3a2c0d8ad444750a7e193104c3136b04..42dda83799c37dd602359e44890e8d317f61c5d1 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/package.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package CombustionChamber "Combustion chamber modeling"
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end CombustionChamber;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package CombustionChamber "Combustion chamber modeling"
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end CombustionChamber;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/package.order
index c07b17fcb0a09f47783a9f5c324e1ebd3e2f9d29..76da96b0773d7ec9560d326c489ed69d96ea38b9 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/package.order
@@ -1,2 +1,2 @@
-TestGTCombustionChamber
-TestGenericCombustion1D
+TestGTCombustionChamber
+TestGenericCombustion1D
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo
index c2210c92f3334294d31d547b2619a71684cf0dc5..61cceac82bd48485934389948a115449bd71d619 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine;
-model TestCombustionTurbine
-  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
-  parameter Real Qred1(fixed=false,start=0.01) "Reduced mass flow rate";
-
-  ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine(
-    tau_n=0.065,
-    is_eff_n=is_eff_n1,
-    Qred=Qred1,
-    Pe(fixed=true, start=1500000),
-    Ts(fixed=true, start=830)) annotation (Placement(transformation(extent={{
-            -42,-42},{36,42}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1(
-    Xso2=0,
-    Q0=430,
-    Xco2=0.06,
-    Xh2o=0.06,
-    Xo2=0.14,
-    T0=1500,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-106,-10},{-86,10}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=1e5)
-    annotation (Placement(transformation(
-        origin={94,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8)
-    annotation (Placement(transformation(extent={{-100,-42},{-80,-22}},
-          rotation=0)));
-equation
-  connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line(
-      points={{-86,0},{-42,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line(
-      points={{36,0},{84,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Wc1.y, CombustionTurbine.CompressorPower)
-    annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}}));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 11.4.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestCombustionTurbine;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine;
+model TestCombustionTurbine
+  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
+  parameter Real Qred1(fixed=false,start=0.01) "Reduced mass flow rate";
+
+  ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine(
+    tau_n=0.065,
+    is_eff_n=is_eff_n1,
+    Qred=Qred1,
+    Pe(fixed=true, start=1500000),
+    Ts(fixed=true, start=830)) annotation (Placement(transformation(extent={{
+            -42,-42},{36,42}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1(
+    Xso2=0,
+    Q0=430,
+    Xco2=0.06,
+    Xh2o=0.06,
+    Xo2=0.14,
+    T0=1500,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-106,-10},{-86,10}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=1e5)
+    annotation (Placement(transformation(
+        origin={94,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8)
+    annotation (Placement(transformation(extent={{-100,-42},{-80,-22}},
+          rotation=0)));
+equation
+  connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line(
+      points={{-86,0},{-42,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line(
+      points={{36,0},{84,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Wc1.y, CombustionTurbine.CompressorPower)
+    annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}}));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 11.4.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestCombustionTurbine;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo
index 7cb23f2f06830e24eace95cceb82147a1281e815..9673a81edc87805d132a828875f9634828b12e0d 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo
@@ -1,63 +1,63 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine;
-model TestCompressor
-  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
-
-  ThermoSysPro.Fluid.Machines.Compressor Compressor(
-    Ps(fixed=false),
-    tau_n=16,
-    is_eff_n=is_eff_n1,
-    Pe(fixed=false, start=100000),
-    Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{
-            -52,-52},{48,52}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1(
-    Xso2=0,
-    T0=288,
-    Xco2=0.0,
-    Xh2o=0.003,
-    Xo2=0.23,
-    P0=1e5,
-    Q0=420,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=15.8e5)
-    annotation (Placement(transformation(
-        origin={96,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-equation
-  connect(SourceQ1.C, Compressor.Ce) annotation (Line(
-      points={{-84,0},{-39.5,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Compressor.Cs, SinkP1.C) annotation (Line(
-      points={{35.5,0},{86,0}},
-      color={0,0,0},
-      thickness=1));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 11.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestCompressor;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine;
+model TestCompressor
+  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
+
+  ThermoSysPro.Fluid.Machines.Compressor Compressor(
+    Ps(fixed=false),
+    tau_n=16,
+    is_eff_n=is_eff_n1,
+    Pe(fixed=false, start=100000),
+    Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{
+            -52,-52},{48,52}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1(
+    Xso2=0,
+    T0=288,
+    Xco2=0.0,
+    Xh2o=0.003,
+    Xo2=0.23,
+    P0=1e5,
+    Q0=420,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=15.8e5)
+    annotation (Placement(transformation(
+        origin={96,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+equation
+  connect(SourceQ1.C, Compressor.Ce) annotation (Line(
+      points={{-84,0},{-39.5,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Compressor.Cs, SinkP1.C) annotation (Line(
+      points={{35.5,0},{86,0}},
+      color={0,0,0},
+      thickness=1));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 11.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestCompressor;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/package.mo
index f46b018954af0d6c899573ee0c3dbdca45f0296e..aabff842dad7096e4daef0f93965e0876417e385 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package GasTurbine "Gas turbine modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 11 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end GasTurbine;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package GasTurbine "Gas turbine modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 11 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end GasTurbine;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/package.order
index 4733fa08d342d04ec7bc03fe9fa0a68f53d5bb6a..e128234aa4f9034c65383964004c765812d6f35c 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/package.order
@@ -1,2 +1,2 @@
-TestCompressor
-TestCombustionTurbine
+TestCompressor
+TestCombustionTurbine
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo
index 9c099a98d658907e203260f7c8b6909d2f718ca9..3c9969acaf9beaaa1f26293821896fde3f328c08 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo
@@ -1,287 +1,287 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
-model Islanding
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    P0=22.733e5,
-    h0=2650.6e3)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=false, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
-    Q(fixed=false, start=56),
-    Cvmax(fixed=false) = 354.534,
-    mode_caract=0,
-    Cv(start=70, fixed=false),
-    C1(h_vol_2(start=800e3), h(start=800e3)))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(
-    Dc=0.016,
-    Lc=2.56,
-    PasL=0.027,
-    PasT=0.02338,
-    ec=2e-3,
-    Rv=1.130514,
-    Ns=10,
-    DpfCorr=1.1136,
-    cp=506,
-    rho=7780,
-    lambda=35,
-    COP0l(fixed=false) = 1.23,
-    C2ex(P(start=2220000)),
-    ntubes1=351,
-    ntubes2=351,
-    ntubes3=1319,
-    L3=26.4,
-    L2=13.2,
-    L1=13.2,
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1000.65e3), P(start=68.48e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      zl(fixed=true, start=0.43),
-      Kvl=1,
-      V=53,
-      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
-      Mp=53227,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      P(fixed=true, start=2216584),
-      hl(start=806345),
-      hv(start=1063490),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
-            519,519.4}),
-      Tp(start=509)),
-    Ce1(P(start=7100000)),
-    pipe_1(
-      z2=0.3,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000}),
-      Tp(start={500,501,502,503,504,505,506,507,508,510})),
-    pipe_2(
-      z2=0.4,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
-            6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    volumeD1(h(start=953939), P(start=6848000)),
-    volumeD(
-      h(start=812750),
-      dynamic_mass_balance=false,
-      P(start=6872000)),
-    P0c=2200000,
-    pipe_3(
-      steady_state=true,
-      z2=0.7,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-            492,492,492,492,132}),
-      advection=false,
-      inertia=true,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
-            6854000,6853000,6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4})))
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
-                         annotation (Placement(transformation(extent={{-99,-48},
-            {-79,-28}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
-    C2(h_vol_1(start=927700), h(start=927700)))
-                         annotation (Placement(transformation(extent={{-80,34},
-            {-100,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1000,
-        72.06e5; 1533,69.8e5; 1863,69.39e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-194,-8},{-172,
-            14}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
-                   annotation (Placement(transformation(extent={{-196,-88},{
-            -176,-68}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    P0=71.29e5,
-    h0=772.09e3,
-    T0=454.46,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-192,-60},{-150,-16}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53)
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
-      Table=[0,624.97; 378,624.97; 390,592; 438,699; 507,353; 936,252; 1404,176;
-        1872,116; 2340,88; 2500,88])
-                   annotation (Placement(transformation(extent={{-196,78},{-176,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
-        2000,3.e5])
-                   annotation (Placement(transformation(extent={{-194,154},{
-            -174,174}}, rotation=0)));
-  ThermoSysPro.Fluid.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
-      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
-      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
-                          annotation (Placement(transformation(extent={{191,
-            -140},{169,-118}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start=2600e3), h(start=2600e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
-    T(fixed=true, start=461.56),
-    Pm(start=2220000))   annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=650),
-    lambda(fixed=false) = 0.03,
-    L=48.72,
-    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pression_eauA.y, sourceP1.IPressure)
-                                              annotation (Line(points={{-170.9,
-          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
-          -124,88},{-124,55},{-125,55}}));
-  connect(Pression_Turbine.y, sourceP.IPressure)
-                                             annotation (Line(points={{-173,164},
-          {-166,164},{-166,152},{-194,152},{-194,130},{-181.5,130}}));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
-         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
-  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
-    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
-          -111.8}}));
-  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
-    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  connect(Temperature_eauA.y, sourceP1.ISpecificEnthalpyOrTemperature)
-    annotation (Line(points={{-175,-78},{-171,-78},{-171,-49}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})), experiment(StopTime=3000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 9.5.2.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end Islanding;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
+model Islanding
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    P0=22.733e5,
+    h0=2650.6e3)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=false, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
+    Q(fixed=false, start=56),
+    Cvmax(fixed=false) = 354.534,
+    mode_caract=0,
+    Cv(start=70, fixed=false),
+    C1(h_vol_2(start=800e3), h(start=800e3)))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(
+    Dc=0.016,
+    Lc=2.56,
+    PasL=0.027,
+    PasT=0.02338,
+    ec=2e-3,
+    Rv=1.130514,
+    Ns=10,
+    DpfCorr=1.1136,
+    cp=506,
+    rho=7780,
+    lambda=35,
+    COP0l(fixed=false) = 1.23,
+    C2ex(P(start=2220000)),
+    ntubes1=351,
+    ntubes2=351,
+    ntubes3=1319,
+    L3=26.4,
+    L2=13.2,
+    L1=13.2,
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1000.65e3), P(start=68.48e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      zl(fixed=true, start=0.43),
+      Kvl=1,
+      V=53,
+      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
+      Mp=53227,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      P(fixed=true, start=2216584),
+      hl(start=806345),
+      hv(start=1063490),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
+            519,519.4}),
+      Tp(start=509)),
+    Ce1(P(start=7100000)),
+    pipe_1(
+      z2=0.3,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000}),
+      Tp(start={500,501,502,503,504,505,506,507,508,510})),
+    pipe_2(
+      z2=0.4,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
+            6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    volumeD1(h(start=953939), P(start=6848000)),
+    volumeD(
+      h(start=812750),
+      dynamic_mass_balance=false,
+      P(start=6872000)),
+    P0c=2200000,
+    pipe_3(
+      steady_state=true,
+      z2=0.7,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+            492,492,492,492,132}),
+      advection=false,
+      inertia=true,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
+            6854000,6853000,6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4})))
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
+                         annotation (Placement(transformation(extent={{-99,-48},
+            {-79,-28}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
+    C2(h_vol_1(start=927700), h(start=927700)))
+                         annotation (Placement(transformation(extent={{-80,34},
+            {-100,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1000,
+        72.06e5; 1533,69.8e5; 1863,69.39e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-194,-8},{-172,
+            14}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
+                   annotation (Placement(transformation(extent={{-196,-88},{
+            -176,-68}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    P0=71.29e5,
+    h0=772.09e3,
+    T0=454.46,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-192,-60},{-150,-16}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53)
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
+      Table=[0,624.97; 378,624.97; 390,592; 438,699; 507,353; 936,252; 1404,176;
+        1872,116; 2340,88; 2500,88])
+                   annotation (Placement(transformation(extent={{-196,78},{-176,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
+        2000,3.e5])
+                   annotation (Placement(transformation(extent={{-194,154},{
+            -174,174}}, rotation=0)));
+  ThermoSysPro.Fluid.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
+      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
+      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
+                          annotation (Placement(transformation(extent={{191,
+            -140},{169,-118}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start=2600e3), h(start=2600e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
+    T(fixed=true, start=461.56),
+    Pm(start=2220000))   annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=650),
+    lambda(fixed=false) = 0.03,
+    L=48.72,
+    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pression_eauA.y, sourceP1.IPressure)
+                                              annotation (Line(points={{-170.9,
+          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
+          -124,88},{-124,55},{-125,55}}));
+  connect(Pression_Turbine.y, sourceP.IPressure)
+                                             annotation (Line(points={{-173,164},
+          {-166,164},{-166,152},{-194,152},{-194,130},{-181.5,130}}));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
+         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
+  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
+    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
+          -111.8}}));
+  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
+    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  connect(Temperature_eauA.y, sourceP1.ISpecificEnthalpyOrTemperature)
+    annotation (Line(points={{-175,-78},{-171,-78},{-171,-49}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})), experiment(StopTime=3000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 9.5.2.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end Islanding;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo
index 91847a6fbf6035a0ec78cdc1745b9bd0ee80dc23..d6d8c5ca803923695f3d50fffb2ee89d40c35499 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo
@@ -1,306 +1,306 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
-model NegativeFlow
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    P0=22.733e5,
-    h0=2650.6e3)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=false, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
-    Q(fixed=false, start=56),
-    Cvmax(fixed=false) = 354.534,
-    mode_caract=0,
-    Cv(start=70, fixed=false),
-    C1(h_vol_2(start=800e3), h(start=800e3)))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(
-    Dc=0.016,
-    Lc=2.56,
-    PasL=0.027,
-    PasT=0.02338,
-    ec=2e-3,
-    Rv=1.130514,
-    Ns=10,
-    DpfCorr=1.1136,
-    cp=506,
-    rho=7780,
-    lambda=35,
-    COP0l(fixed=false) = 1.23,
-    C2ex(P(start=2220000)),
-    ntubes1=351,
-    ntubes2=351,
-    ntubes3=1319,
-    L3=26.4,
-    L2=13.2,
-    L1=13.2,
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1000.65e3), P(start=68.48e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      zl(fixed=true, start=0.43),
-      Kvl=1,
-      V=53,
-      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
-      Mp=53227,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      P(fixed=true, start=2216584),
-      hl(start=806345),
-      hv(start=1063490),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
-            519,519.4}),
-      Tp(start=509)),
-    Ce1(P(start=7100000)),
-    pipe_1(
-      z2=0.3,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000}),
-      Tp(start={500,501,502,503,504,505,506,507,508,510})),
-    pipe_2(
-      z2=0.4,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
-            6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    volumeD1(h(start=953939), P(start=6848000)),
-    volumeD(
-      h(start=812750),
-      dynamic_mass_balance=false,
-      P(start=6872000)),
-    P0c=2200000,
-    pipe_3(
-      steady_state=true,
-      z2=0.7,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-            492,492,492,492,132}),
-      advection=false,
-      inertia=true,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
-            6854000,6853000,6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4})),
-    continuous_flow_reversal=true)
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
-                         annotation (Placement(transformation(extent={{-99,-48},
-            {-79,-28}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
-    C2(h_vol_1(start=927700), h(start=927700)))
-                         annotation (Placement(transformation(extent={{-80,34},
-            {-100,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
-                   annotation (Placement(transformation(extent={{-194,-8},{-172,
-            14}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
-                   annotation (Placement(transformation(extent={{-196,-88},{
-            -176,-68}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    P0=71.29e5,
-    h0=772.09e3,
-    T0=454.46,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-192,-60},{-150,-16}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53)
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
-        624.97; 300,624.97; 2000,-200; 3000,-200])
-                   annotation (Placement(transformation(extent={{-196,78},{-176,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
-        2000,3.e5])
-                   annotation (Placement(transformation(extent={{-194,154},{
-            -174,174}}, rotation=0)));
-  ThermoSysPro.Fluid.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
-      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
-      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
-                          annotation (Placement(transformation(extent={{191,
-            -140},{169,-118}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start=2600e3), h(start=2600e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
-    T(fixed=true, start=461.56),
-    Pm(start=2220000))   annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=650),
-    lambda(fixed=false) = 0.03,
-    L=48.72,
-    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
-        69.8e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-196,-154},{
-            -174,-132}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pression_eauA.y, sourceP1.IPressure)
-                                              annotation (Line(points={{-170.9,
-          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
-          -124,88},{-124,55},{-125,55}}));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
-         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
-  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
-    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
-          -111.8}}));
-  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
-    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics={
-        Text(
-          extent={{-130,218},{124,158}},
-          lineColor={0,0,255},
-          textString=
-               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-90,-188},{102,-220}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-202,-196},{-100,-210}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{-118,152},{-62,138}},
-          lineColor={0,0,255},
-          textString=
-               "Qmin = 0")}), experiment(StopTime=3000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end NegativeFlow;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
+model NegativeFlow
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    P0=22.733e5,
+    h0=2650.6e3)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=false, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
+    Q(fixed=false, start=56),
+    Cvmax(fixed=false) = 354.534,
+    mode_caract=0,
+    Cv(start=70, fixed=false),
+    C1(h_vol_2(start=800e3), h(start=800e3)))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(
+    Dc=0.016,
+    Lc=2.56,
+    PasL=0.027,
+    PasT=0.02338,
+    ec=2e-3,
+    Rv=1.130514,
+    Ns=10,
+    DpfCorr=1.1136,
+    cp=506,
+    rho=7780,
+    lambda=35,
+    COP0l(fixed=false) = 1.23,
+    C2ex(P(start=2220000)),
+    ntubes1=351,
+    ntubes2=351,
+    ntubes3=1319,
+    L3=26.4,
+    L2=13.2,
+    L1=13.2,
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1000.65e3), P(start=68.48e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      zl(fixed=true, start=0.43),
+      Kvl=1,
+      V=53,
+      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
+      Mp=53227,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      P(fixed=true, start=2216584),
+      hl(start=806345),
+      hv(start=1063490),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
+            519,519.4}),
+      Tp(start=509)),
+    Ce1(P(start=7100000)),
+    pipe_1(
+      z2=0.3,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000}),
+      Tp(start={500,501,502,503,504,505,506,507,508,510})),
+    pipe_2(
+      z2=0.4,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
+            6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    volumeD1(h(start=953939), P(start=6848000)),
+    volumeD(
+      h(start=812750),
+      dynamic_mass_balance=false,
+      P(start=6872000)),
+    P0c=2200000,
+    pipe_3(
+      steady_state=true,
+      z2=0.7,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+            492,492,492,492,132}),
+      advection=false,
+      inertia=true,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
+            6854000,6853000,6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4})),
+    continuous_flow_reversal=true)
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
+                         annotation (Placement(transformation(extent={{-99,-48},
+            {-79,-28}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
+    C2(h_vol_1(start=927700), h(start=927700)))
+                         annotation (Placement(transformation(extent={{-80,34},
+            {-100,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
+                   annotation (Placement(transformation(extent={{-194,-8},{-172,
+            14}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
+                   annotation (Placement(transformation(extent={{-196,-88},{
+            -176,-68}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    P0=71.29e5,
+    h0=772.09e3,
+    T0=454.46,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-192,-60},{-150,-16}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53)
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
+        624.97; 300,624.97; 2000,-200; 3000,-200])
+                   annotation (Placement(transformation(extent={{-196,78},{-176,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
+        2000,3.e5])
+                   annotation (Placement(transformation(extent={{-194,154},{
+            -174,174}}, rotation=0)));
+  ThermoSysPro.Fluid.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
+      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
+      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
+                          annotation (Placement(transformation(extent={{191,
+            -140},{169,-118}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start=2600e3), h(start=2600e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
+    T(fixed=true, start=461.56),
+    Pm(start=2220000))   annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=650),
+    lambda(fixed=false) = 0.03,
+    L=48.72,
+    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
+        69.8e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-196,-154},{
+            -174,-132}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pression_eauA.y, sourceP1.IPressure)
+                                              annotation (Line(points={{-170.9,
+          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
+          -124,88},{-124,55},{-125,55}}));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
+         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
+  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
+    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
+          -111.8}}));
+  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
+    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics={
+        Text(
+          extent={{-130,218},{124,158}},
+          lineColor={0,0,255},
+          textString=
+               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-90,-188},{102,-220}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-202,-196},{-100,-210}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{-118,152},{-62,138}},
+          lineColor={0,0,255},
+          textString=
+               "Qmin = 0")}), experiment(StopTime=3000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end NegativeFlow;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo
index ceaa6aee218d508cfb1a4ba98426b062fbb3da63..cb44bd415cda83b7ab554a74aa45cec0ab866251 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo
@@ -1,306 +1,306 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
-model ZeroFlow
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    P0=22.733e5,
-    h0=2650.6e3)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=false, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
-    Q(fixed=false, start=56),
-    Cvmax(fixed=false) = 354.534,
-    mode_caract=0,
-    Cv(start=70, fixed=false),
-    C1(h_vol_2(start=800e3), h(start=800e3)))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(
-    Dc=0.016,
-    Lc=2.56,
-    PasL=0.027,
-    PasT=0.02338,
-    ec=2e-3,
-    Rv=1.130514,
-    Ns=10,
-    DpfCorr=1.1136,
-    cp=506,
-    rho=7780,
-    lambda=35,
-    COP0l(fixed=false) = 1.23,
-    C2ex(P(start=2220000)),
-    ntubes1=351,
-    ntubes2=351,
-    ntubes3=1319,
-    L3=26.4,
-    L2=13.2,
-    L1=13.2,
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1000.65e3), P(start=68.48e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      zl(fixed=true, start=0.43),
-      Kvl=1,
-      V=53,
-      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
-      Mp=53227,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      P(fixed=true, start=2216584),
-      hl(start=806345),
-      hv(start=1063490),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
-            519,519.4}),
-      Tp(start=509)),
-    Ce1(P(start=7100000)),
-    pipe_1(
-      z2=0.3,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000}),
-      Tp(start={500,501,502,503,504,505,506,507,508,510})),
-    pipe_2(
-      z2=0.4,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
-      advection=false,
-      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
-            6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    volumeD1(h(start=953939), P(start=6848000)),
-    volumeD(
-      h(start=812750),
-      dynamic_mass_balance=false,
-      P(start=6872000)),
-    P0c=2200000,
-    pipe_3(
-      steady_state=true,
-      z2=0.7,
-      dynamic_mass_balance=true,
-      simplified_dynamic_energy_balance=false,
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-            492,492,492,492,132}),
-      advection=false,
-      inertia=true,
-      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
-            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
-            6854000,6853000,6852000,6851000,6850000,6848000}),
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4})),
-    continuous_flow_reversal=true)
-    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
-            0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
-                         annotation (Placement(transformation(extent={{-99,-48},
-            {-79,-28}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
-    C2(h_vol_1(start=927700), h(start=927700)))
-                         annotation (Placement(transformation(extent={{-80,34},
-            {-100,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
-                   annotation (Placement(transformation(extent={{-194,-8},{-172,
-            14}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
-                   annotation (Placement(transformation(extent={{-196,-88},{
-            -176,-68}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    P0=71.29e5,
-    h0=772.09e3,
-    T0=454.46,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53)
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
-        624.97; 300,624.97; 2000,0; 3000,0])
-                   annotation (Placement(transformation(extent={{-196,78},{-176,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
-        2000,3.e5])
-                   annotation (Placement(transformation(extent={{-194,154},{
-            -174,174}}, rotation=0)));
-  ThermoSysPro.Fluid.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
-      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
-      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
-                          annotation (Placement(transformation(extent={{191,
-            -140},{169,-118}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start=2600e3), h(start=2600e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
-    T(fixed=true, start=461.56),
-    Pm(start=2220000))   annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=650),
-    lambda(fixed=false) = 0.03,
-    L=48.72,
-    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
-        69.8e5; 2340,68.8e5; 2500,68.8e5])
-                   annotation (Placement(transformation(extent={{-196,-154},{
-            -174,-132}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Pression_eauA.y, sourceP1.IPressure)
-                                              annotation (Line(points={{-170.9,
-          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
-          -124,88},{-124,55},{-125,55}}));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
-         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
-  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
-    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
-          -111.8}}));
-  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
-    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}}), graphics={
-        Text(
-          extent={{-130,218},{124,158}},
-          lineColor={0,0,255},
-          textString=
-               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-90,-188},{102,-220}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-202,-196},{-100,-210}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{-118,152},{-62,138}},
-          lineColor={0,0,255},
-          textString=
-               "Qmin = 0")}), experiment(StopTime=3000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end ZeroFlow;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater;
+model ZeroFlow
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    P0=22.733e5,
+    h0=2650.6e3)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=false, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
+    Q(fixed=false, start=56),
+    Cvmax(fixed=false) = 354.534,
+    mode_caract=0,
+    Cv(start=70, fixed=false),
+    C1(h_vol_2(start=800e3), h(start=800e3)))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(
+    Dc=0.016,
+    Lc=2.56,
+    PasL=0.027,
+    PasT=0.02338,
+    ec=2e-3,
+    Rv=1.130514,
+    Ns=10,
+    DpfCorr=1.1136,
+    cp=506,
+    rho=7780,
+    lambda=35,
+    COP0l(fixed=false) = 1.23,
+    C2ex(P(start=2220000)),
+    ntubes1=351,
+    ntubes2=351,
+    ntubes3=1319,
+    L3=26.4,
+    L2=13.2,
+    L1=13.2,
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,   515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1000.65e3), P(start=68.48e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      zl(fixed=true, start=0.43),
+      Kvl=1,
+      V=53,
+      Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)),
+      Mp=53227,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      P(fixed=true, start=2216584),
+      hl(start=806345),
+      hv(start=1063490),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4,
+            519,519.4}),
+      Tp(start=509)),
+    Ce1(P(start=7100000)),
+    pipe_1(
+      z2=0.3,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000}),
+      Tp(start={500,501,502,503,504,505,506,507,508,510})),
+    pipe_2(
+      z2=0.4,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={132,132,132,132,132,132,132,132,132,132,132}),
+      advection=false,
+      P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000,
+            6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    volumeD1(h(start=953939), P(start=6848000)),
+    volumeD(
+      h(start=812750),
+      dynamic_mass_balance=false,
+      P(start=6872000)),
+    P0c=2200000,
+    pipe_3(
+      steady_state=true,
+      z2=0.7,
+      dynamic_mass_balance=true,
+      simplified_dynamic_energy_balance=false,
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+            492,492,492,492,132}),
+      advection=false,
+      inertia=true,
+      P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000,
+            6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000,
+            6854000,6853000,6852000,6851000,6850000,6848000}),
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4})),
+    continuous_flow_reversal=true)
+    annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation=
+            0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3)
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(Q(fixed=false, start=650), K=35)
+                         annotation (Placement(transformation(extent={{-99,-48},
+            {-79,-28}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(Q(fixed=false, start=650), K=30,
+    C2(h_vol_1(start=927700), h(start=927700)))
+                         annotation (Placement(transformation(extent={{-80,34},
+            {-100,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA(Table=[0,71.29e5; 3000,71.29e5])
+                   annotation (Placement(transformation(extent={{-194,-8},{-172,
+            14}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Temperature_eauA(Table=[0,454.46; 448,454.46; 1155,407.76; 2000,407.76])
+                   annotation (Placement(transformation(extent={{-196,-88},{
+            -176,-68}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    P0=71.29e5,
+    h0=772.09e3,
+    T0=454.46,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-192,-16},{-150,-60}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53)
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0,
+        624.97; 300,624.97; 2000,0; 3000,0])
+                   annotation (Placement(transformation(extent={{-196,78},{-176,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_Turbine(Table=[0,22.733e5; 378,22.733e5; 418,11.18e5; 1145,3.e5;
+        2000,3.e5])
+                   annotation (Placement(transformation(extent={{-194,154},{
+            -174,174}}, rotation=0)));
+  ThermoSysPro.Fluid.Examples.Control.Condenser_LevelControl_RE5 regulation_Niveau(
+      add(k1=+1, k2=-1), pIsat1(Limiteur1(u(signal(start=0.8))))) annotation (
+      Placement(transformation(extent={{140,-146},{102,-110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43)
+                          annotation (Placement(transformation(extent={{191,
+            -140},{169,-118}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start=2600e3), h(start=2600e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3,
+    T(fixed=true, start=461.56),
+    Pm(start=2220000))   annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,2.9e5; 2000,2.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=650),
+    lambda(fixed=false) = 0.03,
+    L=48.72,
+    D=0.387)             annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_eauA1(Table=[0,71.29e5; 378,71.29e5; 438,77e5; 597,73.8e5; 1533,
+        69.8e5; 2340,68.8e5; 2500,68.8e5])
+                   annotation (Placement(transformation(extent={{-196,-154},{
+            -174,-132}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Pression_eauA.y, sourceP1.IPressure)
+                                              annotation (Line(points={{-170.9,
+          3},{-172,3},{-172,-10},{-196,-10},{-196,-38},{-181.5,-38}}));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Debit_eauA.y,refQ. IMassFlow) annotation (Line(points={{-175,88},{
+          -124,88},{-124,55},{-125,55}}));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(points=
+         {{167.9,-129},{157.45,-129},{157.45,-122.6},{140.95,-122.6}}));
+  connect(WaterHeating.sortieReelle, regulation_Niveau.MesureNiveauEau)
+    annotation (Line(points={{164.2,-67.68},{184,-67.68},{184,-111.8},{140.95,
+          -111.8}}));
+  connect(regulation_Niveau.SortieReelle1, ControlValve_eau.Ouv)
+    annotation (Line(points={{101.05,-144.2},{98,-144.2},{98,-165}}));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}}), graphics={
+        Text(
+          extent={{-130,218},{124,158}},
+          lineColor={0,0,255},
+          textString=
+               "1 Ouv et 1 Cvmax =false  , Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-90,-188},{102,-220}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-202,-196},{-100,-210}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{-118,152},{-62,138}},
+          lineColor={0,0,255},
+          textString=
+               "Qmin = 0")}), experiment(StopTime=3000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 7.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end ZeroFlow;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.mo
index dbbbb0773274bd82529659ef97e5be190d35748c..3a8ec6b4ce8002aed68bd0658aae11a5825f6c5d 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
-package DynamicWaterHeater
-
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>The models in this package are documented in Sect. 9.5.2.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-</html>"),
-         Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end DynamicWaterHeater;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
+package DynamicWaterHeater
+
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>The models in this package are documented in Sect. 9.5.2.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+</html>"),
+         Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end DynamicWaterHeater;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.order
index 64770142c3f866d91b6b7fa9fa5424ccb708d7b2..04139c4f7ed7bee6668cdbeda4eeeccc79fe60df 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/package.order
@@ -1,3 +1,3 @@
-Islanding
-NegativeFlow
-ZeroFlow
+Islanding
+NegativeFlow
+ZeroFlow
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo
index e5d7b91d1ad72f31e444b1bc2634ba56979d6558..7b8e7848b2f42ae0b6d169f6dc175a2712353f26 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo
@@ -1,195 +1,195 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
-model TestDynamicCondenser
-
-  parameter Real COP1( fixed=false,start=0.7)
-    "Corrective terme for heat exchange coefficient or Fouling coefficient";
-
-  //parameter Modelica.SIunits.MassFlowRate QCRF = 20000 "CRF mass flow rate";
-  //parameter Modelica.SIunits.Position z=1.05 "Liquid level in Cavity";
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Eau(
-                h0=50000, Q0=19000)
-          annotation (Placement(transformation(extent={{-191,-27},{-133,29}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_vapeur(Q0=310, h0=
-        2400e3)
-            annotation (Placement(transformation(extent={{-192,144},{-134,200}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ Puit_condenseur1(Q0=310)
-             annotation (Placement(transformation(extent={{151,-187},{213,-133}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser DynamicCondenser(
-    Dc=0.016,
-    ec=0.5e-3,
-    ntubest=52176,
-    cp=506,
-    rho=7780,
-    lambda=20,
-    Ns=5,
-    Rv=8.15,
-    Vf0=140/2500,
-    Lv=12,
-    L2=12,
-    Ce2(h_vol_1(fixed=false, start=55390), h(fixed=false, start=55390)),
-    ntubesV=223,
-    pipe_3(
-      dynamic_mass_balance=false,
-      inertia=false,
-      simplified_dynamic_energy_balance=true,
-      C2(h(start=55390, fixed=false)),
-      P(start={110000,109000,108000,107000,106000,105000,104000}),
-      h(start={50000,65000,80000,95000,115000,140000,160000})),
-    P0c=3199.2,
-    DynamicCondenser(
-      steady_state=true,
-      Cal_hcond=true,
-      Mp=50e3,
-      Vertical=true,
-      Kpa=0.01,
-      zl(fixed=false, start=0.65),
-      Qcond(start=380),
-      hl(start=105e3),
-      hcond=2e3,
-      COP=COP1,
-      hv(start=115.1e3),
-      P(fixed=true, start=3199.2)))
-                annotation (Placement(transformation(extent={{-47,-52},{71,64}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_Eau(
-    option_temperature=false,
-    P0=100000)
-             annotation (Placement(transformation(extent={{181,-8},{201,12}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PressureLoss_VapeurIn(
-    Q(start=900),
-    K=1e-4,
-    Pm(start=10000))      annotation (Placement(transformation(extent={{-100,
-            162},{-80,182}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve Valve_ext(
-    Q(fixed=false, start=927),
-    C1(P(start=10000), Q(start=927)),
-    Cvmax=15000,
-    Pm(start=10000))      annotation (                          Placement(
-        transformation(extent={{50,-164},{70,-144}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.8)
-                          annotation (Placement(transformation(extent={{113,
-            -123},{91,-101}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PressureLoss_VapeurIn_in4(K=1e-4, Q(fixed=false, start=0.01))
-                         annotation (Placement(transformation(extent={{-102,83},
-            {-82,102}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Vsup1(Q0=0.00001,
-      h0=2759.6e3)
-          annotation (                           Placement(transformation(
-          extent={{-191,65},{-134,119}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_BP(
-      Table=[0,310; 22,310; 24,150; 25,80; 28,15; 31,0.000001; 35,0.000001;
-        1000,0.000001])
-    annotation (Placement(transformation(extent={{-202,182},{-182,202}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PressureLoss_EauOut(
-    K=1e-4,
-    Q(start=20000))              annotation (Placement(transformation(extent={{112,-8},
-            {132,12}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve PressureLoss_VapeurIn1(
-     Q(start=1000))       annotation (Placement(transformation(
-        origin={12,96},
-        extent={{-6,-9},{6,9}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_Eau(Table=[0,
-        19000; 8,3000; 9,1500; 9.6,0.000001; 100,0.000001])
-    annotation (Placement(transformation(extent={{-202,22},{-182,42}}, rotation=
-           0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_GCT1(Table=[0,
-        0.0001; 22,0.0001; 24,2.02; 25,100; 26,150; 28,300; 29.7,590; 30.2,600;
-        30.5,590; 31,570; 35,250; 40,100; 45,15; 47,0.000001; 200,0.000001;
-        1000,0.000001])
-    annotation (Placement(transformation(extent={{-202,110},{-182,130}},
-          rotation=0)));
-equation
-  connect(Source_vapeur.C, PressureLoss_VapeurIn.C1)
-                                               annotation (Line(
-      points={{-134,172},{-100,172}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(DynamicCondenser.C2ex, Valve_ext.C1)
-    annotation (Line(points={{12,-52},{12,-160},{50,-160}}, color={0,0,255}));
-  connect(Valve_ext.C2, Puit_condenseur1.C)
-    annotation (Line(points={{70,-160},{151,-160}}, color={0,0,255}));
-
-  connect(Source_Vsup1.C,PressureLoss_VapeurIn_in4. C1)
-                                           annotation (Line(
-      points={{-134,92},{-100,92},{-100,92.5},{-102,92.5}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(DynamicCondenser.Ce2, PressureLoss_EauOut.C1) annotation (Line(
-      points={{70.41,5.42},{112,5.42},{112,2}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(PressureLoss_EauOut.C2, Puit_Eau.C) annotation (Line(
-      points={{132,2},{181,2}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(DynamicCondenser.C1vap, PressureLoss_VapeurIn1.C2) annotation (Line(
-      points={{12,64},{12,90}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Source_vapeur.IMassFlow, Vapeur_BP.y)
-    annotation (Line(points={{-163,186},{-163,192},{-181,192}}, thickness=0.5));
-  connect(Source_Eau.C, DynamicCondenser.Ce1) annotation (Line(
-      points={{-133,1},{-49.5,1},{-49.5,5.42},{-47,5.42}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(DynamicCondenser.C2vap, PressureLoss_VapeurIn_in4.C2) annotation (
-      Line(
-      points={{-11.01,59.36},{-18,59.36},{-18,92.5},{-82,92.5}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Level.y, Valve_ext.Ouv)
-    annotation (Line(points={{89.9,-112},{60,-112},{60,-143}}));
-  connect(Debit_Eau.y, Source_Eau.IMassFlow)
-    annotation (Line(points={{-181,32},{-162,32},{-162,15}}, thickness=0.5));
-  connect(PressureLoss_VapeurIn.C2, PressureLoss_VapeurIn1.C1) annotation (Line(
-      points={{-80,172},{12,172},{12,102}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Source_Vsup1.IMassFlow, Vapeur_GCT1.y) annotation (Line(points={{
-          -162.5,105.5},{-162.5,120},{-181,120}}, thickness=0.5));
-  annotation (Diagram(graphics,
-                      coordinateSystem(preserveAspectRatio=false,extent={{-200,
-            -200},{200,200}})),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-        info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 9.5.4.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    experiment(StopTime=500),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestDynamicCondenser;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
+model TestDynamicCondenser
+
+  parameter Real COP1( fixed=false,start=0.7)
+    "Corrective terme for heat exchange coefficient or Fouling coefficient";
+
+  //parameter Modelica.SIunits.MassFlowRate QCRF = 20000 "CRF mass flow rate";
+  //parameter Modelica.SIunits.Position z=1.05 "Liquid level in Cavity";
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Eau(
+                h0=50000, Q0=19000)
+          annotation (Placement(transformation(extent={{-191,-27},{-133,29}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_vapeur(Q0=310, h0=
+        2400e3)
+            annotation (Placement(transformation(extent={{-192,144},{-134,200}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ Puit_condenseur1(Q0=310)
+             annotation (Placement(transformation(extent={{151,-187},{213,-133}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser DynamicCondenser(
+    Dc=0.016,
+    ec=0.5e-3,
+    ntubest=52176,
+    cp=506,
+    rho=7780,
+    lambda=20,
+    Ns=5,
+    Rv=8.15,
+    Vf0=140/2500,
+    Lv=12,
+    L2=12,
+    Ce2(h_vol_1(fixed=false, start=55390), h(fixed=false, start=55390)),
+    ntubesV=223,
+    pipe_3(
+      dynamic_mass_balance=false,
+      inertia=false,
+      simplified_dynamic_energy_balance=true,
+      C2(h(start=55390, fixed=false)),
+      P(start={110000,109000,108000,107000,106000,105000,104000}),
+      h(start={50000,65000,80000,95000,115000,140000,160000})),
+    P0c=3199.2,
+    DynamicCondenser(
+      steady_state=true,
+      Cal_hcond=true,
+      Mp=50e3,
+      Vertical=true,
+      Kpa=0.01,
+      zl(fixed=false, start=0.65),
+      Qcond(start=380),
+      hl(start=105e3),
+      hcond=2e3,
+      COP=COP1,
+      hv(start=115.1e3),
+      P(fixed=true, start=3199.2)))
+                annotation (Placement(transformation(extent={{-47,-52},{71,64}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_Eau(
+    option_temperature=false,
+    P0=100000)
+             annotation (Placement(transformation(extent={{181,-8},{201,12}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PressureLoss_VapeurIn(
+    Q(start=900),
+    K=1e-4,
+    Pm(start=10000))      annotation (Placement(transformation(extent={{-100,
+            162},{-80,182}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve Valve_ext(
+    Q(fixed=false, start=927),
+    C1(P(start=10000), Q(start=927)),
+    Cvmax=15000,
+    Pm(start=10000))      annotation (                          Placement(
+        transformation(extent={{50,-164},{70,-144}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.8)
+                          annotation (Placement(transformation(extent={{113,
+            -123},{91,-101}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PressureLoss_VapeurIn_in4(K=1e-4, Q(fixed=false, start=0.01))
+                         annotation (Placement(transformation(extent={{-102,83},
+            {-82,102}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Vsup1(Q0=0.00001,
+      h0=2759.6e3)
+          annotation (                           Placement(transformation(
+          extent={{-191,65},{-134,119}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_BP(
+      Table=[0,310; 22,310; 24,150; 25,80; 28,15; 31,0.000001; 35,0.000001;
+        1000,0.000001])
+    annotation (Placement(transformation(extent={{-202,182},{-182,202}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PressureLoss_EauOut(
+    K=1e-4,
+    Q(start=20000))              annotation (Placement(transformation(extent={{112,-8},
+            {132,12}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve PressureLoss_VapeurIn1(
+     Q(start=1000))       annotation (Placement(transformation(
+        origin={12,96},
+        extent={{-6,-9},{6,9}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_Eau(Table=[0,
+        19000; 8,3000; 9,1500; 9.6,0.000001; 100,0.000001])
+    annotation (Placement(transformation(extent={{-202,22},{-182,42}}, rotation=
+           0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_GCT1(Table=[0,
+        0.0001; 22,0.0001; 24,2.02; 25,100; 26,150; 28,300; 29.7,590; 30.2,600;
+        30.5,590; 31,570; 35,250; 40,100; 45,15; 47,0.000001; 200,0.000001;
+        1000,0.000001])
+    annotation (Placement(transformation(extent={{-202,110},{-182,130}},
+          rotation=0)));
+equation
+  connect(Source_vapeur.C, PressureLoss_VapeurIn.C1)
+                                               annotation (Line(
+      points={{-134,172},{-100,172}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(DynamicCondenser.C2ex, Valve_ext.C1)
+    annotation (Line(points={{12,-52},{12,-160},{50,-160}}, color={0,0,255}));
+  connect(Valve_ext.C2, Puit_condenseur1.C)
+    annotation (Line(points={{70,-160},{151,-160}}, color={0,0,255}));
+
+  connect(Source_Vsup1.C,PressureLoss_VapeurIn_in4. C1)
+                                           annotation (Line(
+      points={{-134,92},{-100,92},{-100,92.5},{-102,92.5}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(DynamicCondenser.Ce2, PressureLoss_EauOut.C1) annotation (Line(
+      points={{70.41,5.42},{112,5.42},{112,2}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(PressureLoss_EauOut.C2, Puit_Eau.C) annotation (Line(
+      points={{132,2},{181,2}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(DynamicCondenser.C1vap, PressureLoss_VapeurIn1.C2) annotation (Line(
+      points={{12,64},{12,90}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Source_vapeur.IMassFlow, Vapeur_BP.y)
+    annotation (Line(points={{-163,186},{-163,192},{-181,192}}, thickness=0.5));
+  connect(Source_Eau.C, DynamicCondenser.Ce1) annotation (Line(
+      points={{-133,1},{-49.5,1},{-49.5,5.42},{-47,5.42}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(DynamicCondenser.C2vap, PressureLoss_VapeurIn_in4.C2) annotation (
+      Line(
+      points={{-11.01,59.36},{-18,59.36},{-18,92.5},{-82,92.5}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Level.y, Valve_ext.Ouv)
+    annotation (Line(points={{89.9,-112},{60,-112},{60,-143}}));
+  connect(Debit_Eau.y, Source_Eau.IMassFlow)
+    annotation (Line(points={{-181,32},{-162,32},{-162,15}}, thickness=0.5));
+  connect(PressureLoss_VapeurIn.C2, PressureLoss_VapeurIn1.C1) annotation (Line(
+      points={{-80,172},{12,172},{12,102}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Source_Vsup1.IMassFlow, Vapeur_GCT1.y) annotation (Line(points={{
+          -162.5,105.5},{-162.5,120},{-181,120}}, thickness=0.5));
+  annotation (Diagram(graphics,
+                      coordinateSystem(preserveAspectRatio=false,extent={{-200,
+            -200},{200,200}})),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+        info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 9.5.4.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    experiment(StopTime=500),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestDynamicCondenser;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo
index 69d45aff80b1ad9099406681c3b98926be5d2d09..d2173991ecac7ac6bc4fec51bc5fdf4c94206a9a 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo
@@ -1,83 +1,83 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
-model TestDynamicOnePhaseFlowShell
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell
-    dynamicOnePhaseFlowPipeShell(
-    Q(start={30,30,30,30,30,30,30,30,30,30,30}),
-    Ds=1,
-    ntubes=520,
-    L=12,
-    P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000,
-          1973000,1965000,1955000,1950000})) annotation (Placement(
-        transformation(extent={{-48,-36},{48,36}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature=false, P0(fixed=
-         false) = 1900000)
-                 annotation (Placement(transformation(extent={{74,-15},{102,15}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    h0=600e3,
-    Q(start=500, fixed=true),
-    P0=2000000)
-             annotation (Placement(transformation(extent={{-103,-15},{-75,15}},
-          rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    lambda=10,
-    Ns=10,
-    cpw=460,
-    rhow=7900,
-    D=0.017,
-    e=0.002,
-    ntubes=520,
-    L=12) annotation (Placement(transformation(extent={{-54,30},{54,58}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    option_temperature=2,
-    W0={-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6},
-    T0={300,300,300,300,300,300,300,300,300,300})
-                  annotation (Placement(transformation(extent={{-12,76},{12,98}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Initialvalue=20e5,
-    Starttime=300,
-    Duration=600,
-    Finalvalue=19.8e5)
-                     annotation (Placement(transformation(extent={{-100,32},{
-            -80,52}}, rotation=0)));
-equation
-  connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1)
-    annotation (Line(points={{-75,0},{-48,0}}, color={0,0,255}));
-  connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C)
-    annotation (Line(points={{48,0},{74,0}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh)
-    annotation (Line(points={{0,41.2},{0,10.8}}, color={191,95,0}));
-  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,
-          76.22},{0,46.8}}, color={191,95,0}));
-  connect(rampe.y, sourceP.IPressure)
-    annotation (Line(points={{-79,42},{-70,42},{-70,24},{-98,24},{-98,0},{-96,0}}));
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 9.4.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"),
-    experiment(StopTime=2000));
-end TestDynamicOnePhaseFlowShell;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
+model TestDynamicOnePhaseFlowShell
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell
+    dynamicOnePhaseFlowPipeShell(
+    Q(start={30,30,30,30,30,30,30,30,30,30,30}),
+    Ds=1,
+    ntubes=520,
+    L=12,
+    P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000,
+          1973000,1965000,1955000,1950000})) annotation (Placement(
+        transformation(extent={{-48,-36},{48,36}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature=false, P0(fixed=
+         false) = 1900000)
+                 annotation (Placement(transformation(extent={{74,-15},{102,15}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    h0=600e3,
+    Q(start=500, fixed=true),
+    P0=2000000)
+             annotation (Placement(transformation(extent={{-103,-15},{-75,15}},
+          rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    lambda=10,
+    Ns=10,
+    cpw=460,
+    rhow=7900,
+    D=0.017,
+    e=0.002,
+    ntubes=520,
+    L=12) annotation (Placement(transformation(extent={{-54,30},{54,58}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    option_temperature=2,
+    W0={-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6},
+    T0={300,300,300,300,300,300,300,300,300,300})
+                  annotation (Placement(transformation(extent={{-12,76},{12,98}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Initialvalue=20e5,
+    Starttime=300,
+    Duration=600,
+    Finalvalue=19.8e5)
+                     annotation (Placement(transformation(extent={{-100,32},{
+            -80,52}}, rotation=0)));
+equation
+  connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1)
+    annotation (Line(points={{-75,0},{-48,0}}, color={0,0,255}));
+  connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C)
+    annotation (Line(points={{48,0},{74,0}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh)
+    annotation (Line(points={{0,41.2},{0,10.8}}, color={191,95,0}));
+  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,
+          76.22},{0,46.8}}, color={191,95,0}));
+  connect(rampe.y, sourceP.IPressure)
+    annotation (Line(points={{-79,42},{-70,42},{-70,24},{-98,24},{-98,0},{-96,0}}));
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 9.4.3.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"),
+    experiment(StopTime=2000));
+end TestDynamicOnePhaseFlowShell;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo
index 1b15dc808e4d44c3a7995742fa86cced31021fd4..bfd9f7093aa004c31f454804230d28450f7cd4fc 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo
@@ -1,82 +1,82 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
-model TestDynamicPlateHeatExchanger
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger
-    echangeurAPlaques1D1(
-    Ns=5,
-    Sc(Q(fixed=true, start=1036)),
-    region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    Qc(start={39464.19306563736,39464.19140625,39464.19140625,39464.19140625,39464.19140625,
-          39464.19140625}),
-    hc(start={280049.6746505721,280050.4252984669,280051.8112565058,280040.0015809256,
-          280303.05286784086,275103.35213299847,70825.9016030344}),
-    hf(start={100000.0,280103.55213273736,280154.0094354263,279724.06541591545,289300.73217909626,
-          100000.0,100000.0}),
-    Pf(start={300190.97994125,300159.55033252,300128.12100957,300096.69221392,300065.25892599,
-          300033.92449902,300000}),
-    hbf(start={280076.2239838133,280103.55213273736,280154.0094354263,279724.06541591545,
-          289300.73217909626,100000.0}),
-    muc2(start={0.0004220110175304796,0.00042196254388820765,0.0004219131741885822,
-          0.00042188258281012253,0.0004214613445406211,0.0004289079959529233}),
-    muf2(start={0.0004219971888386315,0.00042195825821082143,0.00042188643245605134,
-          0.0004224986924487388,0.00040920745505383134,0.0009148967539000273}))
-         annotation (Placement(transformation(extent={{-14,6},{6,26}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(T0=340, region=
-        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (Placement(transformation(extent={{-74,6},{-54,26}},   rotation=
-            0)));
-  BoundaryConditions.SourceP                    sourcePQ(region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-      Q(start=1084))                        annotation (Placement(
-        transformation(extent={{-54,-14},{-34,6}},   rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed=false)=
-      100000, region=
-        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                         annotation (Placement(transformation(
-          extent={{46,6},{66,26}},   rotation=0)));
-  BoundaryConditions.SinkP                    puitsP3(region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                          annotation (Placement(transformation(
-          extent={{26,-14},{46,6}},   rotation=0)));
-equation
-  connect(sourceP2.C, echangeurAPlaques1D1.Ec)
-    annotation (Line(points={{-54,16},{-14,16}},   color={0,0,255}));
-  connect(sourcePQ.C, echangeurAPlaques1D1.Ef)
-                                              annotation (Line(points={{-34,-4},
-          {-9,-4},{-9,10}},     color={0,0,255}));
-  connect(echangeurAPlaques1D1.Sc, puitsP2.C)
-                                            annotation (Line(points={{6,16},{46,
-          16}},     color={0,0,255}));
-  connect(echangeurAPlaques1D1.Sf, puitsP3.C)
-                                             annotation (Line(points={{1,10},{0,
-          10},{0,-4},{26,-4}},         color={0,0,255}));
-  annotation (Diagram(graphics={Text(
-          extent={{72,24},{92,6}},
-          lineColor={0,0,255},
-          textString=
-               "Qc=true")}), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 9.6.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestDynamicPlateHeatExchanger;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
+model TestDynamicPlateHeatExchanger
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger
+    echangeurAPlaques1D1(
+    Ns=5,
+    Sc(Q(fixed=true, start=1036)),
+    region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    Qc(start={39464.19306563736,39464.19140625,39464.19140625,39464.19140625,39464.19140625,
+          39464.19140625}),
+    hc(start={280049.6746505721,280050.4252984669,280051.8112565058,280040.0015809256,
+          280303.05286784086,275103.35213299847,70825.9016030344}),
+    hf(start={100000.0,280103.55213273736,280154.0094354263,279724.06541591545,289300.73217909626,
+          100000.0,100000.0}),
+    Pf(start={300190.97994125,300159.55033252,300128.12100957,300096.69221392,300065.25892599,
+          300033.92449902,300000}),
+    hbf(start={280076.2239838133,280103.55213273736,280154.0094354263,279724.06541591545,
+          289300.73217909626,100000.0}),
+    muc2(start={0.0004220110175304796,0.00042196254388820765,0.0004219131741885822,
+          0.00042188258281012253,0.0004214613445406211,0.0004289079959529233}),
+    muf2(start={0.0004219971888386315,0.00042195825821082143,0.00042188643245605134,
+          0.0004224986924487388,0.00040920745505383134,0.0009148967539000273}))
+         annotation (Placement(transformation(extent={{-14,6},{6,26}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(T0=340, region=
+        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (Placement(transformation(extent={{-74,6},{-54,26}},   rotation=
+            0)));
+  BoundaryConditions.SourceP                    sourcePQ(region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+      Q(start=1084))                        annotation (Placement(
+        transformation(extent={{-54,-14},{-34,6}},   rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed=false)=
+      100000, region=
+        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                         annotation (Placement(transformation(
+          extent={{46,6},{66,26}},   rotation=0)));
+  BoundaryConditions.SinkP                    puitsP3(region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                          annotation (Placement(transformation(
+          extent={{26,-14},{46,6}},   rotation=0)));
+equation
+  connect(sourceP2.C, echangeurAPlaques1D1.Ec)
+    annotation (Line(points={{-54,16},{-14,16}},   color={0,0,255}));
+  connect(sourcePQ.C, echangeurAPlaques1D1.Ef)
+                                              annotation (Line(points={{-34,-4},
+          {-9,-4},{-9,10}},     color={0,0,255}));
+  connect(echangeurAPlaques1D1.Sc, puitsP2.C)
+                                            annotation (Line(points={{6,16},{46,
+          16}},     color={0,0,255}));
+  connect(echangeurAPlaques1D1.Sf, puitsP3.C)
+                                             annotation (Line(points={{1,10},{0,
+          10},{0,-4},{26,-4}},         color={0,0,255}));
+  annotation (Diagram(graphics={Text(
+          extent={{72,24},{92,6}},
+          lineColor={0,0,255},
+          textString=
+               "Qc=true")}), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 9.6.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestDynamicPlateHeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo
index a68f18af8437d1e93bf41e2d25baa9898cb2187a..40f7585d25b0deb367bb466addd52f03d8cf0e8b 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo
@@ -1,84 +1,84 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
-model TestDynamicTwoPhaseFlowPipe
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(
-    L=10,
-    D=0.03,
-    dpfCorr(fixed=false,
-      start=0.2396333653343408)=
-                           1,
-    P(start={2000000.0,1999571.707027408,1999140.94021676,1998707.6248918818,
-          1998271.6837222823,1997833.0364982954,1997391.599890757,
-          1996715.8221090273,1995640.018272837,1994163.014585635,
-          1992283.4952231126,1990000.0}))
-                            annotation (Placement(transformation(extent={{-40,-48},
-            {40,10}},      rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    C(Q(fixed=true, start=1)),
-    option_temperature=false,
-    h0=800e3,
-    P0=2000000)
-    annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(
-    option_temperature=false,
-    h0=2000e3,
-    P0=19.9e5)
-    annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
-    option_temperature=2,
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4})
-    annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(            Ns=10,
-    L=10,
-    lambda=10,
-    cpw=460,
-    rhow=7900,
-    e=0.005,
-    D=0.03)
-    annotation (Placement(transformation(extent={{-40,-28},{40,52}},rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Initialvalue=20e5,
-    Starttime=300,
-    Duration=600,
-    Finalvalue=19.8e5)
-                     annotation (Placement(transformation(extent={{-74,-4},{-86,
-            7}}, rotation=0)));
-equation
-  connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1) annotation (Line(points={{-70,-18},
-          {-42,-18},{-42,-22},{-42,-20},{-42,-19},{-40,-19}},          color={0,
-          0,255}));
-  connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C) annotation (Line(points={{40,-19},
-          {40,-19},{40,-18},{70,-18}},      color={0,0,255}));
-  connect(heatSource1.C, heatExchangerWall1.WT2)
-    annotation (Line(points={{0,31.2},{0,18},{0,20}},    color={191,95,0}));
-  connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh)
-    annotation (Line(points={{0,4},{0,-10.3}},   color={191,95,0}));
-  connect(rampe.y, sourceP1.IPressure)
-    annotation (Line(points={{-86.6,1.5},{-92,1.5},{-92,-18},{-85,-18}}));
-  annotation (experiment(StopTime=1500), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 9.4.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestDynamicTwoPhaseFlowPipe;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
+model TestDynamicTwoPhaseFlowPipe
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(
+    L=10,
+    D=0.03,
+    dpfCorr(fixed=false,
+      start=0.2396333653343408)=
+                           1,
+    P(start={2000000.0,1999571.707027408,1999140.94021676,1998707.6248918818,
+          1998271.6837222823,1997833.0364982954,1997391.599890757,
+          1996715.8221090273,1995640.018272837,1994163.014585635,
+          1992283.4952231126,1990000.0}))
+                            annotation (Placement(transformation(extent={{-40,-48},
+            {40,10}},      rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    C(Q(fixed=true, start=1)),
+    option_temperature=false,
+    h0=800e3,
+    P0=2000000)
+    annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(
+    option_temperature=false,
+    h0=2000e3,
+    P0=19.9e5)
+    annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
+    option_temperature=2,
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4})
+    annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(            Ns=10,
+    L=10,
+    lambda=10,
+    cpw=460,
+    rhow=7900,
+    e=0.005,
+    D=0.03)
+    annotation (Placement(transformation(extent={{-40,-28},{40,52}},rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Initialvalue=20e5,
+    Starttime=300,
+    Duration=600,
+    Finalvalue=19.8e5)
+                     annotation (Placement(transformation(extent={{-74,-4},{-86,
+            7}}, rotation=0)));
+equation
+  connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1) annotation (Line(points={{-70,-18},
+          {-42,-18},{-42,-22},{-42,-20},{-42,-19},{-40,-19}},          color={0,
+          0,255}));
+  connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C) annotation (Line(points={{40,-19},
+          {40,-19},{40,-18},{70,-18}},      color={0,0,255}));
+  connect(heatSource1.C, heatExchangerWall1.WT2)
+    annotation (Line(points={{0,31.2},{0,18},{0,20}},    color={191,95,0}));
+  connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh)
+    annotation (Line(points={{0,4},{0,-10.3}},   color={191,95,0}));
+  connect(rampe.y, sourceP1.IPressure)
+    annotation (Line(points={{-86.6,1.5},{-92,1.5},{-92,-18},{-85,-18}}));
+  annotation (experiment(StopTime=1500), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 9.4.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestDynamicTwoPhaseFlowPipe;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo
index f328411aa5ea73ab4920f59de4d0c77478bd3d50..ddc064095b48ea0533084bb55dcdfa6d20a5fbe5 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo
@@ -1,116 +1,116 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
-model TestNTUWaterHeater
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1(
-    Q0=1788.90,
-    h0=760.83e3,
-    P0=8270000)
-          annotation (Placement(transformation(extent={{-174,-16},{-154,4}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2
-             annotation (Placement(transformation(extent={{137,-16},{157,4}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1(
-    option_temperature=false,
-    P0=17.49e5,
-    h0=2432.50e3)
-            annotation (Placement(transformation(extent={{-174,84},{-154,104}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss6(K=1e-4)
-                          annotation (Placement(transformation(extent={{-111,
-            -16},{-91,4}},     rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss7(K=1e-4)
-                          annotation (Placement(transformation(extent={{-110,84},
-            {-90,104}},      rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3
-             annotation (Placement(transformation(extent={{136,-75},{156,-55}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss8(K=1e-4)
-                          annotation (Placement(transformation(extent={{75,-16},
-            {95,4}},    rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss9(K=1e-4)
-                          annotation (Placement(transformation(extent={{75,-75},
-            {95,-55}},  rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1(
-    HeiF(start=900000),
-    HDesF(start=900000),
-    Hep(start=500000),
-    SCondDes=5752,
-    Ee(
-      P(start=82e5),
-      h_vol_2(start=760000),
-      Q(start=1790),
-      h(start=780000)),
-    Ep(Q(start=118)),
-    Ev(P(start=27.22e5), h_vol_2(start=2430000)),
-    KCond(fixed=false) = 5024,
-    KPurge(fixed=false) = 1767,
-    Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)),
-    lambdaE(fixed=false) = 67.1,
-    SPurge=1458,
-    Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true)))
-                      annotation (Placement(transformation(extent={{-66,-77},{
-            50,65}},  rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss10(
-                          K=1e-4)
-                          annotation (Placement(transformation(extent={{-110,35},
-            {-90,55}},       rotation=0)));
-  BoundaryConditions.SourceQ                     Drain_inlet1(
-    Q0=118.02,
-    h0=889.89e3)
-          annotation (Placement(transformation(extent={{-174,35},{-154,55}},
-          rotation=0)));
-equation
-  connect(Water_inlet1.C, singularPressureLoss6.C1)
-    annotation (Line(points={{-154,-6},{-111,-6}},     color={0,0,255}));
-  connect(Steam_inlet1.C, singularPressureLoss7.C1)
-    annotation (Line(points={{-154,94},{-110,94}},   color={0,0,255}));
-  connect(singularPressureLoss8.C2, Puit_condenseur2.C)
-    annotation (Line(points={{95,-6},{137,-6}},     color={0,0,255}));
-  connect(singularPressureLoss9.C2,Puit_condenseur3. C)
-    annotation (Line(points={{95,-65},{136,-65}},   color={0,0,255}));
-  connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev)
-                                                        annotation (Line(points={{-90,94},
-          {26.8,94},{26.8,18.14}},              color={0,0,255}));
-  connect(nTUWaterHeating1.Se, singularPressureLoss8.C1)
-    annotation (Line(points={{50,-6},{75,-6}},     color={0,0,255}));
-  connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp)
-    annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}));
-  connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee)
-    annotation (Line(points={{-91,-6},{-66,-6}},        color={0,0,255}));
-  connect(Drain_inlet1.C, singularPressureLoss10.C1)
-    annotation (Line(points={{-154,45},{-110,45}},   color={0,0,255}));
-  connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep)
-                                                        annotation (Line(points={{-90,45},
-          {-42.8,45},{-42.8,18.14}},              color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 9.5.5.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestNTUWaterHeater;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
+model TestNTUWaterHeater
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1(
+    Q0=1788.90,
+    h0=760.83e3,
+    P0=8270000)
+          annotation (Placement(transformation(extent={{-174,-16},{-154,4}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2
+             annotation (Placement(transformation(extent={{137,-16},{157,4}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1(
+    option_temperature=false,
+    P0=17.49e5,
+    h0=2432.50e3)
+            annotation (Placement(transformation(extent={{-174,84},{-154,104}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss6(K=1e-4)
+                          annotation (Placement(transformation(extent={{-111,
+            -16},{-91,4}},     rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss7(K=1e-4)
+                          annotation (Placement(transformation(extent={{-110,84},
+            {-90,104}},      rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3
+             annotation (Placement(transformation(extent={{136,-75},{156,-55}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss8(K=1e-4)
+                          annotation (Placement(transformation(extent={{75,-16},
+            {95,4}},    rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss9(K=1e-4)
+                          annotation (Placement(transformation(extent={{75,-75},
+            {95,-55}},  rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1(
+    HeiF(start=900000),
+    HDesF(start=900000),
+    Hep(start=500000),
+    SCondDes=5752,
+    Ee(
+      P(start=82e5),
+      h_vol_2(start=760000),
+      Q(start=1790),
+      h(start=780000)),
+    Ep(Q(start=118)),
+    Ev(P(start=27.22e5), h_vol_2(start=2430000)),
+    KCond(fixed=false) = 5024,
+    KPurge(fixed=false) = 1767,
+    Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)),
+    lambdaE(fixed=false) = 67.1,
+    SPurge=1458,
+    Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true)))
+                      annotation (Placement(transformation(extent={{-66,-77},{
+            50,65}},  rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss10(
+                          K=1e-4)
+                          annotation (Placement(transformation(extent={{-110,35},
+            {-90,55}},       rotation=0)));
+  BoundaryConditions.SourceQ                     Drain_inlet1(
+    Q0=118.02,
+    h0=889.89e3)
+          annotation (Placement(transformation(extent={{-174,35},{-154,55}},
+          rotation=0)));
+equation
+  connect(Water_inlet1.C, singularPressureLoss6.C1)
+    annotation (Line(points={{-154,-6},{-111,-6}},     color={0,0,255}));
+  connect(Steam_inlet1.C, singularPressureLoss7.C1)
+    annotation (Line(points={{-154,94},{-110,94}},   color={0,0,255}));
+  connect(singularPressureLoss8.C2, Puit_condenseur2.C)
+    annotation (Line(points={{95,-6},{137,-6}},     color={0,0,255}));
+  connect(singularPressureLoss9.C2,Puit_condenseur3. C)
+    annotation (Line(points={{95,-65},{136,-65}},   color={0,0,255}));
+  connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev)
+                                                        annotation (Line(points={{-90,94},
+          {26.8,94},{26.8,18.14}},              color={0,0,255}));
+  connect(nTUWaterHeating1.Se, singularPressureLoss8.C1)
+    annotation (Line(points={{50,-6},{75,-6}},     color={0,0,255}));
+  connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp)
+    annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}));
+  connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee)
+    annotation (Line(points={{-91,-6},{-66,-6}},        color={0,0,255}));
+  connect(Drain_inlet1.C, singularPressureLoss10.C1)
+    annotation (Line(points={{-154,45},{-110,45}},   color={0,0,255}));
+  connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep)
+                                                        annotation (Line(points={{-90,45},
+          {-42.8,45},{-42.8,18.14}},              color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 9.5.5.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestNTUWaterHeater;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo
index 9ccd204e76411a236db0cd0fb22fe59084bfea2c..786e769ddd5b757c84970a0974b4aa726997fc31 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo
@@ -1,116 +1,116 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
-model TestSimpleDynamicCondenser
-
-parameter Real L1 = 425 "First sensor chain length";
-parameter Integer Ns1 = 80 "Number of cells in the first sensor chain";
-
-parameter Real L2 = 75 "Second sensor chain length";
-parameter Integer Ns2 = 1 "Number of cells in the second sensor chain";
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(
-    P0=1e5,
-    option_temperature=false) annotation (Placement(transformation(extent={{48,30},
-            {88,70}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe(                                                          K=1e-6, Q(start=
-          0.598447))
-    annotation (Placement(transformation(
-        origin={-90,-38},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau(
-    option_temperature=false,
-    h0=2401e3,
-    P0=15050)                   annotation (Placement(transformation(extent={{-207,
-            148},{-183,170}},      rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau(
-                  h0=191812, Q0=192)
-                          annotation (Placement(transformation(extent={{-184,
-            -52},{-208,-24}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0=29804.5, h0=113e3)
-                                annotation (Placement(transformation(extent={{-212,30},
-            {-172,68}},          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe1(                                                         K=1e-6)
-    annotation (Placement(transformation(
-        origin={36,50},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe2(                                                         K=1e-6)
-    annotation (Placement(transformation(
-        origin={-154,49},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe3(K(fixed=false) = 1e-3, Q(start=192, fixed=true))
-    annotation (Placement(transformation(
-        origin={-120,159},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    yNiveau(signal(fixed=false, start=1.5)),
-    Vf0=0.15,
-    steady_state=false,
-    P(fixed=false, start=10000))
-                     annotation (Placement(transformation(extent={{-118,6},{1,
-            116}}, rotation=0)));
-equation
-
-  connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(
-        points={{-172,49},{-160,49}}, color={0,0,255}));
-  connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(
-        points={{42,50},{48,50}}, color={0,0,255}));
-  connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(
-        points={{-183,159},{-130,159}}, color={0,0,255}));
-  connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2)
-    annotation (Line(points={{-184,-38},{-100,-38}}));
-  connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{
-          -148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255}));
-  connect(PerteChargeCondPompe.C1, Condenseur.Cl)
-    annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}}));
-  connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{
-          -110,159},{-58.5,159},{-58.5,116}}, color={0,0,255}));
-  connect(PerteChargeCondPompe1.C1, Condenseur.Cse)
-    annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-60},{130,180}},
-        grid={2,2},
-        initialScale=0.1), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This model is documented in Sect. 9.5.3.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end TestSimpleDynamicCondenser;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
+model TestSimpleDynamicCondenser
+
+parameter Real L1 = 425 "First sensor chain length";
+parameter Integer Ns1 = 80 "Number of cells in the first sensor chain";
+
+parameter Real L2 = 75 "Second sensor chain length";
+parameter Integer Ns2 = 1 "Number of cells in the second sensor chain";
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(
+    P0=1e5,
+    option_temperature=false) annotation (Placement(transformation(extent={{48,30},
+            {88,70}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe(                                                          K=1e-6, Q(start=
+          0.598447))
+    annotation (Placement(transformation(
+        origin={-90,-38},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau(
+    option_temperature=false,
+    h0=2401e3,
+    P0=15050)                   annotation (Placement(transformation(extent={{-207,
+            148},{-183,170}},      rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau(
+                  h0=191812, Q0=192)
+                          annotation (Placement(transformation(extent={{-184,
+            -52},{-208,-24}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0=29804.5, h0=113e3)
+                                annotation (Placement(transformation(extent={{-212,30},
+            {-172,68}},          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe1(                                                         K=1e-6)
+    annotation (Placement(transformation(
+        origin={36,50},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe2(                                                         K=1e-6)
+    annotation (Placement(transformation(
+        origin={-154,49},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe3(K(fixed=false) = 1e-3, Q(start=192, fixed=true))
+    annotation (Placement(transformation(
+        origin={-120,159},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    yNiveau(signal(fixed=false, start=1.5)),
+    Vf0=0.15,
+    steady_state=false,
+    P(fixed=false, start=10000))
+                     annotation (Placement(transformation(extent={{-118,6},{1,
+            116}}, rotation=0)));
+equation
+
+  connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(
+        points={{-172,49},{-160,49}}, color={0,0,255}));
+  connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(
+        points={{42,50},{48,50}}, color={0,0,255}));
+  connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(
+        points={{-183,159},{-130,159}}, color={0,0,255}));
+  connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2)
+    annotation (Line(points={{-184,-38},{-100,-38}}));
+  connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{
+          -148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255}));
+  connect(PerteChargeCondPompe.C1, Condenseur.Cl)
+    annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}}));
+  connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{
+          -110,159},{-58.5,159},{-58.5,116}}, color={0,0,255}));
+  connect(PerteChargeCondPompe1.C1, Condenseur.Cse)
+    annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-60},{130,180}},
+        grid={2,2},
+        initialScale=0.1), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This model is documented in Sect. 9.5.3.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>.</h4>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end TestSimpleDynamicCondenser;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo
index 46a2faf52c89c55a877c5f1269cf1d424cfa95d7..785c3231ee4c25973a5c87e041c8f032d7cf4ec0 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
-model TestStaticCondenser
-
-  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000)
-    "Flow pressure at inlet 1 (sourceP)";
-  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000)
-    "Flow pressure at inlet 2 (sourceP1)";
-  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000)
-    "Flow pressure at inlet 3 (sourceP2)";
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur(P0(fixed=false) = 100000)
-             annotation (Placement(transformation(extent={{158,-15},{178,5}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    P0=Pin_1,
-    C(Q(fixed=true, start=832.66)),
-    h0=2275.10e3)
-            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    option_temperature=false,
-    h0=2.5481e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_2)                     annotation (Placement(transformation(extent={
-            {-182,80},{-162,100}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-    option_temperature=false,
-    h0=2.5055e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_3)                      annotation (Placement(transformation(extent=
-            {{-180,40},{-160,60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss(K=10)
-                         annotation (Placement(transformation(extent={{-100,80},
-            {-80,100}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=10)
-                          annotation (Placement(transformation(extent={{-100,40},
-            {-80,60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=10)
-                          annotation (Placement(transformation(extent={{-40,140},
-            {-20,160}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4)
-                          annotation (Placement(transformation(extent={{98,-15},
-            {118,5}},  rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4)
-                          annotation (Placement(transformation(extent={{40,-100},
-            {60,-80}}, rotation=0)));
-
-  ThermoSysPro.Fluid.HeatExchangers.StaticCondenser              condenseur(
-    SCO=47786,
-    z=0,
-    CPCE=0,
-    KCO=3400.57,
-    QC0=37700)     annotation (Placement(transformation(
-          extent={{-24,-24},{68,74}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur(
-    h0=60e3,
-    C(P(fixed=true, start=328800)),
-    Q0(fixed=true) = 42261)
-          annotation (Placement(transformation(extent={{-189,-25},{-146,15}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss              singularPressureLoss2(K=1e-3)
-                          annotation (Placement(transformation(extent={{-101,
-            -15},{-81,5}},
-                       rotation=0)));
-equation
-  connect(sourceP1.C, singularPressureLoss.C1)
-    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
-  connect(sourceP2.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, Puit_condenseur.C)
-    annotation (Line(points={{118,-5},{158,-5}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
-    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, condenseur.Cvt)
-    annotation (Line(points={{-20,150},{22,150},{22,74.49}}, color={0,0,255}));
-  connect(Source_condenseur.C,singularPressureLoss2. C1)
-    annotation (Line(points={{-146,-5},{-101,-5}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2,condenseur. Cee) annotation (Line(points={{-81,-5},
-          {-54,-5},{-54,-4.89},{-24,-4.89}},       color={0,0,255}));
-  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
-          -80,50},{-54,50},{-54,34.31},{-24,34.31}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
-          -80,90},{-62,90},{-40,90},{-40,54.89},{-24,54.89}}, color={0,0,255}));
-  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
-          68.92,-4.89},{83.46,-4.89},{83.46,-5},{98,-5}}, color={0,0,255}));
-  connect(condenseur.Cex, singularPressureLoss5.C1) annotation (Line(points={{22.46,
-          -24},{22.46,-90},{40,-90}},          color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics,
-                                                 coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 9.7.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestStaticCondenser;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
+model TestStaticCondenser
+
+  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000)
+    "Flow pressure at inlet 1 (sourceP)";
+  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000)
+    "Flow pressure at inlet 2 (sourceP1)";
+  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000)
+    "Flow pressure at inlet 3 (sourceP2)";
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur(P0(fixed=false) = 100000)
+             annotation (Placement(transformation(extent={{158,-15},{178,5}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    P0=Pin_1,
+    C(Q(fixed=true, start=832.66)),
+    h0=2275.10e3)
+            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    option_temperature=false,
+    h0=2.5481e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_2)                     annotation (Placement(transformation(extent={
+            {-182,80},{-162,100}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+    option_temperature=false,
+    h0=2.5055e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_3)                      annotation (Placement(transformation(extent=
+            {{-180,40},{-160,60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss(K=10)
+                         annotation (Placement(transformation(extent={{-100,80},
+            {-80,100}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=10)
+                          annotation (Placement(transformation(extent={{-100,40},
+            {-80,60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=10)
+                          annotation (Placement(transformation(extent={{-40,140},
+            {-20,160}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4)
+                          annotation (Placement(transformation(extent={{98,-15},
+            {118,5}},  rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4)
+                          annotation (Placement(transformation(extent={{40,-100},
+            {60,-80}}, rotation=0)));
+
+  ThermoSysPro.Fluid.HeatExchangers.StaticCondenser              condenseur(
+    SCO=47786,
+    z=0,
+    CPCE=0,
+    KCO=3400.57,
+    QC0=37700)     annotation (Placement(transformation(
+          extent={{-24,-24},{68,74}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur(
+    h0=60e3,
+    C(P(fixed=true, start=328800)),
+    Q0(fixed=true) = 42261)
+          annotation (Placement(transformation(extent={{-189,-25},{-146,15}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss              singularPressureLoss2(K=1e-3)
+                          annotation (Placement(transformation(extent={{-101,
+            -15},{-81,5}},
+                       rotation=0)));
+equation
+  connect(sourceP1.C, singularPressureLoss.C1)
+    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
+  connect(sourceP2.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, Puit_condenseur.C)
+    annotation (Line(points={{118,-5},{158,-5}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
+    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, condenseur.Cvt)
+    annotation (Line(points={{-20,150},{22,150},{22,74.49}}, color={0,0,255}));
+  connect(Source_condenseur.C,singularPressureLoss2. C1)
+    annotation (Line(points={{-146,-5},{-101,-5}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2,condenseur. Cee) annotation (Line(points={{-81,-5},
+          {-54,-5},{-54,-4.89},{-24,-4.89}},       color={0,0,255}));
+  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
+          -80,50},{-54,50},{-54,34.31},{-24,34.31}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
+          -80,90},{-62,90},{-40,90},{-40,54.89},{-24,54.89}}, color={0,0,255}));
+  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
+          68.92,-4.89},{83.46,-4.89},{83.46,-5},{98,-5}}, color={0,0,255}));
+  connect(condenseur.Cex, singularPressureLoss5.C1) annotation (Line(points={{22.46,
+          -24},{22.46,-90},{40,-90}},          color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics,
+                                                 coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 9.7.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestStaticCondenser;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo
index 565bf963e8e6db0a09b474675d21a2fbfb1f2ebe..6b610df9db05d8e24beaef4f91d91ad23d300946 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo
@@ -1,93 +1,93 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
-model TestStaticPlateHeatExchanger
-
-  ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques1(
-    Sp=2,
-    Sc(Q(fixed=true, start=1036.78)),
-    region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-         annotation (Placement(transformation(extent={{-10,30},{10,50}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-                                           T0=340)
-    annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
-                                            annotation (Placement(
-        transformation(extent={{-50,10},{-30,30}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed=false)=
-      100000)                            annotation (Placement(transformation(
-          extent={{50,30},{70,50}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3
-                                          annotation (Placement(transformation(
-          extent={{30,10},{50,30}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques(region_c=
-        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                                                               annotation (Placement(transformation(extent={{-10,-34},{10,-14}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceP6(
-                                           T0=340)
-    annotation (Placement(transformation(extent={{-70,-34},{-50,-14}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceP7
-                                            annotation (Placement(
-        transformation(extent={{-50,-54},{-30,-34}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP              puitsP6
-                                         annotation (Placement(transformation(
-          extent={{50,-34},{70,-14}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP              puitsP7
-                                          annotation (Placement(transformation(
-          extent={{30,-54},{50,-34}}, rotation=0)));
-equation
-  connect(sourceP2.C, echangeurAPlaques1.Ec)
-    annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255}));
-  connect(sourceP3.C, echangeurAPlaques1.Ef)  annotation (Line(points={{-30,20},
-          {-5,20},{-5,34}},   color={0,0,255}));
-  connect(echangeurAPlaques1.Sc, puitsP2.C) annotation (Line(points={{10,40.2},
-          {30,40.2},{30,40},{50,40}}, color={0,0,255}));
-  connect(echangeurAPlaques1.Sf, puitsP3.C)  annotation (Line(points={{5,34},{4,
-          34},{4,20},{30,20}},       color={0,0,255}));
-  connect(sourceP6.C, echangeurAPlaques.Ec)
-    annotation (Line(points={{-50,-24},{-10,-24}}, color={0,0,255}));
-  connect(sourceP7.C, echangeurAPlaques.Ef)
-    annotation (Line(points={{-30,-44},{-5,-44},{-5,-30}}, color={0,0,255}));
-  connect(echangeurAPlaques.Sc, puitsP6.C) annotation (Line(points={{10,-23.8},
-          {30,-23.8},{30,-24},{50,-24}}, color={0,0,255}));
-  connect(echangeurAPlaques.Sf, puitsP7.C) annotation (Line(points={{5,-30},{4,
-          -30},{4,-44},{30,-44}}, color={0,0,255}));
-  annotation (Diagram(graphics={
-        Text(
-          extent={{72,48},{92,30}},
-          lineColor={0,0,255},
-          textString=
-               "Qc=true"),
-        Text(
-          extent={{-28,-52},{26,-60}},
-          lineColor={0,0,255},
-          textString="Crossing error")}),
-                                        Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 9.6.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestStaticPlateHeatExchanger;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger;
+model TestStaticPlateHeatExchanger
+
+  ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques1(
+    Sp=2,
+    Sc(Q(fixed=true, start=1036.78)),
+    region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+         annotation (Placement(transformation(extent={{-10,30},{10,50}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+                                           T0=340)
+    annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
+                                            annotation (Placement(
+        transformation(extent={{-50,10},{-30,30}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed=false)=
+      100000)                            annotation (Placement(transformation(
+          extent={{50,30},{70,50}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3
+                                          annotation (Placement(transformation(
+          extent={{30,10},{50,30}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques(region_c=
+        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                                                               annotation (Placement(transformation(extent={{-10,-34},{10,-14}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceP6(
+                                           T0=340)
+    annotation (Placement(transformation(extent={{-70,-34},{-50,-14}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceP7
+                                            annotation (Placement(
+        transformation(extent={{-50,-54},{-30,-34}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP              puitsP6
+                                         annotation (Placement(transformation(
+          extent={{50,-34},{70,-14}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP              puitsP7
+                                          annotation (Placement(transformation(
+          extent={{30,-54},{50,-34}}, rotation=0)));
+equation
+  connect(sourceP2.C, echangeurAPlaques1.Ec)
+    annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255}));
+  connect(sourceP3.C, echangeurAPlaques1.Ef)  annotation (Line(points={{-30,20},
+          {-5,20},{-5,34}},   color={0,0,255}));
+  connect(echangeurAPlaques1.Sc, puitsP2.C) annotation (Line(points={{10,40.2},
+          {30,40.2},{30,40},{50,40}}, color={0,0,255}));
+  connect(echangeurAPlaques1.Sf, puitsP3.C)  annotation (Line(points={{5,34},{4,
+          34},{4,20},{30,20}},       color={0,0,255}));
+  connect(sourceP6.C, echangeurAPlaques.Ec)
+    annotation (Line(points={{-50,-24},{-10,-24}}, color={0,0,255}));
+  connect(sourceP7.C, echangeurAPlaques.Ef)
+    annotation (Line(points={{-30,-44},{-5,-44},{-5,-30}}, color={0,0,255}));
+  connect(echangeurAPlaques.Sc, puitsP6.C) annotation (Line(points={{10,-23.8},
+          {30,-23.8},{30,-24},{50,-24}}, color={0,0,255}));
+  connect(echangeurAPlaques.Sf, puitsP7.C) annotation (Line(points={{5,-30},{4,
+          -30},{4,-44},{30,-44}}, color={0,0,255}));
+  annotation (Diagram(graphics={
+        Text(
+          extent={{72,48},{92,30}},
+          lineColor={0,0,255},
+          textString=
+               "Qc=true"),
+        Text(
+          extent={{-28,-52},{26,-60}},
+          lineColor={0,0,255},
+          textString="Crossing error")}),
+                                        Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 9.6.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestStaticPlateHeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/package.mo
index a40189f83b947a5d8d93479cccf865ccba709c4d..c525bdce7624dbe6447e8d63bcfac824b173b60a 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package HeatExchanger "Heat exchanger modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end HeatExchanger;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package HeatExchanger "Heat exchanger modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end HeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/package.order
index c754feb7d3939a5db34a0c18a09d159d325eb2b4..7f3a864c294f252cb3160efb937e04832f86d11f 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/package.order
@@ -1,9 +1,9 @@
-TestDynamicTwoPhaseFlowPipe
-TestDynamicOnePhaseFlowShell
-DynamicWaterHeater
-TestSimpleDynamicCondenser
-TestDynamicCondenser
-TestNTUWaterHeater
-TestDynamicPlateHeatExchanger
-TestStaticPlateHeatExchanger
-TestStaticCondenser
+TestDynamicTwoPhaseFlowPipe
+TestDynamicOnePhaseFlowShell
+DynamicWaterHeater
+TestSimpleDynamicCondenser
+TestDynamicCondenser
+TestNTUWaterHeater
+TestDynamicPlateHeatExchanger
+TestStaticPlateHeatExchanger
+TestStaticCondenser
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo
index 2b5533df3194db28c59409807e5af77bb1e20f0c..ba8db9a4731cb38f30386dd655fb0740b0e2e41b 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo
@@ -1,113 +1,113 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.InternalCombustionEngine;
-model TestInternalCombustionEngine
-  parameter Integer NCEL = 7;
-
-  Combustion.BoundaryConditions.FuelSourcePQ                    fuelSourcePQ(
-    Hum=0,
-    Xh=0.25,
-    Xs=0,
-    Xashes=0,
-    Xc=0.75,
-    Xo=0,
-    Xn=0,
-    Q0=0.0676,
-    rho=0.744,
-    LHV=50e6,
-    T0(displayUnit="K") = 299,
-    P0=210300,
-    Vol=100) annotation (Placement(transformation(extent={{-106,-81},{-72,-43}},
-          rotation=0)));
-  BoundaryConditions.SourcePQ                    sourceAir(
-    Xso2=0,
-    Xco2=0,
-    Xh2o=0.005,
-    Xo2=0.23,
-    Q0=1.9627,
-    T0=30 + 273.16,
-    option_temperature=true,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=191000)
-    annotation (Placement(transformation(extent={{111,-79},{73,-45}},rotation=0)));
-  BoundaryConditions.Sink                    sink(option_temperature=true)
-                                                  annotation (Placement(transformation(
-          extent={{0,44},{44,86}},  rotation=0)));
-  BoundaryConditions.SourcePQ                    SourcePQ_Water(
-    Q0=15.3,
-    h0=334.41e3,
-    P0=410000)
-    annotation (Placement(transformation(extent={{-107,-19},{-71,15}},rotation=
-            0)));
-  Machines.InternalCombustionEngine                    alternatingEngine(
-    mechanical_efficiency_type=2,
-    Rmeca_nom=0.41,
-    Coef_Rm_a=-5.4727e-9,
-    Coef_Rm_b=4.9359e-5,
-    Coef_Rm_c=0.30814,
-    Xpth=0.05,
-    MMg=20,
-    DPe=1,
-    RV=6.45,
-    Kc=1.28,
-    Kd=1.33,
-    Wmeca(start=1400e3),
-    Welec(start=1358e3),
-    Wcomb(start=3.4942e6),
-    exc(start=1.8),
-    Gamma=1.2085,
-    Tsf(start=1088.15))
-    annotation (Placement(transformation(extent={{-44,-46},{44,42}})));
-  BoundaryConditions.Sink                    Sink_Water1 annotation (Placement(
-        transformation(extent={{75,-19},{111,15}}, rotation=0)));
-  PressureLosses.SingularPressureLoss                    singularPressureLoss
-    annotation (Placement(transformation(extent={{-63,-8},{-51,4}})));
-  PressureLosses.SingularPressureLoss                    singularPressureLoss1
-    annotation (Placement(transformation(extent={{51,-9},{65,5}})));
-equation
-  connect(alternatingEngine.Cair,sourceAir. C) annotation (Line(
-      points={{0,-41.6},{0,-62},{73,-62}},
-      color={0,0,0},
-      thickness=1));
-  connect(alternatingEngine.Cfuel,fuelSourcePQ. C) annotation (Line(points={{-30.8,
-          -41.6},{-30.8,-62},{-72,-62}}, color={0,0,0}));
-  connect(SourcePQ_Water.C,singularPressureLoss. C1)
-    annotation (Line(points={{-71,-2},{-63,-2}},
-                                               color={0,0,255}));
-  connect(alternatingEngine.Cws1,singularPressureLoss. C2) annotation (Line(
-        points={{-39.6,-2},{-51,-2}},                     color={0,0,255}));
-  connect(alternatingEngine.Cws2,singularPressureLoss1. C1)
-    annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255}));
-  connect(Sink_Water1.C,singularPressureLoss1. C2)
-    annotation (Line(points={{75,-2},{75,-2},{65,-2}}, color={0,0,255}));
-  connect(alternatingEngine.Cfg,sink. C) annotation (Line(
-      points={{0,37.6},{0,65},{0,65}},
-      color={0,0,0},
-      thickness=1));
-  annotation (         Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 15.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestInternalCombustionEngine;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.InternalCombustionEngine;
+model TestInternalCombustionEngine
+  parameter Integer NCEL = 7;
+
+  Combustion.BoundaryConditions.FuelSourcePQ                    fuelSourcePQ(
+    Hum=0,
+    Xh=0.25,
+    Xs=0,
+    Xashes=0,
+    Xc=0.75,
+    Xo=0,
+    Xn=0,
+    Q0=0.0676,
+    rho=0.744,
+    LHV=50e6,
+    T0(displayUnit="K") = 299,
+    P0=210300,
+    Vol=100) annotation (Placement(transformation(extent={{-106,-81},{-72,-43}},
+          rotation=0)));
+  BoundaryConditions.SourcePQ                    sourceAir(
+    Xso2=0,
+    Xco2=0,
+    Xh2o=0.005,
+    Xo2=0.23,
+    Q0=1.9627,
+    T0=30 + 273.16,
+    option_temperature=true,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=191000)
+    annotation (Placement(transformation(extent={{111,-79},{73,-45}},rotation=0)));
+  BoundaryConditions.Sink                    sink(option_temperature=true)
+                                                  annotation (Placement(transformation(
+          extent={{0,44},{44,86}},  rotation=0)));
+  BoundaryConditions.SourcePQ                    SourcePQ_Water(
+    Q0=15.3,
+    h0=334.41e3,
+    P0=410000)
+    annotation (Placement(transformation(extent={{-107,-19},{-71,15}},rotation=
+            0)));
+  Machines.InternalCombustionEngine                    alternatingEngine(
+    mechanical_efficiency_type=2,
+    Rmeca_nom=0.41,
+    Coef_Rm_a=-5.4727e-9,
+    Coef_Rm_b=4.9359e-5,
+    Coef_Rm_c=0.30814,
+    Xpth=0.05,
+    MMg=20,
+    DPe=1,
+    RV=6.45,
+    Kc=1.28,
+    Kd=1.33,
+    Wmeca(start=1400e3),
+    Welec(start=1358e3),
+    Wcomb(start=3.4942e6),
+    exc(start=1.8),
+    Gamma=1.2085,
+    Tsf(start=1088.15))
+    annotation (Placement(transformation(extent={{-44,-46},{44,42}})));
+  BoundaryConditions.Sink                    Sink_Water1 annotation (Placement(
+        transformation(extent={{75,-19},{111,15}}, rotation=0)));
+  PressureLosses.SingularPressureLoss                    singularPressureLoss
+    annotation (Placement(transformation(extent={{-63,-8},{-51,4}})));
+  PressureLosses.SingularPressureLoss                    singularPressureLoss1
+    annotation (Placement(transformation(extent={{51,-9},{65,5}})));
+equation
+  connect(alternatingEngine.Cair,sourceAir. C) annotation (Line(
+      points={{0,-41.6},{0,-62},{73,-62}},
+      color={0,0,0},
+      thickness=1));
+  connect(alternatingEngine.Cfuel,fuelSourcePQ. C) annotation (Line(points={{-30.8,
+          -41.6},{-30.8,-62},{-72,-62}}, color={0,0,0}));
+  connect(SourcePQ_Water.C,singularPressureLoss. C1)
+    annotation (Line(points={{-71,-2},{-63,-2}},
+                                               color={0,0,255}));
+  connect(alternatingEngine.Cws1,singularPressureLoss. C2) annotation (Line(
+        points={{-39.6,-2},{-51,-2}},                     color={0,0,255}));
+  connect(alternatingEngine.Cws2,singularPressureLoss1. C1)
+    annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255}));
+  connect(Sink_Water1.C,singularPressureLoss1. C2)
+    annotation (Line(points={{75,-2},{75,-2},{65,-2}}, color={0,0,255}));
+  connect(alternatingEngine.Cfg,sink. C) annotation (Line(
+      points={{0,37.6},{0,65},{0,65}},
+      color={0,0,0},
+      thickness=1));
+  annotation (         Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 15.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestInternalCombustionEngine;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/package.mo
index 7e9dac731bc75c5b60dc20d6d456f403c575b6b5..f966131d97f66722c7ddbdb598ee3b784df7c2dc 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package InternalCombustionEngine "Internal combustion engine modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 15 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end InternalCombustionEngine;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package InternalCombustionEngine "Internal combustion engine modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 15 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end InternalCombustionEngine;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/package.order
index fa6254a35d6235cd8271924df2597ebbd87bf0dd..a4fd463dc96ee495a49d3487aaf59abbc3bfa833 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/package.order
@@ -1 +1 @@
-TestInternalCombustionEngine
+TestInternalCombustionEngine
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo
index 761f1f7ddb5bd28557c6211d503f5b0afb6ccd2e..d245ec1fc86c0fcd996172c9ee62c44ecc1694f6 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestBend
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-62,-6},{-42,14}},  rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1
-                                          annotation (Placement(transformation(
-          extent={{41,-34},{61,-14}},
-                                   rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.Bend Bend   annotation (Placement(
-        transformation(extent={{-8,-6},{12,14}}, rotation=0)));
-equation
-  connect(Bend.C2, SinkP1.C)
-    annotation (Line(points={{2,-6},{2,-24},{41,-24}},   color={0,0,255}));
-  connect(SourceP1.C, Bend.C1)
-    annotation (Line(points={{-42,4},{-8,4}},    color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestBend;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestBend
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-62,-6},{-42,14}},  rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1
+                                          annotation (Placement(transformation(
+          extent={{41,-34},{61,-14}},
+                                   rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.Bend Bend   annotation (Placement(
+        transformation(extent={{-8,-6},{12,14}}, rotation=0)));
+equation
+  connect(Bend.C2, SinkP1.C)
+    annotation (Line(points={{2,-6},{2,-24},{41,-24}},   color={0,0,255}));
+  connect(SourceP1.C, Bend.C1)
+    annotation (Line(points={{-42,4},{-8,4}},    color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestBend;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo
index 812f72da0ed6170d7c379bc84353e3debb5f8933..d61faba94291348aeb45d96c2698bac6e5241d67 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo
@@ -1,58 +1,58 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestCheckValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-40,-10},{-20,10}},  rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{40,-10},{60,10}},  rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    amplitude=6e5,
-    width=50,
-    period=100,
-    offset=3e5) annotation (Placement(transformation(extent={{-80,-10},{-60,10}},
-                   rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3
-    annotation (Placement(transformation(extent={{0,-10},{20,10}},   rotation=0)));
-equation
-  connect(sourceP1.C, checkValve3.C1)
-    annotation (Line(points={{-20,0},{-1,0}},      color={0,0,255}));
-  connect(checkValve3.C2, puitsP1.C)
-    annotation (Line(points={{21,0},{40,0}},    color={0,0,255}));
-  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-59,0},{-35,0}}));
-  annotation (experiment(StopTime=200),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.11.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestCheckValve;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestCheckValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-40,-10},{-20,10}},  rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{40,-10},{60,10}},  rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    amplitude=6e5,
+    width=50,
+    period=100,
+    offset=3e5) annotation (Placement(transformation(extent={{-80,-10},{-60,10}},
+                   rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3
+    annotation (Placement(transformation(extent={{0,-10},{20,10}},   rotation=0)));
+equation
+  connect(sourceP1.C, checkValve3.C1)
+    annotation (Line(points={{-20,0},{-1,0}},      color={0,0,255}));
+  connect(checkValve3.C2, puitsP1.C)
+    annotation (Line(points={{21,0},{40,0}},    color={0,0,255}));
+  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-59,0},{-35,0}}));
+  annotation (experiment(StopTime=200),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.11.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestCheckValve;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo
index 22bd25dec4f3814110382e2e14a1fca0c7052ef7..db28ee93cf3d474b0b4ccaae0c72d9c43110b9ee 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo
@@ -1,59 +1,59 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestControlValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-64,-10},{-44,10}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{44,-10},{64,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve(mode_caract=1, caract=[
-        0,0; 0.5,3000; 0.75,7000; 1,8000])
-                                          annotation (Placement(transformation(
-          extent={{-10,-4},{10,16}},rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(Table=[0,
-        0.9; 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2])
-    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
-equation
-  connect(ControlValve.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
-  connect(Constante1.y, ControlValve.Ouv)
-    annotation (Line(points={{-9,40},{0,40},{0,17}},      color={0,0,255}));
-  connect(SourceP1.C, ControlValve.C1)
-    annotation (Line(points={{-44,0},{-44,0},{-10,0}},
-                                                 color={0,0,255}));
-  annotation (experiment(StopTime=80),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.8.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestControlValve;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestControlValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-64,-10},{-44,10}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{44,-10},{64,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve(mode_caract=1, caract=[
+        0,0; 0.5,3000; 0.75,7000; 1,8000])
+                                          annotation (Placement(transformation(
+          extent={{-10,-4},{10,16}},rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(Table=[0,
+        0.9; 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2])
+    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
+equation
+  connect(ControlValve.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
+  connect(Constante1.y, ControlValve.Ouv)
+    annotation (Line(points={{-9,40},{0,40},{0,17}},      color={0,0,255}));
+  connect(SourceP1.C, ControlValve.C1)
+    annotation (Line(points={{-44,0},{-44,0},{-10,0}},
+                                                 color={0,0,255}));
+  annotation (experiment(StopTime=80),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.8.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestControlValve;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo
index 69fdab1e6344b822467aab80d7cff6d24be13b55..df22d5c0f66da22e208662b1518fd3927aed3863 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestDiaphragm
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{44,-10},{64,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm
-                                          annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}},
-                                    rotation=0)));
-equation
-  connect(Diaphragm.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
-  connect(SourceP1.C, Diaphragm.C1)
-    annotation (Line(points={{-44,0},{-10,0}},   color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.7.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestDiaphragm;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestDiaphragm
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{44,-10},{64,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm
+                                          annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}},
+                                    rotation=0)));
+equation
+  connect(Diaphragm.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
+  connect(SourceP1.C, Diaphragm.C1)
+    annotation (Line(points={{-44,0},{-10,0}},   color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.7.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestDiaphragm;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo
index 096f1076503f827083263211b3863f2b128adbfb..b3e32de6803df212acf04138629b377739ba2bd3 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo
@@ -1,60 +1,60 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestDynamicCheckValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-38,-10},{-18,10}},rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{42,-10},{62,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve(J=10)
-    annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(
-    period=100,
-    amplitude=3e5,
-    offset=6e5) annotation (Placement(transformation(extent={{-78,-10},{-58,10}},
-          rotation=0)));
-equation
-  connect(sourceP1.C, checkValve.C1)
-    annotation (Line(points={{-18,0},{2,0}},   color={0,0,255}));
-  connect(checkValve.C2, puitsP1.C) annotation (Line(points={{22,0},{32,0},{42,
-          0}},             color={0,0,255}));
-  connect(sourceP1.IPressure, pulse.y)
-    annotation (Line(points={{-33,0},{-57,0}},   color={28,108,200}));
-  annotation (
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    experiment(StopTime=300),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.12.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestDynamicCheckValve;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestDynamicCheckValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-38,-10},{-18,10}},rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{42,-10},{62,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve(J=10)
+    annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(
+    period=100,
+    amplitude=3e5,
+    offset=6e5) annotation (Placement(transformation(extent={{-78,-10},{-58,10}},
+          rotation=0)));
+equation
+  connect(sourceP1.C, checkValve.C1)
+    annotation (Line(points={{-18,0},{2,0}},   color={0,0,255}));
+  connect(checkValve.C2, puitsP1.C) annotation (Line(points={{22,0},{32,0},{42,
+          0}},             color={0,0,255}));
+  connect(sourceP1.IPressure, pulse.y)
+    annotation (Line(points={{-33,0},{-57,0}},   color={28,108,200}));
+  annotation (
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    experiment(StopTime=300),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.12.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestDynamicCheckValve;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo
index 717a6c90f25ed71e51b5ee4d39b89b58af05bdc9..22efb59ffc0b19723f058cd3a7f42f272574e497 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo
@@ -1,92 +1,92 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestDynamicReliefValve
-
-  ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve ReliefValve(
-    mech_steady_state=false,
-    caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351;
-        0.7,8625; 0.8,8818; 0.9,8958; 1,9063],
-    Cvmax=9063,
-    mode_caract=1,
-    A1=0.125,
-    A2=0.125,
-    z_max=0.6,
-    m=100,
-    Popen=2000000,
-    Q(start=1.4404060369658185E-32))
-    annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe2(
-    Pm(start=199283),
-    Q(start=1335.993983016864))          annotation (Placement(transformation(
-          extent={{40,-20},{60,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink2
-                                   annotation (Placement(transformation(extent=
-            {{80,-20},{100,0}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe1(
-    D=0.4,
-    Pm(start=1478795.1075221882))        annotation (Placement(transformation(
-          extent={{-40,-20},{-20,0}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeD VolumeD1(P(start=298566), h(start=
-          72156.6431966866))         annotation (Placement(transformation(
-          extent={{0,-20},{20,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink1
-                                   annotation (Placement(transformation(extent=
-            {{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-80,-20},{-60,0}})));
-  InstrumentationAndControl.Blocks.Sources.Rampe ramp(
-    Duration=200,
-    Finalvalue=30e5,
-    Initialvalue=15e5)
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}})));
-equation
-  connect(Pipe2.C2, Sink2.C)
-    annotation (Line(points={{60,-10},{80,-10}}, color={0,0,255}));
-  connect(Pipe1.C2, VolumeD1.Ce)
-    annotation (Line(points={{-20,-10},{0,-10}}, color={0,0,255}));
-  connect(VolumeD1.Cs3, Pipe2.C1)
-    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
-  connect(ReliefValve.C1, VolumeD1.Cs1)
-                                     annotation (Line(points={{10,20.2},{10,0}}));
-  connect(ReliefValve.C2, Sink1.C)
-    annotation (Line(points={{20,30},{30,30},{30,30},{40,30}},     color={0,0,
-          255}));
-  connect(sourceP.C, Pipe1.C1)
-    annotation (Line(points={{-60,-10},{-40,-10}}, color={0,0,255}));
-  connect(ramp.y, sourceP.IPressure) annotation (Line(points={{-79,30},{-60,30},
-          {-60,8},{-80,8},{-80,-10},{-75,-10}}, color={28,108,200}));
-  annotation (
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false, initialScale=0.1)),
-    Window(
-      x=0.1,
-      y=0.08,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
-         coordinateSystem(preserveAspectRatio=false, initialScale=0.1)),
-    experiment(StopTime=300),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.13.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestDynamicReliefValve;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestDynamicReliefValve
+
+  ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve ReliefValve(
+    mech_steady_state=false,
+    caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351;
+        0.7,8625; 0.8,8818; 0.9,8958; 1,9063],
+    Cvmax=9063,
+    mode_caract=1,
+    A1=0.125,
+    A2=0.125,
+    z_max=0.6,
+    m=100,
+    Popen=2000000,
+    Q(start=1.4404060369658185E-32))
+    annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe2(
+    Pm(start=199283),
+    Q(start=1335.993983016864))          annotation (Placement(transformation(
+          extent={{40,-20},{60,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink2
+                                   annotation (Placement(transformation(extent=
+            {{80,-20},{100,0}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe1(
+    D=0.4,
+    Pm(start=1478795.1075221882))        annotation (Placement(transformation(
+          extent={{-40,-20},{-20,0}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeD VolumeD1(P(start=298566), h(start=
+          72156.6431966866))         annotation (Placement(transformation(
+          extent={{0,-20},{20,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink1
+                                   annotation (Placement(transformation(extent=
+            {{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-80,-20},{-60,0}})));
+  InstrumentationAndControl.Blocks.Sources.Rampe ramp(
+    Duration=200,
+    Finalvalue=30e5,
+    Initialvalue=15e5)
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}})));
+equation
+  connect(Pipe2.C2, Sink2.C)
+    annotation (Line(points={{60,-10},{80,-10}}, color={0,0,255}));
+  connect(Pipe1.C2, VolumeD1.Ce)
+    annotation (Line(points={{-20,-10},{0,-10}}, color={0,0,255}));
+  connect(VolumeD1.Cs3, Pipe2.C1)
+    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
+  connect(ReliefValve.C1, VolumeD1.Cs1)
+                                     annotation (Line(points={{10,20.2},{10,0}}));
+  connect(ReliefValve.C2, Sink1.C)
+    annotation (Line(points={{20,30},{30,30},{30,30},{40,30}},     color={0,0,
+          255}));
+  connect(sourceP.C, Pipe1.C1)
+    annotation (Line(points={{-60,-10},{-40,-10}}, color={0,0,255}));
+  connect(ramp.y, sourceP.IPressure) annotation (Line(points={{-79,30},{-60,30},
+          {-60,8},{-80,8},{-80,-10},{-75,-10}}, color={28,108,200}));
+  annotation (
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false, initialScale=0.1)),
+    Window(
+      x=0.1,
+      y=0.08,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
+         coordinateSystem(preserveAspectRatio=false, initialScale=0.1)),
+    experiment(StopTime=300),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.13.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestDynamicReliefValve;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo
index 64bc8688babfe507a5621c9985857f61d740cafb..76bab961c1faf0c376623a8b987c2a9ee227e94e 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestLumpedStraightPipe
-
-  ThermoSysPro.Fluid.Volumes.Tank tank1(h0=2e5) annotation (Placement(
-        transformation(extent={{-50,16},{-30,36}},   rotation=0)));
-  ThermoSysPro.Fluid.Volumes.Tank tank2(z0=10) annotation (Placement(
-        transformation(extent={{30,16},{50,36}},   rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    inertia=true,
-    lambda=0.012,
-    lambda_fixed=true) annotation (Placement(transformation(extent={{-10,-24},{
-            10,-4}}, rotation=0)));
-equation
-  connect(tank1.Cs2, lumpedStraightPipe.C1) annotation (Line(points={{-30,20},{
-          -20,20},{-20,-14},{-10,-14}},   color={0,0,255}));
-  connect(lumpedStraightPipe.C2, tank2.Ce2) annotation (Line(points={{10,-14},{
-          20,-14},{20,20},{30,20}},   color={0,0,255}));
-  annotation (experiment(StopTime=100),
-   Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestLumpedStraightPipe;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestLumpedStraightPipe
+
+  ThermoSysPro.Fluid.Volumes.Tank tank1(h0=2e5) annotation (Placement(
+        transformation(extent={{-50,16},{-30,36}},   rotation=0)));
+  ThermoSysPro.Fluid.Volumes.Tank tank2(z0=10) annotation (Placement(
+        transformation(extent={{30,16},{50,36}},   rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    inertia=true,
+    lambda=0.012,
+    lambda_fixed=true) annotation (Placement(transformation(extent={{-10,-24},{
+            10,-4}}, rotation=0)));
+equation
+  connect(tank1.Cs2, lumpedStraightPipe.C1) annotation (Line(points={{-30,20},{
+          -20,20},{-20,-14},{-10,-14}},   color={0,0,255}));
+  connect(lumpedStraightPipe.C2, tank2.Ce2) annotation (Line(points={{10,-14},{
+          20,-14},{20,20},{30,20}},   color={0,0,255}));
+  annotation (experiment(StopTime=100),
+   Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestLumpedStraightPipe;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo
index c5724c17ac63ff081b3536a9579fa327867572a1..6a9c222c7a30dcb5502b8d059b84748a6303740b 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo
@@ -1,56 +1,56 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestPipePressureLoss
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-85,-10},{-65,10}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{64,-10},{84,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss
-                                          annotation (Placement(transformation(
-          extent={{-40,-53},{38,53}},
-                                    rotation=0)));
-equation
-  connect(pipePressureLoss.C2, PuitsP1.C)
-    annotation (Line(points={{38,0},{49,0},{64,0}},
-                                              color={0,0,255}));
-  connect(SourceP1.C, pipePressureLoss.C1)
-    annotation (Line(points={{-65,0},{-65,0},{-40,0}},
-                                                 color={0,0,255}));
-  annotation (
-    experiment(StopTime=1000),
-     Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.4.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestPipePressureLoss;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestPipePressureLoss
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-85,-10},{-65,10}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{64,-10},{84,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss
+                                          annotation (Placement(transformation(
+          extent={{-40,-53},{38,53}},
+                                    rotation=0)));
+equation
+  connect(pipePressureLoss.C2, PuitsP1.C)
+    annotation (Line(points={{38,0},{49,0},{64,0}},
+                                              color={0,0,255}));
+  connect(SourceP1.C, pipePressureLoss.C1)
+    annotation (Line(points={{-65,0},{-65,0},{-40,0}},
+                                                 color={0,0,255}));
+  annotation (
+    experiment(StopTime=1000),
+     Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.4.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestPipePressureLoss;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo
index 8a98c9346b1f710257a56aded31f14a9faa73a29..3f35f36e534365af7ddc50cd803575e6a3347b12 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestSwitchValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-10},{90,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve
-                                          annotation (Placement(transformation(
-          extent={{-18,-9},{18,37}},rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
-                                         width=10, period=20)
-    annotation (Placement(transformation(extent={{-50,31},{-30,51}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP2
-                                        annotation (Placement(transformation(
-          extent={{-55,-10},{-35,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP1
-                                        annotation (Placement(transformation(
-          extent={{34,-10},{54,10}},rotation=0)));
-equation
-  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-29,41},{0,41},{
-          0,30.56}}));
-  connect(SourceP1.C, perteDP2.C1)
-    annotation (Line(points={{-70,0},{-55,0}},   color={0,0,255}));
-  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-35,0},{-20,0},
-          {-20,0.2},{-18,0.2}},       color={0,0,255}));
-  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{18,0.2},{20,
-          0.2},{20,0},{34,0}},     color={0,0,255}));
-  connect(perteDP1.C2, PuitsP1.C)
-    annotation (Line(points={{54,0},{54,0},{70,0}},    color={0,0,255}));
-  annotation (experiment(StopTime=100),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.10.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestSwitchValve;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestSwitchValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-10},{90,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve
+                                          annotation (Placement(transformation(
+          extent={{-18,-9},{18,37}},rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
+                                         width=10, period=20)
+    annotation (Placement(transformation(extent={{-50,31},{-30,51}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP2
+                                        annotation (Placement(transformation(
+          extent={{-55,-10},{-35,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP1
+                                        annotation (Placement(transformation(
+          extent={{34,-10},{54,10}},rotation=0)));
+equation
+  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-29,41},{0,41},{
+          0,30.56}}));
+  connect(SourceP1.C, perteDP2.C1)
+    annotation (Line(points={{-70,0},{-55,0}},   color={0,0,255}));
+  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-35,0},{-20,0},
+          {-20,0.2},{-18,0.2}},       color={0,0,255}));
+  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{18,0.2},{20,
+          0.2},{20,0},{34,0}},     color={0,0,255}));
+  connect(perteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{54,0},{54,0},{70,0}},    color={0,0,255}));
+  annotation (experiment(StopTime=100),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.10.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestSwitchValve;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo
index 539f313594b2703c21e318a7260ae4760a08e297..9edb2c7dafb3e2675181b5349fbd7802723015a8 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo
@@ -1,66 +1,66 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
-model TestThreeWayValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-10},{90,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve(
-    C2(Q(start=-7.902947109890763E-33)),
-    C3(Q(start=2716.4138702433384)),
-    Valve1(Pm(start=200000.0)),
-    VolumeA1(h(start=71016.12237181117)))
-    annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
-                                          annotation (Placement(transformation(
-          extent={{70,-50},{90,-30}},
-                                    rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe
-                                         annotation (Placement(transformation(
-          extent={{-50,30},{-30,50}}, rotation=0)));
-equation
-  connect(SourceP1.C, threeWayValve.C1)
-    annotation (Line(points={{-70,0},{-10,0}},   color={0,0,255}));
-  connect(threeWayValve.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{70,0}},  color={255,0,0}));
-  connect(threeWayValve.C3, PuitsP2.C) annotation (Line(points={{0,-6},{0,-40},
-          {70,-40}},      color={255,0,0}));
-  connect(rampe.y, threeWayValve.Ouv)
-    annotation (Line(points={{-29,40},{0,40},{0,15}}));
-  annotation (experiment(StopTime=5),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 13.9.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestThreeWayValve;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss;
+model TestThreeWayValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-10},{90,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve(
+    C2(Q(start=-7.902947109890763E-33)),
+    C3(Q(start=2716.4138702433384)),
+    Valve1(Pm(start=200000.0)),
+    VolumeA1(h(start=71016.12237181117)))
+    annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
+                                          annotation (Placement(transformation(
+          extent={{70,-50},{90,-30}},
+                                    rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe
+                                         annotation (Placement(transformation(
+          extent={{-50,30},{-30,50}}, rotation=0)));
+equation
+  connect(SourceP1.C, threeWayValve.C1)
+    annotation (Line(points={{-70,0},{-10,0}},   color={0,0,255}));
+  connect(threeWayValve.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{70,0}},  color={255,0,0}));
+  connect(threeWayValve.C3, PuitsP2.C) annotation (Line(points={{0,-6},{0,-40},
+          {70,-40}},      color={255,0,0}));
+  connect(rampe.y, threeWayValve.Ouv)
+    annotation (Line(points={{-29,40},{0,40},{0,15}}));
+  annotation (experiment(StopTime=5),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 13.9.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestThreeWayValve;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/package.mo
index b7a4ba19cb42e645eb2db12b01d4df50a30ffa4d..d43a5da64a20d7dce386ff7a2269433550a4d2bc 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package PressureLoss "Pressure loss modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 13 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end PressureLoss;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package PressureLoss "Pressure loss modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 13 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end PressureLoss;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/package.order
index 34aac4a6c7d1b2c74b5f98840e5fab80aa930a80..2672eecac426c668fefb4c436f2e7c7bd62a7cad 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/package.order
@@ -1,10 +1,10 @@
-TestPipePressureLoss
-TestLumpedStraightPipe
-TestBend
-TestDiaphragm
-TestControlValve
-TestThreeWayValve
-TestSwitchValve
-TestCheckValve
-TestDynamicCheckValve
-TestDynamicReliefValve
+TestPipePressureLoss
+TestLumpedStraightPipe
+TestBend
+TestDiaphragm
+TestControlValve
+TestThreeWayValve
+TestSwitchValve
+TestCheckValve
+TestDynamicCheckValve
+TestDynamicReliefValve
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo
index 3ec56717ccc99ae476e0fe784a67476a575bf1fb..7ad536c2cf11f28fb633be64b84728edf1794dab 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo
@@ -1,160 +1,160 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SolarCollector;
-model TestFresnelField
-
-public
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    ntubes=1,
-    steady_state=true,
-    D=0.07,
-    e=0.004,
-    Ns=30,
-    T0=500,
-    lambda=20,
-    cpw=500,
-    rhow=8000,
-    Tp(start={628.0843201819387,627.9310075597404,627.8220175907211,
-          627.7368992018166,627.6679716601412,627.6112649113921,
-          627.5643995456558,627.5258238160011,627.4944728950805,
-          627.4695948757801,627.4506537300122,627.4372716636091,
-          627.4291939746797,627.426267226699,627.428426585461,627.4356896138493,
-          627.4481553612113,627.4660085346942,627.4895290639054,
-          627.5191082002851,627.5552734790091,627.5987264837852,
-          627.6504001032708,627.7115474128314,627.7838847016081,
-          627.8698331666657,627.9729350144038,629.4253815385038,
-          633.135688507217,636.2622387488283}),
-    Tp1(start={610.2709965207655,610.0984334604643,609.9757644369477,
-          609.8799665740102,609.8023932206363,609.7385750723525,
-          609.6858335131916,609.6424216866362,609.6071408778737,
-          609.5791446660139,609.5578296140685,609.5427704711935,
-          609.533680491646,609.5303869740989,609.5328169418054,609.540990157294,
-          609.5550181389947,609.5751088339957,609.6015773714007,
-          609.6348642175905,609.6755632868924,609.7244644309128,
-          609.7826179283193,609.8514345863706,609.9328467812495,
-          610.0295806069864,610.1456244663702,611.7808730290952,
-          615.9622431406954,619.4903247027197}),
-    Tp2(start={644.9596553467713,644.824579502235,644.7285482944553,
-          644.6535470354397,644.592810046145,644.5428402353538,
-          644.5015416419557,644.4675473586904,644.4399193877858,
-          644.4179953736024,644.4013031238645,644.3895098327511,
-          644.3823911261306,644.3798118348441,644.3817148399042,644.38811560583,
-          644.3991013774125,644.4148348525065,644.4355626048274,
-          644.4616292617266,644.4934994867675,644.531791236838,
-          644.5773261834961,644.6312079828199,644.6949482231629,
-          644.7706792525222,644.8615205623447,646.1407907783827,
-          649.404839172216,652.1510013554424}),
-    L=1e4/11.46)
-    annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
-    dynamicTwoPhaseFlowPipe(
-    ntubes=1,
-    steady_state=true,
-    rugosrel=0.00005,
-    dpfCorr=1,
-    Ns=30,
-    P(start={12512365.778485337,12512269.4730028,12512159.010926897,
-          12512028.619141866,12511878.28140543,12511707.984695798,
-          12511517.718132183,12511307.472416837,12511077.239500606,
-          12510827.012364838,12510556.784871727,12510266.551658653,
-          12509956.30806284,12509626.050068311,12509275.774270097,
-          12508905.477852736,12508515.15858121,12508104.814803492,
-          12507674.445464557,12507224.050132478,12506753.629037917,
-          12506263.183129327,12505752.714147368,12505222.224723859,
-          12504671.718513375,12504101.200370008,12503510.676589508,
-          12502896.415784404,12502231.48634808,12501522.52554151,
-          12500776.553197166,12500000.0}),
-    h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266,
-          1645211.676359884,1681572.2077847784,1717947.2125321354,
-          1754334.1766730088,1790730.9833788855,1827135.788296852,
-          1863546.9394607474,1899962.9220483964,1936382.3178860326,
-          1972803.7739566958,2009225.9764870608,2045647.6282789519,
-          2082067.4276265746,2118484.0474634594,2154896.1134394333,
-          2191302.179544121,2227700.6996020116,2264089.9923674623,
-          2300468.196934767,2336833.213464297,2373182.6211112435,
-          2409513.559261445,2445822.5467506223,2482105.1942732874,
-          2518015.7979130256,2552967.680496474,2587102.355161259,
-          82548.43470391157}),
-    D=0.07,
-    inertia=false,
-    L=1e4/11.46)            annotation (Placement(transformation(extent={{-36,
-            -67},{36,-20}}, rotation=0)));
-  ThermoSysPro.Solar.Collectors.FresnelField champThermosolaireLFR_N(
-    Ns=30,
-    T(start=fill(500, 30)),
-    F12=0.6366,
-    A=1e4,
-    T0=303)
-    annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(
-    h0=2000e3, P0=125e5)          annotation (Placement(transformation(extent={
-            {48,-54},{68,-34}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3)
-               annotation (Placement(transformation(extent={{-69,-53},{-49,-33}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI(
-    Starttime=100,
-    Initialvalue=100,
-    Duration=3600,
-    Finalvalue=900) annotation (Placement(transformation(extent={{72,39},{58,53}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Angles(
-    Starttime=100,
-    Initialvalue=45,
-    Finalvalue=45,
-    Duration=3600)  annotation (Placement(transformation(extent={{-10,59},{4,72}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Q(
-    Starttime=100,
-    Duration=3600,
-    Initialvalue=2,
-    Finalvalue=3)   annotation (Placement(transformation(extent={{-65,-32},{-51,
-            -19}}, rotation=0)));
-equation
-  connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2)
-    annotation (Line(points={{0,1.6},{0,-15.6}}, color={191,95,0}));
-  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(
-        points={{0,-22.4},{0,-36.45}}, color={191,95,0}));
-  connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{36,
-          -43.5},{47,-43.5},{47,-44},{48,-44}}, color={0,0,255}));
-  connect(champThermosolaireLFR_N.SunDNI, DNI.y)
-    annotation (Line(points={{44,45.6},{51,45.6},{51,46},{57.3,46}}));
-  connect(champThermosolaireLFR_N.SunG, Angles.y)
-    annotation (Line(points={{27.2,58.8},{27.2,65.5},{4.7,65.5}}));
-  connect(champThermosolaireLFR_N.SunA, Angles.y)
-    annotation (Line(points={{36.8,58.8},{36.8,70},{6,70},{6,65.5},{4.7,65.5}}));
-  connect(Q.y, sourceP.IMassFlow)
-    annotation (Line(points={{-50.3,-25.5},{-50,-25.5},{-50,-38},{-59,-38}}));
-  connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-49,
-          -43},{-47.5,-43},{-47.5,-43.5},{-36,-43.5}}, color={0,0,255}));
-  annotation (
-      Diagram(graphics),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 16.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    experiment(StopTime=5000));
-end TestFresnelField;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SolarCollector;
+model TestFresnelField
+
+public
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    ntubes=1,
+    steady_state=true,
+    D=0.07,
+    e=0.004,
+    Ns=30,
+    T0=500,
+    lambda=20,
+    cpw=500,
+    rhow=8000,
+    Tp(start={628.0843201819387,627.9310075597404,627.8220175907211,
+          627.7368992018166,627.6679716601412,627.6112649113921,
+          627.5643995456558,627.5258238160011,627.4944728950805,
+          627.4695948757801,627.4506537300122,627.4372716636091,
+          627.4291939746797,627.426267226699,627.428426585461,627.4356896138493,
+          627.4481553612113,627.4660085346942,627.4895290639054,
+          627.5191082002851,627.5552734790091,627.5987264837852,
+          627.6504001032708,627.7115474128314,627.7838847016081,
+          627.8698331666657,627.9729350144038,629.4253815385038,
+          633.135688507217,636.2622387488283}),
+    Tp1(start={610.2709965207655,610.0984334604643,609.9757644369477,
+          609.8799665740102,609.8023932206363,609.7385750723525,
+          609.6858335131916,609.6424216866362,609.6071408778737,
+          609.5791446660139,609.5578296140685,609.5427704711935,
+          609.533680491646,609.5303869740989,609.5328169418054,609.540990157294,
+          609.5550181389947,609.5751088339957,609.6015773714007,
+          609.6348642175905,609.6755632868924,609.7244644309128,
+          609.7826179283193,609.8514345863706,609.9328467812495,
+          610.0295806069864,610.1456244663702,611.7808730290952,
+          615.9622431406954,619.4903247027197}),
+    Tp2(start={644.9596553467713,644.824579502235,644.7285482944553,
+          644.6535470354397,644.592810046145,644.5428402353538,
+          644.5015416419557,644.4675473586904,644.4399193877858,
+          644.4179953736024,644.4013031238645,644.3895098327511,
+          644.3823911261306,644.3798118348441,644.3817148399042,644.38811560583,
+          644.3991013774125,644.4148348525065,644.4355626048274,
+          644.4616292617266,644.4934994867675,644.531791236838,
+          644.5773261834961,644.6312079828199,644.6949482231629,
+          644.7706792525222,644.8615205623447,646.1407907783827,
+          649.404839172216,652.1510013554424}),
+    L=1e4/11.46)
+    annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
+    dynamicTwoPhaseFlowPipe(
+    ntubes=1,
+    steady_state=true,
+    rugosrel=0.00005,
+    dpfCorr=1,
+    Ns=30,
+    P(start={12512365.778485337,12512269.4730028,12512159.010926897,
+          12512028.619141866,12511878.28140543,12511707.984695798,
+          12511517.718132183,12511307.472416837,12511077.239500606,
+          12510827.012364838,12510556.784871727,12510266.551658653,
+          12509956.30806284,12509626.050068311,12509275.774270097,
+          12508905.477852736,12508515.15858121,12508104.814803492,
+          12507674.445464557,12507224.050132478,12506753.629037917,
+          12506263.183129327,12505752.714147368,12505222.224723859,
+          12504671.718513375,12504101.200370008,12503510.676589508,
+          12502896.415784404,12502231.48634808,12501522.52554151,
+          12500776.553197166,12500000.0}),
+    h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266,
+          1645211.676359884,1681572.2077847784,1717947.2125321354,
+          1754334.1766730088,1790730.9833788855,1827135.788296852,
+          1863546.9394607474,1899962.9220483964,1936382.3178860326,
+          1972803.7739566958,2009225.9764870608,2045647.6282789519,
+          2082067.4276265746,2118484.0474634594,2154896.1134394333,
+          2191302.179544121,2227700.6996020116,2264089.9923674623,
+          2300468.196934767,2336833.213464297,2373182.6211112435,
+          2409513.559261445,2445822.5467506223,2482105.1942732874,
+          2518015.7979130256,2552967.680496474,2587102.355161259,
+          82548.43470391157}),
+    D=0.07,
+    inertia=false,
+    L=1e4/11.46)            annotation (Placement(transformation(extent={{-36,
+            -67},{36,-20}}, rotation=0)));
+  ThermoSysPro.Solar.Collectors.FresnelField champThermosolaireLFR_N(
+    Ns=30,
+    T(start=fill(500, 30)),
+    F12=0.6366,
+    A=1e4,
+    T0=303)
+    annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(
+    h0=2000e3, P0=125e5)          annotation (Placement(transformation(extent={
+            {48,-54},{68,-34}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3)
+               annotation (Placement(transformation(extent={{-69,-53},{-49,-33}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI(
+    Starttime=100,
+    Initialvalue=100,
+    Duration=3600,
+    Finalvalue=900) annotation (Placement(transformation(extent={{72,39},{58,53}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Angles(
+    Starttime=100,
+    Initialvalue=45,
+    Finalvalue=45,
+    Duration=3600)  annotation (Placement(transformation(extent={{-10,59},{4,72}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Q(
+    Starttime=100,
+    Duration=3600,
+    Initialvalue=2,
+    Finalvalue=3)   annotation (Placement(transformation(extent={{-65,-32},{-51,
+            -19}}, rotation=0)));
+equation
+  connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2)
+    annotation (Line(points={{0,1.6},{0,-15.6}}, color={191,95,0}));
+  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(
+        points={{0,-22.4},{0,-36.45}}, color={191,95,0}));
+  connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{36,
+          -43.5},{47,-43.5},{47,-44},{48,-44}}, color={0,0,255}));
+  connect(champThermosolaireLFR_N.SunDNI, DNI.y)
+    annotation (Line(points={{44,45.6},{51,45.6},{51,46},{57.3,46}}));
+  connect(champThermosolaireLFR_N.SunG, Angles.y)
+    annotation (Line(points={{27.2,58.8},{27.2,65.5},{4.7,65.5}}));
+  connect(champThermosolaireLFR_N.SunA, Angles.y)
+    annotation (Line(points={{36.8,58.8},{36.8,70},{6,70},{6,65.5},{4.7,65.5}}));
+  connect(Q.y, sourceP.IMassFlow)
+    annotation (Line(points={{-50.3,-25.5},{-50,-25.5},{-50,-38},{-59,-38}}));
+  connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-49,
+          -43},{-47.5,-43},{-47.5,-43.5},{-36,-43.5}}, color={0,0,255}));
+  annotation (
+      Diagram(graphics),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 16.2.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    experiment(StopTime=5000));
+end TestFresnelField;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/package.mo
index 984a72805ebf274548547a9536ac9e3c42a2f9ce..dba0efe0d3db7212e3e205fb545947f31eb1b5cf 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package SolarCollector "Solar collector modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 16 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end SolarCollector;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package SolarCollector "Solar collector modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 16 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end SolarCollector;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/package.order
index 8e8e585557f2e3661273b13408b7dfc4be053888..3c7132cdabff784e9876a016cde07417026c7c63 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/package.order
@@ -1 +1 @@
-TestFresnelField
+TestFresnelField
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo
index 14c7364aeef816801a9a03559c8ef110320536ad..152616d38530bb88b94c2517fb8b1ffbd35df0a1 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo
@@ -1,58 +1,58 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SteamTurbine;
-model TestStodolaTurbine
-
-  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Cst=2e6,
-      eta_is_nom=0.94)
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=10000000)
-    annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    P0=27000000,
-    h0=3475.e3)
-             annotation (Placement(transformation(extent={{-50,-10},{-30,10}},
-          rotation=0)));
-equation
-  connect(sourceP.C, stodolaTurbine.Ce)
-    annotation (Line(points={{-30,0},{-10.1,0}},   color={0,0,255}));
-  connect(stodolaTurbine.Cs, puitsP.C)
-    annotation (Line(points={{10.1,0},{30,0}},     color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Text(
-          extent={{-64,-14},{-16,-26}},
-          lineColor={0,0,255},
-          textString=
-               "Supercritrical at the inlet")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 10.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestStodolaTurbine;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SteamTurbine;
+model TestStodolaTurbine
+
+  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Cst=2e6,
+      eta_is_nom=0.94)
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=10000000)
+    annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    P0=27000000,
+    h0=3475.e3)
+             annotation (Placement(transformation(extent={{-50,-10},{-30,10}},
+          rotation=0)));
+equation
+  connect(sourceP.C, stodolaTurbine.Ce)
+    annotation (Line(points={{-30,0},{-10.1,0}},   color={0,0,255}));
+  connect(stodolaTurbine.Cs, puitsP.C)
+    annotation (Line(points={{10.1,0},{30,0}},     color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Text(
+          extent={{-64,-14},{-16,-26}},
+          lineColor={0,0,255},
+          textString=
+               "Supercritrical at the inlet")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 10.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestStodolaTurbine;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/package.mo
index cda9269149ed9492d0e8af3bbe0f9cb2a23635d3..ee7f2117527217c25161c6bf9a818bfaa9741db4 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package SteamTurbine "Steam turbine modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 10 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end SteamTurbine;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package SteamTurbine "Steam turbine modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 10 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end SteamTurbine;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/package.order
index 957d3bddc540367f9269e973838d06032b2e7a0a..4bf87c1ac0f271da4f809036a3cb44a63730eb5c 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/package.order
@@ -1 +1 @@
-TestStodolaTurbine
+TestStodolaTurbine
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo
index 10f010cec9a1f147fcd3ac39e8f5ee5eadfb99e6..f7ee700093f246b1726cd9292f1fd0c6c8f13ffb 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo
@@ -1,188 +1,188 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
-model TestDynamicDrum
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.085)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum              Drum(
-    Vv(start=39),
-    Vertical=false,
-    hl(start=1454400),
-    hv(start=2.658e6),
-    xv(start=0.01),
-    rhol(start=670),
-    rhov(start=78),
-    zl(fixed=true, start=1.05),
-    P0=13000000,
-    P(start=13000000, fixed=false),
-    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,16},{1,
-            78}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=335),
-    Q(start=79.5),
-    rho(start=888),
-    h(start=1400000),
-    C1(
-      h_vol_2(start=1400e3),
-      h(start=1400e3),
-      Q(start=79.5),
-      P(start=13300000)),
-    Cvmax=CvmaxWater,
-    Pm(start=13100000))
-                     annotation (Placement(transformation(extent={{-120,74},{
-            -100,94}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Q(start=79.5),
-    rho(start=78.5),
-    h(start=2657930),
-    Cvmax=10000,
-    Pm(start=12900000))
-    annotation (Placement(transformation(extent={{40,74},{60,94}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
-    TubeEcranBoucleEvaporatoire(
-    T0=fill(400, 10),
-    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
-    advection=false,
-    z2=10,
-    simplified_dynamic_energy_balance=false,
-    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
-          13002000,13001000,13000000,12999990}),
-    D=0.03,
-    ntubes=1400,
-    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
-          1900e3,1950e3}),
-    L=20,
-    Q(start=fill(130, 11)))
-                     annotation (Placement(transformation(
-        origin={6,-28},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
-    option_temperature=2,
-    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
-    T0={290,290,290,290,290,290,290,290,290,290})
-    annotation (Placement(transformation(
-        origin={36,-28},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
-    D=0.03,
-    ntubes=1400)
-    annotation (Placement(transformation(
-        origin={18,-28},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=20,
-    z1=20,
-    C1(P(start=130e5)),
-    Q(fixed=true, start=130),
-    lambda=LambdaPipe)
-             annotation (Placement(transformation(
-        origin={-66,-28},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceQ(h0=1400000,
-    option_temperature=false,
-    P0=13300000)
-           annotation (Placement(transformation(extent={{-196,68},{-176,88}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkP(
-    option_temperature=false,
-    h0=2.650e6,
-    P0=12700000)
-    annotation (Placement(transformation(extent={{115,68},{135,88}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k=0.5)
-    annotation (Placement(transformation(extent={{20,100},{40,119}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
-        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
-        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
-    annotation (Placement(transformation(extent={{96,97},{120,121}},  rotation=
-            0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
-    add(k1=-1, k2=+1),
-    Ti=50,
-    pIsat(
-      ureset0=0.5,
-      Limiteur1(u(signal(start=0.5))),
-      Ti=2000)) annotation (Placement(transformation(extent={{-56,104},{-84,130}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=1.05) annotation (
-      Placement(transformation(extent={{-21,100},{-40,119}}, rotation=0)));
-equation
-  connect(Drum.Cv, SteamValve.C1)
-    annotation (Line(points={{1,78},{40,78}}, color={0,0,255}));
-  connect(FeedwaterValve.C2, Drum.Ce1)
-    annotation (Line(points={{-100,78},{-61,78}}, color={0,0,255}));
-  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,16},{
-          -66,16},{-66,-18}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-28},
-          {26.2,-28}}, color={191,95,0}));
-  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
-    annotation (Line(points={{1,16},{6,16},{6,-18}}));
-  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
-        points={{9,-28},{16,-28}}, color={191,95,0}));
-  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
-      points={{-176,78},{-120,78}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(SteamValve.C2,sinkP. C) annotation (Line(
-      points={{60,78},{115,78}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{6,-38},{6,-70},{-66,-70},{-66,-38}}));
-  connect(SteamValve_O.y, SteamValve.Ouv)
-    annotation (Line(points={{41,109.5},{50,109.5},{50,95}}, color={0,0,255}));
-  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
-          109},{130,109},{130,78}}, color={0,0,255}));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
-      points={{-40.95,109.5},{-44,109.5},{-44,110},{-44,108},{-44,109.2},{-50,
-          109.2},{-55.3,109.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-
-  connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(
-      points={{4.1,47},{10,47},{10,128.7},{-55.3,128.7}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-  connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation (Line(
-        points={{-84.7,105.3},{-110,105.3},{-110,95}}, color={0,0,255}));
-  annotation (experiment(StopTime=3000),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 14.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestDynamicDrum;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
+model TestDynamicDrum
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.085)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum              Drum(
+    Vv(start=39),
+    Vertical=false,
+    hl(start=1454400),
+    hv(start=2.658e6),
+    xv(start=0.01),
+    rhol(start=670),
+    rhov(start=78),
+    zl(fixed=true, start=1.05),
+    P0=13000000,
+    P(start=13000000, fixed=false),
+    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,16},{1,
+            78}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=335),
+    Q(start=79.5),
+    rho(start=888),
+    h(start=1400000),
+    C1(
+      h_vol_2(start=1400e3),
+      h(start=1400e3),
+      Q(start=79.5),
+      P(start=13300000)),
+    Cvmax=CvmaxWater,
+    Pm(start=13100000))
+                     annotation (Placement(transformation(extent={{-120,74},{
+            -100,94}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Q(start=79.5),
+    rho(start=78.5),
+    h(start=2657930),
+    Cvmax=10000,
+    Pm(start=12900000))
+    annotation (Placement(transformation(extent={{40,74},{60,94}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
+    TubeEcranBoucleEvaporatoire(
+    T0=fill(400, 10),
+    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
+    advection=false,
+    z2=10,
+    simplified_dynamic_energy_balance=false,
+    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
+          13002000,13001000,13000000,12999990}),
+    D=0.03,
+    ntubes=1400,
+    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
+          1900e3,1950e3}),
+    L=20,
+    Q(start=fill(130, 11)))
+                     annotation (Placement(transformation(
+        origin={6,-28},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
+    option_temperature=2,
+    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
+    T0={290,290,290,290,290,290,290,290,290,290})
+    annotation (Placement(transformation(
+        origin={36,-28},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
+    D=0.03,
+    ntubes=1400)
+    annotation (Placement(transformation(
+        origin={18,-28},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=20,
+    z1=20,
+    C1(P(start=130e5)),
+    Q(fixed=true, start=130),
+    lambda=LambdaPipe)
+             annotation (Placement(transformation(
+        origin={-66,-28},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceQ(h0=1400000,
+    option_temperature=false,
+    P0=13300000)
+           annotation (Placement(transformation(extent={{-196,68},{-176,88}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkP(
+    option_temperature=false,
+    h0=2.650e6,
+    P0=12700000)
+    annotation (Placement(transformation(extent={{115,68},{135,88}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k=0.5)
+    annotation (Placement(transformation(extent={{20,100},{40,119}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
+        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
+        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
+    annotation (Placement(transformation(extent={{96,97},{120,121}},  rotation=
+            0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
+    add(k1=-1, k2=+1),
+    Ti=50,
+    pIsat(
+      ureset0=0.5,
+      Limiteur1(u(signal(start=0.5))),
+      Ti=2000)) annotation (Placement(transformation(extent={{-56,104},{-84,130}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=1.05) annotation (
+      Placement(transformation(extent={{-21,100},{-40,119}}, rotation=0)));
+equation
+  connect(Drum.Cv, SteamValve.C1)
+    annotation (Line(points={{1,78},{40,78}}, color={0,0,255}));
+  connect(FeedwaterValve.C2, Drum.Ce1)
+    annotation (Line(points={{-100,78},{-61,78}}, color={0,0,255}));
+  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,16},{
+          -66,16},{-66,-18}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-28},
+          {26.2,-28}}, color={191,95,0}));
+  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
+    annotation (Line(points={{1,16},{6,16},{6,-18}}));
+  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
+        points={{9,-28},{16,-28}}, color={191,95,0}));
+  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
+      points={{-176,78},{-120,78}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(SteamValve.C2,sinkP. C) annotation (Line(
+      points={{60,78},{115,78}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{6,-38},{6,-70},{-66,-70},{-66,-38}}));
+  connect(SteamValve_O.y, SteamValve.Ouv)
+    annotation (Line(points={{41,109.5},{50,109.5},{50,95}}, color={0,0,255}));
+  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
+          109},{130,109},{130,78}}, color={0,0,255}));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
+      points={{-40.95,109.5},{-44,109.5},{-44,110},{-44,108},{-44,109.2},{-50,
+          109.2},{-55.3,109.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+
+  connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(
+      points={{4.1,47},{10,47},{10,128.7},{-55.3,128.7}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+  connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation (Line(
+        points={{-84.7,105.3},{-110,105.3},{-110,95}}, color={0,0,255}));
+  annotation (experiment(StopTime=3000),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 14.2.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestDynamicDrum;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo
index 2ea67476e097fc3013f6bf5c1f1765d981a04deb..330b1835a09d838622955d5b0a6bc07e63fce396 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
-model TestMixer3
-
-  ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2
-    annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3 annotation (Placement(transformation(extent={{34,-10},
-            {54,10}},  rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss4 annotation (Placement(transformation(extent={{-46,10},
-            {-26,30}},  rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss5 annotation (Placement(transformation(extent={{-46,-30},
-            {-26,-10}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2
-    annotation (Placement(transformation(extent={{-86,10},{-66,30}},   rotation=
-           0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
-    annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1
-    annotation (Placement(transformation(extent={{74,-10},{94,10}},   rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
-        0.5) annotation (Placement(transformation(extent={{-46,30},{-26,50}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ
-    annotation (Placement(transformation(extent={{-86,-10},{-66,10}},  rotation=
-           0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss6 annotation (Placement(transformation(extent={{-46,-10},
-            {-26,10}},  rotation=0)));
-equation
-  connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-26,20},
-          {0,20},{0,10}},        color={0,0,255}));
-  connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation (Line(points={{-26,-20},
-          {0,-20},{0,-10}},      color={0,0,255}));
-  connect(mixer2_2.Cs, singularPressureLoss3.C1)
-    annotation (Line(points={{14,0},{34,0}},     color={0,0,255}));
-  connect(sourceP2.C, singularPressureLoss4.C1)
-    annotation (Line(points={{-66,20},{-46,20}},   color={0,0,255}));
-  connect(sourceP3.C, singularPressureLoss5.C1)
-    annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, sinkP1.C)
-    annotation (Line(points={{54,0},{74,0}},     color={0,0,255}));
-  connect(sourceQ.C, singularPressureLoss6.C1)
-    annotation (Line(points={{-66,0},{-46,0}},     color={0,0,255}));
-  connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation (Line(points={{-26,0},
-          {-16,0},{-6,0}},                   color={0,0,255}));
-  connect(constante1.y, mixer2_2.Ialpha1)
-    annotation (Line(points={{-25,40},{-14,40},{-14,6},{-3,6}}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 14.7.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestMixer3;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
+model TestMixer3
+
+  ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2
+    annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3 annotation (Placement(transformation(extent={{34,-10},
+            {54,10}},  rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss4 annotation (Placement(transformation(extent={{-46,10},
+            {-26,30}},  rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss5 annotation (Placement(transformation(extent={{-46,-30},
+            {-26,-10}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2
+    annotation (Placement(transformation(extent={{-86,10},{-66,30}},   rotation=
+           0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
+    annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1
+    annotation (Placement(transformation(extent={{74,-10},{94,10}},   rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
+        0.5) annotation (Placement(transformation(extent={{-46,30},{-26,50}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ
+    annotation (Placement(transformation(extent={{-86,-10},{-66,10}},  rotation=
+           0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss6 annotation (Placement(transformation(extent={{-46,-10},
+            {-26,10}},  rotation=0)));
+equation
+  connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-26,20},
+          {0,20},{0,10}},        color={0,0,255}));
+  connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation (Line(points={{-26,-20},
+          {0,-20},{0,-10}},      color={0,0,255}));
+  connect(mixer2_2.Cs, singularPressureLoss3.C1)
+    annotation (Line(points={{14,0},{34,0}},     color={0,0,255}));
+  connect(sourceP2.C, singularPressureLoss4.C1)
+    annotation (Line(points={{-66,20},{-46,20}},   color={0,0,255}));
+  connect(sourceP3.C, singularPressureLoss5.C1)
+    annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, sinkP1.C)
+    annotation (Line(points={{54,0},{74,0}},     color={0,0,255}));
+  connect(sourceQ.C, singularPressureLoss6.C1)
+    annotation (Line(points={{-66,0},{-46,0}},     color={0,0,255}));
+  connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation (Line(points={{-26,0},
+          {-16,0},{-6,0}},                   color={0,0,255}));
+  connect(constante1.y, mixer2_2.Ialpha1)
+    annotation (Line(points={{-25,40},{-14,40},{-14,6},{-3,6}}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 14.7.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestMixer3;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo
index 193e30cf45867753d72ac6a1a9dd822d74fccc11..3cd65dd0a1f2d5cdcaa50b607d003003d7b7118f 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo
@@ -1,179 +1,179 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
-model TestPressurizer
-
-  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
-    "Power released by the electrical heaters";
-  parameter Real OUVfeedwaterValve( fixed=false)=0.01
-    "Position of the feedwater valve";
-
-  ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray(
-    Cv(start=100),
-    C1(
-      P(start=160e5),
-      h_vol_2(start=1270e3),
-      Q(start=0.3),
-      h(start=1270e3)),
-    Q(fixed=false, start=0.32),
-    Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{-90,
-            150}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Cvmax(fixed=true) = 5000,
-    Pm(start=15500000))
-    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=1,
-    D=1,
-    z1=1,
-    z2=0,
-    C1(P(start=160e5)),
-    C2(P(start=160e5)),
-    Q(fixed=false, start=0))
-             annotation (Placement(transformation(
-        origin={-30,-42},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=
-          true) = 0.5) annotation (Placement(transformation(extent={{0,156},{20,
-            176}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    h0=1270e3,
-    P0=16000000)
-           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
-    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Volumes.Pressurizer     pressurizer(
-    Zm=10.15,
-    Klv=0.5e6,
-    cpp=600,
-    hl(start=1629887.98290107),
-    hv(start=2596216.59571565),
-    Zl(start=5.5900717167325),
-    Yw0=60,
-    steady_state=true,
-    V=61.12,
-    Rp=1.27,
-    Ae=96.23,
-    Klp=1780,
-    Kvp=7500,
-    Mp=107e3,
-    Kpa=5.63,
-    Ccond=0.02,
-    Cevap=0.05,
-    Yw(start=32.92),
-    y(start=0.3292, fixed=true),
-    P0=15500000,
-    P(start=15500000, fixed=true),
-    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
-            -12},{32,118}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
-           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
-    option_temperature=2,
-    T0={310},
-    W0={1e5})
-    annotation (Placement(transformation(
-        origin={-133,32},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
-    T0={310},
-    W0={0.286e6},
-    option_temperature=1)
-    annotation (Placement(transformation(
-        origin={-133,55},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,
-        Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,
-        Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(
-          extent={{-175,19},{-149,45}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,
-        OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005;
-        300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(
-        transformation(extent={{-134,154},{-108,180}}, rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
-    Ti=50,
-    add(k1=+1, k2=-1),
-    minval=-100,
-    pIsat(
-      Limiteur1(u(signal(start=0.001))),
-      ureset0=0.0,
-      maxval=100,
-      Ti=2000)) annotation (Placement(transformation(extent={{52,-52},{24,-26}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92)
-    annotation (Placement(transformation(extent={{87,-56},{68,-37}}, rotation=0)));
-equation
-  connect(sourceP.C, FeedwaterValve_Spray.C1)
-    annotation (Line(points={{-148,134},{-110,134}}, color={0,0,255}));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
-        color={0,0,255}));
-  connect(SteamrValve_O.y, SteamValve.Ouv)
-    annotation (Line(points={{21,166},{68,166},{68,151}}));
-  connect(FeedwaterValve_Spray.C2, pressurizer.Cas)
-    annotation (Line(points={{-90,134},{-30,134},{-30,118}}, color={0,0,255}));
-  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
-          32,134},{58,134}}, color={0,0,255}));
-  connect(sinkQ1.C, lumpedStraightPipe.C2)
-    annotation (Line(points={{-30,-66},{-30,-52}}));
-  connect(lumpedStraightPipe.C1, pressurizer.Cex)
-    annotation (Line(points={{-30,-32},{-30,-12}}));
-  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
-          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
-  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
-          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
-  connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(
-        points={{-106.7,167},{-100,167},{-100,151}}, color={0,0,255}));
-  connect(ElectricalHeaters.y, SourceC1.ISignal)
-    annotation (Line(points={{-147.7,32},{-141.5,32}}, color={0,0,255}));
-  connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
-      points={{67.05,-46.5},{64,-46.5},{64,-46},{64,-48},{64,-46.8},{58,-46.8},
-          {52.7,-46.8}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-  connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (
-      Line(points={{25.8,53},{78,53},{78,-27.3},{52.7,-27.3}}, color={0,0,255}));
-  connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(
-        points={{23.3,-50.7},{-20,-50.7},{-20,-61}}, color={0,0,255}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    experiment(StopTime=3000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 14.3.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestPressurizer;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
+model TestPressurizer
+
+  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
+    "Power released by the electrical heaters";
+  parameter Real OUVfeedwaterValve( fixed=false)=0.01
+    "Position of the feedwater valve";
+
+  ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray(
+    Cv(start=100),
+    C1(
+      P(start=160e5),
+      h_vol_2(start=1270e3),
+      Q(start=0.3),
+      h(start=1270e3)),
+    Q(fixed=false, start=0.32),
+    Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{-90,
+            150}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Cvmax(fixed=true) = 5000,
+    Pm(start=15500000))
+    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=1,
+    D=1,
+    z1=1,
+    z2=0,
+    C1(P(start=160e5)),
+    C2(P(start=160e5)),
+    Q(fixed=false, start=0))
+             annotation (Placement(transformation(
+        origin={-30,-42},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=
+          true) = 0.5) annotation (Placement(transformation(extent={{0,156},{20,
+            176}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    h0=1270e3,
+    P0=16000000)
+           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
+    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Volumes.Pressurizer     pressurizer(
+    Zm=10.15,
+    Klv=0.5e6,
+    cpp=600,
+    hl(start=1629887.98290107),
+    hv(start=2596216.59571565),
+    Zl(start=5.5900717167325),
+    Yw0=60,
+    steady_state=true,
+    V=61.12,
+    Rp=1.27,
+    Ae=96.23,
+    Klp=1780,
+    Kvp=7500,
+    Mp=107e3,
+    Kpa=5.63,
+    Ccond=0.02,
+    Cevap=0.05,
+    Yw(start=32.92),
+    y(start=0.3292, fixed=true),
+    P0=15500000,
+    P(start=15500000, fixed=true),
+    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
+            -12},{32,118}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
+           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
+    option_temperature=2,
+    T0={310},
+    W0={1e5})
+    annotation (Placement(transformation(
+        origin={-133,32},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
+    T0={310},
+    W0={0.286e6},
+    option_temperature=1)
+    annotation (Placement(transformation(
+        origin={-133,55},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,
+        Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,
+        Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(
+          extent={{-175,19},{-149,45}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,
+        OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005;
+        300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(
+        transformation(extent={{-134,154},{-108,180}}, rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
+    Ti=50,
+    add(k1=+1, k2=-1),
+    minval=-100,
+    pIsat(
+      Limiteur1(u(signal(start=0.001))),
+      ureset0=0.0,
+      maxval=100,
+      Ti=2000)) annotation (Placement(transformation(extent={{52,-52},{24,-26}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92)
+    annotation (Placement(transformation(extent={{87,-56},{68,-37}}, rotation=0)));
+equation
+  connect(sourceP.C, FeedwaterValve_Spray.C1)
+    annotation (Line(points={{-148,134},{-110,134}}, color={0,0,255}));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
+        color={0,0,255}));
+  connect(SteamrValve_O.y, SteamValve.Ouv)
+    annotation (Line(points={{21,166},{68,166},{68,151}}));
+  connect(FeedwaterValve_Spray.C2, pressurizer.Cas)
+    annotation (Line(points={{-90,134},{-30,134},{-30,118}}, color={0,0,255}));
+  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
+          32,134},{58,134}}, color={0,0,255}));
+  connect(sinkQ1.C, lumpedStraightPipe.C2)
+    annotation (Line(points={{-30,-66},{-30,-52}}));
+  connect(lumpedStraightPipe.C1, pressurizer.Cex)
+    annotation (Line(points={{-30,-32},{-30,-12}}));
+  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
+          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
+  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
+          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
+  connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(
+        points={{-106.7,167},{-100,167},{-100,151}}, color={0,0,255}));
+  connect(ElectricalHeaters.y, SourceC1.ISignal)
+    annotation (Line(points={{-147.7,32},{-141.5,32}}, color={0,0,255}));
+  connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
+      points={{67.05,-46.5},{64,-46.5},{64,-46},{64,-48},{64,-46.8},{58,-46.8},
+          {52.7,-46.8}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+  connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (
+      Line(points={{25.8,53},{78,53},{78,-27.3},{52.7,-27.3}}, color={0,0,255}));
+  connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(
+        points={{23.3,-50.7},{-20,-50.7},{-20,-61}}, color={0,0,255}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    experiment(StopTime=3000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 14.3.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestPressurizer;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo
index cde37bd28777cbf665b5a3d904cf9c32dabd8645..7e6aec21ece49e662bc74b147a5730246a826ffb 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
-model TestSplitter3
-
-  ThermoSysPro.Fluid.Junctions.Splitter3 splitter3
-    annotation (Placement(transformation(extent={{-16,-10},{4,10}},  rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(Q0=100,
-      option_temperature=true)
-    annotation (Placement(transformation(extent={{-96,-10},{-76,10}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3 annotation (Placement(transformation(extent={{-56,-10},
-            {-36,10}},  rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2
-    annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3
-    annotation (Placement(transformation(extent={{84,-50},{104,-30}},  rotation=
-           0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss4 annotation (Placement(transformation(extent={{44,30},
-            {64,50}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss5 annotation (Placement(transformation(extent={{44,-50},
-            {64,-30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
-        0) annotation (Placement(transformation(extent={{-36,10},{-16,30}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4
-    annotation (Placement(transformation(extent={{84,-10},{104,10}},  rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=
-        0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}},
-          rotation=0)));
-equation
-  connect(sourceP1.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-76,0},{-56,0}},     color={0,0,255}));
-  connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},
-          {-15.8,0}},        color={0,0,255}));
-  connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},
-          {-2,40},{44,40}},        color={0,0,255}));
-  connect(singularPressureLoss4.C2, sinkP2.C)
-    annotation (Line(points={{64,40},{84,40}},   color={0,0,255}));
-  connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},
-          {-2,-40},{44,-40}},      color={0,0,255}));
-  connect(singularPressureLoss5.C2, sinkP3.C)
-    annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255}));
-  connect(constante1.y, splitter3.Ialpha1)
-    annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}}));
-  connect(splitter3.Cs3, sinkP4.C)
-    annotation (Line(points={{4,0},{84,0}},     color={0,0,255}));
-  connect(splitter3.Ialpha2, constante2.y)
-    annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}}));
-  annotation (experiment(StopTime=10),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 14.8.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestSplitter3;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
+model TestSplitter3
+
+  ThermoSysPro.Fluid.Junctions.Splitter3 splitter3
+    annotation (Placement(transformation(extent={{-16,-10},{4,10}},  rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(Q0=100,
+      option_temperature=true)
+    annotation (Placement(transformation(extent={{-96,-10},{-76,10}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3 annotation (Placement(transformation(extent={{-56,-10},
+            {-36,10}},  rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2
+    annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3
+    annotation (Placement(transformation(extent={{84,-50},{104,-30}},  rotation=
+           0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss4 annotation (Placement(transformation(extent={{44,30},
+            {64,50}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss5 annotation (Placement(transformation(extent={{44,-50},
+            {64,-30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
+        0) annotation (Placement(transformation(extent={{-36,10},{-16,30}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4
+    annotation (Placement(transformation(extent={{84,-10},{104,10}},  rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=
+        0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}},
+          rotation=0)));
+equation
+  connect(sourceP1.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-76,0},{-56,0}},     color={0,0,255}));
+  connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},
+          {-15.8,0}},        color={0,0,255}));
+  connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},
+          {-2,40},{44,40}},        color={0,0,255}));
+  connect(singularPressureLoss4.C2, sinkP2.C)
+    annotation (Line(points={{64,40},{84,40}},   color={0,0,255}));
+  connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},
+          {-2,-40},{44,-40}},      color={0,0,255}));
+  connect(singularPressureLoss5.C2, sinkP3.C)
+    annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255}));
+  connect(constante1.y, splitter3.Ialpha1)
+    annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}}));
+  connect(splitter3.Cs3, sinkP4.C)
+    annotation (Line(points={{4,0},{84,0}},     color={0,0,255}));
+  connect(splitter3.Ialpha2, constante2.y)
+    annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}}));
+  annotation (experiment(StopTime=10),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 14.8.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestSplitter3;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo
index b9da4167722f4f01f72add16f7e3130bf533083b..62c1d5176645ded6d659b60a072e86ed7e7c47ff 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo
@@ -1,113 +1,113 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
-model TestStaticDrum3
-
-  ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1
-    annotation (Placement(transformation(extent={{-30,1},{20,51}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI1(K=1e-4)
-    annotation (Placement(transformation(extent={{38,7},{58,27}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI2(K=1e-4)
-    annotation (Placement(transformation(extent={{-58,-8},{-38,12}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0=10)
-    annotation (Placement(transformation(extent={{74,7},{94,27}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
-    Q0=100,
-    h0=1400e3,
-    P0=10000000)
-    annotation (Placement(transformation(extent={{-86,-8},{-66,12}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
-                                    annotation (Placement(transformation(
-        origin={-76,26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI3(K=1e-4)
-    annotation (Placement(transformation(extent={{38,52},{58,72}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{74,52},{94,72}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(
-    z1=0,
-    rugosrel=0.0001,
-    D=0.05,
-    ntubes=10,
-    L=10,
-    z2=10)           annotation (Placement(transformation(
-        origin={-28.5,-45.5},
-        extent={{13.5,11.5},{-13.5,-11.5}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    lambda(fixed=false) = 0.03,
-    D=0.05,
-    ntubes=10,
-    L=10,
-    z1=10,
-    Q(fixed=true, start=30)) annotation (Placement(transformation(
-        origin={20,-45},
-        extent={{-14,-12},{14,12}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Volumes.VolumeA volumeA annotation (Placement(transformation(
-          extent={{1,-72},{-9,-62}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
-    option_temperature=2,
-    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6},
-    T0={300,300,300,300,300,300,300,300,300,300})
-    annotation (Placement(transformation(
-        origin={-76,-45},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
-                                                          annotation (Line(
-        points={{-38,2},{-15,2},{-15,2.5}}, color={0,0,255}));
-  connect(singularPressureLossVALI1.C2, sinkQ.C)  annotation (Line(points={{58,
-          17},{74,17}}, color={0,0,255}));
-  connect(heatSource.C[1], StaticDrumTh1.Cth)
-                                          annotation (Line(points={{-66.2,26},{
-          -5,26}}, color={191,95,0}));
-  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
-                                                          annotation (Line(
-        points={{4.5,49.5},{4.5,62},{38,62}}, color={0,0,255}));
-  connect(singularPressureLossVALI3.C2, sink.C)
-    annotation (Line(points={{58,62},{74,62}}, color={0,0,255}));
-  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(
-        points={{18.5,17.5},{38,17.5},{38,17}}, color={0,0,255}));
-  connect(sourcePQ.C, singularPressureLossVALI2.C1)
-    annotation (Line(points={{-66,2},{-58,2}}, color={0,0,255}));
-  connect(dynamicTwoPhaseFlowPipe.C2, StaticDrumTh1.Ce_eva) annotation (Line(
-        points={{-28.5,-32},{-28.5,-6},{-28.5,17.5}},
-                                           color={0,0,255}));
-  connect(StaticDrumTh1.Cs_eva, lumpedStraightPipe.C1) annotation (Line(points=
-          {{5,2.5},{20,2.5},{20,-31}}, color={0,0,255}));
-  connect(dynamicTwoPhaseFlowPipe.C1, volumeA.Cs1)
-    annotation (Line(points={{-28.5,-59},{-28,-59},{-28,-67},{-9,-67}}));
-  connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{20,-59},
-          {20,-67},{1,-67}}, color={0,0,255}));
-  connect(heatSource1.C, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{-66.2,
-          -45},{-31.95,-45},{-31.95,-45.5}},
-                                     color={191,95,0}));
-  annotation (experiment(StopTime=20), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 14.6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestStaticDrum3;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
+model TestStaticDrum3
+
+  ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1
+    annotation (Placement(transformation(extent={{-30,1},{20,51}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI1(K=1e-4)
+    annotation (Placement(transformation(extent={{38,7},{58,27}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI2(K=1e-4)
+    annotation (Placement(transformation(extent={{-58,-8},{-38,12}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0=10)
+    annotation (Placement(transformation(extent={{74,7},{94,27}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+    Q0=100,
+    h0=1400e3,
+    P0=10000000)
+    annotation (Placement(transformation(extent={{-86,-8},{-66,12}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
+                                    annotation (Placement(transformation(
+        origin={-76,26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI3(K=1e-4)
+    annotation (Placement(transformation(extent={{38,52},{58,72}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{74,52},{94,72}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(
+    z1=0,
+    rugosrel=0.0001,
+    D=0.05,
+    ntubes=10,
+    L=10,
+    z2=10)           annotation (Placement(transformation(
+        origin={-28.5,-45.5},
+        extent={{13.5,11.5},{-13.5,-11.5}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    lambda(fixed=false) = 0.03,
+    D=0.05,
+    ntubes=10,
+    L=10,
+    z1=10,
+    Q(fixed=true, start=30)) annotation (Placement(transformation(
+        origin={20,-45},
+        extent={{-14,-12},{14,12}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Volumes.VolumeA volumeA annotation (Placement(transformation(
+          extent={{1,-72},{-9,-62}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
+    option_temperature=2,
+    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6},
+    T0={300,300,300,300,300,300,300,300,300,300})
+    annotation (Placement(transformation(
+        origin={-76,-45},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
+                                                          annotation (Line(
+        points={{-38,2},{-15,2},{-15,2.5}}, color={0,0,255}));
+  connect(singularPressureLossVALI1.C2, sinkQ.C)  annotation (Line(points={{58,
+          17},{74,17}}, color={0,0,255}));
+  connect(heatSource.C[1], StaticDrumTh1.Cth)
+                                          annotation (Line(points={{-66.2,26},{
+          -5,26}}, color={191,95,0}));
+  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
+                                                          annotation (Line(
+        points={{4.5,49.5},{4.5,62},{38,62}}, color={0,0,255}));
+  connect(singularPressureLossVALI3.C2, sink.C)
+    annotation (Line(points={{58,62},{74,62}}, color={0,0,255}));
+  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(
+        points={{18.5,17.5},{38,17.5},{38,17}}, color={0,0,255}));
+  connect(sourcePQ.C, singularPressureLossVALI2.C1)
+    annotation (Line(points={{-66,2},{-58,2}}, color={0,0,255}));
+  connect(dynamicTwoPhaseFlowPipe.C2, StaticDrumTh1.Ce_eva) annotation (Line(
+        points={{-28.5,-32},{-28.5,-6},{-28.5,17.5}},
+                                           color={0,0,255}));
+  connect(StaticDrumTh1.Cs_eva, lumpedStraightPipe.C1) annotation (Line(points=
+          {{5,2.5},{20,2.5},{20,-31}}, color={0,0,255}));
+  connect(dynamicTwoPhaseFlowPipe.C1, volumeA.Cs1)
+    annotation (Line(points={{-28.5,-59},{-28,-59},{-28,-67},{-9,-67}}));
+  connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{20,-59},
+          {20,-67},{1,-67}}, color={0,0,255}));
+  connect(heatSource1.C, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{-66.2,
+          -45},{-31.95,-45},{-31.95,-45.5}},
+                                     color={191,95,0}));
+  annotation (experiment(StopTime=20), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 14.6.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestStaticDrum3;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo
index 2cd84820267a7cbdb7d67cb4877516c8f9930f6a..e12f3f68fb52ff68b3544fc5e669169445ec2180 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo
@@ -1,64 +1,64 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
-model TestSteamDryer
-
-  ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta=0.9, P(start=
-          10000000)) annotation (Placement(transformation(extent={{-10,-8},{10,
-            12}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0=
-        2400000)
-    annotation (Placement(transformation(extent={{-90,-4},{-70,16}},  rotation=
-            0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4},
-            {-30,16}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4},
-            {50,16}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1.e-4)
-                          annotation (Placement(transformation(extent={{30,-44},
-            {50,-24}},
-                     rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{70,-44},{90,-24}},
-                                                                   rotation=0)));
-equation
-  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-70,6},
-          {-50,6}},  color={0,0,255}));
-  connect(singularPressureLoss1.C2,sinkP. C)
-    annotation (Line(points={{50,6},{70,6}},   color={0,0,255}));
-  connect(singularPressureLoss3.C2,sink. C)
-    annotation (Line(points={{50,-34},{70,-34}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{-30,6},
-          {-20,6},{-9.9,6}},                     color={0,0,255}));
-  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{9.9,6},
-          {20,6},{30,6}},                    color={0,0,255}));
-  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{0.1,-8},
-          {0,-8},{0,-34},{30,-34}},             color={0,0,255}));
-  annotation (experiment(StopTime=10), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 14.9.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestSteamDryer;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
+model TestSteamDryer
+
+  ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta=0.9, P(start=
+          10000000)) annotation (Placement(transformation(extent={{-10,-8},{10,
+            12}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0=
+        2400000)
+    annotation (Placement(transformation(extent={{-90,-4},{-70,16}},  rotation=
+            0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4},
+            {-30,16}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4},
+            {50,16}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1.e-4)
+                          annotation (Placement(transformation(extent={{30,-44},
+            {50,-24}},
+                     rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{70,-44},{90,-24}},
+                                                                   rotation=0)));
+equation
+  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-70,6},
+          {-50,6}},  color={0,0,255}));
+  connect(singularPressureLoss1.C2,sinkP. C)
+    annotation (Line(points={{50,6},{70,6}},   color={0,0,255}));
+  connect(singularPressureLoss3.C2,sink. C)
+    annotation (Line(points={{50,-34},{70,-34}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{-30,6},
+          {-20,6},{-9.9,6}},                     color={0,0,255}));
+  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{9.9,6},
+          {20,6},{30,6}},                    color={0,0,255}));
+  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{0.1,-8},
+          {0,-8},{0,-34},{30,-34}},             color={0,0,255}));
+  annotation (experiment(StopTime=10), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 14.9.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestSteamDryer;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo
index 1d564723bbf2626e4cb877f1000c80f0001468aa..b22f0802d389aa6cff7fdc0f8a30863ed14e2d8f 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo
@@ -1,65 +1,65 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
-model TestTank
-
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1
-    annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1
-    annotation (Placement(transformation(extent={{-50,2},{-30,22}},  rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-                                            annotation (Placement(
-        transformation(extent={{-90,-4},{-70,16}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-50},{90,-30}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.Tank Tank1(z(fixed=false, start=5))
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}},
-                                                                  rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
-    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
-            0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2
-    annotation (Placement(transformation(extent={{30,-4},{50,16}},   rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
-                                          annotation (Placement(transformation(
-          extent={{70,-4},{90,16}},   rotation=0)));
-equation
-  connect(PerteDP1.C2, PuitsP1.C)
-    annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255}));
-  connect(SourceP1.C, VanneReglante1.C1)
-    annotation (Line(points={{-70,6},{-50,6}},   color={0,0,255}));
-  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{10,-6},{20,-6},{20,
-          -40},{30,-40}}, color={0,0,255}));
-  connect(Rampe1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{-69,40},{-40,40},{-40,23}}));
-  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},
-          {-10,6}},               color={0,0,255}));
-  connect(Tank1.Cs1, PerteDP2.C1)
-    annotation (Line(points={{10.2,6},{20,6},{30,6}},   color={0,0,255}));
-  connect(PerteDP2.C2, PuitsP2.C)
-    annotation (Line(points={{50,6},{50,6},{70,6}},    color={0,0,255}));
-  annotation (experiment(StopTime=20),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 14.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestTank;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
+model TestTank
+
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1
+    annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1
+    annotation (Placement(transformation(extent={{-50,2},{-30,22}},  rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+                                            annotation (Placement(
+        transformation(extent={{-90,-4},{-70,16}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-50},{90,-30}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.Tank Tank1(z(fixed=false, start=5))
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}},
+                                                                  rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
+    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
+            0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2
+    annotation (Placement(transformation(extent={{30,-4},{50,16}},   rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
+                                          annotation (Placement(transformation(
+          extent={{70,-4},{90,16}},   rotation=0)));
+equation
+  connect(PerteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255}));
+  connect(SourceP1.C, VanneReglante1.C1)
+    annotation (Line(points={{-70,6},{-50,6}},   color={0,0,255}));
+  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{10,-6},{20,-6},{20,
+          -40},{30,-40}}, color={0,0,255}));
+  connect(Rampe1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{-69,40},{-40,40},{-40,23}}));
+  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},
+          {-10,6}},               color={0,0,255}));
+  connect(Tank1.Cs1, PerteDP2.C1)
+    annotation (Line(points={{10.2,6},{20,6},{30,6}},   color={0,0,255}));
+  connect(PerteDP2.C2, PuitsP2.C)
+    annotation (Line(points={{50,6},{50,6},{70,6}},    color={0,0,255}));
+  annotation (experiment(StopTime=20),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 14.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestTank;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo
index 0a0051421c90bb9fccf7f2e4d65aa0361dd86a09..b0ef3105df2468fe9d8cbf3508f0a503c00edb6c 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo
@@ -1,83 +1,83 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
-model TestVolumeATh
-
-  ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(
-    h0=1.2e5,
-    V=1,
-    P0=300000,
-    P(start=300000))
-                   annotation (Placement(transformation(extent={{-15,21},{15,-9}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sink(
-    T0=320,
-    option_temperature=false,
-    h0=200000)
-    annotation (Placement(transformation(extent={{64,-4},{84,16}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve1(Cvmax=80)
-    annotation (Placement(transformation(extent={{-47,-58},{-27,-38}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe(Finalvalue=
-        0, Initialvalue=1)           annotation (Placement(transformation(
-          extent={{-89,-38},{-73,-22}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve2
-    annotation (Placement(transformation(extent={{28,2},{48,22}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ
-    annotation (Placement(transformation(extent={{-83,-6},{-59,18}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constant
-                                     annotation (Placement(transformation(
-          extent={{10,18},{26,34}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-      option_temperature=false)
-    annotation (Placement(transformation(extent={{-79,-64},{-59,-44}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
-     L=0.1, D=1)
-    annotation (Placement(transformation(extent={{-47,-4},{-27,16}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Table1DTemps(Table=[0,10;
-        5,-10; 8,0; 9,0]) annotation (Placement(transformation(extent={{-93,16},
-            {-73,36}}, rotation=0)));
-equation
-  connect(Rampe.y, controlValve1.Ouv)
-    annotation (Line(points={{-72.2,-30},{-37,-30},{-37,-37}}));
-  connect(Constant.y, controlValve2.Ouv)
-    annotation (Line(points={{26.8,26},{38,26},{38,23}}));
-  connect(volumeATh.Cs1, controlValve2.C1)
-    annotation (Line(points={{15,6},{28,6}}, color={0,0,255}));
-  connect(sourceP2.C, controlValve1.C1)
-    annotation (Line(points={{-59,-54},{-47,-54}}, color={0,0,255}));
-  connect(controlValve1.C2, volumeATh.Ce2)
-                                          annotation (Line(points={{-27,-54},{0,
-          -54},{0,-9}}, color={0,0,255}));
-  connect(sourceQ.C, lumpedStraightPipe1.C1)
-    annotation (Line(points={{-59,6},{-47,6}}, color={0,0,255}));
-  connect(lumpedStraightPipe1.C2, volumeATh.Ce1)
-    annotation (Line(points={{-27,6},{-15,6}}, color={0,0,255}));
-  connect(controlValve2.C2, sink.C)
-    annotation (Line(points={{48,6},{64,6}}, color={0,0,255}));
-  connect(Table1DTemps.y, sourceQ.IMassFlow)
-    annotation (Line(points={{-72,26},{-71,26},{-71,12}}));
-  annotation (experiment(StopTime=10), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021 </h4>
-<h4>ThermoSysPro Version 4.0 </h4>
-<p>This model is documented in Sect. 14.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
-</html>"));
-end TestVolumeATh;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume;
+model TestVolumeATh
+
+  ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(
+    h0=1.2e5,
+    V=1,
+    P0=300000,
+    P(start=300000))
+                   annotation (Placement(transformation(extent={{-15,21},{15,-9}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sink(
+    T0=320,
+    option_temperature=false,
+    h0=200000)
+    annotation (Placement(transformation(extent={{64,-4},{84,16}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve1(Cvmax=80)
+    annotation (Placement(transformation(extent={{-47,-58},{-27,-38}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe(Finalvalue=
+        0, Initialvalue=1)           annotation (Placement(transformation(
+          extent={{-89,-38},{-73,-22}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve2
+    annotation (Placement(transformation(extent={{28,2},{48,22}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ
+    annotation (Placement(transformation(extent={{-83,-6},{-59,18}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constant
+                                     annotation (Placement(transformation(
+          extent={{10,18},{26,34}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+      option_temperature=false)
+    annotation (Placement(transformation(extent={{-79,-64},{-59,-44}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(
+     L=0.1, D=1)
+    annotation (Placement(transformation(extent={{-47,-4},{-27,16}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Table1DTemps(Table=[0,10;
+        5,-10; 8,0; 9,0]) annotation (Placement(transformation(extent={{-93,16},
+            {-73,36}}, rotation=0)));
+equation
+  connect(Rampe.y, controlValve1.Ouv)
+    annotation (Line(points={{-72.2,-30},{-37,-30},{-37,-37}}));
+  connect(Constant.y, controlValve2.Ouv)
+    annotation (Line(points={{26.8,26},{38,26},{38,23}}));
+  connect(volumeATh.Cs1, controlValve2.C1)
+    annotation (Line(points={{15,6},{28,6}}, color={0,0,255}));
+  connect(sourceP2.C, controlValve1.C1)
+    annotation (Line(points={{-59,-54},{-47,-54}}, color={0,0,255}));
+  connect(controlValve1.C2, volumeATh.Ce2)
+                                          annotation (Line(points={{-27,-54},{0,
+          -54},{0,-9}}, color={0,0,255}));
+  connect(sourceQ.C, lumpedStraightPipe1.C1)
+    annotation (Line(points={{-59,6},{-47,6}}, color={0,0,255}));
+  connect(lumpedStraightPipe1.C2, volumeATh.Ce1)
+    annotation (Line(points={{-27,6},{-15,6}}, color={0,0,255}));
+  connect(controlValve2.C2, sink.C)
+    annotation (Line(points={{48,6},{64,6}}, color={0,0,255}));
+  connect(Table1DTemps.y, sourceQ.IMassFlow)
+    annotation (Line(points={{-72,26},{-71,26},{-71,12}}));
+  annotation (experiment(StopTime=10), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021 </h4>
+<h4>ThermoSysPro Version 4.0 </h4>
+<p>This model is documented in Sect. 14.1.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola. </p>
+</html>"));
+end TestVolumeATh;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/package.mo
index e699ee17bdaf46fdec789456cce14afa83961aee..7115830266b2ba814b3f776852a2cdfce7996f72 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
-package Volume "Volume modeling"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple examples for Chapter 14 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end Volume;
+within ThermoSysPro.Fluid.Examples.Book.SimpleExamples;
+package Volume "Volume modeling"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple examples for Chapter 14 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end Volume;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/package.order
index b26c0f155dbca181518952e6f50677de224c6253..5e9d856999743ffd3c5eaf8ab8a586b00e633d9a 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/package.order
@@ -1,8 +1,8 @@
-TestVolumeATh
-TestDynamicDrum
-TestPressurizer
-TestTank
-TestStaticDrum3
-TestMixer3
-TestSplitter3
-TestSteamDryer
+TestVolumeATh
+TestDynamicDrum
+TestPressurizer
+TestTank
+TestStaticDrum3
+TestMixer3
+TestSplitter3
+TestSteamDryer
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/package.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/package.mo
index d2c294d217efd74c07e4c0c4ffe16e798bc01453..6a9f4c81f3d570c38091a9f8c499865ebcee6802 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/package.mo
@@ -1,142 +1,142 @@
-within ThermoSysPro.Fluid.Examples.Book;
-package SimpleExamples
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains the simple <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a> examples.</p>
-<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
-</html>"));
-end SimpleExamples;
+within ThermoSysPro.Fluid.Examples.Book;
+package SimpleExamples
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains the simple <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a> examples.</p>
+<p>The results reported in the ThermoSysPro book were computed using Dymola.</h4>
+</html>"));
+end SimpleExamples;
diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/package.order b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/package.order
index 0e3844d8124ec4cb9849a0ac6754e09ced3f5391..97339dc6d348582f8f0eabebd069adf6e615283f 100644
--- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/package.order
@@ -1,10 +1,10 @@
-Boiler
-CombustionChamber
-HeatExchanger
-SteamTurbine
-GasTurbine
-CentrifugalPump
-PressureLoss
-Volume
-InternalCombustionEngine
-SolarCollector
+Boiler
+CombustionChamber
+HeatExchanger
+SteamTurbine
+GasTurbine
+CentrifugalPump
+PressureLoss
+Volume
+InternalCombustionEngine
+SolarCollector
diff --git a/ThermoSysPro/Fluid/Examples/Book/package.mo b/ThermoSysPro/Fluid/Examples/Book/package.mo
index 7ebed51e65bf43e547806c739ff8aa06123ed573..7a2de3d7815945bf6050c4bdce8df8cb2795abd2 100644
--- a/ThermoSysPro/Fluid/Examples/Book/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Book/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Fluid.Examples;
-package Book
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Book;
+within ThermoSysPro.Fluid.Examples;
+package Book
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Book;
diff --git a/ThermoSysPro/Fluid/Examples/Book/package.order b/ThermoSysPro/Fluid/Examples/Book/package.order
index ba9f03ebce8730a4cdaead0be73bbc6572fd35b4..68ac16d816376e1fc821b4310e359408ef8838cb 100644
--- a/ThermoSysPro/Fluid/Examples/Book/package.order
+++ b/ThermoSysPro/Fluid/Examples/Book/package.order
@@ -1,2 +1,2 @@
-PowerPlants
-SimpleExamples
+PowerPlants
+SimpleExamples
diff --git a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo
index f290b5bbf50a5a8f19f73c74e3ea08692dc262d9..abb73c981ef90a1e1a2ac137776cb12ef385a205 100644
--- a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo
+++ b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo
@@ -1,1825 +1,1874 @@
-within ThermoSysPro.Fluid.Examples.CombinedCyclePowerPlant;
-model CombinedCycle_Load_100_50 "CCPP model to simulate a load variation from 100% to 50%"
-  parameter Real CstHP(fixed=false,start=7872243.329137064)
-    "Stodola's ellipse coefficient HP";
-  parameter Real CstMP(fixed=false,start=250346.99234192327)
-    "Stodola's ellipse coefficient MP";
-  parameter Real CstBP(fixed=false,start=10510.769959447052)
-    "Stodola's ellipse coefficient BP";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
-    "Maximum CV: alim. valve HP Drum  ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
-    "Maximum CV: steam valve BP Drum ";
-  parameter Real Encras_SHP1(fixed=false,start=1)
-    "Sur HP1: heat exchange fouling coefficient";
-  parameter Real Encras_SHP2(fixed=false,start=1)
-    "Sur HP2: heat exchange fouling coefficient";
-  parameter Real Encras_SHP3(fixed=false,start=1)
-    "Sur HP3: heat exchange fouling coefficient";
-  parameter Real Encras_EHP1(fixed=false,start=1)
-    "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Encras_EHP2(fixed=false,start=1)
-    "Eco HP2: heat exchange fouling coefficient";
-  parameter Real Encras_EHP3(fixed=false,start=1)
-    "Eco HP3: heat exchange fouling coefficient";
-  parameter Real Encras_EHP4(fixed=false,start=1)
-    "Eco HP4: heat exchange fouling coefficient";
-
-  parameter Real Encras_SMP1(fixed=false,start=1)
-    "Sur MP1: heat exchange fouling coefficient";
-  parameter Real Encras_SMP2(fixed=false,start=1)
-    "Sur MP2: heat exchange fouling coefficient";
-  parameter Real Encras_SMP3(fixed=false,start=1)
-    "Sur MP3: heat exchange fouling coefficient";
-  parameter Real Encras_EMP(fixed=false,start=1)
-    "Eco MP: heat exchange fouling coefficient";
-
-  parameter Real Encras_EvHP(fixed=false,start=1)
-    "Evapo HP: heat exchange fouling coefficient";
-  parameter Real Encras_EvMP(fixed=false,start=1)
-    "Evapo MP: heat exchange fouling coefficient";
-  parameter Real Encras_EvBP(fixed=false,start=1)
-    "Evapo BP: heat exchange fouling coefficient";
-
-  parameter Real Encras_SBP(fixed=false,start=1)
-    "Sur BP: heat exchange fouling coefficient";
-  parameter Real Encras_EBP(fixed=false,start=1)
-    "Eco BP: heat exchange fouling coefficient";
-
-  parameter Real KgainChargeHP(fixed=false,start=720.183)
-    "HP: Friction pressure loss coefficient";
-  parameter Real KgainChargeMP(fixed=false,start=1090.9)
-    "MP: Friction pressure loss coefficient";
-  parameter Real Kin_SMP2(fixed=false,start=10.)
-    "SMPin: Friction pressure loss coefficient";
-  parameter Real K_PerteChargeZero2(fixed=false,start=1e-4)
-    "TurbineMP out: Friction pressure loss coefficient";
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
-    "Maximum CV input Turbine HP ";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
-    "Maximum CV input Turbine MP ";
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(
-    L=16.27,
-    Vertical=false,
-    hl(fixed=false, start=1459929.6557225615),
-    hv(fixed=false, start=2664756.9335524077),
-    Vv(fixed=false),
-    R=1.05,
-    xmv(fixed=false),
-    P(fixed=false, start=12726786.684064418),
-    zl(start=1.05, fixed=true),
-    Mp=5000,
-    Kpa=5,
-    Kvl=1000,
-    Pfond(start=12733698.15963666),
-    Tp(start=589.4448369021196))
-                     annotation (Placement(transformation(extent={{38,10},{-2,
-            50}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(
-      Cvmax=CvmaxValveAHP,
-    C1(P(start=13374652.64958711),
-                            h_vol_2(start=1398250.7267619045)),
-    h(start=1398000),
-    Cv(start=178),
-    Pm(start=13050700))   annotation (Placement(transformation(extent={{78,46},{58,66}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurHP(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(
-    Cvmax=47829.4,
-    C2(h_vol_1(start=2664756.9335524077)),
-    h(start=2674000),
-    Cv(start=23914.7),
-    Pm(start=12725274.444912266))   annotation (Placement(transformation(extent={{-22,46},{-42,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(
-    z2=0,
-    Q(start=150, fixed=true),
-    z1=10.83,
-    K=KgainChargeHP,
-    C2(P(start=12758125.131063813)),
-    h(start=1474422.14552527),
-    Pm(start=12704000))
-            annotation (Placement(transformation(
-        origin={28,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(V=5,
-    h(start=1459929.6557225615),
-    P(start=12704000))                         annotation (Placement(transformation(
-          extent={{8,-100},{-12,-80}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EvaporateurHP(
-    Dint=32.8e-3,
-    Ntubes=1476,
-    L=20.7,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
-      Tp(start={607.9743232022095,605.444949344346,604.0557720629383}),
-      Tp1(start={606.517435991606,604.7669177434965,603.7415072757717})),
-    Ns=3,
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.092,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      K(fixed=true, start=37.69),
-      CSailettes=11.86442072,
-      p_rho=1.05,
-      Encras=Encras_EvHP,
-      deltaT(start={106,49,23}),
-      T2(start={755.54833984375,674.4067359457392,636.0812177546504,
-            618.193603515625}),
-      T1(start={714.9775457406769,655.2439768501948,627.1374112677474}),
-      Tp(start={609.3279079642047,606.0749042484599,604.3477535039484})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=10.83,
-      option_temperature(start=false)=
-                         false,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={5.74e7,2.67e7,1.24e7}),
-      h(start={1459929.625,1842858.7345266847,2021072.953461077,
-            2103674.4922587443,1459929.625}),
-      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
-      P(start={12758125.0,12740268.20023451,12734647.766847359,
-            12730499.45519915,12726787.0}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={-14,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurHP4(
-    Ns=3,
-    L=20.726,
-    Dint=0.0266,
-    Ntubes=246,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-3.5e6,-2.63e6,-2e6}),
-      Tp(start={576.9773977809047,582.0830364334571,585.8301318496927}),
-      Tp1(start={576.3268547206692,581.5931147025063,585.4596791589167})),
-    Cws1(P(start=13301170.910895599),
-       h_vol_2(start=1291418.4097512758)),
-    Cws2(h_vol_1(start=1398250.726761905)),
-    ExchangerFlueGasesMetal(
-      Dext=0.0318,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.39069779,
-      K(fixed=true, start=47.53),
-      p_rho=1.06,
-      Encras=Encras_EHP4,
-      deltaT(start={38,29,22}),
-      T2(start={618.193603515625,613.1248964422501,609.3035158562986,
-            606.41162109375}),
-      T1(start={615.6592506115472,611.2142061492743,607.857569142044}),
-      Tp(start={577.5724142989593,582.5311413173429,586.1689648703535})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      z2=0,
-      option_temperature(start=false)=
-                         false,
-      inertia=true,
-      dW1(start={3.5e6,2.63e6,2e6}),
-      h(start={1291418.375,1337416.303924748,1372057.1590979556,
-            1398250.726761905,1398250.75}),
-      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
-      P(start={13301171.0,13320152.543490017,13338662.827011712,
-            13356802.623346366,13374653.0}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={86,-50},
-        extent={{20,20},{-20,-20}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurHP1(
-    Ns=3,
-    L=20.4,
-    Dint=0.0324,
-    Ntubes=246,
-    ExchangerWall(e=0.0028, lambda=37.61,
-    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
-      Tp(start={641.773975889456,659.2620935819541,674.5601453613823}),
-      Tp1(start={639.7214032623475,657.645496743186,673.3086347868172})),
-    Cws1(h_vol_2(start=2664756.9335524077)),
-    Cws2(P(start=12720371.43140221),
-      h_vol_1(start=2973076.465167672)),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=10.25056,
-      K(fixed=true, start=34.71),
-      p_rho=1.04,
-      Encras=Encras_SHP1,
-      deltaT(start={138,108,84}),
-      T2(start={788.2433471679688,774.636330839027,763.888258455914,
-            755.54833984375}),
-      T1(start={781.4398445109163,769.2622946474705,759.7183069957642}),
-      Tp(start={643.6693613731671,660.754890543465,675.715814566568})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      option_temperature(start=false)=
-                         false,
-      inertia=true,
-      dW1(start={9.8e6,7.7e6,5.9e6}),
-      h(start={2664757.0,2793366.8463525265,2894659.427023337,2973076.465167672,
-            2973076.5}),
-      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
-      P(start={12723762.0,12723704.875007024,12723025.392511783,
-            12721873.859626876,12720371.0}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={-54,-50},
-        extent={{-20,20},{20,-20}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurHP3(
-    Dint=26.6e-3,
-    Ntubes=1476,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
-      Tp(start={556.7923625573021,563.4515089057426,565.7949884705216}),
-      Tp1(start={556.3098450461794,563.2778280617686,565.7320909419939})),
-    L=20.726,
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=12.451,
-      K(fixed=true, start=36.0300000000857),
-      p_rho=1.08,
-      Encras=Encras_EHP3,
-      St=5, deltaT(start={34,12,4.4}),
-      T2(start={602.6719360351563,579.980900946576,571.7829862725544,
-            568.8102416992188}),
-      T1(start={591.3264094805266,575.8819436095652,570.2965996068247}),
-      Tp(start={557.2336952021615,563.6103653709807,565.8525174347154})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.6e7,5.6e6,2.1e6}),
-      h(start={986348.0625,1191052.0456419336,1264734.6677716642,
-            1291418.4097512758,1291418.375}),
-      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
-      P(start={13219328.0,13241437.958285147,13261883.227869928,
-            13281654.651763307,13301171.0}),
-      T0(start={290.0,290.0,290.0})))
-                  annotation (Placement(transformation(
-        origin={206,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurHP2(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-5e6,-3e6,-2.e6}),
-      Tp(start={491.54343078281,498.9069980271022,503.5184174104173}),
-      Tp1(start={491.3392380231037,498.7785262547952,503.4374982277421})),
-    L=20.767,
-    Ntubes=1107,
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=111e-3,
-      CSailettes=2.76134577,
-      K(fixed=true, start=65.5300000000393),
-      p_rho=1.11,
-      Encras=Encras_EHP2,
-      St=5, deltaT(start={36,23,14}),
-      T2(start={531.16064453125,523.8360138077611,519.2214124321695,
-            516.3124389648438}),
-      T1(start={527.4983362936189,521.5287131199652,517.7669224567446}),
-      Tp(start={491.73019484551236,499.02450420201814,503.5924298060023})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={5e6,3e6,2.e6}),
-      h(start={854493.25,919592.0464622772,960550.2028257779,986348.0919441726,
-            986348.0625}),
-      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
-      P(start={13129347.0,13152374.515059257,13174952.371260952,
-            13197235.505730344,13219328.0}),
-      T0(start={290.0,290.0,290.0})))
-                  annotation (Placement(transformation(
-        origin={406,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurHP1(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-9.9999e6,-5e6,-2.4e6}),
-      Tp(start={460.16002911133717,469.99835357411166,474.7738719222592}),
-      Tp1(start={459.7281425156256,469.7896188414262,474.67326898241726})),
-    L=20.726,
-    Ntubes=1107,
-    Cws1(h_vol_2(start=618649.6677733721)),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=8.30057632,
-      K(fixed=true, start=40.24),
-      p_rho=1.13,
-      Encras=Encras_EHP1,
-      St=5,   deltaT(start={41,20,10}),
-      T2(start={509.31475830078125,493.76452187742854,486.23046610566547,
-            482.5950622558594}),
-      T1(start={501.5396335543568,489.997493991547,484.4127676365523}),
-      Tp(start={460.5550523989298,470.18927193360446,474.8658879848841})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.767,
-      inertia=true,
-      dW1(start={9.9999e6,5e6,2.4e6}),
-      h(start={618649.6875,756067.8313424552,822483.2837402308,854493.240474255,
-            854493.25}),
-      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
-      advection=true,
-      dynamic_mass_balance=true,
-      P(start={13034952.0,13059418.53296798,13083081.248541538,
-            13106320.315256517,13129347.0}),
-      T0(start={290.0,290.0,290.0})))
-                  annotation (Placement(transformation(
-        origin={526,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurHP2(
-    Ns=3,
-    L=20.4,
-    Dint=32e-3,
-    Ntubes=246,
-    ExchangerWall(e=3e-3, lambda=27,
-          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
-      Tp(start={718.0864855457228,738.9518857688491,755.2055454298172}),
-      Tp1(start={715.3026673550778,736.860075660393,753.6461561287115})),
-    Cws2(P(start=12711006.754972342),
-      h_vol_1(start=3240813.8516343245)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      K(fixed=true, start=34.74),
-      CSailettes=10.2505424803872,
-      p_rho=1.02,
-      Encras=Encras_SHP2,
-      St=5,
-      deltaT(start={124,93,70}),
-      T2(start={850.646484375,838.5707346201303,829.4749488031354,
-            822.6819458007813}),
-      T1(start={844.6086089059804,834.0228417116329,826.0784372242802}),
-      Tp(start={720.6412271937046,740.871563720893,756.6366147445857})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.83,
-      inertia=true,
-      dW1(start={8.8e6,6.6e6,4.9e6}),
-      h(start={2973076.5,3088900.88921149,3175933.4050769014,3240813.8516343245,
-            3240813.75}),
-      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
-      P(start={12720371.0,12718678.034082344,12716464.21434507,
-            12713872.892207509,12711007.0}),
-      T0(start={290.0,290.0,290.0})))
-                  annotation (Placement(transformation(
-        origin={-174,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurHP3(
-    Ns=3,
-    L=20.4,
-    Ntubes=246,
-    ExchangerWall(lambda=27, e=5e-3,
-    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
-      Tp(start={789.3906813408935,806.8419831862884,820.1561431707274}),
-      Tp1(start={785.7263795421367,804.0878954218736,818.093373707382})),
-    Dint=28e-3,
-    Cws2(h_vol_1(start=3433271.775819776)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      K(fixed=true, start=49.33),
-      CSailettes=6.59672842597229,
-      p_rho=1,
-      Encras=Encras_SHP3,
-      St=5,
-      deltaT(start={97,73,55}),
-      T2(start={894.2188110351563,885.636025090525,879.1746662824661,
-            874.3292236328125}),
-      T1(start={889.9274067093704,882.4053456864956,876.7519418617093}),
-      Tp(start={792.5370292454647,809.2067770105702,821.927337447906})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.726,
-      inertia=true,
-      dW1(start={6.3e6,4.7e6,3.6e6}),
-      h(start={3240813.75,3323965.684475156,3386462.568744374,3433271.775819776,
-            3433271.75}),
-      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
-      P(start={12711007.0,12704270.150400551,12696927.059489354,
-            12689132.094962938,12681000.0}),
-      T0(start={290.0,290.0,290.0})))
-                  annotation (Placement(transformation(
-        origin={-294,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(
-    L=16.27,
-    Vertical=false,
-    P0=27.29e5,
-    hl(fixed=false, start=980708.0463805634),
-    hv(fixed=false, start=2798574.7604119307),
-    Vv(fixed=false),
-    R=1.05,
-    P(fixed=false, start=2733824.789876998),
-    zl(start=1.05, fixed=true),
-    Kpa=5,
-    Mp=5000,
-    Kvl=1000,
-    Pfond(start=2742370.2498246767),
-    Tp(start=497.3822823273814))
-                     annotation (Placement(transformation(extent={{358,10},{320,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurMP(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(
-      Cvmax=CvmaxValveAMP,
-    C1(P(start=3216971.701899643),
-    h_vol_2(start=944504.749093579)),
-    h(start=944000),
-    Cv(start=28),
-    Pm(start=2975000))   annotation (Placement(transformation(extent={{398,46},{378,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(
-    Cvmax=47829.4,
-    C2(h_vol_1(start=2798574.7604119307)),
-    h(fixed=false, start=2798000),
-    Cv(start=23914.7),
-    Pm(fixed=false, start=2732575.5179918623))   annotation (Placement(transformation(extent={{298,46},{278,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EvaporateurMP(
-    Dint=32.8e-3,
-    L=20.767,
-    Ntubes=738,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
-      Tp(start={504.98976100715464,504.26964479130794,503.6922361659351}),
-      Tp1(start={504.4959569394237,503.8875506396794,503.39662949233303})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.83,
-      continuous_flow_reversal=true,
-      inertia=true,
-          dW1(start={9.7e7,7.6e6,5.8e6}),
-      P(start={2773367.25,2751227.106127094,2743473.7578241928,
-            2738204.9403230133,2733824.75}),
-      h(start={980708.0625,1045813.9695051656,1096191.4250344052,
-            1135165.8819583436,980708.0625}),
-      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464}),
-      T0(start={290.0,290.0,290.0})),
-    Cws1(P(start=2773367.372876323)),
-    ExchangerFlueGasesMetal(
-      K(fixed=true, start=30.22),
-      Dext=38e-3,
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=10.0676093,
-      p_rho=1.1,
-      Encras=Encras_EvMP,
-      St=5,
-      deltaT(start={53,41,32}),
-      T2(start={565.2481689453125,550.9126306026692,539.787269523939,
-            531.16064453125}),
-      T1(start={558.0803978580261,545.349950063304,535.4739641517078}),
-      Tp(start={505.44855126670757,504.624646069051,503.9668824707551})))
-                          annotation (Placement(transformation(
-        origin={306,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(
-    z2=0,
-    z1=10.83,
-    Q(start=150, fixed=true),
-    K=KgainChargeMP,
-    Pm(start=2734000),
-    h(start=978914.570821827))
-            annotation (Placement(transformation(
-        origin={348,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(V=5,
-    h(start=980708.0463805634),
-    P(start=2734000))                         annotation (Placement(transformation(
-          extent={{328,-100},{308,-80}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurMP(
-    ExchangerWall(e=2.6e-3, lambda=47,
-        dW1(start={-3e6,-1.4e6,-740379}),
-      Tp(start={469.31277462346344,487.36995421739016,497.00024549998545}),
-      Tp1(start={468.830886627779,487.11263557868836,496.8627293559427})),
-    L=20.726,
-    Ns=3,
-    Dint=26.6e-3,
-    Ntubes=246,
-    Cws1(h_vol_2(start=565106.2802015315)),
-    Cws2(h_vol_1(start=944504.7490935794)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      K(fixed=true, start=47.78),
-      CSailettes=7.16188651,
-      p_rho=1.12,
-      Encras=Encras_EMP,
-      St=5,
-      deltaT(start={45,24,13}),
-      T2(start={516.3124389648438,512.4675048876576,510.41305969109146,
-            509.31475830078125}),
-      T1(start={514.3899686844887,511.4402822893745,509.8639024611882}),
-      Tp(start={469.75353148474505,487.6053096442755,497.12602407127685})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.767,
-      z2=0,
-      inertia=true,
-      dW1(start={3e6,1.4e6,740379}),
-      h(start={565106.25,773641.4896138782,884995.1575722523,944504.7490935792,
-            944504.75}),
-      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
-      P(start={3124223.75,3148825.327098676,3172192.2961615147,
-            3194799.9976396263,3216971.75}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={466,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurMP1(
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.3e6,-0.80263e6,
-                                -501864}),
-      Tp(start={558.2379692767729,574.1762943611731,584.4002179866045}),
-      Tp1(start={557.8513010794924,573.9323757073441,584.2477131820202})),
-    L=20.726,
-    Ns=3,
-    Dint=32.8e-3,
-    Ntubes=123,
-    Cws1(h_vol_2(start=2798574.7604119307)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      K(fixed=true, start=22.09),
-      CSailettes=14.46509765,
-      p_rho=1.07,
-      Encras=Encras_SMP1,
-      St=5,
-      deltaT(start={45,30,19}),
-      T2(start={606.41162109375,604.5654891969185,603.4004814494892,
-            602.6719360351563}),
-      T1(start={605.488555812354,603.9829853232038,603.0361997319833}),
-      Tp(start={558.5972202716488,574.4029176513201,584.54190924323})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.77,
-      inertia=true,
-      dW1(start={1.3e6,0.80263e6,501864}),
-      h(start={2798574.75,2900855.9998369273,2965377.215724287,
-            3005717.6950751985,3040562.75}),
-      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
-      P(start={2731326.25,2730394.924575977,2729276.921848465,
-            2728029.2082540947,2726700.0}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={146,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(
-    Ce1(h(start=3046256.0341363903)),
-    h(start=3040562.6721177064),
-    P(start=2726000))
-    annotation (Placement(transformation(
-        origin={148,-110},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurMP2(
-    Ns=3,
-    L=20.4,
-    Dint=39.3e-3,
-    Ntubes=369,
-    ExchangerWall(e=2.6e-3, lambda=36.86,
-    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
-      Tp(start={689.1325590707521,714.3255084496102,731.974510062409}),
-      Tp1(start={687.8673243896432,713.4490802987744,731.369523912658})),
-    Cws1(P(start=2575582.5771302995),
-      h_vol_2(start=3040562.6721177064)),
-    Cws2(P(start=2558239.090625735),
-      h_vol_1(start=3321940.994604838)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=92e-3,
-      K(fixed=true, start=45.22),
-      CSailettes=5.814209831,
-      p_rho=1.03,
-      Encras=Encras_SMP2,
-      St=5,
-      deltaT(start={125,86,60}),
-      T2(start={822.6819458007813,806.8523532375756,795.852828640494,
-            788.2433471679688}),
-      T1(start={814.7671394415003,801.3525909390348,792.0480934116497}),
-      Tp(start={690.3215978858725,715.1491557188672,732.5430623045928})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dW1(start={1.15e7,7.9e6,5.5e6}),
-      h(start={3040562.75,3170178.6567147295,3259963.658181113,
-            3321940.994604838,3321941.0}),
-      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
-      P(start={2575582.5,2571900.999964748,2567682.4202753096,
-            2563090.6820579167,2558239.0}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={-114,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurMP3(
-    Ns=3,
-    L=20.4,
-    Ntubes=369,
-    Dint=45.6e-3,
-    ExchangerWall(e=2.6e-3, lambda=27,
-    dW1(start={-8e6,-5.5e6,-3.8e6}),
-      Tp(start={786.239853752146,802.8777020553458,814.3692554800219}),
-      Tp1(start={785.1915402608809,802.1579544921993,813.8760433493436})),
-    Cws2(h_vol_1(start=3517975.7051807973)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=92e-3,
-      Dext=50.8e-3,
-      K(fixed=true, start=43.23),
-      CSailettes=5.695842178,
-      p_rho=1.01,
-      Encras=Encras_SMP3,
-      St=5,
-      deltaT(start={82,56,38}),
-      T2(start={874.3292236328125,863.3655435931397,855.822658205448,
-            850.646484375}),
-      T1(start={868.8473805170461,859.5941008992938,853.2345706986391}),
-      Tp(start={787.2330782757132,803.5596268196659,814.8365492691358})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dW1(start={8e6,5.5e6,3.8e6}),
-      h(start={3321941.0,3412821.580454202,3475218.0684875553,
-            3517975.7051807973,3517975.75}),
-      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
-      P(start={2558239.0,2556052.5796892336,2553681.6710159215,
-            2551184.3906656993,2548600.0}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={-234,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(
-    Vertical=false,
-    P0=5e5,
-    Vv(fixed=false),
-    L=8,
-    hl(fixed=false, start=550072.7232069891),
-    hv(fixed=false, start=2684673.580149807),
-    R=2,
-    P(fixed=false, start=485579.1243268126),
-    zl(start=1.75, fixed=true),
-    Kpa=5,
-    Mp=5000,
-    Kvl=1000,
-    Pfond(start=501612.0798822072),
-    Tp(start=406.2632923392337))
-                     annotation (Placement(transformation(extent={{618,10},{578,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurBP(                                                              k=0.5)
-    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(
-    p_rho=3, Cvmax=CvmaxValveVBP,
-    C2(P(start=510622.8582477031),
-    h_vol_1(start=2684673.580149807)),
-    h(start=2685000),
-    Cv(start=1),
-    Pm(start=498000))   annotation (Placement(transformation(extent={{558,46},{538,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(
-    Cvmax=285,
-    C1(h_vol_2(start=509236.1596958067)),
-    h(fixed=false, start=509000),
-    Cv(start=142.5),
-    Pm(fixed=false, start=957583.6711025466))   annotation (Placement(transformation(extent={{650,44},{630,64}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(
-    z2=0,
-    z1=10.767,
-    Q(start=50, fixed=false),
-    K=32766,
-    rho(start=934.2358753989836),
-    Pm(start=564000),
-    h(start=549249.519022482))
-            annotation (Placement(transformation(
-        origin={610,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(h(start=550072.7232069891),
-    V=5,
-    P(start=564000))                         annotation (Placement(transformation(
-          extent={{592,-100},{572,-80}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EvaporateurBP(
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
-      Tp(start={427.75117227047275,426.57196634952743,425.692416702357}),
-      Tp1(start={427.2791524733697,426.249857647769,425.4722112637204})),
-    L=20.726,
-    Ntubes=984,
-    Ns=3,
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=138e-3,
-      K(fixed=true, start=30.62),
-      CSailettes=11.07985,
-      p_rho=1.14,
-      Encras=Encras_EvBP,
-      St=5,
-      deltaT(start={45,31,21}),
-      T2(start={482.5950622558594,464.01748118772224,451.30051770870455,
-            442.58880615234375}),
-      T1(start={473.3062751775807,457.6589994482134,446.94466391603106}),
-      Tp(start={428.18972290092955,426.87123552234135,425.89700819308825})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={1.24e7,8.5e6,5.8e6}),
-      h(start={550072.75,798514.7797723989,968052.8982857756,1083955.4353773424,
-            550072.75}),
-      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
-      Q(start={50.00030606442327,50.00030606442327,50.00030606442327,
-            50.00030606442327}),
-      P(start={512574.0,487903.6002327947,486912.76813325885,486233.0185244784,
-            485579.125}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={566,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_ballonBP(k=1)
-    annotation (Placement(transformation(extent={{742,6},{728,18}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(
-    Cvmax=308.931,
-    C1(h_vol_2(start=550072.7232069891)),
-    h(start=550000),
-    Cv(start=308.931),
-    Pm(start=404001.70325999695))
-                 annotation (Placement(transformation(extent={{710,-14},{730,6}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurBP(
-    Ns=3,
-    L=20.726,
-    Dint=39.3e-3,
-    Ntubes=123,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.1e6,-782901,-559798}),
-      Tp(start={475.35471340675434,500.0471952971929,518.0415300925415}),
-      Tp1(start={475.07666786714793,499.8473601819379,517.8986430965637})),
-    Cws1(h_vol_2(start=2684673.580149807)),
-    Cws2(h_vol_1(start=2914519.282601244)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=222.1e-3,
-      K(fixed=true, start=30.46),
-      CSailettes=3.25763059984175,
-      p_rho=1.09,
-      Encras=Encras_SBP,
-      St=5,
-      deltaT(start={92,66,47}),
-      T2(start={568.8102416992188,567.2151210721856,566.0683353396659,
-            565.2481689453125}),
-      T1(start={568.0126670066404,566.6417282059258,565.6582502265244}),
-      Tp(start={475.61601428945164,500.234995799533,518.1758120458845})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      rugosrel=1e-5,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.1e6,782901,559798}),
-      h(start={2684673.5,2787622.843498506,2861613.8808508525,2914519.282601244,
-            2914519.25}),
-      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
-      P(start={510622.84375,508733.6061914782,506650.25202074344,
-            504336.5353393364,501850.0}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={266,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5)
-    annotation (Placement(transformation(
-        origin={722,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurBP(
-    Ns=3,
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
-      Tp(start={400.3519750836609,396.09689492479714,395.2201421057111}),
-      Tp1(start={400.0855824116385,396.0373810697358,395.20741736846634})),
-    Ntubes=3444,
-    L=20.726,
-    Cws1(h_vol_2(start=194584.50261459063)),
-    Cws2(h_vol_1(start=509236.15969580685)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=92e-3,
-      K(fixed=true, start=31.53),
-      CSailettes=11.673758598919,
-      p_rho=1.15,
-      Encras=Encras_EBP,
-      St=5,
-      deltaT(start={23.5,5.3,1.1}),
-      T2(start={442.58880615234375,405.54898708865323,397.2418326138536,
-            395.4642028808594}),
-      T1(start={424.0688986060054,401.3954098512534,396.353024695102}),
-      Tp(start={400.59947884299936,396.1521888739459,395.23196457920767})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      inertia=true,
-      dW1(start={2.45e7,5.5e6,1.17e6}),
-      h(start={194584.5,442113.0226180337,497412.50346040993,509236.1596958068,
-            509236.15625}),
-      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
-      P(start={1540564.125,1504650.386070031,1479432.0451056722,
-            1454480.269096047,1429588.25}),
-      T0(start={290.0,290.0,290.0})))
-                          annotation (Placement(transformation(
-        origin={680,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.88057),
-    Qmax=140,
-    eta_is_nom=0.88057,
-    eta_is_min=0.75,
-    Cst(start=8182844.56002535)=
-        CstHP,
-    pros(d(start=10.66426189633104)),
-    Hrs(start=3046256.0341363903),
-    Pe(fixed=true, start=12431000),
-    Ps(fixed=false, start=2726700))
-              annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9625),
-    Qmax=150,
-    eta_is_nom=0.9625,
-    eta_is_min=0.75,
-    Cst(start=256335.364995961)=
-        CstMP,
-    pros(d(start=1.8827680646065352)),
-    Hrs(start=3029781.976396904),
-    Pe(fixed=true, start=2548500),
-    Ps(fixed=false, start=476800))
-                annotation (Placement(transformation(extent={{318,-250},{358,
-            -210}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(
-    h(start=3017480.4191624634),
-    P(start=476799.99999954),
-    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
-        origin={418,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9538),
-    Qmax=150,
-    eta_is_nom=0.9538,
-    eta_is_min=0.75,
-    Cst(start=11944.9445735985)=
-        CstBP,
-    Cs(h(start=2401033.111118852)),
-    Hrs(start=2401030),
-    Pe(fixed=true, start=476799.99999954),
-    Ps(start=10053))
-                annotation (Placement(transformation(extent={{576,-250},{616,
-            -210}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-292,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(
-                                                    alpha=2)
-    annotation (Placement(transformation(
-        origin={-232,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(
-                                                    alpha=0.5,
-    Ce(h(start=3046260)),
-    P(start=2726700))
-    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(
-    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    Vf0=0.15,
-    steady_state=false,
-    yNiveau(signal(start=1.5)),
-    Cse(h(start=128076)),
-    P(fixed=false, start=6136),
-    Pfond(start=10000.0),
-    Cl(h(start=191812.29519356362)),
-    proe(d(start=996.0186965963143)))
-    annotation (Placement(transformation(extent={{637,-384},{717,-304}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(
-    h0=113.38e3, Q0=29804.5)     annotation (Placement(transformation(extent={{
-            572,-377},{620,-329}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(    K=1e-4,
-    h(start=2400000),
-    C1(h_vol_2(start=2400000), h(start=2400000)),
-    Pm(start=10026.561030835077))
-    annotation (Placement(transformation(extent={{640,-240},{660,-220}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(
-    Ce3(h(start=194584.50261452305)),
-    h(start=194584.50261459063),
-    P(start=1540500))
-    annotation (Placement(transformation(
-        origin={902,-318},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(K=1e-4,
-    rho(start=990.3586687482405),
-    Pm(start=1540000))
-    annotation (Placement(transformation(
-        origin={902,-270},
-        extent={{12,-12},{-12,12}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(
-    h(start=550072.7232069891),
-    P(start=322430))                         annotation (Placement(transformation(
-          extent={{742,-20},{762,0}}, rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(
-    a3=350,
-    b1(fixed=true) = -3.7751,
-    a1=-244551,
-    Q(fixed=false),
-    C1(h_vol_2(start=550072.7232069891)),
-    C2(h_vol_1(start=565106.2802015315)),
-    Qv(start=0.01332183238847357),
-    rho(start=933.5252816181976),
-    Pm(start=1725850))
-            annotation (Placement(transformation(extent={{804,-20},{824,0}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(
-    a3=1600,
-    a1=-28056.2,
-    b1=-12.7952660447433,
-    Q(fixed=false),
-    C1(h_vol_2(start=550072.7232069891)),
-    C2(h_vol_1(start=618649.6677733721)),
-    Qv(start=0.08171817156952406),
-    rho(start=931.4140647908531),
-    Pm(start=6774000))
-             annotation (Placement(transformation(extent={{804,-60},{824,-40}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(alpha=0.5,
-    h(start=194585),
-    P(start=1540500),
-    Cs(h(start=194585)))
-    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(alpha=2)
-    annotation (Placement(transformation(
-        origin={268,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(
-    z2=0,
-    z1=0,
-    K=K_PerteChargeZero2,
-    h(start=3000000),
-    C1(
-      h_vol_2(start=3000000),
-      h(start=3000000),
-      P(fixed=true, start=501850)),
-    Pm(start=490000))
-            annotation (Placement(transformation(
-        origin={344,-278},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(K=1e-4,
-    Pm(start=322424.2818830876))
-    annotation (Placement(transformation(
-        origin={780,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(K=1e-4,
-    Pm(start=322424.28218490275))
-    annotation (Placement(transformation(
-        origin={780,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur
-    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(K=1e-4,
-    C1(h_vol_2(start=191812.29519356362)),
-    C2(h_vol_1(start=191812.29519356362)),
-    rho(start=989.8383588386498),
-    Pm(start=6200))
-    annotation (Placement(transformation(extent={{702,-446},{722,-426}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(
-    Qv(start=0.2002405532484127),
-    a3=400,
-    a1(fixed=true) = -6000,
-    Q(start=194.502, fixed=false),
-    C2(h_vol_1(start=194584.50261452305)),
-    Pm(start=783963.3809799375))
-            annotation (Placement(transformation(extent={{742,-446},{762,-426}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(
-    K=1e-4,
-    rho(start=990.3586687495459),
-    C1(h_vol_2(start=194584.50261452305),
-                            h(start=194585)),
-    Pm(start=1546000))
-    annotation (Placement(transformation(extent={{840,-446},{860,-426}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(Cvmax=
-        2000,
-    h(start=194500),
-    Cv(start=2000),
-    Pm(start=1549245.4644062065))
-                 annotation (Placement(transformation(extent={{802,-440},{822,
-            -420}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol_2(start=2674000),
-        h(start=2674000)))
-    annotation (Placement(transformation(
-        origin={-58,8},
-        extent={{-6,6},{6,-6}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol_1(start=1398000),
-        h(start=1398000))) " "
-    annotation (Placement(transformation(
-        origin={91.5,32},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol_1(start=944000),
-        h(start=944000)))
-    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol_2(start=2798000),
-        h(start=2798000)))
-    annotation (Placement(transformation(
-        origin={236,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol_1(start=2685000),
-        h(start=2685000)))
-    annotation (Placement(transformation(
-        origin={514,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol_1(start=550000),
-        h(start=550000)))
-    annotation (Placement(transformation(
-        origin={663.5,34},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol_1(
-          start=550000), h(start=550000)))
-    annotation (Placement(transformation(extent={{687,-11},{700,1}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol_1(
-          start=194585), h(start=194585)))
-    annotation (Placement(transformation(
-        origin={685.5,-412},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol_1(
-          start=2401000), h(start=2401000)))
-    annotation (Placement(transformation(
-        origin={684.5,-264},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(
-                                                          K=Kin_SMP2,
-    Pm(start=2651000),
-    C1(
-      P(fixed=true, start=2726700),
-      h_vol_2(start=3046000),
-      h(start=3046000)))
-    annotation (Placement(transformation(extent={{114,-120},{94,-100}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(
-    C1(P(fixed=true, start=12680999.9999969)),
-    Cvmax=Cvmax_THP,
-    h(fixed=false, start=3433000),
-    Cv(start=10875),
-    Pm(fixed=false, start=12550000))   annotation (Placement(transformation(extent={{-124,-234},{-104,
-            -214}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauHP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl
-    regulation_Niveau_HP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500)
-    annotation (Placement(transformation(extent={{-40,106},{-20,126}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauMP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl
-    regulation_Niveau_MP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500)
-    annotation (Placement(transformation(extent={{262,106},{282,126}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauBP(                                                              k=1.75)
-    annotation (Placement(transformation(extent={{470,126},{504,144}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
-    add(k1=-1, k2=+1),
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauCondenseur1(                                 k=1.5)
-    annotation (Placement(transformation(extent={{716,-246},{740,-230}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-                                                add(k1=+1, k2=-1),
-    edge(uL(signal(start=true))))
-                                 annotation (Placement(transformation(extent={{
-            758,-282},{778,-262}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneTurbineHP(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
-            -138,-142}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{944,-42},{906,
-            -10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{945,-96},{907,
-            -64}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{945,-458},{907,
-            -426}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(
-    V=1,
-    h0=988332,
-    h(start=854493.2404741034),
-    dynamic_mass_balance=true,
-    P0=7010000,
-    P(start=13129347.20636851))                        annotation (Placement(transformation(
-          extent={{456,-98},{436,-78}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(
-    V=1,
-    h0=983786,
-    h(start=986348.0919441726),
-    dynamic_mass_balance=true,
-    P0=7000000,
-    P(start=13219328.239579093))                        annotation (Placement(transformation(
-          extent={{252,-20},{232,0}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(
-    Cvmax=308.931,
-    h(start=618600),
-    Cv(start=308.931),
-    Pm(start=13130272.672059398))
-                 annotation (Placement(transformation(extent={{754,-98},{730,
-            -122}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(
-    Cvmax=308.931,
-    h(start=565000),
-    Cv(start=308.931),
-    Pm(start=3126744.5275077047))
-                 annotation (Placement(transformation(extent={{804,-138},{780,
-            -162}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(
-    Initialvalue=0.8,
-    Finalvalue=0.01,
-    Duration=1000,
-    Starttime=200000)
-                     annotation (Placement(transformation(extent={{946,-150},{
-            908,-118}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(
-    Initialvalue=0.8,
-    Finalvalue=0.01,
-    Duration=1000,
-    Starttime=200000)
-                     annotation (Placement(transformation(extent={{946,-194},{
-            908,-162}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(
-    h0=3e6,
-    h(start=3433271.775819776),
-    dynamic_mass_balance=true,
-    P0=12700000,
-    P(start=12700000))                annotation (Placement(transformation(
-        origin={-52,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(
-    h0=3523910,
-    h(start=3517975.7051812997),
-    dynamic_mass_balance=true,
-    P0=2400000,
-    P(start=2400000))                     annotation (Placement(transformation(
-        origin={-50,-314},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(
-    C1(P(fixed=true, start=25.486e5)),
-    Cvmax=Cvmax_TMP,
-    h(fixed=false, start=3518000),
-    Cv(start=3.312e6),
-    Pm(fixed=false, start=2547000))   annotation (Placement(transformation(extent={{-124,-318},{-104,
-            -298}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneTurbineMP(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
-            -138,-226}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
-    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
-    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
-    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Gain Gain_2GasTurbine(Gain=
-       2) annotation (Placement(transformation(extent={{-18,-448},{2,-428}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible(
-    Hum=0,
-    Xo=0,
-    Xn=0,
-    Xs=0,
-    rho=0.838,
-    Q0=13.4368286133,
-    T0=185 + 273.16,
-    Xc=0.755,
-    Xh=0.245,
-    Cp=2255,
-    LHV=46989e3) annotation (Placement(transformation(extent={{-421,24},{-385,60}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceEau(             Q0=0.0)
-          annotation (Placement(transformation(extent={{-473,27},{-445,57}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Humidite(k=0.93)
-    annotation (Placement(transformation(extent={{-539,23},{-518,43}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceFumees(
-    Xso2=0,
-    Xco2=0,
-    Xh2o=0,
-    Xo2=0.20994,
-    Q0=600,
-    T0=29.4 + 273.16,
-    P0=1.013e5,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-539,-74},{-495,-28}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Machines.GasTurbine GasTurbine(
-    comp_tau_n=14.0178,
-    comp_eff_n=0.87004,
-    exp_tau_n=0.06458,
-    exp_eff_n=0.89045,
-    TurbQred=0.0175634,
-    Kcham=2.02088,
-    chambreCombustionTAC(Pea(fixed=false, start=14.0e5),
-      Psf(start=1333898.05061735),
-      Tsf(start=1493.5527523474145)),
-    Wpth=1e6,
-    Compresseur(
-      is_eff(fixed=false, start=0.88),
-      Xtau(fixed=false, start=1.00),
-      Ps(start=1419889.7074729432),
-      Ts(start=678.0795840911329),
-      Tis(start=630.7876402069812)),
-    TurbineAgaz(
-      Ps(fixed=false),
-      is_eff(fixed=false, start=0.87),
-      Pe(fixed=false, start=1333900),
-      Te(start=1493.59),
-      Ts(fixed=false, start=893.16),
-      Tis(start=814.7448743706253)),
-    xAIR(rho_air(start=1.099457970518182)))
-    annotation (Placement(transformation(extent={{-471,-115},{-341,13}},
-          rotation=0)));
-
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeQfuel(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=13.507,
-    Finalvalue=8.756)
-                     annotation (Placement(transformation(extent={{-539,64},{
-            -519,84}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampeIQair(
-    Starttime=200,
-    Duration=800,
-    Finalvalue=415.70,
-    Initialvalue=592.7)
-                   annotation (Placement(transformation(extent={{-541,-20},{
-            -521,0}}, rotation=0)));
-equation
-  connect(SurchauffeurHP3.Cws1, SurchauffeurHP2.Cws2)
-    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
-        color={255,0,0}));
-  connect(SurchauffeurHP2.Cws1, SurchauffeurHP1.Cws2)
-    annotation (Line(points={{-174,-70},{-174,-90},{-54,-90},{-54,-70}}, color=
-          {255,0,0}));
-  connect(constante_vanne_vapeurHP.y, vanne_vapeurHP.Ouv)
-    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
-  connect(vanne_vapeurHP.C1, BallonHP.Cv)
-    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
-  connect(GainChargeHP.C1, BallonHP.Cd)
-    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={255,128,
-          0}));
-  connect(BallonHP.Cm, EvaporateurHP.Cws2)
-    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}));
-  connect(VolumeEvapHP.Cs, EvaporateurHP.Cws1)
-    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={255,128,0}));
-  connect(VolumeEvapHP.Ce1, GainChargeHP.C2)
-                                      annotation (Line(points={{8,-90},{18,-90}},
-        color={255,128,0}));
-  connect(EconomiseurHP4.Cws1, EconomiseurHP3.Cws2)
-    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
-  connect(BallonMP.Cm, EvaporateurMP.Cws2)
-    annotation (Line(points={{320,10},{306,10},{306,-30}}));
-  connect(EvaporateurMP.Cws1, VolumeEvapMP.Cs)
-    annotation (Line(points={{306,-70},{306,-80},{308,-80},{308,-90}}, color={
-          255,128,0}));
-  connect(VolumeEvapMP.Ce1, GainChargeMP.C2)
-    annotation (Line(points={{328,-90},{338,-90}}, color={255,128,0}));
-  connect(constante_vanne_vapeurMP.y, vanne_vapeurMP.Ouv)
-    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
-  connect(SurchauffeurHP1.Cfg2, EvaporateurHP.Cfg1)        annotation (Line(
-      points={{-44,-50},{-24,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurHP.Cfg2, EconomiseurHP4.Cfg1)        annotation (Line(
-      points={{-4,-50},{76,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP4.Cfg2, SurchauffeurMP1.Cfg1)          annotation (Line(
-      points={{96,-50},{136,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP1.Cfg2, EconomiseurHP3.Cfg1)           annotation (Line(
-      points={{156,-50},{196,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurMP.Cfg2, EconomiseurHP2.Cfg1)           annotation (Line(
-      points={{316,-50},{396,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP2.Cfg2, EconomiseurMP.Cfg1)           annotation (Line(
-      points={{416,-50},{456,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurMP.Cfg2, EconomiseurHP1.Cfg1)           annotation (Line(
-      points={{476,-50},{516,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(GainChargeMP.C1, BallonMP.Cd)
-    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={255,
-          128,0}));
-  connect(SurchauffeurMP2.Cfg2, SurchauffeurHP1.Cfg1)          annotation (Line(
-      points={{-104,-50},{-64,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP2.Cfg1, SurchauffeurHP2.Cfg2)           annotation (Line(
-      points={{-124,-50},{-164,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP3.Cfg2, SurchauffeurHP2.Cfg1)           annotation (Line(
-      points={{-224,-50},{-184,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurHP3.Cfg2, SurchauffeurMP3.Cfg1)           annotation (Line(
-      points={{-284,-50},{-244,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP3.Cws1,SurchauffeurMP2. Cws2)
-    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
-          {255,0,0}));
-  connect(SurchauffeurMP1.Cws2, MelangeurHPMP.Ce2) annotation (Line(
-      points={{146,-70},{146,-85},{148,-85},{148,-100}},
-      color={255,0,0},
-      pattern=LinePattern.None));
-  connect(vanne_vapeurBP.C1, BallonBP.Cv)
-    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
-  connect(EvaporateurBP.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
-          -70},{566,-90},{572,-90}}, color={255,128,0}));
-  connect(VolumeEvapBP.Ce1, GainChargeBP.C2)
-                                        annotation (Line(points={{592,-90},{600,
-          -90}}, color={255,128,0}));
-  connect(BallonBP.Cd, GainChargeBP.C1)
-                                       annotation (Line(points={{618,10},{628,
-          10},{628,-90},{620,-90}}, color={255,128,0}));
-  connect(EconomiseurBP.Cfg2, PuitsFumees.C)     annotation (Line(
-      points={{690,-50},{712,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP3.Cfg2, SurchauffeurBP.Cfg1)  annotation (Line(
-      points={{216,-50},{256,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurBP.Cfg2, EvaporateurMP.Cfg1)  annotation (Line(
-      points={{276,-50},{296,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP1.Cfg2, EvaporateurBP.Cfg1) annotation (Line(
-      points={{536,-50},{556,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurBP.Cfg2, EconomiseurBP.Cfg1) annotation (Line(
-      points={{576,-50},{670,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(BallonBP.Cm, EvaporateurBP.Cws2)
-    annotation (Line(points={{578,10},{566,10},{566,-30}}));
-  connect(vanne_vapeurMP.C1, BallonMP.Cv)   annotation (Line(points={{298,50},{
-          320,50}}, color={255,0,0}));
-  connect(Vanne_alimentationMPHP.Ouv, constante_ballonBP.y)
-    annotation (Line(points={{720,7},{720,12},{727.3,12}}));
-  connect(SurchauffeurHP3.Cws2, DoubleDebitHP.Ce)
-    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
-        color={255,0,0}));
-  connect(SurchauffeurMP3.Cws2, DoubleDebitMP.Ce)
-    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
-        color={255,0,0}));
-  connect(VolumeCond1.Cs, perteChargeKCond1.C1) annotation (Line(points={{902,
-          -308},{902,-282}}, color={0,0,255}));
-  connect(Vanne_alimentationMPHP.C2, VolumeAlimMPHP.Ce1)
-                                               annotation (Line(points={{730,
-          -10},{742,-10}}, color={0,0,255}));
-  connect(SurchauffeurBP.Cws2, DoubleDebitBP.Ce)
-    annotation (Line(points={{266,-70},{266,-80},{268,-80},{268,-90}}, color={
-          255,0,0}));
-  connect(perteChargeK8.C2, PompeAlimMP.C1)
-    annotation (Line(points={{790,-10},{797,-10},{804,-10}},           color={0,
-          0,255}));
-  connect(VolumeAlimMPHP.Cs1, perteChargeK8.C1)
-    annotation (Line(points={{762,-10},{766,-10},{770,-10}},           color={0,
-          0,255}));
-  connect(VolumeAlimMPHP.Cs2, perteChargeK3.C1)
-                                         annotation (Line(points={{752,-20},{
-          752,-50},{770,-50}}, color={0,0,255}));
-  connect(perteChargeK3.C2, PompeAlimHP.C1)
-    annotation (Line(points={{790,-50},{804,-50}}, color={0,0,255}));
-  connect(MelangeurPostTMP1.Ce2, PerteChargeZero2.C2) annotation (Line(points={{418,
-          -240},{418,-278},{354,-278}},      color={255,0,0}));
-  connect(perteChargeK.C2,PompeAlimBP. C1)
-                                         annotation (Line(points={{722,-436},{
-          742,-436}}, color={0,0,255}));
-  connect(vanne_extraction.C2, perteChargeK2.C1) annotation (Line(points={{822,
-          -436},{840,-436}}, color={0,0,255}));
-  connect(vanne_alimentationHP.C1, CapteurDebitEauHP.C2)
-    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
-  connect(vanne_vapeurHP.C2, CapteurDebitVapHP.C1) annotation (Line(points={{
-          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
-  connect(CapteurDebitVapHP.C2, SurchauffeurHP1.Cws1) annotation (Line(points={
-          {-53.2,1.88},{-53.2,-3.06},{-54,-3.06},{-54,-30}}, color={255,0,0}));
-  connect(vanne_alimentationMP.C1, CapteurDebitEauMP.C2)
-    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
-  connect(CapteurDebitVapMP.C1, vanne_vapeurMP.C2) annotation (Line(points={{
-          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
-  connect(CapteurDebitVapMP.C2, SurchauffeurMP1.Cws1) annotation (Line(points={
-          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
-  connect(CapteurDebitVapBP.C2, SurchauffeurBP.Cws1) annotation (Line(points={{
-          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
-  connect(CapteurDebitVapBP.C1, vanne_vapeurBP.C2) annotation (Line(points={{
-          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
-  connect(CapteurDebitEauBP.C2, vanne_alimentationBP.C1) annotation (Line(
-        points={{658.3,40.12},{658.3,48},{650,48}}, color={0,0,255}));
-  connect(CapteurDebitEauBPsortie.C2, Vanne_alimentationMPHP.C1) annotation (Line(
-        points={{700.13,-9.8},{705.065,-9.8},{705.065,-10},{710,-10}}, color={0,
-          0,255}));
-  connect(CapteurDebitEauCondenseur.C2, perteChargeK.C1) annotation (Line(
-        points={{680.3,-422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
-  connect(perteChargeK1.C2, CapteurDebitVapCondenseur.C1) annotation (Line(
-        points={{660,-230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
-  connect(MelangeurHPMP.Ce1, MoitieDebitHP.Cs)
-    annotation (Line(points={{148,-120},{148,-170},{134,-170}}, color={255,0,0}));
-  connect(perteChargeK2.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,
-          -436},{862,-436},{862,-318},{872,-318}}, color={0,0,255}));
-  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
-          {892,-318}}, color={0,0,255}));
-  connect(SurchauffeurMP2.Cws1, lumpedStraightPipeK2.C2)
-    annotation (Line(points={{-114,-70},{-114,-110},{94,-110}}, color={255,0,0}));
-  connect(lumpedStraightPipeK2.C1, MelangeurHPMP.Cs2)
-    annotation (Line(points={{114,-110},{138,-110}},   color={255,0,0}));
-  connect(DoubleDebitHP.Cs, vanne_entree_TurbineHP.C1) annotation (Line(points=
-          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
-  connect(DoubleDebitBP.Cs, PerteChargeZero2.C1) annotation (Line(points={{268,
-          -110},{268,-278},{334,-278}}, color={255,0,0}));
-  connect(PompeAlimBP.C2, vanne_extraction.C1) annotation (Line(points={{762,
-          -436},{802,-436}}, color={0,0,255}));
-  connect(BallonHP.yLevel,regulation_Niveau_HP. MesureNiveauEau)
-    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
-  connect(regulation_Niveau_HP.SortieReelle1, vanne_alimentationHP.Ouv)
-    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
-  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
-    annotation (Line(points={{208.7,122},{234,122},{234,110},{261.5,110}}));
-  connect(BallonMP.yLevel,regulation_Niveau_MP. MesureNiveauEau)
-    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
-  connect(regulation_Niveau_MP.SortieReelle1, vanne_alimentationMP.Ouv)
-    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
-  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
-    annotation (Line(points={{505.7,135},{529.85,135},{529.85,112},{567.5,112}}));
-  connect(BallonBP.yLevel,regulation_Niveau_BP. MesureNiveauEau)
-    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
-  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
-    annotation (Line(points={{741.2,-238},{752,-238},{752,-269},{757.5,-269}}));
-  connect(regulation_Niveau_Condenseur.SortieReelle1, vanne_extraction.Ouv)
-    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
-  connect(CapteurDebitEauBP.C1, EconomiseurBP.Cws2)
-    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
-  connect(EconomiseurBP.Cws1, perteChargeKCond1.C2) annotation (Line(points={{
-          680,-70},{680,-186},{902,-186},{902,-258}}));
-  connect(CapteurDebitVapCondenseur.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
-    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,
-          -280.9}}));
-  connect(regulation_Niveau_Condenseur.MesureDebitEau,
-    CapteurDebitEauCondenseur.Measure) annotation (Line(points={{757.45,-274.95},
-          {750,-274.95},{750,-310},{792,-310},{792,-412},{692.13,-412}}));
-  connect(ConstantVanneTurbineHP.y, vanne_entree_TurbineHP.Ouv)
-    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
-  connect(regulation_Niveau_BP.SortieReelle1, vanne_vapeurBP.Ouv)
-    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
-  connect(vanne_alimentationBP.Ouv, constante_vanne_vapeurBP.y)
-    annotation (Line(points={{640,65},{640,81},{653.4,81}}));
-  connect(EconomiseurHP1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
-          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
-  connect(VolumeECO_HP1_2.Cs, EconomiseurHP2.Cws1) annotation (Line(points={{
-          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
-  connect(EconomiseurHP2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
-          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
-  connect(VolumeECO_HP2_3.Cs, EconomiseurHP3.Cws1) annotation (Line(points={{
-          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
-  connect(Vanne_alimentationMPHP1.C1, PompeAlimHP.C2)
-    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-50},{824,-50}}));
-  connect(PompeAlimMP.C2, Vanne_alimentationMPHP2.C1) annotation (Line(points={
-          {824,-10},{870,-10},{870,-142.8},{804,-142.8}}, color={0,0,255}));
-  connect(arretPomesMp1.y, Vanne_alimentationMPHP1.Ouv)
-    annotation (Line(points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,
-          -123.2}}));
-  connect(arretPomesHP1.y, Vanne_alimentationMPHP2.Ouv)
-    annotation (Line(points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,
-          -163.2}}));
-  connect(Vanne_alimentationMPHP1.C2, EconomiseurHP1.Cws1) annotation (Line(
-        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
-          -6},{526,-30}}, color={0,0,255}));
-  connect(EconomiseurMP.Cws1, Vanne_alimentationMPHP2.C2)
-    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
-  connect(ConstantVanneTurbineMP.y, vanne_entree_TurbineMP.Ouv)
-    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
-  connect(vanne_entree_TurbineHP.C2, VolumePreTHP.Ce) annotation (Line(points={
-          {-104,-230},{-62,-230}}, color={255,0,0}));
-  connect(DoubleDebitMP.Cs, vanne_entree_TurbineMP.C1) annotation (Line(points=
-          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
-  connect(vanne_entree_TurbineMP.C2, MelangeurPreTMP.Ce1) annotation (Line(
-        points={{-104,-314},{-60,-314}}, color={255,0,0}));
-  connect(SourceCaloporteur.C, Condenseur.Cee) annotation (Line(points={{620,-353},
-          {638,-353},{638,-352.8},{637,-352.8}},     color={0,0,255}));
-  connect(Condenseur.Cse, PuitsCaloporteur.C) annotation (Line(points={{717,-352},
-          {736,-352}},       color={0,0,255}));
-  connect(CapteurDebitVapCondenseur.C2, Condenseur.Cv) annotation (Line(points={{679.3,
-          -274.2},{679.3,-288.1},{677,-288.1},{677,-304}},         color={0,0,
-          255}));
-  connect(CapteurDebitEauCondenseur.C1, Condenseur.Cl)
-    annotation (Line(points={{680.3,-402},{677.8,-402},{677.8,-384}}));
-  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
-    annotation (Line(points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}}));
-  connect(Condenseur.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
-    annotation (Line(points={{721,-372.8},{780,-372.8},{780,-326},{732,-326},{732,
-          -263},{757.5,-263}}));
-  connect(BallonBP.Cs, CapteurDebitEauBPsortie.C1) annotation (Line(points={{
-          578,22},{564,22},{564,16},{642,16},{642,-9.8},{687,-9.8}}, color={0,0,
-          255}));
-  connect(BallonBP.Ce1, vanne_alimentationBP.C2)
-    annotation (Line(points={{618,50},{624,50},{624,48},{630,48}}));
-  connect(BallonMP.Ce1, vanne_alimentationMP.C2)
-    annotation (Line(points={{358,50},{378,50}}));
-  connect(BallonHP.Ce1, vanne_alimentationHP.C2)
-    annotation (Line(points={{38,50},{58,50}}));
-  connect(TurbineHP.Cs, MoitieDebitHP.Ce) annotation (Line(points={{38.2,-230},
-          {74,-230},{74,-170},{114,-170}}, color={255,0,0}));
-  connect(VolumePreTHP.Cs3, TurbineHP.Ce) annotation (Line(points={{-42,-230},{
-          -2.2,-230}}, color={255,0,0}));
-  connect(MelangeurPreTMP.Cs, TurbineMP.Ce) annotation (Line(points={{-40,-314},
-          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
-  connect(TurbineMP.Cs, MelangeurPostTMP1.Ce1) annotation (Line(points={{358.2,
-          -230},{408,-230}}, color={255,0,0}));
-  connect(MelangeurPostTMP1.Cs, TurbineBP.Ce) annotation (Line(points={{428,
-          -230},{575.8,-230}}, color={255,0,0}));
-  connect(TurbineBP.Cs, perteChargeK1.C1) annotation (Line(points={{616.2,-230},
-          {640,-230}}, color={255,0,0}));
-  connect(EconomiseurMP.Cws2, CapteurDebitEauMP.C1) annotation (Line(points={{
-          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
-  connect(TurbineMP.MechPower, Alternateur.Wmec2)
-    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
-  connect(TurbineBP.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
-          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
-  connect(TurbineHP.MechPower, Alternateur.Wmec3)
-    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
-  connect(heatSource.C[1], BallonHP.Cex) annotation (Line(points={{18,68.3},{18,
-          50}}, color={191,95,0}));
-  connect(heatSource1.C[1], BallonMP.Cex) annotation (Line(points={{339,68.3},{
-          339,50}}, color={191,95,0}));
-  connect(heatSource2.C[1], BallonBP.Cex) annotation (Line(points={{598,64.3},{
-          598,50}}, color={191,95,0}));
-  connect(Gain_2GasTurbine.y, Alternateur.Wmec5)
-    annotation (Line(points={{3,-438},{402,-438}}));
-  connect(CapteurDebitEauHP.C1, EconomiseurHP4.Cws2)
-    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
-  connect(PompeAlimMP.rpm_or_mpower, arretPomesMp.y)
-    annotation (Line(points={{814,-21},{814,-26},{904.1,-26}}, smooth=Smooth.None));
-  connect(PompeAlimHP.rpm_or_mpower, arretPomesHP.y)
-    annotation (Line(points={{814,-61},{814,-80},{905.1,-80}}, smooth=Smooth.None));
-  connect(PompeAlimBP.rpm_or_mpower, arretPomesBP.y) annotation (Line(points={{
-          752,-447},{754,-447},{754,-460},{878,-460},{878,-442},{905.1,-442}},
-        smooth=Smooth.None));
-  connect(SourceFumees.C,GasTurbine. Entree_air)
-                                                annotation (Line(
-      points={{-495,-51},{-471,-51}},
-      color={0,0,0},
-      thickness=1));
-  connect(sourceCombustible.C,GasTurbine. Entree_combustible) annotation (Line(
-        points={{-385,42},{-367,42},{-367,13}}, color={0,0,0}));
-  connect(sourceEau.C,GasTurbine. Entree_eau_combustion)
-    annotation (Line(points={{-445,42},{-445,13}}, color={0,0,255}));
-  connect(sourceCombustible.IMassFlow,rampeQfuel. y)
-    annotation (Line(points={{-403,51},{-403,74},{-518,74}}));
-  connect(rampeIQair.y,SourceFumees. IMassFlow)
-    annotation (Line(points={{-520,-10},{-520,-36},{-517,-36},{-517,-39.5}}));
-  connect(Humidite.y, GasTurbine.Huminide)
-    annotation (Line(points={{-516.95,33},{-487,33},{-487,-12.6},{-473.6,-12.6}}));
-  connect(GasTurbine.Sortie_fumees, SurchauffeurHP3.Cfg1) annotation (Line(
-      points={{-341,-51},{-290,-50},{-304,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(GasTurbine.PuissanceMeca, Gain_2GasTurbine.u)
-    annotation (Line(points={{-338.4,-76.6},{-326,-76.6},{-326,-438},{-19,-438}}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-550,
-            -460},{950,150}},
-        initialScale=0.1)),
-    experiment(StopTime=2500, Tolerance=0.001),
-    experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </h4>
-</html>"));
-end CombinedCycle_Load_100_50;
+within ThermoSysPro.Fluid.Examples.CombinedCyclePowerPlant;
+model CombinedCycle_Load_100_50 "CCPP model to simulate a load variation from 100% to 50%"
+  parameter Real CstHP(fixed=false,start=8316103.829776841)
+    "Stodola's ellipse coefficient HP";
+  parameter Real CstMP(fixed=false,start=254110.8564593821)
+    "Stodola's ellipse coefficient MP";
+  parameter Real CstBP(fixed=false,start=10713.964292543395)
+    "Stodola's ellipse coefficient BP";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
+    "Maximum CV: alim. valve HP Drum  ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
+    "Maximum CV: steam valve BP Drum ";
+  parameter Real Encras_SHP1(fixed=false,start=1)
+    "Sur HP1: heat exchange fouling coefficient";
+  parameter Real Encras_SHP2(fixed=false,start=1)
+    "Sur HP2: heat exchange fouling coefficient";
+  parameter Real Encras_SHP3(fixed=false,start=1)
+    "Sur HP3: heat exchange fouling coefficient";
+  parameter Real Encras_EHP1(fixed=false,start=1)
+    "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Encras_EHP2(fixed=false,start=1)
+    "Eco HP2: heat exchange fouling coefficient";
+  parameter Real Encras_EHP3(fixed=false,start=1)
+    "Eco HP3: heat exchange fouling coefficient";
+  parameter Real Encras_EHP4(fixed=false,start=1)
+    "Eco HP4: heat exchange fouling coefficient";
+
+  parameter Real Encras_SMP1(fixed=false,start=1)
+    "Sur MP1: heat exchange fouling coefficient";
+  parameter Real Encras_SMP2(fixed=false,start=1)
+    "Sur MP2: heat exchange fouling coefficient";
+  parameter Real Encras_SMP3(fixed=false,start=1)
+    "Sur MP3: heat exchange fouling coefficient";
+  parameter Real Encras_EMP(fixed=false,start=1)
+    "Eco MP: heat exchange fouling coefficient";
+
+  parameter Real Encras_EvHP(fixed=false,start=1)
+    "Evapo HP: heat exchange fouling coefficient";
+  parameter Real Encras_EvMP(fixed=false,start=1)
+    "Evapo MP: heat exchange fouling coefficient";
+  parameter Real Encras_EvBP(fixed=false,start=1)
+    "Evapo BP: heat exchange fouling coefficient";
+
+  parameter Real Encras_SBP(fixed=false,start=1)
+    "Sur BP: heat exchange fouling coefficient";
+  parameter Real Encras_EBP(fixed=false,start=1)
+    "Eco BP: heat exchange fouling coefficient";
+
+  parameter Real KgainChargeHP(fixed=false,start=720.183)
+    "HP: Friction pressure loss coefficient";
+  parameter Real KgainChargeMP(fixed=false,start=1090.9)
+    "MP: Friction pressure loss coefficient";
+  parameter Real Kin_SMP2(fixed=false,start=10.)
+    "SMPin: Friction pressure loss coefficient";
+  parameter Real K_PerteChargeZero2(fixed=false,start=1e-4)
+    "TurbineMP out: Friction pressure loss coefficient";
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
+    "Maximum CV input Turbine HP ";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
+    "Maximum CV input Turbine MP ";
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(
+    L=16.27,
+    Vertical=false,
+    hl(fixed=false, start=1490815.1478051024),
+    hv(fixed=false, start=2666681.973890458),
+    Vv(fixed=false),
+    R=1.05,
+    xmv(fixed=false),
+    P(fixed=false, start=12723768.606734423),
+    zl(start=1.05, fixed=true),
+    Mp=5000,
+    Kpa=5,
+    Kvl=1000,
+    Pfond(start=12730534.85594967),
+    Tp(start=593.1308910047013))
+                     annotation (Placement(transformation(extent={{38,10},{-2,
+            50}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(
+      Cvmax=CvmaxValveAHP,
+    C1(P(start=13463260.282381449),
+                            h_vol_2(start=1398250.7267619045)),
+    h(start=1398000),
+    Cv(start=178),
+    Pm(start=13050700))   annotation (Placement(transformation(extent={{78,46},{58,66}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurHP(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{-18,70},{-28,78}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(
+    Cvmax=47829.4,
+    C2(h_vol_1(start=2664756.9335524077)),
+    h(start=2674000),
+    Cv(start=23914.7),
+    Pm(start=12722334.038901985))   annotation (Placement(transformation(extent={{-22,46},{-42,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(
+    z2=0,
+    Q(start=150, fixed=true),
+    z1=10.83,
+    K=KgainChargeHP,
+    C2(P(start=12755543.553810954)),
+    h(start=1474422.14552527),
+    Pm(start=12704000))
+            annotation (Placement(transformation(
+        origin={28,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(V=5,
+    h(start=1490815.1478051024),
+    P(start=12704000))                         annotation (Placement(transformation(
+          extent={{8,-100},{-12,-80}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EvaporateurHP(
+    Dint=32.8e-3,
+    Ntubes=1476,
+    L=20.7,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
+      Tp(start={607.0686256839474,605.4340763016401,604.369250336098}),
+      Tp1(start={605.8809866549195,604.7482278053628,603.9735475960298})),
+    Ns=3,
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.092,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      K(fixed=true, start=37.69),
+      CSailettes=11.86442072,
+      p_rho=1.05,
+      Encras=Encras_EvHP,
+      deltaT(start={106,49,23}),
+      T2(start={755.54833984375,674.4067359457392,636.0812177546504,
+            618.193603515625}),
+      T1(start={714.9775457406769,655.2439768501948,627.1374112677474}),
+      Tp(start={608.1720536506299,606.0712938344541,604.7368952679157}),
+      h(start={733599.3125,656358.4375,611752.6709052362,586017.25,579857.8125})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=10.83,
+      option_temperature(start=false)=
+                         false,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={5.74e7,2.67e7,1.24e7}),
+      h(start={1490815.125,1802974.8785231041,1983243.6948464876,
+            2087250.43237827,1490815.125}),
+      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
+      P(start={12755544.0,12738060.440301126,12731944.445232479,
+            12727558.331339812,12723769.0}),
+      T0(start={290.0,290.0,290.0})),
+    Cfg1(
+      Xo2(start=0.1115701174007655),
+      h_vol_1(start=733599.3042437045),
+      h_vol_2(start=656358.4284245522)),
+    Cfg2(h_vol_1(start=586017.2197643318), h_vol_2(start=579857.8163754256)))
+                          annotation (Placement(transformation(
+        origin={-14,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurHP4(
+    Ns=3,
+    L=20.726,
+    Dint=0.0266,
+    Ntubes=246,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-3.5e6,-2.63e6,-2e6}),
+      Tp(start={586.8045312098105,592.233932288974,596.2487558411457}),
+      Tp1(start={586.1107280703657,591.70094527162,595.8370299676952})),
+    Cws1(P(start=13392085.206996098),
+       h_vol_2(start=1291418.4097512758)),
+    Cws2(h_vol_1(start=1398250.726761905)),
+    ExchangerFlueGasesMetal(
+      Dext=0.0318,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.39069779,
+      K(fixed=true, start=47.53),
+      p_rho=1.06,
+      Encras=Encras_EHP4,
+      deltaT(start={38,29,22}),
+      T2(start={618.193603515625,613.1248964422501,609.3035158562986,
+            606.41162109375}),
+      T1(start={615.6592506115472,611.2142061492743,607.857569142044}),
+      Tp(start={587.4391153803123,592.7214266588746,596.6253392075643}),
+      h(start={586017.25,579857.8125,575126.0965916426,571470.875,568995.125})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      z2=0,
+      option_temperature(start=false)=
+                         false,
+      inertia=true,
+      dW1(start={3.5e6,2.63e6,2e6}),
+      h(start={1340827.875,1391283.256558695,1430043.6648856928,
+            1459985.6005320582,1490815.125}),
+      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
+      P(start={13392085.0,13410597.999476302,13428564.988335809,
+            13446090.481250245,13463260.0}),
+      T0(start={290.0,290.0,290.0})),
+    Cfg2(h_vol_1(start=571470.9016291047), h_vol_2(start=568995.1352316155)))
+                          annotation (Placement(transformation(
+        origin={86,-50},
+        extent={{20,20},{-20,-20}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurHP1(
+    Ns=3,
+    L=20.4,
+    Dint=0.0324,
+    Ntubes=246,
+    ExchangerWall(e=0.0028, lambda=37.61,
+    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
+      Tp(start={642.2528493064303,660.2252788975977,676.0185839771161}),
+      Tp1(start={640.2457872857126,658.6370135480385,674.7830152370668})),
+    Cws1(h_vol_2(start=2664756.9335524077)),
+    Cws2(P(start=12717986.08142511),
+      h_vol_1(start=2973076.465167672)),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=10.25056,
+      K(fixed=true, start=34.71),
+      p_rho=1.04,
+      Encras=Encras_SHP1,
+      deltaT(start={138,108,84}),
+      T2(start={788.2433471679688,774.636330839027,763.888258455914,
+            755.54833984375}),
+      T1(start={781.4398445109163,769.2622946474705,759.7183069957642}),
+      Tp(start={644.10620941112,661.6919140110865,677.1595321818904}),
+      h(start={771604.625,755814.75,743319.68570567,733599.3125,656358.4375})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      option_temperature(start=false)=
+                         false,
+      inertia=true,
+      dW1(start={9.8e6,7.7e6,5.9e6}),
+      h(start={2666682.0,2796026.041774324,2898380.976036657,2978006.560766205,
+            3093060.25}),
+      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
+      P(start={12720899.0,12720947.316355772,12720381.982283436,
+            12719355.693542536,12717986.0}),
+      T0(start={290.0,290.0,290.0})),
+    Cfg1(h_vol_1(start=771604.5980597589), h_vol_2(start=755814.7776905377)))
+                          annotation (Placement(transformation(
+        origin={-54,-50},
+        extent={{-20,20},{20,-20}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurHP3(
+    Dint=26.6e-3,
+    Ntubes=1476,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+          dW1(start={-1.6e7,-5.6e6,-2.1e6}),
+      Tp(start={561.796823652815,571.4588678419677,575.4628803966649}),
+      Tp1(start={561.3366476058077,571.262479097038,575.3781133321203})),
+    L=20.726,
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=12.451,
+      K(fixed=true, start=36.0300000000857),
+      p_rho=1.08,
+      Encras=Encras_EHP3,
+      St=5, deltaT(start={34,12,4.4}),
+      T2(start={602.6719360351563,579.980900946576,571.7829862725544,
+            568.8102416992188}),
+      T1(start={591.3264094805266,575.8819436095652,570.2965996068247}),
+      Tp(start={562.2177217699727,571.63849399485,575.5404122414816}),
+      h(start={566350.125,541838.1875,531377.2730086804,526862.0625,524994.875})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.6e7,5.6e6,2.1e6}),
+      h(start={1017356.625,1218148.8764511738,1303840.734184985,
+            1340827.8193574403,1391283.25}),
+      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
+      P(start={13311571.0,13333449.940013096,13353656.79078459,
+            13373055.807696301,13392085.0}),
+      T0(start={290.0,290.0,290.0})),
+    Cfg1(h_vol_1(start=566350.1392976114), h_vol_2(start=541838.2014676201)),
+    Cfg2(h_vol_1(start=526862.0336133951), h_vol_2(start=524994.8479453246)))
+                  annotation (Placement(transformation(
+        origin={206,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurHP2(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-5e6,-3e6,-2.e6}),
+      Tp(start={497.4826387258949,505.30719485126787,510.35203444054224}),
+      Tp1(start={497.280376159525,505.1760138457019,510.2668260105936})),
+    L=20.767,
+    Ntubes=1107,
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=111e-3,
+      CSailettes=2.76134577,
+      K(fixed=true, start=65.5300000000393),
+      p_rho=1.11,
+      Encras=Encras_EHP2,
+      St=5, deltaT(start={36,23,14}),
+      T2(start={531.16064453125,523.8360138077611,519.2214124321695,
+            516.3124389648438}),
+      T1(start={527.4983362936189,521.5287131199652,517.7669224567446}),
+      Tp(start={497.66763734525006,505.42717901517375,510.4299699783979}),
+      h(start={480418.125,472321.78125,467070.7664465268,463659.96875,
+            459024.375})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={5e6,3e6,2.e6}),
+      h(start={880080.3125,946402.3420877852,989416.7007043775,
+            1017356.6143159299,1017356.625}),
+      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
+      P(start={13222388.0,13245245.535219172,13267635.410096379,
+            13289708.936642656,13311571.0}),
+      T0(start={290.0,290.0,290.0})),
+    Cfg1(h_vol_1(start=480418.1309072992), h_vol_2(start=472321.79192425753)),
+    Cfg2(h_vol_1(start=463659.97054164804), h_vol_2(start=459024.3888915999)))
+                  annotation (Placement(transformation(
+        origin={406,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurHP1(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-9.9999e6,-5e6,-2.4e6}),
+      Tp(start={463.9321072661506,474.9929739228467,480.7691364010327}),
+      Tp1(start={463.5249231636951,474.78082392813104,480.65874049533926})),
+    L=20.726,
+    Ntubes=1107,
+    Cws1(h_vol_2(start=618649.6677733721)),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=8.30057632,
+      K(fixed=true, start=40.24),
+      p_rho=1.13,
+      Encras=Encras_EHP1,
+      St=5,   deltaT(start={41,20,10}),
+      T2(start={509.31475830078125,493.76452187742854,486.23046610566547,
+            482.5950622558594}),
+      T1(start={501.5396335543568,489.997493991547,484.4127676365523}),
+      Tp(start={464.30453652050693,475.18701603762264,480.87010955935017}),
+      h(start={454937.0,438670.0625,430194.70910967304,425784.40625,
+            406989.71875})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.767,
+      inertia=true,
+      dW1(start={9.9999e6,5e6,2.4e6}),
+      h(start={571589.625,774526.0247459969,843952.8413327619,880080.2817637667,
+            880080.3125}),
+      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
+      advection=true,
+      dynamic_mass_balance=true,
+      P(start={13128535.0,13152879.589094872,13176430.551414272,
+            13199531.42642672,13222388.0}),
+      T0(start={290.0,290.0,290.0})),
+    Cfg1(h_vol_1(start=454936.9990189345), h_vol_2(start=438670.0646527905)),
+    Cfg2(h_vol_1(start=425784.41179849324), h_vol_2(start=406989.7250411841)))
+                  annotation (Placement(transformation(
+        origin={526,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurHP2(
+    Ns=3,
+    L=20.4,
+    Dint=32e-3,
+    Ntubes=246,
+    ExchangerWall(e=3e-3, lambda=27,
+          dW1(start={-8.8e6,-6.6e6,-4.9e6}),
+      Tp(start={718.9678163326367,740.0767692096435,756.604413623004}),
+      Tp1(start={716.2791829167277,738.0462739865401,755.0829558745072})),
+    Cws2(P(start=12709302.607974846),
+      h_vol_1(start=3240813.8516343245)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      K(fixed=true, start=34.74),
+      CSailettes=10.2505424803872,
+      p_rho=1.02,
+      Encras=Encras_SHP2,
+      St=5,
+      deltaT(start={124,93,70}),
+      T2(start={850.646484375,838.5707346201303,829.4749488031354,
+            822.6819458007813}),
+      T1(start={844.6086089059804,834.0228417116329,826.0784372242802}),
+      Tp(start={721.435205827699,741.940177792463,758.000672720138}),
+      h(start={844515.9375,830470.625,819863.3783947699,811915.375,793532.125})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.83,
+      inertia=true,
+      dW1(start={8.8e6,6.6e6,4.9e6}),
+      h(start={2978006.5,3093060.285806892,3179950.539313758,3245057.7348208814,
+            3327367.0}),
+      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
+      P(start={12717986.0,12716434.741873961,12714386.551930543,
+            12711976.726767521,12709303.0}),
+      T0(start={290.0,290.0,290.0})),
+    Cfg1(h_vol_1(start=844515.913281604), h_vol_2(start=830470.6023452462)),
+    Cfg2(h_vol_1(start=811915.3453800348), h_vol_2(start=793532.1532110969)))
+                  annotation (Placement(transformation(
+        origin={-174,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurHP3(
+    Ns=3,
+    L=20.4,
+    Ntubes=246,
+    ExchangerWall(lambda=27, e=5e-3,
+    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
+      Tp(start={790.194354484117,807.7071433884553,821.1209947971915}),
+      Tp1(start={786.6677403770077,805.0457823271269,819.1194288821613})),
+    Dint=28e-3,
+    Cws2(h_vol_1(start=3433271.775819776), h_vol_2(start=3436197.0248581353)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      K(fixed=true, start=49.33),
+      CSailettes=6.59672842597229,
+      p_rho=1,
+      Encras=Encras_SHP3,
+      St=5,
+      deltaT(start={97,73,55}),
+      T2(start={894.2188110351563,885.636025090525,879.1746662824661,
+            874.3292236328125}),
+      T1(start={889.9274067093704,882.4053456864956,876.7519418617093}),
+      Tp(start={793.2224770352475,809.9923175531776,822.8396367298765}),
+      h(start={1667213.25,885985.75,878403.0483138687,872700.1875,859769.0})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.726,
+      inertia=true,
+      dW1(start={6.3e6,4.7e6,3.6e6}),
+      h(start={3245057.75,3327366.927704592,3389481.600384113,
+            3436197.0248581353,3436197.0}),
+      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
+      P(start={12709303.0,12702950.046102656,12696025.294905605,
+            12688672.774977181,12681000.0}),
+      T0(start={290.0,290.0,290.0})),
+    Cfg1(h_vol_2(start=885985.7657894278)),
+    Cfg2(h_vol_1(start=872700.2111216835), h_vol_2(start=859769.0004719263)))
+                  annotation (Placement(transformation(
+        origin={-294,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(
+    L=16.27,
+    Vertical=false,
+    P0=27.29e5,
+    hl(fixed=false, start=982393.5767040529),
+    hv(fixed=false, start=2799922.9214887),
+    Vv(fixed=false),
+    R=1.05,
+    P(fixed=false, start=2735928.760015618),
+    zl(start=1.05, fixed=true),
+    Kpa=5,
+    Mp=5000,
+    Kvl=1000,
+    Pfond(start=2744469.1253284975),
+    Tp(start=497.67337438326825))
+                     annotation (Placement(transformation(extent={{358,10},{320,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurMP(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{304,70},{292,80}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(
+      Cvmax=CvmaxValveAMP,
+    C1(P(start=3167631.503685111),
+    h_vol_2(start=944504.749093579)),
+    h(start=944000),
+    Cv(start=28),
+    Pm(start=2975000))   annotation (Placement(transformation(extent={{398,46},{378,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(
+    Cvmax=47829.4,
+    C2(h_vol_1(start=2798574.7604119307)),
+    h(fixed=false, start=2798000),
+    Cv(start=23914.7),
+    Pm(fixed=false, start=2734363.102702573))    annotation (Placement(transformation(extent={{298,46},{278,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EvaporateurMP(
+    Dint=32.8e-3,
+    L=20.767,
+    Ntubes=738,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
+      Tp(start={505.16819175410103,504.47653316985316,503.9096834697299}),
+      Tp1(start={504.6351775530387,504.05161319744064,503.5710085659467})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.83,
+      continuous_flow_reversal=true,
+      inertia=true,
+          dW1(start={9.7e7,7.6e6,5.8e6}),
+      P(start={2774374.0,2752246.9598328522,2744979.3658251367,
+            2740042.865359723,2735928.75}),
+      h(start={982393.5625,1052669.185607329,1108693.0397347796,
+            1153345.8558491606,982393.5625}),
+      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464}),
+      T0(start={290.0,290.0,290.0})),
+    Cws1(P(start=2774374.0890979404)),
+    ExchangerFlueGasesMetal(
+      K(fixed=true, start=30.22),
+      Dext=38e-3,
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=10.0676093,
+      p_rho=1.1,
+      Encras=Encras_EvMP,
+      St=5,
+      deltaT(start={53,41,32}),
+      T2(start={565.2481689453125,550.9126306026692,539.787269523939,
+            531.16064453125}),
+      T1(start={558.0803978580261,545.349950063304,535.4739641517078}),
+      Tp(start={505.6634119015416,504.8713236488558,504.224344196615}),
+      h(start={522718.59375,505329.59375,491467.03403307416,480418.125,
+            472321.78125})),
+    Cfg1(h_vol_1(start=522718.6023168775), h_vol_2(start=505329.58942935336)))
+                          annotation (Placement(transformation(
+        origin={306,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(
+    z2=0,
+    z1=10.83,
+    Q(start=150, fixed=true),
+    K=KgainChargeMP,
+    Pm(start=2734000),
+    h(start=978914.570821827))
+            annotation (Placement(transformation(
+        origin={348,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(V=5,
+    h(start=982393.5767040529),
+    P(start=2734000))                         annotation (Placement(transformation(
+          extent={{328,-100},{308,-80}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurMP(
+    ExchangerWall(e=2.6e-3, lambda=47,
+        dW1(start={-3e6,-1.4e6,-740379}),
+      Tp(start={472.3628584074194,491.3438906316966,502.0012847992062}),
+      Tp1(start={471.840700513395,491.0496555837365,501.83511098176496})),
+    L=20.726,
+    Ns=3,
+    Dint=26.6e-3,
+    Ntubes=246,
+    Cws1(h_vol_2(start=565106.2802015315), P(start=3075398.079286396)),
+    Cws2(h_vol_1(start=944504.7490935794)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      K(fixed=true, start=47.78),
+      CSailettes=7.16188651,
+      p_rho=1.12,
+      Encras=Encras_EMP,
+      St=5,
+      deltaT(start={45,24,13}),
+      T2(start={516.3124389648438,512.4675048876576,510.41305969109146,
+            509.31475830078125}),
+      T1(start={514.3899686844887,511.4402822893745,509.8639024611882}),
+      Tp(start={472.8404479644676,491.6130115007493,502.15327499369164}),
+      h(start={463659.96875,459024.375,456412.24684658495,454937.0,438670.0625})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.767,
+      z2=0,
+      inertia=true,
+      dW1(start={3e6,1.4e6,740379}),
+      h(start={571589.625,787918.9315405625,901666.2028313989,965906.7425802368,
+            982393.5625}),
+      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
+      P(start={3075398.0,3099880.3604684034,3123147.6507597235,
+            3145628.859295243,3167631.5}),
+      T0(start={290.0,290.0,290.0})))
+                          annotation (Placement(transformation(
+        origin={466,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurMP1(
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.3e6,-0.80263e6,
+                                -501864}),
+      Tp(start={562.8136365409941,580.9270260501409,592.9171328387902}),
+      Tp1(start={562.3574073875994,580.630547779683,592.7261966839885})),
+    L=20.726,
+    Ns=3,
+    Dint=32.8e-3,
+    Ntubes=123,
+    Cws1(h_vol_2(start=2798574.7604119307)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      K(fixed=true, start=22.09),
+      CSailettes=14.46509765,
+      p_rho=1.07,
+      Encras=Encras_SMP1,
+      St=5,
+      deltaT(start={45,30,19}),
+      T2(start={606.41162109375,604.5654891969185,603.4004814494892,
+            602.6719360351563}),
+      T1(start={605.488555812354,603.9829853232038,603.0361997319833}),
+      Tp(start={563.2375161835078,581.202482150127,593.0945304216444}),
+      h(start={571470.875,568995.125,567386.2706202245,566350.125,541838.1875})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.77,
+      inertia=true,
+      dW1(start={1.3e6,0.80263e6,501864}),
+      h(start={2799923.0,2907731.6344967457,2977790.5961721865,
+            3022909.547827688,3044385.0}),
+      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
+      P(start={2732797.5,2731565.0172964707,2730091.858748362,
+            2728450.5104684294,2726700.0}),
+      T0(start={290.0,290.0,290.0})))
+                          annotation (Placement(transformation(
+        origin={146,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(
+    Ce1(h(start=3046256.0341363903), h_vol_1(start=3048424.856388378)),
+    h(start=3044384.9881097865),
+    P(start=2726000))
+    annotation (Placement(transformation(
+        origin={148,-110},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurMP2(
+    Ns=3,
+    L=20.4,
+    Dint=39.3e-3,
+    Ntubes=369,
+    ExchangerWall(e=2.6e-3, lambda=36.86,
+    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
+      Tp(start={688.4468686536222,714.033199611363,732.1920347309398}),
+      Tp1(start={687.218391177629,713.1710194015468,731.5888814252561})),
+    Cws1(P(start=2575212.183613983),
+      h_vol_2(start=3040562.6721177064)),
+    Cws2(P(start=2558092.5174766793),
+      h_vol_1(start=3321940.994604838)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=92e-3,
+      K(fixed=true, start=45.22),
+      CSailettes=5.814209831,
+      p_rho=1.03,
+      Encras=Encras_SMP2,
+      St=5,
+      deltaT(start={125,86,60}),
+      T2(start={822.6819458007813,806.8523532375756,795.852828640494,
+            788.2433471679688}),
+      T1(start={814.7671394415003,801.3525909390348,792.0480934116497}),
+      Tp(start={689.6013638823948,714.8434569893178,732.7588645078285}),
+      h(start={811915.375,793532.125,780630.3094320802,771604.625,755814.75})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dW1(start={1.15e7,7.9e6,5.5e6}),
+      h(start={3044385.0,3171130.1833912637,3260083.5432993243,
+            3322312.4282463193,3411468.25}),
+      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
+      P(start={2575212.25,2571568.1301815873,2567405.441864329,
+            2562877.7123048743,2558092.5}),
+      T0(start={290.0,290.0,290.0})))
+                          annotation (Placement(transformation(
+        origin={-114,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurMP3(
+    Ns=3,
+    L=20.4,
+    Ntubes=369,
+    Dint=45.6e-3,
+    ExchangerWall(e=2.6e-3, lambda=27,
+    dW1(start={-8e6,-5.5e6,-3.8e6}),
+      Tp(start={784.9199768014527,801.9559375893245,813.881408346332}),
+      Tp1(start={783.8988186940742,801.245223096765,813.3876096599773})),
+    Cws2(h_vol_1(start=3517975.7051807973), h_vol_2(start=3516632.5605054162)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=92e-3,
+      Dext=50.8e-3,
+      K(fixed=true, start=43.23),
+      CSailettes=5.695842178,
+      p_rho=1.01,
+      Encras=Encras_SMP3,
+      St=5,
+      deltaT(start={82,56,38}),
+      T2(start={874.3292236328125,863.3655435931397,855.822658205448,
+            850.646484375}),
+      T1(start={868.8473805170461,859.5941008992938,853.2345706986391}),
+      Tp(start={785.8874729590412,802.6293039717932,814.3492578675946}),
+      h(start={872700.1875,859769.0,850769.0241228014,844515.9375,830470.625})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dW1(start={8e6,5.5e6,3.8e6}),
+      h(start={3322312.5,3411468.261681972,3473519.713324085,3516632.5605054167,
+            3516632.5}),
+      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
+      P(start={2558092.5,2555937.2008945565,2553603.1383043886,
+            2551144.9258610248,2548600.0}),
+      T0(start={290.0,290.0,290.0})))
+                          annotation (Placement(transformation(
+        origin={-234,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(
+    Vertical=false,
+    P0=5e5,
+    Vv(fixed=false),
+    L=8,
+    hl(fixed=false, start=571589.6558240334),
+    hv(fixed=false, start=2689372.23552223),
+    R=2,
+    P(fixed=false, start=555006.6148534557),
+    zl(start=1.75, fixed=true),
+    Kpa=5,
+    Mp=5000,
+    Kvl=1000,
+    Pfond(start=570965.3592810449),
+    Tp(start=411.19945476835005))
+                     annotation (Placement(transformation(extent={{618,10},{578,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurBP(                                                              k=0.5)
+    annotation (Placement(transformation(extent={{666,76},{654,86}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(
+    p_rho=3, Cvmax=CvmaxValveVBP,
+    C2(P(start=510158.3929231321),
+    h_vol_1(start=2684673.580149807)),
+    h(start=2685000),
+    Cv(start=1),
+    Pm(start=498000))   annotation (Placement(transformation(extent={{558,46},{538,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(
+    Cvmax=285,
+    C1(h_vol_2(start=509236.1596958067)),
+    h(fixed=false, start=509000),
+    Cv(start=142.5),
+    Pm(fixed=false, start=1021309.6581195585))  annotation (Placement(transformation(extent={{650,44},{630,64}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(
+    z2=0,
+    z1=10.767,
+    Q(start=50, fixed=false),
+    K=32766,
+    rho(start=929.9117790585748),
+    Pm(start=564000),
+    h(start=549249.519022482))
+            annotation (Placement(transformation(
+        origin={610,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(h(start=571589.6558240334),
+    V=5,
+    P(start=564000))                         annotation (Placement(transformation(
+          extent={{592,-100},{572,-80}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EvaporateurBP(
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
+      Tp(start={432.59535605574797,431.6255977090002,430.8591280369125}),
+      Tp1(start={432.16242526836834,431.3108320909342,430.62996395048594})),
+    L=20.726,
+    Ntubes=984,
+    Ns=3,
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=138e-3,
+      K(fixed=true, start=30.62),
+      CSailettes=11.07985,
+      p_rho=1.14,
+      Encras=Encras_EvBP,
+      St=5,
+      deltaT(start={45,31,21}),
+      T2(start={482.5950622558594,464.01748118772224,451.30051770870455,
+            442.58880615234375}),
+      T1(start={473.3062751775807,457.6589994482134,446.94466391603106}),
+      Tp(start={432.9975893355074,431.918044468841,431.07204294951407}),
+      h(start={425784.40625,406989.71875,393324.9053433096,383376.28125,
+            345485.03125})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={1.24e7,8.5e6,5.8e6}),
+      h(start={571589.625,800925.2190091099,967665.3813576263,
+            1089060.0143937408,571589.625}),
+      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
+      Q(start={49.68034838099436,49.68034838099436,49.68034838099436,
+            49.68034838099436}),
+      P(start={582186.75,557630.6861652867,556428.158876046,555687.7128874982,
+            555006.625}),
+      T0(start={290.0,290.0,290.0})),
+    Cfg2(h_vol_1(start=383376.2777938952), h_vol_2(start=345485.01719053386)))
+                          annotation (Placement(transformation(
+        origin={566,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_ballonBP(k=1)
+    annotation (Placement(transformation(extent={{742,6},{728,18}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(
+    Cvmax=308.931,
+    C1(h_vol_2(start=550072.7232069891)),
+    h(start=550000),
+    Cv(start=308.931),
+    Pm(start=473826.9860082782))
+                 annotation (Placement(transformation(extent={{710,-14},{730,6}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurBP(
+    Ns=3,
+    L=20.726,
+    Dint=39.3e-3,
+    Ntubes=123,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.1e6,-782901,-559798}),
+      Tp(start={483.5879234710947,510.03490701889103,529.1506909427684}),
+      Tp1(start={483.29897049125907,509.8288453180465,529.0044963209424})),
+    Cws1(h_vol_2(start=2684673.580149807)),
+    Cws2(h_vol_1(start=2914519.282601244), h_vol_2(start=2935965.8606590154)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=222.1e-3,
+      K(fixed=true, start=30.46),
+      CSailettes=3.25763059984175,
+      p_rho=1.09,
+      Encras=Encras_SBP,
+      St=5,
+      deltaT(start={92,66,47}),
+      T2(start={568.8102416992188,567.2151210721856,566.0683353396659,
+            565.2481689453125}),
+      T1(start={568.0126670066404,566.6417282059258,565.6582502265244}),
+      Tp(start={483.8594749183778,510.2285591249387,529.2880813277524}),
+      h(start={526862.0625,524994.875,523663.2975499146,522718.59375,
+            505329.59375})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      rugosrel=1e-5,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.1e6,782901,559798}),
+      h(start={2689372.25,2800496.5790294725,2879742.9368326054,
+            2935965.8606590154,2935965.75}),
+      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
+      P(start={510158.40625,508396.8288525169,506425.5320020969,
+            504223.40958995325,501850.0}),
+      T0(start={290.0,290.0,290.0})))
+                          annotation (Placement(transformation(
+        origin={266,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5, C(h_vol_1
+        (start=329093.3007791504)))
+    annotation (Placement(transformation(
+        origin={722,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurBP(
+    Ns=3,
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
+      Tp(start={396.2481159869425,399.78388129181906,401.13111161783405}),
+      Tp1(start={395.99874013762894,399.70202906319594,401.105084136553})),
+    Ntubes=3444,
+    L=20.726,
+    Cws1(h_vol_2(start=194584.50261459063)),
+    Cws2(h_vol_1(start=509236.15969580685)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=92e-3,
+      K(fixed=true, start=31.53),
+      CSailettes=11.673758598919,
+      p_rho=1.15,
+      Encras=Encras_EBP,
+      St=5,
+      deltaT(start={23.5,5.3,1.1}),
+      T2(start={442.58880615234375,405.54898708865323,397.2418326138536,
+            395.4642028808594}),
+      T1(start={424.0688986060054,401.3954098512534,396.353024695102}),
+      Tp(start={396.4798095231228,399.8599296836186,401.15529358730896}),
+      h(start={383376.28125,345485.03125,333048.03047244134,329093.3125,
+            206282.203125})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      inertia=true,
+      dW1(start={2.45e7,5.5e6,1.17e6}),
+      h(start={194692.265625,428815.5293291671,505661.4245378703,
+            530096.9852149182,571589.625}),
+      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
+      P(start={1588738.375,1562590.7775307859,1537310.419233922,
+            1512399.026918416,1487612.75}),
+      T0(start={290.0,290.0,290.0})))
+                          annotation (Placement(transformation(
+        origin={680,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.88057),
+    Qmax=140,
+    eta_is_nom=0.88057,
+    eta_is_min=0.75,
+    Cst(start=8182844.56002535)=
+        CstHP,
+    pros(d(start=10.64336641432295)),
+    Hrs(start=3048424.856388379),
+    Pe(fixed=true, start=12431000),
+    Ps(fixed=false, start=2726700))
+              annotation (Placement(transformation(extent={{-2,-250},{38,-210}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9625),
+    Qmax=150,
+    eta_is_nom=0.9625,
+    eta_is_min=0.75,
+    Cst(start=256335.364995961)=
+        CstMP,
+    pros(d(start=1.884386603984167)),
+    Hrs(start=3028846.077881056),
+    Pe(fixed=true, start=2548500),
+    Ps(fixed=false, start=476800))
+                annotation (Placement(transformation(extent={{318,-250},{358,
+            -210}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(
+    h(start=3019203.192090637),
+    P(start=476799.99999954),
+    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
+        origin={418,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9538),
+    Qmax=150,
+    eta_is_nom=0.9538,
+    eta_is_min=0.75,
+    Cst(start=11944.9445735985)=
+        CstBP,
+    Cs(h(start=2401954.6559323)),
+    Hrs(start=2401030),
+    Pe(fixed=true, start=476799.99999954),
+    Ps(start=10053))
+                annotation (Placement(transformation(extent={{576,-250},{616,
+            -210}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-292,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(
+                                                    alpha=2)
+    annotation (Placement(transformation(
+        origin={-232,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(
+                                                    alpha=0.5,
+    Ce(h(start=3046260)),
+    P(start=2726700))
+    annotation (Placement(transformation(extent={{114,-180},{134,-160}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(
+    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    Vf0=0.15,
+    steady_state=false,
+    yNiveau(signal(start=1.5)),
+    Cse(h(start=128076)),
+    P(fixed=false, start=6136),
+    Pfond(start=10000.0),
+    Cl(h(start=191812.29519356362),
+      Q(start=196.22097932320875),
+      h_vol_2(start=194692.2720118419)),
+    proe(d(start=996.0237398943773)))
+    annotation (Placement(transformation(extent={{637,-384},{717,-304}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(
+    h0=113.38e3, Q0=29804.5)     annotation (Placement(transformation(extent={{
+            572,-377},{620,-329}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{736,-374},{780,-330}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(    K=1e-4,
+    h(start=2400000),
+    C1(h_vol_2(start=2400000), h(start=2400000)),
+    Pm(start=10026.029972250988))
+    annotation (Placement(transformation(extent={{640,-240},{660,-220}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(
+    Ce3(h(start=194584.50261452305)),
+    h(start=194692.2720118418),
+    P(start=1540500))
+    annotation (Placement(transformation(
+        origin={902,-318},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(K=1e-4,
+    rho(start=990.3728941875843),
+    Pm(start=1540000))
+    annotation (Placement(transformation(
+        origin={902,-270},
+        extent={{12,-12},{-12,12}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(
+    h(start=571589.6558240333),
+    P(start=322430))                         annotation (Placement(transformation(
+          extent={{742,-20},{762,0}}, rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(
+    a3=350,
+    b1(fixed=true) = -3.7751,
+    a1=-244551,
+    Q(fixed=false),
+    C1(h_vol_2(start=550072.7232069891)),
+    C2(h_vol_1(start=565106.2802015315)),
+    Qv(start=0.014981930996429617),
+    rho(start=929.199477777818),
+    Pm(start=1725850))
+            annotation (Placement(transformation(extent={{804,-20},{824,0}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(
+    a3=1600,
+    a1=-28056.2,
+    b1=-12.7952660447433,
+    Q(fixed=false),
+    C1(h_vol_2(start=550072.7232069891)),
+    C2(h_vol_1(start=618649.6677733721)),
+    Qv(start=0.079840086308535),
+    rho(start=926.8951785877663),
+    Pm(start=6851620.819939703))
+             annotation (Placement(transformation(extent={{804,-60},{824,-40}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(alpha=0.5,
+    h(start=194585),
+    P(start=1540500),
+    Cs(h(start=194585)))
+    annotation (Placement(transformation(extent={{872,-328},{886,-308}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(alpha=2)
+    annotation (Placement(transformation(
+        origin={268,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(
+    z2=0,
+    z1=0,
+    K=K_PerteChargeZero2,
+    h(start=3000000),
+    C1(
+      h_vol_2(start=3000000),
+      h(start=3000000),
+      P(fixed=true, start=501850)),
+    Pm(start=490000))
+            annotation (Placement(transformation(
+        origin={344,-278},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(K=1e-4,
+    Pm(start=392647.35686859826))
+    annotation (Placement(transformation(
+        origin={780,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(K=1e-4,
+    Pm(start=392647.3571526791))
+    annotation (Placement(transformation(
+        origin={780,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur
+    annotation (Placement(transformation(extent={{402,-448},{522,-348}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(K=1e-4,
+    C1(h_vol_2(start=191812.29519356362)),
+    C2(h_vol_1(start=191812.29519356362)),
+    rho(start=989.7481065917054),
+    Pm(start=6200))
+    annotation (Placement(transformation(extent={{702,-446},{722,-426}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(
+    Qv(start=0.19818087844720814),
+    a3=400,
+    a1(fixed=true) = -6000,
+    Q(start=194.502, fixed=false),
+    C2(h_vol_1(start=194584.50261452305)),
+    Pm(start=807872.6942171099))
+            annotation (Placement(transformation(extent={{742,-446},{762,-426}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(
+    K=1e-4,
+    rho(start=990.3728941888568),
+    C1(h_vol_2(start=194584.50261452305),
+                            h(start=194585)),
+    Pm(start=1546000))
+    annotation (Placement(transformation(extent={{840,-446},{860,-426}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(Cvmax=
+        2000,
+    h(start=194500),
+    Cv(start=2000),
+    Pm(start=1597241.885640957))
+                 annotation (Placement(transformation(extent={{802,-440},{822,
+            -420}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol_2(start=2674000),
+        h(start=2674000)))
+    annotation (Placement(transformation(
+        origin={-58,8},
+        extent={{-6,6},{6,-6}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol_1(start=1398000),
+        h(start=1398000))) " "
+    annotation (Placement(transformation(
+        origin={91.5,32},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol_1(start=944000),
+        h(start=944000)))
+    annotation (Placement(transformation(extent={{424,49},{409,63}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol_2(start=2798000),
+        h(start=2798000)))
+    annotation (Placement(transformation(
+        origin={236,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol_1(start=2685000),
+        h(start=2685000)))
+    annotation (Placement(transformation(
+        origin={514,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol_1(start=550000),
+        h(start=550000)))
+    annotation (Placement(transformation(
+        origin={663.5,34},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol_1(
+          start=550000), h(start=550000)))
+    annotation (Placement(transformation(extent={{687,-11},{700,1}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol_1(
+          start=194585), h(start=194585)))
+    annotation (Placement(transformation(
+        origin={685.5,-412},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol_1(
+          start=2401000), h(start=2401000)))
+    annotation (Placement(transformation(
+        origin={684.5,-264},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(
+                                                          K=Kin_SMP2,
+    Pm(start=2651000),
+    C1(
+      P(fixed=true, start=2726700),
+      h_vol_2(start=3046000),
+      h(start=3046000)))
+    annotation (Placement(transformation(extent={{114,-120},{94,-100}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(
+    C1(P(fixed=true, start=12680999.9999969)),
+    Cvmax=Cvmax_THP,
+    h(fixed=false, start=3433000),
+    Cv(start=10875),
+    Pm(fixed=false, start=12550000))   annotation (Placement(transformation(extent={{-124,-234},{-104,
+            -214}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauHP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{-158,113},{-124,131}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl
+    regulation_Niveau_HP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500)
+    annotation (Placement(transformation(extent={{-40,106},{-20,126}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauMP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{173,113},{207,131}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl
+    regulation_Niveau_MP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500)
+    annotation (Placement(transformation(extent={{262,106},{282,126}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauBP(                                                              k=1.75)
+    annotation (Placement(transformation(extent={{470,126},{504,144}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
+    add(k1=-1, k2=+1),
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    Ti=10) annotation (Placement(transformation(extent={{568,108},{588,128}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauCondenseur1(                                 k=1.5)
+    annotation (Placement(transformation(extent={{716,-246},{740,-230}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+                                                add(k1=+1, k2=-1),
+    edge(uL(signal(start=true))))
+                                 annotation (Placement(transformation(extent={{
+            758,-282},{778,-262}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneTurbineHP(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-216},{
+            -138,-142}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{944,-42},{906,
+            -10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{945,-96},{907,
+            -64}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{945,-458},{907,
+            -426}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(
+    V=1,
+    h0=988332,
+    h(start=880080.2817637667),
+    dynamic_mass_balance=true,
+    P0=7010000,
+    P(start=13222388.265425779))                       annotation (Placement(transformation(
+          extent={{456,-98},{436,-78}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(
+    V=1,
+    h0=983786,
+    h(start=1017356.6143159299),
+    dynamic_mass_balance=true,
+    P0=7000000,
+    P(start=13311571.308698103))                        annotation (Placement(transformation(
+          extent={{252,-20},{232,0}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(
+    Cvmax=308.931,
+    h(start=618600),
+    Cv(start=308.931),
+    Pm(start=13219564.708897255))
+                 annotation (Placement(transformation(extent={{754,-98},{730,
+            -122}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(
+    Cvmax=308.931,
+    h(start=565000),
+    Cv(start=308.931),
+    Pm(start=3078586.376751058))
+                 annotation (Placement(transformation(extent={{804,-138},{780,
+            -162}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(
+    Initialvalue=0.8,
+    Finalvalue=0.01,
+    Duration=1000,
+    Starttime=200000)
+                     annotation (Placement(transformation(extent={{946,-150},{
+            908,-118}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(
+    Initialvalue=0.8,
+    Finalvalue=0.01,
+    Duration=1000,
+    Starttime=200000)
+                     annotation (Placement(transformation(extent={{946,-194},{
+            908,-162}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(
+    h0=3e6,
+    h(start=3436197.0248581353),
+    dynamic_mass_balance=true,
+    P0=12700000,
+    P(start=12700000))                annotation (Placement(transformation(
+        origin={-52,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(
+    h0=3523910,
+    h(start=3516632.5605054167),
+    dynamic_mass_balance=true,
+    P0=2400000,
+    P(start=2400000))                     annotation (Placement(transformation(
+        origin={-50,-314},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(
+    C1(P(fixed=true, start=25.486e5)),
+    Cvmax=Cvmax_TMP,
+    h(fixed=false, start=3518000),
+    Cv(start=3.312e6),
+    Pm(fixed=false, start=2547000))   annotation (Placement(transformation(extent={{-124,-318},{-104,
+            -298}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneTurbineMP(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-208,-300},{
+            -138,-226}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
+    annotation (Placement(transformation(extent={{5,68},{31,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
+    annotation (Placement(transformation(extent={{326,68},{352,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
+    annotation (Placement(transformation(extent={{585,64},{611,94}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Gain Gain_2GasTurbine(Gain=
+       2) annotation (Placement(transformation(extent={{-18,-448},{2,-428}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible(
+    Hum=0,
+    Xo=0,
+    Xn=0,
+    Xs=0,
+    rho=0.838,
+    Q0=13.4368286133,
+    T0=185 + 273.16,
+    Xc=0.755,
+    Xh=0.245,
+    Cp=2255,
+    LHV=46989e3) annotation (Placement(transformation(extent={{-421,24},{-385,60}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceEau(             Q0=0.0)
+          annotation (Placement(transformation(extent={{-473,27},{-445,57}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Humidite(k=0.93)
+    annotation (Placement(transformation(extent={{-539,23},{-518,43}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceFumees(
+    Xso2=0,
+    Xco2=0,
+    Xh2o=0,
+    Xo2=0.20994,
+    Q0=600,
+    T0=29.4 + 273.16,
+    P0=1.013e5,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-539,-74},{-495,-28}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Machines.GasTurbine GasTurbine(
+    comp_tau_n=14.0178,
+    comp_eff_n=0.87004,
+    exp_tau_n=0.06458,
+    exp_eff_n=0.89045,
+    TurbQred=0.0175634,
+    Kcham=2.02088,
+    chambreCombustionTAC(Pea(fixed=false, start=14.0e5),
+      Psf(start=1334276.752202393),
+      Tsf(start=1494.4009297392777),
+      Hrfg(start=188188.8402613545),
+      Tea(start=681.5380510358129)),
+    Wpth=1e6,
+    Compresseur(
+      is_eff(fixed=false, start=0.88),
+      Xtau(fixed=false, start=1.00),
+      Ps(start=1420538.874033405),
+      Ts(start=681.538051035813),
+      Tis(start=634.0826153738103),
+      Te(start=304.3515709150396)),
+    TurbineAgaz(
+      Ps(fixed=false),
+      is_eff(fixed=false, start=0.87),
+      Pe(fixed=false, start=1333900),
+      Te(start=1493.59),
+      Ts(fixed=false, start=893.16),
+      Tis(start=815.7265261633758)),
+    xAIR(rho_air(start=1.0865538789495581),
+      ppvap0(start=4235.17632590997),
+      rho_vap(start=0.030206053717024672)))
+    annotation (Placement(transformation(extent={{-471,-115},{-341,13}},
+          rotation=0)));
+
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeQfuel(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=13.507,
+    Finalvalue=8.756)
+                     annotation (Placement(transformation(extent={{-539,64},{
+            -519,84}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampeIQair(
+    Starttime=200,
+    Duration=800,
+    Finalvalue=415.70,
+    Initialvalue=592.7)
+                   annotation (Placement(transformation(extent={{-541,-20},{
+            -521,0}}, rotation=0)));
+equation
+  connect(SurchauffeurHP3.Cws1, SurchauffeurHP2.Cws2)
+    annotation (Line(points={{-294,-30},{-294,-10},{-174,-10},{-174,-30}},
+        color={255,0,0}));
+  connect(SurchauffeurHP2.Cws1, SurchauffeurHP1.Cws2)
+    annotation (Line(points={{-174,-70},{-174,-90},{-54,-90},{-54,-70}}, color=
+          {255,0,0}));
+  connect(constante_vanne_vapeurHP.y, vanne_vapeurHP.Ouv)
+    annotation (Line(points={{-28.5,74},{-32,74},{-32,67}}));
+  connect(vanne_vapeurHP.C1, BallonHP.Cv)
+    annotation (Line(points={{-22,50},{-2,50}}, color={255,0,0}));
+  connect(GainChargeHP.C1, BallonHP.Cd)
+    annotation (Line(points={{38,-90},{48,-90},{48,10},{38,10}}, color={255,128,
+          0}));
+  connect(BallonHP.Cm, EvaporateurHP.Cws2)
+    annotation (Line(points={{-2,10},{-14,10},{-14,-30}}));
+  connect(VolumeEvapHP.Cs, EvaporateurHP.Cws1)
+    annotation (Line(points={{-12,-90},{-12,-70},{-14,-70}}, color={255,128,0}));
+  connect(VolumeEvapHP.Ce1, GainChargeHP.C2)
+                                      annotation (Line(points={{8,-90},{18,-90}},
+        color={255,128,0}));
+  connect(EconomiseurHP4.Cws1, EconomiseurHP3.Cws2)
+    annotation (Line(points={{86,-70},{86,-82},{206,-82},{206,-70}}));
+  connect(BallonMP.Cm, EvaporateurMP.Cws2)
+    annotation (Line(points={{320,10},{306,10},{306,-30}}));
+  connect(EvaporateurMP.Cws1, VolumeEvapMP.Cs)
+    annotation (Line(points={{306,-70},{306,-80},{308,-80},{308,-90}}, color={
+          255,128,0}));
+  connect(VolumeEvapMP.Ce1, GainChargeMP.C2)
+    annotation (Line(points={{328,-90},{338,-90}}, color={255,128,0}));
+  connect(constante_vanne_vapeurMP.y, vanne_vapeurMP.Ouv)
+    annotation (Line(points={{291.4,75},{288,75},{288,67}}));
+  connect(SurchauffeurHP1.Cfg2, EvaporateurHP.Cfg1)        annotation (Line(
+      points={{-44,-50},{-24,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurHP.Cfg2, EconomiseurHP4.Cfg1)        annotation (Line(
+      points={{-4,-50},{76,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP4.Cfg2, SurchauffeurMP1.Cfg1)          annotation (Line(
+      points={{96,-50},{136,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP1.Cfg2, EconomiseurHP3.Cfg1)           annotation (Line(
+      points={{156,-50},{196,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurMP.Cfg2, EconomiseurHP2.Cfg1)           annotation (Line(
+      points={{316,-50},{396,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP2.Cfg2, EconomiseurMP.Cfg1)           annotation (Line(
+      points={{416,-50},{456,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurMP.Cfg2, EconomiseurHP1.Cfg1)           annotation (Line(
+      points={{476,-50},{516,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(GainChargeMP.C1, BallonMP.Cd)
+    annotation (Line(points={{358,-90},{368,-90},{368,10},{358,10}}, color={255,
+          128,0}));
+  connect(SurchauffeurMP2.Cfg2, SurchauffeurHP1.Cfg1)          annotation (Line(
+      points={{-104,-50},{-64,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP2.Cfg1, SurchauffeurHP2.Cfg2)           annotation (Line(
+      points={{-124,-50},{-164,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP3.Cfg2, SurchauffeurHP2.Cfg1)           annotation (Line(
+      points={{-224,-50},{-184,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurHP3.Cfg2, SurchauffeurMP3.Cfg1)           annotation (Line(
+      points={{-284,-50},{-244,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP3.Cws1,SurchauffeurMP2. Cws2)
+    annotation (Line(points={{-234,-30},{-234,10},{-114,10},{-114,-30}}, color=
+          {255,0,0}));
+  connect(SurchauffeurMP1.Cws2, MelangeurHPMP.Ce2) annotation (Line(
+      points={{146,-70},{146,-85},{148,-85},{148,-100}},
+      color={255,0,0},
+      pattern=LinePattern.None));
+  connect(vanne_vapeurBP.C1, BallonBP.Cv)
+    annotation (Line(points={{558,50},{578,50}}, color={255,0,0}));
+  connect(EvaporateurBP.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{566,
+          -70},{566,-90},{572,-90}}, color={255,128,0}));
+  connect(VolumeEvapBP.Ce1, GainChargeBP.C2)
+                                        annotation (Line(points={{592,-90},{600,
+          -90}}, color={255,128,0}));
+  connect(BallonBP.Cd, GainChargeBP.C1)
+                                       annotation (Line(points={{618,10},{628,
+          10},{628,-90},{620,-90}}, color={255,128,0}));
+  connect(EconomiseurBP.Cfg2, PuitsFumees.C)     annotation (Line(
+      points={{690,-50},{712,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP3.Cfg2, SurchauffeurBP.Cfg1)  annotation (Line(
+      points={{216,-50},{256,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurBP.Cfg2, EvaporateurMP.Cfg1)  annotation (Line(
+      points={{276,-50},{296,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP1.Cfg2, EvaporateurBP.Cfg1) annotation (Line(
+      points={{536,-50},{556,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurBP.Cfg2, EconomiseurBP.Cfg1) annotation (Line(
+      points={{576,-50},{670,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(BallonBP.Cm, EvaporateurBP.Cws2)
+    annotation (Line(points={{578,10},{566,10},{566,-30}}));
+  connect(vanne_vapeurMP.C1, BallonMP.Cv)   annotation (Line(points={{298,50},{
+          320,50}}, color={255,0,0}));
+  connect(Vanne_alimentationMPHP.Ouv, constante_ballonBP.y)
+    annotation (Line(points={{720,7},{720,12},{727.3,12}}));
+  connect(SurchauffeurHP3.Cws2, DoubleDebitHP.Ce)
+    annotation (Line(points={{-294,-70},{-294,-80},{-292,-80},{-292,-90}},
+        color={255,0,0}));
+  connect(SurchauffeurMP3.Cws2, DoubleDebitMP.Ce)
+    annotation (Line(points={{-234,-70},{-234,-80},{-232,-80},{-232,-90}},
+        color={255,0,0}));
+  connect(VolumeCond1.Cs, perteChargeKCond1.C1) annotation (Line(points={{902,
+          -308},{902,-282}}, color={0,0,255}));
+  connect(Vanne_alimentationMPHP.C2, VolumeAlimMPHP.Ce1)
+                                               annotation (Line(points={{730,
+          -10},{742,-10}}, color={0,0,255}));
+  connect(SurchauffeurBP.Cws2, DoubleDebitBP.Ce)
+    annotation (Line(points={{266,-70},{266,-80},{268,-80},{268,-90}}, color={
+          255,0,0}));
+  connect(perteChargeK8.C2, PompeAlimMP.C1)
+    annotation (Line(points={{790,-10},{797,-10},{804,-10}},           color={0,
+          0,255}));
+  connect(VolumeAlimMPHP.Cs1, perteChargeK8.C1)
+    annotation (Line(points={{762,-10},{766,-10},{770,-10}},           color={0,
+          0,255}));
+  connect(VolumeAlimMPHP.Cs2, perteChargeK3.C1)
+                                         annotation (Line(points={{752,-20},{
+          752,-50},{770,-50}}, color={0,0,255}));
+  connect(perteChargeK3.C2, PompeAlimHP.C1)
+    annotation (Line(points={{790,-50},{804,-50}}, color={0,0,255}));
+  connect(MelangeurPostTMP1.Ce2, PerteChargeZero2.C2) annotation (Line(points={{418,
+          -240},{418,-278},{354,-278}},      color={255,0,0}));
+  connect(perteChargeK.C2,PompeAlimBP. C1)
+                                         annotation (Line(points={{722,-436},{
+          742,-436}}, color={0,0,255}));
+  connect(vanne_extraction.C2, perteChargeK2.C1) annotation (Line(points={{822,
+          -436},{840,-436}}, color={0,0,255}));
+  connect(vanne_alimentationHP.C1, CapteurDebitEauHP.C2)
+    annotation (Line(points={{78,50},{86.3,50},{86.3,38.12}}));
+  connect(vanne_vapeurHP.C2, CapteurDebitVapHP.C1) annotation (Line(points={{
+          -42,50},{-53.2,50},{-53.2,14}}, color={255,0,0}));
+  connect(CapteurDebitVapHP.C2, SurchauffeurHP1.Cws1) annotation (Line(points={
+          {-53.2,1.88},{-53.2,-3.06},{-54,-3.06},{-54,-30}}, color={255,0,0}));
+  connect(vanne_alimentationMP.C1, CapteurDebitEauMP.C2)
+    annotation (Line(points={{398,50},{403.425,50},{403.425,50.4},{408.85,50.4}}));
+  connect(CapteurDebitVapMP.C1, vanne_vapeurMP.C2) annotation (Line(points={{
+          244,49.6},{260,49.6},{260,50},{278,50}}, color={255,0,0}));
+  connect(CapteurDebitVapMP.C2, SurchauffeurMP1.Cws1) annotation (Line(points={
+          {227.84,49.6},{146,49.6},{146,-30}}, color={255,0,0}));
+  connect(CapteurDebitVapBP.C2, SurchauffeurBP.Cws1) annotation (Line(points={{
+          505.84,49.6},{490,49.6},{490,-2},{266,-2},{266,-30}}, color={255,0,0}));
+  connect(CapteurDebitVapBP.C1, vanne_vapeurBP.C2) annotation (Line(points={{
+          522,49.6},{530,49.6},{530,50},{538,50}}, color={255,0,0}));
+  connect(CapteurDebitEauBP.C2, vanne_alimentationBP.C1) annotation (Line(
+        points={{658.3,40.12},{658.3,48},{650,48}}, color={0,0,255}));
+  connect(CapteurDebitEauBPsortie.C2, Vanne_alimentationMPHP.C1) annotation (Line(
+        points={{700.13,-9.8},{705.065,-9.8},{705.065,-10},{710,-10}}, color={0,
+          0,255}));
+  connect(CapteurDebitEauCondenseur.C2, perteChargeK.C1) annotation (Line(
+        points={{680.3,-422.2},{680.3,-436},{702,-436}}, color={0,0,255}));
+  connect(perteChargeK1.C2, CapteurDebitVapCondenseur.C1) annotation (Line(
+        points={{660,-230},{679.3,-230},{679.3,-254}}, color={255,0,0}));
+  connect(MelangeurHPMP.Ce1, MoitieDebitHP.Cs)
+    annotation (Line(points={{148,-120},{148,-170},{134,-170}}, color={255,0,0}));
+  connect(perteChargeK2.C2, MoitieDebitBP.Ce) annotation (Line(points={{860,
+          -436},{862,-436},{862,-318},{872,-318}}, color={0,0,255}));
+  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{886,-318},
+          {892,-318}}, color={0,0,255}));
+  connect(SurchauffeurMP2.Cws1, lumpedStraightPipeK2.C2)
+    annotation (Line(points={{-114,-70},{-114,-110},{94,-110}}, color={255,0,0}));
+  connect(lumpedStraightPipeK2.C1, MelangeurHPMP.Cs2)
+    annotation (Line(points={{114,-110},{138,-110}},   color={255,0,0}));
+  connect(DoubleDebitHP.Cs, vanne_entree_TurbineHP.C1) annotation (Line(points=
+          {{-292,-110},{-292,-230},{-124,-230}}, color={255,0,0}));
+  connect(DoubleDebitBP.Cs, PerteChargeZero2.C1) annotation (Line(points={{268,
+          -110},{268,-278},{334,-278}}, color={255,0,0}));
+  connect(PompeAlimBP.C2, vanne_extraction.C1) annotation (Line(points={{762,
+          -436},{802,-436}}, color={0,0,255}));
+  connect(BallonHP.yLevel,regulation_Niveau_HP. MesureNiveauEau)
+    annotation (Line(points={{-4,30},{-68,30},{-68,125},{-40.5,125}}));
+  connect(regulation_Niveau_HP.SortieReelle1, vanne_alimentationHP.Ouv)
+    annotation (Line(points={{-19.5,107},{68,107},{68,67}}));
+  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
+    annotation (Line(points={{208.7,122},{234,122},{234,110},{261.5,110}}));
+  connect(BallonMP.yLevel,regulation_Niveau_MP. MesureNiveauEau)
+    annotation (Line(points={{318.1,30},{252,30},{252,125},{261.5,125}}));
+  connect(regulation_Niveau_MP.SortieReelle1, vanne_alimentationMP.Ouv)
+    annotation (Line(points={{282.5,107},{377.25,107},{377.25,67},{388,67}}));
+  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
+    annotation (Line(points={{505.7,135},{529.85,135},{529.85,112},{567.5,112}}));
+  connect(BallonBP.yLevel,regulation_Niveau_BP. MesureNiveauEau)
+    annotation (Line(points={{576,30},{518,30},{518,127},{567.5,127}}));
+  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
+    annotation (Line(points={{741.2,-238},{752,-238},{752,-269},{757.5,-269}}));
+  connect(regulation_Niveau_Condenseur.SortieReelle1, vanne_extraction.Ouv)
+    annotation (Line(points={{778.5,-281},{812,-281},{812,-419}}));
+  connect(CapteurDebitEauBP.C1, EconomiseurBP.Cws2)
+    annotation (Line(points={{658.3,28},{660,28},{660,6},{680,6},{680,-30}}));
+  connect(EconomiseurBP.Cws1, perteChargeKCond1.C2) annotation (Line(points={{
+          680,-70},{680,-186},{902,-186},{902,-258}}));
+  connect(CapteurDebitVapCondenseur.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
+    annotation (Line(points={{691.13,-264},{704,-264},{704,-280.9},{757.6,
+          -280.9}}));
+  connect(regulation_Niveau_Condenseur.MesureDebitEau,
+    CapteurDebitEauCondenseur.Measure) annotation (Line(points={{757.45,-274.95},
+          {750,-274.95},{750,-310},{792,-310},{792,-412},{692.13,-412}}));
+  connect(ConstantVanneTurbineHP.y, vanne_entree_TurbineHP.Ouv)
+    annotation (Line(points={{-134.5,-179},{-114,-179},{-114,-213}}));
+  connect(regulation_Niveau_BP.SortieReelle1, vanne_vapeurBP.Ouv)
+    annotation (Line(points={{588.5,109},{600,109},{600,90},{548,90},{548,67}}));
+  connect(vanne_alimentationBP.Ouv, constante_vanne_vapeurBP.y)
+    annotation (Line(points={{640,65},{640,81},{653.4,81}}));
+  connect(EconomiseurHP1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{
+          526,-70},{526,-88},{456,-88}}, color={0,0,255}));
+  connect(VolumeECO_HP1_2.Cs, EconomiseurHP2.Cws1) annotation (Line(points={{
+          436,-88},{406,-88},{406,-70}}, color={0,0,255}));
+  connect(EconomiseurHP2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{
+          406,-30},{406,-10},{252,-10}}, color={0,0,255}));
+  connect(VolumeECO_HP2_3.Cs, EconomiseurHP3.Cws1) annotation (Line(points={{
+          232,-10},{206,-10},{206,-30}}, color={0,0,255}));
+  connect(Vanne_alimentationMPHP1.C1, PompeAlimHP.C2)
+    annotation (Line(points={{754,-102.8},{842,-102.8},{842,-50},{824,-50}}));
+  connect(PompeAlimMP.C2, Vanne_alimentationMPHP2.C1) annotation (Line(points={
+          {824,-10},{870,-10},{870,-142.8},{804,-142.8}}, color={0,0,255}));
+  connect(arretPomesMp1.y, Vanne_alimentationMPHP1.Ouv)
+    annotation (Line(points={{906.1,-134},{856,-134},{856,-122},{742,-122},{742,
+          -123.2}}));
+  connect(arretPomesHP1.y, Vanne_alimentationMPHP2.Ouv)
+    annotation (Line(points={{906.1,-178},{883.05,-178},{883.05,-163.2},{792,
+          -163.2}}));
+  connect(Vanne_alimentationMPHP1.C2, EconomiseurHP1.Cws1) annotation (Line(
+        points={{730,-102.8},{636,-102.8},{636,-106},{548,-106},{548,-6},{526,
+          -6},{526,-30}}, color={0,0,255}));
+  connect(EconomiseurMP.Cws1, Vanne_alimentationMPHP2.C2)
+    annotation (Line(points={{466,-70},{466,-142.8},{780,-142.8}}));
+  connect(ConstantVanneTurbineMP.y, vanne_entree_TurbineMP.Ouv)
+    annotation (Line(points={{-134.5,-263},{-114,-263},{-114,-297}}));
+  connect(vanne_entree_TurbineHP.C2, VolumePreTHP.Ce) annotation (Line(points={
+          {-104,-230},{-62,-230}}, color={255,0,0}));
+  connect(DoubleDebitMP.Cs, vanne_entree_TurbineMP.C1) annotation (Line(points=
+          {{-232,-110},{-232,-314},{-124,-314}}, color={255,0,0}));
+  connect(vanne_entree_TurbineMP.C2, MelangeurPreTMP.Ce1) annotation (Line(
+        points={{-104,-314},{-60,-314}}, color={255,0,0}));
+  connect(SourceCaloporteur.C, Condenseur.Cee) annotation (Line(points={{620,-353},
+          {638,-353},{638,-352.8},{637,-352.8}},     color={0,0,255}));
+  connect(Condenseur.Cse, PuitsCaloporteur.C) annotation (Line(points={{717,-352},
+          {736,-352}},       color={0,0,255}));
+  connect(CapteurDebitVapCondenseur.C2, Condenseur.Cv) annotation (Line(points={{679.3,
+          -274.2},{679.3,-288.1},{677,-288.1},{677,-304}},         color={0,0,
+          255}));
+  connect(CapteurDebitEauCondenseur.C1, Condenseur.Cl)
+    annotation (Line(points={{680.3,-402},{677.8,-402},{677.8,-384}}));
+  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
+    annotation (Line(points={{-122.3,122},{-100,122},{-100,110},{-40.5,110}}));
+  connect(Condenseur.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
+    annotation (Line(points={{721,-372.8},{780,-372.8},{780,-326},{732,-326},{732,
+          -263},{757.5,-263}}));
+  connect(BallonBP.Cs, CapteurDebitEauBPsortie.C1) annotation (Line(points={{
+          578,22},{564,22},{564,16},{642,16},{642,-9.8},{687,-9.8}}, color={0,0,
+          255}));
+  connect(BallonBP.Ce1, vanne_alimentationBP.C2)
+    annotation (Line(points={{618,50},{624,50},{624,48},{630,48}}));
+  connect(BallonMP.Ce1, vanne_alimentationMP.C2)
+    annotation (Line(points={{358,50},{378,50}}));
+  connect(BallonHP.Ce1, vanne_alimentationHP.C2)
+    annotation (Line(points={{38,50},{58,50}}));
+  connect(TurbineHP.Cs, MoitieDebitHP.Ce) annotation (Line(points={{38.2,-230},
+          {74,-230},{74,-170},{114,-170}}, color={255,0,0}));
+  connect(VolumePreTHP.Cs3, TurbineHP.Ce) annotation (Line(points={{-42,-230},{
+          -2.2,-230}}, color={255,0,0}));
+  connect(MelangeurPreTMP.Cs, TurbineMP.Ce) annotation (Line(points={{-40,-314},
+          {106,-314},{106,-230},{317.8,-230}}, color={255,0,0}));
+  connect(TurbineMP.Cs, MelangeurPostTMP1.Ce1) annotation (Line(points={{358.2,
+          -230},{408,-230}}, color={255,0,0}));
+  connect(MelangeurPostTMP1.Cs, TurbineBP.Ce) annotation (Line(points={{428,
+          -230},{575.8,-230}}, color={255,0,0}));
+  connect(TurbineBP.Cs, perteChargeK1.C1) annotation (Line(points={{616.2,-230},
+          {640,-230}}, color={255,0,0}));
+  connect(EconomiseurMP.Cws2, CapteurDebitEauMP.C1) annotation (Line(points={{
+          466,-30},{470,-30},{470,50.4},{424,50.4}}, color={0,0,255}));
+  connect(TurbineMP.MechPower, Alternateur.Wmec2)
+    annotation (Line(points={{360,-248},{368,-248},{368,-378},{402,-378}}));
+  connect(TurbineBP.MechPower, Alternateur.Wmec1) annotation (Line(points={{618,
+          -248},{628,-248},{628,-290},{388,-290},{388,-358},{402,-358}}));
+  connect(TurbineHP.MechPower, Alternateur.Wmec3)
+    annotation (Line(points={{40,-248},{48,-248},{48,-398},{402,-398}}));
+  connect(heatSource.C[1], BallonHP.Cex) annotation (Line(points={{18,68.3},{18,
+          50}}, color={191,95,0}));
+  connect(heatSource1.C[1], BallonMP.Cex) annotation (Line(points={{339,68.3},{
+          339,50}}, color={191,95,0}));
+  connect(heatSource2.C[1], BallonBP.Cex) annotation (Line(points={{598,64.3},{
+          598,50}}, color={191,95,0}));
+  connect(Gain_2GasTurbine.y, Alternateur.Wmec5)
+    annotation (Line(points={{3,-438},{402,-438}}));
+  connect(CapteurDebitEauHP.C1, EconomiseurHP4.Cws2)
+    annotation (Line(points={{86.3,26},{86,26},{86,-30}}, smooth=Smooth.None));
+  connect(PompeAlimMP.rpm_or_mpower, arretPomesMp.y)
+    annotation (Line(points={{814,-21},{814,-26},{904.1,-26}}, smooth=Smooth.None));
+  connect(PompeAlimHP.rpm_or_mpower, arretPomesHP.y)
+    annotation (Line(points={{814,-61},{814,-80},{905.1,-80}}, smooth=Smooth.None));
+  connect(PompeAlimBP.rpm_or_mpower, arretPomesBP.y) annotation (Line(points={{
+          752,-447},{754,-447},{754,-460},{878,-460},{878,-442},{905.1,-442}},
+        smooth=Smooth.None));
+  connect(SourceFumees.C,GasTurbine. Entree_air)
+                                                annotation (Line(
+      points={{-495,-51},{-471,-51}},
+      color={0,0,0},
+      thickness=1));
+  connect(sourceCombustible.C,GasTurbine. Entree_combustible) annotation (Line(
+        points={{-385,42},{-367,42},{-367,13}}, color={0,0,0}));
+  connect(sourceEau.C,GasTurbine. Entree_eau_combustion)
+    annotation (Line(points={{-445,42},{-445,13}}, color={0,0,255}));
+  connect(sourceCombustible.IMassFlow,rampeQfuel. y)
+    annotation (Line(points={{-403,51},{-403,74},{-518,74}}));
+  connect(rampeIQair.y,SourceFumees. IMassFlow)
+    annotation (Line(points={{-520,-10},{-520,-36},{-517,-36},{-517,-39.5}}));
+  connect(Humidite.y, GasTurbine.Huminide)
+    annotation (Line(points={{-516.95,33},{-487,33},{-487,-12.6},{-473.6,-12.6}}));
+  connect(GasTurbine.Sortie_fumees, SurchauffeurHP3.Cfg1) annotation (Line(
+      points={{-341,-51},{-290,-50},{-304,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(GasTurbine.PuissanceMeca, Gain_2GasTurbine.u)
+    annotation (Line(points={{-338.4,-76.6},{-326,-76.6},{-326,-438},{-19,-438}}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-550,
+            -460},{950,150}},
+        initialScale=0.1)),
+    experiment(StopTime=2500, Tolerance=0.001),
+    experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </h4>
+</html>"));
+end CombinedCycle_Load_100_50;
diff --git a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo
index 71cf77bdc9fda42825cb800ab05027a78325f424..3772241c74add9b197a491f7bf31b8f7109be49c 100644
--- a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo
+++ b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo
@@ -1,1773 +1,1773 @@
-within ThermoSysPro.Fluid.Examples.CombinedCyclePowerPlant;
-model CombinedCycle_TripTAC "CCPP model to simulate a load variation from 100% to 50%"
-  parameter Real CstHP(fixed=false,start=7921079.316566086)
-    "Stodola's ellipse coefficient HP";
-  parameter Real CstMP(fixed=false,start=251309.80339850043)
-    "Stodola's ellipse coefficient MP";
-  parameter Real CstBP(fixed=false,start=10675.291494903773)
-    "Stodola's ellipse coefficient BP";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
-    "Maximum CV: alim. valve HP Drum  ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
-    "Maximum CV: alim. valve MP Drum ";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
-    "Maximum CV: steam valve BP Drum ";
-  parameter Real Encras_SHP1(fixed=false,start=1)
-    "Sur HP1: heat exchange fouling coefficient";
-  parameter Real Encras_SHP2(fixed=false,start=1)
-    "Sur HP2: heat exchange fouling coefficient";
-  parameter Real Encras_SHP3(fixed=false,start=1)
-    "Sur HP3: heat exchange fouling coefficient";
-  parameter Real Encras_EHP1(fixed=false,start=1)
-    "Eco HP1: heat exchange fouling coefficient";
-  parameter Real Encras_EHP2(fixed=false,start=1)
-    "Eco HP2: heat exchange fouling coefficient";
-  parameter Real Encras_EHP3(fixed=false,start=1)
-    "Eco HP3: heat exchange fouling coefficient";
-  parameter Real Encras_EHP4(fixed=false,start=1)
-    "Eco HP4: heat exchange fouling coefficient";
-
-  parameter Real Encras_SMP1(fixed=false,start=1)
-    "Sur MP1: heat exchange fouling coefficient";
-  parameter Real Encras_SMP2(fixed=false,start=1)
-    "Sur MP2: heat exchange fouling coefficient";
-  parameter Real Encras_SMP3(fixed=false,start=1)
-    "Sur MP3: heat exchange fouling coefficient";
-  parameter Real Encras_EMP(fixed=false,start=1)
-    "Eco MP: heat exchange fouling coefficient";
-
-  parameter Real Encras_EvHP(fixed=false,start=1)
-    "Evapo HP: heat exchange fouling coefficient";
-  parameter Real Encras_EvMP(fixed=false,start=1)
-    "Evapo MP: heat exchange fouling coefficient";
-  parameter Real Encras_EvBP(fixed=false,start=1)
-    "Evapo BP: heat exchange fouling coefficient";
-
-  parameter Real Encras_SBP(fixed=false,start=1)
-    "Sur BP: heat exchange fouling coefficient";
-  parameter Real Encras_EBP(fixed=false,start=1)
-    "Eco BP: heat exchange fouling coefficient";
-
-  parameter Real KgainChargeHP(fixed=false,start=720.183)
-    "HP: Friction pressure loss coefficient";
-  parameter Real KgainChargeMP(fixed=false,start=1090.9)
-    "MP: Friction pressure loss coefficient";
-  parameter Real Kin_SMP2(fixed=false,start=10.)
-    "SMPin: Friction pressure loss coefficient";
-  parameter Real K_PerteChargeZero2(fixed=false,start=1e-4)
-    "TurbineMP out: Friction pressure loss coefficient";
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
-    "Maximum CV input Turbine HP ";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
-    "Maximum CV input Turbine MP ";
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(
-    L=16.27,
-    Vertical=false,
-    hl(fixed=false, start=1460508.128907675),
-    hv(fixed=false, start=2664791.3052738607),
-    Vv(fixed=false),
-    R=1.05,
-    xmv(fixed=false),
-    zl(start=1.05, fixed=true),
-    Mp=5000,
-    Kpa=5,
-    Kvl=1000,
-    P(fixed=false, start=12726424.235625941),
-    Pfond(start=12733333.038455429),
-    Tp(start=589.5151351323206))
-                     annotation (Placement(transformation(extent={{5,10},{-35,
-            50}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(
-      Cvmax=CvmaxValveAHP,
-    C1(P(start=13394232.807871036),
-    h_vol_2(start=1399087.0448386343)),
-    h(start=1398000),
-    Cv(start=178),
-    Pm(start=13050700))
-                 annotation (Placement(transformation(extent={{45,46},{25,66}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurHP(k=0.5)
-    annotation (Placement(transformation(extent={{-51,70},{-61,78}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(
-    Cvmax=47829.4,
-    C2(h_vol_1(start=2664791.3052738607)),
-    h(start=2674000),
-    Cv(start=23914.7),
-    Pm(start=12724920.902023433))
-                 annotation (Placement(transformation(extent={{-55,46},{-75,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(
-    z2=0,
-    Q(start=150, fixed=true),
-    z1=10.83,
-    K=KgainChargeHP,
-    C2(P(start=12757776.366696326)),
-    h(start=1474422.14552527),
-    Pm(start=12704000),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-            annotation (Placement(transformation(
-        origin={-5,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(V=5,
-    h(start=1460508.128907675),
-    P(start=12704000),
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam)
-                                           annotation (Placement(transformation(
-          extent={{-25,-100},{-45,-80}},
-                                       rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EvaporateurHP(
-    Dint=32.8e-3,
-    Ntubes=1476,
-    L=20.7,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
-      Tp(start={607.95945081921,605.4313602675011,604.0450760348469}),
-      Tp1(start={606.5065615724875,604.7563153894058,603.7327223072098})),
-    Ns=3,
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.092,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      K(fixed=true, start=37.69),
-      CSailettes=11.86442072,
-      p_rho=1.05,
-      Encras=Encras_EvHP,
-      deltaT(start={106,49,23}),
-      T2(start={755.2099609375,674.1281000784297,635.8939469832528,
-            618.0787353515625}),
-      T1(start={714.669037024263,655.0110235308413,626.9863546635906}),
-      Tp(start={609.3093210980612,606.0585402262541,604.3352819224443})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=10.83,
-      option_temperature=false,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={5.74e7,2.67e7,1.24e7}),
-      h(start={1460508.125,1842386.3805685563,2019815.5675635953,
-            2101914.802366878,1460508.125}),
-      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
-      P(start={12757776.0,12739926.315661393,12734300.718607338,
-            12730145.067304946,12726424.0})))
-                          annotation (Placement(transformation(
-        origin={-47,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurHP4(
-    Ns=3,
-    L=20.726,
-    Dint=0.0266,
-    Ntubes=246,
-    ExchangerWall(e=0.0026, lambda=47,
-      dW1(start={-3.5e6,-2.63e6,-2e6}),
-      Tp(start={577.1652678885227,582.2393934514894,585.9616914189281}),
-      Tp1(start={576.5195841307088,581.753378536046,585.5943808718256})),
-    Cws1(P(start=13320777.811415095),
-    h_vol_2(start=1292777.0058783418)),
-    Cws2(h_vol_1(start=1399087.0448386343)),
-    ExchangerFlueGasesMetal(
-      Dext=0.0318,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=11.39069779,
-      K(fixed=true, start=47.53),
-      p_rho=1.06,
-      Encras=Encras_EHP4,
-      deltaT(start={38,29,22}),
-      T2(start={618.0787353515625,613.037602447671,609.2389186305828,
-            606.3656616210938}),
-      T1(start={615.5581823957998,611.1382605391269,607.8022941316214}),
-      Tp(start={577.7558398657263,582.6839249827347,586.2976504908789})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      z2=0,
-      option_temperature=false,
-      inertia=true,
-      dW1(start={3.5e6,2.63e6,2e6}),
-      h(start={1292777.0,1338569.0293807227,1373037.3060893763,
-            1399087.0448386343,1399087.0}),
-      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
-      P(start={13320778.0,13339750.403131645,13358253.29250947,
-            13376387.23615858,13394233.0})))
-                          annotation (Placement(transformation(
-        origin={53,-50},
-        extent={{20,20},{-20,-20}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurHP1(
-    Ns=3,
-    L=20.4,
-    Dint=0.0324,
-    Ntubes=246,
-    ExchangerWall(e=0.0028, lambda=37.61,
-    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
-      Tp(start={641.7766266045941,659.2542181292313,674.5323393956571}),
-      Tp1(start={639.7295258289556,657.6427819154001,673.2854985024741})),
-    Cws1(h_vol_2(start=2664791.3052738607)),
-    Cws2(P(start=12720084.224503415),
-      h_vol_1(start=2973079.185217006)),
-    ExchangerFlueGasesMetal(
-      Dext=0.038,
-      step_L=0.111,
-      step_T=0.0869,
-      St=1,
-      Fa=1,
-      CSailettes=10.25056,
-      K(fixed=true, start=34.71),
-      p_rho=1.04,
-      Encras=Encras_SHP1,
-      deltaT(start={138,108,84}),
-      T2(start={787.8693237304688,774.2709985521502,763.5355376271307,
-            755.2099609375}),
-      T1(start={781.0701669240514,768.9032680896405,759.3727557986135}),
-      Tp(start={643.6669592742874,660.7422496694279,675.683696525852})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.83,
-      option_temperature=false,
-      inertia=true,
-      dW1(start={9.8e6,7.7e6,5.9e6}),
-      h(start={2664791.25,2793445.279188231,2894719.078252342,2973079.185217006,
-            2973079.25}),
-      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
-      P(start={12723418.0,12723372.064267773,12722706.076957166,
-            12721569.805902744,12720084.0})))
-                          annotation (Placement(transformation(
-        origin={-87,-50},
-        extent={{-20,20},{20,-20}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurHP3(
-    Dint=26.6e-3,
-    Ntubes=1476,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-      dW1(start={-1.6e7,-5.6e6,-2.1e6}),
-      Tp(start={557.1357570088924,563.7223638401374,566.037182893163}),
-      Tp1(start={556.657781456147,563.5505466405001,565.9750435970707})),
-    L=20.726,
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=12.451,
-      K(fixed=true, start=36.0300000000857),
-      p_rho=1.08,
-      Encras=Encras_EHP3,
-      St=5, deltaT(start={34,12,4.4}),
-      T2(start={602.606689453125,580.0827929934445,571.956039969206,
-            569.0130004882813}),
-      T1(start={591.3447334381658,576.0194164813253,570.4845269121585}),
-      Tp(start={557.5729353703138,563.879515730797,566.0940183432008})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.6e7,5.6e6,2.1e6}),
-      h(start={989834.8125,1193223.55215195,1266335.416732016,
-            1292777.0058783418,1292777.0}),
-      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
-      P(start={13239006.0,13261089.90163249,13281516.713631846,
-            13301273.845180616,13320778.0})))
-                  annotation (Placement(transformation(
-        origin={173,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurHP2(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-      dW1(start={-5e6,-3e6,-2.e6}),
-      Tp(start={492.5265031447411,499.7298617398276,504.2372403374727}),
-      Tp1(start={492.3269425182926,499.6044056390882,504.15828372038055})),
-    L=20.767,
-    Ntubes=1107,
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=111e-3,
-      CSailettes=2.76134577,
-      K(fixed=true, start=65.5300000000393),
-      p_rho=1.11,
-      Encras=Encras_EHP2,
-      St=5, deltaT(start={36,23,14}),
-      T2(start={531.2528686523438,524.0786479337396,519.5624877991071,
-            516.7178344726563}),
-      T1(start={527.6657680129605,521.8205678664233,518.1401706426662}),
-      Tp(start={492.70903044592376,499.8446096432236,504.3094576805689})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.767,
-      inertia=true,
-      dW1(start={5e6,3e6,2.e6}),
-      h(start={860655.375,924469.2991480937,964586.6772085332,989834.8113335292,
-            989834.8125}),
-      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
-      P(start={13149154.0,13172140.227906534,13194684.103908138,
-            13216938.318123804,13239006.0})))
-                  annotation (Placement(transformation(
-        origin={373,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurHP1(
-    Dint=26.6e-3,
-    Ns=3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-              dW1(start={-9.9999e6,-5e6,-2.4e6}),
-      Tp(start={461.83700038875077,471.4458881656956,476.1007075853514}),
-      Tp1(start={461.41562496249884,471.24253667400546,476.002824325766})),
-    L=20.726,
-    Ntubes=1107,
-    Cws1(h_vol_2(start=630040.8772883223)),
-    ExchangerFlueGasesMetal(
-      Dext=31.8e-3,
-      step_L=74e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=8.30057632,
-      K(fixed=true, start=40.24),
-      p_rho=1.13,
-      Encras=Encras_EHP1,
-      St=5,   deltaT(start={41,20,10}),
-      T2(start={509.81195068359375,494.60709242744036,487.25141439639447,
-            483.7066345214844}),
-      T1(start={502.2095163065458,490.92925341191744,485.4790272730564}),
-      Tp(start={462.22240967868714,471.63188276609173,476.1902361036878})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.767,
-      inertia=true,
-      dW1(start={9.9999e6,5e6,2.4e6}),
-      h(start={630040.875,764519.0167009356,829416.7979796123,860655.3510811749,
-            860655.375}),
-      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
-      advection=true,
-      dynamic_mass_balance=true,
-      P(start={13054959.0,13079363.233486831,13102973.863543343,
-            13126167.933420062,13149154.0})))
-                  annotation (Placement(transformation(
-        origin={493,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurHP2(
-    Ns=3,
-    L=20.4,
-    Dint=32e-3,
-    Ntubes=246,
-    ExchangerWall(e=3e-3, lambda=27,
-      dW1(start={-8.8e6,-6.6e6,-4.9e6}),
-      Tp(start={718.0595138013858,738.8988421059552,755.1216906441867}),
-      Tp1(start={715.284148781996,736.8146275114044,753.568899547355})),
-    Cws2(P(start=12710803.048741188),
-                               h_vol_1(start=3240679.101987554)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      K(fixed=true, start=34.74),
-      CSailettes=10.2505424803872,
-      p_rho=1.02,
-      Encras=Encras_SHP2,
-      St=5,
-      deltaT(start={124,93,70}),
-      T2(start={850.2295532226563,838.165359685431,829.0838172755421,
-            822.3056030273438}),
-      T1(start={844.1974477839519,833.6245884804865,825.6946997760892}),
-      Tp(start={720.6064978764006,740.8115495674804,756.5467047118})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.83,
-      inertia=true,
-      dW1(start={8.8e6,6.6e6,4.9e6}),
-      h(start={2973079.25,3088900.225778996,3175878.2994419048,
-            3240679.101987554,3240679.0}),
-      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
-      P(start={12720084.0,12718408.787041187,12716215.067117244,
-            12713645.694467228,12710803.0})))
-                  annotation (Placement(transformation(
-        origin={-207,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurHP3(
-    Ns=3,
-    L=20.4,
-    Ntubes=246,
-    ExchangerWall(lambda=27, e=5e-3,
-    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
-      Tp(start={789.2881838358564,806.7088039780044,819.9912755140301}),
-      Tp1(start={785.6370057524725,803.9662515359148,817.9384055160485})),
-    Dint=28e-3,
-    Cws2(h_vol_1(start=3432930.991856911)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=111e-3,
-      K(fixed=true, start=49.33),
-      CSailettes=6.59672842597229,
-      p_rho=1,
-      Encras=Encras_SHP3,
-      St=5,
-      deltaT(start={97,73,55}),
-      T2(start={893.75,885.1796729176981,878.7316754228791,873.8992309570313}),
-      T1(start={889.464836458849,881.9556741702886,876.315464574507}),
-      Tp(start={792.4232630808997,809.0636930146954,821.7539696298131})),
-    TwoPhaseFlowPipe(
-      rugosrel=5e-6,
-      z2=0,
-      advection=false,
-      z1=10.726,
-      inertia=true,
-      dW1(start={6.3e6,4.7e6,3.6e6}),
-      h(start={3240679.0,3323783.054261407,3386205.9057494565,3432930.991856911,
-            3432931.0}),
-      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
-      P(start={12710803.0,12704112.803652512,12696819.484746953,
-            12689077.136342296,12681000.0})))
-                  annotation (Placement(transformation(
-        origin={-327,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(
-    L=16.27,
-    Vertical=false,
-    P0=27.29e5,
-    hl(fixed=false, start=980960.1562978515),
-    hv(fixed=false, start=2798761.3254371085),
-    Vv(fixed=false),
-    R=1.05,
-    P(fixed=false, start=2733918.2848144253),
-    zl(start=1.05, fixed=true),
-    Kpa=5,
-    Mp=5000,
-    Kvl=1000,
-    Pfond(start=2742462.980913138),
-    Tp(start=497.4249792990277))
-                     annotation (Placement(transformation(extent={{325,10},{287,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurMP(k=0.5)
-    annotation (Placement(transformation(extent={{271,70},{259,80}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(
-      Cvmax=CvmaxValveAMP,
-    C1(P(start=3253417.522956237),
-    h_vol_2(start=947830.5281155076)),
-    h(start=944000),
-    Cv(start=28),
-    Pm(start=2975000))
-                 annotation (Placement(transformation(extent={{365,46},{345,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(
-    Cvmax=47829.4,
-    C2(h_vol_1(start=2798761.3254371085)),
-    h(fixed=false, start=2798000),
-    Cv(start=23914.7),
-    Pm(fixed=false, start=2732653.9482791456))
-                 annotation (Placement(transformation(extent={{265,46},{245,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EvaporateurMP(
-    Dint=32.8e-3,
-    L=20.767,
-    Ntubes=738,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
-      Tp(start={504.9993271430632,504.2768804788304,503.69756244079724}),
-      Tp1(start={504.503193578626,503.89321384657916,503.40091865289605})),
-    Ns=3,
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.83,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={9.7e7,7.6e6,5.8e6}),
-      P(start={2773378.75,2751240.3575119935,2743530.0500684776,
-            2738283.631137228,2733918.25}),
-      h(start={980960.1875,1046373.213452734,1096957.9937272775,
-            1136069.1896699532,980960.1875}),
-      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
-    Cws1(P(start=2773378.6567335734)),
-    ExchangerFlueGasesMetal(
-      K(fixed=true, start=30.22),
-      Dext=38e-3,
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      CSailettes=10.0676093,
-      p_rho=1.1,
-      Encras=Encras_EvMP,
-      St=5,
-      deltaT(start={53,41,32}),
-      T2(start={565.5570068359375,551.1237970278224,539.9287004763471,
-            531.2528686523438}),
-      T1(start={558.3404164937012,545.5262487520847,535.5907942842642}),
-      Tp(start={505.4602817233831,504.6333427384495,503.9731723219999})))
-                          annotation (Placement(transformation(
-        origin={273,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(
-    z2=0,
-    z1=10.83,
-    Q(start=150, fixed=true),
-    K=KgainChargeMP,
-    Pm(start=2734000),
-    h(start=978914.570821827),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-            annotation (Placement(transformation(
-        origin={315,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(V=5,
-    h(start=980960.1562978515),
-    P(start=2734000),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                           annotation (Placement(transformation(
-          extent={{295,-100},{275,-80}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurMP(
-    ExchangerWall(e=2.6e-3, lambda=47,
-        dW1(start={-3e6,-1.4e6,-740379}),
-      Tp(start={470.48677107325835,488.1938632909576,497.65207032563256}),
-      Tp1(start={470.01280565475304,487.9402946158829,497.51626768286917})),
-    L=20.726,
-    Ns=3,
-    Dint=26.6e-3,
-    Ntubes=246,
-    Cws1(h_vol_2(start=576430.3612424443)),
-    Cws2(h_vol_1(start=947830.5281155076)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      K(fixed=true, start=47.78),
-      CSailettes=7.16188651,
-      p_rho=1.12,
-      Encras=Encras_EMP,
-      St=5,
-      deltaT(start={45,24,13}),
-      T2(start={516.7178344726563,512.927875284067,510.89894284399503,
-            509.81195068359375}),
-      T1(start={514.8228643851462,511.91340906403104,510.35544151482316}),
-      Tp(start={470.920281581991,488.4257888303293,497.7762816508864})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=10.767,
-      z2=0,
-      inertia=true,
-      dW1(start={3e6,1.4e6,740379}),
-      h(start={576430.375,780326.2782299566,889409.3790325949,947830.5281155076,
-            947830.5}),
-      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
-      P(start={3160828.5,3185369.6108956896,3208693.506993564,
-            3231270.1974957627,3253417.5})))
-                          annotation (Placement(transformation(
-        origin={433,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurMP1(
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.3e6,-0.80263e6,
-                                -501864}),
-      Tp(start={558.0934551632172,574.0136440053798,584.242260992374}),
-      Tp1(start={557.706011115662,573.7688585895307,584.0889760553388})),
-    L=20.726,
-    Ns=3,
-    Dint=32.8e-3,
-    Ntubes=123,
-    Cws1(h_vol_2(start=2798761.3254371085)),
-    ExchangerFlueGasesMetal(
-      step_L=111e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=31.8e-3,
-      K(fixed=true, start=22.09),
-      CSailettes=14.46509765,
-      p_rho=1.07,
-      Encras=Encras_SMP1,
-      St=5,
-      deltaT(start={45,30,19}),
-      T2(start={606.3656616210938,604.5120304885253,603.3404748736327,
-            602.606689453125}),
-      T1(start={605.4388500605926,603.926252681079,602.9735743782599}),
-      Tp(start={558.4534269956265,574.2410725985397,584.3846770655402})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z2=0,
-      z1=10.77,
-      inertia=true,
-      dW1(start={1.3e6,0.80263e6,501864}),
-      h(start={2798761.25,2900642.773718668,2965011.0169332824,
-            3005318.492253628,3040245.5}),
-      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
-      P(start={2731389.5,2730444.2277886732,2729310.613093969,
-            2728046.4038641006,2726700.0})))
-                          annotation (Placement(transformation(
-        origin={113,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(
-    Ce1(h(start=3046003.380872726)),
-    h(start=3040245.422545259),
-    P(start=2726000))
-    annotation (Placement(transformation(
-        origin={115,-110},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurMP2(
-    Ns=3,
-    L=20.4,
-    Dint=39.3e-3,
-    Ntubes=369,
-    ExchangerWall(e=2.6e-3, lambda=36.86,
-    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
-      Tp(start={688.9747491924221,714.1387227867799,731.7594455240543}),
-      Tp1(start={687.7117385985722,713.2642402785228,731.156085252147})),
-    Cws1(P(start=2575477.4929098235),
-      h_vol_2(start=3040245.422545259)),
-    Cws2(P(start=2558200.620927911),
-      h_vol_1(start=3321522.540904887)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=92e-3,
-      K(fixed=true, start=45.22),
-      CSailettes=5.814209831,
-      p_rho=1.03,
-      Encras=Encras_SMP2,
-      St=5,
-      deltaT(start={125,86,60}),
-      T2(start={822.3056030273438,806.4713844816748,795.4738313791455,
-            787.8693237304688}),
-      T1(start={814.3884833791556,800.9726079304102,791.671583337549}),
-      Tp(start={690.1616978609907,714.9605415853846,732.3264698030932})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dW1(start={1.15e7,7.9e6,5.5e6}),
-      h(start={3040245.5,3169860.5211362485,3259603.344415277,3321522.540904887,
-            3321522.5}),
-      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
-      P(start={2575477.5,2571810.3704688977,2567607.9202979314,
-            2563033.661146952,2558200.5})))
-                          annotation (Placement(transformation(
-        origin={-147,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurMP3(
-    Ns=3,
-    L=20.4,
-    Ntubes=369,
-    Dint=45.6e-3,
-    ExchangerWall(e=2.6e-3, lambda=27,
-    dW1(start={-8e6,-5.5e6,-3.8e6}),
-      Tp(start={786.0003533757151,802.6089712721623,814.0750543986999}),
-      Tp1(start={784.9544439166481,801.8912118855588,813.583437630984})),
-    Cws2(h_vol_1(start=3517381.1285517)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=92e-3,
-      Dext=50.8e-3,
-      K(fixed=true, start=43.23),
-      CSailettes=5.695842178,
-      p_rho=1.01,
-      Encras=Encras_SMP3,
-      St=5,
-      deltaT(start={82,56,38}),
-      T2(start={873.8992309570313,862.9376291442026,855.3997728669909,
-            850.2295532226563}),
-      T1(start={868.4184414351687,859.1687010055967,852.814654374732}),
-      Tp(start={786.9913001992309,803.2890123388494,814.5408366613608})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      z1=10.83,
-      rugosrel=1e-5,
-      inertia=true,
-      dW1(start={8e6,5.5e6,3.8e6}),
-      h(start={3321522.5,3412353.763453483,3474687.0390689597,3517381.1285517,
-            3517381.25}),
-      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
-      P(start={2558200.5,2556022.8892716086,2553661.4076231164,
-            2551174.061990546,2548600.0})))
-                          annotation (Placement(transformation(
-        origin={-267,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(
-    Vertical=false,
-    P0=5e5,
-    Vv(fixed=false),
-    L=8,
-    hl(fixed=false, start=561432.6820300646),
-    hv(fixed=false, start=2682927.2097681486),
-    R=2,
-    P(fixed=false, start=536006.6647383622),
-    zl(start=1.75, fixed=true),
-    Kpa=5,
-    Mp=5000,
-    Kvl=1000,
-    Pfond(start=552000.8087452435),
-    Tp(start=409.09918124890646))
-                     annotation (Placement(transformation(extent={{585,10},{545,
-            50}}, rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_vanne_vapeurBP(k=0.5)
-    annotation (Placement(transformation(extent={{633,76},{621,86}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(
-    p_rho=3, Cvmax=CvmaxValveVBP,
-    C2(P(start=509651.8053666252),
-    h_vol_1(start=2682927.2097681486)),
-    h(start=2685000),
-    Cv(start=1),
-    Pm(start=498000))
-                 annotation (Placement(transformation(extent={{525,46},{505,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(
-    Cvmax=285,
-    C1(h_vol_2(start=517521.1338868904)),
-    h(fixed=false, start=509000),
-    Cv(start=142.5),
-    Pm(fixed=false, start=1001940.4305634197))
-                 annotation (Placement(transformation(extent={{617,44},{597,64}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(
-    z2=0,
-    z1=10.767,
-    Q(start=50, fixed=false),
-    K=32766,
-    rho(start=931.9744461081724),
-    Pm(start=564000),
-    h(start=549249.519022482),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-            annotation (Placement(transformation(
-        origin={577,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(h(start=561432.682030064),
-    V=5,
-    P(start=564000),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                           annotation (Placement(transformation(
-          extent={{559,-100},{539,-80}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EvaporateurBP(
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
-      Tp(start={431.3608522222893,430.24126699702373,429.39686929842486}),
-      Tp1(start={430.9104943759602,429.93425668934924,429.1871126238492})),
-    L=20.726,
-    Ntubes=984,
-    Ns=3,
-    ExchangerFlueGasesMetal(
-      Dext=38e-3,
-      step_T=86.9e-3,
-      Fa=1,
-      step_L=138e-3,
-      K(fixed=true, start=30.62),
-      CSailettes=11.07985,
-      p_rho=1.14,
-      Encras=Encras_EvBP,
-      St=5,
-      deltaT(start={45,31,21}),
-      T2(start={483.7066345214844,465.9440370193418,453.7982409323057,
-            445.483154296875}),
-      T1(start={474.8253385845301,459.8711389758238,449.6406958379268}),
-      Tp(start={431.7792768702483,430.5265083466735,429.59175290805825})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      continuous_flow_reversal=true,
-      inertia=true,
-      dW1(start={1.24e7,8.5e6,5.8e6}),
-      h(start={561432.6875,799363.0194709267,961560.8510406071,
-            1072378.2305328134,561432.6875}),
-      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
-      Q(start={49.81331881379377,49.81331881379377,49.81331881379377,
-            49.81331881379377}),
-      P(start={563167.375,538556.7569255093,537410.7752779912,536682.3739734262,
-            536006.6875})))
-                          annotation (Placement(transformation(
-        origin={533,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    constante_ballonBP(k=1)
-    annotation (Placement(transformation(extent={{709,6},{695,18}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(
-    Cvmax=308.931,
-    C1(h_vol_2(start=561432.6820300646)),
-    h(start=550000),
-    Cv(start=308.931),
-    Pm(start=454319.5384961263),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                 annotation (Placement(transformation(extent={{677,-14},{697,6}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    SurchauffeurBP(
-    Ns=3,
-    L=20.726,
-    Dint=39.3e-3,
-    Ntubes=123,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-1.1e6,-782901,-559798}),
-      Tp(start={477.52260500819597,502.61487297914,520.6394670364305}),
-      Tp1(start={477.2504107508904,502.4219869045609,520.5035062463255})),
-    Cws1(h_vol_2(start=2682927.2097681486)),
-    Cws2(h_vol_1(start=2919992.1127030067)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=44.5e-3,
-      step_L=222.1e-3,
-      K(fixed=true, start=30.46),
-      CSailettes=3.25763059984175,
-      p_rho=1.09,
-      Encras=Encras_SBP,
-      St=5,
-      deltaT(start={92,66,47}),
-      T2(start={569.0130004882813,567.4482541171128,566.3390581546068,
-            565.5570068359375}),
-      T1(start={568.2306339861118,566.8936561358598,565.9480470570934}),
-      Tp(start={477.77840698873644,502.79614293098246,520.7672398988061})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      z2=0,
-      rugosrel=1e-5,
-      z1=10.767,
-      inertia=true,
-      dW1(start={1.1e6,782901,559798}),
-      h(start={2682927.25,2790287.093854774,2866365.945824299,
-            2919992.1127030067,2919992.0}),
-      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
-      P(start={509651.8125,507980.5977658856,506129.5447082628,
-            504067.5333025372,501850.0})))
-                          annotation (Placement(transformation(
-        origin={233,-50},
-        extent={{20,-20},{-20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5)
-    annotation (Placement(transformation(
-        origin={689,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
-    EconomiseurBP(
-    Ns=3,
-    Dint=32.8e-3,
-    ExchangerWall(e=2.6e-3, lambda=47,
-    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
-      Tp(start={402.39147626030376,398.05961040088295,397.171667377241}),
-      Tp1(start={402.1199525074059,397.9993065179613,397.15885396154556})),
-    Ntubes=3444,
-    L=20.726,
-    Cws1(h_vol_2(start=194669.37425632242)),
-    Cws2(h_vol_1(start=517521.1338868904)),
-    ExchangerFlueGasesMetal(
-      step_T=86.9e-3,
-      Fa=1,
-      Dext=38e-3,
-      step_L=92e-3,
-      K(fixed=true, start=31.53),
-      CSailettes=11.673758598919,
-      p_rho=1.15,
-      Encras=Encras_EBP,
-      St=5,
-      deltaT(start={23.5,5.3,1.1}),
-      T2(start={445.483154296875,407.64728846356843,399.20963445670407,
-            397.4152526855469}),
-      T1(start={426.56521960355815,403.42846146013625,398.31244500376624}),
-      Tp(start={402.64374727467464,398.11563835995787,397.18357224132967})),
-    TwoPhaseFlowPipe(
-      advection=false,
-      rugosrel=5e-6,
-      z1=0,
-      z2=10.767,
-      inertia=true,
-      dW1(start={2.45e7,5.5e6,1.17e6}),
-      h(start={194669.375,449026.540992922,505517.82265620184,517521.1338868904,
-            517521.125}),
-      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
-      P(start={1578579.375,1542823.2506358635,1517636.5908885582,
-            1492724.792065889,1467874.25})))
-                          annotation (Placement(transformation(
-        origin={647,-50},
-        extent={{-20,-20},{20,20}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.88057),
-    Qmax=140,
-    eta_is_nom=0.88057,
-    eta_is_min=0.75,
-    Cst(start=8182844.56002535)=CstHP,
-    pros(d(start=10.66670150764929)),
-    Hrs(start=3046003.380872726),
-    Pe(fixed=true, start=12431000),
-    Ps(fixed=false, start=2726700))
-              annotation (Placement(transformation(extent={{-35,-250},{5,-210}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9625),
-    Qmax=150,
-    eta_is_nom=0.9625,
-    eta_is_min=0.75,
-    Cst(start=256335.364995961)=
-        CstMP,
-    pros(d(start=1.883484197675123)),
-    Hrs(start=3029367.6706168973),
-    Pe(fixed=true, start=2548500),
-    Ps(fixed=false, start=476800))
-                annotation (Placement(transformation(extent={{285,-250},{325,
-            -210}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(
-    h(start=3018320.043117248),
-    P(start=476799.99999954),
-    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
-        origin={385,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(
-    W_fric=1,
-    eta_stato=1,
-    eta_is(start=0.9538),
-    Qmax=150,
-    eta_is_nom=0.9538,
-    eta_is_min=0.75,
-    Cst(start=11944.9445735985)=CstBP,
-    Cs(h(start=2401478.8015108025)),
-    Hrs(start=2401030),
-    Pe(fixed=true, start=476799.99999954),
-    Ps(start=10053))
-                annotation (Placement(transformation(extent={{543,-250},{583,
-            -210}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(alpha=2)
-    annotation (Placement(transformation(
-        origin={-325,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(alpha=2)
-    annotation (Placement(transformation(
-        origin={-265,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(
-    alpha=0.5,
-    Ce(h(start=3046260)),
-    P(start=2726700))
-    annotation (Placement(transformation(extent={{81,-180},{101,-160}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(
-    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    continuous_flow_reversal=true,
-    Vf0=0.15,
-    steady_state=false,
-    yNiveau(signal(start=1.5)),
-    Cse(h(start=128076)),
-    P(fixed=false, start=6136),
-    Pfond(start=10000.0),
-    Cl(h(start=191812.29519356362)),
-    proe(d(start=996.0227362797892)))
-    annotation (Placement(transformation(extent={{604,-384},{684,-304}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(
-    h0=113.38e3, Q0=29804.5)     annotation (Placement(transformation(extent={{539,
-            -377},{587,-329}},     rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur
-    annotation (Placement(transformation(extent={{703,-374},{747,-330}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(K=1e-4,
-    h(start=2400000),
-    C1(h_vol_2(start=2400000), h(start=2400000)),
-    Pm(start=10026.138683139128))
-    annotation (Placement(transformation(extent={{607,-240},{627,-220}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(
-    Ce3(h(start=194669.37425631672)),
-    h(start=194669.37425632242),
-    P(start=1540500),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (Placement(transformation(
-        origin={869,-318},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(K=1e-4,
-    rho(start=990.3699122081223),
-    Pm(start=1540000))
-    annotation (Placement(transformation(
-        origin={869,-270},
-        extent={{12,-12},{-12,12}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(
-    h(start=561432.6820300613),
-    P(start=322430),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                           annotation (Placement(transformation(
-          extent={{709,-20},{729,0}}, rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(
-    a3=350,
-    b1(fixed=true) = -3.7751,
-    a1=-244551,
-    Q(fixed=false),
-    C1(h_vol_2(start=561432.6820300613)),
-    C2(h_vol_1(start=576430.3612424443)),
-    Qv(start=0.013433660889458656),
-    rho(start=931.2517020786314),
-    Pm(start=1725850),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-            annotation (Placement(transformation(extent={{771,-20},{791,0}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(
-    a3=1600,
-    a1=-28056.2,
-    b1=-12.7952660447433,
-    Q(fixed=false),
-    C1(h_vol_2(start=561432.6820300613)),
-    C2(h_vol_1(start=630040.8772883223)),
-    Qv(start=0.08167585768192882),
-    rho(start=929.0940034498418),
-    Pm(start=6774000),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-             annotation (Placement(transformation(extent={{771,-60},{791,-40}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(
-    alpha=0.5,
-    h(start=194585),
-    P(start=1540500),
-    Cs(h(start=194585)))
-    annotation (Placement(transformation(extent={{839,-328},{853,-308}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(alpha=2)
-    annotation (Placement(transformation(
-        origin={235,-100},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(
-    z2=0,
-    z1=0,
-    K=K_PerteChargeZero2,
-    h(start=3000000),
-    C1(
-      h_vol_2(start=3000000),
-      h(start=3000000),
-      P(fixed=true, start=501850)),
-    Pm(start=490000))
-            annotation (Placement(transformation(
-        origin={311,-278},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(K=1e-4,
-    Pm(start=372632.41194491077),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (Placement(transformation(
-        origin={747,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(K=1e-4,
-    Pm(start=372632.41224549303),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (Placement(transformation(
-        origin={747,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur
-    annotation (Placement(transformation(extent={{369,-448},{489,-348}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(
-    K=1e-4,
-    C1(h_vol_2(start=191812.29519356362)),
-    C2(h_vol_1(start=191812.29519356362)),
-    rho(start=989.8383588386666),
-    Pm(start=6200),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (Placement(transformation(extent={{669,-446},{689,-426}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(
-    Qv(start=0.19861699733512259),
-    a3=400,
-    a1(fixed=true) = -6000,
-    Q(start=194.502, fixed=false),
-    C2(h_vol_1(start=194669.37425631672)),
-    Pm(start=802830.7060548771),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-            annotation (Placement(transformation(extent={{709,-446},{729,-426}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(
-    K=1e-4,
-    rho(start=990.3699122094005),
-    C1(h_vol_2(start=194669.37425631672),
-    h(start=194585)),
-    Pm(start=1546000),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (Placement(transformation(extent={{807,-446},{827,-426}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(Cvmax=2000,
-    h(start=194500),
-    Cv(start=2000),
-    Pm(start=1587120.4167526974),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                 annotation (Placement(transformation(extent={{769,-440},{789,
-            -420}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol_2(start=2674000),
-        h(start=2674000)))
-    annotation (Placement(transformation(
-        origin={-91,8},
-        extent={{-6,6},{6,-6}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol_1(start=1398000),
-        h(start=1398000))) " "
-    annotation (Placement(transformation(
-        origin={58.5,32},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol_1(start=944000),
-        h(start=944000)))
-    annotation (Placement(transformation(extent={{391,49},{376,63}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol_2(start=2798000),
-        h(start=2798000)))
-    annotation (Placement(transformation(
-        origin={203,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol_1(start=2685000),
-        h(start=2685000)))
-    annotation (Placement(transformation(
-        origin={481,56},
-        extent={{-8,8},{8,-8}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol_1(start=550000),
-        h(start=550000)))
-    annotation (Placement(transformation(
-        origin={630.5,34},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol_1(
-          start=550000), h(start=550000)))
-    annotation (Placement(transformation(extent={{654,-11},{667,1}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol_1(
-          start=194585), h(start=194585)))
-    annotation (Placement(transformation(
-        origin={652.5,-412},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol_1(
-          start=2401000), h(start=2401000)))
-    annotation (Placement(transformation(
-        origin={651.5,-264},
-        extent={{-10,-6.5},{10,6.5}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(
-                                                          K=Kin_SMP2,
-    Pm(start=2651000),
-    C1(
-      P(fixed=true, start=2726700),
-      h_vol_2(start=3046000),
-      h(start=3046000)))
-    annotation (Placement(transformation(extent={{81,-120},{61,-100}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(
-    C1(P(fixed=true, start=12680999.9999969)),
-    Cvmax=Cvmax_THP,
-    h(fixed=false, start=3433000),
-    Cv(start=10875),
-    Pm(fixed=false, start=12550000))
-                 annotation (Placement(transformation(extent={{-157,-234},{-137,
-            -214}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauHP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{-191,113},{-157,131}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl
-    regulation_Niveau_HP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500,
-    minval=0.007)
-    annotation (Placement(transformation(extent={{-73,106},{-53,126}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauMP(                                                              k=1.05)
-    annotation (Placement(transformation(extent={{140,113},{174,131}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl
-    regulation_Niveau_MP(
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    add(k1=-1, k2=+1),
-    Ti=500)
-    annotation (Placement(transformation(extent={{229,106},{249,126}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauEauBP(                                                              k=1.75)
-    annotation (Placement(transformation(extent={{437,126},{471,144}}, rotation=
-           0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
-    add(k1=-1, k2=+1),
-    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-    Ti=10,
-    minval=0.006) annotation (Placement(transformation(extent={{535,108},{555,128}},
-          rotation=0)));
-   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauCondenseur1(                                 k=1.5)
-    annotation (Placement(transformation(extent={{683,-246},{707,-230}},
-          rotation=0)));
-  ThermoSysPro.Examples.Control.Condenser_LevelControl
-    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
-                                                add(k1=+1, k2=-1),
-    edge(uL(signal(start=true))))
-                                 annotation (Placement(transformation(extent={{725,
-            -282},{745,-262}},     rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneTurbineHP(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-241,-216},{
-            -171,-142}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp(
-    Initialvalue=1400,
-    Duration=1000,
-    Starttime=4000,
-    Finalvalue=1000)
-                   annotation (Placement(transformation(extent={{911,-42},{873,
-            -10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP(
-    Initialvalue=1400,
-    Starttime=4000,
-    Duration=1000,
-    Finalvalue=700)
-                   annotation (Placement(transformation(extent={{912,-96},{874,
-            -64}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(
-    Initialvalue=1400,
-    Finalvalue=1000,
-    Duration=1000,
-    Starttime=200000)
-                   annotation (Placement(transformation(extent={{912,-458},{874,
-            -426}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(
-    V=1,
-    h0=988332,
-    h(start=860655.3510813401),
-    dynamic_mass_balance=true,
-    P0=7010000,
-    P(start=13149153.870557636),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                          annotation (Placement(transformation(
-          extent={{423,-98},{403,-78}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(
-    V=1,
-    h0=983786,
-    h(start=989834.8113335292),
-    dynamic_mass_balance=true,
-    P0=7000000,
-    P(start=13239005.657249678),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                                          annotation (Placement(transformation(
-          extent={{219,-20},{199,0}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(
-    Cvmax=308.931,
-    h(start=618600),
-    Cv(start=308.931),
-    Pm(start=13150193.68579806),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                 annotation (Placement(transformation(extent={{721,-98},{697,
-            -122}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(
-    Cvmax=308.931,
-    h(start=565000),
-    Cv(start=308.931),
-    Pm(start=3163391.8442005403),
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-                 annotation (Placement(transformation(extent={{771,-138},{747,
-            -162}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(
-    Initialvalue=0.8,
-    Duration=1000,
-    Starttime=3000,
-    Finalvalue=0.005)
-                     annotation (Placement(transformation(extent={{913,-150},{
-            875,-118}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(
-    Initialvalue=0.8,
-    Duration=1000,
-    Starttime=3000,
-    Finalvalue=0.005)
-                     annotation (Placement(transformation(extent={{913,-194},{
-            875,-162}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(
-    h0=3e6,
-    h(start=3432930.9918569606),
-    dynamic_mass_balance=true,
-    P0=12700000,
-    P(start=12700000))                annotation (Placement(transformation(
-        origin={-85,-230},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(
-    h0=3523910,
-    h(start=3517381.1285518324),
-    dynamic_mass_balance=true,
-    P0=2400000,
-    P(start=2400000))                     annotation (Placement(transformation(
-        origin={-83,-314},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(
-    C1(P(fixed=true, start=25.486e5)),
-    Cvmax=Cvmax_TMP,
-    h(fixed=false, start=3518000),
-    Cv(start=3.312e6),
-    Pm(fixed=false, start=2547000))
-                 annotation (Placement(transformation(extent={{-157,-318},{-137,
-            -298}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    ConstantVanneTurbineMP(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
-        3100,0.8]) annotation (Placement(transformation(extent={{-241,-300},{
-            -171,-226}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
-    annotation (Placement(transformation(extent={{-28,68},{-2,98}},
-                                                                  rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
-    annotation (Placement(transformation(extent={{293,68},{319,98}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
-    annotation (Placement(transformation(extent={{552,64},{578,94}}, rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceFumees(
-    Xco2=0.0613,
-    Xso2=0,
-    Xh2o=0.0706,
-    T0=893.75,
-    Xo2=0.1380,
-    Q0=606.94,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-473,-91},{-371,-7}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit(             Table=[0,606.94; 10,606.94; 600,
-        50; 650,50])
-                annotation (Placement(transformation(extent={{-527,-19},{-457,
-            55}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature(
-      Table=[0,893.75; 10,893.75; 600,423; 650,423])
-                   annotation (Placement(transformation(extent={{-527,-157},{
-            -457,-83}}, rotation=0)));
-equation
-  connect(SurchauffeurHP3.Cws1, SurchauffeurHP2.Cws2)
-    annotation (Line(points={{-327,-30},{-327,-10},{-207,-10},{-207,-30}},
-        color={255,0,0}));
-  connect(SurchauffeurHP2.Cws1, SurchauffeurHP1.Cws2)
-    annotation (Line(points={{-207,-70},{-207,-90},{-87,-90},{-87,-70}}, color=
-          {255,0,0}));
-  connect(constante_vanne_vapeurHP.y, vanne_vapeurHP.Ouv)
-    annotation (Line(points={{-61.5,74},{-65,74},{-65,67}}));
-  connect(vanne_vapeurHP.C1, BallonHP.Cv)
-    annotation (Line(points={{-55,50},{-35,50}},color={255,0,0}));
-  connect(GainChargeHP.C1, BallonHP.Cd)
-    annotation (Line(points={{5,-90},{15,-90},{15,10},{5,10}},   color={255,128,
-          0}));
-  connect(BallonHP.Cm, EvaporateurHP.Cws2)
-    annotation (Line(points={{-35,10},{-47,10},{-47,-30}}));
-  connect(VolumeEvapHP.Cs, EvaporateurHP.Cws1)
-    annotation (Line(points={{-45,-90},{-45,-70},{-47,-70}}, color={255,128,0}));
-  connect(VolumeEvapHP.Ce1, GainChargeHP.C2)
-                                      annotation (Line(points={{-25,-90},{-15,
-          -90}},
-        color={255,128,0}));
-  connect(EconomiseurHP4.Cws1, EconomiseurHP3.Cws2)
-    annotation (Line(points={{53,-70},{53,-82},{173,-82},{173,-70}}));
-  connect(BallonMP.Cm, EvaporateurMP.Cws2)
-    annotation (Line(points={{287,10},{273,10},{273,-30}}));
-  connect(EvaporateurMP.Cws1, VolumeEvapMP.Cs)
-    annotation (Line(points={{273,-70},{273,-80},{275,-80},{275,-90}}, color={
-          255,128,0}));
-  connect(VolumeEvapMP.Ce1, GainChargeMP.C2)
-    annotation (Line(points={{295,-90},{305,-90}}, color={255,128,0}));
-  connect(constante_vanne_vapeurMP.y, vanne_vapeurMP.Ouv)
-    annotation (Line(points={{258.4,75},{255,75},{255,67}}));
-  connect(SurchauffeurHP1.Cfg2, EvaporateurHP.Cfg1)        annotation (Line(
-      points={{-77,-50},{-57,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurHP.Cfg2, EconomiseurHP4.Cfg1)        annotation (Line(
-      points={{-37,-50},{43,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP4.Cfg2, SurchauffeurMP1.Cfg1)          annotation (Line(
-      points={{63,-50},{103,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP1.Cfg2, EconomiseurHP3.Cfg1)           annotation (Line(
-      points={{123,-50},{163,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurMP.Cfg2, EconomiseurHP2.Cfg1)           annotation (Line(
-      points={{283,-50},{363,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP2.Cfg2, EconomiseurMP.Cfg1)           annotation (Line(
-      points={{383,-50},{423,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurMP.Cfg2, EconomiseurHP1.Cfg1)           annotation (Line(
-      points={{443,-50},{483,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(GainChargeMP.C1, BallonMP.Cd)
-    annotation (Line(points={{325,-90},{335,-90},{335,10},{325,10}}, color={255,
-          128,0}));
-  connect(SurchauffeurMP2.Cfg2, SurchauffeurHP1.Cfg1)          annotation (Line(
-      points={{-137,-50},{-97,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP2.Cfg1, SurchauffeurHP2.Cfg2)           annotation (Line(
-      points={{-157,-50},{-197,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP3.Cfg2, SurchauffeurHP2.Cfg1)           annotation (Line(
-      points={{-257,-50},{-217,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurHP3.Cfg2, SurchauffeurMP3.Cfg1)           annotation (Line(
-      points={{-317,-50},{-277,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurMP3.Cws1,SurchauffeurMP2. Cws2)
-    annotation (Line(points={{-267,-30},{-267,10},{-147,10},{-147,-30}}, color=
-          {255,0,0}));
-  connect(SurchauffeurMP1.Cws2, MelangeurHPMP.Ce2) annotation (Line(
-      points={{113,-70},{113,-85},{115,-85},{115,-100}},
-      color={255,0,0},
-      pattern=LinePattern.None));
-  connect(vanne_vapeurBP.C1, BallonBP.Cv)
-    annotation (Line(points={{525,50},{545,50}}, color={255,0,0}));
-  connect(EvaporateurBP.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{533,-70},
-          {533,-90},{539,-90}},      color={255,128,0}));
-  connect(VolumeEvapBP.Ce1, GainChargeBP.C2)
-                                        annotation (Line(points={{559,-90},{567,
-          -90}}, color={255,128,0}));
-  connect(BallonBP.Cd, GainChargeBP.C1)
-                                       annotation (Line(points={{585,10},{595,
-          10},{595,-90},{587,-90}}, color={255,128,0}));
-  connect(EconomiseurBP.Cfg2, PuitsFumees.C)     annotation (Line(
-      points={{657,-50},{679,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP3.Cfg2, SurchauffeurBP.Cfg1)  annotation (Line(
-      points={{183,-50},{223,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(SurchauffeurBP.Cfg2, EvaporateurMP.Cfg1)  annotation (Line(
-      points={{243,-50},{263,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EconomiseurHP1.Cfg2, EvaporateurBP.Cfg1) annotation (Line(
-      points={{503,-50},{523,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(EvaporateurBP.Cfg2, EconomiseurBP.Cfg1) annotation (Line(
-      points={{543,-50},{637,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(BallonBP.Cm, EvaporateurBP.Cws2)
-    annotation (Line(points={{545,10},{533,10},{533,-30}}));
-  connect(vanne_vapeurMP.C1, BallonMP.Cv)   annotation (Line(points={{265,50},{
-          287,50}}, color={255,0,0}));
-  connect(Vanne_alimentationMPHP.Ouv, constante_ballonBP.y)
-    annotation (Line(points={{687,7},{687,12},{694.3,12}}));
-  connect(SurchauffeurHP3.Cws2, DoubleDebitHP.Ce)
-    annotation (Line(points={{-327,-70},{-327,-80},{-325,-80},{-325,-90}},
-        color={255,0,0}));
-  connect(SurchauffeurMP3.Cws2, DoubleDebitMP.Ce)
-    annotation (Line(points={{-267,-70},{-267,-80},{-265,-80},{-265,-90}},
-        color={255,0,0}));
-  connect(VolumeCond1.Cs, perteChargeKCond1.C1) annotation (Line(points={{869,
-          -308},{869,-282}}, color={0,0,255}));
-  connect(Vanne_alimentationMPHP.C2, VolumeAlimMPHP.Ce1)
-                                               annotation (Line(points={{697,-10},
-          {709,-10}},      color={0,0,255}));
-  connect(SurchauffeurBP.Cws2, DoubleDebitBP.Ce)
-    annotation (Line(points={{233,-70},{233,-80},{235,-80},{235,-90}}, color={
-          255,0,0}));
-  connect(perteChargeK8.C2, PompeAlimMP.C1)
-    annotation (Line(points={{757,-10},{764,-10},{771,-10}},           color={0,
-          0,255}));
-  connect(VolumeAlimMPHP.Cs1, perteChargeK8.C1)
-    annotation (Line(points={{729,-10},{733,-10},{737,-10}},           color={0,
-          0,255}));
-  connect(VolumeAlimMPHP.Cs2, perteChargeK3.C1)
-                                         annotation (Line(points={{719,-20},{
-          719,-50},{737,-50}}, color={0,0,255}));
-  connect(perteChargeK3.C2, PompeAlimHP.C1)
-    annotation (Line(points={{757,-50},{771,-50}}, color={0,0,255}));
-  connect(MelangeurPostTMP1.Ce2, PerteChargeZero2.C2) annotation (Line(points={{385,
-          -240},{385,-278},{321,-278}},      color={255,0,0}));
-  connect(perteChargeK.C2,PompeAlimBP. C1)
-                                         annotation (Line(points={{689,-436},{
-          709,-436}}, color={0,0,255}));
-  connect(vanne_extraction.C2, perteChargeK2.C1) annotation (Line(points={{789,
-          -436},{807,-436}}, color={0,0,255}));
-  connect(vanne_alimentationHP.C1, CapteurDebitEauHP.C2)
-    annotation (Line(points={{45,50},{53.3,50},{53.3,38.12}}));
-  connect(vanne_vapeurHP.C2, CapteurDebitVapHP.C1) annotation (Line(points={{-75,50},
-          {-86.2,50},{-86.2,14}},         color={255,0,0}));
-  connect(CapteurDebitVapHP.C2, SurchauffeurHP1.Cws1) annotation (Line(points={{-86.2,
-          1.88},{-86.2,-3.06},{-87,-3.06},{-87,-30}},        color={255,0,0}));
-  connect(vanne_alimentationMP.C1, CapteurDebitEauMP.C2)
-    annotation (Line(points={{365,50},{370.425,50},{370.425,50.4},{375.85,50.4}}));
-  connect(CapteurDebitVapMP.C1, vanne_vapeurMP.C2) annotation (Line(points={{211,
-          49.6},{227,49.6},{227,50},{245,50}},     color={255,0,0}));
-  connect(CapteurDebitVapMP.C2, SurchauffeurMP1.Cws1) annotation (Line(points={{194.84,
-          49.6},{113,49.6},{113,-30}},         color={255,0,0}));
-  connect(CapteurDebitVapBP.C2, SurchauffeurBP.Cws1) annotation (Line(points={{472.84,
-          49.6},{457,49.6},{457,-2},{233,-2},{233,-30}},        color={255,0,0}));
-  connect(CapteurDebitVapBP.C1, vanne_vapeurBP.C2) annotation (Line(points={{489,
-          49.6},{497,49.6},{497,50},{505,50}},     color={255,0,0}));
-  connect(CapteurDebitEauBP.C2, vanne_alimentationBP.C1) annotation (Line(
-        points={{625.3,40.12},{625.3,48},{617,48}}, color={0,0,255}));
-  connect(CapteurDebitEauBPsortie.C2, Vanne_alimentationMPHP.C1) annotation (Line(
-        points={{667.13,-9.8},{672.065,-9.8},{672.065,-10},{677,-10}}, color={0,
-          0,255}));
-  connect(CapteurDebitEauCondenseur.C2, perteChargeK.C1) annotation (Line(
-        points={{647.3,-422.2},{647.3,-436},{669,-436}}, color={0,0,255}));
-  connect(perteChargeK1.C2, CapteurDebitVapCondenseur.C1) annotation (Line(
-        points={{627,-230},{646.3,-230},{646.3,-254}}, color={255,0,0}));
-  connect(MelangeurHPMP.Ce1, MoitieDebitHP.Cs)
-    annotation (Line(points={{115,-120},{115,-170},{101,-170}}, color={255,0,0}));
-  connect(perteChargeK2.C2, MoitieDebitBP.Ce) annotation (Line(points={{827,
-          -436},{829,-436},{829,-318},{839,-318}}, color={0,0,255}));
-  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{853,-318},
-          {859,-318}}, color={0,0,255}));
-  connect(SurchauffeurMP2.Cws1, lumpedStraightPipeK2.C2)
-    annotation (Line(points={{-147,-70},{-147,-110},{61,-110}}, color={255,0,0}));
-  connect(lumpedStraightPipeK2.C1, MelangeurHPMP.Cs2)
-    annotation (Line(points={{81,-110},{105,-110}},    color={255,0,0}));
-  connect(DoubleDebitHP.Cs, vanne_entree_TurbineHP.C1) annotation (Line(points={{-325,
-          -110},{-325,-230},{-157,-230}},        color={255,0,0}));
-  connect(DoubleDebitBP.Cs, PerteChargeZero2.C1) annotation (Line(points={{235,
-          -110},{235,-278},{301,-278}}, color={255,0,0}));
-  connect(PompeAlimBP.C2, vanne_extraction.C1) annotation (Line(points={{729,
-          -436},{769,-436}}, color={0,0,255}));
-  connect(BallonHP.yLevel,regulation_Niveau_HP. MesureNiveauEau)
-    annotation (Line(points={{-37,30},{-101,30},{-101,125},{-73.5,125}}));
-  connect(regulation_Niveau_HP.SortieReelle1, vanne_alimentationHP.Ouv)
-    annotation (Line(points={{-52.5,107},{35,107},{35,67}}));
-  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
-    annotation (Line(points={{175.7,122},{201,122},{201,110},{228.5,110}}));
-  connect(BallonMP.yLevel,regulation_Niveau_MP. MesureNiveauEau)
-    annotation (Line(points={{285.1,30},{219,30},{219,125},{228.5,125}}));
-  connect(regulation_Niveau_MP.SortieReelle1, vanne_alimentationMP.Ouv)
-    annotation (Line(points={{249.5,107},{344.25,107},{344.25,67},{355,67}}));
-  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
-    annotation (Line(points={{472.7,135},{496.85,135},{496.85,112},{534.5,112}}));
-  connect(BallonBP.yLevel,regulation_Niveau_BP. MesureNiveauEau)
-    annotation (Line(points={{543,30},{485,30},{485,127},{534.5,127}}));
-  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
-    annotation (Line(points={{708.2,-238},{719,-238},{719,-269},{724.5,-269}}));
-  connect(regulation_Niveau_Condenseur.SortieReelle1, vanne_extraction.Ouv)
-    annotation (Line(points={{745.5,-281},{779,-281},{779,-419}}));
-  connect(CapteurDebitEauBP.C1, EconomiseurBP.Cws2)
-    annotation (Line(points={{625.3,28},{627,28},{627,6},{647,6},{647,-30}}));
-  connect(EconomiseurBP.Cws1, perteChargeKCond1.C2) annotation (Line(points={{647,-70},
-          {647,-186},{869,-186},{869,-258}}));
-  connect(CapteurDebitVapCondenseur.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
-    annotation (Line(points={{658.13,-264},{671,-264},{671,-280.9},{724.6,
-          -280.9}}));
-  connect(regulation_Niveau_Condenseur.MesureDebitEau,
-    CapteurDebitEauCondenseur.Measure) annotation (Line(points={{724.45,-274.95},
-          {717,-274.95},{717,-310},{759,-310},{759,-412},{659.13,-412}}));
-  connect(ConstantVanneTurbineHP.y, vanne_entree_TurbineHP.Ouv)
-    annotation (Line(points={{-167.5,-179},{-147,-179},{-147,-213}}));
-  connect(regulation_Niveau_BP.SortieReelle1, vanne_vapeurBP.Ouv)
-    annotation (Line(points={{555.5,109},{567,109},{567,90},{515,90},{515,67}}));
-  connect(vanne_alimentationBP.Ouv, constante_vanne_vapeurBP.y)
-    annotation (Line(points={{607,65},{607,81},{620.4,81}}));
-  connect(EconomiseurHP1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{493,-70},
-          {493,-88},{423,-88}},          color={0,0,255}));
-  connect(VolumeECO_HP1_2.Cs, EconomiseurHP2.Cws1) annotation (Line(points={{403,-88},
-          {373,-88},{373,-70}},          color={0,0,255}));
-  connect(EconomiseurHP2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{373,-30},
-          {373,-10},{219,-10}},          color={0,0,255}));
-  connect(VolumeECO_HP2_3.Cs, EconomiseurHP3.Cws1) annotation (Line(points={{199,-10},
-          {173,-10},{173,-30}},          color={0,0,255}));
-  connect(Vanne_alimentationMPHP1.C1, PompeAlimHP.C2)
-    annotation (Line(points={{721,-102.8},{809,-102.8},{809,-50},{791,-50}}));
-  connect(PompeAlimMP.C2, Vanne_alimentationMPHP2.C1) annotation (Line(points={{791,-10},
-          {837,-10},{837,-142.8},{771,-142.8}},           color={0,0,255}));
-  connect(arretPomesMp1.y, Vanne_alimentationMPHP1.Ouv)
-    annotation (Line(points={{873.1,-134},{823,-134},{823,-122},{709,-122},{709,
-          -123.2}}));
-  connect(arretPomesHP1.y, Vanne_alimentationMPHP2.Ouv)
-    annotation (Line(points={{873.1,-178},{850.05,-178},{850.05,-163.2},{759,
-          -163.2}}));
-  connect(Vanne_alimentationMPHP1.C2, EconomiseurHP1.Cws1) annotation (Line(
-        points={{697,-102.8},{603,-102.8},{603,-106},{515,-106},{515,-6},{493,
-          -6},{493,-30}}, color={0,0,255}));
-  connect(EconomiseurMP.Cws1, Vanne_alimentationMPHP2.C2)
-    annotation (Line(points={{433,-70},{433,-142.8},{747,-142.8}}));
-  connect(ConstantVanneTurbineMP.y, vanne_entree_TurbineMP.Ouv)
-    annotation (Line(points={{-167.5,-263},{-147,-263},{-147,-297}}));
-  connect(vanne_entree_TurbineHP.C2, VolumePreTHP.Ce) annotation (Line(points={{-137,
-          -230},{-95,-230}},       color={255,0,0}));
-  connect(DoubleDebitMP.Cs, vanne_entree_TurbineMP.C1) annotation (Line(points={{-265,
-          -110},{-265,-314},{-157,-314}},        color={255,0,0}));
-  connect(vanne_entree_TurbineMP.C2, MelangeurPreTMP.Ce1) annotation (Line(
-        points={{-137,-314},{-93,-314}}, color={255,0,0}));
-  connect(SourceCaloporteur.C, Condenseur.Cee) annotation (Line(points={{587,
-          -353},{605,-353},{605,-352.8},{604,-352.8}},
-                                                     color={0,0,255}));
-  connect(Condenseur.Cse, PuitsCaloporteur.C) annotation (Line(points={{684,
-          -352},{703,-352}}, color={0,0,255}));
-  connect(CapteurDebitVapCondenseur.C2, Condenseur.Cv) annotation (Line(points={{646.3,
-          -274.2},{646.3,-288.1},{644,-288.1},{644,-304}},         color={0,0,
-          255}));
-  connect(CapteurDebitEauCondenseur.C1, Condenseur.Cl)
-    annotation (Line(points={{647.3,-402},{644.8,-402},{644.8,-384}}));
-  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
-    annotation (Line(points={{-155.3,122},{-133,122},{-133,110},{-73.5,110}}));
-  connect(Condenseur.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
-    annotation (Line(points={{688,-372.8},{747,-372.8},{747,-326},{699,-326},{
-          699,-263},{724.5,-263}}));
-  connect(BallonBP.Cs, CapteurDebitEauBPsortie.C1) annotation (Line(points={{545,22},
-          {531,22},{531,16},{609,16},{609,-9.8},{654,-9.8}},         color={0,0,
-          255}));
-  connect(BallonBP.Ce1, vanne_alimentationBP.C2)
-    annotation (Line(points={{585,50},{591,50},{591,48},{597,48}}));
-  connect(BallonMP.Ce1, vanne_alimentationMP.C2)
-    annotation (Line(points={{325,50},{345,50}}));
-  connect(BallonHP.Ce1, vanne_alimentationHP.C2)
-    annotation (Line(points={{5,50},{25,50}}));
-  connect(TurbineHP.Cs, MoitieDebitHP.Ce) annotation (Line(points={{5.2,-230},{
-          41,-230},{41,-170},{81,-170}},   color={255,0,0}));
-  connect(VolumePreTHP.Cs3, TurbineHP.Ce) annotation (Line(points={{-75,-230},{
-          -35.2,-230}},color={255,0,0}));
-  connect(MelangeurPreTMP.Cs, TurbineMP.Ce) annotation (Line(points={{-73,-314},
-          {73,-314},{73,-230},{284.8,-230}},   color={255,0,0}));
-  connect(TurbineMP.Cs, MelangeurPostTMP1.Ce1) annotation (Line(points={{325.2,
-          -230},{375,-230}}, color={255,0,0}));
-  connect(MelangeurPostTMP1.Cs, TurbineBP.Ce) annotation (Line(points={{395,
-          -230},{542.8,-230}}, color={255,0,0}));
-  connect(TurbineBP.Cs, perteChargeK1.C1) annotation (Line(points={{583.2,-230},
-          {607,-230}}, color={255,0,0}));
-  connect(EconomiseurMP.Cws2, CapteurDebitEauMP.C1) annotation (Line(points={{433,-30},
-          {437,-30},{437,50.4},{391,50.4}},          color={0,0,255}));
-  connect(TurbineMP.MechPower, Alternateur.Wmec2)
-    annotation (Line(points={{327,-248},{335,-248},{335,-378},{369,-378}}));
-  connect(TurbineBP.MechPower, Alternateur.Wmec1) annotation (Line(points={{585,
-          -248},{595,-248},{595,-290},{355,-290},{355,-358},{369,-358}}));
-  connect(TurbineHP.MechPower, Alternateur.Wmec3)
-    annotation (Line(points={{7,-248},{15,-248},{15,-398},{369,-398}}));
-  connect(heatSource.C[1], BallonHP.Cex) annotation (Line(points={{-15,68.3},{
-          -15,50}},
-                color={191,95,0}));
-  connect(heatSource1.C[1], BallonMP.Cex) annotation (Line(points={{306,68.3},{
-          306,50}}, color={191,95,0}));
-  connect(heatSource2.C[1], BallonBP.Cex) annotation (Line(points={{565,64.3},{
-          565,50}}, color={191,95,0}));
-  connect(CapteurDebitEauHP.C1, EconomiseurHP4.Cws2)
-    annotation (Line(points={{53.3,26},{53,26},{53,-30}}, smooth=Smooth.None));
-  connect(PompeAlimMP.rpm_or_mpower, arretPomesMp.y)
-    annotation (Line(points={{781,-21},{781,-26},{871.1,-26}}, smooth=Smooth.None));
-  connect(PompeAlimHP.rpm_or_mpower, arretPomesHP.y)
-    annotation (Line(points={{781,-61},{781,-80},{872.1,-80}}, smooth=Smooth.None));
-  connect(PompeAlimBP.rpm_or_mpower, arretPomesBP.y) annotation (Line(points={{719,
-          -447},{721,-447},{721,-460},{845,-460},{845,-442},{872.1,-442}},
-        smooth=Smooth.None));
-  connect(SourceFumees.C, SurchauffeurHP3.Cfg1) annotation (Line(
-      points={{-371,-49},{-371,-50},{-337,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(Debit.y,SourceFumees. IMassFlow)
-    annotation (Line(points={{-453.5,18},{-422,18},{-422,-28}}));
-  connect(Temperature.y, SourceFumees.ISpecificEnthalpyOrTemperature)
-    annotation (Line(points={{-453.5,-120},{-422,-120},{-422,-70}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-560,-460},
-            {950,150}},
-        initialScale=0.1)),
-    experiment(StopTime=10000, Tolerance=0.001),
-    experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </h4>
-</html>"));
-end CombinedCycle_TripTAC;
+within ThermoSysPro.Fluid.Examples.CombinedCyclePowerPlant;
+model CombinedCycle_TripTAC "CCPP model to simulate a load variation from 100% to 50%"
+  parameter Real CstHP(fixed=false,start=7921079.316566086)
+    "Stodola's ellipse coefficient HP";
+  parameter Real CstMP(fixed=false,start=251309.80339850043)
+    "Stodola's ellipse coefficient MP";
+  parameter Real CstBP(fixed=false,start=10675.291494903773)
+    "Stodola's ellipse coefficient BP";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed=false, start=135)
+    "Maximum CV: alim. valve HP Drum  ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed=false, start=70)
+    "Maximum CV: alim. valve MP Drum ";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed=false, start=32000)
+    "Maximum CV: steam valve BP Drum ";
+  parameter Real Encras_SHP1(fixed=false,start=1)
+    "Sur HP1: heat exchange fouling coefficient";
+  parameter Real Encras_SHP2(fixed=false,start=1)
+    "Sur HP2: heat exchange fouling coefficient";
+  parameter Real Encras_SHP3(fixed=false,start=1)
+    "Sur HP3: heat exchange fouling coefficient";
+  parameter Real Encras_EHP1(fixed=false,start=1)
+    "Eco HP1: heat exchange fouling coefficient";
+  parameter Real Encras_EHP2(fixed=false,start=1)
+    "Eco HP2: heat exchange fouling coefficient";
+  parameter Real Encras_EHP3(fixed=false,start=1)
+    "Eco HP3: heat exchange fouling coefficient";
+  parameter Real Encras_EHP4(fixed=false,start=1)
+    "Eco HP4: heat exchange fouling coefficient";
+
+  parameter Real Encras_SMP1(fixed=false,start=1)
+    "Sur MP1: heat exchange fouling coefficient";
+  parameter Real Encras_SMP2(fixed=false,start=1)
+    "Sur MP2: heat exchange fouling coefficient";
+  parameter Real Encras_SMP3(fixed=false,start=1)
+    "Sur MP3: heat exchange fouling coefficient";
+  parameter Real Encras_EMP(fixed=false,start=1)
+    "Eco MP: heat exchange fouling coefficient";
+
+  parameter Real Encras_EvHP(fixed=false,start=1)
+    "Evapo HP: heat exchange fouling coefficient";
+  parameter Real Encras_EvMP(fixed=false,start=1)
+    "Evapo MP: heat exchange fouling coefficient";
+  parameter Real Encras_EvBP(fixed=false,start=1)
+    "Evapo BP: heat exchange fouling coefficient";
+
+  parameter Real Encras_SBP(fixed=false,start=1)
+    "Sur BP: heat exchange fouling coefficient";
+  parameter Real Encras_EBP(fixed=false,start=1)
+    "Eco BP: heat exchange fouling coefficient";
+
+  parameter Real KgainChargeHP(fixed=false,start=720.183)
+    "HP: Friction pressure loss coefficient";
+  parameter Real KgainChargeMP(fixed=false,start=1090.9)
+    "MP: Friction pressure loss coefficient";
+  parameter Real Kin_SMP2(fixed=false,start=10.)
+    "SMPin: Friction pressure loss coefficient";
+  parameter Real K_PerteChargeZero2(fixed=false,start=1e-4)
+    "TurbineMP out: Friction pressure loss coefficient";
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed=false, start=8000)
+    "Maximum CV input Turbine HP ";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed=false, start=1500)
+    "Maximum CV input Turbine MP ";
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(
+    L=16.27,
+    Vertical=false,
+    hl(fixed=false, start=1460508.128907675),
+    hv(fixed=false, start=2664791.3052738607),
+    Vv(fixed=false),
+    R=1.05,
+    xmv(fixed=false),
+    zl(start=1.05, fixed=true),
+    Mp=5000,
+    Kpa=5,
+    Kvl=1000,
+    P(fixed=false, start=12726424.235625941),
+    Pfond(start=12733333.038455429),
+    Tp(start=589.5151351323206))
+                     annotation (Placement(transformation(extent={{5,10},{-35,
+            50}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(
+      Cvmax=CvmaxValveAHP,
+    C1(P(start=13394232.807871036),
+    h_vol_2(start=1399087.0448386343)),
+    h(start=1398000),
+    Cv(start=178),
+    Pm(start=13050700))
+                 annotation (Placement(transformation(extent={{45,46},{25,66}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurHP(k=0.5)
+    annotation (Placement(transformation(extent={{-51,70},{-61,78}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(
+    Cvmax=47829.4,
+    C2(h_vol_1(start=2664791.3052738607)),
+    h(start=2674000),
+    Cv(start=23914.7),
+    Pm(start=12724920.902023433))
+                 annotation (Placement(transformation(extent={{-55,46},{-75,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(
+    z2=0,
+    Q(start=150, fixed=true),
+    z1=10.83,
+    K=KgainChargeHP,
+    C2(P(start=12757776.366696326)),
+    h(start=1474422.14552527),
+    Pm(start=12704000),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+            annotation (Placement(transformation(
+        origin={-5,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(V=5,
+    h(start=1460508.128907675),
+    P(start=12704000),
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam)
+                                           annotation (Placement(transformation(
+          extent={{-25,-100},{-45,-80}},
+                                       rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EvaporateurHP(
+    Dint=32.8e-3,
+    Ntubes=1476,
+    L=20.7,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-5.74e7,-2.67e7,-1.24e7}),
+      Tp(start={607.95945081921,605.4313602675011,604.0450760348469}),
+      Tp1(start={606.5065615724875,604.7563153894058,603.7327223072098})),
+    Ns=3,
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.092,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      K(fixed=true, start=37.69),
+      CSailettes=11.86442072,
+      p_rho=1.05,
+      Encras=Encras_EvHP,
+      deltaT(start={106,49,23}),
+      T2(start={755.2099609375,674.1281000784297,635.8939469832528,
+            618.0787353515625}),
+      T1(start={714.669037024263,655.0110235308413,626.9863546635906}),
+      Tp(start={609.3093210980612,606.0585402262541,604.3352819224443})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=10.83,
+      option_temperature=false,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={5.74e7,2.67e7,1.24e7}),
+      h(start={1460508.125,1842386.3805685563,2019815.5675635953,
+            2101914.802366878,1460508.125}),
+      hb(start={1459929.875,1760591.32331318,1893494.15765019,1954976.19646134}),
+      P(start={12757776.0,12739926.315661393,12734300.718607338,
+            12730145.067304946,12726424.0})))
+                          annotation (Placement(transformation(
+        origin={-47,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurHP4(
+    Ns=3,
+    L=20.726,
+    Dint=0.0266,
+    Ntubes=246,
+    ExchangerWall(e=0.0026, lambda=47,
+      dW1(start={-3.5e6,-2.63e6,-2e6}),
+      Tp(start={577.1652678885227,582.2393934514894,585.9616914189281}),
+      Tp1(start={576.5195841307088,581.753378536046,585.5943808718256})),
+    Cws1(P(start=13320777.811415095),
+    h_vol_2(start=1292777.0058783418)),
+    Cws2(h_vol_1(start=1399087.0448386343)),
+    ExchangerFlueGasesMetal(
+      Dext=0.0318,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=11.39069779,
+      K(fixed=true, start=47.53),
+      p_rho=1.06,
+      Encras=Encras_EHP4,
+      deltaT(start={38,29,22}),
+      T2(start={618.0787353515625,613.037602447671,609.2389186305828,
+            606.3656616210938}),
+      T1(start={615.5581823957998,611.1382605391269,607.8022941316214}),
+      Tp(start={577.7558398657263,582.6839249827347,586.2976504908789})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      z2=0,
+      option_temperature=false,
+      inertia=true,
+      dW1(start={3.5e6,2.63e6,2e6}),
+      h(start={1292777.0,1338569.0293807227,1373037.3060893763,
+            1399087.0448386343,1399087.0}),
+      hb(start={1291418.875,1336078.18827954,1370718.78680301,1396865.59043578}),
+      P(start={13320778.0,13339750.403131645,13358253.29250947,
+            13376387.23615858,13394233.0})))
+                          annotation (Placement(transformation(
+        origin={53,-50},
+        extent={{20,20},{-20,-20}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurHP1(
+    Ns=3,
+    L=20.4,
+    Dint=0.0324,
+    Ntubes=246,
+    ExchangerWall(e=0.0028, lambda=37.61,
+    dW1(start={-9.8e6,-7.7e6,-5.9e6}),
+      Tp(start={641.7766266045941,659.2542181292313,674.5323393956571}),
+      Tp1(start={639.7295258289556,657.6427819154001,673.2854985024741})),
+    Cws1(h_vol_2(start=2664791.3052738607)),
+    Cws2(P(start=12720084.224503415),
+      h_vol_1(start=2973079.185217006)),
+    ExchangerFlueGasesMetal(
+      Dext=0.038,
+      step_L=0.111,
+      step_T=0.0869,
+      St=1,
+      Fa=1,
+      CSailettes=10.25056,
+      K(fixed=true, start=34.71),
+      p_rho=1.04,
+      Encras=Encras_SHP1,
+      deltaT(start={138,108,84}),
+      T2(start={787.8693237304688,774.2709985521502,763.5355376271307,
+            755.2099609375}),
+      T1(start={781.0701669240514,768.9032680896405,759.3727557986135}),
+      Tp(start={643.6669592742874,660.7422496694279,675.683696525852})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.83,
+      option_temperature=false,
+      inertia=true,
+      dW1(start={9.8e6,7.7e6,5.9e6}),
+      h(start={2664791.25,2793445.279188231,2894719.078252342,2973079.185217006,
+            2973079.25}),
+      hb(start={2664757.0,2808108.09290342,2916825.81170239,2998229.34382983}),
+      P(start={12723418.0,12723372.064267773,12722706.076957166,
+            12721569.805902744,12720084.0})))
+                          annotation (Placement(transformation(
+        origin={-87,-50},
+        extent={{-20,20},{20,-20}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurHP3(
+    Dint=26.6e-3,
+    Ntubes=1476,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+      dW1(start={-1.6e7,-5.6e6,-2.1e6}),
+      Tp(start={557.1357570088924,563.7223638401374,566.037182893163}),
+      Tp1(start={556.657781456147,563.5505466405001,565.9750435970707})),
+    L=20.726,
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=12.451,
+      K(fixed=true, start=36.0300000000857),
+      p_rho=1.08,
+      Encras=Encras_EHP3,
+      St=5, deltaT(start={34,12,4.4}),
+      T2(start={602.606689453125,580.0827929934445,571.956039969206,
+            569.0130004882813}),
+      T1(start={591.3447334381658,576.0194164813253,570.4845269121585}),
+      Tp(start={557.5729353703138,563.879515730797,566.0940183432008})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.6e7,5.6e6,2.1e6}),
+      h(start={989834.8125,1193223.55215195,1266335.416732016,
+            1292777.0058783418,1292777.0}),
+      hb(start={986348.9375,1189594.8774342,1263384.6284551,1290000.70037855}),
+      P(start={13239006.0,13261089.90163249,13281516.713631846,
+            13301273.845180616,13320778.0})))
+                  annotation (Placement(transformation(
+        origin={173,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurHP2(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+      dW1(start={-5e6,-3e6,-2.e6}),
+      Tp(start={492.5265031447411,499.7298617398276,504.2372403374727}),
+      Tp1(start={492.3269425182926,499.6044056390882,504.15828372038055})),
+    L=20.767,
+    Ntubes=1107,
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=111e-3,
+      CSailettes=2.76134577,
+      K(fixed=true, start=65.5300000000393),
+      p_rho=1.11,
+      Encras=Encras_EHP2,
+      St=5, deltaT(start={36,23,14}),
+      T2(start={531.2528686523438,524.0786479337396,519.5624877991071,
+            516.7178344726563}),
+      T1(start={527.6657680129605,521.8205678664233,518.1401706426662}),
+      Tp(start={492.70903044592376,499.8446096432236,504.3094576805689})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.767,
+      inertia=true,
+      dW1(start={5e6,3e6,2.e6}),
+      h(start={860655.375,924469.2991480937,964586.6772085332,989834.8113335292,
+            989834.8125}),
+      hb(start={854494.5625,915007.018247822,957243.396653824,983786.364226731}),
+      P(start={13149154.0,13172140.227906534,13194684.103908138,
+            13216938.318123804,13239006.0})))
+                  annotation (Placement(transformation(
+        origin={373,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurHP1(
+    Dint=26.6e-3,
+    Ns=3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+              dW1(start={-9.9999e6,-5e6,-2.4e6}),
+      Tp(start={461.83700038875077,471.4458881656956,476.1007075853514}),
+      Tp1(start={461.41562496249884,471.24253667400546,476.002824325766})),
+    L=20.726,
+    Ntubes=1107,
+    Cws1(h_vol_2(start=630040.8772883223)),
+    ExchangerFlueGasesMetal(
+      Dext=31.8e-3,
+      step_L=74e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=8.30057632,
+      K(fixed=true, start=40.24),
+      p_rho=1.13,
+      Encras=Encras_EHP1,
+      St=5,   deltaT(start={41,20,10}),
+      T2(start={509.81195068359375,494.60709242744036,487.25141439639447,
+            483.7066345214844}),
+      T1(start={502.2095163065458,490.92925341191744,485.4790272730564}),
+      Tp(start={462.22240967868714,471.63188276609173,476.1902361036878})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.767,
+      inertia=true,
+      dW1(start={9.9999e6,5e6,2.4e6}),
+      h(start={630040.875,764519.0167009356,829416.7979796123,860655.3510811749,
+            860655.375}),
+      hb(start={618651.9375,752176.893518976,816707.727773953,847728.424287614}),
+      advection=true,
+      dynamic_mass_balance=true,
+      P(start={13054959.0,13079363.233486831,13102973.863543343,
+            13126167.933420062,13149154.0})))
+                  annotation (Placement(transformation(
+        origin={493,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurHP2(
+    Ns=3,
+    L=20.4,
+    Dint=32e-3,
+    Ntubes=246,
+    ExchangerWall(e=3e-3, lambda=27,
+      dW1(start={-8.8e6,-6.6e6,-4.9e6}),
+      Tp(start={718.0595138013858,738.8988421059552,755.1216906441867}),
+      Tp1(start={715.284148781996,736.8146275114044,753.568899547355})),
+    Cws2(P(start=12710803.048741188),
+                               h_vol_1(start=3240679.101987554)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      K(fixed=true, start=34.74),
+      CSailettes=10.2505424803872,
+      p_rho=1.02,
+      Encras=Encras_SHP2,
+      St=5,
+      deltaT(start={124,93,70}),
+      T2(start={850.2295532226563,838.165359685431,829.0838172755421,
+            822.3056030273438}),
+      T1(start={844.1974477839519,833.6245884804865,825.6946997760892}),
+      Tp(start={720.6064978764006,740.8115495674804,756.5467047118})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.83,
+      inertia=true,
+      dW1(start={8.8e6,6.6e6,4.9e6}),
+      h(start={2973079.25,3088900.225778996,3175878.2994419048,
+            3240679.101987554,3240679.0}),
+      hb(start={2973076.25,3118965.9792171,3205920.08101435,3268474.17308722}),
+      P(start={12720084.0,12718408.787041187,12716215.067117244,
+            12713645.694467228,12710803.0})))
+                  annotation (Placement(transformation(
+        origin={-207,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurHP3(
+    Ns=3,
+    L=20.4,
+    Ntubes=246,
+    ExchangerWall(lambda=27, e=5e-3,
+    dW1(start={-6.3e6,-4.7e6,-3.6e6}),
+      Tp(start={789.2881838358564,806.7088039780044,819.9912755140301}),
+      Tp1(start={785.6370057524725,803.9662515359148,817.9384055160485})),
+    Dint=28e-3,
+    Cws2(h_vol_1(start=3432930.991856911)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=111e-3,
+      K(fixed=true, start=49.33),
+      CSailettes=6.59672842597229,
+      p_rho=1,
+      Encras=Encras_SHP3,
+      St=5,
+      deltaT(start={97,73,55}),
+      T2(start={893.75,885.1796729176981,878.7316754228791,873.8992309570313}),
+      T1(start={889.464836458849,881.9556741702886,876.315464574507}),
+      Tp(start={792.4232630808997,809.0636930146954,821.7539696298131})),
+    TwoPhaseFlowPipe(
+      rugosrel=5e-6,
+      z2=0,
+      advection=false,
+      z1=10.726,
+      inertia=true,
+      dW1(start={6.3e6,4.7e6,3.6e6}),
+      h(start={3240679.0,3323783.054261407,3386205.9057494565,3432930.991856911,
+            3432931.0}),
+      hb(start={3240813.5,3348361.34780186,3407279.82422176,3450835.48993987}),
+      P(start={12710803.0,12704112.803652512,12696819.484746953,
+            12689077.136342296,12681000.0})))
+                  annotation (Placement(transformation(
+        origin={-327,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(
+    L=16.27,
+    Vertical=false,
+    P0=27.29e5,
+    hl(fixed=false, start=980960.1562978515),
+    hv(fixed=false, start=2798761.3254371085),
+    Vv(fixed=false),
+    R=1.05,
+    P(fixed=false, start=2733918.2848144253),
+    zl(start=1.05, fixed=true),
+    Kpa=5,
+    Mp=5000,
+    Kvl=1000,
+    Pfond(start=2742462.980913138),
+    Tp(start=497.4249792990277))
+                     annotation (Placement(transformation(extent={{325,10},{287,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurMP(k=0.5)
+    annotation (Placement(transformation(extent={{271,70},{259,80}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(
+      Cvmax=CvmaxValveAMP,
+    C1(P(start=3253417.522956237),
+    h_vol_2(start=947830.5281155076)),
+    h(start=944000),
+    Cv(start=28),
+    Pm(start=2975000))
+                 annotation (Placement(transformation(extent={{365,46},{345,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(
+    Cvmax=47829.4,
+    C2(h_vol_1(start=2798761.3254371085)),
+    h(fixed=false, start=2798000),
+    Cv(start=23914.7),
+    Pm(fixed=false, start=2732653.9482791456))
+                 annotation (Placement(transformation(extent={{265,46},{245,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EvaporateurMP(
+    Dint=32.8e-3,
+    L=20.767,
+    Ntubes=738,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-9.7e7,-7.6e6,-5.8e6}),
+      Tp(start={504.9993271430632,504.2768804788304,503.69756244079724}),
+      Tp1(start={504.503193578626,503.89321384657916,503.40091865289605})),
+    Ns=3,
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.83,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={9.7e7,7.6e6,5.8e6}),
+      P(start={2773378.75,2751240.3575119935,2743530.0500684776,
+            2738283.631137228,2733918.25}),
+      h(start={980960.1875,1046373.213452734,1096957.9937272775,
+            1136069.1896699532,980960.1875}),
+      hb(start={980708.125,1028103.09460604,1066178.43156513,1095633.31556464})),
+    Cws1(P(start=2773378.6567335734)),
+    ExchangerFlueGasesMetal(
+      K(fixed=true, start=30.22),
+      Dext=38e-3,
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      CSailettes=10.0676093,
+      p_rho=1.1,
+      Encras=Encras_EvMP,
+      St=5,
+      deltaT(start={53,41,32}),
+      T2(start={565.5570068359375,551.1237970278224,539.9287004763471,
+            531.2528686523438}),
+      T1(start={558.3404164937012,545.5262487520847,535.5907942842642}),
+      Tp(start={505.4602817233831,504.6333427384495,503.9731723219999})))
+                          annotation (Placement(transformation(
+        origin={273,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(
+    z2=0,
+    z1=10.83,
+    Q(start=150, fixed=true),
+    K=KgainChargeMP,
+    Pm(start=2734000),
+    h(start=978914.570821827),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+            annotation (Placement(transformation(
+        origin={315,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(V=5,
+    h(start=980960.1562978515),
+    P(start=2734000),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                           annotation (Placement(transformation(
+          extent={{295,-100},{275,-80}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurMP(
+    ExchangerWall(e=2.6e-3, lambda=47,
+        dW1(start={-3e6,-1.4e6,-740379}),
+      Tp(start={470.48677107325835,488.1938632909576,497.65207032563256}),
+      Tp1(start={470.01280565475304,487.9402946158829,497.51626768286917})),
+    L=20.726,
+    Ns=3,
+    Dint=26.6e-3,
+    Ntubes=246,
+    Cws1(h_vol_2(start=576430.3612424443)),
+    Cws2(h_vol_1(start=947830.5281155076)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      K(fixed=true, start=47.78),
+      CSailettes=7.16188651,
+      p_rho=1.12,
+      Encras=Encras_EMP,
+      St=5,
+      deltaT(start={45,24,13}),
+      T2(start={516.7178344726563,512.927875284067,510.89894284399503,
+            509.81195068359375}),
+      T1(start={514.8228643851462,511.91340906403104,510.35544151482316}),
+      Tp(start={470.920281581991,488.4257888303293,497.7762816508864})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=10.767,
+      z2=0,
+      inertia=true,
+      dW1(start={3e6,1.4e6,740379}),
+      h(start={576430.375,780326.2782299566,889409.3790325949,947830.5281155076,
+            947830.5}),
+      hb(start={565108.5,727745.440528479,829820.124314816,892414.570867187}),
+      P(start={3160828.5,3185369.6108956896,3208693.506993564,
+            3231270.1974957627,3253417.5})))
+                          annotation (Placement(transformation(
+        origin={433,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurMP1(
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.3e6,-0.80263e6,
+                                -501864}),
+      Tp(start={558.0934551632172,574.0136440053798,584.242260992374}),
+      Tp1(start={557.706011115662,573.7688585895307,584.0889760553388})),
+    L=20.726,
+    Ns=3,
+    Dint=32.8e-3,
+    Ntubes=123,
+    Cws1(h_vol_2(start=2798761.3254371085)),
+    ExchangerFlueGasesMetal(
+      step_L=111e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=31.8e-3,
+      K(fixed=true, start=22.09),
+      CSailettes=14.46509765,
+      p_rho=1.07,
+      Encras=Encras_SMP1,
+      St=5,
+      deltaT(start={45,30,19}),
+      T2(start={606.3656616210938,604.5120304885253,603.3404748736327,
+            602.606689453125}),
+      T1(start={605.4388500605926,603.926252681079,602.9735743782599}),
+      Tp(start={558.4534269956265,574.2410725985397,584.3846770655402})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z2=0,
+      z1=10.77,
+      inertia=true,
+      dW1(start={1.3e6,0.80263e6,501864}),
+      h(start={2798761.25,2900642.773718668,2965011.0169332824,
+            3005318.492253628,3040245.5}),
+      hb(start={2798574.75,2904836.50693844,2969862.15109307,3009575.30461156}),
+      P(start={2731389.5,2730444.2277886732,2729310.613093969,
+            2728046.4038641006,2726700.0})))
+                          annotation (Placement(transformation(
+        origin={113,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(
+    Ce1(h(start=3046003.380872726)),
+    h(start=3040245.422545259),
+    P(start=2726000))
+    annotation (Placement(transformation(
+        origin={115,-110},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurMP2(
+    Ns=3,
+    L=20.4,
+    Dint=39.3e-3,
+    Ntubes=369,
+    ExchangerWall(e=2.6e-3, lambda=36.86,
+    dW1(start={-1.15e7,-7.9e6,-5.5e6}),
+      Tp(start={688.9747491924221,714.1387227867799,731.7594455240543}),
+      Tp1(start={687.7117385985722,713.2642402785228,731.156085252147})),
+    Cws1(P(start=2575477.4929098235),
+      h_vol_2(start=3040245.422545259)),
+    Cws2(P(start=2558200.620927911),
+      h_vol_1(start=3321522.540904887)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=92e-3,
+      K(fixed=true, start=45.22),
+      CSailettes=5.814209831,
+      p_rho=1.03,
+      Encras=Encras_SMP2,
+      St=5,
+      deltaT(start={125,86,60}),
+      T2(start={822.3056030273438,806.4713844816748,795.4738313791455,
+            787.8693237304688}),
+      T1(start={814.3884833791556,800.9726079304102,791.671583337549}),
+      Tp(start={690.1616978609907,714.9605415853846,732.3264698030932})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dW1(start={1.15e7,7.9e6,5.5e6}),
+      h(start={3040245.5,3169860.5211362485,3259603.344415277,3321522.540904887,
+            3321522.5}),
+      hb(start={3040562.25,3176242.27636476,3267406.25678814,3329559.35651389}),
+      P(start={2575477.5,2571810.3704688977,2567607.9202979314,
+            2563033.661146952,2558200.5})))
+                          annotation (Placement(transformation(
+        origin={-147,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurMP3(
+    Ns=3,
+    L=20.4,
+    Ntubes=369,
+    Dint=45.6e-3,
+    ExchangerWall(e=2.6e-3, lambda=27,
+    dW1(start={-8e6,-5.5e6,-3.8e6}),
+      Tp(start={786.0003533757151,802.6089712721623,814.0750543986999}),
+      Tp1(start={784.9544439166481,801.8912118855588,813.583437630984})),
+    Cws2(h_vol_1(start=3517381.1285517)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=92e-3,
+      Dext=50.8e-3,
+      K(fixed=true, start=43.23),
+      CSailettes=5.695842178,
+      p_rho=1.01,
+      Encras=Encras_SMP3,
+      St=5,
+      deltaT(start={82,56,38}),
+      T2(start={873.8992309570313,862.9376291442026,855.3997728669909,
+            850.2295532226563}),
+      T1(start={868.4184414351687,859.1687010055967,852.814654374732}),
+      Tp(start={786.9913001992309,803.2890123388494,814.5408366613608})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      z1=10.83,
+      rugosrel=1e-5,
+      inertia=true,
+      dW1(start={8e6,5.5e6,3.8e6}),
+      h(start={3321522.5,3412353.763453483,3474687.0390689597,3517381.1285517,
+            3517381.25}),
+      hb(start={3321940.75,3420707.89900972,3482716.02631475,3524890.37222916}),
+      P(start={2558200.5,2556022.8892716086,2553661.4076231164,
+            2551174.061990546,2548600.0})))
+                          annotation (Placement(transformation(
+        origin={-267,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(
+    Vertical=false,
+    P0=5e5,
+    Vv(fixed=false),
+    L=8,
+    hl(fixed=false, start=561432.6820300646),
+    hv(fixed=false, start=2682927.2097681486),
+    R=2,
+    P(fixed=false, start=536006.6647383622),
+    zl(start=1.75, fixed=true),
+    Kpa=5,
+    Mp=5000,
+    Kvl=1000,
+    Pfond(start=552000.8087452435),
+    Tp(start=409.09918124890646))
+                     annotation (Placement(transformation(extent={{585,10},{545,
+            50}}, rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_vanne_vapeurBP(k=0.5)
+    annotation (Placement(transformation(extent={{633,76},{621,86}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(
+    p_rho=3, Cvmax=CvmaxValveVBP,
+    C2(P(start=509651.8053666252),
+    h_vol_1(start=2682927.2097681486)),
+    h(start=2685000),
+    Cv(start=1),
+    Pm(start=498000))
+                 annotation (Placement(transformation(extent={{525,46},{505,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(
+    Cvmax=285,
+    C1(h_vol_2(start=517521.1338868904)),
+    h(fixed=false, start=509000),
+    Cv(start=142.5),
+    Pm(fixed=false, start=1001940.4305634197))
+                 annotation (Placement(transformation(extent={{617,44},{597,64}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(
+    z2=0,
+    z1=10.767,
+    Q(start=50, fixed=false),
+    K=32766,
+    rho(start=931.9744461081724),
+    Pm(start=564000),
+    h(start=549249.519022482),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+            annotation (Placement(transformation(
+        origin={577,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(h(start=561432.682030064),
+    V=5,
+    P(start=564000),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                           annotation (Placement(transformation(
+          extent={{559,-100},{539,-80}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EvaporateurBP(
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.24e7,-8.5e6,-5.8e6}),
+      Tp(start={431.3608522222893,430.24126699702373,429.39686929842486}),
+      Tp1(start={430.9104943759602,429.93425668934924,429.1871126238492})),
+    L=20.726,
+    Ntubes=984,
+    Ns=3,
+    ExchangerFlueGasesMetal(
+      Dext=38e-3,
+      step_T=86.9e-3,
+      Fa=1,
+      step_L=138e-3,
+      K(fixed=true, start=30.62),
+      CSailettes=11.07985,
+      p_rho=1.14,
+      Encras=Encras_EvBP,
+      St=5,
+      deltaT(start={45,31,21}),
+      T2(start={483.7066345214844,465.9440370193418,453.7982409323057,
+            445.483154296875}),
+      T1(start={474.8253385845301,459.8711389758238,449.6406958379268}),
+      Tp(start={431.7792768702483,430.5265083466735,429.59175290805825})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      continuous_flow_reversal=true,
+      inertia=true,
+      dW1(start={1.24e7,8.5e6,5.8e6}),
+      h(start={561432.6875,799363.0194709267,961560.8510406071,
+            1072378.2305328134,561432.6875}),
+      hb(start={550075.0,765243.011613326,912673.256542569,1013555.73710231}),
+      Q(start={49.81331881379377,49.81331881379377,49.81331881379377,
+            49.81331881379377}),
+      P(start={563167.375,538556.7569255093,537410.7752779912,536682.3739734262,
+            536006.6875})))
+                          annotation (Placement(transformation(
+        origin={533,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    constante_ballonBP(k=1)
+    annotation (Placement(transformation(extent={{709,6},{695,18}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(
+    Cvmax=308.931,
+    C1(h_vol_2(start=561432.6820300646)),
+    h(start=550000),
+    Cv(start=308.931),
+    Pm(start=454319.5384961263),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                 annotation (Placement(transformation(extent={{677,-14},{697,6}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    SurchauffeurBP(
+    Ns=3,
+    L=20.726,
+    Dint=39.3e-3,
+    Ntubes=123,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-1.1e6,-782901,-559798}),
+      Tp(start={477.52260500819597,502.61487297914,520.6394670364305}),
+      Tp1(start={477.2504107508904,502.4219869045609,520.5035062463255})),
+    Cws1(h_vol_2(start=2682927.2097681486)),
+    Cws2(h_vol_1(start=2919992.1127030067)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=44.5e-3,
+      step_L=222.1e-3,
+      K(fixed=true, start=30.46),
+      CSailettes=3.25763059984175,
+      p_rho=1.09,
+      Encras=Encras_SBP,
+      St=5,
+      deltaT(start={92,66,47}),
+      T2(start={569.0130004882813,567.4482541171128,566.3390581546068,
+            565.5570068359375}),
+      T1(start={568.2306339861118,566.8936561358598,565.9480470570934}),
+      Tp(start={477.77840698873644,502.79614293098246,520.7672398988061})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      z2=0,
+      rugosrel=1e-5,
+      z1=10.767,
+      inertia=true,
+      dW1(start={1.1e6,782901,559798}),
+      h(start={2682927.25,2790287.093854774,2866365.945824299,
+            2919992.1127030067,2919992.0}),
+      hb(start={2684673.5,2819292.38908571,2893584.12921908,2943776.05560762}),
+      P(start={509651.8125,507980.5977658856,506129.5447082628,
+            504067.5333025372,501850.0})))
+                          annotation (Placement(transformation(
+        origin={233,-50},
+        extent={{20,-20},{-20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5)
+    annotation (Placement(transformation(
+        origin={689,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger
+    EconomiseurBP(
+    Ns=3,
+    Dint=32.8e-3,
+    ExchangerWall(e=2.6e-3, lambda=47,
+    dW1(start={-2.45e7,-5.5e6,-1.17e6}),
+      Tp(start={402.39147626030376,398.05961040088295,397.171667377241}),
+      Tp1(start={402.1199525074059,397.9993065179613,397.15885396154556})),
+    Ntubes=3444,
+    L=20.726,
+    Cws1(h_vol_2(start=194669.37425632242)),
+    Cws2(h_vol_1(start=517521.1338868904)),
+    ExchangerFlueGasesMetal(
+      step_T=86.9e-3,
+      Fa=1,
+      Dext=38e-3,
+      step_L=92e-3,
+      K(fixed=true, start=31.53),
+      CSailettes=11.673758598919,
+      p_rho=1.15,
+      Encras=Encras_EBP,
+      St=5,
+      deltaT(start={23.5,5.3,1.1}),
+      T2(start={445.483154296875,407.64728846356843,399.20963445670407,
+            397.4152526855469}),
+      T1(start={426.56521960355815,403.42846146013625,398.31244500376624}),
+      Tp(start={402.64374727467464,398.11563835995787,397.18357224132967})),
+    TwoPhaseFlowPipe(
+      advection=false,
+      rugosrel=5e-6,
+      z1=0,
+      z2=10.767,
+      inertia=true,
+      dW1(start={2.45e7,5.5e6,1.17e6}),
+      h(start={194669.375,449026.540992922,505517.82265620184,517521.1338868904,
+            517521.125}),
+      hb(start={194584.515625,462556.370989432,494648.45288738,501287.069880104}),
+      P(start={1578579.375,1542823.2506358635,1517636.5908885582,
+            1492724.792065889,1467874.25})))
+                          annotation (Placement(transformation(
+        origin={647,-50},
+        extent={{-20,-20},{20,20}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.88057),
+    Qmax=140,
+    eta_is_nom=0.88057,
+    eta_is_min=0.75,
+    Cst(start=8182844.56002535)=CstHP,
+    pros(d(start=10.66670150764929)),
+    Hrs(start=3046003.380872726),
+    Pe(fixed=true, start=12431000),
+    Ps(fixed=false, start=2726700))
+              annotation (Placement(transformation(extent={{-35,-250},{5,-210}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9625),
+    Qmax=150,
+    eta_is_nom=0.9625,
+    eta_is_min=0.75,
+    Cst(start=256335.364995961)=
+        CstMP,
+    pros(d(start=1.883484197675123)),
+    Hrs(start=3029367.6706168973),
+    Pe(fixed=true, start=2548500),
+    Ps(fixed=false, start=476800))
+                annotation (Placement(transformation(extent={{285,-250},{325,
+            -210}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(
+    h(start=3018320.043117248),
+    P(start=476799.99999954),
+    Ce1(h(start=3029780)))                 annotation (Placement(transformation(
+        origin={385,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(
+    W_fric=1,
+    eta_stato=1,
+    eta_is(start=0.9538),
+    Qmax=150,
+    eta_is_nom=0.9538,
+    eta_is_min=0.75,
+    Cst(start=11944.9445735985)=CstBP,
+    Cs(h(start=2401478.8015108025)),
+    Hrs(start=2401030),
+    Pe(fixed=true, start=476799.99999954),
+    Ps(start=10053))
+                annotation (Placement(transformation(extent={{543,-250},{583,
+            -210}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(alpha=2)
+    annotation (Placement(transformation(
+        origin={-325,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(alpha=2)
+    annotation (Placement(transformation(
+        origin={-265,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(
+    alpha=0.5,
+    Ce(h(start=3046260)),
+    P(start=2726700))
+    annotation (Placement(transformation(extent={{81,-180},{101,-160}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(
+    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    continuous_flow_reversal=true,
+    Vf0=0.15,
+    steady_state=false,
+    yNiveau(signal(start=1.5)),
+    Cse(h(start=128076)),
+    P(fixed=false, start=6136),
+    Pfond(start=10000.0),
+    Cl(h(start=191812.29519356362)),
+    proe(d(start=996.0227362797892)))
+    annotation (Placement(transformation(extent={{604,-384},{684,-304}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(
+    h0=113.38e3, Q0=29804.5)     annotation (Placement(transformation(extent={{539,
+            -377},{587,-329}},     rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur
+    annotation (Placement(transformation(extent={{703,-374},{747,-330}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(K=1e-4,
+    h(start=2400000),
+    C1(h_vol_2(start=2400000), h(start=2400000)),
+    Pm(start=10026.138683139128))
+    annotation (Placement(transformation(extent={{607,-240},{627,-220}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(
+    Ce3(h(start=194669.37425631672)),
+    h(start=194669.37425632242),
+    P(start=1540500),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (Placement(transformation(
+        origin={869,-318},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(K=1e-4,
+    rho(start=990.3699122081223),
+    Pm(start=1540000))
+    annotation (Placement(transformation(
+        origin={869,-270},
+        extent={{12,-12},{-12,12}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(
+    h(start=561432.6820300613),
+    P(start=322430),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                           annotation (Placement(transformation(
+          extent={{709,-20},{729,0}}, rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(
+    a3=350,
+    b1(fixed=true) = -3.7751,
+    a1=-244551,
+    Q(fixed=false),
+    C1(h_vol_2(start=561432.6820300613)),
+    C2(h_vol_1(start=576430.3612424443)),
+    Qv(start=0.013433660889458656),
+    rho(start=931.2517020786314),
+    Pm(start=1725850),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+            annotation (Placement(transformation(extent={{771,-20},{791,0}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(
+    a3=1600,
+    a1=-28056.2,
+    b1=-12.7952660447433,
+    Q(fixed=false),
+    C1(h_vol_2(start=561432.6820300613)),
+    C2(h_vol_1(start=630040.8772883223)),
+    Qv(start=0.08167585768192882),
+    rho(start=929.0940034498418),
+    Pm(start=6774000),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+             annotation (Placement(transformation(extent={{771,-60},{791,-40}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(
+    alpha=0.5,
+    h(start=194585),
+    P(start=1540500),
+    Cs(h(start=194585)))
+    annotation (Placement(transformation(extent={{839,-328},{853,-308}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(alpha=2)
+    annotation (Placement(transformation(
+        origin={235,-100},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(
+    z2=0,
+    z1=0,
+    K=K_PerteChargeZero2,
+    h(start=3000000),
+    C1(
+      h_vol_2(start=3000000),
+      h(start=3000000),
+      P(fixed=true, start=501850)),
+    Pm(start=490000))
+            annotation (Placement(transformation(
+        origin={311,-278},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(K=1e-4,
+    Pm(start=372632.41194491077),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (Placement(transformation(
+        origin={747,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(K=1e-4,
+    Pm(start=372632.41224549303),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (Placement(transformation(
+        origin={747,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur
+    annotation (Placement(transformation(extent={{369,-448},{489,-348}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(
+    K=1e-4,
+    C1(h_vol_2(start=191812.29519356362)),
+    C2(h_vol_1(start=191812.29519356362)),
+    rho(start=989.8383588386666),
+    Pm(start=6200),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (Placement(transformation(extent={{669,-446},{689,-426}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(
+    Qv(start=0.19861699733512259),
+    a3=400,
+    a1(fixed=true) = -6000,
+    Q(start=194.502, fixed=false),
+    C2(h_vol_1(start=194669.37425631672)),
+    Pm(start=802830.7060548771),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+            annotation (Placement(transformation(extent={{709,-446},{729,-426}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(
+    K=1e-4,
+    rho(start=990.3699122094005),
+    C1(h_vol_2(start=194669.37425631672),
+    h(start=194585)),
+    Pm(start=1546000),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (Placement(transformation(extent={{807,-446},{827,-426}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(Cvmax=2000,
+    h(start=194500),
+    Cv(start=2000),
+    Pm(start=1587120.4167526974),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                 annotation (Placement(transformation(extent={{769,-440},{789,
+            -420}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol_2(start=2674000),
+        h(start=2674000)))
+    annotation (Placement(transformation(
+        origin={-91,8},
+        extent={{-6,6},{6,-6}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol_1(start=1398000),
+        h(start=1398000))) " "
+    annotation (Placement(transformation(
+        origin={58.5,32},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol_1(start=944000),
+        h(start=944000)))
+    annotation (Placement(transformation(extent={{391,49},{376,63}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol_2(start=2798000),
+        h(start=2798000)))
+    annotation (Placement(transformation(
+        origin={203,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol_1(start=2685000),
+        h(start=2685000)))
+    annotation (Placement(transformation(
+        origin={481,56},
+        extent={{-8,8},{8,-8}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol_1(start=550000),
+        h(start=550000)))
+    annotation (Placement(transformation(
+        origin={630.5,34},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol_1(
+          start=550000), h(start=550000)))
+    annotation (Placement(transformation(extent={{654,-11},{667,1}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol_1(
+          start=194585), h(start=194585)))
+    annotation (Placement(transformation(
+        origin={652.5,-412},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol_1(
+          start=2401000), h(start=2401000)))
+    annotation (Placement(transformation(
+        origin={651.5,-264},
+        extent={{-10,-6.5},{10,6.5}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(
+                                                          K=Kin_SMP2,
+    Pm(start=2651000),
+    C1(
+      P(fixed=true, start=2726700),
+      h_vol_2(start=3046000),
+      h(start=3046000)))
+    annotation (Placement(transformation(extent={{81,-120},{61,-100}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(
+    C1(P(fixed=true, start=12680999.9999969)),
+    Cvmax=Cvmax_THP,
+    h(fixed=false, start=3433000),
+    Cv(start=10875),
+    Pm(fixed=false, start=12550000))
+                 annotation (Placement(transformation(extent={{-157,-234},{-137,
+            -214}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauHP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{-191,113},{-157,131}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl
+    regulation_Niveau_HP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500,
+    minval=0.007)
+    annotation (Placement(transformation(extent={{-73,106},{-53,126}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauMP(                                                              k=1.05)
+    annotation (Placement(transformation(extent={{140,113},{174,131}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl
+    regulation_Niveau_MP(
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    add(k1=-1, k2=+1),
+    Ti=500)
+    annotation (Placement(transformation(extent={{229,106},{249,126}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauEauBP(                                                              k=1.75)
+    annotation (Placement(transformation(extent={{437,126},{471,144}}, rotation=
+           0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(
+    add(k1=-1, k2=+1),
+    pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+    Ti=10,
+    minval=0.006) annotation (Placement(transformation(extent={{535,108},{555,128}},
+          rotation=0)));
+   ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauCondenseur1(                                 k=1.5)
+    annotation (Placement(transformation(extent={{683,-246},{707,-230}},
+          rotation=0)));
+  ThermoSysPro.Examples.Control.Condenser_LevelControl
+    regulation_Niveau_Condenseur(pIsat(Ti=500, Limiteur1(u(signal(start=0.8)))),
+                                                add(k1=+1, k2=-1),
+    edge(uL(signal(start=true))))
+                                 annotation (Placement(transformation(extent={{725,
+            -282},{745,-262}},     rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneTurbineHP(Table=[0,0.8; 10,0.8; 600,0.8; 650,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-241,-216},{
+            -171,-142}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp(
+    Initialvalue=1400,
+    Duration=1000,
+    Starttime=4000,
+    Finalvalue=1000)
+                   annotation (Placement(transformation(extent={{911,-42},{873,
+            -10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP(
+    Initialvalue=1400,
+    Starttime=4000,
+    Duration=1000,
+    Finalvalue=700)
+                   annotation (Placement(transformation(extent={{912,-96},{874,
+            -64}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(
+    Initialvalue=1400,
+    Finalvalue=1000,
+    Duration=1000,
+    Starttime=200000)
+                   annotation (Placement(transformation(extent={{912,-458},{874,
+            -426}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(
+    V=1,
+    h0=988332,
+    h(start=860655.3510813401),
+    dynamic_mass_balance=true,
+    P0=7010000,
+    P(start=13149153.870557636),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                          annotation (Placement(transformation(
+          extent={{423,-98},{403,-78}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(
+    V=1,
+    h0=983786,
+    h(start=989834.8113335292),
+    dynamic_mass_balance=true,
+    P0=7000000,
+    P(start=13239005.657249678),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                                          annotation (Placement(transformation(
+          extent={{219,-20},{199,0}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(
+    Cvmax=308.931,
+    h(start=618600),
+    Cv(start=308.931),
+    Pm(start=13150193.68579806),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                 annotation (Placement(transformation(extent={{721,-98},{697,
+            -122}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(
+    Cvmax=308.931,
+    h(start=565000),
+    Cv(start=308.931),
+    Pm(start=3163391.8442005403),
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+                 annotation (Placement(transformation(extent={{771,-138},{747,
+            -162}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(
+    Initialvalue=0.8,
+    Duration=1000,
+    Starttime=3000,
+    Finalvalue=0.005)
+                     annotation (Placement(transformation(extent={{913,-150},{
+            875,-118}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(
+    Initialvalue=0.8,
+    Duration=1000,
+    Starttime=3000,
+    Finalvalue=0.005)
+                     annotation (Placement(transformation(extent={{913,-194},{
+            875,-162}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(
+    h0=3e6,
+    h(start=3432930.9918569606),
+    dynamic_mass_balance=true,
+    P0=12700000,
+    P(start=12700000))                annotation (Placement(transformation(
+        origin={-85,-230},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(
+    h0=3523910,
+    h(start=3517381.1285518324),
+    dynamic_mass_balance=true,
+    P0=2400000,
+    P(start=2400000))                     annotation (Placement(transformation(
+        origin={-83,-314},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(
+    C1(P(fixed=true, start=25.486e5)),
+    Cvmax=Cvmax_TMP,
+    h(fixed=false, start=3518000),
+    Cv(start=3.312e6),
+    Pm(fixed=false, start=2547000))
+                 annotation (Placement(transformation(extent={{-157,-318},{-137,
+            -298}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    ConstantVanneTurbineMP(Table=[0,0.8; 10,0.8; 600,0.8; 2000,0.8; 3000,0.8;
+        3100,0.8]) annotation (Placement(transformation(extent={{-241,-300},{
+            -171,-226}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0={303.16})
+    annotation (Placement(transformation(extent={{-28,68},{-2,98}},
+                                                                  rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(T0={303.16})
+    annotation (Placement(transformation(extent={{293,68},{319,98}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0={303.16})
+    annotation (Placement(transformation(extent={{552,64},{578,94}}, rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceFumees(
+    Xco2=0.0613,
+    Xso2=0,
+    Xh2o=0.0706,
+    T0=893.75,
+    Xo2=0.1380,
+    Q0=606.94,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-473,-91},{-371,-7}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit(             Table=[0,606.94; 10,606.94; 600,
+        50; 650,50])
+                annotation (Placement(transformation(extent={{-527,-19},{-457,
+            55}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature(
+      Table=[0,893.75; 10,893.75; 600,423; 650,423])
+                   annotation (Placement(transformation(extent={{-527,-157},{
+            -457,-83}}, rotation=0)));
+equation
+  connect(SurchauffeurHP3.Cws1, SurchauffeurHP2.Cws2)
+    annotation (Line(points={{-327,-30},{-327,-10},{-207,-10},{-207,-30}},
+        color={255,0,0}));
+  connect(SurchauffeurHP2.Cws1, SurchauffeurHP1.Cws2)
+    annotation (Line(points={{-207,-70},{-207,-90},{-87,-90},{-87,-70}}, color=
+          {255,0,0}));
+  connect(constante_vanne_vapeurHP.y, vanne_vapeurHP.Ouv)
+    annotation (Line(points={{-61.5,74},{-65,74},{-65,67}}));
+  connect(vanne_vapeurHP.C1, BallonHP.Cv)
+    annotation (Line(points={{-55,50},{-35,50}},color={255,0,0}));
+  connect(GainChargeHP.C1, BallonHP.Cd)
+    annotation (Line(points={{5,-90},{15,-90},{15,10},{5,10}},   color={255,128,
+          0}));
+  connect(BallonHP.Cm, EvaporateurHP.Cws2)
+    annotation (Line(points={{-35,10},{-47,10},{-47,-30}}));
+  connect(VolumeEvapHP.Cs, EvaporateurHP.Cws1)
+    annotation (Line(points={{-45,-90},{-45,-70},{-47,-70}}, color={255,128,0}));
+  connect(VolumeEvapHP.Ce1, GainChargeHP.C2)
+                                      annotation (Line(points={{-25,-90},{-15,
+          -90}},
+        color={255,128,0}));
+  connect(EconomiseurHP4.Cws1, EconomiseurHP3.Cws2)
+    annotation (Line(points={{53,-70},{53,-82},{173,-82},{173,-70}}));
+  connect(BallonMP.Cm, EvaporateurMP.Cws2)
+    annotation (Line(points={{287,10},{273,10},{273,-30}}));
+  connect(EvaporateurMP.Cws1, VolumeEvapMP.Cs)
+    annotation (Line(points={{273,-70},{273,-80},{275,-80},{275,-90}}, color={
+          255,128,0}));
+  connect(VolumeEvapMP.Ce1, GainChargeMP.C2)
+    annotation (Line(points={{295,-90},{305,-90}}, color={255,128,0}));
+  connect(constante_vanne_vapeurMP.y, vanne_vapeurMP.Ouv)
+    annotation (Line(points={{258.4,75},{255,75},{255,67}}));
+  connect(SurchauffeurHP1.Cfg2, EvaporateurHP.Cfg1)        annotation (Line(
+      points={{-77,-50},{-57,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurHP.Cfg2, EconomiseurHP4.Cfg1)        annotation (Line(
+      points={{-37,-50},{43,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP4.Cfg2, SurchauffeurMP1.Cfg1)          annotation (Line(
+      points={{63,-50},{103,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP1.Cfg2, EconomiseurHP3.Cfg1)           annotation (Line(
+      points={{123,-50},{163,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurMP.Cfg2, EconomiseurHP2.Cfg1)           annotation (Line(
+      points={{283,-50},{363,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP2.Cfg2, EconomiseurMP.Cfg1)           annotation (Line(
+      points={{383,-50},{423,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurMP.Cfg2, EconomiseurHP1.Cfg1)           annotation (Line(
+      points={{443,-50},{483,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(GainChargeMP.C1, BallonMP.Cd)
+    annotation (Line(points={{325,-90},{335,-90},{335,10},{325,10}}, color={255,
+          128,0}));
+  connect(SurchauffeurMP2.Cfg2, SurchauffeurHP1.Cfg1)          annotation (Line(
+      points={{-137,-50},{-97,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP2.Cfg1, SurchauffeurHP2.Cfg2)           annotation (Line(
+      points={{-157,-50},{-197,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP3.Cfg2, SurchauffeurHP2.Cfg1)           annotation (Line(
+      points={{-257,-50},{-217,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurHP3.Cfg2, SurchauffeurMP3.Cfg1)           annotation (Line(
+      points={{-317,-50},{-277,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurMP3.Cws1,SurchauffeurMP2. Cws2)
+    annotation (Line(points={{-267,-30},{-267,10},{-147,10},{-147,-30}}, color=
+          {255,0,0}));
+  connect(SurchauffeurMP1.Cws2, MelangeurHPMP.Ce2) annotation (Line(
+      points={{113,-70},{113,-85},{115,-85},{115,-100}},
+      color={255,0,0},
+      pattern=LinePattern.None));
+  connect(vanne_vapeurBP.C1, BallonBP.Cv)
+    annotation (Line(points={{525,50},{545,50}}, color={255,0,0}));
+  connect(EvaporateurBP.Cws1, VolumeEvapBP.Cs)  annotation (Line(points={{533,-70},
+          {533,-90},{539,-90}},      color={255,128,0}));
+  connect(VolumeEvapBP.Ce1, GainChargeBP.C2)
+                                        annotation (Line(points={{559,-90},{567,
+          -90}}, color={255,128,0}));
+  connect(BallonBP.Cd, GainChargeBP.C1)
+                                       annotation (Line(points={{585,10},{595,
+          10},{595,-90},{587,-90}}, color={255,128,0}));
+  connect(EconomiseurBP.Cfg2, PuitsFumees.C)     annotation (Line(
+      points={{657,-50},{679,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP3.Cfg2, SurchauffeurBP.Cfg1)  annotation (Line(
+      points={{183,-50},{223,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(SurchauffeurBP.Cfg2, EvaporateurMP.Cfg1)  annotation (Line(
+      points={{243,-50},{263,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EconomiseurHP1.Cfg2, EvaporateurBP.Cfg1) annotation (Line(
+      points={{503,-50},{523,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(EvaporateurBP.Cfg2, EconomiseurBP.Cfg1) annotation (Line(
+      points={{543,-50},{637,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(BallonBP.Cm, EvaporateurBP.Cws2)
+    annotation (Line(points={{545,10},{533,10},{533,-30}}));
+  connect(vanne_vapeurMP.C1, BallonMP.Cv)   annotation (Line(points={{265,50},{
+          287,50}}, color={255,0,0}));
+  connect(Vanne_alimentationMPHP.Ouv, constante_ballonBP.y)
+    annotation (Line(points={{687,7},{687,12},{694.3,12}}));
+  connect(SurchauffeurHP3.Cws2, DoubleDebitHP.Ce)
+    annotation (Line(points={{-327,-70},{-327,-80},{-325,-80},{-325,-90}},
+        color={255,0,0}));
+  connect(SurchauffeurMP3.Cws2, DoubleDebitMP.Ce)
+    annotation (Line(points={{-267,-70},{-267,-80},{-265,-80},{-265,-90}},
+        color={255,0,0}));
+  connect(VolumeCond1.Cs, perteChargeKCond1.C1) annotation (Line(points={{869,
+          -308},{869,-282}}, color={0,0,255}));
+  connect(Vanne_alimentationMPHP.C2, VolumeAlimMPHP.Ce1)
+                                               annotation (Line(points={{697,-10},
+          {709,-10}},      color={0,0,255}));
+  connect(SurchauffeurBP.Cws2, DoubleDebitBP.Ce)
+    annotation (Line(points={{233,-70},{233,-80},{235,-80},{235,-90}}, color={
+          255,0,0}));
+  connect(perteChargeK8.C2, PompeAlimMP.C1)
+    annotation (Line(points={{757,-10},{764,-10},{771,-10}},           color={0,
+          0,255}));
+  connect(VolumeAlimMPHP.Cs1, perteChargeK8.C1)
+    annotation (Line(points={{729,-10},{733,-10},{737,-10}},           color={0,
+          0,255}));
+  connect(VolumeAlimMPHP.Cs2, perteChargeK3.C1)
+                                         annotation (Line(points={{719,-20},{
+          719,-50},{737,-50}}, color={0,0,255}));
+  connect(perteChargeK3.C2, PompeAlimHP.C1)
+    annotation (Line(points={{757,-50},{771,-50}}, color={0,0,255}));
+  connect(MelangeurPostTMP1.Ce2, PerteChargeZero2.C2) annotation (Line(points={{385,
+          -240},{385,-278},{321,-278}},      color={255,0,0}));
+  connect(perteChargeK.C2,PompeAlimBP. C1)
+                                         annotation (Line(points={{689,-436},{
+          709,-436}}, color={0,0,255}));
+  connect(vanne_extraction.C2, perteChargeK2.C1) annotation (Line(points={{789,
+          -436},{807,-436}}, color={0,0,255}));
+  connect(vanne_alimentationHP.C1, CapteurDebitEauHP.C2)
+    annotation (Line(points={{45,50},{53.3,50},{53.3,38.12}}));
+  connect(vanne_vapeurHP.C2, CapteurDebitVapHP.C1) annotation (Line(points={{-75,50},
+          {-86.2,50},{-86.2,14}},         color={255,0,0}));
+  connect(CapteurDebitVapHP.C2, SurchauffeurHP1.Cws1) annotation (Line(points={{-86.2,
+          1.88},{-86.2,-3.06},{-87,-3.06},{-87,-30}},        color={255,0,0}));
+  connect(vanne_alimentationMP.C1, CapteurDebitEauMP.C2)
+    annotation (Line(points={{365,50},{370.425,50},{370.425,50.4},{375.85,50.4}}));
+  connect(CapteurDebitVapMP.C1, vanne_vapeurMP.C2) annotation (Line(points={{211,
+          49.6},{227,49.6},{227,50},{245,50}},     color={255,0,0}));
+  connect(CapteurDebitVapMP.C2, SurchauffeurMP1.Cws1) annotation (Line(points={{194.84,
+          49.6},{113,49.6},{113,-30}},         color={255,0,0}));
+  connect(CapteurDebitVapBP.C2, SurchauffeurBP.Cws1) annotation (Line(points={{472.84,
+          49.6},{457,49.6},{457,-2},{233,-2},{233,-30}},        color={255,0,0}));
+  connect(CapteurDebitVapBP.C1, vanne_vapeurBP.C2) annotation (Line(points={{489,
+          49.6},{497,49.6},{497,50},{505,50}},     color={255,0,0}));
+  connect(CapteurDebitEauBP.C2, vanne_alimentationBP.C1) annotation (Line(
+        points={{625.3,40.12},{625.3,48},{617,48}}, color={0,0,255}));
+  connect(CapteurDebitEauBPsortie.C2, Vanne_alimentationMPHP.C1) annotation (Line(
+        points={{667.13,-9.8},{672.065,-9.8},{672.065,-10},{677,-10}}, color={0,
+          0,255}));
+  connect(CapteurDebitEauCondenseur.C2, perteChargeK.C1) annotation (Line(
+        points={{647.3,-422.2},{647.3,-436},{669,-436}}, color={0,0,255}));
+  connect(perteChargeK1.C2, CapteurDebitVapCondenseur.C1) annotation (Line(
+        points={{627,-230},{646.3,-230},{646.3,-254}}, color={255,0,0}));
+  connect(MelangeurHPMP.Ce1, MoitieDebitHP.Cs)
+    annotation (Line(points={{115,-120},{115,-170},{101,-170}}, color={255,0,0}));
+  connect(perteChargeK2.C2, MoitieDebitBP.Ce) annotation (Line(points={{827,
+          -436},{829,-436},{829,-318},{839,-318}}, color={0,0,255}));
+  connect(MoitieDebitBP.Cs, VolumeCond1.Ce3) annotation (Line(points={{853,-318},
+          {859,-318}}, color={0,0,255}));
+  connect(SurchauffeurMP2.Cws1, lumpedStraightPipeK2.C2)
+    annotation (Line(points={{-147,-70},{-147,-110},{61,-110}}, color={255,0,0}));
+  connect(lumpedStraightPipeK2.C1, MelangeurHPMP.Cs2)
+    annotation (Line(points={{81,-110},{105,-110}},    color={255,0,0}));
+  connect(DoubleDebitHP.Cs, vanne_entree_TurbineHP.C1) annotation (Line(points={{-325,
+          -110},{-325,-230},{-157,-230}},        color={255,0,0}));
+  connect(DoubleDebitBP.Cs, PerteChargeZero2.C1) annotation (Line(points={{235,
+          -110},{235,-278},{301,-278}}, color={255,0,0}));
+  connect(PompeAlimBP.C2, vanne_extraction.C1) annotation (Line(points={{729,
+          -436},{769,-436}}, color={0,0,255}));
+  connect(BallonHP.yLevel,regulation_Niveau_HP. MesureNiveauEau)
+    annotation (Line(points={{-37,30},{-101,30},{-101,125},{-73.5,125}}));
+  connect(regulation_Niveau_HP.SortieReelle1, vanne_alimentationHP.Ouv)
+    annotation (Line(points={{-52.5,107},{35,107},{35,67}}));
+  connect(ConsigneNiveauEauMP.y,regulation_Niveau_MP. ConsigneNiveauEau)
+    annotation (Line(points={{175.7,122},{201,122},{201,110},{228.5,110}}));
+  connect(BallonMP.yLevel,regulation_Niveau_MP. MesureNiveauEau)
+    annotation (Line(points={{285.1,30},{219,30},{219,125},{228.5,125}}));
+  connect(regulation_Niveau_MP.SortieReelle1, vanne_alimentationMP.Ouv)
+    annotation (Line(points={{249.5,107},{344.25,107},{344.25,67},{355,67}}));
+  connect(ConsigneNiveauEauBP.y,regulation_Niveau_BP. ConsigneNiveauEau)
+    annotation (Line(points={{472.7,135},{496.85,135},{496.85,112},{534.5,112}}));
+  connect(BallonBP.yLevel,regulation_Niveau_BP. MesureNiveauEau)
+    annotation (Line(points={{543,30},{485,30},{485,127},{534.5,127}}));
+  connect(ConsigneNiveauCondenseur1.y, regulation_Niveau_Condenseur.ConsigneNiveauEau)
+    annotation (Line(points={{708.2,-238},{719,-238},{719,-269},{724.5,-269}}));
+  connect(regulation_Niveau_Condenseur.SortieReelle1, vanne_extraction.Ouv)
+    annotation (Line(points={{745.5,-281},{779,-281},{779,-419}}));
+  connect(CapteurDebitEauBP.C1, EconomiseurBP.Cws2)
+    annotation (Line(points={{625.3,28},{627,28},{627,6},{647,6},{647,-30}}));
+  connect(EconomiseurBP.Cws1, perteChargeKCond1.C2) annotation (Line(points={{647,-70},
+          {647,-186},{869,-186},{869,-258}}));
+  connect(CapteurDebitVapCondenseur.Measure, regulation_Niveau_Condenseur.MesureDebitVapeur)
+    annotation (Line(points={{658.13,-264},{671,-264},{671,-280.9},{724.6,
+          -280.9}}));
+  connect(regulation_Niveau_Condenseur.MesureDebitEau,
+    CapteurDebitEauCondenseur.Measure) annotation (Line(points={{724.45,-274.95},
+          {717,-274.95},{717,-310},{759,-310},{759,-412},{659.13,-412}}));
+  connect(ConstantVanneTurbineHP.y, vanne_entree_TurbineHP.Ouv)
+    annotation (Line(points={{-167.5,-179},{-147,-179},{-147,-213}}));
+  connect(regulation_Niveau_BP.SortieReelle1, vanne_vapeurBP.Ouv)
+    annotation (Line(points={{555.5,109},{567,109},{567,90},{515,90},{515,67}}));
+  connect(vanne_alimentationBP.Ouv, constante_vanne_vapeurBP.y)
+    annotation (Line(points={{607,65},{607,81},{620.4,81}}));
+  connect(EconomiseurHP1.Cws2, VolumeECO_HP1_2.Ce1) annotation (Line(points={{493,-70},
+          {493,-88},{423,-88}},          color={0,0,255}));
+  connect(VolumeECO_HP1_2.Cs, EconomiseurHP2.Cws1) annotation (Line(points={{403,-88},
+          {373,-88},{373,-70}},          color={0,0,255}));
+  connect(EconomiseurHP2.Cws2, VolumeECO_HP2_3.Ce1) annotation (Line(points={{373,-30},
+          {373,-10},{219,-10}},          color={0,0,255}));
+  connect(VolumeECO_HP2_3.Cs, EconomiseurHP3.Cws1) annotation (Line(points={{199,-10},
+          {173,-10},{173,-30}},          color={0,0,255}));
+  connect(Vanne_alimentationMPHP1.C1, PompeAlimHP.C2)
+    annotation (Line(points={{721,-102.8},{809,-102.8},{809,-50},{791,-50}}));
+  connect(PompeAlimMP.C2, Vanne_alimentationMPHP2.C1) annotation (Line(points={{791,-10},
+          {837,-10},{837,-142.8},{771,-142.8}},           color={0,0,255}));
+  connect(arretPomesMp1.y, Vanne_alimentationMPHP1.Ouv)
+    annotation (Line(points={{873.1,-134},{823,-134},{823,-122},{709,-122},{709,
+          -123.2}}));
+  connect(arretPomesHP1.y, Vanne_alimentationMPHP2.Ouv)
+    annotation (Line(points={{873.1,-178},{850.05,-178},{850.05,-163.2},{759,
+          -163.2}}));
+  connect(Vanne_alimentationMPHP1.C2, EconomiseurHP1.Cws1) annotation (Line(
+        points={{697,-102.8},{603,-102.8},{603,-106},{515,-106},{515,-6},{493,
+          -6},{493,-30}}, color={0,0,255}));
+  connect(EconomiseurMP.Cws1, Vanne_alimentationMPHP2.C2)
+    annotation (Line(points={{433,-70},{433,-142.8},{747,-142.8}}));
+  connect(ConstantVanneTurbineMP.y, vanne_entree_TurbineMP.Ouv)
+    annotation (Line(points={{-167.5,-263},{-147,-263},{-147,-297}}));
+  connect(vanne_entree_TurbineHP.C2, VolumePreTHP.Ce) annotation (Line(points={{-137,
+          -230},{-95,-230}},       color={255,0,0}));
+  connect(DoubleDebitMP.Cs, vanne_entree_TurbineMP.C1) annotation (Line(points={{-265,
+          -110},{-265,-314},{-157,-314}},        color={255,0,0}));
+  connect(vanne_entree_TurbineMP.C2, MelangeurPreTMP.Ce1) annotation (Line(
+        points={{-137,-314},{-93,-314}}, color={255,0,0}));
+  connect(SourceCaloporteur.C, Condenseur.Cee) annotation (Line(points={{587,
+          -353},{605,-353},{605,-352.8},{604,-352.8}},
+                                                     color={0,0,255}));
+  connect(Condenseur.Cse, PuitsCaloporteur.C) annotation (Line(points={{684,
+          -352},{703,-352}}, color={0,0,255}));
+  connect(CapteurDebitVapCondenseur.C2, Condenseur.Cv) annotation (Line(points={{646.3,
+          -274.2},{646.3,-288.1},{644,-288.1},{644,-304}},         color={0,0,
+          255}));
+  connect(CapteurDebitEauCondenseur.C1, Condenseur.Cl)
+    annotation (Line(points={{647.3,-402},{644.8,-402},{644.8,-384}}));
+  connect(ConsigneNiveauEauHP.y, regulation_Niveau_HP.ConsigneNiveauEau)
+    annotation (Line(points={{-155.3,122},{-133,122},{-133,110},{-73.5,110}}));
+  connect(Condenseur.yNiveau, regulation_Niveau_Condenseur.MesureNiveauEau)
+    annotation (Line(points={{688,-372.8},{747,-372.8},{747,-326},{699,-326},{
+          699,-263},{724.5,-263}}));
+  connect(BallonBP.Cs, CapteurDebitEauBPsortie.C1) annotation (Line(points={{545,22},
+          {531,22},{531,16},{609,16},{609,-9.8},{654,-9.8}},         color={0,0,
+          255}));
+  connect(BallonBP.Ce1, vanne_alimentationBP.C2)
+    annotation (Line(points={{585,50},{591,50},{591,48},{597,48}}));
+  connect(BallonMP.Ce1, vanne_alimentationMP.C2)
+    annotation (Line(points={{325,50},{345,50}}));
+  connect(BallonHP.Ce1, vanne_alimentationHP.C2)
+    annotation (Line(points={{5,50},{25,50}}));
+  connect(TurbineHP.Cs, MoitieDebitHP.Ce) annotation (Line(points={{5.2,-230},{
+          41,-230},{41,-170},{81,-170}},   color={255,0,0}));
+  connect(VolumePreTHP.Cs3, TurbineHP.Ce) annotation (Line(points={{-75,-230},{
+          -35.2,-230}},color={255,0,0}));
+  connect(MelangeurPreTMP.Cs, TurbineMP.Ce) annotation (Line(points={{-73,-314},
+          {73,-314},{73,-230},{284.8,-230}},   color={255,0,0}));
+  connect(TurbineMP.Cs, MelangeurPostTMP1.Ce1) annotation (Line(points={{325.2,
+          -230},{375,-230}}, color={255,0,0}));
+  connect(MelangeurPostTMP1.Cs, TurbineBP.Ce) annotation (Line(points={{395,
+          -230},{542.8,-230}}, color={255,0,0}));
+  connect(TurbineBP.Cs, perteChargeK1.C1) annotation (Line(points={{583.2,-230},
+          {607,-230}}, color={255,0,0}));
+  connect(EconomiseurMP.Cws2, CapteurDebitEauMP.C1) annotation (Line(points={{433,-30},
+          {437,-30},{437,50.4},{391,50.4}},          color={0,0,255}));
+  connect(TurbineMP.MechPower, Alternateur.Wmec2)
+    annotation (Line(points={{327,-248},{335,-248},{335,-378},{369,-378}}));
+  connect(TurbineBP.MechPower, Alternateur.Wmec1) annotation (Line(points={{585,
+          -248},{595,-248},{595,-290},{355,-290},{355,-358},{369,-358}}));
+  connect(TurbineHP.MechPower, Alternateur.Wmec3)
+    annotation (Line(points={{7,-248},{15,-248},{15,-398},{369,-398}}));
+  connect(heatSource.C[1], BallonHP.Cex) annotation (Line(points={{-15,68.3},{
+          -15,50}},
+                color={191,95,0}));
+  connect(heatSource1.C[1], BallonMP.Cex) annotation (Line(points={{306,68.3},{
+          306,50}}, color={191,95,0}));
+  connect(heatSource2.C[1], BallonBP.Cex) annotation (Line(points={{565,64.3},{
+          565,50}}, color={191,95,0}));
+  connect(CapteurDebitEauHP.C1, EconomiseurHP4.Cws2)
+    annotation (Line(points={{53.3,26},{53,26},{53,-30}}, smooth=Smooth.None));
+  connect(PompeAlimMP.rpm_or_mpower, arretPomesMp.y)
+    annotation (Line(points={{781,-21},{781,-26},{871.1,-26}}, smooth=Smooth.None));
+  connect(PompeAlimHP.rpm_or_mpower, arretPomesHP.y)
+    annotation (Line(points={{781,-61},{781,-80},{872.1,-80}}, smooth=Smooth.None));
+  connect(PompeAlimBP.rpm_or_mpower, arretPomesBP.y) annotation (Line(points={{719,
+          -447},{721,-447},{721,-460},{845,-460},{845,-442},{872.1,-442}},
+        smooth=Smooth.None));
+  connect(SourceFumees.C, SurchauffeurHP3.Cfg1) annotation (Line(
+      points={{-371,-49},{-371,-50},{-337,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(Debit.y,SourceFumees. IMassFlow)
+    annotation (Line(points={{-453.5,18},{-422,18},{-422,-28}}));
+  connect(Temperature.y, SourceFumees.ISpecificEnthalpyOrTemperature)
+    annotation (Line(points={{-453.5,-120},{-422,-120},{-422,-70}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-560,-460},
+            {950,150}},
+        initialScale=0.1)),
+    experiment(StopTime=10000, Tolerance=0.001),
+    experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </h4>
+</html>"));
+end CombinedCycle_TripTAC;
diff --git a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/package.mo b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/package.mo
index 0b6e3015394209a23c71870fba08407b1a085a48..0eb880baa17835bc6e5518c9ad6a421d3d6fd5fd 100644
--- a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/package.mo
+++ b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/package.mo
@@ -1,146 +1,146 @@
-within ThermoSysPro.Fluid.Examples;
-package CombinedCyclePowerPlant "Models of a combined cycle power plant"
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains two models of the same combined cycle power plant are provided to simulate two different transients:</p>
-<ul>
-<li>CombinedCycle_Load_100_50, to simulate a load decrease from 100&percnt; to 50&percnt;</li>
-<li>CombinedCycle_TripTAC, to simulate a full combustion turbine trip</li></p>
-</ul>
-<p>The two models are documented in two conference papers, <a href=\"http://www.ep.liu.se/ecp/063/040/ecp11063040.pdf\">1</a> and <a href=\"http://www.ep.liu.se/ecp/132/046/ecp17132407.pdf\">2</a>. </h4>
-</html>"));
-end CombinedCyclePowerPlant;
+within ThermoSysPro.Fluid.Examples;
+package CombinedCyclePowerPlant "Models of a combined cycle power plant"
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains two models of the same combined cycle power plant are provided to simulate two different transients:</p>
+<ul>
+<li>CombinedCycle_Load_100_50, to simulate a load decrease from 100&percnt; to 50&percnt;</li>
+<li>CombinedCycle_TripTAC, to simulate a full combustion turbine trip</li></p>
+</ul>
+<p>The two models are documented in two conference papers, <a href=\"http://www.ep.liu.se/ecp/063/040/ecp11063040.pdf\">1</a> and <a href=\"http://www.ep.liu.se/ecp/132/046/ecp17132407.pdf\">2</a>. </h4>
+</html>"));
+end CombinedCyclePowerPlant;
diff --git a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/package.order b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/package.order
index f8e7ec90f1602f7f0ec38b357e0f42bee857783b..0a7c22d5226c090bb0c9402ad947d16f3356b607 100644
--- a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/package.order
+++ b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/package.order
@@ -1,2 +1,2 @@
-CombinedCycle_Load_100_50
-CombinedCycle_TripTAC
+CombinedCycle_Load_100_50
+CombinedCycle_TripTAC
diff --git a/ThermoSysPro/Fluid/Examples/Control/Condenser_LevelControl.mo b/ThermoSysPro/Fluid/Examples/Control/Condenser_LevelControl.mo
index 2c0af10963810d6f356a6883494dcd9029dcbf6c..301b45e8cef57e354166ea7c9271bba5a7dda497 100644
--- a/ThermoSysPro/Fluid/Examples/Control/Condenser_LevelControl.mo
+++ b/ThermoSysPro/Fluid/Examples/Control/Condenser_LevelControl.mo
@@ -1,156 +1,156 @@
-within ThermoSysPro.Fluid.Examples.Control;
-model Condenser_LevelControl "Condenser level control"
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitVapeur
-    annotation (Placement(transformation(extent={{-109,-94},{-99,-84}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitEau
-    annotation (Placement(transformation(extent={{-110.5,-34.5},{-100.5,-24.5}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,25},{-100,35}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=+1, k2=-1)
-                                          annotation (Placement(transformation(
-          extent={{63,65},{88,91}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    ureset0=0,
-    Ti=10,
-    k=10)
-    annotation (Placement(transformation(
-        origin={76,-78},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add1(
-                             k1=+1, k2=+1)
-                                          annotation (Placement(transformation(
-        origin={-29,-65},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat1(
-    permanent=false,
-    k=1,
-    Ti=10,
-    ureset0(fixed=true) = 0.8)
-    annotation (Placement(transformation(
-        origin={-63,-65},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true, U0=1.05)
-    annotation (Placement(transformation(extent={{31,71},{51,91}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_2(                              permanent=true, U0=1.05)
-    annotation (Placement(transformation(
-        origin={-17,13},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_3(                              permanent=true, U0=1.05)
-    annotation (Placement(transformation(
-        origin={15,13},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add2(
-                            k1=+1, k2=-1) annotation (Placement(transformation(
-        origin={-11,-29},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Edge edge annotation (Placement(
-        transformation(extent={{-50,-40},{-40,-30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon
-    annotation (Placement(transformation(extent={{-76,-11},{-66,-1}}, rotation=
-            0)));
-equation
-  connect(pIsat.u,add. y) annotation (Line(points={{87,-78},{89,-78},{89,78},{
-          89.25,78}}));
-  connect(pIsat1.u,add1. y) annotation (Line(points={{-52,-65},{-40,-65}}));
-  connect(pT1_1.y,add. u1) annotation (Line(points={{52,81},{57,81},{57,85.8},{
-          61.75,85.8}}));
-  connect(pT1_2.y,add2. u2) annotation (Line(points={{-17,2},{-17,-8},{-17,-8},
-          {-17,-18}}));
-  connect(pT1_3.y,add2. u1)
-    annotation (Line(points={{15,2},{15,-7},{-5,-7},{-5,-18}}));
-  connect(pIsat.y,add1. u1) annotation (Line(points={{65,-78},{19,-78},{19,-71},
-          {-18,-71}}));
-  connect(pIsat1.y, SortieReelle1) annotation (Line(points={{-74,-65},{-79,-65},
-          {-79,-90},{105,-90}}, color={255,0,0}));
-  connect(MesureDebitVapeur, pT1_3.u) annotation (Line(points={{-104,-89},{-91,
-          -89},{-91,-40},{-64,-40},{-64,29},{15,29},{15,24}}, color={255,0,0}));
-  connect(MesureDebitEau, pT1_2.u)
-    annotation (Line(points={{-105.5,-29.5},{-79,-29.5},{-79,37},{-17,37},{-17,
-          24}}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,81},{30,81}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,30},{-93,30},
-          {-93,50},{55,50},{55,70.2},{61.75,70.2}}, color={127,0,0}));
-  connect(add2.y, add1.u2) annotation (Line(points={{-11,-40},{-11,-59},{-18,
-          -59}}));
-  connect(echelon.yL, edge.uL)
-    annotation (Line(points={{-65.5,-6},{-60,-6},{-60,-35},{-50.5,-35}}));
-  connect(edge.yL, pIsat1.reset)
-    annotation (Line(points={{-39.5,-35},{-31,-35},{-31,-46},{-62,-46},{-62,-54}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-117,102},{-79,94}},
-          lineColor={127,0,0},
-          textString="Level"),
-        Text(
-          extent={{-109,56},{-65,28}},
-          lineColor={127,0,0},
-          textString="Level Set point"),
-        Text(
-          extent={{-112,-15},{-63,-30}},
-          lineColor={127,0,0},
-          textString="Water MassFlowrate"),
-        Text(
-          extent={{-109,-89},{-57,-106}},
-          lineColor={127,0,0},
-          textString="Vapour Mass Flowrate"),
-        Text(
-          extent={{62,-93},{100,-101}},
-          lineColor={127,0,0},
-          textString="Valve opening")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-44.5,41.5},{42,-3}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Regulation"),
-        Text(
-          extent={{-29,-5},{20,-38}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Condenser"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Condenser_LevelControl;
+within ThermoSysPro.Fluid.Examples.Control;
+model Condenser_LevelControl "Condenser level control"
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitVapeur
+    annotation (Placement(transformation(extent={{-109,-94},{-99,-84}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureDebitEau
+    annotation (Placement(transformation(extent={{-110.5,-34.5},{-100.5,-24.5}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,25},{-100,35}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=+1, k2=-1)
+                                          annotation (Placement(transformation(
+          extent={{63,65},{88,91}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    ureset0=0,
+    Ti=10,
+    k=10)
+    annotation (Placement(transformation(
+        origin={76,-78},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add1(
+                             k1=+1, k2=+1)
+                                          annotation (Placement(transformation(
+        origin={-29,-65},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat1(
+    permanent=false,
+    k=1,
+    Ti=10,
+    ureset0(fixed=true) = 0.8)
+    annotation (Placement(transformation(
+        origin={-63,-65},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true, U0=1.05)
+    annotation (Placement(transformation(extent={{31,71},{51,91}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_2(                              permanent=true, U0=1.05)
+    annotation (Placement(transformation(
+        origin={-17,13},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_3(                              permanent=true, U0=1.05)
+    annotation (Placement(transformation(
+        origin={15,13},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add2(
+                            k1=+1, k2=-1) annotation (Placement(transformation(
+        origin={-11,-29},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Edge edge annotation (Placement(
+        transformation(extent={{-50,-40},{-40,-30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon
+    annotation (Placement(transformation(extent={{-76,-11},{-66,-1}}, rotation=
+            0)));
+equation
+  connect(pIsat.u,add. y) annotation (Line(points={{87,-78},{89,-78},{89,78},{
+          89.25,78}}));
+  connect(pIsat1.u,add1. y) annotation (Line(points={{-52,-65},{-40,-65}}));
+  connect(pT1_1.y,add. u1) annotation (Line(points={{52,81},{57,81},{57,85.8},{
+          61.75,85.8}}));
+  connect(pT1_2.y,add2. u2) annotation (Line(points={{-17,2},{-17,-8},{-17,-8},
+          {-17,-18}}));
+  connect(pT1_3.y,add2. u1)
+    annotation (Line(points={{15,2},{15,-7},{-5,-7},{-5,-18}}));
+  connect(pIsat.y,add1. u1) annotation (Line(points={{65,-78},{19,-78},{19,-71},
+          {-18,-71}}));
+  connect(pIsat1.y, SortieReelle1) annotation (Line(points={{-74,-65},{-79,-65},
+          {-79,-90},{105,-90}}, color={255,0,0}));
+  connect(MesureDebitVapeur, pT1_3.u) annotation (Line(points={{-104,-89},{-91,
+          -89},{-91,-40},{-64,-40},{-64,29},{15,29},{15,24}}, color={255,0,0}));
+  connect(MesureDebitEau, pT1_2.u)
+    annotation (Line(points={{-105.5,-29.5},{-79,-29.5},{-79,37},{-17,37},{-17,
+          24}}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,81},{30,81}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,30},{-93,30},
+          {-93,50},{55,50},{55,70.2},{61.75,70.2}}, color={127,0,0}));
+  connect(add2.y, add1.u2) annotation (Line(points={{-11,-40},{-11,-59},{-18,
+          -59}}));
+  connect(echelon.yL, edge.uL)
+    annotation (Line(points={{-65.5,-6},{-60,-6},{-60,-35},{-50.5,-35}}));
+  connect(edge.yL, pIsat1.reset)
+    annotation (Line(points={{-39.5,-35},{-31,-35},{-31,-46},{-62,-46},{-62,-54}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-117,102},{-79,94}},
+          lineColor={127,0,0},
+          textString="Level"),
+        Text(
+          extent={{-109,56},{-65,28}},
+          lineColor={127,0,0},
+          textString="Level Set point"),
+        Text(
+          extent={{-112,-15},{-63,-30}},
+          lineColor={127,0,0},
+          textString="Water MassFlowrate"),
+        Text(
+          extent={{-109,-89},{-57,-106}},
+          lineColor={127,0,0},
+          textString="Vapour Mass Flowrate"),
+        Text(
+          extent={{62,-93},{100,-101}},
+          lineColor={127,0,0},
+          textString="Valve opening")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-44.5,41.5},{42,-3}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Regulation"),
+        Text(
+          extent={{-29,-5},{20,-38}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Condenser"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Condenser_LevelControl;
diff --git a/ThermoSysPro/Fluid/Examples/Control/Condenser_LevelControl_RE5.mo b/ThermoSysPro/Fluid/Examples/Control/Condenser_LevelControl_RE5.mo
index 6e8bde1711e75fc530438b18be6af9079cd620ae..900d40de72a48b4e16534168092480da33e7d4f9 100644
--- a/ThermoSysPro/Fluid/Examples/Control/Condenser_LevelControl_RE5.mo
+++ b/ThermoSysPro/Fluid/Examples/Control/Condenser_LevelControl_RE5.mo
@@ -1,101 +1,101 @@
-within ThermoSysPro.Fluid.Examples.Control;
-model Condenser_LevelControl_RE5 "Condenser level control"
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,25},{-100,35}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=+1, k2=-1)
-                                          annotation (Placement(transformation(
-          extent={{63,65},{88,91}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat1(
-    minval=0.00010,
-    k=100,
-    Ti=10,
-    permanent=false,
-    ureset0(fixed=true) = 0.3)
-    annotation (Placement(transformation(
-        origin={-63,-66},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true, U0=0.43,
-    k=1,
-    Ti=1)
-    annotation (Placement(transformation(extent={{31,71},{51,91}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Edge edge annotation (Placement(
-        transformation(extent={{-50,-40},{-40,-30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon
-    annotation (Placement(transformation(extent={{-76,-11},{-66,-1}}, rotation=
-            0)));
-equation
-  connect(pT1_1.y,add. u1) annotation (Line(points={{52,81},{57,81},{57,85.8},{
-          61.75,85.8}}));
-  connect(pIsat1.y, SortieReelle1) annotation (Line(points={{-74,-66},{-79,-66},
-          {-79,-90},{105,-90}}, color={255,0,0}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,81},{30,81}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,30},{-93,30},
-          {-93,50},{55,50},{55,70.2},{61.75,70.2}}, color={127,0,0}));
-  connect(echelon.yL, edge.uL)
-    annotation (Line(points={{-65.5,-6},{-60,-6},{-60,-35},{-50.5,-35}}));
-  connect(edge.yL, pIsat1.reset)
-    annotation (Line(points={{-39.5,-35},{-31,-35},{-31,-46},{-62,-46},{-62,-55}}));
-  connect(add.y, pIsat1.u)
-    annotation (Line(points={{89.25,78},{93,78},{93,-66},{-52,-66}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-99,58},{-53,26}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-58,62},{58,-1}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Regulation
- Niveau "),
-        Text(
-          extent={{-33,-23},{33,-61}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Ballon")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Condenser_LevelControl_RE5;
+within ThermoSysPro.Fluid.Examples.Control;
+model Condenser_LevelControl_RE5 "Condenser level control"
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,25},{-100,35}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=+1, k2=-1)
+                                          annotation (Placement(transformation(
+          extent={{63,65},{88,91}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat1(
+    minval=0.00010,
+    k=100,
+    Ti=10,
+    permanent=false,
+    ureset0(fixed=true) = 0.3)
+    annotation (Placement(transformation(
+        origin={-63,-66},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true, U0=0.43,
+    k=1,
+    Ti=1)
+    annotation (Placement(transformation(extent={{31,71},{51,91}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Edge edge annotation (Placement(
+        transformation(extent={{-50,-40},{-40,-30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Echelon echelon
+    annotation (Placement(transformation(extent={{-76,-11},{-66,-1}}, rotation=
+            0)));
+equation
+  connect(pT1_1.y,add. u1) annotation (Line(points={{52,81},{57,81},{57,85.8},{
+          61.75,85.8}}));
+  connect(pIsat1.y, SortieReelle1) annotation (Line(points={{-74,-66},{-79,-66},
+          {-79,-90},{105,-90}}, color={255,0,0}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,81},{30,81}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,30},{-93,30},
+          {-93,50},{55,50},{55,70.2},{61.75,70.2}}, color={127,0,0}));
+  connect(echelon.yL, edge.uL)
+    annotation (Line(points={{-65.5,-6},{-60,-6},{-60,-35},{-50.5,-35}}));
+  connect(edge.yL, pIsat1.reset)
+    annotation (Line(points={{-39.5,-35},{-31,-35},{-31,-46},{-62,-46},{-62,-55}}));
+  connect(add.y, pIsat1.u)
+    annotation (Line(points={{89.25,78},{93,78},{93,-66},{-52,-66}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-99,58},{-53,26}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-58,62},{58,-1}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Regulation
+ Niveau "),
+        Text(
+          extent={{-33,-23},{33,-61}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Ballon")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Condenser_LevelControl_RE5;
diff --git a/ThermoSysPro/Fluid/Examples/Control/Drum_LevelControl.mo b/ThermoSysPro/Fluid/Examples/Control/Drum_LevelControl.mo
index dc54d7bfcaeb51766bd8dabc2d31e99d9af6c648..0e0662df2966698441fbd064127a33c309e97490 100644
--- a/ThermoSysPro/Fluid/Examples/Control/Drum_LevelControl.mo
+++ b/ThermoSysPro/Fluid/Examples/Control/Drum_LevelControl.mo
@@ -1,84 +1,84 @@
-within ThermoSysPro.Fluid.Examples.Control;
-model Drum_LevelControl "Drum level control"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=0.01 "Minimum output value";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    ureset0=0.8,
-    k=k,
-    Ti=Ti,
-    minval=minval)
-    annotation (Placement(transformation(
-        origin={-10,-56.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    U0=1.1,
-    Ti=10)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{48,53},{83,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-103,102},{-62,91}},
-          lineColor={127,0,0},
-          textString="Measure"),
-        Text(
-          extent={{-99,-48},{-48.5,-88}},
-          lineColor={127,0,0},
-          textString="Level Set point"),
-        Text(
-          extent={{62,-93},{100,-101}},
-          lineColor={127,0,0},
-          textString="Valve opening")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={127,127,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-35.5,15.5},{29,-14}},
-          lineColor={255,0,0},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Regulation")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Drum_LevelControl;
+within ThermoSysPro.Fluid.Examples.Control;
+model Drum_LevelControl "Drum level control"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=0.01 "Minimum output value";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    ureset0=0.8,
+    k=k,
+    Ti=Ti,
+    minval=minval)
+    annotation (Placement(transformation(
+        origin={-10,-56.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    U0=1.1,
+    Ti=10)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{48,53},{83,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-103,102},{-62,91}},
+          lineColor={127,0,0},
+          textString="Measure"),
+        Text(
+          extent={{-99,-48},{-48.5,-88}},
+          lineColor={127,0,0},
+          textString="Level Set point"),
+        Text(
+          extent={{62,-93},{100,-101}},
+          lineColor={127,0,0},
+          textString="Valve opening")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={127,127,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-35.5,15.5},{29,-14}},
+          lineColor={255,0,0},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Regulation")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Drum_LevelControl;
diff --git a/ThermoSysPro/Fluid/Examples/Control/LevelControl.mo b/ThermoSysPro/Fluid/Examples/Control/LevelControl.mo
index 4e318d7a3c4966bebb7643cd968990bde26f9989..688bc52880b33fa8656c308f5bbc4ea59afcfcd7 100644
--- a/ThermoSysPro/Fluid/Examples/Control/LevelControl.mo
+++ b/ThermoSysPro/Fluid/Examples/Control/LevelControl.mo
@@ -1,108 +1,108 @@
-within ThermoSysPro.Fluid.Examples.Control;
-model LevelControl "Level control"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=0.01 "Minimum output value";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    ureset0=0.8,
-    k=k,
-    Ti=Ti,
-    minval=minval)
-    annotation (Placement(transformation(
-        origin={-10,-56.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    U0=1.1,
-    Ti=10)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{49,53},{84,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{47.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{47.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{85.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-59},{-55,-91}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={127,127,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,50},{78,8}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Level"),
-        Text(
-          extent={{-98,93},{-60,85}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-31},{-52,-64}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne"),
-        Text(
-          extent={{-70,-11},{63,-48}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString="Control")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end LevelControl;
+within ThermoSysPro.Fluid.Examples.Control;
+model LevelControl "Level control"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=0.01 "Minimum output value";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    ureset0=0.8,
+    k=k,
+    Ti=Ti,
+    minval=minval)
+    annotation (Placement(transformation(
+        origin={-10,-56.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    U0=1.1,
+    Ti=10)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{49,53},{84,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{47.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{47.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{85.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-59},{-55,-91}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={127,127,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,50},{78,8}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Level"),
+        Text(
+          extent={{-98,93},{-60,85}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-31},{-52,-64}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne"),
+        Text(
+          extent={{-70,-11},{63,-48}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString="Control")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end LevelControl;
diff --git a/ThermoSysPro/Fluid/Examples/Control/MassFlowControl.mo b/ThermoSysPro/Fluid/Examples/Control/MassFlowControl.mo
index 68df9c70264444d4f7457344f6e09f4431afcc31..216481559f9bfc771f8f1b4f5c49410f28cccfd6 100644
--- a/ThermoSysPro/Fluid/Examples/Control/MassFlowControl.mo
+++ b/ThermoSysPro/Fluid/Examples/Control/MassFlowControl.mo
@@ -1,112 +1,112 @@
-within ThermoSysPro.Fluid.Examples.Control;
-model MassFlowControl "Pump_MassFlowControl"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=200 "Minimum Speed";
-  parameter Real maxval=2000 "Maximale Speed";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Mesure_Q_water
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Consigne_Q_water
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    k=k,
-    Ti=Ti,
-    ureset0=1400,
-    maxval=maxval,
-    minval=minval)
-    annotation (Placement(transformation(
-        origin={-10,-56.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    U0=600,
-    Ti=10)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{48,53},{83,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(Mesure_Q_water, pT1_1.u)  annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(Consigne_Q_water, add.u2)  annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
-  annotation (
-    Diagram(
-      coordinateSystem(preserveAspectRatio=false,extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1),
-      graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString=
-               "Debit"),
-        Text(
-          extent={{-101,-59},{-55,-91}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne debit"),
-        Text(
-          extent={{64,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString=
-               "Vitesse")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={170,255,213},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-88,65},{74,-26}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Régulation Niveau "),
-        Text(
-          extent={{-41,-9},{38,-58}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Bache"),
-        Text(
-          extent={{-98,93},{-60,85}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-31},{-52,-64}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end MassFlowControl;
+within ThermoSysPro.Fluid.Examples.Control;
+model MassFlowControl "Pump_MassFlowControl"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=200 "Minimum Speed";
+  parameter Real maxval=2000 "Maximale Speed";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Mesure_Q_water
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Consigne_Q_water
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    k=k,
+    Ti=Ti,
+    ureset0=1400,
+    maxval=maxval,
+    minval=minval)
+    annotation (Placement(transformation(
+        origin={-10,-56.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    U0=600,
+    Ti=10)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{48,53},{83,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(Mesure_Q_water, pT1_1.u)  annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(Consigne_Q_water, add.u2)  annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
+  annotation (
+    Diagram(
+      coordinateSystem(preserveAspectRatio=false,extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1),
+      graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString=
+               "Debit"),
+        Text(
+          extent={{-101,-59},{-55,-91}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne debit"),
+        Text(
+          extent={{64,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString=
+               "Vitesse")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={170,255,213},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-88,65},{74,-26}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Régulation Niveau "),
+        Text(
+          extent={{-41,-9},{38,-58}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Bache"),
+        Text(
+          extent={{-98,93},{-60,85}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-31},{-52,-64}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end MassFlowControl;
diff --git a/ThermoSysPro/Fluid/Examples/Control/MassFlowRateAirCoalWater.mo b/ThermoSysPro/Fluid/Examples/Control/MassFlowRateAirCoalWater.mo
index bbf62e20d6074f71f24824bb257b71b06a315b2f..7857ee653f5490e62bd7c409440ff2f0a23fcc91 100644
--- a/ThermoSysPro/Fluid/Examples/Control/MassFlowRateAirCoalWater.mo
+++ b/ThermoSysPro/Fluid/Examples/Control/MassFlowRateAirCoalWater.mo
@@ -1,113 +1,113 @@
-within ThermoSysPro.Fluid.Examples.Control;
-model MassFlowRateAirCoalWater "MassFlowRateAirCoalWater"
- // Modelica.SIunits.Power Welec
- //   "(Percent, max=100)Electrical power produced by the generator";
-  Units.SI.Power Welec(start=804.461)
-    "(MW)Electrical power produced by the generator";
-  Units.SI.MassFlowRate Qair(start=710) "Air mass flow rate";
-  Units.SI.MassFlowRate Qcoal(start=70) "Coal mass flow rate";
-  Units.SI.MassFlowRate Qwater(start=600) "Water mass flow rate";
-
-  InstrumentationAndControl.Connectors.InputReal Electrical_power_MW
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}},   rotation=-90,
-        origin={-10,96})));
-  InstrumentationAndControl.Connectors.OutputReal Q_air
-                              annotation (Placement(transformation(
-        origin={110,-9},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  InstrumentationAndControl.Connectors.OutputReal Q_coal
-                              annotation (Placement(transformation(
-        origin={110,75},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  InstrumentationAndControl.Connectors.OutputReal Q_water
-                              annotation (Placement(transformation(
-        origin={110,-89},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-equation
-  //if (cardinality(Electrical_power_Percent) == 0) then
-  //  Electrical_power_Percent.signal = 100;
-  //end if;
-
-  if (cardinality(Electrical_power_MW) == 0) then
-    Electrical_power_MW.signal = 804.461;
-  end if;
-
-  Welec = Electrical_power_MW.signal;
-  //Qair = 45.38 + 0.8249*Welec;
-  //Qcoal = - 2.4172 + 0.0849*Welec;
-
-  Qair = 46.0 + 0.8229*Welec;
-  Qcoal = - 2.3534 + 0.0847*Welec;
-
-  //Qwater = 23.484 + 0.7166*Welec;
-  Qwater = 23.524 + 0.7166*Welec;
-
-  //Qwater = 23.523 + 0.7166*Welec;
-
-  Q_air.signal = Qair;
-  Q_coal.signal = Qcoal;
-  Q_water.signal = Qwater;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-100,86},{100,-100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-32,92},{144,56}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qcoal"),
-        Text(
-          extent={{10,-72},{96,-102}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qwater"),
-        Text(
-          extent={{30,12},{100,-26}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qair")}), Icon(graphics={
-        Rectangle(
-          extent={{-100,86},{100,-100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-34,91},{142,55}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qcoal"),
-        Text(
-          extent={{22,12},{102,-28}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qair"),
-        Text(
-          extent={{-6,-70},{98,-104}},
-          lineColor={255,255,255},
-          pattern=LinePattern.Dash,
-          fillColor={135,135,135},
-          fillPattern=FillPattern.Solid,
-          textString="Qwater")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end MassFlowRateAirCoalWater;
+within ThermoSysPro.Fluid.Examples.Control;
+model MassFlowRateAirCoalWater "MassFlowRateAirCoalWater"
+ // Modelica.SIunits.Power Welec
+ //   "(Percent, max=100)Electrical power produced by the generator";
+  Units.SI.Power Welec(start=804.461)
+    "(MW)Electrical power produced by the generator";
+  Units.SI.MassFlowRate Qair(start=710) "Air mass flow rate";
+  Units.SI.MassFlowRate Qcoal(start=70) "Coal mass flow rate";
+  Units.SI.MassFlowRate Qwater(start=600) "Water mass flow rate";
+
+  InstrumentationAndControl.Connectors.InputReal Electrical_power_MW
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}},   rotation=-90,
+        origin={-10,96})));
+  InstrumentationAndControl.Connectors.OutputReal Q_air
+                              annotation (Placement(transformation(
+        origin={110,-9},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  InstrumentationAndControl.Connectors.OutputReal Q_coal
+                              annotation (Placement(transformation(
+        origin={110,75},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  InstrumentationAndControl.Connectors.OutputReal Q_water
+                              annotation (Placement(transformation(
+        origin={110,-89},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+equation
+  //if (cardinality(Electrical_power_Percent) == 0) then
+  //  Electrical_power_Percent.signal = 100;
+  //end if;
+
+  if (cardinality(Electrical_power_MW) == 0) then
+    Electrical_power_MW.signal = 804.461;
+  end if;
+
+  Welec = Electrical_power_MW.signal;
+  //Qair = 45.38 + 0.8249*Welec;
+  //Qcoal = - 2.4172 + 0.0849*Welec;
+
+  Qair = 46.0 + 0.8229*Welec;
+  Qcoal = - 2.3534 + 0.0847*Welec;
+
+  //Qwater = 23.484 + 0.7166*Welec;
+  Qwater = 23.524 + 0.7166*Welec;
+
+  //Qwater = 23.523 + 0.7166*Welec;
+
+  Q_air.signal = Qair;
+  Q_coal.signal = Qcoal;
+  Q_water.signal = Qwater;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-100,86},{100,-100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-32,92},{144,56}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qcoal"),
+        Text(
+          extent={{10,-72},{96,-102}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qwater"),
+        Text(
+          extent={{30,12},{100,-26}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qair")}), Icon(graphics={
+        Rectangle(
+          extent={{-100,86},{100,-100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-34,91},{142,55}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qcoal"),
+        Text(
+          extent={{22,12},{102,-28}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qair"),
+        Text(
+          extent={{-6,-70},{98,-104}},
+          lineColor={255,255,255},
+          pattern=LinePattern.Dash,
+          fillColor={135,135,135},
+          fillPattern=FillPattern.Solid,
+          textString="Qwater")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end MassFlowRateAirCoalWater;
diff --git a/ThermoSysPro/Fluid/Examples/Control/Pump_VelocityControl.mo b/ThermoSysPro/Fluid/Examples/Control/Pump_VelocityControl.mo
index a2a1c04a32a753e10746435b8bdbaf35c169da05..e429fdc90917ab8ee29b71f67abcb79bef7d9343 100644
--- a/ThermoSysPro/Fluid/Examples/Control/Pump_VelocityControl.mo
+++ b/ThermoSysPro/Fluid/Examples/Control/Pump_VelocityControl.mo
@@ -1,111 +1,111 @@
-within ThermoSysPro.Fluid.Examples.Control;
-model Pump_VelocityControl "Drum level control"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=0.01 "Minimum output value";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Mesure_Vrot
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Consigne_Vrot
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    k=k,
-    Ti=Ti,
-    maxval=2000,
-    minval=1000,
-    ureset0=1400)
-    annotation (Placement(transformation(
-        origin={-10,-56.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    Ti=10,
-    U0=1400)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{48,53},{83,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(Mesure_Vrot, pT1_1.u)     annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(Consigne_Vrot, add.u2)     annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
-  annotation (
-    Diagram(
-      coordinateSystem(preserveAspectRatio=false,extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1),
-      graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString=
-               "Debit"),
-        Text(
-          extent={{-101,-59},{-55,-91}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne debit"),
-        Text(
-          extent={{64,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString=
-               "Vitesse")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={170,255,213},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-88,65},{74,-26}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Régulation Niveau "),
-        Text(
-          extent={{-41,-9},{38,-58}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Bache"),
-        Text(
-          extent={{-98,93},{-60,85}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-31},{-52,-64}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Pump_VelocityControl;
+within ThermoSysPro.Fluid.Examples.Control;
+model Pump_VelocityControl "Drum level control"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=0.01 "Minimum output value";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Mesure_Vrot
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Consigne_Vrot
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    k=k,
+    Ti=Ti,
+    maxval=2000,
+    minval=1000,
+    ureset0=1400)
+    annotation (Placement(transformation(
+        origin={-10,-56.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    Ti=10,
+    U0=1400)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{48,53},{83,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-82.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(Mesure_Vrot, pT1_1.u)     annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(Consigne_Vrot, add.u2)     annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{46.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{46.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{84.75,72.5},{96,72.5},{96,-30.65},{-10,-30.65}}));
+  annotation (
+    Diagram(
+      coordinateSystem(preserveAspectRatio=false,extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1),
+      graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString=
+               "Debit"),
+        Text(
+          extent={{-101,-59},{-55,-91}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne debit"),
+        Text(
+          extent={{64,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString=
+               "Vitesse")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={170,255,213},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-88,65},{74,-26}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Régulation Niveau "),
+        Text(
+          extent={{-41,-9},{38,-58}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Bache"),
+        Text(
+          extent={{-98,93},{-60,85}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-31},{-52,-64}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Pump_VelocityControl;
diff --git a/ThermoSysPro/Fluid/Examples/Control/TemperatureControl.mo b/ThermoSysPro/Fluid/Examples/Control/TemperatureControl.mo
index 155362a05deb6ed4404f6355a785306c71ddb010..da7ceba5f8186b37e6ea94eda4b556a8d172ea84 100644
--- a/ThermoSysPro/Fluid/Examples/Control/TemperatureControl.mo
+++ b/ThermoSysPro/Fluid/Examples/Control/TemperatureControl.mo
@@ -1,107 +1,107 @@
-within ThermoSysPro.Fluid.Examples.Control;
-model TemperatureControl "Temperature_Control"
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Time constant (s)";
-  parameter Real minval=0.01 "Minimum output value";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
-    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
-    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
-    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
-           0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
-    permanent=true,
-    k=k,
-    Ti=Ti,
-    minval=minval,
-    ureset0=0.2)
-    annotation (Placement(transformation(
-        origin={-10,-57.5},
-        extent={{-23.5,-29},{23.5,29}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
-    Ti=10,
-    U0=620)
-    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
-                                          annotation (Placement(transformation(
-          extent={{49,53},{84,92}}, rotation=0)));
-equation
-  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-83.35},{-10,
-          -90},{105,-90}}, color={255,0,0}));
-  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
-          {-38,84},{-14.55,84}}, color={127,0,0}));
-  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
-          -60},{-68,42},{35,42},{35,60.8},{47.25,60.8}}));
-  connect(pT1_1.y, add.u1)
-    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{47.25,84.2}}));
-  connect(add.y, pIsat.u)
-    annotation (Line(points={{85.75,72.5},{96,72.5},{96,-31.65},{-10,-31.65}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=true,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-97,99},{-59,91}},
-          lineColor={127,0,0},
-          textString="Temperature"),
-        Text(
-          extent={{-101,-62},{-49,-86}},
-          lineColor={127,0,0},
-          textString="Temperature Set Point"),
-        Text(
-          extent={{59,-92},{102,-100}},
-          lineColor={127,0,0},
-          textString="Valve opening")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={1,1},
-        initialScale=0.1), graphics={
-        Rectangle(extent={{-100,100},{100,-100}}),
-        Rectangle(
-          extent={{-80,81},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-77,55},{85,-36}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Régulation Niveau "),
-        Text(
-          extent={{-30,-15},{49,-64}},
-          lineColor={0,0,255},
-          fillColor={255,255,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Bache"),
-        Text(
-          extent={{-98,93},{-60,85}},
-          lineColor={127,0,0},
-          textString=
-               "Niveau ballon"),
-        Text(
-          extent={{-101,-31},{-52,-64}},
-          lineColor={127,0,0},
-          textString=
-               "Consigne Niveau"),
-        Text(
-          extent={{64,-86},{102,-94}},
-          lineColor={127,0,0},
-          textString=
-               "Ouv Vanne")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TemperatureControl;
+within ThermoSysPro.Fluid.Examples.Control;
+model TemperatureControl "Temperature_Control"
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Time constant (s)";
+  parameter Real minval=0.01 "Minimum output value";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal MesureNiveauEau
+    annotation (Placement(transformation(extent={{-110,85},{-100,95}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ConsigneNiveauEau
+    annotation (Placement(transformation(extent={{-110,-65},{-100,-55}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReelle1
+    annotation (Placement(transformation(extent={{100,-95},{110,-85}}, rotation=
+           0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PIsat pIsat(
+    permanent=true,
+    k=k,
+    Ti=Ti,
+    minval=minval,
+    ureset0=0.2)
+    annotation (Placement(transformation(
+        origin={-10,-57.5},
+        extent={{-23.5,-29},{23.5,29}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Continu.PT1 pT1_1(                              permanent=true,
+    Ti=10,
+    U0=620)
+    annotation (Placement(transformation(extent={{-13,69},{18,99}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add add(                          k1=-1, k2=+1)
+                                          annotation (Placement(transformation(
+          extent={{49,53},{84,92}}, rotation=0)));
+equation
+  connect(pIsat.y, SortieReelle1)  annotation (Line(points={{-10,-83.35},{-10,
+          -90},{105,-90}}, color={255,0,0}));
+  connect(MesureNiveauEau, pT1_1.u) annotation (Line(points={{-105,90},{-38,90},
+          {-38,84},{-14.55,84}}, color={127,0,0}));
+  connect(ConsigneNiveauEau, add.u2) annotation (Line(points={{-105,-60},{-68,
+          -60},{-68,42},{35,42},{35,60.8},{47.25,60.8}}));
+  connect(pT1_1.y, add.u1)
+    annotation (Line(points={{19.55,84},{32.9,84},{32.9,84.2},{47.25,84.2}}));
+  connect(add.y, pIsat.u)
+    annotation (Line(points={{85.75,72.5},{96,72.5},{96,-31.65},{-10,-31.65}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=true,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-97,99},{-59,91}},
+          lineColor={127,0,0},
+          textString="Temperature"),
+        Text(
+          extent={{-101,-62},{-49,-86}},
+          lineColor={127,0,0},
+          textString="Temperature Set Point"),
+        Text(
+          extent={{59,-92},{102,-100}},
+          lineColor={127,0,0},
+          textString="Valve opening")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={1,1},
+        initialScale=0.1), graphics={
+        Rectangle(extent={{-100,100},{100,-100}}),
+        Rectangle(
+          extent={{-80,81},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-77,55},{85,-36}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Régulation Niveau "),
+        Text(
+          extent={{-30,-15},{49,-64}},
+          lineColor={0,0,255},
+          fillColor={255,255,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Bache"),
+        Text(
+          extent={{-98,93},{-60,85}},
+          lineColor={127,0,0},
+          textString=
+               "Niveau ballon"),
+        Text(
+          extent={{-101,-31},{-52,-64}},
+          lineColor={127,0,0},
+          textString=
+               "Consigne Niveau"),
+        Text(
+          extent={{64,-86},{102,-94}},
+          lineColor={127,0,0},
+          textString=
+               "Ouv Vanne")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TemperatureControl;
diff --git a/ThermoSysPro/Fluid/Examples/Control/package.mo b/ThermoSysPro/Fluid/Examples/Control/package.mo
index d1707e093705e513e583a08fd69efcb459672c5a..575f3f6a9e8f676b552349eba620a838faece4ab 100644
--- a/ThermoSysPro/Fluid/Examples/Control/package.mo
+++ b/ThermoSysPro/Fluid/Examples/Control/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Fluid.Examples;
-package Control "Control library for the power plant models"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021 </p>
-<p><b>ThermoSysPro Version 4.0 </p>
-<p>This package contains control blocks for the examples package.</h4>
-</html>"));
-end Control;
+within ThermoSysPro.Fluid.Examples;
+package Control "Control library for the power plant models"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021 </p>
+<p><b>ThermoSysPro Version 4.0 </p>
+<p>This package contains control blocks for the examples package.</h4>
+</html>"));
+end Control;
diff --git a/ThermoSysPro/Fluid/Examples/Control/package.order b/ThermoSysPro/Fluid/Examples/Control/package.order
index 8bf808ecaaa4925ac44ca9e09be3492a252fd0a9..c0a6d4fba4f11ae3e89e63412560b11496a47299 100644
--- a/ThermoSysPro/Fluid/Examples/Control/package.order
+++ b/ThermoSysPro/Fluid/Examples/Control/package.order
@@ -1,8 +1,8 @@
-Condenser_LevelControl
-Condenser_LevelControl_RE5
-Drum_LevelControl
-LevelControl
-MassFlowControl
-MassFlowRateAirCoalWater
-Pump_VelocityControl
-TemperatureControl
+Condenser_LevelControl
+Condenser_LevelControl_RE5
+Drum_LevelControl
+LevelControl
+MassFlowControl
+MassFlowRateAirCoalWater
+Pump_VelocityControl
+TemperatureControl
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo
index f0b55c93518f86994d3acdc8b7bf61301348156b..eb7bcf4f51f43c0d22a98e54875368b6160f0a73 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo
@@ -1,55 +1,55 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestAirHumidity
-
-  ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity(hum0=0.9,
-    ppvap0(start=2085.0),
-    rho_air(start=1.14),
-    rho_vap(start=0.015))
-    annotation (Placement(transformation(extent={{-10,0},{10,20}},  rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss(K=1.e-5, rho(start=1.17))
-                                  annotation (Placement(transformation(extent={{40,0},{
-            60,20}},        rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases
-    annotation (Placement(transformation(extent={{80,0},{100,20}},rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ              sourceFlueGasesPQ(
-    option_temperature=true,
-    Xco2=0,
-    Xh2o=0.0132625,
-    Xo2=0.217282,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=100000,
-    T0=293)   annotation (Placement(transformation(extent={{-80,0},{-60,20}},
-          rotation=0)));
-
-equation
-  connect(airHumidity.C2, singularPressureLoss.C1)
-    annotation (Line(points={{10,10},{40,10}}, color={0,0,0}));
-  connect(singularPressureLoss.C2, sinkFlueGases.C)
-    annotation (Line(points={{60,10},{80,10}},                 color={0,0,0}));
-  connect(sourceFlueGasesPQ.C, airHumidity.C1)
-    annotation (Line(points={{-60,10},{-10,10}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestAirHumidity;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestAirHumidity
+
+  ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity(hum0=0.9,
+    ppvap0(start=2085.0),
+    rho_air(start=1.14),
+    rho_vap(start=0.015))
+    annotation (Placement(transformation(extent={{-10,0},{10,20}},  rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss(K=1.e-5, rho(start=1.17))
+                                  annotation (Placement(transformation(extent={{40,0},{
+            60,20}},        rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases
+    annotation (Placement(transformation(extent={{80,0},{100,20}},rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ              sourceFlueGasesPQ(
+    option_temperature=true,
+    Xco2=0,
+    Xh2o=0.0132625,
+    Xo2=0.217282,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=100000,
+    T0=293)   annotation (Placement(transformation(extent={{-80,0},{-60,20}},
+          rotation=0)));
+
+equation
+  connect(airHumidity.C2, singularPressureLoss.C1)
+    annotation (Line(points={{10,10},{40,10}}, color={0,0,0}));
+  connect(singularPressureLoss.C2, sinkFlueGases.C)
+    annotation (Line(points={{60,10},{80,10}},                 color={0,0,0}));
+  connect(sourceFlueGasesPQ.C, airHumidity.C1)
+    annotation (Line(points={{-60,10},{-10,10}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestAirHumidity;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo
index 9f691b13ec5848d96471ffcb18534c2ecd1014bd..c2f45d3949f0a46ab649bfa4742ee6c727355b65 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo
@@ -1,49 +1,49 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestBend
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-100,26},{-80,46}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1
-                                          annotation (Placement(transformation(
-          extent={{60,0},{80,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.Bend Bend   annotation (Placement(
-        transformation(extent={{-20,26},{0,46}}, rotation=0)));
-equation
-  connect(Bend.C2, SinkP1.C)
-    annotation (Line(points={{-10,26},{-10,10},{60,10}}, color={0,0,255}));
-  connect(SourceP1.C, Bend.C1)
-    annotation (Line(points={{-80,36},{-20,36}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestBend;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestBend
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-100,26},{-80,46}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1
+                                          annotation (Placement(transformation(
+          extent={{60,0},{80,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.Bend Bend   annotation (Placement(
+        transformation(extent={{-20,26},{0,46}}, rotation=0)));
+equation
+  connect(Bend.C2, SinkP1.C)
+    annotation (Line(points={{-10,26},{-10,10},{60,10}}, color={0,0,255}));
+  connect(SourceP1.C, Bend.C1)
+    annotation (Line(points={{-80,36},{-20,36}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestBend;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo
index 90c7cfa687c8803534d36e228ecda245d5a8c89e..d1067a1a558b984f09bcd822ae72961e60395919 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo
@@ -1,69 +1,69 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestBoilerSystem
-  import ThermoSysPro;
-  ThermoSysPro.Fluid.Boilers.BoilerSystem BoilerSystem(
-    Wloss=0,
-    Ke=1.e6,
-    Tsf=386.16)
-    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
-    Xco2=0,
-    Xh2o=0.01,
-    Q0=27.,
-    Xo2=0.233,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    T0=298.16,
-    option_temperature=true)
-               annotation (Placement(transformation(extent={{-102,-92},{-63,-55}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
-          extent={{-56,51},{-98,90}},  rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
-    Q0=24.,
-    h0=600e3,
-    P0=14000000)
-    annotation (Placement(transformation(extent={{105,-88},{69,-54}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{70,53},{106,89}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3)
-    annotation (Placement(transformation(extent={{60,-77},{52,-65}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3)
-    annotation (Placement(transformation(extent={{53,65},{61,77}}, rotation=0)));
-equation
-  connect(singularPressureLoss1.C2, sink.C)
-    annotation (Line(points={{61,71},{70,71}}, color={0,0,255}));
-  connect(BoilerSystem.OutletWaterSteam, singularPressureLoss1.C1) annotation (
-      Line(points={{38.5714,51},{38.5714,71},{53,71}}, color={0,0,0}));
-  connect(BoilerSystem.InletWaterSteam, singularPressureLoss.C2) annotation (
-      Line(points={{38.5714,-51},{38.5714,-71},{52,-71}}, color={0,0,0}));
-  connect(singularPressureLoss.C1, sourcePQ.C) annotation (Line(points={{60,-71},
-          {66,-71},{66,-71},{69,-71}}, color={0,0,0}));
-  connect(sinkP.C, BoilerSystem.OutletFlueGases) annotation (Line(points={{-56,
-          70.5},{-38.5714,70.5},{-38.5714,51}}, color={0,0,0}));
-  connect(sourceQ.C, BoilerSystem.InletFlueGases) annotation (Line(points={{-63,
-          -73.5},{-38.5714,-73.5},{-38.5714,-51}}, color={0,0,0}));
-  annotation (                   Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestBoilerSystem;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestBoilerSystem
+  import ThermoSysPro;
+  ThermoSysPro.Fluid.Boilers.BoilerSystem BoilerSystem(
+    Wloss=0,
+    Ke=1.e6,
+    Tsf=386.16)
+    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+    Xco2=0,
+    Xh2o=0.01,
+    Q0=27.,
+    Xo2=0.233,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    T0=298.16,
+    option_temperature=true)
+               annotation (Placement(transformation(extent={{-102,-92},{-63,-55}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
+          extent={{-56,51},{-98,90}},  rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+    Q0=24.,
+    h0=600e3,
+    P0=14000000)
+    annotation (Placement(transformation(extent={{105,-88},{69,-54}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{70,53},{106,89}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3)
+    annotation (Placement(transformation(extent={{60,-77},{52,-65}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3)
+    annotation (Placement(transformation(extent={{53,65},{61,77}}, rotation=0)));
+equation
+  connect(singularPressureLoss1.C2, sink.C)
+    annotation (Line(points={{61,71},{70,71}}, color={0,0,255}));
+  connect(BoilerSystem.OutletWaterSteam, singularPressureLoss1.C1) annotation (
+      Line(points={{38.5714,51},{38.5714,71},{53,71}}, color={0,0,0}));
+  connect(BoilerSystem.InletWaterSteam, singularPressureLoss.C2) annotation (
+      Line(points={{38.5714,-51},{38.5714,-71},{52,-71}}, color={0,0,0}));
+  connect(singularPressureLoss.C1, sourcePQ.C) annotation (Line(points={{60,-71},
+          {66,-71},{66,-71},{69,-71}}, color={0,0,0}));
+  connect(sinkP.C, BoilerSystem.OutletFlueGases) annotation (Line(points={{-56,
+          70.5},{-38.5714,70.5},{-38.5714,51}}, color={0,0,0}));
+  connect(sourceQ.C, BoilerSystem.InletFlueGases) annotation (Line(points={{-63,
+          -73.5},{-38.5714,-73.5},{-38.5714,-51}}, color={0,0,0}));
+  annotation (                   Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestBoilerSystem;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo
index 3e43756dcc4dc38da3a00e2978269f8b48e99ef8..d7218f4bc8f9e5e4be0f939eee91f115e0cdbbc5 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo
@@ -1,49 +1,49 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestCHPEngineBarkantineSystem
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-  Machines.CHPEngineBarkantineSystem CHPBarkantine annotation (Placement(
-        transformation(extent={{-40,0},{20,60}}, rotation=0)));
-equation
-  connect(SourceP1.C, CHPBarkantine.inletWaterSteam) annotation (Line(points={{
-          -80,30},{-50,30},{-50,45},{-40,45}}, color={0,0,0}));
-  connect(CHPBarkantine.outletWaterSteam, PuitsP1.C)
-    annotation (Line(points={{20,45},{30,45},{30,30},{60,30}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-   Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestCHPEngineBarkantineSystem;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestCHPEngineBarkantineSystem
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+  Machines.CHPEngineBarkantineSystem CHPBarkantine annotation (Placement(
+        transformation(extent={{-40,0},{20,60}}, rotation=0)));
+equation
+  connect(SourceP1.C, CHPBarkantine.inletWaterSteam) annotation (Line(points={{
+          -80,30},{-50,30},{-50,45},{-40,45}}, color={0,0,0}));
+  connect(CHPBarkantine.outletWaterSteam, PuitsP1.C)
+    annotation (Line(points={{20,45},{30,45},{30,30},{60,30}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+   Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestCHPEngineBarkantineSystem;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo
index 7267e1d908fab86405d11878bc367ef2e5a9a78c..f5bf368340dd764fe7ebb7dfacd2aecb28d6abd8 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo
@@ -1,86 +1,86 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestCentrifugalPump1
-
-  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(
-    mode_car=1,
-    mode_car_hn=1,
-    mode_car_Cr=1,
-    dynamic_mech_equation=false)
-                     annotation (Placement(transformation(extent={{-20,20},{0,
-            40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=10,
-    Duration=100,
-    Initialvalue=1400,
-    Finalvalue=0) annotation (Placement(transformation(extent={{-100,-20},{-80,
-            0}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
-    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-20},
-            {-40,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ1(    Q0=0)
-    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump1(
-    mode_car=1,
-    mode_car_hn=1,
-    mode_car_Cr=1)   annotation (Placement(transformation(extent={{-20,-60},{0,
-            -40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink1
-    annotation (Placement(transformation(extent={{40,-60},{60,-40}}, rotation=0)));
-equation
-  connect(sourcePQ.C, centrifugalPump.C1)
-    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
-  connect(centrifugalPump.C2, sink.C)
-    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
-  connect(sourceAngularVelocity.M, centrifugalPump.M)
-    annotation (Line(points={{-39,-10},{-10,-10},{-10,19}}));
-  connect(sourcePQ1.C, centrifugalPump1.C1)
-    annotation (Line(points={{-60,-50},{-20,-50}}, color={0,0,255}));
-  connect(centrifugalPump1.C2, sink1.C)
-    annotation (Line(points={{0,-50},{40,-50}}, color={0,0,255}));
-  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
-    annotation (Line(points={{-79,-10},{-55,-10}}));
-  annotation (experiment(StopTime=1000),
-    Diagram(graphics={
-        Text(
-          extent={{-100,100},{-60,80}},
-          lineColor={0,0,255},
-          textString=
-               "w=1 ==> w=0"),
-        Text(
-          extent={{-100,80},{-60,60}},
-          lineColor={0,0,255},
-          textString=
-               "q=0"),
-        Text(
-          extent={{-100,60},{-60,40}},
-          lineColor={0,0,255},
-          textString=
-               "theta=0 ==> theta=-180")}),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestCentrifugalPump1;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestCentrifugalPump1
+
+  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(
+    mode_car=1,
+    mode_car_hn=1,
+    mode_car_Cr=1,
+    dynamic_mech_equation=false)
+                     annotation (Placement(transformation(extent={{-20,20},{0,
+            40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0=0)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=10,
+    Duration=100,
+    Initialvalue=1400,
+    Finalvalue=0) annotation (Placement(transformation(extent={{-100,-20},{-80,
+            0}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity
+    sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-20},
+            {-40,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ1(    Q0=0)
+    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump1(
+    mode_car=1,
+    mode_car_hn=1,
+    mode_car_Cr=1)   annotation (Placement(transformation(extent={{-20,-60},{0,
+            -40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink1
+    annotation (Placement(transformation(extent={{40,-60},{60,-40}}, rotation=0)));
+equation
+  connect(sourcePQ.C, centrifugalPump.C1)
+    annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255}));
+  connect(centrifugalPump.C2, sink.C)
+    annotation (Line(points={{0,30},{40,30}}, color={0,0,255}));
+  connect(sourceAngularVelocity.M, centrifugalPump.M)
+    annotation (Line(points={{-39,-10},{-10,-10},{-10,19}}));
+  connect(sourcePQ1.C, centrifugalPump1.C1)
+    annotation (Line(points={{-60,-50},{-20,-50}}, color={0,0,255}));
+  connect(centrifugalPump1.C2, sink1.C)
+    annotation (Line(points={{0,-50},{40,-50}}, color={0,0,255}));
+  connect(rampe.y, sourceAngularVelocity.IAngularVelocity)
+    annotation (Line(points={{-79,-10},{-55,-10}}));
+  annotation (experiment(StopTime=1000),
+    Diagram(graphics={
+        Text(
+          extent={{-100,100},{-60,80}},
+          lineColor={0,0,255},
+          textString=
+               "w=1 ==> w=0"),
+        Text(
+          extent={{-100,80},{-60,60}},
+          lineColor={0,0,255},
+          textString=
+               "q=0"),
+        Text(
+          extent={{-100,60},{-60,40}},
+          lineColor={0,0,255},
+          textString=
+               "theta=0 ==> theta=-180")}),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestCentrifugalPump1;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo
index 28a515e0db175b8bca228fd6f4c78557e6943380..cde4b3b7c1091f143928c6e405f63f39fb58cb67 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo
@@ -1,101 +1,101 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestCheckValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
-                                    annotation (Placement(transformation(extent=
-           {{-104,20},{-84,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(
-                                  P0=6e5) annotation (Placement(transformation(
-          extent={{84,20},{104,40}}, rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump1
-    annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump2
-    annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeD volumeD annotation (Placement(
-        transformation(extent={{-50,20},{-30,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve1
-    annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve2
-    annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC volumeC annotation (Placement(
-        transformation(extent={{30,20},{50,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP
-                                        annotation (Placement(transformation(
-          extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1
-                                         annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-60,-80},{-40,-60}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{20,-80},{40,-60}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    amplitude=6e5,
-    width=50,
-    period=100,
-    offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80,
-            -60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3
-    annotation (Placement(transformation(extent={{-20,-80},{0,-60}}, rotation=0)));
-equation
-  connect(staticCentrifugalPump1.C2, checkValve1.C1) annotation (Line(points={{-10,70},
-          {9,70}},                         color={0,0,255}));
-  connect(staticCentrifugalPump2.C2, checkValve2.C1) annotation (Line(points={{
-          -10,-10},{0,-10},{0,-10},{7,-10}}, color={0,0,255}));
-  connect(perteDP1.C2, puitsP.C)
-    annotation (Line(points={{80,30},{84,30}}, color={0,0,255}));
-  connect(sourceP.C, perteDP.C1)
-    annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255}));
-  connect(sourceP1.C, checkValve3.C1)
-    annotation (Line(points={{-40,-70},{-21,-70}}, color={0,0,255}));
-  connect(checkValve3.C2, puitsP1.C)
-    annotation (Line(points={{1,-70},{20,-70}}, color={0,0,255}));
-  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55,
-          -70}}));
-  connect(volumeD.Cs1, staticCentrifugalPump1.C1)
-    annotation (Line(points={{-40,40},{-40,70},{-30,70}}, color={0,0,0}));
-  connect(volumeD.Cs2, staticCentrifugalPump2.C1)
-    annotation (Line(points={{-40,20},{-40,-10},{-30,-10}}, color={0,0,0}));
-  connect(checkValve1.C2, volumeC.Ce2)
-    annotation (Line(points={{31,70},{40,70},{40,40}}, color={0,0,0}));
-  connect(checkValve2.C2, volumeC.Ce3)
-    annotation (Line(points={{29,-10},{40,-10},{40,20}}, color={0,0,0}));
-  connect(volumeC.Cs, perteDP1.C1)
-    annotation (Line(points={{50,30},{60,30}}, color={0,0,0}));
-  connect(perteDP.C2, volumeD.Ce)
-    annotation (Line(points={{-60,30},{-50,30}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestCheckValve;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestCheckValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
+                                    annotation (Placement(transformation(extent=
+           {{-104,20},{-84,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(
+                                  P0=6e5) annotation (Placement(transformation(
+          extent={{84,20},{104,40}}, rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump1
+    annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump2
+    annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeD volumeD annotation (Placement(
+        transformation(extent={{-50,20},{-30,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve1
+    annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve2
+    annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC volumeC annotation (Placement(
+        transformation(extent={{30,20},{50,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP
+                                        annotation (Placement(transformation(
+          extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1
+                                         annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-60,-80},{-40,-60}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{20,-80},{40,-60}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    amplitude=6e5,
+    width=50,
+    period=100,
+    offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80,
+            -60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3
+    annotation (Placement(transformation(extent={{-20,-80},{0,-60}}, rotation=0)));
+equation
+  connect(staticCentrifugalPump1.C2, checkValve1.C1) annotation (Line(points={{-10,70},
+          {9,70}},                         color={0,0,255}));
+  connect(staticCentrifugalPump2.C2, checkValve2.C1) annotation (Line(points={{
+          -10,-10},{0,-10},{0,-10},{7,-10}}, color={0,0,255}));
+  connect(perteDP1.C2, puitsP.C)
+    annotation (Line(points={{80,30},{84,30}}, color={0,0,255}));
+  connect(sourceP.C, perteDP.C1)
+    annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255}));
+  connect(sourceP1.C, checkValve3.C1)
+    annotation (Line(points={{-40,-70},{-21,-70}}, color={0,0,255}));
+  connect(checkValve3.C2, puitsP1.C)
+    annotation (Line(points={{1,-70},{20,-70}}, color={0,0,255}));
+  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55,
+          -70}}));
+  connect(volumeD.Cs1, staticCentrifugalPump1.C1)
+    annotation (Line(points={{-40,40},{-40,70},{-30,70}}, color={0,0,0}));
+  connect(volumeD.Cs2, staticCentrifugalPump2.C1)
+    annotation (Line(points={{-40,20},{-40,-10},{-30,-10}}, color={0,0,0}));
+  connect(checkValve1.C2, volumeC.Ce2)
+    annotation (Line(points={{31,70},{40,70},{40,40}}, color={0,0,0}));
+  connect(checkValve2.C2, volumeC.Ce3)
+    annotation (Line(points={{29,-10},{40,-10},{40,20}}, color={0,0,0}));
+  connect(volumeC.Cs, perteDP1.C1)
+    annotation (Line(points={{50,30},{60,30}}, color={0,0,0}));
+  connect(perteDP.C2, volumeD.Ce)
+    annotation (Line(points={{-60,30},{-50,30}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestCheckValve;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo
index 31b2b18904c23ad0ac76e333cd92fdab33e354f5..b78f44a18eb373215696cfbca6a7a441f2b3ced6 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo
@@ -1,66 +1,66 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestCombustionTurbine
-  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
-  parameter Real Qred1(fixed=false,start=0.01) "Reduced mass flow rate";
-
-  ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine(
-    tau_n=0.065,
-    is_eff_n=is_eff_n1,
-    Qred=Qred1,
-    Pe(fixed=true, start=1500000),
-    Ts(fixed=true, start=830)) annotation (Placement(transformation(extent={{
-            -42,-42},{36,42}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1(
-    Xso2=0,
-    Q0=430,
-    Xco2=0.06,
-    Xh2o=0.06,
-    Xo2=0.14,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    T0=1500,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-106,-10},{-86,10}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=1e5)
-    annotation (Placement(transformation(
-        origin={94,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8)
-    annotation (Placement(transformation(extent={{-100,-42},{-80,-22}},
-          rotation=0)));
-equation
-  connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line(
-      points={{-86,0},{-42,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line(
-      points={{36,0},{84,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Wc1.y, CombustionTurbine.CompressorPower)
-    annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}}));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestCombustionTurbine;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestCombustionTurbine
+  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
+  parameter Real Qred1(fixed=false,start=0.01) "Reduced mass flow rate";
+
+  ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine(
+    tau_n=0.065,
+    is_eff_n=is_eff_n1,
+    Qred=Qred1,
+    Pe(fixed=true, start=1500000),
+    Ts(fixed=true, start=830)) annotation (Placement(transformation(extent={{
+            -42,-42},{36,42}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1(
+    Xso2=0,
+    Q0=430,
+    Xco2=0.06,
+    Xh2o=0.06,
+    Xo2=0.14,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    T0=1500,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-106,-10},{-86,10}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=1e5)
+    annotation (Placement(transformation(
+        origin={94,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8)
+    annotation (Placement(transformation(extent={{-100,-42},{-80,-22}},
+          rotation=0)));
+equation
+  connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line(
+      points={{-86,0},{-42,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line(
+      points={{36,0},{84,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Wc1.y, CombustionTurbine.CompressorPower)
+    annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}}));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestCombustionTurbine;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo
index 21d246273b73470266cef2a7daa36875079bf269..4556c8dbf2656c62043eeec6dac2db3b9533ebe4 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo
@@ -1,61 +1,61 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestCompressor
-  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
-
-  ThermoSysPro.Fluid.Machines.Compressor Compressor(
-    Ps(fixed=false),
-    tau_n=16,
-    is_eff_n=is_eff_n1,
-    Pe(fixed=false, start=100000),
-    Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{
-            -52,-52},{48,52}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1(
-    Xso2=0,
-    Xco2=0.0,
-    Xh2o=0.003,
-    Xo2=0.23,
-    Q0=420,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=100000,
-    T0=288,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=15.8e5)
-    annotation (Placement(transformation(
-        origin={96,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-equation
-  connect(SourceQ1.C, Compressor.Ce) annotation (Line(
-      points={{-84,0},{-39.5,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Compressor.Cs, SinkP1.C) annotation (Line(
-      points={{35.5,0},{86,0}},
-      color={0,0,0},
-      thickness=1));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestCompressor;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestCompressor
+  parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency";
+
+  ThermoSysPro.Fluid.Machines.Compressor Compressor(
+    Ps(fixed=false),
+    tau_n=16,
+    is_eff_n=is_eff_n1,
+    Pe(fixed=false, start=100000),
+    Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{
+            -52,-52},{48,52}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1(
+    Xso2=0,
+    Xco2=0.0,
+    Xh2o=0.003,
+    Xo2=0.23,
+    Q0=420,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=100000,
+    T0=288,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=15.8e5)
+    annotation (Placement(transformation(
+        origin={96,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+equation
+  connect(SourceQ1.C, Compressor.Ce) annotation (Line(
+      points={{-84,0},{-39.5,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Compressor.Cs, SinkP1.C) annotation (Line(
+      points={{35.5,0},{86,0}},
+      color={0,0,0},
+      thickness=1));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestCompressor;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo
index eb750668b2a1e81ae8c423bc7f33c6ad2496c8f7..ed2d06a6b89953b6d56782ea96427dc1745bcb69 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo
@@ -1,50 +1,50 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDiaphragm
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{44,-10},{64,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm
-                                          annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}},
-                                    rotation=0)));
-equation
-  connect(Diaphragm.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
-  connect(SourceP1.C, Diaphragm.C1)
-    annotation (Line(points={{-44,0},{-10,0}},   color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDiaphragm;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDiaphragm
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{44,-10},{64,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm
+                                          annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}},
+                                    rotation=0)));
+equation
+  connect(Diaphragm.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{44,0}},  color={0,0,255}));
+  connect(SourceP1.C, Diaphragm.C1)
+    annotation (Line(points={{-44,0},{-10,0}},   color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDiaphragm;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo
index 4695feb21c6a35bd466640de682a98eaa80d1292..66e7f60099c6622b22d4acae03b1ebdf5259ae8f 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDiffusion_DynamicOnePhaseFlowPipe
-
-  HeatExchangers.DynamicOnePhaseFlowPipe
-    dynamicOnePhaseFlowPipe(L=20,
-    Q(start={5.492026593727256E-28,5.492026607285849E-28,5.492026607285849E-28,
-          5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28,
-          5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28,
-          5.492026607285849E-28,5.492026607285849E-28}),
-    h(start={84011.8111671368,96057.08454715868,107718.52365349933,
-          119295.22918923412,130792.44987567255,142215.00322033433,
-          153567.34130353143,164853.6027022597,176077.65400298327,
-          187243.1234252416,198353.42841254506,209411.79856705698}),
-    continuous_flow_reversal=true,
-    inertia=false,
-    dynamic_mass_balance=false,
-    advection=true,
-    dynamic_energy_balance=false,
-    diffusion=true,
-    P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983,
-          99999.999999985,99999.999999988,99999.99999999,99999.999999992,100000,
-          100000,100000,100000}))
-                            annotation (Placement(transformation(extent={{-10,30},
-            {10,50}},    rotation=0)));
-  BoundaryConditions.SourceP                                 sourceP(
-    continuous_flow_reversal=true,
-    diffusion=true,
-    P0=100000,
-    T0=293.15)
-    annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0)));
-
-  BoundaryConditions.SinkP                                 sinkP(diffusion=true,
-      T0=323.15)
-    annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0)));
-  Thermal.BoundaryConditions.HeatSource              heatSource(
-    option_temperature=2,
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    W0={0,0,0,0,0,0,0,0,0,0})
-    annotation (Placement(transformation(extent={{-10,70},{10,90}},rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall(Ns=10,
-      dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-10,50},{10,70}},rotation=0)));
-  PressureLosses.SwitchValve switchValve(Qmin=0)
-    annotation (Placement(transformation(extent={{-40,36},{-20,56}})));
-  InstrumentationAndControl.Blocks.Logique.Echelon echelon(startTime=1)
-    annotation (Placement(transformation(extent={{-74,66},{-66,74}})));
-  InstrumentationAndControl.Blocks.Logique.NONL nONL
-    annotation (Placement(transformation(extent={{-54,66},{-46,74}})));
-  HeatExchangers.DynamicOnePhaseFlowPipe
-    dynamicOnePhaseFlowPipe1(
-                            L=20,
-    Q(start={4.9243335191367076E-05,4.924351014778949E-05,4.924351014778949E-05,
-          4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05,
-          4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05,
-          4.924351014778949E-05,4.924351014778949E-05}),
-    h(start={84011.8111671368,95792.53373784182,107482.21110144592,
-          119086.65906940492,130611.17116650468,142060.60442474802,
-          153439.44619534744,164751.8668430315,176001.7618457063,
-          187192.78587129858,198328.3807233511,209411.79856705698}),
-    continuous_flow_reversal=true,
-    inertia=false,
-    dynamic_mass_balance=false,
-    advection=true,
-    dynamic_energy_balance=false,
-    diffusion=true,
-    P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983,
-          99999.999999985,99999.999999988,99999.99999999,99999.999999992,100000,
-          100000,100000,100000}))
-                            annotation (Placement(transformation(extent={{-10,-70},
-            {10,-50}},   rotation=0)));
-  BoundaryConditions.SourceQ                                 sourceP1(
-    continuous_flow_reversal=true,
-    diffusion=true,
-    Q0=0,
-    T0=293.15,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-80,-70},{-60,-50}},
-                                                                     rotation=0)));
-  BoundaryConditions.SinkP                                 sinkP1(
-                                                                 diffusion=true,
-      T0=323.15)
-    annotation (Placement(transformation(extent={{30,-70},{50,-50}},
-                                                                   rotation=0)));
-  Thermal.BoundaryConditions.HeatSource              heatSource1(
-    option_temperature=2,
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    W0={0,0,0,0,0,0,0,0,0,0})
-    annotation (Placement(transformation(extent={{-10,-30},{10,-10}},
-                                                                   rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall1(
-                                                                        Ns=10,
-      dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-10,-50},{10,-30}},
-                                                                   rotation=0)));
-equation
-  connect(dynamicOnePhaseFlowPipe.C2,sinkP. C) annotation (Line(points={{10,40},
-          {30,40}}, color={0,0,255}));
-  connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,70.2},
-          {0,62}},         color={191,95,0}));
-  connect(sourceP.C, switchValve.C1)
-    annotation (Line(points={{-60,40},{-40,40}}, color={0,0,0}));
-  connect(switchValve.C2,dynamicOnePhaseFlowPipe. C1)
-    annotation (Line(points={{-20,40},{-10,40}}, color={0,0,0}));
-  connect(echelon.yL, nONL.uL)
-    annotation (Line(points={{-65.6,70},{-54.4,70}}, color={0,0,255}));
-  connect(nONL.yL, switchValve.Ouv) annotation (Line(points={{-45.6,70},{-30,70},
-          {-30,53.2}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1,dynamicOnePhaseFlowPipe. CTh)
-    annotation (Line(points={{0,58},{0,43}}, color={0,0,0}));
-  connect(dynamicOnePhaseFlowPipe1.C2, sinkP1.C)
-    annotation (Line(points={{10,-60},{30,-60}}, color={0,0,255}));
-  connect(heatSource1.C, heatExchangerWall1.WT2)
-    annotation (Line(points={{0,-29.8},{0,-38}}, color={191,95,0}));
-  connect(heatExchangerWall1.WT1,dynamicOnePhaseFlowPipe1. CTh)
-    annotation (Line(points={{0,-42},{0,-57}}, color={0,0,0}));
-  connect(sourceP1.C,dynamicOnePhaseFlowPipe1. C1)
-    annotation (Line(points={{-60,-60},{-10,-60}}, color={0,0,0}));
-  annotation (experiment(StopTime=10),   Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDiffusion_DynamicOnePhaseFlowPipe;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDiffusion_DynamicOnePhaseFlowPipe
+
+  HeatExchangers.DynamicOnePhaseFlowPipe
+    dynamicOnePhaseFlowPipe(L=20,
+    Q(start={5.492026593727256E-28,5.492026607285849E-28,5.492026607285849E-28,
+          5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28,
+          5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28,
+          5.492026607285849E-28,5.492026607285849E-28}),
+    h(start={84011.8111671368,96057.08454715868,107718.52365349933,
+          119295.22918923412,130792.44987567255,142215.00322033433,
+          153567.34130353143,164853.6027022597,176077.65400298327,
+          187243.1234252416,198353.42841254506,209411.79856705698}),
+    continuous_flow_reversal=true,
+    inertia=false,
+    dynamic_mass_balance=false,
+    advection=true,
+    dynamic_energy_balance=false,
+    diffusion=true,
+    P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983,
+          99999.999999985,99999.999999988,99999.99999999,99999.999999992,100000,
+          100000,100000,100000}))
+                            annotation (Placement(transformation(extent={{-10,30},
+            {10,50}},    rotation=0)));
+  BoundaryConditions.SourceP                                 sourceP(
+    continuous_flow_reversal=true,
+    diffusion=true,
+    P0=100000,
+    T0=293.15)
+    annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0)));
+
+  BoundaryConditions.SinkP                                 sinkP(diffusion=true,
+      T0=323.15)
+    annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0)));
+  Thermal.BoundaryConditions.HeatSource              heatSource(
+    option_temperature=2,
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    W0={0,0,0,0,0,0,0,0,0,0})
+    annotation (Placement(transformation(extent={{-10,70},{10,90}},rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall(Ns=10,
+      dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-10,50},{10,70}},rotation=0)));
+  PressureLosses.SwitchValve switchValve(Qmin=0)
+    annotation (Placement(transformation(extent={{-40,36},{-20,56}})));
+  InstrumentationAndControl.Blocks.Logique.Echelon echelon(startTime=1)
+    annotation (Placement(transformation(extent={{-74,66},{-66,74}})));
+  InstrumentationAndControl.Blocks.Logique.NONL nONL
+    annotation (Placement(transformation(extent={{-54,66},{-46,74}})));
+  HeatExchangers.DynamicOnePhaseFlowPipe
+    dynamicOnePhaseFlowPipe1(
+                            L=20,
+    Q(start={4.9243335191367076E-05,4.924351014778949E-05,4.924351014778949E-05,
+          4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05,
+          4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05,
+          4.924351014778949E-05,4.924351014778949E-05}),
+    h(start={84011.8111671368,95792.53373784182,107482.21110144592,
+          119086.65906940492,130611.17116650468,142060.60442474802,
+          153439.44619534744,164751.8668430315,176001.7618457063,
+          187192.78587129858,198328.3807233511,209411.79856705698}),
+    continuous_flow_reversal=true,
+    inertia=false,
+    dynamic_mass_balance=false,
+    advection=true,
+    dynamic_energy_balance=false,
+    diffusion=true,
+    P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983,
+          99999.999999985,99999.999999988,99999.99999999,99999.999999992,100000,
+          100000,100000,100000}))
+                            annotation (Placement(transformation(extent={{-10,-70},
+            {10,-50}},   rotation=0)));
+  BoundaryConditions.SourceQ                                 sourceP1(
+    continuous_flow_reversal=true,
+    diffusion=true,
+    Q0=0,
+    T0=293.15,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-80,-70},{-60,-50}},
+                                                                     rotation=0)));
+  BoundaryConditions.SinkP                                 sinkP1(
+                                                                 diffusion=true,
+      T0=323.15)
+    annotation (Placement(transformation(extent={{30,-70},{50,-50}},
+                                                                   rotation=0)));
+  Thermal.BoundaryConditions.HeatSource              heatSource1(
+    option_temperature=2,
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    W0={0,0,0,0,0,0,0,0,0,0})
+    annotation (Placement(transformation(extent={{-10,-30},{10,-10}},
+                                                                   rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall1(
+                                                                        Ns=10,
+      dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-10,-50},{10,-30}},
+                                                                   rotation=0)));
+equation
+  connect(dynamicOnePhaseFlowPipe.C2,sinkP. C) annotation (Line(points={{10,40},
+          {30,40}}, color={0,0,255}));
+  connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,70.2},
+          {0,62}},         color={191,95,0}));
+  connect(sourceP.C, switchValve.C1)
+    annotation (Line(points={{-60,40},{-40,40}}, color={0,0,0}));
+  connect(switchValve.C2,dynamicOnePhaseFlowPipe. C1)
+    annotation (Line(points={{-20,40},{-10,40}}, color={0,0,0}));
+  connect(echelon.yL, nONL.uL)
+    annotation (Line(points={{-65.6,70},{-54.4,70}}, color={0,0,255}));
+  connect(nONL.yL, switchValve.Ouv) annotation (Line(points={{-45.6,70},{-30,70},
+          {-30,53.2}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1,dynamicOnePhaseFlowPipe. CTh)
+    annotation (Line(points={{0,58},{0,43}}, color={0,0,0}));
+  connect(dynamicOnePhaseFlowPipe1.C2, sinkP1.C)
+    annotation (Line(points={{10,-60},{30,-60}}, color={0,0,255}));
+  connect(heatSource1.C, heatExchangerWall1.WT2)
+    annotation (Line(points={{0,-29.8},{0,-38}}, color={191,95,0}));
+  connect(heatExchangerWall1.WT1,dynamicOnePhaseFlowPipe1. CTh)
+    annotation (Line(points={{0,-42},{0,-57}}, color={0,0,0}));
+  connect(sourceP1.C,dynamicOnePhaseFlowPipe1. C1)
+    annotation (Line(points={{-60,-60},{-10,-60}}, color={0,0,0}));
+  annotation (experiment(StopTime=10),   Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDiffusion_DynamicOnePhaseFlowPipe;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo
index de7ca5acd704e6cc5aa27402ed1d324c814ecfd1..ad5badd5d0a9c9e8c72b19362f7ccc7e0cf09170 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo
@@ -1,62 +1,62 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDiffusion_DynamicPlateHeatExchanger
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger
-    echangeurAPlaques1D(
-    region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    steady_state=true,
-    Ns=10,
-    dynamic_energy_balance=false,
-    diffusion=true,
-    continuous_flow_reversal=true)
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-
-  BoundaryConditions.SourcePQ                   sourceP(
-      option_temperature=true,
-    diffusion=true,
-    Q0=0,
-    T0=340)
-    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
-  BoundaryConditions.SourcePQ                   sourceP1
-                                            annotation (Placement(
-        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  BoundaryConditions.Sink                     puitsP(option_temperature=true,
-      diffusion=true)                    annotation (Placement(transformation(
-          extent={{40,40},{60,60}}, rotation=0)));
-  BoundaryConditions.Sink                     puitsP1(diffusion=true, h0=200000)
-                                          annotation (Placement(transformation(
-          extent={{20,20},{40,40}}, rotation=0)));
-equation
-  connect(sourceP.C, echangeurAPlaques1D.Ec)
-    annotation (Line(points={{-60,50},{-20,50}}, color={0,0,255}));
-  connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation (Line(points={{-40,30},
-          {-15,30},{-15,44}}, color={0,0,255}));
-  connect(echangeurAPlaques1D.Sc, puitsP.C) annotation (Line(points={{0,50},{20,
-          50},{20,50},{40,50}},      color={0,0,255}));
-  connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation (Line(points={{-5,44},{
-          -6,44},{-6,30},{20,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDiffusion_DynamicPlateHeatExchanger;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDiffusion_DynamicPlateHeatExchanger
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger
+    echangeurAPlaques1D(
+    region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    steady_state=true,
+    Ns=10,
+    dynamic_energy_balance=false,
+    diffusion=true,
+    continuous_flow_reversal=true)
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+
+  BoundaryConditions.SourcePQ                   sourceP(
+      option_temperature=true,
+    diffusion=true,
+    Q0=0,
+    T0=340)
+    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
+  BoundaryConditions.SourcePQ                   sourceP1
+                                            annotation (Placement(
+        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  BoundaryConditions.Sink                     puitsP(option_temperature=true,
+      diffusion=true)                    annotation (Placement(transformation(
+          extent={{40,40},{60,60}}, rotation=0)));
+  BoundaryConditions.Sink                     puitsP1(diffusion=true, h0=200000)
+                                          annotation (Placement(transformation(
+          extent={{20,20},{40,40}}, rotation=0)));
+equation
+  connect(sourceP.C, echangeurAPlaques1D.Ec)
+    annotation (Line(points={{-60,50},{-20,50}}, color={0,0,255}));
+  connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation (Line(points={{-40,30},
+          {-15,30},{-15,44}}, color={0,0,255}));
+  connect(echangeurAPlaques1D.Sc, puitsP.C) annotation (Line(points={{0,50},{20,
+          50},{20,50},{40,50}},      color={0,0,255}));
+  connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation (Line(points={{-5,44},{
+          -6,44},{-6,30},{20,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDiffusion_DynamicPlateHeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo
index 0af0b493391993c4167f4a888b87598e623dc14c..1a539127169fe57d238121b87d1860fa35d437ce 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo
@@ -1,187 +1,187 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDiffusion_DynamicTwoPhaseFlowPipe
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
-    dynamicTwoPhaseFlowPipe(L=20,
-    Q(start={5.492026593727256E-28,5.492026607285849E-28,5.492026607285849E-28,
-          5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28,
-          5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28,
-          5.492026607285849E-28,5.492026607285849E-28}),
-    h(start={84011.8111671368,96057.08454715868,107718.52365349933,
-          119295.22918923412,130792.44987567255,142215.00322033433,
-          153567.34130353143,164853.6027022597,176077.65400298327,
-          187243.1234252416,198353.42841254506,209411.79856705698}),
-    continuous_flow_reversal=true,
-    inertia=false,
-    dynamic_mass_balance=false,
-    advection=true,
-    dynamic_energy_balance=false,
-    cpl2(start={4183.826265167646,4182.239614474996,4181.0130500668565,
-          4180.0726819587735,4179.380584625066,4178.908955510578,
-          4178.63729871947,4178.550389628282,4178.636803895239,
-          4178.887855575399,4179.29683238825}),
-    cpv2(start={2049.2168798430116,2046.3449415228738,2043.4582034172774,
-          2040.5558258112756,2037.636860922887,2034.7002308786582,
-          2031.744699351002,2028.7688344361377,2025.770959168656,
-          2022.7490841743909,2019.518356822069}),
-    kl2(start={0.5995743350581909,0.5995743350579683,0.5995743350571023,
-          0.5995743350562764,0.5995743350555206,0.5995743350548642,
-          0.5995743350543319,0.5995743350539415,0.5995743350536991,
-          0.599574335053346,0.5995743403506435}),
-    kv2(start={0.024965829345847085,0.024990303852044017,0.025018417766029456,
-          0.02505065954620164,0.025087620205457677,0.025130023834108832,
-          0.025178770324693366,0.02523499664554269,0.025300167212669696,
-          0.02537621164077076,0.0254715737844706}),
-    diffusion=true,
-    pro2(T(start={294.61264959452353,297.4461204783121,300.22404336919567,
-            302.982702661547,305.7232156830587,308.44660714369365,
-            311.15382285197893,313.8457405734291,316.5231787363566,
-            319.18690350188376,321.8376345796106}), d(start={997.892715521068,
-            997.2253707910008,996.4959923473901,995.7017938222477,
-            994.8471177790162,993.9357736693299,992.9711212203756,
-            991.9561376232762,990.8934721677539,989.7854910510117,
-            988.6343144234495})),
-    P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983,99999.999999985,
-          99999.999999988,99999.99999999,99999.999999992,100000,100000,100000,100000}))
-                            annotation (Placement(transformation(extent={{-10,30},
-            {10,50}},    rotation=0)));
-  BoundaryConditions.SourceP                                 sourceP(
-    continuous_flow_reversal=true,
-    diffusion=true,
-    P0=100000,
-    T0=293.15)
-    annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0)));
-
-  BoundaryConditions.SinkP                                 sinkP(diffusion=true,
-      T0=323.15)
-    annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0)));
-  Thermal.BoundaryConditions.HeatSource              heatSource(
-    option_temperature=2,
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    W0={0,0,0,0,0,0,0,0,0,0})
-    annotation (Placement(transformation(extent={{-10,70},{10,90}},rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall(Ns=10,
-      dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-10,50},{10,70}},rotation=0)));
-  PressureLosses.SwitchValve switchValve(Qmin=0)
-    annotation (Placement(transformation(extent={{-40,36},{-20,56}})));
-  InstrumentationAndControl.Blocks.Logique.Echelon echelon(startTime=1)
-    annotation (Placement(transformation(extent={{-74,66},{-66,74}})));
-  InstrumentationAndControl.Blocks.Logique.NONL nONL
-    annotation (Placement(transformation(extent={{-54,66},{-46,74}})));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
-    dynamicTwoPhaseFlowPipe1(
-                            L=20,
-    Q(start={4.9243335191367076E-05,4.924351014778949E-05,4.924351014778949E-05,
-          4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05,
-          4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05,
-          4.924351014778949E-05,4.924351014778949E-05}),
-    h(start={84011.8111671368,95792.53373784182,107482.21110144592,
-          119086.65906940492,130611.17116650468,142060.60442474802,
-          153439.44619534744,164751.8668430315,176001.7618457063,
-          187192.78587129858,198328.3807233511,209411.79856705698}),
-    continuous_flow_reversal=true,
-    inertia=false,
-    dynamic_mass_balance=false,
-    advection=true,
-    cpl2(start={4183.8461052314415,4182.2694439224715,4181.033777873867,
-          4180.086463719214,4179.389099400846,4178.913555072556,
-          4178.639109839789,4178.550383980675,4178.6358456341095,
-          4178.886733579299,4179.2962820044995}),
-    cpv2(start={2049.2168798430116,2046.3449415228738,2043.4582034172774,
-          2040.5558258112756,2037.636860922887,2034.7002308786582,
-          2031.744699351002,2028.7688344361377,2025.770959168656,
-          2022.7490841743909,2019.518356822069}),
-    kl2(start={0.5995743350581909,0.5995743350579683,0.5995743350571023,
-          0.5995743350562764,0.5995743350555206,0.5995743350548642,
-          0.5995743350543319,0.5995743350539415,0.5995743350536991,
-          0.599574335053346,0.5995743403506435}),
-    kv2(start={0.024965829345847085,0.024990303852044017,0.025018417766029456,
-          0.02505065954620164,0.025087620205457677,0.025130023834108832,
-          0.025178770324693366,0.02523499664554269,0.025300167212669696,
-          0.02537621164077076,0.0254715737844706}),
-    diffusion=true,
-    pro2(T(start={294.58103295016184,297.3862511962513,300.1708576823335,
-            302.9360907339107,305.6830771234792,308.4128498965468,
-            311.12636229776916,313.82449878754863,316.50808386868016,
-            319.1778892498971,321.83463973606456}), d(start={997.8997091804818,
-            997.2402860410343,996.5106311231898,995.7157728656836,
-            994.8600940026633,993.9474377103298,992.9811922410435,
-            991.9643590731059,990.8996082946633,989.7893240021328,
-            988.6356418174122})),
-    dynamic_energy_balance=false,
-    P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983,
-          99999.999999985,99999.999999988,99999.99999999,99999.999999992,100000,
-          100000,100000,100000}))
-                            annotation (Placement(transformation(extent={{-10,-70},
-            {10,-50}},   rotation=0)));
-  BoundaryConditions.SourceQ                                 sourceP1(
-    continuous_flow_reversal=true,
-    diffusion=true,
-    Q0=0,
-    T0=293.15,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-80,-70},{-60,-50}},
-                                                                     rotation=0)));
-  BoundaryConditions.SinkP                                 sinkP1(
-                                                                 diffusion=true,
-      T0=323.15)
-    annotation (Placement(transformation(extent={{30,-70},{50,-50}},
-                                                                   rotation=0)));
-  Thermal.BoundaryConditions.HeatSource              heatSource1(
-    option_temperature=2,
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    W0={0,0,0,0,0,0,0,0,0,0})
-    annotation (Placement(transformation(extent={{-10,-30},{10,-10}},
-                                                                   rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall1(
-                                                                        Ns=10,
-      dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-10,-50},{10,-30}},
-                                                                   rotation=0)));
-equation
-  connect(dynamicTwoPhaseFlowPipe.C2,sinkP. C) annotation (Line(points={{10,40},
-          {30,40}}, color={0,0,255}));
-  connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,70.2},
-          {0,62}},         color={191,95,0}));
-  connect(sourceP.C, switchValve.C1)
-    annotation (Line(points={{-60,40},{-40,40}}, color={0,0,0}));
-  connect(switchValve.C2, dynamicTwoPhaseFlowPipe.C1)
-    annotation (Line(points={{-20,40},{-10,40}}, color={0,0,0}));
-  connect(echelon.yL, nONL.uL)
-    annotation (Line(points={{-65.6,70},{-54.4,70}}, color={0,0,255}));
-  connect(nONL.yL, switchValve.Ouv) annotation (Line(points={{-45.6,70},{-30,70},
-          {-30,53.2}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh)
-    annotation (Line(points={{0,58},{0,43}}, color={0,0,0}));
-  connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C)
-    annotation (Line(points={{10,-60},{30,-60}}, color={0,0,255}));
-  connect(heatSource1.C, heatExchangerWall1.WT2)
-    annotation (Line(points={{0,-29.8},{0,-38}}, color={191,95,0}));
-  connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh)
-    annotation (Line(points={{0,-42},{0,-57}}, color={0,0,0}));
-  connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1)
-    annotation (Line(points={{-60,-60},{-10,-60}}, color={0,0,0}));
-  annotation (experiment(StopTime=10),   Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDiffusion_DynamicTwoPhaseFlowPipe;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDiffusion_DynamicTwoPhaseFlowPipe
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
+    dynamicTwoPhaseFlowPipe(L=20,
+    Q(start={5.492026593727256E-28,5.492026607285849E-28,5.492026607285849E-28,
+          5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28,
+          5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28,
+          5.492026607285849E-28,5.492026607285849E-28}),
+    h(start={84011.8111671368,96057.08454715868,107718.52365349933,
+          119295.22918923412,130792.44987567255,142215.00322033433,
+          153567.34130353143,164853.6027022597,176077.65400298327,
+          187243.1234252416,198353.42841254506,209411.79856705698}),
+    continuous_flow_reversal=true,
+    inertia=false,
+    dynamic_mass_balance=false,
+    advection=true,
+    dynamic_energy_balance=false,
+    cpl2(start={4183.826265167646,4182.239614474996,4181.0130500668565,
+          4180.0726819587735,4179.380584625066,4178.908955510578,
+          4178.63729871947,4178.550389628282,4178.636803895239,
+          4178.887855575399,4179.29683238825}),
+    cpv2(start={2049.2168798430116,2046.3449415228738,2043.4582034172774,
+          2040.5558258112756,2037.636860922887,2034.7002308786582,
+          2031.744699351002,2028.7688344361377,2025.770959168656,
+          2022.7490841743909,2019.518356822069}),
+    kl2(start={0.5995743350581909,0.5995743350579683,0.5995743350571023,
+          0.5995743350562764,0.5995743350555206,0.5995743350548642,
+          0.5995743350543319,0.5995743350539415,0.5995743350536991,
+          0.599574335053346,0.5995743403506435}),
+    kv2(start={0.024965829345847085,0.024990303852044017,0.025018417766029456,
+          0.02505065954620164,0.025087620205457677,0.025130023834108832,
+          0.025178770324693366,0.02523499664554269,0.025300167212669696,
+          0.02537621164077076,0.0254715737844706}),
+    diffusion=true,
+    pro2(T(start={294.61264959452353,297.4461204783121,300.22404336919567,
+            302.982702661547,305.7232156830587,308.44660714369365,
+            311.15382285197893,313.8457405734291,316.5231787363566,
+            319.18690350188376,321.8376345796106}), d(start={997.892715521068,
+            997.2253707910008,996.4959923473901,995.7017938222477,
+            994.8471177790162,993.9357736693299,992.9711212203756,
+            991.9561376232762,990.8934721677539,989.7854910510117,
+            988.6343144234495})),
+    P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983,99999.999999985,
+          99999.999999988,99999.99999999,99999.999999992,100000,100000,100000,100000}))
+                            annotation (Placement(transformation(extent={{-10,30},
+            {10,50}},    rotation=0)));
+  BoundaryConditions.SourceP                                 sourceP(
+    continuous_flow_reversal=true,
+    diffusion=true,
+    P0=100000,
+    T0=293.15)
+    annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0)));
+
+  BoundaryConditions.SinkP                                 sinkP(diffusion=true,
+      T0=323.15)
+    annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0)));
+  Thermal.BoundaryConditions.HeatSource              heatSource(
+    option_temperature=2,
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    W0={0,0,0,0,0,0,0,0,0,0})
+    annotation (Placement(transformation(extent={{-10,70},{10,90}},rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall(Ns=10,
+      dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-10,50},{10,70}},rotation=0)));
+  PressureLosses.SwitchValve switchValve(Qmin=0)
+    annotation (Placement(transformation(extent={{-40,36},{-20,56}})));
+  InstrumentationAndControl.Blocks.Logique.Echelon echelon(startTime=1)
+    annotation (Placement(transformation(extent={{-74,66},{-66,74}})));
+  InstrumentationAndControl.Blocks.Logique.NONL nONL
+    annotation (Placement(transformation(extent={{-54,66},{-46,74}})));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
+    dynamicTwoPhaseFlowPipe1(
+                            L=20,
+    Q(start={4.9243335191367076E-05,4.924351014778949E-05,4.924351014778949E-05,
+          4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05,
+          4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05,
+          4.924351014778949E-05,4.924351014778949E-05}),
+    h(start={84011.8111671368,95792.53373784182,107482.21110144592,
+          119086.65906940492,130611.17116650468,142060.60442474802,
+          153439.44619534744,164751.8668430315,176001.7618457063,
+          187192.78587129858,198328.3807233511,209411.79856705698}),
+    continuous_flow_reversal=true,
+    inertia=false,
+    dynamic_mass_balance=false,
+    advection=true,
+    cpl2(start={4183.8461052314415,4182.2694439224715,4181.033777873867,
+          4180.086463719214,4179.389099400846,4178.913555072556,
+          4178.639109839789,4178.550383980675,4178.6358456341095,
+          4178.886733579299,4179.2962820044995}),
+    cpv2(start={2049.2168798430116,2046.3449415228738,2043.4582034172774,
+          2040.5558258112756,2037.636860922887,2034.7002308786582,
+          2031.744699351002,2028.7688344361377,2025.770959168656,
+          2022.7490841743909,2019.518356822069}),
+    kl2(start={0.5995743350581909,0.5995743350579683,0.5995743350571023,
+          0.5995743350562764,0.5995743350555206,0.5995743350548642,
+          0.5995743350543319,0.5995743350539415,0.5995743350536991,
+          0.599574335053346,0.5995743403506435}),
+    kv2(start={0.024965829345847085,0.024990303852044017,0.025018417766029456,
+          0.02505065954620164,0.025087620205457677,0.025130023834108832,
+          0.025178770324693366,0.02523499664554269,0.025300167212669696,
+          0.02537621164077076,0.0254715737844706}),
+    diffusion=true,
+    pro2(T(start={294.58103295016184,297.3862511962513,300.1708576823335,
+            302.9360907339107,305.6830771234792,308.4128498965468,
+            311.12636229776916,313.82449878754863,316.50808386868016,
+            319.1778892498971,321.83463973606456}), d(start={997.8997091804818,
+            997.2402860410343,996.5106311231898,995.7157728656836,
+            994.8600940026633,993.9474377103298,992.9811922410435,
+            991.9643590731059,990.8996082946633,989.7893240021328,
+            988.6356418174122})),
+    dynamic_energy_balance=false,
+    P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983,
+          99999.999999985,99999.999999988,99999.99999999,99999.999999992,100000,
+          100000,100000,100000}))
+                            annotation (Placement(transformation(extent={{-10,-70},
+            {10,-50}},   rotation=0)));
+  BoundaryConditions.SourceQ                                 sourceP1(
+    continuous_flow_reversal=true,
+    diffusion=true,
+    Q0=0,
+    T0=293.15,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-80,-70},{-60,-50}},
+                                                                     rotation=0)));
+  BoundaryConditions.SinkP                                 sinkP1(
+                                                                 diffusion=true,
+      T0=323.15)
+    annotation (Placement(transformation(extent={{30,-70},{50,-50}},
+                                                                   rotation=0)));
+  Thermal.BoundaryConditions.HeatSource              heatSource1(
+    option_temperature=2,
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    W0={0,0,0,0,0,0,0,0,0,0})
+    annotation (Placement(transformation(extent={{-10,-30},{10,-10}},
+                                                                   rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall1(
+                                                                        Ns=10,
+      dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-10,-50},{10,-30}},
+                                                                   rotation=0)));
+equation
+  connect(dynamicTwoPhaseFlowPipe.C2,sinkP. C) annotation (Line(points={{10,40},
+          {30,40}}, color={0,0,255}));
+  connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,70.2},
+          {0,62}},         color={191,95,0}));
+  connect(sourceP.C, switchValve.C1)
+    annotation (Line(points={{-60,40},{-40,40}}, color={0,0,0}));
+  connect(switchValve.C2, dynamicTwoPhaseFlowPipe.C1)
+    annotation (Line(points={{-20,40},{-10,40}}, color={0,0,0}));
+  connect(echelon.yL, nONL.uL)
+    annotation (Line(points={{-65.6,70},{-54.4,70}}, color={0,0,255}));
+  connect(nONL.yL, switchValve.Ouv) annotation (Line(points={{-45.6,70},{-30,70},
+          {-30,53.2}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh)
+    annotation (Line(points={{0,58},{0,43}}, color={0,0,0}));
+  connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C)
+    annotation (Line(points={{10,-60},{30,-60}}, color={0,0,255}));
+  connect(heatSource1.C, heatExchangerWall1.WT2)
+    annotation (Line(points={{0,-29.8},{0,-38}}, color={191,95,0}));
+  connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh)
+    annotation (Line(points={{0,-42},{0,-57}}, color={0,0,0}));
+  connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1)
+    annotation (Line(points={{-60,-60},{-10,-60}}, color={0,0,0}));
+  annotation (experiment(StopTime=10),   Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDiffusion_DynamicTwoPhaseFlowPipe;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo
index 3e0ce630fc4be1ed93f7cb2175e806ece7ab7708..8d9694e112204eb96e81da6d22ca28a2cd4f43a8 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo
@@ -1,71 +1,71 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDiffusion_VolumeA
-
-  BoundaryConditions.SourcePQ sourcePQ1(
-    C(h_vol_2(start=63269.22110794237)),
-    Q(start=0),
-    continuous_flow_reversal=false,
-    Q0=0,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam,
-    option_temperature=true,
-    T0=293.15,
-    diffusion=true)
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
-
-  BoundaryConditions.Sink                     sink1(
-    option_temperature=true,
-    T0=333.15,
-    diffusion=true)
-    annotation (Placement(transformation(extent={{80,-10},{100,10}})));
-  PressureLosses.SwitchValve switchValve(Qmin=0)
-    annotation (Placement(transformation(extent={{-60,-4},{-40,16}})));
-  InstrumentationAndControl.Blocks.Logique.Constante constante(K=true)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
-  Volumes.VolumeA volumeA(
-    continuous_flow_reversal=false,
-    diffusion=true,
-    dynamic_energy_balance=false,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam)
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
-
-  PressureLosses.SwitchValve switchValve1(Qmin=0, k=2000)
-    annotation (Placement(transformation(extent={{40,-4},{60,16}})));
-  InstrumentationAndControl.Blocks.Logique.Constante constante1(K=true)
-    annotation (Placement(transformation(extent={{20,20},{40,40}})));
-equation
-  connect(constante.yL, switchValve.Ouv)
-    annotation (Line(points={{-59,30},{-50,30},{-50,13.2}}, color={0,0,255}));
-  connect(sourcePQ1.C, switchValve.C1)
-    annotation (Line(points={{-80,0},{-60,0}}, color={0,0,0}));
-  connect(volumeA.Cs1, switchValve1.C1)
-    annotation (Line(points={{10,0},{40,0}}, color={0,0,0}));
-  connect(switchValve1.C2,sink1. C)
-    annotation (Line(points={{60,0},{80,0}}, color={0,0,0}));
-  connect(constante1.yL, switchValve1.Ouv)
-    annotation (Line(points={{41,30},{50,30},{50,13.2}}, color={0,0,255}));
-  connect(switchValve.C2, volumeA.Ce1)
-    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,0}));
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      experiment(StopTime=12),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDiffusion_VolumeA;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDiffusion_VolumeA
+
+  BoundaryConditions.SourcePQ sourcePQ1(
+    C(h_vol_2(start=63269.22110794237)),
+    Q(start=0),
+    continuous_flow_reversal=false,
+    Q0=0,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam,
+    option_temperature=true,
+    T0=293.15,
+    diffusion=true)
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
+
+  BoundaryConditions.Sink                     sink1(
+    option_temperature=true,
+    T0=333.15,
+    diffusion=true)
+    annotation (Placement(transformation(extent={{80,-10},{100,10}})));
+  PressureLosses.SwitchValve switchValve(Qmin=0)
+    annotation (Placement(transformation(extent={{-60,-4},{-40,16}})));
+  InstrumentationAndControl.Blocks.Logique.Constante constante(K=true)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
+  Volumes.VolumeA volumeA(
+    continuous_flow_reversal=false,
+    diffusion=true,
+    dynamic_energy_balance=false,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam)
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+
+  PressureLosses.SwitchValve switchValve1(Qmin=0, k=2000)
+    annotation (Placement(transformation(extent={{40,-4},{60,16}})));
+  InstrumentationAndControl.Blocks.Logique.Constante constante1(K=true)
+    annotation (Placement(transformation(extent={{20,20},{40,40}})));
+equation
+  connect(constante.yL, switchValve.Ouv)
+    annotation (Line(points={{-59,30},{-50,30},{-50,13.2}}, color={0,0,255}));
+  connect(sourcePQ1.C, switchValve.C1)
+    annotation (Line(points={{-80,0},{-60,0}}, color={0,0,0}));
+  connect(volumeA.Cs1, switchValve1.C1)
+    annotation (Line(points={{10,0},{40,0}}, color={0,0,0}));
+  connect(switchValve1.C2,sink1. C)
+    annotation (Line(points={{60,0},{80,0}}, color={0,0,0}));
+  connect(constante1.yL, switchValve1.Ouv)
+    annotation (Line(points={{41,30},{50,30},{50,13.2}}, color={0,0,255}));
+  connect(switchValve.C2, volumeA.Ce1)
+    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,0}));
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      experiment(StopTime=12),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDiffusion_VolumeA;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo
index 61fb998776f85d2e53b146a048d6b6601c41cf41..0c1834f75cbc26c2454aa7d85fefb0dd35e682b4 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo
@@ -1,58 +1,58 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicCheckValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-38,-10},{-18,10}},rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{42,-10},{62,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve(J=10)
-    annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(
-    period=100,
-    amplitude=3e5,
-    offset=6e5) annotation (Placement(transformation(extent={{-78,-10},{-58,10}},
-          rotation=0)));
-equation
-  connect(sourceP1.C, checkValve.C1)
-    annotation (Line(points={{-18,0},{2,0}},   color={0,0,255}));
-  connect(checkValve.C2, puitsP1.C) annotation (Line(points={{22,0},{32,0},{42,
-          0}},             color={0,0,255}));
-  connect(sourceP1.IPressure, pulse.y)
-    annotation (Line(points={{-33,0},{-57,0}},   color={28,108,200}));
-  annotation (
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    experiment(StopTime=300),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicCheckValve;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicCheckValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-38,-10},{-18,10}},rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{42,-10},{62,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve(J=10)
+    annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(
+    period=100,
+    amplitude=3e5,
+    offset=6e5) annotation (Placement(transformation(extent={{-78,-10},{-58,10}},
+          rotation=0)));
+equation
+  connect(sourceP1.C, checkValve.C1)
+    annotation (Line(points={{-18,0},{2,0}},   color={0,0,255}));
+  connect(checkValve.C2, puitsP1.C) annotation (Line(points={{22,0},{32,0},{42,
+          0}},             color={0,0,255}));
+  connect(sourceP1.IPressure, pulse.y)
+    annotation (Line(points={{-33,0},{-57,0}},   color={28,108,200}));
+  annotation (
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    experiment(StopTime=300),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicCheckValve;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo
index c87b2c19f3b07da864f6cc566182a6a6c97677b1..a59c06fe4edbe220b1e62a61e3973da441b98ce9 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo
@@ -1,119 +1,119 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicCondenser
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(Pm(displayUnit = "Pa", start=
-          355000.00000015664),                                                                         Q(fixed = false), hn(fixed = false, start=
-          71.08245675235786),                                                                                                               p_rho(displayUnit = "kg/m3"), rho(displayUnit = "kg/m3"),
-    a1(start=-88.67, fixed=false),
-    C2(h(start=195297.69906611618), h_vol_1(start=195297.69906611618)),
-    Qv(start=0.009081311621074862),
-    h(start=193554.9971298399),
-    C1(P(start=10000.0)))                                                                                                                                                                             annotation (
-    Placement(visible = true, transformation(origin={-10,-60},    extent={{10,-10},
-            {-10,10}},                                                                             rotation = 0)));
-  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Pe(displayUnit = "Pa", fixed = true, start = 700000), Ps(displayUnit = "Pa", fixed = false), W_fric = 0, eta_is(fixed = false), eta_is_wet(fixed = false), rhos(displayUnit = "kg/m3", fixed = false),
-    xm(fixed=false, start=0.9856238368898451),
-    proe(x(start=1, fixed=true)),
-    Ce(h_vol_2(start=3128840.013040668), h(start=3128840.0130323363)),
-    pros(d(start=0.07018147245152216)))                                                                                                                                                                                                   annotation (
-    Placement(visible = true, transformation(origin={-10,60},    extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser       Condenseur(
-    dynamic_energy_balance=true,
-    Rv=20,
-    steady_state=false)                                                                                                                                                                                            annotation (
-    Placement(visible = true, transformation(origin={40.5,-1},    extent = {{-20.5, -16}, {20.5, 16}}, rotation = 0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, T0 = 373.05, option_temperature = true) annotation (
-    Placement(visible = true, transformation(origin={91,-1},    extent = {{-11, -12}, {11, 12}}, rotation = 0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(        h0 = 113e3,
-    option_temperature=true,
-    Q0=100)                                                                            annotation (
-    Placement(visible = true, transformation(origin={-10,-1},    extent = {{-10, -9}, {10, 9}}, rotation = 0)));
-  ThermoSysPro.Fluid.Volumes.VolumeATh
-                    volumeA(
-    P(start=70e5),
-    h(start=2.e6),
-    dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-70,10},{-50,-10}})));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource
-                                        heatSource(W0(start={2e6}, each fixed=false),
-      option_temperature=2) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={-88,12})));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_GCT1(Table=[0,
-        0.0001; 22,0.0001; 24,2.02; 25,100; 26,150; 28,300; 29.7,590; 30.2,600;
-        30.5,590; 31,570; 35,250; 40,100; 45,15; 47,0.000001; 200,0.000001;
-        1000,0.000001])
-    annotation (Placement(transformation(extent={{-56,34},{-44,46}},
-          rotation=0)));
-  BoundaryConditions.SourceQ                    Source_Vsup1(
-      h0=2759.6e3, Q0=1)
-          annotation (                           Placement(transformation(
-          extent={{-40,10},{-20,30}},    rotation=0)));
-  PressureLosses.SingularPressureLoss
-    PressureLoss_VapeurIn_in4(K=1e-4, Q(fixed=false, start=0.01))
-                         annotation (Placement(transformation(extent={{0,10},{
-            20,30}},    rotation=0)));
-equation
-  connect(staticCentrifugalPump.C2,volumeA. Ce2)
-    annotation (Line(points={{-20,-60},{-60,-60},{-60,-10}}, color={28,108,200}));
-  connect(volumeA.Cs2,stodolaTurbine. Ce)
-    annotation (Line(points={{-60,10},{-60,60},{-20.1,60}},  color={28,108,200}));
-  connect(heatSource.C[1],volumeA. Cth) annotation (Line(points={{-78.2,12},{-64,
-          12},{-64,0},{-60,0}}, color={0,0,0}));
-  connect(sourcePCaloporteur.C, Condenseur.Ce1) annotation (Line(points={{0,-1},{
-          2,-1},{2,-1.16},{20,-1.16}},      color={0,0,0}));
-  connect(Condenseur.Ce2, puitsPCaloporteur.C) annotation (Line(points={{60.795,
-          -1.16},{66.3975,-1.16},{66.3975,-1},{80,-1}}, color={0,0,0}));
-  connect(Condenseur.C2ex, staticCentrifugalPump.C1)
-    annotation (Line(points={{40.5,-17},{40.5,-60},{0,-60}}, color={0,0,0}));
-  connect(stodolaTurbine.Cs, Condenseur.C1vap)
-    annotation (Line(points={{0.1,60},{40.5,60},{40.5,15}}, color={0,0,0}));
-  connect(Vapeur_GCT1.y, Source_Vsup1.IMassFlow)
-    annotation (Line(points={{-43.4,40},{-30,40},{-30,25}}, color={0,0,255}));
-  connect(Source_Vsup1.C, PressureLoss_VapeurIn_in4.C1)
-    annotation (Line(points={{-20,20},{0,20}}, color={0,0,0}));
-  connect(PressureLoss_VapeurIn_in4.C2, Condenseur.C2vap) annotation (Line(
-        points={{20,20},{32.505,20},{32.505,13.72}}, color={0,0,0}));
-  annotation (
-    Diagram(graphics={
-        Text(
-          extent={{-94,34},{-64,24}},
-          lineColor={28,108,200},
-          textString="W: free"),
-        Text(
-          extent={{-26,-38},{8,-48}},
-          lineColor={28,108,200},
-          textString="a1: free"),
-        Text(
-          extent={{-28,94},{8,84}},
-          lineColor={28,108,200},
-          textString="Pe: fixed"),
-        Text(
-          extent={{-28,84},{10,72}},
-          lineColor={28,108,200},
-          textString="proe.x: fixed")}),
-    Documentation(info="<html>
-</html><html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    experiment(StopTime=10000));
-end TestDynamicCondenser;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicCondenser
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(Pm(displayUnit = "Pa", start=
+          355000.00000015664),                                                                         Q(fixed = false), hn(fixed = false, start=
+          71.08245675235786),                                                                                                               p_rho(displayUnit = "kg/m3"), rho(displayUnit = "kg/m3"),
+    a1(start=-88.67, fixed=false),
+    C2(h(start=195297.69906611618), h_vol_1(start=195297.69906611618)),
+    Qv(start=0.009081311621074862),
+    h(start=193554.9971298399),
+    C1(P(start=10000.0)))                                                                                                                                                                             annotation (
+    Placement(visible = true, transformation(origin={-10,-60},    extent={{10,-10},
+            {-10,10}},                                                                             rotation = 0)));
+  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Pe(displayUnit = "Pa", fixed = true, start = 700000), Ps(displayUnit = "Pa", fixed = false), W_fric = 0, eta_is(fixed = false), eta_is_wet(fixed = false), rhos(displayUnit = "kg/m3", fixed = false),
+    xm(fixed=false, start=0.9856238368898451),
+    proe(x(start=1, fixed=true)),
+    Ce(h_vol_2(start=3128840.013040668), h(start=3128840.0130323363)),
+    pros(d(start=0.07018147245152216)))                                                                                                                                                                                                   annotation (
+    Placement(visible = true, transformation(origin={-10,60},    extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser       Condenseur(
+    dynamic_energy_balance=true,
+    Rv=20,
+    steady_state=false)                                                                                                                                                                                            annotation (
+    Placement(visible = true, transformation(origin={40.5,-1},    extent = {{-20.5, -16}, {20.5, 16}}, rotation = 0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, T0 = 373.05, option_temperature = true) annotation (
+    Placement(visible = true, transformation(origin={91,-1},    extent = {{-11, -12}, {11, 12}}, rotation = 0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(        h0 = 113e3,
+    option_temperature=true,
+    Q0=100)                                                                            annotation (
+    Placement(visible = true, transformation(origin={-10,-1},    extent = {{-10, -9}, {10, 9}}, rotation = 0)));
+  ThermoSysPro.Fluid.Volumes.VolumeATh
+                    volumeA(
+    P(start=70e5),
+    h(start=2.e6),
+    dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-70,10},{-50,-10}})));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource
+                                        heatSource(W0(start={2e6}, each fixed=false),
+      option_temperature=2) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={-88,12})));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_GCT1(Table=[0,
+        0.0001; 22,0.0001; 24,2.02; 25,100; 26,150; 28,300; 29.7,590; 30.2,600;
+        30.5,590; 31,570; 35,250; 40,100; 45,15; 47,0.000001; 200,0.000001;
+        1000,0.000001])
+    annotation (Placement(transformation(extent={{-56,34},{-44,46}},
+          rotation=0)));
+  BoundaryConditions.SourceQ                    Source_Vsup1(
+      h0=2759.6e3, Q0=1)
+          annotation (                           Placement(transformation(
+          extent={{-40,10},{-20,30}},    rotation=0)));
+  PressureLosses.SingularPressureLoss
+    PressureLoss_VapeurIn_in4(K=1e-4, Q(fixed=false, start=0.01))
+                         annotation (Placement(transformation(extent={{0,10},{
+            20,30}},    rotation=0)));
+equation
+  connect(staticCentrifugalPump.C2,volumeA. Ce2)
+    annotation (Line(points={{-20,-60},{-60,-60},{-60,-10}}, color={28,108,200}));
+  connect(volumeA.Cs2,stodolaTurbine. Ce)
+    annotation (Line(points={{-60,10},{-60,60},{-20.1,60}},  color={28,108,200}));
+  connect(heatSource.C[1],volumeA. Cth) annotation (Line(points={{-78.2,12},{-64,
+          12},{-64,0},{-60,0}}, color={0,0,0}));
+  connect(sourcePCaloporteur.C, Condenseur.Ce1) annotation (Line(points={{0,-1},{
+          2,-1},{2,-1.16},{20,-1.16}},      color={0,0,0}));
+  connect(Condenseur.Ce2, puitsPCaloporteur.C) annotation (Line(points={{60.795,
+          -1.16},{66.3975,-1.16},{66.3975,-1},{80,-1}}, color={0,0,0}));
+  connect(Condenseur.C2ex, staticCentrifugalPump.C1)
+    annotation (Line(points={{40.5,-17},{40.5,-60},{0,-60}}, color={0,0,0}));
+  connect(stodolaTurbine.Cs, Condenseur.C1vap)
+    annotation (Line(points={{0.1,60},{40.5,60},{40.5,15}}, color={0,0,0}));
+  connect(Vapeur_GCT1.y, Source_Vsup1.IMassFlow)
+    annotation (Line(points={{-43.4,40},{-30,40},{-30,25}}, color={0,0,255}));
+  connect(Source_Vsup1.C, PressureLoss_VapeurIn_in4.C1)
+    annotation (Line(points={{-20,20},{0,20}}, color={0,0,0}));
+  connect(PressureLoss_VapeurIn_in4.C2, Condenseur.C2vap) annotation (Line(
+        points={{20,20},{32.505,20},{32.505,13.72}}, color={0,0,0}));
+  annotation (
+    Diagram(graphics={
+        Text(
+          extent={{-94,34},{-64,24}},
+          lineColor={28,108,200},
+          textString="W: free"),
+        Text(
+          extent={{-26,-38},{8,-48}},
+          lineColor={28,108,200},
+          textString="a1: free"),
+        Text(
+          extent={{-28,94},{8,84}},
+          lineColor={28,108,200},
+          textString="Pe: fixed"),
+        Text(
+          extent={{-28,84},{10,72}},
+          lineColor={28,108,200},
+          textString="proe.x: fixed")}),
+    Documentation(info="<html>
+</html><html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    experiment(StopTime=10000));
+end TestDynamicCondenser;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo
index aaf254b1cf34451a256613e42b97b1959c9c64df..0ea612e612c70b0784928e7120839e97e941246a 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo
@@ -1,183 +1,183 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicDrum
-  parameter Units.SI.MassFlowRate Qin(fixed=false, start=80) "Mass flow rate";
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.085)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  Volumes.DynamicDrum Drum(
-    Vv(start=39),
-    Vertical=false,
-    hl(start=1454177.7248984643),
-    hv(start=2670002.8920646077),
-    xv(start=0.01),
-    rhol(start=670),
-    rhov(start=78),
-    zl(fixed=true, start=1.05),
-    wsftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType.WaterSteam,
-    Cm(diff_res_1(start=8476939.240220599)),
-    steady_state=true,
-    dynamic_energy_balance=false,
-    P0=13000000,
-    diffusion=true,
-    P(start=13000000, fixed=true),
-    Pfond(start=13006991.905108),
-    Tp(start=590.93934457637))
-                     annotation (Placement(transformation(extent={{-61,18},{1,
-            80}}, rotation=0)));
-
-  PressureLosses.ControlValve                         feedwaterValve(
-    Cv(start=335),
-    C1(
-      h_vol_1(start=1400e3),
-      h(start=1400e3),
-      P(start=13300000),
-      Q(start=79.5)),
-    Q(start=79.5),
-    rho(start=888),
-    h(start=1400000),
-    Cvmax=CvmaxWater,
-    Pm(start=13100000))
-                     annotation (Placement(transformation(extent={{-120,76},{
-            -100,96}}, rotation=0)));
-  PressureLosses.ControlValve                         steamValve(
-    Cvmax(fixed=true) = 50000,
-    Cv(start=25000),
-    Q(start=79.5),
-    rho(start=78.5),
-    h(start=2657930),
-    Pm(start=12998726.577779422))
-    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon(k(fixed=true) = 0.5)
-    annotation (Placement(transformation(extent={{-160,122},{-140,142}},
-          rotation=0)));
-  HeatExchangers.DynamicTwoPhaseFlowPipe
-    TubeEcranBoucleEvaporatoire(
-    T0=fill(400, 10),
-    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
-    advection=false,
-    z2=10,
-    simplified_dynamic_energy_balance=false,
-    D=0.03,
-    ntubes=1400,
-    h(start={1454177.75,1531100.8018215413,1608023.8787446183,1684946.955667695,
-          1761870.032590772,1838793.109513849,1915716.186436926,
-          1992639.2633600028,2069562.3402830793,2146485.4172061565,
-          2223408.4941292335,1454177.75}),
-    L=20,
-    Q(start=fill(130, 11)),
-    dynamic_mass_balance=false,
-    inertia=false,
-    dynamic_energy_balance=false,
-    diffusion=true,
-    P(start={13032002.884172,13025908.565037,13020089.245351,13015847.070697,
-          13012648.443752,13010064.118918,13007881.468256,13005979.718403,
-          13004283.685995,13002743.397189,13001323.948575,13000000}))
-                     annotation (Placement(transformation(
-        origin={6,-26},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  Thermal.BoundaryConditions.HeatSource
-                                SourceC3(
-    option_temperature=2,
-    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
-    T0={290,290,290,290,290,290,290,290,290,290})
-    annotation (Placement(transformation(
-        origin={36,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
-    D=0.03,
-    ntubes=1400,
-    dynamic_energy_balance=false)
-    annotation (Placement(transformation(
-        origin={18,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=20,
-    z1=20,
-    Q(fixed=true, start=130),
-    lambda=LambdaPipe)
-             annotation (Placement(transformation(
-        origin={-66,-26},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon1(k(fixed=true) = 0.5)
-    annotation (Placement(transformation(extent={{0,122},{20,142}}, rotation=0)));
-  BoundaryConditions.SourceP                         sourceP(h0=1400000,
-    P0(fixed=true) = 13200000,
-    option_temperature=false)
-           annotation (Placement(transformation(extent={{-200,70},{-180,90}},
-          rotation=0)));
-  BoundaryConditions.SinkQ                         sinkQ(Q0=75)
-    annotation (Placement(transformation(extent={{120,70},{140,90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    SteamMassFlowRate(k=Qin)
-    annotation (Placement(transformation(extent={{100,122},{120,142}}, rotation=
-           0)));
-equation
-  connect(Drum.Cv,steamValve. C1)
-    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
-  connect(feedwaterValve.C2, Drum.Ce1)
-    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
-  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
-          -66,18},{-66,-16}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
-          {26.2,-26}}, color={191,95,0}));
-  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
-    annotation (Line(points={{1,18},{6,18},{6,-16}}));
-  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
-        points={{9,-26},{16,-26}}, color={191,95,0}));
-  connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv)
-    annotation (Line(points={{-139,132},{-110,132},{-110,97}}, smooth=Smooth.None));
-  connect(sourceP.C,feedwaterValve. C1)  annotation (Line(
-      points={{-180,80},{-120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(steamValve.C2, sinkQ.C) annotation (Line(
-      points={{60,80},{120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
-  connect(ConsigneNiveauBallon1.y,steamValve. Ouv)
-    annotation (Line(points={{21,132},{50,132},{50,97}}, smooth=Smooth.None));
-  connect(SteamMassFlowRate.y, sinkQ.IMassFlow)
-    annotation (Line(points={{121,132},{130,132},{130,85}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicDrum;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicDrum
+  parameter Units.SI.MassFlowRate Qin(fixed=false, start=80) "Mass flow rate";
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.085)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+
+  Volumes.DynamicDrum Drum(
+    Vv(start=39),
+    Vertical=false,
+    hl(start=1454177.7248984643),
+    hv(start=2670002.8920646077),
+    xv(start=0.01),
+    rhol(start=670),
+    rhov(start=78),
+    zl(fixed=true, start=1.05),
+    wsftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType.WaterSteam,
+    Cm(diff_res_1(start=8476939.240220599)),
+    steady_state=true,
+    dynamic_energy_balance=false,
+    P0=13000000,
+    diffusion=true,
+    P(start=13000000, fixed=true),
+    Pfond(start=13006991.905108),
+    Tp(start=590.93934457637))
+                     annotation (Placement(transformation(extent={{-61,18},{1,
+            80}}, rotation=0)));
+
+  PressureLosses.ControlValve                         feedwaterValve(
+    Cv(start=335),
+    C1(
+      h_vol_1(start=1400e3),
+      h(start=1400e3),
+      P(start=13300000),
+      Q(start=79.5)),
+    Q(start=79.5),
+    rho(start=888),
+    h(start=1400000),
+    Cvmax=CvmaxWater,
+    Pm(start=13100000))
+                     annotation (Placement(transformation(extent={{-120,76},{
+            -100,96}}, rotation=0)));
+  PressureLosses.ControlValve                         steamValve(
+    Cvmax(fixed=true) = 50000,
+    Cv(start=25000),
+    Q(start=79.5),
+    rho(start=78.5),
+    h(start=2657930),
+    Pm(start=12998726.577779422))
+    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon(k(fixed=true) = 0.5)
+    annotation (Placement(transformation(extent={{-160,122},{-140,142}},
+          rotation=0)));
+  HeatExchangers.DynamicTwoPhaseFlowPipe
+    TubeEcranBoucleEvaporatoire(
+    T0=fill(400, 10),
+    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
+    advection=false,
+    z2=10,
+    simplified_dynamic_energy_balance=false,
+    D=0.03,
+    ntubes=1400,
+    h(start={1454177.75,1531100.8018215413,1608023.8787446183,1684946.955667695,
+          1761870.032590772,1838793.109513849,1915716.186436926,
+          1992639.2633600028,2069562.3402830793,2146485.4172061565,
+          2223408.4941292335,1454177.75}),
+    L=20,
+    Q(start=fill(130, 11)),
+    dynamic_mass_balance=false,
+    inertia=false,
+    dynamic_energy_balance=false,
+    diffusion=true,
+    P(start={13032002.884172,13025908.565037,13020089.245351,13015847.070697,
+          13012648.443752,13010064.118918,13007881.468256,13005979.718403,
+          13004283.685995,13002743.397189,13001323.948575,13000000}))
+                     annotation (Placement(transformation(
+        origin={6,-26},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  Thermal.BoundaryConditions.HeatSource
+                                SourceC3(
+    option_temperature=2,
+    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
+    T0={290,290,290,290,290,290,290,290,290,290})
+    annotation (Placement(transformation(
+        origin={36,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
+    D=0.03,
+    ntubes=1400,
+    dynamic_energy_balance=false)
+    annotation (Placement(transformation(
+        origin={18,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=20,
+    z1=20,
+    Q(fixed=true, start=130),
+    lambda=LambdaPipe)
+             annotation (Placement(transformation(
+        origin={-66,-26},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon1(k(fixed=true) = 0.5)
+    annotation (Placement(transformation(extent={{0,122},{20,142}}, rotation=0)));
+  BoundaryConditions.SourceP                         sourceP(h0=1400000,
+    P0(fixed=true) = 13200000,
+    option_temperature=false)
+           annotation (Placement(transformation(extent={{-200,70},{-180,90}},
+          rotation=0)));
+  BoundaryConditions.SinkQ                         sinkQ(Q0=75)
+    annotation (Placement(transformation(extent={{120,70},{140,90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    SteamMassFlowRate(k=Qin)
+    annotation (Placement(transformation(extent={{100,122},{120,142}}, rotation=
+           0)));
+equation
+  connect(Drum.Cv,steamValve. C1)
+    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
+  connect(feedwaterValve.C2, Drum.Ce1)
+    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
+  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
+          -66,18},{-66,-16}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
+          {26.2,-26}}, color={191,95,0}));
+  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
+    annotation (Line(points={{1,18},{6,18},{6,-16}}));
+  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
+        points={{9,-26},{16,-26}}, color={191,95,0}));
+  connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv)
+    annotation (Line(points={{-139,132},{-110,132},{-110,97}}, smooth=Smooth.None));
+  connect(sourceP.C,feedwaterValve. C1)  annotation (Line(
+      points={{-180,80},{-120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(steamValve.C2, sinkQ.C) annotation (Line(
+      points={{60,80},{120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
+  connect(ConsigneNiveauBallon1.y,steamValve. Ouv)
+    annotation (Line(points={{21,132},{50,132},{50,97}}, smooth=Smooth.None));
+  connect(SteamMassFlowRate.y, sinkQ.IMassFlow)
+    annotation (Line(points={{121,132},{130,132},{130,85}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicDrum;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo
index 1428632b07cc0edaae1425a3b89de6971e8e867e..eb8368ec20f565de8c84a8d55da95f3e59a394db 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo
@@ -1,190 +1,190 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicDrum_CC
-  import ThermoSysPro;
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.085)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum              Drum(
-    Vv(start=39),
-    Vertical=false,
-    hl(start=1454400),
-    hv(start=2.658e6),
-    xv(start=0.01),
-    rhol(start=670),
-    rhov(start=78),
-    zl(fixed=true, start=1.05),
-    wsftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType.WaterSteam,
-    P0=13000000,
-    P(start=13000000, fixed=false),
-    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,18},{1,
-            80}}, rotation=0)));
-
-   ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=335),
-    Q(start=79.5),
-    rho(start=888),
-    h(start=1400000),
-    C1(
-      h_vol_1(start=1400e3),
-      h(start=1400e3),
-      Q(start=79.5),
-      P(start=13300000)),
-    Cvmax=CvmaxWater,
-    Pm(start=13100000))
-                     annotation (Placement(transformation(extent={{-120,76},{
-            -100,96}}, rotation=0)));
-   ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Q(start=79.5),
-    rho(start=78.5),
-    h(start=2657930),
-    Cvmax=10000,
-    Pm(start=12900000))
-    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
-   ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
-    TubeEcranBoucleEvaporatoire(
-    T0=fill(400, 10),
-    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
-    advection=false,
-    z2=10,
-    simplified_dynamic_energy_balance=false,
-    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
-          13002000,13001000,13000000,12999990}),
-    D=0.03,
-    ntubes=1400,
-    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
-          1900e3,1950e3}),
-    L=20,
-    Q(start=fill(130, 11)))
-                     annotation (Placement(transformation(
-        origin={6,-26},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
-    option_temperature=2,
-    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
-    T0={290,290,290,290,290,290,290,290,290,290})
-    annotation (Placement(transformation(
-        origin={36,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
-    D=0.03,
-    ntubes=1400)
-    annotation (Placement(transformation(
-        origin={18,-26},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-   ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=20,
-    z1=20,
-    C1(P(start=130e5)),
-    Q(fixed=true, start=130),
-    lambda=LambdaPipe)
-             annotation (Placement(transformation(
-        origin={-66,-26},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-   ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceQ(h0=1400000,
-    option_temperature=false,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam,
-    P0=13300000)
-           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
-          rotation=0)));
-
-   ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkP(
-    option_temperature=false,
-    h0=2.650e6,
-    P0=12700000)
-    annotation (Placement(transformation(extent={{115,70},{135,90}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k=0.5)
-    annotation (Placement(transformation(extent={{20,102},{40,121}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
-        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
-        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
-    annotation (Placement(transformation(extent={{96,99},{120,123}},  rotation=
-            0)));
-  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
-    add(k1=-1, k2=+1),
-    Ti=50,
-    pIsat(
-      ureset0=0.5,
-      Limiteur1(u(signal(start=0.5))),
-      Ti=2000)) annotation (Placement(transformation(extent={{-56,106},{-84,132}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Level(k=1.05) annotation (
-      Placement(transformation(extent={{-21,102},{-40,121}}, rotation=0)));
-equation
-  connect(Drum.Cv, SteamValve.C1)
-    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
-  connect(FeedwaterValve.C2, Drum.Ce1)
-    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
-  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
-          -66,18},{-66,-16}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
-          {26.2,-26}}, color={191,95,0}));
-  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
-    annotation (Line(points={{1,18},{6,18},{6,-16}}));
-  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
-        points={{9,-26},{16,-26}}, color={191,95,0}));
-  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
-      points={{-176,80},{-120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(SteamValve.C2,sinkP. C) annotation (Line(
-      points={{60,80},{115,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
-    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
-  connect(SteamValve_O.y, SteamValve.Ouv)
-    annotation (Line(points={{41,111.5},{50,111.5},{50,97}}, color={0,0,255}));
-  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
-          111},{130,111},{130,80}}, color={0,0,255}));
-  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
-      points={{-40.95,111.5},{-44,111.5},{-44,111.2},{-55.3,111.2}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-
-  connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(
-      points={{4.1,49},{10,49},{10,130.7},{-55.3,130.7}},
-      color={0,0,0},
-      pattern=LinePattern.Dash));
-  connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation (Line(
-        points={{-84.7,107.3},{-110,107.3},{-110,97}}, color={0,0,255}));
-  annotation (experiment(StopTime=3000),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicDrum_CC;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicDrum_CC
+  import ThermoSysPro;
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.085)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum              Drum(
+    Vv(start=39),
+    Vertical=false,
+    hl(start=1454400),
+    hv(start=2.658e6),
+    xv(start=0.01),
+    rhol(start=670),
+    rhov(start=78),
+    zl(fixed=true, start=1.05),
+    wsftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType.WaterSteam,
+    P0=13000000,
+    P(start=13000000, fixed=false),
+    Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,18},{1,
+            80}}, rotation=0)));
+
+   ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=335),
+    Q(start=79.5),
+    rho(start=888),
+    h(start=1400000),
+    C1(
+      h_vol_1(start=1400e3),
+      h(start=1400e3),
+      Q(start=79.5),
+      P(start=13300000)),
+    Cvmax=CvmaxWater,
+    Pm(start=13100000))
+                     annotation (Placement(transformation(extent={{-120,76},{
+            -100,96}}, rotation=0)));
+   ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Q(start=79.5),
+    rho(start=78.5),
+    h(start=2657930),
+    Cvmax=10000,
+    Pm(start=12900000))
+    annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0)));
+   ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
+    TubeEcranBoucleEvaporatoire(
+    T0=fill(400, 10),
+    heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}),
+    advection=false,
+    z2=10,
+    simplified_dynamic_energy_balance=false,
+    P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000,
+          13002000,13001000,13000000,12999990}),
+    D=0.03,
+    ntubes=1400,
+    h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3,
+          1900e3,1950e3}),
+    L=20,
+    Q(start=fill(130, 11)))
+                     annotation (Placement(transformation(
+        origin={6,-26},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(
+    option_temperature=2,
+    W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7},
+    T0={290,290,290,290,290,290,290,290,290,290})
+    annotation (Placement(transformation(
+        origin={36,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20,
+    D=0.03,
+    ntubes=1400)
+    annotation (Placement(transformation(
+        origin={18,-26},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+   ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=20,
+    z1=20,
+    C1(P(start=130e5)),
+    Q(fixed=true, start=130),
+    lambda=LambdaPipe)
+             annotation (Placement(transformation(
+        origin={-66,-26},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+   ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceQ(h0=1400000,
+    option_temperature=false,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam,
+    P0=13300000)
+           annotation (Placement(transformation(extent={{-196,70},{-176,90}},
+          rotation=0)));
+
+   ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkP(
+    option_temperature=false,
+    h0=2.650e6,
+    P0=12700000)
+    annotation (Placement(transformation(extent={{115,70},{135,90}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k=0.5)
+    annotation (Placement(transformation(extent={{20,102},{40,121}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0,
+        128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010,
+        131e5; 2090,131e5; 2300,128e5; 3000,128e5])
+    annotation (Placement(transformation(extent={{96,99},{120,123}},  rotation=
+            0)));
+  ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(
+    add(k1=-1, k2=+1),
+    Ti=50,
+    pIsat(
+      ureset0=0.5,
+      Limiteur1(u(signal(start=0.5))),
+      Ti=2000)) annotation (Placement(transformation(extent={{-56,106},{-84,132}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Level(k=1.05) annotation (
+      Placement(transformation(extent={{-21,102},{-40,121}}, rotation=0)));
+equation
+  connect(Drum.Cv, SteamValve.C1)
+    annotation (Line(points={{1,80},{40,80}}, color={0,0,255}));
+  connect(FeedwaterValve.C2, Drum.Ce1)
+    annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255}));
+  connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{
+          -66,18},{-66,-16}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26},
+          {26.2,-26}}, color={191,95,0}));
+  connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2)
+    annotation (Line(points={{1,18},{6,18},{6,-16}}));
+  connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line(
+        points={{9,-26},{16,-26}}, color={191,95,0}));
+  connect(sourceQ.C, FeedwaterValve.C1)  annotation (Line(
+      points={{-176,80},{-120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(SteamValve.C2,sinkP. C) annotation (Line(
+      points={{60,80},{115,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2)
+    annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}}));
+  connect(SteamValve_O.y, SteamValve.Ouv)
+    annotation (Line(points={{41,111.5},{50,111.5},{50,97}}, color={0,0,255}));
+  connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2,
+          111},{130,111},{130,80}}, color={0,0,255}));
+  connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line(
+      points={{-40.95,111.5},{-44,111.5},{-44,111.2},{-55.3,111.2}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+
+  connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(
+      points={{4.1,49},{10,49},{10,130.7},{-55.3,130.7}},
+      color={0,0,0},
+      pattern=LinePattern.Dash));
+  connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation (Line(
+        points={{-84.7,107.3},{-110,107.3},{-110,97}}, color={0,0,255}));
+  annotation (experiment(StopTime=3000),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicDrum_CC;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo
index e669698c5ced96ba6c08fa5a9cf46baca5b797f5..8e468c8c56718b5ccd1d9bbbf1fb742c165a3cc6 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo
@@ -1,89 +1,89 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicFlueGasesMultiFluidHeatExchanger
-
-  BoundaryConditions.SourceP                    sourceP(C(h_vol_2(start=
-            71016.12237181065)),
-    option_temperature=true,
-    P0=10000000,
-    Q(start=190407.49090838886))
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  BoundaryConditions.SinkP                    sinkP(C(h_vol_1(start=
-            71016.1223718086)))
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger dynamicMultiFluidHeatExchanger(
-    steady_state=true,
-    Cfg1(h_vol_2(start=1999458.3239137873)),
-    Cfg2(h_vol_1(start=1997835.1051783948)),
-    ExchangerFlueGasesMetal(
-      P(start={5000000.0,5000000.0,5000000.0,5000000.0,5000000.0,5000000.0}),
-      Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343,
-            2702.7912398488343,2702.7912398488343}),
-      Tp(start={293.20684981473266,293.655268073503,294.1038710234491,
-            294.55265602776745}),
-      h(start={2000000.0,1999458.375,1998916.9494222174,1998375.8765143699,
-            1997835.125,100000.0}),
-      rho2(start={9.227614370571606,9.229671002969678,9.231727464730685,
-            9.23378375498367,9.235839872860517})),
-    TwoPhaseFlowPipe(
-      P(start={10000000.0,8023904.042494878,6045867.025005122,
-            4065878.0712931687,2083926.1359166082,100000.0}),
-      Q(start={3482.228448926616,3482.228448926616,3482.228448926616,
-            3482.228448926616,3482.228448926616}),
-      h(start={80196.484375,80197.90894929563,80199.3305700632,
-            80200.75139888813,80202.17143579095,70825.8984375})),
-    ExchangerWall(Tp(start={291.91912560937857,292.368260847782,
-            292.81758075140095,293.26708268122}),   Tp1(start={
-            290.60590026437563,291.055766680952,291.5058177362657,
-            291.9560507892685})),
-    Ns=4,
-    inertia=false,
-    Ntubes=100,
-    diffusion=true,
-    dynamic_energy_balance=true)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}})));
-  BoundaryConditions.SourcePQ                   sourceP1(
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    h0=2e6,
-    P0=5000000,
-    Q0=500,
-    T0=1273.15)
-    annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90,
-        origin={-10,70})));
-
-  BoundaryConditions.Sink                     sinkP1
-    annotation (Placement(transformation(extent={{10,-10},{-10,10}},
-                                                                   rotation=90,
-        origin={-10,-10})));
-equation
-  connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1)
-    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0}));
-  connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,0}));
-  connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1)
-    annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0}));
-  connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C)
-    annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicFlueGasesMultiFluidHeatExchanger;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicFlueGasesMultiFluidHeatExchanger
+
+  BoundaryConditions.SourceP                    sourceP(C(h_vol_2(start=
+            71016.12237181065)),
+    option_temperature=true,
+    P0=10000000,
+    Q(start=190407.49090838886))
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  BoundaryConditions.SinkP                    sinkP(C(h_vol_1(start=
+            71016.1223718086)))
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger dynamicMultiFluidHeatExchanger(
+    steady_state=true,
+    Cfg1(h_vol_2(start=1999458.3239137873)),
+    Cfg2(h_vol_1(start=1997835.1051783948)),
+    ExchangerFlueGasesMetal(
+      P(start={5000000.0,5000000.0,5000000.0,5000000.0,5000000.0,5000000.0}),
+      Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343,
+            2702.7912398488343,2702.7912398488343}),
+      Tp(start={293.20684981473266,293.655268073503,294.1038710234491,
+            294.55265602776745}),
+      h(start={2000000.0,1999458.375,1998916.9494222174,1998375.8765143699,
+            1997835.125,100000.0}),
+      rho2(start={9.227614370571606,9.229671002969678,9.231727464730685,
+            9.23378375498367,9.235839872860517})),
+    TwoPhaseFlowPipe(
+      P(start={10000000.0,8023904.042494878,6045867.025005122,
+            4065878.0712931687,2083926.1359166082,100000.0}),
+      Q(start={3482.228448926616,3482.228448926616,3482.228448926616,
+            3482.228448926616,3482.228448926616}),
+      h(start={80196.484375,80197.90894929563,80199.3305700632,
+            80200.75139888813,80202.17143579095,70825.8984375})),
+    ExchangerWall(Tp(start={291.91912560937857,292.368260847782,
+            292.81758075140095,293.26708268122}),   Tp1(start={
+            290.60590026437563,291.055766680952,291.5058177362657,
+            291.9560507892685})),
+    Ns=4,
+    inertia=false,
+    Ntubes=100,
+    diffusion=true,
+    dynamic_energy_balance=true)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}})));
+  BoundaryConditions.SourcePQ                   sourceP1(
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    h0=2e6,
+    P0=5000000,
+    Q0=500,
+    T0=1273.15)
+    annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90,
+        origin={-10,70})));
+
+  BoundaryConditions.Sink                     sinkP1
+    annotation (Placement(transformation(extent={{10,-10},{-10,10}},
+                                                                   rotation=90,
+        origin={-10,-10})));
+equation
+  connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1)
+    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0}));
+  connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,0}));
+  connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1)
+    annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0}));
+  connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C)
+    annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicFlueGasesMultiFluidHeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo
index 283204cb97ed5bc3fa47345866f44bd9984414da..56f0d2027f160cef7e034efbbbf0911e3373ae53 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo
@@ -1,85 +1,85 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicMultiFluidHeatExchanger
-
-  BoundaryConditions.SourceQ                    sourceP(C(h_vol_2(start=
-            71016.12237181065)),
-    Q0=10,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start=
-            71016.1223718086)))
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  HeatExchangers.DynamicMultiFluidHeatExchanger dynamicMultiFluidHeatExchanger(
-    steady_state=true,
-    diffusion=true,
-    dynamic_energy_balance=false,
-    Cfg1(h_vol_2(start=71016.12237181155)),
-    Cfg2(h_vol_1(start=71016.12237181314)),
-    DynamicOnePhaseFlowPipe_1(
-      P(start={300000.0,260001.59713260198,220002.3957916478,180002.39588440701,
-            140001.5973181204,100000.0}),
-      Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343,
-            2702.7912398488343,2702.7912398488343}),
-      h(start={71016.125,71016.125,71016.12237180988,71016.1223718091,71016.125,
-            70825.8984375})),
-    DynamicOnePhaseFlowPipe_2(
-      P(start={300000.0,260001.59801114563,220002.39710936273,180002.3972020214,
-            140001.59819646296,100000.0}),
-      Q(start={3482.228448926616,3482.228448926616,3482.228448926616,
-            3482.228448926616,3482.228448926616}),
-      Tp(start={290.0310327031831,290.04018142634584,290.0493302229013,
-            290.05847909283045}),
-      h(start={71016.125,71016.125,71016.12237181216,71016.12237181274,
-            71016.125,70825.8984375})),
-    ExchangerWall(Tp(start={290.03103270324897,290.0401814264445,
-            290.0493302229999,290.05847909289605}), Tp1(start={
-            290.03103270331616,290.04018142654525,290.0493302231005,
-            290.0584790929629})),
-    Ntubes=10,
-    Ns=4,
-    inertia=false)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}})));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=5000000,
-    T0=1273.15)
-    annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90,
-        origin={-10,70})));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{10,-10},{-10,10}},
-                                                                   rotation=90,
-        origin={-10,-10})));
-equation
-  connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1)
-    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0}));
-  connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,0}));
-  connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1)
-    annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0}));
-  connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C)
-    annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicMultiFluidHeatExchanger;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicMultiFluidHeatExchanger
+
+  BoundaryConditions.SourceQ                    sourceP(C(h_vol_2(start=
+            71016.12237181065)),
+    Q0=10,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start=
+            71016.1223718086)))
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  HeatExchangers.DynamicMultiFluidHeatExchanger dynamicMultiFluidHeatExchanger(
+    steady_state=true,
+    diffusion=true,
+    dynamic_energy_balance=false,
+    Cfg1(h_vol_2(start=71016.12237181155)),
+    Cfg2(h_vol_1(start=71016.12237181314)),
+    DynamicOnePhaseFlowPipe_1(
+      P(start={300000.0,260001.59713260198,220002.3957916478,180002.39588440701,
+            140001.5973181204,100000.0}),
+      Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343,
+            2702.7912398488343,2702.7912398488343}),
+      h(start={71016.125,71016.125,71016.12237180988,71016.1223718091,71016.125,
+            70825.8984375})),
+    DynamicOnePhaseFlowPipe_2(
+      P(start={300000.0,260001.59801114563,220002.39710936273,180002.3972020214,
+            140001.59819646296,100000.0}),
+      Q(start={3482.228448926616,3482.228448926616,3482.228448926616,
+            3482.228448926616,3482.228448926616}),
+      Tp(start={290.0310327031831,290.04018142634584,290.0493302229013,
+            290.05847909283045}),
+      h(start={71016.125,71016.125,71016.12237181216,71016.12237181274,
+            71016.125,70825.8984375})),
+    ExchangerWall(Tp(start={290.03103270324897,290.0401814264445,
+            290.0493302229999,290.05847909289605}), Tp1(start={
+            290.03103270331616,290.04018142654525,290.0493302231005,
+            290.0584790929629})),
+    Ntubes=10,
+    Ns=4,
+    inertia=false)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}})));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=5000000,
+    T0=1273.15)
+    annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90,
+        origin={-10,70})));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{10,-10},{-10,10}},
+                                                                   rotation=90,
+        origin={-10,-10})));
+equation
+  connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1)
+    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0}));
+  connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,0}));
+  connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1)
+    annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0}));
+  connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C)
+    annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicMultiFluidHeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo
index 8142df9fc3e2c305e8fe885dda3b94c9981c996c..6d6db2b99e19f60cacc962330e8ae1b2fbf8197a 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo
@@ -1,87 +1,87 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicMultiFluidHeatExchangerShell
-
-  BoundaryConditions.SourceQ                    sourceP(C(h_vol_2(start=
-            71016.12237181065)),
-    Q0=10,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start=
-            71016.1223718086)))
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  HeatExchangers.DynamicMultiFluidHeatExchangerShell dynamicMultiFluidHeatExchangerShell(
-    Cfg1(h_vol_2(start=71016.12237181155)),
-    Cfg2(h_vol_1(start=71016.12237181314)),
-    DynamicOnePhaseFlowPipe(
-      P(start={300000.0,260001.59713260198,220002.3957916478,180002.39588440701,
-            140001.5973181204,100000.0}),
-      Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343,
-            2702.7912398488343,2702.7912398488343}),
-      h(start={71016.125,71016.125,71016.12237180988,71016.1223718091,71016.125,
-            70825.8984375})),
-    dynamicOnePhaseFlowShell(
-      P(start={300000.0,260001.59801114563,220002.39710936273,180002.3972020214,
-            140001.59819646296,100000.0}),
-      Q(start={3482.228448926616,3482.228448926616,3482.228448926616,
-            3482.228448926616,3482.228448926616}),
-      Tp(start={290.0310327031831,290.04018142634584,290.0493302229013,
-            290.05847909283045}),
-      h(start={71016.125,71016.125,71016.12237181216,71016.12237181274,
-            71016.125,70825.8984375})),
-    ExchangerWall(Tp(start={290.03103270324897,290.0401814264445,
-            290.0493302229999,290.05847909289605}), Tp1(start={
-            290.03103270331616,290.04018142654525,290.0493302231005,
-            290.0584790929629})),
-    Ntubes=10,
-    Ns=4,
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    Dext=0.01,
-    inertia=false,
-    dynamic_energy_balance=false,
-    diffusion=true)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}})));
-
-  BoundaryConditions.SourceP                    sourceP1(
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=5000000,
-    T0=1273.15)
-    annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90,
-        origin={-10,70})));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{10,-10},{-10,10}},
-                                                                   rotation=90,
-        origin={-10,-10})));
-equation
-  connect(sourceP.C, dynamicMultiFluidHeatExchangerShell.Cws1)
-    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0}));
-  connect(dynamicMultiFluidHeatExchangerShell.Cws2, sinkP.C)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,0}));
-  connect(sourceP1.C, dynamicMultiFluidHeatExchangerShell.Cfg1)
-    annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0}));
-  connect(dynamicMultiFluidHeatExchangerShell.Cfg2, sinkP1.C)
-    annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicMultiFluidHeatExchangerShell;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicMultiFluidHeatExchangerShell
+
+  BoundaryConditions.SourceQ                    sourceP(C(h_vol_2(start=
+            71016.12237181065)),
+    Q0=10,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start=
+            71016.1223718086)))
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  HeatExchangers.DynamicMultiFluidHeatExchangerShell dynamicMultiFluidHeatExchangerShell(
+    Cfg1(h_vol_2(start=71016.12237181155)),
+    Cfg2(h_vol_1(start=71016.12237181314)),
+    DynamicOnePhaseFlowPipe(
+      P(start={300000.0,260001.59713260198,220002.3957916478,180002.39588440701,
+            140001.5973181204,100000.0}),
+      Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343,
+            2702.7912398488343,2702.7912398488343}),
+      h(start={71016.125,71016.125,71016.12237180988,71016.1223718091,71016.125,
+            70825.8984375})),
+    dynamicOnePhaseFlowShell(
+      P(start={300000.0,260001.59801114563,220002.39710936273,180002.3972020214,
+            140001.59819646296,100000.0}),
+      Q(start={3482.228448926616,3482.228448926616,3482.228448926616,
+            3482.228448926616,3482.228448926616}),
+      Tp(start={290.0310327031831,290.04018142634584,290.0493302229013,
+            290.05847909283045}),
+      h(start={71016.125,71016.125,71016.12237181216,71016.12237181274,
+            71016.125,70825.8984375})),
+    ExchangerWall(Tp(start={290.03103270324897,290.0401814264445,
+            290.0493302229999,290.05847909289605}), Tp1(start={
+            290.03103270331616,290.04018142654525,290.0493302231005,
+            290.0584790929629})),
+    Ntubes=10,
+    Ns=4,
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    Dext=0.01,
+    inertia=false,
+    dynamic_energy_balance=false,
+    diffusion=true)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}})));
+
+  BoundaryConditions.SourceP                    sourceP1(
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=5000000,
+    T0=1273.15)
+    annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90,
+        origin={-10,70})));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{10,-10},{-10,10}},
+                                                                   rotation=90,
+        origin={-10,-10})));
+equation
+  connect(sourceP.C, dynamicMultiFluidHeatExchangerShell.Cws1)
+    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0}));
+  connect(dynamicMultiFluidHeatExchangerShell.Cws2, sinkP.C)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,0}));
+  connect(sourceP1.C, dynamicMultiFluidHeatExchangerShell.Cfg1)
+    annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0}));
+  connect(dynamicMultiFluidHeatExchangerShell.Cfg2, sinkP1.C)
+    annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicMultiFluidHeatExchangerShell;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo
index 7f7f9e564288d326872eac9e025d78a325be7d7e..7399a067545dc59d630bcbc75717126bf4754f87 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo
@@ -1,62 +1,62 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicOnePhaseFlowPipe
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
-    dynamicOnePhaseFlowPipe(
-    Q(start={536.5750641592207,536.5750641592207,536.5750641592207,
-          536.5750641592207,536.5750641592207,536.5750641592207,
-          536.5750641592207,536.5750641592207,536.5750641592207,
-          536.5750641592207,536.5750641592207}),
-    h(start={71016.12237181116,74743.46665892199,78470.81094603281,
-          82198.15523314364,85925.49952025448,89652.84380736532,
-          93380.18809447614,97107.53238158698,100834.8766686978,
-          104562.22095580865,108289.56524291947,70825.9016030344}),
-    P(start={300000,281833.41863537,263664.30473175,245492.47958308,
-          227317.76827098,209139.99948382,190959.00534677,172774.621262,
-          154586.68575823,136395.04034906,118199.5293995,100000}))
-                            annotation (Placement(transformation(extent={{-20,
-            20},{0,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    option_temperature=2,
-    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6})
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10)
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-equation
-  connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-40,
-          30},{-20,30}}, color={0,0,255}));
-  connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{0,30},
-          {20,30}}, color={0,0,255}));
-  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{-10,
-          60.2},{-10,52}}, color={191,95,0}));
-  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh)
-    annotation (Line(points={{-10,48},{-10,33}}, color={191,95,0}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicOnePhaseFlowPipe;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicOnePhaseFlowPipe
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe
+    dynamicOnePhaseFlowPipe(
+    Q(start={536.5750641592207,536.5750641592207,536.5750641592207,
+          536.5750641592207,536.5750641592207,536.5750641592207,
+          536.5750641592207,536.5750641592207,536.5750641592207,
+          536.5750641592207,536.5750641592207}),
+    h(start={71016.12237181116,74743.46665892199,78470.81094603281,
+          82198.15523314364,85925.49952025448,89652.84380736532,
+          93380.18809447614,97107.53238158698,100834.8766686978,
+          104562.22095580865,108289.56524291947,70825.9016030344}),
+    P(start={300000,281833.41863537,263664.30473175,245492.47958308,
+          227317.76827098,209139.99948382,190959.00534677,172774.621262,
+          154586.68575823,136395.04034906,118199.5293995,100000}))
+                            annotation (Placement(transformation(extent={{-20,
+            20},{0,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    option_temperature=2,
+    W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6})
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10)
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+equation
+  connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-40,
+          30},{-20,30}}, color={0,0,255}));
+  connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{0,30},
+          {20,30}}, color={0,0,255}));
+  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{-10,
+          60.2},{-10,52}}, color={191,95,0}));
+  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh)
+    annotation (Line(points={{-10,48},{-10,33}}, color={191,95,0}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicOnePhaseFlowPipe;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo
index f07b018d8e559d488f232e5d0bef135a3f0cf06e..b8e6944e519f74027e959718ba64292b2c95e245 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo
@@ -1,80 +1,80 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicOnePhaseFlowShell
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell
-    dynamicOnePhaseFlowPipeShell(
-    Q(start={30,30,30,30,30,30,30,30,30,30,30}),
-    Ds=1,
-    ntubes=520,
-    L=12,
-    P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000,
-          1973000,1965000,1955000,1950000})) annotation (Placement(
-        transformation(extent={{-48,-36},{48,36}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature=false, P0(fixed=
-         false) = 1900000)
-                 annotation (Placement(transformation(extent={{74,-15},{102,15}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    h0=600e3,
-    P0=2000000,
-    Q(start=500, fixed=true))
-             annotation (Placement(transformation(extent={{-103,-15},{-75,15}},
-          rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    lambda=10,
-    Ns=10,
-    cpw=460,
-    rhow=7900,
-    D=0.017,
-    e=0.002,
-    ntubes=520,
-    L=12) annotation (Placement(transformation(extent={{-54,30},{54,58}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    option_temperature=2,
-    W0={-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6},
-    T0={300,300,300,300,300,300,300,300,300,300})
-                  annotation (Placement(transformation(extent={{-12,76},{12,98}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Initialvalue=20e5,
-    Starttime=300,
-    Duration=600,
-    Finalvalue=19.8e5)
-                     annotation (Placement(transformation(extent={{-100,32},{
-            -80,52}}, rotation=0)));
-equation
-  connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1)
-    annotation (Line(points={{-75,0},{-48,0}}, color={0,0,255}));
-  connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C)
-    annotation (Line(points={{48,0},{74,0}}, color={0,0,255}));
-  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh)
-    annotation (Line(points={{0,41.2},{0,10.8}}, color={191,95,0}));
-  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,
-          76.22},{0,46.8}}, color={191,95,0}));
-  connect(rampe.y, sourceP.IPressure)
-    annotation (Line(points={{-79,42},{-70,42},{-70,24},{-98,24},{-98,0},{-96,0}}));
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicOnePhaseFlowShell;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicOnePhaseFlowShell
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell
+    dynamicOnePhaseFlowPipeShell(
+    Q(start={30,30,30,30,30,30,30,30,30,30,30}),
+    Ds=1,
+    ntubes=520,
+    L=12,
+    P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000,
+          1973000,1965000,1955000,1950000})) annotation (Placement(
+        transformation(extent={{-48,-36},{48,36}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature=false, P0(fixed=
+         false) = 1900000)
+                 annotation (Placement(transformation(extent={{74,-15},{102,15}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    h0=600e3,
+    P0=2000000,
+    Q(start=500, fixed=true))
+             annotation (Placement(transformation(extent={{-103,-15},{-75,15}},
+          rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    lambda=10,
+    Ns=10,
+    cpw=460,
+    rhow=7900,
+    D=0.017,
+    e=0.002,
+    ntubes=520,
+    L=12) annotation (Placement(transformation(extent={{-54,30},{54,58}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    option_temperature=2,
+    W0={-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6},
+    T0={300,300,300,300,300,300,300,300,300,300})
+                  annotation (Placement(transformation(extent={{-12,76},{12,98}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Initialvalue=20e5,
+    Starttime=300,
+    Duration=600,
+    Finalvalue=19.8e5)
+                     annotation (Placement(transformation(extent={{-100,32},{
+            -80,52}}, rotation=0)));
+equation
+  connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1)
+    annotation (Line(points={{-75,0},{-48,0}}, color={0,0,255}));
+  connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C)
+    annotation (Line(points={{48,0},{74,0}}, color={0,0,255}));
+  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh)
+    annotation (Line(points={{0,41.2},{0,10.8}}, color={191,95,0}));
+  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,
+          76.22},{0,46.8}}, color={191,95,0}));
+  connect(rampe.y, sourceP.IPressure)
+    annotation (Line(points={{-79,42},{-70,42},{-70,24},{-98,24},{-98,0},{-96,0}}));
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicOnePhaseFlowShell;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo
index 36aca3f1b34594f61a2df2940e677f8f3ecf8663..3003053abe4e65caa3569cb34bbcc8d25c85becf 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo
@@ -1,89 +1,89 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicPlateHeatExchanger
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger
-    echangeurAPlaques1D(
-    region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    steady_state=true,
-    Ns=10,
-    dynamic_energy_balance=false,
-    diffusion=true,
-    continuous_flow_reversal=true)
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-
-  BoundaryConditions.SourcePQ                   sourceP(
-      option_temperature=true,
-    diffusion=true,
-    T0=340)
-    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
-  BoundaryConditions.SourcePQ                   sourceP1
-                                            annotation (Placement(
-        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  BoundaryConditions.Sink                     puitsP(option_temperature=true,
-      diffusion=true)                    annotation (Placement(transformation(
-          extent={{40,40},{60,60}}, rotation=0)));
-  BoundaryConditions.Sink                     puitsP1
-                                          annotation (Placement(transformation(
-          extent={{20,20},{40,40}}, rotation=0)));
-  HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques(region_c=
-        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-    annotation (Placement(transformation(extent={{-20,-40},{0,-20}}, rotation=0)));
-  BoundaryConditions.SourcePQ                   sourceP2(T0=340,
-      option_temperature=true)
-    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}},
-                                                                     rotation=0)));
-  BoundaryConditions.SourcePQ                   sourceP3
-                                            annotation (Placement(
-        transformation(extent={{-60,-60},{-40,-40}},
-                                                   rotation=0)));
-  BoundaryConditions.Sink                     puitsP2
-                                         annotation (Placement(transformation(
-          extent={{40,-40},{60,-20}},
-                                    rotation=0)));
-  BoundaryConditions.Sink                     puitsP3
-                                          annotation (Placement(transformation(
-          extent={{20,-60},{40,-40}},
-                                    rotation=0)));
-equation
-  connect(sourceP.C, echangeurAPlaques1D.Ec)
-    annotation (Line(points={{-60,50},{-20,50}}, color={0,0,255}));
-  connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation (Line(points={{-40,30},
-          {-15,30},{-15,44}}, color={0,0,255}));
-  connect(echangeurAPlaques1D.Sc, puitsP.C) annotation (Line(points={{0,50},{20,
-          50},{20,50},{40,50}},      color={0,0,255}));
-  connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation (Line(points={{-5,44},{
-          -6,44},{-6,30},{20,30}}, color={0,0,255}));
-  connect(sourceP2.C, echangeurAPlaques.Ec)
-    annotation (Line(points={{-60,-30},{-20,-30}}, color={0,0,255}));
-  connect(sourceP3.C, echangeurAPlaques.Ef)
-    annotation (Line(points={{-40,-50},{-15,-50},{-15,-36}}, color={0,0,255}));
-  connect(echangeurAPlaques.Sc, puitsP2.C) annotation (Line(points={{0,-29.8},{20,
-          -29.8},{20,-30},{40,-30}}, color={0,0,255}));
-  connect(echangeurAPlaques.Sf, puitsP3.C) annotation (Line(points={{-5,-36},{-6,
-          -36},{-6,-50},{20,-50}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicPlateHeatExchanger;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicPlateHeatExchanger
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger
+    echangeurAPlaques1D(
+    region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    steady_state=true,
+    Ns=10,
+    dynamic_energy_balance=false,
+    diffusion=true,
+    continuous_flow_reversal=true)
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+
+  BoundaryConditions.SourcePQ                   sourceP(
+      option_temperature=true,
+    diffusion=true,
+    T0=340)
+    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
+  BoundaryConditions.SourcePQ                   sourceP1
+                                            annotation (Placement(
+        transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  BoundaryConditions.Sink                     puitsP(option_temperature=true,
+      diffusion=true)                    annotation (Placement(transformation(
+          extent={{40,40},{60,60}}, rotation=0)));
+  BoundaryConditions.Sink                     puitsP1
+                                          annotation (Placement(transformation(
+          extent={{20,20},{40,40}}, rotation=0)));
+  HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques(region_c=
+        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+    annotation (Placement(transformation(extent={{-20,-40},{0,-20}}, rotation=0)));
+  BoundaryConditions.SourcePQ                   sourceP2(T0=340,
+      option_temperature=true)
+    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}},
+                                                                     rotation=0)));
+  BoundaryConditions.SourcePQ                   sourceP3
+                                            annotation (Placement(
+        transformation(extent={{-60,-60},{-40,-40}},
+                                                   rotation=0)));
+  BoundaryConditions.Sink                     puitsP2
+                                         annotation (Placement(transformation(
+          extent={{40,-40},{60,-20}},
+                                    rotation=0)));
+  BoundaryConditions.Sink                     puitsP3
+                                          annotation (Placement(transformation(
+          extent={{20,-60},{40,-40}},
+                                    rotation=0)));
+equation
+  connect(sourceP.C, echangeurAPlaques1D.Ec)
+    annotation (Line(points={{-60,50},{-20,50}}, color={0,0,255}));
+  connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation (Line(points={{-40,30},
+          {-15,30},{-15,44}}, color={0,0,255}));
+  connect(echangeurAPlaques1D.Sc, puitsP.C) annotation (Line(points={{0,50},{20,
+          50},{20,50},{40,50}},      color={0,0,255}));
+  connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation (Line(points={{-5,44},{
+          -6,44},{-6,30},{20,30}}, color={0,0,255}));
+  connect(sourceP2.C, echangeurAPlaques.Ec)
+    annotation (Line(points={{-60,-30},{-20,-30}}, color={0,0,255}));
+  connect(sourceP3.C, echangeurAPlaques.Ef)
+    annotation (Line(points={{-40,-50},{-15,-50},{-15,-36}}, color={0,0,255}));
+  connect(echangeurAPlaques.Sc, puitsP2.C) annotation (Line(points={{0,-29.8},{20,
+          -29.8},{20,-30},{40,-30}}, color={0,0,255}));
+  connect(echangeurAPlaques.Sf, puitsP3.C) annotation (Line(points={{-5,-36},{-6,
+          -36},{-6,-50},{20,-50}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicPlateHeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo
index 00ea3dc0d73d21f4fb47223330797f730f9e9ce9..1ee6859dc8c2d3731147698b564aa80708001322 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo
@@ -1,103 +1,103 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicReliefValve
-  import ThermoSysPro;
-  parameter ThermoSysPro.Units.SI.AbsolutePressure Pinitial=18e5
-    "Initial pressure";
-  parameter ThermoSysPro.Units.SI.AbsolutePressure Pfinal=Pinitial
-    "Final pressure";
-  parameter ThermoSysPro.Units.SI.AbsolutePressure Pmax=21e5 "Maximum pressure";
-
-  ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve reliefValve(
-    mech_steady_state=false,
-    caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351;
-        0.7,8625; 0.8,8818; 0.9,8958; 1,9063],
-    Cvmax=9063,
-    Q(start=0),
-    Pm(start=Pinitial),
-    Pout=sinkP.P0,
-    mode_caract=2,
-    A2=1.1*reliefValve.A1,
-    A1=1.3*Modelica.Constants.pi*pipe.D^2/4,
-    m=50,
-    Cd=0.44,
-    Popen=2000000,
-    z_max=0.05)
-    annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe(
-    Q(start=0),
-    Pm(start=Pinitial),
-    L=2,
-    D=0.2) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP
-                                   annotation (Placement(transformation(extent={{80,0},{
-            100,20}},          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}})));
-  InstrumentationAndControl.Blocks.Sources.Rampe ramp1(
-    Duration=200,
-    Finalvalue=Pmax,
-    Initialvalue=Pinitial)
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
-  InstrumentationAndControl.Blocks.Sources.Rampe ramp2(
-    Duration=200,
-    Starttime=300,
-    Finalvalue=Pmax - Pfinal)
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}})));
-  InstrumentationAndControl.Blocks.Math.Add add(k2=-1)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}})));
-  ThermoSysPro.Fluid.PressureLosses.Bend bend(R0=0.2, D=pipe.D)
-    annotation (Placement(transformation(extent={{0,-20},{20,-40}})));
-  ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(Ouv=1, D=0.5)
-    annotation (Placement(transformation(extent={{40,0},{60,20}})));
-equation
-  connect(sourceP.C, pipe.C1)
-    annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255}));
-  connect(ramp1.y, add.u1) annotation (Line(points={{-79,50},{-70,50},{-70,36},{
-          -61,36}}, color={0,0,255}));
-  connect(ramp2.y, add.u2) annotation (Line(points={{-79,10},{-70,10},{-70,24},{
-          -61,24}}, color={0,0,255}));
-  connect(add.y, sourceP.IPressure) annotation (Line(points={{-39,30},{-20,30},{
-          -20,-10},{-90,-10},{-90,-30},{-75,-30}},
-                                                 color={0,0,255}));
-  connect(pipe.C2, bend.C1)
-    annotation (Line(points={{-20,-30},{0,-30}}, color={0,0,255}));
-  connect(bend.C2,reliefValve. C1)
-    annotation (Line(points={{10,-20},{10,0.2}},color={0,0,255}));
-  connect(reliefValve.C2, diaphragm.C1)
-    annotation (Line(points={{20,10},{40,10}}, color={0,0,255}));
-  connect(diaphragm.C2,sinkP. C)
-    annotation (Line(points={{60,10},{80,10}}, color={0,0,255}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false, initialScale=0.1)),
-    Window(
-      x=0.1,
-      y=0.08,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
-         coordinateSystem(preserveAspectRatio=false, initialScale=0.1)),
-    experiment(StopTime=600, Interval=1),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicReliefValve;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicReliefValve
+  import ThermoSysPro;
+  parameter ThermoSysPro.Units.SI.AbsolutePressure Pinitial=18e5
+    "Initial pressure";
+  parameter ThermoSysPro.Units.SI.AbsolutePressure Pfinal=Pinitial
+    "Final pressure";
+  parameter ThermoSysPro.Units.SI.AbsolutePressure Pmax=21e5 "Maximum pressure";
+
+  ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve reliefValve(
+    mech_steady_state=false,
+    caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351;
+        0.7,8625; 0.8,8818; 0.9,8958; 1,9063],
+    Cvmax=9063,
+    Q(start=0),
+    Pm(start=Pinitial),
+    Pout=sinkP.P0,
+    mode_caract=2,
+    A2=1.1*reliefValve.A1,
+    A1=1.3*Modelica.Constants.pi*pipe.D^2/4,
+    m=50,
+    Cd=0.44,
+    Popen=2000000,
+    z_max=0.05)
+    annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe(
+    Q(start=0),
+    Pm(start=Pinitial),
+    L=2,
+    D=0.2) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP
+                                   annotation (Placement(transformation(extent={{80,0},{
+            100,20}},          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}})));
+  InstrumentationAndControl.Blocks.Sources.Rampe ramp1(
+    Duration=200,
+    Finalvalue=Pmax,
+    Initialvalue=Pinitial)
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
+  InstrumentationAndControl.Blocks.Sources.Rampe ramp2(
+    Duration=200,
+    Starttime=300,
+    Finalvalue=Pmax - Pfinal)
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}})));
+  InstrumentationAndControl.Blocks.Math.Add add(k2=-1)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}})));
+  ThermoSysPro.Fluid.PressureLosses.Bend bend(R0=0.2, D=pipe.D)
+    annotation (Placement(transformation(extent={{0,-20},{20,-40}})));
+  ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(Ouv=1, D=0.5)
+    annotation (Placement(transformation(extent={{40,0},{60,20}})));
+equation
+  connect(sourceP.C, pipe.C1)
+    annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255}));
+  connect(ramp1.y, add.u1) annotation (Line(points={{-79,50},{-70,50},{-70,36},{
+          -61,36}}, color={0,0,255}));
+  connect(ramp2.y, add.u2) annotation (Line(points={{-79,10},{-70,10},{-70,24},{
+          -61,24}}, color={0,0,255}));
+  connect(add.y, sourceP.IPressure) annotation (Line(points={{-39,30},{-20,30},{
+          -20,-10},{-90,-10},{-90,-30},{-75,-30}},
+                                                 color={0,0,255}));
+  connect(pipe.C2, bend.C1)
+    annotation (Line(points={{-20,-30},{0,-30}}, color={0,0,255}));
+  connect(bend.C2,reliefValve. C1)
+    annotation (Line(points={{10,-20},{10,0.2}},color={0,0,255}));
+  connect(reliefValve.C2, diaphragm.C1)
+    annotation (Line(points={{20,10},{40,10}}, color={0,0,255}));
+  connect(diaphragm.C2,sinkP. C)
+    annotation (Line(points={{60,10},{80,10}}, color={0,0,255}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false, initialScale=0.1)),
+    Window(
+      x=0.1,
+      y=0.08,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
+         coordinateSystem(preserveAspectRatio=false, initialScale=0.1)),
+    experiment(StopTime=600, Interval=1),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicReliefValve;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo
index d0475bad65aab10689a83991345a6a9ef1dc1c58..7163efa8ffb129a18e98ef7fbdb24d161a68e1c5 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo
@@ -1,120 +1,120 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicTwoPhaseFlowPipe
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
-    dynamicTwoPhaseFlowPipe(L=20, advection=false,
-    Q(start={378.2555714391421,378.2555714391421,378.2555714391421,
-          378.2555714391421,378.2555714391421,378.2555714391421,
-          378.2555714391421,378.2555714391421,378.2555714391421,
-          378.2555714391421,378.2555714391421}),
-    h(start={71016.12237181116,89522.1287033792,108028.13503495205,
-          126534.14136650086,145040.14769798872,163546.15402957145,
-          182052.16036112772,200558.16669267463,219064.17302421754,
-          237570.17935577242,256076.18568728055,70825.9016030344}),
-    dynamic_energy_balance=false,
-    diffusion=true,
-    P(start={300000,281934.94102069,263857.29519348,245762.87920492,
-          227647.89301968,209508.84324089,191342.485106,173145.77779074,
-          154915.84935981,136649.96881108,118345.52340716,100000}))
-                            annotation (Placement(transformation(extent={{-10,30},
-            {10,50}},    rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceP
-    annotation (Placement(transformation(extent={{-50,30},{-30,50}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkP
-    annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0)));
-  Thermal.BoundaryConditions.HeatSource              heatSource(
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    option_temperature=2,
-    W0={7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6})
-    annotation (Placement(transformation(extent={{-10,70},{10,90}},rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall(Ns=10,
-      dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-10,50},{10,70}},rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(
-    L=10,
-    D=0.03,
-    dpfCorr(fixed=false,
-      start=0.23963336533422905)=
-                           1,
-    inertia=true,
-    P(start={2000000,1999571.7070274,1999140.9402168,1998707.6248919,
-          1998271.6837223,1997833.0364983,1997391.5998908,1996715.822109,
-          1995640.0182728,1994163.0145856,1992283.4952231,1990000}))
-                            annotation (Placement(transformation(extent={{-40,-90},
-            {40,-32}},     rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    C(Q(fixed=true, start=1)),
-    option_temperature=false,
-    h0=800e3,
-    P0=2000000)
-    annotation (Placement(transformation(extent={{-90,-70},{-70,-50}},rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(
-    option_temperature=false,
-    h0=2000e3,
-    P0=1990000)
-    annotation (Placement(transformation(extent={{70,-70},{90,-50}},rotation=0)));
-  Thermal.BoundaryConditions.HeatSource heatSource1(
-    option_temperature=2,
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4})
-    annotation (Placement(transformation(extent={{-10,-11},{10,9}}, rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(            Ns=10,
-    L=10,
-    lambda=10,
-    cpw=460,
-    rhow=7900,
-    e=0.005,
-    D=0.03)
-    annotation (Placement(transformation(extent={{-40,-70},{40,10}},rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Initialvalue=20e5,
-    Starttime=300,
-    Duration=600,
-    Finalvalue=19.8e5)
-                     annotation (Placement(transformation(extent={{-74,-46},{-86,
-            -35}},
-                 rotation=0)));
-equation
-  connect(sourceP.C,dynamicTwoPhaseFlowPipe. C1) annotation (Line(points={{-30,40},
-          {-10,40}},     color={0,0,255}));
-  connect(dynamicTwoPhaseFlowPipe.C2,sinkP. C) annotation (Line(points={{10,40},
-          {30,40}}, color={0,0,255}));
-  connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,70.2},
-          {0,62}},         color={191,95,0}));
-  connect(heatExchangerWall.WT1,dynamicTwoPhaseFlowPipe. CTh)
-    annotation (Line(points={{0,58},{0,43}},     color={191,95,0}));
-  connect(sourceP1.C,dynamicTwoPhaseFlowPipe1. C1) annotation (Line(points={{-70,-60},
-          {-42,-60},{-42,-61},{-40,-61}},                              color={0,
-          0,255}));
-  connect(dynamicTwoPhaseFlowPipe1.C2,sinkP1. C) annotation (Line(points={{40,-61},
-          {40,-60},{70,-60}},               color={0,0,255}));
-  connect(heatSource1.C,heatExchangerWall1. WT2)
-    annotation (Line(points={{0,-10.8},{0,-22}},         color={191,95,0}));
-  connect(heatExchangerWall1.WT1,dynamicTwoPhaseFlowPipe1. CTh)
-    annotation (Line(points={{0,-38},{0,-52.3}}, color={191,95,0}));
-  connect(rampe.y,sourceP1. IPressure)
-    annotation (Line(points={{-86.6,-40.5},{-92,-40.5},{-92,-60},{-85,-60}}));
-  annotation (experiment(StopTime=1000), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicTwoPhaseFlowPipe;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicTwoPhaseFlowPipe
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
+    dynamicTwoPhaseFlowPipe(L=20, advection=false,
+    Q(start={378.2555714391421,378.2555714391421,378.2555714391421,
+          378.2555714391421,378.2555714391421,378.2555714391421,
+          378.2555714391421,378.2555714391421,378.2555714391421,
+          378.2555714391421,378.2555714391421}),
+    h(start={71016.12237181116,89522.1287033792,108028.13503495205,
+          126534.14136650086,145040.14769798872,163546.15402957145,
+          182052.16036112772,200558.16669267463,219064.17302421754,
+          237570.17935577242,256076.18568728055,70825.9016030344}),
+    dynamic_energy_balance=false,
+    diffusion=true,
+    P(start={300000,281934.94102069,263857.29519348,245762.87920492,
+          227647.89301968,209508.84324089,191342.485106,173145.77779074,
+          154915.84935981,136649.96881108,118345.52340716,100000}))
+                            annotation (Placement(transformation(extent={{-10,30},
+            {10,50}},    rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceP
+    annotation (Placement(transformation(extent={{-50,30},{-30,50}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkP
+    annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0)));
+  Thermal.BoundaryConditions.HeatSource              heatSource(
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    option_temperature=2,
+    W0={7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6})
+    annotation (Placement(transformation(extent={{-10,70},{10,90}},rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall(Ns=10,
+      dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-10,50},{10,70}},rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(
+    L=10,
+    D=0.03,
+    dpfCorr(fixed=false,
+      start=0.23963336533422905)=
+                           1,
+    inertia=true,
+    P(start={2000000,1999571.7070274,1999140.9402168,1998707.6248919,
+          1998271.6837223,1997833.0364983,1997391.5998908,1996715.822109,
+          1995640.0182728,1994163.0145856,1992283.4952231,1990000}))
+                            annotation (Placement(transformation(extent={{-40,-90},
+            {40,-32}},     rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    C(Q(fixed=true, start=1)),
+    option_temperature=false,
+    h0=800e3,
+    P0=2000000)
+    annotation (Placement(transformation(extent={{-90,-70},{-70,-50}},rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(
+    option_temperature=false,
+    h0=2000e3,
+    P0=1990000)
+    annotation (Placement(transformation(extent={{70,-70},{90,-50}},rotation=0)));
+  Thermal.BoundaryConditions.HeatSource heatSource1(
+    option_temperature=2,
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4})
+    annotation (Placement(transformation(extent={{-10,-11},{10,9}}, rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(            Ns=10,
+    L=10,
+    lambda=10,
+    cpw=460,
+    rhow=7900,
+    e=0.005,
+    D=0.03)
+    annotation (Placement(transformation(extent={{-40,-70},{40,10}},rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Initialvalue=20e5,
+    Starttime=300,
+    Duration=600,
+    Finalvalue=19.8e5)
+                     annotation (Placement(transformation(extent={{-74,-46},{-86,
+            -35}},
+                 rotation=0)));
+equation
+  connect(sourceP.C,dynamicTwoPhaseFlowPipe. C1) annotation (Line(points={{-30,40},
+          {-10,40}},     color={0,0,255}));
+  connect(dynamicTwoPhaseFlowPipe.C2,sinkP. C) annotation (Line(points={{10,40},
+          {30,40}}, color={0,0,255}));
+  connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,70.2},
+          {0,62}},         color={191,95,0}));
+  connect(heatExchangerWall.WT1,dynamicTwoPhaseFlowPipe. CTh)
+    annotation (Line(points={{0,58},{0,43}},     color={191,95,0}));
+  connect(sourceP1.C,dynamicTwoPhaseFlowPipe1. C1) annotation (Line(points={{-70,-60},
+          {-42,-60},{-42,-61},{-40,-61}},                              color={0,
+          0,255}));
+  connect(dynamicTwoPhaseFlowPipe1.C2,sinkP1. C) annotation (Line(points={{40,-61},
+          {40,-60},{70,-60}},               color={0,0,255}));
+  connect(heatSource1.C,heatExchangerWall1. WT2)
+    annotation (Line(points={{0,-10.8},{0,-22}},         color={191,95,0}));
+  connect(heatExchangerWall1.WT1,dynamicTwoPhaseFlowPipe1. CTh)
+    annotation (Line(points={{0,-38},{0,-52.3}}, color={191,95,0}));
+  connect(rampe.y,sourceP1. IPressure)
+    annotation (Line(points={{-86.6,-40.5},{-92,-40.5},{-92,-60},{-85,-60}}));
+  annotation (experiment(StopTime=1000), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicTwoPhaseFlowPipe;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo
index aad5cae63cdedfe3df961538bc152cd46724dbf0..f5d60064b93a76a489854d90d82f2386de55f86b 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo
@@ -1,79 +1,79 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicTwoPhaseFlowRiser
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser(
-    L=20,
-    inertia=false,
-    advection=false,
-    dynamic_energy_balance=true,
-    Q(start={0.7975821689256883,0.7975821689256898,0.7975821689256883,
-          0.7975821689256885,0.7975821689256883,0.797582168925689,
-          0.7975821689256886,0.7975821689256887,0.7975821689256888,
-          0.7975821689256888,0.7975821689256886}),
-    h(start={71016.12237181116,196401.3226637204,196412.6067675415,
-          196423.89087136256,196435.17497518365,196446.45907900474,
-          196457.7431828258,196469.0272866469,196480.31139046798,
-          196491.59549428907,196502.87959811013,70825.9016030344}),
-    diffusion=true,
-    P(start={300000,281879.25838975,263692.15565175,245504.87004838,
-          227317.40156239,209129.75017657,190941.91587368,172753.89863649,
-          154565.69844777,136377.31529027,118188.74914676,100000})) annotation (
-     Placement(transformation(extent={{-10,30},{10,48}}, rotation=0)));
-  BoundaryConditions.SourceP                                 sourcePQ(ftype=
-        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteamSimple)
-    annotation (Placement(transformation(extent={{-50,30},{-30,50}}, rotation=0)));
-  BoundaryConditions.SinkP                                 sinkP
-    annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0)));
-  Thermal.BoundaryConditions.HeatSource              heatSource(
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    option_temperature=2,
-    W0={0,0,0,0.0,0.0,0.0,0.0,0.0,0.0,0.0})
-    annotation (Placement(transformation(extent={{-10,80},{10,100}},
-                                                                   rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall(Ns=10,
-      dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-10,60},{10,80}},rotation=0)));
-  Thermal.BoundaryConditions.HeatSource              heatSource1(
-    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
-    option_temperature=2,
-    W0={0,0,0,0,0,0,0,0,0,0})
-    annotation (Placement(transformation(extent={{-10,0},{10,-20}},rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall1(Ns=10,
-      dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-10,20},{10,0}}, rotation=0)));
-equation
-  connect(sourcePQ.C, dynamicTwoPhaseFlowRiser.C1) annotation (Line(points={{-30,
-          40},{-20,40},{-20,39.9},{-10,39.9}}, color={0,0,255}));
-  connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation (Line(points={{10,
-          39.9},{20,39.9},{20,40},{30,40}}, color={0,0,255}));
-  connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,80.2},
-          {0,72}},         color={191,95,0}));
-  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowRiser.CTh1)
-    annotation (Line(points={{0,68},{0,45.3}}, color={0,0,0}));
-  connect(dynamicTwoPhaseFlowRiser.CTh2, heatExchangerWall1.WT1)
-    annotation (Line(points={{0,34.5},{0,12}}, color={0,0,0}));
-  connect(heatExchangerWall1.WT2, heatSource1.C)
-    annotation (Line(points={{0,8},{0,-0.2}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicTwoPhaseFlowRiser;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicTwoPhaseFlowRiser
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser(
+    L=20,
+    inertia=false,
+    advection=false,
+    dynamic_energy_balance=true,
+    Q(start={0.7975821689256883,0.7975821689256898,0.7975821689256883,
+          0.7975821689256885,0.7975821689256883,0.797582168925689,
+          0.7975821689256886,0.7975821689256887,0.7975821689256888,
+          0.7975821689256888,0.7975821689256886}),
+    h(start={71016.12237181116,196401.3226637204,196412.6067675415,
+          196423.89087136256,196435.17497518365,196446.45907900474,
+          196457.7431828258,196469.0272866469,196480.31139046798,
+          196491.59549428907,196502.87959811013,70825.9016030344}),
+    diffusion=true,
+    P(start={300000,281879.25838975,263692.15565175,245504.87004838,
+          227317.40156239,209129.75017657,190941.91587368,172753.89863649,
+          154565.69844777,136377.31529027,118188.74914676,100000})) annotation (
+     Placement(transformation(extent={{-10,30},{10,48}}, rotation=0)));
+  BoundaryConditions.SourceP                                 sourcePQ(ftype=
+        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteamSimple)
+    annotation (Placement(transformation(extent={{-50,30},{-30,50}}, rotation=0)));
+  BoundaryConditions.SinkP                                 sinkP
+    annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0)));
+  Thermal.BoundaryConditions.HeatSource              heatSource(
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    option_temperature=2,
+    W0={0,0,0,0.0,0.0,0.0,0.0,0.0,0.0,0.0})
+    annotation (Placement(transformation(extent={{-10,80},{10,100}},
+                                                                   rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall(Ns=10,
+      dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-10,60},{10,80}},rotation=0)));
+  Thermal.BoundaryConditions.HeatSource              heatSource1(
+    T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900},
+    option_temperature=2,
+    W0={0,0,0,0,0,0,0,0,0,0})
+    annotation (Placement(transformation(extent={{-10,0},{10,-20}},rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall              heatExchangerWall1(Ns=10,
+      dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-10,20},{10,0}}, rotation=0)));
+equation
+  connect(sourcePQ.C, dynamicTwoPhaseFlowRiser.C1) annotation (Line(points={{-30,
+          40},{-20,40},{-20,39.9},{-10,39.9}}, color={0,0,255}));
+  connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation (Line(points={{10,
+          39.9},{20,39.9},{20,40},{30,40}}, color={0,0,255}));
+  connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,80.2},
+          {0,72}},         color={191,95,0}));
+  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowRiser.CTh1)
+    annotation (Line(points={{0,68},{0,45.3}}, color={0,0,0}));
+  connect(dynamicTwoPhaseFlowRiser.CTh2, heatExchangerWall1.WT1)
+    annotation (Line(points={{0,34.5},{0,12}}, color={0,0,0}));
+  connect(heatExchangerWall1.WT2, heatSource1.C)
+    annotation (Line(points={{0,8},{0,-0.2}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicTwoPhaseFlowRiser;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo
index 8d942218b2845fa7b63ce3b31a3331861086164a..707b9b4d1b70e6c70e6a0cc77bde0f8d4ebcca51 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo
@@ -1,306 +1,306 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicWaterHeating
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=68.5297)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.003003)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    h0=2750.e3,
-    P0=40e5)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=false, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
-    mode_caract=0,
-    Cvmax=CvmaxWater,
-    Q(fixed=false, start=38.0656),
-    Pm(start=24.771e5),
-    h(start=906345),
-    C1(h_vol_1(start=906345), h(start=906345)),
-    Cv(start=34.26, fixed=false))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(
-    ec=2e-3,
-    Ns=10,
-    Rv=1.2,
-    Lc=2.5,
-    PasL=0.028,
-    PasT=0.024,
-    ntubes3=1500,
-    Dc=0.018,
-    ntubes1=400,
-    ntubes2=400,
-    L1=11,
-    L2=11,
-    L3=22,
-    pipe_1(
-      z2=0.4,
-      Tp(start={500,501,502,503,504,505,506,507,508,510}),
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3}),
-      Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
-            202.4}),
-      P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5,
-            222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5})),
-    pipe_2(
-      z2=0.4,
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3,1080e3}),
-      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
-            1070e3,1080e3}),
-      Q(start={57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,
-            57.57}),
-      P(start={222.600e5,222.590e5,222.580e5,222.570e5,222.560e5,222.550e5,
-            222.540e5,222.530e5,222.520e5,222.51e5,222.50e5,222.48e5})),
-    C2ex(P(start=3900000)),
-    Wall_1(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_2(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
-    Wall_3(
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
-            516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
-            516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1082.65e3), P(start=222.48e5)),
-    volumeD1(h(start=953939), P(start=222.48e5)),
-    volumeD(h(start=812750), P(start=222.72e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      Kvl=1,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      V=70,
-      Mp=50000,
-      zl(fixed=true, start=0.5),
-      P(fixed=true, start=39.5e5),
-      Cv(Q(fixed=false, start=35), P(fixed=false, start=39.5e5)),
-      hv(start=1463490),
-      hl(start=906345),
-      Pfond(start=39.542e5),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
-            516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp(start=509)),
-    pipe_3(
-      z2=1,
-      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
-            516.4,517,517.4,518,518.4,519,519.4}),
-      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3,1080e3}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
-            202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4}),
-      P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5,
-            222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5,
-            222.580e5,222.570e5,222.560e5,222.550e5,222.540e5,222.530e5,
-            222.520e5,222.51e5,222.50e5,222.48e5})),
-    P0c=4000000) annotation (Placement(transformation(extent={{-58,-90},{162,96}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(                           K=35, Q(fixed=false,
-        start=250),
-    Pm(start=227e5))         annotation (Placement(transformation(extent={{-99,
-            -48},{-79,-28}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(                           K=30, Q(fixed=false,
-        start=250),
-    Pm(start=222.48e5),
-    C2(h_vol_1(start=1082650), h(start=1082650)))
-                               annotation (Placement(transformation(extent={{
-            -80,34},{-100,54}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    option_temperature=true,
-    P0=220e5,
-    h0=900e3,
-    T0=482.87)
-    annotation (Placement(transformation(extent={{-192,-60},{-150,-16}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53, C1(h_vol_1(start=
-            1082.65e3), h(start=1082.65e3)))
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
-      Table=[0,260; 378,260; 390,238; 438,275; 507,135; 936,65; 1404,50; 1872,
-        50])       annotation (Placement(transformation(extent={{-195,78},{-175,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.50)
-                          annotation (Placement(transformation(extent={{135,
-            -152},{113,-130}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(Qmin=0.5, C2(h_vol_1(
-          start=2750.e3), h(start=2750.e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(                          K=1e-3,
-    T(fixed=false, start=461.56),
-    Q(fixed=false, start=35),
-    Pm(start=3900000),
-    C2(h_vol_1(start=906340), h(start=906340)))
-                         annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,3.9e5; 2000,3.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=35),
-    L=10,
-    D=0.1,
-    lambda=LambdaPipe,
-    Pm(start=40.34e5),
-    C1(h_vol_1(start=2750e3), h(start=2750e3)))
-                         annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table=
-        [0,41.19e5; 378,41.19e5; 418,21.e5; 1145,5.e5; 2000,5.e5])
-                   annotation (Placement(transformation(extent={{-195,160},{
-            -175,180}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2(
-                  Table=[0,222.72e5; 378,222.72e5; 438,230e5; 597,217e5; 1000,
-        216e5; 1533,214e5; 1863,213.5e5; 2340,213e5; 2500,213e5])
-                   annotation (Placement(transformation(extent={{-195,-8},{-175,
-            12}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table=
-        [0,462; 448,462; 1155,420.0; 2000,420.0])
-                   annotation (Placement(transformation(extent={{-196,-84},{
-            -176,-64}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  connect(Pression_Turbine1.y, sourceP.IPressure) annotation (Line(points={{
-          -174,170},{-174,152},{-190,152},{-190,130},{-181.5,130}}));
-  connect(Pression_eauA2.y, sourceP1.IPressure) annotation (Line(points={{-174,
-          2},{-174,-10},{-194,-10},{-194,-38},{-181.5,-38}}));
-  connect(Debit_eauA.y, refQ.IMassFlow)
-    annotation (Line(points={{-174,88},{-125,88},{-125,55}}));
-  connect(Level.y, ControlValve_eau.Ouv)
-    annotation (Line(points={{111.9,-141},{98,-141},{98,-165}}));
-  connect(Temperature_eauA1.y, sourceP1.ISpecificEnthalpyOrTemperature)
-    annotation (Line(points={{-175,-74},{-171,-74},{-171,-49}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(extent={{-200,-200},{200,200}}),
-                               graphics={
-        Text(
-          extent={{-124,206},{130,146}},
-          lineColor={0,0,255},
-          textString=
-              "1 Ouv et 1 Cvmax = false, Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-74,-190},{118,-222}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-186,-198},{-84,-212}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{16,170},{130,156}},
-          lineColor={0,0,255},
-          textString=
-               "checkValve  Qmin =0.5"),
-        Text(
-          extent={{-136,168},{-18,154}},
-          lineColor={0,0,255},
-          textString="With guess values")}),
-    experiment(StopTime=1000, Tolerance=1e-004),
-    experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-220,-240},{220,240}},
-          radius=25.0),
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicWaterHeating;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicWaterHeating
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=68.5297)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.003003)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    h0=2750.e3,
+    P0=40e5)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=false, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
+    mode_caract=0,
+    Cvmax=CvmaxWater,
+    Q(fixed=false, start=38.0656),
+    Pm(start=24.771e5),
+    h(start=906345),
+    C1(h_vol_1(start=906345), h(start=906345)),
+    Cv(start=34.26, fixed=false))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(
+    ec=2e-3,
+    Ns=10,
+    Rv=1.2,
+    Lc=2.5,
+    PasL=0.028,
+    PasT=0.024,
+    ntubes3=1500,
+    Dc=0.018,
+    ntubes1=400,
+    ntubes2=400,
+    L1=11,
+    L2=11,
+    L3=22,
+    pipe_1(
+      z2=0.4,
+      Tp(start={500,501,502,503,504,505,506,507,508,510}),
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3}),
+      Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
+            202.4}),
+      P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5,
+            222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5})),
+    pipe_2(
+      z2=0.4,
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3,1080e3}),
+      hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,
+            1070e3,1080e3}),
+      Q(start={57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,
+            57.57}),
+      P(start={222.600e5,222.590e5,222.580e5,222.570e5,222.560e5,222.550e5,
+            222.540e5,222.530e5,222.520e5,222.51e5,222.50e5,222.48e5})),
+    C2ex(P(start=3900000)),
+    Wall_1(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_2(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})),
+    Wall_3(
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
+            516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
+            516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1082.65e3), P(start=222.48e5)),
+    volumeD1(h(start=953939), P(start=222.48e5)),
+    volumeD(h(start=812750), P(start=222.72e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      Kvl=1,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      V=70,
+      Mp=50000,
+      zl(fixed=true, start=0.5),
+      P(fixed=true, start=39.5e5),
+      Cv(Q(fixed=false, start=35), P(fixed=false, start=39.5e5)),
+      hv(start=1463490),
+      hl(start=906345),
+      Pfond(start=39.542e5),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
+            516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp(start=509)),
+    pipe_3(
+      z2=1,
+      Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,
+            516.4,517,517.4,518,518.4,519,519.4}),
+      h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3,1080e3}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
+            202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4}),
+      P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5,
+            222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5,
+            222.580e5,222.570e5,222.560e5,222.550e5,222.540e5,222.530e5,
+            222.520e5,222.51e5,222.50e5,222.48e5})),
+    P0c=4000000) annotation (Placement(transformation(extent={{-58,-90},{162,96}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(                           K=35, Q(fixed=false,
+        start=250),
+    Pm(start=227e5))         annotation (Placement(transformation(extent={{-99,
+            -48},{-79,-28}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(                           K=30, Q(fixed=false,
+        start=250),
+    Pm(start=222.48e5),
+    C2(h_vol_1(start=1082650), h(start=1082650)))
+                               annotation (Placement(transformation(extent={{
+            -80,34},{-100,54}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    option_temperature=true,
+    P0=220e5,
+    h0=900e3,
+    T0=482.87)
+    annotation (Placement(transformation(extent={{-192,-60},{-150,-16}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53, C1(h_vol_1(start=
+            1082.65e3), h(start=1082.65e3)))
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
+      Table=[0,260; 378,260; 390,238; 438,275; 507,135; 936,65; 1404,50; 1872,
+        50])       annotation (Placement(transformation(extent={{-195,78},{-175,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.50)
+                          annotation (Placement(transformation(extent={{135,
+            -152},{113,-130}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(Qmin=0.5, C2(h_vol_1(
+          start=2750.e3), h(start=2750.e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(                          K=1e-3,
+    T(fixed=false, start=461.56),
+    Q(fixed=false, start=35),
+    Pm(start=3900000),
+    C2(h_vol_1(start=906340), h(start=906340)))
+                         annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,3.9e5; 2000,3.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=35),
+    L=10,
+    D=0.1,
+    lambda=LambdaPipe,
+    Pm(start=40.34e5),
+    C1(h_vol_1(start=2750e3), h(start=2750e3)))
+                         annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table=
+        [0,41.19e5; 378,41.19e5; 418,21.e5; 1145,5.e5; 2000,5.e5])
+                   annotation (Placement(transformation(extent={{-195,160},{
+            -175,180}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2(
+                  Table=[0,222.72e5; 378,222.72e5; 438,230e5; 597,217e5; 1000,
+        216e5; 1533,214e5; 1863,213.5e5; 2340,213e5; 2500,213e5])
+                   annotation (Placement(transformation(extent={{-195,-8},{-175,
+            12}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table=
+        [0,462; 448,462; 1155,420.0; 2000,420.0])
+                   annotation (Placement(transformation(extent={{-196,-84},{
+            -176,-64}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  connect(Pression_Turbine1.y, sourceP.IPressure) annotation (Line(points={{
+          -174,170},{-174,152},{-190,152},{-190,130},{-181.5,130}}));
+  connect(Pression_eauA2.y, sourceP1.IPressure) annotation (Line(points={{-174,
+          2},{-174,-10},{-194,-10},{-194,-38},{-181.5,-38}}));
+  connect(Debit_eauA.y, refQ.IMassFlow)
+    annotation (Line(points={{-174,88},{-125,88},{-125,55}}));
+  connect(Level.y, ControlValve_eau.Ouv)
+    annotation (Line(points={{111.9,-141},{98,-141},{98,-165}}));
+  connect(Temperature_eauA1.y, sourceP1.ISpecificEnthalpyOrTemperature)
+    annotation (Line(points={{-175,-74},{-171,-74},{-171,-49}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(extent={{-200,-200},{200,200}}),
+                               graphics={
+        Text(
+          extent={{-124,206},{130,146}},
+          lineColor={0,0,255},
+          textString=
+              "1 Ouv et 1 Cvmax = false, Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-74,-190},{118,-222}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-186,-198},{-84,-212}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{16,170},{130,156}},
+          lineColor={0,0,255},
+          textString=
+               "checkValve  Qmin =0.5"),
+        Text(
+          extent={{-136,168},{-18,154}},
+          lineColor={0,0,255},
+          textString="With guess values")}),
+    experiment(StopTime=1000, Tolerance=1e-004),
+    experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-220,-240},{220,240}},
+          radius=25.0),
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicWaterHeating;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo
index 18f06744bb7bc2873176702c637b5f979daecfd2..ec5cb1d7ef25c878c2f7fc66977e16885c667940 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo
@@ -1,298 +1,298 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicWaterHeatingOnePipe
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=68.5297)
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real LambdaPipe(fixed=false,start=0.003003)
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    h0=2750.e3,
-    P0=40e5)
-            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
-      option_temperature=false, P0(fixed=true) = 10e5)
-             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
-    mode_caract=0,
-    Cvmax=CvmaxWater,
-    Q(fixed=false, start=38.0656),
-    Pm(start=24.771e5),
-    h(start=906345),
-    C1(h_vol_1(start=906345), h(start=906345)),
-    Cv(start=34.26, fixed=false))
-                          annotation (Placement(transformation(extent={{88,-186},
-            {108,-166}}, rotation=0)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeaterOnePipe WaterHeating(
-    ec=2e-3,
-    Ns=10,
-    Rv=1.2,
-    Lc=2.5,
-    PasL=0.028,
-    PasT=0.024,
-    ntubes3=1500,
-    Dc=0.018,
-    ntubes1=400,
-    ntubes2=400,
-    L1=11,
-    L2=11,
-    L3=22,
-    C2ex(P(start=3953920.2674434385)),
-    Wall_3(
-      Tp(start={497.4216192636609,502.69423468274414,506.9759296757205,
-            510.4223715331536,513.1750788320363,515.3580718035844,
-            517.0775540203194,518.4230303861297,519.4690257033071,
-            520.2769753151857,520.8970764101637,521.3700027404278,
-            521.7284442755915,521.9984626845046,522.2006676867453,
-            522.3512258466948,522.4627164232634,522.5440949624972,
-            522.5983494885799,522.6391412946117}),
-      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
-            516,516.4,517,517.4,518,518.4,519,519.4}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
-            516,516.4,517,517.4,518,518.4,519,519.4})),
-    volumeC(h(start=1083284.4675828198), P(start=22239324.06759518)),
-    volumeD(h(start=812750.3853612987), P(start=222.72e5)),
-    WaterHeating(
-      steady_state=true,
-      Vertical=false,
-      step_square=true,
-      Kvl=1,
-      Klp=1500,
-      Kvp=1200,
-      Kpa=0.2,
-      V=70,
-      Mp=50000,
-      zl(fixed=true, start=0.5),
-      P(fixed=true, start=39.5e5),
-      Cv(Q(fixed=false, start=35), P(fixed=false, start=39.5e5)),
-      hv(start=1431115.3931413875),
-      hl(start=1083784.8007690564),
-      Pfond(start=39.542e5),
-      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
-      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
-      Tp3(start={502.0668232342926,506.5603551100769,510.17517354535573,
-            513.0552006761686,515.3300849797615,517.1125155075463,
-            518.4982207642074,519.5672140241339,520.3855368446975,
-            521.0071208743625,521.475583235511,521.8258726586643,
-            522.0857355520467,522.276996946816,522.4166635499804,
-            522.5178617542946,522.5906259809204,522.6416937796047,
-            522.6717272169116,522.6943081560064}),
-      Tp(start=522.7203786935834)),
-    pipe_3(
-      z2=1,
-      Tp(start={492.2865845099074,498.42043682971996,503.43932965553495,
-            507.5119139438755,510.7928300582301,513.4186242679523,
-            515.5070797958261,517.1581940553467,518.4558696409629,
-            519.4698368458761,520.2575667844292,520.866061927203,
-            521.3334770960658,521.6905573412918,521.9618953291181,
-            522.1670184035046,522.3213189657012,522.4362044759667,
-            522.5172341741693,522.5781571584042}),
-      h(start={812750.375,863278.0600600096,905331.3426571415,940130.751800155,
-            968769.0495620216,992209.8823638612,1011293.6430149649,
-            1026746.7829727756,1039192.5095809929,1049161.7546575891,
-            1057103.8294379094,1063396.4712379558,1068355.1441001317,
-            1072241.5390561111,1075271.2636377309,1077620.734010462,
-            1079433.2969658624,1080824.6185597836,1081886.238523024,
-            1082684.3963576336,1083284.4675828198,1083284.5}),
-      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
-            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
-            1080e3}),
-      Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
-            202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4}),
-      P(start={22269346.0,22267948.39153832,22266544.294239394,
-            22265134.171108145,22263718.740660597,22262298.715698708,
-            22260874.773397826,22259447.536273584,22258017.56171816,
-            22256585.338030815,22255151.28511641,22253715.75831186,
-            22252279.054104224,22250841.416797128,22249403.045444023,
-            22247964.100585815,22246524.71050402,22245084.976831134,
-            22243644.979685582,22242204.783200525,22240764.436308913,22239324.0})),
-    P0c=4000000) annotation (Placement(transformation(extent={{-58,-90},{162,96}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2
-             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterIn(                           K=35, Q(fixed=false,
-        start=250),
-    Pm(start=22270672.891128033))
-                             annotation (Placement(transformation(extent={{-99,
-            -48},{-79,-28}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossWaterOut(                           K=30, Q(fixed=false,
-        start=250),
-    Pm(start=22238086.493105933),
-    C2(h_vol_1(start=1082650), h(start=1082650)))
-                               annotation (Placement(transformation(extent={{
-            -80,34},{-100,54}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    option_temperature=true,
-    P0=220e5,
-    h0=900e3,
-    T0=482.87)
-    annotation (Placement(transformation(extent={{-192,-60},{-150,-16}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53, C1(h_vol_1(start=
-            1082.65e3), h(start=1082.65e3)))
-    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
-      Table=[0,260; 378,260; 390,238; 438,275; 507,135; 936,65; 1404,50; 1872,
-        50])       annotation (Placement(transformation(extent={{-195,78},{-175,
-            98}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.50)
-                          annotation (Placement(transformation(extent={{135,
-            -152},{113,-130}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(Qmin=0.5, C2(h_vol_1(
-          start=2750.e3), h(start=2750.e3)))
-    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossPurge(                          K=1e-3,
-    T(fixed=false, start=461.56),
-    Q(fixed=false, start=35),
-    Pm(start=3953920.266328794),
-    C2(h_vol_1(start=906340), h(start=906340)))
-                         annotation (Placement(transformation(
-        origin={54,-138},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
-    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,3.9e5; 2000,3.9e5])
-                   annotation (Placement(transformation(extent={{162,-178},{182,
-            -158}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
-    Q(fixed=false, start=35),
-    L=10,
-    D=0.1,
-    lambda=LambdaPipe,
-    Pm(start=40.34e5),
-    C1(h_vol_1(start=2750e3), h(start=2750e3)))
-                         annotation (Placement(transformation(extent={{-48,162},
-            {30,98}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table=
-        [0,41.19e5; 378,41.19e5; 418,21.e5; 1145,5.e5; 2000,5.e5])
-                   annotation (Placement(transformation(extent={{-195,160},{
-            -175,180}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2(
-                  Table=[0,222.72e5; 378,222.72e5; 438,230e5; 597,217e5; 1000,
-        216e5; 1533,214e5; 1863,213.5e5; 2340,213e5; 2500,213e5])
-                   annotation (Placement(transformation(extent={{-195,-8},{-175,
-            12}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table=
-        [0,462; 448,462; 1155,420.0; 2000,420.0])
-                   annotation (Placement(transformation(extent={{-196,-84},{
-            -176,-64}}, rotation=0)));
-equation
-  connect(ControlValve_eau.C2, Puit_condenseur1.C)
-    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
-  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
-      points={{-150,44},{-135,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(refQ.C1, singularPressureLossWaterOut.C2)
-    annotation (Line(
-      points={{-115,44},{-100,44}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(sourceP1.C, singularPressureLossWaterIn.C1)
-                                                annotation (Line(
-      points={{-150,-38},{-99,-38}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
-    annotation (Line(
-      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
-                                                      annotation (Line(
-      points={{-79,-38},{-58,-38},{-58,-38.85}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(sourceP.C, checkValve.C1) annotation (Line(
-      points={{-150,130},{-100,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
-    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
-  connect(Pression_purge.y, Puit_condenseur1.IPressure)
-    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
-  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
-      points={{-84,130},{-48,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
-      points={{52,96},{52,130},{30,130}},
-      color={127,0,0},
-      thickness=1));
-  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
-        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
-  connect(Pression_Turbine1.y, sourceP.IPressure) annotation (Line(points={{
-          -174,170},{-174,152},{-190,152},{-190,130},{-181.5,130}}));
-  connect(Pression_eauA2.y, sourceP1.IPressure) annotation (Line(points={{-174,
-          2},{-174,-10},{-194,-10},{-194,-38},{-181.5,-38}}));
-  connect(Debit_eauA.y, refQ.IMassFlow)
-    annotation (Line(points={{-174,88},{-125,88},{-125,55}}));
-  connect(Level.y, ControlValve_eau.Ouv)
-    annotation (Line(points={{111.9,-141},{98,-141},{98,-165}}));
-  connect(Temperature_eauA1.y, sourceP1.ISpecificEnthalpyOrTemperature)
-    annotation (Line(points={{-175,-74},{-171,-74},{-171,-49}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(extent={{-200,-200},{200,200}}),
-                               graphics={
-        Text(
-          extent={{-124,206},{130,146}},
-          lineColor={0,0,255},
-          textString=
-              "1 Ouv et 1 Cvmax = false, Qvap et niveau=true ou P cavite"),
-        Text(
-          extent={{-74,-190},{118,-222}},
-          lineColor={0,0,255},
-          textString=
-               "COP0l_coef_h =false  , T_Dp_purge=true"),
-        Text(
-          extent={{-186,-198},{-84,-212}},
-          lineColor={0,0,255},
-          textString=
-               "Qvap=true  ==> Erreur"),
-        Text(
-          extent={{16,170},{130,156}},
-          lineColor={0,0,255},
-          textString=
-               "checkValve  Qmin =0.5"),
-        Text(
-          extent={{-136,168},{-18,154}},
-          lineColor={0,0,255},
-          textString="With guess values")}),
-    experiment(StopTime=1000, Tolerance=1e-004),
-    experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-220,-240},{220,240}},
-          radius=25.0),
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicWaterHeatingOnePipe;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicWaterHeatingOnePipe
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=68.5297)
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real LambdaPipe(fixed=false,start=0.003003)
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    h0=2750.e3,
+    P0=40e5)
+            annotation (Placement(transformation(extent={{-192,110},{-150,150}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(
+      option_temperature=false, P0(fixed=true) = 10e5)
+             annotation (Placement(transformation(extent={{124,-202},{160,-162}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(
+    mode_caract=0,
+    Cvmax=CvmaxWater,
+    Q(fixed=false, start=38.0656),
+    Pm(start=24.771e5),
+    h(start=906345),
+    C1(h_vol_1(start=906345), h(start=906345)),
+    Cv(start=34.26, fixed=false))
+                          annotation (Placement(transformation(extent={{88,-186},
+            {108,-166}}, rotation=0)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeaterOnePipe WaterHeating(
+    ec=2e-3,
+    Ns=10,
+    Rv=1.2,
+    Lc=2.5,
+    PasL=0.028,
+    PasT=0.024,
+    ntubes3=1500,
+    Dc=0.018,
+    ntubes1=400,
+    ntubes2=400,
+    L1=11,
+    L2=11,
+    L3=22,
+    C2ex(P(start=3953920.2674434385)),
+    Wall_3(
+      Tp(start={497.4216192636609,502.69423468274414,506.9759296757205,
+            510.4223715331536,513.1750788320363,515.3580718035844,
+            517.0775540203194,518.4230303861297,519.4690257033071,
+            520.2769753151857,520.8970764101637,521.3700027404278,
+            521.7284442755915,521.9984626845046,522.2006676867453,
+            522.3512258466948,522.4627164232634,522.5440949624972,
+            522.5983494885799,522.6391412946117}),
+      Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
+            516,516.4,517,517.4,518,518.4,519,519.4}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,
+            516,516.4,517,517.4,518,518.4,519,519.4})),
+    volumeC(h(start=1083284.4675828198), P(start=22239324.06759518)),
+    volumeD(h(start=812750.3853612987), P(start=222.72e5)),
+    WaterHeating(
+      steady_state=true,
+      Vertical=false,
+      step_square=true,
+      Kvl=1,
+      Klp=1500,
+      Kvp=1200,
+      Kpa=0.2,
+      V=70,
+      Mp=50000,
+      zl(fixed=true, start=0.5),
+      P(fixed=true, start=39.5e5),
+      Cv(Q(fixed=false, start=35), P(fixed=false, start=39.5e5)),
+      hv(start=1431115.3931413875),
+      hl(start=1083784.8007690564),
+      Pfond(start=39.542e5),
+      Tp1(start={500,501,502,503,504,505,506,507,508,510}),
+      Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}),
+      Tp3(start={502.0668232342926,506.5603551100769,510.17517354535573,
+            513.0552006761686,515.3300849797615,517.1125155075463,
+            518.4982207642074,519.5672140241339,520.3855368446975,
+            521.0071208743625,521.475583235511,521.8258726586643,
+            522.0857355520467,522.276996946816,522.4166635499804,
+            522.5178617542946,522.5906259809204,522.6416937796047,
+            522.6717272169116,522.6943081560064}),
+      Tp(start=522.7203786935834)),
+    pipe_3(
+      z2=1,
+      Tp(start={492.2865845099074,498.42043682971996,503.43932965553495,
+            507.5119139438755,510.7928300582301,513.4186242679523,
+            515.5070797958261,517.1581940553467,518.4558696409629,
+            519.4698368458761,520.2575667844292,520.866061927203,
+            521.3334770960658,521.6905573412918,521.9618953291181,
+            522.1670184035046,522.3213189657012,522.4362044759667,
+            522.5172341741693,522.5781571584042}),
+      h(start={812750.375,863278.0600600096,905331.3426571415,940130.751800155,
+            968769.0495620216,992209.8823638612,1011293.6430149649,
+            1026746.7829727756,1039192.5095809929,1049161.7546575891,
+            1057103.8294379094,1063396.4712379558,1068355.1441001317,
+            1072241.5390561111,1075271.2636377309,1077620.734010462,
+            1079433.2969658624,1080824.6185597836,1081886.238523024,
+            1082684.3963576336,1083284.4675828198,1083284.5}),
+      hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3,
+            965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3,
+            1080e3}),
+      Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,
+            202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4}),
+      P(start={22269346.0,22267948.39153832,22266544.294239394,
+            22265134.171108145,22263718.740660597,22262298.715698708,
+            22260874.773397826,22259447.536273584,22258017.56171816,
+            22256585.338030815,22255151.28511641,22253715.75831186,
+            22252279.054104224,22250841.416797128,22249403.045444023,
+            22247964.100585815,22246524.71050402,22245084.976831134,
+            22243644.979685582,22242204.783200525,22240764.436308913,22239324.0})),
+    P0c=4000000) annotation (Placement(transformation(extent={{-58,-90},{162,96}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2
+             annotation (Placement(transformation(extent={{-150,22},{-192,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterIn(                           K=35, Q(fixed=false,
+        start=250),
+    Pm(start=22270672.891128033))
+                             annotation (Placement(transformation(extent={{-99,
+            -48},{-79,-28}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossWaterOut(                           K=30, Q(fixed=false,
+        start=250),
+    Pm(start=22238086.493105933),
+    C2(h_vol_1(start=1082650), h(start=1082650)))
+                               annotation (Placement(transformation(extent={{
+            -80,34},{-100,54}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    option_temperature=true,
+    P0=220e5,
+    h0=900e3,
+    T0=482.87)
+    annotation (Placement(transformation(extent={{-192,-60},{-150,-16}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53, C1(h_vol_1(start=
+            1082.65e3), h(start=1082.65e3)))
+    annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(
+      Table=[0,260; 378,260; 390,238; 438,275; 507,135; 936,65; 1404,50; 1872,
+        50])       annotation (Placement(transformation(extent={{-195,78},{-175,
+            98}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.50)
+                          annotation (Placement(transformation(extent={{135,
+            -152},{113,-130}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(Qmin=0.5, C2(h_vol_1(
+          start=2750.e3), h(start=2750.e3)))
+    annotation (Placement(transformation(extent={{-100,122},{-84,138}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossPurge(                          K=1e-3,
+    T(fixed=false, start=461.56),
+    Q(fixed=false, start=35),
+    Pm(start=3953920.266328794),
+    C2(h_vol_1(start=906340), h(start=906340)))
+                         annotation (Placement(transformation(
+        origin={54,-138},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps
+    Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,3.9e5; 2000,3.9e5])
+                   annotation (Placement(transformation(extent={{162,-178},{182,
+            -158}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(
+    Q(fixed=false, start=35),
+    L=10,
+    D=0.1,
+    lambda=LambdaPipe,
+    Pm(start=40.34e5),
+    C1(h_vol_1(start=2750e3), h(start=2750e3)))
+                         annotation (Placement(transformation(extent={{-48,162},
+            {30,98}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table=
+        [0,41.19e5; 378,41.19e5; 418,21.e5; 1145,5.e5; 2000,5.e5])
+                   annotation (Placement(transformation(extent={{-195,160},{
+            -175,180}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2(
+                  Table=[0,222.72e5; 378,222.72e5; 438,230e5; 597,217e5; 1000,
+        216e5; 1533,214e5; 1863,213.5e5; 2340,213e5; 2500,213e5])
+                   annotation (Placement(transformation(extent={{-195,-8},{-175,
+            12}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table=
+        [0,462; 448,462; 1155,420.0; 2000,420.0])
+                   annotation (Placement(transformation(extent={{-196,-84},{
+            -176,-64}}, rotation=0)));
+equation
+  connect(ControlValve_eau.C2, Puit_condenseur1.C)
+    annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255}));
+  connect(Puit_condenseur2.C,refQ. C2) annotation (Line(
+      points={{-150,44},{-135,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(refQ.C1, singularPressureLossWaterOut.C2)
+    annotation (Line(
+      points={{-115,44},{-100,44}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(sourceP1.C, singularPressureLossWaterIn.C1)
+                                                annotation (Line(
+      points={{-150,-38},{-99,-38}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2)
+    annotation (Line(
+      points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1)
+                                                      annotation (Line(
+      points={{-79,-38},{-58,-38},{-58,-38.85}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(sourceP.C, checkValve.C1) annotation (Line(
+      points={{-150,130},{-100,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C1, WaterHeating.C2ex)
+    annotation (Line(points={{54,-128},{54,-90},{52,-90}}));
+  connect(Pression_purge.y, Puit_condenseur1.IPressure)
+    annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}}));
+  connect(checkValve.C2, PressureLoss_Steam.C1)         annotation (Line(
+      points={{-84,130},{-48,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line(
+      points={{52,96},{52,130},{30,130}},
+      color={127,0,0},
+      thickness=1));
+  connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line(
+        points={{54,-148},{54,-182},{88,-182}}, color={0,0,255}));
+  connect(Pression_Turbine1.y, sourceP.IPressure) annotation (Line(points={{
+          -174,170},{-174,152},{-190,152},{-190,130},{-181.5,130}}));
+  connect(Pression_eauA2.y, sourceP1.IPressure) annotation (Line(points={{-174,
+          2},{-174,-10},{-194,-10},{-194,-38},{-181.5,-38}}));
+  connect(Debit_eauA.y, refQ.IMassFlow)
+    annotation (Line(points={{-174,88},{-125,88},{-125,55}}));
+  connect(Level.y, ControlValve_eau.Ouv)
+    annotation (Line(points={{111.9,-141},{98,-141},{98,-165}}));
+  connect(Temperature_eauA1.y, sourceP1.ISpecificEnthalpyOrTemperature)
+    annotation (Line(points={{-175,-74},{-171,-74},{-171,-49}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(extent={{-200,-200},{200,200}}),
+                               graphics={
+        Text(
+          extent={{-124,206},{130,146}},
+          lineColor={0,0,255},
+          textString=
+              "1 Ouv et 1 Cvmax = false, Qvap et niveau=true ou P cavite"),
+        Text(
+          extent={{-74,-190},{118,-222}},
+          lineColor={0,0,255},
+          textString=
+               "COP0l_coef_h =false  , T_Dp_purge=true"),
+        Text(
+          extent={{-186,-198},{-84,-212}},
+          lineColor={0,0,255},
+          textString=
+               "Qvap=true  ==> Erreur"),
+        Text(
+          extent={{16,170},{130,156}},
+          lineColor={0,0,255},
+          textString=
+               "checkValve  Qmin =0.5"),
+        Text(
+          extent={{-136,168},{-18,154}},
+          lineColor={0,0,255},
+          textString="With guess values")}),
+    experiment(StopTime=1000, Tolerance=1e-004),
+    experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-220,-240},{220,240}},
+          radius=25.0),
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicWaterHeatingOnePipe;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo
index f20a4bb0b264f405bcdefc407e9793ea8e095c26..e9f5fed951f9ebf2fce5901352844fc18e633bb9 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo
@@ -1,84 +1,84 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestDynamicWaterSteamMultiFluidHeatExchanger
-
-  BoundaryConditions.SourceQ                    sourceP(C(h_vol_2(start=
-            71016.12237181065)),
-    Q0=10,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start=
-            71016.1223718086)))
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  HeatExchangers.DynamicWaterSteamMultiFluidsHeatExchanger dynamicMultiFluidHeatExchanger(
-    steady_state=true,
-    Cfg1(h_vol_2(start=71016.12237181155)),
-    Cfg2(h_vol_1(start=71016.12237181314)),
-    ExchangerMultiFluids(
-      P(start={300000.0,260001.59713260198,220002.3957916478,180002.39588440701,
-            140001.5973181204,100000.0}),
-      Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343,
-            2702.7912398488343,2702.7912398488343}),
-      h(start={71016.125,71016.125,71016.12237180988,71016.1223718091,71016.125,
-            70825.8984375})),
-    TwoPhaseFlowPipe(
-      P(start={300000.0,260001.59801114563,220002.39710936273,180002.3972020214,
-            140001.59819646296,100000.0}),
-      Q(start={3482.228448926616,3482.228448926616,3482.228448926616,
-            3482.228448926616,3482.228448926616}),
-      h(start={71016.125,71016.125,71016.12237181216,71016.12237181274,
-            71016.125,70825.8984375})),
-    ExchangerWall(Tp(start={290.03103270324897,290.0401814264445,
-            290.0493302229999,290.05847909289605}), Tp1(start={
-            290.03103270331616,290.04018142654525,290.0493302231005,
-            290.0584790929629})),
-    Ntubes=10,
-    Ns=4,
-    diffusion=true,
-    dynamic_mass_balance=true,
-    dynamic_energy_balance=false,
-    inertia=false)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}})));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=5000000,
-    T0=1273.15)
-    annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90,
-        origin={-10,70})));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{10,-10},{-10,10}},
-                                                                   rotation=90,
-        origin={-10,-10})));
-equation
-  connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1)
-    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0}));
-  connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C)
-    annotation (Line(points={{0,30},{20,30}}, color={0,0,0}));
-  connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1)
-    annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0}));
-  connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C)
-    annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestDynamicWaterSteamMultiFluidHeatExchanger;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestDynamicWaterSteamMultiFluidHeatExchanger
+
+  BoundaryConditions.SourceQ                    sourceP(C(h_vol_2(start=
+            71016.12237181065)),
+    Q0=10,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start=
+            71016.1223718086)))
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  HeatExchangers.DynamicWaterSteamMultiFluidsHeatExchanger dynamicMultiFluidHeatExchanger(
+    steady_state=true,
+    Cfg1(h_vol_2(start=71016.12237181155)),
+    Cfg2(h_vol_1(start=71016.12237181314)),
+    ExchangerMultiFluids(
+      P(start={300000.0,260001.59713260198,220002.3957916478,180002.39588440701,
+            140001.5973181204,100000.0}),
+      Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343,
+            2702.7912398488343,2702.7912398488343}),
+      h(start={71016.125,71016.125,71016.12237180988,71016.1223718091,71016.125,
+            70825.8984375})),
+    TwoPhaseFlowPipe(
+      P(start={300000.0,260001.59801114563,220002.39710936273,180002.3972020214,
+            140001.59819646296,100000.0}),
+      Q(start={3482.228448926616,3482.228448926616,3482.228448926616,
+            3482.228448926616,3482.228448926616}),
+      h(start={71016.125,71016.125,71016.12237181216,71016.12237181274,
+            71016.125,70825.8984375})),
+    ExchangerWall(Tp(start={290.03103270324897,290.0401814264445,
+            290.0493302229999,290.05847909289605}), Tp1(start={
+            290.03103270331616,290.04018142654525,290.0493302231005,
+            290.0584790929629})),
+    Ntubes=10,
+    Ns=4,
+    diffusion=true,
+    dynamic_mass_balance=true,
+    dynamic_energy_balance=false,
+    inertia=false)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}})));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=5000000,
+    T0=1273.15)
+    annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90,
+        origin={-10,70})));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{10,-10},{-10,10}},
+                                                                   rotation=90,
+        origin={-10,-10})));
+equation
+  connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1)
+    annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0}));
+  connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C)
+    annotation (Line(points={{0,30},{20,30}}, color={0,0,0}));
+  connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1)
+    annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0}));
+  connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C)
+    annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestDynamicWaterSteamMultiFluidHeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo
index 703f662223c8eefa8f9682e5e147196d893f699a..0d86decf258bed9b41b7169182c142f0f0e39f68 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo
@@ -1,53 +1,53 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestFixedPowerHeatExchanger
-
-  ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger
-    plateHeatExchanger(region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-    DW=1.e6)   annotation (Placement(transformation(extent={{-20,40},{0,60}},
-          rotation=0)));
-  BoundaryConditions.SourcePQ                   sourceP2(T0=340,
-      option_temperature=true)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  BoundaryConditions.SourcePQ                   sourceP3(option_temperature=
-        true)
-    annotation (Placement(transformation(extent={{-60,40},{-40,60}}, rotation=0)));
-  BoundaryConditions.Sink                     puitsP2
-                                          annotation (Placement(transformation(
-          extent={{20,20},{40,40}}, rotation=0)));
-  BoundaryConditions.Sink                     puitsP3
-                                          annotation (Placement(transformation(
-          extent={{20,40},{40,60}}, rotation=0)));
-equation
-  connect(sourceP3.C, plateHeatExchanger.Ef)
-    annotation (Line(points={{-40,50},{-20,50}}, color={0,0,0}));
-  connect(plateHeatExchanger.Sf, puitsP3.C) annotation (Line(points={{-0.2,50.1},
-          {9.9,50.1},{9.9,50},{20,50}}, color={0,0,0}));
-  connect(plateHeatExchanger.Sc, puitsP2.C) annotation (Line(points={{-4.2,44},
-          {-4,44},{-4,30},{20,30}}, color={0,0,0}));
-  connect(plateHeatExchanger.Ec, sourceP2.C) annotation (Line(points={{-15.8,44},
-          {-16,44},{-16,30},{-40,30}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestFixedPowerHeatExchanger;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestFixedPowerHeatExchanger
+
+  ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger
+    plateHeatExchanger(region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+    DW=1.e6)   annotation (Placement(transformation(extent={{-20,40},{0,60}},
+          rotation=0)));
+  BoundaryConditions.SourcePQ                   sourceP2(T0=340,
+      option_temperature=true)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  BoundaryConditions.SourcePQ                   sourceP3(option_temperature=
+        true)
+    annotation (Placement(transformation(extent={{-60,40},{-40,60}}, rotation=0)));
+  BoundaryConditions.Sink                     puitsP2
+                                          annotation (Placement(transformation(
+          extent={{20,20},{40,40}}, rotation=0)));
+  BoundaryConditions.Sink                     puitsP3
+                                          annotation (Placement(transformation(
+          extent={{20,40},{40,60}}, rotation=0)));
+equation
+  connect(sourceP3.C, plateHeatExchanger.Ef)
+    annotation (Line(points={{-40,50},{-20,50}}, color={0,0,0}));
+  connect(plateHeatExchanger.Sf, puitsP3.C) annotation (Line(points={{-0.2,50.1},
+          {9.9,50.1},{9.9,50},{20,50}}, color={0,0,0}));
+  connect(plateHeatExchanger.Sc, puitsP2.C) annotation (Line(points={{-4.2,44},
+          {-4,44},{-4,30},{20,30}}, color={0,0,0}));
+  connect(plateHeatExchanger.Ec, sourceP2.C) annotation (Line(points={{-15.8,44},
+          {-16,44},{-16,30},{-40,30}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestFixedPowerHeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo
index 9dd0862997fb1ff44a91e4d8978908ea8294b94e..a421259eda91ab8434de8323b0fbd46d553e790b 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo
@@ -1,82 +1,82 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestFossilFuelBoiler
-  import ThermoSysPro;
-  ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler(
-    Wloss=0,
-    Ke=1.e6,
-    Tsf=386.16)
-    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    T0=338.16,
-    Cp=1282,
-    Xh=0.24403,
-    Xc=0.75323,
-    Q0=1.45) annotation (Placement(transformation(extent={{-36,-78},{0,-41}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
-    Xco2=0,
-    Xh2o=0.01,
-    Q0=27.,
-    Xo2=0.233,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    T0=298.16,
-    option_temperature=true)
-               annotation (Placement(transformation(extent={{-110,-50},{-71,-13}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
-          extent={{68,-51},{110,-12}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
-    Q0=24.,
-    h0=600e3,
-    P0=14000000)
-    annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{74,13},{110,49}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3)
-    annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3)
-    annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0)));
-equation
-  connect(sourceQ.C, FossilFuelBoiler.Cair)     annotation (Line(
-      points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}},
-      color={0,0,0},
-      thickness=1));
-  connect(FossilFuelBoiler.Cfg, sinkP.C)     annotation (Line(
-      points={{45,-31.62},{62,-31.62},{62,-31.5},{68,-31.5}},
-      color={0,0,0},
-      thickness=1));
-  connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel)     annotation (Line(points={
-          {0,-59.5},{0,-40.8}}, color={0,0,0}));
-  connect(sourcePQ.C, singularPressureLoss.C1)
-    annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation (Line(
-        points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sink.C)
-    annotation (Line(points={{65,31},{74,31}}, color={0,0,255}));
-  connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation (Line(
-        points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255}));
-  annotation (                   Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestFossilFuelBoiler;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestFossilFuelBoiler
+  import ThermoSysPro;
+  ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler(
+    Wloss=0,
+    Ke=1.e6,
+    Tsf=386.16)
+    annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0)));
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    T0=338.16,
+    Cp=1282,
+    Xh=0.24403,
+    Xc=0.75323,
+    Q0=1.45) annotation (Placement(transformation(extent={{-36,-78},{0,-41}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+    Xco2=0,
+    Xh2o=0.01,
+    Q0=27.,
+    Xo2=0.233,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    T0=298.16,
+    option_temperature=true)
+               annotation (Placement(transformation(extent={{-110,-50},{-71,-13}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation (Placement(transformation(
+          extent={{68,-51},{110,-12}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+    Q0=24.,
+    h0=600e3,
+    P0=14000000)
+    annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{74,13},{110,49}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3)
+    annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3)
+    annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0)));
+equation
+  connect(sourceQ.C, FossilFuelBoiler.Cair)     annotation (Line(
+      points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}},
+      color={0,0,0},
+      thickness=1));
+  connect(FossilFuelBoiler.Cfg, sinkP.C)     annotation (Line(
+      points={{45,-31.62},{62,-31.62},{62,-31.5},{68,-31.5}},
+      color={0,0,0},
+      thickness=1));
+  connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel)     annotation (Line(points={
+          {0,-59.5},{0,-40.8}}, color={0,0,0}));
+  connect(sourcePQ.C, singularPressureLoss.C1)
+    annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation (Line(
+        points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sink.C)
+    annotation (Line(points={{65,31},{74,31}}, color={0,0,255}));
+  connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation (Line(
+        points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255}));
+  annotation (                   Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestFossilFuelBoiler;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo
index c7766aada1b1657fa456252f5525d470affd4135..149de78647b149083f670b6ba1ee978ce0a864a7 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo
@@ -1,172 +1,172 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestFresnelField
-  parameter Integer Nt=3 "Number of trains";
-public
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    ntubes=1,
-    steady_state=true,
-    D=0.07,
-    e=0.004,
-    Ns=30,
-    T0=500,
-    lambda=20,
-    cpw=500,
-    rhow=8000,
-    Tp(start={628.0843201819387,627.9310075597404,627.8220175907211,
-          627.7368992018166,627.6679716601412,627.6112649113921,
-          627.5643995456558,627.5258238160011,627.4944728950805,
-          627.4695948757801,627.4506537300122,627.4372716636091,
-          627.4291939746797,627.426267226699,627.428426585461,627.4356896138493,
-          627.4481553612113,627.4660085346942,627.4895290639054,
-          627.5191082002851,627.5552734790091,627.5987264837852,
-          627.6504001032708,627.7115474128314,627.7838847016081,
-          627.8698331666657,627.9729350144038,629.4253815385038,
-          633.135688507217,636.2622387488283}),
-    Tp1(start={610.2709965207655,610.0984334604643,609.9757644369477,
-          609.8799665740102,609.8023932206363,609.7385750723525,
-          609.6858335131916,609.6424216866362,609.6071408778737,
-          609.5791446660139,609.5578296140685,609.5427704711935,
-          609.533680491646,609.5303869740989,609.5328169418054,609.540990157294,
-          609.5550181389947,609.5751088339957,609.6015773714007,
-          609.6348642175905,609.6755632868924,609.7244644309128,
-          609.7826179283193,609.8514345863706,609.9328467812495,
-          610.0295806069864,610.1456244663702,611.7808730290952,
-          615.9622431406954,619.4903247027197}),
-    Tp2(start={644.9596553467713,644.824579502235,644.7285482944553,
-          644.6535470354397,644.592810046145,644.5428402353538,
-          644.5015416419557,644.4675473586904,644.4399193877858,
-          644.4179953736024,644.4013031238645,644.3895098327511,
-          644.3823911261306,644.3798118348441,644.3817148399042,644.38811560583,
-          644.3991013774125,644.4148348525065,644.4355626048274,
-          644.4616292617266,644.4934994867675,644.531791236838,
-          644.5773261834961,644.6312079828199,644.6949482231629,
-          644.7706792525222,644.8615205623447,646.1407907783827,
-          649.404839172216,652.1510013554424}),
-    L=1e4/11.46)
-    annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3)
-               annotation (Placement(transformation(extent={{-101,-55},{-81,-35}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
-    dynamicTwoPhaseFlowPipe(
-    ntubes=1,
-    steady_state=true,
-    rugosrel=0.00005,
-    dpfCorr=1,
-    Ns=30,
-    P(start={12512365.778485337,12512269.4730028,12512159.010926897,
-          12512028.619141866,12511878.28140543,12511707.984695798,
-          12511517.718132183,12511307.472416837,12511077.239500606,
-          12510827.012364838,12510556.784871727,12510266.551658653,
-          12509956.30806284,12509626.050068311,12509275.774270097,
-          12508905.477852736,12508515.15858121,12508104.814803492,
-          12507674.445464557,12507224.050132478,12506753.629037917,
-          12506263.183129327,12505752.714147368,12505222.224723859,
-          12504671.718513375,12504101.200370008,12503510.676589508,
-          12502896.415784404,12502231.48634808,12501522.52554151,
-          12500776.553197166,12500000.0}),
-    h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266,
-          1645211.676359884,1681572.2077847784,1717947.2125321354,
-          1754334.1766730088,1790730.9833788855,1827135.788296852,
-          1863546.9394607474,1899962.9220483964,1936382.3178860326,
-          1972803.7739566958,2009225.9764870608,2045647.6282789519,
-          2082067.4276265746,2118484.0474634594,2154896.1134394333,
-          2191302.179544121,2227700.6996020116,2264089.9923674623,
-          2300468.196934767,2336833.213464297,2373182.6211112435,
-          2409513.559261445,2445822.5467506223,2482105.1942732874,
-          2518015.7979130256,2552967.680496474,2587102.355161259,
-          82548.43470391157}),
-    D=0.07,
-    inertia=false,
-    L=1e4/11.46)            annotation (Placement(transformation(extent={{-36,
-            -67},{36,-20}}, rotation=0)));
-  ThermoSysPro.Solar.Collectors.FresnelField champThermosolaireLFR_N(
-    Ns=30,
-    T(start=fill(500, 30)),
-    F12=0.6366,
-    A=1e4,
-    T0=303)
-    annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(
-    h0=2000e3, P0=125e5)          annotation (Placement(transformation(extent={{80,-54},
-            {100,-34}},         rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI(
-    Starttime=100,
-    Initialvalue=100,
-    Duration=3600,
-    Finalvalue=900) annotation (Placement(transformation(extent={{72,39},{58,53}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Angles(
-    Starttime=100,
-    Initialvalue=45,
-    Finalvalue=45,
-    Duration=3600)  annotation (Placement(transformation(extent={{-26,77},{-12,
-            90}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Q(
-    Starttime=100,
-    Duration=3600,
-    Initialvalue=2,
-    Finalvalue=3)   annotation (Placement(transformation(extent={{7,-6.5},{-7,
-            6.5}}, rotation=90,
-        origin={-90,-9.5})));
-  Junctions.MassFlowMultiplier massFlowMultiplier1(alpha=1/Nt)
-    annotation (Placement(transformation(extent={{-70,-54},{-50,-34}})));
-  Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=Nt)
-    annotation (Placement(transformation(extent={{52,-54},{72,-34}})));
-equation
-  connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2)
-    annotation (Line(points={{0,1.6},{0,-15.6}}, color={191,95,0}));
-  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(
-        points={{0,-22.4},{0,-36.45}}, color={191,95,0}));
-  connect(champThermosolaireLFR_N.SunDNI, DNI.y)
-    annotation (Line(points={{44,45.6},{51,45.6},{51,46},{57.3,46}}));
-  connect(champThermosolaireLFR_N.SunA, Angles.y)
-    annotation (Line(points={{36.8,58.8},{36.8,84},{28,84},{28,83.5},{-11.3,
-          83.5}}));
-  connect(sourceP.C, massFlowMultiplier1.Ce) annotation (Line(points={{-81,-45},
-          {-76.5,-45},{-76.5,-44},{-70,-44}}, color={0,0,0}));
-  connect(massFlowMultiplier1.Cs, dynamicTwoPhaseFlowPipe.C1) annotation (Line(
-        points={{-50,-44},{-44,-44},{-44,-43.5},{-36,-43.5}}, color={0,0,0}));
-  connect(dynamicTwoPhaseFlowPipe.C2, massFlowMultiplier2.Ce) annotation (Line(
-        points={{36,-43.5},{47,-43.5},{47,-44},{52,-44}}, color={0,0,0}));
-  connect(massFlowMultiplier2.Cs, sinkP.C)
-    annotation (Line(points={{72,-44},{80,-44}}, color={0,0,0}));
-  connect(Q.y, sourceP.IMassFlow) annotation (Line(points={{-90,-17.2},{-91,
-          -17.2},{-91,-40}}, color={0,0,255}));
-  connect(Angles.y, champThermosolaireLFR_N.SunG) annotation (Line(points={{
-          -11.3,83.5},{27.2,83.5},{27.2,58.8}}, color={0,0,255}));
-  annotation (
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    experiment(StopTime=5000),
-    Diagram(graphics={Text(
-          extent={{-36,-64},{54,-82}},
-          lineColor={28,108,200},
-          textString="Fresnel field with Nt=%Nt trains")}));
-end TestFresnelField;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestFresnelField
+  parameter Integer Nt=3 "Number of trains";
+public
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    ntubes=1,
+    steady_state=true,
+    D=0.07,
+    e=0.004,
+    Ns=30,
+    T0=500,
+    lambda=20,
+    cpw=500,
+    rhow=8000,
+    Tp(start={628.0843201819387,627.9310075597404,627.8220175907211,
+          627.7368992018166,627.6679716601412,627.6112649113921,
+          627.5643995456558,627.5258238160011,627.4944728950805,
+          627.4695948757801,627.4506537300122,627.4372716636091,
+          627.4291939746797,627.426267226699,627.428426585461,627.4356896138493,
+          627.4481553612113,627.4660085346942,627.4895290639054,
+          627.5191082002851,627.5552734790091,627.5987264837852,
+          627.6504001032708,627.7115474128314,627.7838847016081,
+          627.8698331666657,627.9729350144038,629.4253815385038,
+          633.135688507217,636.2622387488283}),
+    Tp1(start={610.2709965207655,610.0984334604643,609.9757644369477,
+          609.8799665740102,609.8023932206363,609.7385750723525,
+          609.6858335131916,609.6424216866362,609.6071408778737,
+          609.5791446660139,609.5578296140685,609.5427704711935,
+          609.533680491646,609.5303869740989,609.5328169418054,609.540990157294,
+          609.5550181389947,609.5751088339957,609.6015773714007,
+          609.6348642175905,609.6755632868924,609.7244644309128,
+          609.7826179283193,609.8514345863706,609.9328467812495,
+          610.0295806069864,610.1456244663702,611.7808730290952,
+          615.9622431406954,619.4903247027197}),
+    Tp2(start={644.9596553467713,644.824579502235,644.7285482944553,
+          644.6535470354397,644.592810046145,644.5428402353538,
+          644.5015416419557,644.4675473586904,644.4399193877858,
+          644.4179953736024,644.4013031238645,644.3895098327511,
+          644.3823911261306,644.3798118348441,644.3817148399042,644.38811560583,
+          644.3991013774125,644.4148348525065,644.4355626048274,
+          644.4616292617266,644.4934994867675,644.531791236838,
+          644.5773261834961,644.6312079828199,644.6949482231629,
+          644.7706792525222,644.8615205623447,646.1407907783827,
+          649.404839172216,652.1510013554424}),
+    L=1e4/11.46)
+    annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3)
+               annotation (Placement(transformation(extent={{-101,-55},{-81,-35}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe
+    dynamicTwoPhaseFlowPipe(
+    ntubes=1,
+    steady_state=true,
+    rugosrel=0.00005,
+    dpfCorr=1,
+    Ns=30,
+    P(start={12512365.778485337,12512269.4730028,12512159.010926897,
+          12512028.619141866,12511878.28140543,12511707.984695798,
+          12511517.718132183,12511307.472416837,12511077.239500606,
+          12510827.012364838,12510556.784871727,12510266.551658653,
+          12509956.30806284,12509626.050068311,12509275.774270097,
+          12508905.477852736,12508515.15858121,12508104.814803492,
+          12507674.445464557,12507224.050132478,12506753.629037917,
+          12506263.183129327,12505752.714147368,12505222.224723859,
+          12504671.718513375,12504101.200370008,12503510.676589508,
+          12502896.415784404,12502231.48634808,12501522.52554151,
+          12500776.553197166,12500000.0}),
+    h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266,
+          1645211.676359884,1681572.2077847784,1717947.2125321354,
+          1754334.1766730088,1790730.9833788855,1827135.788296852,
+          1863546.9394607474,1899962.9220483964,1936382.3178860326,
+          1972803.7739566958,2009225.9764870608,2045647.6282789519,
+          2082067.4276265746,2118484.0474634594,2154896.1134394333,
+          2191302.179544121,2227700.6996020116,2264089.9923674623,
+          2300468.196934767,2336833.213464297,2373182.6211112435,
+          2409513.559261445,2445822.5467506223,2482105.1942732874,
+          2518015.7979130256,2552967.680496474,2587102.355161259,
+          82548.43470391157}),
+    D=0.07,
+    inertia=false,
+    L=1e4/11.46)            annotation (Placement(transformation(extent={{-36,
+            -67},{36,-20}}, rotation=0)));
+  ThermoSysPro.Solar.Collectors.FresnelField champThermosolaireLFR_N(
+    Ns=30,
+    T(start=fill(500, 30)),
+    F12=0.6366,
+    A=1e4,
+    T0=303)
+    annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(
+    h0=2000e3, P0=125e5)          annotation (Placement(transformation(extent={{80,-54},
+            {100,-34}},         rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI(
+    Starttime=100,
+    Initialvalue=100,
+    Duration=3600,
+    Finalvalue=900) annotation (Placement(transformation(extent={{72,39},{58,53}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Angles(
+    Starttime=100,
+    Initialvalue=45,
+    Finalvalue=45,
+    Duration=3600)  annotation (Placement(transformation(extent={{-26,77},{-12,
+            90}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Q(
+    Starttime=100,
+    Duration=3600,
+    Initialvalue=2,
+    Finalvalue=3)   annotation (Placement(transformation(extent={{7,-6.5},{-7,
+            6.5}}, rotation=90,
+        origin={-90,-9.5})));
+  Junctions.MassFlowMultiplier massFlowMultiplier1(alpha=1/Nt)
+    annotation (Placement(transformation(extent={{-70,-54},{-50,-34}})));
+  Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=Nt)
+    annotation (Placement(transformation(extent={{52,-54},{72,-34}})));
+equation
+  connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2)
+    annotation (Line(points={{0,1.6},{0,-15.6}}, color={191,95,0}));
+  connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(
+        points={{0,-22.4},{0,-36.45}}, color={191,95,0}));
+  connect(champThermosolaireLFR_N.SunDNI, DNI.y)
+    annotation (Line(points={{44,45.6},{51,45.6},{51,46},{57.3,46}}));
+  connect(champThermosolaireLFR_N.SunA, Angles.y)
+    annotation (Line(points={{36.8,58.8},{36.8,84},{28,84},{28,83.5},{-11.3,
+          83.5}}));
+  connect(sourceP.C, massFlowMultiplier1.Ce) annotation (Line(points={{-81,-45},
+          {-76.5,-45},{-76.5,-44},{-70,-44}}, color={0,0,0}));
+  connect(massFlowMultiplier1.Cs, dynamicTwoPhaseFlowPipe.C1) annotation (Line(
+        points={{-50,-44},{-44,-44},{-44,-43.5},{-36,-43.5}}, color={0,0,0}));
+  connect(dynamicTwoPhaseFlowPipe.C2, massFlowMultiplier2.Ce) annotation (Line(
+        points={{36,-43.5},{47,-43.5},{47,-44},{52,-44}}, color={0,0,0}));
+  connect(massFlowMultiplier2.Cs, sinkP.C)
+    annotation (Line(points={{72,-44},{80,-44}}, color={0,0,0}));
+  connect(Q.y, sourceP.IMassFlow) annotation (Line(points={{-90,-17.2},{-91,
+          -17.2},{-91,-40}}, color={0,0,255}));
+  connect(Angles.y, champThermosolaireLFR_N.SunG) annotation (Line(points={{
+          -11.3,83.5},{27.2,83.5},{27.2,58.8}}, color={0,0,255}));
+  annotation (
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    experiment(StopTime=5000),
+    Diagram(graphics={Text(
+          extent={{-36,-64},{54,-82}},
+          lineColor={28,108,200},
+          textString="Fresnel field with Nt=%Nt trains")}));
+end TestFresnelField;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo
index 983cdfb4292aac2dbbeb589ba93dc4d8a02983ad..7ab557a9f8ddb7d016914a497b36164e2f520384 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo
@@ -1,83 +1,83 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestGTCombustionChamber
-  import ThermoSysPro;
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2
-    annotation (Placement(transformation(
-        origin={149,-2},
-        extent={{23,-24},{-23,24}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(Cfg(P(
-          fixed=true, start=14.1e5)), kcham(fixed=false, start=1)) annotation (
-      Placement(transformation(extent={{-67,-68},{67,64}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2(
-    Q0=0,
-    P0=15e5,
-    h0=300e3)
-    annotation (Placement(transformation(extent={{-112,48},{-72,88}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(
-    Hum=0,
-    Xo=0,
-    Xn=0,
-    Xs=0,
-    rho=0.838,
-    Xc=0.755,
-    Xh=0.245,
-    Cp=2255,
-    T0=410,
-    Q0=9.30,
-    LHV=47500e3) annotation (Placement(transformation(extent={{-107,-93},{-71,-57}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2(
-    Xso2=0,
-    Xco2=0.0,
-    Xo2=0.23,
-    Xh2o=0.01,
-    P0=15e5,
-    Q0=415,
-    T0=680,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-174,-26},{-128,22}},
-          rotation=0)));
-
-equation
-  connect(GTCombustionChamber2.Cws, sourcePQ2.C)
-    annotation (Line(points={{-40.2,57.4},{-40.2,68},{-72,68}}));
-  connect(GTCombustionChamber2.Cfuel, sourceCombustible2.C) annotation (Line(
-        points={{0,-61.4},{0,-75},{-71,-75}},    color={0,0,0}));
-  connect(GTCombustionChamber2.Cfg, Puits_Fumees2.C) annotation (Line(
-      points={{60.3,-2},{126,-2}},
-      color={0,0,0},
-      thickness=1));
-  connect(Source_Fumees2.C, GTCombustionChamber2.Ca) annotation (Line(
-      points={{-128,-2},{-60.3,-2}},
-      color={0,0,0},
-      thickness=1));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1)), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestGTCombustionChamber;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestGTCombustionChamber
+  import ThermoSysPro;
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2
+    annotation (Placement(transformation(
+        origin={149,-2},
+        extent={{23,-24},{-23,24}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(Cfg(P(
+          fixed=true, start=14.1e5)), kcham(fixed=false, start=1)) annotation (
+      Placement(transformation(extent={{-67,-68},{67,64}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2(
+    Q0=0,
+    P0=15e5,
+    h0=300e3)
+    annotation (Placement(transformation(extent={{-112,48},{-72,88}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(
+    Hum=0,
+    Xo=0,
+    Xn=0,
+    Xs=0,
+    rho=0.838,
+    Xc=0.755,
+    Xh=0.245,
+    Cp=2255,
+    T0=410,
+    Q0=9.30,
+    LHV=47500e3) annotation (Placement(transformation(extent={{-107,-93},{-71,-57}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2(
+    Xso2=0,
+    Xco2=0.0,
+    Xo2=0.23,
+    Xh2o=0.01,
+    P0=15e5,
+    Q0=415,
+    T0=680,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-174,-26},{-128,22}},
+          rotation=0)));
+
+equation
+  connect(GTCombustionChamber2.Cws, sourcePQ2.C)
+    annotation (Line(points={{-40.2,57.4},{-40.2,68},{-72,68}}));
+  connect(GTCombustionChamber2.Cfuel, sourceCombustible2.C) annotation (Line(
+        points={{0,-61.4},{0,-75},{-71,-75}},    color={0,0,0}));
+  connect(GTCombustionChamber2.Cfg, Puits_Fumees2.C) annotation (Line(
+      points={{60.3,-2},{126,-2}},
+      color={0,0,0},
+      thickness=1));
+  connect(Source_Fumees2.C, GTCombustionChamber2.Ca) annotation (Line(
+      points={{-128,-2},{-60.3,-2}},
+      color={0,0,0},
+      thickness=1));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1)), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestGTCombustionChamber;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo
index 4819656e418c4d8144557684e93cdc7b47712a36..43677930911eacc35d042dd3918dd6eacc4e0ac1 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo
@@ -1,105 +1,105 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestGasTurbine
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
-    P0=1.013e5,
-    Q0=600,
-    T0=29.4 + 273.16,
-    option_temperature=true,
-    Xco2=0,
-    Xh2o=0,
-    Xo2=0.20994,
-    Xso2=0,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-            annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
-
-  BoundaryConditions.SinkP                   sink
-    annotation (Placement(transformation(extent={{60,-10},{80,10}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante humidity(k=0.93)
-    annotation (Placement(transformation(extent={{-100,30},{-80,50}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe fuel(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=13.507,
-    Finalvalue=8.756)
-    annotation (Placement(transformation(extent={{-40,60},{-20,80}})));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe air(
-    Starttime=200,
-    Duration=800,
-    Initialvalue=592.7,
-    Finalvalue=415.70)
-    annotation (Placement(transformation(extent={{-98,0},{-78,20}})));
-  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Q0=13.4368286133,
-    T0=185 + 273.16,
-    LHV=46989e3,
-    Cp=2255,
-    Xc=0.755,
-    Xh=0.245,
-    rho=0.838) annotation (Placement(transformation(extent={{-20,40},{0,60}})));
-  BoundaryConditions.SourcePQ water(Q0=0)
-    annotation (Placement(transformation(extent={{-60,40},{-40,60}})));
-  Machines.GasTurbine gasTurbine(
-    comp_tau_n=14.0178,
-    comp_eff_n=0.87004,
-    exp_tau_n=0.06458,
-    exp_eff_n=0.89045,
-    TurbQred=0.0175634,
-    Kcham=2.02088,
-    Wpth=1e6,
-    Compresseur(
-      Ps(start=1404200.0),
-      Te(start=302.56000000000006),
-      Tis(start=630.0),
-      Ts(start=729.0)),
-    TurbineAgaz(Tis(start=847.0)),
-    chambreCombustionTAC(
-      Psf(start=1310000.0),
-      Tea(start=729.0),
-      Tsf(start=1532.57)),
-    xAIR(
-      ppvap0(start=4104.0),
-      rho_air(start=1.0836),
-      rho_vap(start=0.029)))
-    annotation (Placement(transformation(extent={{-30,-28},{30,28}})));
-equation
-  connect(air.y, sourcePQ.IMassFlow)
-    annotation (Line(points={{-77,10},{-60,10},{-60,5}}, color={0,0,255}));
-  connect(humidity.y, gasTurbine.Huminide) annotation (Line(points={{-79,40},{
-          -60,40},{-60,16.8},{-31.2,16.8}},color={0,0,255}));
-  connect(fuel.y, fuelSourcePQ.IMassFlow)
-    annotation (Line(points={{-19,70},{-10,70},{-10,55}},
-                                                        color={0,0,255}));
-  connect(sourcePQ.C, gasTurbine.Entree_air) annotation (Line(points={{-50,0},{
-          -32,0},{-32,3.55271e-015},{-30,3.55271e-015}}, color={0,0,0}));
-  connect(fuelSourcePQ.C, gasTurbine.Entree_combustible)
-    annotation (Line(points={{0,50},{18,50},{18,28}}, color={0,0,0}));
-  connect(water.C, gasTurbine.Entree_eau_combustion)
-    annotation (Line(points={{-40,50},{-18,50},{-18,28}}, color={0,0,0}));
-  connect(gasTurbine.Sortie_fumees, sink.C)
-    annotation (Line(points={{30,3.55271e-015},{46,3.55271e-015},{46,0},{60,0}},
-                                             color={0,0,0}));
-  annotation (                   Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    experiment(StopTime=1200));
-end TestGasTurbine;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestGasTurbine
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+    P0=1.013e5,
+    Q0=600,
+    T0=29.4 + 273.16,
+    option_temperature=true,
+    Xco2=0,
+    Xh2o=0,
+    Xo2=0.20994,
+    Xso2=0,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+            annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
+
+  BoundaryConditions.SinkP                   sink
+    annotation (Placement(transformation(extent={{60,-10},{80,10}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante humidity(k=0.93)
+    annotation (Placement(transformation(extent={{-100,30},{-80,50}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe fuel(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=13.507,
+    Finalvalue=8.756)
+    annotation (Placement(transformation(extent={{-40,60},{-20,80}})));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe air(
+    Starttime=200,
+    Duration=800,
+    Initialvalue=592.7,
+    Finalvalue=415.70)
+    annotation (Placement(transformation(extent={{-98,0},{-78,20}})));
+  Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Q0=13.4368286133,
+    T0=185 + 273.16,
+    LHV=46989e3,
+    Cp=2255,
+    Xc=0.755,
+    Xh=0.245,
+    rho=0.838) annotation (Placement(transformation(extent={{-20,40},{0,60}})));
+  BoundaryConditions.SourcePQ water(Q0=0)
+    annotation (Placement(transformation(extent={{-60,40},{-40,60}})));
+  Machines.GasTurbine gasTurbine(
+    comp_tau_n=14.0178,
+    comp_eff_n=0.87004,
+    exp_tau_n=0.06458,
+    exp_eff_n=0.89045,
+    TurbQred=0.0175634,
+    Kcham=2.02088,
+    Wpth=1e6,
+    Compresseur(
+      Ps(start=1404200.0),
+      Te(start=302.56000000000006),
+      Tis(start=630.0),
+      Ts(start=729.0)),
+    TurbineAgaz(Tis(start=847.0)),
+    chambreCombustionTAC(
+      Psf(start=1310000.0),
+      Tea(start=729.0),
+      Tsf(start=1532.57)),
+    xAIR(
+      ppvap0(start=4104.0),
+      rho_air(start=1.0836),
+      rho_vap(start=0.029)))
+    annotation (Placement(transformation(extent={{-30,-28},{30,28}})));
+equation
+  connect(air.y, sourcePQ.IMassFlow)
+    annotation (Line(points={{-77,10},{-60,10},{-60,5}}, color={0,0,255}));
+  connect(humidity.y, gasTurbine.Huminide) annotation (Line(points={{-79,40},{
+          -60,40},{-60,16.8},{-31.2,16.8}},color={0,0,255}));
+  connect(fuel.y, fuelSourcePQ.IMassFlow)
+    annotation (Line(points={{-19,70},{-10,70},{-10,55}},
+                                                        color={0,0,255}));
+  connect(sourcePQ.C, gasTurbine.Entree_air) annotation (Line(points={{-50,0},{
+          -32,0},{-32,3.55271e-015},{-30,3.55271e-015}}, color={0,0,0}));
+  connect(fuelSourcePQ.C, gasTurbine.Entree_combustible)
+    annotation (Line(points={{0,50},{18,50},{18,28}}, color={0,0,0}));
+  connect(water.C, gasTurbine.Entree_eau_combustion)
+    annotation (Line(points={{-40,50},{-18,50},{-18,28}}, color={0,0,0}));
+  connect(gasTurbine.Sortie_fumees, sink.C)
+    annotation (Line(points={{30,3.55271e-015},{46,3.55271e-015},{46,0},{60,0}},
+                                             color={0,0,0}));
+  annotation (                   Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    experiment(StopTime=1200));
+end TestGasTurbine;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo
index 50423676bc1ba0c0d93f4e2ea59fc86ce80778f5..d24ce5522d282c6ee96f3abdc347790dacdc397c 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo
@@ -1,86 +1,86 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestGenericCombustion
-
-  ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion genericCombustionCCS(
-    kcham=0.1,
-    Acham=275,
-    Xbf=0,
-    ImbCV=0.05,
-    ImbBF=0.0,
-    Psf(start=113275)) annotation (Placement(transformation(extent={{-32,-56},{
-            92,72}},
-                  rotation=0)));
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Xn=0.0208,
-    Xashes=0.136,
-    Cp=1200,
-    rho=1100,
-    LHV=29245e3,
-    Xc=0.719,
-    Xh=0.0414,
-    Xo=0.086,
-    Xs=0.0044,
-    Vol=0.286,
-    Q0=57.20,
-    T0=358.15,
-    Hum=0.08) annotation (Placement(transformation(extent={{24,-95},{58,-57}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
-    annotation (Placement(transformation(extent={{-83,-3},{-47,31}},  rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
-    Xso2=0,
-    Q0=609.29,
-    Xh2o=0.01,
-    Xo2=0.230,
-    Xco2=0,
-    P0=191000,
-    T0=524.89,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-54,-94},{-10,-54}},
-                                                                     rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{30,70},{74,112}},rotation=0)));
-equation
-  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel) annotation (Line(points={{58,-76},
-          {73.4,-76},{73.4,-49.6}},         color={0,0,0}));
-  connect(SourcePQ_Water.C, genericCombustionCCS.Cws) annotation (Line(points={{-47,14},
-          {-36,14},{-36,14.4},{-25.8,14.4}},         color={0,0,0}));
-  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
-      points={{11.4,-49.6},{11.4,-74},{-10,-74}},
-      color={0,0,0},
-      thickness=1));
-  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
-      points={{11.4,65.6},{11.4,91},{30,91}},
-      color={0,0,0},
-      thickness=1));
-  annotation (         Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestGenericCombustion;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestGenericCombustion
+
+  ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion genericCombustionCCS(
+    kcham=0.1,
+    Acham=275,
+    Xbf=0,
+    ImbCV=0.05,
+    ImbBF=0.0,
+    Psf(start=113275)) annotation (Placement(transformation(extent={{-32,-56},{
+            92,72}},
+                  rotation=0)));
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Xn=0.0208,
+    Xashes=0.136,
+    Cp=1200,
+    rho=1100,
+    LHV=29245e3,
+    Xc=0.719,
+    Xh=0.0414,
+    Xo=0.086,
+    Xs=0.0044,
+    Vol=0.286,
+    Q0=57.20,
+    T0=358.15,
+    Hum=0.08) annotation (Placement(transformation(extent={{24,-95},{58,-57}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
+    annotation (Placement(transformation(extent={{-83,-3},{-47,31}},  rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
+    Xso2=0,
+    Q0=609.29,
+    Xh2o=0.01,
+    Xo2=0.230,
+    Xco2=0,
+    P0=191000,
+    T0=524.89,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-54,-94},{-10,-54}},
+                                                                     rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{30,70},{74,112}},rotation=0)));
+equation
+  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel) annotation (Line(points={{58,-76},
+          {73.4,-76},{73.4,-49.6}},         color={0,0,0}));
+  connect(SourcePQ_Water.C, genericCombustionCCS.Cws) annotation (Line(points={{-47,14},
+          {-36,14},{-36,14.4},{-25.8,14.4}},         color={0,0,0}));
+  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
+      points={{11.4,-49.6},{11.4,-74},{-10,-74}},
+      color={0,0,0},
+      thickness=1));
+  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
+      points={{11.4,65.6},{11.4,91},{30,91}},
+      color={0,0,0},
+      thickness=1));
+  annotation (         Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestGenericCombustion;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo
index 6923ae7672a313f36f64705292684b0eb018b4b5..4e29d9b4aeb3c315e82f10608a33169c0b13f82b 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo
@@ -1,144 +1,144 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestGenericCombustion1D
-
-  parameter Integer NCEL = 7;
-
-  ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(
-    NCEL=7,
-    Qm(fixed=false),
-    Qsf(fixed=false),
-    kcham(fixed=true) = 0.1,
-    Acham=275,
-    Xbf=0,
-    ImbCV=0.05,
-    EPSPAR=0.7,
-    Kec=8.8,
-    SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56},
-    ImbBF=0.0,
-    Psf(start=113275)) annotation (Placement(transformation(extent={{-62,-56},{62,
-            72}}, rotation=0)));
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Xn=0.0208,
-    Xashes=0.136,
-    Cp=1200,
-    rho=1100,
-    LHV=29245e3,
-    Xc=0.719,
-    Xh=0.0414,
-    Xo=0.086,
-    Xs=0.0044,
-    Vol=0.286,
-    Q0=57.20,
-    T0=358.15,
-    Hum=0.08) annotation (Placement(transformation(extent={{-106,-43},{-72,-5}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
-    Xso2=0,
-    Q0=609.29,
-    Xh2o=0.01,
-    Xo2=0.230,
-    Xco2=0,
-    P0=191000,
-    T0=524.89,
-    option_temperature=true,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{0,70},{44,112}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
-    annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe              PipeWaterSteam(
-    Ns=7,
-    z2=56,
-    rugosrel=5e-5,
-    ntubes=403,
-    L=58,
-    D=0.0327,
-    C2(Q(fixed=false, start=486.69), P(
-        fixed=false,
-        start=1.96318e+07,
-        displayUnit="Pa")),
-    dpfCorr=3.5)
-    annotation (Placement(transformation(
-        origin={91,8},
-        extent={{49,16},{-49,-16}},
-        rotation=270)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall              paroiEcrans(
-    Ns=7,
-    lambda=40,
-    steady_state=true,
-    ntubes=403,
-    L=58,
-    D=0.0327,
-    e=0.001)
-    annotation (Placement(transformation(
-        origin={73,7.5},
-        extent={{51.5,-15},{-51.5,15}},
-        rotation=270)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkWaterSteam2(
-    option_temperature=false,
-    Q(start=486.69, fixed=true),
-    h0=2.5e+06,
-    P0(fixed=false) = 19621600)
-    annotation (Placement(transformation(
-        origin={90,90.5},
-        extent={{14.5,-15},{-14.5,15}},
-        rotation=270)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceEcrans(
-    h0=1.292e+06,
-    option_temperature=false,
-    P0=20112000)
-    annotation (Placement(transformation(
-        origin={91,-81},
-        extent={{15,-15},{-15,15}},
-        rotation=270)));
-equation
-  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel)
-    annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0}));
-  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
-      points={{0,65.6},{0,91},{0,91}},
-      color={0,0,0},
-      thickness=1));
-  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
-      points={{0,-49.6},{0,-78}},
-      color={0,0,0},
-      thickness=1));
-  connect(SourcePQ_Water.C, genericCombustionCCS.Cws)
-    annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255}));
-  connect(genericCombustionCCS.Cth,paroiEcrans. WT2) annotation (Line(points={{55.8,8},
-          {68,8},{68,7.5},{76,7.5}},         color={191,95,0}));
-  connect(paroiEcrans.WT1,PipeWaterSteam. CTh) annotation (Line(points={{70,7.5},
-          {71,7.5},{71,8},{86.2,8}}, color={191,95,0}));
-  connect(sourceEcrans.C,PipeWaterSteam. C1)
-    annotation (Line(points={{91,-66},{91,-41}},   color={0,0,255}));
-  connect(PipeWaterSteam.C2,sinkWaterSteam2. C) annotation (Line(points={{91,57},
-          {91,76},{90,76}},       color={0,0,255}));
-  annotation (         Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestGenericCombustion1D;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestGenericCombustion1D
+
+  parameter Integer NCEL = 7;
+
+  ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(
+    NCEL=7,
+    Qm(fixed=false),
+    Qsf(fixed=false),
+    kcham(fixed=true) = 0.1,
+    Acham=275,
+    Xbf=0,
+    ImbCV=0.05,
+    EPSPAR=0.7,
+    Kec=8.8,
+    SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56},
+    ImbBF=0.0,
+    Psf(start=113275)) annotation (Placement(transformation(extent={{-62,-56},{62,
+            72}}, rotation=0)));
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Xn=0.0208,
+    Xashes=0.136,
+    Cp=1200,
+    rho=1100,
+    LHV=29245e3,
+    Xc=0.719,
+    Xh=0.0414,
+    Xo=0.086,
+    Xs=0.0044,
+    Vol=0.286,
+    Q0=57.20,
+    T0=358.15,
+    Hum=0.08) annotation (Placement(transformation(extent={{-106,-43},{-72,-5}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
+    Xso2=0,
+    Q0=609.29,
+    Xh2o=0.01,
+    Xo2=0.230,
+    Xco2=0,
+    P0=191000,
+    T0=524.89,
+    option_temperature=true,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{0,70},{44,112}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000)
+    annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe              PipeWaterSteam(
+    Ns=7,
+    z2=56,
+    rugosrel=5e-5,
+    ntubes=403,
+    L=58,
+    D=0.0327,
+    C2(Q(fixed=false, start=486.69), P(
+        fixed=false,
+        start=1.96318e+07,
+        displayUnit="Pa")),
+    dpfCorr=3.5)
+    annotation (Placement(transformation(
+        origin={91,8},
+        extent={{49,16},{-49,-16}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall              paroiEcrans(
+    Ns=7,
+    lambda=40,
+    steady_state=true,
+    ntubes=403,
+    L=58,
+    D=0.0327,
+    e=0.001)
+    annotation (Placement(transformation(
+        origin={73,7.5},
+        extent={{51.5,-15},{-51.5,15}},
+        rotation=270)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP              sinkWaterSteam2(
+    option_temperature=false,
+    Q(start=486.69, fixed=true),
+    h0=2.5e+06,
+    P0(fixed=false) = 19621600)
+    annotation (Placement(transformation(
+        origin={90,90.5},
+        extent={{14.5,-15},{-14.5,15}},
+        rotation=270)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceEcrans(
+    h0=1.292e+06,
+    option_temperature=false,
+    P0=20112000)
+    annotation (Placement(transformation(
+        origin={91,-81},
+        extent={{15,-15},{-15,15}},
+        rotation=270)));
+equation
+  connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel)
+    annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0}));
+  connect(genericCombustionCCS.Cfg, sink.C) annotation (Line(
+      points={{0,65.6},{0,91},{0,91}},
+      color={0,0,0},
+      thickness=1));
+  connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line(
+      points={{0,-49.6},{0,-78}},
+      color={0,0,0},
+      thickness=1));
+  connect(SourcePQ_Water.C, genericCombustionCCS.Cws)
+    annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255}));
+  connect(genericCombustionCCS.Cth,paroiEcrans. WT2) annotation (Line(points={{55.8,8},
+          {68,8},{68,7.5},{76,7.5}},         color={191,95,0}));
+  connect(paroiEcrans.WT1,PipeWaterSteam. CTh) annotation (Line(points={{70,7.5},
+          {71,7.5},{71,8},{86.2,8}}, color={191,95,0}));
+  connect(sourceEcrans.C,PipeWaterSteam. C1)
+    annotation (Line(points={{91,-66},{91,-41}},   color={0,0,255}));
+  connect(PipeWaterSteam.C2,sinkWaterSteam2. C) annotation (Line(points={{91,57},
+          {91,76},{90,76}},       color={0,0,255}));
+  annotation (         Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestGenericCombustion1D;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo
index 9d2d62ee2a2ca451c874218738a63bdc133ad1c0..928066e8b6f9f7683e92b7e208dc005cd06f9360 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo
@@ -1,90 +1,90 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestGridFurnace
-  import ThermoSysPro;
-
-  parameter Integer NCEL = 7;
-
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Xn=0.0208,
-    Xashes=0.136,
-    Cp=1200,
-    rho=1100,
-    LHV=29245e3,
-    Xc=0.719,
-    Xh=0.0414,
-    Xo=0.086,
-    Xs=0.0044,
-    Vol=0.286,
-    Q0=57.20,
-    T0=358.15,
-    Hum=0.08) annotation (Placement(transformation(extent={{-106,-23},{-72,15}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
-    Xso2=0,
-    Xh2o=0.01,
-    Xo2=0.230,
-    Xco2=0,
-    T0=300,
-    Q0=10,
-    P0=1.9e5,
-    option_temperature=true,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-74,-80},{-30,-40}},
-                                                                     rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink(option_temperature=true)
-                                                  annotation (Placement(transformation(
-          extent={{28,50},{72,92}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(P0=1.e5, Q0=1)
-    annotation (Placement(transformation(extent={{89,13},{53,47}},    rotation=
-            0)));
-  ThermoSysPro.Fluid.Combustion.CombustionChambers.GridFurnace gridFurnace
-    annotation (Placement(transformation(extent={{-40,-40},{40,40}})));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ  sourceAir1(
-    Xso2=0,
-    Xh2o=0.01,
-    Xo2=0.230,
-    Xco2=0,
-    option_temperature=true,
-    T0=300,
-    Q0=10,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-90,4},{-46,44}},  rotation=0)));
-equation
-  connect(fuelSourcePQ.C, gridFurnace.Com)
-    annotation (Line(points={{-72,-4},{-36,-4}}, color={0,0,0}));
-  connect(gridFurnace.Cfg, sink.C)
-    annotation (Line(points={{0,36},{0,71},{28,71}}, color={0,0,0}));
-  connect(SourcePQ_Water.C, gridFurnace.port_eau_refroid)
-    annotation (Line(points={{53,30},{32,30},{32,12}}, color={0,0,0}));
-  connect(sourceAir1.C, gridFurnace.Ca2)
-    annotation (Line(points={{-46,24},{-20,24}}, color={0,0,0}));
-  connect(sourceAir.C, gridFurnace.Ca1)
-    annotation (Line(points={{-30,-60},{0,-60},{0,-36}}, color={0,0,0}));
-  annotation (         Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestGridFurnace;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestGridFurnace
+  import ThermoSysPro;
+
+  parameter Integer NCEL = 7;
+
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Xn=0.0208,
+    Xashes=0.136,
+    Cp=1200,
+    rho=1100,
+    LHV=29245e3,
+    Xc=0.719,
+    Xh=0.0414,
+    Xo=0.086,
+    Xs=0.0044,
+    Vol=0.286,
+    Q0=57.20,
+    T0=358.15,
+    Hum=0.08) annotation (Placement(transformation(extent={{-106,-23},{-72,15}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
+    Xso2=0,
+    Xh2o=0.01,
+    Xo2=0.230,
+    Xco2=0,
+    T0=300,
+    Q0=10,
+    P0=1.9e5,
+    option_temperature=true,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-74,-80},{-30,-40}},
+                                                                     rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink(option_temperature=true)
+                                                  annotation (Placement(transformation(
+          extent={{28,50},{72,92}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(P0=1.e5, Q0=1)
+    annotation (Placement(transformation(extent={{89,13},{53,47}},    rotation=
+            0)));
+  ThermoSysPro.Fluid.Combustion.CombustionChambers.GridFurnace gridFurnace
+    annotation (Placement(transformation(extent={{-40,-40},{40,40}})));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ  sourceAir1(
+    Xso2=0,
+    Xh2o=0.01,
+    Xo2=0.230,
+    Xco2=0,
+    option_temperature=true,
+    T0=300,
+    Q0=10,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-90,4},{-46,44}},  rotation=0)));
+equation
+  connect(fuelSourcePQ.C, gridFurnace.Com)
+    annotation (Line(points={{-72,-4},{-36,-4}}, color={0,0,0}));
+  connect(gridFurnace.Cfg, sink.C)
+    annotation (Line(points={{0,36},{0,71},{28,71}}, color={0,0,0}));
+  connect(SourcePQ_Water.C, gridFurnace.port_eau_refroid)
+    annotation (Line(points={{53,30},{32,30},{32,12}}, color={0,0,0}));
+  connect(sourceAir1.C, gridFurnace.Ca2)
+    annotation (Line(points={{-46,24},{-20,24}}, color={0,0,0}));
+  connect(sourceAir.C, gridFurnace.Ca1)
+    annotation (Line(points={{-30,-60},{0,-60},{0,-36}}, color={0,0,0}));
+  annotation (         Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestGridFurnace;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo
index fcf57e1865b3793aff544bdb575ad1abcf346954..a47b08f9b36de4daaa377a5175b1085f2ead73a6 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo
@@ -1,53 +1,53 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestHeatPumpCompressor
-  ThermoSysPro.Fluid.Machines.HeatPumpCompressor Compressor(
-    Pe(fixed=false, start=100000),
-    Ts(fixed=false, start=680)) annotation (Placement(transformation(extent={{
-            -52,-52},{48,52}}, rotation=0)));
-  BoundaryConditions.SourceQ                     SourceQ1(
-    Xso2=0,
-    Xco2=0.0,
-    Xh2o=0.003,
-    Xo2=0.23,
-    Q0=420,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.C3H3F5,
-    h0=3.e4,
-    T0=288,
-    option_temperature=false)
-    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=1580000,
-      option_temperature=false)
-    annotation (Placement(transformation(
-        origin={96,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-equation
-  connect(SourceQ1.C, Compressor.C1)
-    annotation (Line(points={{-84,0},{-52,0}}, color={0,0,0}));
-  connect(SinkP1.C, Compressor.C2)
-    annotation (Line(points={{86,0},{48,0}}, color={0,0,0}));
-  annotation (                   Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestHeatPumpCompressor;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestHeatPumpCompressor
+  ThermoSysPro.Fluid.Machines.HeatPumpCompressor Compressor(
+    Pe(fixed=false, start=100000),
+    Ts(fixed=false, start=680)) annotation (Placement(transformation(extent={{
+            -52,-52},{48,52}}, rotation=0)));
+  BoundaryConditions.SourceQ                     SourceQ1(
+    Xso2=0,
+    Xco2=0.0,
+    Xh2o=0.003,
+    Xo2=0.23,
+    Q0=420,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.C3H3F5,
+    h0=3.e4,
+    T0=288,
+    option_temperature=false)
+    annotation (Placement(transformation(extent={{-104,-10},{-84,10}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=1580000,
+      option_temperature=false)
+    annotation (Placement(transformation(
+        origin={96,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+equation
+  connect(SourceQ1.C, Compressor.C1)
+    annotation (Line(points={{-84,0},{-52,0}}, color={0,0,0}));
+  connect(SinkP1.C, Compressor.C2)
+    annotation (Line(points={{86,0},{48,0}}, color={0,0,0}));
+  annotation (                   Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestHeatPumpCompressor;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo
index 670c99a7b2ab8836cc064db054ca997f059e30d2..eedb010264d984ea7bc7b9c7302b76a9c3d5a3a4 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo
@@ -1,111 +1,111 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestIdealCheckValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
-                                     annotation (Placement(transformation(
-          extent={{-60,-80},{-40,-60}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
-                                   P0=6e5) annotation (Placement(transformation(
-          extent={{80,-80},{100,-60}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
-    amplitude=6e5,
-    width=50,
-    period=100,
-    offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80,
-            -60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve3
-    annotation (Placement(transformation(extent={{10,-80},{30,-60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2
-                                        annotation (Placement(transformation(
-          extent={{-30,-80},{-10,-60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP3
-                                        annotation (Placement(transformation(
-          extent={{50,-80},{70,-60}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceP
-                                    annotation (Placement(transformation(extent=
-           {{-104,20},{-84,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP              puitsP(
-                                  P0=6e5) annotation (Placement(transformation(
-          extent={{84,20},{104,40}}, rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump              staticCentrifugalPump1
-    annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump              staticCentrifugalPump2
-    annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeD              volumeD annotation (Placement(
-        transformation(extent={{-50,20},{-30,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve              idealCheckValve1
-    annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve              idealCheckValve2
-    annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeC              volumeC annotation (Placement(
-        transformation(extent={{30,20},{50,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP
-                                        annotation (Placement(transformation(
-          extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP1
-                                         annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-equation
-  connect(sourceP1.C, perteDP2.C1)
-    annotation (Line(points={{-40,-70},{-30,-70}}, color={0,0,255}));
-  connect(perteDP2.C2, idealCheckValve3.C1)
-    annotation (Line(points={{-10,-70},{10,-70}}, color={0,0,255}));
-  connect(idealCheckValve3.C2, perteDP3.C1)
-    annotation (Line(points={{30,-70},{50,-70}}, color={0,0,255}));
-  connect(perteDP3.C2, puitsP1.C)
-    annotation (Line(points={{70,-70},{80,-70}}, color={0,0,255}));
-  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55,
-          -70}}));
-  connect(staticCentrifugalPump1.C2,idealCheckValve1. C1) annotation (Line(
-        points={{-10,70},{-2,70},{-2,70},{10,70}}, color={0,0,255}));
-  connect(staticCentrifugalPump2.C2,idealCheckValve2. C1) annotation (Line(
-        points={{-10,-10},{0,-10},{0,-10},{8,-10}}, color={0,0,255}));
-  connect(perteDP1.C2,puitsP. C)
-    annotation (Line(points={{80,30},{84,30}}, color={0,0,255}));
-  connect(sourceP.C,perteDP. C1)
-    annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255}));
-  connect(perteDP.C2, volumeD.Ce)
-    annotation (Line(points={{-60,30},{-50,30}}, color={0,0,0}));
-  connect(volumeD.Cs1, staticCentrifugalPump1.C1)
-    annotation (Line(points={{-40,40},{-40,70},{-30,70}}, color={0,0,0}));
-  connect(volumeD.Cs2, staticCentrifugalPump2.C1)
-    annotation (Line(points={{-40,20},{-40,-10},{-30,-10}}, color={0,0,0}));
-  connect(idealCheckValve1.C2, volumeC.Ce2)
-    annotation (Line(points={{30,70},{40,70},{40,40}}, color={0,0,0}));
-  connect(volumeC.Cs, perteDP1.C1)
-    annotation (Line(points={{50,30},{60,30}}, color={0,0,0}));
-  connect(idealCheckValve2.C2, volumeC.Ce3)
-    annotation (Line(points={{28,-10},{40,-10},{40,20}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestIdealCheckValve;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestIdealCheckValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
+                                     annotation (Placement(transformation(
+          extent={{-60,-80},{-40,-60}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(
+                                   P0=6e5) annotation (Placement(transformation(
+          extent={{80,-80},{100,-60}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(
+    amplitude=6e5,
+    width=50,
+    period=100,
+    offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80,
+            -60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve3
+    annotation (Placement(transformation(extent={{10,-80},{30,-60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2
+                                        annotation (Placement(transformation(
+          extent={{-30,-80},{-10,-60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP3
+                                        annotation (Placement(transformation(
+          extent={{50,-80},{70,-60}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP              sourceP
+                                    annotation (Placement(transformation(extent=
+           {{-104,20},{-84,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP              puitsP(
+                                  P0=6e5) annotation (Placement(transformation(
+          extent={{84,20},{104,40}}, rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump              staticCentrifugalPump1
+    annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump              staticCentrifugalPump2
+    annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeD              volumeD annotation (Placement(
+        transformation(extent={{-50,20},{-30,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve              idealCheckValve1
+    annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealCheckValve              idealCheckValve2
+    annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeC              volumeC annotation (Placement(
+        transformation(extent={{30,20},{50,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP
+                                        annotation (Placement(transformation(
+          extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP1
+                                         annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+equation
+  connect(sourceP1.C, perteDP2.C1)
+    annotation (Line(points={{-40,-70},{-30,-70}}, color={0,0,255}));
+  connect(perteDP2.C2, idealCheckValve3.C1)
+    annotation (Line(points={{-10,-70},{10,-70}}, color={0,0,255}));
+  connect(idealCheckValve3.C2, perteDP3.C1)
+    annotation (Line(points={{30,-70},{50,-70}}, color={0,0,255}));
+  connect(perteDP3.C2, puitsP1.C)
+    annotation (Line(points={{70,-70},{80,-70}}, color={0,0,255}));
+  connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55,
+          -70}}));
+  connect(staticCentrifugalPump1.C2,idealCheckValve1. C1) annotation (Line(
+        points={{-10,70},{-2,70},{-2,70},{10,70}}, color={0,0,255}));
+  connect(staticCentrifugalPump2.C2,idealCheckValve2. C1) annotation (Line(
+        points={{-10,-10},{0,-10},{0,-10},{8,-10}}, color={0,0,255}));
+  connect(perteDP1.C2,puitsP. C)
+    annotation (Line(points={{80,30},{84,30}}, color={0,0,255}));
+  connect(sourceP.C,perteDP. C1)
+    annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255}));
+  connect(perteDP.C2, volumeD.Ce)
+    annotation (Line(points={{-60,30},{-50,30}}, color={0,0,0}));
+  connect(volumeD.Cs1, staticCentrifugalPump1.C1)
+    annotation (Line(points={{-40,40},{-40,70},{-30,70}}, color={0,0,0}));
+  connect(volumeD.Cs2, staticCentrifugalPump2.C1)
+    annotation (Line(points={{-40,20},{-40,-10},{-30,-10}}, color={0,0,0}));
+  connect(idealCheckValve1.C2, volumeC.Ce2)
+    annotation (Line(points={{30,70},{40,70},{40,40}}, color={0,0,0}));
+  connect(volumeC.Cs, perteDP1.C1)
+    annotation (Line(points={{50,30},{60,30}}, color={0,0,0}));
+  connect(idealCheckValve2.C2, volumeC.Ce3)
+    annotation (Line(points={{28,-10},{40,-10},{40,20}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestIdealCheckValve;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo
index bbc0fdb8afdca0e52c30a25b3211f1c30e9e9803..f7343b3f838a7ef84bf9659dfd52165de9fe744b 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo
@@ -1,65 +1,65 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestIdealSwitchValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve SwitchValve
-                                          annotation (Placement(transformation(
-          extent={{-20,26},{0,46}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
-                                         width=10, period=20)
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2
-                                        annotation (Placement(transformation(
-          extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1
-                                        annotation (Placement(transformation(
-          extent={{20,20},{40,40}}, rotation=0)));
-equation
-  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-39,70},{-10,70},
-          {-10,43}}));
-  connect(SourceP1.C, perteDP2.C1) annotation (Line(points={{-80,30},{-60,30}},
-        color={0,0,255}));
-  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-40,30},{-30,
-          30},{-30,30},{-20,30}},     color={0,0,255}));
-  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{0,30},{20,30}},
-        color={0,0,255}));
-  connect(perteDP1.C2, PuitsP1.C) annotation (Line(points={{40,30},{60,30}},
-        color={0,0,255}));
-  annotation (experiment(StopTime=100),
-   Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestIdealSwitchValve;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestIdealSwitchValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve SwitchValve
+                                          annotation (Placement(transformation(
+          extent={{-20,26},{0,46}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
+                                         width=10, period=20)
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2
+                                        annotation (Placement(transformation(
+          extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1
+                                        annotation (Placement(transformation(
+          extent={{20,20},{40,40}}, rotation=0)));
+equation
+  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-39,70},{-10,70},
+          {-10,43}}));
+  connect(SourceP1.C, perteDP2.C1) annotation (Line(points={{-80,30},{-60,30}},
+        color={0,0,255}));
+  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-40,30},{-30,
+          30},{-30,30},{-20,30}},     color={0,0,255}));
+  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{0,30},{20,30}},
+        color={0,0,255}));
+  connect(perteDP1.C2, PuitsP1.C) annotation (Line(points={{40,30},{60,30}},
+        color={0,0,255}));
+  annotation (experiment(StopTime=100),
+   Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestIdealSwitchValve;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo
index 3f8d7780fedb06bbb73afa6bcb7710649850d50a..296bffbce639e167e0d41c5c011d26d54ba30caa 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo
@@ -1,113 +1,113 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestInternalCombustionEngine
-  import ThermoSysPro;
-
-  parameter Integer NCEL = 7;
-
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
-    Hum=0,
-    Xh=0.25,
-    Xs=0,
-    Xashes=0,
-    Xc=0.75,
-    Xo=0,
-    Xn=0,
-    Q0=0.0676,
-    rho=0.744,
-    LHV=50e6,
-    T0(displayUnit="K") = 299,
-    P0=210300,
-    Vol=100) annotation (Placement(transformation(extent={{-106,-81},{-72,-43}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
-    Xso2=0,
-    Xco2=0,
-    Xh2o=0.005,
-    Xo2=0.23,
-    Q0=1.9627,
-    T0=30 + 273.16,
-    option_temperature=true,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=191000)
-    annotation (Placement(transformation(extent={{111,-79},{73,-45}},rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink(option_temperature=true)
-                                                  annotation (Placement(transformation(
-          extent={{0,44},{44,86}},  rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(
-    Q0=15.3,
-    h0=334.41e3,
-    P0=410000)
-    annotation (Placement(transformation(extent={{-107,-19},{-71,15}},rotation=
-            0)));
-  ThermoSysPro.Fluid.Machines.InternalCombustionEngine alternatingEngine(
-    mechanical_efficiency_type=2,
-    Rmeca_nom=0.41,
-    Coef_Rm_a=-5.4727e-9,
-    Coef_Rm_b=4.9359e-5,
-    Coef_Rm_c=0.30814,
-    Xpth=0.05,
-    MMg=20,
-    DPe=1,
-    RV=6.45,
-    Kc=1.28,
-    Kd=1.33,
-    Wmeca(start=1400e3),
-    Welec(start=1358e3),
-    Wcomb(start=3.4942e6),
-    exc(start=1.8),
-    Gamma=1.2085,
-    Tsf(start=1088.15))
-    annotation (Placement(transformation(extent={{-44,-46},{44,42}})));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Sink_Water1 annotation (Placement(
-        transformation(extent={{75,-19},{111,15}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss
-    annotation (Placement(transformation(extent={{-63,-8},{-51,4}})));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1
-    annotation (Placement(transformation(extent={{51,-9},{65,5}})));
-equation
-  connect(alternatingEngine.Cair, sourceAir.C) annotation (Line(
-      points={{0,-41.6},{0,-62},{73,-62}},
-      color={0,0,0},
-      thickness=1));
-  connect(alternatingEngine.Cfuel, fuelSourcePQ.C) annotation (Line(points={{-30.8,
-          -41.6},{-30.8,-62},{-72,-62}}, color={0,0,0}));
-  connect(SourcePQ_Water.C, singularPressureLoss.C1)
-    annotation (Line(points={{-71,-2},{-63,-2}},
-                                               color={0,0,255}));
-  connect(alternatingEngine.Cws1, singularPressureLoss.C2) annotation (Line(
-        points={{-39.6,-2},{-51,-2}},                     color={0,0,255}));
-  connect(alternatingEngine.Cws2, singularPressureLoss1.C1)
-    annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255}));
-  connect(Sink_Water1.C, singularPressureLoss1.C2)
-    annotation (Line(points={{75,-2},{75,-2},{65,-2}}, color={0,0,255}));
-  connect(alternatingEngine.Cfg, sink.C) annotation (Line(
-      points={{0,37.6},{0,65},{0,65}},
-      color={0,0,0},
-      thickness=1));
-  annotation (         Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestInternalCombustionEngine;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestInternalCombustionEngine
+  import ThermoSysPro;
+
+  parameter Integer NCEL = 7;
+
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(
+    Hum=0,
+    Xh=0.25,
+    Xs=0,
+    Xashes=0,
+    Xc=0.75,
+    Xo=0,
+    Xn=0,
+    Q0=0.0676,
+    rho=0.744,
+    LHV=50e6,
+    T0(displayUnit="K") = 299,
+    P0=210300,
+    Vol=100) annotation (Placement(transformation(extent={{-106,-81},{-72,-43}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(
+    Xso2=0,
+    Xco2=0,
+    Xh2o=0.005,
+    Xo2=0.23,
+    Q0=1.9627,
+    T0=30 + 273.16,
+    option_temperature=true,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=191000)
+    annotation (Placement(transformation(extent={{111,-79},{73,-45}},rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink(option_temperature=true)
+                                                  annotation (Placement(transformation(
+          extent={{0,44},{44,86}},  rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(
+    Q0=15.3,
+    h0=334.41e3,
+    P0=410000)
+    annotation (Placement(transformation(extent={{-107,-19},{-71,15}},rotation=
+            0)));
+  ThermoSysPro.Fluid.Machines.InternalCombustionEngine alternatingEngine(
+    mechanical_efficiency_type=2,
+    Rmeca_nom=0.41,
+    Coef_Rm_a=-5.4727e-9,
+    Coef_Rm_b=4.9359e-5,
+    Coef_Rm_c=0.30814,
+    Xpth=0.05,
+    MMg=20,
+    DPe=1,
+    RV=6.45,
+    Kc=1.28,
+    Kd=1.33,
+    Wmeca(start=1400e3),
+    Welec(start=1358e3),
+    Wcomb(start=3.4942e6),
+    exc(start=1.8),
+    Gamma=1.2085,
+    Tsf(start=1088.15))
+    annotation (Placement(transformation(extent={{-44,-46},{44,42}})));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Sink_Water1 annotation (Placement(
+        transformation(extent={{75,-19},{111,15}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss
+    annotation (Placement(transformation(extent={{-63,-8},{-51,4}})));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1
+    annotation (Placement(transformation(extent={{51,-9},{65,5}})));
+equation
+  connect(alternatingEngine.Cair, sourceAir.C) annotation (Line(
+      points={{0,-41.6},{0,-62},{73,-62}},
+      color={0,0,0},
+      thickness=1));
+  connect(alternatingEngine.Cfuel, fuelSourcePQ.C) annotation (Line(points={{-30.8,
+          -41.6},{-30.8,-62},{-72,-62}}, color={0,0,0}));
+  connect(SourcePQ_Water.C, singularPressureLoss.C1)
+    annotation (Line(points={{-71,-2},{-63,-2}},
+                                               color={0,0,255}));
+  connect(alternatingEngine.Cws1, singularPressureLoss.C2) annotation (Line(
+        points={{-39.6,-2},{-51,-2}},                     color={0,0,255}));
+  connect(alternatingEngine.Cws2, singularPressureLoss1.C1)
+    annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255}));
+  connect(Sink_Water1.C, singularPressureLoss1.C2)
+    annotation (Line(points={{75,-2},{75,-2},{65,-2}}, color={0,0,255}));
+  connect(alternatingEngine.Cfg, sink.C) annotation (Line(
+      points={{0,37.6},{0,65},{0,65}},
+      color={0,0,0},
+      thickness=1));
+  annotation (         Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestInternalCombustionEngine;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo
index 968772cc05a792ed0a88041429c17f815cc42969..e13e489a401594e95ef95b8b7a863c4081b332e8 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo
@@ -1,38 +1,38 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestInvSingularPressureLoss
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ
-    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkQ
-    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss
-    invSingularPressureLoss annotation (Placement(transformation(extent={{-20,0},
-            {0,20}}, rotation=0)));
-equation
-  connect(sourcePQ.C, invSingularPressureLoss.C1) annotation (Line(points={{-60,
-          10},{-20,10}}, color={0,0,255}));
-  connect(invSingularPressureLoss.C2, sinkQ.C) annotation (Line(points={{0,10},
-          {40,10}}, color={0,0,255}));
-annotation(experiment(StopTime=1000), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestInvSingularPressureLoss;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestInvSingularPressureLoss
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ
+    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkQ
+    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss
+    invSingularPressureLoss annotation (Placement(transformation(extent={{-20,0},
+            {0,20}}, rotation=0)));
+equation
+  connect(sourcePQ.C, invSingularPressureLoss.C1) annotation (Line(points={{-60,
+          10},{-20,10}}, color={0,0,255}));
+  connect(invSingularPressureLoss.C2, sinkQ.C) annotation (Line(points={{0,10},
+          {40,10}}, color={0,0,255}));
+annotation(experiment(StopTime=1000), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestInvSingularPressureLoss;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo
index 5f0311344750e2f08a21c8c83f0571d3547fbd8a..534df7e800921fa28d1a81d818dbc7ff1bb88869 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo
@@ -1,115 +1,115 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestJunctions1
-
-  ThermoSysPro.Fluid.Junctions.Splitter2 splitter2
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0=200)
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss annotation (Placement(transformation(extent={{-60,40},
-            {-40,60}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{40,80},
-            {60,100}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{40,0},{
-            60,20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=
-        0.5) annotation (Placement(transformation(extent={{-40,60},{-20,80}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Junctions.Splitter3 splitter3
-    annotation (Placement(transformation(extent={{-20,-60},{0,-40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(Q0=400)
-    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3 annotation (Placement(transformation(extent={{-60,-60},
-            {-40,-40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2
-    annotation (Placement(transformation(extent={{80,-20},{100,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss4 annotation (Placement(transformation(extent={{40,-20},
-            {60,0}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss5 annotation (Placement(transformation(extent={{40,-100},
-            {60,-80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
-        0) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4
-    annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=
-        0) annotation (Placement(transformation(extent={{-40,-80},{-20,-60}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss6 annotation (Placement(transformation(extent={{40,-60},
-            {60,-40}},
-                     rotation=0)));
-equation
-  connect(sourceP.C, singularPressureLoss.C1)
-    annotation (Line(points={{-80,50},{-60,50}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, splitter2.Ce)
-    annotation (Line(points={{-40,50},{-20,50}}, color={0,0,255}));
-  connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,
-          60},{-6,90},{40,90}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sinkP.C)
-    annotation (Line(points={{60,90},{80,90}}, color={0,0,255}));
-  connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,
-          40},{-6,10},{40,10}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, sinkP1.C)
-    annotation (Line(points={{60,10},{80,10}}, color={0,0,255}));
-  connect(constante.y, splitter2.Ialpha1)
-    annotation (Line(points={{-19,70},{-14,70},{-14,56},{-9,56}}));
-  connect(sourceP1.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-80,-50},{-60,-50}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-40,
-          -50},{-19.8,-50}}, color={0,0,255}));
-  connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-6,
-          -40},{-6,-10},{40,-10}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, sinkP2.C)
-    annotation (Line(points={{60,-10},{80,-10}}, color={0,0,255}));
-  connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-6,
-          -60},{-6,-90},{40,-90}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, sinkP3.C)
-    annotation (Line(points={{60,-90},{80,-90}}, color={0,0,255}));
-  connect(constante1.y, splitter3.Ialpha1)
-    annotation (Line(points={{-19,-30},{-14,-30},{-14,-44},{-9,-44}}));
-  connect(splitter3.Ialpha2, constante2.y)
-    annotation (Line(points={{-9,-56},{-14,-56},{-14,-70},{-19,-70}}));
-  connect(splitter3.Cs3, singularPressureLoss6.C1)
-    annotation (Line(points={{0,-50},{40,-50}}, color={0,0,0}));
-  connect(singularPressureLoss6.C2, sinkP4.C)
-    annotation (Line(points={{60,-50},{80,-50}}, color={0,0,0}));
-  annotation (experiment(StopTime=10),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestJunctions1;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestJunctions1
+
+  ThermoSysPro.Fluid.Junctions.Splitter2 splitter2
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0=200)
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss annotation (Placement(transformation(extent={{-60,40},
+            {-40,60}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{40,80},
+            {60,100}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{40,0},{
+            60,20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=
+        0.5) annotation (Placement(transformation(extent={{-40,60},{-20,80}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Junctions.Splitter3 splitter3
+    annotation (Placement(transformation(extent={{-20,-60},{0,-40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(Q0=400)
+    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3 annotation (Placement(transformation(extent={{-60,-60},
+            {-40,-40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2
+    annotation (Placement(transformation(extent={{80,-20},{100,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss4 annotation (Placement(transformation(extent={{40,-20},
+            {60,0}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss5 annotation (Placement(transformation(extent={{40,-100},
+            {60,-80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
+        0) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4
+    annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=
+        0) annotation (Placement(transformation(extent={{-40,-80},{-20,-60}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss6 annotation (Placement(transformation(extent={{40,-60},
+            {60,-40}},
+                     rotation=0)));
+equation
+  connect(sourceP.C, singularPressureLoss.C1)
+    annotation (Line(points={{-80,50},{-60,50}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, splitter2.Ce)
+    annotation (Line(points={{-40,50},{-20,50}}, color={0,0,255}));
+  connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,
+          60},{-6,90},{40,90}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sinkP.C)
+    annotation (Line(points={{60,90},{80,90}}, color={0,0,255}));
+  connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,
+          40},{-6,10},{40,10}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, sinkP1.C)
+    annotation (Line(points={{60,10},{80,10}}, color={0,0,255}));
+  connect(constante.y, splitter2.Ialpha1)
+    annotation (Line(points={{-19,70},{-14,70},{-14,56},{-9,56}}));
+  connect(sourceP1.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-80,-50},{-60,-50}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-40,
+          -50},{-19.8,-50}}, color={0,0,255}));
+  connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-6,
+          -40},{-6,-10},{40,-10}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, sinkP2.C)
+    annotation (Line(points={{60,-10},{80,-10}}, color={0,0,255}));
+  connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-6,
+          -60},{-6,-90},{40,-90}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, sinkP3.C)
+    annotation (Line(points={{60,-90},{80,-90}}, color={0,0,255}));
+  connect(constante1.y, splitter3.Ialpha1)
+    annotation (Line(points={{-19,-30},{-14,-30},{-14,-44},{-9,-44}}));
+  connect(splitter3.Ialpha2, constante2.y)
+    annotation (Line(points={{-9,-56},{-14,-56},{-14,-70},{-19,-70}}));
+  connect(splitter3.Cs3, singularPressureLoss6.C1)
+    annotation (Line(points={{0,-50},{40,-50}}, color={0,0,0}));
+  connect(singularPressureLoss6.C2, sinkP4.C)
+    annotation (Line(points={{60,-50},{80,-50}}, color={0,0,0}));
+  annotation (experiment(StopTime=10),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestJunctions1;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo
index a67ebb006bff2ada7431104c52d94a74e2c05861..c3323ad5711f0d0455239eeae2091e77b2402cfe 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo
@@ -1,131 +1,131 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestJunctions2
-
-  ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1
-    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss annotation (Placement(transformation(extent={{40,60},{
-            60,80}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{-40,80},
-            {-20,100}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-40,40},
-            {-20,60}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Source sourceP
-    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
-    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP
-    annotation (Placement(transformation(extent={{80,60},{100,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0)
-             annotation (Placement(transformation(extent={{-40,60},{-20,80}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2
-    annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3 annotation (Placement(transformation(extent={{40,-60},
-            {60,-40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss4 annotation (Placement(transformation(extent={{-40,-40},
-            {-20,-20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss5 annotation (Placement(transformation(extent={{-40,-80},
-            {-20,-60}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2
-    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
-    annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1
-    annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
-        0.5) annotation (Placement(transformation(extent={{-40,-20},{-20,0}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ
-    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss6 annotation (Placement(transformation(extent={{-40,-60},
-            {-20,-40}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=
-       2) annotation (Placement(transformation(extent={{0,20},{20,40}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ1
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss7 annotation (Placement(transformation(extent={{-40,20},
-            {-20,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss8 annotation (Placement(transformation(extent={{40,20},
-            {60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2
-    annotation (Placement(transformation(extent={{80,20},{100,40}}, rotation=0)));
-equation
-  connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-20,
-          90},{6,90},{6,80}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-20,
-          50},{6,50},{6,60}}, color={0,0,255}));
-  connect(mixer2_1.Cs, singularPressureLoss.C1)
-    annotation (Line(points={{20,70},{40,70}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-60,90},{-40,90}}, color={0,0,255}));
-  connect(sourceP1.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-60,50},{-40,50}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, sinkP.C)
-    annotation (Line(points={{60,70},{80,70}}, color={0,0,255}));
-  connect(constante.y, mixer2_1.Ialpha1)
-    annotation (Line(points={{-19,70},{-8,70},{-8,76},{3,76}}));
-  connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-20,
-          -30},{6,-30},{6,-40}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation (Line(points={{-20,
-          -70},{6,-70},{6,-60}}, color={0,0,255}));
-  connect(mixer2_2.Cs, singularPressureLoss3.C1)
-    annotation (Line(points={{20,-50},{40,-50}}, color={0,0,255}));
-  connect(sourceP2.C, singularPressureLoss4.C1)
-    annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255}));
-  connect(sourceP3.C, singularPressureLoss5.C1)
-    annotation (Line(points={{-60,-70},{-40,-70}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, sinkP1.C)
-    annotation (Line(points={{60,-50},{80,-50}}, color={0,0,255}));
-  connect(sourceQ.C, singularPressureLoss6.C1)
-    annotation (Line(points={{-60,-50},{-40,-50}}, color={0,0,255}));
-  connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation (Line(points={{-20,-50},
-          {-10,-50},{0,-50}},                color={0,0,255}));
-  connect(constante1.y, mixer2_2.Ialpha1)
-    annotation (Line(points={{-19,-10},{-8,-10},{-8,-44},{3,-44}}));
-  connect(sourceQ1.C, singularPressureLoss7.C1)
-    annotation (Line(points={{-60,30},{-40,30}}, color={0,0,255}));
-  connect(singularPressureLoss7.C2, massFlowMultiplier.Ce)
-    annotation (Line(points={{-20,30},{0,30}}, color={0,0,255}));
-  connect(massFlowMultiplier.Cs, singularPressureLoss8.C1)
-    annotation (Line(points={{20,30},{40,30}}, color={0,0,255}));
-  connect(singularPressureLoss8.C2, sinkP2.C)
-    annotation (Line(points={{60,30},{80,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestJunctions2;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestJunctions2
+
+  ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1
+    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss annotation (Placement(transformation(extent={{40,60},{
+            60,80}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{-40,80},
+            {-20,100}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-40,40},
+            {-20,60}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Source sourceP
+    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1
+    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP
+    annotation (Placement(transformation(extent={{80,60},{100,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0)
+             annotation (Placement(transformation(extent={{-40,60},{-20,80}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2
+    annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3 annotation (Placement(transformation(extent={{40,-60},
+            {60,-40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss4 annotation (Placement(transformation(extent={{-40,-40},
+            {-20,-20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss5 annotation (Placement(transformation(extent={{-40,-80},
+            {-20,-60}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2
+    annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
+    annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1
+    annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=
+        0.5) annotation (Placement(transformation(extent={{-40,-20},{-20,0}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ
+    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss6 annotation (Placement(transformation(extent={{-40,-60},
+            {-20,-40}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(alpha=
+       2) annotation (Placement(transformation(extent={{0,20},{20,40}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ1
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss7 annotation (Placement(transformation(extent={{-40,20},
+            {-20,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss8 annotation (Placement(transformation(extent={{40,20},
+            {60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2
+    annotation (Placement(transformation(extent={{80,20},{100,40}}, rotation=0)));
+equation
+  connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-20,
+          90},{6,90},{6,80}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-20,
+          50},{6,50},{6,60}}, color={0,0,255}));
+  connect(mixer2_1.Cs, singularPressureLoss.C1)
+    annotation (Line(points={{20,70},{40,70}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-60,90},{-40,90}}, color={0,0,255}));
+  connect(sourceP1.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-60,50},{-40,50}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, sinkP.C)
+    annotation (Line(points={{60,70},{80,70}}, color={0,0,255}));
+  connect(constante.y, mixer2_1.Ialpha1)
+    annotation (Line(points={{-19,70},{-8,70},{-8,76},{3,76}}));
+  connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-20,
+          -30},{6,-30},{6,-40}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation (Line(points={{-20,
+          -70},{6,-70},{6,-60}}, color={0,0,255}));
+  connect(mixer2_2.Cs, singularPressureLoss3.C1)
+    annotation (Line(points={{20,-50},{40,-50}}, color={0,0,255}));
+  connect(sourceP2.C, singularPressureLoss4.C1)
+    annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255}));
+  connect(sourceP3.C, singularPressureLoss5.C1)
+    annotation (Line(points={{-60,-70},{-40,-70}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, sinkP1.C)
+    annotation (Line(points={{60,-50},{80,-50}}, color={0,0,255}));
+  connect(sourceQ.C, singularPressureLoss6.C1)
+    annotation (Line(points={{-60,-50},{-40,-50}}, color={0,0,255}));
+  connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation (Line(points={{-20,-50},
+          {-10,-50},{0,-50}},                color={0,0,255}));
+  connect(constante1.y, mixer2_2.Ialpha1)
+    annotation (Line(points={{-19,-10},{-8,-10},{-8,-44},{3,-44}}));
+  connect(sourceQ1.C, singularPressureLoss7.C1)
+    annotation (Line(points={{-60,30},{-40,30}}, color={0,0,255}));
+  connect(singularPressureLoss7.C2, massFlowMultiplier.Ce)
+    annotation (Line(points={{-20,30},{0,30}}, color={0,0,255}));
+  connect(massFlowMultiplier.Cs, singularPressureLoss8.C1)
+    annotation (Line(points={{20,30},{40,30}}, color={0,0,255}));
+  connect(singularPressureLoss8.C2, sinkP2.C)
+    annotation (Line(points={{60,30},{80,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestJunctions2;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo
index 26d7e1bb2ffeae060ed4d6008eea8f18986ddfe0..78e596ddd3103911535201644b8059df3b27740c 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo
@@ -1,121 +1,121 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestJunctions3
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
-                                           annotation (Placement(transformation(
-          extent={{-104,0},{-84,20}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(                 P0=2e5, Q(start=
-          323.48244470861454))
-    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve valve1(
-    C2(h_vol_1(start=70977.89042837733)),
-    Pm(start=120690.8728732298),
-    C1(
-      h_vol_1(start=71016.12237181116),
-      Xco2(start=4.2755644765396636E-32),
-      Xso2(start=2.0610804919205873E-32),
-      h_vol_2(start=70977.89042837733),
-      Xh2o(start=1.4925957069001078E-32),
-      Xo2(start=1.8180778675015506E-31)))
-    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve valve2(C1(h_vol_1(start=
-            70921.01678153824),
-      Xco2(start=7.395570986446986E-32),
-      Xh2o(start=1.9721522630525295E-31),
-      Xo2(start=1.9721522630525295E-31),
-      Xso2(start=6.998299036616324E-32)),
-                                 Pm(start=118970.64778985853))
-    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve valve3(Q(start=
-          804.6933031325926), Pm(start=108776.21727782265),
-    C1(
-      Xco2(start=3.4137108264263755E-31),
-      Xo2(start=1.9413373839423337E-31),
-      Xso2(start=1.7792131856876708E-31),
-      Xh2o(start=2.3303752327085554E-31)))
-    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2
-                                          annotation (Placement(transformation(
-          extent={{82,-30},{102,-10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
-    Duration=1,
-    Initialvalue=1,
-    Finalvalue=0.05)
-                  annotation (Placement(transformation(extent={{32,20},{52,40}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
-                                    Initialvalue=1,
-    Starttime=2,
-    Finalvalue=0.001)
-    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(
-                                    Initialvalue=1,
-    Starttime=1,
-    Finalvalue=0.001)
-    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe1
-    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe2
-    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume
-    annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1
-    annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2
-    annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation=
-           0)));
-equation
-  connect(valve3.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
-          -20}}, color={0,0,255}));
-  connect(rampe2.y, valve3.Ouv)
-    annotation (Line(points={{53,30},{60,30},{60,-3}}));
-  connect(rampe3.y, valve1.Ouv)         annotation (Line(points={{-9,40},{0,40},
-          {0,27}}));
-  connect(rampe4.y, valve2.Ouv)         annotation (Line(points={{-9,-20},{0,
-          -20},{0,-33}}));
-  connect(sourceP.C, pipe1.C1)
-    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
-  connect(sourceP1.C, pipe2.C1)
-    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
-  connect(pipe1.C2, staticVolume.Ce4) annotation (Line(points={{-60,10},{-50,10},
-          {-50,14},{-40.2,14}}, color={0,0,255}));
-  connect(staticVolume.Cs, valve1.C1) annotation (Line(points={{-20,10},{-10,10}},
-        color={0,0,255}));
-  connect(staticVolume1.Cs, valve3.C1) annotation (Line(points={{40,-20},{50,
-          -20}}, color={0,0,255}));
-  connect(valve1.C2, staticVolume1.Ce1) annotation (Line(points={{10,10},{33,10},
-          {33,-9.8}}, color={0,0,255}));
-  connect(valve2.C2, staticVolume1.Ce8) annotation (Line(points={{10,-50},{33,
-          -50},{33,-29.9}}, color={0,0,255}));
-  connect(pipe2.C2, staticVolume2.Ce4) annotation (Line(points={{-60,-50},{-50,
-          -50},{-50,-46},{-40.2,-46}}, color={0,0,255}));
-  connect(staticVolume2.Cs, valve2.C1) annotation (Line(points={{-20,-50},{-10,
-          -50}}, color={0,0,255}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestJunctions3;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestJunctions3
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
+                                           annotation (Placement(transformation(
+          extent={{-104,0},{-84,20}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(                 P0=2e5, Q(start=
+          323.48244470861454))
+    annotation (Placement(transformation(extent={{-104,-60},{-84,-40}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve valve1(
+    C2(h_vol_1(start=70977.89042837733)),
+    Pm(start=120690.8728732298),
+    C1(
+      h_vol_1(start=71016.12237181116),
+      Xco2(start=4.2755644765396636E-32),
+      Xso2(start=2.0610804919205873E-32),
+      h_vol_2(start=70977.89042837733),
+      Xh2o(start=1.4925957069001078E-32),
+      Xo2(start=1.8180778675015506E-31)))
+    annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve valve2(C1(h_vol_1(start=
+            70921.01678153824),
+      Xco2(start=7.395570986446986E-32),
+      Xh2o(start=1.9721522630525295E-31),
+      Xo2(start=1.9721522630525295E-31),
+      Xso2(start=6.998299036616324E-32)),
+                                 Pm(start=118970.64778985853))
+    annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve valve3(Q(start=
+          804.6933031325926), Pm(start=108776.21727782265),
+    C1(
+      Xco2(start=3.4137108264263755E-31),
+      Xo2(start=1.9413373839423337E-31),
+      Xso2(start=1.7792131856876708E-31),
+      Xh2o(start=2.3303752327085554E-31)))
+    annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2
+                                          annotation (Placement(transformation(
+          extent={{82,-30},{102,-10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(
+    Duration=1,
+    Initialvalue=1,
+    Finalvalue=0.05)
+                  annotation (Placement(transformation(extent={{32,20},{52,40}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(
+                                    Initialvalue=1,
+    Starttime=2,
+    Finalvalue=0.001)
+    annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(
+                                    Initialvalue=1,
+    Starttime=1,
+    Finalvalue=0.001)
+    annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe1
+    annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe2
+    annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume
+    annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1
+    annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2
+    annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation=
+           0)));
+equation
+  connect(valve3.C2, puitsP2.C)         annotation (Line(points={{70,-20},{82,
+          -20}}, color={0,0,255}));
+  connect(rampe2.y, valve3.Ouv)
+    annotation (Line(points={{53,30},{60,30},{60,-3}}));
+  connect(rampe3.y, valve1.Ouv)         annotation (Line(points={{-9,40},{0,40},
+          {0,27}}));
+  connect(rampe4.y, valve2.Ouv)         annotation (Line(points={{-9,-20},{0,
+          -20},{0,-33}}));
+  connect(sourceP.C, pipe1.C1)
+    annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255}));
+  connect(sourceP1.C, pipe2.C1)
+    annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255}));
+  connect(pipe1.C2, staticVolume.Ce4) annotation (Line(points={{-60,10},{-50,10},
+          {-50,14},{-40.2,14}}, color={0,0,255}));
+  connect(staticVolume.Cs, valve1.C1) annotation (Line(points={{-20,10},{-10,10}},
+        color={0,0,255}));
+  connect(staticVolume1.Cs, valve3.C1) annotation (Line(points={{40,-20},{50,
+          -20}}, color={0,0,255}));
+  connect(valve1.C2, staticVolume1.Ce1) annotation (Line(points={{10,10},{33,10},
+          {33,-9.8}}, color={0,0,255}));
+  connect(valve2.C2, staticVolume1.Ce8) annotation (Line(points={{10,-50},{33,
+          -50},{33,-29.9}}, color={0,0,255}));
+  connect(pipe2.C2, staticVolume2.Ce4) annotation (Line(points={{-60,-50},{-50,
+          -50},{-50,-46},{-40.2,-46}}, color={0,0,255}));
+  connect(staticVolume2.Cs, valve2.C1) annotation (Line(points={{-20,-50},{-10,
+          -50}}, color={0,0,255}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestJunctions3;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo
index f306d70de52665629714e60f9addc25c99bba06b..08d23dcfad6b725a5fa88f94195e30f5fc116646 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo
@@ -1,59 +1,59 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestJunctions4
-
-  ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(Tmax=308)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss annotation (Placement(transformation(extent={{-60,20},
-            {-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
-            {40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,-20},
-            {-40,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(T0=310)
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Source source(h0=30000)
-    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
-            0)));
-equation
-  connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points=
-         {{-40,30},{-30,30},{-30,36},{-20,36}}, color={0,0,255}));
-  connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(
-        points={{0,36},{10,36},{10,30},{20,30}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(
-        points={{-40,-10},{-9.9,-10},{-9.9,20}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss.C1)
-    annotation (Line(points={{-80,30},{-60,30}}, color={0,0,255}));
-  connect(source.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-80,-10},{-60,-10}}, color={0,0,255}));
-  annotation (experiment(StopTime=10), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestJunctions4;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestJunctions4
+
+  ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(Tmax=308)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss annotation (Placement(transformation(extent={{-60,20},
+            {-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
+            {40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,-20},
+            {-40,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(T0=310)
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Source source(h0=30000)
+    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
+            0)));
+equation
+  connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points=
+         {{-40,30},{-30,30},{-30,36},{-20,36}}, color={0,0,255}));
+  connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(
+        points={{0,36},{10,36},{10,30},{20,30}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(
+        points={{-40,-10},{-9.9,-10},{-9.9,20}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss.C1)
+    annotation (Line(points={{-80,30},{-60,30}}, color={0,0,255}));
+  connect(source.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-80,-10},{-60,-10}}, color={0,0,255}));
+  annotation (experiment(StopTime=10), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestJunctions4;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo
index e2476ec422cc86217eff1677349546c7030f61be..3e01a6e1cbbcae73cb5860f9460270239ec2aa91 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo
@@ -1,73 +1,73 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestLoopBreaker
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2
-    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1 annotation (Placement(
-        transformation(extent={{-56,0},{-36,20}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1 annotation (Placement(transformation(
-          extent={{40,0},{60,20}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
-          extent={{80,0},{100,20}}, rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5)
-    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
-  ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP
-    annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0)));
-equation
-  connect(sourcePQ.C, splitter2_1.Ce) annotation (Line(
-      points={{-80,10},{-56,10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line(
-      points={{-42,20},{-42,30},{-20,30}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line(
-      points={{-42,0},{-42,-10},{-20,-10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(mixer2_1.Ce1, singularPressureLoss1.C2)
-    annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None));
-  connect(mixer2_1.Cs, sink.C) annotation (Line(
-      points={{60,10},{80,10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(constante.y, splitter2_1.Ialpha1)
-    annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=
-          Smooth.None));
-  connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line(
-      points={{0,-10},{10,-10}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line(
-      points={{30,-10},{46,-10},{46,0}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestLoopBreaker;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestLoopBreaker
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2
+    annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1 annotation (Placement(
+        transformation(extent={{-56,0},{-36,20}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1 annotation (Placement(transformation(
+          extent={{40,0},{60,20}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation(
+          extent={{80,0},{100,20}}, rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5)
+    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
+  ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP
+    annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0)));
+equation
+  connect(sourcePQ.C, splitter2_1.Ce) annotation (Line(
+      points={{-80,10},{-56,10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line(
+      points={{-42,20},{-42,30},{-20,30}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line(
+      points={{-42,0},{-42,-10},{-20,-10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(mixer2_1.Ce1, singularPressureLoss1.C2)
+    annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None));
+  connect(mixer2_1.Cs, sink.C) annotation (Line(
+      points={{60,10},{80,10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(constante.y, splitter2_1.Ialpha1)
+    annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=
+          Smooth.None));
+  connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line(
+      points={{0,-10},{10,-10}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line(
+      points={{30,-10},{46,-10},{46,0}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestLoopBreaker;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo
index d94f87921486da774dcf5b2b4afe03f86b13abec..81efb0a726e60dc348bf874a968385350412991b 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo
@@ -1,47 +1,47 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestMassFlowMultiplier
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss annotation (Placement(transformation(extent={{-60,0},{
-            -40,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{20,0},{
-            40,20}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier
-    annotation (Placement(transformation(extent={{-20,0},{0,20}}, rotation=0)));
-equation
-  connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-80,10},
-          {-60,10}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{40,10},{
-          60,10}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(
-        points={{-40,10},{-20,10}}, color={0,0,255}));
-  connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(
-        points={{0,10},{20,10}}, color={0,0,255}));
-annotation(experiment(StopTime=1000), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestMassFlowMultiplier;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestMassFlowMultiplier
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss annotation (Placement(transformation(extent={{-60,0},{
+            -40,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{20,0},{
+            40,20}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier
+    annotation (Placement(transformation(extent={{-20,0},{0,20}}, rotation=0)));
+equation
+  connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-80,10},
+          {-60,10}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{40,10},{
+          60,10}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(
+        points={{-40,10},{-20,10}}, color={0,0,255}));
+  connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(
+        points={{0,10},{20,10}}, color={0,0,255}));
+annotation(experiment(StopTime=1000), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestMassFlowMultiplier;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo
index ad344e18c1627e4235c24e4764806d0254edd2dd..63364a2158019e57f3b09883d442277b2b3526a1 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo
@@ -1,105 +1,105 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestNTUWaterHeater0
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_condenseur(
-    P0=80.0e5,
-    Q0=1780,
-    h0=872.0e3)
-          annotation (Placement(transformation(extent={{-182,-10},{-162,10}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur(C(h(start=
-            980281.0129225359)))
-             annotation (Placement(transformation(extent={{152,-10},{172,10}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    P0=27.e5,
-    h0=2.6e6,
-    C(h_vol_2(start=883556.9736276601)),
-    Q(start=112.29047515166533))
-            annotation (Placement(transformation(extent={{-182,90},{-162,110}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2(K=1e-4, C2(P(start=7999999.633732218)))
-                          annotation (Placement(transformation(extent={{-106,
-            -10},{-86,10}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1e-4)
-                          annotation (Placement(transformation(extent={{-106,90},
-            {-86,110}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{152,-106},{172,-86}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4,
-    C1(P(start=7618062.482445708)),
-    rho(start=834.862478836879))
-                          annotation (Placement(transformation(extent={{92,-10},
-            {112,10}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4, rho(start=857.3159873035071))
-                          annotation (Placement(transformation(extent={{34,-106},
-            {54,-86}}, rotation=0)));
-
-  ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating(
-    lambdaE=102.5,
-    SCondDes=6314,
-    KCond=5024,
-    SPurge=656,
-    KPurge=1767,
-    HeiF(start=878162.3337936474),
-    HDesF(start=980281.0129225359),
-    Hep(start=981240.7187349163),
-    Ee(h_vol_2(start=880000), Q(start=1800), h(start=880000), P(start=80e5)),
-    Ev(h_vol_1(start=3500000), P(start=27e5)),
-    Ep(Q(start=10)),
-    Se(P(start=80e5)),
-    SDes(start=1E-09),
-    continuous_flow_reversal=true)
-                        annotation (Placement(transformation(extent={{-44,-52},
-            {64,54}}, rotation=0)));
-equation
-  connect(Source_condenseur.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-162,0},{-106,0}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-162,100},{-106,100}},
-                                                   color={0,0,255}));
-  connect(singularPressureLoss4.C2, Puit_condenseur.C)
-    annotation (Line(points={{112,0},{152,0}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
-    annotation (Line(points={{54,-96},{152,-96}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation (Line(points={{-86,100},
-          {42.4,100},{42.4,19.02}},         color={0,0,255}));
-  connect(nTUWaterHeating.Se, singularPressureLoss4.C1)
-    annotation (Line(points={{64,1},{68,1},{68,0},{92,0}},
-                                             color={0,0,255}));
-  connect(singularPressureLoss2.C2, nTUWaterHeating.Ee)
-    annotation (Line(points={{-86,0},{-44,0},{-44,1}},
-                                                  color={0,0,255}));
-  connect(singularPressureLoss5.C1, nTUWaterHeating.Sp)
-    annotation (Line(points={{34,-96},{-18,-96},{-18,-16.49},{-22.4,-16.49}}));
-    annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestNTUWaterHeater0;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestNTUWaterHeater0
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_condenseur(
+    P0=80.0e5,
+    Q0=1780,
+    h0=872.0e3)
+          annotation (Placement(transformation(extent={{-182,-10},{-162,10}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur(C(h(start=
+            980281.0129225359)))
+             annotation (Placement(transformation(extent={{152,-10},{172,10}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    P0=27.e5,
+    h0=2.6e6,
+    C(h_vol_2(start=883556.9736276601)),
+    Q(start=112.29047515166533))
+            annotation (Placement(transformation(extent={{-182,90},{-162,110}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2(K=1e-4, C2(P(start=7999999.633732218)))
+                          annotation (Placement(transformation(extent={{-106,
+            -10},{-86,10}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1e-4)
+                          annotation (Placement(transformation(extent={{-106,90},
+            {-86,110}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{152,-106},{172,-86}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4,
+    C1(P(start=7618062.482445708)),
+    rho(start=834.862478836879))
+                          annotation (Placement(transformation(extent={{92,-10},
+            {112,10}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4, rho(start=857.3159873035071))
+                          annotation (Placement(transformation(extent={{34,-106},
+            {54,-86}}, rotation=0)));
+
+  ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating(
+    lambdaE=102.5,
+    SCondDes=6314,
+    KCond=5024,
+    SPurge=656,
+    KPurge=1767,
+    HeiF(start=878162.3337936474),
+    HDesF(start=980281.0129225359),
+    Hep(start=981240.7187349163),
+    Ee(h_vol_2(start=880000), Q(start=1800), h(start=880000), P(start=80e5)),
+    Ev(h_vol_1(start=3500000), P(start=27e5)),
+    Ep(Q(start=10)),
+    Se(P(start=80e5)),
+    SDes(start=1E-09),
+    continuous_flow_reversal=true)
+                        annotation (Placement(transformation(extent={{-44,-52},
+            {64,54}}, rotation=0)));
+equation
+  connect(Source_condenseur.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-162,0},{-106,0}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-162,100},{-106,100}},
+                                                   color={0,0,255}));
+  connect(singularPressureLoss4.C2, Puit_condenseur.C)
+    annotation (Line(points={{112,0},{152,0}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
+    annotation (Line(points={{54,-96},{152,-96}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation (Line(points={{-86,100},
+          {42.4,100},{42.4,19.02}},         color={0,0,255}));
+  connect(nTUWaterHeating.Se, singularPressureLoss4.C1)
+    annotation (Line(points={{64,1},{68,1},{68,0},{92,0}},
+                                             color={0,0,255}));
+  connect(singularPressureLoss2.C2, nTUWaterHeating.Ee)
+    annotation (Line(points={{-86,0},{-44,0},{-44,1}},
+                                                  color={0,0,255}));
+  connect(singularPressureLoss5.C1, nTUWaterHeating.Sp)
+    annotation (Line(points={{34,-96},{-18,-96},{-18,-16.49},{-22.4,-16.49}}));
+    annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestNTUWaterHeater0;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo
index 64ac90242144a50d1f649f9d2ca4a8d83a1a1be8..f8d6f8e5297d5d5db8d2d859dbb61961e11bb22c 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo
@@ -1,93 +1,93 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestPostCombustionGas
-  import ThermoSysPro;
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2
-    annotation (Placement(transformation(
-        origin={151,-6},
-        extent={{23,-24},{-23,24}},
-        rotation=180)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2(
-    Xso2=0,
-    Xco2=0.0,
-    Xo2=0.23,
-    Xh2o=0.01,
-    P0=15e5,
-    Q0=415,
-    T0=680,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-174,-30},{-128,18}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ  sourcePQ2(
-    h0=300e3,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    Q0=10)
-    annotation (Placement(transformation(extent={{-172,68},{-132,108}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(
-    Hum=0,
-    Xo=0,
-    Xn=0,
-    Xs=0,
-    rho=0.838,
-    Xc=0.755,
-    Xh=0.245,
-    Cp=2255,
-    T0=410,
-    Q0=9.30,
-    LHV=47500e3) annotation (Placement(transformation(extent={{-107,-109},{-71,
-            -73}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.Combustion.CombustionChambers.PostCombustionGas
-    postCombustionGas
-    annotation (Placement(transformation(extent={{-52,-74},{74,50}})));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss
-    annotation (Placement(transformation(extent={{-100,78},{-80,98}})));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1
-    annotation (Placement(transformation(extent={{-102,-16},{-82,4}})));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2
-    annotation (Placement(transformation(extent={{90,-16},{110,4}})));
-equation
-  connect(sourceCombustible2.C, postCombustionGas.Cfuel) annotation (Line(
-        points={{-71,-91},{-7.9,-91},{-7.9,-67.8}}, color={0,0,0}));
-  connect(sourcePQ2.C, singularPressureLoss.C1)
-    annotation (Line(points={{-132,88},{-100,88}}, color={0,0,0}));
-  connect(singularPressureLoss.C2, postCombustionGas.Ca) annotation (Line(
-        points={{-80,88},{-20.5,88},{-20.5,43.8}}, color={0,0,0}));
-  connect(Source_Fumees2.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-128,-6},{-102,-6}}, color={0,0,0}));
-  connect(singularPressureLoss1.C2, postCombustionGas.Cfg1) annotation (Line(
-        points={{-82,-6},{-64,-6},{-64,-5.8},{-45.7,-5.8}}, color={0,0,0}));
-  connect(postCombustionGas.Cfg2, singularPressureLoss2.C1) annotation (Line(
-        points={{67.7,-5.8},{79.85,-5.8},{79.85,-6},{90,-6}}, color={0,0,0}));
-  connect(singularPressureLoss2.C2, Puits_Fumees2.C)
-    annotation (Line(points={{110,-6},{128,-6}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1)), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestPostCombustionGas;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestPostCombustionGas
+  import ThermoSysPro;
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2
+    annotation (Placement(transformation(
+        origin={151,-6},
+        extent={{23,-24},{-23,24}},
+        rotation=180)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2(
+    Xso2=0,
+    Xco2=0.0,
+    Xo2=0.23,
+    Xh2o=0.01,
+    P0=15e5,
+    Q0=415,
+    T0=680,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-174,-30},{-128,18}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ  sourcePQ2(
+    h0=300e3,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    Q0=10)
+    annotation (Placement(transformation(extent={{-172,68},{-132,108}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(
+    Hum=0,
+    Xo=0,
+    Xn=0,
+    Xs=0,
+    rho=0.838,
+    Xc=0.755,
+    Xh=0.245,
+    Cp=2255,
+    T0=410,
+    Q0=9.30,
+    LHV=47500e3) annotation (Placement(transformation(extent={{-107,-109},{-71,
+            -73}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.Combustion.CombustionChambers.PostCombustionGas
+    postCombustionGas
+    annotation (Placement(transformation(extent={{-52,-74},{74,50}})));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss
+    annotation (Placement(transformation(extent={{-100,78},{-80,98}})));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1
+    annotation (Placement(transformation(extent={{-102,-16},{-82,4}})));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2
+    annotation (Placement(transformation(extent={{90,-16},{110,4}})));
+equation
+  connect(sourceCombustible2.C, postCombustionGas.Cfuel) annotation (Line(
+        points={{-71,-91},{-7.9,-91},{-7.9,-67.8}}, color={0,0,0}));
+  connect(sourcePQ2.C, singularPressureLoss.C1)
+    annotation (Line(points={{-132,88},{-100,88}}, color={0,0,0}));
+  connect(singularPressureLoss.C2, postCombustionGas.Ca) annotation (Line(
+        points={{-80,88},{-20.5,88},{-20.5,43.8}}, color={0,0,0}));
+  connect(Source_Fumees2.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-128,-6},{-102,-6}}, color={0,0,0}));
+  connect(singularPressureLoss1.C2, postCombustionGas.Cfg1) annotation (Line(
+        points={{-82,-6},{-64,-6},{-64,-5.8},{-45.7,-5.8}}, color={0,0,0}));
+  connect(postCombustionGas.Cfg2, singularPressureLoss2.C1) annotation (Line(
+        points={{67.7,-5.8},{79.85,-5.8},{79.85,-6},{90,-6}}, color={0,0,0}));
+  connect(singularPressureLoss2.C2, Puits_Fumees2.C)
+    annotation (Line(points={{110,-6},{128,-6}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1)), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestPostCombustionGas;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo
index 4e77869cb15a150be96c428446c6fd3d8017708d..a6fff725ce85b2cb8f8786a2c128c6f7ad69eb5a 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo
@@ -1,149 +1,149 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestPressurizer
-
-  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
-    "Power released by the electrical heaters";
-  parameter Real OUVfeedwaterValve( fixed=false)=0.01
-    "OUV feed water valve";
-
-  ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve(
-    Cv(start=100),
-    C1(
-      P(start=160e5),
-      h_vol_1(start=1270e3),
-      Q(start=0.3),
-      h(start=1270e3)),
-    Q(fixed=false, start=0.32),
-    Cvmax=5000)      annotation (Placement(transformation(extent={{-110,130},{
-            -90,150}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(
-    Cv(start=25000),
-    Cvmax(fixed=true) = 5000,
-    Pm(start=15500000))
-    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvFeedwaterValve1(k=
-        OUVfeedwaterValve)
-    annotation (Placement(transformation(extent={{-140,176},{-120,196}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
-    L=1,
-    D=1,
-    z1=1,
-    z2=0,
-    C1(P(start=160e5)),
-    C2(P(start=160e5)),
-    Q(fixed=false, start=0))
-             annotation (Placement(transformation(
-        origin={-30,-42},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed=
-          true) = 0.5) annotation (Placement(transformation(extent={{0,176},{20,
-            196}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    h0=1270e3,
-    P0=160e5)
-           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
-    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer(
-    Zm=10.15,
-    Klv=0.5e6,
-    cpp=600,
-    hl(start=1629887.98290107),
-    hv(start=2596216.59571565),
-    Zl(start=5.5900717167325),
-    Yw0=60,
-    V=61.12,
-    Rp=1.27,
-    Ae=96.23,
-    Klp=1780,
-    Kvp=7500,
-    Mp=107e3,
-    Kpa=5.63,
-    Ccond=0.02,
-    Cevap=0.05,
-    Yw(start=32.92),
-    y(start=0.3292, fixed=true),
-    P0=15500000,
-    P(start=15500000, fixed=true),
-    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
-            -12},{32,118}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
-           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
-          rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
-    option_temperature=2,
-    T0={310},
-    W0={Wch})
-    annotation (Placement(transformation(
-        origin={-133,32},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
-    T0={310},
-    W0={0.286e6},
-    option_temperature=1)
-    annotation (Placement(transformation(
-        origin={-133,55},
-        extent={{-17,17},{17,-17}},
-        rotation=270)));
-equation
-  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(points={{-148,134},{
-          -110,134}}, color={0,0,255}));
-  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
-        color={0,0,255}));
-  connect(OuvSteamrValve.y, SteamValve.Ouv)
-    annotation (Line(points={{21,186},{68,186},{68,151}}));
-  connect(FeedwaterValve.C2, pressurizer.Cas) annotation (Line(points={{-90,134},
-          {-30,134},{-30,118}}, color={0,0,255}));
-  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
-          32,134},{58,134}}, color={0,0,255}));
-  connect(sinkQ1.C, lumpedStraightPipe.C2)
-    annotation (Line(points={{-30,-66},{-30,-52}}));
-  connect(lumpedStraightPipe.C1, pressurizer.Cex)
-    annotation (Line(points={{-30,-32},{-30,-12}}));
-  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
-          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
-  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
-          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
-  connect(OuvFeedwaterValve1.y, FeedwaterValve.Ouv) annotation (Line(points={{
-          -119,186},{-100,186},{-100,151}}, color={0,0,255}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    experiment(StopTime=1000));
-end TestPressurizer;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestPressurizer
+
+  parameter Units.SI.Power Wch(fixed=false) = 0.29e6
+    "Power released by the electrical heaters";
+  parameter Real OUVfeedwaterValve( fixed=false)=0.01
+    "OUV feed water valve";
+
+  ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve(
+    Cv(start=100),
+    C1(
+      P(start=160e5),
+      h_vol_1(start=1270e3),
+      Q(start=0.3),
+      h(start=1270e3)),
+    Q(fixed=false, start=0.32),
+    Cvmax=5000)      annotation (Placement(transformation(extent={{-110,130},{
+            -90,150}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(
+    Cv(start=25000),
+    Cvmax(fixed=true) = 5000,
+    Pm(start=15500000))
+    annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvFeedwaterValve1(k=
+        OUVfeedwaterValve)
+    annotation (Placement(transformation(extent={{-140,176},{-120,196}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(
+    L=1,
+    D=1,
+    z1=1,
+    z2=0,
+    C1(P(start=160e5)),
+    C2(P(start=160e5)),
+    Q(fixed=false, start=0))
+             annotation (Placement(transformation(
+        origin={-30,-42},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed=
+          true) = 0.5) annotation (Placement(transformation(extent={{0,176},{20,
+            196}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    h0=1270e3,
+    P0=160e5)
+           annotation (Placement(transformation(extent={{-168,124},{-148,144}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6)
+    annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer(
+    Zm=10.15,
+    Klv=0.5e6,
+    cpp=600,
+    hl(start=1629887.98290107),
+    hv(start=2596216.59571565),
+    Zl(start=5.5900717167325),
+    Yw0=60,
+    V=61.12,
+    Rp=1.27,
+    Ae=96.23,
+    Klp=1780,
+    Kvp=7500,
+    Mp=107e3,
+    Kpa=5.63,
+    Ccond=0.02,
+    Cevap=0.05,
+    Yw(start=32.92),
+    y(start=0.3292, fixed=true),
+    P0=15500000,
+    P(start=15500000, fixed=true),
+    Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92,
+            -12},{32,118}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1(            Q0=0, h0=1600000)
+           annotation (Placement(transformation(extent={{-30,-76},{-10,-56}},
+          rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(
+    option_temperature=2,
+    T0={310},
+    W0={Wch})
+    annotation (Placement(transformation(
+        origin={-133,32},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(
+    T0={310},
+    W0={0.286e6},
+    option_temperature=1)
+    annotation (Placement(transformation(
+        origin={-133,55},
+        extent={{-17,17},{17,-17}},
+        rotation=270)));
+equation
+  connect(sourceP.C, FeedwaterValve.C1)  annotation (Line(points={{-148,134},{
+          -110,134}}, color={0,0,255}));
+  connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}},
+        color={0,0,255}));
+  connect(OuvSteamrValve.y, SteamValve.Ouv)
+    annotation (Line(points={{21,186},{68,186},{68,151}}));
+  connect(FeedwaterValve.C2, pressurizer.Cas) annotation (Line(points={{-90,134},
+          {-30,134},{-30,118}}, color={0,0,255}));
+  connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{
+          32,134},{58,134}}, color={0,0,255}));
+  connect(sinkQ1.C, lumpedStraightPipe.C2)
+    annotation (Line(points={{-30,-66},{-30,-52}}));
+  connect(lumpedStraightPipe.C1, pressurizer.Cex)
+    annotation (Line(points={{-30,-32},{-30,-12}}));
+  connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55},
+          {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0}));
+  connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32},
+          {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0}));
+  connect(OuvFeedwaterValve1.y, FeedwaterValve.Ouv) annotation (Line(points={{
+          -119,186},{-100,186},{-100,151}}, color={0,0,255}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    experiment(StopTime=1000));
+end TestPressurizer;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo
index 710b2ccf8583216a669a06f5b613f1428d618db3..5681e0b5ca69a3daf949779a41b98d087b0c28b8 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo
@@ -1,62 +1,62 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestRefP
-
-  ThermoSysPro.Fluid.BoundaryConditions.RefP refP
-    annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(
-                                                 k=2.e5)
-    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump
-    annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0)));
-  ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ
-    annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0)));
-  ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH
-    annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.RefT refT
-    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe
-    annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0)));
-  Volumes.VolumeA volumeA(dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{10,-30},{-10,-10}})));
-equation
-  connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color=
-          {0,0,255}));
-  connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color=
-          {0,0,255}));
-  connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,
-          70},{-60,34},{-80,34},{-80,21}}));
-  connect(pump.C2, loopBreakerQ.C1)
-    annotation (Line(points={{-10,10},{0,10}}, color={0,0,255}));
-  connect(loopBreakerQ.C2, loopBreakerH.C1)
-    annotation (Line(points={{20,10},{30,10}}, color={0,0,255}));
-  connect(loopBreakerH.C2, lumpedStraightPipe.C1)
-    annotation (Line(points={{50,10},{60,10}}, color={0,0,255}));
-  connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{80,10},
-          {100,10},{100,-20},{10,-20}}, color={0,0,0}));
-  connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{
-          -100,10},{-90,10}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestRefP;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestRefP
+
+  ThermoSysPro.Fluid.BoundaryConditions.RefP refP
+    annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(
+                                                 k=2.e5)
+    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump
+    annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0)));
+  ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ
+    annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0)));
+  ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH
+    annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.RefT refT
+    annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe
+    annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0)));
+  Volumes.VolumeA volumeA(dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{10,-30},{-10,-10}})));
+equation
+  connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color=
+          {0,0,255}));
+  connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color=
+          {0,0,255}));
+  connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,
+          70},{-60,34},{-80,34},{-80,21}}));
+  connect(pump.C2, loopBreakerQ.C1)
+    annotation (Line(points={{-10,10},{0,10}}, color={0,0,255}));
+  connect(loopBreakerQ.C2, loopBreakerH.C1)
+    annotation (Line(points={{20,10},{30,10}}, color={0,0,255}));
+  connect(loopBreakerH.C2, lumpedStraightPipe.C1)
+    annotation (Line(points={{50,10},{60,10}}, color={0,0,255}));
+  connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{80,10},
+          {100,10},{100,-20},{10,-20}}, color={0,0,0}));
+  connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{
+          -100,10},{-90,10}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestRefP;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo
index 6547df8602e54b22a2f0762df527047725b9e44f..f15624103244f3ef666f70884572dc287d944c50 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo
@@ -1,56 +1,56 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestRefP1
-
-  ThermoSysPro.Fluid.BoundaryConditions.RefP refP
-    annotation (Placement(transformation(extent={{-70,0},{-50,20}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(
-                                                 k=2.e5)
-    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump
-    annotation (Placement(transformation(extent={{0,0},{20,20}},    rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe
-    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
-  BoundaryConditions.Source source
-    annotation (Placement(transformation(extent={{-100,0},{-80,20}})));
-  BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{80,0},{100,20}})));
-  BoundaryConditions.RefQ refQ
-    annotation (Placement(transformation(extent={{-40,0},{-20,20}})));
-equation
-  connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,
-          70},{-60,21}}));
-  connect(source.C, refP.C1)
-    annotation (Line(points={{-80,10},{-70,10}}, color={0,0,0}));
-  connect(lumpedStraightPipe.C2, sink.C)
-    annotation (Line(points={{60,10},{80,10}}, color={0,0,0}));
-  connect(pump.C2, lumpedStraightPipe.C1)
-    annotation (Line(points={{20,10},{40,10}}, color={0,0,0}));
-  connect(refP.C2, refQ.C1)
-    annotation (Line(points={{-50,10},{-40,10}}, color={0,0,0}));
-  connect(pump.C1, refQ.C2)
-    annotation (Line(points={{0,10},{-20,10}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestRefP1;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestRefP1
+
+  ThermoSysPro.Fluid.BoundaryConditions.RefP refP
+    annotation (Placement(transformation(extent={{-70,0},{-50,20}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(
+                                                 k=2.e5)
+    annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump
+    annotation (Placement(transformation(extent={{0,0},{20,20}},    rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe
+    annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0)));
+  BoundaryConditions.Source source
+    annotation (Placement(transformation(extent={{-100,0},{-80,20}})));
+  BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{80,0},{100,20}})));
+  BoundaryConditions.RefQ refQ
+    annotation (Placement(transformation(extent={{-40,0},{-20,20}})));
+equation
+  connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,
+          70},{-60,21}}));
+  connect(source.C, refP.C1)
+    annotation (Line(points={{-80,10},{-70,10}}, color={0,0,0}));
+  connect(lumpedStraightPipe.C2, sink.C)
+    annotation (Line(points={{60,10},{80,10}}, color={0,0,0}));
+  connect(pump.C2, lumpedStraightPipe.C1)
+    annotation (Line(points={{20,10},{40,10}}, color={0,0,0}));
+  connect(refP.C2, refQ.C1)
+    annotation (Line(points={{-50,10},{-40,10}}, color={0,0,0}));
+  connect(pump.C1, refQ.C2)
+    annotation (Line(points={{0,10},{-20,10}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestRefP1;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo
index aa2c3cfe450fe0aef1593479e0c36adc5df39ad9..aa7877ecdf2404365f75b934ec5a540028851f76 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo
@@ -1,61 +1,61 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSensors
-
-  ThermoSysPro.Fluid.Sensors.SensorH specificEnthalpySensor
-    annotation (Placement(transformation(extent={{-60,8},{-40,28}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorQ massFlowSensor
-    annotation (Placement(transformation(extent={{-20,8},{0,28}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorQv volumetricFlowSensor
-    annotation (Placement(transformation(extent={{20,8},{40,28}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorP pressureSensor
-    annotation (Placement(transformation(extent={{-60,-32},{-40,-12}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor
-    annotation (Placement(transformation(extent={{-20,-32},{0,-12}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP
-                                         annotation (Placement(transformation(
-          extent={{60,-40},{80,-20}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
-                                           annotation (Placement(transformation(
-          extent={{-100,0},{-80,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP
-    annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0)));
-equation
-  connect(sourceP.C, specificEnthalpySensor.C1)
-    annotation (Line(points={{-80,10},{-60,10}}, color={0,0,255}));
-  connect(specificEnthalpySensor.C2, massFlowSensor.C1)
-    annotation (Line(points={{-39.8,10},{-20,10}}, color={0,0,255}));
-  connect(massFlowSensor.C2, volumetricFlowSensor.C1)
-    annotation (Line(points={{0.2,10},{20,10}}, color={0,0,255}));
-  connect(volumetricFlowSensor.C2, pressureSensor.C1) annotation (Line(points={
-          {40.2,10},{60,10},{60,0},{-80,0},{-80,-30},{-60,-30}}, color={0,0,255}));
-  connect(pressureSensor.C2, temperatureSensor.C1) annotation (Line(points={{
-          -39.8,-30},{-20,-30}}, color={0,0,255}));
-  connect(temperatureSensor.C2, perteDP.C1)
-    annotation (Line(points={{0.2,-30},{20,-30}}, color={0,0,255}));
-  connect(perteDP.C2, puitsP.C)
-    annotation (Line(points={{40,-30},{60,-30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestSensors;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSensors
+
+  ThermoSysPro.Fluid.Sensors.SensorH specificEnthalpySensor
+    annotation (Placement(transformation(extent={{-60,8},{-40,28}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorQ massFlowSensor
+    annotation (Placement(transformation(extent={{-20,8},{0,28}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorQv volumetricFlowSensor
+    annotation (Placement(transformation(extent={{20,8},{40,28}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorP pressureSensor
+    annotation (Placement(transformation(extent={{-60,-32},{-40,-12}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor
+    annotation (Placement(transformation(extent={{-20,-32},{0,-12}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP
+                                         annotation (Placement(transformation(
+          extent={{60,-40},{80,-20}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
+                                           annotation (Placement(transformation(
+          extent={{-100,0},{-80,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP
+    annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0)));
+equation
+  connect(sourceP.C, specificEnthalpySensor.C1)
+    annotation (Line(points={{-80,10},{-60,10}}, color={0,0,255}));
+  connect(specificEnthalpySensor.C2, massFlowSensor.C1)
+    annotation (Line(points={{-39.8,10},{-20,10}}, color={0,0,255}));
+  connect(massFlowSensor.C2, volumetricFlowSensor.C1)
+    annotation (Line(points={{0.2,10},{20,10}}, color={0,0,255}));
+  connect(volumetricFlowSensor.C2, pressureSensor.C1) annotation (Line(points={
+          {40.2,10},{60,10},{60,0},{-80,0},{-80,-30},{-60,-30}}, color={0,0,255}));
+  connect(pressureSensor.C2, temperatureSensor.C1) annotation (Line(points={{
+          -39.8,-30},{-20,-30}}, color={0,0,255}));
+  connect(temperatureSensor.C2, perteDP.C1)
+    annotation (Line(points={{0.2,-30},{20,-30}}, color={0,0,255}));
+  connect(perteDP.C2, puitsP.C)
+    annotation (Line(points={{40,-30},{60,-30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestSensors;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo
index 79789d8014ba6f3bcbd517c3d5fb417f86bf84c7..f7ffbe712cb9d4defae12e6830fd6ca57a6f2bec 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSimpleDynamicCondenser
-
-parameter Real L1 = 425 "Longueur de la première chaine de capteurs";
-parameter Integer Ns1 = 80
-    "Nombre de mailles de la première chaine de capteurs";
-
-parameter Real L2 = 75 "Longueur de la deuxième chaine de capteurs";
-parameter Integer Ns2 = 1 "Nombre de mailles de la deuxième chaine de capteurs";
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(
-                    P0=1e5,
-    option_temperature=false) annotation (Placement(transformation(extent={{48,30},
-            {88,70}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe(                                                          K=1e-6, Q(start=
-          0.598447),
-    C1(P(start=9035.18437098087)),
-    rho(start=990.6632738884383))
-    annotation (Placement(transformation(
-        origin={-90,-38},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau(
-    option_temperature=false,
-    h0=2401e3,
-    P0=15050)                   annotation (Placement(transformation(extent={{-207,
-            148},{-183,170}},      rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau(
-                  h0=191812, Q0(start=192, fixed=false))
-                          annotation (Placement(transformation(extent={{-184,
-            -52},{-208,-24}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0=29804.5, h0=113e3)
-                                annotation (Placement(transformation(extent={{-212,30},
-            {-172,68}},          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe1(                                                         K=1e-6, rho(
-        start=995.5397398431962))
-    annotation (Placement(transformation(
-        origin={36,50},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe2(                                                         K=1e-6, rho(
-        start=996.552939890412))
-    annotation (Placement(transformation(
-        origin={-154,49},
-        extent={{6,-10},{-6,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    PerteChargeCondPompe3(K(fixed=false) = 1e-3, Q(start=192, fixed=true))
-    annotation (Placement(transformation(
-        origin={-120,159},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(    D=0.018,
-    V=1000,
-    A=100,
-    lambda=0.01,
-    ntubes=28700,
-    yNiveau(signal(fixed=false, start=1.5)),
-    Vf0=0.15,
-    Vl(start=500, fixed=true),
-    P(fixed=false, start=9035.18437098087),
-    hl(start=183576.8570917718),
-    hv(start=187278.68509678004),
-    proe(d(start=996.0593559031695)))
-                     annotation (Placement(transformation(extent={{-118,6},{1,
-            116}}, rotation=0)));
-equation
-
-  connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(
-        points={{-172,49},{-160,49}}, color={0,0,255}));
-  connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(
-        points={{42,50},{48,50}}, color={0,0,255}));
-  connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(
-        points={{-183,159},{-130,159}}, color={0,0,255}));
-  connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2)
-    annotation (Line(points={{-184,-38},{-100,-38}}));
-  connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{
-          -148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255}));
-  connect(PerteChargeCondPompe.C1, Condenseur.Cl)
-    annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}}));
-  connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{
-          -110,159},{-58.5,159},{-58.5,116}}, color={0,0,255}));
-  connect(PerteChargeCondPompe1.C1, Condenseur.Cse)
-    annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}}));
-  annotation (
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-60},{130,180}},
-        grid={2,2},
-        initialScale=0.1)),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    experiment(StopTime=1000));
-end TestSimpleDynamicCondenser;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSimpleDynamicCondenser
+
+parameter Real L1 = 425 "Longueur de la première chaine de capteurs";
+parameter Integer Ns1 = 80
+    "Nombre de mailles de la première chaine de capteurs";
+
+parameter Real L2 = 75 "Longueur de la deuxième chaine de capteurs";
+parameter Integer Ns2 = 1 "Nombre de mailles de la deuxième chaine de capteurs";
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(
+                    P0=1e5,
+    option_temperature=false) annotation (Placement(transformation(extent={{48,30},
+            {88,70}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe(                                                          K=1e-6, Q(start=
+          0.598447),
+    C1(P(start=9035.18437098087)),
+    rho(start=990.6632738884383))
+    annotation (Placement(transformation(
+        origin={-90,-38},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau(
+    option_temperature=false,
+    h0=2401e3,
+    P0=15050)                   annotation (Placement(transformation(extent={{-207,
+            148},{-183,170}},      rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau(
+                  h0=191812, Q0(start=192, fixed=false))
+                          annotation (Placement(transformation(extent={{-184,
+            -52},{-208,-24}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0=29804.5, h0=113e3)
+                                annotation (Placement(transformation(extent={{-212,30},
+            {-172,68}},          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe1(                                                         K=1e-6, rho(
+        start=995.5397398431962))
+    annotation (Placement(transformation(
+        origin={36,50},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe2(                                                         K=1e-6, rho(
+        start=996.552939890412))
+    annotation (Placement(transformation(
+        origin={-154,49},
+        extent={{6,-10},{-6,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    PerteChargeCondPompe3(K(fixed=false) = 1e-3, Q(start=192, fixed=true))
+    annotation (Placement(transformation(
+        origin={-120,159},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(    D=0.018,
+    V=1000,
+    A=100,
+    lambda=0.01,
+    ntubes=28700,
+    yNiveau(signal(fixed=false, start=1.5)),
+    Vf0=0.15,
+    Vl(start=500, fixed=true),
+    P(fixed=false, start=9035.18437098087),
+    hl(start=183576.8570917718),
+    hv(start=187278.68509678004),
+    proe(d(start=996.0593559031695)))
+                     annotation (Placement(transformation(extent={{-118,6},{1,
+            116}}, rotation=0)));
+equation
+
+  connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(
+        points={{-172,49},{-160,49}}, color={0,0,255}));
+  connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(
+        points={{42,50},{48,50}}, color={0,0,255}));
+  connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(
+        points={{-183,159},{-130,159}}, color={0,0,255}));
+  connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2)
+    annotation (Line(points={{-184,-38},{-100,-38}}));
+  connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{
+          -148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255}));
+  connect(PerteChargeCondPompe.C1, Condenseur.Cl)
+    annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}}));
+  connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{
+          -110,159},{-58.5,159},{-58.5,116}}, color={0,0,255}));
+  connect(PerteChargeCondPompe1.C1, Condenseur.Cse)
+    annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}}));
+  annotation (
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-60},{130,180}},
+        grid={2,2},
+        initialScale=0.1)),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    experiment(StopTime=1000));
+end TestSimpleDynamicCondenser;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo
index c526cc9a09de15d7239ac1cfa67e82f25e423a45..a409bf6e713b26832929af1948cee71fd9ba4089 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo
@@ -1,95 +1,95 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSimpleDynamicCondenser1
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(Pm(displayUnit = "Pa", start=
-          355000.00000015664),                                                                         Q(fixed = false), hn(fixed = false, start=
-          71.08245675235786),                                                                                                               p_rho(displayUnit = "kg/m3"), rho(displayUnit = "kg/m3"),
-    a1(start=-88.67, fixed=false),
-    C2(h(start=195297.69906611618), h_vol_1(start=195297.69906611618)),
-    Qv(start=0.009081311621074862),
-    h(start=193554.9971298399),
-    C1(P(start=10000.0)))                                                                                                                                                                             annotation (
-    Placement(visible = true, transformation(origin={-10,-60},    extent={{10,-10},
-            {-10,10}},                                                                             rotation = 0)));
-  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Pe(displayUnit = "Pa", fixed = true, start = 700000), Ps(displayUnit = "Pa", fixed = false), W_fric = 0, eta_is(fixed = false), eta_is_wet(fixed = false), rhos(displayUnit = "kg/m3", fixed = false),
-    xm(fixed=false, start=0.9856238368898451),
-    proe(x(start=1, fixed=true)),
-    Ce(h_vol_2(start=3128840.013040668), h(start=3128840.0130323363)),
-    pros(d(start=0.07018147245152216)))                                                                                                                                                                                                   annotation (
-    Placement(visible = true, transformation(origin={-10,60},    extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(A = 100, D = 0.018,
-    dynamic_energy_balance=true,
-    P(fixed=false, start=10000),
-    P0(displayUnit="Pa") = 1000,                                                                                                                                V = 1000, continuous_flow_reversal = true, lambda = 0.01, ntubes = 28700, rhol(displayUnit = "kg/m3"), rhom(displayUnit = "kg/m3"), rhov(displayUnit = "kg/m3"),                       yNiveau(signal(fixed = false, start = 1.5)),
-    steady_state=false,
-    proe(d(start=0.7468807684211932)))                                                                                                                                                                                          annotation (
-    Placement(visible = true, transformation(origin={40.5,-1},    extent = {{-20.5, -16}, {20.5, 16}}, rotation = 0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, T0 = 373.05, option_temperature = true) annotation (
-    Placement(visible = true, transformation(origin={85,-1},    extent = {{-11, -12}, {11, 12}}, rotation = 0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0 = 5, h0 = 113e3) annotation (
-    Placement(visible = true, transformation(origin={-24,-1},    extent = {{-10, -9}, {10, 9}}, rotation = 0)));
-  Volumes.VolumeATh volumeA(
-    P(start=70e5),
-    h(start=2.e6),
-    dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-70,10},{-50,-10}})));
-  Thermal.BoundaryConditions.HeatSource heatSource(W0(start={2e6}, each fixed=false),
-      option_temperature=2) annotation (Placement(transformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={-88,12})));
-equation
-  connect(Condenseur.Cv,stodolaTurbine. Cs) annotation (
-    Line(points={{40.5,15},{40.5,60},{0.1,60}},    color = {0, 0, 255}));
-  connect(Condenseur.Cse,puitsPCaloporteur. C) annotation (
-    Line(points={{61,-4.2},{62,-4.2},{62,-1},{74,-1}},
-                                        color = {0, 0, 255}));
-  connect(sourcePCaloporteur.C,Condenseur. Cee) annotation (
-    Line(points={{-14,-1},{-9,-1},{-9,-4.52},{20,-4.52}},   color = {0, 0, 255}));
-  connect(Condenseur.Cl, staticCentrifugalPump.C1) annotation (Line(points={{40.91,
-          -17},{40,-17},{40,-60},{0,-60}},   color={28,108,200}));
-  connect(staticCentrifugalPump.C2, volumeA.Ce2)
-    annotation (Line(points={{-20,-60},{-60,-60},{-60,-10}}, color={28,108,200}));
-  connect(volumeA.Cs2, stodolaTurbine.Ce)
-    annotation (Line(points={{-60,10},{-60,60},{-20.1,60}},  color={28,108,200}));
-  connect(heatSource.C[1], volumeA.Cth) annotation (Line(points={{-78.2,12},{-64,
-          12},{-64,0},{-60,0}}, color={0,0,0}));
-  annotation (                         Diagram(graphics={
-        Text(
-          extent={{-94,34},{-64,24}},
-          lineColor={28,108,200},
-          textString="W: free"),
-        Text(
-          extent={{-26,-38},{8,-48}},
-          lineColor={28,108,200},
-          textString="a1: free"),
-        Text(
-          extent={{-28,94},{8,84}},
-          lineColor={28,108,200},
-          textString="Pe: fixed"),
-        Text(
-          extent={{-28,84},{10,72}},
-          lineColor={28,108,200},
-          textString="proe.x: fixed")}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    experiment(StopTime=1000, __Dymola_Algorithm="Dassl"));
-end TestSimpleDynamicCondenser1;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSimpleDynamicCondenser1
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(Pm(displayUnit = "Pa", start=
+          355000.00000015664),                                                                         Q(fixed = false), hn(fixed = false, start=
+          71.08245675235786),                                                                                                               p_rho(displayUnit = "kg/m3"), rho(displayUnit = "kg/m3"),
+    a1(start=-88.67, fixed=false),
+    C2(h(start=195297.69906611618), h_vol_1(start=195297.69906611618)),
+    Qv(start=0.009081311621074862),
+    h(start=193554.9971298399),
+    C1(P(start=10000.0)))                                                                                                                                                                             annotation (
+    Placement(visible = true, transformation(origin={-10,-60},    extent={{10,-10},
+            {-10,10}},                                                                             rotation = 0)));
+  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Pe(displayUnit = "Pa", fixed = true, start = 700000), Ps(displayUnit = "Pa", fixed = false), W_fric = 0, eta_is(fixed = false), eta_is_wet(fixed = false), rhos(displayUnit = "kg/m3", fixed = false),
+    xm(fixed=false, start=0.9856238368898451),
+    proe(x(start=1, fixed=true)),
+    Ce(h_vol_2(start=3128840.013040668), h(start=3128840.0130323363)),
+    pros(d(start=0.07018147245152216)))                                                                                                                                                                                                   annotation (
+    Placement(visible = true, transformation(origin={-10,60},    extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+  ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(A = 100, D = 0.018,
+    dynamic_energy_balance=true,
+    P(fixed=false, start=10000),
+    P0(displayUnit="Pa") = 1000,                                                                                                                                V = 1000, continuous_flow_reversal = true, lambda = 0.01, ntubes = 28700, rhol(displayUnit = "kg/m3"), rhom(displayUnit = "kg/m3"), rhov(displayUnit = "kg/m3"),                       yNiveau(signal(fixed = false, start = 1.5)),
+    steady_state=false,
+    proe(d(start=0.7468807684211932)))                                                                                                                                                                                          annotation (
+    Placement(visible = true, transformation(origin={40.5,-1},    extent = {{-20.5, -16}, {20.5, 16}}, rotation = 0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, T0 = 373.05, option_temperature = true) annotation (
+    Placement(visible = true, transformation(origin={85,-1},    extent = {{-11, -12}, {11, 12}}, rotation = 0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0 = 5, h0 = 113e3) annotation (
+    Placement(visible = true, transformation(origin={-24,-1},    extent = {{-10, -9}, {10, 9}}, rotation = 0)));
+  Volumes.VolumeATh volumeA(
+    P(start=70e5),
+    h(start=2.e6),
+    dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-70,10},{-50,-10}})));
+  Thermal.BoundaryConditions.HeatSource heatSource(W0(start={2e6}, each fixed=false),
+      option_temperature=2) annotation (Placement(transformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={-88,12})));
+equation
+  connect(Condenseur.Cv,stodolaTurbine. Cs) annotation (
+    Line(points={{40.5,15},{40.5,60},{0.1,60}},    color = {0, 0, 255}));
+  connect(Condenseur.Cse,puitsPCaloporteur. C) annotation (
+    Line(points={{61,-4.2},{62,-4.2},{62,-1},{74,-1}},
+                                        color = {0, 0, 255}));
+  connect(sourcePCaloporteur.C,Condenseur. Cee) annotation (
+    Line(points={{-14,-1},{-9,-1},{-9,-4.52},{20,-4.52}},   color = {0, 0, 255}));
+  connect(Condenseur.Cl, staticCentrifugalPump.C1) annotation (Line(points={{40.91,
+          -17},{40,-17},{40,-60},{0,-60}},   color={28,108,200}));
+  connect(staticCentrifugalPump.C2, volumeA.Ce2)
+    annotation (Line(points={{-20,-60},{-60,-60},{-60,-10}}, color={28,108,200}));
+  connect(volumeA.Cs2, stodolaTurbine.Ce)
+    annotation (Line(points={{-60,10},{-60,60},{-20.1,60}},  color={28,108,200}));
+  connect(heatSource.C[1], volumeA.Cth) annotation (Line(points={{-78.2,12},{-64,
+          12},{-64,0},{-60,0}}, color={0,0,0}));
+  annotation (                         Diagram(graphics={
+        Text(
+          extent={{-94,34},{-64,24}},
+          lineColor={28,108,200},
+          textString="W: free"),
+        Text(
+          extent={{-26,-38},{8,-48}},
+          lineColor={28,108,200},
+          textString="a1: free"),
+        Text(
+          extent={{-28,94},{8,84}},
+          lineColor={28,108,200},
+          textString="Pe: fixed"),
+        Text(
+          extent={{-28,84},{10,72}},
+          lineColor={28,108,200},
+          textString="proe.x: fixed")}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    experiment(StopTime=1000, __Dymola_Algorithm="Dassl"));
+end TestSimpleDynamicCondenser1;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo
index 75d1f5fb4889d1d1b683a9189c4065d55bcaa4ee..8caa6112aff4d0e44dcbeb61bea3d3482b27f5b1 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo
@@ -1,71 +1,71 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSimpleEvaporatorWaterSteamFlueGases
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink puits_Eau
-                                          annotation (Placement(transformation(
-          extent={{64,-17},{84,3}}, rotation=0)));
-
-  ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases
-    EchangeurEfficacite(Kdpf=1, Kdpe=1)
-                annotation (Placement(transformation(extent={{-44,-35},{44,21}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source_Eau(
-    Q0=38.92/3.6,
-    h0=1242080,
-    P0=6527000)
-              annotation (Placement(transformation(extent={{-84,-17},{-64,3}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees(
-    Xso2=0,
-    Q0=86.7429,
-    Xco2=0.04725,
-    Xh2o=0.051874,
-    Xo2=0.15011,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=101000,
-    T0=750.54,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-34,45},{0,75}}, rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees
-    annotation (Placement(transformation(
-        origin={16,-70},
-        extent={{16,-15},{-16,15}},
-        rotation=180)));
-equation
-  connect(Source_Fumees.C, EchangeurEfficacite.Cfg1) annotation (Line(
-      points={{0,60},{0,18.2}},
-      color={0,0,0},
-      thickness=1));
-  connect(EchangeurEfficacite.Cfg2, Puits_Fumees.C) annotation (Line(
-      points={{0,-32.2},{0,-70},{0,-70}},
-      color={0,0,0},
-      thickness=1));
-  connect(EchangeurEfficacite.Cws2, puits_Eau.C) annotation (Line(points={{44,
-          -7},{54,-7},{54,-7},{64,-7}}, color={0,0,255}));
-  connect(EchangeurEfficacite.Cws1, source_Eau.C)
-    annotation (Line(points={{-44,-7},{-54,-7},{-54,-7},{-64,-7}}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestSimpleEvaporatorWaterSteamFlueGases;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSimpleEvaporatorWaterSteamFlueGases
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink puits_Eau
+                                          annotation (Placement(transformation(
+          extent={{64,-17},{84,3}}, rotation=0)));
+
+  ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases
+    EchangeurEfficacite(Kdpf=1, Kdpe=1)
+                annotation (Placement(transformation(extent={{-44,-35},{44,21}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source_Eau(
+    Q0=38.92/3.6,
+    h0=1242080,
+    P0=6527000)
+              annotation (Placement(transformation(extent={{-84,-17},{-64,3}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees(
+    Xso2=0,
+    Q0=86.7429,
+    Xco2=0.04725,
+    Xh2o=0.051874,
+    Xo2=0.15011,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=101000,
+    T0=750.54,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-34,45},{0,75}}, rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees
+    annotation (Placement(transformation(
+        origin={16,-70},
+        extent={{16,-15},{-16,15}},
+        rotation=180)));
+equation
+  connect(Source_Fumees.C, EchangeurEfficacite.Cfg1) annotation (Line(
+      points={{0,60},{0,18.2}},
+      color={0,0,0},
+      thickness=1));
+  connect(EchangeurEfficacite.Cfg2, Puits_Fumees.C) annotation (Line(
+      points={{0,-32.2},{0,-70},{0,-70}},
+      color={0,0,0},
+      thickness=1));
+  connect(EchangeurEfficacite.Cws2, puits_Eau.C) annotation (Line(points={{44,
+          -7},{54,-7},{54,-7},{64,-7}}, color={0,0,255}));
+  connect(EchangeurEfficacite.Cws1, source_Eau.C)
+    annotation (Line(points={{-44,-7},{-54,-7},{-54,-7},{-64,-7}}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestSimpleEvaporatorWaterSteamFlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo
index ae856e02ad64f4263e47a8e05347c8d6a9d45546..38eaea3424f3ec2f097b9b37b2a2165ab5e20433 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo
@@ -1,53 +1,53 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSimpleStaticCondenser
-
-  ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser
-    simpleStaticCondenser(
-    Ec(h(start=532983.7176868258)),
-    Ef(h(start=71016.12237181116)),
-    Qc(start=1049.6385508765125),
-    Qf(start=4469.84281279143),
-    Sf(h(start=64330.208038325145)))
-                          annotation (Placement(transformation(extent={{-20,20},
-            {0,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(T0=400)
-    annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0)));
-equation
-  connect(sourceP.C, simpleStaticCondenser.Ef) annotation (Line(points={{-40,30},
-          {-20,30}}, color={0,0,255}));
-  connect(sourceP1.C, simpleStaticCondenser.Ec) annotation (Line(points={{-40,
-          -10},{-16,-10},{-16,20}}, color={0,0,255}));
-  connect(simpleStaticCondenser.Sf, sinkP.C) annotation (Line(points={{0,29.9},
-          {10,29.9},{10,30},{20,30}}, color={0,0,255}));
-  connect(simpleStaticCondenser.Sc, sinkP1.C) annotation (Line(points={{-4,20},
-          {-4,-10},{20,-10}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestSimpleStaticCondenser;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSimpleStaticCondenser
+
+  ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser
+    simpleStaticCondenser(
+    Ec(h(start=532983.7176868258)),
+    Ef(h(start=71016.12237181116)),
+    Qc(start=1049.6385508765125),
+    Qf(start=4469.84281279143),
+    Sf(h(start=64330.208038325145)))
+                          annotation (Placement(transformation(extent={{-20,20},
+            {0,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(T0=400)
+    annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0)));
+equation
+  connect(sourceP.C, simpleStaticCondenser.Ef) annotation (Line(points={{-40,30},
+          {-20,30}}, color={0,0,255}));
+  connect(sourceP1.C, simpleStaticCondenser.Ec) annotation (Line(points={{-40,
+          -10},{-16,-10},{-16,20}}, color={0,0,255}));
+  connect(simpleStaticCondenser.Sf, sinkP.C) annotation (Line(points={{0,29.9},
+          {10,29.9},{10,30},{20,30}}, color={0,0,255}));
+  connect(simpleStaticCondenser.Sc, sinkP1.C) annotation (Line(points={{-4,20},
+          {-4,-10},{20,-10}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestSimpleStaticCondenser;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo
index 99e9fae25fb5082ece1f77909357ab030219977f..5e0c5697d21d2095acb6a468f2ad3f9f9af7e7e6 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo
@@ -1,51 +1,51 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSingularPressureLoss
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss(                                                          fluid=1)
-                                          annotation (Placement(transformation(
-          extent={{-20,20},{0,40}}, rotation=0)));
-equation
-  connect(singularPressureLoss.C2, PuitsP1.C)
-    annotation (Line(points={{0,30},{60,30}}, color={0,0,255}));
-  connect(SourceP1.C, singularPressureLoss.C1)
-    annotation (Line(points={{-80,30},{-20,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-   Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestSingularPressureLoss;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSingularPressureLoss
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss(                                                          fluid=1)
+                                          annotation (Placement(transformation(
+          extent={{-20,20},{0,40}}, rotation=0)));
+equation
+  connect(singularPressureLoss.C2, PuitsP1.C)
+    annotation (Line(points={{0,30},{60,30}}, color={0,0,255}));
+  connect(SourceP1.C, singularPressureLoss.C1)
+    annotation (Line(points={{-80,30},{-20,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+   Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestSingularPressureLoss;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo
index 7d53eeccb26c879d8da2cd83b5f5748dc549d7e7..0a74e43e0ea9abbac999902a35148df799f90c2b 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo
@@ -1,97 +1,97 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticAerocondenser
-
-  parameter Units.SI.AbsolutePressure Pin_1=20000
-    "Flow pressure at inlet 1 (sourceP)";
-  parameter Units.SI.AbsolutePressure Pin_2=20000
-    "Flow pressure at inlet 3 (sourceP2)";
-
-  BoundaryConditions.SourcePQ                   Source_condenseur(
-             Q0(fixed=true) = 4000,
-    h0=15e3,
-    option_temperature=true,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=100000,
-    T0=287.15)
-          annotation (Placement(transformation(extent={{190,-90},{170,-70}},
-          rotation=0)));
-
-  BoundaryConditions.Sink                     Puit_condenseur
-             annotation (Placement(transformation(extent={{170,90},{190,110}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    h0=2.5817e6,
-    C(Q(fixed=false, start=100)),
-    P0=Pin_1)
-            annotation (Placement(transformation(extent={{-100,90},{-80,110}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-    option_temperature=false,
-    h0=2.5055e6,
-    C(Q(fixed=false, start=1e-5)),
-    P0=Pin_2)                      annotation (Placement(transformation(extent={{-182,
-            -40},{-162,-20}},      rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=10)
-                          annotation (Placement(transformation(extent={{-120,-40},
-            {-100,-20}},
-                       rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=10)
-                          annotation (Placement(transformation(extent={{-38,90},
-            {-18,110}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{-100,-90},{-120,-70}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4)
-                          annotation (Placement(transformation(extent={{-40,-90},
-            {-60,-70}},rotation=0)));
-
-  Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser
-    annotation (Placement(transformation(extent={{-64,-44},{66,70}})));
-equation
-  connect(sourceP2.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-162,-30},{-120,-30}},
-                                                   color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-80,100},{-38,100}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, staticAerocondenser.Cw) annotation (Line(
-        points={{-100,-30},{-70,-30},{-70,-29.75},{-58.5833,-29.75}},color={0,0,
-          0}));
-  connect(singularPressureLoss3.C2, staticAerocondenser.Cws1)
-    annotation (Line(points={{-18,100},{1,100},{1,65.25}}, color={0,0,0}));
-  connect(Puit_condenseur1.C, singularPressureLoss5.C2)
-    annotation (Line(points={{-100,-80},{-60,-80}},color={0,0,0}));
-  connect(singularPressureLoss5.C1, staticAerocondenser.Cws2)
-    annotation (Line(points={{-40,-80},{1,-80},{1,-39.25}}, color={0,0,0}));
-  connect(Source_condenseur.C, staticAerocondenser.Cair1) annotation (Line(
-        points={{170,-80},{60.5833,-80},{60.5833,-38.775}}, color={0,0,0}));
-  connect(Puit_condenseur.C, staticAerocondenser.Cair2) annotation (Line(points={{170,100},
-          {60.5833,100},{60.5833,65.25}},           color={0,0,0}));
-  annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticAerocondenser;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticAerocondenser
+
+  parameter Units.SI.AbsolutePressure Pin_1=20000
+    "Flow pressure at inlet 1 (sourceP)";
+  parameter Units.SI.AbsolutePressure Pin_2=20000
+    "Flow pressure at inlet 3 (sourceP2)";
+
+  BoundaryConditions.SourcePQ                   Source_condenseur(
+             Q0(fixed=true) = 4000,
+    h0=15e3,
+    option_temperature=true,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=100000,
+    T0=287.15)
+          annotation (Placement(transformation(extent={{190,-90},{170,-70}},
+          rotation=0)));
+
+  BoundaryConditions.Sink                     Puit_condenseur
+             annotation (Placement(transformation(extent={{170,90},{190,110}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    h0=2.5817e6,
+    C(Q(fixed=false, start=100)),
+    P0=Pin_1)
+            annotation (Placement(transformation(extent={{-100,90},{-80,110}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+    option_temperature=false,
+    h0=2.5055e6,
+    C(Q(fixed=false, start=1e-5)),
+    P0=Pin_2)                      annotation (Placement(transformation(extent={{-182,
+            -40},{-162,-20}},      rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=10)
+                          annotation (Placement(transformation(extent={{-120,-40},
+            {-100,-20}},
+                       rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=10)
+                          annotation (Placement(transformation(extent={{-38,90},
+            {-18,110}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{-100,-90},{-120,-70}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4)
+                          annotation (Placement(transformation(extent={{-40,-90},
+            {-60,-70}},rotation=0)));
+
+  Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser
+    annotation (Placement(transformation(extent={{-64,-44},{66,70}})));
+equation
+  connect(sourceP2.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-162,-30},{-120,-30}},
+                                                   color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-80,100},{-38,100}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, staticAerocondenser.Cw) annotation (Line(
+        points={{-100,-30},{-70,-30},{-70,-29.75},{-58.5833,-29.75}},color={0,0,
+          0}));
+  connect(singularPressureLoss3.C2, staticAerocondenser.Cws1)
+    annotation (Line(points={{-18,100},{1,100},{1,65.25}}, color={0,0,0}));
+  connect(Puit_condenseur1.C, singularPressureLoss5.C2)
+    annotation (Line(points={{-100,-80},{-60,-80}},color={0,0,0}));
+  connect(singularPressureLoss5.C1, staticAerocondenser.Cws2)
+    annotation (Line(points={{-40,-80},{1,-80},{1,-39.25}}, color={0,0,0}));
+  connect(Source_condenseur.C, staticAerocondenser.Cair1) annotation (Line(
+        points={{170,-80},{60.5833,-80},{60.5833,-38.775}}, color={0,0,0}));
+  connect(Puit_condenseur.C, staticAerocondenser.Cair2) annotation (Line(points={{170,100},
+          {60.5833,100},{60.5833,65.25}},           color={0,0,0}));
+  annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticAerocondenser;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo
index a95bf93a112544aaa6b37f31bcad6d33f1cf13c2..446b660072879ca2f82c1fe39574bbd635e8efd1 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticCentrifugalPump1
-
-  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1(
-      fixed_rot_or_power=2, MPower=0.15e6)
-    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0=600000)
-    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
-equation
-  connect(sourceP.C, StaticCentrifugalPump1.C1) annotation (Line(
-      points={{-60,30},{-20,30}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(StaticCentrifugalPump1.C2, sinkP.C) annotation (Line(
-      points={{0,30},{40,30}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticCentrifugalPump1;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticCentrifugalPump1
+
+  ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1(
+      fixed_rot_or_power=2, MPower=0.15e6)
+    annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0=600000)
+    annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0)));
+equation
+  connect(sourceP.C, StaticCentrifugalPump1.C1) annotation (Line(
+      points={{-60,30},{-20,30}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(StaticCentrifugalPump1.C2, sinkP.C) annotation (Line(
+      points={{0,30},{40,30}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticCentrifugalPump1;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo
index 46f31c39d9ada0b8b1cda726867e16f1e98e308d..38768f3345fc8fb26c9658b20a1a6d935d63da12 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticCondenser
-
-  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000)
-    "Flow pressure at inlet 1 (sourceP)";
-  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000)
-    "Flow pressure at inlet 2 (sourceP1)";
-  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000)
-    "Flow pressure at inlet 3 (sourceP2)";
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur(
-    h0=60e3, Q0(fixed=true) = 4000)
-          annotation (Placement(transformation(extent={{-180,0},{-160,20}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur
-             annotation (Placement(transformation(extent={{160,0},{180,20}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur(
-    CPCE=0,
-    KCO=100,
-    QC0=200,
-    z=5,
-    SCO=15e3,
-    Qee(start=4000, fixed=false),
-    Pcond(fixed=false, start=2154.77))     annotation (Placement(transformation(
-          extent={{-20,-16},{72,82}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    h0=2.5817e6,
-    C(Q(fixed=true, start=100)),
-    P0=Pin_1)
-            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    option_temperature=false,
-    h0=2.5481e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_2)                     annotation (Placement(transformation(extent={
-            {-182,80},{-162,100}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-    option_temperature=false,
-    h0=2.5055e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_3)                      annotation (Placement(transformation(extent=
-            {{-180,40},{-160,60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss(K=10)
-                         annotation (Placement(transformation(extent={{-100,80},
-            {-80,100}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=10)
-                          annotation (Placement(transformation(extent={{-100,40},
-            {-80,60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2(K=1e-4)
-                          annotation (Placement(transformation(extent={{-100,0},
-            {-80,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=10)
-                          annotation (Placement(transformation(extent={{-40,140},
-            {-20,160}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4)
-                          annotation (Placement(transformation(extent={{100,0},
-            {120,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4)
-                          annotation (Placement(transformation(extent={{40,-100},
-            {60,-80}}, rotation=0)));
-
-equation
-  connect(sourceP1.C, singularPressureLoss.C1)
-    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
-          -80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255}));
-  connect(sourceP2.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
-          -80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255}));
-  connect(Source_condenseur.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{
-          -80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{
-          -20,150},{26,150},{26,82.49}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, Puit_condenseur.C)
-    annotation (Line(points={{120,10},{160,10}}, color={0,0,255}));
-  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
-          72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
-    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
-  connect(singularPressureLoss5.C1, condenseur.Cex)
-    annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16}}));
-  annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticCondenser;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticCondenser
+
+  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000)
+    "Flow pressure at inlet 1 (sourceP)";
+  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000)
+    "Flow pressure at inlet 2 (sourceP1)";
+  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000)
+    "Flow pressure at inlet 3 (sourceP2)";
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur(
+    h0=60e3, Q0(fixed=true) = 4000)
+          annotation (Placement(transformation(extent={{-180,0},{-160,20}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur
+             annotation (Placement(transformation(extent={{160,0},{180,20}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur(
+    CPCE=0,
+    KCO=100,
+    QC0=200,
+    z=5,
+    SCO=15e3,
+    Qee(start=4000, fixed=false),
+    Pcond(fixed=false, start=2154.77))     annotation (Placement(transformation(
+          extent={{-20,-16},{72,82}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    h0=2.5817e6,
+    C(Q(fixed=true, start=100)),
+    P0=Pin_1)
+            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    option_temperature=false,
+    h0=2.5481e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_2)                     annotation (Placement(transformation(extent={
+            {-182,80},{-162,100}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+    option_temperature=false,
+    h0=2.5055e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_3)                      annotation (Placement(transformation(extent=
+            {{-180,40},{-160,60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss(K=10)
+                         annotation (Placement(transformation(extent={{-100,80},
+            {-80,100}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=10)
+                          annotation (Placement(transformation(extent={{-100,40},
+            {-80,60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2(K=1e-4)
+                          annotation (Placement(transformation(extent={{-100,0},
+            {-80,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=10)
+                          annotation (Placement(transformation(extent={{-40,140},
+            {-20,160}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4)
+                          annotation (Placement(transformation(extent={{100,0},
+            {120,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4)
+                          annotation (Placement(transformation(extent={{40,-100},
+            {60,-80}}, rotation=0)));
+
+equation
+  connect(sourceP1.C, singularPressureLoss.C1)
+    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
+          -80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255}));
+  connect(sourceP2.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
+          -80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255}));
+  connect(Source_condenseur.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{
+          -80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{
+          -20,150},{26,150},{26,82.49}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, Puit_condenseur.C)
+    annotation (Line(points={{120,10},{160,10}}, color={0,0,255}));
+  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
+          72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
+    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
+  connect(singularPressureLoss5.C1, condenseur.Cex)
+    annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16}}));
+  annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticCondenser;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo
index 5872d217a7dfd484fd94f991b554a60ad4493692..17a48c1408f83024a5a2bdc3aa4645994e033abb 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticCondenserHEI
-
-  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=
-        179979.0023433965) "Flow pressure at inlet 1 (sourceP)";
-  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=
-        4691.365030963762) "Flow pressure at inlet 2 (sourceP1)";
-  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=
-        4691.365030911197) "Flow pressure at inlet 3 (sourceP2)";
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur(
-    h0=60e3, Q0(fixed=true) = 4000)
-          annotation (Placement(transformation(extent={{-180,0},{-160,20}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur(C(h(start=
-            121216.39257552983)))
-             annotation (Placement(transformation(extent={{160,0},{180,20}},
-          rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.StaticCondenserHEI condenseur(
-    Kf=0,
-    z1c=5,
-    Cee(
-    Q(    start=4000, fixed=false)),
-    Pcond(fixed=false, start=2154.77),
-    DPf(start=-7.816453667652961E-26),
-    Wcut_off(start=116804805.25936648),
-    procs(d(start=9.50351941496327)))      annotation (Placement(transformation(
-          extent={{-20,-16},{72,82}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    option_temperature=false,
-    h0=2.5817e6,
-    C(Q(fixed=true, start=100)),
-    P0=Pin_1)
-            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    option_temperature=false,
-    h0=2.5481e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_2)                     annotation (Placement(transformation(extent={
-            {-182,80},{-162,100}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-    option_temperature=false,
-    h0=2.5055e6,
-    C(Q(fixed=true, start=1e-5)),
-    P0=Pin_3)                      annotation (Placement(transformation(extent=
-            {{-180,40},{-160,60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss(K=10)
-                         annotation (Placement(transformation(extent={{-100,80},
-            {-80,100}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1(K=10)
-                          annotation (Placement(transformation(extent={{-100,40},
-            {-80,60}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2(K=1e-4, rho(start=999.2051327991054))
-                          annotation (Placement(transformation(extent={{-100,0},
-            {-80,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=10)
-                          annotation (Placement(transformation(extent={{-40,140},
-            {-20,160}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
-             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss4(K=1e-4, rho(start=995.9727926518547))
-                          annotation (Placement(transformation(extent={{100,0},
-            {120,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss5(K=1e-4, rho(start=9.502298036944223))
-                          annotation (Placement(transformation(extent={{40,-100},
-            {60,-80}}, rotation=0)));
-
-equation
-  connect(sourceP1.C, singularPressureLoss.C1)
-    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
-  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
-          -80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255}));
-  connect(sourceP2.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
-          -80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255}));
-  connect(Source_condenseur.C, singularPressureLoss2.C1)
-    annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{
-          -80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255}));
-  connect(sourceP.C, singularPressureLoss3.C1)
-    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{
-          -20,150},{26,150},{26,82.49}}, color={0,0,255}));
-  connect(singularPressureLoss4.C2, Puit_condenseur.C)
-    annotation (Line(points={{120,10},{160,10}}, color={0,0,255}));
-  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
-          72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255}));
-  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
-    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
-  connect(singularPressureLoss5.C1, condenseur.Cex)
-    annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16}}));
-  annotation (experiment(StopTime=1000), Diagram(graphics,
-                                                 coordinateSystem(preserveAspectRatio=false, extent={{-200,
-            -200},{200,200}})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticCondenserHEI;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticCondenserHEI
+
+  parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=
+        179979.0023433965) "Flow pressure at inlet 1 (sourceP)";
+  parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=
+        4691.365030963762) "Flow pressure at inlet 2 (sourceP1)";
+  parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=
+        4691.365030911197) "Flow pressure at inlet 3 (sourceP2)";
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur(
+    h0=60e3, Q0(fixed=true) = 4000)
+          annotation (Placement(transformation(extent={{-180,0},{-160,20}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur(C(h(start=
+            121216.39257552983)))
+             annotation (Placement(transformation(extent={{160,0},{180,20}},
+          rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.StaticCondenserHEI condenseur(
+    Kf=0,
+    z1c=5,
+    Cee(
+    Q(    start=4000, fixed=false)),
+    Pcond(fixed=false, start=2154.77),
+    DPf(start=-7.816453667652961E-26),
+    Wcut_off(start=116804805.25936648),
+    procs(d(start=9.50351941496327)))      annotation (Placement(transformation(
+          extent={{-20,-16},{72,82}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    option_temperature=false,
+    h0=2.5817e6,
+    C(Q(fixed=true, start=100)),
+    P0=Pin_1)
+            annotation (Placement(transformation(extent={{-100,140},{-80,160}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    option_temperature=false,
+    h0=2.5481e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_2)                     annotation (Placement(transformation(extent={
+            {-182,80},{-162,100}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+    option_temperature=false,
+    h0=2.5055e6,
+    C(Q(fixed=true, start=1e-5)),
+    P0=Pin_3)                      annotation (Placement(transformation(extent=
+            {{-180,40},{-160,60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss(K=10)
+                         annotation (Placement(transformation(extent={{-100,80},
+            {-80,100}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1(K=10)
+                          annotation (Placement(transformation(extent={{-100,40},
+            {-80,60}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2(K=1e-4, rho(start=999.2051327991054))
+                          annotation (Placement(transformation(extent={{-100,0},
+            {-80,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=10)
+                          annotation (Placement(transformation(extent={{-40,140},
+            {-20,160}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1
+             annotation (Placement(transformation(extent={{100,-100},{120,-80}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss4(K=1e-4, rho(start=995.9727926518547))
+                          annotation (Placement(transformation(extent={{100,0},
+            {120,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss5(K=1e-4, rho(start=9.502298036944223))
+                          annotation (Placement(transformation(extent={{40,-100},
+            {60,-80}}, rotation=0)));
+
+equation
+  connect(sourceP1.C, singularPressureLoss.C1)
+    annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255}));
+  connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{
+          -80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255}));
+  connect(sourceP2.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{
+          -80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255}));
+  connect(Source_condenseur.C, singularPressureLoss2.C1)
+    annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{
+          -80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255}));
+  connect(sourceP.C, singularPressureLoss3.C1)
+    annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{
+          -20,150},{26,150},{26,82.49}}, color={0,0,255}));
+  connect(singularPressureLoss4.C2, Puit_condenseur.C)
+    annotation (Line(points={{120,10},{160,10}}, color={0,0,255}));
+  connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{
+          72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255}));
+  connect(singularPressureLoss5.C2, Puit_condenseur1.C)
+    annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255}));
+  connect(singularPressureLoss5.C1, condenseur.Cex)
+    annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16}}));
+  annotation (experiment(StopTime=1000), Diagram(graphics,
+                                                 coordinateSystem(preserveAspectRatio=false, extent={{-200,
+            -200},{200,200}})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticCondenserHEI;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo
index 839d14adde0cfc133de2a61e3e30eea7ee127e8f..1d62207cb77fa4b22053cf2f96219f3c0d2d9d0a 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo
@@ -1,92 +1,92 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticDrum1
-
-  ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1
-    annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI1(K=1e-4)
-    annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI2(K=1e-4)
-    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(Q0=10)
-    annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorT sensorT
-    annotation (Placement(transformation(extent={{40,-82},{60,-62}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    option_temperature=2,
-    W0={2.4e8},
-    T0={290})   annotation (Placement(transformation(extent={{-80,20},{-60,40}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI3(K=1e-4)
-    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
-  BoundaryConditions.PlugB                   sinkP2
-    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorT sensorT1
-    annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.RefP refP(P0=3e5)
-    annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=100)
-    annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=
-           0)));
-  BoundaryConditions.PlugA                    sourcePlug(C(h(fixed=true)))
-    annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=
-           0)));
-  BoundaryConditions.RefXgas refXgas
-    annotation (Placement(transformation(extent={{8,-90},{28,-70}})));
-equation
-  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
-                                                          annotation (Line(
-        points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255}));
-  connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,
-          0},{40,0}}, color={0,0,255}));
-  connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{60.2,
-          -80},{80,-80},{80,-60},{-80,-60},{-80,-40}},      color={0,0,255}));
-  connect(heatSource.C[1], StaticDrumTh1.Cth)
-                                          annotation (Line(points={{-70,20.2},{
-          -70,10},{-44,10}}, color={191,95,0}));
-  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1)
-                                                           annotation (Line(
-        points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255}));
-  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
-                                                          annotation (Line(
-        points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255}));
-  connect(singularPressureLossVALI3.C2, sensorT1.C1)
-    annotation (Line(points={{0,60},{20,60}}, color={0,0,255}));
-  connect(sensorT1.C2, sinkP2.C)
-    annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255}));
-  connect(refQ.C2, refP.C1) annotation (Line(points={{-36,-80},{-26,-80}},
-        color={0,0,255}));
-  connect(sourcePlug.C, refQ.C1) annotation (Line(points={{-70,-80},{-56,-80}},
-        color={0,0,255}));
-  connect(refP.C2, refXgas.C1)
-    annotation (Line(points={{-6,-80},{8,-80}}, color={0,0,0}));
-  connect(refXgas.C2, sensorT.C1)
-    annotation (Line(points={{28,-80},{40,-80}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticDrum1;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticDrum1
+
+  ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1
+    annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI1(K=1e-4)
+    annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI2(K=1e-4)
+    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(Q0=10)
+    annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorT sensorT
+    annotation (Placement(transformation(extent={{40,-82},{60,-62}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    option_temperature=2,
+    W0={2.4e8},
+    T0={290})   annotation (Placement(transformation(extent={{-80,20},{-60,40}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI3(K=1e-4)
+    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
+  BoundaryConditions.PlugB                   sinkP2
+    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorT sensorT1
+    annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.RefP refP(P0=3e5)
+    annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=100)
+    annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=
+           0)));
+  BoundaryConditions.PlugA                    sourcePlug(C(h(fixed=true)))
+    annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=
+           0)));
+  BoundaryConditions.RefXgas refXgas
+    annotation (Placement(transformation(extent={{8,-90},{28,-70}})));
+equation
+  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
+                                                          annotation (Line(
+        points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255}));
+  connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,
+          0},{40,0}}, color={0,0,255}));
+  connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{60.2,
+          -80},{80,-80},{80,-60},{-80,-60},{-80,-40}},      color={0,0,255}));
+  connect(heatSource.C[1], StaticDrumTh1.Cth)
+                                          annotation (Line(points={{-70,20.2},{
+          -70,10},{-44,10}}, color={191,95,0}));
+  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1)
+                                                           annotation (Line(
+        points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255}));
+  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
+                                                          annotation (Line(
+        points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255}));
+  connect(singularPressureLossVALI3.C2, sensorT1.C1)
+    annotation (Line(points={{0,60},{20,60}}, color={0,0,255}));
+  connect(sensorT1.C2, sinkP2.C)
+    annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255}));
+  connect(refQ.C2, refP.C1) annotation (Line(points={{-36,-80},{-26,-80}},
+        color={0,0,255}));
+  connect(sourcePlug.C, refQ.C1) annotation (Line(points={{-70,-80},{-56,-80}},
+        color={0,0,255}));
+  connect(refP.C2, refXgas.C1)
+    annotation (Line(points={{-6,-80},{8,-80}}, color={0,0,0}));
+  connect(refXgas.C2, sensorT.C1)
+    annotation (Line(points={{28,-80},{40,-80}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticDrum1;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo
index 27e73555fc5e67a8ccdcefd5177fb79a12b8b9bc..19e8b6a4d83b583d208bd15d069985f95a0db69c 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticDrum2
-
-  ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1
-    annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI1(K=1e-4)
-    annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI2(K=1e-4)
-    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(Q0=10)
-    annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorT sensorT
-    annotation (Placement(transformation(extent={{-40,-82},{-20,-62}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(P0=100e5)
-    annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=
-           0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
-                                    annotation (Placement(transformation(extent=
-           {{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossVALI3(K=1e-4)
-    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2
-    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorT sensorT1
-    annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0)));
-equation
-  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
-                                                          annotation (Line(
-        points={{-60,-40},{-48,-40},{-48,0.6}}, color={0,0,255}));
-  connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,
-          0},{40,0}}, color={0,0,255}));
-  connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{
-          -19.8,-80},{-10,-80},{-10,-54},{-80,-54},{-80,-40}}, color={0,0,255}));
-  connect(sourcePQ.C, sensorT.C1) annotation (Line(points={{-70,-80},{-40,-80}},
-        color={0,0,255}));
-  connect(heatSource.C[1], StaticDrumTh1.Cth)
-                                          annotation (Line(points={{-70,20.2},{
-          -70,10},{-44,10}}, color={191,95,0}));
-  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1)
-                                                           annotation (Line(
-        points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255}));
-  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
-                                                          annotation (Line(
-        points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255}));
-  connect(singularPressureLossVALI3.C2, sensorT1.C1)
-    annotation (Line(points={{0,60},{20,60}}, color={0,0,255}));
-  connect(sensorT1.C2, sinkP2.C)
-    annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticDrum2;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticDrum2
+
+  ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1
+    annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI1(K=1e-4)
+    annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI2(K=1e-4)
+    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(Q0=10)
+    annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorT sensorT
+    annotation (Placement(transformation(extent={{-40,-82},{-20,-62}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(P0=100e5)
+    annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=
+           0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource
+                                    annotation (Placement(transformation(extent=
+           {{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossVALI3(K=1e-4)
+    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2
+    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorT sensorT1
+    annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0)));
+equation
+  connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco)
+                                                          annotation (Line(
+        points={{-60,-40},{-48,-40},{-48,0.6}}, color={0,0,255}));
+  connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,
+          0},{40,0}}, color={0,0,255}));
+  connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{
+          -19.8,-80},{-10,-80},{-10,-54},{-80,-54},{-80,-40}}, color={0,0,255}));
+  connect(sourcePQ.C, sensorT.C1) annotation (Line(points={{-70,-80},{-40,-80}},
+        color={0,0,255}));
+  connect(heatSource.C[1], StaticDrumTh1.Cth)
+                                          annotation (Line(points={{-70,20.2},{
+          -70,10},{-44,10}}, color={191,95,0}));
+  connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1)
+                                                           annotation (Line(
+        points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255}));
+  connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1)
+                                                          annotation (Line(
+        points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255}));
+  connect(singularPressureLossVALI3.C2, sensorT1.C1)
+    annotation (Line(points={{0,60},{20,60}}, color={0,0,255}));
+  connect(sensorT1.C2, sinkP2.C)
+    annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticDrum2;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo
index 4e0bd56fc7ccfc7052f55e6fe7396cc63bc5c006..200832c40c0d8cd40a133c2969099183f703b1a9 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo
@@ -1,63 +1,63 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticExchangerDTorWorEff
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF(
-    C(P(start=219.E5)),
-    Q0=481.07,
-    h0=1067.9E3)
-    annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF(
-    P0=217.68E5)
-    annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC(
-    C(P(start=24E5)),
-    Q0=23.377,
-    h0=3420.3E3)
-    annotation (Placement(transformation(
-        origin={-30,30},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FC(
-    P0=24.13E5)
-    annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff
-    exchangerWaterSteamDTorWorEFF(
-    EffEch=1,
-    Kf=597.832,
-    Ec(P(start=23e5)),
-    Ef(P(start=219E5)),
-    exchanger_type=3)   annotation (Placement(transformation(extent={{-20,-20},
-            {0,0}}, rotation=0)));
-equation
-  connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef)
-    annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255}));
-  connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation (Line(
-        points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255}));
-  connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation (Line(
-        points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255}));
-  connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation (Line(
-        points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticExchangerDTorWorEff;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticExchangerDTorWorEff
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF(
+    C(P(start=219.E5)),
+    Q0=481.07,
+    h0=1067.9E3)
+    annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF(
+    P0=217.68E5)
+    annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC(
+    C(P(start=24E5)),
+    Q0=23.377,
+    h0=3420.3E3)
+    annotation (Placement(transformation(
+        origin={-30,30},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FC(
+    P0=24.13E5)
+    annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff
+    exchangerWaterSteamDTorWorEFF(
+    EffEch=1,
+    Kf=597.832,
+    Ec(P(start=23e5)),
+    Ef(P(start=219E5)),
+    exchanger_type=3)   annotation (Placement(transformation(extent={{-20,-20},
+            {0,0}}, rotation=0)));
+equation
+  connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef)
+    annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255}));
+  connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation (Line(
+        points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255}));
+  connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation (Line(
+        points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255}));
+  connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation (Line(
+        points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticExchangerDTorWorEff;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo
index 54f2a539a8580c15f862985f9493ae87017fa140..cb48ae0eaa19dba48c42d6c5b47bc5572a20bfdc 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo
@@ -1,53 +1,53 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticExchangerKS
-
-  ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS
-    plateHeatExchanger(region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-               annotation (Placement(transformation(extent={{-20,34},{20,66}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-                                            T0=340)
-    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
-    annotation (Placement(transformation(extent={{-80,60},{-60,80}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2
-                                          annotation (Placement(transformation(
-          extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3
-                                          annotation (Placement(transformation(
-          extent={{60,60},{80,80}}, rotation=0)));
-equation
-  connect(sourceP2.C, plateHeatExchanger.Ec)
-    annotation (Line(points={{-60,30},{-40,30},{-40,45.2},{-20,45.2}},
-                                                 color={0,0,255}));
-  connect(sourceP3.C, plateHeatExchanger.Ef) annotation (Line(points={{-60,70},
-          {-40,70},{-40,54.8},{-20,54.8}}, color={0,0,0}));
-  connect(plateHeatExchanger.Sc, puitsP2.C) annotation (Line(points={{20,45.2},
-          {26,45.2},{26,46},{40,46},{40,30},{60,30}}, color={0,0,0}));
-  connect(plateHeatExchanger.Sf, puitsP3.C) annotation (Line(points={{20,54.8},
-          {40,54.8},{40,70},{60,70}}, color={0,0,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticExchangerKS;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticExchangerKS
+
+  ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS
+    plateHeatExchanger(region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+               annotation (Placement(transformation(extent={{-20,34},{20,66}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+                                            T0=340)
+    annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
+    annotation (Placement(transformation(extent={{-80,60},{-60,80}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2
+                                          annotation (Placement(transformation(
+          extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3
+                                          annotation (Placement(transformation(
+          extent={{60,60},{80,80}}, rotation=0)));
+equation
+  connect(sourceP2.C, plateHeatExchanger.Ec)
+    annotation (Line(points={{-60,30},{-40,30},{-40,45.2},{-20,45.2}},
+                                                 color={0,0,255}));
+  connect(sourceP3.C, plateHeatExchanger.Ef) annotation (Line(points={{-60,70},
+          {-40,70},{-40,54.8},{-20,54.8}}, color={0,0,0}));
+  connect(plateHeatExchanger.Sc, puitsP2.C) annotation (Line(points={{20,45.2},
+          {26,45.2},{26,46},{40,46},{40,30},{60,30}}, color={0,0,0}));
+  connect(plateHeatExchanger.Sf, puitsP3.C) annotation (Line(points={{20,54.8},
+          {40,54.8},{40,70},{60,70}}, color={0,0,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticExchangerKS;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo
index 8e3f4879e194efd9a5fb7fe04b95a53d186bd6af..124364ab62c2ac3a289cadd8a722c0cf13534cc8 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo
@@ -1,223 +1,223 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticFan
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees(
-    Xso2=0,
-    Xco2=0.0,
-    Xh2o=0.006,
-    Xo2=0.23,
-    Q0=4,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    P0=130000,
-    T0=300,
-    option_temperature=true)
-    annotation (Placement(transformation(extent={{-210,-24},{-164,24}},
-          rotation=0)));
-
-  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees
-    annotation (Placement(transformation(
-        origin={182,0},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Fluid.Volumes.VolumeATh                    dynamicExchanger(ftype=
-        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-      option_temperature=2, W0={1e4})
-                            annotation (Placement(transformation(extent={{-48,
-            90},{-28,110}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases(                    Q(fixed=false, start=10), K=10)
-                                  annotation (Placement(transformation(extent={
-            {12,50},{32,70}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases1(                      Q(fixed=false, start=
-          11), K=0.01)            annotation (Placement(transformation(extent={
-            {-108,50},{-88,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=1e4,
-    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,100},{-20,
-            120}}, rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticFan staticFan(
-    VRotn=2700,
-    rm=1,
-    a2=0,
-    b1=-1.315,
-    b2=2.4593,
-    VRot=2700,
-    a1=-263.145,
-    a3=500,
-    Q(start=2),
-    Qv(start=1.4),
-    rho(start=1.4))
-               annotation (Placement(transformation(extent={{52,50},{72,70}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.CheckValve
-    singularPressureLossFlueGases2(                   Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {92,50},{112,70}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.VolumeATh                                 dynamicExchanger1(ftype=
-        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
-           0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
-      option_temperature=2, W0={1e4})
-                            annotation (Placement(transformation(extent={{-48,
-            -90},{-28,-110}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases3(                   Q(fixed=false, start=10), K=10)
-                                  annotation (Placement(transformation(extent={
-            {12,-70},{32,-50}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLossFlueGases4(                      Q(fixed=false, start=
-          11), K=0.01)            annotation (Placement(transformation(extent={
-            {-108,-70},{-88,-50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=1e4,
-    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,-120},{-20,
-            -100}}, rotation=0)));
-  ThermoSysPro.Fluid.Machines.StaticFan staticFan1(
-    VRotn=2700,
-    rm=1,
-    b2=2.4593,
-    b1=-1.315,
-    VRot=2700,
-    a1=-263.145,
-    a2=0,
-    a3=500,
-    Q(start=2),
-    Qv(start=1.4),
-    rho(start=1.4))
-               annotation (Placement(transformation(extent={{52,-70},{72,-50}},
-          rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.CheckValve
-    singularPressureLossFlueGases5(                   Q(fixed=false, start=10))
-                                  annotation (Placement(transformation(extent={
-            {92,-70},{112,-50}}, rotation=0)));
-  ThermoSysPro.Fluid.Junctions.Mixer2 mixerFlueGases2_1(ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Volumes.VolumeDTh volume2S(
-      dynamic_composition_balance=true, ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-148,-10},{-128,10}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorT                        temperatureSensor
-    annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0)));
-  ThermoSysPro.Fluid.Sensors.SensorT                        temperatureSensor1
-    annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin(
-    Starttime=50,
-    Duration=50,
-    Initialvalue=4,
-    Finalvalue=1)   annotation (Placement(transformation(extent={{-200,40},{
-            -180,60}}, rotation=0)));
-equation
-  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
-      points={{32,60},{52,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
-      points={{72,60},{91,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line(
-      points={{32,-60},{52,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line(
-      points={{72,-60},{91,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line(
-      points={{113,60},{138,60},{138,10}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line(
-      points={{113,-60},{138,-60},{138,-10}},
-      color={0,0,0},
-      thickness=1));
-  connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line(
-      points={{-7.8,-60},{12,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line(
-      points={{-7.8,60},{12,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(Source_Fumees.C, volume2S.Ce) annotation (Line(
-      points={{-164,0},{-148,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line(
-      points={{-138,10},{-138,60},{-108,60}},
-      color={0,0,0},
-      thickness=1));
-  connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line(
-      points={{-138,-10},{-138,-60},{-108,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,
-          90.2},{-58,60}}, color={191,95,0}));
-  connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{
-          -38,-90.2},{-58,-60}}, color={191,95,0}));
-  connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line(
-      points={{152,0},{162,0},{162,-1.20011e-015},{172,-1.20011e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (Line(
-      points={{-88,60},{-68,60}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line(
-      points={{-48,60},{-28,60}},
-      color={0,0,0},
-      thickness=1,
-      smooth=Smooth.None));
-  connect(Qin.y, Source_Fumees.IMassFlow)
-    annotation (Line(points={{-179,50},{-170,50},{-170,28},{-187,28},{-187,12}}));
-  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (
-     Line(
-      points={{-88,-60},{-68,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(dynamicExchanger1.Cs1, temperatureSensor1.C1) annotation (Line(
-      points={{-48,-60},{-38,-60},{-28,-60}},
-      color={0,0,0},
-      thickness=1));
-  connect(rampe.y, heatSource.ISignal)
-    annotation (Line(points={{-21,110},{-38,110},{-38,105}}, color={0,0,255}));
-  connect(rampe1.y, heatSource1.ISignal) annotation (Line(points={{-21,-110},{
-          -38,-110},{-38,-105}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-150},{200,150}},
-        initialScale=0.1)),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticFan;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticFan
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees(
+    Xso2=0,
+    Xco2=0.0,
+    Xh2o=0.006,
+    Xo2=0.23,
+    Q0=4,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    P0=130000,
+    T0=300,
+    option_temperature=true)
+    annotation (Placement(transformation(extent={{-210,-24},{-164,24}},
+          rotation=0)));
+
+  ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees
+    annotation (Placement(transformation(
+        origin={182,0},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Fluid.Volumes.VolumeATh                    dynamicExchanger(ftype=
+        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+      option_temperature=2, W0={1e4})
+                            annotation (Placement(transformation(extent={{-48,
+            90},{-28,110}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases(                    Q(fixed=false, start=10), K=10)
+                                  annotation (Placement(transformation(extent={
+            {12,50},{32,70}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases1(                      Q(fixed=false, start=
+          11), K=0.01)            annotation (Placement(transformation(extent={
+            {-108,50},{-88,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=1e4,
+    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,100},{-20,
+            120}}, rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticFan staticFan(
+    VRotn=2700,
+    rm=1,
+    a2=0,
+    b1=-1.315,
+    b2=2.4593,
+    VRot=2700,
+    a1=-263.145,
+    a3=500,
+    Q(start=2),
+    Qv(start=1.4),
+    rho(start=1.4))
+               annotation (Placement(transformation(extent={{52,50},{72,70}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.CheckValve
+    singularPressureLossFlueGases2(                   Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {92,50},{112,70}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.VolumeATh                                 dynamicExchanger1(ftype=
+        ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
+           0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
+      option_temperature=2, W0={1e4})
+                            annotation (Placement(transformation(extent={{-48,
+            -90},{-28,-110}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases3(                   Q(fixed=false, start=10), K=10)
+                                  annotation (Placement(transformation(extent={
+            {12,-70},{32,-50}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLossFlueGases4(                      Q(fixed=false, start=
+          11), K=0.01)            annotation (Placement(transformation(extent={
+            {-108,-70},{-88,-50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=1e4,
+    Finalvalue=2e5) annotation (Placement(transformation(extent={{0,-120},{-20,
+            -100}}, rotation=0)));
+  ThermoSysPro.Fluid.Machines.StaticFan staticFan1(
+    VRotn=2700,
+    rm=1,
+    b2=2.4593,
+    b1=-1.315,
+    VRot=2700,
+    a1=-263.145,
+    a2=0,
+    a3=500,
+    Q(start=2),
+    Qv(start=1.4),
+    rho(start=1.4))
+               annotation (Placement(transformation(extent={{52,-70},{72,-50}},
+          rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.CheckValve
+    singularPressureLossFlueGases5(                   Q(fixed=false, start=10))
+                                  annotation (Placement(transformation(extent={
+            {92,-70},{112,-50}}, rotation=0)));
+  ThermoSysPro.Fluid.Junctions.Mixer2 mixerFlueGases2_1(ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Volumes.VolumeDTh volume2S(
+      dynamic_composition_balance=true, ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-148,-10},{-128,10}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorT                        temperatureSensor
+    annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0)));
+  ThermoSysPro.Fluid.Sensors.SensorT                        temperatureSensor1
+    annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin(
+    Starttime=50,
+    Duration=50,
+    Initialvalue=4,
+    Finalvalue=1)   annotation (Placement(transformation(extent={{-200,40},{
+            -180,60}}, rotation=0)));
+equation
+  connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line(
+      points={{32,60},{52,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line(
+      points={{72,60},{91,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line(
+      points={{32,-60},{52,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line(
+      points={{72,-60},{91,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line(
+      points={{113,60},{138,60},{138,10}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line(
+      points={{113,-60},{138,-60},{138,-10}},
+      color={0,0,0},
+      thickness=1));
+  connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line(
+      points={{-7.8,-60},{12,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line(
+      points={{-7.8,60},{12,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(Source_Fumees.C, volume2S.Ce) annotation (Line(
+      points={{-164,0},{-148,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line(
+      points={{-138,10},{-138,60},{-108,60}},
+      color={0,0,0},
+      thickness=1));
+  connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line(
+      points={{-138,-10},{-138,-60},{-108,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,
+          90.2},{-58,60}}, color={191,95,0}));
+  connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{
+          -38,-90.2},{-58,-60}}, color={191,95,0}));
+  connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line(
+      points={{152,0},{162,0},{162,-1.20011e-015},{172,-1.20011e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (Line(
+      points={{-88,60},{-68,60}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line(
+      points={{-48,60},{-28,60}},
+      color={0,0,0},
+      thickness=1,
+      smooth=Smooth.None));
+  connect(Qin.y, Source_Fumees.IMassFlow)
+    annotation (Line(points={{-179,50},{-170,50},{-170,28},{-187,28},{-187,12}}));
+  connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (
+     Line(
+      points={{-88,-60},{-68,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(dynamicExchanger1.Cs1, temperatureSensor1.C1) annotation (Line(
+      points={{-48,-60},{-38,-60},{-28,-60}},
+      color={0,0,0},
+      thickness=1));
+  connect(rampe.y, heatSource.ISignal)
+    annotation (Line(points={{-21,110},{-38,110},{-38,105}}, color={0,0,255}));
+  connect(rampe1.y, heatSource1.ISignal) annotation (Line(points={{-21,-110},{
+          -38,-110},{-38,-105}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-150},{200,150}},
+        initialScale=0.1)),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticFan;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo
index cef1ff21ac9de25b72b9acd8e3c0ba75fce746d5..350ca00a8b86266e2b89374ef41108fe2752167f 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo
@@ -1,55 +1,55 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticPlateHeatExchanger
-
-  ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger
-    plateHeatExchanger(region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
-      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
-               annotation (Placement(transformation(extent={{-20,44},{0,64}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-                                            T0=340)
-    annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
-    annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2
-                                          annotation (Placement(transformation(
-          extent={{40,44},{60,64}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3
-                                          annotation (Placement(transformation(
-          extent={{20,24},{40,44}}, rotation=0)));
-equation
-  connect(sourceP2.C, plateHeatExchanger.Ec)
-    annotation (Line(points={{-60,54},{-20,54}}, color={0,0,255}));
-  connect(sourceP3.C, plateHeatExchanger.Ef)
-                                            annotation (Line(points={{-40,34},{
-          -15,34},{-15,48}}, color={0,0,255}));
-  connect(plateHeatExchanger.Sc, puitsP2.C)
-                                           annotation (Line(points={{0,54.2},{
-          20,54.2},{20,54},{40,54}}, color={0,0,255}));
-  connect(plateHeatExchanger.Sf, puitsP3.C)
-                                           annotation (Line(points={{-5,48},{-6,
-          48},{-6,34},{20,34}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticPlateHeatExchanger;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticPlateHeatExchanger
+
+  ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger
+    plateHeatExchanger(region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1,
+      region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1)
+               annotation (Placement(transformation(extent={{-20,44},{0,64}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+                                            T0=340)
+    annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3
+    annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2
+                                          annotation (Placement(transformation(
+          extent={{40,44},{60,64}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3
+                                          annotation (Placement(transformation(
+          extent={{20,24},{40,44}}, rotation=0)));
+equation
+  connect(sourceP2.C, plateHeatExchanger.Ec)
+    annotation (Line(points={{-60,54},{-20,54}}, color={0,0,255}));
+  connect(sourceP3.C, plateHeatExchanger.Ef)
+                                            annotation (Line(points={{-40,34},{
+          -15,34},{-15,48}}, color={0,0,255}));
+  connect(plateHeatExchanger.Sc, puitsP2.C)
+                                           annotation (Line(points={{0,54.2},{
+          20,54.2},{20,54},{40,54}}, color={0,0,255}));
+  connect(plateHeatExchanger.Sf, puitsP3.C)
+                                           annotation (Line(points={{-5,48},{-6,
+          48},{-6,34},{20,34}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticPlateHeatExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo
index 44c78da7383d6439ccd6c6fa0f85e1b410e23645..cfedfae65869b0b1f60c1507eb2f738596d621a0 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStaticWallFlueGasesExchanger
-
-  HeatExchangers.StaticWallFlueGasesExchanger
-    dynamicOnePhaseFlowPipe(
-    Q(start={536.5750641592207,536.5750641592207,536.5750641592207,
-          536.5750641592207,536.5750641592207,536.5750641592207,
-          536.5750641592207,536.5750641592207,536.5750641592207,
-          536.5750641592207,536.5750641592207}),
-    h(start={71016.12237181116,74743.46665892199,78470.81094603281,
-          82198.15523314364,85925.49952025448,89652.84380736532,
-          93380.18809447614,97107.53238158698,100834.8766686978,
-          104562.22095580865,108289.56524291947,70825.9016030344}),
-    p_rho=998,
-    P(start={300000,281833.41863537,263664.30473175,245492.47958308,
-          227317.76827098,209139.99948382,190959.00534677,172774.621262,
-          154586.68575823,136395.04034906,118199.5293995,100000}))
-                            annotation (Placement(transformation(extent={{-20,
-            20},{0,40}}, rotation=0)));
-  BoundaryConditions.SourcePQ                   sourceP(
-    option_temperature=true,
-    Q0=1,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  BoundaryConditions.Sink                     sinkP
-    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
-  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
-    T0={273 + 400,273 + 400,273 + 400,273 + 400,273 + 400,273 + 400,273 + 400,
-        273 + 400,273 + 400,273 + 400},
-    option_temperature=2,
-    W0={6e4,6e4,6e4,6e4,6e4,6e4,6e4,6e4,6e4,6e4})
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10,
-      dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-equation
-  connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-40,
-          30},{-20,30}}, color={0,0,255}));
-  connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{0,30},
-          {20,30}}, color={0,0,255}));
-  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{-10,
-          60.2},{-10,52}}, color={191,95,0}));
-  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh)
-    annotation (Line(points={{-10,48},{-10,33}}, color={191,95,0}));
-  annotation (experiment(StopTime=1000),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStaticWallFlueGasesExchanger;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStaticWallFlueGasesExchanger
+
+  HeatExchangers.StaticWallFlueGasesExchanger
+    dynamicOnePhaseFlowPipe(
+    Q(start={536.5750641592207,536.5750641592207,536.5750641592207,
+          536.5750641592207,536.5750641592207,536.5750641592207,
+          536.5750641592207,536.5750641592207,536.5750641592207,
+          536.5750641592207,536.5750641592207}),
+    h(start={71016.12237181116,74743.46665892199,78470.81094603281,
+          82198.15523314364,85925.49952025448,89652.84380736532,
+          93380.18809447614,97107.53238158698,100834.8766686978,
+          104562.22095580865,108289.56524291947,70825.9016030344}),
+    p_rho=998,
+    P(start={300000,281833.41863537,263664.30473175,245492.47958308,
+          227317.76827098,209139.99948382,190959.00534677,172774.621262,
+          154586.68575823,136395.04034906,118199.5293995,100000}))
+                            annotation (Placement(transformation(extent={{-20,
+            20},{0,40}}, rotation=0)));
+  BoundaryConditions.SourcePQ                   sourceP(
+    option_temperature=true,
+    Q0=1,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  BoundaryConditions.Sink                     sinkP
+    annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0)));
+  ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+    T0={273 + 400,273 + 400,273 + 400,273 + 400,273 + 400,273 + 400,273 + 400,
+        273 + 400,273 + 400,273 + 400},
+    option_temperature=2,
+    W0={6e4,6e4,6e4,6e4,6e4,6e4,6e4,6e4,6e4,6e4})
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10,
+      dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+equation
+  connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-40,
+          30},{-20,30}}, color={0,0,255}));
+  connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{0,30},
+          {20,30}}, color={0,0,255}));
+  connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{-10,
+          60.2},{-10,52}}, color={191,95,0}));
+  connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh)
+    annotation (Line(points={{-10,48},{-10,33}}, color={191,95,0}));
+  annotation (experiment(StopTime=1000),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStaticWallFlueGasesExchanger;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo
index 9927ff6da98172346444079308c3f4d6dacc6a1d..727cdf4819ad74ea77a2312c99a1518999c2d715 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo
@@ -1,62 +1,62 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSteamDryer1
-
-  ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(
-    eta=1,
-    h(start=3e6),
-    P(start=10000000))
-                  annotation (Placement(transformation(extent={{-20,20},{0,40}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(h0=3000000)
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20},
-            {-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0=100e5)
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
-            {40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=2.e-3)
-                          annotation (Placement(transformation(extent={{0,-20},
-            {20,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0)));
-equation
-  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-80,30},
-          {-60,30}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2,sinkP. C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2,sink. C)
-    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{
-          -40,30},{-30,30},{-30,34},{-19.9,34}}, color={0,0,255}));
-  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{
-          -0.1,34},{10,34},{10,30},{20,30}}, color={0,0,255}));
-  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{
-          -9.9,20},{-10,20},{-10,-10},{0,-10}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestSteamDryer1;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSteamDryer1
+
+  ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(
+    eta=1,
+    h(start=3e6),
+    P(start=10000000))
+                  annotation (Placement(transformation(extent={{-20,20},{0,40}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(h0=3000000)
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20},
+            {-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0=100e5)
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
+            {40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=2.e-3)
+                          annotation (Placement(transformation(extent={{0,-20},
+            {20,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0)));
+equation
+  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-80,30},
+          {-60,30}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2,sinkP. C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2,sink. C)
+    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{
+          -40,30},{-30,30},{-30,34},{-19.9,34}}, color={0,0,255}));
+  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{
+          -0.1,34},{10,34},{10,30},{20,30}}, color={0,0,255}));
+  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{
+          -9.9,20},{-10,20},{-10,-10},{0,-10}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestSteamDryer1;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo
index 861a4dd38aa82860dc8121847cddb39df44da7e7..3c71cb63e3441d7472d762c6f6212c171c949f03 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo
@@ -1,62 +1,62 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSteamDryer2
-
-  ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta=0.9, P(start=
-          10000000)) annotation (Placement(transformation(extent={{-10,-8},{10,
-            12}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0=
-        2400000)
-    annotation (Placement(transformation(extent={{-90,-4},{-70,16}},  rotation=
-            0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4},
-            {-30,16}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP
-    annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4},
-            {50,16}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=1.e-4)
-                          annotation (Placement(transformation(extent={{30,-44},
-            {50,-24}},
-                     rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
-    annotation (Placement(transformation(extent={{70,-44},{90,-24}},
-                                                                   rotation=0)));
-equation
-  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-70,6},
-          {-50,6}},  color={0,0,255}));
-  connect(singularPressureLoss1.C2,sinkP. C)
-    annotation (Line(points={{50,6},{70,6}},   color={0,0,255}));
-  connect(singularPressureLoss3.C2,sink. C)
-    annotation (Line(points={{50,-34},{70,-34}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{-30,6},
-          {-20,6},{-9.9,6}},                     color={0,0,255}));
-  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{9.9,6},
-          {20,6},{30,6}},                    color={0,0,255}));
-  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{0.1,-8},
-          {0,-8},{0,-34},{30,-34}},             color={0,0,255}));
-  annotation (experiment(StopTime=10), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestSteamDryer2;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSteamDryer2
+
+  ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta=0.9, P(start=
+          10000000)) annotation (Placement(transformation(extent={{-10,-8},{10,
+            12}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0=
+        2400000)
+    annotation (Placement(transformation(extent={{-90,-4},{-70,16}},  rotation=
+            0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4},
+            {-30,16}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP
+    annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4},
+            {50,16}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=1.e-4)
+                          annotation (Placement(transformation(extent={{30,-44},
+            {50,-24}},
+                     rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink sink
+    annotation (Placement(transformation(extent={{70,-44},{90,-24}},
+                                                                   rotation=0)));
+equation
+  connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-70,6},
+          {-50,6}},  color={0,0,255}));
+  connect(singularPressureLoss1.C2,sinkP. C)
+    annotation (Line(points={{50,6},{70,6}},   color={0,0,255}));
+  connect(singularPressureLoss3.C2,sink. C)
+    annotation (Line(points={{50,-34},{70,-34}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{-30,6},
+          {-20,6},{-9.9,6}},                     color={0,0,255}));
+  connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{9.9,6},
+          {20,6},{30,6}},                    color={0,0,255}));
+  connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{0.1,-8},
+          {0,-8},{0,-34},{30,-34}},             color={0,0,255}));
+  annotation (experiment(StopTime=10), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestSteamDryer2;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo
index 2c8109c425c14260a4edc890ceb5d84dd39363db..aef85a2ff614b6a11418a620814e2223491b4ae2 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo
@@ -1,51 +1,51 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSteamEngine
-
-  ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=100000)
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    h0=3.e6,
-    option_temperature=false,
-    P0=16e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
-          rotation=0)));
-equation
-  connect(sourceP.C, steamEngine1.C1)
-    annotation (Line(points={{-80,70},{-57,70}}, color={0,0,255}));
-  connect(steamEngine1.C2, puitsP.C)
-    annotation (Line(points={{-43,70},{-31.5,70},{-31.5,70},{-20,70}}, color={0,
-          0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestSteamEngine;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSteamEngine
+
+  ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=100000)
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    h0=3.e6,
+    option_temperature=false,
+    P0=16e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}},
+          rotation=0)));
+equation
+  connect(sourceP.C, steamEngine1.C1)
+    annotation (Line(points={{-80,70},{-57,70}}, color={0,0,255}));
+  connect(steamEngine1.C2, puitsP.C)
+    annotation (Line(points={{-43,70},{-31.5,70},{-31.5,70},{-20,70}}, color={0,
+          0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestSteamEngine;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo
index e58de42e00c73ded35173a5ae15511429d66090d..b6dc407da67ffd8f72a16c2a7f50e00df33b93e6 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo
@@ -1,61 +1,61 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSteamExtractionSplitter
-
-  ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter
-    steamExtractionSplitter(alpha=0.9)
-                            annotation (Placement(transformation(extent={{-20,
-            20},{0,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(h0=2600000)
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20},
-            {-40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0=100e5)
-    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
-            {40,40}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
-    singularPressureLoss3(K=2.e-3)
-                          annotation (Placement(transformation(extent={{0,-20},
-            {20,0}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(Q0=10)
-    annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0)));
-equation
-  connect(sourceQ.C, singularPressureLoss2.C1) annotation (Line(points={{-80,30},
-          {-60,30}}, color={0,0,255}));
-  connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation (Line(
-        points={{-40,30},{-20.3,30}}, color={0,0,255}));
-  connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation (Line(
-        points={{0.3,30},{20,30}}, color={0,0,255}));
-  connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation (Line(
-        points={{-6,20},{-6,-10},{0,-10}}, color={0,0,255}));
-  connect(singularPressureLoss1.C2, sinkP.C)
-    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
-  connect(singularPressureLoss3.C2, sink.C)
-    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000), Diagram(graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestSteamExtractionSplitter;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSteamExtractionSplitter
+
+  ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter
+    steamExtractionSplitter(alpha=0.9)
+                            annotation (Placement(transformation(extent={{-20,
+            20},{0,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(h0=2600000)
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20},
+            {-40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0=100e5)
+    annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss1 annotation (Placement(transformation(extent={{20,20},
+            {40,40}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss
+    singularPressureLoss3(K=2.e-3)
+                          annotation (Placement(transformation(extent={{0,-20},
+            {20,0}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(Q0=10)
+    annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0)));
+equation
+  connect(sourceQ.C, singularPressureLoss2.C1) annotation (Line(points={{-80,30},
+          {-60,30}}, color={0,0,255}));
+  connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation (Line(
+        points={{-40,30},{-20.3,30}}, color={0,0,255}));
+  connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation (Line(
+        points={{0.3,30},{20,30}}, color={0,0,255}));
+  connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation (Line(
+        points={{-6,20},{-6,-10},{0,-10}}, color={0,0,255}));
+  connect(singularPressureLoss1.C2, sinkP.C)
+    annotation (Line(points={{40,30},{60,30}}, color={0,0,255}));
+  connect(singularPressureLoss3.C2, sink.C)
+    annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000), Diagram(graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestSteamExtractionSplitter;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo
index ef82c7dcdec695e71295224b031d19585fe65499..6729f0c9d3003e8a62c1187292c68004b3243a03 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo
@@ -1,92 +1,92 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStodolaTurbine1
-  parameter Units.SI.AbsolutePressure PoutPump(fixed=false, start=13e5)
-    "Flow pressure at the outlet of the pump";
-  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(pros1(x(start=
-            1)), Hrs(start=2931e3),
-    pros(d(start=19.715136086827403)),
-    Ce(h(start=3000000.0)),
-    proe(T(start=613.0), x(start=1.0)))
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=45e5,
-    C(h_vol_1(start=75002)))
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    h0=3.e6,
-    option_temperature=false,
-    P0=6500000,
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2)
-             annotation (Placement(transformation(extent={{-100,60},{-80,80}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Machines.CentrifugalPump
-    DynamicCentrifugalPump1(
-                        Q(fixed=true, start=50),
-    Qv(start=23.0),
-    Pm(start=1158163.6),
-    h(start=3041170.0441966015),
-    C1(P(start=10e5)),
-    C2(P(start=3.e6), h(start=3082340.088393203)),
-    hn(start=7119.0),
-    w_a(start=20.0))
-    annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0)));
-  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
-    annotation (Placement(transformation(extent={{-20,-90},{0,-70}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0=13e5)
-    annotation (Placement(transformation(extent={{60,-40},{80,-20}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    h0=3.e6,
-    option_temperature=false,
-    P0=1000000,
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2)
-             annotation (Placement(transformation(extent={{-20,-40},{0,-20}},
-          rotation=0)));
-  InstrumentationAndControl.Blocks.Sources.Constante Pout(k=PoutPump)
-    annotation (Placement(transformation(extent={{56,-12},{68,0}}, rotation=0)));
-equation
-  connect(Shaft1.C2, DynamicCentrifugalPump1.M)
-    annotation (Line(points={{1,-80},{30,-80},{30,-41}}));
-  connect(stodolaTurbine.M, Shaft1.C1)
-    annotation (Line(points={{-50,60},{-50,-80},{-21,-80}}));
-  connect(sourceP1.C, DynamicCentrifugalPump1.C1)
-    annotation (Line(points={{0,-30},{20,-30}}, color={0,0,255}));
-  connect(DynamicCentrifugalPump1.C2, puitsP1.C) annotation (Line(points={{40,-30},
-          {50,-30},{50,-30},{60,-30}},          color={0,0,255}));
-  connect(sourceP.C, stodolaTurbine.Ce)
-    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
-  connect(stodolaTurbine.Cs, puitsP.C)
-    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
-  connect(Pout.y, puitsP1.IPressure)
-    annotation (Line(points={{68.6,-6},{88,-6},{88,-30},{75,-30}}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStodolaTurbine1;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStodolaTurbine1
+  parameter Units.SI.AbsolutePressure PoutPump(fixed=false, start=13e5)
+    "Flow pressure at the outlet of the pump";
+  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(pros1(x(start=
+            1)), Hrs(start=2931e3),
+    pros(d(start=19.715136086827403)),
+    Ce(h(start=3000000.0)),
+    proe(T(start=613.0), x(start=1.0)))
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=45e5,
+    C(h_vol_1(start=75002)))
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    h0=3.e6,
+    option_temperature=false,
+    P0=6500000,
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2)
+             annotation (Placement(transformation(extent={{-100,60},{-80,80}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Machines.CentrifugalPump
+    DynamicCentrifugalPump1(
+                        Q(fixed=true, start=50),
+    Qv(start=23.0),
+    Pm(start=1158163.6),
+    h(start=3041170.0441966015),
+    C1(P(start=10e5)),
+    C2(P(start=3.e6), h(start=3082340.088393203)),
+    hn(start=7119.0),
+    w_a(start=20.0))
+    annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0)));
+  ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1
+    annotation (Placement(transformation(extent={{-20,-90},{0,-70}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0=13e5)
+    annotation (Placement(transformation(extent={{60,-40},{80,-20}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    h0=3.e6,
+    option_temperature=false,
+    P0=1000000,
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2)
+             annotation (Placement(transformation(extent={{-20,-40},{0,-20}},
+          rotation=0)));
+  InstrumentationAndControl.Blocks.Sources.Constante Pout(k=PoutPump)
+    annotation (Placement(transformation(extent={{56,-12},{68,0}}, rotation=0)));
+equation
+  connect(Shaft1.C2, DynamicCentrifugalPump1.M)
+    annotation (Line(points={{1,-80},{30,-80},{30,-41}}));
+  connect(stodolaTurbine.M, Shaft1.C1)
+    annotation (Line(points={{-50,60},{-50,-80},{-21,-80}}));
+  connect(sourceP1.C, DynamicCentrifugalPump1.C1)
+    annotation (Line(points={{0,-30},{20,-30}}, color={0,0,255}));
+  connect(DynamicCentrifugalPump1.C2, puitsP1.C) annotation (Line(points={{40,-30},
+          {50,-30},{50,-30},{60,-30}},          color={0,0,255}));
+  connect(sourceP.C, stodolaTurbine.Ce)
+    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
+  connect(stodolaTurbine.Cs, puitsP.C)
+    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
+  connect(Pout.y, puitsP1.IPressure)
+    annotation (Line(points={{68.6,-6},{88,-6},{88,-30},{75,-30}}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStodolaTurbine1;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo
index be9f2819da2aa3d7f2accca12c7f6f9b703b954c..7c7e7aa826ff2a592baec2fa70e8d417f880b44e 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo
@@ -1,53 +1,53 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestStodolaTurbine2
-
-  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Ce(h(start=
-            3000000.0)))
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=5000)
-    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    h0=3.e6,
-    option_temperature=false,
-    P0=300000,
-    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2)
-             annotation (Placement(transformation(extent={{-100,60},{-80,80}},
-          rotation=0)));
-equation
-  connect(sourceP.C, stodolaTurbine.Ce)
-    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
-  connect(stodolaTurbine.Cs, puitsP.C)
-    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
-  annotation (experiment(StopTime=1000),
-    Window(
-      x=0.32,
-      y=0.02,
-      width=0.39,
-      height=0.47),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestStodolaTurbine2;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestStodolaTurbine2
+
+  ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Ce(h(start=
+            3000000.0)))
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=5000)
+    annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    h0=3.e6,
+    option_temperature=false,
+    P0=300000,
+    region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2)
+             annotation (Placement(transformation(extent={{-100,60},{-80,80}},
+          rotation=0)));
+equation
+  connect(sourceP.C, stodolaTurbine.Ce)
+    annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255}));
+  connect(stodolaTurbine.Cs, puitsP.C)
+    annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255}));
+  annotation (experiment(StopTime=1000),
+    Window(
+      x=0.32,
+      y=0.02,
+      width=0.39,
+      height=0.47),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestStodolaTurbine2;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo
index e6a11c262ebeba3d4455752bd0e6ddb8fe8af12e..94b0befe36c648a81afccd89ed656658b73e1286 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo
@@ -1,67 +1,67 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestSwitchValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}},rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{80,-10},{100,10}},
-                                    rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve
-                                          annotation (Placement(transformation(
-          extent={{-10,-4},{10,16}},rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
-                                         width=10, period=20)
-    annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP2
-                                        annotation (Placement(transformation(
-          extent={{-60,-10},{-39,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP1
-                                        annotation (Placement(transformation(
-          extent={{40,-10},{60,10}},rotation=0)));
-equation
-  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-39,60},{0,60},{
-          0,13.2}}));
-  connect(SourceP1.C, perteDP2.C1)
-    annotation (Line(points={{-80,0},{-60,0}},   color={0,0,255}));
-  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-39,0},{-10,0}},
-                                      color={0,0,255}));
-  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{10,0},{40,0}},
-                                   color={0,0,255}));
-  connect(perteDP1.C2, PuitsP1.C)
-    annotation (Line(points={{60,0},{80,0}},           color={0,0,255}));
-  annotation (experiment(StopTime=100),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(graphics,
-            coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestSwitchValve;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestSwitchValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}},rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{80,-10},{100,10}},
+                                    rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve
+                                          annotation (Placement(transformation(
+          extent={{-10,-4},{10,16}},rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(
+                                         width=10, period=20)
+    annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP2
+                                        annotation (Placement(transformation(
+          extent={{-60,-10},{-39,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe              perteDP1
+                                        annotation (Placement(transformation(
+          extent={{40,-10},{60,10}},rotation=0)));
+equation
+  connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-39,60},{0,60},{
+          0,13.2}}));
+  connect(SourceP1.C, perteDP2.C1)
+    annotation (Line(points={{-80,0},{-60,0}},   color={0,0,255}));
+  connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-39,0},{-10,0}},
+                                      color={0,0,255}));
+  connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{10,0},{40,0}},
+                                   color={0,0,255}));
+  connect(perteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{60,0},{80,0}},           color={0,0,255}));
+  annotation (experiment(StopTime=100),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(graphics,
+            coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestSwitchValve;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo
index 2975594217bb292ae4b54502252b8bb75945d112..74aad887824a9c92f75304f171562d9523bcef86 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo
@@ -1,67 +1,67 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestTank
-
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1(C1(P(start=
-            400000.0)), Q(start=600.0))
-    annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1(Pm(start=
-          200000.0), Q(start=0.0))
-    annotation (Placement(transformation(extent={{-50,2},{-30,22}},  rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-                                            annotation (Placement(
-        transformation(extent={{-90,-4},{-70,16}}, rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-50},{90,-30}}, rotation=0)));
-  ThermoSysPro.Fluid.Volumes.Tank Tank1(z(fixed=false, start=5), Cs1(Q(start=
-            0.0)),
-    steady_state=true)
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}},
-                                                                  rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
-    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
-            0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2
-    annotation (Placement(transformation(extent={{30,-4},{50,16}},   rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
-                                          annotation (Placement(transformation(
-          extent={{70,-4},{90,16}},   rotation=0)));
-equation
-  connect(PerteDP1.C2, PuitsP1.C)
-    annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255}));
-  connect(SourceP1.C, VanneReglante1.C1)
-    annotation (Line(points={{-70,6},{-50,6}},   color={0,0,255}));
-  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{10,-6},{20,-6},{20,
-          -40},{30,-40}}, color={0,0,255}));
-  connect(Rampe1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{-69,40},{-40,40},{-40,23}}));
-  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},
-          {-10,6}},               color={0,0,255}));
-  connect(Tank1.Cs1, PerteDP2.C1)
-    annotation (Line(points={{10.2,6},{20,6},{30,6}},   color={0,0,255}));
-  connect(PerteDP2.C2, PuitsP2.C)
-    annotation (Line(points={{50,6},{50,6},{70,6}},    color={0,0,255}));
-  annotation (experiment(StopTime=20),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestTank;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestTank
+
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1(C1(P(start=
+            400000.0)), Q(start=600.0))
+    annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1(Pm(start=
+          200000.0), Q(start=0.0))
+    annotation (Placement(transformation(extent={{-50,2},{-30,22}},  rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+                                            annotation (Placement(
+        transformation(extent={{-90,-4},{-70,16}}, rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-50},{90,-30}}, rotation=0)));
+  ThermoSysPro.Fluid.Volumes.Tank Tank1(z(fixed=false, start=5), Cs1(Q(start=
+            0.0)),
+    steady_state=true)
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}},
+                                                                  rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
+    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
+            0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2
+    annotation (Placement(transformation(extent={{30,-4},{50,16}},   rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
+                                          annotation (Placement(transformation(
+          extent={{70,-4},{90,16}},   rotation=0)));
+equation
+  connect(PerteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255}));
+  connect(SourceP1.C, VanneReglante1.C1)
+    annotation (Line(points={{-70,6},{-50,6}},   color={0,0,255}));
+  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{10,-6},{20,-6},{20,
+          -40},{30,-40}}, color={0,0,255}));
+  connect(Rampe1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{-69,40},{-40,40},{-40,23}}));
+  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},
+          {-10,6}},               color={0,0,255}));
+  connect(Tank1.Cs1, PerteDP2.C1)
+    annotation (Line(points={{10.2,6},{20,6},{30,6}},   color={0,0,255}));
+  connect(PerteDP2.C2, PuitsP2.C)
+    annotation (Line(points={{50,6},{50,6},{70,6}},    color={0,0,255}));
+  annotation (experiment(StopTime=20),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestTank;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo
index 35974f75103483221a2e06627c8c880aeacefbef..669ea88b99f39db4756214c6110900118bc2a8e4 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo
@@ -1,69 +1,69 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestTankHorizontal
-
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1(C1(P(start=
-            400000.0)), Q(start=600.0))
-    annotation (Placement(transformation(extent={{32,-20},{52,0}},   rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1(Pm(start=
-          200000.0), Q(start=0.0))
-    annotation (Placement(transformation(extent={{-50,6},{-30,26}},  rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-                                            annotation (Placement(
-        transformation(extent={{-90,0},{-70,20}},  rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-20},{90,0}},   rotation=0)));
-  Volumes.TankHorizontal          Tank1(z(fixed=false, start=5), Cs1(Q(start=
-            0.0)),
-    diffusion=true,
-    dynamic_mass_balance=true)
-    annotation (Placement(transformation(extent={{-20,-20},{20,20}},
-                                                                  rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
-    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
-            0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2
-    annotation (Placement(transformation(extent={{32,0},{52,20}},    rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
-                                          annotation (Placement(transformation(
-          extent={{70,0},{90,20}},    rotation=0)));
-equation
-  connect(PerteDP1.C2, PuitsP1.C)
-    annotation (Line(points={{52,-10},{70,-10}}, color={0,0,255}));
-  connect(SourceP1.C, VanneReglante1.C1)
-    annotation (Line(points={{-70,10},{-50,10}}, color={0,0,255}));
-  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{20,-10},{32,-10}},
-                          color={0,0,255}));
-  connect(Rampe1.y, VanneReglante1.Ouv)
-    annotation (Line(points={{-69,40},{-40,40},{-40,27}}));
-  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,10},{-20,
-          10}},                   color={0,0,255}));
-  connect(Tank1.Cs1, PerteDP2.C1)
-    annotation (Line(points={{20.4,9.8},{20.4,10},{32,10}},
-                                                        color={0,0,255}));
-  connect(PerteDP2.C2, PuitsP2.C)
-    annotation (Line(points={{52,10},{70,10}},         color={0,0,255}));
-  annotation (experiment(StopTime=20),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestTankHorizontal;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestTankHorizontal
+
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1(C1(P(start=
+            400000.0)), Q(start=600.0))
+    annotation (Placement(transformation(extent={{32,-20},{52,0}},   rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1(Pm(start=
+          200000.0), Q(start=0.0))
+    annotation (Placement(transformation(extent={{-50,6},{-30,26}},  rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+                                            annotation (Placement(
+        transformation(extent={{-90,0},{-70,20}},  rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-20},{90,0}},   rotation=0)));
+  Volumes.TankHorizontal          Tank1(z(fixed=false, start=5), Cs1(Q(start=
+            0.0)),
+    diffusion=true,
+    dynamic_mass_balance=true)
+    annotation (Placement(transformation(extent={{-20,-20},{20,20}},
+                                                                  rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1
+    annotation (Placement(transformation(extent={{-90,30},{-70,50}},  rotation=
+            0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2
+    annotation (Placement(transformation(extent={{32,0},{52,20}},    rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
+                                          annotation (Placement(transformation(
+          extent={{70,0},{90,20}},    rotation=0)));
+equation
+  connect(PerteDP1.C2, PuitsP1.C)
+    annotation (Line(points={{52,-10},{70,-10}}, color={0,0,255}));
+  connect(SourceP1.C, VanneReglante1.C1)
+    annotation (Line(points={{-70,10},{-50,10}}, color={0,0,255}));
+  connect(Tank1.Cs2, PerteDP1.C1)  annotation (Line(points={{20,-10},{32,-10}},
+                          color={0,0,255}));
+  connect(Rampe1.y, VanneReglante1.Ouv)
+    annotation (Line(points={{-69,40},{-40,40},{-40,27}}));
+  connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,10},{-20,
+          10}},                   color={0,0,255}));
+  connect(Tank1.Cs1, PerteDP2.C1)
+    annotation (Line(points={{20.4,9.8},{20.4,10},{32,10}},
+                                                        color={0,0,255}));
+  connect(PerteDP2.C2, PuitsP2.C)
+    annotation (Line(points={{52,10},{70,10}},         color={0,0,255}));
+  annotation (experiment(StopTime=20),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestTankHorizontal;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo
index a659d503df72ee3ab4b38d45847c43111015d9d5..c512df0f2a5fb623c7370f8a64d4d6f68d79beee 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo
@@ -1,64 +1,64 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestThreeWayValve
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
-    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
-                                          annotation (Placement(transformation(
-          extent={{70,-10},{90,10}},rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve(
-    C2(Q(start=-7.902947109890763E-33)),
-    C3(Q(start=2716.4138702433384)),
-    Valve1(Pm(start=200000.0)),
-    VolumeA1(h(start=71016.12237181117)))
-    annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
-                                          annotation (Placement(transformation(
-          extent={{70,-50},{90,-30}},
-                                    rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe
-                                         annotation (Placement(transformation(
-          extent={{-50,30},{-30,50}}, rotation=0)));
-equation
-  connect(rampe.y, threeWayValve.Ouv)
-    annotation (Line(points={{-29,40},{0,40},{0,15}}));
-  connect(SourceP1.C, threeWayValve.C1)
-    annotation (Line(points={{-70,0},{-10,0}}, color={0,0,0}));
-  connect(threeWayValve.C2, PuitsP1.C)
-    annotation (Line(points={{10,0},{70,0}}, color={0,0,0}));
-  connect(threeWayValve.C3, PuitsP2.C)
-    annotation (Line(points={{0,-6},{0,-40},{70,-40}}, color={0,0,0}));
-  annotation (experiment(StopTime=5),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestThreeWayValve;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestThreeWayValve
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1
+    annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1
+                                          annotation (Placement(transformation(
+          extent={{70,-10},{90,10}},rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve(
+    C2(Q(start=-7.902947109890763E-33)),
+    C3(Q(start=2716.4138702433384)),
+    Valve1(Pm(start=200000.0)),
+    VolumeA1(h(start=71016.12237181117)))
+    annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2
+                                          annotation (Placement(transformation(
+          extent={{70,-50},{90,-30}},
+                                    rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe
+                                         annotation (Placement(transformation(
+          extent={{-50,30},{-30,50}}, rotation=0)));
+equation
+  connect(rampe.y, threeWayValve.Ouv)
+    annotation (Line(points={{-29,40},{0,40},{0,15}}));
+  connect(SourceP1.C, threeWayValve.C1)
+    annotation (Line(points={{-70,0},{-10,0}}, color={0,0,0}));
+  connect(threeWayValve.C2, PuitsP1.C)
+    annotation (Line(points={{10,0},{70,0}}, color={0,0,0}));
+  connect(threeWayValve.C3, PuitsP2.C)
+    annotation (Line(points={{0,-6},{0,-40},{70,-40}}, color={0,0,0}));
+  annotation (experiment(StopTime=5),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestThreeWayValve;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo
index 8b09593e8cb8e562cdb0a7da2c16d8344d660394..7cbb0e0f7e04d686686b506eff21120b485745f8 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo
@@ -1,116 +1,116 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestTwoPhaseCavity
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater=670
-    "Maximum CV (active if mode_caract=0)";
-  PressureLosses.ControlValve                         feedwaterValve(
-    Cv(start=335),
-    C1(
-      h_vol_1(start=1400e3),
-      h(start=1400e3),
-      P(start=13300000),
-      h_vol_2(start=1975433.4222685455)),
-    rho(start=888),
-    h(start=1400000),
-    Cvmax=CvmaxWater,
-    Q(start=10),
-    Pm(start=13200000.029884))
-                     annotation (Placement(transformation(extent={{-98,96},{-78,
-            116}},     rotation=0)));
-  PressureLosses.ControlValve                         steamValve(
-    Cv(start=25000),
-    Q(start=0.0),
-    rho(start=78.5),
-    h(start=2657930),
-    C1(h_vol_2(start=2655313.7785675577)),
-    Cvmax(fixed=false),
-    Pm(start=12998726.577779))
-    annotation (Placement(transformation(extent={{-60,136},{-40,156}},
-                                                                   rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon(k=0.5)
-    annotation (Placement(transformation(extent={{-138,120},{-118,140}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon1(k=0.5)
-    annotation (Placement(transformation(extent={{-100,160},{-80,180}},
-                                                                    rotation=0)));
-  BoundaryConditions.SourceP                         sourceP(h0=1400000,
-    option_temperature=false,
-    P0=13200000)
-           annotation (Placement(transformation(extent={{-138,90},{-118,110}},
-          rotation=0)));
-  BoundaryConditions.SinkP                         sinkQ(P0=13200000, Q(start=
-          51.00572315373906))
-    annotation (Placement(transformation(extent={{0,-60},{20,-40}},  rotation=0)));
-  Volumes.TwoPhaseCavity twoPhaseVolume(
-    Vv(start=0.5, fixed=true),
-    diffusion=true,
-    dynamic_energy_balance=false,
-    P0=13200000,
-    Pfond(start=13200000))
-    annotation (Placement(transformation(extent={{-60,20},{20,100}})));
-  PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation (Placement(
-        transformation(
-        extent={{10,-10},{-10,10}},
-        rotation=90,
-        origin={-20,-10})));
-  BoundaryConditions.SourceP                         sourceP1(
-    P0(fixed=true) = 13200000,
-    option_temperature=false,
-    h0=2600000)
-           annotation (Placement(transformation(extent={{-100,130},{-80,150}},
-          rotation=0)));
-equation
-  connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv)
-    annotation (Line(points={{-117,130},{-88,130},{-88,117}},  smooth=Smooth.None));
-  connect(sourceP.C,feedwaterValve. C1)  annotation (Line(
-      points={{-118,100},{-98,100}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ConsigneNiveauBallon1.y,steamValve. Ouv)
-    annotation (Line(points={{-79,170},{-50,170},{-50,157}},
-                                                         smooth=Smooth.None));
-  connect(lumpedStraightPipe.C2, sinkQ.C)
-    annotation (Line(points={{-20,-20},{-20,-50},{0,-50}}, color={0,0,0}));
-  connect(sourceP1.C, steamValve.C1)
-    annotation (Line(points={{-80,140},{-60,140}},   color={0,0,0}));
-  connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) annotation (Line(points={{
-          -19.5556,30.6667},{-19.5556,15.3333},{-20,15.3333},{-20,0}}, color={0,
-          0,0}));
-  connect(steamValve.C2, twoPhaseVolume.Cv) annotation (Line(points={{-40,140},
-          {-19.5556,140},{-19.5556,89.3333}}, color={0,0,0}));
-  connect(feedwaterValve.C2, twoPhaseVolume.Ce) annotation (Line(points={{-78,100},
-          {-35.5556,100},{-35.5556,89.3333}},      color={0,0,0}));
-  annotation (experiment(__Dymola_Algorithm="Dassl"),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestTwoPhaseCavity;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestTwoPhaseCavity
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater=670
+    "Maximum CV (active if mode_caract=0)";
+  PressureLosses.ControlValve                         feedwaterValve(
+    Cv(start=335),
+    C1(
+      h_vol_1(start=1400e3),
+      h(start=1400e3),
+      P(start=13300000),
+      h_vol_2(start=1975433.4222685455)),
+    rho(start=888),
+    h(start=1400000),
+    Cvmax=CvmaxWater,
+    Q(start=10),
+    Pm(start=13200000.029884))
+                     annotation (Placement(transformation(extent={{-98,96},{-78,
+            116}},     rotation=0)));
+  PressureLosses.ControlValve                         steamValve(
+    Cv(start=25000),
+    Q(start=0.0),
+    rho(start=78.5),
+    h(start=2657930),
+    C1(h_vol_2(start=2655313.7785675577)),
+    Cvmax(fixed=false),
+    Pm(start=12998726.577779))
+    annotation (Placement(transformation(extent={{-60,136},{-40,156}},
+                                                                   rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon(k=0.5)
+    annotation (Placement(transformation(extent={{-138,120},{-118,140}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon1(k=0.5)
+    annotation (Placement(transformation(extent={{-100,160},{-80,180}},
+                                                                    rotation=0)));
+  BoundaryConditions.SourceP                         sourceP(h0=1400000,
+    option_temperature=false,
+    P0=13200000)
+           annotation (Placement(transformation(extent={{-138,90},{-118,110}},
+          rotation=0)));
+  BoundaryConditions.SinkP                         sinkQ(P0=13200000, Q(start=
+          51.00572315373906))
+    annotation (Placement(transformation(extent={{0,-60},{20,-40}},  rotation=0)));
+  Volumes.TwoPhaseCavity twoPhaseVolume(
+    Vv(start=0.5, fixed=true),
+    diffusion=true,
+    dynamic_energy_balance=false,
+    P0=13200000,
+    Pfond(start=13200000))
+    annotation (Placement(transformation(extent={{-60,20},{20,100}})));
+  PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation (Placement(
+        transformation(
+        extent={{10,-10},{-10,10}},
+        rotation=90,
+        origin={-20,-10})));
+  BoundaryConditions.SourceP                         sourceP1(
+    P0(fixed=true) = 13200000,
+    option_temperature=false,
+    h0=2600000)
+           annotation (Placement(transformation(extent={{-100,130},{-80,150}},
+          rotation=0)));
+equation
+  connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv)
+    annotation (Line(points={{-117,130},{-88,130},{-88,117}},  smooth=Smooth.None));
+  connect(sourceP.C,feedwaterValve. C1)  annotation (Line(
+      points={{-118,100},{-98,100}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ConsigneNiveauBallon1.y,steamValve. Ouv)
+    annotation (Line(points={{-79,170},{-50,170},{-50,157}},
+                                                         smooth=Smooth.None));
+  connect(lumpedStraightPipe.C2, sinkQ.C)
+    annotation (Line(points={{-20,-20},{-20,-50},{0,-50}}, color={0,0,0}));
+  connect(sourceP1.C, steamValve.C1)
+    annotation (Line(points={{-80,140},{-60,140}},   color={0,0,0}));
+  connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) annotation (Line(points={{
+          -19.5556,30.6667},{-19.5556,15.3333},{-20,15.3333},{-20,0}}, color={0,
+          0,0}));
+  connect(steamValve.C2, twoPhaseVolume.Cv) annotation (Line(points={{-40,140},
+          {-19.5556,140},{-19.5556,89.3333}}, color={0,0,0}));
+  connect(feedwaterValve.C2, twoPhaseVolume.Ce) annotation (Line(points={{-78,100},
+          {-35.5556,100},{-35.5556,89.3333}},      color={0,0,0}));
+  annotation (experiment(__Dymola_Algorithm="Dassl"),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestTwoPhaseCavity;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo
index 9dea9c471b803e80f0595711b5e823c25606f7bc..700cc9e72bd8ac6e783115d5aa3b0b9ad70da7e4 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestTwoPhaseCavityOnePipe
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater=670
-    "Maximum CV (active if mode_caract=0)";
-  PressureLosses.ControlValve                         feedwaterValve(
-    Cv(start=335),
-    C1(
-      h_vol_1(start=1400e3),
-      h(start=1400e3),
-      P(start=13300000),
-      h_vol_2(start=1399988.8233534198)),
-    rho(start=888),
-    h(start=1400000),
-    Cvmax=CvmaxWater,
-    Q(start=58.005768798668484),
-    Pm(start=13146647.912081594))
-                     annotation (Placement(transformation(extent={{-98,96},{-78,
-            116}},     rotation=0)));
-  PressureLosses.ControlValve                         steamValve(
-    Cv(start=25000),
-    Q(start=6.303270420619601E-10),
-    rho(start=78.5),
-    h(start=2657930),
-    C1(h_vol_2(start=2658519.5634182408)),
-    Cvmax(fixed=false),
-    Pm(start=12998726.577779))
-    annotation (Placement(transformation(extent={{-60,136},{-40,156}},
-                                                                   rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon(k=0.5)
-    annotation (Placement(transformation(extent={{-138,120},{-118,140}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon1(k=0.5)
-    annotation (Placement(transformation(extent={{-100,160},{-80,180}},
-                                                                    rotation=0)));
-  BoundaryConditions.SourceP                         sourceP(h0=1400000,
-    option_temperature=false,
-    P0=13200000)
-           annotation (Placement(transformation(extent={{-138,90},{-118,110}},
-          rotation=0)));
-  BoundaryConditions.SinkP                         sinkQ(P0=13200000, Q(start=
-          51.00572315373906))
-    annotation (Placement(transformation(extent={{0,-60},{20,-40}},  rotation=0)));
-  Volumes.TwoPhaseCavityOnePipe
-                         twoPhaseVolume(
-    Vv(start=0.5, fixed=true),
-    diffusion=true,
-    hl(start=1400000.0),
-    hv(start=2410000.0),
-    Cal_hcond=false,
-    dynamic_energy_balance=false,
-    P0=13200000,
-    Pfond(start=13203663.545897305),
-    Tp(start=583.6846968972088),
-    hvIn(start=2400966.7047930923))
-    annotation (Placement(transformation(extent={{-60,20},{20,100}})));
-  PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation (Placement(
-        transformation(
-        extent={{10,-10},{-10,10}},
-        rotation=90,
-        origin={-20,-10})));
-  BoundaryConditions.SourceP                         sourceP1(
-    P0(fixed=true) = 13200000,
-    option_temperature=false,
-    h0=2600000)
-           annotation (Placement(transformation(extent={{-100,130},{-80,150}},
-          rotation=0)));
-equation
-  connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv)
-    annotation (Line(points={{-117,130},{-88,130},{-88,117}},  smooth=Smooth.None));
-  connect(sourceP.C,feedwaterValve. C1)  annotation (Line(
-      points={{-118,100},{-98,100}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ConsigneNiveauBallon1.y,steamValve. Ouv)
-    annotation (Line(points={{-79,170},{-50,170},{-50,157}},
-                                                         smooth=Smooth.None));
-  connect(lumpedStraightPipe.C2, sinkQ.C)
-    annotation (Line(points={{-20,-20},{-20,-50},{0,-50}}, color={0,0,0}));
-  connect(sourceP1.C, steamValve.C1)
-    annotation (Line(points={{-80,140},{-60,140}},   color={0,0,0}));
-  connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) annotation (Line(points={{-20,
-          30.6667},{-20,15.3333},{-20,15.3333},{-20,0}},               color={0,
-          0,0}));
-  connect(feedwaterValve.C2, twoPhaseVolume.Ce) annotation (Line(points={{-78,100},
-          {-50.6286,100},{-50.6286,81.0667}},      color={0,0,0}));
-  connect(steamValve.C2, twoPhaseVolume.CvBP) annotation (Line(points={{-40,140},
-          {-20.2286,140},{-20.2286,89.3333}}, color={0,0,0}));
-  annotation (experiment(__Dymola_Algorithm="Dassl"),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestTwoPhaseCavityOnePipe;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestTwoPhaseCavityOnePipe
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater=670
+    "Maximum CV (active if mode_caract=0)";
+  PressureLosses.ControlValve                         feedwaterValve(
+    Cv(start=335),
+    C1(
+      h_vol_1(start=1400e3),
+      h(start=1400e3),
+      P(start=13300000),
+      h_vol_2(start=1399988.8233534198)),
+    rho(start=888),
+    h(start=1400000),
+    Cvmax=CvmaxWater,
+    Q(start=58.005768798668484),
+    Pm(start=13146647.912081594))
+                     annotation (Placement(transformation(extent={{-98,96},{-78,
+            116}},     rotation=0)));
+  PressureLosses.ControlValve                         steamValve(
+    Cv(start=25000),
+    Q(start=6.303270420619601E-10),
+    rho(start=78.5),
+    h(start=2657930),
+    C1(h_vol_2(start=2658519.5634182408)),
+    Cvmax(fixed=false),
+    Pm(start=12998726.577779))
+    annotation (Placement(transformation(extent={{-60,136},{-40,156}},
+                                                                   rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon(k=0.5)
+    annotation (Placement(transformation(extent={{-138,120},{-118,140}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon1(k=0.5)
+    annotation (Placement(transformation(extent={{-100,160},{-80,180}},
+                                                                    rotation=0)));
+  BoundaryConditions.SourceP                         sourceP(h0=1400000,
+    option_temperature=false,
+    P0=13200000)
+           annotation (Placement(transformation(extent={{-138,90},{-118,110}},
+          rotation=0)));
+  BoundaryConditions.SinkP                         sinkQ(P0=13200000, Q(start=
+          51.00572315373906))
+    annotation (Placement(transformation(extent={{0,-60},{20,-40}},  rotation=0)));
+  Volumes.TwoPhaseCavityOnePipe
+                         twoPhaseVolume(
+    Vv(start=0.5, fixed=true),
+    diffusion=true,
+    hl(start=1400000.0),
+    hv(start=2410000.0),
+    Cal_hcond=false,
+    dynamic_energy_balance=false,
+    P0=13200000,
+    Pfond(start=13203663.545897305),
+    Tp(start=583.6846968972088),
+    hvIn(start=2400966.7047930923))
+    annotation (Placement(transformation(extent={{-60,20},{20,100}})));
+  PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation (Placement(
+        transformation(
+        extent={{10,-10},{-10,10}},
+        rotation=90,
+        origin={-20,-10})));
+  BoundaryConditions.SourceP                         sourceP1(
+    P0(fixed=true) = 13200000,
+    option_temperature=false,
+    h0=2600000)
+           annotation (Placement(transformation(extent={{-100,130},{-80,150}},
+          rotation=0)));
+equation
+  connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv)
+    annotation (Line(points={{-117,130},{-88,130},{-88,117}},  smooth=Smooth.None));
+  connect(sourceP.C,feedwaterValve. C1)  annotation (Line(
+      points={{-118,100},{-98,100}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ConsigneNiveauBallon1.y,steamValve. Ouv)
+    annotation (Line(points={{-79,170},{-50,170},{-50,157}},
+                                                         smooth=Smooth.None));
+  connect(lumpedStraightPipe.C2, sinkQ.C)
+    annotation (Line(points={{-20,-20},{-20,-50},{0,-50}}, color={0,0,0}));
+  connect(sourceP1.C, steamValve.C1)
+    annotation (Line(points={{-80,140},{-60,140}},   color={0,0,0}));
+  connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) annotation (Line(points={{-20,
+          30.6667},{-20,15.3333},{-20,15.3333},{-20,0}},               color={0,
+          0,0}));
+  connect(feedwaterValve.C2, twoPhaseVolume.Ce) annotation (Line(points={{-78,100},
+          {-50.6286,100},{-50.6286,81.0667}},      color={0,0,0}));
+  connect(steamValve.C2, twoPhaseVolume.CvBP) annotation (Line(points={{-40,140},
+          {-20.2286,140},{-20.2286,89.3333}}, color={0,0,0}));
+  annotation (experiment(__Dymola_Algorithm="Dassl"),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestTwoPhaseCavityOnePipe;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo
index c1fcaafda53f02250cc762aa0503ecc2261ab22e..fc4a8c6dca8a79f2ff3ed1b6b2baaed5d498e3f0 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo
@@ -1,116 +1,116 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestTwoPhaseVolume
-  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater=670
-    "Maximum CV (active if mode_caract=0)";
-  PressureLosses.ControlValve                         feedwaterValve(
-    Cv(start=335),
-    C1(
-      h_vol_1(start=1400e3),
-      h(start=1400e3),
-      P(start=13300000),
-      h_vol_2(start=1975433.4222685455)),
-    rho(start=888),
-    h(start=1400000),
-    Cvmax=CvmaxWater,
-    Q(start=10),
-    Pm(start=13200000.029884))
-                     annotation (Placement(transformation(extent={{-120,76},{
-            -100,96}}, rotation=0)));
-  PressureLosses.ControlValve                         steamValve(
-    Cv(start=25000),
-    Q(start=0.0),
-    rho(start=78.5),
-    h(start=2657930),
-    C1(h_vol_2(start=2655313.7785675577)),
-    Cvmax(fixed=false),
-    Pm(start=12998726.577779))
-    annotation (Placement(transformation(extent={{-120,136},{-100,156}},
-                                                                   rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon(k=0.5)
-    annotation (Placement(transformation(extent={{-160,100},{-140,120}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    ConsigneNiveauBallon1(k=0.5)
-    annotation (Placement(transformation(extent={{-160,160},{-140,180}},
-                                                                    rotation=0)));
-  BoundaryConditions.SourceP                         sourceP(h0=1400000,
-    option_temperature=false,
-    P0=13200000)
-           annotation (Placement(transformation(extent={{-200,70},{-180,90}},
-          rotation=0)));
-  BoundaryConditions.SinkP                         sinkQ(P0=13200000, Q(start=
-          51.00572315373906))
-    annotation (Placement(transformation(extent={{-38,-40},{-18,-20}},
-                                                                     rotation=0)));
-  Volumes.TwoPhaseVolume twoPhaseVolume(diffusion=true,
-    steady_state=true,
-    Vv(start=0.5, fixed=true),
-    dynamic_energy_balance=true,
-    P0=13200000,
-    Pfond(start=13200000))
-    annotation (Placement(transformation(extent={{-80,50},{-20,110}})));
-  PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation (Placement(
-        transformation(
-        extent={{10,-10},{-10,10}},
-        rotation=90,
-        origin={-50,10})));
-  BoundaryConditions.SourceP                         sourceP1(
-    P0(fixed=true) = 13200000,
-    option_temperature=false,
-    h0=2600000)
-           annotation (Placement(transformation(extent={{-200,130},{-180,150}},
-          rotation=0)));
-equation
-  connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv)
-    annotation (Line(points={{-139,110},{-110,110},{-110,97}}, smooth=Smooth.None));
-  connect(sourceP.C,feedwaterValve. C1)  annotation (Line(
-      points={{-180,80},{-120,80}},
-      color={0,0,255},
-      smooth=Smooth.None));
-  connect(ConsigneNiveauBallon1.y,steamValve. Ouv)
-    annotation (Line(points={{-139,170},{-110,170},{-110,157}},
-                                                         smooth=Smooth.None));
-  connect(feedwaterValve.C2, twoPhaseVolume.Ce)
-    annotation (Line(points={{-100,80},{-80,80}}, color={0,0,0}));
-  connect(lumpedStraightPipe.C2, sinkQ.C)
-    annotation (Line(points={{-50,0},{-50,-30},{-38,-30}}, color={0,0,0}));
-  connect(sourceP1.C, steamValve.C1)
-    annotation (Line(points={{-180,140},{-120,140}}, color={0,0,0}));
-  connect(steamValve.C2, twoPhaseVolume.Cv)
-    annotation (Line(points={{-100,140},{-50,140},{-50,110}}, color={0,0,0}));
-  connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1)
-    annotation (Line(points={{-50,50},{-50,20}}, color={0,0,0}));
-  annotation (experiment(__Dymola_Algorithm="Dassl"),
-    Window(
-      x=0.43,
-      y=0,
-      width=0.57,
-      height=0.63),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-100},{140,200}},
-        grid={2,2})),
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestTwoPhaseVolume;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestTwoPhaseVolume
+  parameter ThermoSysPro.Units.xSI.Cv CvmaxWater=670
+    "Maximum CV (active if mode_caract=0)";
+  PressureLosses.ControlValve                         feedwaterValve(
+    Cv(start=335),
+    C1(
+      h_vol_1(start=1400e3),
+      h(start=1400e3),
+      P(start=13300000),
+      h_vol_2(start=1975433.4222685455)),
+    rho(start=888),
+    h(start=1400000),
+    Cvmax=CvmaxWater,
+    Q(start=10),
+    Pm(start=13200000.029884))
+                     annotation (Placement(transformation(extent={{-120,76},{
+            -100,96}}, rotation=0)));
+  PressureLosses.ControlValve                         steamValve(
+    Cv(start=25000),
+    Q(start=0.0),
+    rho(start=78.5),
+    h(start=2657930),
+    C1(h_vol_2(start=2655313.7785675577)),
+    Cvmax(fixed=false),
+    Pm(start=12998726.577779))
+    annotation (Placement(transformation(extent={{-120,136},{-100,156}},
+                                                                   rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon(k=0.5)
+    annotation (Placement(transformation(extent={{-160,100},{-140,120}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    ConsigneNiveauBallon1(k=0.5)
+    annotation (Placement(transformation(extent={{-160,160},{-140,180}},
+                                                                    rotation=0)));
+  BoundaryConditions.SourceP                         sourceP(h0=1400000,
+    option_temperature=false,
+    P0=13200000)
+           annotation (Placement(transformation(extent={{-200,70},{-180,90}},
+          rotation=0)));
+  BoundaryConditions.SinkP                         sinkQ(P0=13200000, Q(start=
+          51.00572315373906))
+    annotation (Placement(transformation(extent={{-38,-40},{-18,-20}},
+                                                                     rotation=0)));
+  Volumes.TwoPhaseVolume twoPhaseVolume(diffusion=true,
+    steady_state=true,
+    Vv(start=0.5, fixed=true),
+    dynamic_energy_balance=true,
+    P0=13200000,
+    Pfond(start=13200000))
+    annotation (Placement(transformation(extent={{-80,50},{-20,110}})));
+  PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation (Placement(
+        transformation(
+        extent={{10,-10},{-10,10}},
+        rotation=90,
+        origin={-50,10})));
+  BoundaryConditions.SourceP                         sourceP1(
+    P0(fixed=true) = 13200000,
+    option_temperature=false,
+    h0=2600000)
+           annotation (Placement(transformation(extent={{-200,130},{-180,150}},
+          rotation=0)));
+equation
+  connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv)
+    annotation (Line(points={{-139,110},{-110,110},{-110,97}}, smooth=Smooth.None));
+  connect(sourceP.C,feedwaterValve. C1)  annotation (Line(
+      points={{-180,80},{-120,80}},
+      color={0,0,255},
+      smooth=Smooth.None));
+  connect(ConsigneNiveauBallon1.y,steamValve. Ouv)
+    annotation (Line(points={{-139,170},{-110,170},{-110,157}},
+                                                         smooth=Smooth.None));
+  connect(feedwaterValve.C2, twoPhaseVolume.Ce)
+    annotation (Line(points={{-100,80},{-80,80}}, color={0,0,0}));
+  connect(lumpedStraightPipe.C2, sinkQ.C)
+    annotation (Line(points={{-50,0},{-50,-30},{-38,-30}}, color={0,0,0}));
+  connect(sourceP1.C, steamValve.C1)
+    annotation (Line(points={{-180,140},{-120,140}}, color={0,0,0}));
+  connect(steamValve.C2, twoPhaseVolume.Cv)
+    annotation (Line(points={{-100,140},{-50,140},{-50,110}}, color={0,0,0}));
+  connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1)
+    annotation (Line(points={{-50,50},{-50,20}}, color={0,0,0}));
+  annotation (experiment(__Dymola_Algorithm="Dassl"),
+    Window(
+      x=0.43,
+      y=0,
+      width=0.57,
+      height=0.63),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-100},{140,200}},
+        grid={2,2})),
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestTwoPhaseVolume;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo
index 1482b216f996759973fad7f7067faa3c9fa4550e..b6faabc45e8b0d887445ce1c5dcbc22cdf82e03e 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo
@@ -1,112 +1,112 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestVolumeA
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    continuous_flow_reversal=true,
-    T0=288.15,
-    diffusion=true,
-    C(h_vol_2(start=63269.22110794238)))
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(
-    Q(start=356.3142593657128),
-    P0=300000,
-    T0=369.15,
-    diffusion=true)
-    annotation (Placement(transformation(extent={{80,-10},{100,10}})));
-  ThermoSysPro.Fluid.Volumes.VolumeA volumeA(
-    dynamic_composition_balance=false,
-    steady_state=true,
-    V=1.e-6,
-    Ce2(Q(start=-4.6367791499652465E-36)),
-    continuous_flow_reversal=true,
-    dynamic_mass_balance=false,
-    dynamic_energy_balance=false,
-    diffusion=true,
-    P(start=200002.5108577))
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
-
-  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Duration=10,
-    Initialvalue=1e5,
-    Finalvalue=5e5)
-    annotation (Placement(transformation(extent={{60,-40},{80,-20}})));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(gamma_diff(
-        start=4.4340701734837724E-07))
-    annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe3(
-      gamma_diff(start=4.4336099270975624E-07))
-    annotation (Placement(transformation(extent={{50,-10},{70,10}})));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(inertia=
-        false)
-    annotation (Placement(transformation(extent={{-70,40},{-50,60}})));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-    continuous_flow_reversal=false,
-    T0=288.15,
-    diffusion=true)
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
-
-  PressureLosses.ControlValve controlValve1(Pm(start=201722.05301761828))
-    annotation (Placement(transformation(extent={{-40,-4},{-20,16}})));
-  PressureLosses.ControlValve controlValve2(C2(Q(start=0)), Pm(start=
-          250001.25542885027))
-    annotation (Placement(transformation(extent={{-40,46},{-20,66}})));
-  PressureLosses.ControlValve controlValve3(Pm(start=198282.96276544))
-    annotation (Placement(transformation(extent={{20,-4},{40,16}})));
-  InstrumentationAndControl.Blocks.Sources.Constante constante1(k=1)
-    annotation (Placement(transformation(extent={{-56,24},{-44,36}})));
-  InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0)
-    annotation (Placement(transformation(extent={{-56,74},{-44,86}})));
-  InstrumentationAndControl.Blocks.Sources.Constante constante3
-    annotation (Placement(transformation(extent={{4,22},{16,34}})));
-equation
-  connect(rampe.y, sinkP.IPressure) annotation (Line(points={{81,-30},{100,-30},
-          {100,0},{95,0}}, color={0,0,255}));
-  connect(sourceP1.C, lumpedStraightPipe1.C1)
-    annotation (Line(points={{-80,0},{-70,0}}, color={0,0,0}));
-  connect(lumpedStraightPipe3.C2, sinkP.C)
-    annotation (Line(points={{70,0},{80,0}}, color={0,0,0}));
-  connect(sourceP2.C, lumpedStraightPipe2.C1)
-    annotation (Line(points={{-80,50},{-70,50}}, color={0,0,0}));
-  connect(lumpedStraightPipe1.C2, controlValve1.C1)
-    annotation (Line(points={{-50,0},{-40,0}}, color={0,0,0}));
-  connect(lumpedStraightPipe2.C2, controlValve2.C1)
-    annotation (Line(points={{-50,50},{-40,50}}, color={0,0,0}));
-  connect(controlValve2.C2, volumeA.Ce2)
-    annotation (Line(points={{-20,50},{0,50},{0,10}},  color={0,0,0}));
-  connect(volumeA.Cs1, controlValve3.C1)
-    annotation (Line(points={{10,0},{20,0}}, color={0,0,0}));
-  connect(controlValve3.C2, lumpedStraightPipe3.C1)
-    annotation (Line(points={{40,0},{50,0}}, color={0,0,0}));
-  connect(constante1.y, controlValve1.Ouv)
-    annotation (Line(points={{-43.4,30},{-30,30},{-30,17}}, color={0,0,255}));
-  connect(constante2.y, controlValve2.Ouv)
-    annotation (Line(points={{-43.4,80},{-30,80},{-30,67}}, color={0,0,255}));
-  connect(constante3.y, controlValve3.Ouv)
-    annotation (Line(points={{16.6,28},{30,28},{30,17}}, color={0,0,255}));
-  connect(volumeA.Ce1, controlValve1.C2)
-    annotation (Line(points={{-10,0},{-20,0}}, color={0,0,255}));
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      experiment(StopTime=12),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestVolumeA;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestVolumeA
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    continuous_flow_reversal=true,
+    T0=288.15,
+    diffusion=true,
+    C(h_vol_2(start=63269.22110794238)))
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(
+    Q(start=356.3142593657128),
+    P0=300000,
+    T0=369.15,
+    diffusion=true)
+    annotation (Placement(transformation(extent={{80,-10},{100,10}})));
+  ThermoSysPro.Fluid.Volumes.VolumeA volumeA(
+    dynamic_composition_balance=false,
+    steady_state=true,
+    V=1.e-6,
+    Ce2(Q(start=-4.6367791499652465E-36)),
+    continuous_flow_reversal=true,
+    dynamic_mass_balance=false,
+    dynamic_energy_balance=false,
+    diffusion=true,
+    P(start=200002.5108577))
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+
+  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Duration=10,
+    Initialvalue=1e5,
+    Finalvalue=5e5)
+    annotation (Placement(transformation(extent={{60,-40},{80,-20}})));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(gamma_diff(
+        start=4.4340701734837724E-07))
+    annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe3(
+      gamma_diff(start=4.4336099270975624E-07))
+    annotation (Placement(transformation(extent={{50,-10},{70,10}})));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(inertia=
+        false)
+    annotation (Placement(transformation(extent={{-70,40},{-50,60}})));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+    continuous_flow_reversal=false,
+    T0=288.15,
+    diffusion=true)
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
+
+  PressureLosses.ControlValve controlValve1(Pm(start=201722.05301761828))
+    annotation (Placement(transformation(extent={{-40,-4},{-20,16}})));
+  PressureLosses.ControlValve controlValve2(C2(Q(start=0)), Pm(start=
+          250001.25542885027))
+    annotation (Placement(transformation(extent={{-40,46},{-20,66}})));
+  PressureLosses.ControlValve controlValve3(Pm(start=198282.96276544))
+    annotation (Placement(transformation(extent={{20,-4},{40,16}})));
+  InstrumentationAndControl.Blocks.Sources.Constante constante1(k=1)
+    annotation (Placement(transformation(extent={{-56,24},{-44,36}})));
+  InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0)
+    annotation (Placement(transformation(extent={{-56,74},{-44,86}})));
+  InstrumentationAndControl.Blocks.Sources.Constante constante3
+    annotation (Placement(transformation(extent={{4,22},{16,34}})));
+equation
+  connect(rampe.y, sinkP.IPressure) annotation (Line(points={{81,-30},{100,-30},
+          {100,0},{95,0}}, color={0,0,255}));
+  connect(sourceP1.C, lumpedStraightPipe1.C1)
+    annotation (Line(points={{-80,0},{-70,0}}, color={0,0,0}));
+  connect(lumpedStraightPipe3.C2, sinkP.C)
+    annotation (Line(points={{70,0},{80,0}}, color={0,0,0}));
+  connect(sourceP2.C, lumpedStraightPipe2.C1)
+    annotation (Line(points={{-80,50},{-70,50}}, color={0,0,0}));
+  connect(lumpedStraightPipe1.C2, controlValve1.C1)
+    annotation (Line(points={{-50,0},{-40,0}}, color={0,0,0}));
+  connect(lumpedStraightPipe2.C2, controlValve2.C1)
+    annotation (Line(points={{-50,50},{-40,50}}, color={0,0,0}));
+  connect(controlValve2.C2, volumeA.Ce2)
+    annotation (Line(points={{-20,50},{0,50},{0,10}},  color={0,0,0}));
+  connect(volumeA.Cs1, controlValve3.C1)
+    annotation (Line(points={{10,0},{20,0}}, color={0,0,0}));
+  connect(controlValve3.C2, lumpedStraightPipe3.C1)
+    annotation (Line(points={{40,0},{50,0}}, color={0,0,0}));
+  connect(constante1.y, controlValve1.Ouv)
+    annotation (Line(points={{-43.4,30},{-30,30},{-30,17}}, color={0,0,255}));
+  connect(constante2.y, controlValve2.Ouv)
+    annotation (Line(points={{-43.4,80},{-30,80},{-30,67}}, color={0,0,255}));
+  connect(constante3.y, controlValve3.Ouv)
+    annotation (Line(points={{16.6,28},{30,28},{30,17}}, color={0,0,255}));
+  connect(volumeA.Ce1, controlValve1.C2)
+    annotation (Line(points={{-10,0},{-20,0}}, color={0,0,255}));
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      experiment(StopTime=12),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestVolumeA;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo
index 1799e4bafb0507734d6ca46a4b68851c3f186652..f6d28f116ad22332a826404ebcfbbaccc208d931 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo
@@ -1,78 +1,78 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestVolumeA1
-
-  ThermoSysPro.Fluid.Volumes.VolumeA volumeA(ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    Ce2(Q(start=5381683.17323685)),
-    Cs1(Q(start=5381683.173236847)),
-    Cs2(Q(start=5381683.173236847)),
-    Xo2(start=0.22),
-    h(start=999999.9999999997),
-    dynamic_energy_balance=false)
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(rho(start=
-         164.8075648419657))
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}})));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1
-    annotation (Placement(transformation(extent={{-60,-40},{-40,-20}})));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2
-    annotation (Placement(transformation(extent={{40,20},{60,40}})));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3
-    annotation (Placement(transformation(extent={{40,-40},{60,-20}})));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    option_temperature=false,
-    h0=1e6,
-    P0=600e5)
-    annotation (Placement(transformation(extent={{-100,20},{-80,40}})));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    T0=1000,
-    option_temperature=false,
-    h0=1e6,
-    P0=600e5)
-    annotation (Placement(transformation(extent={{-100,-40},{-80,-20}})));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature=false)
-    annotation (Placement(transformation(extent={{80,20},{100,40}})));
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(option_temperature=false)
-    annotation (Placement(transformation(extent={{80,-40},{100,-20}})));
-equation
-  connect(singularPressureLoss.C2, volumeA.Ce2)
-    annotation (Line(points={{-40,30},{0,30},{0,10}}, color={0,0,0}));
-  connect(singularPressureLoss1.C2, volumeA.Ce1) annotation (Line(points={{-40,
-          -30},{-20,-30},{-20,0},{-10,0}}, color={0,0,0}));
-  connect(volumeA.Cs1, singularPressureLoss2.C1) annotation (Line(points={{10,0},
-          {10,0},{20,0},{20,30},{40,30},{40,30}}, color={0,0,0}));
-  connect(volumeA.Cs2, singularPressureLoss3.C1) annotation (Line(points={{0,
-          -10},{0,-10},{0,-30},{40,-30},{40,-30}}, color={0,0,0}));
-  connect(sourceP.C, singularPressureLoss.C1)
-    annotation (Line(points={{-80,30},{-60,30}}, color={0,0,0}));
-  connect(sourceP1.C, singularPressureLoss1.C1)
-    annotation (Line(points={{-80,-30},{-60,-30}}, color={0,0,0}));
-  connect(singularPressureLoss2.C2, sinkP.C)
-    annotation (Line(points={{60,30},{70,30},{70,30},{80,30}}, color={0,0,0}));
-  connect(singularPressureLoss3.C2, sinkP1.C) annotation (Line(points={{60,-30},
-          {70,-30},{70,-30},{80,-30}}, color={0,0,0}));
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end TestVolumeA1;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestVolumeA1
+
+  ThermoSysPro.Fluid.Volumes.VolumeA volumeA(ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    Ce2(Q(start=5381683.17323685)),
+    Cs1(Q(start=5381683.173236847)),
+    Cs2(Q(start=5381683.173236847)),
+    Xo2(start=0.22),
+    h(start=999999.9999999997),
+    dynamic_energy_balance=false)
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(rho(start=
+         164.8075648419657))
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}})));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1
+    annotation (Placement(transformation(extent={{-60,-40},{-40,-20}})));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2
+    annotation (Placement(transformation(extent={{40,20},{60,40}})));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3
+    annotation (Placement(transformation(extent={{40,-40},{60,-20}})));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    option_temperature=false,
+    h0=1e6,
+    P0=600e5)
+    annotation (Placement(transformation(extent={{-100,20},{-80,40}})));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    T0=1000,
+    option_temperature=false,
+    h0=1e6,
+    P0=600e5)
+    annotation (Placement(transformation(extent={{-100,-40},{-80,-20}})));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature=false)
+    annotation (Placement(transformation(extent={{80,20},{100,40}})));
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(option_temperature=false)
+    annotation (Placement(transformation(extent={{80,-40},{100,-20}})));
+equation
+  connect(singularPressureLoss.C2, volumeA.Ce2)
+    annotation (Line(points={{-40,30},{0,30},{0,10}}, color={0,0,0}));
+  connect(singularPressureLoss1.C2, volumeA.Ce1) annotation (Line(points={{-40,
+          -30},{-20,-30},{-20,0},{-10,0}}, color={0,0,0}));
+  connect(volumeA.Cs1, singularPressureLoss2.C1) annotation (Line(points={{10,0},
+          {10,0},{20,0},{20,30},{40,30},{40,30}}, color={0,0,0}));
+  connect(volumeA.Cs2, singularPressureLoss3.C1) annotation (Line(points={{0,
+          -10},{0,-10},{0,-30},{40,-30},{40,-30}}, color={0,0,0}));
+  connect(sourceP.C, singularPressureLoss.C1)
+    annotation (Line(points={{-80,30},{-60,30}}, color={0,0,0}));
+  connect(sourceP1.C, singularPressureLoss1.C1)
+    annotation (Line(points={{-80,-30},{-60,-30}}, color={0,0,0}));
+  connect(singularPressureLoss2.C2, sinkP.C)
+    annotation (Line(points={{60,30},{70,30},{70,30},{80,30}}, color={0,0,0}));
+  connect(singularPressureLoss3.C2, sinkP1.C) annotation (Line(points={{60,-30},
+          {70,-30},{70,-30},{80,-30}}, color={0,0,0}));
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end TestVolumeA1;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo
index f997f9a7ed76a23f453451e1d303c06bca9c20f6..5a136206a68a2c28b3d635e3aca5d19db5f132bd 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo
@@ -1,111 +1,111 @@
-within ThermoSysPro.Fluid.Examples.SimpleExamples;
-model TestVolumeI
-
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
-    continuous_flow_reversal=true,
-    T0=288.15,
-    diffusion=true)
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
-
-  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(
-    Q(start=356.3142593657128),
-    P0=300000,
-    T0=369.15,
-    diffusion=true)
-    annotation (Placement(transformation(extent={{80,-10},{100,10}})));
-  Volumes.VolumeI                    volumeA(
-    dynamic_composition_balance=false,
-    steady_state=true,
-    V=1.e-6,
-    Ce2(Q(start=-1.2064107019298721E-33)),
-    continuous_flow_reversal=true,
-    dynamic_mass_balance=false,
-    diffusion=false,
-    dynamic_energy_balance=true,
-    P(start=200002.5108577),
-    h(start=63269.22110794238))
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
-
-  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Duration=10,
-    Initialvalue=1e5,
-    Finalvalue=5e5)
-    annotation (Placement(transformation(extent={{60,-40},{80,-20}})));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(gamma_diff(
-        start=4.4340701734837724E-07))
-    annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe3
-    annotation (Placement(transformation(extent={{50,-10},{70,10}})));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(inertia=
-        false)
-    annotation (Placement(transformation(extent={{-70,40},{-50,60}})));
-  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
-    continuous_flow_reversal=false,
-    T0=288.15,
-    diffusion=true)
-    annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
-
-  PressureLosses.ControlValve controlValve1(Pm(start=201722.05301761828))
-    annotation (Placement(transformation(extent={{-40,-4},{-20,16}})));
-  PressureLosses.ControlValve controlValve2(C2(Q(start=0)), Pm(start=
-          250001.25542885027))
-    annotation (Placement(transformation(extent={{-40,46},{-20,66}})));
-  PressureLosses.ControlValve controlValve3(Pm(start=198282.96276544))
-    annotation (Placement(transformation(extent={{20,-4},{40,16}})));
-  InstrumentationAndControl.Blocks.Sources.Constante constante1(k=1)
-    annotation (Placement(transformation(extent={{-56,24},{-44,36}})));
-  InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0)
-    annotation (Placement(transformation(extent={{-56,74},{-44,86}})));
-  InstrumentationAndControl.Blocks.Sources.Constante constante3
-    annotation (Placement(transformation(extent={{4,22},{16,34}})));
-equation
-  connect(rampe.y, sinkP.IPressure) annotation (Line(points={{81,-30},{100,-30},
-          {100,0},{95,0}}, color={0,0,255}));
-  connect(sourceP1.C, lumpedStraightPipe1.C1)
-    annotation (Line(points={{-80,0},{-70,0}}, color={0,0,0}));
-  connect(lumpedStraightPipe3.C2, sinkP.C)
-    annotation (Line(points={{70,0},{80,0}}, color={0,0,0}));
-  connect(sourceP2.C, lumpedStraightPipe2.C1)
-    annotation (Line(points={{-80,50},{-70,50}}, color={0,0,0}));
-  connect(lumpedStraightPipe1.C2, controlValve1.C1)
-    annotation (Line(points={{-50,0},{-40,0}}, color={0,0,0}));
-  connect(lumpedStraightPipe2.C2, controlValve2.C1)
-    annotation (Line(points={{-50,50},{-40,50}}, color={0,0,0}));
-  connect(controlValve3.C2, lumpedStraightPipe3.C1)
-    annotation (Line(points={{40,0},{50,0}}, color={0,0,0}));
-  connect(constante1.y, controlValve1.Ouv)
-    annotation (Line(points={{-43.4,30},{-30,30},{-30,17}}, color={0,0,255}));
-  connect(constante2.y, controlValve2.Ouv)
-    annotation (Line(points={{-43.4,80},{-30,80},{-30,67}}, color={0,0,255}));
-  connect(constante3.y, controlValve3.Ouv)
-    annotation (Line(points={{16.6,28},{30,28},{30,17}}, color={0,0,255}));
-  connect(controlValve1.C2, volumeA.Ce2)
-    annotation (Line(points={{-20,0},{-10,0}}, color={0,0,0}));
-  connect(controlValve2.C2, volumeA.Ce1) annotation (Line(points={{-20,50},{-14,
-          50},{-14,8},{-10,8}}, color={0,0,0}));
-  connect(volumeA.Cs2, controlValve3.C1)
-    annotation (Line(points={{10,0},{20,0}}, color={0,0,0}));
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
-      experiment(StopTime=12),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end TestVolumeI;
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+model TestVolumeI
+
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(
+    continuous_flow_reversal=true,
+    T0=288.15,
+    diffusion=true)
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
+
+  ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(
+    Q(start=356.3142593657128),
+    P0=300000,
+    T0=369.15,
+    diffusion=true)
+    annotation (Placement(transformation(extent={{80,-10},{100,10}})));
+  Volumes.VolumeI                    volumeA(
+    dynamic_composition_balance=false,
+    steady_state=true,
+    V=1.e-6,
+    Ce2(Q(start=-1.2064107019298721E-33)),
+    continuous_flow_reversal=true,
+    dynamic_mass_balance=false,
+    diffusion=false,
+    dynamic_energy_balance=true,
+    P(start=200002.5108577),
+    h(start=63269.22110794238))
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+
+  InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Duration=10,
+    Initialvalue=1e5,
+    Finalvalue=5e5)
+    annotation (Placement(transformation(extent={{60,-40},{80,-20}})));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(gamma_diff(
+        start=4.4340701734837724E-07))
+    annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe3
+    annotation (Placement(transformation(extent={{50,-10},{70,10}})));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(inertia=
+        false)
+    annotation (Placement(transformation(extent={{-70,40},{-50,60}})));
+  ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(
+    continuous_flow_reversal=false,
+    T0=288.15,
+    diffusion=true)
+    annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
+
+  PressureLosses.ControlValve controlValve1(Pm(start=201722.05301761828))
+    annotation (Placement(transformation(extent={{-40,-4},{-20,16}})));
+  PressureLosses.ControlValve controlValve2(C2(Q(start=0)), Pm(start=
+          250001.25542885027))
+    annotation (Placement(transformation(extent={{-40,46},{-20,66}})));
+  PressureLosses.ControlValve controlValve3(Pm(start=198282.96276544))
+    annotation (Placement(transformation(extent={{20,-4},{40,16}})));
+  InstrumentationAndControl.Blocks.Sources.Constante constante1(k=1)
+    annotation (Placement(transformation(extent={{-56,24},{-44,36}})));
+  InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0)
+    annotation (Placement(transformation(extent={{-56,74},{-44,86}})));
+  InstrumentationAndControl.Blocks.Sources.Constante constante3
+    annotation (Placement(transformation(extent={{4,22},{16,34}})));
+equation
+  connect(rampe.y, sinkP.IPressure) annotation (Line(points={{81,-30},{100,-30},
+          {100,0},{95,0}}, color={0,0,255}));
+  connect(sourceP1.C, lumpedStraightPipe1.C1)
+    annotation (Line(points={{-80,0},{-70,0}}, color={0,0,0}));
+  connect(lumpedStraightPipe3.C2, sinkP.C)
+    annotation (Line(points={{70,0},{80,0}}, color={0,0,0}));
+  connect(sourceP2.C, lumpedStraightPipe2.C1)
+    annotation (Line(points={{-80,50},{-70,50}}, color={0,0,0}));
+  connect(lumpedStraightPipe1.C2, controlValve1.C1)
+    annotation (Line(points={{-50,0},{-40,0}}, color={0,0,0}));
+  connect(lumpedStraightPipe2.C2, controlValve2.C1)
+    annotation (Line(points={{-50,50},{-40,50}}, color={0,0,0}));
+  connect(controlValve3.C2, lumpedStraightPipe3.C1)
+    annotation (Line(points={{40,0},{50,0}}, color={0,0,0}));
+  connect(constante1.y, controlValve1.Ouv)
+    annotation (Line(points={{-43.4,30},{-30,30},{-30,17}}, color={0,0,255}));
+  connect(constante2.y, controlValve2.Ouv)
+    annotation (Line(points={{-43.4,80},{-30,80},{-30,67}}, color={0,0,255}));
+  connect(constante3.y, controlValve3.Ouv)
+    annotation (Line(points={{16.6,28},{30,28},{30,17}}, color={0,0,255}));
+  connect(controlValve1.C2, volumeA.Ce2)
+    annotation (Line(points={{-20,0},{-10,0}}, color={0,0,0}));
+  connect(controlValve2.C2, volumeA.Ce1) annotation (Line(points={{-20,50},{-14,
+          50},{-14,8},{-10,8}}, color={0,0,0}));
+  connect(volumeA.Cs2, controlValve3.C1)
+    annotation (Line(points={{10,0},{20,0}}, color={0,0,0}));
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}),
+      experiment(StopTime=12),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end TestVolumeI;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.mo
index 25e598f5ec9ce6b0a8ae4320f49981867584d01f..71938459530326a2aba30798aca2535993a04ee8 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.mo
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.Fluid.Examples;
-package SimpleExamples
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end SimpleExamples;
+within ThermoSysPro.Fluid.Examples;
+package SimpleExamples
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end SimpleExamples;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order
index c793b479b420508c377496a886420cdaa1868e84..f1d67d76b352afa2a96bbd67e2ecb130a21a2319 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order
@@ -1,86 +1,86 @@
-TestAirHumidity
-TestBend
-TestBoilerSystem
-TestCentrifugalPump1
-TestCheckValve
-TestCHPEngineBarkantineSystem
-TestCombustionTurbine
-TestCompressor
-TestDiaphragm
-TestDiffusion_DynamicOnePhaseFlowPipe
-TestDiffusion_DynamicPlateHeatExchanger
-TestDiffusion_DynamicTwoPhaseFlowPipe
-TestDiffusion_VolumeA
-TestDynamicCheckValve
-TestDynamicCondenser
-TestDynamicDrum
-TestDynamicDrum_CC
-TestDynamicFlueGasesMultiFluidHeatExchanger
-TestDynamicMultiFluidHeatExchanger
-TestDynamicMultiFluidHeatExchangerShell
-TestDynamicOnePhaseFlowPipe
-TestDynamicOnePhaseFlowShell
-TestDynamicPlateHeatExchanger
-TestDynamicReliefValve
-TestDynamicTwoPhaseFlowPipe
-TestDynamicTwoPhaseFlowRiser
-TestDynamicWaterHeating
-TestDynamicWaterHeatingOnePipe
-TestDynamicWaterSteamMultiFluidHeatExchanger
-TestFixedPowerHeatExchanger
-TestFossilFuelBoiler
-TestFresnelField
-TestGasTurbine
-TestGenericCombustion
-TestGenericCombustion1D
-TestGridFurnace
-TestGTCombustionChamber
-TestHeatPumpCompressor
-TestIdealCheckValve
-TestIdealSwitchValve
-TestInternalCombustionEngine
-TestInvSingularPressureLoss
-TestJunctions1
-TestJunctions2
-TestJunctions3
-TestJunctions4
-TestLoopBreaker
-TestMassFlowMultiplier
-TestNTUWaterHeater0
-TestPostCombustionGas
-TestPressurizer
-TestRefP
-TestRefP1
-TestSensors
-TestSimpleDynamicCondenser
-TestSimpleDynamicCondenser1
-TestSimpleEvaporatorWaterSteamFlueGases
-TestSimpleStaticCondenser
-TestSingularPressureLoss
-TestStaticAerocondenser
-TestStaticCentrifugalPump1
-TestStaticCondenser
-TestStaticCondenserHEI
-TestStaticDrum1
-TestStaticDrum2
-TestStaticExchangerDTorWorEff
-TestStaticExchangerKS
-TestStaticFan
-TestStaticPlateHeatExchanger
-TestStaticWallFlueGasesExchanger
-TestSteamDryer1
-TestSteamDryer2
-TestSteamEngine
-TestSteamExtractionSplitter
-TestStodolaTurbine1
-TestStodolaTurbine2
-TestSwitchValve
-TestTank
-TestTankHorizontal
-TestThreeWayValve
-TestTwoPhaseCavity
-TestTwoPhaseCavityOnePipe
-TestTwoPhaseVolume
-TestVolumeA
-TestVolumeA1
-TestVolumeI
+TestAirHumidity
+TestBend
+TestBoilerSystem
+TestCentrifugalPump1
+TestCheckValve
+TestCHPEngineBarkantineSystem
+TestCombustionTurbine
+TestCompressor
+TestDiaphragm
+TestDiffusion_DynamicOnePhaseFlowPipe
+TestDiffusion_DynamicPlateHeatExchanger
+TestDiffusion_DynamicTwoPhaseFlowPipe
+TestDiffusion_VolumeA
+TestDynamicCheckValve
+TestDynamicCondenser
+TestDynamicDrum
+TestDynamicDrum_CC
+TestDynamicFlueGasesMultiFluidHeatExchanger
+TestDynamicMultiFluidHeatExchanger
+TestDynamicMultiFluidHeatExchangerShell
+TestDynamicOnePhaseFlowPipe
+TestDynamicOnePhaseFlowShell
+TestDynamicPlateHeatExchanger
+TestDynamicReliefValve
+TestDynamicTwoPhaseFlowPipe
+TestDynamicTwoPhaseFlowRiser
+TestDynamicWaterHeating
+TestDynamicWaterHeatingOnePipe
+TestDynamicWaterSteamMultiFluidHeatExchanger
+TestFixedPowerHeatExchanger
+TestFossilFuelBoiler
+TestFresnelField
+TestGasTurbine
+TestGenericCombustion
+TestGenericCombustion1D
+TestGridFurnace
+TestGTCombustionChamber
+TestHeatPumpCompressor
+TestIdealCheckValve
+TestIdealSwitchValve
+TestInternalCombustionEngine
+TestInvSingularPressureLoss
+TestJunctions1
+TestJunctions2
+TestJunctions3
+TestJunctions4
+TestLoopBreaker
+TestMassFlowMultiplier
+TestNTUWaterHeater0
+TestPostCombustionGas
+TestPressurizer
+TestRefP
+TestRefP1
+TestSensors
+TestSimpleDynamicCondenser
+TestSimpleDynamicCondenser1
+TestSimpleEvaporatorWaterSteamFlueGases
+TestSimpleStaticCondenser
+TestSingularPressureLoss
+TestStaticAerocondenser
+TestStaticCentrifugalPump1
+TestStaticCondenser
+TestStaticCondenserHEI
+TestStaticDrum1
+TestStaticDrum2
+TestStaticExchangerDTorWorEff
+TestStaticExchangerKS
+TestStaticFan
+TestStaticPlateHeatExchanger
+TestStaticWallFlueGasesExchanger
+TestSteamDryer1
+TestSteamDryer2
+TestSteamEngine
+TestSteamExtractionSplitter
+TestStodolaTurbine1
+TestStodolaTurbine2
+TestSwitchValve
+TestTank
+TestTankHorizontal
+TestThreeWayValve
+TestTwoPhaseCavity
+TestTwoPhaseCavityOnePipe
+TestTwoPhaseVolume
+TestVolumeA
+TestVolumeA1
+TestVolumeI
diff --git a/ThermoSysPro/Fluid/Examples/package.mo b/ThermoSysPro/Fluid/Examples/package.mo
index 85227fb2a66e878bb9a08e37d93d7d0956207f92..c2f612ebf6a4ac9ec5b5edf9ec60f3839f2d5565 100644
--- a/ThermoSysPro/Fluid/Examples/package.mo
+++ b/ThermoSysPro/Fluid/Examples/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Fluid;
-package Examples
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Examples;
+within ThermoSysPro.Fluid;
+package Examples
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Examples;
diff --git a/ThermoSysPro/Fluid/Examples/package.order b/ThermoSysPro/Fluid/Examples/package.order
index 677ba0965f846c6798994522aca9d2145c41fd01..bef4659248e4c935a3c5b60ffeb3062deec08f07 100644
--- a/ThermoSysPro/Fluid/Examples/package.order
+++ b/ThermoSysPro/Fluid/Examples/package.order
@@ -1,4 +1,4 @@
-CombinedCyclePowerPlant
-SimpleExamples
-Book
-Control
+CombinedCyclePowerPlant
+SimpleExamples
+Book
+Control
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo
index 2344f253e2b1cf2f469b1b255b7e17da0cc682bc..8b1083c08503d9043000e4cd0970518a78bdd14c 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo
@@ -1,328 +1,328 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicCondenser "Dynamic condenser"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
-  parameter Units.SI.Length Lv=15 "Cavity length";
-  parameter Units.SI.Length L2=14 "Pipes length";
-  parameter Units.SI.Length Lc=2.5
-    "Support plate spacing in cooling zone(chicanes)";
-  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
-  parameter Units.SI.Thickness ec=2.e-3 "Thickness of the cooling pipes";
-  parameter Integer Ns=10 "Number of segments for pipes";
-  parameter Integer ntubest=10000 "Number of total pipes in Cavity ";
-  parameter Integer ntubesV=200 "Numbers of pipes in a vertical plan in Cavity";
-  parameter Units.SI.SpecificHeatCapacity cp=460
-    "Specific heat capacity of the metal of the cooling pipes";
-  parameter Units.SI.Density rho=7900
-    "Density of the metal of the cooling pipes";
-  parameter Units.SI.ThermalConductivity lambda=26
-    "Wall thermal conductivity of the cooling pipes";
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true "true: start from steady state - false: start from (P0c, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.066 "Fraction of initial liquid volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0c=1e4
-    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-  Volumes.TwoPhaseCavityOnePipe DynamicCondenser(
-    Vf0=Vf0,
-    P0=P0c,
-    Ns=Ns,
-    L2=L2,
-    NbTubT=ntubest,
-    Lc=Lc,
-    NbTubV=ntubesV,
-    Dext=Dc + 2*ec,
-    R=Rv,
-    L=Lv,
-    Vertical=true,
-    wsftype=wsftype,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion)
-    annotation (                        Placement(transformation(extent={{-100,-100},
-            {100,100}},       rotation=0)));
-  DynamicOnePhaseFlowPipe pipe_3(
-    D=Dc,
-    L=L2,
-    ntubes=ntubest,
-    Ns=Ns,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    advection=advection,
-    option_temperature=option_temperature,
-    inertia=inertia,
-    T0=T0,
-    h0=h0)
-    annotation (Placement(transformation(extent={{-58,-20},{54,18}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet  C1vap "Vapor inlet" annotation (Placement(
-        transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet  C2ex "Condensed water extraction outlet"
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Interfaces.Connectors.FluidInlet  Ce1 "Cooling water inlet" annotation (
-      Placement(transformation(extent={{-110,-11},{-90,9}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet  Ce2 "Cooling water outlet" annotation (
-      Placement(transformation(extent={{89,-11},{109,9}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
-    annotation (Placement(transformation(extent={{98,-62},{118,-42}}, rotation=
-            0)));
-
-  Interfaces.Connectors.FluidInlet  C1 "Extra water inlet" annotation (
-      Placement(transformation(extent={{-91,65},{-71,85}},  rotation=0),
-        iconTransformation(extent={{-91,65},{-71,85}})));
-  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    L=L2,
-    Ns=Ns,
-    ntubes=ntubest,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state)
-    annotation (Placement(transformation(extent={{-58,-4},{54,40}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet  C2vap "Vapor inlet" annotation (Placement(
-        transformation(extent={{-49,82},{-29,102}}, rotation=0),
-        iconTransformation(extent={{-49,82},{-29,102}})));
-equation
-
-  if (cardinality(C1) == 1) then
-    C1.Q = 0;
-    C1.h = 1.e5;
-    C1.h_vol_1 = 1.e5;
-    C1.diff_res_1 = 0;
-    C1.diff_on_1 = false;
-    C1.ftype = ftype;
-    C1.Xco2 = 0;
-    C1.Xh2o = 1;
-    C1.Xo2 = 0;
-    C1.Xso2 = 0;
-  end if;
-
-  if (cardinality(C2vap) == 1) then
-    C2vap.Q = 0;
-    C2vap.h = 1.e5;
-    C2vap.h_vol_1 = 1.e5;
-    C2vap.diff_res_1 = 0;
-    C2vap.diff_on_1 = false;
-    C2vap.ftype = ftype;
-    C2vap.Xco2 = 0;
-    C2vap.Xh2o = 1;
-    C2vap.Xo2 = 0;
-    C2vap.Xso2 = 0;
-  end if;
-
-  connect(DynamicCondenser.Cl, C2ex)
-                               annotation (Line(points={{7.10543e-015,-73.3333},
-          {7.10543e-015,-98},{0,-98},{0,-100}}, color={0,0,255}));
-  connect(DynamicCondenser.yLevel, sortieReelle)
-    annotation (Line(points={{98.8571,-31.3333},{94,-31.3333},{94,-52},{108,-52}}));
-  connect(DynamicCondenser.Cth3, Wall_3.WT2)
-                                      annotation (Line(points={{-0.571429,
-          37.3333},{-2,32},{-2,22.4}}, color={191,95,0}));
-  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{-2,13.6},{-2,4.7}},
-        color={191,95,0}));
-  connect(DynamicCondenser.CvBP, C1vap)
-    annotation (Line(points={{-0.571429,73.3333},{-0.571429,92},{0,92},{0,100}}));
-  connect(C2vap, DynamicCondenser.CvGCT)
-    annotation (Line(points={{-39,92},{-42.8571,92},{-42.8571,73.3333}}));
-  connect(pipe_3.C2, Ce2) annotation (Line(
-      points={{54,-1},{99,-1}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(pipe_3.C1, Ce1)
-    annotation (Line(points={{-58,-1},{-100,-1}}, thickness=0.5));
-  connect(C1, DynamicCondenser.Ce) annotation (Line(points={{-81,75},{-76.5714,
-          75},{-76.5714,52.6667}},
-                               color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={Text(
-          extent={{6,114},{32,98}},
-          lineColor={0,0,255},
-          textString="LP")}),
-                       Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{100,58},{80,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,58},{-80,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,24},{-80,18}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-20},{-80,-26}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-42},{-80,-48}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,24},{20,18}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-42},{20,-48}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-20},{20,-26}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-20},{-30,-26}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-42},{-30,-48}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,24},{-30,18}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,100},{-20,98},{-40,94},{-60,88},{-80,78},{-92,66},{-96,62},
-              {-96,62},{-100,58},{100,58},{96,62},{92,66},{86,72},{80,78},{60,
-              88},{40,94},{20,98},{0,100}},
-          lineColor={28,108,200},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-100},{-20,-98},{-40,-96},{-60,-90},{-80,-80},{-92,-68},{
-              -96,-64},{-100,-60},{-100,-60},{98,-60},{100,-60},{96,-64},{92,
-              -68},{80,-80},{60,-90},{40,-96},{20,-98},{0,-100}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({53,117,255}, if fluid==1 then {53,117,255} else if fluid==2 then {0,255,255} else if fluid==3 then {175,175,175} else if fluid==4 then {255,170,213} else if fluid==5 then {0,127,0} else if fluid==6 then {170,215,215} else {213,255,170}),
-          fillPattern=FillPattern.Solid,
-          lineThickness=0.5),
-        Polygon(
-          points={{100,-60},{80,-80},{80,-60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,-60},{-80,-60},{-80,-80},{-100,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,58},{-80,58},{-80,78},{-100,58}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{100,58},{80,58},{80,78},{100,58}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-64},{-80,-70}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-64},{20,-70}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-64},{-30,-70}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,2},{-80,-4}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,2},{20,-4}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,2},{-30,-4}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,46},{-80,40}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,46},{20,40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,46},{-30,40}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{90,8},{80,20}}, color={255,0,0}),
-        Line(points={{90,-10},{80,-22}}, color={255,0,0}),
-        Line(points={{90,-1},{78,-1}}, color={255,0,0}),
-        Line(points={{-90,9},{-80,20}}, color={0,0,255}),
-        Line(points={{-90,-10},{-80,-24}}, color={0,0,255}),
-        Line(points={{-90,-1},{-76,-1}}, color={0,0,255})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end DynamicCondenser;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicCondenser "Dynamic condenser"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
+  parameter Units.SI.Length Lv=15 "Cavity length";
+  parameter Units.SI.Length L2=14 "Pipes length";
+  parameter Units.SI.Length Lc=2.5
+    "Support plate spacing in cooling zone(chicanes)";
+  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
+  parameter Units.SI.Thickness ec=2.e-3 "Thickness of the cooling pipes";
+  parameter Integer Ns=10 "Number of segments for pipes";
+  parameter Integer ntubest=10000 "Number of total pipes in Cavity ";
+  parameter Integer ntubesV=200 "Numbers of pipes in a vertical plan in Cavity";
+  parameter Units.SI.SpecificHeatCapacity cp=460
+    "Specific heat capacity of the metal of the cooling pipes";
+  parameter Units.SI.Density rho=7900
+    "Density of the metal of the cooling pipes";
+  parameter Units.SI.ThermalConductivity lambda=26
+    "Wall thermal conductivity of the cooling pipes";
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true "true: start from steady state - false: start from (P0c, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.066 "Fraction of initial liquid volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0c=1e4
+    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+  Volumes.TwoPhaseCavityOnePipe DynamicCondenser(
+    Vf0=Vf0,
+    P0=P0c,
+    Ns=Ns,
+    L2=L2,
+    NbTubT=ntubest,
+    Lc=Lc,
+    NbTubV=ntubesV,
+    Dext=Dc + 2*ec,
+    R=Rv,
+    L=Lv,
+    Vertical=true,
+    wsftype=wsftype,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion)
+    annotation (                        Placement(transformation(extent={{-100,-100},
+            {100,100}},       rotation=0)));
+  DynamicOnePhaseFlowPipe pipe_3(
+    D=Dc,
+    L=L2,
+    ntubes=ntubest,
+    Ns=Ns,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    advection=advection,
+    option_temperature=option_temperature,
+    inertia=inertia,
+    T0=T0,
+    h0=h0)
+    annotation (Placement(transformation(extent={{-58,-20},{54,18}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet  C1vap "Vapor inlet" annotation (Placement(
+        transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet  C2ex "Condensed water extraction outlet"
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Interfaces.Connectors.FluidInlet  Ce1 "Cooling water inlet" annotation (
+      Placement(transformation(extent={{-110,-11},{-90,9}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet  Ce2 "Cooling water outlet" annotation (
+      Placement(transformation(extent={{89,-11},{109,9}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
+    annotation (Placement(transformation(extent={{98,-62},{118,-42}}, rotation=
+            0)));
+
+  Interfaces.Connectors.FluidInlet  C1 "Extra water inlet" annotation (
+      Placement(transformation(extent={{-91,65},{-71,85}},  rotation=0),
+        iconTransformation(extent={{-91,65},{-71,85}})));
+  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    L=L2,
+    Ns=Ns,
+    ntubes=ntubest,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state)
+    annotation (Placement(transformation(extent={{-58,-4},{54,40}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet  C2vap "Vapor inlet" annotation (Placement(
+        transformation(extent={{-49,82},{-29,102}}, rotation=0),
+        iconTransformation(extent={{-49,82},{-29,102}})));
+equation
+
+  if (cardinality(C1) == 1) then
+    C1.Q = 0;
+    C1.h = 1.e5;
+    C1.h_vol_1 = 1.e5;
+    C1.diff_res_1 = 0;
+    C1.diff_on_1 = false;
+    C1.ftype = ftype;
+    C1.Xco2 = 0;
+    C1.Xh2o = 0;
+    C1.Xo2 = 0;
+    C1.Xso2 = 0;
+  end if;
+
+  if (cardinality(C2vap) == 1) then
+    C2vap.Q = 0;
+    C2vap.h = 1.e5;
+    C2vap.h_vol_1 = 1.e5;
+    C2vap.diff_res_1 = 0;
+    C2vap.diff_on_1 = false;
+    C2vap.ftype = ftype;
+    C2vap.Xco2 = 0;
+    C2vap.Xh2o = 0;
+    C2vap.Xo2 = 0;
+    C2vap.Xso2 = 0;
+  end if;
+
+  connect(DynamicCondenser.Cl, C2ex)
+                               annotation (Line(points={{7.10543e-015,-73.3333},
+          {7.10543e-015,-98},{0,-98},{0,-100}}, color={0,0,255}));
+  connect(DynamicCondenser.yLevel, sortieReelle)
+    annotation (Line(points={{98.8571,-31.3333},{94,-31.3333},{94,-52},{108,-52}}));
+  connect(DynamicCondenser.Cth3, Wall_3.WT2)
+                                      annotation (Line(points={{-0.571429,
+          37.3333},{-2,32},{-2,22.4}}, color={191,95,0}));
+  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{-2,13.6},{-2,4.7}},
+        color={191,95,0}));
+  connect(DynamicCondenser.CvBP, C1vap)
+    annotation (Line(points={{-0.571429,73.3333},{-0.571429,92},{0,92},{0,100}}));
+  connect(C2vap, DynamicCondenser.CvGCT)
+    annotation (Line(points={{-39,92},{-42.8571,92},{-42.8571,73.3333}}));
+  connect(pipe_3.C2, Ce2) annotation (Line(
+      points={{54,-1},{99,-1}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(pipe_3.C1, Ce1)
+    annotation (Line(points={{-58,-1},{-100,-1}}, thickness=0.5));
+  connect(C1, DynamicCondenser.Ce) annotation (Line(points={{-81,75},{-76.5714,
+          75},{-76.5714,52.6667}},
+                               color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={Text(
+          extent={{6,114},{32,98}},
+          lineColor={0,0,255},
+          textString="LP")}),
+                       Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{100,58},{80,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,58},{-80,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,24},{-80,18}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-20},{-80,-26}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-42},{-80,-48}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,24},{20,18}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-42},{20,-48}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-20},{20,-26}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-20},{-30,-26}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-42},{-30,-48}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,24},{-30,18}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,100},{-20,98},{-40,94},{-60,88},{-80,78},{-92,66},{-96,62},
+              {-96,62},{-100,58},{100,58},{96,62},{92,66},{86,72},{80,78},{60,
+              88},{40,94},{20,98},{0,100}},
+          lineColor={28,108,200},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-100},{-20,-98},{-40,-96},{-60,-90},{-80,-80},{-92,-68},{
+              -96,-64},{-100,-60},{-100,-60},{98,-60},{100,-60},{96,-64},{92,
+              -68},{80,-80},{60,-90},{40,-96},{20,-98},{0,-100}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({53,117,255}, if fluid==1 then {53,117,255} else if fluid==2 then {0,255,255} else if fluid==3 then {175,175,175} else if fluid==4 then {255,170,213} else if fluid==5 then {0,127,0} else if fluid==6 then {170,215,215} else {213,255,170}),
+          fillPattern=FillPattern.Solid,
+          lineThickness=0.5),
+        Polygon(
+          points={{100,-60},{80,-80},{80,-60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,-60},{-80,-60},{-80,-80},{-100,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,58},{-80,58},{-80,78},{-100,58}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{100,58},{80,58},{80,78},{100,58}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-64},{-80,-70}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-64},{20,-70}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-64},{-30,-70}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,2},{-80,-4}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,2},{20,-4}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,2},{-30,-4}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,46},{-80,40}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,46},{20,40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,46},{-30,40}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{90,8},{80,20}}, color={255,0,0}),
+        Line(points={{90,-10},{80,-22}}, color={255,0,0}),
+        Line(points={{90,-1},{78,-1}}, color={255,0,0}),
+        Line(points={{-90,9},{-80,20}}, color={0,0,255}),
+        Line(points={{-90,-10},{-80,-24}}, color={0,0,255}),
+        Line(points={{-90,-1},{-76,-1}}, color={0,0,255})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end DynamicCondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo
index b28b95d0eec184c7ab3952cf851f021b17813723..849004dd735dfbc35d75ac9f903225ae8c1c2a60 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo
@@ -1,176 +1,176 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicFlueGasesMultiFluidHeatExchanger "Dynamic flue gases - water/steam heat exchanger"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Length L=1 "Exchanger length";
-  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
-  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
-  parameter Integer Ns=1 "Numver of segments";
-  parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
-  parameter Integer Ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
-  parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity";
-  parameter Units.SI.SpecificHeatCapacity cpw=1000
-    "Wall specific heat capacity (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.Density rhow=7800
-    "Wall density (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  StaticWallFlueGasesExchanger
-    ExchangerFlueGasesMetal(
-    Dext=0.022,
-    Ns=Ns,
-    NbTub=Ntubes,
-    L=L,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion)
-    annotation (Placement(transformation(extent={{-10,30},{10,10}}, rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
-    L=L,
-    D=Dint,
-    Ns=Ns,
-    ntubes=Ntubes,
-    dynamic_energy_balance=dynamic_energy_balance,
-    cpw=cpw,
-    rhow=rhow,
-    steady_state=steady_state,
-    e=e,
-    lambda=lambda,
-    T0=T0[1])                            annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe(
-    L=L,
-    D=Dint,
-    ntubes=Ntubes,
-    Ns=Ns,
-    z1=z1,
-    z2=z2,
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    T0=T0,
-    h0=h0)
-    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
-            0)));
-  Interfaces.Connectors.FluidInlet Cfg1 annotation (Placement(transformation(
-          extent={{-10,40},{10,60}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cfg2 annotation (Placement(transformation(
-          extent={{-10,-60},{10,-40}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Cws1 annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cws2 annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-equation
-  connect(Cws2, TwoPhaseFlowPipe.C2)
-                                   annotation (Line(points={{100,0},{40,0},{40,
-          -20},{10,-20}}, color={255,0,0}));
-  connect(Cws1, TwoPhaseFlowPipe.C1)
-    annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}}));
-  connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh)
-    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
-  connect(ExchangerFlueGasesMetal.CTh, ExchangerWall.WT2)
-    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
-  connect(ExchangerFlueGasesMetal.C1, Cfg1) annotation (Line(
-      points={{-10,20},{-20,20},{-20,50},{0,50}},
-      color={0,0,0},
-      thickness=0.5));
-  connect(ExchangerFlueGasesMetal.C2, Cfg2) annotation (Line(
-      points={{10,20},{24,20},{24,-50},{0,-50}},
-      color={0,0,0},
-      thickness=0.5));
-  annotation (         Icon(graphics={
-        Rectangle(
-          extent={{-100,50},{100,-50}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={255,127,0}),
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={0,0,0},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-          lineThickness=0),
-        Line(points={{-60,50},{-60,-50}}),
-        Line(points={{-20,50},{-20,-50}}),
-        Line(points={{20,50},{20,-50}}),
-        Line(points={{60,50},{60,-50}}),
-        Text(
-          extent={{-132,28},{-106,14}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water inlet"),
-        Text(
-          extent={{104,26},{128,14}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water outlet"),
-        Text(
-          extent={{-50,66},{-16,48}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Flue gases inlet"),
-        Text(
-          extent={{-54,-50},{-16,-70}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Flue gases outlet")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end DynamicFlueGasesMultiFluidHeatExchanger;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicFlueGasesMultiFluidHeatExchanger "Dynamic flue gases - water/steam heat exchanger"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Length L=1 "Exchanger length";
+  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
+  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
+  parameter Integer Ns=1 "Numver of segments";
+  parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
+  parameter Integer Ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
+  parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity";
+  parameter Units.SI.SpecificHeatCapacity cpw=1000
+    "Wall specific heat capacity (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.Density rhow=7800
+    "Wall density (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  StaticWallFlueGasesExchanger
+    ExchangerFlueGasesMetal(
+    Dext=0.022,
+    Ns=Ns,
+    NbTub=Ntubes,
+    L=L,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion)
+    annotation (Placement(transformation(extent={{-10,30},{10,10}}, rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
+    L=L,
+    D=Dint,
+    Ns=Ns,
+    ntubes=Ntubes,
+    dynamic_energy_balance=dynamic_energy_balance,
+    cpw=cpw,
+    rhow=rhow,
+    steady_state=steady_state,
+    e=e,
+    lambda=lambda,
+    T0=T0[1])                            annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe(
+    L=L,
+    D=Dint,
+    ntubes=Ntubes,
+    Ns=Ns,
+    z1=z1,
+    z2=z2,
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    T0=T0,
+    h0=h0)
+    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
+            0)));
+  Interfaces.Connectors.FluidInlet Cfg1 annotation (Placement(transformation(
+          extent={{-10,40},{10,60}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cfg2 annotation (Placement(transformation(
+          extent={{-10,-60},{10,-40}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Cws1 annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cws2 annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+equation
+  connect(Cws2, TwoPhaseFlowPipe.C2)
+                                   annotation (Line(points={{100,0},{40,0},{40,
+          -20},{10,-20}}, color={255,0,0}));
+  connect(Cws1, TwoPhaseFlowPipe.C1)
+    annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}}));
+  connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh)
+    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
+  connect(ExchangerFlueGasesMetal.CTh, ExchangerWall.WT2)
+    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
+  connect(ExchangerFlueGasesMetal.C1, Cfg1) annotation (Line(
+      points={{-10,20},{-20,20},{-20,50},{0,50}},
+      color={0,0,0},
+      thickness=0.5));
+  connect(ExchangerFlueGasesMetal.C2, Cfg2) annotation (Line(
+      points={{10,20},{24,20},{24,-50},{0,-50}},
+      color={0,0,0},
+      thickness=0.5));
+  annotation (         Icon(graphics={
+        Rectangle(
+          extent={{-100,50},{100,-50}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={255,127,0}),
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={0,0,0},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+          lineThickness=0),
+        Line(points={{-60,50},{-60,-50}}),
+        Line(points={{-20,50},{-20,-50}}),
+        Line(points={{20,50},{20,-50}}),
+        Line(points={{60,50},{60,-50}}),
+        Text(
+          extent={{-132,28},{-106,14}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water inlet"),
+        Text(
+          extent={{104,26},{128,14}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water outlet"),
+        Text(
+          extent={{-50,66},{-16,48}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Flue gases inlet"),
+        Text(
+          extent={{-54,-50},{-16,-70}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Flue gases outlet")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end DynamicFlueGasesMultiFluidHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo
index 032dd0111bdb8e57b269c96642239d5ae24cc8c0..59cc81523abcff6b42f8bbdebd871e54e921e4b2 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo
@@ -1,210 +1,210 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicMultiFluidHeatExchanger "Dynamic one-phase heat exchanger"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Length L=1 "Exchanger length";
-  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
-  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
-  parameter Real rugosrel_int=0.0007 "Internal relative roughness";
-  parameter Real rugosrel_ext=0.0007 "External relative roughness";
-  parameter Units.SI.Diameter Dint=0.1 "Internal diameter";
-  parameter Units.SI.Diameter Dext=0.11 "External diameter";
-  parameter Integer Ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
-  parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity";
-  parameter Units.SI.SpecificHeatCapacity cpw=1000
-    "Wall specific heat capacity (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.Density rhow=7800
-    "Wall density (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Integer Ns=1 "Number of segments";
-  parameter Units.SI.AbsolutePressure P0=1.e5
-    "Fluid initial pressure (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean option_temperature=true
-    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_2(
-    Ns=Ns,
-    L=L,
-    ntubes=Ntubes,
-    D=Dext,
-    continuous_flow_reversal=continuous_flow_reversal,
-    T0=T0,
-    h0=h0,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    diffusion=diffusion,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    region=region,
-    P0=P0,
-    z1=z1,
-    z2=z2,
-    rugosrel=rugosrel_ext,
-    inertia=inertia)
-                  annotation (Placement(transformation(extent={{-10,30},{10,10}},
-          rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
-    L=L,
-    D=Dint,
-    Ns=Ns,
-    ntubes=Ntubes,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    T0=T0[1],
-    cpw=cpw,
-    rhow=rhow,
-    e=e,
-    lambda=lambda)                       annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_1(
-    ntubes=Ntubes,
-    Ns=Ns,
-    T0=T0,
-    h0=h0,
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    region=region,
-    P0=P0,
-    L=L,
-    D=Dint,
-    rugosrel=rugosrel_int,
-    z1=z1,
-    z2=z2) annotation (Placement(transformation(extent={{-10,-30},{10,-10}},
-          rotation=0)));
-  Interfaces.Connectors.FluidInlet  Cfg1 annotation (Placement(transformation(
-          extent={{-10,40},{10,60}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet  Cfg2 annotation (Placement(transformation(
-          extent={{-10,-60},{10,-40}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet                     Cws1 annotation (
-      Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet                     Cws2 annotation (
-      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-  connect(Cws2, DynamicOnePhaseFlowPipe_1.C2) annotation (Line(
-      points={{100,0},{40,0},{40,-20},{10,-20}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Cws1, DynamicOnePhaseFlowPipe_1.C1) annotation (Line(points={{-100,0},
-          {-20,0},{-20,-20},{-10,-20}}, thickness=0.5));
-  connect(ExchangerWall.WT1, DynamicOnePhaseFlowPipe_1.CTh)
-    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
-  connect(DynamicOnePhaseFlowPipe_2.CTh, ExchangerWall.WT2)
-    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
-  connect(DynamicOnePhaseFlowPipe_2.C2, Cfg2) annotation (Line(
-      points={{10,20},{32,20},{32,-50},{0,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(DynamicOnePhaseFlowPipe_2.C1, Cfg1) annotation (Line(
-      points={{-10,20},{-26,20},{-26,50},{0,50}},
-      color={0,0,0},
-      thickness=1));
-  annotation (         Icon(graphics={
-        Rectangle(
-          extent={{-100,50},{100,-50}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-          fillColor={255,127,0}),
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={0,0,0},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-         fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Line(points={{-60,50},{-60,-50}}),
-        Line(points={{-20,50},{-20,-50}}),
-        Line(points={{20,50},{20,-50}}),
-        Line(points={{60,50},{60,-50}}),
-        Text(
-          extent={{-48,68},{-20,52}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Fluid2 inlet"),
-        Text(
-          extent={{-134,22},{-108,10}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Fluid1 inlet"),
-        Text(
-          extent={{104,24},{132,12}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Fluid1 outlet"),
-        Text(
-          extent={{-46,-56},{-14,-68}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Fluid2 outlet")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end DynamicMultiFluidHeatExchanger;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicMultiFluidHeatExchanger "Dynamic one-phase heat exchanger"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Length L=1 "Exchanger length";
+  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
+  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
+  parameter Real rugosrel_int=0.0007 "Internal relative roughness";
+  parameter Real rugosrel_ext=0.0007 "External relative roughness";
+  parameter Units.SI.Diameter Dint=0.1 "Internal diameter";
+  parameter Units.SI.Diameter Dext=0.11 "External diameter";
+  parameter Integer Ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
+  parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity";
+  parameter Units.SI.SpecificHeatCapacity cpw=1000
+    "Wall specific heat capacity (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.Density rhow=7800
+    "Wall density (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Integer Ns=1 "Number of segments";
+  parameter Units.SI.AbsolutePressure P0=1.e5
+    "Fluid initial pressure (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean option_temperature=true
+    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_2(
+    Ns=Ns,
+    L=L,
+    ntubes=Ntubes,
+    D=Dext,
+    continuous_flow_reversal=continuous_flow_reversal,
+    T0=T0,
+    h0=h0,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    diffusion=diffusion,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    region=region,
+    P0=P0,
+    z1=z1,
+    z2=z2,
+    rugosrel=rugosrel_ext,
+    inertia=inertia)
+                  annotation (Placement(transformation(extent={{-10,30},{10,10}},
+          rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
+    L=L,
+    D=Dint,
+    Ns=Ns,
+    ntubes=Ntubes,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    T0=T0[1],
+    cpw=cpw,
+    rhow=rhow,
+    e=e,
+    lambda=lambda)                       annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_1(
+    ntubes=Ntubes,
+    Ns=Ns,
+    T0=T0,
+    h0=h0,
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    region=region,
+    P0=P0,
+    L=L,
+    D=Dint,
+    rugosrel=rugosrel_int,
+    z1=z1,
+    z2=z2) annotation (Placement(transformation(extent={{-10,-30},{10,-10}},
+          rotation=0)));
+  Interfaces.Connectors.FluidInlet  Cfg1 annotation (Placement(transformation(
+          extent={{-10,40},{10,60}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet  Cfg2 annotation (Placement(transformation(
+          extent={{-10,-60},{10,-40}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet                     Cws1 annotation (
+      Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet                     Cws2 annotation (
+      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+  connect(Cws2, DynamicOnePhaseFlowPipe_1.C2) annotation (Line(
+      points={{100,0},{40,0},{40,-20},{10,-20}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Cws1, DynamicOnePhaseFlowPipe_1.C1) annotation (Line(points={{-100,0},
+          {-20,0},{-20,-20},{-10,-20}}, thickness=0.5));
+  connect(ExchangerWall.WT1, DynamicOnePhaseFlowPipe_1.CTh)
+    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
+  connect(DynamicOnePhaseFlowPipe_2.CTh, ExchangerWall.WT2)
+    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
+  connect(DynamicOnePhaseFlowPipe_2.C2, Cfg2) annotation (Line(
+      points={{10,20},{32,20},{32,-50},{0,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(DynamicOnePhaseFlowPipe_2.C1, Cfg1) annotation (Line(
+      points={{-10,20},{-26,20},{-26,50},{0,50}},
+      color={0,0,0},
+      thickness=1));
+  annotation (         Icon(graphics={
+        Rectangle(
+          extent={{-100,50},{100,-50}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+          fillColor={255,127,0}),
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={0,0,0},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+         fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Line(points={{-60,50},{-60,-50}}),
+        Line(points={{-20,50},{-20,-50}}),
+        Line(points={{20,50},{20,-50}}),
+        Line(points={{60,50},{60,-50}}),
+        Text(
+          extent={{-48,68},{-20,52}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Fluid2 inlet"),
+        Text(
+          extent={{-134,22},{-108,10}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Fluid1 inlet"),
+        Text(
+          extent={{104,24},{132,12}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Fluid1 outlet"),
+        Text(
+          extent={{-46,-56},{-14,-68}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Fluid2 outlet")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end DynamicMultiFluidHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo
index 001e9d487cca1b4bef7adb4336206b6239161353..7b0d9a9ccf9348469a5af813711506fef2904a14 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo
@@ -1,208 +1,208 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicMultiFluidHeatExchangerShell "Dynamic one-phase heat exchanger"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Length L=1 "Exchanger length";
-  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
-  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
-  parameter Integer Ns=1 "Numver of segments";
-  parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
-  parameter Units.SI.Diameter Dext=0.11 "Pipe external diameter";
-  parameter Integer Ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.AbsolutePressure P0=1.e5
-    "Fluid initial pressure (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean option_temperature=true
-    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell
-    dynamicOnePhaseFlowShell(
-    Ns=Ns,
-    L=L,
-    ntubes=Ntubes,
-    De=Dext,
-    inertia=inertia,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    continuous_flow_reversal=continuous_flow_reversal,
-    advection=advection,
-    diffusion=diffusion,
-    T0=T0,
-    h0=h0,
-    region=region)
-             annotation (Placement(transformation(extent={{-10,30},{10,10}},
-          rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
-    L=L,
-    D=Dint,
-    Ns=Ns,
-    ntubes=Ntubes,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state)           annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe(
-    L=L,
-    D=Dint,
-    ntubes=Ntubes,
-    Ns=Ns,
-    z1=z1,
-    z2=z2,
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    dynamic_mass_balance=dynamic_mass_balance,
-    T0=T0,
-    h0=h0,
-    P0=P0,
-    region=region)
-           annotation (Placement(transformation(extent={{-10,-30},{10,-10}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 annotation (
-      Placement(transformation(extent={{-10,40},{10,60}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 annotation (
-      Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 annotation (
-      Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 annotation (
-      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-  connect(Cws2, DynamicOnePhaseFlowPipe.C2) annotation (Line(
-      points={{100,0},{40,0},{40,-20},{10,-20}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Cws1, DynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-100,0},{-20,
-          0},{-20,-20},{-10,-20}}, thickness=0.5));
-  connect(ExchangerWall.WT1, DynamicOnePhaseFlowPipe.CTh)
-    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
-  connect(dynamicOnePhaseFlowShell.CTh, ExchangerWall.WT2)
-    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
-  connect(dynamicOnePhaseFlowShell.C2, Cfg2) annotation (Line(
-      points={{10,20},{32,20},{32,-50},{0,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(dynamicOnePhaseFlowShell.C1, Cfg1) annotation (Line(
-      points={{-10,20},{-26,20},{-26,50},{0,50}},
-      color={0,0,0},
-      thickness=1));
-  annotation (         Icon(graphics={
-        Rectangle(
-          extent={{-100,50},{100,-50}},
-          lineColor={0,0,255},
-         fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-          fillColor={255,127,0}),
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={0,0,0},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Line(points={{-60,50},{-60,-50}}),
-        Line(points={{-20,50},{-20,-50}}),
-        Line(points={{20,50},{20,-50}}),
-        Line(points={{60,50},{60,-50}}),
-        Line(
-          points={{-60,-30},{-60,-50}},
-          color={255,255,255},
-          thickness=1),
-        Line(
-          points={{-20,50},{-20,30}},
-          color={255,255,255},
-          thickness=1),
-        Line(
-          points={{20,-30},{20,-50}},
-          color={255,255,255},
-          thickness=1),
-        Line(
-          points={{60,50},{60,30}},
-          color={255,255,255},
-          thickness=1),
-        Text(
-          extent={{-50,66},{-16,48}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Flue gases inlet"),
-        Text(
-          extent={{-132,28},{-106,14}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water inlet"),
-        Text(
-          extent={{-54,-50},{-16,-70}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Flue gases outlet"),
-        Text(
-          extent={{104,26},{128,14}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water outlet")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end DynamicMultiFluidHeatExchangerShell;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicMultiFluidHeatExchangerShell "Dynamic one-phase heat exchanger"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Length L=1 "Exchanger length";
+  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
+  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
+  parameter Integer Ns=1 "Numver of segments";
+  parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
+  parameter Units.SI.Diameter Dext=0.11 "Pipe external diameter";
+  parameter Integer Ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.AbsolutePressure P0=1.e5
+    "Fluid initial pressure (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean option_temperature=true
+    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell
+    dynamicOnePhaseFlowShell(
+    Ns=Ns,
+    L=L,
+    ntubes=Ntubes,
+    De=Dext,
+    inertia=inertia,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    continuous_flow_reversal=continuous_flow_reversal,
+    advection=advection,
+    diffusion=diffusion,
+    T0=T0,
+    h0=h0,
+    region=region)
+             annotation (Placement(transformation(extent={{-10,30},{10,10}},
+          rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
+    L=L,
+    D=Dint,
+    Ns=Ns,
+    ntubes=Ntubes,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state)           annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe(
+    L=L,
+    D=Dint,
+    ntubes=Ntubes,
+    Ns=Ns,
+    z1=z1,
+    z2=z2,
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    dynamic_mass_balance=dynamic_mass_balance,
+    T0=T0,
+    h0=h0,
+    P0=P0,
+    region=region)
+           annotation (Placement(transformation(extent={{-10,-30},{10,-10}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 annotation (
+      Placement(transformation(extent={{-10,40},{10,60}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 annotation (
+      Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 annotation (
+      Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 annotation (
+      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+  connect(Cws2, DynamicOnePhaseFlowPipe.C2) annotation (Line(
+      points={{100,0},{40,0},{40,-20},{10,-20}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Cws1, DynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-100,0},{-20,
+          0},{-20,-20},{-10,-20}}, thickness=0.5));
+  connect(ExchangerWall.WT1, DynamicOnePhaseFlowPipe.CTh)
+    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
+  connect(dynamicOnePhaseFlowShell.CTh, ExchangerWall.WT2)
+    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
+  connect(dynamicOnePhaseFlowShell.C2, Cfg2) annotation (Line(
+      points={{10,20},{32,20},{32,-50},{0,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(dynamicOnePhaseFlowShell.C1, Cfg1) annotation (Line(
+      points={{-10,20},{-26,20},{-26,50},{0,50}},
+      color={0,0,0},
+      thickness=1));
+  annotation (         Icon(graphics={
+        Rectangle(
+          extent={{-100,50},{100,-50}},
+          lineColor={0,0,255},
+         fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+          fillColor={255,127,0}),
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={0,0,0},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Line(points={{-60,50},{-60,-50}}),
+        Line(points={{-20,50},{-20,-50}}),
+        Line(points={{20,50},{20,-50}}),
+        Line(points={{60,50},{60,-50}}),
+        Line(
+          points={{-60,-30},{-60,-50}},
+          color={255,255,255},
+          thickness=1),
+        Line(
+          points={{-20,50},{-20,30}},
+          color={255,255,255},
+          thickness=1),
+        Line(
+          points={{20,-30},{20,-50}},
+          color={255,255,255},
+          thickness=1),
+        Line(
+          points={{60,50},{60,30}},
+          color={255,255,255},
+          thickness=1),
+        Text(
+          extent={{-50,66},{-16,48}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Flue gases inlet"),
+        Text(
+          extent={{-132,28},{-106,14}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water inlet"),
+        Text(
+          extent={{-54,-50},{-16,-70}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Flue gases outlet"),
+        Text(
+          extent={{104,26},{128,14}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water outlet")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end DynamicMultiFluidHeatExchangerShell;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo
index 139380448bdc1fd4550627ecbc543b93e4c46744..b7c774fa0813a9809dbed99522f0fa0720759f45 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo
@@ -1,438 +1,438 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicOnePhaseFlowPipe "Dynamic one-phase flow pipe"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
-  parameter Real rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real CSailettes=1 "Increase/decrease factor of the heat exchange surface for solar receiver or boiler ";
-  parameter Real dpfCorr=1.00 "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Real hcCorr=1.00 "Corrective term for the heat exchange coefficient (hc) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.AbsolutePressure P0=1.e5
-    "Fluid initial pressure (active if steady_state = false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state));
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean option_temperature=true
-    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Internal cross sectional pipe area";
-  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-  parameter Units.SI.Area dSi=pi*Di*dx1*CSailettes
-    "Internal heat exchange area for a node";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boudary of node i";
-  Units.SI.MassFlowRate BQ[N - 1]
-    "Right hand side of the mass balance equation for thermal node i";
-  Units.SI.Power BH[N - 1]
-    "Right hand side of the energy balance equation for thermal node i";
-  Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Convection thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Diffusion thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the water side for node i";
-  Units.SI.Power W1t "Total power exchanged on the water side";
-  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
-       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
-  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Fluid Reynolds number in hydraulic node i";
-  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i";
-  Units.SI.ThermalConductivity k1[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Fluid thermal conductivity in thermal node i";
-  Units.SI.ThermalConductivity k2[N](start=fill(0.6, N), nominal=fill(0.6, N))
-    "Fluid thermal conductivity in hydraulic node i";
-  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
-  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Fluid dynamic viscosity in hydraulic node i";
-  Units.SI.SpecificHeatCapacity cp1[N - 1](start=fill(4000, N - 1), nominal=
-        fill(4000, N - 1)) "Fluid specific heat capacity in thermal node i";
-  Units.SI.SpecificHeatCapacity cp2[N](start=fill(4000, N), nominal=fill(4000,
-        N)) "Fluid specific heat capacity in hydraulic node i";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real khi[N] "Hydraulic pressure loss coefficient in node i";
-  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i";
-  Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure";
-  Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative srt. enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Real diff_res[N] "Diffusion resistance in hydraulic node i";
-  Real diff_res_t "Total diffusion resistance in the pipe";
-  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
-  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
-  Units.SI.MassFlowRate gamma[N]
-    "Total diffusion conductance in hydraulic node i";
-  Units.SI.MassFlowRate gamma_e[N - 1]
-    "Diffusion conductance at inlet of thermal node i";
-  Units.SI.MassFlowRate gamma_s[N - 1]
-    "Diffusion conductance at outlet of thermal node i";
-  Units.SI.Power Je[N - 1]
-    "Thermal power diffusion from inlet of thermal node i";
-  Units.SI.Power Js[N - 1]
-    "Thermal power diffusion from outlet of thermal node i";
-  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
-  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
-  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      for i in 2:N loop
-        der(h[i]) = 0;
-      end for;
-    else
-      if option_temperature then
-        for i in 2:N loop
-          h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P0, T0[i-1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-        end for;
-      else
-        for i in 2:N loop
-          h[i] = h0[i - 1];
-        end for;
-      end if;
-    end if;
-
-    if dynamic_mass_balance then
-      for i in 2:N loop
-        der(P[i]) = 0;
-      end for;
-    end if;
-  end if;
-
-  if inertia then
-    for i in 1:N loop
-      der(Q[i]) = 0;
-    end for;
-  end if;
-
-equation
-
-  /* Wall temperature */
-  Tp = CTh.T;
-  CTh.W = dW1;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol_1;
-  h[N + 1] = C2.h_vol_2;
-
-  C1.h_vol_2 = h[2];
-  C2.h_vol_1 = h[N];
-
-  C2.diff_on_1 = diffusion;
-  C1.diff_on_2 = diffusion;
-
-  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
-  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2 = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  ftype = C1.ftype;
-
-  Xco2 = C1.Xco2;
-  Xh2o = C1.Xh2o;
-  Xo2 = C1.Xo2;
-  Xso2 = C1.Xso2;
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-    BQ[i] = Q[i] - Q[i + 1];
-
-    if dynamic_energy_balance and dynamic_mass_balance then
-      A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i];
-    else
-      0 = BQ[i];
-    end if;
-
-    /* Energy balance equation */
-    BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + J[i];
-
-    if dynamic_energy_balance then
-      if dynamic_mass_balance then
-        if simplified_dynamic_energy_balance then
-          A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i];
-        else
-          A*((h[i + 1]*ddph[i] - 1)*der(P[i + 1]) + (h[i + 1]*ddhp[i] + rho1[i])*der(h[i + 1]))*dx1 = BH[i];
-        end if;
-      else
-        A*rho1[i]*der(h[i + 1])*dx1 = BH[i];
-      end if;
-    else
-      0 = BH[i];
-    end if;
-
-    /* Heat transfer at the wall */
-    dW1_conv[i] = hc[i]*dSi*(Tp[i] - T1[i]);
-    dW1_diff[i] = 2*pi*dx1*ntubes*k1[i]*(Tp[i] - T1[i]);
-
-    dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0);
-
-    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
-    if noEvent(Re1[i] > 2000) then
-      hc[i] = hcCorr*0.023*k1[i]/D*Re1[i]^0.8*Pr[i]^0.4;
-    else
-      // Dittus-Boelter correlation or Lévêque correlation for constant temperature
-      hc[i] = hcCorr*k1[i]/D*max(4.36,0.023*Re1[i]^0.8*Pr[i]^0.4);
-    end if;
-
-    Pr[i] = mu1[i]*cp1[i]/k1[i];
-    Re1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2/(pi*Di*mu1[i])));
-
-    /* Diffusion power */
-    if diffusion then
-      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
-      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
-
-      gamma_e[i] = 1/diff_res_e[i];
-      gamma_s[i] = 1/diff_res_s[i];
-
-      if i == 1 then
-        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
-        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
-     else
-        diff_res_e[i] = diff_res[i];
-        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
-      end if;
-
-      if i == N - 1 then
-        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
-        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
-      else
-        diff_res_s[i] = diff_res[i + 1];
-        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
-      end if;
-    else
-      diff_res_e[i] = 1/gamma0;
-      diff_res_s[i] = 1/gamma0;
-
-      re[i] = 0;
-      rs[i] = 0;
-
-      gamma_e[i] = gamma0;
-      gamma_s[i] = gamma0;
-
-      Je[i] = 0;
-      Js[i] = 0;
-    end if;
-
-    J[i] = Je[i] + Js[i];
-
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
-    else
-      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
-    end if;
-
-    /* Fluid thermodynamic properties */
-    ddph[i] = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp[i] = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-    rho1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    cp1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    mu1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    k1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Momentum balance equation */
-    if inertia then
-      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
-    else
-      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-    end if;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rho2[i]));
-
-    khi[i] = lambda[i]*dx2/D;
-    lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-    Re2[i] = noEvent(abs(4*Q[i]/(pi*Di*mu2[i])));
-
-    /* Diffusion resistance */
-    diff_res[i] = cp2[i]*dx2/A/k2[i];
-    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
-
-    /* Fluid thermodynamic properties */
-    rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    cp2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    mu2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    k2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  rhoc[1] = ThermoSysPro.Properties.Fluid.Density_Ph(P[1],h[1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  rhoc[N + 1] = ThermoSysPro.Properties.Fluid.Density_Ph((P[N + 1]), h[N + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  W1t = sum(dW1);
-
-  /* Total fluid diffusion resistance */
-  diff_res_t = sum(diff_res);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{-60,20},{-60,-20}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor= {0,0,255},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid)),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-    Window(
-      x=0.18,
-      y=0.05,
-      width=0.68,
-      height=0.94),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end DynamicOnePhaseFlowPipe;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicOnePhaseFlowPipe "Dynamic one-phase flow pipe"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
+  parameter Real rugosrel=0.0007 "Pipe relative roughness";
+  parameter Integer ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real CSailettes=1 "Increase/decrease factor of the heat exchange surface for solar receiver or boiler ";
+  parameter Real dpfCorr=1.00 "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Real hcCorr=1.00 "Corrective term for the heat exchange coefficient (hc) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.AbsolutePressure P0=1.e5
+    "Fluid initial pressure (active if steady_state = false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state));
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean option_temperature=true
+    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Internal cross sectional pipe area";
+  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+  parameter Units.SI.Area dSi=pi*Di*dx1*CSailettes
+    "Internal heat exchange area for a node";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boudary of node i";
+  Units.SI.MassFlowRate BQ[N - 1]
+    "Right hand side of the mass balance equation for thermal node i";
+  Units.SI.Power BH[N - 1]
+    "Right hand side of the energy balance equation for thermal node i";
+  Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Convection thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Diffusion thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the water side for node i";
+  Units.SI.Power W1t "Total power exchanged on the water side";
+  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
+       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
+  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Fluid Reynolds number in hydraulic node i";
+  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i";
+  Units.SI.ThermalConductivity k1[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Fluid thermal conductivity in thermal node i";
+  Units.SI.ThermalConductivity k2[N](start=fill(0.6, N), nominal=fill(0.6, N))
+    "Fluid thermal conductivity in hydraulic node i";
+  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
+  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Fluid dynamic viscosity in hydraulic node i";
+  Units.SI.SpecificHeatCapacity cp1[N - 1](start=fill(4000, N - 1), nominal=
+        fill(4000, N - 1)) "Fluid specific heat capacity in thermal node i";
+  Units.SI.SpecificHeatCapacity cp2[N](start=fill(4000, N), nominal=fill(4000,
+        N)) "Fluid specific heat capacity in hydraulic node i";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real khi[N] "Hydraulic pressure loss coefficient in node i";
+  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i";
+  Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure";
+  Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative srt. enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Real diff_res[N] "Diffusion resistance in hydraulic node i";
+  Real diff_res_t "Total diffusion resistance in the pipe";
+  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
+  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
+  Units.SI.MassFlowRate gamma[N]
+    "Total diffusion conductance in hydraulic node i";
+  Units.SI.MassFlowRate gamma_e[N - 1]
+    "Diffusion conductance at inlet of thermal node i";
+  Units.SI.MassFlowRate gamma_s[N - 1]
+    "Diffusion conductance at outlet of thermal node i";
+  Units.SI.Power Je[N - 1]
+    "Thermal power diffusion from inlet of thermal node i";
+  Units.SI.Power Js[N - 1]
+    "Thermal power diffusion from outlet of thermal node i";
+  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
+  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
+  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      for i in 2:N loop
+        der(h[i]) = 0;
+      end for;
+    else
+      if option_temperature then
+        for i in 2:N loop
+          h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P0, T0[i-1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+        end for;
+      else
+        for i in 2:N loop
+          h[i] = h0[i - 1];
+        end for;
+      end if;
+    end if;
+
+    if dynamic_mass_balance then
+      for i in 2:N loop
+        der(P[i]) = 0;
+      end for;
+    end if;
+  end if;
+
+  if inertia then
+    for i in 1:N loop
+      der(Q[i]) = 0;
+    end for;
+  end if;
+
+equation
+
+  /* Wall temperature */
+  Tp = CTh.T;
+  CTh.W = dW1;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol_1;
+  h[N + 1] = C2.h_vol_2;
+
+  C1.h_vol_2 = h[2];
+  C2.h_vol_1 = h[N];
+
+  C2.diff_on_1 = diffusion;
+  C1.diff_on_2 = diffusion;
+
+  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
+  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2 = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  ftype = C1.ftype;
+
+  Xco2 = C1.Xco2;
+  Xh2o = C1.Xh2o;
+  Xo2 = C1.Xo2;
+  Xso2 = C1.Xso2;
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+    BQ[i] = Q[i] - Q[i + 1];
+
+    if dynamic_energy_balance and dynamic_mass_balance then
+      A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i];
+    else
+      0 = BQ[i];
+    end if;
+
+    /* Energy balance equation */
+    BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + J[i];
+
+    if dynamic_energy_balance then
+      if dynamic_mass_balance then
+        if simplified_dynamic_energy_balance then
+          A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i];
+        else
+          A*((h[i + 1]*ddph[i] - 1)*der(P[i + 1]) + (h[i + 1]*ddhp[i] + rho1[i])*der(h[i + 1]))*dx1 = BH[i];
+        end if;
+      else
+        A*rho1[i]*der(h[i + 1])*dx1 = BH[i];
+      end if;
+    else
+      0 = BH[i];
+    end if;
+
+    /* Heat transfer at the wall */
+    dW1_conv[i] = hc[i]*dSi*(Tp[i] - T1[i]);
+    dW1_diff[i] = 2*pi*dx1*ntubes*k1[i]*(Tp[i] - T1[i]);
+
+    dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0);
+
+    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
+    if noEvent(Re1[i] > 2000) then
+      hc[i] = hcCorr*0.023*k1[i]/D*Re1[i]^0.8*Pr[i]^0.4;
+    else
+      // Dittus-Boelter correlation or Lévêque correlation for constant temperature
+      hc[i] = hcCorr*k1[i]/D*max(4.36,0.023*Re1[i]^0.8*Pr[i]^0.4);
+    end if;
+
+    Pr[i] = mu1[i]*cp1[i]/k1[i];
+    Re1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2/(pi*Di*mu1[i])));
+
+    /* Diffusion power */
+    if diffusion then
+      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
+      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
+
+      gamma_e[i] = 1/diff_res_e[i];
+      gamma_s[i] = 1/diff_res_s[i];
+
+      if i == 1 then
+        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
+        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
+     else
+        diff_res_e[i] = diff_res[i];
+        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
+      end if;
+
+      if i == N - 1 then
+        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
+        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
+      else
+        diff_res_s[i] = diff_res[i + 1];
+        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
+      end if;
+    else
+      diff_res_e[i] = 1/gamma0;
+      diff_res_s[i] = 1/gamma0;
+
+      re[i] = 0;
+      rs[i] = 0;
+
+      gamma_e[i] = gamma0;
+      gamma_s[i] = gamma0;
+
+      Je[i] = 0;
+      Js[i] = 0;
+    end if;
+
+    J[i] = Je[i] + Js[i];
+
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
+    else
+      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
+    end if;
+
+    /* Fluid thermodynamic properties */
+    ddph[i] = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp[i] = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+    rho1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    cp1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    mu1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    k1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Momentum balance equation */
+    if inertia then
+      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
+    else
+      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+    end if;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rho2[i]));
+
+    khi[i] = lambda[i]*dx2/D;
+    lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+    Re2[i] = noEvent(abs(4*Q[i]/(pi*Di*mu2[i])));
+
+    /* Diffusion resistance */
+    diff_res[i] = cp2[i]*dx2/A/k2[i];
+    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
+
+    /* Fluid thermodynamic properties */
+    rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    cp2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    mu2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    k2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  rhoc[1] = ThermoSysPro.Properties.Fluid.Density_Ph(P[1],h[1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  rhoc[N + 1] = ThermoSysPro.Properties.Fluid.Density_Ph((P[N + 1]), h[N + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  W1t = sum(dW1);
+
+  /* Total fluid diffusion resistance */
+  diff_res_t = sum(diff_res);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{-60,20},{-60,-20}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor= {0,0,255},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid)),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+    Window(
+      x=0.18,
+      y=0.05,
+      width=0.68,
+      height=0.94),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end DynamicOnePhaseFlowPipe;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo
index 5498b49cb959ea346b2cec2fdfeeb36b914b2ddd..38c93380c005089543cdb126637b021830b2d050 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo
@@ -1,555 +1,555 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicOnePhaseFlowShell "Dynamic one-phase flow shell"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Integer option_arrangement = 1 "1:triangle - 2: square";
-  parameter Units.SI.Length L=12 "Shell length";
-  parameter Units.SI.Diameter Ds=1 "Shell internal diameter";
-  parameter Units.SI.Diameter De=0.019 "Tube external diameter";
-  parameter Units.SI.Distance dc=0.03 "Central distance of two tubes";
-  parameter Units.SI.Length B=1.2 "Distance between two plates in the shell";
-  parameter Real rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=500 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real CSailettes=1 "Increase/Decrease factor of the heat exchange surface for Solar Receiver or Boiler ";
-  parameter Real dpfCorr=1.00 "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Real hcCorr=1.00 "Corrective term for the heat exchange coefficient (hc) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)";
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
-  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer Nb = integer(floor(L/B));
-  parameter Units.SI.Distance dt=dc - De "Distance between two tubes";
-  parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area As=B*Ds*dt/dc
-    "Maximum cross sectional area of flow in shell";
-  parameter Units.SI.Area A=pi*Ds^2/4 - ntubes*pi*De^2/4
-    "Liquid cross sectional in shell";
-  parameter Units.SI.Diameter Deq=if (option_arrangement == 1) then (3.464*dc^2
-       - pi*De^2)/(pi*De) else if (option_arrangement == 2) then (4*dc^2 - pi*
-      De^2)/(pi*De) else De
-    "Equivalent diameter of triangle arrangement between tubes";
-  parameter Units.SI.Area dSi=pi*De*ntubes*dx1*CSailettes
-    "Internal heat exchange area for a node";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boundary of node i";
-  Units.SI.MassFlowRate BQ[N - 1]
-    "Right hand side of the mass balance equation for thermal node i";
-  Units.SI.Power BH[N - 1]
-    "Right hand side of the energy balance equation for thermal node i";
-  Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Convection thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Diffusion thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the water side for node i";
-  Units.SI.Power W1t "Total power exchanged on the water side";
-  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
-       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
-  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Fluid Reynolds number in hydraulic node i";
-  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i";
-  Units.SI.ThermalConductivity k1[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Fluid thermal conductivity in thermal node i";
-  Units.SI.ThermalConductivity k2[N](start=fill(0.6, N), nominal=fill(0.6, N))
-    "Fluid thermal conductivity in hydraulic node i";
-  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
-  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Fluid dynamic viscosity in hydraulic node i";
-  Units.SI.SpecificHeatCapacity cp1[N - 1](start=fill(4000, N - 1), nominal=
-        fill(4000, N - 1)) "Fluid specific heat capacity in thermal node i";
-  Units.SI.SpecificHeatCapacity cp2[N](start=fill(4000, N), nominal=fill(4000,
-        N)) "Fluid specific heat capacity in hydraulic node i";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i";
-  Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure";
-  Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Real diff_res[N] "Diffusion resistance in hydraulic node i";
-  Real diff_res_t "Total diffusion resistance in the pipe";
-  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
-  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
-  Units.SI.MassFlowRate gamma[N]
-    "Total diffusion conductance in hydraulic node i";
-  Units.SI.MassFlowRate gamma_e[N - 1]
-    "Diffusion conductance at inlet of thermal node i";
-  Units.SI.MassFlowRate gamma_s[N - 1]
-    "Diffusion conductance at outlet of thermal node i";
-  Units.SI.Power Je[N - 1]
-    "Thermal power diffusion from inlet of thermal node i";
-  Units.SI.Power Js[N - 1]
-    "Thermal power diffusion from outlet of thermal node i";
-  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
-  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
-  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      for i in 2:N loop
-        der(h[i]) = 0;
-      end for;
-    else
-      if option_temperature then
-        for i in 2:N loop
-          h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P[i], T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-        end for;
-      else
-        for i in 2:N loop
-          h[i] = h0[i - 1];
-        end for;
-      end if;
-    end if;
-
-    if dynamic_mass_balance then
-      for i in 2:N loop
-        der(P[i]) = 0;
-      end for;
-    end if;
-  end if;
-
-  if inertia then
-    for i in 1:N loop
-      der(Q[i]) = 0;
-    end for;
-  end if;
-
-equation
-
-  /* dt must be positive */
-  assert( dt > 0, "DynamicOnePhaseFlowShell: dt = dc - De must be positive");
-
-  /* Wall temperature */
-  Tp = CTh.T;
-  CTh.W = dW1;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol_1;
-  h[N + 1] = C2.h_vol_2;
-
-  C1.h_vol_2 = h[2];
-  C2.h_vol_1 = h[N];
-
-  C2.diff_on_1 = diffusion;
-  C1.diff_on_2 = diffusion;
-
-  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
-  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2 = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  ftype = C1.ftype;
-
-  Xco2 = C1.Xco2;
-  Xh2o = C1.Xh2o;
-  Xo2 = C1.Xo2;
-  Xso2 = C1.Xso2;
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-    BQ[i] = Q[i] - Q[i + 1];
-
-    if dynamic_energy_balance and dynamic_mass_balance then
-      A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i];
-    else
-      0 = BQ[i];
-    end if;
-
-    /* Energy balance equation */
-    BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + J[i];
-
-    if dynamic_energy_balance then
-      if dynamic_mass_balance then
-        if simplified_dynamic_energy_balance then
-          A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i];
-        else
-          A*((h[i + 1]*ddph[i] - 1)*der(P[i + 1]) + (h[i + 1]*ddhp[i] + rho1[i])*der(h[i + 1]))*dx1 = BH[i];
-        end if;
-      else
-        A*rho1[i]*der(h[i + 1])*dx1 = BH[i];
-      end if;
-    else
-      0 = BH[i];
-    end if;
-
-    /* Heat transfer at the wall */
-    dW1_conv[i] = hc[i]*dSi*(Tp[i] - T1[i]);
-    dW1_diff[i] = 2*pi*dx1*ntubes*k1[i]*(Tp[i] - T1[i]);
-
-    dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0);
-
-    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
-    Pr[i] = mu1[i]*cp1[i]/k1[i];
-    Re1[i] = noEvent(abs(De*(Q[i] + Q[i + 1])/(2*As*mu1[i])));
-
-    hc[i] = hcCorr*(noEvent(if (Re1[i] < 2000) then 0.5*(k1[i]/De)*Re1[i]^0.507*Pr[i]^0.33 else if ((Re1[i] > 2000) and (Re1[i] < 1e6)) then 0.36*(k1[i]/De)*Re1[i]^0.55*Pr[i]^0.33 else 0.023*k1[i]/De*Re1[i]^0.8*Pr[i]^0.4));
-
-    /* Diffusion power */
-    if diffusion then
-      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
-      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
-
-      gamma_e[i] = 1/diff_res_e[i];
-      gamma_s[i] = 1/diff_res_s[i];
-
-      if i == 1 then
-        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
-        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
-     else
-        diff_res_e[i] = diff_res[i];
-        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
-      end if;
-
-      if i == N - 1 then
-        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
-        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
-      else
-        diff_res_s[i] = diff_res[i + 1];
-        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
-      end if;
-    else
-      diff_res_e[i] = 1/gamma0;
-      diff_res_s[i] = 1/gamma0;
-
-      re[i] = 0;
-      rs[i] = 0;
-
-      gamma_e[i] = gamma0;
-      gamma_s[i] = gamma0;
-
-      Je[i] = 0;
-      Js[i] = 0;
-    end if;
-
-    J[i] = Je[i] + Js[i];
-
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
-    else
-      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
-    end if;
-
-    /* Fluid thermodynamic properties */
-    ddph[i] = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp[i] = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-    rho1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    cp1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-    mu1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    k1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Momentum balance equation */
-    if inertia then
-      1/As*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
-    else
-      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-    end if;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/As^2;
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    dpf[i] = noEvent(dpfCorr*Ds/dc*(Nb +1)*lambda[i]*Q[i]*abs(Q[i])/(2*As^2*rho2[i])/N);
-    lambda[i] = Modelica.Math.exp(0.576-0.19*Modelica.Math.log(Re2[i]));
-    Re2[i] = noEvent(De*abs(Q[i])/(As*mu2[i]));
-
-    /* Diffusion resistance */
-    diff_res[i] = cp2[i]*dx2/A/k2[i];
-    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
-
-    /* Fluid thermodynamic properties */
-    rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2,hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    cp2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    mu2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    k2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  rhoc[1] = ThermoSysPro.Properties.Fluid.Density_Ph(P[1], h[1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  rhoc[N + 1] = ThermoSysPro.Properties.Fluid.Density_Ph((P[N + 1]), h[N + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  W1t = sum(dW1);
-
-  /* Total fluid diffusion resistance */
-  diff_res_t = sum(diff_res);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={85,170,255}),
-        Line(
-          points={{60,10},{60,-30}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{20,30},{20,-10}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-20,10},{-20,-30}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-60,30},{-60,-10}},
-          color={0,0,0},
-          thickness=1),
-        Ellipse(
-          extent={{-31,-35},{31,-95}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{14,-47},{24,-57}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-24,-74},{-14,-84}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{14,-73},{24,-83}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-14,-60},{-4,-70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{6,-60},{16,-70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{18,-60},{28,-70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-12,-81},{-2,-91}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{2,-82},{12,-92}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-5,-50},{5,-60}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{2,-39},{12,-49}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-29,-61},{-19,-71}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-12,-39},{-2,-49}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-20,29},{-20,11}}, color={255,255,255}),
-        Line(points={{-60,-10},{-60,-30}}, color={255,255,255}),
-        Line(points={{20,-10},{20,-30}}, color={255,255,255}),
-        Line(points={{60,30},{60,11}}, color={255,255,255}),
-        Ellipse(
-          extent={{-4,-69},{6,-79}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-24,-47},{-14,-57}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={0,0,255},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-          fillColor = DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          lineThickness=0),
-        Line(
-          points={{-60,30},{-60,-10}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-20,11},{-20,-29}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{20,30},{20,-10}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{60,10},{60,-30}},
-          color={0,0,0},
-          thickness=1),
-        Line(points={{-60,-10},{-60,-30}}, color={255,255,255}),
-        Line(points={{-20,29},{-20,11}}, color={255,255,255}),
-        Line(points={{20,-10},{20,-30}}, color={255,255,255}),
-        Line(points={{60,30},{60,11}}, color={255,255,255})}),
-    Window(
-      x=0.18,
-      y=0.05,
-      width=0.68,
-      height=0.94),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.4.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-<p>Nota: component model name in title of Sect. 9.4.3.3 in book is incorrectly given as DynamicTwoPhaseFlowShell, instead of DynamicOnePhaseFlowShell. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela</li>
-<li>Jiahui LU</li>
-</ul>
-</html>"));
-end DynamicOnePhaseFlowShell;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicOnePhaseFlowShell "Dynamic one-phase flow shell"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Integer option_arrangement = 1 "1:triangle - 2: square";
+  parameter Units.SI.Length L=12 "Shell length";
+  parameter Units.SI.Diameter Ds=1 "Shell internal diameter";
+  parameter Units.SI.Diameter De=0.019 "Tube external diameter";
+  parameter Units.SI.Distance dc=0.03 "Central distance of two tubes";
+  parameter Units.SI.Length B=1.2 "Distance between two plates in the shell";
+  parameter Real rugosrel=0.0007 "Pipe relative roughness";
+  parameter Integer ntubes=500 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real CSailettes=1 "Increase/Decrease factor of the heat exchange surface for Solar Receiver or Boiler ";
+  parameter Real dpfCorr=1.00 "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Real hcCorr=1.00 "Corrective term for the heat exchange coefficient (hc) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)";
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
+  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer Nb = integer(floor(L/B));
+  parameter Units.SI.Distance dt=dc - De "Distance between two tubes";
+  parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area As=B*Ds*dt/dc
+    "Maximum cross sectional area of flow in shell";
+  parameter Units.SI.Area A=pi*Ds^2/4 - ntubes*pi*De^2/4
+    "Liquid cross sectional in shell";
+  parameter Units.SI.Diameter Deq=if (option_arrangement == 1) then (3.464*dc^2
+       - pi*De^2)/(pi*De) else if (option_arrangement == 2) then (4*dc^2 - pi*
+      De^2)/(pi*De) else De
+    "Equivalent diameter of triangle arrangement between tubes";
+  parameter Units.SI.Area dSi=pi*De*ntubes*dx1*CSailettes
+    "Internal heat exchange area for a node";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boundary of node i";
+  Units.SI.MassFlowRate BQ[N - 1]
+    "Right hand side of the mass balance equation for thermal node i";
+  Units.SI.Power BH[N - 1]
+    "Right hand side of the energy balance equation for thermal node i";
+  Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Convection thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Diffusion thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the water side for node i";
+  Units.SI.Power W1t "Total power exchanged on the water side";
+  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
+       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
+  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Fluid Reynolds number in hydraulic node i";
+  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i";
+  Units.SI.ThermalConductivity k1[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Fluid thermal conductivity in thermal node i";
+  Units.SI.ThermalConductivity k2[N](start=fill(0.6, N), nominal=fill(0.6, N))
+    "Fluid thermal conductivity in hydraulic node i";
+  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
+  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Fluid dynamic viscosity in hydraulic node i";
+  Units.SI.SpecificHeatCapacity cp1[N - 1](start=fill(4000, N - 1), nominal=
+        fill(4000, N - 1)) "Fluid specific heat capacity in thermal node i";
+  Units.SI.SpecificHeatCapacity cp2[N](start=fill(4000, N), nominal=fill(4000,
+        N)) "Fluid specific heat capacity in hydraulic node i";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i";
+  Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure";
+  Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Real diff_res[N] "Diffusion resistance in hydraulic node i";
+  Real diff_res_t "Total diffusion resistance in the pipe";
+  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
+  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
+  Units.SI.MassFlowRate gamma[N]
+    "Total diffusion conductance in hydraulic node i";
+  Units.SI.MassFlowRate gamma_e[N - 1]
+    "Diffusion conductance at inlet of thermal node i";
+  Units.SI.MassFlowRate gamma_s[N - 1]
+    "Diffusion conductance at outlet of thermal node i";
+  Units.SI.Power Je[N - 1]
+    "Thermal power diffusion from inlet of thermal node i";
+  Units.SI.Power Js[N - 1]
+    "Thermal power diffusion from outlet of thermal node i";
+  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
+  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
+  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      for i in 2:N loop
+        der(h[i]) = 0;
+      end for;
+    else
+      if option_temperature then
+        for i in 2:N loop
+          h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P[i], T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+        end for;
+      else
+        for i in 2:N loop
+          h[i] = h0[i - 1];
+        end for;
+      end if;
+    end if;
+
+    if dynamic_mass_balance then
+      for i in 2:N loop
+        der(P[i]) = 0;
+      end for;
+    end if;
+  end if;
+
+  if inertia then
+    for i in 1:N loop
+      der(Q[i]) = 0;
+    end for;
+  end if;
+
+equation
+
+  /* dt must be positive */
+  assert( dt > 0, "DynamicOnePhaseFlowShell: dt = dc - De must be positive");
+
+  /* Wall temperature */
+  Tp = CTh.T;
+  CTh.W = dW1;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol_1;
+  h[N + 1] = C2.h_vol_2;
+
+  C1.h_vol_2 = h[2];
+  C2.h_vol_1 = h[N];
+
+  C2.diff_on_1 = diffusion;
+  C1.diff_on_2 = diffusion;
+
+  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
+  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2 = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  ftype = C1.ftype;
+
+  Xco2 = C1.Xco2;
+  Xh2o = C1.Xh2o;
+  Xo2 = C1.Xo2;
+  Xso2 = C1.Xso2;
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+    BQ[i] = Q[i] - Q[i + 1];
+
+    if dynamic_energy_balance and dynamic_mass_balance then
+      A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i];
+    else
+      0 = BQ[i];
+    end if;
+
+    /* Energy balance equation */
+    BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + J[i];
+
+    if dynamic_energy_balance then
+      if dynamic_mass_balance then
+        if simplified_dynamic_energy_balance then
+          A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i];
+        else
+          A*((h[i + 1]*ddph[i] - 1)*der(P[i + 1]) + (h[i + 1]*ddhp[i] + rho1[i])*der(h[i + 1]))*dx1 = BH[i];
+        end if;
+      else
+        A*rho1[i]*der(h[i + 1])*dx1 = BH[i];
+      end if;
+    else
+      0 = BH[i];
+    end if;
+
+    /* Heat transfer at the wall */
+    dW1_conv[i] = hc[i]*dSi*(Tp[i] - T1[i]);
+    dW1_diff[i] = 2*pi*dx1*ntubes*k1[i]*(Tp[i] - T1[i]);
+
+    dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0);
+
+    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
+    Pr[i] = mu1[i]*cp1[i]/k1[i];
+    Re1[i] = noEvent(abs(De*(Q[i] + Q[i + 1])/(2*As*mu1[i])));
+
+    hc[i] = hcCorr*(noEvent(if (Re1[i] < 2000) then 0.5*(k1[i]/De)*Re1[i]^0.507*Pr[i]^0.33 else if ((Re1[i] > 2000) and (Re1[i] < 1e6)) then 0.36*(k1[i]/De)*Re1[i]^0.55*Pr[i]^0.33 else 0.023*k1[i]/De*Re1[i]^0.8*Pr[i]^0.4));
+
+    /* Diffusion power */
+    if diffusion then
+      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
+      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
+
+      gamma_e[i] = 1/diff_res_e[i];
+      gamma_s[i] = 1/diff_res_s[i];
+
+      if i == 1 then
+        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
+        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
+     else
+        diff_res_e[i] = diff_res[i];
+        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
+      end if;
+
+      if i == N - 1 then
+        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
+        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
+      else
+        diff_res_s[i] = diff_res[i + 1];
+        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
+      end if;
+    else
+      diff_res_e[i] = 1/gamma0;
+      diff_res_s[i] = 1/gamma0;
+
+      re[i] = 0;
+      rs[i] = 0;
+
+      gamma_e[i] = gamma0;
+      gamma_s[i] = gamma0;
+
+      Je[i] = 0;
+      Js[i] = 0;
+    end if;
+
+    J[i] = Je[i] + Js[i];
+
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
+    else
+      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
+    end if;
+
+    /* Fluid thermodynamic properties */
+    ddph[i] = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp[i] = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+    rho1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    cp1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+    mu1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    k1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Momentum balance equation */
+    if inertia then
+      1/As*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
+    else
+      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+    end if;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/As^2;
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    dpf[i] = noEvent(dpfCorr*Ds/dc*(Nb +1)*lambda[i]*Q[i]*abs(Q[i])/(2*As^2*rho2[i])/N);
+    lambda[i] = Modelica.Math.exp(0.576-0.19*Modelica.Math.log(Re2[i]));
+    Re2[i] = noEvent(De*abs(Q[i])/(As*mu2[i]));
+
+    /* Diffusion resistance */
+    diff_res[i] = cp2[i]*dx2/A/k2[i];
+    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
+
+    /* Fluid thermodynamic properties */
+    rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2,hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    cp2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    mu2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    k2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  rhoc[1] = ThermoSysPro.Properties.Fluid.Density_Ph(P[1], h[1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  rhoc[N + 1] = ThermoSysPro.Properties.Fluid.Density_Ph((P[N + 1]), h[N + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  W1t = sum(dW1);
+
+  /* Total fluid diffusion resistance */
+  diff_res_t = sum(diff_res);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={85,170,255}),
+        Line(
+          points={{60,10},{60,-30}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{20,30},{20,-10}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-20,10},{-20,-30}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-60,30},{-60,-10}},
+          color={0,0,0},
+          thickness=1),
+        Ellipse(
+          extent={{-31,-35},{31,-95}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{14,-47},{24,-57}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-24,-74},{-14,-84}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{14,-73},{24,-83}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-14,-60},{-4,-70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{6,-60},{16,-70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{18,-60},{28,-70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-12,-81},{-2,-91}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{2,-82},{12,-92}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-5,-50},{5,-60}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{2,-39},{12,-49}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-29,-61},{-19,-71}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-12,-39},{-2,-49}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-20,29},{-20,11}}, color={255,255,255}),
+        Line(points={{-60,-10},{-60,-30}}, color={255,255,255}),
+        Line(points={{20,-10},{20,-30}}, color={255,255,255}),
+        Line(points={{60,30},{60,11}}, color={255,255,255}),
+        Ellipse(
+          extent={{-4,-69},{6,-79}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-24,-47},{-14,-57}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={0,0,255},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+          fillColor = DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          lineThickness=0),
+        Line(
+          points={{-60,30},{-60,-10}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-20,11},{-20,-29}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{20,30},{20,-10}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{60,10},{60,-30}},
+          color={0,0,0},
+          thickness=1),
+        Line(points={{-60,-10},{-60,-30}}, color={255,255,255}),
+        Line(points={{-20,29},{-20,11}}, color={255,255,255}),
+        Line(points={{20,-10},{20,-30}}, color={255,255,255}),
+        Line(points={{60,30},{60,11}}, color={255,255,255})}),
+    Window(
+      x=0.18,
+      y=0.05,
+      width=0.68,
+      height=0.94),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.4.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+<p>Nota: component model name in title of Sect. 9.4.3.3 in book is incorrectly given as DynamicTwoPhaseFlowShell, instead of DynamicOnePhaseFlowShell. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela</li>
+<li>Jiahui LU</li>
+</ul>
+</html>"));
+end DynamicOnePhaseFlowShell;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo
index c8e55b2adee25276001865ce4632e8dd713bea25..ae97a3de3a64517f69c99bdb42577a6d80243c1f 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo
@@ -1,647 +1,647 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicPlateHeatExchanger "Dynamic plate heat exchanger"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.ThermalConductivity lambdam=15.0
-    "Metal thermal conductivity";
-  parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000
-    "Heat transfer coefficient for the hot side if not computed by the correlations";
-  parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000
-    "Heat transfer coefficient for the cold side if not computed by the correlations";
-  parameter Real p_Kc=100 "Pressure loss coefficient for the hot side if not computed by the correlations";
-  parameter Real p_Kf=100 "Pressure loss coefficient for the cold side if not computed by the correlations";
-  parameter Units.SI.Volume Vc=1 "Hot side volume";
-  parameter Units.SI.Volume Vf=1 "Cold side volume";
-  parameter Units.SI.Thickness emetal=0.0006 "Wall thickness";
-  parameter Units.SI.Area Sp=2 "Plate area";
-  parameter Real nbp=499 "Number of plates";
-  parameter Real c1=1.12647 "Correction coefficient";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Integer heat_exchange_correlation=1 "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations";
-  parameter Integer pressure_loss_correlation=1 "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations";
-  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
-    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
-    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.AbsolutePressure Pc0=1.e5
-    "Hot fluid initial pressure (active if steady_state = false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state));
-  parameter Units.SI.AbsolutePressure Pf0=1.e5
-    "Cold fluid initial pressure (active if steady_state = false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state));
-  parameter Units.SI.Temperature Tc0[Ns]=fill(290, Ns)
-    "Initial hot fluid temperature (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.Temperature Tf0[Ns]=fill(290, Ns)
-    "Initial cold fluid temperature (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy hc0[Ns]=fill(1e5, Ns)
-    "Initial hot fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy hf0[Ns]=fill(1e5, Ns)
-    "Initial cold fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean option_temperature=true
-    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot fluid"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold fluid"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_c=IF97Region.All_regions "Hot fluid IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype_c==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_f=IF97Region.All_regions "Cold fluid IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype_f==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode_c=Integer(region_c) - 1 "Hot fluid IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_f=Integer(region_f) - 1 "Cold fluid IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area Ac=1
-    "Internal cross sectional pipe area for the hot fluid";
-  parameter Units.SI.Area Af=1
-    "Internal cross sectional pipe area for the cold fluid";
-  parameter Units.SI.PathLength dx2_c=Vc/N/Ac
-    "Length of a hydraulic node for the hot fluid";
-  parameter Units.SI.PathLength dx2_f=Vf/N/Af
-    "Length of a hydraulic node for the cold fluid";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
-
-public
-  Units.SI.AbsolutePressure Pc[N + 1](start=fill(1.e5, N + 1), nominal=fill(
-        1.e5, N + 1)) "Hot fluid pressure in node i";
-  Units.SI.AbsolutePressure Pf[N + 1](start=fill(1.e5, N + 1), nominal=fill(
-        1.e5, N + 1)) "Cold fluid pressure in node i";
-  Units.SI.MassFlowRate Qc[N](start=fill(10, N), nominal=fill(10, N))
-    "Hot fluid mass flow rate in node i";
-  Units.SI.MassFlowRate Qf[N](start=fill(10, N), nominal=fill(10, N))
-    "Cold fluid mass flow rate in node i";
-  Units.SI.SpecificEnthalpy hc[N + 1](start=fill(1.e5, N + 1), nominal=fill(
-        1.e6, N + 1)) "Hot fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hf[N + 1](start=fill(1.e5, N + 1), nominal=fill(
-        1.e6, N + 1)) "Cold fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hbc[N]
-    "Hot fluid specific enthalpy at the boundary of node i";
-  Units.SI.SpecificEnthalpy hbf[N]
-    "Cold fluid specific enthalpy at the boundary of node i";
-  Units.SI.Density rhoc1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Hot fluid density in thermal node i";
-  Units.SI.Density rhof1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Cold fluid density in thermal node i";
-  Units.SI.Density rhoc2[N](start=fill(998, N), nominal=fill(1, N))
-    "Hot fluid density in hydraulic node i";
-  Units.SI.Density rhof2[N](start=fill(998, N), nominal=fill(1, N))
-    "Cold fluid density in hydraulic node i";
-  Units.SI.MassFlowRate BQc[N - 1]
-    "Right hand side of the mass balance equation for thermal node i for the hot fluid";
-  Units.SI.MassFlowRate BQf[N - 1]
-    "Right hand side of the mass balance equation for thermal node i for the cold fluid";
-  Units.SI.Power BHc[N - 1]
-    "Right hand side of the energy balance equation for thermal node i for the cold fluid";
-  Units.SI.Power BHf[N - 1]
-    "Right hand side of the energy balance equation for thermal node i for the hot fluid";
-  Units.SI.CoefficientOfHeatTransfer hconv[N - 1]
-    "Global heat transfer coefficient in thermal node i";
-  Units.SI.CoefficientOfHeatTransfer hconv_c[N - 1](start=fill(2000, N - 1),
-      nominal=fill(200, N - 1)) "Hot fluid heat exchange coefficient in node i";
-  Units.SI.CoefficientOfHeatTransfer hconv_f[N - 1](start=fill(2000, N - 1),
-      nominal=fill(200, N - 1))
-    "Cold fluid heat exchange coefficient in node i";
-  Units.SI.ThermalConductivity kc1[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Hot fluid thermal conductivity in thermal node i";
-  Units.SI.ThermalConductivity kf1[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Cold fluid thermal conductivity in thermal node i";
-  Units.SI.ThermalConductivity kc2[N](start=fill(0.6, N), nominal=fill(0.6, N))
-    "Hot fluid thermal conductivity in hydraulic node i";
-  Units.SI.ThermalConductivity kf2[N](start=fill(0.6, N), nominal=fill(0.6, N))
-    "Cold fluid thermal conductivity in hydraulic node i";
-  Units.SI.DynamicViscosity muc1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Hot fluid dynamic viscosity in thermal node i";
-  Units.SI.DynamicViscosity muf1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Cold fluid dynamic viscosity in thermal node i";
-  Units.SI.DynamicViscosity muc2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Hot fluid dynamic viscosity in hydraulic node i";
-  Units.SI.DynamicViscosity muf2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Cold fluid dynamic viscosity in hydraulic node i";
-  Units.SI.SpecificHeatCapacity cpc1[N - 1](start=fill(4000, N - 1), nominal=
-        fill(4000, N - 1)) "Hot fluid specific heat capacity in thermal node i";
-  Units.SI.SpecificHeatCapacity cpf1[N - 1](start=fill(4000, N - 1), nominal=
-        fill(4000, N - 1))
-    "Cold fluid specific heat capacity in thermal node i";
-  Units.SI.SpecificHeatCapacity cpc2[N](start=fill(4000, N), nominal=fill(4000,
-        N)) "Hot fluid specific heat capacity in hydraulic node i";
-  Units.SI.SpecificHeatCapacity cpf2[N](start=fill(4000, N), nominal=fill(4000,
-        N)) "Cold fluid specific heat capacity in hydraulic node i";
-  Units.SI.ThermalConductivity lambdac1[N - 1](start=fill(0.602698, N - 1))
-    "Hot fluid thermal conductivity in thermal node i";
-  Units.SI.ThermalConductivity lambdaf1[N - 1](start=fill(0.597928, N - 1))
-    "Cold fluid thermal conductivity in thermal node i";
-  Units.SI.Temperature Tc1[N - 1] "Hot fluid temperature in thermal node i";
-  Units.SI.Temperature Tf1[N - 1] "Cold fluid temperature in thermal node i";
-  Units.SI.Temperature Tc2[N] "Hot fluid temperature in hydraulic node i";
-  Units.SI.Temperature Tf2[N] "Cold fluid temperature in hydraulic node i";
-  Units.SI.Area dS "Heat exchange surface";
-  Units.SI.Power dW[N - 1]
-    "Thermal power exchanged between the hot and cold sides in thermal node i";
-  Real qmc1[N - 1];
-  Real qmf1[N - 1];
-  Real qmc2[N];
-  Real qmf2[N];
-  Real quc[N];
-  Real quf[N];
-  Real M;
-  ThermoSysPro.Units.SI.PressureDifference DPc[N]
-    "Pressure loss of the hot fluid in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference DPf[N]
-    "Pressure loss of the cold fluid in hydraulic node i";
-  Units.SI.Temperature Tec "Fluid temperature at the hot inlet";
-  Units.SI.Temperature Tsc "Fluid temperature at the hot outlet";
-  Units.SI.Temperature Tef "Fluid temperature at the cold inlet";
-  Units.SI.Temperature Tsf "Fluid temperature at the cold outlet";
-  FluidType ftype_c "Hot fluid type";
-  FluidType ftype_f "Cold fluid type";
-  Integer fluid_c=Integer(ftype_c) "Hot fluid number";
-  Integer fluid_f=Integer(ftype_f) "Cold fluid number";
-  ThermoSysPro.Units.SI.MassFraction Xco2_c "Hot fluid CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xco2_f "Cold fluid CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o_c "Hot fluid H2O mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o_f "Cold fluid H2O mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2_c "Hot fluid O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2_f "Cold fluid O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2_c "Hot fluid SO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2_f "Cold fluid SO2 mass fraction";
-  Real diff_res_c[N] "Diffusion resistance in hydraulic node i for the hot fluid";
-  Real diff_res_f[N] "Diffusion resistance in hydraulic node i for the cold fluid";
-  Real diff_res_t_c "Total diffusion resistance in the pipe for the hot fluid";
-  Real diff_res_t_f "Total diffusion resistance in the pipe for the cold fluid";
-  Real diff_res_e_c[N - 1] "Diffusion resistance at inlet of thermal node i for the hot fluid";
-  Real diff_res_e_f[N - 1] "Diffusion resistance at inlet of thermal node i for the cold fluid";
-  Real diff_res_s_c[N - 1] "Diffusion resistance at outlet of thermal node i for the hot fluid";
-  Real diff_res_s_f[N - 1] "Diffusion resistance at outlet of thermal node i for the cold fluid";
-  Units.SI.MassFlowRate gamma_c[N]
-    "Total diffusion conductance in hydraulic node i for the hot fluid";
-  Units.SI.MassFlowRate gamma_f[N]
-    "Total diffusion conductance in hydraulic node i for the cold fluid";
-  Units.SI.MassFlowRate gamma_e_c[N - 1]
-    "Diffusion conductance at inlet of thermal node i for the hot fluid";
-  Units.SI.MassFlowRate gamma_e_f[N - 1]
-    "Diffusion conductance at inlet of thermal node i for the cold fluid";
-  Units.SI.MassFlowRate gamma_s_c[N - 1]
-    "Diffusion conductance at outlet of thermal node i for the hot fluid";
-  Units.SI.MassFlowRate gamma_s_f[N - 1]
-    "Diffusion conductance at outlet of thermal node i for the cold fluid";
-  Units.SI.Power Je_c[N - 1]
-    "Thermal power diffusion from inlet of thermal node i for the hot fluid";
-  Units.SI.Power Je_f[N - 1]
-    "Thermal power diffusion from inlet of thermal node i for the cold fluid";
-  Units.SI.Power Js_c[N - 1]
-    "Thermal power diffusion from outlet of thermal node i for the hot fluid";
-  Units.SI.Power Js_f[N - 1]
-    "Thermal power diffusion from outlet of thermal node i for the cold fluid";
-  Units.SI.Power J_c[N - 1]
-    "Total thermal power diffusion of thermal node i for the hot fluid";
-  Units.SI.Power J_f[N - 1]
-    "Total thermal power diffusion of thermal node i for the cold fluid";
-  Real re_c[N - 1] "Value of r(Q/gamma) for inlet of thermal node i for the hot fluid";
-  Real re_f[N - 1] "Value of r(Q/gamma) for inlet of thermal node i for the cold fluid";
-  Real rs_c[N - 1] "Value of r(Q/gamma) for outlet of thermal node i for the hot fluid";
-  Real rs_f[N - 1] "Value of r(Q/gamma) for outlet of thermal node i for the cold fluid";
-
-public
-  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
-          extent={{-60,-70},{-40,-50}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
-          extent={{40,-70},{60,-50}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      for i in 2:N loop
-        der(hc[i]) = 0;
-        der(hf[i]) = 0;
-      end for;
-    else
-      if option_temperature then
-        for i in 2:N loop
-          hc[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pc0, Tc0[i - 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-          hf[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pf0, Tf0[i - 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-        end for;
-      else
-        for i in 2:N loop
-          hc[i] = hc0[i - 1];
-          hf[i] = hf0[i - 1];
-        end for;
-      end if;
-    end if;
-  end if;
-
-equation
-
-  /* Heat exchanger boundaries */
-  Pc[1] = Ec.P;
-  Pc[N + 1] = Sc.P;
-
-  Pf[1] = Sf.P;
-  Pf[N + 1] = Ef.P;
-
-  Qc[1] = Ec.Q;
-  Qc[N] = Sc.Q;
-
-  Qf[1] = Sf.Q;
-  Qf[N] = Ef.Q;
-
-  hbc[1] = Ec.h;
-  hbc[N] = Sc.h;
-
-  hbf[1] = Sf.h;
-  hbf[N] = Ef.h;
-
-  hc[1] = Ec.h_vol_1;
-  hc[N + 1] = Sc.h_vol_2;
-
-  hf[N + 1] = Ef.h_vol_1;
-  hf[1] = Sf.h_vol_2;
-
-  Ec.h_vol_2 = hc[2];
-  Sc.h_vol_1 = hc[N];
-
-  Ef.h_vol_2 = hf[N];
-  Sf.h_vol_1 = hf[2];
-
-  Sc.diff_on_1 = diffusion;
-  Ec.diff_on_2 = diffusion;
-
-  Sf.diff_on_1 = diffusion;
-  Ef.diff_on_2 = diffusion;
-
-  Sc.diff_res_1 = Ec.diff_res_1 + diff_res_t_c;
-  Ec.diff_res_2 = Sc.diff_res_2 + diff_res_t_c;
-
-  Sf.diff_res_1 = Ef.diff_res_1 + diff_res_t_f;
-  Ef.diff_res_2 = Sf.diff_res_2 + diff_res_t_f;
-
-  Ec.ftype = Sc.ftype;
-  Sf.ftype = Ef.ftype;
-
-  Ec.Xco2 =  Sc.Xco2;
-  Ec.Xh2o = Sc.Xh2o;
-  Ec.Xo2 = Sc.Xo2;
-  Ec.Xso2 = Sc.Xso2;
-
-  Sf.Xco2 = Ef.Xco2;
-  Sf.Xh2o = Ef.Xh2o;
-  Sf.Xo2 = Ef.Xo2;
-  Sf.Xso2 = Ef.Xso2;
-
-  ftype_c = Ec.ftype;
-  ftype_f = Sf.ftype;
-
-  Xco2_c = Ec.Xco2;
-  Xh2o_c = Ec.Xh2o;
-  Xo2_c = Ec.Xo2;
-  Xso2_c = Ec.Xso2;
-
-  Xco2_f = Sf.Xco2;
-  Xh2o_f = Sf.Xh2o;
-  Xo2_f = Sf.Xo2;
-  Xso2_f = Sf.Xso2;
-
-  /* Exchange area for the plate exchanger */
-  dS = (nbp - 2)*Sp/(N - 1);
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equations */
-    BQc[i] = Qc[i] - Qc[i + 1];
-    BQf[i] = Qf[i + 1] - Qf[i];
-
-    0 = BQc[i];
-    0 = BQf[i];
-
-    /* Energy balance equations */
-    BHc[i] = hbc[i]*Qc[i] - hbc[i + 1]*Qc[i + 1] - dW[i] + J_c[i];
-    BHf[i] = hbf[i + 1]*Qf[i + 1] - hbf[i]*Qf[i] + dW[i] + J_f[i];
-
-    if dynamic_energy_balance then
-      Vc/(N - 1)*rhoc1[i]*der(hc[i + 1]) = BHc[i];
-      Vf/(N - 1)*rhof1[i]*der(hf[i + 1]) = BHf[i];
-    else
-      0 = BHc[i];
-      0 = BHf[i];
-    end if;
-
-    /* Heat transfer between the hot and cold sides */
-    /* 1/hconv = 1/hconv_c + 1/hconv_f + emetal/lambdam */
-    hconv[i] = if noEvent(hconv_c[i]*hconv_f[i] < 1.e-6) then 0 else hconv_c[i]*hconv_f[i]/(hconv_c[i] + hconv_f[i] + hconv_c[i]*hconv_f[i]*emetal/lambdam);
-    dW[i] = hconv[i]*dS*(Tc1[i] - Tf1[i]);
-
-    /* Heat transfer correlations for water/steam */
-    qmc1[i] = (qmc2[i] + qmc2[i + 1])/2;
-    qmf1[i] = (qmf2[i] + qmf2[i + 1])/2;
-
-    if (heat_exchange_correlation == 0) then
-      hconv_c[i] = p_hc;
-      hconv_f[i] = p_hf;
-    elseif (heat_exchange_correlation == 1) then
-      hconv_c[i] = noEvent(if (qmc1[i] < 1.e-3) then 0 else 11.245*abs(qmc1[i])^0.8*abs(muc1[i]*cpc1[i]/lambdac1[i])^0.4*lambdac1[i]);
-      hconv_f[i] = noEvent(if (qmf1[i] < 1.e-3) then 0 else 11.245*abs(qmf1[i])^0.8*abs(muf1[i]*cpf1[i]/lambdaf1[i])^0.4*lambdaf1[i]);
-    else
-      hconv_c[i] = 0;
-      hconv_f[i] = 0;
-      assert(false, "DynamicWaterWaterExchanger: incorrect heat exchange correlation number");
-    end if;
-
-    /* Diffusion power */
-    if diffusion then
-      re_c[i] = exp(-0.033*(Qc[i]*diff_res_e_c[i])^2);
-      rs_c[i] = exp(-0.033*(Qc[i + 1]*diff_res_s_c[i])^2);
-
-      gamma_e_c[i] = 1/diff_res_e_c[i];
-      gamma_s_c[i] = 1/diff_res_s_c[i];
-
-      re_f[i] = exp(-0.033*(Qf[i]*diff_res_e_f[i])^2);
-      rs_f[i] = exp(-0.033*(Qf[i + 1]*diff_res_s_f[i])^2);
-
-      gamma_e_f[i] = 1/diff_res_e_f[i];
-      gamma_s_f[i] = 1/diff_res_s_f[i];
-
-      if i == 1 then
-        diff_res_e_c[i] = (if Ec.diff_on_1 then Ec.diff_res_1 else 0) + diff_res_c[i];
-        Je_c[i] = if Ec.diff_on_1 then re_c[i]*gamma_e_c[i]*(hc[i] - hc[i + 1]) else 0;
-     else
-        diff_res_e_c[i] = diff_res_c[i];
-        Je_c[i] = re_c[i]*gamma_e_c[i]*(hc[i] - hc[i + 1]);
-      end if;
-
-      if i == N - 1 then
-        diff_res_s_c[i] = (if Sc.diff_on_2 then Sc.diff_res_2 else 0) + diff_res_c[i + 1];
-        Js_c[i] = if Sc.diff_on_2 then rs_c[i]*gamma_s_c[i]*(hc[i + 2] - hc[i + 1]) else 0;
-      else
-        diff_res_s_c[i] = diff_res_c[i + 1];
-        Js_c[i] = rs_c[i]*gamma_s_c[i]*(hc[i + 2] - hc[i + 1]);
-     end if;
-
-      if i == N - 1 then
-        diff_res_e_f[i] = (if Ef.diff_on_1 then Ef.diff_res_1 else 0) + diff_res_f[i];
-        Je_f[i] = if Ef.diff_on_1 then re_f[i]*gamma_e_f[i]*(hf[i] - hf[i + 1]) else 0;
-     else
-        diff_res_e_f[i] = diff_res_f[i];
-        Je_f[i] = re_f[i]*gamma_e_f[i]*(hf[i] - hf[i + 1]);
-      end if;
-
-      if i == 1 then
-        diff_res_s_f[i] = (if Sf.diff_on_2 then Sf.diff_res_2 else 0) + diff_res_f[i + 1];
-        Js_f[i] = if Sf.diff_on_2 then rs_f[i]*gamma_s_f[i]*(hf[i + 2] - hf[i + 1]) else 0;
-      else
-        diff_res_s_f[i] = diff_res_f[i + 1];
-        Js_f[i] = rs_f[i]*gamma_s_f[i]*(hf[i + 2] - hf[i + 1]);
-     end if;
-    else
-      diff_res_e_c[i] = 1/gamma0;
-      diff_res_s_c[i] = 1/gamma0;
-
-      re_c[i] = 0;
-      rs_c[i] = 0;
-
-      gamma_e_c[i] = gamma0;
-      gamma_s_c[i] = gamma0;
-
-      Je_c[i] = 0;
-      Js_c[i] = 0;
-
-      diff_res_e_f[i] = 1/gamma0;
-      diff_res_s_f[i] = 1/gamma0;
-
-      re_f[i] = 0;
-      rs_f[i] = 0;
-
-      gamma_e_f[i] = gamma0;
-      gamma_s_f[i] = gamma0;
-
-      Je_f[i] = 0;
-      Js_f[i] = 0;
-    end if;
-
-    J_c[i] = Je_c[i] + Js_c[i];
-    J_f[i] = Je_f[i] + Js_f[i];
-
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      hbc[i + 1] = ThermoSysPro.Functions.SmoothCond(Qc[i + 1]/gamma_c[i + 1], hc[i + 1], hc[i + 2], 1);
-      hbf[i + 1] = ThermoSysPro.Functions.SmoothCond(Qf[i + 1]/gamma_f[i + 1], hf[i + 1], hf[i + 2], 1);
-    else
-      hbc[i + 1] = if (Qc[i + 1] > 0) then hc[i + 1] else hc[i + 2];
-      hbf[i + 1] = if (Qf[i + 1] > 0) then hf[i + 1] else hf[i + 2];
-    end if;
-
-    /* Fluid thermodynamic properties */
-    if (p_rhoc > 0) then
-      rhoc1[i] = p_rhoc;
-    else
-      rhoc1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-    end if;
-
-    Tc1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-    cpc1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-    muc1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-    kc1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-    lambdac1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhoc1[i], Tc1[i], Pc[i + 1], 0, fluid_c);
-
-    if (p_rhof > 0) then
-      rhof1[i] = p_rhof;
-    else
-      rhof1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-    end if;
-
-    Tf1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-    cpf1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-    muf1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-    kf1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-    lambdaf1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhof1[i], Tf1[i], Pf[i + 1], 0, fluid_f);
-  end for;
-
-  /* Pressure losses correlations */
-  M = (nbp - 1)/2;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Pressure losses */
-    Pc[i + 1] = if Qc[i] > 0 then Pc[i] - DPc[i]/N else Pc[i] + DPc[i]/N;
-    Pf[i + 1] = if Qf[i] > 0 then Pf[i] - DPf[i]/N else Pf[i] + DPf[i]/N;
-
-    qmc2[i] = noEvent(abs(Qc[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muc2[i])*M));
-    qmf2[i] = noEvent(abs(Qf[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muf2[i])*M));
-
-    quc[i] = noEvent(abs(Qc[i])/M);
-    quf[i] = noEvent(abs(Qf[i])/M);
-
-    if (pressure_loss_correlation == 0) then
-      DPc[i] = p_Kc*Qc[i]^2/rhoc2[i];
-      DPf[i] = p_Kf*Qf[i]^2/rhof2[i];
-    elseif (pressure_loss_correlation == 1) then
-      DPc[i] = noEvent(if (qmc2[i] < 1.e-3) then 0 else c1*14423.2/rhoc2[i]*abs(qmc2[i])^(-0.097)*quc[i]^2*(1472.47 + 1.54*(M - 1)/2 + 104.97*abs(qmc2[i])^(-0.25)));
-      DPf[i] = noEvent(if (qmf2[i] < 1.e-3) then 0 else 14423.2/rhof2[i]*abs(qmf2[i])^(-0.097)*quf[i]^2*(1472.47 + 1.54*(M - 1)/2 + 104.97*abs(qmf2[i])^(-0.25)));
-    else
-      DPc[i] = 0;
-      DPf[i] = 0;
-      assert(false, "DynamicWaterWaterExchanger: incorrect pressure loss correlation number");
-    end if;
-
-    /* Diffusion resistance */
-    diff_res_c[i] = cpc2[i]*dx2_c/Ac/kc2[i];
-    gamma_c[i] = if diffusion then 1/diff_res_c[i] else gamma0;
-
-    diff_res_f[i] = cpf2[i]*dx2_f/Af/kf2[i];
-    gamma_f[i] = if diffusion then 1/diff_res_f[i] else gamma0;
-
-    /* Fluid thermodynamic properties */
-    if (p_rhoc > 0) then
-      rhoc2[i] = p_rhoc;
-    else
-      rhoc2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-    end if;
-
-    Tc2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-    cpc2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-    muc2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-    kc2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-
-    if (p_rhof > 0) then
-      rhof2[i] = p_rhof;
-    else
-      rhof2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-    end if;
-
-    Tf2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-    cpf2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-    muf2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-    kf2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-  end for;
-
-  /* Calcul des températures en entrée et en sortie de l'échangeur */
-   Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-   Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
-
-   Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-   Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
-
-  /* Total fluid diffusion resistance */
-  diff_res_t_c = sum(diff_res_c);
-  diff_res_t_f = sum(diff_res_f);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0}),
-        Line(points={{-80,60},{-80,-60}}),
-        Line(points={{80,60},{80,-60}}),
-        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={
-              28,108,200}),
-        Line(
-          points={{-40,60},{-40,-60}},
-          color={28,108,200},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{0,60},{0,-60}},
-          color={28,108,200},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{40,60},{40,-60}},
-          color={28,108,200},
-          pattern=LinePattern.Dot)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          lineThickness=0),
-        Line(points={{-80,60},{-80,-60}}),
-        Line(points={{80,60},{80,-60}}),
-        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={
-              28,108,200}),
-        Line(
-          points={{-40,60},{-40,-60}},
-          color={28,108,200},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{0,60},{0,-60}},
-          color={28,108,200},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{40,60},{40,-60}},
-          color={28,108,200},
-          pattern=LinePattern.Dot),
-        Text(
-          extent={{104,24},{128,10}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot outlet"),
-        Text(
-          extent={{-82,-66},{-62,-76}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold inlet"),
-        Text(
-          extent={{-126,24},{-106,14}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot inlet"),
-        Text(
-          extent={{66,-66},{90,-76}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold outlet")}),
-    Window(
-      x=0.18,
-      y=0.05,
-      width=0.68,
-      height=0.94),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.6.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end DynamicPlateHeatExchanger;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicPlateHeatExchanger "Dynamic plate heat exchanger"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.ThermalConductivity lambdam=15.0
+    "Metal thermal conductivity";
+  parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000
+    "Heat transfer coefficient for the hot side if not computed by the correlations";
+  parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000
+    "Heat transfer coefficient for the cold side if not computed by the correlations";
+  parameter Real p_Kc=100 "Pressure loss coefficient for the hot side if not computed by the correlations";
+  parameter Real p_Kf=100 "Pressure loss coefficient for the cold side if not computed by the correlations";
+  parameter Units.SI.Volume Vc=1 "Hot side volume";
+  parameter Units.SI.Volume Vf=1 "Cold side volume";
+  parameter Units.SI.Thickness emetal=0.0006 "Wall thickness";
+  parameter Units.SI.Area Sp=2 "Plate area";
+  parameter Real nbp=499 "Number of plates";
+  parameter Real c1=1.12647 "Correction coefficient";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Integer heat_exchange_correlation=1 "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations";
+  parameter Integer pressure_loss_correlation=1 "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations";
+  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
+    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
+    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.AbsolutePressure Pc0=1.e5
+    "Hot fluid initial pressure (active if steady_state = false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state));
+  parameter Units.SI.AbsolutePressure Pf0=1.e5
+    "Cold fluid initial pressure (active if steady_state = false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state));
+  parameter Units.SI.Temperature Tc0[Ns]=fill(290, Ns)
+    "Initial hot fluid temperature (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.Temperature Tf0[Ns]=fill(290, Ns)
+    "Initial cold fluid temperature (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy hc0[Ns]=fill(1e5, Ns)
+    "Initial hot fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy hf0[Ns]=fill(1e5, Ns)
+    "Initial cold fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean option_temperature=true
+    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot fluid"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold fluid"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_c=IF97Region.All_regions "Hot fluid IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype_c==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_f=IF97Region.All_regions "Cold fluid IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype_f==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode_c=Integer(region_c) - 1 "Hot fluid IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_f=Integer(region_f) - 1 "Cold fluid IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area Ac=1
+    "Internal cross sectional pipe area for the hot fluid";
+  parameter Units.SI.Area Af=1
+    "Internal cross sectional pipe area for the cold fluid";
+  parameter Units.SI.PathLength dx2_c=Vc/N/Ac
+    "Length of a hydraulic node for the hot fluid";
+  parameter Units.SI.PathLength dx2_f=Vf/N/Af
+    "Length of a hydraulic node for the cold fluid";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
+
+public
+  Units.SI.AbsolutePressure Pc[N + 1](start=fill(1.e5, N + 1), nominal=fill(
+        1.e5, N + 1)) "Hot fluid pressure in node i";
+  Units.SI.AbsolutePressure Pf[N + 1](start=fill(1.e5, N + 1), nominal=fill(
+        1.e5, N + 1)) "Cold fluid pressure in node i";
+  Units.SI.MassFlowRate Qc[N](start=fill(10, N), nominal=fill(10, N))
+    "Hot fluid mass flow rate in node i";
+  Units.SI.MassFlowRate Qf[N](start=fill(10, N), nominal=fill(10, N))
+    "Cold fluid mass flow rate in node i";
+  Units.SI.SpecificEnthalpy hc[N + 1](start=fill(1.e5, N + 1), nominal=fill(
+        1.e6, N + 1)) "Hot fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hf[N + 1](start=fill(1.e5, N + 1), nominal=fill(
+        1.e6, N + 1)) "Cold fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hbc[N]
+    "Hot fluid specific enthalpy at the boundary of node i";
+  Units.SI.SpecificEnthalpy hbf[N]
+    "Cold fluid specific enthalpy at the boundary of node i";
+  Units.SI.Density rhoc1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Hot fluid density in thermal node i";
+  Units.SI.Density rhof1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Cold fluid density in thermal node i";
+  Units.SI.Density rhoc2[N](start=fill(998, N), nominal=fill(1, N))
+    "Hot fluid density in hydraulic node i";
+  Units.SI.Density rhof2[N](start=fill(998, N), nominal=fill(1, N))
+    "Cold fluid density in hydraulic node i";
+  Units.SI.MassFlowRate BQc[N - 1]
+    "Right hand side of the mass balance equation for thermal node i for the hot fluid";
+  Units.SI.MassFlowRate BQf[N - 1]
+    "Right hand side of the mass balance equation for thermal node i for the cold fluid";
+  Units.SI.Power BHc[N - 1]
+    "Right hand side of the energy balance equation for thermal node i for the cold fluid";
+  Units.SI.Power BHf[N - 1]
+    "Right hand side of the energy balance equation for thermal node i for the hot fluid";
+  Units.SI.CoefficientOfHeatTransfer hconv[N - 1]
+    "Global heat transfer coefficient in thermal node i";
+  Units.SI.CoefficientOfHeatTransfer hconv_c[N - 1](start=fill(2000, N - 1),
+      nominal=fill(200, N - 1)) "Hot fluid heat exchange coefficient in node i";
+  Units.SI.CoefficientOfHeatTransfer hconv_f[N - 1](start=fill(2000, N - 1),
+      nominal=fill(200, N - 1))
+    "Cold fluid heat exchange coefficient in node i";
+  Units.SI.ThermalConductivity kc1[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Hot fluid thermal conductivity in thermal node i";
+  Units.SI.ThermalConductivity kf1[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Cold fluid thermal conductivity in thermal node i";
+  Units.SI.ThermalConductivity kc2[N](start=fill(0.6, N), nominal=fill(0.6, N))
+    "Hot fluid thermal conductivity in hydraulic node i";
+  Units.SI.ThermalConductivity kf2[N](start=fill(0.6, N), nominal=fill(0.6, N))
+    "Cold fluid thermal conductivity in hydraulic node i";
+  Units.SI.DynamicViscosity muc1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Hot fluid dynamic viscosity in thermal node i";
+  Units.SI.DynamicViscosity muf1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Cold fluid dynamic viscosity in thermal node i";
+  Units.SI.DynamicViscosity muc2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Hot fluid dynamic viscosity in hydraulic node i";
+  Units.SI.DynamicViscosity muf2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Cold fluid dynamic viscosity in hydraulic node i";
+  Units.SI.SpecificHeatCapacity cpc1[N - 1](start=fill(4000, N - 1), nominal=
+        fill(4000, N - 1)) "Hot fluid specific heat capacity in thermal node i";
+  Units.SI.SpecificHeatCapacity cpf1[N - 1](start=fill(4000, N - 1), nominal=
+        fill(4000, N - 1))
+    "Cold fluid specific heat capacity in thermal node i";
+  Units.SI.SpecificHeatCapacity cpc2[N](start=fill(4000, N), nominal=fill(4000,
+        N)) "Hot fluid specific heat capacity in hydraulic node i";
+  Units.SI.SpecificHeatCapacity cpf2[N](start=fill(4000, N), nominal=fill(4000,
+        N)) "Cold fluid specific heat capacity in hydraulic node i";
+  Units.SI.ThermalConductivity lambdac1[N - 1](start=fill(0.602698, N - 1))
+    "Hot fluid thermal conductivity in thermal node i";
+  Units.SI.ThermalConductivity lambdaf1[N - 1](start=fill(0.597928, N - 1))
+    "Cold fluid thermal conductivity in thermal node i";
+  Units.SI.Temperature Tc1[N - 1] "Hot fluid temperature in thermal node i";
+  Units.SI.Temperature Tf1[N - 1] "Cold fluid temperature in thermal node i";
+  Units.SI.Temperature Tc2[N] "Hot fluid temperature in hydraulic node i";
+  Units.SI.Temperature Tf2[N] "Cold fluid temperature in hydraulic node i";
+  Units.SI.Area dS "Heat exchange surface";
+  Units.SI.Power dW[N - 1]
+    "Thermal power exchanged between the hot and cold sides in thermal node i";
+  Real qmc1[N - 1];
+  Real qmf1[N - 1];
+  Real qmc2[N];
+  Real qmf2[N];
+  Real quc[N];
+  Real quf[N];
+  Real M;
+  ThermoSysPro.Units.SI.PressureDifference DPc[N]
+    "Pressure loss of the hot fluid in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference DPf[N]
+    "Pressure loss of the cold fluid in hydraulic node i";
+  Units.SI.Temperature Tec "Fluid temperature at the hot inlet";
+  Units.SI.Temperature Tsc "Fluid temperature at the hot outlet";
+  Units.SI.Temperature Tef "Fluid temperature at the cold inlet";
+  Units.SI.Temperature Tsf "Fluid temperature at the cold outlet";
+  FluidType ftype_c "Hot fluid type";
+  FluidType ftype_f "Cold fluid type";
+  Integer fluid_c=Integer(ftype_c) "Hot fluid number";
+  Integer fluid_f=Integer(ftype_f) "Cold fluid number";
+  ThermoSysPro.Units.SI.MassFraction Xco2_c "Hot fluid CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xco2_f "Cold fluid CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o_c "Hot fluid H2O mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o_f "Cold fluid H2O mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2_c "Hot fluid O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2_f "Cold fluid O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2_c "Hot fluid SO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2_f "Cold fluid SO2 mass fraction";
+  Real diff_res_c[N] "Diffusion resistance in hydraulic node i for the hot fluid";
+  Real diff_res_f[N] "Diffusion resistance in hydraulic node i for the cold fluid";
+  Real diff_res_t_c "Total diffusion resistance in the pipe for the hot fluid";
+  Real diff_res_t_f "Total diffusion resistance in the pipe for the cold fluid";
+  Real diff_res_e_c[N - 1] "Diffusion resistance at inlet of thermal node i for the hot fluid";
+  Real diff_res_e_f[N - 1] "Diffusion resistance at inlet of thermal node i for the cold fluid";
+  Real diff_res_s_c[N - 1] "Diffusion resistance at outlet of thermal node i for the hot fluid";
+  Real diff_res_s_f[N - 1] "Diffusion resistance at outlet of thermal node i for the cold fluid";
+  Units.SI.MassFlowRate gamma_c[N]
+    "Total diffusion conductance in hydraulic node i for the hot fluid";
+  Units.SI.MassFlowRate gamma_f[N]
+    "Total diffusion conductance in hydraulic node i for the cold fluid";
+  Units.SI.MassFlowRate gamma_e_c[N - 1]
+    "Diffusion conductance at inlet of thermal node i for the hot fluid";
+  Units.SI.MassFlowRate gamma_e_f[N - 1]
+    "Diffusion conductance at inlet of thermal node i for the cold fluid";
+  Units.SI.MassFlowRate gamma_s_c[N - 1]
+    "Diffusion conductance at outlet of thermal node i for the hot fluid";
+  Units.SI.MassFlowRate gamma_s_f[N - 1]
+    "Diffusion conductance at outlet of thermal node i for the cold fluid";
+  Units.SI.Power Je_c[N - 1]
+    "Thermal power diffusion from inlet of thermal node i for the hot fluid";
+  Units.SI.Power Je_f[N - 1]
+    "Thermal power diffusion from inlet of thermal node i for the cold fluid";
+  Units.SI.Power Js_c[N - 1]
+    "Thermal power diffusion from outlet of thermal node i for the hot fluid";
+  Units.SI.Power Js_f[N - 1]
+    "Thermal power diffusion from outlet of thermal node i for the cold fluid";
+  Units.SI.Power J_c[N - 1]
+    "Total thermal power diffusion of thermal node i for the hot fluid";
+  Units.SI.Power J_f[N - 1]
+    "Total thermal power diffusion of thermal node i for the cold fluid";
+  Real re_c[N - 1] "Value of r(Q/gamma) for inlet of thermal node i for the hot fluid";
+  Real re_f[N - 1] "Value of r(Q/gamma) for inlet of thermal node i for the cold fluid";
+  Real rs_c[N - 1] "Value of r(Q/gamma) for outlet of thermal node i for the hot fluid";
+  Real rs_f[N - 1] "Value of r(Q/gamma) for outlet of thermal node i for the cold fluid";
+
+public
+  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
+          extent={{-60,-70},{-40,-50}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
+          extent={{40,-70},{60,-50}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      for i in 2:N loop
+        der(hc[i]) = 0;
+        der(hf[i]) = 0;
+      end for;
+    else
+      if option_temperature then
+        for i in 2:N loop
+          hc[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pc0, Tc0[i - 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+          hf[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pf0, Tf0[i - 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+        end for;
+      else
+        for i in 2:N loop
+          hc[i] = hc0[i - 1];
+          hf[i] = hf0[i - 1];
+        end for;
+      end if;
+    end if;
+  end if;
+
+equation
+
+  /* Heat exchanger boundaries */
+  Pc[1] = Ec.P;
+  Pc[N + 1] = Sc.P;
+
+  Pf[1] = Sf.P;
+  Pf[N + 1] = Ef.P;
+
+  Qc[1] = Ec.Q;
+  Qc[N] = Sc.Q;
+
+  Qf[1] = Sf.Q;
+  Qf[N] = Ef.Q;
+
+  hbc[1] = Ec.h;
+  hbc[N] = Sc.h;
+
+  hbf[1] = Sf.h;
+  hbf[N] = Ef.h;
+
+  hc[1] = Ec.h_vol_1;
+  hc[N + 1] = Sc.h_vol_2;
+
+  hf[N + 1] = Ef.h_vol_1;
+  hf[1] = Sf.h_vol_2;
+
+  Ec.h_vol_2 = hc[2];
+  Sc.h_vol_1 = hc[N];
+
+  Ef.h_vol_2 = hf[N];
+  Sf.h_vol_1 = hf[2];
+
+  Sc.diff_on_1 = diffusion;
+  Ec.diff_on_2 = diffusion;
+
+  Sf.diff_on_1 = diffusion;
+  Ef.diff_on_2 = diffusion;
+
+  Sc.diff_res_1 = Ec.diff_res_1 + diff_res_t_c;
+  Ec.diff_res_2 = Sc.diff_res_2 + diff_res_t_c;
+
+  Sf.diff_res_1 = Ef.diff_res_1 + diff_res_t_f;
+  Ef.diff_res_2 = Sf.diff_res_2 + diff_res_t_f;
+
+  Ec.ftype = Sc.ftype;
+  Sf.ftype = Ef.ftype;
+
+  Ec.Xco2 =  Sc.Xco2;
+  Ec.Xh2o = Sc.Xh2o;
+  Ec.Xo2 = Sc.Xo2;
+  Ec.Xso2 = Sc.Xso2;
+
+  Sf.Xco2 = Ef.Xco2;
+  Sf.Xh2o = Ef.Xh2o;
+  Sf.Xo2 = Ef.Xo2;
+  Sf.Xso2 = Ef.Xso2;
+
+  ftype_c = Ec.ftype;
+  ftype_f = Sf.ftype;
+
+  Xco2_c = Ec.Xco2;
+  Xh2o_c = Ec.Xh2o;
+  Xo2_c = Ec.Xo2;
+  Xso2_c = Ec.Xso2;
+
+  Xco2_f = Sf.Xco2;
+  Xh2o_f = Sf.Xh2o;
+  Xo2_f = Sf.Xo2;
+  Xso2_f = Sf.Xso2;
+
+  /* Exchange area for the plate exchanger */
+  dS = (nbp - 2)*Sp/(N - 1);
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equations */
+    BQc[i] = Qc[i] - Qc[i + 1];
+    BQf[i] = Qf[i + 1] - Qf[i];
+
+    0 = BQc[i];
+    0 = BQf[i];
+
+    /* Energy balance equations */
+    BHc[i] = hbc[i]*Qc[i] - hbc[i + 1]*Qc[i + 1] - dW[i] + J_c[i];
+    BHf[i] = hbf[i + 1]*Qf[i + 1] - hbf[i]*Qf[i] + dW[i] + J_f[i];
+
+    if dynamic_energy_balance then
+      Vc/(N - 1)*rhoc1[i]*der(hc[i + 1]) = BHc[i];
+      Vf/(N - 1)*rhof1[i]*der(hf[i + 1]) = BHf[i];
+    else
+      0 = BHc[i];
+      0 = BHf[i];
+    end if;
+
+    /* Heat transfer between the hot and cold sides */
+    /* 1/hconv = 1/hconv_c + 1/hconv_f + emetal/lambdam */
+    hconv[i] = if noEvent(hconv_c[i]*hconv_f[i] < 1.e-6) then 0 else hconv_c[i]*hconv_f[i]/(hconv_c[i] + hconv_f[i] + hconv_c[i]*hconv_f[i]*emetal/lambdam);
+    dW[i] = hconv[i]*dS*(Tc1[i] - Tf1[i]);
+
+    /* Heat transfer correlations for water/steam */
+    qmc1[i] = (qmc2[i] + qmc2[i + 1])/2;
+    qmf1[i] = (qmf2[i] + qmf2[i + 1])/2;
+
+    if (heat_exchange_correlation == 0) then
+      hconv_c[i] = p_hc;
+      hconv_f[i] = p_hf;
+    elseif (heat_exchange_correlation == 1) then
+      hconv_c[i] = noEvent(if (qmc1[i] < 1.e-3) then 0 else 11.245*abs(qmc1[i])^0.8*abs(muc1[i]*cpc1[i]/lambdac1[i])^0.4*lambdac1[i]);
+      hconv_f[i] = noEvent(if (qmf1[i] < 1.e-3) then 0 else 11.245*abs(qmf1[i])^0.8*abs(muf1[i]*cpf1[i]/lambdaf1[i])^0.4*lambdaf1[i]);
+    else
+      hconv_c[i] = 0;
+      hconv_f[i] = 0;
+      assert(false, "DynamicWaterWaterExchanger: incorrect heat exchange correlation number");
+    end if;
+
+    /* Diffusion power */
+    if diffusion then
+      re_c[i] = exp(-0.033*(Qc[i]*diff_res_e_c[i])^2);
+      rs_c[i] = exp(-0.033*(Qc[i + 1]*diff_res_s_c[i])^2);
+
+      gamma_e_c[i] = 1/diff_res_e_c[i];
+      gamma_s_c[i] = 1/diff_res_s_c[i];
+
+      re_f[i] = exp(-0.033*(Qf[i]*diff_res_e_f[i])^2);
+      rs_f[i] = exp(-0.033*(Qf[i + 1]*diff_res_s_f[i])^2);
+
+      gamma_e_f[i] = 1/diff_res_e_f[i];
+      gamma_s_f[i] = 1/diff_res_s_f[i];
+
+      if i == 1 then
+        diff_res_e_c[i] = (if Ec.diff_on_1 then Ec.diff_res_1 else 0) + diff_res_c[i];
+        Je_c[i] = if Ec.diff_on_1 then re_c[i]*gamma_e_c[i]*(hc[i] - hc[i + 1]) else 0;
+     else
+        diff_res_e_c[i] = diff_res_c[i];
+        Je_c[i] = re_c[i]*gamma_e_c[i]*(hc[i] - hc[i + 1]);
+      end if;
+
+      if i == N - 1 then
+        diff_res_s_c[i] = (if Sc.diff_on_2 then Sc.diff_res_2 else 0) + diff_res_c[i + 1];
+        Js_c[i] = if Sc.diff_on_2 then rs_c[i]*gamma_s_c[i]*(hc[i + 2] - hc[i + 1]) else 0;
+      else
+        diff_res_s_c[i] = diff_res_c[i + 1];
+        Js_c[i] = rs_c[i]*gamma_s_c[i]*(hc[i + 2] - hc[i + 1]);
+     end if;
+
+      if i == N - 1 then
+        diff_res_e_f[i] = (if Ef.diff_on_1 then Ef.diff_res_1 else 0) + diff_res_f[i];
+        Je_f[i] = if Ef.diff_on_1 then re_f[i]*gamma_e_f[i]*(hf[i] - hf[i + 1]) else 0;
+     else
+        diff_res_e_f[i] = diff_res_f[i];
+        Je_f[i] = re_f[i]*gamma_e_f[i]*(hf[i] - hf[i + 1]);
+      end if;
+
+      if i == 1 then
+        diff_res_s_f[i] = (if Sf.diff_on_2 then Sf.diff_res_2 else 0) + diff_res_f[i + 1];
+        Js_f[i] = if Sf.diff_on_2 then rs_f[i]*gamma_s_f[i]*(hf[i + 2] - hf[i + 1]) else 0;
+      else
+        diff_res_s_f[i] = diff_res_f[i + 1];
+        Js_f[i] = rs_f[i]*gamma_s_f[i]*(hf[i + 2] - hf[i + 1]);
+     end if;
+    else
+      diff_res_e_c[i] = 1/gamma0;
+      diff_res_s_c[i] = 1/gamma0;
+
+      re_c[i] = 0;
+      rs_c[i] = 0;
+
+      gamma_e_c[i] = gamma0;
+      gamma_s_c[i] = gamma0;
+
+      Je_c[i] = 0;
+      Js_c[i] = 0;
+
+      diff_res_e_f[i] = 1/gamma0;
+      diff_res_s_f[i] = 1/gamma0;
+
+      re_f[i] = 0;
+      rs_f[i] = 0;
+
+      gamma_e_f[i] = gamma0;
+      gamma_s_f[i] = gamma0;
+
+      Je_f[i] = 0;
+      Js_f[i] = 0;
+    end if;
+
+    J_c[i] = Je_c[i] + Js_c[i];
+    J_f[i] = Je_f[i] + Js_f[i];
+
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      hbc[i + 1] = ThermoSysPro.Functions.SmoothCond(Qc[i + 1]/gamma_c[i + 1], hc[i + 1], hc[i + 2], 1);
+      hbf[i + 1] = ThermoSysPro.Functions.SmoothCond(Qf[i + 1]/gamma_f[i + 1], hf[i + 1], hf[i + 2], 1);
+    else
+      hbc[i + 1] = if (Qc[i + 1] > 0) then hc[i + 1] else hc[i + 2];
+      hbf[i + 1] = if (Qf[i + 1] > 0) then hf[i + 1] else hf[i + 2];
+    end if;
+
+    /* Fluid thermodynamic properties */
+    if (p_rhoc > 0) then
+      rhoc1[i] = p_rhoc;
+    else
+      rhoc1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+    end if;
+
+    Tc1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+    cpc1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+    muc1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+    kc1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+    lambdac1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhoc1[i], Tc1[i], Pc[i + 1], 0, fluid_c);
+
+    if (p_rhof > 0) then
+      rhof1[i] = p_rhof;
+    else
+      rhof1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+    end if;
+
+    Tf1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+    cpf1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+    muf1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+    kf1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+    lambdaf1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhof1[i], Tf1[i], Pf[i + 1], 0, fluid_f);
+  end for;
+
+  /* Pressure losses correlations */
+  M = (nbp - 1)/2;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Pressure losses */
+    Pc[i + 1] = if Qc[i] > 0 then Pc[i] - DPc[i]/N else Pc[i] + DPc[i]/N;
+    Pf[i + 1] = if Qf[i] > 0 then Pf[i] - DPf[i]/N else Pf[i] + DPf[i]/N;
+
+    qmc2[i] = noEvent(abs(Qc[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muc2[i])*M));
+    qmf2[i] = noEvent(abs(Qf[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muf2[i])*M));
+
+    quc[i] = noEvent(abs(Qc[i])/M);
+    quf[i] = noEvent(abs(Qf[i])/M);
+
+    if (pressure_loss_correlation == 0) then
+      DPc[i] = p_Kc*Qc[i]^2/rhoc2[i];
+      DPf[i] = p_Kf*Qf[i]^2/rhof2[i];
+    elseif (pressure_loss_correlation == 1) then
+      DPc[i] = noEvent(if (qmc2[i] < 1.e-3) then 0 else c1*14423.2/rhoc2[i]*abs(qmc2[i])^(-0.097)*quc[i]^2*(1472.47 + 1.54*(M - 1)/2 + 104.97*abs(qmc2[i])^(-0.25)));
+      DPf[i] = noEvent(if (qmf2[i] < 1.e-3) then 0 else 14423.2/rhof2[i]*abs(qmf2[i])^(-0.097)*quf[i]^2*(1472.47 + 1.54*(M - 1)/2 + 104.97*abs(qmf2[i])^(-0.25)));
+    else
+      DPc[i] = 0;
+      DPf[i] = 0;
+      assert(false, "DynamicWaterWaterExchanger: incorrect pressure loss correlation number");
+    end if;
+
+    /* Diffusion resistance */
+    diff_res_c[i] = cpc2[i]*dx2_c/Ac/kc2[i];
+    gamma_c[i] = if diffusion then 1/diff_res_c[i] else gamma0;
+
+    diff_res_f[i] = cpf2[i]*dx2_f/Af/kf2[i];
+    gamma_f[i] = if diffusion then 1/diff_res_f[i] else gamma0;
+
+    /* Fluid thermodynamic properties */
+    if (p_rhoc > 0) then
+      rhoc2[i] = p_rhoc;
+    else
+      rhoc2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+    end if;
+
+    Tc2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+    cpc2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+    muc2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+    kc2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+
+    if (p_rhof > 0) then
+      rhof2[i] = p_rhof;
+    else
+      rhof2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+    end if;
+
+    Tf2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+    cpf2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+    muf2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+    kf2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+  end for;
+
+  /* Calcul des températures en entrée et en sortie de l'échangeur */
+   Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+   Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c);
+
+   Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+   Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f);
+
+  /* Total fluid diffusion resistance */
+  diff_res_t_c = sum(diff_res_c);
+  diff_res_t_f = sum(diff_res_f);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0}),
+        Line(points={{-80,60},{-80,-60}}),
+        Line(points={{80,60},{80,-60}}),
+        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={
+              28,108,200}),
+        Line(
+          points={{-40,60},{-40,-60}},
+          color={28,108,200},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{0,60},{0,-60}},
+          color={28,108,200},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{40,60},{40,-60}},
+          color={28,108,200},
+          pattern=LinePattern.Dot)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          lineThickness=0),
+        Line(points={{-80,60},{-80,-60}}),
+        Line(points={{80,60},{80,-60}}),
+        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={
+              28,108,200}),
+        Line(
+          points={{-40,60},{-40,-60}},
+          color={28,108,200},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{0,60},{0,-60}},
+          color={28,108,200},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{40,60},{40,-60}},
+          color={28,108,200},
+          pattern=LinePattern.Dot),
+        Text(
+          extent={{104,24},{128,10}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot outlet"),
+        Text(
+          extent={{-82,-66},{-62,-76}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold inlet"),
+        Text(
+          extent={{-126,24},{-106,14}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot inlet"),
+        Text(
+          extent={{66,-66},{90,-76}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold outlet")}),
+    Window(
+      x=0.18,
+      y=0.05,
+      width=0.68,
+      height=0.94),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.6.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end DynamicPlateHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo
index 33675244c794855ddeab5523dda36ff8e29f8fec..4b7eca6974a9730a2a46c7d0a2d78105020f8086 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo
@@ -1,615 +1,615 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicTwoPhaseFlowPipe "Dynamic two-phase flow pipe"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
-  parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real rgliss=1 "Phase slip coefficient";
-  parameter Integer a=4200 "Phase pressure loss coefficient";
-  parameter Real dpfCorr=1.00
-    "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.Temperature T0[Ns]=fill(300, Ns)
-    "Initial fluid temperature (active if steady_state=false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state=false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection term - false: without advection term";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean option_temperature=true
-    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer N=Ns + 1
-    "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Internal cross sectional pipe area";
-  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-  parameter Units.SI.Area dSi=pi*Di*dx1
-    "Internal heat exchange area for a node";
-  parameter Real Mmol=18.015 "Water molar mass";
-  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
-    "Critical pressure";
-  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
-    "Critical temperature";
-  parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple
-    "Triple point pressure";
-  parameter Real xb1=0.0002 "Min value for vapor mass fraction";
-  parameter Real xb2=0.85 "Max value for vapor mass fraction";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill(
-        1.e5, N + 1)) "Bounded fluid pressure in node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boudary of node i";
-  Units.SI.MassFlowRate BQ[N - 1]
-    "Right hand side of the mass balance equation for thermal node i";
-  Units.SI.Power BH[N - 1]
-    "Right hand side of the energy balance equation for thermal node i";
-  Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Convection thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Diffusion thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the liquid side for node i";
-  Units.SI.Power W1t "Total power exchanged on the liquid side";
-  Units.SI.Temperature Tp1[N - 1](each start=500.0)
-    "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal=
-       fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1),
-      nominal=fill(200, N - 1))
-    "Fluid heat exchange coefficient in node i for the liquid fraction";
-  Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal=
-        fill(200, N - 1))
-    "Fluid heat exchange coefficient in node i for the vapor fraction";
-  Real S[N - 1] "Corrective term for nucleation removal";
-  Real E[N - 1] "Corrective term for hcl";
-  Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal=
-        fill(5.e5, N - 1))
-    "Fluid heat exchange coefficient for vaporization in thermal node i";
-  Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid";
-  Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Reynolds number in hydraulic node i for the liquid";
-  Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill(
-        5.e5, N - 1)) "Reynolds number in thermal node i for the vapor";
-  Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N))
-    "Reynolds number in hydraulic node i for the vapor";
-  Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i for the liquid";
-  Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i for the vapor";
-  Units.SI.ThermalConductivity kl1[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Thermal conductivity in thermal node i for the liquid";
-  Units.SI.ThermalConductivity kl2[N](start=fill(0.6, N), nominal=fill(0.6, N))
-    "Thermal conductivity in hydraulic node i for the liquid";
-  Units.SI.ThermalConductivity kv1[N - 1](start=fill(0.03, N - 1), nominal=fill(
-        0.03, N - 1)) "Thermal conductivity in thermal node i for the vapor";
-  Units.SI.ThermalConductivity kv2[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Thermal conductivity in hydraulic node i for the vapor";
-  Real xv1[N - 1] "Vapor mass fraction in thermal node i";
-  Real xv2[N] "Vapor mass fraction in hydraulic node i";
-  Real xbs[N - 1] "Bounded upper value for the vapor mass fraction";
-  Real xbi[N - 1] "Bounded lower value for the vapor mass fraction";
-  Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid";
-  Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Dynamic viscosity in hydraulic node i for the liquid";
-  Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill(
-        1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor";
-  Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N))
-    "Dynamic viscosity in hydraulic node i for the vapor";
-  Units.SI.SpecificHeatCapacity cpl1[N - 1](start=fill(4000, N - 1), nominal=
-        fill(4000, N - 1))
-    "Specific heat capacity in thermal node i for the liquid";
-  Units.SI.SpecificHeatCapacity cpl2[N](start=fill(4000, N), nominal=fill(4000,
-        N)) "Specific heat capacity in hydraulic node i for the liquid";
-  Units.SI.SpecificHeatCapacity cpv1[N - 1](start=fill(2000, N - 1), nominal=
-        fill(2000, N - 1))
-    "Specific heat capacity in thermal node i for the vapor";
-  Units.SI.SpecificHeatCapacity cpv2[N](start=fill(4000, N), nominal=fill(4000,
-        N)) "Specific heat capacity in hydraulic node i for the vapor";
-  Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1))
-    "Boiling number";
-  Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Martinelli number";
-  Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill(
-        2.e6, N - 1)) "Specific enthalpy for vaporisation";
-  Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1))
-    "Fluid density in thermal node i for the liquid";
-  Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N))
-    "Fluid density in hydraulic node i for the liquid";
-  Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i for the vapor";
-  Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i for the vapor";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real khi[N] "Hydraulic pressure loss coefficient in node i";
-  Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i for the liquid";
-  Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i for the vapor)";
-  Real filo[N] "Pressure loss coefficient for two-phase flow";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Real diff_res_l[N] "Diffusion resistance in hydraulic node i for the liquid";
-  Real diff_res_v[N] "Diffusion resistance in hydraulic node i for the vapor";
-  Real diff_res[N] "Total diffusion resistance in hydraulic node i";
-  Real diff_res_t "Total diffusion resistance in the pipe";
-  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
-  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
-  Units.SI.MassFlowRate gamma[N]
-    "Total diffusion conductance in hydraulic node i";
-  Units.SI.MassFlowRate gamma_e[N - 1]
-    "Diffusion conductance at inlet of thermal node i";
-  Units.SI.MassFlowRate gamma_s[N - 1]
-    "Diffusion conductance at outlet of thermal node i";
-  Units.SI.Power Je[N - 1]
-    "Thermal power diffusion from inlet of thermal node i";
-  Units.SI.Power Js[N - 1]
-    "Thermal power diffusion from outlet of thermal node i";
-  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
-  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
-  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[N - 1]
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[2]
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[N]
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[N]
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[N]
-    annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[N - 1]
-    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[N - 1]
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-public
-  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      for i in 2:N loop
-        der(h[i]) = 0;
-      end for;
-    else
-      if option_temperature then
-        for i in 2:N loop
-          h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pb[i], T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-        end for;
-      else
-        for i in 2:N loop
-          h[i] = h0[i - 1];
-        end for;
-      end if;
-    end if;
-
-    if dynamic_mass_balance then
-      for i in 2:N loop
-        der(P[i]) = 0;
-      end for;
-    end if;
-  end if;
-
-  if inertia then
-    for i in 1:N loop
-      der(Q[i]) = 0;
-    end for;
-  end if;
-
-equation
-
-  /* Check that the fluid type is water/steam */
-  assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "DynamicTwoPhaseFlowPipe: the fluid type must be water/steam");
-
-  /* Wall temperature */
-  Tp1 = CTh.T;
-  CTh.W = dW1;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol_1;
-  h[N + 1] = C2.h_vol_2;
-
-  C1.h_vol_2 = h[2];
-  C2.h_vol_1 = h[N];
-
-  Pb[1] = max(min(P[1], pcrit - 1), ptriple);
-  Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple);
-
-  C2.diff_on_1 = diffusion;
-  C1.diff_on_2 = diffusion;
-
-  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
-  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2 = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  ftype = C1.ftype;
-
-  Xco2 = C1.Xco2;
-  Xh2o = C1.Xh2o;
-  Xo2 = C1.Xo2;
-  Xso2 = C1.Xso2;
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-    BQ[i] = Q[i] - Q[i + 1];
-
-    if dynamic_energy_balance and dynamic_mass_balance then
-      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = BQ[i];
-    else
-      0 = BQ[i];
-    end if;
-
-    /* Energy balance equation */
-    BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + J[i];
-
-    if dynamic_energy_balance then
-      if dynamic_mass_balance then
-        if simplified_dynamic_energy_balance then
-          A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i];
-        else
-          A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = BH[i];
-        end if;
-      else
-        A*rho1[i]*der(h[i + 1])*dx1 = BH[i];
-      end if;
-    else
-      0 = BH[i];
-    end if;
-
-    /* Heat transfer at the wall */
-    dW1_conv[i] = hi[i]*dSi*(Tp1[i] - T1[i]);
-    dW1_diff[i] = ((1 - xv1[i])*kl1[i] + xv1[i]*kv1[i])*2*pi*dx1*ntubes*(Tp1[i] - T1[i]);
-
-    dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0);
-
-    if noEvent(xv1[i] < xb1) then
-      hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]);
-      Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
-    elseif noEvent(xv1[i] > xb2) then
-      hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*hcl[i] + S[i]*heb[i]);
-      Xtt[i] = ((1 - xb2)/xb2)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
-    else
-      hi[i] = E[i]*hcl[i] + S[i]*heb[i];
-      Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
-    end if;
-
-    E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1;
-    Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4*(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5);
-    S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0);
-    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)^0.67 else 100);
-
-    hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl1[i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0);
-    hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv1[i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0);
-
-    Prl[i] = mul1[i]*cpl1[i]/kl1[i];
-    Prv[i] = muv1[i]*cpv1[i]/kv1[i];
-
-    Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i])));
-    Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i])));
-
-    /* Diffusion power */
-    if diffusion then
-      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
-      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
-
-      gamma_e[i] = 1/diff_res_e[i];
-      gamma_s[i] = 1/diff_res_s[i];
-
-      if i == 1 then
-        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
-        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
-     else
-        diff_res_e[i] = diff_res[i];
-        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
-      end if;
-
-      if i == N - 1 then
-        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
-        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
-      else
-        diff_res_s[i] = diff_res[i + 1];
-        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
-      end if;
-    else
-      diff_res_e[i] = 1/gamma0;
-      diff_res_s[i] = 1/gamma0;
-
-      re[i] = 0;
-      rs[i] = 0;
-
-      gamma_e[i] = gamma0;
-      gamma_s[i] = gamma0;
-
-      Je[i] = 0;
-      Js[i] = 0;
-    end if;
-
-    J[i] = Je[i] + Js[i];
-
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
-    else
-      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
-    end if;
-
-    /* Fluid thermodynamic properties */
-    pro1[i] = ThermoSysPro.Properties.Fluid.Ph(P[i + 1], h[i + 1], mode, fluid);
-
-    rho1[i] = pro1[i].d;
-    T1[i] = pro1[i].T;
-    xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x;
-
-    (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P(P[i + 1], fluid);
-
-    if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
-      xbs[i]   = 0;
-      xbi[i]   = 1;
-      rhol1[i] = pro1[i].d;
-      rhov1[i] = pro1[i].d;
-      cpl1[i]  = pro1[i].cp;
-      cpv1[i]  = pro1[i].cp;
-      lv[i]    = 1;
-    else
-      xbs[i]   = min(pro1[i].x, 0.90);
-      xbi[i]   = max(pro1[i].x, 0.10);
-      rhol1[i] = max(pro1[i].d, lsat1[i].rho);
-      rhov1[i] = min(pro1[i].d, vsat1[i].rho);
-      cpl1[i]  = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp;
-      cpv1[i]  = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp;
-      lv[i]    = vsat1[i].h - lsat1[i].h;
-    end if;
-
-    mul1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol1[i], T1[i], fluid);
-    muv1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov1[i], T1[i], fluid);
-
-    kl1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1], mode, fluid);
-    kv1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1], mode, fluid);
-
-    Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Momentum balance equation */
-    if inertia then
-      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
-    else
-      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-    end if;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i]));
-
-    khi[i] = filo[i]*lambdal[i]*dx2/D;
-
-    lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-    lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-
-    Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i])));
-    Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i])));
-
-    if noEvent(xv2[i] < 0) then
-      filo[i] = 1;
-    else
-      if noEvent((xv2[i] >= 0) and (xv2[i] < 0.8)) then
-        filo[i] = 1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84);
-      else
-        filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i];
-      end if;
-    end if;
-
-    /* Diffusion resistance */
-    // diff_res_l[i] = (1 - xv2[i])*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i];
-    // diff_res_v[i] = xv2[i]*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i];
-    diff_res_l[i] = 1*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i];
-    diff_res_v[i] = 0*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i];
-
-    diff_res[i] = diff_res_l[i] + diff_res_v[i];
-    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
-
-    /* Fluid thermodynamic properties */
-    pro2[i] = ThermoSysPro.Properties.Fluid.Ph((P[i] + P[i + 1])/2, hb[i], mode, fluid);
-
-    rho2[i] = pro2[i].d;
-    xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x;
-    T2[i] = pro2[i].T;
-
-    (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P((P[i] + P[i + 1])/2, fluid);
-
-    if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then
-      rhol2[i] = pro2[i].d;
-      rhov2[i] = pro2[i].d;
-      cpl2[i]  = pro2[i].cp;
-      cpv2[i]  = pro2[i].cp;
-    else
-      rhol2[i] = max(pro2[i].d, lsat2[i].rho);
-      rhov2[i] = min(pro2[i].d, vsat2[i].rho);
-      cpl2[i]  = if noEvent(xv2[i] <= 0.0) then pro2[i].cp else lsat2[i].cp;
-      cpv2[i]  = if noEvent(xv2[i] >= 1.0) then pro2[i].cp else vsat2[i].cp;
-    end if;
-
-    mul2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol2[i], T2[i], fluid);
-    muv2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov2[i], T2[i], fluid);
-
-    kl2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid);
-    kv2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid);
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  proc[1] = ThermoSysPro.Properties.Fluid.Ph(P[1], h[1], mode, fluid);
-  proc[2] = ThermoSysPro.Properties.Fluid.Ph(P[N + 1], h[N + 1], mode, fluid);
-
-  rhoc[1] = proc[1].d;
-  rhoc[N + 1] = proc[2].d;
-
-  W1t = sum(dW1);
-
-  /* Total fluid diffusion resistance */
-  diff_res_t = sum(diff_res);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,0},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,0}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{100,0}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({170,213,255},
-          if dynamic_energy_balance then {170,213,255}
-          else if diffusion then {213,255,170}
-          else {255,255,170}),
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,0},{100,-20}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid)),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-    Window(
-      x=0.16,
-      y=0.07,
-      width=0.71,
-      height=0.85),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.4.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni</li>
-<li>Guillaume Larrignon </li>
-</ul>
-</html>"));
-end DynamicTwoPhaseFlowPipe;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicTwoPhaseFlowPipe "Dynamic two-phase flow pipe"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
+  parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness";
+  parameter Integer ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real rgliss=1 "Phase slip coefficient";
+  parameter Integer a=4200 "Phase pressure loss coefficient";
+  parameter Real dpfCorr=1.00
+    "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.Temperature T0[Ns]=fill(300, Ns)
+    "Initial fluid temperature (active if steady_state=false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state=false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection term - false: without advection term";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean option_temperature=true
+    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer N=Ns + 1
+    "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Internal cross sectional pipe area";
+  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+  parameter Units.SI.Area dSi=pi*Di*dx1
+    "Internal heat exchange area for a node";
+  parameter Real Mmol=18.015 "Water molar mass";
+  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
+    "Critical pressure";
+  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
+    "Critical temperature";
+  parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple
+    "Triple point pressure";
+  parameter Real xb1=0.0002 "Min value for vapor mass fraction";
+  parameter Real xb2=0.85 "Max value for vapor mass fraction";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill(
+        1.e5, N + 1)) "Bounded fluid pressure in node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boudary of node i";
+  Units.SI.MassFlowRate BQ[N - 1]
+    "Right hand side of the mass balance equation for thermal node i";
+  Units.SI.Power BH[N - 1]
+    "Right hand side of the energy balance equation for thermal node i";
+  Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Convection thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Diffusion thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the liquid side for node i";
+  Units.SI.Power W1t "Total power exchanged on the liquid side";
+  Units.SI.Temperature Tp1[N - 1](each start=500.0)
+    "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal=
+       fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1),
+      nominal=fill(200, N - 1))
+    "Fluid heat exchange coefficient in node i for the liquid fraction";
+  Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal=
+        fill(200, N - 1))
+    "Fluid heat exchange coefficient in node i for the vapor fraction";
+  Real S[N - 1] "Corrective term for nucleation removal";
+  Real E[N - 1] "Corrective term for hcl";
+  Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal=
+        fill(5.e5, N - 1))
+    "Fluid heat exchange coefficient for vaporization in thermal node i";
+  Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid";
+  Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Reynolds number in hydraulic node i for the liquid";
+  Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill(
+        5.e5, N - 1)) "Reynolds number in thermal node i for the vapor";
+  Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N))
+    "Reynolds number in hydraulic node i for the vapor";
+  Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i for the liquid";
+  Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i for the vapor";
+  Units.SI.ThermalConductivity kl1[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Thermal conductivity in thermal node i for the liquid";
+  Units.SI.ThermalConductivity kl2[N](start=fill(0.6, N), nominal=fill(0.6, N))
+    "Thermal conductivity in hydraulic node i for the liquid";
+  Units.SI.ThermalConductivity kv1[N - 1](start=fill(0.03, N - 1), nominal=fill(
+        0.03, N - 1)) "Thermal conductivity in thermal node i for the vapor";
+  Units.SI.ThermalConductivity kv2[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Thermal conductivity in hydraulic node i for the vapor";
+  Real xv1[N - 1] "Vapor mass fraction in thermal node i";
+  Real xv2[N] "Vapor mass fraction in hydraulic node i";
+  Real xbs[N - 1] "Bounded upper value for the vapor mass fraction";
+  Real xbi[N - 1] "Bounded lower value for the vapor mass fraction";
+  Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid";
+  Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Dynamic viscosity in hydraulic node i for the liquid";
+  Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill(
+        1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor";
+  Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N))
+    "Dynamic viscosity in hydraulic node i for the vapor";
+  Units.SI.SpecificHeatCapacity cpl1[N - 1](start=fill(4000, N - 1), nominal=
+        fill(4000, N - 1))
+    "Specific heat capacity in thermal node i for the liquid";
+  Units.SI.SpecificHeatCapacity cpl2[N](start=fill(4000, N), nominal=fill(4000,
+        N)) "Specific heat capacity in hydraulic node i for the liquid";
+  Units.SI.SpecificHeatCapacity cpv1[N - 1](start=fill(2000, N - 1), nominal=
+        fill(2000, N - 1))
+    "Specific heat capacity in thermal node i for the vapor";
+  Units.SI.SpecificHeatCapacity cpv2[N](start=fill(4000, N), nominal=fill(4000,
+        N)) "Specific heat capacity in hydraulic node i for the vapor";
+  Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1))
+    "Boiling number";
+  Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Martinelli number";
+  Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill(
+        2.e6, N - 1)) "Specific enthalpy for vaporisation";
+  Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1))
+    "Fluid density in thermal node i for the liquid";
+  Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N))
+    "Fluid density in hydraulic node i for the liquid";
+  Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i for the vapor";
+  Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i for the vapor";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real khi[N] "Hydraulic pressure loss coefficient in node i";
+  Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i for the liquid";
+  Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i for the vapor)";
+  Real filo[N] "Pressure loss coefficient for two-phase flow";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Real diff_res_l[N] "Diffusion resistance in hydraulic node i for the liquid";
+  Real diff_res_v[N] "Diffusion resistance in hydraulic node i for the vapor";
+  Real diff_res[N] "Total diffusion resistance in hydraulic node i";
+  Real diff_res_t "Total diffusion resistance in the pipe";
+  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
+  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
+  Units.SI.MassFlowRate gamma[N]
+    "Total diffusion conductance in hydraulic node i";
+  Units.SI.MassFlowRate gamma_e[N - 1]
+    "Diffusion conductance at inlet of thermal node i";
+  Units.SI.MassFlowRate gamma_s[N - 1]
+    "Diffusion conductance at outlet of thermal node i";
+  Units.SI.Power Je[N - 1]
+    "Thermal power diffusion from inlet of thermal node i";
+  Units.SI.Power Js[N - 1]
+    "Thermal power diffusion from outlet of thermal node i";
+  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
+  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
+  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[N - 1]
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[2]
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[N]
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[N]
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[N]
+    annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[N - 1]
+    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[N - 1]
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+public
+  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      for i in 2:N loop
+        der(h[i]) = 0;
+      end for;
+    else
+      if option_temperature then
+        for i in 2:N loop
+          h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pb[i], T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+        end for;
+      else
+        for i in 2:N loop
+          h[i] = h0[i - 1];
+        end for;
+      end if;
+    end if;
+
+    if dynamic_mass_balance then
+      for i in 2:N loop
+        der(P[i]) = 0;
+      end for;
+    end if;
+  end if;
+
+  if inertia then
+    for i in 1:N loop
+      der(Q[i]) = 0;
+    end for;
+  end if;
+
+equation
+
+  /* Check that the fluid type is water/steam */
+  assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "DynamicTwoPhaseFlowPipe: the fluid type must be water/steam");
+
+  /* Wall temperature */
+  Tp1 = CTh.T;
+  CTh.W = dW1;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol_1;
+  h[N + 1] = C2.h_vol_2;
+
+  C1.h_vol_2 = h[2];
+  C2.h_vol_1 = h[N];
+
+  Pb[1] = max(min(P[1], pcrit - 1), ptriple);
+  Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple);
+
+  C2.diff_on_1 = diffusion;
+  C1.diff_on_2 = diffusion;
+
+  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
+  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2 = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  ftype = C1.ftype;
+
+  Xco2 = C1.Xco2;
+  Xh2o = C1.Xh2o;
+  Xo2 = C1.Xo2;
+  Xso2 = C1.Xso2;
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+    BQ[i] = Q[i] - Q[i + 1];
+
+    if dynamic_energy_balance and dynamic_mass_balance then
+      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = BQ[i];
+    else
+      0 = BQ[i];
+    end if;
+
+    /* Energy balance equation */
+    BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + J[i];
+
+    if dynamic_energy_balance then
+      if dynamic_mass_balance then
+        if simplified_dynamic_energy_balance then
+          A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i];
+        else
+          A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = BH[i];
+        end if;
+      else
+        A*rho1[i]*der(h[i + 1])*dx1 = BH[i];
+      end if;
+    else
+      0 = BH[i];
+    end if;
+
+    /* Heat transfer at the wall */
+    dW1_conv[i] = hi[i]*dSi*(Tp1[i] - T1[i]);
+    dW1_diff[i] = ((1 - xv1[i])*kl1[i] + xv1[i]*kv1[i])*2*pi*dx1*ntubes*(Tp1[i] - T1[i]);
+
+    dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0);
+
+    if noEvent(xv1[i] < xb1) then
+      hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]);
+      Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
+    elseif noEvent(xv1[i] > xb2) then
+      hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*hcl[i] + S[i]*heb[i]);
+      Xtt[i] = ((1 - xb2)/xb2)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
+    else
+      hi[i] = E[i]*hcl[i] + S[i]*heb[i];
+      Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
+    end if;
+
+    E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1;
+    Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4*(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5);
+    S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0);
+    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)^0.67 else 100);
+
+    hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl1[i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0);
+    hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv1[i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0);
+
+    Prl[i] = mul1[i]*cpl1[i]/kl1[i];
+    Prv[i] = muv1[i]*cpv1[i]/kv1[i];
+
+    Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i])));
+    Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i])));
+
+    /* Diffusion power */
+    if diffusion then
+      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
+      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
+
+      gamma_e[i] = 1/diff_res_e[i];
+      gamma_s[i] = 1/diff_res_s[i];
+
+      if i == 1 then
+        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
+        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
+     else
+        diff_res_e[i] = diff_res[i];
+        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
+      end if;
+
+      if i == N - 1 then
+        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
+        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
+      else
+        diff_res_s[i] = diff_res[i + 1];
+        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
+      end if;
+    else
+      diff_res_e[i] = 1/gamma0;
+      diff_res_s[i] = 1/gamma0;
+
+      re[i] = 0;
+      rs[i] = 0;
+
+      gamma_e[i] = gamma0;
+      gamma_s[i] = gamma0;
+
+      Je[i] = 0;
+      Js[i] = 0;
+    end if;
+
+    J[i] = Je[i] + Js[i];
+
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
+    else
+      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
+    end if;
+
+    /* Fluid thermodynamic properties */
+    pro1[i] = ThermoSysPro.Properties.Fluid.Ph(P[i + 1], h[i + 1], mode, fluid);
+
+    rho1[i] = pro1[i].d;
+    T1[i] = pro1[i].T;
+    xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x;
+
+    (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P(P[i + 1], fluid);
+
+    if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
+      xbs[i]   = 0;
+      xbi[i]   = 1;
+      rhol1[i] = pro1[i].d;
+      rhov1[i] = pro1[i].d;
+      cpl1[i]  = pro1[i].cp;
+      cpv1[i]  = pro1[i].cp;
+      lv[i]    = 1;
+    else
+      xbs[i]   = min(pro1[i].x, 0.90);
+      xbi[i]   = max(pro1[i].x, 0.10);
+      rhol1[i] = max(pro1[i].d, lsat1[i].rho);
+      rhov1[i] = min(pro1[i].d, vsat1[i].rho);
+      cpl1[i]  = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp;
+      cpv1[i]  = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp;
+      lv[i]    = vsat1[i].h - lsat1[i].h;
+    end if;
+
+    mul1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol1[i], T1[i], fluid);
+    muv1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov1[i], T1[i], fluid);
+
+    kl1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1], mode, fluid);
+    kv1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1], mode, fluid);
+
+    Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Momentum balance equation */
+    if inertia then
+      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
+    else
+      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+    end if;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i]));
+
+    khi[i] = filo[i]*lambdal[i]*dx2/D;
+
+    lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+    lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+
+    Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i])));
+    Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i])));
+
+    if noEvent(xv2[i] < 0) then
+      filo[i] = 1;
+    else
+      if noEvent((xv2[i] >= 0) and (xv2[i] < 0.8)) then
+        filo[i] = 1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84);
+      else
+        filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i];
+      end if;
+    end if;
+
+    /* Diffusion resistance */
+    // diff_res_l[i] = (1 - xv2[i])*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i];
+    // diff_res_v[i] = xv2[i]*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i];
+    diff_res_l[i] = 1*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i];
+    diff_res_v[i] = 0*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i];
+
+    diff_res[i] = diff_res_l[i] + diff_res_v[i];
+    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
+
+    /* Fluid thermodynamic properties */
+    pro2[i] = ThermoSysPro.Properties.Fluid.Ph((P[i] + P[i + 1])/2, hb[i], mode, fluid);
+
+    rho2[i] = pro2[i].d;
+    xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x;
+    T2[i] = pro2[i].T;
+
+    (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P((P[i] + P[i + 1])/2, fluid);
+
+    if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then
+      rhol2[i] = pro2[i].d;
+      rhov2[i] = pro2[i].d;
+      cpl2[i]  = pro2[i].cp;
+      cpv2[i]  = pro2[i].cp;
+    else
+      rhol2[i] = max(pro2[i].d, lsat2[i].rho);
+      rhov2[i] = min(pro2[i].d, vsat2[i].rho);
+      cpl2[i]  = if noEvent(xv2[i] <= 0.0) then pro2[i].cp else lsat2[i].cp;
+      cpv2[i]  = if noEvent(xv2[i] >= 1.0) then pro2[i].cp else vsat2[i].cp;
+    end if;
+
+    mul2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol2[i], T2[i], fluid);
+    muv2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov2[i], T2[i], fluid);
+
+    kl2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid);
+    kv2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid);
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  proc[1] = ThermoSysPro.Properties.Fluid.Ph(P[1], h[1], mode, fluid);
+  proc[2] = ThermoSysPro.Properties.Fluid.Ph(P[N + 1], h[N + 1], mode, fluid);
+
+  rhoc[1] = proc[1].d;
+  rhoc[N + 1] = proc[2].d;
+
+  W1t = sum(dW1);
+
+  /* Total fluid diffusion resistance */
+  diff_res_t = sum(diff_res);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,0},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,0}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{100,0}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({170,213,255},
+          if dynamic_energy_balance then {170,213,255}
+          else if diffusion then {213,255,170}
+          else {255,255,170}),
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,0},{100,-20}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid)),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+    Window(
+      x=0.16,
+      y=0.07,
+      width=0.71,
+      height=0.85),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.4.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni</li>
+<li>Guillaume Larrignon </li>
+</ul>
+</html>"));
+end DynamicTwoPhaseFlowPipe;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo
index 4dcb33eb7b9fdc0dfbef4bf60d02d029512bcd70..872d44298492e5748137a0965f078386a85b4672 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo
@@ -1,681 +1,681 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicTwoPhaseFlowRiser "Dynamic two-phase flow riser"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.02 "Hydraulic diameter";
-  parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real rgliss=1 "Phase slip coefficient";
-  parameter Integer a=4200 "Phase pressure loss coefficient";
-  parameter Real dpfCorr=1.00 "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Real hcCorr=1.00 "Corrective term for the heat exchange coefficient (hc) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.Temperature T0[Ns]=fill(300, Ns)
-    "Initial fluid temperature (active if steady_state=false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state=false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection term - false: without advection term";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean option_temperature=true
-    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer N=Ns + 1
-    "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Internal cross sectional pipe area";
-  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-  parameter Units.SI.Area dSi=pi*Di*dx1
-    "Internal heat exchange area for a node";
-  parameter Real Mmol=18.015 "Water molar mass";
-  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
-    "Critical pressure";
-  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
-    "Critical temperature";
-  parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple
-    "Triple point pressure";
-  parameter Real xb1=0.0002 "Min value for vapor mass fraction";
-  parameter Real xb2=0.85 "Max value for vapor mass fraction";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill(
-        1.e5, N + 1)) "Bounded fluid pressure in node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boudary of node i";
-  Units.SI.MassFlowRate BQ[N - 1]
-    "Right hand side of the mass balance equation for thermal node i";
-  Units.SI.Power BH[N - 1]
-    "Right hand side of the energy balance equation for thermal node i";
-  Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Convection thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Diffusion thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW2_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Convection thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW2_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
-         - 1))
-    "Diffusion thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW2[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the liquid side for node i";
-  Units.SI.Power W1t "Total power exchanged on the liquid side";
-  Units.SI.Temperature Tp1[N - 1](each start=500.0)
-    "Wall temperature in node i";
-  Units.SI.Temperature Tp2[N - 1](each start=500.0)
-    "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal=
-       fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1),
-      nominal=fill(200, N - 1))
-    "Fluid heat exchange coefficient in node i for the liquid fraction";
-  Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal=
-        fill(200, N - 1))
-    "Fluid heat exchange coefficient in node i for the vapor fraction";
-  Real S[N - 1] "Corrective terme correctif for nucleation removal";
-  Real E[N - 1] "Corrective term for hcl";
-  Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal=
-        fill(5.e5, N - 1))
-    "Fluid heat exchange coefficient for vaporization in thermal node i";
-  Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid";
-  Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Reynolds number in hydraulic node i for the liquid";
-  Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill(
-        5.e5, N - 1)) "Reynolds number in thermal node i for the vapor";
-  Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N))
-    "Reynolds number in hydraulic node i for the vapor";
-  Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i for the liquid";
-  Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i for the vapor";
-  Units.SI.ThermalConductivity kl1[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Thermal conductivity in thermal node i for the liquid";
-  Units.SI.ThermalConductivity kl2[N](start=fill(0.6, N), nominal=fill(0.6, N))
-    "Thermal conductivity in hydraulic node i for the liquid";
-  Units.SI.ThermalConductivity kv1[N - 1](start=fill(0.03, N - 1), nominal=fill(
-        0.03, N - 1)) "Thermal conductivity in thermal node i for the vapor";
-  Units.SI.ThermalConductivity kv2[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Thermal conductivity in hydraulic node i for the vapor";
-  Real xv1[N - 1] "Vapor mass fraction in thermal node i";
-  Real xv2[N] "Vapor mass fraction in hydraulic node i";
-  Real xbs[N - 1] "Bounded upper value for the vapor mass fraction";
-  Real xbi[N - 1] "Bounded lower value for the vapor mass fraction";
-  Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid";
-  Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Dynamic viscosity in hydraulic node i for the liquid";
-  Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill(
-        1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor";
-  Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N))
-    "Dynamic viscosity in hydraulic node i for the vapor";
-  Units.SI.SpecificHeatCapacity cpl1[N - 1](start=fill(4000, N - 1), nominal=
-        fill(4000, N - 1))
-    "Specific heat capacity in thermal node i for the liquid";
-  Units.SI.SpecificHeatCapacity cpl2[N](start=fill(4000, N), nominal=fill(4000,
-        N)) "Specific heat capacity in hydraulic node i for the liquid";
-  Units.SI.SpecificHeatCapacity cpv1[N - 1](start=fill(2000, N - 1), nominal=
-        fill(2000, N - 1))
-    "Specific heat capacity in thermal node i for the vapor";
-  Units.SI.SpecificHeatCapacity cpv2[N](start=fill(4000, N), nominal=fill(4000,
-        N)) "Specific heat capacity in hydraulic node i for the vapor";
-  Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1))
-    "Boiling number";
-  Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Martinelli number";
-  Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill(
-        2.e6, N - 1)) "Specific enthalpy for vaporisation";
-  Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1))
-    "Fluid density in thermal node i for the liquid";
-  Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N))
-    "Fluid density in hydraulic node i for the liquid";
-  Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i for the vapor";
-  Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i for the vapor";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real khi[N] "Hydraulic pressure loss coefficient in node i";
-  Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i for the liquid";
-  Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i for the vapor)";
-  Real filo[N] "Pressure loss coefficient for two-phase flow";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Real diff_res_l[N] "Diffusion resistance in hydraulic node i for the liquid";
-  Real diff_res_v[N] "Diffusion resistance in hydraulic node i for the vapor";
-  Real diff_res[N] "Total diffusion resistance in hydraulic node i";
-  Real diff_res_t "Total diffusion resistance in the pipe";
-  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
-  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
-  Units.SI.MassFlowRate gamma[N]
-    "Total diffusion conductance in hydraulic node i";
-  Units.SI.MassFlowRate gamma_e[N - 1]
-    "Diffusion conductance at inlet of thermal node i";
-  Units.SI.MassFlowRate gamma_s[N - 1]
-    "Diffusion conductance at outlet of thermal node i";
-  Units.SI.Power Je[N - 1]
-    "Thermal power diffusion from inlet of thermal node i";
-  Units.SI.Power Js[N - 1]
-    "Thermal power diffusion from outlet of thermal node i";
-  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
-  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
-  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[N - 1]
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[2]
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[N]
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[N]
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[N]
-    annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[N - 1]
-    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[N - 1]
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-public
-  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
-          extent={{-110,0},{-90,20}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh1[Ns]
-    annotation (Placement(transformation(extent={{-10,60},{10,80}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
-          extent={{90,0},{110,20}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh2[Ns]
-    annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=
-            0)));
-initial equation
-
-  if dynamic_energy_balance then
-    if steady_state then
-      for i in 2:N loop
-        der(h[i]) = 0;
-      end for;
-    else
-      if option_temperature then
-        for i in 2:N loop
-          h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pb[i], T0[i - 1],fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-        end for;
-      else
-        for i in 2:N loop
-          h[i] = h0[i - 1];
-        end for;
-      end if;
-    end if;
-
-    if dynamic_mass_balance then
-      for i in 2:N loop
-        der(P[i]) = 0;
-      end for;
-    end if;
-  end if;
-
-  if inertia then
-    for i in 1:N loop
-      der(Q[i]) = 0;
-    end for;
-  end if;
-
-equation
-
-  /* Check that the fluid type is water/steam */
-  assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "DynamicTwoPhaseFlowRiser: the fluid type must be water/steam");
-
-  /* Wall temperature */
-  Tp1 = CTh1.T;
-  CTh1.W = dW1;
-
-  Tp2 = CTh2.T;
-  CTh2.W = dW2;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol_1;
-  h[N + 1] = C2.h_vol_2;
-
-  C1.h_vol_2 = h[2];
-  C2.h_vol_1 = h[N];
-
-  Pb[1] = max(min(P[1], pcrit - 1), ptriple);
-  Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple);
-
-  C2.diff_on_1 = diffusion;
-  C1.diff_on_2 = diffusion;
-
-  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
-  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2 = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  ftype = C1.ftype;
-
-  Xco2 = C1.Xco2;
-  Xh2o = C1.Xh2o;
-  Xo2 = C1.Xo2;
-  Xso2 = C1.Xso2;
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    BQ[i] = Q[i] - Q[i + 1];
-
-    /* Mass balance equation */
-    if dynamic_energy_balance and dynamic_mass_balance then
-      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = BQ[i];
-    else
-      0 = BQ[i];
-    end if;
-
-    /* Energy balance equation */
-    BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i]  + dW2[i] + J[i];
-
-    if dynamic_energy_balance then
-      if dynamic_mass_balance then
-        if simplified_dynamic_energy_balance then
-          A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i];
-        else
-          A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = BH[i];
-        end if;
-      else
-        A*rho1[i]*der(h[i + 1])*dx1 = BH[i];
-      end if;
-    else
-      0 = BH[i];
-    end if;
-
-    /* Heat transfer at the wall */
-    dW1_conv[i] = hcCorr*hi[i]*dSi*(Tp1[i] - T1[i]);
-    dW2_conv[i] = hcCorr*hi[i]*dSi*(Tp2[i] - T1[i]);
-
-    dW1_diff[i] = ((1 - xv1[i])*kl1[i] + xv1[i]*kv1[i])*2*pi*dx1*ntubes*(Tp1[i] - T1[i]);
-    dW2_diff[i] = ((1 - xv1[i])*kl1[i] + xv1[i]*kv1[i])*2*pi*dx1*ntubes*(Tp2[i] - T1[i]);
-
-    dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0);
-    dW2[i] = dW2_conv[i] + (if diffusion then dW2_diff[i] else 0);
-
-    //*** Thermal exchange correlation
-    // Thom correlation
-    // hi_1[i] = max(1970*exp(P[i + 1]/43.5e5)*(Tp1[i] - Tsat[i]), 5000);
-    // hi_2[i] = max(1970*exp(P[i + 1]/43.5e5)*(Tp2[i] - Tsat[i]), 5000);
-
-    if noEvent(xv1[i] < xb1) then
-      hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]);
-      Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
-    elseif noEvent(xv1[i] > xb2) then
-      hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*hcl[i] + S[i]*heb[i]);
-      Xtt[i] = ((1 - xb2)/xb2)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
-    else
-      hi[i] = E[i]*hcl[i] + S[i]*heb[i];
-      Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
-    end if;
-
-    E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1;
-    Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4*(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5);
-    S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0);
-    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)^0.67 else 100);
-
-    hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl1[i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0);
-    hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv1[i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0);
-
-    Prl[i] = mul1[i]*cpl1[i]/kl1[i];
-    Prv[i] = muv1[i]*cpv1[i]/kv1[i];
-
-    Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i])));
-    Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i])));
-
-    /* Diffusion power */
-    if diffusion then
-      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
-      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
-
-      gamma_e[i] = 1/diff_res_e[i];
-      gamma_s[i] = 1/diff_res_s[i];
-
-      if i == 1 then
-        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
-        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
-     else
-        diff_res_e[i] = diff_res[i];
-        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
-      end if;
-
-      if i == N - 1 then
-        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
-        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
-      else
-        diff_res_s[i] = diff_res[i + 1];
-        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
-      end if;
-    else
-      diff_res_e[i] = 1/gamma0;
-      diff_res_s[i] = 1/gamma0;
-
-      re[i] = 0;
-      rs[i] = 0;
-
-      gamma_e[i] = gamma0;
-      gamma_s[i] = gamma0;
-
-      Je[i] = 0;
-      Js[i] = 0;
-    end if;
-
-    J[i] = Je[i] + Js[i];
-
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
-    else
-      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
-    end if;
-
-    /* Fluid thermodynamic properties */
-    pro1[i] = ThermoSysPro.Properties.Fluid.Ph(P[i + 1], h[i + 1], mode, fluid);
-
-    rho1[i] = pro1[i].d;
-    T1[i] = pro1[i].T;
-    xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x;
-
-    (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P(P[i + 1], fluid);
-
-    if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
-      xbs[i]   = 0;
-      xbi[i]   = 1;
-      rhol1[i] = pro1[i].d;
-      rhov1[i] = pro1[i].d;
-      cpl1[i]   = pro1[i].cp;
-      cpv1[i]   = pro1[i].cp;
-      lv[i]    = 1;
-    else
-      xbs[i]   = min(pro1[i].x, 0.90);
-      xbi[i]   = max(pro1[i].x, 0.10);
-      rhol1[i] = max(pro1[i].d, lsat1[i].rho);
-      rhov1[i] = min(pro1[i].d, vsat1[i].rho);
-      cpl1[i]   = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp;
-      cpv1[i]   = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp;
-      lv[i]    = vsat1[i].h - lsat1[i].h;
-    end if;
-
-    mul1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol1[i], T1[i], fluid);
-    muv1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov1[i], T1[i], fluid);
-
-    kl1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1], mode, fluid);
-    kv1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1], mode, fluid);
-
-    Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Momentum balance equation */
-    if inertia then
-      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
-    else
-      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-    end if;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i]));
-
-    khi[i] = filo[i]*lambdal[i]*dx2/D;
-
-    lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-    lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-
-    Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i])));
-    Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i])));
-
-    if noEvent(xv2[i] < 0) then
-      filo[i] = 1;
-    else
-      if noEvent((xv2[i] >= 0) and (xv2[i] < 0.8)) then
-        filo[i] = 1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84);
-      else
-        filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i];
-      end if;
-    end if;
-
-    /* Diffusion resistance */
-    // diff_res_l[i] = (1 - xv2[i])*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i];
-    // diff_res_v[i] = xv2[i]*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i];
-    diff_res_l[i] = 1*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i];
-    diff_res_v[i] = 0*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i];
-
-    diff_res[i] = diff_res_l[i] + diff_res_v[i];
-    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
-
-    /* Fluid thermodynamic properties */
-    pro2[i] = ThermoSysPro.Properties.Fluid.Ph((P[i] + P[i + 1])/2, hb[i],mode,fluid);
-
-    rho2[i] = pro2[i].d;
-    xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x;
-    T2[i] = pro2[i].T;
-
-    (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P((P[i] + P[i + 1])/2, fluid);
-
-    rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else max(pro2[i].d, lsat2[i].rho);
-    rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else min(pro2[i].d, vsat2[i].rho);
-
-    cpl2[i]  = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].cp else (if noEvent(xv2[i] <= 0.0) then pro2[i].cp else lsat2[i].cp);
-    cpv2[i]  = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].cp else (if noEvent(xv2[i] >= 1.0) then pro2[i].cp else vsat2[i].cp);
-
-    mul2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol2[i], T2[i],fluid);
-    muv2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov2[i], T2[i],fluid);
-
-    kl2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid);
-    kv2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid);
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  proc[1] = ThermoSysPro.Properties.Fluid.Ph(P[1], h[1], mode, fluid);
-  proc[2] = ThermoSysPro.Properties.Fluid.Ph(P[N + 1], h[N + 1], mode, fluid);
-
-  rhoc[1] = proc[1].d;
-  rhoc[N + 1] = proc[2].d;
-
-  W1t = sum(dW1);
-
-  /* Total fluid diffusion resistance */
-  diff_res_t = sum(diff_res);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-20},{100,-40}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,0},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,0},{-60,-40}}),
-        Line(points={{-20,0},{-20,-40}}),
-        Line(points={{20,0},{20,-40}}),
-        Line(points={{60,0},{60,-40}}),
-        Rectangle(
-          extent={{-100,60},{100,40}},
-          lineColor={28,108,200},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,40},{100,20}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,0}},
-          lineColor={28,108,200},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,60},{-60,20}}),
-        Line(points={{-20,60},{-20,20}}),
-        Line(points={{20,60},{20,20}}),
-        Line(points={{60,60},{60,20}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,0},{100,-20}},
-          lineColor={28,108,200},
-          fillColor=DynamicSelect({170,213,255},
-          if dynamic_energy_balance then {170,213,255}
-          else if diffusion then {213,255,170}
-          else {255,255,170}),
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,-20},{100,-40}},
-          lineColor={28,108,200},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-          lineThickness=0),
-        Line(points={{-60,0},{-60,-40}}),
-        Line(points={{-20,0},{-20,-40}}),
-        Line(points={{20,0},{20,-40}}),
-        Line(points={{60,0},{60,-40}}),
-        Rectangle(
-          extent={{-100,60},{100,40}},
-          lineColor={28,108,200},
-          fillColor=DynamicSelect({170,213,255},
-          if dynamic_energy_balance then {170,213,255}
-          else if diffusion then {213,255,170}
-          else {255,255,170}),
-          fillPattern=FillPattern.Solid,
-          lineThickness=0),
-        Rectangle(
-          extent={{-100,40},{100,20}},
-          lineColor={28,108,200},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid)),
-        Rectangle(
-          extent={{-100,20},{100,0}},
-          lineColor={28,108,200},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,60},{-60,20}}),
-        Line(points={{-20,60},{-20,20}}),
-        Line(points={{20,60},{20,20}}),
-        Line(points={{60,60},{60,20}})}),
-    Window(
-      x=0.16,
-      y=0.07,
-      width=0.71,
-      height=0.85),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DynamicTwoPhaseFlowRiser;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicTwoPhaseFlowRiser "Dynamic two-phase flow riser"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.02 "Hydraulic diameter";
+  parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness";
+  parameter Integer ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real rgliss=1 "Phase slip coefficient";
+  parameter Integer a=4200 "Phase pressure loss coefficient";
+  parameter Real dpfCorr=1.00 "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Real hcCorr=1.00 "Corrective term for the heat exchange coefficient (hc) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.Temperature T0[Ns]=fill(300, Ns)
+    "Initial fluid temperature (active if steady_state=false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state=false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection term - false: without advection term";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean option_temperature=true
+    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer N=Ns + 1
+    "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Internal cross sectional pipe area";
+  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+  parameter Units.SI.Area dSi=pi*Di*dx1
+    "Internal heat exchange area for a node";
+  parameter Real Mmol=18.015 "Water molar mass";
+  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
+    "Critical pressure";
+  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
+    "Critical temperature";
+  parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple
+    "Triple point pressure";
+  parameter Real xb1=0.0002 "Min value for vapor mass fraction";
+  parameter Real xb2=0.85 "Max value for vapor mass fraction";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill(
+        1.e5, N + 1)) "Bounded fluid pressure in node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boudary of node i";
+  Units.SI.MassFlowRate BQ[N - 1]
+    "Right hand side of the mass balance equation for thermal node i";
+  Units.SI.Power BH[N - 1]
+    "Right hand side of the energy balance equation for thermal node i";
+  Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Convection thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Diffusion thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW2_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Convection thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW2_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N
+         - 1))
+    "Diffusion thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW2[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the liquid side for node i";
+  Units.SI.Power W1t "Total power exchanged on the liquid side";
+  Units.SI.Temperature Tp1[N - 1](each start=500.0)
+    "Wall temperature in node i";
+  Units.SI.Temperature Tp2[N - 1](each start=500.0)
+    "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal=
+       fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1),
+      nominal=fill(200, N - 1))
+    "Fluid heat exchange coefficient in node i for the liquid fraction";
+  Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal=
+        fill(200, N - 1))
+    "Fluid heat exchange coefficient in node i for the vapor fraction";
+  Real S[N - 1] "Corrective terme correctif for nucleation removal";
+  Real E[N - 1] "Corrective term for hcl";
+  Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal=
+        fill(5.e5, N - 1))
+    "Fluid heat exchange coefficient for vaporization in thermal node i";
+  Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid";
+  Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Reynolds number in hydraulic node i for the liquid";
+  Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill(
+        5.e5, N - 1)) "Reynolds number in thermal node i for the vapor";
+  Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N))
+    "Reynolds number in hydraulic node i for the vapor";
+  Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i for the liquid";
+  Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i for the vapor";
+  Units.SI.ThermalConductivity kl1[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Thermal conductivity in thermal node i for the liquid";
+  Units.SI.ThermalConductivity kl2[N](start=fill(0.6, N), nominal=fill(0.6, N))
+    "Thermal conductivity in hydraulic node i for the liquid";
+  Units.SI.ThermalConductivity kv1[N - 1](start=fill(0.03, N - 1), nominal=fill(
+        0.03, N - 1)) "Thermal conductivity in thermal node i for the vapor";
+  Units.SI.ThermalConductivity kv2[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Thermal conductivity in hydraulic node i for the vapor";
+  Real xv1[N - 1] "Vapor mass fraction in thermal node i";
+  Real xv2[N] "Vapor mass fraction in hydraulic node i";
+  Real xbs[N - 1] "Bounded upper value for the vapor mass fraction";
+  Real xbi[N - 1] "Bounded lower value for the vapor mass fraction";
+  Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid";
+  Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Dynamic viscosity in hydraulic node i for the liquid";
+  Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill(
+        1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor";
+  Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N))
+    "Dynamic viscosity in hydraulic node i for the vapor";
+  Units.SI.SpecificHeatCapacity cpl1[N - 1](start=fill(4000, N - 1), nominal=
+        fill(4000, N - 1))
+    "Specific heat capacity in thermal node i for the liquid";
+  Units.SI.SpecificHeatCapacity cpl2[N](start=fill(4000, N), nominal=fill(4000,
+        N)) "Specific heat capacity in hydraulic node i for the liquid";
+  Units.SI.SpecificHeatCapacity cpv1[N - 1](start=fill(2000, N - 1), nominal=
+        fill(2000, N - 1))
+    "Specific heat capacity in thermal node i for the vapor";
+  Units.SI.SpecificHeatCapacity cpv2[N](start=fill(4000, N), nominal=fill(4000,
+        N)) "Specific heat capacity in hydraulic node i for the vapor";
+  Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1))
+    "Boiling number";
+  Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Martinelli number";
+  Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill(
+        2.e6, N - 1)) "Specific enthalpy for vaporisation";
+  Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1))
+    "Fluid density in thermal node i for the liquid";
+  Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N))
+    "Fluid density in hydraulic node i for the liquid";
+  Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i for the vapor";
+  Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i for the vapor";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real khi[N] "Hydraulic pressure loss coefficient in node i";
+  Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i for the liquid";
+  Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i for the vapor)";
+  Real filo[N] "Pressure loss coefficient for two-phase flow";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Real diff_res_l[N] "Diffusion resistance in hydraulic node i for the liquid";
+  Real diff_res_v[N] "Diffusion resistance in hydraulic node i for the vapor";
+  Real diff_res[N] "Total diffusion resistance in hydraulic node i";
+  Real diff_res_t "Total diffusion resistance in the pipe";
+  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
+  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
+  Units.SI.MassFlowRate gamma[N]
+    "Total diffusion conductance in hydraulic node i";
+  Units.SI.MassFlowRate gamma_e[N - 1]
+    "Diffusion conductance at inlet of thermal node i";
+  Units.SI.MassFlowRate gamma_s[N - 1]
+    "Diffusion conductance at outlet of thermal node i";
+  Units.SI.Power Je[N - 1]
+    "Thermal power diffusion from inlet of thermal node i";
+  Units.SI.Power Js[N - 1]
+    "Thermal power diffusion from outlet of thermal node i";
+  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
+  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
+  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[N - 1]
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[2]
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[N]
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[N]
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[N]
+    annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[N - 1]
+    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[N - 1]
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+public
+  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
+          extent={{-110,0},{-90,20}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh1[Ns]
+    annotation (Placement(transformation(extent={{-10,60},{10,80}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
+          extent={{90,0},{110,20}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh2[Ns]
+    annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=
+            0)));
+initial equation
+
+  if dynamic_energy_balance then
+    if steady_state then
+      for i in 2:N loop
+        der(h[i]) = 0;
+      end for;
+    else
+      if option_temperature then
+        for i in 2:N loop
+          h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pb[i], T0[i - 1],fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+        end for;
+      else
+        for i in 2:N loop
+          h[i] = h0[i - 1];
+        end for;
+      end if;
+    end if;
+
+    if dynamic_mass_balance then
+      for i in 2:N loop
+        der(P[i]) = 0;
+      end for;
+    end if;
+  end if;
+
+  if inertia then
+    for i in 1:N loop
+      der(Q[i]) = 0;
+    end for;
+  end if;
+
+equation
+
+  /* Check that the fluid type is water/steam */
+  assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "DynamicTwoPhaseFlowRiser: the fluid type must be water/steam");
+
+  /* Wall temperature */
+  Tp1 = CTh1.T;
+  CTh1.W = dW1;
+
+  Tp2 = CTh2.T;
+  CTh2.W = dW2;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol_1;
+  h[N + 1] = C2.h_vol_2;
+
+  C1.h_vol_2 = h[2];
+  C2.h_vol_1 = h[N];
+
+  Pb[1] = max(min(P[1], pcrit - 1), ptriple);
+  Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple);
+
+  C2.diff_on_1 = diffusion;
+  C1.diff_on_2 = diffusion;
+
+  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
+  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2 = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  ftype = C1.ftype;
+
+  Xco2 = C1.Xco2;
+  Xh2o = C1.Xh2o;
+  Xo2 = C1.Xo2;
+  Xso2 = C1.Xso2;
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    BQ[i] = Q[i] - Q[i + 1];
+
+    /* Mass balance equation */
+    if dynamic_energy_balance and dynamic_mass_balance then
+      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = BQ[i];
+    else
+      0 = BQ[i];
+    end if;
+
+    /* Energy balance equation */
+    BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i]  + dW2[i] + J[i];
+
+    if dynamic_energy_balance then
+      if dynamic_mass_balance then
+        if simplified_dynamic_energy_balance then
+          A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i];
+        else
+          A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = BH[i];
+        end if;
+      else
+        A*rho1[i]*der(h[i + 1])*dx1 = BH[i];
+      end if;
+    else
+      0 = BH[i];
+    end if;
+
+    /* Heat transfer at the wall */
+    dW1_conv[i] = hcCorr*hi[i]*dSi*(Tp1[i] - T1[i]);
+    dW2_conv[i] = hcCorr*hi[i]*dSi*(Tp2[i] - T1[i]);
+
+    dW1_diff[i] = ((1 - xv1[i])*kl1[i] + xv1[i]*kv1[i])*2*pi*dx1*ntubes*(Tp1[i] - T1[i]);
+    dW2_diff[i] = ((1 - xv1[i])*kl1[i] + xv1[i]*kv1[i])*2*pi*dx1*ntubes*(Tp2[i] - T1[i]);
+
+    dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0);
+    dW2[i] = dW2_conv[i] + (if diffusion then dW2_diff[i] else 0);
+
+    //*** Thermal exchange correlation
+    // Thom correlation
+    // hi_1[i] = max(1970*exp(P[i + 1]/43.5e5)*(Tp1[i] - Tsat[i]), 5000);
+    // hi_2[i] = max(1970*exp(P[i + 1]/43.5e5)*(Tp2[i] - Tsat[i]), 5000);
+
+    if noEvent(xv1[i] < xb1) then
+      hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]);
+      Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
+    elseif noEvent(xv1[i] > xb2) then
+      hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*hcl[i] + S[i]*heb[i]);
+      Xtt[i] = ((1 - xb2)/xb2)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
+    else
+      hi[i] = E[i]*hcl[i] + S[i]*heb[i];
+      Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1;
+    end if;
+
+    E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1;
+    Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4*(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5);
+    S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0);
+    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)^0.67 else 100);
+
+    hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl1[i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0);
+    hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv1[i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0);
+
+    Prl[i] = mul1[i]*cpl1[i]/kl1[i];
+    Prv[i] = muv1[i]*cpv1[i]/kv1[i];
+
+    Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i])));
+    Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i])));
+
+    /* Diffusion power */
+    if diffusion then
+      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
+      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
+
+      gamma_e[i] = 1/diff_res_e[i];
+      gamma_s[i] = 1/diff_res_s[i];
+
+      if i == 1 then
+        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
+        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
+     else
+        diff_res_e[i] = diff_res[i];
+        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
+      end if;
+
+      if i == N - 1 then
+        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
+        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
+      else
+        diff_res_s[i] = diff_res[i + 1];
+        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
+      end if;
+    else
+      diff_res_e[i] = 1/gamma0;
+      diff_res_s[i] = 1/gamma0;
+
+      re[i] = 0;
+      rs[i] = 0;
+
+      gamma_e[i] = gamma0;
+      gamma_s[i] = gamma0;
+
+      Je[i] = 0;
+      Js[i] = 0;
+    end if;
+
+    J[i] = Je[i] + Js[i];
+
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
+    else
+      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
+    end if;
+
+    /* Fluid thermodynamic properties */
+    pro1[i] = ThermoSysPro.Properties.Fluid.Ph(P[i + 1], h[i + 1], mode, fluid);
+
+    rho1[i] = pro1[i].d;
+    T1[i] = pro1[i].T;
+    xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x;
+
+    (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P(P[i + 1], fluid);
+
+    if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
+      xbs[i]   = 0;
+      xbi[i]   = 1;
+      rhol1[i] = pro1[i].d;
+      rhov1[i] = pro1[i].d;
+      cpl1[i]   = pro1[i].cp;
+      cpv1[i]   = pro1[i].cp;
+      lv[i]    = 1;
+    else
+      xbs[i]   = min(pro1[i].x, 0.90);
+      xbi[i]   = max(pro1[i].x, 0.10);
+      rhol1[i] = max(pro1[i].d, lsat1[i].rho);
+      rhov1[i] = min(pro1[i].d, vsat1[i].rho);
+      cpl1[i]   = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp;
+      cpv1[i]   = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp;
+      lv[i]    = vsat1[i].h - lsat1[i].h;
+    end if;
+
+    mul1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol1[i], T1[i], fluid);
+    muv1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov1[i], T1[i], fluid);
+
+    kl1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1], mode, fluid);
+    kv1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1], mode, fluid);
+
+    Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Momentum balance equation */
+    if inertia then
+      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
+    else
+      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+    end if;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i]));
+
+    khi[i] = filo[i]*lambdal[i]*dx2/D;
+
+    lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+    lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+
+    Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i])));
+    Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i])));
+
+    if noEvent(xv2[i] < 0) then
+      filo[i] = 1;
+    else
+      if noEvent((xv2[i] >= 0) and (xv2[i] < 0.8)) then
+        filo[i] = 1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84);
+      else
+        filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i];
+      end if;
+    end if;
+
+    /* Diffusion resistance */
+    // diff_res_l[i] = (1 - xv2[i])*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i];
+    // diff_res_v[i] = xv2[i]*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i];
+    diff_res_l[i] = 1*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i];
+    diff_res_v[i] = 0*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i];
+
+    diff_res[i] = diff_res_l[i] + diff_res_v[i];
+    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
+
+    /* Fluid thermodynamic properties */
+    pro2[i] = ThermoSysPro.Properties.Fluid.Ph((P[i] + P[i + 1])/2, hb[i],mode,fluid);
+
+    rho2[i] = pro2[i].d;
+    xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x;
+    T2[i] = pro2[i].T;
+
+    (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P((P[i] + P[i + 1])/2, fluid);
+
+    rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else max(pro2[i].d, lsat2[i].rho);
+    rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else min(pro2[i].d, vsat2[i].rho);
+
+    cpl2[i]  = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].cp else (if noEvent(xv2[i] <= 0.0) then pro2[i].cp else lsat2[i].cp);
+    cpv2[i]  = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].cp else (if noEvent(xv2[i] >= 1.0) then pro2[i].cp else vsat2[i].cp);
+
+    mul2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol2[i], T2[i],fluid);
+    muv2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov2[i], T2[i],fluid);
+
+    kl2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid);
+    kv2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid);
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  proc[1] = ThermoSysPro.Properties.Fluid.Ph(P[1], h[1], mode, fluid);
+  proc[2] = ThermoSysPro.Properties.Fluid.Ph(P[N + 1], h[N + 1], mode, fluid);
+
+  rhoc[1] = proc[1].d;
+  rhoc[N + 1] = proc[2].d;
+
+  W1t = sum(dW1);
+
+  /* Total fluid diffusion resistance */
+  diff_res_t = sum(diff_res);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-20},{100,-40}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,0},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,0},{-60,-40}}),
+        Line(points={{-20,0},{-20,-40}}),
+        Line(points={{20,0},{20,-40}}),
+        Line(points={{60,0},{60,-40}}),
+        Rectangle(
+          extent={{-100,60},{100,40}},
+          lineColor={28,108,200},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,40},{100,20}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,0}},
+          lineColor={28,108,200},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,60},{-60,20}}),
+        Line(points={{-20,60},{-20,20}}),
+        Line(points={{20,60},{20,20}}),
+        Line(points={{60,60},{60,20}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,0},{100,-20}},
+          lineColor={28,108,200},
+          fillColor=DynamicSelect({170,213,255},
+          if dynamic_energy_balance then {170,213,255}
+          else if diffusion then {213,255,170}
+          else {255,255,170}),
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,-20},{100,-40}},
+          lineColor={28,108,200},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+          lineThickness=0),
+        Line(points={{-60,0},{-60,-40}}),
+        Line(points={{-20,0},{-20,-40}}),
+        Line(points={{20,0},{20,-40}}),
+        Line(points={{60,0},{60,-40}}),
+        Rectangle(
+          extent={{-100,60},{100,40}},
+          lineColor={28,108,200},
+          fillColor=DynamicSelect({170,213,255},
+          if dynamic_energy_balance then {170,213,255}
+          else if diffusion then {213,255,170}
+          else {255,255,170}),
+          fillPattern=FillPattern.Solid,
+          lineThickness=0),
+        Rectangle(
+          extent={{-100,40},{100,20}},
+          lineColor={28,108,200},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid)),
+        Rectangle(
+          extent={{-100,20},{100,0}},
+          lineColor={28,108,200},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,60},{-60,20}}),
+        Line(points={{-20,60},{-20,20}}),
+        Line(points={{20,60},{20,20}}),
+        Line(points={{60,60},{60,20}})}),
+    Window(
+      x=0.16,
+      y=0.07,
+      width=0.71,
+      height=0.85),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DynamicTwoPhaseFlowRiser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo
index 7f296aa8d7c1f6a801ff999c6f33e8faea5c7a47..10ad2761feb6ca17818845b06907f34f18546609 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo
@@ -1,464 +1,464 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicWaterHeater "Dynamic water heater"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
-  //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area";
-  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
-  parameter Units.SI.Length L1=12.5
-    " Length of drowned pipes in liquid (pipes 1)";
-  parameter Units.SI.Length L2=12.5 " Length of Pipe 2 (in steam)";
-  parameter Units.SI.Length L3=25 " Length of Pipe 3 (in steam)";
-  parameter Units.SI.Length Lc=2.5
-    "support plate spacing in cooling zone(chicanes)";
-  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
-  parameter Units.SI.Thickness ec=2.e-3 " Thickness of the cooling pipes";
-  parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter";
-  parameter Units.SI.Length PasL=0.03
-    "Longitudinal step or bottom pipes triangular step";
-  parameter Units.SI.Length PasT=0.03 " Transverse step or pipes step";
-  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
-  parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe";
-  parameter Integer ntubes1=500 "Numbers of drowned pipes in liquid for pipes 1";
-  parameter Integer ntubes2=500 "Numbers of the pipes immersed in steam = NbTub2, for pipes 2";
-  parameter Integer ntubes3=500 "Numbers of the pipes immersed in steam, for pipe 3";
-  parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)";
-  parameter Units.SI.SpecificHeatCapacity cp=460
-    "Specific heat capacity of the metal of the cooling pipes";
-  parameter Units.SI.Density rho=7900
-    "Density of the metal of the cooling pipes";
-  parameter Units.SI.ThermalConductivity lambda=26
-    "Wall thermal conductivity of the cooling pipes";
-  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000 "Heat transfer coefficient between the vapor and the cooling pipes";
-  parameter Real DpfCorr= 1.00 "Corrective terme for friction pressure loss (dpf) in node i";
-  parameter Real COP0v = 1.0 "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side";
-  parameter Real COP0l = 1 "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side";
-  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=true "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true "true: start from steady state - false: start from (P0c, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0c=1.e5
-    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-  Volumes.TwoPhaseCavity WaterHeating(
-    Vf0=Vf0,
-    P0=P0c,
-    Ns=Ns,
-    L2=L2,
-    NbTub1=ntubes1,
-    NbTubV=ntubesV,
-    DIc=DIc,
-    R=Rv,
-    Dext=Dc + 2*ec,
-    COPv=COP0v,
-    COPl=COP0l,
-    Lc=Lc,
-    PasL=PasL,
-    PasT=PasT,
-    L1=L1,
-    L3=L3,
-    NbTub2=ntubes2,
-    NbTub3=ntubes3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    Cal_hconv=true,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    wsftype=wsftype)
-    annotation (                        Placement(transformation(extent={{-100,
-            -100},{100,100}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
-    option_temperature=false,
-    D=Dc,
-    Ns=Ns*2,
-    dpfCorr=DpfCorr,
-    L=L3,
-    ntubes=ntubes3,
-    Q(start=fill(300, Ns*2 + 1)),
-    P(start=fill(200e5, 2*Ns + 2)),
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    inertia=inertia,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    advection=advection)
-    annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet  C1vap "Vapor inlet" annotation (Placement(
-        transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet  C2ex "Condensed water extraction outlet"
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Interfaces.Connectors.FluidInlet  Ce1 "Cooling water inlet" annotation (
-      Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet  Ce2 "Cooling water outlet" annotation (
-      Placement(transformation(extent={{-110,34},{-90,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
-    annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation=
-            0)));
-
-  Interfaces.Connectors.FluidInlet  C1 "Extra water inlet" annotation (
-      Placement(transformation(extent={{-74,82},{-54,102}}, rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    Ns=Ns*2,
-    L=L3,
-    ntubes=ntubes3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state)
-    annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_1(
-    option_temperature=false,
-    D=Dc,
-    Ns=Ns,
-    ntubes=ntubes1,
-    dpfCorr=DpfCorr,
-    Q(start=fill(200, Ns + 1)),
-    L=L1,
-    P(start=fill(200e5, Ns + 2)),
-    dynamic_mass_balance=dynamic_mass_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    inertia=inertia,
-    advection=advection,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    dynamic_energy_balance=dynamic_energy_balance)
-    annotation (Placement(transformation(extent={{-35,-77},{60,-43}}, rotation=
-            0)));
-  Thermal.HeatTransfer.HeatExchangerWall Wall_1(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    Ns=Ns,
-    ntubes=ntubes1,
-    L=L1,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state)
-    annotation (Placement(transformation(extent={{-35,-69},{59,-21}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_2(
-    option_temperature=false,
-    D=Dc,
-    Ns=Ns,
-    dpfCorr=DpfCorr,
-    Q(start=fill(200, Ns + 1)),
-    L=L2,
-    ntubes=ntubes2,
-    P(start=fill(200e5, Ns + 2)),
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    inertia=inertia,
-    advection=advection,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance)
-    annotation (Placement(transformation(extent={{60,11},{-35,45}}, rotation=0)));
-
-  Thermal.HeatTransfer.HeatExchangerWall Wall_2(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    Ns=Ns,
-    L=L2,
-    ntubes=ntubes2,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state)
-    annotation (Placement(transformation(extent={{-35,21},{59,69}}, rotation=0)));
-  Volumes.VolumeC volumeC(
-    h0=890e3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    diffusion=diffusion,
-    dynamic_mass_balance=dynamic_mass_balance,
-    continuous_flow_reversal=continuous_flow_reversal,
-    ftype=ftype)                annotation (Placement(transformation(extent={{
-            -56,35},{-74,53}}, rotation=0)));
-  Volumes.VolumeD volumeD(
-    h0=790e3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    diffusion=diffusion,
-    dynamic_mass_balance=dynamic_mass_balance,
-    continuous_flow_reversal=continuous_flow_reversal,
-    ftype=ftype)   annotation (Placement(transformation(extent={{-74,-54},{-56,
-            -36}}, rotation=0)));
-  Volumes.VolumeD volumeD1(
-    h0=850e3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    diffusion=diffusion,
-    dynamic_mass_balance=dynamic_mass_balance,
-    ftype=ftype)   annotation (Placement(transformation(
-        origin={75,-33},
-        extent={{-9,-9},{9,9}},
-        rotation=90)));
-equation
-
-  if (cardinality(C1) == 1) then
-    C1.Q = 0;
-    C1.h = 1.e5;
-    C1.h_vol_1 = 1.e5;
-    C1.diff_res_1 = 0;
-    C1.diff_on_1 = false;
-    C1.ftype = ftype;
-    C1.Xco2 = 0;
-    C1.Xh2o = 0;
-    C1.Xo2 = 0;
-    C1.Xso2 = 0;
-  end if;
-
-  connect(C1vap, WaterHeating.Cv)
-                                annotation (Line(points={{0,100},{0,73.3333},{
-          1.11111,73.3333}}));
-  connect(WaterHeating.Cl, C2ex)
-                               annotation (Line(points={{1.11111,-73.3333},{
-          1.11111,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}},   color={0,0,255}));
-  connect(C1, WaterHeating.Ce)
-    annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-38.8889,73.3333}}));
-  connect(WaterHeating.yLevel, sortieReelle)
-    annotation (Line(points={{98.8889,-32.6667},{94,-32.6667},{94,-76},{102,-76}}));
-  connect(WaterHeating.Cth2, Wall_2.WT2)
-    annotation (Line(points={{0.555556,50.3333},{0.555556,55.4},{12,55.4},{12,
-          49.8}},
-        color={191,95,0}));
-  connect(Wall_2.WT1, pipe_2.CTh) annotation (Line(points={{12,40.2},{12,33.1},
-          {12.5,33.1}}, color={191,95,0}));
-  connect(WaterHeating.Cth1, Wall_1.WT2)
-                                      annotation (Line(points={{0.555556,-51},{0.555556,
-          -35.5},{12,-35.5},{12,-40.2}},         color={191,95,0}));
-  connect(Wall_1.WT1, pipe_1.CTh) annotation (Line(points={{12,-49.8},{12,-54.4},
-          {12.5,-54.4},{12.5,-54.9}}, color={191,95,0}));
-  connect(WaterHeating.Cth3, Wall_3.WT2)
-                                      annotation (Line(points={{0.555556,2},{0.555556,
-          8.33335},{13,8.33335},{13,4.8}},          color={191,95,0}));
-  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4},
-          {12.5,-10.4},{12.5,-11.9}}, color={191,95,0}));
-  connect(Ce1, volumeD.Ce)
-    annotation (Line(points={{-100,-45},{-74,-45}}, thickness=1));
-  connect(volumeD.Cs2, pipe_1.C1) annotation (Line(
-      points={{-65,-54},{-65,-60},{-35,-60}},
-      color={0,0,255},
-      thickness=1));
-  connect(pipe_3.C2, volumeC.Ce3) annotation (Line(
-      points={{60,-17},{70,-17},{70,20},{-65,20},{-65,35}},
-      color={95,95,95},
-      thickness=1));
-  connect(pipe_2.C2, volumeC.Ce1) annotation (Line(
-      points={{-35,28},{-46,28},{-46,44},{-56,44}},
-      color={0,0,255},
-      thickness=1));
-  connect(volumeD.Cs1, pipe_3.C1) annotation (Line(
-      points={{-65,-36},{-66,-36},{-66,-17},{-35,-17}},
-      color={95,95,95},
-      thickness=1));
-  connect(Ce2, volumeC.Cs) annotation (Line(
-      points={{-100,44},{-74,44}},
-      color={95,95,95},
-      thickness=1));
-  connect(volumeD1.Ce, pipe_1.C2) annotation (Line(
-      points={{75,-42},{68,-42},{68,-60},{60,-60}},
-      color={0,0,255},
-      thickness=1));
-  connect(volumeD1.Cs3, pipe_2.C1) annotation (Line(
-      points={{75,-24},{76,-24},{76,28},{60,28}},
-      color={0,0,255},
-      thickness=1));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-116,-56},{-90,-72}},
-          lineColor={0,0,255},
-          textString="Inlet"),
-        Text(
-          extent={{-110,67},{-86,53}},
-          lineColor={0,0,255},
-          textString="Outlet"),
-        Text(
-          extent={{16,102},{44,87}},
-          lineColor={0,0,255},
-          textString=
-               "Steam")}),
-                       Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-100,0},{-74,-90}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{60,-8},{0,-14}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,14},{-74,8}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{60,14},{16,8}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{60,-90},{-100,-90}},
-          color={0,0,255},
-          thickness=0),
-        Line(
-          points={{60,90},{-100,90}},
-          color={0,0,255},
-          thickness=0),
-        Line(
-          points={{-100,0},{76,0}},
-          color={0,0,255}),
-        Rectangle(
-          extent={{-74,-52},{60,-90}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,90},{-74,0}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-8},{-74,-14}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-30},{-74,-36}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-54},{-74,-60}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,36},{-74,30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,60},{-74,54}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{
-              94,-40},{84,-60},{70,-80},{60,-90},{60,90}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid)),
-        Rectangle(
-          extent={{66,14},{60,-14}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{70,36},{16,30}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{78,60},{16,54}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{74,-30},{16,-36}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}},
-          lineColor={255,170,170},
-          lineThickness=0.5,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-76},{72,-76}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0),
-        Rectangle(
-          extent={{74,36},{68,-36}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{82,60},{76,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{76,-54},{16,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-68},{78,-68}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0),
-        Line(
-          points={{-74,-58},{84,-58}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0),
-        Text(
-          extent={{-132,-18},{-104,-32}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water inlet"),
-        Text(
-          extent={{-132,72},{-106,58}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water outlet")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.5.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end DynamicWaterHeater;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicWaterHeater "Dynamic water heater"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
+  //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area";
+  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
+  parameter Units.SI.Length L1=12.5
+    " Length of drowned pipes in liquid (pipes 1)";
+  parameter Units.SI.Length L2=12.5 " Length of Pipe 2 (in steam)";
+  parameter Units.SI.Length L3=25 " Length of Pipe 3 (in steam)";
+  parameter Units.SI.Length Lc=2.5
+    "support plate spacing in cooling zone(chicanes)";
+  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
+  parameter Units.SI.Thickness ec=2.e-3 " Thickness of the cooling pipes";
+  parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter";
+  parameter Units.SI.Length PasL=0.03
+    "Longitudinal step or bottom pipes triangular step";
+  parameter Units.SI.Length PasT=0.03 " Transverse step or pipes step";
+  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
+  parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe";
+  parameter Integer ntubes1=500 "Numbers of drowned pipes in liquid for pipes 1";
+  parameter Integer ntubes2=500 "Numbers of the pipes immersed in steam = NbTub2, for pipes 2";
+  parameter Integer ntubes3=500 "Numbers of the pipes immersed in steam, for pipe 3";
+  parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)";
+  parameter Units.SI.SpecificHeatCapacity cp=460
+    "Specific heat capacity of the metal of the cooling pipes";
+  parameter Units.SI.Density rho=7900
+    "Density of the metal of the cooling pipes";
+  parameter Units.SI.ThermalConductivity lambda=26
+    "Wall thermal conductivity of the cooling pipes";
+  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000 "Heat transfer coefficient between the vapor and the cooling pipes";
+  parameter Real DpfCorr= 1.00 "Corrective terme for friction pressure loss (dpf) in node i";
+  parameter Real COP0v = 1.0 "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side";
+  parameter Real COP0l = 1 "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side";
+  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=true "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true "true: start from steady state - false: start from (P0c, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0c=1.e5
+    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+  Volumes.TwoPhaseCavity WaterHeating(
+    Vf0=Vf0,
+    P0=P0c,
+    Ns=Ns,
+    L2=L2,
+    NbTub1=ntubes1,
+    NbTubV=ntubesV,
+    DIc=DIc,
+    R=Rv,
+    Dext=Dc + 2*ec,
+    COPv=COP0v,
+    COPl=COP0l,
+    Lc=Lc,
+    PasL=PasL,
+    PasT=PasT,
+    L1=L1,
+    L3=L3,
+    NbTub2=ntubes2,
+    NbTub3=ntubes3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    Cal_hconv=true,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    wsftype=wsftype)
+    annotation (                        Placement(transformation(extent={{-100,
+            -100},{100,100}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
+    option_temperature=false,
+    D=Dc,
+    Ns=Ns*2,
+    dpfCorr=DpfCorr,
+    L=L3,
+    ntubes=ntubes3,
+    Q(start=fill(300, Ns*2 + 1)),
+    P(start=fill(200e5, 2*Ns + 2)),
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    inertia=inertia,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    advection=advection)
+    annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet  C1vap "Vapor inlet" annotation (Placement(
+        transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet  C2ex "Condensed water extraction outlet"
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Interfaces.Connectors.FluidInlet  Ce1 "Cooling water inlet" annotation (
+      Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet  Ce2 "Cooling water outlet" annotation (
+      Placement(transformation(extent={{-110,34},{-90,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
+    annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation=
+            0)));
+
+  Interfaces.Connectors.FluidInlet  C1 "Extra water inlet" annotation (
+      Placement(transformation(extent={{-74,82},{-54,102}}, rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    Ns=Ns*2,
+    L=L3,
+    ntubes=ntubes3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state)
+    annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_1(
+    option_temperature=false,
+    D=Dc,
+    Ns=Ns,
+    ntubes=ntubes1,
+    dpfCorr=DpfCorr,
+    Q(start=fill(200, Ns + 1)),
+    L=L1,
+    P(start=fill(200e5, Ns + 2)),
+    dynamic_mass_balance=dynamic_mass_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    inertia=inertia,
+    advection=advection,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    dynamic_energy_balance=dynamic_energy_balance)
+    annotation (Placement(transformation(extent={{-35,-77},{60,-43}}, rotation=
+            0)));
+  Thermal.HeatTransfer.HeatExchangerWall Wall_1(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    Ns=Ns,
+    ntubes=ntubes1,
+    L=L1,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state)
+    annotation (Placement(transformation(extent={{-35,-69},{59,-21}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_2(
+    option_temperature=false,
+    D=Dc,
+    Ns=Ns,
+    dpfCorr=DpfCorr,
+    Q(start=fill(200, Ns + 1)),
+    L=L2,
+    ntubes=ntubes2,
+    P(start=fill(200e5, Ns + 2)),
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    inertia=inertia,
+    advection=advection,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance)
+    annotation (Placement(transformation(extent={{60,11},{-35,45}}, rotation=0)));
+
+  Thermal.HeatTransfer.HeatExchangerWall Wall_2(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    Ns=Ns,
+    L=L2,
+    ntubes=ntubes2,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state)
+    annotation (Placement(transformation(extent={{-35,21},{59,69}}, rotation=0)));
+  Volumes.VolumeC volumeC(
+    h0=890e3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    diffusion=diffusion,
+    dynamic_mass_balance=dynamic_mass_balance,
+    continuous_flow_reversal=continuous_flow_reversal,
+    ftype=ftype)                annotation (Placement(transformation(extent={{
+            -56,35},{-74,53}}, rotation=0)));
+  Volumes.VolumeD volumeD(
+    h0=790e3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    diffusion=diffusion,
+    dynamic_mass_balance=dynamic_mass_balance,
+    continuous_flow_reversal=continuous_flow_reversal,
+    ftype=ftype)   annotation (Placement(transformation(extent={{-74,-54},{-56,
+            -36}}, rotation=0)));
+  Volumes.VolumeD volumeD1(
+    h0=850e3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    diffusion=diffusion,
+    dynamic_mass_balance=dynamic_mass_balance,
+    ftype=ftype)   annotation (Placement(transformation(
+        origin={75,-33},
+        extent={{-9,-9},{9,9}},
+        rotation=90)));
+equation
+
+  if (cardinality(C1) == 1) then
+    C1.Q = 0;
+    C1.h = 1.e5;
+    C1.h_vol_1 = 1.e5;
+    C1.diff_res_1 = 0;
+    C1.diff_on_1 = false;
+    C1.ftype = ftype;
+    C1.Xco2 = 0;
+    C1.Xh2o = 0;
+    C1.Xo2 = 0;
+    C1.Xso2 = 0;
+  end if;
+
+  connect(C1vap, WaterHeating.Cv)
+                                annotation (Line(points={{0,100},{0,73.3333},{
+          1.11111,73.3333}}));
+  connect(WaterHeating.Cl, C2ex)
+                               annotation (Line(points={{1.11111,-73.3333},{
+          1.11111,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}},   color={0,0,255}));
+  connect(C1, WaterHeating.Ce)
+    annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-38.8889,73.3333}}));
+  connect(WaterHeating.yLevel, sortieReelle)
+    annotation (Line(points={{98.8889,-32.6667},{94,-32.6667},{94,-76},{102,-76}}));
+  connect(WaterHeating.Cth2, Wall_2.WT2)
+    annotation (Line(points={{0.555556,50.3333},{0.555556,55.4},{12,55.4},{12,
+          49.8}},
+        color={191,95,0}));
+  connect(Wall_2.WT1, pipe_2.CTh) annotation (Line(points={{12,40.2},{12,33.1},
+          {12.5,33.1}}, color={191,95,0}));
+  connect(WaterHeating.Cth1, Wall_1.WT2)
+                                      annotation (Line(points={{0.555556,-51},{0.555556,
+          -35.5},{12,-35.5},{12,-40.2}},         color={191,95,0}));
+  connect(Wall_1.WT1, pipe_1.CTh) annotation (Line(points={{12,-49.8},{12,-54.4},
+          {12.5,-54.4},{12.5,-54.9}}, color={191,95,0}));
+  connect(WaterHeating.Cth3, Wall_3.WT2)
+                                      annotation (Line(points={{0.555556,2},{0.555556,
+          8.33335},{13,8.33335},{13,4.8}},          color={191,95,0}));
+  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4},
+          {12.5,-10.4},{12.5,-11.9}}, color={191,95,0}));
+  connect(Ce1, volumeD.Ce)
+    annotation (Line(points={{-100,-45},{-74,-45}}, thickness=1));
+  connect(volumeD.Cs2, pipe_1.C1) annotation (Line(
+      points={{-65,-54},{-65,-60},{-35,-60}},
+      color={0,0,255},
+      thickness=1));
+  connect(pipe_3.C2, volumeC.Ce3) annotation (Line(
+      points={{60,-17},{70,-17},{70,20},{-65,20},{-65,35}},
+      color={95,95,95},
+      thickness=1));
+  connect(pipe_2.C2, volumeC.Ce1) annotation (Line(
+      points={{-35,28},{-46,28},{-46,44},{-56,44}},
+      color={0,0,255},
+      thickness=1));
+  connect(volumeD.Cs1, pipe_3.C1) annotation (Line(
+      points={{-65,-36},{-66,-36},{-66,-17},{-35,-17}},
+      color={95,95,95},
+      thickness=1));
+  connect(Ce2, volumeC.Cs) annotation (Line(
+      points={{-100,44},{-74,44}},
+      color={95,95,95},
+      thickness=1));
+  connect(volumeD1.Ce, pipe_1.C2) annotation (Line(
+      points={{75,-42},{68,-42},{68,-60},{60,-60}},
+      color={0,0,255},
+      thickness=1));
+  connect(volumeD1.Cs3, pipe_2.C1) annotation (Line(
+      points={{75,-24},{76,-24},{76,28},{60,28}},
+      color={0,0,255},
+      thickness=1));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-116,-56},{-90,-72}},
+          lineColor={0,0,255},
+          textString="Inlet"),
+        Text(
+          extent={{-110,67},{-86,53}},
+          lineColor={0,0,255},
+          textString="Outlet"),
+        Text(
+          extent={{16,102},{44,87}},
+          lineColor={0,0,255},
+          textString=
+               "Steam")}),
+                       Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-100,0},{-74,-90}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{60,-8},{0,-14}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,14},{-74,8}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{60,14},{16,8}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{60,-90},{-100,-90}},
+          color={0,0,255},
+          thickness=0),
+        Line(
+          points={{60,90},{-100,90}},
+          color={0,0,255},
+          thickness=0),
+        Line(
+          points={{-100,0},{76,0}},
+          color={0,0,255}),
+        Rectangle(
+          extent={{-74,-52},{60,-90}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,90},{-74,0}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-8},{-74,-14}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-30},{-74,-36}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-54},{-74,-60}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,36},{-74,30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,60},{-74,54}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{
+              94,-40},{84,-60},{70,-80},{60,-90},{60,90}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid)),
+        Rectangle(
+          extent={{66,14},{60,-14}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{70,36},{16,30}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{78,60},{16,54}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{74,-30},{16,-36}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}},
+          lineColor={255,170,170},
+          lineThickness=0.5,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-76},{72,-76}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0),
+        Rectangle(
+          extent={{74,36},{68,-36}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{82,60},{76,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{76,-54},{16,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-68},{78,-68}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0),
+        Line(
+          points={{-74,-58},{84,-58}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0),
+        Text(
+          extent={{-132,-18},{-104,-32}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water inlet"),
+        Text(
+          extent={{-132,72},{-106,58}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water outlet")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.5.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end DynamicWaterHeater;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo
index 174e8c7eaf51d2b34a88ed7f33bee5f71cf06e3c..c8c7d21629c10446871a0b75c868df86024e4980 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo
@@ -1,370 +1,370 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicWaterHeaterOnePipe "Dynamic water heater"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
-  //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area";
-  parameter Units.SI.Radius Rv=1.0 "Radius of the cavity cross-sectional area";
-  parameter Units.SI.Length L1=12.5
-    "Length of drowned pipes in liquid (pipes 1)";
-  parameter Units.SI.Length L2=12.5 "Length of Pipe 2 (in steam)";
-  parameter Units.SI.Length L3=25 "Length of Pipe 3 (in steam)";
-  parameter Units.SI.Length Lc=2.5
-    "Support plate spacing in cooling zone(chicanes)";
-  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
-  parameter Units.SI.Thickness ec=2.e-3 "Thickness of the cooling pipes";
-  parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter";
-  parameter Units.SI.Length PasL=0.03
-    "Longitudianl step or Length bottom pipes triangular step";
-  parameter Units.SI.Length PasT=0.03 "Transverse step or pipes step";
-  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
-  parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe)";
-  parameter Integer ntubes1=500 "Numbers of drowned pipes in liquid for pipes 1";
-  parameter Integer ntubes2=500 "Numbers of the pipes immersed in steam = NbTub2, for pipes 2";
-  parameter Integer ntubes3=500 "Numbers of the pipes immersed in steam, for pipe 3";
-  parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)";
-  parameter Units.SI.SpecificHeatCapacity cp=460
-    "Specific heat capacity of the metal of the cooling pipes";
-  parameter Units.SI.Density rho=7900
-    "Density of the metal of the cooling pipes";
-  parameter Units.SI.ThermalConductivity lambda=26
-    "Wall thermal conductivity of the cooling pipes";
-  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000 "Heat transfer coefficient between the vapor and the cooling pipes";
-  parameter Real DpfCorr=1.00 "Corrective terme for friction pressure loss (dpf) in node i";
-  parameter Real COP0v=1.0 "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side";
-  parameter Real COP0l=1 "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side";
-  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=true "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true "true: start from steady state - false: start from (Vf0, P0c, T0 or h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0c=1.e5
-    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Units.SI.Temperature T0[2*Ns]=fill(290, 2*Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state and option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0[2*Ns]=fill(1e5, 2*Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state and not option_temperature));
-  parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-  Volumes.TwoPhaseCavity WaterHeating(
-    Vf0=Vf0,
-    P0=P0c,
-    Ns=Ns,
-    L2=L2,
-    NbTub1=ntubes1,
-    NbTubV=ntubesV,
-    DIc=DIc,
-    R=Rv,
-    Dext=Dc + 2*ec,
-    COPv=COP0v,
-    COPl=COP0l,
-    Lc=Lc,
-    PasL=PasL,
-    PasT=PasT,
-    L1=L1,
-    L3=L3,
-    NbTub2=ntubes2,
-    NbTub3=ntubes3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    wsftype=wsftype)
-    annotation (                        Placement(transformation(extent={{-100,
-            -100},{100,100}}, rotation=0)));
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
-    D=Dc,
-    Ns=Ns*2,
-    dpfCorr=DpfCorr,
-    L=L3,
-    ntubes=ntubes3,
-    Q(start=fill(300, Ns*2 + 1)),
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    h0=h0,
-    T0=T0,
-    option_temperature=option_temperature,
-    P0=P0c)
-    annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet C1vap "Vapor inlet" annotation (Placement(
-        transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet C2ex "Condensed water extraction outlet"
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Interfaces.Connectors.FluidInlet Ce1 "Cooling water inlet" annotation (
-      Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Ce2 "Cooling water outlet" annotation (
-      Placement(transformation(extent={{-110,34},{-90,54}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
-    annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation=
-            0)));
-
-  Interfaces.Connectors.FluidInlet C1 "Extra water inlet" annotation (
-      Placement(transformation(extent={{-74,82},{-54,102}}, rotation=0)));
-  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    Ns=Ns*2,
-    L=L3,
-    ntubes=ntubes3,
-    steady_state=steady_state,
-    dynamic_energy_balance=dynamic_energy_balance)
-    annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0)));
-
-  Volumes.VolumeD volumeD(
-    h0=790e3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    diffusion=diffusion,
-    dynamic_mass_balance=dynamic_mass_balance,
-    continuous_flow_reversal=continuous_flow_reversal,
-    ftype=ftype)   annotation (Placement(transformation(extent={{-72,-54},{-54,-36}},
-                   rotation=0)));
-  Volumes.VolumeC volumeC(
-    h0=890e3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    steady_state=steady_state,
-    diffusion=diffusion,
-    continuous_flow_reversal=continuous_flow_reversal,
-    ftype=ftype)                annotation (Placement(transformation(extent={{-52,35},
-            {-70,53}},         rotation=0)));
-equation
-  if (cardinality(C1) == 1) then
-    C1.Q = 0;
-    C1.h = 1.e5;
-    C1.h_vol_1 = 1.e5;
-    C1.diff_res_1 = 0;
-    C1.diff_on_1 = false;
-    C1.ftype = ftype;
-    C1.Xco2 = 0;
-    C1.Xh2o = 0;
-    C1.Xo2 = 0;
-    C1.Xso2 = 0;
-  end if;
-
-  connect(C1vap, WaterHeating.Cv)
-                                annotation (Line(points={{0,100},{0,73.3333},{
-          1.11111,73.3333}}));
-  connect(WaterHeating.Cl, C2ex)
-                               annotation (Line(points={{1.11111,-73.3333},{
-          1.11111,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}},   color={0,0,255}));
-  connect(C1, WaterHeating.Ce)
-    annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-38.8889,73.3333}}));
-  connect(WaterHeating.yLevel, sortieReelle)
-    annotation (Line(points={{98.8889,-32.6667},{94,-32.6667},{94,-76},{102,-76}}));
-  connect(WaterHeating.Cth3, Wall_3.WT2)
-                                      annotation (Line(points={{0.555556,2},{0.555556,
-          8.33335},{13,8.33335},{13,4.8}},          color={191,95,0}));
-  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4},
-          {12.5,-10.4},{12.5,-11.9}}, color={191,95,0}));
-  connect(Ce1, volumeD.Ce)
-    annotation (Line(points={{-100,-45},{-72,-45}}, color={0,0,0}));
-  connect(volumeD.Cs1, pipe_3.C1) annotation (Line(points={{-63,-36},{-64,-36},{
-          -64,-17},{-35,-17}}, color={0,0,0}));
-  connect(pipe_3.C2, volumeC.Ce1) annotation (Line(points={{60,-17},{78,-17},{78,
-          44},{-52,44}}, color={0,0,0}));
-  connect(volumeC.Cs, Ce2)
-    annotation (Line(points={{-70,44},{-100,44}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-116,-56},{-90,-72}},
-          lineColor={0,0,255},
-          textString="Inlet"),
-        Text(
-          extent={{-110,67},{-86,53}},
-          lineColor={0,0,255},
-          textString="Outlet"),
-        Text(
-          extent={{16,102},{44,87}},
-          lineColor={0,0,255},
-          textString=
-               "Steam")}),
-                       Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-100,0},{-74,-90}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{60,-8},{0,-14}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,14},{-74,8}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{60,14},{16,8}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{60,-90},{-100,-90}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{60,90},{-100,90}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-100,0},{76,0}},
-          color={0,0,255},
-          thickness=0.5),
-        Rectangle(
-          extent={{-74,-52},{60,-90}},
-          lineColor={0,0,255},
-          lineThickness=0,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,90},{-74,0}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-8},{-74,-14}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-30},{-74,-36}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-54},{-74,-60}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,36},{-74,30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,60},{-74,54}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{
-              94,-40},{84,-60},{70,-80},{60,-90},{60,90}},
-          lineColor={0,0,255},
-          lineThickness=0,
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid)),
-        Rectangle(
-          extent={{66,14},{60,-14}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{70,36},{16,30}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{78,60},{16,54}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{74,-30},{16,-36}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}},
-          lineColor={255,170,170},
-          lineThickness=0,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-76},{72,-76}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0.5),
-        Rectangle(
-          extent={{74,36},{68,-36}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{82,60},{76,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{76,-54},{16,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-68},{78,-68}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0.5),
-        Line(
-          points={{-74,-58},{84,-58}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0.5),
-        Text(
-          extent={{-132,72},{-106,58}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water outlet"),
-        Text(
-          extent={{-132,-18},{-104,-32}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water inlet")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end DynamicWaterHeaterOnePipe;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicWaterHeaterOnePipe "Dynamic water heater"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
+  //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area";
+  parameter Units.SI.Radius Rv=1.0 "Radius of the cavity cross-sectional area";
+  parameter Units.SI.Length L1=12.5
+    "Length of drowned pipes in liquid (pipes 1)";
+  parameter Units.SI.Length L2=12.5 "Length of Pipe 2 (in steam)";
+  parameter Units.SI.Length L3=25 "Length of Pipe 3 (in steam)";
+  parameter Units.SI.Length Lc=2.5
+    "Support plate spacing in cooling zone(chicanes)";
+  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
+  parameter Units.SI.Thickness ec=2.e-3 "Thickness of the cooling pipes";
+  parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter";
+  parameter Units.SI.Length PasL=0.03
+    "Longitudianl step or Length bottom pipes triangular step";
+  parameter Units.SI.Length PasT=0.03 "Transverse step or pipes step";
+  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
+  parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe)";
+  parameter Integer ntubes1=500 "Numbers of drowned pipes in liquid for pipes 1";
+  parameter Integer ntubes2=500 "Numbers of the pipes immersed in steam = NbTub2, for pipes 2";
+  parameter Integer ntubes3=500 "Numbers of the pipes immersed in steam, for pipe 3";
+  parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)";
+  parameter Units.SI.SpecificHeatCapacity cp=460
+    "Specific heat capacity of the metal of the cooling pipes";
+  parameter Units.SI.Density rho=7900
+    "Density of the metal of the cooling pipes";
+  parameter Units.SI.ThermalConductivity lambda=26
+    "Wall thermal conductivity of the cooling pipes";
+  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000 "Heat transfer coefficient between the vapor and the cooling pipes";
+  parameter Real DpfCorr=1.00 "Corrective terme for friction pressure loss (dpf) in node i";
+  parameter Real COP0v=1.0 "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side";
+  parameter Real COP0l=1 "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side";
+  parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=true "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true "true: start from steady state - false: start from (Vf0, P0c, T0 or h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0c=1.e5
+    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Units.SI.Temperature T0[2*Ns]=fill(290, 2*Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state and option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0[2*Ns]=fill(1e5, 2*Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state and not option_temperature));
+  parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+  Volumes.TwoPhaseCavity WaterHeating(
+    Vf0=Vf0,
+    P0=P0c,
+    Ns=Ns,
+    L2=L2,
+    NbTub1=ntubes1,
+    NbTubV=ntubesV,
+    DIc=DIc,
+    R=Rv,
+    Dext=Dc + 2*ec,
+    COPv=COP0v,
+    COPl=COP0l,
+    Lc=Lc,
+    PasL=PasL,
+    PasT=PasT,
+    L1=L1,
+    L3=L3,
+    NbTub2=ntubes2,
+    NbTub3=ntubes3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    wsftype=wsftype)
+    annotation (                        Placement(transformation(extent={{-100,
+            -100},{100,100}}, rotation=0)));
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
+    D=Dc,
+    Ns=Ns*2,
+    dpfCorr=DpfCorr,
+    L=L3,
+    ntubes=ntubes3,
+    Q(start=fill(300, Ns*2 + 1)),
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    h0=h0,
+    T0=T0,
+    option_temperature=option_temperature,
+    P0=P0c)
+    annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet C1vap "Vapor inlet" annotation (Placement(
+        transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet C2ex "Condensed water extraction outlet"
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Interfaces.Connectors.FluidInlet Ce1 "Cooling water inlet" annotation (
+      Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Ce2 "Cooling water outlet" annotation (
+      Placement(transformation(extent={{-110,34},{-90,54}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
+    annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation=
+            0)));
+
+  Interfaces.Connectors.FluidInlet C1 "Extra water inlet" annotation (
+      Placement(transformation(extent={{-74,82},{-54,102}}, rotation=0)));
+  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    Ns=Ns*2,
+    L=L3,
+    ntubes=ntubes3,
+    steady_state=steady_state,
+    dynamic_energy_balance=dynamic_energy_balance)
+    annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0)));
+
+  Volumes.VolumeD volumeD(
+    h0=790e3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    diffusion=diffusion,
+    dynamic_mass_balance=dynamic_mass_balance,
+    continuous_flow_reversal=continuous_flow_reversal,
+    ftype=ftype)   annotation (Placement(transformation(extent={{-72,-54},{-54,-36}},
+                   rotation=0)));
+  Volumes.VolumeC volumeC(
+    h0=890e3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    steady_state=steady_state,
+    diffusion=diffusion,
+    continuous_flow_reversal=continuous_flow_reversal,
+    ftype=ftype)                annotation (Placement(transformation(extent={{-52,35},
+            {-70,53}},         rotation=0)));
+equation
+  if (cardinality(C1) == 1) then
+    C1.Q = 0;
+    C1.h = 1.e5;
+    C1.h_vol_1 = 1.e5;
+    C1.diff_res_1 = 0;
+    C1.diff_on_1 = false;
+    C1.ftype = ftype;
+    C1.Xco2 = 0;
+    C1.Xh2o = 0;
+    C1.Xo2 = 0;
+    C1.Xso2 = 0;
+  end if;
+
+  connect(C1vap, WaterHeating.Cv)
+                                annotation (Line(points={{0,100},{0,73.3333},{
+          1.11111,73.3333}}));
+  connect(WaterHeating.Cl, C2ex)
+                               annotation (Line(points={{1.11111,-73.3333},{
+          1.11111,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}},   color={0,0,255}));
+  connect(C1, WaterHeating.Ce)
+    annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-38.8889,73.3333}}));
+  connect(WaterHeating.yLevel, sortieReelle)
+    annotation (Line(points={{98.8889,-32.6667},{94,-32.6667},{94,-76},{102,-76}}));
+  connect(WaterHeating.Cth3, Wall_3.WT2)
+                                      annotation (Line(points={{0.555556,2},{0.555556,
+          8.33335},{13,8.33335},{13,4.8}},          color={191,95,0}));
+  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4},
+          {12.5,-10.4},{12.5,-11.9}}, color={191,95,0}));
+  connect(Ce1, volumeD.Ce)
+    annotation (Line(points={{-100,-45},{-72,-45}}, color={0,0,0}));
+  connect(volumeD.Cs1, pipe_3.C1) annotation (Line(points={{-63,-36},{-64,-36},{
+          -64,-17},{-35,-17}}, color={0,0,0}));
+  connect(pipe_3.C2, volumeC.Ce1) annotation (Line(points={{60,-17},{78,-17},{78,
+          44},{-52,44}}, color={0,0,0}));
+  connect(volumeC.Cs, Ce2)
+    annotation (Line(points={{-70,44},{-100,44}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-116,-56},{-90,-72}},
+          lineColor={0,0,255},
+          textString="Inlet"),
+        Text(
+          extent={{-110,67},{-86,53}},
+          lineColor={0,0,255},
+          textString="Outlet"),
+        Text(
+          extent={{16,102},{44,87}},
+          lineColor={0,0,255},
+          textString=
+               "Steam")}),
+                       Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-100,0},{-74,-90}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{60,-8},{0,-14}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,14},{-74,8}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{60,14},{16,8}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{60,-90},{-100,-90}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{60,90},{-100,90}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-100,0},{76,0}},
+          color={0,0,255},
+          thickness=0.5),
+        Rectangle(
+          extent={{-74,-52},{60,-90}},
+          lineColor={0,0,255},
+          lineThickness=0,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,90},{-74,0}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-8},{-74,-14}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-30},{-74,-36}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-54},{-74,-60}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,36},{-74,30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,60},{-74,54}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{
+              94,-40},{84,-60},{70,-80},{60,-90},{60,90}},
+          lineColor={0,0,255},
+          lineThickness=0,
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid)),
+        Rectangle(
+          extent={{66,14},{60,-14}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{70,36},{16,30}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{78,60},{16,54}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{74,-30},{16,-36}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}},
+          lineColor={255,170,170},
+          lineThickness=0,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-76},{72,-76}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0.5),
+        Rectangle(
+          extent={{74,36},{68,-36}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{82,60},{76,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{76,-54},{16,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-68},{78,-68}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0.5),
+        Line(
+          points={{-74,-58},{84,-58}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0.5),
+        Text(
+          extent={{-132,72},{-106,58}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water outlet"),
+        Text(
+          extent={{-132,-18},{-104,-32}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water inlet")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end DynamicWaterHeaterOnePipe;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo
index 122ebf250712875ba41ad0164630ec4491b574b5..d923a62016848b6930c0b44048e86975e5dac107 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo
@@ -1,214 +1,214 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model DynamicWaterSteamMultiFluidsHeatExchanger "Dynamic water/steam heat exchanger"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Length L=1 "Exchanger length";
-  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
-  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
-  parameter Integer Ns=1 "Numver of segments";
-  parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
-  parameter Units.SI.Diameter Dext=0.11 "Pipe external diameter";
-  parameter Integer Ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.AbsolutePressure P0=1.e5
-    "Fluid initial pressure (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and
-          option_temperature));
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state and not
-          option_temperature));
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean option_temperature=true
-    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  Fluid.HeatExchangers.DynamicOnePhaseFlowPipe ExchangerMultiFluids(
-    Ns=Ns,
-    L=L,
-    ntubes=Ntubes,
-    D=Dext,
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    P0=P0,
-    T0=T0,
-    h0=h0)  annotation (Placement(transformation(extent={{-10,30},{10,10}},
-          rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
-    L=L,
-    D=Dint,
-    Ns=Ns,
-    ntubes=Ntubes,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    T0=T0[1])                            annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe(
-    L=L,
-    D=Dint,
-    ntubes=Ntubes,
-    Ns=Ns,
-    z1=z1,
-    z2=z2,
-    T0=T0,
-    h0=h0,
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    diffusion=diffusion,
-    continuous_flow_reversal=continuous_flow_reversal)
-    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
-            0)));
-  Interfaces.Connectors.FluidInlet Cfg1 annotation (Placement(transformation(
-          extent={{-10,40},{10,60}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cfg2 annotation (Placement(transformation(
-          extent={{-10,-60},{10,-40}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Cws1 annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cws2 annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-equation
-  connect(Cws2, TwoPhaseFlowPipe.C2)
-                                   annotation (Line(
-      points={{100,0},{40,0},{40,-20},{10,-20}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Cws1, TwoPhaseFlowPipe.C1)
-    annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}}, thickness=
-          0.5));
-  connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh)
-    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
-  connect(ExchangerMultiFluids.CTh, ExchangerWall.WT2)
-    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
-  connect(ExchangerMultiFluids.C2, Cfg2) annotation (Line(
-      points={{10,20},{32,20},{32,-50},{0,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerMultiFluids.C1, Cfg1) annotation (Line(
-      points={{-10,20},{-26,20},{-26,50},{0,50}},
-      color={0,0,0},
-      thickness=1));
-  annotation (         Icon(graphics={
-        Rectangle(
-          extent={{-100,50},{100,-50}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-          fillColor={255,127,0}),
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={0,0,0},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Rectangle(
-          extent={{-100,0},{100,-20}},
-          lineColor={0,0,255},
-          lineThickness=0,
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,50},{-60,-50}}),
-        Line(points={{-20,50},{-20,-50}}),
-        Line(points={{20,50},{20,-50}}),
-        Line(points={{60,50},{60,-50}})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"),
-    Diagram(graphics={
-        Text(
-          extent={{-14,76},{14,60}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Fluid2 inlet"),
-        Text(
-          extent={{-16,-56},{18,-78}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Fluid2 outlet"),
-        Text(
-          extent={{-146,40},{-102,8}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water/steam inlet"),
-        Text(
-          extent={{-146,0},{-104,-34}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Fluid1 inlet
-Two-phase flow"),
-        Text(
-          extent={{104,26},{152,16}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water/steam outlet"),
-        Text(
-          extent={{106,-4},{140,-32}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Fluid1 outlet")}));
-end DynamicWaterSteamMultiFluidsHeatExchanger;
+within ThermoSysPro.Fluid.HeatExchangers;
+model DynamicWaterSteamMultiFluidsHeatExchanger "Dynamic water/steam heat exchanger"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Length L=1 "Exchanger length";
+  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
+  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
+  parameter Integer Ns=1 "Numver of segments";
+  parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
+  parameter Units.SI.Diameter Dext=0.11 "Pipe external diameter";
+  parameter Integer Ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.AbsolutePressure P0=1.e5
+    "Fluid initial pressure (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature=true)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and
+          option_temperature));
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state and not
+          option_temperature));
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean option_temperature=true
+    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  Fluid.HeatExchangers.DynamicOnePhaseFlowPipe ExchangerMultiFluids(
+    Ns=Ns,
+    L=L,
+    ntubes=Ntubes,
+    D=Dext,
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    P0=P0,
+    T0=T0,
+    h0=h0)  annotation (Placement(transformation(extent={{-10,30},{10,10}},
+          rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
+    L=L,
+    D=Dint,
+    Ns=Ns,
+    ntubes=Ntubes,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    T0=T0[1])                            annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe(
+    L=L,
+    D=Dint,
+    ntubes=Ntubes,
+    Ns=Ns,
+    z1=z1,
+    z2=z2,
+    T0=T0,
+    h0=h0,
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    diffusion=diffusion,
+    continuous_flow_reversal=continuous_flow_reversal)
+    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
+            0)));
+  Interfaces.Connectors.FluidInlet Cfg1 annotation (Placement(transformation(
+          extent={{-10,40},{10,60}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cfg2 annotation (Placement(transformation(
+          extent={{-10,-60},{10,-40}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Cws1 annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cws2 annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+equation
+  connect(Cws2, TwoPhaseFlowPipe.C2)
+                                   annotation (Line(
+      points={{100,0},{40,0},{40,-20},{10,-20}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Cws1, TwoPhaseFlowPipe.C1)
+    annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}}, thickness=
+          0.5));
+  connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh)
+    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
+  connect(ExchangerMultiFluids.CTh, ExchangerWall.WT2)
+    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
+  connect(ExchangerMultiFluids.C2, Cfg2) annotation (Line(
+      points={{10,20},{32,20},{32,-50},{0,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerMultiFluids.C1, Cfg1) annotation (Line(
+      points={{-10,20},{-26,20},{-26,50},{0,50}},
+      color={0,0,0},
+      thickness=1));
+  annotation (         Icon(graphics={
+        Rectangle(
+          extent={{-100,50},{100,-50}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+          fillColor={255,127,0}),
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={0,0,0},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Rectangle(
+          extent={{-100,0},{100,-20}},
+          lineColor={0,0,255},
+          lineThickness=0,
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,50},{-60,-50}}),
+        Line(points={{-20,50},{-20,-50}}),
+        Line(points={{20,50},{20,-50}}),
+        Line(points={{60,50},{60,-50}})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"),
+    Diagram(graphics={
+        Text(
+          extent={{-14,76},{14,60}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Fluid2 inlet"),
+        Text(
+          extent={{-16,-56},{18,-78}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Fluid2 outlet"),
+        Text(
+          extent={{-146,40},{-102,8}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water/steam inlet"),
+        Text(
+          extent={{-146,0},{-104,-34}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Fluid1 inlet
+Two-phase flow"),
+        Text(
+          extent={{104,26},{152,16}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water/steam outlet"),
+        Text(
+          extent={{106,-4},{140,-32}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Fluid1 outlet")}));
+end DynamicWaterSteamMultiFluidsHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo
index 68970ec69f2fc70df84cf1b623c61568cb1780f5..3addadd9df58ce04ce1549a2d4dc808d1fbb95e0 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo
@@ -1,207 +1,207 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model FixedPowerHeatExchanger "Heat exchanger with fixed delta power"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Power DW=0
-    "Power exchanged between the hot and the cold fluid";
-  parameter Real DPc=10 "Total pressure loss for the hot fluid (percent of the fluid pressure at the inlet)";
-  parameter Real DPf=10 "Total pressure loss for the cold fluid (percent of the fluid pressure at the inlet)";
-  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
-    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
-    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
-  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature Tec "Fluid temperature at the inlet of the hot side";
-  Units.SI.Temperature Tsc "Fluid temperature at the outlet of the hot side";
-  Units.SI.Temperature Tef "Fluid temperature at the inlet of the cold side";
-  Units.SI.Temperature Tsf "Fluid temperature at the outlet of the cold side";
-  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
-  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
-  FluidType ftype_c "Fluid type for the hot fluid";
-  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
-  FluidType ftype_f "Fluid type for the cold fluid";
-  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
-
-public
-  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
-          extent={{-68,-70},{-48,-50}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
-          extent={{88,-9},{108,11}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
-          extent={{48,-70},{68,-50}}, rotation=0)));
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-equation
-
-  /* Mass flow rates */
-  Ec.Q = Sc.Q;
-
-  Ec.h_vol_1 = Sc.h_vol_1;
-  Ec.h_vol_2 = Sc.h_vol_2;
-
-  Sc.diff_on_1 = Ec.diff_on_1;
-  Ec.diff_on_2 = Sc.diff_on_2;
-
-  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
-  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
-
-  Ec.ftype = Sc.ftype;
-
-  Ec.Xco2 = Sc.Xco2;
-  Ec.Xh2o = Sc.Xh2o;
-  Ec.Xo2  = Sc.Xo2;
-  Ec.Xso2 = Sc.Xso2;
-
-  ftype_c = Ec.ftype;
-
-  Ef.Q = Sf.Q;
-
-  Ef.h_vol_1 = Sf.h_vol_1;
-  Ef.h_vol_2 = Sf.h_vol_2;
-
-  Sf.diff_on_1 = Ef.diff_on_1;
-  Ef.diff_on_2 = Sf.diff_on_2;
-
-  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
-  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
-
-  Ef.ftype = Sf.ftype;
-
-  Ef.Xco2 = Sf.Xco2;
-  Ef.Xh2o = Sf.Xh2o;
-  Ef.Xo2  = Sf.Xo2;
-  Ef.Xso2 = Sf.Xso2;
-
-  ftype_f = Ef.ftype;
-
-  Qc = Ec.Q;
-  Qf = Ef.Q;
-
-  /* Power exchanged between the hot and cold fluid */
-  DW = Qf*(Sf.h - Ef.h);
-  DW = Qc*(Ec.h - Sc.h);
-
-  /* Pressure losses */
-  Sc.P = if (Qc > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
-  Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100;
-
-  /* Fluid thermodynamic properties for the hot fluid */
-  proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c);
-  procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_c, fluid_c);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-
-  /* Fluid thermodynamic properties for the cold fluid */
-  profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_f);
-  profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f);
-
-  Tef = profe.T;
-  Tsf = profs.T;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,62},{100,-62}},
-          lineColor={255,255,170},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          lineThickness=0,
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,62},{100,-62}},
-          lineColor={0,0,0},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.CrossDiag),
-        Line(
-          points={{-58,-50},{-58,4},{-2,-28},{58,6},{58,-50}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-126,24},{-106,14}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold inlet"),
-        Text(
-          extent={{-88,-70},{-68,-80}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot inlet"),
-        Text(
-          extent={{70,-72},{94,-82}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot outlet"),
-        Text(
-          extent={{104,24},{128,10}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold outlet")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={28,108,200},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.CrossDiag), Line(
-          points={{-58,-50},{-58,2},{-2,-34},{58,2},{58,-50}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-104,28},{-60,10}},
-          lineColor={0,0,0},
-          textString="Cold inlet"),
-        Text(
-          extent={{62,30},{106,12}},
-          lineColor={0,0,0},
-          textString="Cold outlet"),
-        Text(
-          extent={{62,-36},{106,-54}},
-          lineColor={238,46,47},
-          textString="Hot outlet"),
-        Text(
-          extent={{-106,-34},{-62,-52}},
-          lineColor={238,46,47},
-          textString="Hot inlet")}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end FixedPowerHeatExchanger;
+within ThermoSysPro.Fluid.HeatExchangers;
+model FixedPowerHeatExchanger "Heat exchanger with fixed delta power"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Power DW=0
+    "Power exchanged between the hot and the cold fluid";
+  parameter Real DPc=10 "Total pressure loss for the hot fluid (percent of the fluid pressure at the inlet)";
+  parameter Real DPf=10 "Total pressure loss for the cold fluid (percent of the fluid pressure at the inlet)";
+  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
+    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
+    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
+  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature Tec "Fluid temperature at the inlet of the hot side";
+  Units.SI.Temperature Tsc "Fluid temperature at the outlet of the hot side";
+  Units.SI.Temperature Tef "Fluid temperature at the inlet of the cold side";
+  Units.SI.Temperature Tsf "Fluid temperature at the outlet of the cold side";
+  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+  FluidType ftype_c "Fluid type for the hot fluid";
+  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
+  FluidType ftype_f "Fluid type for the cold fluid";
+  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
+
+public
+  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
+          extent={{-68,-70},{-48,-50}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
+          extent={{88,-9},{108,11}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
+          extent={{48,-70},{68,-50}}, rotation=0)));
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+equation
+
+  /* Mass flow rates */
+  Ec.Q = Sc.Q;
+
+  Ec.h_vol_1 = Sc.h_vol_1;
+  Ec.h_vol_2 = Sc.h_vol_2;
+
+  Sc.diff_on_1 = Ec.diff_on_1;
+  Ec.diff_on_2 = Sc.diff_on_2;
+
+  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
+  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
+
+  Ec.ftype = Sc.ftype;
+
+  Ec.Xco2 = Sc.Xco2;
+  Ec.Xh2o = Sc.Xh2o;
+  Ec.Xo2  = Sc.Xo2;
+  Ec.Xso2 = Sc.Xso2;
+
+  ftype_c = Ec.ftype;
+
+  Ef.Q = Sf.Q;
+
+  Ef.h_vol_1 = Sf.h_vol_1;
+  Ef.h_vol_2 = Sf.h_vol_2;
+
+  Sf.diff_on_1 = Ef.diff_on_1;
+  Ef.diff_on_2 = Sf.diff_on_2;
+
+  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
+  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
+
+  Ef.ftype = Sf.ftype;
+
+  Ef.Xco2 = Sf.Xco2;
+  Ef.Xh2o = Sf.Xh2o;
+  Ef.Xo2  = Sf.Xo2;
+  Ef.Xso2 = Sf.Xso2;
+
+  ftype_f = Ef.ftype;
+
+  Qc = Ec.Q;
+  Qf = Ef.Q;
+
+  /* Power exchanged between the hot and cold fluid */
+  DW = Qf*(Sf.h - Ef.h);
+  DW = Qc*(Ec.h - Sc.h);
+
+  /* Pressure losses */
+  Sc.P = if (Qc > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
+  Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100;
+
+  /* Fluid thermodynamic properties for the hot fluid */
+  proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c);
+  procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_c, fluid_c);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+
+  /* Fluid thermodynamic properties for the cold fluid */
+  profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_f);
+  profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f);
+
+  Tef = profe.T;
+  Tsf = profs.T;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,62},{100,-62}},
+          lineColor={255,255,170},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          lineThickness=0,
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,62},{100,-62}},
+          lineColor={0,0,0},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.CrossDiag),
+        Line(
+          points={{-58,-50},{-58,4},{-2,-28},{58,6},{58,-50}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-126,24},{-106,14}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold inlet"),
+        Text(
+          extent={{-88,-70},{-68,-80}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot inlet"),
+        Text(
+          extent={{70,-72},{94,-82}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot outlet"),
+        Text(
+          extent={{104,24},{128,10}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold outlet")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={28,108,200},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.CrossDiag), Line(
+          points={{-58,-50},{-58,2},{-2,-34},{58,2},{58,-50}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-104,28},{-60,10}},
+          lineColor={0,0,0},
+          textString="Cold inlet"),
+        Text(
+          extent={{62,30},{106,12}},
+          lineColor={0,0,0},
+          textString="Cold outlet"),
+        Text(
+          extent={{62,-36},{106,-54}},
+          lineColor={238,46,47},
+          textString="Hot outlet"),
+        Text(
+          extent={{-106,-34},{-62,-52}},
+          lineColor={238,46,47},
+          textString="Hot inlet")}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end FixedPowerHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo b/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo
index 559b0ad76d22e942d293cf5ea710bd72e45f6cd0..43e3c50b84806a346ae5a97845220ce532e7282d 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo
@@ -1,668 +1,668 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model NTUWaterHeater "NTU water heater"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real lambdaE=0 "Pressure loss coefficient on the water side";
-  parameter Units.SI.Area SCondDes=3000
-    "Exchange surface for the condensation and deheating";
-  parameter Units.SI.CoefficientOfHeatTransfer KCond=1
-    "Heat transfer coefficient for the condensation";
-  parameter Units.SI.Area SPurge=0 "Drain surface - if > 0: with drain cooling";
-  parameter Units.SI.CoefficientOfHeatTransfer KPurge=1
-    "Heat transfer coefficient for the drain cooling";
-  parameter Units.SI.MassFlowRate gamma_diff_e=1e-4
-    "Diffusion conductance for the water side (active if diffusion=true in neighbouring volumes)";
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region_eeF=IF97Region.All_regions "IF97 region at the inlet of the water side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_seF=IF97Region.All_regions "IF97 region at the outlet of the water side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_evC=IF97Region.All_regions "IF97 region at the inlet of the vapor side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_mF=IF97Region.All_regions "IF97 region in the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_epC=IF97Region.All_regions "IF97 region at the inlet of the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_spC=IF97Region.All_regions "IF97 region at the outlet of the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_flash=IF97Region.All_regions "IF97 region in the flash zone of the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-  parameter Integer mode_eeF=Integer(region_eeF) "IF97 region at the inlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_seF=Integer(region_seF) "IF97 region at the outlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_evC=Integer(region_evC) "IF97 region at the inlet of the vapor side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_mF=Integer(region_mF) "IF97 region in the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_epC=Integer(region_epC) "IF97 region at the inlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_spC=Integer(region_spC) "IF97 region at the outlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_flash=Integer(region_flash) "IF97 region in the flash zone of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.SpecificEnthalpy HsateC(start=300e3, min=0)
-    "Saturation specific enthalpy of the water at the pressure of the vapor inlet";
-  Units.SI.SpecificEnthalpy HsatvC(start=2500e3, min=0)
-    "Saturation specific enthalpy of the vapor at the pressure of the vapor inlet";
-  Units.SI.Area SDes(start=0) "Heat exchange surface for deheating";
-  Units.SI.SpecificEnthalpy HeiF(start=200e3)
-    "Fluid specific enthalpy after drain cooling";
-  Units.SI.SpecificEnthalpy HDesF(start=200e3)
-    "Fluid specific enthalpy after deheating";
-  Units.SI.Temperature TeiF(start=400, min=0)
-    "Fluid temperature after drain cooling";
-  Units.SI.Temperature TsatC(start=400, min=0) "Saturation temperature";
-  Units.SI.Power W(start=1) "Total heat power transfered to the cooling water";
-  Units.SI.Power Wdes(start=1) "Energy transfer during deheating";
-  Units.SI.Power Wcond(start=1) "Energy transfer during condensation";
-  Units.SI.Power Wflash(start=1)
-    "Energy transfer during partial vaporisation in the drain";
-  Units.SI.Power Wpurge(start=1) "Energy transfer during drain cooling";
-  Units.SI.SpecificEnthalpy Hep(start=3e5)
-    "Mixing specific enthalpy of the drain and the condensate";
-  Units.SI.Density rho(start=1e3, min=0) "Average water density";
-  FluidType fluids[4] "Fluids mixing in volume";
-  FluidType ftype_e "Fluid type for the water side";
-  Integer fluid_e=Integer(ftype_e) "Fluid number for the water side";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Jep "Thermal power diffusion from the inlet of the drain";
-  Units.SI.Power Jev "Thermal power diffusion from the inlet of the vapor side";
-  Units.SI.Power Jsp "Thermal power diffusion from the outlet of the drain";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_ep
-    "Diffusion conductance for the inlet of the drain";
-  Units.SI.MassFlowRate gamma_ev
-    "Diffusion conductance for the inlet of the vapor side";
-  Units.SI.MassFlowRate gamma_sp
-    "Diffusion conductance for the outlet of the drain";
-  Real rep "Value of r(Q/gamma) for the inlet of the drain";
-  Real rev "Value of r(Q/gamma) for inlet for the inlet of the vapor side";
-  Real rsp "Value of r(Q/gamma) for the outlet of the drain";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proeeF
-    "Water inlet fluid properties (4F)"
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proseF
-    "Water outlet fluid properties (1F)"
-    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prospC
-    "Drain outlet fluid properties (4C)"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Interfaces.Connectors.FluidInlet Ee "Water inlet"
-    annotation (Placement(transformation(extent={{-90,-10},{-110,10}}, rotation=
-           0)));
-  Interfaces.Connectors.FluidOutlet Se "Water outlet" annotation (Placement(
-        transformation(extent={{110,-10},{90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Ep "Drain inlet"
-    annotation (Placement(transformation(extent={{-50,24},{-70,44}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sp "Drain outlet" annotation (Placement(
-        transformation(extent={{-50,-43},{-70,-23}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Ev "Vapor inlet"
-    annotation (Placement(transformation(extent={{70,24},{50,44}}, rotation=0),
-        iconTransformation(extent={{70,24},{50,44}})));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proevC
-    "Vapor inlet fluid properties (1C)"
-    annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsatC
-    "Saturation conditions for the liquid phase"
-    annotation (Placement(transformation(extent={{10,40},{30,60}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsatC
-    "Saturation conditions for the vapor phase"
-    annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promeF
-    "Average water fluid properties (between 4F and 3F)"
-    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmC
-    "Deheating average fluid properties (between 1C and 2C)"
-    annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promcF
-    "Average deheating fluid properties (between 3F and 2F)"
-    annotation (Placement(transformation(extent={{50,-100},{70,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesF
-    "Deheating inlet fluid properties (2F)"
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmF
-    "Average deheating fluid properties (between 2F and 1F)"
-    annotation (Placement(transformation(extent={{20,-100},{40,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prosp
-    "Drain outlet fluid properties before cooling (near 3C)"
-    annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompC
-    "Average fluid properties in the drain (between 3C and 4C)"
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompF
-    "Average water fluid properties (between 4F and 3F)"
-    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proecF
-    "Water fluid properties (3F)"
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph flashepC
-    "Flash fluid properties (near 4C)"
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ev.ftype;
-  fluids[3] = Ep.ftype;
-  fluids[4] = Sp.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "NTUWaterHeater:  fluids mixing in water heater volume are not compatible with each other");
-
-  /* Check that the fluid type is water/steam for the water side */
-  assert((ftype_e == FluidType.WaterSteam) or (ftype_e == FluidType.WaterSteamSimple), "NTUWaterHeater: the fluid type for the water side must be water/steam");
-
-  /* Unconnected connectors */
-  if cardinality(Ep) == 0 then
-    Ep.Q = 0;
-    Ep.h = 1.e5;
-    Ep.h_vol_1 = 1.e5;
-    Ep.diff_res_1 = 0;
-    Ep.diff_on_1 = false;
-    Ep.ftype = ftype;
-    Ep.Xco2 = 0;
-    Ep.Xh2o = 0;
-    Ep.Xo2 = 0;
-    Ep.Xso2 = 0;
-  end if;
-
-  // Cooling pipe
-  //-------------
-
-  Ee.Q = Se.Q;
-
-  Ee.h_vol_1 = Se.h_vol_1;
-  Ee.h_vol_2 = Se.h_vol_2;
-
-  Se.diff_on_1 = Ee.diff_on_1;
-  Ee.diff_on_2 = Se.diff_on_2;
-
-  Se.diff_res_1 = Ee.diff_res_1 + 1/gamma_diff_e;
-  Ee.diff_res_2 = Se.diff_res_2 + 1/gamma_diff_e;
-
-  Ee.ftype = Se.ftype;
-
-  Ee.Xco2 = Se.Xco2;
-  Ee.Xh2o = Se.Xh2o;
-  Ee.Xo2  = Se.Xo2;
-  Ee.Xso2 = Se.Xso2;
-
-  ftype_e = Ee.ftype;
-
-  /* Pressure loss equation in the water pipe */
-  Ee.P - Se.P = lambdaE*ThermoSysPro.Functions.ThermoSquare(Ee.Q, eps)/rho;
-
-  /* Heating power released to the cooling pipe */
-  W = Se.Q*(Se.h - Ee.h);
-
-  // Water/steam cavity
-  //-------------------
-
-  /* Fluid pressure */
-  P = Ep.P;
-  P = Ev.P;
-  P = Sp.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ep.h_vol_2 = h;
-  Ev.h_vol_2 = h;
-  Sp.h_vol_1 = h;
-
-  /* Mass balance equation */
-  0 = Ep.Q + Ev.Q - Sp.Q;
-
-  /* Energy balance equations */
-
-  // Deheating zone
-  //---------------
-
-  /* Heat power, fluid specific enthalpy on the cold side and deheating surface */
-  /* If deheating is present */
-  if (HsatvC < Ev.h) then
-    0 = Ev.Q*(Ev.h - HsatvC) - Ee.Q*(Se.h - HDesF) + J/3;
-    Wdes = Ee.Q*(Se.h - HDesF);
-    Wdes = noEvent(min(Ev.Q*prodesmC.cp, Ee.Q*prodesmF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, prodesmC.cp, prodesmF.cp, KCond/2, SDes, 1)*(proevC.T - prodesF.T));
-  /* If deheating is absent */
-  else
-    Wdes = 1e-9;
-    HDesF = Se.h;
-    SDes = 1e-9;
-  end if;
-
-  // Condensation zone
-  //------------------
-
-  /* Heat power, fluid specific enthalpy at the outlet of the condensation zone and vapor mass flow rate at the inlet */
-  if noEvent(Ev.h < HsatvC) then
-    0 = Ev.Q*(Ev.h - HsateC) + Wflash - Ee.Q*(HDesF - HeiF) + J/3;
-  else
-    0 = Ev.Q*(HsatvC - HsateC) + Wflash - Ee.Q*(HDesF - HeiF) + J/3;
-  end if;
-
-  Wcond = Ee.Q*(HDesF - HeiF);
-  Wcond = Ee.Q*promcF.cp*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, 1.e20, promcF.cp, KCond, (SCondDes - SDes), 0.5)*(TsatC - TeiF);
-
-  // Flash zone
-  //-----------
-
-  /* Heat power in case of partial vaporization in the drain */
-  if (flashepC.x > 0) then
-    Wflash = Ep.Q*(Ep.h - HsateC);
-  else
-    Wflash = 0;
-  end if;
-
-  /* Condition for partial vaporisation in the drain (flash) */
-  if (flashepC.x > 0) then
-    Hep = HsateC;
-  else
-    Sp.Q*Hep = HsateC*Ev.Q + Ep.h*Ep.Q;
-  end if;
-
-  // Drain cooling zone
-  //-------------------
-
-  /* Power, fluid specific enthalpy at the cold outlet and temperature of the drain outlet */
-  if noEvent(SPurge > 0) then
-    0 = Sp.Q*(Hep - Sp.h) - Ee.Q*(HeiF - Ee.h) + J/3;
-    Wpurge = Ee.Q*(HeiF - Ee.h);
-    Wpurge = noEvent(min(Sp.Q*prompC.cp, Ee.Q*prompF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Sp.Q, Ee.Q, prompC.cp, prompF.cp, KPurge, SPurge, 0)*(prosp.T - proeeF.T));
-    TeiF = proecF.T;
-  else
-    HeiF = Ee.h;
-    Wpurge = 0;
-    Hep = Sp.h;
-    TeiF = proeeF.T;
-  end if;
-
-  /* Fluid composition balance equations */
-  0 = Ep.Xco2*Ep.Q + Ev.Xco2*Ev.Q - Sp.Xco2*Sp.Q;
-  0 = Ep.Xh2o*Ep.Q + Ev.Xh2o*Ev.Q - Sp.Xh2o*Sp.Q;
-  0 = Ep.Xo2*Ep.Q + Ev.Xo2*Ev.Q - Sp.Xo2*Sp.Q;
-  0 = Ep.Xso2*Ep.Q + Ev.Xso2*Ev.Q - Sp.Xso2*Sp.Q;
-
-  Sp.ftype = ftype;
-
-  Sp.Xco2 = Xco2;
-  Sp.Xh2o = Xh2o;
-  Sp.Xo2  = Xo2;
-  Sp.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Sp.h = ThermoSysPro.Functions.SmoothCond(Sp.Q/gamma_sp, Sp.h_vol_1, Sp.h_vol_2, 1);
-  else
-    Sp.h = if (Sp.Q > 0) then Sp.h_vol_1 else Sp.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    rep = if Ep.diff_on_1 then exp(-0.033*(Ep.Q*Ep.diff_res_1)^2) else 0;
-    rev = if Ev.diff_on_1 then exp(-0.033*(Ev.Q*Ev.diff_res_1)^2) else 0;
-    rsp = if Sp.diff_on_2 then exp(-0.033*(Sp.Q*Sp.diff_res_2)^2) else 0;
-
-    gamma_ep = if Ep.diff_on_1 then 1/Ep.diff_res_1 else gamma0;
-    gamma_ev = if Ev.diff_on_1 then 1/Ev.diff_res_1 else gamma0;
-    gamma_sp = if Sp.diff_on_2 then 1/Sp.diff_res_2 else gamma0;
-
-    Jep = if Ep.diff_on_1 then rep*gamma_ep*(Ep.h_vol_1 - Ep.h_vol_2) else 0;
-    Jev = if Ev.diff_on_1 then rev*gamma_ev*(Ev.h_vol_1 - Ev.h_vol_2) else 0;
-    Jsp = if Sp.diff_on_2 then rsp*gamma_sp*(Sp.h_vol_2 - Sp.h_vol_1) else 0;
-  else
-    rep = 0;
-    rev = 0;
-    rsp = 0;
-
-    gamma_ep = gamma0;
-    gamma_ev = gamma0;
-    gamma_sp = gamma0;
-
-    Jep = 0;
-    Jev = 0;
-    Jsp = 0;
-  end if;
-
-  J = Jep + Jev + Jsp;
-
-  Ep.diff_res_2 = 0;
-  Ev.diff_res_2 = 0;
-  Sp.diff_res_1 = 0;
-
-  Ep.diff_on_2 = diffusion;
-  Ev.diff_on_2 = diffusion;
-  Sp.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  proeeF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, Ee.h, mode_eeF, fluid_e);
-  proseF = ThermoSysPro.Properties.Fluid.Ph(Se.P, Se.h, mode_seF, fluid_e);
-  promeF = ThermoSysPro.Properties.Fluid.Ph((Ee.P + Se.P)/2,(Ee.h + Se.h)/2, mode_eeF, fluid_e);
-  proevC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Ev.h, mode_evC, fluid);
-  prospC = ThermoSysPro.Properties.Fluid.Ph(Sp.P, Sp.h, mode_spC, fluid);
-  prosp = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Hep, mode_spC, fluid);
-  prodesF = ThermoSysPro.Properties.Fluid.Ph(Se.P, HDesF, mode_seF, fluid_e);
-  prompC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, (Hep + Sp.h)/2, mode_spC, fluid);
-  prodesmC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, (vsatC.h + Ev.h)/2, mode_evC, fluid);
-  prompF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, (Ee.h + HeiF)/2, mode_eeF, fluid_e);
-  promcF = ThermoSysPro.Properties.Fluid.Ph((Ee.P + Se.P)/2, (HeiF + HDesF)/2, mode_mF, fluid_e);
-  prodesmF = ThermoSysPro.Properties.Fluid.Ph(Se.P, (HDesF + Se.h)/2, mode_seF, fluid_e);
-  proecF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, HeiF, mode_eeF, fluid_e);
-  flashepC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Ep.h, mode_flash, fluid);
-
-  /* Fluid density */
-  rho = promeF.d;
-
-  /* Saturation point at the vapor inlet pressure */
-  (lsatC, vsatC) = ThermoSysPro.Properties.Fluid.Water_sat_P(Ev.P, fluid);
-
-  TsatC  = lsatC.T;
-  HsateC = lsatC.h;
-  HsatvC = vsatC.h;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2},
-        initialScale=0.01), graphics={
-        Ellipse(
-          extent={{-100,-30},{-36,32}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillColor= DynamicSelect({85,170,255},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{38,-30},{102,32}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillColor= DynamicSelect({85,170,255},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,32},{74,-30}},
-          lineColor={0,0,0},
-          fillColor=DynamicSelect({85,170,255},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-70,32},{74,32},{74,32}},
-          color={0,0,0}),
-        Line(
-          points={{-70,-30},{74,-30},{74,-30}},
-          color={0,0,0},
-          thickness=0),
-        Line(
-          points={{74,32},{74,-30}},
-          color={0,0,0},
-          thickness=0),
-        Line(
-          points={{74,0},{102,0}},
-          color={0,0,0},
-          thickness=0),
-        Rectangle(
-          extent={{-58,-14},{74,-16}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-58,16},{74,14}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-78,-16},{-44,16}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-76,-14},{-48,14}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillColor= DynamicSelect({85,170,255},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-62,14},{72,-14}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({85,170,255},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-96,-12},{74,-12}},
-          color={0,0,127},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-92,-18},{74,-18}},
-          color={0,0,127},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-86,-24},{74,-24}},
-          color={0,0,127},
-          pattern=LinePattern.Dash),
-        Text(
-          extent={{-112,22},{-90,12}},
-          lineColor={0,0,0},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water inlet"),
-        Text(
-          extent={{88,22},{112,8}},
-          lineColor={0,0,0},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water outlet"),
-        Text(
-          extent={{48,58},{72,44}},
-          lineColor={0,0,0},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Steam inlet"),
-        Text(
-          extent={{-72,56},{-50,44}},
-          lineColor={0,0,0},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Drain inlet"),
-        Text(
-          extent={{-70,-46},{-46,-58}},
-          lineColor={0,0,0},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Drain outlet")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2},
-        initialScale=0.01), graphics={
-        Line(
-          points={{-40,-40},{20,-24}},
-          color={0,0,255},
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-40,-20},{-20,0}},
-          color={255,0,0},
-          thickness=0.5),
-        Line(
-          points={{-20,0},{20,0}},
-          color={255,0,0},
-          thickness=0.5),
-        Line(
-          points={{60,0},{80,20}},
-          color={255,0,0},
-          thickness=0.5),
-        Text(
-          extent={{76,28},{84,20}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "1C"),
-        Text(
-          extent={{56,10},{64,2}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "2C"),
-        Text(
-          extent={{-24,8},{-16,0}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "3C"),
-        Text(
-          extent={{-44,-10},{-36,-18}},
-          lineColor={255,0,0},
-          lineThickness=0,
-          textString=
-               "4C"),
-        Text(
-          extent={{76,-10},{82,-16}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "1F"),
-        Text(
-          extent={{58,-18},{64,-24}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "2F"),
-        Text(
-          extent={{-22,-38},{-16,-44}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "3F"),
-        Text(
-          extent={{-42,-44},{-36,-50}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "4F"),
-        Line(
-          points={{20,0},{60,0}},
-          color={255,0,0},
-          thickness=0.5,
-          arrow={Arrow.Filled,Arrow.None}),
-        Line(
-          points={{20,-24},{80,-8}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-40,8},{-24,2}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "Drain"),
-        Text(
-          extent={{66,-18},{82,-24}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "Deheating"),
-        Text(
-          extent={{-36,-18},{-16,-24}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          textString=
-               "Drain cooling"),
-        Line(
-          points={{-26,4},{-22,0}},
-          color={0,0,0},
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-40,-20},{-40,-40}},
-          color={0,0,0},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{-20,0},{-20,-34}},
-          color={0,0,0},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{60,0},{60,-14}},
-          color={0,0,0},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{80,20},{80,-8}},
-          color={0,0,0},
-          pattern=LinePattern.Dot),
-        Text(
-          extent={{48,50},{74,44}},
-          lineColor={0,0,255},
-          textString=
-               "Vapor inlet"),
-        Text(
-          extent={{-74,52},{-48,46}},
-          lineColor={0,0,255},
-          textString=
-               "Drain inlet"),
-        Text(
-          extent={{-74,-16},{-48,-22}},
-          lineColor={0,0,255},
-          textString=
-               "Drain outlet"),
-        Text(
-          extent={{-114,18},{-88,12}},
-          lineColor={0,0,255},
-          textString=
-               "Water inlet"),
-        Text(
-          extent={{86,18},{112,12}},
-          lineColor={0,0,255},
-          textString=
-               "Water outlet"),
-        Text(
-          extent={{12,-10},{34,-18}},
-          lineColor={0,0,255},
-          lineThickness=0,
-          textString=
-               "Condensation"),
-        Text(
-          extent={{-26,-4},{-12,-8}},
-          lineColor={0,0,255},
-          lineThickness=0,
-          textString=
-               "Flash")}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.5.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end NTUWaterHeater;
+within ThermoSysPro.Fluid.HeatExchangers;
+model NTUWaterHeater "NTU water heater"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real lambdaE=0 "Pressure loss coefficient on the water side";
+  parameter Units.SI.Area SCondDes=3000
+    "Exchange surface for the condensation and deheating";
+  parameter Units.SI.CoefficientOfHeatTransfer KCond=1
+    "Heat transfer coefficient for the condensation";
+  parameter Units.SI.Area SPurge=0 "Drain surface - if > 0: with drain cooling";
+  parameter Units.SI.CoefficientOfHeatTransfer KPurge=1
+    "Heat transfer coefficient for the drain cooling";
+  parameter Units.SI.MassFlowRate gamma_diff_e=1e-4
+    "Diffusion conductance for the water side (active if diffusion=true in neighbouring volumes)";
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region_eeF=IF97Region.All_regions "IF97 region at the inlet of the water side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_seF=IF97Region.All_regions "IF97 region at the outlet of the water side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_evC=IF97Region.All_regions "IF97 region at the inlet of the vapor side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_mF=IF97Region.All_regions "IF97 region in the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_epC=IF97Region.All_regions "IF97 region at the inlet of the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_spC=IF97Region.All_regions "IF97 region at the outlet of the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_flash=IF97Region.All_regions "IF97 region in the flash zone of the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+  parameter Integer mode_eeF=Integer(region_eeF) "IF97 region at the inlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_seF=Integer(region_seF) "IF97 region at the outlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_evC=Integer(region_evC) "IF97 region at the inlet of the vapor side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_mF=Integer(region_mF) "IF97 region in the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_epC=Integer(region_epC) "IF97 region at the inlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_spC=Integer(region_spC) "IF97 region at the outlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_flash=Integer(region_flash) "IF97 region in the flash zone of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.SpecificEnthalpy HsateC(start=300e3, min=0)
+    "Saturation specific enthalpy of the water at the pressure of the vapor inlet";
+  Units.SI.SpecificEnthalpy HsatvC(start=2500e3, min=0)
+    "Saturation specific enthalpy of the vapor at the pressure of the vapor inlet";
+  Units.SI.Area SDes(start=0) "Heat exchange surface for deheating";
+  Units.SI.SpecificEnthalpy HeiF(start=200e3)
+    "Fluid specific enthalpy after drain cooling";
+  Units.SI.SpecificEnthalpy HDesF(start=200e3)
+    "Fluid specific enthalpy after deheating";
+  Units.SI.Temperature TeiF(start=400, min=0)
+    "Fluid temperature after drain cooling";
+  Units.SI.Temperature TsatC(start=400, min=0) "Saturation temperature";
+  Units.SI.Power W(start=1) "Total heat power transfered to the cooling water";
+  Units.SI.Power Wdes(start=1) "Energy transfer during deheating";
+  Units.SI.Power Wcond(start=1) "Energy transfer during condensation";
+  Units.SI.Power Wflash(start=1)
+    "Energy transfer during partial vaporisation in the drain";
+  Units.SI.Power Wpurge(start=1) "Energy transfer during drain cooling";
+  Units.SI.SpecificEnthalpy Hep(start=3e5)
+    "Mixing specific enthalpy of the drain and the condensate";
+  Units.SI.Density rho(start=1e3, min=0) "Average water density";
+  FluidType fluids[4] "Fluids mixing in volume";
+  FluidType ftype_e "Fluid type for the water side";
+  Integer fluid_e=Integer(ftype_e) "Fluid number for the water side";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Jep "Thermal power diffusion from the inlet of the drain";
+  Units.SI.Power Jev "Thermal power diffusion from the inlet of the vapor side";
+  Units.SI.Power Jsp "Thermal power diffusion from the outlet of the drain";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_ep
+    "Diffusion conductance for the inlet of the drain";
+  Units.SI.MassFlowRate gamma_ev
+    "Diffusion conductance for the inlet of the vapor side";
+  Units.SI.MassFlowRate gamma_sp
+    "Diffusion conductance for the outlet of the drain";
+  Real rep "Value of r(Q/gamma) for the inlet of the drain";
+  Real rev "Value of r(Q/gamma) for inlet for the inlet of the vapor side";
+  Real rsp "Value of r(Q/gamma) for the outlet of the drain";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proeeF
+    "Water inlet fluid properties (4F)"
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proseF
+    "Water outlet fluid properties (1F)"
+    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prospC
+    "Drain outlet fluid properties (4C)"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Interfaces.Connectors.FluidInlet Ee "Water inlet"
+    annotation (Placement(transformation(extent={{-90,-10},{-110,10}}, rotation=
+           0)));
+  Interfaces.Connectors.FluidOutlet Se "Water outlet" annotation (Placement(
+        transformation(extent={{110,-10},{90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Ep "Drain inlet"
+    annotation (Placement(transformation(extent={{-50,24},{-70,44}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sp "Drain outlet" annotation (Placement(
+        transformation(extent={{-50,-43},{-70,-23}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Ev "Vapor inlet"
+    annotation (Placement(transformation(extent={{70,24},{50,44}}, rotation=0),
+        iconTransformation(extent={{70,24},{50,44}})));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proevC
+    "Vapor inlet fluid properties (1C)"
+    annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsatC
+    "Saturation conditions for the liquid phase"
+    annotation (Placement(transformation(extent={{10,40},{30,60}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsatC
+    "Saturation conditions for the vapor phase"
+    annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promeF
+    "Average water fluid properties (between 4F and 3F)"
+    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmC
+    "Deheating average fluid properties (between 1C and 2C)"
+    annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promcF
+    "Average deheating fluid properties (between 3F and 2F)"
+    annotation (Placement(transformation(extent={{50,-100},{70,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesF
+    "Deheating inlet fluid properties (2F)"
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmF
+    "Average deheating fluid properties (between 2F and 1F)"
+    annotation (Placement(transformation(extent={{20,-100},{40,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prosp
+    "Drain outlet fluid properties before cooling (near 3C)"
+    annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompC
+    "Average fluid properties in the drain (between 3C and 4C)"
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompF
+    "Average water fluid properties (between 4F and 3F)"
+    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proecF
+    "Water fluid properties (3F)"
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph flashepC
+    "Flash fluid properties (near 4C)"
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ev.ftype;
+  fluids[3] = Ep.ftype;
+  fluids[4] = Sp.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "NTUWaterHeater:  fluids mixing in water heater volume are not compatible with each other");
+
+  /* Check that the fluid type is water/steam for the water side */
+  assert((ftype_e == FluidType.WaterSteam) or (ftype_e == FluidType.WaterSteamSimple), "NTUWaterHeater: the fluid type for the water side must be water/steam");
+
+  /* Unconnected connectors */
+  if cardinality(Ep) == 0 then
+    Ep.Q = 0;
+    Ep.h = 1.e5;
+    Ep.h_vol_1 = 1.e5;
+    Ep.diff_res_1 = 0;
+    Ep.diff_on_1 = false;
+    Ep.ftype = ftype;
+    Ep.Xco2 = 0;
+    Ep.Xh2o = 0;
+    Ep.Xo2 = 0;
+    Ep.Xso2 = 0;
+  end if;
+
+  // Cooling pipe
+  //-------------
+
+  Ee.Q = Se.Q;
+
+  Ee.h_vol_1 = Se.h_vol_1;
+  Ee.h_vol_2 = Se.h_vol_2;
+
+  Se.diff_on_1 = Ee.diff_on_1;
+  Ee.diff_on_2 = Se.diff_on_2;
+
+  Se.diff_res_1 = Ee.diff_res_1 + 1/gamma_diff_e;
+  Ee.diff_res_2 = Se.diff_res_2 + 1/gamma_diff_e;
+
+  Ee.ftype = Se.ftype;
+
+  Ee.Xco2 = Se.Xco2;
+  Ee.Xh2o = Se.Xh2o;
+  Ee.Xo2  = Se.Xo2;
+  Ee.Xso2 = Se.Xso2;
+
+  ftype_e = Ee.ftype;
+
+  /* Pressure loss equation in the water pipe */
+  Ee.P - Se.P = lambdaE*ThermoSysPro.Functions.ThermoSquare(Ee.Q, eps)/rho;
+
+  /* Heating power released to the cooling pipe */
+  W = Se.Q*(Se.h - Ee.h);
+
+  // Water/steam cavity
+  //-------------------
+
+  /* Fluid pressure */
+  P = Ep.P;
+  P = Ev.P;
+  P = Sp.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ep.h_vol_2 = h;
+  Ev.h_vol_2 = h;
+  Sp.h_vol_1 = h;
+
+  /* Mass balance equation */
+  0 = Ep.Q + Ev.Q - Sp.Q;
+
+  /* Energy balance equations */
+
+  // Deheating zone
+  //---------------
+
+  /* Heat power, fluid specific enthalpy on the cold side and deheating surface */
+  /* If deheating is present */
+  if (HsatvC < Ev.h) then
+    0 = Ev.Q*(Ev.h - HsatvC) - Ee.Q*(Se.h - HDesF) + J/3;
+    Wdes = Ee.Q*(Se.h - HDesF);
+    Wdes = noEvent(min(Ev.Q*prodesmC.cp, Ee.Q*prodesmF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, prodesmC.cp, prodesmF.cp, KCond/2, SDes, 1)*(proevC.T - prodesF.T));
+  /* If deheating is absent */
+  else
+    Wdes = 1e-9;
+    HDesF = Se.h;
+    SDes = 1e-9;
+  end if;
+
+  // Condensation zone
+  //------------------
+
+  /* Heat power, fluid specific enthalpy at the outlet of the condensation zone and vapor mass flow rate at the inlet */
+  if noEvent(Ev.h < HsatvC) then
+    0 = Ev.Q*(Ev.h - HsateC) + Wflash - Ee.Q*(HDesF - HeiF) + J/3;
+  else
+    0 = Ev.Q*(HsatvC - HsateC) + Wflash - Ee.Q*(HDesF - HeiF) + J/3;
+  end if;
+
+  Wcond = Ee.Q*(HDesF - HeiF);
+  Wcond = Ee.Q*promcF.cp*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, 1.e20, promcF.cp, KCond, (SCondDes - SDes), 0.5)*(TsatC - TeiF);
+
+  // Flash zone
+  //-----------
+
+  /* Heat power in case of partial vaporization in the drain */
+  if (flashepC.x > 0) then
+    Wflash = Ep.Q*(Ep.h - HsateC);
+  else
+    Wflash = 0;
+  end if;
+
+  /* Condition for partial vaporisation in the drain (flash) */
+  if (flashepC.x > 0) then
+    Hep = HsateC;
+  else
+    Sp.Q*Hep = HsateC*Ev.Q + Ep.h*Ep.Q;
+  end if;
+
+  // Drain cooling zone
+  //-------------------
+
+  /* Power, fluid specific enthalpy at the cold outlet and temperature of the drain outlet */
+  if noEvent(SPurge > 0) then
+    0 = Sp.Q*(Hep - Sp.h) - Ee.Q*(HeiF - Ee.h) + J/3;
+    Wpurge = Ee.Q*(HeiF - Ee.h);
+    Wpurge = noEvent(min(Sp.Q*prompC.cp, Ee.Q*prompF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Sp.Q, Ee.Q, prompC.cp, prompF.cp, KPurge, SPurge, 0)*(prosp.T - proeeF.T));
+    TeiF = proecF.T;
+  else
+    HeiF = Ee.h;
+    Wpurge = 0;
+    Hep = Sp.h;
+    TeiF = proeeF.T;
+  end if;
+
+  /* Fluid composition balance equations */
+  0 = Ep.Xco2*Ep.Q + Ev.Xco2*Ev.Q - Sp.Xco2*Sp.Q;
+  0 = Ep.Xh2o*Ep.Q + Ev.Xh2o*Ev.Q - Sp.Xh2o*Sp.Q;
+  0 = Ep.Xo2*Ep.Q + Ev.Xo2*Ev.Q - Sp.Xo2*Sp.Q;
+  0 = Ep.Xso2*Ep.Q + Ev.Xso2*Ev.Q - Sp.Xso2*Sp.Q;
+
+  Sp.ftype = ftype;
+
+  Sp.Xco2 = Xco2;
+  Sp.Xh2o = Xh2o;
+  Sp.Xo2  = Xo2;
+  Sp.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Sp.h = ThermoSysPro.Functions.SmoothCond(Sp.Q/gamma_sp, Sp.h_vol_1, Sp.h_vol_2, 1);
+  else
+    Sp.h = if (Sp.Q > 0) then Sp.h_vol_1 else Sp.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    rep = if Ep.diff_on_1 then exp(-0.033*(Ep.Q*Ep.diff_res_1)^2) else 0;
+    rev = if Ev.diff_on_1 then exp(-0.033*(Ev.Q*Ev.diff_res_1)^2) else 0;
+    rsp = if Sp.diff_on_2 then exp(-0.033*(Sp.Q*Sp.diff_res_2)^2) else 0;
+
+    gamma_ep = if Ep.diff_on_1 then 1/Ep.diff_res_1 else gamma0;
+    gamma_ev = if Ev.diff_on_1 then 1/Ev.diff_res_1 else gamma0;
+    gamma_sp = if Sp.diff_on_2 then 1/Sp.diff_res_2 else gamma0;
+
+    Jep = if Ep.diff_on_1 then rep*gamma_ep*(Ep.h_vol_1 - Ep.h_vol_2) else 0;
+    Jev = if Ev.diff_on_1 then rev*gamma_ev*(Ev.h_vol_1 - Ev.h_vol_2) else 0;
+    Jsp = if Sp.diff_on_2 then rsp*gamma_sp*(Sp.h_vol_2 - Sp.h_vol_1) else 0;
+  else
+    rep = 0;
+    rev = 0;
+    rsp = 0;
+
+    gamma_ep = gamma0;
+    gamma_ev = gamma0;
+    gamma_sp = gamma0;
+
+    Jep = 0;
+    Jev = 0;
+    Jsp = 0;
+  end if;
+
+  J = Jep + Jev + Jsp;
+
+  Ep.diff_res_2 = 0;
+  Ev.diff_res_2 = 0;
+  Sp.diff_res_1 = 0;
+
+  Ep.diff_on_2 = diffusion;
+  Ev.diff_on_2 = diffusion;
+  Sp.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  proeeF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, Ee.h, mode_eeF, fluid_e);
+  proseF = ThermoSysPro.Properties.Fluid.Ph(Se.P, Se.h, mode_seF, fluid_e);
+  promeF = ThermoSysPro.Properties.Fluid.Ph((Ee.P + Se.P)/2,(Ee.h + Se.h)/2, mode_eeF, fluid_e);
+  proevC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Ev.h, mode_evC, fluid);
+  prospC = ThermoSysPro.Properties.Fluid.Ph(Sp.P, Sp.h, mode_spC, fluid);
+  prosp = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Hep, mode_spC, fluid);
+  prodesF = ThermoSysPro.Properties.Fluid.Ph(Se.P, HDesF, mode_seF, fluid_e);
+  prompC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, (Hep + Sp.h)/2, mode_spC, fluid);
+  prodesmC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, (vsatC.h + Ev.h)/2, mode_evC, fluid);
+  prompF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, (Ee.h + HeiF)/2, mode_eeF, fluid_e);
+  promcF = ThermoSysPro.Properties.Fluid.Ph((Ee.P + Se.P)/2, (HeiF + HDesF)/2, mode_mF, fluid_e);
+  prodesmF = ThermoSysPro.Properties.Fluid.Ph(Se.P, (HDesF + Se.h)/2, mode_seF, fluid_e);
+  proecF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, HeiF, mode_eeF, fluid_e);
+  flashepC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Ep.h, mode_flash, fluid);
+
+  /* Fluid density */
+  rho = promeF.d;
+
+  /* Saturation point at the vapor inlet pressure */
+  (lsatC, vsatC) = ThermoSysPro.Properties.Fluid.Water_sat_P(Ev.P, fluid);
+
+  TsatC  = lsatC.T;
+  HsateC = lsatC.h;
+  HsatvC = vsatC.h;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2},
+        initialScale=0.01), graphics={
+        Ellipse(
+          extent={{-100,-30},{-36,32}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillColor= DynamicSelect({85,170,255},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{38,-30},{102,32}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillColor= DynamicSelect({85,170,255},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,32},{74,-30}},
+          lineColor={0,0,0},
+          fillColor=DynamicSelect({85,170,255},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-70,32},{74,32},{74,32}},
+          color={0,0,0}),
+        Line(
+          points={{-70,-30},{74,-30},{74,-30}},
+          color={0,0,0},
+          thickness=0),
+        Line(
+          points={{74,32},{74,-30}},
+          color={0,0,0},
+          thickness=0),
+        Line(
+          points={{74,0},{102,0}},
+          color={0,0,0},
+          thickness=0),
+        Rectangle(
+          extent={{-58,-14},{74,-16}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-58,16},{74,14}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-78,-16},{-44,16}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-76,-14},{-48,14}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillColor= DynamicSelect({85,170,255},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-62,14},{72,-14}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({85,170,255},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-96,-12},{74,-12}},
+          color={0,0,127},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-92,-18},{74,-18}},
+          color={0,0,127},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-86,-24},{74,-24}},
+          color={0,0,127},
+          pattern=LinePattern.Dash),
+        Text(
+          extent={{-112,22},{-90,12}},
+          lineColor={0,0,0},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water inlet"),
+        Text(
+          extent={{88,22},{112,8}},
+          lineColor={0,0,0},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water outlet"),
+        Text(
+          extent={{48,58},{72,44}},
+          lineColor={0,0,0},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Steam inlet"),
+        Text(
+          extent={{-72,56},{-50,44}},
+          lineColor={0,0,0},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Drain inlet"),
+        Text(
+          extent={{-70,-46},{-46,-58}},
+          lineColor={0,0,0},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Drain outlet")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2},
+        initialScale=0.01), graphics={
+        Line(
+          points={{-40,-40},{20,-24}},
+          color={0,0,255},
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-40,-20},{-20,0}},
+          color={255,0,0},
+          thickness=0.5),
+        Line(
+          points={{-20,0},{20,0}},
+          color={255,0,0},
+          thickness=0.5),
+        Line(
+          points={{60,0},{80,20}},
+          color={255,0,0},
+          thickness=0.5),
+        Text(
+          extent={{76,28},{84,20}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "1C"),
+        Text(
+          extent={{56,10},{64,2}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "2C"),
+        Text(
+          extent={{-24,8},{-16,0}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "3C"),
+        Text(
+          extent={{-44,-10},{-36,-18}},
+          lineColor={255,0,0},
+          lineThickness=0,
+          textString=
+               "4C"),
+        Text(
+          extent={{76,-10},{82,-16}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "1F"),
+        Text(
+          extent={{58,-18},{64,-24}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "2F"),
+        Text(
+          extent={{-22,-38},{-16,-44}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "3F"),
+        Text(
+          extent={{-42,-44},{-36,-50}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "4F"),
+        Line(
+          points={{20,0},{60,0}},
+          color={255,0,0},
+          thickness=0.5,
+          arrow={Arrow.Filled,Arrow.None}),
+        Line(
+          points={{20,-24},{80,-8}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-40,8},{-24,2}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "Drain"),
+        Text(
+          extent={{66,-18},{82,-24}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "Deheating"),
+        Text(
+          extent={{-36,-18},{-16,-24}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          textString=
+               "Drain cooling"),
+        Line(
+          points={{-26,4},{-22,0}},
+          color={0,0,0},
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-40,-20},{-40,-40}},
+          color={0,0,0},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{-20,0},{-20,-34}},
+          color={0,0,0},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{60,0},{60,-14}},
+          color={0,0,0},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{80,20},{80,-8}},
+          color={0,0,0},
+          pattern=LinePattern.Dot),
+        Text(
+          extent={{48,50},{74,44}},
+          lineColor={0,0,255},
+          textString=
+               "Vapor inlet"),
+        Text(
+          extent={{-74,52},{-48,46}},
+          lineColor={0,0,255},
+          textString=
+               "Drain inlet"),
+        Text(
+          extent={{-74,-16},{-48,-22}},
+          lineColor={0,0,255},
+          textString=
+               "Drain outlet"),
+        Text(
+          extent={{-114,18},{-88,12}},
+          lineColor={0,0,255},
+          textString=
+               "Water inlet"),
+        Text(
+          extent={{86,18},{112,12}},
+          lineColor={0,0,255},
+          textString=
+               "Water outlet"),
+        Text(
+          extent={{12,-10},{34,-18}},
+          lineColor={0,0,255},
+          lineThickness=0,
+          textString=
+               "Condensation"),
+        Text(
+          extent={{-26,-4},{-12,-8}},
+          lineColor={0,0,255},
+          lineThickness=0,
+          textString=
+               "Flash")}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.5.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end NTUWaterHeater;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo
index 5175c685b6cfd652d128347dc5d7f77dc07d64a4..c8a49bc3f89de2f97921428d195065aaae7c96f2 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo
@@ -1,565 +1,565 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model SimpleDynamicCondenser "Simple dynamic condenser"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Volume V=1 "Cavity volume";
-  parameter Units.SI.Area A=1 "Cavity cross-sectional area";
-  parameter Real Ccond=0.01 "Condensation coefficient";
-  parameter Real Cevap=0.09 "Evaporation coefficient";
-  parameter Real Xlo=0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
-  parameter Real Xvo=0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
-  parameter Units.SI.Area Avl=A
-    "Heat exchange surface between the liquid and gas phases";
-  parameter Real Kvl=1000 "Heat exchange coefficient between the liquid and gas phases";
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.02 "Pipe internal diameter";
-  parameter Units.SI.Length e=2.e-3 "Wall thickness";
-  parameter Units.SI.Position z1=0 "Inlet altitude";
-  parameter Units.SI.Position z2=0 "Outlet altitude";
-  parameter Units.SI.Length rugosrel=0.0007 "Pipe roughness";
-  parameter Real lambda= 0.03 "Friction pressure loss coefficient (active if lambda_fixed=true)";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Area At=ntubes*pi*D^2/4
-    "Internal pipe cross-section area (cooling fluid)";
-  parameter Boolean gravity_pressure=false "true: fluid pressure at the bottom of the cavity includes gravity term - false: without gravity term";
-  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0=0.1e5
-    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region for the pipes (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer fluid_c=Integer(ftype) "Fluid number in the cavity";
-  parameter Integer mode=Integer(region) - 1 "IF97 region for the pipes. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.MassFlowRate Q(start=100) "Mass flow rate in the pipes";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure in the pipes";
-  Units.SI.SpecificEnthalpy hm "Fluid average specific enthalpy in the pipes";
-  Units.SI.SpecificHeatCapacity cp(start=4200)
-    "Fluid specific heat capacity in the pipes";
-  Units.SI.ThermalConductivity k(start=0.05)
-    "Fluid thermal conductivity in the pipes";
-  Units.SI.Density rhom(start=998) "Liquid phase density in the pipes";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Total pressure loss in the pipes";
-  ThermoSysPro.Units.SI.PressureDifference dpf
-    "Friction pressure loss in the pipes";
-  ThermoSysPro.Units.SI.PressureDifference dpg
-    "Gravity pressure loss in the pipes";
-  Real khi "Hydraulic pressure loss coefficient";
-  Units.SI.AbsolutePressure P "Fluid average pressure in the cavity";
-  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity";
-  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy in the cavity";
-  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy in the cavity";
-  Units.SI.Temperature Tl "Liquid phase temperature in the cavity";
-  Units.SI.Temperature Tv "Gas phase temperature in the cavity";
-  Units.SI.Volume Vl "Liquid phase volume in the cavity";
-  Units.SI.Volume Vv "Gas phase volume in the cavity";
-  Real xl(start=0.0) "Mass vapor fraction in the liquid phase of the cavity";
-  Real xv(start=1) "Mass vapor fraction in the gas phase if the cavity";
-  Units.SI.Density rhol(start=996) "Liquid phase density in the cavity";
-  Units.SI.Density rhov(start=1.5) "Gas phase density in the cavity";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase in the cavity";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phase in the cavity";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase in the cavity";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase in the cavity";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase in the cavity";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase in the cavity";
-  Units.SI.Power Wvl
-    "Thermal power exchanged from the gas phase to the liquid phase in the cavity";
-  Units.SI.Power Wout
-    "Thermal power exchanged from the steam in the cavity to the pipes";
-  Units.SI.Power Jv "Thermal power diffusion from inlet Cv";
-  Units.SI.Power Jl "Thermal power diffusion from outlet Cl";
-  Units.SI.Power Jt_l
-    "Total thermal power diffusion for the liquid in the cavity";
-  Units.SI.Power Jt_v
-    "Total thermal power diffusion for the vapor in the cavity";
-  Units.SI.MassFlowRate gamma_v "Diffusion conductance for inlet Cv";
-  Units.SI.MassFlowRate gamma_l "Diffusion conductance for outlet Cl";
-  Real rv "Value of r(Q/gamma) for inlet Cv";
-  Real rl "Value of r(Q/gamma) for outlet Cl";
-  Units.SI.MassFlowRate gamma_diff(start=1.e-4)
-    "Diffusion conductance in the pipes";
-  FluidType ftype_p "Fluid type in the pipes";
-  Integer fluid_p=Integer(ftype_p) "Fluid number in the pipes";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-100,80},{-80,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Propriétés de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{10,40},{30,60}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Cv annotation (Placement(transformation(
-          extent={{-10,90},{10,110}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cl annotation (Placement(transformation(
-          extent={{-8,-110},{12,-90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yNiveau          annotation (Placement(
-        transformation(extent={{100,-82},{120,-62}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-public
-  Interfaces.Connectors.FluidInlet Cee annotation (Placement(transformation(
-          extent={{-110,-32},{-90,-12}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cse annotation (Placement(transformation(
-          extent={{90,-30},{110,-10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    "Propriétés de l'eau "                   annotation (Placement(
-        transformation(extent={{40,20},{60,40}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      der(hl) = 0;
-      der(hv) = 0;
-      der(Vl) = 0;
-      der(P) = 0;
-    else
-      hl = lsat.h;
-      hv = vsat.h;
-      Vl = Vf0*V;
-      P = P0;
-    end if;
-  end if;
-
-equation
-
-  /* Check that the fluid type for the cooling pipe is water/steam */
-  assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "SimpleDynamicCondenser: the fluid type for the cooling pipe must be water/steam");
-
-  /* Unconnected connectors */
-  if (cardinality(Cv) == 0) then
-    Cv.Q = 0;
-    Cv.h = 1.e5;
-    Cv.h_vol_1 = 1.e5;
-    Cv.diff_res_1 = 0;
-    Cv.diff_on_1 = false;
-    Cv.ftype = ftype;
-    Cv.Xco2 = 0;
-    Cv.Xh2o = 1;
-    Cv.Xo2 = 0;
-    Cv.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cee) == 0) then
-    Cee.Q = 0;
-    Cee.h = 1.e5;
-    Cee.h_vol_1 = 1.e5;
-    Cee.diff_res_1 = 0;
-    Cee.diff_on_1 = false;
-    Cee.ftype = ftype;
-    Cee.Xco2 = 0;
-    Cee.Xh2o = 1;
-    Cee.Xo2 = 0;
-    Cee.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cl) == 0) then
-    Cl.Q = 0;
-    Cl.h_vol_2 = 1.e5;
-    Cl.diff_res_2 = 0;
-    Cl.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cse) == 0) then
-    Cse.Q = 0;
-    Cse.h_vol_2 = 1.e5;
-    Cse.diff_res_2 = 0;
-    Cse.diff_on_2 = false;
-  end if;
-
-  /* Drum volume */
-  V = Vl + Vv;
-
-  /* Water level */
-  yNiveau.signal = Vl/A;
-
-  /* Pressure at the bottom of the condenser */
-  Pfond = if gravity_pressure then P + prod.d*g*Vl/A else P;
-
-  /* Liquid phase mass balance equation in the cavity */
-  BQl = -Cl.Q + Qcond - Qevap;
-
-  if dynamic_energy_balance then
-    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-  else
-    0 = BQl;
-  end if;
-
-  /* Vapor phase mass balance equation in the cavity */
-  BQv = Cv.Q + Qevap - Qcond;
-
-  if dynamic_energy_balance then
-    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-  else
-    0 = BQv;
-  end if;
-
-  /* Condensation and evaporation mass flow rates */
-  Qcond = if noEvent(xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
-  Qevap = if noEvent(xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
-
-  Cv.P = P;
-  Cl.P = Pfond;
-
-  /* Liquid phase energy balance equation in the cavity */
-  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wvl + Jt_l;
-
-  if dynamic_energy_balance then
-    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-  else
-    0 = BHl;
-  end if;
-
-  /* Vapor phase energy balance equation in the cavity */
-  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Wout + Jt_v;
-
-  if dynamic_energy_balance then
-    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-  else
-    0 = BHv;
-  end if;
-
-  Cv.h_vol_2 = hv;
-  Cl.h_vol_1 = hl;
-
-  /* Heat transfer between the liquid and the vapor */
-  Wvl = Kvl*Avl*(Tv - Tl);
-
-  /* Thermal power exchanged from the steam to the pipes */
-  Wout = -Cv.Q*(Cv.h - hl);
-  Wout = -Cee.Q*(Cse.h - Cee.h);
-
-  /* Fluid composition in the cavity (no balance equations) */
-  Cl.ftype = ftype;
-
-  Cl.Xco2 = 0;
-  Cl.Xh2o = 1;
-  Cl.Xo2  = 0;
-  Cl.Xso2 = 0;
-
-  /* Pipes inlet and outlet */
-  Cee.Q = Cse.Q;
-
-  Cee.h_vol_1 = Cse.h_vol_1;
-  Cee.h_vol_2 = Cse.h_vol_2;
-
-  Cse.diff_on_1 = Cee.diff_on_1;
-  Cee.diff_on_2 = Cse.diff_on_2;
-
-  Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff;
-  Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff;
-
-  Cee.ftype = Cse.ftype;
-
-  Cee.Xco2 = Cse.Xco2;
-  Cee.Xh2o = Cse.Xh2o;
-  Cee.Xo2  = Cse.Xo2;
-  Cee.Xso2 = Cse.Xso2;
-
-  ftype_p = Cee.ftype;
-
-  Q = Cee.Q;
-  deltaP = Cee.P - Cse.P;
-
-  /* Pressure losses in the pipes */
-  dpf = khi*ThermoSysPro.Functions.ThermoSquare(Cee.Q,eps)/(2*At^2*rhom);
-  dpg = rhom*g*(z2 - z1);
-  deltaP = dpf + dpg;
-
-  khi = lambda*L/D;
-
-  /* Diffusion resistance in the pipes */
-  gamma_diff = A*k/cp/L;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1);
-  else
-    Cl.h = if (Cl.Q > 0) then Cl.h_vol_1 else Cl.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    rv = if Cv.diff_on_1 then exp(-0.033*(Cv.Q*Cv.diff_res_1)^2) else 0;
-    rl = if Cl.diff_on_2 then exp(-0.033*(Cl.Q*Cl.diff_res_2)^2) else 0;
-
-    gamma_v = if Cv.diff_on_1 then 1/Cv.diff_res_1 else gamma0;
-    gamma_l = if Cl.diff_on_2 then 1/Cl.diff_res_2 else gamma0;
-
-    Jv = if Cv.diff_on_1 then rv*gamma_v*(Cv.h_vol_1 - Cv.h_vol_2) else 0;
-    Jl = if Cl.diff_on_2 then rl*gamma_l*(Cl.h_vol_2 - Cl.h_vol_1) else 0;
-  else
-    rv = 0;
-    rl = 0;
-
-    gamma_v = gamma0;
-    gamma_l = gamma0;
-
-    Jv = 0;
-    Jl = 0;
-   end if;
-
-  Jt_l = Jl;
-  Jt_v = Jv;
-
-  Cv.diff_res_2 = 0;
-  Cl.diff_res_1 = 0;
-
-  Cv.diff_on_2 = diffusion;
-  Cl.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  Pm = (Cee.P + Cse.P)/2;
-  hm = (Cee.h + Cse.h)/2;
-
-  prol = ThermoSysPro.Properties.Fluid.Ph(P, hl,0, fluid_c);
-  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv,0, fluid_c);
-  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid_c);
-  proe = ThermoSysPro.Properties.Fluid.Ph(Pm, hm, mode, fluid_p);
-
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid_c);
-
-  rhom = proe.d;
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-  rhov = prov.d;
-  xv = prov.x;
-
-  k =  ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pm, hm, fluid_p, mode, Cee.Xco2, Cee.Xh2o,Cee.Xo2, Cee.Xso2);
-  cp = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pm, hm, fluid_p, mode, Cee.Xco2, Cee.Xh2o, Cee.Xo2, Cee.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{100,20},{80,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{-80,-60}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,6},{-80,0}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-18},{-80,-24}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-40},{-80,-46}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,6},{20,0}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-40},{20,-46}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-18},{20,-24}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-18},{-30,-24}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-40},{-30,-46}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,6},{-30,0}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,-72},{100,-100}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20},
-              {-20,100}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20},
-              {-20,100}},
-          color={0,0,255},
-          thickness=0),
-        Rectangle(
-          extent={{100,20},{80,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{-80,-60}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,6},{-80,0}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-18},{-80,-24}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-40},{-80,-46}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,6},{20,0}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-40},{20,-46}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-18},{20,-24}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-18},{-30,-24}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-40},{-30,-46}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,6},{-30,0}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,-72},{100,-100}},
-          lineColor={0,0,255},
-          lineThickness=0,
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,102},{-22,100},{-42,94},{-62,82},{-82,62},{-94,42},{-100,
-              22},{-100,20},{-98,20},{100,20},{100,20},{96,28},{90,42},{78,62},
-              {58,82},{38,94},{18,100},{-2,102}},
-          lineColor={28,108,200},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          lineThickness=0,
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-66,66},{72,22}},
-          lineColor={0,0,255},
-          fillColor={175,175,175},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Simple"),
-        Text(
-          extent={{-130,4},{-104,-12}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water inlet"),
-        Text(
-          extent={{108,4},{136,-10}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water outlet"),
-        Text(
-          extent={{-18,92},{24,74}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Turbine outlet"),
-        Text(
-          extent={{12,132},{40,104}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Steam inlet")}),
-    Window(
-      x=0.11,
-      y=0.06,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.5.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>"));
-end SimpleDynamicCondenser;
+within ThermoSysPro.Fluid.HeatExchangers;
+model SimpleDynamicCondenser "Simple dynamic condenser"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Volume V=1 "Cavity volume";
+  parameter Units.SI.Area A=1 "Cavity cross-sectional area";
+  parameter Real Ccond=0.01 "Condensation coefficient";
+  parameter Real Cevap=0.09 "Evaporation coefficient";
+  parameter Real Xlo=0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
+  parameter Real Xvo=0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
+  parameter Units.SI.Area Avl=A
+    "Heat exchange surface between the liquid and gas phases";
+  parameter Real Kvl=1000 "Heat exchange coefficient between the liquid and gas phases";
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.02 "Pipe internal diameter";
+  parameter Units.SI.Length e=2.e-3 "Wall thickness";
+  parameter Units.SI.Position z1=0 "Inlet altitude";
+  parameter Units.SI.Position z2=0 "Outlet altitude";
+  parameter Units.SI.Length rugosrel=0.0007 "Pipe roughness";
+  parameter Real lambda= 0.03 "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  parameter Integer ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Area At=ntubes*pi*D^2/4
+    "Internal pipe cross-section area (cooling fluid)";
+  parameter Boolean gravity_pressure=false "true: fluid pressure at the bottom of the cavity includes gravity term - false: without gravity term";
+  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0=0.1e5
+    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region for the pipes (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer fluid_c=Integer(ftype) "Fluid number in the cavity";
+  parameter Integer mode=Integer(region) - 1 "IF97 region for the pipes. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.MassFlowRate Q(start=100) "Mass flow rate in the pipes";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure in the pipes";
+  Units.SI.SpecificEnthalpy hm "Fluid average specific enthalpy in the pipes";
+  Units.SI.SpecificHeatCapacity cp(start=4200)
+    "Fluid specific heat capacity in the pipes";
+  Units.SI.ThermalConductivity k(start=0.05)
+    "Fluid thermal conductivity in the pipes";
+  Units.SI.Density rhom(start=998) "Liquid phase density in the pipes";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Total pressure loss in the pipes";
+  ThermoSysPro.Units.SI.PressureDifference dpf
+    "Friction pressure loss in the pipes";
+  ThermoSysPro.Units.SI.PressureDifference dpg
+    "Gravity pressure loss in the pipes";
+  Real khi "Hydraulic pressure loss coefficient";
+  Units.SI.AbsolutePressure P "Fluid average pressure in the cavity";
+  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity";
+  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy in the cavity";
+  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy in the cavity";
+  Units.SI.Temperature Tl "Liquid phase temperature in the cavity";
+  Units.SI.Temperature Tv "Gas phase temperature in the cavity";
+  Units.SI.Volume Vl "Liquid phase volume in the cavity";
+  Units.SI.Volume Vv "Gas phase volume in the cavity";
+  Real xl(start=0.0) "Mass vapor fraction in the liquid phase of the cavity";
+  Real xv(start=1) "Mass vapor fraction in the gas phase if the cavity";
+  Units.SI.Density rhol(start=996) "Liquid phase density in the cavity";
+  Units.SI.Density rhov(start=1.5) "Gas phase density in the cavity";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase in the cavity";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phase in the cavity";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase in the cavity";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase in the cavity";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase in the cavity";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase in the cavity";
+  Units.SI.Power Wvl
+    "Thermal power exchanged from the gas phase to the liquid phase in the cavity";
+  Units.SI.Power Wout
+    "Thermal power exchanged from the steam in the cavity to the pipes";
+  Units.SI.Power Jv "Thermal power diffusion from inlet Cv";
+  Units.SI.Power Jl "Thermal power diffusion from outlet Cl";
+  Units.SI.Power Jt_l
+    "Total thermal power diffusion for the liquid in the cavity";
+  Units.SI.Power Jt_v
+    "Total thermal power diffusion for the vapor in the cavity";
+  Units.SI.MassFlowRate gamma_v "Diffusion conductance for inlet Cv";
+  Units.SI.MassFlowRate gamma_l "Diffusion conductance for outlet Cl";
+  Real rv "Value of r(Q/gamma) for inlet Cv";
+  Real rl "Value of r(Q/gamma) for outlet Cl";
+  Units.SI.MassFlowRate gamma_diff(start=1.e-4)
+    "Diffusion conductance in the pipes";
+  FluidType ftype_p "Fluid type in the pipes";
+  Integer fluid_p=Integer(ftype_p) "Fluid number in the pipes";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-100,80},{-80,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Propriétés de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{10,40},{30,60}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Cv annotation (Placement(transformation(
+          extent={{-10,90},{10,110}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cl annotation (Placement(transformation(
+          extent={{-8,-110},{12,-90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yNiveau          annotation (Placement(
+        transformation(extent={{100,-82},{120,-62}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+public
+  Interfaces.Connectors.FluidInlet Cee annotation (Placement(transformation(
+          extent={{-110,-32},{-90,-12}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cse annotation (Placement(transformation(
+          extent={{90,-30},{110,-10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    "Propriétés de l'eau "                   annotation (Placement(
+        transformation(extent={{40,20},{60,40}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      der(hl) = 0;
+      der(hv) = 0;
+      der(Vl) = 0;
+      der(P) = 0;
+    else
+      hl = lsat.h;
+      hv = vsat.h;
+      Vl = Vf0*V;
+      P = P0;
+    end if;
+  end if;
+
+equation
+
+  /* Check that the fluid type for the cooling pipe is water/steam */
+  assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "SimpleDynamicCondenser: the fluid type for the cooling pipe must be water/steam");
+
+  /* Unconnected connectors */
+  if (cardinality(Cv) == 0) then
+    Cv.Q = 0;
+    Cv.h = 1.e5;
+    Cv.h_vol_1 = 1.e5;
+    Cv.diff_res_1 = 0;
+    Cv.diff_on_1 = false;
+    Cv.ftype = ftype;
+    Cv.Xco2 = 0;
+    Cv.Xh2o = 0;
+    Cv.Xo2 = 0;
+    Cv.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cee) == 0) then
+    Cee.Q = 0;
+    Cee.h = 1.e5;
+    Cee.h_vol_1 = 1.e5;
+    Cee.diff_res_1 = 0;
+    Cee.diff_on_1 = false;
+    Cee.ftype = ftype;
+    Cee.Xco2 = 0;
+    Cee.Xh2o = 0;
+    Cee.Xo2 = 0;
+    Cee.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cl) == 0) then
+    Cl.Q = 0;
+    Cl.h_vol_2 = 1.e5;
+    Cl.diff_res_2 = 0;
+    Cl.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cse) == 0) then
+    Cse.Q = 0;
+    Cse.h_vol_2 = 1.e5;
+    Cse.diff_res_2 = 0;
+    Cse.diff_on_2 = false;
+  end if;
+
+  /* Drum volume */
+  V = Vl + Vv;
+
+  /* Water level */
+  yNiveau.signal = Vl/A;
+
+  /* Pressure at the bottom of the condenser */
+  Pfond = if gravity_pressure then P + prod.d*g*Vl/A else P;
+
+  /* Liquid phase mass balance equation in the cavity */
+  BQl = -Cl.Q + Qcond - Qevap;
+
+  if dynamic_energy_balance then
+    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+  else
+    0 = BQl;
+  end if;
+
+  /* Vapor phase mass balance equation in the cavity */
+  BQv = Cv.Q + Qevap - Qcond;
+
+  if dynamic_energy_balance then
+    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+  else
+    0 = BQv;
+  end if;
+
+  /* Condensation and evaporation mass flow rates */
+  Qcond = if noEvent(xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
+  Qevap = if noEvent(xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
+
+  Cv.P = P;
+  Cl.P = Pfond;
+
+  /* Liquid phase energy balance equation in the cavity */
+  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wvl + Jt_l;
+
+  if dynamic_energy_balance then
+    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+  else
+    0 = BHl;
+  end if;
+
+  /* Vapor phase energy balance equation in the cavity */
+  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Wout + Jt_v;
+
+  if dynamic_energy_balance then
+    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+  else
+    0 = BHv;
+  end if;
+
+  Cv.h_vol_2 = hv;
+  Cl.h_vol_1 = hl;
+
+  /* Heat transfer between the liquid and the vapor */
+  Wvl = Kvl*Avl*(Tv - Tl);
+
+  /* Thermal power exchanged from the steam to the pipes */
+  Wout = -Cv.Q*(Cv.h - hl);
+  Wout = -Cee.Q*(Cse.h - Cee.h);
+
+  /* Fluid composition in the cavity (no balance equations) */
+  Cl.ftype = ftype;
+
+  Cl.Xco2 = 0;
+  Cl.Xh2o = 0;
+  Cl.Xo2  = 0;
+  Cl.Xso2 = 0;
+
+  /* Pipes inlet and outlet */
+  Cee.Q = Cse.Q;
+
+  Cee.h_vol_1 = Cse.h_vol_1;
+  Cee.h_vol_2 = Cse.h_vol_2;
+
+  Cse.diff_on_1 = Cee.diff_on_1;
+  Cee.diff_on_2 = Cse.diff_on_2;
+
+  Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff;
+  Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff;
+
+  Cee.ftype = Cse.ftype;
+
+  Cee.Xco2 = Cse.Xco2;
+  Cee.Xh2o = Cse.Xh2o;
+  Cee.Xo2  = Cse.Xo2;
+  Cee.Xso2 = Cse.Xso2;
+
+  ftype_p = Cee.ftype;
+
+  Q = Cee.Q;
+  deltaP = Cee.P - Cse.P;
+
+  /* Pressure losses in the pipes */
+  dpf = khi*ThermoSysPro.Functions.ThermoSquare(Cee.Q,eps)/(2*At^2*rhom);
+  dpg = rhom*g*(z2 - z1);
+  deltaP = dpf + dpg;
+
+  khi = lambda*L/D;
+
+  /* Diffusion resistance in the pipes */
+  gamma_diff = A*k/cp/L;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1);
+  else
+    Cl.h = if (Cl.Q > 0) then Cl.h_vol_1 else Cl.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    rv = if Cv.diff_on_1 then exp(-0.033*(Cv.Q*Cv.diff_res_1)^2) else 0;
+    rl = if Cl.diff_on_2 then exp(-0.033*(Cl.Q*Cl.diff_res_2)^2) else 0;
+
+    gamma_v = if Cv.diff_on_1 then 1/Cv.diff_res_1 else gamma0;
+    gamma_l = if Cl.diff_on_2 then 1/Cl.diff_res_2 else gamma0;
+
+    Jv = if Cv.diff_on_1 then rv*gamma_v*(Cv.h_vol_1 - Cv.h_vol_2) else 0;
+    Jl = if Cl.diff_on_2 then rl*gamma_l*(Cl.h_vol_2 - Cl.h_vol_1) else 0;
+  else
+    rv = 0;
+    rl = 0;
+
+    gamma_v = gamma0;
+    gamma_l = gamma0;
+
+    Jv = 0;
+    Jl = 0;
+   end if;
+
+  Jt_l = Jl;
+  Jt_v = Jv;
+
+  Cv.diff_res_2 = 0;
+  Cl.diff_res_1 = 0;
+
+  Cv.diff_on_2 = diffusion;
+  Cl.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  Pm = (Cee.P + Cse.P)/2;
+  hm = (Cee.h + Cse.h)/2;
+
+  prol = ThermoSysPro.Properties.Fluid.Ph(P, hl,0, fluid_c);
+  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv,0, fluid_c);
+  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid_c);
+  proe = ThermoSysPro.Properties.Fluid.Ph(Pm, hm, mode, fluid_p);
+
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid_c);
+
+  rhom = proe.d;
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+  rhov = prov.d;
+  xv = prov.x;
+
+  k =  ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pm, hm, fluid_p, mode, Cee.Xco2, Cee.Xh2o,Cee.Xo2, Cee.Xso2);
+  cp = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pm, hm, fluid_p, mode, Cee.Xco2, Cee.Xh2o, Cee.Xo2, Cee.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{100,20},{80,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{-80,-60}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,6},{-80,0}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-18},{-80,-24}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-40},{-80,-46}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,6},{20,0}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-40},{20,-46}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-18},{20,-24}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-18},{-30,-24}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-40},{-30,-46}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,6},{-30,0}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,-72},{100,-100}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20},
+              {-20,100}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20},
+              {-20,100}},
+          color={0,0,255},
+          thickness=0),
+        Rectangle(
+          extent={{100,20},{80,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{-80,-60}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,6},{-80,0}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-18},{-80,-24}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-40},{-80,-46}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,6},{20,0}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-40},{20,-46}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-18},{20,-24}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-18},{-30,-24}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-40},{-30,-46}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,6},{-30,0}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,-72},{100,-100}},
+          lineColor={0,0,255},
+          lineThickness=0,
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,102},{-22,100},{-42,94},{-62,82},{-82,62},{-94,42},{-100,
+              22},{-100,20},{-98,20},{100,20},{100,20},{96,28},{90,42},{78,62},
+              {58,82},{38,94},{18,100},{-2,102}},
+          lineColor={28,108,200},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          lineThickness=0,
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-66,66},{72,22}},
+          lineColor={0,0,255},
+          fillColor={175,175,175},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Simple"),
+        Text(
+          extent={{-130,4},{-104,-12}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water inlet"),
+        Text(
+          extent={{108,4},{136,-10}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water outlet"),
+        Text(
+          extent={{-18,92},{24,74}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Turbine outlet"),
+        Text(
+          extent={{12,132},{40,104}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Steam inlet")}),
+    Window(
+      x=0.11,
+      y=0.06,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.5.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>"));
+end SimpleDynamicCondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo
index 5670981a8526b849830a6cca98d879cff4bd6d4d..8f8dbfcd17a8d786eccb4ef91d9ba73779cc1654 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo
@@ -1,268 +1,268 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model SimpleEvaporatorWaterSteamFlueGases "Simple water/steam - flue gases evaporator"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real Kdpf=10 "Flue gases pressure drop coefficient";
-  parameter Real Kdpe=10 "Water/steam pressure drop coefficient";
-  parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4
-    "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.MassFlowRate gamma_diff_fg=1e-4
-    "Diffusion conductance for the flue gases side (active if diffusion=true in neighbouring volumes)";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region for the water/steam side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region for the water/steam side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.AbsolutePressure Pef(start=3e5) "Flue gases pressure at the inlet";
-  Units.SI.AbsolutePressure Psf(start=2.5e5)
-    "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tef(start=600) "Flue gases temperature at the inlet";
-  Units.SI.Temperature Tsf(start=400) "Flue gases temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hsf(start=3e5)
-    "Flue gases specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hef(start=6e5)
-    "Flue gases specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qf(start=10) "Flue gases mass flow rate";
-  Units.SI.AbsolutePressure Pee(start=2e6) "Water pressure at the inlet";
-  Units.SI.AbsolutePressure Pse(start=2e6) "Water pressure at the outlet";
-  Units.SI.Temperature Tee(start=400) "Water temperature at the inlet";
-  Units.SI.Temperature Tse(start=450) "Water temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hee(start=3e5)
-    "Water specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hse(start=20e5)
-    "Water specific enthalpy at the outlet";
-  Units.SI.MassFlowRate Qe(start=10) "Water mass flow rate";
-  Units.SI.Density rhof(start=0.9) "Flue gases density";
-  Units.SI.Density rhoe(start=700) "Water density";
-  Units.SI.Power W(start=1e8) "Power exchanged";
-  FluidType ftype_ws "Fluid type for the water/steam side";
-  Integer fluid_ws=Integer(ftype_ws) "Fluid number for the water/steam side";
-  FluidType ftype_fg "Fluid type for the flue gases side";
-  Integer fluid_fg=Integer(ftype_fg) "Fluid number for the flue gases side";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 annotation (
-      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 annotation (
-      Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 annotation (
-      Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 annotation (
-      Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proes
-    annotation (Placement(transformation(extent={{-52,80},{-32,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proem
-    annotation (Placement(transformation(extent={{-76,80},{-56,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{58,80},{78,100}}, rotation=0)));
-equation
-  /* Check that the fluid type for the water/steam side is water/steam */
-  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "SimpleEvaporatorWaterSteamFlueGases: the fluid type must be water/steam for the water/steam side");
-
-  /* Flue gases inlet */
-  Pef = Cfg1.P;
-  Hef = Cfg1.h;
-  Qf = Cfg1.Q;
-
-  /* Flue gases outlet */
-  Psf = Cfg2.P;
-  Hsf = Cfg2.h;
-  Cfg1.Q = Cfg2.Q;
-
-  Cfg1.h_vol_1 = Cfg2.h_vol_1;
-  Cfg1.h_vol_2 = Cfg2.h_vol_2;
-
-  Cfg2.diff_on_1 = Cfg1.diff_on_1;
-  Cfg1.diff_on_2 = Cfg2.diff_on_2;
-
-  Cfg2.diff_res_1 = Cfg1.diff_res_1 + 1/gamma_diff_fg;
-  Cfg1.diff_res_2 = Cfg2.diff_res_2 + 1/gamma_diff_fg;
-
-  Cfg1.ftype = Cfg2.ftype;
-
-  Cfg2.Xco2 = Cfg1.Xco2;
-  Cfg2.Xh2o = Cfg1.Xh2o;
-  Cfg2.Xo2  = Cfg1.Xo2;
-  Cfg2.Xso2 = Cfg1.Xso2;
-
-  ftype_fg = Cfg1.ftype;
-
-  /* Water inlet */
-  Pee = Cws1.P;
-  Hee = Cws1.h;
-  Qe = Cws1.Q;
-
-  /* Water outlet */
-  Pse = Cws2.P;
-  Hse = Cws2.h;
-  Cws1.Q = Cws2.Q;
-
-  Cws1.h_vol_1 = Cws2.h_vol_1;
-  Cws1.h_vol_2 = Cws2.h_vol_2;
-
-  Cws2.diff_on_1 = Cws1.diff_on_1;
-  Cws1.diff_on_2 = Cws2.diff_on_2;
-
-  Cws2.diff_res_1 = Cws1.diff_res_1 + 1/gamma_diff_ws;
-  Cws1.diff_res_2 = Cws2.diff_res_2 + 1/gamma_diff_ws;
-
-  Cws1.ftype = Cws2.ftype;
-
-  Cws2.Xco2 = Cws1.Xco2;
-  Cws2.Xh2o = Cws1.Xh2o;
-  Cws2.Xo2  = Cws1.Xo2;
-  Cws2.Xso2 = Cws1.Xso2;
-
-  ftype_ws = Cws1.ftype;
-
-  /* Pressure losses */
-  Pef = Psf + Kdpf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
-  Pee = Pse + Kdpe*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe;
-
-  /* Power exchanged */
-  W = Qf*(Hef - Hsf);
-  W = Qe*(Hse - Hee);
-
-  /* Flue gases specific enthalpy at the inlet */
-  Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pef, Hef, fluid_fg, 0, Cfg1.Xco2,  Cfg1.Xh2o,  Cfg1.Xo2,  Cfg1.Xso2);
-
-  /* Flue gases specific enthalpy at the outlet */
-  Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Psf, Hsf, fluid_fg, 0, Cfg1.Xco2,  Cfg1.Xh2o,  Cfg1.Xo2,  Cfg1.Xso2);
-
-  /* Flue gases density */
-  rhof = ThermoSysPro.Properties.Fluid.Density_Ph(Pef, Hef, fluid_fg, 0, Cfg1.Xco2,  Cfg1.Xh2o,  Cfg1.Xo2,  Cfg1.Xso2);
-
-  /* Water/steam thermodynamic properties */
-  proee = ThermoSysPro.Properties.Fluid.Ph(Pee, Hee, mode, fluid_ws);
-  Tee = proee.T;
-
-  proem = ThermoSysPro.Properties.Fluid.Ph((Pee + Pse)/2, (Hee + Hse)/2, mode, fluid_ws);
-  rhoe = proem.d;
-
-  proes = ThermoSysPro.Properties.Fluid.Ph(Pse, Hse, mode, fluid_ws);
-  Tse = proes.T;
-
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pse, fluid_ws);
-  Hse = vsat.h;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-30,76},{28,66}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "Flue gases"),
-        Polygon(
-          points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74,
-              6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92,
-              -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-114,28},{-48,18}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "Water/Steam"),
-        Polygon(
-          points={{-94,3},{90,3},{90,-3},{-94,-3},{-94,3}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-                            Icon(graphics={
-        Rectangle(
-          extent={{-100,-75},{100,-85}},
-          lineColor={175,175,175},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,86},{100,76}},
-          lineColor={175,175,175},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={175,175,175},
-          lineThickness=0,
-          fillColor= DynamicSelect({255,255,0}, fill_color_static),
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74,
-              6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-92,3},{92,3},{92,-3},{-92,-3},{-92,3}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92,
-              -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-128,26},{-102,16}},
-          lineColor={28,108,200},
-          lineThickness=0,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward,
-          textString="Water"),
-        Text(
-          extent={{104,22},{128,12}},
-          lineColor={255,0,0},
-          lineThickness=0,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward,
-          textString="Steam"),
-        Text(
-          extent={{-52,-86},{-14,-98}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward,
-          textString="Flue gases"),
-        Text(
-          extent={{-50,102},{-14,86}},
-          lineColor={238,46,47},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward,
-          textString="Flue gases")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end SimpleEvaporatorWaterSteamFlueGases;
+within ThermoSysPro.Fluid.HeatExchangers;
+model SimpleEvaporatorWaterSteamFlueGases "Simple water/steam - flue gases evaporator"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real Kdpf=10 "Flue gases pressure drop coefficient";
+  parameter Real Kdpe=10 "Water/steam pressure drop coefficient";
+  parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4
+    "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.MassFlowRate gamma_diff_fg=1e-4
+    "Diffusion conductance for the flue gases side (active if diffusion=true in neighbouring volumes)";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region for the water/steam side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region for the water/steam side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.AbsolutePressure Pef(start=3e5) "Flue gases pressure at the inlet";
+  Units.SI.AbsolutePressure Psf(start=2.5e5)
+    "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tef(start=600) "Flue gases temperature at the inlet";
+  Units.SI.Temperature Tsf(start=400) "Flue gases temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hsf(start=3e5)
+    "Flue gases specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hef(start=6e5)
+    "Flue gases specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qf(start=10) "Flue gases mass flow rate";
+  Units.SI.AbsolutePressure Pee(start=2e6) "Water pressure at the inlet";
+  Units.SI.AbsolutePressure Pse(start=2e6) "Water pressure at the outlet";
+  Units.SI.Temperature Tee(start=400) "Water temperature at the inlet";
+  Units.SI.Temperature Tse(start=450) "Water temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hee(start=3e5)
+    "Water specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hse(start=20e5)
+    "Water specific enthalpy at the outlet";
+  Units.SI.MassFlowRate Qe(start=10) "Water mass flow rate";
+  Units.SI.Density rhof(start=0.9) "Flue gases density";
+  Units.SI.Density rhoe(start=700) "Water density";
+  Units.SI.Power W(start=1e8) "Power exchanged";
+  FluidType ftype_ws "Fluid type for the water/steam side";
+  Integer fluid_ws=Integer(ftype_ws) "Fluid number for the water/steam side";
+  FluidType ftype_fg "Fluid type for the flue gases side";
+  Integer fluid_fg=Integer(ftype_fg) "Fluid number for the flue gases side";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 annotation (
+      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 annotation (
+      Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 annotation (
+      Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 annotation (
+      Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proes
+    annotation (Placement(transformation(extent={{-52,80},{-32,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proem
+    annotation (Placement(transformation(extent={{-76,80},{-56,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{58,80},{78,100}}, rotation=0)));
+equation
+  /* Check that the fluid type for the water/steam side is water/steam */
+  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "SimpleEvaporatorWaterSteamFlueGases: the fluid type must be water/steam for the water/steam side");
+
+  /* Flue gases inlet */
+  Pef = Cfg1.P;
+  Hef = Cfg1.h;
+  Qf = Cfg1.Q;
+
+  /* Flue gases outlet */
+  Psf = Cfg2.P;
+  Hsf = Cfg2.h;
+  Cfg1.Q = Cfg2.Q;
+
+  Cfg1.h_vol_1 = Cfg2.h_vol_1;
+  Cfg1.h_vol_2 = Cfg2.h_vol_2;
+
+  Cfg2.diff_on_1 = Cfg1.diff_on_1;
+  Cfg1.diff_on_2 = Cfg2.diff_on_2;
+
+  Cfg2.diff_res_1 = Cfg1.diff_res_1 + 1/gamma_diff_fg;
+  Cfg1.diff_res_2 = Cfg2.diff_res_2 + 1/gamma_diff_fg;
+
+  Cfg1.ftype = Cfg2.ftype;
+
+  Cfg2.Xco2 = Cfg1.Xco2;
+  Cfg2.Xh2o = Cfg1.Xh2o;
+  Cfg2.Xo2  = Cfg1.Xo2;
+  Cfg2.Xso2 = Cfg1.Xso2;
+
+  ftype_fg = Cfg1.ftype;
+
+  /* Water inlet */
+  Pee = Cws1.P;
+  Hee = Cws1.h;
+  Qe = Cws1.Q;
+
+  /* Water outlet */
+  Pse = Cws2.P;
+  Hse = Cws2.h;
+  Cws1.Q = Cws2.Q;
+
+  Cws1.h_vol_1 = Cws2.h_vol_1;
+  Cws1.h_vol_2 = Cws2.h_vol_2;
+
+  Cws2.diff_on_1 = Cws1.diff_on_1;
+  Cws1.diff_on_2 = Cws2.diff_on_2;
+
+  Cws2.diff_res_1 = Cws1.diff_res_1 + 1/gamma_diff_ws;
+  Cws1.diff_res_2 = Cws2.diff_res_2 + 1/gamma_diff_ws;
+
+  Cws1.ftype = Cws2.ftype;
+
+  Cws2.Xco2 = Cws1.Xco2;
+  Cws2.Xh2o = Cws1.Xh2o;
+  Cws2.Xo2  = Cws1.Xo2;
+  Cws2.Xso2 = Cws1.Xso2;
+
+  ftype_ws = Cws1.ftype;
+
+  /* Pressure losses */
+  Pef = Psf + Kdpf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
+  Pee = Pse + Kdpe*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe;
+
+  /* Power exchanged */
+  W = Qf*(Hef - Hsf);
+  W = Qe*(Hse - Hee);
+
+  /* Flue gases specific enthalpy at the inlet */
+  Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pef, Hef, fluid_fg, 0, Cfg1.Xco2,  Cfg1.Xh2o,  Cfg1.Xo2,  Cfg1.Xso2);
+
+  /* Flue gases specific enthalpy at the outlet */
+  Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Psf, Hsf, fluid_fg, 0, Cfg1.Xco2,  Cfg1.Xh2o,  Cfg1.Xo2,  Cfg1.Xso2);
+
+  /* Flue gases density */
+  rhof = ThermoSysPro.Properties.Fluid.Density_Ph(Pef, Hef, fluid_fg, 0, Cfg1.Xco2,  Cfg1.Xh2o,  Cfg1.Xo2,  Cfg1.Xso2);
+
+  /* Water/steam thermodynamic properties */
+  proee = ThermoSysPro.Properties.Fluid.Ph(Pee, Hee, mode, fluid_ws);
+  Tee = proee.T;
+
+  proem = ThermoSysPro.Properties.Fluid.Ph((Pee + Pse)/2, (Hee + Hse)/2, mode, fluid_ws);
+  rhoe = proem.d;
+
+  proes = ThermoSysPro.Properties.Fluid.Ph(Pse, Hse, mode, fluid_ws);
+  Tse = proes.T;
+
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pse, fluid_ws);
+  Hse = vsat.h;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-30,76},{28,66}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "Flue gases"),
+        Polygon(
+          points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74,
+              6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92,
+              -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-114,28},{-48,18}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "Water/Steam"),
+        Polygon(
+          points={{-94,3},{90,3},{90,-3},{-94,-3},{-94,3}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+                            Icon(graphics={
+        Rectangle(
+          extent={{-100,-75},{100,-85}},
+          lineColor={175,175,175},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,86},{100,76}},
+          lineColor={175,175,175},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={175,175,175},
+          lineThickness=0,
+          fillColor= DynamicSelect({255,255,0}, fill_color_static),
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74,
+              6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-92,3},{92,3},{92,-3},{-92,-3},{-92,3}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92,
+              -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-128,26},{-102,16}},
+          lineColor={28,108,200},
+          lineThickness=0,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward,
+          textString="Water"),
+        Text(
+          extent={{104,22},{128,12}},
+          lineColor={255,0,0},
+          lineThickness=0,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward,
+          textString="Steam"),
+        Text(
+          extent={{-52,-86},{-14,-98}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward,
+          textString="Flue gases"),
+        Text(
+          extent={{-50,102},{-14,86}},
+          lineColor={238,46,47},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward,
+          textString="Flue gases")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end SimpleEvaporatorWaterSteamFlueGases;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo
index a98accb5774f94967912fae49a91d6403f8a586d..bc73b5716ddf228ef67396a852fc6aec1efecc9e 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo
@@ -1,289 +1,289 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model SimpleStaticCondenser "Simple static condenser"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real Kc=10 "Friction pressure loss coefficient for the hot side";
-  parameter Real Kf=10 "Friction pressure loss coefficient for the cold side";
-  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
-  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
-  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
-  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot side";
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold side";
-  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
-    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
-    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
-  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_cs=IF97Region.All_regions "IF97 region of the water at the outlet of the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_cs=Integer(region_cs) - 1 "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.Power W(start=1e6)
-    "Power exchanged from the hot side to the cold side";
-  Units.SI.Temperature Tec(start=500)
-    "Fluid temperature at the inlet of the hot side";
-  Units.SI.Temperature Tsc(start=400)
-    "Fluid temperature at the outlet of the hot side";
-  Units.SI.Temperature Tef(start=350)
-    "Fluid temperature at the inlet of the cold side";
-  Units.SI.Temperature Tsf(start=350)
-    "Fluid temperature at the outlet of the cold side";
-  ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3)
-    "Friction pressure loss in the hot side";
-  ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2)
-    "Gravity pressure loss in the hot side";
-  ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3)
-    "Total pressure loss in the hot side";
-  ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3)
-    "Friction pressure loss in the cold side";
-  ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2)
-    "Gravity pressure loss in the cold side";
-  ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3)
-    "Total pressure loss in the cold side";
-  Units.SI.Density rhoc(start=998) "Density of the fluid in the hot side";
-  Units.SI.Density rhof(start=998) "Density of the fluid in the cold side";
-  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
-  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
-  FluidType ftype_c "Fluid type for the hot fluid";
-  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
-  FluidType ftype_f "Fluid type for the cold fluid";
-  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
-
-public
-  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
-          extent={{-70,-110},{-50,-90}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
-          extent={{90,-11},{110,9}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
-          extent={{50,-110},{70,-90}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{40,80},{60,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promc
-    annotation (Placement(transformation(extent={{0,-100},{20,-80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-equation
-
-  /* Check that the fluid type for both sides is water/steam */
-  assert((ftype_c == FluidType.WaterSteam) or (ftype_c == FluidType.WaterSteamSimple), "SimpleStaticCondenser: the fluid type must be water/steam for the hot side");
-  assert((ftype_f == FluidType.WaterSteam) or (ftype_f == FluidType.WaterSteamSimple), "SimpleStaticCondenser: the fluid type must be water/steam for the cold side");
-
-  /* Mass flow rates */
-  Ec.Q = Sc.Q;
-
-  Ec.h_vol_1 = Sc.h_vol_1;
-  Ec.h_vol_2 = Sc.h_vol_2;
-
-  Sc.diff_on_1 = Ec.diff_on_1;
-  Ec.diff_on_2 = Sc.diff_on_2;
-
-  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
-  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
-
-  Ec.ftype = Sc.ftype;
-
-  Ec.Xco2 = Sc.Xco2;
-  Ec.Xh2o = Sc.Xh2o;
-  Ec.Xo2  = Sc.Xo2;
-  Ec.Xso2 = Sc.Xso2;
-
-  ftype_c = Ec.ftype;
-
-  Ef.Q = Sf.Q;
-
-  Ef.h_vol_1 = Sf.h_vol_1;
-  Ef.h_vol_2 = Sf.h_vol_2;
-
-  Sf.diff_on_1 = Ef.diff_on_1;
-  Ef.diff_on_2 = Sf.diff_on_2;
-
-  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
-  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
-
-  Ef.ftype = Sf.ftype;
-
-  Ef.Xco2 = Sf.Xco2;
-  Ef.Xh2o = Sf.Xh2o;
-  Ef.Xo2  = Sf.Xo2;
-  Ef.Xso2 = Sf.Xso2;
-
-  ftype_f = Ef.ftype;
-
-  Qc = Ec.Q;
-  Qf = Ef.Q;
-
-  /* The fluid specific enthalpy at the outlet of the hot side is assumed to be at the saturation point */
-  Sc.h = lsat.h;
-
-  /* Power exchanged between the two sides */
-  W = Qf*(Sf.h - Ef.h);
-  W = Qc*(Ec.h - Sc.h);
-
-  /* Pressure losses in the hot side */
-  Ec.P - Sc.P = DPc;
-
-  DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
-  DPgc = rhoc*g*(z2c - z1c);
-  DPc  = DPfc + DPgc;
-
-  /* Pressure losses in the cold side */
-  Ef.P - Sf.P = DPf;
-
-  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
-  DPgf = rhof*g*(z2f - z1f);
-  DPf  = DPff + DPgf;
-
-  /* Fluid thermodynamic properties at the hot side */
-  proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c);
-  procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_cs, fluid_c);
-  promc = ThermoSysPro.Properties.Fluid.Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, mode_c, fluid_c);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Ec.P, fluid_c);
-
-  if (p_rhoc > 0) then
-    rhoc = p_rhoc;
-  else
-    rhoc = promc.d;
-  end if;
-
-  /* Fluid thermodynamic properties at the cold side */
-  profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_f);
-  profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f);
-  promf = ThermoSysPro.Properties.Fluid.Ph((Ef.P + Sf.P)/2, (Ef.h + Sf.h)/2, mode_f, fluid_f);
-
-  Tef = profe.T;
-  Tsf = profs.T;
-
-  if (p_rhof > 0) then
-    rhof = p_rhof;
-  else
-    rhof = promf.d;
-  end if;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0}),
-          Line(
-          points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}},
-          color={0,0,255},
-          thickness=0),
-        Text(
-          extent={{-104,-90},{-76,-110}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Steam inlet"),
-        Text(
-          extent={{-132,28},{-106,14}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold inlet"),
-        Text(
-          extent={{104,28},{134,12}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold outlet"),
-        Text(
-          extent={{78,-90},{106,-110}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Steam outlet")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={255,255,0}),
-        Line(
-          points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-110,21},{-90,11}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Cold inlet"),
-        Text(
-          extent={{-46,-93},{-26,-103}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Hot inlet"),
-        Text(
-          extent={{28,-93},{48,-103}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Hot outlet"),
-        Text(
-          extent={{88,20},{110,9}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Cold outlet")}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end SimpleStaticCondenser;
+within ThermoSysPro.Fluid.HeatExchangers;
+model SimpleStaticCondenser "Simple static condenser"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real Kc=10 "Friction pressure loss coefficient for the hot side";
+  parameter Real Kf=10 "Friction pressure loss coefficient for the cold side";
+  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
+  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
+  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
+  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot side";
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold side";
+  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
+    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
+    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
+  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_cs=IF97Region.All_regions "IF97 region of the water at the outlet of the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_cs=Integer(region_cs) - 1 "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.Power W(start=1e6)
+    "Power exchanged from the hot side to the cold side";
+  Units.SI.Temperature Tec(start=500)
+    "Fluid temperature at the inlet of the hot side";
+  Units.SI.Temperature Tsc(start=400)
+    "Fluid temperature at the outlet of the hot side";
+  Units.SI.Temperature Tef(start=350)
+    "Fluid temperature at the inlet of the cold side";
+  Units.SI.Temperature Tsf(start=350)
+    "Fluid temperature at the outlet of the cold side";
+  ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3)
+    "Friction pressure loss in the hot side";
+  ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2)
+    "Gravity pressure loss in the hot side";
+  ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3)
+    "Total pressure loss in the hot side";
+  ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3)
+    "Friction pressure loss in the cold side";
+  ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2)
+    "Gravity pressure loss in the cold side";
+  ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3)
+    "Total pressure loss in the cold side";
+  Units.SI.Density rhoc(start=998) "Density of the fluid in the hot side";
+  Units.SI.Density rhof(start=998) "Density of the fluid in the cold side";
+  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+  FluidType ftype_c "Fluid type for the hot fluid";
+  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
+  FluidType ftype_f "Fluid type for the cold fluid";
+  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
+
+public
+  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
+          extent={{-70,-110},{-50,-90}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
+          extent={{90,-11},{110,9}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
+          extent={{50,-110},{70,-90}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{40,80},{60,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promc
+    annotation (Placement(transformation(extent={{0,-100},{20,-80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+equation
+
+  /* Check that the fluid type for both sides is water/steam */
+  assert((ftype_c == FluidType.WaterSteam) or (ftype_c == FluidType.WaterSteamSimple), "SimpleStaticCondenser: the fluid type must be water/steam for the hot side");
+  assert((ftype_f == FluidType.WaterSteam) or (ftype_f == FluidType.WaterSteamSimple), "SimpleStaticCondenser: the fluid type must be water/steam for the cold side");
+
+  /* Mass flow rates */
+  Ec.Q = Sc.Q;
+
+  Ec.h_vol_1 = Sc.h_vol_1;
+  Ec.h_vol_2 = Sc.h_vol_2;
+
+  Sc.diff_on_1 = Ec.diff_on_1;
+  Ec.diff_on_2 = Sc.diff_on_2;
+
+  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
+  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
+
+  Ec.ftype = Sc.ftype;
+
+  Ec.Xco2 = Sc.Xco2;
+  Ec.Xh2o = Sc.Xh2o;
+  Ec.Xo2  = Sc.Xo2;
+  Ec.Xso2 = Sc.Xso2;
+
+  ftype_c = Ec.ftype;
+
+  Ef.Q = Sf.Q;
+
+  Ef.h_vol_1 = Sf.h_vol_1;
+  Ef.h_vol_2 = Sf.h_vol_2;
+
+  Sf.diff_on_1 = Ef.diff_on_1;
+  Ef.diff_on_2 = Sf.diff_on_2;
+
+  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
+  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
+
+  Ef.ftype = Sf.ftype;
+
+  Ef.Xco2 = Sf.Xco2;
+  Ef.Xh2o = Sf.Xh2o;
+  Ef.Xo2  = Sf.Xo2;
+  Ef.Xso2 = Sf.Xso2;
+
+  ftype_f = Ef.ftype;
+
+  Qc = Ec.Q;
+  Qf = Ef.Q;
+
+  /* The fluid specific enthalpy at the outlet of the hot side is assumed to be at the saturation point */
+  Sc.h = lsat.h;
+
+  /* Power exchanged between the two sides */
+  W = Qf*(Sf.h - Ef.h);
+  W = Qc*(Ec.h - Sc.h);
+
+  /* Pressure losses in the hot side */
+  Ec.P - Sc.P = DPc;
+
+  DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
+  DPgc = rhoc*g*(z2c - z1c);
+  DPc  = DPfc + DPgc;
+
+  /* Pressure losses in the cold side */
+  Ef.P - Sf.P = DPf;
+
+  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
+  DPgf = rhof*g*(z2f - z1f);
+  DPf  = DPff + DPgf;
+
+  /* Fluid thermodynamic properties at the hot side */
+  proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c);
+  procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_cs, fluid_c);
+  promc = ThermoSysPro.Properties.Fluid.Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, mode_c, fluid_c);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Ec.P, fluid_c);
+
+  if (p_rhoc > 0) then
+    rhoc = p_rhoc;
+  else
+    rhoc = promc.d;
+  end if;
+
+  /* Fluid thermodynamic properties at the cold side */
+  profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_f);
+  profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f);
+  promf = ThermoSysPro.Properties.Fluid.Ph((Ef.P + Sf.P)/2, (Ef.h + Sf.h)/2, mode_f, fluid_f);
+
+  Tef = profe.T;
+  Tsf = profs.T;
+
+  if (p_rhof > 0) then
+    rhof = p_rhof;
+  else
+    rhof = promf.d;
+  end if;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0}),
+          Line(
+          points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}},
+          color={0,0,255},
+          thickness=0),
+        Text(
+          extent={{-104,-90},{-76,-110}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Steam inlet"),
+        Text(
+          extent={{-132,28},{-106,14}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold inlet"),
+        Text(
+          extent={{104,28},{134,12}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold outlet"),
+        Text(
+          extent={{78,-90},{106,-110}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Steam outlet")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={255,255,0}),
+        Line(
+          points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-110,21},{-90,11}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Cold inlet"),
+        Text(
+          extent={{-46,-93},{-26,-103}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Hot inlet"),
+        Text(
+          extent={{28,-93},{48,-103}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Hot outlet"),
+        Text(
+          extent={{88,20},{110,9}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Cold outlet")}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end SimpleStaticCondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo
index e2d4a45dbdc470b539bf6ecad3629e688a334660..1692d273ab0dab10896af77ca56e54d96e417f07 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo
@@ -1,520 +1,520 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model StaticAerocondenser "Static aerocondenser"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.CoefficientOfHeatTransfer Uref=50
-    "Reference heat transfer coefficient between the air and the condenser external wall";
-  parameter Real UCOR=1. "Heat transfer corrective coefficient";
-  parameter Units.SI.Area Se=1.e4 "Condenser external wall area";
-  parameter Units.SI.Height z=0 "Water level in the condenser";
-  parameter Real K=0.02 "Pressure loss coefficient for the water/steam pipe (Pa.s²/(kg.m**3))";
-  parameter Real Ka=0.00 "Pressure loss coefficient for the air (Pa.s²/(kg.m**3))";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Air diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_s=IF97Region.All_regions "IF97 region at the outlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer fluid_w=Integer(ftype) "Water fluid number";
-  parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_s=Integer(region_s) - 1 "IF97 region at the outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.SpecificEnthalpy he(start=370000)
-    "Water specific enthalpy at the outlet of the condenser";
-  Units.SI.SpecificEnthalpy hae(start=75000)
-    "Air specific enthalpy at the inlet of the condenser";
-  Units.SI.SpecificEnthalpy has(start=100000)
-    "Air specific enthalpy at the outlet of the condenser";
-  Units.SI.MassFlowRate Q(start=1.5e2)
-    "Fluid mass flow rate in the water/steam pipe";
-  Units.SI.MassFlowRate Qa(start=1.4e3) "Air mass flow rate in the condenser";
-  Units.SI.Temperature Tae(start=290)
-    "Air temperature at the inlet of the condenser";
-  Units.SI.Temperature Tas(start=360)
-    "Air temperature at the outlet of the condenser";
-  Units.SI.AbsolutePressure Pae(start=1.e5)
-    "Air pressure at the inlet of the condenser";
-  Units.SI.AbsolutePressure Pas(start=1.e5)
-    "Air pressure at the outlet of the condenser";
-  Units.SI.AbsolutePressure Pfond(start=30000)
-    "Water pressure at the bottom of the condenser";
-  Units.SI.AbsolutePressure Pcond(start=17000) "Condensation pressure (vacuum)";
-  Units.SI.Temperature Tcond(start=360) "Condensation temperature";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Total air pressure loss";
-  Units.SI.CoefficientOfHeatTransfer U(start=50) "Heat transfer coefficient";
-  Units.SI.SpecificHeatCapacity cp_a(start=1000)
-    "Air specific heat capacity at constant pressure";
-  Real Nut(start=2.) "Number of transfer units";
-  Real Ef(start=0.8) "Efficiency in two-phase flow regime";
-  Units.SI.Power W "Heat power transfered to the cooling air";
-  Units.SI.Density rho_e(start=998)
-    "Water density at the outlet of the condenser";
-  Units.SI.Density rho_a(start=1) "Air density";
-  FluidType fluids[4] "Fluids mixing in volume";
-  Units.SI.Power Jws1 "Thermal power diffusion from inlet Cws1";
-  Units.SI.Power Jw "Thermal power diffusion from inlet Cw";
-  Units.SI.Power Jws2 "Thermal power diffusion from outlet Cws2";
-  Units.SI.Power J "Total thermal power diffusion for the liquid in the cavity";
-  Units.SI.MassFlowRate gamma_ws1 "Diffusion conductance for inlet Cws1";
-  Units.SI.MassFlowRate gamma_w "Diffusion conductance for inlet Cw";
-  Units.SI.MassFlowRate gamma_ws2 "Diffusion conductance for outlet Cws2";
-  Real rws1 "Value of r(Q/gamma) for inlet Cws1";
-  Real rw "Value of r(Q/gamma) for inlet Cw";
-  Real rws2 "Value of r(Q/gamma) for outlet Cws1";
-  FluidType ftype_a "Air fluid type";
-  Integer fluid_a=Integer(ftype_a) "Air fluid number";
-
-public
-  Interfaces.Connectors.FluidInlet Cws1 annotation (Placement(transformation(
-          extent={{-10,100},{10,120}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cws2 annotation (Placement(transformation(
-          extent={{-10,-120},{10,-100}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Cair1 annotation (Placement(transformation(
-          extent={{100,-119},{120,-99}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cair2 annotation (Placement(transformation(
-          extent={{100,100},{120,120}}, rotation=0)));
-public
-  Interfaces.Connectors.FluidInlet Cw annotation (Placement(transformation(
-          extent={{-120,-100},{-100,-80}}, rotation=0), iconTransformation(
-          extent={{-120,-100},{-100,-80}})));
-  Properties.WaterSteam.Common.ThermoProperties_ph proe "Water properties"
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  Properties.WaterSteam.Common.PropThermoSat lsat annotation (Placement(
-        transformation(extent={{-100,80},{-80,100}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Cws1.ftype;
-  fluids[3] = Cw.ftype;
-  fluids[4] = Cws2.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticAerocondenser: fluids mixing in condenser volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Cw) == 0) then
-    Cw.Q = 0;
-    Cw.h = 1.e5;
-    Cw.h_vol_1 = 1.e5;
-    Cw.diff_res_1 = 0;
-    Cw.diff_on_1 = false;
-    Cw.ftype = ftype;
-    Cw.Xco2 = 0;
-    Cw.Xh2o = 1;
-    Cw.Xo2 = 0;
-    Cw.Xso2 = 0;
-  end if;
-
-  /* Pressure at the bottom of the condenser*/
-  Pfond = Pcond + rho_e*g*z;
-
-  /* Water/steam mass balance equation */
-  0 = Cws1.Q + Cw.Q - Cws2.Q;
-
-  Q = Cws2.Q;
-
-  Pcond = Cws1.P;
-  Pcond = Cw.P;
-  Pfond = Cws2.P;
-
-  /* Water/steam energy balance equation */
-  0 = (Cws1.h - he)*Cws1.Q + (Cw.h - he)*Cw.Q - (Cws2.h - he)*Cws2.Q - W + J;
-  // if noEvent(Qa > 0) then
-  //  (has - hae)*Qa - ((Cws1.h - he)*Q + (Cw.h - he)*Cw.Q) = 0;
-  // else
-  //  (has - hae)*1.e-6 - ((Cws1.h - he)*Q + (Cw.h - he)*Cw.Q) = 0;
-  // end if;
-
-  Cws1.h_vol_2 = he;
-  Cw.h_vol_2 = he;
-  Cws2.h_vol_1 = he;
-
-  /* Fluid composition in the cavity (no balance equations) */
-  Cws2.ftype = ftype;
-
-  Cws2.Xco2 = 0;
-  Cws2.Xh2o = 1;
-  Cws2.Xo2  = 0;
-  Cws2.Xso2 = 0;
-
-  /* Air inlet and outlet */
-  Cair1.Q = Cair2.Q;
-
-  Cair1.h_vol_1 = Cair2.h_vol_1;
-  Cair1.h_vol_2 = Cair2.h_vol_2;
-
-  Cair2.diff_on_1 = Cair1.diff_on_1;
-  Cair1.diff_on_2 = Cair2.diff_on_2;
-
-  Cair2.diff_res_1 = Cair1.diff_res_1 + 1/gamma_diff;
-  Cair1.diff_res_2 = Cair2.diff_res_2 + 1/gamma_diff;
-
-  Cair1.ftype = Cair2.ftype;
-
-  Cair1.Xco2 = Cair2.Xco2;
-  Cair1.Xh2o = Cair2.Xh2o;
-  Cair1.Xo2  = Cair2.Xo2;
-  Cair1.Xso2 = Cair2.Xso2;
-
-  ftype_a = Cair1.ftype;
-
-  Qa = Cair1.Q;
-  Pae = Cair1.P;
-  Pas = Cair2.P;
-  hae = Cair1.h;
-  has = Cair2.h;
-
-  deltaP = Cair1.P - Cair2.P;
-
-  /* Air pressure loss */
-  deltaP = Ka*Qa*abs(Qa)/rho_a;
-
-  /* Heat power transferred to the cooling water */
-  W = Qa*(has - hae);
-
-  /* Heat exchange coefficient */
-  U = UCOR*Uref*(-2.e-4*(Tae - 273.16)^2 + 0.0187*(Tae - 273.16) + 0.5007);
-
-  /* Number of transfer units */
-  Nut = if noEvent(Qa*cp_a > 0) then Se*U/(Qa*cp_a) else 2.;
-
-  /* Efficiency in the two-phase flow regime */
-  Ef = 1 - exp(-Nut);
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cws2.h = ThermoSysPro.Functions.SmoothCond(Cws2.Q/gamma_ws2, Cws2.h_vol_1, Cws2.h_vol_2, 1);
-  else
-    Cws2.h = if (Cws2.Q > 0) then Cws2.h_vol_1 else Cws2.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    rws1 = if Cws1.diff_on_1 then exp(-0.033*(Cws1.Q*Cws1.diff_res_1)^2) else 0;
-    rw = if Cw.diff_on_1 then exp(-0.033*(Cw.Q*Cw.diff_res_1)^2) else 0;
-    rws2 = if Cws2.diff_on_2 then exp(-0.033*(Cws2.Q*Cws2.diff_res_2)^2) else 0;
-
-    gamma_ws1 = if Cws1.diff_on_1 then 1/Cws1.diff_res_1 else gamma0;
-    gamma_w = if Cw.diff_on_1 then 1/Cw.diff_res_1 else gamma0;
-    gamma_ws2 = if Cws2.diff_on_2 then 1/Cws2.diff_res_2 else gamma0;
-
-    Jws1 = if Cws1.diff_on_1 then rws1*gamma_ws1*(Cws1.h_vol_1 - Cws1.h_vol_2) else 0;
-    Jw = if Cw.diff_on_1 then rw*gamma_w*(Cw.h_vol_1 - Cw.h_vol_2) else 0;
-    Jws2 = if Cws2.diff_on_2 then rws2*gamma_ws2*(Cws2.h_vol_2 - Cws2.h_vol_1) else 0;
-  else
-    rws1 = 0;
-    rw = 0;
-    rws2 = 0;
-
-    gamma_ws1 = gamma0;
-    gamma_w = gamma0;
-    gamma_ws2 = gamma0;
-
-    Jws1 = 0;
-    Jw = 0;
-    Jws2 = 0;
-   end if;
-
-  J = Jws1 + Jw + Jws2;
-
-  Cws1.diff_res_2 = 0;
-  Cw.diff_res_2 = 0;
-  Cws2.diff_res_1 = 0;
-
-  Cws1.diff_on_2 = diffusion;
-  Cw.diff_on_2 = diffusion;
-  Cws2.diff_on_1 = diffusion;
-
-  /* Condensation temperature */
-  Tcond = ((Tas + Tae*(Ef - 1.0))/Ef);
-
-  /* Condensation pressure */
-  Pcond = ThermoSysPro.Properties.Fluid.P_sat(Tcond, fluid_w);
-
-  /* Water/steam thermodynamic properties */
-  proe = ThermoSysPro.Properties.Fluid.Ph((Pfond + Pcond)/2, he, mode_s, fluid_w);
-  rho_e = proe.d;
-
-  /* Water specific enthalpy at the saturation point with pressure Pcond */
-  lsat = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid_w);
-  he = lsat.h;
-
-  /* Air thermodynamic properties */
-  hae = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pae, Tae, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  has = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pas, Tas, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  rho_a = ThermoSysPro.Properties.Fluid.Density_Ph(Pae, hae,  fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  cp_a = ThermoSysPro.Properties.FlueGases.FlueGases_cp((Pae + Pas)/2, (Tae + Tas)/2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  //cp_a = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_PT((Pae + Pas)/2, (Tae + Tas)/2, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-120,-120},{120,120}},
-        grid={2,2}), graphics={
-        Text(
-          extent={{86,112},{98,102}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Air"),
-        Text(
-          extent={{82,-106},{94,-116}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Air"),
-        Text(
-          extent={{-36,-112},{-12,-120}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Water"),
-        Text(
-          extent={{-38,114},{-12,106}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Steam"),
-        Polygon(
-          points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}},
-          lineColor={28,108,200},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{89,40},{79,20},{99,20},{89,40}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{89,20},{89,4}},
-          color={0,0,0},
-          thickness=1),
-        Ellipse(
-          extent={{-20,100},{20,60}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={255,0,0}),
-        Ellipse(
-          extent={{60,-39},{100,-79}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,128,255}),
-        Ellipse(
-          extent={{-100,-39},{-60,-79}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,128,255}),
-        Polygon(
-          points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,0,0}),
-        Polygon(
-          points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}},
-          lineColor={255,128,0},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}},
-          lineColor={0,128,255},
-          fillColor={0,128,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{38,33},{30,29},{9,64},{16,69},{38,33}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,0,0}),
-        Polygon(
-          points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,128,0}),
-        Polygon(
-          points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={0,128,255}),
-        Polygon(
-          points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}},
-          lineColor={28,108,200},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}},
-          lineColor={28,108,200},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-100,-79},{-80,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,255,255}),
-        Ellipse(
-          extent={{80,-79},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,255,255}),
-        Rectangle(
-          extent={{-89,-79},{90,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,255,255}),
-        Text(
-          extent={{-38,22},{36,-38}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={255,255,0},
-          textString=
-               "Volume")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-120,-120},{120,120}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}},
-          lineColor={0,255,0},
-          fillColor= DynamicSelect({85,170,255},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid,
-          lineThickness=0),
-        Line(
-          points={{110,20},{110,-8}},
-          color={0,0,0},
-          thickness=0),
-        Ellipse(
-          extent={{-20,100},{20,60}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={255,0,0}),
-        Ellipse(
-          extent={{60,-39},{100,-79}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,128,255}),
-        Ellipse(
-          extent={{-100,-39},{-60,-79}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,128,255}),
-        Polygon(
-          points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,0,0}),
-        Polygon(
-          points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}},
-          lineColor={255,128,0},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}},
-          lineColor={0,128,255},
-          fillColor={0,128,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{38,33},{30,29},{9,64},{16,69},{38,33}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,0,0}),
-        Polygon(
-          points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,128,0}),
-        Polygon(
-          points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={0,128,255}),
-        Polygon(
-          points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}},
-          lineColor={28,108,200},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}},
-          lineColor={28,108,200},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{80,-79},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,255,255}),
-        Ellipse(
-          extent={{-100,-79},{-80,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,255,255}),
-        Rectangle(
-          extent={{-89,-79},{90,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={0,255,255}),
-        Text(
-          extent={{20,120},{54,100}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Steam inlet"),
-        Text(
-          extent={{126,116},{154,100}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Air outlet"),
-        Text(
-          extent={{126,-104},{150,-116}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Air inlet"),
-        Line(
-          points={{110,-99},{110,104}},
-          color={28,108,200},
-          thickness=1),
-        Polygon(
-          points={{110,12},{100,-8},{120,-8},{110,12}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0})}),
-    Window(
-      x=0.09,
-      y=0.08,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StaticAerocondenser;
+within ThermoSysPro.Fluid.HeatExchangers;
+model StaticAerocondenser "Static aerocondenser"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.CoefficientOfHeatTransfer Uref=50
+    "Reference heat transfer coefficient between the air and the condenser external wall";
+  parameter Real UCOR=1. "Heat transfer corrective coefficient";
+  parameter Units.SI.Area Se=1.e4 "Condenser external wall area";
+  parameter Units.SI.Height z=0 "Water level in the condenser";
+  parameter Real K=0.02 "Pressure loss coefficient for the water/steam pipe (Pa.s²/(kg.m**3))";
+  parameter Real Ka=0.00 "Pressure loss coefficient for the air (Pa.s²/(kg.m**3))";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Air diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_s=IF97Region.All_regions "IF97 region at the outlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer fluid_w=Integer(ftype) "Water fluid number";
+  parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_s=Integer(region_s) - 1 "IF97 region at the outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.SpecificEnthalpy he(start=370000)
+    "Water specific enthalpy at the outlet of the condenser";
+  Units.SI.SpecificEnthalpy hae(start=75000)
+    "Air specific enthalpy at the inlet of the condenser";
+  Units.SI.SpecificEnthalpy has(start=100000)
+    "Air specific enthalpy at the outlet of the condenser";
+  Units.SI.MassFlowRate Q(start=1.5e2)
+    "Fluid mass flow rate in the water/steam pipe";
+  Units.SI.MassFlowRate Qa(start=1.4e3) "Air mass flow rate in the condenser";
+  Units.SI.Temperature Tae(start=290)
+    "Air temperature at the inlet of the condenser";
+  Units.SI.Temperature Tas(start=360)
+    "Air temperature at the outlet of the condenser";
+  Units.SI.AbsolutePressure Pae(start=1.e5)
+    "Air pressure at the inlet of the condenser";
+  Units.SI.AbsolutePressure Pas(start=1.e5)
+    "Air pressure at the outlet of the condenser";
+  Units.SI.AbsolutePressure Pfond(start=30000)
+    "Water pressure at the bottom of the condenser";
+  Units.SI.AbsolutePressure Pcond(start=17000) "Condensation pressure (vacuum)";
+  Units.SI.Temperature Tcond(start=360) "Condensation temperature";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Total air pressure loss";
+  Units.SI.CoefficientOfHeatTransfer U(start=50) "Heat transfer coefficient";
+  Units.SI.SpecificHeatCapacity cp_a(start=1000)
+    "Air specific heat capacity at constant pressure";
+  Real Nut(start=2.) "Number of transfer units";
+  Real Ef(start=0.8) "Efficiency in two-phase flow regime";
+  Units.SI.Power W "Heat power transfered to the cooling air";
+  Units.SI.Density rho_e(start=998)
+    "Water density at the outlet of the condenser";
+  Units.SI.Density rho_a(start=1) "Air density";
+  FluidType fluids[4] "Fluids mixing in volume";
+  Units.SI.Power Jws1 "Thermal power diffusion from inlet Cws1";
+  Units.SI.Power Jw "Thermal power diffusion from inlet Cw";
+  Units.SI.Power Jws2 "Thermal power diffusion from outlet Cws2";
+  Units.SI.Power J "Total thermal power diffusion for the liquid in the cavity";
+  Units.SI.MassFlowRate gamma_ws1 "Diffusion conductance for inlet Cws1";
+  Units.SI.MassFlowRate gamma_w "Diffusion conductance for inlet Cw";
+  Units.SI.MassFlowRate gamma_ws2 "Diffusion conductance for outlet Cws2";
+  Real rws1 "Value of r(Q/gamma) for inlet Cws1";
+  Real rw "Value of r(Q/gamma) for inlet Cw";
+  Real rws2 "Value of r(Q/gamma) for outlet Cws1";
+  FluidType ftype_a "Air fluid type";
+  Integer fluid_a=Integer(ftype_a) "Air fluid number";
+
+public
+  Interfaces.Connectors.FluidInlet Cws1 annotation (Placement(transformation(
+          extent={{-10,100},{10,120}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cws2 annotation (Placement(transformation(
+          extent={{-10,-120},{10,-100}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Cair1 annotation (Placement(transformation(
+          extent={{100,-119},{120,-99}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cair2 annotation (Placement(transformation(
+          extent={{100,100},{120,120}}, rotation=0)));
+public
+  Interfaces.Connectors.FluidInlet Cw annotation (Placement(transformation(
+          extent={{-120,-100},{-100,-80}}, rotation=0), iconTransformation(
+          extent={{-120,-100},{-100,-80}})));
+  Properties.WaterSteam.Common.ThermoProperties_ph proe "Water properties"
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  Properties.WaterSteam.Common.PropThermoSat lsat annotation (Placement(
+        transformation(extent={{-100,80},{-80,100}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Cws1.ftype;
+  fluids[3] = Cw.ftype;
+  fluids[4] = Cws2.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticAerocondenser: fluids mixing in condenser volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Cw) == 0) then
+    Cw.Q = 0;
+    Cw.h = 1.e5;
+    Cw.h_vol_1 = 1.e5;
+    Cw.diff_res_1 = 0;
+    Cw.diff_on_1 = false;
+    Cw.ftype = ftype;
+    Cw.Xco2 = 0;
+    Cw.Xh2o = 0;
+    Cw.Xo2 = 0;
+    Cw.Xso2 = 0;
+  end if;
+
+  /* Pressure at the bottom of the condenser*/
+  Pfond = Pcond + rho_e*g*z;
+
+  /* Water/steam mass balance equation */
+  0 = Cws1.Q + Cw.Q - Cws2.Q;
+
+  Q = Cws2.Q;
+
+  Pcond = Cws1.P;
+  Pcond = Cw.P;
+  Pfond = Cws2.P;
+
+  /* Water/steam energy balance equation */
+  0 = (Cws1.h - he)*Cws1.Q + (Cw.h - he)*Cw.Q - (Cws2.h - he)*Cws2.Q - W + J;
+  // if noEvent(Qa > 0) then
+  //  (has - hae)*Qa - ((Cws1.h - he)*Q + (Cw.h - he)*Cw.Q) = 0;
+  // else
+  //  (has - hae)*1.e-6 - ((Cws1.h - he)*Q + (Cw.h - he)*Cw.Q) = 0;
+  // end if;
+
+  Cws1.h_vol_2 = he;
+  Cw.h_vol_2 = he;
+  Cws2.h_vol_1 = he;
+
+  /* Fluid composition in the cavity (no balance equations) */
+  Cws2.ftype = ftype;
+
+  Cws2.Xco2 = 0;
+  Cws2.Xh2o = 0;
+  Cws2.Xo2  = 0;
+  Cws2.Xso2 = 0;
+
+  /* Air inlet and outlet */
+  Cair1.Q = Cair2.Q;
+
+  Cair1.h_vol_1 = Cair2.h_vol_1;
+  Cair1.h_vol_2 = Cair2.h_vol_2;
+
+  Cair2.diff_on_1 = Cair1.diff_on_1;
+  Cair1.diff_on_2 = Cair2.diff_on_2;
+
+  Cair2.diff_res_1 = Cair1.diff_res_1 + 1/gamma_diff;
+  Cair1.diff_res_2 = Cair2.diff_res_2 + 1/gamma_diff;
+
+  Cair1.ftype = Cair2.ftype;
+
+  Cair1.Xco2 = Cair2.Xco2;
+  Cair1.Xh2o = Cair2.Xh2o;
+  Cair1.Xo2  = Cair2.Xo2;
+  Cair1.Xso2 = Cair2.Xso2;
+
+  ftype_a = Cair1.ftype;
+
+  Qa = Cair1.Q;
+  Pae = Cair1.P;
+  Pas = Cair2.P;
+  hae = Cair1.h;
+  has = Cair2.h;
+
+  deltaP = Cair1.P - Cair2.P;
+
+  /* Air pressure loss */
+  deltaP = Ka*Qa*abs(Qa)/rho_a;
+
+  /* Heat power transferred to the cooling water */
+  W = Qa*(has - hae);
+
+  /* Heat exchange coefficient */
+  U = UCOR*Uref*(-2.e-4*(Tae - 273.16)^2 + 0.0187*(Tae - 273.16) + 0.5007);
+
+  /* Number of transfer units */
+  Nut = if noEvent(Qa*cp_a > 0) then Se*U/(Qa*cp_a) else 2.;
+
+  /* Efficiency in the two-phase flow regime */
+  Ef = 1 - exp(-Nut);
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cws2.h = ThermoSysPro.Functions.SmoothCond(Cws2.Q/gamma_ws2, Cws2.h_vol_1, Cws2.h_vol_2, 1);
+  else
+    Cws2.h = if (Cws2.Q > 0) then Cws2.h_vol_1 else Cws2.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    rws1 = if Cws1.diff_on_1 then exp(-0.033*(Cws1.Q*Cws1.diff_res_1)^2) else 0;
+    rw = if Cw.diff_on_1 then exp(-0.033*(Cw.Q*Cw.diff_res_1)^2) else 0;
+    rws2 = if Cws2.diff_on_2 then exp(-0.033*(Cws2.Q*Cws2.diff_res_2)^2) else 0;
+
+    gamma_ws1 = if Cws1.diff_on_1 then 1/Cws1.diff_res_1 else gamma0;
+    gamma_w = if Cw.diff_on_1 then 1/Cw.diff_res_1 else gamma0;
+    gamma_ws2 = if Cws2.diff_on_2 then 1/Cws2.diff_res_2 else gamma0;
+
+    Jws1 = if Cws1.diff_on_1 then rws1*gamma_ws1*(Cws1.h_vol_1 - Cws1.h_vol_2) else 0;
+    Jw = if Cw.diff_on_1 then rw*gamma_w*(Cw.h_vol_1 - Cw.h_vol_2) else 0;
+    Jws2 = if Cws2.diff_on_2 then rws2*gamma_ws2*(Cws2.h_vol_2 - Cws2.h_vol_1) else 0;
+  else
+    rws1 = 0;
+    rw = 0;
+    rws2 = 0;
+
+    gamma_ws1 = gamma0;
+    gamma_w = gamma0;
+    gamma_ws2 = gamma0;
+
+    Jws1 = 0;
+    Jw = 0;
+    Jws2 = 0;
+   end if;
+
+  J = Jws1 + Jw + Jws2;
+
+  Cws1.diff_res_2 = 0;
+  Cw.diff_res_2 = 0;
+  Cws2.diff_res_1 = 0;
+
+  Cws1.diff_on_2 = diffusion;
+  Cw.diff_on_2 = diffusion;
+  Cws2.diff_on_1 = diffusion;
+
+  /* Condensation temperature */
+  Tcond = ((Tas + Tae*(Ef - 1.0))/Ef);
+
+  /* Condensation pressure */
+  Pcond = ThermoSysPro.Properties.Fluid.P_sat(Tcond, fluid_w);
+
+  /* Water/steam thermodynamic properties */
+  proe = ThermoSysPro.Properties.Fluid.Ph((Pfond + Pcond)/2, he, mode_s, fluid_w);
+  rho_e = proe.d;
+
+  /* Water specific enthalpy at the saturation point with pressure Pcond */
+  lsat = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid_w);
+  he = lsat.h;
+
+  /* Air thermodynamic properties */
+  hae = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pae, Tae, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  has = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pas, Tas, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  rho_a = ThermoSysPro.Properties.Fluid.Density_Ph(Pae, hae,  fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  cp_a = ThermoSysPro.Properties.FlueGases.FlueGases_cp((Pae + Pas)/2, (Tae + Tas)/2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  //cp_a = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_PT((Pae + Pas)/2, (Tae + Tas)/2, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-120,-120},{120,120}},
+        grid={2,2}), graphics={
+        Text(
+          extent={{86,112},{98,102}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Air"),
+        Text(
+          extent={{82,-106},{94,-116}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Air"),
+        Text(
+          extent={{-36,-112},{-12,-120}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Water"),
+        Text(
+          extent={{-38,114},{-12,106}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Steam"),
+        Polygon(
+          points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}},
+          lineColor={28,108,200},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{89,40},{79,20},{99,20},{89,40}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{89,20},{89,4}},
+          color={0,0,0},
+          thickness=1),
+        Ellipse(
+          extent={{-20,100},{20,60}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={255,0,0}),
+        Ellipse(
+          extent={{60,-39},{100,-79}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,128,255}),
+        Ellipse(
+          extent={{-100,-39},{-60,-79}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,128,255}),
+        Polygon(
+          points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,0,0}),
+        Polygon(
+          points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}},
+          lineColor={255,128,0},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}},
+          lineColor={0,128,255},
+          fillColor={0,128,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{38,33},{30,29},{9,64},{16,69},{38,33}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,0,0}),
+        Polygon(
+          points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}),
+        Polygon(
+          points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Polygon(
+          points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}},
+          lineColor={28,108,200},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}},
+          lineColor={28,108,200},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-100,-79},{-80,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,255,255}),
+        Ellipse(
+          extent={{80,-79},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,255,255}),
+        Rectangle(
+          extent={{-89,-79},{90,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,255,255}),
+        Text(
+          extent={{-38,22},{36,-38}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={255,255,0},
+          textString=
+               "Volume")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-120,-120},{120,120}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}},
+          lineColor={0,255,0},
+          fillColor= DynamicSelect({85,170,255},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid,
+          lineThickness=0),
+        Line(
+          points={{110,20},{110,-8}},
+          color={0,0,0},
+          thickness=0),
+        Ellipse(
+          extent={{-20,100},{20,60}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={255,0,0}),
+        Ellipse(
+          extent={{60,-39},{100,-79}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,128,255}),
+        Ellipse(
+          extent={{-100,-39},{-60,-79}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,128,255}),
+        Polygon(
+          points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,0,0}),
+        Polygon(
+          points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}},
+          lineColor={255,128,0},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}},
+          lineColor={0,128,255},
+          fillColor={0,128,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{38,33},{30,29},{9,64},{16,69},{38,33}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,0,0}),
+        Polygon(
+          points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}),
+        Polygon(
+          points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Polygon(
+          points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}},
+          lineColor={28,108,200},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}},
+          lineColor={28,108,200},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{80,-79},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,255,255}),
+        Ellipse(
+          extent={{-100,-79},{-80,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,255,255}),
+        Rectangle(
+          extent={{-89,-79},{90,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={0,255,255}),
+        Text(
+          extent={{20,120},{54,100}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Steam inlet"),
+        Text(
+          extent={{126,116},{154,100}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Air outlet"),
+        Text(
+          extent={{126,-104},{150,-116}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Air inlet"),
+        Line(
+          points={{110,-99},{110,104}},
+          color={28,108,200},
+          thickness=1),
+        Polygon(
+          points={{110,12},{100,-8},{120,-8},{110,12}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0})}),
+    Window(
+      x=0.09,
+      y=0.08,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StaticAerocondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo
index cc3acc08ed7afa27e95eaa95d5c103bd5e738891..6fa7fc88e15c209085371c556e2a790b3f1142f7 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo
@@ -1,505 +1,505 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model StaticCondenser "Static condenser"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Area SCO=10000 "Heat exchange surface";
-  parameter Real CPCE=0.02 "Pressure loss coefficient for the water side (Pa.s²/(kg.m**3))";
-  parameter Units.SI.Height z=0.5 "Water level in the condenser";
-  parameter Units.SI.CoefficientOfHeatTransfer KCO=1
-    "Reference heat exchange coefficient";
-  parameter Units.SI.MassFlowRate QC0=100 "Reference mass flow rate";
-  parameter Units.SI.Temperature Tref=293 "Reference temperature";
-  parameter Real COPR=1 "Reference fouling coefficient";
-  parameter Real COP=1 "Actual fouling coefficient";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Air diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region_ee=IF97Region.All_regions "IF97 region at the water inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_se=IF97Region.All_regions "IF97 region at the water outlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_ex=IF97Region.All_regions "IF97 region at the extraction point (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer fluid=Integer(ftype) "Water fluid number";
-  parameter Integer mode_ee=Integer(region_ee) - 1 "IF97 region at the water inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_se=Integer(region_se) - 1 "IF97 region at the water outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_ex=Integer(region_ex) - 1 "IF97 region at the extraction point. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.MassFlowRate Qee(start=10)
-    "Cooling water mass flow rate at the inlet";
-  Units.SI.SpecificEnthalpy Hee(start=250000)
-    "Cooling water specific anthalpy at the inlet";
-  Units.SI.AbsolutePressure Pee(start=1.e5)
-    "Cooling water pressure at the inlet";
-  Units.SI.MassFlowRate Qep(start=10) "Drain mass flow rate at the inlet";
-  Units.SI.SpecificEnthalpy Hep(start=1000000)
-    "Drain specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qev(start=10) "Vapor mass flow rate at the inlet";
-  Units.SI.SpecificEnthalpy Hev(start=2500000)
-    "Vapor specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qvt(start=10)
-    "Vapor mass flow rate leaving the turbine";
-  Units.SI.SpecificEnthalpy Hvt(start=2500000)
-    "Vapor specific enthalpy leaving the turbine";
-  Units.SI.MassFlowRate Qse(start=10)
-    "Cooling water mass flow rate at the outlet";
-  Units.SI.SpecificEnthalpy Hse(start=500000)
-    "Cooling water specific enthalpy at the outlet";
-  Units.SI.AbsolutePressure Pse(start=1.e5)
-    "Cooling water pressure at the outlet";
-  Units.SI.MassFlowRate Qex(start=10) "Drain mass flow rate at the outlet";
-  Units.SI.SpecificEnthalpy Hex(start=500000)
-    "Drain specific enthalpy at the outlet";
-  Units.SI.AbsolutePressure Pex(start=1.e5) "Drain pressure at the outlet";
-  Units.SI.SpecificEnthalpy Hsate(start=200000)
-    "Water specific enthalpy at the saturation point";
-  Units.SI.AbsolutePressure Pcond(start=17000)
-    "Vapor pressure inside the condenser";
-  Units.SI.Temperature Tsat(start=500)
-    "Water temperature at the saturation point";
-  Units.SI.Temperature Tee(start=300) "Cooling water temperature at the inlet";
-  Units.SI.Temperature Tse(start=400) "Cooling water temperature at the outlet";
-  Units.SI.Density rho_ee(start=900) "Cooling water density at the inlet";
-  Units.SI.Density rho_ex(start=900) "Water density at the extraction point";
-  Units.SI.CoefficientOfHeatTransfer KT1(start=50)
-    "First reference value for the exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer KT2(start=50)
-    "Second reference value for the exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer XKCO(start=200)
-    "Heat transfer coefficient";
-  Units.SI.SpecificEnthalpy Hml(start=250000)
-    "Extraction water average specific enthalpy";
-  Units.SI.Power W "Heat power released to the cold source";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.Power Jvt "Thermal power diffusion from inlet Cvt";
-  Units.SI.Power Jev "Thermal power diffusion from inlet Cev";
-  Units.SI.Power Jep "Thermal power diffusion from inlet Cep";
-  Units.SI.Power Jex "Thermal power diffusion from outlet Cex";
-  Units.SI.Power J "Total thermal power diffusion for the liquid in the cavity";
-  Units.SI.MassFlowRate gamma_vt "Diffusion conductance for inlet Cvt";
-  Units.SI.MassFlowRate gamma_ev "Diffusion conductance for inlet Cev";
-  Units.SI.MassFlowRate gamma_ep "Diffusion conductance for inlet Cep";
-  Units.SI.MassFlowRate gamma_ex "Diffusion conductance for outlet Cex";
-  Real rvt "Value of r(Q/gamma) for inlet Cvt";
-  Real rev "Value of r(Q/gamma) for inlet Cev";
-  Real rep "Value of r(Q/gamma) for inlet Cep";
-  Real rex "Value of r(Q/gamma) for outlet Cex";
-  FluidType ftype_p "Cooling pipe fluid type";
-  Integer fluid_p=Integer(ftype_p) "Cooling pipe fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee "Cooling water inlet"
-    annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse
-    "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72},
-            {114,-50}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction water"
-    annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation=
-           0), iconTransformation(extent={{-12,-112},{14,-88}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt "Turbine outlet"
-    annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proex
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prose
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet"
-    annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet"
-    annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation=
-            0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Cvt.ftype;
-  fluids[3] = Cev.ftype;
-  fluids[4] = Cep.ftype;
-  fluids[5] = Cex.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticCondenser: fluids mixing in condenser volume are not compatible with each other");
-
-  /* Check that the fluid type for the cooling pipe is water/steam */
-  assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "StaticCondenser: the fluid type for the cooling pipe must be water/steam");
-
-  /* Unconnected connectors */
-  if (cardinality(Cev) == 0) then
-    Cev.Q = 0;
-    Cev.h = 1.e5;
-    Cev.h_vol_1 = 1.e5;
-    Cev.diff_res_1 = 0;
-    Cev.diff_on_1 = false;
-    Cev.ftype = ftype;
-    Cev.Xco2 = 0;
-    Cev.Xh2o = 1;
-    Cev.Xo2 = 0;
-    Cev.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cep) == 0) then
-    Cep.Q = 0;
-    Cep.h = 1.e5;
-    Cep.h_vol_1 = 1.e5;
-    Cep.diff_res_1 = 0;
-    Cep.diff_on_1 = false;
-    Cep.ftype = ftype;
-    Cep.Xco2 = 0;
-    Cep.Xh2o = 1;
-    Cep.Xo2 = 0;
-    Cep.Xso2 = 0;
-  end if;
-
-  // Water/steam cavity
-  //-------------------
-
-  /* Mass balance equation */
-  0 = Cvt.Q + Cev.Q + Cep.Q - Cex.Q;
-
-  Qvt = Cvt.Q;
-  Qev = Cev.Q;
-  Qep = Cep.Q;
-  Qex = Cex.Q;
-
-  /* Extraction water pressure */
-  Pex = Pcond + rho_ex*g*z;
-
-  /* Fluid pressure */
-  Pcond = Cvt.P;
-  Pcond = Cev.P;
-  Pcond = Cep.P;
-  Pex = Cex.P;
-
-  /* Energy balance equation */
-  0 = Cvt.Q* Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h - Cex.Q*Cex.h - W + J;
-  // 0 = Qvt*(Hvt - Hsate) + Qev*(Hev - Hsate) + Qep*(Hep - Hsate) - W + J;
-
-  /* Extraction water average specific enthalpy */
-  Hml = Hsate;
-  // Hml = (Hsate + Hex)/2;
-
-  Cvt.h_vol_2 = Hml;
-  Cev.h_vol_2 = Hml;
-  Cep.h_vol_2 = Hml;
-  Cex.h_vol_1 = Hml;
-
-  /* Fluid specific enthalpies */
-  Hvt = Cvt.h;
-  Hev = Cev.h;
-  Hep = Cep.h;
-  Hex = Cex.h;
-  // Hex = noEvent(if (rho_ex > 0) then Hsate + ((Pex - Pcond)/rho_ex) else Hsate);
-
-  /* First reference value for the exchange coefficient */
-  KT1 = -0.05*(Tref - 273.16)^2 + 3.3*(Tref - 273.16) + 52;
-
-  /* Second reference value for the exchange coefficient */
-  KT2 = -0.05*(Tee - 273.16)^2 + 3.3*(Tee - 273.16) + 52;
-
-  /* Heat exchange coefficient */
-  XKCO = KCO*(COP/COPR)*(KT2/KT1)*ThermoSysPro.Functions.ThermoRoot(Qee/QC0, Modelica.Constants.eps);
-
-  /* Fluid saturation temperature */
-  0 = Tsat - Tse - (Tsat - Tee)*exp(XKCO*SCO*((Tee - Tse)/W));
-
-  /* Fluid composition in the cavity (no balance equations) */
-  Cex.ftype = ftype;
-
-  Cex.Xco2 = 0;
-  Cex.Xh2o = 1;
-  Cex.Xo2  = 0;
-  Cex.Xso2 = 0;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1);
-  else
-    Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    rvt = if Cvt.diff_on_1 then exp(-0.033*(Cvt.Q*Cvt.diff_res_1)^2) else 0;
-    rev = if Cev.diff_on_1 then exp(-0.033*(Cev.Q*Cev.diff_res_1)^2) else 0;
-    rep = if Cep.diff_on_1 then exp(-0.033*(Cep.Q*Cep.diff_res_1)^2) else 0;
-    rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0;
-
-    gamma_vt = if Cvt.diff_on_1 then 1/Cvt.diff_res_1 else gamma0;
-    gamma_ev = if Cev.diff_on_1 then 1/Cev.diff_res_1 else gamma0;
-    gamma_ep = if Cep.diff_on_1 then 1/Cep.diff_res_1 else gamma0;
-    gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0;
-
-    Jvt = if Cvt.diff_on_1 then rvt*gamma_vt*(Cvt.h_vol_1 - Cvt.h_vol_2) else 0;
-    Jev = if Cev.diff_on_1 then rev*gamma_ev*(Cev.h_vol_1 - Cev.h_vol_2) else 0;
-    Jep = if Cep.diff_on_1 then rep*gamma_ep*(Cep.h_vol_1 - Cep.h_vol_2) else 0;
-    Jex = if Cex.diff_on_2 then rex*gamma_ex*(Cex.h_vol_2 - Cex.h_vol_1) else 0;
-  else
-    rvt = 0;
-    rev = 0;
-    rep = 0;
-    rex = 0;
-
-    gamma_vt = gamma0;
-    gamma_ev = gamma0;
-    gamma_ep = gamma0;
-    gamma_ex = gamma0;
-
-    Jvt = 0;
-    Jev = 0;
-    Jep = 0;
-    Jex = 0;
-   end if;
-
-  J = Jvt + Jev + Jep + Jex;
-
-  Cvt.diff_res_2 = 0;
-  Cev.diff_res_2 = 0;
-  Cep.diff_res_2 = 0;
-  Cex.diff_res_1 = 0;
-
-  Cvt.diff_on_2 = diffusion;
-  Cev.diff_on_2 = diffusion;
-  Cep.diff_on_2 = diffusion;
-  Cex.diff_on_1 = diffusion;
-
-  // Cooling pipe
-  //-------------
-
-  /* Cooling pipe inlet and outlet */
-  Cee.Q = Cse.Q;
-
-  Cee.h_vol_1 = Cse.h_vol_1;
-  Cee.h_vol_2 = Cse.h_vol_2;
-
-  Cse.diff_on_1 = Cee.diff_on_1;
-  Cee.diff_on_2 = Cse.diff_on_2;
-
-  Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff;
-  Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff;
-
-  Cee.ftype = Cse.ftype;
-
-  Cee.Xco2 = Cse.Xco2;
-  Cee.Xh2o = Cse.Xh2o;
-  Cee.Xo2  = Cse.Xo2;
-  Cee.Xso2 = Cse.Xso2;
-
-  ftype_p = Cee.ftype;
-
-  Qee = Cee.Q;
-  Qse = Cse.Q;
-
-  Pee = Cee.P;
-  Pse = Cse.P;
-
-  Hee = Cee.h;
-  Hse = Cse.h;
-
-  /* Pressure loss equation in the water pipe */
-  Pse = noEvent(if (rho_ee > 0) then Pee - (CPCE * ThermoSysPro.Functions.ThermoSquare(Qee, eps)/ rho_ee) else Pee);
-
-  /* Heating power released to the cooling pipe */
-  W = Qee*(Hse - Hee);
-
-  /* Fluid thermodynamic properties */
-  proee = ThermoSysPro.Properties.Fluid.Ph(Pee, Hee, mode_ee, fluid_p);
-  proex = ThermoSysPro.Properties.Fluid.Ph(Pex, Hex, mode_ex, fluid);
-  prose = ThermoSysPro.Properties.Fluid.Ph(Pse, Hse, mode_se, fluid_p);
-
-  rho_ee = proee.d;
-  rho_ex = proex.d;
-
-  Tee = proee.T;
-  Tse = prose.T;
-
-  /* Vapor pressure inside the condenser */
-  Pcond = ThermoSysPro.Properties.Fluid.P_sat(Tsat, fluid);
-
-  /* Fluid thermodynamic properties at the saturation point */
-  (lsat1,vsat1) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid);
-
-  Hsate = lsat1.h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-22,88},{20,70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Turbine outlet"),
-        Text(
-          extent={{-82,24},{-52,16}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Drain inlet"),
-        Text(
-          extent={{-24,-52},{26,-72}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Extraction water"),
-        Text(
-          extent={{38,-58},{86,-66}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Cooling water outlet"),
-        Text(
-          extent={{-86,-52},{-32,-74}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Cooling water inlet"),
-        Text(
-          extent={{-86,66},{-50,54}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Vapor inlet"),
-        Line(
-          points={{0,8},{0,-70}},
-          color={0,0,0},
-          thickness=0),
-        Polygon(
-          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{-100,8},{100,8}},
-          color={0,0,255},
-          thickness=0),
-        Line(
-          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
-              -32},{-90,-32},{-90,-38},{100,-38}},
-          color={28,108,200},
-          thickness=0)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-86},{100,100},{-100,100},{-100,-86},{100,-86}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid,
-                    lineThickness=0),
-        Text(
-          extent={{20,122},{48,94}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Steam inlet"),
-        Text(
-          extent={{-128,-36},{-104,-46}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water inlet"),
-        Text(
-          extent={{106,-36},{132,-52}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Water outlet"),
-        Text(
-          extent={{-104,44},{-74,36}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Drain inlet"),
-        Text(
-          extent={{-18,92},{24,74}},
-          lineColor={0,0,0},
-          lineThickness=0,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Turbine outlet"),
-        Line(
-          points={{0,8},{0,-66}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-100,8},{100,8}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
-              -32},{-90,-32},{-90,-38},{100,-38}},
-          color={28,108,200},
-          thickness=0.5),
-        Polygon(
-          points={{0,-86},{-11,-66},{11,-66},{0,-86}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0})}),
-    Window(
-      x=0.09,
-      y=0.08,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.7.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StaticCondenser;
+within ThermoSysPro.Fluid.HeatExchangers;
+model StaticCondenser "Static condenser"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Area SCO=10000 "Heat exchange surface";
+  parameter Real CPCE=0.02 "Pressure loss coefficient for the water side (Pa.s²/(kg.m**3))";
+  parameter Units.SI.Height z=0.5 "Water level in the condenser";
+  parameter Units.SI.CoefficientOfHeatTransfer KCO=1
+    "Reference heat exchange coefficient";
+  parameter Units.SI.MassFlowRate QC0=100 "Reference mass flow rate";
+  parameter Units.SI.Temperature Tref=293 "Reference temperature";
+  parameter Real COPR=1 "Reference fouling coefficient";
+  parameter Real COP=1 "Actual fouling coefficient";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Air diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region_ee=IF97Region.All_regions "IF97 region at the water inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_se=IF97Region.All_regions "IF97 region at the water outlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_ex=IF97Region.All_regions "IF97 region at the extraction point (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer fluid=Integer(ftype) "Water fluid number";
+  parameter Integer mode_ee=Integer(region_ee) - 1 "IF97 region at the water inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_se=Integer(region_se) - 1 "IF97 region at the water outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_ex=Integer(region_ex) - 1 "IF97 region at the extraction point. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.MassFlowRate Qee(start=10)
+    "Cooling water mass flow rate at the inlet";
+  Units.SI.SpecificEnthalpy Hee(start=250000)
+    "Cooling water specific anthalpy at the inlet";
+  Units.SI.AbsolutePressure Pee(start=1.e5)
+    "Cooling water pressure at the inlet";
+  Units.SI.MassFlowRate Qep(start=10) "Drain mass flow rate at the inlet";
+  Units.SI.SpecificEnthalpy Hep(start=1000000)
+    "Drain specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qev(start=10) "Vapor mass flow rate at the inlet";
+  Units.SI.SpecificEnthalpy Hev(start=2500000)
+    "Vapor specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qvt(start=10)
+    "Vapor mass flow rate leaving the turbine";
+  Units.SI.SpecificEnthalpy Hvt(start=2500000)
+    "Vapor specific enthalpy leaving the turbine";
+  Units.SI.MassFlowRate Qse(start=10)
+    "Cooling water mass flow rate at the outlet";
+  Units.SI.SpecificEnthalpy Hse(start=500000)
+    "Cooling water specific enthalpy at the outlet";
+  Units.SI.AbsolutePressure Pse(start=1.e5)
+    "Cooling water pressure at the outlet";
+  Units.SI.MassFlowRate Qex(start=10) "Drain mass flow rate at the outlet";
+  Units.SI.SpecificEnthalpy Hex(start=500000)
+    "Drain specific enthalpy at the outlet";
+  Units.SI.AbsolutePressure Pex(start=1.e5) "Drain pressure at the outlet";
+  Units.SI.SpecificEnthalpy Hsate(start=200000)
+    "Water specific enthalpy at the saturation point";
+  Units.SI.AbsolutePressure Pcond(start=17000)
+    "Vapor pressure inside the condenser";
+  Units.SI.Temperature Tsat(start=500)
+    "Water temperature at the saturation point";
+  Units.SI.Temperature Tee(start=300) "Cooling water temperature at the inlet";
+  Units.SI.Temperature Tse(start=400) "Cooling water temperature at the outlet";
+  Units.SI.Density rho_ee(start=900) "Cooling water density at the inlet";
+  Units.SI.Density rho_ex(start=900) "Water density at the extraction point";
+  Units.SI.CoefficientOfHeatTransfer KT1(start=50)
+    "First reference value for the exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer KT2(start=50)
+    "Second reference value for the exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer XKCO(start=200)
+    "Heat transfer coefficient";
+  Units.SI.SpecificEnthalpy Hml(start=250000)
+    "Extraction water average specific enthalpy";
+  Units.SI.Power W "Heat power released to the cold source";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.Power Jvt "Thermal power diffusion from inlet Cvt";
+  Units.SI.Power Jev "Thermal power diffusion from inlet Cev";
+  Units.SI.Power Jep "Thermal power diffusion from inlet Cep";
+  Units.SI.Power Jex "Thermal power diffusion from outlet Cex";
+  Units.SI.Power J "Total thermal power diffusion for the liquid in the cavity";
+  Units.SI.MassFlowRate gamma_vt "Diffusion conductance for inlet Cvt";
+  Units.SI.MassFlowRate gamma_ev "Diffusion conductance for inlet Cev";
+  Units.SI.MassFlowRate gamma_ep "Diffusion conductance for inlet Cep";
+  Units.SI.MassFlowRate gamma_ex "Diffusion conductance for outlet Cex";
+  Real rvt "Value of r(Q/gamma) for inlet Cvt";
+  Real rev "Value of r(Q/gamma) for inlet Cev";
+  Real rep "Value of r(Q/gamma) for inlet Cep";
+  Real rex "Value of r(Q/gamma) for outlet Cex";
+  FluidType ftype_p "Cooling pipe fluid type";
+  Integer fluid_p=Integer(ftype_p) "Cooling pipe fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee "Cooling water inlet"
+    annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse
+    "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72},
+            {114,-50}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction water"
+    annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation=
+           0), iconTransformation(extent={{-12,-112},{14,-88}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt "Turbine outlet"
+    annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proex
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prose
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet"
+    annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet"
+    annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation=
+            0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Cvt.ftype;
+  fluids[3] = Cev.ftype;
+  fluids[4] = Cep.ftype;
+  fluids[5] = Cex.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticCondenser: fluids mixing in condenser volume are not compatible with each other");
+
+  /* Check that the fluid type for the cooling pipe is water/steam */
+  assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "StaticCondenser: the fluid type for the cooling pipe must be water/steam");
+
+  /* Unconnected connectors */
+  if (cardinality(Cev) == 0) then
+    Cev.Q = 0;
+    Cev.h = 1.e5;
+    Cev.h_vol_1 = 1.e5;
+    Cev.diff_res_1 = 0;
+    Cev.diff_on_1 = false;
+    Cev.ftype = ftype;
+    Cev.Xco2 = 0;
+    Cev.Xh2o = 0;
+    Cev.Xo2 = 0;
+    Cev.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cep) == 0) then
+    Cep.Q = 0;
+    Cep.h = 1.e5;
+    Cep.h_vol_1 = 1.e5;
+    Cep.diff_res_1 = 0;
+    Cep.diff_on_1 = false;
+    Cep.ftype = ftype;
+    Cep.Xco2 = 0;
+    Cep.Xh2o = 0;
+    Cep.Xo2 = 0;
+    Cep.Xso2 = 0;
+  end if;
+
+  // Water/steam cavity
+  //-------------------
+
+  /* Mass balance equation */
+  0 = Cvt.Q + Cev.Q + Cep.Q - Cex.Q;
+
+  Qvt = Cvt.Q;
+  Qev = Cev.Q;
+  Qep = Cep.Q;
+  Qex = Cex.Q;
+
+  /* Extraction water pressure */
+  Pex = Pcond + rho_ex*g*z;
+
+  /* Fluid pressure */
+  Pcond = Cvt.P;
+  Pcond = Cev.P;
+  Pcond = Cep.P;
+  Pex = Cex.P;
+
+  /* Energy balance equation */
+  0 = Cvt.Q* Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h - Cex.Q*Cex.h - W + J;
+  // 0 = Qvt*(Hvt - Hsate) + Qev*(Hev - Hsate) + Qep*(Hep - Hsate) - W + J;
+
+  /* Extraction water average specific enthalpy */
+  Hml = Hsate;
+  // Hml = (Hsate + Hex)/2;
+
+  Cvt.h_vol_2 = Hml;
+  Cev.h_vol_2 = Hml;
+  Cep.h_vol_2 = Hml;
+  Cex.h_vol_1 = Hml;
+
+  /* Fluid specific enthalpies */
+  Hvt = Cvt.h;
+  Hev = Cev.h;
+  Hep = Cep.h;
+  Hex = Cex.h;
+  // Hex = noEvent(if (rho_ex > 0) then Hsate + ((Pex - Pcond)/rho_ex) else Hsate);
+
+  /* First reference value for the exchange coefficient */
+  KT1 = -0.05*(Tref - 273.16)^2 + 3.3*(Tref - 273.16) + 52;
+
+  /* Second reference value for the exchange coefficient */
+  KT2 = -0.05*(Tee - 273.16)^2 + 3.3*(Tee - 273.16) + 52;
+
+  /* Heat exchange coefficient */
+  XKCO = KCO*(COP/COPR)*(KT2/KT1)*ThermoSysPro.Functions.ThermoRoot(Qee/QC0, Modelica.Constants.eps);
+
+  /* Fluid saturation temperature */
+  0 = Tsat - Tse - (Tsat - Tee)*exp(XKCO*SCO*((Tee - Tse)/W));
+
+  /* Fluid composition in the cavity (no balance equations) */
+  Cex.ftype = ftype;
+
+  Cex.Xco2 = 0;
+  Cex.Xh2o = 0;
+  Cex.Xo2  = 0;
+  Cex.Xso2 = 0;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1);
+  else
+    Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    rvt = if Cvt.diff_on_1 then exp(-0.033*(Cvt.Q*Cvt.diff_res_1)^2) else 0;
+    rev = if Cev.diff_on_1 then exp(-0.033*(Cev.Q*Cev.diff_res_1)^2) else 0;
+    rep = if Cep.diff_on_1 then exp(-0.033*(Cep.Q*Cep.diff_res_1)^2) else 0;
+    rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0;
+
+    gamma_vt = if Cvt.diff_on_1 then 1/Cvt.diff_res_1 else gamma0;
+    gamma_ev = if Cev.diff_on_1 then 1/Cev.diff_res_1 else gamma0;
+    gamma_ep = if Cep.diff_on_1 then 1/Cep.diff_res_1 else gamma0;
+    gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0;
+
+    Jvt = if Cvt.diff_on_1 then rvt*gamma_vt*(Cvt.h_vol_1 - Cvt.h_vol_2) else 0;
+    Jev = if Cev.diff_on_1 then rev*gamma_ev*(Cev.h_vol_1 - Cev.h_vol_2) else 0;
+    Jep = if Cep.diff_on_1 then rep*gamma_ep*(Cep.h_vol_1 - Cep.h_vol_2) else 0;
+    Jex = if Cex.diff_on_2 then rex*gamma_ex*(Cex.h_vol_2 - Cex.h_vol_1) else 0;
+  else
+    rvt = 0;
+    rev = 0;
+    rep = 0;
+    rex = 0;
+
+    gamma_vt = gamma0;
+    gamma_ev = gamma0;
+    gamma_ep = gamma0;
+    gamma_ex = gamma0;
+
+    Jvt = 0;
+    Jev = 0;
+    Jep = 0;
+    Jex = 0;
+   end if;
+
+  J = Jvt + Jev + Jep + Jex;
+
+  Cvt.diff_res_2 = 0;
+  Cev.diff_res_2 = 0;
+  Cep.diff_res_2 = 0;
+  Cex.diff_res_1 = 0;
+
+  Cvt.diff_on_2 = diffusion;
+  Cev.diff_on_2 = diffusion;
+  Cep.diff_on_2 = diffusion;
+  Cex.diff_on_1 = diffusion;
+
+  // Cooling pipe
+  //-------------
+
+  /* Cooling pipe inlet and outlet */
+  Cee.Q = Cse.Q;
+
+  Cee.h_vol_1 = Cse.h_vol_1;
+  Cee.h_vol_2 = Cse.h_vol_2;
+
+  Cse.diff_on_1 = Cee.diff_on_1;
+  Cee.diff_on_2 = Cse.diff_on_2;
+
+  Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff;
+  Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff;
+
+  Cee.ftype = Cse.ftype;
+
+  Cee.Xco2 = Cse.Xco2;
+  Cee.Xh2o = Cse.Xh2o;
+  Cee.Xo2  = Cse.Xo2;
+  Cee.Xso2 = Cse.Xso2;
+
+  ftype_p = Cee.ftype;
+
+  Qee = Cee.Q;
+  Qse = Cse.Q;
+
+  Pee = Cee.P;
+  Pse = Cse.P;
+
+  Hee = Cee.h;
+  Hse = Cse.h;
+
+  /* Pressure loss equation in the water pipe */
+  Pse = noEvent(if (rho_ee > 0) then Pee - (CPCE * ThermoSysPro.Functions.ThermoSquare(Qee, eps)/ rho_ee) else Pee);
+
+  /* Heating power released to the cooling pipe */
+  W = Qee*(Hse - Hee);
+
+  /* Fluid thermodynamic properties */
+  proee = ThermoSysPro.Properties.Fluid.Ph(Pee, Hee, mode_ee, fluid_p);
+  proex = ThermoSysPro.Properties.Fluid.Ph(Pex, Hex, mode_ex, fluid);
+  prose = ThermoSysPro.Properties.Fluid.Ph(Pse, Hse, mode_se, fluid_p);
+
+  rho_ee = proee.d;
+  rho_ex = proex.d;
+
+  Tee = proee.T;
+  Tse = prose.T;
+
+  /* Vapor pressure inside the condenser */
+  Pcond = ThermoSysPro.Properties.Fluid.P_sat(Tsat, fluid);
+
+  /* Fluid thermodynamic properties at the saturation point */
+  (lsat1,vsat1) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid);
+
+  Hsate = lsat1.h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-22,88},{20,70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Turbine outlet"),
+        Text(
+          extent={{-82,24},{-52,16}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Drain inlet"),
+        Text(
+          extent={{-24,-52},{26,-72}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Extraction water"),
+        Text(
+          extent={{38,-58},{86,-66}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Cooling water outlet"),
+        Text(
+          extent={{-86,-52},{-32,-74}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Cooling water inlet"),
+        Text(
+          extent={{-86,66},{-50,54}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Vapor inlet"),
+        Line(
+          points={{0,8},{0,-70}},
+          color={0,0,0},
+          thickness=0),
+        Polygon(
+          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{-100,8},{100,8}},
+          color={0,0,255},
+          thickness=0),
+        Line(
+          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
+              -32},{-90,-32},{-90,-38},{100,-38}},
+          color={28,108,200},
+          thickness=0)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-86},{100,100},{-100,100},{-100,-86},{100,-86}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid,
+                    lineThickness=0),
+        Text(
+          extent={{20,122},{48,94}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Steam inlet"),
+        Text(
+          extent={{-128,-36},{-104,-46}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water inlet"),
+        Text(
+          extent={{106,-36},{132,-52}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Water outlet"),
+        Text(
+          extent={{-104,44},{-74,36}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Drain inlet"),
+        Text(
+          extent={{-18,92},{24,74}},
+          lineColor={0,0,0},
+          lineThickness=0,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Turbine outlet"),
+        Line(
+          points={{0,8},{0,-66}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-100,8},{100,8}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
+              -32},{-90,-32},{-90,-38},{100,-38}},
+          color={28,108,200},
+          thickness=0.5),
+        Polygon(
+          points={{0,-86},{-11,-66},{11,-66},{0,-86}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0})}),
+    Window(
+      x=0.09,
+      y=0.08,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.7.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StaticCondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo
index 86e70c9b3e7f056de2b3ddd0b2c9d9b5f0c440be..de4edeb6055eec111c688ec8378b0c56cdd12066 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo
@@ -1,635 +1,635 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model StaticCondenserHEI "HEI static condenser"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real Kf=0 "Friction pressure loss coefficient for the cold side";
-  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
-  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
-  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
-  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
-  parameter Real Ucorr=1.00 "Corrective term for the heat transfert coefficient (U) for calibration";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot side";
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold side";
-  parameter Integer Tube_Material1=1 "Material of the tubes type 1. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material2=1 "Material of the tubes type 2. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material3=1 "Material of the tubes type 3. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material4=1 "Material of the tubes type 4. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material5=1 "Material of the tubes type 5. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material6=1 "Material of the tubes type 6. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Real nb_pass=2 "Number of water passes";
-  parameter Real nb_tube1=12000 "Number of tubes type 1. For exemple tubes of the condensing zone";
-  parameter Real nb_tube2=900 "Number of tubes type 2. For exemple gaz removal tubes";
-  parameter Real nb_tube3=700 "Number of tubes type 3. For exemple impingement tubes";
-  parameter Real nb_tube4=200 "Number of tubes type 4";
-  parameter Real nb_tube5=200 "Number of tubes type 5";
-  parameter Real nb_tube6=200 "Number of tubes type 6";
-  parameter Units.SI.Thickness e_tube1=0.7e-3 "Tubes thickness type 1";
-  parameter Units.SI.Thickness e_tube2=0.7e-3 "Tubes thickness type 2";
-  parameter Units.SI.Thickness e_tube3=1e-3 "Tubes thickness type 3";
-  parameter Units.SI.Thickness e_tube4=1e-3 "Tubes thickness type 4";
-  parameter Units.SI.Thickness e_tube5=1e-3 "Tubes thickness type 5";
-  parameter Units.SI.Thickness e_tube6=1e-3 "Tubes thickness type 6";
-  parameter Units.SI.Diameter D_tube1=25.4e-3
-    "External diameter of tubes type 1";
-  parameter Units.SI.Diameter D_tube2=25.4e-3
-    "External diameter of tubes type 2";
-  parameter Units.SI.Diameter D_tube3=25.4e-3
-    "External diameter of tubes type 3";
-  parameter Units.SI.Diameter D_tube4=25.4e-3
-    "External diameter of tubes type 4";
-  parameter Units.SI.Diameter D_tube5=25.4e-3
-    "External diameter of tubes type 5";
-  parameter Units.SI.Diameter D_tube6=25.4e-3
-    "External diameter of tubes type 6";
-  parameter Units.SI.Length L_tube1=10 "Tubes length type 1";
-  parameter Units.SI.Length L_tube2=10 "Tubes length type 2";
-  parameter Units.SI.Length L_tube3=10 "Tubes length type 3";
-  parameter Units.SI.Length L_tube4=10 "Tubes length type 4";
-  parameter Units.SI.Length L_tube5=10 "Tubes length type 5";
-  parameter Units.SI.Length L_tube6=10 "Tubes length type 6";
-  parameter Real FC=0.95 "Correction factor for cleanless";
-  parameter Units.SI.Pressure Poffset=0
-    "Offset applied on the pressure provided by HEI";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Air diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_cs=IF97Region.All_regions "IF97 region at the outlet of the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer fluid=Integer(ftype) "Water fluid number";
-  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_cs=Integer(region_cs) - 1 "IF97 region at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.Diameter D_tubes "Weight average diameter of the tubes";
-  Units.SI.Thickness e_tubes "Weight average thickness of the tubes";
-  Units.SI.Area S_pass(start=3) "Passage section of the cold water";
-  Units.SI.Area S_ech1(start=10000) "Heat exchange surface of tubes type 1";
-  Units.SI.Area S_ech2(start=10000) "Heat exchange surface of tubes type 2";
-  Units.SI.Area S_ech3(start=10000) "Heat exchange surface of tubes type 3";
-  Units.SI.Area S_ech4(start=10000) "Heat exchange surface of tubes type 4";
-  Units.SI.Area S_ech5(start=10000) "Heat exchange surface of tubes type 5";
-  Units.SI.Area S_ech6(start=10000) "Heat exchange surface of tubes type 6";
-  Real FM1 "Correction factor for material and gauge of tubes type 1";
-  Real FM2 "Correction factor for material and gauge of tubes type 2";
-  Real FM3 "Correction factor for material and gauge of tubes type 3";
-  Real FM4 "Correction factor for material and gauge of tubes type 4";
-  Real FM5 "Correction factor for material and gauge of tubes type 5";
-  Real FM6 "Correction factor for material and gauge of tubes type 6";
-  Units.SI.Power W(start=1e6)
-    "Power exchanged from the hot side to the cold side";
-  Units.SI.Temperature Tec(start=500)
-    "Fluid temperature at the inlet of the hot side";
-  Units.SI.Temperature Tsc(start=400)
-    "Fluid temperature at the outlet of the hot side";
-  Units.SI.Temperature Tef(start=350)
-    "Fluid temperature at the inlet of the cold side";
-  Units.SI.Temperature Tsf(start=350)
-    "Fluid temperature at the outlet of the cold side";
-  Units.SI.Pressure DPgc(start=1e2) "Gravity pressure loss in the hot side";
-  Units.SI.Pressure DPff(start=1e3) "Friction pressure loss in the cold side";
-  Units.SI.Pressure DPgf(start=1e2) "Gravity pressure loss in the cold side";
-  Units.SI.Pressure DPf(start=1e3) "Total pressure loss in the cold side";
-  Units.SI.Density rhof(start=998) "Density of the fluid in the cold side";
-  Units.SI.Density rho_ex(start=950) "Water density at the extraction point";
-  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
-  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
-  Units.SI.Area S_ech(start=10000) "Heat exchange surface";
-  Units.SI.Velocity Vf "Velocity of the cold water";
-  Real Fw "Correction factor for water";
-  Units.SI.CoefficientOfHeatTransfer U1
-    "Uncorrected heat transfert coefficient";
-  Real FM "Overall correction factor for material and gauge";
-  Units.SI.CoefficientOfHeatTransfer U "Heat transfert coefficient";
-  Units.SI.Temperature Tcut_off "Saturation temperature at pressure cut-off";
-  Units.SI.Pressure Psat_att(start=6000) "Expected HEI saturation pressure";
-  Units.SI.Pressure Pcut_off "Pressure cut-off";
-  Units.SI.Pressure Pzero_load "Zero-load pressure ";
-  Units.SI.Pressure Pcond(start=6000)
-    "Expected corrected HEI saturation pressure";
-  Units.SI.Temperature Tsat(start=310)
-    "Expected corrected HEI saturation temperature";
-  Units.SI.Power Wcut_off(start=5e5)
-    "Power exchanged from the hot side to the cold side at Pcut_off";
-  Units.SI.Temperature TTD "Terminal Temperature Difference";
-  Integer HEI "Applicability of the HEI standard. 0:No - 1:Yes";
-  Units.SI.Temperature Tsat_att(start=310)
-    "Expected HEI saturation temperature";
-  Units.SI.SpecificHeatCapacity Cpmf(start=950)
-    "Average specific heat capacity of the cold water";
-  Units.SI.SpecificEnthalpy Hmv(start=2500000)
-    "Fluid inlets average specific enthalpy";
-  Units.SI.SpecificEnthalpy Hml(start=100000)
-    "Extraction water average specific enthalpy";
-  Units.SI.SpecificEnthalpy Hex(start=100000)
-    "Drain specific enthalpy at the outlet";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.Power Jvt "Thermal power diffusion from inlet Cvt";
-  Units.SI.Power Jev "Thermal power diffusion from inlet Cev";
-  Units.SI.Power Jep "Thermal power diffusion from inlet Cep";
-  Units.SI.Power Jex "Thermal power diffusion from outlet Cex";
-  Units.SI.Power J "Total thermal power diffusion for the liquid in the cavity";
-  Units.SI.MassFlowRate gamma_vt "Diffusion conductance for inlet Cvt";
-  Units.SI.MassFlowRate gamma_ev "Diffusion conductance for inlet Cev";
-  Units.SI.MassFlowRate gamma_ep "Diffusion conductance for inlet Cep";
-  Units.SI.MassFlowRate gamma_ex "Diffusion conductance for outlet Cex";
-  Real rvt "Value of r(Q/gamma) for inlet Cvt";
-  Real rev "Value of r(Q/gamma) for inlet Cev";
-  Real rep "Value of r(Q/gamma) for inlet Cep";
-  Real rex "Value of r(Q/gamma) for outlet Cex";
-  FluidType ftype_p "Cooling pipe fluid type";
-  Integer fluid_p=Integer(ftype_p) "Cooling pipe fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee "Cooling water inlet"
-    annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse
-    "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72},
-            {114,-50}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction water"
-    annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation=
-           0), iconTransformation(extent={{-12,-112},{14,-88}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt "Turbine outlet"
-    annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0),
-        iconTransformation(extent={{-13,88},{13,114}})));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet"
-    annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet"
-    annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation=
-            0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Cvt.ftype;
-  fluids[3] = Cev.ftype;
-  fluids[4] = Cep.ftype;
-  fluids[5] = Cex.ftype;
-
-  /* Check that the fluid type for the cooling pipe is water/steam */
-  assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "StaticCondenserHEI: the fluid type for the cooling pipe must be water/steam");
-
-  /* Unconnected connectors */
-  if (cardinality(Cev) == 0) then
-    Cev.Q = 0;
-    Cev.h = 1.e5;
-    Cev.h_vol_1 = 1.e5;
-    Cev.diff_res_1 = 0;
-    Cev.diff_on_1 = false;
-    Cev.ftype = ftype;
-    Cev.Xco2 = 0;
-    Cev.Xh2o = 1;
-    Cev.Xo2 = 0;
-    Cev.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cep) == 0) then
-    Cep.Q = 0;
-    Cep.h = 1.e5;
-    Cep.h_vol_1 = 1.e5;
-    Cep.diff_res_1 = 0;
-    Cep.diff_on_1 = false;
-    Cep.ftype = ftype;
-    Cep.Xco2 = 0;
-    Cep.Xh2o = 1;
-    Cep.Xo2 = 0;
-    Cep.Xso2 = 0;
-  end if;
-
-  // Water/steam cavity
-  //-------------------
-
-  /* Mixer: mass balance equation */
-  0 = Cvt.Q + Cev.Q + Cep.Q - Cex.Q;
-
-  Qc = Cex.Q;
-
-  /* Extraction water pressure */
-  Cex.P = Pcond + rho_ex*g*(z2c - z1c);
-
-  /* Fluid pressure */
-  Pcond = Cvt.P;
-  Pcond = Cev.P;
-  Pcond = Cep.P;
-
-  /* Energy balance equation */
-  0 = Cvt.Q* Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h - Cex.Q*Cex.h - W + J;
-  // 0 = Cvt.Q*(Cvt.h - lsat.h) + Cev.Q*(Cev.h - lsat.h) + Cep.Q*(Cep.h - lsat.h) -  W;
-
-  /* Extraction water average specific enthalpy */
-  Hml = lsat.h;
-  // Hml = (lsat.h + Hex)/2;
-
-  Cvt.h_vol_2 = Hml;
-  Cev.h_vol_2 = Hml;
-  Cep.h_vol_2 = Hml;
-  Cex.h_vol_1 = Hml;
-
-  /* Average specific enthalpies of the inlets */
-  Hmv = (Cvt.Q*Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h)/Qc;
-
-  // Cvt.h_vol_2 = Hmv;
-  // Cev.h_vol_2 = Hmv;
-  // Cep.h_vol_2 = Hmv;
-  // Cex.h_vol_1 = Hex;
-
-  /* Extraction water specific enthalpy */
-  Hex = noEvent(if (rho_ex > 0) then lsat.h + ((Cex.P - Pcond)/rho_ex) else lsat.h);
-
-  /* Gravity pressure losses in the hot side */
-  DPgc = rho_ex*g*(z2c - z1c);
-
-  /* Fluid composition in the cavity (no balance equations) */
-  Cex.ftype = ftype;
-
-  Cex.Xco2 = 0;
-  Cex.Xh2o = 1;
-  Cex.Xo2  = 0;
-  Cex.Xso2 = 0;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1);
-  else
-    Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    rvt = if Cvt.diff_on_1 then exp(-0.033*(Cvt.Q*Cvt.diff_res_1)^2) else 0;
-    rev = if Cev.diff_on_1 then exp(-0.033*(Cev.Q*Cev.diff_res_1)^2) else 0;
-    rep = if Cep.diff_on_1 then exp(-0.033*(Cep.Q*Cep.diff_res_1)^2) else 0;
-    rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0;
-
-    gamma_vt = if Cvt.diff_on_1 then 1/Cvt.diff_res_1 else gamma0;
-    gamma_ev = if Cev.diff_on_1 then 1/Cev.diff_res_1 else gamma0;
-    gamma_ep = if Cep.diff_on_1 then 1/Cep.diff_res_1 else gamma0;
-    gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0;
-
-    Jvt = if Cvt.diff_on_1 then rvt*gamma_vt*(Cvt.h_vol_1 - Cvt.h_vol_2) else 0;
-    Jev = if Cev.diff_on_1 then rev*gamma_ev*(Cev.h_vol_1 - Cev.h_vol_2) else 0;
-    Jep = if Cep.diff_on_1 then rep*gamma_ep*(Cep.h_vol_1 - Cep.h_vol_2) else 0;
-    Jex = if Cex.diff_on_2 then rex*gamma_ex*(Cex.h_vol_2 - Cex.h_vol_1) else 0;
-  else
-    rvt = 0;
-    rev = 0;
-    rep = 0;
-    rex = 0;
-
-    gamma_vt = gamma0;
-    gamma_ev = gamma0;
-    gamma_ep = gamma0;
-    gamma_ex = gamma0;
-
-    Jvt = 0;
-    Jev = 0;
-    Jep = 0;
-    Jex = 0;
-   end if;
-
-  J = Jvt + Jev + Jep + Jex;
-
-  Cvt.diff_res_2 = 0;
-  Cev.diff_res_2 = 0;
-  Cep.diff_res_2 = 0;
-  Cex.diff_res_1 = 0;
-
-  Cvt.diff_on_2 = diffusion;
-  Cev.diff_on_2 = diffusion;
-  Cep.diff_on_2 = diffusion;
-  Cex.diff_on_1 = diffusion;
-
-  // Cooling pipe
-  //-------------
-
-  /* Cooling pipe inlet and outlet */
-  Cee.Q = Cse.Q;
-
-  Cee.h_vol_1 = Cse.h_vol_1;
-  Cee.h_vol_2 = Cse.h_vol_2;
-
-  Cse.diff_on_1 = Cee.diff_on_1;
-  Cee.diff_on_2 = Cse.diff_on_2;
-
-  Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff;
-  Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff;
-
-  Cee.ftype = Cse.ftype;
-
-  Cee.Xco2 = Cse.Xco2;
-  Cee.Xh2o = Cse.Xh2o;
-  Cee.Xo2  = Cse.Xo2;
-  Cee.Xso2 = Cse.Xso2;
-
-  ftype_p = Cee.ftype;
-
-  Qf = Cee.Q;
-
-  /* Pressure losses in the cold side */
-  Cee.P - Cse.P = DPf;
-
-  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
-  DPgf = rhof*g*(z2f - z1f);
-  DPf = DPff + DPgf;
-
-  /* Power released from the hot side to the cold side */
-  W = Qf*(Cse.h - Cee.h);
-
-  /* Fluid thermodynamic properties of the hot side */
-  proce = ThermoSysPro.Properties.Fluid.Ph(Cvt.P, Hmv, mode_c, fluid);
-  procs = ThermoSysPro.Properties.Fluid.Ph(Cex.P, Cex.h, mode_cs, fluid);
-  //procs = ThermoSysPro.Properties.Fluid.Ph(Pcond + Cex.P)/2, (lsat.h + Cex.h)/2, modecs);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid);
-
-  if (p_rhoc > 0) then
-    rho_ex = p_rhoc;
-  else
-    rho_ex = procs.d;
-  end if;
-
-  /* Fluid thermodynamic properties of the cold side */
-  profe = ThermoSysPro.Properties.Fluid.Ph(Cee.P, Cee.h, mode_f, fluid_p);
-  profs = ThermoSysPro.Properties.Fluid.Ph(Cse.P, Cse.h, mode_f, fluid_p);
-  promf = ThermoSysPro.Properties.Fluid.Ph((Cee.P + Cse.P)/2, (Cee.h + Cse.h)/2, mode_f, fluid_p);
-
-  Tef = profe.T;
-  Tsf = profs.T;
-
-  if (p_rhof > 0) then
-    rhof = p_rhof;
-  else
-    rhof = promf.d;
-  end if;
-
-  /* Calculation of the heat exchange surface */
-  S_ech1 = pi*D_tube1*L_tube1*nb_tube1;
-  S_ech2 = pi*D_tube2*L_tube2*nb_tube2;
-  S_ech3 = pi*D_tube3*L_tube3*nb_tube3;
-  S_ech4 = pi*D_tube4*L_tube4*nb_tube4;
-  S_ech5 = pi*D_tube5*L_tube5*nb_tube5;
-  S_ech6 = pi*D_tube6*L_tube6*nb_tube6;
-  S_ech = S_ech1 + S_ech2 + S_ech3 + S_ech4 + S_ech5 + S_ech6;
-
- /* Calculation of the passage section of the cold water */
-  S_pass = (D_tube1/2 - e_tube1)^2*pi*nb_tube1/nb_pass + (D_tube2/2 - e_tube2)^2*pi*nb_tube2/nb_pass + (D_tube3/2 - e_tube3)^2*pi*nb_tube3/nb_pass + (D_tube4/2 - e_tube4)^2*pi*nb_tube4/nb_pass + (D_tube5/2 - e_tube5)^2*pi*nb_tube5/nb_pass +(D_tube6/2 - e_tube6)^2*pi*nb_tube6/nb_pass;
-
-  /* Calculation of the velocity of the cold water */
-  Vf = Qf/rhof/S_pass;
-
-  /* Calculation of the correction factor for the water according to the HEI standard, 10th edition */
-  Fw = -2.104072e-04*(Tef - 273.15)^2 + 1.974994e-02*(Tef - 273.15) + 6.639699e-01;
-
-  /* Calculation of the weight average diameter of the tubes */
-  D_tubes = (D_tube1*nb_tube1 + D_tube2*nb_tube2 + D_tube3*nb_tube3 + D_tube4*nb_tube4 + D_tube5*nb_tube5 + D_tube6*nb_tube6)/(nb_tube1 + nb_tube2 + nb_tube3 + nb_tube4 + nb_tube5 + nb_tube6);
-
-  /* Calculation of the uncorrected heat transfert coefficient according to the HEI standard, 10th edition */
-  U1 = ThermoSysPro.Correlations.Thermal.Function_U1(D_tubes, Vf);
-
-  /* Calculation of the weight average thickness of the tubes */
-  e_tubes = (e_tube1*nb_tube1 + e_tube2*nb_tube2 + e_tube3*nb_tube3 + e_tube4*nb_tube4 + e_tube5*nb_tube5 + e_tube6*nb_tube6)/(nb_tube1 + nb_tube2 + nb_tube3 + nb_tube4 + nb_tube5 + nb_tube6);
-
-  /* Calculation of the correction factor for material and gauge according to the HEI standard, 10th edition */
-  FM1 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube1, Tube_Material1);
-  FM2 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube2, Tube_Material2);
-  FM3 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube3, Tube_Material3);
-  FM4 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube4, Tube_Material4);
-  FM5 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube5, Tube_Material5);
-  FM6 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube6, Tube_Material6);
-  FM = (FM1*S_ech1 + FM2*S_ech2 + FM3*S_ech3 + FM4*S_ech4 + FM5*S_ech5 + FM6*S_ech6)/S_ech;
-
-  /* Calculation of the heat transfert coefficient according to the HEI standard, 10th edition */
-  U = Ucorr*U1*FM*FC*Fw;
-
-  /* Calculation of the average specific heat capacity of the cold water */
-  Cpmf = promf.cp;
-
-  /* Calculation of the expected HEI saturation temperature  */
-  Tsat_att = Tef + (W/(Qf*Cpmf))*(1/(1 - Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf))));
-
-  /* Calculation of expected HEI saturation pressure  */
-  Psat_att = ThermoSysPro.Properties.Fluid.P_sat(Tsat_att, fluid);
-
-  /* Calculation of the HEI pressure cut-off */
-  Pcut_off = (5.752433E-04*(Tef-273.15)^3 + 1.735162E-02*(Tef-273.15)^2 + 8.052739E-02*(Tef-273.15) + 2.109159E+01)*100;
-
-  /* Calculation of the HEI saturation temperature at pressure cut-off  */
-  Tcut_off = ThermoSysPro.Properties.Fluid.T_sat(Pcut_off, fluid);
-
-  /* Calculation of HEI zero-load  pressure */
-  Pzero_load = (5.008000E-04*(Tef - 273.15)^3 + 2.039549E-02*(Tef - 273.15)^2 + 2.277566E-01*(Tef - 273.15) + 1.027824E+01)*100;
-
-  /* Calculation of power exchanged from the hot side to the cold side at Pcut_off */
-  Tcut_off = Tef + (Wcut_off/(Qf*Cpmf))*(1/(1-Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf))));
-
-  /* Calculation of the expected HEI corrected saturation pressure*/
-  if (Psat_att < Pcut_off) then
-    Pcond = (Pcut_off - Pzero_load)/Wcut_off*W + Pzero_load + Poffset;
-  else
-    Pcond = Psat_att + Poffset;
-  end if;
-
-  /* Calculation of the expected HEI corrected saturation pressure */
-  Tsat = ThermoSysPro.Properties.Fluid.T_sat(Pcond, fluid);
-
-  /* Calculation of the Terminal Temperature Difference */
-  TTD = Tsat - Tsf;
-
-  /* The standards HEI are not applicable if the terminal temperature difference is less than 2,78 K */
-  if (TTD > 2.78) then
-    HEI = 1;
-  else
-    HEI = 0;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-22,88},{20,70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Turbine outlet"),
-        Text(
-          extent={{-82,24},{-52,16}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Drain inlet"),
-        Text(
-          extent={{-24,-52},{26,-72}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Extraction water"),
-        Text(
-          extent={{38,-58},{86,-66}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Cooling water outlet"),
-        Text(
-          extent={{-86,-52},{-32,-74}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Cooling water inlet"),
-        Text(
-          extent={{-86,66},{-50,54}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Vapor inlet"),
-        Line(
-          points={{0,8},{0,-70}},
-          color={0,0,0},
-          thickness=1),
-        Polygon(
-          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{-100,8},{100,8}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
-              -32},{-90,-32},{-90,-38},{100,-38}},
-          color={28,108,200},
-          thickness=0.5),
-        Text(
-          extent={{-80,60},{72,12}},
-          lineColor={28,108,200},
-          textString="HEI")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-86},{100,100},{-100,100},{-100,-86},{100,-86}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid,
-                    lineThickness=0),
-        Line(
-          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
-              -32},{-90,-32},{-90,-38},{100,-38}},
-          color={28,108,200},
-          thickness=0.5),
-        Polygon(
-          points={{0,-86},{-11,-66},{11,-66},{0,-86}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{0,8},{0,-66}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-100,8},{100,8}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-78,74},{74,26}},
-          lineColor={28,108,200},
-          textString="HEI")}),
-    Window(
-      x=0.09,
-      y=0.08,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StaticCondenserHEI;
+within ThermoSysPro.Fluid.HeatExchangers;
+model StaticCondenserHEI "HEI static condenser"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real Kf=0 "Friction pressure loss coefficient for the cold side";
+  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
+  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
+  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
+  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
+  parameter Real Ucorr=1.00 "Corrective term for the heat transfert coefficient (U) for calibration";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot side";
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold side";
+  parameter Integer Tube_Material1=1 "Material of the tubes type 1. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material2=1 "Material of the tubes type 2. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material3=1 "Material of the tubes type 3. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material4=1 "Material of the tubes type 4. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material5=1 "Material of the tubes type 5. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material6=1 "Material of the tubes type 6. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Real nb_pass=2 "Number of water passes";
+  parameter Real nb_tube1=12000 "Number of tubes type 1. For exemple tubes of the condensing zone";
+  parameter Real nb_tube2=900 "Number of tubes type 2. For exemple gaz removal tubes";
+  parameter Real nb_tube3=700 "Number of tubes type 3. For exemple impingement tubes";
+  parameter Real nb_tube4=200 "Number of tubes type 4";
+  parameter Real nb_tube5=200 "Number of tubes type 5";
+  parameter Real nb_tube6=200 "Number of tubes type 6";
+  parameter Units.SI.Thickness e_tube1=0.7e-3 "Tubes thickness type 1";
+  parameter Units.SI.Thickness e_tube2=0.7e-3 "Tubes thickness type 2";
+  parameter Units.SI.Thickness e_tube3=1e-3 "Tubes thickness type 3";
+  parameter Units.SI.Thickness e_tube4=1e-3 "Tubes thickness type 4";
+  parameter Units.SI.Thickness e_tube5=1e-3 "Tubes thickness type 5";
+  parameter Units.SI.Thickness e_tube6=1e-3 "Tubes thickness type 6";
+  parameter Units.SI.Diameter D_tube1=25.4e-3
+    "External diameter of tubes type 1";
+  parameter Units.SI.Diameter D_tube2=25.4e-3
+    "External diameter of tubes type 2";
+  parameter Units.SI.Diameter D_tube3=25.4e-3
+    "External diameter of tubes type 3";
+  parameter Units.SI.Diameter D_tube4=25.4e-3
+    "External diameter of tubes type 4";
+  parameter Units.SI.Diameter D_tube5=25.4e-3
+    "External diameter of tubes type 5";
+  parameter Units.SI.Diameter D_tube6=25.4e-3
+    "External diameter of tubes type 6";
+  parameter Units.SI.Length L_tube1=10 "Tubes length type 1";
+  parameter Units.SI.Length L_tube2=10 "Tubes length type 2";
+  parameter Units.SI.Length L_tube3=10 "Tubes length type 3";
+  parameter Units.SI.Length L_tube4=10 "Tubes length type 4";
+  parameter Units.SI.Length L_tube5=10 "Tubes length type 5";
+  parameter Units.SI.Length L_tube6=10 "Tubes length type 6";
+  parameter Real FC=0.95 "Correction factor for cleanless";
+  parameter Units.SI.Pressure Poffset=0
+    "Offset applied on the pressure provided by HEI";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Air diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_cs=IF97Region.All_regions "IF97 region at the outlet of the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer fluid=Integer(ftype) "Water fluid number";
+  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_cs=Integer(region_cs) - 1 "IF97 region at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.Diameter D_tubes "Weight average diameter of the tubes";
+  Units.SI.Thickness e_tubes "Weight average thickness of the tubes";
+  Units.SI.Area S_pass(start=3) "Passage section of the cold water";
+  Units.SI.Area S_ech1(start=10000) "Heat exchange surface of tubes type 1";
+  Units.SI.Area S_ech2(start=10000) "Heat exchange surface of tubes type 2";
+  Units.SI.Area S_ech3(start=10000) "Heat exchange surface of tubes type 3";
+  Units.SI.Area S_ech4(start=10000) "Heat exchange surface of tubes type 4";
+  Units.SI.Area S_ech5(start=10000) "Heat exchange surface of tubes type 5";
+  Units.SI.Area S_ech6(start=10000) "Heat exchange surface of tubes type 6";
+  Real FM1 "Correction factor for material and gauge of tubes type 1";
+  Real FM2 "Correction factor for material and gauge of tubes type 2";
+  Real FM3 "Correction factor for material and gauge of tubes type 3";
+  Real FM4 "Correction factor for material and gauge of tubes type 4";
+  Real FM5 "Correction factor for material and gauge of tubes type 5";
+  Real FM6 "Correction factor for material and gauge of tubes type 6";
+  Units.SI.Power W(start=1e6)
+    "Power exchanged from the hot side to the cold side";
+  Units.SI.Temperature Tec(start=500)
+    "Fluid temperature at the inlet of the hot side";
+  Units.SI.Temperature Tsc(start=400)
+    "Fluid temperature at the outlet of the hot side";
+  Units.SI.Temperature Tef(start=350)
+    "Fluid temperature at the inlet of the cold side";
+  Units.SI.Temperature Tsf(start=350)
+    "Fluid temperature at the outlet of the cold side";
+  Units.SI.Pressure DPgc(start=1e2) "Gravity pressure loss in the hot side";
+  Units.SI.Pressure DPff(start=1e3) "Friction pressure loss in the cold side";
+  Units.SI.Pressure DPgf(start=1e2) "Gravity pressure loss in the cold side";
+  Units.SI.Pressure DPf(start=1e3) "Total pressure loss in the cold side";
+  Units.SI.Density rhof(start=998) "Density of the fluid in the cold side";
+  Units.SI.Density rho_ex(start=950) "Water density at the extraction point";
+  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+  Units.SI.Area S_ech(start=10000) "Heat exchange surface";
+  Units.SI.Velocity Vf "Velocity of the cold water";
+  Real Fw "Correction factor for water";
+  Units.SI.CoefficientOfHeatTransfer U1
+    "Uncorrected heat transfert coefficient";
+  Real FM "Overall correction factor for material and gauge";
+  Units.SI.CoefficientOfHeatTransfer U "Heat transfert coefficient";
+  Units.SI.Temperature Tcut_off "Saturation temperature at pressure cut-off";
+  Units.SI.Pressure Psat_att(start=6000) "Expected HEI saturation pressure";
+  Units.SI.Pressure Pcut_off "Pressure cut-off";
+  Units.SI.Pressure Pzero_load "Zero-load pressure ";
+  Units.SI.Pressure Pcond(start=6000)
+    "Expected corrected HEI saturation pressure";
+  Units.SI.Temperature Tsat(start=310)
+    "Expected corrected HEI saturation temperature";
+  Units.SI.Power Wcut_off(start=5e5)
+    "Power exchanged from the hot side to the cold side at Pcut_off";
+  Units.SI.Temperature TTD "Terminal Temperature Difference";
+  Integer HEI "Applicability of the HEI standard. 0:No - 1:Yes";
+  Units.SI.Temperature Tsat_att(start=310)
+    "Expected HEI saturation temperature";
+  Units.SI.SpecificHeatCapacity Cpmf(start=950)
+    "Average specific heat capacity of the cold water";
+  Units.SI.SpecificEnthalpy Hmv(start=2500000)
+    "Fluid inlets average specific enthalpy";
+  Units.SI.SpecificEnthalpy Hml(start=100000)
+    "Extraction water average specific enthalpy";
+  Units.SI.SpecificEnthalpy Hex(start=100000)
+    "Drain specific enthalpy at the outlet";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.Power Jvt "Thermal power diffusion from inlet Cvt";
+  Units.SI.Power Jev "Thermal power diffusion from inlet Cev";
+  Units.SI.Power Jep "Thermal power diffusion from inlet Cep";
+  Units.SI.Power Jex "Thermal power diffusion from outlet Cex";
+  Units.SI.Power J "Total thermal power diffusion for the liquid in the cavity";
+  Units.SI.MassFlowRate gamma_vt "Diffusion conductance for inlet Cvt";
+  Units.SI.MassFlowRate gamma_ev "Diffusion conductance for inlet Cev";
+  Units.SI.MassFlowRate gamma_ep "Diffusion conductance for inlet Cep";
+  Units.SI.MassFlowRate gamma_ex "Diffusion conductance for outlet Cex";
+  Real rvt "Value of r(Q/gamma) for inlet Cvt";
+  Real rev "Value of r(Q/gamma) for inlet Cev";
+  Real rep "Value of r(Q/gamma) for inlet Cep";
+  Real rex "Value of r(Q/gamma) for outlet Cex";
+  FluidType ftype_p "Cooling pipe fluid type";
+  Integer fluid_p=Integer(ftype_p) "Cooling pipe fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee "Cooling water inlet"
+    annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse
+    "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72},
+            {114,-50}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction water"
+    annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation=
+           0), iconTransformation(extent={{-12,-112},{14,-88}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt "Turbine outlet"
+    annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0),
+        iconTransformation(extent={{-13,88},{13,114}})));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet"
+    annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet"
+    annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation=
+            0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Cvt.ftype;
+  fluids[3] = Cev.ftype;
+  fluids[4] = Cep.ftype;
+  fluids[5] = Cex.ftype;
+
+  /* Check that the fluid type for the cooling pipe is water/steam */
+  assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "StaticCondenserHEI: the fluid type for the cooling pipe must be water/steam");
+
+  /* Unconnected connectors */
+  if (cardinality(Cev) == 0) then
+    Cev.Q = 0;
+    Cev.h = 1.e5;
+    Cev.h_vol_1 = 1.e5;
+    Cev.diff_res_1 = 0;
+    Cev.diff_on_1 = false;
+    Cev.ftype = ftype;
+    Cev.Xco2 = 0;
+    Cev.Xh2o = 0;
+    Cev.Xo2 = 0;
+    Cev.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cep) == 0) then
+    Cep.Q = 0;
+    Cep.h = 1.e5;
+    Cep.h_vol_1 = 1.e5;
+    Cep.diff_res_1 = 0;
+    Cep.diff_on_1 = false;
+    Cep.ftype = ftype;
+    Cep.Xco2 = 0;
+    Cep.Xh2o = 0;
+    Cep.Xo2 = 0;
+    Cep.Xso2 = 0;
+  end if;
+
+  // Water/steam cavity
+  //-------------------
+
+  /* Mixer: mass balance equation */
+  0 = Cvt.Q + Cev.Q + Cep.Q - Cex.Q;
+
+  Qc = Cex.Q;
+
+  /* Extraction water pressure */
+  Cex.P = Pcond + rho_ex*g*(z2c - z1c);
+
+  /* Fluid pressure */
+  Pcond = Cvt.P;
+  Pcond = Cev.P;
+  Pcond = Cep.P;
+
+  /* Energy balance equation */
+  0 = Cvt.Q* Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h - Cex.Q*Cex.h - W + J;
+  // 0 = Cvt.Q*(Cvt.h - lsat.h) + Cev.Q*(Cev.h - lsat.h) + Cep.Q*(Cep.h - lsat.h) -  W;
+
+  /* Extraction water average specific enthalpy */
+  Hml = lsat.h;
+  // Hml = (lsat.h + Hex)/2;
+
+  Cvt.h_vol_2 = Hml;
+  Cev.h_vol_2 = Hml;
+  Cep.h_vol_2 = Hml;
+  Cex.h_vol_1 = Hml;
+
+  /* Average specific enthalpies of the inlets */
+  Hmv = (Cvt.Q*Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h)/Qc;
+
+  // Cvt.h_vol_2 = Hmv;
+  // Cev.h_vol_2 = Hmv;
+  // Cep.h_vol_2 = Hmv;
+  // Cex.h_vol_1 = Hex;
+
+  /* Extraction water specific enthalpy */
+  Hex = noEvent(if (rho_ex > 0) then lsat.h + ((Cex.P - Pcond)/rho_ex) else lsat.h);
+
+  /* Gravity pressure losses in the hot side */
+  DPgc = rho_ex*g*(z2c - z1c);
+
+  /* Fluid composition in the cavity (no balance equations) */
+  Cex.ftype = ftype;
+
+  Cex.Xco2 = 0;
+  Cex.Xh2o = 0;
+  Cex.Xo2  = 0;
+  Cex.Xso2 = 0;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1);
+  else
+    Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    rvt = if Cvt.diff_on_1 then exp(-0.033*(Cvt.Q*Cvt.diff_res_1)^2) else 0;
+    rev = if Cev.diff_on_1 then exp(-0.033*(Cev.Q*Cev.diff_res_1)^2) else 0;
+    rep = if Cep.diff_on_1 then exp(-0.033*(Cep.Q*Cep.diff_res_1)^2) else 0;
+    rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0;
+
+    gamma_vt = if Cvt.diff_on_1 then 1/Cvt.diff_res_1 else gamma0;
+    gamma_ev = if Cev.diff_on_1 then 1/Cev.diff_res_1 else gamma0;
+    gamma_ep = if Cep.diff_on_1 then 1/Cep.diff_res_1 else gamma0;
+    gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0;
+
+    Jvt = if Cvt.diff_on_1 then rvt*gamma_vt*(Cvt.h_vol_1 - Cvt.h_vol_2) else 0;
+    Jev = if Cev.diff_on_1 then rev*gamma_ev*(Cev.h_vol_1 - Cev.h_vol_2) else 0;
+    Jep = if Cep.diff_on_1 then rep*gamma_ep*(Cep.h_vol_1 - Cep.h_vol_2) else 0;
+    Jex = if Cex.diff_on_2 then rex*gamma_ex*(Cex.h_vol_2 - Cex.h_vol_1) else 0;
+  else
+    rvt = 0;
+    rev = 0;
+    rep = 0;
+    rex = 0;
+
+    gamma_vt = gamma0;
+    gamma_ev = gamma0;
+    gamma_ep = gamma0;
+    gamma_ex = gamma0;
+
+    Jvt = 0;
+    Jev = 0;
+    Jep = 0;
+    Jex = 0;
+   end if;
+
+  J = Jvt + Jev + Jep + Jex;
+
+  Cvt.diff_res_2 = 0;
+  Cev.diff_res_2 = 0;
+  Cep.diff_res_2 = 0;
+  Cex.diff_res_1 = 0;
+
+  Cvt.diff_on_2 = diffusion;
+  Cev.diff_on_2 = diffusion;
+  Cep.diff_on_2 = diffusion;
+  Cex.diff_on_1 = diffusion;
+
+  // Cooling pipe
+  //-------------
+
+  /* Cooling pipe inlet and outlet */
+  Cee.Q = Cse.Q;
+
+  Cee.h_vol_1 = Cse.h_vol_1;
+  Cee.h_vol_2 = Cse.h_vol_2;
+
+  Cse.diff_on_1 = Cee.diff_on_1;
+  Cee.diff_on_2 = Cse.diff_on_2;
+
+  Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff;
+  Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff;
+
+  Cee.ftype = Cse.ftype;
+
+  Cee.Xco2 = Cse.Xco2;
+  Cee.Xh2o = Cse.Xh2o;
+  Cee.Xo2  = Cse.Xo2;
+  Cee.Xso2 = Cse.Xso2;
+
+  ftype_p = Cee.ftype;
+
+  Qf = Cee.Q;
+
+  /* Pressure losses in the cold side */
+  Cee.P - Cse.P = DPf;
+
+  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
+  DPgf = rhof*g*(z2f - z1f);
+  DPf = DPff + DPgf;
+
+  /* Power released from the hot side to the cold side */
+  W = Qf*(Cse.h - Cee.h);
+
+  /* Fluid thermodynamic properties of the hot side */
+  proce = ThermoSysPro.Properties.Fluid.Ph(Cvt.P, Hmv, mode_c, fluid);
+  procs = ThermoSysPro.Properties.Fluid.Ph(Cex.P, Cex.h, mode_cs, fluid);
+  //procs = ThermoSysPro.Properties.Fluid.Ph(Pcond + Cex.P)/2, (lsat.h + Cex.h)/2, modecs);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid);
+
+  if (p_rhoc > 0) then
+    rho_ex = p_rhoc;
+  else
+    rho_ex = procs.d;
+  end if;
+
+  /* Fluid thermodynamic properties of the cold side */
+  profe = ThermoSysPro.Properties.Fluid.Ph(Cee.P, Cee.h, mode_f, fluid_p);
+  profs = ThermoSysPro.Properties.Fluid.Ph(Cse.P, Cse.h, mode_f, fluid_p);
+  promf = ThermoSysPro.Properties.Fluid.Ph((Cee.P + Cse.P)/2, (Cee.h + Cse.h)/2, mode_f, fluid_p);
+
+  Tef = profe.T;
+  Tsf = profs.T;
+
+  if (p_rhof > 0) then
+    rhof = p_rhof;
+  else
+    rhof = promf.d;
+  end if;
+
+  /* Calculation of the heat exchange surface */
+  S_ech1 = pi*D_tube1*L_tube1*nb_tube1;
+  S_ech2 = pi*D_tube2*L_tube2*nb_tube2;
+  S_ech3 = pi*D_tube3*L_tube3*nb_tube3;
+  S_ech4 = pi*D_tube4*L_tube4*nb_tube4;
+  S_ech5 = pi*D_tube5*L_tube5*nb_tube5;
+  S_ech6 = pi*D_tube6*L_tube6*nb_tube6;
+  S_ech = S_ech1 + S_ech2 + S_ech3 + S_ech4 + S_ech5 + S_ech6;
+
+ /* Calculation of the passage section of the cold water */
+  S_pass = (D_tube1/2 - e_tube1)^2*pi*nb_tube1/nb_pass + (D_tube2/2 - e_tube2)^2*pi*nb_tube2/nb_pass + (D_tube3/2 - e_tube3)^2*pi*nb_tube3/nb_pass + (D_tube4/2 - e_tube4)^2*pi*nb_tube4/nb_pass + (D_tube5/2 - e_tube5)^2*pi*nb_tube5/nb_pass +(D_tube6/2 - e_tube6)^2*pi*nb_tube6/nb_pass;
+
+  /* Calculation of the velocity of the cold water */
+  Vf = Qf/rhof/S_pass;
+
+  /* Calculation of the correction factor for the water according to the HEI standard, 10th edition */
+  Fw = -2.104072e-04*(Tef - 273.15)^2 + 1.974994e-02*(Tef - 273.15) + 6.639699e-01;
+
+  /* Calculation of the weight average diameter of the tubes */
+  D_tubes = (D_tube1*nb_tube1 + D_tube2*nb_tube2 + D_tube3*nb_tube3 + D_tube4*nb_tube4 + D_tube5*nb_tube5 + D_tube6*nb_tube6)/(nb_tube1 + nb_tube2 + nb_tube3 + nb_tube4 + nb_tube5 + nb_tube6);
+
+  /* Calculation of the uncorrected heat transfert coefficient according to the HEI standard, 10th edition */
+  U1 = ThermoSysPro.Correlations.Thermal.Function_U1(D_tubes, Vf);
+
+  /* Calculation of the weight average thickness of the tubes */
+  e_tubes = (e_tube1*nb_tube1 + e_tube2*nb_tube2 + e_tube3*nb_tube3 + e_tube4*nb_tube4 + e_tube5*nb_tube5 + e_tube6*nb_tube6)/(nb_tube1 + nb_tube2 + nb_tube3 + nb_tube4 + nb_tube5 + nb_tube6);
+
+  /* Calculation of the correction factor for material and gauge according to the HEI standard, 10th edition */
+  FM1 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube1, Tube_Material1);
+  FM2 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube2, Tube_Material2);
+  FM3 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube3, Tube_Material3);
+  FM4 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube4, Tube_Material4);
+  FM5 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube5, Tube_Material5);
+  FM6 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube6, Tube_Material6);
+  FM = (FM1*S_ech1 + FM2*S_ech2 + FM3*S_ech3 + FM4*S_ech4 + FM5*S_ech5 + FM6*S_ech6)/S_ech;
+
+  /* Calculation of the heat transfert coefficient according to the HEI standard, 10th edition */
+  U = Ucorr*U1*FM*FC*Fw;
+
+  /* Calculation of the average specific heat capacity of the cold water */
+  Cpmf = promf.cp;
+
+  /* Calculation of the expected HEI saturation temperature  */
+  Tsat_att = Tef + (W/(Qf*Cpmf))*(1/(1 - Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf))));
+
+  /* Calculation of expected HEI saturation pressure  */
+  Psat_att = ThermoSysPro.Properties.Fluid.P_sat(Tsat_att, fluid);
+
+  /* Calculation of the HEI pressure cut-off */
+  Pcut_off = (5.752433E-04*(Tef-273.15)^3 + 1.735162E-02*(Tef-273.15)^2 + 8.052739E-02*(Tef-273.15) + 2.109159E+01)*100;
+
+  /* Calculation of the HEI saturation temperature at pressure cut-off  */
+  Tcut_off = ThermoSysPro.Properties.Fluid.T_sat(Pcut_off, fluid);
+
+  /* Calculation of HEI zero-load  pressure */
+  Pzero_load = (5.008000E-04*(Tef - 273.15)^3 + 2.039549E-02*(Tef - 273.15)^2 + 2.277566E-01*(Tef - 273.15) + 1.027824E+01)*100;
+
+  /* Calculation of power exchanged from the hot side to the cold side at Pcut_off */
+  Tcut_off = Tef + (Wcut_off/(Qf*Cpmf))*(1/(1-Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf))));
+
+  /* Calculation of the expected HEI corrected saturation pressure*/
+  if (Psat_att < Pcut_off) then
+    Pcond = (Pcut_off - Pzero_load)/Wcut_off*W + Pzero_load + Poffset;
+  else
+    Pcond = Psat_att + Poffset;
+  end if;
+
+  /* Calculation of the expected HEI corrected saturation pressure */
+  Tsat = ThermoSysPro.Properties.Fluid.T_sat(Pcond, fluid);
+
+  /* Calculation of the Terminal Temperature Difference */
+  TTD = Tsat - Tsf;
+
+  /* The standards HEI are not applicable if the terminal temperature difference is less than 2,78 K */
+  if (TTD > 2.78) then
+    HEI = 1;
+  else
+    HEI = 0;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-22,88},{20,70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Turbine outlet"),
+        Text(
+          extent={{-82,24},{-52,16}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Drain inlet"),
+        Text(
+          extent={{-24,-52},{26,-72}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Extraction water"),
+        Text(
+          extent={{38,-58},{86,-66}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Cooling water outlet"),
+        Text(
+          extent={{-86,-52},{-32,-74}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Cooling water inlet"),
+        Text(
+          extent={{-86,66},{-50,54}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Vapor inlet"),
+        Line(
+          points={{0,8},{0,-70}},
+          color={0,0,0},
+          thickness=1),
+        Polygon(
+          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{-100,8},{100,8}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
+              -32},{-90,-32},{-90,-38},{100,-38}},
+          color={28,108,200},
+          thickness=0.5),
+        Text(
+          extent={{-80,60},{72,12}},
+          lineColor={28,108,200},
+          textString="HEI")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-86},{100,100},{-100,100},{-100,-86},{100,-86}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid,
+                    lineThickness=0),
+        Line(
+          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
+              -32},{-90,-32},{-90,-38},{100,-38}},
+          color={28,108,200},
+          thickness=0.5),
+        Polygon(
+          points={{0,-86},{-11,-66},{11,-66},{0,-86}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{0,8},{0,-66}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-100,8},{100,8}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-78,74},{74,26}},
+          lineColor={28,108,200},
+          textString="HEI")}),
+    Window(
+      x=0.09,
+      y=0.08,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StaticCondenserHEI;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo
index a636f0057d23e3f9d26fbf757ddc4c4eab973d59..153e6209b675ba633459669c8aea6c86c340c895 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo
@@ -1,404 +1,404 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model StaticExchangerDTorWorEff "Static heat exchanger with fixed delta temperature, delta power or efficiency"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Integer exchanger_type=1 "Exchanger type - 1: delta temperature is fixed - 2: delta power is fixed - 3: efficiency is fixed";
-  parameter ThermoSysPro.Units.SI.TemperatureDifference DTfroid=0
-    "Temperature difference between the cold inlet and the cold outlet (active if exchanger_type=1)";
-  parameter Units.SI.Power DW=0
-    "Power increase on the cold side (active if exchanger_type=2)";
-  parameter Real EffEch=0.9 "Thermal exchange efficiency (=W/Wmax) (active if exchanger_type=3)";
-  parameter Real Kc=1e-4 "Pressure loss coefficient for the hot fluid";
-  parameter Real Kf=1e-4 "Pressure loss coefficient for the cold fluid";
-  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
-  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
-  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
-  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
-  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
-    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
-    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot fluid";
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold fluid";
-  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_cs=IF97Region.All_regions "IF97 region of the water at the outlet of the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_cs=Integer(region_cs) - 1 "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.Power W(start=1e6)
-    "Power exchanged from the hot fluid to the cold fluid";
-  Units.SI.Temperature Tec(start=500)
-    "Fluid temperature at the inlet of the hot side";
-  Units.SI.Temperature Tsc(start=400)
-    "Fluid temperature at the outlet of the hot side";
-  Units.SI.Temperature Tef(start=350)
-    "Fluid temperature at the inlet of the cold side";
-  Units.SI.Temperature Tsf(start=450)
-    "Fluid temperature at the outlet of the cold side";
-  ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3)
-    "Friction pressure loss for the hot fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2)
-    "Gravity pressure loss for the hot fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3)
-    "Total pressure loss for the hot fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3)
-    "Friction pressure loss for the cold fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2)
-    "Gravity pressure loss for the cold fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3)
-    "Total pressure loss for the cold fluid";
-  Units.SI.Density rhoc(start=998) "Hot fluid density";
-  Units.SI.Density rhof(start=998) "Cold fluid density";
-  Units.SI.SpecificHeatCapacity Cpf "Specific heat capacity of the cold fluid";
-  Units.SI.SpecificHeatCapacity Cpc "Specific heat capacity of the hot fluid";
-  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
-  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
-  FluidType ftype_c "Fluid type for the hot fluid";
-  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
-  FluidType ftype_f "Fluid type for the cold fluid";
-  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
-
-public
-  Interfaces.Connectors.FluidInlet Ec "Hot inlet" annotation (Placement(
-        transformation(extent={{-50,31},{-30,51}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Ef "Cold inlet" annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sf "Cold outlet" annotation (Placement(
-        transformation(extent={{90,-9},{110,11}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sc "Hot outlet" annotation (Placement(
-        transformation(extent={{30,31},{50,51}}, rotation=0)));
-equation
-
-  /* Mass flow rates */
-  Ec.Q = Sc.Q;
-
-  Ec.h_vol_1 = Sc.h_vol_1;
-  Ec.h_vol_2 = Sc.h_vol_2;
-
-  Sc.diff_on_1 = Ec.diff_on_1;
-  Ec.diff_on_2 = Sc.diff_on_2;
-
-  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
-  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
-
-  Ec.ftype = Sc.ftype;
-
-  Ec.Xco2 = Sc.Xco2;
-  Ec.Xh2o = Sc.Xh2o;
-  Ec.Xo2  = Sc.Xo2;
-  Ec.Xso2 = Sc.Xso2;
-
-  ftype_c = Ec.ftype;
-
-  Ef.Q = Sf.Q;
-
-  Ef.h_vol_1 = Sf.h_vol_1;
-  Ef.h_vol_2 = Sf.h_vol_2;
-
-  Sf.diff_on_1 = Ef.diff_on_1;
-  Ef.diff_on_2 = Sf.diff_on_2;
-
-  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
-  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
-
-  Ef.ftype = Sf.ftype;
-
-  Ef.Xco2 = Sf.Xco2;
-  Ef.Xh2o = Sf.Xh2o;
-  Ef.Xo2  = Sf.Xo2;
-  Ef.Xso2 = Sf.Xso2;
-
-  ftype_f = Ef.ftype;
-
-  Qc = Ec.Q;
-  Qf = Ef.Q;
-
-   /* Power exchanged between the hot and cold fluids */
-  if (exchanger_type == 1) then
-    W = Qf*(Sf.h - Ef.h);
-    W = Qc*(Ec.h - Sc.h);
-    Sf.h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Sf.P, Tsf, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-    Tsf = Tef + DTfroid;
-  elseif (exchanger_type == 2) then
-    W = Qf*(Sf.h - Ef.h);
-    DW = Qf*(Sf.h - Ef.h);
-    DW = Qc*(Ec.h - Sc.h);
-    Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f,  Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-  elseif (exchanger_type == 3) then
-    W = noEvent(min(Qc*Cpc, Qf*Cpf)*EffEch*(Tec - Tef));
-    Sf.h = Ef.h + W/Qf;
-    Sc.h = Ec.h - W/Qc;
-    Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f,  Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-  else
-    assert(false, "StaticWaterWaterExchangerDTorWorEff: invalid option");
-  end if;
-
-  /* Pressure losses for the hot fluid */
-  Ec.P - Sc.P = DPc;
-
-  DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
-  DPgc = rhoc*g*(z2c - z1c);
-  DPc  = DPfc + DPgc;
-
-  /* Pressure losses for the cold fluid */
-  Ef.P - Sf.P = DPf;
-
-  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
-  DPgf = rhof*g*(z2f - z1f);
-  DPf  = DPff + DPgf;
-
- /* Hot fluid Temperature at the inlet and at the outlet */
-  Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, mode_c,  Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
-  Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, mode_cs,  Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
-
-  /* Hot fluid density */
-  if (p_rhoc > 0) then
-    rhoc = p_rhoc;
-  else
-    rhoc = ThermoSysPro.Properties.Fluid.Density_Ph((Ec.P + Sc.P)/2,(Ec.h + Sc.h)/2, fluid_c, mode_c, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
-  end if;
-
-  /* Cold fluid Temperature at the inlet */
-  Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-
-  /* Cold fluid density */
-  if (p_rhof > 0) then
-    rhof = p_rhof;
-  else
-    rhof = ThermoSysPro.Properties.Fluid.Density_Ph((Ef.P + Sf.P)/2,(Ef.h + Sf.h)/2, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-  end if;
-
-  /* Average specific heat capacities */
-  Cpf = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ef.P, Ef.h, fluid_f, mode_f,  Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-  Cpc = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ec.P, Ec.h, fluid_c, mode_c,  Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{36,-31},{100,31}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-102,-31},{-38,31}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,31},{72,-31}},
-          lineColor={255,255,0},
-          fillColor= DynamicSelect({255,255,0}, fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-72,31},{72,31},{72,31}},
-          color={0,0,0}),
-        Line(
-          points={{-72,-31},{72,-31},{72,-31}},
-          color={0,0,0}),
-        Line(
-          points={{68,-17},{100,-1}},
-          color={0,255,255},
-          thickness=0),
-        Rectangle(
-          extent={{-64,2},{68,2}},
-          lineColor={0,255,255},
-          lineThickness=0,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-96,5},{-64,21}},
-          color={0,255,255},
-          thickness=0),
-        Line(
-          points={{-66,-17},{-66,-7}},
-          color={0,255,255},
-          thickness=0),
-        Line(
-          points={{-66,-8},{-66,2}},
-          color={0,255,255},
-          thickness=0),
-        Line(
-          points={{70,11},{70,21}},
-          color={0,255,255},
-          thickness=0),
-        Line(
-          points={{70,2},{70,12}},
-          color={0,255,255},
-          thickness=0),
-        Line(
-          points={{0,31},{0,-23}},
-          color={0,0,0},
-          thickness=0),
-        Rectangle(
-          extent={{-64,21},{68,21}},
-          lineColor={0,255,255},
-          lineThickness=0,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-64,-17},{68,-17}},
-          lineColor={0,255,255},
-          lineThickness=0,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{0,31},{0,-23}},
-          color={0,0,0},
-          thickness=0),
-        Text(
-          extent={{-126,26},{-96,18}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold inlet"),
-        Text(
-          extent={{94,30},{124,16}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold outlet"),
-        Text(
-          extent={{-88,56},{-60,44}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot inlet"),
-        Text(
-          extent={{56,56},{88,44}},
-          lineColor={238,46,47},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot outlet")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(
-          extent={{-108,28},{-92,22}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "E_Froid"),
-        Text(
-          extent={{96,28},{112,22}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "S_Froid"),
-        Ellipse(
-          extent={{38,-31},{102,31}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-102,-31},{-38,31}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-70,31},{70,-31}},
-          lineColor={255,255,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-72,31},{72,31},{72,31}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-72,-31},{72,-31},{72,-31}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{68,-17},{100,-1}},
-          color={0,255,255},
-          thickness=1),
-        Rectangle(
-          extent={{-64,-15},{68,-17}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-64,2},{68,0}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-64,21},{68,19}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-64,-7},{68,-9}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-96,5},{-64,21}},
-          color={0,255,255},
-          thickness=1),
-        Rectangle(
-          extent={{-64,11},{68,9}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-64,-17},{-64,-7}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{68,-9},{68,1}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{68,10},{68,20}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{-64,1},{-64,11}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{0,31},{0,-23}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end StaticExchangerDTorWorEff;
+within ThermoSysPro.Fluid.HeatExchangers;
+model StaticExchangerDTorWorEff "Static heat exchanger with fixed delta temperature, delta power or efficiency"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Integer exchanger_type=1 "Exchanger type - 1: delta temperature is fixed - 2: delta power is fixed - 3: efficiency is fixed";
+  parameter ThermoSysPro.Units.SI.TemperatureDifference DTfroid=0
+    "Temperature difference between the cold inlet and the cold outlet (active if exchanger_type=1)";
+  parameter Units.SI.Power DW=0
+    "Power increase on the cold side (active if exchanger_type=2)";
+  parameter Real EffEch=0.9 "Thermal exchange efficiency (=W/Wmax) (active if exchanger_type=3)";
+  parameter Real Kc=1e-4 "Pressure loss coefficient for the hot fluid";
+  parameter Real Kf=1e-4 "Pressure loss coefficient for the cold fluid";
+  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
+  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
+  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
+  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
+  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
+    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
+    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot fluid";
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold fluid";
+  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_cs=IF97Region.All_regions "IF97 region of the water at the outlet of the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_cs=Integer(region_cs) - 1 "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.Power W(start=1e6)
+    "Power exchanged from the hot fluid to the cold fluid";
+  Units.SI.Temperature Tec(start=500)
+    "Fluid temperature at the inlet of the hot side";
+  Units.SI.Temperature Tsc(start=400)
+    "Fluid temperature at the outlet of the hot side";
+  Units.SI.Temperature Tef(start=350)
+    "Fluid temperature at the inlet of the cold side";
+  Units.SI.Temperature Tsf(start=450)
+    "Fluid temperature at the outlet of the cold side";
+  ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3)
+    "Friction pressure loss for the hot fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2)
+    "Gravity pressure loss for the hot fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3)
+    "Total pressure loss for the hot fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3)
+    "Friction pressure loss for the cold fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2)
+    "Gravity pressure loss for the cold fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3)
+    "Total pressure loss for the cold fluid";
+  Units.SI.Density rhoc(start=998) "Hot fluid density";
+  Units.SI.Density rhof(start=998) "Cold fluid density";
+  Units.SI.SpecificHeatCapacity Cpf "Specific heat capacity of the cold fluid";
+  Units.SI.SpecificHeatCapacity Cpc "Specific heat capacity of the hot fluid";
+  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+  FluidType ftype_c "Fluid type for the hot fluid";
+  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
+  FluidType ftype_f "Fluid type for the cold fluid";
+  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
+
+public
+  Interfaces.Connectors.FluidInlet Ec "Hot inlet" annotation (Placement(
+        transformation(extent={{-50,31},{-30,51}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Ef "Cold inlet" annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sf "Cold outlet" annotation (Placement(
+        transformation(extent={{90,-9},{110,11}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sc "Hot outlet" annotation (Placement(
+        transformation(extent={{30,31},{50,51}}, rotation=0)));
+equation
+
+  /* Mass flow rates */
+  Ec.Q = Sc.Q;
+
+  Ec.h_vol_1 = Sc.h_vol_1;
+  Ec.h_vol_2 = Sc.h_vol_2;
+
+  Sc.diff_on_1 = Ec.diff_on_1;
+  Ec.diff_on_2 = Sc.diff_on_2;
+
+  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
+  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
+
+  Ec.ftype = Sc.ftype;
+
+  Ec.Xco2 = Sc.Xco2;
+  Ec.Xh2o = Sc.Xh2o;
+  Ec.Xo2  = Sc.Xo2;
+  Ec.Xso2 = Sc.Xso2;
+
+  ftype_c = Ec.ftype;
+
+  Ef.Q = Sf.Q;
+
+  Ef.h_vol_1 = Sf.h_vol_1;
+  Ef.h_vol_2 = Sf.h_vol_2;
+
+  Sf.diff_on_1 = Ef.diff_on_1;
+  Ef.diff_on_2 = Sf.diff_on_2;
+
+  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
+  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
+
+  Ef.ftype = Sf.ftype;
+
+  Ef.Xco2 = Sf.Xco2;
+  Ef.Xh2o = Sf.Xh2o;
+  Ef.Xo2  = Sf.Xo2;
+  Ef.Xso2 = Sf.Xso2;
+
+  ftype_f = Ef.ftype;
+
+  Qc = Ec.Q;
+  Qf = Ef.Q;
+
+   /* Power exchanged between the hot and cold fluids */
+  if (exchanger_type == 1) then
+    W = Qf*(Sf.h - Ef.h);
+    W = Qc*(Ec.h - Sc.h);
+    Sf.h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Sf.P, Tsf, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+    Tsf = Tef + DTfroid;
+  elseif (exchanger_type == 2) then
+    W = Qf*(Sf.h - Ef.h);
+    DW = Qf*(Sf.h - Ef.h);
+    DW = Qc*(Ec.h - Sc.h);
+    Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f,  Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+  elseif (exchanger_type == 3) then
+    W = noEvent(min(Qc*Cpc, Qf*Cpf)*EffEch*(Tec - Tef));
+    Sf.h = Ef.h + W/Qf;
+    Sc.h = Ec.h - W/Qc;
+    Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f,  Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+  else
+    assert(false, "StaticWaterWaterExchangerDTorWorEff: invalid option");
+  end if;
+
+  /* Pressure losses for the hot fluid */
+  Ec.P - Sc.P = DPc;
+
+  DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
+  DPgc = rhoc*g*(z2c - z1c);
+  DPc  = DPfc + DPgc;
+
+  /* Pressure losses for the cold fluid */
+  Ef.P - Sf.P = DPf;
+
+  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
+  DPgf = rhof*g*(z2f - z1f);
+  DPf  = DPff + DPgf;
+
+ /* Hot fluid Temperature at the inlet and at the outlet */
+  Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, mode_c,  Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
+  Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, mode_cs,  Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
+
+  /* Hot fluid density */
+  if (p_rhoc > 0) then
+    rhoc = p_rhoc;
+  else
+    rhoc = ThermoSysPro.Properties.Fluid.Density_Ph((Ec.P + Sc.P)/2,(Ec.h + Sc.h)/2, fluid_c, mode_c, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
+  end if;
+
+  /* Cold fluid Temperature at the inlet */
+  Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+
+  /* Cold fluid density */
+  if (p_rhof > 0) then
+    rhof = p_rhof;
+  else
+    rhof = ThermoSysPro.Properties.Fluid.Density_Ph((Ef.P + Sf.P)/2,(Ef.h + Sf.h)/2, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+  end if;
+
+  /* Average specific heat capacities */
+  Cpf = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ef.P, Ef.h, fluid_f, mode_f,  Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+  Cpc = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ec.P, Ec.h, fluid_c, mode_c,  Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{36,-31},{100,31}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-102,-31},{-38,31}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,31},{72,-31}},
+          lineColor={255,255,0},
+          fillColor= DynamicSelect({255,255,0}, fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-72,31},{72,31},{72,31}},
+          color={0,0,0}),
+        Line(
+          points={{-72,-31},{72,-31},{72,-31}},
+          color={0,0,0}),
+        Line(
+          points={{68,-17},{100,-1}},
+          color={0,255,255},
+          thickness=0),
+        Rectangle(
+          extent={{-64,2},{68,2}},
+          lineColor={0,255,255},
+          lineThickness=0,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-96,5},{-64,21}},
+          color={0,255,255},
+          thickness=0),
+        Line(
+          points={{-66,-17},{-66,-7}},
+          color={0,255,255},
+          thickness=0),
+        Line(
+          points={{-66,-8},{-66,2}},
+          color={0,255,255},
+          thickness=0),
+        Line(
+          points={{70,11},{70,21}},
+          color={0,255,255},
+          thickness=0),
+        Line(
+          points={{70,2},{70,12}},
+          color={0,255,255},
+          thickness=0),
+        Line(
+          points={{0,31},{0,-23}},
+          color={0,0,0},
+          thickness=0),
+        Rectangle(
+          extent={{-64,21},{68,21}},
+          lineColor={0,255,255},
+          lineThickness=0,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-64,-17},{68,-17}},
+          lineColor={0,255,255},
+          lineThickness=0,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{0,31},{0,-23}},
+          color={0,0,0},
+          thickness=0),
+        Text(
+          extent={{-126,26},{-96,18}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold inlet"),
+        Text(
+          extent={{94,30},{124,16}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold outlet"),
+        Text(
+          extent={{-88,56},{-60,44}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot inlet"),
+        Text(
+          extent={{56,56},{88,44}},
+          lineColor={238,46,47},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot outlet")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(
+          extent={{-108,28},{-92,22}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "E_Froid"),
+        Text(
+          extent={{96,28},{112,22}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "S_Froid"),
+        Ellipse(
+          extent={{38,-31},{102,31}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-102,-31},{-38,31}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-70,31},{70,-31}},
+          lineColor={255,255,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-72,31},{72,31},{72,31}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-72,-31},{72,-31},{72,-31}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{68,-17},{100,-1}},
+          color={0,255,255},
+          thickness=1),
+        Rectangle(
+          extent={{-64,-15},{68,-17}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-64,2},{68,0}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-64,21},{68,19}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-64,-7},{68,-9}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-96,5},{-64,21}},
+          color={0,255,255},
+          thickness=1),
+        Rectangle(
+          extent={{-64,11},{68,9}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-64,-17},{-64,-7}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{68,-9},{68,1}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{68,10},{68,20}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{-64,1},{-64,11}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{0,31},{0,-23}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end StaticExchangerDTorWorEff;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo
index 0cd8f23b4615a302cd166876f0194fac08d0e0fe..fa740c6be9a871b71bf600529d03ee41e1a16ce1 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo
@@ -1,264 +1,264 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model StaticExchangerKS "Static heat exchanger with fixed K and S (Coefficient of heat transfer and Heat exchanger surface)"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.CoefficientOfHeatTransfer K=100
-    "Global heat exchange coefficient";
-  parameter Units.SI.Area S=10 "Heat exchange surface";
-  parameter Real Kc=1e-4 "Pressure loss coefficient for the hot fluid";
-  parameter Real Kf=1e-4 "Pressure loss coefficient for the cold fluid";
-  parameter Integer exchanger_conf=1 "Exchanger configuration - 1: counter-current. 2: co-current";
-  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
-    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
-    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot fluid"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold fluid"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.Power W "Power exchanged";
-  Units.SI.Temperature Tec(start=400)
-    "Temperature of the hot fluid at the inlet";
-  Units.SI.Temperature Tsc(start=300)
-    "Temperature of the hot fluid at the outlet";
-  Units.SI.Temperature Tef(start=300)
-    "Temperature of the cold fluid at the inlet";
-  Units.SI.Temperature Tsf(start=400)
-    "Temperature of the cold fluid at the outlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DT1 "Delta T at the inlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DT2 "Delta T at the outlet";
-  Units.SI.SpecificHeatCapacity Cpf(start=2000)
-    "Specific heat capacity of the cold fluid";
-  Units.SI.SpecificHeatCapacity Cpc(start=2000)
-    "Specific heat capacity of the hot fluid";
-  Units.SI.Density rhoc(start=998) "Hot fluid density";
-  Units.SI.Density rhof(start=998) "Cold fluid density";
-  Units.SI.MassFlowRate Qc(start=100) "Mass flow rate of the hot fluid";
-  Units.SI.MassFlowRate Qf(start=100) "Mass flow rate of the cold fluid";
-  Real Kcor "Corrective term for the global heat exchange coefficient";
-  FluidType ftype_c "Fluid type for the hot fluid";
-  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
-  FluidType ftype_f "Fluid type for the cold fluid";
-  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
-
-  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
-          extent={{90,-40},{110,-20}}, rotation=0), iconTransformation(extent={
-            {90,-40},{110,-20}})));
-  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
-          extent={{-110,-40},{-90,-20}}, rotation=0), iconTransformation(extent=
-           {{-110,-40},{-90,-20}})));
-  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
-          extent={{-110,20},{-90,40}}, rotation=0), iconTransformation(extent={
-            {-110,20},{-90,40}})));
-  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
-          extent={{90,20},{110,40}}, rotation=0), iconTransformation(extent={{
-            90,20},{110,40}})));
-  InstrumentationAndControl.Connectors.InputReal Kcorr "K_correction"
-    annotation (Placement(transformation(
-        origin={0,70},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-equation
-
-  if (cardinality(Kcorr) == 0) then
-    Kcorr.signal = 1;
-  end if;
-
-  Kcor = Kcorr.signal;
-
-  /* Mass flow rates */
-  Ec.Q = Sc.Q;
-
-  Ec.h_vol_1 = Sc.h_vol_1;
-  Ec.h_vol_2 = Sc.h_vol_2;
-
-  Sc.diff_on_1 = Ec.diff_on_1;
-  Ec.diff_on_2 = Sc.diff_on_2;
-
-  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
-  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
-
-  Ec.ftype = Sc.ftype;
-
-  Ec.Xco2 = Sc.Xco2;
-  Ec.Xh2o = Sc.Xh2o;
-  Ec.Xo2  = Sc.Xo2;
-  Ec.Xso2 = Sc.Xso2;
-
-  ftype_c = Ec.ftype;
-
-  Ef.Q = Sf.Q;
-
-  Ef.h_vol_1 = Sf.h_vol_1;
-  Ef.h_vol_2 = Sf.h_vol_2;
-
-  Sf.diff_on_1 = Ef.diff_on_1;
-  Ef.diff_on_2 = Sf.diff_on_2;
-
-  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
-  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
-
-  Ef.ftype = Sf.ftype;
-
-  Ef.Xco2 = Sf.Xco2;
-  Ef.Xh2o = Sf.Xh2o;
-  Ef.Xo2  = Sf.Xo2;
-  Ef.Xso2 = Sf.Xso2;
-
-  ftype_f = Ef.ftype;
-
-  Qc = Ec.Q;
-  Qf = Ef.Q;
-
-  /* Presure losses */
-  Ec.P - Sc.P = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
-  Ef.P - Sf.P = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
-
-  if (exchanger_conf == 1) then
-     /* Counter-current exchanger */
-     DT1 = Tec - Tsf;
-     DT2 = Tsc - Tef;
-  elseif (exchanger_conf == 2) then
-     /* Co-current exchanger */
-     DT1 = Tec - Tef;
-     DT2 = Tsc - Tsf;
-  else
-     DT1 = 0;
-     DT2 = 0;
-     assert(false, "StaticExchangerFlueGasesWaterSteam: incorrect exchanger configuration");
-  end if;
-
-  DT2 = if (exchanger_conf == 1) then DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) - 1/(Qf*Cpf)))
-                                 else DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) + 1/(Qf*Cpf)));
-
-  /* Power exchanged */
-  W = Qc*(Ec.h-Sc.h);
-  W = Qf*(Sf.h - Ef.h);
-
-  /* Fluid specific enthalpy at the inlet */
-  Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-  Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-
-  /* Fluid specific enthalpy at the outlet */
-  Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
-  Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
-
-  /* Specific heat capacities */
-  Cpf = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ef.P, Ef.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-  Cpc = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ec.P, Ec.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
-
-  /* Hot fluid density */
-  if (p_rhoc > 0) then
-    rhoc = p_rhoc;
-  else
-    rhoc = ThermoSysPro.Properties.Fluid.Density_Ph((Ec.P + Sc.P)/2,(Ec.h + Sc.h)/2, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
-  end if;
-
-  /* Cold fluid density */
-  if (p_rhof > 0) then
-    rhof = p_rhof;
-  else
-    rhof = ThermoSysPro.Properties.Fluid.Density_Ph((Ef.P+Sf.P)/2,(Ef.h + Sf.h)/2, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
-  end if;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-54},{100,-61}},
-          lineColor={175,175,175},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-                               Rectangle(
-          extent={{-100,0},{100,-60}},
-          lineColor={28,108,200},
-          fillColor= DynamicSelect({255,255,0}, fill_color_static),
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-100,61},{100,54}},
-          lineColor={175,175,175},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-                               Rectangle(
-          extent={{-100,60},{100,0}},
-          lineColor={28,108,200},
-          fillColor=DynamicSelect({255,255,0}, fill_color_static),
-          fillPattern=FillPattern.Backward),
-        Line(points={{-50,-31},{48,-31}},
-                                      color={255,0,0}),
-        Line(points={{46,-29},{50,-31}},
-                                     color={255,0,0}),
-        Line(points={{46,-33},{50,-31}},
-                                      color={255,0,0}),
-        Line(
-          points={{-100,0},{-42,0},{-26,0},{10,0},{38,0},{100,0}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=true,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(
-          points={{-100,0},{-42,0},{-22,48},{18,-46},{38,0},{100,0}},
-          color={0,0,0},
-          thickness=1),
-        Text(
-          extent={{-114,32},{-78,0}},
-          lineColor={28,108,200},
-          textString="Cold fluid inlet"),
-        Text(
-          extent={{-116,56},{-90,36}},
-          lineColor={28,108,200},
-          textString=" Fluid 2"),
-        Text(
-          extent={{-112,0},{-84,-28}},
-          lineColor={238,46,47},
-          textString=" Fluid 1"),
-        Text(
-          extent={{-110,-30},{-74,-66}},
-          lineColor={238,46,47},
-          textString="Hot fluid inlet"),
-        Text(
-          extent={{84,32},{124,-4}},
-          lineColor={28,108,200},
-          textString="Cold fluid outlet"),
-        Text(
-          extent={{87,-29},{124,-64}},
-          lineColor={238,46,47},
-          textString="Hot fluid outlet")}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StaticExchangerKS;
+within ThermoSysPro.Fluid.HeatExchangers;
+model StaticExchangerKS "Static heat exchanger with fixed K and S (Coefficient of heat transfer and Heat exchanger surface)"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.CoefficientOfHeatTransfer K=100
+    "Global heat exchange coefficient";
+  parameter Units.SI.Area S=10 "Heat exchange surface";
+  parameter Real Kc=1e-4 "Pressure loss coefficient for the hot fluid";
+  parameter Real Kf=1e-4 "Pressure loss coefficient for the cold fluid";
+  parameter Integer exchanger_conf=1 "Exchanger configuration - 1: counter-current. 2: co-current";
+  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
+    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
+    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot fluid"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold fluid"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.Power W "Power exchanged";
+  Units.SI.Temperature Tec(start=400)
+    "Temperature of the hot fluid at the inlet";
+  Units.SI.Temperature Tsc(start=300)
+    "Temperature of the hot fluid at the outlet";
+  Units.SI.Temperature Tef(start=300)
+    "Temperature of the cold fluid at the inlet";
+  Units.SI.Temperature Tsf(start=400)
+    "Temperature of the cold fluid at the outlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DT1 "Delta T at the inlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DT2 "Delta T at the outlet";
+  Units.SI.SpecificHeatCapacity Cpf(start=2000)
+    "Specific heat capacity of the cold fluid";
+  Units.SI.SpecificHeatCapacity Cpc(start=2000)
+    "Specific heat capacity of the hot fluid";
+  Units.SI.Density rhoc(start=998) "Hot fluid density";
+  Units.SI.Density rhof(start=998) "Cold fluid density";
+  Units.SI.MassFlowRate Qc(start=100) "Mass flow rate of the hot fluid";
+  Units.SI.MassFlowRate Qf(start=100) "Mass flow rate of the cold fluid";
+  Real Kcor "Corrective term for the global heat exchange coefficient";
+  FluidType ftype_c "Fluid type for the hot fluid";
+  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
+  FluidType ftype_f "Fluid type for the cold fluid";
+  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
+
+  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
+          extent={{90,-40},{110,-20}}, rotation=0), iconTransformation(extent={
+            {90,-40},{110,-20}})));
+  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
+          extent={{-110,-40},{-90,-20}}, rotation=0), iconTransformation(extent=
+           {{-110,-40},{-90,-20}})));
+  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
+          extent={{-110,20},{-90,40}}, rotation=0), iconTransformation(extent={
+            {-110,20},{-90,40}})));
+  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
+          extent={{90,20},{110,40}}, rotation=0), iconTransformation(extent={{
+            90,20},{110,40}})));
+  InstrumentationAndControl.Connectors.InputReal Kcorr "K_correction"
+    annotation (Placement(transformation(
+        origin={0,70},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+equation
+
+  if (cardinality(Kcorr) == 0) then
+    Kcorr.signal = 1;
+  end if;
+
+  Kcor = Kcorr.signal;
+
+  /* Mass flow rates */
+  Ec.Q = Sc.Q;
+
+  Ec.h_vol_1 = Sc.h_vol_1;
+  Ec.h_vol_2 = Sc.h_vol_2;
+
+  Sc.diff_on_1 = Ec.diff_on_1;
+  Ec.diff_on_2 = Sc.diff_on_2;
+
+  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
+  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
+
+  Ec.ftype = Sc.ftype;
+
+  Ec.Xco2 = Sc.Xco2;
+  Ec.Xh2o = Sc.Xh2o;
+  Ec.Xo2  = Sc.Xo2;
+  Ec.Xso2 = Sc.Xso2;
+
+  ftype_c = Ec.ftype;
+
+  Ef.Q = Sf.Q;
+
+  Ef.h_vol_1 = Sf.h_vol_1;
+  Ef.h_vol_2 = Sf.h_vol_2;
+
+  Sf.diff_on_1 = Ef.diff_on_1;
+  Ef.diff_on_2 = Sf.diff_on_2;
+
+  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
+  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
+
+  Ef.ftype = Sf.ftype;
+
+  Ef.Xco2 = Sf.Xco2;
+  Ef.Xh2o = Sf.Xh2o;
+  Ef.Xo2  = Sf.Xo2;
+  Ef.Xso2 = Sf.Xso2;
+
+  ftype_f = Ef.ftype;
+
+  Qc = Ec.Q;
+  Qf = Ef.Q;
+
+  /* Presure losses */
+  Ec.P - Sc.P = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
+  Ef.P - Sf.P = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
+
+  if (exchanger_conf == 1) then
+     /* Counter-current exchanger */
+     DT1 = Tec - Tsf;
+     DT2 = Tsc - Tef;
+  elseif (exchanger_conf == 2) then
+     /* Co-current exchanger */
+     DT1 = Tec - Tef;
+     DT2 = Tsc - Tsf;
+  else
+     DT1 = 0;
+     DT2 = 0;
+     assert(false, "StaticExchangerFlueGasesWaterSteam: incorrect exchanger configuration");
+  end if;
+
+  DT2 = if (exchanger_conf == 1) then DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) - 1/(Qf*Cpf)))
+                                 else DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) + 1/(Qf*Cpf)));
+
+  /* Power exchanged */
+  W = Qc*(Ec.h-Sc.h);
+  W = Qf*(Sf.h - Ef.h);
+
+  /* Fluid specific enthalpy at the inlet */
+  Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+  Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+
+  /* Fluid specific enthalpy at the outlet */
+  Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
+  Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
+
+  /* Specific heat capacities */
+  Cpf = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ef.P, Ef.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+  Cpc = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ec.P, Ec.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
+
+  /* Hot fluid density */
+  if (p_rhoc > 0) then
+    rhoc = p_rhoc;
+  else
+    rhoc = ThermoSysPro.Properties.Fluid.Density_Ph((Ec.P + Sc.P)/2,(Ec.h + Sc.h)/2, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2);
+  end if;
+
+  /* Cold fluid density */
+  if (p_rhof > 0) then
+    rhof = p_rhof;
+  else
+    rhof = ThermoSysPro.Properties.Fluid.Density_Ph((Ef.P+Sf.P)/2,(Ef.h + Sf.h)/2, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2);
+  end if;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-54},{100,-61}},
+          lineColor={175,175,175},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+                               Rectangle(
+          extent={{-100,0},{100,-60}},
+          lineColor={28,108,200},
+          fillColor= DynamicSelect({255,255,0}, fill_color_static),
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-100,61},{100,54}},
+          lineColor={175,175,175},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+                               Rectangle(
+          extent={{-100,60},{100,0}},
+          lineColor={28,108,200},
+          fillColor=DynamicSelect({255,255,0}, fill_color_static),
+          fillPattern=FillPattern.Backward),
+        Line(points={{-50,-31},{48,-31}},
+                                      color={255,0,0}),
+        Line(points={{46,-29},{50,-31}},
+                                     color={255,0,0}),
+        Line(points={{46,-33},{50,-31}},
+                                      color={255,0,0}),
+        Line(
+          points={{-100,0},{-42,0},{-26,0},{10,0},{38,0},{100,0}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=true,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(
+          points={{-100,0},{-42,0},{-22,48},{18,-46},{38,0},{100,0}},
+          color={0,0,0},
+          thickness=1),
+        Text(
+          extent={{-114,32},{-78,0}},
+          lineColor={28,108,200},
+          textString="Cold fluid inlet"),
+        Text(
+          extent={{-116,56},{-90,36}},
+          lineColor={28,108,200},
+          textString=" Fluid 2"),
+        Text(
+          extent={{-112,0},{-84,-28}},
+          lineColor={238,46,47},
+          textString=" Fluid 1"),
+        Text(
+          extent={{-110,-30},{-74,-66}},
+          lineColor={238,46,47},
+          textString="Hot fluid inlet"),
+        Text(
+          extent={{84,32},{124,-4}},
+          lineColor={28,108,200},
+          textString="Cold fluid outlet"),
+        Text(
+          extent={{87,-29},{124,-64}},
+          lineColor={238,46,47},
+          textString="Hot fluid outlet")}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StaticExchangerKS;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo
index 86c26acb31ecf2dc33225156a0e5d6d8a50a622a..8bee1c0e4f97bdb6f21347f34a48cad9c9e2aa16 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo
@@ -1,375 +1,375 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model StaticPlateHeatExchanger "Static plate heat exchanger"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.ThermalConductivity lambdam=15.0
-    "Metal thermal conductivity";
-  parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000
-    "Heat transfer coefficient for the hot side if not computed by the correlations";
-  parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000
-    "Heat transfer coefficient for the cold side if not computed by the correlations";
-  parameter Real p_Kc=100 "Pressure loss coefficient for the hot side if not computed by the correlations";
-  parameter Real p_Kf=100 "Pressure loss coefficient for the cold side if not computed by the correlations";
-  parameter Units.SI.Thickness emetal=0.0006 "Wall thickness";
-  parameter Units.SI.Area Sp=2 "Plate area";
-  parameter Real nbp=499 "Number of plates";
-  parameter Real c1=1.12647 "Correction coefficient";
-  parameter Integer exchanger_type=1 "Exchanger type - 1: counter-current. 2: co-current";
-  parameter Integer heat_exchange_correlation=1 "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations";
-  parameter Integer pressure_loss_correlation=1 "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations";
-  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
-    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
-    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot fluid"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold fluid"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Power W "Thermal power exchanged between the two sides";
-  ThermoSysPro.Units.SI.PressureDifference DPc
-    "Pressure loss of the hot fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPf
-    "Pressure loss of the cold fluid";
-  Units.SI.CoefficientOfHeatTransfer hc
-    "Heat transfer coefficient of the hot fluid";
-  Units.SI.CoefficientOfHeatTransfer hf
-    "Heat transfer coefficient of the cold fluid";
-  Units.SI.CoefficientOfHeatTransfer K "Global heat transfer coefficient";
-  Units.SI.Area S "Heat exchange surface";
-  Units.SI.Temperature Tec "Fluid temperature at the hot inlet";
-  Units.SI.Temperature Tsc "Fluid temperature at the hot outlet";
-  Units.SI.Temperature Tef "Fluid temperature at the cold inlet";
-  Units.SI.Temperature Tsf "Fluid temperature at the cold outlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DTm
-    "Difference in average temperature";
-  ThermoSysPro.Units.SI.TemperatureDifference DT1
-    "Temperature difference at the inlet of the exchanger";
-  ThermoSysPro.Units.SI.TemperatureDifference DT2
-    "Temperature difference at the outlet of the exchanger";
-  Real DT12 "DT1/DT2 (s.u.)";
-  Units.SI.MassFlowRate Qc(start=500) "Mass flow rate of the hot fluid";
-  Units.SI.MassFlowRate Qf(start=500) "Mass flow rate of the cold fluid";
-  Real qmc;
-  Real qmf;
-  Real quc;
-  Real quf;
-  Real N;
-  Units.SI.Density rhoc(start=998) "Hot fluid density";
-  Units.SI.Density rhof(start=998) "Cold fluid density";
-  Units.SI.DynamicViscosity muc(start=1.e-3) "Hot fluid dynamic viscosity";
-  Units.SI.DynamicViscosity muf(start=1.e-3) "Cold fluid dynamic viscosity";
-  Units.SI.ThermalConductivity lambdac(start=0.602698)
-    "Hot fluid thermal conductivity";
-  Units.SI.ThermalConductivity lambdaf(start=0.597928)
-    "Cold fluid thermal conductivity";
-  Units.SI.Temperature Tmc(start=290) "Hot fluid average temperature";
-  Units.SI.Temperature Tmf(start=290) "Cold fluid average temperature";
-  Units.SI.AbsolutePressure Pmc(start=1.e5) "Hot fluid average pressure";
-  Units.SI.AbsolutePressure Pmf(start=1.e5) "Cold fluid average pressure";
-  Units.SI.SpecificEnthalpy Hmc(start=100000)
-    "Hot fluid average specific enthalpy";
-  Units.SI.SpecificEnthalpy Hmf(start=100000)
-    "Cold fluid average specific enthalpy";
-  FluidType ftype_c "Fluid type for the hot fluid";
-  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
-  FluidType ftype_f "Fluid type for the cold fluid";
-  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
-
-public
-  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
-          extent={{-60,-70},{-40,-50}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
-          extent={{40,-70},{60,-50}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
-          extent={{90,-8},{110,12}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    annotation (Placement(transformation(extent={{-20,-100},{0,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prof
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-equation
-
-  /* Mass flow rates */
-  Ec.Q = Sc.Q;
-
-  Ec.h_vol_1 = Sc.h_vol_1;
-  Ec.h_vol_2 = Sc.h_vol_2;
-
-  Sc.diff_on_1 = Ec.diff_on_1;
-  Ec.diff_on_2 = Sc.diff_on_2;
-
-  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
-  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
-
-  Ec.ftype = Sc.ftype;
-
-  Ec.Xco2 = Sc.Xco2;
-  Ec.Xh2o = Sc.Xh2o;
-  Ec.Xo2  = Sc.Xo2;
-  Ec.Xso2 = Sc.Xso2;
-
-  ftype_c = Ec.ftype;
-
-  Ef.Q = Sf.Q;
-
-  Ef.h_vol_1 = Sf.h_vol_1;
-  Ef.h_vol_2 = Sf.h_vol_2;
-
-  Sf.diff_on_1 = Ef.diff_on_1;
-  Ef.diff_on_2 = Sf.diff_on_2;
-
-  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
-  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
-
-  Ef.ftype = Sf.ftype;
-
-  Ef.Xco2 = Sf.Xco2;
-  Ef.Xh2o = Sf.Xh2o;
-  Ef.Xo2  = Sf.Xo2;
-  Ef.Xso2 = Sf.Xso2;
-
-  ftype_f = Ef.ftype;
-
-  Qc = Ec.Q;
-  Qf = Ef.Q;
-
-  /* Pressures */
-  Sc.P = if Qc > 0 then Ec.P - DPc else Ec.P + DPc;
-  Sf.P = if Qf > 0 then Ef.P - DPf else Ef.P + DPf;
-
-  /* Heat exchanges between the hot and cold fluids */
-  K = hc*hf/(hc + hf + hc*hf*emetal/lambdam);
-  W = K*S*DTm;
-
-  if (abs(Qc) > 1.e-3) then
-    W = Qc*proc.cp*(Tec - Tsc);
-  else
-    Tec = Tsc;
-  end if;
-
-  if (abs(Qf) > 1.e-3) then
-    W = Qf*prof.cp*(Tsf - Tef);
-  else
-    Tef = Tsf;
-  end if;
-
-  /* Difference in average temperatures */
-  if noEvent(((DT1 > DT2) and (DT2 > 0)) or ((DT1 < DT2) and (DT2 < 0))) then
-    DTm = (DT1 - DT2)/Modelica.Math.log(DT1/DT2);
-  else
-    DTm = (DT1 + DT2)/2;
-  end if;
-
-  if (exchanger_type == 1) then
-    /* Counter-current heat exchanger */
-    DT1 = Tec - Tsf;
-    DT2 = Tsc - Tef;
-  elseif (exchanger_type == 2) then
-    /* Co-current heat exchanger */
-    DT1 = Tec - Tef;
-    DT2 = Tsc - Tsf;
-  else
-    DT1 = 0;
-    DT2 = 0;
-    assert(false, "StaticWaterWaterExchanger: incorrect exchanger type");
-  end if;
-
-  DT12 = if noEvent(abs(DT2) > Modelica.Constants.eps) then DT1/DT2 else 0;
-
-  /* Heat exchange area (for the plate heat exchanger) */
-  S = (nbp - 2)*Sp;
-  N = (nbp - 1)/2;
-
-  /* Heat exchange coefficients */
-  qmc = noEvent(abs(Qc)/(muc*N));
-  qmf = noEvent(abs(Qf)/(muf*N));
-
-  if (heat_exchange_correlation == 0) then
-    hc = p_hc;
-    hf = p_hf;
-  elseif (heat_exchange_correlation == 1) then
-    hc = noEvent(if (qmc < 1.e-3) then 0 else 11.245*qmc^0.8*abs(muc*proc.cp/lambdac)^0.4*lambdac);
-    hf = noEvent(if (qmf < 1.e-3) then 0 else 11.245*qmf^0.8*abs(muf*prof.cp/lambdaf)^0.4*lambdaf);
-  else
-    hc = 0;
-    hf = 0;
-    assert(false, "StaticWaterWaterExchanger: incorrect heat exchange correlation number");
-  end if;
-
-  /* Pressure losses */
-  quc = noEvent(abs(Qc)/N);
-  quf = noEvent(abs(Qf)/N);
-
-  if (pressure_loss_correlation == 0) then
-    DPc = p_Kc*Qc^2/rhoc;
-    DPf = p_Kf*Qf^2/rhof;
-  elseif (pressure_loss_correlation == 1) then
-    DPc = noEvent(if (qmc < 1.e-3) then 0 else c1*14423.2/rhoc*qmc^(-0.097)*quc^2*(1472.47 + 1.54*(N - 1)/2 + 104.97*qmc^(-0.25)));
-    DPf = noEvent(if (qmf < 1.e-3) then 0 else 14423.2/rhof*qmf^(-0.097)*quf^2*(1472.47 + 1.54*(N - 1)/2 + 104.97*qmf^(-0.25)));
-  else
-    DPc = 0;
-    DPf = 0;
-    assert(false,
-      "StaticWaterWaterExchanger: incorrect pressure loss correlation number");
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pmc = (Ec.P + Sc.P)/2;
-  Pmf = (Ef.P + Sf.P)/2;
-  Hmc = (Ec.h + Sc.h)/2;
-  Hmf = (Ef.h + Sf.h)/2;
-
-  proc = ThermoSysPro.Properties.Fluid.Ph(Pmc, Hmc, mode_c, fluid_c);
-  prof = ThermoSysPro.Properties.Fluid.Ph(Pmf, Hmf, mode_f, fluid_f);
-
-  Tmc = proc.T;
-  Tmf = prof.T;
-
-  if (p_rhoc > 0) then
-    rhoc = p_rhoc;
-  else
-    rhoc = proc.d;
-  end if;
-
-  if (p_rhof > 0) then
-    rhof = p_rhof;
-  else
-    rhof = prof.d;
-  end if;
-
-  muc = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhoc, Tmc, fluid_c);
-  muf = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhof, Tmf, fluid_f);
-
-  lambdac = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhoc, Tmc, Pmc, 0, fluid_c);
-  lambdaf = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhof, Tmf, Pmf, 0, fluid_f);
-
-  /* Calcul des températures en entrée et en sortie de l'échangeur */
-  proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c);
-  procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_c, fluid_f);
-
-  profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_c);
-  profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-  Tef = profe.T;
-  Tsf = profs.T;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
-        Line(points={{-80,60},{-80,-60}}),
-        Line(points={{80,60},{80,-60}}),
-        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={
-              28,108,200}),
-        Text(
-          extent={{-126,24},{-106,14}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot inlet"),
-        Text(
-          extent={{-82,-66},{-62,-76}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold inlet"),
-        Text(
-          extent={{66,-66},{90,-76}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold outlet"),
-        Text(
-          extent={{104,24},{128,10}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot outlet")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={255,255,0}),
-        Line(points={{-80,60},{-80,-60}}),
-        Line(points={{80,60},{80,-60}}),
-        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={
-              28,108,200}),
-        Text(
-          extent={{-122,22},{-102,12}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot inlet"),
-        Text(
-          extent={{100,24},{124,10}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Hot outlet"),
-        Text(
-          extent={{-86,-66},{-62,-76}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold inlet"),
-        Text(
-          extent={{64,-66},{92,-80}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString="Cold outlet")}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.6.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end StaticPlateHeatExchanger;
+within ThermoSysPro.Fluid.HeatExchangers;
+model StaticPlateHeatExchanger "Static plate heat exchanger"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.ThermalConductivity lambdam=15.0
+    "Metal thermal conductivity";
+  parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000
+    "Heat transfer coefficient for the hot side if not computed by the correlations";
+  parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000
+    "Heat transfer coefficient for the cold side if not computed by the correlations";
+  parameter Real p_Kc=100 "Pressure loss coefficient for the hot side if not computed by the correlations";
+  parameter Real p_Kf=100 "Pressure loss coefficient for the cold side if not computed by the correlations";
+  parameter Units.SI.Thickness emetal=0.0006 "Wall thickness";
+  parameter Units.SI.Area Sp=2 "Plate area";
+  parameter Real nbp=499 "Number of plates";
+  parameter Real c1=1.12647 "Correction coefficient";
+  parameter Integer exchanger_type=1 "Exchanger type - 1: counter-current. 2: co-current";
+  parameter Integer heat_exchange_correlation=1 "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations";
+  parameter Integer pressure_loss_correlation=1 "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations";
+  parameter Units.SI.MassFlowRate gamma_diff_c=1e-4
+    "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.MassFlowRate gamma_diff_f=1e-4
+    "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot fluid"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold fluid"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Power W "Thermal power exchanged between the two sides";
+  ThermoSysPro.Units.SI.PressureDifference DPc
+    "Pressure loss of the hot fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPf
+    "Pressure loss of the cold fluid";
+  Units.SI.CoefficientOfHeatTransfer hc
+    "Heat transfer coefficient of the hot fluid";
+  Units.SI.CoefficientOfHeatTransfer hf
+    "Heat transfer coefficient of the cold fluid";
+  Units.SI.CoefficientOfHeatTransfer K "Global heat transfer coefficient";
+  Units.SI.Area S "Heat exchange surface";
+  Units.SI.Temperature Tec "Fluid temperature at the hot inlet";
+  Units.SI.Temperature Tsc "Fluid temperature at the hot outlet";
+  Units.SI.Temperature Tef "Fluid temperature at the cold inlet";
+  Units.SI.Temperature Tsf "Fluid temperature at the cold outlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DTm
+    "Difference in average temperature";
+  ThermoSysPro.Units.SI.TemperatureDifference DT1
+    "Temperature difference at the inlet of the exchanger";
+  ThermoSysPro.Units.SI.TemperatureDifference DT2
+    "Temperature difference at the outlet of the exchanger";
+  Real DT12 "DT1/DT2 (s.u.)";
+  Units.SI.MassFlowRate Qc(start=500) "Mass flow rate of the hot fluid";
+  Units.SI.MassFlowRate Qf(start=500) "Mass flow rate of the cold fluid";
+  Real qmc;
+  Real qmf;
+  Real quc;
+  Real quf;
+  Real N;
+  Units.SI.Density rhoc(start=998) "Hot fluid density";
+  Units.SI.Density rhof(start=998) "Cold fluid density";
+  Units.SI.DynamicViscosity muc(start=1.e-3) "Hot fluid dynamic viscosity";
+  Units.SI.DynamicViscosity muf(start=1.e-3) "Cold fluid dynamic viscosity";
+  Units.SI.ThermalConductivity lambdac(start=0.602698)
+    "Hot fluid thermal conductivity";
+  Units.SI.ThermalConductivity lambdaf(start=0.597928)
+    "Cold fluid thermal conductivity";
+  Units.SI.Temperature Tmc(start=290) "Hot fluid average temperature";
+  Units.SI.Temperature Tmf(start=290) "Cold fluid average temperature";
+  Units.SI.AbsolutePressure Pmc(start=1.e5) "Hot fluid average pressure";
+  Units.SI.AbsolutePressure Pmf(start=1.e5) "Cold fluid average pressure";
+  Units.SI.SpecificEnthalpy Hmc(start=100000)
+    "Hot fluid average specific enthalpy";
+  Units.SI.SpecificEnthalpy Hmf(start=100000)
+    "Cold fluid average specific enthalpy";
+  FluidType ftype_c "Fluid type for the hot fluid";
+  Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid";
+  FluidType ftype_f "Fluid type for the cold fluid";
+  Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid";
+
+public
+  Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation(
+          extent={{-60,-70},{-40,-50}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation(
+          extent={{40,-70},{60,-50}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation(
+          extent={{90,-8},{110,12}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    annotation (Placement(transformation(extent={{-20,-100},{0,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prof
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+equation
+
+  /* Mass flow rates */
+  Ec.Q = Sc.Q;
+
+  Ec.h_vol_1 = Sc.h_vol_1;
+  Ec.h_vol_2 = Sc.h_vol_2;
+
+  Sc.diff_on_1 = Ec.diff_on_1;
+  Ec.diff_on_2 = Sc.diff_on_2;
+
+  Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c;
+  Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c;
+
+  Ec.ftype = Sc.ftype;
+
+  Ec.Xco2 = Sc.Xco2;
+  Ec.Xh2o = Sc.Xh2o;
+  Ec.Xo2  = Sc.Xo2;
+  Ec.Xso2 = Sc.Xso2;
+
+  ftype_c = Ec.ftype;
+
+  Ef.Q = Sf.Q;
+
+  Ef.h_vol_1 = Sf.h_vol_1;
+  Ef.h_vol_2 = Sf.h_vol_2;
+
+  Sf.diff_on_1 = Ef.diff_on_1;
+  Ef.diff_on_2 = Sf.diff_on_2;
+
+  Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f;
+  Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f;
+
+  Ef.ftype = Sf.ftype;
+
+  Ef.Xco2 = Sf.Xco2;
+  Ef.Xh2o = Sf.Xh2o;
+  Ef.Xo2  = Sf.Xo2;
+  Ef.Xso2 = Sf.Xso2;
+
+  ftype_f = Ef.ftype;
+
+  Qc = Ec.Q;
+  Qf = Ef.Q;
+
+  /* Pressures */
+  Sc.P = if Qc > 0 then Ec.P - DPc else Ec.P + DPc;
+  Sf.P = if Qf > 0 then Ef.P - DPf else Ef.P + DPf;
+
+  /* Heat exchanges between the hot and cold fluids */
+  K = hc*hf/(hc + hf + hc*hf*emetal/lambdam);
+  W = K*S*DTm;
+
+  if (abs(Qc) > 1.e-3) then
+    W = Qc*proc.cp*(Tec - Tsc);
+  else
+    Tec = Tsc;
+  end if;
+
+  if (abs(Qf) > 1.e-3) then
+    W = Qf*prof.cp*(Tsf - Tef);
+  else
+    Tef = Tsf;
+  end if;
+
+  /* Difference in average temperatures */
+  if noEvent(((DT1 > DT2) and (DT2 > 0)) or ((DT1 < DT2) and (DT2 < 0))) then
+    DTm = (DT1 - DT2)/Modelica.Math.log(DT1/DT2);
+  else
+    DTm = (DT1 + DT2)/2;
+  end if;
+
+  if (exchanger_type == 1) then
+    /* Counter-current heat exchanger */
+    DT1 = Tec - Tsf;
+    DT2 = Tsc - Tef;
+  elseif (exchanger_type == 2) then
+    /* Co-current heat exchanger */
+    DT1 = Tec - Tef;
+    DT2 = Tsc - Tsf;
+  else
+    DT1 = 0;
+    DT2 = 0;
+    assert(false, "StaticWaterWaterExchanger: incorrect exchanger type");
+  end if;
+
+  DT12 = if noEvent(abs(DT2) > Modelica.Constants.eps) then DT1/DT2 else 0;
+
+  /* Heat exchange area (for the plate heat exchanger) */
+  S = (nbp - 2)*Sp;
+  N = (nbp - 1)/2;
+
+  /* Heat exchange coefficients */
+  qmc = noEvent(abs(Qc)/(muc*N));
+  qmf = noEvent(abs(Qf)/(muf*N));
+
+  if (heat_exchange_correlation == 0) then
+    hc = p_hc;
+    hf = p_hf;
+  elseif (heat_exchange_correlation == 1) then
+    hc = noEvent(if (qmc < 1.e-3) then 0 else 11.245*qmc^0.8*abs(muc*proc.cp/lambdac)^0.4*lambdac);
+    hf = noEvent(if (qmf < 1.e-3) then 0 else 11.245*qmf^0.8*abs(muf*prof.cp/lambdaf)^0.4*lambdaf);
+  else
+    hc = 0;
+    hf = 0;
+    assert(false, "StaticWaterWaterExchanger: incorrect heat exchange correlation number");
+  end if;
+
+  /* Pressure losses */
+  quc = noEvent(abs(Qc)/N);
+  quf = noEvent(abs(Qf)/N);
+
+  if (pressure_loss_correlation == 0) then
+    DPc = p_Kc*Qc^2/rhoc;
+    DPf = p_Kf*Qf^2/rhof;
+  elseif (pressure_loss_correlation == 1) then
+    DPc = noEvent(if (qmc < 1.e-3) then 0 else c1*14423.2/rhoc*qmc^(-0.097)*quc^2*(1472.47 + 1.54*(N - 1)/2 + 104.97*qmc^(-0.25)));
+    DPf = noEvent(if (qmf < 1.e-3) then 0 else 14423.2/rhof*qmf^(-0.097)*quf^2*(1472.47 + 1.54*(N - 1)/2 + 104.97*qmf^(-0.25)));
+  else
+    DPc = 0;
+    DPf = 0;
+    assert(false,
+      "StaticWaterWaterExchanger: incorrect pressure loss correlation number");
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pmc = (Ec.P + Sc.P)/2;
+  Pmf = (Ef.P + Sf.P)/2;
+  Hmc = (Ec.h + Sc.h)/2;
+  Hmf = (Ef.h + Sf.h)/2;
+
+  proc = ThermoSysPro.Properties.Fluid.Ph(Pmc, Hmc, mode_c, fluid_c);
+  prof = ThermoSysPro.Properties.Fluid.Ph(Pmf, Hmf, mode_f, fluid_f);
+
+  Tmc = proc.T;
+  Tmf = prof.T;
+
+  if (p_rhoc > 0) then
+    rhoc = p_rhoc;
+  else
+    rhoc = proc.d;
+  end if;
+
+  if (p_rhof > 0) then
+    rhof = p_rhof;
+  else
+    rhof = prof.d;
+  end if;
+
+  muc = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhoc, Tmc, fluid_c);
+  muf = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhof, Tmf, fluid_f);
+
+  lambdac = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhoc, Tmc, Pmc, 0, fluid_c);
+  lambdaf = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhof, Tmf, Pmf, 0, fluid_f);
+
+  /* Calcul des températures en entrée et en sortie de l'échangeur */
+  proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c);
+  procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_c, fluid_f);
+
+  profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_c);
+  profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+  Tef = profe.T;
+  Tsf = profs.T;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({255,255,0}, fill_color_static)),
+        Line(points={{-80,60},{-80,-60}}),
+        Line(points={{80,60},{80,-60}}),
+        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={
+              28,108,200}),
+        Text(
+          extent={{-126,24},{-106,14}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot inlet"),
+        Text(
+          extent={{-82,-66},{-62,-76}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold inlet"),
+        Text(
+          extent={{66,-66},{90,-76}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold outlet"),
+        Text(
+          extent={{104,24},{128,10}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot outlet")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={255,255,0}),
+        Line(points={{-80,60},{-80,-60}}),
+        Line(points={{80,60},{80,-60}}),
+        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={
+              28,108,200}),
+        Text(
+          extent={{-122,22},{-102,12}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot inlet"),
+        Text(
+          extent={{100,24},{124,10}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Hot outlet"),
+        Text(
+          extent={{-86,-66},{-62,-76}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold inlet"),
+        Text(
+          extent={{64,-66},{92,-80}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString="Cold outlet")}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.6.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end StaticPlateHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo
index 9d03e28fbe84e9152e8f754e5df4315d63f1b5e2..4aeb5935661c2734f1162fe697834c69f20cd4e1 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo
@@ -1,337 +1,337 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model StaticWallFlueGasesExchanger "Static wall - flue gases exchanger"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Integer Ns=10 "Number of segments";
-  parameter Integer NbTub=100 "Number of pipes";
-  parameter Real DPc=0 "Pressure loss coefficient";
-  parameter Units.SI.Length L=2 "Exchanger length";
-  parameter Units.SI.Diameter Dext=0.022 "External pipe diameter";
-  parameter Units.SI.PathLength step_L=0.033 "Longitudinal length step";
-  parameter Units.SI.PathLength step_T=0.066 "Transverse length step";
-  parameter Units.SI.Area St=100 "Cross-sectional area";
-  parameter Units.SI.Area Surf_ext=pi*Dext*Ls*NbTub*CSailettes
-    "Heat exchange surface for one section";
-  parameter Real Encras=1.00 "Corrective term for the heat exchange coefficient";
-  parameter Real Fa=0.7 "Fouling factor (0.3 - 1.1)";
-  parameter Units.SI.MassFlowRate Qmin=1e-3 "Minimum flue gases mass flow rate";
-  parameter Integer exchanger_type=1 "Exchanger type - 1:crossed flux - 2:longitudinal flux";
-  parameter Units.SI.Temperature Tp0=500
-    "Wall temperature (active if the thermal connector is not connected)";
-  parameter Real CSailettes=1 "Increase factor of the heat exchange surface to to the fins";
-  parameter Real Coeff=1 "Corrective coeffeicient";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Real Mco2=44.009 "CO2 molar mass";
-  constant Real Mh2o=18.0148 "H2O molar mass";
-  constant Real Mo2=31.998 "O2 molar mass";
-  constant Real Mn2=28.014 "N2 molar mass";
-  constant Real Mso2=64.063 "SO2 molar mass";
-  constant Real pi=Modelica.Constants.pi;
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.PathLength Ls=L/Ns "Section length";
-  parameter Units.SI.Area Surf_tot=Ns*Surf_ext "Total heat exchange surface";
-  parameter Units.SI.Area Sgaz=St*(1 - Dext/step_T) "Geometrical parameter";
-  parameter Real PasLD=step_L/Dext "Geometrical parameter";
-  parameter Real PasTD=step_T/Dext "Geometrical parameter";
-  parameter Real Optl=ThermoSysPro.Correlations.Misc.WBCorrectiveDiameterCoefficient(PasTD,PasLD,Dext) "Geometrical parameter";
-  parameter Units.SI.Length Deq=4*Sgaz/Perb
-    "Equivalent diameter for longitudinal flux";
-  parameter Units.SI.Length Perb=Surf_ext/Ls "Geometrical parameter";
-  parameter Units.SI.CoefficientOfHeatTransfer Kdef=50
-    "Heat exchange coefficient in case of zero flow";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
-  parameter Real eps=1.e-1 "Small number for the computation of the pressure losses";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Temperature Tp[N - 1](start=fill(500, N - 1))
-    "Wall temperature in thermal node i";
-  Units.SI.AbsolutePressure Pco2[N - 1]
-    "CO2 partial pressure in thermal node i";
-  Units.SI.AbsolutePressure Ph2o[N - 1]
-    "H2O partial pressure in thermal node i";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xn2 "N2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xvh2o "H2O volume fraction";
-  ThermoSysPro.Units.SI.MassFraction Xvco2 "CO2 volume fraction";
-  ThermoSysPro.Units.SI.MassFraction Xvo2 "O2 volume fraction";
-  ThermoSysPro.Units.SI.MassFraction Xvn2 "N2 volume fraction";
-  ThermoSysPro.Units.SI.MassFraction Xvso2 "SO2 volume fraction";
-  Units.SI.CoefficientOfHeatTransfer K(start=0)
-    "Total heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer Kc(start=0)
-    "Convective heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer Kr(start=0)
-    "Radiative heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer Kcc[N - 1](start=fill(0, N - 1))
-    "Intermediate variable for the computation of the convective heat exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer Krr[N - 1](start=fill(0, N - 1))
-    "Intermediate variable for the computation of the radiative heat exchange coefficient";
-  Units.SI.Power dW1[N - 1](start=fill(0, N - 1))
-    "Power exchange between the wall and the fluid in each thermal node";
-  Units.SI.Power W(start=0) "Total power exchanged";
-  ThermoSysPro.Units.SI.TemperatureDifference deltaT[N - 1](start=fill(50, N
-         - 1)) "Temperature difference between the fluid and the wall";
-  Units.SI.Temperature TFilm[N - 1] "Film temperature";
-  Real Mmt "Total flue gases molar mass";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-  Real diff_res[N] "Diffusion resistance in hydraulic node i";
-  Real diff_res_t "Total diffusion resistance in the pipe";
-  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
-  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
-  Units.SI.MassFlowRate gamma[N]
-    "Total diffusion conductance in hydraulic node i";
-  Units.SI.MassFlowRate gamma_e[N - 1]
-    "Diffusion conductance at inlet of thermal node i";
-  Units.SI.MassFlowRate gamma_s[N - 1]
-    "Diffusion conductance at outlet of thermal node i";
-  Units.SI.Power Je[N - 1]
-    "Thermal power diffusion from inlet of thermal node i";
-  Units.SI.Power Js[N - 1]
-    "Thermal power diffusion from outlet of thermal node i";
-  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
-  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
-  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
-
-public
-  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  /* Check that the fluid type is flue gases */
-  assert(ftype == FluidType.FlueGases, "StaticWallFlueGasesExchanger: the fluid type must be flue gases");
-
-  /* Wall boundary */
-  CTh.W = -dW1;
-  CTh.T = Tp;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol_1;
-  h[N + 1] = C2.h_vol_2;
-
-  C1.h_vol_2 = h[2];
-  C2.h_vol_1 = h[N];
-
-  C2.diff_on_1 = diffusion;
-  C1.diff_on_2 = diffusion;
-
-  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
-  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2 = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  ftype = C1.ftype;
-
-  Xh2o = C1.Xh2o;
-  Xco2 = C1.Xco2;
-  Xo2 = C1.Xo2;
-  Xso2 = C1.Xso2;
-  Xn2 = 1 - C1.Xco2 - C1.Xh2o - C1.Xo2 - C1.Xso2;
-
-  /* Volume fractions */
-  Xvco2 = (Xco2/Mco2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
-  Xvh2o = (Xh2o/Mh2o)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
-  Xvo2 = (Xo2/Mo2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
-  Xvn2 = (Xn2/Mn2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
-  Xvso2 = (Xso2/Mso2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
-
-  /* Total molar mass */
-  Mmt = Xvco2*Mco2 + Xvh2o*Mh2o + Xvo2*Mo2 + Xvn2*Mn2 + Xvso2*Mso2;
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-    0 = Q[i] - Q[i + 1];
-
-    /* Energy balance equation */
-    0 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] - dW1[i] + J[i];
-
-    /* Temperature difference between the fluid and the wall */
-    deltaT[i] = T1[i] - Tp[i];
-
-    /* Partial gas pressures */
-    Ph2o[i] = P[i + 1]*Xh2o*Mmt/Mh2o;
-    Pco2[i] = P[i + 1]*Xco2*Mmt/Mco2;
-
-    if (abs(Q[i]) >= Qmin) then
-      /* Convective heat exchange coefficient */
-      if (exchanger_type == 1) then
-        /* Crossed flux */
-        Kcc[i] = ThermoSysPro.Correlations.Thermal.WBCrossedCurrentConvectiveHeatTransferCoefficient(TFilm[i], abs(Q[i]), Xh2o*100, Sgaz, Dext, Fa);
-      else
-        /* Longitudinal flux */
-        Kcc[i] = ThermoSysPro.Correlations.Thermal.WBLongitudinalCurrentConvectiveHeatTransferCoefficient(TFilm[i], T1[i], abs(Q[i]), Xh2o*100, Sgaz, Deq);
-      end if;
-
-      /* Radiative heat exchange coefficient */
-      Krr[i] = ThermoSysPro.Correlations.Thermal.WBRadiativeHeatTransferCoefficient(deltaT[i], Tp[i], Ph2o[i]/P[i + 1], Pco2[i]/P[i + 1], Optl);
-    else
-      Krr[i] = 0;
-      Kcc[i] = 0;
-    end if;
-
-    /* Film temperature */
-    TFilm[i] = (T1[i] + Tp[i])/2;
-
-    /* Power exchanged for each section */
-    dW1[i] = Coeff*K*(T1[i] - Tp[i])*Surf_ext;
-
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
-    else
-      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
-    end if;
-
-    /* Diffusion power */
-    if diffusion then
-      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
-      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
-
-      gamma_e[i] = 1/diff_res_e[i];
-      gamma_s[i] = 1/diff_res_s[i];
-
-      if i == 1 then
-        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
-        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
-     else
-        diff_res_e[i] = diff_res[i];
-        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
-      end if;
-
-      if i == N - 1 then
-        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
-        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
-      else
-        diff_res_s[i] = diff_res[i + 1];
-        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
-      end if;
-    else
-      diff_res_e[i] = 1/gamma0;
-      diff_res_s[i] = 1/gamma0;
-
-      re[i] = 0;
-      rs[i] = 0;
-
-      gamma_e[i] = gamma0;
-      gamma_s[i] = gamma0;
-
-      Je[i] = 0;
-      Js[i] = 0;
-    end if;
-
-    J[i] = Je[i] + Js[i];
-
-    /* Fluid thermodynamic properties */
-    T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, 0, Xco2, Xh2o, Xo2, Xso2);
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Pressure losses */
-    P[i] - P[i + 1] = DPc/N*ThermoSysPro.Functions.ThermoSquare(Q[i],eps)/rho2[i];
-
-    /* Diffusion resistance */
-    diff_res[i] = 1/gamma_diff/N;
-    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
-
-    /* Fluid thermodynamic properties */
-    if (p_rho > 0) then
-      rho2[i] = p_rho;
-    else
-      rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, 0, Xco2, Xh2o, Xo2, Xso2);
-    end if;
-
-    T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, 0, Xco2, Xh2o, Xo2, Xso2);
-  end for;
-
-  /* Total heat exchange coefficient ??? */
-  0 = noEvent(if (abs(Q[1]) >= Qmin) then K - (Kc + Kr)*Encras else K - Kdef);
-
-  /* Convective and radiative heat exchange coefficients */
-  Kc = sum(Kcc)*Surf_ext/Surf_tot;
-  Kr = sum(Krr)*Surf_ext/Surf_tot;
-
-  /* Total power exchanged */
-  W = sum(dW1);
-
-  /* Total fluid diffusion resistance */
-  diff_res_t = sum(diff_res);
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-                           Icon(graphics={
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Backward),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end StaticWallFlueGasesExchanger;
+within ThermoSysPro.Fluid.HeatExchangers;
+model StaticWallFlueGasesExchanger "Static wall - flue gases exchanger"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Integer Ns=10 "Number of segments";
+  parameter Integer NbTub=100 "Number of pipes";
+  parameter Real DPc=0 "Pressure loss coefficient";
+  parameter Units.SI.Length L=2 "Exchanger length";
+  parameter Units.SI.Diameter Dext=0.022 "External pipe diameter";
+  parameter Units.SI.PathLength step_L=0.033 "Longitudinal length step";
+  parameter Units.SI.PathLength step_T=0.066 "Transverse length step";
+  parameter Units.SI.Area St=100 "Cross-sectional area";
+  parameter Units.SI.Area Surf_ext=pi*Dext*Ls*NbTub*CSailettes
+    "Heat exchange surface for one section";
+  parameter Real Encras=1.00 "Corrective term for the heat exchange coefficient";
+  parameter Real Fa=0.7 "Fouling factor (0.3 - 1.1)";
+  parameter Units.SI.MassFlowRate Qmin=1e-3 "Minimum flue gases mass flow rate";
+  parameter Integer exchanger_type=1 "Exchanger type - 1:crossed flux - 2:longitudinal flux";
+  parameter Units.SI.Temperature Tp0=500
+    "Wall temperature (active if the thermal connector is not connected)";
+  parameter Real CSailettes=1 "Increase factor of the heat exchange surface to to the fins";
+  parameter Real Coeff=1 "Corrective coeffeicient";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Real Mco2=44.009 "CO2 molar mass";
+  constant Real Mh2o=18.0148 "H2O molar mass";
+  constant Real Mo2=31.998 "O2 molar mass";
+  constant Real Mn2=28.014 "N2 molar mass";
+  constant Real Mso2=64.063 "SO2 molar mass";
+  constant Real pi=Modelica.Constants.pi;
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.PathLength Ls=L/Ns "Section length";
+  parameter Units.SI.Area Surf_tot=Ns*Surf_ext "Total heat exchange surface";
+  parameter Units.SI.Area Sgaz=St*(1 - Dext/step_T) "Geometrical parameter";
+  parameter Real PasLD=step_L/Dext "Geometrical parameter";
+  parameter Real PasTD=step_T/Dext "Geometrical parameter";
+  parameter Real Optl=ThermoSysPro.Correlations.Misc.WBCorrectiveDiameterCoefficient(PasTD,PasLD,Dext) "Geometrical parameter";
+  parameter Units.SI.Length Deq=4*Sgaz/Perb
+    "Equivalent diameter for longitudinal flux";
+  parameter Units.SI.Length Perb=Surf_ext/Ls "Geometrical parameter";
+  parameter Units.SI.CoefficientOfHeatTransfer Kdef=50
+    "Heat exchange coefficient in case of zero flow";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)";
+  parameter Real eps=1.e-1 "Small number for the computation of the pressure losses";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Temperature Tp[N - 1](start=fill(500, N - 1))
+    "Wall temperature in thermal node i";
+  Units.SI.AbsolutePressure Pco2[N - 1]
+    "CO2 partial pressure in thermal node i";
+  Units.SI.AbsolutePressure Ph2o[N - 1]
+    "H2O partial pressure in thermal node i";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xn2 "N2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xvh2o "H2O volume fraction";
+  ThermoSysPro.Units.SI.MassFraction Xvco2 "CO2 volume fraction";
+  ThermoSysPro.Units.SI.MassFraction Xvo2 "O2 volume fraction";
+  ThermoSysPro.Units.SI.MassFraction Xvn2 "N2 volume fraction";
+  ThermoSysPro.Units.SI.MassFraction Xvso2 "SO2 volume fraction";
+  Units.SI.CoefficientOfHeatTransfer K(start=0)
+    "Total heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer Kc(start=0)
+    "Convective heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer Kr(start=0)
+    "Radiative heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer Kcc[N - 1](start=fill(0, N - 1))
+    "Intermediate variable for the computation of the convective heat exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer Krr[N - 1](start=fill(0, N - 1))
+    "Intermediate variable for the computation of the radiative heat exchange coefficient";
+  Units.SI.Power dW1[N - 1](start=fill(0, N - 1))
+    "Power exchange between the wall and the fluid in each thermal node";
+  Units.SI.Power W(start=0) "Total power exchanged";
+  ThermoSysPro.Units.SI.TemperatureDifference deltaT[N - 1](start=fill(50, N
+         - 1)) "Temperature difference between the fluid and the wall";
+  Units.SI.Temperature TFilm[N - 1] "Film temperature";
+  Real Mmt "Total flue gases molar mass";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+  Real diff_res[N] "Diffusion resistance in hydraulic node i";
+  Real diff_res_t "Total diffusion resistance in the pipe";
+  Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i";
+  Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i";
+  Units.SI.MassFlowRate gamma[N]
+    "Total diffusion conductance in hydraulic node i";
+  Units.SI.MassFlowRate gamma_e[N - 1]
+    "Diffusion conductance at inlet of thermal node i";
+  Units.SI.MassFlowRate gamma_s[N - 1]
+    "Diffusion conductance at outlet of thermal node i";
+  Units.SI.Power Je[N - 1]
+    "Thermal power diffusion from inlet of thermal node i";
+  Units.SI.Power Js[N - 1]
+    "Thermal power diffusion from outlet of thermal node i";
+  Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i";
+  Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i";
+  Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i";
+
+public
+  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  /* Check that the fluid type is flue gases */
+  assert(ftype == FluidType.FlueGases, "StaticWallFlueGasesExchanger: the fluid type must be flue gases");
+
+  /* Wall boundary */
+  CTh.W = -dW1;
+  CTh.T = Tp;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol_1;
+  h[N + 1] = C2.h_vol_2;
+
+  C1.h_vol_2 = h[2];
+  C2.h_vol_1 = h[N];
+
+  C2.diff_on_1 = diffusion;
+  C1.diff_on_2 = diffusion;
+
+  C2.diff_res_1 = C1.diff_res_1 + diff_res_t;
+  C1.diff_res_2 = C2.diff_res_2 + diff_res_t;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2 = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  ftype = C1.ftype;
+
+  Xh2o = C1.Xh2o;
+  Xco2 = C1.Xco2;
+  Xo2 = C1.Xo2;
+  Xso2 = C1.Xso2;
+  Xn2 = 1 - C1.Xco2 - C1.Xh2o - C1.Xo2 - C1.Xso2;
+
+  /* Volume fractions */
+  Xvco2 = (Xco2/Mco2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
+  Xvh2o = (Xh2o/Mh2o)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
+  Xvo2 = (Xo2/Mo2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
+  Xvn2 = (Xn2/Mn2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
+  Xvso2 = (Xso2/Mso2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2);
+
+  /* Total molar mass */
+  Mmt = Xvco2*Mco2 + Xvh2o*Mh2o + Xvo2*Mo2 + Xvn2*Mn2 + Xvso2*Mso2;
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+    0 = Q[i] - Q[i + 1];
+
+    /* Energy balance equation */
+    0 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] - dW1[i] + J[i];
+
+    /* Temperature difference between the fluid and the wall */
+    deltaT[i] = T1[i] - Tp[i];
+
+    /* Partial gas pressures */
+    Ph2o[i] = P[i + 1]*Xh2o*Mmt/Mh2o;
+    Pco2[i] = P[i + 1]*Xco2*Mmt/Mco2;
+
+    if (abs(Q[i]) >= Qmin) then
+      /* Convective heat exchange coefficient */
+      if (exchanger_type == 1) then
+        /* Crossed flux */
+        Kcc[i] = ThermoSysPro.Correlations.Thermal.WBCrossedCurrentConvectiveHeatTransferCoefficient(TFilm[i], abs(Q[i]), Xh2o*100, Sgaz, Dext, Fa);
+      else
+        /* Longitudinal flux */
+        Kcc[i] = ThermoSysPro.Correlations.Thermal.WBLongitudinalCurrentConvectiveHeatTransferCoefficient(TFilm[i], T1[i], abs(Q[i]), Xh2o*100, Sgaz, Deq);
+      end if;
+
+      /* Radiative heat exchange coefficient */
+      Krr[i] = ThermoSysPro.Correlations.Thermal.WBRadiativeHeatTransferCoefficient(deltaT[i], Tp[i], Ph2o[i]/P[i + 1], Pco2[i]/P[i + 1], Optl);
+    else
+      Krr[i] = 0;
+      Kcc[i] = 0;
+    end if;
+
+    /* Film temperature */
+    TFilm[i] = (T1[i] + Tp[i])/2;
+
+    /* Power exchanged for each section */
+    dW1[i] = Coeff*K*(T1[i] - Tp[i])*Surf_ext;
+
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1);
+    else
+      hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2];
+    end if;
+
+    /* Diffusion power */
+    if diffusion then
+      re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2);
+      rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2);
+
+      gamma_e[i] = 1/diff_res_e[i];
+      gamma_s[i] = 1/diff_res_s[i];
+
+      if i == 1 then
+        diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i];
+        Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0;
+     else
+        diff_res_e[i] = diff_res[i];
+        Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]);
+      end if;
+
+      if i == N - 1 then
+        diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1];
+        Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0;
+      else
+        diff_res_s[i] = diff_res[i + 1];
+        Js[i] = rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]);
+      end if;
+    else
+      diff_res_e[i] = 1/gamma0;
+      diff_res_s[i] = 1/gamma0;
+
+      re[i] = 0;
+      rs[i] = 0;
+
+      gamma_e[i] = gamma0;
+      gamma_s[i] = gamma0;
+
+      Je[i] = 0;
+      Js[i] = 0;
+    end if;
+
+    J[i] = Je[i] + Js[i];
+
+    /* Fluid thermodynamic properties */
+    T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, 0, Xco2, Xh2o, Xo2, Xso2);
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Pressure losses */
+    P[i] - P[i + 1] = DPc/N*ThermoSysPro.Functions.ThermoSquare(Q[i],eps)/rho2[i];
+
+    /* Diffusion resistance */
+    diff_res[i] = 1/gamma_diff/N;
+    gamma[i] = if diffusion then 1/diff_res[i] else gamma0;
+
+    /* Fluid thermodynamic properties */
+    if (p_rho > 0) then
+      rho2[i] = p_rho;
+    else
+      rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, 0, Xco2, Xh2o, Xo2, Xso2);
+    end if;
+
+    T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, 0, Xco2, Xh2o, Xo2, Xso2);
+  end for;
+
+  /* Total heat exchange coefficient ??? */
+  0 = noEvent(if (abs(Q[1]) >= Qmin) then K - (Kc + Kr)*Encras else K - Kdef);
+
+  /* Convective and radiative heat exchange coefficients */
+  Kc = sum(Kcc)*Surf_ext/Surf_tot;
+  Kr = sum(Krr)*Surf_ext/Surf_tot;
+
+  /* Total power exchanged */
+  W = sum(dW1);
+
+  /* Total fluid diffusion resistance */
+  diff_res_t = sum(diff_res);
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+                           Icon(graphics={
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Backward),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end StaticWallFlueGasesExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo
index 9234429aa8fcb8cd40b76f942fa69988665e8632..2d6eedf0aeb7720debdbbfa6eaa2bdd9eeda945f 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo
@@ -1,401 +1,401 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model SteamGenerator_1SG "Single steam generator"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real H0_Mix_AlimDomeGV=1194812.89980521;
-  parameter Boolean inertia=false
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.1 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0=50.e5
-    "Fluid initial pressure in the drum (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean option_temperature=false
-    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-public
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg(
-    L=10.848,
-    D=0.01687,
-    z2=10.848,
-    h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393,
-          1346263.00297153,1326153.46646787,1326153}),
-    Ns=5,
-    dpfCorr=0.17,
-    hcCorr=5,
-    ntubes=5340,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    inertia=inertia,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    option_temperature=option_temperature,
-    P(start={15548026.576998,15539261.540558,15513354.885726,15479081.11289,15444819.569988,
-          15410560.642776,15395560}),
-    Tp(start={564,562,560,559,568}))
-                 annotation (Placement(transformation(
-        origin={-67,-41.5},
-        extent={{30.5,-15},{-30.5,15}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg(
-    L=10.848,
-    D=0.01687,
-    h(start={1326153.46646787,1310848.36111251,1299218.76228131,
-          1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}),
-    Ns=5,
-    dpfCorr=0.17,
-    hcCorr=5,
-    z1=10.848,
-    ntubes=5340,
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    option_temperature=option_temperature,
-    P(start={15393431.104025,15393244.26355,15392971.944187,15392877.066005,15392915.646752,
-          15393000.834432,15393020}),
-    Tp(start={584,580,575,571,568}))
-                 annotation (Placement(transformation(
-        origin={67,-41.5},
-        extent={{30.5,-14},{-30.5,14}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV(
-    hl(start=1257382.15477056),
-    hv(start=2771260.46625813),
-    cpp=500,
-    L=8.625,
-    Cd(P(start=67.9e5)),
-    zl(fixed=false, start=0.66),
-    R=4.2818979,
-    Mp=32000,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    Vf0=Vf0,
-    P0=P0,
-    wsftype=wsftype)
-              annotation (Placement(transformation(extent={{-22,64},{22,107}},
-          rotation=0)));
-protected
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
-    L=1,
-    D=0.95886,
-    lambda=0.03,
-    inertia=inertia)
-                 annotation (Placement(transformation(
-        origin={0,42},
-        extent={{-5,-10},{5,10}},
-        rotation=90)));
-public
-  ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV(
-    h0=H0_Mix_AlimDomeGV,
-    h(start=1194851.37111438),
-    V=0.01,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    dynamic_mass_balance=dynamic_mass_balance,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    ftype=ftype)                               " "
-    annotation (Placement(transformation(
-        origin={94,63},
-        extent={{-8,-8},{8,8}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
-      K=1e-4)
-    annotation (Placement(transformation(
-        origin={94,88},
-        extent={{-6,-7},{6,7}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
-    p_rho=0,
-    C2(P(start=6829391.22090726), Q(fixed=false, start=6643)),
-    K=0.172144)                   annotation (Placement(transformation(extent={{53,53},
-            {63,73}},          rotation=0)));
-
-public
-  ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim
-    annotation (Placement(transformation(
-        origin={99,26},
-        extent={{-6,-6},{6,6}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI
-    annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet annotation (
-      Placement(transformation(extent={{42,102},{62,122}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1 annotation (
-      Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1
-    annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
-    annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
-            0)));
-public
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV(
-    p_rho=0,
-    h(start=1194851.3),
-    z1=10.8,
-    C1(
-      h_vol_1(start=1.1733e6),
-      h(start=1.1733e6),
-      Q(start=7525.84),
-      P(start=6829391.22090726)),
-    L=10.8,
-    D=0.216,
-    C2(
-      h_vol_1(start=1.1733e6),
-      Q(start=7525.84),
-      h(start=1.1733e6),
-      P(fixed=false, start=68.4935e5)),
-    lambda=0.08,
-    ntubes=32,
-    Q(start=7525.84/4),
-    inertia=inertia)           "DownComerGV" annotation (Placement(transformation(
-        origin={94.5,-41},
-        extent={{-31,16.5},{31,-16.5}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    L=10.848,
-    D=0.01687,
-    e=2.18e-3,
-    lambda=23,
-    cpw=503,
-    rhow=8430,
-    Ns=5,
-    ntubes=5340,
-    dynamic_energy_balance=dynamic_energy_balance,
-    Tp(start={571,568,566,564,562}))
-                  annotation (Placement(transformation(
-        origin={-44,-41},
-        extent={{-33,-16},{33,16}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
-    L=10.848,
-    D=0.01687,
-    e=2.18e-3,
-    lambda=23,
-    cpw=503,
-    rhow=8430,
-    Ns=5,
-    ntubes=5340,
-    dynamic_energy_balance=dynamic_energy_balance,
-    Tp(start={563,560,558,557,556}))
-                  annotation (Placement(transformation(
-        origin={44,-41},
-        extent={{-33,16},{33,-16}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV(
-    Ns=5,
-    h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846,
-          1525552.01981793,1595519.78942018,1595519.78863864}),
-    D=0.03689,
-    L=10.848,
-    z2=10.848,
-    hcCorr=5,
-    dpfCorr=1,
-    ntubes=5340,
-    Q(start={8600/4,8600/4,8600/4,8600/4,8600/4,8600/4}),
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    option_temperature=option_temperature,
-    P(start={6866734.6044951,6862203.9025063,6853535.2456408,6846247.0825137,6840314.8313501,
-          6834912.1497303,6828884.4924605}),
-    Tp1(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}),
-    Tp2(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}))
-                                                          annotation (Placement(
-        transformation(
-        origin={-2.5,-41},
-        extent={{-32,31.5},{32,-31.5}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.VolumeC volumeA(
-    h0=1185.2e3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    dynamic_mass_balance=dynamic_mass_balance,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    ftype=ftype,
-    P0=6849350)                annotation (Placement(transformation(
-        origin={1,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.Volumes.VolumeC volumeA1(
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    dynamic_mass_balance=dynamic_mass_balance,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    ftype=ftype)                                                                                                                   annotation (
-      Placement(transformation(
-        origin={0,18},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line(
-      points={{-67,-11},{-67,-2},{67,-2},{67,-11}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2)
-    annotation (Line(points={{94,71},{94,82}}, thickness=0.5));
-  connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line(
-      points={{63,63},{86,63}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line(
-      points={{94,55},{94.2,32}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(DPnulle_AlimDwnc.C1, fluidInlet)
-    annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}}));
-  connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line(
-      points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line(
-      points={{67,-72},{68,-78},{68,-122},{46,-122}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(CapteurPAlim.C2, DownComerGV.C1)      annotation (Line(
-      points={{94.2,19.88},{94.2,20},{94,20},{94,6},{94.5,6},{94.5,-10}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line(
-      points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}},
-      color={191,95,0},
-      thickness=0.5));
-  connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line(
-      points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}},
-      color={191,95,0},
-      thickness=0.5));
-  connect(DownComerGV.C2, volumeA.Ce1)      annotation (Line(points={{94.5,-72},
-          {94.5,-108},{1,-108},{1,-100}}, color={0,0,255}));
-  connect(volumeA.Cs, RiserGV.C1)
-                                annotation (Line(points={{1,-80},{0.65,-80},{
-          0.65,-73}}, color={0,0,255}));
-  connect(RiserGV.C2, volumeA1.Ce1)
-                                  annotation (Line(points={{0.65,-9},{
-          -6.12303e-016,-9},{-6.12303e-016,8}}, color={0,0,255}));
-  connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{
-          6.12303e-016,28},{-6.12303e-016,28},{-6.12303e-016,37}}, color={0,0,
-          255}));
-  connect(heatExchangerWall.WT2, RiserGV.CTh2)
-                                             annotation (Line(points={{-40.8,
-          -41},{-18.25,-41}}, color={191,95,0}));
-  connect(RiserGV.CTh1, heatExchangerWall1.WT2)
-                                              annotation (Line(points={{19.55,
-          -41},{40.8,-41}}, color={191,95,0}));
-  connect(DomeGV.Cv, fluidOutletI) annotation (Line(points={{22,107},{22,124},{
-          0,124},{0,149}}, color={255,0,0}));
-  connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{
-          6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255}));
-  connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{40,
-          76.9},{40,63},{53,63}},    color={0,0,255}));
-  connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,85.5},
-          {32,114},{-36,114},{-36,96},{-52,96}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-150,-150},{150,150}},
-        initialScale=0.1), graphics={Text(
-          extent={{55,81},{55,75}},
-          lineColor={0,0,255},
-          textString=
-               "petit DP"), Text(
-          extent={{-126,153},{-84,123}},
-          lineColor={0,0,255},
-          textString=
-               "= 1GV")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-150,-150},{150,150}},
-        initialScale=0.1), graphics={
-        Ellipse(
-          extent={{-42,150},{42,108}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={0,128,255}),
-        Rectangle(
-          extent={{-42,131},{42,80}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={0,128,255}),
-        Ellipse(
-          extent={{-36,-108},{36,-150}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={0,128,255}),
-        Rectangle(
-          extent={{-42,86},{42,56}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={170,213,255}),
-        Rectangle(
-          extent={{-36,42},{36,-128}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={170,213,255}),
-        Polygon(
-          points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={170,213,255})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end SteamGenerator_1SG;
+within ThermoSysPro.Fluid.HeatExchangers;
+model SteamGenerator_1SG "Single steam generator"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real H0_Mix_AlimDomeGV=1194812.89980521;
+  parameter Boolean inertia=false
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.1 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0=50.e5
+    "Fluid initial pressure in the drum (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean option_temperature=false
+    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+public
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg(
+    L=10.848,
+    D=0.01687,
+    z2=10.848,
+    h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393,
+          1346263.00297153,1326153.46646787,1326153}),
+    Ns=5,
+    dpfCorr=0.17,
+    hcCorr=5,
+    ntubes=5340,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    inertia=inertia,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    option_temperature=option_temperature,
+    P(start={15548026.576998,15539261.540558,15513354.885726,15479081.11289,15444819.569988,
+          15410560.642776,15395560}),
+    Tp(start={564,562,560,559,568}))
+                 annotation (Placement(transformation(
+        origin={-67,-41.5},
+        extent={{30.5,-15},{-30.5,15}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg(
+    L=10.848,
+    D=0.01687,
+    h(start={1326153.46646787,1310848.36111251,1299218.76228131,
+          1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}),
+    Ns=5,
+    dpfCorr=0.17,
+    hcCorr=5,
+    z1=10.848,
+    ntubes=5340,
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    option_temperature=option_temperature,
+    P(start={15393431.104025,15393244.26355,15392971.944187,15392877.066005,15392915.646752,
+          15393000.834432,15393020}),
+    Tp(start={584,580,575,571,568}))
+                 annotation (Placement(transformation(
+        origin={67,-41.5},
+        extent={{30.5,-14},{-30.5,14}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV(
+    hl(start=1257382.15477056),
+    hv(start=2771260.46625813),
+    cpp=500,
+    L=8.625,
+    Cd(P(start=67.9e5)),
+    zl(fixed=false, start=0.66),
+    R=4.2818979,
+    Mp=32000,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    Vf0=Vf0,
+    P0=P0,
+    wsftype=wsftype)
+              annotation (Placement(transformation(extent={{-22,64},{22,107}},
+          rotation=0)));
+protected
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
+    L=1,
+    D=0.95886,
+    lambda=0.03,
+    inertia=inertia)
+                 annotation (Placement(transformation(
+        origin={0,42},
+        extent={{-5,-10},{5,10}},
+        rotation=90)));
+public
+  ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV(
+    h0=H0_Mix_AlimDomeGV,
+    h(start=1194851.37111438),
+    V=0.01,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    dynamic_mass_balance=dynamic_mass_balance,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    ftype=ftype)                               " "
+    annotation (Placement(transformation(
+        origin={94,63},
+        extent={{-8,-8},{8,8}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
+      K=1e-4)
+    annotation (Placement(transformation(
+        origin={94,88},
+        extent={{-6,-7},{6,7}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
+    p_rho=0,
+    C2(P(start=6829391.22090726), Q(fixed=false, start=6643)),
+    K=0.172144)                   annotation (Placement(transformation(extent={{53,53},
+            {63,73}},          rotation=0)));
+
+public
+  ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim
+    annotation (Placement(transformation(
+        origin={99,26},
+        extent={{-6,-6},{6,6}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI
+    annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet annotation (
+      Placement(transformation(extent={{42,102},{62,122}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1 annotation (
+      Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1
+    annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
+    annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
+            0)));
+public
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV(
+    p_rho=0,
+    h(start=1194851.3),
+    z1=10.8,
+    C1(
+      h_vol_1(start=1.1733e6),
+      h(start=1.1733e6),
+      Q(start=7525.84),
+      P(start=6829391.22090726)),
+    L=10.8,
+    D=0.216,
+    C2(
+      h_vol_1(start=1.1733e6),
+      Q(start=7525.84),
+      h(start=1.1733e6),
+      P(fixed=false, start=68.4935e5)),
+    lambda=0.08,
+    ntubes=32,
+    Q(start=7525.84/4),
+    inertia=inertia)           "DownComerGV" annotation (Placement(transformation(
+        origin={94.5,-41},
+        extent={{-31,16.5},{31,-16.5}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    Ns=5,
+    ntubes=5340,
+    dynamic_energy_balance=dynamic_energy_balance,
+    Tp(start={571,568,566,564,562}))
+                  annotation (Placement(transformation(
+        origin={-44,-41},
+        extent={{-33,-16},{33,16}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    Ns=5,
+    ntubes=5340,
+    dynamic_energy_balance=dynamic_energy_balance,
+    Tp(start={563,560,558,557,556}))
+                  annotation (Placement(transformation(
+        origin={44,-41},
+        extent={{-33,16},{33,-16}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV(
+    Ns=5,
+    h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846,
+          1525552.01981793,1595519.78942018,1595519.78863864}),
+    D=0.03689,
+    L=10.848,
+    z2=10.848,
+    hcCorr=5,
+    dpfCorr=1,
+    ntubes=5340,
+    Q(start={8600/4,8600/4,8600/4,8600/4,8600/4,8600/4}),
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    option_temperature=option_temperature,
+    P(start={6866734.6044951,6862203.9025063,6853535.2456408,6846247.0825137,6840314.8313501,
+          6834912.1497303,6828884.4924605}),
+    Tp1(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}),
+    Tp2(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}))
+                                                          annotation (Placement(
+        transformation(
+        origin={-2.5,-41},
+        extent={{-32,31.5},{32,-31.5}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.VolumeC volumeA(
+    h0=1185.2e3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    dynamic_mass_balance=dynamic_mass_balance,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    ftype=ftype,
+    P0=6849350)                annotation (Placement(transformation(
+        origin={1,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.Volumes.VolumeC volumeA1(
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    dynamic_mass_balance=dynamic_mass_balance,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    ftype=ftype)                                                                                                                   annotation (
+      Placement(transformation(
+        origin={0,18},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line(
+      points={{-67,-11},{-67,-2},{67,-2},{67,-11}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2)
+    annotation (Line(points={{94,71},{94,82}}, thickness=0.5));
+  connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line(
+      points={{63,63},{86,63}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line(
+      points={{94,55},{94.2,32}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(DPnulle_AlimDwnc.C1, fluidInlet)
+    annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}}));
+  connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line(
+      points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line(
+      points={{67,-72},{68,-78},{68,-122},{46,-122}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(CapteurPAlim.C2, DownComerGV.C1)      annotation (Line(
+      points={{94.2,19.88},{94.2,20},{94,20},{94,6},{94.5,6},{94.5,-10}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line(
+      points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line(
+      points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(DownComerGV.C2, volumeA.Ce1)      annotation (Line(points={{94.5,-72},
+          {94.5,-108},{1,-108},{1,-100}}, color={0,0,255}));
+  connect(volumeA.Cs, RiserGV.C1)
+                                annotation (Line(points={{1,-80},{0.65,-80},{
+          0.65,-73}}, color={0,0,255}));
+  connect(RiserGV.C2, volumeA1.Ce1)
+                                  annotation (Line(points={{0.65,-9},{
+          -6.12303e-016,-9},{-6.12303e-016,8}}, color={0,0,255}));
+  connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{
+          6.12303e-016,28},{-6.12303e-016,28},{-6.12303e-016,37}}, color={0,0,
+          255}));
+  connect(heatExchangerWall.WT2, RiserGV.CTh2)
+                                             annotation (Line(points={{-40.8,
+          -41},{-18.25,-41}}, color={191,95,0}));
+  connect(RiserGV.CTh1, heatExchangerWall1.WT2)
+                                              annotation (Line(points={{19.55,
+          -41},{40.8,-41}}, color={191,95,0}));
+  connect(DomeGV.Cv, fluidOutletI) annotation (Line(points={{22,107},{22,124},{
+          0,124},{0,149}}, color={255,0,0}));
+  connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{
+          6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255}));
+  connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{40,
+          76.9},{40,63},{53,63}},    color={0,0,255}));
+  connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,85.5},
+          {32,114},{-36,114},{-36,96},{-52,96}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={Text(
+          extent={{55,81},{55,75}},
+          lineColor={0,0,255},
+          textString=
+               "petit DP"), Text(
+          extent={{-126,153},{-84,123}},
+          lineColor={0,0,255},
+          textString=
+               "= 1GV")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={
+        Ellipse(
+          extent={{-42,150},{42,108}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,131},{42,80}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={0,128,255}),
+        Ellipse(
+          extent={{-36,-108},{36,-150}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,86},{42,56}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={170,213,255}),
+        Rectangle(
+          extent={{-36,42},{36,-128}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={170,213,255}),
+        Polygon(
+          points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={170,213,255})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end SteamGenerator_1SG;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo
index 0370b63ee4d3e20438679a445608e4d93ccd467b..e70a69f99c69ed0e930aeb00d3d9246bf6971e2a 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo
@@ -1,405 +1,405 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-model SteamGenerator_4SG "Single steam generator equivalent to four steam generators"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real H0_Mix_AlimDomeGV=1194812.89980521;
-  parameter Boolean inertia=false
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.1 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0=50.e5
-    "Fluid initial pressure in the drum (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean option_temperature=false
-    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-public
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg(
-    L=10.848,
-    D=0.01687,
-    z2=10.848,
-    h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393,
-          1346263.00297153,1326153.46646787,1326153}),
-    Ns=5,
-    ntubes=21360,
-    dpfCorr=0.17,
-    hcCorr=5,
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    P(start={15548026.576998,15539261.540558,15513354.885726,15479081.11289,15444819.569988,
-          15410560.642776,15395560}),
-    Tp(start={564,562,560,559,568}))
-              annotation (Placement(transformation(
-        origin={-67,-41.5},
-        extent={{30.5,-15},{-30.5,15}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg(
-    L=10.848,
-    D=0.01687,
-    z1=10.848,
-    h(start={1326153.46646787,1310848.36111251,1299218.76228131,
-          1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}),
-    ntubes=21360,
-    dpfCorr=0.17,
-    hcCorr=5,
-    Ns=5,
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    P(start={15393431.104025,15393244.26355,15392971.944187,15392877.066005,15392915.646752,
-          15393000.834432,15393020}),
-    Tp(start={584,580,575,571,568}))
-          annotation (Placement(transformation(
-        origin={67,-41.5},
-        extent={{30.5,-14},{-30.5,14}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV(
-    hl(start=1257382.15477056),
-    hv(start=2771260.46625813),
-    Mp=32000,
-    cpp=500,
-    R=4.2818979,
-    L=8.625,
-    Cd(P(start=67.9e5)),
-    zl(fixed=false, start=0.66),
-    dynamic_energy_balance=dynamic_energy_balance,
-    steady_state=steady_state,
-    Vf0=Vf0,
-    P0=P0,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    wsftype=wsftype)                             annotation (Placement(transformation(extent={{
-            -22,64},{22,107}}, rotation=0)));
-protected
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
-    L=1,
-    D=0.95886,
-    lambda=0.03,
-    inertia=inertia)
-                 annotation (Placement(transformation(
-        origin={0,39.5},
-        extent={{-7.5,-10},{7.5,10}},
-        rotation=90)));
-public
-  ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV(
-    h0=H0_Mix_AlimDomeGV,
-    h(start=1194851.37111438),
-    V=0.01,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    ftype=ftype)                               " "
-    annotation (Placement(transformation(
-        origin={94,63},
-        extent={{-8,-8},{8,8}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
-      K=1e-4, rho(start=839))
-    annotation (Placement(transformation(
-        origin={94,88},
-        extent={{-6,-7},{6,7}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
-    p_rho=0,
-    C2(P(start=6829391.22090726), Q(fixed=false, start=6643)),
-    K=0.172144,
-    rho(start=742))                   annotation (Placement(transformation(extent=
-            {{53,53},{63,73}}, rotation=0)));
-
-public
-  ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim
-    annotation (Placement(transformation(
-        origin={99,26},
-        extent={{-6,-6},{6,6}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI
-    annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet annotation (
-      Placement(transformation(extent={{42,102},{62,122}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1 annotation (
-      Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1
-    annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
-    annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
-            0)));
-public
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV(
-    p_rho=0,
-    h(start=1194851.3),
-    z1=10.8,
-    C1(
-      h_vol_1(start=1.1733e6),
-      h(start=1.1733e6),
-      Q(start=7525.84),
-      P(start=6829391.22090726)),
-    Q(start=7525.84),
-    L=10.8,
-    D=0.216,
-    ntubes=128,
-    C2(
-      h_vol_1(start=1.1733e6),
-      Q(start=7525.84),
-      h(start=1.1733e6),
-      P(fixed=false, start=68.4935e5)),
-    lambda=0.08,
-    inertia=inertia)
-                 "DownComerGV" annotation (Placement(transformation(
-        origin={94.5,-41},
-        extent={{-31,16.5},{31,-16.5}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    L=10.848,
-    D=0.01687,
-    e=2.18e-3,
-    lambda=23,
-    cpw=503,
-    rhow=8430,
-    ntubes=21360,
-    Ns=5,
-    dynamic_energy_balance=dynamic_energy_balance,
-    Tp(start={571,568,566,564,562}))
-                  annotation (Placement(transformation(
-        origin={-44,-41},
-        extent={{-33,-16},{33,16}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
-    L=10.848,
-    D=0.01687,
-    e=2.18e-3,
-    lambda=23,
-    cpw=503,
-    rhow=8430,
-    ntubes=21360,
-    Ns=5,
-    dynamic_energy_balance=dynamic_energy_balance,
-    Tp(start={563,560,558,557,556}))
-                  annotation (Placement(transformation(
-        origin={44,-41},
-        extent={{-33,16},{33,-16}},
-        rotation=270)));
-
-  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV(
-    Ns=5,
-    Q(start={8600,8600,8600,8600,8600,8600}),
-    h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846,
-          1525552.01981793,1595519.78942018,1595519.78863864}),
-    D=0.03689,
-    ntubes=22056,
-    L=10.848,
-    z2=10.848,
-    hcCorr=5,
-    inertia=inertia,
-    advection=advection,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
-    steady_state=steady_state,
-    option_temperature=option_temperature,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    P(start={6866734.6044951,6862203.9025063,6853535.2456408,6846247.0825137,6840314.8313501,
-          6834912.1497303,6828884.4924605}),
-    Tp1(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}),
-    Tp2(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}))
-              annotation (Placement(transformation(
-        origin={-2.5,-41},
-        extent={{-32,31.5},{32,-31.5}},
-        rotation=90)));
-
-  ThermoSysPro.Fluid.Volumes.VolumeC volumeA(
-    h0=1185.2e3,
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    ftype=ftype,
-    P0=6849350)                annotation (Placement(transformation(
-        origin={0.5,-92},
-        extent={{-8,-8.5},{8,8.5}},
-        rotation=90)));
-  ThermoSysPro.Fluid.Volumes.VolumeC volumeA1(
-    dynamic_energy_balance=dynamic_energy_balance,
-    dynamic_mass_balance=dynamic_mass_balance,
-    steady_state=steady_state,
-    continuous_flow_reversal=continuous_flow_reversal,
-    diffusion=diffusion,
-    ftype=ftype)                                                                                                                   annotation (
-      Placement(transformation(
-        origin={-0.5,17},
-        extent={{-9,-9.5},{9,9.5}},
-        rotation=90)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_Vapeur(K=
-        1e-4, Q(start=2113))
-    annotation (Placement(transformation(
-        origin={-0.5,124},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-equation
-  connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line(
-      points={{-67,-11},{-67,-2},{67,-2},{67,-11}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2)
-    annotation (Line(points={{94,71},{94,82}}, thickness=0.5));
-  connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line(
-      points={{63,63},{86,63}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line(
-      points={{94,55},{94.2,32}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(DPnulle_AlimDwnc.C1, fluidInlet)
-    annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}}));
-  connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line(
-      points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line(
-      points={{67,-72},{68,-78},{68,-122},{46,-122}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(CapteurPAlim.C2, DownComerGV.C1)      annotation (Line(
-      points={{94.2,19.88},{94.2,18},{94,18},{94,4},{94.5,4},{94.5,-10}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line(
-      points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}},
-      color={191,95,0},
-      thickness=0.5));
-  connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line(
-      points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}},
-      color={191,95,0},
-      thickness=0.5));
-  connect(DownComerGV.C2, volumeA.Ce1)      annotation (Line(points={{94.5,-72},
-          {94.5,-108},{0.5,-108},{0.5,-100}}, color={0,0,255}));
-  connect(volumeA.Cs, RiserGV.C1)
-                                annotation (Line(points={{0.5,-84},{0.65,-84},{
-          0.65,-73}}, color={0,0,255}));
-  connect(RiserGV.C2, volumeA1.Ce1)
-                                  annotation (Line(points={{0.65,-9},{-0.5,-9},{
-          -0.5,8}},                             color={0,0,255}));
-  connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{-0.5,26},
-          {-6.12303e-016,26},{-6.12303e-016,32}},                  color={0,0,
-          255}));
-  connect(heatExchangerWall.WT2, RiserGV.CTh2)
-                                             annotation (Line(points={{-40.8,
-          -41},{-18.25,-41}}, color={191,95,0}));
-  connect(RiserGV.CTh1, heatExchangerWall1.WT2)
-                                              annotation (Line(points={{19.55,-41},
-          {30,-41},{40.8,-41}},               color={191,95,0}));
-  connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{
-          6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255}));
-  connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{
-          40,76.9},{40,63},{53,63}}, color={0,0,255}));
-  connect(DomeGV.Cv, DPnulle_Vapeur.C1) annotation (Line(points={{22,107},{22,
-          118},{-0.5,118}}, color={255,0,0}));
-  connect(DPnulle_Vapeur.C2, fluidOutletI) annotation (Line(points={{-0.5,130},
-          {0,130},{0,149}}, color={255,0,0}));
-  connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,85.5},
-          {32,114},{-36,114},{-36,96},{-52,96}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-150,-150},{150,150}},
-        initialScale=0.1), graphics={Text(
-          extent={{55,81},{55,75}},
-          lineColor={0,0,255},
-          textString=
-               "petit DP"), Text(
-          extent={{-126,153},{-84,123}},
-          lineColor={0,0,255},
-          textString=
-               "= 4GV")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-150,-150},{150,150}},
-        initialScale=0.1), graphics={
-        Ellipse(
-          extent={{-42,150},{42,108}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={0,128,255}),
-        Rectangle(
-          extent={{-42,131},{42,80}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={0,128,255}),
-        Ellipse(
-          extent={{-36,-108},{36,-150}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={0,128,255}),
-        Rectangle(
-          extent={{-42,86},{42,56}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={170,213,255}),
-        Rectangle(
-          extent={{-36,42},{36,-128}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={170,213,255}),
-        Polygon(
-          points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor={170,213,255})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end SteamGenerator_4SG;
+within ThermoSysPro.Fluid.HeatExchangers;
+model SteamGenerator_4SG "Single steam generator equivalent to four steam generators"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real H0_Mix_AlimDomeGV=1194812.89980521;
+  parameter Boolean inertia=false
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.1 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0=50.e5
+    "Fluid initial pressure in the drum (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean option_temperature=false
+    "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+public
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg(
+    L=10.848,
+    D=0.01687,
+    z2=10.848,
+    h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393,
+          1346263.00297153,1326153.46646787,1326153}),
+    Ns=5,
+    ntubes=21360,
+    dpfCorr=0.17,
+    hcCorr=5,
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    P(start={15548026.576998,15539261.540558,15513354.885726,15479081.11289,15444819.569988,
+          15410560.642776,15395560}),
+    Tp(start={564,562,560,559,568}))
+              annotation (Placement(transformation(
+        origin={-67,-41.5},
+        extent={{30.5,-15},{-30.5,15}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg(
+    L=10.848,
+    D=0.01687,
+    z1=10.848,
+    h(start={1326153.46646787,1310848.36111251,1299218.76228131,
+          1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}),
+    ntubes=21360,
+    dpfCorr=0.17,
+    hcCorr=5,
+    Ns=5,
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    P(start={15393431.104025,15393244.26355,15392971.944187,15392877.066005,15392915.646752,
+          15393000.834432,15393020}),
+    Tp(start={584,580,575,571,568}))
+          annotation (Placement(transformation(
+        origin={67,-41.5},
+        extent={{30.5,-14},{-30.5,14}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV(
+    hl(start=1257382.15477056),
+    hv(start=2771260.46625813),
+    Mp=32000,
+    cpp=500,
+    R=4.2818979,
+    L=8.625,
+    Cd(P(start=67.9e5)),
+    zl(fixed=false, start=0.66),
+    dynamic_energy_balance=dynamic_energy_balance,
+    steady_state=steady_state,
+    Vf0=Vf0,
+    P0=P0,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    wsftype=wsftype)                             annotation (Placement(transformation(extent={{
+            -22,64},{22,107}}, rotation=0)));
+protected
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
+    L=1,
+    D=0.95886,
+    lambda=0.03,
+    inertia=inertia)
+                 annotation (Placement(transformation(
+        origin={0,39.5},
+        extent={{-7.5,-10},{7.5,10}},
+        rotation=90)));
+public
+  ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV(
+    h0=H0_Mix_AlimDomeGV,
+    h(start=1194851.37111438),
+    V=0.01,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    ftype=ftype)                               " "
+    annotation (Placement(transformation(
+        origin={94,63},
+        extent={{-8,-8},{8,8}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
+      K=1e-4, rho(start=839))
+    annotation (Placement(transformation(
+        origin={94,88},
+        extent={{-6,-7},{6,7}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
+    p_rho=0,
+    C2(P(start=6829391.22090726), Q(fixed=false, start=6643)),
+    K=0.172144,
+    rho(start=742))                   annotation (Placement(transformation(extent=
+            {{53,53},{63,73}}, rotation=0)));
+
+public
+  ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim
+    annotation (Placement(transformation(
+        origin={99,26},
+        extent={{-6,-6},{6,6}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI
+    annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet annotation (
+      Placement(transformation(extent={{42,102},{62,122}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1 annotation (
+      Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1
+    annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
+    annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
+            0)));
+public
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV(
+    p_rho=0,
+    h(start=1194851.3),
+    z1=10.8,
+    C1(
+      h_vol_1(start=1.1733e6),
+      h(start=1.1733e6),
+      Q(start=7525.84),
+      P(start=6829391.22090726)),
+    Q(start=7525.84),
+    L=10.8,
+    D=0.216,
+    ntubes=128,
+    C2(
+      h_vol_1(start=1.1733e6),
+      Q(start=7525.84),
+      h(start=1.1733e6),
+      P(fixed=false, start=68.4935e5)),
+    lambda=0.08,
+    inertia=inertia)
+                 "DownComerGV" annotation (Placement(transformation(
+        origin={94.5,-41},
+        extent={{-31,16.5},{31,-16.5}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    ntubes=21360,
+    Ns=5,
+    dynamic_energy_balance=dynamic_energy_balance,
+    Tp(start={571,568,566,564,562}))
+                  annotation (Placement(transformation(
+        origin={-44,-41},
+        extent={{-33,-16},{33,16}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    ntubes=21360,
+    Ns=5,
+    dynamic_energy_balance=dynamic_energy_balance,
+    Tp(start={563,560,558,557,556}))
+                  annotation (Placement(transformation(
+        origin={44,-41},
+        extent={{-33,16},{33,-16}},
+        rotation=270)));
+
+  ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV(
+    Ns=5,
+    Q(start={8600,8600,8600,8600,8600,8600}),
+    h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846,
+          1525552.01981793,1595519.78942018,1595519.78863864}),
+    D=0.03689,
+    ntubes=22056,
+    L=10.848,
+    z2=10.848,
+    hcCorr=5,
+    inertia=inertia,
+    advection=advection,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    simplified_dynamic_energy_balance=simplified_dynamic_energy_balance,
+    steady_state=steady_state,
+    option_temperature=option_temperature,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    P(start={6866734.6044951,6862203.9025063,6853535.2456408,6846247.0825137,6840314.8313501,
+          6834912.1497303,6828884.4924605}),
+    Tp1(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}),
+    Tp2(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}))
+              annotation (Placement(transformation(
+        origin={-2.5,-41},
+        extent={{-32,31.5},{32,-31.5}},
+        rotation=90)));
+
+  ThermoSysPro.Fluid.Volumes.VolumeC volumeA(
+    h0=1185.2e3,
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    ftype=ftype,
+    P0=6849350)                annotation (Placement(transformation(
+        origin={0.5,-92},
+        extent={{-8,-8.5},{8,8.5}},
+        rotation=90)));
+  ThermoSysPro.Fluid.Volumes.VolumeC volumeA1(
+    dynamic_energy_balance=dynamic_energy_balance,
+    dynamic_mass_balance=dynamic_mass_balance,
+    steady_state=steady_state,
+    continuous_flow_reversal=continuous_flow_reversal,
+    diffusion=diffusion,
+    ftype=ftype)                                                                                                                   annotation (
+      Placement(transformation(
+        origin={-0.5,17},
+        extent={{-9,-9.5},{9,9.5}},
+        rotation=90)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_Vapeur(K=
+        1e-4, Q(start=2113))
+    annotation (Placement(transformation(
+        origin={-0.5,124},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+equation
+  connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line(
+      points={{-67,-11},{-67,-2},{67,-2},{67,-11}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2)
+    annotation (Line(points={{94,71},{94,82}}, thickness=0.5));
+  connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line(
+      points={{63,63},{86,63}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line(
+      points={{94,55},{94.2,32}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(DPnulle_AlimDwnc.C1, fluidInlet)
+    annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}}));
+  connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line(
+      points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line(
+      points={{67,-72},{68,-78},{68,-122},{46,-122}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(CapteurPAlim.C2, DownComerGV.C1)      annotation (Line(
+      points={{94.2,19.88},{94.2,18},{94,18},{94,4},{94.5,4},{94.5,-10}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line(
+      points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line(
+      points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(DownComerGV.C2, volumeA.Ce1)      annotation (Line(points={{94.5,-72},
+          {94.5,-108},{0.5,-108},{0.5,-100}}, color={0,0,255}));
+  connect(volumeA.Cs, RiserGV.C1)
+                                annotation (Line(points={{0.5,-84},{0.65,-84},{
+          0.65,-73}}, color={0,0,255}));
+  connect(RiserGV.C2, volumeA1.Ce1)
+                                  annotation (Line(points={{0.65,-9},{-0.5,-9},{
+          -0.5,8}},                             color={0,0,255}));
+  connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{-0.5,26},
+          {-6.12303e-016,26},{-6.12303e-016,32}},                  color={0,0,
+          255}));
+  connect(heatExchangerWall.WT2, RiserGV.CTh2)
+                                             annotation (Line(points={{-40.8,
+          -41},{-18.25,-41}}, color={191,95,0}));
+  connect(RiserGV.CTh1, heatExchangerWall1.WT2)
+                                              annotation (Line(points={{19.55,-41},
+          {30,-41},{40.8,-41}},               color={191,95,0}));
+  connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{
+          6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255}));
+  connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{
+          40,76.9},{40,63},{53,63}}, color={0,0,255}));
+  connect(DomeGV.Cv, DPnulle_Vapeur.C1) annotation (Line(points={{22,107},{22,
+          118},{-0.5,118}}, color={255,0,0}));
+  connect(DPnulle_Vapeur.C2, fluidOutletI) annotation (Line(points={{-0.5,130},
+          {0,130},{0,149}}, color={255,0,0}));
+  connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,85.5},
+          {32,114},{-36,114},{-36,96},{-52,96}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={Text(
+          extent={{55,81},{55,75}},
+          lineColor={0,0,255},
+          textString=
+               "petit DP"), Text(
+          extent={{-126,153},{-84,123}},
+          lineColor={0,0,255},
+          textString=
+               "= 4GV")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={
+        Ellipse(
+          extent={{-42,150},{42,108}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,131},{42,80}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={0,128,255}),
+        Ellipse(
+          extent={{-36,-108},{36,-150}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,86},{42,56}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={170,213,255}),
+        Rectangle(
+          extent={{-36,42},{36,-128}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={170,213,255}),
+        Polygon(
+          points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor={170,213,255})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end SteamGenerator_4SG;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/package.mo b/ThermoSysPro/Fluid/HeatExchangers/package.mo
index 1497f5a65f257be752178fbbbc204259050d939f..55594066c70ec982f3c13286dcfb46604ac40842 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/package.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/package.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.Fluid;
-package HeatExchangers "Heat exchangers"
-
-
-
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end HeatExchangers;
+within ThermoSysPro.Fluid;
+package HeatExchangers "Heat exchangers"
+
+
+
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end HeatExchangers;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/package.order b/ThermoSysPro/Fluid/HeatExchangers/package.order
index 45ad7d6f4486290d70807349c17437e46197fcbb..74e2004c95cc17ad0b6d9fea0828296c96fa66ba 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/package.order
+++ b/ThermoSysPro/Fluid/HeatExchangers/package.order
@@ -1,26 +1,26 @@
-DynamicCondenser
-DynamicFlueGasesMultiFluidHeatExchanger
-DynamicMultiFluidHeatExchanger
-DynamicMultiFluidHeatExchangerShell
-DynamicOnePhaseFlowPipe
-DynamicOnePhaseFlowShell
-DynamicPlateHeatExchanger
-DynamicTwoPhaseFlowPipe
-DynamicTwoPhaseFlowRiser
-DynamicWaterHeater
-DynamicWaterHeaterOnePipe
-DynamicWaterSteamMultiFluidsHeatExchanger
-FixedPowerHeatExchanger
-NTUWaterHeater
-SimpleDynamicCondenser
-SimpleEvaporatorWaterSteamFlueGases
-SimpleStaticCondenser
-StaticAerocondenser
-StaticCondenser
-StaticCondenserHEI
-StaticExchangerDTorWorEff
-StaticExchangerKS
-StaticPlateHeatExchanger
-StaticWallFlueGasesExchanger
-SteamGenerator_1SG
-SteamGenerator_4SG
+DynamicCondenser
+DynamicFlueGasesMultiFluidHeatExchanger
+DynamicMultiFluidHeatExchanger
+DynamicMultiFluidHeatExchangerShell
+DynamicOnePhaseFlowPipe
+DynamicOnePhaseFlowShell
+DynamicPlateHeatExchanger
+DynamicTwoPhaseFlowPipe
+DynamicTwoPhaseFlowRiser
+DynamicWaterHeater
+DynamicWaterHeaterOnePipe
+DynamicWaterSteamMultiFluidsHeatExchanger
+FixedPowerHeatExchanger
+NTUWaterHeater
+SimpleDynamicCondenser
+SimpleEvaporatorWaterSteamFlueGases
+SimpleStaticCondenser
+StaticAerocondenser
+StaticCondenser
+StaticCondenserHEI
+StaticExchangerDTorWorEff
+StaticExchangerKS
+StaticPlateHeatExchanger
+StaticWallFlueGasesExchanger
+SteamGenerator_1SG
+SteamGenerator_4SG
diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo
index 58580182ef92cc109db2afba145c278d48e0cfee..375ac74ed1999a453dfdb5bb1a3bf6f573bec68e 100644
--- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo
+++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo
@@ -1,54 +1,54 @@
-within ThermoSysPro.Fluid.Interfaces.Connectors;
-connector FluidInlet "Fluid inlet connector"
-  Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume";
-  Units.SI.MassFlowRate Q(start=500)
-    "Mass flow rate of the fluid crossing the boundary of the control volume";
-  Units.SI.SpecificEnthalpy h(start=1.e5)
-    "Specific enthalpy of the fluid crossing the boundary of the control volume";
-  Units.SI.SpecificEnthalpy h_vol_1(start=1.e5)
-    "Fluid specific enthalpy in the control volume 1";
-  Units.SI.SpecificEnthalpy h_vol_2(start=1.e5)
-    "Fluid specific enthalpy in the control volume 2";
-  input ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType ftype
-    "Fluid type";
-  ThermoSysPro.Units.SI.MassFraction Xco2(start=0.01)
-    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-  ThermoSysPro.Units.SI.MassFraction Xh2o(start=0.05)
-    "H2O mass fraction of the fluid crossing the boundary of the control volume";
-  ThermoSysPro.Units.SI.MassFraction Xo2(start=0.2)
-    "O2 mass fraction of the fluid crossing the boundary of the control volume";
-  ThermoSysPro.Units.SI.MassFraction Xso2(start=0)
-    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-  input Real diff_res_1(start=1e4)
-    "Diffusion resistance from control volume 1";
-  output Real diff_res_2(start=1e4)
-    "Diffusion resistance from control volume 2";
-  input Boolean diff_on_1
-    "true: with diffusion - false: without diffusion from control volume 1";
-  output Boolean diff_on_2
-    "true: with diffusion - false: without diffusion from control volume 2";
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={108,199,255})}),
-    Window(
-      x=0.27,
-      y=0.33,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
- revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end FluidInlet;
+within ThermoSysPro.Fluid.Interfaces.Connectors;
+connector FluidInlet "Fluid inlet connector"
+  Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume";
+  Units.SI.MassFlowRate Q(start=500)
+    "Mass flow rate of the fluid crossing the boundary of the control volume";
+  Units.SI.SpecificEnthalpy h(start=1.e5)
+    "Specific enthalpy of the fluid crossing the boundary of the control volume";
+  Units.SI.SpecificEnthalpy h_vol_1(start=1.e5)
+    "Fluid specific enthalpy in the control volume 1";
+  Units.SI.SpecificEnthalpy h_vol_2(start=1.e5)
+    "Fluid specific enthalpy in the control volume 2";
+  input ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType ftype
+    "Fluid type";
+  ThermoSysPro.Units.SI.MassFraction Xco2(start=0.01)
+    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+  ThermoSysPro.Units.SI.MassFraction Xh2o
+    "H2O mass fraction of the fluid crossing the boundary of the control volume";
+  ThermoSysPro.Units.SI.MassFraction Xo2(start=0.2)
+    "O2 mass fraction of the fluid crossing the boundary of the control volume";
+  ThermoSysPro.Units.SI.MassFraction Xso2(start=0)
+    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+  input Real diff_res_1(start=1e4)
+    "Diffusion resistance from control volume 1";
+  output Real diff_res_2(start=1e4)
+    "Diffusion resistance from control volume 2";
+  input Boolean diff_on_1
+    "true: with diffusion - false: without diffusion from control volume 1";
+  output Boolean diff_on_2
+    "true: with diffusion - false: without diffusion from control volume 2";
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={108,199,255})}),
+    Window(
+      x=0.27,
+      y=0.33,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+ revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end FluidInlet;
diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo
index 38c443deaf43821c85bdd52e46128050c6f37451..4f067e7152e237d894ba54417cda6317ffe59eac 100644
--- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo
+++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo
@@ -1,54 +1,54 @@
-within ThermoSysPro.Fluid.Interfaces.Connectors;
-connector FluidOutlet "Fluid outlet connector"
-  Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume";
-  Units.SI.MassFlowRate Q(start=500)
-    "Mass flow rate of the fluid crossing the boundary of the control volume";
-  Units.SI.SpecificEnthalpy h(start=1.e5)
-    "Specific enthalpy of the fluid crossing the boundary of the control volume";
-  Units.SI.SpecificEnthalpy h_vol_1(start=1.e5)
-    "Fluid specific enthalpy in the control volume 1";
-  Units.SI.SpecificEnthalpy h_vol_2(start=1.e5)
-    "Fluid specific enthalpy in the control volume 2";
-  output ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType ftype
-    "Fluid type";
-  ThermoSysPro.Units.SI.MassFraction Xco2(start=0.01)
-    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
-  ThermoSysPro.Units.SI.MassFraction Xh2o(start=0.05)
-    "H2O mass fraction of the fluid crossing the boundary of the control volume";
-  ThermoSysPro.Units.SI.MassFraction Xo2(start=0.2)
-    "O2 mass fraction of the fluid crossing the boundary of the control volume";
-  ThermoSysPro.Units.SI.MassFraction Xso2(start=0)
-    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
-  output Real diff_res_1(start=1e4)
-    "Diffusion resistance from control volume 1";
-  input Real diff_res_2(start=1e4)
-    "Diffusion resistance from control volume 2";
-  output Boolean diff_on_1
-    "true: with diffusion - false: without diffusion from control volume 1";
-  input Boolean diff_on_2
-    "true: with diffusion - false: without diffusion from control volume 2";
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,108,92})}),
-    Window(
-      x=0.26,
-      y=0.39,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
- revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end FluidOutlet;
+within ThermoSysPro.Fluid.Interfaces.Connectors;
+connector FluidOutlet "Fluid outlet connector"
+  Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume";
+  Units.SI.MassFlowRate Q(start=500)
+    "Mass flow rate of the fluid crossing the boundary of the control volume";
+  Units.SI.SpecificEnthalpy h(start=1.e5)
+    "Specific enthalpy of the fluid crossing the boundary of the control volume";
+  Units.SI.SpecificEnthalpy h_vol_1(start=1.e5)
+    "Fluid specific enthalpy in the control volume 1";
+  Units.SI.SpecificEnthalpy h_vol_2(start=1.e5)
+    "Fluid specific enthalpy in the control volume 2";
+  output ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType ftype
+    "Fluid type";
+  ThermoSysPro.Units.SI.MassFraction Xco2(start=0.01)
+    "CO2 mass fraction of the fluid crossing the boundary of the control volume";
+  ThermoSysPro.Units.SI.MassFraction Xh2o
+    "H2O mass fraction of the fluid crossing the boundary of the control volume";
+  ThermoSysPro.Units.SI.MassFraction Xo2(start=0.2)
+    "O2 mass fraction of the fluid crossing the boundary of the control volume";
+  ThermoSysPro.Units.SI.MassFraction Xso2(start=0)
+    "SO2 mass fraction of the fluid crossing the boundary of the control volume";
+  output Real diff_res_1(start=1e4)
+    "Diffusion resistance from control volume 1";
+  input Real diff_res_2(start=1e4)
+    "Diffusion resistance from control volume 2";
+  output Boolean diff_on_1
+    "true: with diffusion - false: without diffusion from control volume 1";
+  input Boolean diff_on_2
+    "true: with diffusion - false: without diffusion from control volume 2";
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,108,92})}),
+    Window(
+      x=0.26,
+      y=0.39,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+ revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end FluidOutlet;
diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FuelInlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FuelInlet.mo
index d49532ee751936135999f3a05b83a60579dac9ab..ca6e872f85effcbb46f6e11c4d18733150d0fc20 100644
--- a/ThermoSysPro/Fluid/Interfaces/Connectors/FuelInlet.mo
+++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FuelInlet.mo
@@ -1,30 +1,30 @@
-within ThermoSysPro.Fluid.Interfaces.Connectors;
-connector FuelInlet "Fuel inlet connector"
-  input Units.SI.MassFlowRate Q "Fuel mass flow rate";
-  Units.SI.AbsolutePressure P "Fuel pressure";
-  Units.SI.Temperature T "Fuel temperature";
-  Units.SI.SpecificEnergy LHV "Lower heating value";
-  Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
-  Real hum "Fuel humidity (%)";
-  ThermoSysPro.Units.SI.MassFraction Xc "C mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh "H mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo "O mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xn "N mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xs "S mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xashes "Ashes mass fraction";
-  ThermoSysPro.Units.SI.MassFraction VolM "Percentage of volatile matter";
-  Units.SI.Density rho "Fuel density";
-  annotation (Icon(graphics={Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={0,0,0}), Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={0,128,255})}),    Documentation(revisions="",
-        info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end FuelInlet;
+within ThermoSysPro.Fluid.Interfaces.Connectors;
+connector FuelInlet "Fuel inlet connector"
+  input Units.SI.MassFlowRate Q "Fuel mass flow rate";
+  Units.SI.AbsolutePressure P "Fuel pressure";
+  Units.SI.Temperature T "Fuel temperature";
+  Units.SI.SpecificEnergy LHV "Lower heating value";
+  Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
+  Real hum "Fuel humidity (%)";
+  ThermoSysPro.Units.SI.MassFraction Xc "C mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh "H mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo "O mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xn "N mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xs "S mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xashes "Ashes mass fraction";
+  ThermoSysPro.Units.SI.MassFraction VolM "Percentage of volatile matter";
+  Units.SI.Density rho "Fuel density";
+  annotation (Icon(graphics={Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,0,0}), Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={0,128,255})}),    Documentation(revisions="",
+        info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end FuelInlet;
diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FuelOutlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FuelOutlet.mo
index 416eee64e23a425ab44030e1131b962e298eee10..65950b5aa855d0f7de52c5bdc3ebdc7cd0f9d5b0 100644
--- a/ThermoSysPro/Fluid/Interfaces/Connectors/FuelOutlet.mo
+++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FuelOutlet.mo
@@ -1,30 +1,30 @@
-within ThermoSysPro.Fluid.Interfaces.Connectors;
-connector FuelOutlet "Fuel outlet connector"
-  output Units.SI.MassFlowRate Q "Fuel mass flow rate";
-  Units.SI.AbsolutePressure P "Fuel pressure";
-  Units.SI.Temperature T "Fuel temperature";
-  Units.SI.SpecificEnergy LHV "Lower heating value";
-  Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
-  Real hum "Fuel humidity (%)";
-  ThermoSysPro.Units.SI.MassFraction Xc "C mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh "H mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo "O mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xn "N mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xs "S mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xashes "Ashes mass fraction";
-  ThermoSysPro.Units.SI.MassFraction VolM "Percentage of volatile matter";
-  Units.SI.Density rho "Fuel density";
-  annotation (Icon(graphics={Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,0},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Forward), Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0})}),    Documentation(revisions="",
-        info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end FuelOutlet;
+within ThermoSysPro.Fluid.Interfaces.Connectors;
+connector FuelOutlet "Fuel outlet connector"
+  output Units.SI.MassFlowRate Q "Fuel mass flow rate";
+  Units.SI.AbsolutePressure P "Fuel pressure";
+  Units.SI.Temperature T "Fuel temperature";
+  Units.SI.SpecificEnergy LHV "Lower heating value";
+  Units.SI.SpecificHeatCapacity cp "Fuel specific heat capacity at 273.15 K";
+  Real hum "Fuel humidity (%)";
+  ThermoSysPro.Units.SI.MassFraction Xc "C mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh "H mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo "O mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xn "N mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xs "S mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xashes "Ashes mass fraction";
+  ThermoSysPro.Units.SI.MassFraction VolM "Percentage of volatile matter";
+  Units.SI.Density rho "Fuel density";
+  annotation (Icon(graphics={Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,0},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Forward), Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0})}),    Documentation(revisions="",
+        info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end FuelOutlet;
diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/package.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/package.mo
index c6e38149eaad4aa192d0f59380d6c3af2d8b43c2..92923109b3cb6a507c93925bb1e5bee0013f84c4 100644
--- a/ThermoSysPro/Fluid/Interfaces/Connectors/package.mo
+++ b/ThermoSysPro/Fluid/Interfaces/Connectors/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Fluid.Interfaces;
-package Connectors
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Connectors;
+within ThermoSysPro.Fluid.Interfaces;
+package Connectors
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Connectors;
diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/package.order b/ThermoSysPro/Fluid/Interfaces/Connectors/package.order
index 3494904ffadc47d110436e81700558724289407d..7cb9aea3fd437f83ede33ecc45a6b6f99bb6d14d 100644
--- a/ThermoSysPro/Fluid/Interfaces/Connectors/package.order
+++ b/ThermoSysPro/Fluid/Interfaces/Connectors/package.order
@@ -1,4 +1,4 @@
-FluidInlet
-FluidOutlet
-FuelInlet
-FuelOutlet
+FluidInlet
+FluidOutlet
+FuelInlet
+FuelOutlet
diff --git a/ThermoSysPro/Fluid/Interfaces/IconColors.mo b/ThermoSysPro/Fluid/Interfaces/IconColors.mo
index 90a86dab0d847a49999ca8bd0f1a015170002a3e..9400201fe9bc9b9e3e4a3ebcbbecf36ebcd43ea1 100644
--- a/ThermoSysPro/Fluid/Interfaces/IconColors.mo
+++ b/ThermoSysPro/Fluid/Interfaces/IconColors.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Fluid.Interfaces;
-partial model IconColors
-  "Colors of the static, singular and dynamic model icons"
-
-protected
-  constant Integer fill_color_dynamic[:] = {85,170,255} "Light blue";
-  constant Integer fill_color_singular[:] = {127,255,0} "Green";
-  constant Integer fill_color_static[:] = {255,255,0} "Yellow";
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end IconColors;
+within ThermoSysPro.Fluid.Interfaces;
+partial model IconColors
+  "Colors of the static, singular and dynamic model icons"
+
+protected
+  constant Integer fill_color_dynamic[:] = {85,170,255} "Light blue";
+  constant Integer fill_color_singular[:] = {127,255,0} "Green";
+  constant Integer fill_color_static[:] = {255,255,0} "Yellow";
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end IconColors;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FlueGasesFluidType.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FlueGasesFluidType.mo
index c9f25d93302f345055a75e957e7841a87075e3d3..8f53f278c56d6c00a89ff847650278ca4dc05718 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FlueGasesFluidType.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FlueGasesFluidType.mo
@@ -1,6 +1,6 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-type FlueGasesFluidType = enumeration(
-    FlueGases "3 - Flue gases (compressible)") annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+type FlueGasesFluidType = enumeration(
+    FlueGases "3 - Flue gases (compressible)") annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FlueGasesFluidTypeParameterInterface.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FlueGasesFluidTypeParameterInterface.mo
index 3a74f6ce89b6d661277d22e91a2eac57bd1254ed..126ae2af95a1c6ff82df8087ca9fc0f2fd57a109 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FlueGasesFluidTypeParameterInterface.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FlueGasesFluidTypeParameterInterface.mo
@@ -1,21 +1,21 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-partial model FlueGasesFluidTypeParameterInterface
-  "Interface to display the  flue gases fluid type after parametrization"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidType;
-
-  parameter FlueGasesFluidType fgftype=FlueGasesFluidType.FlueGases "Flue gases fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer fgfluid=Integer(fgftype) "Fluid number" annotation(Evaluate=true);
-
-protected
-  parameter FluidType ftype=cvfgftype(fgftype) annotation(Evaluate=true);
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false)),
-                                            Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end FlueGasesFluidTypeParameterInterface;
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+partial model FlueGasesFluidTypeParameterInterface
+  "Interface to display the  flue gases fluid type after parametrization"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidType;
+
+  parameter FlueGasesFluidType fgftype=FlueGasesFluidType.FlueGases "Flue gases fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer fgfluid=Integer(fgftype) "Fluid number" annotation(Evaluate=true);
+
+protected
+  parameter FluidType ftype=cvfgftype(fgftype) annotation(Evaluate=true);
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)),
+                                            Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end FlueGasesFluidTypeParameterInterface;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidType.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidType.mo
index e29cae8bc42164681e6ca84492f7ce319f5f74cd..89d9557c10186990fd143dee9c3925ae28b8aaeb 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidType.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidType.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-type FluidType = enumeration(
-    WaterSteam "1 - IF97 water/steam (compressible)",
-    C3H3F5 "2 - C3H3F5",
-    FlueGases "3 - Flue gases (compressible)",
-    MoltenSalt "4 - Molten salt",
-    Oil_TherminolVP1 "5 - Oil Therminol VP1",
-    DryAirIdealGas "6 - Dry air (compressible)",
-    WaterSteamSimple "7 - Simplified water/steam (compressible)") annotation (
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+type FluidType = enumeration(
+    WaterSteam "1 - IF97 water/steam (compressible)",
+    C3H3F5 "2 - C3H3F5",
+    FlueGases "3 - Flue gases (compressible)",
+    MoltenSalt "4 - Molten salt",
+    Oil_TherminolVP1 "5 - Oil Therminol VP1",
+    DryAirIdealGas "6 - Dry air (compressible)",
+    WaterSteamSimple "7 - Simplified water/steam (compressible)") annotation (
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeColors.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeColors.mo
index c96b8453c4034dce70f9df2004b655c053f3c26c..2ce0c7062994d7a3de48846def557b5e8e1f0950 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeColors.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeColors.mo
@@ -1,28 +1,28 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-partial model FluidTypeColors "Fluid type colors"
-
-protected
-  constant Integer line_color_WaterSteam[:] = {0,0,255} "Blue";
-  constant Integer line_color_C3H3F5[:] = {238,46,47} "Red";
-  constant Integer line_color_FlueGases[:] = {0,140,72} "Green";
-  constant Integer line_color_Oil_MoltenSalt[:] = {217,67,180} "Magenta";
-  constant Integer line_color_Oil_TherminolVP1[:] = {162,29,33} "Brown";
-  constant Integer line_color_DryAirIdealGas[:] = {244,125,35} "Orange";
-  constant Integer line_color_WaterSteamSimple[:] = {102,44,145} "Purple";
-
-  constant Integer fill_color_WaterSteam[:] = {0,0,255} "Blue";
-  constant Integer fill_color_C3H3F5[:] = {238,46,47} "Red";
-  constant Integer fill_color_FlueGases[:] = {0,140,72} "Green";
-  constant Integer fill_color_MoltenSalt[:] = {217,67,180} "Magenta";
-  constant Integer fill_color_Oil_TherminolVP1[:] = {162,29,33} "Brown";
-  constant Integer fill_color_DryAirIdealGas[:] = {244,125,35} "Orange";
-  constant Integer fill_color_WaterSteamSimple[:] = {102,44,145} "Purple";
-
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false)),
-                                            Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end FluidTypeColors;
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+partial model FluidTypeColors "Fluid type colors"
+
+protected
+  constant Integer line_color_WaterSteam[:] = {0,0,255} "Blue";
+  constant Integer line_color_C3H3F5[:] = {238,46,47} "Red";
+  constant Integer line_color_FlueGases[:] = {0,140,72} "Green";
+  constant Integer line_color_Oil_MoltenSalt[:] = {217,67,180} "Magenta";
+  constant Integer line_color_Oil_TherminolVP1[:] = {162,29,33} "Brown";
+  constant Integer line_color_DryAirIdealGas[:] = {244,125,35} "Orange";
+  constant Integer line_color_WaterSteamSimple[:] = {102,44,145} "Purple";
+
+  constant Integer fill_color_WaterSteam[:] = {0,0,255} "Blue";
+  constant Integer fill_color_C3H3F5[:] = {238,46,47} "Red";
+  constant Integer fill_color_FlueGases[:] = {0,140,72} "Green";
+  constant Integer fill_color_MoltenSalt[:] = {217,67,180} "Magenta";
+  constant Integer fill_color_Oil_TherminolVP1[:] = {162,29,33} "Brown";
+  constant Integer fill_color_DryAirIdealGas[:] = {244,125,35} "Orange";
+  constant Integer fill_color_WaterSteamSimple[:] = {102,44,145} "Purple";
+
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)),
+                                            Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end FluidTypeColors;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeParameterInterface.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeParameterInterface.mo
index dcca0b5d76e7494028f8c2c4a8dd65ef34c6b9a7..d325e62d8d286dea0bf25fdab294fc53cf30b2bb 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeParameterInterface.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeParameterInterface.mo
@@ -1,62 +1,62 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-partial model FluidTypeParameterInterface "Interface to display the fluid type after parametrization"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter FluidType ftype=FluidType.WaterSteam "Fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer fluid=Integer(ftype) "Fluid number" annotation(Evaluate=true);
-  parameter Boolean isCompressible=(ftype==FluidType.WaterSteam or ftype==FluidType.FlueGases or ftype==FluidType.DryAirIdealGas or ftype==FluidType.WaterSteamSimple) "Compressible fluid" annotation(Evaluate=true);
-
-public
-  Integer fluid1=Integer(ftype) "Fluid number";
-
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
-          Rectangle(
-          extent={{78,98},{98,78}},
-          lineColor= DynamicSelect({255,255,255},
-          if fluid1==1 then {0,0,255}
-          else if fluid1==2 then {238,46,47}
-          else if fluid1==3 then {0,140,72}
-          else if fluid1==4 then {217,67,180}
-          else if fluid1==5 then {162,29,33}
-          else if fluid1==6 then {244,125,35}
-          else if fluid1==7 then {102,44,145}
-          else {213,255,170}),
-          fillColor= DynamicSelect({255,255,255},
-          if fluid1==1 then {0,0,255}
-          else if fluid1==2 then {238,46,47}
-          else if fluid1==3 then {0,140,72}
-          else if fluid1==4 then {217,67,180}
-          else if fluid1==5 then {162,29,33}
-          else if fluid1==6 then {244,125,35}
-          else if fluid1==7 then {102,44,145}
-          else {213,255,170}),
-          fillPattern=FillPattern.Solid),
-          Rectangle(
-          extent={{-98,98},{-78,78}},
-          lineColor= DynamicSelect({255,255,255},
-          if fluid==1 then {0,0,255}
-          else if fluid==2 then {238,46,47}
-          else if fluid==3 then {0,140,72}
-          else if fluid==4 then {217,67,180}
-          else if fluid==5 then {162,29,33}
-          else if fluid==6 then {244,125,35}
-          else if fluid==7 then {102,44,145}
-          else {213,255,170}),
-          fillColor= DynamicSelect({255,255,255},
-          if fluid==1 then {0,0,255}
-          else if fluid==2 then {238,46,47}
-          else if fluid==3 then {0,140,72}
-          else if fluid==4 then {217,67,180}
-          else if fluid==5 then {162,29,33}
-          else if fluid==6 then {244,125,35}
-          else if fluid==7 then {102,44,145}
-          else {213,255,170}),
-          fillPattern=FillPattern.Solid)}), Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end FluidTypeParameterInterface;
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+partial model FluidTypeParameterInterface "Interface to display the fluid type after parametrization"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter FluidType ftype=FluidType.WaterSteam "Fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer fluid=Integer(ftype) "Fluid number" annotation(Evaluate=true);
+  parameter Boolean isCompressible=(ftype==FluidType.WaterSteam or ftype==FluidType.FlueGases or ftype==FluidType.DryAirIdealGas or ftype==FluidType.WaterSteamSimple) "Compressible fluid" annotation(Evaluate=true);
+
+public
+  Integer fluid1=Integer(ftype) "Fluid number";
+
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
+          Rectangle(
+          extent={{78,98},{98,78}},
+          lineColor= DynamicSelect({255,255,255},
+          if fluid1==1 then {0,0,255}
+          else if fluid1==2 then {238,46,47}
+          else if fluid1==3 then {0,140,72}
+          else if fluid1==4 then {217,67,180}
+          else if fluid1==5 then {162,29,33}
+          else if fluid1==6 then {244,125,35}
+          else if fluid1==7 then {102,44,145}
+          else {213,255,170}),
+          fillColor= DynamicSelect({255,255,255},
+          if fluid1==1 then {0,0,255}
+          else if fluid1==2 then {238,46,47}
+          else if fluid1==3 then {0,140,72}
+          else if fluid1==4 then {217,67,180}
+          else if fluid1==5 then {162,29,33}
+          else if fluid1==6 then {244,125,35}
+          else if fluid1==7 then {102,44,145}
+          else {213,255,170}),
+          fillPattern=FillPattern.Solid),
+          Rectangle(
+          extent={{-98,98},{-78,78}},
+          lineColor= DynamicSelect({255,255,255},
+          if fluid==1 then {0,0,255}
+          else if fluid==2 then {238,46,47}
+          else if fluid==3 then {0,140,72}
+          else if fluid==4 then {217,67,180}
+          else if fluid==5 then {162,29,33}
+          else if fluid==6 then {244,125,35}
+          else if fluid==7 then {102,44,145}
+          else {213,255,170}),
+          fillColor= DynamicSelect({255,255,255},
+          if fluid==1 then {0,0,255}
+          else if fluid==2 then {238,46,47}
+          else if fluid==3 then {0,140,72}
+          else if fluid==4 then {217,67,180}
+          else if fluid==5 then {162,29,33}
+          else if fluid==6 then {244,125,35}
+          else if fluid==7 then {102,44,145}
+          else {213,255,170}),
+          fillPattern=FillPattern.Solid)}), Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end FluidTypeParameterInterface;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeVariableInterface.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeVariableInterface.mo
index 119781ac2cff6c78cb8abc6d9122950a0b650603..5a0db7a7c3fe590384a5f06ffa3f9e8c265f364a 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeVariableInterface.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/FluidTypeVariableInterface.mo
@@ -1,36 +1,36 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-partial model FluidTypeVariableInterface "Interface to display the fluid type after simulation"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-public
-  FluidType ftype "fluid type";
-  Integer fluid1=Integer(ftype) "Fluid number";
-
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
-          Rectangle(
-          extent={{78,98},{98,78}},
-          lineColor= DynamicSelect({255,255,255},
-          if fluid1==1 then {0,0,255}
-          else if fluid1==2 then {238,46,47}
-          else if fluid1==3 then {0,140,72}
-          else if fluid1==4 then {217,67,180}
-          else if fluid1==5 then {162,29,33}
-          else if fluid1==6 then {244,125,35}
-          else if fluid1==7 then {102,44,145}
-          else {213,255,170}),
-          fillColor= DynamicSelect({255,255,255},
-          if fluid1==1 then {0,0,255}
-          else if fluid1==2 then {238,46,47}
-          else if fluid1==3 then {0,140,72}
-          else if fluid1==4 then {217,67,180}
-          else if fluid1==5 then {162,29,33}
-          else if fluid1==6 then {244,125,35}
-          else if fluid1==7 then {102,44,145}
-          else {213,255,170}),
-          fillPattern=FillPattern.Solid)}), Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end FluidTypeVariableInterface;
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+partial model FluidTypeVariableInterface "Interface to display the fluid type after simulation"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+public
+  FluidType ftype "fluid type";
+  Integer fluid1=Integer(ftype) "Fluid number";
+
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
+          Rectangle(
+          extent={{78,98},{98,78}},
+          lineColor= DynamicSelect({255,255,255},
+          if fluid1==1 then {0,0,255}
+          else if fluid1==2 then {238,46,47}
+          else if fluid1==3 then {0,140,72}
+          else if fluid1==4 then {217,67,180}
+          else if fluid1==5 then {162,29,33}
+          else if fluid1==6 then {244,125,35}
+          else if fluid1==7 then {102,44,145}
+          else {213,255,170}),
+          fillColor= DynamicSelect({255,255,255},
+          if fluid1==1 then {0,0,255}
+          else if fluid1==2 then {238,46,47}
+          else if fluid1==3 then {0,140,72}
+          else if fluid1==4 then {217,67,180}
+          else if fluid1==5 then {162,29,33}
+          else if fluid1==6 then {244,125,35}
+          else if fluid1==7 then {102,44,145}
+          else {213,255,170}),
+          fillPattern=FillPattern.Solid)}), Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end FluidTypeVariableInterface;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/IF97Region.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/IF97Region.mo
index 93d824be589f334a863646250ed0b166ff2de9d3..c15ebcd880f85817ba70843aba6d454c06fedb2b 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/IF97Region.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/IF97Region.mo
@@ -1,11 +1,11 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-type IF97Region = enumeration(
-    All_regions "All regions - IF97 is selected automatically",
-    Region_1 "Region 1 - Liquid",
-    Region_2 "Region 2 - Vapor",
-    Region_3 "Region 3",
-    Region_4 "Region 4 - Saturation line",
-    Region_5 "Region 5") "IF97 Regions" annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+type IF97Region = enumeration(
+    All_regions "All regions - IF97 is selected automatically",
+    Region_1 "Region 1 - Liquid",
+    Region_2 "Region 2 - Vapor",
+    Region_3 "Region 3",
+    Region_4 "Region 4 - Saturation line",
+    Region_5 "Region 5") "IF97 Regions" annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/WaterSteamFluidType.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/WaterSteamFluidType.mo
index a02d491375138508d0a1d668ace1afc892a6178f..a78026cf62a66c136685a9f1edbe4fa9132c9467 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/WaterSteamFluidType.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/WaterSteamFluidType.mo
@@ -1,8 +1,8 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-type WaterSteamFluidType = enumeration(
-    WaterSteam "1 - IF97 water/steam (compressible)",
-    WaterSteamSimple "7 - Simplified water/steam (compressible)") annotation (
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+type WaterSteamFluidType = enumeration(
+    WaterSteam "1 - IF97 water/steam (compressible)",
+    WaterSteamSimple "7 - Simplified water/steam (compressible)") annotation (
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/WaterSteamFluidTypeParameterInterface.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/WaterSteamFluidTypeParameterInterface.mo
index dfda8207c9c27c0b1e71ea0b4b78061e89b6bc8f..b6ecdd4e9506e3c5d2bf7c68d4bf611119811885 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/WaterSteamFluidTypeParameterInterface.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/WaterSteamFluidTypeParameterInterface.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-partial model WaterSteamFluidTypeParameterInterface "Interface to display the water/steam fluid type after parametrization"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType;
-
-  parameter WaterSteamFluidType wsftype=WaterSteamFluidType.WaterSteam "Water/steam fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer wsfluid=Integer(wsftype) "Fluid number" annotation(Evaluate=true);
-
-protected
-  parameter FluidType ftype=cvwsftype(wsftype) annotation(Evaluate=true);
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false)),
-                                            Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end WaterSteamFluidTypeParameterInterface;
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+partial model WaterSteamFluidTypeParameterInterface "Interface to display the water/steam fluid type after parametrization"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType;
+
+  parameter WaterSteamFluidType wsftype=WaterSteamFluidType.WaterSteam "Water/steam fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer wsfluid=Integer(wsftype) "Fluid number" annotation(Evaluate=true);
+
+protected
+  parameter FluidType ftype=cvwsftype(wsftype) annotation(Evaluate=true);
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)),
+                                            Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end WaterSteamFluidTypeParameterInterface;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/cvfgftype.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/cvfgftype.mo
index 4d8bf3808930d007593915877f4ef9fc44f2a798..3638b81d7660ed08937b94b12732a6f90c22495b 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/cvfgftype.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/cvfgftype.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-function cvfgftype "Converts flue gases fluid type into fluid type"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidType;
-
-  input FlueGasesFluidType fgftype;
-  output FluidType ftype;
-
-algorithm
-
-  assert(fgftype == FlueGasesFluidType.FlueGases, "cvfgftype: wrong fluid type");
-
-  ftype := FluidType.FlueGases;
-
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end cvfgftype;
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+function cvfgftype "Converts flue gases fluid type into fluid type"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidType;
+
+  input FlueGasesFluidType fgftype;
+  output FluidType ftype;
+
+algorithm
+
+  assert(fgftype == FlueGasesFluidType.FlueGases, "cvfgftype: wrong fluid type");
+
+  ftype := FluidType.FlueGases;
+
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end cvfgftype;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/cvwsftype.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/cvwsftype.mo
index c141681afb3b5c7077c8ddc72b81fcd4691238f7..6f7c7149fd050efc5a9239d9788f6a2a953c8a55 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/cvwsftype.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/cvwsftype.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-function cvwsftype "Converts water/steam fluid type into fluid type"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType;
-
-  input WaterSteamFluidType wsftype;
-  output FluidType ftype;
-
-algorithm
-
-  assert((wsftype == WaterSteamFluidType.WaterSteam) or (wsftype == WaterSteamFluidType.WaterSteamSimple), "cvwsftype: wrong fluid type");
-
-  ftype := if wsftype == WaterSteamFluidType.WaterSteam then FluidType.WaterSteam
-           else FluidType.WaterSteamSimple;
-
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end cvwsftype;
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+function cvwsftype "Converts water/steam fluid type into fluid type"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType;
+
+  input WaterSteamFluidType wsftype;
+  output FluidType ftype;
+
+algorithm
+
+  assert((wsftype == WaterSteamFluidType.WaterSteam) or (wsftype == WaterSteamFluidType.WaterSteamSimple), "cvwsftype: wrong fluid type");
+
+  ftype := if wsftype == WaterSteamFluidType.WaterSteam then FluidType.WaterSteam
+           else FluidType.WaterSteamSimple;
+
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end cvwsftype;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/isCompatible.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/isCompatible.mo
index e1a6eb19390baa309aef96e92b24b2cc7e5c41e8..38d407cf3ed9701e734990522beb5c3bd9c1fdd9 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/isCompatible.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/isCompatible.mo
@@ -1,32 +1,32 @@
-within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
-function isCompatible "Determines whether fluids are comptaible"
-  input FluidType ftype[:] "Fluid type";
-  output Boolean compatible;
-
-  /* The size of each dimension of the compatibility table must be equal to the
-  number of elements in the FluidType enumeration */
-protected
-  Boolean compatibility_table[7, 7]=
-  [true,  false, false, false, false, false, true;
-   false, true,  false, false, false, false, false;
-   false, false, true,  false, false, false, false;
-   false, false, false, true,  false, false, false;
-   false, false, false, false, true,  false, false;
-   false, false, false, false, false, true,  false;
-   true,  false, false, false, false, false, true];
-
-algorithm
-
-  compatible := true;
-
-  for i in 1:size(ftype, 1) loop
-    for j in i + 1:size(ftype, 1) loop
-      compatible := compatible and compatibility_table[Integer(ftype[i]), Integer(ftype[j])];
-    end for;
-  end for;
-
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end isCompatible;
+within ThermoSysPro.Fluid.Interfaces.PropertyInterfaces;
+function isCompatible "Determines whether fluids are comptaible"
+  input FluidType ftype[:] "Fluid type";
+  output Boolean compatible;
+
+  /* The size of each dimension of the compatibility table must be equal to the
+  number of elements in the FluidType enumeration */
+protected
+  Boolean compatibility_table[7, 7]=
+  [true,  false, false, false, false, false, true;
+   false, true,  false, false, false, false, false;
+   false, false, true,  false, false, false, false;
+   false, false, false, true,  false, false, false;
+   false, false, false, false, true,  false, false;
+   false, false, false, false, false, true,  false;
+   true,  false, false, false, false, false, true];
+
+algorithm
+
+  compatible := true;
+
+  for i in 1:size(ftype, 1) loop
+    for j in i + 1:size(ftype, 1) loop
+      compatible := compatible and compatibility_table[Integer(ftype[i]), Integer(ftype[j])];
+    end for;
+  end for;
+
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end isCompatible;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/package.mo b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/package.mo
index d0ea7ca848e796c10421ac4bb53ace0ae18648ee..eca976a0478f271094e9ccd3f3eb6f1a1aceda5f 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/package.mo
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Fluid.Interfaces;
-package PropertyInterfaces "Interface to the fluid properties package"
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end PropertyInterfaces;
+within ThermoSysPro.Fluid.Interfaces;
+package PropertyInterfaces "Interface to the fluid properties package"
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end PropertyInterfaces;
diff --git a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/package.order b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/package.order
index 8a2836c68774f37e91caf76665f47b939ae2f4ad..98b3add6db3910106011a853dc09a5101941c212 100644
--- a/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/package.order
+++ b/ThermoSysPro/Fluid/Interfaces/PropertyInterfaces/package.order
@@ -1,12 +1,12 @@
-FluidType
-FluidTypeColors
-FluidTypeParameterInterface
-FluidTypeVariableInterface
-FlueGasesFluidType
-WaterSteamFluidType
-FlueGasesFluidTypeParameterInterface
-WaterSteamFluidTypeParameterInterface
-IF97Region
-isCompatible
-cvfgftype
-cvwsftype
+FluidType
+FluidTypeColors
+FluidTypeParameterInterface
+FluidTypeVariableInterface
+FlueGasesFluidType
+WaterSteamFluidType
+FlueGasesFluidTypeParameterInterface
+WaterSteamFluidTypeParameterInterface
+IF97Region
+isCompatible
+cvfgftype
+cvwsftype
diff --git a/ThermoSysPro/Fluid/Interfaces/package.mo b/ThermoSysPro/Fluid/Interfaces/package.mo
index a909f2e9bd0b2af9fd592ccb0ae08d0a2966e3d3..4aa02baf5b89d9d47cddd862169118fd35f32ae1 100644
--- a/ThermoSysPro/Fluid/Interfaces/package.mo
+++ b/ThermoSysPro/Fluid/Interfaces/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Fluid;
-package Interfaces "Connectors"
-
-
-
-
-
-  annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Interfaces;
+within ThermoSysPro.Fluid;
+package Interfaces "Connectors"
+
+
+
+
+
+  annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Interfaces;
diff --git a/ThermoSysPro/Fluid/Interfaces/package.order b/ThermoSysPro/Fluid/Interfaces/package.order
index 6e81f3938109033d6489d0f687c568a53859c3de..f0c90ca0e7c8a767732f7c444f2bbeb8c4f2f6b0 100644
--- a/ThermoSysPro/Fluid/Interfaces/package.order
+++ b/ThermoSysPro/Fluid/Interfaces/package.order
@@ -1,3 +1,3 @@
-IconColors
-Connectors
-PropertyInterfaces
+IconColors
+Connectors
+PropertyInterfaces
diff --git a/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo b/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo
index 7742a2b04eafda5fcf9cb7cc8830fc9b9325ed80..1f14a681071ba852e085f42496415f9ba301f0c9 100644
--- a/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo
+++ b/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo
@@ -1,189 +1,189 @@
-within ThermoSysPro.Fluid.Junctions;
-model DeheaterMixer2
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Temperature Tmax=700 "Maximum fluid temperature";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P(start=50e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T(start=700) "Fluid temperature";
-  Units.SI.SpecificEnthalpy hmax(start=10e5) "Maximum fluid specific enthalpy";
-  FluidType fluids[4] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je "Thermal power diffusion from inlet e";
-  Units.SI.Power Je_mix "Thermal power diffusion from inlet e_mix";
-  Units.SI.Power Js "Thermal power diffusion from outlet s";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
-  Units.SI.MassFlowRate gamma_e_mix "Diffusion conductance for inlet e_mix";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
-  Real re "Value of r(Q/gamma) for inlet e";
-  Real re_mix "Value of r(Q/gamma) for inlet e_mix";
-  Real rs "Value of r(Q/gamma) for outlet s";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_mix annotation (
-      Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
-        transformation(extent={{90,50},{110,70}}, rotation=0)));
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
-        transformation(extent={{-110,50},{-90,70}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = Ce_mix.ftype;
-  fluids[4] = Cs.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "DeheaterMixer2: fluids mixing in volume are not compatible with each other");
-
-  /* Mass balance equation */
-  0 = Ce.Q + Ce_mix.Q - Cs.Q;
-
-  P = Ce.P;
-  P = Ce_mix.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  0 = Ce.Q*Ce.h + Ce_mix.Q*Ce_mix.h - Cs.Q*Cs.h + J;
-
-  Ce.h_vol_2 = h;
-  Ce_mix.h_vol_2 = h;
-  Cs.h_vol_1 = h;
-
-  /* The flow at the mixing inlet is such as to ensure T <= Tmax */
-  if T <= Tmax then
-    Ce_mix.Q = 0;
-  else
-    h = hmax;
-  end if;
-
-  /* Fluid composition balance equations */
-  0 = Ce.Xco2*Ce.Q + Ce_mix.Xco2*Ce_mix.Q - Cs.Xco2*Cs.Q;
-  0 = Ce.Xh2o*Ce.Q + Ce_mix.Xh2o*Ce_mix.Q - Cs.Xh2o*Cs.Q;
-  0 = Ce.Xo2*Ce.Q + Ce_mix.Xo2*Ce_mix.Q - Cs.Xo2*Cs.Q;
-  0 = Ce.Xso2*Ce.Q + Ce_mix.Xso2*Ce_mix.Q - Cs.Xso2*Cs.Q;
-
-  Cs.ftype = ftype;
-
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2  = Xo2;
-  Cs.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-  else
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    re_mix = if Ce_mix.diff_on_1 then exp(-0.033*(Ce_mix.Q*Ce_mix.diff_res_1)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_e_mix = if Ce_mix.diff_on_1 then 1/Ce_mix.diff_res_1 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    Je_mix = if Ce_mix.diff_on_1 then re_mix*gamma_e_mix*(Ce_mix.h_vol_1 - Ce_mix.h_vol_2) else 0;
-    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-  else
-    re = 0;
-    re_mix = 0;
-    rs = 0;
-
-    gamma_e = gamma0;
-    gamma_e_mix = gamma0;
-    gamma_s = gamma0;
-
-    Je = 0;
-    Je_mix = 0;
-    Js = 0;
-  end if;
-
-  J = Je + Je_mix + Js;
-
-  Ce.diff_res_2 = 0;
-  Ce_mix.diff_res_2 = 0;
-  Cs.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  Ce_mix.diff_on_2 = diffusion;
-  Cs.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
-
-  hmax = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, Tmax, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{
-              100,40},{100,80},{-100,80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-16,72},{16,46}},
-          lineColor={0,0,255},
-          textString=
-               "D")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{
-              100,40},{100,80},{-100,80}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-18,78},{22,38}},
-          lineColor={0,0,255},
-          textString=
-               "D")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DeheaterMixer2;
+within ThermoSysPro.Fluid.Junctions;
+model DeheaterMixer2
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Temperature Tmax=700 "Maximum fluid temperature";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P(start=50e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T(start=700) "Fluid temperature";
+  Units.SI.SpecificEnthalpy hmax(start=10e5) "Maximum fluid specific enthalpy";
+  FluidType fluids[4] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je "Thermal power diffusion from inlet e";
+  Units.SI.Power Je_mix "Thermal power diffusion from inlet e_mix";
+  Units.SI.Power Js "Thermal power diffusion from outlet s";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
+  Units.SI.MassFlowRate gamma_e_mix "Diffusion conductance for inlet e_mix";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
+  Real re "Value of r(Q/gamma) for inlet e";
+  Real re_mix "Value of r(Q/gamma) for inlet e_mix";
+  Real rs "Value of r(Q/gamma) for outlet s";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_mix annotation (
+      Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
+        transformation(extent={{90,50},{110,70}}, rotation=0)));
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
+        transformation(extent={{-110,50},{-90,70}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = Ce_mix.ftype;
+  fluids[4] = Cs.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "DeheaterMixer2: fluids mixing in volume are not compatible with each other");
+
+  /* Mass balance equation */
+  0 = Ce.Q + Ce_mix.Q - Cs.Q;
+
+  P = Ce.P;
+  P = Ce_mix.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  0 = Ce.Q*Ce.h + Ce_mix.Q*Ce_mix.h - Cs.Q*Cs.h + J;
+
+  Ce.h_vol_2 = h;
+  Ce_mix.h_vol_2 = h;
+  Cs.h_vol_1 = h;
+
+  /* The flow at the mixing inlet is such as to ensure T <= Tmax */
+  if T <= Tmax then
+    Ce_mix.Q = 0;
+  else
+    h = hmax;
+  end if;
+
+  /* Fluid composition balance equations */
+  0 = Ce.Xco2*Ce.Q + Ce_mix.Xco2*Ce_mix.Q - Cs.Xco2*Cs.Q;
+  0 = Ce.Xh2o*Ce.Q + Ce_mix.Xh2o*Ce_mix.Q - Cs.Xh2o*Cs.Q;
+  0 = Ce.Xo2*Ce.Q + Ce_mix.Xo2*Ce_mix.Q - Cs.Xo2*Cs.Q;
+  0 = Ce.Xso2*Ce.Q + Ce_mix.Xso2*Ce_mix.Q - Cs.Xso2*Cs.Q;
+
+  Cs.ftype = ftype;
+
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2  = Xo2;
+  Cs.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+  else
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    re_mix = if Ce_mix.diff_on_1 then exp(-0.033*(Ce_mix.Q*Ce_mix.diff_res_1)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_e_mix = if Ce_mix.diff_on_1 then 1/Ce_mix.diff_res_1 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    Je_mix = if Ce_mix.diff_on_1 then re_mix*gamma_e_mix*(Ce_mix.h_vol_1 - Ce_mix.h_vol_2) else 0;
+    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+  else
+    re = 0;
+    re_mix = 0;
+    rs = 0;
+
+    gamma_e = gamma0;
+    gamma_e_mix = gamma0;
+    gamma_s = gamma0;
+
+    Je = 0;
+    Je_mix = 0;
+    Js = 0;
+  end if;
+
+  J = Je + Je_mix + Js;
+
+  Ce.diff_res_2 = 0;
+  Ce_mix.diff_res_2 = 0;
+  Cs.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  Ce_mix.diff_on_2 = diffusion;
+  Cs.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
+
+  hmax = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, Tmax, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{
+              100,40},{100,80},{-100,80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-16,72},{16,46}},
+          lineColor={0,0,255},
+          textString=
+               "D")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{
+              100,40},{100,80},{-100,80}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-18,78},{22,38}},
+          lineColor={0,0,255},
+          textString=
+               "D")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DeheaterMixer2;
diff --git a/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo b/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo
index 600594dd8b65e822c0bd4b604115571a772cc99f..ff06492f87618771458db374bca36d84cd209e2c 100644
--- a/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo
+++ b/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo
@@ -1,174 +1,174 @@
-within ThermoSysPro.Fluid.Junctions;
-model MassFlowMultiplier "Mass flow multipliier"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real alpha=2 "Flow multiplier";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.Density rho(start=998) "Fluid density";
-  FluidType fluids[3] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je "Thermal power diffusion from inlet e";
-  Units.SI.Power Js "Thermal power diffusion from outlet s";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
-  Real re "Value of r(Q/gamma) for inlet e";
-  Real rs "Value of r(Q/gamma) for outlet s";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = Cs.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "MassFlowMultiplier: fluids mixing in volume are not compatible with each other");
-
-  /* Mass balance equation */
-  0 = alpha*Ce.Q - Cs.Q;
-
-  P = Ce.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  0 = alpha*Ce.Q*Ce.h - Cs.Q*Cs.h + J;
-
-  Ce.h_vol_2 = h;
-  Cs.h_vol_1 = h;
-
-  /* Fluid composition */
-  0 = Ce.Xco2*alpha*Ce.Q - Cs.Xco2*Cs.Q;
-  0 = Ce.Xh2o*alpha*Ce.Q - Cs.Xh2o*Cs.Q;
-  0 = Ce.Xo2*alpha*Ce.Q - Cs.Xo2*Cs.Q;
-  0 = Ce.Xso2*alpha*Ce.Q - Cs.Xso2*Cs.Q;
-
-  Cs.ftype = ftype;
-
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2  = Xo2;
-  Cs.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-  else
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-  else
-    re = 0;
-    rs = 0;
-
-    gamma_e = gamma0;
-    gamma_s = gamma0;
-
-    Je = 0;
-    Js = 0;
-  end if;
-
-  J = Je + Js;
-
-  Ce.diff_res_2 = 0;
-  Cs.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  Cs.diff_on_1 = diffusion;
-
- /* Fluid thermodynamic properties */
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P,h,fluid,mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,60},{-100,-60},{90,0},{-100,60}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,0}), Text(
-          extent={{-60,24},{-20,-16}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "%alpha")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,60},{-100,-60},{90,0},{-100,60}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-60,24},{-20,-16}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "%alpha")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end MassFlowMultiplier;
+within ThermoSysPro.Fluid.Junctions;
+model MassFlowMultiplier "Mass flow multipliier"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real alpha=2 "Flow multiplier";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.Density rho(start=998) "Fluid density";
+  FluidType fluids[3] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je "Thermal power diffusion from inlet e";
+  Units.SI.Power Js "Thermal power diffusion from outlet s";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
+  Real re "Value of r(Q/gamma) for inlet e";
+  Real rs "Value of r(Q/gamma) for outlet s";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = Cs.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "MassFlowMultiplier: fluids mixing in volume are not compatible with each other");
+
+  /* Mass balance equation */
+  0 = alpha*Ce.Q - Cs.Q;
+
+  P = Ce.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  0 = alpha*Ce.Q*Ce.h - Cs.Q*Cs.h + J;
+
+  Ce.h_vol_2 = h;
+  Cs.h_vol_1 = h;
+
+  /* Fluid composition */
+  0 = Ce.Xco2*alpha*Ce.Q - Cs.Xco2*Cs.Q;
+  0 = Ce.Xh2o*alpha*Ce.Q - Cs.Xh2o*Cs.Q;
+  0 = Ce.Xo2*alpha*Ce.Q - Cs.Xo2*Cs.Q;
+  0 = Ce.Xso2*alpha*Ce.Q - Cs.Xso2*Cs.Q;
+
+  Cs.ftype = ftype;
+
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2  = Xo2;
+  Cs.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+  else
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+  else
+    re = 0;
+    rs = 0;
+
+    gamma_e = gamma0;
+    gamma_s = gamma0;
+
+    Je = 0;
+    Js = 0;
+  end if;
+
+  J = Je + Js;
+
+  Ce.diff_res_2 = 0;
+  Cs.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  Cs.diff_on_1 = diffusion;
+
+ /* Fluid thermodynamic properties */
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P,h,fluid,mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,60},{-100,-60},{90,0},{-100,60}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,0}), Text(
+          extent={{-60,24},{-20,-16}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "%alpha")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,60},{-100,-60},{90,0},{-100,60}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-60,24},{-20,-16}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "%alpha")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end MassFlowMultiplier;
diff --git a/ThermoSysPro/Fluid/Junctions/Mixer2.mo b/ThermoSysPro/Fluid/Junctions/Mixer2.mo
index a1bdb32523ada095eaadb84813790b3278403d92..a6d9694a6db30581cce48f893981e26b6e957d89 100644
--- a/ThermoSysPro/Fluid/Junctions/Mixer2.mo
+++ b/ThermoSysPro/Fluid/Junctions/Mixer2.mo
@@ -1,200 +1,200 @@
-within ThermoSysPro.Fluid.Junctions;
-model Mixer2 "Mixer with two inlets"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  FluidType fluids[4] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Js "Thermal power diffusion from outlet s";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real rs "Value of r(Q/gamma) for outlet s";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-50,-110},{-30,-90}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-50,90},{-30,110}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for inlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Cs.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "Mixer2: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.5;
-  end if;
-
-  /* Mass balance equation */
-  0 = Ce1.Q + Ce2.Q - Cs.Q;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs.Q*Cs.h + J;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Cs.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs.Xco2*Cs.Q;
-  0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs.Xh2o*Cs.Q;
-  0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs.Xo2*Cs.Q;
-  0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs.Xso2*Cs.Q;
-
-  Cs.ftype = ftype;
-
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2  = Xo2;
-  Cs.Xso2 = Xso2;
-
-  /* Mass flow at the outlet */
-  if (cardinality(Ialpha1) <> 0) then
-    Ce1.Q = Ialpha1.signal*Cs.Q;
-  end if;
-
-  alpha1 = if noEvent(abs(Cs.Q) > 0) then Ce1.Q/Cs.Q else Modelica.Constants.inf;
-  Oalpha1.signal = alpha1;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-  else
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    rs = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_s = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Js = 0;
-  end if;
-
-  J = Je1 + Je2 + Js;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Cs.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Cs.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
-              -20,100},{-60,100},{-60,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-60,80},{-20,40}}, textString=
-                                     "1"),
-        Text(extent={{-60,-40},{-20,-80}}, textString=
-                             "2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
-              -20,100},{-60,100},{-60,-100}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-56,90},{-24,66}}, textString=
-                                     "1"),
-        Text(extent={{-50,-66},{-30,-88}}, textString=
-                             "2")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Mixer2;
+within ThermoSysPro.Fluid.Junctions;
+model Mixer2 "Mixer with two inlets"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  FluidType fluids[4] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Js "Thermal power diffusion from outlet s";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real rs "Value of r(Q/gamma) for outlet s";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-50,-110},{-30,-90}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-50,90},{-30,110}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for inlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Cs.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "Mixer2: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.5;
+  end if;
+
+  /* Mass balance equation */
+  0 = Ce1.Q + Ce2.Q - Cs.Q;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs.Q*Cs.h + J;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Cs.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs.Xco2*Cs.Q;
+  0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs.Xh2o*Cs.Q;
+  0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs.Xo2*Cs.Q;
+  0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs.Xso2*Cs.Q;
+
+  Cs.ftype = ftype;
+
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2  = Xo2;
+  Cs.Xso2 = Xso2;
+
+  /* Mass flow at the outlet */
+  if (cardinality(Ialpha1) <> 0) then
+    Ce1.Q = Ialpha1.signal*Cs.Q;
+  end if;
+
+  alpha1 = if noEvent(abs(Cs.Q) > 0) then Ce1.Q/Cs.Q else Modelica.Constants.inf;
+  Oalpha1.signal = alpha1;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+  else
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    rs = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_s = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Js = 0;
+  end if;
+
+  J = Je1 + Je2 + Js;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Cs.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Cs.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
+              -20,100},{-60,100},{-60,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-60,80},{-20,40}}, textString=
+                                     "1"),
+        Text(extent={{-60,-40},{-20,-80}}, textString=
+                             "2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
+              -20,100},{-60,100},{-60,-100}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-56,90},{-24,66}}, textString=
+                                     "1"),
+        Text(extent={{-50,-66},{-30,-88}}, textString=
+                             "2")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Mixer2;
diff --git a/ThermoSysPro/Fluid/Junctions/Mixer3.mo b/ThermoSysPro/Fluid/Junctions/Mixer3.mo
index 0bf2fc015263c16222f5516e9ac2798bb2e96baa..416248907b70df7f3fe19736aecb44fdd0f2f94c 100644
--- a/ThermoSysPro/Fluid/Junctions/Mixer3.mo
+++ b/ThermoSysPro/Fluid/Junctions/Mixer3.mo
@@ -1,237 +1,237 @@
-within ThermoSysPro.Fluid.Junctions;
-model Mixer3 "Mixer with three inlets"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
-  Real alpha2 "Extraction coefficient for inlet 2 (<=1)";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  FluidType fluids[5] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
-  Units.SI.Power Js "Thermal power diffusion from outlet s";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real re3 "Value of r(Q/gamma) for inlet e3";
-  Real rs "Value of r(Q/gamma) for outlet s";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-50,-110},{-30,-90}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-50,90},{-30,110}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for inlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha2
-    "Extraction coefficient for inlet 2 (<=1)"
-    annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}, rotation=
-           0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha2
-    annotation (Placement(transformation(extent={{-20,-70},{0,-50}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Ce3.ftype;
-  fluids[5] = Cs.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "Mixer3: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.3;
-  end if;
-
-  if (cardinality(Ialpha2) == 0) then
-    Ialpha2.signal = 0.3;
-  end if;
-
-  /* Mass balance equation */
-  0 = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + J;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Ce3.h_vol_2 = h;
-  Cs.h_vol_1 = h;
-
-  /* Mass flow at the outlet */
-  if (cardinality(Ialpha1) <> 0) then
-    Ce1.Q = Ialpha1.signal*Cs.Q;
-  end if;
-
-  if (cardinality(Ialpha2) <> 0) then
-    Ce2.Q = Ialpha2.signal*Cs.Q;
-  end if;
-
-  alpha1 = if noEvent(abs(Cs.Q) > 0) then Ce1.Q/Cs.Q else Modelica.Constants.inf;
-  Oalpha1.signal = alpha1;
-
-  alpha2 = if noEvent(abs(Cs.Q) > 0) then Ce2.Q/Cs.Q else Modelica.Constants.inf;
-  Oalpha2.signal = alpha2;
-
-  /* Fluid composition balance equations */
-  0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q;
-  0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q  - Cs.Xh2o*Cs.Q;
-  0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q  - Cs.Xo2*Cs.Q;
-  0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q  - Cs.Xso2*Cs.Q;
-
-  Cs.ftype = ftype;
-
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2  = Xo2;
-  Cs.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-  else
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
-    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    re3 = 0;
-    rs = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_e3 = gamma0;
-    gamma_s = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Je3 = 0;
-    Js = 0;
-  end if;
-
-  J = Je1 + Je2 + Je3 + Js;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Ce3.diff_res_2 = 0;
-  Cs.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Ce3.diff_on_2 = diffusion;
-  Cs.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{
-              -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60,
-              100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-60,80},{-20,40}}, textString=
-                                     "1"),
-        Text(extent={{-60,-40},{-20,-80}}, textString=
-                             "2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{
-              -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60,
-              100}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-50,88},{-32,72}}, textString=
-                                     "1"),
-        Text(extent={{-54,-72},{-26,-88}}, textString=
-                             "2")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Mixer3;
+within ThermoSysPro.Fluid.Junctions;
+model Mixer3 "Mixer with three inlets"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
+  Real alpha2 "Extraction coefficient for inlet 2 (<=1)";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  FluidType fluids[5] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
+  Units.SI.Power Js "Thermal power diffusion from outlet s";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real re3 "Value of r(Q/gamma) for inlet e3";
+  Real rs "Value of r(Q/gamma) for outlet s";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-50,-110},{-30,-90}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-50,90},{-30,110}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for inlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha2
+    "Extraction coefficient for inlet 2 (<=1)"
+    annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}, rotation=
+           0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha2
+    annotation (Placement(transformation(extent={{-20,-70},{0,-50}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Ce3.ftype;
+  fluids[5] = Cs.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "Mixer3: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.3;
+  end if;
+
+  if (cardinality(Ialpha2) == 0) then
+    Ialpha2.signal = 0.3;
+  end if;
+
+  /* Mass balance equation */
+  0 = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + J;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Ce3.h_vol_2 = h;
+  Cs.h_vol_1 = h;
+
+  /* Mass flow at the outlet */
+  if (cardinality(Ialpha1) <> 0) then
+    Ce1.Q = Ialpha1.signal*Cs.Q;
+  end if;
+
+  if (cardinality(Ialpha2) <> 0) then
+    Ce2.Q = Ialpha2.signal*Cs.Q;
+  end if;
+
+  alpha1 = if noEvent(abs(Cs.Q) > 0) then Ce1.Q/Cs.Q else Modelica.Constants.inf;
+  Oalpha1.signal = alpha1;
+
+  alpha2 = if noEvent(abs(Cs.Q) > 0) then Ce2.Q/Cs.Q else Modelica.Constants.inf;
+  Oalpha2.signal = alpha2;
+
+  /* Fluid composition balance equations */
+  0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q;
+  0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q  - Cs.Xh2o*Cs.Q;
+  0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q  - Cs.Xo2*Cs.Q;
+  0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q  - Cs.Xso2*Cs.Q;
+
+  Cs.ftype = ftype;
+
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2  = Xo2;
+  Cs.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+  else
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
+    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    re3 = 0;
+    rs = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_e3 = gamma0;
+    gamma_s = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Je3 = 0;
+    Js = 0;
+  end if;
+
+  J = Je1 + Je2 + Je3 + Js;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Ce3.diff_res_2 = 0;
+  Cs.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Ce3.diff_on_2 = diffusion;
+  Cs.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{
+              -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60,
+              100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-60,80},{-20,40}}, textString=
+                                     "1"),
+        Text(extent={{-60,-40},{-20,-80}}, textString=
+                             "2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{
+              -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60,
+              100}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-50,88},{-32,72}}, textString=
+                                     "1"),
+        Text(extent={{-54,-72},{-26,-88}}, textString=
+                             "2")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Mixer3;
diff --git a/ThermoSysPro/Fluid/Junctions/Mixer8.mo b/ThermoSysPro/Fluid/Junctions/Mixer8.mo
index 97d0cc73dba3fd3901aeffb0b03b7f15256e51ad..18896d8ad2906a53598f33713286a9cbf4d8a90e 100644
--- a/ThermoSysPro/Fluid/Junctions/Mixer8.mo
+++ b/ThermoSysPro/Fluid/Junctions/Mixer8.mo
@@ -1,433 +1,433 @@
-within ThermoSysPro.Fluid.Junctions;
-model Mixer8 "Mixer with eight inlets"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  FluidType fluids[10] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
-  Units.SI.Power Je4 "Thermal power diffusion from inlet e4";
-  Units.SI.Power Je5 "Thermal power diffusion from inlet e5";
-  Units.SI.Power Je6 "Thermal power diffusion from inlet e6";
-  Units.SI.Power Je7 "Thermal power diffusion from inlet e7";
-  Units.SI.Power Je8 "Thermal power diffusion from inlet e8";
-  Units.SI.Power Js "Thermal power diffusion from outlet s";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
-  Units.SI.MassFlowRate gamma_e4 "Diffusion conductance for inlet e4";
-  Units.SI.MassFlowRate gamma_e5 "Diffusion conductance for inlet e5";
-  Units.SI.MassFlowRate gamma_e6 "Diffusion conductance for inlet e6";
-  Units.SI.MassFlowRate gamma_e7 "Diffusion conductance for inlet e7";
-  Units.SI.MassFlowRate gamma_e8 "Diffusion conductance for inlet e8";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real re3 "Value of r(Q/gamma) for inlet e3";
-  Real re4 "Value of r(Q/gamma) for inlet e4";
-  Real re5 "Value of r(Q/gamma) for inlet e5";
-  Real re6 "Value of r(Q/gamma) for inlet e6";
-  Real re7 "Value of r(Q/gamma) for inlet e7";
-  Real re8 "Value of r(Q/gamma) for inlet e8";
-  Real rs
-         "Value of r(Q/gamma) for outlet s";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce5 annotation (layer=
-        "icon", Placement(transformation(extent={{-110,-50},{-90,-30}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce6 annotation (layer=
-        "icon", Placement(transformation(extent={{-112,-109},{-92,-89}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce7 annotation (layer=
-        "icon", Placement(transformation(extent={{-40,-109},{-20,-89}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (layer=
-        "icon", Placement(transformation(extent={{-112,90},{-92,110}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (layer=
-        "icon", Placement(transformation(extent={{-40,90},{-20,110}}, rotation=
-            0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (layer=
-        "icon", Placement(transformation(extent={{20,92},{40,112}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (layer=
-        "icon", Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce8 annotation (layer=
-        "icon", Placement(transformation(extent={{20,-109},{40,-89}}, rotation=
-            0)));
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4 annotation (layer=
-        "icon", Placement(transformation(extent={{-112,30},{-92,50}}, rotation=
-            0)));
-equation
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Ce3.ftype;
-  fluids[5] = Ce4.ftype;
-  fluids[6] = Ce5.ftype;
-  fluids[7] = Ce6.ftype;
-  fluids[8] = Ce7.ftype;
-  fluids[9] = Ce8.ftype;
-  fluids[10] = Cs.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "Mixer8: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.h_vol_1 = 1.e5;
-    Ce3.diff_res_1 = 0;
-    Ce3.diff_on_1 = false;
-    Ce3.ftype = ftype;
-    Ce3.Xco2 = 0;
-    Ce3.Xh2o = 0;
-    Ce3.Xo2 = 0;
-    Ce3.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce4) == 0) then
-    Ce4.Q = 0;
-    Ce4.h = 1.e5;
-    Ce4.h_vol_1 = 1.e5;
-    Ce4.diff_res_1 = 0;
-    Ce4.diff_on_1 = false;
-    Ce4.ftype = ftype;
-    Ce4.Xco2 = 0;
-    Ce4.Xh2o = 0;
-    Ce4.Xo2 = 0;
-    Ce4.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce5) == 0) then
-    Ce5.Q = 0;
-    Ce5.h = 1.e5;
-    Ce5.h_vol_1 = 1.e5;
-    Ce5.diff_res_1 = 0;
-    Ce5.diff_on_1 = false;
-    Ce5.ftype = ftype;
-    Ce5.Xco2 = 0;
-    Ce5.Xh2o = 0;
-    Ce5.Xo2 = 0;
-    Ce5.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce6) == 0) then
-    Ce6.Q = 0;
-    Ce6.h = 1.e5;
-    Ce6.h_vol_1 = 1.e5;
-    Ce6.diff_res_1 = 0;
-    Ce6.diff_on_1 = false;
-    Ce6.ftype = ftype;
-    Ce6.Xco2 = 0;
-    Ce6.Xh2o = 0;
-    Ce6.Xo2 = 0;
-    Ce6.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce7) == 0) then
-    Ce7.Q = 0;
-    Ce7.h = 1.e5;
-    Ce7.h_vol_1 = 1.e5;
-    Ce7.diff_res_1 = 0;
-    Ce7.diff_on_1 = false;
-    Ce7.ftype = ftype;
-    Ce7.Xco2 = 0;
-    Ce7.Xh2o = 0;
-    Ce7.Xo2 = 0;
-    Ce7.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce8) == 0) then
-    Ce8.Q = 0;
-    Ce8.h = 1.e5;
-    Ce8.h_vol_1 = 1.e5;
-    Ce8.diff_res_1 = 0;
-    Ce8.diff_on_1 = false;
-    Ce8.ftype = ftype;
-    Ce8.Xco2 = 0;
-    Ce8.Xh2o = 0;
-    Ce8.Xo2 = 0;
-    Ce8.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h_vol_2 = 1.e5;
-    Cs.diff_res_2 = 0;
-    Cs.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  0 = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q + Ce5.Q + Ce6.Q + Ce7.Q + Ce8.Q - Cs.Q;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Ce4.P;
-  P = Ce5.P;
-  P = Ce6.P;
-  P = Ce7.P;
-  P = Ce8.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h + Ce5.Q*Ce5.h + Ce6.Q*Ce6.h + Ce7.Q*Ce7.h + Ce8.Q*Ce8.h - Cs.Q*Cs.h + J;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Ce3.h_vol_2 = h;
-  Ce4.h_vol_2 = h;
-  Ce5.h_vol_2 = h;
-  Ce6.h_vol_2 = h;
-  Ce7.h_vol_2 = h;
-  Ce8.h_vol_2 = h;
-  Cs.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q  + Ce5.Xco2*Ce5.Q  + Ce6.Xco2*Ce6.Q  + Ce7.Xco2*Ce7.Q  + Ce8.Xco2*Ce8.Q  - Cs.Xco2*Cs.Q;
-  0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q   + Ce5.Xh2o*Ce5.Q   + Ce6.Xh2o*Ce6.Q   + Ce7.Xh2o*Ce7.Q   + Ce8.Xh2o*Ce8.Q    - Cs.Xh2o*Cs.Q;
-  0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q  + Ce5.Xo2*Ce5.Q  + Ce6.Xo2*Ce6.Q  + Ce7.Xo2*Ce7.Q  + Ce8.Xo2*Ce8.Q   - Cs.Xo2*Cs.Q;
-  0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q  + Ce5.Xso2*Ce5.Q  + Ce6.Xso2*Ce6.Q  + Ce7.Xso2*Ce7.Q  + Ce8.Xso2*Ce8.Q   - Cs.Xso2*Cs.Q;
-
-  Cs.ftype = ftype;
-
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2  = Xo2;
-  Cs.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-  else
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
-    re4 = if Ce4.diff_on_1 then exp(-0.033*(Ce4.Q*Ce4.diff_res_1)^2) else 0;
-    re5 = if Ce5.diff_on_1 then exp(-0.033*(Ce5.Q*Ce5.diff_res_1)^2) else 0;
-    re6 = if Ce6.diff_on_1 then exp(-0.033*(Ce6.Q*Ce6.diff_res_1)^2) else 0;
-    re7 = if Ce7.diff_on_1 then exp(-0.033*(Ce7.Q*Ce7.diff_res_1)^2) else 0;
-    re8 = if Ce8.diff_on_1 then exp(-0.033*(Ce8.Q*Ce8.diff_res_1)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
-    gamma_e4 = if Ce4.diff_on_1 then 1/Ce4.diff_res_1 else gamma0;
-    gamma_e5 = if Ce5.diff_on_1 then 1/Ce5.diff_res_1 else gamma0;
-    gamma_e6 = if Ce6.diff_on_1 then 1/Ce6.diff_res_1 else gamma0;
-    gamma_e7 = if Ce7.diff_on_1 then 1/Ce7.diff_res_1 else gamma0;
-    gamma_e8 = if Ce8.diff_on_1 then 1/Ce8.diff_res_1 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
-    Je4 = if Ce4.diff_on_1 then re4*gamma_e4*(Ce4.h_vol_1 - Ce4.h_vol_2) else 0;
-    Je5 = if Ce5.diff_on_1 then re5*gamma_e5*(Ce5.h_vol_1 - Ce5.h_vol_2) else 0;
-    Je6 = if Ce6.diff_on_1 then re6*gamma_e6*(Ce6.h_vol_1 - Ce6.h_vol_2) else 0;
-    Je7 = if Ce7.diff_on_1 then re7*gamma_e7*(Ce7.h_vol_1 - Ce7.h_vol_2) else 0;
-    Je8 = if Ce8.diff_on_1 then re8*gamma_e8*(Ce8.h_vol_1 - Ce8.h_vol_2) else 0;
-    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    re3 = 0;
-    re4 = 0;
-    re5 = 0;
-    re6 = 0;
-    re7 = 0;
-    re8 = 0;
-    rs = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_e3 = gamma0;
-    gamma_e4 = gamma0;
-    gamma_e5 = gamma0;
-    gamma_e6 = gamma0;
-    gamma_e7 = gamma0;
-    gamma_e8 = gamma0;
-    gamma_s = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Je3 = 0;
-    Je4 = 0;
-    Je5 = 0;
-    Je6 = 0;
-    Je7 = 0;
-    Je8 = 0;
-    Js = 0;
-  end if;
-
-  J = Je1 + Je2 + Je3 + Je4 + Je5 + Je6 + Je7 + Je8 + Js;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Ce3.diff_res_2 = 0;
-  Ce4.diff_res_2 = 0;
-  Ce5.diff_res_2 = 0;
-  Ce6.diff_res_2 = 0;
-  Ce7.diff_res_2 = 0;
-  Ce8.diff_res_2 = 0;
-  Cs.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Ce3.diff_on_2 = diffusion;
-  Ce4.diff_on_2 = diffusion;
-  Ce5.diff_on_2 = diffusion;
-  Ce6.diff_on_2 = diffusion;
-  Ce7.diff_on_2 = diffusion;
-  Ce8.diff_on_2 = diffusion;
-  Cs.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{40,0},{92,0}}),
-        Line(points={{-92,-40},{-40,-40}}),
-        Line(points={{-30,90},{-30,66}}, color={0,0,255}),
-        Line(points={{30,92},{30,66}}, color={0,0,255}),
-        Line(points={{-30,-66},{-30,-90}}, color={0,0,255}),
-        Line(points={{30,-66},{30,-90}}, color={0,0,255}),
-        Line(points={{-92,40},{-40,40}}),
-        Line(points={{-38,-52},{-92,-90}}, color={0,0,255}),
-        Line(points={{-38,54},{-92,90}}, color={0,0,255}),
-        Polygon(points={{-40,40},{-38,54},{-34,60},{-24,72},{-8,80},{6,80},{18,
-              76},{26,70},{34,62},{38,52},{40,46},{40,40},{40,38},{40,34},{40,
-              -40},{40,-46},{36,-58},{30,-66},{24,-72},{16,-76},{6,-80},{0,-80},
-              {-4,-80},{-8,-80},{-18,-76},{-28,-70},{-34,-60},{-36,-58},{-38,
-              -54},{-38,-52},{-40,-46},{-40,-40},{-40,0},{-40,40}}, lineColor={
-              28,108,200})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(points={{-30,90},{-30,66}}, color={0,0,255}),
-        Line(points={{-30,-66},{-30,-90}}, color={0,0,255}),
-        Line(points={{30,92},{30,66}}, color={0,0,255}),
-        Line(points={{30,-66},{30,-90}}, color={0,0,255}),
-        Line(points={{-92,40},{-40,40}}),
-        Line(points={{-92,-40},{-40,-40}}),
-        Line(points={{40,0},{92,0}}),
-        Line(points={{-38,-52},{-92,-90}}, color={0,0,255}),
-        Line(points={{-38,54},{-92,90}}, color={0,0,255})}),
-    Window(
-      x=0.05,
-      y=0.07,
-      width=0.74,
-      height=0.85),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Mixer8;
+within ThermoSysPro.Fluid.Junctions;
+model Mixer8 "Mixer with eight inlets"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  FluidType fluids[10] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
+  Units.SI.Power Je4 "Thermal power diffusion from inlet e4";
+  Units.SI.Power Je5 "Thermal power diffusion from inlet e5";
+  Units.SI.Power Je6 "Thermal power diffusion from inlet e6";
+  Units.SI.Power Je7 "Thermal power diffusion from inlet e7";
+  Units.SI.Power Je8 "Thermal power diffusion from inlet e8";
+  Units.SI.Power Js "Thermal power diffusion from outlet s";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
+  Units.SI.MassFlowRate gamma_e4 "Diffusion conductance for inlet e4";
+  Units.SI.MassFlowRate gamma_e5 "Diffusion conductance for inlet e5";
+  Units.SI.MassFlowRate gamma_e6 "Diffusion conductance for inlet e6";
+  Units.SI.MassFlowRate gamma_e7 "Diffusion conductance for inlet e7";
+  Units.SI.MassFlowRate gamma_e8 "Diffusion conductance for inlet e8";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real re3 "Value of r(Q/gamma) for inlet e3";
+  Real re4 "Value of r(Q/gamma) for inlet e4";
+  Real re5 "Value of r(Q/gamma) for inlet e5";
+  Real re6 "Value of r(Q/gamma) for inlet e6";
+  Real re7 "Value of r(Q/gamma) for inlet e7";
+  Real re8 "Value of r(Q/gamma) for inlet e8";
+  Real rs
+         "Value of r(Q/gamma) for outlet s";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce5 annotation (layer=
+        "icon", Placement(transformation(extent={{-110,-50},{-90,-30}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce6 annotation (layer=
+        "icon", Placement(transformation(extent={{-112,-109},{-92,-89}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce7 annotation (layer=
+        "icon", Placement(transformation(extent={{-40,-109},{-20,-89}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (layer=
+        "icon", Placement(transformation(extent={{-112,90},{-92,110}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (layer=
+        "icon", Placement(transformation(extent={{-40,90},{-20,110}}, rotation=
+            0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (layer=
+        "icon", Placement(transformation(extent={{20,92},{40,112}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (layer=
+        "icon", Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce8 annotation (layer=
+        "icon", Placement(transformation(extent={{20,-109},{40,-89}}, rotation=
+            0)));
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4 annotation (layer=
+        "icon", Placement(transformation(extent={{-112,30},{-92,50}}, rotation=
+            0)));
+equation
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Ce3.ftype;
+  fluids[5] = Ce4.ftype;
+  fluids[6] = Ce5.ftype;
+  fluids[7] = Ce6.ftype;
+  fluids[8] = Ce7.ftype;
+  fluids[9] = Ce8.ftype;
+  fluids[10] = Cs.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "Mixer8: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.h_vol_1 = 1.e5;
+    Ce3.diff_res_1 = 0;
+    Ce3.diff_on_1 = false;
+    Ce3.ftype = ftype;
+    Ce3.Xco2 = 0;
+    Ce3.Xh2o = 0;
+    Ce3.Xo2 = 0;
+    Ce3.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce4) == 0) then
+    Ce4.Q = 0;
+    Ce4.h = 1.e5;
+    Ce4.h_vol_1 = 1.e5;
+    Ce4.diff_res_1 = 0;
+    Ce4.diff_on_1 = false;
+    Ce4.ftype = ftype;
+    Ce4.Xco2 = 0;
+    Ce4.Xh2o = 0;
+    Ce4.Xo2 = 0;
+    Ce4.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce5) == 0) then
+    Ce5.Q = 0;
+    Ce5.h = 1.e5;
+    Ce5.h_vol_1 = 1.e5;
+    Ce5.diff_res_1 = 0;
+    Ce5.diff_on_1 = false;
+    Ce5.ftype = ftype;
+    Ce5.Xco2 = 0;
+    Ce5.Xh2o = 0;
+    Ce5.Xo2 = 0;
+    Ce5.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce6) == 0) then
+    Ce6.Q = 0;
+    Ce6.h = 1.e5;
+    Ce6.h_vol_1 = 1.e5;
+    Ce6.diff_res_1 = 0;
+    Ce6.diff_on_1 = false;
+    Ce6.ftype = ftype;
+    Ce6.Xco2 = 0;
+    Ce6.Xh2o = 0;
+    Ce6.Xo2 = 0;
+    Ce6.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce7) == 0) then
+    Ce7.Q = 0;
+    Ce7.h = 1.e5;
+    Ce7.h_vol_1 = 1.e5;
+    Ce7.diff_res_1 = 0;
+    Ce7.diff_on_1 = false;
+    Ce7.ftype = ftype;
+    Ce7.Xco2 = 0;
+    Ce7.Xh2o = 0;
+    Ce7.Xo2 = 0;
+    Ce7.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce8) == 0) then
+    Ce8.Q = 0;
+    Ce8.h = 1.e5;
+    Ce8.h_vol_1 = 1.e5;
+    Ce8.diff_res_1 = 0;
+    Ce8.diff_on_1 = false;
+    Ce8.ftype = ftype;
+    Ce8.Xco2 = 0;
+    Ce8.Xh2o = 0;
+    Ce8.Xo2 = 0;
+    Ce8.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h_vol_2 = 1.e5;
+    Cs.diff_res_2 = 0;
+    Cs.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  0 = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q + Ce5.Q + Ce6.Q + Ce7.Q + Ce8.Q - Cs.Q;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Ce4.P;
+  P = Ce5.P;
+  P = Ce6.P;
+  P = Ce7.P;
+  P = Ce8.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h + Ce5.Q*Ce5.h + Ce6.Q*Ce6.h + Ce7.Q*Ce7.h + Ce8.Q*Ce8.h - Cs.Q*Cs.h + J;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Ce3.h_vol_2 = h;
+  Ce4.h_vol_2 = h;
+  Ce5.h_vol_2 = h;
+  Ce6.h_vol_2 = h;
+  Ce7.h_vol_2 = h;
+  Ce8.h_vol_2 = h;
+  Cs.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q  + Ce5.Xco2*Ce5.Q  + Ce6.Xco2*Ce6.Q  + Ce7.Xco2*Ce7.Q  + Ce8.Xco2*Ce8.Q  - Cs.Xco2*Cs.Q;
+  0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q   + Ce5.Xh2o*Ce5.Q   + Ce6.Xh2o*Ce6.Q   + Ce7.Xh2o*Ce7.Q   + Ce8.Xh2o*Ce8.Q    - Cs.Xh2o*Cs.Q;
+  0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q  + Ce5.Xo2*Ce5.Q  + Ce6.Xo2*Ce6.Q  + Ce7.Xo2*Ce7.Q  + Ce8.Xo2*Ce8.Q   - Cs.Xo2*Cs.Q;
+  0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q  + Ce5.Xso2*Ce5.Q  + Ce6.Xso2*Ce6.Q  + Ce7.Xso2*Ce7.Q  + Ce8.Xso2*Ce8.Q   - Cs.Xso2*Cs.Q;
+
+  Cs.ftype = ftype;
+
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2  = Xo2;
+  Cs.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+  else
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
+    re4 = if Ce4.diff_on_1 then exp(-0.033*(Ce4.Q*Ce4.diff_res_1)^2) else 0;
+    re5 = if Ce5.diff_on_1 then exp(-0.033*(Ce5.Q*Ce5.diff_res_1)^2) else 0;
+    re6 = if Ce6.diff_on_1 then exp(-0.033*(Ce6.Q*Ce6.diff_res_1)^2) else 0;
+    re7 = if Ce7.diff_on_1 then exp(-0.033*(Ce7.Q*Ce7.diff_res_1)^2) else 0;
+    re8 = if Ce8.diff_on_1 then exp(-0.033*(Ce8.Q*Ce8.diff_res_1)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
+    gamma_e4 = if Ce4.diff_on_1 then 1/Ce4.diff_res_1 else gamma0;
+    gamma_e5 = if Ce5.diff_on_1 then 1/Ce5.diff_res_1 else gamma0;
+    gamma_e6 = if Ce6.diff_on_1 then 1/Ce6.diff_res_1 else gamma0;
+    gamma_e7 = if Ce7.diff_on_1 then 1/Ce7.diff_res_1 else gamma0;
+    gamma_e8 = if Ce8.diff_on_1 then 1/Ce8.diff_res_1 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
+    Je4 = if Ce4.diff_on_1 then re4*gamma_e4*(Ce4.h_vol_1 - Ce4.h_vol_2) else 0;
+    Je5 = if Ce5.diff_on_1 then re5*gamma_e5*(Ce5.h_vol_1 - Ce5.h_vol_2) else 0;
+    Je6 = if Ce6.diff_on_1 then re6*gamma_e6*(Ce6.h_vol_1 - Ce6.h_vol_2) else 0;
+    Je7 = if Ce7.diff_on_1 then re7*gamma_e7*(Ce7.h_vol_1 - Ce7.h_vol_2) else 0;
+    Je8 = if Ce8.diff_on_1 then re8*gamma_e8*(Ce8.h_vol_1 - Ce8.h_vol_2) else 0;
+    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    re3 = 0;
+    re4 = 0;
+    re5 = 0;
+    re6 = 0;
+    re7 = 0;
+    re8 = 0;
+    rs = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_e3 = gamma0;
+    gamma_e4 = gamma0;
+    gamma_e5 = gamma0;
+    gamma_e6 = gamma0;
+    gamma_e7 = gamma0;
+    gamma_e8 = gamma0;
+    gamma_s = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Je3 = 0;
+    Je4 = 0;
+    Je5 = 0;
+    Je6 = 0;
+    Je7 = 0;
+    Je8 = 0;
+    Js = 0;
+  end if;
+
+  J = Je1 + Je2 + Je3 + Je4 + Je5 + Je6 + Je7 + Je8 + Js;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Ce3.diff_res_2 = 0;
+  Ce4.diff_res_2 = 0;
+  Ce5.diff_res_2 = 0;
+  Ce6.diff_res_2 = 0;
+  Ce7.diff_res_2 = 0;
+  Ce8.diff_res_2 = 0;
+  Cs.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Ce3.diff_on_2 = diffusion;
+  Ce4.diff_on_2 = diffusion;
+  Ce5.diff_on_2 = diffusion;
+  Ce6.diff_on_2 = diffusion;
+  Ce7.diff_on_2 = diffusion;
+  Ce8.diff_on_2 = diffusion;
+  Cs.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{40,0},{92,0}}),
+        Line(points={{-92,-40},{-40,-40}}),
+        Line(points={{-30,90},{-30,66}}, color={0,0,255}),
+        Line(points={{30,92},{30,66}}, color={0,0,255}),
+        Line(points={{-30,-66},{-30,-90}}, color={0,0,255}),
+        Line(points={{30,-66},{30,-90}}, color={0,0,255}),
+        Line(points={{-92,40},{-40,40}}),
+        Line(points={{-38,-52},{-92,-90}}, color={0,0,255}),
+        Line(points={{-38,54},{-92,90}}, color={0,0,255}),
+        Polygon(points={{-40,40},{-38,54},{-34,60},{-24,72},{-8,80},{6,80},{18,
+              76},{26,70},{34,62},{38,52},{40,46},{40,40},{40,38},{40,34},{40,
+              -40},{40,-46},{36,-58},{30,-66},{24,-72},{16,-76},{6,-80},{0,-80},
+              {-4,-80},{-8,-80},{-18,-76},{-28,-70},{-34,-60},{-36,-58},{-38,
+              -54},{-38,-52},{-40,-46},{-40,-40},{-40,0},{-40,40}}, lineColor={
+              28,108,200})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(points={{-30,90},{-30,66}}, color={0,0,255}),
+        Line(points={{-30,-66},{-30,-90}}, color={0,0,255}),
+        Line(points={{30,92},{30,66}}, color={0,0,255}),
+        Line(points={{30,-66},{30,-90}}, color={0,0,255}),
+        Line(points={{-92,40},{-40,40}}),
+        Line(points={{-92,-40},{-40,-40}}),
+        Line(points={{40,0},{92,0}}),
+        Line(points={{-38,-52},{-92,-90}}, color={0,0,255}),
+        Line(points={{-38,54},{-92,90}}, color={0,0,255})}),
+    Window(
+      x=0.05,
+      y=0.07,
+      width=0.74,
+      height=0.85),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Mixer8;
diff --git a/ThermoSysPro/Fluid/Junctions/Splitter2.mo b/ThermoSysPro/Fluid/Junctions/Splitter2.mo
index 59e555f65c7a2f1663ed5e2e7c08c5f1fb1024e4..88a58452fee7514761b35871208c940e9be2ea72 100644
--- a/ThermoSysPro/Fluid/Junctions/Splitter2.mo
+++ b/ThermoSysPro/Fluid/Junctions/Splitter2.mo
@@ -1,208 +1,208 @@
-within ThermoSysPro.Fluid.Junctions;
-model Splitter2 "Splitter with two outlets"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  FluidType fluids[4] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je "Thermal power diffusion from inlet e";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Real re "Value of r(Q/gamma) for inlet e";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for outlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = Cs1.ftype;
-  fluids[4] = Cs2.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "Splitter2: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.5;
-  end if;
-
-  /* Mass balance equation */
-  0 = Ce.Q - Cs1.Q - Cs2.Q;
-
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  0 = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + J;
-
-  Ce.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  /* Mass flow at outlet 1 */
-  if (cardinality(Ialpha1) <> 0) then
-    Cs1.Q = Ialpha1.signal*Ce.Q;
-  end if;
-
-  alpha1 = if noEvent(abs(Ce.Q) > 0) then Cs1.Q/Ce.Q else Modelica.Constants.inf;
-  Oalpha1.signal = alpha1;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    Js1 = if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-  else
-    re = 0;
-    rs1 = 0;
-    rs2 = 0;
-
-    gamma_e = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-
-    Je = 0;
-    Js1 = 0;
-    Js2 = 0;
-  end if;
-
-  J = Je + Js1 + Js2;
-
-  Ce.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
-              20,20},{20,100},{60,100}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{20,80},{60,40}}, textString=
-                                     "1"),
-        Text(extent={{20,-40},{60,-80}}, textString=
-                             "2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
-              20,20},{20,100},{60,100}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Text(extent={{30,88},{50,72}}, textString=
-                                     "1"),
-        Text(extent={{32,-72},{50,-88}}, textString=
-                             "2")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end Splitter2;
+within ThermoSysPro.Fluid.Junctions;
+model Splitter2 "Splitter with two outlets"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  FluidType fluids[4] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je "Thermal power diffusion from inlet e";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Real re "Value of r(Q/gamma) for inlet e";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for outlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = Cs1.ftype;
+  fluids[4] = Cs2.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "Splitter2: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.5;
+  end if;
+
+  /* Mass balance equation */
+  0 = Ce.Q - Cs1.Q - Cs2.Q;
+
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  0 = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + J;
+
+  Ce.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  /* Mass flow at outlet 1 */
+  if (cardinality(Ialpha1) <> 0) then
+    Cs1.Q = Ialpha1.signal*Ce.Q;
+  end if;
+
+  alpha1 = if noEvent(abs(Ce.Q) > 0) then Cs1.Q/Ce.Q else Modelica.Constants.inf;
+  Oalpha1.signal = alpha1;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    Js1 = if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+  else
+    re = 0;
+    rs1 = 0;
+    rs2 = 0;
+
+    gamma_e = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+
+    Je = 0;
+    Js1 = 0;
+    Js2 = 0;
+  end if;
+
+  J = Je + Js1 + Js2;
+
+  Ce.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
+              20,20},{20,100},{60,100}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{20,80},{60,40}}, textString=
+                                     "1"),
+        Text(extent={{20,-40},{60,-80}}, textString=
+                             "2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
+              20,20},{20,100},{60,100}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Text(extent={{30,88},{50,72}}, textString=
+                                     "1"),
+        Text(extent={{32,-72},{50,-88}}, textString=
+                             "2")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end Splitter2;
diff --git a/ThermoSysPro/Fluid/Junctions/Splitter3.mo b/ThermoSysPro/Fluid/Junctions/Splitter3.mo
index c7ecb73f6b10eb767c06c8765b3273bfcb54ad6c..db1bf8b499aed6d99de5f820ab2a19d9aeb12b3d 100644
--- a/ThermoSysPro/Fluid/Junctions/Splitter3.mo
+++ b/ThermoSysPro/Fluid/Junctions/Splitter3.mo
@@ -1,286 +1,286 @@
-within ThermoSysPro.Fluid.Junctions;
-model Splitter3 "Splitter with three outlets"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
-  Real alpha2 "Extraction coefficient for outlet 2 (<=1)";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  FluidType fluids[5] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je "Thermal power diffusion from inlet e";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
-  Real re "Value of r(Q/gamma) for inlet e";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-  Real rs3 "Value of r(Q/gamma) for outlet s3";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
-        transformation(extent={{-108,-10},{-88,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3 annotation (
-      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for outlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha2
-    "Extraction coefficient for outlet 2 (<=1)"
-    annotation (Placement(transformation(extent={{0,-70},{20,-50}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha2
-    annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = Cs1.ftype;
-  fluids[4] = Cs2.ftype;
-  fluids[5] = Cs3.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "Splitter3: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.3;
-  end if;
-
-  if (cardinality(Ialpha2) == 0) then
-    Ialpha2.signal = 0.3;
-  end if;
-
-  /* Mass balance equation */
-  0 = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
-
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-
-  /* Energy balance equation */
-  0 = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + J;
-
-  Ce.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-  Cs3.h_vol_1 = h;
-
-  /* Mass flows at outlets 1 and 2 */
-  if (cardinality(Ialpha1) <> 0) then
-    Cs1.Q = Ialpha1.signal*Ce.Q;
-  end if;
-
-  if (cardinality(Ialpha2) <> 0) then
-    Cs2.Q = Ialpha2.signal*Ce.Q;
-  end if;
-
-  alpha1 = if noEvent(abs(Ce.Q) > 0) then Cs1.Q/Ce.Q else Modelica.Constants.inf;
-  Oalpha1.signal = alpha1;
-
-  alpha2 = if noEvent(abs(Ce.Q) > 0) then Cs2.Q/Ce.Q else Modelica.Constants.inf;
-  Oalpha2.signal = alpha2;
-
-  /* Fluid composition balance equations */
-  0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q;
-  0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q;
-  0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q;
-  0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-  Cs3.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  Cs3.Xco2 = Xco2;
-  Cs3.Xh2o = Xh2o;
-  Cs3.Xo2  = Xo2;
-  Cs3.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    Js1 = if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
-  else
-    re = 0;
-    rs1 = 0;
-    rs2 = 0;
-    rs3 = 0;
-
-    gamma_e = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-    gamma_s3 = gamma0;
-
-    Je = 0;
-    Js1 = 0;
-    Js2 = 0;
-    Js3 = 0;
-  end if;
-
-  J = Je + Js1 + Js2 + Js3;
-
-  Ce.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-  Cs3.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-  Cs3.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  annotation (
-    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{
-            100,100}}), graphics={
-        Text(extent={{10,-60},{48,-90}}, textString =           "3"),
-        Rectangle(
-          extent={{44,-27},{50,-65}},
-          lineColor={28,108,200},
-          pattern=LinePattern.None,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100,
-              20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{20,80},{60,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "1"),
-        Text(
-          extent={{20,-40},{60,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "2"),
-        Text(
-          extent={{60,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "3")}),
-    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
-            100}}), graphics={
-        Text(extent={{10,-60},{48,-90}}, textString =           "3"),
-        Rectangle(
-          extent={{44,-27},{50,-65}},
-          lineColor={28,108,200},
-          pattern=LinePattern.None,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100,
-              20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{26,88},{52,74}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "1"),
-        Text(
-          extent={{26,-74},{52,-88}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "2"),
-        Text(
-          extent={{66,6},{92,-8}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "3")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Splitter3;
+within ThermoSysPro.Fluid.Junctions;
+model Splitter3 "Splitter with three outlets"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
+  Real alpha2 "Extraction coefficient for outlet 2 (<=1)";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  FluidType fluids[5] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je "Thermal power diffusion from inlet e";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
+  Real re "Value of r(Q/gamma) for inlet e";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+  Real rs3 "Value of r(Q/gamma) for outlet s3";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
+        transformation(extent={{-108,-10},{-88,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3 annotation (
+      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for outlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha2
+    "Extraction coefficient for outlet 2 (<=1)"
+    annotation (Placement(transformation(extent={{0,-70},{20,-50}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha2
+    annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = Cs1.ftype;
+  fluids[4] = Cs2.ftype;
+  fluids[5] = Cs3.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "Splitter3: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.3;
+  end if;
+
+  if (cardinality(Ialpha2) == 0) then
+    Ialpha2.signal = 0.3;
+  end if;
+
+  /* Mass balance equation */
+  0 = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
+
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+
+  /* Energy balance equation */
+  0 = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + J;
+
+  Ce.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+  Cs3.h_vol_1 = h;
+
+  /* Mass flows at outlets 1 and 2 */
+  if (cardinality(Ialpha1) <> 0) then
+    Cs1.Q = Ialpha1.signal*Ce.Q;
+  end if;
+
+  if (cardinality(Ialpha2) <> 0) then
+    Cs2.Q = Ialpha2.signal*Ce.Q;
+  end if;
+
+  alpha1 = if noEvent(abs(Ce.Q) > 0) then Cs1.Q/Ce.Q else Modelica.Constants.inf;
+  Oalpha1.signal = alpha1;
+
+  alpha2 = if noEvent(abs(Ce.Q) > 0) then Cs2.Q/Ce.Q else Modelica.Constants.inf;
+  Oalpha2.signal = alpha2;
+
+  /* Fluid composition balance equations */
+  0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q;
+  0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q;
+  0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q;
+  0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+  Cs3.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  Cs3.Xco2 = Xco2;
+  Cs3.Xh2o = Xh2o;
+  Cs3.Xo2  = Xo2;
+  Cs3.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    Js1 = if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
+  else
+    re = 0;
+    rs1 = 0;
+    rs2 = 0;
+    rs3 = 0;
+
+    gamma_e = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+    gamma_s3 = gamma0;
+
+    Je = 0;
+    Js1 = 0;
+    Js2 = 0;
+    Js3 = 0;
+  end if;
+
+  J = Je + Js1 + Js2 + Js3;
+
+  Ce.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+  Cs3.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+  Cs3.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  annotation (
+    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{
+            100,100}}), graphics={
+        Text(extent={{10,-60},{48,-90}}, textString =           "3"),
+        Rectangle(
+          extent={{44,-27},{50,-65}},
+          lineColor={28,108,200},
+          pattern=LinePattern.None,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100,
+              20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{20,80},{60,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "1"),
+        Text(
+          extent={{20,-40},{60,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "2"),
+        Text(
+          extent={{60,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "3")}),
+    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
+            100}}), graphics={
+        Text(extent={{10,-60},{48,-90}}, textString =           "3"),
+        Rectangle(
+          extent={{44,-27},{50,-65}},
+          lineColor={28,108,200},
+          pattern=LinePattern.None,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100,
+              20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{26,88},{52,74}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "1"),
+        Text(
+          extent={{26,-74},{52,-88}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "2"),
+        Text(
+          extent={{66,6},{92,-8}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "3")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Splitter3;
diff --git a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo
index d099e6163d3e5d3a0ab706af0c3eec1adf4f2be5..49bc4ba98606d464bca0dbc7133d32d2bdf9c070 100644
--- a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo
+++ b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo
@@ -1,416 +1,416 @@
-within ThermoSysPro.Fluid.Junctions;
-model StaticDrum "Static drum"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real x=1 "Vapor separation efficiency at the outlet";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=10.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy hl(start=100000) "Liquid phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hv(start=2800000) "Gas phase specific enthalpy";
-  FluidType fluids[9] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je_steam "Thermal power diffusion from inlet e_steam";
-  Units.SI.Power Je_sup "Thermal power diffusion from inlet e_sup";
-  Units.SI.Power Je_eva "Thermal power diffusion from inlet e_eva";
-  Units.SI.Power Je_eco "Thermal power diffusion from inlet e_eco";
-  Units.SI.Power Js_eva "Thermal power diffusion from outlet s_eva";
-  Units.SI.Power Js_purg "Thermal power diffusion from outlet s_purg";
-  Units.SI.Power Js_sup "Thermal power diffusion from outlet s_sup";
-  Units.SI.Power Js_sur "Thermal power diffusion from outlet s_sur";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e_steam "Diffusion conductance for inlet e_steam";
-  Units.SI.MassFlowRate gamma_e_sup "Diffusion conductance for inlet e_sup";
-  Units.SI.MassFlowRate gamma_e_eva "Diffusion conductance for inlet e_eva";
-  Units.SI.MassFlowRate gamma_e_eco "Diffusion conductance for inlet e_eco";
-  Units.SI.MassFlowRate gamma_s_eva "Diffusion conductance for outlet s_eva";
-  Units.SI.MassFlowRate gamma_s_purg "Diffusion conductance for outlet s_purg";
-  Units.SI.MassFlowRate gamma_s_sup "Diffusion conductance for outlet s_sup";
-  Units.SI.MassFlowRate gamma_s_sur "Diffusion conductance for outlet s_sur";
-  Real re_steam "Value of r(Q/gamma) for inlet e_steam";
-  Real re_sup "Value of r(Q/gamma) for inlet e_sup";
-  Real re_eva "Value of r(Q/gamma) for inlet e_eva";
-  Real re_eco "Value of r(Q/gamma) for inlet e_eco";
-  Real rs_eva "Value of r(Q/gamma) for outlet s_eva";
-  Real rs_purg "Value of r(Q/gamma) for outlet s_purg";
-  Real rs_sup "Value of r(Q/gamma) for outlet s_sup";
-  Real rs_sur "Value of r(Q/gamma) for outlet s_sur";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eva annotation (
-      Placement(transformation(extent={{-104,-44},{-84,-24}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eco annotation (
-      Placement(transformation(extent={{-50,-104},{-30,-84}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sup annotation (
-      Placement(transformation(extent={{84,24},{104,44}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_eva annotation (
-      Placement(transformation(extent={{30,-104},{50,-84}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sur annotation (
-      Placement(transformation(extent={{28,84},{48,104}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_purg annotation (
-      Placement(transformation(extent={{84,-44},{104,-24}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_steam annotation (
-      Placement(transformation(extent={{-48,84},{-28,104}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_sup annotation (
-      Placement(transformation(extent={{-104,26},{-84,46}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-104,66},{-78,98}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-    annotation (Placement(transformation(extent={{72,68},{100,100}}, rotation=0)));
-  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce_steam.ftype;
-  fluids[3] = Ce_sup.ftype;
-  fluids[4] = Ce_eva.ftype;
-  fluids[5] = Ce_eco.ftype;
-  fluids[6] = Cs_eva.ftype;
-  fluids[7] = Cs_purg.ftype;
-  fluids[8] = Cs_sup.ftype;
-  fluids[9] = Cs_sur.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticDrum: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  /* Steam input */
-  if (cardinality(Ce_steam) == 0) then
-    Ce_steam.Q = 0;
-    Ce_steam.h = 1.e5;
-    Ce_steam.h_vol_1 = 1.e5;
-    Ce_steam.diff_res_1 = 0;
-    Ce_steam.diff_on_1 = false;
-    Ce_steam.ftype = ftype;
-    Ce_steam.Xco2 = 0;
-    Ce_steam.Xh2o = 0;
-    Ce_steam.Xo2  = 0;
-    Ce_steam.Xso2 = 0;
-  end if;
-
-  /* Extra input */
-  if (cardinality(Ce_sup) == 0) then
-    Ce_sup.Q = 0;
-    Ce_sup.h = 1.e5;
-    Ce_sup.h_vol_1 = 1.e5;
-    Ce_sup.diff_res_1 = 0;
-    Ce_sup.diff_on_1 = false;
-    Ce_sup.ftype = ftype;
-    Ce_sup.Xco2 = 0;
-    Ce_sup.Xh2o = 0;
-    Ce_sup.Xo2  = 0;
-    Ce_sup.Xso2 = 0;
-  end if;
-
-  /* Input from evaporator */
-  if (cardinality(Ce_eva) == 0) then
-    Ce_eva.Q = 0;
-    Ce_eva.h = 1.e5;
-    Ce_eva.h_vol_1 = 1.e5;
-    Ce_eva.diff_res_1 = 0;
-    Ce_eva.diff_on_1 = false;
-    Ce_eva.ftype = ftype;
-    Ce_eva.Xco2 = 0;
-    Ce_eva.Xh2o = 0;
-    Ce_eva.Xo2  = 0;
-    Ce_eva.Xso2 = 0;
-  end if;
-
-  /* Input from the economizer */
-  if (cardinality(Ce_eco) == 0) then
-    Ce_eco.Q = 0;
-    Ce_eco.h = 1.e5;
-    Ce_eco.h_vol_1 = 1.e5;
-    Ce_eco.diff_res_1 = 0;
-    Ce_eco.diff_on_1 = false;
-    Ce_eco.ftype = ftype;
-    Ce_eco.Xco2 = 0;
-    Ce_eco.Xh2o = 0;
-    Ce_eco.Xo2  = 0;
-    Ce_eco.Xso2 = 0;
-  end if;
-
-  /* Output to the evaporator */
-  if (cardinality(Cs_eva) == 0) then
-    Cs_eva.Q = 0;
-    Cs_eva.h_vol_2 = 1.e5;
-    Cs_eva.diff_res_2 = 0;
-    Cs_eva.diff_on_2 = false;
-  end if;
-
-  /* Drain outlet */
-  if (cardinality(Cs_purg) == 0) then
-    Cs_purg.Q = 0;
-    Cs_purg.h_vol_2 = 1.e5;
-    Cs_purg.diff_res_2 = 0;
-    Cs_purg.diff_on_2 = false;
-  end if;
-
-  /* Extra output  */
-  if (cardinality(Cs_sup) == 0) then
-    Cs_sup.Q = 0;
-    Cs_sup.h_vol_2 = 1.e5;
-    Cs_sup.diff_res_2 = 0;
-    Cs_sup.diff_on_2 = false;
-  end if;
-
-  /* Output to reheater */
-  if (cardinality(Cs_sur) == 0) then
-    Cs_sur.Q = 0;
-    Cs_sur.h_vol_2 = 1.e5;
-    Cs_sur.diff_res_2 = 0;
-    Cs_sur.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  Ce_eco.Q + Ce_steam.Q + Ce_sup.Q + Ce_eva.Q - Cs_eva.Q - Cs_sur.Q - Cs_purg.Q - Cs_sup.Q = 0;
-
-  P = Ce_steam.P;
-  P = Ce_sup.P;
-  P = Ce_eva.P;
-  P = Ce_eco.P;
-
-  P = Cs_eva.P;
-  P = Cs_purg.P;
-  P = Cs_sup.P;
-  P = Cs_sur.P;
-
-  /* Energy balance equation */
-  Ce_eco.Q*Ce_eco.h + Ce_steam.Q*Ce_steam.h + Ce_sup.Q*Ce_sup.h + Ce_eva.Q*Ce_eva.h - Cs_eva.Q*Cs_eva.h - Cs_sur.Q*Cs_sur.h - Cs_purg.Q*Cs_purg.h - Cs_sup.Q*Cs_sup.h + Cth.W + J = 0;
-
-  Ce_steam.h_vol_2 = hv;
-  Ce_sup.h_vol_2 = hl;
-  Ce_eva.h_vol_2 = hl;
-  Ce_eco.h_vol_2 = hl;
-
-  Cs_eva.h_vol_1 = hl;
-  Cs_purg.h_vol_1 = hl;
-  Cs_sup.h_vol_1 = hl;
-  Cs_sur.h_vol_1 = (1 - x)*hl + x*hv;
-
-  /* Fluid composition balance equations */
-  0 = Ce_steam.Xco2*Ce_steam.Q + Ce_sup.Xco2*Ce_sup.Q + Ce_eva.Xco2*Ce_eva.Q + Ce_eco.Xco2*Ce_eco.Q - Cs_sur.Xco2*Cs_sur.Q - Cs_sup.Xco2*Cs_sup.Q - Cs_purg.Xco2*Cs_purg.Q - Cs_eva.Xco2*Cs_eva.Q;
-  0 = Ce_steam.Xh2o*Ce_steam.Q + Ce_sup.Xh2o*Ce_sup.Q + Ce_eva.Xh2o*Ce_eva.Q + Ce_eco.Xh2o*Ce_eco.Q - Cs_sur.Xh2o*Cs_sur.Q - Cs_sup.Xh2o*Cs_sup.Q - Cs_purg.Xh2o*Cs_purg.Q - Cs_eva.Xh2o*Cs_eva.Q;
-  0 = Ce_steam.Xo2*Ce_steam.Q + Ce_sup.Xo2*Ce_sup.Q + Ce_eva.Xo2*Ce_eva.Q + Ce_eco.Xo2*Ce_eco.Q - Cs_sur.Xo2*Cs_sur.Q - Cs_sup.Xo2*Cs_sup.Q - Cs_purg.Xo2*Cs_purg.Q - Cs_eva.Xo2*Cs_eva.Q;
-  0 = Ce_steam.Xso2*Ce_steam.Q + Ce_sup.Xso2*Ce_sup.Q + Ce_eva.Xso2*Ce_eva.Q + Ce_eco.Xso2*Ce_eco.Q - Cs_sur.Xso2*Cs_sur.Q - Cs_sup.Xso2*Cs_sup.Q - Cs_purg.Xso2*Cs_purg.Q - Cs_eva.Xso2*Cs_eva.Q;
-
-  Cs_eva.ftype = ftype;
-  Cs_purg.ftype = ftype;
-  Cs_sup.ftype = ftype;
-  Cs_sur.ftype = ftype;
-
-  Xco2 = Cs_eva.Xco2;
-  Xh2o = Cs_eva.Xh2o;
-  Xo2  = Cs_eva.Xo2;
-  Xso2 = Cs_eva.Xso2;
-
-  Xco2 = Cs_purg.Xco2;
-  Xh2o = Cs_purg.Xh2o;
-  Xo2  = Cs_purg.Xo2;
-  Xso2 = Cs_purg.Xso2;
-
-  Xco2 = Cs_sup.Xco2;
-  Xh2o = Cs_sup.Xh2o;
-  Xo2  = Cs_sup.Xo2;
-  Xso2 = Cs_sup.Xso2;
-
-  Xco2 = Cs_sur.Xco2;
-  Xh2o = Cs_sur.Xh2o;
-  Xo2  = Cs_sur.Xo2;
-  Xso2 = Cs_sur.Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs_eva.h = ThermoSysPro.Functions.SmoothCond(Cs_eva.Q/gamma_s_eva, Cs_eva.h_vol_1, Cs_eva.h_vol_2, 1);
-    Cs_purg.h = ThermoSysPro.Functions.SmoothCond(Cs_purg.Q/gamma_s_purg, Cs_purg.h_vol_1, Cs_purg.h_vol_2, 1);
-    Cs_sup.h = ThermoSysPro.Functions.SmoothCond(Cs_sup.Q/gamma_s_sup, Cs_sup.h_vol_1, Cs_sup.h_vol_2, 1);
-    Cs_sur.h = ThermoSysPro.Functions.SmoothCond(Cs_sur.Q/gamma_s_sur, Cs_sur.h_vol_1, Cs_sur.h_vol_2, 1);
-  else
-    Cs_eva.h = if (Cs_eva.Q > 0) then Cs_eva.h_vol_1 else Cs_eva.h_vol_2;
-    Cs_purg.h = if (Cs_purg.Q > 0) then Cs_purg.h_vol_1 else Cs_purg.h_vol_2;
-    Cs_sup.h = if (Cs_sup.Q > 0) then Cs_sup.h_vol_1 else Cs_sup.h_vol_2;
-    Cs_sur.h = if (Cs_sur.Q > 0) then Cs_sur.h_vol_1 else Cs_sur.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re_steam = if Ce_steam.diff_on_1 then exp(-0.033*(Ce_steam.Q*Ce_steam.diff_res_1)^2) else 0;
-    re_sup = if Ce_sup.diff_on_1 then exp(-0.033*(Ce_sup.Q*Ce_sup.diff_res_1)^2) else 0;
-    re_eva = if Ce_eva.diff_on_1 then exp(-0.033*(Ce_eva.Q*Ce_eva.diff_res_1)^2) else 0;
-    re_eco = if Ce_eco.diff_on_1 then exp(-0.033*(Ce_eco.Q*Ce_eco.diff_res_1)^2) else 0;
-    rs_eva = if Cs_eva.diff_on_2 then exp(-0.033*(Cs_eva.Q*Cs_eva.diff_res_2)^2) else 0;
-    rs_purg = if Cs_purg.diff_on_2 then exp(-0.033*(Cs_purg.Q*Cs_purg.diff_res_2)^2) else 0;
-    rs_sup = if Cs_sup.diff_on_2 then exp(-0.033*(Cs_sup.Q*Cs_sup.diff_res_2)^2) else 0;
-    rs_sur = if Cs_sur.diff_on_2 then exp(-0.033*(Cs_sur.Q*Cs_sur.diff_res_2)^2) else 0;
-
-    gamma_e_steam = if Ce_steam.diff_on_1 then 1/Ce_steam.diff_res_1 else gamma0;
-    gamma_e_sup = if Ce_sup.diff_on_1 then 1/Ce_sup.diff_res_1 else gamma0;
-    gamma_e_eva = if Ce_eva.diff_on_1 then 1/Ce_eva.diff_res_1 else gamma0;
-    gamma_e_eco = if Ce_eco.diff_on_1 then 1/Ce_eco.diff_res_1 else gamma0;
-    gamma_s_eva = if Cs_eva.diff_on_2 then 1/Cs_eva.diff_res_2 else gamma0;
-    gamma_s_purg = if Cs_purg.diff_on_2 then 1/Cs_purg.diff_res_2 else gamma0;
-    gamma_s_sup = if Cs_sup.diff_on_2 then 1/Cs_sup.diff_res_2 else gamma0;
-    gamma_s_sur = if Cs_sur.diff_on_2 then 1/Cs_sur.diff_res_2 else gamma0;
-
-    Je_steam = if Ce_steam.diff_on_1 then re_steam*gamma_e_steam*(Ce_steam.h_vol_1 - Ce_steam.h_vol_2) else 0;
-    Je_sup = if Ce_sup.diff_on_1 then re_sup*gamma_e_sup*(Ce_sup.h_vol_1 - Ce_sup.h_vol_2) else 0;
-    Je_eva = if Ce_eva.diff_on_1 then re_eva*gamma_e_eva*(Ce_eva.h_vol_1 - Ce_eva.h_vol_2) else 0;
-    Je_eco = if Ce_eco.diff_on_1 then re_eco*gamma_e_eco*(Ce_eco.h_vol_1 - Ce_eco.h_vol_2) else 0;
-    Js_eva =  if Cs_eva.diff_on_2 then rs_eva*gamma_s_eva*(Cs_eva.h_vol_2 - Cs_eva.h_vol_1) else 0;
-    Js_purg = if Cs_purg.diff_on_2 then rs_purg*gamma_s_purg*(Cs_purg.h_vol_2 - Cs_purg.h_vol_1) else 0;
-    Js_sup = if Cs_sup.diff_on_2 then rs_sup*gamma_s_sup*(Cs_sup.h_vol_2 - Cs_sup.h_vol_1) else 0;
-    Js_sur = if Cs_sur.diff_on_2 then rs_sur*gamma_s_sur*(Cs_sur.h_vol_2 - Cs_sur.h_vol_1) else 0;
-  else
-    re_steam = 0;
-    re_sup = 0;
-    re_eva = 0;
-    re_eco = 0;
-    rs_eva = 0;
-    rs_purg = 0;
-    rs_sup = 0;
-    rs_sur = 0;
-
-    gamma_e_steam = gamma0;
-    gamma_e_sup = gamma0;
-    gamma_e_eva = gamma0;
-    gamma_e_eco = gamma0;
-    gamma_s_eva = gamma0;
-    gamma_s_purg = gamma0;
-    gamma_s_sup = gamma0;
-    gamma_s_sur = gamma0;
-
-    Je_steam = 0;
-    Je_sup = 0;
-    Je_eva = 0;
-    Je_eco = 0;
-    Js_eva = 0;
-    Js_purg = 0;
-    Js_sup = 0;
-    Js_sur = 0;
-  end if;
-
-  J = Je_steam + Je_sup + Je_eva + Je_eco + Js_eva + Js_purg + Js_sup + Js_sur;
-
-  Ce_steam.diff_res_2 = 0;
-  Ce_sup.diff_res_2 = 0;
-  Ce_eva.diff_res_2 = 0;
-  Ce_eco.diff_res_2 = 0;
-  Cs_eva.diff_res_1 = 0;
-  Cs_purg.diff_res_1 = 0;
-  Cs_sup.diff_res_1 = 0;
-  Cs_sur.diff_res_1 = 0;
-
-  Ce_steam.diff_on_2 = diffusion;
-  Ce_sup.diff_on_2 = diffusion;
-  Ce_eva.diff_on_2 = diffusion;
-  Ce_eco.diff_on_2 = diffusion;
-  Cs_eva.diff_on_1 = diffusion;
-  Cs_purg.diff_on_1 = diffusion;
-  Cs_sup.diff_on_1 = diffusion;
-  Cs_sur.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid);
-
-  hl = lsat.h;
-  hv = vsat.h;
-  T = lsat.T;
-
-  Cth.T = T;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Ellipse(
-          extent={{-98,96},{98,-96}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-86,-44},{86,-44}},
-          color={28,108,200},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-44,-86},{44,-86}},
-          color={28,108,200},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-64,-72},{64,-72}},
-          color={28,108,200},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-78,-58},{76,-58}},
-          color={28,108,200},
-          pattern=LinePattern.Dash),
-        Text(extent={{-56,94},{-56,92}}, textString=
-                                             "Esteam")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Ellipse(
-          extent={{-98,96},{98,-96}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-86,-44},{86,-44}},
-          color={28,108,200},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-44,-86},{44,-86}},
-          color={28,108,200},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-64,-72},{64,-72}},
-          color={28,108,200},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-78,-58},{76,-58}},
-          color={28,108,200},
-          pattern=LinePattern.Dash)}),
-    Window(
-      x=0.33,
-      y=0.08,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end StaticDrum;
+within ThermoSysPro.Fluid.Junctions;
+model StaticDrum "Static drum"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real x=1 "Vapor separation efficiency at the outlet";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=10.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy hl(start=100000) "Liquid phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hv(start=2800000) "Gas phase specific enthalpy";
+  FluidType fluids[9] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je_steam "Thermal power diffusion from inlet e_steam";
+  Units.SI.Power Je_sup "Thermal power diffusion from inlet e_sup";
+  Units.SI.Power Je_eva "Thermal power diffusion from inlet e_eva";
+  Units.SI.Power Je_eco "Thermal power diffusion from inlet e_eco";
+  Units.SI.Power Js_eva "Thermal power diffusion from outlet s_eva";
+  Units.SI.Power Js_purg "Thermal power diffusion from outlet s_purg";
+  Units.SI.Power Js_sup "Thermal power diffusion from outlet s_sup";
+  Units.SI.Power Js_sur "Thermal power diffusion from outlet s_sur";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e_steam "Diffusion conductance for inlet e_steam";
+  Units.SI.MassFlowRate gamma_e_sup "Diffusion conductance for inlet e_sup";
+  Units.SI.MassFlowRate gamma_e_eva "Diffusion conductance for inlet e_eva";
+  Units.SI.MassFlowRate gamma_e_eco "Diffusion conductance for inlet e_eco";
+  Units.SI.MassFlowRate gamma_s_eva "Diffusion conductance for outlet s_eva";
+  Units.SI.MassFlowRate gamma_s_purg "Diffusion conductance for outlet s_purg";
+  Units.SI.MassFlowRate gamma_s_sup "Diffusion conductance for outlet s_sup";
+  Units.SI.MassFlowRate gamma_s_sur "Diffusion conductance for outlet s_sur";
+  Real re_steam "Value of r(Q/gamma) for inlet e_steam";
+  Real re_sup "Value of r(Q/gamma) for inlet e_sup";
+  Real re_eva "Value of r(Q/gamma) for inlet e_eva";
+  Real re_eco "Value of r(Q/gamma) for inlet e_eco";
+  Real rs_eva "Value of r(Q/gamma) for outlet s_eva";
+  Real rs_purg "Value of r(Q/gamma) for outlet s_purg";
+  Real rs_sup "Value of r(Q/gamma) for outlet s_sup";
+  Real rs_sur "Value of r(Q/gamma) for outlet s_sur";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eva annotation (
+      Placement(transformation(extent={{-104,-44},{-84,-24}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eco annotation (
+      Placement(transformation(extent={{-50,-104},{-30,-84}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sup annotation (
+      Placement(transformation(extent={{84,24},{104,44}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_eva annotation (
+      Placement(transformation(extent={{30,-104},{50,-84}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sur annotation (
+      Placement(transformation(extent={{28,84},{48,104}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_purg annotation (
+      Placement(transformation(extent={{84,-44},{104,-24}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_steam annotation (
+      Placement(transformation(extent={{-48,84},{-28,104}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_sup annotation (
+      Placement(transformation(extent={{-104,26},{-84,46}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-104,66},{-78,98}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+    annotation (Placement(transformation(extent={{72,68},{100,100}}, rotation=0)));
+  Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce_steam.ftype;
+  fluids[3] = Ce_sup.ftype;
+  fluids[4] = Ce_eva.ftype;
+  fluids[5] = Ce_eco.ftype;
+  fluids[6] = Cs_eva.ftype;
+  fluids[7] = Cs_purg.ftype;
+  fluids[8] = Cs_sup.ftype;
+  fluids[9] = Cs_sur.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticDrum: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  /* Steam input */
+  if (cardinality(Ce_steam) == 0) then
+    Ce_steam.Q = 0;
+    Ce_steam.h = 1.e5;
+    Ce_steam.h_vol_1 = 1.e5;
+    Ce_steam.diff_res_1 = 0;
+    Ce_steam.diff_on_1 = false;
+    Ce_steam.ftype = ftype;
+    Ce_steam.Xco2 = 0;
+    Ce_steam.Xh2o = 0;
+    Ce_steam.Xo2  = 0;
+    Ce_steam.Xso2 = 0;
+  end if;
+
+  /* Extra input */
+  if (cardinality(Ce_sup) == 0) then
+    Ce_sup.Q = 0;
+    Ce_sup.h = 1.e5;
+    Ce_sup.h_vol_1 = 1.e5;
+    Ce_sup.diff_res_1 = 0;
+    Ce_sup.diff_on_1 = false;
+    Ce_sup.ftype = ftype;
+    Ce_sup.Xco2 = 0;
+    Ce_sup.Xh2o = 0;
+    Ce_sup.Xo2  = 0;
+    Ce_sup.Xso2 = 0;
+  end if;
+
+  /* Input from evaporator */
+  if (cardinality(Ce_eva) == 0) then
+    Ce_eva.Q = 0;
+    Ce_eva.h = 1.e5;
+    Ce_eva.h_vol_1 = 1.e5;
+    Ce_eva.diff_res_1 = 0;
+    Ce_eva.diff_on_1 = false;
+    Ce_eva.ftype = ftype;
+    Ce_eva.Xco2 = 0;
+    Ce_eva.Xh2o = 0;
+    Ce_eva.Xo2  = 0;
+    Ce_eva.Xso2 = 0;
+  end if;
+
+  /* Input from the economizer */
+  if (cardinality(Ce_eco) == 0) then
+    Ce_eco.Q = 0;
+    Ce_eco.h = 1.e5;
+    Ce_eco.h_vol_1 = 1.e5;
+    Ce_eco.diff_res_1 = 0;
+    Ce_eco.diff_on_1 = false;
+    Ce_eco.ftype = ftype;
+    Ce_eco.Xco2 = 0;
+    Ce_eco.Xh2o = 0;
+    Ce_eco.Xo2  = 0;
+    Ce_eco.Xso2 = 0;
+  end if;
+
+  /* Output to the evaporator */
+  if (cardinality(Cs_eva) == 0) then
+    Cs_eva.Q = 0;
+    Cs_eva.h_vol_2 = 1.e5;
+    Cs_eva.diff_res_2 = 0;
+    Cs_eva.diff_on_2 = false;
+  end if;
+
+  /* Drain outlet */
+  if (cardinality(Cs_purg) == 0) then
+    Cs_purg.Q = 0;
+    Cs_purg.h_vol_2 = 1.e5;
+    Cs_purg.diff_res_2 = 0;
+    Cs_purg.diff_on_2 = false;
+  end if;
+
+  /* Extra output  */
+  if (cardinality(Cs_sup) == 0) then
+    Cs_sup.Q = 0;
+    Cs_sup.h_vol_2 = 1.e5;
+    Cs_sup.diff_res_2 = 0;
+    Cs_sup.diff_on_2 = false;
+  end if;
+
+  /* Output to reheater */
+  if (cardinality(Cs_sur) == 0) then
+    Cs_sur.Q = 0;
+    Cs_sur.h_vol_2 = 1.e5;
+    Cs_sur.diff_res_2 = 0;
+    Cs_sur.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  Ce_eco.Q + Ce_steam.Q + Ce_sup.Q + Ce_eva.Q - Cs_eva.Q - Cs_sur.Q - Cs_purg.Q - Cs_sup.Q = 0;
+
+  P = Ce_steam.P;
+  P = Ce_sup.P;
+  P = Ce_eva.P;
+  P = Ce_eco.P;
+
+  P = Cs_eva.P;
+  P = Cs_purg.P;
+  P = Cs_sup.P;
+  P = Cs_sur.P;
+
+  /* Energy balance equation */
+  Ce_eco.Q*Ce_eco.h + Ce_steam.Q*Ce_steam.h + Ce_sup.Q*Ce_sup.h + Ce_eva.Q*Ce_eva.h - Cs_eva.Q*Cs_eva.h - Cs_sur.Q*Cs_sur.h - Cs_purg.Q*Cs_purg.h - Cs_sup.Q*Cs_sup.h + Cth.W + J = 0;
+
+  Ce_steam.h_vol_2 = hv;
+  Ce_sup.h_vol_2 = hl;
+  Ce_eva.h_vol_2 = hl;
+  Ce_eco.h_vol_2 = hl;
+
+  Cs_eva.h_vol_1 = hl;
+  Cs_purg.h_vol_1 = hl;
+  Cs_sup.h_vol_1 = hl;
+  Cs_sur.h_vol_1 = (1 - x)*hl + x*hv;
+
+  /* Fluid composition balance equations */
+  0 = Ce_steam.Xco2*Ce_steam.Q + Ce_sup.Xco2*Ce_sup.Q + Ce_eva.Xco2*Ce_eva.Q + Ce_eco.Xco2*Ce_eco.Q - Cs_sur.Xco2*Cs_sur.Q - Cs_sup.Xco2*Cs_sup.Q - Cs_purg.Xco2*Cs_purg.Q - Cs_eva.Xco2*Cs_eva.Q;
+  0 = Ce_steam.Xh2o*Ce_steam.Q + Ce_sup.Xh2o*Ce_sup.Q + Ce_eva.Xh2o*Ce_eva.Q + Ce_eco.Xh2o*Ce_eco.Q - Cs_sur.Xh2o*Cs_sur.Q - Cs_sup.Xh2o*Cs_sup.Q - Cs_purg.Xh2o*Cs_purg.Q - Cs_eva.Xh2o*Cs_eva.Q;
+  0 = Ce_steam.Xo2*Ce_steam.Q + Ce_sup.Xo2*Ce_sup.Q + Ce_eva.Xo2*Ce_eva.Q + Ce_eco.Xo2*Ce_eco.Q - Cs_sur.Xo2*Cs_sur.Q - Cs_sup.Xo2*Cs_sup.Q - Cs_purg.Xo2*Cs_purg.Q - Cs_eva.Xo2*Cs_eva.Q;
+  0 = Ce_steam.Xso2*Ce_steam.Q + Ce_sup.Xso2*Ce_sup.Q + Ce_eva.Xso2*Ce_eva.Q + Ce_eco.Xso2*Ce_eco.Q - Cs_sur.Xso2*Cs_sur.Q - Cs_sup.Xso2*Cs_sup.Q - Cs_purg.Xso2*Cs_purg.Q - Cs_eva.Xso2*Cs_eva.Q;
+
+  Cs_eva.ftype = ftype;
+  Cs_purg.ftype = ftype;
+  Cs_sup.ftype = ftype;
+  Cs_sur.ftype = ftype;
+
+  Xco2 = Cs_eva.Xco2;
+  Xh2o = Cs_eva.Xh2o;
+  Xo2  = Cs_eva.Xo2;
+  Xso2 = Cs_eva.Xso2;
+
+  Xco2 = Cs_purg.Xco2;
+  Xh2o = Cs_purg.Xh2o;
+  Xo2  = Cs_purg.Xo2;
+  Xso2 = Cs_purg.Xso2;
+
+  Xco2 = Cs_sup.Xco2;
+  Xh2o = Cs_sup.Xh2o;
+  Xo2  = Cs_sup.Xo2;
+  Xso2 = Cs_sup.Xso2;
+
+  Xco2 = Cs_sur.Xco2;
+  Xh2o = Cs_sur.Xh2o;
+  Xo2  = Cs_sur.Xo2;
+  Xso2 = Cs_sur.Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs_eva.h = ThermoSysPro.Functions.SmoothCond(Cs_eva.Q/gamma_s_eva, Cs_eva.h_vol_1, Cs_eva.h_vol_2, 1);
+    Cs_purg.h = ThermoSysPro.Functions.SmoothCond(Cs_purg.Q/gamma_s_purg, Cs_purg.h_vol_1, Cs_purg.h_vol_2, 1);
+    Cs_sup.h = ThermoSysPro.Functions.SmoothCond(Cs_sup.Q/gamma_s_sup, Cs_sup.h_vol_1, Cs_sup.h_vol_2, 1);
+    Cs_sur.h = ThermoSysPro.Functions.SmoothCond(Cs_sur.Q/gamma_s_sur, Cs_sur.h_vol_1, Cs_sur.h_vol_2, 1);
+  else
+    Cs_eva.h = if (Cs_eva.Q > 0) then Cs_eva.h_vol_1 else Cs_eva.h_vol_2;
+    Cs_purg.h = if (Cs_purg.Q > 0) then Cs_purg.h_vol_1 else Cs_purg.h_vol_2;
+    Cs_sup.h = if (Cs_sup.Q > 0) then Cs_sup.h_vol_1 else Cs_sup.h_vol_2;
+    Cs_sur.h = if (Cs_sur.Q > 0) then Cs_sur.h_vol_1 else Cs_sur.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re_steam = if Ce_steam.diff_on_1 then exp(-0.033*(Ce_steam.Q*Ce_steam.diff_res_1)^2) else 0;
+    re_sup = if Ce_sup.diff_on_1 then exp(-0.033*(Ce_sup.Q*Ce_sup.diff_res_1)^2) else 0;
+    re_eva = if Ce_eva.diff_on_1 then exp(-0.033*(Ce_eva.Q*Ce_eva.diff_res_1)^2) else 0;
+    re_eco = if Ce_eco.diff_on_1 then exp(-0.033*(Ce_eco.Q*Ce_eco.diff_res_1)^2) else 0;
+    rs_eva = if Cs_eva.diff_on_2 then exp(-0.033*(Cs_eva.Q*Cs_eva.diff_res_2)^2) else 0;
+    rs_purg = if Cs_purg.diff_on_2 then exp(-0.033*(Cs_purg.Q*Cs_purg.diff_res_2)^2) else 0;
+    rs_sup = if Cs_sup.diff_on_2 then exp(-0.033*(Cs_sup.Q*Cs_sup.diff_res_2)^2) else 0;
+    rs_sur = if Cs_sur.diff_on_2 then exp(-0.033*(Cs_sur.Q*Cs_sur.diff_res_2)^2) else 0;
+
+    gamma_e_steam = if Ce_steam.diff_on_1 then 1/Ce_steam.diff_res_1 else gamma0;
+    gamma_e_sup = if Ce_sup.diff_on_1 then 1/Ce_sup.diff_res_1 else gamma0;
+    gamma_e_eva = if Ce_eva.diff_on_1 then 1/Ce_eva.diff_res_1 else gamma0;
+    gamma_e_eco = if Ce_eco.diff_on_1 then 1/Ce_eco.diff_res_1 else gamma0;
+    gamma_s_eva = if Cs_eva.diff_on_2 then 1/Cs_eva.diff_res_2 else gamma0;
+    gamma_s_purg = if Cs_purg.diff_on_2 then 1/Cs_purg.diff_res_2 else gamma0;
+    gamma_s_sup = if Cs_sup.diff_on_2 then 1/Cs_sup.diff_res_2 else gamma0;
+    gamma_s_sur = if Cs_sur.diff_on_2 then 1/Cs_sur.diff_res_2 else gamma0;
+
+    Je_steam = if Ce_steam.diff_on_1 then re_steam*gamma_e_steam*(Ce_steam.h_vol_1 - Ce_steam.h_vol_2) else 0;
+    Je_sup = if Ce_sup.diff_on_1 then re_sup*gamma_e_sup*(Ce_sup.h_vol_1 - Ce_sup.h_vol_2) else 0;
+    Je_eva = if Ce_eva.diff_on_1 then re_eva*gamma_e_eva*(Ce_eva.h_vol_1 - Ce_eva.h_vol_2) else 0;
+    Je_eco = if Ce_eco.diff_on_1 then re_eco*gamma_e_eco*(Ce_eco.h_vol_1 - Ce_eco.h_vol_2) else 0;
+    Js_eva =  if Cs_eva.diff_on_2 then rs_eva*gamma_s_eva*(Cs_eva.h_vol_2 - Cs_eva.h_vol_1) else 0;
+    Js_purg = if Cs_purg.diff_on_2 then rs_purg*gamma_s_purg*(Cs_purg.h_vol_2 - Cs_purg.h_vol_1) else 0;
+    Js_sup = if Cs_sup.diff_on_2 then rs_sup*gamma_s_sup*(Cs_sup.h_vol_2 - Cs_sup.h_vol_1) else 0;
+    Js_sur = if Cs_sur.diff_on_2 then rs_sur*gamma_s_sur*(Cs_sur.h_vol_2 - Cs_sur.h_vol_1) else 0;
+  else
+    re_steam = 0;
+    re_sup = 0;
+    re_eva = 0;
+    re_eco = 0;
+    rs_eva = 0;
+    rs_purg = 0;
+    rs_sup = 0;
+    rs_sur = 0;
+
+    gamma_e_steam = gamma0;
+    gamma_e_sup = gamma0;
+    gamma_e_eva = gamma0;
+    gamma_e_eco = gamma0;
+    gamma_s_eva = gamma0;
+    gamma_s_purg = gamma0;
+    gamma_s_sup = gamma0;
+    gamma_s_sur = gamma0;
+
+    Je_steam = 0;
+    Je_sup = 0;
+    Je_eva = 0;
+    Je_eco = 0;
+    Js_eva = 0;
+    Js_purg = 0;
+    Js_sup = 0;
+    Js_sur = 0;
+  end if;
+
+  J = Je_steam + Je_sup + Je_eva + Je_eco + Js_eva + Js_purg + Js_sup + Js_sur;
+
+  Ce_steam.diff_res_2 = 0;
+  Ce_sup.diff_res_2 = 0;
+  Ce_eva.diff_res_2 = 0;
+  Ce_eco.diff_res_2 = 0;
+  Cs_eva.diff_res_1 = 0;
+  Cs_purg.diff_res_1 = 0;
+  Cs_sup.diff_res_1 = 0;
+  Cs_sur.diff_res_1 = 0;
+
+  Ce_steam.diff_on_2 = diffusion;
+  Ce_sup.diff_on_2 = diffusion;
+  Ce_eva.diff_on_2 = diffusion;
+  Ce_eco.diff_on_2 = diffusion;
+  Cs_eva.diff_on_1 = diffusion;
+  Cs_purg.diff_on_1 = diffusion;
+  Cs_sup.diff_on_1 = diffusion;
+  Cs_sur.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid);
+
+  hl = lsat.h;
+  hv = vsat.h;
+  T = lsat.T;
+
+  Cth.T = T;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Ellipse(
+          extent={{-98,96},{98,-96}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-86,-44},{86,-44}},
+          color={28,108,200},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-44,-86},{44,-86}},
+          color={28,108,200},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-64,-72},{64,-72}},
+          color={28,108,200},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-78,-58},{76,-58}},
+          color={28,108,200},
+          pattern=LinePattern.Dash),
+        Text(extent={{-56,94},{-56,92}}, textString=
+                                             "Esteam")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Ellipse(
+          extent={{-98,96},{98,-96}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-86,-44},{86,-44}},
+          color={28,108,200},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-44,-86},{44,-86}},
+          color={28,108,200},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-64,-72},{64,-72}},
+          color={28,108,200},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-78,-58},{76,-58}},
+          color={28,108,200},
+          pattern=LinePattern.Dash)}),
+    Window(
+      x=0.33,
+      y=0.08,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end StaticDrum;
diff --git a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo
index aff2de09aa2a5093885de088bc85dd0fc786d595..cd99f793707e5da4bde3d29c9255721c82677d08 100644
--- a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo
+++ b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo
@@ -1,199 +1,199 @@
-within ThermoSysPro.Fluid.Junctions;
-model SteamDryer "Steam dryer"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real eta=1 "Steam dryer efficiency (0 <= eta <= 1)";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Real xe(start=1.0) "Vapor mass fraction at the inlet";
-  FluidType fluids[4] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Jev "Thermal power diffusion from inlet ev";
-  Units.SI.Power Jsv "Thermal power diffusion from outlet sv";
-  Units.SI.Power Jsl "Thermal power diffusion from outlet sl";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_ev "Diffusion conductance for inlet ev";
-  Units.SI.MassFlowRate gamma_sv "Diffusion conductance for outlet sv";
-  Units.SI.MassFlowRate gamma_sl "Diffusion conductance for outlet sl";
-  Real rev "Value of r(Q/gamma) for inlet ev";
-  Real rsv "Value of r(Q/gamma) for outlet sv";
-  Real rsl "Value of r(Q/gamma) for outlet sl";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev annotation (Placement(
-        transformation(extent={{-109,30},{-89,50}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csv annotation (
-      Placement(transformation(extent={{89,30},{109,50}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1
-    annotation (Placement(transformation(extent={{-100,-98},{-80,-78}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1
-    annotation (Placement(transformation(extent={{-76,-98},{-56,-78}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csl annotation (
-      Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0)));
-
-equation
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Cev.ftype;
-  fluids[3] = Csv.ftype;
-  fluids[4] = Csl.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "SteamDryer: fluids mixing in volume are not compatible with each other");
-
-  /* Check that eta is between 0 and 1 */
-  assert((eta >= 0) and (eta <= 1), "SteamDryer - Parameter eta should be >= 0 and <= 1");
-
-  /* Mass flow at the vapor outlet */
-  Csv.Q = noEvent(if (xe > 0) then Cev.Q*(1-eta*(1-xe)) else 0);
-
-  /* Mass balance equation */
-  0 = Cev.Q - Csv.Q - Csl.Q;
-
-  P = Cev.P;
-  P = Csv.P;
-  P = Csl.P;
-
-  /* Energy balance equation */
-  0 = Cev.Q*Cev.h - Csv.Q*Csv.h - Csl.Q*Csl.h + J;
-
-  Cev.h_vol_2 = h;
-  Csv.h_vol_1 = h;
-  Csl.h_vol_1 = noEvent(if (xe > 0) then lsat1.h else Cev.h);
-
-  /* Fluid composition balance equations*/
-  0 = Cev.Xco2*Cev.Q - Csv.Xco2*Csv.Q - Csl.Xco2*Csl.Q;
-  0 = Cev.Xh2o*Cev.Q - Csv.Xh2o*Csv.Q - Csl.Xh2o*Csl.Q;
-  0 = Cev.Xo2*Cev.Q - Csv.Xo2*Csv.Q - Csl.Xo2*Csl.Q;
-  0 = Cev.Xso2*Cev.Q - Csv.Xso2*Csv.Q - Csl.Xso2*Csl.Q;
-
-  Csv.ftype = ftype;
-  Csl.ftype = ftype;
-
-  Csv.Xco2 = Xco2;
-  Csv.Xh2o = Xh2o;
-  Csv.Xo2  = Xo2;
-  Csv.Xso2 = Xso2;
-
-  Csl.Xco2 = Xco2;
-  Csl.Xh2o = Xh2o;
-  Csl.Xo2  = Xo2;
-  Csl.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Csv.h = ThermoSysPro.Functions.SmoothCond(Csv.Q/gamma_sv, Csv.h_vol_1, Csv.h_vol_2, 1);
-    Csl.h = ThermoSysPro.Functions.SmoothCond(Csl.Q/gamma_sl, Csl.h_vol_1, Csl.h_vol_2, 1);
-  else
-    Csv.h = if (Csv.Q > 0) then Csv.h_vol_1 else Csv.h_vol_2;
-    Csl.h = if (Csl.Q > 0) then Csl.h_vol_1 else Csl.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    rev = if Cev.diff_on_1 then exp(-0.033*(Cev.Q*Cev.diff_res_1)^2) else 0;
-    rsv = if Csv.diff_on_2 then exp(-0.033*(Csv.Q*Csv.diff_res_2)^2) else 0;
-    rsl = if Csl.diff_on_2 then exp(-0.033*(Csl.Q*Csl.diff_res_2)^2) else 0;
-
-    gamma_ev = if Cev.diff_on_1 then 1/Cev.diff_res_1 else gamma0;
-    gamma_sv = if Csv.diff_on_2 then 1/Csv.diff_res_2 else gamma0;
-    gamma_sl = if Csl.diff_on_2 then 1/Csl.diff_res_2 else gamma0;
-
-    Jev = if Cev.diff_on_1 then rev*gamma_ev*(Cev.h_vol_1 - Cev.h_vol_2) else 0;
-    Jsl = if Csl.diff_on_2 then rsl*gamma_sl*(Csl.h_vol_2 - Csl.h_vol_1) else 0;
-    Jsv = if Csv.diff_on_2 then rsv*gamma_sv*(Csv.h_vol_2 - Csv.h_vol_1) else 0;
-  else
-    rev = 0;
-    rsv = 0;
-    rsl = 0;
-
-    gamma_ev = gamma0;
-    gamma_sv = gamma0;
-    gamma_sl = gamma0;
-
-    Jev = 0;
-    Jsv = 0;
-    Jsl = 0;
-  end if;
-
-  J = Jev + Jsv + Jsl;
-
-  Cev.diff_res_2 = 0;
-  Csv.diff_res_1 = 0;
-  Csl.diff_res_1 = 0;
-
-  Cev.diff_on_2 = diffusion;
-  Csv.diff_on_1 = diffusion;
-  Csl.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  proe = ThermoSysPro.Properties.Fluid.Ph(Cev.P, Cev.h, mode_e, fluid);
-
-  /* Vapor mass fraction at the inlet */
-  xe = proe.x;
-
-  /* Fluid thermodynamic properties at the saturation point */
-  (lsat1,vsat1) = ThermoSysPro.Properties.Fluid.Water_sat_P(Cev.P, fluid);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-98,40},{-18,-100},{22,-100},{102,40},{-98,40}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,40},{-20,-100},{20,-100},{100,40},{-100,40}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SteamDryer;
+within ThermoSysPro.Fluid.Junctions;
+model SteamDryer "Steam dryer"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real eta=1 "Steam dryer efficiency (0 <= eta <= 1)";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Real xe(start=1.0) "Vapor mass fraction at the inlet";
+  FluidType fluids[4] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Jev "Thermal power diffusion from inlet ev";
+  Units.SI.Power Jsv "Thermal power diffusion from outlet sv";
+  Units.SI.Power Jsl "Thermal power diffusion from outlet sl";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_ev "Diffusion conductance for inlet ev";
+  Units.SI.MassFlowRate gamma_sv "Diffusion conductance for outlet sv";
+  Units.SI.MassFlowRate gamma_sl "Diffusion conductance for outlet sl";
+  Real rev "Value of r(Q/gamma) for inlet ev";
+  Real rsv "Value of r(Q/gamma) for outlet sv";
+  Real rsl "Value of r(Q/gamma) for outlet sl";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev annotation (Placement(
+        transformation(extent={{-109,30},{-89,50}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csv annotation (
+      Placement(transformation(extent={{89,30},{109,50}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1
+    annotation (Placement(transformation(extent={{-100,-98},{-80,-78}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1
+    annotation (Placement(transformation(extent={{-76,-98},{-56,-78}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csl annotation (
+      Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0)));
+
+equation
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Cev.ftype;
+  fluids[3] = Csv.ftype;
+  fluids[4] = Csl.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "SteamDryer: fluids mixing in volume are not compatible with each other");
+
+  /* Check that eta is between 0 and 1 */
+  assert((eta >= 0) and (eta <= 1), "SteamDryer - Parameter eta should be >= 0 and <= 1");
+
+  /* Mass flow at the vapor outlet */
+  Csv.Q = noEvent(if (xe > 0) then Cev.Q*(1-eta*(1-xe)) else 0);
+
+  /* Mass balance equation */
+  0 = Cev.Q - Csv.Q - Csl.Q;
+
+  P = Cev.P;
+  P = Csv.P;
+  P = Csl.P;
+
+  /* Energy balance equation */
+  0 = Cev.Q*Cev.h - Csv.Q*Csv.h - Csl.Q*Csl.h + J;
+
+  Cev.h_vol_2 = h;
+  Csv.h_vol_1 = h;
+  Csl.h_vol_1 = noEvent(if (xe > 0) then lsat1.h else Cev.h);
+
+  /* Fluid composition balance equations*/
+  0 = Cev.Xco2*Cev.Q - Csv.Xco2*Csv.Q - Csl.Xco2*Csl.Q;
+  0 = Cev.Xh2o*Cev.Q - Csv.Xh2o*Csv.Q - Csl.Xh2o*Csl.Q;
+  0 = Cev.Xo2*Cev.Q - Csv.Xo2*Csv.Q - Csl.Xo2*Csl.Q;
+  0 = Cev.Xso2*Cev.Q - Csv.Xso2*Csv.Q - Csl.Xso2*Csl.Q;
+
+  Csv.ftype = ftype;
+  Csl.ftype = ftype;
+
+  Csv.Xco2 = Xco2;
+  Csv.Xh2o = Xh2o;
+  Csv.Xo2  = Xo2;
+  Csv.Xso2 = Xso2;
+
+  Csl.Xco2 = Xco2;
+  Csl.Xh2o = Xh2o;
+  Csl.Xo2  = Xo2;
+  Csl.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Csv.h = ThermoSysPro.Functions.SmoothCond(Csv.Q/gamma_sv, Csv.h_vol_1, Csv.h_vol_2, 1);
+    Csl.h = ThermoSysPro.Functions.SmoothCond(Csl.Q/gamma_sl, Csl.h_vol_1, Csl.h_vol_2, 1);
+  else
+    Csv.h = if (Csv.Q > 0) then Csv.h_vol_1 else Csv.h_vol_2;
+    Csl.h = if (Csl.Q > 0) then Csl.h_vol_1 else Csl.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    rev = if Cev.diff_on_1 then exp(-0.033*(Cev.Q*Cev.diff_res_1)^2) else 0;
+    rsv = if Csv.diff_on_2 then exp(-0.033*(Csv.Q*Csv.diff_res_2)^2) else 0;
+    rsl = if Csl.diff_on_2 then exp(-0.033*(Csl.Q*Csl.diff_res_2)^2) else 0;
+
+    gamma_ev = if Cev.diff_on_1 then 1/Cev.diff_res_1 else gamma0;
+    gamma_sv = if Csv.diff_on_2 then 1/Csv.diff_res_2 else gamma0;
+    gamma_sl = if Csl.diff_on_2 then 1/Csl.diff_res_2 else gamma0;
+
+    Jev = if Cev.diff_on_1 then rev*gamma_ev*(Cev.h_vol_1 - Cev.h_vol_2) else 0;
+    Jsl = if Csl.diff_on_2 then rsl*gamma_sl*(Csl.h_vol_2 - Csl.h_vol_1) else 0;
+    Jsv = if Csv.diff_on_2 then rsv*gamma_sv*(Csv.h_vol_2 - Csv.h_vol_1) else 0;
+  else
+    rev = 0;
+    rsv = 0;
+    rsl = 0;
+
+    gamma_ev = gamma0;
+    gamma_sv = gamma0;
+    gamma_sl = gamma0;
+
+    Jev = 0;
+    Jsv = 0;
+    Jsl = 0;
+  end if;
+
+  J = Jev + Jsv + Jsl;
+
+  Cev.diff_res_2 = 0;
+  Csv.diff_res_1 = 0;
+  Csl.diff_res_1 = 0;
+
+  Cev.diff_on_2 = diffusion;
+  Csv.diff_on_1 = diffusion;
+  Csl.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  proe = ThermoSysPro.Properties.Fluid.Ph(Cev.P, Cev.h, mode_e, fluid);
+
+  /* Vapor mass fraction at the inlet */
+  xe = proe.x;
+
+  /* Fluid thermodynamic properties at the saturation point */
+  (lsat1,vsat1) = ThermoSysPro.Properties.Fluid.Water_sat_P(Cev.P, fluid);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-98,40},{-18,-100},{22,-100},{102,40},{-98,40}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,40},{-20,-100},{20,-100},{100,40},{-100,40}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SteamDryer;
diff --git a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo
index 76cc00f5f9c4d7afd1e25ba9784a490cb0af4ea8..d31b433a26d38234d638dd643cd8b6c9ffa286ab 100644
--- a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo
+++ b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo
@@ -1,194 +1,194 @@
-within ThermoSysPro.Fluid.Junctions;
-model SteamExtractionSplitter "Splitter for steam extraction"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real alpha = 1
-    "Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 <= alpha <= 1)";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  Real x_ex(start=0.99) "Vapor mass fraction at the extraction outlet";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  FluidType fluids[4] "Fluids mixing in volume";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je "Thermal power diffusion from inlet e";
-  Units.SI.Power Js "Thermal power diffusion from outlet s";
-  Units.SI.Power Jex "Thermal power diffusion from outlet ex";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
-  Units.SI.MassFlowRate gamma_ex "Diffusion conductance for outlet ex";
-  Real re "Value of r(Q/gamma) for inlet e";
-  Real rs "Value of r(Q/gamma) for outlet s";
-  Real rex "Value of r(Q/gamma) for outlet ex";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
-        transformation(extent={{-113,-10},{-93,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
-        transformation(extent={{93,-10},{113,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction outlet"
-    annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=
-            0)));
-equation
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = Cs.ftype;
-  fluids[4] = Cex.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "SteamExtractionSplitter: fluids mixing in volume are not compatible with each other");
-
-  /* Mass balance equation */
-  0 = Ce.Q - Cs.Q - Cex.Q;
-
-  P = Ce.P;
-  P = Cs.P;
-  P = Cex.P;
-
-  /* Energy balance equation */
-  0 = Ce.Q*Ce.h - Cs.Q*Cs.h - Cex.Q*Cex.h + J;
-
-  Ce.h_vol_2 = h;
-  Cs.h_vol_1 = h;
-  Cex.h_vol_1 = if noEvent(x_ex < 1) then (1 - x_ex)*lsat.h + x_ex*vsat.h else h;
-
-  /* Fluid composition */
-  0 = Ce.Xco2*Ce.Q - Cs.Xco2*Cs.Q - Cex.Xco2*Cex.Q;
-  0 = Ce.Xh2o*Ce.Q - Cs.Xh2o*Cs.Q - Cex.Xh2o*Cex.Q;
-  0 = Ce.Xo2*Ce.Q - Cs.Xo2*Cs.Q - Cex.Xo2*Cex.Q;
-  0 = Ce.Xso2*Ce.Q - Cs.Xso2*Cs.Q - Cex.Xso2*Cex.Q;
-
-  Cs.ftype = ftype;
-  Cex.ftype = ftype;
-
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2  = Xo2;
-  Cs.Xso2 = Xso2;
-
-  Cex.Xco2 = Xco2;
-  Cex.Xh2o = Xh2o;
-  Cex.Xo2  = Xo2;
-  Cex.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-    Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1);
-  else
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-    Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-    rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-    gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-    Jex = if Cex.diff_on_2 then rex*gamma_ex*(Cex.h_vol_2 - Cex.h_vol_1) else 0;
-  else
-    re = 0;
-    rs = 0;
-    rex = 0;
-
-    gamma_e = gamma0;
-    gamma_s = gamma0;
-    gamma_ex = gamma0;
-
-    Je = 0;
-    Js = 0;
-    Jex = 0;
-  end if;
-
-  J = Je + Js + Jex;
-
-  Ce.diff_res_2 = 0;
-  Cs.diff_res_1 = 0;
-  Cex.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  Cs.diff_on_1 = diffusion;
-  Cex.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties at the inlet */
-  proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, mode_e,fluid);
-
-  /* Fluid thermodynamic properties at the saturation point */
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid);
-
-  /* Vapor mass fraction at the extraction outlet */
-  x_ex = alpha*proe.x;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,30},{-100,-30},{-40,-30},{20,-100},{20,-100},{60,-100},
-              {70,-100},{0,-30},{100,-30},{100,30},{-100,30}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,28},{-100,-32},{-40,-32},{20,-102},{20,-102},{60,-102},
-              {70,-102},{0,-32},{100,-32},{100,28},{-100,28}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({255,255,0},
-          if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SteamExtractionSplitter;
+within ThermoSysPro.Fluid.Junctions;
+model SteamExtractionSplitter "Splitter for steam extraction"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real alpha = 1
+    "Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 <= alpha <= 1)";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  Real x_ex(start=0.99) "Vapor mass fraction at the extraction outlet";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  FluidType fluids[4] "Fluids mixing in volume";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je "Thermal power diffusion from inlet e";
+  Units.SI.Power Js "Thermal power diffusion from outlet s";
+  Units.SI.Power Jex "Thermal power diffusion from outlet ex";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
+  Units.SI.MassFlowRate gamma_ex "Diffusion conductance for outlet ex";
+  Real re "Value of r(Q/gamma) for inlet e";
+  Real rs "Value of r(Q/gamma) for outlet s";
+  Real rex "Value of r(Q/gamma) for outlet ex";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
+        transformation(extent={{-113,-10},{-93,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
+        transformation(extent={{93,-10},{113,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction outlet"
+    annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=
+            0)));
+equation
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = Cs.ftype;
+  fluids[4] = Cex.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "SteamExtractionSplitter: fluids mixing in volume are not compatible with each other");
+
+  /* Mass balance equation */
+  0 = Ce.Q - Cs.Q - Cex.Q;
+
+  P = Ce.P;
+  P = Cs.P;
+  P = Cex.P;
+
+  /* Energy balance equation */
+  0 = Ce.Q*Ce.h - Cs.Q*Cs.h - Cex.Q*Cex.h + J;
+
+  Ce.h_vol_2 = h;
+  Cs.h_vol_1 = h;
+  Cex.h_vol_1 = if noEvent(x_ex < 1) then (1 - x_ex)*lsat.h + x_ex*vsat.h else h;
+
+  /* Fluid composition */
+  0 = Ce.Xco2*Ce.Q - Cs.Xco2*Cs.Q - Cex.Xco2*Cex.Q;
+  0 = Ce.Xh2o*Ce.Q - Cs.Xh2o*Cs.Q - Cex.Xh2o*Cex.Q;
+  0 = Ce.Xo2*Ce.Q - Cs.Xo2*Cs.Q - Cex.Xo2*Cex.Q;
+  0 = Ce.Xso2*Ce.Q - Cs.Xso2*Cs.Q - Cex.Xso2*Cex.Q;
+
+  Cs.ftype = ftype;
+  Cex.ftype = ftype;
+
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2  = Xo2;
+  Cs.Xso2 = Xso2;
+
+  Cex.Xco2 = Xco2;
+  Cex.Xh2o = Xh2o;
+  Cex.Xo2  = Xo2;
+  Cex.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+    Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1);
+  else
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+    Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+    rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+    gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+    Jex = if Cex.diff_on_2 then rex*gamma_ex*(Cex.h_vol_2 - Cex.h_vol_1) else 0;
+  else
+    re = 0;
+    rs = 0;
+    rex = 0;
+
+    gamma_e = gamma0;
+    gamma_s = gamma0;
+    gamma_ex = gamma0;
+
+    Je = 0;
+    Js = 0;
+    Jex = 0;
+  end if;
+
+  J = Je + Js + Jex;
+
+  Ce.diff_res_2 = 0;
+  Cs.diff_res_1 = 0;
+  Cex.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  Cs.diff_on_1 = diffusion;
+  Cex.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties at the inlet */
+  proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, mode_e,fluid);
+
+  /* Fluid thermodynamic properties at the saturation point */
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid);
+
+  /* Vapor mass fraction at the extraction outlet */
+  x_ex = alpha*proe.x;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,30},{-100,-30},{-40,-30},{20,-100},{20,-100},{60,-100},
+              {70,-100},{0,-30},{100,-30},{100,30},{-100,30}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,28},{-100,-32},{-40,-32},{20,-102},{20,-102},{60,-102},
+              {70,-102},{0,-32},{100,-32},{100,28},{-100,28}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({255,255,0},
+          if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SteamExtractionSplitter;
diff --git a/ThermoSysPro/Fluid/Junctions/package.mo b/ThermoSysPro/Fluid/Junctions/package.mo
index ac2273629e04538f35c82751a6675f08e9d04767..c059b8a151856facc6a4d99069a3190930bfe0b0 100644
--- a/ThermoSysPro/Fluid/Junctions/package.mo
+++ b/ThermoSysPro/Fluid/Junctions/package.mo
@@ -1,120 +1,120 @@
-within ThermoSysPro.Fluid;
-package Junctions "Junctions"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Junctions;
+within ThermoSysPro.Fluid;
+package Junctions "Junctions"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Junctions;
diff --git a/ThermoSysPro/Fluid/Junctions/package.order b/ThermoSysPro/Fluid/Junctions/package.order
index a6768c36c16dc6053cf06fbd0d8eeb587070e4c5..a5e732e4f6d6f29c66cbf3c011e12821a86d522b 100644
--- a/ThermoSysPro/Fluid/Junctions/package.order
+++ b/ThermoSysPro/Fluid/Junctions/package.order
@@ -1,10 +1,10 @@
-DeheaterMixer2
-MassFlowMultiplier
-Mixer2
-Mixer3
-Mixer8
-Splitter2
-Splitter3
-StaticDrum
-SteamDryer
-SteamExtractionSplitter
+DeheaterMixer2
+MassFlowMultiplier
+Mixer2
+Mixer3
+Mixer8
+Splitter2
+Splitter3
+StaticDrum
+SteamDryer
+SteamExtractionSplitter
diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo
index 342ebe74fca664134c031f069e98fbaec805d8f7..f4d85c00fb037b8ce838411abbca155dfda1568b 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo
+++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.Fluid.LoopBreakers;
-model LoopBreakerH "Specific enthalpy loop breaker"
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.P = C2.P;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-38,38},{42,-42}},
-          lineColor={0,0,255},
-          textString=
-               "h"),
-        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-38,38},{42,-42}},
-          lineColor={0,0,255},
-          textString=
-               "h"),
-        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerH;
+within ThermoSysPro.Fluid.LoopBreakers;
+model LoopBreakerH "Specific enthalpy loop breaker"
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.P = C2.P;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-38,38},{42,-42}},
+          lineColor={0,0,255},
+          textString=
+               "h"),
+        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-38,38},{42,-42}},
+          lineColor={0,0,255},
+          textString=
+               "h"),
+        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerH;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo
index 03006306458daa3ca0590a4095b43f5e9f488ab9..4d1b87ba588ddf11fdeac421b3a1e34cf34921d6 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo
+++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.Fluid.LoopBreakers;
-model LoopBreakerP "Pressure loop breaker"
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,38},{40,-42}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-38,38},{42,-42}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerP;
+within ThermoSysPro.Fluid.LoopBreakers;
+model LoopBreakerP "Pressure loop breaker"
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,38},{40,-42}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-38,38},{42,-42}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerP;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo
index 7350ddc41715a6cee2d72e7fec467cde3c8651f3..6880ba4e331342f486bc7654d315fc911fd293f6 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo
+++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.Fluid.LoopBreakers;
-model LoopBreakerQ "Mass flow loop breaker"
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={255,255,0}),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,38},{40,-42}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,0}),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerQ;
+within ThermoSysPro.Fluid.LoopBreakers;
+model LoopBreakerQ "Mass flow loop breaker"
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={255,255,0}),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,38},{40,-42}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,0}),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerQ;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo
index 3c6c7feac358ae054c9f9f76c1baf4b4d101778c..ea72c82af8dd8458b54afd3da4fbf18fbe40227c 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo
+++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo
@@ -1,71 +1,71 @@
-within ThermoSysPro.Fluid.LoopBreakers;
-model LoopBreakerXgas "Fluid composition loop breaker"
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.P = C2.P;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-38,38},{42,-42}},
-          lineColor={0,0,255},
-          textString="X"),
-        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-40,38},{40,-42}},
-          lineColor={0,0,255},
-          textString="X"),
-        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerXgas;
+within ThermoSysPro.Fluid.LoopBreakers;
+model LoopBreakerXgas "Fluid composition loop breaker"
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.P = C2.P;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-38,38},{42,-42}},
+          lineColor={0,0,255},
+          textString="X"),
+        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-40,38},{40,-42}},
+          lineColor={0,0,255},
+          textString="X"),
+        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerXgas;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/package.mo b/ThermoSysPro/Fluid/LoopBreakers/package.mo
index 3b25dd80caa0ea1c7317329ddd7289760dd32523..d228b9d6771871fe374f8ba1fb83f0cf4291f487 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/package.mo
+++ b/ThermoSysPro/Fluid/LoopBreakers/package.mo
@@ -1,121 +1,121 @@
-within ThermoSysPro.Fluid;
-package LoopBreakers "Loop breakers"
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end LoopBreakers;
+within ThermoSysPro.Fluid;
+package LoopBreakers "Loop breakers"
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end LoopBreakers;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/package.order b/ThermoSysPro/Fluid/LoopBreakers/package.order
index 5d012c6b43d42117d8334232ed329d8a5d4dc966..4b729fa77e3ba743c05eaaaa49b062c890508012 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/package.order
+++ b/ThermoSysPro/Fluid/LoopBreakers/package.order
@@ -1,4 +1,4 @@
-LoopBreakerH
-LoopBreakerP
-LoopBreakerQ
-LoopBreakerXgas
+LoopBreakerH
+LoopBreakerP
+LoopBreakerQ
+LoopBreakerXgas
diff --git a/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo
index a7c63e81a9d06651a8024e6a660701f578776bdc..aa03b4da5a92fb33583c70bc6ca8242b3cfd2073 100644
--- a/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo
+++ b/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo
@@ -1,263 +1,263 @@
-within ThermoSysPro.Fluid.Machines;
-model CHPEngineBarkantineSystem
-  parameter Units.SI.Temperature Tair=300 "Inlet air temperature";
-  parameter Real RechFumEff=0.73 "Flue gases heater efficiency";
-  parameter Real RechWaterEff=0.9 "Water heater efficiency";
-  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
-                                                         annotation(choices(
-    choice=1 "Fixed nominal efficiency",
-    choice=2 "Efficiency computed using a linear function Coef_Rm",
-    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
-  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency";
-  parameter Units.SI.Power Pnom=1.4e6 "Engine nominal power";
-
-  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ FuelSource(
-    Hum=0,
-    Xh=0.25,
-    Xs=0,
-    Xashes=0,
-    Xc=0.75,
-    Xo=0,
-    Xn=0,
-    rho=0.72,
-    LHV=48e6,
-    Q0=0.0727958,
-    P0=225000,
-    T0=299,
-    Vol=1)  annotation (Placement(transformation(extent={{62,-26},{38,-2}},
-          rotation=0)));
-  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ WaterSource(
-    h0=293e3,
-    Q0=11.8,
-    P0=300000) annotation (Placement(transformation(extent={{62,-46},{40,-24}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Machines.InternalCombustionEngine Engine(
-    DPe=1,
-    MMg=20,
-    Kd=1.33,
-    Wcomb(fixed=false, start=3.4942e6),
-    exc(fixed=false, start=1.8),
-    RV=6.45,
-    Kc=1.28,
-    Xpth=0.01,
-    Xref=0.2896,
-    Wmeca(fixed=false, start=1400e3),
-    mechanical_efficiency_type=mechanical_efficiency_type,
-    Rmeca_nom=Rmeca_nom,
-    Tsf(fixed=false, start=815)) annotation (Placement(transformation(
-        origin={0,0},
-        extent={{-24,-24},{24,24}},
-        rotation=90)));
-  ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff
-    ExchangerWaterWater(
-    EffEch=RechWaterEff, exchanger_type=3,
-    Kf=50)     annotation (Placement(transformation(
-        origin={0,-66},
-        extent={{14,14},{-14,-14}},
-        rotation=270)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC1(L=0.0001)
-    annotation (Placement(transformation(
-        origin={-60,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.BoundaryConditions.Sink WaterSteamSink annotation (
-      Placement(transformation(extent={{-22,-72},{-44,-48}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC2(L=0.0001)
-    annotation (Placement(transformation(
-        origin={-80,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff
-    ExchangerWaterFlueGases(                             EffEch=RechFumEff,
-    exchanger_type=3,
-    Kf=50,
-    DTfroid=283.15,
-    Tsf(fixed=false, start=363))
-             annotation (Placement(transformation(
-        origin={0,68},
-        extent={{-14,-14},{14,14}},
-        rotation=90)));
-  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss silencieux(K=20)
-           annotation (Placement(transformation(
-        origin={-39,16},
-        extent={{10,-9},{-10,9}},
-        rotation=270)));
-  Interfaces.Connectors.FluidOutlet outletWaterSteam annotation (Placement(
-        transformation(extent={{180,80},{220,120}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet inletWaterSteam annotation (Placement(
-        transformation(extent={{-220,80},{-180,120}}, rotation=0)));
-  BoundaryConditions.Sink FlueGasesSink annotation (Placement(transformation(
-          extent={{-56,86},{-80,110}}, rotation=0)));
-  BoundaryConditions.SourcePQ AirSource(
-    Xco2=0,
-    Xh2o=0.005,
-    Xo2=0.23,
-    Xso2=0,
-    h0=40000,
-    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
-    option_temperature=true,
-    P0=160000)
-    annotation (Placement(transformation(extent={{64,2},{40,26}}, rotation=0)));
-
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante AirTemperature(k=Tair)
-    "Air temperature" annotation (Placement(transformation(extent={{100,-10},{80,
-            10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante AirMassFlowRate(k=3)
-    "Air mass flow rate" annotation (Placement(transformation(extent={{20,30},{40,
-            50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante WaterMassFlowRate(k=11.8)
-    annotation (Placement(transformation(extent={{96,-34},{80,-18}}, rotation=0)));
-equation
-  connect(ExchangerWaterWater.Ef, inletWaterSteam) annotation (Line(points={{-9.19104e-016,
-          -80},{0,-80},{0,-100},{-140,-100},{-140,100},{-200,100}}));
-  connect(PDC2.C1, ExchangerWaterWater.Sf)
-    annotation (Line(points={{-80,-20},{-80,-40},{-0.14,-40},{-0.14,-52}}));
-  connect(PDC1.C2, ExchangerWaterWater.Ec)
-                                   annotation (Line(points={{-60,-20},{-60,-71.6},
-          {-5.74,-71.6}},        color={0,0,0}));
-  connect(AirMassFlowRate.y, AirSource.IMassFlow)
-    annotation (Line(points={{41,40},{52,40},{52,20}}));
-  connect(WaterSource.IMassFlow, WaterMassFlowRate.y)
-    annotation (Line(points={{51,-29.5},{51,-26},{79.2,-26}}));
-  connect(silencieux.C1, Engine.Cfg) annotation (Line(
-      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
-      color={0,0,0},
-      thickness=0.5));
-  connect(Engine.Cws1, WaterSource.C) annotation (Line(points={{-1.32262e-015,-21.6},
-          {-1.32262e-015,-35},{40,-35}}));
-  connect(Engine.Cair, AirSource.C) annotation (Line(
-      points={{21.6,-1.77636e-015},{32,-1.77636e-015},{32,14},{40,14}},
-      color={0,0,0},
-      thickness=0.5));
-  connect(PDC1.C1, Engine.Cws2)
-    annotation (Line(points={{-60,0},{-60,32},{1.32262e-015,32},{1.32262e-015,
-          21.6}}));
-  connect(Engine.Cfuel, FuelSource.C) annotation (Line(points={{21.6,-16.8},{32,
-          -16.8},{32,-14},{38,-14}}, color={0,0,0}));
-  connect(silencieux.C2, ExchangerWaterFlueGases.Ec) annotation (Line(points={{-39,26},
-          {-40,26},{-40,58},{-40,62.4},{-5.74,62.4}},         color={0,0,0},
-      thickness=0.5));
-  connect(AirTemperature.y, AirSource.ISpecificEnthalpyOrTemperature)
-    annotation (Line(points={{79,0},{64,0},{52,0},{52,8}}, color={0,0,255}));
-  connect(ExchangerWaterFlueGases.Sf, outletWaterSteam) annotation (Line(points=
-         {{-0.14,82},{-0.14,100},{200,100}}, color={0,0,0}));
-  connect(PDC2.C2, ExchangerWaterFlueGases.Ef) annotation (Line(points={{-80,0},
-          {-80,44},{8.88178e-016,44},{8.88178e-016,54}}, color={0,0,0}));
-  connect(ExchangerWaterFlueGases.Sc, FlueGasesSink.C) annotation (Line(
-      points={{-5.74,73.6},{-40,73.6},{-40,98},{-56,98}},
-      color={0,0,0},
-      thickness=0.5));
-  connect(WaterSteamSink.C, ExchangerWaterWater.Sc) annotation (Line(points={{-22,
-          -60},{-14,-60},{-14,-60.4},{-5.74,-60.4}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1)),
-                          Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-200,200},{200,-200}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Dash,
-          lineThickness=0.5,
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-180,0},{-20,-160}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-110,-144},{-96,-126},{-100,-136},{-82,-134},{-98,-140},{-78,
-              -146},{-94,-144},{-110,-156},{-102,-146},{-110,-144}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-146,-122},{-146,-80},{-106,-80},{-106,-22},{-100,-30},{-94,
-              -22},{-94,-80},{-52,-80},{-52,-122},{-146,-122}},
-          lineColor={0,0,0},
-          fillColor={170,255,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-180,-50},{-134,-50},{-134,-26},{-62,-26},{-62,-50},{-20,-50},
-              {-20,-42},{-54,-42},{-54,-18},{-142,-18},{-142,-42},{-180,-42},{
-              -180,-50}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{20,142},{180,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{50,144},{146,76}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Rectangle(
-          extent={{-180,142},{-20,40}},
-          lineColor={0,0,255},
-          fillColor={72,143,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-160,40},{-160,118},{-100,74},{-100,74},{-100,74}},
-          color={255,0,0},
-          thickness=1),
-        Text(
-          extent={{-148,148},{-52,80}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Line(
-          points={{38,40},{38,118},{98,74},{158,122},{158,40}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-20,100},{20,100}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{-160,0},{-160,40}},
-          color={255,0,0},
-          thickness=1),
-        Line(
-          points={{-40,0},{-40,40}},
-          color={0,0,255},
-          thickness=1),
-        Polygon(
-          points={{-20,-50},{26,-50},{26,-50},{38,-50},{38,-50},{44,-50},{44,40},
-              {36,40},{36,-42},{18,-42},{18,-42},{-20,-42},{-20,-50}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,40},{-40,118},{-100,74},{-100,74},{-100,74}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{40,40},{40,118},{100,74},{160,122},{160,40}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{42,40},{42,118},{102,74},{162,122},{162,40}},
-          color={0,0,0},
-          thickness=1)}),
-    DymolaStoredErrors,
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Guillaume Larrignon</li>
-<li>Bruno P&eacute;chin&eacute; </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end CHPEngineBarkantineSystem;
+within ThermoSysPro.Fluid.Machines;
+model CHPEngineBarkantineSystem
+  parameter Units.SI.Temperature Tair=300 "Inlet air temperature";
+  parameter Real RechFumEff=0.73 "Flue gases heater efficiency";
+  parameter Real RechWaterEff=0.9 "Water heater efficiency";
+  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
+                                                         annotation(choices(
+    choice=1 "Fixed nominal efficiency",
+    choice=2 "Efficiency computed using a linear function Coef_Rm",
+    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
+  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency";
+  parameter Units.SI.Power Pnom=1.4e6 "Engine nominal power";
+
+  ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ FuelSource(
+    Hum=0,
+    Xh=0.25,
+    Xs=0,
+    Xashes=0,
+    Xc=0.75,
+    Xo=0,
+    Xn=0,
+    rho=0.72,
+    LHV=48e6,
+    Q0=0.0727958,
+    P0=225000,
+    T0=299,
+    Vol=1)  annotation (Placement(transformation(extent={{62,-26},{38,-2}},
+          rotation=0)));
+  ThermoSysPro.Fluid.BoundaryConditions.SourcePQ WaterSource(
+    h0=293e3,
+    Q0=11.8,
+    P0=300000) annotation (Placement(transformation(extent={{62,-46},{40,-24}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Machines.InternalCombustionEngine Engine(
+    DPe=1,
+    MMg=20,
+    Kd=1.33,
+    Wcomb(fixed=false, start=3.4942e6),
+    exc(fixed=false, start=1.8),
+    RV=6.45,
+    Kc=1.28,
+    Xpth=0.01,
+    Xref=0.2896,
+    Wmeca(fixed=false, start=1400e3),
+    mechanical_efficiency_type=mechanical_efficiency_type,
+    Rmeca_nom=Rmeca_nom,
+    Tsf(fixed=false, start=815)) annotation (Placement(transformation(
+        origin={0,0},
+        extent={{-24,-24},{24,24}},
+        rotation=90)));
+  ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff
+    ExchangerWaterWater(
+    EffEch=RechWaterEff, exchanger_type=3,
+    Kf=50)     annotation (Placement(transformation(
+        origin={0,-66},
+        extent={{14,14},{-14,-14}},
+        rotation=270)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC1(L=0.0001)
+    annotation (Placement(transformation(
+        origin={-60,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.BoundaryConditions.Sink WaterSteamSink annotation (
+      Placement(transformation(extent={{-22,-72},{-44,-48}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC2(L=0.0001)
+    annotation (Placement(transformation(
+        origin={-80,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff
+    ExchangerWaterFlueGases(                             EffEch=RechFumEff,
+    exchanger_type=3,
+    Kf=50,
+    DTfroid=283.15,
+    Tsf(fixed=false, start=363))
+             annotation (Placement(transformation(
+        origin={0,68},
+        extent={{-14,-14},{14,14}},
+        rotation=90)));
+  ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss silencieux(K=20)
+           annotation (Placement(transformation(
+        origin={-39,16},
+        extent={{10,-9},{-10,9}},
+        rotation=270)));
+  Interfaces.Connectors.FluidOutlet outletWaterSteam annotation (Placement(
+        transformation(extent={{180,80},{220,120}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet inletWaterSteam annotation (Placement(
+        transformation(extent={{-220,80},{-180,120}}, rotation=0)));
+  BoundaryConditions.Sink FlueGasesSink annotation (Placement(transformation(
+          extent={{-56,86},{-80,110}}, rotation=0)));
+  BoundaryConditions.SourcePQ AirSource(
+    Xco2=0,
+    Xh2o=0.005,
+    Xo2=0.23,
+    Xso2=0,
+    h0=40000,
+    ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases,
+    option_temperature=true,
+    P0=160000)
+    annotation (Placement(transformation(extent={{64,2},{40,26}}, rotation=0)));
+
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante AirTemperature(k=Tair)
+    "Air temperature" annotation (Placement(transformation(extent={{100,-10},{80,
+            10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante AirMassFlowRate(k=3)
+    "Air mass flow rate" annotation (Placement(transformation(extent={{20,30},{40,
+            50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante WaterMassFlowRate(k=11.8)
+    annotation (Placement(transformation(extent={{96,-34},{80,-18}}, rotation=0)));
+equation
+  connect(ExchangerWaterWater.Ef, inletWaterSteam) annotation (Line(points={{-9.19104e-016,
+          -80},{0,-80},{0,-100},{-140,-100},{-140,100},{-200,100}}));
+  connect(PDC2.C1, ExchangerWaterWater.Sf)
+    annotation (Line(points={{-80,-20},{-80,-40},{-0.14,-40},{-0.14,-52}}));
+  connect(PDC1.C2, ExchangerWaterWater.Ec)
+                                   annotation (Line(points={{-60,-20},{-60,-71.6},
+          {-5.74,-71.6}},        color={0,0,0}));
+  connect(AirMassFlowRate.y, AirSource.IMassFlow)
+    annotation (Line(points={{41,40},{52,40},{52,20}}));
+  connect(WaterSource.IMassFlow, WaterMassFlowRate.y)
+    annotation (Line(points={{51,-29.5},{51,-26},{79.2,-26}}));
+  connect(silencieux.C1, Engine.Cfg) annotation (Line(
+      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
+      color={0,0,0},
+      thickness=0.5));
+  connect(Engine.Cws1, WaterSource.C) annotation (Line(points={{-1.32262e-015,-21.6},
+          {-1.32262e-015,-35},{40,-35}}));
+  connect(Engine.Cair, AirSource.C) annotation (Line(
+      points={{21.6,-1.77636e-015},{32,-1.77636e-015},{32,14},{40,14}},
+      color={0,0,0},
+      thickness=0.5));
+  connect(PDC1.C1, Engine.Cws2)
+    annotation (Line(points={{-60,0},{-60,32},{1.32262e-015,32},{1.32262e-015,
+          21.6}}));
+  connect(Engine.Cfuel, FuelSource.C) annotation (Line(points={{21.6,-16.8},{32,
+          -16.8},{32,-14},{38,-14}}, color={0,0,0}));
+  connect(silencieux.C2, ExchangerWaterFlueGases.Ec) annotation (Line(points={{-39,26},
+          {-40,26},{-40,58},{-40,62.4},{-5.74,62.4}},         color={0,0,0},
+      thickness=0.5));
+  connect(AirTemperature.y, AirSource.ISpecificEnthalpyOrTemperature)
+    annotation (Line(points={{79,0},{64,0},{52,0},{52,8}}, color={0,0,255}));
+  connect(ExchangerWaterFlueGases.Sf, outletWaterSteam) annotation (Line(points=
+         {{-0.14,82},{-0.14,100},{200,100}}, color={0,0,0}));
+  connect(PDC2.C2, ExchangerWaterFlueGases.Ef) annotation (Line(points={{-80,0},
+          {-80,44},{8.88178e-016,44},{8.88178e-016,54}}, color={0,0,0}));
+  connect(ExchangerWaterFlueGases.Sc, FlueGasesSink.C) annotation (Line(
+      points={{-5.74,73.6},{-40,73.6},{-40,98},{-56,98}},
+      color={0,0,0},
+      thickness=0.5));
+  connect(WaterSteamSink.C, ExchangerWaterWater.Sc) annotation (Line(points={{-22,
+          -60},{-14,-60},{-14,-60.4},{-5.74,-60.4}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1)),
+                          Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-200,200},{200,-200}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Dash,
+          lineThickness=0.5,
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-180,0},{-20,-160}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-110,-144},{-96,-126},{-100,-136},{-82,-134},{-98,-140},{-78,
+              -146},{-94,-144},{-110,-156},{-102,-146},{-110,-144}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-146,-122},{-146,-80},{-106,-80},{-106,-22},{-100,-30},{-94,
+              -22},{-94,-80},{-52,-80},{-52,-122},{-146,-122}},
+          lineColor={0,0,0},
+          fillColor={170,255,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-180,-50},{-134,-50},{-134,-26},{-62,-26},{-62,-50},{-20,-50},
+              {-20,-42},{-54,-42},{-54,-18},{-142,-18},{-142,-42},{-180,-42},{
+              -180,-50}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{20,142},{180,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{50,144},{146,76}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Rectangle(
+          extent={{-180,142},{-20,40}},
+          lineColor={0,0,255},
+          fillColor={72,143,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-160,40},{-160,118},{-100,74},{-100,74},{-100,74}},
+          color={255,0,0},
+          thickness=1),
+        Text(
+          extent={{-148,148},{-52,80}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Line(
+          points={{38,40},{38,118},{98,74},{158,122},{158,40}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-20,100},{20,100}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{-160,0},{-160,40}},
+          color={255,0,0},
+          thickness=1),
+        Line(
+          points={{-40,0},{-40,40}},
+          color={0,0,255},
+          thickness=1),
+        Polygon(
+          points={{-20,-50},{26,-50},{26,-50},{38,-50},{38,-50},{44,-50},{44,40},
+              {36,40},{36,-42},{18,-42},{18,-42},{-20,-42},{-20,-50}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,40},{-40,118},{-100,74},{-100,74},{-100,74}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{40,40},{40,118},{100,74},{160,122},{160,40}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{42,40},{42,118},{102,74},{162,122},{162,40}},
+          color={0,0,0},
+          thickness=1)}),
+    DymolaStoredErrors,
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Guillaume Larrignon</li>
+<li>Bruno P&eacute;chin&eacute; </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end CHPEngineBarkantineSystem;
diff --git a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo
index 2c9c0e6ac4dd074113f6c97c7ddf0e38ebb911f7..f23d4dc12501d3c166ec4a094245a338a9cf462e 100644
--- a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo
+++ b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo
@@ -1,334 +1,334 @@
-within ThermoSysPro.Fluid.Machines;
-model CentrifugalPump "Centrifugal pump"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N=1400
-    "Pump angular velocity in rpm (active if input M is not connected)";
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N_nom=1400
-    "Nominal angular velocity in rpm";
-  parameter Units.SI.MomentOfInertia J=10
-    "Rotating masses moment of inertia (active if dynamic_mech_equation=true)";
-  parameter Units.SI.Volume V=1
-    "Pump volume (active if dynamic_energy_balance=true)";
-  parameter Boolean dynamic_mech_equation=false
-    "true: dynamic mechanical equation - false: static mechanical equation (active if input M is connected)";
-  parameter Boolean dynamic_energy_balance=false
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  parameter Integer mode_car=2
-    "1:nominal values and coef. c given by parameters - 2:nominal values and coef. c computed from semi-parabolic characteristics";
-  parameter Integer mode_car_hn=2
-    "1:complete pump head characteristics - 2:semi-parabolic pump head characteristics";
-  parameter Integer mode_car_Cr=2
-    "1:complete torque characteristics - 2:analytic formula";
-
-  parameter Units.SI.VolumeFlowRate Qv_nom_p=0.4781
-    "Nominal volumetric flow (active if mode_car=1)";
-  parameter Units.SI.Height hn_nom_p=22.879
-    "Nominal pump head (active if mode_car=1)";
-  parameter Units.SI.Height rh_nom_p=0.863
-    "Nominal pump efficiency (active if mode_car=1)";
-
-  parameter Real F_t[:]={ 0.634, 0.643, 0.646, 0.640, 0.629, 0.613, 0.595, 0.575, 0.552, 0.533, 0.516, 0.505,
-                          0.504, 0.510, 0.512, 0.522, 0.539, 0.559, 0.580, 0.601, 0.630, 0.662, 0.692, 0.722,
-                          0.753, 0.782, 0.808, 0.832, 0.857, 0.879, 0.904, 0.930, 0.959, 0.996, 1.027, 1.060,
-                          1.090, 1.124, 1.165, 1.204, 1.238, 1.258, 1.271, 1.282, 1.288, 1.281, 1.260, 1.225,
-                          1.172, 1.107, 1.031, 0.942, 0.842, 0.733, 0.617, 0.500, 0.368, 0.240, 0.125, 0.011,
-                         -0.102,-0.168,-0.255,-0.342,-0.423,-0.494,-0.556,-0.620,-0.655,-0.670,-0.670,-0.660,
-                         -0.655,-0.640,-0.600,-0.570,-0.520,-0.470,-0.430,-0.360,-0.275,-0.160,-0.040, 0.130,
-                          0.295, 0.430, 0.550, 0.620, 0.634}
-    "Head characteristics (active if mode_car_hn=1)";
-
-  parameter Real G_t[:]={-0.684,-0.547,-0.414,-0.292,-0.187,-0.105,-0.053,-0.012, 0.042, 0.097, 0.156, 0.227,
-                          0.300, 0.371, 0.444, 0.522, 0.596, 0.672, 0.738, 0.763, 0.797, 0.837, 0.865, 0.883,
-                          0.886, 0.877, 0.859, 0.838, 0.804, 0.758, 0.703, 0.645, 0.583, 0.520, 0.454, 0.408,
-                          0.370, 0.343, 0.331, 0.329, 0.338, 0.354, 0.372, 0.405, 0.450, 0.486, 0.520, 0.552,
-                          0.579, 0.603, 0.616, 0.617, 0.606, 0.582, 0.546, 0.500, 0.432, 0.360, 0.288, 0.214,
-                          0.123, 0.037,-0.053,-0.161,-0.248,-0.314,-0.372,-0.580,-0.740,-0.880,-1.000,-1.120,
-                         -1.250,-1.370,-1.490,-1.590,-1.660,-1.690,-1.770,-1.650,-1.590,-1.520,-1.420,-1.320,
-                         -1.230,-1.100,-0.980,-0.820, -0.684}
-    "Torque characteristics (active if mode_car_Cr=1)";
-
-  parameter Real c_p=1.288
-    "Dimensionless coef. of the semi-parabolic pump head characteristics (active if mode_car=1 and mode_car_hn=2)";
-  constant Real b=2
-    "Dimensionless coef. of the parabolic pump efficiency characteristics";
-
-  parameter Real hn_coef[2]={-88.67, 43.15}
-    "Coef. of the semi-parabolic pump head characteristics (active if mode_car=2)";
-  parameter Real rh_coef[2]={-3.7751, 3.61}
-    "Coef. of the parabolic pump efficiency characteristics (active if mode_car=2)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.AngularVelocity w_a_min=1.e-4 "Small angular velocity";
-  parameter Units.SI.VolumeFlowRate Qv_a_min=1.e-4 "Small volume flow rate";
-  parameter Real rh_min=0.05 "Minimum efficiency";
-
-public
-  Real w_a "Dimensionless angular velocity";
-  Real Qv_a(start=1) "Dimensionless volumetric flow";
-  Real hn_a(start=1) "Dimensionless head";
-  Real Cr_a(start=1) "Dimensionless resistive torque";
-  Real rh_a(start=1) "Dimensionless pump efficiency";
-  Units.SI.AngularVelocity w_nom "Nominal angular velocity";
-  Units.SI.VolumeFlowRate Qv_nom "Nominal volumetric flow";
-  Units.SI.Height hn_nom "Nominal pump head";
-  Units.SI.Torque Cr_nom "Nominal resistive hydraulic torque";
-  Real rh_nom "Nominal pump efficiency";
-  Units.SI.Angle theta "Angle arctan(Qv_a/w_a) (rad)";
-  ThermoSysPro.Units.nonSI.Angle_deg theta_deg "Angle arctan(Qv_a/w_a) (deg)";
-  Units.SI.AngularVelocity w "Angular velocity in rad";
-  ThermoSysPro.Units.nonSI.AngularVelocity_rpm w_rpm "Angular velocity in rpm";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow rate";
-  Units.SI.Pressure deltaP
-    "Pressure variation between the outlet and the inlet";
-  Units.SI.Height hn(start=10) "Pump head";
-  Units.SI.Torque Cm "Motor torque";
-  Units.SI.Torque Cr "Resistive hydraulic torque";
-  Real rh "Pump efficiency";
-  Units.SI.Power Wr "Resistive power";
-  Units.SI.Power Wm "Motor power";
-  Units.SI.Energy Ec "Kinetic energy of the rotating masses";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.SpecificEnthalpy deltaH
-    "Specific enthalpy variation between the outlet and the inlet";
-  Units.SI.Pressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
-  Real c "Dimensionless coef. of the semi-parabolic pump head characteristics";
-  Real F "Function F";
-  Real G "Function G";
-  Real Z "Function Z";
-  Real i_h "Index in head characteristics table";
-  Real i_t "Index in torque characteristics table";
-  Real alpha=hn_coef[1] "Coef. alpha of the characteristics for hn";
-  Real beta=hn_coef[2] "Coef. beta of the characteristics for hn";
-  Real gamma=rh_coef[1] "Coef. gamma of the characteristics for rh";
-  Real delta=rh_coef[2] "Coef. delta of the characteristics for rh";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ElectroMechanics.Connectors.MechanichalTorque M
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-initial equation
-  if (cardinality(M) <> 0) and dynamic_mech_equation then
-    der(w) = 0;
-  end if;
-
-  if dynamic_energy_balance then
-    der(h) = 0;
-  end if;
-
-equation
-
-  if (cardinality(M) == 0) then
-    M.w = pi/30*N;
-  end if;
-
-  C1.Q = C2.Q;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  deltaP = C2.P - C1.P;
-  deltaH = C2.h - C1.h;
-
-  deltaP = rho*g*hn;
-  Q = Qv*rho;
-
-  ftype = C1.ftype;
-
-  /* Energy balance equation */
-  if dynamic_energy_balance then
-    V*rho*der(h) = -Q*deltaH + Wr;
-  else
-    deltaH = ThermoSysPro.Functions.SmoothCond(
-      Q,
-      g*hn/ThermoSysPro.Functions.SmoothMax(rh, rh_min),
-      g*hn/ThermoSysPro.Functions.SmoothMin(rh, -rh_min));
-  end if;
-
-  /* Nominal quantities */
-  w_nom = pi/30*N_nom;
-
-  if (mode_car == 1) then
-    Qv_nom = Qv_nom_p;
-    hn_nom = hn_nom_p;
-    rh_nom = rh_nom_p;
-  elseif (mode_car == 2) then
-    Qv_nom = -delta/2/gamma;
-    hn_nom = beta + alpha*delta^2/4/gamma^2;
-    rh_nom = -delta^2/4/gamma;
-  else
-    assert(false, "CentrifugalPump: invalid option");
-  end if;
-
-  Cr_nom = rho*g*Qv_nom*hn_nom/rh_nom/w_nom;
-
-  /* Dimensionless quantities */
-  w_a = w/w_nom;
-  Qv_a = Qv/Qv_nom;
-  hn_a = hn/hn_nom;
-  rh_a = rh/rh_nom;
-  Cr_a = Cr/Cr_nom;
-
-  /* Dimensionless coef. c */
-  if (mode_car == 1) then
-    c = c_p;
-  elseif (mode_car == 2) then
-    c = 1/(1 + alpha*delta^2/4/beta/gamma^2);
-  else
-    assert(false, "CentrifugalPump: invalid option");
-  end if;
-
-  /* Angle theta */
-  theta = noEvent(if (abs(w_a) > w_a_min) then atan(Qv_a/w_a) else
-                        if (abs(Qv_a) < Qv_a_min) then (if (w_a > 0) then 0 else -pi) else
-                        if (Qv_a > 0) then pi/2 else
-                        - pi/2);
-  theta_deg = 180/pi*theta;
-
-  i_h = (theta + pi)/(2*pi)*(size(F_t, 1) - 1) + 1;
-  i_t = (theta + pi)/(2*pi)*(size(G_t, 1) - 1) + 1;
-
-  /* Pump head */
-  if (mode_car_hn == 1) then
-    F = ThermoSysPro.Functions.SplineInterpolation(
-      1:size(F_t, 1),
-      F_t[:],
-      i_h);
-    hn_a = (w_a^2 + Qv_a^2)*F;
-  elseif (mode_car_hn == 2) then
-    F = ((1 - c)*ThermoSysPro.Functions.SmoothSign(w_a)*tan(theta)*
-      ThermoSysPro.Functions.SmoothAbs(tan(theta)) + c)/(1 + tan(theta)^2);
-    hn_a = (1 - c)*Qv_a*abs(Qv_a) + c*w_a^2;
-  else
-    assert(false, "CentrifugalPump: invalid option");
-  end if;
-
-  /* Pump resistive torque */
-  if (mode_car_Cr == 1) then
-    G = ThermoSysPro.Functions.SplineInterpolation(
-      1:size(G_t, 1),
-      G_t[:],
-      i_t);
-    Z = 0;
-    Cr_a = (w_a^2 + Qv_a^2)*G;
-  elseif (mode_car_Cr == 2) then
-    G = 0;
-    Z = (1 + tan(theta)^2)/(b - (b - 1)*tan(theta))*F;
-    Cr_a = if noEvent(abs(w_a) > w_a_min) then w_a^2*Z else w_a^2/b*F;
-  else
-    assert(false, "CentrifugalPump: invalid option");
-  end if;
-
-  /* Pump efficiency */
-  rh_a = if noEvent(abs(w_a) > w_a_min) then
-              -(b - 1)*(Qv_a/w_a)^2 + b*Qv_a/w_a else
-              -(b - 1)*(Qv_a/w_a_min)^2 + b*Qv_a/w_a_min;
-
-  /* Motor power */
-  Wm = Cm*w;
-
-  /* Resistive hydraulic power */
-  Wr = Cr*w;
-
-  /* Kinetic energy of the rotating masses */
-  Ec = 1/2*J*w^2;
-
-  /* Rotating mass equation */
-  if (cardinality(M) <> 0) and dynamic_mech_equation then
-    J*der(w) = Cm - Cr;
-  else
-    0 = Cm - Cr;
-  end if;
-
-  w_rpm = 30/pi*w;
-
-  w = M.w;
-  Cm = M.Ctr;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-  h = (C1.h + C2.h)/2;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0}), Polygon(
-          points={{-30,40},{60,0},{-30,-40},{-30,40}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.03,
-      y=0.02,
-      width=0.95,
-      height=0.95),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
-          Polygon(
-          points={{-30,40},{60,0},{-30,-40},{-30,40}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 12.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end CentrifugalPump;
+within ThermoSysPro.Fluid.Machines;
+model CentrifugalPump "Centrifugal pump"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N=1400
+    "Pump angular velocity in rpm (active if input M is not connected)";
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N_nom=1400
+    "Nominal angular velocity in rpm";
+  parameter Units.SI.MomentOfInertia J=10
+    "Rotating masses moment of inertia (active if dynamic_mech_equation=true)";
+  parameter Units.SI.Volume V=1
+    "Pump volume (active if dynamic_energy_balance=true)";
+  parameter Boolean dynamic_mech_equation=false
+    "true: dynamic mechanical equation - false: static mechanical equation (active if input M is connected)";
+  parameter Boolean dynamic_energy_balance=false
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  parameter Integer mode_car=2
+    "1:nominal values and coef. c given by parameters - 2:nominal values and coef. c computed from semi-parabolic characteristics";
+  parameter Integer mode_car_hn=2
+    "1:complete pump head characteristics - 2:semi-parabolic pump head characteristics";
+  parameter Integer mode_car_Cr=2
+    "1:complete torque characteristics - 2:analytic formula";
+
+  parameter Units.SI.VolumeFlowRate Qv_nom_p=0.4781
+    "Nominal volumetric flow (active if mode_car=1)";
+  parameter Units.SI.Height hn_nom_p=22.879
+    "Nominal pump head (active if mode_car=1)";
+  parameter Units.SI.Height rh_nom_p=0.863
+    "Nominal pump efficiency (active if mode_car=1)";
+
+  parameter Real F_t[:]={ 0.634, 0.643, 0.646, 0.640, 0.629, 0.613, 0.595, 0.575, 0.552, 0.533, 0.516, 0.505,
+                          0.504, 0.510, 0.512, 0.522, 0.539, 0.559, 0.580, 0.601, 0.630, 0.662, 0.692, 0.722,
+                          0.753, 0.782, 0.808, 0.832, 0.857, 0.879, 0.904, 0.930, 0.959, 0.996, 1.027, 1.060,
+                          1.090, 1.124, 1.165, 1.204, 1.238, 1.258, 1.271, 1.282, 1.288, 1.281, 1.260, 1.225,
+                          1.172, 1.107, 1.031, 0.942, 0.842, 0.733, 0.617, 0.500, 0.368, 0.240, 0.125, 0.011,
+                         -0.102,-0.168,-0.255,-0.342,-0.423,-0.494,-0.556,-0.620,-0.655,-0.670,-0.670,-0.660,
+                         -0.655,-0.640,-0.600,-0.570,-0.520,-0.470,-0.430,-0.360,-0.275,-0.160,-0.040, 0.130,
+                          0.295, 0.430, 0.550, 0.620, 0.634}
+    "Head characteristics (active if mode_car_hn=1)";
+
+  parameter Real G_t[:]={-0.684,-0.547,-0.414,-0.292,-0.187,-0.105,-0.053,-0.012, 0.042, 0.097, 0.156, 0.227,
+                          0.300, 0.371, 0.444, 0.522, 0.596, 0.672, 0.738, 0.763, 0.797, 0.837, 0.865, 0.883,
+                          0.886, 0.877, 0.859, 0.838, 0.804, 0.758, 0.703, 0.645, 0.583, 0.520, 0.454, 0.408,
+                          0.370, 0.343, 0.331, 0.329, 0.338, 0.354, 0.372, 0.405, 0.450, 0.486, 0.520, 0.552,
+                          0.579, 0.603, 0.616, 0.617, 0.606, 0.582, 0.546, 0.500, 0.432, 0.360, 0.288, 0.214,
+                          0.123, 0.037,-0.053,-0.161,-0.248,-0.314,-0.372,-0.580,-0.740,-0.880,-1.000,-1.120,
+                         -1.250,-1.370,-1.490,-1.590,-1.660,-1.690,-1.770,-1.650,-1.590,-1.520,-1.420,-1.320,
+                         -1.230,-1.100,-0.980,-0.820, -0.684}
+    "Torque characteristics (active if mode_car_Cr=1)";
+
+  parameter Real c_p=1.288
+    "Dimensionless coef. of the semi-parabolic pump head characteristics (active if mode_car=1 and mode_car_hn=2)";
+  constant Real b=2
+    "Dimensionless coef. of the parabolic pump efficiency characteristics";
+
+  parameter Real hn_coef[2]={-88.67, 43.15}
+    "Coef. of the semi-parabolic pump head characteristics (active if mode_car=2)";
+  parameter Real rh_coef[2]={-3.7751, 3.61}
+    "Coef. of the parabolic pump efficiency characteristics (active if mode_car=2)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.AngularVelocity w_a_min=1.e-4 "Small angular velocity";
+  parameter Units.SI.VolumeFlowRate Qv_a_min=1.e-4 "Small volume flow rate";
+  parameter Real rh_min=0.05 "Minimum efficiency";
+
+public
+  Real w_a "Dimensionless angular velocity";
+  Real Qv_a(start=1) "Dimensionless volumetric flow";
+  Real hn_a(start=1) "Dimensionless head";
+  Real Cr_a(start=1) "Dimensionless resistive torque";
+  Real rh_a(start=1) "Dimensionless pump efficiency";
+  Units.SI.AngularVelocity w_nom "Nominal angular velocity";
+  Units.SI.VolumeFlowRate Qv_nom "Nominal volumetric flow";
+  Units.SI.Height hn_nom "Nominal pump head";
+  Units.SI.Torque Cr_nom "Nominal resistive hydraulic torque";
+  Real rh_nom "Nominal pump efficiency";
+  Units.SI.Angle theta "Angle arctan(Qv_a/w_a) (rad)";
+  ThermoSysPro.Units.nonSI.Angle_deg theta_deg "Angle arctan(Qv_a/w_a) (deg)";
+  Units.SI.AngularVelocity w "Angular velocity in rad";
+  ThermoSysPro.Units.nonSI.AngularVelocity_rpm w_rpm "Angular velocity in rpm";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow rate";
+  Units.SI.Pressure deltaP
+    "Pressure variation between the outlet and the inlet";
+  Units.SI.Height hn(start=10) "Pump head";
+  Units.SI.Torque Cm "Motor torque";
+  Units.SI.Torque Cr "Resistive hydraulic torque";
+  Real rh "Pump efficiency";
+  Units.SI.Power Wr "Resistive power";
+  Units.SI.Power Wm "Motor power";
+  Units.SI.Energy Ec "Kinetic energy of the rotating masses";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.SpecificEnthalpy deltaH
+    "Specific enthalpy variation between the outlet and the inlet";
+  Units.SI.Pressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
+  Real c "Dimensionless coef. of the semi-parabolic pump head characteristics";
+  Real F "Function F";
+  Real G "Function G";
+  Real Z "Function Z";
+  Real i_h "Index in head characteristics table";
+  Real i_t "Index in torque characteristics table";
+  Real alpha=hn_coef[1] "Coef. alpha of the characteristics for hn";
+  Real beta=hn_coef[2] "Coef. beta of the characteristics for hn";
+  Real gamma=rh_coef[1] "Coef. gamma of the characteristics for rh";
+  Real delta=rh_coef[2] "Coef. delta of the characteristics for rh";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ElectroMechanics.Connectors.MechanichalTorque M
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+initial equation
+  if (cardinality(M) <> 0) and dynamic_mech_equation then
+    der(w) = 0;
+  end if;
+
+  if dynamic_energy_balance then
+    der(h) = 0;
+  end if;
+
+equation
+
+  if (cardinality(M) == 0) then
+    M.w = pi/30*N;
+  end if;
+
+  C1.Q = C2.Q;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  deltaP = C2.P - C1.P;
+  deltaH = C2.h - C1.h;
+
+  deltaP = rho*g*hn;
+  Q = Qv*rho;
+
+  ftype = C1.ftype;
+
+  /* Energy balance equation */
+  if dynamic_energy_balance then
+    V*rho*der(h) = -Q*deltaH + Wr;
+  else
+    deltaH = ThermoSysPro.Functions.SmoothCond(
+      Q,
+      g*hn/ThermoSysPro.Functions.SmoothMax(rh, rh_min),
+      g*hn/ThermoSysPro.Functions.SmoothMin(rh, -rh_min));
+  end if;
+
+  /* Nominal quantities */
+  w_nom = pi/30*N_nom;
+
+  if (mode_car == 1) then
+    Qv_nom = Qv_nom_p;
+    hn_nom = hn_nom_p;
+    rh_nom = rh_nom_p;
+  elseif (mode_car == 2) then
+    Qv_nom = -delta/2/gamma;
+    hn_nom = beta + alpha*delta^2/4/gamma^2;
+    rh_nom = -delta^2/4/gamma;
+  else
+    assert(false, "CentrifugalPump: invalid option");
+  end if;
+
+  Cr_nom = rho*g*Qv_nom*hn_nom/rh_nom/w_nom;
+
+  /* Dimensionless quantities */
+  w_a = w/w_nom;
+  Qv_a = Qv/Qv_nom;
+  hn_a = hn/hn_nom;
+  rh_a = rh/rh_nom;
+  Cr_a = Cr/Cr_nom;
+
+  /* Dimensionless coef. c */
+  if (mode_car == 1) then
+    c = c_p;
+  elseif (mode_car == 2) then
+    c = 1/(1 + alpha*delta^2/4/beta/gamma^2);
+  else
+    assert(false, "CentrifugalPump: invalid option");
+  end if;
+
+  /* Angle theta */
+  theta = noEvent(if (abs(w_a) > w_a_min) then atan(Qv_a/w_a) else
+                        if (abs(Qv_a) < Qv_a_min) then (if (w_a > 0) then 0 else -pi) else
+                        if (Qv_a > 0) then pi/2 else
+                        - pi/2);
+  theta_deg = 180/pi*theta;
+
+  i_h = (theta + pi)/(2*pi)*(size(F_t, 1) - 1) + 1;
+  i_t = (theta + pi)/(2*pi)*(size(G_t, 1) - 1) + 1;
+
+  /* Pump head */
+  if (mode_car_hn == 1) then
+    F = ThermoSysPro.Functions.SplineInterpolation(
+      1:size(F_t, 1),
+      F_t[:],
+      i_h);
+    hn_a = (w_a^2 + Qv_a^2)*F;
+  elseif (mode_car_hn == 2) then
+    F = ((1 - c)*ThermoSysPro.Functions.SmoothSign(w_a)*tan(theta)*
+      ThermoSysPro.Functions.SmoothAbs(tan(theta)) + c)/(1 + tan(theta)^2);
+    hn_a = (1 - c)*Qv_a*abs(Qv_a) + c*w_a^2;
+  else
+    assert(false, "CentrifugalPump: invalid option");
+  end if;
+
+  /* Pump resistive torque */
+  if (mode_car_Cr == 1) then
+    G = ThermoSysPro.Functions.SplineInterpolation(
+      1:size(G_t, 1),
+      G_t[:],
+      i_t);
+    Z = 0;
+    Cr_a = (w_a^2 + Qv_a^2)*G;
+  elseif (mode_car_Cr == 2) then
+    G = 0;
+    Z = (1 + tan(theta)^2)/(b - (b - 1)*tan(theta))*F;
+    Cr_a = if noEvent(abs(w_a) > w_a_min) then w_a^2*Z else w_a^2/b*F;
+  else
+    assert(false, "CentrifugalPump: invalid option");
+  end if;
+
+  /* Pump efficiency */
+  rh_a = if noEvent(abs(w_a) > w_a_min) then
+              -(b - 1)*(Qv_a/w_a)^2 + b*Qv_a/w_a else
+              -(b - 1)*(Qv_a/w_a_min)^2 + b*Qv_a/w_a_min;
+
+  /* Motor power */
+  Wm = Cm*w;
+
+  /* Resistive hydraulic power */
+  Wr = Cr*w;
+
+  /* Kinetic energy of the rotating masses */
+  Ec = 1/2*J*w^2;
+
+  /* Rotating mass equation */
+  if (cardinality(M) <> 0) and dynamic_mech_equation then
+    J*der(w) = Cm - Cr;
+  else
+    0 = Cm - Cr;
+  end if;
+
+  w_rpm = 30/pi*w;
+
+  w = M.w;
+  Cm = M.Ctr;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+  h = (C1.h + C2.h)/2;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0}), Polygon(
+          points={{-30,40},{60,0},{-30,-40},{-30,40}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.03,
+      y=0.02,
+      width=0.95,
+      height=0.95),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
+          Polygon(
+          points={{-30,40},{60,0},{-30,-40},{-30,40}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 12.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end CentrifugalPump;
diff --git a/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo b/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo
index 808dcfb04adeeb7a40b47685fc3eb6b01b802e0e..40dcd196179825c767dff0d4c834f9fc519599c5 100644
--- a/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo
+++ b/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo
@@ -1,150 +1,150 @@
-within ThermoSysPro.Fluid.Machines;
-model CombustionTurbine "Combustion turbine"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Real A3=0 "X^3 coefficient of the efficiency curve";
-  parameter Real A2=-0.04778 "X^2 coefficient of the efficiency curve";
-  parameter Real A1=0.09555 "X^1 coefficient of the efficiency curve";
-  parameter Real A0=0.95223 "X^0 coefficient of the efficiency curve";
-  parameter Real tau_n=0.07 "Nominal expansion rate";
-  parameter Real is_eff_n=0.8600 "Nominal isentropic efficiency";
-  parameter Real Qred=0.01 "Reduced mass flow rate";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-
-public
-  Real tau(start=0.07) "Expansion rate";
-  Real is_eff(start=0.85) "Isentropic efficiency";
-  Units.SI.Power Wcp(start=1e9) "Compressor power";
-  Units.SI.Power Wturb(start=2e9) "Turbine power";
-  Units.SI.Power Wmech(start=1e9) "Mechanical power";
-  Units.SI.AbsolutePressure Pe(start=1e5) "Flue gases pressure at the inlet";
-  Units.SI.AbsolutePressure Ps(start=1e5) "Flue gases pressure at the outlet";
-  Real Xtau(start=1) "Ratio between the actual and nominal expansion rate";
-  Units.SI.MassFlowRate Q(start=500) "Flue gases mass flow rate";
-  Units.SI.Temperature Te(start=1.4e3) "Flue gases temperature at the inlet";
-  Units.SI.Temperature Ts(start=900) "Flue gases temperature at the outlet";
-  Units.SI.Temperature Tis(start=750)
-    "Isentropic air temperature at the outlet";
-  Units.SI.SpecificEnthalpy He(start=1.2e6)
-    "Flue gases specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hs(start=6e5)
-    "Flue gases specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy His(start=6e5)
-    "Flue gases specific enthalpy after the isentropic expansion";
-  Units.SI.SpecificEntropy Se "Flue gases specific entropy at the inlet";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  Interfaces.Connectors.FluidInlet Ce annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cs annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower
-    annotation (Placement(transformation(extent={{-120,-50},{-100,-30}},
-          rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
-    annotation (Placement(transformation(extent={{100,-100},{120,-80}},
-          rotation=0)));
-equation
-  /* Check that the fluid type is flue gases */
-  assert(ftype == FluidType.FlueGases, "CombustionTurbine: the fluid type must be flue gases");
-
-  Ce.Q = Cs.Q;
-
-  Ce.h_vol_1 = Cs.h_vol_1;
-  Ce.h_vol_2 = Cs.h_vol_2;
-
-  Cs.diff_on_1 = if (gamma_diff > 0) then Ce.diff_on_1 else false;
-  Ce.diff_on_2 = if (gamma_diff > 0) then Cs.diff_on_2 else false;
-
-  Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  Ce.ftype = Cs.ftype;
-
-  Ce.Xco2 = Cs.Xco2;
-  Ce.Xh2o = Cs.Xh2o;
-  Ce.Xo2  = Cs.Xo2;
-  Ce.Xso2 = Cs.Xso2;
-
-  Q = Ce.Q;
-
-  Pe = Ce.P;
-  Ps = Cs.P;
-
-  He = Ce.h;
-  Hs = Cs.h;
-
-  ftype = Ce.ftype;
-
-  /* Input compressor power (negative value) */
-  Wcp = CompressorPower.signal;
-
-  /* Expansion rate */
-  tau = Ps/Pe;
-
-  /* Expansion rates ratio */
-  Xtau = tau/tau_n;
-
-  /* Isentropic efficiency */
-  is_eff = (A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
-
-  /* Reduced mass flow rate */
-  Qred = (Q*sqrt(Te))/Pe;
-
-  /* Turbine power */
-  Wturb = Q*(He - Hs);
-
-  /* Mechanical power */
-  Wmech = Wturb + Wcp;
-  MechPower.signal = Wmech;
-
-  /* Temperature at the inlet */
-  Te = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific entropy at the inlet */
-  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific enthalpy after the isentropic expansion */
-  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific enthalpy at the outlet */
-  Hs = is_eff*(His - He) +  He;
-
-  /* Temperature at the outlet */
-  Ts = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ps, Hs, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={Polygon(
-          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={Polygon(
-          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Backward)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 11.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end CombustionTurbine;
+within ThermoSysPro.Fluid.Machines;
+model CombustionTurbine "Combustion turbine"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Real A3=0 "X^3 coefficient of the efficiency curve";
+  parameter Real A2=-0.04778 "X^2 coefficient of the efficiency curve";
+  parameter Real A1=0.09555 "X^1 coefficient of the efficiency curve";
+  parameter Real A0=0.95223 "X^0 coefficient of the efficiency curve";
+  parameter Real tau_n=0.07 "Nominal expansion rate";
+  parameter Real is_eff_n=0.8600 "Nominal isentropic efficiency";
+  parameter Real Qred=0.01 "Reduced mass flow rate";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+
+public
+  Real tau(start=0.07) "Expansion rate";
+  Real is_eff(start=0.85) "Isentropic efficiency";
+  Units.SI.Power Wcp(start=1e9) "Compressor power";
+  Units.SI.Power Wturb(start=2e9) "Turbine power";
+  Units.SI.Power Wmech(start=1e9) "Mechanical power";
+  Units.SI.AbsolutePressure Pe(start=1e5) "Flue gases pressure at the inlet";
+  Units.SI.AbsolutePressure Ps(start=1e5) "Flue gases pressure at the outlet";
+  Real Xtau(start=1) "Ratio between the actual and nominal expansion rate";
+  Units.SI.MassFlowRate Q(start=500) "Flue gases mass flow rate";
+  Units.SI.Temperature Te(start=1.4e3) "Flue gases temperature at the inlet";
+  Units.SI.Temperature Ts(start=900) "Flue gases temperature at the outlet";
+  Units.SI.Temperature Tis(start=750)
+    "Isentropic air temperature at the outlet";
+  Units.SI.SpecificEnthalpy He(start=1.2e6)
+    "Flue gases specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hs(start=6e5)
+    "Flue gases specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy His(start=6e5)
+    "Flue gases specific enthalpy after the isentropic expansion";
+  Units.SI.SpecificEntropy Se "Flue gases specific entropy at the inlet";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  Interfaces.Connectors.FluidInlet Ce annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cs annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower
+    annotation (Placement(transformation(extent={{-120,-50},{-100,-30}},
+          rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
+    annotation (Placement(transformation(extent={{100,-100},{120,-80}},
+          rotation=0)));
+equation
+  /* Check that the fluid type is flue gases */
+  assert(ftype == FluidType.FlueGases, "CombustionTurbine: the fluid type must be flue gases");
+
+  Ce.Q = Cs.Q;
+
+  Ce.h_vol_1 = Cs.h_vol_1;
+  Ce.h_vol_2 = Cs.h_vol_2;
+
+  Cs.diff_on_1 = if (gamma_diff > 0) then Ce.diff_on_1 else false;
+  Ce.diff_on_2 = if (gamma_diff > 0) then Cs.diff_on_2 else false;
+
+  Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  Ce.ftype = Cs.ftype;
+
+  Ce.Xco2 = Cs.Xco2;
+  Ce.Xh2o = Cs.Xh2o;
+  Ce.Xo2  = Cs.Xo2;
+  Ce.Xso2 = Cs.Xso2;
+
+  Q = Ce.Q;
+
+  Pe = Ce.P;
+  Ps = Cs.P;
+
+  He = Ce.h;
+  Hs = Cs.h;
+
+  ftype = Ce.ftype;
+
+  /* Input compressor power (negative value) */
+  Wcp = CompressorPower.signal;
+
+  /* Expansion rate */
+  tau = Ps/Pe;
+
+  /* Expansion rates ratio */
+  Xtau = tau/tau_n;
+
+  /* Isentropic efficiency */
+  is_eff = (A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
+
+  /* Reduced mass flow rate */
+  Qred = (Q*sqrt(Te))/Pe;
+
+  /* Turbine power */
+  Wturb = Q*(He - Hs);
+
+  /* Mechanical power */
+  Wmech = Wturb + Wcp;
+  MechPower.signal = Wmech;
+
+  /* Temperature at the inlet */
+  Te = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific entropy at the inlet */
+  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific enthalpy after the isentropic expansion */
+  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific enthalpy at the outlet */
+  Hs = is_eff*(His - He) +  He;
+
+  /* Temperature at the outlet */
+  Ts = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ps, Hs, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={Polygon(
+          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={Polygon(
+          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Backward)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 11.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end CombustionTurbine;
diff --git a/ThermoSysPro/Fluid/Machines/Compressor.mo b/ThermoSysPro/Fluid/Machines/Compressor.mo
index c5e75b4d9e1cfe51d295cc83c718823c70802b3e..0485d2881b5a3cf58e2d5e5d2fc0c83682c6476d 100644
--- a/ThermoSysPro/Fluid/Machines/Compressor.mo
+++ b/ThermoSysPro/Fluid/Machines/Compressor.mo
@@ -1,155 +1,155 @@
-within ThermoSysPro.Fluid.Machines;
-model Compressor "Gas compressor"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Integer mass_flow_rate_comp=1 "Ways for computing the mass flow rate - 1: Q = rho*Qv - 2: Q = rho*f(T)";
-  parameter Units.SI.Temperature Tmax=284.16
-    "Air transition temperature between f1 = a*x + b and f2 = c*x + d for the computation of Q (active if mass_flow_rate_comp == 2)";
-  parameter Real coef1_1=0.1164 "Coefficient a for f1 = a*x + b";
-   parameter Real coef2_1=38.643 "Coefficient b for f1 = a*x + b";
-  parameter Real coef1_2=-0.2324 "Coefficient c for f2 = c*x + d";
-  parameter Real coef2_2=137.49 "Coefficient d for f2 = c*x + d";
-  parameter Real A4=-1.2362 "Coefficient of X^4 for the computation of the isentropic efficiency";
-  parameter Real A3=3.6721 "Coefficient of X^3 for the computation of the isentropic efficiency";
-  parameter Real A2=-4.2434 "Coefficient of X^2 for the computation of the isentropic efficiency";
-  parameter Real A1=2.3957 "Coefficient of X^1 for the computation of the isentropic efficiency";
-  parameter Real A0=0.4118 "Coefficient of X^0 for the computation of the isentropic efficiency";
-  parameter Real tau_n=14.149 "Nominal compression rate";
-  parameter Real is_eff_n=0.84752 "Nominal isentropic efficiency";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-
-protected
-  Units.SI.VolumeFlowRate Qv_cal(start=500)
-    "Intermediate variable for the computation of Qv";
-
-public
-  Real tau(start=15) "Compression rate";
-  Real is_eff(start=0.85) "Isentropic efficiency";
-  Units.SI.Power Wcp(start=1e9) "Compressor power";
-  Units.SI.AbsolutePressure Pe(start=1e5) "Air pressure at the inlet";
-  Units.SI.AbsolutePressure Ps(start=15e5) "Air pressure at the outlet";
-  Real Xtau( start=1) "Normal and nominal compression rates ratio";
-  Units.SI.MassFlowRate Q(start=500) "Air mass flow rate";
-  Units.SI.VolumeFlowRate Qv(start=500) "Air volume flow rate";
-  Units.SI.Temperature Te(start=300) "Air temperature at the inlet";
-  Units.SI.Temperature Ts(start=750) "Air temperature at the outlet";
-  Units.SI.Temperature Tis(start=750)
-    "Isentropic air temperature at the outlet";
-  Units.SI.SpecificEnthalpy He(start=80e3) "Air specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hs(start=500e3)
-    "Air specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy His(start=450e3)
-    "Air specific enthalpy after the isentropic compression";
-  Units.SI.SpecificEntropy Se "Air specific entropy at the inlet";
-  Units.SI.Density rho_e(start=1) "Air density at the inlet";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  Interfaces.Connectors.FluidInlet Ce annotation (Placement(transformation(
-          extent={{-100,-10},{-80,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cs annotation (Placement(transformation(
-          extent={{80,-10},{100,10}}, rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power
-    annotation (Placement(transformation(extent={{80,-40},{100,-20}}, rotation=
-            0)));
-equation
-  /* Check that the fluid type is flue gases */
-  assert(ftype == FluidType.FlueGases, "Compressor: the fluid type must be flue gases");
-
-  Ce.Q = Cs.Q;
-
-  Ce.h_vol_1 = Cs.h_vol_1;
-  Ce.h_vol_2 = Cs.h_vol_2;
-
-  Cs.diff_on_1 = if (gamma_diff > 0) then Ce.diff_on_1 else false;
-  Ce.diff_on_2 = if (gamma_diff > 0) then Cs.diff_on_2 else false;
-
-  Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  Ce.ftype = Cs.ftype;
-
-  Ce.Xco2 = Cs.Xco2;
-  Ce.Xh2o = Cs.Xh2o;
-  Ce.Xo2  = Cs.Xo2;
-  Ce.Xso2 = Cs.Xso2;
-
-  Q = Ce.Q;
-
-  Pe = Ce.P;
-  Ps = Cs.P;
-
-  He = Ce.h;
-  Hs = Cs.h;
-
-  ftype = Ce.ftype;
-
-  /* Compression rate */
-  tau = Ps/Pe;
-
-  /* Compression rates ratio */
-  Xtau = tau/tau_n;
-
-  /* Isentropic efficiency */
-  is_eff = (A4*Xtau^4 + A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
-
-  /* Compressor power */
-  Wcp = Q*(He - Hs);
-  Power.signal = Wcp;
-
-  /* Volume flow rate at the inlet */
-  Qv_cal = if (Te < Tmax) then coef1_1*Te + coef2_1 else coef1_2*Te + coef2_2;
-  Q = if (mass_flow_rate_comp == 1) then Qv*rho_e else Qv_cal*rho_e;
-
-  /* Specific enthalpy at the inlet */
-  //Te = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  // Call implicitly to avoid function that cannot be differentiated.
-  He = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific entropy at the inlet */
-  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific enthalpy after the isentropic compression */
-  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Fluid density at the inlet */
-  //rho_e = ThermoSysPro.Properties.Fluid.Density_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  rho_e = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  /* Specific enthalpy at the outlet */
-  Hs = (His - He + is_eff*He)/is_eff;
-
-  /* Temperature at the outlet */
-  // Ts = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ps, Hs, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-  // Call implicitly to avoid function that cannot be differentiated.
-  Hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Ts, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{
-            120,100}}), graphics={Polygon(
-          points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}},
-          lineColor={0,0,0},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,
-            100}}), graphics={Polygon(
-          points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}},
-          lineColor={0,0,0},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Backward)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 11.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end Compressor;
+within ThermoSysPro.Fluid.Machines;
+model Compressor "Gas compressor"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Integer mass_flow_rate_comp=1 "Ways for computing the mass flow rate - 1: Q = rho*Qv - 2: Q = rho*f(T)";
+  parameter Units.SI.Temperature Tmax=284.16
+    "Air transition temperature between f1 = a*x + b and f2 = c*x + d for the computation of Q (active if mass_flow_rate_comp == 2)";
+  parameter Real coef1_1=0.1164 "Coefficient a for f1 = a*x + b";
+   parameter Real coef2_1=38.643 "Coefficient b for f1 = a*x + b";
+  parameter Real coef1_2=-0.2324 "Coefficient c for f2 = c*x + d";
+  parameter Real coef2_2=137.49 "Coefficient d for f2 = c*x + d";
+  parameter Real A4=-1.2362 "Coefficient of X^4 for the computation of the isentropic efficiency";
+  parameter Real A3=3.6721 "Coefficient of X^3 for the computation of the isentropic efficiency";
+  parameter Real A2=-4.2434 "Coefficient of X^2 for the computation of the isentropic efficiency";
+  parameter Real A1=2.3957 "Coefficient of X^1 for the computation of the isentropic efficiency";
+  parameter Real A0=0.4118 "Coefficient of X^0 for the computation of the isentropic efficiency";
+  parameter Real tau_n=14.149 "Nominal compression rate";
+  parameter Real is_eff_n=0.84752 "Nominal isentropic efficiency";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+
+protected
+  Units.SI.VolumeFlowRate Qv_cal(start=500)
+    "Intermediate variable for the computation of Qv";
+
+public
+  Real tau(start=15) "Compression rate";
+  Real is_eff(start=0.85) "Isentropic efficiency";
+  Units.SI.Power Wcp(start=1e9) "Compressor power";
+  Units.SI.AbsolutePressure Pe(start=1e5) "Air pressure at the inlet";
+  Units.SI.AbsolutePressure Ps(start=15e5) "Air pressure at the outlet";
+  Real Xtau( start=1) "Normal and nominal compression rates ratio";
+  Units.SI.MassFlowRate Q(start=500) "Air mass flow rate";
+  Units.SI.VolumeFlowRate Qv(start=500) "Air volume flow rate";
+  Units.SI.Temperature Te(start=300) "Air temperature at the inlet";
+  Units.SI.Temperature Ts(start=750) "Air temperature at the outlet";
+  Units.SI.Temperature Tis(start=750)
+    "Isentropic air temperature at the outlet";
+  Units.SI.SpecificEnthalpy He(start=80e3) "Air specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hs(start=500e3)
+    "Air specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy His(start=450e3)
+    "Air specific enthalpy after the isentropic compression";
+  Units.SI.SpecificEntropy Se "Air specific entropy at the inlet";
+  Units.SI.Density rho_e(start=1) "Air density at the inlet";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  Interfaces.Connectors.FluidInlet Ce annotation (Placement(transformation(
+          extent={{-100,-10},{-80,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cs annotation (Placement(transformation(
+          extent={{80,-10},{100,10}}, rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power
+    annotation (Placement(transformation(extent={{80,-40},{100,-20}}, rotation=
+            0)));
+equation
+  /* Check that the fluid type is flue gases */
+  assert(ftype == FluidType.FlueGases, "Compressor: the fluid type must be flue gases");
+
+  Ce.Q = Cs.Q;
+
+  Ce.h_vol_1 = Cs.h_vol_1;
+  Ce.h_vol_2 = Cs.h_vol_2;
+
+  Cs.diff_on_1 = if (gamma_diff > 0) then Ce.diff_on_1 else false;
+  Ce.diff_on_2 = if (gamma_diff > 0) then Cs.diff_on_2 else false;
+
+  Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  Ce.ftype = Cs.ftype;
+
+  Ce.Xco2 = Cs.Xco2;
+  Ce.Xh2o = Cs.Xh2o;
+  Ce.Xo2  = Cs.Xo2;
+  Ce.Xso2 = Cs.Xso2;
+
+  Q = Ce.Q;
+
+  Pe = Ce.P;
+  Ps = Cs.P;
+
+  He = Ce.h;
+  Hs = Cs.h;
+
+  ftype = Ce.ftype;
+
+  /* Compression rate */
+  tau = Ps/Pe;
+
+  /* Compression rates ratio */
+  Xtau = tau/tau_n;
+
+  /* Isentropic efficiency */
+  is_eff = (A4*Xtau^4 + A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
+
+  /* Compressor power */
+  Wcp = Q*(He - Hs);
+  Power.signal = Wcp;
+
+  /* Volume flow rate at the inlet */
+  Qv_cal = if (Te < Tmax) then coef1_1*Te + coef2_1 else coef1_2*Te + coef2_2;
+  Q = if (mass_flow_rate_comp == 1) then Qv*rho_e else Qv_cal*rho_e;
+
+  /* Specific enthalpy at the inlet */
+  //Te = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  // Call implicitly to avoid function that cannot be differentiated.
+  He = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific entropy at the inlet */
+  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific enthalpy after the isentropic compression */
+  Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Fluid density at the inlet */
+  //rho_e = ThermoSysPro.Properties.Fluid.Density_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  rho_e = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  /* Specific enthalpy at the outlet */
+  Hs = (His - He + is_eff*He)/is_eff;
+
+  /* Temperature at the outlet */
+  // Ts = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ps, Hs, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+  // Call implicitly to avoid function that cannot be differentiated.
+  Hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Ts, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{
+            120,100}}), graphics={Polygon(
+          points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}},
+          lineColor={0,0,0},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,
+            100}}), graphics={Polygon(
+          points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}},
+          lineColor={0,0,0},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Backward)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 11.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end Compressor;
diff --git a/ThermoSysPro/Fluid/Machines/GasTurbine.mo b/ThermoSysPro/Fluid/Machines/GasTurbine.mo
index 48c0d03eb02120ad31d95180a9afcf13dcee95de..8856476f74280ccaed166bd14f9e77614ac7ca26 100644
--- a/ThermoSysPro/Fluid/Machines/GasTurbine.mo
+++ b/ThermoSysPro/Fluid/Machines/GasTurbine.mo
@@ -1,137 +1,137 @@
-within ThermoSysPro.Fluid.Machines;
-model GasTurbine "Combustion turbine for CICO and Barilla plants"
-  parameter Real comp_tau_n=15 "Nominal compression nominal rate";
-  parameter Real comp_eff_n=0.9 "Compressor nominal efficiency";
-  parameter Real A0=0.1725914;
-  parameter Real A1=1.46222;
-  parameter Real A2=-0.634857;
-  parameter Real A3=0;
-  parameter Real A4=0;
-  parameter Real exp_tau_n=0.05 "Turbine nominal expansion rate";
-  parameter Real exp_eff_n=0.9 "Turbine nominal efficiency";
-  parameter Real TurbQred=0.01 "Turbine reduced mass flow rate";
-  parameter Real B0=0.95223;
-  parameter Real B1=0.09555;
-  parameter Real B2=-0.04778;
-  parameter Real Kcham=1 "Chamber pressure loss coefficient";
-  parameter Units.SI.Power Wpth=1e5 "Combustion chamber thermal losses";
-
-  ThermoSysPro.Fluid.BoundaryConditions.AirHumidity xAIR
-                    annotation (Placement(transformation(
-        origin={-84,30},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Machines.Compressor Compresseur(
-    A4=A4,
-    A3=A3,
-    A2=A2,
-    A1=A1,
-    A0=A0,
-    tau_n=comp_tau_n,
-    is_eff_n=comp_eff_n)                   annotation (Placement(transformation(
-          extent={{-82,-28},{-32,28}}, rotation=0)));
-  ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber chambreCombustionTAC(
-    Acham=1,
-    eta_comb=1,
-    kcham=Kcham,
-    Pea(start=13.8e5),
-    Wpth=Wpth,
-    Qsf(start=500),
-    Qfuel(start=10),
-    Psf(start=13.2e5),
-    Tsf(start=1495))   annotation (Placement(transformation(extent={{-25,31},{
-            25,83}}, rotation=0)));
-  ThermoSysPro.Fluid.Machines.CombustionTurbine TurbineAgaz(
-    Te(start=1495),
-    Pe(start=13.2e5),
-    A2=B2,
-    A1=B1,
-    A0=B0,
-    tau_n=exp_tau_n,
-    Qred=TurbQred,
-    Ps(fixed=false, start=1.013e5),
-    is_eff_n=exp_eff_n,
-    Ts(start=894.518, fixed=false))
-                                   annotation (Placement(transformation(extent=
-            {{47,-22},{79,22}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Entree_air annotation (Placement(
-        transformation(extent={{-104,-4},{-96,4}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Sortie_fumees annotation (Placement(
-        transformation(extent={{96,-4},{104,4}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Entree_eau_combustion annotation (Placement(
-        transformation(extent={{-64,96},{-56,104}}, rotation=0)));
-  Interfaces.Connectors.FuelInlet Entree_combustible
-    annotation (Placement(transformation(extent={{56,96},{64,104}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Huminide
-    annotation (Placement(transformation(extent={{-108,56},{-100,64}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal PuissanceMeca
-    annotation (Placement(transformation(extent={{100,-44},{108,-36}}, rotation=
-           0)));
-equation
-  connect(Huminide, xAIR.humidity) annotation (Line(points={{-104,60},{-56,60},
-          {-56,30},{-73,30}}));
-  connect(TurbineAgaz.MechPower, PuissanceMeca) annotation (Line(points={{80.6,
-          -19.8},{90,-19.8},{90,-40},{104,-40}}));
-  connect(Compresseur.Power, TurbineAgaz.CompressorPower)
-    annotation (Line(points={{-38.25,-8.4},{46,-8.4},{46,-8},{45.4,-8.8}}));
-  connect(xAIR.C2, Compresseur.Ce) annotation (Line(
-      points={{-84,20},{-84,3.55271e-015},{-75.75,3.55271e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(TurbineAgaz.Cs, Sortie_fumees) annotation (Line(
-      points={{79,0},{100,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(xAIR.C1, Entree_air) annotation (Line(
-      points={{-84,40},{-100,40},{-100,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Compresseur.Cs, chambreCombustionTAC.Ca) annotation (Line(
-      points={{-38.25,3.55271e-015},{-32,3.55271e-015},{-32,57},{-22.5,57}},
-      color={0,0,0},
-      thickness=1));
-  connect(chambreCombustionTAC.Cfg, TurbineAgaz.Ce) annotation (Line(
-      points={{22.5,57},{32,57},{32,0},{47,0}},
-      color={0,0,0},
-      thickness=1));
-  connect(Entree_eau_combustion, chambreCombustionTAC.Cws)
-    annotation (Line(points={{-60,100},{-60,90},{-15,90},{-15,80.4}}));
-  connect(chambreCombustionTAC.Cfuel, Entree_combustible) annotation (Line(
-        points={{0,33.6},{0,20},{60,20},{60,100}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics),
-                       Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Polygon(
-          points={{-100,72},{-100,-70},{-20,-20},{-20,20},{-100,72}},
-          lineColor={0,0,0},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,0},
-          fillColor={170,255,213},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{20,20},{20,-20},{100,-70},{100,70},{20,20}},
-          lineColor={0,0,0},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,96},{-60,60},{-10,60},{-10,20}}, color={0,0,255}),
-        Line(points={{60,96},{60,60},{8,60},{8,20}}, color={0,0,127})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end GasTurbine;
+within ThermoSysPro.Fluid.Machines;
+model GasTurbine "Combustion turbine for CICO and Barilla plants"
+  parameter Real comp_tau_n=15 "Nominal compression nominal rate";
+  parameter Real comp_eff_n=0.9 "Compressor nominal efficiency";
+  parameter Real A0=0.1725914;
+  parameter Real A1=1.46222;
+  parameter Real A2=-0.634857;
+  parameter Real A3=0;
+  parameter Real A4=0;
+  parameter Real exp_tau_n=0.05 "Turbine nominal expansion rate";
+  parameter Real exp_eff_n=0.9 "Turbine nominal efficiency";
+  parameter Real TurbQred=0.01 "Turbine reduced mass flow rate";
+  parameter Real B0=0.95223;
+  parameter Real B1=0.09555;
+  parameter Real B2=-0.04778;
+  parameter Real Kcham=1 "Chamber pressure loss coefficient";
+  parameter Units.SI.Power Wpth=1e5 "Combustion chamber thermal losses";
+
+  ThermoSysPro.Fluid.BoundaryConditions.AirHumidity xAIR
+                    annotation (Placement(transformation(
+        origin={-84,30},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Machines.Compressor Compresseur(
+    A4=A4,
+    A3=A3,
+    A2=A2,
+    A1=A1,
+    A0=A0,
+    tau_n=comp_tau_n,
+    is_eff_n=comp_eff_n)                   annotation (Placement(transformation(
+          extent={{-82,-28},{-32,28}}, rotation=0)));
+  ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber chambreCombustionTAC(
+    Acham=1,
+    eta_comb=1,
+    kcham=Kcham,
+    Pea(start=13.8e5),
+    Wpth=Wpth,
+    Qsf(start=500),
+    Qfuel(start=10),
+    Psf(start=13.2e5),
+    Tsf(start=1495))   annotation (Placement(transformation(extent={{-25,31},{
+            25,83}}, rotation=0)));
+  ThermoSysPro.Fluid.Machines.CombustionTurbine TurbineAgaz(
+    Te(start=1495),
+    Pe(start=13.2e5),
+    A2=B2,
+    A1=B1,
+    A0=B0,
+    tau_n=exp_tau_n,
+    Qred=TurbQred,
+    Ps(fixed=false, start=1.013e5),
+    is_eff_n=exp_eff_n,
+    Ts(start=894.518, fixed=false))
+                                   annotation (Placement(transformation(extent=
+            {{47,-22},{79,22}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Entree_air annotation (Placement(
+        transformation(extent={{-104,-4},{-96,4}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Sortie_fumees annotation (Placement(
+        transformation(extent={{96,-4},{104,4}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Entree_eau_combustion annotation (Placement(
+        transformation(extent={{-64,96},{-56,104}}, rotation=0)));
+  Interfaces.Connectors.FuelInlet Entree_combustible
+    annotation (Placement(transformation(extent={{56,96},{64,104}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Huminide
+    annotation (Placement(transformation(extent={{-108,56},{-100,64}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal PuissanceMeca
+    annotation (Placement(transformation(extent={{100,-44},{108,-36}}, rotation=
+           0)));
+equation
+  connect(Huminide, xAIR.humidity) annotation (Line(points={{-104,60},{-56,60},
+          {-56,30},{-73,30}}));
+  connect(TurbineAgaz.MechPower, PuissanceMeca) annotation (Line(points={{80.6,
+          -19.8},{90,-19.8},{90,-40},{104,-40}}));
+  connect(Compresseur.Power, TurbineAgaz.CompressorPower)
+    annotation (Line(points={{-38.25,-8.4},{46,-8.4},{46,-8},{45.4,-8.8}}));
+  connect(xAIR.C2, Compresseur.Ce) annotation (Line(
+      points={{-84,20},{-84,3.55271e-015},{-75.75,3.55271e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(TurbineAgaz.Cs, Sortie_fumees) annotation (Line(
+      points={{79,0},{100,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(xAIR.C1, Entree_air) annotation (Line(
+      points={{-84,40},{-100,40},{-100,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Compresseur.Cs, chambreCombustionTAC.Ca) annotation (Line(
+      points={{-38.25,3.55271e-015},{-32,3.55271e-015},{-32,57},{-22.5,57}},
+      color={0,0,0},
+      thickness=1));
+  connect(chambreCombustionTAC.Cfg, TurbineAgaz.Ce) annotation (Line(
+      points={{22.5,57},{32,57},{32,0},{47,0}},
+      color={0,0,0},
+      thickness=1));
+  connect(Entree_eau_combustion, chambreCombustionTAC.Cws)
+    annotation (Line(points={{-60,100},{-60,90},{-15,90},{-15,80.4}}));
+  connect(chambreCombustionTAC.Cfuel, Entree_combustible) annotation (Line(
+        points={{0,33.6},{0,20},{60,20},{60,100}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics),
+                       Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Polygon(
+          points={{-100,72},{-100,-70},{-20,-20},{-20,20},{-100,72}},
+          lineColor={0,0,0},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,0},
+          fillColor={170,255,213},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{20,20},{20,-20},{100,-70},{100,70},{20,20}},
+          lineColor={0,0,0},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,96},{-60,60},{-10,60},{-10,20}}, color={0,0,255}),
+        Line(points={{60,96},{60,60},{8,60},{8,20}}, color={0,0,127})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end GasTurbine;
diff --git a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo
index 48f0c057c6ad5423bb56a2fd01d07c8111914331..9acf3701a4322af415a5a1765dde5cdcfcad5f70 100644
--- a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo
+++ b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.Fluid.Machines;
-model HeatPumpCompressor "Heat pump compressor "
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real pi=10.0 "Compression factor (Ps/Pe)";
-  parameter Real eta=0.85 "Isentropic efficiency";
-  parameter Units.SI.Power W_fric=0.0
-    "Power losses due to hydrodynamic friction (percent)";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-
-public
-  Units.SI.Power W "Mechanical power delivered to the compressor";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy His
-    "Fluid specific enthalpy after isentropic compression";
-  Units.SI.AbsolutePressure Pe(start=10e5) "Inlet pressure";
-  Units.SI.AbsolutePressure Ps(start=10e5) "Outlet pressure";
-  Units.SI.Temperature Te "Inlet temperature";
-  Units.SI.Temperature Ts "Outlet temperature";
-  Real xm(start=1.0) "Average vapor mass fraction";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-equation
-
-  /* Check that the fluid type is C3H3F5 */
-  assert(ftype == FluidType.C3H3F5, "HeatPumpCompressor: the fluid type must be C3H3F5");
-
-  C1.Q = C2.Q;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  Pe = C1.P;
-  Ps = C2.P;
-
-  ftype = C1.ftype;
-
-  /* Mechnical power delivered to the compressor */
-  W = Q*(C2.h - C1.h) / (1 - W_fric/100);
-
-  /* Compression factor */
-  pi = Ps/Pe;
-
-  /* Average vapor mass fraction */
-  xm = (proe.x + pros.x)/2.0;
-
-  /* Compression efficiency */
-  His - C1.h = max(xm, 0.01)*eta*(C2.h - C1.h);
-
-  /* Fluid thermodynamic properties before the compression */
-  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, 0, fluid);
-  Te = proe.T;
-
-  /* Fluid thermodynamic properties after the compression */
-  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, 0, fluid);
-  Ts = pros.T;
-
-  /* Fluid thermodynamic properties after the identropic compression */
-  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, 0, fluid);
-  His = props.h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid), Line(points={{-60,80},{60,20},{60,-20},
-              {-60,-80}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),Line(points={{-60,80},{60,20},{60,-20},
-              {-60,-80}}, color={0,0,255})}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end HeatPumpCompressor;
+within ThermoSysPro.Fluid.Machines;
+model HeatPumpCompressor "Heat pump compressor "
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real pi=10.0 "Compression factor (Ps/Pe)";
+  parameter Real eta=0.85 "Isentropic efficiency";
+  parameter Units.SI.Power W_fric=0.0
+    "Power losses due to hydrodynamic friction (percent)";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+
+public
+  Units.SI.Power W "Mechanical power delivered to the compressor";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy His
+    "Fluid specific enthalpy after isentropic compression";
+  Units.SI.AbsolutePressure Pe(start=10e5) "Inlet pressure";
+  Units.SI.AbsolutePressure Ps(start=10e5) "Outlet pressure";
+  Units.SI.Temperature Te "Inlet temperature";
+  Units.SI.Temperature Ts "Outlet temperature";
+  Real xm(start=1.0) "Average vapor mass fraction";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+equation
+
+  /* Check that the fluid type is C3H3F5 */
+  assert(ftype == FluidType.C3H3F5, "HeatPumpCompressor: the fluid type must be C3H3F5");
+
+  C1.Q = C2.Q;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  Pe = C1.P;
+  Ps = C2.P;
+
+  ftype = C1.ftype;
+
+  /* Mechnical power delivered to the compressor */
+  W = Q*(C2.h - C1.h) / (1 - W_fric/100);
+
+  /* Compression factor */
+  pi = Ps/Pe;
+
+  /* Average vapor mass fraction */
+  xm = (proe.x + pros.x)/2.0;
+
+  /* Compression efficiency */
+  His - C1.h = max(xm, 0.01)*eta*(C2.h - C1.h);
+
+  /* Fluid thermodynamic properties before the compression */
+  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, 0, fluid);
+  Te = proe.T;
+
+  /* Fluid thermodynamic properties after the compression */
+  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, 0, fluid);
+  Ts = pros.T;
+
+  /* Fluid thermodynamic properties after the identropic compression */
+  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, 0, fluid);
+  His = props.h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid), Line(points={{-60,80},{60,20},{60,-20},
+              {-60,-80}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),Line(points={{-60,80},{60,20},{60,-20},
+              {-60,-80}}, color={0,0,255})}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end HeatPumpCompressor;
diff --git a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo
index ad3507c56156206aca0407b9fd27ab5a8b96c015..36d67a2685f64daddac67cfb2544a5f6940788ec 100644
--- a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo
+++ b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo
@@ -1,416 +1,416 @@
-within ThermoSysPro.Fluid.Machines;
-model InternalCombustionEngine "Internal combustion engine with electrical output"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Integer mechanical_efficiency_type=1 "1: fixed nominal efficiency - 2: Linear efficiency using Coef_Rm_a, Coef_Rm_b and Coef_Rm_c - 3: Beau de Rochas cycle efficiency";
-  parameter Real Rmeca_nom=0.40 "Fixed nominal mechanical efficiency (active if mechanical_efficiency_type=1)";
-  parameter Real Coef_Rm_a=-5.727E-09 "Coefficient a for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
-  parameter Real Coef_Rm_b=4.5267E-05 "Coefficient b for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
-  parameter Real Coef_Rm_c=0.312412946 "Coefficient c for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
-  parameter Real Relec=0.97 "Engine electrical efficiency";
-  parameter Real Cosphi=1 "Cos(phi) of the electrical grid";
-  parameter Real Xpth=0.03 "Thermal loss fraction - cooling (0-1 sur Q.PCI)";
-  parameter Real Xref=0.2 "Cooling power fraction (0-1 sur Q.PCI)";
-  parameter Real MMg=30 "Gas average molar mass (g/mol)";
-  parameter Real DPe=0 "Water pressure loss as percent of the pressure at the inlet";
-  parameter ThermoSysPro.Units.SI.PressureDifference DPaf=0
-    "Pressure difference between the air pressure at the inlet and the flue gases pressure at the outlet";
-  parameter Real RV=6 "Engine volume ratio (> 1)";
-  parameter Real Kc=1.2 "Compression polytropic coefficient";
-  parameter Real Kd=1.4 "Expansion polytropic coefficient";
-  parameter Real Gamma=1.3333 "Flue gases gamma = Cp/Cv";
-  parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4
-    "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)";
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Real amCO2=amC+2*amO "CO2 molecular mass";
-  constant Real amH2O=2*amH+amO "H2O molecular mass";
-  constant Real amSO2=amS+2*amO "SO2 molecular mass";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-
-public
-  Units.SI.MassFlowRate Qsf(start=400)
-    "Flue gases mass flow rate at the outlet";
-  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
-  Real XsfCO2(start=0.5) "Flue gases CO2 mass fraction at the outlet";
-  Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet";
-  Real XsfO2(start=0) "Flue gases O2 mass fraction at the outlet";
-  Real XsfSO2(start=0) "Flue gases SO2 mass fraction at the outlet";
-  Real Rmeca(start=0.3) "Engine mechanical efficiency";
-  Units.SI.Power Wmeca(start=5e8) "Engine mechanical power";
-  Units.SI.Power Welec(start=5e8) "Engine electrical power";
-  Units.SI.Power Wact(start=5e8) "Active power";
-  Units.SI.Power Wcomb(start=5e8) "Fuel power available (Q.PCS)";
-  Units.SI.Power Wpth_ref(start=1e6) "Power of thermal losses + cooling";
-  Real exc(start=1) "Combustion air ratio";
-  Real PCScomb "Pouvoir Calorifique Supérieur du combustible sur brut(en J/kg)";
-  Units.SI.Temperature Tm(start=500) "Air-gas mixture temperature";
-  Units.SI.Temperature Tfcp(start=500)
-    "Temperature at the end of the compression phase";
-  Units.SI.AbsolutePressure Pfcp(start=12e5)
-    "Pressure at the end of the compression phase";
-  Units.SI.Temperature Tfcb(start=500)
-    "Temperature at the end of the combustion phase";
-  Units.SI.AbsolutePressure Pfcb(start=12e5)
-    "Pressure at the end of the combustion phase";
-  Units.SI.Temperature Tfd(start=500)
-    "Temperature at the end of the expansion phase";
-  Units.SI.AbsolutePressure Pfd(start=12e5)
-    "Pressure at the end of the expansion phase";
-  Units.SI.Temperature Tfe(start=500) "Temperature at the exhaust";
-  Units.SI.SpecificEnthalpy Hea(start=50e3)
-    "Air specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4)
-    "Flue gases specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hcomb(start=10e3)
-    "Fuel specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hrfum(start=10e3)
-    "Flue gases reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrcomb(start=10e3)
-    "Fuel reference specific enthalpy";
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
-  Real XeaCO2(start=0) "Air CO2 mass fraction at the inlet";
-  Real XeaH2O(start=0.1) "Air H2O mass fraction at the inlet";
-  Real XeaO2(start=0.2) "Air O2 mass fraction at the inlet";
-  Real XeaSO2(start=0) "Air SO2 mass fraction at the inlet";
-  Units.SI.SpecificHeatCapacity Cpair(start=1000) "Air specific heat capacity";
-  Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tcomb(start=300) "Fuel temperature";
-  Real XCcomb(start=0.8) "Fuel carbon fraction";
-  Real XHcomb(start=0.2) "Fuel hydrogen fraction";
-  Real XOcomb(start=0) "Fuel oxygen fraction";
-  Real XScomb(start=0) "Fuel sulfur fraction";
-  Real XEAUcomb(start=0) "Fuel H2O fraction";
-  Real XCDcomb(start=0) "Fuel ashes fraction";
-  Real PCIcomb(start=5e7) "Fuel PCI (J/kg)";
-  Units.SI.SpecificHeatCapacity Cpcomb(start=1000)
-    "Fuel specific heat capacity";
-  Units.SI.MassFlowRate Qe(start=1) "Water mass flow rate";
-  Units.SI.SpecificEnthalpy Hev(start=10e3)
-    "Water specific enthalpy at the inlet";
-  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
-  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
-  Units.SI.SpecificEnthalpy Hsv(start=10e3)
-    "Water specific enthalpy at the outlet";
-  Real MMairgaz(start=30) "Air/gas mixture molecular mass (g/mol)";
-  Real MMfumees(start=30) "Flue gases molecular mass (g/mol)";
-  FluidType fluids[2] "Fluids mixing in volume";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Flue gases specific enthalpy";
-  Units.SI.Power Jair "Thermal power diffusion from inlet Cair";
-  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_air "Diffusion conductance for inlet Cair";
-  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
-  Real rair "Value of r(Q/gamma) for inlet Cair";
-  Real rfg "Value of r(Q/gamma) for outlet Cfg";
-  FluidType ftype_ws "Water/steam fluid type";
-  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
-    annotation (Placement(transformation(extent={{-80,-100},{-60,-80}},
-          rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cair "Air inlet"
-                                                           annotation (
-      Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
-                                                           annotation (
-      Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 "Water inlet"
-                                                           annotation (
-      Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2
-    "Water/steam outlet"                                    annotation (
-      Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-equation
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Cair.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "InternalCombustionEngine: fluids mixing in volume are not compatible with each other");
-
-  // ----------------
-  // Water/steam side
-
-  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "InternalCombustionEngine: the fluid type for the water/steam side must be water/steam");
-
-  Cws1.Q = Cws2.Q;
-
-  Cws1.h_vol_1 = Cws2.h_vol_1;
-  Cws1.h_vol_2 = Cws2.h_vol_2;
-
-  Cws2.diff_on_1 = if (gamma_diff_ws > 0) then Cws1.diff_on_1 else false;
-  Cws1.diff_on_2 = if (gamma_diff_ws > 0) then Cws2.diff_on_2 else false;
-
-  Cws2.diff_res_1 = Cws1.diff_res_1 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0);
-  Cws1.diff_res_2 = Cws2.diff_res_2 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0);
-
-  Cws1.ftype = Cws2.ftype;
-
-  Cws1.Xco2 = Cws2.Xco2;
-  Cws1.Xh2o = Cws2.Xh2o;
-  Cws1.Xo2  = Cws2.Xo2;
-  Cws1.Xso2 = Cws2.Xso2;
-
-  ftype_ws = Cws1.ftype;
-
-  Qe = Cws1.Q;
-  Hev = Cws1.h;
-  Hsv = Cws2.h;
-
-  // ---------------
-  // Combustion side
-
-  /* Fuel inlet */
-  Qcomb = Cfuel.Q;
-  Tcomb = Cfuel.T;
-  XCcomb = Cfuel.Xc;
-  XHcomb = Cfuel.Xh;
-  XOcomb = Cfuel.Xo;
-  XScomb = Cfuel.Xs;
-  XEAUcomb = Cfuel.hum;
-  XCDcomb = Cfuel.Xashes;
-  PCIcomb = Cfuel.LHV;
-  Cpcomb = Cfuel.cp;
-
-  /* Air inlet */
-  Qea = Cair.Q;
-  Pea = Cair.P;
-  Hea = Cair.h; /***/
-
-  XeaCO2 = Cair.Xco2;
-  XeaH2O = Cair.Xh2o;
-  XeaO2 = Cair.Xo2;
-  XeaSO2 = Cair.Xso2;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Hsf = Cfg.h;
-
-  /* Mass balance equation for the flue gases */
-  0 = Qcomb + Qea - Qsf;
-
-  /* Energy balance equation for the flue gases */
-  0 = Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair) - Qsf*(Hsf - Hrfum) - Wpth_ref - Wmeca + J;
-
-  Hcomb = Cpcomb*(Tcomb - 273.15);
-
-  Cair.h_vol_2 = h;
-  Cfg.h_vol_1 = h;
-
-  /* Thermal losses */
-  Wpth_ref = Qcomb*PCIcomb*(Xpth + Xref);
-  Qe*(Hsv - Hev) = Qcomb*PCIcomb*Xref;
-
-  /* Fuel thermal power available */
-  PCScomb = PCIcomb + 224.3e5*XHcomb + 25.1e5*XEAUcomb;
-  Wcomb = Qcomb*PCIcomb;
-
-  /* Flue gases composition balance equations */
-  0 = Qcomb*XCcomb*amCO2/amC + Qea*XeaCO2 - Qsf*XsfCO2;
-  0 = Qcomb*XHcomb*(amH2O/2)/amH + Qea*XeaH2O - XsfH2O*Qsf;
-  0 = Qea*XeaO2 - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb - XsfO2*Qsf;
-  0 = Qcomb*XScomb*amSO2/amS + Qea*XeaSO2 - XsfSO2*Qsf;
-
-  Cfg.ftype = ftype;
-
-  Cfg.Xco2 = XsfCO2;
-  Cfg.Xh2o = XsfH2O;
-  Cfg.Xo2  = XsfO2;
-  Cfg.Xso2 = XsfSO2;
-
-  /* No flow reversal */
-  Cfg.h = Cfg.h_vol_1;
-
-  /* Diffusion power */
-  if diffusion then
-    rair = if Cair.diff_on_1 then exp(-0.033*(Cair.Q*Cair.diff_res_1)^2) else 0;
-    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
-
-    gamma_air = if Cair.diff_on_1 then 1/Cair.diff_res_1 else gamma0;
-    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
-
-    Jair = if Cair.diff_on_1 then rair*gamma_air*(Cair.h_vol_1 - Cair.h_vol_2) else 0;
-    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
-  else
-    rair = 0;
-    rfg = 0;
-
-    gamma_air = gamma0;
-    gamma_fg = gamma0;
-
-    Jair = 0;
-    Jfg = 0;
-  end if;
-
-  J = Jair + Jfg;
-
-  Cair.diff_res_2 = 0;
-  Cfg.diff_res_1 = 0;
-
-  Cair.diff_on_2 = diffusion;
-  Cfg.diff_on_1 = diffusion;
-
-  /* Air thermodynamic properties at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-  Cpair = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-
-  /* Flue gases thermodynamic properties at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  // --------------------
-  //  BEAU DE ROCHAS CYCLE
-
-  /* (1) Air and gas mixing at constant pressure Pea */
-  Tm = (Qcomb*Cpcomb*Tcomb + Qea*Cpair*Tea)/(Qcomb*Cpcomb + Qea*Cpair);
-
-  /* (2) Polytropic compression */
-  Tfcp = Tm*RV^(Kc - 1);
-  Pfcp = Pea*RV^Kc;
-
-  /* (3) Constant volume combustion (point mort haut) */
-  MMairgaz = (Qea*28.9 + Qcomb*MMg)/(Qea + Qcomb);
-  MMfumees = (1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2)*28 + XsfCO2*44 + XsfH2O*18 + XsfO2*32 + XsfSO2*64;
-  Pfcb = Pfcp*Tfcb/Tfcp*MMairgaz/MMfumees;
-  //Tfcb = (Wcomb - Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/0.75/Qsf + Tfcp;
-  Tfcb = Wcomb/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/Qsf + Tfcp;
-
-  /* (4) Polytropic expansion */
-  Tfd = Tfcb *(1/RV)^(Kd - 1);
-  Pfd = Pfcb *(1/RV)^Kd;
-
-  /* (5) Echappement */
-  Tfe = Tfd*(Psf/Pfd)^((Gamma - 1)/Gamma);
-
-  // --------------------
-
-  /* Efficiency and mechanical power */
-  if (mechanical_efficiency_type == 1) then
-    Rmeca = Rmeca_nom;
-  elseif (mechanical_efficiency_type == 2) then
-    Rmeca = Coef_Rm_a * Wcomb/1000*Wcomb/1000 + Coef_Rm_b*Wcomb/1000 + Coef_Rm_c;
-  else
-    Rmeca = ((Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair))
-            -(Qsf*(ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfe, XsfCO2, XsfH2O, XsfO2, XsfSO2)
-            -Hrfum) + Wpth_ref))/Wcomb;
-  end if;
-
-  Wmeca = Rmeca*Wcomb;
-
-  /* Combustion air ratio */
-  exc = Qea*(1 - XeaH2O)/((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO))/(XeaO2/(1 - XeaH2O)));
-
-  /* Pressure losses */
-  Pea - Psf = DPaf;
-  Cws2.P = if (Qe > 0) then Cws1.P - DPe*Cws1.P/100 else Cws1.P + DPe*Cws1.P/100;
-
-  /* Electrical power produced and active power*/
-  Welec = Wmeca*Relec;
-  Wact = Welec*Cosphi;
-
-  /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrcomb = 0;
-  Hrfum = 2501.569e3*XsfH2O;
-
-    annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{
-              -10,-76},{-2,-66},{-10,-64}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{
-              48,-42},{-46,-42}},
-          lineColor={0,0,0},
-          fillColor={170,255,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{
-              46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}},
-          lineColor={28,108,200},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-112,32},{-82,4}},
-          lineColor={28,108,200},
-          textString="Water inlet"),
-        Text(
-          extent={{82,34},{116,2}},
-          lineColor={238,46,47},
-          textString="Water outlet"),
-        Text(
-          extent={{14,-80},{38,-100}},
-          lineColor={28,108,200},
-          textString="Air inlet"),
-        Text(
-          extent={{14,112},{62,76}},
-          lineColor={238,46,47},
-          textString="Flue gases outlet"),
-        Text(
-          extent={{-112,-76},{-82,-104}},
-          lineColor={28,108,200},
-          textString="Fuel inlet")}),
-                             Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{
-              -10,-76},{-2,-66},{-10,-64}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{
-              48,-42},{-46,-42}},
-          lineColor={0,0,0},
-          fillColor={170,255,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{
-              46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}},
-          lineColor={28,108,200},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Chapter 15 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>"));
-end InternalCombustionEngine;
+within ThermoSysPro.Fluid.Machines;
+model InternalCombustionEngine "Internal combustion engine with electrical output"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Integer mechanical_efficiency_type=1 "1: fixed nominal efficiency - 2: Linear efficiency using Coef_Rm_a, Coef_Rm_b and Coef_Rm_c - 3: Beau de Rochas cycle efficiency";
+  parameter Real Rmeca_nom=0.40 "Fixed nominal mechanical efficiency (active if mechanical_efficiency_type=1)";
+  parameter Real Coef_Rm_a=-5.727E-09 "Coefficient a for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
+  parameter Real Coef_Rm_b=4.5267E-05 "Coefficient b for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
+  parameter Real Coef_Rm_c=0.312412946 "Coefficient c for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
+  parameter Real Relec=0.97 "Engine electrical efficiency";
+  parameter Real Cosphi=1 "Cos(phi) of the electrical grid";
+  parameter Real Xpth=0.03 "Thermal loss fraction - cooling (0-1 sur Q.PCI)";
+  parameter Real Xref=0.2 "Cooling power fraction (0-1 sur Q.PCI)";
+  parameter Real MMg=30 "Gas average molar mass (g/mol)";
+  parameter Real DPe=0 "Water pressure loss as percent of the pressure at the inlet";
+  parameter ThermoSysPro.Units.SI.PressureDifference DPaf=0
+    "Pressure difference between the air pressure at the inlet and the flue gases pressure at the outlet";
+  parameter Real RV=6 "Engine volume ratio (> 1)";
+  parameter Real Kc=1.2 "Compression polytropic coefficient";
+  parameter Real Kd=1.4 "Expansion polytropic coefficient";
+  parameter Real Gamma=1.3333 "Flue gases gamma = Cp/Cv";
+  parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4
+    "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)";
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Real amCO2=amC+2*amO "CO2 molecular mass";
+  constant Real amH2O=2*amH+amO "H2O molecular mass";
+  constant Real amSO2=amS+2*amO "SO2 molecular mass";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+
+public
+  Units.SI.MassFlowRate Qsf(start=400)
+    "Flue gases mass flow rate at the outlet";
+  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
+  Real XsfCO2(start=0.5) "Flue gases CO2 mass fraction at the outlet";
+  Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet";
+  Real XsfO2(start=0) "Flue gases O2 mass fraction at the outlet";
+  Real XsfSO2(start=0) "Flue gases SO2 mass fraction at the outlet";
+  Real Rmeca(start=0.3) "Engine mechanical efficiency";
+  Units.SI.Power Wmeca(start=5e8) "Engine mechanical power";
+  Units.SI.Power Welec(start=5e8) "Engine electrical power";
+  Units.SI.Power Wact(start=5e8) "Active power";
+  Units.SI.Power Wcomb(start=5e8) "Fuel power available (Q.PCS)";
+  Units.SI.Power Wpth_ref(start=1e6) "Power of thermal losses + cooling";
+  Real exc(start=1) "Combustion air ratio";
+  Real PCScomb "Pouvoir Calorifique Supérieur du combustible sur brut(en J/kg)";
+  Units.SI.Temperature Tm(start=500) "Air-gas mixture temperature";
+  Units.SI.Temperature Tfcp(start=500)
+    "Temperature at the end of the compression phase";
+  Units.SI.AbsolutePressure Pfcp(start=12e5)
+    "Pressure at the end of the compression phase";
+  Units.SI.Temperature Tfcb(start=500)
+    "Temperature at the end of the combustion phase";
+  Units.SI.AbsolutePressure Pfcb(start=12e5)
+    "Pressure at the end of the combustion phase";
+  Units.SI.Temperature Tfd(start=500)
+    "Temperature at the end of the expansion phase";
+  Units.SI.AbsolutePressure Pfd(start=12e5)
+    "Pressure at the end of the expansion phase";
+  Units.SI.Temperature Tfe(start=500) "Temperature at the exhaust";
+  Units.SI.SpecificEnthalpy Hea(start=50e3)
+    "Air specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4)
+    "Flue gases specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hcomb(start=10e3)
+    "Fuel specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hrfum(start=10e3)
+    "Flue gases reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrcomb(start=10e3)
+    "Fuel reference specific enthalpy";
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
+  Real XeaCO2(start=0) "Air CO2 mass fraction at the inlet";
+  Real XeaH2O(start=0.1) "Air H2O mass fraction at the inlet";
+  Real XeaO2(start=0.2) "Air O2 mass fraction at the inlet";
+  Real XeaSO2(start=0) "Air SO2 mass fraction at the inlet";
+  Units.SI.SpecificHeatCapacity Cpair(start=1000) "Air specific heat capacity";
+  Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tcomb(start=300) "Fuel temperature";
+  Real XCcomb(start=0.8) "Fuel carbon fraction";
+  Real XHcomb(start=0.2) "Fuel hydrogen fraction";
+  Real XOcomb(start=0) "Fuel oxygen fraction";
+  Real XScomb(start=0) "Fuel sulfur fraction";
+  Real XEAUcomb(start=0) "Fuel H2O fraction";
+  Real XCDcomb(start=0) "Fuel ashes fraction";
+  Real PCIcomb(start=5e7) "Fuel PCI (J/kg)";
+  Units.SI.SpecificHeatCapacity Cpcomb(start=1000)
+    "Fuel specific heat capacity";
+  Units.SI.MassFlowRate Qe(start=1) "Water mass flow rate";
+  Units.SI.SpecificEnthalpy Hev(start=10e3)
+    "Water specific enthalpy at the inlet";
+  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
+  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
+  Units.SI.SpecificEnthalpy Hsv(start=10e3)
+    "Water specific enthalpy at the outlet";
+  Real MMairgaz(start=30) "Air/gas mixture molecular mass (g/mol)";
+  Real MMfumees(start=30) "Flue gases molecular mass (g/mol)";
+  FluidType fluids[2] "Fluids mixing in volume";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Flue gases specific enthalpy";
+  Units.SI.Power Jair "Thermal power diffusion from inlet Cair";
+  Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_air "Diffusion conductance for inlet Cair";
+  Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg";
+  Real rair "Value of r(Q/gamma) for inlet Cair";
+  Real rfg "Value of r(Q/gamma) for outlet Cfg";
+  FluidType ftype_ws "Water/steam fluid type";
+  Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet"
+    annotation (Placement(transformation(extent={{-80,-100},{-60,-80}},
+          rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cair "Air inlet"
+                                                           annotation (
+      Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet"
+                                                           annotation (
+      Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 "Water inlet"
+                                                           annotation (
+      Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2
+    "Water/steam outlet"                                    annotation (
+      Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+equation
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Cair.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "InternalCombustionEngine: fluids mixing in volume are not compatible with each other");
+
+  // ----------------
+  // Water/steam side
+
+  assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "InternalCombustionEngine: the fluid type for the water/steam side must be water/steam");
+
+  Cws1.Q = Cws2.Q;
+
+  Cws1.h_vol_1 = Cws2.h_vol_1;
+  Cws1.h_vol_2 = Cws2.h_vol_2;
+
+  Cws2.diff_on_1 = if (gamma_diff_ws > 0) then Cws1.diff_on_1 else false;
+  Cws1.diff_on_2 = if (gamma_diff_ws > 0) then Cws2.diff_on_2 else false;
+
+  Cws2.diff_res_1 = Cws1.diff_res_1 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0);
+  Cws1.diff_res_2 = Cws2.diff_res_2 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0);
+
+  Cws1.ftype = Cws2.ftype;
+
+  Cws1.Xco2 = Cws2.Xco2;
+  Cws1.Xh2o = Cws2.Xh2o;
+  Cws1.Xo2  = Cws2.Xo2;
+  Cws1.Xso2 = Cws2.Xso2;
+
+  ftype_ws = Cws1.ftype;
+
+  Qe = Cws1.Q;
+  Hev = Cws1.h;
+  Hsv = Cws2.h;
+
+  // ---------------
+  // Combustion side
+
+  /* Fuel inlet */
+  Qcomb = Cfuel.Q;
+  Tcomb = Cfuel.T;
+  XCcomb = Cfuel.Xc;
+  XHcomb = Cfuel.Xh;
+  XOcomb = Cfuel.Xo;
+  XScomb = Cfuel.Xs;
+  XEAUcomb = Cfuel.hum;
+  XCDcomb = Cfuel.Xashes;
+  PCIcomb = Cfuel.LHV;
+  Cpcomb = Cfuel.cp;
+
+  /* Air inlet */
+  Qea = Cair.Q;
+  Pea = Cair.P;
+  Hea = Cair.h; /***/
+
+  XeaCO2 = Cair.Xco2;
+  XeaH2O = Cair.Xh2o;
+  XeaO2 = Cair.Xo2;
+  XeaSO2 = Cair.Xso2;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Hsf = Cfg.h;
+
+  /* Mass balance equation for the flue gases */
+  0 = Qcomb + Qea - Qsf;
+
+  /* Energy balance equation for the flue gases */
+  0 = Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair) - Qsf*(Hsf - Hrfum) - Wpth_ref - Wmeca + J;
+
+  Hcomb = Cpcomb*(Tcomb - 273.15);
+
+  Cair.h_vol_2 = h;
+  Cfg.h_vol_1 = h;
+
+  /* Thermal losses */
+  Wpth_ref = Qcomb*PCIcomb*(Xpth + Xref);
+  Qe*(Hsv - Hev) = Qcomb*PCIcomb*Xref;
+
+  /* Fuel thermal power available */
+  PCScomb = PCIcomb + 224.3e5*XHcomb + 25.1e5*XEAUcomb;
+  Wcomb = Qcomb*PCIcomb;
+
+  /* Flue gases composition balance equations */
+  0 = Qcomb*XCcomb*amCO2/amC + Qea*XeaCO2 - Qsf*XsfCO2;
+  0 = Qcomb*XHcomb*(amH2O/2)/amH + Qea*XeaH2O - XsfH2O*Qsf;
+  0 = Qea*XeaO2 - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb - XsfO2*Qsf;
+  0 = Qcomb*XScomb*amSO2/amS + Qea*XeaSO2 - XsfSO2*Qsf;
+
+  Cfg.ftype = ftype;
+
+  Cfg.Xco2 = XsfCO2;
+  Cfg.Xh2o = XsfH2O;
+  Cfg.Xo2  = XsfO2;
+  Cfg.Xso2 = XsfSO2;
+
+  /* No flow reversal */
+  Cfg.h = Cfg.h_vol_1;
+
+  /* Diffusion power */
+  if diffusion then
+    rair = if Cair.diff_on_1 then exp(-0.033*(Cair.Q*Cair.diff_res_1)^2) else 0;
+    rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0;
+
+    gamma_air = if Cair.diff_on_1 then 1/Cair.diff_res_1 else gamma0;
+    gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0;
+
+    Jair = if Cair.diff_on_1 then rair*gamma_air*(Cair.h_vol_1 - Cair.h_vol_2) else 0;
+    Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0;
+  else
+    rair = 0;
+    rfg = 0;
+
+    gamma_air = gamma0;
+    gamma_fg = gamma0;
+
+    Jair = 0;
+    Jfg = 0;
+  end if;
+
+  J = Jair + Jfg;
+
+  Cair.diff_res_2 = 0;
+  Cfg.diff_res_1 = 0;
+
+  Cair.diff_on_2 = diffusion;
+  Cfg.diff_on_1 = diffusion;
+
+  /* Air thermodynamic properties at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+  Cpair = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+
+  /* Flue gases thermodynamic properties at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  // --------------------
+  //  BEAU DE ROCHAS CYCLE
+
+  /* (1) Air and gas mixing at constant pressure Pea */
+  Tm = (Qcomb*Cpcomb*Tcomb + Qea*Cpair*Tea)/(Qcomb*Cpcomb + Qea*Cpair);
+
+  /* (2) Polytropic compression */
+  Tfcp = Tm*RV^(Kc - 1);
+  Pfcp = Pea*RV^Kc;
+
+  /* (3) Constant volume combustion (point mort haut) */
+  MMairgaz = (Qea*28.9 + Qcomb*MMg)/(Qea + Qcomb);
+  MMfumees = (1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2)*28 + XsfCO2*44 + XsfH2O*18 + XsfO2*32 + XsfSO2*64;
+  Pfcb = Pfcp*Tfcb/Tfcp*MMairgaz/MMfumees;
+  //Tfcb = (Wcomb - Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/0.75/Qsf + Tfcp;
+  Tfcb = Wcomb/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/Qsf + Tfcp;
+
+  /* (4) Polytropic expansion */
+  Tfd = Tfcb *(1/RV)^(Kd - 1);
+  Pfd = Pfcb *(1/RV)^Kd;
+
+  /* (5) Echappement */
+  Tfe = Tfd*(Psf/Pfd)^((Gamma - 1)/Gamma);
+
+  // --------------------
+
+  /* Efficiency and mechanical power */
+  if (mechanical_efficiency_type == 1) then
+    Rmeca = Rmeca_nom;
+  elseif (mechanical_efficiency_type == 2) then
+    Rmeca = Coef_Rm_a * Wcomb/1000*Wcomb/1000 + Coef_Rm_b*Wcomb/1000 + Coef_Rm_c;
+  else
+    Rmeca = ((Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair))
+            -(Qsf*(ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfe, XsfCO2, XsfH2O, XsfO2, XsfSO2)
+            -Hrfum) + Wpth_ref))/Wcomb;
+  end if;
+
+  Wmeca = Rmeca*Wcomb;
+
+  /* Combustion air ratio */
+  exc = Qea*(1 - XeaH2O)/((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO))/(XeaO2/(1 - XeaH2O)));
+
+  /* Pressure losses */
+  Pea - Psf = DPaf;
+  Cws2.P = if (Qe > 0) then Cws1.P - DPe*Cws1.P/100 else Cws1.P + DPe*Cws1.P/100;
+
+  /* Electrical power produced and active power*/
+  Welec = Wmeca*Relec;
+  Wact = Welec*Cosphi;
+
+  /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrcomb = 0;
+  Hrfum = 2501.569e3*XsfH2O;
+
+    annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{
+              -10,-76},{-2,-66},{-10,-64}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{
+              48,-42},{-46,-42}},
+          lineColor={0,0,0},
+          fillColor={170,255,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{
+              46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}},
+          lineColor={28,108,200},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-112,32},{-82,4}},
+          lineColor={28,108,200},
+          textString="Water inlet"),
+        Text(
+          extent={{82,34},{116,2}},
+          lineColor={238,46,47},
+          textString="Water outlet"),
+        Text(
+          extent={{14,-80},{38,-100}},
+          lineColor={28,108,200},
+          textString="Air inlet"),
+        Text(
+          extent={{14,112},{62,76}},
+          lineColor={238,46,47},
+          textString="Flue gases outlet"),
+        Text(
+          extent={{-112,-76},{-82,-104}},
+          lineColor={28,108,200},
+          textString="Fuel inlet")}),
+                             Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{
+              -10,-76},{-2,-66},{-10,-64}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{
+              48,-42},{-46,-42}},
+          lineColor={0,0,0},
+          fillColor={170,255,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{
+              46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}},
+          lineColor={28,108,200},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Chapter 15 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>"));
+end InternalCombustionEngine;
diff --git a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo
index 89da26e221867df0fd1800ffbefdf722439b72cb..b6c4439323c3583264fe00d91e23980d2d32d956 100644
--- a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo
+++ b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo
@@ -1,191 +1,191 @@
-within ThermoSysPro.Fluid.Machines;
-model StaticCentrifugalPump "Static centrifugal pump"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
-    "Fixed rotational speed (active if fixed_rot_or_power=1 and rpm_or_mpower connector not connected)";
-  parameter Units.SI.Power MPower=0.1e6
-    "Fixed mechanical power (active if fixed_rot_or_power=2 and rpm_or_mpower connector not connected)";
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
-    "Nominal rotational speed";
-  parameter Real rm=0.85
-    "Product of the pump mechanical and electrical efficiencies";
-  parameter Integer fixed_rot_or_power=1
-    "1: fixed rotational speed - 2: fixed mechanical power";
-  parameter Boolean adiabatic_compression=false
-    "true: compression at constant enthalpy - false: compression with varying enthalpy";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-  parameter Real a1=-88.67
-    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-  parameter Real a2=0
-    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
-  parameter Real a3=43.15
-    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter Real b1=-3.7751
-    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
-  parameter Real b2=3.61
-    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
-  parameter Real b3=-0.0075464
-    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-6 "Small number";
-  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
-
-public
-  Real rh "Hydraulic efficiency";
-  Units.SI.Height hn(start=10) "Pump head";
-  Real R(start=VRot/VRotn) "Reduced rotational speed";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
-  Units.SI.Power Wh "Hydraulic power";
-  Units.SI.Power Wm "Mechanical power";
-  ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vr "Rotational speed";
-  Units.SI.Density rho(start=998) "Fluid density";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Pressure variation between the outlet and the inlet";
-  Units.SI.SpecificEnthalpy deltaH
-    "Specific enthalpy variation between the outlet and the inlet";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal rpm_or_mpower
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  if (cardinality(rpm_or_mpower) == 0) then
-    if (fixed_rot_or_power == 1) then
-      rpm_or_mpower.signal = VRot;
-    elseif (fixed_rot_or_power == 2) then
-      rpm_or_mpower.signal = MPower;
-    else
-      assert(false, "StaticCentrifugalPump: incorrect option");
-    end if;
-  end if;
-
-  C1.Q = C2.Q;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  deltaP = C2.P - C1.P;
-  deltaH = C2.h - C1.h;
-
-  deltaP = rho*g*hn;
-  Q = Qv*rho;
-
-  ftype = C1.ftype;
-
-  /* Fixed rotational speed or fixed mechanical power */
-  if (fixed_rot_or_power == 1) then
-    Vr = rpm_or_mpower.signal;
-  elseif (fixed_rot_or_power == 2) then
-    Wm = rpm_or_mpower.signal;
-  else
-    assert(false, "StaticCentrifugalPump: incorrect option");
-  end if;
-
-  /* Energy balance equation */
-  if adiabatic_compression then
-    deltaH = 0;
-  else
-    deltaH = g*hn/rh;
-  end if;
-
-  /* Reduced rotational speed */
-  R = Vr/VRotn;
-
-  /* Pump characteristics */
-  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
-  rh = noEvent(max(if (abs(R) > eps) then b1*Qv*abs(Qv)/R^2 + b2*Qv/R + b3 else b3, rhmin));
-
-  /* Mechanical power */
-  Wm = Q*deltaH/rm;
-
-  /* Hydraulic power */
-  Wh = Qv*deltaP/rh;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-  h = (C1.h + C2.h)/2;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0}),
-        Line(points={{-80,0},{80,0}}),
-        Line(points={{80,0},{2,60}}),
-        Line(points={{80,0},{0,-60}})}),
-    Window(
-      x=0.03,
-      y=0.02,
-      width=0.95,
-      height=0.95),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{-80,0},{80,0}}),
-        Line(points={{80,0},{2,60}}),
-        Line(points={{80,0},{0,-60}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 12.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end StaticCentrifugalPump;
+within ThermoSysPro.Fluid.Machines;
+model StaticCentrifugalPump "Static centrifugal pump"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
+    "Fixed rotational speed (active if fixed_rot_or_power=1 and rpm_or_mpower connector not connected)";
+  parameter Units.SI.Power MPower=0.1e6
+    "Fixed mechanical power (active if fixed_rot_or_power=2 and rpm_or_mpower connector not connected)";
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
+    "Nominal rotational speed";
+  parameter Real rm=0.85
+    "Product of the pump mechanical and electrical efficiencies";
+  parameter Integer fixed_rot_or_power=1
+    "1: fixed rotational speed - 2: fixed mechanical power";
+  parameter Boolean adiabatic_compression=false
+    "true: compression at constant enthalpy - false: compression with varying enthalpy";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+  parameter Real a1=-88.67
+    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+  parameter Real a2=0
+    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
+  parameter Real a3=43.15
+    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter Real b1=-3.7751
+    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
+  parameter Real b2=3.61
+    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
+  parameter Real b3=-0.0075464
+    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-6 "Small number";
+  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
+
+public
+  Real rh "Hydraulic efficiency";
+  Units.SI.Height hn(start=10) "Pump head";
+  Real R(start=VRot/VRotn) "Reduced rotational speed";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
+  Units.SI.Power Wh "Hydraulic power";
+  Units.SI.Power Wm "Mechanical power";
+  ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vr "Rotational speed";
+  Units.SI.Density rho(start=998) "Fluid density";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Pressure variation between the outlet and the inlet";
+  Units.SI.SpecificEnthalpy deltaH
+    "Specific enthalpy variation between the outlet and the inlet";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal rpm_or_mpower
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  if (cardinality(rpm_or_mpower) == 0) then
+    if (fixed_rot_or_power == 1) then
+      rpm_or_mpower.signal = VRot;
+    elseif (fixed_rot_or_power == 2) then
+      rpm_or_mpower.signal = MPower;
+    else
+      assert(false, "StaticCentrifugalPump: incorrect option");
+    end if;
+  end if;
+
+  C1.Q = C2.Q;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  deltaP = C2.P - C1.P;
+  deltaH = C2.h - C1.h;
+
+  deltaP = rho*g*hn;
+  Q = Qv*rho;
+
+  ftype = C1.ftype;
+
+  /* Fixed rotational speed or fixed mechanical power */
+  if (fixed_rot_or_power == 1) then
+    Vr = rpm_or_mpower.signal;
+  elseif (fixed_rot_or_power == 2) then
+    Wm = rpm_or_mpower.signal;
+  else
+    assert(false, "StaticCentrifugalPump: incorrect option");
+  end if;
+
+  /* Energy balance equation */
+  if adiabatic_compression then
+    deltaH = 0;
+  else
+    deltaH = g*hn/rh;
+  end if;
+
+  /* Reduced rotational speed */
+  R = Vr/VRotn;
+
+  /* Pump characteristics */
+  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
+  rh = noEvent(max(if (abs(R) > eps) then b1*Qv*abs(Qv)/R^2 + b2*Qv/R + b3 else b3, rhmin));
+
+  /* Mechanical power */
+  Wm = Q*deltaH/rm;
+
+  /* Hydraulic power */
+  Wh = Qv*deltaP/rh;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+  h = (C1.h + C2.h)/2;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0}),
+        Line(points={{-80,0},{80,0}}),
+        Line(points={{80,0},{2,60}}),
+        Line(points={{80,0},{0,-60}})}),
+    Window(
+      x=0.03,
+      y=0.02,
+      width=0.95,
+      height=0.95),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{-80,0},{80,0}}),
+        Line(points={{80,0},{2,60}}),
+        Line(points={{80,0},{0,-60}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 12.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end StaticCentrifugalPump;
diff --git a/ThermoSysPro/Fluid/Machines/StaticFan.mo b/ThermoSysPro/Fluid/Machines/StaticFan.mo
index 6b01b06debfe0cff3b070b9b324e6b8b6a84e747..8572de129d202d452e4ddcf2d75171b36720070e 100644
--- a/ThermoSysPro/Fluid/Machines/StaticFan.mo
+++ b/ThermoSysPro/Fluid/Machines/StaticFan.mo
@@ -1,182 +1,182 @@
-within ThermoSysPro.Fluid.Machines;
-model StaticFan "Static fan"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
-    "Rotational speed";
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
-    "Nominal rotational speed";
-  parameter Real rm=0.85 "Product of the pump mechanical and electrical efficiencies";
-  parameter Boolean adiabatic_compression=false "true: adiabatic compression - false: non adiabatic compression";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-
-  parameter Real a1=-52.04 "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-  parameter Real a2=-71.735 "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
-  parameter Real a3=45.59  "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter Real b1=-8.4818 "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
-  parameter Real b2=4.6593 "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
-  parameter Real b3=-0.1533 "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Real eps=1.e-6 "Small number";
-  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
-
-public
-  Real rh( start=0.5) "Hydraulic efficiency";
-  Units.SI.Length hn(start=10) "Pump head";
-  Real R "Ratio VRot/VRotn (s.u.)";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow";
-  Units.SI.Power Wh "Hydraulic power";
-  Units.SI.Power Wm "Motor power";
-  Units.SI.Density rho(start=998) "Fluid density";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Pressure variation between the outlet and the inlet";
-  Units.SI.SpecificEnthalpy deltaH
-    "Specific enthalpy variation between the outlet and the inlet";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
-  Units.SI.Temperature T(start=500) "Fluid temperature";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandeFan
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
-          extent={{-110,-10},{-90,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal VRotation
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  /* Check that the fluid type is flue gases */
-  assert(ftype == FluidType.FlueGases, "StaticFan: the fluid type must be flue gases");
-
-  if (cardinality(commandeFan) == 0) then
-    commandeFan.signal = true;
-  end if;
-
-  if (cardinality(VRotation) == 0) then
-    VRotation.signal = VRot;
-  end if;
-
-  C1.Q = C2.Q;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  ftype = C1.ftype;
-
-  Q = C1.Q;
-  Q = Qv*rho;
-
-  deltaP = C2.P - C1.P;
-  deltaH = C2.h - C1.h;
-
-  deltaP = rho*g*hn;
-
-  if adiabatic_compression then
-    deltaH = 0;
-  else
-    deltaH = g*hn/rh;
-  end if;
-
-  /* Pump position (started or stopped) */
-  R = if commandeFan.signal then VRotation.signal/VRotn else 0;
-
-  /* Pump characteristics */
-  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
-  rh = noEvent(max(if (abs(R) > eps) then b1*Qv^2/R^2 + b2*Qv/R + b3 else b3, rhmin));
-
-  /* Mechanical power */
-  Wm = Q*deltaH/rm;
-
-  /* Hydraulic power */
-  Wh = Qv*deltaP/rh;
-
-  /* Fluid thermodynamic properties */
-  P = (C1.P + C2.P)/2;
-  h = (C2.h + C1.h)/2;
-
-  // Temperature
-  h =  ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}),
-        Polygon(
-          points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Backward)}),
-    Window(
-      x=0.03,
-      y=0.02,
-      width=0.95,
-      height=0.95),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}),
-        Polygon(
-          points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Backward)}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end StaticFan;
+within ThermoSysPro.Fluid.Machines;
+model StaticFan "Static fan"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
+    "Rotational speed";
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
+    "Nominal rotational speed";
+  parameter Real rm=0.85 "Product of the pump mechanical and electrical efficiencies";
+  parameter Boolean adiabatic_compression=false "true: adiabatic compression - false: non adiabatic compression";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+  parameter Real a1=-52.04 "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+  parameter Real a2=-71.735 "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
+  parameter Real a3=45.59  "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter Real b1=-8.4818 "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
+  parameter Real b2=4.6593 "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
+  parameter Real b3=-0.1533 "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Real eps=1.e-6 "Small number";
+  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
+
+public
+  Real rh( start=0.5) "Hydraulic efficiency";
+  Units.SI.Length hn(start=10) "Pump head";
+  Real R "Ratio VRot/VRotn (s.u.)";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow";
+  Units.SI.Power Wh "Hydraulic power";
+  Units.SI.Power Wm "Motor power";
+  Units.SI.Density rho(start=998) "Fluid density";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Pressure variation between the outlet and the inlet";
+  Units.SI.SpecificEnthalpy deltaH
+    "Specific enthalpy variation between the outlet and the inlet";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
+  Units.SI.Temperature T(start=500) "Fluid temperature";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandeFan
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
+          extent={{-110,-10},{-90,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal VRotation
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  /* Check that the fluid type is flue gases */
+  assert(ftype == FluidType.FlueGases, "StaticFan: the fluid type must be flue gases");
+
+  if (cardinality(commandeFan) == 0) then
+    commandeFan.signal = true;
+  end if;
+
+  if (cardinality(VRotation) == 0) then
+    VRotation.signal = VRot;
+  end if;
+
+  C1.Q = C2.Q;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  ftype = C1.ftype;
+
+  Q = C1.Q;
+  Q = Qv*rho;
+
+  deltaP = C2.P - C1.P;
+  deltaH = C2.h - C1.h;
+
+  deltaP = rho*g*hn;
+
+  if adiabatic_compression then
+    deltaH = 0;
+  else
+    deltaH = g*hn/rh;
+  end if;
+
+  /* Pump position (started or stopped) */
+  R = if commandeFan.signal then VRotation.signal/VRotn else 0;
+
+  /* Pump characteristics */
+  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
+  rh = noEvent(max(if (abs(R) > eps) then b1*Qv^2/R^2 + b2*Qv/R + b3 else b3, rhmin));
+
+  /* Mechanical power */
+  Wm = Q*deltaH/rm;
+
+  /* Hydraulic power */
+  Wh = Qv*deltaP/rh;
+
+  /* Fluid thermodynamic properties */
+  P = (C1.P + C2.P)/2;
+  h = (C2.h + C1.h)/2;
+
+  // Temperature
+  h =  ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2);
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}),
+        Polygon(
+          points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Backward)}),
+    Window(
+      x=0.03,
+      y=0.02,
+      width=0.95,
+      height=0.95),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}),
+        Polygon(
+          points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Backward)}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end StaticFan;
diff --git a/ThermoSysPro/Fluid/Machines/SteamEngine.mo b/ThermoSysPro/Fluid/Machines/SteamEngine.mo
index b29088327f70e4cab4c8a12406f819f4cbff83fd..076566dbaac541859351489b0d61ebd7ca34b8ee 100644
--- a/ThermoSysPro/Fluid/Machines/SteamEngine.mo
+++ b/ThermoSysPro/Fluid/Machines/SteamEngine.mo
@@ -1,174 +1,174 @@
-within ThermoSysPro.Fluid.Machines;
-model SteamEngine "Steam engine"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real caract[:, 2]=[0, 0; 15e5, 20.0] "Engine charateristics Q=f(deltaP)";
-  parameter Real eta_is=0.85 "Isentropic efficiency";
-  parameter Real W_frot=0.0 "Power losses due to hydrodynamic friction (percent)";
-  parameter Real eta_stato=1.0 "Efficiency to account for cinetic losses (<= 1) (s.u.)";
-  parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter IF97Region region_e=IF97Region.All_regions "Inlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_s=IF97Region.All_regions "Outlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer mode_e=Integer(region_e) - 1 "Inlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_s=Integer(region_s) - 1 "Outlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Power W "Power produced by the engine";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy His
-    "Fluid specific enthalpy after isentropic expansion";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss";
-  Units.SI.AbsolutePressure Pe(start=10e5) "Pressure at the inlet";
-  Units.SI.AbsolutePressure Ps(start=10e5) "Pressure at the outlet";
-  Units.SI.Temperature Te "Temperature at the inlet";
-  Units.SI.Temperature Ts "Temperature at the outlet";
-  Real xm(start=1.0,min=0) "Average vapor mass fraction (n.u.)";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
-          extent={{-80,-10},{-60,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
-          extent={{60,-10},{80,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
-    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
-equation
-
-  /* Check that the fluid type is water/steam */
-  assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "SteamEngine: the fluid type must be water/steam");
-
-  C1.Q = C2.Q;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  Pe = C1.P;
-  Ps = C2.P;
-  deltaP = Pe - Ps;
-
-  ftype = C1.ftype;
-
-  /* Average vapor mass fraction during the expansion */
-  xm = (proe.x + pros.x)/2.0;
-
-  /* Mass flow */
-  if (option_interpolation == 1) then
-    Q = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], deltaP);
-  elseif (option_interpolation == 2) then
-    Q = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], deltaP);
-  else
-    assert(false, "SteamEngine: incorrect interpolation option");
-  end if;
-
-  /* Fluid specific enthalpy at the outlet */
-  C2.h - C1.h = xm*eta_is*(His - C1.h);
-
-  /* Mechanical power produced by the engine */
-  W = Q*eta_stato*(C1.h - C2.h)*(1 - W_frot/100);
-
-  /* Fluid thermodynamic properties before the expansion */
-  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, mode_e,fluid);
-  Te = proe.T;
-
-  /* Fluid thermodynamic properties after the expansion */
-  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, mode_s,fluid);
-  Ts = pros.T;
-
-  /* Fluid thermodynamic properties after the isentropic expansion */
-  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_s,fluid);
-  His = props.h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,100},{20,12}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-22,-16},{30,-66}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,60},{24,-42}}, color={0,0,255}),
-        Rectangle(
-          extent={{-20,80},{20,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Forward)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}},
-          lineColor={28,108,200},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,100},{20,20}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-22,-16},{30,-66}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,60},{24,-42}}, color={0,0,255}),
-        Rectangle(
-          extent={{-20,80},{20,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Forward)}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SteamEngine;
+within ThermoSysPro.Fluid.Machines;
+model SteamEngine "Steam engine"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real caract[:, 2]=[0, 0; 15e5, 20.0] "Engine charateristics Q=f(deltaP)";
+  parameter Real eta_is=0.85 "Isentropic efficiency";
+  parameter Real W_frot=0.0 "Power losses due to hydrodynamic friction (percent)";
+  parameter Real eta_stato=1.0 "Efficiency to account for cinetic losses (<= 1) (s.u.)";
+  parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter IF97Region region_e=IF97Region.All_regions "Inlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_s=IF97Region.All_regions "Outlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer mode_e=Integer(region_e) - 1 "Inlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_s=Integer(region_s) - 1 "Outlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Power W "Power produced by the engine";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy His
+    "Fluid specific enthalpy after isentropic expansion";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss";
+  Units.SI.AbsolutePressure Pe(start=10e5) "Pressure at the inlet";
+  Units.SI.AbsolutePressure Ps(start=10e5) "Pressure at the outlet";
+  Units.SI.Temperature Te "Temperature at the inlet";
+  Units.SI.Temperature Ts "Temperature at the outlet";
+  Real xm(start=1.0,min=0) "Average vapor mass fraction (n.u.)";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
+          extent={{-80,-10},{-60,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
+          extent={{60,-10},{80,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
+    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
+equation
+
+  /* Check that the fluid type is water/steam */
+  assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "SteamEngine: the fluid type must be water/steam");
+
+  C1.Q = C2.Q;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  Pe = C1.P;
+  Ps = C2.P;
+  deltaP = Pe - Ps;
+
+  ftype = C1.ftype;
+
+  /* Average vapor mass fraction during the expansion */
+  xm = (proe.x + pros.x)/2.0;
+
+  /* Mass flow */
+  if (option_interpolation == 1) then
+    Q = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], deltaP);
+  elseif (option_interpolation == 2) then
+    Q = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], deltaP);
+  else
+    assert(false, "SteamEngine: incorrect interpolation option");
+  end if;
+
+  /* Fluid specific enthalpy at the outlet */
+  C2.h - C1.h = xm*eta_is*(His - C1.h);
+
+  /* Mechanical power produced by the engine */
+  W = Q*eta_stato*(C1.h - C2.h)*(1 - W_frot/100);
+
+  /* Fluid thermodynamic properties before the expansion */
+  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, mode_e,fluid);
+  Te = proe.T;
+
+  /* Fluid thermodynamic properties after the expansion */
+  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, mode_s,fluid);
+  Ts = pros.T;
+
+  /* Fluid thermodynamic properties after the isentropic expansion */
+  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_s,fluid);
+  His = props.h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,100},{20,12}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-22,-16},{30,-66}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,60},{24,-42}}, color={0,0,255}),
+        Rectangle(
+          extent={{-20,80},{20,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Forward)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}},
+          lineColor={28,108,200},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,100},{20,20}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-22,-16},{30,-66}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,60},{24,-42}}, color={0,0,255}),
+        Rectangle(
+          extent={{-20,80},{20,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Forward)}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SteamEngine;
diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo
index 1d2a3d48e400028e92c0314c3cea12f400c78118..82a2183fd3c95c5bc88dad0ca81ac3d1e8131754 100644
--- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo
+++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo
@@ -1,206 +1,206 @@
-within ThermoSysPro.Fluid.Machines;
-model StodolaTurbine "Multistage turbine group using Stodola's ellipse"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real Cst=1.e7 "Stodola's ellipse coefficient";
-  parameter Real W_fric=0.0
-    "Power losses due to hydrodynamic friction (percent)";
-  parameter Real eta_stato=1.0
-    "Efficiency to account for cinetic losses (<= 1) (s.u.)";
-  parameter Units.SI.Area area_nz=1 "Nozzle area";
-  parameter Real eta_nz=1.0
-    "Nozzle efficency (eta_nz < 1 - turbine with nozzle - eta_nz = 1 - turbine without nozzle)";
-  parameter Units.SI.MassFlowRate Qmax=1
-    "Maximum mass flow through the turbine";
-  parameter Real eta_is_nom=0.8 "Nominal isentropic efficiency";
-  parameter Real eta_is_min=0.35 "Minimum isentropic efficiency";
-  parameter Real a=-1.3889
-    "x^2 coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
-  parameter Real b=2.6944
-    "x coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
-  parameter Real c=-0.5056
-    "Constant coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter IF97Region region_e=IF97Region.All_regions "IF97 region before expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_s=IF97Region.All_regions "IF97 region after expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region_ps=IF97Region.All_regions "IF97 region after isentropic expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode_e=Integer(region_e) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_s=Integer(region_s) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_ps=Integer(region_ps) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
-    "Critical pressure";
-  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
-    "Critical temperature";
-
-public
-  Real eta_is(start=0.85) "Isentropic efficiency";
-  Real eta_is_wet(start=0.83) "Isentropic efficiency for wet steam";
-  Units.SI.Power W "Mechanical power produced by the turbine";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy His
-    "Fluid specific enthalpy after isentropic expansion";
-  Units.SI.SpecificEnthalpy Hrs
-    "Fluid specific enthalpy after the real expansion";
-  Units.SI.AbsolutePressure Pe(start=10e5, min=0) "Pressure at the inlet";
-  Units.SI.AbsolutePressure Ps(start=10e5, min=0) "Pressure at the outlet";
-  Units.SI.Temperature Te(min=0) "Temperature at the inlet";
-  Units.SI.Temperature Ts(min=0) "Temperature at the outlet";
-  Units.SI.Velocity Vs "Fluid velocity at the outlet";
-  Units.SI.Density rhos(start=200) "Fluid density at the outlet";
-  Real xm(start=1.0,min=0) "Average vapor mass fraction";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  Interfaces.Connectors.FluidInlet Ce annotation (Placement(transformation(
-          extent={{-111,-10},{-91,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cs annotation (Placement(transformation(
-          extent={{91,-10},{111,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
-    annotation (Placement(transformation(
-        origin={0,-100},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
-                              annotation (Placement(transformation(
-        origin={110,-90},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros1
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-equation
-  /* Check that the fluid type is water/steam */
-  assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "StodolaTurbine: the fluid type must be water/steam");
-
-  if (cardinality(M) == 0) then
-    M.Ctr = 0;
-    M.w = 0;
-  else
-    M.Ctr*M.w = W;
-  end if;
-
-  Ce.Q = Cs.Q;
-
-  Ce.h_vol_1 = Cs.h_vol_1;
-  Ce.h_vol_2 = Cs.h_vol_2;
-
-  Cs.diff_on_1 = if (gamma_diff > 0) then Ce.diff_on_1 else false;
-  Ce.diff_on_2 = if (gamma_diff > 0) then Cs.diff_on_2 else false;
-
-  Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  Ce.ftype = Cs.ftype;
-
-  Ce.Xco2 = Cs.Xco2;
-  Ce.Xh2o = Cs.Xh2o;
-  Ce.Xo2  = Cs.Xo2;
-  Ce.Xso2 = Cs.Xso2;
-
-  Q = Ce.Q;
-  Pe = Ce.P;
-  Ps = Cs.P;
-
-  ftype = Ce.ftype;
-
-  /* Isentropic efficiency */
-  eta_is = if (Q < Qmax) then (max(eta_is_min,(a*(Q/Qmax)^2 + b*(Q/Qmax) + c))) else eta_is_nom;
-  eta_is_wet = xm*eta_is;
-
-  /* Average vapor mass fraction during the expansion */
-  if noEvent((Pe > pcrit) or (Te > Tcrit)) then
-    xm = 1;
-  else
-    xm = (proe.x + pros1.x)/2.0;
-  end if;
-
-  /* Stodola's ellipse law */
-  if noEvent((Pe > pcrit) or (Te > Tcrit)) then
-    Q = sqrt((Pe^2 - Ps^2)/(Cst*Te));
-  else
-    Q = sqrt((Pe^2 - Ps^2)/(Cst*Te*proe.x));
-  end if;
-
-  /* Fluid specific enthalpy after the expansion */
-  Hrs - Ce.h = xm*eta_is*(His - Ce.h);
-
-  /* Fluid specific enthalpy at the outlet of the nozzle */
-  Vs = Q/rhos/area_nz;
-  Cs.h - Hrs = (1 - eta_nz)*Vs^2/2;
-
-  /* Mechanical power produced by the turbine */
-  W = Q*eta_stato*(Ce.h - Cs.h)*(1 - W_fric/100);
-  MechPower.signal = W;
-
-  /* Fluid thermodynamic properties before the expansion */
-  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, Ce.h, mode_e, fluid);
-
-  Te = proe.T;
-
-  /* Fluid thermodynamic properties after the expansion */
-  pros1 = ThermoSysPro.Properties.Fluid.Ph(Ps, Hrs, mode_s, fluid);
-
-  /* Fluid thermodynamic properties at the outlet of the nozzle */
-  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, Cs.h, mode_s, fluid);
-
-  Ts = pros.T;
-  rhos = pros.d;
-
-  /* Fluid thermodynamic properties after the isentropic expansion */
-  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_ps, fluid);
-  His = props.h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid), Line(
-          points={{0,-70},{0,-90}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
-          lineColor={0,0,0},
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid), Line(
-          points={{0,-70},{0,-90}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 10.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StodolaTurbine;
+within ThermoSysPro.Fluid.Machines;
+model StodolaTurbine "Multistage turbine group using Stodola's ellipse"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real Cst=1.e7 "Stodola's ellipse coefficient";
+  parameter Real W_fric=0.0
+    "Power losses due to hydrodynamic friction (percent)";
+  parameter Real eta_stato=1.0
+    "Efficiency to account for cinetic losses (<= 1) (s.u.)";
+  parameter Units.SI.Area area_nz=1 "Nozzle area";
+  parameter Real eta_nz=1.0
+    "Nozzle efficency (eta_nz < 1 - turbine with nozzle - eta_nz = 1 - turbine without nozzle)";
+  parameter Units.SI.MassFlowRate Qmax=1
+    "Maximum mass flow through the turbine";
+  parameter Real eta_is_nom=0.8 "Nominal isentropic efficiency";
+  parameter Real eta_is_min=0.35 "Minimum isentropic efficiency";
+  parameter Real a=-1.3889
+    "x^2 coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
+  parameter Real b=2.6944
+    "x coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
+  parameter Real c=-0.5056
+    "Constant coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter IF97Region region_e=IF97Region.All_regions "IF97 region before expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_s=IF97Region.All_regions "IF97 region after expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region_ps=IF97Region.All_regions "IF97 region after isentropic expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode_e=Integer(region_e) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_s=Integer(region_s) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_ps=Integer(region_ps) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
+    "Critical pressure";
+  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
+    "Critical temperature";
+
+public
+  Real eta_is(start=0.85) "Isentropic efficiency";
+  Real eta_is_wet(start=0.83) "Isentropic efficiency for wet steam";
+  Units.SI.Power W "Mechanical power produced by the turbine";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy His
+    "Fluid specific enthalpy after isentropic expansion";
+  Units.SI.SpecificEnthalpy Hrs
+    "Fluid specific enthalpy after the real expansion";
+  Units.SI.AbsolutePressure Pe(start=10e5, min=0) "Pressure at the inlet";
+  Units.SI.AbsolutePressure Ps(start=10e5, min=0) "Pressure at the outlet";
+  Units.SI.Temperature Te(min=0) "Temperature at the inlet";
+  Units.SI.Temperature Ts(min=0) "Temperature at the outlet";
+  Units.SI.Velocity Vs "Fluid velocity at the outlet";
+  Units.SI.Density rhos(start=200) "Fluid density at the outlet";
+  Real xm(start=1.0,min=0) "Average vapor mass fraction";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  Interfaces.Connectors.FluidInlet Ce annotation (Placement(transformation(
+          extent={{-111,-10},{-91,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cs annotation (Placement(transformation(
+          extent={{91,-10},{111,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
+    annotation (Placement(transformation(
+        origin={0,-100},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
+                              annotation (Placement(transformation(
+        origin={110,-90},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros1
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+equation
+  /* Check that the fluid type is water/steam */
+  assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "StodolaTurbine: the fluid type must be water/steam");
+
+  if (cardinality(M) == 0) then
+    M.Ctr = 0;
+    M.w = 0;
+  else
+    M.Ctr*M.w = W;
+  end if;
+
+  Ce.Q = Cs.Q;
+
+  Ce.h_vol_1 = Cs.h_vol_1;
+  Ce.h_vol_2 = Cs.h_vol_2;
+
+  Cs.diff_on_1 = if (gamma_diff > 0) then Ce.diff_on_1 else false;
+  Ce.diff_on_2 = if (gamma_diff > 0) then Cs.diff_on_2 else false;
+
+  Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  Ce.ftype = Cs.ftype;
+
+  Ce.Xco2 = Cs.Xco2;
+  Ce.Xh2o = Cs.Xh2o;
+  Ce.Xo2  = Cs.Xo2;
+  Ce.Xso2 = Cs.Xso2;
+
+  Q = Ce.Q;
+  Pe = Ce.P;
+  Ps = Cs.P;
+
+  ftype = Ce.ftype;
+
+  /* Isentropic efficiency */
+  eta_is = if (Q < Qmax) then (max(eta_is_min,(a*(Q/Qmax)^2 + b*(Q/Qmax) + c))) else eta_is_nom;
+  eta_is_wet = xm*eta_is;
+
+  /* Average vapor mass fraction during the expansion */
+  if noEvent((Pe > pcrit) or (Te > Tcrit)) then
+    xm = 1;
+  else
+    xm = (proe.x + pros1.x)/2.0;
+  end if;
+
+  /* Stodola's ellipse law */
+  if noEvent((Pe > pcrit) or (Te > Tcrit)) then
+    Q = sqrt((Pe^2 - Ps^2)/(Cst*Te));
+  else
+    Q = sqrt((Pe^2 - Ps^2)/(Cst*Te*proe.x));
+  end if;
+
+  /* Fluid specific enthalpy after the expansion */
+  Hrs - Ce.h = xm*eta_is*(His - Ce.h);
+
+  /* Fluid specific enthalpy at the outlet of the nozzle */
+  Vs = Q/rhos/area_nz;
+  Cs.h - Hrs = (1 - eta_nz)*Vs^2/2;
+
+  /* Mechanical power produced by the turbine */
+  W = Q*eta_stato*(Ce.h - Cs.h)*(1 - W_fric/100);
+  MechPower.signal = W;
+
+  /* Fluid thermodynamic properties before the expansion */
+  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, Ce.h, mode_e, fluid);
+
+  Te = proe.T;
+
+  /* Fluid thermodynamic properties after the expansion */
+  pros1 = ThermoSysPro.Properties.Fluid.Ph(Ps, Hrs, mode_s, fluid);
+
+  /* Fluid thermodynamic properties at the outlet of the nozzle */
+  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, Cs.h, mode_s, fluid);
+
+  Ts = pros.T;
+  rhos = pros.d;
+
+  /* Fluid thermodynamic properties after the isentropic expansion */
+  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_ps, fluid);
+  His = props.h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid), Line(
+          points={{0,-70},{0,-90}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
+          lineColor={0,0,0},
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid), Line(
+          points={{0,-70},{0,-90}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 10.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StodolaTurbine;
diff --git a/ThermoSysPro/Fluid/Machines/package.mo b/ThermoSysPro/Fluid/Machines/package.mo
index a68b2e3fcffbcd5aa36592b5e6e407bf91680b0c..3b1a88ed0a0de06fecdd758e183371d50b87b38f 100644
--- a/ThermoSysPro/Fluid/Machines/package.mo
+++ b/ThermoSysPro/Fluid/Machines/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.Fluid;
-package Machines "Machines"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Machines;
+within ThermoSysPro.Fluid;
+package Machines "Machines"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Machines;
diff --git a/ThermoSysPro/Fluid/Machines/package.order b/ThermoSysPro/Fluid/Machines/package.order
index 4cafac1d9220e1c42eff46bffd2c56ef0adcf410..80416a6600f31b109e01237acaf691532210cb16 100644
--- a/ThermoSysPro/Fluid/Machines/package.order
+++ b/ThermoSysPro/Fluid/Machines/package.order
@@ -1,11 +1,11 @@
-CentrifugalPump
-CHPEngineBarkantineSystem
-CombustionTurbine
-Compressor
-GasTurbine
-HeatPumpCompressor
-InternalCombustionEngine
-StaticCentrifugalPump
-StaticFan
-SteamEngine
-StodolaTurbine
+CentrifugalPump
+CHPEngineBarkantineSystem
+CombustionTurbine
+Compressor
+GasTurbine
+HeatPumpCompressor
+InternalCombustionEngine
+StaticCentrifugalPump
+StaticFan
+SteamEngine
+StodolaTurbine
diff --git a/ThermoSysPro/Fluid/PressureLosses/Bend.mo b/ThermoSysPro/Fluid/PressureLosses/Bend.mo
index d832c5d7488ff3f541a7bf112a5ce8690c0c6134..0da80123885ba9694528d6a7a84740d3ab7c014e 100644
--- a/ThermoSysPro/Fluid/PressureLosses/Bend.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/Bend.mo
@@ -1,230 +1,230 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model Bend "Bend"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Diameter D=0.2 "Pipe diameter";
-  parameter Units.SI.Radius R0=0.2 "Pipe radius";
-  parameter ThermoSysPro.Units.nonSI.Angle_deg delta=90 "Pipe angle";
-  parameter Real rugosrel=0 "Pipe roughness";
-  parameter Boolean K_A1_Tabule=true
-    "true: A1 is computed using linear interpolation - false: A1 is computed using correlation formula";
-  parameter Boolean K_B1_Tabule=true
-    "true: B1 is computed using linear interpolation - false: B1 is computed using correlation formula";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  Real khi "Hydraulic pressure loss coefficient";
-  Real khim "Singular pressure loss coefficient";
-  Real khif "Friction pressure loss coefficient";
-  Real kdelta "Roughness factor for the singular pressure loss";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Presure loss";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.ReynoldsNumber Re "Reynolds number";
-  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
-  Real yA1 "Output of table A1";
-  Real yB1 "Output of table B1";
-  Real yC1 "Output of table C1";
-  Real lambda "Friction pressure loss coefficient";
-  Units.SI.Density rho "Fluid density";
-  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TA1(
-                    Table=[0, 0; 20, 0.31; 30, 0.45; 45, 0.60; 60, 0.78;
-        75, 0.90; 90, 1; 110, 1.13; 130, 1.20; 150, 1.28; 180, 1.40])
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TB1(
-                    Table=[0.5, 1.18; 0.6, 0.77; 0.7, 0.51; 0.8, 0.37;
-        0.9, 0.28; 1, 0.21; 1.25, 0.19; 1.50, 0.17; 2, 0.15; 4, 0.11; 6, 0.09;
-        8, 0.07; 10, 0.07; 15, 0.06; 20, 0.05; 25, 0.05; 30, 0.04; 35, 0.04; 40,
-        0.03; 45, 0.03; 50, 0.03]) annotation (Placement(transformation(extent=
-            {{20,80},{40,100}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  C1.P - C2.P = deltaP;
-
-  ftype = C1.ftype;
-
-  /* Pressure loss */
-  deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho);
-
-    /* Coude à °arois concentriques (Idel'cik p. 192). Quadratic flow regime is assumed and Re > 2e5 (Re > Relim). */
-  assert(R0/D > 0.5, "Coude: on doit avoir R0/D > 0.5");
-  assert((delta > 0) and not (delta > 180),
-    "Bend: parameter delta should be such as 0ࠦlt; delta <= 180°");
-
-  khi = kdelta*khim + khif;
-
-  khim = yA1*yB1*yC1;
-
-  TA1.u.signal = delta;
-
-  if (K_A1_Tabule) then
-    yA1 = TA1.y.signal;
-  else
-    yA1 = if (delta < 70) then 0.9*sin(delta) else if (delta > 100) then 0.7 +
-      0.35*delta/90 else 1.0;
-  end if;
-
-  TB1.u.signal = R0/D;
-
-  if (K_B1_Tabule) then
-    yB1 = TB1.y.signal;
-  else
-    yB1 = if (R0/D < 1) then 0.21/(R0/D)^2.5 else 0.21/(R0/D)^0.5;
-  end if;
-
-  yC1 = 1;
-
-  kdelta = if ((rugosrel < 0.001)) and (R0/D < 1.5) then 1.0 + 1.e3*rugosrel else
-          if (rugosrel < 0.001) then 1.0 + 1.e6*rugosrel^2 else 2.0;
-
-  khif = 0.0175*lambda*R0*delta/D;
-
-  if (rugosrel > 0.00005) then
-    lambda = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
-  else
-    lambda = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else
-            0;
-  end if;
-
-  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 2.e5;
-
-  Re = 4*abs(Q)/(pi*D*mu);
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid,mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-
-  mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{-20,-20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0}),
-        Rectangle(
-          extent={{-20,-18},{20,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0}),
-        Polygon(
-          points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20,
-              -18},{-20,20}},
-          lineColor={28,108,200},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,20},{-20,-20},{20,-18},{-20,20}},
-          lineColor={127,255,0},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}},
-          lineColor={192,192,192},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}}, color={28,108,
-              200})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{-20,-20}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
-        Rectangle(
-          extent={{-20,-18},{20,-100}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
-        Polygon(
-          points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20,-20},
-              {-20,20}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,20},{-20,-20},{20,-20},{-20,20}},
-          lineColor={127,255,0},
-          fillPattern=FillPattern.Solid,
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
-        Polygon(
-          points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}},
-          lineColor={0,255,0},
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
-          lineThickness=0.5,
-          fillPattern=FillPattern.Solid),
-        Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}})}),
-    Window(
-      x=0.04,
-      y=0.1,
-      width=0.84,
-      height=0.67),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end Bend;
+within ThermoSysPro.Fluid.PressureLosses;
+model Bend "Bend"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Diameter D=0.2 "Pipe diameter";
+  parameter Units.SI.Radius R0=0.2 "Pipe radius";
+  parameter ThermoSysPro.Units.nonSI.Angle_deg delta=90 "Pipe angle";
+  parameter Real rugosrel=0 "Pipe roughness";
+  parameter Boolean K_A1_Tabule=true
+    "true: A1 is computed using linear interpolation - false: A1 is computed using correlation formula";
+  parameter Boolean K_B1_Tabule=true
+    "true: B1 is computed using linear interpolation - false: B1 is computed using correlation formula";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  Real khi "Hydraulic pressure loss coefficient";
+  Real khim "Singular pressure loss coefficient";
+  Real khif "Friction pressure loss coefficient";
+  Real kdelta "Roughness factor for the singular pressure loss";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Presure loss";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.ReynoldsNumber Re "Reynolds number";
+  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
+  Real yA1 "Output of table A1";
+  Real yB1 "Output of table B1";
+  Real yC1 "Output of table C1";
+  Real lambda "Friction pressure loss coefficient";
+  Units.SI.Density rho "Fluid density";
+  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TA1(
+                    Table=[0, 0; 20, 0.31; 30, 0.45; 45, 0.60; 60, 0.78;
+        75, 0.90; 90, 1; 110, 1.13; 130, 1.20; 150, 1.28; 180, 1.40])
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TB1(
+                    Table=[0.5, 1.18; 0.6, 0.77; 0.7, 0.51; 0.8, 0.37;
+        0.9, 0.28; 1, 0.21; 1.25, 0.19; 1.50, 0.17; 2, 0.15; 4, 0.11; 6, 0.09;
+        8, 0.07; 10, 0.07; 15, 0.06; 20, 0.05; 25, 0.05; 30, 0.04; 35, 0.04; 40,
+        0.03; 45, 0.03; 50, 0.03]) annotation (Placement(transformation(extent=
+            {{20,80},{40,100}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  C1.P - C2.P = deltaP;
+
+  ftype = C1.ftype;
+
+  /* Pressure loss */
+  deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho);
+
+    /* Coude à °arois concentriques (Idel'cik p. 192). Quadratic flow regime is assumed and Re > 2e5 (Re > Relim). */
+  assert(R0/D > 0.5, "Coude: on doit avoir R0/D > 0.5");
+  assert((delta > 0) and not (delta > 180),
+    "Bend: parameter delta should be such as 0ࠦlt; delta <= 180°");
+
+  khi = kdelta*khim + khif;
+
+  khim = yA1*yB1*yC1;
+
+  TA1.u.signal = delta;
+
+  if (K_A1_Tabule) then
+    yA1 = TA1.y.signal;
+  else
+    yA1 = if (delta < 70) then 0.9*sin(delta) else if (delta > 100) then 0.7 +
+      0.35*delta/90 else 1.0;
+  end if;
+
+  TB1.u.signal = R0/D;
+
+  if (K_B1_Tabule) then
+    yB1 = TB1.y.signal;
+  else
+    yB1 = if (R0/D < 1) then 0.21/(R0/D)^2.5 else 0.21/(R0/D)^0.5;
+  end if;
+
+  yC1 = 1;
+
+  kdelta = if ((rugosrel < 0.001)) and (R0/D < 1.5) then 1.0 + 1.e3*rugosrel else
+          if (rugosrel < 0.001) then 1.0 + 1.e6*rugosrel^2 else 2.0;
+
+  khif = 0.0175*lambda*R0*delta/D;
+
+  if (rugosrel > 0.00005) then
+    lambda = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
+  else
+    lambda = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else
+            0;
+  end if;
+
+  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 2.e5;
+
+  Re = 4*abs(Q)/(pi*D*mu);
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid,mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+
+  mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{-20,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0}),
+        Rectangle(
+          extent={{-20,-18},{20,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0}),
+        Polygon(
+          points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20,
+              -18},{-20,20}},
+          lineColor={28,108,200},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,20},{-20,-20},{20,-18},{-20,20}},
+          lineColor={127,255,0},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}},
+          lineColor={192,192,192},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}}, color={28,108,
+              200})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{-20,-20}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
+        Rectangle(
+          extent={{-20,-18},{20,-100}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
+        Polygon(
+          points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20,-20},
+              {-20,20}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,20},{-20,-20},{20,-20},{-20,20}},
+          lineColor={127,255,0},
+          fillPattern=FillPattern.Solid,
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
+        Polygon(
+          points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}},
+          lineColor={0,255,0},
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
+          lineThickness=0.5,
+          fillPattern=FillPattern.Solid),
+        Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}})}),
+    Window(
+      x=0.04,
+      y=0.1,
+      width=0.84,
+      height=0.67),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end Bend;
diff --git a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo
index 503263d358f1abce6234c46758bf912153f42517..d8739dd1847c230ae56ee0f75014f53c9c480282 100644
--- a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model CheckValve "Check valve"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=10
-    "Pressure difference when the valve opens";
-  parameter ThermoSysPro.Units.SI.PressureDifference dPFerme=0
-    "Pressure difference when the valve closes";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
-    "Pressure loss coefficient";
-  parameter Units.SI.MassFlowRate Qmin=1.e-6
-    "Mass flow when the valve is closed";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  Boolean ouvert(start=true, fixed=true) "Valve state";
-  discrete Boolean touvert(start=false, fixed=true);
-  discrete Boolean tferme(start=false, fixed=true);
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  ftype = C1.ftype;
-
-  /* Pressure loss */
-  if ouvert then
-    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
-  else
-    Q - Qmin = 0;
-  end if;
-
-  touvert = (deltaP > dPOuvert);
-  tferme = (deltaP < dPFerme);
-
-  when {pre(tferme),pre(touvert)} then
-    ouvert = pre(touvert);
-  end when;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={0,0,255}),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular))}),
-    Window(
-      x=0.09,
-      y=0.05,
-      width=0.91,
-      height=0.92),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.11 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end CheckValve;
+within ThermoSysPro.Fluid.PressureLosses;
+model CheckValve "Check valve"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=10
+    "Pressure difference when the valve opens";
+  parameter ThermoSysPro.Units.SI.PressureDifference dPFerme=0
+    "Pressure difference when the valve closes";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
+    "Pressure loss coefficient";
+  parameter Units.SI.MassFlowRate Qmin=1.e-6
+    "Mass flow when the valve is closed";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  Boolean ouvert(start=true, fixed=true) "Valve state";
+  discrete Boolean touvert(start=false, fixed=true);
+  discrete Boolean tferme(start=false, fixed=true);
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  ftype = C1.ftype;
+
+  /* Pressure loss */
+  if ouvert then
+    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
+  else
+    Q - Qmin = 0;
+  end if;
+
+  touvert = (deltaP > dPOuvert);
+  tferme = (deltaP < dPFerme);
+
+  when {pre(tferme),pre(touvert)} then
+    ouvert = pre(touvert);
+  end when;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={0,0,255}),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular))}),
+    Window(
+      x=0.09,
+      y=0.05,
+      width=0.91,
+      height=0.92),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.11 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end CheckValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo
index b2fb5e3195b96ebfa92e56c07b94584262424d72..1dea3a68d28aff53ed6c168eb5b4bd11ced8cff2 100644
--- a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo
@@ -1,177 +1,177 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model ControlValve "Control valve"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
-    "Position vs. Cv characteristics (active if mode_caract=1)";
-  parameter Integer mode_caract=0
-    "0:linear characteristics - 1:characteristics is given by caract[]";
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
-  parameter Integer option_rho_water=1
-    "1: using (deltaP*Cv^2=A.Q^2/rho^2) - 2: using (deltaP*Cv^2=A.Q^2/(rho*rho_15)); with rho_15 is the density of the water at 15.5556 °C)";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  parameter Units.SI.Density rho_15=999 "density of the water at 15.5556 °C";
-
-public
-  ThermoSysPro.Units.xSI.Cv Cv(start=100) "Cv";
-  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-70},{-90,-50}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-70},{110,-50}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  ftype = C1.ftype;
-
-  /* Pressure loss */
-  if (option_rho_water == 1) then
-    deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho^2;
-  elseif (option_rho_water == 2) then
-    deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho_15);
-  else
-    assert(false, "ControlValve - option_rho_water: invalid option");
-  end if;
-
-  /* Cv as a function of the valve position */
-  if (mode_caract == 0) then
-    Cv = Ouv.signal*Cvmax;
-  elseif (mode_caract == 1) then
-    if (option_interpolation == 1) then
-      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
-    elseif (option_interpolation == 2) then
-      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
-    else
-      assert(false, "ControlValve: incorrect interpolation option");
-    end if;
-  else
-    assert(false, "ControlValve: invalid option");
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
-              {20,94},{32,84},{38,72},{40,54},{40,40}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{40,40},{-40,40},{0,-60}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
-              {20,94},{32,84},{38,72},{40,54},{40,40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{40,40},{-40,40},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.07,
-      y=0.13,
-      width=0.8,
-      height=0.77),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end ControlValve;
+within ThermoSysPro.Fluid.PressureLosses;
+model ControlValve "Control valve"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
+    "Position vs. Cv characteristics (active if mode_caract=1)";
+  parameter Integer mode_caract=0
+    "0:linear characteristics - 1:characteristics is given by caract[]";
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
+  parameter Integer option_rho_water=1
+    "1: using (deltaP*Cv^2=A.Q^2/rho^2) - 2: using (deltaP*Cv^2=A.Q^2/(rho*rho_15)); with rho_15 is the density of the water at 15.5556 °C)";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  parameter Units.SI.Density rho_15=999 "density of the water at 15.5556 °C";
+
+public
+  ThermoSysPro.Units.xSI.Cv Cv(start=100) "Cv";
+  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-70},{-90,-50}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-70},{110,-50}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  ftype = C1.ftype;
+
+  /* Pressure loss */
+  if (option_rho_water == 1) then
+    deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho^2;
+  elseif (option_rho_water == 2) then
+    deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho_15);
+  else
+    assert(false, "ControlValve - option_rho_water: invalid option");
+  end if;
+
+  /* Cv as a function of the valve position */
+  if (mode_caract == 0) then
+    Cv = Ouv.signal*Cvmax;
+  elseif (mode_caract == 1) then
+    if (option_interpolation == 1) then
+      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
+    elseif (option_interpolation == 2) then
+      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
+    else
+      assert(false, "ControlValve: incorrect interpolation option");
+    end if;
+  else
+    assert(false, "ControlValve: invalid option");
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
+              {20,94},{32,84},{38,72},{40,54},{40,40}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{40,40},{-40,40},{0,-60}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
+              {20,94},{32,84},{38,72},{40,54},{40,40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{40,40},{-40,40},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.07,
+      y=0.13,
+      width=0.8,
+      height=0.77),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end ControlValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo
index ba675b0e6fc4775123e3c357305efa12e539de7e..997b2c8ea39c8c40b31005d26dd544ee3d193467 100644
--- a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo
@@ -1,146 +1,146 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model Diaphragm "Diaphragm"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real Ouv=0.5 "Diaphragm aperture";
-  parameter Units.SI.Diameter D=0.2 "Diaphragm diameter";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  Real khi "Hydraulic pressure loss coefficient";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.ReynoldsNumber Re "Reynolds number";
-  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
-  Units.SI.Density rho "Fluid density";
-  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  C1.P - C2.P = deltaP;
-
-  ftype = C1.ftype;
-
-  /* Pressure loss */
-  deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho);
-
-    /* Diaphragme avec ouvertures à arêtes vives (Idel'cik p. 103). One assumes that Re > 1.e5 (Re > Relim) */
-  assert((Ouv > 0) and not (Ouv > 1), "Diaphragm: parameter Ouv should be such as 0 < Ouv <= 1");
-
-  khi = ((1.707 - Ouv)/Ouv)^2;
-
-  Relim = 1.e5;
-
-  Re = 4*abs(Q)/(pi*D*mu*Ouv);
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-
-  mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{-40,100},{-40,20}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(
-          points={{-40,-20},{-40,-100}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(
-          points={{40,100},{40,18}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(
-          points={{40,-20},{40,-100}},
-          color={0,203,0},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{-40,100},{-40,20}},
-          color= {0,203,0},
-          thickness=0.5),
-        Line(
-          points={{-40,-20},{-40,-100}},
-          color= {0,203,0},
-          thickness=0.5),
-        Line(
-          points={{40,100},{40,18}},
-          color= {0,203,0},
-          thickness=0.5),
-        Line(
-          points={{40,-20},{40,-100}},
-          color= {0,203,0},
-          thickness=0.5)}),
-    Window(
-      x=0.13,
-      y=0.05,
-      width=0.73,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Diaphragm;
+within ThermoSysPro.Fluid.PressureLosses;
+model Diaphragm "Diaphragm"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real Ouv=0.5 "Diaphragm aperture";
+  parameter Units.SI.Diameter D=0.2 "Diaphragm diameter";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  Real khi "Hydraulic pressure loss coefficient";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.ReynoldsNumber Re "Reynolds number";
+  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
+  Units.SI.Density rho "Fluid density";
+  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  C1.P - C2.P = deltaP;
+
+  ftype = C1.ftype;
+
+  /* Pressure loss */
+  deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho);
+
+    /* Diaphragme avec ouvertures à arêtes vives (Idel'cik p. 103). One assumes that Re > 1.e5 (Re > Relim) */
+  assert((Ouv > 0) and not (Ouv > 1), "Diaphragm: parameter Ouv should be such as 0 < Ouv <= 1");
+
+  khi = ((1.707 - Ouv)/Ouv)^2;
+
+  Relim = 1.e5;
+
+  Re = 4*abs(Q)/(pi*D*mu*Ouv);
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+
+  mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{-40,100},{-40,20}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(
+          points={{-40,-20},{-40,-100}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(
+          points={{40,100},{40,18}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(
+          points={{40,-20},{40,-100}},
+          color={0,203,0},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{-40,100},{-40,20}},
+          color= {0,203,0},
+          thickness=0.5),
+        Line(
+          points={{-40,-20},{-40,-100}},
+          color= {0,203,0},
+          thickness=0.5),
+        Line(
+          points={{40,100},{40,18}},
+          color= {0,203,0},
+          thickness=0.5),
+        Line(
+          points={{40,-20},{40,-100}},
+          color= {0,203,0},
+          thickness=0.5)}),
+    Window(
+      x=0.13,
+      y=0.05,
+      width=0.73,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Diaphragm;
diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo
index 264089a1accbba2811dc27158ce7003e122a1232..932b93544ff6f80094061cad8f874dd37301d5ad 100644
--- a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo
@@ -1,202 +1,202 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model DynamicCheckValve "Dynamic check valve"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum CV";
-  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
-    "Position vs. Cv characteristics (active if mode_caract=1)";
-  parameter Units.SI.MomentOfInertia J=1 "Flap moment of inertia";
-  parameter Real Kf1=0 "Flap friction law coefficient #1";
-  parameter Real Kf2=100 "Flap friction law coefficient #2";
-  parameter Real n=5 "Flap friction law exponent";
-  parameter Units.SI.Mass m=1 "Flap mass";
-  parameter Units.SI.Area A=1 "Flap hydraulic area";
-  parameter Integer mode_caract=0 "0:linear characteristics - 1:characteristics is given by caract[]" annotation(Evaluate=true);
-  parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1)));
-  parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0";
-  parameter Real Ouv0=0 "Initial valve position, between 0 and 1. 0:valve closed - 1: valve open (active if mech_steady_state=false)" annotation(Evaluate=true, Dialog(enable=not mech_steady_state));
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  parameter Units.SI.Radius r=sqrt(A/pi) "Flap radius";
-  parameter Units.SI.Angle theta_min=0 "Minimum flap aperture angle";
-  parameter Units.SI.Angle theta_max=pi/2 "Maximum flap aperture angle";
-  parameter Units.SI.Angle theta_m=(theta_min + theta_max)/2;
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  Boolean libre(start=true)
-    "Indicator whether the flap is free to move in both directions";
-  Units.SI.Torque Cp "Gravity torque";
-  Units.SI.Torque Cf "Friction torque";
-  Units.SI.Torque Ch "Hydraulic torque";
-  Units.SI.Torque Ct "Total torque";
-  Units.SI.Angle theta(start=theta_m) "Flap aperture angle";
-  Units.SI.AngularVelocity omega "Flap angular speed";
-  Units.SI.AngularAcceleration a "Flap angular acceleration";
-  Real Ouv "Valve position";
-  ThermoSysPro.Units.xSI.Cv Cv(start=Cvmax) "Cv";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressrue";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-initial equation
-  if mech_steady_state then
-    der(theta) = 0;
-    der(omega) = 0;
-  else
-    assert((0 <= Ouv0) and (Ouv0 <= 1), "DynamickCheckValve: Ouv0 should be between 0 and 1");
-    theta = acos(1 - Ouv0);
-    omega = 0;
-  end if;
-
-equation
-
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  ftype = C1.ftype;
-
-  /* Flap angle */
-  Ouv = 1 - cos(theta);
-
-  omega = der(theta);
-  a = der(omega);
-
-  Cp = -m*g*r*sin(theta);
-  Cf = -sign(omega)*(Kf1 + Kf2*abs(omega)^n);
-  Ch = deltaP*r*A*cos(theta);
-
-  Ct = Cp + Cf + Ch;
-
-  libre = ((theta > theta_min) and (theta < theta_max)) or ((theta <= theta_min)
-     and (Ct > 0)) or ((theta >= theta_max) and (Ct < 0));
-
-  if libre then
-    J*a = Ct;
-  else
-    a = 0;
-  end if;
-
-  when {theta <= theta_min,theta >= theta_max} then
-    reinit(omega, 0);
-  end when;
-
-  /* Pressure loss */
-  deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/
-    rho^2;
-
-  /* Cv as a function of the valve position */
-  if (mode_caract == 0) then
-    Cv = Ouv*Cvmax;
-  elseif (mode_caract == 1) then
-    if (option_interpolation == 1) then
-      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv);
-    elseif (option_interpolation == 2) then
-      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv);
-    else
-      assert(false, "DynamicCheckValve: incorrect interpolation option");
-    end if;
-  else
-    assert(false, "ClapetDyn : mode de calcul du Cv incorrect");
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={170,85,255},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={170,85,255},
-          thickness=0.5),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Text(extent={{-28,80},{32,20}}, textString=
-                                            "D")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={170,85,255},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={170,85,255},
-          thickness=0.5),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Text(extent={{-28,80},{32,20}}, textString=
-                                            "D")}),
-    Window(
-      x=0.08,
-      y=0.01,
-      width=0.81,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.12 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DynamicCheckValve;
+within ThermoSysPro.Fluid.PressureLosses;
+model DynamicCheckValve "Dynamic check valve"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum CV";
+  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
+    "Position vs. Cv characteristics (active if mode_caract=1)";
+  parameter Units.SI.MomentOfInertia J=1 "Flap moment of inertia";
+  parameter Real Kf1=0 "Flap friction law coefficient #1";
+  parameter Real Kf2=100 "Flap friction law coefficient #2";
+  parameter Real n=5 "Flap friction law exponent";
+  parameter Units.SI.Mass m=1 "Flap mass";
+  parameter Units.SI.Area A=1 "Flap hydraulic area";
+  parameter Integer mode_caract=0 "0:linear characteristics - 1:characteristics is given by caract[]" annotation(Evaluate=true);
+  parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1)));
+  parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0";
+  parameter Real Ouv0=0 "Initial valve position, between 0 and 1. 0:valve closed - 1: valve open (active if mech_steady_state=false)" annotation(Evaluate=true, Dialog(enable=not mech_steady_state));
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  parameter Units.SI.Radius r=sqrt(A/pi) "Flap radius";
+  parameter Units.SI.Angle theta_min=0 "Minimum flap aperture angle";
+  parameter Units.SI.Angle theta_max=pi/2 "Maximum flap aperture angle";
+  parameter Units.SI.Angle theta_m=(theta_min + theta_max)/2;
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  Boolean libre(start=true)
+    "Indicator whether the flap is free to move in both directions";
+  Units.SI.Torque Cp "Gravity torque";
+  Units.SI.Torque Cf "Friction torque";
+  Units.SI.Torque Ch "Hydraulic torque";
+  Units.SI.Torque Ct "Total torque";
+  Units.SI.Angle theta(start=theta_m) "Flap aperture angle";
+  Units.SI.AngularVelocity omega "Flap angular speed";
+  Units.SI.AngularAcceleration a "Flap angular acceleration";
+  Real Ouv "Valve position";
+  ThermoSysPro.Units.xSI.Cv Cv(start=Cvmax) "Cv";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressrue";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+initial equation
+  if mech_steady_state then
+    der(theta) = 0;
+    der(omega) = 0;
+  else
+    assert((0 <= Ouv0) and (Ouv0 <= 1), "DynamickCheckValve: Ouv0 should be between 0 and 1");
+    theta = acos(1 - Ouv0);
+    omega = 0;
+  end if;
+
+equation
+
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  ftype = C1.ftype;
+
+  /* Flap angle */
+  Ouv = 1 - cos(theta);
+
+  omega = der(theta);
+  a = der(omega);
+
+  Cp = -m*g*r*sin(theta);
+  Cf = -sign(omega)*(Kf1 + Kf2*abs(omega)^n);
+  Ch = deltaP*r*A*cos(theta);
+
+  Ct = Cp + Cf + Ch;
+
+  libre = ((theta > theta_min) and (theta < theta_max)) or ((theta <= theta_min)
+     and (Ct > 0)) or ((theta >= theta_max) and (Ct < 0));
+
+  if libre then
+    J*a = Ct;
+  else
+    a = 0;
+  end if;
+
+  when {theta <= theta_min,theta >= theta_max} then
+    reinit(omega, 0);
+  end when;
+
+  /* Pressure loss */
+  deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/
+    rho^2;
+
+  /* Cv as a function of the valve position */
+  if (mode_caract == 0) then
+    Cv = Ouv*Cvmax;
+  elseif (mode_caract == 1) then
+    if (option_interpolation == 1) then
+      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv);
+    elseif (option_interpolation == 2) then
+      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv);
+    else
+      assert(false, "DynamicCheckValve: incorrect interpolation option");
+    end if;
+  else
+    assert(false, "ClapetDyn : mode de calcul du Cv incorrect");
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={170,85,255},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={170,85,255},
+          thickness=0.5),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Text(extent={{-28,80},{32,20}}, textString=
+                                            "D")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={170,85,255},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={170,85,255},
+          thickness=0.5),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Text(extent={{-28,80},{32,20}}, textString=
+                                            "D")}),
+    Window(
+      x=0.08,
+      y=0.01,
+      width=0.81,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.12 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DynamicCheckValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo
index 372245c3ed1883ab67b802e656109c8e7bc5984b..45b5ca7933e62f90e7580d4da019a2e025c0a2d0 100644
--- a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo
@@ -1,237 +1,237 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model DynamicReliefValve "Dynamic relief valve"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.AbsolutePressure Popen=3e5 "Pressure that opens the valve";
-  parameter Units.SI.AbsolutePressure Pout=1e5
-    "Pressure at the valve outlet (for sizing)";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum Cv";
-  parameter Real caract[:, 2]=[0, 0; 1, Cvmax] "Position vs. Cv characteristics (active if mode_caract=1)";
-  parameter Units.SI.Area A1=0.1 "Hydraulic area upstream the clapper";
-  parameter Units.SI.Area A2=0.125 "Hydraulic area downstream the clapper";
-  parameter Units.SI.Area clapper_area[:,2]=[0,A1; 0.01,A2; 1,A2]
-    "Clapper area as a function of the clapper elevation";
-  parameter Real D=1 "Damping";
-  parameter Units.SI.Mass m=1 "Valve mass";
-  parameter Units.SI.Length z_max=0.1 "Maximum clapper elevation";
-  parameter Real Ke=62500 "Valve spring stiffness";
-  parameter Real Cd=0 "Drag coefficient of the clapper";
-  parameter Integer mode_caract=0
-    "0:linear characteristics - 1:characteristics is given by caract[] - 2:characteristics for conic clapper" annotation(Evaluate=true);
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1)));
-  parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0" annotation(Evaluate=true);
-  parameter Units.SI.Length z0=0
-    "Initial clapper elevation, between 0 and z_max. 0:valve closed - z_max: valve fully open (active if mech_steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=not mech_steady_state));
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  constant Units.SI.Density rho60F=998.98 "Water density at 60°F";
-  constant Real K=1.733e12 "Valve constant";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.Length z_min=0 "Minimum clapper elevation";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  Boolean clapper_is_free(start=true) "true if clapper is free to move in both directions, false otherwise";
-  Units.SI.Force Fp "Gravity force";
-  Units.SI.Force Fr "Spring force";
-  Units.SI.Force Fd "Damping force";
-  Units.SI.Force Fh "Hydraulic force";
-  Units.SI.Force Fdyn "Dynamic pressure force";
-  Units.SI.Force Ft "Total force";
-  Units.SI.Length z(start=z_min) "Clapper elevation";
-  Units.SI.Velocity v=der(z) "Clapper velocity";
-  Units.SI.Acceleration a=der(v) "Clapper acceleration";
-  Real Ouv "Valve position";
-  Units.SI.Area A "Hydraulic area upstream the clapper";
-  Units.SI.Force Fr_min "Spring force when valve is closed";
-  ThermoSysPro.Units.xSI.Cv Cv "Cv";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.AbsolutePressure Pdyn "Dynamic pressure on the clapper";
-  Units.SI.Velocity vh "Fluid velocity through the valve";
-  Units.SI.Energy Wdyn "Dissipated fluid kinetic energy";
-  Real Re=rho*(vh - v)*sqrt(4*A/pi)/ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T) "Clapper Reynolds";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-10,-108},{10,-88}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0),
-        iconTransformation(extent={{90,-10},{110,10}})));
-initial equation
-  if mech_steady_state then
-    der(z) = 0;
-    der(v) = 0;
-  else
-    z = z0;
-    der(z) = 0;
-  end if;
-
-  Wdyn = 0;
-
-equation
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  ftype = C1.ftype;
-
-  /* Hydraulic area upstream the clapper. It varies as a function of the valve elevation
-  between A1 (valve closed) and A2 (valve open) with a hysteresis */
-  A = ThermoSysPro.Functions.SplineInterpolation(clapper_area[:, 1], clapper_area[:, 2], z - z_min);
-
-  /* Dynamic pressure on the valve */
-  Pdyn = Cd*rho/2*(vh - v)^2;
-
-  /* Dissipated kinetic energy */
-  der(Wdyn) = Fdyn*v;
-
-  /* Fluid velocity through the valve */
-  rho*vh*A = Q;
-
-  /* Force balance */
-  Fp = -m*g;
-  Fr = -Ke*(z - z_min) + Fr_min;
-  Fd = -D*v;
-  Fh = C1.P*A - C2.P*A2;
-  Fdyn = sign(vh - v)*Pdyn*A;
-  Ft = Fp + Fr + Fd + Fh + Fdyn;
-
-  /* Newton's law */
-  clapper_is_free = ((z > z_min) and (z < z_max)) or ((z <= z_min) and (Ft > 0)) or ((z >= z_max) and (Ft < 0));
-
-  if clapper_is_free then
-    m*a = Ft;
-  else
-    a = 0;
-  end if;
-
-  when {z <= z_min,z >= z_max} then
-    reinit(v, 0);
-  end when;
-
-  /* Pressure that opens the valve */
-  m*g - Fr_min = Popen*A1 - Pout*A2;
-
-  /* Valve position */
-  Ouv = (z - z_min)/(z_max - z_min);
-
-  /* Pressure loss */
-  deltaP*Cv*abs(Cv) = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho60F);
-
-  /* Cv as a function of the valve position */
-  if (mode_caract == 0) then
-    Cv = Ouv*Cvmax;
-  elseif (mode_caract == 1) then
-    if (option_interpolation == 1) then
-      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv);
-    elseif (option_interpolation == 2) then
-      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv);
-    else
-      assert(false, "DynamicReliefValve: incorrect interpolation option");
-    end if;
-  elseif (mode_caract == 2) then
-    Cv = sqrt(pi*A1*K/(0.3*rho60F))*(z - z_min)/sqrt(1 + pi/A1*(z - z_min)^2);
-  else
-    assert(false, "DynamicReliefValve : incorrect Cv computation mode");
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,0},{-30,-60},{30,-60},{0,0}},
-          lineColor={28,108,200},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,0},{60,-30},{60,30},{0,0}},
-          lineColor={28,108,200},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-60},{0,-98}}),
-        Line(points={{60,0},{90,0}}),
-        Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{
-              10,70}}, color={170,85,255})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,0},{-30,-60},{30,-60},{0,0}},
-          lineColor={28,108,200},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,0},{60,-30},{60,30},{0,0}},
-          lineColor={28,108,200},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-60},{0,-98}}),
-        Line(points={{60,0},{90,0}}),
-        Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{
-              10,70}})}),
-    Window(
-      x=0.12,
-      y=0.05,
-      width=0.8,
-      height=0.77),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.13 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DynamicReliefValve;
+within ThermoSysPro.Fluid.PressureLosses;
+model DynamicReliefValve "Dynamic relief valve"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.AbsolutePressure Popen=3e5 "Pressure that opens the valve";
+  parameter Units.SI.AbsolutePressure Pout=1e5
+    "Pressure at the valve outlet (for sizing)";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum Cv";
+  parameter Real caract[:, 2]=[0, 0; 1, Cvmax] "Position vs. Cv characteristics (active if mode_caract=1)";
+  parameter Units.SI.Area A1=0.1 "Hydraulic area upstream the clapper";
+  parameter Units.SI.Area A2=0.125 "Hydraulic area downstream the clapper";
+  parameter Units.SI.Area clapper_area[:,2]=[0,A1; 0.01,A2; 1,A2]
+    "Clapper area as a function of the clapper elevation";
+  parameter Real D=1 "Damping";
+  parameter Units.SI.Mass m=1 "Valve mass";
+  parameter Units.SI.Length z_max=0.1 "Maximum clapper elevation";
+  parameter Real Ke=62500 "Valve spring stiffness";
+  parameter Real Cd=0 "Drag coefficient of the clapper";
+  parameter Integer mode_caract=0
+    "0:linear characteristics - 1:characteristics is given by caract[] - 2:characteristics for conic clapper" annotation(Evaluate=true);
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1)));
+  parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0" annotation(Evaluate=true);
+  parameter Units.SI.Length z0=0
+    "Initial clapper elevation, between 0 and z_max. 0:valve closed - z_max: valve fully open (active if mech_steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=not mech_steady_state));
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  constant Units.SI.Density rho60F=998.98 "Water density at 60°F";
+  constant Real K=1.733e12 "Valve constant";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.Length z_min=0 "Minimum clapper elevation";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  Boolean clapper_is_free(start=true) "true if clapper is free to move in both directions, false otherwise";
+  Units.SI.Force Fp "Gravity force";
+  Units.SI.Force Fr "Spring force";
+  Units.SI.Force Fd "Damping force";
+  Units.SI.Force Fh "Hydraulic force";
+  Units.SI.Force Fdyn "Dynamic pressure force";
+  Units.SI.Force Ft "Total force";
+  Units.SI.Length z(start=z_min) "Clapper elevation";
+  Units.SI.Velocity v=der(z) "Clapper velocity";
+  Units.SI.Acceleration a=der(v) "Clapper acceleration";
+  Real Ouv "Valve position";
+  Units.SI.Area A "Hydraulic area upstream the clapper";
+  Units.SI.Force Fr_min "Spring force when valve is closed";
+  ThermoSysPro.Units.xSI.Cv Cv "Cv";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.AbsolutePressure Pdyn "Dynamic pressure on the clapper";
+  Units.SI.Velocity vh "Fluid velocity through the valve";
+  Units.SI.Energy Wdyn "Dissipated fluid kinetic energy";
+  Real Re=rho*(vh - v)*sqrt(4*A/pi)/ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T) "Clapper Reynolds";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-10,-108},{10,-88}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0),
+        iconTransformation(extent={{90,-10},{110,10}})));
+initial equation
+  if mech_steady_state then
+    der(z) = 0;
+    der(v) = 0;
+  else
+    z = z0;
+    der(z) = 0;
+  end if;
+
+  Wdyn = 0;
+
+equation
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  ftype = C1.ftype;
+
+  /* Hydraulic area upstream the clapper. It varies as a function of the valve elevation
+  between A1 (valve closed) and A2 (valve open) with a hysteresis */
+  A = ThermoSysPro.Functions.SplineInterpolation(clapper_area[:, 1], clapper_area[:, 2], z - z_min);
+
+  /* Dynamic pressure on the valve */
+  Pdyn = Cd*rho/2*(vh - v)^2;
+
+  /* Dissipated kinetic energy */
+  der(Wdyn) = Fdyn*v;
+
+  /* Fluid velocity through the valve */
+  rho*vh*A = Q;
+
+  /* Force balance */
+  Fp = -m*g;
+  Fr = -Ke*(z - z_min) + Fr_min;
+  Fd = -D*v;
+  Fh = C1.P*A - C2.P*A2;
+  Fdyn = sign(vh - v)*Pdyn*A;
+  Ft = Fp + Fr + Fd + Fh + Fdyn;
+
+  /* Newton's law */
+  clapper_is_free = ((z > z_min) and (z < z_max)) or ((z <= z_min) and (Ft > 0)) or ((z >= z_max) and (Ft < 0));
+
+  if clapper_is_free then
+    m*a = Ft;
+  else
+    a = 0;
+  end if;
+
+  when {z <= z_min,z >= z_max} then
+    reinit(v, 0);
+  end when;
+
+  /* Pressure that opens the valve */
+  m*g - Fr_min = Popen*A1 - Pout*A2;
+
+  /* Valve position */
+  Ouv = (z - z_min)/(z_max - z_min);
+
+  /* Pressure loss */
+  deltaP*Cv*abs(Cv) = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho60F);
+
+  /* Cv as a function of the valve position */
+  if (mode_caract == 0) then
+    Cv = Ouv*Cvmax;
+  elseif (mode_caract == 1) then
+    if (option_interpolation == 1) then
+      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv);
+    elseif (option_interpolation == 2) then
+      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv);
+    else
+      assert(false, "DynamicReliefValve: incorrect interpolation option");
+    end if;
+  elseif (mode_caract == 2) then
+    Cv = sqrt(pi*A1*K/(0.3*rho60F))*(z - z_min)/sqrt(1 + pi/A1*(z - z_min)^2);
+  else
+    assert(false, "DynamicReliefValve : incorrect Cv computation mode");
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,0},{-30,-60},{30,-60},{0,0}},
+          lineColor={28,108,200},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,0},{60,-30},{60,30},{0,0}},
+          lineColor={28,108,200},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-60},{0,-98}}),
+        Line(points={{60,0},{90,0}}),
+        Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{
+              10,70}}, color={170,85,255})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,0},{-30,-60},{30,-60},{0,0}},
+          lineColor={28,108,200},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,0},{60,-30},{60,30},{0,0}},
+          lineColor={28,108,200},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-60},{0,-98}}),
+        Line(points={{60,0},{90,0}}),
+        Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{
+              10,70}})}),
+    Window(
+      x=0.12,
+      y=0.05,
+      width=0.8,
+      height=0.77),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.13 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DynamicReliefValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo
index f3acffcb4b63151f37e15cd563e1835a764d1ad3..a944985ac64f0fe95d2429bdacbb54acb80f2eef 100644
--- a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo
@@ -1,116 +1,116 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model IdealCheckValve "Ideal check valve"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=0.01
-    "Pressure difference when the valve opens";
-  parameter Units.SI.MassFlowRate Qmin=1.e-6
-    "Mass flow trhough the valve when the valve is closed";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-
-public
-  Boolean ouvert(start=true, fixed=true) "Valve state";
-  discrete Boolean touvert(start=false, fixed=true);
-  discrete Boolean tferme(start=false, fixed=true);
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Pressure difference between the inlet and the outlet";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  /* Pressure loss */
-  if ouvert then
-    deltaP = 0;
-  else
-   Q - Qmin = 0;
-  end if;
-
-  touvert = (deltaP > dPOuvert);
-  tferme = (not (Q > 0));
-
-  when {pre(tferme),pre(touvert)} then
-    ouvert = pre(touvert);
-  end when;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={0,0,255}),
-        Line(points={{-90,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Text(extent={{-96,-56},{96,-112}}, textString=
-                                               "DP=0"),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Text(extent={{-96,-56},{96,-112}}, textString=
-                                               "DP=0"),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5)}),
-    Window(
-      x=0.08,
-      y=0.02,
-      width=0.84,
-      height=0.9),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end IdealCheckValve;
+within ThermoSysPro.Fluid.PressureLosses;
+model IdealCheckValve "Ideal check valve"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=0.01
+    "Pressure difference when the valve opens";
+  parameter Units.SI.MassFlowRate Qmin=1.e-6
+    "Mass flow trhough the valve when the valve is closed";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+
+public
+  Boolean ouvert(start=true, fixed=true) "Valve state";
+  discrete Boolean touvert(start=false, fixed=true);
+  discrete Boolean tferme(start=false, fixed=true);
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Pressure difference between the inlet and the outlet";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  /* Pressure loss */
+  if ouvert then
+    deltaP = 0;
+  else
+   Q - Qmin = 0;
+  end if;
+
+  touvert = (deltaP > dPOuvert);
+  tferme = (not (Q > 0));
+
+  when {pre(tferme),pre(touvert)} then
+    ouvert = pre(touvert);
+  end when;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={0,0,255}),
+        Line(points={{-90,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Text(extent={{-96,-56},{96,-112}}, textString=
+                                               "DP=0"),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Text(extent={{-96,-56},{96,-112}}, textString=
+                                               "DP=0"),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5)}),
+    Window(
+      x=0.08,
+      y=0.02,
+      width=0.84,
+      height=0.9),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end IdealCheckValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo
index 44fd220ef8b93248fb0859ee2441ddddb8fc5890..77577d8324b181d36aa98a13a8ecc51acc3661f8 100644
--- a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo
@@ -1,116 +1,116 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model IdealSwitchValve "Ideal switch valve"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.MassFlowRate Qmin=1.e-6
-    "Mass flow when the valve is closed";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-
-public
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Pressure difference between the inlet and the outlet";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
-    annotation (Placement(transformation(
-        origin={0,70},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
-          extent={{-110,-70},{-90,-50}}, rotation=0), iconTransformation(extent=
-           {{-110,-70},{-90,-50}})));
-  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
-          extent={{90,-70},{110,-50}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  if Ouv.signal then
-    deltaP = 0;
-  else
-    Q - Qmin = 0;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,60},{40,60}},
-          color={28,108,200},
-          thickness=1),
-        Line(points={{0,60},{0,-60}}),
-        Text(extent={{-104,34},{88,-22}}, textString=
-                                              "DP=0")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,60},{40,60}},
-          color={28,108,200},
-          thickness=1),
-        Line(points={{0,60},{0,-60}}),
-        Text(extent={{-104,34},{88,-22}}, textString=
-                                              "DP=0")}),
-    Window(
-      x=0.22,
-      y=0.12,
-      width=0.72,
-      height=0.74),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end IdealSwitchValve;
+within ThermoSysPro.Fluid.PressureLosses;
+model IdealSwitchValve "Ideal switch valve"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.MassFlowRate Qmin=1.e-6
+    "Mass flow when the valve is closed";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+
+public
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Pressure difference between the inlet and the outlet";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
+    annotation (Placement(transformation(
+        origin={0,70},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
+          extent={{-110,-70},{-90,-50}}, rotation=0), iconTransformation(extent=
+           {{-110,-70},{-90,-50}})));
+  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
+          extent={{90,-70},{110,-50}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  if Ouv.signal then
+    deltaP = 0;
+  else
+    Q - Qmin = 0;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,60},{40,60}},
+          color={28,108,200},
+          thickness=1),
+        Line(points={{0,60},{0,-60}}),
+        Text(extent={{-104,34},{88,-22}}, textString=
+                                              "DP=0")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,60},{40,60}},
+          color={28,108,200},
+          thickness=1),
+        Line(points={{0,60},{0,-60}}),
+        Text(extent={{-104,34},{88,-22}}, textString=
+                                              "DP=0")}),
+    Window(
+      x=0.22,
+      y=0.12,
+      width=0.72,
+      height=0.74),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end IdealSwitchValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo
index 4c4107d8e5b2febdad00bfe0f64634225f82c0ba..717a491d3a4e2f580e707cbd4e06db2799aae605 100644
--- a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model InvSingularPressureLoss "Inverse singular pressure loss"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3 "Small mass flow rate";
-
-public
-  Real K(start=1.e3) "Pressure loss coefficient";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C2.Q = C1.Q;
-  C2.h = C1.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  ftype = C1.ftype;
-
-  /* Pressure loss */
-  deltaP = if noEvent(abs(Q) < Qeps) then 1.e-10 else K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,0}),
-        Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({255,255,0}, fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({255,255,0}, fill_color_static),
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end InvSingularPressureLoss;
+within ThermoSysPro.Fluid.PressureLosses;
+model InvSingularPressureLoss "Inverse singular pressure loss"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3 "Small mass flow rate";
+
+public
+  Real K(start=1.e3) "Pressure loss coefficient";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C2.Q = C1.Q;
+  C2.h = C1.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  ftype = C1.ftype;
+
+  /* Pressure loss */
+  deltaP = if noEvent(abs(Q) < Qeps) then 1.e-10 else K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,0}),
+        Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({255,255,0}, fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({255,255,0}, fill_color_static),
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end InvSingularPressureLoss;
diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo
index b69559ca946d5ae8065dfe206408b0f0411894e8..e02c36e2d56d22e848e64acc9b38db23c9dd55a7 100644
--- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo
@@ -1,168 +1,168 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model LumpedStraightPipe "Lumped straight pipe (circular duct)"
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.2 "Pipe internal hydraulic diameter";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Real lambda=0.03
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-  parameter Real rugosrel=0.0001
-    "Pipe roughness (active if lambda_fixed=false)";
-  parameter Units.SI.Position z1=0 "Inlet altitude";
-  parameter Units.SI.Position z2=0 "Outlet altitude";
-  parameter Boolean lambda_fixed=true
-    "true: lambda given by parameter - false: lambde computed using Idel'Cik correlation";
-  parameter Boolean inertia=false
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Pipe cross-sectional area (circular duct is assumed)";
-  parameter Units.SI.Area Pw=pi*D*ntubes
-    "Pipe wetted perimeter (circular duct is assumed)";
-
-public
-  Real khi "Hydraulic pressure loss coefficient";
-  ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss";
-  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
-  Units.SI.ReynoldsNumber Re "Reynolds number";
-  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
-  Real lam "Friction pressure loss coefficient";
-  Units.SI.Density rho "Fluid density";
-  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Units.SI.SpecificHeatCapacity cp(start=4200) "Fluid specific heat capacity";
-  Units.SI.ThermalConductivity k(start=0.05) "Fluid thermal conductivity";
-  Units.SI.MassFlowRate gamma_diff(start=1.e-4) "Diffusion conductance";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-initial equation
-  if inertia then
-    der(Q) = 0;
-  end if;
-
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1 + 1/gamma_diff;
-  C1.diff_res_2 = C2.diff_res_2 + 1/gamma_diff;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  ftype = C1.ftype;
-
-  /* Diffusion resistance */
-  gamma_diff = A*k/cp/L;
-
-  /* Pressure loss */
-  if inertia then
-    deltaP = deltaPf + rho*g*(z2 - z1) + L/A*der(Q);
-  else
-    deltaP = deltaPf + rho*g*(z2 - z1);
-  end if;
-
-  deltaPf = khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(2*A^2*rho);
-
-  /* Darcy-Weisbach formula (Idel'cik p. 55). Quadratic flow regime is assumed and Re > 4000 (Re > Relim). */
-  khi = lam*L/D;
-
-  if lambda_fixed then
-    lam = lambda;
-  else
-    if (rugosrel > 0.00005) then
-      lam = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
-    else
-      lam = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else 0;
-    end if;
-  end if;
-
-  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 4000;
-  Re = 4*abs(Q)/(Pw*mu);
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  k =  ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o,C1.Xo2, C1.Xso2);
-  cp = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={28,108,200},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0},
-          if inertia then fill_color_dynamic
-          else fill_color_singular))}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end LumpedStraightPipe;
+within ThermoSysPro.Fluid.PressureLosses;
+model LumpedStraightPipe "Lumped straight pipe (circular duct)"
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.2 "Pipe internal hydraulic diameter";
+  parameter Real ntubes=1 "Number of pipes in parallel";
+  parameter Real lambda=0.03
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  parameter Real rugosrel=0.0001
+    "Pipe roughness (active if lambda_fixed=false)";
+  parameter Units.SI.Position z1=0 "Inlet altitude";
+  parameter Units.SI.Position z2=0 "Outlet altitude";
+  parameter Boolean lambda_fixed=true
+    "true: lambda given by parameter - false: lambde computed using Idel'Cik correlation";
+  parameter Boolean inertia=false
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Pipe cross-sectional area (circular duct is assumed)";
+  parameter Units.SI.Area Pw=pi*D*ntubes
+    "Pipe wetted perimeter (circular duct is assumed)";
+
+public
+  Real khi "Hydraulic pressure loss coefficient";
+  ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss";
+  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
+  Units.SI.ReynoldsNumber Re "Reynolds number";
+  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
+  Real lam "Friction pressure loss coefficient";
+  Units.SI.Density rho "Fluid density";
+  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Units.SI.SpecificHeatCapacity cp(start=4200) "Fluid specific heat capacity";
+  Units.SI.ThermalConductivity k(start=0.05) "Fluid thermal conductivity";
+  Units.SI.MassFlowRate gamma_diff(start=1.e-4) "Diffusion conductance";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+initial equation
+  if inertia then
+    der(Q) = 0;
+  end if;
+
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1 + 1/gamma_diff;
+  C1.diff_res_2 = C2.diff_res_2 + 1/gamma_diff;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  ftype = C1.ftype;
+
+  /* Diffusion resistance */
+  gamma_diff = A*k/cp/L;
+
+  /* Pressure loss */
+  if inertia then
+    deltaP = deltaPf + rho*g*(z2 - z1) + L/A*der(Q);
+  else
+    deltaP = deltaPf + rho*g*(z2 - z1);
+  end if;
+
+  deltaPf = khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(2*A^2*rho);
+
+  /* Darcy-Weisbach formula (Idel'cik p. 55). Quadratic flow regime is assumed and Re > 4000 (Re > Relim). */
+  khi = lam*L/D;
+
+  if lambda_fixed then
+    lam = lambda;
+  else
+    if (rugosrel > 0.00005) then
+      lam = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
+    else
+      lam = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else 0;
+    end if;
+  end if;
+
+  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 4000;
+  Re = 4*abs(Q)/(Pw*mu);
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  k =  ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o,C1.Xo2, C1.Xso2);
+  cp = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={28,108,200},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0},
+          if inertia then fill_color_dynamic
+          else fill_color_singular))}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end LumpedStraightPipe;
diff --git a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo
index f90ae935aa26297b25bdb25db5621b8be10838ef..7234a2d823358179b2668c128658b7d11e7c10ae 100644
--- a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model PipePressureLoss "Pipe generic pressure loss"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real K=10 "Friction pressure loss coefficient";
-  parameter Units.SI.Position z1=0 "Inlet altitude";
-  parameter Units.SI.Position z2=0 "Outlet altitude";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss";
-  ThermoSysPro.Units.SI.PressureDifference deltaPg "Gravity pressure loss";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss";
-  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-
-equation
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  ftype = C1.ftype;
-
-  /* Pressure loss */
-  deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-  deltaPg = rho*g*(z2 - z1);
-  deltaP = deltaPf + deltaPg;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,255,85}), Text(
-          extent={{-12,14},{16,-14}},
-          lineColor={0,0,255},
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "K")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-           Text(
-          extent={{-14,10},{14,-8}},
-          lineColor={0,0,255},
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "K")}),
-    Window(
-      x=0.11,
-      y=0.04,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end PipePressureLoss;
+within ThermoSysPro.Fluid.PressureLosses;
+model PipePressureLoss "Pipe generic pressure loss"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real K=10 "Friction pressure loss coefficient";
+  parameter Units.SI.Position z1=0 "Inlet altitude";
+  parameter Units.SI.Position z2=0 "Outlet altitude";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss";
+  ThermoSysPro.Units.SI.PressureDifference deltaPg "Gravity pressure loss";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss";
+  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+
+equation
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  ftype = C1.ftype;
+
+  /* Pressure loss */
+  deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
+  deltaPg = rho*g*(z2 - z1);
+  deltaP = deltaPf + deltaPg;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,255,85}), Text(
+          extent={{-12,14},{16,-14}},
+          lineColor={0,0,255},
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "K")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+           Text(
+          extent={{-14,10},{14,-8}},
+          lineColor={0,0,255},
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "K")}),
+    Window(
+      x=0.11,
+      y=0.04,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end PipePressureLoss;
diff --git a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo
index d44ac9ea702e5ac34c2e81cbec23c6815e189258..cc338b3faa6628f5a24e3a955796b1382c84afe0 100644
--- a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model SingularPressureLoss "Singular pressure loss"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Real K=1.e-4 "Pressure loss coefficient";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  ftype = C1.ftype;
-
-  /* Pressure loss */
-  deltaP = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SingularPressureLoss;
+within ThermoSysPro.Fluid.PressureLosses;
+model SingularPressureLoss "Singular pressure loss"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Real K=1.e-4 "Pressure loss coefficient";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  ftype = C1.ftype;
+
+  /* Pressure loss */
+  deltaP = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SingularPressureLoss;
diff --git a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo
index 6f1e6e9b37caa8c70a96d7c3ee4d1b27ff80e7fd..b4d208e8af72099f04c790625ee59550728542b3 100644
--- a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo
@@ -1,141 +1,141 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model SwitchValve "Switch valve"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
-    "Pressure loss coefficient";
-  parameter Units.SI.MassFlowRate Qmin=1.e-6
-    "Mass flow when the valve is closed";
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
-    annotation (Placement(transformation(
-        origin={0,72},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
-          extent={{-110,-70},{-90,-50}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
-          extent={{90,-70},{110,-50}}, rotation=0), iconTransformation(extent={
-            {90,-70},{110,-50}})));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
-  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
-
-  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-  h = C1.h;
-  deltaP = C1.P - C2.P;
-
-  ftype = C1.ftype;
-
-  /* Pressure loss */
-  if Ouv.signal then
-    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
-  else
-    Q - Qmin = 0;
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-  end if;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,60},{40,60}},
-          color={28,108,200},
-          thickness=1),
-        Line(points={{0,60},{0,-60}})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
-          lineColor={28,108,200},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
-          lineColor={28,108,200},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,60},{40,60}},
-          color={28,108,200},
-          thickness=1),
-        Line(points={{0,60},{0,-60}})}),
-    Window(
-      x=0.1,
-      y=0.04,
-      width=0.79,
-      height=0.84),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.10 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SwitchValve;
+within ThermoSysPro.Fluid.PressureLosses;
+model SwitchValve "Switch valve"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
+    "Pressure loss coefficient";
+  parameter Units.SI.MassFlowRate Qmin=1.e-6
+    "Mass flow when the valve is closed";
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
+    annotation (Placement(transformation(
+        origin={0,72},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation(
+          extent={{-110,-70},{-90,-50}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation(
+          extent={{90,-70},{110,-50}}, rotation=0), iconTransformation(extent={
+            {90,-70},{110,-50}})));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false;
+  C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false;
+
+  C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+  C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0);
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+  h = C1.h;
+  deltaP = C1.P - C2.P;
+
+  ftype = C1.ftype;
+
+  /* Pressure loss */
+  if Ouv.signal then
+    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
+  else
+    Q - Qmin = 0;
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+  end if;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular),
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,60},{40,60}},
+          color={28,108,200},
+          thickness=1),
+        Line(points={{0,60},{0,-60}})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
+          lineColor={28,108,200},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
+          lineColor={28,108,200},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,60},{40,60}},
+          color={28,108,200},
+          thickness=1),
+        Line(points={{0,60},{0,-60}})}),
+    Window(
+      x=0.1,
+      y=0.04,
+      width=0.79,
+      height=0.84),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.10 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SwitchValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo
index 0f1c304c528e38cc4d3c41470912ab4a88b5ca4b..00025a94cd75afd4a939565cbf8b6a001553b90a 100644
--- a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo
@@ -1,209 +1,209 @@
-within ThermoSysPro.Fluid.PressureLosses;
-model ThreeWayValve "Three way valve"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax1=8005.42 "Valve 1 max CV";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax2=8005.42 "Valve 2 max CV";
-  parameter Real caract1[:, 2]=[0, 0; 1, Cvmax1]
-    "Valve 1 - Position vs. Cv characteristics (active if mode_caract1=true)";
-  parameter Real caract2[:, 2]=[0, 0; 1, Cvmax2]
-    "Valve 2 - Position vs. Cv characteristics (active if mode_caract2=true)";
-  parameter Integer mode_caract1=0
-    "Valve 1 - 0:linear characteristics - 1:characteristics is given by caract1[]";
-  parameter Integer mode_caract2=0
-    "Valve 2 - 0:linear characteristics - 1:characteristics is given by caract2[]";
-  parameter Units.SI.Volume V=1
-    "Three way valve volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.MassFlowRate gamma_diff=1e-4
-    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
-  parameter Boolean dynamic_energy_balance=false
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=true
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Interfaces.Connectors.FluidInlet C1 annotation (layer="icon", Placement(
-        transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet C2 annotation (layer="icon", Placement(
-        transformation(extent={{90,-50},{110,-30}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve Valve1(
-    Cvmax=Cvmax1,
-    caract=caract1,
-    mode_caract=mode_caract1,
-    p_rho=p_rho,
-    region=region,
-    gamma_diff=gamma_diff)
-               annotation (Placement(transformation(
-        origin={-6,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  Interfaces.Connectors.FluidOutlet C3 annotation (Placement(transformation(
-          extent={{-10,-110},{10,-90}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.ControlValve Valve2(
-    Cvmax=Cvmax2,
-    caract=caract2,
-    mode_caract=mode_caract2,
-    p_rho=p_rho,
-    region=region,
-    gamma_diff=gamma_diff)
-               annotation (Placement(transformation(extent={{40,-4},{60,16}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1
-                                         annotation (Placement(transformation(
-          extent={{-80,60},{-60,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add Add1(k2=-1) annotation (Placement(transformation(
-          extent={{-40,40},{-20,60}}, rotation=0)));
-  Volumes.VolumeA VolumeA1(
-    V=V,
-    p_rho=p_rho,
-    dynamic_energy_balance=dynamic_energy_balance,
-    diffusion=diffusion,
-    continuous_flow_reversal=continuous_flow_reversal,
-    ftype=ftype,
-    region=region,
-    dynamic_composition_balance=dynamic_composition_balance,
-    Xco20=Xco20,
-    Xh2o0=Xh2o0,
-    Xo20=Xo20,
-    Xso20=Xso20)            annotation (Placement(transformation(extent={{-10,
-            -10},{10,10}}, rotation=0)));
-  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1(K=0, region=region, gamma_diff=gamma_diff)
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-equation
-  connect(Ouv, Valve2.Ouv)
-    annotation (Line(points={{0,110},{0,60},{50,60},{50,17}}));
-  connect(Constante1.y, Add1.u1)
-    annotation (Line(points={{-59,70},{-50,70},{-50,56},{-41,56}}, color={0,0,
-          255}));
-  connect(Ouv, Add1.u2)
-    annotation (Line(points={{0,110},{0,90},{-90,90},{-90,44},{-41,44}}));
-  connect(Add1.y, Valve1.Ouv)
-    annotation (Line(points={{-19,50},{-10,50},{-10,26},{-28,26},{-28,-50},{-17,
-          -50}},                                                  color={0,0,
-          255}));
-  connect(VolumeA1.Cs1, Valve2.C1)
-    annotation (Line(points={{10,0},{40,0}}, color={0,0,255}));
-  connect(VolumeA1.Cs2, Valve1.C1)
-    annotation (Line(points={{0,-10},{0,-40},{8.88178e-016,-40}}, color={0,0,
-          255}));
-  connect(Valve1.C2, C3)
-    annotation (Line(points={{-8.88178e-016,-60},{-8.88178e-016,-78},{0,-78},{0,
-          -100}}, color={0,0,255}));
-  connect(PerteDP1.C2, VolumeA1.Ce1)
-    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,255}));
-  connect(Valve2.C2, C2)
-    annotation (Line(points={{60,0},{80,0},{80,-40},{100,-40}}, color={0,0,255}));
-  connect(PerteDP1.C1, C1)
-    annotation (Line(points={{-60,0},{-80,0},{-80,-40},{-100,-40}}, color={0,0,
-          255}));
-  annotation(structurallyIncomplete, Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 13.9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}),
-            graphics={Text(extent={{12,-40},{46,-62}},   textString=
-                                                   "Valve 1"), Text(extent={{36,
-              -6},{70,-28}}, textString =       "Valve 2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}),
-         graphics={
-        Polygon(
-          points={{-100,0},{-100,-80},{100,0},{100,-80},{-100,0}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({127,255,0},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,-100},{0,-40},{20,-100},{-20,-100}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({127,255,0},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
-              {20,94},{32,84},{38,72},{40,54},{40,40}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({127,255,0},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-40},{40,40},{-40,40},{0,-40}},
-          lineColor={0,0,255},
-          fillColor= DynamicSelect({127,255,0},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.11,
-      width=0.7,
-      height=0.66),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2003</b></p>
-</HTML>
-<html>
-<p><b>Version 1.4</b></p>
-</HTML>
-"), Diagram(Text(extent=[34, -4; 68, -26], string="Valve 2")));
-end ThreeWayValve;
+within ThermoSysPro.Fluid.PressureLosses;
+model ThreeWayValve "Three way valve"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax1=8005.42 "Valve 1 max CV";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax2=8005.42 "Valve 2 max CV";
+  parameter Real caract1[:, 2]=[0, 0; 1, Cvmax1]
+    "Valve 1 - Position vs. Cv characteristics (active if mode_caract1=true)";
+  parameter Real caract2[:, 2]=[0, 0; 1, Cvmax2]
+    "Valve 2 - Position vs. Cv characteristics (active if mode_caract2=true)";
+  parameter Integer mode_caract1=0
+    "Valve 1 - 0:linear characteristics - 1:characteristics is given by caract1[]";
+  parameter Integer mode_caract2=0
+    "Valve 2 - 0:linear characteristics - 1:characteristics is given by caract2[]";
+  parameter Units.SI.Volume V=1
+    "Three way valve volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.MassFlowRate gamma_diff=1e-4
+    "Diffusion conductance (active if diffusion=true in neighbouring volumes)";
+  parameter Boolean dynamic_energy_balance=false
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=true
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Interfaces.Connectors.FluidInlet C1 annotation (layer="icon", Placement(
+        transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet C2 annotation (layer="icon", Placement(
+        transformation(extent={{90,-50},{110,-30}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve Valve1(
+    Cvmax=Cvmax1,
+    caract=caract1,
+    mode_caract=mode_caract1,
+    p_rho=p_rho,
+    region=region,
+    gamma_diff=gamma_diff)
+               annotation (Placement(transformation(
+        origin={-6,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  Interfaces.Connectors.FluidOutlet C3 annotation (Placement(transformation(
+          extent={{-10,-110},{10,-90}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.ControlValve Valve2(
+    Cvmax=Cvmax2,
+    caract=caract2,
+    mode_caract=mode_caract2,
+    p_rho=p_rho,
+    region=region,
+    gamma_diff=gamma_diff)
+               annotation (Placement(transformation(extent={{40,-4},{60,16}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1
+                                         annotation (Placement(transformation(
+          extent={{-80,60},{-60,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add Add1(k2=-1) annotation (Placement(transformation(
+          extent={{-40,40},{-20,60}}, rotation=0)));
+  Volumes.VolumeA VolumeA1(
+    V=V,
+    p_rho=p_rho,
+    dynamic_energy_balance=dynamic_energy_balance,
+    diffusion=diffusion,
+    continuous_flow_reversal=continuous_flow_reversal,
+    ftype=ftype,
+    region=region,
+    dynamic_composition_balance=dynamic_composition_balance,
+    Xco20=Xco20,
+    Xh2o0=Xh2o0,
+    Xo20=Xo20,
+    Xso20=Xso20)            annotation (Placement(transformation(extent={{-10,
+            -10},{10,10}}, rotation=0)));
+  ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1(K=0, region=region, gamma_diff=gamma_diff)
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+equation
+  connect(Ouv, Valve2.Ouv)
+    annotation (Line(points={{0,110},{0,60},{50,60},{50,17}}));
+  connect(Constante1.y, Add1.u1)
+    annotation (Line(points={{-59,70},{-50,70},{-50,56},{-41,56}}, color={0,0,
+          255}));
+  connect(Ouv, Add1.u2)
+    annotation (Line(points={{0,110},{0,90},{-90,90},{-90,44},{-41,44}}));
+  connect(Add1.y, Valve1.Ouv)
+    annotation (Line(points={{-19,50},{-10,50},{-10,26},{-28,26},{-28,-50},{-17,
+          -50}},                                                  color={0,0,
+          255}));
+  connect(VolumeA1.Cs1, Valve2.C1)
+    annotation (Line(points={{10,0},{40,0}}, color={0,0,255}));
+  connect(VolumeA1.Cs2, Valve1.C1)
+    annotation (Line(points={{0,-10},{0,-40},{8.88178e-016,-40}}, color={0,0,
+          255}));
+  connect(Valve1.C2, C3)
+    annotation (Line(points={{-8.88178e-016,-60},{-8.88178e-016,-78},{0,-78},{0,
+          -100}}, color={0,0,255}));
+  connect(PerteDP1.C2, VolumeA1.Ce1)
+    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,255}));
+  connect(Valve2.C2, C2)
+    annotation (Line(points={{60,0},{80,0},{80,-40},{100,-40}}, color={0,0,255}));
+  connect(PerteDP1.C1, C1)
+    annotation (Line(points={{-60,0},{-80,0},{-80,-40},{-100,-40}}, color={0,0,
+          255}));
+  annotation(structurallyIncomplete, Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 13.9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}),
+            graphics={Text(extent={{12,-40},{46,-62}},   textString=
+                                                   "Valve 1"), Text(extent={{36,
+              -6},{70,-28}}, textString =       "Valve 2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}),
+         graphics={
+        Polygon(
+          points={{-100,0},{-100,-80},{100,0},{100,-80},{-100,0}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({127,255,0},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,-100},{0,-40},{20,-100},{-20,-100}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({127,255,0},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
+              {20,94},{32,84},{38,72},{40,54},{40,40}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({127,255,0},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-40},{40,40},{-40,40},{0,-40}},
+          lineColor={0,0,255},
+          fillColor= DynamicSelect({127,255,0},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.11,
+      width=0.7,
+      height=0.66),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2003</b></p>
+</HTML>
+<html>
+<p><b>Version 1.4</b></p>
+</HTML>
+"), Diagram(Text(extent=[34, -4; 68, -26], string="Valve 2")));
+end ThreeWayValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/package.mo b/ThermoSysPro/Fluid/PressureLosses/package.mo
index 7fe7cbcbc646e34bbe80d8fd05b51acc280786c6..d7e14c9ac0c68d887a89bedc43276e67948dac88 100644
--- a/ThermoSysPro/Fluid/PressureLosses/package.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.Fluid;
-package PressureLosses "Pressure losses"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end PressureLosses;
+within ThermoSysPro.Fluid;
+package PressureLosses "Pressure losses"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end PressureLosses;
diff --git a/ThermoSysPro/Fluid/PressureLosses/package.order b/ThermoSysPro/Fluid/PressureLosses/package.order
index 96c144018c08ce0cb658e04bf09a189cbc56f577..8e609c78d7ed3eb5c42aeae0e7cf9f9c47f4ac6a 100644
--- a/ThermoSysPro/Fluid/PressureLosses/package.order
+++ b/ThermoSysPro/Fluid/PressureLosses/package.order
@@ -1,14 +1,14 @@
-Bend
-CheckValve
-ControlValve
-Diaphragm
-DynamicCheckValve
-DynamicReliefValve
-IdealCheckValve
-IdealSwitchValve
-InvSingularPressureLoss
-LumpedStraightPipe
-PipePressureLoss
-SingularPressureLoss
-SwitchValve
-ThreeWayValve
+Bend
+CheckValve
+ControlValve
+Diaphragm
+DynamicCheckValve
+DynamicReliefValve
+IdealCheckValve
+IdealSwitchValve
+InvSingularPressureLoss
+LumpedStraightPipe
+PipePressureLoss
+SingularPressureLoss
+SwitchValve
+ThreeWayValve
diff --git a/ThermoSysPro/Fluid/Sensors/SensorH.mo b/ThermoSysPro/Fluid/Sensors/SensorH.mo
index b40e4a40026a8364a44a3b547544572f7be9e364..24f44968aa90db2644490d113f57421b41d0c41b 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorH.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorH.mo
@@ -1,87 +1,87 @@
-within ThermoSysPro.Fluid.Sensors;
-model SensorH "Specific enthalpy sensor"
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  /* Sensor signal */
-  Measure.signal = C1.h;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,60},{60,0}},
-          lineColor={0,0,0},
-          textString="h")}),
-    Window(
-      x=0.62,
-      y=0.25,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={0,255,0}),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,60},{60,0}},
-          lineColor={28,108,200},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid,
-          textString="h")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SensorH;
+within ThermoSysPro.Fluid.Sensors;
+model SensorH "Specific enthalpy sensor"
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  /* Sensor signal */
+  Measure.signal = C1.h;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,60},{60,0}},
+          lineColor={0,0,0},
+          textString="h")}),
+    Window(
+      x=0.62,
+      y=0.25,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={0,255,0}),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,60},{60,0}},
+          lineColor={28,108,200},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid,
+          textString="h")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SensorH;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorP.mo b/ThermoSysPro/Fluid/Sensors/SensorP.mo
index b0d0dca5672c5a48b6961abe0a4fb56795f66cb7..aa373e811708bc7716bbc17de85644619cc234c7 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorP.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorP.mo
@@ -1,82 +1,82 @@
-within ThermoSysPro.Fluid.Sensors;
-model SensorP "Pressure sensor"
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  /* Sensor signal */
-  Measure.signal = C1.P;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "P")}),
-    Window(
-      x=0.62,
-      y=0.25,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={0,255,0}),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "P")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SensorP;
+within ThermoSysPro.Fluid.Sensors;
+model SensorP "Pressure sensor"
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  /* Sensor signal */
+  Measure.signal = C1.P;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "P")}),
+    Window(
+      x=0.62,
+      y=0.25,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={0,255,0}),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "P")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SensorP;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorQ.mo b/ThermoSysPro/Fluid/Sensors/SensorQ.mo
index 10c2e849e51b15c20efe0ce8c4d93fb06e77881c..d9e865d721cf63ee968d79c7c85aa627a04d79c0 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorQ.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorQ.mo
@@ -1,88 +1,88 @@
-within ThermoSysPro.Fluid.Sensors;
-model SensorQ "Mass flow sensor"
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  /* Sensor signal */
-  Measure.signal = C1.Q;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,60},{60,0}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString =                      "Q")}),
-    Window(
-      x=0.25,
-      y=0.19,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={0,255,0}),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,60},{60,0}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={120,255,0},
-          textString =                      "Q")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SensorQ;
+within ThermoSysPro.Fluid.Sensors;
+model SensorQ "Mass flow sensor"
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  /* Sensor signal */
+  Measure.signal = C1.Q;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,60},{60,0}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          textString =                      "Q")}),
+    Window(
+      x=0.25,
+      y=0.19,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={0,255,0}),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,60},{60,0}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={120,255,0},
+          textString =                      "Q")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SensorQ;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorQv.mo b/ThermoSysPro/Fluid/Sensors/SensorQv.mo
index 8e280be817eb13ad97abb6648bae65f6df5b4f1a..581a959a55e91f43225c7c3d389ba93c19464745 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorQv.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorQv.mo
@@ -1,117 +1,117 @@
-within ThermoSysPro.Fluid.Sensors;
-model SensorQv "Volumetric flow sensor"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor";
-
-public
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-
-  ftype = C1.ftype;
-
-  /* Sensor signal */
-  Qv = Q/rho;
-  Measure.signal = Qv*facteur;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-  h = C1.h;
-  rho = ThermoSysPro.Properties.Fluid.Density_Ph(C1.P,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{0,-30},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,60},{60,0}},
-          lineColor={0,0,0},
-          textString="Qv")}),
-    Window(
-      x=0.3,
-      y=0.19,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={0,255,0}),
-        Line(points={{0,-30},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,64},{60,4}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString =                      "Qv")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni</li>
-</ul>
-</html>"));
-end SensorQv;
+within ThermoSysPro.Fluid.Sensors;
+model SensorQv "Volumetric flow sensor"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor";
+
+public
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+
+  ftype = C1.ftype;
+
+  /* Sensor signal */
+  Qv = Q/rho;
+  Measure.signal = Qv*facteur;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+  h = C1.h;
+  rho = ThermoSysPro.Properties.Fluid.Density_Ph(C1.P,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{0,-30},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,60},{60,0}},
+          lineColor={0,0,0},
+          textString="Qv")}),
+    Window(
+      x=0.3,
+      y=0.19,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={0,255,0}),
+        Line(points={{0,-30},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,64},{60,4}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString =                      "Qv")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni</li>
+</ul>
+</html>"));
+end SensorQv;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorT.mo b/ThermoSysPro/Fluid/Sensors/SensorT.mo
index e322057d17c8e03e525273f2cab396c589b2a4dd..334405ea74f2a299c7186bf2bbeaa4074bfcfa1f 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorT.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorT.mo
@@ -1,119 +1,119 @@
-within ThermoSysPro.Fluid.Sensors;
-model SensorT "Temperature sensor"
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s";
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Minimum mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  FluidType ftype "Fluid type";
-  Integer fluid=Integer(ftype) "Fluid number";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90), iconTransformation(
-        extent={{-10,-10},{10,10}},
-        rotation=90,
-        origin={0,102})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
-        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
-        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  C1.h_vol_1 = C2.h_vol_1;
-  C1.h_vol_2 = C2.h_vol_2;
-
-  C2.diff_on_1 = C1.diff_on_1;
-  C1.diff_on_2 = C2.diff_on_2;
-
-  C2.diff_res_1 = C1.diff_res_1;
-  C1.diff_res_2 = C2.diff_res_2;
-
-  C1.ftype = C2.ftype;
-
-  C1.Xco2 = C2.Xco2;
-  C1.Xh2o = C2.Xh2o;
-  C1.Xo2  = C2.Xo2;
-  C1.Xso2 = C2.Xso2;
-
-  Q = C1.Q;
-
-  ftype = C1.ftype;
-
-  /* Sensor signal */
-  Measure.signal = T;
-
-  /* Fluid thermodynamic properties */
-  P = (C1.P + C2.P)/2;
-  h = (C1.h + C2.h)/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={127,255,0}),
-        Line(points={{0,-30},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,64},{60,4}},
-          lineColor={28,108,200},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
-        Line(points={{0,-30},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(extent={{-60,64},{60,4}}, textString=
-                                            "T")}),
-    Window(
-      x=0.22,
-      y=0.21,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni</li>
-</ul>
-</html>"));
-end SensorT;
+within ThermoSysPro.Fluid.Sensors;
+model SensorT "Temperature sensor"
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s";
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Minimum mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  FluidType ftype "Fluid type";
+  Integer fluid=Integer(ftype) "Fluid number";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90), iconTransformation(
+        extent={{-10,-10},{10,10}},
+        rotation=90,
+        origin={0,102})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement(
+        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement(
+        transformation(extent={{92,-90},{112,-70}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  C1.h_vol_1 = C2.h_vol_1;
+  C1.h_vol_2 = C2.h_vol_2;
+
+  C2.diff_on_1 = C1.diff_on_1;
+  C1.diff_on_2 = C2.diff_on_2;
+
+  C2.diff_res_1 = C1.diff_res_1;
+  C1.diff_res_2 = C2.diff_res_2;
+
+  C1.ftype = C2.ftype;
+
+  C1.Xco2 = C2.Xco2;
+  C1.Xh2o = C2.Xh2o;
+  C1.Xo2  = C2.Xo2;
+  C1.Xso2 = C2.Xso2;
+
+  Q = C1.Q;
+
+  ftype = C1.ftype;
+
+  /* Sensor signal */
+  Measure.signal = T;
+
+  /* Fluid thermodynamic properties */
+  P = (C1.P + C2.P)/2;
+  h = (C1.h + C2.h)/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={127,255,0}),
+        Line(points={{0,-30},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,64},{60,4}},
+          lineColor={28,108,200},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor=DynamicSelect({127,255,0}, fill_color_singular)),
+        Line(points={{0,-30},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(extent={{-60,64},{60,4}}, textString=
+                                            "T")}),
+    Window(
+      x=0.22,
+      y=0.21,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni</li>
+</ul>
+</html>"));
+end SensorT;
diff --git a/ThermoSysPro/Fluid/Sensors/package.mo b/ThermoSysPro/Fluid/Sensors/package.mo
index c1315e785f68c6987b73f2a6a60af29c2c90ff3a..3d3654d1cf4e2df9256ba02983e2095fbff48135 100644
--- a/ThermoSysPro/Fluid/Sensors/package.mo
+++ b/ThermoSysPro/Fluid/Sensors/package.mo
@@ -1,121 +1,121 @@
-within ThermoSysPro.Fluid;
-package Sensors "Sensors"
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Sensors;
+within ThermoSysPro.Fluid;
+package Sensors "Sensors"
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Sensors;
diff --git a/ThermoSysPro/Fluid/Sensors/package.order b/ThermoSysPro/Fluid/Sensors/package.order
index 84c44e3c6910ad8489f4d750da1c8b0b6f94f5ad..f2873124c6480574af0567243f24c1a31505ea9c 100644
--- a/ThermoSysPro/Fluid/Sensors/package.order
+++ b/ThermoSysPro/Fluid/Sensors/package.order
@@ -1,5 +1,5 @@
-SensorP
-SensorQ
-SensorQv
-SensorH
-SensorT
+SensorP
+SensorQ
+SensorQv
+SensorH
+SensorT
diff --git a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo
index c9f1a668fa6b333d53b022877408a42852cf3e00..ff433175d1c58749ebde7754c0a84c86d98f3a02 100644
--- a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo
+++ b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo
@@ -1,557 +1,557 @@
-within ThermoSysPro.Fluid.Volumes;
-model DynamicDrum "Dynamic drum"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Boolean Vertical=true
-    "true: vertical cylinder - false: horizontal cylinder";
-  parameter Units.SI.Radius R=1.05 "Radius of the drum cross-sectional area";
-  parameter Units.SI.Length L=16.27 "Drum length";
-  parameter Real Ccond=0.01 "Condensation coefficient";
-  parameter Real Cevap=0.09 "Evaporation coefficient";
-  parameter Real Xlo=0.0025
-    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
-  parameter Real Xvo=0.9975
-    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
-  parameter Real Kvl=1000
-    "Heat exchange coefficient between the liquid and gas phases";
-  parameter Units.SI.CoefficientOfHeatTransfer Klp=400
-    "Heat exchange coefficient between the liquid phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kvp=100
-    "Heat exchange coefficient between the gas phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kpa=25
-    "Heat exchange coefficient between the wall and the outside";
-  parameter Units.SI.Mass Mp=117e3 "Wall mass";
-  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.5
-    "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0=50.e5
-    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-  parameter Units.SI.Volume V=pi*R^2*L "Drum volume";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Units.SI.Volume Vmin=1.e-6;
-
-public
-  Units.SI.AbsolutePressure P "Fluid average pressure";
-  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the drum";
-  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
-  Units.SI.Temperature Tl "Liquid phase temperature";
-  Units.SI.Temperature Tv "Gas phase temperature";
-  Units.SI.Temperature Tp(start=550) "Wall temperature";
-  Units.SI.Temperature Ta "External temperature";
-  Units.SI.Volume Vl "Liquid phase volume";
-  Units.SI.Volume Vv "Gas phase volume";
-  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
-  Units.SI.Area Avp "Gas phase surface on contact with the wall";
-  Units.SI.Area Ape "Wall surface on contact with the outside";
-  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
-  Real xv(start=0) "Mass vapor fraction in the vapor phase";
-  Real xmv(start=0.5) "Mass vapor fraction in the ascending tube";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Gas phase density";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phase";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase";
-  Units.SI.Power Wlv
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  Units.SI.Power Wpl
-    "Thermal power exchanged from the liquid phase to the wall";
-  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
-  Units.SI.Power Wpa "Thermal power exchanged from the outside to the wall";
-  Units.SI.Position zl(start=1.05) "Liquid level in drum";
-  Units.SI.Area Al "Cross sectional area of the liquid phase";
-  Units.SI.Angle theta "Angle";
-  Units.SI.Area Avl(start=1.0)
-    "Heat exchange surface between the liquid and gas phases";
-  FluidType fluids[8] "Fluids mixing in volume";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet Ce1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet Ce2";
-  Units.SI.Power Je3 "Thermal power diffusion from inlet Ce3";
-  Units.SI.Power Jm "Thermal power diffusion from inlet Cm";
-  Units.SI.Power Jd "Thermal power diffusion from outlet Cd";
-  Units.SI.Power Js "Thermal power diffusion from outlet Cs";
-  Units.SI.Power Jv "Thermal power diffusion from outlet Cv";
-  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
-  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet Ce1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet Ce2";
-  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet Ce3";
-  Units.SI.MassFlowRate gamma_m "Diffusion conductance for inlet Cm";
-  Units.SI.MassFlowRate gamma_d "Diffusion conductance for outlet Cd";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet Cs";
-  Units.SI.MassFlowRate gamma_v "Diffusion conductance for outlet Cv";
-  Real re1 "Value of r(Q/gamma) for inlet Ce1";
-  Real re2 "Value of r(Q/gamma) for inlet Ce2";
-  Real re3 "Value of r(Q/gamma) for inlet Ce3";
-  Real rm "Value of r(Q/gamma) for inlet Cm";
-  Real rd "Value of r(Q/gamma) for outlet Cd";
-  Real rs "Value of r(Q/gamma) for outlet Cs";
-  Real rv "Value of r(Q/gamma) for outlet Cv";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-60,40},{-20,80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{0,40},{40,80}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom
-    annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{0,-80},{40,-40}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Ce1 "Feedwater input 1" annotation (
-      Placement(transformation(extent={{-110,90},{-90,110}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Cm "Evaporation loop outlet" annotation (
-      Placement(transformation(extent={{90,-110},{110,-90}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cd "Evaporation loop inlet" annotation (
-      Placement(transformation(extent={{-110,-110},{-90,-90}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cv "Steam outlet" annotation (Placement(
-        transformation(extent={{90,90},{110,110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level "
-    annotation (                            layer="icon", Placement(
-        transformation(extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth "Thermal input to the liquid"
-                                     annotation (Placement(transformation(
-          extent={{-10,-60},{10,-40}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cex "Thermal input to the wall"
-                           annotation (Placement(transformation(extent={{-10,90},
-            {10,110}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{0,-20},{40,20}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Ce2 "Feedwater input 2" annotation (
-      Placement(transformation(extent={{-110,30},{-90,50}}, rotation=0),
-        iconTransformation(extent={{-110,30},{-90,50}})));
-  Interfaces.Connectors.FluidInlet Ce3 "Feedwater input 3" annotation (
-      Placement(transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cs "Water outlet" annotation (Placement(
-        transformation(extent={{90,-50},{110,-30}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      der(P) = 0;
-      der(hl) = 0;
-      der(hv) = 0;
-      der(Vl) = 0;
-      der(Tp) = 0;
-    else
-      P = P0;
-      hl = lsat.h;
-      hv = vsat.h;
-      Vl = Vf0*V;
-      der(Tp) = 0;
-    end if;
-  end if;
-
-equation
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Ce3.ftype;
-  fluids[5] = Cm.ftype;
-  fluids[6] = Cd.ftype;
-  fluids[7] = Cs.ftype;
-  fluids[8] = Cv.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "DynamicDrum: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 1;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 1;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.h_vol_1 = 1.e5;
-    Ce3.diff_res_1 = 0;
-    Ce3.diff_on_1 = false;
-    Ce3.ftype = ftype;
-    Ce3.Xco2 = 0;
-    Ce3.Xh2o = 1;
-    Ce3.Xo2 = 0;
-    Ce3.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cm) == 0) then
-    Cm.Q = 0;
-    Cm.h = 1.e5;
-    Cm.h_vol_1 = 1.e5;
-    Cm.diff_res_1 = 0;
-    Cm.diff_on_1 = false;
-    Cm.ftype = ftype;
-    Cm.Xco2 = 0;
-    Cm.Xh2o = 1;
-    Cm.Xo2 = 0;
-    Cm.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cd) == 0) then
-    Cd.Q = 0;
-    Cd.h_vol_2 = 1.e5;
-    Cd.diff_res_2 = 0;
-    Cd.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h_vol_2 = 1.e5;
-    Cs.diff_res_2 = 0;
-    Cs.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cv) == 0) then
-    Cv.Q = 0;
-    Cv.h_vol_2 = 1.e5;
-    Cv.diff_res_2 = 0;
-    Cv.diff_on_2 = false;
-  end if;
-
-  /* Liquid volume */
-  if Vertical then
-     theta = 1;
-     Al = pi*R^2;
-     Vl = Al*zl;
-     Avl = Al;
-  else
-     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
-     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
-     Vl = Al*L;
-     Avl = 2*R*Modelica.Math.cos(theta)*L;
-  end if;
-
-  /* Drum volume */
-  Vl + Vv = V;
-
-  /* Liquid level */
-  yLevel.signal = zl;
-
-  /* Liquid surface and vapor surface on contact with wall */
-  Alp = if Vertical then 2*pi*R*zl + Al else (pi - 2*theta)*R*L + 2*Al;
-  Avp = if Vertical then 2*pi*R*(L - zl) + Al else (pi + 2*theta)*R*L + 2*Al;
-
-  /* Wall surface on contact with the outside */
-  Ape = Alp + Avp;
-
-  /* Pressure at the bottom of the drum */
-  Pfond = P + prod.d*g*zl;
-
-  /* Liquid phase mass balance equation */
-  BQl = Ce1.Q + Ce2.Q + Ce3.Q - Cd.Q - Cs.Q + (1 - xmv)*Cm.Q + Qcond - Qevap;
-
-  if dynamic_energy_balance then
-    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-  else
-    0 = BQl;
-  end if;
-
-  /* Gas phase mass balance equation */
-  BQv = xmv*Cm.Q - Cv.Q + Qevap - Qcond;
-
-  if dynamic_energy_balance then
-    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-  else
-    0 = BQv;
-  end if;
-
-  /* Condensation and evaporation mass flow rates */
-  Qcond = if noEvent(xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
-  Qevap = if noEvent(xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
-
-  Ce1.P = P;
-  Ce2.P = P;
-  Ce3.P = P;
-  Cm.P = P;
-  Cd.P = Pfond;
-  Cs.P = P;
-  Cv.P = P;
-
-  /* Liquid phase energy balance equation */
-  BHl = Ce1.Q*(Ce1.h - (hl - P/rhol)) + Ce2.Q*(Ce2.h - (hl - P/rhol)) + Ce3.Q*(Ce3.h - (hl - P/rhol))
-    - Cd.Q*(Cd.h - (hl - P/rhol)) - Cs.Q*(Cs.h - (hl - P/rhol))
-    + (1 - xmv)*Cm.Q*((if (xmv > 0) then lsat.h else Cm.h) - (hl - P/rhol))
-    + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wlv - Wpl + Cth.W + Jt_l;
-
-  if dynamic_energy_balance then
-    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-  else
-    0 = BHl;
-  end if;
-
-  /* Gas phase energy balance equation */
-  BHv = xmv*Cm.Q*((if (xmv < 1) then vsat.h else Cm.h) - (hv - P/rhov))
-     - Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov))
-     - Wlv - Wpv + Jt_v;
-
-  if dynamic_energy_balance then
-    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-  else
-    0 = BHv;
-  end if;
-
-  Ce1.h_vol_2 = hl;
-  Ce2.h_vol_2 = hl;
-  Ce3.h_vol_2 = hl;
-  Cm.h_vol_2 = hl;
-  Cd.h_vol_1 = noEvent(min(lsat.h, hl));
-  Cs.h_vol_1 = hl;
-  Cv.h_vol_1 = hv;
-
-  /* Energy balance equation at the wall */
-  if dynamic_energy_balance then
-    Mp*cpp*der(Tp) = Wpl + Wpv + Wpa;
-  else
-    0 = Wpl + Wpv + Wpa;
-  end if;
-
-  /* Heat exchange between liquid and gas phases */
-  Wlv = Kvl*Avl*(Tv - Tl);
-
-  /* Heat exchange between the liquid phase and the wall */
-  Wpl = Klp*Alp*(Tl - Tp);
-
-  /* Heat exchange between the gas phase and the wall */
-  Wpv = Kvp*Avp*(Tv - Tp);
-
-  /* Heat exchange between the wall and the outside */
-  Wpa = Kpa*Ape*(Ta - Tp);
-
-  /* Fluid composition (no balance equations) */
-  Cd.ftype = ftype;
-  Cs.ftype = ftype;
-  Cv.ftype = ftype;
-
-  Cd.Xco2 = 0;
-  Cd.Xh2o = 1;
-  Cd.Xo2  = 0;
-  Cd.Xso2 = 0;
-  Cs.Xco2 = 0;
-  Cs.Xh2o = 1;
-  Cs.Xo2  = 0;
-  Cs.Xso2 = 0;
-  Cv.Xco2 = 0;
-  Cv.Xh2o = 1;
-  Cv.Xo2  = 0;
-  Cv.Xso2 = 0;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cd.h = ThermoSysPro.Functions.SmoothCond(Cd.Q/gamma_d, Cd.h_vol_1, Cd.h_vol_2, 1);
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-    Cv.h = ThermoSysPro.Functions.SmoothCond(Cv.Q/gamma_v, Cv.h_vol_1, Cv.h_vol_2, 1);
-  else
-    Cd.h = if (Cd.Q > 0) then Cd.h_vol_1 else Cd.h_vol_2;
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-    Cv.h = if (Cv.Q > 0) then Cv.h_vol_1 else Cv.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
-    rm = if Cm.diff_on_1 then exp(-0.033*(Cm.Q*Cm.diff_res_1)^2) else 0;
-    rd = if Cd.diff_on_2 then exp(-0.033*(Cd.Q*Cd.diff_res_2)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-    rv = if Cv.diff_on_2 then exp(-0.033*(Cv.Q*Cv.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
-    gamma_m = if Cm.diff_on_1 then 1/Cm.diff_res_1 else gamma0;
-    gamma_d = if Cd.diff_on_2 then 1/Cd.diff_res_2 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-    gamma_v = if Cv.diff_on_2 then 1/Cv.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
-    Jm = if Cm.diff_on_1 then rm*gamma_m*(Cm.h_vol_1 - Cm.h_vol_2) else 0;
-    Jd = if Cd.diff_on_2 then rd*gamma_d*(Cd.h_vol_2 - Cd.h_vol_1) else 0;
-    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-    Jv = if Cv.diff_on_2 then rv*gamma_v*(Cv.h_vol_2 - Cv.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    re3 = 0;
-    rm = 0;
-    rd = 0;
-    rs = 0;
-    rv = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_e3 = gamma0;
-    gamma_m = gamma0;
-    gamma_d = gamma0;
-    gamma_s = gamma0;
-    gamma_v = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Je3 = 0;
-    Jm = 0;
-    Jd = 0;
-    Js = 0;
-    Jv = 0;
-  end if;
-
-  Jt_l = Je1 + Je2 + Je3 + Jm + Jd + Js;
-  Jt_v = Jv;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Ce3.diff_res_2 = 0;
-  Cm.diff_res_2 = 0;
-  Cd.diff_res_1 = 0;
-  Cs.diff_res_1 = 0;
-  Cv.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Ce3.diff_on_2 = diffusion;
-  Cm.diff_on_2 = diffusion;
-  Cd.diff_on_1 = diffusion;
-  Cs.diff_on_1 = diffusion;
-  Cv.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  prol = ThermoSysPro.Properties.Fluid.Ph(P, hl, 0, fluid);
-  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid);
-  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cd.h, 0, fluid);
-  prom = ThermoSysPro.Properties.Fluid.Ph(P, Cm.h, 0, fluid);
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid);
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-  rhov = prov.d;
-  xv = prov.x;
-
-  xmv = if noEvent(Cm.Q > 0) then prom.x else 0;
-
-  Cth.T = Tl;
-  Cex.T = Ta;
-  Cex.W = Wpa;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,100},{-68,100},{-60,80}}),
-        Line(points={{-90,-100},{-68,-100},{-60,-80}}),
-        Line(points={{62,80},{70,100},{90,100}}),
-        Polygon(
-          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
-              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
-              80},{40,92},{20,98},{0,100}},
-          lineColor={28,108,200},
-          fillColor={255,255,255},
-          fillPattern=DynamicSelect(FillPattern.Sphere,
-          if dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid)),
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={28,108,200},
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Sphere,
-          if dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid)),
-        Line(points={{60,-80},{72,-100},{90,-100}}),
-        Polygon(
-          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
-              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
-              80},{40,92},{20,98},{0,100}},
-          lineColor={28,108,200},
-          fillColor=DynamicSelect({170,213,255},
-          if dynamic_energy_balance then {170,213,255}
-          else if diffusion then {213,255,170}
-          else {255,255,170}),
-          fillPattern=DynamicSelect(FillPattern.Sphere,
-          if dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid))}),
-    Window(
-      x=0.16,
-      y=0.04,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end DynamicDrum;
+within ThermoSysPro.Fluid.Volumes;
+model DynamicDrum "Dynamic drum"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Boolean Vertical=true
+    "true: vertical cylinder - false: horizontal cylinder";
+  parameter Units.SI.Radius R=1.05 "Radius of the drum cross-sectional area";
+  parameter Units.SI.Length L=16.27 "Drum length";
+  parameter Real Ccond=0.01 "Condensation coefficient";
+  parameter Real Cevap=0.09 "Evaporation coefficient";
+  parameter Real Xlo=0.0025
+    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
+  parameter Real Xvo=0.9975
+    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
+  parameter Real Kvl=1000
+    "Heat exchange coefficient between the liquid and gas phases";
+  parameter Units.SI.CoefficientOfHeatTransfer Klp=400
+    "Heat exchange coefficient between the liquid phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kvp=100
+    "Heat exchange coefficient between the gas phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kpa=25
+    "Heat exchange coefficient between the wall and the outside";
+  parameter Units.SI.Mass Mp=117e3 "Wall mass";
+  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.5
+    "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0=50.e5
+    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+  parameter Units.SI.Volume V=pi*R^2*L "Drum volume";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Units.SI.Volume Vmin=1.e-6;
+
+public
+  Units.SI.AbsolutePressure P "Fluid average pressure";
+  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the drum";
+  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
+  Units.SI.Temperature Tl "Liquid phase temperature";
+  Units.SI.Temperature Tv "Gas phase temperature";
+  Units.SI.Temperature Tp(start=550) "Wall temperature";
+  Units.SI.Temperature Ta "External temperature";
+  Units.SI.Volume Vl "Liquid phase volume";
+  Units.SI.Volume Vv "Gas phase volume";
+  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
+  Units.SI.Area Avp "Gas phase surface on contact with the wall";
+  Units.SI.Area Ape "Wall surface on contact with the outside";
+  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
+  Real xv(start=0) "Mass vapor fraction in the vapor phase";
+  Real xmv(start=0.5) "Mass vapor fraction in the ascending tube";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Gas phase density";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phase";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase";
+  Units.SI.Power Wlv
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  Units.SI.Power Wpl
+    "Thermal power exchanged from the liquid phase to the wall";
+  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
+  Units.SI.Power Wpa "Thermal power exchanged from the outside to the wall";
+  Units.SI.Position zl(start=1.05) "Liquid level in drum";
+  Units.SI.Area Al "Cross sectional area of the liquid phase";
+  Units.SI.Angle theta "Angle";
+  Units.SI.Area Avl(start=1.0)
+    "Heat exchange surface between the liquid and gas phases";
+  FluidType fluids[8] "Fluids mixing in volume";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet Ce1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet Ce2";
+  Units.SI.Power Je3 "Thermal power diffusion from inlet Ce3";
+  Units.SI.Power Jm "Thermal power diffusion from inlet Cm";
+  Units.SI.Power Jd "Thermal power diffusion from outlet Cd";
+  Units.SI.Power Js "Thermal power diffusion from outlet Cs";
+  Units.SI.Power Jv "Thermal power diffusion from outlet Cv";
+  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
+  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet Ce1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet Ce2";
+  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet Ce3";
+  Units.SI.MassFlowRate gamma_m "Diffusion conductance for inlet Cm";
+  Units.SI.MassFlowRate gamma_d "Diffusion conductance for outlet Cd";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet Cs";
+  Units.SI.MassFlowRate gamma_v "Diffusion conductance for outlet Cv";
+  Real re1 "Value of r(Q/gamma) for inlet Ce1";
+  Real re2 "Value of r(Q/gamma) for inlet Ce2";
+  Real re3 "Value of r(Q/gamma) for inlet Ce3";
+  Real rm "Value of r(Q/gamma) for inlet Cm";
+  Real rd "Value of r(Q/gamma) for outlet Cd";
+  Real rs "Value of r(Q/gamma) for outlet Cs";
+  Real rv "Value of r(Q/gamma) for outlet Cv";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-60,40},{-20,80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{0,40},{40,80}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom
+    annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{0,-80},{40,-40}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Ce1 "Feedwater input 1" annotation (
+      Placement(transformation(extent={{-110,90},{-90,110}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Cm "Evaporation loop outlet" annotation (
+      Placement(transformation(extent={{90,-110},{110,-90}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cd "Evaporation loop inlet" annotation (
+      Placement(transformation(extent={{-110,-110},{-90,-90}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cv "Steam outlet" annotation (Placement(
+        transformation(extent={{90,90},{110,110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level "
+    annotation (                            layer="icon", Placement(
+        transformation(extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth "Thermal input to the liquid"
+                                     annotation (Placement(transformation(
+          extent={{-10,-60},{10,-40}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cex "Thermal input to the wall"
+                           annotation (Placement(transformation(extent={{-10,90},
+            {10,110}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{0,-20},{40,20}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Ce2 "Feedwater input 2" annotation (
+      Placement(transformation(extent={{-110,30},{-90,50}}, rotation=0),
+        iconTransformation(extent={{-110,30},{-90,50}})));
+  Interfaces.Connectors.FluidInlet Ce3 "Feedwater input 3" annotation (
+      Placement(transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cs "Water outlet" annotation (Placement(
+        transformation(extent={{90,-50},{110,-30}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      der(P) = 0;
+      der(hl) = 0;
+      der(hv) = 0;
+      der(Vl) = 0;
+      der(Tp) = 0;
+    else
+      P = P0;
+      hl = lsat.h;
+      hv = vsat.h;
+      Vl = Vf0*V;
+      der(Tp) = 0;
+    end if;
+  end if;
+
+equation
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Ce3.ftype;
+  fluids[5] = Cm.ftype;
+  fluids[6] = Cd.ftype;
+  fluids[7] = Cs.ftype;
+  fluids[8] = Cv.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "DynamicDrum: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.h_vol_1 = 1.e5;
+    Ce3.diff_res_1 = 0;
+    Ce3.diff_on_1 = false;
+    Ce3.ftype = ftype;
+    Ce3.Xco2 = 0;
+    Ce3.Xh2o = 0;
+    Ce3.Xo2 = 0;
+    Ce3.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cm) == 0) then
+    Cm.Q = 0;
+    Cm.h = 1.e5;
+    Cm.h_vol_1 = 1.e5;
+    Cm.diff_res_1 = 0;
+    Cm.diff_on_1 = false;
+    Cm.ftype = ftype;
+    Cm.Xco2 = 0;
+    Cm.Xh2o = 0;
+    Cm.Xo2 = 0;
+    Cm.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cd) == 0) then
+    Cd.Q = 0;
+    Cd.h_vol_2 = 1.e5;
+    Cd.diff_res_2 = 0;
+    Cd.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h_vol_2 = 1.e5;
+    Cs.diff_res_2 = 0;
+    Cs.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cv) == 0) then
+    Cv.Q = 0;
+    Cv.h_vol_2 = 1.e5;
+    Cv.diff_res_2 = 0;
+    Cv.diff_on_2 = false;
+  end if;
+
+  /* Liquid volume */
+  if Vertical then
+     theta = 1;
+     Al = pi*R^2;
+     Vl = Al*zl;
+     Avl = Al;
+  else
+     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
+     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
+     Vl = Al*L;
+     Avl = 2*R*Modelica.Math.cos(theta)*L;
+  end if;
+
+  /* Drum volume */
+  Vl + Vv = V;
+
+  /* Liquid level */
+  yLevel.signal = zl;
+
+  /* Liquid surface and vapor surface on contact with wall */
+  Alp = if Vertical then 2*pi*R*zl + Al else (pi - 2*theta)*R*L + 2*Al;
+  Avp = if Vertical then 2*pi*R*(L - zl) + Al else (pi + 2*theta)*R*L + 2*Al;
+
+  /* Wall surface on contact with the outside */
+  Ape = Alp + Avp;
+
+  /* Pressure at the bottom of the drum */
+  Pfond = P + prod.d*g*zl;
+
+  /* Liquid phase mass balance equation */
+  BQl = Ce1.Q + Ce2.Q + Ce3.Q - Cd.Q - Cs.Q + (1 - xmv)*Cm.Q + Qcond - Qevap;
+
+  if dynamic_energy_balance then
+    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+  else
+    0 = BQl;
+  end if;
+
+  /* Gas phase mass balance equation */
+  BQv = xmv*Cm.Q - Cv.Q + Qevap - Qcond;
+
+  if dynamic_energy_balance then
+    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+  else
+    0 = BQv;
+  end if;
+
+  /* Condensation and evaporation mass flow rates */
+  Qcond = if noEvent(xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
+  Qevap = if noEvent(xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
+
+  Ce1.P = P;
+  Ce2.P = P;
+  Ce3.P = P;
+  Cm.P = P;
+  Cd.P = Pfond;
+  Cs.P = P;
+  Cv.P = P;
+
+  /* Liquid phase energy balance equation */
+  BHl = Ce1.Q*(Ce1.h - (hl - P/rhol)) + Ce2.Q*(Ce2.h - (hl - P/rhol)) + Ce3.Q*(Ce3.h - (hl - P/rhol))
+    - Cd.Q*(Cd.h - (hl - P/rhol)) - Cs.Q*(Cs.h - (hl - P/rhol))
+    + (1 - xmv)*Cm.Q*((if (xmv > 0) then lsat.h else Cm.h) - (hl - P/rhol))
+    + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wlv - Wpl + Cth.W + Jt_l;
+
+  if dynamic_energy_balance then
+    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+  else
+    0 = BHl;
+  end if;
+
+  /* Gas phase energy balance equation */
+  BHv = xmv*Cm.Q*((if (xmv < 1) then vsat.h else Cm.h) - (hv - P/rhov))
+     - Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov))
+     - Wlv - Wpv + Jt_v;
+
+  if dynamic_energy_balance then
+    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+  else
+    0 = BHv;
+  end if;
+
+  Ce1.h_vol_2 = hl;
+  Ce2.h_vol_2 = hl;
+  Ce3.h_vol_2 = hl;
+  Cm.h_vol_2 = hl;
+  Cd.h_vol_1 = noEvent(min(lsat.h, hl));
+  Cs.h_vol_1 = hl;
+  Cv.h_vol_1 = hv;
+
+  /* Energy balance equation at the wall */
+  if dynamic_energy_balance then
+    Mp*cpp*der(Tp) = Wpl + Wpv + Wpa;
+  else
+    0 = Wpl + Wpv + Wpa;
+  end if;
+
+  /* Heat exchange between liquid and gas phases */
+  Wlv = Kvl*Avl*(Tv - Tl);
+
+  /* Heat exchange between the liquid phase and the wall */
+  Wpl = Klp*Alp*(Tl - Tp);
+
+  /* Heat exchange between the gas phase and the wall */
+  Wpv = Kvp*Avp*(Tv - Tp);
+
+  /* Heat exchange between the wall and the outside */
+  Wpa = Kpa*Ape*(Ta - Tp);
+
+  /* Fluid composition (no balance equations) */
+  Cd.ftype = ftype;
+  Cs.ftype = ftype;
+  Cv.ftype = ftype;
+
+  Cd.Xco2 = 0;
+  Cd.Xh2o = 0;
+  Cd.Xo2  = 0;
+  Cd.Xso2 = 0;
+  Cs.Xco2 = 0;
+  Cs.Xh2o = 0;
+  Cs.Xo2  = 0;
+  Cs.Xso2 = 0;
+  Cv.Xco2 = 0;
+  Cv.Xh2o = 0;
+  Cv.Xo2  = 0;
+  Cv.Xso2 = 0;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cd.h = ThermoSysPro.Functions.SmoothCond(Cd.Q/gamma_d, Cd.h_vol_1, Cd.h_vol_2, 1);
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+    Cv.h = ThermoSysPro.Functions.SmoothCond(Cv.Q/gamma_v, Cv.h_vol_1, Cv.h_vol_2, 1);
+  else
+    Cd.h = if (Cd.Q > 0) then Cd.h_vol_1 else Cd.h_vol_2;
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+    Cv.h = if (Cv.Q > 0) then Cv.h_vol_1 else Cv.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
+    rm = if Cm.diff_on_1 then exp(-0.033*(Cm.Q*Cm.diff_res_1)^2) else 0;
+    rd = if Cd.diff_on_2 then exp(-0.033*(Cd.Q*Cd.diff_res_2)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+    rv = if Cv.diff_on_2 then exp(-0.033*(Cv.Q*Cv.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
+    gamma_m = if Cm.diff_on_1 then 1/Cm.diff_res_1 else gamma0;
+    gamma_d = if Cd.diff_on_2 then 1/Cd.diff_res_2 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+    gamma_v = if Cv.diff_on_2 then 1/Cv.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
+    Jm = if Cm.diff_on_1 then rm*gamma_m*(Cm.h_vol_1 - Cm.h_vol_2) else 0;
+    Jd = if Cd.diff_on_2 then rd*gamma_d*(Cd.h_vol_2 - Cd.h_vol_1) else 0;
+    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+    Jv = if Cv.diff_on_2 then rv*gamma_v*(Cv.h_vol_2 - Cv.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    re3 = 0;
+    rm = 0;
+    rd = 0;
+    rs = 0;
+    rv = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_e3 = gamma0;
+    gamma_m = gamma0;
+    gamma_d = gamma0;
+    gamma_s = gamma0;
+    gamma_v = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Je3 = 0;
+    Jm = 0;
+    Jd = 0;
+    Js = 0;
+    Jv = 0;
+  end if;
+
+  Jt_l = Je1 + Je2 + Je3 + Jm + Jd + Js;
+  Jt_v = Jv;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Ce3.diff_res_2 = 0;
+  Cm.diff_res_2 = 0;
+  Cd.diff_res_1 = 0;
+  Cs.diff_res_1 = 0;
+  Cv.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Ce3.diff_on_2 = diffusion;
+  Cm.diff_on_2 = diffusion;
+  Cd.diff_on_1 = diffusion;
+  Cs.diff_on_1 = diffusion;
+  Cv.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  prol = ThermoSysPro.Properties.Fluid.Ph(P, hl, 0, fluid);
+  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid);
+  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cd.h, 0, fluid);
+  prom = ThermoSysPro.Properties.Fluid.Ph(P, Cm.h, 0, fluid);
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid);
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+  rhov = prov.d;
+  xv = prov.x;
+
+  xmv = if noEvent(Cm.Q > 0) then prom.x else 0;
+
+  Cth.T = Tl;
+  Cex.T = Ta;
+  Cex.W = Wpa;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,100},{-68,100},{-60,80}}),
+        Line(points={{-90,-100},{-68,-100},{-60,-80}}),
+        Line(points={{62,80},{70,100},{90,100}}),
+        Polygon(
+          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
+              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
+              80},{40,92},{20,98},{0,100}},
+          lineColor={28,108,200},
+          fillColor={255,255,255},
+          fillPattern=DynamicSelect(FillPattern.Sphere,
+          if dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid)),
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={28,108,200},
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Sphere,
+          if dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid)),
+        Line(points={{60,-80},{72,-100},{90,-100}}),
+        Polygon(
+          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
+              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
+              80},{40,92},{20,98},{0,100}},
+          lineColor={28,108,200},
+          fillColor=DynamicSelect({170,213,255},
+          if dynamic_energy_balance then {170,213,255}
+          else if diffusion then {213,255,170}
+          else {255,255,170}),
+          fillPattern=DynamicSelect(FillPattern.Sphere,
+          if dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid))}),
+    Window(
+      x=0.16,
+      y=0.04,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end DynamicDrum;
diff --git a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo
index 2da36024c9b6e1c33d22da7fc854f32e34ac0467..096355900ae8eda9f54d86897bda85807d811869 100644
--- a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo
+++ b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo
@@ -1,432 +1,432 @@
-within ThermoSysPro.Fluid.Volumes;
-model Pressurizer "Pressurizer"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Units.SI.Volume V=61.1 "Pressurizer volume";
-  parameter Units.SI.Radius Rp=1.265 "Pressurizer cross-sectional radius";
-  parameter Units.SI.Area Ae=1 "Wall surface";
-  parameter Units.SI.Position Zm=10.15 "Hauteur de la gamme de mesure niveau";
-  parameter Real Ccond=0.1 "Condensation coefficient";
-  parameter Real Cevap=0.1 "Evaporation coefficient";
-  parameter Units.SI.CoefficientOfHeatTransfer Klv=0.5e6
-    "Heat exchange coefficient between the liquid and gas phases";
-  parameter Units.SI.CoefficientOfHeatTransfer Klp=50000
-    "Heat exchange coefficient between the liquid phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kvp=25
-    "Heat exchange coefficient between the gas phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kpa=542
-    "Heat exchange coefficient between the wall and the outside";
-  parameter Units.SI.Mass Mp=117e3 "Wall mass";
-  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Yw0=50
-    "Initial water level - percent of the measure scale level (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0=155e5
-    "Initial fluid pressure (active if steady_state=false)" annotation (
-      Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Real pi=Modelica.Constants.pi "Pi";
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Units.SI.Area Ap=pi*Rp*Rp "Pressurizer cross-sectional area";
-
-public
-  Units.SI.Area Slpin "Exchange surface between the liquid and the wall";
-  Units.SI.Area Svpin "Exchange surface between the vapor and the wall";
-  Real Yw(start=50) "Liquid level as a percent of the measure scale";
-  Real y(start=0.5) "Liquid level as a proportion of the measure scale";
-  Units.SI.Position Zl(start=20) "Liquid level in the pressurizer";
-  Units.SI.Volume Vl "Liquid phase volume";
-  Units.SI.Volume Vv "Gas phase volume";
-  Units.SI.AbsolutePressure P(start=155.0e5) "Average fluid pressure";
-  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the drum";
-  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hls "Liquid phase saturation specific enthalpy";
-  Units.SI.SpecificEnthalpy hvs "Gas phase saturation specific enthalpy";
-  Units.SI.Temperature Tl "Liquid phase temperature";
-  Units.SI.Temperature Tv "Gas phase temperature";
-  Units.SI.Temperature Tp(start=617.24) "Wall temperature";
-  Units.SI.Temperature Ta "External temperature";
-  Units.SI.Power Wlv
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  Units.SI.Power Wpl
-    "Thermal power exchanged from the liquid phase to the wall";
-  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
-  Units.SI.Power Wpa "Thermal power exchanged from the outside to the wall";
-  Units.SI.Power Wch "Power released by the electrical heaters";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phase";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Vapor phase density";
-  FluidType fluids[4] "Fluids mixing in volume";
-  Units.SI.Power Jas "Thermal power diffusion from inlet Cas";
-  Units.SI.Power Jex "Thermal power diffusion from outlet Cex";
-  Units.SI.Power Js "Thermal power diffusion from outlet Cs";
-  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
-  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
-  Units.SI.MassFlowRate gamma_as "Diffusion conductance for inlet Cas";
-  Units.SI.MassFlowRate gamma_ex "Diffusion conductance for outlet Cex";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet Cs";
-  Real ras "Value of r(Q/gamma) for inlet Cas";
-  Real rex "Value of r(Q/gamma) for outlet Cex";
-  Real rs "Value of r(Q/gamma) for outlet Cs";
-
-  Interfaces.Connectors.FluidInlet Cas "Water input" annotation (Placement(
-        transformation(extent={{-8,92},{8,108}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cs "Steam output" annotation (Placement(
-        transformation(extent={{92,90},{108,106}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Ca "Thermal input to the wall"
-    annotation (Placement(transformation(extent={{-100,-8},{-80,12}}, rotation=
-            0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cc "Thermal input to the liquid"
-    annotation (Placement(transformation(extent={{-10,-42},{10,-22}}, rotation=
-            0)));
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"
-    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cex "Water output" annotation (Placement(
-        transformation(extent={{-8,-108},{8,-92}}, rotation=0)));
-  Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{16,44},{56,84}}, rotation=0)));
-  Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-54,44},{-14,84}}, rotation=0)));
-  Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-54,4},{-14,44}}, rotation=0)));
-  Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{16,4},{56,44}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      der(P) = 0;
-      der(hl) = 0;
-      der(hv) = 0;
-      der(y) = 0;
-      der(Tp) = 0;
-    else
-      P = P0;
-      hl = hls;
-      hv = hvs;
-      Yw = Yw0;
-      der(Tp) = 0;
-    end if;
-  end if;
-
-equation
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Cas.ftype;
-  fluids[3] = Cex.ftype;
-  fluids[4] = Cs.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "Pressurizer: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Cas) == 0) then
-    Cas.Q = 0;
-    Cas.h = 1.e5;
-    Cas.h_vol_1 = 1.e5;
-    Cas.diff_res_1 = 0;
-    Cas.diff_on_1 = false;
-    Cas.ftype = ftype;
-    Cas.Xco2 = 0;
-    Cas.Xh2o = 1;
-    Cas.Xo2 = 0;
-    Cas.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cex) == 0) then
-    Cex.Q = 0;
-    Cex.h_vol_2 = 1.e5;
-    Cex.diff_res_2 = 0;
-    Cex.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h_vol_2 = 1.e5;
-    Cs.diff_res_2 = 0;
-    Cs.diff_on_2 = false;
-  end if;
-
-  Ca.W = Wpa;
-  Ca.T = Ta;
-
-  Cc.W = Wch;
-  Cc.T = Tl;
-
-  yLevel.signal = Yw;
-
-  /* Computation of the geometrical variables */
-  Yw = 100*y;
-  Zl = Zm*y + 0.5*(V/Ap - Zm);
-  Vl = Ap*Zl;
-  Vv = V - Vl;
-  Slpin = Zl*2*pi*Rp;
-  Svpin = (V/Ap - Zl)*2*pi*Rp;
-
-  /* Pressure in the expansion line */
-  Pfond = P + g*(Vl*rhol + Vv*rhov)/Ap;
-
-  /* Liquid phase mass balance equation */
-  BQl = Cas.Q - Cex.Q + Qcond - Qevap;
-
-  if dynamic_energy_balance then
-    rhol*Ap*Zm*der(y) + Vl*prol.ddph*der(P) + Vl*prol.ddhp*der(hl) = BQl;
-  else
-    0 = BQl;
-  end if;
-
-  /* Gas phase mass balance equation */
-  BQv = Qevap - Cs.Q - Qcond;
-
-  if dynamic_energy_balance then
-    -rhov*Ap*Zm*der(y) + Vv*prov.ddph*der(P) + Vv*prov.ddhp*der(hv) = BQv;
-  else
-    0 = BQv;
-  end if;
-
-  /* Condensation and evaporation mass flows */
-  Qevap = Cevap*rhol*Vl*(hl - hls)/(hvs - hls);
-  Qcond = Ccond*rhov*Vv*(hvs - hv)/(hvs - hls);
-
-  Cas.P = P;
-  Cs.P = P;
-  Cex.P = Pfond;
-
-  /* Liquid phase energy balance equation */
-  BHl = (Qcond + Cas.Q)*(hls - hl) - Qevap*(hvs - hl) - Cex.Q*(Cex.h - hl) - Wpl + Wlv + Wch + Jt_l;
-
-  if dynamic_energy_balance then
-    rhol*Vl*der(hl) - Vl*der(P) = BHl;
-  else
-    0 = BHl;
-  end if;
-
-  /* Gas phase energy balance equation */
-  BHv = Qevap*(hvs - hv) - Qcond*(hls - hv) - Cas.Q*(hls - Cas.h) - Wpv - Wlv - Cs.Q*(Cs.h - hv) + Jt_v;
-
-  if dynamic_energy_balance then
-    rhov*Vv*der(hv) - Vv*der(P) = BHv;
-  else
-    0 = BHv;
-  end if;
-
-  Cas.h_vol_2 = hl;
-  Cs.h_vol_1 = hv;
-  Cex.h_vol_1 = hl;
-
-  /* Energy balance equation at the wall */
-  if dynamic_energy_balance then
-    Mp*cpp*der(Tp) = Wpl + Wpv + Wpa;
-  else
-    0 = Wpl + Wpv + Wpa;
-  end if;
-
-  /* Heat exchange between liquid and gas phases */
-  Wlv = Klv*Ap*(Tv - Tl);
-
-  /* Heat exchange between the liquid phase and the wall */
-  Wpl = Klp*Slpin*(Tl - Tp);
-
-  /* Heat exchange between the gas phase and the wall */
-  Wpv = Kvp*Svpin*(Tv - Tp);
-
-  /* Heat exchange between the wall and the outside */
-  Wpa = Kpa*Ae*(Ta - Tp);
-
-  /* Fluid composition (no balance equations) */
-  Cex.ftype = ftype;
-  Cs.ftype = ftype;
-
-  Cs.Xco2 = 0;
-  Cs.Xh2o = 1;
-  Cs.Xo2  = 0;
-  Cs.Xso2 = 0;
-
-  Cex.Xco2 = 0;
-  Cex.Xh2o = 1;
-  Cex.Xo2  = 0;
-  Cex.Xso2 = 0;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1);
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-  else
-    Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2;
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    ras = if Cas.diff_on_1 then exp(-0.033*(Cas.Q*Cas.diff_res_1)^2) else 0;
-    rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-
-    gamma_as = if Cas.diff_on_1 then 1/Cas.diff_res_1 else gamma0;
-    gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-
-    Jas = if Cas.diff_on_1 then ras*gamma_as*(Cas.h_vol_1 - Cas.h_vol_2) else 0;
-    Jex = if Cex.diff_on_2 then rex*gamma_ex*(Cex.h_vol_2 - Cex.h_vol_1) else 0;
-    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-  else
-    ras = 0;
-    rex = 0;
-    rs = 0;
-
-    gamma_as = gamma0;
-    gamma_ex = gamma0;
-    gamma_s = gamma0;
-
-    Jas = 0;
-    Jex = 0;
-    Js = 0;
-  end if;
-
-  Jt_l = Jas + Jex;
-  Jt_v = Js;
-
-  Cas.diff_res_2 = 0;
-  Cex.diff_res_1 = 0;
-  Cs.diff_res_1 = 0;
-
-  Cas.diff_on_2 = diffusion;
-  Cex.diff_on_1 = diffusion;
-  Cs.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  prol = ThermoSysPro.Properties.Fluid.Ph(P, hl,0,fluid);
-  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv,0,fluid);
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid);
-
-  Tl = prol.T;
-  Tv = prov.T;
-  rhol = prol.d;
-  rhov = prov.d;
-  hls = lsat.h;
-  hvs = vsat.h;
-
-  annotation (Icon(graphics={
-        Line(
-          points={{100,90},{100,60},{80,60},{80,60}},
-          color={28,108,200},
-          thickness=1),
-        Ellipse(
-          extent={{-80,-92},{80,-42}},
-          lineColor={85,170,255},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Sphere,
-          if dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          lineThickness=0.5),
-        Rectangle(
-          extent={{-80,-14},{80,-68}},
-          lineColor={85,170,255},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
-          if dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          lineThickness=0.5),
-        Ellipse(
-          extent={{-80,42},{80,92}},
-          lineColor={28,108,200},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{0,40},{0,92}},
-          color={28,108,200},
-          thickness=1),
-        Line(points={{0,38},{0,92}}, color={255,255,255}),
-        Rectangle(
-          extent={{-80,-14},{80,68}},
-          lineColor={28,108,200},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-79,68},{80,68}}, color={255,255,255}),
-        Line(points={{80,60},{100,60},{100,90}}, color={255,255,255})}),
-                            Diagram(graphics={
-        Ellipse(
-          extent={{-80,-92},{80,-42}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-80,-14},{80,-68}},
-          lineColor={85,170,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-80,42},{80,92}},
-          lineColor={28,108,200},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{0,40},{0,92}},
-          color={28,108,200},
-          thickness=1),
-        Line(points={{0,38},{0,92}}, color={255,255,255}),
-        Rectangle(
-          extent={{-80,-14},{80,68}},
-          lineColor={28,108,200},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-79,68},{80,68}}, color={255,255,255}),
-        Text(
-          extent={{58,4},{58,-10}},
-          lineColor={0,0,255},
-          textString=
-               "Niveau"),
-        Line(
-          points={{100,90},{100,60},{80,60},{80,60}},
-          color={28,108,200},
-          thickness=1),
-        Line(points={{80,60},{100,60},{100,90}}, color={255,255,255})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end Pressurizer;
+within ThermoSysPro.Fluid.Volumes;
+model Pressurizer "Pressurizer"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Units.SI.Volume V=61.1 "Pressurizer volume";
+  parameter Units.SI.Radius Rp=1.265 "Pressurizer cross-sectional radius";
+  parameter Units.SI.Area Ae=1 "Wall surface";
+  parameter Units.SI.Position Zm=10.15 "Hauteur de la gamme de mesure niveau";
+  parameter Real Ccond=0.1 "Condensation coefficient";
+  parameter Real Cevap=0.1 "Evaporation coefficient";
+  parameter Units.SI.CoefficientOfHeatTransfer Klv=0.5e6
+    "Heat exchange coefficient between the liquid and gas phases";
+  parameter Units.SI.CoefficientOfHeatTransfer Klp=50000
+    "Heat exchange coefficient between the liquid phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kvp=25
+    "Heat exchange coefficient between the gas phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kpa=542
+    "Heat exchange coefficient between the wall and the outside";
+  parameter Units.SI.Mass Mp=117e3 "Wall mass";
+  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Yw0=50
+    "Initial water level - percent of the measure scale level (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0=155e5
+    "Initial fluid pressure (active if steady_state=false)" annotation (
+      Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Real pi=Modelica.Constants.pi "Pi";
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Units.SI.Area Ap=pi*Rp*Rp "Pressurizer cross-sectional area";
+
+public
+  Units.SI.Area Slpin "Exchange surface between the liquid and the wall";
+  Units.SI.Area Svpin "Exchange surface between the vapor and the wall";
+  Real Yw(start=50) "Liquid level as a percent of the measure scale";
+  Real y(start=0.5) "Liquid level as a proportion of the measure scale";
+  Units.SI.Position Zl(start=20) "Liquid level in the pressurizer";
+  Units.SI.Volume Vl "Liquid phase volume";
+  Units.SI.Volume Vv "Gas phase volume";
+  Units.SI.AbsolutePressure P(start=155.0e5) "Average fluid pressure";
+  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the drum";
+  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hls "Liquid phase saturation specific enthalpy";
+  Units.SI.SpecificEnthalpy hvs "Gas phase saturation specific enthalpy";
+  Units.SI.Temperature Tl "Liquid phase temperature";
+  Units.SI.Temperature Tv "Gas phase temperature";
+  Units.SI.Temperature Tp(start=617.24) "Wall temperature";
+  Units.SI.Temperature Ta "External temperature";
+  Units.SI.Power Wlv
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  Units.SI.Power Wpl
+    "Thermal power exchanged from the liquid phase to the wall";
+  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
+  Units.SI.Power Wpa "Thermal power exchanged from the outside to the wall";
+  Units.SI.Power Wch "Power released by the electrical heaters";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phase";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Vapor phase density";
+  FluidType fluids[4] "Fluids mixing in volume";
+  Units.SI.Power Jas "Thermal power diffusion from inlet Cas";
+  Units.SI.Power Jex "Thermal power diffusion from outlet Cex";
+  Units.SI.Power Js "Thermal power diffusion from outlet Cs";
+  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
+  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
+  Units.SI.MassFlowRate gamma_as "Diffusion conductance for inlet Cas";
+  Units.SI.MassFlowRate gamma_ex "Diffusion conductance for outlet Cex";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet Cs";
+  Real ras "Value of r(Q/gamma) for inlet Cas";
+  Real rex "Value of r(Q/gamma) for outlet Cex";
+  Real rs "Value of r(Q/gamma) for outlet Cs";
+
+  Interfaces.Connectors.FluidInlet Cas "Water input" annotation (Placement(
+        transformation(extent={{-8,92},{8,108}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cs "Steam output" annotation (Placement(
+        transformation(extent={{92,90},{108,106}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Ca "Thermal input to the wall"
+    annotation (Placement(transformation(extent={{-100,-8},{-80,12}}, rotation=
+            0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cc "Thermal input to the liquid"
+    annotation (Placement(transformation(extent={{-10,-42},{10,-22}}, rotation=
+            0)));
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"
+    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cex "Water output" annotation (Placement(
+        transformation(extent={{-8,-108},{8,-92}}, rotation=0)));
+  Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{16,44},{56,84}}, rotation=0)));
+  Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-54,44},{-14,84}}, rotation=0)));
+  Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-54,4},{-14,44}}, rotation=0)));
+  Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{16,4},{56,44}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      der(P) = 0;
+      der(hl) = 0;
+      der(hv) = 0;
+      der(y) = 0;
+      der(Tp) = 0;
+    else
+      P = P0;
+      hl = hls;
+      hv = hvs;
+      Yw = Yw0;
+      der(Tp) = 0;
+    end if;
+  end if;
+
+equation
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Cas.ftype;
+  fluids[3] = Cex.ftype;
+  fluids[4] = Cs.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "Pressurizer: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Cas) == 0) then
+    Cas.Q = 0;
+    Cas.h = 1.e5;
+    Cas.h_vol_1 = 1.e5;
+    Cas.diff_res_1 = 0;
+    Cas.diff_on_1 = false;
+    Cas.ftype = ftype;
+    Cas.Xco2 = 0;
+    Cas.Xh2o = 0;
+    Cas.Xo2 = 0;
+    Cas.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cex) == 0) then
+    Cex.Q = 0;
+    Cex.h_vol_2 = 1.e5;
+    Cex.diff_res_2 = 0;
+    Cex.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h_vol_2 = 1.e5;
+    Cs.diff_res_2 = 0;
+    Cs.diff_on_2 = false;
+  end if;
+
+  Ca.W = Wpa;
+  Ca.T = Ta;
+
+  Cc.W = Wch;
+  Cc.T = Tl;
+
+  yLevel.signal = Yw;
+
+  /* Computation of the geometrical variables */
+  Yw = 100*y;
+  Zl = Zm*y + 0.5*(V/Ap - Zm);
+  Vl = Ap*Zl;
+  Vv = V - Vl;
+  Slpin = Zl*2*pi*Rp;
+  Svpin = (V/Ap - Zl)*2*pi*Rp;
+
+  /* Pressure in the expansion line */
+  Pfond = P + g*(Vl*rhol + Vv*rhov)/Ap;
+
+  /* Liquid phase mass balance equation */
+  BQl = Cas.Q - Cex.Q + Qcond - Qevap;
+
+  if dynamic_energy_balance then
+    rhol*Ap*Zm*der(y) + Vl*prol.ddph*der(P) + Vl*prol.ddhp*der(hl) = BQl;
+  else
+    0 = BQl;
+  end if;
+
+  /* Gas phase mass balance equation */
+  BQv = Qevap - Cs.Q - Qcond;
+
+  if dynamic_energy_balance then
+    -rhov*Ap*Zm*der(y) + Vv*prov.ddph*der(P) + Vv*prov.ddhp*der(hv) = BQv;
+  else
+    0 = BQv;
+  end if;
+
+  /* Condensation and evaporation mass flows */
+  Qevap = Cevap*rhol*Vl*(hl - hls)/(hvs - hls);
+  Qcond = Ccond*rhov*Vv*(hvs - hv)/(hvs - hls);
+
+  Cas.P = P;
+  Cs.P = P;
+  Cex.P = Pfond;
+
+  /* Liquid phase energy balance equation */
+  BHl = (Qcond + Cas.Q)*(hls - hl) - Qevap*(hvs - hl) - Cex.Q*(Cex.h - hl) - Wpl + Wlv + Wch + Jt_l;
+
+  if dynamic_energy_balance then
+    rhol*Vl*der(hl) - Vl*der(P) = BHl;
+  else
+    0 = BHl;
+  end if;
+
+  /* Gas phase energy balance equation */
+  BHv = Qevap*(hvs - hv) - Qcond*(hls - hv) - Cas.Q*(hls - Cas.h) - Wpv - Wlv - Cs.Q*(Cs.h - hv) + Jt_v;
+
+  if dynamic_energy_balance then
+    rhov*Vv*der(hv) - Vv*der(P) = BHv;
+  else
+    0 = BHv;
+  end if;
+
+  Cas.h_vol_2 = hl;
+  Cs.h_vol_1 = hv;
+  Cex.h_vol_1 = hl;
+
+  /* Energy balance equation at the wall */
+  if dynamic_energy_balance then
+    Mp*cpp*der(Tp) = Wpl + Wpv + Wpa;
+  else
+    0 = Wpl + Wpv + Wpa;
+  end if;
+
+  /* Heat exchange between liquid and gas phases */
+  Wlv = Klv*Ap*(Tv - Tl);
+
+  /* Heat exchange between the liquid phase and the wall */
+  Wpl = Klp*Slpin*(Tl - Tp);
+
+  /* Heat exchange between the gas phase and the wall */
+  Wpv = Kvp*Svpin*(Tv - Tp);
+
+  /* Heat exchange between the wall and the outside */
+  Wpa = Kpa*Ae*(Ta - Tp);
+
+  /* Fluid composition (no balance equations) */
+  Cex.ftype = ftype;
+  Cs.ftype = ftype;
+
+  Cs.Xco2 = 0;
+  Cs.Xh2o = 0;
+  Cs.Xo2  = 0;
+  Cs.Xso2 = 0;
+
+  Cex.Xco2 = 0;
+  Cex.Xh2o = 0;
+  Cex.Xo2  = 0;
+  Cex.Xso2 = 0;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1);
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+  else
+    Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2;
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    ras = if Cas.diff_on_1 then exp(-0.033*(Cas.Q*Cas.diff_res_1)^2) else 0;
+    rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+
+    gamma_as = if Cas.diff_on_1 then 1/Cas.diff_res_1 else gamma0;
+    gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+
+    Jas = if Cas.diff_on_1 then ras*gamma_as*(Cas.h_vol_1 - Cas.h_vol_2) else 0;
+    Jex = if Cex.diff_on_2 then rex*gamma_ex*(Cex.h_vol_2 - Cex.h_vol_1) else 0;
+    Js = if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+  else
+    ras = 0;
+    rex = 0;
+    rs = 0;
+
+    gamma_as = gamma0;
+    gamma_ex = gamma0;
+    gamma_s = gamma0;
+
+    Jas = 0;
+    Jex = 0;
+    Js = 0;
+  end if;
+
+  Jt_l = Jas + Jex;
+  Jt_v = Js;
+
+  Cas.diff_res_2 = 0;
+  Cex.diff_res_1 = 0;
+  Cs.diff_res_1 = 0;
+
+  Cas.diff_on_2 = diffusion;
+  Cex.diff_on_1 = diffusion;
+  Cs.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  prol = ThermoSysPro.Properties.Fluid.Ph(P, hl,0,fluid);
+  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv,0,fluid);
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid);
+
+  Tl = prol.T;
+  Tv = prov.T;
+  rhol = prol.d;
+  rhov = prov.d;
+  hls = lsat.h;
+  hvs = vsat.h;
+
+  annotation (Icon(graphics={
+        Line(
+          points={{100,90},{100,60},{80,60},{80,60}},
+          color={28,108,200},
+          thickness=1),
+        Ellipse(
+          extent={{-80,-92},{80,-42}},
+          lineColor={85,170,255},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Sphere,
+          if dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          lineThickness=0.5),
+        Rectangle(
+          extent={{-80,-14},{80,-68}},
+          lineColor={85,170,255},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.VerticalCylinder,
+          if dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          lineThickness=0.5),
+        Ellipse(
+          extent={{-80,42},{80,92}},
+          lineColor={28,108,200},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{0,40},{0,92}},
+          color={28,108,200},
+          thickness=1),
+        Line(points={{0,38},{0,92}}, color={255,255,255}),
+        Rectangle(
+          extent={{-80,-14},{80,68}},
+          lineColor={28,108,200},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-79,68},{80,68}}, color={255,255,255}),
+        Line(points={{80,60},{100,60},{100,90}}, color={255,255,255})}),
+                            Diagram(graphics={
+        Ellipse(
+          extent={{-80,-92},{80,-42}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-80,-14},{80,-68}},
+          lineColor={85,170,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-80,42},{80,92}},
+          lineColor={28,108,200},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{0,40},{0,92}},
+          color={28,108,200},
+          thickness=1),
+        Line(points={{0,38},{0,92}}, color={255,255,255}),
+        Rectangle(
+          extent={{-80,-14},{80,68}},
+          lineColor={28,108,200},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-79,68},{80,68}}, color={255,255,255}),
+        Text(
+          extent={{58,4},{58,-10}},
+          lineColor={0,0,255},
+          textString=
+               "Niveau"),
+        Line(
+          points={{100,90},{100,60},{80,60},{80,60}},
+          color={28,108,200},
+          thickness=1),
+        Line(points={{80,60},{100,60},{100,90}}, color={255,255,255})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end Pressurizer;
diff --git a/ThermoSysPro/Fluid/Volumes/Tank.mo b/ThermoSysPro/Fluid/Volumes/Tank.mo
index 227a44c0f761220e6ef5b18fbdf34170fa3d92b2..526847667dd6bfacc9988bfa4b36399c840f2202 100644
--- a/ThermoSysPro/Fluid/Volumes/Tank.mo
+++ b/ThermoSysPro/Fluid/Volumes/Tank.mo
@@ -1,452 +1,452 @@
-within ThermoSysPro.Fluid.Volumes;
-model Tank "Open vertical tank"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.AbsolutePressure Patm=1.013e5
-    "Pressure above the fluid level";
-  parameter Units.SI.Area A=1 "Tank cross sectional area";
-  parameter Units.SI.Position ze1=40 "Altitude of inlet 1";
-  parameter Units.SI.Position ze2=de2/2 "Altitude of inlet 2";
-  parameter Units.SI.Position zs1=40 "Altitude of outlet 1";
-  parameter Units.SI.Position zs2=ds2/2 "Altitude of outlet 2";
-  parameter Units.SI.Diameter de1=0.20 "Diameter of inlet 1";
-  parameter Units.SI.Diameter de2=0.20 "Diameter of inlet 2";
-  parameter Units.SI.Diameter ds1=0.20 "Diameter of outlet 1";
-  parameter Units.SI.Diameter ds2=0.20 "Diameter of outlet 2";
-  parameter Real ke1=1 "Pressure loss coefficient for inlet e1";
-  parameter Real ke2=1 "Pressure loss coefficient for inlet e2";
-  parameter Real ks1=1 "Pressure loss coefficient for outlet s1";
-  parameter Real ks2=1 "Pressure loss coefficient for outlet s2";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=false
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.SpecificEnthalpy h0=1.e5
-    "Initial fluid specific enthalpy (active if steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean steady_state_mech=false
-    "true: start from steady state - false: start from z0";
-  parameter Units.SI.Position z0=30
-    "Initial fluid level (active if steady_state_mech=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state_mech));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Real eps=1.e-0 "Small number for the square function";
-  parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level";
-  parameter Real pi=Modelica.Constants.pi;
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Position z "Fluid level";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  ThermoSysPro.Units.SI.PressureDifference deltaP_e1 "Presure loss for e1";
-  ThermoSysPro.Units.SI.PressureDifference deltaP_e2 "Presure loss for e2";
-  ThermoSysPro.Units.SI.PressureDifference deltaP_s1 "Presure loss for s1";
-  ThermoSysPro.Units.SI.PressureDifference deltaP_s2 "Presure loss for s2";
-  Real omega_e1;
-  Real omega_e2;
-  Real omega_s1;
-  Real omega_s2;
-  Units.SI.Angle theta_e1;
-  Units.SI.Angle theta_e2;
-  Units.SI.Angle theta_s1;
-  Units.SI.Angle theta_s2;
-  Units.SI.DerDensityByPressure ddph "density derivative by pressure";
-  Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"                        annotation (Placement(transformation(
-          extent={{100,10},{120,30}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,50},{-90,70}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{90,-70},{110,-50}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-110,-70},{-90,-50}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{92,50},{112,70}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if steady_state_mech then
-    der(z) = 0;
-  else
-    z = z0;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that cross-sectional area is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(A > 0, "Cross-sectional area is non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Cs1.ftype;
-  fluids[5] = Cs2.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "Tank: fluids mixing in volume are not compatible with each other");
-
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    A*(ddph*der(P) + ddhp*der(h - Xh2o*hr))*z + A*rho*der(z) = BQ;
-  else
-    A*rho*der(z) = BQ;
-  end if;
-
-  /* Pressure at each inlet and outlet */
-  theta_e1 = if (z > ze1 + de1/2) then pi/2
-             else if (z < ze1 - de1/2) then -pi/2
-             else asin((z - ze1)/de1/2);
-
-  theta_e2 = if (z > ze2 + de2/2) then pi/2
-             else if (z < ze2 - de2/2) then -pi/2
-             else asin((z - ze2)/de2/2);
-
-  theta_s1 = if (z > zs1 + ds1/2) then pi/2
-             else if (z < zs1 - ds1/2) then -pi/2
-             else asin((z - zs1)/ds1/2);
-
-  theta_s2 = if (z > zs2 + ds2/2) then pi/2
-             else if (z < zs2 - ds2/2) then -pi/2
-             else asin((z - zs2)/ds2/2);
-
-  omega_e1 = if (Ce1.Q >= 0) then 1 else (pi + 2*theta_e1 + sin(2*theta_e1))/2/pi;
-  omega_e2 = if (Ce2.Q >= 0) then 1 else (pi + 2*theta_e2 + sin(2*theta_e2))/2/pi;
-  omega_s1 = if (Cs1.Q <= 0) then 1 else (pi + 2*theta_s1 + sin(2*theta_s1))/2/pi;
-  omega_s2 = if (Cs2.Q <= 0) then 1 else (pi + 2*theta_s2 + sin(2*theta_s2))/2/pi;
-
-  deltaP_e1 = Ce1.P - (Patm + rho*g*max(z - ze1, 0));
-  deltaP_e2 = Ce2.P - (Patm + rho*g*max(z - ze2, 0));
-  deltaP_s1 = Patm + rho*g*max(z - zs1, 0) - Cs1.P;
-  deltaP_s2 = Patm + rho*g*max(z - zs2, 0) - Cs2.P;
-
-  deltaP_e1*omega_e1^2 = ke1*ThermoSysPro.Functions.ThermoSquare(Ce1.Q, eps)/2/rho;
-  deltaP_e2*omega_e2^2 = ke2*ThermoSysPro.Functions.ThermoSquare(Ce2.Q, eps)/2/rho;
-  deltaP_s1*omega_s1^2 = ks1*ThermoSysPro.Functions.ThermoSquare(Cs1.Q, eps)/2/rho;
-  deltaP_s2*omega_s2^2 = ks2*ThermoSysPro.Functions.ThermoSquare(Cs2.Q, eps)/2/rho;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*((Ce1.h - Ce1.Xh2o*hr) - (h - Xh2o*hr)) + Ce2.Q*((Ce2.h - Ce2.Xh2o*hr) - (h - Xh2o*hr)) - Cs1.Q*((Cs1.h - Cs1.Xh2o*hr) - (h - Xh2o*hr)) - Cs2.Q*((Cs2.h - Cs2.Xh2o*hr) - (h - Xh2o*hr)) + Cth.W + J;
-
-  if dynamic_energy_balance then
-    if z > zmin then
-      if dynamic_mass_balance then
-        A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-      else
-        A*z*rho*der(h - Xh2o*hr) = BH;
-      end if;
-    else
-      der(h - Xh2o*hr) = 0;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-
-  Cth.T = T;
-
-  /* Fluid level sensor */
-  yLevel.signal = z;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      A*z*rho*der(Xco2) + Xco2*BQ = BXco2;
-      A*z*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      A*z*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      A*z*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    rs1 = 0;
-    rs2 = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Js1 = 0;
-    Js2 = 0;
-  end if;
-
-  J = Je1 + Je2 + Js1 + Js2;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  P = Patm + rho*g*z/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-  end if;
-
-  if dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={           Rectangle(extent={{-100,100},{100,20}}),
-                               Rectangle(
-          extent={{-100,20},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static))}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(extent={{-100,100},{100,20}},
-            lineColor={28,108,200}),
-                               Rectangle(
-          extent={{-100,20},{100,-100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255})}),
-    Window(
-      x=0.16,
-      y=0.03,
-      width=0.81,
-      height=0.9),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</h4>
-<p><b>ThermoSysPro Version 4.0</h4>
-<p>This component model is documented in Sect. 14.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Tank;
+within ThermoSysPro.Fluid.Volumes;
+model Tank "Open vertical tank"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.AbsolutePressure Patm=1.013e5
+    "Pressure above the fluid level";
+  parameter Units.SI.Area A=1 "Tank cross sectional area";
+  parameter Units.SI.Position ze1=40 "Altitude of inlet 1";
+  parameter Units.SI.Position ze2=de2/2 "Altitude of inlet 2";
+  parameter Units.SI.Position zs1=40 "Altitude of outlet 1";
+  parameter Units.SI.Position zs2=ds2/2 "Altitude of outlet 2";
+  parameter Units.SI.Diameter de1=0.20 "Diameter of inlet 1";
+  parameter Units.SI.Diameter de2=0.20 "Diameter of inlet 2";
+  parameter Units.SI.Diameter ds1=0.20 "Diameter of outlet 1";
+  parameter Units.SI.Diameter ds2=0.20 "Diameter of outlet 2";
+  parameter Real ke1=1 "Pressure loss coefficient for inlet e1";
+  parameter Real ke2=1 "Pressure loss coefficient for inlet e2";
+  parameter Real ks1=1 "Pressure loss coefficient for outlet s1";
+  parameter Real ks2=1 "Pressure loss coefficient for outlet s2";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=false
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.SpecificEnthalpy h0=1.e5
+    "Initial fluid specific enthalpy (active if steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean steady_state_mech=false
+    "true: start from steady state - false: start from z0";
+  parameter Units.SI.Position z0=30
+    "Initial fluid level (active if steady_state_mech=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state_mech));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Real eps=1.e-0 "Small number for the square function";
+  parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level";
+  parameter Real pi=Modelica.Constants.pi;
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Position z "Fluid level";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  ThermoSysPro.Units.SI.PressureDifference deltaP_e1 "Presure loss for e1";
+  ThermoSysPro.Units.SI.PressureDifference deltaP_e2 "Presure loss for e2";
+  ThermoSysPro.Units.SI.PressureDifference deltaP_s1 "Presure loss for s1";
+  ThermoSysPro.Units.SI.PressureDifference deltaP_s2 "Presure loss for s2";
+  Real omega_e1;
+  Real omega_e2;
+  Real omega_s1;
+  Real omega_s2;
+  Units.SI.Angle theta_e1;
+  Units.SI.Angle theta_e2;
+  Units.SI.Angle theta_s1;
+  Units.SI.Angle theta_s2;
+  Units.SI.DerDensityByPressure ddph "density derivative by pressure";
+  Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"                        annotation (Placement(transformation(
+          extent={{100,10},{120,30}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,50},{-90,70}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{90,-70},{110,-50}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-110,-70},{-90,-50}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{92,50},{112,70}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if steady_state_mech then
+    der(z) = 0;
+  else
+    z = z0;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that cross-sectional area is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(A > 0, "Cross-sectional area is non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Cs1.ftype;
+  fluids[5] = Cs2.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "Tank: fluids mixing in volume are not compatible with each other");
+
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    A*(ddph*der(P) + ddhp*der(h - Xh2o*hr))*z + A*rho*der(z) = BQ;
+  else
+    A*rho*der(z) = BQ;
+  end if;
+
+  /* Pressure at each inlet and outlet */
+  theta_e1 = if (z > ze1 + de1/2) then pi/2
+             else if (z < ze1 - de1/2) then -pi/2
+             else asin((z - ze1)/de1/2);
+
+  theta_e2 = if (z > ze2 + de2/2) then pi/2
+             else if (z < ze2 - de2/2) then -pi/2
+             else asin((z - ze2)/de2/2);
+
+  theta_s1 = if (z > zs1 + ds1/2) then pi/2
+             else if (z < zs1 - ds1/2) then -pi/2
+             else asin((z - zs1)/ds1/2);
+
+  theta_s2 = if (z > zs2 + ds2/2) then pi/2
+             else if (z < zs2 - ds2/2) then -pi/2
+             else asin((z - zs2)/ds2/2);
+
+  omega_e1 = if (Ce1.Q >= 0) then 1 else (pi + 2*theta_e1 + sin(2*theta_e1))/2/pi;
+  omega_e2 = if (Ce2.Q >= 0) then 1 else (pi + 2*theta_e2 + sin(2*theta_e2))/2/pi;
+  omega_s1 = if (Cs1.Q <= 0) then 1 else (pi + 2*theta_s1 + sin(2*theta_s1))/2/pi;
+  omega_s2 = if (Cs2.Q <= 0) then 1 else (pi + 2*theta_s2 + sin(2*theta_s2))/2/pi;
+
+  deltaP_e1 = Ce1.P - (Patm + rho*g*max(z - ze1, 0));
+  deltaP_e2 = Ce2.P - (Patm + rho*g*max(z - ze2, 0));
+  deltaP_s1 = Patm + rho*g*max(z - zs1, 0) - Cs1.P;
+  deltaP_s2 = Patm + rho*g*max(z - zs2, 0) - Cs2.P;
+
+  deltaP_e1*omega_e1^2 = ke1*ThermoSysPro.Functions.ThermoSquare(Ce1.Q, eps)/2/rho;
+  deltaP_e2*omega_e2^2 = ke2*ThermoSysPro.Functions.ThermoSquare(Ce2.Q, eps)/2/rho;
+  deltaP_s1*omega_s1^2 = ks1*ThermoSysPro.Functions.ThermoSquare(Cs1.Q, eps)/2/rho;
+  deltaP_s2*omega_s2^2 = ks2*ThermoSysPro.Functions.ThermoSquare(Cs2.Q, eps)/2/rho;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*((Ce1.h - Ce1.Xh2o*hr) - (h - Xh2o*hr)) + Ce2.Q*((Ce2.h - Ce2.Xh2o*hr) - (h - Xh2o*hr)) - Cs1.Q*((Cs1.h - Cs1.Xh2o*hr) - (h - Xh2o*hr)) - Cs2.Q*((Cs2.h - Cs2.Xh2o*hr) - (h - Xh2o*hr)) + Cth.W + J;
+
+  if dynamic_energy_balance then
+    if z > zmin then
+      if dynamic_mass_balance then
+        A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+      else
+        A*z*rho*der(h - Xh2o*hr) = BH;
+      end if;
+    else
+      der(h - Xh2o*hr) = 0;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+
+  Cth.T = T;
+
+  /* Fluid level sensor */
+  yLevel.signal = z;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      A*z*rho*der(Xco2) + Xco2*BQ = BXco2;
+      A*z*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      A*z*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      A*z*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    rs1 = 0;
+    rs2 = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Js1 = 0;
+    Js2 = 0;
+  end if;
+
+  J = Je1 + Je2 + Js1 + Js2;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  P = Patm + rho*g*z/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+  end if;
+
+  if dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={           Rectangle(extent={{-100,100},{100,20}}),
+                               Rectangle(
+          extent={{-100,20},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static))}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(extent={{-100,100},{100,20}},
+            lineColor={28,108,200}),
+                               Rectangle(
+          extent={{-100,20},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255})}),
+    Window(
+      x=0.16,
+      y=0.03,
+      width=0.81,
+      height=0.9),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</h4>
+<p><b>ThermoSysPro Version 4.0</h4>
+<p>This component model is documented in Sect. 14.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Tank;
diff --git a/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo b/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo
index f750ff678140cb580f081929e7859eacf964e73e..963a30f85e96f153d565e311a91917c87485db2d 100644
--- a/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo
+++ b/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo
@@ -1,545 +1,545 @@
-within ThermoSysPro.Fluid.Volumes;
-model TankHorizontal "Open horizontal tank"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Units.SI.AbsolutePressure Patm=1.013e5
-    "Pressure above the fluid level";
-  parameter Units.SI.Radius R=1 "Radius of the tank cross-sectional area";
-  parameter Units.SI.Length L=10 "Tank equivalentlength";
-  parameter Units.SI.Position ze1=2*R "Altitude of inlet 1";
-  parameter Units.SI.Position ze2=0 "Altitude of inlet 2";
-  parameter Units.SI.Position zs1=2*R "Altitude of outlet 1";
-  parameter Units.SI.Position zs2=0 "Altitude of outlet 2";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ke1=1
-    "Pressure loss coefficient for inlet e1";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ke2=1
-    "Pressure loss coefficient for inlet e2";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ks1=1
-    "Pressure loss coefficient for outlet s1";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ks2=1
-    "Pressure loss coefficient for outlet s2";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=false
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.SpecificEnthalpy h0=1.e5
-    "Initial fluid specific enthalpy (active if steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean steady_state_mech=false
-    "true: start from steady state - false: start from z0";
-  parameter Units.SI.Position z0=2*R
-    "Initial fluid level (active if steady_state_mech=false)"
-    annotation (Evaluate=true, Dialog(enable=not steady_state_mech));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Units.SI.Thickness e=0.25 "Inlet/outlet thickness";
-  parameter Real eps=1.e-0 "Small number for ths square function";
-  parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Position z "Fluid level";
-  Units.SI.Area A "Surface of the liquid in the tank";
-  Units.SI.Angle theta "Angle";
-  Units.SI.Area Aw "Wall area = Wall surface on contact with the outside";
-  Units.SI.Area Al "Cross section area of the liquid in the tank";
-  Units.SI.Area Alw "Liquid surface on contact with the wall";
-  Units.SI.Volume Vl(start=1) "Fluid volume";
-  Units.SI.Volume V(start=1) "Tank volume";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Real Oe1;
-  Real Oe2;
-  Real Os1;
-  Real Os2;
-  Units.SI.DerDensityByPressure ddph "density derivative by pressure";
-  Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"                        annotation (Placement(transformation(
-          extent={{102,-9},{122,11}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,40},{-90,60}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{90,-60},{110,-40}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-110,-60},{-90,-40}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{92,39},{112,59}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if steady_state_mech then
-    der(z) = 0;
-  else
-    z = z0;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Cs1.ftype;
-  fluids[5] = Cs2.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "TankHorizontal: fluids mixing in volume are not compatible with each other");
-
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  /* Geometry: horizontal cylinder */
-  Aw = 2*pi*R*L + 2*pi*R^2;
-  theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - z)/R)));
-  Al = (pi/2 - theta)*R^2 - R*(R - z)*Modelica.Math.cos(theta);
-  A = 2*R*Modelica.Math.cos(theta)*L;
-  Alw = (pi - 2*theta)*R*L + 2*Al;
-
-  /* Fluid and tank volume */
-  Vl = Al*L;
-  V = pi*R^2*L;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    A*(ddph*der(P) + ddhp*der(h - Xh2o*hr))*z + A*rho*der(z) = BQ;
-  else
-    A*rho*der(z) = BQ;
-  end if;
-
-  /* Fluid pressure at the inlets and outlets */
-  if (cardinality(Ce1) == 0) then
-    Ce1.P = Patm + rho*g*max(z - ze1, 0);
-    Oe1 = 0;
-  else
-    (Ce1.P - (Patm + rho*g*max(z - ze1, 0)))*Oe1 = ke1*ThermoSysPro.Functions.ThermoSquare(Ce1.Q, eps)/2/rho;
-    Oe1 = if ((Ce1.Q >= 0) or (z > ze1 + e)) then 1 else if (z < ze1) then 0 else (z - ze1)/e;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.P = Patm + rho*g*max(z - ze2, 0);
-    Oe2 = 0;
-  else
-    (Ce2.P - (Patm + rho*g*max(z - ze2, 0)))*Oe2 = ke2*ThermoSysPro.Functions.ThermoSquare(Ce2.Q, eps)/2/rho;
-    Oe2 = if ((Ce2.Q >= 0) or (z > ze2 + e)) then 1 else if (z < ze2) then 0 else (z - ze2)/e;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.P = Patm + rho*g*max(z - zs1, 0);
-    Os1 = 0;
-  else
-    (Patm + rho*g*max(z - zs1, 0) - Cs1.P)*Os1 = ks1*ThermoSysPro.Functions.ThermoSquare(Cs1.Q, eps)/2/rho;
-    Os1 = if ((Cs1.Q <= 0) or (z > zs1 + e)) then 1 else if (z < zs1) then 0 else (z - zs1)/e;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.P = Patm + rho*g*max(z - zs2, 0);
-    Os2 = 0;
-  else
-    (Patm + rho*g*max(z - zs2, 0) - Cs2.P)*Os2 = ks2*ThermoSysPro.Functions.ThermoSquare(Cs2.Q, eps)/2/rho;
-    Os2 = if ((Cs2.Q <= 0) or (z > zs2 + e)) then 1 else if (z < zs2) then 0 else (z - zs2)/e;
-  end if;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*((Ce1.h - Ce1.Xh2o*hr) - (h - Xh2o*hr)) + Ce2.Q*((Ce2.h - Ce2.Xh2o*hr) - (h - Xh2o*hr)) - Cs1.Q*((Cs1.h - Cs1.Xh2o*hr) - (h - Xh2o*hr)) - Cs2.Q*((Cs2.h - Cs2.Xh2o*hr) - (h - Xh2o*hr)) + Cth.W + J;
-
-  if dynamic_energy_balance then
-    if z > zmin then
-      if dynamic_mass_balance then
-        A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-      else
-        A*z*rho*der(h - Xh2o*hr) = BH;
-      end if;
-    else
-      der(h - Xh2o*hr) = 0;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-
-  Cth.T = T;
-
-  /* Fluid level sensor */
-  yLevel.signal = z;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      A*z*rho*der(Xco2) + Xco2*BQ = BXco2;
-      A*z*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      A*z*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      A*z*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    rs1 = 0;
-    rs2 = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Js1 = 0;
-    Js2 = 0;
-  end if;
-
-  J = Je1 + Je2 + Js1 + Js2;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  P = Patm + rho*g*z/2;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P,h,fluid,mode,Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P,h,fluid,mode,Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-  end if;
-
-  if dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-100,40},{-52,-40}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Ellipse(
-          extent={{58,40},{100,-40}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Rectangle(
-          extent={{-78,40},{79,-40}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
-          else FillPattern.Solid),
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Line(
-          points={{-100,-18},{102,-18}},
-          color={255,255,0},
-          pattern=LinePattern.Dot,
-          thickness=0.5),
-        Line(
-          points={{-91,-32},{91,-32}},
-          color={255,255,0},
-          pattern=LinePattern.Dot,
-          thickness=0.5),
-        Line(points={{-90,50},{-60,50},{-20,40}}),
-        Line(points={{92,50},{60,50},{20,40}}),
-        Line(points={{-90,-50},{-60,-50},{-20,-40}}),
-        Line(points={{92,-50},{60,-50},{20,-40}}),
-        Line(
-          points={{-101,-1},{101,-1}},
-          color={255,255,0},
-          pattern=LinePattern.Dot,
-          thickness=0.5)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-100,40},{-46,-40}},
-          lineColor={0,0,0},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255}),
-        Ellipse(
-          extent={{50,40},{104,-40}},
-          lineColor={0,0,0},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255}),
-        Rectangle(
-          extent={{-76,40},{81,-40}},
-          lineColor={0,0,0},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255}),
-        Line(
-          points={{-98,12},{102,12}},
-          color={255,255,0},
-          pattern=LinePattern.Dash,
-          thickness=1),
-        Line(
-          points={{-98,3},{104,3}},
-          color={255,255,0},
-          pattern=LinePattern.Dash,
-          thickness=1),
-        Line(
-          points={{-98,-6},{104,-6}},
-          color={255,255,0},
-          pattern=LinePattern.Dash,
-          thickness=1),
-        Line(
-          points={{-97,-15},{101,-15}},
-          color={255,255,0},
-          pattern=LinePattern.Dash,
-          thickness=1),
-        Line(
-          points={{-94,-24},{98,-24}},
-          color={255,255,0},
-          pattern=LinePattern.Dash,
-          thickness=1),
-        Line(
-          points={{-89,-32},{93,-32}},
-          color={255,255,0},
-          pattern=LinePattern.Dash,
-          thickness=1),
-        Line(points={{-90,50},{-60,50},{-20,40}}),
-        Line(points={{92,50},{60,50},{20,40}}),
-        Line(points={{-90,-50},{-60,-50},{-20,-40}}),
-        Line(points={{92,-50},{60,-50},{20,-40}})}),
-    Window(
-      x=0.16,
-      y=0.03,
-      width=0.81,
-      height=0.9),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end TankHorizontal;
+within ThermoSysPro.Fluid.Volumes;
+model TankHorizontal "Open horizontal tank"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Units.SI.AbsolutePressure Patm=1.013e5
+    "Pressure above the fluid level";
+  parameter Units.SI.Radius R=1 "Radius of the tank cross-sectional area";
+  parameter Units.SI.Length L=10 "Tank equivalentlength";
+  parameter Units.SI.Position ze1=2*R "Altitude of inlet 1";
+  parameter Units.SI.Position ze2=0 "Altitude of inlet 2";
+  parameter Units.SI.Position zs1=2*R "Altitude of outlet 1";
+  parameter Units.SI.Position zs2=0 "Altitude of outlet 2";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ke1=1
+    "Pressure loss coefficient for inlet e1";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ke2=1
+    "Pressure loss coefficient for inlet e2";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ks1=1
+    "Pressure loss coefficient for outlet s1";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ks2=1
+    "Pressure loss coefficient for outlet s2";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=false
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.SpecificEnthalpy h0=1.e5
+    "Initial fluid specific enthalpy (active if steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean steady_state_mech=false
+    "true: start from steady state - false: start from z0";
+  parameter Units.SI.Position z0=2*R
+    "Initial fluid level (active if steady_state_mech=false)"
+    annotation (Evaluate=true, Dialog(enable=not steady_state_mech));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Units.SI.Thickness e=0.25 "Inlet/outlet thickness";
+  parameter Real eps=1.e-0 "Small number for ths square function";
+  parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Position z "Fluid level";
+  Units.SI.Area A "Surface of the liquid in the tank";
+  Units.SI.Angle theta "Angle";
+  Units.SI.Area Aw "Wall area = Wall surface on contact with the outside";
+  Units.SI.Area Al "Cross section area of the liquid in the tank";
+  Units.SI.Area Alw "Liquid surface on contact with the wall";
+  Units.SI.Volume Vl(start=1) "Fluid volume";
+  Units.SI.Volume V(start=1) "Tank volume";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Real Oe1;
+  Real Oe2;
+  Real Os1;
+  Real Os2;
+  Units.SI.DerDensityByPressure ddph "density derivative by pressure";
+  Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"                        annotation (Placement(transformation(
+          extent={{102,-9},{122,11}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,40},{-90,60}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{90,-60},{110,-40}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-110,-60},{-90,-40}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{92,39},{112,59}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if steady_state_mech then
+    der(z) = 0;
+  else
+    z = z0;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Cs1.ftype;
+  fluids[5] = Cs2.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "TankHorizontal: fluids mixing in volume are not compatible with each other");
+
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  /* Geometry: horizontal cylinder */
+  Aw = 2*pi*R*L + 2*pi*R^2;
+  theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - z)/R)));
+  Al = (pi/2 - theta)*R^2 - R*(R - z)*Modelica.Math.cos(theta);
+  A = 2*R*Modelica.Math.cos(theta)*L;
+  Alw = (pi - 2*theta)*R*L + 2*Al;
+
+  /* Fluid and tank volume */
+  Vl = Al*L;
+  V = pi*R^2*L;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    A*(ddph*der(P) + ddhp*der(h - Xh2o*hr))*z + A*rho*der(z) = BQ;
+  else
+    A*rho*der(z) = BQ;
+  end if;
+
+  /* Fluid pressure at the inlets and outlets */
+  if (cardinality(Ce1) == 0) then
+    Ce1.P = Patm + rho*g*max(z - ze1, 0);
+    Oe1 = 0;
+  else
+    (Ce1.P - (Patm + rho*g*max(z - ze1, 0)))*Oe1 = ke1*ThermoSysPro.Functions.ThermoSquare(Ce1.Q, eps)/2/rho;
+    Oe1 = if ((Ce1.Q >= 0) or (z > ze1 + e)) then 1 else if (z < ze1) then 0 else (z - ze1)/e;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.P = Patm + rho*g*max(z - ze2, 0);
+    Oe2 = 0;
+  else
+    (Ce2.P - (Patm + rho*g*max(z - ze2, 0)))*Oe2 = ke2*ThermoSysPro.Functions.ThermoSquare(Ce2.Q, eps)/2/rho;
+    Oe2 = if ((Ce2.Q >= 0) or (z > ze2 + e)) then 1 else if (z < ze2) then 0 else (z - ze2)/e;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.P = Patm + rho*g*max(z - zs1, 0);
+    Os1 = 0;
+  else
+    (Patm + rho*g*max(z - zs1, 0) - Cs1.P)*Os1 = ks1*ThermoSysPro.Functions.ThermoSquare(Cs1.Q, eps)/2/rho;
+    Os1 = if ((Cs1.Q <= 0) or (z > zs1 + e)) then 1 else if (z < zs1) then 0 else (z - zs1)/e;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.P = Patm + rho*g*max(z - zs2, 0);
+    Os2 = 0;
+  else
+    (Patm + rho*g*max(z - zs2, 0) - Cs2.P)*Os2 = ks2*ThermoSysPro.Functions.ThermoSquare(Cs2.Q, eps)/2/rho;
+    Os2 = if ((Cs2.Q <= 0) or (z > zs2 + e)) then 1 else if (z < zs2) then 0 else (z - zs2)/e;
+  end if;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*((Ce1.h - Ce1.Xh2o*hr) - (h - Xh2o*hr)) + Ce2.Q*((Ce2.h - Ce2.Xh2o*hr) - (h - Xh2o*hr)) - Cs1.Q*((Cs1.h - Cs1.Xh2o*hr) - (h - Xh2o*hr)) - Cs2.Q*((Cs2.h - Cs2.Xh2o*hr) - (h - Xh2o*hr)) + Cth.W + J;
+
+  if dynamic_energy_balance then
+    if z > zmin then
+      if dynamic_mass_balance then
+        A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+      else
+        A*z*rho*der(h - Xh2o*hr) = BH;
+      end if;
+    else
+      der(h - Xh2o*hr) = 0;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+
+  Cth.T = T;
+
+  /* Fluid level sensor */
+  yLevel.signal = z;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      A*z*rho*der(Xco2) + Xco2*BQ = BXco2;
+      A*z*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      A*z*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      A*z*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    rs1 = 0;
+    rs2 = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Js1 = 0;
+    Js2 = 0;
+  end if;
+
+  J = Je1 + Je2 + Js1 + Js2;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  P = Patm + rho*g*z/2;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P,h,fluid,mode,Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P,h,fluid,mode,Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+  end if;
+
+  if dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-100,40},{-52,-40}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Ellipse(
+          extent={{58,40},{100,-40}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Rectangle(
+          extent={{-78,40},{79,-40}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder
+          else FillPattern.Solid),
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Line(
+          points={{-100,-18},{102,-18}},
+          color={255,255,0},
+          pattern=LinePattern.Dot,
+          thickness=0.5),
+        Line(
+          points={{-91,-32},{91,-32}},
+          color={255,255,0},
+          pattern=LinePattern.Dot,
+          thickness=0.5),
+        Line(points={{-90,50},{-60,50},{-20,40}}),
+        Line(points={{92,50},{60,50},{20,40}}),
+        Line(points={{-90,-50},{-60,-50},{-20,-40}}),
+        Line(points={{92,-50},{60,-50},{20,-40}}),
+        Line(
+          points={{-101,-1},{101,-1}},
+          color={255,255,0},
+          pattern=LinePattern.Dot,
+          thickness=0.5)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-100,40},{-46,-40}},
+          lineColor={0,0,0},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255}),
+        Ellipse(
+          extent={{50,40},{104,-40}},
+          lineColor={0,0,0},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255}),
+        Rectangle(
+          extent={{-76,40},{81,-40}},
+          lineColor={0,0,0},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255}),
+        Line(
+          points={{-98,12},{102,12}},
+          color={255,255,0},
+          pattern=LinePattern.Dash,
+          thickness=1),
+        Line(
+          points={{-98,3},{104,3}},
+          color={255,255,0},
+          pattern=LinePattern.Dash,
+          thickness=1),
+        Line(
+          points={{-98,-6},{104,-6}},
+          color={255,255,0},
+          pattern=LinePattern.Dash,
+          thickness=1),
+        Line(
+          points={{-97,-15},{101,-15}},
+          color={255,255,0},
+          pattern=LinePattern.Dash,
+          thickness=1),
+        Line(
+          points={{-94,-24},{98,-24}},
+          color={255,255,0},
+          pattern=LinePattern.Dash,
+          thickness=1),
+        Line(
+          points={{-89,-32},{93,-32}},
+          color={255,255,0},
+          pattern=LinePattern.Dash,
+          thickness=1),
+        Line(points={{-90,50},{-60,50},{-20,40}}),
+        Line(points={{92,50},{60,50},{20,40}}),
+        Line(points={{-90,-50},{-60,-50},{-20,-40}}),
+        Line(points={{92,-50},{60,-50},{20,-40}})}),
+    Window(
+      x=0.16,
+      y=0.03,
+      width=0.81,
+      height=0.9),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end TankHorizontal;
diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo
index efba09dfe5e9c4ca6ed777fdc2d50fbb5a3338c8..d124d5d45e2b3a35bbef6308f06cf4dd92198dc0 100644
--- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo
+++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo
@@ -1,974 +1,974 @@
-within ThermoSysPro.Fluid.Volumes;
-model TwoPhaseCavity "TwoPhaseCavity for one shell pass "
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder";
-  parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area";
-  parameter Units.SI.Length Lc=2.5
-    "Support plate spacing in cooling zone(chicanes)";
-  parameter Units.SI.Volume V=50
-    "Cavity volume (= total volume + bleeding volume - pipe volume) ";
-  parameter Units.SI.Volume Vmin=1.e-6;
-  parameter Integer Ns=10 "Number of segments for one tube pass";
-  parameter Integer NbTub1=500 "Numbers of drowned pipes in liquid; Pipe 1 (Hoizontal, Vertical Separate)";
-  parameter Integer NbTub2=500 "Number of total pipes immersed in steam = NbTub2; Pipe 2";
-  parameter Integer NbTub3=2000 "Number of total pipes immersed in steam ; Pipe 3";
-  parameter Integer NbTubV=15 "Numbers of pipes in a vertical row (tube bank)";
-  parameter Units.SI.Length L1=10 "Length of drowned pipes in liquid (pipes 1)";
-  parameter Units.SI.Length L2=10 "Length of Pipe 2 (in steam)";
-  parameter Units.SI.Length L3=20 "Length of Pipe 3 (in steam)";
-  parameter Units.SI.Diameter Dext=0.02 "External pipe diameter";
-  parameter Units.SI.Diameter DIc=1.40 "Internal calendre diameter";
-  parameter Units.SI.Length PasL=0.025
-    "Longitudinal step or length bottom pipes triangular step";
-  parameter Units.SI.Length PasT=0.023 "Transverse step or pipes step";
-  parameter ThermoSysPro.Units.nonSI.Angle_deg Angle=60
-    "Average bend angle (deg)";
-  parameter Real Ccond=0.01 "Condensation coefficient";
-  parameter Real Cevap=0.09 "Evaporation coefficient";
-  parameter Real Xlo=0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
-  parameter Real Xvo=0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
-  parameter Real COPl(start=1)=1 "Corrective terme for the heat exchange coefficient or the fouling coefficient of the liquid side";
-  parameter Real COPv( start=1)=1 "Corrective terme for heat exchange coefficient or the fouling coefficient of the steam side";
-  parameter Boolean Cal_hconv=true "false: heat transfer coefficient liquid and steam given by parameter COPl and COPv- true: calculated using the Nusselt correlation";
-  parameter Units.SI.CoefficientOfHeatTransfer hliq=1.5e3
-    "Heat transfer coefficient between the liquid and the cooling pipes ";
-  parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3
-    "Heat transfer coefficient between the vapor and the cooling pipes ";
-  parameter Units.SI.CoefficientOfHeatTransfer Kvl=1000
-    "Heat exchange coefficient between the liquid and gas phases";
-  parameter Units.SI.CoefficientOfHeatTransfer Klp=850
-    "Heat exchange coefficient between the liquid phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kvp=450
-    "Heat exchange coefficient between the gas phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.5
-    "Heat exchange coefficient between the wall and the outside ambiant";
-  parameter Units.SI.Temperature Ta=310 "External temperature";
-  parameter Units.SI.Mass Mp=100e3 "Wall mass";
-  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
-  parameter Boolean step_square=true "true: aligned pipes - false: staggered pipes (triangular step)";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.5
-    "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0=1.e5
-    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi;
-  parameter Integer Ns3=2*Ns "Number of segments for half pipes";
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-  parameter Units.SI.CoefficientOfHeatTransfer h4=1 "Heat exchange coefficient";
-  parameter Units.SI.Area S4=1 "Heat exchange surface";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-
-public
-  Units.SI.Length L(start=15) "Cavity length";
-  Integer NbTubT "Number of total pipes in Cavity";
-  Units.SI.Pressure P "Fluid average pressure";
-  Units.SI.Pressure Pfond "Fluid pressure at the bottom of the cavity";
-  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
-  Units.SI.Temperature Tl "Liquid phase temperature";
-  Units.SI.Temperature Tv "Gas phase temperature";
-  Units.SI.Volume Vl "Liquid phase volume";
-  Units.SI.Volume Vv "Gas phase volume";
-  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
-  Real xv(start=0) "Mass vapor fraction in the gas phase";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Gas phase density";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phaser";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase";
-  Real QS "Surface mass flow rate of Water (kg/m2s)";
-  Units.SI.Power dW1[Ns](start=fill(10e5, Ns))
-    "Power exchange between the wall and the fluid in each section side 1";
-  Units.SI.Power dW2[Ns](start=fill(10e5, Ns))
-    "Power exchange between the wall and the fluid in each section side 2";
-  Units.SI.Power dW3[Ns3](start=fill(10e5, Ns3))
-    "Power exchange between the wall and the fluid in each section side 3";
-  Units.SI.Power W1t "Total power exchanged on the steam side 1";
-  Units.SI.Power W2t "Total power exchanged on the water side 2";
-  Units.SI.Power W3t "Total power exchanged on the water side 3";
-  Units.SI.Power W4t "Total power exchanged on the steam side 4";
-  Units.SI.Power Wvl
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  Units.SI.Power Wpl
-    "Thermal power exchanged from the liquid phase to the wall";
-  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
-  Units.SI.Power Wpa "Thermal power losses to ambiant";
-  Units.SI.Temperature Tp1[Ns](start=fill(400, Ns))
-    "Wall temperature in section i of side 1";
-  Units.SI.Temperature Tp2[Ns](start=fill(400, Ns))
-    "Wall temperature in section i of side 2";
-  Units.SI.Temperature Tp3[Ns3](start=fill(400, Ns3))
-    "Wall temperature in section i of side 3";
-  Units.SI.Temperature Tp(start=400) "Wall temperature of cavity";
-  Units.SI.Position zl(start=1.05) "Liquid level in Cavity";
-  Units.SI.Area Al(start=5) "Cross sectional area of the liquid phase";
-  Units.SI.Angle theta "Angle";
-  Units.SI.Area Avl(start=5)
-    "Heat exchange surface between the liquid and gas phases";
-  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
-  Units.SI.Area Avp "Gas phase surface on contact with the wall";
-  Units.SI.Area Ape "Wall surface on contact with the fluid";
-  Units.SI.Area Surf_tot(start=1.e4) "Total heat exchange surface";
-  Units.SI.Area Surf_ext1(start=1.e2)
-    "Heat exchange surface for drowned section ; pipe 1";
-  Units.SI.Area Surf_ext2(start=1.e2)
-    "Heat exchange surface for section 2 ; pipe 2 ";
-  Units.SI.Area Surf_ext3(start=1.e2)
-    "Heat exchange surface for section 3 ; pipe 3";
-  Units.SI.ReynoldsNumber Rel(start=6.e4) "liquid Reynolds number";
-  Real Prl(start=1) "liquid Prandtl number in node i";
-  Units.SI.ThermalConductivity kl(start=1) "liquid thermal conductivity";
-  Units.SI.DynamicViscosity mul(start=2.e-4) "liquid dynamic viscosity ";
-  Units.SI.DynamicViscosity mult[Ns](start=fill(2.e-4, Ns))
-    "liquid dynamic viscosity at wall temperature";
-  Units.SI.CoefficientOfHeatTransfer hcond2[Ns](start=fill(1e4, Ns))
-    "Heat transfer coefficient between the vapor and the cooling pipes zone 2";
-  Units.SI.CoefficientOfHeatTransfer hcond3[Ns3](start=fill(1e4, Ns3))
-    "Heat transfer coefficient between the vapor and the cooling pipes zone 3";
-  Units.SI.CoefficientOfHeatTransfer hliqu[Ns](start=fill(1000, Ns))
-    "Heat transfer coefficient between the liquid and the cooling pipes zone 1";
-  Units.SI.Diameter DH(start=0.02) "hydraulic diameter";
-  Real EE[Ns](start=fill(1, Ns));
-  FluidType fluids[4] "Fluids mixing in volume";
-  Units.SI.Power Je "Thermal power diffusion from inlet Ce";
-  Units.SI.Power Jv "Thermal power diffusion from inlet Cv";
-  Units.SI.Power Jl "Thermal power diffusion from outlet Cl";
-  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
-  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet Ce";
-  Units.SI.MassFlowRate gamma_v "Diffusion conductance for inlet Cv";
-  Units.SI.MassFlowRate gamma_l "Diffusion conductance for outlet Cl";
-  Real re "Value of r(Q/gamma) for inlet Ce";
-  Real rv "Value of r(Q/gamma) for inlet Cv";
-  Real rl "Value of r(Q/gamma) for outlet Cl";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-250,70},{-210,110}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{60,70},{100,110}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-250,-200},{-210,-160}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{58,-200},{98,-160}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Cv "Steam input" annotation (Placement(
-        transformation(extent={{-88,50},{-68,70}}, rotation=0),
-        iconTransformation(extent={{-88,50},{-68,70}})));
-  Interfaces.Connectors.FluidOutlet Cl "Water output" annotation (Placement(
-        transformation(extent={{-88,-170},{-68,-150}}, rotation=0),
-        iconTransformation(extent={{-88,-170},{-68,-150}})));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns3]
-                                     annotation (Placement(transformation(
-          extent={{-85,-53},{-73,-41}}, rotation=0), iconTransformation(extent=
-            {{-85,-53},{-73,-41}})));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"                        annotation (Placement(transformation(
-          extent={{88,-109},{108,-89}}, rotation=0), iconTransformation(extent={
-            {88,-109},{108,-89}})));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{-250,-20},{-210,20}},
-          rotation=0)));
-  Interfaces.Connectors.FluidInlet Ce "Water input" annotation (Placement(
-        transformation(extent={{-160,50},{-140,70}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth1[Ns]
-                                     annotation (Placement(transformation(
-          extent={{-85,-133},{-73,-120}},rotation=0), iconTransformation(extent=
-           {{-85,-133},{-73,-120}})));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth2[Ns]
-                                     annotation (Placement(transformation(
-          extent={{-85,19},{-73,32}}, rotation=0), iconTransformation(extent={{
-            -85,19},{-73,32}})));
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-250,-110},{-210,-70}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provIn
-    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{12,70},{52,110}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      der(hl) = 0;
-      der(hv) = 0;
-      der(Vl) = 0;
-      der(P) = 0;
-      der(Tp) = 0;
-    else
-      hl = lsat.h;
-      hv = vsat.h;
-      Vl = Vf0*V;
-      P = P0;
-      der(Tp) = 0;
-    end if;
-  end if;
-
-equation
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = Cv.ftype;
-  fluids[4] = Cl.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "TwoPhaseCavity: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.h_vol_1 = 1.e5;
-    Ce.diff_res_1 = 0;
-    Ce.diff_on_1 = false;
-    Ce.ftype = ftype;
-    Ce.Xco2 = 0;
-    Ce.Xh2o = 1;
-    Ce.Xo2 = 0;
-    Ce.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cv) == 0) then
-    Cv.Q = 0;
-    Cv.h = 1.e5;
-    Cv.h_vol_1 = 1.e5;
-    Cv.diff_res_1 = 0;
-    Cv.diff_on_1 = false;
-    Cv.ftype = ftype;
-    Cv.Xco2 = 0;
-    Cv.Xh2o = 1;
-    Cv.Xo2 = 0;
-    Cv.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cl) == 0) then
-    Cl.Q = 0;
-    Cl.h_vol_2 = 1.e5;
-    Cl.diff_res_2 = 0;
-    Cl.diff_on_2 = false;
-  end if;
-
-  /* Wall temperature and heat flow rate*/
-  Cth1.T = Tp1;
-  Cth1.W = dW1;
-  Cth2.T = Tp2;
-  Cth2.W = dW2;
-  Cth3.T = Tp3;
-  Cth3.W = dW3;
-
-  /* Cavity length */
-  V = pi*R*R*L;
-
-  /* Liquid volume */
-  if Vertical then
-     theta = 1;
-     Al = pi*R^2;
-     Vl = Al*zl;
-     Avl = Al;
-     NbTubT = NbTub1;
-  else
-     theta = Modelica.Math.asin(max(-0.9999, min(0.9999,(R - zl)/R)));
-     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
-     Vl = Al*L;
-     Avl = 2*R*Modelica.Math.cos(theta)*L;
-     NbTubT = NbTub1 + NbTub3;
-  end if;
-
-  /* Heat exchange surface*/
-  Surf_ext1 = pi*Dext*L1/Ns*NbTub1;
-  Surf_ext2 = pi*Dext*L2/Ns*NbTub2;
-  Surf_ext3 = pi*Dext*L3/Ns3*NbTub3;
-  Surf_tot  = Ns*Surf_ext1 + Ns*Surf_ext2 + Ns3*Surf_ext3;
-
-  /* Cavity volume */
-  V = Vl + Vv;
-
-  /* Water leval */
-  yLevel.signal = zl;
-
-  /* Liquid surface and vapor surface on contact with wall */
-  Alp = if Vertical then 2*sqrt(pi/Al)*Vl + Al else (pi - 2*theta)*R*L + 2*Al;
-  Avp = if Vertical then 2*sqrt(pi/Al)*Vv + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al);
-
-  /* Wall surface on contact with the outside */
-  Ape = Alp + Avp;
-
-  /* Pressure at the bottom of the cavity */
-  Pfond = P + prod.d*g*zl;
-
-  /* Liquid phase mass balance equation */
-  BQl = -Cl.Q + Qcond - Qevap + (1 - proe.x)*Ce.Q;
-
-  if dynamic_energy_balance then
-    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-  else
-    0 = BQl;
-  end if;
-
-  /* Vapor phase mass balance equation */
-  BQv = Cv.Q + Qevap - Qcond + proe.x*Ce.Q;
-
-  if dynamic_energy_balance then
-    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-  else
-    0 = BQv;
-  end if;
-
-  Ce.P = P;
-  Cv.P = P;
-  Cl.P = Pfond;
-
-  /* Liquid phase energy balance equation */
-  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wpl + Wvl + W1t + Jt_l;
-
-  if dynamic_energy_balance then
-    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-  else
-    0 = BHl;
-  end if;
-
-  /* Gas phase energy balance equation */
-  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wpv + W2t + W3t + Jt_v;
-
-  if dynamic_energy_balance then
-    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-  else
-    0 = BHv;
-  end if;
-
-  Ce.h_vol_2 = hl;
-  Cv.h_vol_2 = hv;
-  Cl.h_vol_1 = hl;
-
-  /* Energy balance equation at the wall */
-  if dynamic_energy_balance then
-    Mp*cpp*der(Tp) = Wpl + Wpv - Wpa;
-  else
-    0 = Wpl + Wpv - Wpa;
-  end if;
-
-  /* Heat exchange between liquid and gas phases */
-  Wvl = Kvl*Avl*(Tv - Tl);
-
-  /* Heat exchange between the liquid phase and the wall */
-  Wpl = Klp*Alp*(Tl - Tp);
-
-  /* Heat exchange between the gas phase and the wall */
-  Wpv = Kvp*Avp*(Tv - Tp);
-
-  /* Thermal power losses to ambiant, for simplifid we use the wall surface on contact with the fluid (Ape)*/
-  Wpa = Kpa*Ape*(Tp - Ta);
-
-  /* Condensation and evaporation mass flow rates */
-  Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
-  Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
-
-  /* Heat transfer coefficient of fluid 
-                   and
-     Power exchanged for each section 
-    ----------------------------------*/
-  /* Heat transfer coefficient of liquid*/
-  // Sacadura
-  DH = if step_square then 4*PasL^2/(pi*Dext) - Dext else ((2*PasL*PasT) - (pi*Dext^2*(Angle/120)))/(pi*Dext*(Angle/120));
-
-  QS = Cl.Q /(DIc*Lc*(PasL - Dext)/PasL);
-
-  Rel = noEvent( abs(QS*DH/mul));
-  Prl = mul*prol.cp/kl;
-
-  assert(PasL - Dext > 0, "Error Data for TwoPhaseCavity model (PasL - Dext)<= 0 ");
-
-  for i in 1:Ns loop
-    mult[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tp1[i], fluid);
-
-    EE[i]= max((PasT/Dext - 1/2/((((PasL/Dext)^2 + (PasT/Dext/2)^2)^0.5/Dext) - 1)), 1);
-
-    /* Heat transfer coefficient of liquid*/
-    if Cal_hconv then
-       // Kern corelation (Sacadura)
-       hliqu[i] = noEvent(if ((Rel > 1.e-6) and (Prl > 1.e-6)) then (COPl*0.36*kl/Dext*Rel^0.55*Prl^0.3333*(mul/mult[i])^0.14) else  10);
-    else
-       hliqu[i] = COPl*hliq;
-    end if;
-
-    if Cal_hconv then
-       /* Heat transfer coefficient of vapeur*/
-       if Vertical then
-         // Frank P. & David P. Fundamentals of Heat Transfer  For (PasL/Dext)= 1.4
-         hcond2[i] = COPv*noEvent(min(1.13*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(max(L2, 1)*mul*abs(lsat.T - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000));
-       else
-         // Nusselt corelation
-         hcond2[i] = COPv*noEvent(min(0.728*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*abs(lsat.T - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000));
-       end if;
-    else
-       hcond2[i] = COPv*hcond;
-    end if;
-
-    /* Power exchanged for each section zone 1*/
-    if (noEvent(abs(dW1[i]) < 0.1)) then
-       dW1[i] = -h4*S4*(Tv - Tp1[i]);
-    else
-       dW1[i] = -hliqu[i]*Surf_ext1 *((Tv + Tl)/2 - (Tp1[1] + Tp1[Ns])/2);
-    end if;
-
-    /* Power exchanged for each section zone 2*/
-    if (noEvent(abs(dW2[i]) < 0.1)) then
-       dW2[i] = -h4*S4*(Tv - Tp2[i]);
-    else
-       dW2[i] = -hcond2[i]*Surf_ext2*(Tv - Tp2[i]);
-    end if;
-  end for;
-
-  for i in 1:Ns3 loop
-    if Cal_hconv then
-       /* Heat transfer coefficient of vapeur*/
-       if Vertical then
-          // Frank P. & David P. Fundamentals of Heat Transfer  For vertical plate
-          hcond3[i] = COPv*noEvent(min( 1.13*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(max(L3,1)*mul*abs(lsat.T - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000));
-       else
-          // Nusselt corelation
-          hcond3[i] = COPv*noEvent(min(0.728*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*abs(lsat.T - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000));
-       end if;
-    else
-       hcond3[i] = COPv*hcond;
-    end if;
-
-    /* Power exchanged for each section  zone 3 + power exchanged for Deheating*/
-    if (noEvent(abs(dW3[i]) < 0.1)) then
-       dW3[i] = -h4*S4*(Tv - Tp3[i]);
-    else
-       dW3[i] = -hcond3[i]*Surf_ext3*(Tv - Tp3[i]) + W4t/Ns3;
-    end if;
-  end for;
-
-  W1t = sum(dW1);
-  W2t = sum(dW2);
-  W3t = sum(dW3);
-
-  /* Total power exchanged for Deheating*/
-  W4t = noEvent(if (Cv.h > vsat.h) then -Cv.Q*(Cv.h - vsat.h) else -0.0001);
-
-  /* Fluid composition (no balance equations) */
-  Cl.ftype = ftype;
-
-  Cl.Xco2 = 0;
-  Cl.Xh2o = 1;
-  Cl.Xo2  = 0;
-  Cl.Xso2 = 0;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1);
-  else
-    Cl.h = if (Cl.Q > 0) then Cl.h_vol_1 else Cl.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    rv = if Cv.diff_on_1 then exp(-0.033*(Cv.Q*Cv.diff_res_1)^2) else 0;
-    rl = if Cl.diff_on_2 then exp(-0.033*(Cl.Q*Cl.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_v = if Cv.diff_on_1 then 1/Cv.diff_res_1 else gamma0;
-    gamma_l = if Cl.diff_on_2 then 1/Cl.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    Jv = if Cv.diff_on_1 then rv*gamma_v*(Cv.h_vol_1 - Cv.h_vol_2) else 0;
-    Jl = if Cl.diff_on_2 then rl*gamma_l*(Cl.h_vol_2 - Cl.h_vol_1) else 0;
-  else
-    re = 0;
-    rv = 0;
-    rl = 0;
-
-    gamma_e = gamma0;
-    gamma_v = gamma0;
-    gamma_l = gamma0;
-
-    Je = 0;
-    Jv = 0;
-    Jl = 0;
-  end if;
-
-  Jt_l = Je + Jl;
-  Jt_v = Jv;
-
-  Ce.diff_res_2 = 0;
-  Cv.diff_res_2 = 0;
-  Cl.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  Cv.diff_on_2 = diffusion;
-  Cl.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, 0, fluid);
-  prol = ThermoSysPro.Properties.Fluid.Ph((P + Pfond)/2, hl, 0, fluid);
-  provIn = ThermoSysPro.Properties.Fluid.Ph(P, Cv.h, 0, fluid);
-  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid);
-  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid);
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid);
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-  rhov = prov.d;
-  xv = prov.x;
-
-  mul = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tl, fluid);
-  kl = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol, Tl, P, 0, fluid));
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-260,-200},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-142,2},{-124,-6}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{-164,55},{-88,19}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Horizontal_1pipe"),
-        Rectangle(
-          extent={{-158,-6},{-102,-10}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-184,16},{-166,16}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Text(
-          extent={{-198,-6},{-160,-24}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{-180,-8},{-162,-8}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-102,-8},{-96,-8},{-96,16},{-160,16},{-170,16}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{-162,28},{-90,-44}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Text(
-          extent={{-182,-56},{-86,-78}},
-          lineColor={0,0,255},
-          textString=
-               "Vertical Separate"),
-        Rectangle(
-          extent={{-170,-100},{-166,-152}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-114,-76},{-114,-94}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{-116,-100},{-112,-152}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-168,-76},{-168,-94}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Rectangle(
-          extent={{-166,-176},{-120,-180}},
-          lineColor={0,0,255},
-          fillColor={85,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-190,-128},{-172,-136}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 2"),
-        Text(
-          extent={{-152,-180},{-134,-188}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 1"),
-        Text(
-          extent={{-111,-122},{-93,-130}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{-210,-164},{-172,-182}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{-168,-150},{-168,-160},{-114,-160},{-114,-150}},
-          color={0,0,255},
-          pattern=LinePattern.Dash,
-          arrow={Arrow.Filled,Arrow.None}),
-        Line(
-          points={{-183,-168},{-105,-168}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{-182,-96},{-106,-192}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-114,-78},{-114,-72},{-92,-72},{-92,-178},{-120,-178}},
-          color={0,0,255},
-          pattern=LinePattern.Dash,
-          arrow={Arrow.Filled,Arrow.None}),
-        Line(
-          points={{-188,-178},{-170,-178}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Text(
-          extent={{12,-54},{54,-70}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Vertical"),
-        Rectangle(
-          extent={{4,-82},{8,-134}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{6,-58},{6,-76}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{58,-82},{62,-134}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{60,-60},{60,-78}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Rectangle(
-          extent={{10,-142},{56,-146}},
-          lineColor={0,0,255},
-          fillColor={85,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-16,-104},{2,-112}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 2"),
-        Text(
-          extent={{16,-162},{42,-154}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 1"),
-        Text(
-          extent={{65,-112},{83,-120}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{-20,-50},{18,-68}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{6,-134},{6,-144},{60,-144},{60,-134}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-7,-138},{71,-138}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{-8,-78},{70,-152}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{2,-20},{58,-24}},
-          lineColor={0,0,255},
-          fillColor={85,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{32,34},{50,26}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 2"),
-        Text(
-          extent={{16,-26},{34,-34}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 1"),
-        Text(
-          extent={{18,10},{36,2}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{4,60},{56,34}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Horizontal"),
-        Rectangle(
-          extent={{2,2},{58,-2}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{2,26},{58,22}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-24,24},{-6,24}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Line(
-          points={{-36,-22},{-4,-22}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Text(
-          extent={{-58,-10},{-20,-28}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{60,-22},{72,-22},{72,24},{60,24},{58,24}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-20,0},{-2,0}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-20,-22},{-20,-3},{-20,-1}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{58,0},{64,0},{64,12},{-10,12},{-10,24}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{-2,36},{76,-38}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-2,-16},{76,-16}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{-160,18},{-142,14}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{2,26},{20,22}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-170,-100},{-166,-116}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{58,-82},{62,-98}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-234,64},{-164,36}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe4=deheating pipes"),
-        Text(
-          extent={{-158,26},{-140,18}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 4"),
-        Text(
-          extent={{0,34},{18,26}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 4"),
-        Text(
-          extent={{64,-86},{82,-94}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 4"),
-        Text(
-          extent={{-190,-104},{-172,-112}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 4")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-260,-200},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Ellipse(
-          extent={{-100,50},{100,-150}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-260,50},{-60,-150}},
-          lineColor={0,0,255},
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-160,50},{0,-150}},
-          lineColor={28,108,200},
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(points={{-260,-48},{-160,-48}}, color={0,0,0}),
-        Line(
-          points={{-160,-48},{100,-48}},
-          color={0,0,0},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,50},{-160,-150}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-160,-98},{88,-98}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-112},{78,-112}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-126},{66,-126}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-106},{82,-106}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-120},{72,-120}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-132},{56,-132}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-150},{0,-150}},
-          color={0,0,255}),
-        Line(
-          points={{0,50},{0,-150}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-160,-140},{44,-140}},
-          color={0,0,255},
-          pattern=LinePattern.Dash)}),
-    Window(
-      x=0.11,
-      y=0.06,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end TwoPhaseCavity;
+within ThermoSysPro.Fluid.Volumes;
+model TwoPhaseCavity "TwoPhaseCavity for one shell pass "
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder";
+  parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area";
+  parameter Units.SI.Length Lc=2.5
+    "Support plate spacing in cooling zone(chicanes)";
+  parameter Units.SI.Volume V=50
+    "Cavity volume (= total volume + bleeding volume - pipe volume) ";
+  parameter Units.SI.Volume Vmin=1.e-6;
+  parameter Integer Ns=10 "Number of segments for one tube pass";
+  parameter Integer NbTub1=500 "Numbers of drowned pipes in liquid; Pipe 1 (Hoizontal, Vertical Separate)";
+  parameter Integer NbTub2=500 "Number of total pipes immersed in steam = NbTub2; Pipe 2";
+  parameter Integer NbTub3=2000 "Number of total pipes immersed in steam ; Pipe 3";
+  parameter Integer NbTubV=15 "Numbers of pipes in a vertical row (tube bank)";
+  parameter Units.SI.Length L1=10 "Length of drowned pipes in liquid (pipes 1)";
+  parameter Units.SI.Length L2=10 "Length of Pipe 2 (in steam)";
+  parameter Units.SI.Length L3=20 "Length of Pipe 3 (in steam)";
+  parameter Units.SI.Diameter Dext=0.02 "External pipe diameter";
+  parameter Units.SI.Diameter DIc=1.40 "Internal calendre diameter";
+  parameter Units.SI.Length PasL=0.025
+    "Longitudinal step or length bottom pipes triangular step";
+  parameter Units.SI.Length PasT=0.023 "Transverse step or pipes step";
+  parameter ThermoSysPro.Units.nonSI.Angle_deg Angle=60
+    "Average bend angle (deg)";
+  parameter Real Ccond=0.01 "Condensation coefficient";
+  parameter Real Cevap=0.09 "Evaporation coefficient";
+  parameter Real Xlo=0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
+  parameter Real Xvo=0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
+  parameter Real COPl(start=1)=1 "Corrective terme for the heat exchange coefficient or the fouling coefficient of the liquid side";
+  parameter Real COPv( start=1)=1 "Corrective terme for heat exchange coefficient or the fouling coefficient of the steam side";
+  parameter Boolean Cal_hconv=true "false: heat transfer coefficient liquid and steam given by parameter COPl and COPv- true: calculated using the Nusselt correlation";
+  parameter Units.SI.CoefficientOfHeatTransfer hliq=1.5e3
+    "Heat transfer coefficient between the liquid and the cooling pipes ";
+  parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3
+    "Heat transfer coefficient between the vapor and the cooling pipes ";
+  parameter Units.SI.CoefficientOfHeatTransfer Kvl=1000
+    "Heat exchange coefficient between the liquid and gas phases";
+  parameter Units.SI.CoefficientOfHeatTransfer Klp=850
+    "Heat exchange coefficient between the liquid phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kvp=450
+    "Heat exchange coefficient between the gas phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.5
+    "Heat exchange coefficient between the wall and the outside ambiant";
+  parameter Units.SI.Temperature Ta=310 "External temperature";
+  parameter Units.SI.Mass Mp=100e3 "Wall mass";
+  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
+  parameter Boolean step_square=true "true: aligned pipes - false: staggered pipes (triangular step)";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.5
+    "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0=1.e5
+    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi;
+  parameter Integer Ns3=2*Ns "Number of segments for half pipes";
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+  parameter Units.SI.CoefficientOfHeatTransfer h4=1 "Heat exchange coefficient";
+  parameter Units.SI.Area S4=1 "Heat exchange surface";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+
+public
+  Units.SI.Length L(start=15) "Cavity length";
+  Integer NbTubT "Number of total pipes in Cavity";
+  Units.SI.Pressure P "Fluid average pressure";
+  Units.SI.Pressure Pfond "Fluid pressure at the bottom of the cavity";
+  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
+  Units.SI.Temperature Tl "Liquid phase temperature";
+  Units.SI.Temperature Tv "Gas phase temperature";
+  Units.SI.Volume Vl "Liquid phase volume";
+  Units.SI.Volume Vv "Gas phase volume";
+  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
+  Real xv(start=0) "Mass vapor fraction in the gas phase";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Gas phase density";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phaser";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase";
+  Real QS "Surface mass flow rate of Water (kg/m2s)";
+  Units.SI.Power dW1[Ns](start=fill(10e5, Ns))
+    "Power exchange between the wall and the fluid in each section side 1";
+  Units.SI.Power dW2[Ns](start=fill(10e5, Ns))
+    "Power exchange between the wall and the fluid in each section side 2";
+  Units.SI.Power dW3[Ns3](start=fill(10e5, Ns3))
+    "Power exchange between the wall and the fluid in each section side 3";
+  Units.SI.Power W1t "Total power exchanged on the steam side 1";
+  Units.SI.Power W2t "Total power exchanged on the water side 2";
+  Units.SI.Power W3t "Total power exchanged on the water side 3";
+  Units.SI.Power W4t "Total power exchanged on the steam side 4";
+  Units.SI.Power Wvl
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  Units.SI.Power Wpl
+    "Thermal power exchanged from the liquid phase to the wall";
+  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
+  Units.SI.Power Wpa "Thermal power losses to ambiant";
+  Units.SI.Temperature Tp1[Ns](start=fill(400, Ns))
+    "Wall temperature in section i of side 1";
+  Units.SI.Temperature Tp2[Ns](start=fill(400, Ns))
+    "Wall temperature in section i of side 2";
+  Units.SI.Temperature Tp3[Ns3](start=fill(400, Ns3))
+    "Wall temperature in section i of side 3";
+  Units.SI.Temperature Tp(start=400) "Wall temperature of cavity";
+  Units.SI.Position zl(start=1.05) "Liquid level in Cavity";
+  Units.SI.Area Al(start=5) "Cross sectional area of the liquid phase";
+  Units.SI.Angle theta "Angle";
+  Units.SI.Area Avl(start=5)
+    "Heat exchange surface between the liquid and gas phases";
+  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
+  Units.SI.Area Avp "Gas phase surface on contact with the wall";
+  Units.SI.Area Ape "Wall surface on contact with the fluid";
+  Units.SI.Area Surf_tot(start=1.e4) "Total heat exchange surface";
+  Units.SI.Area Surf_ext1(start=1.e2)
+    "Heat exchange surface for drowned section ; pipe 1";
+  Units.SI.Area Surf_ext2(start=1.e2)
+    "Heat exchange surface for section 2 ; pipe 2 ";
+  Units.SI.Area Surf_ext3(start=1.e2)
+    "Heat exchange surface for section 3 ; pipe 3";
+  Units.SI.ReynoldsNumber Rel(start=6.e4) "liquid Reynolds number";
+  Real Prl(start=1) "liquid Prandtl number in node i";
+  Units.SI.ThermalConductivity kl(start=1) "liquid thermal conductivity";
+  Units.SI.DynamicViscosity mul(start=2.e-4) "liquid dynamic viscosity ";
+  Units.SI.DynamicViscosity mult[Ns](start=fill(2.e-4, Ns))
+    "liquid dynamic viscosity at wall temperature";
+  Units.SI.CoefficientOfHeatTransfer hcond2[Ns](start=fill(1e4, Ns))
+    "Heat transfer coefficient between the vapor and the cooling pipes zone 2";
+  Units.SI.CoefficientOfHeatTransfer hcond3[Ns3](start=fill(1e4, Ns3))
+    "Heat transfer coefficient between the vapor and the cooling pipes zone 3";
+  Units.SI.CoefficientOfHeatTransfer hliqu[Ns](start=fill(1000, Ns))
+    "Heat transfer coefficient between the liquid and the cooling pipes zone 1";
+  Units.SI.Diameter DH(start=0.02) "hydraulic diameter";
+  Real EE[Ns](start=fill(1, Ns));
+  FluidType fluids[4] "Fluids mixing in volume";
+  Units.SI.Power Je "Thermal power diffusion from inlet Ce";
+  Units.SI.Power Jv "Thermal power diffusion from inlet Cv";
+  Units.SI.Power Jl "Thermal power diffusion from outlet Cl";
+  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
+  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet Ce";
+  Units.SI.MassFlowRate gamma_v "Diffusion conductance for inlet Cv";
+  Units.SI.MassFlowRate gamma_l "Diffusion conductance for outlet Cl";
+  Real re "Value of r(Q/gamma) for inlet Ce";
+  Real rv "Value of r(Q/gamma) for inlet Cv";
+  Real rl "Value of r(Q/gamma) for outlet Cl";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-250,70},{-210,110}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{60,70},{100,110}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-250,-200},{-210,-160}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{58,-200},{98,-160}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Cv "Steam input" annotation (Placement(
+        transformation(extent={{-88,50},{-68,70}}, rotation=0),
+        iconTransformation(extent={{-88,50},{-68,70}})));
+  Interfaces.Connectors.FluidOutlet Cl "Water output" annotation (Placement(
+        transformation(extent={{-88,-170},{-68,-150}}, rotation=0),
+        iconTransformation(extent={{-88,-170},{-68,-150}})));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns3]
+                                     annotation (Placement(transformation(
+          extent={{-85,-53},{-73,-41}}, rotation=0), iconTransformation(extent=
+            {{-85,-53},{-73,-41}})));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"                        annotation (Placement(transformation(
+          extent={{88,-109},{108,-89}}, rotation=0), iconTransformation(extent={
+            {88,-109},{108,-89}})));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{-250,-20},{-210,20}},
+          rotation=0)));
+  Interfaces.Connectors.FluidInlet Ce "Water input" annotation (Placement(
+        transformation(extent={{-160,50},{-140,70}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth1[Ns]
+                                     annotation (Placement(transformation(
+          extent={{-85,-133},{-73,-120}},rotation=0), iconTransformation(extent=
+           {{-85,-133},{-73,-120}})));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth2[Ns]
+                                     annotation (Placement(transformation(
+          extent={{-85,19},{-73,32}}, rotation=0), iconTransformation(extent={{
+            -85,19},{-73,32}})));
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-250,-110},{-210,-70}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provIn
+    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{12,70},{52,110}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      der(hl) = 0;
+      der(hv) = 0;
+      der(Vl) = 0;
+      der(P) = 0;
+      der(Tp) = 0;
+    else
+      hl = lsat.h;
+      hv = vsat.h;
+      Vl = Vf0*V;
+      P = P0;
+      der(Tp) = 0;
+    end if;
+  end if;
+
+equation
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = Cv.ftype;
+  fluids[4] = Cl.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "TwoPhaseCavity: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.h_vol_1 = 1.e5;
+    Ce.diff_res_1 = 0;
+    Ce.diff_on_1 = false;
+    Ce.ftype = ftype;
+    Ce.Xco2 = 0;
+    Ce.Xh2o = 0;
+    Ce.Xo2 = 0;
+    Ce.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cv) == 0) then
+    Cv.Q = 0;
+    Cv.h = 1.e5;
+    Cv.h_vol_1 = 1.e5;
+    Cv.diff_res_1 = 0;
+    Cv.diff_on_1 = false;
+    Cv.ftype = ftype;
+    Cv.Xco2 = 0;
+    Cv.Xh2o = 0;
+    Cv.Xo2 = 0;
+    Cv.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cl) == 0) then
+    Cl.Q = 0;
+    Cl.h_vol_2 = 1.e5;
+    Cl.diff_res_2 = 0;
+    Cl.diff_on_2 = false;
+  end if;
+
+  /* Wall temperature and heat flow rate*/
+  Cth1.T = Tp1;
+  Cth1.W = dW1;
+  Cth2.T = Tp2;
+  Cth2.W = dW2;
+  Cth3.T = Tp3;
+  Cth3.W = dW3;
+
+  /* Cavity length */
+  V = pi*R*R*L;
+
+  /* Liquid volume */
+  if Vertical then
+     theta = 1;
+     Al = pi*R^2;
+     Vl = Al*zl;
+     Avl = Al;
+     NbTubT = NbTub1;
+  else
+     theta = Modelica.Math.asin(max(-0.9999, min(0.9999,(R - zl)/R)));
+     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
+     Vl = Al*L;
+     Avl = 2*R*Modelica.Math.cos(theta)*L;
+     NbTubT = NbTub1 + NbTub3;
+  end if;
+
+  /* Heat exchange surface*/
+  Surf_ext1 = pi*Dext*L1/Ns*NbTub1;
+  Surf_ext2 = pi*Dext*L2/Ns*NbTub2;
+  Surf_ext3 = pi*Dext*L3/Ns3*NbTub3;
+  Surf_tot  = Ns*Surf_ext1 + Ns*Surf_ext2 + Ns3*Surf_ext3;
+
+  /* Cavity volume */
+  V = Vl + Vv;
+
+  /* Water leval */
+  yLevel.signal = zl;
+
+  /* Liquid surface and vapor surface on contact with wall */
+  Alp = if Vertical then 2*sqrt(pi/Al)*Vl + Al else (pi - 2*theta)*R*L + 2*Al;
+  Avp = if Vertical then 2*sqrt(pi/Al)*Vv + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al);
+
+  /* Wall surface on contact with the outside */
+  Ape = Alp + Avp;
+
+  /* Pressure at the bottom of the cavity */
+  Pfond = P + prod.d*g*zl;
+
+  /* Liquid phase mass balance equation */
+  BQl = -Cl.Q + Qcond - Qevap + (1 - proe.x)*Ce.Q;
+
+  if dynamic_energy_balance then
+    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+  else
+    0 = BQl;
+  end if;
+
+  /* Vapor phase mass balance equation */
+  BQv = Cv.Q + Qevap - Qcond + proe.x*Ce.Q;
+
+  if dynamic_energy_balance then
+    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+  else
+    0 = BQv;
+  end if;
+
+  Ce.P = P;
+  Cv.P = P;
+  Cl.P = Pfond;
+
+  /* Liquid phase energy balance equation */
+  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wpl + Wvl + W1t + Jt_l;
+
+  if dynamic_energy_balance then
+    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+  else
+    0 = BHl;
+  end if;
+
+  /* Gas phase energy balance equation */
+  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wpv + W2t + W3t + Jt_v;
+
+  if dynamic_energy_balance then
+    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+  else
+    0 = BHv;
+  end if;
+
+  Ce.h_vol_2 = hl;
+  Cv.h_vol_2 = hv;
+  Cl.h_vol_1 = hl;
+
+  /* Energy balance equation at the wall */
+  if dynamic_energy_balance then
+    Mp*cpp*der(Tp) = Wpl + Wpv - Wpa;
+  else
+    0 = Wpl + Wpv - Wpa;
+  end if;
+
+  /* Heat exchange between liquid and gas phases */
+  Wvl = Kvl*Avl*(Tv - Tl);
+
+  /* Heat exchange between the liquid phase and the wall */
+  Wpl = Klp*Alp*(Tl - Tp);
+
+  /* Heat exchange between the gas phase and the wall */
+  Wpv = Kvp*Avp*(Tv - Tp);
+
+  /* Thermal power losses to ambiant, for simplifid we use the wall surface on contact with the fluid (Ape)*/
+  Wpa = Kpa*Ape*(Tp - Ta);
+
+  /* Condensation and evaporation mass flow rates */
+  Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
+  Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
+
+  /* Heat transfer coefficient of fluid 
+                   and
+     Power exchanged for each section 
+    ----------------------------------*/
+  /* Heat transfer coefficient of liquid*/
+  // Sacadura
+  DH = if step_square then 4*PasL^2/(pi*Dext) - Dext else ((2*PasL*PasT) - (pi*Dext^2*(Angle/120)))/(pi*Dext*(Angle/120));
+
+  QS = Cl.Q /(DIc*Lc*(PasL - Dext)/PasL);
+
+  Rel = noEvent( abs(QS*DH/mul));
+  Prl = mul*prol.cp/kl;
+
+  assert(PasL - Dext > 0, "Error Data for TwoPhaseCavity model (PasL - Dext)<= 0 ");
+
+  for i in 1:Ns loop
+    mult[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tp1[i], fluid);
+
+    EE[i]= max((PasT/Dext - 1/2/((((PasL/Dext)^2 + (PasT/Dext/2)^2)^0.5/Dext) - 1)), 1);
+
+    /* Heat transfer coefficient of liquid*/
+    if Cal_hconv then
+       // Kern corelation (Sacadura)
+       hliqu[i] = noEvent(if ((Rel > 1.e-6) and (Prl > 1.e-6)) then (COPl*0.36*kl/Dext*Rel^0.55*Prl^0.3333*(mul/mult[i])^0.14) else  10);
+    else
+       hliqu[i] = COPl*hliq;
+    end if;
+
+    if Cal_hconv then
+       /* Heat transfer coefficient of vapeur*/
+       if Vertical then
+         // Frank P. & David P. Fundamentals of Heat Transfer  For (PasL/Dext)= 1.4
+         hcond2[i] = COPv*noEvent(min(1.13*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(max(L2, 1)*mul*abs(lsat.T - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000));
+       else
+         // Nusselt corelation
+         hcond2[i] = COPv*noEvent(min(0.728*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*abs(lsat.T - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000));
+       end if;
+    else
+       hcond2[i] = COPv*hcond;
+    end if;
+
+    /* Power exchanged for each section zone 1*/
+    if (noEvent(abs(dW1[i]) < 0.1)) then
+       dW1[i] = -h4*S4*(Tv - Tp1[i]);
+    else
+       dW1[i] = -hliqu[i]*Surf_ext1 *((Tv + Tl)/2 - (Tp1[1] + Tp1[Ns])/2);
+    end if;
+
+    /* Power exchanged for each section zone 2*/
+    if (noEvent(abs(dW2[i]) < 0.1)) then
+       dW2[i] = -h4*S4*(Tv - Tp2[i]);
+    else
+       dW2[i] = -hcond2[i]*Surf_ext2*(Tv - Tp2[i]);
+    end if;
+  end for;
+
+  for i in 1:Ns3 loop
+    if Cal_hconv then
+       /* Heat transfer coefficient of vapeur*/
+       if Vertical then
+          // Frank P. & David P. Fundamentals of Heat Transfer  For vertical plate
+          hcond3[i] = COPv*noEvent(min( 1.13*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(max(L3,1)*mul*abs(lsat.T - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000));
+       else
+          // Nusselt corelation
+          hcond3[i] = COPv*noEvent(min(0.728*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*abs(lsat.T - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000));
+       end if;
+    else
+       hcond3[i] = COPv*hcond;
+    end if;
+
+    /* Power exchanged for each section  zone 3 + power exchanged for Deheating*/
+    if (noEvent(abs(dW3[i]) < 0.1)) then
+       dW3[i] = -h4*S4*(Tv - Tp3[i]);
+    else
+       dW3[i] = -hcond3[i]*Surf_ext3*(Tv - Tp3[i]) + W4t/Ns3;
+    end if;
+  end for;
+
+  W1t = sum(dW1);
+  W2t = sum(dW2);
+  W3t = sum(dW3);
+
+  /* Total power exchanged for Deheating*/
+  W4t = noEvent(if (Cv.h > vsat.h) then -Cv.Q*(Cv.h - vsat.h) else -0.0001);
+
+  /* Fluid composition (no balance equations) */
+  Cl.ftype = ftype;
+
+  Cl.Xco2 = 0;
+  Cl.Xh2o = 0;
+  Cl.Xo2  = 0;
+  Cl.Xso2 = 0;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1);
+  else
+    Cl.h = if (Cl.Q > 0) then Cl.h_vol_1 else Cl.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    rv = if Cv.diff_on_1 then exp(-0.033*(Cv.Q*Cv.diff_res_1)^2) else 0;
+    rl = if Cl.diff_on_2 then exp(-0.033*(Cl.Q*Cl.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_v = if Cv.diff_on_1 then 1/Cv.diff_res_1 else gamma0;
+    gamma_l = if Cl.diff_on_2 then 1/Cl.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    Jv = if Cv.diff_on_1 then rv*gamma_v*(Cv.h_vol_1 - Cv.h_vol_2) else 0;
+    Jl = if Cl.diff_on_2 then rl*gamma_l*(Cl.h_vol_2 - Cl.h_vol_1) else 0;
+  else
+    re = 0;
+    rv = 0;
+    rl = 0;
+
+    gamma_e = gamma0;
+    gamma_v = gamma0;
+    gamma_l = gamma0;
+
+    Je = 0;
+    Jv = 0;
+    Jl = 0;
+  end if;
+
+  Jt_l = Je + Jl;
+  Jt_v = Jv;
+
+  Ce.diff_res_2 = 0;
+  Cv.diff_res_2 = 0;
+  Cl.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  Cv.diff_on_2 = diffusion;
+  Cl.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, 0, fluid);
+  prol = ThermoSysPro.Properties.Fluid.Ph((P + Pfond)/2, hl, 0, fluid);
+  provIn = ThermoSysPro.Properties.Fluid.Ph(P, Cv.h, 0, fluid);
+  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid);
+  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid);
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid);
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+  rhov = prov.d;
+  xv = prov.x;
+
+  mul = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tl, fluid);
+  kl = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol, Tl, P, 0, fluid));
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-260,-200},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-142,2},{-124,-6}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{-164,55},{-88,19}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Horizontal_1pipe"),
+        Rectangle(
+          extent={{-158,-6},{-102,-10}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-184,16},{-166,16}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Text(
+          extent={{-198,-6},{-160,-24}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{-180,-8},{-162,-8}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-102,-8},{-96,-8},{-96,16},{-160,16},{-170,16}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{-162,28},{-90,-44}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Text(
+          extent={{-182,-56},{-86,-78}},
+          lineColor={0,0,255},
+          textString=
+               "Vertical Separate"),
+        Rectangle(
+          extent={{-170,-100},{-166,-152}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-114,-76},{-114,-94}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{-116,-100},{-112,-152}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-168,-76},{-168,-94}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Rectangle(
+          extent={{-166,-176},{-120,-180}},
+          lineColor={0,0,255},
+          fillColor={85,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-190,-128},{-172,-136}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 2"),
+        Text(
+          extent={{-152,-180},{-134,-188}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 1"),
+        Text(
+          extent={{-111,-122},{-93,-130}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{-210,-164},{-172,-182}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{-168,-150},{-168,-160},{-114,-160},{-114,-150}},
+          color={0,0,255},
+          pattern=LinePattern.Dash,
+          arrow={Arrow.Filled,Arrow.None}),
+        Line(
+          points={{-183,-168},{-105,-168}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{-182,-96},{-106,-192}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-114,-78},{-114,-72},{-92,-72},{-92,-178},{-120,-178}},
+          color={0,0,255},
+          pattern=LinePattern.Dash,
+          arrow={Arrow.Filled,Arrow.None}),
+        Line(
+          points={{-188,-178},{-170,-178}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Text(
+          extent={{12,-54},{54,-70}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Vertical"),
+        Rectangle(
+          extent={{4,-82},{8,-134}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{6,-58},{6,-76}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{58,-82},{62,-134}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{60,-60},{60,-78}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Rectangle(
+          extent={{10,-142},{56,-146}},
+          lineColor={0,0,255},
+          fillColor={85,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-16,-104},{2,-112}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 2"),
+        Text(
+          extent={{16,-162},{42,-154}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 1"),
+        Text(
+          extent={{65,-112},{83,-120}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{-20,-50},{18,-68}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{6,-134},{6,-144},{60,-144},{60,-134}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-7,-138},{71,-138}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{-8,-78},{70,-152}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{2,-20},{58,-24}},
+          lineColor={0,0,255},
+          fillColor={85,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{32,34},{50,26}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 2"),
+        Text(
+          extent={{16,-26},{34,-34}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 1"),
+        Text(
+          extent={{18,10},{36,2}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{4,60},{56,34}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Horizontal"),
+        Rectangle(
+          extent={{2,2},{58,-2}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{2,26},{58,22}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-24,24},{-6,24}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Line(
+          points={{-36,-22},{-4,-22}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Text(
+          extent={{-58,-10},{-20,-28}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{60,-22},{72,-22},{72,24},{60,24},{58,24}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-20,0},{-2,0}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-20,-22},{-20,-3},{-20,-1}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{58,0},{64,0},{64,12},{-10,12},{-10,24}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{-2,36},{76,-38}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-2,-16},{76,-16}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{-160,18},{-142,14}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{2,26},{20,22}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-170,-100},{-166,-116}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{58,-82},{62,-98}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-234,64},{-164,36}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe4=deheating pipes"),
+        Text(
+          extent={{-158,26},{-140,18}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 4"),
+        Text(
+          extent={{0,34},{18,26}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 4"),
+        Text(
+          extent={{64,-86},{82,-94}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 4"),
+        Text(
+          extent={{-190,-104},{-172,-112}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 4")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-260,-200},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Ellipse(
+          extent={{-100,50},{100,-150}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-260,50},{-60,-150}},
+          lineColor={0,0,255},
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-160,50},{0,-150}},
+          lineColor={28,108,200},
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(points={{-260,-48},{-160,-48}}, color={0,0,0}),
+        Line(
+          points={{-160,-48},{100,-48}},
+          color={0,0,0},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,50},{-160,-150}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-160,-98},{88,-98}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-112},{78,-112}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-126},{66,-126}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-106},{82,-106}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-120},{72,-120}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-132},{56,-132}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-150},{0,-150}},
+          color={0,0,255}),
+        Line(
+          points={{0,50},{0,-150}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-160,-140},{44,-140}},
+          color={0,0,255},
+          pattern=LinePattern.Dash)}),
+    Window(
+      x=0.11,
+      y=0.06,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end TwoPhaseCavity;
diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo
index eedab8432695c89248f0dae7e6fc63b633ed0f20..e0c92579169008a2e73608c181857aa4c3b374bf 100644
--- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo
+++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo
@@ -1,645 +1,645 @@
-within ThermoSysPro.Fluid.Volumes;
-model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass "
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder";
-  parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area";
-  parameter Units.SI.Length L=16.27 "Cavity length";
-  parameter Units.SI.Length Lc=2.5
-    "Support plate spacing in cooling zone(chicanes)";
-  parameter Units.SI.Volume V=pi*R^2*L "Cavity volume";
-  parameter Units.SI.Volume Vmin=1.e-6;
-  parameter Integer Ns=10 "Number of segments";
-  parameter Integer NbTubT=10000 "Number of total pipes in Cavity";
-  parameter Integer NbTubV=150 "Numbers of pipes in a vertical plan in Cavity";
-  parameter Units.SI.Length L2=25 "tubes length";
-  parameter Units.SI.Diameter Dext=0.020 "External pipe diameter";
-  parameter Real COP=1 "Corrective terme for heat exchange coefficient or Fouling coefficient";
-  parameter Real Kcorr=1 "Corrective terme for heat exchange coefficient between the vapor and the liquid Kvl (with a stagnation point Kcorr = 0.5)";
-  parameter Boolean Cal_hcond=false "false : condensation heat transfer coefficient = hcond (parameter) - true: calculate by Nusselt corelation";
-  parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3
-    "Heat transfer coefficient between the vapor and the cooling pipes ";
-  parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.02
-    "Heat exchange coefficient between the wall and the outside ambiant";
-  parameter Units.SI.Temperature Ta=300 "External temperature";
-  parameter Units.SI.Mass Mp=50e3 "Wall mass";
-  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
-  parameter Boolean step_square=true "true: Square step - false: Triangular step";
-  parameter Units.SI.PathLength Ls=L2/Ns "Section length for one pipe";
-  parameter Units.SI.Area Surf_exe=pi*Dext*Ls*NbTubT
-    "Section heat exchange surface";
-  parameter Units.SI.Area Surf_tot=Surf_exe*Ns "Total heat exchange surface";
-  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0=1.e5
-    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi;
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-
-public
-  Units.SI.Pressure P(start=10000) "Fluid average pressure";
-  Units.SI.Pressure Pfond(start=11000)
-    "Fluid pressure at the bottom of the cavity";
-  Units.SI.SpecificEnthalpy hl(start=200e3) "Liquid phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hv(start=250e3) "Gas phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hvIn(start=2400000)
-    "Steam average specific enthalpy input cavity";
-  Units.SI.Temperature Tl(start=310) "Liquid phase temperature";
-  Units.SI.Temperature Tv(start=320) "Gas phase temperature";
-  Units.SI.Volume Vl(start=100) "Liquid phase volume";
-  Units.SI.Volume Vv(start=2000) "Gas phase volume";
-  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
-  Real xv(start=0) "Mass vapor fraction in the gas phase";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Gas phase density";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phaser";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond(start=1000)
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate QcondS(start=100)
-    "Splitter mass flow rate of the liquid phase from the two-phase input";
-  Units.SI.Power Wvl
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  Units.SI.Power Wlp
-    "Thermal power exchanged from the liquid phase to the wall";
-  Units.SI.Power Wvp "Thermal power exchanged from the gas phase to the wall";
-  Units.SI.Power Wpa "Thermal power losses to ambiant";
-  Units.SI.Power dW[Ns](start=fill(10e5, Ns))
-    "Power exchange between the wall and the fluid in each section side 3";
-  Units.SI.Power Wt "Total power exchanged on the water side 3";
-  Units.SI.Power Wt2(start=0) "Total power exchanged Deheating zone";
-  Units.SI.Temperature Tp1[Ns](start=fill(320, Ns))
-    "Wall temperature in section i of side 1";
-  Units.SI.Temperature Tp(start=320) "Wall temperature of cavity";
-  Units.SI.Position zl(start=1.05) "Liquid level in Cavity";
-  Units.SI.Area Al "Cross sectional area of the liquid phase";
-  Units.SI.Angle theta "Angle";
-  Units.SI.Area Avl(start=1.0)
-    "Heat exchange surface between the liquid and gas phases";
-  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
-  Units.SI.Area Avp "Gas phase surface on contact with the wall";
-  Units.SI.Area Ape "Wall surface on contact with the outside";
-  Units.SI.ReynoldsNumber Rel(start=6.e4) "Liquid phase Reynolds number";
-  Units.SI.ReynoldsNumber Rev(start=6.e3) "Steam phase Reynolds number";
-  Units.SI.ReynoldsNumber Revl(start=6.e3) "Steam liquid Reynolds number";
-  Units.SI.ThermalConductivity kl(start=1) "Liquid phase thermal conductivity";
-  Units.SI.ThermalConductivity kv(start=1) "Steam phase thermal conductivity";
-  Units.SI.DynamicViscosity mul(start=2.e-4) "Liquid phase dynamic viscosity ";
-  Units.SI.DynamicViscosity muv(start=2.e-5) "Steam phase dynamic viscosity ";
-  Units.SI.CoefficientOfHeatTransfer hcond3[Ns](start=fill(1e4, Ns))
-    "Heat transfer coefficient between the vapor and the cooling pipes 2";
-  Units.SI.CoefficientOfHeatTransfer Kvl(start=10)
-    "Heat exchange coefficient between the liquid and gas phases";
-  Units.SI.CoefficientOfHeatTransfer Klp(start=10)
-    "Heat exchange coefficient between the liquid phase and the wall";
-  Units.SI.CoefficientOfHeatTransfer Kvp(start=10)
-    "Heat exchange coefficient between the gas phase and the wall";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.Power Je "Thermal power diffusion from inlet Ce";
-  Units.SI.Power JvGCT "Thermal power diffusion from inlet CvGCT";
-  Units.SI.Power JvBP "Thermal power diffusion from inlet CvBP";
-  Units.SI.Power Jl "Thermal power diffusion from outlet Cl";
-  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
-  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet Ce";
-  Units.SI.MassFlowRate gamma_vGCT "Diffusion conductance for inlet CvGCT";
-  Units.SI.MassFlowRate gamma_vBP "Diffusion conductance for inlet CvBP";
-  Units.SI.MassFlowRate gamma_l "Diffusion conductance for outlet Cl";
-  Real re "Value of r(Q/gamma) for inlet Ce";
-  Real rvGCT "Value of r(Q/gamma) for inlet CvGCT";
-  Real rvBP "Value of r(Q/gamma) for inlet CvBP";
-  Real rl "Value of r(Q/gamma) for outlet Cl";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-250,70},{-210,110}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{60,70},{100,110}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-250,-200},{-210,-160}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{58,-200},{98,-160}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet CvBP "Steam input" annotation (Placement(
-        transformation(extent={{-86,50},{-66,70}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cl "Water output" annotation (Placement(
-        transformation(extent={{-85,-170},{-65,-150}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns]
-                                     annotation (Placement(transformation(
-          extent={{-82,0},{-70,12}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"                        annotation (Placement(transformation(
-          extent={{88,-107},{108,-87}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{-250,-16},{-210,24}},
-          rotation=0)));
-  Interfaces.Connectors.FluidInlet Ce "Water input" annotation (Placement(
-        transformation(extent={{-219,19},{-199,39}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-250,-106},{-210,-66}}, rotation=0)));
-  Properties.WaterSteam.Common.ThermoProperties_ph provIn
-    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{0,70},{40,110}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet CvGCT "Steam input" annotation (Placement(
-        transformation(extent={{-160,50},{-140,70}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      der(hl) = 0;
-      der(hv) = 0;
-      //Vl = Vf0*V; // without liquid level control
-      der(Vl) = 0;  // with liquid level control
-      der(P) = 0;
-      der(Tp) = 0;
-      der(hvIn) = 0;
-    else
-      hl = lsat.h;
-      hv = vsat.h;
-      Vl = Vf0*V;
-      P = P0;
-      Tp = 320;
-      hvIn = hv;
-    end if;
-  end if;
-
-equation
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = CvGCT.ftype;
-  fluids[4] = CvBP.ftype;
-  fluids[5] = Cl.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "TwoPhaseCavityOnePipe: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.h_vol_1 = 1.e5;
-    Ce.diff_res_1 = 0;
-    Ce.diff_on_1 = false;
-    Ce.ftype = ftype;
-    Ce.Xco2 = 0;
-    Ce.Xh2o = 1;
-    Ce.Xo2 = 0;
-    Ce.Xso2 = 0;
-  end if;
-
-  if (cardinality(CvGCT) == 0) then
-    CvGCT.Q = 0;
-    CvGCT.h = 1.e5;
-    CvGCT.h_vol_1 = 1.e5;
-    CvGCT.diff_res_1 = 0;
-    CvGCT.diff_on_1 = false;
-    CvGCT.ftype = ftype;
-    CvGCT.Xco2 = 0;
-    CvGCT.Xh2o = 1;
-    CvGCT.Xo2 = 0;
-    CvGCT.Xso2 = 0;
-  end if;
-
-  if (cardinality(CvBP) == 0) then
-    CvBP.Q = 0;
-    CvBP.h = 1.e5;
-    CvBP.h_vol_1 = 1.e5;
-    CvBP.diff_res_1 = 0;
-    CvBP.diff_on_1 = false;
-    CvBP.ftype = ftype;
-    CvBP.Xco2 = 0;
-    CvBP.Xh2o = 1;
-    CvBP.Xo2 = 0;
-    CvBP.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cl) == 0) then
-    Cl.Q = 0;
-    Cl.h_vol_2 = 1.e5;
-    Cl.diff_res_2 = 0;
-    Cl.diff_on_2 = false;
-  end if;
-
-  /* Wall temperature and heat flow rate*/
-  Cth3.T = Tp1;
-  Cth3.W = dW;
-
-  /* Liquid volume */
-  if Vertical then
-     theta = 1;
-     Al = pi*R^2;
-     Vl = Al*zl;
-     Avl = Al;
-  else
-     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
-     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
-     Vl = Al*L;
-     Avl = 2*R*Modelica.Math.cos(theta)*L;
-  end if;
-
-  /* Cavity volume */
-  V = Vl + Vv;
-
-  /* Water level */
-  yLevel.signal = zl;
-
-  /* Liquid surface and vapor surface on contact with wall */
-  Alp = if Vertical then 2*pi*R*zl + Al else (pi - 2*theta)*R*L + 2*Al;
-  Avp = if Vertical then 2*pi*R*(L-zl) + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al);
-
-  /* Wall surface on contact with the outside */
-  Ape = Alp + Avp;
-
-  /* Pressure at the bottom of the cavity */
-  Pfond = P + prod.d*g*zl;
-
-  /* Liquid phase mass balance equation */
-  BQl = -Cl.Q + Qcond + QcondS + (1 - proe.x)*Ce.Q;
-
-  if dynamic_energy_balance then
-    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-  else
-    0 = BQl;
-  end if;
-
-  /* Vapor phase mass balance equation */
-  BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + proe.x*Ce.Q;
-
-  if dynamic_energy_balance then
-    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-  else
-    0 = BQv;
-  end if;
-
-  Cl.P = Pfond;
-  CvGCT.P = P;
-  CvBP.P = P;
-  Ce.P = P;
-
-  /* Liquid phase energy balance equation */
-  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + (Qcond + QcondS)*(lsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wlp + Wvl + Jt_l;
-
-  if dynamic_energy_balance then
-    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-  else
-    0 = BHl;
-  end if;
-
-  /* Gas phase energy balance equation */
-  BHv = CvBP.Q*(CvBP.h - (hv - P/rhov)) + CvGCT.Q*(CvGCT.h - (hv - P/rhov)) - (Qcond + QcondS)*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wvp + Wt + Jt_v;
-
-  if dynamic_energy_balance then
-    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-  else
-    0 = BHv;
-  end if;
-
-  Ce.h_vol_2 = hl;
-  CvGCT.h_vol_2 = hv;
-  CvBP.h_vol_2 = hv;
-  Cl.h_vol_1 = hl;
-
-  /* Condensation mass flow rates */
-  // Only the power used to condensate steam
-  Qcond = (-Wt + Wt2 + noEvent(max(Wvl, 0)) + Wvp)/(vsat.h - lsat.h);
-
-  QcondS = (1 - provIn.x)*(CvBP.Q + CvGCT.Q);
-
-  /* Steam average specific enthalpy input cavity */
-  // 0 = noEvent(hvIn*(max(CvBP.Q, 1e-10) + max(CvGCT.Q, 1e-10)) - max(CvBP.Q, 1e-10)*CvBP.h - max(CvGCT.Q, 1e-10)*CvGCT.h);
-  if dynamic_energy_balance then
-    0.1*provIn.d*der(hvIn) = CvBP.Q*(CvBP.h - (hvIn - P/rhov)) + CvGCT.Q*(CvGCT.h - (hvIn - P/rhov));
-  else
-    0 = hvIn*(CvBP.Q + CvGCT.Q) - CvBP.Q*CvBP.h - CvGCT.Q*CvGCT.h;
-  end if;
-
-  /* Fluid composition (no balance equations) */
-  Cl.ftype = ftype;
-
-  Cl.Xco2 = 0;
-  Cl.Xh2o = 1;
-  Cl.Xo2  = 0;
-  Cl.Xso2 = 0;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1);
-  else
-    Cl.h = if (Cl.Q > 0) then Cl.h_vol_1 else Cl.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    rvGCT = if CvGCT.diff_on_1 then exp(-0.033*(CvGCT.Q*CvGCT.diff_res_1)^2) else 0;
-    rvBP = if CvBP.diff_on_1 then exp(-0.033*(CvBP.Q*CvBP.diff_res_1)^2) else 0;
-    rl = if Cl.diff_on_2 then exp(-0.033*(Cl.Q*Cl.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_vGCT = if CvGCT.diff_on_1 then 1/CvGCT.diff_res_1 else gamma0;
-    gamma_vBP = if CvBP.diff_on_1 then 1/CvBP.diff_res_1 else gamma0;
-    gamma_l = if Cl.diff_on_2 then 1/Cl.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    JvGCT = if CvGCT.diff_on_1 then rvGCT*gamma_vGCT*(CvGCT.h_vol_1 - CvGCT.h_vol_2) else 0;
-    JvBP = if CvBP.diff_on_1 then rvBP*gamma_vBP*(CvBP.h_vol_1 - CvBP.h_vol_2) else 0;
-    Jl = if Cl.diff_on_2 then rl*gamma_l*(Cl.h_vol_2 - Cl.h_vol_1) else 0;
-  else
-    re = 0;
-    rvGCT = 0;
-    rvBP = 0;
-    rl = 0;
-
-    gamma_e = gamma0;
-    gamma_vGCT = gamma0;
-    gamma_vBP = gamma0;
-    gamma_l = gamma0;
-
-    Je = 0;
-    JvGCT = 0;
-    JvBP = 0;
-    Jl = 0;
-  end if;
-
-  Jt_l = Je + Jl;
-  Jt_v = JvGCT + JvBP;
-
-  Ce.diff_res_2 = 0;
-  CvGCT.diff_res_2 = 0;
-  CvBP.diff_res_2 = 0;
-  Cl.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  CvGCT.diff_on_2 = diffusion;
-  CvBP.diff_on_2 = diffusion;
-  Cl.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties*/
-  proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, 0, fluid);
-  prol = ThermoSysPro.Properties.Fluid.Ph((P+Pfond)/2, hl, 0, fluid);
-
-  provIn = ThermoSysPro.Properties.Fluid.Ph(P,  hvIn,  0, fluid);
-  prov = ThermoSysPro.Properties.Fluid.Ph(P,  hv,  0, fluid);
-  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond,  Cl.h, 0, fluid);
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid);
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-  rhov = prov.d;
-  xv = prov.x;
-
-  muv = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(provIn.d, provIn.T, fluid);
-  mul = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tl, fluid);
-  kl = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol, Tl, P, 0, fluid));
-  kv = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(provIn.d, provIn.T, P, 0,fluid));
-
-  /* Heat transfer coefficient between liquid and wall*/
-  /* SACADURA, Von Karman equation*/
-  Rel = noEvent(abs(Cl.Q*zl/(pi*R^2*mul)));
-
-  Klp = 0.037*kl*Rel^0.8*(mul*prol.cp/kl)^0.3333/zl;
-
-  /* Heat transfer coefficient between steam and wall*/
-  Rev = noEvent(abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(L - zl)/(pi*R^2*muv)));
-  Revl = noEvent(abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(2*R)/(pi*R^2*muv)));
-
-  Kvp = 0.037*kv*Rev^0.8*(muv*prov.cp/kv)^0.3333/(L - zl);
-
-  /* Heat transfer coefficient between steam and liquid */
-  Kvl = 0.105*kv*Revl^0.68*(muv*prov.cp/kv)^0.33333*(L/2/R)^(-0.103)/(2*R);
-
-  /* Thermal power losses*/
-  /* Energy balance equation at the wall */
-  if dynamic_energy_balance then
-    Mp*cpp*der(Tp) = Wlp + Wvp - Wpa;
-  else
-    0 = Wlp + Wvp - Wpa;
-  end if;
-
-  /* Heat exchange between liquid and gas phases */
-  Wvl = Kcorr*Kvl*Avl*(Tv - Tl);
-
-  /* Heat exchange between the liquid phase and the wall */
-  Wlp = Klp*Alp*(Tl - Tp);
-
-  /* Heat exchange between the gas phase and the wall */
-  Wvp = Kvp*Avp*(Tv - Tp);
-
-  /* Thermal power losses to ambiant, for simplifid we use the wall surface on contact with the fluid (Ape)*/
-  Wpa = Kpa*Ape*(Tp - Ta);
-
-  for i in 1:Ns loop
-    /* Heat transfer coefficient of liquid*/
-    if Cal_hcond then
-      // Nusselt corelation
-      hcond3[i] = ThermoSysPro.Functions.SmoothCond(Tv - Tp1[i],
-                       COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*ThermoSysPro.Functions.SmoothMax((Tv-Tp1[i]), 0.1)))^0.25,
-                       COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*0.1))^0.25);
-    else
-      hcond3[i] = hcond;
-    end if;
-
-    /* Power exchanged for each section */
-    dW[i] = -hcond3[i]*(Tv - Tp1[i])*Surf_exe + Wt2/Ns;
-  end for;
-
-  Wt = sum(dW);
-
-  /* Total power exchanged for deheating*/
-  /* This equation is not valid for mass flow rate in the pipes = 0 */
-  Wt2 = noEvent(if (hvIn > vsat.h) then -(CvBP.Q + CvGCT.Q)*(hvIn - vsat.h) else 0);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-200},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-96,-68},{-78,-76}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{-118,-15},{-42,-51}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Horizontal_1pipe"),
-        Rectangle(
-          extent={{-112,-76},{-56,-80}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-138,-54},{-120,-54}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Text(
-          extent={{-152,-76},{-114,-94}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{-134,-78},{-116,-78}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-56,-78},{-50,-78},{-50,-54},{-114,-54},{-124,-54}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{-116,-42},{-44,-114}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{-114,-52},{-96,-56}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-126,42},{-32,12}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Condensation pipes"),
-        Text(
-          extent={{-114,30},{-48,6}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               " +  Deheating pipes")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-200},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Ellipse(
-          extent={{-100,50},{100,-150}},
-          lineColor={28,108,200},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-250,50},{-50,-150}},
-          lineColor={28,108,200},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-160,50},{8,-150}},
-          lineColor={28,108,200},
-          fillColor= DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-238,-98},{88,-98}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-228,-112},{78,-112}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-214,-126},{66,-126}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-196,-138},{48,-138}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-232,-106},{82,-106}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-222,-118},{72,-118}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-206,-132},{56,-132}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-182,-144},{32,-144}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-150},{8,-150}},
-          color={0,0,255}),
-        Line(points={{-160,50},{10,50}}, color={0,0,255}),
-        Text(
-          extent={{-90,84},{-58,70}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString="Steam LP"),
-        Text(
-          extent={{-164,84},{-132,70}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Steam HP"),
-        Text(
-          extent={{-248,52},{-206,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString="Water/steam")}),
-    Window(
-      x=0.11,
-      y=0.06,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end TwoPhaseCavityOnePipe;
+within ThermoSysPro.Fluid.Volumes;
+model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass "
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder";
+  parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area";
+  parameter Units.SI.Length L=16.27 "Cavity length";
+  parameter Units.SI.Length Lc=2.5
+    "Support plate spacing in cooling zone(chicanes)";
+  parameter Units.SI.Volume V=pi*R^2*L "Cavity volume";
+  parameter Units.SI.Volume Vmin=1.e-6;
+  parameter Integer Ns=10 "Number of segments";
+  parameter Integer NbTubT=10000 "Number of total pipes in Cavity";
+  parameter Integer NbTubV=150 "Numbers of pipes in a vertical plan in Cavity";
+  parameter Units.SI.Length L2=25 "tubes length";
+  parameter Units.SI.Diameter Dext=0.020 "External pipe diameter";
+  parameter Real COP=1 "Corrective terme for heat exchange coefficient or Fouling coefficient";
+  parameter Real Kcorr=1 "Corrective terme for heat exchange coefficient between the vapor and the liquid Kvl (with a stagnation point Kcorr = 0.5)";
+  parameter Boolean Cal_hcond=false "false : condensation heat transfer coefficient = hcond (parameter) - true: calculate by Nusselt corelation";
+  parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3
+    "Heat transfer coefficient between the vapor and the cooling pipes ";
+  parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.02
+    "Heat exchange coefficient between the wall and the outside ambiant";
+  parameter Units.SI.Temperature Ta=300 "External temperature";
+  parameter Units.SI.Mass Mp=50e3 "Wall mass";
+  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
+  parameter Boolean step_square=true "true: Square step - false: Triangular step";
+  parameter Units.SI.PathLength Ls=L2/Ns "Section length for one pipe";
+  parameter Units.SI.Area Surf_exe=pi*Dext*Ls*NbTubT
+    "Section heat exchange surface";
+  parameter Units.SI.Area Surf_tot=Surf_exe*Ns "Total heat exchange surface";
+  parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0=1.e5
+    "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi;
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+
+public
+  Units.SI.Pressure P(start=10000) "Fluid average pressure";
+  Units.SI.Pressure Pfond(start=11000)
+    "Fluid pressure at the bottom of the cavity";
+  Units.SI.SpecificEnthalpy hl(start=200e3) "Liquid phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hv(start=250e3) "Gas phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hvIn(start=2400000)
+    "Steam average specific enthalpy input cavity";
+  Units.SI.Temperature Tl(start=310) "Liquid phase temperature";
+  Units.SI.Temperature Tv(start=320) "Gas phase temperature";
+  Units.SI.Volume Vl(start=100) "Liquid phase volume";
+  Units.SI.Volume Vv(start=2000) "Gas phase volume";
+  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
+  Real xv(start=0) "Mass vapor fraction in the gas phase";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Gas phase density";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phaser";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond(start=1000)
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate QcondS(start=100)
+    "Splitter mass flow rate of the liquid phase from the two-phase input";
+  Units.SI.Power Wvl
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  Units.SI.Power Wlp
+    "Thermal power exchanged from the liquid phase to the wall";
+  Units.SI.Power Wvp "Thermal power exchanged from the gas phase to the wall";
+  Units.SI.Power Wpa "Thermal power losses to ambiant";
+  Units.SI.Power dW[Ns](start=fill(10e5, Ns))
+    "Power exchange between the wall and the fluid in each section side 3";
+  Units.SI.Power Wt "Total power exchanged on the water side 3";
+  Units.SI.Power Wt2(start=0) "Total power exchanged Deheating zone";
+  Units.SI.Temperature Tp1[Ns](start=fill(320, Ns))
+    "Wall temperature in section i of side 1";
+  Units.SI.Temperature Tp(start=320) "Wall temperature of cavity";
+  Units.SI.Position zl(start=1.05) "Liquid level in Cavity";
+  Units.SI.Area Al "Cross sectional area of the liquid phase";
+  Units.SI.Angle theta "Angle";
+  Units.SI.Area Avl(start=1.0)
+    "Heat exchange surface between the liquid and gas phases";
+  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
+  Units.SI.Area Avp "Gas phase surface on contact with the wall";
+  Units.SI.Area Ape "Wall surface on contact with the outside";
+  Units.SI.ReynoldsNumber Rel(start=6.e4) "Liquid phase Reynolds number";
+  Units.SI.ReynoldsNumber Rev(start=6.e3) "Steam phase Reynolds number";
+  Units.SI.ReynoldsNumber Revl(start=6.e3) "Steam liquid Reynolds number";
+  Units.SI.ThermalConductivity kl(start=1) "Liquid phase thermal conductivity";
+  Units.SI.ThermalConductivity kv(start=1) "Steam phase thermal conductivity";
+  Units.SI.DynamicViscosity mul(start=2.e-4) "Liquid phase dynamic viscosity ";
+  Units.SI.DynamicViscosity muv(start=2.e-5) "Steam phase dynamic viscosity ";
+  Units.SI.CoefficientOfHeatTransfer hcond3[Ns](start=fill(1e4, Ns))
+    "Heat transfer coefficient between the vapor and the cooling pipes 2";
+  Units.SI.CoefficientOfHeatTransfer Kvl(start=10)
+    "Heat exchange coefficient between the liquid and gas phases";
+  Units.SI.CoefficientOfHeatTransfer Klp(start=10)
+    "Heat exchange coefficient between the liquid phase and the wall";
+  Units.SI.CoefficientOfHeatTransfer Kvp(start=10)
+    "Heat exchange coefficient between the gas phase and the wall";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.Power Je "Thermal power diffusion from inlet Ce";
+  Units.SI.Power JvGCT "Thermal power diffusion from inlet CvGCT";
+  Units.SI.Power JvBP "Thermal power diffusion from inlet CvBP";
+  Units.SI.Power Jl "Thermal power diffusion from outlet Cl";
+  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
+  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet Ce";
+  Units.SI.MassFlowRate gamma_vGCT "Diffusion conductance for inlet CvGCT";
+  Units.SI.MassFlowRate gamma_vBP "Diffusion conductance for inlet CvBP";
+  Units.SI.MassFlowRate gamma_l "Diffusion conductance for outlet Cl";
+  Real re "Value of r(Q/gamma) for inlet Ce";
+  Real rvGCT "Value of r(Q/gamma) for inlet CvGCT";
+  Real rvBP "Value of r(Q/gamma) for inlet CvBP";
+  Real rl "Value of r(Q/gamma) for outlet Cl";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-250,70},{-210,110}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{60,70},{100,110}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-250,-200},{-210,-160}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{58,-200},{98,-160}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet CvBP "Steam input" annotation (Placement(
+        transformation(extent={{-86,50},{-66,70}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cl "Water output" annotation (Placement(
+        transformation(extent={{-85,-170},{-65,-150}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns]
+                                     annotation (Placement(transformation(
+          extent={{-82,0},{-70,12}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"                        annotation (Placement(transformation(
+          extent={{88,-107},{108,-87}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{-250,-16},{-210,24}},
+          rotation=0)));
+  Interfaces.Connectors.FluidInlet Ce "Water input" annotation (Placement(
+        transformation(extent={{-219,19},{-199,39}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-250,-106},{-210,-66}}, rotation=0)));
+  Properties.WaterSteam.Common.ThermoProperties_ph provIn
+    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{0,70},{40,110}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet CvGCT "Steam input" annotation (Placement(
+        transformation(extent={{-160,50},{-140,70}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      der(hl) = 0;
+      der(hv) = 0;
+      //Vl = Vf0*V; // without liquid level control
+      der(Vl) = 0;  // with liquid level control
+      der(P) = 0;
+      der(Tp) = 0;
+      der(hvIn) = 0;
+    else
+      hl = lsat.h;
+      hv = vsat.h;
+      Vl = Vf0*V;
+      P = P0;
+      Tp = 320;
+      hvIn = hv;
+    end if;
+  end if;
+
+equation
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = CvGCT.ftype;
+  fluids[4] = CvBP.ftype;
+  fluids[5] = Cl.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "TwoPhaseCavityOnePipe: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.h_vol_1 = 1.e5;
+    Ce.diff_res_1 = 0;
+    Ce.diff_on_1 = false;
+    Ce.ftype = ftype;
+    Ce.Xco2 = 0;
+    Ce.Xh2o = 0;
+    Ce.Xo2 = 0;
+    Ce.Xso2 = 0;
+  end if;
+
+  if (cardinality(CvGCT) == 0) then
+    CvGCT.Q = 0;
+    CvGCT.h = 1.e5;
+    CvGCT.h_vol_1 = 1.e5;
+    CvGCT.diff_res_1 = 0;
+    CvGCT.diff_on_1 = false;
+    CvGCT.ftype = ftype;
+    CvGCT.Xco2 = 0;
+    CvGCT.Xh2o = 0;
+    CvGCT.Xo2 = 0;
+    CvGCT.Xso2 = 0;
+  end if;
+
+  if (cardinality(CvBP) == 0) then
+    CvBP.Q = 0;
+    CvBP.h = 1.e5;
+    CvBP.h_vol_1 = 1.e5;
+    CvBP.diff_res_1 = 0;
+    CvBP.diff_on_1 = false;
+    CvBP.ftype = ftype;
+    CvBP.Xco2 = 0;
+    CvBP.Xh2o = 0;
+    CvBP.Xo2 = 0;
+    CvBP.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cl) == 0) then
+    Cl.Q = 0;
+    Cl.h_vol_2 = 1.e5;
+    Cl.diff_res_2 = 0;
+    Cl.diff_on_2 = false;
+  end if;
+
+  /* Wall temperature and heat flow rate*/
+  Cth3.T = Tp1;
+  Cth3.W = dW;
+
+  /* Liquid volume */
+  if Vertical then
+     theta = 1;
+     Al = pi*R^2;
+     Vl = Al*zl;
+     Avl = Al;
+  else
+     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
+     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
+     Vl = Al*L;
+     Avl = 2*R*Modelica.Math.cos(theta)*L;
+  end if;
+
+  /* Cavity volume */
+  V = Vl + Vv;
+
+  /* Water level */
+  yLevel.signal = zl;
+
+  /* Liquid surface and vapor surface on contact with wall */
+  Alp = if Vertical then 2*pi*R*zl + Al else (pi - 2*theta)*R*L + 2*Al;
+  Avp = if Vertical then 2*pi*R*(L-zl) + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al);
+
+  /* Wall surface on contact with the outside */
+  Ape = Alp + Avp;
+
+  /* Pressure at the bottom of the cavity */
+  Pfond = P + prod.d*g*zl;
+
+  /* Liquid phase mass balance equation */
+  BQl = -Cl.Q + Qcond + QcondS + (1 - proe.x)*Ce.Q;
+
+  if dynamic_energy_balance then
+    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+  else
+    0 = BQl;
+  end if;
+
+  /* Vapor phase mass balance equation */
+  BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + proe.x*Ce.Q;
+
+  if dynamic_energy_balance then
+    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+  else
+    0 = BQv;
+  end if;
+
+  Cl.P = Pfond;
+  CvGCT.P = P;
+  CvBP.P = P;
+  Ce.P = P;
+
+  /* Liquid phase energy balance equation */
+  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + (Qcond + QcondS)*(lsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wlp + Wvl + Jt_l;
+
+  if dynamic_energy_balance then
+    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+  else
+    0 = BHl;
+  end if;
+
+  /* Gas phase energy balance equation */
+  BHv = CvBP.Q*(CvBP.h - (hv - P/rhov)) + CvGCT.Q*(CvGCT.h - (hv - P/rhov)) - (Qcond + QcondS)*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wvp + Wt + Jt_v;
+
+  if dynamic_energy_balance then
+    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+  else
+    0 = BHv;
+  end if;
+
+  Ce.h_vol_2 = hl;
+  CvGCT.h_vol_2 = hv;
+  CvBP.h_vol_2 = hv;
+  Cl.h_vol_1 = hl;
+
+  /* Condensation mass flow rates */
+  // Only the power used to condensate steam
+  Qcond = (-Wt + Wt2 + noEvent(max(Wvl, 0)) + Wvp)/(vsat.h - lsat.h);
+
+  QcondS = (1 - provIn.x)*(CvBP.Q + CvGCT.Q);
+
+  /* Steam average specific enthalpy input cavity */
+  // 0 = noEvent(hvIn*(max(CvBP.Q, 1e-10) + max(CvGCT.Q, 1e-10)) - max(CvBP.Q, 1e-10)*CvBP.h - max(CvGCT.Q, 1e-10)*CvGCT.h);
+  if dynamic_energy_balance then
+    0.1*provIn.d*der(hvIn) = CvBP.Q*(CvBP.h - (hvIn - P/rhov)) + CvGCT.Q*(CvGCT.h - (hvIn - P/rhov));
+  else
+    0 = hvIn*(CvBP.Q + CvGCT.Q) - CvBP.Q*CvBP.h - CvGCT.Q*CvGCT.h;
+  end if;
+
+  /* Fluid composition (no balance equations) */
+  Cl.ftype = ftype;
+
+  Cl.Xco2 = 0;
+  Cl.Xh2o = 0;
+  Cl.Xo2  = 0;
+  Cl.Xso2 = 0;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1);
+  else
+    Cl.h = if (Cl.Q > 0) then Cl.h_vol_1 else Cl.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    rvGCT = if CvGCT.diff_on_1 then exp(-0.033*(CvGCT.Q*CvGCT.diff_res_1)^2) else 0;
+    rvBP = if CvBP.diff_on_1 then exp(-0.033*(CvBP.Q*CvBP.diff_res_1)^2) else 0;
+    rl = if Cl.diff_on_2 then exp(-0.033*(Cl.Q*Cl.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_vGCT = if CvGCT.diff_on_1 then 1/CvGCT.diff_res_1 else gamma0;
+    gamma_vBP = if CvBP.diff_on_1 then 1/CvBP.diff_res_1 else gamma0;
+    gamma_l = if Cl.diff_on_2 then 1/Cl.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    JvGCT = if CvGCT.diff_on_1 then rvGCT*gamma_vGCT*(CvGCT.h_vol_1 - CvGCT.h_vol_2) else 0;
+    JvBP = if CvBP.diff_on_1 then rvBP*gamma_vBP*(CvBP.h_vol_1 - CvBP.h_vol_2) else 0;
+    Jl = if Cl.diff_on_2 then rl*gamma_l*(Cl.h_vol_2 - Cl.h_vol_1) else 0;
+  else
+    re = 0;
+    rvGCT = 0;
+    rvBP = 0;
+    rl = 0;
+
+    gamma_e = gamma0;
+    gamma_vGCT = gamma0;
+    gamma_vBP = gamma0;
+    gamma_l = gamma0;
+
+    Je = 0;
+    JvGCT = 0;
+    JvBP = 0;
+    Jl = 0;
+  end if;
+
+  Jt_l = Je + Jl;
+  Jt_v = JvGCT + JvBP;
+
+  Ce.diff_res_2 = 0;
+  CvGCT.diff_res_2 = 0;
+  CvBP.diff_res_2 = 0;
+  Cl.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  CvGCT.diff_on_2 = diffusion;
+  CvBP.diff_on_2 = diffusion;
+  Cl.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties*/
+  proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, 0, fluid);
+  prol = ThermoSysPro.Properties.Fluid.Ph((P+Pfond)/2, hl, 0, fluid);
+
+  provIn = ThermoSysPro.Properties.Fluid.Ph(P,  hvIn,  0, fluid);
+  prov = ThermoSysPro.Properties.Fluid.Ph(P,  hv,  0, fluid);
+  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond,  Cl.h, 0, fluid);
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid);
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+  rhov = prov.d;
+  xv = prov.x;
+
+  muv = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(provIn.d, provIn.T, fluid);
+  mul = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tl, fluid);
+  kl = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol, Tl, P, 0, fluid));
+  kv = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(provIn.d, provIn.T, P, 0,fluid));
+
+  /* Heat transfer coefficient between liquid and wall*/
+  /* SACADURA, Von Karman equation*/
+  Rel = noEvent(abs(Cl.Q*zl/(pi*R^2*mul)));
+
+  Klp = 0.037*kl*Rel^0.8*(mul*prol.cp/kl)^0.3333/zl;
+
+  /* Heat transfer coefficient between steam and wall*/
+  Rev = noEvent(abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(L - zl)/(pi*R^2*muv)));
+  Revl = noEvent(abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(2*R)/(pi*R^2*muv)));
+
+  Kvp = 0.037*kv*Rev^0.8*(muv*prov.cp/kv)^0.3333/(L - zl);
+
+  /* Heat transfer coefficient between steam and liquid */
+  Kvl = 0.105*kv*Revl^0.68*(muv*prov.cp/kv)^0.33333*(L/2/R)^(-0.103)/(2*R);
+
+  /* Thermal power losses*/
+  /* Energy balance equation at the wall */
+  if dynamic_energy_balance then
+    Mp*cpp*der(Tp) = Wlp + Wvp - Wpa;
+  else
+    0 = Wlp + Wvp - Wpa;
+  end if;
+
+  /* Heat exchange between liquid and gas phases */
+  Wvl = Kcorr*Kvl*Avl*(Tv - Tl);
+
+  /* Heat exchange between the liquid phase and the wall */
+  Wlp = Klp*Alp*(Tl - Tp);
+
+  /* Heat exchange between the gas phase and the wall */
+  Wvp = Kvp*Avp*(Tv - Tp);
+
+  /* Thermal power losses to ambiant, for simplifid we use the wall surface on contact with the fluid (Ape)*/
+  Wpa = Kpa*Ape*(Tp - Ta);
+
+  for i in 1:Ns loop
+    /* Heat transfer coefficient of liquid*/
+    if Cal_hcond then
+      // Nusselt corelation
+      hcond3[i] = ThermoSysPro.Functions.SmoothCond(Tv - Tp1[i],
+                       COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*ThermoSysPro.Functions.SmoothMax((Tv-Tp1[i]), 0.1)))^0.25,
+                       COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*0.1))^0.25);
+    else
+      hcond3[i] = hcond;
+    end if;
+
+    /* Power exchanged for each section */
+    dW[i] = -hcond3[i]*(Tv - Tp1[i])*Surf_exe + Wt2/Ns;
+  end for;
+
+  Wt = sum(dW);
+
+  /* Total power exchanged for deheating*/
+  /* This equation is not valid for mass flow rate in the pipes = 0 */
+  Wt2 = noEvent(if (hvIn > vsat.h) then -(CvBP.Q + CvGCT.Q)*(hvIn - vsat.h) else 0);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-200},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-96,-68},{-78,-76}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{-118,-15},{-42,-51}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Horizontal_1pipe"),
+        Rectangle(
+          extent={{-112,-76},{-56,-80}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-138,-54},{-120,-54}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Text(
+          extent={{-152,-76},{-114,-94}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{-134,-78},{-116,-78}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-56,-78},{-50,-78},{-50,-54},{-114,-54},{-124,-54}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{-116,-42},{-44,-114}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{-114,-52},{-96,-56}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-126,42},{-32,12}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Condensation pipes"),
+        Text(
+          extent={{-114,30},{-48,6}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               " +  Deheating pipes")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-200},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Ellipse(
+          extent={{-100,50},{100,-150}},
+          lineColor={28,108,200},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-250,50},{-50,-150}},
+          lineColor={28,108,200},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-160,50},{8,-150}},
+          lineColor={28,108,200},
+          fillColor= DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-238,-98},{88,-98}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-228,-112},{78,-112}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-214,-126},{66,-126}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-196,-138},{48,-138}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-232,-106},{82,-106}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-222,-118},{72,-118}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-206,-132},{56,-132}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-182,-144},{32,-144}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-150},{8,-150}},
+          color={0,0,255}),
+        Line(points={{-160,50},{10,50}}, color={0,0,255}),
+        Text(
+          extent={{-90,84},{-58,70}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString="Steam LP"),
+        Text(
+          extent={{-164,84},{-132,70}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Steam HP"),
+        Text(
+          extent={{-248,52},{-206,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString="Water/steam")}),
+    Window(
+      x=0.11,
+      y=0.06,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end TwoPhaseCavityOnePipe;
diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo
index f199e42a3eb0c182f7674c65800c23d9486927b0..fbe7ca6acf3fe78465b29d89303cdd0766a3ee22 100644
--- a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo
+++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo
@@ -1,352 +1,352 @@
-within ThermoSysPro.Fluid.Volumes;
-model TwoPhaseVolume "TwoPhaseVolume"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-
-  parameter Units.SI.Volume V=1 "Cavity volume";
-  parameter Units.SI.Area A=1 "Cavity cross-sectional area";
-  parameter Real Ccond=0.01 "Condensation coefficient";
-  parameter Real Cevap=0.09 "Evaporation coefficient";
-  parameter Real Xlo=0.0025
-    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
-  parameter Real Xvo=0.9975
-    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
-  parameter Units.SI.Area Avl=A
-    "Heat exchange surface between the liquid and gas phases";
-  parameter Real Kvl=1000
-    "Heat exchange coefficient between the liquid and gas phases";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (Vf0, P0)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Real Vf0=0.5
-    "Fraction of initial water volume in the drum (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Units.SI.AbsolutePressure P0=0.1e5
-    "Fluid initial pressure (active if steady_state=false)" annotation (
-      Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
-  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-
-public
-  Units.SI.AbsolutePressure P "Fluid average pressure";
-  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity";
-  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy";
-  Units.SI.Temperature Tl "Liquid phase temperature";
-  Units.SI.Temperature Tv "Gas phase temperature";
-  Units.SI.Volume Vl "Liquid phase volume";
-  Units.SI.Volume Vv "Gas phase volume";
-  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
-  Real xv(start=0) "Mass vapor fraction in the gas phase";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Gas phase density";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phaser";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase";
-  Units.SI.Power Wvl
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  FluidType fluids[4] "Fluids mixing in volume";
-  Units.SI.Power Je "Thermal power diffusion from inlet Ce";
-  Units.SI.Power Jv "Thermal power diffusion from inlet Cv";
-  Units.SI.Power Jl "Thermal power diffusion from outlet Cl";
-  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
-  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet Ce";
-  Units.SI.MassFlowRate gamma_v "Diffusion conductance for inlet Cv";
-  Units.SI.MassFlowRate gamma_l "Diffusion conductance for outlet Cl";
-  Real re "Value of r(Q/gamma) for inlet Ce";
-  Real rv "Value of r(Q/gamma) for inlet Cv";
-  Real rl "Value of r(Q/gamma) for outlet Cl";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-60,40},{-20,80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{0,40},{40,80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{0,-80},{40,-40}}, rotation=0)));
-  Interfaces.Connectors.FluidInlet Cv "Steam input" annotation (Placement(
-        transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cl "Water output" annotation (Placement(
-        transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,10},{10,30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"                        annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation=
-            0)));
-  Interfaces.Connectors.FluidInlet Ce "Water input" annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      der(P) = 0;
-      der(hl) = 0;
-      der(hv) = 0;
-      der(Vl) = 0;
-    else
-      P = P0;
-      hl = lsat.h;
-      hv = vsat.h;
-      Vl = Vf0*V;
-    end if;
-  end if;
-
-equation
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = Cv.ftype;
-  fluids[4] = Cl.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "TwoPhaseVolume: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.h_vol_1 = 1.e5;
-    Ce.diff_res_1 = 0;
-    Ce.diff_on_1 = false;
-    Ce.ftype = ftype;
-    Ce.Xco2 = 0;
-    Ce.Xh2o = 1;
-    Ce.Xo2 = 0;
-    Ce.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cv) == 0) then
-    Cv.Q = 0;
-    Cv.h = 1.e5;
-    Cv.h_vol_1 = 1.e5;
-    Cv.diff_res_1 = 0;
-    Cv.diff_on_1 = false;
-    Cv.ftype = ftype;
-    Cv.Xco2 = 0;
-    Cv.Xh2o = 1;
-    Cv.Xo2 = 0;
-    Cv.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cl) == 0) then
-    Cl.Q = 0;
-    Cl.h_vol_2 = 1.e5;
-    Cl.diff_res_2 = 0;
-    Cl.diff_on_2 = false;
-  end if;
-
-
-  /* Volume of the cavity */
-  V = Vl + Vv;
-
-  /* Pressure at the bottom of the cavity */
-  Pfond = P + prod.d*g*Vl/A;
-
-  /* Liquid phase mass balance equation */
-  BQl = -Cl.Q + Qcond - Qevap + Ce.Q;
-
-  if dynamic_energy_balance then
-    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-  else
-    0 = BQl;
-  end if;
-
-  /* Vapor phase mass balance equation */
-  BQv = Cv.Q + Qevap - Qcond;
-
-  if dynamic_energy_balance then
-    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-  else
-    0 = BQv;
-  end if;
-
-  /* Condensation and evaporation mass flow rates */
-  Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
-  Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
-
-  Ce.P = P;
-  Cv.P = P;
-  Cl.P = Pfond;
-
-  /* Liquid phase energy balance equation */
-  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Ce.Q*(Ce.h - (hl - P/rhol)) + Wvl + Jt_l;
-
-  if dynamic_energy_balance then
-    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-  else
-    0 = BHl;
-  end if;
-
-  /* Gas phase energy balance equation */
-  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Cth.W + Jt_v;
-
-  if dynamic_energy_balance then
-    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-  else
-    0 = BHv;
-  end if;
-
-  Ce.h_vol_2 = hl;
-  Cv.h_vol_2 = hv;
-  Cl.h_vol_1 = hl;
-
-  /* Heat exchange between liquid and gas phases */
-  Wvl = Kvl*Avl*(Tv - Tl);
-
-  /* Water leval */
-  yLevel.signal = Vl/A;
-
-  /* Fluid composition (no balance equations) */
-  Cl.ftype = ftype;
-
-  Cl.Xco2 = 0;
-  Cl.Xh2o = 1;
-  Cl.Xo2  = 0;
-  Cl.Xso2 = 0;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1);
-  else
-    Cl.h = if (Cl.Q > 0) then Cl.h_vol_1 else Cl.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    rv = if Cv.diff_on_1 then exp(-0.033*(Cv.Q*Cv.diff_res_1)^2) else 0;
-    rl = if Cl.diff_on_2 then exp(-0.033*(Cl.Q*Cl.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_v = if Cv.diff_on_1 then 1/Cv.diff_res_1 else gamma0;
-    gamma_l = if Cl.diff_on_2 then 1/Cl.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    Jv = if Cv.diff_on_1 then rv*gamma_v*(Cv.h_vol_1 - Cv.h_vol_2) else 0;
-    Jl = if Cl.diff_on_2 then rl*gamma_l*(Cl.h_vol_2 - Cl.h_vol_1) else 0;
-  else
-    re = 0;
-    rv = 0;
-    rl = 0;
-
-    gamma_e = gamma0;
-    gamma_v = gamma0;
-    gamma_l = gamma0;
-
-    Je = 0;
-    Jv = 0;
-    Jl = 0;
-  end if;
-
-  Jt_l = Je + Jl;
-  Jt_v = Jv;
-
-  Ce.diff_res_2 = 0;
-  Cv.diff_res_2 = 0;
-  Cl.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  Cv.diff_on_2 = diffusion;
-  Cl.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  prol = ThermoSysPro.Properties.Fluid.Ph((P + Pfond)/2, hl, 0,fluid);
-  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0,fluid);
-  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0,fluid);
-  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid);
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-  rhov = prov.d;
-  xv = prov.x;
-
-  Cth.T = Tv;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
-              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
-              80},{40,92},{20,98},{0,100}},
-          lineColor={28,108,200},
-          fillColor={255,255,255},
-          fillPattern=DynamicSelect(FillPattern.Sphere,
-          if dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid)),
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={28,108,200},
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static),
-          fillPattern=DynamicSelect(FillPattern.Sphere,
-          if dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid)),
-        Polygon(
-          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
-              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
-              80},{40,92},{20,98},{0,100}},
-          lineColor={28,108,200},
-          fillColor= DynamicSelect({170,213,255},
-          if dynamic_energy_balance then {170,213,255}
-          else if diffusion then {213,255,170}
-          else {255,255,170}),
-          fillPattern=DynamicSelect(FillPattern.Sphere,
-          if dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid))}),
-    Window(
-      x=0.11,
-      y=0.06,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end TwoPhaseVolume;
+within ThermoSysPro.Fluid.Volumes;
+model TwoPhaseVolume "TwoPhaseVolume"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+
+  parameter Units.SI.Volume V=1 "Cavity volume";
+  parameter Units.SI.Area A=1 "Cavity cross-sectional area";
+  parameter Real Ccond=0.01 "Condensation coefficient";
+  parameter Real Cevap=0.09 "Evaporation coefficient";
+  parameter Real Xlo=0.0025
+    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
+  parameter Real Xvo=0.9975
+    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
+  parameter Units.SI.Area Avl=A
+    "Heat exchange surface between the liquid and gas phases";
+  parameter Real Kvl=1000
+    "Heat exchange coefficient between the liquid and gas phases";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (Vf0, P0)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Real Vf0=0.5
+    "Fraction of initial water volume in the drum (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Units.SI.AbsolutePressure P0=0.1e5
+    "Fluid initial pressure (active if steady_state=false)" annotation (
+      Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+  parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+
+public
+  Units.SI.AbsolutePressure P "Fluid average pressure";
+  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity";
+  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy";
+  Units.SI.Temperature Tl "Liquid phase temperature";
+  Units.SI.Temperature Tv "Gas phase temperature";
+  Units.SI.Volume Vl "Liquid phase volume";
+  Units.SI.Volume Vv "Gas phase volume";
+  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
+  Real xv(start=0) "Mass vapor fraction in the gas phase";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Gas phase density";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phaser";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase";
+  Units.SI.Power Wvl
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  FluidType fluids[4] "Fluids mixing in volume";
+  Units.SI.Power Je "Thermal power diffusion from inlet Ce";
+  Units.SI.Power Jv "Thermal power diffusion from inlet Cv";
+  Units.SI.Power Jl "Thermal power diffusion from outlet Cl";
+  Units.SI.Power Jt_l "Total thermal power diffusion for the liquid";
+  Units.SI.Power Jt_v "Total thermal power diffusion for the vapor";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet Ce";
+  Units.SI.MassFlowRate gamma_v "Diffusion conductance for inlet Cv";
+  Units.SI.MassFlowRate gamma_l "Diffusion conductance for outlet Cl";
+  Real re "Value of r(Q/gamma) for inlet Ce";
+  Real rv "Value of r(Q/gamma) for inlet Cv";
+  Real rl "Value of r(Q/gamma) for outlet Cl";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Proprié´©s de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-60,40},{-20,80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Proprié´©s de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{0,40},{40,80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{0,-80},{40,-40}}, rotation=0)));
+  Interfaces.Connectors.FluidInlet Cv "Steam input" annotation (Placement(
+        transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cl "Water output" annotation (Placement(
+        transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,10},{10,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"                        annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation=
+            0)));
+  Interfaces.Connectors.FluidInlet Ce "Water input" annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      der(P) = 0;
+      der(hl) = 0;
+      der(hv) = 0;
+      der(Vl) = 0;
+    else
+      P = P0;
+      hl = lsat.h;
+      hv = vsat.h;
+      Vl = Vf0*V;
+    end if;
+  end if;
+
+equation
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = Cv.ftype;
+  fluids[4] = Cl.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "TwoPhaseVolume: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.h_vol_1 = 1.e5;
+    Ce.diff_res_1 = 0;
+    Ce.diff_on_1 = false;
+    Ce.ftype = ftype;
+    Ce.Xco2 = 0;
+    Ce.Xh2o = 0;
+    Ce.Xo2 = 0;
+    Ce.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cv) == 0) then
+    Cv.Q = 0;
+    Cv.h = 1.e5;
+    Cv.h_vol_1 = 1.e5;
+    Cv.diff_res_1 = 0;
+    Cv.diff_on_1 = false;
+    Cv.ftype = ftype;
+    Cv.Xco2 = 0;
+    Cv.Xh2o = 0;
+    Cv.Xo2 = 0;
+    Cv.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cl) == 0) then
+    Cl.Q = 0;
+    Cl.h_vol_2 = 1.e5;
+    Cl.diff_res_2 = 0;
+    Cl.diff_on_2 = false;
+  end if;
+
+
+  /* Volume of the cavity */
+  V = Vl + Vv;
+
+  /* Pressure at the bottom of the cavity */
+  Pfond = P + prod.d*g*Vl/A;
+
+  /* Liquid phase mass balance equation */
+  BQl = -Cl.Q + Qcond - Qevap + Ce.Q;
+
+  if dynamic_energy_balance then
+    rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+  else
+    0 = BQl;
+  end if;
+
+  /* Vapor phase mass balance equation */
+  BQv = Cv.Q + Qevap - Qcond;
+
+  if dynamic_energy_balance then
+    rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+  else
+    0 = BQv;
+  end if;
+
+  /* Condensation and evaporation mass flow rates */
+  Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
+  Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
+
+  Ce.P = P;
+  Cv.P = P;
+  Cl.P = Pfond;
+
+  /* Liquid phase energy balance equation */
+  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Ce.Q*(Ce.h - (hl - P/rhol)) + Wvl + Jt_l;
+
+  if dynamic_energy_balance then
+    Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+  else
+    0 = BHl;
+  end if;
+
+  /* Gas phase energy balance equation */
+  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Cth.W + Jt_v;
+
+  if dynamic_energy_balance then
+    Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+  else
+    0 = BHv;
+  end if;
+
+  Ce.h_vol_2 = hl;
+  Cv.h_vol_2 = hv;
+  Cl.h_vol_1 = hl;
+
+  /* Heat exchange between liquid and gas phases */
+  Wvl = Kvl*Avl*(Tv - Tl);
+
+  /* Water leval */
+  yLevel.signal = Vl/A;
+
+  /* Fluid composition (no balance equations) */
+  Cl.ftype = ftype;
+
+  Cl.Xco2 = 0;
+  Cl.Xh2o = 0;
+  Cl.Xo2  = 0;
+  Cl.Xso2 = 0;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1);
+  else
+    Cl.h = if (Cl.Q > 0) then Cl.h_vol_1 else Cl.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    rv = if Cv.diff_on_1 then exp(-0.033*(Cv.Q*Cv.diff_res_1)^2) else 0;
+    rl = if Cl.diff_on_2 then exp(-0.033*(Cl.Q*Cl.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_v = if Cv.diff_on_1 then 1/Cv.diff_res_1 else gamma0;
+    gamma_l = if Cl.diff_on_2 then 1/Cl.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    Jv = if Cv.diff_on_1 then rv*gamma_v*(Cv.h_vol_1 - Cv.h_vol_2) else 0;
+    Jl = if Cl.diff_on_2 then rl*gamma_l*(Cl.h_vol_2 - Cl.h_vol_1) else 0;
+  else
+    re = 0;
+    rv = 0;
+    rl = 0;
+
+    gamma_e = gamma0;
+    gamma_v = gamma0;
+    gamma_l = gamma0;
+
+    Je = 0;
+    Jv = 0;
+    Jl = 0;
+  end if;
+
+  Jt_l = Je + Jl;
+  Jt_v = Jv;
+
+  Ce.diff_res_2 = 0;
+  Cv.diff_res_2 = 0;
+  Cl.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  Cv.diff_on_2 = diffusion;
+  Cl.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  prol = ThermoSysPro.Properties.Fluid.Ph((P + Pfond)/2, hl, 0,fluid);
+  prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0,fluid);
+  prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0,fluid);
+  (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid);
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+  rhov = prov.d;
+  xv = prov.x;
+
+  Cth.T = Tv;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
+              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
+              80},{40,92},{20,98},{0,100}},
+          lineColor={28,108,200},
+          fillColor={255,255,255},
+          fillPattern=DynamicSelect(FillPattern.Sphere,
+          if dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid)),
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={28,108,200},
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static),
+          fillPattern=DynamicSelect(FillPattern.Sphere,
+          if dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid)),
+        Polygon(
+          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
+              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
+              80},{40,92},{20,98},{0,100}},
+          lineColor={28,108,200},
+          fillColor= DynamicSelect({170,213,255},
+          if dynamic_energy_balance then {170,213,255}
+          else if diffusion then {213,255,170}
+          else {255,255,170}),
+          fillPattern=DynamicSelect(FillPattern.Sphere,
+          if dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid))}),
+    Window(
+      x=0.11,
+      y=0.06,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end TwoPhaseVolume;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeA.mo b/ThermoSysPro/Fluid/Volumes/VolumeA.mo
index 3c93afbb1e7ab431c121a72860168886ca9eda20..7a2b92180a4e7331f14d1ed7570629de49e2292d 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeA.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeA.mo
@@ -1,398 +1,398 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeA "Mixing volume with 2 inlets and 2 outlets"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-10,90},{10,110}}, rotation=0),
-        iconTransformation(extent={{-10,90},{10,110}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Cs1.ftype;
-  fluids[5] = Cs2.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeA: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    rs1 = 0;
-    rs2 = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Js1 = 0;
-    Js2 = 0;
-  end if;
-
-  J = Je1 + Je2 + Js1 + Js2;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-         Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255},
-          lineThickness=0.2)}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={28,108,200},
-          lineThickness=0.2,
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static))}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeA;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeA "Mixing volume with 2 inlets and 2 outlets"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-10,90},{10,110}}, rotation=0),
+        iconTransformation(extent={{-10,90},{10,110}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Cs1.ftype;
+  fluids[5] = Cs2.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeA: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    rs1 = 0;
+    rs2 = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Js1 = 0;
+    Js2 = 0;
+  end if;
+
+  J = Je1 + Je2 + Js1 + Js2;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+         Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255},
+          lineThickness=0.2)}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={28,108,200},
+          lineThickness=0.2,
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static))}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeA;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo
index 10774e616065a3f341c876563e0d076f795fd33d..777838d5025f6f1d5fd18b0eb382a3ecbd7d4d1b 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo
@@ -1,404 +1,404 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeATh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-10,90},{10,110}}, rotation=0),
-        iconTransformation(extent={{-10,90},{10,110}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-public
-  Thermal.Connectors.ThermalPort              Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Cs1.ftype;
-  fluids[5] = Cs2.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeAth: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + Cth.W + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    rs1 = 0;
-    rs2 = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Js1 = 0;
-    Js2 = 0;
-  end if;
-
-  J = Je1 + Je2 + Js1 + Js2;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-         Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255},
-          lineThickness=0.2)}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={28,108,200},
-          lineThickness=0.2,
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static))}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeATh;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeATh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-10,90},{10,110}}, rotation=0),
+        iconTransformation(extent={{-10,90},{10,110}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+public
+  Thermal.Connectors.ThermalPort              Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Cs1.ftype;
+  fluids[5] = Cs2.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeAth: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + Cth.W + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    rs1 = 0;
+    rs2 = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Js1 = 0;
+    Js2 = 0;
+  end if;
+
+  J = Je1 + Je2 + Js1 + Js2;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+         Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255},
+          lineThickness=0.2)}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={28,108,200},
+          lineThickness=0.2,
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static))}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeATh;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeB.mo b/ThermoSysPro/Fluid/Volumes/VolumeB.mo
index 0e425738f58aecdaa297df5b2325358a872d08dc..80c8998a1501619c79bf02391b2effaf7bb51839 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeB.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeB.mo
@@ -1,399 +1,399 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeB "Mixing volume with 2 inlets and 2 outlets"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0),
-        iconTransformation(extent={{90,-10},{110,10}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0),
-        iconTransformation(extent={{-10,90},{10,110}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Cs1.ftype;
-  fluids[5] = Cs2.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeB: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    rs1 = 0;
-    rs2 = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Js1 = 0;
-    Js2 = 0;
-  end if;
-
-  J = Je1 + Je2 + Js1 + Js2;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-         Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255},
-          lineThickness=0.2)}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={28,108,200},
-          lineThickness=0.2,
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static))}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeB;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeB "Mixing volume with 2 inlets and 2 outlets"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0),
+        iconTransformation(extent={{90,-10},{110,10}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0),
+        iconTransformation(extent={{-10,90},{10,110}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Cs1.ftype;
+  fluids[5] = Cs2.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeB: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    rs1 = 0;
+    rs2 = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Js1 = 0;
+    Js2 = 0;
+  end if;
+
+  J = Je1 + Je2 + Js1 + Js2;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+         Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255},
+          lineThickness=0.2)}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={28,108,200},
+          lineThickness=0.2,
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static))}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeB;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo
index 5088c925e31464b307ba9fdbae85f736333176dc..37a9551e8364d363073e028b989d25cbe0a1b963 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo
@@ -1,404 +1,404 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeBTh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0),
-        iconTransformation(extent={{90,-10},{110,10}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-public
-  Thermal.Connectors.ThermalPort              Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Cs1.ftype;
-  fluids[5] = Cs2.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeBth: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + Cth.W + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    rs1 = 0;
-    rs2 = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Js1 = 0;
-    Js2 = 0;
-  end if;
-
-  J = Je1 + Je2 + Js1 + Js2;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-         Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255},
-          lineThickness=0.2)}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={28,108,200},
-          lineThickness=0.2,
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static))}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeBTh;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeBTh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0),
+        iconTransformation(extent={{90,-10},{110,10}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+public
+  Thermal.Connectors.ThermalPort              Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Cs1.ftype;
+  fluids[5] = Cs2.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeBth: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + Cth.W + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    rs1 = 0;
+    rs2 = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Js1 = 0;
+    Js2 = 0;
+  end if;
+
+  J = Je1 + Je2 + Js1 + Js2;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+         Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255},
+          lineThickness=0.2)}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={28,108,200},
+          lineThickness=0.2,
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static))}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeBTh;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeC.mo b/ThermoSysPro/Fluid/Volumes/VolumeC.mo
index c8a76e12b55842d25a2801f6e7110aa32f74a0de..62aba1e3e8b0c9e6dcd32271c99d95b27995dc04 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeC.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeC.mo
@@ -1,397 +1,397 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeC "Mixing volume with 3 inlets and 1 outlet"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
-  Units.SI.Power Js "Thermal power diffusion from outlet s";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real re3 "Value of r(Q/gamma) for inlet e3";
-  Real rs "Value of r(Q/gamma) for outlet s";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0),
-        iconTransformation(extent={{-110,-10},{-90,10}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-10,90},{10,110}}, rotation=0),
-        iconTransformation(extent={{-10,90},{10,110}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation(
-          extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{
-            10,-90}})));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Ce3.ftype;
-  fluids[5] = Cs.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeC: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.h_vol_1 = 1.e5;
-    Ce3.diff_res_1 = 0;
-    Ce3.diff_on_1 = false;
-    Ce3.ftype = ftype;
-    Ce3.Xco2 = 0;
-    Ce3.Xh2o = 0;
-    Ce3.Xo2 = 0;
-    Ce3.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h_vol_2 = 1.e5;
-    Cs.diff_res_2 = 0;
-    Cs.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q + Ce3.Q  - Cs.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o *hr) - Cs.Q*(Cs.h - Cs.Xh2o*hr) + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Ce3.h_vol_2 = h;
-  Cs.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs.ftype = ftype;
-
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2  = Xo2;
-  Cs.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-  else
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2)  else 0;
-    Js =  if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    re3 = 0;
-    rs = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_e3 = gamma0;
-    gamma_s = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Je3 = 0;
-    Js = 0;
-  end if;
-
-  J = Je1 + Je2 + Je3 + Js;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Ce3.diff_res_2 = 0;
-  Cs.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Ce3.diff_on_2 = diffusion;
-  Cs.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-         Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255},
-          lineThickness=0.2)}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={28,108,200},
-          lineThickness=0.2,
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static))}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeC;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeC "Mixing volume with 3 inlets and 1 outlet"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
+  Units.SI.Power Js "Thermal power diffusion from outlet s";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real re3 "Value of r(Q/gamma) for inlet e3";
+  Real rs "Value of r(Q/gamma) for outlet s";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0),
+        iconTransformation(extent={{-110,-10},{-90,10}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-10,90},{10,110}}, rotation=0),
+        iconTransformation(extent={{-10,90},{10,110}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation(
+          extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{
+            10,-90}})));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Ce3.ftype;
+  fluids[5] = Cs.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeC: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.h_vol_1 = 1.e5;
+    Ce3.diff_res_1 = 0;
+    Ce3.diff_on_1 = false;
+    Ce3.ftype = ftype;
+    Ce3.Xco2 = 0;
+    Ce3.Xh2o = 0;
+    Ce3.Xo2 = 0;
+    Ce3.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h_vol_2 = 1.e5;
+    Cs.diff_res_2 = 0;
+    Cs.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q + Ce3.Q  - Cs.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o *hr) - Cs.Q*(Cs.h - Cs.Xh2o*hr) + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Ce3.h_vol_2 = h;
+  Cs.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs.ftype = ftype;
+
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2  = Xo2;
+  Cs.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+  else
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2)  else 0;
+    Js =  if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    re3 = 0;
+    rs = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_e3 = gamma0;
+    gamma_s = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Je3 = 0;
+    Js = 0;
+  end if;
+
+  J = Je1 + Je2 + Je3 + Js;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Ce3.diff_res_2 = 0;
+  Cs.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Ce3.diff_on_2 = diffusion;
+  Cs.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+         Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255},
+          lineThickness=0.2)}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={28,108,200},
+          lineThickness=0.2,
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static))}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeC;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo
index 4f3a722ff126c13a1fa19765e5560ad317b9774e..dac3a56572c902cc7581035706d472c8b44ec977 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo
@@ -1,403 +1,403 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeCTh "Mixing volume with 3 inlets, 1 outlet and 1 thermal input"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
-  Units.SI.Power Js "Thermal power diffusion from outlet s";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
-  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real re3 "Value of r(Q/gamma) for inlet e3";
-  Real rs "Value of r(Q/gamma) for outlet s";
-
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0),
-        iconTransformation(extent={{-110,-10},{-90,10}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-10,90},{10,110}}, rotation=0),
-        iconTransformation(extent={{-10,90},{10,110}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
-        transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation(
-          extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{
-            10,-90}})));
-public
-  Thermal.Connectors.ThermalPort              Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Ce3.ftype;
-  fluids[5] = Cs.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeCTh: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.h_vol_1 = 1.e5;
-    Ce3.diff_res_1 = 0;
-    Ce3.diff_on_1 = false;
-    Ce3.ftype = ftype;
-    Ce3.Xco2 = 0;
-    Ce3.Xh2o = 0;
-    Ce3.Xo2 = 0;
-    Ce3.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h_vol_2 = 1.e5;
-    Cs.diff_res_2 = 0;
-    Cs.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q + Ce3.Q  - Cs.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o *hr) - Cs.Q*(Cs.h - Cs.Xh2o*hr) + Cth.W + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Ce3.h_vol_2 = h;
-  Cs.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs.ftype = ftype;
-
-  Cs.Xco2 = Xco2;
-  Cs.Xh2o = Xh2o;
-  Cs.Xo2  = Xo2;
-  Cs.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
-  else
-    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
-    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
-    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2)  else 0;
-    Js =  if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    re3 = 0;
-    rs = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_e3 = gamma0;
-    gamma_s = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Je3 = 0;
-    Js = 0;
-  end if;
-
-  J = Je1 + Je2 + Je3 + Js;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Ce3.diff_res_2 = 0;
-  Cs.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Ce3.diff_on_2 = diffusion;
-  Cs.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-         Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255},
-          lineThickness=0.2)}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={28,108,200},
-          lineThickness=0.2,
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static))}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeCTh;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeCTh "Mixing volume with 3 inlets, 1 outlet and 1 thermal input"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
+  Units.SI.Power Js "Thermal power diffusion from outlet s";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
+  Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real re3 "Value of r(Q/gamma) for inlet e3";
+  Real rs "Value of r(Q/gamma) for outlet s";
+
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0),
+        iconTransformation(extent={{-110,-10},{-90,10}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-10,90},{10,110}}, rotation=0),
+        iconTransformation(extent={{-10,90},{10,110}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement(
+        transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation(
+          extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{
+            10,-90}})));
+public
+  Thermal.Connectors.ThermalPort              Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Ce3.ftype;
+  fluids[5] = Cs.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeCTh: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.h_vol_1 = 1.e5;
+    Ce3.diff_res_1 = 0;
+    Ce3.diff_on_1 = false;
+    Ce3.ftype = ftype;
+    Ce3.Xco2 = 0;
+    Ce3.Xh2o = 0;
+    Ce3.Xo2 = 0;
+    Ce3.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h_vol_2 = 1.e5;
+    Cs.diff_res_2 = 0;
+    Cs.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q + Ce3.Q  - Cs.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o *hr) - Cs.Q*(Cs.h - Cs.Xh2o*hr) + Cth.W + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Ce3.h_vol_2 = h;
+  Cs.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs.ftype = ftype;
+
+  Cs.Xco2 = Xco2;
+  Cs.Xh2o = Xh2o;
+  Cs.Xo2  = Xo2;
+  Cs.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1);
+  else
+    Cs.h = if (Cs.Q > 0) then Cs.h_vol_1 else Cs.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
+    rs = if Cs.diff_on_2 then exp(-0.033*(Cs.Q*Cs.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
+    gamma_s = if Cs.diff_on_2 then 1/Cs.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2)  else 0;
+    Js =  if Cs.diff_on_2 then rs*gamma_s*(Cs.h_vol_2 - Cs.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    re3 = 0;
+    rs = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_e3 = gamma0;
+    gamma_s = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Je3 = 0;
+    Js = 0;
+  end if;
+
+  J = Je1 + Je2 + Je3 + Js;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Ce3.diff_res_2 = 0;
+  Cs.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Ce3.diff_on_2 = diffusion;
+  Cs.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+         Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255},
+          lineThickness=0.2)}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={28,108,200},
+          lineThickness=0.2,
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static))}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeCTh;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeD.mo b/ThermoSysPro/Fluid/Volumes/VolumeD.mo
index 7a8ef168475747d81988eab1ff38987a449016b0..16dbfa573761e13e97018537f707d630085414fc 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeD.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeD.mo
@@ -1,399 +1,399 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeD "Mixing volume with 1 inlet and 3 outlets"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je "Thermal power diffusion from inlet e";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
-  Real re "Value of r(Q/gamma) for inlet e";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-  Real rs3 "Value of r(Q/gamma) for outlet s3";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cs3
-    annotation (Placement(transformation(extent={{90,-10},{110,10}})));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = Cs1.ftype;
-  fluids[4] = Cs2.ftype;
-  fluids[5] = Cs3.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeD: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.h_vol_1 = 1.e5;
-    Ce.diff_res_1 = 0;
-    Ce.diff_on_1 = false;
-    Ce.ftype = ftype;
-    Ce.Xco2 = 0;
-    Ce.Xh2o = 0;
-    Ce.Xo2 = 0;
-    Ce.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs3) == 0) then
-    Cs3.Q = 0;
-    Cs3.h_vol_2 = 1.e5;
-    Cs3.diff_res_2 = 0;
-    Cs3.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-
-  /* Energy balance equation */
-  BH = Ce.Q*(Ce.h - Ce.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-  Cs3.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q;
-  BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q;
-  BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q;
-  BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-  Cs3.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  Cs3.Xco2 = Xco2;
-  Cs3.Xh2o = Xh2o;
-  Cs3.Xo2  = Xo2;
-  Cs3.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
-  else
-    re = 0;
-    rs1 = 0;
-    rs2 = 0;
-    rs3 = 0;
-
-    gamma_e = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-    gamma_s3 = gamma0;
-
-    Je = 0;
-    Js1 = 0;
-    Js2 = 0;
-    Js3 = 0;
-  end if;
-
-  J = Je + Js1 + Js2 + Js3;
-
-  Ce.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-  Cs3.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-  Cs3.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-         Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255},
-          lineThickness=0.2)}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={28,108,200},
-          lineThickness=0.2,
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static))}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeD;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeD "Mixing volume with 1 inlet and 3 outlets"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je "Thermal power diffusion from inlet e";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
+  Real re "Value of r(Q/gamma) for inlet e";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+  Real rs3 "Value of r(Q/gamma) for outlet s3";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cs3
+    annotation (Placement(transformation(extent={{90,-10},{110,10}})));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = Cs1.ftype;
+  fluids[4] = Cs2.ftype;
+  fluids[5] = Cs3.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeD: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.h_vol_1 = 1.e5;
+    Ce.diff_res_1 = 0;
+    Ce.diff_on_1 = false;
+    Ce.ftype = ftype;
+    Ce.Xco2 = 0;
+    Ce.Xh2o = 0;
+    Ce.Xo2 = 0;
+    Ce.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs3) == 0) then
+    Cs3.Q = 0;
+    Cs3.h_vol_2 = 1.e5;
+    Cs3.diff_res_2 = 0;
+    Cs3.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+
+  /* Energy balance equation */
+  BH = Ce.Q*(Ce.h - Ce.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+  Cs3.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q;
+  BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q;
+  BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q;
+  BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+  Cs3.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  Cs3.Xco2 = Xco2;
+  Cs3.Xh2o = Xh2o;
+  Cs3.Xo2  = Xo2;
+  Cs3.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
+  else
+    re = 0;
+    rs1 = 0;
+    rs2 = 0;
+    rs3 = 0;
+
+    gamma_e = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+    gamma_s3 = gamma0;
+
+    Je = 0;
+    Js1 = 0;
+    Js2 = 0;
+    Js3 = 0;
+  end if;
+
+  J = Je + Js1 + Js2 + Js3;
+
+  Ce.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+  Cs3.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+  Cs3.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+         Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255},
+          lineThickness=0.2)}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={28,108,200},
+          lineThickness=0.2,
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static))}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeD;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo
index c79bcb24d90a678dbeb0896665af61d113345b44..73c963fed17f01d694f8d858d53387804e373dd3 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo
@@ -1,404 +1,404 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeDTh "Mixing volume with 1 inlet, 3 outlets and 1 thermal input"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[5] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je "Thermal power diffusion from inlet e";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
-  Real re "Value of r(Q/gamma) for inlet e";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-  Real rs3 "Value of r(Q/gamma) for outlet s3";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-  Interfaces.Connectors.FluidOutlet Cs3
-    annotation (Placement(transformation(extent={{90,-10},{110,10}})));
-  Thermal.Connectors.ThermalPort              Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce.ftype;
-  fluids[3] = Cs1.ftype;
-  fluids[4] = Cs2.ftype;
-  fluids[5] = Cs3.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeDTh: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.h_vol_1 = 1.e5;
-    Ce.diff_res_1 = 0;
-    Ce.diff_on_1 = false;
-    Ce.ftype = ftype;
-    Ce.Xco2 = 0;
-    Ce.Xh2o = 0;
-    Ce.Xo2 = 0;
-    Ce.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs3) == 0) then
-    Cs3.Q = 0;
-    Cs3.h_vol_2 = 1.e5;
-    Cs3.diff_res_2 = 0;
-    Cs3.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-
-  /* Energy balance equation */
-  BH = Ce.Q*(Ce.h - Ce.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) + Cth.W + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-  Cs3.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q;
-  BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q;
-  BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q;
-  BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-  Cs3.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  Cs3.Xco2 = Xco2;
-  Cs3.Xh2o = Xh2o;
-  Cs3.Xo2  = Xo2;
-  Cs3.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
-
-    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
-
-    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
-  else
-    re = 0;
-    rs1 = 0;
-    rs2 = 0;
-    rs3 = 0;
-
-    gamma_e = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-    gamma_s3 = gamma0;
-
-    Je = 0;
-    Js1 = 0;
-    Js2 = 0;
-    Js3 = 0;
-  end if;
-
-  J = Je + Js1 + Js2 + Js3;
-
-  Ce.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-  Cs3.diff_res_1 = 0;
-
-  Ce.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-  Cs3.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-         Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255},
-          lineThickness=0.2)}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={28,108,200},
-          lineThickness=0.2,
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static))}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeDTh;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeDTh "Mixing volume with 1 inlet, 3 outlets and 1 thermal input"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[5] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je "Thermal power diffusion from inlet e";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
+  Real re "Value of r(Q/gamma) for inlet e";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+  Real rs3 "Value of r(Q/gamma) for outlet s3";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+  Interfaces.Connectors.FluidOutlet Cs3
+    annotation (Placement(transformation(extent={{90,-10},{110,10}})));
+  Thermal.Connectors.ThermalPort              Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce.ftype;
+  fluids[3] = Cs1.ftype;
+  fluids[4] = Cs2.ftype;
+  fluids[5] = Cs3.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeDTh: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.h_vol_1 = 1.e5;
+    Ce.diff_res_1 = 0;
+    Ce.diff_on_1 = false;
+    Ce.ftype = ftype;
+    Ce.Xco2 = 0;
+    Ce.Xh2o = 0;
+    Ce.Xo2 = 0;
+    Ce.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs3) == 0) then
+    Cs3.Q = 0;
+    Cs3.h_vol_2 = 1.e5;
+    Cs3.diff_res_2 = 0;
+    Cs3.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+
+  /* Energy balance equation */
+  BH = Ce.Q*(Ce.h - Ce.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) + Cth.W + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+  Cs3.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q;
+  BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q;
+  BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q;
+  BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+  Cs3.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  Cs3.Xco2 = Xco2;
+  Cs3.Xh2o = Xh2o;
+  Cs3.Xo2  = Xo2;
+  Cs3.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re = if Ce.diff_on_1 then exp(-0.033*(Ce.Q*Ce.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
+
+    gamma_e = if Ce.diff_on_1 then 1/Ce.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
+
+    Je = if Ce.diff_on_1 then re*gamma_e*(Ce.h_vol_1 - Ce.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
+  else
+    re = 0;
+    rs1 = 0;
+    rs2 = 0;
+    rs3 = 0;
+
+    gamma_e = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+    gamma_s3 = gamma0;
+
+    Je = 0;
+    Js1 = 0;
+    Js2 = 0;
+    Js3 = 0;
+  end if;
+
+  J = Je + Js1 + Js2 + Js3;
+
+  Ce.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+  Cs3.diff_res_1 = 0;
+
+  Ce.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+  Cs3.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+         Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255},
+          lineThickness=0.2)}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={28,108,200},
+          lineThickness=0.2,
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static))}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeDTh;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeI.mo b/ThermoSysPro/Fluid/Volumes/VolumeI.mo
index 239d0d9db0d11bd1ad55bb77537c195b73f72732..c261497f54db133955366ffbd166263da3d584bb 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeI.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeI.mo
@@ -1,561 +1,561 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeI "Mixing volume with 4 inlets and 4 outlets"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[9] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
-  Units.SI.Power Je4 "Thermal power diffusion from inlet e4";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
-  Units.SI.Power Js4 "Thermal power diffusion from outlet s4";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
-  Units.SI.MassFlowRate gamma_e4 "Diffusion conductance for inlet e4";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
-  Units.SI.MassFlowRate gamma_s4 "Diffusion conductance for outlet s4";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real re3 "Value of r(Q/gamma) for inlet e3";
-  Real re4 "Value of r(Q/gamma) for inlet e4";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-  Real rs3 "Value of r(Q/gamma) for outlet s3";
-  Real rs4 "Value of r(Q/gamma) for outlet s4";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,70},{-90,90}},  rotation=0),
-        iconTransformation(extent={{-110,70},{-90,90}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}},
-                                                   rotation=0),
-        iconTransformation(extent={{-110,-10},{-90,10}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{90,70},{110,90}},  rotation=0),
-        iconTransformation(extent={{90,70},{110,90}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{90,-10},{110,10}},   rotation=0),
-        iconTransformation(extent={{90,-10},{110,10}})));
-  Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation(
-          extent={{-110,-90},{-90,-70}}), iconTransformation(extent={{-110,-90},
-            {-90,-70}})));
-  Interfaces.Connectors.FluidInlet Ce4 annotation (Placement(transformation(
-          extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{
-            10,-90}})));
-  Interfaces.Connectors.FluidOutlet Cs3 annotation (Placement(transformation(
-          extent={{90,-90},{110,-70}}), iconTransformation(extent={{90,-90},{110,
-            -70}})));
-  Interfaces.Connectors.FluidOutlet Cs4 annotation (Placement(transformation(
-          extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10,110}})));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Ce3.ftype;
-  fluids[5] = Ce4.ftype;
-  fluids[6] = Cs1.ftype;
-  fluids[7] = Cs2.ftype;
-  fluids[8] = Cs3.ftype;
-  fluids[9] = Cs4.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeI: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.h_vol_1 = 1.e5;
-    Ce3.diff_res_1 = 0;
-    Ce3.diff_on_1 = false;
-    Ce3.ftype = ftype;
-    Ce3.Xco2 = 0;
-    Ce3.Xh2o = 0;
-    Ce3.Xo2 = 0;
-    Ce3.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce4) == 0) then
-    Ce4.Q = 0;
-    Ce4.h = 1.e5;
-    Ce4.h_vol_1 = 1.e5;
-    Ce4.diff_res_1 = 0;
-    Ce4.diff_on_1 = false;
-    Ce4.ftype = ftype;
-    Ce4.Xco2 = 0;
-    Ce4.Xh2o = 0;
-    Ce4.Xo2 = 0;
-    Ce4.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs3) == 0) then
-    Cs3.Q = 0;
-    Cs3.h_vol_2 = 1.e5;
-    Cs3.diff_res_2 = 0;
-    Cs3.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs4) == 0) then
-    Cs4.Q = 0;
-    Cs4.h_vol_2 = 1.e5;
-    Cs4.diff_res_2 = 0;
-    Cs4.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Ce4.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-  P = Cs4.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) + Ce4.Q*(Ce4.h - Ce4.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) - Cs4.Q*(Cs4.h - Cs4.Xh2o*hr) + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Ce3.h_vol_2 = h;
-  Ce4.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-  Cs3.h_vol_1 = h;
-  Cs4.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q - Cs4.Xco2*Cs4.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q - Cs4.Xh2o*Cs4.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q - Cs4.Xo2*Cs4.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q - Cs4.Xso2*Cs4.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-  Cs3.ftype = ftype;
-  Cs4.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  Cs3.Xco2 = Xco2;
-  Cs3.Xh2o = Xh2o;
-  Cs3.Xo2  = Xo2;
-  Cs3.Xso2 = Xso2;
-
-  Cs4.Xco2 = Xco2;
-  Cs4.Xh2o = Xh2o;
-  Cs4.Xo2  = Xo2;
-  Cs4.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
-    Cs4.h = ThermoSysPro.Functions.SmoothCond(Cs4.Q/gamma_s4, Cs4.h_vol_1, Cs4.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
-    Cs4.h = if (Cs4.Q > 0) then Cs4.h_vol_1 else Cs4.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
-    re4 = if Ce4.diff_on_1 then exp(-0.033*(Ce4.Q*Ce4.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
-    rs4 = if Cs4.diff_on_2 then exp(-0.033*(Cs4.Q*Cs4.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
-    gamma_e4 = if Ce4.diff_on_1 then 1/Ce4.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
-    gamma_s4 = if Cs4.diff_on_2 then 1/Cs4.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
-    Je4 = if Ce4.diff_on_1 then re4*gamma_e4*(Ce4.h_vol_1 - Ce4.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
-    Js4 = if Cs4.diff_on_2 then rs4*gamma_s4*(Cs4.h_vol_2 - Cs4.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    re3 = 0;
-    re4 = 0;
-    rs1 = 0;
-    rs2 = 0;
-    rs3 = 0;
-    rs4 = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_e3 = gamma0;
-    gamma_e4 = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-    gamma_s3 = gamma0;
-    gamma_s4 = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Je3 = 0;
-    Je4 = 0;
-    Js1 = 0;
-    Js2 = 0;
-    Js3 = 0;
-    Js4 = 0;
-  end if;
-
-  J = Je1 + Je2 + Je3 + Je4 + Js1 + Js2 + Js3 + Js4;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Ce3.diff_res_2 = 0;
-  Ce4.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-  Cs3.diff_res_1 = 0;
-  Cs4.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Ce3.diff_on_2 = diffusion;
-  Ce4.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-  Cs3.diff_on_1 = diffusion;
-  Cs4.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255}),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255}),
-        Line(points={{-90,80},{-60,80},{-40,46}}),
-        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
-        Line(points={{92,80},{60,80},{40,46}}),
-        Line(points={{92,-80},{60,-80},{40,-46}})}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Line(points={{-90,80},{-60,80},{-40,46}}),
-        Line(points={{92,80},{60,80},{40,46}}),
-        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
-        Line(points={{92,-80},{60,-80},{40,-46}})}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeI;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeI "Mixing volume with 4 inlets and 4 outlets"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[9] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
+  Units.SI.Power Je4 "Thermal power diffusion from inlet e4";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
+  Units.SI.Power Js4 "Thermal power diffusion from outlet s4";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
+  Units.SI.MassFlowRate gamma_e4 "Diffusion conductance for inlet e4";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
+  Units.SI.MassFlowRate gamma_s4 "Diffusion conductance for outlet s4";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real re3 "Value of r(Q/gamma) for inlet e3";
+  Real re4 "Value of r(Q/gamma) for inlet e4";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+  Real rs3 "Value of r(Q/gamma) for outlet s3";
+  Real rs4 "Value of r(Q/gamma) for outlet s4";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,70},{-90,90}},  rotation=0),
+        iconTransformation(extent={{-110,70},{-90,90}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}},
+                                                   rotation=0),
+        iconTransformation(extent={{-110,-10},{-90,10}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{90,70},{110,90}},  rotation=0),
+        iconTransformation(extent={{90,70},{110,90}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{90,-10},{110,10}},   rotation=0),
+        iconTransformation(extent={{90,-10},{110,10}})));
+  Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation(
+          extent={{-110,-90},{-90,-70}}), iconTransformation(extent={{-110,-90},
+            {-90,-70}})));
+  Interfaces.Connectors.FluidInlet Ce4 annotation (Placement(transformation(
+          extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{
+            10,-90}})));
+  Interfaces.Connectors.FluidOutlet Cs3 annotation (Placement(transformation(
+          extent={{90,-90},{110,-70}}), iconTransformation(extent={{90,-90},{110,
+            -70}})));
+  Interfaces.Connectors.FluidOutlet Cs4 annotation (Placement(transformation(
+          extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10,110}})));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Ce3.ftype;
+  fluids[5] = Ce4.ftype;
+  fluids[6] = Cs1.ftype;
+  fluids[7] = Cs2.ftype;
+  fluids[8] = Cs3.ftype;
+  fluids[9] = Cs4.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeI: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.h_vol_1 = 1.e5;
+    Ce3.diff_res_1 = 0;
+    Ce3.diff_on_1 = false;
+    Ce3.ftype = ftype;
+    Ce3.Xco2 = 0;
+    Ce3.Xh2o = 0;
+    Ce3.Xo2 = 0;
+    Ce3.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce4) == 0) then
+    Ce4.Q = 0;
+    Ce4.h = 1.e5;
+    Ce4.h_vol_1 = 1.e5;
+    Ce4.diff_res_1 = 0;
+    Ce4.diff_on_1 = false;
+    Ce4.ftype = ftype;
+    Ce4.Xco2 = 0;
+    Ce4.Xh2o = 0;
+    Ce4.Xo2 = 0;
+    Ce4.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs3) == 0) then
+    Cs3.Q = 0;
+    Cs3.h_vol_2 = 1.e5;
+    Cs3.diff_res_2 = 0;
+    Cs3.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs4) == 0) then
+    Cs4.Q = 0;
+    Cs4.h_vol_2 = 1.e5;
+    Cs4.diff_res_2 = 0;
+    Cs4.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Ce4.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+  P = Cs4.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) + Ce4.Q*(Ce4.h - Ce4.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) - Cs4.Q*(Cs4.h - Cs4.Xh2o*hr) + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Ce3.h_vol_2 = h;
+  Ce4.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+  Cs3.h_vol_1 = h;
+  Cs4.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q - Cs4.Xco2*Cs4.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q - Cs4.Xh2o*Cs4.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q - Cs4.Xo2*Cs4.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q - Cs4.Xso2*Cs4.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+  Cs3.ftype = ftype;
+  Cs4.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  Cs3.Xco2 = Xco2;
+  Cs3.Xh2o = Xh2o;
+  Cs3.Xo2  = Xo2;
+  Cs3.Xso2 = Xso2;
+
+  Cs4.Xco2 = Xco2;
+  Cs4.Xh2o = Xh2o;
+  Cs4.Xo2  = Xo2;
+  Cs4.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
+    Cs4.h = ThermoSysPro.Functions.SmoothCond(Cs4.Q/gamma_s4, Cs4.h_vol_1, Cs4.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
+    Cs4.h = if (Cs4.Q > 0) then Cs4.h_vol_1 else Cs4.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
+    re4 = if Ce4.diff_on_1 then exp(-0.033*(Ce4.Q*Ce4.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
+    rs4 = if Cs4.diff_on_2 then exp(-0.033*(Cs4.Q*Cs4.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
+    gamma_e4 = if Ce4.diff_on_1 then 1/Ce4.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
+    gamma_s4 = if Cs4.diff_on_2 then 1/Cs4.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
+    Je4 = if Ce4.diff_on_1 then re4*gamma_e4*(Ce4.h_vol_1 - Ce4.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
+    Js4 = if Cs4.diff_on_2 then rs4*gamma_s4*(Cs4.h_vol_2 - Cs4.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    re3 = 0;
+    re4 = 0;
+    rs1 = 0;
+    rs2 = 0;
+    rs3 = 0;
+    rs4 = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_e3 = gamma0;
+    gamma_e4 = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+    gamma_s3 = gamma0;
+    gamma_s4 = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Je3 = 0;
+    Je4 = 0;
+    Js1 = 0;
+    Js2 = 0;
+    Js3 = 0;
+    Js4 = 0;
+  end if;
+
+  J = Je1 + Je2 + Je3 + Je4 + Js1 + Js2 + Js3 + Js4;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Ce3.diff_res_2 = 0;
+  Ce4.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+  Cs3.diff_res_1 = 0;
+  Cs4.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Ce3.diff_on_2 = diffusion;
+  Ce4.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+  Cs3.diff_on_1 = diffusion;
+  Cs4.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255}),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255}),
+        Line(points={{-90,80},{-60,80},{-40,46}}),
+        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
+        Line(points={{92,80},{60,80},{40,46}}),
+        Line(points={{92,-80},{60,-80},{40,-46}})}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Line(points={{-90,80},{-60,80},{-40,46}}),
+        Line(points={{92,80},{60,80},{40,46}}),
+        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
+        Line(points={{92,-80},{60,-80},{40,-46}})}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeI;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeITh.mo b/ThermoSysPro/Fluid/Volumes/VolumeITh.mo
index 5a422e4b4e0f722530402abd212b515b68953df9..49a0dfb11656e2ee08b92fe516383449f8a293a8 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeITh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeITh.mo
@@ -1,566 +1,566 @@
-within ThermoSysPro.Fluid.Volumes;
-model VolumeITh "Mixing volume with 4 inlets, 4 outlets and 1 thermal input"
-  extends
-    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
-  extends ThermoSysPro.Fluid.Interfaces.IconColors;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
-  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
-
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.Volume V=1
-    "Volume (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=isCompressible and
-          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Boolean diffusion=false
-    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
-    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
-  parameter Boolean dynamic_composition_balance=false
-    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
-
-  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
-    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=0.05
-    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
-    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
-    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
-      enable=dynamic_composition_balance,
-      tab="Fluid",
-      group=
-          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
-
-protected
-  constant Units.SI.SpecificEnthalpy hr=2501569
-    "Water/steam reference specific enthalpy at 0.01°C";
-  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
-  parameter Units.SI.MassFlowRate gamma0=1.e-4
-    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
-  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Units.SI.DerDensityByPressure ddph
-    "density derivative wrt pressure at constant specific enthalpy";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "density derivative wrt specific enthalpy at constant pressure";
-  FluidType fluids[9] "Fluids mixing in volume";
-  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
-  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
-  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
-  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
-  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
-  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
-  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
-  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
-  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
-  Units.SI.Power Je4 "Thermal power diffusion from inlet e4";
-  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
-  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
-  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
-  Units.SI.Power Js4 "Thermal power diffusion from outlet s4";
-  Units.SI.Power J "Total thermal power diffusion";
-  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
-  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
-  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
-  Units.SI.MassFlowRate gamma_e4 "Diffusion conductance for inlet e4";
-  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
-  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
-  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
-  Units.SI.MassFlowRate gamma_s4 "Diffusion conductance for outlet s4";
-  Real re1 "Value of r(Q/gamma) for inlet e1";
-  Real re2 "Value of r(Q/gamma) for inlet e2";
-  Real re3 "Value of r(Q/gamma) for inlet e3";
-  Real re4 "Value of r(Q/gamma) for inlet e4";
-  Real rs1 "Value of r(Q/gamma) for outlet s1";
-  Real rs2 "Value of r(Q/gamma) for outlet s2";
-  Real rs3 "Value of r(Q/gamma) for outlet s3";
-  Real rs4 "Value of r(Q/gamma) for outlet s4";
-
-public
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
-        transformation(extent={{-110,70},{-90,90}},  rotation=0),
-        iconTransformation(extent={{-110,70},{-90,90}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
-        transformation(extent={{-110,-10},{-90,10}},
-                                                   rotation=0),
-        iconTransformation(extent={{-110,-10},{-90,10}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
-      Placement(transformation(extent={{90,70},{110,90}},  rotation=0),
-        iconTransformation(extent={{90,70},{110,90}})));
-  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
-      Placement(transformation(extent={{90,-10},{110,10}},   rotation=0),
-        iconTransformation(extent={{90,-10},{110,10}})));
-  Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation(
-          extent={{-110,-90},{-90,-70}}), iconTransformation(extent={{-110,-90},
-            {-90,-70}})));
-  Interfaces.Connectors.FluidInlet Ce4 annotation (Placement(transformation(
-          extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{
-            10,-90}})));
-  Interfaces.Connectors.FluidOutlet Cs3 annotation (Placement(transformation(
-          extent={{90,-90},{110,-70}}), iconTransformation(extent={{90,-90},{110,
-            -70}})));
-  Interfaces.Connectors.FluidOutlet Cs4 annotation (Placement(transformation(
-          extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10,110}})));
-  Thermal.Connectors.ThermalPort              Cth
-                           annotation (Placement(transformation(extent={{-10,
-            -10},{10,10}}, rotation=0)));
-initial equation
-  if dynamic_energy_balance and dynamic_mass_balance then
-    if steady_state then
-      der(P) = 0;
-    else
-      P = P0;
-    end if;
-  end if;
-
-  if dynamic_energy_balance then
-    if steady_state then
-      der(h) = 0;
-    else
-      h = h0;
-    end if;
-  end if;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      if steady_state then
-        der(Xco2) = 0;
-        der(Xh2o) = 0;
-        der(Xo2) = 0;
-        der(Xso2) = 0;
-      else
-        Xco2 = Xco20;
-        Xh2o = Xh2o0;
-        Xo2 = Xo20;
-        Xso2 = Xso20;
-      end if;
-    end if;
-  end if;
-
-equation
-  /* Check that volume is positive */
-  if dynamic_energy_balance or dynamic_mass_balance then
-    assert(V > 0, "Volume non-positive");
-  end if;
-
-  /* Check that incoming fluids are compatible with fluid in volume */
-  fluids[1] = ftype;
-  fluids[2] = Ce1.ftype;
-  fluids[3] = Ce2.ftype;
-  fluids[4] = Ce3.ftype;
-  fluids[5] = Ce4.ftype;
-  fluids[6] = Cs1.ftype;
-  fluids[7] = Cs2.ftype;
-  fluids[8] = Cs3.ftype;
-  fluids[9] = Cs4.ftype;
-
-  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
-    "VolumeITh: fluids mixing in volume are not compatible with each other");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.h_vol_1 = 1.e5;
-    Ce1.diff_res_1 = 0;
-    Ce1.diff_on_1 = false;
-    Ce1.ftype = ftype;
-    Ce1.Xco2 = 0;
-    Ce1.Xh2o = 0;
-    Ce1.Xo2 = 0;
-    Ce1.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.h_vol_1 = 1.e5;
-    Ce2.diff_res_1 = 0;
-    Ce2.diff_on_1 = false;
-    Ce2.ftype = ftype;
-    Ce2.Xco2 = 0;
-    Ce2.Xh2o = 0;
-    Ce2.Xo2 = 0;
-    Ce2.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.h_vol_1 = 1.e5;
-    Ce3.diff_res_1 = 0;
-    Ce3.diff_on_1 = false;
-    Ce3.ftype = ftype;
-    Ce3.Xco2 = 0;
-    Ce3.Xh2o = 0;
-    Ce3.Xo2 = 0;
-    Ce3.Xso2 = 0;
-  end if;
-
-  if (cardinality(Ce4) == 0) then
-    Ce4.Q = 0;
-    Ce4.h = 1.e5;
-    Ce4.h_vol_1 = 1.e5;
-    Ce4.diff_res_1 = 0;
-    Ce4.diff_on_1 = false;
-    Ce4.ftype = ftype;
-    Ce4.Xco2 = 0;
-    Ce4.Xh2o = 0;
-    Ce4.Xo2 = 0;
-    Ce4.Xso2 = 0;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h_vol_2 = 1.e5;
-    Cs1.diff_res_2 = 0;
-    Cs1.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h_vol_2 = 1.e5;
-    Cs2.diff_res_2 = 0;
-    Cs2.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs3) == 0) then
-    Cs3.Q = 0;
-    Cs3.h_vol_2 = 1.e5;
-    Cs3.diff_res_2 = 0;
-    Cs3.diff_on_2 = false;
-  end if;
-
-  if (cardinality(Cs4) == 0) then
-    Cs4.Q = 0;
-    Cs4.h_vol_2 = 1.e5;
-    Cs4.diff_res_2 = 0;
-    Cs4.diff_on_2 = false;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q;
-
-  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
-    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Ce4.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-  P = Cs4.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) + Ce4.Q*(Ce4.h - Ce4.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) - Cs4.Q*(Cs4.h - Cs4.Xh2o*hr) + Cth.W + J;
-
-  if dynamic_energy_balance then
-    if dynamic_mass_balance then
-      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
-    else
-      V*rho*der(h - Xh2o*hr) = BH;
-    end if;
-  else
-    BH = 0;
-  end if;
-
-  Ce1.h_vol_2 = h;
-  Ce2.h_vol_2 = h;
-  Ce3.h_vol_2 = h;
-  Ce4.h_vol_2 = h;
-  Cs1.h_vol_1 = h;
-  Cs2.h_vol_1 = h;
-  Cs3.h_vol_1 = h;
-  Cs4.h_vol_1 = h;
-
-  /* Fluid composition balance equations */
-  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q - Cs4.Xco2*Cs4.Q;
-  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q - Cs4.Xh2o*Cs4.Q;
-  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q - Cs4.Xo2*Cs4.Q;
-  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q - Cs4.Xso2*Cs4.Q;
-
-  if flue_gases then
-    if dynamic_composition_balance then
-      V*rho*der(Xco2) + Xco2*BQ = BXco2;
-      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
-      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
-      V*rho*der(Xso2) + Xso2*BQ = BXso2;
-    else
-      Xco2*BQ = BXco2;
-      Xh2o*BQ = BXh2o;
-      Xo2*BQ  = BXo2;
-      Xso2*BQ = BXso2;
-    end if;
-  else
-    Xco2 = 0;
-    Xh2o = 0;
-    Xo2 = 0;
-    Xso2 = 0;
-  end if;
-
-  Cs1.ftype = ftype;
-  Cs2.ftype = ftype;
-  Cs3.ftype = ftype;
-  Cs4.ftype = ftype;
-
-  Cs1.Xco2 = Xco2;
-  Cs1.Xh2o = Xh2o;
-  Cs1.Xo2  = Xo2;
-  Cs1.Xso2 = Xso2;
-
-  Cs2.Xco2 = Xco2;
-  Cs2.Xh2o = Xh2o;
-  Cs2.Xo2  = Xo2;
-  Cs2.Xso2 = Xso2;
-
-  Cs3.Xco2 = Xco2;
-  Cs3.Xh2o = Xh2o;
-  Cs3.Xo2  = Xo2;
-  Cs3.Xso2 = Xso2;
-
-  Cs4.Xco2 = Xco2;
-  Cs4.Xh2o = Xh2o;
-  Cs4.Xo2  = Xo2;
-  Cs4.Xso2 = Xso2;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
-    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
-    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
-    Cs4.h = ThermoSysPro.Functions.SmoothCond(Cs4.Q/gamma_s4, Cs4.h_vol_1, Cs4.h_vol_2, 1);
-  else
-    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
-    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
-    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
-    Cs4.h = if (Cs4.Q > 0) then Cs4.h_vol_1 else Cs4.h_vol_2;
-  end if;
-
-  /* Diffusion power */
-  if diffusion then
-    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
-    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
-    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
-    re4 = if Ce4.diff_on_1 then exp(-0.033*(Ce4.Q*Ce4.diff_res_1)^2) else 0;
-    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
-    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
-    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
-    rs4 = if Cs4.diff_on_2 then exp(-0.033*(Cs4.Q*Cs4.diff_res_2)^2) else 0;
-
-    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
-    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
-    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
-    gamma_e4 = if Ce4.diff_on_1 then 1/Ce4.diff_res_1 else gamma0;
-    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
-    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
-    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
-    gamma_s4 = if Cs4.diff_on_2 then 1/Cs4.diff_res_2 else gamma0;
-
-    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
-    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
-    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
-    Je4 = if Ce4.diff_on_1 then re4*gamma_e4*(Ce4.h_vol_1 - Ce4.h_vol_2) else 0;
-    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
-    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
-    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
-    Js4 = if Cs4.diff_on_2 then rs4*gamma_s4*(Cs4.h_vol_2 - Cs4.h_vol_1) else 0;
-  else
-    re1 = 0;
-    re2 = 0;
-    re3 = 0;
-    re4 = 0;
-    rs1 = 0;
-    rs2 = 0;
-    rs3 = 0;
-    rs4 = 0;
-
-    gamma_e1 = gamma0;
-    gamma_e2 = gamma0;
-    gamma_e3 = gamma0;
-    gamma_e4 = gamma0;
-    gamma_s1 = gamma0;
-    gamma_s2 = gamma0;
-    gamma_s3 = gamma0;
-    gamma_s4 = gamma0;
-
-    Je1 = 0;
-    Je2 = 0;
-    Je3 = 0;
-    Je4 = 0;
-    Js1 = 0;
-    Js2 = 0;
-    Js3 = 0;
-    Js4 = 0;
-  end if;
-
-  J = Je1 + Je2 + Je3 + Je4 + Js1 + Js2 + Js3 + Js4;
-
-  Ce1.diff_res_2 = 0;
-  Ce2.diff_res_2 = 0;
-  Ce3.diff_res_2 = 0;
-  Ce4.diff_res_2 = 0;
-  Cs1.diff_res_1 = 0;
-  Cs2.diff_res_1 = 0;
-  Cs3.diff_res_1 = 0;
-  Cs4.diff_res_1 = 0;
-
-  Ce1.diff_on_2 = diffusion;
-  Ce2.diff_on_2 = diffusion;
-  Ce3.diff_on_2 = diffusion;
-  Ce4.diff_on_2 = diffusion;
-  Cs1.diff_on_1 = diffusion;
-  Cs2.diff_on_1 = diffusion;
-  Cs3.diff_on_1 = diffusion;
-  Cs4.diff_on_1 = diffusion;
-
-  /* Fluid thermodynamic properties */
-  if isCompressible and dynamic_mass_balance then
-    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  else
-    ddph = 0;
-    ddhp = 0;
-  end if;
-
-  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}, color={0,0,255}),
-        Line(points={{0,90},{0,-100}}, color={0,0,255},
-          thickness=0.2),
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255}),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          fillColor={85,170,255}),
-        Line(points={{-90,80},{-60,80},{-40,46}}),
-        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
-        Line(points={{92,80},{60,80},{40,46}}),
-        Line(points={{92,-80},{60,-80},{40,-46}})}),
-   Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{0,90},{0,-100}},
-          color={28,108,200},
-          thickness=0.2),
-        Line(
-          points={{-90,0},{90,0}},
-          color={28,108,200},
-          thickness=0.2),
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,0},
-          fillPattern=DynamicSelect(FillPattern.Solid,
-          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder
-          else FillPattern.Solid),
-          fillColor=DynamicSelect({85,170,255},
-          if dynamic_energy_balance then fill_color_dynamic
-          else if diffusion then fill_color_singular
-          else fill_color_static)),
-        Line(points={{-90,80},{-60,80},{-40,46}}),
-        Line(points={{92,80},{60,80},{40,46}}),
-        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
-        Line(points={{92,-80},{60,-80},{40,-46}})}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end VolumeITh;
+within ThermoSysPro.Fluid.Volumes;
+model VolumeITh "Mixing volume with 4 inlets, 4 outlets and 1 thermal input"
+  extends
+    ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface;
+  extends ThermoSysPro.Fluid.Interfaces.IconColors;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+  import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region;
+
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.Volume V=1
+    "Volume (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=isCompressible and
+          dynamic_energy_balance and dynamic_mass_balance and not steady_state));
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Boolean diffusion=false
+    "true: energy balance equation with diffusion - false: energy balance equation without diffusion";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density"
+    annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+  parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties"));
+  parameter Boolean dynamic_composition_balance=false
+    "<html>true: dynamic fluid composition balance equation <br>false: static fluid composition balance equation (active for flue gases)</html>" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties"));
+
+  parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0
+    "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0
+    "Initial H20 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23
+    "Initial O2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+  parameter ThermoSysPro.Units.SI.MassFraction Xso20=0
+    "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog(
+      enable=dynamic_composition_balance,
+      tab="Fluid",
+      group=
+          "Initial composition values (active for flue gases only if dynamic_composition_balance=true)"));
+
+protected
+  constant Units.SI.SpecificEnthalpy hr=2501569
+    "Water/steam reference specific enthalpy at 0.01°C";
+  parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases";
+  parameter Units.SI.MassFlowRate gamma0=1.e-4
+    "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)";
+  parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Units.SI.DerDensityByPressure ddph
+    "density derivative wrt pressure at constant specific enthalpy";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "density derivative wrt specific enthalpy at constant pressure";
+  FluidType fluids[9] "Fluids mixing in volume";
+  Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation";
+  Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation";
+  Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation";
+  Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation";
+  ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction";
+  ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction";
+  Units.SI.Power Je1 "Thermal power diffusion from inlet e1";
+  Units.SI.Power Je2 "Thermal power diffusion from inlet e2";
+  Units.SI.Power Je3 "Thermal power diffusion from inlet e3";
+  Units.SI.Power Je4 "Thermal power diffusion from inlet e4";
+  Units.SI.Power Js1 "Thermal power diffusion from outlet s1";
+  Units.SI.Power Js2 "Thermal power diffusion from outlet s2";
+  Units.SI.Power Js3 "Thermal power diffusion from outlet s3";
+  Units.SI.Power Js4 "Thermal power diffusion from outlet s4";
+  Units.SI.Power J "Total thermal power diffusion";
+  Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1";
+  Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2";
+  Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3";
+  Units.SI.MassFlowRate gamma_e4 "Diffusion conductance for inlet e4";
+  Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1";
+  Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2";
+  Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3";
+  Units.SI.MassFlowRate gamma_s4 "Diffusion conductance for outlet s4";
+  Real re1 "Value of r(Q/gamma) for inlet e1";
+  Real re2 "Value of r(Q/gamma) for inlet e2";
+  Real re3 "Value of r(Q/gamma) for inlet e3";
+  Real re4 "Value of r(Q/gamma) for inlet e4";
+  Real rs1 "Value of r(Q/gamma) for outlet s1";
+  Real rs2 "Value of r(Q/gamma) for outlet s2";
+  Real rs3 "Value of r(Q/gamma) for outlet s3";
+  Real rs4 "Value of r(Q/gamma) for outlet s4";
+
+public
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement(
+        transformation(extent={{-110,70},{-90,90}},  rotation=0),
+        iconTransformation(extent={{-110,70},{-90,90}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement(
+        transformation(extent={{-110,-10},{-90,10}},
+                                                   rotation=0),
+        iconTransformation(extent={{-110,-10},{-90,10}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation (
+      Placement(transformation(extent={{90,70},{110,90}},  rotation=0),
+        iconTransformation(extent={{90,70},{110,90}})));
+  ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation (
+      Placement(transformation(extent={{90,-10},{110,10}},   rotation=0),
+        iconTransformation(extent={{90,-10},{110,10}})));
+  Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation(
+          extent={{-110,-90},{-90,-70}}), iconTransformation(extent={{-110,-90},
+            {-90,-70}})));
+  Interfaces.Connectors.FluidInlet Ce4 annotation (Placement(transformation(
+          extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{
+            10,-90}})));
+  Interfaces.Connectors.FluidOutlet Cs3 annotation (Placement(transformation(
+          extent={{90,-90},{110,-70}}), iconTransformation(extent={{90,-90},{110,
+            -70}})));
+  Interfaces.Connectors.FluidOutlet Cs4 annotation (Placement(transformation(
+          extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10,110}})));
+  Thermal.Connectors.ThermalPort              Cth
+                           annotation (Placement(transformation(extent={{-10,
+            -10},{10,10}}, rotation=0)));
+initial equation
+  if dynamic_energy_balance and dynamic_mass_balance then
+    if steady_state then
+      der(P) = 0;
+    else
+      P = P0;
+    end if;
+  end if;
+
+  if dynamic_energy_balance then
+    if steady_state then
+      der(h) = 0;
+    else
+      h = h0;
+    end if;
+  end if;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      if steady_state then
+        der(Xco2) = 0;
+        der(Xh2o) = 0;
+        der(Xo2) = 0;
+        der(Xso2) = 0;
+      else
+        Xco2 = Xco20;
+        Xh2o = Xh2o0;
+        Xo2 = Xo20;
+        Xso2 = Xso20;
+      end if;
+    end if;
+  end if;
+
+equation
+  /* Check that volume is positive */
+  if dynamic_energy_balance or dynamic_mass_balance then
+    assert(V > 0, "Volume non-positive");
+  end if;
+
+  /* Check that incoming fluids are compatible with fluid in volume */
+  fluids[1] = ftype;
+  fluids[2] = Ce1.ftype;
+  fluids[3] = Ce2.ftype;
+  fluids[4] = Ce3.ftype;
+  fluids[5] = Ce4.ftype;
+  fluids[6] = Cs1.ftype;
+  fluids[7] = Cs2.ftype;
+  fluids[8] = Cs3.ftype;
+  fluids[9] = Cs4.ftype;
+
+  assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids),
+    "VolumeITh: fluids mixing in volume are not compatible with each other");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.h_vol_1 = 1.e5;
+    Ce1.diff_res_1 = 0;
+    Ce1.diff_on_1 = false;
+    Ce1.ftype = ftype;
+    Ce1.Xco2 = 0;
+    Ce1.Xh2o = 0;
+    Ce1.Xo2 = 0;
+    Ce1.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.h_vol_1 = 1.e5;
+    Ce2.diff_res_1 = 0;
+    Ce2.diff_on_1 = false;
+    Ce2.ftype = ftype;
+    Ce2.Xco2 = 0;
+    Ce2.Xh2o = 0;
+    Ce2.Xo2 = 0;
+    Ce2.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.h_vol_1 = 1.e5;
+    Ce3.diff_res_1 = 0;
+    Ce3.diff_on_1 = false;
+    Ce3.ftype = ftype;
+    Ce3.Xco2 = 0;
+    Ce3.Xh2o = 0;
+    Ce3.Xo2 = 0;
+    Ce3.Xso2 = 0;
+  end if;
+
+  if (cardinality(Ce4) == 0) then
+    Ce4.Q = 0;
+    Ce4.h = 1.e5;
+    Ce4.h_vol_1 = 1.e5;
+    Ce4.diff_res_1 = 0;
+    Ce4.diff_on_1 = false;
+    Ce4.ftype = ftype;
+    Ce4.Xco2 = 0;
+    Ce4.Xh2o = 0;
+    Ce4.Xo2 = 0;
+    Ce4.Xso2 = 0;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h_vol_2 = 1.e5;
+    Cs1.diff_res_2 = 0;
+    Cs1.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h_vol_2 = 1.e5;
+    Cs2.diff_res_2 = 0;
+    Cs2.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs3) == 0) then
+    Cs3.Q = 0;
+    Cs3.h_vol_2 = 1.e5;
+    Cs3.diff_res_2 = 0;
+    Cs3.diff_on_2 = false;
+  end if;
+
+  if (cardinality(Cs4) == 0) then
+    Cs4.Q = 0;
+    Cs4.h_vol_2 = 1.e5;
+    Cs4.diff_res_2 = 0;
+    Cs4.diff_on_2 = false;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q;
+
+  if isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+    V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Ce4.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+  P = Cs4.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) + Ce4.Q*(Ce4.h - Ce4.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) - Cs4.Q*(Cs4.h - Cs4.Xh2o*hr) + Cth.W + J;
+
+  if dynamic_energy_balance then
+    if dynamic_mass_balance then
+      V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH;
+    else
+      V*rho*der(h - Xh2o*hr) = BH;
+    end if;
+  else
+    BH = 0;
+  end if;
+
+  Ce1.h_vol_2 = h;
+  Ce2.h_vol_2 = h;
+  Ce3.h_vol_2 = h;
+  Ce4.h_vol_2 = h;
+  Cs1.h_vol_1 = h;
+  Cs2.h_vol_1 = h;
+  Cs3.h_vol_1 = h;
+  Cs4.h_vol_1 = h;
+
+  /* Fluid composition balance equations */
+  BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q - Cs4.Xco2*Cs4.Q;
+  BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q - Cs4.Xh2o*Cs4.Q;
+  BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q - Cs4.Xo2*Cs4.Q;
+  BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q - Cs4.Xso2*Cs4.Q;
+
+  if flue_gases then
+    if dynamic_composition_balance then
+      V*rho*der(Xco2) + Xco2*BQ = BXco2;
+      V*rho*der(Xh2o) + Xh2o*BQ = BXh2o;
+      V*rho*der(Xo2)  + Xo2*BQ  = BXo2;
+      V*rho*der(Xso2) + Xso2*BQ = BXso2;
+    else
+      Xco2*BQ = BXco2;
+      Xh2o*BQ = BXh2o;
+      Xo2*BQ  = BXo2;
+      Xso2*BQ = BXso2;
+    end if;
+  else
+    Xco2 = 0;
+    Xh2o = 0;
+    Xo2 = 0;
+    Xso2 = 0;
+  end if;
+
+  Cs1.ftype = ftype;
+  Cs2.ftype = ftype;
+  Cs3.ftype = ftype;
+  Cs4.ftype = ftype;
+
+  Cs1.Xco2 = Xco2;
+  Cs1.Xh2o = Xh2o;
+  Cs1.Xo2  = Xo2;
+  Cs1.Xso2 = Xso2;
+
+  Cs2.Xco2 = Xco2;
+  Cs2.Xh2o = Xh2o;
+  Cs2.Xo2  = Xo2;
+  Cs2.Xso2 = Xso2;
+
+  Cs3.Xco2 = Xco2;
+  Cs3.Xh2o = Xh2o;
+  Cs3.Xo2  = Xo2;
+  Cs3.Xso2 = Xso2;
+
+  Cs4.Xco2 = Xco2;
+  Cs4.Xh2o = Xh2o;
+  Cs4.Xo2  = Xo2;
+  Cs4.Xso2 = Xso2;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1);
+    Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1);
+    Cs3.h = ThermoSysPro.Functions.SmoothCond(Cs3.Q/gamma_s3, Cs3.h_vol_1, Cs3.h_vol_2, 1);
+    Cs4.h = ThermoSysPro.Functions.SmoothCond(Cs4.Q/gamma_s4, Cs4.h_vol_1, Cs4.h_vol_2, 1);
+  else
+    Cs1.h = if (Cs1.Q > 0) then Cs1.h_vol_1 else Cs1.h_vol_2;
+    Cs2.h = if (Cs2.Q > 0) then Cs2.h_vol_1 else Cs2.h_vol_2;
+    Cs3.h = if (Cs3.Q > 0) then Cs3.h_vol_1 else Cs3.h_vol_2;
+    Cs4.h = if (Cs4.Q > 0) then Cs4.h_vol_1 else Cs4.h_vol_2;
+  end if;
+
+  /* Diffusion power */
+  if diffusion then
+    re1 = if Ce1.diff_on_1 then exp(-0.033*(Ce1.Q*Ce1.diff_res_1)^2) else 0;
+    re2 = if Ce2.diff_on_1 then exp(-0.033*(Ce2.Q*Ce2.diff_res_1)^2) else 0;
+    re3 = if Ce3.diff_on_1 then exp(-0.033*(Ce3.Q*Ce3.diff_res_1)^2) else 0;
+    re4 = if Ce4.diff_on_1 then exp(-0.033*(Ce4.Q*Ce4.diff_res_1)^2) else 0;
+    rs1 = if Cs1.diff_on_2 then exp(-0.033*(Cs1.Q*Cs1.diff_res_2)^2) else 0;
+    rs2 = if Cs2.diff_on_2 then exp(-0.033*(Cs2.Q*Cs2.diff_res_2)^2) else 0;
+    rs3 = if Cs3.diff_on_2 then exp(-0.033*(Cs3.Q*Cs3.diff_res_2)^2) else 0;
+    rs4 = if Cs4.diff_on_2 then exp(-0.033*(Cs4.Q*Cs4.diff_res_2)^2) else 0;
+
+    gamma_e1 = if Ce1.diff_on_1 then 1/Ce1.diff_res_1 else gamma0;
+    gamma_e2 = if Ce2.diff_on_1 then 1/Ce2.diff_res_1 else gamma0;
+    gamma_e3 = if Ce3.diff_on_1 then 1/Ce3.diff_res_1 else gamma0;
+    gamma_e4 = if Ce4.diff_on_1 then 1/Ce4.diff_res_1 else gamma0;
+    gamma_s1 = if Cs1.diff_on_2 then 1/Cs1.diff_res_2 else gamma0;
+    gamma_s2 = if Cs2.diff_on_2 then 1/Cs2.diff_res_2 else gamma0;
+    gamma_s3 = if Cs3.diff_on_2 then 1/Cs3.diff_res_2 else gamma0;
+    gamma_s4 = if Cs4.diff_on_2 then 1/Cs4.diff_res_2 else gamma0;
+
+    Je1 = if Ce1.diff_on_1 then re1*gamma_e1*(Ce1.h_vol_1 - Ce1.h_vol_2) else 0;
+    Je2 = if Ce2.diff_on_1 then re2*gamma_e2*(Ce2.h_vol_1 - Ce2.h_vol_2) else 0;
+    Je3 = if Ce3.diff_on_1 then re3*gamma_e3*(Ce3.h_vol_1 - Ce3.h_vol_2) else 0;
+    Je4 = if Ce4.diff_on_1 then re4*gamma_e4*(Ce4.h_vol_1 - Ce4.h_vol_2) else 0;
+    Js1 =  if Cs1.diff_on_2 then rs1*gamma_s1*(Cs1.h_vol_2 - Cs1.h_vol_1) else 0;
+    Js2 = if Cs2.diff_on_2 then rs2*gamma_s2*(Cs2.h_vol_2 - Cs2.h_vol_1) else 0;
+    Js3 = if Cs3.diff_on_2 then rs3*gamma_s3*(Cs3.h_vol_2 - Cs3.h_vol_1) else 0;
+    Js4 = if Cs4.diff_on_2 then rs4*gamma_s4*(Cs4.h_vol_2 - Cs4.h_vol_1) else 0;
+  else
+    re1 = 0;
+    re2 = 0;
+    re3 = 0;
+    re4 = 0;
+    rs1 = 0;
+    rs2 = 0;
+    rs3 = 0;
+    rs4 = 0;
+
+    gamma_e1 = gamma0;
+    gamma_e2 = gamma0;
+    gamma_e3 = gamma0;
+    gamma_e4 = gamma0;
+    gamma_s1 = gamma0;
+    gamma_s2 = gamma0;
+    gamma_s3 = gamma0;
+    gamma_s4 = gamma0;
+
+    Je1 = 0;
+    Je2 = 0;
+    Je3 = 0;
+    Je4 = 0;
+    Js1 = 0;
+    Js2 = 0;
+    Js3 = 0;
+    Js4 = 0;
+  end if;
+
+  J = Je1 + Je2 + Je3 + Je4 + Js1 + Js2 + Js3 + Js4;
+
+  Ce1.diff_res_2 = 0;
+  Ce2.diff_res_2 = 0;
+  Ce3.diff_res_2 = 0;
+  Ce4.diff_res_2 = 0;
+  Cs1.diff_res_1 = 0;
+  Cs2.diff_res_1 = 0;
+  Cs3.diff_res_1 = 0;
+  Cs4.diff_res_1 = 0;
+
+  Ce1.diff_on_2 = diffusion;
+  Ce2.diff_on_2 = diffusion;
+  Ce3.diff_on_2 = diffusion;
+  Ce4.diff_on_2 = diffusion;
+  Cs1.diff_on_1 = diffusion;
+  Cs2.diff_on_1 = diffusion;
+  Cs3.diff_on_1 = diffusion;
+  Cs4.diff_on_1 = diffusion;
+
+  /* Fluid thermodynamic properties */
+  if isCompressible and dynamic_mass_balance then
+    ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+    ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  else
+    ddph = 0;
+    ddhp = 0;
+  end if;
+
+  T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}, color={0,0,255}),
+        Line(points={{0,90},{0,-100}}, color={0,0,255},
+          thickness=0.2),
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255}),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          fillColor={85,170,255}),
+        Line(points={{-90,80},{-60,80},{-40,46}}),
+        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
+        Line(points={{92,80},{60,80},{40,46}}),
+        Line(points={{92,-80},{60,-80},{40,-46}})}),
+   Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{0,90},{0,-100}},
+          color={28,108,200},
+          thickness=0.2),
+        Line(
+          points={{-90,0},{90,0}},
+          color={28,108,200},
+          thickness=0.2),
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,0},
+          fillPattern=DynamicSelect(FillPattern.Solid,
+          if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder
+          else FillPattern.Solid),
+          fillColor=DynamicSelect({85,170,255},
+          if dynamic_energy_balance then fill_color_dynamic
+          else if diffusion then fill_color_singular
+          else fill_color_static)),
+        Line(points={{-90,80},{-60,80},{-40,46}}),
+        Line(points={{92,80},{60,80},{40,46}}),
+        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
+        Line(points={{92,-80},{60,-80},{40,-46}})}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end VolumeITh;
diff --git a/ThermoSysPro/Fluid/Volumes/package.mo b/ThermoSysPro/Fluid/Volumes/package.mo
index 66953e3845f46877504e798126a1f1f2cf60326e..ba27b88fb3bf9ac70b8cfa8b6b816364c952dd09 100644
--- a/ThermoSysPro/Fluid/Volumes/package.mo
+++ b/ThermoSysPro/Fluid/Volumes/package.mo
@@ -1,121 +1,121 @@
-within ThermoSysPro.Fluid;
-package Volumes "Volumes"
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end Volumes;
+within ThermoSysPro.Fluid;
+package Volumes "Volumes"
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}), Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end Volumes;
diff --git a/ThermoSysPro/Fluid/Volumes/package.order b/ThermoSysPro/Fluid/Volumes/package.order
index 64c4636cf9b407e4ec2902dfcb1aacf03bf76f4b..9c23c081c9865f28d97b5ffbeff17dd13869871f 100644
--- a/ThermoSysPro/Fluid/Volumes/package.order
+++ b/ThermoSysPro/Fluid/Volumes/package.order
@@ -1,17 +1,17 @@
-DynamicDrum
-Pressurizer
-Tank
-TankHorizontal
-TwoPhaseCavity
-TwoPhaseCavityOnePipe
-TwoPhaseVolume
-VolumeA
-VolumeATh
-VolumeB
-VolumeBTh
-VolumeC
-VolumeCTh
-VolumeD
-VolumeDTh
-VolumeI
-VolumeITh
+DynamicDrum
+Pressurizer
+Tank
+TankHorizontal
+TwoPhaseCavity
+TwoPhaseCavityOnePipe
+TwoPhaseVolume
+VolumeA
+VolumeATh
+VolumeB
+VolumeBTh
+VolumeC
+VolumeCTh
+VolumeD
+VolumeDTh
+VolumeI
+VolumeITh
diff --git a/ThermoSysPro/Fluid/package.mo b/ThermoSysPro/Fluid/package.mo
index a76eca00ef0236595c60b7a24f2cf096244f9102..783affb50f4f492a4c7a6cbe4059e42452230d6a 100644
--- a/ThermoSysPro/Fluid/package.mo
+++ b/ThermoSysPro/Fluid/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro;
-package Fluid "Fluid library"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Fluid;
+within ThermoSysPro;
+package Fluid "Fluid library"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Fluid;
diff --git a/ThermoSysPro/Fluid/package.order b/ThermoSysPro/Fluid/package.order
index 9c1e1858ea4a9fe824238335be487bca67c645a1..ce7eb2a7bbfe1e73e09bab0ba3ecac0e50d42477 100644
--- a/ThermoSysPro/Fluid/package.order
+++ b/ThermoSysPro/Fluid/package.order
@@ -1,12 +1,12 @@
-Boilers
-BoundaryConditions
-Combustion
-HeatExchangers
-Interfaces
-Junctions
-LoopBreakers
-Machines
-PressureLosses
-Sensors
-Volumes
-Examples
+Boilers
+BoundaryConditions
+Combustion
+HeatExchangers
+Interfaces
+Junctions
+LoopBreakers
+Machines
+PressureLosses
+Sensors
+Volumes
+Examples
diff --git a/ThermoSysPro/Functions/LinearInterpolation.mo b/ThermoSysPro/Functions/LinearInterpolation.mo
index fe5324e8c7d49f077247c925686da731aa8ebf43..a9701d5439e03f2a7599984dbfa158cdaee9f17d 100644
--- a/ThermoSysPro/Functions/LinearInterpolation.mo
+++ b/ThermoSysPro/Functions/LinearInterpolation.mo
@@ -1,26 +1,26 @@
-within ThermoSysPro.Functions;
-function LinearInterpolation "Linear interpolation"
-  input Real TabX[:] "References table";
-  input Real TabY[:] "Results table";
-  input Real X "Reference value";
-
-  output Real Y "Interpolated result";
-
-protected
-  Real deltaYX "Step in Y w.r.t. X";
-
-algorithm
-  (Y,deltaYX) := ThermoSysPro.Functions.Utilities.LinearInterpolation_i(
-    TabX,
-    TabY,
-    X);
-
-  annotation (
-    smoothOrder=1,
-     Icon(graphics),       Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.0</h4></p>
-</html><html>
-</html>", revisions="<html>
-</html>"));
-end LinearInterpolation;
+within ThermoSysPro.Functions;
+function LinearInterpolation "Linear interpolation"
+  input Real TabX[:] "References table";
+  input Real TabY[:] "Results table";
+  input Real X "Reference value";
+
+  output Real Y "Interpolated result";
+
+protected
+  Real deltaYX "Step in Y w.r.t. X";
+
+algorithm
+  (Y,deltaYX) := ThermoSysPro.Functions.Utilities.LinearInterpolation_i(
+    TabX,
+    TabY,
+    X);
+
+  annotation (
+    smoothOrder=1,
+     Icon(graphics),       Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.0</h4></p>
+</html><html>
+</html>", revisions="<html>
+</html>"));
+end LinearInterpolation;
diff --git a/ThermoSysPro/Functions/SmoothAbs.mo b/ThermoSysPro/Functions/SmoothAbs.mo
index 66137572d8f3638089a5bd8057e8aff8ea7fcb96..1b5f7fe0438810b991d0e32c6d6c1ef6cc3554b5 100644
--- a/ThermoSysPro/Functions/SmoothAbs.mo
+++ b/ThermoSysPro/Functions/SmoothAbs.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Functions;
-function SmoothAbs "Smooth abs function"
-  input Real x;
-  input Real alpha=100;
-
-  output Real y;
-
-algorithm
-  y := SmoothSign(x, alpha)*x;
-
-  annotation (smoothOrder=2, Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.0</h4>
-</html>"));
-end SmoothAbs;
+within ThermoSysPro.Functions;
+function SmoothAbs "Smooth abs function"
+  input Real x;
+  input Real alpha=100;
+
+  output Real y;
+
+algorithm
+  y := SmoothSign(x, alpha)*x;
+
+  annotation (smoothOrder=2, Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.0</h4>
+</html>"));
+end SmoothAbs;
diff --git a/ThermoSysPro/Functions/SmoothCond.mo b/ThermoSysPro/Functions/SmoothCond.mo
index 0f6b89c9bcf6dbba29ecd03288b13c85c3cf6511..c35182ae42912c529e92016b36c80c495333ccf9 100644
--- a/ThermoSysPro/Functions/SmoothCond.mo
+++ b/ThermoSysPro/Functions/SmoothCond.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Functions;
-function SmoothCond "Smooth conditional function"
-  input Real cond;
-  input Real x1;
-  input Real x2;
-  input Real alpha=100;
-
-  output Real y;
-
-algorithm
-  y := SmoothStep(cond, alpha)*x1 + SmoothStep(-cond, alpha)*x2;
-
-  annotation (smoothOrder=2, Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>"));
-end SmoothCond;
+within ThermoSysPro.Functions;
+function SmoothCond "Smooth conditional function"
+  input Real cond;
+  input Real x1;
+  input Real x2;
+  input Real alpha=100;
+
+  output Real y;
+
+algorithm
+  y := SmoothStep(cond, alpha)*x1 + SmoothStep(-cond, alpha)*x2;
+
+  annotation (smoothOrder=2, Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>"));
+end SmoothCond;
diff --git a/ThermoSysPro/Functions/SmoothMax.mo b/ThermoSysPro/Functions/SmoothMax.mo
index e714e159e32d429b31df2052141f7a56fe7aa566..ed560d667868fae0fe742a055bbef369a73d5753 100644
--- a/ThermoSysPro/Functions/SmoothMax.mo
+++ b/ThermoSysPro/Functions/SmoothMax.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Functions;
-function SmoothMax "Smooth max function"
-  input Real x1;
-  input Real x2;
-  input Real alpha=100;
-
-  output Real y;
-
-algorithm
-  y := SmoothStep(x1 - x2, alpha)*x1 + SmoothStep(x2 - x1, alpha)*x2;
-
-  annotation (smoothOrder=2, Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>"));
-end SmoothMax;
+within ThermoSysPro.Functions;
+function SmoothMax "Smooth max function"
+  input Real x1;
+  input Real x2;
+  input Real alpha=100;
+
+  output Real y;
+
+algorithm
+  y := SmoothStep(x1 - x2, alpha)*x1 + SmoothStep(x2 - x1, alpha)*x2;
+
+  annotation (smoothOrder=2, Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>"));
+end SmoothMax;
diff --git a/ThermoSysPro/Functions/SmoothMin.mo b/ThermoSysPro/Functions/SmoothMin.mo
index 4525e923b3def454fe81ac35ab2c033c8d054d35..7289eb9a9b9e9edc511057103577996737814bb6 100644
--- a/ThermoSysPro/Functions/SmoothMin.mo
+++ b/ThermoSysPro/Functions/SmoothMin.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Functions;
-function SmoothMin "Smooth min function"
-  input Real x1;
-  input Real x2;
-  input Real alpha=100;
-
-  output Real y;
-
-algorithm
-  y := SmoothStep(x1 - x2, alpha)*x2 + SmoothStep(x2 - x1, alpha)*x1;
-
-  annotation (smoothOrder=2, Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>"));
-end SmoothMin;
+within ThermoSysPro.Functions;
+function SmoothMin "Smooth min function"
+  input Real x1;
+  input Real x2;
+  input Real alpha=100;
+
+  output Real y;
+
+algorithm
+  y := SmoothStep(x1 - x2, alpha)*x2 + SmoothStep(x2 - x1, alpha)*x1;
+
+  annotation (smoothOrder=2, Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>"));
+end SmoothMin;
diff --git a/ThermoSysPro/Functions/SmoothSign.mo b/ThermoSysPro/Functions/SmoothSign.mo
index d5868c5010a799c8b1aa9e29011a5166f8a66903..233ebcc4bf7a01310bc62c709917162672a92e68 100644
--- a/ThermoSysPro/Functions/SmoothSign.mo
+++ b/ThermoSysPro/Functions/SmoothSign.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Functions;
-function SmoothSign "Smooth sign function"
-  input Real x;
-  input Real alpha=100;
-
-  output Real y;
-
-algorithm
-  y := SmoothStep(x, alpha) - SmoothStep(-x, alpha);
-
-  annotation (smoothOrder=2, Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.0</h4>
-</html>"));
-end SmoothSign;
+within ThermoSysPro.Functions;
+function SmoothSign "Smooth sign function"
+  input Real x;
+  input Real alpha=100;
+
+  output Real y;
+
+algorithm
+  y := SmoothStep(x, alpha) - SmoothStep(-x, alpha);
+
+  annotation (smoothOrder=2, Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.0</h4>
+</html>"));
+end SmoothSign;
diff --git a/ThermoSysPro/Functions/SmoothStep.mo b/ThermoSysPro/Functions/SmoothStep.mo
index 5c6680083491308a3a84d9a0807fefe49125fce1..d1f2cb37e3d4db1ee67d17501c3a7068d8fa4227 100644
--- a/ThermoSysPro/Functions/SmoothStep.mo
+++ b/ThermoSysPro/Functions/SmoothStep.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Functions;
-function SmoothStep "Smooth step function"
-  input Real x;
-  input Real alpha=100;
-
-  output Real y;
-
-algorithm
-  y := 1/(1 + exp(-alpha*x/2));
-
-  annotation (smoothOrder=2,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.0</h4>
-</html>"));
-end SmoothStep;
+within ThermoSysPro.Functions;
+function SmoothStep "Smooth step function"
+  input Real x;
+  input Real alpha=100;
+
+  output Real y;
+
+algorithm
+  y := 1/(1 + exp(-alpha*x/2));
+
+  annotation (smoothOrder=2,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.0</h4>
+</html>"));
+end SmoothStep;
diff --git a/ThermoSysPro/Functions/SplineInterpolation.mo b/ThermoSysPro/Functions/SplineInterpolation.mo
index 748d364b4777732fc8b38fadb02db3cacdb8d1b3..f8188c88be049b289e16a7ce12dfccb165d05368 100644
--- a/ThermoSysPro/Functions/SplineInterpolation.mo
+++ b/ThermoSysPro/Functions/SplineInterpolation.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Functions;
-function SplineInterpolation "Spline interpolation"
-  input Real TabX[:] "References table";
-  input Real TabY[:] "Results table";
-  input Real X "Reference value"; // index in table
-  input Real t(max = 1) = 0.5 "Stiffness parameter";
-  output Real Y "Interpolated result";
-
-protected
-  parameter Integer dimX=size(TabX, 1) "TabX dimension";
-  parameter Integer dimY=size(TabY, 1) "TabY dimension";
-  Real y0;
-  Real y1;
-  Real y2;
-  Real x0;
-  Real x1;
-  Real x2;
-  Real y1d "derivative at point at y1";
-  Real y2d "derivative at point at y2";
-  Integer IndX "Reference index";
-  Boolean IndXcal "True if IndX is contained in TabX";
-
-algorithm
-  if (dimX <> dimY) then
-    assert(false, "LinearInterpolation: the dimensions of the tables are different");
-  end if;
-  if (dimX < 2) then
-    assert(false, "Only one data point in table");
-  end if;
-
-  IndXcal := false;
-
-  // Find index in table:
-  if (X > TabX[1]) then
-    for i in 2:dimX loop
-      if ((X <= TabX[i]) and (not IndXcal)) then // IndX => x2
-        IndX := i;
-        IndXcal := true;
-      end if;
-    end for;
-  end if;
-
-  // If index is outside of table => Linear extrapolation
-  if (not IndXcal) then
-    if (X <= 2) then
-      IndX := 2;
-    else
-      IndX := dimX;
-    end if;
-  end if;
-
-  // Relevant data points:
-  y1 := TabY[IndX - 1];
-  y2 := TabY[IndX];
-  x1 := TabX[IndX - 1];
-  x2 := TabX[IndX];
-  y2d := (y2-y1)/(x2-x1); // Approximating derivative
-
-  // Use spline interpolation if X i contained in the table interval,
-  //  If NOT contained: Use linear extrapolation.
-  if (not IndXcal) then
-    // Linear Extrapolation
-    if (IndX == dimX) then
-      Y := y2d*(X - x2) + y2;
-    else
-      Y := y2d*(X-x1)+y1;
-    end if;
-  else
-    // Spline interpolation:
-    if (IndX == 2) then
-      y1d := y2d; // Approximating derivative
-    else
-      // In table (genral case)
-      y0 := TabY[IndX - 2];
-      x0 := TabX[IndX - 2];
-      y1d := (1 - t)*0.5*(y2d + (y1 - y0)/(x1 - x0)); // Approximating derivative
-      if (IndX < dimX) then
-        y2d := (1 - t)*0.5*(y2d + (TabY[IndX + 1] - y2)/(TabX[IndX + 1] - x2));
-      end if;
-    end if;
-
-    // Compute Y using CubicHermite, spline interpolation
-    Y := ThermoSysPro.Functions.Utilities.CubicHermite(
-      x=X,
-      x1=x1,
-      x2=x2,
-      y1=y1,
-      y2=y2,
-      y1d=y1d,
-      y2d=y2d);
-  end if;
-  annotation (
-    smoothOrder=1,
-     Icon(graphics),       Documentation(info="<html>
-<p><b>ThermoSysPro Version 3.1</b> </p>
-<p>Spline interpolation function. The resulting spline will be continuous and have a continuous first derivative.</p>
-<p><h4><font color=\"#008000\">Implementation</font></h4></p>
-<p>It uses a cardinal spline interpolation algorithm. Cardinal splines are a sub-set of cubic Hermite splines where each piece is a third-degree polynomial specified in Hermite form: i.e specified by its values and the first derivatives at the end points of the reference interval.</p>
-<p>The derivatives are calculated based on the non-uniform cardinal grid approach according to:</p>
-<p>y1_der=0.5(1-t)(y1-y0/(x1-x0)+(y2-y1/(x2-x1)</p>
-<p>I.e. the derivative in a point is calculated as an average of the surrounding points with an extra input shape parameter t.</p>
-<p><h4><font color=\"#008000\">Inputs</font></h4></p>
-<p><ul>
-<li>TabX: Vector containing x-table values</li>
-<li>TabY: Vector containing y-table values</li>
-<li>X: The x-value that the spline should be evaluated at</li>
-<li>t: Cardinal spline shape parameter. t = 0.5 is default and is generally a good choice. A value close to 1 will yield a stiff spline, t=0<a name=\"_x0000_i1025\">&nbsp;</a>corresponds to a Catmull-Rom spline and <a name=\"_x0000_i1025\">&nbsp;</a>t &LT; 0 corresponds to a more &ldquo;loose&rdquo; spline. From testing, t=0.5 <a name=\"_x0000_i1025\">&nbsp;</a>seems to be a good choice in general and is therefore chosen as a default value. A value of t = 1 corresponds to that the derivative in all data points is zero, which may result in strange curves . See Examples &GT; TestSplineInterpolation for a demonstration.</li>
-</ul></p>
-<p><h4><font color=\"#008000\">Output</font></h4></p>
-<p><ul>
-<li>Y: Interpolated value evaluated at X</li>
-</ul></p>
-<p><h4><font color=\"#008000\">Extrapolation</font></h4></p>
-<p>Linear extrapolation is employed if the reference value is not contained in the reference value table.</p>
-<p><h4><font color=\"#008000\">Example</font></h4></p>
-<p><ul>
-<li>TabX = {1,2,3,4};</li>
-<li>TabY = {4,3,5,2};<br/><br/><img src=\"modelica://ThermoSysPro/Resources/Images/spline.png\"/></li>
-</ul></p>
-<p><h4><font color=\"#008000\">References</font></h4></p>
-<p><a href=\"http://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf\">http://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf</a></p>
-</html>", revisions="<html>
-</html>"));
-end SplineInterpolation;
+within ThermoSysPro.Functions;
+function SplineInterpolation "Spline interpolation"
+  input Real TabX[:] "References table";
+  input Real TabY[:] "Results table";
+  input Real X "Reference value"; // index in table
+  input Real t(max = 1) = 0.5 "Stiffness parameter";
+  output Real Y "Interpolated result";
+
+protected
+  parameter Integer dimX=size(TabX, 1) "TabX dimension";
+  parameter Integer dimY=size(TabY, 1) "TabY dimension";
+  Real y0;
+  Real y1;
+  Real y2;
+  Real x0;
+  Real x1;
+  Real x2;
+  Real y1d "derivative at point at y1";
+  Real y2d "derivative at point at y2";
+  Integer IndX "Reference index";
+  Boolean IndXcal "True if IndX is contained in TabX";
+
+algorithm
+  if (dimX <> dimY) then
+    assert(false, "LinearInterpolation: the dimensions of the tables are different");
+  end if;
+  if (dimX < 2) then
+    assert(false, "Only one data point in table");
+  end if;
+
+  IndXcal := false;
+
+  // Find index in table:
+  if (X > TabX[1]) then
+    for i in 2:dimX loop
+      if ((X <= TabX[i]) and (not IndXcal)) then // IndX => x2
+        IndX := i;
+        IndXcal := true;
+      end if;
+    end for;
+  end if;
+
+  // If index is outside of table => Linear extrapolation
+  if (not IndXcal) then
+    if (X <= 2) then
+      IndX := 2;
+    else
+      IndX := dimX;
+    end if;
+  end if;
+
+  // Relevant data points:
+  y1 := TabY[IndX - 1];
+  y2 := TabY[IndX];
+  x1 := TabX[IndX - 1];
+  x2 := TabX[IndX];
+  y2d := (y2-y1)/(x2-x1); // Approximating derivative
+
+  // Use spline interpolation if X i contained in the table interval,
+  //  If NOT contained: Use linear extrapolation.
+  if (not IndXcal) then
+    // Linear Extrapolation
+    if (IndX == dimX) then
+      Y := y2d*(X - x2) + y2;
+    else
+      Y := y2d*(X-x1)+y1;
+    end if;
+  else
+    // Spline interpolation:
+    if (IndX == 2) then
+      y1d := y2d; // Approximating derivative
+    else
+      // In table (genral case)
+      y0 := TabY[IndX - 2];
+      x0 := TabX[IndX - 2];
+      y1d := (1 - t)*0.5*(y2d + (y1 - y0)/(x1 - x0)); // Approximating derivative
+      if (IndX < dimX) then
+        y2d := (1 - t)*0.5*(y2d + (TabY[IndX + 1] - y2)/(TabX[IndX + 1] - x2));
+      end if;
+    end if;
+
+    // Compute Y using CubicHermite, spline interpolation
+    Y := ThermoSysPro.Functions.Utilities.CubicHermite(
+      x=X,
+      x1=x1,
+      x2=x2,
+      y1=y1,
+      y2=y2,
+      y1d=y1d,
+      y2d=y2d);
+  end if;
+  annotation (
+    smoothOrder=1,
+     Icon(graphics),       Documentation(info="<html>
+<p><b>ThermoSysPro Version 3.1</b> </p>
+<p>Spline interpolation function. The resulting spline will be continuous and have a continuous first derivative.</p>
+<p><h4><font color=\"#008000\">Implementation</font></h4></p>
+<p>It uses a cardinal spline interpolation algorithm. Cardinal splines are a sub-set of cubic Hermite splines where each piece is a third-degree polynomial specified in Hermite form: i.e specified by its values and the first derivatives at the end points of the reference interval.</p>
+<p>The derivatives are calculated based on the non-uniform cardinal grid approach according to:</p>
+<p>y1_der=0.5(1-t)(y1-y0/(x1-x0)+(y2-y1/(x2-x1)</p>
+<p>I.e. the derivative in a point is calculated as an average of the surrounding points with an extra input shape parameter t.</p>
+<p><h4><font color=\"#008000\">Inputs</font></h4></p>
+<p><ul>
+<li>TabX: Vector containing x-table values</li>
+<li>TabY: Vector containing y-table values</li>
+<li>X: The x-value that the spline should be evaluated at</li>
+<li>t: Cardinal spline shape parameter. t = 0.5 is default and is generally a good choice. A value close to 1 will yield a stiff spline, t=0<a name=\"_x0000_i1025\">&nbsp;</a>corresponds to a Catmull-Rom spline and <a name=\"_x0000_i1025\">&nbsp;</a>t &LT; 0 corresponds to a more &ldquo;loose&rdquo; spline. From testing, t=0.5 <a name=\"_x0000_i1025\">&nbsp;</a>seems to be a good choice in general and is therefore chosen as a default value. A value of t = 1 corresponds to that the derivative in all data points is zero, which may result in strange curves . See Examples &GT; TestSplineInterpolation for a demonstration.</li>
+</ul></p>
+<p><h4><font color=\"#008000\">Output</font></h4></p>
+<p><ul>
+<li>Y: Interpolated value evaluated at X</li>
+</ul></p>
+<p><h4><font color=\"#008000\">Extrapolation</font></h4></p>
+<p>Linear extrapolation is employed if the reference value is not contained in the reference value table.</p>
+<p><h4><font color=\"#008000\">Example</font></h4></p>
+<p><ul>
+<li>TabX = {1,2,3,4};</li>
+<li>TabY = {4,3,5,2};<br/><br/><img src=\"modelica://ThermoSysPro/Resources/Images/spline.png\"/></li>
+</ul></p>
+<p><h4><font color=\"#008000\">References</font></h4></p>
+<p><a href=\"http://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf\">http://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf</a></p>
+</html>", revisions="<html>
+</html>"));
+end SplineInterpolation;
diff --git a/ThermoSysPro/Functions/TableLinearInterpolation.mo b/ThermoSysPro/Functions/TableLinearInterpolation.mo
index f0475adfa8c1aae1d41abf6aea1ad7bee0fdc718..184af711fb53c05e605f58fd3dd321d905352ef9 100644
--- a/ThermoSysPro/Functions/TableLinearInterpolation.mo
+++ b/ThermoSysPro/Functions/TableLinearInterpolation.mo
@@ -1,37 +1,37 @@
-within ThermoSysPro.Functions;
-function TableLinearInterpolation "Table linear interpolation"
-  input Real TabP[:] "1st reference table";
-  input Real TabX[:] "2nd reference table";
-  input Real TabY[:, :] "Results table";
-  input Real P "1st reference value";
-  input Real X "2nd reference value";
-
-  output Real Y "Interpolated result";
-
-protected
-  Real deltaYX "Y step wrt. X";
-  Real deltaYP "Y step wrt. P";
-
-algorithm
-  (Y,deltaYX,deltaYP) := ThermoSysPro.Functions.Utilities.TableLinearInterpolation_i(
-    TabP,
-    TabX,
-    TabY,
-    P,
-    X);
-
-  annotation (
-    smoothOrder=2,
-    Icon(graphics),        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 3.0</b></p>
-</HTML>
-",        revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end TableLinearInterpolation;
+within ThermoSysPro.Functions;
+function TableLinearInterpolation "Table linear interpolation"
+  input Real TabP[:] "1st reference table";
+  input Real TabX[:] "2nd reference table";
+  input Real TabY[:, :] "Results table";
+  input Real P "1st reference value";
+  input Real X "2nd reference value";
+
+  output Real Y "Interpolated result";
+
+protected
+  Real deltaYX "Y step wrt. X";
+  Real deltaYP "Y step wrt. P";
+
+algorithm
+  (Y,deltaYX,deltaYP) := ThermoSysPro.Functions.Utilities.TableLinearInterpolation_i(
+    TabP,
+    TabX,
+    TabY,
+    P,
+    X);
+
+  annotation (
+    smoothOrder=2,
+    Icon(graphics),        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 3.0</b></p>
+</HTML>
+",        revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end TableLinearInterpolation;
diff --git a/ThermoSysPro/Functions/TableSplineInterpolation.mo b/ThermoSysPro/Functions/TableSplineInterpolation.mo
index 974ad9287e6d52550c109e5a133f46d4f06c7628..1517026471a5f2dc3ee92e43ee5496f90c2681e5 100644
--- a/ThermoSysPro/Functions/TableSplineInterpolation.mo
+++ b/ThermoSysPro/Functions/TableSplineInterpolation.mo
@@ -1,109 +1,109 @@
-within ThermoSysPro.Functions;
-function TableSplineInterpolation "Table spline interpolation"
-  input Real TabP[:] "1st reference table";
-  input Real TabX[:] "2nd reference table";
-  input Real TabY[:, :] "Results table";
-  input Real P "1st reference value";
-  input Real X "2nd reference value";
-  input Real t = 0.5 "Stiffness parameter";
-  output Real Y "Interpolated result";
-
-protected
-  Integer dimP=size(TabP, 1) "TabP dimension";
-  Integer dimX=size(TabX, 1) "TabX dimension";
-  Integer dimY1=size(TabY, 1) "TabY 1st dimension";
-  Integer dimY2=size(TabY, 2) "TabY 2nd dimension";
-  Integer IndP=0 "Reference index";
-  Boolean IndPcal "Computed index";
-
-  Real Y1;
-  Real Y0;
-  Real Y2;
-
-algorithm
-  if ((dimX <> dimY2) or (dimP <> dimY1)) then
-    assert(false, "TableLinearInterpolation: the dimensions of the tables are different");
-  end if;
-
-  IndPcal :=false;
-
- for i in 2:dimP loop
-    if ((P <= TabP[i]) and (not IndPcal)) then
-      IndP := i;
-      IndPcal := true;
-    end if;
-  end for;
-
-   // If P is not contained in the table:
-  if (not IndPcal) then
-    IndP := dimP;
-    if integer(P)<=2 then
-      IndP :=2;
-    end if;
-  end if;
-
-  // Find corresponding table for IndP (p1, p2)
-  Y1 := ThermoSysPro.Functions.SplineInterpolation(
-    TabX=TabX,
-    TabY=TabY[IndP - 1, :],
-    X=X, t= t);
-  Y2 := ThermoSysPro.Functions.SplineInterpolation(
-    TabX=TabX,
-    TabY=TabY[IndP, :],
-    X=X, t = t);
-
- // If possible to use three points (p0,p1,p2):
- if ((IndP > 2) and IndPcal) then
-    Y0 := ThermoSysPro.Functions.SplineInterpolation(
-      TabX=TabX,
-      TabY=TabY[IndP - 2, :],
-      X=X, t= t);
-    Y := ThermoSysPro.Functions.SplineInterpolation(
-      TabX=TabP[IndP - 2:IndP],
-      TabY={Y0,Y1,Y2},
-      X=P, t= t);
- else
-    Y := ThermoSysPro.Functions.SplineInterpolation(
-      TabX=TabP[IndP - 1:IndP],
-      TabY={Y1,Y2},
-      X=P, t= t);
- end if;
-
-  annotation (
-    smoothOrder=2,
-    Icon(graphics),        Documentation(info="<html>
-<p><b>ThermoSysPro Version 3.1</b> </p>
-<p>Computes 2-dimensional spline interpolation based on function SplineInterpolation. The resulting 2-dimensional spline will be continuous and have continuous first derivatives. </p>
-<p><h4><font color=\"#008000\">Implementation</font></h4></p>
-<p>It uses a cardinal spline interpolation algorithm. Cardinal splines are a sub-set of cubic Hermite splines where each piece is a third-degree polynomial specified in Hermite form: i.e specified by its values and the first derivatives at the end points of the reference interval.</p>
-<p>The derivatives are calculated based on the non-uniform cardinal grid approach, see function SplineInterpolation for futher details.</p>
-<p><h4><font color=\"#008000\">Inputs</font></h4></p>
-<p><ul>
-<li>TabP: vecor containing p-table values</li>
-<li>TabX: Vector containing x-table values</li>
-<li>TabY: Vector containing y-table values</li>
-<li>P: The p-value that the spline should be evaluated at</li>
-<li>X: The x-value that the spline should be evaluated at</li>
-<li>t: Cardinal spline shape parameter. t = 0.5 is default and is generally a good choice. A value close to 1 will yield a stiff spline, t=0<a name=\"_x0000_i1025\">&nbsp;</a>corresponds to a Catmull-Rom spline and <a name=\"_x0000_i1025\">&nbsp;</a>t &LT; 0 corresponds to a more &ldquo;loose&rdquo; spline. From testing, t=0.5 <a name=\"_x0000_i1025\">&nbsp;</a>seems to be a good choice in general and is therefore chosen as a default value. A value of t = 1 corresponds to that the derivative in all data points is zero, which may result in strange curves . See Examples &GT; TestSplineInterpolation for a demonstration.</li>
-</ul></p>
-<p><h4><font color=\"#008000\">Output</font></h4></p>
-<p><ul>
-<li>Y: Interpolated value evaluated at P,X</li>
-</ul></p>
-<p><h4><font color=\"#008000\">Extrapolation</font></h4></p>
-<p>Linear extrapolation is employed if the reference value is not contained in the reference value table.</p>
-<p><br/><b><font style=\"color: #008000; \">Example</font></b></p>
-<p><ul>
-<li>TabX = {1,2,3,4};</li>
-<li>TabP = {1,2,3,4};</li>
-<li>TabY = &nbsp;[2,2,2,2;2,2,1,2;2,2,2,2;1,2,1,2]; </li>
-</ul></p>
-<p>TabY respresents the value table, and TabX and TabP represent the reference tables.</p>
-<p>The example was called for X = linspace(0,0.1,5) and P = linspace(0.1,0.1,4)</p>
-<p>The black dots represent the data points, and the red lines represent the interpolation result.</p>
-<p><br/><img src=\"modelica://ThermoSysPro/Resources/Images/splinetable.png\"/></p>
-<p><h4><font color=\"#008000\">References</font></h4></p>
-<p><a href=\"http://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf\">http://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf</a></p>
-</html>", revisions="<html>
-</html>"));
-end TableSplineInterpolation;
+within ThermoSysPro.Functions;
+function TableSplineInterpolation "Table spline interpolation"
+  input Real TabP[:] "1st reference table";
+  input Real TabX[:] "2nd reference table";
+  input Real TabY[:, :] "Results table";
+  input Real P "1st reference value";
+  input Real X "2nd reference value";
+  input Real t = 0.5 "Stiffness parameter";
+  output Real Y "Interpolated result";
+
+protected
+  Integer dimP=size(TabP, 1) "TabP dimension";
+  Integer dimX=size(TabX, 1) "TabX dimension";
+  Integer dimY1=size(TabY, 1) "TabY 1st dimension";
+  Integer dimY2=size(TabY, 2) "TabY 2nd dimension";
+  Integer IndP=0 "Reference index";
+  Boolean IndPcal "Computed index";
+
+  Real Y1;
+  Real Y0;
+  Real Y2;
+
+algorithm
+  if ((dimX <> dimY2) or (dimP <> dimY1)) then
+    assert(false, "TableLinearInterpolation: the dimensions of the tables are different");
+  end if;
+
+  IndPcal :=false;
+
+ for i in 2:dimP loop
+    if ((P <= TabP[i]) and (not IndPcal)) then
+      IndP := i;
+      IndPcal := true;
+    end if;
+  end for;
+
+   // If P is not contained in the table:
+  if (not IndPcal) then
+    IndP := dimP;
+    if integer(P)<=2 then
+      IndP :=2;
+    end if;
+  end if;
+
+  // Find corresponding table for IndP (p1, p2)
+  Y1 := ThermoSysPro.Functions.SplineInterpolation(
+    TabX=TabX,
+    TabY=TabY[IndP - 1, :],
+    X=X, t= t);
+  Y2 := ThermoSysPro.Functions.SplineInterpolation(
+    TabX=TabX,
+    TabY=TabY[IndP, :],
+    X=X, t = t);
+
+ // If possible to use three points (p0,p1,p2):
+ if ((IndP > 2) and IndPcal) then
+    Y0 := ThermoSysPro.Functions.SplineInterpolation(
+      TabX=TabX,
+      TabY=TabY[IndP - 2, :],
+      X=X, t= t);
+    Y := ThermoSysPro.Functions.SplineInterpolation(
+      TabX=TabP[IndP - 2:IndP],
+      TabY={Y0,Y1,Y2},
+      X=P, t= t);
+ else
+    Y := ThermoSysPro.Functions.SplineInterpolation(
+      TabX=TabP[IndP - 1:IndP],
+      TabY={Y1,Y2},
+      X=P, t= t);
+ end if;
+
+  annotation (
+    smoothOrder=2,
+    Icon(graphics),        Documentation(info="<html>
+<p><b>ThermoSysPro Version 3.1</b> </p>
+<p>Computes 2-dimensional spline interpolation based on function SplineInterpolation. The resulting 2-dimensional spline will be continuous and have continuous first derivatives. </p>
+<p><h4><font color=\"#008000\">Implementation</font></h4></p>
+<p>It uses a cardinal spline interpolation algorithm. Cardinal splines are a sub-set of cubic Hermite splines where each piece is a third-degree polynomial specified in Hermite form: i.e specified by its values and the first derivatives at the end points of the reference interval.</p>
+<p>The derivatives are calculated based on the non-uniform cardinal grid approach, see function SplineInterpolation for futher details.</p>
+<p><h4><font color=\"#008000\">Inputs</font></h4></p>
+<p><ul>
+<li>TabP: vecor containing p-table values</li>
+<li>TabX: Vector containing x-table values</li>
+<li>TabY: Vector containing y-table values</li>
+<li>P: The p-value that the spline should be evaluated at</li>
+<li>X: The x-value that the spline should be evaluated at</li>
+<li>t: Cardinal spline shape parameter. t = 0.5 is default and is generally a good choice. A value close to 1 will yield a stiff spline, t=0<a name=\"_x0000_i1025\">&nbsp;</a>corresponds to a Catmull-Rom spline and <a name=\"_x0000_i1025\">&nbsp;</a>t &LT; 0 corresponds to a more &ldquo;loose&rdquo; spline. From testing, t=0.5 <a name=\"_x0000_i1025\">&nbsp;</a>seems to be a good choice in general and is therefore chosen as a default value. A value of t = 1 corresponds to that the derivative in all data points is zero, which may result in strange curves . See Examples &GT; TestSplineInterpolation for a demonstration.</li>
+</ul></p>
+<p><h4><font color=\"#008000\">Output</font></h4></p>
+<p><ul>
+<li>Y: Interpolated value evaluated at P,X</li>
+</ul></p>
+<p><h4><font color=\"#008000\">Extrapolation</font></h4></p>
+<p>Linear extrapolation is employed if the reference value is not contained in the reference value table.</p>
+<p><br/><b><font style=\"color: #008000; \">Example</font></b></p>
+<p><ul>
+<li>TabX = {1,2,3,4};</li>
+<li>TabP = {1,2,3,4};</li>
+<li>TabY = &nbsp;[2,2,2,2;2,2,1,2;2,2,2,2;1,2,1,2]; </li>
+</ul></p>
+<p>TabY respresents the value table, and TabX and TabP represent the reference tables.</p>
+<p>The example was called for X = linspace(0,0.1,5) and P = linspace(0.1,0.1,4)</p>
+<p>The black dots represent the data points, and the red lines represent the interpolation result.</p>
+<p><br/><img src=\"modelica://ThermoSysPro/Resources/Images/splinetable.png\"/></p>
+<p><h4><font color=\"#008000\">References</font></h4></p>
+<p><a href=\"http://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf\">http://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf</a></p>
+</html>", revisions="<html>
+</html>"));
+end TableSplineInterpolation;
diff --git a/ThermoSysPro/Functions/ThermoRoot.mo b/ThermoSysPro/Functions/ThermoRoot.mo
index 35fa5b0ab17fccc962a13163b8974a5fb5b24c58..3075186cbf4b1586bf7e715519518f5fdaf4d1b1 100644
--- a/ThermoSysPro/Functions/ThermoRoot.mo
+++ b/ThermoSysPro/Functions/ThermoRoot.mo
@@ -1,45 +1,45 @@
-within ThermoSysPro.Functions;
-function ThermoRoot "Thermodynamic root"
-  input Real x;
-  input Real dx;
-
-  output Real y;
-
-protected
-  Real C3;
-  Real C1;
-  Real dx2;
-  Real adx;
-  Real sqrtdx;
-
-algorithm
-  adx := abs(dx);
-  if (x > adx) then
-    y := sqrt(x);
-  else
-    if (x < -adx) then
-      y := -sqrt(-x);
-    else
-      dx2 := adx*adx;
-      sqrtdx := sqrt(adx);
-      C3 := -0.25/(sqrtdx*dx2);
-      C1 := 0.5/sqrtdx - 3.0*C3*dx2;
-      y := (C1 + C3*x*x)*x;
-    end if;
-  end if;
-
-  annotation (smoothOrder=1,
-    Window(
-      x=0.2,
-      y=0.17,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b> </p>
-<p><b>ThermoSysPro Version 2.0</h4>
-</html>"));
-end ThermoRoot;
+within ThermoSysPro.Functions;
+function ThermoRoot "Thermodynamic root"
+  input Real x;
+  input Real dx;
+
+  output Real y;
+
+protected
+  Real C3;
+  Real C1;
+  Real dx2;
+  Real adx;
+  Real sqrtdx;
+
+algorithm
+  adx := abs(dx);
+  if (x > adx) then
+    y := sqrt(x);
+  else
+    if (x < -adx) then
+      y := -sqrt(-x);
+    else
+      dx2 := adx*adx;
+      sqrtdx := sqrt(adx);
+      C3 := -0.25/(sqrtdx*dx2);
+      C1 := 0.5/sqrtdx - 3.0*C3*dx2;
+      y := (C1 + C3*x*x)*x;
+    end if;
+  end if;
+
+  annotation (smoothOrder=1,
+    Window(
+      x=0.2,
+      y=0.17,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b> </p>
+<p><b>ThermoSysPro Version 2.0</h4>
+</html>"));
+end ThermoRoot;
diff --git a/ThermoSysPro/Functions/ThermoSquare.mo b/ThermoSysPro/Functions/ThermoSquare.mo
index 97f7d5154458a0d9ab0dbd3222347038903daddc..e85424aac8667a008cd4a5bcd434870b323da78c 100644
--- a/ThermoSysPro/Functions/ThermoSquare.mo
+++ b/ThermoSysPro/Functions/ThermoSquare.mo
@@ -1,28 +1,28 @@
-within ThermoSysPro.Functions;
-function ThermoSquare "Thermodynamic square"
-  input Real x;
-
-  input Real dx;
-  output Real y;
-
-algorithm
-  y := if (abs(x) > dx) then x*abs(x) else x*dx;
-
-  annotation (smoothOrder = 1,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.11,
-      y=0.2,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end ThermoSquare;
+within ThermoSysPro.Functions;
+function ThermoSquare "Thermodynamic square"
+  input Real x;
+
+  input Real dx;
+  output Real y;
+
+algorithm
+  y := if (abs(x) > dx) then x*abs(x) else x*dx;
+
+  annotation (smoothOrder = 1,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.11,
+      y=0.2,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end ThermoSquare;
diff --git a/ThermoSysPro/Functions/Utilities/CubicHermite.mo b/ThermoSysPro/Functions/Utilities/CubicHermite.mo
index 535501353373d9ea00aae148b3ce1fd0c74c0535..f12fc01d0c5c922fdccb84657f31656625d172a3 100644
--- a/ThermoSysPro/Functions/Utilities/CubicHermite.mo
+++ b/ThermoSysPro/Functions/Utilities/CubicHermite.mo
@@ -1,46 +1,46 @@
-within ThermoSysPro.Functions.Utilities;
-function CubicHermite "Evaluate a cubic Hermite spline"
-  input Real x "Abscissa value";
-  input Real x1 "Lower abscissa value";
-  input Real x2 "Upper abscissa value";
-  input Real y1 "Lower ordinate value";
-  input Real y2 "Upper ordinate value";
-  input Real y1d "Lower gradient";
-  input Real y2d "Upper gradient";
-  output Real y "Interpolated ordinate value";
-protected
-  Real h "Distance between x1 and x2";
-  Real t "abscissa scaled with h, i.e., t=[0..1] within x=[x1..x2]";
-  Real h00 "Basis function 00 of cubic Hermite spline";
-  Real h10 "Basis function 10 of cubic Hermite spline";
-  Real h01 "Basis function 01 of cubic Hermite spline";
-  Real h11 "Basis function 11 of cubic Hermite spline";
-  Real aux3 "t cube";
-  Real aux2 "t square";
-algorithm
-  h := x2 - x1;
-  if abs(h)>0 then
-    // Regular case
-    t := (x - x1)/h;
-
-    aux3 :=t^3;
-    aux2 :=t^2;
-
-    h00 := 2*aux3 - 3*aux2 + 1;
-    h10 := aux3 - 2*aux2 + t;
-    h01 := -2*aux3 + 3*aux2;
-    h11 := aux3 - aux2;
-    y := y1*h00 + h*y1d*h10 + y2*h01 + h*y2d*h11;
-  else
-    // Degenerate case, x1 and x2 are identical, return step function
-    y := (y1 + y2)/2;
-  end if;
-  annotation(smoothOrder=3, Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li><i>May 2008</i> by <a href=\"mailto:Michael.Sielemann@dlr.de\">Michael Sielemann</a></li>
-</ul>
-</html>", info="<html>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>"));
-end CubicHermite;
+within ThermoSysPro.Functions.Utilities;
+function CubicHermite "Evaluate a cubic Hermite spline"
+  input Real x "Abscissa value";
+  input Real x1 "Lower abscissa value";
+  input Real x2 "Upper abscissa value";
+  input Real y1 "Lower ordinate value";
+  input Real y2 "Upper ordinate value";
+  input Real y1d "Lower gradient";
+  input Real y2d "Upper gradient";
+  output Real y "Interpolated ordinate value";
+protected
+  Real h "Distance between x1 and x2";
+  Real t "abscissa scaled with h, i.e., t=[0..1] within x=[x1..x2]";
+  Real h00 "Basis function 00 of cubic Hermite spline";
+  Real h10 "Basis function 10 of cubic Hermite spline";
+  Real h01 "Basis function 01 of cubic Hermite spline";
+  Real h11 "Basis function 11 of cubic Hermite spline";
+  Real aux3 "t cube";
+  Real aux2 "t square";
+algorithm
+  h := x2 - x1;
+  if abs(h)>0 then
+    // Regular case
+    t := (x - x1)/h;
+
+    aux3 :=t^3;
+    aux2 :=t^2;
+
+    h00 := 2*aux3 - 3*aux2 + 1;
+    h10 := aux3 - 2*aux2 + t;
+    h01 := -2*aux3 + 3*aux2;
+    h11 := aux3 - aux2;
+    y := y1*h00 + h*y1d*h10 + y2*h01 + h*y2d*h11;
+  else
+    // Degenerate case, x1 and x2 are identical, return step function
+    y := (y1 + y2)/2;
+  end if;
+  annotation(smoothOrder=3, Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li><i>May 2008</i> by <a href=\"mailto:Michael.Sielemann@dlr.de\">Michael Sielemann</a></li>
+</ul>
+</html>", info="<html>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>"));
+end CubicHermite;
diff --git a/ThermoSysPro/Functions/Utilities/LinearInterpolation_i.mo b/ThermoSysPro/Functions/Utilities/LinearInterpolation_i.mo
index 4c2d21b2ac7025d5f3c80b42b72fed473a1a0019..f39614a2a20611b1dcbfc11237603e295e1db9fd 100644
--- a/ThermoSysPro/Functions/Utilities/LinearInterpolation_i.mo
+++ b/ThermoSysPro/Functions/Utilities/LinearInterpolation_i.mo
@@ -1,53 +1,53 @@
-within ThermoSysPro.Functions.Utilities;
-function LinearInterpolation_i "Linear interpolation (internal function)"
-  input Real TabX[:] "References table";
-  input Real TabY[:] "Results table";
-  input Real X "Reference value";
-
-  output Real Y "Interpolated result";
-  output Real DeltaYX "Y step wrt. X";
-
-protected
-  Integer dimX=size(TabX, 1) "TabX dimension";
-  Integer dimY=size(TabY, 1) "TabY dimension";
-  Integer IndX=0 "Reference index";
-  Boolean IndXcal "Computed index";
-  Real ValNum;
-  Real ValDen;
-  Real DeltaYX2 "Step in Y w.r.t. X";
-
-algorithm
-  if (dimX <> dimY) then
-    assert(false, "LinearInterpolation: the dimensions of the tables are different");
-  end if;
-
-  IndXcal := false;
-
-  for i in 2:dimX - 1 loop
-     if ((X <= TabX[i]) and (not IndXcal)) then
-      IndX := i;
-      IndXcal := true;
-    end if;
-  end for;
-
-  if (not IndXcal) then
-    IndX := dimX;
-  end if;
-
-  ValNum := integer(1000*TabY[IndX] + 0.5)/1000 - integer(1000*TabY[IndX - 1] + 0.5)/1000;
-  ValDen := integer(1000*TabX[IndX] + 0.5)/1000 - integer(1000*TabX[IndX - 1] + 0.5)/1000;
-
-  DeltaYX := ValNum/ValDen;
-  DeltaYX2 := (TabY[IndX] - TabY[IndX - 1])/(TabX[IndX] - TabX[IndX - 1]);
-
-  Y := (TabY[IndX] - TabY[IndX - 1])/(TabX[IndX] - TabX[IndX - 1])*(X - TabX[IndX - 1]) + TabY[IndX - 1];
-
-  annotation (
-    smoothOrder=1,
-     Icon(graphics),       Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</b> </p>
-</html>" "<html>
-</html>", revisions="<html>
-</html>"));
-end LinearInterpolation_i;
+within ThermoSysPro.Functions.Utilities;
+function LinearInterpolation_i "Linear interpolation (internal function)"
+  input Real TabX[:] "References table";
+  input Real TabY[:] "Results table";
+  input Real X "Reference value";
+
+  output Real Y "Interpolated result";
+  output Real DeltaYX "Y step wrt. X";
+
+protected
+  Integer dimX=size(TabX, 1) "TabX dimension";
+  Integer dimY=size(TabY, 1) "TabY dimension";
+  Integer IndX=0 "Reference index";
+  Boolean IndXcal "Computed index";
+  Real ValNum;
+  Real ValDen;
+  Real DeltaYX2 "Step in Y w.r.t. X";
+
+algorithm
+  if (dimX <> dimY) then
+    assert(false, "LinearInterpolation: the dimensions of the tables are different");
+  end if;
+
+  IndXcal := false;
+
+  for i in 2:dimX - 1 loop
+     if ((X <= TabX[i]) and (not IndXcal)) then
+      IndX := i;
+      IndXcal := true;
+    end if;
+  end for;
+
+  if (not IndXcal) then
+    IndX := dimX;
+  end if;
+
+  ValNum := integer(1000*TabY[IndX] + 0.5)/1000 - integer(1000*TabY[IndX - 1] + 0.5)/1000;
+  ValDen := integer(1000*TabX[IndX] + 0.5)/1000 - integer(1000*TabX[IndX - 1] + 0.5)/1000;
+
+  DeltaYX := ValNum/ValDen;
+  DeltaYX2 := (TabY[IndX] - TabY[IndX - 1])/(TabX[IndX] - TabX[IndX - 1]);
+
+  Y := (TabY[IndX] - TabY[IndX - 1])/(TabX[IndX] - TabX[IndX - 1])*(X - TabX[IndX - 1]) + TabY[IndX - 1];
+
+  annotation (
+    smoothOrder=1,
+     Icon(graphics),       Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</b> </p>
+</html>" "<html>
+</html>", revisions="<html>
+</html>"));
+end LinearInterpolation_i;
diff --git a/ThermoSysPro/Functions/Utilities/RedGreen_colorMap.mo b/ThermoSysPro/Functions/Utilities/RedGreen_colorMap.mo
new file mode 100644
index 0000000000000000000000000000000000000000..5c215abb32bbac9b373bfa51409f45c4752b1778
--- /dev/null
+++ b/ThermoSysPro/Functions/Utilities/RedGreen_colorMap.mo
@@ -0,0 +1,37 @@
+within ThermoSysPro.Functions.Utilities;
+function RedGreen_colorMap "Returns the \"RedGreen\" color map"
+extends Modelica.Mechanics.MultiBody.Interfaces.partialColorMap;
+algorithm
+  if n_colors > 1 then
+     colorMap := [linspace(162.,254.,integer(ceil(n_colors/2))),linspace(0,254.,integer(ceil(n_colors/2))),linspace(30.,189.,integer(ceil(n_colors/2)));
+                     linspace(254.,0,integer(floor(n_colors/2))),linspace(254.,93.,integer(floor(n_colors/2))),linspace(189.,40.,integer(floor(n_colors/2)))];
+   else
+    colorMap:=255*[1,0,1];
+   end if;
+
+  annotation (Documentation(info="<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+ColorMaps.<strong>RedGreen</strong>();
+ColorMaps.<strong>RedGreen</strong>(n_colors=64);
+</pre></blockquote>
+<h4>Description</h4>
+<p>
+This function returns the color map \"RedGreen.\" A color map
+is a Real[:,3] array where every row represents a color.
+With the optional argument \"n_colors\" the number of rows
+of the returned array can be defined. The default value is
+\"n_colors=64\" (it is usually best if n_colors is a multiple of 4).
+Image of the \"RedGreen\" color map:
+</p>
+
+<blockquote>
+<img src=\"modelica:modelica://ThermoSysPro/InstrumentationAndControl/Blocks/Sources/colorMap_RedGreen.png\">
+</blockquote>
+
+<h4>See also</h4>
+<a href=\"modelica://Modelica.Mechanics.MultiBody.Visualizers.Colors.ColorMaps\">ColorMaps</a>,
+<a href=\"modelica://Modelica.Mechanics.MultiBody.Visualizers.Colors.colorMapToSvg\">colorMapToSvg</a>,
+<a href=\"modelica://Modelica.Mechanics.MultiBody.Visualizers.Colors.scalarToColor\">scalarToColor</a>.
+</html>"));
+end RedGreen_colorMap;
diff --git a/ThermoSysPro/Functions/Utilities/TableLinearInterpolation_i.mo b/ThermoSysPro/Functions/Utilities/TableLinearInterpolation_i.mo
index 9572e826fb06f126a7021a134a630d3a7e5ff66e..b09a9cc3bd6b2185b590d82925a6dbcb4b4a467f 100644
--- a/ThermoSysPro/Functions/Utilities/TableLinearInterpolation_i.mo
+++ b/ThermoSysPro/Functions/Utilities/TableLinearInterpolation_i.mo
@@ -1,72 +1,72 @@
-within ThermoSysPro.Functions.Utilities;
-function TableLinearInterpolation_i
-  "Table linear interpolation (internal function)"
-  input Real TabP[:] "1st reference table";
-  input Real TabX[:] "2nd reference table";
-  input Real TabY[:, :] "Results table";
-  input Real P "1st reference value";
-  input Real X "2nd reference value";
-
-  output Real Y "Interpolated result";
-  output Real DeltaYX "Y step wrt. X";
-  output Real DeltaYP "Y step wrt. P";
-
-protected
-  Integer dimP=size(TabP, 1) "TabP dimension";
-  Integer dimX=size(TabX, 1) "TabX dimension";
-  Integer dimY1=size(TabY, 1) "TabY 1st dimension";
-  Integer dimY2=size(TabY, 2) "TabY 2nd dimension";
-  Integer IndP=0 "Reference index";
-  Boolean IndPcal "Computed index";
-  Real Y1;
-  Real DeltaYX1;
-  Real Y2;
-  Real DeltaYX2;
-
-algorithm
-  if ((dimX <> dimY2) or (dimP <> dimY1)) then
-    assert(false, "TableLinearInterpolation: the dimensions of the tables are different");
-  end if;
-
-  IndPcal := false;
-
-  for i in 2:dimP - 1 loop
-    if ((P <= TabP[i]) and (not IndPcal)) then
-      IndP := i;
-      IndPcal := true;
-    end if;
-  end for;
-
-  if (not IndPcal) then
-    IndP := dimP;
-  end if;
-
-  (Y1,DeltaYX1) := ThermoSysPro.Functions.Utilities.LinearInterpolation_i(
-    TabX,
-    TabY[IndP - 1, :],
-    X);
-  (Y2,DeltaYX2) := ThermoSysPro.Functions.Utilities.LinearInterpolation_i(
-    TabX,
-    TabY[IndP, :],
-    X);
-
-  DeltaYP := (Y2 - Y1)/(TabP[IndP] - TabP[IndP - 1]);
-  DeltaYX := DeltaYX1 + (P - TabP[IndP - 1])*(DeltaYX2 - DeltaYX1)/(TabP[IndP] - TabP[IndP - 1]);
-
-  Y := Y1 + (P - TabP[IndP - 1])*DeltaYP;
-
-  annotation (
-    smoothOrder=2,
-    Icon(graphics),        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 3.0</b></p>
-</HTML>
-",        revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end TableLinearInterpolation_i;
+within ThermoSysPro.Functions.Utilities;
+function TableLinearInterpolation_i
+  "Table linear interpolation (internal function)"
+  input Real TabP[:] "1st reference table";
+  input Real TabX[:] "2nd reference table";
+  input Real TabY[:, :] "Results table";
+  input Real P "1st reference value";
+  input Real X "2nd reference value";
+
+  output Real Y "Interpolated result";
+  output Real DeltaYX "Y step wrt. X";
+  output Real DeltaYP "Y step wrt. P";
+
+protected
+  Integer dimP=size(TabP, 1) "TabP dimension";
+  Integer dimX=size(TabX, 1) "TabX dimension";
+  Integer dimY1=size(TabY, 1) "TabY 1st dimension";
+  Integer dimY2=size(TabY, 2) "TabY 2nd dimension";
+  Integer IndP=0 "Reference index";
+  Boolean IndPcal "Computed index";
+  Real Y1;
+  Real DeltaYX1;
+  Real Y2;
+  Real DeltaYX2;
+
+algorithm
+  if ((dimX <> dimY2) or (dimP <> dimY1)) then
+    assert(false, "TableLinearInterpolation: the dimensions of the tables are different");
+  end if;
+
+  IndPcal := false;
+
+  for i in 2:dimP - 1 loop
+    if ((P <= TabP[i]) and (not IndPcal)) then
+      IndP := i;
+      IndPcal := true;
+    end if;
+  end for;
+
+  if (not IndPcal) then
+    IndP := dimP;
+  end if;
+
+  (Y1,DeltaYX1) := ThermoSysPro.Functions.Utilities.LinearInterpolation_i(
+    TabX,
+    TabY[IndP - 1, :],
+    X);
+  (Y2,DeltaYX2) := ThermoSysPro.Functions.Utilities.LinearInterpolation_i(
+    TabX,
+    TabY[IndP, :],
+    X);
+
+  DeltaYP := (Y2 - Y1)/(TabP[IndP] - TabP[IndP - 1]);
+  DeltaYX := DeltaYX1 + (P - TabP[IndP - 1])*(DeltaYX2 - DeltaYX1)/(TabP[IndP] - TabP[IndP - 1]);
+
+  Y := Y1 + (P - TabP[IndP - 1])*DeltaYP;
+
+  annotation (
+    smoothOrder=2,
+    Icon(graphics),        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 3.0</b></p>
+</HTML>
+",        revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end TableLinearInterpolation_i;
diff --git a/ThermoSysPro/Functions/Utilities/package.mo b/ThermoSysPro/Functions/Utilities/package.mo
index 1dbff50dab0dba6a986058ed41cfc2ef35261284..3d8946a8cc32cc594beaf5175a40eff6d8494b9d 100644
--- a/ThermoSysPro/Functions/Utilities/package.mo
+++ b/ThermoSysPro/Functions/Utilities/package.mo
@@ -1,122 +1,121 @@
-within ThermoSysPro.Functions;
-package Utilities
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Utilities;
+within ThermoSysPro.Functions;
+package Utilities
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Utilities;
diff --git a/ThermoSysPro/Functions/Utilities/package.order b/ThermoSysPro/Functions/Utilities/package.order
index 1b4cae5ad83df3d24cbe60f2a61525686e6aeac0..c15d054224f57b16d3ecba805a955441072ab2fe 100644
--- a/ThermoSysPro/Functions/Utilities/package.order
+++ b/ThermoSysPro/Functions/Utilities/package.order
@@ -1,3 +1,5 @@
-CubicHermite
-LinearInterpolation_i
-TableLinearInterpolation_i
+CubicHermite
+LinearInterpolation_i
+TableLinearInterpolation_i
+scalarToColor_validityRange
+RedGreen_colorMap
diff --git a/ThermoSysPro/Functions/Utilities/scalarToColor_validityRange.mo b/ThermoSysPro/Functions/Utilities/scalarToColor_validityRange.mo
new file mode 100644
index 0000000000000000000000000000000000000000..5307635d6c2f6f569d9e0637ec9dfaf450a89ca3
--- /dev/null
+++ b/ThermoSysPro/Functions/Utilities/scalarToColor_validityRange.mo
@@ -0,0 +1,53 @@
+within ThermoSysPro.Functions.Utilities;
+function scalarToColor_validityRange
+  "Map a scalar to a color using a color map. colorMap used between T_min and T_nominal. Reversed colorMap is used between T_nominal and T_max"
+  extends Modelica.Icons.Function;
+
+input Real T "Scalar value" annotation(Dialog);
+input Real T_nominal "Nominal value, if T<Tnominal is mapped with colorMap, T>T_nominal is mapped with reversed colorMap" annotation(Dialog);
+input Real T_min "T <= T_min is mapped to colorMap[1,:]" annotation(Dialog);
+input Real T_max "T >= T_max is mapped to colorMap[end,:]" annotation(Dialog);
+input Real colorMap[:,3] "Color map" annotation(Dialog);
+output Real color[3] "Color of scalar value T";
+
+protected
+Real eps=max(abs(T_min),abs(T_max));
+
+algorithm
+  /*Had to add 1e-7 and not Modelica.Constants.eps because otherwise a pulse would appear at the time where T=T_min or T_max (in the case where a ramp for T finishes at T_min or T_max*/
+  color := noEvent(
+  if (T < T_min-eps*1e-10 or T > T_max+eps*1e-10) then
+      {138, 43, 226}
+    elseif T_nominal == T_max then
+      colorMap[1 + integer((size(colorMap, 1) - 1) * (max(T_min, min(T, T_nominal)) - T_min) / (T_nominal - T_min)), :]
+    elseif T_nominal == T_min then
+      colorMap[1 + integer((size(colorMap, 1) - 1) * (1 - (max(T_nominal, min(T, T_max)) - T_nominal) / (T_max - T_nominal))), :]
+    elseif T < T_nominal then
+      colorMap[1 + integer((size(colorMap, 1) - 1) * (max(T_min, min(T, T_nominal)) - T_min) / (T_nominal - T_min)), :]
+    elseif T >= T_nominal then
+      colorMap[1 + integer((size(colorMap, 1) - 1) * (1 - (max(T_nominal, min(T, T_max)) - T_nominal) / (T_max - T_nominal))), :]
+    else
+      {100, 100, 100});
+  //     if (T < T_min-1e-8 or T > T_max+1e-8) then
+
+  annotation(Inline=true, Documentation(info="<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+//Real T, T_min, T_max, colorMap[:,3];
+Colors.<strong>scalarToColor</strong>(T, T_min, T_max, colorMap);
+</pre></blockquote>
+<h4>Description</h4>
+<p>
+This function returns an rgb color Real[3] that corresponds to the value of \"T\".
+The color is selected from the colorMap by interpolation so that
+\"T_min\" corresponds to \"colorMap[1,:]\" and
+\"T_max\" corresponds to \"colorMap[end,:]\".
+</p>
+
+<h4>See also</h4>
+<a href=\"modelica://Modelica.Mechanics.MultiBody.Visualizers.Colors.ColorMaps\">ColorMaps</a>,
+<a href=\"modelica://Modelica.Mechanics.MultiBody.Visualizers.Colors.colorMapToSvg\">colorMapToSvg</a>,
+<a href=\"modelica://Modelica.Mechanics.MultiBody.Visualizers.PipeWithScalarField\">PipeWithScalarField</a>.
+
+</html>"));
+end scalarToColor_validityRange;
diff --git a/ThermoSysPro/Functions/package.mo b/ThermoSysPro/Functions/package.mo
index b00bfe380b9771a6833cffe8b98798e4c7b13ce3..0d579b9271625054c4e77e80b163632d44a9150a 100644
--- a/ThermoSysPro/Functions/package.mo
+++ b/ThermoSysPro/Functions/package.mo
@@ -1,139 +1,139 @@
-within ThermoSysPro;
-package Functions "General purpose functions"
-
-
-
-  annotation (
-    Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-    Window(
-      x=0.05,
-      y=0.26,
-      width=0.25,
-      height=0.25,
-      library=1,
-      autolayout=1),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"));
-end Functions;
+within ThermoSysPro;
+package Functions "General purpose functions"
+
+
+
+  annotation (
+    Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+    Window(
+      x=0.05,
+      y=0.26,
+      width=0.25,
+      height=0.25,
+      library=1,
+      autolayout=1),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"));
+end Functions;
diff --git a/ThermoSysPro/Functions/package.order b/ThermoSysPro/Functions/package.order
index 3feb9ae3b64b1abebb6c55901feb032b761739df..fdbde98fa10b5c970793089a32cf9d312dcd72fc 100644
--- a/ThermoSysPro/Functions/package.order
+++ b/ThermoSysPro/Functions/package.order
@@ -1,13 +1,13 @@
-ThermoRoot
-ThermoSquare
-LinearInterpolation
-TableLinearInterpolation
-SmoothStep
-SmoothSign
-SmoothAbs
-SmoothMax
-SmoothMin
-SmoothCond
-SplineInterpolation
-TableSplineInterpolation
-Utilities
+ThermoRoot
+ThermoSquare
+LinearInterpolation
+TableLinearInterpolation
+SmoothStep
+SmoothSign
+SmoothAbs
+SmoothMax
+SmoothMin
+SmoothCond
+SplineInterpolation
+TableSplineInterpolation
+Utilities
diff --git a/ThermoSysPro/HeatNetworksCooling/AbsorberWaterLiBr.mo b/ThermoSysPro/HeatNetworksCooling/AbsorberWaterLiBr.mo
index bb641944f10c78d2edf77937266a4f35a650c2e5..ef528053900e682297c6d27092817f676f1ab973 100644
--- a/ThermoSysPro/HeatNetworksCooling/AbsorberWaterLiBr.mo
+++ b/ThermoSysPro/HeatNetworksCooling/AbsorberWaterLiBr.mo
@@ -1,141 +1,141 @@
-within ThermoSysPro.HeatNetworksCooling;
-model AbsorberWaterLiBr
-  "Absorption of H2O into a H2O LiBr solution, and exchange with cold water"
-  parameter Real DPf=0
-    "Pressure losses in the cold fluid a a percent of the pressure at the inlet";
-
-public
-  Units.SI.Power W(start=1e6) "Power exchanged";
-  Real DPc(start=10)
-    "Pressure losses in the hot fluid a a percent of the pressure at the inlet";
-
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Ef "Cold fluid inlet"
-                          annotation (Placement(transformation(extent={{-84,-72},
-            {-64,-52}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Sf "Cold fluid outlet"
-                          annotation (Placement(transformation(extent={{-82,50},
-            {-62,70}}, rotation=0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ec
-    "Water solution inlet"
-    annotation (Placement(transformation(extent={{64,50},{84,70}}, rotation=0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Sc
-    "Water solution outlet"
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provap
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Evap
-                          annotation (Placement(transformation(extent={{-10,80},
-            {10,100}}, rotation=0)));
-equation
-
-  Sf.Q = Ef.Q;
-
-  /* Flow reversal */
-  0 = if (Ef.Q > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
-  0 = Evap.h - Evap.h_vol;
-
-  /* Mass balance equation for the hot fluid */
-  Sc.Q = Ec.Q + Evap.Q;
-
-  /* Pressure losses in the cold fluid */
-  Sf.P = if (Ef.Q > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ec.P/100;
-
-  /* Pressure losses in the hot fluid */
-  Sc.P = Ec.P - DPc*Ec.P/100;
-  Evap.P = Sc.P;
-
-  /* Energy balance equation for the cold fluid */
-  Sf.h = Ef.h + W/Ef.Q;
-
-  /* Energy balance equation for the hot fluid */
-  W = Ec.Q*ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Ec.T, Ec.Xh2o)
-      - Sc.Q*ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Sc.T, Ec.Xh2o)
-      + Evap.Q*Evap.h;
-
-  /* Solution temperature at the outlet */
-  Sc.Xh2o = ThermoSysPro.Properties.WaterSolution.MassFraction_eq_PT(Sc.P, Sc.T);
-
-  /* H2O mass fraction at the outlet */
-  Sc.Xh2o = (Evap.Q + Ec.Xh2o*Ec.Q)/Sc.Q;
-
-  /* Water/steam properties */
-  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, 0);
-  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, 0);
-  provap = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Evap.P, Evap.h, 0);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-74,80},{-64,90},{64,90},{74,80},{74,-80},{64,-90},{-64,-90},
-              {-74,-80},{-74,80}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{74,-10},{74,-80},{64,-90},{-64,-90},{-74,-80},{-74,-10},{-26,
-              -10},{-4,66},{64,66},{64,54},{8,54},{26,-10},{74,-10}},
-          lineColor={0,0,0},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-64,60},{0,60},{0,-16},{0,-62},{-64,-62}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-14,78},{0,68},{14,78}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-74,80},{-64,90},{64,90},{74,80},{74,-80},{64,-90},{-64,-90},
-              {-74,-80},{-74,80}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{74,-10},{74,-80},{64,-90},{-64,-90},{-74,-80},{-74,-10},{-26,
-              -10},{-4,66},{64,66},{64,54},{8,54},{26,-10},{74,-10}},
-          lineColor={0,0,0},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-64,60},{0,60},{0,-16},{0,-62},{-64,-62}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-14,78},{0,68},{14,78}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-end AbsorberWaterLiBr;
+within ThermoSysPro.HeatNetworksCooling;
+model AbsorberWaterLiBr
+  "Absorption of H2O into a H2O LiBr solution, and exchange with cold water"
+  parameter Real DPf=0
+    "Pressure losses in the cold fluid a a percent of the pressure at the inlet";
+
+public
+  Units.SI.Power W(start=1e6) "Power exchanged";
+  Real DPc(start=10)
+    "Pressure losses in the hot fluid a a percent of the pressure at the inlet";
+
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Ef "Cold fluid inlet"
+                          annotation (Placement(transformation(extent={{-84,-72},
+            {-64,-52}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Sf "Cold fluid outlet"
+                          annotation (Placement(transformation(extent={{-82,50},
+            {-62,70}}, rotation=0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ec
+    "Water solution inlet"
+    annotation (Placement(transformation(extent={{64,50},{84,70}}, rotation=0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Sc
+    "Water solution outlet"
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provap
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Evap
+                          annotation (Placement(transformation(extent={{-10,80},
+            {10,100}}, rotation=0)));
+equation
+
+  Sf.Q = Ef.Q;
+
+  /* Flow reversal */
+  0 = if (Ef.Q > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
+  0 = Evap.h - Evap.h_vol;
+
+  /* Mass balance equation for the hot fluid */
+  Sc.Q = Ec.Q + Evap.Q;
+
+  /* Pressure losses in the cold fluid */
+  Sf.P = if (Ef.Q > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ec.P/100;
+
+  /* Pressure losses in the hot fluid */
+  Sc.P = Ec.P - DPc*Ec.P/100;
+  Evap.P = Sc.P;
+
+  /* Energy balance equation for the cold fluid */
+  Sf.h = Ef.h + W/Ef.Q;
+
+  /* Energy balance equation for the hot fluid */
+  W = Ec.Q*ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Ec.T, Ec.Xh2o)
+      - Sc.Q*ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Sc.T, Ec.Xh2o)
+      + Evap.Q*Evap.h;
+
+  /* Solution temperature at the outlet */
+  Sc.Xh2o = ThermoSysPro.Properties.WaterSolution.MassFraction_eq_PT(Sc.P, Sc.T);
+
+  /* H2O mass fraction at the outlet */
+  Sc.Xh2o = (Evap.Q + Ec.Xh2o*Ec.Q)/Sc.Q;
+
+  /* Water/steam properties */
+  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, 0);
+  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, 0);
+  provap = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Evap.P, Evap.h, 0);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-74,80},{-64,90},{64,90},{74,80},{74,-80},{64,-90},{-64,-90},
+              {-74,-80},{-74,80}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{74,-10},{74,-80},{64,-90},{-64,-90},{-74,-80},{-74,-10},{-26,
+              -10},{-4,66},{64,66},{64,54},{8,54},{26,-10},{74,-10}},
+          lineColor={0,0,0},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-64,60},{0,60},{0,-16},{0,-62},{-64,-62}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-14,78},{0,68},{14,78}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-74,80},{-64,90},{64,90},{74,80},{74,-80},{64,-90},{-64,-90},
+              {-74,-80},{-74,80}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{74,-10},{74,-80},{64,-90},{-64,-90},{-74,-80},{-74,-10},{-26,
+              -10},{-4,66},{64,66},{64,54},{8,54},{26,-10},{74,-10}},
+          lineColor={0,0,0},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-64,60},{0,60},{0,-16},{0,-62},{-64,-62}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-14,78},{0,68},{14,78}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+end AbsorberWaterLiBr;
diff --git a/ThermoSysPro/HeatNetworksCooling/AbsorptionRefrigeratorSystem.mo b/ThermoSysPro/HeatNetworksCooling/AbsorptionRefrigeratorSystem.mo
index db2d5c3e4bcaad6d0c65aa077bb0663c8ff72e9d..e249b3c21c6b3e330952bdcbf8b05d2424fcf60c 100644
--- a/ThermoSysPro/HeatNetworksCooling/AbsorptionRefrigeratorSystem.mo
+++ b/ThermoSysPro/HeatNetworksCooling/AbsorptionRefrigeratorSystem.mo
@@ -1,317 +1,317 @@
-within ThermoSysPro.HeatNetworksCooling;
-model AbsorptionRefrigeratorSystem "Refrigeration system by absorption"
-
-  parameter Real DesEff=0.362979 "Desorber efficiency";
-  parameter Real Pth=0.33 "Desorber thermal losses (0-1 %W)";
-  parameter Real ExchEff=0.99 "Exchanger water LiBr efficiency";
-  parameter Real EvapEff=0.99 "Evaporator efficiency";
-  parameter Units.SI.MassFlowRate Qsol=8.856 "Solution mass flow rate";
-  parameter Units.SI.MassFlowRate Qnom=8.856
-    "Pump solution nominal mass flow rate";
-  parameter ThermoSysPro.Units.SI.PressureDifference DPnom=3386.05
-    "Pump solution nominal delta pressure";
-
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
-    annotation (Placement(transformation(extent={{-200,160},{-180,180}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
-    annotation (Placement(transformation(extent={{-200,40},{-180,60}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI ColdNeedOutlet
-    annotation (Placement(transformation(extent={{10,-180},{30,-160}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI ColdNeedInlet
-    annotation (Placement(transformation(extent={{130,-180},{150,-160}},
-          rotation=0)));
-  DesorberWaterLiBr desorber(
-    W(fixed=false, start=4.16e6),
-    DPc=0.2,
-    DTm(fixed=false, start=9.648),
-    Pth=Pth,
-    Ec(h(start=432e3, fixed=false)),
-    Eff=DesEff)
-              annotation (Placement(transformation(extent={{-100,20},{-80,40}},
-          rotation=0)));
-  ThermoSysPro.WaterSolution.HeatExchangers.ExchangerEfficiency
-    solutionHeatExchanger(
-    Ef(P(fixed=false, start=900)),
-    Qf(fixed=false, start=13),
-    Tsf(fixed=false, start=343.15),
-    DPc=0.2,
-    DPf=0.2,
-    Hsf(fixed=false, start=102586),
-    Xf(fixed=false, start=0.5633),
-    Eff=ExchEff)
-    annotation (Placement(transformation(
-        origin={-70,-30},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSolution.PressureLosses.SingularPressureLoss solutionExp(C2(
-       P(fixed=false, start=870)), K=10)
-    annotation (Placement(transformation(
-        origin={-110,-50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  WaterSolution.Machines.StaticCentrifugalPumpNom solutionPump(Qnom=Qnom, DPnom=
-       DPnom)
-    annotation (Placement(transformation(
-        origin={-30,-70},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ ambientSource(
-    P0=1e5,
-    Q0=313,
-    h0=100e3) annotation (Placement(transformation(extent={{60,-140},{40,-120}},
-          rotation=0)));
-  AbsorberWaterLiBr absorber(
-    DPf=0.2,
-    Sc(T(fixed=false, start=290.98)),
-    DPc(fixed=false, start=0.2))
-    annotation (Placement(transformation(extent={{0,-120},{-20,-100}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink ambientSink
-    annotation (Placement(transformation(
-        origin={30,90},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss waterExp(K=2749.77)
-                                   annotation (Placement(transformation(extent=
-            {{20,120},{40,140}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
-    evaporator(EffEch=EvapEff)
-    annotation (Placement(transformation(
-        origin={70,-10},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.WaterSolution.LoopBreakers.LoopBreakerQ loopBreakerQ
-    annotation (Placement(transformation(
-        origin={-30,-30},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  WaterSolution.BoundaryConditions.RefQ solutionMassFlowRate
-    annotation (Placement(transformation(
-        origin={-30,0},
-        extent={{-10,10},{10,-10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
-    solutionMassFlowRateValue(k=Qsol)
-                      annotation (Placement(transformation(extent={{6,-6},{-6,6}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.SimpleStaticCondenser condensor
-    annotation (Placement(transformation(
-        origin={30,50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-equation
-  connect(desorber.Sf, solutionHeatExchanger.Ec)
-                                         annotation (Line(points={{-89.8,21},{
-          -89.8,-24},{-76,-24},{-76,-24.2}}, color={0,0,0}));
-  connect(solutionHeatExchanger.Sf, desorber.Ef)
-                                         annotation (Line(points={{-69.8,-40},{
-          -70,-40},{-70,-60},{-50,-60},{-50,36},{-82.6,36}}, color={0,0,0}));
-  connect(ambientSource.C, absorber.Ef)      annotation (Line(points={{40,-130},
-          {6.4,-130},{6.4,-116.2},{-2.6,-116.2}}, color={0,0,255}));
-  connect(solutionExp.C2, absorber.Ec)         annotation (Line(points={{-110,
-          -59},{-110,-104},{-17.4,-104}}, color={0,0,0}));
-  connect(solutionPump.Ce, absorber.Sc)    annotation (Line(points={{-30,-79},{
-          -30,-130},{-10,-130},{-10,-119}}, color={0,0,0}));
-  connect(waterExp.C2, evaporator.Ef)       annotation (Line(points={{40,130},{
-          70,130},{70,0}}, color={0,0,255}));
-  connect(evaporator.Sf, absorber.Evap)   annotation (Line(points={{70.1,-20},{
-          70.1,-44},{-10,-44},{-10,-101}}, color={0,0,255}));
-  connect(desorber.Svap, condensor.Ec)   annotation (Line(points={{-90,39.05},{
-          -90,44},{20,44}}, color={0,0,255}));
-  connect(condensor.Sc, waterExp.C1)       annotation (Line(points={{20,56},{
-          -10,56},{-10,130},{20,130}}, color={0,0,255}));
-  connect(ambientSink.C, condensor.Sf)
-    annotation (Line(points={{30,80},{30,60},{29.9,60}}));
-  connect(condensor.Ef, absorber.Sf)
-    annotation (Line(points={{30,40},{30,-104},{-2.8,-104}}));
-  connect(outletWaterSteamI, desorber.Sc)  annotation (Line(points={{-190,170},
-          {-106,170},{-106,36},{-97.2,36}}, color={255,0,0}));
-  connect(inletWaterSteamI, desorber.Ec)  annotation (Line(points={{-190,50},{
-          -110,50},{-110,23.8},{-97.4,23.8}}));
-  connect(evaporator.Ec, ColdNeedInlet)
-    annotation (Line(points={{74.1,-6},{160,-6},{160,-170},{140,-170}}));
-  connect(ColdNeedOutlet, evaporator.Sc)  annotation (Line(points={{20,-170},{
-          100,-170},{100,-14},{74.1,-14}}, color={255,0,0}));
-  connect(solutionHeatExchanger.Ef, solutionMassFlowRate.C2)
-                                           annotation (Line(points={{-69.8,-20},
-          {-70,-20},{-70,20},{-30,20},{-30,10}}, color={0,0,0}));
-  connect(solutionMassFlowRate.C1, loopBreakerQ.Cs)
-                                                 annotation (Line(points={{-30,
-          -10},{-30,-20}}, color={0,0,0}));
-  connect(solutionExp.C1, solutionHeatExchanger.Sc) annotation (Line(points={{
-          -110,-41},{-110,-35.8},{-76,-35.8}}, color={0,0,0}));
-  connect(loopBreakerQ.Ce, solutionPump.Cs) annotation (Line(points={{-30,-40},
-          {-30,-50},{-35,-50},{-35,-61}}, color={0,0,0}));
-  connect(solutionMassFlowRate.IMassFlow, solutionMassFlowRateValue.y)
-    annotation (Line(points={{-19,6.73556e-016},{-12.5,6.73556e-016},{-12.5,0},
-          {-6.6,0}}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-22,-94},{4,-98}},
-          lineColor={0,0,255},
-          textString=
-               "Absorber"),
-        Text(
-          extent={{14,-48},{84,-54}},
-          lineColor={0,0,255},
-          textString=
-               "Water at ambient temperature"),
-        Text(
-          extent={{-44,52},{10,46}},
-          lineColor={0,0,255},
-          textString=
-               "Water outlet (ambient)"),
-        Text(
-          extent={{-100,50},{-74,46}},
-          lineColor={0,0,255},
-          textString=
-               "Desorber"),
-        Text(
-          extent={{-122,-4},{-92,-8}},
-          lineColor={0,0,255},
-          textString=
-               "Heat source"),
-        Text(
-          extent={{-140,-24},{-82,-36}},
-          lineColor={0,0,255},
-          textString=
-               "Solution heat exchanger"),
-        Text(
-          extent={{-130,-60},{-86,-74}},
-          lineColor={0,0,255},
-          textString=
-               "Solution expansion"),
-        Text(
-          extent={{-62,-82},{-24,-90}},
-          lineColor={0,0,255},
-          textString=
-               "Solution pump"),
-        Text(
-          extent={{-2,34},{20,30}},
-          lineColor={0,0,255},
-          textString=
-               "Condensor"),
-        Text(
-          extent={{46,8},{72,4}},
-          lineColor={0,0,255},
-          textString=
-               "Evaporator"),
-        Text(
-          extent={{46,-24},{76,-28}},
-          lineColor={0,0,255},
-          textString=
-               "Cold supply"),
-        Text(
-          extent={{16,126},{58,114}},
-          lineColor={0,0,255},
-          textString=
-               "Water expansion")}),
-                          Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-200,200},{200,-200}},
-          lineColor={0,127,0},
-          pattern=LinePattern.Dash,
-          lineThickness=0.5),
-        Polygon(
-          points={{-180,190},{-170,200},{-42,200},{-32,190},{-32,30},{-42,20},{
-              -170,20},{-180,30},{-180,190}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-32,100},{-32,30},{-42,20},{-170,20},{-180,30},{-180,100},{
-              -132,100},{-110,176},{-42,176},{-42,164},{-98,164},{-80,100},{-32,
-              100}},
-          lineColor={0,0,0},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-180,170},{-106,170},{-106,94},{-106,48},{-180,48}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-118,178},{-106,188},{-92,178}},
-          color={0,0,255},
-          thickness=0.5),
-        Polygon(
-          points={{-180,-10},{-170,0},{-42,0},{-32,-10},{-32,-170},{-42,-180},{
-              -170,-180},{-180,-170},{-180,-10}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-32,-100},{-32,-170},{-42,-180},{-170,-180},{-180,-170},{
-              -180,-100},{-132,-100},{-110,-24},{-42,-24},{-42,-36},{-98,-36},{
-              -80,-100},{-32,-100}},
-          lineColor={0,0,0},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-170,-30},{-106,-30},{-106,-106},{-106,-152},{-170,-152}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-120,-12},{-106,-22},{-92,-12}},
-          color={0,0,255},
-          thickness=0.5),
-        Rectangle(
-          extent={{0,140},{160,40}},
-          lineColor={0,0,255},
-          fillColor={213,255,170},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{24,50},{24,128},{82,84},{140,132},{140,50}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{46,82},{114,40}},
-          lineColor={0,0,0},
-          textString=
-               "Cond"),
-        Rectangle(
-          extent={{0,-40},{160,-160}},
-          lineColor={0,0,255},
-          fillColor={72,143,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{20,-160},{20,-82},{80,-128},{140,-78},{140,-160}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{38,-46},{120,-104}},
-          lineColor={0,0,255},
-          textString=
-               "Evap"),
-        Text(
-          extent={{-104,68},{-34,22}},
-          lineColor={0,0,255},
-          textString=
-               "Des"),
-        Text(
-          extent={{-102,-130},{-32,-176}},
-          lineColor={0,0,255},
-          textString=
-               "Abs")}),
-    DymolaStoredErrors,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-end AbsorptionRefrigeratorSystem;
+within ThermoSysPro.HeatNetworksCooling;
+model AbsorptionRefrigeratorSystem "Refrigeration system by absorption"
+
+  parameter Real DesEff=0.362979 "Desorber efficiency";
+  parameter Real Pth=0.33 "Desorber thermal losses (0-1 %W)";
+  parameter Real ExchEff=0.99 "Exchanger water LiBr efficiency";
+  parameter Real EvapEff=0.99 "Evaporator efficiency";
+  parameter Units.SI.MassFlowRate Qsol=8.856 "Solution mass flow rate";
+  parameter Units.SI.MassFlowRate Qnom=8.856
+    "Pump solution nominal mass flow rate";
+  parameter ThermoSysPro.Units.SI.PressureDifference DPnom=3386.05
+    "Pump solution nominal delta pressure";
+
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
+    annotation (Placement(transformation(extent={{-200,160},{-180,180}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
+    annotation (Placement(transformation(extent={{-200,40},{-180,60}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI ColdNeedOutlet
+    annotation (Placement(transformation(extent={{10,-180},{30,-160}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI ColdNeedInlet
+    annotation (Placement(transformation(extent={{130,-180},{150,-160}},
+          rotation=0)));
+  DesorberWaterLiBr desorber(
+    W(fixed=false, start=4.16e6),
+    DPc=0.2,
+    DTm(fixed=false, start=9.648),
+    Pth=Pth,
+    Ec(h(start=432e3, fixed=false)),
+    Eff=DesEff)
+              annotation (Placement(transformation(extent={{-100,20},{-80,40}},
+          rotation=0)));
+  ThermoSysPro.WaterSolution.HeatExchangers.ExchangerEfficiency
+    solutionHeatExchanger(
+    Ef(P(fixed=false, start=900)),
+    Qf(fixed=false, start=13),
+    Tsf(fixed=false, start=343.15),
+    DPc=0.2,
+    DPf=0.2,
+    Hsf(fixed=false, start=102586),
+    Xf(fixed=false, start=0.5633),
+    Eff=ExchEff)
+    annotation (Placement(transformation(
+        origin={-70,-30},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSolution.PressureLosses.SingularPressureLoss solutionExp(C2(
+       P(fixed=false, start=870)), K=10)
+    annotation (Placement(transformation(
+        origin={-110,-50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  WaterSolution.Machines.StaticCentrifugalPumpNom solutionPump(Qnom=Qnom, DPnom=
+       DPnom)
+    annotation (Placement(transformation(
+        origin={-30,-70},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ ambientSource(
+    P0=1e5,
+    Q0=313,
+    h0=100e3) annotation (Placement(transformation(extent={{60,-140},{40,-120}},
+          rotation=0)));
+  AbsorberWaterLiBr absorber(
+    DPf=0.2,
+    Sc(T(fixed=false, start=290.98)),
+    DPc(fixed=false, start=0.2))
+    annotation (Placement(transformation(extent={{0,-120},{-20,-100}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink ambientSink
+    annotation (Placement(transformation(
+        origin={30,90},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss waterExp(K=2749.77)
+                                   annotation (Placement(transformation(extent=
+            {{20,120},{40,140}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
+    evaporator(EffEch=EvapEff)
+    annotation (Placement(transformation(
+        origin={70,-10},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.WaterSolution.LoopBreakers.LoopBreakerQ loopBreakerQ
+    annotation (Placement(transformation(
+        origin={-30,-30},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  WaterSolution.BoundaryConditions.RefQ solutionMassFlowRate
+    annotation (Placement(transformation(
+        origin={-30,0},
+        extent={{-10,10},{10,-10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante
+    solutionMassFlowRateValue(k=Qsol)
+                      annotation (Placement(transformation(extent={{6,-6},{-6,6}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.SimpleStaticCondenser condensor
+    annotation (Placement(transformation(
+        origin={30,50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+equation
+  connect(desorber.Sf, solutionHeatExchanger.Ec)
+                                         annotation (Line(points={{-89.8,21},{
+          -89.8,-24},{-76,-24},{-76,-24.2}}, color={0,0,0}));
+  connect(solutionHeatExchanger.Sf, desorber.Ef)
+                                         annotation (Line(points={{-69.8,-40},{
+          -70,-40},{-70,-60},{-50,-60},{-50,36},{-82.6,36}}, color={0,0,0}));
+  connect(ambientSource.C, absorber.Ef)      annotation (Line(points={{40,-130},
+          {6.4,-130},{6.4,-116.2},{-2.6,-116.2}}, color={0,0,255}));
+  connect(solutionExp.C2, absorber.Ec)         annotation (Line(points={{-110,
+          -59},{-110,-104},{-17.4,-104}}, color={0,0,0}));
+  connect(solutionPump.Ce, absorber.Sc)    annotation (Line(points={{-30,-79},{
+          -30,-130},{-10,-130},{-10,-119}}, color={0,0,0}));
+  connect(waterExp.C2, evaporator.Ef)       annotation (Line(points={{40,130},{
+          70,130},{70,0}}, color={0,0,255}));
+  connect(evaporator.Sf, absorber.Evap)   annotation (Line(points={{70.1,-20},{
+          70.1,-44},{-10,-44},{-10,-101}}, color={0,0,255}));
+  connect(desorber.Svap, condensor.Ec)   annotation (Line(points={{-90,39.05},{
+          -90,44},{20,44}}, color={0,0,255}));
+  connect(condensor.Sc, waterExp.C1)       annotation (Line(points={{20,56},{
+          -10,56},{-10,130},{20,130}}, color={0,0,255}));
+  connect(ambientSink.C, condensor.Sf)
+    annotation (Line(points={{30,80},{30,60},{29.9,60}}));
+  connect(condensor.Ef, absorber.Sf)
+    annotation (Line(points={{30,40},{30,-104},{-2.8,-104}}));
+  connect(outletWaterSteamI, desorber.Sc)  annotation (Line(points={{-190,170},
+          {-106,170},{-106,36},{-97.2,36}}, color={255,0,0}));
+  connect(inletWaterSteamI, desorber.Ec)  annotation (Line(points={{-190,50},{
+          -110,50},{-110,23.8},{-97.4,23.8}}));
+  connect(evaporator.Ec, ColdNeedInlet)
+    annotation (Line(points={{74.1,-6},{160,-6},{160,-170},{140,-170}}));
+  connect(ColdNeedOutlet, evaporator.Sc)  annotation (Line(points={{20,-170},{
+          100,-170},{100,-14},{74.1,-14}}, color={255,0,0}));
+  connect(solutionHeatExchanger.Ef, solutionMassFlowRate.C2)
+                                           annotation (Line(points={{-69.8,-20},
+          {-70,-20},{-70,20},{-30,20},{-30,10}}, color={0,0,0}));
+  connect(solutionMassFlowRate.C1, loopBreakerQ.Cs)
+                                                 annotation (Line(points={{-30,
+          -10},{-30,-20}}, color={0,0,0}));
+  connect(solutionExp.C1, solutionHeatExchanger.Sc) annotation (Line(points={{
+          -110,-41},{-110,-35.8},{-76,-35.8}}, color={0,0,0}));
+  connect(loopBreakerQ.Ce, solutionPump.Cs) annotation (Line(points={{-30,-40},
+          {-30,-50},{-35,-50},{-35,-61}}, color={0,0,0}));
+  connect(solutionMassFlowRate.IMassFlow, solutionMassFlowRateValue.y)
+    annotation (Line(points={{-19,6.73556e-016},{-12.5,6.73556e-016},{-12.5,0},
+          {-6.6,0}}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-22,-94},{4,-98}},
+          lineColor={0,0,255},
+          textString=
+               "Absorber"),
+        Text(
+          extent={{14,-48},{84,-54}},
+          lineColor={0,0,255},
+          textString=
+               "Water at ambient temperature"),
+        Text(
+          extent={{-44,52},{10,46}},
+          lineColor={0,0,255},
+          textString=
+               "Water outlet (ambient)"),
+        Text(
+          extent={{-100,50},{-74,46}},
+          lineColor={0,0,255},
+          textString=
+               "Desorber"),
+        Text(
+          extent={{-122,-4},{-92,-8}},
+          lineColor={0,0,255},
+          textString=
+               "Heat source"),
+        Text(
+          extent={{-140,-24},{-82,-36}},
+          lineColor={0,0,255},
+          textString=
+               "Solution heat exchanger"),
+        Text(
+          extent={{-130,-60},{-86,-74}},
+          lineColor={0,0,255},
+          textString=
+               "Solution expansion"),
+        Text(
+          extent={{-62,-82},{-24,-90}},
+          lineColor={0,0,255},
+          textString=
+               "Solution pump"),
+        Text(
+          extent={{-2,34},{20,30}},
+          lineColor={0,0,255},
+          textString=
+               "Condensor"),
+        Text(
+          extent={{46,8},{72,4}},
+          lineColor={0,0,255},
+          textString=
+               "Evaporator"),
+        Text(
+          extent={{46,-24},{76,-28}},
+          lineColor={0,0,255},
+          textString=
+               "Cold supply"),
+        Text(
+          extent={{16,126},{58,114}},
+          lineColor={0,0,255},
+          textString=
+               "Water expansion")}),
+                          Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-200,200},{200,-200}},
+          lineColor={0,127,0},
+          pattern=LinePattern.Dash,
+          lineThickness=0.5),
+        Polygon(
+          points={{-180,190},{-170,200},{-42,200},{-32,190},{-32,30},{-42,20},{
+              -170,20},{-180,30},{-180,190}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-32,100},{-32,30},{-42,20},{-170,20},{-180,30},{-180,100},{
+              -132,100},{-110,176},{-42,176},{-42,164},{-98,164},{-80,100},{-32,
+              100}},
+          lineColor={0,0,0},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-180,170},{-106,170},{-106,94},{-106,48},{-180,48}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-118,178},{-106,188},{-92,178}},
+          color={0,0,255},
+          thickness=0.5),
+        Polygon(
+          points={{-180,-10},{-170,0},{-42,0},{-32,-10},{-32,-170},{-42,-180},{
+              -170,-180},{-180,-170},{-180,-10}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-32,-100},{-32,-170},{-42,-180},{-170,-180},{-180,-170},{
+              -180,-100},{-132,-100},{-110,-24},{-42,-24},{-42,-36},{-98,-36},{
+              -80,-100},{-32,-100}},
+          lineColor={0,0,0},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-170,-30},{-106,-30},{-106,-106},{-106,-152},{-170,-152}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-120,-12},{-106,-22},{-92,-12}},
+          color={0,0,255},
+          thickness=0.5),
+        Rectangle(
+          extent={{0,140},{160,40}},
+          lineColor={0,0,255},
+          fillColor={213,255,170},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{24,50},{24,128},{82,84},{140,132},{140,50}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{46,82},{114,40}},
+          lineColor={0,0,0},
+          textString=
+               "Cond"),
+        Rectangle(
+          extent={{0,-40},{160,-160}},
+          lineColor={0,0,255},
+          fillColor={72,143,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{20,-160},{20,-82},{80,-128},{140,-78},{140,-160}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{38,-46},{120,-104}},
+          lineColor={0,0,255},
+          textString=
+               "Evap"),
+        Text(
+          extent={{-104,68},{-34,22}},
+          lineColor={0,0,255},
+          textString=
+               "Des"),
+        Text(
+          extent={{-102,-130},{-32,-176}},
+          lineColor={0,0,255},
+          textString=
+               "Abs")}),
+    DymolaStoredErrors,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+end AbsorptionRefrigeratorSystem;
diff --git a/ThermoSysPro/HeatNetworksCooling/DesorberWaterLiBr.mo b/ThermoSysPro/HeatNetworksCooling/DesorberWaterLiBr.mo
index b811446888971d1c18a9306d53af767ee5873f77..34d55da94c09b1d75cf91c9c49a7ef15bf110ea1 100644
--- a/ThermoSysPro/HeatNetworksCooling/DesorberWaterLiBr.mo
+++ b/ThermoSysPro/HeatNetworksCooling/DesorberWaterLiBr.mo
@@ -1,180 +1,180 @@
-within ThermoSysPro.HeatNetworksCooling;
-model DesorberWaterLiBr "Water LiBr solution desorber with water heating"
-  parameter Real Eff=0.65 "Thermal exchange efficiency (=W/Wmax)";
-  parameter ThermoSysPro.Units.SI.PressureDifference DPc=0
-    "Pressure losses in the hot fluid a a percent of the pressure at the inlet";
-  parameter Real Pth=0.15 "Thermal losses fraction (=losses/W)";
-
-public
-  Units.SI.Power W(start=1e6) "Power exchnaged with the solution";
-  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
-  Units.SI.Power Wtot(start=1e6) "Hot water total power";
-  Units.SI.Power Wmaxf(start=1e6) "Maximum power acceptable by the solution";
-  Units.SI.Power Wmaxc(start=1e6) "Maximum power releasable by the hot water";
-  Units.SI.Temperature Tsatc(start=400)
-    "Hot water saturation temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hminc(start=1e5)
-    "Minimum specific enthalpy reachable by the hot water";
-  Real Xmin "Minimum mass fraction reachable by the solution";
-  Units.SI.MassFlowRate Qs_min(start=100)
-    "Minimum solution mass flow rate at the outlet";
-  Units.SI.MassFlowRate Qv_max(start=100)
-    "Maximum steam mass flow rate at the outlet";
-  Units.SI.Power Wmax(start=1e6) "Maximum power exchangeable";
-  ThermoSysPro.Units.SI.TemperatureDifference DTm(start=40)
-    "Differences of the average temperatures between the hot and cold sides";
-
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Ec
-                          annotation (Placement(transformation(extent={{-84,-72},
-            {-64,-52}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Svap
-                          annotation (Placement(transformation(extent={{-10,80},
-            {10,101}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Sc
-                          annotation (Placement(transformation(extent={{-82,50},
-            {-62,70}}, rotation=0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ef
-    annotation (Placement(transformation(extent={{64,50},{84,70}}, rotation=0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Sf
-    annotation (Placement(transformation(extent={{-8,-100},{12,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provap
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-equation
-
-  // Hypothesis : counter-current exchange
-
-  Sc.Q = Ec.Q;
-  Ef.P = Sf.P;
-  Svap.P = Sf.P;
-
-  /* Flow reversal */
-  0 = if (Ec.Q > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
-
-  /* Maximum power exchangeable on the hot side */
-  Tsatc = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Sc.P);
-
-  if (Tsatc > Ef.T) then
-      Hminc = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Sc.P, Ef.T, 0);
-  elseif (Tsatc < Ef.T) then
-      Hminc = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Sc.P, Ef.T, 0);
-  else
-      Hminc = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Sc.P, Ef.T, 1);
-  end if;
-
-  Wmaxc = Ec.Q*(Ec.h - Hminc);
-
-  /* Maximum power exchangeable on the solution side */
-  Xmin = ThermoSysPro.Properties.WaterSolution.MassFraction_eq_PT(Sf.P, proce.T);
-  Qs_min = Ef.Q*(1 - Ef.Xh2o)/(1 - Xmin);
-  Qv_max = Ef.Q*(1 - (1-Ef.Xh2o)/(1 - Xmin));
-  Wmaxf = Ef.Q*ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Ef.T, Ef.Xh2o)
-          - Qs_min * ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(proce.T, Xmin) + Qv_max*Svap.h;
-
-  /* Power exchanged */
-  Wmax = min(Wmaxf, Wmaxc);
-  W = Eff*Wmax;
-  Wpth = W*Pth;
-  Wtot = W + Wpth;
-
-  /* Water/steam properties */
-  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, 0);
-  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, 0);
-  provap = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Svap.P, Svap.h, 0);
-
-  /* Mass flow rate in the hot side : mass balance and LiBr balance */
-  Sf.Q = Ef.Q*(1 - Ef.Xh2o)/(1 - Sf.Xh2o);
-  Svap.Q = Ef.Q*(1 - (1-Ef.Xh2o)/(1 - Sf.Xh2o));
-
-  /* Pressure losses in the hot side */
-  Sc.P = if (Ec.Q > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
-
-  /* Fluid properties at the outlet */
-  Svap.h = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Svap.P, Sf.T,2);
-  Sf.Xh2o = ThermoSysPro.Properties.WaterSolution.MassFraction_eq_PT(Sf.P, Sf.T);
-
-  /* Energy balance in the hot side */
-  Sc.h = Ec.h - Wtot/Ec.Q;
-
-  /* Energy balance in the solution side */
-  W = Ef.Q*ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Ef.T, Ef.Xh2o)
-      - Sf.Q * ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Sf.T, Sf.Xh2o)
-      + Svap.Q*Svap.h;
-
-  /* Difference between the average temperatures */
-  DTm = (proce.T - procs.T) - (Sf.T - Ef.T);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-74,80},{-64,90},{64,90},{74,80},{74,-80},{64,-90},{-64,-90},
-              {-74,-80},{-74,80}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{74,-10},{74,-80},{64,-90},{-64,-90},{-74,-80},{-74,-10},{-26,
-              -10},{-4,66},{64,66},{64,54},{8,54},{26,-10},{74,-10}},
-          lineColor={0,0,0},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-64,60},{0,60},{0,-16},{0,-62},{-64,-62}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-12,68},{0,78},{14,68}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-74,80},{-64,90},{64,90},{74,80},{74,-80},{64,-90},{-64,-90},
-              {-74,-80},{-74,80}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{74,-10},{74,-80},{64,-90},{-64,-90},{-74,-80},{-74,-10},{-26,
-              -10},{-4,66},{64,66},{64,54},{8,54},{26,-10},{74,-10}},
-          lineColor={0,0,0},
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-64,60},{0,60},{0,-16},{0,-62},{-64,-62}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-12,68},{0,78},{14,68}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-end DesorberWaterLiBr;
+within ThermoSysPro.HeatNetworksCooling;
+model DesorberWaterLiBr "Water LiBr solution desorber with water heating"
+  parameter Real Eff=0.65 "Thermal exchange efficiency (=W/Wmax)";
+  parameter ThermoSysPro.Units.SI.PressureDifference DPc=0
+    "Pressure losses in the hot fluid a a percent of the pressure at the inlet";
+  parameter Real Pth=0.15 "Thermal losses fraction (=losses/W)";
+
+public
+  Units.SI.Power W(start=1e6) "Power exchnaged with the solution";
+  Units.SI.Power Wpth(start=1e6) "Thermal losses power";
+  Units.SI.Power Wtot(start=1e6) "Hot water total power";
+  Units.SI.Power Wmaxf(start=1e6) "Maximum power acceptable by the solution";
+  Units.SI.Power Wmaxc(start=1e6) "Maximum power releasable by the hot water";
+  Units.SI.Temperature Tsatc(start=400)
+    "Hot water saturation temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hminc(start=1e5)
+    "Minimum specific enthalpy reachable by the hot water";
+  Real Xmin "Minimum mass fraction reachable by the solution";
+  Units.SI.MassFlowRate Qs_min(start=100)
+    "Minimum solution mass flow rate at the outlet";
+  Units.SI.MassFlowRate Qv_max(start=100)
+    "Maximum steam mass flow rate at the outlet";
+  Units.SI.Power Wmax(start=1e6) "Maximum power exchangeable";
+  ThermoSysPro.Units.SI.TemperatureDifference DTm(start=40)
+    "Differences of the average temperatures between the hot and cold sides";
+
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Ec
+                          annotation (Placement(transformation(extent={{-84,-72},
+            {-64,-52}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Svap
+                          annotation (Placement(transformation(extent={{-10,80},
+            {10,101}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Sc
+                          annotation (Placement(transformation(extent={{-82,50},
+            {-62,70}}, rotation=0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ef
+    annotation (Placement(transformation(extent={{64,50},{84,70}}, rotation=0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Sf
+    annotation (Placement(transformation(extent={{-8,-100},{12,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provap
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+equation
+
+  // Hypothesis : counter-current exchange
+
+  Sc.Q = Ec.Q;
+  Ef.P = Sf.P;
+  Svap.P = Sf.P;
+
+  /* Flow reversal */
+  0 = if (Ec.Q > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
+
+  /* Maximum power exchangeable on the hot side */
+  Tsatc = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Sc.P);
+
+  if (Tsatc > Ef.T) then
+      Hminc = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Sc.P, Ef.T, 0);
+  elseif (Tsatc < Ef.T) then
+      Hminc = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Sc.P, Ef.T, 0);
+  else
+      Hminc = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Sc.P, Ef.T, 1);
+  end if;
+
+  Wmaxc = Ec.Q*(Ec.h - Hminc);
+
+  /* Maximum power exchangeable on the solution side */
+  Xmin = ThermoSysPro.Properties.WaterSolution.MassFraction_eq_PT(Sf.P, proce.T);
+  Qs_min = Ef.Q*(1 - Ef.Xh2o)/(1 - Xmin);
+  Qv_max = Ef.Q*(1 - (1-Ef.Xh2o)/(1 - Xmin));
+  Wmaxf = Ef.Q*ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Ef.T, Ef.Xh2o)
+          - Qs_min * ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(proce.T, Xmin) + Qv_max*Svap.h;
+
+  /* Power exchanged */
+  Wmax = min(Wmaxf, Wmaxc);
+  W = Eff*Wmax;
+  Wpth = W*Pth;
+  Wtot = W + Wpth;
+
+  /* Water/steam properties */
+  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, 0);
+  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, 0);
+  provap = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Svap.P, Svap.h, 0);
+
+  /* Mass flow rate in the hot side : mass balance and LiBr balance */
+  Sf.Q = Ef.Q*(1 - Ef.Xh2o)/(1 - Sf.Xh2o);
+  Svap.Q = Ef.Q*(1 - (1-Ef.Xh2o)/(1 - Sf.Xh2o));
+
+  /* Pressure losses in the hot side */
+  Sc.P = if (Ec.Q > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
+
+  /* Fluid properties at the outlet */
+  Svap.h = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Svap.P, Sf.T,2);
+  Sf.Xh2o = ThermoSysPro.Properties.WaterSolution.MassFraction_eq_PT(Sf.P, Sf.T);
+
+  /* Energy balance in the hot side */
+  Sc.h = Ec.h - Wtot/Ec.Q;
+
+  /* Energy balance in the solution side */
+  W = Ef.Q*ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Ef.T, Ef.Xh2o)
+      - Sf.Q * ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Sf.T, Sf.Xh2o)
+      + Svap.Q*Svap.h;
+
+  /* Difference between the average temperatures */
+  DTm = (proce.T - procs.T) - (Sf.T - Ef.T);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-74,80},{-64,90},{64,90},{74,80},{74,-80},{64,-90},{-64,-90},
+              {-74,-80},{-74,80}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{74,-10},{74,-80},{64,-90},{-64,-90},{-74,-80},{-74,-10},{-26,
+              -10},{-4,66},{64,66},{64,54},{8,54},{26,-10},{74,-10}},
+          lineColor={0,0,0},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-64,60},{0,60},{0,-16},{0,-62},{-64,-62}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-12,68},{0,78},{14,68}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-74,80},{-64,90},{64,90},{74,80},{74,-80},{64,-90},{-64,-90},
+              {-74,-80},{-74,80}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{74,-10},{74,-80},{64,-90},{-64,-90},{-74,-80},{-74,-10},{-26,
+              -10},{-4,66},{64,66},{64,54},{8,54},{26,-10},{74,-10}},
+          lineColor={0,0,0},
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-64,60},{0,60},{0,-16},{0,-62},{-64,-62}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-12,68},{0,78},{14,68}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+end DesorberWaterLiBr;
diff --git a/ThermoSysPro/HeatNetworksCooling/HeatNetworkPipe.mo b/ThermoSysPro/HeatNetworksCooling/HeatNetworkPipe.mo
index ab840c5ee71fb23530fb3e44966f2cf6e94eba01..525830ac1159f666a8e308ad5091e56f3a545032 100644
--- a/ThermoSysPro/HeatNetworksCooling/HeatNetworkPipe.mo
+++ b/ThermoSysPro/HeatNetworksCooling/HeatNetworkPipe.mo
@@ -1,143 +1,143 @@
-within ThermoSysPro.HeatNetworksCooling;
-model HeatNetworkPipe
-  "Static pipe with thermal losses and singular pressure losses"
-  parameter Units.SI.Length L=10 "Pipe length";
-  parameter Units.SI.Diameter D=0.2 "Pipe internal diameter";
-  parameter Units.SI.Length e=0.05 "Wall thickness";
-  parameter Real rugosrel=0 "Pipe roughness";
-  parameter Units.SI.Length z1=0 "Pipe altitude at the inlet";
-  parameter Units.SI.Length z2=0 "Pipe altitude at the outlet";
-  parameter Units.SI.Temperature Tamb=293 "Ambient temperature";
-  parameter Units.SI.CoefficientOfHeatTransfer K=0.1
-    "Heat exchange coefficient with ambient";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ks=1000
-    "Singular pressure losses coefficient";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Units.SI.Power Wloss "Thermal losses at ambient conditions";
-  Real khi "Hydraulic pressure loss coefficient";
-  ThermoSysPro.Units.SI.PressureDifference deltaPr "Regular pressure losses";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure losses";
-  ThermoSysPro.Units.SI.PressureDifference deltaPs
-    "Singular pressure losses";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.ReynoldsNumber Re "Reynolds number";
-  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
-  Real lambda "Friction pressure loss coefficient";
-  Units.SI.Density rho "Fluid density";
-  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy hm "Fluid average specific enthalpy";
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-90,80},
-            {-70,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{70,80},
-            {90,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-10,60},{10,80}}, rotation=0)));
-equation
-
-  C1.h = C2.h + Wloss/Q;
-  C1.Q = C2.Q;
-  C1.P - C2.P = deltaP;
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Thermal losses */
-  Wloss = pi*(D + 2*e)*L*K*(T - Tamb);
-
-  /* Pressure losses */
-  deltaP = deltaPr + deltaPs + rho*g*(z2 - z1);
-  deltaPs = 8*Ks * ThermoSysPro.Functions.ThermoSquare(
-                                                      Q, eps)/(pi^2*D^4*rho^2);
-  deltaPr = 8*khi*ThermoSysPro.Functions.ThermoSquare(
-                                                     Q, eps)/(pi^2*D^4*rho);
-
-  /* Darcy-Weisbach formula (Idel'cik p. 55). Quadratic flow regime is assumed and Re > 4000 (Re > Relim). */
-  khi = lambda*L/D;
-
-  if (rugosrel > 0.00005) then
-    lambda = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
-  else
-    lambda = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else 0;
-  end if;
-
-  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 4000;
-
-  Re = 4*abs(Q)/(pi*D*mu);
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-  hm = (C1.h + C2.h)/2;
-
-  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pm, hm, mode);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  mu = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T);
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{60,80},{100,80},{100,-100},{-100,-100},{-100,80},{-60,80},{
-              -60,-60},{60,-60},{60,80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{60,80},{100,80},{100,-100},{-100,-100},{-100,80},{-60,80},{
-              -60,-60},{60,-60},{60,80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-end HeatNetworkPipe;
+within ThermoSysPro.HeatNetworksCooling;
+model HeatNetworkPipe
+  "Static pipe with thermal losses and singular pressure losses"
+  parameter Units.SI.Length L=10 "Pipe length";
+  parameter Units.SI.Diameter D=0.2 "Pipe internal diameter";
+  parameter Units.SI.Length e=0.05 "Wall thickness";
+  parameter Real rugosrel=0 "Pipe roughness";
+  parameter Units.SI.Length z1=0 "Pipe altitude at the inlet";
+  parameter Units.SI.Length z2=0 "Pipe altitude at the outlet";
+  parameter Units.SI.Temperature Tamb=293 "Ambient temperature";
+  parameter Units.SI.CoefficientOfHeatTransfer K=0.1
+    "Heat exchange coefficient with ambient";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ks=1000
+    "Singular pressure losses coefficient";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Units.SI.Power Wloss "Thermal losses at ambient conditions";
+  Real khi "Hydraulic pressure loss coefficient";
+  ThermoSysPro.Units.SI.PressureDifference deltaPr "Regular pressure losses";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure losses";
+  ThermoSysPro.Units.SI.PressureDifference deltaPs
+    "Singular pressure losses";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.ReynoldsNumber Re "Reynolds number";
+  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
+  Real lambda "Friction pressure loss coefficient";
+  Units.SI.Density rho "Fluid density";
+  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy hm "Fluid average specific enthalpy";
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-90,80},
+            {-70,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{70,80},
+            {90,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-10,60},{10,80}}, rotation=0)));
+equation
+
+  C1.h = C2.h + Wloss/Q;
+  C1.Q = C2.Q;
+  C1.P - C2.P = deltaP;
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Thermal losses */
+  Wloss = pi*(D + 2*e)*L*K*(T - Tamb);
+
+  /* Pressure losses */
+  deltaP = deltaPr + deltaPs + rho*g*(z2 - z1);
+  deltaPs = 8*Ks * ThermoSysPro.Functions.ThermoSquare(
+                                                      Q, eps)/(pi^2*D^4*rho^2);
+  deltaPr = 8*khi*ThermoSysPro.Functions.ThermoSquare(
+                                                     Q, eps)/(pi^2*D^4*rho);
+
+  /* Darcy-Weisbach formula (Idel'cik p. 55). Quadratic flow regime is assumed and Re > 4000 (Re > Relim). */
+  khi = lambda*L/D;
+
+  if (rugosrel > 0.00005) then
+    lambda = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
+  else
+    lambda = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else 0;
+  end if;
+
+  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 4000;
+
+  Re = 4*abs(Q)/(pi*D*mu);
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+  hm = (C1.h + C2.h)/2;
+
+  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pm, hm, mode);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  mu = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T);
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{60,80},{100,80},{100,-100},{-100,-100},{-100,80},{-60,80},{
+              -60,-60},{60,-60},{60,80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{60,80},{100,80},{100,-100},{-100,-100},{-100,80},{-60,80},{
+              -60,-60},{60,-60},{60,80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+end HeatNetworkPipe;
diff --git a/ThermoSysPro/HeatNetworksCooling/LatentHeatStorage.mo b/ThermoSysPro/HeatNetworksCooling/LatentHeatStorage.mo
index c21327c1adb9aa43f5a0f5a57c1c43602857e014..77c7ec503756d38c9f46ec9c5994808ae0e2d505 100644
--- a/ThermoSysPro/HeatNetworksCooling/LatentHeatStorage.mo
+++ b/ThermoSysPro/HeatNetworksCooling/LatentHeatStorage.mo
@@ -1,206 +1,206 @@
-within ThermoSysPro.HeatNetworksCooling;
-model LatentHeatStorage "Latent heat storage"
-  parameter Units.SI.Area S=1 "Exchange surface";
-  parameter Units.SI.Area Samb=1 "Exchange surface with the ambient air";
-  parameter Units.SI.Volume V=1 "Storage volume";
-  parameter Units.SI.SpecificHeatCapacity CpL=4.18
-    "Fluid specific heat capacity";
-  parameter Units.SI.SpecificHeatCapacity CpS=4.18
-    "Storage specific heat capacity";
-  parameter Units.SI.ThermalConductivity Lambda=0.585
-    "PCM (phase change material) thermal conductivity";
-  parameter Units.SI.ThermalConductivity LambdaC=0.585
-    "Insulation thermal conductivity";
-  parameter Units.SI.Length ep=0.1 "PCM thickness";
-  parameter Units.SI.Length epC=0.1 "Insulation thickness";
-  parameter Units.SI.Density rhom=1000 "PCM density";
-  parameter Units.SI.CoefficientOfHeatTransfer h=20
-    "Convective heat exchange coefficient with the water";
-  parameter Units.SI.CoefficientOfHeatTransfer ha=20
-    "Convective heat exchange coefficient with the ambient air";
-  parameter Units.SI.Temperature Tamb "Ambient air temperature";
-  parameter Units.SI.Temperature Tsl0
-    "Initial storage temperature (active if steady_state=false)";
-  parameter Real xL0=0.5 "Initial liquid PCM fraction";
-  parameter Units.SI.Temperature Tfusion=293 "PCM fusion temperature";
-  parameter Units.SI.SpecificEnergy hfus "PCM fusion specific enthalpy";
-  parameter Real Fremp=0.5 "Volume fraction of the storage filled by the PCM";
-  parameter Boolean steady_state=false
-    "true: start from steady state - false: start from Tsl0";
-  parameter Integer mode_e=0
-    "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_s=0
-    "IF97 region at the outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q "Water mass flow rate";
-  Units.SI.Mass m "PCM mass";
-  Units.SI.Temperature Tsl "Storage average temperature";
-  Real xL "Liquid PCM fraction in the storage";
-  Units.SI.Temperature T1 "Water temperature at the inlet";
-  Units.SI.Temperature T2 "Water temperature at the outlet";
-  Units.SI.Power Ws "Stored power";
-  Units.SI.Power We "Power exchanged with the water";
-  Units.SI.Power Wa "Power exchanged with the ambient air";
-  Units.SI.SpecificEnthalpy Hsl "Storage specific enthalpy";
-  Units.SI.SpecificEnthalpy HsatL
-    "Storage specific enthalpy at the liquid saturation temperature";
-  Units.SI.SpecificEnthalpy HsatS
-    "Storage specific enthalpy at the solid saturation temperature";
-  Units.SI.Temperature Tm(start=293) "Water average temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Water average pressure";
-  Units.SI.SpecificEnthalpy hm(start=100000) "Water average specific enthalpy";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Ce
-                                     annotation (Placement(transformation(
-          extent={{-100,20},{-80,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cs
-                                     annotation (Placement(transformation(
-          extent={{80,-40},{100,-20}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(Hsl) = 0;
-  else
-    if (Tsl0 < Tfusion) then
-      Hsl = CpS*(Tsl0 - 273);
-    elseif (Tsl0 > Tfusion) then
-      Hsl = CpS*(Tfusion - 273) + hfus + CpL * (Tsl0 - Tfusion);
-    else
-      Hsl = CpS*(Tfusion - 273) + hfus*xL0;
-    end if;
-  end if;
-
-equation
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.b = true;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h = 1.e5;
-    Cs.a = true;
-  end if;
-
-  Ce.P = Cs.P;
-  Ce.Q = Cs.Q;
-
-  Q = Ce.Q;
-
-  /* Flow reversal */
-  0 = noEvent(if (Q > Qeps) then Ce.h - Ce.h_vol else if (Q < -Qeps) then
-      Cs.h - Cs.h_vol else Ce.h - 0.5*((Ce.h_vol - Cs.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + Ce.h_vol + Cs.h_vol));
-
-  /* Water average specific enthalpy */
-  Pm = Ce.P;
-  if (abs(Q) < Qeps) then
-    Tm = T2;
-  else
-    Tm = (T1 + T2)/2;
-  end if;
-
-  hm = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Pm, Tm, 0);
-
-  /* Water temperature at the inlet and at the outlet */
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ce.P, Ce.h, mode_e);
-  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cs.P, Cs.h, mode_s);
-  T1 = proe.T;
-  T2 = pros.T;
-
-  /* Liquid and solid specific enthalpies at the saturation point */
-  HsatL = CpS*(Tfusion - 273) + hfus;
-  HsatS = CpS*(Tfusion - 273);
-
-  /* Storage differential equation */
-  Ws = m*der(Hsl);
-  Ws = We + Wa;
-
-  /* PCM (phase change material) fraction */
-  if (Hsl < HsatS) then
-    xL = 0;
-    Tsl = 273 + Hsl/CpS;
-  elseif (Hsl > HsatL) then
-    xL = 1;
-    Tsl = Tfusion + (Hsl - HsatL)/CpL;
-  else
-    xL = (Hsl - HsatS)/(HsatL - HsatS);
-    Tsl = Tfusion;
-  end if;
-
-  /* Power exchanged with the water */
-  if (abs(Q) < Qeps) then
-    We = 0;
-    Tm = Tsl;
-  else
-    We = Q*(Ce.h - Cs.h);
-    Tm = Tsl + We*(ep/Lambda + 1/h)/S;
-  end if;
-
-  /* Power exchanged with ambient air */
-  Wa = 1/(epC/LambdaC + 1/ha)*Samb*(Tamb - Tsl);
-
-  /* PCM mass */
-  m = rhom*V*Fremp;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-80,50},{-40,100},{40,100},{80,52},{80,-50},{40,-100},{-40,
-              -100},{-80,-48},{-80,50}},
-          lineColor={0,0,0},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "L")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-80,50},{-40,100},{40,100},{80,52},{80,-50},{40,-100},{-40,
-              -100},{-80,-48},{-80,50}},
-          lineColor={0,0,0},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          textString=
-               "L")}),
-    Window(
-      x=0.16,
-      y=0.03,
-      width=0.81,
-      height=0.9),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-end LatentHeatStorage;
+within ThermoSysPro.HeatNetworksCooling;
+model LatentHeatStorage "Latent heat storage"
+  parameter Units.SI.Area S=1 "Exchange surface";
+  parameter Units.SI.Area Samb=1 "Exchange surface with the ambient air";
+  parameter Units.SI.Volume V=1 "Storage volume";
+  parameter Units.SI.SpecificHeatCapacity CpL=4.18
+    "Fluid specific heat capacity";
+  parameter Units.SI.SpecificHeatCapacity CpS=4.18
+    "Storage specific heat capacity";
+  parameter Units.SI.ThermalConductivity Lambda=0.585
+    "PCM (phase change material) thermal conductivity";
+  parameter Units.SI.ThermalConductivity LambdaC=0.585
+    "Insulation thermal conductivity";
+  parameter Units.SI.Length ep=0.1 "PCM thickness";
+  parameter Units.SI.Length epC=0.1 "Insulation thickness";
+  parameter Units.SI.Density rhom=1000 "PCM density";
+  parameter Units.SI.CoefficientOfHeatTransfer h=20
+    "Convective heat exchange coefficient with the water";
+  parameter Units.SI.CoefficientOfHeatTransfer ha=20
+    "Convective heat exchange coefficient with the ambient air";
+  parameter Units.SI.Temperature Tamb "Ambient air temperature";
+  parameter Units.SI.Temperature Tsl0
+    "Initial storage temperature (active if steady_state=false)";
+  parameter Real xL0=0.5 "Initial liquid PCM fraction";
+  parameter Units.SI.Temperature Tfusion=293 "PCM fusion temperature";
+  parameter Units.SI.SpecificEnergy hfus "PCM fusion specific enthalpy";
+  parameter Real Fremp=0.5 "Volume fraction of the storage filled by the PCM";
+  parameter Boolean steady_state=false
+    "true: start from steady state - false: start from Tsl0";
+  parameter Integer mode_e=0
+    "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_s=0
+    "IF97 region at the outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q "Water mass flow rate";
+  Units.SI.Mass m "PCM mass";
+  Units.SI.Temperature Tsl "Storage average temperature";
+  Real xL "Liquid PCM fraction in the storage";
+  Units.SI.Temperature T1 "Water temperature at the inlet";
+  Units.SI.Temperature T2 "Water temperature at the outlet";
+  Units.SI.Power Ws "Stored power";
+  Units.SI.Power We "Power exchanged with the water";
+  Units.SI.Power Wa "Power exchanged with the ambient air";
+  Units.SI.SpecificEnthalpy Hsl "Storage specific enthalpy";
+  Units.SI.SpecificEnthalpy HsatL
+    "Storage specific enthalpy at the liquid saturation temperature";
+  Units.SI.SpecificEnthalpy HsatS
+    "Storage specific enthalpy at the solid saturation temperature";
+  Units.SI.Temperature Tm(start=293) "Water average temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Water average pressure";
+  Units.SI.SpecificEnthalpy hm(start=100000) "Water average specific enthalpy";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Ce
+                                     annotation (Placement(transformation(
+          extent={{-100,20},{-80,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cs
+                                     annotation (Placement(transformation(
+          extent={{80,-40},{100,-20}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+initial equation
+  if steady_state then
+    der(Hsl) = 0;
+  else
+    if (Tsl0 < Tfusion) then
+      Hsl = CpS*(Tsl0 - 273);
+    elseif (Tsl0 > Tfusion) then
+      Hsl = CpS*(Tfusion - 273) + hfus + CpL * (Tsl0 - Tfusion);
+    else
+      Hsl = CpS*(Tfusion - 273) + hfus*xL0;
+    end if;
+  end if;
+
+equation
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.b = true;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h = 1.e5;
+    Cs.a = true;
+  end if;
+
+  Ce.P = Cs.P;
+  Ce.Q = Cs.Q;
+
+  Q = Ce.Q;
+
+  /* Flow reversal */
+  0 = noEvent(if (Q > Qeps) then Ce.h - Ce.h_vol else if (Q < -Qeps) then
+      Cs.h - Cs.h_vol else Ce.h - 0.5*((Ce.h_vol - Cs.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + Ce.h_vol + Cs.h_vol));
+
+  /* Water average specific enthalpy */
+  Pm = Ce.P;
+  if (abs(Q) < Qeps) then
+    Tm = T2;
+  else
+    Tm = (T1 + T2)/2;
+  end if;
+
+  hm = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Pm, Tm, 0);
+
+  /* Water temperature at the inlet and at the outlet */
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ce.P, Ce.h, mode_e);
+  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cs.P, Cs.h, mode_s);
+  T1 = proe.T;
+  T2 = pros.T;
+
+  /* Liquid and solid specific enthalpies at the saturation point */
+  HsatL = CpS*(Tfusion - 273) + hfus;
+  HsatS = CpS*(Tfusion - 273);
+
+  /* Storage differential equation */
+  Ws = m*der(Hsl);
+  Ws = We + Wa;
+
+  /* PCM (phase change material) fraction */
+  if (Hsl < HsatS) then
+    xL = 0;
+    Tsl = 273 + Hsl/CpS;
+  elseif (Hsl > HsatL) then
+    xL = 1;
+    Tsl = Tfusion + (Hsl - HsatL)/CpL;
+  else
+    xL = (Hsl - HsatS)/(HsatL - HsatS);
+    Tsl = Tfusion;
+  end if;
+
+  /* Power exchanged with the water */
+  if (abs(Q) < Qeps) then
+    We = 0;
+    Tm = Tsl;
+  else
+    We = Q*(Ce.h - Cs.h);
+    Tm = Tsl + We*(ep/Lambda + 1/h)/S;
+  end if;
+
+  /* Power exchanged with ambient air */
+  Wa = 1/(epC/LambdaC + 1/ha)*Samb*(Tamb - Tsl);
+
+  /* PCM mass */
+  m = rhom*V*Fremp;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-80,50},{-40,100},{40,100},{80,52},{80,-50},{40,-100},{-40,
+              -100},{-80,-48},{-80,50}},
+          lineColor={0,0,0},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "L")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-80,50},{-40,100},{40,100},{80,52},{80,-50},{40,-100},{-40,
+              -100},{-80,-48},{-80,50}},
+          lineColor={0,0,0},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          textString=
+               "L")}),
+    Window(
+      x=0.16,
+      y=0.03,
+      width=0.81,
+      height=0.9),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+end LatentHeatStorage;
diff --git a/ThermoSysPro/HeatNetworksCooling/SensibleHeatStorage.mo b/ThermoSysPro/HeatNetworksCooling/SensibleHeatStorage.mo
index f36a4de34bddd16c4106f8c16567a019dd3eb9d9..63b5ca7c446302b546ef33412400fc83f21e9a74 100644
--- a/ThermoSysPro/HeatNetworksCooling/SensibleHeatStorage.mo
+++ b/ThermoSysPro/HeatNetworksCooling/SensibleHeatStorage.mo
@@ -1,153 +1,153 @@
-within ThermoSysPro.HeatNetworksCooling;
-model SensibleHeatStorage "Sensible heat storage"
-  parameter Units.SI.Area S=1
-    "Exchange surface between the water and the surface";
-  parameter Units.SI.Area Samb=1 "Echange surface with the ambient air";
-  parameter Units.SI.Volume V=1 "Storage volume";
-  parameter Units.SI.SpecificHeatCapacity Cp=4000 "PCM specific heat capacity";
-  parameter Units.SI.ThermalConductivity Lambda=20 "PCM thermal conductivity";
-  parameter Units.SI.ThermalConductivity LambdaC=0.04
-    "Insulation thermal conductivity";
-  parameter Units.SI.Length ep=0.1 "PCM thickness";
-  parameter Units.SI.Length epC=0.1 "Insulation thickness";
-  parameter Units.SI.Density rhom=2000 "PCM density";
-  parameter Units.SI.CoefficientOfHeatTransfer h=20
-    "Convective heat exchange coefficient with the water";
-  parameter Units.SI.CoefficientOfHeatTransfer ha=20
-    "Convective heat exchange coefficient with the ambient air";
-  parameter Units.SI.Temperature Tamb "Ambient air temperature";
-  parameter Units.SI.Temperature Tss0
-    "Initial storage temperature (active if steady_state=false)";
-  parameter Real Fremp=0.5 "Volume fraction of the solid matrix in the storage";
-  parameter Boolean steady_state=false
-    "true: start from steady state - false: start from Tss0";
-  parameter Integer mode_e=0
-    "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_s=0
-    "IF97 region at the outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.MassFlowRate Q "Water mass flow rate";
-  Units.SI.Mass m "PCM mass";
-  Units.SI.Temperature Tss(start=293) "Storage average temperature";
-  Units.SI.Temperature T1 "Water temperature at the inlet";
-  Units.SI.Temperature T2 "Water temperature at the outlet";
-  Units.SI.Power Ws "Stored power";
-  Units.SI.Power We "Power exchanged with the water";
-  Units.SI.Power Wa "Power exchanged with the ambient air";
-  Units.SI.Temperature Tm(start=293) "Average temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Average pressure";
-  Units.SI.SpecificEnthalpy hm(start=100000) "Average specific enthalpy";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Ce
-                                     annotation (Placement(transformation(
-          extent={{-100,20},{-80,40}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cs
-                                     annotation (Placement(transformation(
-          extent={{80,-40},{100,-20}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(Tss) = 0;
-  else
-    Tss = Tss0;
-  end if;
-
-equation
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.b = true;
-  end if;
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h = 1.e5;
-    Cs.a = true;
-  end if;
-
-  Ce.P = Cs.P;
-  Ce.Q = Cs.Q;
-
-  Q = Ce.Q;
-
-  /* Flow reversal */
-  0 = if (Q > 0) then hm - Ce.h_vol else hm - Cs.h_vol;
-
-  /* Water average specific enthalpy */
-  Pm = Ce.P;
-  Tm = (T1 + T2)/2;
-  hm = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Pm, Tm, 0);
-
-  /* Water temperature at the inlet and at the outlet */
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ce.P, Ce.h, mode_e);
-  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cs.P, Cs.h, mode_s);
-
-  T1 = proe.T;
-  T2 = pros.T;
-
-  /* Storage differential equation */
-  Ws = m*Cp*der(Tss);
-  Ws = We + Wa;
-
-  /* Power exchanged with the water */
-  We = 1/(ep/Lambda + 1/h)*S*(Tm - Tss);
-  We = Q*(Ce.h - Cs.h);
-
-  /* Power exchanged with the ambient air */
-  Wa = 1/(epC/LambdaC + 1/ha)*Samb*(Tamb - Tss);
-
-  /* PCM mass */
-  m = rhom*V*Fremp;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-80,50},{-40,100},{40,100},{80,52},{80,-50},{40,-100},{-40,
-              -100},{-80,-48},{-80,50}},
-          lineColor={0,0,0},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          textString=
-               "S")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-80,50},{-40,100},{40,100},{80,52},{80,-50},{40,-100},{-40,
-              -100},{-80,-48},{-80,50}},
-          lineColor={0,0,0},
-          fillColor={120,255,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          textString=
-               "S")}),
-    Window(
-      x=0.16,
-      y=0.03,
-      width=0.81,
-      height=0.9),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-end SensibleHeatStorage;
+within ThermoSysPro.HeatNetworksCooling;
+model SensibleHeatStorage "Sensible heat storage"
+  parameter Units.SI.Area S=1
+    "Exchange surface between the water and the surface";
+  parameter Units.SI.Area Samb=1 "Echange surface with the ambient air";
+  parameter Units.SI.Volume V=1 "Storage volume";
+  parameter Units.SI.SpecificHeatCapacity Cp=4000 "PCM specific heat capacity";
+  parameter Units.SI.ThermalConductivity Lambda=20 "PCM thermal conductivity";
+  parameter Units.SI.ThermalConductivity LambdaC=0.04
+    "Insulation thermal conductivity";
+  parameter Units.SI.Length ep=0.1 "PCM thickness";
+  parameter Units.SI.Length epC=0.1 "Insulation thickness";
+  parameter Units.SI.Density rhom=2000 "PCM density";
+  parameter Units.SI.CoefficientOfHeatTransfer h=20
+    "Convective heat exchange coefficient with the water";
+  parameter Units.SI.CoefficientOfHeatTransfer ha=20
+    "Convective heat exchange coefficient with the ambient air";
+  parameter Units.SI.Temperature Tamb "Ambient air temperature";
+  parameter Units.SI.Temperature Tss0
+    "Initial storage temperature (active if steady_state=false)";
+  parameter Real Fremp=0.5 "Volume fraction of the solid matrix in the storage";
+  parameter Boolean steady_state=false
+    "true: start from steady state - false: start from Tss0";
+  parameter Integer mode_e=0
+    "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_s=0
+    "IF97 region at the outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.MassFlowRate Q "Water mass flow rate";
+  Units.SI.Mass m "PCM mass";
+  Units.SI.Temperature Tss(start=293) "Storage average temperature";
+  Units.SI.Temperature T1 "Water temperature at the inlet";
+  Units.SI.Temperature T2 "Water temperature at the outlet";
+  Units.SI.Power Ws "Stored power";
+  Units.SI.Power We "Power exchanged with the water";
+  Units.SI.Power Wa "Power exchanged with the ambient air";
+  Units.SI.Temperature Tm(start=293) "Average temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Average pressure";
+  Units.SI.SpecificEnthalpy hm(start=100000) "Average specific enthalpy";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Ce
+                                     annotation (Placement(transformation(
+          extent={{-100,20},{-80,40}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cs
+                                     annotation (Placement(transformation(
+          extent={{80,-40},{100,-20}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+initial equation
+  if steady_state then
+    der(Tss) = 0;
+  else
+    Tss = Tss0;
+  end if;
+
+equation
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.b = true;
+  end if;
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h = 1.e5;
+    Cs.a = true;
+  end if;
+
+  Ce.P = Cs.P;
+  Ce.Q = Cs.Q;
+
+  Q = Ce.Q;
+
+  /* Flow reversal */
+  0 = if (Q > 0) then hm - Ce.h_vol else hm - Cs.h_vol;
+
+  /* Water average specific enthalpy */
+  Pm = Ce.P;
+  Tm = (T1 + T2)/2;
+  hm = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Pm, Tm, 0);
+
+  /* Water temperature at the inlet and at the outlet */
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ce.P, Ce.h, mode_e);
+  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cs.P, Cs.h, mode_s);
+
+  T1 = proe.T;
+  T2 = pros.T;
+
+  /* Storage differential equation */
+  Ws = m*Cp*der(Tss);
+  Ws = We + Wa;
+
+  /* Power exchanged with the water */
+  We = 1/(ep/Lambda + 1/h)*S*(Tm - Tss);
+  We = Q*(Ce.h - Cs.h);
+
+  /* Power exchanged with the ambient air */
+  Wa = 1/(epC/LambdaC + 1/ha)*Samb*(Tamb - Tss);
+
+  /* PCM mass */
+  m = rhom*V*Fremp;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-80,50},{-40,100},{40,100},{80,52},{80,-50},{40,-100},{-40,
+              -100},{-80,-48},{-80,50}},
+          lineColor={0,0,0},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          textString=
+               "S")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-80,50},{-40,100},{40,100},{80,52},{80,-50},{40,-100},{-40,
+              -100},{-80,-48},{-80,50}},
+          lineColor={0,0,0},
+          fillColor={120,255,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          textString=
+               "S")}),
+    Window(
+      x=0.16,
+      y=0.03,
+      width=0.81,
+      height=0.9),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+end SensibleHeatStorage;
diff --git a/ThermoSysPro/HeatNetworksCooling/package.mo b/ThermoSysPro/HeatNetworksCooling/package.mo
index 0e843de484149892c213ec893936df5bb9878d85..437d36c5b7344b704e247e9859948610a181aba9 100644
--- a/ThermoSysPro/HeatNetworksCooling/package.mo
+++ b/ThermoSysPro/HeatNetworksCooling/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro;
-package HeatNetworksCooling "Heat network cooling library"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end HeatNetworksCooling;
+within ThermoSysPro;
+package HeatNetworksCooling "Heat network cooling library"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end HeatNetworksCooling;
diff --git a/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/AdaptorModelicaTSP.mo b/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/AdaptorModelicaTSP.mo
index 228cb542cea0d9d43cbafe4fde69becbcfaa7fe5..00308526e9bb29f2441e7e7688c5e29f8a8b920f 100644
--- a/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/AdaptorModelicaTSP.mo
+++ b/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/AdaptorModelicaTSP.mo
@@ -1,38 +1,38 @@
-within ThermoSysPro.InstrumentationAndControl.AdaptorForFMU;
-model AdaptorModelicaTSP "AdaptorModelicaTSP"
-
-  Modelica.Blocks.Interfaces.RealInput u
-    annotation (Placement(transformation(extent={{-140,-20},{-100,20}}),
-        iconTransformation(extent={{-140,-20},{-100,20}})));
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
-    annotation (Placement(transformation(extent={{100,-10},{120,10}})));
-equation
-  outputReal.signal = u;
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-            -100},{100,100}}), graphics={Polygon(
-          points={{-100,100},{0,0},{-100,-100},{-100,100}},
-          lineColor={0,0,255},
-          smooth=Smooth.None,
-          fillColor={0,0,175},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{0,100},{100,0},{0,-100},{0,100}},
-          lineColor={0,0,255},
-          smooth=Smooth.None,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid)}), Diagram(graphics={Polygon(
-          points={{0,100},{100,0},{0,-100},{0,100}},
-          lineColor={0,0,255},
-          smooth=Smooth.None,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-100,100},{0,0},{-100,-100},{-100,100}},
-          lineColor={0,0,255},
-          smooth=Smooth.None,
-          fillColor={0,0,175},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(info="<html>
-<p><b>Version 3.2</b></p>
-</html>
-"));
-end AdaptorModelicaTSP;
+within ThermoSysPro.InstrumentationAndControl.AdaptorForFMU;
+model AdaptorModelicaTSP "AdaptorModelicaTSP"
+
+  Modelica.Blocks.Interfaces.RealInput u
+    annotation (Placement(transformation(extent={{-140,-20},{-100,20}}),
+        iconTransformation(extent={{-140,-20},{-100,20}})));
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
+    annotation (Placement(transformation(extent={{100,-10},{120,10}})));
+equation
+  outputReal.signal = u;
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
+            -100},{100,100}}), graphics={Polygon(
+          points={{-100,100},{0,0},{-100,-100},{-100,100}},
+          lineColor={0,0,255},
+          smooth=Smooth.None,
+          fillColor={0,0,175},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{0,100},{100,0},{0,-100},{0,100}},
+          lineColor={0,0,255},
+          smooth=Smooth.None,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid)}), Diagram(graphics={Polygon(
+          points={{0,100},{100,0},{0,-100},{0,100}},
+          lineColor={0,0,255},
+          smooth=Smooth.None,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-100,100},{0,0},{-100,-100},{-100,100}},
+          lineColor={0,0,255},
+          smooth=Smooth.None,
+          fillColor={0,0,175},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(info="<html>
+<p><b>Version 3.2</b></p>
+</html>
+"));
+end AdaptorModelicaTSP;
diff --git a/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/AdaptorTSPModelica.mo b/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/AdaptorTSPModelica.mo
index a1ce076b2294d76b41b30c1755693879a154cd2c..e8411be284fece83ef93a5aa3989e2919beb288b 100644
--- a/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/AdaptorTSPModelica.mo
+++ b/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/AdaptorTSPModelica.mo
@@ -1,40 +1,40 @@
-within ThermoSysPro.InstrumentationAndControl.AdaptorForFMU;
-model AdaptorTSPModelica "AdaptorTSPModelica"
-
-  Modelica.Blocks.Interfaces.RealOutput y
-    annotation (Placement(transformation(extent={{100,-20},{140,20}}),
-        iconTransformation(extent={{100,-20},{140,20}})));
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal inputReal
-    annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
-equation
-  inputReal.signal =y;
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
-            {100,100}}), graphics={Polygon(
-          points={{0,100},{100,0},{0,-100},{0,100}},
-          lineColor={0,0,255},
-          smooth=Smooth.None,
-          fillColor={0,0,175},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-100,100},{0,0},{-100,-100},{-100,100}},
-          lineColor={0,0,255},
-          smooth=Smooth.None,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem(
-          preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
-                                                    graphics={Polygon(
-          points={{-100,100},{0,0},{-100,-100},{-100,100}},
-          lineColor={0,0,255},
-          smooth=Smooth.None,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{0,100},{100,0},{0,-100},{0,100}},
-          lineColor={0,0,255},
-          smooth=Smooth.None,
-          fillColor={0,0,175},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(info="<html>
-<p><b>Version 3.2</b></p>
-</html>
-"));
-end AdaptorTSPModelica;
+within ThermoSysPro.InstrumentationAndControl.AdaptorForFMU;
+model AdaptorTSPModelica "AdaptorTSPModelica"
+
+  Modelica.Blocks.Interfaces.RealOutput y
+    annotation (Placement(transformation(extent={{100,-20},{140,20}}),
+        iconTransformation(extent={{100,-20},{140,20}})));
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal inputReal
+    annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
+equation
+  inputReal.signal =y;
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
+            {100,100}}), graphics={Polygon(
+          points={{0,100},{100,0},{0,-100},{0,100}},
+          lineColor={0,0,255},
+          smooth=Smooth.None,
+          fillColor={0,0,175},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-100,100},{0,0},{-100,-100},{-100,100}},
+          lineColor={0,0,255},
+          smooth=Smooth.None,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem(
+          preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
+                                                    graphics={Polygon(
+          points={{-100,100},{0,0},{-100,-100},{-100,100}},
+          lineColor={0,0,255},
+          smooth=Smooth.None,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{0,100},{100,0},{0,-100},{0,100}},
+          lineColor={0,0,255},
+          smooth=Smooth.None,
+          fillColor={0,0,175},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(info="<html>
+<p><b>Version 3.2</b></p>
+</html>
+"));
+end AdaptorTSPModelica;
diff --git a/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/package.mo b/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/package.mo
index c27fa9d9d0b02e02906b24e2a5714777ec5098c2..54b24d668c54378666c1592e10d8ec8b03640bd8 100644
--- a/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.InstrumentationAndControl;
-package AdaptorForFMU "AdaptorForFMU"
-annotation (uses(Modelica(version="3.2.2"), ThermoSysPro(version="3.1")), Icon(
-      graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-end AdaptorForFMU;
+within ThermoSysPro.InstrumentationAndControl;
+package AdaptorForFMU "AdaptorForFMU"
+annotation (uses(Modelica(version="3.2.2"), ThermoSysPro(version="3.1")), Icon(
+      graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+end AdaptorForFMU;
diff --git a/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/package.order b/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/package.order
index daf67841ac485077d891f00da1b7f4f79d6bb4ae..bffcbf98876281d72c3027c7d9d8eeffcf06e151 100644
--- a/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/package.order
+++ b/ThermoSysPro/InstrumentationAndControl/AdaptorForFMU/package.order
@@ -1,2 +1,2 @@
-AdaptorModelicaTSP
-AdaptorTSPModelica
+AdaptorModelicaTSP
+AdaptorTSPModelica
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Commun.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Commun.mo
index 3bca14fdbd54da49eea7a530bd69f64da6340a11..418ccb73d012bd15a943f0be86b31716877f20f0 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Commun.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Commun.mo
@@ -1,228 +1,228 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks;
-package Commun
-
-
-  function rand "rand"
-    output Integer y;
-  external "C" y = rand(0);
-    annotation (
-      Window(
-        x=0.45,
-        y=0.01,
-        width=0.35,
-        height=0.49),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Text(
-            extent={{-84,18},{84,-30}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name"),
-          Ellipse(extent={{-100,40},{100,-100}}, lineColor={255,127,0}),
-          Text(
-            extent={{-82,-22},{86,-70}},
-            lineColor={255,127,0},
-            textString=
-                 "externe")}),
-      Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end rand;
-
-  function srand "rand"
-    input Integer u;
-  external "C" srand(u);
-    annotation (
-      Window(
-        x=0.26,
-        y=0.28,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name"),
-          Ellipse(extent={{-100,40},{100,-100}}, lineColor={255,127,0}),
-          Text(
-            extent={{-84,18},{84,-30}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(
-            extent={{-82,-22},{86,-70}},
-            lineColor={255,127,0},
-            textString=
-                 "externe")}),
-      Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end srand;
-
-  function fmod "fmod"
-    input Real u1;
-    input Real u2;
-    output Real y;
-  external "C" y = fmod(u1, u2);
-    annotation (Icon(graphics={
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name"),
-          Ellipse(extent={{-100,40},{100,-100}}, lineColor={255,127,0}),
-          Text(
-            extent={{-84,18},{84,-30}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(
-            extent={{-82,-22},{86,-70}},
-            lineColor={255,127,0},
-            textString=
-                 "externe")}),
-                             Documentation(info="<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-  end fmod;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}),
-    Window(
-      x=0.05,
-      y=0.26,
-      width=0.25,
-      height=0.25,
-      library=1,
-      autolayout=1),
-    Documentation(info="<html>
-<p><b>Version 1.1</b></p>
-</HTML>
-"));
-
-end Commun;
+within ThermoSysPro.InstrumentationAndControl.Blocks;
+package Commun
+
+
+  function rand "rand"
+    output Integer y;
+  external "C" y = rand(0);
+    annotation (
+      Window(
+        x=0.45,
+        y=0.01,
+        width=0.35,
+        height=0.49),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Text(
+            extent={{-84,18},{84,-30}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name"),
+          Ellipse(extent={{-100,40},{100,-100}}, lineColor={255,127,0}),
+          Text(
+            extent={{-82,-22},{86,-70}},
+            lineColor={255,127,0},
+            textString=
+                 "externe")}),
+      Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end rand;
+
+  function srand "rand"
+    input Integer u;
+  external "C" srand(u);
+    annotation (
+      Window(
+        x=0.26,
+        y=0.28,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name"),
+          Ellipse(extent={{-100,40},{100,-100}}, lineColor={255,127,0}),
+          Text(
+            extent={{-84,18},{84,-30}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(
+            extent={{-82,-22},{86,-70}},
+            lineColor={255,127,0},
+            textString=
+                 "externe")}),
+      Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end srand;
+
+  function fmod "fmod"
+    input Real u1;
+    input Real u2;
+    output Real y;
+  external "C" y = fmod(u1, u2);
+    annotation (Icon(graphics={
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name"),
+          Ellipse(extent={{-100,40},{100,-100}}, lineColor={255,127,0}),
+          Text(
+            extent={{-84,18},{84,-30}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(
+            extent={{-82,-22},{86,-70}},
+            lineColor={255,127,0},
+            textString=
+                 "externe")}),
+                             Documentation(info="<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+  end fmod;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}),
+    Window(
+      x=0.05,
+      y=0.26,
+      width=0.25,
+      height=0.25,
+      library=1,
+      autolayout=1),
+    Documentation(info="<html>
+<p><b>Version 1.1</b></p>
+</HTML>
+"));
+
+end Commun;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/FctTrans.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/FctTrans.mo
index fe2042997a2e3ff65b41f4837072744101e2a345..436b15eecacd0086e7870ae929d1c66f4bcf624e 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/FctTrans.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/FctTrans.mo
@@ -1,102 +1,102 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
-block FctTrans
-  parameter Real b[:]={1}
-    "Coefficients numérateurs de la fonction de transfert (par puissances décroissantes)";
-  parameter Real a[:]={1,1}
-    "Coefficients dénominateurs de la fonction de transfert (par puissances décroissantes)";
-  parameter Real U0=0
-    "Valeur de la sortie à l'instant initial (si non permanent et si u0 non connecté)";
-  parameter Boolean permanent=false "Calcul du permanent";
-
-protected
-  parameter Integer na=size(a, 1);
-  parameter Integer nb(max=na) = size(b, 1);
-  parameter Integer nx=na - 1;
-  Real x[nx];
-  Real x1dot;
-  Real xn;
-
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u0
-                                       annotation (Placement(transformation(
-          extent={{-120,-90},{-100,-70}}, rotation=0)));
-initial equation
-  if permanent then
-    der(x) = zeros(nx);
-  elseif (nx > 0) then
-    transpose([zeros(na - nb, 1); b])*[x1dot; x] = [u0.signal];
-  end if;
-
-equation
-  if (cardinality(u0) == 0) then
-    u0.signal = U0;
-  end if;
-
-  [der(x); xn] = [x1dot; x];
-  [u.signal] = transpose([a])*[x1dot; x];
-  [y.signal] = transpose([zeros(na - nb, 1); b])*[x1dot; x];
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{62,0},{102,0}}),
-        Line(points={{-50,0},{50,0}}, color={0,0,0}),
-        Text(
-          extent={{-55,55},{55,5}},
-          lineColor={0,0,0},
-          textString=
-               "b(s)"),
-        Text(
-          extent={{-55,-5},{55,-55}},
-          lineColor={0,0,0},
-          textString=
-               "a(s)")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-90,10},{90,90}}, textString=
-                                            "b(s)"),
-        Line(points={{-80,0},{80,0}}),
-        Text(extent={{-90,-10},{90,-90}}, textString=
-                                              "a(s)")}),
-    Window(
-      x=0.12,
-      y=0.11,
-      width=0.69,
-      height=0.81),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.7</b></p>
-</HTML>
-"));
-end FctTrans;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
+block FctTrans
+  parameter Real b[:]={1}
+    "Coefficients numérateurs de la fonction de transfert (par puissances décroissantes)";
+  parameter Real a[:]={1,1}
+    "Coefficients dénominateurs de la fonction de transfert (par puissances décroissantes)";
+  parameter Real U0=0
+    "Valeur de la sortie à l'instant initial (si non permanent et si u0 non connecté)";
+  parameter Boolean permanent=false "Calcul du permanent";
+
+protected
+  parameter Integer na=size(a, 1);
+  parameter Integer nb(max=na) = size(b, 1);
+  parameter Integer nx=na - 1;
+  Real x[nx];
+  Real x1dot;
+  Real xn;
+
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u0
+                                       annotation (Placement(transformation(
+          extent={{-120,-90},{-100,-70}}, rotation=0)));
+initial equation
+  if permanent then
+    der(x) = zeros(nx);
+  elseif (nx > 0) then
+    transpose([zeros(na - nb, 1); b])*[x1dot; x] = [u0.signal];
+  end if;
+
+equation
+  if (cardinality(u0) == 0) then
+    u0.signal = U0;
+  end if;
+
+  [der(x); xn] = [x1dot; x];
+  [u.signal] = transpose([a])*[x1dot; x];
+  [y.signal] = transpose([zeros(na - nb, 1); b])*[x1dot; x];
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{62,0},{102,0}}),
+        Line(points={{-50,0},{50,0}}, color={0,0,0}),
+        Text(
+          extent={{-55,55},{55,5}},
+          lineColor={0,0,0},
+          textString=
+               "b(s)"),
+        Text(
+          extent={{-55,-5},{55,-55}},
+          lineColor={0,0,0},
+          textString=
+               "a(s)")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-90,10},{90,90}}, textString=
+                                            "b(s)"),
+        Line(points={{-80,0},{80,0}}),
+        Text(extent={{-90,-10},{90,-90}}, textString=
+                                              "a(s)")}),
+    Window(
+      x=0.12,
+      y=0.11,
+      width=0.69,
+      height=0.81),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.7</b></p>
+</HTML>
+"));
+end FctTrans;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/Integrateur.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/Integrateur.mo
index 136c45f83745e47d2a764d97e9c1c378899aab3c..640830f8f5dffdd14225d599a04c668875fed90d 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/Integrateur.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/Integrateur.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
-block Integrateur
-  parameter Real k=1 "Gain";
-  parameter Real ureset0=0
-    "Valeur de la sortie sur reset (si ureset non connecté)";
-  parameter Boolean permanent=false "Calcul du permanent";
-
-protected
-  Real x;
-  Real x0;
-
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical reset
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ureset
-                                           annotation (Placement(transformation(
-          extent={{-120,-90},{-100,-70}}, rotation=0)));
-initial equation
-  if permanent then
-    der(x) = 0;
-  else
-    x = (1/k - 1) * ureset.signal/k;
-  end if;
-
-equation
-
-  if (cardinality(reset) == 0) then
-    reset.signal = false;
-  end if;
-
-  if (cardinality(ureset) == 0) then
-    ureset.signal = ureset0;
-  end if;
-
-  when not (reset.signal) then
-    x0 = ureset.signal/k;
-    reinit(x, x0);
-  end when;
-
-  der(x) = if reset.signal then 0 else u.signal;
-  y.signal = if reset.signal then ureset.signal else k*x;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-60,52},{60,6}},
-          lineColor={0,0,0},
-          textString=
-               "k"),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{62,0},{102,0}}),
-        Line(points={{-50,0},{50,0}}, color={0,0,0}),
-        Text(
-          extent={{-60,-6},{60,-52}},
-          lineColor={0,0,0},
-          textString=
-               "s")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,78},{-80,-90}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,-80},{82,-80}}, color={192,192,192}),
-        Polygon(
-          points={{90,-80},{68,-72},{68,-88},{90,-80}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-54,84},{6,24}},
-          lineColor={192,192,192},
-          textString=
-               "I"),
-        Line(points={{-80,-80},{80,80}}),
-        Text(
-          extent={{-36,-34},{54,-74}},
-          lineColor={0,0,0},
-          textString=
-               "K=%k")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.7</b></p>
-</HTML>
-"));
-end Integrateur;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
+block Integrateur
+  parameter Real k=1 "Gain";
+  parameter Real ureset0=0
+    "Valeur de la sortie sur reset (si ureset non connecté)";
+  parameter Boolean permanent=false "Calcul du permanent";
+
+protected
+  Real x;
+  Real x0;
+
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical reset
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ureset
+                                           annotation (Placement(transformation(
+          extent={{-120,-90},{-100,-70}}, rotation=0)));
+initial equation
+  if permanent then
+    der(x) = 0;
+  else
+    x = (1/k - 1) * ureset.signal/k;
+  end if;
+
+equation
+
+  if (cardinality(reset) == 0) then
+    reset.signal = false;
+  end if;
+
+  if (cardinality(ureset) == 0) then
+    ureset.signal = ureset0;
+  end if;
+
+  when not (reset.signal) then
+    x0 = ureset.signal/k;
+    reinit(x, x0);
+  end when;
+
+  der(x) = if reset.signal then 0 else u.signal;
+  y.signal = if reset.signal then ureset.signal else k*x;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-60,52},{60,6}},
+          lineColor={0,0,0},
+          textString=
+               "k"),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{62,0},{102,0}}),
+        Line(points={{-50,0},{50,0}}, color={0,0,0}),
+        Text(
+          extent={{-60,-6},{60,-52}},
+          lineColor={0,0,0},
+          textString=
+               "s")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,78},{-80,-90}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,-80},{82,-80}}, color={192,192,192}),
+        Polygon(
+          points={{90,-80},{68,-72},{68,-88},{90,-80}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-54,84},{6,24}},
+          lineColor={192,192,192},
+          textString=
+               "I"),
+        Line(points={{-80,-80},{80,80}}),
+        Text(
+          extent={{-36,-34},{54,-74}},
+          lineColor={0,0,0},
+          textString=
+               "K=%k")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.7</b></p>
+</HTML>
+"));
+end Integrateur;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/IntegrateurSat.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/IntegrateurSat.mo
index 43af2bf413614149987ab2160e63edda89f252a2..748b3ea889f3cbba07e41ce308ed8a1bfdbce1da 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/IntegrateurSat.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/IntegrateurSat.mo
@@ -1,112 +1,112 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
-block IntegrateurSat
-  parameter Real k=1 "Gain";
-  parameter Real maxval=1 "Valeur maximale de la sortie";
-  parameter Real minval=0 "Valeur minimale de la sortie";
-  parameter Real ureset0=0
-    "Valeur de la sortie sur reset (si ureset non connecté)";
-  parameter Boolean permanent=false "Calcul du permanent";
-
-protected
-  Real x;
-  Real x0;
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ureset
-                                           annotation (Placement(transformation(
-          extent={{-120,-90},{-100,-70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical reset
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-initial equation
-  if permanent then
-    der(x) = 0;
-  else
-    x = (1/k - 1) * ureset.signal/k;
-  end if;
-
-equation
-
-  assert(maxval > minval,
-    "IntegrateurSat : Le paramètre maxval doit être supérieur au paramètre minval");
-
-  if (cardinality(reset) == 0) then
-    reset.signal = false;
-  end if;
-
-  if (cardinality(ureset) == 0) then
-    ureset.signal = ureset0;
-  end if;
-
-  when not (reset.signal) then
-    x0 = ureset.signal/k;
-    reinit(x, x0);
-  end when;
-
-  der(x) = if (reset.signal or ((y.signal > maxval) and (u.signal > 0)) or ((y.
-    signal < minval) and (u.signal < 0))) then 0 else u.signal;
-  y.signal = if reset.signal then ureset.signal else k*x;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,78},{-80,-90}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,-80},{82,-80}}, color={192,192,192}),
-        Polygon(
-          points={{90,-80},{68,-72},{68,-88},{90,-80}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-54,84},{6,24}},
-          lineColor={192,192,192},
-          textString=
-               "I"),
-        Text(
-          extent={{-36,-34},{54,-74}},
-          lineColor={0,0,0},
-          textString=
-               "K=%k"),
-        Line(points={{-80,-80},{20,20},{80,20}})}),
-    Window(
-      x=0.39,
-      y=0.15,
-      width=0.72,
-      height=0.72),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.7</b></p>
-</HTML>
-"));
-end IntegrateurSat;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
+block IntegrateurSat
+  parameter Real k=1 "Gain";
+  parameter Real maxval=1 "Valeur maximale de la sortie";
+  parameter Real minval=0 "Valeur minimale de la sortie";
+  parameter Real ureset0=0
+    "Valeur de la sortie sur reset (si ureset non connecté)";
+  parameter Boolean permanent=false "Calcul du permanent";
+
+protected
+  Real x;
+  Real x0;
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ureset
+                                           annotation (Placement(transformation(
+          extent={{-120,-90},{-100,-70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical reset
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+initial equation
+  if permanent then
+    der(x) = 0;
+  else
+    x = (1/k - 1) * ureset.signal/k;
+  end if;
+
+equation
+
+  assert(maxval > minval,
+    "IntegrateurSat : Le paramètre maxval doit être supérieur au paramètre minval");
+
+  if (cardinality(reset) == 0) then
+    reset.signal = false;
+  end if;
+
+  if (cardinality(ureset) == 0) then
+    ureset.signal = ureset0;
+  end if;
+
+  when not (reset.signal) then
+    x0 = ureset.signal/k;
+    reinit(x, x0);
+  end when;
+
+  der(x) = if (reset.signal or ((y.signal > maxval) and (u.signal > 0)) or ((y.
+    signal < minval) and (u.signal < 0))) then 0 else u.signal;
+  y.signal = if reset.signal then ureset.signal else k*x;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,78},{-80,-90}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,-80},{82,-80}}, color={192,192,192}),
+        Polygon(
+          points={{90,-80},{68,-72},{68,-88},{90,-80}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-54,84},{6,24}},
+          lineColor={192,192,192},
+          textString=
+               "I"),
+        Text(
+          extent={{-36,-34},{54,-74}},
+          lineColor={0,0,0},
+          textString=
+               "K=%k"),
+        Line(points={{-80,-80},{20,20},{80,20}})}),
+    Window(
+      x=0.39,
+      y=0.15,
+      width=0.72,
+      height=0.72),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.7</b></p>
+</HTML>
+"));
+end IntegrateurSat;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PI.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PI.mo
index ea06f2e0b5534776624ac082925af5e28d09b78d..87f24a568919a4675506f0e6db35baaa7bca06c2 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PI.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PI.mo
@@ -1,139 +1,139 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
-block PI
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Constante de temps (s)";
-  parameter Real ureset0=0
-    "Valeur de la sortie sur reset (si ureset non connecté)";
-  parameter Boolean permanent=false "Calcul du permanent";
-
-protected
-  Real x;
-  Real x0;
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ureset
-                                           annotation (Placement(transformation(
-          extent={{-120,-90},{-100,-70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical reset
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-initial equation
-  if permanent then
-    der(x) = 0;
-  else
-    x = (1/k - 1) * ureset.signal/k;
-  end if;
-
-equation
-  if (cardinality(reset) == 0) then
-    reset.signal = false;
-  end if;
-
-  if (cardinality(ureset) == 0) then
-    ureset.signal = ureset0;
-  end if;
-
-  when not (reset.signal) then
-    x0 = ureset.signal/k - u.signal;
-    reinit(x, x0);
-  end when;
-
-  der(x) = if reset.signal then 0 else u.signal/Ti;
-  y.signal = if reset.signal then ureset.signal else k*(x + u.signal);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-74,64},{-74,-80}}, color={192,192,192}),
-        Line(points={{-74,-80},{70,-80}}, color={192,192,192}),
-        Polygon(
-          points={{92,-80},{70,-72},{70,-88},{92,-80}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-68},{-74,2},{66,58}},
-          color={0,0,255},
-          thickness=0.25),
-        Text(
-          extent={{-32,70},{0,42}},
-          lineColor={192,192,192},
-          textString=
-               "PI"),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Text(
-          extent={{-36,-34},{54,-74}},
-          lineColor={0,0,0},
-          textString=
-               "Ti=%Ti"),
-        Text(
-          extent={{-38,10},{52,-30}},
-          lineColor={0,0,0},
-          textString=
-               "K=%k"),
-        Polygon(
-          points={{-74,86},{-82,64},{-66,64},{-74,86}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{62,0},{100,0}}),
-        Rectangle(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-68,24},{-24,-18}},
-          lineColor={0,0,0},
-          textString=
-               "k"),
-        Text(
-          extent={{-32,48},{60,0}},
-          lineColor={0,0,0},
-          textString=
-               "T s + 1"),
-        Text(
-          extent={{-30,-8},{52,-40}},
-          lineColor={0,0,0},
-          textString=
-               "T s"),
-        Line(points={{-24,0},{54,0}}, color={0,0,0})}),
-    Window(
-      x=0.19,
-      y=0.2,
-      width=0.58,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end PI;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
+block PI
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Constante de temps (s)";
+  parameter Real ureset0=0
+    "Valeur de la sortie sur reset (si ureset non connecté)";
+  parameter Boolean permanent=false "Calcul du permanent";
+
+protected
+  Real x;
+  Real x0;
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ureset
+                                           annotation (Placement(transformation(
+          extent={{-120,-90},{-100,-70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical reset
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+initial equation
+  if permanent then
+    der(x) = 0;
+  else
+    x = (1/k - 1) * ureset.signal/k;
+  end if;
+
+equation
+  if (cardinality(reset) == 0) then
+    reset.signal = false;
+  end if;
+
+  if (cardinality(ureset) == 0) then
+    ureset.signal = ureset0;
+  end if;
+
+  when not (reset.signal) then
+    x0 = ureset.signal/k - u.signal;
+    reinit(x, x0);
+  end when;
+
+  der(x) = if reset.signal then 0 else u.signal/Ti;
+  y.signal = if reset.signal then ureset.signal else k*(x + u.signal);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-74,64},{-74,-80}}, color={192,192,192}),
+        Line(points={{-74,-80},{70,-80}}, color={192,192,192}),
+        Polygon(
+          points={{92,-80},{70,-72},{70,-88},{92,-80}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-68},{-74,2},{66,58}},
+          color={0,0,255},
+          thickness=0.25),
+        Text(
+          extent={{-32,70},{0,42}},
+          lineColor={192,192,192},
+          textString=
+               "PI"),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Text(
+          extent={{-36,-34},{54,-74}},
+          lineColor={0,0,0},
+          textString=
+               "Ti=%Ti"),
+        Text(
+          extent={{-38,10},{52,-30}},
+          lineColor={0,0,0},
+          textString=
+               "K=%k"),
+        Polygon(
+          points={{-74,86},{-82,64},{-66,64},{-74,86}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{62,0},{100,0}}),
+        Rectangle(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-68,24},{-24,-18}},
+          lineColor={0,0,0},
+          textString=
+               "k"),
+        Text(
+          extent={{-32,48},{60,0}},
+          lineColor={0,0,0},
+          textString=
+               "T s + 1"),
+        Text(
+          extent={{-30,-8},{52,-40}},
+          lineColor={0,0,0},
+          textString=
+               "T s"),
+        Line(points={{-24,0},{54,0}}, color={0,0,0})}),
+    Window(
+      x=0.19,
+      y=0.2,
+      width=0.58,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end PI;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PIsat.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PIsat.mo
index c5f1c65997c79cb27810cd31e6afcb0e2cbc7f94..a5971139fe75b00324b2f95d12a22b33f8e5d0e6 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PIsat.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PIsat.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
-block PIsat
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Constante de temps (s)";
-  parameter Real maxval=1 "Valeur maximale de la sortie";
-  parameter Real minval=0 "Valeur minimale de la sortie";
-  parameter Real ureset0=0
-    "Valeur de la sortie sur reset (si ureset non connecté)";
-  parameter Boolean permanent=false "Calcul du permanent";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  NonLineaire.Limiteur Limiteur1(maxval=maxval, minval=minval)
-    annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0)));
-  Math.Add Add2(k1=-1, k2=+1)
-                             annotation (Placement(transformation(extent={{40,
-            60},{20,80}}, rotation=0)));
-  Math.Gain Gain3(Gain=1/k)       annotation (Placement(transformation(extent={
-            {0,60},{-20,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ureset
-                                           annotation (Placement(transformation(
-          extent={{-120,-90},{-100,-70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical reset
-    annotation (Placement(transformation(
-        origin={-10,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  Math.Gain Gain(Gain=k) annotation (Placement(transformation(extent={{-46,20},
-            {-26,40}}, rotation=0)));
-  Math.Feedback Feedback1 annotation (Placement(transformation(extent={{-80,40},
-            {-60,20}}, rotation=0)));
-  Integrateur Integrateur1(k=1/Ti, permanent=permanent,
-    ureset0=ureset0)               annotation (Placement(transformation(extent=
-            {{-10,20},{10,40}}, rotation=0)));
-  Math.Add Add1 annotation (Placement(transformation(extent={{32,-10},{52,10}},
-          rotation=0)));
-  Math.Gain Gain1(Gain=k) annotation (Placement(transformation(extent={{-46,-40},
-            {-26,-20}}, rotation=0)));
-  NonLineaire.Selecteur Selecteur1(C1=0) annotation (Placement(transformation(
-          extent={{0,-30},{20,-10}}, rotation=0)));
-equation
-
-  if (cardinality(ureset) == 1) then
-    Integrateur1.ureset.signal = ureset0;
-  end if;
-
-  if (cardinality(reset) == 2) then
-    Integrateur1.reset.signal = false;
-  end if;
-
-  connect(Limiteur1.y, y) annotation (Line(points={{91,0},{110,0}}));
-  connect(Gain3.u, Add2.y) annotation (Line(points={{1,70},{19,70}}));
-  connect(u, Feedback1.u1) annotation (Line(points={{-110,0},{-90,0},{-90,30},{
-          -81,30}}));
-  connect(Limiteur1.y, Add2.u1) annotation (Line(points={{91,0},{94,0},{94,76},
-          {41,76}}));
-  connect(Gain3.y, Feedback1.u2) annotation (Line(points={{-21,70},{-70,70},{
-          -70,41}}));
-  connect(Integrateur1.y, Add1.u1)
-    annotation (Line(points={{11,30},{20,30},{20,6},{31,6}}));
-  connect(ureset, Integrateur1.ureset)
-    annotation (Line(points={{-110,-80},{-20,-80},{-20,22},{-11,22}}));
-  connect(reset, Integrateur1.reset)
-    annotation (Line(points={{-10,-110},{-10,10},{0,10},{0,19}}, pattern=
-          LinePattern.Dash));
-  connect(Add1.y, Limiteur1.u) annotation (Line(points={{53,0},{69,0}}));
-  connect(Add1.y, Add2.u2) annotation (Line(points={{53,0},{60,0},{60,64},{41,
-          64}}));
-  connect(Feedback1.y, Gain.u) annotation (Line(points={{-59,30},{-47,30}}));
-  connect(Gain.y, Integrateur1.u) annotation (Line(points={{-25,30},{-11,30}}));
-  connect(u, Gain1.u) annotation (Line(points={{-110,0},{-90,0},{-90,-30},{-47,
-          -30}}));
-  connect(Selecteur1.y, Add1.u2)
-    annotation (Line(points={{21,-20},{26,-20},{26,-6},{31,-6}}));
-  connect(Gain1.y, Selecteur1.u2)
-    annotation (Line(points={{-25,-30},{-14,-30},{-14,-28},{-1,-28}}));
-  connect(reset, Selecteur1.uCond)
-    annotation (Line(points={{-10,-110},{-10,-20},{-1,-20}}, pattern=
-          LinePattern.Dash));
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-74,64},{-74,-80}}, color={192,192,192}),
-        Line(points={{-74,-80},{70,-80}}, color={192,192,192}),
-        Polygon(
-          points={{92,-80},{70,-72},{70,-88},{92,-80}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-68},{-74,2},{30,42}},
-          color={0,0,255},
-          thickness=0.25),
-        Text(
-          extent={{-32,70},{0,42}},
-          lineColor={192,192,192},
-          textString=
-               "PI"),
-        Line(points={{30,42},{86,42}}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Text(
-          extent={{-38,10},{52,-30}},
-          lineColor={0,0,0},
-          textString=
-               "K=%k"),
-        Text(
-          extent={{-36,-34},{54,-74}},
-          lineColor={0,0,0},
-          textString=
-               "Ti=%Ti"),
-        Polygon(
-          points={{-74,86},{-82,64},{-66,64},{-74,86}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.12,
-      y=0.18,
-      width=0.56,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Continuous library</b> </p>
-<p><b>Version 1.7</h4>
-</html>"),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics));
-end PIsat;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
+block PIsat
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Constante de temps (s)";
+  parameter Real maxval=1 "Valeur maximale de la sortie";
+  parameter Real minval=0 "Valeur minimale de la sortie";
+  parameter Real ureset0=0
+    "Valeur de la sortie sur reset (si ureset non connecté)";
+  parameter Boolean permanent=false "Calcul du permanent";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  NonLineaire.Limiteur Limiteur1(maxval=maxval, minval=minval)
+    annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0)));
+  Math.Add Add2(k1=-1, k2=+1)
+                             annotation (Placement(transformation(extent={{40,
+            60},{20,80}}, rotation=0)));
+  Math.Gain Gain3(Gain=1/k)       annotation (Placement(transformation(extent={
+            {0,60},{-20,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ureset
+                                           annotation (Placement(transformation(
+          extent={{-120,-90},{-100,-70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical reset
+    annotation (Placement(transformation(
+        origin={-10,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  Math.Gain Gain(Gain=k) annotation (Placement(transformation(extent={{-46,20},
+            {-26,40}}, rotation=0)));
+  Math.Feedback Feedback1 annotation (Placement(transformation(extent={{-80,40},
+            {-60,20}}, rotation=0)));
+  Integrateur Integrateur1(k=1/Ti, permanent=permanent,
+    ureset0=ureset0)               annotation (Placement(transformation(extent=
+            {{-10,20},{10,40}}, rotation=0)));
+  Math.Add Add1 annotation (Placement(transformation(extent={{32,-10},{52,10}},
+          rotation=0)));
+  Math.Gain Gain1(Gain=k) annotation (Placement(transformation(extent={{-46,-40},
+            {-26,-20}}, rotation=0)));
+  NonLineaire.Selecteur Selecteur1(C1=0) annotation (Placement(transformation(
+          extent={{0,-30},{20,-10}}, rotation=0)));
+equation
+
+  if (cardinality(ureset) == 1) then
+    Integrateur1.ureset.signal = ureset0;
+  end if;
+
+  if (cardinality(reset) == 2) then
+    Integrateur1.reset.signal = false;
+  end if;
+
+  connect(Limiteur1.y, y) annotation (Line(points={{91,0},{110,0}}));
+  connect(Gain3.u, Add2.y) annotation (Line(points={{1,70},{19,70}}));
+  connect(u, Feedback1.u1) annotation (Line(points={{-110,0},{-90,0},{-90,30},{
+          -81,30}}));
+  connect(Limiteur1.y, Add2.u1) annotation (Line(points={{91,0},{94,0},{94,76},
+          {41,76}}));
+  connect(Gain3.y, Feedback1.u2) annotation (Line(points={{-21,70},{-70,70},{
+          -70,41}}));
+  connect(Integrateur1.y, Add1.u1)
+    annotation (Line(points={{11,30},{20,30},{20,6},{31,6}}));
+  connect(ureset, Integrateur1.ureset)
+    annotation (Line(points={{-110,-80},{-20,-80},{-20,22},{-11,22}}));
+  connect(reset, Integrateur1.reset)
+    annotation (Line(points={{-10,-110},{-10,10},{0,10},{0,19}}, pattern=
+          LinePattern.Dash));
+  connect(Add1.y, Limiteur1.u) annotation (Line(points={{53,0},{69,0}}));
+  connect(Add1.y, Add2.u2) annotation (Line(points={{53,0},{60,0},{60,64},{41,
+          64}}));
+  connect(Feedback1.y, Gain.u) annotation (Line(points={{-59,30},{-47,30}}));
+  connect(Gain.y, Integrateur1.u) annotation (Line(points={{-25,30},{-11,30}}));
+  connect(u, Gain1.u) annotation (Line(points={{-110,0},{-90,0},{-90,-30},{-47,
+          -30}}));
+  connect(Selecteur1.y, Add1.u2)
+    annotation (Line(points={{21,-20},{26,-20},{26,-6},{31,-6}}));
+  connect(Gain1.y, Selecteur1.u2)
+    annotation (Line(points={{-25,-30},{-14,-30},{-14,-28},{-1,-28}}));
+  connect(reset, Selecteur1.uCond)
+    annotation (Line(points={{-10,-110},{-10,-20},{-1,-20}}, pattern=
+          LinePattern.Dash));
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-74,64},{-74,-80}}, color={192,192,192}),
+        Line(points={{-74,-80},{70,-80}}, color={192,192,192}),
+        Polygon(
+          points={{92,-80},{70,-72},{70,-88},{92,-80}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-68},{-74,2},{30,42}},
+          color={0,0,255},
+          thickness=0.25),
+        Text(
+          extent={{-32,70},{0,42}},
+          lineColor={192,192,192},
+          textString=
+               "PI"),
+        Line(points={{30,42},{86,42}}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Text(
+          extent={{-38,10},{52,-30}},
+          lineColor={0,0,0},
+          textString=
+               "K=%k"),
+        Text(
+          extent={{-36,-34},{54,-74}},
+          lineColor={0,0,0},
+          textString=
+               "Ti=%Ti"),
+        Polygon(
+          points={{-74,86},{-82,64},{-66,64},{-74,86}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.12,
+      y=0.18,
+      width=0.56,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Continuous library</b> </p>
+<p><b>Version 1.7</h4>
+</html>"),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics));
+end PIsat;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PT1.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PT1.mo
index df855024f616f3378a056ab40885e56e840a4b5c..610876b74c10d23f5ebe1fb7df081334e9e8a89e 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PT1.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PT1.mo
@@ -1,111 +1,111 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
-block PT1
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Constante de temps (s)";
-  parameter Real U0=0
-    "Valeur de la sortie à l'instant initial (si non permanent et si u0 non connecté)";
-  parameter Boolean permanent=false "Calcul du permanent";
-
-protected
-  Real x;
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u0
-                                       annotation (Placement(transformation(
-          extent={{-120,-90},{-100,-70}}, rotation=0)));
-initial equation
-  if permanent then
-    der(x) = 0;
-  else
-    x = (u0.signal)/k;
-  end if;
-
-equation
-  if (cardinality(u0) == 0) then
-    u0.signal = U0;
-  end if;
-
-  der(x) = (u.signal - x)/Ti;
-  y.signal = k*x;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-60,52},{60,6}},
-          lineColor={0,0,0},
-          textString=
-               "k"),
-        Text(
-          extent={{-60,0},{60,-60}},
-          lineColor={0,0,0},
-          textString=
-               "T s + 1"),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{62,0},{102,0}}),
-        Line(points={{-50,0},{50,0}}, color={0,0,0})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-80,78},{-80,-90}}, color={192,192,192}),
-        Line(points={{-90,-80},{82,-80}}, color={192,192,192}),
-        Polygon(
-          points={{90,-80},{68,-72},{68,-88},{90,-80}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-80},{-70,-45.11},{-60,-19.58},{-50,-0.9087},{-40,
-              12.75},{-30,22.75},{-20,30.06},{-10,35.41},{0,39.33},{10,42.19},{
-              20,44.29},{30,45.82},{40,46.94},{50,47.76},{60,48.36},{70,48.8},{
-              80,49.12}}),
-        Text(
-          extent={{-64,82},{-4,22}},
-          lineColor={192,192,192},
-          textString=
-               "PT1"),
-        Text(
-          extent={{-38,10},{52,-30}},
-          lineColor={0,0,0},
-          textString=
-               "K=%k"),
-        Text(
-          extent={{-36,-34},{54,-74}},
-          lineColor={0,0,0},
-          textString=
-               "Ti=%Ti"),
-        Polygon(
-          points={{-80,94},{-88,72},{-72,72},{-80,94}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.33,
-      y=0.24,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
-<p><b>Version 1.7</h4>
-</HTML>
-"));
-end PT1;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
+block PT1
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Constante de temps (s)";
+  parameter Real U0=0
+    "Valeur de la sortie à l'instant initial (si non permanent et si u0 non connecté)";
+  parameter Boolean permanent=false "Calcul du permanent";
+
+protected
+  Real x;
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u0
+                                       annotation (Placement(transformation(
+          extent={{-120,-90},{-100,-70}}, rotation=0)));
+initial equation
+  if permanent then
+    der(x) = 0;
+  else
+    x = (u0.signal)/k;
+  end if;
+
+equation
+  if (cardinality(u0) == 0) then
+    u0.signal = U0;
+  end if;
+
+  der(x) = (u.signal - x)/Ti;
+  y.signal = k*x;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-60,52},{60,6}},
+          lineColor={0,0,0},
+          textString=
+               "k"),
+        Text(
+          extent={{-60,0},{60,-60}},
+          lineColor={0,0,0},
+          textString=
+               "T s + 1"),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{62,0},{102,0}}),
+        Line(points={{-50,0},{50,0}}, color={0,0,0})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-80,78},{-80,-90}}, color={192,192,192}),
+        Line(points={{-90,-80},{82,-80}}, color={192,192,192}),
+        Polygon(
+          points={{90,-80},{68,-72},{68,-88},{90,-80}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-80},{-70,-45.11},{-60,-19.58},{-50,-0.9087},{-40,
+              12.75},{-30,22.75},{-20,30.06},{-10,35.41},{0,39.33},{10,42.19},{
+              20,44.29},{30,45.82},{40,46.94},{50,47.76},{60,48.36},{70,48.8},{
+              80,49.12}}),
+        Text(
+          extent={{-64,82},{-4,22}},
+          lineColor={192,192,192},
+          textString=
+               "PT1"),
+        Text(
+          extent={{-38,10},{52,-30}},
+          lineColor={0,0,0},
+          textString=
+               "K=%k"),
+        Text(
+          extent={{-36,-34},{54,-74}},
+          lineColor={0,0,0},
+          textString=
+               "Ti=%Ti"),
+        Polygon(
+          points={{-80,94},{-88,72},{-72,72},{-80,94}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.33,
+      y=0.24,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
+<p><b>Version 1.7</h4>
+</HTML>
+"));
+end PT1;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PT2.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PT2.mo
index ebe662c9c77b83b7a41df788c4a4461f086b0246..50509799ef8aa3554d8ecb7abefa0d4f5eea4660 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PT2.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/PT2.mo
@@ -1,150 +1,150 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
-block PT2
-  parameter Real k=1 "Gain";
-  parameter Real w=1 "Fréquence angulaire";
-  parameter Real D=1 "Amortissement";
-  parameter Boolean permanent=false "Calcul du permanent";
-
-protected
-  Real x(start=0);
-  Real xd(start=0);
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-initial equation
-  if permanent then
-    der(x) = 0;
-    der(xd) = 0;
-  end if;
-
-equation
-  der(x) = xd;
-  der(xd) = w*(w*(u.signal - x) - 2*D*xd);
-  y.signal = k*x;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-60,52},{60,6}},
-          lineColor={0,0,0},
-          textString=
-               "k"),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{62,0},{102,0}}),
-        Line(points={{-50,0},{50,0}}, color={0,0,0}),
-        Text(
-          extent={{-60,0},{-32,-28}},
-          lineColor={0,0,0},
-          textString=
-               "s"),
-        Line(points={{-54,-28},{-38,-28}}, color={0,0,0}),
-        Text(
-          extent={{-52,-34},{-36,-56}},
-          lineColor={0,0,0},
-          textString=
-               "w"),
-        Line(points={{-40,-6},{-34,-18},{-34,-38},{-38,-54}}, color={0,0,0}),
-        Text(
-          extent={{-34,0},{-22,-18}},
-          lineColor={0,0,0},
-          textString=
-               "2"),
-        Text(
-          extent={{-34,-14},{6,-44}},
-          lineColor={0,0,0},
-          textString=
-               "+2D"),
-        Text(
-          extent={{2,0},{30,-28}},
-          lineColor={0,0,0},
-          textString=
-               "s"),
-        Line(points={{8,-28},{24,-28}}, color={0,0,0}),
-        Text(
-          extent={{10,-34},{26,-56}},
-          lineColor={0,0,0},
-          textString=
-               "w"),
-        Line(points={{12,-6},{6,-16},{6,-36},{10,-54}}, color={0,0,0}),
-        Line(points={{22,-6},{28,-18},{28,-38},{24,-54}}, color={0,0,0}),
-        Text(
-          extent={{30,-6},{58,-50}},
-          lineColor={0,0,0},
-          textString=
-               "+1"),
-        Line(points={{-50,-6},{-56,-16},{-56,-36},{-52,-54}}, color={0,0,0})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,78},{-80,-90}}, color={192,192,192}),
-        Line(points={{-90,-80},{82,-80}}, color={192,192,192}),
-        Polygon(
-          points={{90,-80},{68,-72},{68,-88},{90,-80}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-80},{-72,-68.53},{-64,-39.5},{-56,-2.522},{-48,32.75},
-              {-40,58.8},{-32,71.51},{-24,70.49},{-16,58.45},{-8,40.06},{0,
-              20.55},{8,4.459},{16,-5.271},{24,-7.629},{32,-3.428},{40,5.21},{
-              48,15.56},{56,25.03},{64,31.66},{72,34.5},{80,33.61}}),
-        Text(
-          extent={{-2,90},{58,30}},
-          lineColor={192,192,192},
-          textString=
-               "PT2"),
-        Text(
-          extent={{-150,-150},{150,-110}},
-          lineColor={0,0,0},
-          textString=
-               "w=%w"),
-        Text(
-          extent={{-64,4},{26,-36}},
-          lineColor={0,0,0},
-          textString=
-               "K=%k"),
-        Text(
-          extent={{-62,-40},{28,-80}},
-          lineColor={0,0,0},
-          textString=
-               "D=%D"),
-        Polygon(
-          points={{-80,94},{-88,72},{-72,72},{-80,94}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.34,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
-<p><b>Version 1.7</h4>
-</HTML>
-"));
-end PT2;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Continu;
+block PT2
+  parameter Real k=1 "Gain";
+  parameter Real w=1 "Fréquence angulaire";
+  parameter Real D=1 "Amortissement";
+  parameter Boolean permanent=false "Calcul du permanent";
+
+protected
+  Real x(start=0);
+  Real xd(start=0);
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+initial equation
+  if permanent then
+    der(x) = 0;
+    der(xd) = 0;
+  end if;
+
+equation
+  der(x) = xd;
+  der(xd) = w*(w*(u.signal - x) - 2*D*xd);
+  y.signal = k*x;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-60,52},{60,6}},
+          lineColor={0,0,0},
+          textString=
+               "k"),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{62,0},{102,0}}),
+        Line(points={{-50,0},{50,0}}, color={0,0,0}),
+        Text(
+          extent={{-60,0},{-32,-28}},
+          lineColor={0,0,0},
+          textString=
+               "s"),
+        Line(points={{-54,-28},{-38,-28}}, color={0,0,0}),
+        Text(
+          extent={{-52,-34},{-36,-56}},
+          lineColor={0,0,0},
+          textString=
+               "w"),
+        Line(points={{-40,-6},{-34,-18},{-34,-38},{-38,-54}}, color={0,0,0}),
+        Text(
+          extent={{-34,0},{-22,-18}},
+          lineColor={0,0,0},
+          textString=
+               "2"),
+        Text(
+          extent={{-34,-14},{6,-44}},
+          lineColor={0,0,0},
+          textString=
+               "+2D"),
+        Text(
+          extent={{2,0},{30,-28}},
+          lineColor={0,0,0},
+          textString=
+               "s"),
+        Line(points={{8,-28},{24,-28}}, color={0,0,0}),
+        Text(
+          extent={{10,-34},{26,-56}},
+          lineColor={0,0,0},
+          textString=
+               "w"),
+        Line(points={{12,-6},{6,-16},{6,-36},{10,-54}}, color={0,0,0}),
+        Line(points={{22,-6},{28,-18},{28,-38},{24,-54}}, color={0,0,0}),
+        Text(
+          extent={{30,-6},{58,-50}},
+          lineColor={0,0,0},
+          textString=
+               "+1"),
+        Line(points={{-50,-6},{-56,-16},{-56,-36},{-52,-54}}, color={0,0,0})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,78},{-80,-90}}, color={192,192,192}),
+        Line(points={{-90,-80},{82,-80}}, color={192,192,192}),
+        Polygon(
+          points={{90,-80},{68,-72},{68,-88},{90,-80}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-80},{-72,-68.53},{-64,-39.5},{-56,-2.522},{-48,32.75},
+              {-40,58.8},{-32,71.51},{-24,70.49},{-16,58.45},{-8,40.06},{0,
+              20.55},{8,4.459},{16,-5.271},{24,-7.629},{32,-3.428},{40,5.21},{
+              48,15.56},{56,25.03},{64,31.66},{72,34.5},{80,33.61}}),
+        Text(
+          extent={{-2,90},{58,30}},
+          lineColor={192,192,192},
+          textString=
+               "PT2"),
+        Text(
+          extent={{-150,-150},{150,-110}},
+          lineColor={0,0,0},
+          textString=
+               "w=%w"),
+        Text(
+          extent={{-64,4},{26,-36}},
+          lineColor={0,0,0},
+          textString=
+               "K=%k"),
+        Text(
+          extent={{-62,-40},{28,-80}},
+          lineColor={0,0,0},
+          textString=
+               "D=%D"),
+        Polygon(
+          points={{-80,94},{-88,72},{-72,72},{-80,94}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.34,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Continuous library</b></p>
+<p><b>Version 1.7</h4>
+</HTML>
+"));
+end PT2;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/package.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/package.mo
index 9d02fe94085ec2a690076823fc1f81026b970d5c..6d0aa3373db736fa20309352e2903677c161bbbc 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Continu/package.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks;
-package Continu
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Continu;
+within ThermoSysPro.InstrumentationAndControl.Blocks;
+package Continu
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Continu;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/ConvAD.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/ConvAD.mo
index 55e7f2b65d8c25fe0afbe028ee8b664f78c62521..5275c6397bd2cef675a9067d21847573cfa18c27 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/ConvAD.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/ConvAD.mo
@@ -1,61 +1,61 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
-block ConvAD
-  parameter Real maxval=1 "Valeur maximale en entrée";
-  parameter Real minval=-maxval "Valeur minimale en entrée";
-  parameter Real bits=12 "Nombre de bits du convertisseur AD";
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
-
-protected
-  Real qInterval(start=((maxval - minval)/2^bits)) "quantization interval";
-  Real uBound "bounded input";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-algorithm
-
-  qInterval := ((maxval - minval)/2^bits);
-
-  when sample(SampleOffset, SampleInterval) then
-    uBound := if u.signal > maxval then maxval else if u.signal < minval then
-      minval else u.signal;
-    y.signal := qInterval*floor(abs(uBound/qInterval) + 0.5)*sign(uBound);
-  end when;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-30},{-46,-30},{-46,0},{-20,0},{-20,22},{-8,22},{-8,
-              44},{12,44},{12,20},{30,20},{30,0},{62,0},{62,-22},{88,-22}}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid), Line(points={{-80,-30},{-46,-30},{-46,
-              0},{-20,0},{-20,22},{-8,22},{-8,44},{12,44},{12,20},{30,20},{30,0},
-              {62,0},{62,-22},{88,-22}})}),
-    Window(
-      x=0.1,
-      y=0.25,
-      width=0.77,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end ConvAD;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
+block ConvAD
+  parameter Real maxval=1 "Valeur maximale en entrée";
+  parameter Real minval=-maxval "Valeur minimale en entrée";
+  parameter Real bits=12 "Nombre de bits du convertisseur AD";
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
+
+protected
+  Real qInterval(start=((maxval - minval)/2^bits)) "quantization interval";
+  Real uBound "bounded input";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+algorithm
+
+  qInterval := ((maxval - minval)/2^bits);
+
+  when sample(SampleOffset, SampleInterval) then
+    uBound := if u.signal > maxval then maxval else if u.signal < minval then
+      minval else u.signal;
+    y.signal := qInterval*floor(abs(uBound/qInterval) + 0.5)*sign(uBound);
+  end when;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-30},{-46,-30},{-46,0},{-20,0},{-20,22},{-8,22},{-8,
+              44},{12,44},{12,20},{30,20},{30,0},{62,0},{62,-22},{88,-22}}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid), Line(points={{-80,-30},{-46,-30},{-46,
+              0},{-20,0},{-20,22},{-8,22},{-8,44},{12,44},{12,20},{30,20},{30,0},
+              {62,0},{62,-22},{88,-22}})}),
+    Window(
+      x=0.1,
+      y=0.25,
+      width=0.77,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end ConvAD;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/ConvDA.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/ConvDA.mo
index a9c518e0ad3f80ccc275122231a66605b1ff2f5e..330ef1f810ecfce22118babb5a8e3a82a111707d 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/ConvDA.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/ConvDA.mo
@@ -1,57 +1,57 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
-block ConvDA
-  parameter Real maxval=1 "Valeur maximale en entrée";
-  parameter Real minval=-maxval "Valeur minimale en entrée";
-  parameter Real bits=12 "Nombre de bits du convertisseur DA";
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
-
-protected
-  Real qInterval(start=((maxval - minval)/2^bits)) "quantization interval";
-  Real uBound "bounded input";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-algorithm
-
-  qInterval := ((maxval - minval)/2^bits);
-
-  when sample(SampleOffset, SampleInterval) then
-    uBound := if u.signal > maxval then maxval else if u.signal < minval then
-      minval else u.signal;
-    y.signal := qInterval*floor(abs(uBound/qInterval) + 0.5)*sign(uBound);
-  end when;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-30},{-46,-30},{-46,0},{-20,0},{-20,22},{-8,22},{-8,
-              44},{12,44},{12,20},{30,20},{30,0},{62,0},{62,-22},{88,-22}}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Line(points={{-80,-30},{-46,-30},{-46,0},{-20,0},
-              {-20,22},{-8,22},{-8,44},{12,44},{12,20},{30,20},{30,0},{62,0},{
-              62,-22},{88,-22}})}),
-    Window(
-      x=0.15,
-      y=0.24,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end ConvDA;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
+block ConvDA
+  parameter Real maxval=1 "Valeur maximale en entrée";
+  parameter Real minval=-maxval "Valeur minimale en entrée";
+  parameter Real bits=12 "Nombre de bits du convertisseur DA";
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
+
+protected
+  Real qInterval(start=((maxval - minval)/2^bits)) "quantization interval";
+  Real uBound "bounded input";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+algorithm
+
+  qInterval := ((maxval - minval)/2^bits);
+
+  when sample(SampleOffset, SampleInterval) then
+    uBound := if u.signal > maxval then maxval else if u.signal < minval then
+      minval else u.signal;
+    y.signal := qInterval*floor(abs(uBound/qInterval) + 0.5)*sign(uBound);
+  end when;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-30},{-46,-30},{-46,0},{-20,0},{-20,22},{-8,22},{-8,
+              44},{12,44},{12,20},{30,20},{30,0},{62,0},{62,-22},{88,-22}}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Line(points={{-80,-30},{-46,-30},{-46,0},{-20,0},
+              {-20,22},{-8,22},{-8,44},{12,44},{12,20},{30,20},{30,0},{62,0},{
+              62,-22},{88,-22}})}),
+    Window(
+      x=0.15,
+      y=0.24,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end ConvDA;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/Echant.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/Echant.mo
index 7d24aaa4cd30eadf36a04cc9273937b98645d1ce..e2b78f90be1d1fa808f6517104bd5aa5679f73b8 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/Echant.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/Echant.mo
@@ -1,93 +1,93 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
-block Echant
-  parameter Real Gain=1 "Gain";
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
-
-protected
-  Real uc;
-  Real ud;
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical continu
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  if (cardinality(continu) == 0) then
-    continu.signal = false;
-  end if;
-
-algorithm
-  when {sample(SampleOffset, SampleInterval),not (continu.signal)} then
-    ud := u.signal;
-  end when;
-
-  uc := u.signal;
-
-  y.signal := Gain*(if continu.signal then uc else ud);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Ellipse(
-          extent={{-25,-10},{-45,10}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{45,-10},{25,10}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-100,0},{-45,0}}, color={0,0,255}),
-        Line(points={{45,0},{100,0}}, color={0,0,255}),
-        Line(points={{-35,0},{30,35}}, color={0,0,255})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-25,-10},{-45,10}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{45,-10},{25,10}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-100,0},{-45,0}}, color={0,0,255}),
-        Line(points={{45,0},{100,0}}, color={0,0,255}),
-        Line(points={{-35,0},{30,35}}, color={0,0,255}),
-        Line(
-          points={{0,-20},{0,-100}},
-          color={0,0,255},
-          pattern=LinePattern.Dot)}),
-    Window(
-      x=0.17,
-      y=0.12,
-      width=0.65,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Adapted from the ModelicaAdditions.Blocks.Discrete library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Echant;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
+block Echant
+  parameter Real Gain=1 "Gain";
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
+
+protected
+  Real uc;
+  Real ud;
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical continu
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  if (cardinality(continu) == 0) then
+    continu.signal = false;
+  end if;
+
+algorithm
+  when {sample(SampleOffset, SampleInterval),not (continu.signal)} then
+    ud := u.signal;
+  end when;
+
+  uc := u.signal;
+
+  y.signal := Gain*(if continu.signal then uc else ud);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Ellipse(
+          extent={{-25,-10},{-45,10}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{45,-10},{25,10}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-100,0},{-45,0}}, color={0,0,255}),
+        Line(points={{45,0},{100,0}}, color={0,0,255}),
+        Line(points={{-35,0},{30,35}}, color={0,0,255})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-25,-10},{-45,10}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{45,-10},{25,10}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-100,0},{-45,0}}, color={0,0,255}),
+        Line(points={{45,0},{100,0}}, color={0,0,255}),
+        Line(points={{-35,0},{30,35}}, color={0,0,255}),
+        Line(
+          points={{0,-20},{0,-100}},
+          color={0,0,255},
+          pattern=LinePattern.Dot)}),
+    Window(
+      x=0.17,
+      y=0.12,
+      width=0.65,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Adapted from the ModelicaAdditions.Blocks.Discrete library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Echant;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/FctTrans.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/FctTrans.mo
index 8d36eed9b95f66e995638f6a62931493108ba6f6..2e08cf2d9760d2872a961aa7f322b7028d4d961d 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/FctTrans.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/FctTrans.mo
@@ -1,87 +1,87 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
-block FctTrans
-  parameter Real b[:]={1}
-    "Coefficients numérateurs de la fonction de transfert";
-  parameter Real a[:]={1,1}
-    "Coefficients dénominateurs de la fonction de transfert";
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
-
-protected
-  Real x[size(a, 1) - 1];
-  parameter Integer na=size(a, 1);
-  parameter Integer nb(max=na) = size(b, 1);
-  Real x1;
-  Real xn;
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  when sample(SampleOffset, SampleInterval) then
-    [x; xn] = [x1; pre(x)];
-    [u.signal] = transpose([a])*[x1; pre(x)];
-    [y.signal] = transpose([zeros(na - nb, 1); b])*[x1; pre(x)];
-  end when;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{82,0},{-84,0}}, color={0,0,255}),
-        Text(
-          extent={{-92,92},{86,12}},
-          lineColor={0,0,255},
-          textString=
-               "b(z)"),
-        Text(
-          extent={{-90,-12},{90,-90}},
-          lineColor={0,0,255},
-          textString=
-               "a(z)")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(extent={{-60,60},{60,-60}}, lineColor={0,0,255}),
-        Line(
-          points={{40,0},{-44,0}},
-          color={0,0,0},
-          thickness=0.5),
-        Text(
-          extent={{-54,54},{54,4}},
-          lineColor={0,0,0},
-          textString=
-               "b(z)"),
-        Text(
-          extent={{-54,-6},{56,-56}},
-          lineColor={0,0,0},
-          textString=
-               "a(z)"),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}})}),
-    Window(
-      x=0.24,
-      y=0.15,
-      width=0.65,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Adapted from the ModelicaAdditions.Blocks.Discrete library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end FctTrans;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
+block FctTrans
+  parameter Real b[:]={1}
+    "Coefficients numérateurs de la fonction de transfert";
+  parameter Real a[:]={1,1}
+    "Coefficients dénominateurs de la fonction de transfert";
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
+
+protected
+  Real x[size(a, 1) - 1];
+  parameter Integer na=size(a, 1);
+  parameter Integer nb(max=na) = size(b, 1);
+  Real x1;
+  Real xn;
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  when sample(SampleOffset, SampleInterval) then
+    [x; xn] = [x1; pre(x)];
+    [u.signal] = transpose([a])*[x1; pre(x)];
+    [y.signal] = transpose([zeros(na - nb, 1); b])*[x1; pre(x)];
+  end when;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{82,0},{-84,0}}, color={0,0,255}),
+        Text(
+          extent={{-92,92},{86,12}},
+          lineColor={0,0,255},
+          textString=
+               "b(z)"),
+        Text(
+          extent={{-90,-12},{90,-90}},
+          lineColor={0,0,255},
+          textString=
+               "a(z)")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(extent={{-60,60},{60,-60}}, lineColor={0,0,255}),
+        Line(
+          points={{40,0},{-44,0}},
+          color={0,0,0},
+          thickness=0.5),
+        Text(
+          extent={{-54,54},{54,4}},
+          lineColor={0,0,0},
+          textString=
+               "b(z)"),
+        Text(
+          extent={{-54,-6},{56,-56}},
+          lineColor={0,0,0},
+          textString=
+               "a(z)"),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}})}),
+    Window(
+      x=0.24,
+      y=0.15,
+      width=0.65,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Adapted from the ModelicaAdditions.Blocks.Discrete library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end FctTrans;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PI.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PI.mo
index 8596e377e42fd25142c1cc19d1b9d9e1830ffb78..b25e4fc78da4d1fa72f6710ad32098fd44d4aae8 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PI.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PI.mo
@@ -1,111 +1,111 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
-block PI
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Constante de temps";
-  parameter Real initialCond=0 "Condition initiale";
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
-
-protected
-  Real x(start=initialCond);
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-algorithm
-
-  when sample(SampleOffset, SampleInterval) then
-    x := pre(x) + SampleInterval/Ti*pre(u.signal);
-    y.signal := k*(x + u.signal);
-  end when;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-74,64},{-74,-80}}, color={0,0,0}),
-        Line(points={{-74,-80},{70,-80}}, color={0,0,0}),
-        Polygon(
-          points={{92,-80},{70,-72},{70,-88},{92,-80}},
-          lineColor={192,192,192},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-68},{-74,2},{66,58}},
-          color={0,0,255},
-          thickness=0.25),
-        Text(
-          extent={{-32,70},{0,42}},
-          lineColor={160,160,164},
-          textString=
-               "PI"),
-        Text(extent={{-154,142},{146,102}}, textString=
-                                                "%name"),
-        Text(
-          extent={{-38,10},{52,-30}},
-          lineColor={0,0,0},
-          textString=
-               "K=%k"),
-        Text(
-          extent={{-36,-34},{54,-74}},
-          lineColor={0,0,0},
-          textString=
-               "Ti=%Ti"),
-        Polygon(
-          points={{-74,86},{-82,64},{-66,64},{-74,86}},
-          lineColor={192,192,192},
-          fillColor={128,128,128},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.26,
-      y=0.13,
-      width=0.78,
-      height=0.7),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{62,0},{100,0}}),
-        Rectangle(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-68,24},{-24,-18}},
-          lineColor={0,0,0},
-          textString=
-               "k"),
-        Text(
-          extent={{-32,48},{60,0}},
-          lineColor={0,0,0},
-          textString=
-               "T s + 1"),
-        Text(
-          extent={{-30,-8},{52,-40}},
-          lineColor={0,0,0},
-          textString=
-               "T s"),
-        Line(points={{-24,0},{54,0}}, color={0,0,0})}),
-    Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end PI;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
+block PI
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Constante de temps";
+  parameter Real initialCond=0 "Condition initiale";
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
+
+protected
+  Real x(start=initialCond);
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+algorithm
+
+  when sample(SampleOffset, SampleInterval) then
+    x := pre(x) + SampleInterval/Ti*pre(u.signal);
+    y.signal := k*(x + u.signal);
+  end when;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-74,64},{-74,-80}}, color={0,0,0}),
+        Line(points={{-74,-80},{70,-80}}, color={0,0,0}),
+        Polygon(
+          points={{92,-80},{70,-72},{70,-88},{92,-80}},
+          lineColor={192,192,192},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-68},{-74,2},{66,58}},
+          color={0,0,255},
+          thickness=0.25),
+        Text(
+          extent={{-32,70},{0,42}},
+          lineColor={160,160,164},
+          textString=
+               "PI"),
+        Text(extent={{-154,142},{146,102}}, textString=
+                                                "%name"),
+        Text(
+          extent={{-38,10},{52,-30}},
+          lineColor={0,0,0},
+          textString=
+               "K=%k"),
+        Text(
+          extent={{-36,-34},{54,-74}},
+          lineColor={0,0,0},
+          textString=
+               "Ti=%Ti"),
+        Polygon(
+          points={{-74,86},{-82,64},{-66,64},{-74,86}},
+          lineColor={192,192,192},
+          fillColor={128,128,128},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.26,
+      y=0.13,
+      width=0.78,
+      height=0.7),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{62,0},{100,0}}),
+        Rectangle(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-68,24},{-24,-18}},
+          lineColor={0,0,0},
+          textString=
+               "k"),
+        Text(
+          extent={{-32,48},{60,0}},
+          lineColor={0,0,0},
+          textString=
+               "T s + 1"),
+        Text(
+          extent={{-30,-8},{52,-40}},
+          lineColor={0,0,0},
+          textString=
+               "T s"),
+        Line(points={{-24,0},{54,0}}, color={0,0,0})}),
+    Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end PI;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PIsat.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PIsat.mo
index f31d669585632827484ed2b8e5b674e82cc7e2b9..2025f334c229adc812d5c50d722a58441617380c 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PIsat.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PIsat.mo
@@ -1,104 +1,104 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
-block PIsat
-  parameter Real Kp=1 "Gain";
-  parameter Real Ti=1 "Constante de temps";
-  parameter Real initialCond=0 "Condition initiale";
-
-  parameter Real maxval=1 "Valeur maximale de la sortie";
-  parameter Real minval=0 "Valeur minimale de la sortie";
-
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  Math.Add Add1       annotation (Placement(transformation(extent={{-60,-6},{
-            -40,14}}, rotation=0)));
-  PI PI1(
-    k=Kp,
-    Ti=Ti,
-    initialCond=initialCond,
-    SampleOffset=SampleOffset,
-    SampleInterval=SampleInterval) annotation (Placement(transformation(extent=
-            {{-20,-6},{0,14}}, rotation=0)));
-  NonLineaire.Limiteur Limiteur1(maxval=maxval, minval=minval)
-    annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0)));
-  Math.Gain Gain1(Gain=1/Kp)       annotation (Placement(transformation(extent=
-            {{-40,60},{-60,80}}, rotation=0)));
-  Math.Add Add2(k2=-1)       annotation (Placement(transformation(extent={{20,
-            60},{0,80}}, rotation=0)));
-  Pre Pre1(SampleOffset=SampleOffset, SampleInterval=SampleInterval)
-                        annotation (Placement(transformation(
-        origin={-80,38},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-equation
-  connect(u, Add1.u2)
-    annotation (Line(points={{-110,0},{-85.5,0},{-85.5,-2},{-61,-2}}));
-  connect(Add1.y, PI1.u) annotation (Line(points={{-39,4},{-21,4}}));
-  connect(PI1.y, Limiteur1.u) annotation (Line(points={{1,4},{40,4},{40,0},{59,
-          0}}));
-  connect(Limiteur1.y, y) annotation (Line(points={{81,0},{110,0}}));
-  connect(PI1.y, Add2.u2) annotation (Line(points={{1,4},{40,4},{40,64},{21,64}}));
-  connect(Limiteur1.y, Add2.u1)
-    annotation (Line(points={{81,0},{90,0},{90,76},{21,76}}));
-  connect(Gain1.u, Add2.y) annotation (Line(points={{-39,70},{-1,70}}));
-  connect(Gain1.y, Pre1.u) annotation (Line(points={{-61,70},{-80,70},{-80,49}}));
-  connect(Pre1.y, Add1.u1) annotation (Line(points={{-80,27},{-80,10},{-61,10}}));
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-74,64},{-74,-80}}, color={0,0,0}),
-        Line(points={{-74,-80},{70,-80}}, color={0,0,0}),
-        Polygon(
-          points={{92,-80},{70,-72},{70,-88},{92,-80}},
-          lineColor={192,192,192},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-68},{-74,2},{24,42}},
-          color={0,0,255},
-          thickness=0.25),
-        Text(
-          extent={{-32,70},{0,42}},
-          lineColor={160,160,164},
-          textString=
-               "PI"),
-        Line(points={{24,42},{76,42}}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Polygon(
-          points={{-74,86},{-82,64},{-66,64},{-74,86}},
-          lineColor={192,192,192},
-          fillColor={128,128,128},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-36,-34},{54,-74}},
-          lineColor={0,0,0},
-          textString=
-               "Ti=%Ti"),
-        Text(
-          extent={{-38,10},{52,-30}},
-          lineColor={0,0,0},
-          textString=
-               "K=%Kp")}),
-    Window(
-      x=0.16,
-      y=0.19,
-      width=0.72,
-      height=0.79),
-    Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end PIsat;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
+block PIsat
+  parameter Real Kp=1 "Gain";
+  parameter Real Ti=1 "Constante de temps";
+  parameter Real initialCond=0 "Condition initiale";
+
+  parameter Real maxval=1 "Valeur maximale de la sortie";
+  parameter Real minval=0 "Valeur minimale de la sortie";
+
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  Math.Add Add1       annotation (Placement(transformation(extent={{-60,-6},{
+            -40,14}}, rotation=0)));
+  PI PI1(
+    k=Kp,
+    Ti=Ti,
+    initialCond=initialCond,
+    SampleOffset=SampleOffset,
+    SampleInterval=SampleInterval) annotation (Placement(transformation(extent=
+            {{-20,-6},{0,14}}, rotation=0)));
+  NonLineaire.Limiteur Limiteur1(maxval=maxval, minval=minval)
+    annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0)));
+  Math.Gain Gain1(Gain=1/Kp)       annotation (Placement(transformation(extent=
+            {{-40,60},{-60,80}}, rotation=0)));
+  Math.Add Add2(k2=-1)       annotation (Placement(transformation(extent={{20,
+            60},{0,80}}, rotation=0)));
+  Pre Pre1(SampleOffset=SampleOffset, SampleInterval=SampleInterval)
+                        annotation (Placement(transformation(
+        origin={-80,38},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+equation
+  connect(u, Add1.u2)
+    annotation (Line(points={{-110,0},{-85.5,0},{-85.5,-2},{-61,-2}}));
+  connect(Add1.y, PI1.u) annotation (Line(points={{-39,4},{-21,4}}));
+  connect(PI1.y, Limiteur1.u) annotation (Line(points={{1,4},{40,4},{40,0},{59,
+          0}}));
+  connect(Limiteur1.y, y) annotation (Line(points={{81,0},{110,0}}));
+  connect(PI1.y, Add2.u2) annotation (Line(points={{1,4},{40,4},{40,64},{21,64}}));
+  connect(Limiteur1.y, Add2.u1)
+    annotation (Line(points={{81,0},{90,0},{90,76},{21,76}}));
+  connect(Gain1.u, Add2.y) annotation (Line(points={{-39,70},{-1,70}}));
+  connect(Gain1.y, Pre1.u) annotation (Line(points={{-61,70},{-80,70},{-80,49}}));
+  connect(Pre1.y, Add1.u1) annotation (Line(points={{-80,27},{-80,10},{-61,10}}));
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-74,64},{-74,-80}}, color={0,0,0}),
+        Line(points={{-74,-80},{70,-80}}, color={0,0,0}),
+        Polygon(
+          points={{92,-80},{70,-72},{70,-88},{92,-80}},
+          lineColor={192,192,192},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-68},{-74,2},{24,42}},
+          color={0,0,255},
+          thickness=0.25),
+        Text(
+          extent={{-32,70},{0,42}},
+          lineColor={160,160,164},
+          textString=
+               "PI"),
+        Line(points={{24,42},{76,42}}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Polygon(
+          points={{-74,86},{-82,64},{-66,64},{-74,86}},
+          lineColor={192,192,192},
+          fillColor={128,128,128},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-36,-34},{54,-74}},
+          lineColor={0,0,0},
+          textString=
+               "Ti=%Ti"),
+        Text(
+          extent={{-38,10},{52,-30}},
+          lineColor={0,0,0},
+          textString=
+               "K=%Kp")}),
+    Window(
+      x=0.16,
+      y=0.19,
+      width=0.72,
+      height=0.79),
+    Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end PIsat;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PT1.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PT1.mo
index 2089040d3bca40d31339a7b48568d44712e8eb42..63eff0a439faae67a1bfe59a1a18399f02bdb81e 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PT1.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/PT1.mo
@@ -1,105 +1,105 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
-block PT1
-  parameter Real k=1 "Gain";
-  parameter Real Ti=1 "Constante de temps (s)";
-  parameter Real initialCond=0 "Condition initiale";
-
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
-
-protected
-  Real x(start=initialCond);
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-algorithm
-
-  when sample(SampleOffset, SampleInterval) then
-    x := (1 - SampleInterval/Ti)*pre(x) + SampleInterval/Ti*pre(u.signal);
-    y.signal := k*x;
-  end when;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,100},{102,-100}},
-          lineColor={0,0,255},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-80,78},{-80,-90}}, color={128,128,128}),
-        Line(points={{-90,-80},{82,-80}}, color={128,128,128}),
-        Polygon(
-          points={{90,-80},{68,-72},{68,-88},{90,-80}},
-          lineColor={0,0,0},
-          fillColor={128,128,128},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-80},{-70,-45.11},{-60,-19.58},{-50,-0.9087},{-40,
-              12.75},{-30,22.75},{-20,30.06},{-10,35.41},{0,39.33},{10,42.19},{
-              20,44.29},{30,45.82},{40,46.94},{50,47.76},{60,48.36},{70,48.8},{
-              80,49.12}}),
-        Text(
-          extent={{-64,82},{-4,22}},
-          lineColor={192,192,192},
-          textString=
-               "PT1"),
-        Text(
-          extent={{-38,10},{52,-30}},
-          lineColor={0,0,0},
-          textString=
-               "K=%k"),
-        Text(
-          extent={{-36,-34},{54,-74}},
-          lineColor={0,0,0},
-          textString=
-               "Ti=%Ti"),
-        Text(
-          extent={{-64,82},{-4,22}},
-          lineColor={128,128,128},
-          textString=
-               "PT1"),
-        Polygon(
-          points={{-80,94},{-88,72},{-72,72},{-80,94}},
-          lineColor={192,192,192},
-          fillColor={128,128,128},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.14,
-      y=0.3,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-60,52},{60,6}},
-          lineColor={0,0,0},
-          textString=
-               "k"),
-        Text(
-          extent={{-60,0},{60,-60}},
-          lineColor={0,0,0},
-          textString=
-               "T s + 1"),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{62,0},{102,0}}),
-        Line(points={{-50,0},{50,0}}, color={0,0,0})}),
-    Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end PT1;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
+block PT1
+  parameter Real k=1 "Gain";
+  parameter Real Ti=1 "Constante de temps (s)";
+  parameter Real initialCond=0 "Condition initiale";
+
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
+
+protected
+  Real x(start=initialCond);
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+algorithm
+
+  when sample(SampleOffset, SampleInterval) then
+    x := (1 - SampleInterval/Ti)*pre(x) + SampleInterval/Ti*pre(u.signal);
+    y.signal := k*x;
+  end when;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,100},{102,-100}},
+          lineColor={0,0,255},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-80,78},{-80,-90}}, color={128,128,128}),
+        Line(points={{-90,-80},{82,-80}}, color={128,128,128}),
+        Polygon(
+          points={{90,-80},{68,-72},{68,-88},{90,-80}},
+          lineColor={0,0,0},
+          fillColor={128,128,128},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-80},{-70,-45.11},{-60,-19.58},{-50,-0.9087},{-40,
+              12.75},{-30,22.75},{-20,30.06},{-10,35.41},{0,39.33},{10,42.19},{
+              20,44.29},{30,45.82},{40,46.94},{50,47.76},{60,48.36},{70,48.8},{
+              80,49.12}}),
+        Text(
+          extent={{-64,82},{-4,22}},
+          lineColor={192,192,192},
+          textString=
+               "PT1"),
+        Text(
+          extent={{-38,10},{52,-30}},
+          lineColor={0,0,0},
+          textString=
+               "K=%k"),
+        Text(
+          extent={{-36,-34},{54,-74}},
+          lineColor={0,0,0},
+          textString=
+               "Ti=%Ti"),
+        Text(
+          extent={{-64,82},{-4,22}},
+          lineColor={128,128,128},
+          textString=
+               "PT1"),
+        Polygon(
+          points={{-80,94},{-88,72},{-72,72},{-80,94}},
+          lineColor={192,192,192},
+          fillColor={128,128,128},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.14,
+      y=0.3,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-60,52},{60,6}},
+          lineColor={0,0,0},
+          textString=
+               "k"),
+        Text(
+          extent={{-60,0},{60,-60}},
+          lineColor={0,0,0},
+          textString=
+               "T s + 1"),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{62,0},{102,0}}),
+        Line(points={{-50,0},{50,0}}, color={0,0,0})}),
+    Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end PT1;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/Pre.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/Pre.mo
index 3b81c52b8a03ae4083f58848bac383d83f7fad19..ce6303fc0942c785a4691bbe3d4d6defc318445a 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/Pre.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/Pre.mo
@@ -1,80 +1,80 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
-block Pre
-  parameter Real Gain=1 "Gain";
-  parameter Real initialCond=0 "Condition initiale";
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
-
-protected
-  Real x(start=initialCond);
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-algorithm
-
-  when sample(SampleOffset, SampleInterval) then
-    x := u.signal;
-  end when;
-
-  when sample(SampleOffset, SampleInterval) then
-    y.signal := Gain*pre(x);
-  end when;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-60,0},{60,0}},
-          color={0,0,0},
-          thickness=0.5),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Text(
-          extent={{-55,55},{55,5}},
-          lineColor={0,0,0},
-          textString=
-               "1"),
-        Text(
-          extent={{-55,-5},{55,-55}},
-          lineColor={0,0,0},
-          textString=
-               "z")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(extent={{-60,60},{60,-60}}, lineColor={0,0,255}),
-        Line(points={{-100,0},{-60,0}}, color={0,0,255}),
-        Line(points={{60,0},{100,0}}, color={0,0,255}),
-        Line(points={{40,0},{-40,0}}, color={0,0,0}),
-        Text(
-          extent={{-55,55},{55,5}},
-          lineColor={0,0,0},
-          textString=
-               "1"),
-        Text(
-          extent={{-55,-5},{55,-55}},
-          lineColor={0,0,0},
-          textString=
-               "z")}),
-    Window(
-      x=0.23,
-      y=0.2,
-      width=0.65,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Pre;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Discret;
+block Pre
+  parameter Real Gain=1 "Gain";
+  parameter Real initialCond=0 "Condition initiale";
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
+
+protected
+  Real x(start=initialCond);
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+algorithm
+
+  when sample(SampleOffset, SampleInterval) then
+    x := u.signal;
+  end when;
+
+  when sample(SampleOffset, SampleInterval) then
+    y.signal := Gain*pre(x);
+  end when;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-60,0},{60,0}},
+          color={0,0,0},
+          thickness=0.5),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Text(
+          extent={{-55,55},{55,5}},
+          lineColor={0,0,0},
+          textString=
+               "1"),
+        Text(
+          extent={{-55,-5},{55,-55}},
+          lineColor={0,0,0},
+          textString=
+               "z")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(extent={{-60,60},{60,-60}}, lineColor={0,0,255}),
+        Line(points={{-100,0},{-60,0}}, color={0,0,255}),
+        Line(points={{60,0},{100,0}}, color={0,0,255}),
+        Line(points={{40,0},{-40,0}}, color={0,0,0}),
+        Text(
+          extent={{-55,55},{55,5}},
+          lineColor={0,0,0},
+          textString=
+               "1"),
+        Text(
+          extent={{-55,-5},{55,-55}},
+          lineColor={0,0,0},
+          textString=
+               "z")}),
+    Window(
+      x=0.23,
+      y=0.2,
+      width=0.65,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Pre;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/package.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/package.mo
index 5781e08cea0de80675d275fdab10ee0f0d364072..2e2857bd56141429d4eeabcafa146a50b46020a3 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Discret/package.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks;
-package Discret
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Discret;
+within ThermoSysPro.InstrumentationAndControl.Blocks;
+package Discret
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Discret;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Edge.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Edge.mo
index d013fed6549100c7000edd48b22f71cd0bad563c..e72ccc882031a280919528eb0b055effeb20dbb0 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Edge.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Edge.mo
@@ -1,50 +1,50 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
-block Edge
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uL(signal(start=false, fixed=true))
-                                          annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                           annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-algorithm
-  yL.signal := edge(uL.signal);
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Text(
-          extent={{-40,28},{46,-24}},
-          lineColor={0,0,0},
-          textString=
-               "Edge")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,102}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25,
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-40,28},{46,-24}},
-          lineColor={0,0,0},
-          textString=
-               "Edge")}),
-    Window(
-      x=0.13,
-      y=0.28,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Edge;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
+block Edge
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uL(signal(start=false, fixed=true))
+                                          annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                           annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+algorithm
+  yL.signal := edge(uL.signal);
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Text(
+          extent={{-40,28},{46,-24}},
+          lineColor={0,0,0},
+          textString=
+               "Edge")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,102}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25,
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-40,28},{46,-24}},
+          lineColor={0,0,0},
+          textString=
+               "Edge")}),
+    Window(
+      x=0.13,
+      y=0.28,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Edge;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Pre.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Pre.mo
index e9e5a3287e4bf7d91bbddc9c07fce7091d755935..4c81b64c28f833c3f7092c34777d1c17959c382e 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Pre.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Pre.mo
@@ -1,49 +1,49 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
-block Pre
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uL(signal(start=false, fixed=true))
-                                          annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                           annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-algorithm
-
-  yL.signal := pre(uL.signal);
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Text(
-          extent={{-40,28},{46,-24}},
-          lineColor={0,0,0},
-          textString=
-               "PRE")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,102}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25,
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-40,28},{46,-24}},
-          lineColor={0,0,0},
-          textString=
-               "PRE")}),
-    Window(
-      x=0.3,
-      y=0.16,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Pre;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
+block Pre
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uL(signal(start=false, fixed=true))
+                                          annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                           annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+algorithm
+
+  yL.signal := pre(uL.signal);
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Text(
+          extent={{-40,28},{46,-24}},
+          lineColor={0,0,0},
+          textString=
+               "PRE")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,102}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25,
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-40,28},{46,-24}},
+          lineColor={0,0,0},
+          textString=
+               "PRE")}),
+    Window(
+      x=0.3,
+      y=0.16,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Pre;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Pulse.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Pulse.mo
index 639c56ea033ce61e2cb0620356bc005ef7603e14..65b00869519d46faa590bd9b84eae2a789ac59da 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Pulse.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Pulse.mo
@@ -1,174 +1,174 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
-block Pulse
-  parameter Real width=0.5 "Largeur des impulsions (s)";
-  parameter Real period=1 "Periode des impulsions (s)";
-  parameter Real startTime=0 "Instant de départ des impulsions";
-
-protected
-  Real T0;
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                           annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-algorithm
-
-  when sample(startTime, period) then
-    T0 := time;
-  end when;
-
-  yL.signal := (if time < startTime or time >= T0 + width then false else true);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-70},{-40,-70},{-40,44},{0,44},{0,-70},{40,-70},{40,
-              44},{79,44}}, color={0,0,0}),
-        Rectangle(
-          extent={{-100,-102},{100,100}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25,
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-70},{-40,-70},{-40,44},{0,44},{0,-70},{40,-70},{40,
-              44},{79,44}}, color={0,0,0}),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={160,160,164},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-60,-72},{-14,-90}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Text(
-          extent={{-82,91},{-41,71}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{70,-80},{94,-100}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(
-          points={{-78,-70},{-40,-70},{-40,20},{20,20},{20,-70},{50,-70},{50,20},
-              {100,20}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-40,61},{-40,21}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{20,44},{20,20}},
-          color={160,160,164},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{50,58},{50,20}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(points={{-40,53},{50,53}}, color={192,192,192}),
-        Line(points={{-40,35},{20,35}}, color={192,192,192}),
-        Text(
-          extent={{-30,67},{16,55}},
-          lineColor={160,160,164},
-          textString=
-               "period"),
-        Text(
-          extent={{-35,49},{14,37}},
-          lineColor={160,160,164},
-          textString=
-               "width"),
-        Line(
-          points={{-80,20},{-41,20}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Polygon(
-          points={{-40,35},{-31,37},{-31,33},{-40,35}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{20,35},{12,37},{12,33},{20,35}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-40,53},{-31,55},{-31,51},{-40,53}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{50,53},{42,55},{42,51},{50,53}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-109,28},{-77,14}},
-          lineColor={160,160,164},
-          textString=
-               "true"),
-        Text(
-          extent={{-101,-56},{-80,-71}},
-          lineColor={160,160,164},
-          textString=
-               "false")}),
-    Window(
-      x=0.09,
-      y=0.3,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Pulse;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
+block Pulse
+  parameter Real width=0.5 "Largeur des impulsions (s)";
+  parameter Real period=1 "Periode des impulsions (s)";
+  parameter Real startTime=0 "Instant de départ des impulsions";
+
+protected
+  Real T0;
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                           annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+algorithm
+
+  when sample(startTime, period) then
+    T0 := time;
+  end when;
+
+  yL.signal := (if time < startTime or time >= T0 + width then false else true);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-70},{-40,-70},{-40,44},{0,44},{0,-70},{40,-70},{40,
+              44},{79,44}}, color={0,0,0}),
+        Rectangle(
+          extent={{-100,-102},{100,100}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25,
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-70},{-40,-70},{-40,44},{0,44},{0,-70},{40,-70},{40,
+              44},{79,44}}, color={0,0,0}),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={160,160,164},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-60,-72},{-14,-90}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Text(
+          extent={{-82,91},{-41,71}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{70,-80},{94,-100}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(
+          points={{-78,-70},{-40,-70},{-40,20},{20,20},{20,-70},{50,-70},{50,20},
+              {100,20}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-40,61},{-40,21}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{20,44},{20,20}},
+          color={160,160,164},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{50,58},{50,20}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(points={{-40,53},{50,53}}, color={192,192,192}),
+        Line(points={{-40,35},{20,35}}, color={192,192,192}),
+        Text(
+          extent={{-30,67},{16,55}},
+          lineColor={160,160,164},
+          textString=
+               "period"),
+        Text(
+          extent={{-35,49},{14,37}},
+          lineColor={160,160,164},
+          textString=
+               "width"),
+        Line(
+          points={{-80,20},{-41,20}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Polygon(
+          points={{-40,35},{-31,37},{-31,33},{-40,35}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{20,35},{12,37},{12,33},{20,35}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-40,53},{-31,55},{-31,51},{-40,53}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{50,53},{42,55},{42,51},{50,53}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-109,28},{-77,14}},
+          lineColor={160,160,164},
+          textString=
+               "true"),
+        Text(
+          extent={{-101,-56},{-80,-71}},
+          lineColor={160,160,164},
+          textString=
+               "false")}),
+    Window(
+      x=0.09,
+      y=0.3,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Pulse;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/SampleTrigger.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/SampleTrigger.mo
index ac37d3f49d8fb5ec3c56c0d2717367d20c4d2b8a..cc410728892aa24d10cc1f34b7027a58beafb55f 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/SampleTrigger.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/SampleTrigger.mo
@@ -1,159 +1,159 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
-block SampleTrigger
-  parameter Real period=1 "Periode des impulsions (s)";
-  parameter Real startTime=0 "Instant de départ des impulsions";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                           annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-algorithm
-
-  yL.signal := sample(startTime, period);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-70},{-40,-70},{-40,44},{0,44},{0,-70},{40,-70},{40,
-              44},{79,44}}, color={0,0,0}),
-        Rectangle(
-          extent={{-100,-102},{100,100}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25,
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={160,160,164},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-60,-70},{-60,70}}, color={0,0,0}),
-        Line(points={{-20,-70},{-20,70}}, color={0,0,0}),
-        Line(points={{20,-70},{20,70}}, color={0,0,0}),
-        Line(points={{60,-70},{60,70}}, color={0,0,0})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-53,-71},{-7,-89}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Text(
-          extent={{-82,91},{-41,71}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{70,-80},{94,-100}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(
-          points={{-30,47},{-30,19}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{0,47},{0,18}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(points={{-30,41},{0,41}}, color={192,192,192}),
-        Text(
-          extent={{-37,61},{9,49}},
-          lineColor={160,160,164},
-          textString=
-               "period"),
-        Line(
-          points={{-80,19},{-30,19}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Polygon(
-          points={{-30,41},{-21,43},{-21,39},{-30,41}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,41},{-8,43},{-8,39},{0,41}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-100,28},{-80,13}},
-          lineColor={160,160,164},
-          textString=
-               "true"),
-        Text(
-          extent={{-100,-56},{-80,-71}},
-          lineColor={160,160,164},
-          textString=
-               "false"),
-        Line(
-          points={{0,-70},{0,19}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-30,-70},{-30,19}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{30,-70},{30,19}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{60,-70},{60,19}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Window(
-      x=0.05,
-      y=0.32,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end SampleTrigger;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
+block SampleTrigger
+  parameter Real period=1 "Periode des impulsions (s)";
+  parameter Real startTime=0 "Instant de départ des impulsions";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                           annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+algorithm
+
+  yL.signal := sample(startTime, period);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-70},{-40,-70},{-40,44},{0,44},{0,-70},{40,-70},{40,
+              44},{79,44}}, color={0,0,0}),
+        Rectangle(
+          extent={{-100,-102},{100,100}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25,
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={160,160,164},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-60,-70},{-60,70}}, color={0,0,0}),
+        Line(points={{-20,-70},{-20,70}}, color={0,0,0}),
+        Line(points={{20,-70},{20,70}}, color={0,0,0}),
+        Line(points={{60,-70},{60,70}}, color={0,0,0})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-53,-71},{-7,-89}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Text(
+          extent={{-82,91},{-41,71}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{70,-80},{94,-100}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(
+          points={{-30,47},{-30,19}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{0,47},{0,18}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(points={{-30,41},{0,41}}, color={192,192,192}),
+        Text(
+          extent={{-37,61},{9,49}},
+          lineColor={160,160,164},
+          textString=
+               "period"),
+        Line(
+          points={{-80,19},{-30,19}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Polygon(
+          points={{-30,41},{-21,43},{-21,39},{-30,41}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,41},{-8,43},{-8,39},{0,41}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-100,28},{-80,13}},
+          lineColor={160,160,164},
+          textString=
+               "true"),
+        Text(
+          extent={{-100,-56},{-80,-71}},
+          lineColor={160,160,164},
+          textString=
+               "false"),
+        Line(
+          points={{0,-70},{0,19}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-30,-70},{-30,19}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{30,-70},{30,19}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{60,-70},{60,19}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Window(
+      x=0.05,
+      y=0.32,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end SampleTrigger;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Terminate.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Terminate.mo
index fc062a3ca7a5a1fda2808d6ca906688fd1b421a7..7e98a72b55cacf8ac31abe2aeb25af0be0600e62 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Terminate.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/Terminate.mo
@@ -1,54 +1,54 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
-block Terminate
-  parameter String message="End of simulation";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uL
-                                          annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-algorithm
-
-  when uL.signal then
-    terminate(message);
-  end when;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-80,0},{40,0}}),
-        Line(points={{40,40},{40,-40}}),
-        Rectangle(
-          extent={{-100,-100},{100,102}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25,
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Polygon(points={{-70,-20},{-70,40},{-30,80},{30,80},{70,40},{70,-20},{
-              30,-60},{-30,-60},{-70,-20}}, lineColor={0,0,0}),
-        Text(
-          extent={{-48,40},{50,-20}},
-          lineColor={0,0,0},
-          textString=
-               "STOP")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(points={{-70,-20},{-70,40},{-30,80},{30,
-              80},{70,40},{70,-20},{30,-60},{-30,-60},{-70,-20}}, lineColor={0,
-              0,0}), Text(
-          extent={{-48,40},{50,-20}},
-          lineColor={0,0,0},
-          textString=
-               "STOP")}),
-    Window(
-      x=0.25,
-      y=0.16,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Version 4.0</b> </p>
-</html>"));
-end Terminate;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Logique;
+block Terminate
+  parameter String message="End of simulation";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uL
+                                          annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+algorithm
+
+  when uL.signal then
+    terminate(message);
+  end when;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-80,0},{40,0}}),
+        Line(points={{40,40},{40,-40}}),
+        Rectangle(
+          extent={{-100,-100},{100,102}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25,
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Polygon(points={{-70,-20},{-70,40},{-30,80},{30,80},{70,40},{70,-20},{
+              30,-60},{-30,-60},{-70,-20}}, lineColor={0,0,0}),
+        Text(
+          extent={{-48,40},{50,-20}},
+          lineColor={0,0,0},
+          textString=
+               "STOP")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(points={{-70,-20},{-70,40},{-30,80},{30,
+              80},{70,40},{70,-20},{30,-60},{-30,-60},{-70,-20}}, lineColor={0,
+              0,0}), Text(
+          extent={{-48,40},{50,-20}},
+          lineColor={0,0,0},
+          textString=
+               "STOP")}),
+    Window(
+      x=0.25,
+      y=0.16,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Version 4.0</b> </p>
+</html>"));
+end Terminate;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/package.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/package.mo
index 5ce0413149c946a80757233b8c6709068fff051b..bb2678ef447b420c631f8d92512d03da700f5203 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Logique/package.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks;
-package Logique
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Logique;
+within ThermoSysPro.InstrumentationAndControl.Blocks;
+package Logique
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Logique;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/BooleanToReal.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/BooleanToReal.mo
new file mode 100644
index 0000000000000000000000000000000000000000..7aa7d853b52fbf85ea658d95ad9ae7a95255be13
--- /dev/null
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/BooleanToReal.mo
@@ -0,0 +1,23 @@
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block BooleanToReal
+  parameter Real realTrue=1.0;
+  parameter Real realFalse=0.0;
+
+  Connectors.InputLogical u
+    annotation (Placement(transformation(extent={{-120,0},{-100,20}}), iconTransformation(
+          extent={{-120,0},{-100,20}})));
+  Connectors.OutputReal y annotation (Placement(transformation(extent={{100,2},{120,22}}),
+        iconTransformation(extent={{100,2},{120,22}})));
+equation
+  y.signal= if u.signal then realTrue else realFalse;
+
+
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
+        Rectangle(
+          extent={{-100,-100},{102,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(extent={{-80,82},{80,-78}})}),                   Diagram(coordinateSystem(
+          preserveAspectRatio=false)));
+end BooleanToReal;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/EgEntier.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/EgEntier.mo
index 8c79b37bc38bd57b39aed0851951c5f6514a352d..3cfa144ad6ae95bbe28e7dffaef0686a556dd59c 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/EgEntier.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/EgEntier.mo
@@ -1,103 +1,103 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block EgEntier
-  parameter Integer C1=1 "Valeur de u1 si u1 non connecté";
-  parameter Integer C2=2 "Valeur de u2 si u2 non connecté";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                     annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
-                                          annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
-                                          annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-equation
-
-  if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  yL.signal = (u1.signal == u2.signal);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               "=="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.27,
-      y=0.13,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-40,34},{36,-34}},
-          lineColor={0,0,0},
-          textString=
-               "=="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end EgEntier;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block EgEntier
+  parameter Integer C1=1 "Valeur de u1 si u1 non connecté";
+  parameter Integer C2=2 "Valeur de u2 si u2 non connecté";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                     annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
+                                          annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
+                                          annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+equation
+
+  if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  yL.signal = (u1.signal == u2.signal);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               "=="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.27,
+      y=0.13,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-40,34},{36,-34}},
+          lineColor={0,0,0},
+          textString=
+               "=="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end EgEntier;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Feedback.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Feedback.mo
index 6aeeb2ec856bbe61f41330c79af4e00dc6e904fc..5c8752967ce4c548e05a981d3fd140afd9d9832f 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Feedback.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Feedback.mo
@@ -1,83 +1,83 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block Feedback "Différence entre la commande et le feedback"
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-    annotation (Placement(transformation(extent={{100,-10},{120,10}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
-    annotation (Placement(transformation(extent={{-120,-10},{-100,10}},
-          rotation=0)));
-equation
-  y.signal = u1.signal - u2.signal;
-  annotation (
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"), Icon(graphics={
-        Ellipse(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25,
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-100,0},{-20,0}}),
-        Line(points={{20,0},{100,0}}),
-        Line(points={{0,-20},{0,-100}}),
-        Text(
-          extent={{-16,-18},{44,-52}},
-          lineColor={0,0,255},
-          textString=
-               "-"),
-        Text(
-          extent={{-56,4},{-6,-24}},
-          lineColor={0,0,255},
-          textString=
-               "+"),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name")}),
-    Diagram(graphics={
-        Ellipse(
-          extent={{-20,20},{20,-20}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25,
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-100,0},{-20,0}}),
-        Line(points={{20,0},{100,0}}),
-        Line(points={{0,-20},{0,-100}}),
-        Text(
-          extent={{-54,2},{-4,-26}},
-          lineColor={0,0,255},
-          textString=
-               "+"),
-        Text(
-          extent={{-14,-20},{46,-54}},
-          lineColor={0,0,255},
-          textString=
-               "-"),
-        Text(
-          extent={{-100,26},{-72,10}},
-          lineColor={0,0,255},
-          textString=
-               "u1"),
-        Text(
-          extent={{4,-84},{42,-94}},
-          lineColor={0,0,255},
-          textString=
-               "u2"),
-        Text(
-          extent={{70,26},{98,10}},
-          lineColor={0,0,255},
-          textString=
-               "y")}));
-end Feedback;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block Feedback "Différence entre la commande et le feedback"
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+    annotation (Placement(transformation(extent={{100,-10},{120,10}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
+    annotation (Placement(transformation(extent={{-120,-10},{-100,10}},
+          rotation=0)));
+equation
+  y.signal = u1.signal - u2.signal;
+  annotation (
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"), Icon(graphics={
+        Ellipse(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25,
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-100,0},{-20,0}}),
+        Line(points={{20,0},{100,0}}),
+        Line(points={{0,-20},{0,-100}}),
+        Text(
+          extent={{-16,-18},{44,-52}},
+          lineColor={0,0,255},
+          textString=
+               "-"),
+        Text(
+          extent={{-56,4},{-6,-24}},
+          lineColor={0,0,255},
+          textString=
+               "+"),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name")}),
+    Diagram(graphics={
+        Ellipse(
+          extent={{-20,20},{20,-20}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25,
+          fillColor={235,235,235},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-100,0},{-20,0}}),
+        Line(points={{20,0},{100,0}}),
+        Line(points={{0,-20},{0,-100}}),
+        Text(
+          extent={{-54,2},{-4,-26}},
+          lineColor={0,0,255},
+          textString=
+               "+"),
+        Text(
+          extent={{-14,-20},{46,-54}},
+          lineColor={0,0,255},
+          textString=
+               "-"),
+        Text(
+          extent={{-100,26},{-72,10}},
+          lineColor={0,0,255},
+          textString=
+               "u1"),
+        Text(
+          extent={{4,-84},{42,-94}},
+          lineColor={0,0,255},
+          textString=
+               "u2"),
+        Text(
+          extent={{70,26},{98,10}},
+          lineColor={0,0,255},
+          textString=
+               "y")}));
+end Feedback;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Inf.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Inf.mo
index 7e6d6fcad0bd7cec399f45cedf0f8c14324eb436..1810e8c16dd786cb149a2ced3348724008b8cb1f 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Inf.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Inf.mo
@@ -1,102 +1,102 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block Inf
-  parameter Real C1=0 "Valeur de u1 si u1 non connecté";
-  parameter Real C2=0 "Valeur de u2 si u2 non connecté";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
-                                       annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
-                                       annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                           annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-   if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  yL.signal = (u1.signal < u2.signal);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               "<"),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.27,
-      y=0.13,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               "<"),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end Inf;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block Inf
+  parameter Real C1=0 "Valeur de u1 si u1 non connecté";
+  parameter Real C2=0 "Valeur de u2 si u2 non connecté";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
+                                       annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
+                                       annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                           annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+   if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  yL.signal = (u1.signal < u2.signal);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               "<"),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.27,
+      y=0.13,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               "<"),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end Inf;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/InfEntier.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/InfEntier.mo
index 1b8d80785fb9253f075fc5d9f8972a0833fdaa80..ee2b04841d8a1ad677271392bec127687dc4680c 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/InfEntier.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/InfEntier.mo
@@ -1,103 +1,103 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block InfEntier
-  parameter Integer C1=0 "Valeur de u1 si u1 non connecté";
-  parameter Integer C2=0 "Valeur de u2 si u2 non connecté";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                     annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
-                                          annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
-                                          annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-equation
-
-  if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  yL.signal = (u1.signal < u2.signal);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               "<"),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.27,
-      y=0.13,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               "<"),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end InfEntier;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block InfEntier
+  parameter Integer C1=0 "Valeur de u1 si u1 non connecté";
+  parameter Integer C2=0 "Valeur de u2 si u2 non connecté";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                     annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
+                                          annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
+                                          annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+equation
+
+  if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  yL.signal = (u1.signal < u2.signal);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               "<"),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.27,
+      y=0.13,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               "<"),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end InfEntier;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Infeg.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Infeg.mo
index 584dfbf7a63141e836047f1aea5dc8e543ba051f..202c503cbd1ca39eb6203066269fa9d3f7e619c1 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Infeg.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Infeg.mo
@@ -1,102 +1,102 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block Infeg
-  parameter Real C1=0 "Valeur de u1 si u1 non connecté";
-  parameter Real C2=0 "Valeur de u2 si u2 non connecté";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
-                                       annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
-                                       annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                           annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-   if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  yL.signal = (u1.signal <= u2.signal);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               "<="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.27,
-      y=0.13,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               "<="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end Infeg;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block Infeg
+  parameter Real C1=0 "Valeur de u1 si u1 non connecté";
+  parameter Real C2=0 "Valeur de u2 si u2 non connecté";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
+                                       annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
+                                       annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                           annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+   if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  yL.signal = (u1.signal <= u2.signal);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               "<="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.27,
+      y=0.13,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               "<="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end Infeg;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/InfegEntier.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/InfegEntier.mo
index 7ca199154485cfac3a65b3db40d8affba208471a..f1c81d12461aaea68fa4da9b38482ef677240027 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/InfegEntier.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/InfegEntier.mo
@@ -1,103 +1,103 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block InfegEntier
-  parameter Integer C1=0 "Valeur de u1 si u1 non connecté";
-  parameter Integer C2=0 "Valeur de u2 si u2 non connecté";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                     annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
-                                          annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
-                                          annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-equation
-
-  if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  yL.signal = (u1.signal <= u2.signal);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               "<="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.27,
-      y=0.13,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-40,34},{36,-34}},
-          lineColor={0,0,0},
-          textString=
-               "<="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end InfegEntier;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block InfegEntier
+  parameter Integer C1=0 "Valeur de u1 si u1 non connecté";
+  parameter Integer C2=0 "Valeur de u2 si u2 non connecté";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                     annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
+                                          annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
+                                          annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+equation
+
+  if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  yL.signal = (u1.signal <= u2.signal);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               "<="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.27,
+      y=0.13,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-40,34},{36,-34}},
+          lineColor={0,0,0},
+          textString=
+               "<="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end InfegEntier;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Sup.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Sup.mo
index 2a4f6bd3446f21f2873fc806a774f2e21c4239d5..342dd4255a0deadd76e5a18fb0177a68ee2d8510 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Sup.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Sup.mo
@@ -1,99 +1,99 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block Sup
-  parameter Real C1=0 "Valeur de u1 si u1 non connecté";
-  parameter Real C2=0 "Valeur de u2 si u2 non connecté";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
-                                       annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
-                                       annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                           annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-   if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  yL.signal = (u1.signal > u2.signal);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               ">"),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.27,
-      y=0.17,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               ">"),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Documentation(info="<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end Sup;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block Sup
+  parameter Real C1=0 "Valeur de u1 si u1 non connecté";
+  parameter Real C2=0 "Valeur de u2 si u2 non connecté";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
+                                       annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
+                                       annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                           annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+   if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  yL.signal = (u1.signal > u2.signal);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               ">"),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.27,
+      y=0.17,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               ">"),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Documentation(info="<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end Sup;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/SupEntier.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/SupEntier.mo
index c60e4653e8d3e82900f94ecf08685dd823d700c8..f5fc10ebbe48e0da5ffe690aad841fb05afc34f4 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/SupEntier.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/SupEntier.mo
@@ -1,103 +1,103 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block SupEntier
-  parameter Integer C1=0 "Valeur de u1 si u1 non connecté";
-  parameter Integer C2=0 "Valeur de u2 si u2 non connecté";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                     annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
-                                          annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
-                                          annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-equation
-
-  if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  yL.signal = (u1.signal > u2.signal);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               ">"),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.27,
-      y=0.13,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               ">"),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end SupEntier;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block SupEntier
+  parameter Integer C1=0 "Valeur de u1 si u1 non connecté";
+  parameter Integer C2=0 "Valeur de u2 si u2 non connecté";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                     annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
+                                          annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
+                                          annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+equation
+
+  if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  yL.signal = (u1.signal > u2.signal);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               ">"),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.27,
+      y=0.13,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               ">"),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end SupEntier;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Supeg.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Supeg.mo
index 4e1c56a30e162a3f80c03d848d216d11eb4f04aa..5c11cf65c7c963abba8c66446df2bab905b4bed2 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Supeg.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/Supeg.mo
@@ -1,99 +1,99 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block Supeg
-  parameter Real C1=0 "Valeur de u1 si u1 non connecté";
-  parameter Real C2=0 "Valeur de u2 si u2 non connecté";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
-                                       annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
-                                       annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                           annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-   if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  yL.signal = (u1.signal >= u2.signal);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               ">="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.27,
-      y=0.17,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               ">="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Documentation(info="<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end Supeg;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block Supeg
+  parameter Real C1=0 "Valeur de u1 si u1 non connecté";
+  parameter Real C2=0 "Valeur de u2 si u2 non connecté";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
+                                       annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
+                                       annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                           annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+   if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  yL.signal = (u1.signal >= u2.signal);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               ">="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.27,
+      y=0.17,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               ">="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Documentation(info="<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end Supeg;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/SupegEntier.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/SupegEntier.mo
index fd60757aa5ac8a591e523589e9b35281cbec0c6d..a8b4f5852b2736892cdbdd28a51863bacc31440a 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/SupegEntier.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/SupegEntier.mo
@@ -1,103 +1,103 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
-block SupegEntier
-  parameter Integer C1=0 "Valeur de u1 si u1 non connecté";
-  parameter Integer C2=0 "Valeur de u2 si u2 non connecté";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-                                     annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
-                                          annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
-                                          annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-equation
-
-  if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  yL.signal = (u1.signal >= u2.signal);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-36,34},{40,-34}},
-          lineColor={0,0,0},
-          textString=
-               ">="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.27,
-      y=0.13,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{100,0}}),
-        Ellipse(extent={{-80,80},{80,-80}}),
-        Line(points={{-100,60},{-52,60}}),
-        Line(points={{-100,-60},{-52,-60}}),
-        Text(
-          extent={{-40,34},{36,-34}},
-          lineColor={0,0,0},
-          textString=
-               ">="),
-        Text(
-          extent={{-100,100},{-38,68}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-68},{-38,-100}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end SupegEntier;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Math;
+block SupegEntier
+  parameter Integer C1=0 "Valeur de u1 si u1 non connecté";
+  parameter Integer C2=0 "Valeur de u2 si u2 non connecté";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+                                     annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
+                                          annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
+                                          annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+equation
+
+  if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  yL.signal = (u1.signal >= u2.signal);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-36,34},{40,-34}},
+          lineColor={0,0,0},
+          textString=
+               ">="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.27,
+      y=0.13,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{100,0}}),
+        Ellipse(extent={{-80,80},{80,-80}}),
+        Line(points={{-100,60},{-52,60}}),
+        Line(points={{-100,-60},{-52,-60}}),
+        Text(
+          extent={{-40,34},{36,-34}},
+          lineColor={0,0,0},
+          textString=
+               ">="),
+        Text(
+          extent={{-100,100},{-38,68}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-68},{-38,-100}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Math library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end SupegEntier;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/package.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/package.mo
index 850e3f58e9acd8611091a2daf4c8f2eb72c448c4..3fcfa42c64d0fa19e68cccfb70a698a10c8bf6dc 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/package.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks;
-package Math "Bibliothèque de blocs mathématiques"
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Math;
+within ThermoSysPro.InstrumentationAndControl.Blocks;
+package Math "Bibliothèque de blocs mathématiques"
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Math;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/package.order b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/package.order
index b8c3110fc38d40d8320df28dd2ee85378a8dece3..a277b6c95175a87d813713cbe3e6fee171701fab 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Math/package.order
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Math/package.order
@@ -27,3 +27,4 @@ Supeg
 SupegEntier
 SupEntier
 Tan
+BooleanToReal
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/BandeMorte.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/BandeMorte.mo
index 33a663e0c34dac135a4893f85f593dad7bbc567f..17501921add88b86f621104fc8dcc925f7267216 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/BandeMorte.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/BandeMorte.mo
@@ -1,90 +1,90 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
-block BandeMorte
-  parameter Real uMax=1 "Limite supérieure de la bande morte";
-  parameter Real uMin=-uMax "Limite inférieure de la bande morte";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  y.signal = if (u.signal) > uMax then u.signal - uMax else if (u.signal < uMin) then
-          u.signal - uMin else 0;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{0,-90},{0,68}}, color={192,192,192}),
-        Polygon(
-          points={{0,90},{-8,68},{8,68},{0,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,0},{68,0}}, color={192,192,192}),
-        Polygon(
-          points={{90,0},{68,-8},{68,8},{90,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-60},{-20,0},{20,0},{80,60}}, color={0,0,0})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,-60},{0,50}}, color={192,192,192}),
-        Polygon(
-          points={{0,60},{-5,50},{5,50},{0,60}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-76,0},{74,0}}, color={192,192,192}),
-        Polygon(
-          points={{84,0},{74,-5},{74,5},{84,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-81,-40},{-38,0},{40,0},{80,40}}, color={0,0,0}),
-        Text(
-          extent={{62,-5},{88,-23}},
-          lineColor={128,128,128},
-          textString=
-               "u"),
-        Text(
-          extent={{-34,68},{-3,46}},
-          lineColor={128,128,128},
-          textString=
-               "y"),
-        Text(
-          extent={{-51,1},{-28,19}},
-          lineColor={128,128,128},
-          textString=
-               "uMin"),
-        Text(
-          extent={{27,21},{52,5}},
-          lineColor={128,128,128},
-          textString=
-               "uMax")}),
-    Window(
-      x=0.05,
-      y=0.3,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.NonLinear library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end BandeMorte;
+within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
+block BandeMorte
+  parameter Real uMax=1 "Limite supérieure de la bande morte";
+  parameter Real uMin=-uMax "Limite inférieure de la bande morte";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  y.signal = if (u.signal) > uMax then u.signal - uMax else if (u.signal < uMin) then
+          u.signal - uMin else 0;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{0,-90},{0,68}}, color={192,192,192}),
+        Polygon(
+          points={{0,90},{-8,68},{8,68},{0,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,0},{68,0}}, color={192,192,192}),
+        Polygon(
+          points={{90,0},{68,-8},{68,8},{90,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-60},{-20,0},{20,0},{80,60}}, color={0,0,0})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,-60},{0,50}}, color={192,192,192}),
+        Polygon(
+          points={{0,60},{-5,50},{5,50},{0,60}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-76,0},{74,0}}, color={192,192,192}),
+        Polygon(
+          points={{84,0},{74,-5},{74,5},{84,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-81,-40},{-38,0},{40,0},{80,40}}, color={0,0,0}),
+        Text(
+          extent={{62,-5},{88,-23}},
+          lineColor={128,128,128},
+          textString=
+               "u"),
+        Text(
+          extent={{-34,68},{-3,46}},
+          lineColor={128,128,128},
+          textString=
+               "y"),
+        Text(
+          extent={{-51,1},{-28,19}},
+          lineColor={128,128,128},
+          textString=
+               "uMin"),
+        Text(
+          extent={{27,21},{52,5}},
+          lineColor={128,128,128},
+          textString=
+               "uMax")}),
+    Window(
+      x=0.05,
+      y=0.3,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.NonLinear library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end BandeMorte;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Hysteresis.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Hysteresis.mo
new file mode 100644
index 0000000000000000000000000000000000000000..ade2d33471cf36881f4e53da61e067838c9978e4
--- /dev/null
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Hysteresis.mo
@@ -0,0 +1,59 @@
+within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
+block Hysteresis
+
+  parameter Real uMax=1 "Maximum value of the hysteresis interval";
+  parameter Real uMin=0 "Minimum value of the hysteresis interval";
+
+  Connectors.InputReal u
+ annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
+  Connectors.OutputLogical y
+ annotation (Placement(transformation(extent={{100,-12},{120,8}})));
+initial equation
+ y.signal=if (u.signal > (uMin+uMax)/2) then false else true;
+
+algorithm
+when u.signal > uMax then
+    y.signal:=false;
+  end when;
+when u.signal < uMin then
+  y.signal:=true;
+end when;
+
+  annotation (Icon(graphics={
+     Rectangle(
+       extent={{-100,-100},{100,100}},
+       lineColor={0,0,255},
+       pattern=LinePattern.Solid,
+       lineThickness=0.25,
+       fillColor={255,255,255},
+       fillPattern=FillPattern.Solid),
+     Line(points={{-86,0},{88,0}}, color={192,192,192}),
+     Line(points={{0,-78},{0,76}}, color={192,192,192}),
+     Polygon(
+       points={{0,88},{-5,78},{5,78},{0,88}},
+       lineColor={192,192,192},
+       fillColor={192,192,192},
+       fillPattern=FillPattern.Solid),
+     Polygon(
+       points={{90,0},{80,-5},{80,5},{90,0}},
+       lineColor={192,192,192},
+       fillColor={192,192,192},
+       fillPattern=FillPattern.Solid),
+     Rectangle(
+       extent={{-22,60},{26,0}},
+       lineColor={0,0,0},
+       fillColor={236,236,236},
+       fillPattern=FillPattern.Solid),
+     Line(points={{-24,32},{-22,34},{-20,32}}, color={0,0,0}),
+     Line(
+       points={{-2,-1},{0,1},{2,-1}},
+       color={0,0,0},
+       origin={26,31},
+       rotation=180),
+     Line(points={{0,62},{4,60},{0,58}}, color={0,0,0}),
+     Line(
+       points={{-2,2},{2,0},{-2,-2}},
+       color={0,0,0},
+       origin={4,0},
+       rotation=180)}));
+end Hysteresis;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Limiteur.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Limiteur.mo
index d74fa8953e146234edfdbd20a860086f5b680d88..7cdaf6fdcb0342c106450bc0caf9e1996a599797 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Limiteur.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Limiteur.mo
@@ -1,97 +1,97 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
-block Limiteur
-  parameter Real maxval=1 "Valeur maximale de la sortie";
-  parameter Real minval=-1 "Valeur minimale de la sortie";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  assert(maxval > minval,
-    "Limiteur : Le paramètre maxval doit être supérieur au paramètre minval");
-
-  y.signal = if u.signal > maxval then maxval else if u.signal < minval then
-    minval else u.signal;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0}),
-        Text(
-          extent={{26,90},{88,68}},
-          lineColor={0,0,0},
-          textString=
-               "%maxval"),
-        Text(
-          extent={{-88,-64},{-26,-86}},
-          lineColor={0,0,0},
-          textString=
-               "%minval"),
-        Line(points={{-86,0},{88,0}}, color={192,192,192}),
-        Polygon(
-          points={{96,0},{86,-5},{86,5},{96,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,84},{-5,74},{5,74},{0,84}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-80},{0,74}}, color={192,192,192})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(
-          extent={{26,90},{88,68}},
-          lineColor={160,160,164},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "maxval"),
-        Text(
-          extent={{-88,-64},{-26,-86}},
-          lineColor={160,160,164},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "minval"),
-        Line(points={{-86,0},{88,0}}, color={192,192,192}),
-        Polygon(
-          points={{96,0},{86,-5},{86,5},{96,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,84},{-5,74},{5,74},{0,84}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-80},{0,74}}, color={192,192,192}),
-        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0})}),
-    Window(
-      x=0.27,
-      y=0.23,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.NonLinear library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Limiteur;
+within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
+block Limiteur
+  parameter Real maxval=1 "Valeur maximale de la sortie";
+  parameter Real minval=-1 "Valeur minimale de la sortie";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  assert(maxval > minval,
+    "Limiteur : Le paramètre maxval doit être supérieur au paramètre minval");
+
+  y.signal = if u.signal > maxval then maxval else if u.signal < minval then
+    minval else u.signal;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0}),
+        Text(
+          extent={{26,90},{88,68}},
+          lineColor={0,0,0},
+          textString=
+               "%maxval"),
+        Text(
+          extent={{-88,-64},{-26,-86}},
+          lineColor={0,0,0},
+          textString=
+               "%minval"),
+        Line(points={{-86,0},{88,0}}, color={192,192,192}),
+        Polygon(
+          points={{96,0},{86,-5},{86,5},{96,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,84},{-5,74},{5,74},{0,84}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-80},{0,74}}, color={192,192,192})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(
+          extent={{26,90},{88,68}},
+          lineColor={160,160,164},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "maxval"),
+        Text(
+          extent={{-88,-64},{-26,-86}},
+          lineColor={160,160,164},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "minval"),
+        Line(points={{-86,0},{88,0}}, color={192,192,192}),
+        Polygon(
+          points={{96,0},{86,-5},{86,5},{96,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,84},{-5,74},{5,74},{0,84}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-80},{0,74}}, color={192,192,192}),
+        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0})}),
+    Window(
+      x=0.27,
+      y=0.23,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.NonLinear library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Limiteur;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/LimiteurVar.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/LimiteurVar.mo
index cf4f1e6d768b5f38c25fbd29b1dfb86f4feb2e75..92d4d662ec77321f8e9a92a757a421221520c2af 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/LimiteurVar.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/LimiteurVar.mo
@@ -1,129 +1,129 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
-block LimiteurVar
-  parameter Real maxval=1
-    "Valeur maximale de la sortie si limit1 n'est pas connecté";
-  parameter Real minval=-1
-    "Valeur minimale de la sortie si limit2 n'est pas connecté";
-protected
-  Real uMax;
-  Real uMin;
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal limit1
-                                           annotation (Placement(transformation(
-          extent={{-120,70},{-100,90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal limit2
-                                           annotation (Placement(transformation(
-          extent={{-120,-90},{-100,-70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical ySMax
-                                      annotation (                         layer="icon",
-      Placement(transformation(extent={{100,70},{120,90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical ySMin
-                                      annotation (                           layer="icon",
-      Placement(transformation(extent={{100,-90},{120,-70}}, rotation=0)));
-equation
-
-  if (cardinality(limit1) == 0) then
-    limit1.signal = maxval;
-  end if;
-
-  if (cardinality(limit2) == 0) then
-    limit2.signal = minval;
-  end if;
-
-  uMax = max(limit1.signal, limit2.signal);
-  uMin = min(limit1.signal, limit2.signal);
-
-  y.signal = if (u.signal > uMax) then uMax else if (u.signal < uMin) then uMin else
-          u.signal;
-
-  ySMax.signal = (u.signal >= uMax);
-  ySMin.signal = (u.signal <= uMin);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0}),
-        Line(points={{-86,0},{88,0}}, color={192,192,192}),
-        Polygon(
-          points={{96,0},{86,-5},{86,5},{96,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,84},{-5,74},{5,74},{0,84}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-80},{0,74}}, color={192,192,192}),
-        Line(points={{-100,-80},{-60,-80},{-60,-66}}),
-        Line(points={{-100,80},{60,80},{60,64}}),
-        Polygon(
-          points={{-60,-62},{-65,-72},{-55,-72},{-60,-62}},
-          lineColor={0,127,255},
-          fillColor={0,127,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{56,72},{64,72},{60,62},{56,72},{56,72}},
-          lineColor={0,0,255},
-          fillColor={0,127,255},
-          fillPattern=FillPattern.Solid)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(
-          extent={{26,90},{88,68}},
-          lineColor={160,160,164},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "umax"),
-        Text(
-          extent={{-88,-64},{-26,-86}},
-          lineColor={160,160,164},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "umin"),
-        Line(points={{-86,0},{88,0}}, color={192,192,192}),
-        Polygon(
-          points={{96,0},{86,-5},{86,5},{96,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,84},{-5,74},{5,74},{0,84}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-80},{0,74}}, color={192,192,192}),
-        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0})}),
-    Window(
-      x=0.36,
-      y=0.19,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.NonLinear library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end LimiteurVar;
+within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
+block LimiteurVar
+  parameter Real maxval=1
+    "Valeur maximale de la sortie si limit1 n'est pas connecté";
+  parameter Real minval=-1
+    "Valeur minimale de la sortie si limit2 n'est pas connecté";
+protected
+  Real uMax;
+  Real uMin;
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal limit1
+                                           annotation (Placement(transformation(
+          extent={{-120,70},{-100,90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal limit2
+                                           annotation (Placement(transformation(
+          extent={{-120,-90},{-100,-70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical ySMax
+                                      annotation (                         layer="icon",
+      Placement(transformation(extent={{100,70},{120,90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical ySMin
+                                      annotation (                           layer="icon",
+      Placement(transformation(extent={{100,-90},{120,-70}}, rotation=0)));
+equation
+
+  if (cardinality(limit1) == 0) then
+    limit1.signal = maxval;
+  end if;
+
+  if (cardinality(limit2) == 0) then
+    limit2.signal = minval;
+  end if;
+
+  uMax = max(limit1.signal, limit2.signal);
+  uMin = min(limit1.signal, limit2.signal);
+
+  y.signal = if (u.signal > uMax) then uMax else if (u.signal < uMin) then uMin else
+          u.signal;
+
+  ySMax.signal = (u.signal >= uMax);
+  ySMin.signal = (u.signal <= uMin);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0}),
+        Line(points={{-86,0},{88,0}}, color={192,192,192}),
+        Polygon(
+          points={{96,0},{86,-5},{86,5},{96,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,84},{-5,74},{5,74},{0,84}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-80},{0,74}}, color={192,192,192}),
+        Line(points={{-100,-80},{-60,-80},{-60,-66}}),
+        Line(points={{-100,80},{60,80},{60,64}}),
+        Polygon(
+          points={{-60,-62},{-65,-72},{-55,-72},{-60,-62}},
+          lineColor={0,127,255},
+          fillColor={0,127,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{56,72},{64,72},{60,62},{56,72},{56,72}},
+          lineColor={0,0,255},
+          fillColor={0,127,255},
+          fillPattern=FillPattern.Solid)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(
+          extent={{26,90},{88,68}},
+          lineColor={160,160,164},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "umax"),
+        Text(
+          extent={{-88,-64},{-26,-86}},
+          lineColor={160,160,164},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "umin"),
+        Line(points={{-86,0},{88,0}}, color={192,192,192}),
+        Polygon(
+          points={{96,0},{86,-5},{86,5},{96,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,84},{-5,74},{5,74},{0,84}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-80},{0,74}}, color={192,192,192}),
+        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0})}),
+    Window(
+      x=0.36,
+      y=0.19,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.NonLinear library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end LimiteurVar;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/LimiteurVitesse.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/LimiteurVitesse.mo
index 5d81abc7aef762ef64c050fc747d91d0d5183811..c8308bad499444e9ef0f07213489c437bfa7a6f3 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/LimiteurVitesse.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/LimiteurVitesse.mo
@@ -1,98 +1,98 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
-block LimiteurVitesse
-  parameter Real dmax=1 "Valeur maximale de la dérivée de la sortie";
-  parameter Real dmin=-1 "Valeur minimale de la dérivée de la sortie";
-  parameter Real Ti(min=Modelica.Constants.small) = 0.01
-    "Constante de temps (s)";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  Continu.Derivee Derivee1(Ti=Ti) annotation (Placement(transformation(extent={
-            {-60,-10},{-40,10}}, rotation=0)));
-  Continu.Integrateur Integrateur1 annotation (Placement(transformation(extent=
-            {{40,-10},{60,10}}, rotation=0)));
-  Limiteur Limiteur1(maxval=dmax, minval=dmin)
-    annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0)));
-  Sources.Horloge Horloge1 annotation (Placement(transformation(extent={{-80,
-            -60},{-60,-40}}, rotation=0)));
-  Sources.Constante Constante1(k=0) annotation (Placement(transformation(extent=
-           {{-80,-100},{-60,-80}}, rotation=0)));
-  Math.Supeg Supeg1 annotation (Placement(transformation(extent={{-40,-80},{-20,
-            -60}}, rotation=0)));
-  Logique.Edge Edge1 annotation (Placement(transformation(extent={{0,-80},{20,
-            -60}}, rotation=0)));
-equation
-  connect(u, Derivee1.u) annotation (Line(points={{-110,0},{-61,0}}));
-  connect(Integrateur1.y, y)
-    annotation (Line(points={{61,0},{110,0}}, color={0,0,255}));
-  connect(Derivee1.y, Limiteur1.u)
-    annotation (Line(points={{-39,0},{-11,0}}, color={0,0,255}));
-  connect(Limiteur1.y, Integrateur1.u)
-    annotation (Line(points={{11,0},{39,0}}, color={0,0,255}));
-  connect(u, Integrateur1.ureset)
-    annotation (Line(points={{-110,0},{-80,0},{-80,-20},{28,-20},{28,-8},{39,-8}}));
-  connect(Horloge1.y, Supeg1.u1) annotation (Line(points={{-59,-50},{-50,-50},{
-          -50,-64},{-41,-64}}, color={0,0,255}));
-  connect(Constante1.y, Supeg1.u2) annotation (Line(points={{-59,-90},{-50,-90},
-          {-50,-76},{-41,-76}}, color={0,0,255}));
-  connect(Supeg1.yL, Edge1.uL) annotation (Line(points={{-19,-70},{-1,-70}}));
-  connect(Edge1.yL, Integrateur1.reset)
-    annotation (Line(points={{21,-70},{50,-70},{50,-11}}));
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0}),
-        Line(points={{-86,0},{88,0}}, color={160,160,164}),
-        Polygon(
-          points={{96,0},{86,-5},{86,5},{96,0}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,84},{-5,74},{5,74},{0,84}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-80},{0,74}}, color={160,160,164}),
-        Text(
-          extent={{-94,-8},{-32,-30}},
-          lineColor={160,160,164},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "%dmin"),
-        Text(
-          extent={{30,34},{92,12}},
-          lineColor={160,160,164},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "%dmax")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.19,
-      y=0.24,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Version 1.7</b></p>
-</HTML>
-"));
-end LimiteurVitesse;
+within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
+block LimiteurVitesse
+  parameter Real dmax=1 "Valeur maximale de la dérivée de la sortie";
+  parameter Real dmin=-1 "Valeur minimale de la dérivée de la sortie";
+  parameter Real Ti(min=Modelica.Constants.small) = 0.01
+    "Constante de temps (s)";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  Continu.Derivee Derivee1(Ti=Ti) annotation (Placement(transformation(extent={
+            {-60,-10},{-40,10}}, rotation=0)));
+  Continu.Integrateur Integrateur1 annotation (Placement(transformation(extent=
+            {{40,-10},{60,10}}, rotation=0)));
+  Limiteur Limiteur1(maxval=dmax, minval=dmin)
+    annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0)));
+  Sources.Horloge Horloge1 annotation (Placement(transformation(extent={{-80,
+            -60},{-60,-40}}, rotation=0)));
+  Sources.Constante Constante1(k=0) annotation (Placement(transformation(extent=
+           {{-80,-100},{-60,-80}}, rotation=0)));
+  Math.Supeg Supeg1 annotation (Placement(transformation(extent={{-40,-80},{-20,
+            -60}}, rotation=0)));
+  Logique.Edge Edge1 annotation (Placement(transformation(extent={{0,-80},{20,
+            -60}}, rotation=0)));
+equation
+  connect(u, Derivee1.u) annotation (Line(points={{-110,0},{-61,0}}));
+  connect(Integrateur1.y, y)
+    annotation (Line(points={{61,0},{110,0}}, color={0,0,255}));
+  connect(Derivee1.y, Limiteur1.u)
+    annotation (Line(points={{-39,0},{-11,0}}, color={0,0,255}));
+  connect(Limiteur1.y, Integrateur1.u)
+    annotation (Line(points={{11,0},{39,0}}, color={0,0,255}));
+  connect(u, Integrateur1.ureset)
+    annotation (Line(points={{-110,0},{-80,0},{-80,-20},{28,-20},{28,-8},{39,-8}}));
+  connect(Horloge1.y, Supeg1.u1) annotation (Line(points={{-59,-50},{-50,-50},{
+          -50,-64},{-41,-64}}, color={0,0,255}));
+  connect(Constante1.y, Supeg1.u2) annotation (Line(points={{-59,-90},{-50,-90},
+          {-50,-76},{-41,-76}}, color={0,0,255}));
+  connect(Supeg1.yL, Edge1.uL) annotation (Line(points={{-19,-70},{-1,-70}}));
+  connect(Edge1.yL, Integrateur1.reset)
+    annotation (Line(points={{21,-70},{50,-70},{50,-11}}));
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{78,60},{40,60},{-40,-60},{-80,-60}}, color={0,0,0}),
+        Line(points={{-86,0},{88,0}}, color={160,160,164}),
+        Polygon(
+          points={{96,0},{86,-5},{86,5},{96,0}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,84},{-5,74},{5,74},{0,84}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-80},{0,74}}, color={160,160,164}),
+        Text(
+          extent={{-94,-8},{-32,-30}},
+          lineColor={160,160,164},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "%dmin"),
+        Text(
+          extent={{30,34},{92,12}},
+          lineColor={160,160,164},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "%dmax")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.19,
+      y=0.24,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Version 1.7</b></p>
+</HTML>
+"));
+end LimiteurVitesse;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/RetardFixe.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/RetardFixe.mo
index 04014cd683c22a1d7686438d00982c1d2e4fe3b0..d24c7e670571b751a0891b3a6f1ec19ce09dc601 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/RetardFixe.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/RetardFixe.mo
@@ -1,105 +1,105 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
-block RetardFixe
-  parameter Real retard=1 "Retard de la sortie sur l'entrée (s)";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  y.signal = delay(u.signal, retard);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-92,0},{-80.7,34.2},{-73.5,53.1},{-67.1,66.4},{-61.4,74.6},
-              {-55.8,79.1},{-50.2,79.8},{-44.6,76.6},{-38.9,69.7},{-33.3,59.4},
-              {-26.9,44.1},{-18.83,21.2},{-1.9,-30.8},{5.3,-50.2},{11.7,-64.2},
-              {17.3,-73.1},{23,-78.4},{28.6,-80},{34.2,-77.6},{39.9,-71.5},{
-              45.5,-61.9},{51.9,-47.2},{60,-24.8},{68,0}}, color={0,0,255}),
-        Line(points={{-62,0},{-50.7,34.2},{-43.5,53.1},{-37.1,66.4},{-31.4,74.6},
-              {-25.8,79.1},{-20.2,79.8},{-14.6,76.6},{-8.9,69.7},{-3.3,59.4},{
-              3.1,44.1},{11.17,21.2},{28.1,-30.8},{35.3,-50.2},{41.7,-64.2},{
-              47.3,-73.1},{53,-78.4},{58.6,-80},{64.2,-77.6},{69.9,-71.5},{75.5,
-              -61.9},{81.9,-47.2},{90,-24.8},{98,0}}, color={160,160,164})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-80,80},{-88,80}}, color={192,192,192}),
-        Line(points={{-80,-80},{-88,-80}}, color={192,192,192}),
-        Line(points={{-80,-88},{-80,86}}, color={192,192,192}),
-        Text(
-          extent={{-75,98},{-46,78}},
-          lineColor={0,0,255},
-          textString=
-               "y"),
-        Polygon(
-          points={{-80,96},{-86,80},{-74,80},{-80,96}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-100,0},{84,0}}, color={192,192,192}),
-        Polygon(
-          points={{100,0},{84,6},{84,-6},{100,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,0},{-68.7,34.2},{-61.5,53.1},{-55.1,66.4},{-49.4,74.6},
-              {-43.8,79.1},{-38.2,79.8},{-32.6,76.6},{-26.9,69.7},{-21.3,59.4},
-              {-14.9,44.1},{-6.83,21.2},{10.1,-30.8},{17.3,-50.2},{23.7,-64.2},
-              {29.3,-73.1},{35,-78.4},{40.6,-80},{46.2,-77.6},{51.9,-71.5},{
-              57.5,-61.9},{63.9,-47.2},{72,-24.8},{80,0}}, color={0,0,255}),
-        Text(
-          extent={{-24,98},{-2,78}},
-          lineColor={0,0,0},
-          textString=
-               "u"),
-        Line(points={{-64,0},{-52.7,34.2},{-45.5,53.1},{-39.1,66.4},{-33.4,74.6},
-              {-27.8,79.1},{-22.2,79.8},{-16.6,76.6},{-10.9,69.7},{-5.3,59.4},{
-              1.1,44.1},{9.17,21.2},{26.1,-30.8},{33.3,-50.2},{39.7,-64.2},{
-              45.3,-73.1},{51,-78.4},{56.6,-80},{62.2,-77.6},{67.9,-71.5},{73.5,
-              -61.9},{79.9,-47.2},{88,-24.8},{96,0}}, color={0,0,0}),
-        Text(
-          extent={{67,22},{96,6}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(points={{-64,-30},{-64,0}}, color={192,192,192}),
-        Line(points={{-94,-26},{-80,-26}}, color={192,192,192}),
-        Line(points={{-64,-26},{-50,-26}}, color={192,192,192}),
-        Polygon(
-          points={{-80,-26},{-88,-24},{-88,-28},{-80,-26}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-56,-24},{-64,-26},{-56,-28},{-56,-24}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-72,-38},{-72,-28}}, textString=
-                                               "retard")}),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.NonLinear library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end RetardFixe;
+within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
+block RetardFixe
+  parameter Real retard=1 "Retard de la sortie sur l'entrée (s)";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  y.signal = delay(u.signal, retard);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-92,0},{-80.7,34.2},{-73.5,53.1},{-67.1,66.4},{-61.4,74.6},
+              {-55.8,79.1},{-50.2,79.8},{-44.6,76.6},{-38.9,69.7},{-33.3,59.4},
+              {-26.9,44.1},{-18.83,21.2},{-1.9,-30.8},{5.3,-50.2},{11.7,-64.2},
+              {17.3,-73.1},{23,-78.4},{28.6,-80},{34.2,-77.6},{39.9,-71.5},{
+              45.5,-61.9},{51.9,-47.2},{60,-24.8},{68,0}}, color={0,0,255}),
+        Line(points={{-62,0},{-50.7,34.2},{-43.5,53.1},{-37.1,66.4},{-31.4,74.6},
+              {-25.8,79.1},{-20.2,79.8},{-14.6,76.6},{-8.9,69.7},{-3.3,59.4},{
+              3.1,44.1},{11.17,21.2},{28.1,-30.8},{35.3,-50.2},{41.7,-64.2},{
+              47.3,-73.1},{53,-78.4},{58.6,-80},{64.2,-77.6},{69.9,-71.5},{75.5,
+              -61.9},{81.9,-47.2},{90,-24.8},{98,0}}, color={160,160,164})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-80,80},{-88,80}}, color={192,192,192}),
+        Line(points={{-80,-80},{-88,-80}}, color={192,192,192}),
+        Line(points={{-80,-88},{-80,86}}, color={192,192,192}),
+        Text(
+          extent={{-75,98},{-46,78}},
+          lineColor={0,0,255},
+          textString=
+               "y"),
+        Polygon(
+          points={{-80,96},{-86,80},{-74,80},{-80,96}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-100,0},{84,0}}, color={192,192,192}),
+        Polygon(
+          points={{100,0},{84,6},{84,-6},{100,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,0},{-68.7,34.2},{-61.5,53.1},{-55.1,66.4},{-49.4,74.6},
+              {-43.8,79.1},{-38.2,79.8},{-32.6,76.6},{-26.9,69.7},{-21.3,59.4},
+              {-14.9,44.1},{-6.83,21.2},{10.1,-30.8},{17.3,-50.2},{23.7,-64.2},
+              {29.3,-73.1},{35,-78.4},{40.6,-80},{46.2,-77.6},{51.9,-71.5},{
+              57.5,-61.9},{63.9,-47.2},{72,-24.8},{80,0}}, color={0,0,255}),
+        Text(
+          extent={{-24,98},{-2,78}},
+          lineColor={0,0,0},
+          textString=
+               "u"),
+        Line(points={{-64,0},{-52.7,34.2},{-45.5,53.1},{-39.1,66.4},{-33.4,74.6},
+              {-27.8,79.1},{-22.2,79.8},{-16.6,76.6},{-10.9,69.7},{-5.3,59.4},{
+              1.1,44.1},{9.17,21.2},{26.1,-30.8},{33.3,-50.2},{39.7,-64.2},{
+              45.3,-73.1},{51,-78.4},{56.6,-80},{62.2,-77.6},{67.9,-71.5},{73.5,
+              -61.9},{79.9,-47.2},{88,-24.8},{96,0}}, color={0,0,0}),
+        Text(
+          extent={{67,22},{96,6}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(points={{-64,-30},{-64,0}}, color={192,192,192}),
+        Line(points={{-94,-26},{-80,-26}}, color={192,192,192}),
+        Line(points={{-64,-26},{-50,-26}}, color={192,192,192}),
+        Polygon(
+          points={{-80,-26},{-88,-24},{-88,-28},{-80,-26}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-56,-24},{-64,-26},{-56,-28},{-56,-24}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-72,-38},{-72,-28}}, textString=
+                                               "retard")}),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.NonLinear library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end RetardFixe;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Selecteur.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Selecteur.mo
index ae8b74096e3464725c1e1a8f935a5a06c38956a9..7569893a962a443b976aa14ee62f991e1f43cf78 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Selecteur.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Selecteur.mo
@@ -1,135 +1,135 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
-block Selecteur
-  parameter Real C1=-1 "Valeur de la sortie pour uCond=true si u1 non connecté";
-  parameter Real C2=+1
-    "Valeur de la sortie pour uCond=false si u2 non connecté";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uCond
-    annotation (Placement(transformation(extent={{-120,-10},{-100,10}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
-                                       annotation (Placement(transformation(
-          extent={{-120,70},{-100,90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
-                                       annotation (Placement(transformation(
-          extent={{-120,-90},{-100,-70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  y.signal = if uCond.signal then u1.signal else u2.signal;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Line(
-          points={{12,0},{100,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-100,0},{-40,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-98,-80},{-40,-80}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(points={{-40,10},{-40,-10}}, color={0,0,0}),
-        Line(points={{-98,80},{-40,80}}, color={0,0,0}),
-        Line(points={{-40,80},{10,0}}, color={0,0,0}),
-        Ellipse(
-          extent={{2,8},{18,-8}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-40,70},{-40,80}}, color={0,0,0}),
-        Line(points={{-40,80},{-30,76}}, color={0,0,0}),
-        Text(
-          extent={{-100,80},{-38,48}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-48},{-38,-80}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Line(
-          points={{12,0},{100,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-100,0},{-40,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-98,-80},{-40,-80}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(points={{-40,10},{-40,-10}}, color={0,0,0}),
-        Line(points={{-98,80},{-40,80}}, color={0,0,0}),
-        Line(points={{-40,80},{10,0}}, color={0,0,0}),
-        Ellipse(
-          extent={{2,8},{18,-8}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-40,70},{-40,80}}, color={0,0,0}),
-        Line(points={{-40,80},{-30,76}}, color={0,0,0}),
-        Text(
-          extent={{-102,78},{-40,46}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-102,-50},{-40,-82}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.35,
-      y=0.11,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end Selecteur;
+within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
+block Selecteur
+  parameter Real C1=-1 "Valeur de la sortie pour uCond=true si u1 non connecté";
+  parameter Real C2=+1
+    "Valeur de la sortie pour uCond=false si u2 non connecté";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uCond
+    annotation (Placement(transformation(extent={{-120,-10},{-100,10}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
+                                       annotation (Placement(transformation(
+          extent={{-120,70},{-100,90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
+                                       annotation (Placement(transformation(
+          extent={{-120,-90},{-100,-70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  y.signal = if uCond.signal then u1.signal else u2.signal;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Line(
+          points={{12,0},{100,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-100,0},{-40,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-98,-80},{-40,-80}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(points={{-40,10},{-40,-10}}, color={0,0,0}),
+        Line(points={{-98,80},{-40,80}}, color={0,0,0}),
+        Line(points={{-40,80},{10,0}}, color={0,0,0}),
+        Ellipse(
+          extent={{2,8},{18,-8}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-40,70},{-40,80}}, color={0,0,0}),
+        Line(points={{-40,80},{-30,76}}, color={0,0,0}),
+        Text(
+          extent={{-100,80},{-38,48}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-48},{-38,-80}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Line(
+          points={{12,0},{100,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-100,0},{-40,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-98,-80},{-40,-80}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(points={{-40,10},{-40,-10}}, color={0,0,0}),
+        Line(points={{-98,80},{-40,80}}, color={0,0,0}),
+        Line(points={{-40,80},{10,0}}, color={0,0,0}),
+        Ellipse(
+          extent={{2,8},{18,-8}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-40,70},{-40,80}}, color={0,0,0}),
+        Line(points={{-40,80},{-30,76}}, color={0,0,0}),
+        Text(
+          extent={{-102,78},{-40,46}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-102,-50},{-40,-82}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.35,
+      y=0.11,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end Selecteur;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/SelecteurEntier.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/SelecteurEntier.mo
index 5ddb4d6aca429ae669ddca335816d5bfd0417b6d..896fc9c43bcbfe6eb5475467ddb4e701e82f3a44 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/SelecteurEntier.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/SelecteurEntier.mo
@@ -1,137 +1,137 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
-block SelecteurEntier "Sélection entre deux entiers"
-  parameter Integer C1=-1
-    "Valeur de la sortie pour uCond=true si u1 non connecté";
-  parameter Integer C2=1
-    "Valeur de la sortie pour uCond=false si u2 non connecté";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uCond
-    annotation (Placement(transformation(extent={{-120,-10},{-100,10}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputInteger y
-                                          annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
-                                          annotation (Placement(transformation(
-          extent={{-120,70},{-100,90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
-                                          annotation (Placement(transformation(
-          extent={{-120,-90},{-100,-70}}, rotation=0)));
-equation
-
-  if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  y.signal = if uCond.signal then u1.signal else u2.signal;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Line(
-          points={{12,0},{100,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(points={{-40,80},{10,0}}, color={0,0,0}),
-        Ellipse(
-          extent={{2,8},{18,-8}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-40,70},{-40,80}}, color={0,0,0}),
-        Line(points={{-40,80},{-30,76}}, color={0,0,0}),
-        Line(
-          points={{-100,0},{-40,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-98,-80},{-40,-80}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(points={{-98,80},{-40,80}}, color={0,0,0}),
-        Text(
-          extent={{-100,80},{-38,48}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-48},{-38,-80}},
-          lineColor={0,0,255},
-          textString=
-               "C2"),
-        Line(points={{-40,10},{-40,-10}}, color={0,0,0})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Line(
-          points={{12,0},{100,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(points={{-40,10},{-40,-10}}, color={0,0,0}),
-        Line(points={{-40,80},{10,0}}, color={0,0,0}),
-        Ellipse(
-          extent={{2,8},{18,-8}},
-          lineColor={160,160,164},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-40,70},{-40,80}}, color={0,0,0}),
-        Line(points={{-40,80},{-30,76}}, color={0,0,0}),
-        Line(
-          points={{-100,0},{-40,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-98,-80},{-40,-80}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(points={{-98,80},{-40,80}}, color={0,0,0}),
-        Text(
-          extent={{-100,80},{-38,48}},
-          lineColor={0,0,255},
-          textString=
-               "C1"),
-        Text(
-          extent={{-100,-48},{-38,-80}},
-          lineColor={0,0,255},
-          textString=
-               "C2")}),
-    Window(
-      x=0.35,
-      y=0.11,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end SelecteurEntier;
+within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
+block SelecteurEntier "Sélection entre deux entiers"
+  parameter Integer C1=-1
+    "Valeur de la sortie pour uCond=true si u1 non connecté";
+  parameter Integer C2=1
+    "Valeur de la sortie pour uCond=false si u2 non connecté";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uCond
+    annotation (Placement(transformation(extent={{-120,-10},{-100,10}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputInteger y
+                                          annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u1
+                                          annotation (Placement(transformation(
+          extent={{-120,70},{-100,90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger u2
+                                          annotation (Placement(transformation(
+          extent={{-120,-90},{-100,-70}}, rotation=0)));
+equation
+
+  if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  y.signal = if uCond.signal then u1.signal else u2.signal;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Line(
+          points={{12,0},{100,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(points={{-40,80},{10,0}}, color={0,0,0}),
+        Ellipse(
+          extent={{2,8},{18,-8}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-40,70},{-40,80}}, color={0,0,0}),
+        Line(points={{-40,80},{-30,76}}, color={0,0,0}),
+        Line(
+          points={{-100,0},{-40,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-98,-80},{-40,-80}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(points={{-98,80},{-40,80}}, color={0,0,0}),
+        Text(
+          extent={{-100,80},{-38,48}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-48},{-38,-80}},
+          lineColor={0,0,255},
+          textString=
+               "C2"),
+        Line(points={{-40,10},{-40,-10}}, color={0,0,0})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Line(
+          points={{12,0},{100,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(points={{-40,10},{-40,-10}}, color={0,0,0}),
+        Line(points={{-40,80},{10,0}}, color={0,0,0}),
+        Ellipse(
+          extent={{2,8},{18,-8}},
+          lineColor={160,160,164},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-40,70},{-40,80}}, color={0,0,0}),
+        Line(points={{-40,80},{-30,76}}, color={0,0,0}),
+        Line(
+          points={{-100,0},{-40,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-98,-80},{-40,-80}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(points={{-98,80},{-40,80}}, color={0,0,0}),
+        Text(
+          extent={{-100,80},{-38,48}},
+          lineColor={0,0,255},
+          textString=
+               "C1"),
+        Text(
+          extent={{-100,-48},{-38,-80}},
+          lineColor={0,0,255},
+          textString=
+               "C2")}),
+    Window(
+      x=0.35,
+      y=0.11,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end SelecteurEntier;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Switch.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Switch.mo
index 7045337157cfa65901f011a276fd645b9424601f..3e89820b85d74ab763b149d060e93375b241d42d 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Switch.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/Switch.mo
@@ -1,318 +1,318 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
-block Switch
-  parameter Real C1=1 "Valeur de la sortie pour sel=1 si u1 non connecté";
-  parameter Real C2=1 "Valeur de la sortie pour sel=2 si u2 non connecté";
-  parameter Real C3=1 "Valeur de la sortie pour sel=3 si u3 non connecté";
-  parameter Real C4=1 "Valeur de la sortie pour sel=4 si u4 non connecté";
-  parameter Real C5=1
-    "Valeur de la sortie pour des autres valeur de sel si u5 non connecté";
-  parameter Integer Sel0=1 "Valeur de sel s'il n'est pas connecté";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
-                                    annotation (Placement(transformation(extent=
-           {{-120,70},{-100,90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
-                                    annotation (Placement(transformation(extent=
-           {{-120,30},{-100,50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                   annotation (Placement(transformation(extent=
-            {{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u3
-                                    annotation (Placement(transformation(extent=
-           {{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u4
-                                    annotation (Placement(transformation(extent=
-           {{-120,-50},{-100,-30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u5
-                                    annotation (Placement(transformation(extent=
-           {{-120,-90},{-100,-70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger sel
-                                           annotation (Placement(transformation(
-        origin={10,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-
-  if (cardinality(u1) == 0) then
-    u1.signal = C1;
-  end if;
-
-  if (cardinality(u2) == 0) then
-    u2.signal = C2;
-  end if;
-
-  if (cardinality(u3) == 0) then
-    u3.signal = C3;
-  end if;
-
-  if (cardinality(u4) == 0) then
-    u4.signal = C4;
-  end if;
-
-  if (cardinality(u5) == 0) then
-    u5.signal = C5;
-  end if;
-
-  if (cardinality(sel) == 0) then
-    sel.signal = Sel0;
-  end if;
-
-  y.signal = if (sel.signal == 1) then u1.signal else
-             if (sel.signal == 2) then u2.signal else
-             if (sel.signal == 3) then u3.signal else
-             if (sel.signal == 4) then u4.signal else
-                                   u5.signal;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Line(
-          points={{-98,-80},{-40,-80}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(
-          points={{-100,80},{-40,80}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-100,40},{-40,40}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-100,0},{-40,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-100,-40},{-40,-40}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-100,-80},{-40,-80}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-40,70},{-40,80}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-40,80},{-30,76}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-40,80},{10,0}},
-          color={0,0,0},
-          thickness=0.5),
-        Ellipse(
-          extent={{2,8},{18,-8}},
-          lineColor={95,95,95},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{18,0},{100,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{10,-8},{10,-84}},
-          color={0,0,0},
-          thickness=0.5),
-        Text(
-          extent={{-68,98},{-30,76}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C1"),
-        Text(
-          extent={{-68,60},{-30,38}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C2"),
-        Text(
-          extent={{-68,20},{-30,-2}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C3"),
-        Text(
-          extent={{-68,-20},{-30,-42}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C4"),
-        Text(
-          extent={{-68,-60},{-30,-82}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C5"),
-        Text(
-          extent={{12,-60},{50,-82}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "sel")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Solid,
-          lineThickness=0.25),
-        Line(
-          points={{18,0},{100,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-100,-80},{-40,-80}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-100,80},{-40,80}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-40,80},{10,0}},
-          color={0,0,0},
-          thickness=0.5),
-        Ellipse(
-          extent={{2,8},{18,-8}},
-          lineColor={95,95,95},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,70},{-40,80}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-40,80},{-30,76}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-100,40},{-40,40}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-100,0},{-40,0}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{-100,-40},{-40,-40}},
-          color={0,0,0},
-          pattern=LinePattern.Solid,
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{10,-8},{10,-84}},
-          color={0,0,0},
-          thickness=0.5),
-        Text(
-          extent={{-70,60},{-32,38}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C2"),
-        Text(
-          extent={{-70,20},{-32,-2}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C3"),
-        Text(
-          extent={{-70,-20},{-32,-42}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C4"),
-        Text(
-          extent={{-70,-60},{-32,-82}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C5"),
-        Text(
-          extent={{10,-60},{48,-82}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "sel"),
-        Text(
-          extent={{-70,98},{-32,76}},
-          lineColor={95,95,95},
-          lineThickness=0.5,
-          fillColor={255,0,128},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "C1")}),
-    Window(
-      x=0.35,
-      y=0.11,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Version 1.6</b></p>
-<par>
-Selection entre plusieurs valeurs :
-<ul>
-<li>   y==u1 (ou C1 si u1 n'est pas connecté) si Sel == 1; <\\li>
-<li>   y==u2 (ou C2 si u2 n'est pas connecté) si Sel == 2; <\\li>
-<li>   y==u3 (ou C3 si u3 n'est pas connecté) si Sel == 3; <\\li>
-<li>   y==u4 (ou C4 si u4 n'est pas connecté) si Sel == 4; <\\li>
-<li>   y==u5 (ou C5 si u5 n'est pas connecté) dans tous les autres cas; <\\li>
-<\\ul>
-<\\par>
-</HTML>
-"));
-end Switch;
+within ThermoSysPro.InstrumentationAndControl.Blocks.NonLineaire;
+block Switch
+  parameter Real C1=1 "Valeur de la sortie pour sel=1 si u1 non connecté";
+  parameter Real C2=1 "Valeur de la sortie pour sel=2 si u2 non connecté";
+  parameter Real C3=1 "Valeur de la sortie pour sel=3 si u3 non connecté";
+  parameter Real C4=1 "Valeur de la sortie pour sel=4 si u4 non connecté";
+  parameter Real C5=1
+    "Valeur de la sortie pour des autres valeur de sel si u5 non connecté";
+  parameter Integer Sel0=1 "Valeur de sel s'il n'est pas connecté";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
+                                    annotation (Placement(transformation(extent=
+           {{-120,70},{-100,90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
+                                    annotation (Placement(transformation(extent=
+           {{-120,30},{-100,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                   annotation (Placement(transformation(extent=
+            {{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u3
+                                    annotation (Placement(transformation(extent=
+           {{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u4
+                                    annotation (Placement(transformation(extent=
+           {{-120,-50},{-100,-30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u5
+                                    annotation (Placement(transformation(extent=
+           {{-120,-90},{-100,-70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputInteger sel
+                                           annotation (Placement(transformation(
+        origin={10,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+
+  if (cardinality(u1) == 0) then
+    u1.signal = C1;
+  end if;
+
+  if (cardinality(u2) == 0) then
+    u2.signal = C2;
+  end if;
+
+  if (cardinality(u3) == 0) then
+    u3.signal = C3;
+  end if;
+
+  if (cardinality(u4) == 0) then
+    u4.signal = C4;
+  end if;
+
+  if (cardinality(u5) == 0) then
+    u5.signal = C5;
+  end if;
+
+  if (cardinality(sel) == 0) then
+    sel.signal = Sel0;
+  end if;
+
+  y.signal = if (sel.signal == 1) then u1.signal else
+             if (sel.signal == 2) then u2.signal else
+             if (sel.signal == 3) then u3.signal else
+             if (sel.signal == 4) then u4.signal else
+                                   u5.signal;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Line(
+          points={{-98,-80},{-40,-80}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(
+          points={{-100,80},{-40,80}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-100,40},{-40,40}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-100,0},{-40,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-100,-40},{-40,-40}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-100,-80},{-40,-80}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-40,70},{-40,80}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-40,80},{-30,76}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-40,80},{10,0}},
+          color={0,0,0},
+          thickness=0.5),
+        Ellipse(
+          extent={{2,8},{18,-8}},
+          lineColor={95,95,95},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{18,0},{100,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{10,-8},{10,-84}},
+          color={0,0,0},
+          thickness=0.5),
+        Text(
+          extent={{-68,98},{-30,76}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C1"),
+        Text(
+          extent={{-68,60},{-30,38}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C2"),
+        Text(
+          extent={{-68,20},{-30,-2}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C3"),
+        Text(
+          extent={{-68,-20},{-30,-42}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C4"),
+        Text(
+          extent={{-68,-60},{-30,-82}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C5"),
+        Text(
+          extent={{12,-60},{50,-82}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "sel")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Solid,
+          lineThickness=0.25),
+        Line(
+          points={{18,0},{100,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-100,-80},{-40,-80}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-100,80},{-40,80}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-40,80},{10,0}},
+          color={0,0,0},
+          thickness=0.5),
+        Ellipse(
+          extent={{2,8},{18,-8}},
+          lineColor={95,95,95},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,70},{-40,80}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-40,80},{-30,76}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-100,40},{-40,40}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-100,0},{-40,0}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{-100,-40},{-40,-40}},
+          color={0,0,0},
+          pattern=LinePattern.Solid,
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{10,-8},{10,-84}},
+          color={0,0,0},
+          thickness=0.5),
+        Text(
+          extent={{-70,60},{-32,38}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C2"),
+        Text(
+          extent={{-70,20},{-32,-2}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C3"),
+        Text(
+          extent={{-70,-20},{-32,-42}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C4"),
+        Text(
+          extent={{-70,-60},{-32,-82}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C5"),
+        Text(
+          extent={{10,-60},{48,-82}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "sel"),
+        Text(
+          extent={{-70,98},{-32,76}},
+          lineColor={95,95,95},
+          lineThickness=0.5,
+          fillColor={255,0,128},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "C1")}),
+    Window(
+      x=0.35,
+      y=0.11,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Version 1.6</b></p>
+<par>
+Selection entre plusieurs valeurs :
+<ul>
+<li>   y==u1 (ou C1 si u1 n'est pas connecté) si Sel == 1; <\\li>
+<li>   y==u2 (ou C2 si u2 n'est pas connecté) si Sel == 2; <\\li>
+<li>   y==u3 (ou C3 si u3 n'est pas connecté) si Sel == 3; <\\li>
+<li>   y==u4 (ou C4 si u4 n'est pas connecté) si Sel == 4; <\\li>
+<li>   y==u5 (ou C5 si u5 n'est pas connecté) dans tous les autres cas; <\\li>
+<\\ul>
+<\\par>
+</HTML>
+"));
+end Switch;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/package.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/package.mo
index 70f9813e042363a0e2e574cd06fafac299736772..e6fbc6eda43cbbbe870f9af1eeeaf59fc2156b75 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/package.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks;
-package NonLineaire "Bibliothèque des blocs non-linéaires"
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end NonLineaire;
+within ThermoSysPro.InstrumentationAndControl.Blocks;
+package NonLineaire "Bibliothèque des blocs non-linéaires"
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end NonLineaire;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/package.order b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/package.order
index 76c1aeb91abf06176865e5f63fcb5055c220e8e1..0132bf967e75efe5099a19b44f09e05418be7702 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/package.order
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/NonLineaire/package.order
@@ -7,3 +7,4 @@ RetardVar
 Selecteur
 SelecteurEntier
 Switch
+Hysteresis
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/ConstanteEntier.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/ConstanteEntier.mo
index a7fc109e90ca779b89d87be4175709d52ba889ad..ef372a1e3bb893be5fcff1371dd9247e85280c60 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/ConstanteEntier.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/ConstanteEntier.mo
@@ -1,78 +1,78 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block ConstanteEntier
-  parameter Integer k=1 "Valeur de la sortie entiere";
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputInteger y
-                                          annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  y.signal = k;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Line(points={{-80,0},{80,0}}, color={0,0,0}),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-89,90},{-36,72}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{70,-80},{94,-100}},
-          lineColor={160,160,164},
-          textString=
-               "temps")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-80,0},{80,0}}, color={0,0,0}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Text(
-          extent={{-148,14},{152,54}},
-          lineColor={0,0,0},
-          textString=
-               "%k")}),
-    Window(
-      x=0.42,
-      y=0.22,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end ConstanteEntier;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block ConstanteEntier
+  parameter Integer k=1 "Valeur de la sortie entiere";
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputInteger y
+                                          annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  y.signal = k;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Line(points={{-80,0},{80,0}}, color={0,0,0}),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-89,90},{-36,72}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{70,-80},{94,-100}},
+          lineColor={160,160,164},
+          textString=
+               "temps")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-80,0},{80,0}}, color={0,0,0}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Text(
+          extent={{-148,14},{152,54}},
+          lineColor={0,0,0},
+          textString=
+               "%k")}),
+    Window(
+      x=0.42,
+      y=0.22,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end ConstanteEntier;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Echelon.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Echelon.mo
index bc5412d96b44ad5cf79e81aa97c8b5554624a2e5..97306f53d3856b122e864b8d5c13bb9998cb6ac0 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Echelon.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Echelon.mo
@@ -1,135 +1,135 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block Echelon
-  parameter Real hauteur=1 "Hauteur de l'échelon";
-  parameter Real offset=0 "Décalage de la sortie";
-  parameter Real startTime=0 "Instant de départ de l'échelon";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  y.signal = offset + (if time < startTime then 0 else hauteur);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-70},{0,-70},{0,50},{80,50}}, color={0,0,0})}),
-    Window(
-      x=0.18,
-      y=0.17,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(
-          points={{-80,-18},{0,-18},{0,50},{80,50}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{70,-80},{94,-100}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Text(
-          extent={{-21,-72},{25,-90}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Line(
-          points={{0,-17},{0,-71}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Text(
-          extent={{-68,-36},{-22,-54}},
-          lineColor={160,160,164},
-          textString=
-               "offset"),
-        Line(
-          points={{-13,50},{-13,-17}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Polygon(
-          points={{2,50},{-19,50},{2,50}},
-          lineColor={192,192,192},
-          pattern=LinePattern.Dash),
-        Polygon(
-          points={{-13,-17},{-16,-4},{-10,-4},{-13,-17},{-13,-17}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-13,50},{-16,37},{-9,37},{-13,50}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-68,26},{-22,8}},
-          lineColor={160,160,164},
-          textString=
-               "hauteur"),
-        Polygon(
-          points={{-13,-69},{-16,-56},{-10,-56},{-13,-69},{-13,-69}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-13,-18},{-13,-70}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Polygon(
-          points={{-13,-18},{-16,-31},{-9,-31},{-13,-18}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-78,90},{-37,70}},
-          lineColor={160,160,164},
-          textString=
-               "y")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Echelon;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block Echelon
+  parameter Real hauteur=1 "Hauteur de l'échelon";
+  parameter Real offset=0 "Décalage de la sortie";
+  parameter Real startTime=0 "Instant de départ de l'échelon";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  y.signal = offset + (if time < startTime then 0 else hauteur);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-70},{0,-70},{0,50},{80,50}}, color={0,0,0})}),
+    Window(
+      x=0.18,
+      y=0.17,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(
+          points={{-80,-18},{0,-18},{0,50},{80,50}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{70,-80},{94,-100}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Text(
+          extent={{-21,-72},{25,-90}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Line(
+          points={{0,-17},{0,-71}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Text(
+          extent={{-68,-36},{-22,-54}},
+          lineColor={160,160,164},
+          textString=
+               "offset"),
+        Line(
+          points={{-13,50},{-13,-17}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Polygon(
+          points={{2,50},{-19,50},{2,50}},
+          lineColor={192,192,192},
+          pattern=LinePattern.Dash),
+        Polygon(
+          points={{-13,-17},{-16,-4},{-10,-4},{-13,-17},{-13,-17}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-13,50},{-16,37},{-9,37},{-13,50}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-68,26},{-22,8}},
+          lineColor={160,160,164},
+          textString=
+               "hauteur"),
+        Polygon(
+          points={{-13,-69},{-16,-56},{-10,-56},{-13,-69},{-13,-69}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-13,-18},{-13,-70}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Polygon(
+          points={{-13,-18},{-16,-31},{-9,-31},{-13,-18}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-78,90},{-37,70}},
+          lineColor={160,160,164},
+          textString=
+               "y")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Echelon;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Exp.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Exp.mo
index 29bcbf4f66a6fe3daa2a5c2a6fd94f94d5fd59d8..8c033fa1057c98971ff34d4e64419162b1efee6b 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Exp.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Exp.mo
@@ -1,158 +1,158 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block Exp
-  parameter Real ymax=1 "Hauteur de la sortie pour riseTime infini";
-  parameter Real riseTime(min=0) = 0.5 "Durée du front montant";
-  parameter Real riseTimeConst(min=Modelica.Constants.small) = 0.1
-    "Constante du front montant";
-  parameter Real fallTimeConst(min=Modelica.Constants.small) = 0.1
-    "Constante du front descendant";
-  parameter Real offset=0 "Décalage de la sortie";
-  parameter Real startTime=0 "Instant de départ de l'exponentielle";
-
-protected
-  Real y_riseTime;
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  y_riseTime = ymax*(1 - Modelica.Math.exp(-riseTime/riseTimeConst));
-
-  y.signal = offset + (if (time < startTime) then 0 else if (time < (startTime
-     + riseTime)) then ymax*(1 - exp(-(time - startTime)/riseTimeConst)) else
-    y_riseTime*Modelica.Math.exp(-(time - startTime - riseTime)/fallTimeConst));
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,-70},{68,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-70},{-77.2,-55.3},{-74.3,-42.1},{-70.8,-27.6},{-67.3,
-              -15},{-63.7,-4.08},{-59.5,7.18},{-55.3,16.7},{-50.3,26},{-44.6,
-              34.5},{-38.3,42.1},{-31.2,48.6},{-22.7,54.3},{-12.1,59.2},{-10,60},
-              {-7.88,47.5},{-5.05,32.7},{-2.22,19.8},{0.606,8.45},{4.14,-3.7},{
-              7.68,-14},{11.9,-24.2},{16.2,-32.6},{21.1,-40.5},{26.8,-47.4},{
-              33.1,-53.3},{40.9,-58.5},{50.8,-62.8},{60,-65.4}}, color={0,0,0}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192})}),
-    Window(
-      x=0.23,
-      y=0.27,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-100,-70},{84,-70}}, color={192,192,192}),
-        Polygon(
-          points={{100,-70},{84,-64},{84,-76},{100,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,-30},{-37.2,-15.3},{-34.3,-2.1},{-30.8,12.4},{-27.3,25},
-              {-23.7,35.92},{-19.5,47.18},{-15.3,56.7},{-10.3,66},{-4.6,74.5},{
-              1.7,82.1},{8.8,88.6},{17.3,94.3},{27.9,99.2},{30,100},{32.12,87.5},
-              {34.95,72.7},{37.78,59.8},{40.606,48.45},{44.14,36.3},{47.68,26},
-              {51.9,15.8},{56.2,7.4},{61.1,-0.5},{66.8,-7.4},{73.1,-13.3},{80.9,
-              -18.5},{90.8,-22.8},{100,-25.4}},
-          color={0,0,0},
-          thickness=0.5),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Text(
-          extent={{-82,91},{-41,71}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{-78,-43},{-46,-56}},
-          lineColor={160,160,164},
-          textString=
-               "offset"),
-        Polygon(
-          points={{-40,-70},{-43,-60},{-38,-60},{-40,-70},{-40,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,-29},{-40,-60}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Polygon(
-          points={{-40,-30},{-42,-40},{-37,-40},{-40,-30}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-39,-30},{-80,-30}},
-          color={0,0,0},
-          thickness=0.5),
-        Text(
-          extent={{-59,-71},{-13,-89}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Polygon(
-          points={{-41,-30},{-32,-28},{-32,-32},{-41,-30}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,-30},{29,-30}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Polygon(
-          points={{29,-30},{21,-28},{21,-32},{29,-30}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-26,-12},{19,-28}},
-          lineColor={160,160,164},
-          textString=
-               "riseTime"),
-        Text(
-          extent={{78,-76},{102,-96}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(
-          points={{30,100},{30,-34}},
-          color={192,192,192},
-          pattern=LinePattern.Dash)}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.7</b></p>
-</HTML>
-"));
-end Exp;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block Exp
+  parameter Real ymax=1 "Hauteur de la sortie pour riseTime infini";
+  parameter Real riseTime(min=0) = 0.5 "Durée du front montant";
+  parameter Real riseTimeConst(min=Modelica.Constants.small) = 0.1
+    "Constante du front montant";
+  parameter Real fallTimeConst(min=Modelica.Constants.small) = 0.1
+    "Constante du front descendant";
+  parameter Real offset=0 "Décalage de la sortie";
+  parameter Real startTime=0 "Instant de départ de l'exponentielle";
+
+protected
+  Real y_riseTime;
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  y_riseTime = ymax*(1 - Modelica.Math.exp(-riseTime/riseTimeConst));
+
+  y.signal = offset + (if (time < startTime) then 0 else if (time < (startTime
+     + riseTime)) then ymax*(1 - exp(-(time - startTime)/riseTimeConst)) else
+    y_riseTime*Modelica.Math.exp(-(time - startTime - riseTime)/fallTimeConst));
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,-70},{68,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-70},{-77.2,-55.3},{-74.3,-42.1},{-70.8,-27.6},{-67.3,
+              -15},{-63.7,-4.08},{-59.5,7.18},{-55.3,16.7},{-50.3,26},{-44.6,
+              34.5},{-38.3,42.1},{-31.2,48.6},{-22.7,54.3},{-12.1,59.2},{-10,60},
+              {-7.88,47.5},{-5.05,32.7},{-2.22,19.8},{0.606,8.45},{4.14,-3.7},{
+              7.68,-14},{11.9,-24.2},{16.2,-32.6},{21.1,-40.5},{26.8,-47.4},{
+              33.1,-53.3},{40.9,-58.5},{50.8,-62.8},{60,-65.4}}, color={0,0,0}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192})}),
+    Window(
+      x=0.23,
+      y=0.27,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-100,-70},{84,-70}}, color={192,192,192}),
+        Polygon(
+          points={{100,-70},{84,-64},{84,-76},{100,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,-30},{-37.2,-15.3},{-34.3,-2.1},{-30.8,12.4},{-27.3,25},
+              {-23.7,35.92},{-19.5,47.18},{-15.3,56.7},{-10.3,66},{-4.6,74.5},{
+              1.7,82.1},{8.8,88.6},{17.3,94.3},{27.9,99.2},{30,100},{32.12,87.5},
+              {34.95,72.7},{37.78,59.8},{40.606,48.45},{44.14,36.3},{47.68,26},
+              {51.9,15.8},{56.2,7.4},{61.1,-0.5},{66.8,-7.4},{73.1,-13.3},{80.9,
+              -18.5},{90.8,-22.8},{100,-25.4}},
+          color={0,0,0},
+          thickness=0.5),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Text(
+          extent={{-82,91},{-41,71}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{-78,-43},{-46,-56}},
+          lineColor={160,160,164},
+          textString=
+               "offset"),
+        Polygon(
+          points={{-40,-70},{-43,-60},{-38,-60},{-40,-70},{-40,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,-29},{-40,-60}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Polygon(
+          points={{-40,-30},{-42,-40},{-37,-40},{-40,-30}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-39,-30},{-80,-30}},
+          color={0,0,0},
+          thickness=0.5),
+        Text(
+          extent={{-59,-71},{-13,-89}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Polygon(
+          points={{-41,-30},{-32,-28},{-32,-32},{-41,-30}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,-30},{29,-30}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Polygon(
+          points={{29,-30},{21,-28},{21,-32},{29,-30}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-26,-12},{19,-28}},
+          lineColor={160,160,164},
+          textString=
+               "riseTime"),
+        Text(
+          extent={{78,-76},{102,-96}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(
+          points={{30,100},{30,-34}},
+          color={192,192,192},
+          pattern=LinePattern.Dash)}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.7</b></p>
+</HTML>
+"));
+end Exp;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Horloge.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Horloge.mo
index 0d5aa4d73eecd27174cf4c03b6a8cc05642c775d..20f0c4e8b519b983cc2bf197cbd073ea6d147564 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Horloge.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Horloge.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block Horloge
-  parameter Real offset=0 "Décalage de la sortie";
-  parameter Real startTime=0 "Instant de départ de l'horloge";
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  y.signal = offset + (if (time < startTime) then 0 else time - startTime);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(extent={{-80,80},{80,-80}}, lineColor={160,160,164}),
-        Line(points={{0,80},{0,60}}, color={160,160,164}),
-        Line(points={{80,0},{60,0}}, color={160,160,164}),
-        Line(points={{0,-80},{0,-60}}, color={160,160,164}),
-        Line(points={{-80,0},{-60,0}}, color={160,160,164}),
-        Line(points={{37,70},{26,50}}, color={160,160,164}),
-        Line(points={{70,38},{49,26}}, color={160,160,164}),
-        Line(points={{71,-37},{52,-27}}, color={160,160,164}),
-        Line(points={{39,-70},{29,-51}}, color={160,160,164}),
-        Line(points={{-39,-70},{-29,-52}}, color={160,160,164}),
-        Line(points={{-71,-37},{-50,-26}}, color={160,160,164}),
-        Line(points={{-71,37},{-54,28}}, color={160,160,164}),
-        Line(points={{-38,70},{-28,51}}, color={160,160,164}),
-        Line(
-          points={{0,0},{-50,50}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{0,0},{40,0}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Window(
-      x=0.34,
-      y=0.23,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(
-          points={{-80,0},{-10,0},{60,70}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-34,0},{-37,-13},{-30,-13},{-34,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-34,-13},{-34,-70}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Polygon(
-          points={{-34,-69},{-37,-56},{-31,-56},{-34,-69},{-34,-69}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-81,-25},{-35,-43}},
-          lineColor={160,160,164},
-          textString=
-               "offset"),
-        Text(
-          extent={{-33,-71},{13,-89}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Text(
-          extent={{-82,90},{-41,70}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{70,-80},{94,-100}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(
-          points={{-10,0},{-10,-70}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-10,0},{50,0}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{50,0},{50,60}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Text(
-          extent={{35,33},{50,23}},
-          lineColor={160,160,164},
-          textString=
-               "1"),
-        Text(
-          extent={{14,13},{32,1}},
-          lineColor={160,160,164},
-          textString=
-               "1")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Horloge;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block Horloge
+  parameter Real offset=0 "Décalage de la sortie";
+  parameter Real startTime=0 "Instant de départ de l'horloge";
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  y.signal = offset + (if (time < startTime) then 0 else time - startTime);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(extent={{-80,80},{80,-80}}, lineColor={160,160,164}),
+        Line(points={{0,80},{0,60}}, color={160,160,164}),
+        Line(points={{80,0},{60,0}}, color={160,160,164}),
+        Line(points={{0,-80},{0,-60}}, color={160,160,164}),
+        Line(points={{-80,0},{-60,0}}, color={160,160,164}),
+        Line(points={{37,70},{26,50}}, color={160,160,164}),
+        Line(points={{70,38},{49,26}}, color={160,160,164}),
+        Line(points={{71,-37},{52,-27}}, color={160,160,164}),
+        Line(points={{39,-70},{29,-51}}, color={160,160,164}),
+        Line(points={{-39,-70},{-29,-52}}, color={160,160,164}),
+        Line(points={{-71,-37},{-50,-26}}, color={160,160,164}),
+        Line(points={{-71,37},{-54,28}}, color={160,160,164}),
+        Line(points={{-38,70},{-28,51}}, color={160,160,164}),
+        Line(
+          points={{0,0},{-50,50}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{0,0},{40,0}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Window(
+      x=0.34,
+      y=0.23,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(
+          points={{-80,0},{-10,0},{60,70}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-34,0},{-37,-13},{-30,-13},{-34,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-34,-13},{-34,-70}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Polygon(
+          points={{-34,-69},{-37,-56},{-31,-56},{-34,-69},{-34,-69}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-81,-25},{-35,-43}},
+          lineColor={160,160,164},
+          textString=
+               "offset"),
+        Text(
+          extent={{-33,-71},{13,-89}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Text(
+          extent={{-82,90},{-41,70}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{70,-80},{94,-100}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(
+          points={{-10,0},{-10,-70}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-10,0},{50,0}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{50,0},{50,60}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Text(
+          extent={{35,33},{50,23}},
+          lineColor={160,160,164},
+          textString=
+               "1"),
+        Text(
+          extent={{14,13},{32,1}},
+          lineColor={160,160,164},
+          textString=
+               "1")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Horloge;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Pulse.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Pulse.mo
index 4d9a31581fb4a7decc9873836a1dfa438928d07b..d283620ee183edc2b416a3a09a88653e026f0657 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Pulse.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Pulse.mo
@@ -1,195 +1,195 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block Pulse
-  parameter Real amplitude=1 "Amplitude des impulsions";
-  parameter Real width=0.5 "Largeur des impulsions (s)";
-  parameter Real period=1 "Periode des impulsions (s)";
-  parameter Real offset=0 "Décalage de la sortie";
-  parameter Real startTime=0 "Instant de départ des impulsions";
-
-protected
-  Real T0;
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  when sample(startTime, period) then
-    T0 = time;
-  end when;
-
-  y.signal = offset + (if time < startTime or time >= T0 + width then 0 else
-    amplitude);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-70},{-40,-70},{-40,44},{0,44},{0,-70},{40,-70},{40,
-              44},{79,44}}, color={0,0,0}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name")}),
-    Window(
-      x=0.08,
-      y=0.05,
-      width=0.79,
-      height=0.77),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-34,1},{-37,-12},{-30,-12},{-34,1}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-34,-1},{-34,-70}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Polygon(
-          points={{-33,-70},{-36,-57},{-30,-57},{-33,-70},{-33,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-78,-24},{-35,-36}},
-          lineColor={160,160,164},
-          textString=
-               "offset"),
-        Text(
-          extent={{-31,-69},{15,-87}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Text(
-          extent={{-82,93},{-41,73}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{70,-80},{94,-100}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(
-          points={{-10,0},{-10,-70}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-80,0},{-10,0},{-10,50},{30,50},{30,0},{50,0},{50,50},{90,50}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-10,88},{-10,49}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{30,74},{30,50}},
-          color={160,160,164},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{50,88},{50,50}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(points={{-10,83},{51,83}}, color={192,192,192}),
-        Line(points={{-10,69},{30,69}}, color={192,192,192}),
-        Text(
-          extent={{0,97},{46,85}},
-          lineColor={160,160,164},
-          textString=
-               "period"),
-        Text(
-          extent={{-9,81},{30,69}},
-          lineColor={160,160,164},
-          textString=
-               "width"),
-        Line(
-          points={{-43,50},{-10,50}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-34,50},{-34,1}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Text(
-          extent={{-78,34},{-37,20}},
-          lineColor={160,160,164},
-          textString=
-               "amplitude"),
-        Polygon(
-          points={{-34,49},{-37,36},{-30,36},{-34,49}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-34,1},{-37,14},{-31,14},{-34,1},{-34,1}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{90,50},{90,0},{100,0}},
-          color={0,0,0},
-          thickness=0.5),
-        Polygon(
-          points={{-10,69},{-1,71},{-1,67},{-10,69}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{30,69},{22,71},{22,67},{30,69}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-10,83},{-1,85},{-1,81},{-10,83}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{50,83},{42,85},{42,81},{50,83}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Pulse;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block Pulse
+  parameter Real amplitude=1 "Amplitude des impulsions";
+  parameter Real width=0.5 "Largeur des impulsions (s)";
+  parameter Real period=1 "Periode des impulsions (s)";
+  parameter Real offset=0 "Décalage de la sortie";
+  parameter Real startTime=0 "Instant de départ des impulsions";
+
+protected
+  Real T0;
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  when sample(startTime, period) then
+    T0 = time;
+  end when;
+
+  y.signal = offset + (if time < startTime or time >= T0 + width then 0 else
+    amplitude);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-70},{-40,-70},{-40,44},{0,44},{0,-70},{40,-70},{40,
+              44},{79,44}}, color={0,0,0}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name")}),
+    Window(
+      x=0.08,
+      y=0.05,
+      width=0.79,
+      height=0.77),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-34,1},{-37,-12},{-30,-12},{-34,1}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-34,-1},{-34,-70}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Polygon(
+          points={{-33,-70},{-36,-57},{-30,-57},{-33,-70},{-33,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-78,-24},{-35,-36}},
+          lineColor={160,160,164},
+          textString=
+               "offset"),
+        Text(
+          extent={{-31,-69},{15,-87}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Text(
+          extent={{-82,93},{-41,73}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{70,-80},{94,-100}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(
+          points={{-10,0},{-10,-70}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-80,0},{-10,0},{-10,50},{30,50},{30,0},{50,0},{50,50},{90,50}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-10,88},{-10,49}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{30,74},{30,50}},
+          color={160,160,164},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{50,88},{50,50}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(points={{-10,83},{51,83}}, color={192,192,192}),
+        Line(points={{-10,69},{30,69}}, color={192,192,192}),
+        Text(
+          extent={{0,97},{46,85}},
+          lineColor={160,160,164},
+          textString=
+               "period"),
+        Text(
+          extent={{-9,81},{30,69}},
+          lineColor={160,160,164},
+          textString=
+               "width"),
+        Line(
+          points={{-43,50},{-10,50}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-34,50},{-34,1}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Text(
+          extent={{-78,34},{-37,20}},
+          lineColor={160,160,164},
+          textString=
+               "amplitude"),
+        Polygon(
+          points={{-34,49},{-37,36},{-30,36},{-34,49}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-34,1},{-37,14},{-31,14},{-34,1},{-34,1}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{90,50},{90,0},{100,0}},
+          color={0,0,0},
+          thickness=0.5),
+        Polygon(
+          points={{-10,69},{-1,71},{-1,67},{-10,69}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{30,69},{22,71},{22,67},{30,69}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-10,83},{-1,85},{-1,81},{-10,83}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{50,83},{42,85},{42,81},{50,83}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Pulse;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Rampe.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Rampe.mo
index f14426ce1fb742e352ccdbb1681c590ea9e03dca..f0b32a934e6360fa8e26b74ebbf3eeb73b8dbd05 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Rampe.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Rampe.mo
@@ -1,159 +1,159 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block Rampe
-  parameter Real Starttime=1 "Instant de départ de la rampe (s)";
-  parameter Real Duration=2 "Durée de la rampe (s)";
-  parameter Real Initialvalue=0 "Valeur initiale de la sortie";
-  parameter Real Finalvalue=1 "Valeur finale de la sortie";
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  y.signal = if time < Starttime then (Initialvalue) else if time > (Starttime
-     + Duration) then (Finalvalue) else (Initialvalue + (Finalvalue -
-    Initialvalue)*(time - Starttime)/Duration);
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(
-          points={{-80,-20},{-20,-20},{50,50}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-30,-20},{-32,-30},{-27,-30},{-30,-20}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-30,-20},{-30,-70}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Polygon(
-          points={{-30,-70},{-33,-60},{-28,-60},{-30,-70},{-30,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-80,-33},{-30,-50}},
-          lineColor={160,160,164},
-          textString=
-               "initialValue"),
-        Text(
-          extent={{-40,-70},{6,-88}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Text(
-          extent={{-80,92},{-39,72}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{70,-80},{94,-100}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(
-          points={{-20,-20},{-20,-70}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-19,-20},{50,-20}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Line(
-          points={{50,50},{101,50}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{50,50},{50,-62}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Polygon(
-          points={{50,-20},{42,-18},{42,-22},{50,-20}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,-20},{-11,-18},{-11,-22},{-20,-20}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{50,50},{48,40},{53,40},{50,50}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{50,-72},{47,-62},{52,-62},{50,-72},{50,-72}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{53,25},{100,8}},
-          lineColor={160,160,164},
-          textString=
-               "finalValue"),
-        Text(
-          extent={{0,-17},{35,-37}},
-          lineColor={160,160,164},
-          textString=
-               "duration")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,-70},{-40,-70},{31,38}}, color={0,0,0}),
-        Line(points={{31,38},{86,38}}, color={0,0,0}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name")}),
-    Window(
-      x=0.2,
-      y=0.15,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Rampe;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block Rampe
+  parameter Real Starttime=1 "Instant de départ de la rampe (s)";
+  parameter Real Duration=2 "Durée de la rampe (s)";
+  parameter Real Initialvalue=0 "Valeur initiale de la sortie";
+  parameter Real Finalvalue=1 "Valeur finale de la sortie";
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  y.signal = if time < Starttime then (Initialvalue) else if time > (Starttime
+     + Duration) then (Finalvalue) else (Initialvalue + (Finalvalue -
+    Initialvalue)*(time - Starttime)/Duration);
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(
+          points={{-80,-20},{-20,-20},{50,50}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-30,-20},{-32,-30},{-27,-30},{-30,-20}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-30,-20},{-30,-70}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Polygon(
+          points={{-30,-70},{-33,-60},{-28,-60},{-30,-70},{-30,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-80,-33},{-30,-50}},
+          lineColor={160,160,164},
+          textString=
+               "initialValue"),
+        Text(
+          extent={{-40,-70},{6,-88}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Text(
+          extent={{-80,92},{-39,72}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{70,-80},{94,-100}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(
+          points={{-20,-20},{-20,-70}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-19,-20},{50,-20}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Line(
+          points={{50,50},{101,50}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{50,50},{50,-62}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Polygon(
+          points={{50,-20},{42,-18},{42,-22},{50,-20}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,-20},{-11,-18},{-11,-22},{-20,-20}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{50,50},{48,40},{53,40},{50,50}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{50,-72},{47,-62},{52,-62},{50,-72},{50,-72}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{53,25},{100,8}},
+          lineColor={160,160,164},
+          textString=
+               "finalValue"),
+        Text(
+          extent={{0,-17},{35,-37}},
+          lineColor={160,160,164},
+          textString=
+               "duration")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,-70},{-40,-70},{31,38}}, color={0,0,0}),
+        Line(points={{31,38},{86,38}}, color={0,0,0}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name")}),
+    Window(
+      x=0.2,
+      y=0.15,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Rampe;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Random.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Random.mo
index 27d256c1fa4cbff0aecdd0c06cc4a22d28dfb4fe..c1bdb63f882f15bd972daf0d0c95d26742b6a989 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Random.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Random.mo
@@ -1,78 +1,78 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block Random
-  parameter Integer seed=1 "Source du générateur aléatoire";
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  when initial() then
-    Commun.srand(seed);
-  end when;
-
-  when sample(SampleOffset, SampleInterval) then
-    y.signal = Commun.fmod(Commun.rand()/32768*10, 1);
-  end when;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-89,90},{-36,72}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{70,-80},{94,-100}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(points={{-60,-20},{-40,20},{-20,-40},{0,-60},{20,0},{40,40},{60,0}},
-            color={0,0,0})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-60,-20},{-40,20},{-20,-40},{0,-60},{20,0},{40,40},{60,0}},
-            color={0,0,0})}),
-    Window(
-      x=0.32,
-      y=0.33,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end Random;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block Random
+  parameter Integer seed=1 "Source du générateur aléatoire";
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage (s)";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage (s)";
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  when initial() then
+    Commun.srand(seed);
+  end when;
+
+  when sample(SampleOffset, SampleInterval) then
+    y.signal = Commun.fmod(Commun.rand()/32768*10, 1);
+  end when;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-89,90},{-36,72}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{70,-80},{94,-100}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(points={{-60,-20},{-40,20},{-20,-40},{0,-60},{20,0},{40,40},{60,0}},
+            color={0,0,0})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-60,-20},{-40,20},{-20,-40},{0,-60},{20,0},{40,40},{60,0}},
+            color={0,0,0})}),
+    Window(
+      x=0.32,
+      y=0.33,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end Random;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/RandomLineaire.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/RandomLineaire.mo
index ceb2342063622eec26433725e36e0b9dfa19a328..10bdcbe7f352411cafd20ca75ced0c78d121fceb 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/RandomLineaire.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/RandomLineaire.mo
@@ -1,135 +1,135 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block RandomLineaire
-  parameter Integer seed=1 "Source du générateur aléatoire";
-  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage";
-  parameter Real SampleInterval=0.01 "Période d'échantillonnage";
-protected
-  Real p1;
-  Real p2;
-  Real t1;
-  Real t2;
-  discrete Real Interval;
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                   annotation (Placement(transformation(extent=
-            {{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uL
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-algorithm
-
-  when initial() then
-    Commun.srand(seed);
-    t1 := 0;
-    t2 := SampleOffset;
-    p1 := 0;
-    p2 := 0;
-    Interval := if uL.signal then SampleInterval else Modelica.Constants.inf;
-  end when;
-
-  when change(uL.signal) then
-    Interval := if uL.signal then SampleInterval else Modelica.Constants.inf;
-  end when;
-
-  when edge(uL.signal) then
-   p2 := 0;
-   p1 := 0;
-  end when;
-
-  when (sample(SampleOffset, Interval) and uL.signal) then
-    p1 := p2;
-    p2 := 2*(Commun.fmod(Commun.rand()/32768*10, 1) - 0.5);
-    t1 := time;
-    t2 := t2 + SampleInterval;
-  end when;
-
-  y.signal := if uL.signal then p1 + (p2 - p1)/SampleInterval*(time - t1) else 0;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,0},{82,0}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{98,0},{76,8},{76,-8},{98,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-89,90},{-36,72}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{72,-8},{96,-28}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(points={{-60,-20},{-40,20},{-20,-40},{0,-60},{20,0},{40,40},{60,0}},
-            color={0,0,0}),
-        Text(
-          extent={{-88,64},{-58,46}},
-          lineColor={0,0,255},
-          textString=
-               "1"),
-        Text(
-          extent={{-88,-52},{-58,-70}},
-          lineColor={0,0,255},
-          textString=
-               "-1")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{50,0},{100,0}}),
-        Line(points={{50,0},{100,0}}),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-82,66},{-82,-82}}, color={192,192,192}),
-        Line(points={{-92,-2},{80,-2}}, color={192,192,192}),
-        Polygon(
-          points={{-82,88},{-90,66},{-74,66},{-82,88}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{96,-2},{74,6},{74,-10},{96,-2}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-62,-22},{-42,18},{-22,-42},{-2,-62},{18,-2},{38,38},{58,
-              -2}}, color={0,0,0}),
-        Text(
-          extent={{-90,62},{-60,44}},
-          lineColor={0,0,255},
-          textString=
-               "1"),
-        Text(
-          extent={{-90,-54},{-60,-72}},
-          lineColor={0,0,255},
-          textString=
-               "-1")}),
-    Window(
-      x=0.32,
-      y=0.33,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-"));
-end RandomLineaire;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block RandomLineaire
+  parameter Integer seed=1 "Source du générateur aléatoire";
+  parameter Real SampleOffset=0 "Instant de départ de l'échantillonnage";
+  parameter Real SampleInterval=0.01 "Période d'échantillonnage";
+protected
+  Real p1;
+  Real p2;
+  Real t1;
+  Real t2;
+  discrete Real Interval;
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                   annotation (Placement(transformation(extent=
+            {{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical uL
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+algorithm
+
+  when initial() then
+    Commun.srand(seed);
+    t1 := 0;
+    t2 := SampleOffset;
+    p1 := 0;
+    p2 := 0;
+    Interval := if uL.signal then SampleInterval else Modelica.Constants.inf;
+  end when;
+
+  when change(uL.signal) then
+    Interval := if uL.signal then SampleInterval else Modelica.Constants.inf;
+  end when;
+
+  when edge(uL.signal) then
+   p2 := 0;
+   p1 := 0;
+  end when;
+
+  when (sample(SampleOffset, Interval) and uL.signal) then
+    p1 := p2;
+    p2 := 2*(Commun.fmod(Commun.rand()/32768*10, 1) - 0.5);
+    t1 := time;
+    t2 := t2 + SampleInterval;
+  end when;
+
+  y.signal := if uL.signal then p1 + (p2 - p1)/SampleInterval*(time - t1) else 0;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,0},{82,0}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{98,0},{76,8},{76,-8},{98,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-89,90},{-36,72}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{72,-8},{96,-28}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(points={{-60,-20},{-40,20},{-20,-40},{0,-60},{20,0},{40,40},{60,0}},
+            color={0,0,0}),
+        Text(
+          extent={{-88,64},{-58,46}},
+          lineColor={0,0,255},
+          textString=
+               "1"),
+        Text(
+          extent={{-88,-52},{-58,-70}},
+          lineColor={0,0,255},
+          textString=
+               "-1")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{50,0},{100,0}}),
+        Line(points={{50,0},{100,0}}),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-82,66},{-82,-82}}, color={192,192,192}),
+        Line(points={{-92,-2},{80,-2}}, color={192,192,192}),
+        Polygon(
+          points={{-82,88},{-90,66},{-74,66},{-82,88}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{96,-2},{74,6},{74,-10},{96,-2}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-62,-22},{-42,18},{-22,-42},{-2,-62},{18,-2},{38,38},{58,
+              -2}}, color={0,0,0}),
+        Text(
+          extent={{-90,62},{-60,44}},
+          lineColor={0,0,255},
+          textString=
+               "1"),
+        Text(
+          extent={{-90,-54},{-60,-72}},
+          lineColor={0,0,255},
+          textString=
+               "-1")}),
+    Window(
+      x=0.32,
+      y=0.33,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+"));
+end RandomLineaire;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/SinusExp.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/SinusExp.mo
index ecc4b89212c5800b10177b9235d3d86674aa8d8f..85dfa71676d28a7b7249eb6c8a56039ffd2f201e 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/SinusExp.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/SinusExp.mo
@@ -1,176 +1,176 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block SinusExp
-  parameter Real amplitude=1 "Amplitude du sinus";
-  parameter Real frequence=2 "Fréquence du sinus (Hz)";
-  parameter Real phase=0 "Phase du sinus (rad)";
-  parameter Real damping=1 "Coefficient d'amortissement du sinus";
-  parameter Real offset=0 "Décalage de la sortie";
-  parameter Real startTime=0 "Instant de départ de l'échelon";
-
-protected
-  constant Real pi=Modelica.Constants.pi;
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  y.signal = offset + (if time < startTime then 0 else amplitude*
-    Modelica.Math.exp(-(time - startTime)*damping)*Modelica.Math.sin(2*pi*
-    frequence*(time - startTime) + phase));
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,0},{68,0}}, color={192,192,192}),
-        Polygon(
-          points={{90,0},{68,8},{68,-8},{90,0}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,0},{-75.2,32.3},{-72,50.3},{-68.7,64.5},{-65.5,74.2},
-              {-62.3,79.3},{-59.1,79.6},{-55.9,75.3},{-52.7,67.1},{-48.6,52.2},
-              {-43,25.8},{-35,-13.9},{-30.2,-33.7},{-26.1,-45.9},{-22.1,-53.2},
-              {-18.1,-55.3},{-14.1,-52.5},{-10.1,-45.3},{-5.23,-32.1},{8.44,
-              13.7},{13.3,26.4},{18.1,34.8},{22.1,38},{26.9,37.2},{31.8,31.8},{
-              38.2,19.4},{51.1,-10.5},{57.5,-21.2},{63.1,-25.9},{68.7,-25.9},{
-              75.2,-20.5},{80,-13.8}}, color={0,0,0}),
-        Text(
-          extent={{-147,-152},{153,-112}},
-          lineColor={0,0,0},
-          textString=
-               "freqHz=%freqHz")}),
-    Window(
-      x=0.16,
-      y=0.34,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-80,-90},{-80,84}}, color={192,192,192}),
-        Polygon(
-          points={{-80,100},{-86,84},{-74,84},{-80,100}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-99,-40},{85,-40}}, color={192,192,192}),
-        Polygon(
-          points={{101,-40},{85,-34},{85,-46},{101,-40}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-50,0},{-46.1,28.2},{-43.5,44},{-40.9,56.4},{-38.2,64.9},{
-              -35.6,69.4},{-33,69.6},{-30.4,65.9},{-27.8,58.7},{-24.5,45.7},{
-              -19.9,22.5},{-13.4,-12.2},{-9.5,-29.5},{-6.23,-40.1},{-2.96,-46.5},
-              {0.302,-48.4},{3.57,-45.9},{6.83,-39.6},{10.8,-28.1},{21.9,12},{
-              25.8,23.1},{29.7,30.5},{33,33.3},{36.9,32.5},{40.8,27.8},{46,16.9},
-              {56.5,-9.2},{61.7,-18.6},{66.3,-22.7},{70.9,-22.6},{76.1,-18},{80,
-              -12.1}},
-          color={0,0,0},
-          thickness=0.5),
-        Text(
-          extent={{-106,10},{-83,-10}},
-          lineColor={160,160,164},
-          textString=
-               "offset"),
-        Text(
-          extent={{-72,-36},{-26,-54}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Text(
-          extent={{84,-52},{108,-72}},
-          lineColor={160,160,164},
-          textString=
-               "time"),
-        Text(
-          extent={{-79,104},{-39,87}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Line(
-          points={{-50,0},{18,0}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-50,0},{-81,0}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-50,77},{-50,0}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{18,-1},{18,76}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(points={{18,73},{-50,73}}, color={192,192,192}),
-        Text(
-          extent={{-42,88},{9,74}},
-          lineColor={160,160,164},
-          textString=
-               "1/frequence"),
-        Polygon(
-          points={{-49,73},{-40,75},{-40,71},{-49,73}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{18,73},{10,75},{10,71},{18,73}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-50,-61},{-19,-61}}, color={192,192,192}),
-        Polygon(
-          points={{-18,-61},{-26,-59},{-26,-63},{-18,-61}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-51,-63},{-27,-75}},
-          lineColor={160,160,164},
-          textString=
-               "t"),
-        Text(
-          extent={{-82,-67},{108,-96}},
-          lineColor={160,160,164},
-          textString=
-               "amplitude*exp(-damping*t)*sin(2*pi*frequence*t+phase)"),
-        Line(
-          points={{-50,0},{-50,-40}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-50,-54},{-50,-72}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-15,-77},{-1,-48}},
-          color={192,192,192},
-          pattern=LinePattern.Dash)}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.7</b></p>
-</HTML>
-"));
-end SinusExp;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block SinusExp
+  parameter Real amplitude=1 "Amplitude du sinus";
+  parameter Real frequence=2 "Fréquence du sinus (Hz)";
+  parameter Real phase=0 "Phase du sinus (rad)";
+  parameter Real damping=1 "Coefficient d'amortissement du sinus";
+  parameter Real offset=0 "Décalage de la sortie";
+  parameter Real startTime=0 "Instant de départ de l'échelon";
+
+protected
+  constant Real pi=Modelica.Constants.pi;
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  y.signal = offset + (if time < startTime then 0 else amplitude*
+    Modelica.Math.exp(-(time - startTime)*damping)*Modelica.Math.sin(2*pi*
+    frequence*(time - startTime) + phase));
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,0},{68,0}}, color={192,192,192}),
+        Polygon(
+          points={{90,0},{68,8},{68,-8},{90,0}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,0},{-75.2,32.3},{-72,50.3},{-68.7,64.5},{-65.5,74.2},
+              {-62.3,79.3},{-59.1,79.6},{-55.9,75.3},{-52.7,67.1},{-48.6,52.2},
+              {-43,25.8},{-35,-13.9},{-30.2,-33.7},{-26.1,-45.9},{-22.1,-53.2},
+              {-18.1,-55.3},{-14.1,-52.5},{-10.1,-45.3},{-5.23,-32.1},{8.44,
+              13.7},{13.3,26.4},{18.1,34.8},{22.1,38},{26.9,37.2},{31.8,31.8},{
+              38.2,19.4},{51.1,-10.5},{57.5,-21.2},{63.1,-25.9},{68.7,-25.9},{
+              75.2,-20.5},{80,-13.8}}, color={0,0,0}),
+        Text(
+          extent={{-147,-152},{153,-112}},
+          lineColor={0,0,0},
+          textString=
+               "freqHz=%freqHz")}),
+    Window(
+      x=0.16,
+      y=0.34,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-80,-90},{-80,84}}, color={192,192,192}),
+        Polygon(
+          points={{-80,100},{-86,84},{-74,84},{-80,100}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-99,-40},{85,-40}}, color={192,192,192}),
+        Polygon(
+          points={{101,-40},{85,-34},{85,-46},{101,-40}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-50,0},{-46.1,28.2},{-43.5,44},{-40.9,56.4},{-38.2,64.9},{
+              -35.6,69.4},{-33,69.6},{-30.4,65.9},{-27.8,58.7},{-24.5,45.7},{
+              -19.9,22.5},{-13.4,-12.2},{-9.5,-29.5},{-6.23,-40.1},{-2.96,-46.5},
+              {0.302,-48.4},{3.57,-45.9},{6.83,-39.6},{10.8,-28.1},{21.9,12},{
+              25.8,23.1},{29.7,30.5},{33,33.3},{36.9,32.5},{40.8,27.8},{46,16.9},
+              {56.5,-9.2},{61.7,-18.6},{66.3,-22.7},{70.9,-22.6},{76.1,-18},{80,
+              -12.1}},
+          color={0,0,0},
+          thickness=0.5),
+        Text(
+          extent={{-106,10},{-83,-10}},
+          lineColor={160,160,164},
+          textString=
+               "offset"),
+        Text(
+          extent={{-72,-36},{-26,-54}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Text(
+          extent={{84,-52},{108,-72}},
+          lineColor={160,160,164},
+          textString=
+               "time"),
+        Text(
+          extent={{-79,104},{-39,87}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Line(
+          points={{-50,0},{18,0}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-50,0},{-81,0}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-50,77},{-50,0}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{18,-1},{18,76}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(points={{18,73},{-50,73}}, color={192,192,192}),
+        Text(
+          extent={{-42,88},{9,74}},
+          lineColor={160,160,164},
+          textString=
+               "1/frequence"),
+        Polygon(
+          points={{-49,73},{-40,75},{-40,71},{-49,73}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{18,73},{10,75},{10,71},{18,73}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-50,-61},{-19,-61}}, color={192,192,192}),
+        Polygon(
+          points={{-18,-61},{-26,-59},{-26,-63},{-18,-61}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-51,-63},{-27,-75}},
+          lineColor={160,160,164},
+          textString=
+               "t"),
+        Text(
+          extent={{-82,-67},{108,-96}},
+          lineColor={160,160,164},
+          textString=
+               "amplitude*exp(-damping*t)*sin(2*pi*frequence*t+phase)"),
+        Line(
+          points={{-50,0},{-50,-40}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-50,-54},{-50,-72}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-15,-77},{-1,-48}},
+          color={192,192,192},
+          pattern=LinePattern.Dash)}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.7</b></p>
+</HTML>
+"));
+end SinusExp;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Sinusoide.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Sinusoide.mo
index a3f8c03000ff2c2de763340938318eb7e15dcdf2..d03479049759d91c31689c383f7b82ac37899a47 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Sinusoide.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Sinusoide.mo
@@ -1,138 +1,138 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block Sinusoide
-  parameter Real amplitude=1 "Amplitude";
-  parameter Real period=1 "Periode (s)";
-  parameter Real phase=0 "Phase (rad)";
-  parameter Real offset=0 "Décalage de la sortie";
-  parameter Real startTime=0 "Instant de départ de la sinusoide (s)";
-
-protected
-  constant Real pi=Modelica.Constants.pi;
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  y.signal = offset + (if time < startTime then 0 else amplitude*
-    Modelica.Math.sin(2*pi*(time - startTime)/period + phase));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-80,-90},{-80,84}}, color={192,192,192}),
-        Polygon(
-          points={{-80,100},{-86,84},{-74,84},{-80,100}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-99,-40},{85,-40}}, color={192,192,192}),
-        Polygon(
-          points={{101,-40},{85,-34},{85,-46},{101,-40}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,0},{-31.6,34.2},{-26.1,53.1},{-21.3,66.4},{-17.1,74.6},{
-              -12.9,79.1},{-8.64,79.8},{-4.42,76.6},{-0.201,69.7},{4.02,59.4},{
-              8.84,44.1},{14.9,21.2},{27.5,-30.8},{33,-50.2},{37.8,-64.2},{42,
-              -73.1},{46.2,-78.4},{50.5,-80},{54.7,-77.6},{58.9,-71.5},{63.1,
-              -61.9},{67.9,-47.2},{74,-24.8},{80,0}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-41,-2},{-80,-2}},
-          color={0,0,0},
-          thickness=0.5),
-        Text(
-          extent={{-128,7},{-82,-11}},
-          lineColor={160,160,164},
-          textString=
-               "offset"),
-        Line(
-          points={{-41,-2},{-41,-40}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Text(
-          extent={{-60,-43},{-14,-61}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Text(
-          extent={{84,-52},{108,-72}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Text(
-          extent={{-84,106},{-43,86}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Line(
-          points={{-9,79},{43,79}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-42,-1},{50,0}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Polygon(
-          points={{33,80},{30,67},{37,67},{33,80}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{37,57},{83,39}},
-          lineColor={160,160,164},
-          textString=
-               "amplitude"),
-        Polygon(
-          points={{33,1},{30,14},{36,14},{33,1},{33,1}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{33,79},{33,0}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-41,-2},{-80,-2}}, color={0,0,0}),
-        Line(points={{-40,0},{-31.6,34.2},{-26.1,53.1},{-21.3,66.4},{-17.1,74.6},
-              {-12.9,79.1},{-8.64,79.8},{-4.42,76.6},{-0.201,69.7},{4.02,59.4},
-              {8.84,44.1},{14.9,21.2},{27.5,-30.8},{33,-50.2},{37.8,-64.2},{42,
-              -73.1},{46.2,-78.4},{50.5,-80},{54.7,-77.6},{58.9,-71.5},{63.1,
-              -61.9},{67.9,-47.2},{74,-24.8},{80,0}}, color={0,0,0}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,-100},{100,100}}, lineColor={0,0,255}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name")}),
-    Window(
-      x=0.35,
-      y=0.28,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.7</b></p>
-</HTML>
-"));
-end Sinusoide;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block Sinusoide
+  parameter Real amplitude=1 "Amplitude";
+  parameter Real period=1 "Periode (s)";
+  parameter Real phase=0 "Phase (rad)";
+  parameter Real offset=0 "Décalage de la sortie";
+  parameter Real startTime=0 "Instant de départ de la sinusoide (s)";
+
+protected
+  constant Real pi=Modelica.Constants.pi;
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  y.signal = offset + (if time < startTime then 0 else amplitude*
+    Modelica.Math.sin(2*pi*(time - startTime)/period + phase));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-80,-90},{-80,84}}, color={192,192,192}),
+        Polygon(
+          points={{-80,100},{-86,84},{-74,84},{-80,100}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-99,-40},{85,-40}}, color={192,192,192}),
+        Polygon(
+          points={{101,-40},{85,-34},{85,-46},{101,-40}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,0},{-31.6,34.2},{-26.1,53.1},{-21.3,66.4},{-17.1,74.6},{
+              -12.9,79.1},{-8.64,79.8},{-4.42,76.6},{-0.201,69.7},{4.02,59.4},{
+              8.84,44.1},{14.9,21.2},{27.5,-30.8},{33,-50.2},{37.8,-64.2},{42,
+              -73.1},{46.2,-78.4},{50.5,-80},{54.7,-77.6},{58.9,-71.5},{63.1,
+              -61.9},{67.9,-47.2},{74,-24.8},{80,0}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-41,-2},{-80,-2}},
+          color={0,0,0},
+          thickness=0.5),
+        Text(
+          extent={{-128,7},{-82,-11}},
+          lineColor={160,160,164},
+          textString=
+               "offset"),
+        Line(
+          points={{-41,-2},{-41,-40}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Text(
+          extent={{-60,-43},{-14,-61}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Text(
+          extent={{84,-52},{108,-72}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Text(
+          extent={{-84,106},{-43,86}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Line(
+          points={{-9,79},{43,79}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-42,-1},{50,0}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Polygon(
+          points={{33,80},{30,67},{37,67},{33,80}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{37,57},{83,39}},
+          lineColor={160,160,164},
+          textString=
+               "amplitude"),
+        Polygon(
+          points={{33,1},{30,14},{36,14},{33,1},{33,1}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{33,79},{33,0}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-41,-2},{-80,-2}}, color={0,0,0}),
+        Line(points={{-40,0},{-31.6,34.2},{-26.1,53.1},{-21.3,66.4},{-17.1,74.6},
+              {-12.9,79.1},{-8.64,79.8},{-4.42,76.6},{-0.201,69.7},{4.02,59.4},
+              {8.84,44.1},{14.9,21.2},{27.5,-30.8},{33,-50.2},{37.8,-64.2},{42,
+              -73.1},{46.2,-78.4},{50.5,-80},{54.7,-77.6},{58.9,-71.5},{63.1,
+              -61.9},{67.9,-47.2},{74,-24.8},{80,0}}, color={0,0,0}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,-100},{100,100}}, lineColor={0,0,255}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name")}),
+    Window(
+      x=0.35,
+      y=0.28,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.7</b></p>
+</HTML>
+"));
+end Sinusoide;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Trapezoide.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Trapezoide.mo
index 1e7fc5ad2f897b7d61d329c14b0e1b40561646dc..8ec0f11bdefb781dc024af1d07b1c23b78f0b345 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Trapezoide.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/Trapezoide.mo
@@ -1,234 +1,234 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
-block Trapezoide
-  parameter Real amplitude=1 "Amplitude du trapèze";
-  parameter Real rising(final min=0) = 0.5 "Durée du front montant (s)";
-  parameter Real largeur(final min=0) = 2 "Largeur du trapèze (s)";
-  parameter Real falling(final min=0) = 0.5 "Durée du front descendant (s)";
-  parameter Real periode(final min=Modelica.Constants.small) = 4 "Période (s)";
-  parameter Integer n=-1 "Nombre de périodes (< 0 nombre de périodes infini)";
-  parameter Real offset=0 "Décalage de la sortie";
-  parameter Real startTime=0 "Instant de départ de l'échelon";
-
-protected
-  Real T0(final start=startTime) "Instant de départ de la période courante";
-  Integer counter(start=n);
-  Integer counter2(start=n);
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  when ((pre(counter2) <> 0) and sample(startTime, periode)) then
-    T0 = time;
-    counter2 = pre(counter);
-    counter = pre(counter) - (if pre(counter) > 0 then 1 else 0);
-  end when;
-
-  y.signal = offset + (if (time < startTime or (counter2 == 0) or (time >= T0
-     + rising + largeur + falling)) then 0 else if (time < T0 + rising) then (
-    time - T0)*amplitude/rising else if (time < T0 + rising + largeur) then
-    amplitude else (T0 + rising + largeur - time)*amplitude/falling + amplitude);
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(
-          extent={{-100,-100},{100,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-81,-70},{-60,-70},{-30,40},{9,40},{39,-70},{61,-70},{90,
-              40}}, color={0,0,0})}),
-    Window(
-      x=0.16,
-      y=0.11,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-80,90},{-88,68},{-72,68},{-80,90}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
-        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
-        Polygon(
-          points={{90,-70},{68,-62},{68,-78},{90,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-45,-30},{-47,-41},{-43,-41},{-45,-30}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-45,-31},{-45,-70}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Polygon(
-          points={{-45,-70},{-47,-60},{-43,-60},{-45,-70},{-45,-70}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-86,-43},{-43,-55}},
-          lineColor={160,160,164},
-          textString=
-               "offset"),
-        Text(
-          extent={{-47,-69},{-1,-87}},
-          lineColor={160,160,164},
-          textString=
-               "startTime"),
-        Text(
-          extent={{-84,91},{-43,71}},
-          lineColor={160,160,164},
-          textString=
-               "y"),
-        Text(
-          extent={{70,-80},{94,-100}},
-          lineColor={160,160,164},
-          textString=
-               "temps"),
-        Line(
-          points={{-29,82},{-30,-70}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-10,59},{-10,40}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{20,59},{20,39}},
-          color={160,160,164},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{40,59},{40,-30}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(points={{-20,76},{61,76}}, color={192,192,192}),
-        Line(points={{-29,56},{40,56}}, color={192,192,192}),
-        Text(
-          extent={{-2,86},{25,77}},
-          lineColor={160,160,164},
-          textString=
-               "periode"),
-        Text(
-          extent={{-8,70},{21,60}},
-          lineColor={160,160,164},
-          textString=
-               "largeur"),
-        Line(
-          points={{-42,40},{-10,40}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-39,40},{-39,-19}},
-          color={192,192,192},
-          pattern=LinePattern.Solid,
-          thickness=0.25,
-          arrow={Arrow.None,Arrow.None}),
-        Text(
-          extent={{-77,14},{-40,0}},
-          lineColor={160,160,164},
-          textString=
-               "amplitude"),
-        Polygon(
-          points={{-29,56},{-22,58},{-22,54},{-29,56}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-10,56},{-17,58},{-17,54},{-10,56}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-29,76},{-20,78},{-20,74},{-29,76}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{61,76},{53,78},{53,74},{61,76}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-80,-30},{-30,-30},{-10,40},{20,40},{40,-30},{60,-30},{80,40},
-              {100,40}},
-          color={0,0,0},
-          thickness=0.5),
-        Polygon(
-          points={{-39,40},{-41,29},{-37,29},{-39,40}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-39,-29},{-41,-19},{-37,-19},{-39,-29},{-39,-29}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{61,84},{60,-30}},
-          color={192,192,192},
-          pattern=LinePattern.Dash),
-        Polygon(
-          points={{39,56},{32,58},{32,54},{39,56}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{20,56},{27,58},{27,54},{20,56}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{20,56},{13,58},{13,54},{20,56}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-12,56},{-5,58},{-5,54},{-12,56}},
-          lineColor={192,192,192},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-34,70},{-5,60}},
-          lineColor={160,160,164},
-          textString=
-               "rising"),
-        Text(
-          extent={{16,70},{45,60}},
-          lineColor={160,160,164},
-          textString=
-               "falling")}),
-    Documentation(info="<html>
-<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Trapezoide;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block Trapezoide
+  parameter Real amplitude=1 "Amplitude du trapèze";
+  parameter Real rising(final min=0) = 0.5 "Durée du front montant (s)";
+  parameter Real largeur(final min=0) = 2 "Largeur du trapèze (s)";
+  parameter Real falling(final min=0) = 0.5 "Durée du front descendant (s)";
+  parameter Real periode(final min=Modelica.Constants.small) = 4 "Période (s)";
+  parameter Integer n=-1 "Nombre de périodes (< 0 nombre de périodes infini)";
+  parameter Real offset=0 "Décalage de la sortie";
+  parameter Real startTime=0 "Instant de départ de l'échelon";
+
+protected
+  Real T0(final start=startTime) "Instant de départ de la période courante";
+  Integer counter(start=n);
+  Integer counter2(start=n);
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  when ((pre(counter2) <> 0) and sample(startTime, periode)) then
+    T0 = time;
+    counter2 = pre(counter);
+    counter = pre(counter) - (if pre(counter) > 0 then 1 else 0);
+  end when;
+
+  y.signal = offset + (if (time < startTime or (counter2 == 0) or (time >= T0
+     + rising + largeur + falling)) then 0 else if (time < T0 + rising) then (
+    time - T0)*amplitude/rising else if (time < T0 + rising + largeur) then
+    amplitude else (T0 + rising + largeur - time)*amplitude/falling + amplitude);
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(
+          extent={{-100,-100},{100,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-81,-70},{-60,-70},{-30,40},{9,40},{39,-70},{61,-70},{90,
+              40}}, color={0,0,0})}),
+    Window(
+      x=0.16,
+      y=0.11,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-80,90},{-88,68},{-72,68},{-80,90}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,68},{-80,-80}}, color={192,192,192}),
+        Line(points={{-90,-70},{82,-70}}, color={192,192,192}),
+        Polygon(
+          points={{90,-70},{68,-62},{68,-78},{90,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-45,-30},{-47,-41},{-43,-41},{-45,-30}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-45,-31},{-45,-70}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Polygon(
+          points={{-45,-70},{-47,-60},{-43,-60},{-45,-70},{-45,-70}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-86,-43},{-43,-55}},
+          lineColor={160,160,164},
+          textString=
+               "offset"),
+        Text(
+          extent={{-47,-69},{-1,-87}},
+          lineColor={160,160,164},
+          textString=
+               "startTime"),
+        Text(
+          extent={{-84,91},{-43,71}},
+          lineColor={160,160,164},
+          textString=
+               "y"),
+        Text(
+          extent={{70,-80},{94,-100}},
+          lineColor={160,160,164},
+          textString=
+               "temps"),
+        Line(
+          points={{-29,82},{-30,-70}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-10,59},{-10,40}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{20,59},{20,39}},
+          color={160,160,164},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{40,59},{40,-30}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(points={{-20,76},{61,76}}, color={192,192,192}),
+        Line(points={{-29,56},{40,56}}, color={192,192,192}),
+        Text(
+          extent={{-2,86},{25,77}},
+          lineColor={160,160,164},
+          textString=
+               "periode"),
+        Text(
+          extent={{-8,70},{21,60}},
+          lineColor={160,160,164},
+          textString=
+               "largeur"),
+        Line(
+          points={{-42,40},{-10,40}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-39,40},{-39,-19}},
+          color={192,192,192},
+          pattern=LinePattern.Solid,
+          thickness=0.25,
+          arrow={Arrow.None,Arrow.None}),
+        Text(
+          extent={{-77,14},{-40,0}},
+          lineColor={160,160,164},
+          textString=
+               "amplitude"),
+        Polygon(
+          points={{-29,56},{-22,58},{-22,54},{-29,56}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-10,56},{-17,58},{-17,54},{-10,56}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-29,76},{-20,78},{-20,74},{-29,76}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{61,76},{53,78},{53,74},{61,76}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-80,-30},{-30,-30},{-10,40},{20,40},{40,-30},{60,-30},{80,40},
+              {100,40}},
+          color={0,0,0},
+          thickness=0.5),
+        Polygon(
+          points={{-39,40},{-41,29},{-37,29},{-39,40}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-39,-29},{-41,-19},{-37,-19},{-39,-29},{-39,-29}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{61,84},{60,-30}},
+          color={192,192,192},
+          pattern=LinePattern.Dash),
+        Polygon(
+          points={{39,56},{32,58},{32,54},{39,56}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{20,56},{27,58},{27,54},{20,56}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{20,56},{13,58},{13,54},{20,56}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-12,56},{-5,58},{-5,54},{-12,56}},
+          lineColor={192,192,192},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-34,70},{-5,60}},
+          lineColor={160,160,164},
+          textString=
+               "rising"),
+        Text(
+          extent={{16,70},{45,60}},
+          lineColor={160,160,164},
+          textString=
+               "falling")}),
+    Documentation(info="<html>
+<p><b>Adapted from the Modelica.Blocks.Sources library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Trapezoide;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/WirelessSensor.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/WirelessSensor.mo
new file mode 100644
index 0000000000000000000000000000000000000000..91cff5fd4ab314ef7e3285cd39f7c92b19182d81
--- /dev/null
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/WirelessSensor.mo
@@ -0,0 +1,107 @@
+within ThermoSysPro.InstrumentationAndControl.Blocks.Sources;
+block WirelessSensor
+  "Mesure data with expression, no connection (as MSL RealExpression)"
+
+  Real m=0.0 "Measure Expression" annotation (Dialog(group="Measured data"));
+
+  parameter Boolean ValidityRange=false "Intensity colorscale by default (jet colormap); ValidityRange: green if close to nominal value"
+                                                                                                                                        annotation(Dialog(group="Animation"),choices(checkBox=true));
+  parameter Real min_range = 0 "Color Scale Min Value" annotation (Dialog(group="Animation"));
+  parameter Real max_range = 14 "Color Scale Max Value" annotation (Dialog(group="Animation"));
+  parameter Real m_nominal = 10 "Color Scale nominal Value" annotation (Dialog(enable=ValidityRange,group="Animation",groupImage = ("modelica://ThermoSysPro/InstrumentationAndControl/Blocks/Sources/colorMap_WirelessSensor.png")));
+  parameter Integer significantDigits(min=1) = 2
+    "Number of significant digits to be shown" annotation (Dialog(group="Animation"));
+
+
+  Real measure_col[3](each min=0, each max=255) "Corrspondig color for the box";
+  Real neg_col[3](each min=0, each max=255) "Negative color for the text";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+    annotation (Placement(transformation(extent={{100,-10},{120,10}}),
+        iconTransformation(extent={{100,-10},{120,10}})));
+
+protected
+parameter Integer n_colors=64 "Number of colors in the colorMap";
+parameter Real colorMapData_jet[n_colors,3] = Modelica.Mechanics.MultiBody.Visualizers.Colors.ColorMaps.jet(n_colors);  //Defined as parameters to have less equations, not defined directly in scalarToColor because of compatibility with OpenModelica
+parameter Real colorMapData_redGreen[n_colors,3] = ThermoSysPro.Functions.Utilities.RedGreen_colorMap(n_colors);    //Defined as parameters to have less equations, not defined directly in scalarToColor because of compatibility with OpenModelica
+
+equation
+  y.signal=m;
+  if ValidityRange then
+  measure_col =ThermoSysPro.Functions.Utilities.scalarToColor_validityRange(
+    T=m,
+    T_nominal=m_nominal,
+    T_min=min_range,
+    T_max=max_range,
+    colorMap=colorMapData_redGreen);
+  else
+  measure_col = Modelica.Mechanics.MultiBody.Visualizers.Colors.scalarToColor(
+        T=m,
+        T_min=min_range,
+        T_max=max_range,
+        colorMap=colorMapData_jet);
+  end if;
+
+  neg_col = fill(255,3) - measure_col;
+
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
+        Ellipse(
+          extent={{30,70},{140,-40}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          startAngle=-80,
+          endAngle=-10,
+          closure=EllipseClosure.None),
+        Polygon(
+          points={{-94,28},{94,28},{100,24},{100,-24},{94,-28},{-94,-28},{-100,-22},
+              {-100,22},{-94,28}},
+          lineColor={0,0,0},
+          fillColor=DynamicSelect({255,255,170}, {measure_col[1],measure_col[2],measure_col[3]}),
+          fillPattern=FillPattern.Solid,
+          lineThickness=0.5),
+        Text(
+          extent={{-100,28},{100,-24}},
+          textColor=DynamicSelect({0,0,0},{neg_col[1],neg_col[2],neg_col[3]}),
+          textString=DynamicSelect("M", String(m,significantDigits=significantDigits))),
+        Text(
+          extent={{-140,-92},{140,-134}},
+          textColor={95,95,95},
+          textString="%m"),
+        Ellipse(
+          extent={{48,58},{128,-22}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          startAngle=-80,
+          endAngle=-10,
+          closure=EllipseClosure.None),
+        Ellipse(
+          extent={{66,46},{116,-4}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          startAngle=-80,
+          endAngle=-10,
+          closure=EllipseClosure.None),
+        Ellipse(
+          extent={{-140,42},{-30,-68}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          startAngle=100,
+          endAngle=170,
+          closure=EllipseClosure.None),
+        Ellipse(
+          extent={{-128,26},{-48,-56}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          startAngle=100,
+          endAngle=170,
+          closure=EllipseClosure.None),
+        Ellipse(
+          extent={{-116,6},{-66,-44}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          startAngle=100,
+          endAngle=170,
+          closure=EllipseClosure.None)}),                Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    uses(ThermoSysPro(version="4.0"), Modelica(version="4.0.0")));
+end WirelessSensor;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/colorMap_RedGreen.png b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/colorMap_RedGreen.png
new file mode 100644
index 0000000000000000000000000000000000000000..36d5688218d11ac1aca586184c0c1d445af8064d
Binary files /dev/null and b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/colorMap_RedGreen.png differ
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/colorMap_WirelessSensor.png b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/colorMap_WirelessSensor.png
new file mode 100644
index 0000000000000000000000000000000000000000..02b64413236eada0a48287097dc007633409c831
Binary files /dev/null and b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/colorMap_WirelessSensor.png differ
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/package.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/package.mo
index e529d1fef2cddf7143597e20059a32428b295f61..14bfc325b324cbf145155eaa9d4b839fb7868764 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/package.mo
@@ -1,140 +1,137 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks;
-package Sources "Bibliothèque des blocs sources"
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Sources;
+within ThermoSysPro.InstrumentationAndControl.Blocks;
+package Sources "Bibliothèque des blocs sources"
+annotation (
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Sources;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/package.order b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/package.order
index 68cd950380939dd2c0f417a5fb52e335dab98955..9bd7c15db9fb53af02b07da3be2fbe71070e8c10 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/package.order
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Sources/package.order
@@ -10,3 +10,4 @@ RandomLineaire
 SinusExp
 Sinusoide
 Trapezoide
+WirelessSensor
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1D.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1D.mo
index 3eb9f87266f9810e3816adb13785db3329293b83..143faefd2c65127a04e49acce420d913d316c247 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1D.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1D.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Tables;
-block Table1D
-  parameter Real Table[:, 2]=[0, 0; 0, 0]
-    "Table (entrées = première colonne, sorties = deuxième colonne)";
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation";
-
-protected
-  parameter Real Tu[:]=Table[:, 1] "Entrées de la table";
-  parameter Real Ty[:]=Table[:, 2] "Sorties de la table";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
-                                      annotation (Placement(transformation(
-          extent={{-120,-10},{-100,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  if (option_interpolation == 1) then
-    y.signal = ThermoSysPro.Functions.LinearInterpolation(Tu, Ty, u.signal);
-  elseif (option_interpolation == 2) then
-     y.signal = ThermoSysPro.Functions.SplineInterpolation(Tu, Ty, u.signal);
-  else
-    assert(false, "Table1D: incorrect interpolation option");
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
-        Line(points={{80,0},{100,0}}),
-        Line(points={{28,40},{28,-40}}, color={0,0,0}),
-        Rectangle(
-          extent={{-26,40},{0,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,20},{0,0}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,0},{0,-20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,-20},{0,-40}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-24,56},{-6,44}}, textString=
-                                            "u"),
-        Text(extent={{2,56},{26,44}}, textString=
-                                          "y"),
-        Text(extent={{-98,14},{-80,2}}, textString=
-                                            "u"),
-        Text(extent={{78,14},{102,2}}, textString=
-                                           "y"),
-        Line(points={{-80,0},{-100,0}}),
-        Line(points={{0,40},{28,40}}, color={0,0,0}),
-        Line(points={{0,20},{28,20}}, color={0,0,0}),
-        Line(points={{0,0},{28,0}}, color={0,0,0}),
-        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
-        Line(points={{0,-40},{28,-40}}, color={0,0,0})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
-        Line(points={{80,0},{100,0}}),
-        Line(points={{28,40},{28,-40}}, color={0,0,0}),
-        Rectangle(
-          extent={{-26,40},{0,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,20},{0,0}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,0},{0,-20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,-20},{0,-40}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-24,56},{-6,44}}, textString=
-                                            "u"),
-        Text(extent={{2,56},{26,44}}, textString=
-                                          "y"),
-        Text(extent={{-98,14},{-80,2}}, textString=
-                                            "u"),
-        Text(extent={{78,14},{102,2}}, textString=
-                                           "y"),
-        Line(points={{-80,0},{-100,0}}),
-        Line(points={{0,40},{28,40}}, color={0,0,0}),
-        Line(points={{0,20},{28,20}}, color={0,0,0}),
-        Line(points={{0,0},{28,0}}, color={0,0,0}),
-        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
-        Line(points={{0,-40},{28,-40}}, color={0,0,0})}),
-    Window(
-      x=0.17,
-      y=0.19,
-      width=0.83,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Adapted from the ModelicaAdditions.Blocks.Tables library</b> </p>
-<p><b>Version 3.1</h4>
-</html>"));
-end Table1D;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Tables;
+block Table1D
+  parameter Real Table[:, 2]=[0, 0; 0, 0]
+    "Table (entrées = première colonne, sorties = deuxième colonne)";
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation";
+
+protected
+  parameter Real Tu[:]=Table[:, 1] "Entrées de la table";
+  parameter Real Ty[:]=Table[:, 2] "Sorties de la table";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u
+                                      annotation (Placement(transformation(
+          extent={{-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  if (option_interpolation == 1) then
+    y.signal = ThermoSysPro.Functions.LinearInterpolation(Tu, Ty, u.signal);
+  elseif (option_interpolation == 2) then
+     y.signal = ThermoSysPro.Functions.SplineInterpolation(Tu, Ty, u.signal);
+  else
+    assert(false, "Table1D: incorrect interpolation option");
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
+        Line(points={{80,0},{100,0}}),
+        Line(points={{28,40},{28,-40}}, color={0,0,0}),
+        Rectangle(
+          extent={{-26,40},{0,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,20},{0,0}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,0},{0,-20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,-20},{0,-40}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-24,56},{-6,44}}, textString=
+                                            "u"),
+        Text(extent={{2,56},{26,44}}, textString=
+                                          "y"),
+        Text(extent={{-98,14},{-80,2}}, textString=
+                                            "u"),
+        Text(extent={{78,14},{102,2}}, textString=
+                                           "y"),
+        Line(points={{-80,0},{-100,0}}),
+        Line(points={{0,40},{28,40}}, color={0,0,0}),
+        Line(points={{0,20},{28,20}}, color={0,0,0}),
+        Line(points={{0,0},{28,0}}, color={0,0,0}),
+        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
+        Line(points={{0,-40},{28,-40}}, color={0,0,0})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
+        Line(points={{80,0},{100,0}}),
+        Line(points={{28,40},{28,-40}}, color={0,0,0}),
+        Rectangle(
+          extent={{-26,40},{0,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,20},{0,0}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,0},{0,-20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,-20},{0,-40}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-24,56},{-6,44}}, textString=
+                                            "u"),
+        Text(extent={{2,56},{26,44}}, textString=
+                                          "y"),
+        Text(extent={{-98,14},{-80,2}}, textString=
+                                            "u"),
+        Text(extent={{78,14},{102,2}}, textString=
+                                           "y"),
+        Line(points={{-80,0},{-100,0}}),
+        Line(points={{0,40},{28,40}}, color={0,0,0}),
+        Line(points={{0,20},{28,20}}, color={0,0,0}),
+        Line(points={{0,0},{28,0}}, color={0,0,0}),
+        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
+        Line(points={{0,-40},{28,-40}}, color={0,0,0})}),
+    Window(
+      x=0.17,
+      y=0.19,
+      width=0.83,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Adapted from the ModelicaAdditions.Blocks.Tables library</b> </p>
+<p><b>Version 3.1</h4>
+</html>"));
+end Table1D;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1DTemps.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1DTemps.mo
index d4ecd42af90d8ba1022ba345dc75ee01cba82725..720d0abd6c682ea47b2c3657f2721d461fe2a944 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1DTemps.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1DTemps.mo
@@ -1,116 +1,116 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Tables;
-block Table1DTemps
-  parameter Real Table[:, 2]=[0, 0; 1, 0] "Table (temps = première colonne)";
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation";
-
-protected
-  parameter Real Tu[:]=Table[:, 1] "Entrées de la table";
-  parameter Real Ty[:]=Table[:, 2] "Sorties de la table";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-equation
-
-  if (option_interpolation == 1) then
-    y.signal = ThermoSysPro.Functions.LinearInterpolation(Tu, Ty, time);
-  elseif (option_interpolation == 2) then
-    y.signal = ThermoSysPro.Functions.SplineInterpolation(Tu, Ty, time);
-  else
-    assert(false, "Table1DTemps: incorrect interpolation option");
-  end if;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
-        Text(extent={{-24,56},{-2,42}}, textString=
-                                            "temps"),
-        Text(extent={{2,56},{26,44}}, textString=
-                                          "y"),
-        Text(extent={{78,14},{102,2}}, textString=
-                                           "y"),
-        Line(points={{0,40},{28,40}}, color={0,0,0}),
-        Rectangle(
-          extent={{-26,40},{0,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,20},{0,0}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,0},{0,-20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,-20},{0,-40}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{28,40},{28,-40}}, color={0,0,0}),
-        Line(points={{0,20},{28,20}}, color={0,0,0}),
-        Line(points={{0,0},{28,0}}, color={0,0,0}),
-        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
-        Text(extent={{78,14},{102,2}}, textString=
-                                           "y"),
-        Line(points={{80,0},{100,0}}),
-        Line(points={{0,-40},{28,-40}}, color={0,0,0}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name")}),
-    Window(
-      x=0.24,
-      y=0.35,
-      width=0.73,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
-        Text(extent={{-24,56},{-4,44}}, textString=
-                                            "temps"),
-        Text(extent={{2,56},{26,44}}, textString=
-                                          "y"),
-        Text(extent={{78,14},{102,2}}, textString=
-                                           "y"),
-        Line(points={{0,40},{28,40}}, color={0,0,0}),
-        Rectangle(
-          extent={{-26,40},{0,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,20},{0,0}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,0},{0,-20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,-20},{0,-40}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{28,40},{28,-40}}, color={0,0,0}),
-        Line(points={{0,20},{28,20}}, color={0,0,0}),
-        Line(points={{0,0},{28,0}}, color={0,0,0}),
-        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
-        Text(extent={{78,14},{102,2}}, textString=
-                                           "y"),
-        Line(points={{80,0},{100,0}}),
-        Line(points={{0,-40},{28,-40}}, color={0,0,0})}),
-    Documentation(info="<html>
-<p><b>Adapted from the ModelicaAdditions.Blocks.Tables library</b> </p>
-<p><b>Version 3.1</h4>
-</html>"));
-end Table1DTemps;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Tables;
+block Table1DTemps
+  parameter Real Table[:, 2]=[0, 0; 1, 0] "Table (temps = première colonne)";
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation";
+
+protected
+  parameter Real Tu[:]=Table[:, 1] "Entrées de la table";
+  parameter Real Ty[:]=Table[:, 2] "Sorties de la table";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+equation
+
+  if (option_interpolation == 1) then
+    y.signal = ThermoSysPro.Functions.LinearInterpolation(Tu, Ty, time);
+  elseif (option_interpolation == 2) then
+    y.signal = ThermoSysPro.Functions.SplineInterpolation(Tu, Ty, time);
+  else
+    assert(false, "Table1DTemps: incorrect interpolation option");
+  end if;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
+        Text(extent={{-24,56},{-2,42}}, textString=
+                                            "temps"),
+        Text(extent={{2,56},{26,44}}, textString=
+                                          "y"),
+        Text(extent={{78,14},{102,2}}, textString=
+                                           "y"),
+        Line(points={{0,40},{28,40}}, color={0,0,0}),
+        Rectangle(
+          extent={{-26,40},{0,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,20},{0,0}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,0},{0,-20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,-20},{0,-40}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{28,40},{28,-40}}, color={0,0,0}),
+        Line(points={{0,20},{28,20}}, color={0,0,0}),
+        Line(points={{0,0},{28,0}}, color={0,0,0}),
+        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
+        Text(extent={{78,14},{102,2}}, textString=
+                                           "y"),
+        Line(points={{80,0},{100,0}}),
+        Line(points={{0,-40},{28,-40}}, color={0,0,0}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name")}),
+    Window(
+      x=0.24,
+      y=0.35,
+      width=0.73,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
+        Text(extent={{-24,56},{-4,44}}, textString=
+                                            "temps"),
+        Text(extent={{2,56},{26,44}}, textString=
+                                          "y"),
+        Text(extent={{78,14},{102,2}}, textString=
+                                           "y"),
+        Line(points={{0,40},{28,40}}, color={0,0,0}),
+        Rectangle(
+          extent={{-26,40},{0,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,20},{0,0}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,0},{0,-20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,-20},{0,-40}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{28,40},{28,-40}}, color={0,0,0}),
+        Line(points={{0,20},{28,20}}, color={0,0,0}),
+        Line(points={{0,0},{28,0}}, color={0,0,0}),
+        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
+        Text(extent={{78,14},{102,2}}, textString=
+                                           "y"),
+        Line(points={{80,0},{100,0}}),
+        Line(points={{0,-40},{28,-40}}, color={0,0,0})}),
+    Documentation(info="<html>
+<p><b>Adapted from the ModelicaAdditions.Blocks.Tables library</b> </p>
+<p><b>Version 3.1</h4>
+</html>"));
+end Table1DTemps;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1DTempsBool.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1DTempsBool.mo
index 9819b5d40224cc50a8f5a56792172e9a02973aa8..80b8a7fd9f5bc5d6ffcb9273d9e343457a621f82 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1DTempsBool.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table1DTempsBool.mo
@@ -1,112 +1,112 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Tables;
-block Table1DTempsBool
-  parameter Real Table[:, 2]=[0, 0]
-    "Table (temps = première colonne, sequence strictement croissante).";
-protected
-  parameter Integer iMax=size(Table, 1);
-  Integer index(start=1, fixed=true);
-  discrete Boolean val(start=(Table[1,2]>0.5), fixed=true);
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
-    annotation (Placement(transformation(extent={{100,-10},{120,10}}, rotation=
-            0)));
-algorithm
-
-  when (time >= Table[index,1]) then
-    val := (Table[index, 2] > 0.5);
-    index := if (pre(index) < iMax) then pre(index) + 1 else pre(index);
-  end when;
-
-  yL.signal := val;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
-        Text(extent={{-24,54},{0,44}}, textString=
-                                            "temps"),
-        Line(points={{0,40},{28,40}}, color={0,0,0}),
-        Rectangle(
-          extent={{-26,40},{0,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,20},{0,0}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,0},{0,-20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,-20},{0,-40}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{28,40},{28,-40}}, color={0,0,0}),
-        Line(points={{0,20},{28,20}}, color={0,0,0}),
-        Line(points={{0,0},{28,0}}, color={0,0,0}),
-        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
-        Text(extent={{80,10},{100,0}}, textString=
-                                         "Bool"),
-        Line(points={{80,0},{100,0}}),
-        Line(points={{0,-40},{28,-40}}, color={0,0,0}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Text(extent={{6,54},{26,44}}, textString=
-                                        "Bool")}),
-    Window(
-      x=0.24,
-      y=0.35,
-      width=0.73,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
-        Text(extent={{-24,56},{-2,42}}, textString=
-                                          "temps"),
-        Text(extent={{2,56},{26,44}}, textString=
-                                          "Bool"),
-        Line(points={{0,40},{28,40}}, color={0,0,0}),
-        Rectangle(
-          extent={{-26,40},{0,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,20},{0,0}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,0},{0,-20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-26,-20},{0,-40}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{28,40},{28,-40}}, color={0,0,0}),
-        Line(points={{0,20},{28,20}}, color={0,0,0}),
-        Line(points={{0,0},{28,0}}, color={0,0,0}),
-        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
-        Line(points={{80,0},{100,0}}),
-        Line(points={{0,-40},{28,-40}}, color={0,0,0})}),
-    Documentation(info="<html>
-<p><b>Adapted from the ModelicaAdditions.Blocks.Tables library</b></p>
-</HTML>
-<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-end Table1DTempsBool;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Tables;
+block Table1DTempsBool
+  parameter Real Table[:, 2]=[0, 0]
+    "Table (temps = première colonne, sequence strictement croissante).";
+protected
+  parameter Integer iMax=size(Table, 1);
+  Integer index(start=1, fixed=true);
+  discrete Boolean val(start=(Table[1,2]>0.5), fixed=true);
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputLogical yL
+    annotation (Placement(transformation(extent={{100,-10},{120,10}}, rotation=
+            0)));
+algorithm
+
+  when (time >= Table[index,1]) then
+    val := (Table[index, 2] > 0.5);
+    index := if (pre(index) < iMax) then pre(index) + 1 else pre(index);
+  end when;
+
+  yL.signal := val;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
+        Text(extent={{-24,54},{0,44}}, textString=
+                                            "temps"),
+        Line(points={{0,40},{28,40}}, color={0,0,0}),
+        Rectangle(
+          extent={{-26,40},{0,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,20},{0,0}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,0},{0,-20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,-20},{0,-40}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{28,40},{28,-40}}, color={0,0,0}),
+        Line(points={{0,20},{28,20}}, color={0,0,0}),
+        Line(points={{0,0},{28,0}}, color={0,0,0}),
+        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
+        Text(extent={{80,10},{100,0}}, textString=
+                                         "Bool"),
+        Line(points={{80,0},{100,0}}),
+        Line(points={{0,-40},{28,-40}}, color={0,0,0}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Text(extent={{6,54},{26,44}}, textString=
+                                        "Bool")}),
+    Window(
+      x=0.24,
+      y=0.35,
+      width=0.73,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
+        Text(extent={{-24,56},{-2,42}}, textString=
+                                          "temps"),
+        Text(extent={{2,56},{26,44}}, textString=
+                                          "Bool"),
+        Line(points={{0,40},{28,40}}, color={0,0,0}),
+        Rectangle(
+          extent={{-26,40},{0,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,20},{0,0}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,0},{0,-20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-26,-20},{0,-40}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{28,40},{28,-40}}, color={0,0,0}),
+        Line(points={{0,20},{28,20}}, color={0,0,0}),
+        Line(points={{0,0},{28,0}}, color={0,0,0}),
+        Line(points={{0,-20},{28,-20}}, color={0,0,0}),
+        Line(points={{80,0},{100,0}}),
+        Line(points={{0,-40},{28,-40}}, color={0,0,0})}),
+    Documentation(info="<html>
+<p><b>Adapted from the ModelicaAdditions.Blocks.Tables library</b></p>
+</HTML>
+<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+end Table1DTempsBool;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table2D.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table2D.mo
index 47070a29a676bfcda2bb8674114e8540db21e2f5..001e4dd94623e55858840cbe189b723b0e432c49 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table2D.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/Table2D.mo
@@ -1,218 +1,218 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks.Tables;
-block Table2D
-  parameter Real Tu1[:,1]=[0; 0] "Entrées lignes de la table";
-  parameter Real Tu2[1,:]=[0, 0] "Entrées colonnes de la table";
-  parameter Real Ty[size(Tu1, 1), size(Tu2, 2)]=[0, 0; 0, 0]
-    "Sorties de la table";
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
-                                       annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
-                                       annotation (Placement(transformation(
-          extent={{-120,50},{-100,70}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
-                                       annotation (Placement(transformation(
-          extent={{-120,-70},{-100,-50}}, rotation=0)));
-equation
-
-  if (option_interpolation == 1) then
-    y.signal = ThermoSysPro.Functions.TableLinearInterpolation(Tu1[:, 1], Tu2[1, :], Ty, u1.signal, u2.signal);
-  elseif (option_interpolation == 2) then
-    y.signal = ThermoSysPro.Functions.TableSplineInterpolation(Tu1[:, 1], Tu2[1, :], Ty, u1.signal, u2.signal);
-  else
-    assert(false, "Table1D: incorrect interpolation option");
-  end if;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
-        Line(points={{-54,40},{-54,-40},{54,-40},{54,40},{28,40},{28,-40},{-28,
-              -40},{-28,40},{-54,40},{-54,20},{54,20},{54,0},{-54,0},{-54,-20},
-              {54,-20},{54,-40},{-54,-40},{-54,40},{54,40},{54,-40}}, color={0,
-              0,0}),
-        Line(points={{0,40},{0,-40}}, color={0,0,0}),
-        Rectangle(
-          extent={{-54,20},{-28,0}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-54,0},{-28,-20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-54,-20},{-28,-40}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-28,40},{0,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{0,40},{28,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{28,40},{54,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-54,40},{-28,20}}, color={0,0,0}),
-        Line(points={{-28,40},{-54,20}}, color={0,0,0}),
-        Text(extent={{-54,-40},{-30,-56}}, textString=
-                                               "u1"),
-        Text(extent={{28,58},{52,44}}, textString=
-                                           "u2"),
-        Text(extent={{-4,12},{30,-22}}, textString=
-                                            "y"),
-        Line(points={{80,0},{100,0}}),
-        Text(extent={{-150,150},{150,110}}, textString=
-                                                "%name"),
-        Line(points={{-100,60},{-80,60}}),
-        Line(points={{-80,-60},{-100,-60}})}),
-    Window(
-      x=0.13,
-      y=0.18,
-      width=0.73,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
-        Line(points={{-54,40},{-54,-40},{54,-40},{54,40},{28,40},{28,-40},{-28,
-              -40},{-28,40},{-54,40},{-54,20},{54,20},{54,0},{-54,0},{-54,-20},
-              {54,-20},{54,-40},{-54,-40},{-54,40},{54,40},{54,-40}}, color={0,
-              0,0}),
-        Line(points={{0,40},{0,-40}}, color={0,0,0}),
-        Rectangle(
-          extent={{-54,20},{-28,0}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-54,0},{-28,-20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-54,-20},{-28,-40}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-28,40},{0,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{0,40},{28,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{28,40},{54,20}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-54,40},{-28,20}}, color={0,0,0}),
-        Line(points={{-28,40},{-54,20}}, color={0,0,0}),
-        Text(extent={{-54,-40},{-30,-56}}, textString=
-                                               "u1"),
-        Text(extent={{28,58},{52,44}}, textString=
-                                           "u2"),
-        Text(extent={{-4,12},{30,-22}}, textString=
-                                            "y"),
-        Line(points={{80,0},{100,0}}),
-        Line(points={{-80,-60},{-100,-60}}),
-        Line(points={{-100,60},{-80,60}})}),
-    Documentation(info="<html>
-<p><b>Adapted from the ModelicaAdditions.Blocks.Tables library</b> </p>
-<p><b>Version 3.1</h4>
-</html>"),    Icon(
-      Rectangle(extent=[-80,80; 80,-80],   style(fillPattern=0)),
-      Line(points=[-54,40; -54,-40; 54,-40; 54,40; 28,40; 28,-40; -28,-40; -28,
-            40; -54,40; -54,20; 54,20; 54,0; -54,0; -54,-20; 54,-20; 54,-40;
-            -54,-40; -54,40; 54,40; 54,-40],               style(color=0)),
-      Line(points=[0,40; 0,-40],   style(color=0)),
-      Rectangle(extent=[-54,20; -28,0],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[-54,0; -28,-20],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[-54,-20; -28,-40],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[-28,40; 0,20],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[0,40; 28,20],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[28,40; 54,20],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Line(points=[-54,40; -28,20],   style(color=0)),
-      Line(points=[-28,40; -54,20],   style(color=0)),
-      Text(extent=[-54,-40; -30,-56],   string="u1"),
-      Text(extent=[56,38; 80,24],   string="u2"),
-      Text(extent=[0,0; 28,-20],     string="y"),
-      Line(points=[80,0; 100,0]),
-      Line(points=[-100,60; -80,60]),
-      Line(points=[-80,-60; -100,-60])), Diagram(
-      Rectangle(extent=[-80,80; 80,-80],   style(fillPattern=0)),
-      Line(points=[-54,40; -54,-40; 54,-40; 54,40; 28,40; 28,-40; -28,-40; -28,
-            40; -54,40; -54,20; 54,20; 54,0; -54,0; -54,-20; 54,-20; 54,-40;
-            -54,-40; -54,40; 54,40; 54,-40],               style(color=0)),
-      Line(points=[0,40; 0,-40],   style(color=0)),
-      Rectangle(extent=[-54,20; -28,0],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[-54,0; -28,-20],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[-54,-20; -28,-40],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[-28,40; 0,20],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[0,40; 28,20],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Rectangle(extent=[28,40; 54,20],   style(
-          color=0,
-          fillColor=6,
-          fillPattern=1)),
-      Line(points=[-54,40; -28,20],   style(color=0)),
-      Line(points=[-28,40; -54,20],   style(color=0)),
-      Text(extent=[-54,-40; -30,-56],   string="u1"),
-      Text(extent=[56,38; 80,24],   string="u2"),
-      Text(extent=[0,0; 28,-20],     string="y"),
-      Line(points=[80,0; 100,0]),
-      Line(points=[-100,60; -80,60]),
-      Line(points=[-80,-60; -100,-60])));
-end Table2D;
+within ThermoSysPro.InstrumentationAndControl.Blocks.Tables;
+block Table2D
+  parameter Real Tu1[:,1]=[0; 0] "Entrées lignes de la table";
+  parameter Real Tu2[1,:]=[0, 0] "Entrées colonnes de la table";
+  parameter Real Ty[size(Tu1, 1), size(Tu2, 2)]=[0, 0; 0, 0]
+    "Sorties de la table";
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal y
+                                       annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u1
+                                       annotation (Placement(transformation(
+          extent={{-120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal u2
+                                       annotation (Placement(transformation(
+          extent={{-120,-70},{-100,-50}}, rotation=0)));
+equation
+
+  if (option_interpolation == 1) then
+    y.signal = ThermoSysPro.Functions.TableLinearInterpolation(Tu1[:, 1], Tu2[1, :], Ty, u1.signal, u2.signal);
+  elseif (option_interpolation == 2) then
+    y.signal = ThermoSysPro.Functions.TableSplineInterpolation(Tu1[:, 1], Tu2[1, :], Ty, u1.signal, u2.signal);
+  else
+    assert(false, "Table1D: incorrect interpolation option");
+  end if;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
+        Line(points={{-54,40},{-54,-40},{54,-40},{54,40},{28,40},{28,-40},{-28,
+              -40},{-28,40},{-54,40},{-54,20},{54,20},{54,0},{-54,0},{-54,-20},
+              {54,-20},{54,-40},{-54,-40},{-54,40},{54,40},{54,-40}}, color={0,
+              0,0}),
+        Line(points={{0,40},{0,-40}}, color={0,0,0}),
+        Rectangle(
+          extent={{-54,20},{-28,0}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-54,0},{-28,-20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-54,-20},{-28,-40}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-28,40},{0,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{0,40},{28,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{28,40},{54,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-54,40},{-28,20}}, color={0,0,0}),
+        Line(points={{-28,40},{-54,20}}, color={0,0,0}),
+        Text(extent={{-54,-40},{-30,-56}}, textString=
+                                               "u1"),
+        Text(extent={{28,58},{52,44}}, textString=
+                                           "u2"),
+        Text(extent={{-4,12},{30,-22}}, textString=
+                                            "y"),
+        Line(points={{80,0},{100,0}}),
+        Text(extent={{-150,150},{150,110}}, textString=
+                                                "%name"),
+        Line(points={{-100,60},{-80,60}}),
+        Line(points={{-80,-60},{-100,-60}})}),
+    Window(
+      x=0.13,
+      y=0.18,
+      width=0.73,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(extent={{-80,80},{80,-80}}, lineColor={0,0,255}),
+        Line(points={{-54,40},{-54,-40},{54,-40},{54,40},{28,40},{28,-40},{-28,
+              -40},{-28,40},{-54,40},{-54,20},{54,20},{54,0},{-54,0},{-54,-20},
+              {54,-20},{54,-40},{-54,-40},{-54,40},{54,40},{54,-40}}, color={0,
+              0,0}),
+        Line(points={{0,40},{0,-40}}, color={0,0,0}),
+        Rectangle(
+          extent={{-54,20},{-28,0}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-54,0},{-28,-20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-54,-20},{-28,-40}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-28,40},{0,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{0,40},{28,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{28,40},{54,20}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-54,40},{-28,20}}, color={0,0,0}),
+        Line(points={{-28,40},{-54,20}}, color={0,0,0}),
+        Text(extent={{-54,-40},{-30,-56}}, textString=
+                                               "u1"),
+        Text(extent={{28,58},{52,44}}, textString=
+                                           "u2"),
+        Text(extent={{-4,12},{30,-22}}, textString=
+                                            "y"),
+        Line(points={{80,0},{100,0}}),
+        Line(points={{-80,-60},{-100,-60}}),
+        Line(points={{-100,60},{-80,60}})}),
+    Documentation(info="<html>
+<p><b>Adapted from the ModelicaAdditions.Blocks.Tables library</b> </p>
+<p><b>Version 3.1</h4>
+</html>"),    Icon(
+      Rectangle(extent=[-80,80; 80,-80],   style(fillPattern=0)),
+      Line(points=[-54,40; -54,-40; 54,-40; 54,40; 28,40; 28,-40; -28,-40; -28,
+            40; -54,40; -54,20; 54,20; 54,0; -54,0; -54,-20; 54,-20; 54,-40;
+            -54,-40; -54,40; 54,40; 54,-40],               style(color=0)),
+      Line(points=[0,40; 0,-40],   style(color=0)),
+      Rectangle(extent=[-54,20; -28,0],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[-54,0; -28,-20],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[-54,-20; -28,-40],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[-28,40; 0,20],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[0,40; 28,20],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[28,40; 54,20],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Line(points=[-54,40; -28,20],   style(color=0)),
+      Line(points=[-28,40; -54,20],   style(color=0)),
+      Text(extent=[-54,-40; -30,-56],   string="u1"),
+      Text(extent=[56,38; 80,24],   string="u2"),
+      Text(extent=[0,0; 28,-20],     string="y"),
+      Line(points=[80,0; 100,0]),
+      Line(points=[-100,60; -80,60]),
+      Line(points=[-80,-60; -100,-60])), Diagram(
+      Rectangle(extent=[-80,80; 80,-80],   style(fillPattern=0)),
+      Line(points=[-54,40; -54,-40; 54,-40; 54,40; 28,40; 28,-40; -28,-40; -28,
+            40; -54,40; -54,20; 54,20; 54,0; -54,0; -54,-20; 54,-20; 54,-40;
+            -54,-40; -54,40; 54,40; 54,-40],               style(color=0)),
+      Line(points=[0,40; 0,-40],   style(color=0)),
+      Rectangle(extent=[-54,20; -28,0],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[-54,0; -28,-20],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[-54,-20; -28,-40],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[-28,40; 0,20],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[0,40; 28,20],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Rectangle(extent=[28,40; 54,20],   style(
+          color=0,
+          fillColor=6,
+          fillPattern=1)),
+      Line(points=[-54,40; -28,20],   style(color=0)),
+      Line(points=[-28,40; -54,20],   style(color=0)),
+      Text(extent=[-54,-40; -30,-56],   string="u1"),
+      Text(extent=[56,38; 80,24],   string="u2"),
+      Text(extent=[0,0; 28,-20],     string="y"),
+      Line(points=[80,0; 100,0]),
+      Line(points=[-100,60; -80,60]),
+      Line(points=[-80,-60; -100,-60])));
+end Table2D;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/package.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/package.mo
index f7489df992f3552d14456d1855c5bee6ff7c2211..ecc5d693723aca3bfde028b219bf5a7fa98fad8e 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/Tables/package.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.InstrumentationAndControl.Blocks;
-package Tables
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end Tables;
+within ThermoSysPro.InstrumentationAndControl.Blocks;
+package Tables
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end Tables;
diff --git a/ThermoSysPro/InstrumentationAndControl/Blocks/package.mo b/ThermoSysPro/InstrumentationAndControl/Blocks/package.mo
index a89c426e9ecc601ed286014eae2391ed9c1191b0..7fa70a690c3fd41d23bce73f1211733059251036 100644
--- a/ThermoSysPro/InstrumentationAndControl/Blocks/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Blocks/package.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.InstrumentationAndControl;
-package Blocks "Signal blocks library"
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Version 1.1</b></p>
-</HTML>
-"));
-end Blocks;
+within ThermoSysPro.InstrumentationAndControl;
+package Blocks "Signal blocks library"
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Version 1.1</b></p>
+</HTML>
+"));
+end Blocks;
diff --git a/ThermoSysPro/InstrumentationAndControl/Common.mo b/ThermoSysPro/InstrumentationAndControl/Common.mo
index 2e520b2fd98f06c98f839b2a68f6c8675cac4c9e..7759f40c54341a184782f741be5378aeb96acaeb 100644
--- a/ThermoSysPro/InstrumentationAndControl/Common.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Common.mo
@@ -1,254 +1,254 @@
-within ThermoSysPro.InstrumentationAndControl;
-package Common
-
-
-  record Duree
-    Integer nb_jours(min=0) "Nombre de jours";
-    Integer nb_heures(min=0, max=23) "Nombre d'heures";
-    Integer nb_minutes(min=0, max=59) "Nombre de minutes";
-    Integer nb_secondes(min=0, max=59) "Nombre de secondes";
-    Integer nb_dixiemes_secondes(min=0, max=9) "Nombre de dixèmes de secondes";
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name"),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-      Window(
-        x=0.33,
-        y=0.33,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-  end Duree;
-
-  record DateEtHeure
-    Integer annee(min=2000) "Année";
-    Integer mois(min=1, max=12) "Mois dans l'année";
-    Integer jour(min=1, max=31) "Jour dans le mois";
-    Integer heure(min=0, max=23) "Heure du jour";
-    Integer minutes(min=0, max=59) "Nombre de minutes";
-    Integer secondes(min=0, max=59) "Nombre de secondes";
-    Integer nb_dixemes_secondes(min=0, max=9) "Nombre de dixèmes de secondes";
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name"),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-  end DateEtHeure;
-
-  function CvtEntierVersDuree
-    input Integer t "Duree en dixiemes secondes";
-    output Duree d "Duree"        annotation (Placement(transformation(extent={
-              {-70,-70},{70,70}}, rotation=0)));
-  algorithm
-
-    d.nb_jours := integer(t/24/3600/10);
-    d.nb_heures := integer((t - d.nb_jours*24*3600*10)/3600/10);
-    d.nb_minutes := integer((t - d.nb_jours*24*3600*10 - d.nb_heures*3600*10)/
-      60/10);
-    d.nb_secondes := integer((t - d.nb_jours*24*3600*10 - d.nb_heures*3600*10
-       - d.nb_minutes*60*10)/10);
-    d.nb_dixiemes_secondes := integer(t - d.nb_jours*24*3600*10 - d.nb_heures*
-      3600*10 - d.nb_minutes*60*10 - d.nb_secondes*10);
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Window(
-        x=0.27,
-        y=0.27,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-  end CvtEntierVersDuree;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}),
-    Window(
-      x=0.05,
-      y=0.26,
-      width=0.25,
-      height=0.25,
-      library=1,
-      autolayout=1),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2003</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-
-end Common;
+within ThermoSysPro.InstrumentationAndControl;
+package Common
+
+
+  record Duree
+    Integer nb_jours(min=0) "Nombre de jours";
+    Integer nb_heures(min=0, max=23) "Nombre d'heures";
+    Integer nb_minutes(min=0, max=59) "Nombre de minutes";
+    Integer nb_secondes(min=0, max=59) "Nombre de secondes";
+    Integer nb_dixiemes_secondes(min=0, max=9) "Nombre de dixèmes de secondes";
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name"),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+      Window(
+        x=0.33,
+        y=0.33,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+  end Duree;
+
+  record DateEtHeure
+    Integer annee(min=2000) "Année";
+    Integer mois(min=1, max=12) "Mois dans l'année";
+    Integer jour(min=1, max=31) "Jour dans le mois";
+    Integer heure(min=0, max=23) "Heure du jour";
+    Integer minutes(min=0, max=59) "Nombre de minutes";
+    Integer secondes(min=0, max=59) "Nombre de secondes";
+    Integer nb_dixemes_secondes(min=0, max=9) "Nombre de dixèmes de secondes";
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name"),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+  end DateEtHeure;
+
+  function CvtEntierVersDuree
+    input Integer t "Duree en dixiemes secondes";
+    output Duree d "Duree"        annotation (Placement(transformation(extent={
+              {-70,-70},{70,70}}, rotation=0)));
+  algorithm
+
+    d.nb_jours := integer(t/24/3600/10);
+    d.nb_heures := integer((t - d.nb_jours*24*3600*10)/3600/10);
+    d.nb_minutes := integer((t - d.nb_jours*24*3600*10 - d.nb_heures*3600*10)/
+      60/10);
+    d.nb_secondes := integer((t - d.nb_jours*24*3600*10 - d.nb_heures*3600*10
+       - d.nb_minutes*60*10)/10);
+    d.nb_dixiemes_secondes := integer(t - d.nb_jours*24*3600*10 - d.nb_heures*
+      3600*10 - d.nb_minutes*60*10 - d.nb_secondes*10);
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Window(
+        x=0.27,
+        y=0.27,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+  end CvtEntierVersDuree;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}),
+    Window(
+      x=0.05,
+      y=0.26,
+      width=0.25,
+      height=0.25,
+      library=1,
+      autolayout=1),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2003</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+
+end Common;
diff --git a/ThermoSysPro/InstrumentationAndControl/Connectors.mo b/ThermoSysPro/InstrumentationAndControl/Connectors.mo
index d3225e75b39d7160468ccf603fe3f47fbf0a0462..a03b75659398ea0fbec5b8cb0eddf16157db4d5b 100644
--- a/ThermoSysPro/InstrumentationAndControl/Connectors.mo
+++ b/ThermoSysPro/InstrumentationAndControl/Connectors.mo
@@ -1,326 +1,326 @@
-within ThermoSysPro.InstrumentationAndControl;
-package Connectors "Connectors"
-
-
-  connector InputDateAndTime
-    input ThermoSysPro.InstrumentationAndControl.Common.DateEtHeure
-                             signal;
-    annotation (
-      Window(
-        x=0.37,
-        y=0.02,
-        width=0.49,
-        height=0.65),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-1,-1},{1,1}},
-          grid={2,2}), graphics={Polygon(
-            points={{-1,1},{1,0},{-1,-1},{-1,1}},
-            lineColor={0,0,255},
-            fillColor={0,0,0},
-            fillPattern=FillPattern.Solid)}),
-      Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end InputDateAndTime;
-
-  connector OutputDateAndTime
-    output ThermoSysPro.InstrumentationAndControl.Common.DateEtHeure
-                              signal;
-    annotation (
-      Window(
-        x=0.29,
-        y=0.11,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-1,-1},{1,1}},
-          grid={2,2}), graphics={Polygon(
-            points={{-1,1},{1,0},{-1,-1},{-1,1}},
-            lineColor={0,0,255},
-            fillColor={192,192,192},
-            fillPattern=FillPattern.Solid)}),
-      Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end OutputDateAndTime;
-
-  connector InputReal
-    input Real signal;
-    annotation (
-      Diagram(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Polygon(
-            points={{-100,100},{-100,-100},{100,0},{-100,100}},
-            lineColor={0,0,255},
-            fillColor={0,127,255},
-            fillPattern=FillPattern.Solid)}),
-      Window(
-        x=0.34,
-        y=0.2,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end InputReal;
-
-  connector InputLogical
-     input Boolean signal;
-     annotation (
-       Window(
-         x=0.37,
-         y=0.02,
-         width=0.49,
-         height=0.65),
-       Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Polygon(
-            points={{-100,100},{-100,-100},{100,0},{-100,100}},
-            lineColor={0,0,255},
-            fillColor={255,255,0},
-            fillPattern=FillPattern.Solid)}),
-       Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end InputLogical;
-
-  connector InputInteger
-    input Integer signal;
-    annotation (
-      Diagram(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Polygon(
-            points={{-100,100},{-100,-100},{100,0},{-100,100}},
-            lineColor={0,0,255},
-            fillColor={255,0,255},
-            fillPattern=FillPattern.Solid)}),
-      Window(
-        x=0.34,
-        y=0.2,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-
-  end InputInteger;
-
-  connector OutputInteger
-    output Integer signal;
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Polygon(
-            points={{-100,100},{-100,-100},{100,0},{-100,100}},
-            lineColor={0,0,255},
-            fillColor={255,0,128},
-            fillPattern=FillPattern.Solid)}),
-      Window(
-        x=0.34,
-        y=0.18,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Version 1.6</b></p>
-</HTML>
-"));
-  end OutputInteger;
-
-  connector OutputLogical
-      output Boolean signal;
-      annotation (
-        Window(
-          x=0.29,
-          y=0.11,
-          width=0.6,
-          height=0.6),
-        Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Polygon(
-            points={{-100,100},{-100,-100},{100,0},{-100,100}},
-            lineColor={0,0,255},
-            fillColor={127,255,0},
-            fillPattern=FillPattern.Solid)}),
-        Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end OutputLogical;
-
-  connector OutputReal
-      output Real signal;
-      annotation (
-        Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Polygon(
-            points={{-100,100},{-100,-100},{100,0},{-100,100}},
-            lineColor={0,0,255},
-            fillColor={0,255,255},
-            fillPattern=FillPattern.Solid)}),
-        Window(
-          x=0.34,
-          y=0.18,
-          width=0.6,
-          height=0.6),
-        Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end OutputReal;
-  annotation (
-    Window(
-      x=0.05,
-      y=0.26,
-      width=0.25,
-      height=0.25,
-      library=1,
-      autolayout=1),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}),
-    Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-
-end Connectors;
+within ThermoSysPro.InstrumentationAndControl;
+package Connectors "Connectors"
+
+
+  connector InputDateAndTime
+    input ThermoSysPro.InstrumentationAndControl.Common.DateEtHeure
+                             signal;
+    annotation (
+      Window(
+        x=0.37,
+        y=0.02,
+        width=0.49,
+        height=0.65),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-1,-1},{1,1}},
+          grid={2,2}), graphics={Polygon(
+            points={{-1,1},{1,0},{-1,-1},{-1,1}},
+            lineColor={0,0,255},
+            fillColor={0,0,0},
+            fillPattern=FillPattern.Solid)}),
+      Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end InputDateAndTime;
+
+  connector OutputDateAndTime
+    output ThermoSysPro.InstrumentationAndControl.Common.DateEtHeure
+                              signal;
+    annotation (
+      Window(
+        x=0.29,
+        y=0.11,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-1,-1},{1,1}},
+          grid={2,2}), graphics={Polygon(
+            points={{-1,1},{1,0},{-1,-1},{-1,1}},
+            lineColor={0,0,255},
+            fillColor={192,192,192},
+            fillPattern=FillPattern.Solid)}),
+      Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end OutputDateAndTime;
+
+  connector InputReal
+    input Real signal;
+    annotation (
+      Diagram(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Polygon(
+            points={{-100,100},{-100,-100},{100,0},{-100,100}},
+            lineColor={0,0,255},
+            fillColor={0,127,255},
+            fillPattern=FillPattern.Solid)}),
+      Window(
+        x=0.34,
+        y=0.2,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end InputReal;
+
+  connector InputLogical
+     input Boolean signal;
+     annotation (
+       Window(
+         x=0.37,
+         y=0.02,
+         width=0.49,
+         height=0.65),
+       Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Polygon(
+            points={{-100,100},{-100,-100},{100,0},{-100,100}},
+            lineColor={0,0,255},
+            fillColor={255,255,0},
+            fillPattern=FillPattern.Solid)}),
+       Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end InputLogical;
+
+  connector InputInteger
+    input Integer signal;
+    annotation (
+      Diagram(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Polygon(
+            points={{-100,100},{-100,-100},{100,0},{-100,100}},
+            lineColor={0,0,255},
+            fillColor={255,0,255},
+            fillPattern=FillPattern.Solid)}),
+      Window(
+        x=0.34,
+        y=0.2,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+
+  end InputInteger;
+
+  connector OutputInteger
+    output Integer signal;
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Polygon(
+            points={{-100,100},{-100,-100},{100,0},{-100,100}},
+            lineColor={0,0,255},
+            fillColor={255,0,128},
+            fillPattern=FillPattern.Solid)}),
+      Window(
+        x=0.34,
+        y=0.18,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Version 1.6</b></p>
+</HTML>
+"));
+  end OutputInteger;
+
+  connector OutputLogical
+      output Boolean signal;
+      annotation (
+        Window(
+          x=0.29,
+          y=0.11,
+          width=0.6,
+          height=0.6),
+        Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Polygon(
+            points={{-100,100},{-100,-100},{100,0},{-100,100}},
+            lineColor={0,0,255},
+            fillColor={127,255,0},
+            fillPattern=FillPattern.Solid)}),
+        Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end OutputLogical;
+
+  connector OutputReal
+      output Real signal;
+      annotation (
+        Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Polygon(
+            points={{-100,100},{-100,-100},{100,0},{-100,100}},
+            lineColor={0,0,255},
+            fillColor={0,255,255},
+            fillPattern=FillPattern.Solid)}),
+        Window(
+          x=0.34,
+          y=0.18,
+          width=0.6,
+          height=0.6),
+        Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end OutputReal;
+  annotation (
+    Window(
+      x=0.05,
+      y=0.26,
+      width=0.25,
+      height=0.25,
+      library=1,
+      autolayout=1),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}),
+    Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+
+end Connectors;
diff --git a/ThermoSysPro/InstrumentationAndControl/package.mo b/ThermoSysPro/InstrumentationAndControl/package.mo
index 6ced6925c0b9b99ef8eed4f106d7d7b2bfad3f82..00ffabc1c8c344081ee047a90c6583f14e569b7a 100644
--- a/ThermoSysPro/InstrumentationAndControl/package.mo
+++ b/ThermoSysPro/InstrumentationAndControl/package.mo
@@ -1,139 +1,139 @@
-within ThermoSysPro;
-package InstrumentationAndControl "Instrumentation and control library"
-
-
-
-annotation (
-  Window(
-    x=0.05,
-    y=0.01,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"));
-end InstrumentationAndControl;
+within ThermoSysPro;
+package InstrumentationAndControl "Instrumentation and control library"
+
+
+
+annotation (
+  Window(
+    x=0.05,
+    y=0.01,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"));
+end InstrumentationAndControl;
diff --git a/ThermoSysPro/InstrumentationAndControl/package.order b/ThermoSysPro/InstrumentationAndControl/package.order
index ebf8057bf8c1ef784d049fffdd6547b5e37eb541..d1652c1bcefd8d14e417d4bde2af43c15edca5f2 100644
--- a/ThermoSysPro/InstrumentationAndControl/package.order
+++ b/ThermoSysPro/InstrumentationAndControl/package.order
@@ -1,4 +1,4 @@
-Blocks
-Common
-Connectors
-AdaptorForFMU
+Blocks
+Common
+Connectors
+AdaptorForFMU
diff --git a/ThermoSysPro/MultiFluids/Boilers/BoilerSystem.mo b/ThermoSysPro/MultiFluids/Boilers/BoilerSystem.mo
index 090f09c7634fc2b8d18eef887f539f89219d492d..b32ec120cabdffff8691dd267d90fe7943bb2f55 100644
--- a/ThermoSysPro/MultiFluids/Boilers/BoilerSystem.mo
+++ b/ThermoSysPro/MultiFluids/Boilers/BoilerSystem.mo
@@ -1,129 +1,129 @@
-within ThermoSysPro.MultiFluids.Boilers;
-model BoilerSystem
-  parameter Units.SI.Temperature Tair=300 "Source air temperature";
-  parameter Units.SI.Temperature Tsf=423.16
-    "Flue gases temperature at the outlet";
-  parameter Units.SI.Power Wloss=1e5 "Thermal losses";
-
-  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
-    Xashes=0.011,
-    rho=1000,
-    T0=294.45,
-    Hum=0.50,
-    Xc=0.2479,
-    Xh=0.0297,
-    Xo=0.2088,
-    Xn=0.0017,
-    Xs=0.0003,
-    LHV=1.5e7,
-    Q0=0.0407331)
-    annotation (Placement(transformation(extent={{-40,-10},{-20,10}}, rotation=
-            0)));
-  ThermoSysPro.MultiFluids.Boilers.FossilFuelBoiler Boiler(
-    Qsf(start=45.8744, fixed=false),
-    mode=1,
-    Pee(fixed=false),
-    Tf(fixed=false, start=1600),
-    Qe(fixed=false, start=6),
-    Pse(fixed=false, start=2e5),
-    Hee(fixed=false, start=293.1e3),
-    Hse(fixed=false, start=377e3),
-    Tsf=Tsf,
-    Tse(fixed=false, start=363.16),
-    exc_air(fixed=false, start=10),
-    Wloss=Wloss,
-    Wboil(start=1600e3, fixed=false))
-    annotation (Placement(transformation(
-        origin={6,0},
-        extent={{20,-20},{-20,20}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
-    annotation (Placement(transformation(extent={{-20,-108},{0,-88}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
-    annotation (Placement(transformation(extent={{-20,90},{0,110}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkG SinkFlueGases
-    annotation (Placement(transformation(extent={{-20,10},{-40,30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante FlueGas_P(
-                                        k=1e5)
-    annotation (Placement(transformation(extent={{-80,10},{-60,30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Air_Q(
-                                    k=1)
-    annotation (Placement(transformation(extent={{-80,-20},{-60,0}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceG SourceAir(
-    Xco2=0,
-    Xh2o=0.01,
-    Xo2=0.233) annotation (Placement(transformation(extent={{-40,-30},{-20,-10}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Air_T(
-                                    k=Tair)
-    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
-           0)));
-equation
-  connect(FlueGas_P.y, SinkFlueGases.IPressure)
-    annotation (Line(points={{-59,20},{-35,20}}));
-  connect(SourceAir.IMassFlow, Air_Q.y)
-    annotation (Line(points={{-30,-15},{-30,-10},{-59,-10}}));
-  connect(Air_T.y, SourceAir.ITemperature)
-    annotation (Line(points={{-59,-40},{-30,-40},{-30,-25}}));
-  connect(outletWaterSteamI, Boiler.Cws2) annotation (Line(points={{-10,100},{
-          -10,40},{18,40},{18,20}}, color={255,0,0}));
-  connect(Boiler.Cws1, inletWaterSteamI)
-    annotation (Line(points={{18,-20},{18,-60},{-10,-60},{-10,-98}}));
-  connect(SinkFlueGases.C, Boiler.Cfg) annotation (Line(
-      points={{-20.2,20},{-6.4,20}},
-      color={0,0,0},
-      thickness=1));
-  connect(SourceAir.C, Boiler.Cair) annotation (Line(
-      points={{-20,-20},{-6.4,-20}},
-      color={0,0,0},
-      thickness=1));
-  connect(Boiler.Cfuel, Fuel.C) annotation (Line(points={{-10,9.79717e-016},{
-          -16,9.79717e-016},{-16,0},{-20,0}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-80,-100},{60,100}},
-        initialScale=0.01), graphics),
-                          Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-80,-100},{60,100}},
-        initialScale=0.01), graphics={
-        Rectangle(
-          extent={{-80,100},{60,-100}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Dash,
-          lineThickness=0.5),
-        Rectangle(
-          extent={{-60,80},{40,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-12,-46},{0,-50},{10,-38},{14,-24},{12,-10},{10,-2},{6,8},{2,
-              18},{0,26},{-2,32},{-6,50},{-10,40},{-14,32},{-18,20},{-18,16},{
-              -20,12},{-22,20},{-24,22},{-26,18},{-30,10},{-32,4},{-36,-4},{-38,
-              -14},{-40,-24},{-40,-32},{-34,-40},{-30,-46},{-20,-52},{-12,-46}},
-          lineColor={255,0,128},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,-28},{-18,-24},{-14,-22},{-10,-22},{-6,-24},{-4,-26},{-2,
-              -32},{-2,-36},{-4,-34},{-6,-30},{-8,-26},{-14,-26},{-16,-28},{-20,
-              -32},{-22,-34},{-22,-34},{-20,-28}},
-          lineColor={127,0,0},
-          fillColor={127,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end BoilerSystem;
+within ThermoSysPro.MultiFluids.Boilers;
+model BoilerSystem
+  parameter Units.SI.Temperature Tair=300 "Source air temperature";
+  parameter Units.SI.Temperature Tsf=423.16
+    "Flue gases temperature at the outlet";
+  parameter Units.SI.Power Wloss=1e5 "Thermal losses";
+
+  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
+    Xashes=0.011,
+    rho=1000,
+    T0=294.45,
+    Hum=0.50,
+    Xc=0.2479,
+    Xh=0.0297,
+    Xo=0.2088,
+    Xn=0.0017,
+    Xs=0.0003,
+    LHV=1.5e7,
+    Q0=0.0407331)
+    annotation (Placement(transformation(extent={{-40,-10},{-20,10}}, rotation=
+            0)));
+  ThermoSysPro.MultiFluids.Boilers.FossilFuelBoiler Boiler(
+    Qsf(start=45.8744, fixed=false),
+    mode=1,
+    Pee(fixed=false),
+    Tf(fixed=false, start=1600),
+    Qe(fixed=false, start=6),
+    Pse(fixed=false, start=2e5),
+    Hee(fixed=false, start=293.1e3),
+    Hse(fixed=false, start=377e3),
+    Tsf=Tsf,
+    Tse(fixed=false, start=363.16),
+    exc_air(fixed=false, start=10),
+    Wloss=Wloss,
+    Wboil(start=1600e3, fixed=false))
+    annotation (Placement(transformation(
+        origin={6,0},
+        extent={{20,-20},{-20,20}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
+    annotation (Placement(transformation(extent={{-20,-108},{0,-88}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
+    annotation (Placement(transformation(extent={{-20,90},{0,110}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkG SinkFlueGases
+    annotation (Placement(transformation(extent={{-20,10},{-40,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante FlueGas_P(
+                                        k=1e5)
+    annotation (Placement(transformation(extent={{-80,10},{-60,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Air_Q(
+                                    k=1)
+    annotation (Placement(transformation(extent={{-80,-20},{-60,0}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceG SourceAir(
+    Xco2=0,
+    Xh2o=0.01,
+    Xo2=0.233) annotation (Placement(transformation(extent={{-40,-30},{-20,-10}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Air_T(
+                                    k=Tair)
+    annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=
+           0)));
+equation
+  connect(FlueGas_P.y, SinkFlueGases.IPressure)
+    annotation (Line(points={{-59,20},{-35,20}}));
+  connect(SourceAir.IMassFlow, Air_Q.y)
+    annotation (Line(points={{-30,-15},{-30,-10},{-59,-10}}));
+  connect(Air_T.y, SourceAir.ITemperature)
+    annotation (Line(points={{-59,-40},{-30,-40},{-30,-25}}));
+  connect(outletWaterSteamI, Boiler.Cws2) annotation (Line(points={{-10,100},{
+          -10,40},{18,40},{18,20}}, color={255,0,0}));
+  connect(Boiler.Cws1, inletWaterSteamI)
+    annotation (Line(points={{18,-20},{18,-60},{-10,-60},{-10,-98}}));
+  connect(SinkFlueGases.C, Boiler.Cfg) annotation (Line(
+      points={{-20.2,20},{-6.4,20}},
+      color={0,0,0},
+      thickness=1));
+  connect(SourceAir.C, Boiler.Cair) annotation (Line(
+      points={{-20,-20},{-6.4,-20}},
+      color={0,0,0},
+      thickness=1));
+  connect(Boiler.Cfuel, Fuel.C) annotation (Line(points={{-10,9.79717e-016},{
+          -16,9.79717e-016},{-16,0},{-20,0}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-80,-100},{60,100}},
+        initialScale=0.01), graphics),
+                          Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-80,-100},{60,100}},
+        initialScale=0.01), graphics={
+        Rectangle(
+          extent={{-80,100},{60,-100}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Dash,
+          lineThickness=0.5),
+        Rectangle(
+          extent={{-60,80},{40,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-12,-46},{0,-50},{10,-38},{14,-24},{12,-10},{10,-2},{6,8},{2,
+              18},{0,26},{-2,32},{-6,50},{-10,40},{-14,32},{-18,20},{-18,16},{
+              -20,12},{-22,20},{-24,22},{-26,18},{-30,10},{-32,4},{-36,-4},{-38,
+              -14},{-40,-24},{-40,-32},{-34,-40},{-30,-46},{-20,-52},{-12,-46}},
+          lineColor={255,0,128},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,-28},{-18,-24},{-14,-22},{-10,-22},{-6,-24},{-4,-26},{-2,
+              -32},{-2,-36},{-4,-34},{-6,-30},{-8,-26},{-14,-26},{-16,-28},{-20,
+              -32},{-22,-34},{-22,-34},{-20,-28}},
+          lineColor={127,0,0},
+          fillColor={127,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end BoilerSystem;
diff --git a/ThermoSysPro/MultiFluids/Boilers/FossilFuelBoiler.mo b/ThermoSysPro/MultiFluids/Boilers/FossilFuelBoiler.mo
index 5c1700daa04c214615c914f633fdc6a16419da28..07477d6d10f57734d4d0dff5fe449c4e8e179e9a 100644
--- a/ThermoSysPro/MultiFluids/Boilers/FossilFuelBoiler.mo
+++ b/ThermoSysPro/MultiFluids/Boilers/FossilFuelBoiler.mo
@@ -1,291 +1,291 @@
-within ThermoSysPro.MultiFluids.Boilers;
-model FossilFuelBoiler "Fossil fuel boiler"
-  parameter Units.SI.Temperature Tsf=400 "Flue gases temperature at the outlet";
-  parameter Integer Boiler_efficiency_type = 1
-    "1: Taking into account LHV only - 2: Using the total incoming power";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf=0.05
-    "Flue gases pressure loss coefficient";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke=1e4
-    "Water/steam pressure loss coefficient";
-  parameter Real etacomb=1 "Combustion efficiency (between 0 and 1)";
-  parameter Units.SI.Power Wloss=1e5 "Thermal losses";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Real amCO2 = amC + 2*amO "CO2 molecular mass";
-  constant Real amH2O = 2*amH + amO "H2O molecular mass";
-  constant Real amSO2 = amS + 2*amO "SO2 molecular mass";
-  constant Real teps=1e-6 "Small number";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  Real XeaO2c(start=0.2)
-    "Intermediate variable for the computation of the O2 mass fraction";
-
-public
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=400) "Air temperature at the inlet";
-  Units.SI.SpecificEnthalpy Hea(start=50e3)
-    "Air specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Real XeaCO2(start=0) "CO2 mass fraction at the inlet";
-  Real XeaH2O(start=0.1) "H2O mass fraction at the inlet";
-  Real XeaO2(start=0.2) "O2 mass fraction at the inlet";
-  Real XeaSO2(start=0) "SO2 mass fraction at the inlet";
-
-  Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tcomb(start=300) "Fuel temperature";
-  Units.SI.SpecificEnthalpy Hcomb(start=10e3) "Fuel specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrcomb(start=10e3)
-    "Fuel reference specific enthalpy";
-  Real XCcomb(start=0.8) "Carbon mass fraction";
-  Real XHcomb(start=0.2) "Hydrogen mass fraction";
-  Real XOcomb(start=0) "Oxygen mass fraction";
-  Real XScomb(start=0) "Sulfur mass fraction";
-  Real PCIcomb(start=5e7) "Fuel PCI (J/kg)";
-  Units.SI.SpecificHeatCapacity Cpcomb(start=2000)
-    "Fuel specific heat capacity";
-
-  Units.SI.MassFlowRate Qe(start=100) "Water/steam mass flow rate";
-  Units.SI.AbsolutePressure Pee(start=50e5) "Water/steam pressure at the inlet";
-  Units.SI.AbsolutePressure Pse(start=50e5)
-    "Water/steam pressure at the outlet";
-  ThermoSysPro.Units.SI.PressureDifference deltaPe(start=1e5)
-    "Water/steam pressure losses";
-  Units.SI.Temperature Tse(start=500) "Water/steam temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hee(start=400e3)
-    "Water/steam specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hse(start=400e3)
-    "Water/steam specific enthalpy at the outlet";
-  Units.SI.Density rhoe(start=998) "Average water/steam density";
-
-  Units.SI.MassFlowRate Qsf(start=400)
-    "Flue gases mass flow rate at the outlet";
-  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tf(start=1500) "Flue gases temperature after combustion";
-  Units.SI.SpecificEnthalpy Hsf(start=50e3)
-    "Flue gases specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hf(start=100e3)
-    "Flue gases specific enthalpy after combustion";
-  Units.SI.SpecificEnthalpy Hrfum(start=10e3)
-    "Flue gases reference specific enthalpy";
-  ThermoSysPro.Units.SI.PressureDifference deltaPf(start=1e3)
-    "Pressure losses in the combusiton chamber";
-  Units.SI.Density rhof(start=0.05) "Flue gases density";
-  Real XsfCO2(start=0.2) "CO2 mass fraction at the outlet";
-  Real XsfH2O(start=0.15) "H2O mass fraction at the outlet";
-  Real XsfO2(start=0) "O2 mass fraction at the outlet";
-  Real XsfSO2(start=0) "SO2 mass fraction at the outlet";
-
-  Units.SI.Power Wfuel(start=5e8) "Fuel available power PCI";
-  Units.SI.Power Wtot(start=5e8) "Total incoming power";
-  Units.SI.Power Wboil(start=5e9) "Power exchanged in the boiler";
-  Real eta_boil(start=90) "Boiler efficiency (%) ";
-  Real exc(start=1) "Air combustion ratio";
-  Real exc_air(start=0.1) "Pertcentage of air in excess";
-public
-  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel
-    annotation (Placement(transformation(extent={{-10,-90},{10,-70}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cair
-    annotation (Placement(transformation(extent={{-110,-72},{-90,-52}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg
-    annotation (Placement(transformation(extent={{90,-72},{110,-52}}, rotation=
-            0)));
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws1
-                          annotation (Placement(transformation(extent={{-110,50},
-            {-90,70}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cws2
-                          annotation (Placement(transformation(extent={{90,50},
-            {110,70}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    annotation (Placement(transformation(extent={{-100,84},{-80,104}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom
-    annotation (Placement(transformation(extent={{80,84},{100,104}}, rotation=0)));
-equation
-
-  /* Air inlet */
-  Qea = Cair.Q;
-  Pea = Cair.P;
-  Tea = Cair.T;
-  XeaCO2 = Cair.Xco2;
-  XeaH2O = Cair.Xh2o;
-  XeaO2 = Cair.Xo2;
-  XeaSO2 = Cair.Xso2;
-
-  /* Fuel inlet */
-  Qcomb = Cfuel.Q;
-  Tcomb = Cfuel.T;
-  XCcomb = Cfuel.Xc;
-  XHcomb = Cfuel.Xh;
-  XOcomb = Cfuel.Xo;
-  XScomb = Cfuel.Xs;
-  PCIcomb = Cfuel.LHV;
-  Cpcomb = Cfuel.cp;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Tsf = Cfg.T;
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Water/steam inlet */
-  Hee = Cws1.h;
-  Pee = Cws1.P;
-  Qe = Cws1.Q;
-
-  /* Water/steam outlet */
-  Cws2.h = Hse;
-  Cws2.P = Pse;
-  Cws2.Q = Qe;
-
-  /* Flow reversal */
-  0 = if (Qe > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
-
-  /* Mass balance equation for the flue gases */
-  Qsf = Qea + Qcomb;
-
-  /* CO2 flue gases composition */
-  XsfCO2*Qsf = Qea*XeaCO2 + Qcomb*XCcomb*amCO2/amC;
-
-  /* H2O flue gases composition */
-  XsfH2O*Qsf = Qea*XeaH2O + Qcomb*XHcomb*(amH2O/2)/amH;
-
-  /* O2 flue gases composition */
-  XsfO2*Qsf = Qea*XeaO2c - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb;
-
-  /* SO2 flue gases composition */
-  XsfSO2*Qsf = Qea*XeaSO2 + Qcomb*XScomb*amSO2/amS;
-
-  /* Combustion air ratio */
-  exc = Qea*(1 - XeaH2O) / ((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO)) / (XeaO2c/(1 - XeaH2O)));
-
-  /* Air excess */
-  exc_air = (exc - 1)*100;
-
-  /* Flue gases pressure losses */
-  Pea - Psf = deltaPf;
-  deltaPf = Kf*ThermoSysPro.Functions.ThermoSquare(
-                                                  Qsf, eps)/rhof;
-
-  /* Water/steam pressure losses */
-  Pee - Pse = deltaPe;
-  deltaPe = Ke*ThermoSysPro.Functions.ThermoSquare(
-                                                  Qe, eps)/rhoe;
-
-  /* Fuel specific enthalpy at the inlet */
-  Hcomb = Cpcomb*Tcomb;
-
-  /* Energy balance equation for the flue gases */
-  0 = (Qsf*(Hf - Hrfum)  + Wloss) - (Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair));
-
-  /* Fuel power */
-  Wfuel = Qcomb*PCIcomb;
-
-  /* Total incoming power */
-  Wtot = Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair);
-
-  /* Power exchanged in the boiler */
-  Wboil = Wtot - Qsf*(Hsf - Hrfum) - Wloss;
-
-  /* Water/steam specific enthalpy at the outlet */
-  Hse = Wboil/Qe + Hee;
-
-  /* Boiler efficiency*/
-  if (Boiler_efficiency_type == 1) then
-     eta_boil = 100*Wboil/Wfuel;
-  else
-     eta_boil = 100*Wboil/Wtot;
-  end if;
-
-  /* Air specific enthalpy at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
-
-  /* Flue gases tempretaure after combustion */
-  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
-  Hf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Flue gases specific enthalpy at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  /* Flue gases density */
-  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, (Tea + Tf)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  0 = if (XeaO2 > teps) then (XeaO2c - XeaO2) else (XeaO2c - teps);
-
-  /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrcomb = 0;
-  Hrfum = 2501.569e3*XsfH2O;
-
-  /* Water/steam thermodynamic properties */
-  prom = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2, (Hee + Hse)/2, mode);
-  rhoe = prom.d;
-
-  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode);
-  Tse = pros.T;
-
-    annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-42},{12,-46},{22,-34},{26,-20},{24,-6},{22,2},{18,12},{14,
-              22},{12,30},{10,36},{6,54},{2,44},{-2,36},{-6,24},{-6,20},{-8,16},
-              {-10,24},{-12,26},{-14,22},{-18,14},{-20,8},{-24,0},{-26,-10},{
-              -28,-20},{-28,-28},{-22,-36},{-18,-42},{-8,-48},{0,-42}},
-          lineColor={255,0,128},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,-22},{-6,-18},{-2,-16},{2,-16},{6,-18},{8,-20},{10,-26},{
-              10,-30},{8,-28},{6,-24},{4,-20},{-2,-20},{-4,-22},{-8,-26},{-10,
-              -28},{-10,-28},{-8,-22}},
-          lineColor={127,0,0},
-          fillColor={127,0,0},
-          fillPattern=FillPattern.Solid)}),
-                             Icon(graphics={
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,-42},{10,-46},{20,-34},{24,-20},{22,-6},{20,2},{16,12},{
-              12,22},{10,30},{8,36},{4,54},{0,44},{-4,36},{-8,24},{-8,20},{-10,
-              16},{-12,24},{-14,26},{-16,22},{-20,14},{-22,8},{-26,0},{-28,-10},
-              {-30,-20},{-30,-28},{-24,-36},{-20,-42},{-10,-48},{-2,-42}},
-          lineColor={255,0,128},
-          fillColor={255,128,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-10,-24},{-8,-20},{-4,-18},{0,-18},{4,-20},{6,-22},{8,-28},{
-              8,-32},{6,-30},{4,-26},{2,-22},{-4,-22},{-6,-24},{-10,-28},{-12,
-              -30},{-12,-30},{-10,-24}},
-          lineColor={127,0,0},
-          fillColor={127,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 7.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>"));
-end FossilFuelBoiler;
+within ThermoSysPro.MultiFluids.Boilers;
+model FossilFuelBoiler "Fossil fuel boiler"
+  parameter Units.SI.Temperature Tsf=400 "Flue gases temperature at the outlet";
+  parameter Integer Boiler_efficiency_type = 1
+    "1: Taking into account LHV only - 2: Using the total incoming power";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf=0.05
+    "Flue gases pressure loss coefficient";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke=1e4
+    "Water/steam pressure loss coefficient";
+  parameter Real etacomb=1 "Combustion efficiency (between 0 and 1)";
+  parameter Units.SI.Power Wloss=1e5 "Thermal losses";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Real amCO2 = amC + 2*amO "CO2 molecular mass";
+  constant Real amH2O = 2*amH + amO "H2O molecular mass";
+  constant Real amSO2 = amS + 2*amO "SO2 molecular mass";
+  constant Real teps=1e-6 "Small number";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  Real XeaO2c(start=0.2)
+    "Intermediate variable for the computation of the O2 mass fraction";
+
+public
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=400) "Air temperature at the inlet";
+  Units.SI.SpecificEnthalpy Hea(start=50e3)
+    "Air specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Real XeaCO2(start=0) "CO2 mass fraction at the inlet";
+  Real XeaH2O(start=0.1) "H2O mass fraction at the inlet";
+  Real XeaO2(start=0.2) "O2 mass fraction at the inlet";
+  Real XeaSO2(start=0) "SO2 mass fraction at the inlet";
+
+  Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tcomb(start=300) "Fuel temperature";
+  Units.SI.SpecificEnthalpy Hcomb(start=10e3) "Fuel specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrcomb(start=10e3)
+    "Fuel reference specific enthalpy";
+  Real XCcomb(start=0.8) "Carbon mass fraction";
+  Real XHcomb(start=0.2) "Hydrogen mass fraction";
+  Real XOcomb(start=0) "Oxygen mass fraction";
+  Real XScomb(start=0) "Sulfur mass fraction";
+  Real PCIcomb(start=5e7) "Fuel PCI (J/kg)";
+  Units.SI.SpecificHeatCapacity Cpcomb(start=2000)
+    "Fuel specific heat capacity";
+
+  Units.SI.MassFlowRate Qe(start=100) "Water/steam mass flow rate";
+  Units.SI.AbsolutePressure Pee(start=50e5) "Water/steam pressure at the inlet";
+  Units.SI.AbsolutePressure Pse(start=50e5)
+    "Water/steam pressure at the outlet";
+  ThermoSysPro.Units.SI.PressureDifference deltaPe(start=1e5)
+    "Water/steam pressure losses";
+  Units.SI.Temperature Tse(start=500) "Water/steam temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hee(start=400e3)
+    "Water/steam specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hse(start=400e3)
+    "Water/steam specific enthalpy at the outlet";
+  Units.SI.Density rhoe(start=998) "Average water/steam density";
+
+  Units.SI.MassFlowRate Qsf(start=400)
+    "Flue gases mass flow rate at the outlet";
+  Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tf(start=1500) "Flue gases temperature after combustion";
+  Units.SI.SpecificEnthalpy Hsf(start=50e3)
+    "Flue gases specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hf(start=100e3)
+    "Flue gases specific enthalpy after combustion";
+  Units.SI.SpecificEnthalpy Hrfum(start=10e3)
+    "Flue gases reference specific enthalpy";
+  ThermoSysPro.Units.SI.PressureDifference deltaPf(start=1e3)
+    "Pressure losses in the combusiton chamber";
+  Units.SI.Density rhof(start=0.05) "Flue gases density";
+  Real XsfCO2(start=0.2) "CO2 mass fraction at the outlet";
+  Real XsfH2O(start=0.15) "H2O mass fraction at the outlet";
+  Real XsfO2(start=0) "O2 mass fraction at the outlet";
+  Real XsfSO2(start=0) "SO2 mass fraction at the outlet";
+
+  Units.SI.Power Wfuel(start=5e8) "Fuel available power PCI";
+  Units.SI.Power Wtot(start=5e8) "Total incoming power";
+  Units.SI.Power Wboil(start=5e9) "Power exchanged in the boiler";
+  Real eta_boil(start=90) "Boiler efficiency (%) ";
+  Real exc(start=1) "Air combustion ratio";
+  Real exc_air(start=0.1) "Pertcentage of air in excess";
+public
+  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel
+    annotation (Placement(transformation(extent={{-10,-90},{10,-70}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cair
+    annotation (Placement(transformation(extent={{-110,-72},{-90,-52}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg
+    annotation (Placement(transformation(extent={{90,-72},{110,-52}}, rotation=
+            0)));
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws1
+                          annotation (Placement(transformation(extent={{-110,50},
+            {-90,70}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cws2
+                          annotation (Placement(transformation(extent={{90,50},
+            {110,70}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    annotation (Placement(transformation(extent={{-100,84},{-80,104}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom
+    annotation (Placement(transformation(extent={{80,84},{100,104}}, rotation=0)));
+equation
+
+  /* Air inlet */
+  Qea = Cair.Q;
+  Pea = Cair.P;
+  Tea = Cair.T;
+  XeaCO2 = Cair.Xco2;
+  XeaH2O = Cair.Xh2o;
+  XeaO2 = Cair.Xo2;
+  XeaSO2 = Cair.Xso2;
+
+  /* Fuel inlet */
+  Qcomb = Cfuel.Q;
+  Tcomb = Cfuel.T;
+  XCcomb = Cfuel.Xc;
+  XHcomb = Cfuel.Xh;
+  XOcomb = Cfuel.Xo;
+  XScomb = Cfuel.Xs;
+  PCIcomb = Cfuel.LHV;
+  Cpcomb = Cfuel.cp;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Tsf = Cfg.T;
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Water/steam inlet */
+  Hee = Cws1.h;
+  Pee = Cws1.P;
+  Qe = Cws1.Q;
+
+  /* Water/steam outlet */
+  Cws2.h = Hse;
+  Cws2.P = Pse;
+  Cws2.Q = Qe;
+
+  /* Flow reversal */
+  0 = if (Qe > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
+
+  /* Mass balance equation for the flue gases */
+  Qsf = Qea + Qcomb;
+
+  /* CO2 flue gases composition */
+  XsfCO2*Qsf = Qea*XeaCO2 + Qcomb*XCcomb*amCO2/amC;
+
+  /* H2O flue gases composition */
+  XsfH2O*Qsf = Qea*XeaH2O + Qcomb*XHcomb*(amH2O/2)/amH;
+
+  /* O2 flue gases composition */
+  XsfO2*Qsf = Qea*XeaO2c - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb;
+
+  /* SO2 flue gases composition */
+  XsfSO2*Qsf = Qea*XeaSO2 + Qcomb*XScomb*amSO2/amS;
+
+  /* Combustion air ratio */
+  exc = Qea*(1 - XeaH2O) / ((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO)) / (XeaO2c/(1 - XeaH2O)));
+
+  /* Air excess */
+  exc_air = (exc - 1)*100;
+
+  /* Flue gases pressure losses */
+  Pea - Psf = deltaPf;
+  deltaPf = Kf*ThermoSysPro.Functions.ThermoSquare(
+                                                  Qsf, eps)/rhof;
+
+  /* Water/steam pressure losses */
+  Pee - Pse = deltaPe;
+  deltaPe = Ke*ThermoSysPro.Functions.ThermoSquare(
+                                                  Qe, eps)/rhoe;
+
+  /* Fuel specific enthalpy at the inlet */
+  Hcomb = Cpcomb*Tcomb;
+
+  /* Energy balance equation for the flue gases */
+  0 = (Qsf*(Hf - Hrfum)  + Wloss) - (Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair));
+
+  /* Fuel power */
+  Wfuel = Qcomb*PCIcomb;
+
+  /* Total incoming power */
+  Wtot = Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair);
+
+  /* Power exchanged in the boiler */
+  Wboil = Wtot - Qsf*(Hsf - Hrfum) - Wloss;
+
+  /* Water/steam specific enthalpy at the outlet */
+  Hse = Wboil/Qe + Hee;
+
+  /* Boiler efficiency*/
+  if (Boiler_efficiency_type == 1) then
+     eta_boil = 100*Wboil/Wfuel;
+  else
+     eta_boil = 100*Wboil/Wtot;
+  end if;
+
+  /* Air specific enthalpy at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2);
+
+  /* Flue gases tempretaure after combustion */
+  // Changed from FlueGases_T to FlueGases_h to provide a differentiable function
+  Hf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Flue gases specific enthalpy at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  /* Flue gases density */
+  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, (Tea + Tf)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  0 = if (XeaO2 > teps) then (XeaO2c - XeaO2) else (XeaO2c - teps);
+
+  /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrcomb = 0;
+  Hrfum = 2501.569e3*XsfH2O;
+
+  /* Water/steam thermodynamic properties */
+  prom = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2, (Hee + Hse)/2, mode);
+  rhoe = prom.d;
+
+  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode);
+  Tse = pros.T;
+
+    annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-42},{12,-46},{22,-34},{26,-20},{24,-6},{22,2},{18,12},{14,
+              22},{12,30},{10,36},{6,54},{2,44},{-2,36},{-6,24},{-6,20},{-8,16},
+              {-10,24},{-12,26},{-14,22},{-18,14},{-20,8},{-24,0},{-26,-10},{
+              -28,-20},{-28,-28},{-22,-36},{-18,-42},{-8,-48},{0,-42}},
+          lineColor={255,0,128},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,-22},{-6,-18},{-2,-16},{2,-16},{6,-18},{8,-20},{10,-26},{
+              10,-30},{8,-28},{6,-24},{4,-20},{-2,-20},{-4,-22},{-8,-26},{-10,
+              -28},{-10,-28},{-8,-22}},
+          lineColor={127,0,0},
+          fillColor={127,0,0},
+          fillPattern=FillPattern.Solid)}),
+                             Icon(graphics={
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,-42},{10,-46},{20,-34},{24,-20},{22,-6},{20,2},{16,12},{
+              12,22},{10,30},{8,36},{4,54},{0,44},{-4,36},{-8,24},{-8,20},{-10,
+              16},{-12,24},{-14,26},{-16,22},{-20,14},{-22,8},{-26,0},{-28,-10},
+              {-30,-20},{-30,-28},{-24,-36},{-20,-42},{-10,-48},{-2,-42}},
+          lineColor={255,0,128},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-10,-24},{-8,-20},{-4,-18},{0,-18},{4,-20},{6,-22},{8,-28},{
+              8,-32},{6,-30},{4,-26},{2,-22},{-4,-22},{-6,-24},{-10,-28},{-12,
+              -30},{-12,-30},{-10,-24}},
+          lineColor={127,0,0},
+          fillColor={127,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 7.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>"));
+end FossilFuelBoiler;
diff --git a/ThermoSysPro/MultiFluids/Boilers/package.mo b/ThermoSysPro/MultiFluids/Boilers/package.mo
index 782d26d1b72e0303fca34ca921e1705769744122..b8e0420ac25a6d52153429df21106f11c3d31f40 100644
--- a/ThermoSysPro/MultiFluids/Boilers/package.mo
+++ b/ThermoSysPro/MultiFluids/Boilers/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.MultiFluids;
-package Boilers "Boilers"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Boilers;
+within ThermoSysPro.MultiFluids;
+package Boilers "Boilers"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Boilers;
diff --git a/ThermoSysPro/MultiFluids/HeatExchangers/DynamicExchangerWaterSteamFlueGases.mo b/ThermoSysPro/MultiFluids/HeatExchangers/DynamicExchangerWaterSteamFlueGases.mo
index 5476d46194ae572aebb5ca716d8d7c397e7e8774..fe84982251af4ec69aa89d816a392716460d3c59 100644
--- a/ThermoSysPro/MultiFluids/HeatExchangers/DynamicExchangerWaterSteamFlueGases.mo
+++ b/ThermoSysPro/MultiFluids/HeatExchangers/DynamicExchangerWaterSteamFlueGases.mo
@@ -1,103 +1,103 @@
-within ThermoSysPro.MultiFluids.HeatExchangers;
-model DynamicExchangerWaterSteamFlueGases
-  "Dynamic exchanger water/steam - flue gases "
-
-  parameter Units.SI.Length L=1 "Exchanger length";
-  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
-  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
-  parameter Integer Ns=1 "Numver of segments";
-  parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
-  parameter Integer Ntubes=1 "Number of pipes in parallel";
-
-  ThermoSysPro.FlueGases.HeatExchangers.StaticWallFlueGasesExchanger
-    ExchangerFlueGasesMetal(
-    Dext=0.022,
-    Ns=Ns,
-    NbTub=Ntubes,
-    L=L)
-    annotation (Placement(transformation(extent={{-10,30},{10,10}}, rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
-    L=L,
-    D=Dint,
-    Ns=Ns,
-    ntubes=Ntubes)                       annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
-    TwoPhaseFlowPipe(
-    L=L,
-    D=Dint,
-    ntubes=Ntubes,
-    Ns=Ns,
-    z1=z1,
-    z2=z2)
-    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInletI Cfg1
-    annotation (Placement(transformation(extent={{-10,40},{10,60}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutletI Cfg2
-    annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI Cws1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI Cws2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-  connect(Cws2, TwoPhaseFlowPipe.C2)
-                                   annotation (Line(points={{100,0},{40,0},{40,
-          -20},{10,-20}}, color={255,0,0}));
-  connect(Cws1, TwoPhaseFlowPipe.C1)
-    annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}}));
-  connect(Cfg1, ExchangerFlueGasesMetal.C1) annotation (Line(
-      points={{0,50},{-20,50},{-20,20},{-10,20}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerFlueGasesMetal.C2, Cfg2) annotation (Line(
-      points={{10,20},{20,20},{20,-50},{0,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh)
-    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
-  connect(ExchangerFlueGasesMetal.CTh, ExchangerWall.WT2)
-    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
-  annotation (Diagram(graphics),
-                       Icon(graphics={
-        Rectangle(
-          extent={{-100,50},{100,-50}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={255,127,0}),
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={0,0,0},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,50},{-60,-50}}),
-        Line(points={{-20,50},{-20,-50}}),
-        Line(points={{20,50},{20,-50}}),
-        Line(points={{60,50},{60,-50}})}),
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Guillaume Larrignon</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end DynamicExchangerWaterSteamFlueGases;
+within ThermoSysPro.MultiFluids.HeatExchangers;
+model DynamicExchangerWaterSteamFlueGases
+  "Dynamic exchanger water/steam - flue gases "
+
+  parameter Units.SI.Length L=1 "Exchanger length";
+  parameter Units.SI.Position z1=0 "Exchanger inlet altitude";
+  parameter Units.SI.Position z2=0 "Exchanger outlet altitude";
+  parameter Integer Ns=1 "Numver of segments";
+  parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
+  parameter Integer Ntubes=1 "Number of pipes in parallel";
+
+  ThermoSysPro.FlueGases.HeatExchangers.StaticWallFlueGasesExchanger
+    ExchangerFlueGasesMetal(
+    Dext=0.022,
+    Ns=Ns,
+    NbTub=Ntubes,
+    L=L)
+    annotation (Placement(transformation(extent={{-10,30},{10,10}}, rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
+    L=L,
+    D=Dint,
+    Ns=Ns,
+    ntubes=Ntubes)                       annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe
+    TwoPhaseFlowPipe(
+    L=L,
+    D=Dint,
+    ntubes=Ntubes,
+    Ns=Ns,
+    z1=z1,
+    z2=z2)
+    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInletI Cfg1
+    annotation (Placement(transformation(extent={{-10,40},{10,60}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutletI Cfg2
+    annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI Cws1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI Cws2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+  connect(Cws2, TwoPhaseFlowPipe.C2)
+                                   annotation (Line(points={{100,0},{40,0},{40,
+          -20},{10,-20}}, color={255,0,0}));
+  connect(Cws1, TwoPhaseFlowPipe.C1)
+    annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}}));
+  connect(Cfg1, ExchangerFlueGasesMetal.C1) annotation (Line(
+      points={{0,50},{-20,50},{-20,20},{-10,20}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerFlueGasesMetal.C2, Cfg2) annotation (Line(
+      points={{10,20},{20,20},{20,-50},{0,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh)
+    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
+  connect(ExchangerFlueGasesMetal.CTh, ExchangerWall.WT2)
+    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
+  annotation (Diagram(graphics),
+                       Icon(graphics={
+        Rectangle(
+          extent={{-100,50},{100,-50}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={255,127,0}),
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={0,0,0},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,50},{-60,-50}}),
+        Line(points={{-20,50},{-20,-50}}),
+        Line(points={{20,50},{20,-50}}),
+        Line(points={{60,50},{60,-50}})}),
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Guillaume Larrignon</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end DynamicExchangerWaterSteamFlueGases;
diff --git a/ThermoSysPro/MultiFluids/HeatExchangers/ExchangerWaterC3H3F5W.mo b/ThermoSysPro/MultiFluids/HeatExchangers/ExchangerWaterC3H3F5W.mo
index 289f3dc2690fc4479277f74502a06156363bfcf3..17133e1322b6e5c68f9eaa5f0c518fbbbce4c896 100644
--- a/ThermoSysPro/MultiFluids/HeatExchangers/ExchangerWaterC3H3F5W.mo
+++ b/ThermoSysPro/MultiFluids/HeatExchangers/ExchangerWaterC3H3F5W.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.MultiFluids.HeatExchangers;
-model ExchangerWaterC3H3F5W
-  "Static water - C3H3F5 heat exchanger with fixed delta power"
-  parameter Units.SI.Power DW=0
-    "Power exchanged between the hot and the cold fluids";
-  parameter ThermoSysPro.Units.SI.PressureDifference DPc
-    "Total pressure loss for the hot fluid (% of the fluid pressure at the inlet)";
-  parameter ThermoSysPro.Units.SI.PressureDifference DPf
-    "Total pressure loss for the cold fluid (% of the fluid pressure at the inlet)";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer modec=0
-    "IF97 region of the water for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Units.SI.Temperature Tec "Fluid temperature at the inlet of the hot side";
-  Units.SI.Temperature Tsc "Fluid temperature at the outlet of the hot side";
-  Units.SI.Temperature Tef "Fluid temperature at the inlet of the cold side";
-  Units.SI.Temperature Tsf "Fluid temperature at the outlet of the cold side";
-  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
-  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
-
-public
-  WaterSteam.Connectors.FluidInlet Ec
-                          annotation (Placement(transformation(extent={{-68,-70},
-            {-48,-50}}, rotation=0)));
-  WaterSteam.Connectors.FluidInlet Ef
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  WaterSteam.Connectors.FluidOutlet Sf
-                          annotation (Placement(transformation(extent={{88,-9},
-            {108,11}}, rotation=0)));
-  WaterSteam.Connectors.FluidOutlet Sc
-                          annotation (Placement(transformation(extent={{48,-70},
-            {68,-50}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-equation
-
-  /* Flow reversal for the hot fluid */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Qc > Qeps) then Ec.h - Ec.h_vol else if (Qc < -Qeps) then
-        Sc.h - Sc.h_vol else Ec.h - 0.5*((Ec.h_vol - Sc.h_vol)*Modelica.Math.sin(pi
-        *Qc/2/Qeps) + Ec.h_vol + Sc.h_vol));
-  else
-    0 = if (Qc > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
-  end if;
-
-  /* Flow reversal for the cold fluid */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Qf > Qeps) then Ef.h - Ef.h_vol else if (Qf < -Qeps) then
-        Sf.h - Sf.h_vol else Ef.h - 0.5*((Ef.h_vol - Sf.h_vol)*Modelica.Math.sin(pi
-        *Qf/2/Qeps) + Ef.h_vol + Sf.h_vol));
-  else
-    0 = if (Qf > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
-  end if;
-
-  /* Mass flow rates */
-  Ec.Q = Sc.Q;
-  Qc = Ec.Q;
-
-  Ef.Q = Sf.Q;
-  Qf = Ef.Q;
-
-  /* Power exchanged between the hot and cold fluids */
-  DW = Qf*(Sf.h - Ef.h);
-  DW = Qc*(Ec.h - Sc.h);
-
-  /* Pressure losses */
-  Sc.P = if (Qc > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
-  Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100;
-
-  /* Fluid thermodynamic properties for the hot fluid */
-  proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, modec, 1);
-  procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P,Sc.h, modec, 1);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-
-  /* Fluid thermodynamic properties for the cold fluid */
-  profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, 0, 2);
-  profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, 0, 2);
-
-  Tef = profe.T;
-  Tsf = profs.T;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.CrossDiag), Line(
-          points={{-56,-50},{-56,4},{0,-28},{60,6},{60,-50}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.CrossDiag), Line(
-          points={{-58,-50},{-58,2},{-2,-34},{58,2},{58,-50}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end ExchangerWaterC3H3F5W;
+within ThermoSysPro.MultiFluids.HeatExchangers;
+model ExchangerWaterC3H3F5W
+  "Static water - C3H3F5 heat exchanger with fixed delta power"
+  parameter Units.SI.Power DW=0
+    "Power exchanged between the hot and the cold fluids";
+  parameter ThermoSysPro.Units.SI.PressureDifference DPc
+    "Total pressure loss for the hot fluid (% of the fluid pressure at the inlet)";
+  parameter ThermoSysPro.Units.SI.PressureDifference DPf
+    "Total pressure loss for the cold fluid (% of the fluid pressure at the inlet)";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer modec=0
+    "IF97 region of the water for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Units.SI.Temperature Tec "Fluid temperature at the inlet of the hot side";
+  Units.SI.Temperature Tsc "Fluid temperature at the outlet of the hot side";
+  Units.SI.Temperature Tef "Fluid temperature at the inlet of the cold side";
+  Units.SI.Temperature Tsf "Fluid temperature at the outlet of the cold side";
+  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+
+public
+  WaterSteam.Connectors.FluidInlet Ec
+                          annotation (Placement(transformation(extent={{-68,-70},
+            {-48,-50}}, rotation=0)));
+  WaterSteam.Connectors.FluidInlet Ef
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  WaterSteam.Connectors.FluidOutlet Sf
+                          annotation (Placement(transformation(extent={{88,-9},
+            {108,11}}, rotation=0)));
+  WaterSteam.Connectors.FluidOutlet Sc
+                          annotation (Placement(transformation(extent={{48,-70},
+            {68,-50}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+equation
+
+  /* Flow reversal for the hot fluid */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Qc > Qeps) then Ec.h - Ec.h_vol else if (Qc < -Qeps) then
+        Sc.h - Sc.h_vol else Ec.h - 0.5*((Ec.h_vol - Sc.h_vol)*Modelica.Math.sin(pi
+        *Qc/2/Qeps) + Ec.h_vol + Sc.h_vol));
+  else
+    0 = if (Qc > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
+  end if;
+
+  /* Flow reversal for the cold fluid */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Qf > Qeps) then Ef.h - Ef.h_vol else if (Qf < -Qeps) then
+        Sf.h - Sf.h_vol else Ef.h - 0.5*((Ef.h_vol - Sf.h_vol)*Modelica.Math.sin(pi
+        *Qf/2/Qeps) + Ef.h_vol + Sf.h_vol));
+  else
+    0 = if (Qf > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
+  end if;
+
+  /* Mass flow rates */
+  Ec.Q = Sc.Q;
+  Qc = Ec.Q;
+
+  Ef.Q = Sf.Q;
+  Qf = Ef.Q;
+
+  /* Power exchanged between the hot and cold fluids */
+  DW = Qf*(Sf.h - Ef.h);
+  DW = Qc*(Ec.h - Sc.h);
+
+  /* Pressure losses */
+  Sc.P = if (Qc > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
+  Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100;
+
+  /* Fluid thermodynamic properties for the hot fluid */
+  proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, modec, 1);
+  procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P,Sc.h, modec, 1);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+
+  /* Fluid thermodynamic properties for the cold fluid */
+  profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, 0, 2);
+  profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, 0, 2);
+
+  Tef = profe.T;
+  Tsf = profs.T;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.CrossDiag), Line(
+          points={{-56,-50},{-56,4},{0,-28},{60,6},{60,-50}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.CrossDiag), Line(
+          points={{-58,-50},{-58,2},{-2,-34},{58,2},{58,-50}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end ExchangerWaterC3H3F5W;
diff --git a/ThermoSysPro/MultiFluids/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/MultiFluids/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo
index 01537688557631b8a9fcf7cd97574a322b24fdea..a2521945928ceb0436e4f259851abb4241c53e0b 100644
--- a/ThermoSysPro/MultiFluids/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo
+++ b/ThermoSysPro/MultiFluids/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo
@@ -1,198 +1,198 @@
-within ThermoSysPro.MultiFluids.HeatExchangers;
-model SimpleEvaporatorWaterSteamFlueGases
-  "Simple water/steam - flue gases evaporator"
-  parameter Real Kdpf=10 "Flue gases pressure drop coefficient";
-  parameter Real Kdpe=10 "Water/steam pressure drop coefficient";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.AbsolutePressure Pef(start=3e5) "Flue gases pressure at the inlet";
-  Units.SI.AbsolutePressure Psf(start=2.5e5)
-    "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tef(start=600) "Flue gases temperature at the inlet";
-  Units.SI.Temperature Tsf(start=400) "Flue gases temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hsf(start=3e5)
-    "Flue gases specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hef(start=6e5)
-    "Flue gases specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qf(start=10) "Flue gases mass flow rate";
-  Units.SI.AbsolutePressure Pee(start=2e6) "Water pressure at the inlet";
-  Units.SI.AbsolutePressure Pse(start=2e6) "Water pressure at the outlet";
-  Units.SI.Temperature Tee(start=400) "Water temperature at the inlet";
-  Units.SI.Temperature Tse(start=450) "Water temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hee(start=3e5)
-    "Water specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hse(start=20e5)
-    "Water specific enthalpy at the outlet";
-  Units.SI.MassFlowRate Qe(start=10) "Water mass flow rate";
-  Units.SI.Density rhof(start=0.9) "Flue gases density";
-  Units.SI.Density rhoe(start=700) "Water density";
-  Units.SI.Power W(start=1e8) "Power exchanged";
-
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cws2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cfg1
-    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg2
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proes
-    annotation (Placement(transformation(extent={{-52,80},{-32,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proem
-    annotation (Placement(transformation(extent={{-76,80},{-56,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{58,80},{78,100}}, rotation=0)));
-equation
-  /* Flue gases inlet */
-  Pef = Cfg1.P;
-  Tef = Cfg1.T;
-  Qf = Cfg1.Q;
-
-  /* Flue gases outlet */
-  Psf = Cfg2.P;
-  Tsf = Cfg2.T;
-  Cfg1.Q = Cfg2.Q;
-
-  Cfg2.Xco2 = Cfg1.Xco2;
-  Cfg2.Xh2o = Cfg1.Xh2o;
-  Cfg2.Xo2  = Cfg1.Xo2;
-  Cfg2.Xso2 = Cfg1.Xso2;
-
-  /* Water inlet */
-  Pee = Cws1.P;
-  Hee = Cws1.h;
-  Qe = Cws1.Q;
-
-  /* Water outlet */
-  Pse = Cws2.P;
-  Hse = Cws2.h;
-  Cws1.Q = Cws2.Q;
-
-  /* Flow reversal */
-  0 = if (Qe > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
-
-  /* Pressure losses */
-  Pef = Psf + Kdpf*ThermoSysPro.Functions.ThermoSquare(
-                                                      Qf, eps)/rhof;
-  Pee = Pse + Kdpe*ThermoSysPro.Functions.ThermoSquare(
-                                                      Qe, eps)/rhoe;
-
-  /* Power exchanged */
-  W = Qf*(Hef - Hsf);
-  W = Qe*(Hse - Hee);
-
-  /* Flue gases specific ethalpy at the inlet */
-  Hef =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
-
-  /* Flue gases specific ethalpy at the outlet */
-  Hsf =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
-
-  /* Flue gases density */
-  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
-
-  /* Water/steam thermodynamic properties */
-  proee = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pee, Hee, mode);
-  Tee = proee.T;
-
-  proem = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2, (Hee + Hse)/2, mode);
-  rhoe = proem.d;
-
-  proes = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode);
-  Tse = proes.T;
-
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Pse);
-  Hse= vsat.h;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-30,76},{28,66}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "Flue gases"),
-        Polygon(
-          points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74,
-              6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92,
-              -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-114,28},{-48,18}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "Water/Steam"),
-        Polygon(
-          points={{-94,3},{90,3},{90,-3},{-94,-3},{-94,3}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-                            Icon(graphics={
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Polygon(
-          points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74,
-              6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-92,3},{92,3},{92,-3},{-92,-3},{-92,3}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92,
-              -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end SimpleEvaporatorWaterSteamFlueGases;
+within ThermoSysPro.MultiFluids.HeatExchangers;
+model SimpleEvaporatorWaterSteamFlueGases
+  "Simple water/steam - flue gases evaporator"
+  parameter Real Kdpf=10 "Flue gases pressure drop coefficient";
+  parameter Real Kdpe=10 "Water/steam pressure drop coefficient";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.AbsolutePressure Pef(start=3e5) "Flue gases pressure at the inlet";
+  Units.SI.AbsolutePressure Psf(start=2.5e5)
+    "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tef(start=600) "Flue gases temperature at the inlet";
+  Units.SI.Temperature Tsf(start=400) "Flue gases temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hsf(start=3e5)
+    "Flue gases specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hef(start=6e5)
+    "Flue gases specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qf(start=10) "Flue gases mass flow rate";
+  Units.SI.AbsolutePressure Pee(start=2e6) "Water pressure at the inlet";
+  Units.SI.AbsolutePressure Pse(start=2e6) "Water pressure at the outlet";
+  Units.SI.Temperature Tee(start=400) "Water temperature at the inlet";
+  Units.SI.Temperature Tse(start=450) "Water temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hee(start=3e5)
+    "Water specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hse(start=20e5)
+    "Water specific enthalpy at the outlet";
+  Units.SI.MassFlowRate Qe(start=10) "Water mass flow rate";
+  Units.SI.Density rhof(start=0.9) "Flue gases density";
+  Units.SI.Density rhoe(start=700) "Water density";
+  Units.SI.Power W(start=1e8) "Power exchanged";
+
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cws2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cfg1
+    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg2
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proes
+    annotation (Placement(transformation(extent={{-52,80},{-32,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proem
+    annotation (Placement(transformation(extent={{-76,80},{-56,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{58,80},{78,100}}, rotation=0)));
+equation
+  /* Flue gases inlet */
+  Pef = Cfg1.P;
+  Tef = Cfg1.T;
+  Qf = Cfg1.Q;
+
+  /* Flue gases outlet */
+  Psf = Cfg2.P;
+  Tsf = Cfg2.T;
+  Cfg1.Q = Cfg2.Q;
+
+  Cfg2.Xco2 = Cfg1.Xco2;
+  Cfg2.Xh2o = Cfg1.Xh2o;
+  Cfg2.Xo2  = Cfg1.Xo2;
+  Cfg2.Xso2 = Cfg1.Xso2;
+
+  /* Water inlet */
+  Pee = Cws1.P;
+  Hee = Cws1.h;
+  Qe = Cws1.Q;
+
+  /* Water outlet */
+  Pse = Cws2.P;
+  Hse = Cws2.h;
+  Cws1.Q = Cws2.Q;
+
+  /* Flow reversal */
+  0 = if (Qe > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
+
+  /* Pressure losses */
+  Pef = Psf + Kdpf*ThermoSysPro.Functions.ThermoSquare(
+                                                      Qf, eps)/rhof;
+  Pee = Pse + Kdpe*ThermoSysPro.Functions.ThermoSquare(
+                                                      Qe, eps)/rhoe;
+
+  /* Power exchanged */
+  W = Qf*(Hef - Hsf);
+  W = Qe*(Hse - Hee);
+
+  /* Flue gases specific ethalpy at the inlet */
+  Hef =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
+
+  /* Flue gases specific ethalpy at the outlet */
+  Hsf =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
+
+  /* Flue gases density */
+  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
+
+  /* Water/steam thermodynamic properties */
+  proee = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pee, Hee, mode);
+  Tee = proee.T;
+
+  proem = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2, (Hee + Hse)/2, mode);
+  rhoe = proem.d;
+
+  proes = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode);
+  Tse = proes.T;
+
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Pse);
+  Hse= vsat.h;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-30,76},{28,66}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "Flue gases"),
+        Polygon(
+          points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74,
+              6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92,
+              -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-114,28},{-48,18}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "Water/Steam"),
+        Polygon(
+          points={{-94,3},{90,3},{90,-3},{-94,-3},{-94,3}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+                            Icon(graphics={
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Polygon(
+          points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74,
+              6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-92,3},{92,3},{92,-3},{-92,-3},{-92,3}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92,
+              -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end SimpleEvaporatorWaterSteamFlueGases;
diff --git a/ThermoSysPro/MultiFluids/HeatExchangers/StaticAerocondenser.mo b/ThermoSysPro/MultiFluids/HeatExchangers/StaticAerocondenser.mo
index 04cb059f77b5f63ca0253a5b2468650ef747f3f8..545074a99c63a0832621688dfd0be848e8d662f4 100644
--- a/ThermoSysPro/MultiFluids/HeatExchangers/StaticAerocondenser.mo
+++ b/ThermoSysPro/MultiFluids/HeatExchangers/StaticAerocondenser.mo
@@ -1,259 +1,259 @@
-within ThermoSysPro.MultiFluids.HeatExchangers;
-model StaticAerocondenser "Static aerocondenser"
-  parameter Units.SI.CoefficientOfHeatTransfer Uref=50
-    "Reference heat transfer coefficient between the air and the condenser external wall";
-  parameter Real UCOR=1. "Heat transfer corrective coefficient";
-  parameter Units.SI.Area Se=1.e4 "Condenser external wall area";
-  parameter Units.SI.Height z=0 "Water level in the condenser";
-  parameter Real K=0.02
-    "Pressure loss coefficient for the water/steam pipe (Pa.s²/(kg.m**3))";
-  parameter Real Ka=0.00
-    "Pressure loss coefficient for the air (Pa.s²/(kg.m**3))";
-  parameter Integer mode_e=0
-    "Région IAPWS en entrée. 1:liquide - 2:vapeur - 4:saturation - 0:calcul automatique";
-  parameter Integer mode_s=0
-    "Région IAPWS en entrée. 1:liquide - 2:vapeur - 4:saturation - 0:calcul automatique";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-
-public
-  Units.SI.SpecificEnthalpy hv(start=2500000)
-    "Fluid specific enthalpy at the inlet of the condenser";
-  Units.SI.SpecificEnthalpy he(start=370000)
-    "Fluid specific enthalpy at the outlet of the condenser";
-  Units.SI.SpecificEnthalpy hae(start=75000)
-    "Air specific enthalpy at the inlet of the condenser";
-  Units.SI.SpecificEnthalpy has(start=100000)
-    "Air specific enthalpy at the outlet of the condenser";
-  Units.SI.MassFlowRate Q(start=1.5e2)
-    "Fluid mass flow rate in the water/steam pipe";
-  Units.SI.MassFlowRate Qa(start=1.4e3) "Air mass flow rate in the condenser";
-  Units.SI.Temperature Tae(start=290)
-    "Air temperature at the inlet of the condenser";
-  Units.SI.Temperature Tas(start=360)
-    "Air temperature at the outlet of the condenser";
-  Units.SI.AbsolutePressure Pae(start=1.e5)
-    "Air pressure at the inlet of the condenser";
-  Units.SI.AbsolutePressure Pas(start=1.e5)
-    "Air pressure at the outlet of the condenser";
-  Units.SI.AbsolutePressure Pv(start=30000)
-    "Fluid pressure at the inlet of the condenser";
-  Units.SI.AbsolutePressure Pe(start=30000)
-    "Fluid pressure at the outlet of the condenser";
-  Units.SI.AbsolutePressure Pcond(start=17000) "Condensation pressure (vacuum)";
-  Units.SI.Temperature Tcond(start=360) "Condensation temperature";
-  Units.SI.CoefficientOfHeatTransfer U(start=50) "Heat transfer coefficient";
-  Units.SI.SpecificHeatCapacity cp_a(start=1000)
-    "Air specific heat capacity at constant pressure";
-  Real Nut(start=2.) "Number of transfer units";
-  Real Ef(start=0.8) "Efficiency in two-phase flow regime";
-  Units.SI.Power W "Heat power transfered to the cooling air";
-  Units.SI.Density rho_v(start=500)
-    "Fluid density at the inlet of the condenser";
-  Units.SI.Density rho_e(start=998)
-    "Fluid density at the outlet of the condenser";
-  Units.SI.Density rho_a(start=1) "Air density";
-public
-  WaterSteam.Connectors.FluidInlet Cws1
-    annotation (Placement(transformation(extent={{-110,-50},{-90,-30}},
-          rotation=0)));
-  WaterSteam.Connectors.FluidOutlet Cws2
-    annotation (Placement(transformation(extent={{90,-50},{110,-30}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cair1
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cair2
-    annotation (Placement(transformation(extent={{-10,88},{10,108}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Steam properties"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    "Water properties"
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-equation
-
-  Pv = Cws1.P;
-  Pe = Cws2.P;
-  hv = Cws1.h;
-  he = Cws2.h;
-  Q = Cws1.Q;
-  Q = Cws2.Q;
-
-  Pae = Cair1.P;
-  Pas = Cair2.P;
-  Tae = Cair1.T;
-  Tas = Cair2.T;
-  Qa = Cair1.Q;
-  Qa = Cair2.Q;
-
-  /* Flow reversal in the water/steam pipe */
-  0 = if (Q > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
-
-  /* Air composition */
-  Cair2.Xco2 = Cair1.Xco2;
-  Cair2.Xh2o = Cair1.Xh2o;
-  Cair2.Xo2 = Cair1.Xo2;
-  Cair2.Xso2 = Cair1.Xso2;
-
-  /* Condensation temperature */
-  Tcond = ((Tas + Tae*(Ef - 1.))/Ef);
-
-  /* Condensation pressure */
-  Pcond = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Tcond);
-
-  /* Pressure losses in the water steam pipe */
-  Pv = Pcond + K*(Q*abs(Q))/rho_v;
-  Pe = Pcond + rho_e*g*z;
-
-  /* Air pressure losses */
-  Pae = Pas + Ka*(Qa*abs(Qa))/rho_a;
-
-  /* Heat exchange coefficient */
-  U = UCOR*Uref*(-2.e-4*(Tae - 273.16)^2 + 0.0187*(Tae - 273.16) + 0.5007);
-
-  /* Energy balance equation for the air */
-  if noEvent(Qa > 0) then
-    (has - hae)*Qa - ((hv - he)*Q) = 0;
-  else
-    (has - hae)*1.e-6 - ((hv - he)*Q) = 0;
-  end if;
-
-  /* Number of transfer units */
-  Nut = if noEvent(Qa*cp_a > 0) then Se*U/(Qa*cp_a) else 2.;
-
-  /* Efficiency in the two-phase flow regime */
-  Ef = 1 - exp(-Nut);
-
-  /* Heat power transferred to the cooling water */
-  W = Qa*(has - hae);
-
-  /* Water/steam thermodynamic properties */
-  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pv + Pcond)/2., hv, mode_e);
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pe + Pcond)/2., he, mode_s);
-
-  rho_v = prov.d;
-  rho_e = proe.d;
-
-  /* Water specific enthalpy at the saturation point with pressure Pcond */
-
-  he = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(Pcond);
-
-  /* Air thermodynamic properties */
-  hae = ThermoSysPro.Properties.FlueGases.FlueGases_h( Pae, Tae, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  has = ThermoSysPro.Properties.FlueGases.FlueGases_h( Pas, Tas, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  rho_a = ThermoSysPro.Properties.FlueGases.FlueGases_rho( Pae, Tae,  Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  cp_a = ThermoSysPro.Properties.FlueGases.FlueGases_cp( (Pae + Pas)/2., (Tae + Tas)/2., Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-100},{100,48},{-100,48},{-100,-100},{100,-100}},
-          lineColor={28,108,200},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{100,48},{-100,48},{-40,100},{40,100},{100,48}},
-          lineColor={28,108,200},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,86},{-10,66},{12,66},{0,86}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{1,66},{1,10}},
-          color={0,0,0},
-          thickness=1),
-        Text(
-          extent={{-28,102},{-16,92}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Air"),
-        Text(
-          extent={{-24,-88},{-12,-98}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Air"),
-        Text(
-          extent={{90,-20},{114,-28}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Water"),
-        Text(
-          extent={{-112,-18},{-86,-26}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Steam"),
-        Line(
-          points={{-100,-28},{86,-28},{86,-34},{-84,-34},{-84,-40},{86,-40},{86,
-              -46},{-84,-46},{-84,-52},{100,-52}},
-          color={28,108,200},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-100},{100,48},{-100,48},{-100,-100},{100,-100}},
-          lineColor={28,108,200},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{100,48},{-100,48},{-40,100},{40,100},{100,48}},
-          lineColor={28,108,200},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-100,-28},{86,-28},{86,-34},{-84,-34},{-84,-40},{86,-40},{86,
-              -46},{-84,-46},{-84,-52},{100,-52}},
-          color={28,108,200},
-          thickness=0.5),
-        Polygon(
-          points={{0,78},{-10,58},{12,58},{0,78}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{0,58},{0,42}},
-          color={0,0,0},
-          thickness=1)}),
-    Window(
-      x=0.09,
-      y=0.08,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StaticAerocondenser;
+within ThermoSysPro.MultiFluids.HeatExchangers;
+model StaticAerocondenser "Static aerocondenser"
+  parameter Units.SI.CoefficientOfHeatTransfer Uref=50
+    "Reference heat transfer coefficient between the air and the condenser external wall";
+  parameter Real UCOR=1. "Heat transfer corrective coefficient";
+  parameter Units.SI.Area Se=1.e4 "Condenser external wall area";
+  parameter Units.SI.Height z=0 "Water level in the condenser";
+  parameter Real K=0.02
+    "Pressure loss coefficient for the water/steam pipe (Pa.s²/(kg.m**3))";
+  parameter Real Ka=0.00
+    "Pressure loss coefficient for the air (Pa.s²/(kg.m**3))";
+  parameter Integer mode_e=0
+    "Région IAPWS en entrée. 1:liquide - 2:vapeur - 4:saturation - 0:calcul automatique";
+  parameter Integer mode_s=0
+    "Région IAPWS en entrée. 1:liquide - 2:vapeur - 4:saturation - 0:calcul automatique";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+
+public
+  Units.SI.SpecificEnthalpy hv(start=2500000)
+    "Fluid specific enthalpy at the inlet of the condenser";
+  Units.SI.SpecificEnthalpy he(start=370000)
+    "Fluid specific enthalpy at the outlet of the condenser";
+  Units.SI.SpecificEnthalpy hae(start=75000)
+    "Air specific enthalpy at the inlet of the condenser";
+  Units.SI.SpecificEnthalpy has(start=100000)
+    "Air specific enthalpy at the outlet of the condenser";
+  Units.SI.MassFlowRate Q(start=1.5e2)
+    "Fluid mass flow rate in the water/steam pipe";
+  Units.SI.MassFlowRate Qa(start=1.4e3) "Air mass flow rate in the condenser";
+  Units.SI.Temperature Tae(start=290)
+    "Air temperature at the inlet of the condenser";
+  Units.SI.Temperature Tas(start=360)
+    "Air temperature at the outlet of the condenser";
+  Units.SI.AbsolutePressure Pae(start=1.e5)
+    "Air pressure at the inlet of the condenser";
+  Units.SI.AbsolutePressure Pas(start=1.e5)
+    "Air pressure at the outlet of the condenser";
+  Units.SI.AbsolutePressure Pv(start=30000)
+    "Fluid pressure at the inlet of the condenser";
+  Units.SI.AbsolutePressure Pe(start=30000)
+    "Fluid pressure at the outlet of the condenser";
+  Units.SI.AbsolutePressure Pcond(start=17000) "Condensation pressure (vacuum)";
+  Units.SI.Temperature Tcond(start=360) "Condensation temperature";
+  Units.SI.CoefficientOfHeatTransfer U(start=50) "Heat transfer coefficient";
+  Units.SI.SpecificHeatCapacity cp_a(start=1000)
+    "Air specific heat capacity at constant pressure";
+  Real Nut(start=2.) "Number of transfer units";
+  Real Ef(start=0.8) "Efficiency in two-phase flow regime";
+  Units.SI.Power W "Heat power transfered to the cooling air";
+  Units.SI.Density rho_v(start=500)
+    "Fluid density at the inlet of the condenser";
+  Units.SI.Density rho_e(start=998)
+    "Fluid density at the outlet of the condenser";
+  Units.SI.Density rho_a(start=1) "Air density";
+public
+  WaterSteam.Connectors.FluidInlet Cws1
+    annotation (Placement(transformation(extent={{-110,-50},{-90,-30}},
+          rotation=0)));
+  WaterSteam.Connectors.FluidOutlet Cws2
+    annotation (Placement(transformation(extent={{90,-50},{110,-30}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cair1
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cair2
+    annotation (Placement(transformation(extent={{-10,88},{10,108}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Steam properties"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    "Water properties"
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+equation
+
+  Pv = Cws1.P;
+  Pe = Cws2.P;
+  hv = Cws1.h;
+  he = Cws2.h;
+  Q = Cws1.Q;
+  Q = Cws2.Q;
+
+  Pae = Cair1.P;
+  Pas = Cair2.P;
+  Tae = Cair1.T;
+  Tas = Cair2.T;
+  Qa = Cair1.Q;
+  Qa = Cair2.Q;
+
+  /* Flow reversal in the water/steam pipe */
+  0 = if (Q > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
+
+  /* Air composition */
+  Cair2.Xco2 = Cair1.Xco2;
+  Cair2.Xh2o = Cair1.Xh2o;
+  Cair2.Xo2 = Cair1.Xo2;
+  Cair2.Xso2 = Cair1.Xso2;
+
+  /* Condensation temperature */
+  Tcond = ((Tas + Tae*(Ef - 1.))/Ef);
+
+  /* Condensation pressure */
+  Pcond = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Tcond);
+
+  /* Pressure losses in the water steam pipe */
+  Pv = Pcond + K*(Q*abs(Q))/rho_v;
+  Pe = Pcond + rho_e*g*z;
+
+  /* Air pressure losses */
+  Pae = Pas + Ka*(Qa*abs(Qa))/rho_a;
+
+  /* Heat exchange coefficient */
+  U = UCOR*Uref*(-2.e-4*(Tae - 273.16)^2 + 0.0187*(Tae - 273.16) + 0.5007);
+
+  /* Energy balance equation for the air */
+  if noEvent(Qa > 0) then
+    (has - hae)*Qa - ((hv - he)*Q) = 0;
+  else
+    (has - hae)*1.e-6 - ((hv - he)*Q) = 0;
+  end if;
+
+  /* Number of transfer units */
+  Nut = if noEvent(Qa*cp_a > 0) then Se*U/(Qa*cp_a) else 2.;
+
+  /* Efficiency in the two-phase flow regime */
+  Ef = 1 - exp(-Nut);
+
+  /* Heat power transferred to the cooling water */
+  W = Qa*(has - hae);
+
+  /* Water/steam thermodynamic properties */
+  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pv + Pcond)/2., hv, mode_e);
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pe + Pcond)/2., he, mode_s);
+
+  rho_v = prov.d;
+  rho_e = proe.d;
+
+  /* Water specific enthalpy at the saturation point with pressure Pcond */
+
+  he = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(Pcond);
+
+  /* Air thermodynamic properties */
+  hae = ThermoSysPro.Properties.FlueGases.FlueGases_h( Pae, Tae, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  has = ThermoSysPro.Properties.FlueGases.FlueGases_h( Pas, Tas, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  rho_a = ThermoSysPro.Properties.FlueGases.FlueGases_rho( Pae, Tae,  Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  cp_a = ThermoSysPro.Properties.FlueGases.FlueGases_cp( (Pae + Pas)/2., (Tae + Tas)/2., Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-100},{100,48},{-100,48},{-100,-100},{100,-100}},
+          lineColor={28,108,200},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{100,48},{-100,48},{-40,100},{40,100},{100,48}},
+          lineColor={28,108,200},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,86},{-10,66},{12,66},{0,86}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{1,66},{1,10}},
+          color={0,0,0},
+          thickness=1),
+        Text(
+          extent={{-28,102},{-16,92}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Air"),
+        Text(
+          extent={{-24,-88},{-12,-98}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Air"),
+        Text(
+          extent={{90,-20},{114,-28}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Water"),
+        Text(
+          extent={{-112,-18},{-86,-26}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Steam"),
+        Line(
+          points={{-100,-28},{86,-28},{86,-34},{-84,-34},{-84,-40},{86,-40},{86,
+              -46},{-84,-46},{-84,-52},{100,-52}},
+          color={28,108,200},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-100},{100,48},{-100,48},{-100,-100},{100,-100}},
+          lineColor={28,108,200},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{100,48},{-100,48},{-40,100},{40,100},{100,48}},
+          lineColor={28,108,200},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-100,-28},{86,-28},{86,-34},{-84,-34},{-84,-40},{86,-40},{86,
+              -46},{-84,-46},{-84,-52},{100,-52}},
+          color={28,108,200},
+          thickness=0.5),
+        Polygon(
+          points={{0,78},{-10,58},{12,58},{0,78}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{0,58},{0,42}},
+          color={0,0,0},
+          thickness=1)}),
+    Window(
+      x=0.09,
+      y=0.08,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StaticAerocondenser;
diff --git a/ThermoSysPro/MultiFluids/HeatExchangers/StaticExchangerWaterSteamFlueGases.mo b/ThermoSysPro/MultiFluids/HeatExchangers/StaticExchangerWaterSteamFlueGases.mo
index df51b897fea43bdc45c9095b9391f6f40598dc98..39d73ded8c6ba3b66d311a903e6c940bfe6a2107 100644
--- a/ThermoSysPro/MultiFluids/HeatExchangers/StaticExchangerWaterSteamFlueGases.mo
+++ b/ThermoSysPro/MultiFluids/HeatExchangers/StaticExchangerWaterSteamFlueGases.mo
@@ -1,255 +1,255 @@
-within ThermoSysPro.MultiFluids.HeatExchangers;
-model StaticExchangerWaterSteamFlueGases
-  "Static heat exchanger water/steam - flue gases"
-  parameter Integer exchanger_type=1
-    "Exchanger type - 1: Efficiency is fixed - 2: delta power is fixed - 3: heat transfer is fixed";
-  parameter Real EffEch = 0.9 "Thermal exchange efficiency";
-  parameter Units.SI.Power W0=0 "Power exchanged (active if exchanger_type=2)";
-  parameter Units.SI.CoefficientOfHeatTransfer K=100
-    "Global heat transfer coefficient (active if exchanger_type=3)";
-  parameter Units.SI.Area S=10
-    "Global heat exchange surface (active if exchanger_type=3)";
-  parameter Real Kdpf = 10 "Pressure loss coefficient on the flue gas side";
-  parameter Real Kdpe = 10 "Pressure loss coefficient on the water/steam side";
-  parameter Integer exchanger_conf=1
-    "Exchanger configuration - 1: counter-current. 2: co-current";
-  parameter Integer mode=0
-    "IF97 region of the water. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.AbsolutePressure Pef(start=3e5) "Flue gas pressure at the inlet";
-  Units.SI.AbsolutePressure Psf(start=2.5e5) "Flue gas pressure at the outlet";
-  Units.SI.Temperature Tef(start=600) "Flue gas temperature at the inlet";
-  Units.SI.Temperature Tsf(start=400) "Flue gas temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hef(start=6e5)
-    "Flue gas specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hsf(start=3e5)
-    "Flue gas specific enthalpy at the outlet";
-  Units.SI.MassFlowRate Qf(start=10) "Flue gas mass flow rate";
-  Units.SI.AbsolutePressure Pee(start=2e6) "Water pressure at the inlet";
-  Units.SI.AbsolutePressure Pse(start=2e6) "Water pressure at the outlet";
-  Units.SI.Temperature Tee(start=400) "Water temperature at the inlet";
-  Units.SI.Temperature Tse(start=450) "Water temperature at the outlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DT1 "Delta T at the inlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DT2 "Delta T at the outlet";
-  Units.SI.SpecificEnthalpy Hse(start=20e5)
-    "Water specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hee(start=3e5)
-    "Water specific enthalpy at the outlet";
-  Units.SI.MassFlowRate Qe(start=10) "Water mass flow rate";
-  Units.SI.Density rhoe(start=700) "Water density";
-  Units.SI.Density rhof(start=0.9) "Fluie gas density";
-  Units.SI.SpecificHeatCapacity Cpf(start=1000)
-    "Flue gas specific heat capacity";
-  Units.SI.SpecificHeatCapacity Cpe(start=4200) "Water specific heat capacity";
-  Units.SI.Power W(start=1e8) "Exchanger power";
-
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cws2 "Water outlet"
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws1 "Water inlet"
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cfg1
-    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg2
-    annotation (Placement(transformation(extent={{-11,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proes
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proem
-    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
-equation
-  /* Flue gas inlet */
-  Pef = Cfg1.P;
-  Tef = Cfg1.T;
-  Qf = Cfg1.Q;
-
-  /* Flue gas outlet */
-  Psf = Cfg2.P;
-  Tsf = Cfg2.T;
-  Qf = Cfg2.Q;
-
-  Cfg2.Xco2 = Cfg1.Xco2;
-  Cfg2.Xh2o = Cfg1.Xh2o;
-  Cfg2.Xo2  = Cfg1.Xo2;
-  Cfg2.Xso2 = Cfg1.Xso2;
-
-  /* Water inlet */
-  Pee = Cws1.P;
-  Hee = Cws1.h;
-  Qe = Cws1.Q;
-
-  /* Water outlet */
-  Pse = Cws2.P;
-  Hse = Cws2.h;
-  Qe = Cws2.Q;
-
-  /* Flow reversal */
-  0 = if (Qe > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
-
-  if (exchanger_conf == 1) then
-     /* Counter-current exchanger */
-     DT1 = Tef - Tse;
-     DT2 = Tsf - Tee;
-  elseif (exchanger_conf == 2) then
-     /* Co-current exchanger */
-     DT1 = Tef - Tee;
-     DT2 = Tsf - Tse;
-  else
-     DT1 = 0;
-     DT2 = 0;
-     assert(false, "StaticExchangerFlueGasesWaterSteam: incorrect exchanger configuration");
-  end if;
-
-  /* Power exchanged between the hot and the cold sides */
-  if (exchanger_type == 1) then
-     W = noEvent(min(Qe*Cpe, Qf*Cpf))*EffEch*(Tef - Tee);
-     W = Qf*(Hef - Hsf);
-     W = Qe*(Hse - Hee);
-  elseif (exchanger_type == 2) then
-     W = W0;
-     W = Qf*(Hef - Hsf);
-     W = Qe*(Hse - Hee);
-  else
-     DT2 = if (exchanger_conf == 1) then DT1*Modelica.Math.exp(-K*S*(1/(Qf*Cpf) - 1/(Qe*Cpe))) else
-                                         DT1*Modelica.Math.exp(-K*S*(1/(Qf*Cpf) + 1/(Qe*Cpe)));
-     W = Qf*Cpf*(Tef - Tsf);
-     W = Qe*(Hse - Hee);
-  end if;
-
-  /* Pressure losses */
-  Pef = Psf + Kdpf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
-  Pee = Pse + Kdpe*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe;
-
-  /* Flue gas specific enthalpy at the inlet */
-  Hef = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
-
-  /* Flue gas specific enthalpy at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
-
-  /* Flue gas specific heat capacity */
-  Cpf = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
-
-  /* Flue gas specific density */
-  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
-
-  /* Water/steam thermodynamic properties */
-  proee = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pee, Hee, mode);
-  Tee = proee.T;
-
-  proem = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2,(Hee + Hse)/2,mode);
-  rhoe = proem.d;
-  Cpe = noEvent(if proee.x <= 0.0 or proee.x >= 1.0 then proee.cp else 1e6);
-
-  proes = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode);
-  Tse = proes.T;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-100,50},{100,-50}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,-50},{100,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-100,80},{100,50}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Line(
-          points={{-94,-2},{-44,-2},{-24,46},{16,-48},{36,-2},{90,-2}},
-          color={0,0,0},
-          thickness=0.5),
-        Text(
-          extent={{-28,72},{34,56}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "HotFlueGases"),
-        Text(
-          extent={{-34,8},{42,-6}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "WaterSteam"),
-        Text(
-          extent={{-30,-58},{32,-74}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "HotFlueGases")}),
-                            Icon(graphics={
-        Rectangle(
-          extent={{-100,80},{100,50}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-100,50},{100,-50}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-94,-2},{-44,-2},{-24,46},{16,-48},{36,-2},{90,-2}},
-          color={0,0,0},
-          thickness=0.5),
-        Text(
-          extent={{-34,8},{42,-6}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "WaterSteam"),
-        Rectangle(
-          extent={{-100,-50},{100,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Backward),
-        Text(
-          extent={{-30,-58},{32,-74}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "HotFlueGases"),
-        Text(
-          extent={{-30,72},{32,56}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={175,175,175},
-          textString=
-               "HotFlueGases")}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end StaticExchangerWaterSteamFlueGases;
+within ThermoSysPro.MultiFluids.HeatExchangers;
+model StaticExchangerWaterSteamFlueGases
+  "Static heat exchanger water/steam - flue gases"
+  parameter Integer exchanger_type=1
+    "Exchanger type - 1: Efficiency is fixed - 2: delta power is fixed - 3: heat transfer is fixed";
+  parameter Real EffEch = 0.9 "Thermal exchange efficiency";
+  parameter Units.SI.Power W0=0 "Power exchanged (active if exchanger_type=2)";
+  parameter Units.SI.CoefficientOfHeatTransfer K=100
+    "Global heat transfer coefficient (active if exchanger_type=3)";
+  parameter Units.SI.Area S=10
+    "Global heat exchange surface (active if exchanger_type=3)";
+  parameter Real Kdpf = 10 "Pressure loss coefficient on the flue gas side";
+  parameter Real Kdpe = 10 "Pressure loss coefficient on the water/steam side";
+  parameter Integer exchanger_conf=1
+    "Exchanger configuration - 1: counter-current. 2: co-current";
+  parameter Integer mode=0
+    "IF97 region of the water. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.AbsolutePressure Pef(start=3e5) "Flue gas pressure at the inlet";
+  Units.SI.AbsolutePressure Psf(start=2.5e5) "Flue gas pressure at the outlet";
+  Units.SI.Temperature Tef(start=600) "Flue gas temperature at the inlet";
+  Units.SI.Temperature Tsf(start=400) "Flue gas temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hef(start=6e5)
+    "Flue gas specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hsf(start=3e5)
+    "Flue gas specific enthalpy at the outlet";
+  Units.SI.MassFlowRate Qf(start=10) "Flue gas mass flow rate";
+  Units.SI.AbsolutePressure Pee(start=2e6) "Water pressure at the inlet";
+  Units.SI.AbsolutePressure Pse(start=2e6) "Water pressure at the outlet";
+  Units.SI.Temperature Tee(start=400) "Water temperature at the inlet";
+  Units.SI.Temperature Tse(start=450) "Water temperature at the outlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DT1 "Delta T at the inlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DT2 "Delta T at the outlet";
+  Units.SI.SpecificEnthalpy Hse(start=20e5)
+    "Water specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hee(start=3e5)
+    "Water specific enthalpy at the outlet";
+  Units.SI.MassFlowRate Qe(start=10) "Water mass flow rate";
+  Units.SI.Density rhoe(start=700) "Water density";
+  Units.SI.Density rhof(start=0.9) "Fluie gas density";
+  Units.SI.SpecificHeatCapacity Cpf(start=1000)
+    "Flue gas specific heat capacity";
+  Units.SI.SpecificHeatCapacity Cpe(start=4200) "Water specific heat capacity";
+  Units.SI.Power W(start=1e8) "Exchanger power";
+
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cws2 "Water outlet"
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws1 "Water inlet"
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cfg1
+    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg2
+    annotation (Placement(transformation(extent={{-11,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proes
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proem
+    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
+equation
+  /* Flue gas inlet */
+  Pef = Cfg1.P;
+  Tef = Cfg1.T;
+  Qf = Cfg1.Q;
+
+  /* Flue gas outlet */
+  Psf = Cfg2.P;
+  Tsf = Cfg2.T;
+  Qf = Cfg2.Q;
+
+  Cfg2.Xco2 = Cfg1.Xco2;
+  Cfg2.Xh2o = Cfg1.Xh2o;
+  Cfg2.Xo2  = Cfg1.Xo2;
+  Cfg2.Xso2 = Cfg1.Xso2;
+
+  /* Water inlet */
+  Pee = Cws1.P;
+  Hee = Cws1.h;
+  Qe = Cws1.Q;
+
+  /* Water outlet */
+  Pse = Cws2.P;
+  Hse = Cws2.h;
+  Qe = Cws2.Q;
+
+  /* Flow reversal */
+  0 = if (Qe > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
+
+  if (exchanger_conf == 1) then
+     /* Counter-current exchanger */
+     DT1 = Tef - Tse;
+     DT2 = Tsf - Tee;
+  elseif (exchanger_conf == 2) then
+     /* Co-current exchanger */
+     DT1 = Tef - Tee;
+     DT2 = Tsf - Tse;
+  else
+     DT1 = 0;
+     DT2 = 0;
+     assert(false, "StaticExchangerFlueGasesWaterSteam: incorrect exchanger configuration");
+  end if;
+
+  /* Power exchanged between the hot and the cold sides */
+  if (exchanger_type == 1) then
+     W = noEvent(min(Qe*Cpe, Qf*Cpf))*EffEch*(Tef - Tee);
+     W = Qf*(Hef - Hsf);
+     W = Qe*(Hse - Hee);
+  elseif (exchanger_type == 2) then
+     W = W0;
+     W = Qf*(Hef - Hsf);
+     W = Qe*(Hse - Hee);
+  else
+     DT2 = if (exchanger_conf == 1) then DT1*Modelica.Math.exp(-K*S*(1/(Qf*Cpf) - 1/(Qe*Cpe))) else
+                                         DT1*Modelica.Math.exp(-K*S*(1/(Qf*Cpf) + 1/(Qe*Cpe)));
+     W = Qf*Cpf*(Tef - Tsf);
+     W = Qe*(Hse - Hee);
+  end if;
+
+  /* Pressure losses */
+  Pef = Psf + Kdpf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
+  Pee = Pse + Kdpe*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe;
+
+  /* Flue gas specific enthalpy at the inlet */
+  Hef = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
+
+  /* Flue gas specific enthalpy at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
+
+  /* Flue gas specific heat capacity */
+  Cpf = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
+
+  /* Flue gas specific density */
+  rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pef, Tef, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2);
+
+  /* Water/steam thermodynamic properties */
+  proee = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pee, Hee, mode);
+  Tee = proee.T;
+
+  proem = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2,(Hee + Hse)/2,mode);
+  rhoe = proem.d;
+  Cpe = noEvent(if proee.x <= 0.0 or proee.x >= 1.0 then proee.cp else 1e6);
+
+  proes = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode);
+  Tse = proes.T;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-100,50},{100,-50}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,-50},{100,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-100,80},{100,50}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Line(
+          points={{-94,-2},{-44,-2},{-24,46},{16,-48},{36,-2},{90,-2}},
+          color={0,0,0},
+          thickness=0.5),
+        Text(
+          extent={{-28,72},{34,56}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "HotFlueGases"),
+        Text(
+          extent={{-34,8},{42,-6}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "WaterSteam"),
+        Text(
+          extent={{-30,-58},{32,-74}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "HotFlueGases")}),
+                            Icon(graphics={
+        Rectangle(
+          extent={{-100,80},{100,50}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-100,50},{100,-50}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-94,-2},{-44,-2},{-24,46},{16,-48},{36,-2},{90,-2}},
+          color={0,0,0},
+          thickness=0.5),
+        Text(
+          extent={{-34,8},{42,-6}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "WaterSteam"),
+        Rectangle(
+          extent={{-100,-50},{100,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Backward),
+        Text(
+          extent={{-30,-58},{32,-74}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "HotFlueGases"),
+        Text(
+          extent={{-30,72},{32,56}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={175,175,175},
+          textString=
+               "HotFlueGases")}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end StaticExchangerWaterSteamFlueGases;
diff --git a/ThermoSysPro/MultiFluids/HeatExchangers/package.mo b/ThermoSysPro/MultiFluids/HeatExchangers/package.mo
index 0065eebc51339760b42273c4f4c22e545f6ffe77..8be6c531d6395f22abf3ec1da9828acaf45e7abd 100644
--- a/ThermoSysPro/MultiFluids/HeatExchangers/package.mo
+++ b/ThermoSysPro/MultiFluids/HeatExchangers/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.MultiFluids;
-package HeatExchangers "Heat exchangers"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end HeatExchangers;
+within ThermoSysPro.MultiFluids;
+package HeatExchangers "Heat exchangers"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end HeatExchangers;
diff --git a/ThermoSysPro/MultiFluids/HeatExchangers/package.order b/ThermoSysPro/MultiFluids/HeatExchangers/package.order
index 1a654aba8500b2342a4103c85bb8f2c3dfdb27c3..988bf19106c53fc670820705b1ad4caaff855715 100644
--- a/ThermoSysPro/MultiFluids/HeatExchangers/package.order
+++ b/ThermoSysPro/MultiFluids/HeatExchangers/package.order
@@ -1,5 +1,5 @@
-DynamicExchangerWaterSteamFlueGases
-ExchangerWaterC3H3F5W
-SimpleEvaporatorWaterSteamFlueGases
-StaticExchangerWaterSteamFlueGases
-StaticAerocondenser
+DynamicExchangerWaterSteamFlueGases
+ExchangerWaterC3H3F5W
+SimpleEvaporatorWaterSteamFlueGases
+StaticExchangerWaterSteamFlueGases
+StaticAerocondenser
diff --git a/ThermoSysPro/MultiFluids/Machines/AlternatingEngine.mo b/ThermoSysPro/MultiFluids/Machines/AlternatingEngine.mo
index 3dcf71ead6389713d53bf63a826b17b8c0846761..3d2ef7e2e4e6f040ff7e8fb7d862ef2a1801ddad 100644
--- a/ThermoSysPro/MultiFluids/Machines/AlternatingEngine.mo
+++ b/ThermoSysPro/MultiFluids/Machines/AlternatingEngine.mo
@@ -1,317 +1,317 @@
-within ThermoSysPro.MultiFluids.Machines;
-model AlternatingEngine "Internal combustion engine with electrical output"
-  parameter Integer mechanical_efficiency_type = 1
-    "1: fixed nominal efficiency - 2: Linear efficiency using Coef_Rm_a, Coef_Rm_b and Coef_Rm_c - 3: Beau de Rochas cycle efficiency";
-  parameter Real Rmeca_nom=0.40
-    "Fixed nominal mechanical efficiency (active if mechanical_efficiency_type=1)";
-  parameter Real Coef_Rm_a=-5.727E-09
-    "Coefficient a for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
-  parameter Real Coef_Rm_b=4.5267E-05
-    "Coefficient b for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
-  parameter Real Coef_Rm_c=0.312412946
-    "Coefficient c for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
-  parameter Real Relec=0.97 "Engine electrical efficiency";
-  parameter Real Cosphi=1 "Cos(phi) of the electrical grid";
-  parameter Real Xpth=0.03 "Thermal loss fraction - cooling (0-1 sur Q.PCI)";
-  parameter Real Xref=0.2 "Cooling power fraction (0-1 sur Q.PCI)";
-  parameter Real MMg=30 "Gas average molar mass (g/mol)";
-  parameter Real DPe=0
-    "Water pressure loss as percent of the pressure at the inlet";
-  parameter ThermoSysPro.Units.SI.PressureDifference DPaf=0
-    "Pressure difference between the air pressure at the inlet and the flue gases pressure at the outlet";
-  parameter Real RV=6 "Engine volume ratio (> 1)";
-  parameter Real Kc=1.2 "Compression polytropic coefficient";
-  parameter Real Kd=1.4 "Expansion polytropic coefficient";
-  parameter Real Gamma=1.3333 "Flue gases gamma = Cp/Cv";
-
-protected
-  constant Real amC=12.01115 "Carbon atomic mass";
-  constant Real amH=1.00797 "Hydrogen atomic mass";
-  constant Real amO=15.9994 "Oxygen atomic mass";
-  constant Real amS=32.064 "Sulfur atomic mass";
-  constant Real amCO2=amC+2*amO "CO2 molecular mass";
-  constant Real amH2O=2*amH+amO "H2O molecular mass";
-  constant Real amSO2=amS+2*amO "SO2 molecular mass";
-
-public
-  Units.SI.MassFlowRate Qsf(start=400)
-    "Flue gases mass flow rate at the outlet";
-  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
-  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
-  Real XsfCO2(start=0.5) "Flue gases CO2 mass fraction at the outlet";
-  Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet";
-  Real XsfO2(start=0) "Flue gases O2 mass fraction at the outlet";
-  Real XsfSO2(start=0) "Flue gases SO2 mass fraction at the outlet";
-  Real Rmeca(start=0.3) "Engine mechanical efficiency";
-  Units.SI.Power Wmeca(start=5e8) "Engine mechanical power";
-  Units.SI.Power Welec(start=5e8) "Engine electrical power";
-  Units.SI.Power Wact(start=5e8) "Active power";
-  Units.SI.Power Wcomb(start=5e8) "Fuel power available (Q.PCS)";
-  Units.SI.Power Wpth_ref(start=1e6) "Power of thermal losses + cooling";
-  Real exc(start=1) "Combustion air ratio";
-  Real PCScomb "Pouvoir Calorifique Supérieur du combustible sur brut(en J/kg)";
-  Units.SI.Temperature Tm(start=500) "Air-gas mixture temperature";
-  Units.SI.Temperature Tfcp(start=500)
-    "Temperature at the end of the compression phase";
-  Units.SI.AbsolutePressure Pfcp(start=12e5)
-    "Pressure at the end of the compression phase";
-  Units.SI.Temperature Tfcb(start=500)
-    "Temperature at the end of the combustion phase";
-  Units.SI.AbsolutePressure Pfcb(start=12e5)
-    "Pressure at the end of the combustion phase";
-  Units.SI.Temperature Tfd(start=500)
-    "Temperature at the end of the expansion phase";
-  Units.SI.AbsolutePressure Pfd(start=12e5)
-    "Pressure at the end of the expansion phase";
-  Units.SI.Temperature Tfe(start=500) "Temperature at the exhaust";
-  Units.SI.SpecificEnthalpy Hea(start=50e3)
-    "Air specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hsf(start=50e4)
-    "Flue gases specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hcomb(start=10e3)
-    "Fuel specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hrfum(start=10e3)
-    "Flue gases reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
-  Units.SI.SpecificEnthalpy Hrcomb(start=10e3)
-    "Fuel reference specific enthalpy";
-  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet";
-  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
-  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
-  Real XeaCO2(start=0) "Air CO2 mass fraction at the inlet";
-  Real XeaH2O(start=0.1) "Air H2O mass fraction at the inlet";
-  Real XeaO2(start=0.2) "Air O2 mass fraction at the inlet";
-  Real XeaSO2(start=0) "Air SO2 mass fraction at the inlet";
-  Units.SI.SpecificHeatCapacity Cpair(start=1000) "Air specific heat capacity";
-  Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate";
-  Units.SI.Temperature Tcomb(start=300) "Fuel temperature";
-  Real XCcomb(start=0.8) "Fuel carbon fraction";
-  Real XHcomb(start=0.2) "Fuel hydrogen fraction";
-  Real XOcomb(start=0) "Fuel oxygen fraction";
-  Real XScomb(start=0) "Fuel sulfur fraction";
-  Real XEAUcomb(start=0) "Fuel H2O fraction";
-  Real XCDcomb(start=0) "Fuel ashes fraction";
-  Real PCIcomb(start=5e7) "Fuel PCI (J/kg)";
-  Units.SI.SpecificHeatCapacity Cpcomb(start=1000)
-    "Fuel specific heat capacity";
-  Units.SI.MassFlowRate Qe(start=1) "Water mass flow rate";
-  Units.SI.SpecificEnthalpy Hev(start=10e3)
-    "Water specific enthalpy at the inlet";
-  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
-  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
-  Units.SI.SpecificEnthalpy Hsv(start=10e3)
-    "Water specific enthalpy at the outlet";
-  Real MMairgaz(start=30) "Air/gas mixture molecular mass (g/mol)";
-  Real MMfumees(start=30) "Flue gases molecular mass (g/mol)";
-
-public
-  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel
-    annotation (Placement(transformation(extent={{-50,-100},{-30,-80}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cair
-    annotation (Placement(transformation(extent={{30,-100},{50,-80}}, rotation=
-            0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg
-    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws1
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cws2
-    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-equation
-
-  /* Air inlet */
-  Qea = Cair.Q;
-  Pea = Cair.P;
-  Tea = Cair.T;
-  XeaCO2 = Cair.Xco2;
-  XeaH2O = Cair.Xh2o;
-  XeaO2 = Cair.Xo2;
-  XeaSO2 = Cair.Xso2;
-
-  /* Fuel inlet */
-  Qcomb = Cfuel.Q;
-  Tcomb = Cfuel.T;
-  XCcomb = Cfuel.Xc;
-  XHcomb = Cfuel.Xh;
-  XOcomb = Cfuel.Xo;
-  XScomb = Cfuel.Xs;
-  XEAUcomb = Cfuel.hum;
-  XCDcomb = Cfuel.Xashes;
-  PCIcomb = Cfuel.LHV;
-  Cpcomb = Cfuel.cp;
-
-  /* Water/steam inlet */
-  Qe = Cws1.Q;
-  Hev = Cws1.h;
-
-  /* Water/steam outlet */
-  Cws2.Q = Cws1.Q;
-  Hsv = Cws2.h;
-
-  /* Flue gases outlet */
-  Qsf = Cfg.Q;
-  Psf = Cfg.P;
-  Tsf = Cfg.T;
-  XsfCO2 = Cfg.Xco2;
-  XsfH2O = Cfg.Xh2o;
-  XsfO2 = Cfg.Xo2;
-  XsfSO2 = Cfg.Xso2;
-
-  /* Flow reversal */
-  0 = if (Qe > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
-
-  /* Mass balance equation for the flue gases */
-  Qsf = Qea + Qcomb;
-
-  /* CO2 flue gases composition */
-  XsfCO2*Qsf = Qea*XeaCO2 + Qcomb*XCcomb*amCO2/amC;
-
-  /* H2O flue gases composition */
-  XsfH2O*Qsf = Qea*XeaH2O + Qcomb*XHcomb*(amH2O/2)/amH;
-
-  /* O2 flue gases composition */
-  XsfO2*Qsf = Qea*XeaO2 - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb;
-
-  /* SO2 flue gases composition */
-  XsfSO2*Qsf = Qea*XeaSO2 + Qcomb*XScomb*amSO2/amS;
-
-  /* Fuel thermal power available */
-  PCScomb = PCIcomb + 224.3e5*XHcomb + 25.1e5*XEAUcomb;
-  Wcomb = Qcomb*PCIcomb;
-
-  /* Thermal losses */
-  Wpth_ref = Qcomb*PCIcomb*(Xpth + Xref);
-  Qe*(Hsv - Hev) = Qcomb*PCIcomb*Xref;
-
-  /* Air thermodynamic properties at the inlet */
-  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-  Cpair = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
-
-  /* Flue gases thermodynamic properties at the outlet */
-  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
-
-  //---------------------
-  //  BEAU DE ROCHAS CYCLE
-
-  /* (1) Air and gas mixing at constant pressure Pea */
-  Tm = (Qcomb*Cpcomb*Tcomb + Qea*Cpair*Tea)/(Qcomb*Cpcomb + Qea*Cpair);
-
-  /* (2) Polytropic compression */
-  Tfcp = Tm*RV^(Kc - 1);
-  Pfcp = Pea*RV^Kc;
-
-  /* (3) Constant volume combustion (point mort haut) */
-  MMairgaz = (Qea*28.9 + Qcomb*MMg)/(Qea + Qcomb);
-  MMfumees = (1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2)*28 + XsfCO2*44 + XsfH2O*18 + XsfO2*32 + XsfSO2*64;
-  Pfcb = Pfcp*Tfcb/Tfcp*MMairgaz/MMfumees;
-  //Tfcb = (Wcomb - Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/0.75/Qsf + Tfcp;
-  Tfcb = Wcomb/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/Qsf + Tfcp;
-
-  /* (4) Polytropic expansion */
-  Tfd = Tfcb *(1/RV)^(Kd - 1);
-  Pfd = Pfcb *(1/RV)^Kd;
-
-  /* (5) Echappement */
-  Tfe = Tfd*(Psf/Pfd)^((Gamma - 1)/Gamma);
-
-  //---------------------
-
-  /* Efficiency and mechanical power */
-  if (mechanical_efficiency_type == 1) then
-    Rmeca = Rmeca_nom;
-  elseif (mechanical_efficiency_type == 2) then
-    Rmeca = Coef_Rm_a * Wcomb/1000*Wcomb/1000 + Coef_Rm_b*Wcomb/1000 + Coef_Rm_c;
-  else
-    Rmeca = ((Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair))
-            -(Qsf*(ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfe, XsfCO2, XsfH2O, XsfO2, XsfSO2)
-            -Hrfum) + Wpth_ref))/Wcomb;
-  end if;
-
-  Wmeca = Rmeca*Wcomb;
-
-  /* Combustion air ratio */
-  exc = Qea*(1 - XeaH2O)/((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO))/(XeaO2/(1 - XeaH2O)));
-
-  /* Pressure losses */
-  Pea - Psf = DPaf;
-  Cws2.P = if (Qe > 0) then Cws1.P - DPe*Cws1.P/100 else Cws1.P + DPe*Cws1.P/100;
-
-  /* Energy balance equation for the flue gases */
-  (Qsf*(Hsf - Hrfum) + Wpth_ref + Wmeca) - (Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair)) = 0;
-
-  Hcomb = Cpcomb*(Tcomb - 273.15);
-
-  /* Electrical power produced and active power*/
-  Welec = Wmeca*Relec;
-  Wact = Welec*Cosphi;
-
-  /* Reference specific enthalpies */
-  Hrair = 2501.569e3*XeaH2O;
-  Hrcomb = 0;
-  Hrfum = 2501.569e3*XsfH2O;
-
-    annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{
-              -10,-76},{-2,-66},{-10,-64}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{
-              48,-42},{-46,-42}},
-          lineColor={0,0,0},
-          fillColor={170,255,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{
-              46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid)}),
-                             Icon(graphics={
-        Rectangle(
-          extent={{-80,80},{80,-80}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{
-              -10,-76},{-2,-66},{-10,-64}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{
-              48,-42},{-46,-42}},
-          lineColor={0,0,0},
-          fillColor={170,255,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{
-              46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Chapter 15 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>"));
-end AlternatingEngine;
+within ThermoSysPro.MultiFluids.Machines;
+model AlternatingEngine "Internal combustion engine with electrical output"
+  parameter Integer mechanical_efficiency_type = 1
+    "1: fixed nominal efficiency - 2: Linear efficiency using Coef_Rm_a, Coef_Rm_b and Coef_Rm_c - 3: Beau de Rochas cycle efficiency";
+  parameter Real Rmeca_nom=0.40
+    "Fixed nominal mechanical efficiency (active if mechanical_efficiency_type=1)";
+  parameter Real Coef_Rm_a=-5.727E-09
+    "Coefficient a for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
+  parameter Real Coef_Rm_b=4.5267E-05
+    "Coefficient b for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
+  parameter Real Coef_Rm_c=0.312412946
+    "Coefficient c for the linear mechanical efficiency (active if mechanical_efficiency_type=2)";
+  parameter Real Relec=0.97 "Engine electrical efficiency";
+  parameter Real Cosphi=1 "Cos(phi) of the electrical grid";
+  parameter Real Xpth=0.03 "Thermal loss fraction - cooling (0-1 sur Q.PCI)";
+  parameter Real Xref=0.2 "Cooling power fraction (0-1 sur Q.PCI)";
+  parameter Real MMg=30 "Gas average molar mass (g/mol)";
+  parameter Real DPe=0
+    "Water pressure loss as percent of the pressure at the inlet";
+  parameter ThermoSysPro.Units.SI.PressureDifference DPaf=0
+    "Pressure difference between the air pressure at the inlet and the flue gases pressure at the outlet";
+  parameter Real RV=6 "Engine volume ratio (> 1)";
+  parameter Real Kc=1.2 "Compression polytropic coefficient";
+  parameter Real Kd=1.4 "Expansion polytropic coefficient";
+  parameter Real Gamma=1.3333 "Flue gases gamma = Cp/Cv";
+
+protected
+  constant Real amC=12.01115 "Carbon atomic mass";
+  constant Real amH=1.00797 "Hydrogen atomic mass";
+  constant Real amO=15.9994 "Oxygen atomic mass";
+  constant Real amS=32.064 "Sulfur atomic mass";
+  constant Real amCO2=amC+2*amO "CO2 molecular mass";
+  constant Real amH2O=2*amH+amO "H2O molecular mass";
+  constant Real amSO2=amS+2*amO "SO2 molecular mass";
+
+public
+  Units.SI.MassFlowRate Qsf(start=400)
+    "Flue gases mass flow rate at the outlet";
+  Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet";
+  Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet";
+  Real XsfCO2(start=0.5) "Flue gases CO2 mass fraction at the outlet";
+  Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet";
+  Real XsfO2(start=0) "Flue gases O2 mass fraction at the outlet";
+  Real XsfSO2(start=0) "Flue gases SO2 mass fraction at the outlet";
+  Real Rmeca(start=0.3) "Engine mechanical efficiency";
+  Units.SI.Power Wmeca(start=5e8) "Engine mechanical power";
+  Units.SI.Power Welec(start=5e8) "Engine electrical power";
+  Units.SI.Power Wact(start=5e8) "Active power";
+  Units.SI.Power Wcomb(start=5e8) "Fuel power available (Q.PCS)";
+  Units.SI.Power Wpth_ref(start=1e6) "Power of thermal losses + cooling";
+  Real exc(start=1) "Combustion air ratio";
+  Real PCScomb "Pouvoir Calorifique Supérieur du combustible sur brut(en J/kg)";
+  Units.SI.Temperature Tm(start=500) "Air-gas mixture temperature";
+  Units.SI.Temperature Tfcp(start=500)
+    "Temperature at the end of the compression phase";
+  Units.SI.AbsolutePressure Pfcp(start=12e5)
+    "Pressure at the end of the compression phase";
+  Units.SI.Temperature Tfcb(start=500)
+    "Temperature at the end of the combustion phase";
+  Units.SI.AbsolutePressure Pfcb(start=12e5)
+    "Pressure at the end of the combustion phase";
+  Units.SI.Temperature Tfd(start=500)
+    "Temperature at the end of the expansion phase";
+  Units.SI.AbsolutePressure Pfd(start=12e5)
+    "Pressure at the end of the expansion phase";
+  Units.SI.Temperature Tfe(start=500) "Temperature at the exhaust";
+  Units.SI.SpecificEnthalpy Hea(start=50e3)
+    "Air specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hsf(start=50e4)
+    "Flue gases specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hcomb(start=10e3)
+    "Fuel specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hrfum(start=10e3)
+    "Flue gases reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy";
+  Units.SI.SpecificEnthalpy Hrcomb(start=10e3)
+    "Fuel reference specific enthalpy";
+  Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet";
+  Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet";
+  Units.SI.Temperature Tea(start=600) "Air temperature at the inlet";
+  Real XeaCO2(start=0) "Air CO2 mass fraction at the inlet";
+  Real XeaH2O(start=0.1) "Air H2O mass fraction at the inlet";
+  Real XeaO2(start=0.2) "Air O2 mass fraction at the inlet";
+  Real XeaSO2(start=0) "Air SO2 mass fraction at the inlet";
+  Units.SI.SpecificHeatCapacity Cpair(start=1000) "Air specific heat capacity";
+  Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate";
+  Units.SI.Temperature Tcomb(start=300) "Fuel temperature";
+  Real XCcomb(start=0.8) "Fuel carbon fraction";
+  Real XHcomb(start=0.2) "Fuel hydrogen fraction";
+  Real XOcomb(start=0) "Fuel oxygen fraction";
+  Real XScomb(start=0) "Fuel sulfur fraction";
+  Real XEAUcomb(start=0) "Fuel H2O fraction";
+  Real XCDcomb(start=0) "Fuel ashes fraction";
+  Real PCIcomb(start=5e7) "Fuel PCI (J/kg)";
+  Units.SI.SpecificHeatCapacity Cpcomb(start=1000)
+    "Fuel specific heat capacity";
+  Units.SI.MassFlowRate Qe(start=1) "Water mass flow rate";
+  Units.SI.SpecificEnthalpy Hev(start=10e3)
+    "Water specific enthalpy at the inlet";
+  Units.SI.Density rhoea(start=0.001) "Air density at the inlet";
+  Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet";
+  Units.SI.SpecificEnthalpy Hsv(start=10e3)
+    "Water specific enthalpy at the outlet";
+  Real MMairgaz(start=30) "Air/gas mixture molecular mass (g/mol)";
+  Real MMfumees(start=30) "Flue gases molecular mass (g/mol)";
+
+public
+  ThermoSysPro.Combustion.Connectors.FuelInlet Cfuel
+    annotation (Placement(transformation(extent={{-50,-100},{-30,-80}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cair
+    annotation (Placement(transformation(extent={{30,-100},{50,-80}}, rotation=
+            0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cfg
+    annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cws1
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cws2
+    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+equation
+
+  /* Air inlet */
+  Qea = Cair.Q;
+  Pea = Cair.P;
+  Tea = Cair.T;
+  XeaCO2 = Cair.Xco2;
+  XeaH2O = Cair.Xh2o;
+  XeaO2 = Cair.Xo2;
+  XeaSO2 = Cair.Xso2;
+
+  /* Fuel inlet */
+  Qcomb = Cfuel.Q;
+  Tcomb = Cfuel.T;
+  XCcomb = Cfuel.Xc;
+  XHcomb = Cfuel.Xh;
+  XOcomb = Cfuel.Xo;
+  XScomb = Cfuel.Xs;
+  XEAUcomb = Cfuel.hum;
+  XCDcomb = Cfuel.Xashes;
+  PCIcomb = Cfuel.LHV;
+  Cpcomb = Cfuel.cp;
+
+  /* Water/steam inlet */
+  Qe = Cws1.Q;
+  Hev = Cws1.h;
+
+  /* Water/steam outlet */
+  Cws2.Q = Cws1.Q;
+  Hsv = Cws2.h;
+
+  /* Flue gases outlet */
+  Qsf = Cfg.Q;
+  Psf = Cfg.P;
+  Tsf = Cfg.T;
+  XsfCO2 = Cfg.Xco2;
+  XsfH2O = Cfg.Xh2o;
+  XsfO2 = Cfg.Xo2;
+  XsfSO2 = Cfg.Xso2;
+
+  /* Flow reversal */
+  0 = if (Qe > 0) then Cws1.h - Cws1.h_vol else Cws2.h - Cws2.h_vol;
+
+  /* Mass balance equation for the flue gases */
+  Qsf = Qea + Qcomb;
+
+  /* CO2 flue gases composition */
+  XsfCO2*Qsf = Qea*XeaCO2 + Qcomb*XCcomb*amCO2/amC;
+
+  /* H2O flue gases composition */
+  XsfH2O*Qsf = Qea*XeaH2O + Qcomb*XHcomb*(amH2O/2)/amH;
+
+  /* O2 flue gases composition */
+  XsfO2*Qsf = Qea*XeaO2 - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb;
+
+  /* SO2 flue gases composition */
+  XsfSO2*Qsf = Qea*XeaSO2 + Qcomb*XScomb*amSO2/amS;
+
+  /* Fuel thermal power available */
+  PCScomb = PCIcomb + 224.3e5*XHcomb + 25.1e5*XEAUcomb;
+  Wcomb = Qcomb*PCIcomb;
+
+  /* Thermal losses */
+  Wpth_ref = Qcomb*PCIcomb*(Xpth + Xref);
+  Qe*(Hsv - Hev) = Qcomb*PCIcomb*Xref;
+
+  /* Air thermodynamic properties at the inlet */
+  Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+  Cpair = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+  rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2);
+
+  /* Flue gases thermodynamic properties at the outlet */
+  Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+  rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2);
+
+  //---------------------
+  //  BEAU DE ROCHAS CYCLE
+
+  /* (1) Air and gas mixing at constant pressure Pea */
+  Tm = (Qcomb*Cpcomb*Tcomb + Qea*Cpair*Tea)/(Qcomb*Cpcomb + Qea*Cpair);
+
+  /* (2) Polytropic compression */
+  Tfcp = Tm*RV^(Kc - 1);
+  Pfcp = Pea*RV^Kc;
+
+  /* (3) Constant volume combustion (point mort haut) */
+  MMairgaz = (Qea*28.9 + Qcomb*MMg)/(Qea + Qcomb);
+  MMfumees = (1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2)*28 + XsfCO2*44 + XsfH2O*18 + XsfO2*32 + XsfSO2*64;
+  Pfcb = Pfcp*Tfcb/Tfcp*MMairgaz/MMfumees;
+  //Tfcb = (Wcomb - Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/0.75/Qsf + Tfcp;
+  Tfcb = Wcomb/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/Qsf + Tfcp;
+
+  /* (4) Polytropic expansion */
+  Tfd = Tfcb *(1/RV)^(Kd - 1);
+  Pfd = Pfcb *(1/RV)^Kd;
+
+  /* (5) Echappement */
+  Tfe = Tfd*(Psf/Pfd)^((Gamma - 1)/Gamma);
+
+  //---------------------
+
+  /* Efficiency and mechanical power */
+  if (mechanical_efficiency_type == 1) then
+    Rmeca = Rmeca_nom;
+  elseif (mechanical_efficiency_type == 2) then
+    Rmeca = Coef_Rm_a * Wcomb/1000*Wcomb/1000 + Coef_Rm_b*Wcomb/1000 + Coef_Rm_c;
+  else
+    Rmeca = ((Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair))
+            -(Qsf*(ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfe, XsfCO2, XsfH2O, XsfO2, XsfSO2)
+            -Hrfum) + Wpth_ref))/Wcomb;
+  end if;
+
+  Wmeca = Rmeca*Wcomb;
+
+  /* Combustion air ratio */
+  exc = Qea*(1 - XeaH2O)/((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO))/(XeaO2/(1 - XeaH2O)));
+
+  /* Pressure losses */
+  Pea - Psf = DPaf;
+  Cws2.P = if (Qe > 0) then Cws1.P - DPe*Cws1.P/100 else Cws1.P + DPe*Cws1.P/100;
+
+  /* Energy balance equation for the flue gases */
+  (Qsf*(Hsf - Hrfum) + Wpth_ref + Wmeca) - (Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair)) = 0;
+
+  Hcomb = Cpcomb*(Tcomb - 273.15);
+
+  /* Electrical power produced and active power*/
+  Welec = Wmeca*Relec;
+  Wact = Welec*Cosphi;
+
+  /* Reference specific enthalpies */
+  Hrair = 2501.569e3*XeaH2O;
+  Hrcomb = 0;
+  Hrfum = 2501.569e3*XsfH2O;
+
+    annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{
+              -10,-76},{-2,-66},{-10,-64}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{
+              48,-42},{-46,-42}},
+          lineColor={0,0,0},
+          fillColor={170,255,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{
+              46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid)}),
+                             Icon(graphics={
+        Rectangle(
+          extent={{-80,80},{80,-80}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{
+              -10,-76},{-2,-66},{-10,-64}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{
+              48,-42},{-46,-42}},
+          lineColor={0,0,0},
+          fillColor={170,255,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{
+              46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Chapter 15 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>"));
+end AlternatingEngine;
diff --git a/ThermoSysPro/MultiFluids/Machines/CHPEngineBarkantineSystem.mo b/ThermoSysPro/MultiFluids/Machines/CHPEngineBarkantineSystem.mo
index 36999ba43d1da287eb06dd836833149d11ae6edd..e36bcc2cbd38bb47d0638429d0c81fbb09aae28f 100644
--- a/ThermoSysPro/MultiFluids/Machines/CHPEngineBarkantineSystem.mo
+++ b/ThermoSysPro/MultiFluids/Machines/CHPEngineBarkantineSystem.mo
@@ -1,266 +1,266 @@
-within ThermoSysPro.MultiFluids.Machines;
-model CHPEngineBarkantineSystem
-  parameter Units.SI.Temperature Tair=300 "Temperature inlet air";
-  parameter Real RechFumEff=0.73 "Flue gases heater efficiency";
-  parameter Real RechWaterEff=0.9 "Water heater efficiency";
-  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
-                                                         annotation(choices(
-    choice=1 "Fixed nominal efficiency",
-    choice=2 "Efficiency computed using a linear function Coef_Rm",
-    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
-  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency";
-
-  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
-    Hum=0,
-    Xh=0.25,
-    Xs=0,
-    Xashes=0,
-    Vol=100,
-    Xc=0.75,
-    Xo=0,
-    Xn=0,
-    T0=299,
-    P0=2.25e5,
-    rho=0.72,
-    LHV=48e6,
-    Q0=0.0727958)
-             annotation (Placement(transformation(extent={{62,-26},{38,-2}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_water(
-    P0=3e5,
-    h0=293e3,
-    Q0=11.8)
-          annotation (Placement(transformation(extent={{62,-46},{40,-24}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.Machines.AlternatingEngine Engine(
-    DPe=1,
-    MMg=20,
-    Kd=1.33,
-    Wcomb(fixed=false, start=3.4942e6),
-    exc(fixed=false, start=1.8),
-    RV=6.45,
-    Kc=1.28,
-    Xpth=0.01,
-    Xref=0.2896,
-    Tsf(fixed=false, start=815),
-    Wmeca(fixed=false, start=1400e3),
-    mechanical_efficiency_type=mechanical_efficiency_type,
-    Rmeca_nom=Rmeca_nom) annotation (Placement(transformation(
-        origin={0,0},
-        extent={{-24,-24},{24,24}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
-    ExchangerWaterWater(
-    EffEch=RechWaterEff, exchanger_type=3)
-               annotation (Placement(transformation(
-        origin={0,-66},
-        extent={{14,-14},{-14,14}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC1(L=0.0001)
-    annotation (Placement(transformation(
-        origin={-60,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink M1_puits_eau
-    annotation (Placement(transformation(extent={{-20,-72},{-42,-48}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC2(L=0.0001)
-    annotation (Placement(transformation(
-        origin={-80,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
-    ExchangerWaterFlueGases(Tsf(fixed=false, start=363), EffEch=RechFumEff)
-             annotation (Placement(transformation(
-        origin={0,70},
-        extent={{-14,-14},{14,14}},
-        rotation=90)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss silencieux(
-                                                                   K=20)
-           annotation (Placement(transformation(
-        origin={-39,16},
-        extent={{10,-9},{-10,9}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
-    annotation (Placement(transformation(extent={{180,80},{220,120}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
-    annotation (Placement(transformation(extent={{-220,80},{-180,120}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkG M_puits_fumees
-    annotation (Placement(transformation(extent={{58,58},{82,82}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
-                                       k=1e5)
-    annotation (Placement(transformation(extent={{120,60},{100,80}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceG M_Air(
-    Xco2=0,
-    Xh2o=0.005,
-    Xo2=0.23,
-    Xso2=0) annotation (Placement(transformation(extent={{64,2},{40,26}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Temperature(
-                                          k=Tair)
-    annotation (Placement(transformation(extent={{100,-10},{80,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante DebitAir(
-                                       k=50)
-    annotation (Placement(transformation(extent={{20,30},{40,50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_eau(
-                                   k=11.8)
-                      annotation (Placement(transformation(extent={{96,-34},{80,
-            -18}}, rotation=0)));
-equation
-  connect(ExchangerWaterWater.Ef, inletWaterSteamI)
-    annotation (Line(points={{-9.19104e-016,-80},{0,-80},{0,-100},{-140,-100},{
-          -140,100},{-200,100}}));
-  connect(M1_puits_eau.C, ExchangerWaterWater.Sc)
-    annotation (Line(points={{-20,-60},{-13.04,-60},{-13.04,-60.4},{5.74,-60.4}}));
-  connect(PDC2.C1, ExchangerWaterWater.Sf)
-    annotation (Line(points={{-80,-20},{-80,-40},{0.14,-40},{0.14,-52}}));
-  connect(PDC1.C2, ExchangerWaterWater.Ec)
-                                   annotation (Line(points={{-60,-20},{-60,
-          -71.6},{5.74,-71.6}},  color={0,0,255}));
-  connect(Pression.y, M_puits_fumees.IPressure)
-    annotation (Line(points={{99,70},{76,70}}));
-  connect(DebitAir.y, M_Air.IMassFlow)
-    annotation (Line(points={{41,40},{52,40},{52,20}}));
-  connect(M_Air.ITemperature, Temperature.y)
-    annotation (Line(points={{52,8},{52,0},{79,0}}));
-  connect(Source_water.IMassFlow, Debit_eau.y)
-    annotation (Line(points={{51,-29.5},{51,-26},{79.2,-26}}));
-  connect(silencieux.C2, ExchangerWaterFlueGases.Cfg1) annotation (Line(
-      points={{-39,26},{-39,70},{-12.6,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerWaterFlueGases.Cfg2, M_puits_fumees.C) annotation (Line(
-      points={{12.6,69.93},{35.3,69.93},{35.3,70},{58.24,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerWaterFlueGases.Cws2, outletWaterSteamI) annotation (Line(
-        points={{-7.95401e-016,84},{0,84},{0,100},{200,100}}, color={0,0,255}));
-  connect(PDC2.C2, ExchangerWaterFlueGases.Cws1) annotation (Line(points={{-80,
-          0},{-80,48},{4.34812e-015,48},{4.34812e-015,56}}, color={0,0,255}));
-  connect(silencieux.C1, Engine.Cfg) annotation (Line(
-      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(Engine.Cws1, Source_water.C)
-    annotation (Line(points={{-1.32262e-015,-21.6},{-1.32262e-015,-35},{40,-35}}));
-  connect(Engine.Cair, M_Air.C) annotation (Line(
-      points={{21.6,9.6},{32,9.6},{32,14},{40,14}},
-      color={0,0,0},
-      thickness=1));
-  connect(PDC1.C1, Engine.Cws2)
-    annotation (Line(points={{-60,0},{-60,32},{1.32262e-015,32},{1.32262e-015,
-          21.6}}));
-  connect(Engine.Cfuel, Fuel.C) annotation (Line(points={{21.6,-9.6},{32,-9.6},
-          {32,-14},{38,-14}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics),
-                          Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-200,200},{200,-200}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Dash,
-          lineThickness=0.5),
-        Rectangle(
-          extent={{-180,0},{-20,-160}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-110,-144},{-96,-126},{-100,-136},{-82,-134},{-98,-140},{-78,
-              -146},{-94,-144},{-110,-156},{-102,-146},{-110,-144}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-146,-122},{-146,-80},{-106,-80},{-106,-22},{-100,-30},{-94,
-              -22},{-94,-80},{-52,-80},{-52,-122},{-146,-122}},
-          lineColor={0,0,0},
-          fillColor={170,255,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-180,-50},{-134,-50},{-134,-26},{-62,-26},{-62,-50},{-20,-50},
-              {-20,-42},{-54,-42},{-54,-18},{-142,-18},{-142,-42},{-180,-42},{
-              -180,-50}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{20,142},{180,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{50,144},{146,76}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Rectangle(
-          extent={{-180,142},{-20,40}},
-          lineColor={0,0,255},
-          fillColor={72,143,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-160,40},{-160,118},{-100,74},{-100,74},{-100,74}},
-          color={255,0,0},
-          thickness=1),
-        Text(
-          extent={{-148,148},{-52,80}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Line(
-          points={{38,40},{38,118},{98,74},{158,122},{158,40}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-20,100},{20,100}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{-160,0},{-160,40}},
-          color={255,0,0},
-          thickness=1),
-        Line(
-          points={{-40,0},{-40,40}},
-          color={0,0,255},
-          thickness=1),
-        Polygon(
-          points={{-20,-50},{26,-50},{26,-50},{38,-50},{38,-50},{44,-50},{44,40},
-              {36,40},{36,-42},{18,-42},{18,-42},{-20,-42},{-20,-50}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,40},{-40,118},{-100,74},{-100,74},{-100,74}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{40,40},{40,118},{100,74},{160,122},{160,40}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{42,40},{42,118},{102,74},{162,122},{162,40}},
-          color={0,0,0},
-          thickness=1)}),
-    DymolaStoredErrors,
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Guillaume Larrignon</li>
-<li>Bruno P&eacute;chin&eacute; </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end CHPEngineBarkantineSystem;
+within ThermoSysPro.MultiFluids.Machines;
+model CHPEngineBarkantineSystem
+  parameter Units.SI.Temperature Tair=300 "Temperature inlet air";
+  parameter Real RechFumEff=0.73 "Flue gases heater efficiency";
+  parameter Real RechWaterEff=0.9 "Water heater efficiency";
+  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
+                                                         annotation(choices(
+    choice=1 "Fixed nominal efficiency",
+    choice=2 "Efficiency computed using a linear function Coef_Rm",
+    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
+  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency";
+
+  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
+    Hum=0,
+    Xh=0.25,
+    Xs=0,
+    Xashes=0,
+    Vol=100,
+    Xc=0.75,
+    Xo=0,
+    Xn=0,
+    T0=299,
+    P0=2.25e5,
+    rho=0.72,
+    LHV=48e6,
+    Q0=0.0727958)
+             annotation (Placement(transformation(extent={{62,-26},{38,-2}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_water(
+    P0=3e5,
+    h0=293e3,
+    Q0=11.8)
+          annotation (Placement(transformation(extent={{62,-46},{40,-24}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.Machines.AlternatingEngine Engine(
+    DPe=1,
+    MMg=20,
+    Kd=1.33,
+    Wcomb(fixed=false, start=3.4942e6),
+    exc(fixed=false, start=1.8),
+    RV=6.45,
+    Kc=1.28,
+    Xpth=0.01,
+    Xref=0.2896,
+    Tsf(fixed=false, start=815),
+    Wmeca(fixed=false, start=1400e3),
+    mechanical_efficiency_type=mechanical_efficiency_type,
+    Rmeca_nom=Rmeca_nom) annotation (Placement(transformation(
+        origin={0,0},
+        extent={{-24,-24},{24,24}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
+    ExchangerWaterWater(
+    EffEch=RechWaterEff, exchanger_type=3)
+               annotation (Placement(transformation(
+        origin={0,-66},
+        extent={{14,-14},{-14,14}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC1(L=0.0001)
+    annotation (Placement(transformation(
+        origin={-60,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink M1_puits_eau
+    annotation (Placement(transformation(extent={{-20,-72},{-42,-48}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC2(L=0.0001)
+    annotation (Placement(transformation(
+        origin={-80,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
+    ExchangerWaterFlueGases(Tsf(fixed=false, start=363), EffEch=RechFumEff)
+             annotation (Placement(transformation(
+        origin={0,70},
+        extent={{-14,-14},{14,14}},
+        rotation=90)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss silencieux(
+                                                                   K=20)
+           annotation (Placement(transformation(
+        origin={-39,16},
+        extent={{10,-9},{-10,9}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
+    annotation (Placement(transformation(extent={{180,80},{220,120}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
+    annotation (Placement(transformation(extent={{-220,80},{-180,120}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkG M_puits_fumees
+    annotation (Placement(transformation(extent={{58,58},{82,82}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
+                                       k=1e5)
+    annotation (Placement(transformation(extent={{120,60},{100,80}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceG M_Air(
+    Xco2=0,
+    Xh2o=0.005,
+    Xo2=0.23,
+    Xso2=0) annotation (Placement(transformation(extent={{64,2},{40,26}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Temperature(
+                                          k=Tair)
+    annotation (Placement(transformation(extent={{100,-10},{80,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante DebitAir(
+                                       k=50)
+    annotation (Placement(transformation(extent={{20,30},{40,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_eau(
+                                   k=11.8)
+                      annotation (Placement(transformation(extent={{96,-34},{80,
+            -18}}, rotation=0)));
+equation
+  connect(ExchangerWaterWater.Ef, inletWaterSteamI)
+    annotation (Line(points={{-9.19104e-016,-80},{0,-80},{0,-100},{-140,-100},{
+          -140,100},{-200,100}}));
+  connect(M1_puits_eau.C, ExchangerWaterWater.Sc)
+    annotation (Line(points={{-20,-60},{-13.04,-60},{-13.04,-60.4},{5.74,-60.4}}));
+  connect(PDC2.C1, ExchangerWaterWater.Sf)
+    annotation (Line(points={{-80,-20},{-80,-40},{0.14,-40},{0.14,-52}}));
+  connect(PDC1.C2, ExchangerWaterWater.Ec)
+                                   annotation (Line(points={{-60,-20},{-60,
+          -71.6},{5.74,-71.6}},  color={0,0,255}));
+  connect(Pression.y, M_puits_fumees.IPressure)
+    annotation (Line(points={{99,70},{76,70}}));
+  connect(DebitAir.y, M_Air.IMassFlow)
+    annotation (Line(points={{41,40},{52,40},{52,20}}));
+  connect(M_Air.ITemperature, Temperature.y)
+    annotation (Line(points={{52,8},{52,0},{79,0}}));
+  connect(Source_water.IMassFlow, Debit_eau.y)
+    annotation (Line(points={{51,-29.5},{51,-26},{79.2,-26}}));
+  connect(silencieux.C2, ExchangerWaterFlueGases.Cfg1) annotation (Line(
+      points={{-39,26},{-39,70},{-12.6,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerWaterFlueGases.Cfg2, M_puits_fumees.C) annotation (Line(
+      points={{12.6,69.93},{35.3,69.93},{35.3,70},{58.24,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerWaterFlueGases.Cws2, outletWaterSteamI) annotation (Line(
+        points={{-7.95401e-016,84},{0,84},{0,100},{200,100}}, color={0,0,255}));
+  connect(PDC2.C2, ExchangerWaterFlueGases.Cws1) annotation (Line(points={{-80,
+          0},{-80,48},{4.34812e-015,48},{4.34812e-015,56}}, color={0,0,255}));
+  connect(silencieux.C1, Engine.Cfg) annotation (Line(
+      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(Engine.Cws1, Source_water.C)
+    annotation (Line(points={{-1.32262e-015,-21.6},{-1.32262e-015,-35},{40,-35}}));
+  connect(Engine.Cair, M_Air.C) annotation (Line(
+      points={{21.6,9.6},{32,9.6},{32,14},{40,14}},
+      color={0,0,0},
+      thickness=1));
+  connect(PDC1.C1, Engine.Cws2)
+    annotation (Line(points={{-60,0},{-60,32},{1.32262e-015,32},{1.32262e-015,
+          21.6}}));
+  connect(Engine.Cfuel, Fuel.C) annotation (Line(points={{21.6,-9.6},{32,-9.6},
+          {32,-14},{38,-14}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics),
+                          Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-200,200},{200,-200}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Dash,
+          lineThickness=0.5),
+        Rectangle(
+          extent={{-180,0},{-20,-160}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-110,-144},{-96,-126},{-100,-136},{-82,-134},{-98,-140},{-78,
+              -146},{-94,-144},{-110,-156},{-102,-146},{-110,-144}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-146,-122},{-146,-80},{-106,-80},{-106,-22},{-100,-30},{-94,
+              -22},{-94,-80},{-52,-80},{-52,-122},{-146,-122}},
+          lineColor={0,0,0},
+          fillColor={170,255,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-180,-50},{-134,-50},{-134,-26},{-62,-26},{-62,-50},{-20,-50},
+              {-20,-42},{-54,-42},{-54,-18},{-142,-18},{-142,-42},{-180,-42},{
+              -180,-50}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{20,142},{180,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{50,144},{146,76}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Rectangle(
+          extent={{-180,142},{-20,40}},
+          lineColor={0,0,255},
+          fillColor={72,143,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-160,40},{-160,118},{-100,74},{-100,74},{-100,74}},
+          color={255,0,0},
+          thickness=1),
+        Text(
+          extent={{-148,148},{-52,80}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Line(
+          points={{38,40},{38,118},{98,74},{158,122},{158,40}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-20,100},{20,100}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{-160,0},{-160,40}},
+          color={255,0,0},
+          thickness=1),
+        Line(
+          points={{-40,0},{-40,40}},
+          color={0,0,255},
+          thickness=1),
+        Polygon(
+          points={{-20,-50},{26,-50},{26,-50},{38,-50},{38,-50},{44,-50},{44,40},
+              {36,40},{36,-42},{18,-42},{18,-42},{-20,-42},{-20,-50}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,40},{-40,118},{-100,74},{-100,74},{-100,74}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{40,40},{40,118},{100,74},{160,122},{160,40}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{42,40},{42,118},{102,74},{162,122},{162,40}},
+          color={0,0,0},
+          thickness=1)}),
+    DymolaStoredErrors,
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Guillaume Larrignon</li>
+<li>Bruno P&eacute;chin&eacute; </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end CHPEngineBarkantineSystem;
diff --git a/ThermoSysPro/MultiFluids/Machines/CHPEngineBarkantineSystem_NewQair.mo b/ThermoSysPro/MultiFluids/Machines/CHPEngineBarkantineSystem_NewQair.mo
index 421af353c8ec1533ef9c8fd176c1596106baf822..8a36230dd574baafd17e4352f6e9b35a0b332eb3 100644
--- a/ThermoSysPro/MultiFluids/Machines/CHPEngineBarkantineSystem_NewQair.mo
+++ b/ThermoSysPro/MultiFluids/Machines/CHPEngineBarkantineSystem_NewQair.mo
@@ -1,265 +1,265 @@
-within ThermoSysPro.MultiFluids.Machines;
-model CHPEngineBarkantineSystem_NewQair
-  parameter Units.SI.Temperature Tair=300 "Temperature inlet air";
-  parameter Real RechFumEff=0.73 "Flue gases heater efficiency";
-  parameter Real RechWaterEff=0.9 "Water heater efficiency";
-  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
-                                                         annotation(choices(
-    choice=1 "Fixed nominal efficiency",
-    choice=2 "Efficiency computed using a linear function Coef_Rm",
-    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
-  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency";
-
-  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
-    Hum=0,
-    Xh=0.25,
-    Xs=0,
-    Xashes=0,
-    Vol=100,
-    Xc=0.75,
-    Xo=0,
-    Xn=0,
-    T0=299,
-    P0=2.25e5,
-    rho=0.72,
-    LHV=48e6,
-    Q0=0.0727958)
-             annotation (Placement(transformation(extent={{62,-26},{38,-2}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_water(
-    P0=3e5,
-    h0=293e3,
-    Q0=11.8)
-          annotation (Placement(transformation(extent={{62,-46},{40,-24}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.Machines.AlternatingEngine Engine(
-    DPe=1,
-    MMg=20,
-    Kd=1.33,
-    Wcomb(fixed=false, start=3.4942e6),
-    exc(fixed=false, start=1.8),
-    RV=6.45,
-    Kc=1.28,
-    Xpth=0.01,
-    Xref=0.2896,
-    Tsf(fixed=false, start=815),
-    Wmeca(fixed=false, start=1400e3),
-    mechanical_efficiency_type=mechanical_efficiency_type,
-    Rmeca_nom=Rmeca_nom) annotation (Placement(transformation(
-        origin={0,0},
-        extent={{-24,-24},{24,24}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
-    ExchangerWaterWater(
-    EffEch=RechWaterEff, exchanger_type=3)
-               annotation (Placement(transformation(
-        origin={0,-66},
-        extent={{14,-14},{-14,14}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC1(L=0.0001)
-    annotation (Placement(transformation(
-        origin={-60,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink M1_puits_eau
-    annotation (Placement(transformation(extent={{-20,-72},{-42,-48}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC2(L=0.0001)
-    annotation (Placement(transformation(
-        origin={-80,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
-    ExchangerWaterFlueGases(Tsf(fixed=false, start=363), EffEch=RechFumEff)
-             annotation (Placement(transformation(
-        origin={0,70},
-        extent={{-14,-14},{14,14}},
-        rotation=90)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss silencieux(
-                                                                   K=20)
-           annotation (Placement(transformation(
-        origin={-39,16},
-        extent={{10,-9},{-10,9}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
-    annotation (Placement(transformation(extent={{180,80},{220,120}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
-    annotation (Placement(transformation(extent={{-220,80},{-180,120}},
-          rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkG M_puits_fumees
-    annotation (Placement(transformation(extent={{58,58},{82,82}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
-                                       k=1e5)
-    annotation (Placement(transformation(extent={{120,60},{100,80}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceG M_Air(
-    Xco2=0,
-    Xh2o=0.005,
-    Xo2=0.23,
-    Xso2=0) annotation (Placement(transformation(extent={{64,2},{40,26}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Temperature(
-                                          k=Tair)
-    annotation (Placement(transformation(extent={{100,-10},{80,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante DebitAir(k=3)
-    annotation (Placement(transformation(extent={{22,30},{42,50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_eau(
-                                   k=11.8)
-                      annotation (Placement(transformation(extent={{96,-34},{80,
-            -18}}, rotation=0)));
-equation
-  connect(ExchangerWaterWater.Ef, inletWaterSteamI)
-    annotation (Line(points={{-9.19104e-016,-80},{0,-80},{0,-100},{-140,-100},{
-          -140,100},{-200,100}}));
-  connect(M1_puits_eau.C, ExchangerWaterWater.Sc)
-    annotation (Line(points={{-20,-60},{-13.04,-60},{-13.04,-60.4},{5.74,-60.4}}));
-  connect(PDC2.C1, ExchangerWaterWater.Sf)
-    annotation (Line(points={{-80,-20},{-80,-40},{0.14,-40},{0.14,-52}}));
-  connect(PDC1.C2, ExchangerWaterWater.Ec)
-                                   annotation (Line(points={{-60,-20},{-60,
-          -71.6},{5.74,-71.6}},  color={0,0,255}));
-  connect(Pression.y, M_puits_fumees.IPressure)
-    annotation (Line(points={{99,70},{76,70}}));
-  connect(DebitAir.y, M_Air.IMassFlow)
-    annotation (Line(points={{43,40},{52,40},{52,20}}));
-  connect(M_Air.ITemperature, Temperature.y)
-    annotation (Line(points={{52,8},{52,0},{79,0}}));
-  connect(Source_water.IMassFlow, Debit_eau.y)
-    annotation (Line(points={{51,-29.5},{51,-26},{79.2,-26}}));
-  connect(silencieux.C2, ExchangerWaterFlueGases.Cfg1) annotation (Line(
-      points={{-39,26},{-39,70},{-12.6,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerWaterFlueGases.Cfg2, M_puits_fumees.C) annotation (Line(
-      points={{12.6,69.93},{35.3,69.93},{35.3,70},{58.24,70}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerWaterFlueGases.Cws2, outletWaterSteamI) annotation (Line(
-        points={{-7.95401e-016,84},{0,84},{0,100},{200,100}}, color={0,0,255}));
-  connect(PDC2.C2, ExchangerWaterFlueGases.Cws1) annotation (Line(points={{-80,
-          0},{-80,48},{4.34812e-015,48},{4.34812e-015,56}}, color={0,0,255}));
-  connect(silencieux.C1, Engine.Cfg) annotation (Line(
-      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(Engine.Cws1, Source_water.C)
-    annotation (Line(points={{-1.32262e-015,-21.6},{-1.32262e-015,-35},{40,-35}}));
-  connect(Engine.Cair, M_Air.C) annotation (Line(
-      points={{21.6,9.6},{32,9.6},{32,14},{40,14}},
-      color={0,0,0},
-      thickness=1));
-  connect(PDC1.C1, Engine.Cws2)
-    annotation (Line(points={{-60,0},{-60,32},{1.32262e-015,32},{1.32262e-015,
-          21.6}}));
-  connect(Engine.Cfuel, Fuel.C) annotation (Line(points={{21.6,-9.6},{32,-9.6},
-          {32,-14},{38,-14}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics),
-                          Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-200,200},{200,-200}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Dash,
-          lineThickness=0.5),
-        Rectangle(
-          extent={{-180,0},{-20,-160}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-110,-144},{-96,-126},{-100,-136},{-82,-134},{-98,-140},{-78,
-              -146},{-94,-144},{-110,-156},{-102,-146},{-110,-144}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-146,-122},{-146,-80},{-106,-80},{-106,-22},{-100,-30},{-94,
-              -22},{-94,-80},{-52,-80},{-52,-122},{-146,-122}},
-          lineColor={0,0,0},
-          fillColor={170,255,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-180,-50},{-134,-50},{-134,-26},{-62,-26},{-62,-50},{-20,-50},
-              {-20,-42},{-54,-42},{-54,-18},{-142,-18},{-142,-42},{-180,-42},{
-              -180,-50}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{20,142},{180,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{50,144},{146,76}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Rectangle(
-          extent={{-180,142},{-20,40}},
-          lineColor={0,0,255},
-          fillColor={72,143,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-160,40},{-160,118},{-100,74},{-100,74},{-100,74}},
-          color={255,0,0},
-          thickness=1),
-        Text(
-          extent={{-148,148},{-52,80}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Line(
-          points={{38,40},{38,118},{98,74},{158,122},{158,40}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-20,100},{20,100}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{-160,0},{-160,40}},
-          color={255,0,0},
-          thickness=1),
-        Line(
-          points={{-40,0},{-40,40}},
-          color={0,0,255},
-          thickness=1),
-        Polygon(
-          points={{-20,-50},{26,-50},{26,-50},{38,-50},{38,-50},{44,-50},{44,40},
-              {36,40},{36,-42},{18,-42},{18,-42},{-20,-42},{-20,-50}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,40},{-40,118},{-100,74},{-100,74},{-100,74}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{40,40},{40,118},{100,74},{160,122},{160,40}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{42,40},{42,118},{102,74},{162,122},{162,40}},
-          color={0,0,0},
-          thickness=1)}),
-    DymolaStoredErrors,
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Guillaume Larrignon</li>
-<li>Bruno P&eacute;chin&eacute; </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end CHPEngineBarkantineSystem_NewQair;
+within ThermoSysPro.MultiFluids.Machines;
+model CHPEngineBarkantineSystem_NewQair
+  parameter Units.SI.Temperature Tair=300 "Temperature inlet air";
+  parameter Real RechFumEff=0.73 "Flue gases heater efficiency";
+  parameter Real RechWaterEff=0.9 "Water heater efficiency";
+  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
+                                                         annotation(choices(
+    choice=1 "Fixed nominal efficiency",
+    choice=2 "Efficiency computed using a linear function Coef_Rm",
+    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
+  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency";
+
+  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
+    Hum=0,
+    Xh=0.25,
+    Xs=0,
+    Xashes=0,
+    Vol=100,
+    Xc=0.75,
+    Xo=0,
+    Xn=0,
+    T0=299,
+    P0=2.25e5,
+    rho=0.72,
+    LHV=48e6,
+    Q0=0.0727958)
+             annotation (Placement(transformation(extent={{62,-26},{38,-2}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_water(
+    P0=3e5,
+    h0=293e3,
+    Q0=11.8)
+          annotation (Placement(transformation(extent={{62,-46},{40,-24}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.Machines.AlternatingEngine Engine(
+    DPe=1,
+    MMg=20,
+    Kd=1.33,
+    Wcomb(fixed=false, start=3.4942e6),
+    exc(fixed=false, start=1.8),
+    RV=6.45,
+    Kc=1.28,
+    Xpth=0.01,
+    Xref=0.2896,
+    Tsf(fixed=false, start=815),
+    Wmeca(fixed=false, start=1400e3),
+    mechanical_efficiency_type=mechanical_efficiency_type,
+    Rmeca_nom=Rmeca_nom) annotation (Placement(transformation(
+        origin={0,0},
+        extent={{-24,-24},{24,24}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
+    ExchangerWaterWater(
+    EffEch=RechWaterEff, exchanger_type=3)
+               annotation (Placement(transformation(
+        origin={0,-66},
+        extent={{14,-14},{-14,14}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC1(L=0.0001)
+    annotation (Placement(transformation(
+        origin={-60,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink M1_puits_eau
+    annotation (Placement(transformation(extent={{-20,-72},{-42,-48}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC2(L=0.0001)
+    annotation (Placement(transformation(
+        origin={-80,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
+    ExchangerWaterFlueGases(Tsf(fixed=false, start=363), EffEch=RechFumEff)
+             annotation (Placement(transformation(
+        origin={0,70},
+        extent={{-14,-14},{14,14}},
+        rotation=90)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss silencieux(
+                                                                   K=20)
+           annotation (Placement(transformation(
+        origin={-39,16},
+        extent={{10,-9},{-10,9}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
+    annotation (Placement(transformation(extent={{180,80},{220,120}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
+    annotation (Placement(transformation(extent={{-220,80},{-180,120}},
+          rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkG M_puits_fumees
+    annotation (Placement(transformation(extent={{58,58},{82,82}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
+                                       k=1e5)
+    annotation (Placement(transformation(extent={{120,60},{100,80}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceG M_Air(
+    Xco2=0,
+    Xh2o=0.005,
+    Xo2=0.23,
+    Xso2=0) annotation (Placement(transformation(extent={{64,2},{40,26}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Temperature(
+                                          k=Tair)
+    annotation (Placement(transformation(extent={{100,-10},{80,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante DebitAir(k=3)
+    annotation (Placement(transformation(extent={{22,30},{42,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_eau(
+                                   k=11.8)
+                      annotation (Placement(transformation(extent={{96,-34},{80,
+            -18}}, rotation=0)));
+equation
+  connect(ExchangerWaterWater.Ef, inletWaterSteamI)
+    annotation (Line(points={{-9.19104e-016,-80},{0,-80},{0,-100},{-140,-100},{
+          -140,100},{-200,100}}));
+  connect(M1_puits_eau.C, ExchangerWaterWater.Sc)
+    annotation (Line(points={{-20,-60},{-13.04,-60},{-13.04,-60.4},{5.74,-60.4}}));
+  connect(PDC2.C1, ExchangerWaterWater.Sf)
+    annotation (Line(points={{-80,-20},{-80,-40},{0.14,-40},{0.14,-52}}));
+  connect(PDC1.C2, ExchangerWaterWater.Ec)
+                                   annotation (Line(points={{-60,-20},{-60,
+          -71.6},{5.74,-71.6}},  color={0,0,255}));
+  connect(Pression.y, M_puits_fumees.IPressure)
+    annotation (Line(points={{99,70},{76,70}}));
+  connect(DebitAir.y, M_Air.IMassFlow)
+    annotation (Line(points={{43,40},{52,40},{52,20}}));
+  connect(M_Air.ITemperature, Temperature.y)
+    annotation (Line(points={{52,8},{52,0},{79,0}}));
+  connect(Source_water.IMassFlow, Debit_eau.y)
+    annotation (Line(points={{51,-29.5},{51,-26},{79.2,-26}}));
+  connect(silencieux.C2, ExchangerWaterFlueGases.Cfg1) annotation (Line(
+      points={{-39,26},{-39,70},{-12.6,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerWaterFlueGases.Cfg2, M_puits_fumees.C) annotation (Line(
+      points={{12.6,69.93},{35.3,69.93},{35.3,70},{58.24,70}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerWaterFlueGases.Cws2, outletWaterSteamI) annotation (Line(
+        points={{-7.95401e-016,84},{0,84},{0,100},{200,100}}, color={0,0,255}));
+  connect(PDC2.C2, ExchangerWaterFlueGases.Cws1) annotation (Line(points={{-80,
+          0},{-80,48},{4.34812e-015,48},{4.34812e-015,56}}, color={0,0,255}));
+  connect(silencieux.C1, Engine.Cfg) annotation (Line(
+      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(Engine.Cws1, Source_water.C)
+    annotation (Line(points={{-1.32262e-015,-21.6},{-1.32262e-015,-35},{40,-35}}));
+  connect(Engine.Cair, M_Air.C) annotation (Line(
+      points={{21.6,9.6},{32,9.6},{32,14},{40,14}},
+      color={0,0,0},
+      thickness=1));
+  connect(PDC1.C1, Engine.Cws2)
+    annotation (Line(points={{-60,0},{-60,32},{1.32262e-015,32},{1.32262e-015,
+          21.6}}));
+  connect(Engine.Cfuel, Fuel.C) annotation (Line(points={{21.6,-9.6},{32,-9.6},
+          {32,-14},{38,-14}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics),
+                          Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-200,200},{200,-200}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Dash,
+          lineThickness=0.5),
+        Rectangle(
+          extent={{-180,0},{-20,-160}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-110,-144},{-96,-126},{-100,-136},{-82,-134},{-98,-140},{-78,
+              -146},{-94,-144},{-110,-156},{-102,-146},{-110,-144}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-146,-122},{-146,-80},{-106,-80},{-106,-22},{-100,-30},{-94,
+              -22},{-94,-80},{-52,-80},{-52,-122},{-146,-122}},
+          lineColor={0,0,0},
+          fillColor={170,255,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-180,-50},{-134,-50},{-134,-26},{-62,-26},{-62,-50},{-20,-50},
+              {-20,-42},{-54,-42},{-54,-18},{-142,-18},{-142,-42},{-180,-42},{
+              -180,-50}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{20,142},{180,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{50,144},{146,76}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Rectangle(
+          extent={{-180,142},{-20,40}},
+          lineColor={0,0,255},
+          fillColor={72,143,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-160,40},{-160,118},{-100,74},{-100,74},{-100,74}},
+          color={255,0,0},
+          thickness=1),
+        Text(
+          extent={{-148,148},{-52,80}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Line(
+          points={{38,40},{38,118},{98,74},{158,122},{158,40}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-20,100},{20,100}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{-160,0},{-160,40}},
+          color={255,0,0},
+          thickness=1),
+        Line(
+          points={{-40,0},{-40,40}},
+          color={0,0,255},
+          thickness=1),
+        Polygon(
+          points={{-20,-50},{26,-50},{26,-50},{38,-50},{38,-50},{44,-50},{44,40},
+              {36,40},{36,-42},{18,-42},{18,-42},{-20,-42},{-20,-50}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,40},{-40,118},{-100,74},{-100,74},{-100,74}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{40,40},{40,118},{100,74},{160,122},{160,40}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{42,40},{42,118},{102,74},{162,122},{162,40}},
+          color={0,0,0},
+          thickness=1)}),
+    DymolaStoredErrors,
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Guillaume Larrignon</li>
+<li>Bruno P&eacute;chin&eacute; </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end CHPEngineBarkantineSystem_NewQair;
diff --git a/ThermoSysPro/MultiFluids/Machines/CHPEngineTriGenPredSystem.mo b/ThermoSysPro/MultiFluids/Machines/CHPEngineTriGenPredSystem.mo
index 28e20623b24b7ec1e9f06c32390193493f36a86b..48fd227336055eddc0a527ba2adfe72207406f4c 100644
--- a/ThermoSysPro/MultiFluids/Machines/CHPEngineTriGenPredSystem.mo
+++ b/ThermoSysPro/MultiFluids/Machines/CHPEngineTriGenPredSystem.mo
@@ -1,266 +1,266 @@
-within ThermoSysPro.MultiFluids.Machines;
-model CHPEngineTriGenPredSystem
-  parameter Units.SI.Temperature Tair=298 "Temperature inlet air";
-  parameter Real RechFumEff=0.717833 "Flue gases heater efficiency";
-  parameter Real RechWaterEff=0.837865 "Water heater efficiency";
-  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
-                                                         annotation(choices(
-    choice=1 "Fixed nominal efficiency",
-    choice=2 "Efficiency computed using a linear function Coef_Rm",
-    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
-  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency";
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_water(
-    P0=3e5,
-    Q0=12.2,
-    h0=205e3)
-          annotation (Placement(transformation(extent={{62,-42},{40,-20}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC1(L=0.0001)
-    annotation (Placement(transformation(
-        origin={-60,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Sink_water
-    annotation (Placement(transformation(extent={{-22,-72},{-44,-48}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC2(L=0.0001)
-    annotation (Placement(transformation(
-        origin={-80,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss silencieux(
-                                                                   K=20)
-           annotation (Placement(transformation(
-        origin={-39,16},
-        extent={{10,-9},{-10,9}},
-        rotation=270)));
-  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
-    rho=500,
-    Hum=0,
-    Xh=0.25,
-    Xs=0,
-    Xashes=0,
-    Vol=100,
-    T0=298,
-    Xc=0.75,
-    Xo=0,
-    Xn=0,
-    LHV=47.5e6,
-    Q0=0.156042)
-             annotation (Placement(transformation(extent={{62,-18},{40,4}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.Machines.AlternatingEngine Engine(
-    DPe=1,
-    MMg=20,
-    Xref=0.3166,
-    Xpth=0,
-    RV=6.45,
-    Kc=1.28,
-    Kd=1.33,
-    Tsf(fixed=false, start=657),
-    exc(fixed=false, start=1.8),
-    mechanical_efficiency_type=mechanical_efficiency_type,
-    Rmeca_nom=Rmeca_nom) annotation (Placement(transformation(
-        origin={0,0},
-        extent={{-24,-24},{24,24}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
-    ExchangerWaterWater(
-    DPc(start=0.1),
-    DPf(start=0.1),
-    W(fixed=false, start=463.4e3),
-    EffEch=RechWaterEff,
-    exchanger_type=3)
-               annotation (Placement(transformation(
-        origin={0,-66},
-        extent={{-14,-14},{14,14}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
-    ExchangerWaterFlueGases(W(fixed=false, start=1195.9e3), EffEch=RechFumEff)
-             annotation (Placement(transformation(
-        origin={0,68},
-        extent={{-14,-14},{14,14}},
-        rotation=90)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkG puits_fumees
-    annotation (Placement(transformation(extent={{58,56},{82,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
-                                       k=1e5)
-    annotation (Placement(transformation(extent={{120,60},{100,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_air(
-                                        k(fixed=false) = 50)
-    annotation (Placement(transformation(extent={{20,30},{40,50}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceG Air(
-    Xco2=0,
-    Xh2o=0.005,
-    Xo2=0.23,
-    Xso2=0) annotation (Placement(transformation(extent={{72,8},{48,32}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Temperature(
-                                          k=Tair)
-    annotation (Placement(transformation(extent={{100,0},{80,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
-    annotation (Placement(transformation(extent={{180,80},{220,120}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
-    annotation (Placement(transformation(extent={{-220,80},{-180,120}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_eau(
-                                                k=12.2)
-                      annotation (Placement(transformation(extent={{96,-28},{80,
-            -12}}, rotation=0)));
-equation
-  connect(Sink_water.C, ExchangerWaterWater.Sc)
-    annotation (Line(points={{-22,-60},{-12.08,-60},{-12.08,-60.4},{-5.74,-60.4}}));
-  connect(ExchangerWaterWater.Ec, PDC1.C2)
-    annotation (Line(points={{-5.74,-71.6},{-60,-71.6},{-60,-20}}));
-  connect(PDC2.C1, ExchangerWaterWater.Sf)
-    annotation (Line(points={{-80,-20},{-80,-40},{-0.14,-40},{-0.14,-52}}));
-  connect(Debit_air.y, Air.IMassFlow)
-    annotation (Line(points={{41,40},{60,40},{60,26}}));
-  connect(Air.ITemperature, Temperature.y)
-    annotation (Line(points={{60,14},{60,10},{79,10}}));
-  connect(ExchangerWaterWater.Ef, inletWaterSteamI)
-                                     annotation (Line(points={{9.19104e-016,-80},
-          {0,-80},{0,-100},{-140,-100},{-140,100},{-200,100}}));
-  connect(Debit_eau.y, Source_water.IMassFlow)
-    annotation (Line(points={{79.2,-20},{51,-20},{51,-25.5}}));
-  connect(puits_fumees.IPressure, Pression.y)
-    annotation (Line(points={{76,68},{90,68},{90,70},{99,70}}));
-  connect(silencieux.C2, ExchangerWaterFlueGases.Cfg1) annotation (Line(
-      points={{-39,26},{-39,68},{-12.6,68}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerWaterFlueGases.Cfg2, puits_fumees.C) annotation (Line(
-      points={{12.6,67.93},{36.3,67.93},{36.3,68},{58.24,68}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerWaterFlueGases.Cws2, outletWaterSteamI) annotation (Line(
-        points={{2.63361e-015,82},{2.63361e-015,100},{200,100}}, color={0,0,255}));
-  connect(PDC2.C2, ExchangerWaterFlueGases.Cws1) annotation (Line(points={{-80,
-          0},{-80,40},{9.19104e-016,40},{9.19104e-016,54}}, color={0,0,255}));
-  connect(PDC1.C1, Engine.Cws2)
-    annotation (Line(points={{-60,0},{-60,32},{1.32262e-015,32},{1.32262e-015,
-          21.6}}));
-  connect(Engine.Cair, Air.C) annotation (Line(
-      points={{21.6,9.6},{34,9.6},{34,20},{48,20}},
-      color={0,0,0},
-      thickness=1));
-  connect(Engine.Cws1, Source_water.C)
-    annotation (Line(points={{-1.32262e-015,-21.6},{-1.32262e-015,-31},{40,-31}}));
-  connect(silencieux.C1, Engine.Cfg) annotation (Line(
-      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(Engine.Cfuel, Fuel.C) annotation (Line(points={{21.6,-9.6},{32,-9.6},
-          {32,-7},{40,-7}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics),
-                          Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-200,200},{200,-200}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Dash,
-          lineThickness=0.5),
-        Rectangle(
-          extent={{-180,-2},{-20,-162}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-110,-146},{-96,-128},{-100,-138},{-82,-136},{-98,-142},{-78,
-              -148},{-94,-146},{-110,-158},{-102,-148},{-110,-146}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-146,-124},{-146,-82},{-106,-82},{-106,-24},{-100,-32},{-94,
-              -24},{-94,-82},{-52,-82},{-52,-124},{-146,-124}},
-          lineColor={0,0,0},
-          fillColor={170,255,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-180,-52},{-134,-52},{-134,-28},{-62,-28},{-62,-52},{-20,-52},
-              {-20,-44},{-54,-44},{-54,-20},{-142,-20},{-142,-44},{-180,-44},{
-              -180,-52}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{20,140},{180,38}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{50,142},{146,74}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Rectangle(
-          extent={{-180,140},{-20,38}},
-          lineColor={0,0,255},
-          fillColor={72,143,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-160,38},{-160,116},{-100,72},{-100,72},{-100,72}},
-          color={255,0,0},
-          thickness=1),
-        Text(
-          extent={{-148,146},{-52,78}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Line(
-          points={{38,38},{38,116},{98,72},{158,120},{158,38}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-20,98},{20,98}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{-160,-2},{-160,38}},
-          color={255,0,0},
-          thickness=1),
-        Line(
-          points={{-40,-2},{-40,38}},
-          color={0,0,255},
-          thickness=1),
-        Polygon(
-          points={{-20,-52},{26,-52},{26,-52},{38,-52},{38,-52},{44,-52},{44,38},
-              {36,38},{36,-44},{18,-44},{18,-44},{-20,-44},{-20,-52}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,38},{-40,116},{-100,72},{-100,72},{-100,72}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{40,38},{40,116},{100,72},{160,120},{160,38}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{42,38},{42,116},{102,72},{162,120},{162,38}},
-          color={0,0,0},
-          thickness=1)}),
-    DymolaStoredErrors,
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Guillaume Larrignon</li>
-<li>Bruno P&eacute;chin&eacute; </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end CHPEngineTriGenPredSystem;
+within ThermoSysPro.MultiFluids.Machines;
+model CHPEngineTriGenPredSystem
+  parameter Units.SI.Temperature Tair=298 "Temperature inlet air";
+  parameter Real RechFumEff=0.717833 "Flue gases heater efficiency";
+  parameter Real RechWaterEff=0.837865 "Water heater efficiency";
+  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
+                                                         annotation(choices(
+    choice=1 "Fixed nominal efficiency",
+    choice=2 "Efficiency computed using a linear function Coef_Rm",
+    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
+  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency";
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_water(
+    P0=3e5,
+    Q0=12.2,
+    h0=205e3)
+          annotation (Placement(transformation(extent={{62,-42},{40,-20}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC1(L=0.0001)
+    annotation (Placement(transformation(
+        origin={-60,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.Sink Sink_water
+    annotation (Placement(transformation(extent={{-22,-72},{-44,-48}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe PDC2(L=0.0001)
+    annotation (Placement(transformation(
+        origin={-80,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss silencieux(
+                                                                   K=20)
+           annotation (Placement(transformation(
+        origin={-39,16},
+        extent={{10,-9},{-10,9}},
+        rotation=270)));
+  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
+    rho=500,
+    Hum=0,
+    Xh=0.25,
+    Xs=0,
+    Xashes=0,
+    Vol=100,
+    T0=298,
+    Xc=0.75,
+    Xo=0,
+    Xn=0,
+    LHV=47.5e6,
+    Q0=0.156042)
+             annotation (Placement(transformation(extent={{62,-18},{40,4}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.Machines.AlternatingEngine Engine(
+    DPe=1,
+    MMg=20,
+    Xref=0.3166,
+    Xpth=0,
+    RV=6.45,
+    Kc=1.28,
+    Kd=1.33,
+    Tsf(fixed=false, start=657),
+    exc(fixed=false, start=1.8),
+    mechanical_efficiency_type=mechanical_efficiency_type,
+    Rmeca_nom=Rmeca_nom) annotation (Placement(transformation(
+        origin={0,0},
+        extent={{-24,-24},{24,24}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
+    ExchangerWaterWater(
+    DPc(start=0.1),
+    DPf(start=0.1),
+    W(fixed=false, start=463.4e3),
+    EffEch=RechWaterEff,
+    exchanger_type=3)
+               annotation (Placement(transformation(
+        origin={0,-66},
+        extent={{-14,-14},{14,14}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
+    ExchangerWaterFlueGases(W(fixed=false, start=1195.9e3), EffEch=RechFumEff)
+             annotation (Placement(transformation(
+        origin={0,68},
+        extent={{-14,-14},{14,14}},
+        rotation=90)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkG puits_fumees
+    annotation (Placement(transformation(extent={{58,56},{82,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
+                                       k=1e5)
+    annotation (Placement(transformation(extent={{120,60},{100,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_air(
+                                        k(fixed=false) = 50)
+    annotation (Placement(transformation(extent={{20,30},{40,50}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceG Air(
+    Xco2=0,
+    Xh2o=0.005,
+    Xo2=0.23,
+    Xso2=0) annotation (Placement(transformation(extent={{72,8},{48,32}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Temperature(
+                                          k=Tair)
+    annotation (Placement(transformation(extent={{100,0},{80,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
+    annotation (Placement(transformation(extent={{180,80},{220,120}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
+    annotation (Placement(transformation(extent={{-220,80},{-180,120}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_eau(
+                                                k=12.2)
+                      annotation (Placement(transformation(extent={{96,-28},{80,
+            -12}}, rotation=0)));
+equation
+  connect(Sink_water.C, ExchangerWaterWater.Sc)
+    annotation (Line(points={{-22,-60},{-12.08,-60},{-12.08,-60.4},{-5.74,-60.4}}));
+  connect(ExchangerWaterWater.Ec, PDC1.C2)
+    annotation (Line(points={{-5.74,-71.6},{-60,-71.6},{-60,-20}}));
+  connect(PDC2.C1, ExchangerWaterWater.Sf)
+    annotation (Line(points={{-80,-20},{-80,-40},{-0.14,-40},{-0.14,-52}}));
+  connect(Debit_air.y, Air.IMassFlow)
+    annotation (Line(points={{41,40},{60,40},{60,26}}));
+  connect(Air.ITemperature, Temperature.y)
+    annotation (Line(points={{60,14},{60,10},{79,10}}));
+  connect(ExchangerWaterWater.Ef, inletWaterSteamI)
+                                     annotation (Line(points={{9.19104e-016,-80},
+          {0,-80},{0,-100},{-140,-100},{-140,100},{-200,100}}));
+  connect(Debit_eau.y, Source_water.IMassFlow)
+    annotation (Line(points={{79.2,-20},{51,-20},{51,-25.5}}));
+  connect(puits_fumees.IPressure, Pression.y)
+    annotation (Line(points={{76,68},{90,68},{90,70},{99,70}}));
+  connect(silencieux.C2, ExchangerWaterFlueGases.Cfg1) annotation (Line(
+      points={{-39,26},{-39,68},{-12.6,68}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerWaterFlueGases.Cfg2, puits_fumees.C) annotation (Line(
+      points={{12.6,67.93},{36.3,67.93},{36.3,68},{58.24,68}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerWaterFlueGases.Cws2, outletWaterSteamI) annotation (Line(
+        points={{2.63361e-015,82},{2.63361e-015,100},{200,100}}, color={0,0,255}));
+  connect(PDC2.C2, ExchangerWaterFlueGases.Cws1) annotation (Line(points={{-80,
+          0},{-80,40},{9.19104e-016,40},{9.19104e-016,54}}, color={0,0,255}));
+  connect(PDC1.C1, Engine.Cws2)
+    annotation (Line(points={{-60,0},{-60,32},{1.32262e-015,32},{1.32262e-015,
+          21.6}}));
+  connect(Engine.Cair, Air.C) annotation (Line(
+      points={{21.6,9.6},{34,9.6},{34,20},{48,20}},
+      color={0,0,0},
+      thickness=1));
+  connect(Engine.Cws1, Source_water.C)
+    annotation (Line(points={{-1.32262e-015,-21.6},{-1.32262e-015,-31},{40,-31}}));
+  connect(silencieux.C1, Engine.Cfg) annotation (Line(
+      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(Engine.Cfuel, Fuel.C) annotation (Line(points={{21.6,-9.6},{32,-9.6},
+          {32,-7},{40,-7}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics),
+                          Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-200,200},{200,-200}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Dash,
+          lineThickness=0.5),
+        Rectangle(
+          extent={{-180,-2},{-20,-162}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-110,-146},{-96,-128},{-100,-138},{-82,-136},{-98,-142},{-78,
+              -148},{-94,-146},{-110,-158},{-102,-148},{-110,-146}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-146,-124},{-146,-82},{-106,-82},{-106,-24},{-100,-32},{-94,
+              -24},{-94,-82},{-52,-82},{-52,-124},{-146,-124}},
+          lineColor={0,0,0},
+          fillColor={170,255,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-180,-52},{-134,-52},{-134,-28},{-62,-28},{-62,-52},{-20,-52},
+              {-20,-44},{-54,-44},{-54,-20},{-142,-20},{-142,-44},{-180,-44},{
+              -180,-52}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{20,140},{180,38}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{50,142},{146,74}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Rectangle(
+          extent={{-180,140},{-20,38}},
+          lineColor={0,0,255},
+          fillColor={72,143,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-160,38},{-160,116},{-100,72},{-100,72},{-100,72}},
+          color={255,0,0},
+          thickness=1),
+        Text(
+          extent={{-148,146},{-52,78}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Line(
+          points={{38,38},{38,116},{98,72},{158,120},{158,38}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-20,98},{20,98}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{-160,-2},{-160,38}},
+          color={255,0,0},
+          thickness=1),
+        Line(
+          points={{-40,-2},{-40,38}},
+          color={0,0,255},
+          thickness=1),
+        Polygon(
+          points={{-20,-52},{26,-52},{26,-52},{38,-52},{38,-52},{44,-52},{44,38},
+              {36,38},{36,-44},{18,-44},{18,-44},{-20,-44},{-20,-52}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,38},{-40,116},{-100,72},{-100,72},{-100,72}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{40,38},{40,116},{100,72},{160,120},{160,38}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{42,38},{42,116},{102,72},{162,120},{162,38}},
+          color={0,0,0},
+          thickness=1)}),
+    DymolaStoredErrors,
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Guillaume Larrignon</li>
+<li>Bruno P&eacute;chin&eacute; </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end CHPEngineTriGenPredSystem;
diff --git a/ThermoSysPro/MultiFluids/Machines/CHPEngineTrigenParamSystem.mo b/ThermoSysPro/MultiFluids/Machines/CHPEngineTrigenParamSystem.mo
index ed1d48f3281549a669d77aa2e3c0d99b587fe408..92f598e10818c6095f69e8a13a21d79c609543ec 100644
--- a/ThermoSysPro/MultiFluids/Machines/CHPEngineTrigenParamSystem.mo
+++ b/ThermoSysPro/MultiFluids/Machines/CHPEngineTrigenParamSystem.mo
@@ -1,272 +1,272 @@
-within ThermoSysPro.MultiFluids.Machines;
-model CHPEngineTrigenParamSystem
-  parameter Units.SI.Temperature Tair=298 "Temperature inlet air";
-  parameter Real RechFumEff=0.725576 "Flue gases heater efficiency";
-  parameter Real RechWaterEff=0.910767 "Water heater efficiency";
-  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
-                                                         annotation(choices(
-    choice=1 "Fixed nominal efficiency",
-    choice=2 "Efficiency computed using a linear function Coef_Rm",
-    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
-  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency ";
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_water(
-    P0=3e5,
-    Q0=12.2,
-    h0=215e3)
-          annotation (Placement(transformation(extent={{62,-42},{40,-20}},
-          rotation=0)));
-  WaterSteam.PressureLosses.LumpedStraightPipe PDC1(  L=0.0001)
-    annotation (Placement(transformation(
-        origin={-60,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  WaterSteam.BoundaryConditions.SinkPQ Sink_water
-    annotation (Placement(transformation(extent={{-18,-72},{-40,-48}}, rotation=
-           0)));
-  WaterSteam.PressureLosses.LumpedStraightPipe PDC2(  L=0.0001)
-    annotation (Placement(transformation(
-        origin={-80,-10},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss silencieux(
-                                                                    K=20)
-           annotation (Placement(transformation(
-        origin={-39,16},
-        extent={{10,-9},{-10,9}},
-        rotation=270)));
-  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
-    rho=500,
-    Hum=0,
-    Xh=0.25,
-    Xs=0,
-    Xashes=0,
-    Vol=100,
-    T0=298,
-    Xc=0.75,
-    Xo=0,
-    Xn=0,
-    LHV=47.5e6,
-    Q0=0.156042)
-             annotation (Placement(transformation(extent={{62,-20},{40,2}},
-          rotation=0)));
-  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
-    ExchangerWaterFlueGases(
-    W(fixed=false, start=1195.9e3),
-    EffEch=RechFumEff)
-             annotation (Placement(transformation(
-        origin={0,68},
-        extent={{-14,-14},{14,14}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
-    ExchangerWaterWater(
-    DPc(start=0.1),
-    DPf(start=0.1),
-    W(fixed=false, start=463.4e3),
-    Tsf(fixed=false, start=364.186),
-    exchanger_type=3,
-    EffEch=RechWaterEff)
-               annotation (Placement(transformation(
-        origin={0,-66},
-        extent={{-14,-14},{14,14}},
-        rotation=90)));
-  ThermoSysPro.MultiFluids.Machines.AlternatingEngine Engine(
-    MMg=20,
-    Xref=0.3166,
-    Xpth=0,
-    RV=6.45,
-    Kc=1.28,
-    Kd=1.33,
-    Tsf(fixed=false, start=657),
-    exc(fixed=false, start=1.8),
-    DPe=1,
-    mechanical_efficiency_type=mechanical_efficiency_type,
-    Rmeca_nom=Rmeca_nom) annotation (Placement(transformation(
-        origin={0,0},
-        extent={{-24,-24},{24,24}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_eau(
-                                                k=12.2)
-                      annotation (Placement(transformation(extent={{96,-28},{80,
-            -12}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SinkG M_puits_fumees
-    annotation (Placement(transformation(extent={{38,56},{62,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
-                                       k=1e5)
-    annotation (Placement(transformation(extent={{100,58},{80,78}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_air(
-                                                k=50)
-    annotation (Placement(transformation(extent={{20,30},{40,50}}, rotation=0)));
-  ThermoSysPro.FlueGases.BoundaryConditions.SourceG Air(
-    Xco2=0,
-    Xh2o=0.005,
-    Xo2=0.23,
-    Xso2=0) annotation (Placement(transformation(extent={{64,8},{40,32}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Temperature(
-                                          k=Tair)
-    annotation (Placement(transformation(extent={{100,0},{80,20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
-    annotation (Placement(transformation(extent={{180,80},{220,120}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
-    annotation (Placement(transformation(extent={{-220,80},{-180,120}},
-          rotation=0)));
-equation
-  connect(ExchangerWaterWater.Ef, inletWaterSteamI)
-                                         annotation (Line(points={{9.19104e-016,
-          -80},{9.19104e-016,-100},{-140,-100},{-140,100},{-200,100}}));
-  connect(Sink_water.C, ExchangerWaterWater.Sc)
-                                       annotation (Line(points={{-18,-60},{
-          -14.08,-60},{-14.08,-60.4},{-5.74,-60.4}}));
-  connect(PDC1.C2, ExchangerWaterWater.Ec)
-                                   annotation (Line(points={{-60,-20},{-60,
-          -71.6},{-5.74,-71.6}}, color={0,0,255}));
-  connect(PDC2.C1, ExchangerWaterWater.Sf)
-                                   annotation (Line(points={{-80,-20},{-80,-40},
-          {-0.14,-40},{-0.14,-52}}));
-  connect(Debit_air.y, Air.IMassFlow)
-    annotation (Line(points={{41,40},{52,40},{52,26}}));
-  connect(Air.ITemperature, Temperature.y)
-    annotation (Line(points={{52,14},{52,10},{79,10}}));
-  connect(M_puits_fumees.IPressure, Pression.y)
-    annotation (Line(points={{56,68},{68,68},{68,68},{79,68}}));
-  connect(Source_water.IMassFlow, Debit_eau.y)
-    annotation (Line(points={{51,-25.5},{51,-20},{79.2,-20}}));
-  connect(silencieux.C2, ExchangerWaterFlueGases.Cfg1) annotation (Line(
-      points={{-39,26},{-40,26},{-40,68},{-12.6,68}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerWaterFlueGases.Cfg2, M_puits_fumees.C) annotation (Line(
-      points={{12.6,67.93},{26.3,67.93},{26.3,68},{38.24,68}},
-      color={0,0,0},
-      thickness=1));
-  connect(ExchangerWaterFlueGases.Cws2, outletWaterSteamI) annotation (Line(
-        points={{2.63361e-015,82},{0,82},{0,100},{200,100}}, color={0,0,255}));
-  connect(PDC2.C2, ExchangerWaterFlueGases.Cws1) annotation (Line(points={{-80,
-          0},{-80,40},{9.19104e-016,40},{9.19104e-016,54}}, color={0,0,255}));
-  connect(Engine.Cair, Air.C) annotation (Line(
-      points={{21.6,9.6},{30,9.6},{30,20},{40,20}},
-      color={0,0,0},
-      thickness=1));
-  connect(Engine.Cws1, Source_water.C)
-    annotation (Line(points={{-1.32262e-015,-21.6},{-1.32262e-015,-31},{40,-31}}));
-  connect(silencieux.C1, Engine.Cfg) annotation (Line(
-      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
-      color={0,0,0},
-      thickness=1));
-  connect(PDC1.C1, Engine.Cws2)
-    annotation (Line(points={{-60,0},{-60,30},{1.32262e-015,30},{1.32262e-015,
-          21.6}}));
-  connect(Engine.Cfuel, Fuel.C) annotation (Line(points={{21.6,-9.6},{30.8,-9.6},
-          {30.8,-9},{40,-9}}, color={0,0,0}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics),
-                          Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-200,-200},{200,200}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-200,200},{200,-200}},
-          lineColor={0,0,0},
-          pattern=LinePattern.Dash,
-          lineThickness=0.5),
-        Rectangle(
-          extent={{-180,0},{-20,-160}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-110,-144},{-96,-126},{-100,-136},{-82,-134},{-98,-140},{-78,
-              -146},{-94,-144},{-110,-156},{-102,-146},{-110,-144}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-146,-122},{-146,-80},{-106,-80},{-106,-22},{-100,-30},{-94,
-              -22},{-94,-80},{-52,-80},{-52,-122},{-146,-122}},
-          lineColor={0,0,0},
-          fillColor={170,255,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-180,-50},{-134,-50},{-134,-26},{-62,-26},{-62,-50},{-20,-50},
-              {-20,-42},{-54,-42},{-54,-18},{-142,-18},{-142,-42},{-180,-42},{
-              -180,-50}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{20,142},{180,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{50,144},{146,76}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Rectangle(
-          extent={{-180,142},{-20,40}},
-          lineColor={0,0,255},
-          fillColor={72,143,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-160,40},{-160,118},{-100,74},{-100,74},{-100,74}},
-          color={255,0,0},
-          thickness=1),
-        Text(
-          extent={{-148,148},{-52,80}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Line(
-          points={{38,40},{38,118},{98,74},{158,122},{158,40}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-20,100},{20,100}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{-160,0},{-160,40}},
-          color={255,0,0},
-          thickness=1),
-        Line(
-          points={{-40,0},{-40,40}},
-          color={0,0,255},
-          thickness=1),
-        Polygon(
-          points={{-20,-50},{26,-50},{26,-50},{38,-50},{38,-50},{44,-50},{44,40},
-              {36,40},{36,-42},{18,-42},{18,-42},{-20,-42},{-20,-50}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,40},{-40,118},{-100,74},{-100,74},{-100,74}},
-          color={0,0,255},
-          thickness=1),
-        Line(
-          points={{40,40},{40,118},{100,74},{160,122},{160,40}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{42,40},{42,118},{102,74},{162,122},{162,40}},
-          color={0,0,0},
-          thickness=1)}),
-    DymolaStoredErrors,
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Guillaume Larrignon</li>
-<li>Bruno P&eacute;chin&eacute; </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end CHPEngineTrigenParamSystem;
+within ThermoSysPro.MultiFluids.Machines;
+model CHPEngineTrigenParamSystem
+  parameter Units.SI.Temperature Tair=298 "Temperature inlet air";
+  parameter Real RechFumEff=0.725576 "Flue gases heater efficiency";
+  parameter Real RechWaterEff=0.910767 "Water heater efficiency";
+  parameter Integer mechanical_efficiency_type=3 "Engine efficiency type"
+                                                         annotation(choices(
+    choice=1 "Fixed nominal efficiency",
+    choice=2 "Efficiency computed using a linear function Coef_Rm",
+    choice=3 "Efficiency computed using the Beau de Rochas Cycle"));
+  parameter Real Rmeca_nom=0.40 "Engine nominal efficiency ";
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourcePQ Source_water(
+    P0=3e5,
+    Q0=12.2,
+    h0=215e3)
+          annotation (Placement(transformation(extent={{62,-42},{40,-20}},
+          rotation=0)));
+  WaterSteam.PressureLosses.LumpedStraightPipe PDC1(  L=0.0001)
+    annotation (Placement(transformation(
+        origin={-60,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  WaterSteam.BoundaryConditions.SinkPQ Sink_water
+    annotation (Placement(transformation(extent={{-18,-72},{-40,-48}}, rotation=
+           0)));
+  WaterSteam.PressureLosses.LumpedStraightPipe PDC2(  L=0.0001)
+    annotation (Placement(transformation(
+        origin={-80,-10},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  ThermoSysPro.FlueGases.PressureLosses.SingularPressureLoss silencieux(
+                                                                    K=20)
+           annotation (Placement(transformation(
+        origin={-39,16},
+        extent={{10,-9},{-10,9}},
+        rotation=270)));
+  ThermoSysPro.Combustion.BoundaryConditions.FuelSourcePQ Fuel(
+    rho=500,
+    Hum=0,
+    Xh=0.25,
+    Xs=0,
+    Xashes=0,
+    Vol=100,
+    T0=298,
+    Xc=0.75,
+    Xo=0,
+    Xn=0,
+    LHV=47.5e6,
+    Q0=0.156042)
+             annotation (Placement(transformation(extent={{62,-20},{40,2}},
+          rotation=0)));
+  ThermoSysPro.MultiFluids.HeatExchangers.StaticExchangerWaterSteamFlueGases
+    ExchangerWaterFlueGases(
+    W(fixed=false, start=1195.9e3),
+    EffEch=RechFumEff)
+             annotation (Placement(transformation(
+        origin={0,68},
+        extent={{-14,-14},{14,14}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchangerDTorWorEff
+    ExchangerWaterWater(
+    DPc(start=0.1),
+    DPf(start=0.1),
+    W(fixed=false, start=463.4e3),
+    Tsf(fixed=false, start=364.186),
+    exchanger_type=3,
+    EffEch=RechWaterEff)
+               annotation (Placement(transformation(
+        origin={0,-66},
+        extent={{-14,-14},{14,14}},
+        rotation=90)));
+  ThermoSysPro.MultiFluids.Machines.AlternatingEngine Engine(
+    MMg=20,
+    Xref=0.3166,
+    Xpth=0,
+    RV=6.45,
+    Kc=1.28,
+    Kd=1.33,
+    Tsf(fixed=false, start=657),
+    exc(fixed=false, start=1.8),
+    DPe=1,
+    mechanical_efficiency_type=mechanical_efficiency_type,
+    Rmeca_nom=Rmeca_nom) annotation (Placement(transformation(
+        origin={0,0},
+        extent={{-24,-24},{24,24}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_eau(
+                                                k=12.2)
+                      annotation (Placement(transformation(extent={{96,-28},{80,
+            -12}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SinkG M_puits_fumees
+    annotation (Placement(transformation(extent={{38,56},{62,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
+                                       k=1e5)
+    annotation (Placement(transformation(extent={{100,58},{80,78}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit_air(
+                                                k=50)
+    annotation (Placement(transformation(extent={{20,30},{40,50}}, rotation=0)));
+  ThermoSysPro.FlueGases.BoundaryConditions.SourceG Air(
+    Xco2=0,
+    Xh2o=0.005,
+    Xo2=0.23,
+    Xso2=0) annotation (Placement(transformation(extent={{64,8},{40,32}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Temperature(
+                                          k=Tair)
+    annotation (Placement(transformation(extent={{100,0},{80,20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI outletWaterSteamI
+    annotation (Placement(transformation(extent={{180,80},{220,120}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI inletWaterSteamI
+    annotation (Placement(transformation(extent={{-220,80},{-180,120}},
+          rotation=0)));
+equation
+  connect(ExchangerWaterWater.Ef, inletWaterSteamI)
+                                         annotation (Line(points={{9.19104e-016,
+          -80},{9.19104e-016,-100},{-140,-100},{-140,100},{-200,100}}));
+  connect(Sink_water.C, ExchangerWaterWater.Sc)
+                                       annotation (Line(points={{-18,-60},{
+          -14.08,-60},{-14.08,-60.4},{-5.74,-60.4}}));
+  connect(PDC1.C2, ExchangerWaterWater.Ec)
+                                   annotation (Line(points={{-60,-20},{-60,
+          -71.6},{-5.74,-71.6}}, color={0,0,255}));
+  connect(PDC2.C1, ExchangerWaterWater.Sf)
+                                   annotation (Line(points={{-80,-20},{-80,-40},
+          {-0.14,-40},{-0.14,-52}}));
+  connect(Debit_air.y, Air.IMassFlow)
+    annotation (Line(points={{41,40},{52,40},{52,26}}));
+  connect(Air.ITemperature, Temperature.y)
+    annotation (Line(points={{52,14},{52,10},{79,10}}));
+  connect(M_puits_fumees.IPressure, Pression.y)
+    annotation (Line(points={{56,68},{68,68},{68,68},{79,68}}));
+  connect(Source_water.IMassFlow, Debit_eau.y)
+    annotation (Line(points={{51,-25.5},{51,-20},{79.2,-20}}));
+  connect(silencieux.C2, ExchangerWaterFlueGases.Cfg1) annotation (Line(
+      points={{-39,26},{-40,26},{-40,68},{-12.6,68}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerWaterFlueGases.Cfg2, M_puits_fumees.C) annotation (Line(
+      points={{12.6,67.93},{26.3,67.93},{26.3,68},{38.24,68}},
+      color={0,0,0},
+      thickness=1));
+  connect(ExchangerWaterFlueGases.Cws2, outletWaterSteamI) annotation (Line(
+        points={{2.63361e-015,82},{0,82},{0,100},{200,100}}, color={0,0,255}));
+  connect(PDC2.C2, ExchangerWaterFlueGases.Cws1) annotation (Line(points={{-80,
+          0},{-80,40},{9.19104e-016,40},{9.19104e-016,54}}, color={0,0,255}));
+  connect(Engine.Cair, Air.C) annotation (Line(
+      points={{21.6,9.6},{30,9.6},{30,20},{40,20}},
+      color={0,0,0},
+      thickness=1));
+  connect(Engine.Cws1, Source_water.C)
+    annotation (Line(points={{-1.32262e-015,-21.6},{-1.32262e-015,-31},{40,-31}}));
+  connect(silencieux.C1, Engine.Cfg) annotation (Line(
+      points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}},
+      color={0,0,0},
+      thickness=1));
+  connect(PDC1.C1, Engine.Cws2)
+    annotation (Line(points={{-60,0},{-60,30},{1.32262e-015,30},{1.32262e-015,
+          21.6}}));
+  connect(Engine.Cfuel, Fuel.C) annotation (Line(points={{21.6,-9.6},{30.8,-9.6},
+          {30.8,-9},{40,-9}}, color={0,0,0}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics),
+                          Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-200,-200},{200,200}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-200,200},{200,-200}},
+          lineColor={0,0,0},
+          pattern=LinePattern.Dash,
+          lineThickness=0.5),
+        Rectangle(
+          extent={{-180,0},{-20,-160}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-110,-144},{-96,-126},{-100,-136},{-82,-134},{-98,-140},{-78,
+              -146},{-94,-144},{-110,-156},{-102,-146},{-110,-144}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-146,-122},{-146,-80},{-106,-80},{-106,-22},{-100,-30},{-94,
+              -22},{-94,-80},{-52,-80},{-52,-122},{-146,-122}},
+          lineColor={0,0,0},
+          fillColor={170,255,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-180,-50},{-134,-50},{-134,-26},{-62,-26},{-62,-50},{-20,-50},
+              {-20,-42},{-54,-42},{-54,-18},{-142,-18},{-142,-42},{-180,-42},{
+              -180,-50}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{20,142},{180,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{50,144},{146,76}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Rectangle(
+          extent={{-180,142},{-20,40}},
+          lineColor={0,0,255},
+          fillColor={72,143,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-160,40},{-160,118},{-100,74},{-100,74},{-100,74}},
+          color={255,0,0},
+          thickness=1),
+        Text(
+          extent={{-148,148},{-52,80}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Line(
+          points={{38,40},{38,118},{98,74},{158,122},{158,40}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-20,100},{20,100}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{-160,0},{-160,40}},
+          color={255,0,0},
+          thickness=1),
+        Line(
+          points={{-40,0},{-40,40}},
+          color={0,0,255},
+          thickness=1),
+        Polygon(
+          points={{-20,-50},{26,-50},{26,-50},{38,-50},{38,-50},{44,-50},{44,40},
+              {36,40},{36,-42},{18,-42},{18,-42},{-20,-42},{-20,-50}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,40},{-40,118},{-100,74},{-100,74},{-100,74}},
+          color={0,0,255},
+          thickness=1),
+        Line(
+          points={{40,40},{40,118},{100,74},{160,122},{160,40}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{42,40},{42,118},{102,74},{162,122},{162,40}},
+          color={0,0,0},
+          thickness=1)}),
+    DymolaStoredErrors,
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Guillaume Larrignon</li>
+<li>Bruno P&eacute;chin&eacute; </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end CHPEngineTrigenParamSystem;
diff --git a/ThermoSysPro/MultiFluids/Machines/package.mo b/ThermoSysPro/MultiFluids/Machines/package.mo
index e0aefdc092723c9c735e92bf33e01d84bf4ce790..298cdddfeac86e00cfe0c056a4b094732270c978 100644
--- a/ThermoSysPro/MultiFluids/Machines/package.mo
+++ b/ThermoSysPro/MultiFluids/Machines/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.MultiFluids;
-package Machines "Machines"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Machines;
+within ThermoSysPro.MultiFluids;
+package Machines "Machines"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Machines;
diff --git a/ThermoSysPro/MultiFluids/Machines/package.order b/ThermoSysPro/MultiFluids/Machines/package.order
index 084d8de0c9a28b42215fbf445020bb1ebcd6d41f..7d6bcda1aa7d1570d5d658fd704d2a4731c58635 100644
--- a/ThermoSysPro/MultiFluids/Machines/package.order
+++ b/ThermoSysPro/MultiFluids/Machines/package.order
@@ -1,5 +1,5 @@
-AlternatingEngine
-CHPEngineBarkantineSystem
-CHPEngineTrigenParamSystem
-CHPEngineTriGenPredSystem
-CHPEngineBarkantineSystem_NewQair
+AlternatingEngine
+CHPEngineBarkantineSystem
+CHPEngineTrigenParamSystem
+CHPEngineTriGenPredSystem
+CHPEngineBarkantineSystem_NewQair
diff --git a/ThermoSysPro/MultiFluids/package.mo b/ThermoSysPro/MultiFluids/package.mo
index 3c1aaeec06c2cb53bbfdcb959fa07dc288245f90..7146b9d3705b81d7a3990221249f19d89cd50494 100644
--- a/ThermoSysPro/MultiFluids/package.mo
+++ b/ThermoSysPro/MultiFluids/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro;
-package MultiFluids "Multi-fluids components library"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end MultiFluids;
+within ThermoSysPro;
+package MultiFluids "Multi-fluids components library"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end MultiFluids;
diff --git a/ThermoSysPro/NuclearCore/FuelThermalPower.mo b/ThermoSysPro/NuclearCore/FuelThermalPower.mo
new file mode 100644
index 0000000000000000000000000000000000000000..9e2fd5fe7c24f35d413c26883e6c8c89a550c4d2
--- /dev/null
+++ b/ThermoSysPro/NuclearCore/FuelThermalPower.mo
@@ -0,0 +1,202 @@
+within ThermoSysPro.NuclearCore;
+model FuelThermalPower "Grid model that describes the dynamic of the conduction of heat generated 
+  by fission in a fuel rod."
+
+  parameter Integer Nrods=50952 "Number of fuel rods of UO2";
+  parameter ThermoSysPro.Units.SI.Length Rp=0.004095 "Radius of the fuel pellet";
+  parameter ThermoSysPro.Units.SI.Length Rclad=0.00418 "Internal radius of the cladding";
+  parameter Integer N=6 "Number of zones";
+  parameter ThermoSysPro.Units.SI.Length Length=2 "Active lenght of the fuel rods";
+  parameter ThermoSysPro.Units.SI.Length L[N]={Length/N,Length/N,Length/N,Length/N,Length/N,
+      Length/N} "Lenght of the zones (insert a table of size N)";
+  parameter Real xWt[N]={0.0679,0.1829,0.2492,0.2492,0.1829,0.0679}
+    "Fraction of the total thermal power produced in the zone i of the fuel";
+  parameter Boolean steady_state=false;
+  parameter ThermoSysPro.Units.SI.Temperature Tstart=973.15;
+
+protected
+  parameter ThermoSysPro.Units.SI.Density rho=10950
+    "Density of the UO2 fuel";
+  parameter ThermoSysPro.Units.SI.CoefficientOfHeatTransfer  heat_coeff_clad=10000
+    "Heat Tranfer Coefficient between the fuel rods and the internal wall of the cladding";
+  parameter ThermoSysPro.Units.SI.Mass dM[N]=Nrods*rho*pi*Rp*Rclad*L
+    "Mass of fuel in the zone i";
+  parameter ThermoSysPro.Units.SI.Area dSgi[N]=Nrods*2*pi*Rclad*L
+    "Internal surface of the cladding in zone i";
+  constant Real pi=Modelica.Constants.pi "Pi";
+ // parameter ThermoSysPro.Units.SI.Temperature Tstart(start=973.15, fixed=true);
+  //ThermoSysPro.Units.SI.Temperature Tm[N, 2](start=fill(Tstart, N, 2))
+ ThermoSysPro.Units.SI.Temperature Tm[N, 2]
+    "Average T between 1 and 2, and between 2 and 3";
+  ThermoSysPro.Units.SI.SpecificHeatCapacity cp[N, 3] "Specific heat of UO2";
+  ThermoSysPro.Units.SI.ThermalConductivity k[N, 2]  "Thermal conductivity of UO2";
+  Real Coef "Intermediate coefficient";
+
+  // ThermoSysPro.Units.SI.Temperature T[N, 3](start=fill(Tstart, N, 3))
+public
+   ThermoSysPro.Units.SI.Temperature T[N, 3]
+    "Temperature of the fuel";
+  /* Temperature of the fuel in each axial zone i *:
+  T[i,1] : temperature at the centre of the pellet
+       T[i,2] : temperature qt R/(2^0.5)
+       T[i,3] : temperature at the external surface of the pellet
+   Rq : R/(2^0.5) définit deux zones isovolumes ? */
+   ThermoSysPro.Units.SI.Temperature Teff[N](start=fill(Tstart, N))
+    "Effective temperature of the UO2 per zone, used for the calculation of the Doppler effect";
+   ThermoSysPro.Units.SI.Temperature Teffg(start=Tstart)
+    "Effective global temperature of the UO2, used for the calculation of the Doppler effect";
+   ThermoSysPro.Units.SI.Temperature Tg[N](start=fill(Tstart, N))
+    "Internal T of the cladding";
+
+  ThermoSysPro.Units.SI.Power W[N]
+    "Power transmitted from the UO2 to the cladding in zone i";
+  ThermoSysPro.Units.SI.Power Wt
+    "Total thermal power produced by the UO2 fuel";
+
+  ThermoSysPro.Thermal.Connectors.ThermalPort C_WTgaine[N]
+    annotation (extent=[100, -10; 120, 12], Placement(transformation(extent={{
+            100,-10},{120,12}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreePt
+    annotation (extent=[-120, -10; -100, 10], Placement(transformation(extent={
+            {-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieT_fuel
+    annotation (extent=[-10, 100; 10, 120], rotation=90,
+    Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+
+initial equation
+  if steady_state then
+    for i in 1:N loop
+      for j in 1:3 loop
+        der(T[i, j]) = 0;
+      end for;
+    end for;
+  else
+    for i in 1:N loop
+      for j in 1:3 loop
+        T[i, j] = 973.15;
+      end for;
+    end for;
+  end if;
+
+equation
+  -W = C_WTgaine.W;
+  Tg = C_WTgaine.T;
+  Wt = EntreePt.signal;
+  Teffg = SortieT_fuel.signal;
+
+  Coef = 4/(Rp*Rp*rho);
+
+  for i in 1:N loop
+
+    //*** Energy balance in the fuel rods ***
+    cp[i, 1]*der(T[i, 1]) = xWt[i]*Wt/dM[i] + 2*Coef*k[i, 1]*(T[i, 2] - T[i, 1]);
+
+    cp[i, 2]*der(T[i, 2]) = xWt[i]*Wt/dM[i] + Coef*(-k[i, 1]*(T[i, 2] - T[i, 1])
+       + 3*k[i, 2]*(T[i, 3] - T[i, 2]));
+
+    cp[i, 3]*der(T[i, 3]) = xWt[i]*Wt/dM[i] - 6*Coef*k[i, 2]*(T[i, 3] - T[i, 2])
+       - 4*W[i]/dM[i];
+
+    //***Thermal exchange between the fuel rod and the cladding***
+    W[i] = heat_coeff_clad*dSgi[i]*(T[i, 3] - Tg[i]);
+
+    // Calculation of the thermal conductivity of the UO2
+    for j in 1:2 loop
+      Tm[i, j] = 0.5*(T[i, j] + T[i, j + 1]);
+      k[i, j] = 1/(0.0322 + 0.0002497*Tm[i, j]) + 0.641576e-10*Tm[i, j]*Tm[i, j]
+        *Tm[i, j];
+    end for;
+
+    // Calculation of the specific heat of the UO2
+    for j in 1:3 loop
+      cp[i, j] = 4186.8/270*(18.45 + 0.002431*T[i, j] - 2.272e5/(T[i, j]*T[i, j]));
+    end for;
+
+    // Calculation of the effective temperature in the zones (Rowlands correlation)
+    Teff[i] = 0.444*T[i, 1] + 0.556*T[i, 3];
+
+  end for;
+
+  // Calculation of the global effective temperature
+  Teffg = 0.023*Teff[1] + 0.167*Teff[2] + 0.31*Teff[3] + 0.31*Teff[4] + 0.167*
+    Teff[5] + 0.023*Teff[6];
+
+  annotation (Diagram(
+      coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
+      Rectangle(extent=[-100, 100; 100, -100], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Text(
+        extent=[-72, 96; 80, -96],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Uranium"),
+      Text(
+        extent=[-114, 28; -114, 12],
+        style(color=3, rgbcolor={0,0,255}),
+        string="Puo2"),
+      Text(
+        extent=[2, 94; 2, 78],
+        style(color=3, rgbcolor={0,0,255}),
+        string="T_fuel"),
+      graphics={
+        Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}),
+        Text(
+          extent={{-72,96},{80,-96}},
+          textColor={0,0,0},
+          textString=
+               "Uranium"),
+        Text(
+          extent={{-114,28},{-114,12}},
+          textColor={0,0,255},
+          textString=
+               "Puo2"),
+        Text(
+          extent={{2,94},{2,78}},
+          textColor={0,0,255},
+          textString=
+               "T_fuel")}),Icon(
+      graphics={Rectangle(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}), Text(
+          extent={{-74,102},{82,-84}},
+          textColor={0,0,0},
+          textString=
+               "%name")},        Rectangle(extent=[-100, 100; 100, -100], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0})), Text(
+        extent=[-74, 102; 82, -84],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="%name")),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FuelThermalPower;
diff --git a/ThermoSysPro/NuclearCore/NeutronKinetics.mo b/ThermoSysPro/NuclearCore/NeutronKinetics.mo
new file mode 100644
index 0000000000000000000000000000000000000000..4a3eaf438eb00080d1a0b68c4e6bc2acaa5e9a43
--- /dev/null
+++ b/ThermoSysPro/NuclearCore/NeutronKinetics.mo
@@ -0,0 +1,355 @@
+within ThermoSysPro.NuclearCore;
+model NeutronKinetics "This module contains a model of the neutronic flux with six groups of
+  delayed neutrons. Starting from the total reactivity, which is an input in the module and it is given
+  by the sum of all the possible feedback effects (Doppler, moderator, control bars, boron and xenon),
+  this module calculates the fission power of the reactor. The total power is the sum of the neutronic power
+  and the residual power (which is an input of the module)."
+
+  parameter ThermoSysPro.Units.SI.Time Tlife=23.27e-6
+    "Average lifetime of the prompt neutrons in the core (s)";
+  parameter Real Kuo2=1
+    "Ratio between the power produced in the fuel and the total power";
+  parameter Real Lambda[6]={0.0125,0.0308,0.1143,0.3103,1.2331,3.289}
+    "Radioactivity constants of the groups of the delayed neutrons (1/s)";
+  parameter Real Beta[6]={0.00021,0.00142,0.00131,0.00274,0.000932,0.000313}
+    "Fraction of delayed neutrons in each group with respect to the total number of neutrons emitted per fission";
+
+  parameter Boolean steady_state=false;
+  parameter Real Puo20=524e6 "Initial power of the core";
+
+protected
+  Real SumBeta=sum(Beta);
+
+public
+  ThermoSysPro.Units.SI.Power Pneut(start=Puo20) "Neutronic power (W)";
+  ThermoSysPro.Units.SI.Power Pndelay[6](start={2570e9,7052.7e9,1753.3e9,1350.8e9,
+        115.62e9,14.558e9})
+    "Power given by the 6 groups of delayed neutrons (W)";
+  ThermoSysPro.Units.SI.Power Ptot "Total power of the reactor (W)";
+  ThermoSysPro.Units.SI.Power Puo2 "Power produced in the fuel (W)";
+  ThermoSysPro.Units.SI.Power Ph2o
+    "Power directly received by the moderator (W)";
+  Real Reac "Total reactivity (pcm)";
+  ThermoSysPro.Units.SI.Power Pres "Residual power (W)";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreeReac
+    annotation (extent=[-120, 30; -100, 50], Placement(transformation(extent={{
+            -120,30},{-100,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreePres
+    annotation (extent=[-120, -50; -100, -30], Placement(transformation(extent=
+            {{-120,-50},{-100,-30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortiePneut
+    annotation (extent=[100, 40; 120, 60], Placement(transformation(extent={{
+            100,40},{120,60}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortiePtot
+    annotation (extent=[100, 6; 120, 26], Placement(transformation(extent={{100,
+            6},{120,26}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortiePuo2
+    annotation (extent=[100, -26; 120, -6], Placement(transformation(extent={{
+            100,-26},{120,-6}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortiePh2o
+    annotation (extent=[100, -60; 120, -40], Placement(transformation(extent={{
+            100,-60},{120,-40}}, rotation=0)));
+
+initial equation
+
+  if steady_state then
+
+    Puo2 = Puo20;
+    for i in 1:6 loop
+      der(Pndelay[i]) = 0;
+    end for;
+  else
+    Pneut = 540e6;
+    Pndelay = {2570e9,7052.7e9,1753.3e9,1350.8e9,115.62e9,14.558e9};
+
+  end if;
+
+equation
+  Reac = EntreeReac.signal;
+  Pres = EntreePres.signal;
+  Pneut = SortiePneut.signal;
+  Ptot = SortiePtot.signal;
+  Puo2 = SortiePuo2.signal;
+  Ph2o = SortiePh2o.signal;
+
+  Ptot - (Pneut + Pres) = 0;
+  Puo2 - Kuo2*Ptot = 0;
+  Ph2o - (1 - Kuo2)*Ptot = 0;
+
+  // Point reactor kinetics equations
+  der(Pneut) = (Reac*1e-5 - SumBeta)*Pneut/Tlife + sum(Lambda .* Pndelay);
+
+  for i in 1:6 loop
+
+    der(Pndelay[i]) = Beta[i]*Pneut/Tlife - Lambda[i]*Pndelay[i];
+
+  end for;
+
+  annotation (Icon(
+      graphics={
+        Ellipse(
+          extent={{-100,100},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Ellipse(
+          extent={{-100,20},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Rectangle(
+          extent={{-100,40},{100,-42}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}),
+        Text(
+          extent={{-78,92},{78,-84}},
+          textColor={0,0,0},
+          textString=
+               "%name"),
+        Text(
+          extent={{-130,68},{-130,56}},
+          textColor={0,0,0},
+          textString=
+               "Reac"),
+        Text(
+          extent={{-134,-14},{-134,-26}},
+          textColor={0,0,0},
+          textString=
+               "Pres"),
+        Text(
+          extent={{140,38},{140,26}},
+          textColor={0,0,0},
+          textString=
+               "Ptot"),
+        Text(
+          extent={{142,74},{142,62}},
+          textColor={0,0,0},
+          textString=
+               "Pneut"),
+        Text(
+          extent={{142,6},{142,-6}},
+          textColor={0,0,0},
+          textString=
+               "Puo2"),
+        Text(
+          extent={{142,-28},{142,-40}},
+          textColor={0,0,0},
+          textString=
+               "Ph2o")},
+      Ellipse(extent=[-100, 100; 100, -20], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Ellipse(extent=[-100, 20; 100, -100], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Rectangle(extent=[-100, 40; 100, -42], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Text(
+        extent=[-78, 92; 78, -84],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="%name"),
+      Text(
+        extent=[-130, 68; -130, 56],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Reac"),
+      Text(
+        extent=[-134, -14; -134, -26],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Pres"),
+      Text(
+        extent=[140, 38; 140, 26],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Ptot"),
+      Text(
+        extent=[142, 74; 142, 62],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Pneut"),
+      Text(
+        extent=[142, 6; 142, -6],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Puo2"),
+      Text(
+        extent=[142, -28; 142, -40],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Ph2o")), Diagram(
+      graphics={
+        Ellipse(
+          extent={{-100,100},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Ellipse(
+          extent={{-100,20},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Rectangle(
+          extent={{-100,40},{100,-42}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}),
+        Text(
+          extent={{-110,62},{-110,50}},
+          textColor={0,0,0},
+          textString=
+               "Reac"),
+        Text(
+          extent={{-110,-18},{-110,-30}},
+          textColor={0,0,0},
+          textString=
+               "Pres"),
+        Text(
+          extent={{-88,60},{92,-56}},
+          textColor={0,0,255},
+          textString="Neutron Kinetics"),
+        Text(
+          extent={{112,72},{112,60}},
+          textColor={0,0,0},
+          textString=
+               "Pneut"),
+        Text(
+          extent={{110,36},{110,24}},
+          textColor={0,0,0},
+          textString=
+               "Ptot"),
+        Text(
+          extent={{112,4},{112,-8}},
+          textColor={0,0,0},
+          textString=
+               "Puo2"),
+        Text(
+          extent={{112,-30},{112,-42}},
+          textColor={0,0,0},
+          textString=
+               "Ph2o")},
+      Ellipse(extent=[-100, 100; 100, -20], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Ellipse(extent=[-100, 20; 100, -100], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Rectangle(extent=[-100, 40; 100, -42], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Text(
+        extent=[-110, 62; -110, 50],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Reac"),
+      Text(
+        extent=[-110, -18; -110, -30],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Pres"),
+      Text(
+        extent=[-88, 60; 92, -56],
+        style(color=3, rgbcolor={0,0,255}),
+        string="CinetiqueNeutronique"),
+      Text(
+        extent=[112, 72; 112, 60],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Pneut"),
+      Text(
+        extent=[110, 36; 110, 24],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Ptot"),
+      Text(
+        extent=[112, 4; 112, -8],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Puo2"),
+      Text(
+        extent=[112, -30; 112, -42],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Ph2o")),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end NeutronKinetics;
diff --git a/ThermoSysPro/NuclearCore/ReactivityFeedbacks.mo b/ThermoSysPro/NuclearCore/ReactivityFeedbacks.mo
new file mode 100644
index 0000000000000000000000000000000000000000..9f2e1374886a650cdbe0c206b372531bce142516
--- /dev/null
+++ b/ThermoSysPro/NuclearCore/ReactivityFeedbacks.mo
@@ -0,0 +1,377 @@
+within ThermoSysPro.NuclearCore;
+model ReactivityFeedbacks "This module calculates the neutronic feedback reactions due to the control rods, the Doppler effect, the moderator, 
+  the boron and the xenon for a punctual neutronic flux. The emergency shutdown (SCRAM) of the reactor is not considered 
+  in this module."
+
+  parameter Real alfa_dop=-2 "Doppler coefficient (pcm/K)";
+  parameter ThermoSysPro.Units.SI.Temperature t0_doppler=944
+    "Doppler Temperature associated (K)";
+  parameter Real L=200 "Length of the control rods (cm)";
+//  parameter Real step_size= L/25;
+  // parameter Real Reac_worth_G=1250;
+ //  parameter Real Reac_worth_R=30;
+ // Ediffg0 = Reac_worth_G/L (pcm/cm);
+ // Ediffr0 = Reac_worth_R/L (pcm/cm);
+ // parameter Integer g_rods_number = 10 "Total number of control rods assemblies of the group G";
+ // parameter Integer r_rods_number = 20 "Total number of control rods assemblies of the group R";
+ parameter Boolean steady_state = true;
+
+  parameter Real PosR0=0 "Control rods initial position is assumed to be 0, the control
+  rods are completely extracted from the core";
+
+  parameter Real alfa_mod = -60 "Moderator Coefficient (pcm/K)";
+  parameter ThermoSysPro.Units.SI.Temperature Tref_core = 585.45;
+  parameter Real kxe=-1;
+  parameter Real Cxenon0=0 "Xenon reference concentration (ppm)";
+  parameter ThermoSysPro.Units.SI.Temperature Tref_fuel(start=973.15, fixed=false)
+    "fuel effective reference temperature (K)";
+
+  parameter Real XPosgYEdiffg[27, 2]=[25*8, -62.5; 24*8, -62.5; 23*8, -62.5; 22*8, -62.5; 21*8, -62.5; 20*8, -62.5; 19*8, -62.5;
+   18*8, -62.5; 17*8, -62.5; 16*8, -62.5; 15*8, -62.5; 14*8, -62.5; 13*8, -62.5; 12*8, -62.5; 11*8, -62.5; 10*8, -62.5;
+   9*8, -62.5; 8*8, -62.5; 7*8, -62.5; 6*8, -62.5; 5*8, -62.5; 4*8, -62.5; 3*8, -62.5; 2*8, -62.5; 8, -62.5; 0, -62.5; 0, 0]
+    "XPosgYEdiffg (input = first column, output = second column)";
+  parameter Real XPosrYEdiffr[27, 2]=[25*8, -3; 24*8, -3; 23*8, -3; 22*8, -3; 21*8, -3; 20*8, -3; 19*8, -3;
+   18*8, -3; 17*8, -3; 16*8, -3; 15*8, -3; 14*8, -3; 13*8, -3; 12*8, -3; 11*8, -3; 10*8, -3;
+   9*8, -3; 8*8, -3; 7*8, -3; 6*8, -3; 5*8, -3; 4*8, -3; 3*8, -3; 2*8, -3; 8, -3; 0, -3; 0, 0]
+    "XPosrYEdiffr (input = first column, output = second column)";
+
+protected
+  parameter Real XPosg[1, :]=transpose(matrix(XPosgYEdiffg[:, 1]))
+    "Inputs of the table";
+  parameter Real YEdiffg[1, :]=transpose(matrix(XPosgYEdiffg[:, 2]))
+    "Outputs of the table";
+  parameter Integer ng[1, 1]=[size(XPosg, 2)] "Size of the table";
+  parameter Real XPosr[1, :]=transpose(matrix(XPosrYEdiffr[:, 1]))
+    "Inputs of the table";
+  parameter Real YEdiffr[1, :]=transpose(matrix(XPosrYEdiffr[:, 2]))
+    "Outputs of the table";
+  parameter Integer nr[1, 1]=[size(XPosr, 2)] "Size of the table";
+
+public
+  Real PosR(start=0, fixed=true) "Position of group R (cm)";
+  Real VelR "Velocity of group R (cm/min)";
+  Real PosG "Position of the grey group (cm)";
+  Real T_fuel "Fuel effective temperature (K)";
+  Real T_CoreAv "Average temperature of the moderator in the core (K)";
+  Real Cbore "Concentration of the boron";
+  Real Cxenon "Concentration of the xénon";
+
+  Real Reac "Total reactivity (pcm)";
+  Real ReacB "Reactivity given by the control bars (pcm)";
+ Real ReacBG
+    "Reactivity given by the control bars of group G (pcm)";
+ Real ReacBR
+    "Reactivity given by the control bars of group R (pcm)";
+ Real ReacD
+    "Reactivity given by the Doppler effect (fuel temperature) (pcm)";
+ Real ReacM "Reactivity given by the moderator effect (pcm)";
+ Real ReacX "Reactivity given by the Xenon (pcm)";
+
+  Real Ediffg "Differential efficiency of the grey group (pcm/cm)";
+  Real Ediffr "Differential efficiency of group R (pcm/cm)";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortieReac
+    annotation (extent=[100, 70; 120, 90], Placement(transformation(extent={{100,-16},{120,
+            4}},               rotation=0), iconTransformation(extent={{100,-16},{120,4}})));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreeCbore
+    annotation (extent=[-120, -70; -100, -50], Placement(transformation(extent=
+            {{-120,-70},{-100,-50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreeT_CoreAv
+    annotation (extent=[-120, -30; -100, -10], Placement(transformation(extent=
+            {{-120,-30},{-100,-10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreeT_fuel
+    annotation (extent=[-120, 10; -100, 30], Placement(transformation(extent={{
+            -120,10},{-100,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreePosG
+    annotation (extent=[-120, 50; -100, 70], Placement(transformation(extent={{
+            -120,50},{-100,70}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreeVelR
+    annotation (extent=[-120, 90; -100, 110], Placement(transformation(extent={
+            {-120,90},{-100,110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreeCxenon
+    annotation (extent=[-120, -110; -100, -90], Placement(transformation(extent=
+           {{-120,-110},{-100,-90}}, rotation=0)));
+initial equation
+  ReacBG = 0;
+  ReacBR = Ediffr*(PosR - PosR0);
+  Tref_fuel=T_fuel;
+
+ if steady_state then
+   Reac=0;
+   //Tref_fuel=T_fuel;
+ end if;
+
+equation
+  Reac = SortieReac.signal;
+  der(PosR) = VelR/60;
+  VelR = EntreeVelR.signal;
+  PosG = EntreePosG.signal;
+  T_fuel = EntreeT_fuel.signal;
+  T_CoreAv = EntreeT_CoreAv.signal;
+  Cbore = EntreeCbore.signal;
+  Cxenon = EntreeCxenon.signal;
+
+  /* Total reactivity given by the control bars */
+  ReacB = ReacBR + ReacBG;
+
+  Ediffg = ThermoSysPro.Functions.LinearInterpolation(XPosgYEdiffg[:, 1], XPosgYEdiffg[:, 2], PosG);
+  der(ReacBG) = Ediffg*der(PosG);
+
+  Ediffr = ThermoSysPro.Functions.LinearInterpolation(XPosrYEdiffr[:, 1], XPosrYEdiffr[:, 2], PosR);
+  der(ReacBR) = Ediffr*der(PosR);
+
+  ReacD = alfa_dop*(T_fuel-Tref_fuel);
+
+  /* Reactivity given by the moderator effect */
+
+  ReacM = alfa_mod*(T_CoreAv-Tref_core);
+
+  /* Reactivity given by the Xenon*/
+  ReacX = kxe*(Cxenon - Cxenon0);
+
+  /* Total reactivity*/
+  Reac = ReacB + ReacD + ReacM + ReacX;
+
+  annotation (Icon(
+      graphics={
+        Text(
+          extent={{-136,-78},{-136,-90}},
+          textColor={0,0,255},
+          textString=
+               "Cxenon"),
+        Text(
+          extent={{-136,-38},{-136,-50}},
+          textColor={0,0,255},
+          textString=
+               "Cbore"),
+        Text(
+          extent={{-136,2},{-136,-10}},
+          textColor={0,0,255},
+          textString=
+               "T_CoreAv"),
+        Text(
+          extent={{-136,42},{-136,30}},
+          textColor={0,0,255},
+          textString=
+               "T_fuel"),
+        Text(
+          extent={{-136,82},{-136,70}},
+          textColor={0,0,255},
+          textString=
+               "PosG"),
+        Text(
+          extent={{124,18},{124,6}},
+          textColor={0,0,255},
+          textString=
+               "Reac"),
+        Ellipse(
+          extent={{-100,100},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Ellipse(
+          extent={{-100,20},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Rectangle(
+          extent={{-100,40},{100,-42}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}),
+        Text(
+          extent={{-82,102},{82,-98}},
+          textColor={0,0,255},
+          textString=
+               "%name")},
+      Text(
+        extent=[-136, -78; -136, -90],
+        style(color=3, rgbcolor={0,0,255}),
+        string="Cxenon"),
+      Text(
+        extent=[-136, -38; -136, -50],
+        style(color=3, rgbcolor={0,0,255}),
+        string="Cbore"),
+      Text(
+        extent=[-136, 2; -136, -10],
+        style(color=3, rgbcolor={0,0,255}),
+        string="T_CoreAv"),
+      Text(
+        extent=[-136, 42; -136, 30],
+        style(color=3, rgbcolor={0,0,255}),
+        string="T_fuel"),
+      Text(
+        extent=[-136, 82; -136, 70],
+        style(color=3, rgbcolor={0,0,255}),
+        string="PosG"),
+      Text(
+        extent=[136, 102; 136, 90],
+        style(color=3, rgbcolor={0,0,255}),
+        string="Reac"),
+      Text(
+        extent=[136, -60; 136, -72],
+        style(color=3, rgbcolor={0,0,255}),
+        string="ReacX"),
+      Text(
+        extent=[136, -20; 136, -32],
+        style(color=3, rgbcolor={0,0,255}),
+        string="ReacM"),
+      Text(
+        extent=[136, 20; 136, 8],
+        style(color=3, rgbcolor={0,0,255}),
+        string="ReacD"),
+      Text(
+        extent=[136, 60; 136, 48],
+        style(color=3, rgbcolor={0,0,255}),
+        string="ReacB"),
+      Ellipse(extent=[-100, 100; 100, -20], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Ellipse(extent=[-100, 20; 100, -100], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Rectangle(extent=[-100, 40; 100, -42], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Text(
+        extent=[-82, 102; 82, -98],
+        style(color=3, rgbcolor={0,0,255}),
+        string="%name")), Diagram(
+      graphics={
+        Ellipse(
+          extent={{-100,102},{100,-18}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Ellipse(
+          extent={{-100,22},{100,-98}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Rectangle(
+          extent={{-100,42},{100,-40}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}),
+        Text(
+          extent={{-76,102},{82,-98}},
+          textColor={0,0,255},
+          textString="Reactivity Feedback"),
+        Text(
+          extent={{-112,124},{-112,112}},
+          textColor={0,0,255},
+          textString=
+               "PosR"),
+        Text(
+          extent={{-114,84},{-114,72}},
+          textColor={0,0,255},
+          textString=
+               "PosG"),
+        Text(
+          extent={{-116,44},{-116,32}},
+          textColor={0,0,255},
+          textString=
+               "T_fuel"),
+        Text(
+          extent={{-114,4},{-114,-8}},
+          textColor={0,0,255},
+          textString=
+               "T_CoreAv"),
+        Text(
+          extent={{-114,-36},{-114,-48}},
+          textColor={0,0,255},
+          textString=
+               "Cbore"),
+        Text(
+          extent={{-114,-76},{-114,-88}},
+          textColor={0,0,255},
+          textString=
+               "Cxenon"),
+        Text(
+          extent={{106,82},{106,70}},
+          textColor={0,0,255},
+          textString=
+               "Reac")},
+      Ellipse(extent=[-100, 102; 100, -18], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Ellipse(extent=[-100, 22; 100, -98], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Rectangle(extent=[-100, 42; 100, -40], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Text(
+        extent=[-76, 104; 82, -96],
+        style(color=3, rgbcolor={0,0,255}),
+        string="AntiReac"),
+      Text(
+        extent=[-112, 124; -112, 112],
+        style(color=3, rgbcolor={0,0,255}),
+        string="PosR"),
+      Text(
+        extent=[-114, 84; -114, 72],
+        style(color=3, rgbcolor={0,0,255}),
+        string="PosG"),
+      Text(
+        extent=[-116, 44; -116, 32],
+        style(color=3, rgbcolor={0,0,255}),
+        string="T_fuel"),
+      Text(
+        extent=[-114, 4; -114, -8],
+        style(color=3, rgbcolor={0,0,255}),
+        string="T_CoreAv"),
+      Text(
+        extent=[-114, -36; -114, -48],
+        style(color=3, rgbcolor={0,0,255}),
+        string="Cbore"),
+      Text(
+        extent=[-114, -76; -114, -88],
+        style(color=3, rgbcolor={0,0,255}),
+        string="Cxenon"),
+      Text(
+        extent=[116, 104; 116, 92],
+        style(color=3, rgbcolor={0,0,255}),
+        string="Reac"),
+      Text(
+        extent=[116, -58; 116, -70],
+        style(color=3, rgbcolor={0,0,255}),
+        string="ReacX"),
+      Text(
+        extent=[116, -18; 116, -30],
+        style(color=3, rgbcolor={0,0,255}),
+        string="ReacM"),
+      Text(
+        extent=[116, 22; 116, 10],
+        style(color=3, rgbcolor={0,0,255}),
+        string="ReacD"),
+      Text(
+        extent=[116, 62; 116, 50],
+        style(color=3, rgbcolor={0,0,255}),
+        string="ReacB")),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end ReactivityFeedbacks;
diff --git a/ThermoSysPro/NuclearCore/ResidualPower.mo b/ThermoSysPro/NuclearCore/ResidualPower.mo
new file mode 100644
index 0000000000000000000000000000000000000000..f862fee6cfd2112e978600e338e7835fb50c5fe6
--- /dev/null
+++ b/ThermoSysPro/NuclearCore/ResidualPower.mo
@@ -0,0 +1,211 @@
+within ThermoSysPro.NuclearCore;
+model ResidualPower "Calculation of the residual power given by the decay of the fission
+  products in the core of the nuclear reactor; maximum 6 groups of radio-isotopes are considered."
+
+  parameter Real Kris[:]={0.0251,0.01654,0.02586}
+    "Fraction of the power associated to group i";
+  parameter Real Tris[:]={15,137,2910}
+    "Time constant associated to group i (s)";
+  parameter Boolean steady_state=false;
+
+protected
+  parameter Integer N=size(Kris, 1) "Number of groups of radio-isotopes";
+
+public
+  ThermoSysPro.Units.SI.Power Pneut(start=3560e6) "Total neutronic power (W)";
+  ThermoSysPro.Units.SI.Power PresTot "Total residual power (W)";
+  ThermoSysPro.Units.SI.Power Pres[N](start={89.35e6,58.88e6,92.05e6})
+    "Residual power associated to the groups of radio-isotopes (W)";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal EntreePneut
+    annotation (extent=[-120, -10; -100, 10], Placement(transformation(extent={
+            {-120,-10},{-100,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal SortiePresTot
+    annotation (extent=[100, -10; 120, 10], Placement(transformation(extent={{
+            100,-10},{120,10}}, rotation=0)));
+initial equation
+
+  if steady_state then
+
+    for i in 1:N loop
+
+      der(Pres[i]) = 0;
+
+    end for;
+
+  else
+    Pres = {89.35e6,58.88e6,92.05e6};
+
+  end if;
+
+equation
+  Pneut = EntreePneut.signal;
+  PresTot = SortiePresTot.signal;
+
+  PresTot = sum(Pres);
+
+  for i in 1:N loop
+
+    der(Pres[i]) = (Kris[i]*Pneut - Pres[i])/Tris[i];
+
+  end for;
+
+  annotation (Icon(
+      graphics={
+        Ellipse(
+          extent={{-100,100},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Ellipse(
+          extent={{-100,20},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Rectangle(
+          extent={{-100,40},{100,-42}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}),
+        Text(
+          extent={{-78,90},{78,-96}},
+          textColor={0,0,0},
+          textString=
+               "%name"),
+        Text(
+          extent={{-132,28},{-132,16}},
+          textColor={0,0,0},
+          textString=
+               "Pneut"),
+        Text(
+          extent={{130,26},{130,14}},
+          textColor={0,0,0},
+          textString=
+               "Pres")},
+      Ellipse(extent=[-100, 100; 100, -20], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Ellipse(extent=[-100, 20; 100, -100], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Rectangle(extent=[-100, 40; 100, -42], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Text(
+        extent=[-78, 90; 78, -96],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="%name"),
+      Text(
+        extent=[-132, 28; -132, 16],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Pneut"),
+      Text(
+        extent=[130, 26; 130, 14],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Pres")), Diagram(
+      graphics={
+        Ellipse(
+          extent={{-100,100},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Ellipse(
+          extent={{-100,20},{100,-100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,128,0}),
+        Rectangle(
+          extent={{-100,40},{100,-42}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,128,0}),
+        Text(
+          extent={{-76,74},{80,-74}},
+          textColor={0,0,0},
+          textString="Residual Power"),
+        Text(
+          extent={{116,24},{116,12}},
+          textColor={0,0,0},
+          textString=
+               "Pres"),
+        Text(
+          extent={{-118,24},{-118,12}},
+          textColor={0,0,0},
+          textString=
+               "Pneut")},
+      Ellipse(extent=[-100, 100; 100, -20], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Ellipse(extent=[-100, 20; 100, -100], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=3,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Rectangle(extent=[-100, 40; 100, -42], style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0})),
+      Text(
+        extent=[-76, 74; 80, -74],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="PuissResiduelle"),
+      Text(
+        extent=[116, 24; 116, 12],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Pres"),
+      Text(
+        extent=[-118, 24; -118, 12],
+        style(
+          color=3,
+          rgbcolor={0,0,255},
+          gradient=1,
+          fillColor=45,
+          rgbfillColor={255,128,0}),
+        string="Pneut")),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end ResidualPower;
diff --git a/ThermoSysPro/NuclearCore/Xenon.mo b/ThermoSysPro/NuclearCore/Xenon.mo
new file mode 100644
index 0000000000000000000000000000000000000000..90bf6e910fafb8b841f6c0cef50aba4127637b3e
--- /dev/null
+++ b/ThermoSysPro/NuclearCore/Xenon.mo
@@ -0,0 +1,68 @@
+within ThermoSysPro.NuclearCore;
+model Xenon "xenon as fission product"
+  parameter Boolean steady_state = true "Steady-state (true) or fixed values (false) initialization";
+  parameter Real Xe_start = 0 "Initial concentration of Xenon (if steady_state=false)" annotation (Dialog(enable=not steady_state));
+  parameter Real I_start = 0 "Initial concentration of Iode (if steady_state=false)" annotation (Dialog(enable=not steady_state));
+  parameter ThermoSysPro.Units.SI.Power NominalThPower = 2768e6 "Nominal Thermal Power";
+  parameter ThermoSysPro.Units.SI.Mass FuelMass = 72376 "Nuclear Fuel Mass";
+  parameter Real Enrichment = 0.02433 "Fuel enrichement";
+  constant ThermoSysPro.Units.SI.Energy FissionEnergy = 3.09e-11 "Power from each fission";
+  constant Real FastFissionFactor = 1.07 "Fast Fission Factor";
+  constant ThermoSysPro.Units.SI.Area microCrossSection = 5.795e-26 "Fuel microscopic fission cross-section";
+  constant Real AtomicMass = 235.04393 "Fuel atomic mass";
+  ThermoSysPro.Units.SI.Frequency FissionRate "Reactor Fission Rate";
+  ThermoSysPro.Units.SI.Frequency ThFissionRate "Thermal Fission Rate";
+  ThermoSysPro.Units.SI.Mass FissilMass "Mass of fissil fuel";
+  Real U_235 "Number of 235Uranium nuclei";
+  constant Real I_yield = 0.064 "Total fission yield of 135Iode";
+  constant Real Xe_yield = 0.0025 "Total fission yield of 135Xenon";
+  constant ThermoSysPro.Units.SI.Frequency I_decay = 2.874e-5 "Decay constant of 135Iode";
+  constant ThermoSysPro.Units.SI.Frequency Xe_decay = 2.027e-5 "Decay constant of 135Xenon";
+  constant ThermoSysPro.Units.SI.Area Xe_abs_CS = 2.75e-22 "Microscopic absorption cross-section of 135Xenon";
+  ThermoSysPro.Units.SI.Power power "Thermal Nuclear Power";
+  Real I_135 "Number of 135Iode nuclei";
+  Real Xe_135 "Number of 135Xenon nuclei";
+  ThermoSysPro.Units.SI.NeutronFluenceRate NeutronFlux "Neutron Flux";
+  ThermoSysPro.Units.SI.Frequency FissionProduction "";
+  ThermoSysPro.Units.SI.Frequency DecayProduction "";
+  ThermoSysPro.Units.SI.Frequency DecayRemoval "";
+  ThermoSysPro.Units.SI.Frequency AbsorptionRemoval "";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wrel
+    annotation (Placement(transformation(extent={{-92,-10},{-72,10}})));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Xe
+    annotation (Placement(transformation(extent={{72,-52},{92,-32}})));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal I
+    annotation (Placement(transformation(extent={{72,30},{92,50}})));
+initial equation
+  if steady_state then
+    der(I_135) = 0;
+    der(Xe_135) = 0;
+  else
+    I_135 = I_start;
+    Xe_135 = Xe_start;
+  end if;
+equation
+  Xe.signal = Xe_135;
+  I.signal = I_135;
+  power = FissionEnergy*FissionRate;
+  ThFissionRate = FissionRate/FastFissionFactor;
+  ThFissionRate = NeutronFlux * microCrossSection * U_235;
+  FissilMass = FuelMass * Enrichment;
+  U_235 = FissilMass * 1000 / AtomicMass * Modelica.Constants.N_A;
+  power = Wrel.signal * NominalThPower;
+  der(I_135) = ThFissionRate*I_yield - I_135*I_decay;
+  der(Xe_135) = ThFissionRate*Xe_yield + I_135*I_decay - Xe_135*Xe_decay - NeutronFlux*Xe_135*Xe_abs_CS;
+  FissionProduction = power/FissionEnergy*Xe_yield;
+  DecayProduction = I_135*I_decay;
+  DecayRemoval = Xe_135*Xe_decay;
+  AbsorptionRemoval = NeutronFlux*Xe_135*Xe_abs_CS;
+  annotation (                                   Icon(graphics={
+        Rectangle(extent={{-80,80},{80,-80}}, lineColor={28,108,200},
+          fillColor={255,128,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-60,66},{60,-56}},
+          lineColor={0,140,72},
+          textString="Xe",
+          textStyle={TextStyle.Bold})}));
+end Xenon;
diff --git a/ThermoSysPro/NuclearCore/package.mo b/ThermoSysPro/NuclearCore/package.mo
new file mode 100644
index 0000000000000000000000000000000000000000..119d130848b213e874c56cf9a0dfc2e302ad27c4
--- /dev/null
+++ b/ThermoSysPro/NuclearCore/package.mo
@@ -0,0 +1,118 @@
+within ThermoSysPro;
+package NuclearCore "Library to model a nuclear core"
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end NuclearCore;
diff --git a/ThermoSysPro/NuclearCore/package.order b/ThermoSysPro/NuclearCore/package.order
new file mode 100644
index 0000000000000000000000000000000000000000..60d34fdbed6d07bf6146b888027e3884e21f3968
--- /dev/null
+++ b/ThermoSysPro/NuclearCore/package.order
@@ -0,0 +1,5 @@
+Xenon
+FuelThermalPower
+ReactivityFeedbacks
+ResidualPower
+NeutronKinetics
diff --git a/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo b/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo
index 45a916c7bcffc3c1c25639353522dd106a4beee9..32ad957a0f5858fc35e57b24cc88fa4ff37f8483 100644
--- a/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo
+++ b/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo
@@ -1,131 +1,131 @@
-within ThermoSysPro.Properties.C3H3F5;
-function C3H3F5_Ph "11133-C3H3F5 physical properties as a function of P and h"
-  input Units.SI.AbsolutePressure P "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-protected
-  Units.SI.Temperature Tsat "Saturation temperature";
-  Units.SI.AbsolutePressure Psc "Critical pressure";
-  Units.SI.AbsolutePressure Pcalc
-    "Variable for the computation of the pressure";
-  Units.SI.SpecificEnthalpy hcalc
-    "Variable for the computation of the specific  enthalpy";
-  Units.SI.SpecificEnthalpy hsatL "Boiling specific enthalpy";
-  Units.SI.SpecificEnthalpy hsatV "Condensation specific enthalpy";
-  Units.SI.SpecificEntropy ssatL "Boiling specific entropy";
-  Units.SI.SpecificEntropy ssatV "Condensation specific entropy";
-  Units.SI.Density rhoSatL "Boiling density";
-  Units.SI.Density rhoSatV "Condensation density";
-  Real A1;
-  Real B1;
-  Real C1;
-  Real A2;
-  Real B2;
-  Real C2;
-  Real D2;
-  Real A3;
-  Real B3;
-  Real C3;
-
-public
-  output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-                     annotation (Placement(transformation(extent={{-100,80},{
-            -80,100}}, rotation=0)));
-algorithm
-
-  /* Critical pressure */
-  Psc := 3640000;
-
-  /* Tests : the function is only valid for P > 0, P < Pcritique, h > 100 kJ/kg and h < 640 kJ/kg */
-  if (P > Psc) then
-    Pcalc := Psc/100000;
-  elseif (P <= 0) then
-    Pcalc := 1/100000;
-  else
-    Pcalc := P/100000;
-  end if;
-
-  if (h > 640000) then
-    hcalc := 640;
-  elseif (h < 100000) then
-    hcalc := 100;
-  else
-    hcalc := h/1000;
-  end if;
-
-  /* Properties on the saturation line */
-  hsatV := -0.00000274*Pcalc^6 + 0.00032217*Pcalc^5 - 0.01489673*Pcalc^4 + 0.34258030*Pcalc^3
-            - 4.15381744*Pcalc^2 + 27.64876596*Pcalc + 385.22149853;
-  hsatL := -0.0000039275*Pcalc^6 + 0.0004780040*Pcalc^5 - 0.0227439765*Pcalc^4 + 0.5370471515*Pcalc^3
-            - 6.6496487588*Pcalc^2 + 46.8685173786*Pcalc + 166.7823742593;
-  ssatV := 1000*(0.0000000017*Pcalc^6 - 0.0000002159*Pcalc^5 + 0.0000102230*Pcalc^4 - 0.0002295813*Pcalc^3
-            + 0.0023692545*Pcalc^2 - 0.0062966866*Pcalc + 1.7667560947);
-  ssatL := 1000*(-0.0000000164*Pcalc^6 + 0.0000019814*Pcalc^5 - 0.0000934768*Pcalc^4 + 0.0021827510*Pcalc^3
-            - 0.0265228817*Pcalc^2 + 0.1740890297*Pcalc + 0.8685336198);
-  rhoSatL := 0.0000057803*Pcalc^6 - 0.0007528646*Pcalc^5 + 0.0377373800*Pcalc^4 - 0.9314090824*Pcalc^3
-            + 11.9184348938*Pcalc^2 - 89.9582798898*Pcalc + 1467.5902188299;
-  rhoSatV := 0.00000207*Pcalc^6 - 0.00019163*Pcalc^5 + 0.00675913*Pcalc^4 - 0.10924667*Pcalc^3
-            + 0.84661954*Pcalc^2 + 2.83415571*Pcalc + 2.12959146;
-
-  Tsat := -0.0000033655*Pcalc^6 + 0.0004044854*Pcalc^5 - 0.0190328128*Pcalc^4 + 0.4443722095*Pcalc^3
-          - 5.4337547883*Pcalc^2 + 36.7572359309*Pcalc + 246.4280421048;
-
-  /* Determination of the property zone (liquid, two-phase or steam) and compuation of the properties */
-  if ((hcalc >= hsatL) and (hcalc <= hsatV)) then
-      /* Two-phase zone */
-      pro.T := Tsat;
-      pro.x := (hcalc - hsatL) / (hsatV - hsatL);
-      pro.d := rhoSatL*(1-pro.x) + rhoSatV * pro.x;
-      pro.s := ssatL*(1-pro.x) + ssatV * pro.x;
-
-  elseif (hcalc < hsatL) then
-      /* Liquid zone */
-      pro.T := -0.0005311*hcalc^2 + 0.9990391*hcalc + 93.9602333;
-      if (pro.T > Tsat) then
-          pro.T := Tsat;
-      end if;
-      pro.x := 0;
-      pro.d := -0.0000154*hcalc^3 + 0.0095634*hcalc^2 - 3.8184877*hcalc + 1916.6958695;
-      if (pro.d < rhoSatL) then
-          pro.d := rhoSatL;
-      end if;
-      pro.s := 1000*(-0.0000037*hcalc^2 + 0.0051600*hcalc + 0.1002293);
-      if (pro.s > ssatL) then
-          pro.s := ssatL;
-      end if;
-  else
-      /* Steam zone */
-      A1 := 0.0000698*Pcalc - 0.0008618;
-      B1 := -0.0858201*Pcalc + 1.8849272;
-      C1 := 27.0570743*Pcalc - 353.7594967;
-      pro.T := A1*hcalc^2 + B1*hcalc + C1;
-      if (pro.T < Tsat) then
-          pro.T := Tsat;
-      end if;
-      pro.x := 1;
-      A2 :=  -0.0000000958*Pcalc^2 + 0.0000006742*Pcalc - 0.0000002691;
-      B2 := 0.0001689*Pcalc^2 - 0.0011644*Pcalc + 0.0004690;
-      C2 := -0.0995131*Pcalc^2 + 0.6639841*Pcalc - 0.2724718;
-      D2 :=  19.6224804*Pcalc^2 - 121.4944333*Pcalc + 52.8361115;
-      pro.d := A2*hcalc^3 + B2*hcalc^2 + C2*hcalc + D2;
-      if (pro.d > rhoSatV) then
-          pro.d := rhoSatV;
-      end if;
-      A3 := -0.0000000032*Pcalc^2 + 0.0000001779*Pcalc - 0.0000037134;
-      B3 := 0.0000034*Pcalc^2 - 0.0001957*Pcalc + 0.0064718;
-      C3 :=  -0.0001958*Pcalc^2 + 0.0194928*Pcalc - 0.1696592;
-      pro.s := 1000*(A3*hcalc^2 + B3*hcalc + C3);
-      if (pro.s < ssatV) then
-          pro.s := ssatV;
-      end if;
-  end if;
-  annotation (
-    smoothOrder = 2,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end C3H3F5_Ph;
+within ThermoSysPro.Properties.C3H3F5;
+function C3H3F5_Ph "11133-C3H3F5 physical properties as a function of P and h"
+  input Units.SI.AbsolutePressure P "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+protected
+  Units.SI.Temperature Tsat "Saturation temperature";
+  Units.SI.AbsolutePressure Psc "Critical pressure";
+  Units.SI.AbsolutePressure Pcalc
+    "Variable for the computation of the pressure";
+  Units.SI.SpecificEnthalpy hcalc
+    "Variable for the computation of the specific  enthalpy";
+  Units.SI.SpecificEnthalpy hsatL "Boiling specific enthalpy";
+  Units.SI.SpecificEnthalpy hsatV "Condensation specific enthalpy";
+  Units.SI.SpecificEntropy ssatL "Boiling specific entropy";
+  Units.SI.SpecificEntropy ssatV "Condensation specific entropy";
+  Units.SI.Density rhoSatL "Boiling density";
+  Units.SI.Density rhoSatV "Condensation density";
+  Real A1;
+  Real B1;
+  Real C1;
+  Real A2;
+  Real B2;
+  Real C2;
+  Real D2;
+  Real A3;
+  Real B3;
+  Real C3;
+
+public
+  output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+                     annotation (Placement(transformation(extent={{-100,80},{
+            -80,100}}, rotation=0)));
+algorithm
+
+  /* Critical pressure */
+  Psc := 3640000;
+
+  /* Tests : the function is only valid for P > 0, P < Pcritique, h > 100 kJ/kg and h < 640 kJ/kg */
+  if (P > Psc) then
+    Pcalc := Psc/100000;
+  elseif (P <= 0) then
+    Pcalc := 1/100000;
+  else
+    Pcalc := P/100000;
+  end if;
+
+  if (h > 640000) then
+    hcalc := 640;
+  elseif (h < 100000) then
+    hcalc := 100;
+  else
+    hcalc := h/1000;
+  end if;
+
+  /* Properties on the saturation line */
+  hsatV := -0.00000274*Pcalc^6 + 0.00032217*Pcalc^5 - 0.01489673*Pcalc^4 + 0.34258030*Pcalc^3
+            - 4.15381744*Pcalc^2 + 27.64876596*Pcalc + 385.22149853;
+  hsatL := -0.0000039275*Pcalc^6 + 0.0004780040*Pcalc^5 - 0.0227439765*Pcalc^4 + 0.5370471515*Pcalc^3
+            - 6.6496487588*Pcalc^2 + 46.8685173786*Pcalc + 166.7823742593;
+  ssatV := 1000*(0.0000000017*Pcalc^6 - 0.0000002159*Pcalc^5 + 0.0000102230*Pcalc^4 - 0.0002295813*Pcalc^3
+            + 0.0023692545*Pcalc^2 - 0.0062966866*Pcalc + 1.7667560947);
+  ssatL := 1000*(-0.0000000164*Pcalc^6 + 0.0000019814*Pcalc^5 - 0.0000934768*Pcalc^4 + 0.0021827510*Pcalc^3
+            - 0.0265228817*Pcalc^2 + 0.1740890297*Pcalc + 0.8685336198);
+  rhoSatL := 0.0000057803*Pcalc^6 - 0.0007528646*Pcalc^5 + 0.0377373800*Pcalc^4 - 0.9314090824*Pcalc^3
+            + 11.9184348938*Pcalc^2 - 89.9582798898*Pcalc + 1467.5902188299;
+  rhoSatV := 0.00000207*Pcalc^6 - 0.00019163*Pcalc^5 + 0.00675913*Pcalc^4 - 0.10924667*Pcalc^3
+            + 0.84661954*Pcalc^2 + 2.83415571*Pcalc + 2.12959146;
+
+  Tsat := -0.0000033655*Pcalc^6 + 0.0004044854*Pcalc^5 - 0.0190328128*Pcalc^4 + 0.4443722095*Pcalc^3
+          - 5.4337547883*Pcalc^2 + 36.7572359309*Pcalc + 246.4280421048;
+
+  /* Determination of the property zone (liquid, two-phase or steam) and compuation of the properties */
+  if ((hcalc >= hsatL) and (hcalc <= hsatV)) then
+      /* Two-phase zone */
+      pro.T := Tsat;
+      pro.x := (hcalc - hsatL) / (hsatV - hsatL);
+      pro.d := rhoSatL*(1-pro.x) + rhoSatV * pro.x;
+      pro.s := ssatL*(1-pro.x) + ssatV * pro.x;
+
+  elseif (hcalc < hsatL) then
+      /* Liquid zone */
+      pro.T := -0.0005311*hcalc^2 + 0.9990391*hcalc + 93.9602333;
+      if (pro.T > Tsat) then
+          pro.T := Tsat;
+      end if;
+      pro.x := 0;
+      pro.d := -0.0000154*hcalc^3 + 0.0095634*hcalc^2 - 3.8184877*hcalc + 1916.6958695;
+      if (pro.d < rhoSatL) then
+          pro.d := rhoSatL;
+      end if;
+      pro.s := 1000*(-0.0000037*hcalc^2 + 0.0051600*hcalc + 0.1002293);
+      if (pro.s > ssatL) then
+          pro.s := ssatL;
+      end if;
+  else
+      /* Steam zone */
+      A1 := 0.0000698*Pcalc - 0.0008618;
+      B1 := -0.0858201*Pcalc + 1.8849272;
+      C1 := 27.0570743*Pcalc - 353.7594967;
+      pro.T := A1*hcalc^2 + B1*hcalc + C1;
+      if (pro.T < Tsat) then
+          pro.T := Tsat;
+      end if;
+      pro.x := 1;
+      A2 :=  -0.0000000958*Pcalc^2 + 0.0000006742*Pcalc - 0.0000002691;
+      B2 := 0.0001689*Pcalc^2 - 0.0011644*Pcalc + 0.0004690;
+      C2 := -0.0995131*Pcalc^2 + 0.6639841*Pcalc - 0.2724718;
+      D2 :=  19.6224804*Pcalc^2 - 121.4944333*Pcalc + 52.8361115;
+      pro.d := A2*hcalc^3 + B2*hcalc^2 + C2*hcalc + D2;
+      if (pro.d > rhoSatV) then
+          pro.d := rhoSatV;
+      end if;
+      A3 := -0.0000000032*Pcalc^2 + 0.0000001779*Pcalc - 0.0000037134;
+      B3 := 0.0000034*Pcalc^2 - 0.0001957*Pcalc + 0.0064718;
+      C3 :=  -0.0001958*Pcalc^2 + 0.0194928*Pcalc - 0.1696592;
+      pro.s := 1000*(A3*hcalc^2 + B3*hcalc + C3);
+      if (pro.s < ssatV) then
+          pro.s := ssatV;
+      end if;
+  end if;
+  annotation (
+    smoothOrder = 2,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end C3H3F5_Ph;
diff --git a/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ps.mo b/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ps.mo
index c94e519f441ba0c8983f8d4d8f08cefc9648272a..24297b4996315f0e873d07960405f1b5f9196c5f 100644
--- a/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ps.mo
+++ b/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ps.mo
@@ -1,106 +1,106 @@
-within ThermoSysPro.Properties.C3H3F5;
-function C3H3F5_Ps "11133-C3H3F5 physical properties as a function of P and s"
-  input Units.SI.AbsolutePressure P "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-
-protected
-  Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  Units.SI.AbsolutePressure Psc "Critical pressure";
-  Units.SI.AbsolutePressure Pcalc
-    "Variable for the computation of the pressure";
-  Units.SI.SpecificEntropy scalc
-    "Variable for the computation of the specific entropy";
-  Units.SI.SpecificEnthalpy hsatL "Boiling specific enthalpy";
-  Units.SI.SpecificEnthalpy hsatV "Condensation specific enthalpy";
-  Units.SI.SpecificEntropy ssatL "Boiling specific entropy";
-  Units.SI.SpecificEntropy ssatV "Condensation specific entropy";
-  Real x "Vapor mass fraction";
-  Real A;
-  Real B;
-  Real C;
-
-public
-  output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-                     annotation (Placement(transformation(extent={{-60,80},{-40,
-            100}}, rotation=0)));
-algorithm
-
-  /* Critical pressure */
-  Psc := 3640000;
-
-  /* Tests : the function is only valid for P > 0, P < Pcritique, h > 0.6 kJ/kg and h < 2.52 kJ/kg */
-  if (P > Psc) then
-    Pcalc := Psc/100000;
-  elseif (P <= 0) then
-    Pcalc := 1/100000;
-  else
-    Pcalc := P/100000;
-  end if;
-
-  if (s > 2520) then
-    scalc := 2.52;
-  elseif (s < 600) then
-    scalc := 0.6;
-  else
-    scalc := s/1000;
-  end if;
-
-  /* Properties on the saturation line */
-  hsatV := -0.00000274*Pcalc^6 + 0.00032217*Pcalc^5 - 0.01489673*Pcalc^4 + 0.34258030*Pcalc^3
-            - 4.15381744*Pcalc^2 + 27.64876596*Pcalc + 385.22149853;
-  hsatL := -0.0000039275*Pcalc^6 + 0.0004780040*Pcalc^5 - 0.0227439765*Pcalc^4 + 0.5370471515*Pcalc^3
-            - 6.6496487588*Pcalc^2 + 46.8685173786*Pcalc + 166.7823742593;
-  ssatV := 0.0000000017*Pcalc^6 - 0.0000002159*Pcalc^5 + 0.0000102230*Pcalc^4 - 0.0002295813*Pcalc^3
-            + 0.0023692545*Pcalc^2 - 0.0062966866*Pcalc + 1.7667560947;
-  ssatL := -0.0000000164*Pcalc^6 + 0.0000019814*Pcalc^5 - 0.0000934768*Pcalc^4 + 0.0021827510*Pcalc^3
-            - 0.0265228817*Pcalc^2 + 0.1740890297*Pcalc + 0.8685336198;
-
-  /* Determination of the property zone (liquid, two-phase or steam) and compuation of the properties */
-  if ((scalc >= ssatL) and (scalc <= ssatV)) then
-      /* Two-phase zone */
-      x := (scalc - ssatL) / (ssatV - ssatL);
-      h := 1000*(hsatL*(1-x) + hsatV * x);
-
-  elseif (scalc < ssatL) then
-      /* Liquid zone */
-      x := 0;
-      h := 1000*(112.482*scalc^2 + 50.525*scalc + 39.292);
-      if (h > hsatL) then
-          h := 1000*hsatL;
-      end if;
-  else
-      /* Steam zone */
-      x := 1;
-      A :=  -0.0396219*Pcalc^2 + 0.2873498*Pcalc + 185.5998054;
-      B := -0.1114991*Pcalc^2 + 12.8417980*Pcalc - 415.1029137;
-      C :=   0.1219352*Pcalc^2 - 13.8031170*Pcalc + 540.5578010;
-      h := 1000*(A*scalc^2 + B*scalc + C);
-      if (h < hsatV) then
-          h := 1000*hsatV;
-      end if;
-  end if;
-
-  pro := C3H3F5_Ph(P,h);
-
-  props.T := pro.T;
-  props.d := pro.d;
-  props.u := pro.u;
-  props.h := h;
-  props.cp := pro.cp;
-  props.x := x;
-
-  annotation (
-    smoothOrder = 2,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end C3H3F5_Ps;
+within ThermoSysPro.Properties.C3H3F5;
+function C3H3F5_Ps "11133-C3H3F5 physical properties as a function of P and s"
+  input Units.SI.AbsolutePressure P "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+
+protected
+  Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  Units.SI.AbsolutePressure Psc "Critical pressure";
+  Units.SI.AbsolutePressure Pcalc
+    "Variable for the computation of the pressure";
+  Units.SI.SpecificEntropy scalc
+    "Variable for the computation of the specific entropy";
+  Units.SI.SpecificEnthalpy hsatL "Boiling specific enthalpy";
+  Units.SI.SpecificEnthalpy hsatV "Condensation specific enthalpy";
+  Units.SI.SpecificEntropy ssatL "Boiling specific entropy";
+  Units.SI.SpecificEntropy ssatV "Condensation specific entropy";
+  Real x "Vapor mass fraction";
+  Real A;
+  Real B;
+  Real C;
+
+public
+  output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+                     annotation (Placement(transformation(extent={{-60,80},{-40,
+            100}}, rotation=0)));
+algorithm
+
+  /* Critical pressure */
+  Psc := 3640000;
+
+  /* Tests : the function is only valid for P > 0, P < Pcritique, h > 0.6 kJ/kg and h < 2.52 kJ/kg */
+  if (P > Psc) then
+    Pcalc := Psc/100000;
+  elseif (P <= 0) then
+    Pcalc := 1/100000;
+  else
+    Pcalc := P/100000;
+  end if;
+
+  if (s > 2520) then
+    scalc := 2.52;
+  elseif (s < 600) then
+    scalc := 0.6;
+  else
+    scalc := s/1000;
+  end if;
+
+  /* Properties on the saturation line */
+  hsatV := -0.00000274*Pcalc^6 + 0.00032217*Pcalc^5 - 0.01489673*Pcalc^4 + 0.34258030*Pcalc^3
+            - 4.15381744*Pcalc^2 + 27.64876596*Pcalc + 385.22149853;
+  hsatL := -0.0000039275*Pcalc^6 + 0.0004780040*Pcalc^5 - 0.0227439765*Pcalc^4 + 0.5370471515*Pcalc^3
+            - 6.6496487588*Pcalc^2 + 46.8685173786*Pcalc + 166.7823742593;
+  ssatV := 0.0000000017*Pcalc^6 - 0.0000002159*Pcalc^5 + 0.0000102230*Pcalc^4 - 0.0002295813*Pcalc^3
+            + 0.0023692545*Pcalc^2 - 0.0062966866*Pcalc + 1.7667560947;
+  ssatL := -0.0000000164*Pcalc^6 + 0.0000019814*Pcalc^5 - 0.0000934768*Pcalc^4 + 0.0021827510*Pcalc^3
+            - 0.0265228817*Pcalc^2 + 0.1740890297*Pcalc + 0.8685336198;
+
+  /* Determination of the property zone (liquid, two-phase or steam) and compuation of the properties */
+  if ((scalc >= ssatL) and (scalc <= ssatV)) then
+      /* Two-phase zone */
+      x := (scalc - ssatL) / (ssatV - ssatL);
+      h := 1000*(hsatL*(1-x) + hsatV * x);
+
+  elseif (scalc < ssatL) then
+      /* Liquid zone */
+      x := 0;
+      h := 1000*(112.482*scalc^2 + 50.525*scalc + 39.292);
+      if (h > hsatL) then
+          h := 1000*hsatL;
+      end if;
+  else
+      /* Steam zone */
+      x := 1;
+      A :=  -0.0396219*Pcalc^2 + 0.2873498*Pcalc + 185.5998054;
+      B := -0.1114991*Pcalc^2 + 12.8417980*Pcalc - 415.1029137;
+      C :=   0.1219352*Pcalc^2 - 13.8031170*Pcalc + 540.5578010;
+      h := 1000*(A*scalc^2 + B*scalc + C);
+      if (h < hsatV) then
+          h := 1000*hsatV;
+      end if;
+  end if;
+
+  pro := C3H3F5_Ph(P,h);
+
+  props.T := pro.T;
+  props.d := pro.d;
+  props.u := pro.u;
+  props.h := h;
+  props.cp := pro.cp;
+  props.x := x;
+
+  annotation (
+    smoothOrder = 2,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end C3H3F5_Ps;
diff --git a/ThermoSysPro/Properties/C3H3F5/package.mo b/ThermoSysPro/Properties/C3H3F5/package.mo
index b36e996ff67425beea954d5f8c4d0877256761a9..7b090dc0bcfe10fab241881d7a348200d327b8b9 100644
--- a/ThermoSysPro/Properties/C3H3F5/package.mo
+++ b/ThermoSysPro/Properties/C3H3F5/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro.Properties;
-package C3H3F5 "2 - C3H3F5 properties library"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>ThermoSysPro Version 3.2</b></h4>
-</HTML>"));
-end C3H3F5;
+within ThermoSysPro.Properties;
+package C3H3F5 "2 - C3H3F5 properties library"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>ThermoSysPro Version 3.2</b></h4>
+</HTML>"));
+end C3H3F5;
diff --git a/ThermoSysPro/Properties/C3H3F5/package.order b/ThermoSysPro/Properties/C3H3F5/package.order
index 57bd24f2050805554f2de7477f3271e18b9d9e92..86eb191324e554aab3f2f8db7037213db064e65f 100644
--- a/ThermoSysPro/Properties/C3H3F5/package.order
+++ b/ThermoSysPro/Properties/C3H3F5/package.order
@@ -1,2 +1,2 @@
-C3H3F5_Ph
-C3H3F5_Ps
+C3H3F5_Ph
+C3H3F5_Ps
diff --git a/ThermoSysPro/Properties/Common.mo b/ThermoSysPro/Properties/Common.mo
index 2b34749f13dd6e23426baca1b8b5d01f798360c0..5b95008427c0525eec94b2eb1ef2ba96a011ce3c 100644
--- a/ThermoSysPro/Properties/Common.mo
+++ b/ThermoSysPro/Properties/Common.mo
@@ -1,1955 +1,1955 @@
-within ThermoSysPro.Properties;
-package Common
-  "Data structures and fundamental functions for fluid properties"
-
-  type Rate = Real (final quantity="Rate", final unit="s-1");
-  type MolarFlowRate = Real (final quantity="MolarFlowRate", final unit="mol/s");
-  type MolarReactionRate = Real (final quantity="MolarReactionRate", final unit=
-         "mol/(m3.s)");
-  type MolarEnthalpy = Real (final quantity="MolarEnthalpy", final unit="J/mol");
-  type DerDensityByEntropy = Real (final quantity="DerDensityByEntropy", final
-        unit="kg2.K/(m3.J)");
-  type DerEnergyByPressure = Real (final quantity="DerEnergyByPressure", final
-        unit="J/Pa");
-  type DerEnergyByMoles = Real (final quantity="DerEnergyByMoles", final unit=
-          "J/mol");
-  type DerEntropyByTemperature = Real (final quantity="DerEntropyByTemperature",
-        final unit="J/K2");
-  type DerEntropyByPressure = Real (final quantity="DerEntropyByPressure",
-        final unit="J/(K.Pa)");
-  type DerEntropyByMoles = Real (final quantity="DerEntropyByMoles", final unit=
-         "J/(mol.K)");
-  type DerPressureByDensity = Real (final quantity="DerPressureByDensity",
-        final unit="Pa.m3/kg");
-  type DerPressureBySpecificVolume = Real (final quantity=
-          "DerPressureBySpecificVolume", final unit="Pa.kg/m3");
-  type DerPressureByTemperature = Real (final quantity=
-          "DerPressureByTemperature", final unit="Pa/K");
-  type DerVolumeByTemperature = Real (final quantity="DerVolumeByTemperature",
-        final unit="m3/K");
-  type DerVolumeByPressure = Real (final quantity="DerVolumeByPressure", final
-        unit="m3/Pa");
-  type DerVolumeByMoles = Real (final quantity="DerVolumeByMoles", final unit=
-          "m3/mol");
-  type IsenthalpicExponent = Real (final quantity="IsenthalpicExponent", unit=
-          "1");
-  type IsentropicExponent = Real (final quantity="IsentropicExponent", unit="1");
-  type IsobaricVolumeExpansionCoefficient = Real (final quantity=
-          "IsobaricVolumeExpansionCoefficient", unit="1/K");
-  type IsochoricPressureCoefficient = Real (final quantity=
-          "IsochoricPressureCoefficient", unit="1/K");
-  type IsothermalCompressibility = Real (final quantity=
-          "IsothermalCompressibility", unit="1/Pa");
-  type JouleThomsonCoefficient = Real (final quantity="JouleThomsonCoefficient",
-        unit="K/Pa");
-  // introduce min-manx-nominal values
-  constant Real MINPOS=1.0e-9
-    "Minimal value for physical variables which are always > 0.0";
-
-  constant Units.SI.Area AMIN=MINPOS "Minimal init area";
-  constant Units.SI.Area AMAX=1.0e5 "Maximal init area";
-  constant Units.SI.Area ANOM=1.0 "Nominal init area";
-  constant Units.SI.AmountOfSubstance MOLMIN=-1.0*MINPOS
-    "Minimal Mole Number";
-  constant Units.SI.AmountOfSubstance MOLMAX=1.0e8
-    "Maximal Mole Number";
-  constant Units.SI.AmountOfSubstance MOLNOM=1.0 "Nominal Mole Number";
-  constant Units.SI.Density DMIN=1e-6 "Minimal init density";
-  constant Units.SI.Density DMAX=30.0e3 "Maximal init density";
-  constant Units.SI.Density DNOM=1.0 "Nominal init density";
-  constant Units.SI.ThermalConductivity LAMMIN=MINPOS
-    "Minimal thermal conductivity";
-  constant Units.SI.ThermalConductivity LAMNOM=1.0
-    "Nominal thermal conductivity";
-  constant Units.SI.ThermalConductivity LAMMAX=1000.0
-    "Maximal thermal conductivity";
-  constant Units.SI.DynamicViscosity ETAMIN=MINPOS
-    "Minimal init dynamic viscosity";
-  constant Units.SI.DynamicViscosity ETAMAX=1.0e8
-    "Maximal init dynamic viscosity";
-  constant Units.SI.DynamicViscosity ETANOM=100.0
-    "Nominal init dynamic viscosity";
-  constant Units.SI.Energy EMIN=-1.0e10 "Minimal init energy";
-  constant Units.SI.Energy EMAX=1.0e10 "Maximal init energy";
-  constant Units.SI.Energy ENOM=1.0e3 "Nominal init energy";
-  constant Units.SI.Entropy SMIN=-1.0e6 "Minimal init entropy";
-  constant Units.SI.Entropy SMAX=1.0e6 "Maximal init entropy";
-  constant Units.SI.Entropy SNOM=1.0e3 "Nominal init entropy";
-  constant Units.SI.MassFlowRate MDOTMIN=-1.0e5
-    "Minimal init mass flow rate";
-  constant Units.SI.MassFlowRate MDOTMAX=1.0e5
-    "Maximal init mass flow rate";
-  constant Units.SI.MassFlowRate MDOTNOM=1.0
-    "Nominal init mass flow rate";
-  constant Units.SI.MassFraction MASSXMIN=-1.0*MINPOS
-    "Minimal init mass fraction";
-  constant Units.SI.MassFraction MASSXMAX=1.0
-    "Maximal init mass fraction";
-  constant Units.SI.MassFraction MASSXNOM=0.1
-    "Nominal init mass fraction";
-  constant Units.SI.Mass MMIN=-1.0*MINPOS "Minimal init mass";
-  constant Units.SI.Mass MMAX=1.0e8 "Maximal init mass";
-  constant Units.SI.Mass MNOM=1.0 "Nominal init mass";
-  constant Units.SI.MolarMass MMMIN=0.001 "Minimal initial molar mass";
-  constant Units.SI.MolarMass MMMAX=250.0 "Maximal initial molar mass";
-  constant Units.SI.MolarMass MMNOM=0.2 "Nominal initial molar mass";
-  constant Units.SI.MoleFraction MOLEYMIN=-1.0*MINPOS
-    "Minimal init mole fraction";
-  constant Units.SI.MoleFraction MOLEYMAX=1.0
-    "Maximal init mole fraction";
-  constant Units.SI.MoleFraction MOLEYNOM=0.1
-    "Nominal init mole fraction";
-  constant Units.SI.MomentumFlux GMIN=-1.0e8
-    "Minimal init momentum flux";
-  constant Units.SI.MomentumFlux GMAX=1.0e8
-    "Maximal init momentum flux";
-  constant Units.SI.MomentumFlux GNOM=1.0 "Nominal init momentum flux";
-  constant Units.SI.Power POWMIN=-1.0e8 "Minimal init power or heat";
-  constant Units.SI.Power POWMAX=1.0e8 "Maximal init power or heat";
-  constant Units.SI.Power POWNOM=1.0e3 "Nominal init power or heat";
-  constant Units.SI.Pressure PMIN=1.0e4 "Minimal init pressure";
-  constant Units.SI.Pressure PMAX=1.0e8 "Maximal init pressure";
-  constant Units.SI.Pressure PNOM=1.0e5 "Nominal init pressure";
-  constant Units.SI.Pressure COMPPMIN=-1.0*MINPOS
-    "Minimal init pressure";
-  constant Units.SI.Pressure COMPPMAX=1.0e8 "Maximal init pressure";
-  constant Units.SI.Pressure COMPPNOM=1.0e5 "Nominal init pressure";
-  constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMIN=1.0
-    "Minimal init isentropic exponent";
-  constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMAX=1.7
-    "Maximal init isentropic exponent";
-  constant Units.SI.RatioOfSpecificHeatCapacities KAPPANOM=1.2
-    "Nominal init isentropic exponent";
-  constant Units.SI.SpecificEnergy SEMIN=-1.0e8
-    "Minimal init specific energy";
-  constant Units.SI.SpecificEnergy SEMAX=1.0e8
-    "Maximal init specific energy";
-  constant Units.SI.SpecificEnergy SENOM=1.0e6
-    "Nominal init specific energy";
-  constant Units.SI.SpecificEnthalpy SHMIN=-1.0e8
-    "Minimal init specific enthalpy";
-  constant Units.SI.SpecificEnthalpy SHMAX=1.0e8
-    "Maximal init specific enthalpy";
-  constant Units.SI.SpecificEnthalpy SHNOM=1.0e6
-    "Nominal init specific enthalpy";
-  constant Units.SI.SpecificEntropy SSMIN=-1.0e6
-    "Minimal init specific entropy";
-  constant Units.SI.SpecificEntropy SSMAX=1.0e6
-    "Maximal init specific entropy";
-  constant Units.SI.SpecificEntropy SSNOM=1.0e3
-    "Nominal init specific entropy";
-  constant Units.SI.SpecificHeatCapacity CPMIN=MINPOS
-    "Minimal init specific heat capacity";
-  constant Units.SI.SpecificHeatCapacity CPMAX=1.0e6
-    "Maximal init specific heat capacity";
-  constant Units.SI.SpecificHeatCapacity CPNOM=1.0e3
-    "Nominal init specific heat capacity";
-  constant Units.SI.Temperature TMIN=1.0 "Minimal init temperature";
-  constant Units.SI.Temperature TMAX=6000.0 "Maximal init temperature";
-  constant Units.SI.Temperature TNOM=320.0 "Nominal init temperature";
-  constant Units.SI.ThermalConductivity LMIN=MINPOS
-    "Minimal init thermal conductivity";
-  constant Units.SI.ThermalConductivity LMAX=500.0
-    "Maximal init thermal conductivity";
-  constant Units.SI.ThermalConductivity LNOM=1.0
-    "Nominal init thermal conductivity";
-  constant Units.SI.Velocity VELMIN=-1.0e5 "Minimal init speed";
-  constant Units.SI.Velocity VELMAX=1.0e5 "Maximal init speed";
-  constant Units.SI.Velocity VELNOM=1.0 "Nominal init speed";
-  constant Units.SI.Volume VMIN=0.0 "Minimal init volume";
-  constant Units.SI.Volume VMAX=1.0e5 "Maximal init volume";
-  constant Units.SI.Volume VNOM=1.0e-3 "Nominal init volume";
-
-  package ThermoFluidSpecial "Property records used by the ThermoFluid library"
-
-    record FixedIGProperties "Constant properties for ideal gases"
-      extends Modelica.Icons.Record;
-      parameter Integer nspecies(min=1) "Number of components";
-      Units.SI.MolarMass[nspecies] MM "Molar mass of components";
-      Real[nspecies] invMM "Inverse of molar mass of components";
-      Units.SI.SpecificHeatCapacity[nspecies] R "Gas constant";
-      Units.SI.SpecificEnthalpy[nspecies] Hf
-        "Enthalpy of formation at 298.15K";
-      Units.SI.SpecificEnthalpy[nspecies] H0 "H0(298.15K) - H0(0K)";
-    end FixedIGProperties;
-
-    record ThermoBaseVars
-      extends Modelica.Icons.Record;
-      parameter Integer n(min=1) "Discretization number";
-      parameter Integer nspecies(min=1) "Number of species";
-      Units.SI.Pressure[n] p(
-        min=PMIN,
-        max=PMAX,
-        nominal=PNOM,
-        start=fill(1.0e5, n)) "Pressure";
-      Units.SI.Temperature[n] T(
-        min=TMIN,
-        max=TMAX,
-        nominal=TNOM) "Temperature";
-      Units.SI.Density[n] d(
-        min=DMIN,
-        max=DMAX,
-        nominal=DNOM) "Density";
-      Units.SI.SpecificEnthalpy[n] h(
-        min=SHMIN,
-        max=SHMAX,
-        nominal=SHNOM) "Specific enthalpy";
-      Units.SI.SpecificEntropy[n] s(
-        min=SSMIN,
-        max=SSMAX,
-        nominal=SSNOM) "Specific entropy";
-      Units.SI.RatioOfSpecificHeatCapacities[n] kappa "Ratio of cp/cv";
-      Units.SI.Mass[n] M(
-        min=MMIN,
-        max=MMAX,
-        nominal=MNOM) "Total mass";
-      Units.SI.Energy[n] U(
-        min=EMIN,
-        max=EMAX,
-        nominal=ENOM) "Inner energy";
-      Units.SI.MassFlowRate[n] dM(
-        min=MDOTMIN,
-        max=MDOTMAX,
-        nominal=MDOTNOM) "Change in total mass";
-      Units.SI.Power[n] dU(
-        min=POWMIN,
-        max=POWMAX,
-        nominal=POWNOM) "Change in inner energy";
-      Units.SI.Volume[n] V(
-        min=VMIN,
-        max=VMAX,
-        nominal=VNOM) "Volume";
-      Units.SI.MassFraction[n,nspecies] mass_x(
-        min=MASSXMIN,
-        max=MASSXMAX,
-        nominal=MASSXNOM) "Mass fraction";
-      Units.SI.MoleFraction[n,nspecies] mole_y(
-        min=MOLEYMIN,
-        max=MOLEYMAX,
-        nominal=MOLEYNOM) "Mole fraction";
-      Units.SI.Mass[n,nspecies] M_x(
-        min=MMIN,
-        max=MMAX,
-        nominal=MNOM) "Component mass";
-      Units.SI.MassFlowRate[n,nspecies] dM_x(
-        min=MDOTMIN,
-        max=MDOTMAX,
-        nominal=MDOTNOM) "Rate of change in component mass";
-      MolarFlowRate[n, nspecies] dZ(
-        min=-1.0e6,
-        max=1.0e6,
-        nominal=0.0) "Rate of change in component moles";
-      MolarFlowRate[n, nspecies] rZ(
-        min=-1.0e6,
-        max=1.0e6,
-        nominal=0.0) "Reaction(source) mole rates";
-      Units.SI.MolarMass[n] MM(
-        min=MMMIN,
-        max=MMMAX,
-        nominal=MMNOM) "Molar mass of mixture";
-      Units.SI.AmountOfSubstance[n] Moles(
-        min=MOLMIN,
-        max=MOLMAX,
-        nominal=MOLNOM) "Total moles";
-      Units.SI.AmountOfSubstance[n,nspecies] Moles_z(
-        min=MOLMIN,
-        max=MOLMAX,
-        nominal=MOLNOM) "Mole vector";
-      annotation (Documentation(info="<html>
-                         <h4>Model description</h4>
-                              <p>
-                              <b>ThermoBaseVars</b> is inherited by all medium property models
-                              and by all models defining the dynamic states for the conservation
-                              of mass and energy. Thus it is a good choice as a restricting class
-                              for any medium model or dynamic state model.
-                           </p>
-                              </html>"));
-    end ThermoBaseVars;
-
-    record ThermoProperties
-      "Thermodynamic base property data for all state models"
-      extends Modelica.Icons.Record;
-      parameter Integer nspecies(min=1) "Number of species";
-      Units.SI.Temperature T(
-        min=TMIN,
-        max=TMAX,
-        nominal=TNOM) "Temperature";
-      Units.SI.Density d(
-        min=DMIN,
-        max=DMAX,
-        nominal=DNOM) "Density";
-      Units.SI.Pressure p(
-        min=PMIN,
-        max=PMAX,
-        nominal=PNOM) "Pressure";
-      Units.SI.Volume V(
-        min=VMIN,
-        max=VMAX,
-        nominal=VNOM) "Volume";
-      Units.SI.SpecificEnthalpy h(
-        min=SHMIN,
-        max=SHMAX,
-        nominal=SHNOM) "Specific enthalpy";
-      Units.SI.SpecificEnergy u(
-        min=SEMIN,
-        max=SEMAX,
-        nominal=SENOM) "Specific inner energy";
-      Units.SI.SpecificEntropy s(
-        min=SSMIN,
-        max=SSMAX,
-        nominal=SSNOM) "Specific entropy";
-      Units.SI.SpecificGibbsFreeEnergy g(
-        min=SHMIN,
-        max=SHMAX,
-        nominal=SHNOM) "Specific Gibbs free energy";
-      Units.SI.SpecificHeatCapacity cp(
-        min=CPMIN,
-        max=CPMAX,
-        nominal=CPNOM) "Heat capacity at constant pressure";
-      Units.SI.SpecificHeatCapacity cv(
-        min=CPMIN,
-        max=CPMAX,
-        nominal=CPNOM) "Heat capacity at constant volume";
-      Units.SI.SpecificHeatCapacity R(
-        min=CPMIN,
-        max=CPMAX,
-        nominal=CPNOM) "Gas constant";
-      Units.SI.MolarMass MM(
-        min=MMMIN,
-        max=MMMAX,
-        nominal=MMNOM) "Molar mass of mixture";
-      Units.SI.MassFraction[nspecies] mass_x(
-        min=MASSXMIN,
-        max=MASSXMAX,
-        nominal=MASSXNOM) "Mass fraction";
-      Units.SI.MoleFraction[nspecies] mole_y(
-        min=MOLEYMIN,
-        max=MOLEYMAX,
-        nominal=MOLEYNOM) "Mole fraction";
-      Units.SI.RatioOfSpecificHeatCapacities kappa "Ratio of cp/cv";
-      Units.SI.DerDensityByTemperature ddTp
-        "Derivative of density by temperature at constant pressure";
-      Units.SI.DerDensityByPressure ddpT
-        "Derivative of density by pressure at constant temperature";
-      Real dupT(unit="m3.kg-1")
-        "Derivative of inner energy by pressure at constant T";
-      Real dudT(unit="(J.m3)/(kg2)")
-        "Derivative of inner energy by density at constant T";
-      Units.SI.SpecificHeatCapacity duTp
-        "Derivative of inner energy by temperature at constant p";
-      Units.SI.SpecificEnergy ddx[nspecies]
-        "Derivative vector of density by change in mass composition";
-      Units.SI.SpecificEnergy[nspecies] compu(
-        min=SEMIN,
-        max=SEMAX,
-        nominal=SENOM) "Inner energy of the components";
-      Units.SI.Pressure[nspecies] compp(
-        min=COMPPMIN,
-        max=COMPPMAX,
-        nominal=COMPPNOM) "partial pressures of the components";
-      Units.SI.Velocity a(
-        min=VELMIN,
-        max=VELMAX,
-        nominal=VELNOM) "Speed of sound";
-      Units.SI.HeatCapacity dUTZ
-        "Derivative of inner energy by temperature at constant moles";
-      Units.SI.MolarInternalEnergy[nspecies] dUZT
-        "Derivative of inner energy by moles at constant temperature";
-      Units.SI.SpecificEnthalpy[nspecies] dHMxT(
-        min=SEMIN,
-        max=SEMAX,
-        nominal=SENOM)
-        "Derivative of total enthalpy w.r.t. component mass at constant T";
-      Real dpT "Derivative of pressure w.r.t. temperature";
-      Real dpZ[nspecies] "Derivative of pressure w.r.t. moles";
-      annotation (Documentation(info="<html>
-        <h4>Model description</h4>
-        <p>
-        A base class for medium property models which work with most of the
-        versions of dynamic states that are available in the ThermoFluid
-        library. Currently used by all ideal gas models.
-     </p>
-        </html>"));
-    end ThermoProperties;
-
-    record ThermoProperties_ph
-      "Thermodynamic property data for pressure p and specific enthalpy h as dynamic states"
-
-      extends Modelica.Icons.Record;
-      Units.SI.Temperature T(
-        min=1.0e-9,
-        max=10000.0,
-        nominal=298.15) "Temperature";
-      Units.SI.Density d(
-        min=1.0e-9,
-        max=10000.0,
-        nominal=10.0) "Density";
-      Units.SI.SpecificEnergy u(
-        min=-1.0e8,
-        max=1.0e8,
-        nominal=1.0e6) "Specific inner energy";
-      Units.SI.SpecificEntropy s(
-        min=-1.0e6,
-        max=1.0e6,
-        nominal=1.0e3) "Specific entropy";
-      Units.SI.SpecificHeatCapacity cp(
-        min=1.0,
-        max=1.0e6,
-        nominal=1000.0) "Heat capacity at constant pressure";
-      Units.SI.SpecificHeatCapacity cv(
-        min=1.0,
-        max=1.0e6,
-        nominal=1000.0) "Heat capacity at constant volume";
-      Units.SI.SpecificHeatCapacity R(
-        min=1.0,
-        max=1.0e6,
-        nominal=1000.0) "Gas constant";
-      Units.SI.RatioOfSpecificHeatCapacities kappa "Ratio of cp/cv";
-      Units.SI.Velocity a(
-        min=1.0,
-        max=10000.0,
-        nominal=300.0) "Speed of sound";
-      Units.SI.DerDensityByEnthalpy ddhp
-        "Derivative of density by enthalpy at constant pressure";
-      Units.SI.DerDensityByPressure ddph
-        "Derivative of density by pressure at constant enthalpy";
-      Real duph(unit="m3/kg")
-        "Derivative of inner energy by pressure at constant enthalpy";
-      Real duhp(unit="1")
-        "Derivative of inner energy by enthalpy at constant pressure";
-      annotation (Documentation(info="<html>
-<h4>Model description</h4>
-<p>
-A base class for medium property models which
-use pressure and enthalpy as dynamic states.
-This is the preferred model for fluids that can also be in the
-two phase and liquid regions.
-</p>
-</html>"));
-    end ThermoProperties_ph;
-
-    record ThermoProperties_pT
-      "Thermodynamic property data for pressure p and temperature T as dynamic states"
-
-      extends Modelica.Icons.Record;
-      Units.SI.Density d(
-        min=1.0e-9,
-        max=10000.0,
-        nominal=10.0) "Density";
-      Units.SI.SpecificEnthalpy h(
-        min=-1.0e8,
-        max=1.0e8,
-        nominal=1.0e6) "Specific enthalpy";
-      Units.SI.SpecificEnergy u(
-        min=-1.0e8,
-        max=1.0e8,
-        nominal=1.0e6) "Specific inner energy";
-      Units.SI.SpecificEntropy s(
-        min=-1.0e6,
-        max=1.0e6,
-        nominal=1.0e3) "Specific entropy";
-      Units.SI.SpecificHeatCapacity cp(
-        min=1.0,
-        max=1.0e6,
-        nominal=1000.0) "Heat capacity at constant pressure";
-      Units.SI.SpecificHeatCapacity cv(
-        min=1.0,
-        max=1.0e6,
-        nominal=1000.0) "Heat capacity at constant volume";
-      Units.SI.SpecificHeatCapacity R(
-        min=1.0,
-        max=1.0e6,
-        nominal=1000.0) "Gas constant";
-      Units.SI.RatioOfSpecificHeatCapacities kappa "Ratio of cp/cv";
-      Units.SI.Velocity a(
-        min=1.0,
-        max=10000.0,
-        nominal=300.0) "Speed of sound";
-      Units.SI.DerDensityByTemperature ddTp
-        "Derivative of density by temperature at constant pressure";
-      Units.SI.DerDensityByPressure ddpT
-        "Derivative of density by pressure at constant temperature";
-      Real dupT(unit="m3.kg-1")
-        "Derivative of inner energy by pressure at constant T";
-      Units.SI.SpecificHeatCapacity duTp
-        "Derivative of inner energy by temperature at constant p";
-      annotation (Documentation(info="<html>
-<h4>Model description</h4>
-<p>
-A base class for medium property models which use pressure and temperature as dynamic states.
-This is a reasonable model for fluids that can also be in the gas and
-liquid regions, but never in the two-phase region.
-</p>
-</html>"));
-    end ThermoProperties_pT;
-
-    record ThermoProperties_dT
-      "Thermodynamic property data for density d and temperature T as dynamic states"
-
-      extends Modelica.Icons.Record;
-      Units.SI.Pressure p(
-        min=1.0,
-        max=1.0e9,
-        nominal=1.0e5) "Pressure";
-      Units.SI.SpecificEnthalpy h(
-        min=-1.0e8,
-        max=1.0e8,
-        nominal=1.0e6) "Specific enthalpy";
-      Units.SI.SpecificEnergy u(
-        min=-1.0e8,
-        max=1.0e8,
-        nominal=1.0e6) "Specific inner energy";
-      Units.SI.SpecificEntropy s(
-        min=-1.0e6,
-        max=1.0e6,
-        nominal=1.0e3) "Specific entropy";
-      Units.SI.SpecificHeatCapacity cp(
-        min=1.0,
-        max=1.0e6,
-        nominal=1000.0) "Heat capacity at constant pressure";
-      Units.SI.SpecificHeatCapacity cv(
-        min=1.0,
-        max=1.0e6,
-        nominal=1000.0) "Heat capacity at constant volume";
-      Units.SI.SpecificHeatCapacity R(
-        min=1.0,
-        max=1.0e6,
-        nominal=1000.0) "Gas constant";
-      Units.SI.RatioOfSpecificHeatCapacities kappa "Ratio of cp/cv";
-      Units.SI.Velocity a(
-        min=1.0,
-        max=10000.0,
-        nominal=300.0) "Speed of sound";
-      Real dudT(unit="m5/(kg.s2)")
-        "Derivative of inner energy by density at constant T";
-      annotation (Documentation(info="<html>
-<h4>Model description</h4>
-<p>
-A base class for medium property models which use density and temperature as dynamic states.
-This is a reasonable model for fluids that can be in the gas, liquid
-and two-phase region. The model is numerically not well suited for
-liquids except if the pressure is always above approx. 80% of the
-critical pressure.
-</p>
-</html>"));
-    end ThermoProperties_dT;
-
-    //   record GibbsDerivs
-
-    //     "Derivatives of dimensionless Gibbs-function w.r.t. dimensionless pressure and temperature"
-    //     extends Modelica.Icons.Record;
-    //     Real pi "Dimensionless pressure";
-    //     Real tau "Dimensionless temperature";
-    //     Real g "Dimensionless Gibbs-function";
-    //     Real gpi "Derivative of g w.r.t. pi";
-    //     Real gpipi "2nd derivative of g w.r.t. pi";
-    //     Real gtau "Derivative of g w.r.t. tau";
-    //     Real gtautau "2nd derivative of g w.r.t. tau";
-    //     Real gtaupi "Mixed derivative of g w.r.t. pi and tau";
-    //   end GibbsDerivs;
-
-    //   record HelmholtzDerivs
-
-    //     "Derivatives of dimensionless Helmholtz-function w.r.t. dimensionless pressure, density and temperature"
-    //     extends Modelica.Icons.Record;
-    //     Real delta "Dimensionless density";
-    //     Real tau "Dimensionless temperature";
-    //     Real f "Dimensionless Helmholtz-function";
-    //     Real fdelta "Derivative of f w.r.t. delta";
-    //     Real fdeltadelta "2nd derivative of f w.r.t. delta";
-    //     Real ftau "Derivative of f w.r.t. tau";
-    //     Real ftautau "2nd derivative of f w.r.t. tau";
-    //     Real fdeltatau "Mixed derivative of f w.r.t. delta and tau";
-    //   end HelmholtzDerivs;
-
-    record TransportProps "Record with transport properties"
-      extends Modelica.Icons.Record;
-      Units.SI.DynamicViscosity eta;
-      Units.SI.ThermalConductivity lam;
-    end TransportProps;
-
-    function gibbsToProps_ph
-      "Calculate property record for pressure and specific enthalpy as states from dimensionless Gibbs function"
-
-      extends Modelica.Icons.Function;
-      input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
-      output ThermoProperties_ph pro
-        "Property record for pressure and specific enthalpy as dynamic states";
-    protected
-      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";
-    algorithm
-      pro.T := g.T;
-      pro.R := g.R;
-      pro.d := g.p/(pro.R*pro.T*g.pi*g.gpi);
-      pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-      pro.s := pro.R*(g.tau*g.gtau - g.g);
-      pro.cp := -pro.R*g.tau*g.tau*g.gtautau;
-      pro.cv := pro.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi
-         - g.tau*g.gtaupi)/(g.gpipi));
-      pro.a := abs(g.R*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
-        *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))^0.5;
-      vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-      vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-      pro.kappa := -1/(pro.d*g.p)*pro.cp/(vp*pro.cp + vt*vt*g.T);
-      pro.ddhp := -pro.d*pro.d*vt/(pro.cp);
-      pro.ddph := -pro.d*pro.d*(vp*pro.cp - vt/pro.d + g.T*vt*vt)/pro.cp;
-      pro.duph := -1/pro.d + g.p/(pro.d*pro.d)*pro.ddph;
-      pro.duhp := 1 + g.p/(pro.d*pro.d)*pro.ddhp;
-    end gibbsToProps_ph;
-
-    function gibbsToBoundaryProps
-      "Calculate phase boundary property record from dimensionless Gibbs function"
-
-      extends Modelica.Icons.Function;
-      input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
-      output PhaseBoundaryProperties sat "Phase boundary properties";
-    protected
-      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";
-    algorithm
-      sat.d := g.p/(g.R*g.T*g.pi*g.gpi);
-      sat.h := g.R*g.T*g.tau*g.gtau;
-      sat.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-      sat.s := g.R*(g.tau*g.gtau - g.g);
-      sat.cp := -g.R*g.tau*g.tau*g.gtautau;
-      sat.cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi
-         - g.tau*g.gtaupi)/(g.gpipi));
-      vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-      vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-      // sat.kappa := -1/(sat.d*g.p)*sat.cp/(vp*sat.cp + vt*vt*g.T);
-      sat.pt := -g.p/g.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
-      sat.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-    end gibbsToBoundaryProps;
-
-    function gibbsToProps_dT
-      "Calculate property record for density and temperature as states from dimensionless Gibbs function"
-
-      extends Modelica.Icons.Function;
-      input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
-      output ThermoProperties_dT pro
-        "Property record for density and temperature as dynamic states";
-    protected
-      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";
-      Units.SI.Density d;
-    algorithm
-      pro.R := g.R;
-      pro.p := g.p;
-      pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-      pro.h := g.R*g.T*g.tau*g.gtau;
-      pro.s := pro.R*(g.tau*g.gtau - g.g);
-      pro.cp := -pro.R*g.tau*g.tau*g.gtautau;
-      pro.cv := pro.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi
-         - g.tau*g.gtaupi)/g.gpipi);
-      vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-      vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-      pro.kappa := -1/((g.p/(pro.R*g.T*g.pi*g.gpi))*g.p)*pro.cp/(vp*pro.cp + vt
-        *vt*g.T);
-      pro.a := abs(g.R*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
-        *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))^0.5;
-
-      d := g.p/(pro.R*g.T*g.pi*g.gpi);
-      pro.dudT := (pro.p - g.T*vt/vp)/(d*d);
-    end gibbsToProps_dT;
-
-    function gibbsToProps_pT
-      "Calculate property record for pressure and temperature as states from dimensionless Gibbs function"
-
-      extends Modelica.Icons.Function;
-      input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
-      output ThermoProperties_pT pro
-        "Property record for pressure and temperature as dynamic states";
-    protected
-      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";
-    algorithm
-      pro.R := g.R;
-      pro.d := g.p/(pro.R*g.T*g.pi*g.gpi);
-      pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-      pro.h := g.R*g.T*g.tau*g.gtau;
-      pro.s := pro.R*(g.tau*g.gtau - g.g);
-      pro.cp := -pro.R*g.tau*g.tau*g.gtautau;
-      pro.cv := pro.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi
-         - g.tau*g.gtaupi)/g.gpipi);
-      vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-      vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-      pro.kappa := -1/(pro.d*g.p)*pro.cp/(vp*pro.cp + vt*vt*g.T);
-      pro.a := abs(g.R*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
-        *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))^0.5;
-      pro.ddpT := -(pro.d*pro.d)*vp;
-      pro.ddTp := -(pro.d*pro.d)*vt;
-      pro.duTp := pro.cp - g.p*vt;
-      pro.dupT := -g.T*vt - g.p*vp;
-    end gibbsToProps_pT;
-
-    function helmholtzToProps_ph
-      "Calculate property record for pressure and specific enthalpy as states from dimensionless Helmholtz function"
-
-      extends Modelica.Icons.Function;
-      input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
-      output ThermoProperties_ph pro
-        "Property record for pressure and specific enthalpy as dynamic states";
-    protected
-      Units.SI.Pressure p "Pressure";
-      DerPressureByDensity pd "Derivative of pressure w.r.t. density";
-      DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-      DerPressureBySpecificVolume pv
-        "Derivative of pressure w.r.t. specific volume";
-    algorithm
-      pro.d := f.d;
-      pro.T := f.T;
-      pro.R := f.R;
-      pro.s := f.R*(f.tau*f.ftau - f.f);
-      pro.u := f.R*f.T*f.tau*f.ftau;
-      p := pro.d*pro.R*pro.T*f.delta*f.fdelta;
-      pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-      pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-      pv := -pd*f.d*f.d;
-
-      // calculating cp near the critical point may be troublesome (cp -> inf).
-      pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
-        *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-      pro.cv := f.R*(-f.tau*f.tau*f.ftautau);
-      pro.kappa := 1/(f.d*f.R*f.d*f.T*f.delta*f.fdelta)*((-pv*pro.cv + pt*pt*f.T)
-        /(pro.cv));
-      pro.a := abs(f.R*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta
-         - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta*f.fdelta -
-        f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5;
-      pro.ddph := (f.d*(pro.cv*f.d + pt))/(f.d*f.d*pd*pro.cv + f.T*pt*pt);
-      pro.ddhp := -f.d*f.d*pt/(f.d*f.d*pd*pro.cv + f.T*pt*pt);
-      pro.duph := -1/pro.d + p/(pro.d*pro.d)*pro.ddph;
-      pro.duhp := 1 + p/(pro.d*pro.d)*pro.ddhp;
-    end helmholtzToProps_ph;
-
-    function helmholtzToProps_pT
-      "Calculate property record for pressure and temperature as states from dimensionless Helmholtz function"
-
-      extends Modelica.Icons.Function;
-      input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
-      output ThermoProperties_pT pro
-        "Property record for pressure and temperature as dynamic states";
-    protected
-      DerPressureByDensity pd "Derivative of pressure w.r.t. density";
-      DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-      DerPressureBySpecificVolume pv
-        "Derivative of pressure w.r.t. specific volume";
-      IsobaricVolumeExpansionCoefficient alpha
-        "Isobaric volume expansion coefficient";
-      // beta in Bejan
-      IsothermalCompressibility gamma "Isothermal compressibility";
-      // kappa in Bejan
-      Units.SI.Pressure p "Pressure";
-    algorithm
-      pro.d := f.d;
-      pro.R := f.R;
-      pro.s := f.R*(f.tau*f.ftau - f.f);
-      pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
-      pro.u := f.R*f.T*f.tau*f.ftau;
-      pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-      pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-      pv := -(f.d*f.d)*pd;
-      alpha := -f.d*pt/pv;
-      gamma := -f.d/pv;
-      p := f.R*f.d*f.T*f.delta*f.fdelta;
-      // calculating cp near the critical point may be troublesome (cp -> inf).
-      pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
-        *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-      pro.cv := f.R*(-f.tau*f.tau*f.ftautau);
-      pro.kappa := 1/(f.d*f.R*f.d*f.T*f.delta*f.fdelta)*((-pv*pro.cv + pt*pt*f.T)
-        /(pro.cv));
-      pro.a := abs(f.R*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta
-         - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta*f.fdelta -
-        f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5;
-      pro.ddTp := -pt/pd;
-      pro.ddpT := 1/pd;
-      //problem with units in last two lines
-      pro.dupT := gamma*p/f.d - alpha*f.T/f.d;
-      pro.duTp := pro.cp - alpha*p/f.d;
-    end helmholtzToProps_pT;
-
-    function helmholtzToProps_dT
-      "Calculate property record for density and temperature as states from dimensionless Helmholtz function"
-
-      extends Modelica.Icons.Function;
-      input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
-      output ThermoProperties_dT pro
-        "Property record for density and temperature as dynamic states";
-    protected
-      DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-      DerPressureBySpecificVolume pv "Derivative of pressure w.r.t. pressure";
-    algorithm
-      pro.p := f.R*f.d*f.T*f.delta*f.fdelta;
-      pro.R := f.R;
-      pro.s := f.R*(f.tau*f.ftau - f.f);
-      pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
-      pro.u := f.R*f.T*f.tau*f.ftau;
-      pv := -(f.d*f.d)*f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-      pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-
-      // calculating cp near the critical point may be troublesome (cp -> inf).
-      pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
-        *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-      pro.cv := f.R*(-f.tau*f.tau*f.ftautau);
-      pro.kappa := 1/(f.d*pro.p)*((-pv*pro.cv + pt*pt*f.T)/(pro.cv));
-      pro.a := abs(f.R*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta
-         - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta*f.fdelta -
-        f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5;
-      pro.dudT := (pro.p - f.T*pt)/(f.d*f.d);
-    end helmholtzToProps_dT;
-
-    function TwoPhaseToProps_ph
-      "Compute property record for pressure and specific enthalpy as states from saturation properties"
-
-      extends Modelica.Icons.Function;
-      input SaturationProperties sat "Saturation property record";
-      output ThermoProperties_ph pro
-        "Property record for pressure and specific enthalpy as dynamic states";
-    protected
-      Real dht(unit="(J/kg)/K")
-        "Derivative of specific enthalpy w.r.t. temperature";
-      Real dhd(unit="(J/kg)/(kg/m3)")
-        "Derivative of specific enthalpy w.r.t. density";
-      Real detph(unit="m4.s4/(K.s8)") "Thermodynamic determinant";
-    algorithm
-      pro.d := sat.d;
-      pro.T := sat.T;
-      pro.u := sat.u;
-      pro.s := sat.s;
-      pro.cv := sat.cv;
-      pro.R := sat.R;
-      pro.cp := Modelica.Constants.inf;
-      pro.kappa := -1/(sat.d*sat.p)*sat.dpT*sat.dpT*sat.T/sat.cv;
-      pro.a := Modelica.Constants.inf;
-      dht := sat.cv + sat.dpT/sat.d;
-      dhd := -sat.T*sat.dpT/(sat.d*sat.d);
-      detph := -sat.dpT*dhd;
-      pro.ddph := dht/detph;
-      pro.ddhp := -sat.dpT/detph;
-    end TwoPhaseToProps_ph;
-
-    function TwoPhaseToProps_dT
-      "Compute property record for density and temperature as states from saturation properties"
-
-      extends Modelica.Icons.Function;
-      input SaturationProperties sat "Saturation properties";
-      output ThermoProperties_dT pro
-        "Property record for density and temperature as dynamic states";
-    algorithm
-      pro.p := sat.p;
-      pro.h := sat.h;
-      pro.u := sat.u;
-      pro.s := sat.s;
-      pro.cv := sat.cv;
-      pro.cp := Modelica.Constants.inf;
-      pro.R := sat.R;
-      pro.kappa := -1/(sat.d*sat.p)*sat.dpT*sat.dpT*sat.T/sat.cv;
-      pro.a := Modelica.Constants.inf;
-      pro.dudT := (sat.p - sat.T*sat.dpT)/(sat.d*sat.d);
-    end TwoPhaseToProps_dT;
-
-  end ThermoFluidSpecial;
-public
-
-  record SaturationProperties "Properties in the two phase region"
-    extends Modelica.Icons.Record;
-    Units.SI.Temp_K T "Temperature";
-    Units.SI.Density d "Density";
-    Units.SI.Pressure p "Pressure";
-    Units.SI.SpecificEnergy u "Specific inner energy";
-    Units.SI.SpecificEnthalpy h "Specific enthalpy";
-    Units.SI.SpecificEntropy s "Specific entropy";
-    Units.SI.SpecificHeatCapacity cp
-      "Heat capacity at constant pressure";
-    Units.SI.SpecificHeatCapacity cv "Heat capacity at constant volume";
-    Units.SI.SpecificHeatCapacity R "Gas constant";
-    Units.SI.RatioOfSpecificHeatCapacities kappa
-      "Isentropic expansion coefficient";
-    PhaseBoundaryProperties liq
-      "Thermodynamic base properties on the boiling curve";
-    PhaseBoundaryProperties vap
-      "Thermodynamic base properties on the dew curve";
-    Real dpT(unit="Pa/K")
-      "Derivative of saturation pressure w.r.t. temperature";
-    Units.SI.MassFraction x "Vapour mass fraction";
-  end SaturationProperties;
-
-  record SaturationBoundaryProperties
-    "Properties on both phase boundaries, including some derivatives"
-
-    extends Modelica.Icons.Record;
-    Units.SI.Temp_K T "Saturation temperature";
-    Units.SI.Density dl "Liquid density";
-    Units.SI.Density dv "Vapour density";
-    Units.SI.SpecificEnthalpy hl "Liquid specific enthalpy";
-    Units.SI.SpecificEnthalpy hv "Vapour specific enthalpy";
-    Real dTp "Derivative of temperature w.r.t. saturation pressure";
-    Real ddldp "Derivative of density along boiling curve";
-    Real ddvdp "Derivative of density along dew curve";
-    Real dhldp "Derivative of specific enthalpy along boiling curve";
-    Real dhvdp "Derivative of specific enthalpy along dew curve";
-    Units.SI.MassFraction x "Vapour mass fraction";
-  end SaturationBoundaryProperties;
-
-  record IF97BaseTwoPhase "Intermediate property data record for IF 97"
-    extends Modelica.Icons.Record;
-    Integer phase(start=0)
-      "Phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-    Integer region(min=1, max=5) "IF 97 region";
-    Units.SI.Pressure p "Pressure";
-    Units.SI.Temperature T "Temperature";
-    Units.SI.SpecificEnthalpy h "Specific enthalpy";
-    Units.SI.SpecificHeatCapacity R "Gas constant";
-    Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
-    Units.SI.SpecificHeatCapacity cv "Specific heat capacity";
-    Units.SI.Density rho "Density";
-    Units.SI.SpecificEntropy s "Specific entropy";
-    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
-    Real vt "Derivative of specific volume w.r.t. temperature";
-    Real vp "Derivative of specific volume w.r.t. pressure";
-    Real x "Dryness fraction";
-    Real dpT "dp/dT derivative of saturation curve";
-  end IF97BaseTwoPhase;
-
-  record IF97PhaseBoundaryProperties
-    "Thermodynamic base properties on the phase boundary for IF97 steam tables"
-
-    extends Modelica.Icons.Record;
-    Boolean region3boundary "True if boundary between 2-phase and region 3";
-    Units.SI.SpecificHeatCapacity R "Specific heat capacity";
-    Units.SI.Temperature T "Temperature";
-    Units.SI.Density d "Density";
-    Units.SI.SpecificEnthalpy h "Specific enthalpy";
-    Units.SI.SpecificEntropy s "Specific entropy";
-    Units.SI.SpecificHeatCapacity cp
-      "Heat capacity at constant pressure";
-    Units.SI.SpecificHeatCapacity cv "Heat capacity at constant volume";
-    DerPressureByTemperature dpT "dp/dT derivative of saturation curve";
-    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
-    Real vt(unit="m3/(kg.K)")
-      "Derivative of specific volume w.r.t. temperature";
-    Real vp(unit="m3/(kg.Pa)") "Derivative of specific volume w.r.t. pressure";
-  end IF97PhaseBoundaryProperties;
-
-  record GibbsDerivs
-    "Derivatives of dimensionless Gibbs-function w.r.t. dimensionless pressure and temperature"
-
-    extends Modelica.Icons.Record;
-    Units.SI.Pressure p "Pressure";
-    Units.SI.Temperature T "Temperature";
-    Units.SI.SpecificHeatCapacity R "Specific heat capacity";
-    Real pi(unit="1") "Dimensionless pressure";
-    Real tau(unit="1") "Dimensionless temperature";
-    Real g(unit="1") "Dimensionless Gibbs-function";
-    Real gpi(unit="1") "Derivative of g w.r.t. pi";
-    Real gpipi(unit="1") "2nd derivative of g w.r.t. pi";
-    Real gtau(unit="1") "Derivative of g w.r.t. tau";
-    Real gtautau(unit="1") "2nd derivative of g w.r.t. tau";
-    Real gtaupi(unit="1") "Mixed derivative of g w.r.t. pi and tau";
-  end GibbsDerivs;
-
-  record HelmholtzDerivs
-    "Derivatives of dimensionless Helmholtz-function w.r.t. dimensionless pressure, density and temperature"
-    extends Modelica.Icons.Record;
-    Units.SI.Density d "Density";
-    Units.SI.Temperature T "Temperature";
-    Units.SI.SpecificHeatCapacity R "Specific heat capacity";
-    Real delta(unit="1") "Dimensionless density";
-    Real tau(unit="1") "Dimensionless temperature";
-    Real f(unit="1") "Dimensionless Helmholtz-function";
-    Real fdelta(unit="1") "Derivative of f w.r.t. delta";
-    Real fdeltadelta(unit="1") "2nd derivative of f w.r.t. delta";
-    Real ftau(unit="1") "Derivative of f w.r.t. tau";
-    Real ftautau(unit="1") "2nd derivative of f w.r.t. tau";
-    Real fdeltatau(unit="1") "Mixed derivative of f w.r.t. delta and tau";
-  end HelmholtzDerivs;
-
-  record TwoPhaseTransportProps
-    "Defines properties on both phase boundaries, needed in the two phase region"
-    extends Modelica.Icons.Record;
-    Units.SI.Density d_vap "Density on the dew line";
-    Units.SI.Density d_liq "Density on the bubble line";
-    Units.SI.DynamicViscosity eta_vap
-      "Dynamic viscosity on the dew line";
-    Units.SI.DynamicViscosity eta_liq
-      "Dynamic viscosity on the bubble line";
-    Units.SI.ThermalConductivity lam_vap
-      "Thermal conductivity on the dew line";
-    Units.SI.ThermalConductivity lam_liq
-      "Thermal conductivity on the bubble line";
-    Units.SI.SpecificHeatCapacity cp_vap "Cp on the dew line";
-    Units.SI.SpecificHeatCapacity cp_liq "Cp on the bubble line";
-    Units.SI.MassFraction x "Steam quality";
-  end TwoPhaseTransportProps;
-
-  record PhaseBoundaryProperties
-    "Thermodynamic base properties on the phase boundary"
-    extends Modelica.Icons.Record;
-    Units.SI.Density d "Density";
-    Units.SI.SpecificEnthalpy h "Specific enthalpy";
-    Units.SI.SpecificEnergy u "Inner energy";
-    Units.SI.SpecificEntropy s "Specific entropy";
-    Units.SI.SpecificHeatCapacity cp
-      "Heat capacity at constant pressure";
-    Units.SI.SpecificHeatCapacity cv "Heat capacity at constant volume";
-    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
-  end PhaseBoundaryProperties;
-
-  record NewtonDerivatives_ph
-    "Derivatives for fast inverse calculations of Helmholtz functions: p & h"
-
-    extends Modelica.Icons.Record;
-    Units.SI.Pressure p "Pressure";
-    Units.SI.SpecificEnthalpy h "Specific enthalpy";
-    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
-    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-    Real hd "Derivative of specific enthalpy w.r.t. density";
-    Real ht "Derivative of specific enthalpy w.r.t. temperature";
-  end NewtonDerivatives_ph;
-
-  record NewtonDerivatives_ps
-    "Derivatives for fast inverse calculation of Helmholtz functions: p & s"
-
-    extends Modelica.Icons.Record;
-    Units.SI.Pressure p "Pressure";
-    Units.SI.SpecificEntropy s "Specific entropy";
-    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
-    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-    Real sd "Derivative of specific entropy w.r.t. density";
-    Real st "Derivative of specific entropy w.r.t. temperature";
-  end NewtonDerivatives_ps;
-
-  record NewtonDerivatives_pT
-    "Derivatives for fast inverse calculations of Helmholtz functions:p & T"
-
-    extends Modelica.Icons.Record;
-    Units.SI.Pressure p "Pressure";
-    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
-  end NewtonDerivatives_pT;
-
-  record ExtraDerivatives "Additional thermodynamic derivatives"
-    extends Modelica.Icons.Record;
-    IsentropicExponent kappa "Isentropic expansion coefficient";
-    // k in Bejan
-    IsenthalpicExponent theta "Isenthalpic exponent";
-    // same as kappa, except derivative at const h
-    IsobaricVolumeExpansionCoefficient alpha
-      "Isobaric volume expansion coefficient";
-    // beta in Bejan
-    IsochoricPressureCoefficient beta "Isochoric pressure coefficient";
-    // kT in Bejan
-    IsothermalCompressibility gamma "Isothermal compressibility";
-    // kappa in Bejan
-    JouleThomsonCoefficient mu "Joule-Thomson coefficient";
-    // mu_J in Bejan
-  end ExtraDerivatives;
-
-  record BridgmansTables
-    "Calculates all entries in Bridgmans tables if first seven variables given"
-    extends Modelica.Icons.Record;
-    // the first 7 need to calculated in a function!
-    Units.SI.SpecificVolume v "Specific volume";
-    Units.SI.Pressure p "Pressure";
-    Units.SI.Temperature T "Temperature";
-    Units.SI.SpecificEntropy s "Specific entropy";
-    Units.SI.SpecificHeatCapacity cp
-      "Heat capacity at constant pressure";
-    IsobaricVolumeExpansionCoefficient alpha
-      "Isobaric volume expansion coefficient";
-    // beta in Bejan
-    IsothermalCompressibility gamma "Isothermal compressibility";
-    // kappa in Bejan
-    // Derivatives at constant pressure
-    Real dTp=1 "Coefficient in Bridgmans table, see info for usage";
-    Real dpT=-dTp "Coefficient in Bridgmans table, see info for usage";
-    Real dvp=alpha*v "Coefficient in Bridgmans table, see info for usage";
-    Real dpv=-dvp "Coefficient in Bridgmans table, see info for usage";
-    Real dsp=cp/T "Coefficient in Bridgmans table, see info for usage";
-    Real dps=-dsp "Coefficient in Bridgmans table, see info for usage";
-    Real dup=cp - alpha*p*v
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dpu=-dup "Coefficient in Bridgmans table, see info for usage";
-    Real dhp=cp "Coefficient in Bridgmans table, see info for usage";
-    Real dph=-dhp "Coefficient in Bridgmans table, see info for usage";
-    Real dfp=-s - alpha*p*v
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dpf=-dfp "Coefficient in Bridgmans table, see info for usage";
-    Real dgp=-s "Coefficient in Bridgmans table, see info for usage";
-    Real dpg=-dgp "Coefficient in Bridgmans table, see info for usage";
-    // Derivatives at constant Temperature
-    Real dvT=gamma*v "Coefficient in Bridgmans table, see info for usage";
-    Real dTv=-dvT "Coefficient in Bridgmans table, see info for usage";
-    Real dsT=alpha*v "Coefficient in Bridgmans table, see info for usage";
-    Real dTs=-dsT "Coefficient in Bridgmans table, see info for usage";
-    Real duT=alpha*T*v - gamma*p*v
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dTu=-duT "Coefficient in Bridgmans table, see info for usage";
-    Real dhT=-v + alpha*T*v
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dTh=-dhT "Coefficient in Bridgmans table, see info for usage";
-    Real dfT=-gamma*p*v "Coefficient in Bridgmans table, see info for usage";
-    Real dTf=-dfT "Coefficient in Bridgmans table, see info for usage";
-    Real dgT=-v "Coefficient in Bridgmans table, see info for usage";
-    Real dTg=-dgT "Coefficient in Bridgmans table, see info for usage";
-    // Derivatives at constant v
-    Real dsv=alpha*alpha*v*v - gamma*v*cp/T
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dvs=-dsv "Coefficient in Bridgmans table, see info for usage";
-    Real duv=T*alpha*alpha*v*v - gamma*v*cp
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dvu=-duv "Coefficient in Bridgmans table, see info for usage";
-    Real dhv=T*alpha*alpha*v*v - alpha*v*v - gamma*v*cp
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dvh=-dhv "Coefficient in Bridgmans table, see info for usage";
-    Real dfv=gamma*v*s "Coefficient in Bridgmans table, see info for usage";
-    Real dvf=-dfv "Coefficient in Bridgmans table, see info for usage";
-    Real dgv=gamma*v*s - alpha*v*v
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dvg=-dgv "Coefficient in Bridgmans table, see info for usage";
-    // Derivatives at constant s
-    Real dus=dsv*p "Coefficient in Bridgmans table, see info for usage";
-    Real dsu=-dus "Coefficient in Bridgmans table, see info for usage";
-    Real dhs=-v*cp/T "Coefficient in Bridgmans table, see info for usage";
-    Real dsh=-dhs "Coefficient in Bridgmans table, see info for usage";
-    Real dfs=alpha*v*s + dus
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dsf=-dfs "Coefficient in Bridgmans table, see info for usage";
-    Real dgs=alpha*v*s - v*cp/T
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dsg=-dgs "Coefficient in Bridgmans table, see info for usage";
-    // Derivatives at constant u
-    Real dhu=p*alpha*v*v + gamma*v*cp*p - v*cp - p*T*alpha*alpha*v*v
-      "Coefficient in Bridgmans table, see info for usage";
-    Real duh=-dhu "Coefficient in Bridgmans table, see info for usage";
-    Real dfu=s*T*alpha*v - gamma*v*cp*p - gamma*v*s*p + p*T*alpha*alpha*v*v
-      "Coefficient in Bridgmans table, see info for usage";
-    Real duf=-dfu "Coefficient in Bridgmans table, see info for usage";
-    Real dgu=alpha*v*v*p + alpha*v*s*T - v*cp - gamma*v*s*p
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dug=-dgu "Coefficient in Bridgmans table, see info for usage";
-    //  Derivatives at constant h
-    Real dfh=(s - v*alpha*p)*(v - v*alpha*T) - gamma*v*cp*p
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dhf=-dfh "Coefficient in Bridgmans table, see info for usage";
-    Real dgh=alpha*v*s*T - v*(s + cp)
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dhg=-dgh "Coefficient in Bridgmans table, see info for usage";
-    // Derivatives at constant g
-    Real dfg=gamma*v*s*p - v*s - alpha*v*v*p
-      "Coefficient in Bridgmans table, see info for usage";
-    Real dgf=-dfg "Coefficient in Bridgmans table, see info for usage";
-    annotation (Documentation(info="<html>
-<p>
-Important: the phase equilibrium conditions are not yet considered.
-this means that Bridgman's tables do not yet work in the two phase region.
-Some derivatives are 0 or infinity anyways.
-Idea: Do not use the values in Bridgmans table directly, all
-derivatives are calculated as the quotient of two entries in the
-table. The last letter indicates which variable is held constant in
-taking the derivative. The second letters are the two variables
-involved in the derivative and the first letter is always a d to remind
-of differentiation.
-</p>
-
-<pre>
-Example 1: Get the derivative of specific entropy s w.r.t. Temperature at
-constant specific volume (between identical to constant density)
-constant volume  --> last letter v
-Temperature      --> second letter T
-Specific entropy --> second letter s
---> the needed value is dsv/dTv
-Known variables:
-Temperature T
-pressure p
-specific volume v
-specific inner energy u
-specific enthalpy h
-specific entropy s
-specific Helmholtz energy f
-specific gibbs enthalpy g
-Not included but useful:
-density d
-In order to convert derivatives involving density use the following
-rules:
-at constant density == at constant specific volume
-ddx/dyx = -d*d*dvx/dyx with y,x any of T,p,u,h,s,f,g
-dyx/ddx = -1/(d*d)dyx/dvx with y,x any of T,p,u,h,s,f,g
-Usage example assuming water as the medium:
-model BridgmansTablesForWater
-extends ThermoFluid.BaseClasses.MediumModels.Water.WaterSteamMedium_ph;
-Real derOfsByTAtConstantv \"derivative of sp. entropy by temperature at constant sp. volume\"
-ThermoFluid.BaseClasses.MediumModels.Common.ExtraDerivatives dpro;
-ThermoFluid.BaseClasses.MediumModels.Common.BridgmansTables bt;
-equation
-dpro = ThermoFluid.BaseClasses.MediumModels.SteamIF97.extraDerivs_pT(p[1],T[1]);
-bt.p = p[1];
-bt.T = T[1];
-bt.v = 1/pro[1].d;
-bt.s = pro[1].s;
-bt.cp = pro[1].cp;
-bt.alpha = dpro.alpha;
-bt.gamma = dpro.gamma;
-derOfsByTAtConstantv =  bt.dsv/bt.dTv;
-                ...
-end BridgmansTablesForWater;
-                </pre>
-
-                </html>"));
-  end BridgmansTables;
-
-  record FundamentalConstants "Constants of the medium"
-    extends Modelica.Icons.Record;
-    Units.SI.MolarHeatCapacity R_bar;
-    Units.SI.SpecificHeatCapacity R;
-    Units.SI.MolarMass MM;
-    Units.SI.MolarDensity rhored;
-    Units.SI.Temperature Tred;
-    Units.SI.AbsolutePressure pred;
-    Units.SI.SpecificEnthalpy h_off;
-    Units.SI.SpecificEntropy s_off;
-  end FundamentalConstants;
-
-  record AuxiliaryProperties "Intermediate property data record"
-    extends Modelica.Icons.Record;
-    Units.SI.Pressure p "Pressure";
-    Units.SI.Temperature T "Temperature";
-    Units.SI.SpecificEnthalpy h "Specific enthalpy";
-    Units.SI.SpecificHeatCapacity R "Gas constant";
-    Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
-    Units.SI.SpecificHeatCapacity cv "Specific heat capacity";
-    Units.SI.Density rho "Density";
-    Units.SI.SpecificEntropy s "Specific entropy";
-    Units.SI.DerPressureByTemperature pt
-      "Derivative of pressure w.r.t. temperature";
-    Units.SI.DerPressureByDensity pd
-      "Derivative of pressure w.r.t. density";
-    Real vt "Derivative of specific volume w.r.t. temperature";
-    Real vp "Derivative of specific volume w.r.t. pressure";
-  end AuxiliaryProperties;
-
-  record GibbsDerivs2
-    "Derivatives of Gibbs function w.r.t. pressure and temperature"
-
-    extends Modelica.Icons.Record;
-    Units.SI.Pressure p "Pressure";
-    Units.SI.Temperature T "Temperature";
-    Units.SI.SpecificHeatCapacity R "Specific heat capacity";
-    Real pi(unit="1") "Dimensionless pressure";
-    Real theta(unit="1") "Dimensionless temperature";
-    Real g(unit="J/kg") "Gibbs function";
-    Real gp(unit="m3/kg") "Derivative of g w.r.t. p";
-    Real gpp(unit="m3/(kg.Pa)") "2nd derivative of g w.r.t. p";
-    Real gT(unit="J/(kg.K)") "Derivative of g w.r.t. T";
-    Real gTT(unit="J/(kg.K2)") "2nd derivative of g w.r.t. T";
-    Real gTp(unit="m3/(kg.K)") "Mixed derivative of g w.r.t. T and p";
-  end GibbsDerivs2;
-
-  record NewtonDerivatives_dT
-    "Derivatives for fast inverse calculations of Gibbs function"
-    extends Modelica.Icons.Record;
-    Units.SI.SpecificVolume v "Specific volume";
-    Real vp "Derivative of specific volume w.r.t. pressure";
-  end NewtonDerivatives_dT;
-
-  function gibbsToBridgmansTables
-    "Calculates base coefficients for Bridgman's tables from gibbs enthalpy"
-
-    extends Modelica.Icons.Function;
-    input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
-    output Units.SI.SpecificVolume v "Specific volume";
-    output Units.SI.Pressure p=g.p "Pressure";
-    output Units.SI.Temperature T=g.T "Temperature";
-    output Units.SI.SpecificEntropy s "Specific entropy";
-    output Units.SI.SpecificHeatCapacity cp
-      "Heat capacity at constant pressure";
-    output IsobaricVolumeExpansionCoefficient alpha
-      "Isobaric volume expansion coefficient";
-    // beta in Bejan
-    output IsothermalCompressibility gamma "Isothermal compressibility";
-    // kappa in Bejan
-  protected
-    Real vt(unit="m3/(kg.K)")
-      "Derivative of specific volume w.r.t. temperature";
-    Real vp(unit="m4.kg-2.s2") "Derivative of specific volume w.r.t. pressure";
-  algorithm
-    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-    v := (g.R*g.T*g.pi*g.gpi)/g.p;
-    s := g.R*(g.tau*g.gtau - g.g);
-    cp := -g.R*g.tau*g.tau*g.gtautau;
-    alpha := vt/v;
-    gamma := -vp/v;
-  end gibbsToBridgmansTables;
-
-  function helmholtzToBridgmansTables
-    "Calculates base coefficients for Bridgmans tables from Helmholtz energy"
-    extends Modelica.Icons.Function;
-    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
-    output Units.SI.SpecificVolume v=1/f.d "Specific volume";
-    output Units.SI.Pressure p "Pressure";
-    output Units.SI.Temperature T=f.T "Temperature";
-    output Units.SI.SpecificEntropy s "Specific entropy";
-    output Units.SI.SpecificHeatCapacity cp
-      "Heat capacity at constant pressure";
-    output IsobaricVolumeExpansionCoefficient alpha
-      "Isobaric volume expansion coefficient";
-    // beta in Bejan
-    output IsothermalCompressibility gamma "Isothermal compressibility";
-    // kappa in Bejan
-  protected
-    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-    DerPressureBySpecificVolume pv
-      "Derivative of pressure w.r.t. specific volume";
-    Units.SI.SpecificHeatCapacity cv "Isochoric specific heat capacity";
-  algorithm
-    p := f.R*f.d*f.T*f.delta*f.fdelta;
-    pv := -(f.d*f.d)*f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    s := f.R*(f.tau*f.ftau - f.f);
-    alpha := -f.d*pt/pv;
-    gamma := -f.d/pv;
-    cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)
-      ^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-  end helmholtzToBridgmansTables;
-
-  function gibbsToBoundaryProps
-    "Calculate phase boundary property record from dimensionless Gibbs function"
-
-    extends Modelica.Icons.Function;
-    input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
-    output PhaseBoundaryProperties sat "Phase boundary properties";
-  protected
-    Real vt "Derivative of specific volume w.r.t. temperature";
-    Real vp "Derivative of specific volume w.r.t. pressure";
-  algorithm
-    sat.d := g.p/(g.R*g.T*g.pi*g.gpi);
-    sat.h := g.R*g.T*g.tau*g.gtau;
-    sat.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-    sat.s := g.R*(g.tau*g.gtau - g.g);
-    sat.cp := -g.R*g.tau*g.tau*g.gtautau;
-    sat.cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
-      *g.gtaupi)/(g.gpipi));
-    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-    // sat.kappa := -1/(sat.d*g.p)*sat.cp/(vp*sat.cp + vt*vt*g.T);
-    sat.pt := -g.p/g.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
-    sat.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-  end gibbsToBoundaryProps;
-
-  function helmholtzToBoundaryProps
-    "Calculate phase boundary property record from dimensionless Helmholtz function"
-
-    extends Modelica.Icons.Function;
-    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
-    output PhaseBoundaryProperties sat "Phase boundary property record";
-  protected
-    Units.SI.Pressure p "Pressure";
-  algorithm
-    p := f.R*f.d*f.T*f.delta*f.fdelta;
-    sat.d := f.d;
-    sat.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
-    sat.s := f.R*(f.tau*f.ftau - f.f);
-    sat.u := f.R*f.T*f.tau*f.ftau;
-    sat.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)
-      ^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-    sat.cv := f.R*(-f.tau*f.tau*f.ftautau);
-    sat.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    sat.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-  end helmholtzToBoundaryProps;
-
-  function cv2Phase
-    "Compute isochoric specific heat capacity inside the two-phase region"
-
-    extends Modelica.Icons.Function;
-    input PhaseBoundaryProperties liq "Properties on the boiling curve";
-    input PhaseBoundaryProperties vap "Properties on the condensation curve";
-    input Units.SI.MassFraction x "Vapour mass fraction";
-    input Units.SI.Temperature T "Temperature";
-    input Units.SI.Pressure p "Properties";
-    output Units.SI.SpecificHeatCapacity cv
-      "Isochoric specific heat capacity";
-  protected
-    Real dpT "Derivative of pressure w.r.t. temperature";
-    Real dxv "Derivative of vapour mass fraction w.r.t. specific volume";
-    Real dvTl "Derivative of liquid specific volume w.r.t. temperature";
-    Real dvTv "Derivative of vapour specific volume w.r.t. temperature";
-    Real duTl "Derivative of liquid specific inner energy w.r.t. temperature";
-    Real duTv "Derivative of vapour specific inner energy w.r.t. temperature";
-    Real dxt "Derivative of vapour mass fraction w.r.t. temperature";
-  algorithm
-    dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d - vap.d) else 0.0;
-    dpT := (vap.s - liq.s)*dxv;
-    // wrong at critical point
-    dvTl := (liq.pt - dpT)/liq.pd/liq.d/liq.d;
-    dvTv := (vap.pt - dpT)/vap.pd/vap.d/vap.d;
-    dxt := -dxv*(dvTl + x*(dvTv - dvTl));
-    duTl := liq.cv + (T*liq.pt - p)*dvTl;
-    duTv := vap.cv + (T*vap.pt - p)*dvTv;
-    cv := duTl + x*(duTv - duTl) + dxt*(vap.u - liq.u);
-  end cv2Phase;
-
-  function cvdpT2Phase
-    "Compute isochoric specific heat capacity inside the two-phase region and derivative of pressure w.r.t. temperature"
-
-    extends Modelica.Icons.Function;
-    input PhaseBoundaryProperties liq "Properties on the boiling curve";
-    input PhaseBoundaryProperties vap "Properties on the condensation curve";
-    input Units.SI.MassFraction x "Vapour mass fraction";
-    input Units.SI.Temperature T "Temperature";
-    input Units.SI.Pressure p "Properties";
-    output Units.SI.SpecificHeatCapacity cv
-      "Isochoric specific heat capacity";
-    output Real dpT "Derivative of pressure w.r.t. temperature";
-  protected
-    Real dxv "Derivative of vapour mass fraction w.r.t. specific volume";
-    Real dvTl "Derivative of liquid specific volume w.r.t. temperature";
-    Real dvTv "Derivative of vapour specific volume w.r.t. temperature";
-    Real duTl "Derivative of liquid specific inner energy w.r.t. temperature";
-    Real duTv "Derivative of vapour specific inner energy w.r.t. temperature";
-    Real dxt "Derivative of vapour mass fraction w.r.t. temperature";
-  algorithm
-    dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d - vap.d) else 0.0;
-    dpT := (vap.s - liq.s)*dxv;
-    // wrong at critical point
-    dvTl := (liq.pt - dpT)/liq.pd/liq.d/liq.d;
-    dvTv := (vap.pt - dpT)/vap.pd/vap.d/vap.d;
-    dxt := -dxv*(dvTl + x*(dvTv - dvTl));
-    duTl := liq.cv + (T*liq.pt - p)*dvTl;
-    duTv := vap.cv + (T*vap.pt - p)*dvTv;
-    cv := duTl + x*(duTv - duTl) + dxt*(vap.u - liq.u);
-  end cvdpT2Phase;
-
-  function gibbsToExtraDerivs
-    "Compute additional thermodynamic derivatives from dimensionless Gibbs function"
-
-    extends Modelica.Icons.Function;
-    input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
-    output ExtraDerivatives dpro "Additional property derivatives";
-  protected
-    Real vt "Derivative of specific volume w.r.t. temperature";
-    Real vp "Derivative of specific volume w.r.t. pressure";
-    Units.SI.Density d "Density";
-    Units.SI.SpecificVolume v "Specific volume";
-    Units.SI.SpecificHeatCapacity cv "Isochoric heat capacity";
-    Units.SI.SpecificHeatCapacity cp "Isobaric heat capacity";
-  algorithm
-    d := g.p/(g.R*g.T*g.pi*g.gpi);
-    v := 1/d;
-    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-    cp := -g.R*g.tau*g.tau*g.gtautau;
-    cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
-      *g.gtaupi)/g.gpipi);
-    dpro.kappa := -1/(d*g.p)*cp/(vp*cp + vt*vt*g.T);
-    dpro.theta := cp/(d*g.p*(-vp*cp + vt*v - g.T*vt*vt));
-    dpro.alpha := d*vt;
-    dpro.beta := -vt/(g.p*vp);
-    dpro.gamma := -d*vp;
-    dpro.mu := -(v - g.T*vt)/cp;
-  end gibbsToExtraDerivs;
-
-  function helmholtzToExtraDerivs
-    "Compute additional thermodynamic derivatives from dimensionless Helmholtz function"
-
-    extends Modelica.Icons.Function;
-    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
-    output ExtraDerivatives dpro "Additional property derivatives";
-  protected
-    Units.SI.Pressure p "Pressure";
-    Units.SI.SpecificVolume v "Specific volume";
-    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
-    DerPressureBySpecificVolume pv
-      "Derivative of pressure w.r.t. specific volume";
-    Units.SI.SpecificHeatCapacity cv "Isochoric specific heat capacity";
-  algorithm
-    v := 1/f.d;
-    p := f.R*f.d*f.T*f.delta*f.fdelta;
-    pv := -(f.d*f.d)*f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    cv := f.R*(-f.tau*f.tau*f.ftautau);
-    dpro.kappa := 1/(f.d*p)*((-pv*cv + pt*pt*f.T)/(cv));
-    dpro.theta := -1/(f.d*p)*((-pv*cv + f.T*pt*pt)/(cv + pt*v));
-    dpro.alpha := -f.d*pt/pv;
-    dpro.beta := pt/p;
-    dpro.gamma := -f.d/pv;
-    dpro.mu := (v*pv + f.T*pt)/(pt*pt*f.T - pv*cv);
-  end helmholtzToExtraDerivs;
-
-  function Helmholtz_ph
-    "Function to calculate analytic derivatives for computing d and t given p and h"
-    extends Modelica.Icons.Function;
-    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
-    output NewtonDerivatives_ph nderivs
-      "Derivatives for Newton iteration to calculate d and t from p and h";
-  protected
-    Units.SI.SpecificHeatCapacity cv "Isochoric heat capacity";
-  algorithm
-    cv := -f.R*(f.tau*f.tau*f.ftautau);
-    nderivs.p := f.d*f.R*f.T*f.delta*f.fdelta;
-    nderivs.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
-    nderivs.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    nderivs.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    nderivs.ht := cv + nderivs.pt/f.d;
-    nderivs.hd := (nderivs.pd - f.T*nderivs.pt/f.d)/f.d;
-  end Helmholtz_ph;
-
-  function Helmholtz_pT
-    "Function to calculate analytic derivatives for computing d and t given p and t"
-
-    extends Modelica.Icons.Function;
-    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
-    output NewtonDerivatives_pT nderivs
-      "Derivatives for Newton iteration to compute d and t from p and t";
-  algorithm
-    nderivs.p := f.d*f.R*f.T*f.delta*f.fdelta;
-    nderivs.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-  end Helmholtz_pT;
-
-  function Helmholtz_ps
-    "Function to calculate analytic derivatives for computing d and t given p and s"
-
-    extends Modelica.Icons.Function;
-    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
-    output NewtonDerivatives_ps nderivs
-      "Derivatives for Newton iteration to compute d and t from p and s";
-  protected
-    Units.SI.SpecificHeatCapacity cv "Isochoric heat capacity";
-  algorithm
-    cv := -f.R*(f.tau*f.tau*f.ftautau);
-    nderivs.p := f.d*f.R*f.T*f.delta*f.fdelta;
-    nderivs.s := f.R*(f.tau*f.ftau - f.f);
-    nderivs.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    nderivs.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    nderivs.st := cv/f.T;
-    nderivs.sd := -nderivs.pt/(f.d*f.d);
-  end Helmholtz_ps;
-
-  function smoothStep
-    "Approximation of a general step, such that the characteristic is continuous and differentiable"
-    extends Modelica.Icons.Function;
-    input Real x "Abscissa value";
-    input Real y1 "Ordinate value for x > 0";
-    input Real y2 "Ordinate value for x < 0";
-    input Real x_small(min=0) = 1e-5
-      "Approximation of step for -x_small <= x <= x_small; x_small > 0 required";
-    output Real y "Ordinate value to approximate y = if x > 0 then y1 else y2";
-  algorithm
-    y := smooth(1, if x > x_small then y1 else if x < -x_small then y2 else if
-      abs(x_small) > 0 then (x/x_small)*((x/x_small)^2 - 3)*(y2 - y1)/4 + (y1
-       + y2)/2 else (y1 + y2)/2);
-
-    annotation (
-      Inline=true,
-      smoothOrder=1,
-      Documentation(revisions="<html>
-<ul>
-<li><i>April 29, 2008</i>
-    by <a href=\"mailto:Martin.Otter@DLR.de\">Martin Otter</a>:<br>
-    Designed and implemented.</li>
-<li><i>August 12, 2008</i>
-    by <a href=\"mailto:Michael.Sielemann@dlr.de\">Michael Sielemann</a>:<br>
-    Minor modification to cover the limit case <code>x_small -> 0</code> without division by zero.</li>
-</ul>
-</html>", info="<html>
-<p>
-This function is used to approximate the equation
-</p>
-<pre>
-    y = <b>if</b> x &gt; 0 <b>then</b> y1 <b>else</b> y2;
-</pre>
-
-<p>
-by a smooth characteristic, so that the expression is continuous and differentiable:
-</p>
-
-<pre>
-   y = <b>smooth</b>(1, <b>if</b> x &gt;  x_small <b>then</b> y1 <b>else</b>
-                 <b>if</b> x &lt; -x_small <b>then</b> y2 <b>else</b> f(y1, y2));
-</pre>
-
-<p>
-In the region -x_small &lt; x &lt; x_small a 2nd order polynomial is used
-for a smooth transition from y1 to y2.
-</p>
-
-<p>
-If <b>mass fractions</b> X[:] are approximated with this function then this can be performed
-for all <b>nX</b> mass fractions, instead of applying it for nX-1 mass fractions and computing
-the last one by the mass fraction constraint sum(X)=1. The reason is that the approximating function has the
-property that sum(X) = 1, provided sum(X_a) = sum(X_b) = 1
-(and y1=X_a[i], y2=X_b[i]).
-This can be shown by evaluating the approximating function in the abs(x) &lt; x_small
-region (otherwise X is either X_a or X_b):
-</p>
-
-<pre>
-    X[1]  = smoothStep(x, X_a[1] , X_b[1] , x_small);
-    X[2]  = smoothStep(x, X_a[2] , X_b[2] , x_small);
-       ...
-    X[nX] = smoothStep(x, X_a[nX], X_b[nX], x_small);
-</pre>
-
-<p>
-or
-</p>
-
-<pre>
-    X[1]  = c*(X_a[1]  - X_b[1])  + (X_a[1]  + X_b[1])/2
-    X[2]  = c*(X_a[2]  - X_b[2])  + (X_a[2]  + X_b[2])/2;
-       ...
-    X[nX] = c*(X_a[nX] - X_b[nX]) + (X_a[nX] + X_b[nX])/2;
-    c     = (x/x_small)*((x/x_small)^2 - 3)/4
-</pre>
-
-<p>
-Summing all mass fractions together results in
-</p>
-
-<pre>
-    sum(X) = c*(sum(X_a) - sum(X_b)) + (sum(X_a) + sum(X_b))/2
-           = c*(1 - 1) + (1 + 1)/2
-           = 1
-</pre>
-</html>"));
-  end smoothStep;
-
-  function Gibbs2_ph
-    "Function to calculate analytic derivatives for computing T given p and h"
-    extends Modelica.Icons.Function;
-    input ThermoSysPro.Properties.Common.GibbsDerivs2 g
-      "Dimensionless derivatives of Gibbs function";
-    output ThermoSysPro.Properties.Common.NewtonDerivatives_ph nderivs
-      "Derivatives for Newton iteration to calculate d and t from p and h";
-
-  algorithm
-    nderivs.h := g.g - g.T*g.gT;
-    nderivs.ht := -g.T*g.gTT;
-
-    //dummy values - DO NOT USE
-    nderivs.p := 0.0;
-    nderivs.pd := 0.0;
-    nderivs.pt := 0.0;
-    nderivs.hd := 0.0;
-  end Gibbs2_ph;
-
-  function Gibbs2_dT
-    "Function to calculate analytic derivatives for computing p given d and T"
-    extends Modelica.Icons.Function;
-    input ThermoSysPro.Properties.Common.GibbsDerivs2 g
-      "Dimensionless derivatives of Gibbs function";
-    output ThermoSysPro.Properties.Common.NewtonDerivatives_dT nderivs
-      "Derivatives for Newton iteration to compute p from d and T";
-
-  algorithm
-    nderivs.v := g.gp;
-    nderivs.vp := nderivs.v*g.gpp/g.gp;
-  end Gibbs2_dT;
-
-  function Gibbs2_ps
-    "Function to calculate analytic derivatives for computing d and t given p and s"
-
-    extends Modelica.Icons.Function;
-    input ThermoSysPro.Properties.Common.GibbsDerivs2 g
-      "Dimensionless derivatives of Gibbs function";
-    output ThermoSysPro.Properties.Common.NewtonDerivatives_ps nderivs
-      "Derivatives for Newton iteration to compute T from p and s";
-
-  algorithm
-    nderivs.s := -g.gT;
-    nderivs.st := -g.gTT;
-
-    //dummy values - DO NOT USE
-    nderivs.p := 0.0;
-    nderivs.pd := 0.0;
-    nderivs.pt := 0.0;
-    nderivs.sd := 0.0;
-  end Gibbs2_ps;
-
-  package OneNonLinearEquation
-    "Determine solution of a non-linear algebraic equation in one unknown without derivatives in a reliable and efficient way"
-    extends Modelica.Icons.Package;
-
-    replaceable record f_nonlinear_Data
-      "Data specific for function f_nonlinear"
-      extends Modelica.Icons.Record;
-    end f_nonlinear_Data;
-
-    replaceable partial function f_nonlinear
-      "Nonlinear algebraic equation in one unknown: y = f_nonlinear(x,p,X)"
-      extends Modelica.Icons.Function;
-      input Real x "Independent variable of function";
-      input Real p=0.0 "Disregarded variables (here always used for pressure)";
-      input Real[:] X=fill(0, 0)
-        "Disregarded variables (her always used for composition)";
-      input f_nonlinear_Data f_nonlinear_data
-        "Additional data for the function";
-      output Real y "= f_nonlinear(x)";
-      // annotation(derivative(zeroDerivative=y)); // this must hold for all replaced functions
-    end f_nonlinear;
-
-    replaceable function solve
-      "Solve f_nonlinear(x_zero)=y_zero; f_nonlinear(x_min) - y_zero and f_nonlinear(x_max)-y_zero must have different sign"
-      import Modelica.Utilities.Streams.error;
-      extends Modelica.Icons.Function;
-      input Real y_zero
-        "Determine x_zero, such that f_nonlinear(x_zero) = y_zero";
-      input Real x_min "Minimum value of x";
-      input Real x_max "Maximum value of x";
-      input Real pressure=0.0
-        "Disregarded variables (here always used for pressure)";
-      input Real[:] X=fill(0, 0)
-        "Disregarded variables (here always used for composition)";
-      input f_nonlinear_Data f_nonlinear_data
-        "Additional data for function f_nonlinear";
-      input Real x_tol=100*Modelica.Constants.eps
-        "Relative tolerance of the result";
-      output Real x_zero "f_nonlinear(x_zero) = y_zero";
-    protected
-      constant Real eps=Modelica.Constants.eps "Machine epsilon";
-      constant Real x_eps=1e-10
-        "Slight modification of x_min, x_max, since x_min, x_max are usually exactly at the borders T_min/h_min and then small numeric noise may make the interval invalid";
-      Real x_min2=x_min - x_eps;
-      Real x_max2=x_max + x_eps;
-      Real a=x_min2 "Current best minimum interval value";
-      Real b=x_max2 "Current best maximum interval value";
-      Real c "Intermediate point a <= c <= b";
-      Real d;
-      Real e "b - a";
-      Real m;
-      Real s;
-      Real p;
-      Real q;
-      Real r;
-      Real tol;
-      Real fa "= f_nonlinear(a) - y_zero";
-      Real fb "= f_nonlinear(b) - y_zero";
-      Real fc;
-      Boolean found=false;
-    algorithm
-      // Check that f(x_min) and f(x_max) have different sign
-      fa := f_nonlinear(
-              x_min2,
-              pressure,
-              X,
-              f_nonlinear_data) - y_zero;
-      fb := f_nonlinear(
-              x_max2,
-              pressure,
-              X,
-              f_nonlinear_data) - y_zero;
-      fc := fb;
-      if fa > 0.0 and fb > 0.0 or fa < 0.0 and fb < 0.0 then
-        error(
-          "The arguments x_min and x_max to OneNonLinearEquation.solve(..)\n"
-           + "do not bracket the root of the single non-linear equation:\n" +
-          "  x_min  = " + String(x_min2) + "\n" + "  x_max  = " + String(x_max2)
-           + "\n" + "  y_zero = " + String(y_zero) + "\n" +
-          "  fa = f(x_min) - y_zero = " + String(fa) + "\n" +
-          "  fb = f(x_max) - y_zero = " + String(fb) + "\n" +
-          "fa and fb must have opposite sign which is not the case");
-      end if;
-
-      // Initialize variables
-      c := a;
-      fc := fa;
-      e := b - a;
-      d := e;
-
-      // Search loop
-      while not found loop
-        if abs(fc) < abs(fb) then
-          a := b;
-          b := c;
-          c := a;
-          fa := fb;
-          fb := fc;
-          fc := fa;
-        end if;
-
-        tol := 2*eps*abs(b) + x_tol;
-        m := (c - b)/2;
-
-        if abs(m) <= tol or fb == 0.0 then
-          // root found (interval is small enough)
-          found := true;
-          x_zero := b;
-        else
-          // Determine if a bisection is needed
-          if abs(e) < tol or abs(fa) <= abs(fb) then
-            e := m;
-            d := e;
-          else
-            s := fb/fa;
-            if a == c then
-              // linear interpolation
-              p := 2*m*s;
-              q := 1 - s;
-            else
-              // inverse quadratic interpolation
-              q := fa/fc;
-              r := fb/fc;
-              p := s*(2*m*q*(q - r) - (b - a)*(r - 1));
-              q := (q - 1)*(r - 1)*(s - 1);
-            end if;
-
-            if p > 0 then
-              q := -q;
-            else
-              p := -p;
-            end if;
-
-            s := e;
-            e := d;
-            if 2*p < 3*m*q - abs(tol*q) and p < abs(0.5*s*q) then
-              // interpolation successful
-              d := p/q;
-            else
-              // use bi-section
-              e := m;
-              d := e;
-            end if;
-          end if;
-
-          // Best guess value is defined as "a"
-          a := b;
-          fa := fb;
-          b := b + (if abs(d) > tol then d else if m > 0 then tol else -tol);
-          fb := f_nonlinear(
-                  b,
-                  pressure,
-                  X,
-                  f_nonlinear_data) - y_zero;
-
-          if fb > 0 and fc > 0 or fb < 0 and fc < 0 then
-            // initialize variables
-            c := a;
-            fc := fa;
-            e := b - a;
-            d := e;
-          end if;
-        end if;
-      end while;
-    end solve;
-
-    annotation (Documentation(info="<html>
-<p>
-This function should currently only be used in Modelica.Media,
-since it might be replaced in the future by another strategy,
-where the tool is responsible for the solution of the non-linear
-equation.
-</p>
-
-<p>
-This library determines the solution of one non-linear algebraic equation \"y=f(x)\"
-in one unknown \"x\" in a reliable way. As input, the desired value y of the
-non-linear function has to be given, as well as an interval x_min, x_max that
-contains the solution, i.e., \"f(x_min) - y\" and \"f(x_max) - y\" must
-have a different sign. If possible, a smaller interval is computed by
-inverse quadratic interpolation (interpolating with a quadratic polynomial
-through the last 3 points and computing the zero). If this fails,
-bisection is used, which always reduces the interval by a factor of 2.
-The inverse quadratic interpolation method has superlinear convergence.
-This is roughly the same convergence rate as a globally convergent Newton
-method, but without the need to compute derivatives of the non-linear
-function. The solver function is a direct mapping of the Algol 60 procedure
-\"zero\" to Modelica, from:
-</p>
-
-<dl>
-<dt> Brent R.P.:</dt>
-<dd> <b>Algorithms for Minimization without derivatives</b>.
-     Prentice Hall, 1973, pp. 58-59.</dd>
-</dl>
-
-<p>
-Due to current limitations of the
-Modelica language (not possible to pass a function reference to a function),
-the construction to use this solver on a user-defined function is a bit
-complicated (this method is from Hans Olsson, Dassault Syst&egrave;mes AB). A user has to
-provide a package in the following way:
-</p>
-
-<pre>
-  <b>package</b> MyNonLinearSolver
-    <b>extends</b> OneNonLinearEquation;
-
-    <b>redeclare record extends</b> Data
-      // Define data to be passed to user function
-      ...
-    <b>end</b> Data;
-
-    <b>redeclare function extends</b> f_nonlinear
-    <b>algorithm</b>
-       // Compute the non-linear equation: y = f(x, Data)
-    <b>end</b> f_nonlinear;
-
-    // Dummy definition that has to be present for current Dymola
-    <b>redeclare function extends</b> solve
-    <b>end</b> solve;
-  <b>end</b> MyNonLinearSolver;
-
-  x_zero = MyNonLinearSolver.solve(y_zero, x_min, x_max, data=data);
-</pre>
-</html>"));
-  end OneNonLinearEquation;
-  annotation (Documentation(info="<html>
-<p><b>Package description</b> </p>
-<p>This package provides records and functions shared by many of the property sub-packages. High accuracy fluid property models share a lot of common structure, even if the actual models are different. Common data structures and computations shared by these property models are collected in this library.</p>
-<p>This package is copied from package Modelica.Media.Common in Modelica package version 3.2.2.</p>
-</html>", revisions="<html>
-      <ul>
-      <li>First implemented: <i>July, 2000</i>
-      by Hubertus Tummescheit
-      for the ThermoFluid Library with help from Jonas Eborn and Falko Jens Wagner
-      </li>
-      <li>Code reorganization, enhanced documentation, additional functions: <i>December, 2002</i>
-      by Hubertus Tummescheit and move to Modelica
-                            properties library.</li>
-      <li>Inclusion into Modelica.Media: September 2003 </li>
-      </ul>
-
-      <address>Author: Hubertus Tummescheit, <br>
-      Lund University<br>
-      Department of Automatic Control<br>
-      Box 118, 22100 Lund, Sweden<br>
-      email: hubertus@control.lth.se
-      </address>
-</html>"), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Ellipse(
-          lineColor={102,102,102},
-          fillColor={204,204,204},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Sphere,
-          extent={{-60.0,-60.0},{60.0,60.0}})}));
-end Common;
+within ThermoSysPro.Properties;
+package Common
+  "Data structures and fundamental functions for fluid properties"
+
+  type Rate = Real (final quantity="Rate", final unit="s-1");
+  type MolarFlowRate = Real (final quantity="MolarFlowRate", final unit="mol/s");
+  type MolarReactionRate = Real (final quantity="MolarReactionRate", final unit=
+         "mol/(m3.s)");
+  type MolarEnthalpy = Real (final quantity="MolarEnthalpy", final unit="J/mol");
+  type DerDensityByEntropy = Real (final quantity="DerDensityByEntropy", final
+        unit="kg2.K/(m3.J)");
+  type DerEnergyByPressure = Real (final quantity="DerEnergyByPressure", final
+        unit="J/Pa");
+  type DerEnergyByMoles = Real (final quantity="DerEnergyByMoles", final unit=
+          "J/mol");
+  type DerEntropyByTemperature = Real (final quantity="DerEntropyByTemperature",
+        final unit="J/K2");
+  type DerEntropyByPressure = Real (final quantity="DerEntropyByPressure",
+        final unit="J/(K.Pa)");
+  type DerEntropyByMoles = Real (final quantity="DerEntropyByMoles", final unit=
+         "J/(mol.K)");
+  type DerPressureByDensity = Real (final quantity="DerPressureByDensity",
+        final unit="Pa.m3/kg");
+  type DerPressureBySpecificVolume = Real (final quantity=
+          "DerPressureBySpecificVolume", final unit="Pa.kg/m3");
+  type DerPressureByTemperature = Real (final quantity=
+          "DerPressureByTemperature", final unit="Pa/K");
+  type DerVolumeByTemperature = Real (final quantity="DerVolumeByTemperature",
+        final unit="m3/K");
+  type DerVolumeByPressure = Real (final quantity="DerVolumeByPressure", final
+        unit="m3/Pa");
+  type DerVolumeByMoles = Real (final quantity="DerVolumeByMoles", final unit=
+          "m3/mol");
+  type IsenthalpicExponent = Real (final quantity="IsenthalpicExponent", unit=
+          "1");
+  type IsentropicExponent = Real (final quantity="IsentropicExponent", unit="1");
+  type IsobaricVolumeExpansionCoefficient = Real (final quantity=
+          "IsobaricVolumeExpansionCoefficient", unit="1/K");
+  type IsochoricPressureCoefficient = Real (final quantity=
+          "IsochoricPressureCoefficient", unit="1/K");
+  type IsothermalCompressibility = Real (final quantity=
+          "IsothermalCompressibility", unit="1/Pa");
+  type JouleThomsonCoefficient = Real (final quantity="JouleThomsonCoefficient",
+        unit="K/Pa");
+  // introduce min-manx-nominal values
+  constant Real MINPOS=1.0e-9
+    "Minimal value for physical variables which are always > 0.0";
+
+  constant Units.SI.Area AMIN=MINPOS "Minimal init area";
+  constant Units.SI.Area AMAX=1.0e5 "Maximal init area";
+  constant Units.SI.Area ANOM=1.0 "Nominal init area";
+  constant Units.SI.AmountOfSubstance MOLMIN=-1.0*MINPOS
+    "Minimal Mole Number";
+  constant Units.SI.AmountOfSubstance MOLMAX=1.0e8
+    "Maximal Mole Number";
+  constant Units.SI.AmountOfSubstance MOLNOM=1.0 "Nominal Mole Number";
+  constant Units.SI.Density DMIN=1e-6 "Minimal init density";
+  constant Units.SI.Density DMAX=30.0e3 "Maximal init density";
+  constant Units.SI.Density DNOM=1.0 "Nominal init density";
+  constant Units.SI.ThermalConductivity LAMMIN=MINPOS
+    "Minimal thermal conductivity";
+  constant Units.SI.ThermalConductivity LAMNOM=1.0
+    "Nominal thermal conductivity";
+  constant Units.SI.ThermalConductivity LAMMAX=1000.0
+    "Maximal thermal conductivity";
+  constant Units.SI.DynamicViscosity ETAMIN=MINPOS
+    "Minimal init dynamic viscosity";
+  constant Units.SI.DynamicViscosity ETAMAX=1.0e8
+    "Maximal init dynamic viscosity";
+  constant Units.SI.DynamicViscosity ETANOM=100.0
+    "Nominal init dynamic viscosity";
+  constant Units.SI.Energy EMIN=-1.0e10 "Minimal init energy";
+  constant Units.SI.Energy EMAX=1.0e10 "Maximal init energy";
+  constant Units.SI.Energy ENOM=1.0e3 "Nominal init energy";
+  constant Units.SI.Entropy SMIN=-1.0e6 "Minimal init entropy";
+  constant Units.SI.Entropy SMAX=1.0e6 "Maximal init entropy";
+  constant Units.SI.Entropy SNOM=1.0e3 "Nominal init entropy";
+  constant Units.SI.MassFlowRate MDOTMIN=-1.0e5
+    "Minimal init mass flow rate";
+  constant Units.SI.MassFlowRate MDOTMAX=1.0e5
+    "Maximal init mass flow rate";
+  constant Units.SI.MassFlowRate MDOTNOM=1.0
+    "Nominal init mass flow rate";
+  constant Units.SI.MassFraction MASSXMIN=-1.0*MINPOS
+    "Minimal init mass fraction";
+  constant Units.SI.MassFraction MASSXMAX=1.0
+    "Maximal init mass fraction";
+  constant Units.SI.MassFraction MASSXNOM=0.1
+    "Nominal init mass fraction";
+  constant Units.SI.Mass MMIN=-1.0*MINPOS "Minimal init mass";
+  constant Units.SI.Mass MMAX=1.0e8 "Maximal init mass";
+  constant Units.SI.Mass MNOM=1.0 "Nominal init mass";
+  constant Units.SI.MolarMass MMMIN=0.001 "Minimal initial molar mass";
+  constant Units.SI.MolarMass MMMAX=250.0 "Maximal initial molar mass";
+  constant Units.SI.MolarMass MMNOM=0.2 "Nominal initial molar mass";
+  constant Units.SI.MoleFraction MOLEYMIN=-1.0*MINPOS
+    "Minimal init mole fraction";
+  constant Units.SI.MoleFraction MOLEYMAX=1.0
+    "Maximal init mole fraction";
+  constant Units.SI.MoleFraction MOLEYNOM=0.1
+    "Nominal init mole fraction";
+  constant Units.SI.MomentumFlux GMIN=-1.0e8
+    "Minimal init momentum flux";
+  constant Units.SI.MomentumFlux GMAX=1.0e8
+    "Maximal init momentum flux";
+  constant Units.SI.MomentumFlux GNOM=1.0 "Nominal init momentum flux";
+  constant Units.SI.Power POWMIN=-1.0e8 "Minimal init power or heat";
+  constant Units.SI.Power POWMAX=1.0e8 "Maximal init power or heat";
+  constant Units.SI.Power POWNOM=1.0e3 "Nominal init power or heat";
+  constant Units.SI.Pressure PMIN=1.0e4 "Minimal init pressure";
+  constant Units.SI.Pressure PMAX=1.0e8 "Maximal init pressure";
+  constant Units.SI.Pressure PNOM=1.0e5 "Nominal init pressure";
+  constant Units.SI.Pressure COMPPMIN=-1.0*MINPOS
+    "Minimal init pressure";
+  constant Units.SI.Pressure COMPPMAX=1.0e8 "Maximal init pressure";
+  constant Units.SI.Pressure COMPPNOM=1.0e5 "Nominal init pressure";
+  constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMIN=1.0
+    "Minimal init isentropic exponent";
+  constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMAX=1.7
+    "Maximal init isentropic exponent";
+  constant Units.SI.RatioOfSpecificHeatCapacities KAPPANOM=1.2
+    "Nominal init isentropic exponent";
+  constant Units.SI.SpecificEnergy SEMIN=-1.0e8
+    "Minimal init specific energy";
+  constant Units.SI.SpecificEnergy SEMAX=1.0e8
+    "Maximal init specific energy";
+  constant Units.SI.SpecificEnergy SENOM=1.0e6
+    "Nominal init specific energy";
+  constant Units.SI.SpecificEnthalpy SHMIN=-1.0e8
+    "Minimal init specific enthalpy";
+  constant Units.SI.SpecificEnthalpy SHMAX=1.0e8
+    "Maximal init specific enthalpy";
+  constant Units.SI.SpecificEnthalpy SHNOM=1.0e6
+    "Nominal init specific enthalpy";
+  constant Units.SI.SpecificEntropy SSMIN=-1.0e6
+    "Minimal init specific entropy";
+  constant Units.SI.SpecificEntropy SSMAX=1.0e6
+    "Maximal init specific entropy";
+  constant Units.SI.SpecificEntropy SSNOM=1.0e3
+    "Nominal init specific entropy";
+  constant Units.SI.SpecificHeatCapacity CPMIN=MINPOS
+    "Minimal init specific heat capacity";
+  constant Units.SI.SpecificHeatCapacity CPMAX=1.0e6
+    "Maximal init specific heat capacity";
+  constant Units.SI.SpecificHeatCapacity CPNOM=1.0e3
+    "Nominal init specific heat capacity";
+  constant Units.SI.Temperature TMIN=1.0 "Minimal init temperature";
+  constant Units.SI.Temperature TMAX=6000.0 "Maximal init temperature";
+  constant Units.SI.Temperature TNOM=320.0 "Nominal init temperature";
+  constant Units.SI.ThermalConductivity LMIN=MINPOS
+    "Minimal init thermal conductivity";
+  constant Units.SI.ThermalConductivity LMAX=500.0
+    "Maximal init thermal conductivity";
+  constant Units.SI.ThermalConductivity LNOM=1.0
+    "Nominal init thermal conductivity";
+  constant Units.SI.Velocity VELMIN=-1.0e5 "Minimal init speed";
+  constant Units.SI.Velocity VELMAX=1.0e5 "Maximal init speed";
+  constant Units.SI.Velocity VELNOM=1.0 "Nominal init speed";
+  constant Units.SI.Volume VMIN=0.0 "Minimal init volume";
+  constant Units.SI.Volume VMAX=1.0e5 "Maximal init volume";
+  constant Units.SI.Volume VNOM=1.0e-3 "Nominal init volume";
+
+  package ThermoFluidSpecial "Property records used by the ThermoFluid library"
+
+    record FixedIGProperties "Constant properties for ideal gases"
+      extends Modelica.Icons.Record;
+      parameter Integer nspecies(min=1) "Number of components";
+      Units.SI.MolarMass[nspecies] MM "Molar mass of components";
+      Real[nspecies] invMM "Inverse of molar mass of components";
+      Units.SI.SpecificHeatCapacity[nspecies] R "Gas constant";
+      Units.SI.SpecificEnthalpy[nspecies] Hf
+        "Enthalpy of formation at 298.15K";
+      Units.SI.SpecificEnthalpy[nspecies] H0 "H0(298.15K) - H0(0K)";
+    end FixedIGProperties;
+
+    record ThermoBaseVars
+      extends Modelica.Icons.Record;
+      parameter Integer n(min=1) "Discretization number";
+      parameter Integer nspecies(min=1) "Number of species";
+      Units.SI.Pressure[n] p(
+        min=PMIN,
+        max=PMAX,
+        nominal=PNOM,
+        start=fill(1.0e5, n)) "Pressure";
+      Units.SI.Temperature[n] T(
+        min=TMIN,
+        max=TMAX,
+        nominal=TNOM) "Temperature";
+      Units.SI.Density[n] d(
+        min=DMIN,
+        max=DMAX,
+        nominal=DNOM) "Density";
+      Units.SI.SpecificEnthalpy[n] h(
+        min=SHMIN,
+        max=SHMAX,
+        nominal=SHNOM) "Specific enthalpy";
+      Units.SI.SpecificEntropy[n] s(
+        min=SSMIN,
+        max=SSMAX,
+        nominal=SSNOM) "Specific entropy";
+      Units.SI.RatioOfSpecificHeatCapacities[n] kappa "Ratio of cp/cv";
+      Units.SI.Mass[n] M(
+        min=MMIN,
+        max=MMAX,
+        nominal=MNOM) "Total mass";
+      Units.SI.Energy[n] U(
+        min=EMIN,
+        max=EMAX,
+        nominal=ENOM) "Inner energy";
+      Units.SI.MassFlowRate[n] dM(
+        min=MDOTMIN,
+        max=MDOTMAX,
+        nominal=MDOTNOM) "Change in total mass";
+      Units.SI.Power[n] dU(
+        min=POWMIN,
+        max=POWMAX,
+        nominal=POWNOM) "Change in inner energy";
+      Units.SI.Volume[n] V(
+        min=VMIN,
+        max=VMAX,
+        nominal=VNOM) "Volume";
+      Units.SI.MassFraction[n,nspecies] mass_x(
+        min=MASSXMIN,
+        max=MASSXMAX,
+        nominal=MASSXNOM) "Mass fraction";
+      Units.SI.MoleFraction[n,nspecies] mole_y(
+        min=MOLEYMIN,
+        max=MOLEYMAX,
+        nominal=MOLEYNOM) "Mole fraction";
+      Units.SI.Mass[n,nspecies] M_x(
+        min=MMIN,
+        max=MMAX,
+        nominal=MNOM) "Component mass";
+      Units.SI.MassFlowRate[n,nspecies] dM_x(
+        min=MDOTMIN,
+        max=MDOTMAX,
+        nominal=MDOTNOM) "Rate of change in component mass";
+      MolarFlowRate[n, nspecies] dZ(
+        min=-1.0e6,
+        max=1.0e6,
+        nominal=0.0) "Rate of change in component moles";
+      MolarFlowRate[n, nspecies] rZ(
+        min=-1.0e6,
+        max=1.0e6,
+        nominal=0.0) "Reaction(source) mole rates";
+      Units.SI.MolarMass[n] MM(
+        min=MMMIN,
+        max=MMMAX,
+        nominal=MMNOM) "Molar mass of mixture";
+      Units.SI.AmountOfSubstance[n] Moles(
+        min=MOLMIN,
+        max=MOLMAX,
+        nominal=MOLNOM) "Total moles";
+      Units.SI.AmountOfSubstance[n,nspecies] Moles_z(
+        min=MOLMIN,
+        max=MOLMAX,
+        nominal=MOLNOM) "Mole vector";
+      annotation (Documentation(info="<html>
+                         <h4>Model description</h4>
+                              <p>
+                              <b>ThermoBaseVars</b> is inherited by all medium property models
+                              and by all models defining the dynamic states for the conservation
+                              of mass and energy. Thus it is a good choice as a restricting class
+                              for any medium model or dynamic state model.
+                           </p>
+                              </html>"));
+    end ThermoBaseVars;
+
+    record ThermoProperties
+      "Thermodynamic base property data for all state models"
+      extends Modelica.Icons.Record;
+      parameter Integer nspecies(min=1) "Number of species";
+      Units.SI.Temperature T(
+        min=TMIN,
+        max=TMAX,
+        nominal=TNOM) "Temperature";
+      Units.SI.Density d(
+        min=DMIN,
+        max=DMAX,
+        nominal=DNOM) "Density";
+      Units.SI.Pressure p(
+        min=PMIN,
+        max=PMAX,
+        nominal=PNOM) "Pressure";
+      Units.SI.Volume V(
+        min=VMIN,
+        max=VMAX,
+        nominal=VNOM) "Volume";
+      Units.SI.SpecificEnthalpy h(
+        min=SHMIN,
+        max=SHMAX,
+        nominal=SHNOM) "Specific enthalpy";
+      Units.SI.SpecificEnergy u(
+        min=SEMIN,
+        max=SEMAX,
+        nominal=SENOM) "Specific inner energy";
+      Units.SI.SpecificEntropy s(
+        min=SSMIN,
+        max=SSMAX,
+        nominal=SSNOM) "Specific entropy";
+      Units.SI.SpecificGibbsFreeEnergy g(
+        min=SHMIN,
+        max=SHMAX,
+        nominal=SHNOM) "Specific Gibbs free energy";
+      Units.SI.SpecificHeatCapacity cp(
+        min=CPMIN,
+        max=CPMAX,
+        nominal=CPNOM) "Heat capacity at constant pressure";
+      Units.SI.SpecificHeatCapacity cv(
+        min=CPMIN,
+        max=CPMAX,
+        nominal=CPNOM) "Heat capacity at constant volume";
+      Units.SI.SpecificHeatCapacity R(
+        min=CPMIN,
+        max=CPMAX,
+        nominal=CPNOM) "Gas constant";
+      Units.SI.MolarMass MM(
+        min=MMMIN,
+        max=MMMAX,
+        nominal=MMNOM) "Molar mass of mixture";
+      Units.SI.MassFraction[nspecies] mass_x(
+        min=MASSXMIN,
+        max=MASSXMAX,
+        nominal=MASSXNOM) "Mass fraction";
+      Units.SI.MoleFraction[nspecies] mole_y(
+        min=MOLEYMIN,
+        max=MOLEYMAX,
+        nominal=MOLEYNOM) "Mole fraction";
+      Units.SI.RatioOfSpecificHeatCapacities kappa "Ratio of cp/cv";
+      Units.SI.DerDensityByTemperature ddTp
+        "Derivative of density by temperature at constant pressure";
+      Units.SI.DerDensityByPressure ddpT
+        "Derivative of density by pressure at constant temperature";
+      Real dupT(unit="m3.kg-1")
+        "Derivative of inner energy by pressure at constant T";
+      Real dudT(unit="(J.m3)/(kg2)")
+        "Derivative of inner energy by density at constant T";
+      Units.SI.SpecificHeatCapacity duTp
+        "Derivative of inner energy by temperature at constant p";
+      Units.SI.SpecificEnergy ddx[nspecies]
+        "Derivative vector of density by change in mass composition";
+      Units.SI.SpecificEnergy[nspecies] compu(
+        min=SEMIN,
+        max=SEMAX,
+        nominal=SENOM) "Inner energy of the components";
+      Units.SI.Pressure[nspecies] compp(
+        min=COMPPMIN,
+        max=COMPPMAX,
+        nominal=COMPPNOM) "partial pressures of the components";
+      Units.SI.Velocity a(
+        min=VELMIN,
+        max=VELMAX,
+        nominal=VELNOM) "Speed of sound";
+      Units.SI.HeatCapacity dUTZ
+        "Derivative of inner energy by temperature at constant moles";
+      Units.SI.MolarInternalEnergy[nspecies] dUZT
+        "Derivative of inner energy by moles at constant temperature";
+      Units.SI.SpecificEnthalpy[nspecies] dHMxT(
+        min=SEMIN,
+        max=SEMAX,
+        nominal=SENOM)
+        "Derivative of total enthalpy w.r.t. component mass at constant T";
+      Real dpT "Derivative of pressure w.r.t. temperature";
+      Real dpZ[nspecies] "Derivative of pressure w.r.t. moles";
+      annotation (Documentation(info="<html>
+        <h4>Model description</h4>
+        <p>
+        A base class for medium property models which work with most of the
+        versions of dynamic states that are available in the ThermoFluid
+        library. Currently used by all ideal gas models.
+     </p>
+        </html>"));
+    end ThermoProperties;
+
+    record ThermoProperties_ph
+      "Thermodynamic property data for pressure p and specific enthalpy h as dynamic states"
+
+      extends Modelica.Icons.Record;
+      Units.SI.Temperature T(
+        min=1.0e-9,
+        max=10000.0,
+        nominal=298.15) "Temperature";
+      Units.SI.Density d(
+        min=1.0e-9,
+        max=10000.0,
+        nominal=10.0) "Density";
+      Units.SI.SpecificEnergy u(
+        min=-1.0e8,
+        max=1.0e8,
+        nominal=1.0e6) "Specific inner energy";
+      Units.SI.SpecificEntropy s(
+        min=-1.0e6,
+        max=1.0e6,
+        nominal=1.0e3) "Specific entropy";
+      Units.SI.SpecificHeatCapacity cp(
+        min=1.0,
+        max=1.0e6,
+        nominal=1000.0) "Heat capacity at constant pressure";
+      Units.SI.SpecificHeatCapacity cv(
+        min=1.0,
+        max=1.0e6,
+        nominal=1000.0) "Heat capacity at constant volume";
+      Units.SI.SpecificHeatCapacity R(
+        min=1.0,
+        max=1.0e6,
+        nominal=1000.0) "Gas constant";
+      Units.SI.RatioOfSpecificHeatCapacities kappa "Ratio of cp/cv";
+      Units.SI.Velocity a(
+        min=1.0,
+        max=10000.0,
+        nominal=300.0) "Speed of sound";
+      Units.SI.DerDensityByEnthalpy ddhp
+        "Derivative of density by enthalpy at constant pressure";
+      Units.SI.DerDensityByPressure ddph
+        "Derivative of density by pressure at constant enthalpy";
+      Real duph(unit="m3/kg")
+        "Derivative of inner energy by pressure at constant enthalpy";
+      Real duhp(unit="1")
+        "Derivative of inner energy by enthalpy at constant pressure";
+      annotation (Documentation(info="<html>
+<h4>Model description</h4>
+<p>
+A base class for medium property models which
+use pressure and enthalpy as dynamic states.
+This is the preferred model for fluids that can also be in the
+two phase and liquid regions.
+</p>
+</html>"));
+    end ThermoProperties_ph;
+
+    record ThermoProperties_pT
+      "Thermodynamic property data for pressure p and temperature T as dynamic states"
+
+      extends Modelica.Icons.Record;
+      Units.SI.Density d(
+        min=1.0e-9,
+        max=10000.0,
+        nominal=10.0) "Density";
+      Units.SI.SpecificEnthalpy h(
+        min=-1.0e8,
+        max=1.0e8,
+        nominal=1.0e6) "Specific enthalpy";
+      Units.SI.SpecificEnergy u(
+        min=-1.0e8,
+        max=1.0e8,
+        nominal=1.0e6) "Specific inner energy";
+      Units.SI.SpecificEntropy s(
+        min=-1.0e6,
+        max=1.0e6,
+        nominal=1.0e3) "Specific entropy";
+      Units.SI.SpecificHeatCapacity cp(
+        min=1.0,
+        max=1.0e6,
+        nominal=1000.0) "Heat capacity at constant pressure";
+      Units.SI.SpecificHeatCapacity cv(
+        min=1.0,
+        max=1.0e6,
+        nominal=1000.0) "Heat capacity at constant volume";
+      Units.SI.SpecificHeatCapacity R(
+        min=1.0,
+        max=1.0e6,
+        nominal=1000.0) "Gas constant";
+      Units.SI.RatioOfSpecificHeatCapacities kappa "Ratio of cp/cv";
+      Units.SI.Velocity a(
+        min=1.0,
+        max=10000.0,
+        nominal=300.0) "Speed of sound";
+      Units.SI.DerDensityByTemperature ddTp
+        "Derivative of density by temperature at constant pressure";
+      Units.SI.DerDensityByPressure ddpT
+        "Derivative of density by pressure at constant temperature";
+      Real dupT(unit="m3.kg-1")
+        "Derivative of inner energy by pressure at constant T";
+      Units.SI.SpecificHeatCapacity duTp
+        "Derivative of inner energy by temperature at constant p";
+      annotation (Documentation(info="<html>
+<h4>Model description</h4>
+<p>
+A base class for medium property models which use pressure and temperature as dynamic states.
+This is a reasonable model for fluids that can also be in the gas and
+liquid regions, but never in the two-phase region.
+</p>
+</html>"));
+    end ThermoProperties_pT;
+
+    record ThermoProperties_dT
+      "Thermodynamic property data for density d and temperature T as dynamic states"
+
+      extends Modelica.Icons.Record;
+      Units.SI.Pressure p(
+        min=1.0,
+        max=1.0e9,
+        nominal=1.0e5) "Pressure";
+      Units.SI.SpecificEnthalpy h(
+        min=-1.0e8,
+        max=1.0e8,
+        nominal=1.0e6) "Specific enthalpy";
+      Units.SI.SpecificEnergy u(
+        min=-1.0e8,
+        max=1.0e8,
+        nominal=1.0e6) "Specific inner energy";
+      Units.SI.SpecificEntropy s(
+        min=-1.0e6,
+        max=1.0e6,
+        nominal=1.0e3) "Specific entropy";
+      Units.SI.SpecificHeatCapacity cp(
+        min=1.0,
+        max=1.0e6,
+        nominal=1000.0) "Heat capacity at constant pressure";
+      Units.SI.SpecificHeatCapacity cv(
+        min=1.0,
+        max=1.0e6,
+        nominal=1000.0) "Heat capacity at constant volume";
+      Units.SI.SpecificHeatCapacity R(
+        min=1.0,
+        max=1.0e6,
+        nominal=1000.0) "Gas constant";
+      Units.SI.RatioOfSpecificHeatCapacities kappa "Ratio of cp/cv";
+      Units.SI.Velocity a(
+        min=1.0,
+        max=10000.0,
+        nominal=300.0) "Speed of sound";
+      Real dudT(unit="m5/(kg.s2)")
+        "Derivative of inner energy by density at constant T";
+      annotation (Documentation(info="<html>
+<h4>Model description</h4>
+<p>
+A base class for medium property models which use density and temperature as dynamic states.
+This is a reasonable model for fluids that can be in the gas, liquid
+and two-phase region. The model is numerically not well suited for
+liquids except if the pressure is always above approx. 80% of the
+critical pressure.
+</p>
+</html>"));
+    end ThermoProperties_dT;
+
+    //   record GibbsDerivs
+
+    //     "Derivatives of dimensionless Gibbs-function w.r.t. dimensionless pressure and temperature"
+    //     extends Modelica.Icons.Record;
+    //     Real pi "Dimensionless pressure";
+    //     Real tau "Dimensionless temperature";
+    //     Real g "Dimensionless Gibbs-function";
+    //     Real gpi "Derivative of g w.r.t. pi";
+    //     Real gpipi "2nd derivative of g w.r.t. pi";
+    //     Real gtau "Derivative of g w.r.t. tau";
+    //     Real gtautau "2nd derivative of g w.r.t. tau";
+    //     Real gtaupi "Mixed derivative of g w.r.t. pi and tau";
+    //   end GibbsDerivs;
+
+    //   record HelmholtzDerivs
+
+    //     "Derivatives of dimensionless Helmholtz-function w.r.t. dimensionless pressure, density and temperature"
+    //     extends Modelica.Icons.Record;
+    //     Real delta "Dimensionless density";
+    //     Real tau "Dimensionless temperature";
+    //     Real f "Dimensionless Helmholtz-function";
+    //     Real fdelta "Derivative of f w.r.t. delta";
+    //     Real fdeltadelta "2nd derivative of f w.r.t. delta";
+    //     Real ftau "Derivative of f w.r.t. tau";
+    //     Real ftautau "2nd derivative of f w.r.t. tau";
+    //     Real fdeltatau "Mixed derivative of f w.r.t. delta and tau";
+    //   end HelmholtzDerivs;
+
+    record TransportProps "Record with transport properties"
+      extends Modelica.Icons.Record;
+      Units.SI.DynamicViscosity eta;
+      Units.SI.ThermalConductivity lam;
+    end TransportProps;
+
+    function gibbsToProps_ph
+      "Calculate property record for pressure and specific enthalpy as states from dimensionless Gibbs function"
+
+      extends Modelica.Icons.Function;
+      input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
+      output ThermoProperties_ph pro
+        "Property record for pressure and specific enthalpy as dynamic states";
+    protected
+      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";
+    algorithm
+      pro.T := g.T;
+      pro.R := g.R;
+      pro.d := g.p/(pro.R*pro.T*g.pi*g.gpi);
+      pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+      pro.s := pro.R*(g.tau*g.gtau - g.g);
+      pro.cp := -pro.R*g.tau*g.tau*g.gtautau;
+      pro.cv := pro.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi
+         - g.tau*g.gtaupi)/(g.gpipi));
+      pro.a := abs(g.R*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
+        *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))^0.5;
+      vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+      vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+      pro.kappa := -1/(pro.d*g.p)*pro.cp/(vp*pro.cp + vt*vt*g.T);
+      pro.ddhp := -pro.d*pro.d*vt/(pro.cp);
+      pro.ddph := -pro.d*pro.d*(vp*pro.cp - vt/pro.d + g.T*vt*vt)/pro.cp;
+      pro.duph := -1/pro.d + g.p/(pro.d*pro.d)*pro.ddph;
+      pro.duhp := 1 + g.p/(pro.d*pro.d)*pro.ddhp;
+    end gibbsToProps_ph;
+
+    function gibbsToBoundaryProps
+      "Calculate phase boundary property record from dimensionless Gibbs function"
+
+      extends Modelica.Icons.Function;
+      input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
+      output PhaseBoundaryProperties sat "Phase boundary properties";
+    protected
+      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";
+    algorithm
+      sat.d := g.p/(g.R*g.T*g.pi*g.gpi);
+      sat.h := g.R*g.T*g.tau*g.gtau;
+      sat.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+      sat.s := g.R*(g.tau*g.gtau - g.g);
+      sat.cp := -g.R*g.tau*g.tau*g.gtautau;
+      sat.cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi
+         - g.tau*g.gtaupi)/(g.gpipi));
+      vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+      vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+      // sat.kappa := -1/(sat.d*g.p)*sat.cp/(vp*sat.cp + vt*vt*g.T);
+      sat.pt := -g.p/g.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
+      sat.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+    end gibbsToBoundaryProps;
+
+    function gibbsToProps_dT
+      "Calculate property record for density and temperature as states from dimensionless Gibbs function"
+
+      extends Modelica.Icons.Function;
+      input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
+      output ThermoProperties_dT pro
+        "Property record for density and temperature as dynamic states";
+    protected
+      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";
+      Units.SI.Density d;
+    algorithm
+      pro.R := g.R;
+      pro.p := g.p;
+      pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+      pro.h := g.R*g.T*g.tau*g.gtau;
+      pro.s := pro.R*(g.tau*g.gtau - g.g);
+      pro.cp := -pro.R*g.tau*g.tau*g.gtautau;
+      pro.cv := pro.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi
+         - g.tau*g.gtaupi)/g.gpipi);
+      vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+      vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+      pro.kappa := -1/((g.p/(pro.R*g.T*g.pi*g.gpi))*g.p)*pro.cp/(vp*pro.cp + vt
+        *vt*g.T);
+      pro.a := abs(g.R*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
+        *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))^0.5;
+
+      d := g.p/(pro.R*g.T*g.pi*g.gpi);
+      pro.dudT := (pro.p - g.T*vt/vp)/(d*d);
+    end gibbsToProps_dT;
+
+    function gibbsToProps_pT
+      "Calculate property record for pressure and temperature as states from dimensionless Gibbs function"
+
+      extends Modelica.Icons.Function;
+      input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
+      output ThermoProperties_pT pro
+        "Property record for pressure and temperature as dynamic states";
+    protected
+      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";
+    algorithm
+      pro.R := g.R;
+      pro.d := g.p/(pro.R*g.T*g.pi*g.gpi);
+      pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+      pro.h := g.R*g.T*g.tau*g.gtau;
+      pro.s := pro.R*(g.tau*g.gtau - g.g);
+      pro.cp := -pro.R*g.tau*g.tau*g.gtautau;
+      pro.cv := pro.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi
+         - g.tau*g.gtaupi)/g.gpipi);
+      vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+      vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+      pro.kappa := -1/(pro.d*g.p)*pro.cp/(vp*pro.cp + vt*vt*g.T);
+      pro.a := abs(g.R*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
+        *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))^0.5;
+      pro.ddpT := -(pro.d*pro.d)*vp;
+      pro.ddTp := -(pro.d*pro.d)*vt;
+      pro.duTp := pro.cp - g.p*vt;
+      pro.dupT := -g.T*vt - g.p*vp;
+    end gibbsToProps_pT;
+
+    function helmholtzToProps_ph
+      "Calculate property record for pressure and specific enthalpy as states from dimensionless Helmholtz function"
+
+      extends Modelica.Icons.Function;
+      input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
+      output ThermoProperties_ph pro
+        "Property record for pressure and specific enthalpy as dynamic states";
+    protected
+      Units.SI.Pressure p "Pressure";
+      DerPressureByDensity pd "Derivative of pressure w.r.t. density";
+      DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+      DerPressureBySpecificVolume pv
+        "Derivative of pressure w.r.t. specific volume";
+    algorithm
+      pro.d := f.d;
+      pro.T := f.T;
+      pro.R := f.R;
+      pro.s := f.R*(f.tau*f.ftau - f.f);
+      pro.u := f.R*f.T*f.tau*f.ftau;
+      p := pro.d*pro.R*pro.T*f.delta*f.fdelta;
+      pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+      pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+      pv := -pd*f.d*f.d;
+
+      // calculating cp near the critical point may be troublesome (cp -> inf).
+      pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
+        *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+      pro.cv := f.R*(-f.tau*f.tau*f.ftautau);
+      pro.kappa := 1/(f.d*f.R*f.d*f.T*f.delta*f.fdelta)*((-pv*pro.cv + pt*pt*f.T)
+        /(pro.cv));
+      pro.a := abs(f.R*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta
+         - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta*f.fdelta -
+        f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5;
+      pro.ddph := (f.d*(pro.cv*f.d + pt))/(f.d*f.d*pd*pro.cv + f.T*pt*pt);
+      pro.ddhp := -f.d*f.d*pt/(f.d*f.d*pd*pro.cv + f.T*pt*pt);
+      pro.duph := -1/pro.d + p/(pro.d*pro.d)*pro.ddph;
+      pro.duhp := 1 + p/(pro.d*pro.d)*pro.ddhp;
+    end helmholtzToProps_ph;
+
+    function helmholtzToProps_pT
+      "Calculate property record for pressure and temperature as states from dimensionless Helmholtz function"
+
+      extends Modelica.Icons.Function;
+      input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
+      output ThermoProperties_pT pro
+        "Property record for pressure and temperature as dynamic states";
+    protected
+      DerPressureByDensity pd "Derivative of pressure w.r.t. density";
+      DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+      DerPressureBySpecificVolume pv
+        "Derivative of pressure w.r.t. specific volume";
+      IsobaricVolumeExpansionCoefficient alpha
+        "Isobaric volume expansion coefficient";
+      // beta in Bejan
+      IsothermalCompressibility gamma "Isothermal compressibility";
+      // kappa in Bejan
+      Units.SI.Pressure p "Pressure";
+    algorithm
+      pro.d := f.d;
+      pro.R := f.R;
+      pro.s := f.R*(f.tau*f.ftau - f.f);
+      pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
+      pro.u := f.R*f.T*f.tau*f.ftau;
+      pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+      pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+      pv := -(f.d*f.d)*pd;
+      alpha := -f.d*pt/pv;
+      gamma := -f.d/pv;
+      p := f.R*f.d*f.T*f.delta*f.fdelta;
+      // calculating cp near the critical point may be troublesome (cp -> inf).
+      pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
+        *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+      pro.cv := f.R*(-f.tau*f.tau*f.ftautau);
+      pro.kappa := 1/(f.d*f.R*f.d*f.T*f.delta*f.fdelta)*((-pv*pro.cv + pt*pt*f.T)
+        /(pro.cv));
+      pro.a := abs(f.R*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta
+         - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta*f.fdelta -
+        f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5;
+      pro.ddTp := -pt/pd;
+      pro.ddpT := 1/pd;
+      //problem with units in last two lines
+      pro.dupT := gamma*p/f.d - alpha*f.T/f.d;
+      pro.duTp := pro.cp - alpha*p/f.d;
+    end helmholtzToProps_pT;
+
+    function helmholtzToProps_dT
+      "Calculate property record for density and temperature as states from dimensionless Helmholtz function"
+
+      extends Modelica.Icons.Function;
+      input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
+      output ThermoProperties_dT pro
+        "Property record for density and temperature as dynamic states";
+    protected
+      DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+      DerPressureBySpecificVolume pv "Derivative of pressure w.r.t. pressure";
+    algorithm
+      pro.p := f.R*f.d*f.T*f.delta*f.fdelta;
+      pro.R := f.R;
+      pro.s := f.R*(f.tau*f.ftau - f.f);
+      pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
+      pro.u := f.R*f.T*f.tau*f.ftau;
+      pv := -(f.d*f.d)*f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+      pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+
+      // calculating cp near the critical point may be troublesome (cp -> inf).
+      pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
+        *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+      pro.cv := f.R*(-f.tau*f.tau*f.ftautau);
+      pro.kappa := 1/(f.d*pro.p)*((-pv*pro.cv + pt*pt*f.T)/(pro.cv));
+      pro.a := abs(f.R*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta
+         - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta*f.fdelta -
+        f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5;
+      pro.dudT := (pro.p - f.T*pt)/(f.d*f.d);
+    end helmholtzToProps_dT;
+
+    function TwoPhaseToProps_ph
+      "Compute property record for pressure and specific enthalpy as states from saturation properties"
+
+      extends Modelica.Icons.Function;
+      input SaturationProperties sat "Saturation property record";
+      output ThermoProperties_ph pro
+        "Property record for pressure and specific enthalpy as dynamic states";
+    protected
+      Real dht(unit="(J/kg)/K")
+        "Derivative of specific enthalpy w.r.t. temperature";
+      Real dhd(unit="(J/kg)/(kg/m3)")
+        "Derivative of specific enthalpy w.r.t. density";
+      Real detph(unit="m4.s4/(K.s8)") "Thermodynamic determinant";
+    algorithm
+      pro.d := sat.d;
+      pro.T := sat.T;
+      pro.u := sat.u;
+      pro.s := sat.s;
+      pro.cv := sat.cv;
+      pro.R := sat.R;
+      pro.cp := Modelica.Constants.inf;
+      pro.kappa := -1/(sat.d*sat.p)*sat.dpT*sat.dpT*sat.T/sat.cv;
+      pro.a := Modelica.Constants.inf;
+      dht := sat.cv + sat.dpT/sat.d;
+      dhd := -sat.T*sat.dpT/(sat.d*sat.d);
+      detph := -sat.dpT*dhd;
+      pro.ddph := dht/detph;
+      pro.ddhp := -sat.dpT/detph;
+    end TwoPhaseToProps_ph;
+
+    function TwoPhaseToProps_dT
+      "Compute property record for density and temperature as states from saturation properties"
+
+      extends Modelica.Icons.Function;
+      input SaturationProperties sat "Saturation properties";
+      output ThermoProperties_dT pro
+        "Property record for density and temperature as dynamic states";
+    algorithm
+      pro.p := sat.p;
+      pro.h := sat.h;
+      pro.u := sat.u;
+      pro.s := sat.s;
+      pro.cv := sat.cv;
+      pro.cp := Modelica.Constants.inf;
+      pro.R := sat.R;
+      pro.kappa := -1/(sat.d*sat.p)*sat.dpT*sat.dpT*sat.T/sat.cv;
+      pro.a := Modelica.Constants.inf;
+      pro.dudT := (sat.p - sat.T*sat.dpT)/(sat.d*sat.d);
+    end TwoPhaseToProps_dT;
+
+  end ThermoFluidSpecial;
+public
+
+  record SaturationProperties "Properties in the two phase region"
+    extends Modelica.Icons.Record;
+    Units.SI.Temp_K T "Temperature";
+    Units.SI.Density d "Density";
+    Units.SI.Pressure p "Pressure";
+    Units.SI.SpecificEnergy u "Specific inner energy";
+    Units.SI.SpecificEnthalpy h "Specific enthalpy";
+    Units.SI.SpecificEntropy s "Specific entropy";
+    Units.SI.SpecificHeatCapacity cp
+      "Heat capacity at constant pressure";
+    Units.SI.SpecificHeatCapacity cv "Heat capacity at constant volume";
+    Units.SI.SpecificHeatCapacity R "Gas constant";
+    Units.SI.RatioOfSpecificHeatCapacities kappa
+      "Isentropic expansion coefficient";
+    PhaseBoundaryProperties liq
+      "Thermodynamic base properties on the boiling curve";
+    PhaseBoundaryProperties vap
+      "Thermodynamic base properties on the dew curve";
+    Real dpT(unit="Pa/K")
+      "Derivative of saturation pressure w.r.t. temperature";
+    Units.SI.MassFraction x "Vapour mass fraction";
+  end SaturationProperties;
+
+  record SaturationBoundaryProperties
+    "Properties on both phase boundaries, including some derivatives"
+
+    extends Modelica.Icons.Record;
+    Units.SI.Temp_K T "Saturation temperature";
+    Units.SI.Density dl "Liquid density";
+    Units.SI.Density dv "Vapour density";
+    Units.SI.SpecificEnthalpy hl "Liquid specific enthalpy";
+    Units.SI.SpecificEnthalpy hv "Vapour specific enthalpy";
+    Real dTp "Derivative of temperature w.r.t. saturation pressure";
+    Real ddldp "Derivative of density along boiling curve";
+    Real ddvdp "Derivative of density along dew curve";
+    Real dhldp "Derivative of specific enthalpy along boiling curve";
+    Real dhvdp "Derivative of specific enthalpy along dew curve";
+    Units.SI.MassFraction x "Vapour mass fraction";
+  end SaturationBoundaryProperties;
+
+  record IF97BaseTwoPhase "Intermediate property data record for IF 97"
+    extends Modelica.Icons.Record;
+    Integer phase(start=0)
+      "Phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+    Integer region(min=1, max=5) "IF 97 region";
+    Units.SI.Pressure p "Pressure";
+    Units.SI.Temperature T "Temperature";
+    Units.SI.SpecificEnthalpy h "Specific enthalpy";
+    Units.SI.SpecificHeatCapacity R "Gas constant";
+    Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
+    Units.SI.SpecificHeatCapacity cv "Specific heat capacity";
+    Units.SI.Density rho "Density";
+    Units.SI.SpecificEntropy s "Specific entropy";
+    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
+    Real vt "Derivative of specific volume w.r.t. temperature";
+    Real vp "Derivative of specific volume w.r.t. pressure";
+    Real x "Dryness fraction";
+    Real dpT "dp/dT derivative of saturation curve";
+  end IF97BaseTwoPhase;
+
+  record IF97PhaseBoundaryProperties
+    "Thermodynamic base properties on the phase boundary for IF97 steam tables"
+
+    extends Modelica.Icons.Record;
+    Boolean region3boundary "True if boundary between 2-phase and region 3";
+    Units.SI.SpecificHeatCapacity R "Specific heat capacity";
+    Units.SI.Temperature T "Temperature";
+    Units.SI.Density d "Density";
+    Units.SI.SpecificEnthalpy h "Specific enthalpy";
+    Units.SI.SpecificEntropy s "Specific entropy";
+    Units.SI.SpecificHeatCapacity cp
+      "Heat capacity at constant pressure";
+    Units.SI.SpecificHeatCapacity cv "Heat capacity at constant volume";
+    DerPressureByTemperature dpT "dp/dT derivative of saturation curve";
+    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
+    Real vt(unit="m3/(kg.K)")
+      "Derivative of specific volume w.r.t. temperature";
+    Real vp(unit="m3/(kg.Pa)") "Derivative of specific volume w.r.t. pressure";
+  end IF97PhaseBoundaryProperties;
+
+  record GibbsDerivs
+    "Derivatives of dimensionless Gibbs-function w.r.t. dimensionless pressure and temperature"
+
+    extends Modelica.Icons.Record;
+    Units.SI.Pressure p "Pressure";
+    Units.SI.Temperature T "Temperature";
+    Units.SI.SpecificHeatCapacity R "Specific heat capacity";
+    Real pi(unit="1") "Dimensionless pressure";
+    Real tau(unit="1") "Dimensionless temperature";
+    Real g(unit="1") "Dimensionless Gibbs-function";
+    Real gpi(unit="1") "Derivative of g w.r.t. pi";
+    Real gpipi(unit="1") "2nd derivative of g w.r.t. pi";
+    Real gtau(unit="1") "Derivative of g w.r.t. tau";
+    Real gtautau(unit="1") "2nd derivative of g w.r.t. tau";
+    Real gtaupi(unit="1") "Mixed derivative of g w.r.t. pi and tau";
+  end GibbsDerivs;
+
+  record HelmholtzDerivs
+    "Derivatives of dimensionless Helmholtz-function w.r.t. dimensionless pressure, density and temperature"
+    extends Modelica.Icons.Record;
+    Units.SI.Density d "Density";
+    Units.SI.Temperature T "Temperature";
+    Units.SI.SpecificHeatCapacity R "Specific heat capacity";
+    Real delta(unit="1") "Dimensionless density";
+    Real tau(unit="1") "Dimensionless temperature";
+    Real f(unit="1") "Dimensionless Helmholtz-function";
+    Real fdelta(unit="1") "Derivative of f w.r.t. delta";
+    Real fdeltadelta(unit="1") "2nd derivative of f w.r.t. delta";
+    Real ftau(unit="1") "Derivative of f w.r.t. tau";
+    Real ftautau(unit="1") "2nd derivative of f w.r.t. tau";
+    Real fdeltatau(unit="1") "Mixed derivative of f w.r.t. delta and tau";
+  end HelmholtzDerivs;
+
+  record TwoPhaseTransportProps
+    "Defines properties on both phase boundaries, needed in the two phase region"
+    extends Modelica.Icons.Record;
+    Units.SI.Density d_vap "Density on the dew line";
+    Units.SI.Density d_liq "Density on the bubble line";
+    Units.SI.DynamicViscosity eta_vap
+      "Dynamic viscosity on the dew line";
+    Units.SI.DynamicViscosity eta_liq
+      "Dynamic viscosity on the bubble line";
+    Units.SI.ThermalConductivity lam_vap
+      "Thermal conductivity on the dew line";
+    Units.SI.ThermalConductivity lam_liq
+      "Thermal conductivity on the bubble line";
+    Units.SI.SpecificHeatCapacity cp_vap "Cp on the dew line";
+    Units.SI.SpecificHeatCapacity cp_liq "Cp on the bubble line";
+    Units.SI.MassFraction x "Steam quality";
+  end TwoPhaseTransportProps;
+
+  record PhaseBoundaryProperties
+    "Thermodynamic base properties on the phase boundary"
+    extends Modelica.Icons.Record;
+    Units.SI.Density d "Density";
+    Units.SI.SpecificEnthalpy h "Specific enthalpy";
+    Units.SI.SpecificEnergy u "Inner energy";
+    Units.SI.SpecificEntropy s "Specific entropy";
+    Units.SI.SpecificHeatCapacity cp
+      "Heat capacity at constant pressure";
+    Units.SI.SpecificHeatCapacity cv "Heat capacity at constant volume";
+    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
+  end PhaseBoundaryProperties;
+
+  record NewtonDerivatives_ph
+    "Derivatives for fast inverse calculations of Helmholtz functions: p & h"
+
+    extends Modelica.Icons.Record;
+    Units.SI.Pressure p "Pressure";
+    Units.SI.SpecificEnthalpy h "Specific enthalpy";
+    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
+    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+    Real hd "Derivative of specific enthalpy w.r.t. density";
+    Real ht "Derivative of specific enthalpy w.r.t. temperature";
+  end NewtonDerivatives_ph;
+
+  record NewtonDerivatives_ps
+    "Derivatives for fast inverse calculation of Helmholtz functions: p & s"
+
+    extends Modelica.Icons.Record;
+    Units.SI.Pressure p "Pressure";
+    Units.SI.SpecificEntropy s "Specific entropy";
+    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
+    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+    Real sd "Derivative of specific entropy w.r.t. density";
+    Real st "Derivative of specific entropy w.r.t. temperature";
+  end NewtonDerivatives_ps;
+
+  record NewtonDerivatives_pT
+    "Derivatives for fast inverse calculations of Helmholtz functions:p & T"
+
+    extends Modelica.Icons.Record;
+    Units.SI.Pressure p "Pressure";
+    DerPressureByDensity pd "Derivative of pressure w.r.t. density";
+  end NewtonDerivatives_pT;
+
+  record ExtraDerivatives "Additional thermodynamic derivatives"
+    extends Modelica.Icons.Record;
+    IsentropicExponent kappa "Isentropic expansion coefficient";
+    // k in Bejan
+    IsenthalpicExponent theta "Isenthalpic exponent";
+    // same as kappa, except derivative at const h
+    IsobaricVolumeExpansionCoefficient alpha
+      "Isobaric volume expansion coefficient";
+    // beta in Bejan
+    IsochoricPressureCoefficient beta "Isochoric pressure coefficient";
+    // kT in Bejan
+    IsothermalCompressibility gamma "Isothermal compressibility";
+    // kappa in Bejan
+    JouleThomsonCoefficient mu "Joule-Thomson coefficient";
+    // mu_J in Bejan
+  end ExtraDerivatives;
+
+  record BridgmansTables
+    "Calculates all entries in Bridgmans tables if first seven variables given"
+    extends Modelica.Icons.Record;
+    // the first 7 need to calculated in a function!
+    Units.SI.SpecificVolume v "Specific volume";
+    Units.SI.Pressure p "Pressure";
+    Units.SI.Temperature T "Temperature";
+    Units.SI.SpecificEntropy s "Specific entropy";
+    Units.SI.SpecificHeatCapacity cp
+      "Heat capacity at constant pressure";
+    IsobaricVolumeExpansionCoefficient alpha
+      "Isobaric volume expansion coefficient";
+    // beta in Bejan
+    IsothermalCompressibility gamma "Isothermal compressibility";
+    // kappa in Bejan
+    // Derivatives at constant pressure
+    Real dTp=1 "Coefficient in Bridgmans table, see info for usage";
+    Real dpT=-dTp "Coefficient in Bridgmans table, see info for usage";
+    Real dvp=alpha*v "Coefficient in Bridgmans table, see info for usage";
+    Real dpv=-dvp "Coefficient in Bridgmans table, see info for usage";
+    Real dsp=cp/T "Coefficient in Bridgmans table, see info for usage";
+    Real dps=-dsp "Coefficient in Bridgmans table, see info for usage";
+    Real dup=cp - alpha*p*v
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dpu=-dup "Coefficient in Bridgmans table, see info for usage";
+    Real dhp=cp "Coefficient in Bridgmans table, see info for usage";
+    Real dph=-dhp "Coefficient in Bridgmans table, see info for usage";
+    Real dfp=-s - alpha*p*v
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dpf=-dfp "Coefficient in Bridgmans table, see info for usage";
+    Real dgp=-s "Coefficient in Bridgmans table, see info for usage";
+    Real dpg=-dgp "Coefficient in Bridgmans table, see info for usage";
+    // Derivatives at constant Temperature
+    Real dvT=gamma*v "Coefficient in Bridgmans table, see info for usage";
+    Real dTv=-dvT "Coefficient in Bridgmans table, see info for usage";
+    Real dsT=alpha*v "Coefficient in Bridgmans table, see info for usage";
+    Real dTs=-dsT "Coefficient in Bridgmans table, see info for usage";
+    Real duT=alpha*T*v - gamma*p*v
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dTu=-duT "Coefficient in Bridgmans table, see info for usage";
+    Real dhT=-v + alpha*T*v
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dTh=-dhT "Coefficient in Bridgmans table, see info for usage";
+    Real dfT=-gamma*p*v "Coefficient in Bridgmans table, see info for usage";
+    Real dTf=-dfT "Coefficient in Bridgmans table, see info for usage";
+    Real dgT=-v "Coefficient in Bridgmans table, see info for usage";
+    Real dTg=-dgT "Coefficient in Bridgmans table, see info for usage";
+    // Derivatives at constant v
+    Real dsv=alpha*alpha*v*v - gamma*v*cp/T
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dvs=-dsv "Coefficient in Bridgmans table, see info for usage";
+    Real duv=T*alpha*alpha*v*v - gamma*v*cp
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dvu=-duv "Coefficient in Bridgmans table, see info for usage";
+    Real dhv=T*alpha*alpha*v*v - alpha*v*v - gamma*v*cp
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dvh=-dhv "Coefficient in Bridgmans table, see info for usage";
+    Real dfv=gamma*v*s "Coefficient in Bridgmans table, see info for usage";
+    Real dvf=-dfv "Coefficient in Bridgmans table, see info for usage";
+    Real dgv=gamma*v*s - alpha*v*v
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dvg=-dgv "Coefficient in Bridgmans table, see info for usage";
+    // Derivatives at constant s
+    Real dus=dsv*p "Coefficient in Bridgmans table, see info for usage";
+    Real dsu=-dus "Coefficient in Bridgmans table, see info for usage";
+    Real dhs=-v*cp/T "Coefficient in Bridgmans table, see info for usage";
+    Real dsh=-dhs "Coefficient in Bridgmans table, see info for usage";
+    Real dfs=alpha*v*s + dus
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dsf=-dfs "Coefficient in Bridgmans table, see info for usage";
+    Real dgs=alpha*v*s - v*cp/T
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dsg=-dgs "Coefficient in Bridgmans table, see info for usage";
+    // Derivatives at constant u
+    Real dhu=p*alpha*v*v + gamma*v*cp*p - v*cp - p*T*alpha*alpha*v*v
+      "Coefficient in Bridgmans table, see info for usage";
+    Real duh=-dhu "Coefficient in Bridgmans table, see info for usage";
+    Real dfu=s*T*alpha*v - gamma*v*cp*p - gamma*v*s*p + p*T*alpha*alpha*v*v
+      "Coefficient in Bridgmans table, see info for usage";
+    Real duf=-dfu "Coefficient in Bridgmans table, see info for usage";
+    Real dgu=alpha*v*v*p + alpha*v*s*T - v*cp - gamma*v*s*p
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dug=-dgu "Coefficient in Bridgmans table, see info for usage";
+    //  Derivatives at constant h
+    Real dfh=(s - v*alpha*p)*(v - v*alpha*T) - gamma*v*cp*p
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dhf=-dfh "Coefficient in Bridgmans table, see info for usage";
+    Real dgh=alpha*v*s*T - v*(s + cp)
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dhg=-dgh "Coefficient in Bridgmans table, see info for usage";
+    // Derivatives at constant g
+    Real dfg=gamma*v*s*p - v*s - alpha*v*v*p
+      "Coefficient in Bridgmans table, see info for usage";
+    Real dgf=-dfg "Coefficient in Bridgmans table, see info for usage";
+    annotation (Documentation(info="<html>
+<p>
+Important: the phase equilibrium conditions are not yet considered.
+this means that Bridgman's tables do not yet work in the two phase region.
+Some derivatives are 0 or infinity anyways.
+Idea: Do not use the values in Bridgmans table directly, all
+derivatives are calculated as the quotient of two entries in the
+table. The last letter indicates which variable is held constant in
+taking the derivative. The second letters are the two variables
+involved in the derivative and the first letter is always a d to remind
+of differentiation.
+</p>
+
+<pre>
+Example 1: Get the derivative of specific entropy s w.r.t. Temperature at
+constant specific volume (between identical to constant density)
+constant volume  --> last letter v
+Temperature      --> second letter T
+Specific entropy --> second letter s
+--> the needed value is dsv/dTv
+Known variables:
+Temperature T
+pressure p
+specific volume v
+specific inner energy u
+specific enthalpy h
+specific entropy s
+specific Helmholtz energy f
+specific gibbs enthalpy g
+Not included but useful:
+density d
+In order to convert derivatives involving density use the following
+rules:
+at constant density == at constant specific volume
+ddx/dyx = -d*d*dvx/dyx with y,x any of T,p,u,h,s,f,g
+dyx/ddx = -1/(d*d)dyx/dvx with y,x any of T,p,u,h,s,f,g
+Usage example assuming water as the medium:
+model BridgmansTablesForWater
+extends ThermoFluid.BaseClasses.MediumModels.Water.WaterSteamMedium_ph;
+Real derOfsByTAtConstantv \"derivative of sp. entropy by temperature at constant sp. volume\"
+ThermoFluid.BaseClasses.MediumModels.Common.ExtraDerivatives dpro;
+ThermoFluid.BaseClasses.MediumModels.Common.BridgmansTables bt;
+equation
+dpro = ThermoFluid.BaseClasses.MediumModels.SteamIF97.extraDerivs_pT(p[1],T[1]);
+bt.p = p[1];
+bt.T = T[1];
+bt.v = 1/pro[1].d;
+bt.s = pro[1].s;
+bt.cp = pro[1].cp;
+bt.alpha = dpro.alpha;
+bt.gamma = dpro.gamma;
+derOfsByTAtConstantv =  bt.dsv/bt.dTv;
+                ...
+end BridgmansTablesForWater;
+                </pre>
+
+                </html>"));
+  end BridgmansTables;
+
+  record FundamentalConstants "Constants of the medium"
+    extends Modelica.Icons.Record;
+    Units.SI.MolarHeatCapacity R_bar;
+    Units.SI.SpecificHeatCapacity R;
+    Units.SI.MolarMass MM;
+    Units.SI.MolarDensity rhored;
+    Units.SI.Temperature Tred;
+    Units.SI.AbsolutePressure pred;
+    Units.SI.SpecificEnthalpy h_off;
+    Units.SI.SpecificEntropy s_off;
+  end FundamentalConstants;
+
+  record AuxiliaryProperties "Intermediate property data record"
+    extends Modelica.Icons.Record;
+    Units.SI.Pressure p "Pressure";
+    Units.SI.Temperature T "Temperature";
+    Units.SI.SpecificEnthalpy h "Specific enthalpy";
+    Units.SI.SpecificHeatCapacity R "Gas constant";
+    Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
+    Units.SI.SpecificHeatCapacity cv "Specific heat capacity";
+    Units.SI.Density rho "Density";
+    Units.SI.SpecificEntropy s "Specific entropy";
+    Units.SI.DerPressureByTemperature pt
+      "Derivative of pressure w.r.t. temperature";
+    Units.SI.DerPressureByDensity pd
+      "Derivative of pressure w.r.t. density";
+    Real vt "Derivative of specific volume w.r.t. temperature";
+    Real vp "Derivative of specific volume w.r.t. pressure";
+  end AuxiliaryProperties;
+
+  record GibbsDerivs2
+    "Derivatives of Gibbs function w.r.t. pressure and temperature"
+
+    extends Modelica.Icons.Record;
+    Units.SI.Pressure p "Pressure";
+    Units.SI.Temperature T "Temperature";
+    Units.SI.SpecificHeatCapacity R "Specific heat capacity";
+    Real pi(unit="1") "Dimensionless pressure";
+    Real theta(unit="1") "Dimensionless temperature";
+    Real g(unit="J/kg") "Gibbs function";
+    Real gp(unit="m3/kg") "Derivative of g w.r.t. p";
+    Real gpp(unit="m3/(kg.Pa)") "2nd derivative of g w.r.t. p";
+    Real gT(unit="J/(kg.K)") "Derivative of g w.r.t. T";
+    Real gTT(unit="J/(kg.K2)") "2nd derivative of g w.r.t. T";
+    Real gTp(unit="m3/(kg.K)") "Mixed derivative of g w.r.t. T and p";
+  end GibbsDerivs2;
+
+  record NewtonDerivatives_dT
+    "Derivatives for fast inverse calculations of Gibbs function"
+    extends Modelica.Icons.Record;
+    Units.SI.SpecificVolume v "Specific volume";
+    Real vp "Derivative of specific volume w.r.t. pressure";
+  end NewtonDerivatives_dT;
+
+  function gibbsToBridgmansTables
+    "Calculates base coefficients for Bridgman's tables from gibbs enthalpy"
+
+    extends Modelica.Icons.Function;
+    input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
+    output Units.SI.SpecificVolume v "Specific volume";
+    output Units.SI.Pressure p=g.p "Pressure";
+    output Units.SI.Temperature T=g.T "Temperature";
+    output Units.SI.SpecificEntropy s "Specific entropy";
+    output Units.SI.SpecificHeatCapacity cp
+      "Heat capacity at constant pressure";
+    output IsobaricVolumeExpansionCoefficient alpha
+      "Isobaric volume expansion coefficient";
+    // beta in Bejan
+    output IsothermalCompressibility gamma "Isothermal compressibility";
+    // kappa in Bejan
+  protected
+    Real vt(unit="m3/(kg.K)")
+      "Derivative of specific volume w.r.t. temperature";
+    Real vp(unit="m4.kg-2.s2") "Derivative of specific volume w.r.t. pressure";
+  algorithm
+    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+    v := (g.R*g.T*g.pi*g.gpi)/g.p;
+    s := g.R*(g.tau*g.gtau - g.g);
+    cp := -g.R*g.tau*g.tau*g.gtautau;
+    alpha := vt/v;
+    gamma := -vp/v;
+  end gibbsToBridgmansTables;
+
+  function helmholtzToBridgmansTables
+    "Calculates base coefficients for Bridgmans tables from Helmholtz energy"
+    extends Modelica.Icons.Function;
+    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
+    output Units.SI.SpecificVolume v=1/f.d "Specific volume";
+    output Units.SI.Pressure p "Pressure";
+    output Units.SI.Temperature T=f.T "Temperature";
+    output Units.SI.SpecificEntropy s "Specific entropy";
+    output Units.SI.SpecificHeatCapacity cp
+      "Heat capacity at constant pressure";
+    output IsobaricVolumeExpansionCoefficient alpha
+      "Isobaric volume expansion coefficient";
+    // beta in Bejan
+    output IsothermalCompressibility gamma "Isothermal compressibility";
+    // kappa in Bejan
+  protected
+    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+    DerPressureBySpecificVolume pv
+      "Derivative of pressure w.r.t. specific volume";
+    Units.SI.SpecificHeatCapacity cv "Isochoric specific heat capacity";
+  algorithm
+    p := f.R*f.d*f.T*f.delta*f.fdelta;
+    pv := -(f.d*f.d)*f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    s := f.R*(f.tau*f.ftau - f.f);
+    alpha := -f.d*pt/pv;
+    gamma := -f.d/pv;
+    cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)
+      ^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+  end helmholtzToBridgmansTables;
+
+  function gibbsToBoundaryProps
+    "Calculate phase boundary property record from dimensionless Gibbs function"
+
+    extends Modelica.Icons.Function;
+    input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
+    output PhaseBoundaryProperties sat "Phase boundary properties";
+  protected
+    Real vt "Derivative of specific volume w.r.t. temperature";
+    Real vp "Derivative of specific volume w.r.t. pressure";
+  algorithm
+    sat.d := g.p/(g.R*g.T*g.pi*g.gpi);
+    sat.h := g.R*g.T*g.tau*g.gtau;
+    sat.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+    sat.s := g.R*(g.tau*g.gtau - g.g);
+    sat.cp := -g.R*g.tau*g.tau*g.gtautau;
+    sat.cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
+      *g.gtaupi)/(g.gpipi));
+    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+    // sat.kappa := -1/(sat.d*g.p)*sat.cp/(vp*sat.cp + vt*vt*g.T);
+    sat.pt := -g.p/g.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
+    sat.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+  end gibbsToBoundaryProps;
+
+  function helmholtzToBoundaryProps
+    "Calculate phase boundary property record from dimensionless Helmholtz function"
+
+    extends Modelica.Icons.Function;
+    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
+    output PhaseBoundaryProperties sat "Phase boundary property record";
+  protected
+    Units.SI.Pressure p "Pressure";
+  algorithm
+    p := f.R*f.d*f.T*f.delta*f.fdelta;
+    sat.d := f.d;
+    sat.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
+    sat.s := f.R*(f.tau*f.ftau - f.f);
+    sat.u := f.R*f.T*f.tau*f.ftau;
+    sat.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)
+      ^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+    sat.cv := f.R*(-f.tau*f.tau*f.ftautau);
+    sat.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    sat.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+  end helmholtzToBoundaryProps;
+
+  function cv2Phase
+    "Compute isochoric specific heat capacity inside the two-phase region"
+
+    extends Modelica.Icons.Function;
+    input PhaseBoundaryProperties liq "Properties on the boiling curve";
+    input PhaseBoundaryProperties vap "Properties on the condensation curve";
+    input Units.SI.MassFraction x "Vapour mass fraction";
+    input Units.SI.Temperature T "Temperature";
+    input Units.SI.Pressure p "Properties";
+    output Units.SI.SpecificHeatCapacity cv
+      "Isochoric specific heat capacity";
+  protected
+    Real dpT "Derivative of pressure w.r.t. temperature";
+    Real dxv "Derivative of vapour mass fraction w.r.t. specific volume";
+    Real dvTl "Derivative of liquid specific volume w.r.t. temperature";
+    Real dvTv "Derivative of vapour specific volume w.r.t. temperature";
+    Real duTl "Derivative of liquid specific inner energy w.r.t. temperature";
+    Real duTv "Derivative of vapour specific inner energy w.r.t. temperature";
+    Real dxt "Derivative of vapour mass fraction w.r.t. temperature";
+  algorithm
+    dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d - vap.d) else 0.0;
+    dpT := (vap.s - liq.s)*dxv;
+    // wrong at critical point
+    dvTl := (liq.pt - dpT)/liq.pd/liq.d/liq.d;
+    dvTv := (vap.pt - dpT)/vap.pd/vap.d/vap.d;
+    dxt := -dxv*(dvTl + x*(dvTv - dvTl));
+    duTl := liq.cv + (T*liq.pt - p)*dvTl;
+    duTv := vap.cv + (T*vap.pt - p)*dvTv;
+    cv := duTl + x*(duTv - duTl) + dxt*(vap.u - liq.u);
+  end cv2Phase;
+
+  function cvdpT2Phase
+    "Compute isochoric specific heat capacity inside the two-phase region and derivative of pressure w.r.t. temperature"
+
+    extends Modelica.Icons.Function;
+    input PhaseBoundaryProperties liq "Properties on the boiling curve";
+    input PhaseBoundaryProperties vap "Properties on the condensation curve";
+    input Units.SI.MassFraction x "Vapour mass fraction";
+    input Units.SI.Temperature T "Temperature";
+    input Units.SI.Pressure p "Properties";
+    output Units.SI.SpecificHeatCapacity cv
+      "Isochoric specific heat capacity";
+    output Real dpT "Derivative of pressure w.r.t. temperature";
+  protected
+    Real dxv "Derivative of vapour mass fraction w.r.t. specific volume";
+    Real dvTl "Derivative of liquid specific volume w.r.t. temperature";
+    Real dvTv "Derivative of vapour specific volume w.r.t. temperature";
+    Real duTl "Derivative of liquid specific inner energy w.r.t. temperature";
+    Real duTv "Derivative of vapour specific inner energy w.r.t. temperature";
+    Real dxt "Derivative of vapour mass fraction w.r.t. temperature";
+  algorithm
+    dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d - vap.d) else 0.0;
+    dpT := (vap.s - liq.s)*dxv;
+    // wrong at critical point
+    dvTl := (liq.pt - dpT)/liq.pd/liq.d/liq.d;
+    dvTv := (vap.pt - dpT)/vap.pd/vap.d/vap.d;
+    dxt := -dxv*(dvTl + x*(dvTv - dvTl));
+    duTl := liq.cv + (T*liq.pt - p)*dvTl;
+    duTv := vap.cv + (T*vap.pt - p)*dvTv;
+    cv := duTl + x*(duTv - duTl) + dxt*(vap.u - liq.u);
+  end cvdpT2Phase;
+
+  function gibbsToExtraDerivs
+    "Compute additional thermodynamic derivatives from dimensionless Gibbs function"
+
+    extends Modelica.Icons.Function;
+    input GibbsDerivs g "Dimensionless derivatives of Gibbs function";
+    output ExtraDerivatives dpro "Additional property derivatives";
+  protected
+    Real vt "Derivative of specific volume w.r.t. temperature";
+    Real vp "Derivative of specific volume w.r.t. pressure";
+    Units.SI.Density d "Density";
+    Units.SI.SpecificVolume v "Specific volume";
+    Units.SI.SpecificHeatCapacity cv "Isochoric heat capacity";
+    Units.SI.SpecificHeatCapacity cp "Isobaric heat capacity";
+  algorithm
+    d := g.p/(g.R*g.T*g.pi*g.gpi);
+    v := 1/d;
+    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+    cp := -g.R*g.tau*g.tau*g.gtautau;
+    cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau
+      *g.gtaupi)/g.gpipi);
+    dpro.kappa := -1/(d*g.p)*cp/(vp*cp + vt*vt*g.T);
+    dpro.theta := cp/(d*g.p*(-vp*cp + vt*v - g.T*vt*vt));
+    dpro.alpha := d*vt;
+    dpro.beta := -vt/(g.p*vp);
+    dpro.gamma := -d*vp;
+    dpro.mu := -(v - g.T*vt)/cp;
+  end gibbsToExtraDerivs;
+
+  function helmholtzToExtraDerivs
+    "Compute additional thermodynamic derivatives from dimensionless Helmholtz function"
+
+    extends Modelica.Icons.Function;
+    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
+    output ExtraDerivatives dpro "Additional property derivatives";
+  protected
+    Units.SI.Pressure p "Pressure";
+    Units.SI.SpecificVolume v "Specific volume";
+    DerPressureByTemperature pt "Derivative of pressure w.r.t. temperature";
+    DerPressureBySpecificVolume pv
+      "Derivative of pressure w.r.t. specific volume";
+    Units.SI.SpecificHeatCapacity cv "Isochoric specific heat capacity";
+  algorithm
+    v := 1/f.d;
+    p := f.R*f.d*f.T*f.delta*f.fdelta;
+    pv := -(f.d*f.d)*f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    cv := f.R*(-f.tau*f.tau*f.ftautau);
+    dpro.kappa := 1/(f.d*p)*((-pv*cv + pt*pt*f.T)/(cv));
+    dpro.theta := -1/(f.d*p)*((-pv*cv + f.T*pt*pt)/(cv + pt*v));
+    dpro.alpha := -f.d*pt/pv;
+    dpro.beta := pt/p;
+    dpro.gamma := -f.d/pv;
+    dpro.mu := (v*pv + f.T*pt)/(pt*pt*f.T - pv*cv);
+  end helmholtzToExtraDerivs;
+
+  function Helmholtz_ph
+    "Function to calculate analytic derivatives for computing d and t given p and h"
+    extends Modelica.Icons.Function;
+    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
+    output NewtonDerivatives_ph nderivs
+      "Derivatives for Newton iteration to calculate d and t from p and h";
+  protected
+    Units.SI.SpecificHeatCapacity cv "Isochoric heat capacity";
+  algorithm
+    cv := -f.R*(f.tau*f.tau*f.ftautau);
+    nderivs.p := f.d*f.R*f.T*f.delta*f.fdelta;
+    nderivs.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
+    nderivs.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    nderivs.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    nderivs.ht := cv + nderivs.pt/f.d;
+    nderivs.hd := (nderivs.pd - f.T*nderivs.pt/f.d)/f.d;
+  end Helmholtz_ph;
+
+  function Helmholtz_pT
+    "Function to calculate analytic derivatives for computing d and t given p and t"
+
+    extends Modelica.Icons.Function;
+    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
+    output NewtonDerivatives_pT nderivs
+      "Derivatives for Newton iteration to compute d and t from p and t";
+  algorithm
+    nderivs.p := f.d*f.R*f.T*f.delta*f.fdelta;
+    nderivs.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+  end Helmholtz_pT;
+
+  function Helmholtz_ps
+    "Function to calculate analytic derivatives for computing d and t given p and s"
+
+    extends Modelica.Icons.Function;
+    input HelmholtzDerivs f "Dimensionless derivatives of Helmholtz function";
+    output NewtonDerivatives_ps nderivs
+      "Derivatives for Newton iteration to compute d and t from p and s";
+  protected
+    Units.SI.SpecificHeatCapacity cv "Isochoric heat capacity";
+  algorithm
+    cv := -f.R*(f.tau*f.tau*f.ftautau);
+    nderivs.p := f.d*f.R*f.T*f.delta*f.fdelta;
+    nderivs.s := f.R*(f.tau*f.ftau - f.f);
+    nderivs.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    nderivs.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    nderivs.st := cv/f.T;
+    nderivs.sd := -nderivs.pt/(f.d*f.d);
+  end Helmholtz_ps;
+
+  function smoothStep
+    "Approximation of a general step, such that the characteristic is continuous and differentiable"
+    extends Modelica.Icons.Function;
+    input Real x "Abscissa value";
+    input Real y1 "Ordinate value for x > 0";
+    input Real y2 "Ordinate value for x < 0";
+    input Real x_small(min=0) = 1e-5
+      "Approximation of step for -x_small <= x <= x_small; x_small > 0 required";
+    output Real y "Ordinate value to approximate y = if x > 0 then y1 else y2";
+  algorithm
+    y := smooth(1, if x > x_small then y1 else if x < -x_small then y2 else if
+      abs(x_small) > 0 then (x/x_small)*((x/x_small)^2 - 3)*(y2 - y1)/4 + (y1
+       + y2)/2 else (y1 + y2)/2);
+
+    annotation (
+      Inline=true,
+      smoothOrder=1,
+      Documentation(revisions="<html>
+<ul>
+<li><i>April 29, 2008</i>
+    by <a href=\"mailto:Martin.Otter@DLR.de\">Martin Otter</a>:<br>
+    Designed and implemented.</li>
+<li><i>August 12, 2008</i>
+    by <a href=\"mailto:Michael.Sielemann@dlr.de\">Michael Sielemann</a>:<br>
+    Minor modification to cover the limit case <code>x_small -> 0</code> without division by zero.</li>
+</ul>
+</html>", info="<html>
+<p>
+This function is used to approximate the equation
+</p>
+<pre>
+    y = <b>if</b> x &gt; 0 <b>then</b> y1 <b>else</b> y2;
+</pre>
+
+<p>
+by a smooth characteristic, so that the expression is continuous and differentiable:
+</p>
+
+<pre>
+   y = <b>smooth</b>(1, <b>if</b> x &gt;  x_small <b>then</b> y1 <b>else</b>
+                 <b>if</b> x &lt; -x_small <b>then</b> y2 <b>else</b> f(y1, y2));
+</pre>
+
+<p>
+In the region -x_small &lt; x &lt; x_small a 2nd order polynomial is used
+for a smooth transition from y1 to y2.
+</p>
+
+<p>
+If <b>mass fractions</b> X[:] are approximated with this function then this can be performed
+for all <b>nX</b> mass fractions, instead of applying it for nX-1 mass fractions and computing
+the last one by the mass fraction constraint sum(X)=1. The reason is that the approximating function has the
+property that sum(X) = 1, provided sum(X_a) = sum(X_b) = 1
+(and y1=X_a[i], y2=X_b[i]).
+This can be shown by evaluating the approximating function in the abs(x) &lt; x_small
+region (otherwise X is either X_a or X_b):
+</p>
+
+<pre>
+    X[1]  = smoothStep(x, X_a[1] , X_b[1] , x_small);
+    X[2]  = smoothStep(x, X_a[2] , X_b[2] , x_small);
+       ...
+    X[nX] = smoothStep(x, X_a[nX], X_b[nX], x_small);
+</pre>
+
+<p>
+or
+</p>
+
+<pre>
+    X[1]  = c*(X_a[1]  - X_b[1])  + (X_a[1]  + X_b[1])/2
+    X[2]  = c*(X_a[2]  - X_b[2])  + (X_a[2]  + X_b[2])/2;
+       ...
+    X[nX] = c*(X_a[nX] - X_b[nX]) + (X_a[nX] + X_b[nX])/2;
+    c     = (x/x_small)*((x/x_small)^2 - 3)/4
+</pre>
+
+<p>
+Summing all mass fractions together results in
+</p>
+
+<pre>
+    sum(X) = c*(sum(X_a) - sum(X_b)) + (sum(X_a) + sum(X_b))/2
+           = c*(1 - 1) + (1 + 1)/2
+           = 1
+</pre>
+</html>"));
+  end smoothStep;
+
+  function Gibbs2_ph
+    "Function to calculate analytic derivatives for computing T given p and h"
+    extends Modelica.Icons.Function;
+    input ThermoSysPro.Properties.Common.GibbsDerivs2 g
+      "Dimensionless derivatives of Gibbs function";
+    output ThermoSysPro.Properties.Common.NewtonDerivatives_ph nderivs
+      "Derivatives for Newton iteration to calculate d and t from p and h";
+
+  algorithm
+    nderivs.h := g.g - g.T*g.gT;
+    nderivs.ht := -g.T*g.gTT;
+
+    //dummy values - DO NOT USE
+    nderivs.p := 0.0;
+    nderivs.pd := 0.0;
+    nderivs.pt := 0.0;
+    nderivs.hd := 0.0;
+  end Gibbs2_ph;
+
+  function Gibbs2_dT
+    "Function to calculate analytic derivatives for computing p given d and T"
+    extends Modelica.Icons.Function;
+    input ThermoSysPro.Properties.Common.GibbsDerivs2 g
+      "Dimensionless derivatives of Gibbs function";
+    output ThermoSysPro.Properties.Common.NewtonDerivatives_dT nderivs
+      "Derivatives for Newton iteration to compute p from d and T";
+
+  algorithm
+    nderivs.v := g.gp;
+    nderivs.vp := nderivs.v*g.gpp/g.gp;
+  end Gibbs2_dT;
+
+  function Gibbs2_ps
+    "Function to calculate analytic derivatives for computing d and t given p and s"
+
+    extends Modelica.Icons.Function;
+    input ThermoSysPro.Properties.Common.GibbsDerivs2 g
+      "Dimensionless derivatives of Gibbs function";
+    output ThermoSysPro.Properties.Common.NewtonDerivatives_ps nderivs
+      "Derivatives for Newton iteration to compute T from p and s";
+
+  algorithm
+    nderivs.s := -g.gT;
+    nderivs.st := -g.gTT;
+
+    //dummy values - DO NOT USE
+    nderivs.p := 0.0;
+    nderivs.pd := 0.0;
+    nderivs.pt := 0.0;
+    nderivs.sd := 0.0;
+  end Gibbs2_ps;
+
+  package OneNonLinearEquation
+    "Determine solution of a non-linear algebraic equation in one unknown without derivatives in a reliable and efficient way"
+    extends Modelica.Icons.Package;
+
+    replaceable record f_nonlinear_Data
+      "Data specific for function f_nonlinear"
+      extends Modelica.Icons.Record;
+    end f_nonlinear_Data;
+
+    replaceable partial function f_nonlinear
+      "Nonlinear algebraic equation in one unknown: y = f_nonlinear(x,p,X)"
+      extends Modelica.Icons.Function;
+      input Real x "Independent variable of function";
+      input Real p=0.0 "Disregarded variables (here always used for pressure)";
+      input Real[:] X=fill(0, 0)
+        "Disregarded variables (her always used for composition)";
+      input f_nonlinear_Data f_nonlinear_data
+        "Additional data for the function";
+      output Real y "= f_nonlinear(x)";
+      // annotation(derivative(zeroDerivative=y)); // this must hold for all replaced functions
+    end f_nonlinear;
+
+    replaceable function solve
+      "Solve f_nonlinear(x_zero)=y_zero; f_nonlinear(x_min) - y_zero and f_nonlinear(x_max)-y_zero must have different sign"
+      import Modelica.Utilities.Streams.error;
+      extends Modelica.Icons.Function;
+      input Real y_zero
+        "Determine x_zero, such that f_nonlinear(x_zero) = y_zero";
+      input Real x_min "Minimum value of x";
+      input Real x_max "Maximum value of x";
+      input Real pressure=0.0
+        "Disregarded variables (here always used for pressure)";
+      input Real[:] X=fill(0, 0)
+        "Disregarded variables (here always used for composition)";
+      input f_nonlinear_Data f_nonlinear_data
+        "Additional data for function f_nonlinear";
+      input Real x_tol=100*Modelica.Constants.eps
+        "Relative tolerance of the result";
+      output Real x_zero "f_nonlinear(x_zero) = y_zero";
+    protected
+      constant Real eps=Modelica.Constants.eps "Machine epsilon";
+      constant Real x_eps=1e-10
+        "Slight modification of x_min, x_max, since x_min, x_max are usually exactly at the borders T_min/h_min and then small numeric noise may make the interval invalid";
+      Real x_min2=x_min - x_eps;
+      Real x_max2=x_max + x_eps;
+      Real a=x_min2 "Current best minimum interval value";
+      Real b=x_max2 "Current best maximum interval value";
+      Real c "Intermediate point a <= c <= b";
+      Real d;
+      Real e "b - a";
+      Real m;
+      Real s;
+      Real p;
+      Real q;
+      Real r;
+      Real tol;
+      Real fa "= f_nonlinear(a) - y_zero";
+      Real fb "= f_nonlinear(b) - y_zero";
+      Real fc;
+      Boolean found=false;
+    algorithm
+      // Check that f(x_min) and f(x_max) have different sign
+      fa := f_nonlinear(
+              x_min2,
+              pressure,
+              X,
+              f_nonlinear_data) - y_zero;
+      fb := f_nonlinear(
+              x_max2,
+              pressure,
+              X,
+              f_nonlinear_data) - y_zero;
+      fc := fb;
+      if fa > 0.0 and fb > 0.0 or fa < 0.0 and fb < 0.0 then
+        error(
+          "The arguments x_min and x_max to OneNonLinearEquation.solve(..)\n"
+           + "do not bracket the root of the single non-linear equation:\n" +
+          "  x_min  = " + String(x_min2) + "\n" + "  x_max  = " + String(x_max2)
+           + "\n" + "  y_zero = " + String(y_zero) + "\n" +
+          "  fa = f(x_min) - y_zero = " + String(fa) + "\n" +
+          "  fb = f(x_max) - y_zero = " + String(fb) + "\n" +
+          "fa and fb must have opposite sign which is not the case");
+      end if;
+
+      // Initialize variables
+      c := a;
+      fc := fa;
+      e := b - a;
+      d := e;
+
+      // Search loop
+      while not found loop
+        if abs(fc) < abs(fb) then
+          a := b;
+          b := c;
+          c := a;
+          fa := fb;
+          fb := fc;
+          fc := fa;
+        end if;
+
+        tol := 2*eps*abs(b) + x_tol;
+        m := (c - b)/2;
+
+        if abs(m) <= tol or fb == 0.0 then
+          // root found (interval is small enough)
+          found := true;
+          x_zero := b;
+        else
+          // Determine if a bisection is needed
+          if abs(e) < tol or abs(fa) <= abs(fb) then
+            e := m;
+            d := e;
+          else
+            s := fb/fa;
+            if a == c then
+              // linear interpolation
+              p := 2*m*s;
+              q := 1 - s;
+            else
+              // inverse quadratic interpolation
+              q := fa/fc;
+              r := fb/fc;
+              p := s*(2*m*q*(q - r) - (b - a)*(r - 1));
+              q := (q - 1)*(r - 1)*(s - 1);
+            end if;
+
+            if p > 0 then
+              q := -q;
+            else
+              p := -p;
+            end if;
+
+            s := e;
+            e := d;
+            if 2*p < 3*m*q - abs(tol*q) and p < abs(0.5*s*q) then
+              // interpolation successful
+              d := p/q;
+            else
+              // use bi-section
+              e := m;
+              d := e;
+            end if;
+          end if;
+
+          // Best guess value is defined as "a"
+          a := b;
+          fa := fb;
+          b := b + (if abs(d) > tol then d else if m > 0 then tol else -tol);
+          fb := f_nonlinear(
+                  b,
+                  pressure,
+                  X,
+                  f_nonlinear_data) - y_zero;
+
+          if fb > 0 and fc > 0 or fb < 0 and fc < 0 then
+            // initialize variables
+            c := a;
+            fc := fa;
+            e := b - a;
+            d := e;
+          end if;
+        end if;
+      end while;
+    end solve;
+
+    annotation (Documentation(info="<html>
+<p>
+This function should currently only be used in Modelica.Media,
+since it might be replaced in the future by another strategy,
+where the tool is responsible for the solution of the non-linear
+equation.
+</p>
+
+<p>
+This library determines the solution of one non-linear algebraic equation \"y=f(x)\"
+in one unknown \"x\" in a reliable way. As input, the desired value y of the
+non-linear function has to be given, as well as an interval x_min, x_max that
+contains the solution, i.e., \"f(x_min) - y\" and \"f(x_max) - y\" must
+have a different sign. If possible, a smaller interval is computed by
+inverse quadratic interpolation (interpolating with a quadratic polynomial
+through the last 3 points and computing the zero). If this fails,
+bisection is used, which always reduces the interval by a factor of 2.
+The inverse quadratic interpolation method has superlinear convergence.
+This is roughly the same convergence rate as a globally convergent Newton
+method, but without the need to compute derivatives of the non-linear
+function. The solver function is a direct mapping of the Algol 60 procedure
+\"zero\" to Modelica, from:
+</p>
+
+<dl>
+<dt> Brent R.P.:</dt>
+<dd> <b>Algorithms for Minimization without derivatives</b>.
+     Prentice Hall, 1973, pp. 58-59.</dd>
+</dl>
+
+<p>
+Due to current limitations of the
+Modelica language (not possible to pass a function reference to a function),
+the construction to use this solver on a user-defined function is a bit
+complicated (this method is from Hans Olsson, Dassault Syst&egrave;mes AB). A user has to
+provide a package in the following way:
+</p>
+
+<pre>
+  <b>package</b> MyNonLinearSolver
+    <b>extends</b> OneNonLinearEquation;
+
+    <b>redeclare record extends</b> Data
+      // Define data to be passed to user function
+      ...
+    <b>end</b> Data;
+
+    <b>redeclare function extends</b> f_nonlinear
+    <b>algorithm</b>
+       // Compute the non-linear equation: y = f(x, Data)
+    <b>end</b> f_nonlinear;
+
+    // Dummy definition that has to be present for current Dymola
+    <b>redeclare function extends</b> solve
+    <b>end</b> solve;
+  <b>end</b> MyNonLinearSolver;
+
+  x_zero = MyNonLinearSolver.solve(y_zero, x_min, x_max, data=data);
+</pre>
+</html>"));
+  end OneNonLinearEquation;
+  annotation (Documentation(info="<html>
+<p><b>Package description</b> </p>
+<p>This package provides records and functions shared by many of the property sub-packages. High accuracy fluid property models share a lot of common structure, even if the actual models are different. Common data structures and computations shared by these property models are collected in this library.</p>
+<p>This package is copied from package Modelica.Media.Common in Modelica package version 3.2.2.</p>
+</html>", revisions="<html>
+      <ul>
+      <li>First implemented: <i>July, 2000</i>
+      by Hubertus Tummescheit
+      for the ThermoFluid Library with help from Jonas Eborn and Falko Jens Wagner
+      </li>
+      <li>Code reorganization, enhanced documentation, additional functions: <i>December, 2002</i>
+      by Hubertus Tummescheit and move to Modelica
+                            properties library.</li>
+      <li>Inclusion into Modelica.Media: September 2003 </li>
+      </ul>
+
+      <address>Author: Hubertus Tummescheit, <br>
+      Lund University<br>
+      Department of Automatic Control<br>
+      Box 118, 22100 Lund, Sweden<br>
+      email: hubertus@control.lth.se
+      </address>
+</html>"), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Ellipse(
+          lineColor={102,102,102},
+          fillColor={204,204,204},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Sphere,
+          extent={{-60.0,-60.0},{60.0,60.0}})}));
+end Common;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/Density_PT.mo b/ThermoSysPro/Properties/DryAirIdealGas/Density_PT.mo
index f64290a609ae1028be4c7847ed4b5b38eff12681..efe0614d188896984894352e2bbd30608ade7dfd 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/Density_PT.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/Density_PT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function Density_PT "Density computation for Dry Air Ideal Gas (input P, T)"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.Pressure P;
-  input Units.SI.Temperature T "Temperature (K)";
-
-  output Units.SI.Density rho;
-
-protected
-  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
-
-algorithm
-  rho := P / (Data.specificGasConstant * T);
-
-//annotation(inverse(p = Pressure_rhot_calc(rho,temp), temp = Temperature_rhop_calc(rho,p)), derivative = Density_derpt_calc);
-annotation(derivative = derDensity_derP_derT);
-end Density_PT;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function Density_PT "Density computation for Dry Air Ideal Gas (input P, T)"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.Pressure P;
+  input Units.SI.Temperature T "Temperature (K)";
+
+  output Units.SI.Density rho;
+
+protected
+  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
+
+algorithm
+  rho := P / (Data.specificGasConstant * T);
+
+//annotation(inverse(p = Pressure_rhot_calc(rho,temp), temp = Temperature_rhop_calc(rho,p)), derivative = Density_derpt_calc);
+annotation(derivative = derDensity_derP_derT);
+end Density_PT;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/DryAirIdealGas.mo b/ThermoSysPro/Properties/DryAirIdealGas/DryAirIdealGas.mo
index e6315f9067b0560bcba31e232e6e1cfadcbe0247..b9a2d5d51a424caf1ee11825041bd03c27bcfcfe 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/DryAirIdealGas.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/DryAirIdealGas.mo
@@ -1,29 +1,29 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-record DryAirIdealGas "Data for Dry Air Ideal Gas from STEPHANIE Library"
-  // STEPHANIE Dry Air Ideal Gas
-  // "Air Data Package - valid temperature ranges 200K - 1000K and 1000K - 6000K. Source: NASA/TP-2002-211556 Coefficients for Calculating Thermodynamic Properties"
-
-// Data package
-  String idealGasName = "Air -N2 78.08 -O2 20.95 -Ar 0.94 -CO2 0.03 percent";
-  Real molarMass = 0.0289651;
-  Units.SI.SpecificEnthalpy enthalpyOfFormation=-4333.836;
-  Units.SI.SpecificEnthalpy enthalpyReference=298609.8443;
-  Real limitTemperature = 1000;
-  Real alow[:] = {10099.5016,-196.827561,5.00915511,-0.00576101373,1.06685993e-5,-7.94029797e-9,2.18523191e-12};
-  Real blow[:] = {-176.796731,-3.921504225};
-  Real ahigh[:] = {241521.443,-1257.8746,5.14455867,-0.000213854179,7.06522784e-8,-1.07148349e-11,6.57780015e-16};
-  Real bhigh[:] = {6462.26319,-8.147411905};
-  Real specificGasConstant = 287.051225;
-
-// extends PartialIdealSingleGas (ie: ajouté à PartialIdealSingleGas)
-  String mediumName = "Dry Air";
-  Boolean compressible = true;
-  Units.SI.Temperature maximum_temperature=1000;
-  Units.SI.Temperature minimum_temperature=200;
-  Units.SI.Temperature reference_temperature=302.45;
-  Units.SI.Pressure pressure_default=101325;
-  Units.SI.SpecificEnthalpy enthalpy_default=300415.551249572
-    "Default value for enthalpy (@ 323ºC) of medium (for initialization)";
-    //=ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T=(323+273.15))
-
-end DryAirIdealGas;
+within ThermoSysPro.Properties.DryAirIdealGas;
+record DryAirIdealGas "Data for Dry Air Ideal Gas from STEPHANIE Library"
+  // STEPHANIE Dry Air Ideal Gas
+  // "Air Data Package - valid temperature ranges 200K - 1000K and 1000K - 6000K. Source: NASA/TP-2002-211556 Coefficients for Calculating Thermodynamic Properties"
+
+// Data package
+  String idealGasName = "Air -N2 78.08 -O2 20.95 -Ar 0.94 -CO2 0.03 percent";
+  Real molarMass = 0.0289651;
+  Units.SI.SpecificEnthalpy enthalpyOfFormation=-4333.836;
+  Units.SI.SpecificEnthalpy enthalpyReference=298609.8443;
+  Real limitTemperature = 1000;
+  Real alow[:] = {10099.5016,-196.827561,5.00915511,-0.00576101373,1.06685993e-5,-7.94029797e-9,2.18523191e-12};
+  Real blow[:] = {-176.796731,-3.921504225};
+  Real ahigh[:] = {241521.443,-1257.8746,5.14455867,-0.000213854179,7.06522784e-8,-1.07148349e-11,6.57780015e-16};
+  Real bhigh[:] = {6462.26319,-8.147411905};
+  Real specificGasConstant = 287.051225;
+
+// extends PartialIdealSingleGas (ie: ajouté à PartialIdealSingleGas)
+  String mediumName = "Dry Air";
+  Boolean compressible = true;
+  Units.SI.Temperature maximum_temperature=1000;
+  Units.SI.Temperature minimum_temperature=200;
+  Units.SI.Temperature reference_temperature=302.45;
+  Units.SI.Pressure pressure_default=101325;
+  Units.SI.SpecificEnthalpy enthalpy_default=300415.551249572
+    "Default value for enthalpy (@ 323ºC) of medium (for initialization)";
+    //=ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T=(323+273.15))
+
+end DryAirIdealGas;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/DynamicViscosity_Trho.mo b/ThermoSysPro/Properties/DryAirIdealGas/DynamicViscosity_Trho.mo
index 404416736dd530ccfbea98c03df326a14193b27e..92c8017031acdacb15ecb32846b1d7518b506680 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/DynamicViscosity_Trho.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/DynamicViscosity_Trho.mo
@@ -1,43 +1,43 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function DynamicViscosity_Trho
-  "Dynamic Viscosity computation for Dry Air Ideal Gas (inputs: T, rho)"
-  //valid up to 100MPa and 2000K, according to Kadoya et al. 1985 (Viscosity and Thermal Conductivity of Dry Air in the Gaseous Phase), Journal of Physical and Chemical Reference Data"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.Temperature T "Temperature (K)";
-  input Units.SI.Density rho "Density (kg/m3)";
-
-  output Units.SI.DynamicViscosity mu "Dynamic Viscosity (Pa.s)";
-
-protected
-  constant Units.SI.Temperature tnorm=132.5 "kritikal temperature";
-  constant Units.SI.Density rhonorm=314.3 "critical density";
-  constant Real H = 6.1609e-6;
-  constant Real A1 = 0.128517;
-  constant Real A05 = 2.60661;
-  constant Real A0 = -1;
-  constant Real A_1 = -0.709661;
-  constant Real A_2 = 0.662534;
-  constant Real A_3 = -0.197846;
-  constant Real A_4 = 0.00770147;
-  constant Real B1 = 0.465601;
-  constant Real B2 = 1.26469;
-  constant Real B3 = -0.511425;
-  constant Real B4 = 0.2746;
-  Real viscosityZeroDensity;
-  Units.SI.Temperature tReduced "dimensionless temperature";
-  Units.SI.Density rhoReduced "dimensionless density";
-  Real residualViscosity;
-
-algorithm
- //viscosityZeroDensity:
-  tReduced := T/tnorm;
-  viscosityZeroDensity := A1*tReduced + A05*sqrt(tReduced) + A0 + A_1*tReduced^(-1) + A_2*tReduced^(-2) + A_3*tReduced^(-3) + A_4*tReduced^(-4);
- //residualViscosity:
-  rhoReduced := rho/rhonorm;
-  residualViscosity := B1*rhoReduced + B2*rhoReduced^2 + B3*rhoReduced^3 + B4*rhoReduced^4;
-
-  mu := (viscosityZeroDensity + residualViscosity)*H;
-
-  annotation(derivative = derDynamicViscosity_derT_derrho);
-end DynamicViscosity_Trho;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function DynamicViscosity_Trho
+  "Dynamic Viscosity computation for Dry Air Ideal Gas (inputs: T, rho)"
+  //valid up to 100MPa and 2000K, according to Kadoya et al. 1985 (Viscosity and Thermal Conductivity of Dry Air in the Gaseous Phase), Journal of Physical and Chemical Reference Data"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.Temperature T "Temperature (K)";
+  input Units.SI.Density rho "Density (kg/m3)";
+
+  output Units.SI.DynamicViscosity mu "Dynamic Viscosity (Pa.s)";
+
+protected
+  constant Units.SI.Temperature tnorm=132.5 "kritikal temperature";
+  constant Units.SI.Density rhonorm=314.3 "critical density";
+  constant Real H = 6.1609e-6;
+  constant Real A1 = 0.128517;
+  constant Real A05 = 2.60661;
+  constant Real A0 = -1;
+  constant Real A_1 = -0.709661;
+  constant Real A_2 = 0.662534;
+  constant Real A_3 = -0.197846;
+  constant Real A_4 = 0.00770147;
+  constant Real B1 = 0.465601;
+  constant Real B2 = 1.26469;
+  constant Real B3 = -0.511425;
+  constant Real B4 = 0.2746;
+  Real viscosityZeroDensity;
+  Units.SI.Temperature tReduced "dimensionless temperature";
+  Units.SI.Density rhoReduced "dimensionless density";
+  Real residualViscosity;
+
+algorithm
+ //viscosityZeroDensity:
+  tReduced := T/tnorm;
+  viscosityZeroDensity := A1*tReduced + A05*sqrt(tReduced) + A0 + A_1*tReduced^(-1) + A_2*tReduced^(-2) + A_3*tReduced^(-3) + A_4*tReduced^(-4);
+ //residualViscosity:
+  rhoReduced := rho/rhonorm;
+  residualViscosity := B1*rhoReduced + B2*rhoReduced^2 + B3*rhoReduced^3 + B4*rhoReduced^4;
+
+  mu := (viscosityZeroDensity + residualViscosity)*H;
+
+  annotation(derivative = derDynamicViscosity_derT_derrho);
+end DynamicViscosity_Trho;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/IsobaricExpansionCoefficient_T.mo b/ThermoSysPro/Properties/DryAirIdealGas/IsobaricExpansionCoefficient_T.mo
index 4a27683ac74ecf7811deedda4a4541e2cc3f4600..29f56a47cc420bcbd54468b03c94d0ee70ac977b 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/IsobaricExpansionCoefficient_T.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/IsobaricExpansionCoefficient_T.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function IsobaricExpansionCoefficient_T
-  "Isobaric Expansion Coefficient computation for Dry Air Ideal Gas (input T)"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  output Units.SI.CubicExpansionCoefficient Beta
-    "Isobaric Expansion Coefficient (1/K)";
-
-algorithm
-  Beta := 1/T;
-
-  annotation(derivative = derIsobaricExpansionCoefficient_derT);
-end IsobaricExpansionCoefficient_T;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function IsobaricExpansionCoefficient_T
+  "Isobaric Expansion Coefficient computation for Dry Air Ideal Gas (input T)"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  output Units.SI.CubicExpansionCoefficient Beta
+    "Isobaric Expansion Coefficient (1/K)";
+
+algorithm
+  Beta := 1/T;
+
+  annotation(derivative = derIsobaricExpansionCoefficient_derT);
+end IsobaricExpansionCoefficient_T;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/SpecificEnthalpy_T.mo b/ThermoSysPro/Properties/DryAirIdealGas/SpecificEnthalpy_T.mo
index c599eff80b2a2bce8d6b117ab2501af94df74377..b9100e83bd36edbde14bc54f4a875e4e88ad9bc2 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/SpecificEnthalpy_T.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/SpecificEnthalpy_T.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function SpecificEnthalpy_T
-  "Specific Enthalpy computation for Dry Air Ideal Gas (input T)"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.Temperature T "Temperature (K)";
-  output Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
-
-protected
-  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
-
-algorithm
- //H(T)/RT = -a1*T^(-2) + a2*lnT/T + a3 + a4*T/2 + a5*T^(2)/3 + a6*T^(3)/4 + a7*T^(4)/5 + b1/T
-   h := (-Data.alow[1]*T^(-2) + Data.alow[2]*Modelica.Math.log(T)/T + Data.alow[3] + Data.alow[4]*T/2 + Data.alow[5]*T^(2)/3 + Data.alow[6]*T^(3)/4 + Data.alow[7]*T^(4)/5 + Data.blow[1]/T)*T*Data.specificGasConstant;
-
-  annotation(derivative = derSpecificEnthalpy_derT, inverse(T = Temperature_h(h)));
-end SpecificEnthalpy_T;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function SpecificEnthalpy_T
+  "Specific Enthalpy computation for Dry Air Ideal Gas (input T)"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.Temperature T "Temperature (K)";
+  output Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
+
+protected
+  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
+
+algorithm
+ //H(T)/RT = -a1*T^(-2) + a2*lnT/T + a3 + a4*T/2 + a5*T^(2)/3 + a6*T^(3)/4 + a7*T^(4)/5 + b1/T
+   h := (-Data.alow[1]*T^(-2) + Data.alow[2]*Modelica.Math.log(T)/T + Data.alow[3] + Data.alow[4]*T/2 + Data.alow[5]*T^(2)/3 + Data.alow[6]*T^(3)/4 + Data.alow[7]*T^(4)/5 + Data.blow[1]/T)*T*Data.specificGasConstant;
+
+  annotation(derivative = derSpecificEnthalpy_derT, inverse(T = Temperature_h(h)));
+end SpecificEnthalpy_T;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/SpecificHeatCp_T.mo b/ThermoSysPro/Properties/DryAirIdealGas/SpecificHeatCp_T.mo
index 2f9e55260b6e45c71174e599050347eab02165ec..34d3215d1306349a876cff412b3ec0c1004c135a 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/SpecificHeatCp_T.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/SpecificHeatCp_T.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function SpecificHeatCp_T
-  "Specific Heat Capacity at fixed P computation for Dry Air Ideal Gas (input T)"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.Temperature T "Temperature (K)";
-  output Units.SI.SpecificHeatCapacity Cp "Specific Heat Capacity (J/kg/K)";
-
-protected
-  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
-
-algorithm
-  //Cp(T)/R = a1*T^(-2) + a2*T^(-1) + a3 + a4*T + a5*T^(2) + a6*T^(3) + a7*T^(4)
-  Cp := Data.specificGasConstant*(Data.alow[1]*T^(-2) + Data.alow[2]*T^(-1) + Data.alow[3] + Data.alow[4]*T + Data.alow[5]*T^(2) + Data.alow[6]*T^(3) + Data.alow[7]*T^(4));
-
-  //annotation(inverse(temp = Temperature_cp(cp)), derivative = SpecificHeatCp_dert);
-  annotation(derivative = SpecificHeatCp_derT);
-end SpecificHeatCp_T;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function SpecificHeatCp_T
+  "Specific Heat Capacity at fixed P computation for Dry Air Ideal Gas (input T)"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.Temperature T "Temperature (K)";
+  output Units.SI.SpecificHeatCapacity Cp "Specific Heat Capacity (J/kg/K)";
+
+protected
+  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
+
+algorithm
+  //Cp(T)/R = a1*T^(-2) + a2*T^(-1) + a3 + a4*T + a5*T^(2) + a6*T^(3) + a7*T^(4)
+  Cp := Data.specificGasConstant*(Data.alow[1]*T^(-2) + Data.alow[2]*T^(-1) + Data.alow[3] + Data.alow[4]*T + Data.alow[5]*T^(2) + Data.alow[6]*T^(3) + Data.alow[7]*T^(4));
+
+  //annotation(inverse(temp = Temperature_cp(cp)), derivative = SpecificHeatCp_dert);
+  annotation(derivative = SpecificHeatCp_derT);
+end SpecificHeatCp_T;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/SpecificHeatCp_derT.mo b/ThermoSysPro/Properties/DryAirIdealGas/SpecificHeatCp_derT.mo
index 52a01d93b86d140983bf5c16a763a9b34987543b..c9633b93fac26037f1e2e142542140d78a3c1d1f 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/SpecificHeatCp_derT.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/SpecificHeatCp_derT.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function SpecificHeatCp_derT
-  "der(Specific Heat Capacity at fixed P) computation for Dry Air Ideal Gas (inputs: T, der(T))"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  input Real der_T "Temperature time derivative (K/s)";
-
-  output Real der_Cp "Specific Heat Capacity time derivative (J/kg/K/s)";
-
-protected
-  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
-
-algorithm
-  //der_Cp(T) = (-2*a1*T^(-3) - a2*T^(-2) + a4 + 2*a5*T + 3*a6*T^(2) + 4*a7*T^(3))*R*der_temp;
-  der_Cp := (-2*Data.alow[1]*T^(-3) - Data.alow[2]*T^(-2) + Data.alow[4] + 2*Data.alow[5]*T + 3*Data.alow[6]*T^(2) + 4*Data.alow[7]*T^(3))*Data.specificGasConstant*der_T;
-
-end SpecificHeatCp_derT;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function SpecificHeatCp_derT
+  "der(Specific Heat Capacity at fixed P) computation for Dry Air Ideal Gas (inputs: T, der(T))"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  input Real der_T "Temperature time derivative (K/s)";
+
+  output Real der_Cp "Specific Heat Capacity time derivative (J/kg/K/s)";
+
+protected
+  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
+
+algorithm
+  //der_Cp(T) = (-2*a1*T^(-3) - a2*T^(-2) + a4 + 2*a5*T + 3*a6*T^(2) + 4*a7*T^(3))*R*der_temp;
+  der_Cp := (-2*Data.alow[1]*T^(-3) - Data.alow[2]*T^(-2) + Data.alow[4] + 2*Data.alow[5]*T + 3*Data.alow[6]*T^(2) + 4*Data.alow[7]*T^(3))*Data.specificGasConstant*der_T;
+
+end SpecificHeatCp_derT;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/Temperature_h.mo b/ThermoSysPro/Properties/DryAirIdealGas/Temperature_h.mo
index 40b522d5f907c8031c3c4bb02c3ed200d391aac4..5dcfa76880584919f5e959993e5d732f8128d0f3 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/Temperature_h.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/Temperature_h.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function Temperature_h
-  "Temperature computation for Dry Air Ideal Gas (input h)"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
-  output Units.SI.Temperature T "Temperature (K)";
-
-protected
-  constant Real C[6] = {302.45170074922396, 0.0009955239553877519,-2.3667518904940937e-11,-1.6218505689880788e-16,1.5436079535175405e-22,-4.4309458281550505e-29};
-  //constants C[6] obtained from inverting SpecificEnthalpy_t (through polynomial fitting) it's not the exact inverse function!
-
-algorithm
-  T := C[1] + C[2]*h + C[3]*h^2 + C[4]*h^3 + C[5]*h^4 + C[6]*h^5;
-
-  annotation(derivative = derTemperature_derh, inverse(h = SpecificEnthalpy_T(T)));
-end Temperature_h;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function Temperature_h
+  "Temperature computation for Dry Air Ideal Gas (input h)"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
+  output Units.SI.Temperature T "Temperature (K)";
+
+protected
+  constant Real C[6] = {302.45170074922396, 0.0009955239553877519,-2.3667518904940937e-11,-1.6218505689880788e-16,1.5436079535175405e-22,-4.4309458281550505e-29};
+  //constants C[6] obtained from inverting SpecificEnthalpy_t (through polynomial fitting) it's not the exact inverse function!
+
+algorithm
+  T := C[1] + C[2]*h + C[3]*h^2 + C[4]*h^3 + C[5]*h^4 + C[6]*h^5;
+
+  annotation(derivative = derTemperature_derh, inverse(h = SpecificEnthalpy_T(T)));
+end Temperature_h;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/ThermalConductivity_Trho.mo b/ThermoSysPro/Properties/DryAirIdealGas/ThermalConductivity_Trho.mo
index f7454b249d3e50c09aef91448ee014c55ff59bc6..034090e5d0555d472a097532d679c9d93a3b0058 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/ThermalConductivity_Trho.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/ThermalConductivity_Trho.mo
@@ -1,44 +1,44 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function ThermalConductivity_Trho
-  "Thermal Conductivity computation for Dry Air Ideal Gas (inputs: T, rho)"
-  //valid up to 100MPa and 2000K, according to Kadoya et al. 1985 (Viscosity and Thermal Conductivity of Dry Air in the Gaseous Phase), Journal of Physical and Chemical Reference Data
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.Temperature T "Temperature (K)";
-  input Units.SI.Density rho "Density (kg/m3)";
-
-  output Units.SI.ThermalConductivity k "Thermal Conductivity (W/m/K)";
-
-protected
-  constant Units.SI.Temperature tnorm=132.5 "critical temperature";
-  constant Units.SI.Density rhonorm=314.3 "critical density";
-    constant Real lambda = 25.9778e-3;
-    constant Real C1 = 0.239503;
-    constant Real C05 = 0.00649768;
-    constant Real C0 = 1;
-    constant Real C_1 = -1.92615;
-    constant Real C_2 = 2.00383;
-    constant Real C_3 = -1.07553;
-    constant Real C_4 = 0.229414;
-    constant Real D1 = 0.402287;
-    constant Real D2 = 0.356603;
-    constant Real D3 = -0.163159;
-    constant Real D4 = 0.138059;
-    constant Real D5 = -0.0201725;
-  Units.SI.Temperature tReduced "dimensionless temperature";
-  Units.SI.Density rhoReduced "dimensionless density";
-    Real diluteConductivity;
-    Real residualConductivity;
-
-algorithm
-     //dilute conductivity
-     tReduced := T/tnorm;
-     diluteConductivity := C1*tReduced + C05*sqrt(tReduced) + C0 + C_1*tReduced^(-1) + C_2*tReduced^(-2) + C_3*tReduced^(-3) + C_4*tReduced^(-4);
-     //residual conductivity
-     rhoReduced := rho/rhonorm;
-     residualConductivity := D1*rhoReduced + D2*rhoReduced^2 + D3*rhoReduced^3 + D4*rhoReduced^4 + D5*rhoReduced^5;
-
-     k := (diluteConductivity + residualConductivity)*lambda;
-
-  annotation(derivative = derThermalConductivity_derT_derrho);
-end ThermalConductivity_Trho;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function ThermalConductivity_Trho
+  "Thermal Conductivity computation for Dry Air Ideal Gas (inputs: T, rho)"
+  //valid up to 100MPa and 2000K, according to Kadoya et al. 1985 (Viscosity and Thermal Conductivity of Dry Air in the Gaseous Phase), Journal of Physical and Chemical Reference Data
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.Temperature T "Temperature (K)";
+  input Units.SI.Density rho "Density (kg/m3)";
+
+  output Units.SI.ThermalConductivity k "Thermal Conductivity (W/m/K)";
+
+protected
+  constant Units.SI.Temperature tnorm=132.5 "critical temperature";
+  constant Units.SI.Density rhonorm=314.3 "critical density";
+    constant Real lambda = 25.9778e-3;
+    constant Real C1 = 0.239503;
+    constant Real C05 = 0.00649768;
+    constant Real C0 = 1;
+    constant Real C_1 = -1.92615;
+    constant Real C_2 = 2.00383;
+    constant Real C_3 = -1.07553;
+    constant Real C_4 = 0.229414;
+    constant Real D1 = 0.402287;
+    constant Real D2 = 0.356603;
+    constant Real D3 = -0.163159;
+    constant Real D4 = 0.138059;
+    constant Real D5 = -0.0201725;
+  Units.SI.Temperature tReduced "dimensionless temperature";
+  Units.SI.Density rhoReduced "dimensionless density";
+    Real diluteConductivity;
+    Real residualConductivity;
+
+algorithm
+     //dilute conductivity
+     tReduced := T/tnorm;
+     diluteConductivity := C1*tReduced + C05*sqrt(tReduced) + C0 + C_1*tReduced^(-1) + C_2*tReduced^(-2) + C_3*tReduced^(-3) + C_4*tReduced^(-4);
+     //residual conductivity
+     rhoReduced := rho/rhonorm;
+     residualConductivity := D1*rhoReduced + D2*rhoReduced^2 + D3*rhoReduced^3 + D4*rhoReduced^4 + D5*rhoReduced^5;
+
+     k := (diluteConductivity + residualConductivity)*lambda;
+
+  annotation(derivative = derThermalConductivity_derT_derrho);
+end ThermalConductivity_Trho;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/derDensity_derP_derT.mo b/ThermoSysPro/Properties/DryAirIdealGas/derDensity_derP_derT.mo
index b7848bcf08a74a5a8399ab5d04106fddc039085d..5a51225548dce69160eddc9238bed218f396fb24 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/derDensity_derP_derT.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/derDensity_derP_derT.mo
@@ -1,21 +1,21 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function derDensity_derP_derT
-  "der(Density) computation for Dry Air Ideal Gas (inputs: P, T, der(P), der(T))"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.Pressure P;
-  input Units.SI.Temperature T "Temperature (K)";
-  input Real der_P "pressure time derivative (Pa/s)";
-  input Real der_T "Temperature time derivative (K/s)";
-
-  output Real der_rho "density time derivative (kg/(m3*s))";
-
-protected
-  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
-
-algorithm
-//-> der_density = partial derivative of density with respect to pressure * der_pressure +
-//                 partial derivative of density with respect to temperature *der_temperature
-  der_rho := (1 / (Data.specificGasConstant * T)) * der_P + (- P / (Data.specificGasConstant * T^2)) * der_T;
-
-end derDensity_derP_derT;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function derDensity_derP_derT
+  "der(Density) computation for Dry Air Ideal Gas (inputs: P, T, der(P), der(T))"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.Pressure P;
+  input Units.SI.Temperature T "Temperature (K)";
+  input Real der_P "pressure time derivative (Pa/s)";
+  input Real der_T "Temperature time derivative (K/s)";
+
+  output Real der_rho "density time derivative (kg/(m3*s))";
+
+protected
+  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
+
+algorithm
+//-> der_density = partial derivative of density with respect to pressure * der_pressure +
+//                 partial derivative of density with respect to temperature *der_temperature
+  der_rho := (1 / (Data.specificGasConstant * T)) * der_P + (- P / (Data.specificGasConstant * T^2)) * der_T;
+
+end derDensity_derP_derT;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/derDynamicViscosity_derT_derrho.mo b/ThermoSysPro/Properties/DryAirIdealGas/derDynamicViscosity_derT_derrho.mo
index b5cadd11edc54f2c218ccc8f92ef21d8bf45d29b..286ef83f51e22b34e4d7db6b62081e167a237601 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/derDynamicViscosity_derT_derrho.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/derDynamicViscosity_derT_derrho.mo
@@ -1,36 +1,36 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function derDynamicViscosity_derT_derrho
-  "der(Dynamic Viscosity) computation for Dry Air Ideal Gas (inputs: T, rho, der(T), der(rho))"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.Temperature T "Temperature (K)";
-  input Units.SI.Density rho "Density (kg/m3)";
-  input Real der_T "Temperature time derivative (K/s)";
-  input Real der_rho "Density time derivative (kg/m3/s)";
-
-  output Real der_mu "Dynamic Viscosity time derivative (Pa)";
-
-protected
-  constant Units.SI.Temperature tnorm=132.5 "kritikal temperature";
-  constant Units.SI.Density rhonorm=314.3 "critical density";
-  constant Real H = 6.1609e-6;
-  constant Real A1 = 0.128517;
-  constant Real A05 = 2.60661;
-  constant Real A0 = -1;
-  constant Real A_1 = -0.709661;
-  constant Real A_2 = 0.662534;
-  constant Real A_3 = -0.197846;
-  constant Real A_4 = 0.00770147;
-  constant Real B1 = 0.465601;
-  constant Real B2 = 1.26469;
-  constant Real B3 = -0.511425;
-  constant Real B4 = 0.2746;
-
-algorithm
-    // der_mu = partial derivative of mu with respect to T times der_T + partial derivative of mu with respect to rho times der_rho
-    // der_mu = derivative of viscosityZeroDensity*H with respect to T times der_T + derivative of residualViscosity*H with respect to rho times der_rho
-
-    der_mu := (H*(A1/tnorm + A05/(2*sqrt(T/tnorm)*tnorm) - (A_1*tnorm)/T^2 - (2*A_2*tnorm^2)/T^3 - (3*A_3*tnorm^3)/T^4 - (4*A_4*tnorm^4)/T^5))*der_T +
-              (H*((4*B4*rho^3)/rhonorm^4 + (3*B3*rho^2)/rhonorm^3 + (2*B2*rho)/rhonorm^2 + B1/rhonorm))*der_rho;
-
-end derDynamicViscosity_derT_derrho;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function derDynamicViscosity_derT_derrho
+  "der(Dynamic Viscosity) computation for Dry Air Ideal Gas (inputs: T, rho, der(T), der(rho))"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.Temperature T "Temperature (K)";
+  input Units.SI.Density rho "Density (kg/m3)";
+  input Real der_T "Temperature time derivative (K/s)";
+  input Real der_rho "Density time derivative (kg/m3/s)";
+
+  output Real der_mu "Dynamic Viscosity time derivative (Pa)";
+
+protected
+  constant Units.SI.Temperature tnorm=132.5 "kritikal temperature";
+  constant Units.SI.Density rhonorm=314.3 "critical density";
+  constant Real H = 6.1609e-6;
+  constant Real A1 = 0.128517;
+  constant Real A05 = 2.60661;
+  constant Real A0 = -1;
+  constant Real A_1 = -0.709661;
+  constant Real A_2 = 0.662534;
+  constant Real A_3 = -0.197846;
+  constant Real A_4 = 0.00770147;
+  constant Real B1 = 0.465601;
+  constant Real B2 = 1.26469;
+  constant Real B3 = -0.511425;
+  constant Real B4 = 0.2746;
+
+algorithm
+    // der_mu = partial derivative of mu with respect to T times der_T + partial derivative of mu with respect to rho times der_rho
+    // der_mu = derivative of viscosityZeroDensity*H with respect to T times der_T + derivative of residualViscosity*H with respect to rho times der_rho
+
+    der_mu := (H*(A1/tnorm + A05/(2*sqrt(T/tnorm)*tnorm) - (A_1*tnorm)/T^2 - (2*A_2*tnorm^2)/T^3 - (3*A_3*tnorm^3)/T^4 - (4*A_4*tnorm^4)/T^5))*der_T +
+              (H*((4*B4*rho^3)/rhonorm^4 + (3*B3*rho^2)/rhonorm^3 + (2*B2*rho)/rhonorm^2 + B1/rhonorm))*der_rho;
+
+end derDynamicViscosity_derT_derrho;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/derIsobaricExpansionCoefficient_derT.mo b/ThermoSysPro/Properties/DryAirIdealGas/derIsobaricExpansionCoefficient_derT.mo
index 708682870b15031731547a4da016cff7ca1a12c8..d964ee73c2c7995e5e824751ef1824edcfeca478 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/derIsobaricExpansionCoefficient_derT.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/derIsobaricExpansionCoefficient_derT.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function derIsobaricExpansionCoefficient_derT
-  "der(Isobaric Expansion Coefficient) computation for Dry Air Ideal Gas (input T, der(T))"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  input Real der_T "Temperature time derivative (K/s)";
-
-  output Real der_Beta "isobaric expansion coefficient time derivative (1/Ks)";
-
-algorithm
-  der_Beta := -1/T^2*der_T;
-
-end derIsobaricExpansionCoefficient_derT;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function derIsobaricExpansionCoefficient_derT
+  "der(Isobaric Expansion Coefficient) computation for Dry Air Ideal Gas (input T, der(T))"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  input Real der_T "Temperature time derivative (K/s)";
+
+  output Real der_Beta "isobaric expansion coefficient time derivative (1/Ks)";
+
+algorithm
+  der_Beta := -1/T^2*der_T;
+
+end derIsobaricExpansionCoefficient_derT;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/derSpecificEnthalpy_derT.mo b/ThermoSysPro/Properties/DryAirIdealGas/derSpecificEnthalpy_derT.mo
index 25690b49c98ec2723de8a7e9dc297951e4a96c01..ae2cd5f56405a7350e392bd371e1247e6d2a1144 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/derSpecificEnthalpy_derT.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/derSpecificEnthalpy_derT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function derSpecificEnthalpy_derT
-  "der(SpecificEnthalpy) computation for Dry Air Ideal Gas (inputs: T, der(T))"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.Temperature T "Temperature (K)";
-    input Real der_T "Temperature time derivative (K/s)";
-
-    output Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-
-protected
-    ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
-
-algorithm
-   // ideal gas: dh/dT = cp     ->  der_h = cp(T)*der_T
-   der_h := Data.specificGasConstant*(Data.alow[1]*T^(-2) + Data.alow[2]*T^(-1) + Data.alow[3] + Data.alow[4]*T + Data.alow[5]*T^(2) + Data.alow[6]*T^(3) + Data.alow[7]*T^(4))*der_T;
-
-end derSpecificEnthalpy_derT;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function derSpecificEnthalpy_derT
+  "der(SpecificEnthalpy) computation for Dry Air Ideal Gas (inputs: T, der(T))"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.Temperature T "Temperature (K)";
+    input Real der_T "Temperature time derivative (K/s)";
+
+    output Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+
+protected
+    ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data;
+
+algorithm
+   // ideal gas: dh/dT = cp     ->  der_h = cp(T)*der_T
+   der_h := Data.specificGasConstant*(Data.alow[1]*T^(-2) + Data.alow[2]*T^(-1) + Data.alow[3] + Data.alow[4]*T + Data.alow[5]*T^(2) + Data.alow[6]*T^(3) + Data.alow[7]*T^(4))*der_T;
+
+end derSpecificEnthalpy_derT;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/derTemperature_derh.mo b/ThermoSysPro/Properties/DryAirIdealGas/derTemperature_derh.mo
index df90c999ba420a35e8e71cb6c0291580dd971fe1..caccbca9e40b379427851389ea4fef2c62a10982 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/derTemperature_derh.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/derTemperature_derh.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function derTemperature_derh
-  "der(Temperature) computation for Dry Air Ideal Gas (inputs: h, der(h))"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-
-  output Real der_T "Fluid temperature time derivative (K/s)";
-
-protected
-  constant Real C[6] = {302.45170074922396, 0.0009955239553877519,-2.3667518904940937e-11,-1.6218505689880788e-16,1.5436079535175405e-22,-4.4309458281550505e-29};
-  //constants C[6] obtained from inverting SpecificEnthalpy_t (through polynomial fitting) it's not the exact inverse function!
-
-algorithm
-  der_T := (C[2] + 2*C[3]*h + 3*C[4]*h^2 + 4*C[5]*h^3 + 5*C[6]*h^4)*der_h;
-
-end derTemperature_derh;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function derTemperature_derh
+  "der(Temperature) computation for Dry Air Ideal Gas (inputs: h, der(h))"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+
+  output Real der_T "Fluid temperature time derivative (K/s)";
+
+protected
+  constant Real C[6] = {302.45170074922396, 0.0009955239553877519,-2.3667518904940937e-11,-1.6218505689880788e-16,1.5436079535175405e-22,-4.4309458281550505e-29};
+  //constants C[6] obtained from inverting SpecificEnthalpy_t (through polynomial fitting) it's not the exact inverse function!
+
+algorithm
+  der_T := (C[2] + 2*C[3]*h + 3*C[4]*h^2 + 4*C[5]*h^3 + 5*C[6]*h^4)*der_h;
+
+end derTemperature_derh;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/derThermalConductivity_derT_derrho.mo b/ThermoSysPro/Properties/DryAirIdealGas/derThermalConductivity_derT_derrho.mo
index f0f200a2cd575735700b1457656bb40bd3941f7d..18f09a1de21c718900ec35a2c54c8e45a242d931 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/derThermalConductivity_derT_derrho.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/derThermalConductivity_derT_derrho.mo
@@ -1,37 +1,37 @@
-within ThermoSysPro.Properties.DryAirIdealGas;
-function derThermalConductivity_derT_derrho
-  "der(Thermal Conductivity) computation for Dry Air Ideal Gas (inputs: T, rho, der(T), der(rho))"
-  // STEPHANIE Dry Air Ideal Gas
-
-  input Units.SI.Temperature T "Temperature (K)";
-  input Units.SI.Density rho "Density (kg/m3)";
-  input Real der_T "Temperature time derivative (K/s)";
-  input Real der_rho "Density time derivative (kg/m3/s)";
-
-  output Real der_k "thermal conductivity time derivative (W/m/K/s)";
-
-protected
-  constant Units.SI.Temperature tnorm=132.5 "critical temperature";
-  constant Units.SI.Density rhonorm=314.3 "critical density";
-    constant Real lambda = 25.9778e-3;
-    constant Real C1 = 0.239503;
-    constant Real C05 = 0.00649768;
-    constant Real C0 = 1;
-    constant Real C_1 = -1.92615;
-    constant Real C_2 = 2.00383;
-    constant Real C_3 = -1.07553;
-    constant Real C_4 = 0.229414;
-    constant Real D1 = 0.402287;
-    constant Real D2 = 0.356603;
-    constant Real D3 = -0.163159;
-    constant Real D4 = 0.138059;
-    constant Real D5 = -0.0201725;
-
-algorithm
-  // der_k = partial derivative of k with respect to T times der_T + partial derivative of k with respect to rho times der_rho
-  // der_k = derivative of diluteConductivity*lambda with respect to T times der_T + derivative of residualConductivity*lambda with respect to rho times der_rho
-
-    der_k := (lambda*(C1/tnorm + C05/(2*sqrt(T/tnorm)*tnorm) - (C_1*tnorm)/T^2 - (2*C_2*tnorm^2)/T^3 - (3*C_3*tnorm^3)/T^4 - (4*C_4*tnorm^4)/T^5))*der_T +
-             (lambda*((5*D5*rho^4)/rhonorm^5 + (4*D4*rho^3)/rhonorm^4 + (3*D3*rho^2)/rhonorm^3 + (2*D2*rho)/rhonorm^2 + D1/rhonorm))*der_rho;
-
-end derThermalConductivity_derT_derrho;
+within ThermoSysPro.Properties.DryAirIdealGas;
+function derThermalConductivity_derT_derrho
+  "der(Thermal Conductivity) computation for Dry Air Ideal Gas (inputs: T, rho, der(T), der(rho))"
+  // STEPHANIE Dry Air Ideal Gas
+
+  input Units.SI.Temperature T "Temperature (K)";
+  input Units.SI.Density rho "Density (kg/m3)";
+  input Real der_T "Temperature time derivative (K/s)";
+  input Real der_rho "Density time derivative (kg/m3/s)";
+
+  output Real der_k "thermal conductivity time derivative (W/m/K/s)";
+
+protected
+  constant Units.SI.Temperature tnorm=132.5 "critical temperature";
+  constant Units.SI.Density rhonorm=314.3 "critical density";
+    constant Real lambda = 25.9778e-3;
+    constant Real C1 = 0.239503;
+    constant Real C05 = 0.00649768;
+    constant Real C0 = 1;
+    constant Real C_1 = -1.92615;
+    constant Real C_2 = 2.00383;
+    constant Real C_3 = -1.07553;
+    constant Real C_4 = 0.229414;
+    constant Real D1 = 0.402287;
+    constant Real D2 = 0.356603;
+    constant Real D3 = -0.163159;
+    constant Real D4 = 0.138059;
+    constant Real D5 = -0.0201725;
+
+algorithm
+  // der_k = partial derivative of k with respect to T times der_T + partial derivative of k with respect to rho times der_rho
+  // der_k = derivative of diluteConductivity*lambda with respect to T times der_T + derivative of residualConductivity*lambda with respect to rho times der_rho
+
+    der_k := (lambda*(C1/tnorm + C05/(2*sqrt(T/tnorm)*tnorm) - (C_1*tnorm)/T^2 - (2*C_2*tnorm^2)/T^3 - (3*C_3*tnorm^3)/T^4 - (4*C_4*tnorm^4)/T^5))*der_T +
+             (lambda*((5*D5*rho^4)/rhonorm^5 + (4*D4*rho^3)/rhonorm^4 + (3*D3*rho^2)/rhonorm^3 + (2*D2*rho)/rhonorm^2 + D1/rhonorm))*der_rho;
+
+end derThermalConductivity_derT_derrho;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/package.mo b/ThermoSysPro/Properties/DryAirIdealGas/package.mo
index e12f33cd48ad813989768234c6aabfa9d9031cd1..60997b803f140a2bf03a808728de3fcfcdfe06e4 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/package.mo
+++ b/ThermoSysPro/Properties/DryAirIdealGas/package.mo
@@ -1,137 +1,137 @@
-within ThermoSysPro.Properties;
-package DryAirIdealGas "6 - Dry air ideal gas properties library"
-
-annotation (
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}),
-  Window(
-    x=0.45,
-    y=0.01,
-    width=0.44,
-    height=0.65,
-    library=1,
-    autolayout=1),
-  Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<p><b>ThermoSysPro Version 3.2</h4>
-</HTML>"));
-end DryAirIdealGas;
+within ThermoSysPro.Properties;
+package DryAirIdealGas "6 - Dry air ideal gas properties library"
+
+annotation (
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}),
+  Window(
+    x=0.45,
+    y=0.01,
+    width=0.44,
+    height=0.65,
+    library=1,
+    autolayout=1),
+  Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<p><b>ThermoSysPro Version 3.2</h4>
+</HTML>"));
+end DryAirIdealGas;
diff --git a/ThermoSysPro/Properties/DryAirIdealGas/package.order b/ThermoSysPro/Properties/DryAirIdealGas/package.order
index f1e2c077da460fd539c6c90e1c0051864b5d20cb..76ff9d4f757ca57b4ff42a243e0e082b7c09692c 100644
--- a/ThermoSysPro/Properties/DryAirIdealGas/package.order
+++ b/ThermoSysPro/Properties/DryAirIdealGas/package.order
@@ -1,15 +1,15 @@
-Density_PT
-derDensity_derP_derT
-derDynamicViscosity_derT_derrho
-derIsobaricExpansionCoefficient_derT
-derSpecificEnthalpy_derT
-derTemperature_derh
-derThermalConductivity_derT_derrho
-DryAirIdealGas
-DynamicViscosity_Trho
-IsobaricExpansionCoefficient_T
-SpecificEnthalpy_T
-SpecificHeatCp_derT
-SpecificHeatCp_T
-Temperature_h
-ThermalConductivity_Trho
+Density_PT
+derDensity_derP_derT
+derDynamicViscosity_derT_derrho
+derIsobaricExpansionCoefficient_derT
+derSpecificEnthalpy_derT
+derTemperature_derh
+derThermalConductivity_derT_derrho
+DryAirIdealGas
+DynamicViscosity_Trho
+IsobaricExpansionCoefficient_T
+SpecificEnthalpy_T
+SpecificHeatCp_derT
+SpecificHeatCp_T
+Temperature_h
+ThermalConductivity_Trho
diff --git a/ThermoSysPro/Properties/FlueGases/Absorb.mo b/ThermoSysPro/Properties/FlueGases/Absorb.mo
index deaed287966c33b2af89509879b96493d230ec93..a6cd3b5f65bbb74f1e12af618223886bfd14ea68 100644
--- a/ThermoSysPro/Properties/FlueGases/Absorb.mo
+++ b/ThermoSysPro/Properties/FlueGases/Absorb.mo
@@ -1,21 +1,21 @@
-within ThermoSysPro.Properties.FlueGases;
-function Absorb "Flue gases - particles emissivity"
-  extends ThermoSysPro.Properties.FlueGases.unsafeForJacobian;
-  input Units.SI.AbsolutePressure PC "CO2 partial pressure";
-  input Units.SI.AbsolutePressure PW "H2O partial pressure";
-  input Real FV "Volume concentration of the particules";
-  input Units.SI.Length L "Optical path";
-  input Units.SI.Temperature T "Temperature";
-  output Real EG " ";
-  output Real ES " ";
-  output Real emigaz "Gas emissivity";
-
-  external "FORTRAN" absorb(PC,PW,FV,L,T,EG,ES,emigaz);
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Absorb;
+within ThermoSysPro.Properties.FlueGases;
+function Absorb "Flue gases - particles emissivity"
+  extends ThermoSysPro.Properties.FlueGases.unsafeForJacobian;
+  input Units.SI.AbsolutePressure PC "CO2 partial pressure";
+  input Units.SI.AbsolutePressure PW "H2O partial pressure";
+  input Real FV "Volume concentration of the particules";
+  input Units.SI.Length L "Optical path";
+  input Units.SI.Temperature T "Temperature";
+  output Real EG " ";
+  output Real ES " ";
+  output Real emigaz "Gas emissivity";
+
+  external "FORTRAN" absorb(PC,PW,FV,L,T,EG,ES,emigaz);
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Absorb;
diff --git a/ThermoSysPro/Properties/FlueGases/EmissivGP.mo b/ThermoSysPro/Properties/FlueGases/EmissivGP.mo
index fd8fb607dda28b99b0f03fd2071abb3da6094663..ecdde14973e1d7169a0f64d013cc7a4396f332c6 100644
--- a/ThermoSysPro/Properties/FlueGases/EmissivGP.mo
+++ b/ThermoSysPro/Properties/FlueGases/EmissivGP.mo
@@ -1,28 +1,28 @@
-within ThermoSysPro.Properties.FlueGases;
-function EmissivGP "Flue gases - particles emissivity"
-  extends ThermoSysPro.Properties.FlueGases.unsafeForJacobian;
-  input Units.SI.Length AL "Equivalent length (radiation)";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Units.SI.Temperature TPE "Wall temperature";
-  input Units.SI.AbsolutePressure PMEL "Mixture pressure";
-  input Units.SI.AbsolutePressure PH2O "H2O partial pressure";
-  input Units.SI.AbsolutePressure PCO2 "PCO2 partial pressure";
-  input Real FV "Volume concentration of the particles in the flue gases";
-  input Units.SI.Length DP "Particles average diameter";
-  input Real EPSPAR "Wall emissivity";
-  output Real EPSFP "Particles/flue gases emissivity";
-
-external "FORTRAN" emg(AL, TMF, TPE, PMEL, PH2O, PCO2, FV, DP, EPSPAR, EPSFP);
-  annotation (             Window(
-      x=0.22,
-      y=0.22,
-      width=0.44,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end EmissivGP;
+within ThermoSysPro.Properties.FlueGases;
+function EmissivGP "Flue gases - particles emissivity"
+  extends ThermoSysPro.Properties.FlueGases.unsafeForJacobian;
+  input Units.SI.Length AL "Equivalent length (radiation)";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Units.SI.Temperature TPE "Wall temperature";
+  input Units.SI.AbsolutePressure PMEL "Mixture pressure";
+  input Units.SI.AbsolutePressure PH2O "H2O partial pressure";
+  input Units.SI.AbsolutePressure PCO2 "PCO2 partial pressure";
+  input Real FV "Volume concentration of the particles in the flue gases";
+  input Units.SI.Length DP "Particles average diameter";
+  input Real EPSPAR "Wall emissivity";
+  output Real EPSFP "Particles/flue gases emissivity";
+
+external "FORTRAN" emg(AL, TMF, TPE, PMEL, PH2O, PCO2, FV, DP, EPSPAR, EPSFP);
+  annotation (             Window(
+      x=0.22,
+      y=0.22,
+      width=0.44,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end EmissivGP;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_Absorb.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_Absorb.mo
index 91cf3e22dccc02019fd4e8c6a819a8ae896451c3..8da1e8928e917ac4967d3b37d5d547880485dcc9 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_Absorb.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_Absorb.mo
@@ -1,25 +1,25 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_Absorb "Flue gases - particles emissivity"
-  extends ThermoSysPro.Properties.FlueGases.unsafeForJacobian;
-  input Units.SI.AbsolutePressure PC "CO2 partial pressure";
-  input Units.SI.AbsolutePressure PW "H2O partial pressure";
-  input Real FV "Volume concentration of the particles in the flue gases";
-  input Units.SI.Length L "Optical path";
-  input Units.SI.Temperature T "Temperature";
-
-  output Real EG " ";
-  output Real ES " ";
-  output Real emigaz "Flue gases - particles emissivity";
-
-algorithm
-  (EG,ES,emigaz) := ThermoSysPro.Properties.FlueGases.Absorb(PC*1e-5, PW*1e-5, FV, L, T);
-
-  annotation (smoothOrder=2,Icon(graphics),
-              Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_Absorb;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_Absorb "Flue gases - particles emissivity"
+  extends ThermoSysPro.Properties.FlueGases.unsafeForJacobian;
+  input Units.SI.AbsolutePressure PC "CO2 partial pressure";
+  input Units.SI.AbsolutePressure PW "H2O partial pressure";
+  input Real FV "Volume concentration of the particles in the flue gases";
+  input Units.SI.Length L "Optical path";
+  input Units.SI.Temperature T "Temperature";
+
+  output Real EG " ";
+  output Real ES " ";
+  output Real emigaz "Flue gases - particles emissivity";
+
+algorithm
+  (EG,ES,emigaz) := ThermoSysPro.Properties.FlueGases.Absorb(PC*1e-5, PW*1e-5, FV, L, T);
+
+  annotation (smoothOrder=2,Icon(graphics),
+              Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_Absorb;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_T.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_T.mo
index a7a01b5f724bcc9e46feb235a89ccc4c45b68833..e7f0ddc92b756977dd921d5c2e9aff46b44a215e 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_T.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_T.mo
@@ -1,42 +1,42 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_T "Temperature"
-  //extends ThermoSysPro.Properties.FlueGases.unSafeForJacobian;
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.SpecificEnthalpy HMF "Flue gases specific enthalpy";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.Temperature T "Temperature";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state0;
-  Units.SI.SpecificEnthalpy H0
-    "Flue gases specific enthalpy at the reference state";
-  Real Xn2 "N2 mass fraction";
-  constant Real Hlat=2501.5999019e3 "Phase transition energy";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the reference thermodynamic state */
-  state0 :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(0.006112*1e5, 273.16, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-  H0 := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0);
-
-  /* Computation of the thermodynamic state */
-  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_phX(PMF, HMF + H0 - Xh2o*Hlat, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the temperature */
-  T := ThermoSysPro.Properties.ModelicaMediaFlueGases.temperature(state);
-
-  annotation (Icon(graphics),
-                    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_T;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_T "Temperature"
+  //extends ThermoSysPro.Properties.FlueGases.unSafeForJacobian;
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.SpecificEnthalpy HMF "Flue gases specific enthalpy";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.Temperature T "Temperature";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state0;
+  Units.SI.SpecificEnthalpy H0
+    "Flue gases specific enthalpy at the reference state";
+  Real Xn2 "N2 mass fraction";
+  constant Real Hlat=2501.5999019e3 "Phase transition energy";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the reference thermodynamic state */
+  state0 :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(0.006112*1e5, 273.16, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+  H0 := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0);
+
+  /* Computation of the thermodynamic state */
+  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_phX(PMF, HMF + H0 - Xh2o*Hlat, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the temperature */
+  T := ThermoSysPro.Properties.ModelicaMediaFlueGases.temperature(state);
+
+  annotation (Icon(graphics),
+                    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_T;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_Xtot.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_Xtot.mo
index bcab1a160e32205ccf2b3195fa6839f2598942d8..afe35d7534d3ce684c63fc0bf18d18230c6c54cc 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_Xtot.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_Xtot.mo
@@ -1,48 +1,48 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_Xtot "Density"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Real Xtot "Total molar Mass";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  Real Xn2 "N2 mass fraction";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-  // state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-  state.p := PMF;
-  state.T := TMF;
-  state.X := {Xn2,Xo2,Xh2o,Xco2,Xso2};
-
-  /* Computation of the Total molar mass of mixture */
-  Xtot := ThermoSysPro.Properties.ModelicaMediaFlueGases.molarMass(state);
-
-  annotation (smoothOrder=2,  Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_Xtot;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_Xtot "Density"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Real Xtot "Total molar Mass";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  Real Xn2 "N2 mass fraction";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+  // state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+  state.p := PMF;
+  state.T := TMF;
+  state.X := {Xn2,Xo2,Xh2o,Xco2,Xso2};
+
+  /* Computation of the Total molar mass of mixture */
+  Xtot := ThermoSysPro.Properties.ModelicaMediaFlueGases.molarMass(state);
+
+  annotation (smoothOrder=2,  Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_Xtot;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_a.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_a.mo
index f3ef8b32945b156960b1ae47cc83f74c5283ca83..28a9ec53a76e37c7204140d67fee7f5bf80c0b03 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_a.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_a.mo
@@ -1,48 +1,48 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_a "Velocity of sound"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.Velocity a "Velocity of sound";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  Real Xn2 "N2 mass fraction";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-  state.p :=PMF;
-  state.T :=TMF;
-  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
-//  state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the velocity of sound */
-  a := ThermoSysPro.Properties.ModelicaMediaFlueGases.velocityOfSound(state);
-
-  annotation (smoothOrder=2,Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_a;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_a "Velocity of sound"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.Velocity a "Velocity of sound";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  Real Xn2 "N2 mass fraction";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+  state.p :=PMF;
+  state.T :=TMF;
+  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
+//  state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the velocity of sound */
+  a := ThermoSysPro.Properties.ModelicaMediaFlueGases.velocityOfSound(state);
+
+  annotation (smoothOrder=2,Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_a;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_cp.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_cp.mo
index a99dfa1e8a55a30163480fc1ca54a962ea4bd6f3..9ddb7b33a09ef7c50ac6da3670e845b31739408a 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_cp.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_cp.mo
@@ -1,48 +1,48 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_cp "Specific heat capacity"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  Real Xn2 "N2 mass fraction";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-  state.p :=PMF;
-  state.T :=TMF;
-  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
-//  state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the specific heat capacity */
-  cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state);
-
-  annotation (smoothOrder=2,Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_cp;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_cp "Specific heat capacity"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  Real Xn2 "N2 mass fraction";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+  state.p :=PMF;
+  state.T :=TMF;
+  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
+//  state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the specific heat capacity */
+  cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state);
+
+  annotation (smoothOrder=2,Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_cp;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_cv.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_cv.mo
index 6009067b9cfa1a093d85d96a004f2dd4271d1db1..a4d6403391838bbbac0f91c28cf9ae3ba6b5e073 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_cv.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_cv.mo
@@ -1,43 +1,43 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_cv "Specific heat capacity at constant volume"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.SpecificHeatCapacity cv
-    "Specific heat capacity at constant volume";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-algorithm
-  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(
-    PMF,
-    TMF,
-    {1 - (Xo2 + Xh2o + Xco2 + Xso2),Xo2,Xh2o,Xco2,Xso2});
-  cv :=ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCv(
-    state);
-
-  annotation (smoothOrder=2,Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_cv;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_cv "Specific heat capacity at constant volume"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.SpecificHeatCapacity cv
+    "Specific heat capacity at constant volume";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+algorithm
+  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(
+    PMF,
+    TMF,
+    {1 - (Xo2 + Xh2o + Xco2 + Xso2),Xo2,Xh2o,Xco2,Xso2});
+  cv :=ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCv(
+    state);
+
+  annotation (smoothOrder=2,Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_cv;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_drhodh.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_drhodh.mo
index b07592feafdadf092dea2436a769b48f34908271..e0d3a2c92d7b7bfacee99741b527684e900cc7a6 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_drhodh.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_drhodh.mo
@@ -1,44 +1,44 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_drhodh
-  "Derivative of the density wrt. the specific enthalpy at constant pressure"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.DerDensityByEnthalpy drhodh
-    "Derivative of the density wrt. the specific enthalpy at constant pressure";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  Units.SI.SpecificEntropy s "Flue gases specific entropy";
-  Units.SI.Density rho "Flue gaases density";
-  Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
-  Units.SI.SpecificHeatCapacity R "gas constant";
-
-  Real Xn2 "N2 mass fraction";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-  state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-  s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state);
-  rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state);
-  cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state);
-  R := ThermoSysPro.Properties.ModelicaMediaFlueGases.gasConstant(state);
-
-  drhodh := -rho*rho*R/(PMF*cp);
-
-  annotation (
-    smoothOrder=2,
-    Icon(graphics),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</html>"));
-end FlueGases_drhodh;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_drhodh
+  "Derivative of the density wrt. the specific enthalpy at constant pressure"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.DerDensityByEnthalpy drhodh
+    "Derivative of the density wrt. the specific enthalpy at constant pressure";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  Units.SI.SpecificEntropy s "Flue gases specific entropy";
+  Units.SI.Density rho "Flue gaases density";
+  Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
+  Units.SI.SpecificHeatCapacity R "gas constant";
+
+  Real Xn2 "N2 mass fraction";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+  state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+  s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state);
+  rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state);
+  cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state);
+  R := ThermoSysPro.Properties.ModelicaMediaFlueGases.gasConstant(state);
+
+  drhodh := -rho*rho*R/(PMF*cp);
+
+  annotation (
+    smoothOrder=2,
+    Icon(graphics),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</html>"));
+end FlueGases_drhodh;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_drhodp.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_drhodp.mo
index 98c73f61cc8f613ba53f1c288e515cd64f4968cd..251066f4820cb5de45ffd1c1a156b5c6f27f379a 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_drhodp.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_drhodp.mo
@@ -1,45 +1,45 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_drhodp
-  "Derivative of the density wrt. the pressure at constant specific enthalpy"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.DerDensityByPressure drhodp
-    "Derivative of the density wrt. the pressure at constant specific enthalpy";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  Units.SI.SpecificEntropy s "Flue gases specific entropy";
-  Units.SI.Density rho "Flue gaases density";
-  Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
-  Units.SI.SpecificHeatCapacity R "gas constant";
-
-  Real Xn2 "N2 mass fraction";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-  state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-  s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state);
-  rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state);
-  cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state);
-  R := ThermoSysPro.Properties.ModelicaMediaFlueGases.gasConstant(state);
-
-  drhodp := (rho*rho*R)/(PMF*cp)*(1/rho + TMF/PMF*(cp - R));
-
-  annotation (
-    smoothOrder=2,
-    Icon(graphics),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-</html>"));
-end FlueGases_drhodp;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_drhodp
+  "Derivative of the density wrt. the pressure at constant specific enthalpy"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.DerDensityByPressure drhodp
+    "Derivative of the density wrt. the pressure at constant specific enthalpy";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  Units.SI.SpecificEntropy s "Flue gases specific entropy";
+  Units.SI.Density rho "Flue gaases density";
+  Units.SI.SpecificHeatCapacity cp "Specific heat capacity";
+  Units.SI.SpecificHeatCapacity R "gas constant";
+
+  Real Xn2 "N2 mass fraction";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+  state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+  s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state);
+  rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state);
+  cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state);
+  R := ThermoSysPro.Properties.ModelicaMediaFlueGases.gasConstant(state);
+
+  drhodp := (rho*rho*R)/(PMF*cp)*(1/rho + TMF/PMF*(cp - R));
+
+  annotation (
+    smoothOrder=2,
+    Icon(graphics),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+</html>"));
+end FlueGases_drhodp;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_h.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_h.mo
index fdca028c4fb0b1120a1cdf1a5d5e7474e6337784..cda27bbbd5ef5eec7864ee44a21ec61a7294eb53 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_h.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_h.mo
@@ -1,57 +1,57 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_h "Specific enthalpy"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state0;
-  Real Xn2 "N2 mass fraction";
-  constant Real Hlat=2501.5999019e3 "Phase transition energy";
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-  state.p :=PMF;
-  state.T :=TMF;
-  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
-  //state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the reference thermodynamic state */
-  state0.p :=0.006112*1e5;
-  state0.T :=273.16;
-  state0.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
-  //state0 := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(0.006112*1e5, 273.16, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the specific enthalpy minus a reference at (0.006112 bars, 0.01°C) */
-  h := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state)
-       - ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0) + Xh2o*Hlat;
-
-  annotation (smoothOrder=2,  Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"),           extent=[-80,60; -60,80],
-    Placement(transformation(extent={{-80,60},{-60,80}}, rotation=0)));
-end FlueGases_h;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_h "Specific enthalpy"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state0;
+  Real Xn2 "N2 mass fraction";
+  constant Real Hlat=2501.5999019e3 "Phase transition energy";
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+  state.p :=PMF;
+  state.T :=TMF;
+  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
+  //state := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the reference thermodynamic state */
+  state0.p :=0.006112*1e5;
+  state0.T :=273.16;
+  state0.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
+  //state0 := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(0.006112*1e5, 273.16, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the specific enthalpy minus a reference at (0.006112 bars, 0.01°C) */
+  h := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state)
+       - ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0) + Xh2o*Hlat;
+
+  annotation (smoothOrder=2,  Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"),           extent=[-80,60; -60,80],
+    Placement(transformation(extent={{-80,60},{-60,80}}, rotation=0)));
+end FlueGases_h;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_h_Ps.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_h_Ps.mo
index 2923ba1828dd7bcdd9f22cbb9deb51fd1cb5c11e..e158123d9ff38ae0d172903394550aadaae7dabc 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_h_Ps.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_h_Ps.mo
@@ -1,47 +1,47 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_h_Ps "Specific enthalpy"
-  //extends ThermoSysPro.Properties.FlueGases.unSafeForJacobian;
-
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.SpecificEntropy SMF "Flue gases average specific entropy";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state0;
-  Units.SI.SpecificEntropy S0;
-  Real Xn2 "N2 mass fraction";
-  constant Real Hlat=2501.5999019e3 "Phase transition energy";
-  constant Real Slat=9.157461e3 "Phase transition entropy";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the reference thermodynamic state */
-  state0.p :=0.006112*1e5;
-  state0.T :=273.16;
-  state0.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
-//  state0 := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(0.006112*1e5, 273.16, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-  S0 :=ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state0);
-
-  /* Computation of the thermodynamic state */
-  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_psX(PMF, SMF + S0 - Xh2o*Slat, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the specific enthalpy minus a reference at (0.006112 bars, 0.01°C) */
-  h := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state)
-       -ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0) + Xh2o*Hlat;
-
-  annotation (smoothOrder=2,Icon(graphics),
-              Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_h_Ps;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_h_Ps "Specific enthalpy"
+  //extends ThermoSysPro.Properties.FlueGases.unSafeForJacobian;
+
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.SpecificEntropy SMF "Flue gases average specific entropy";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state0;
+  Units.SI.SpecificEntropy S0;
+  Real Xn2 "N2 mass fraction";
+  constant Real Hlat=2501.5999019e3 "Phase transition energy";
+  constant Real Slat=9.157461e3 "Phase transition entropy";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the reference thermodynamic state */
+  state0.p :=0.006112*1e5;
+  state0.T :=273.16;
+  state0.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
+//  state0 := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(0.006112*1e5, 273.16, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+  S0 :=ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state0);
+
+  /* Computation of the thermodynamic state */
+  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_psX(PMF, SMF + S0 - Xh2o*Slat, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the specific enthalpy minus a reference at (0.006112 bars, 0.01°C) */
+  h := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state)
+       -ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0) + Xh2o*Hlat;
+
+  annotation (smoothOrder=2,Icon(graphics),
+              Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_h_Ps;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_k.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_k.mo
index 6641003235a564d17388c545dd7521a9117439bc..efc81114986697365f2dd7dbaab30034f3421a53 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_k.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_k.mo
@@ -1,48 +1,48 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_k "Thermal conductivity"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.ThermalConductivity k "Thermal conductivity";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  Real Xn2 "N2 mass fraction";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-  state.p :=PMF;
-  state.T :=TMF;
-  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
-//  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the thermal conductivity */
-  k := ThermoSysPro.Properties.ModelicaMediaFlueGases.thermalConductivity(state);
-
-  annotation (smoothOrder=2,Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_k;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_k "Thermal conductivity"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.ThermalConductivity k "Thermal conductivity";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  Real Xn2 "N2 mass fraction";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+  state.p :=PMF;
+  state.T :=TMF;
+  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
+//  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the thermal conductivity */
+  k := ThermoSysPro.Properties.ModelicaMediaFlueGases.thermalConductivity(state);
+
+  annotation (smoothOrder=2,Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_k;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_mu.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_mu.mo
index d827f30fe6191381b34075190970d845893d92ea..f6e33885a33f524ea956010eb720be4bd3219fdd 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_mu.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_mu.mo
@@ -1,48 +1,48 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_mu "Dynamic viscosity"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  Real Xn2 "N2 mass fraction";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-  state.p :=PMF;
-  state.T :=TMF;
-  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
-//  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the dynamic viscosity */
-  mu := ThermoSysPro.Properties.ModelicaMediaFlueGases.dynamicViscosity(state);
-
-  annotation (smoothOrder=2,Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_mu;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_mu "Dynamic viscosity"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  Real Xn2 "N2 mass fraction";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+  state.p :=PMF;
+  state.T :=TMF;
+  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
+//  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the dynamic viscosity */
+  mu := ThermoSysPro.Properties.ModelicaMediaFlueGases.dynamicViscosity(state);
+
+  annotation (smoothOrder=2,Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_mu;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_rho.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_rho.mo
index 33eba1946acc4725fcab5ac7b8df4cc7015829a3..3f52d863866ac22963919b89642fc31a3e16f6d4 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_rho.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_rho.mo
@@ -1,49 +1,49 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_rho "Density"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.Density rho "Density";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  Real Xn2 "N2 mass fraction";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-//  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-  state.p := PMF;
-  state.T := TMF;
-  state.X := {Xn2,Xo2,Xh2o,Xco2,Xso2};
-
-  /* Computation of the density */
-  //rho := state.p/((state.X*ThermoSysPro.Properties.ModelicaMediaFlueGases.data.R)*state.T);
-  rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state)
-  annotation (smoothOrder=2,  Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-
-end FlueGases_rho;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_rho "Density"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.Density rho "Density";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  Real Xn2 "N2 mass fraction";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+//  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+  state.p := PMF;
+  state.T := TMF;
+  state.X := {Xn2,Xo2,Xh2o,Xco2,Xso2};
+
+  /* Computation of the density */
+  //rho := state.p/((state.X*ThermoSysPro.Properties.ModelicaMediaFlueGases.data.R)*state.T);
+  rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state)
+  annotation (smoothOrder=2,  Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+
+end FlueGases_rho;
diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_s.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_s.mo
index 0ed5c886b340422d7dc398a5a865bea2537af467..fa163537359bc2ee585215ca27eafa1012d89175 100644
--- a/ThermoSysPro/Properties/FlueGases/FlueGases_s.mo
+++ b/ThermoSysPro/Properties/FlueGases/FlueGases_s.mo
@@ -1,57 +1,57 @@
-within ThermoSysPro.Properties.FlueGases;
-function FlueGases_s "Specific entropy"
-  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
-  input Units.SI.Temperature TMF "Flue gases average temperature";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.SpecificEntropy s "Specific entropy";
-
-protected
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
-  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state0;
-  Real Xn2 "N2 mass fraction";
-  constant Real Slat=9.157461e3 "Phase transition entropy";
-
-algorithm
-  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
-
-  /* Computation of the thermodynamic state */
-  state.p :=PMF;
-  state.T :=TMF;
-  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
-//  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the reference thermodynamic state */
-  state0.p :=0.006112*1e5;
-  state0.T :=273.16;
-  state0.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
-//  state0 := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(0.006112*1e5, 273.16, {Xn2,Xo2,Xh2o,Xco2,Xso2});
-
-  /* Computation of the specific entropy minus a reference at (0.006112 bars, 0.01°C) */
-  s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state)
-       -ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state0) + Xh2o*Slat;
-
-  annotation (smoothOrder=2,Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end FlueGases_s;
+within ThermoSysPro.Properties.FlueGases;
+function FlueGases_s "Specific entropy"
+  input Units.SI.AbsolutePressure PMF "Flue gases average pressure";
+  input Units.SI.Temperature TMF "Flue gases average temperature";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.SpecificEntropy s "Specific entropy";
+
+protected
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state;
+  ThermoSysPro.Properties.ModelicaMediaFlueGases.ThermodynamicState state0;
+  Real Xn2 "N2 mass fraction";
+  constant Real Slat=9.157461e3 "Phase transition entropy";
+
+algorithm
+  Xn2 := 1 - Xco2 - Xh2o - Xo2 - Xso2;
+
+  /* Computation of the thermodynamic state */
+  state.p :=PMF;
+  state.T :=TMF;
+  state.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
+//  state :=ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(PMF, TMF, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the reference thermodynamic state */
+  state0.p :=0.006112*1e5;
+  state0.T :=273.16;
+  state0.X :={Xn2,Xo2,Xh2o,Xco2,Xso2};
+//  state0 := ThermoSysPro.Properties.ModelicaMediaFlueGases.setState_pTX(0.006112*1e5, 273.16, {Xn2,Xo2,Xh2o,Xco2,Xso2});
+
+  /* Computation of the specific entropy minus a reference at (0.006112 bars, 0.01°C) */
+  s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state)
+       -ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state0) + Xh2o*Slat;
+
+  annotation (smoothOrder=2,Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end FlueGases_s;
diff --git a/ThermoSysPro/Properties/FlueGases/XSat.mo b/ThermoSysPro/Properties/FlueGases/XSat.mo
index 9df0c518126b75d9bf5ae392a66fcc3a120e3c92..fdb72bcf3983cc912be8de6557e6d2ad7551d1c8 100644
--- a/ThermoSysPro/Properties/FlueGases/XSat.mo
+++ b/ThermoSysPro/Properties/FlueGases/XSat.mo
@@ -1,73 +1,73 @@
-within ThermoSysPro.Properties.FlueGases;
-function XSat
-//---------------------------------------------------------------------------
-// Fonction  de l'humidité absolue a saturation xs(T)
-// Tair en °K, attention formule avec T en °C
-//---------------------------------------------------------------------------
-  input Units.SI.Temperature Tair "Air temperature";
-  input Units.SI.AbsolutePressure Patm "Atmospheric pressure";
-
-public
-  output Real xs "Humidity at the saturation point";
-
-protected
-  Real Ps;
-  Real Ps0;
-  Real TT;
-  ThermoSysPro.Units.nonSI.Temperature_degC T "Air temperature in Celsius";
-algorithm
-  T := Tair - 273.16;
-
-  if (T < -20) then
-    xs :=0;
-  end if;
-
-  if ((T >= -20) and (T <= 0)) then
-    Ps := Modelica.Math.exp(6.4147+(22.376*T)/(271.68+T));
-    xs := 0.622*Ps / (Patm-Ps);
-  end if;
-
-  if ((T > 0) and (T <= 40)) then
-   Ps := Modelica.Math.exp(6.4147+(17.438*T)/(239.78+T));
-   xs := 0.622*Ps / (Patm-Ps);
-  end if;
-
-  if ((40 < T) and (T < 90)) then
-   TT := T/273.16;
-   Ps0 := 0.78614
-            + 10.7954*TT/(1+TT)
-            - 5.028*Modelica.Math.log10(1+TT)
-            + 1.50475e-5*(1.-1./(10^(8.2969*TT))
-            +  0.00042873*(10^(4.76955*TT/(1.+TT)))-1.);
-   Ps :=(10^Ps0)*100.;
-   xs := 0.622*Ps / (Patm-Ps);
-  end if;
-
-  if (T >= 90) then
-   xs := 0.5 + 0.001*T;
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-    Documentation(info="<html>
-<p>Problem: discontinuous function. Should be replaced by a continuous one. </p>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end XSat;
+within ThermoSysPro.Properties.FlueGases;
+function XSat
+//---------------------------------------------------------------------------
+// Fonction  de l'humidité absolue a saturation xs(T)
+// Tair en °K, attention formule avec T en °C
+//---------------------------------------------------------------------------
+  input Units.SI.Temperature Tair "Air temperature";
+  input Units.SI.AbsolutePressure Patm "Atmospheric pressure";
+
+public
+  output Real xs "Humidity at the saturation point";
+
+protected
+  Real Ps;
+  Real Ps0;
+  Real TT;
+  ThermoSysPro.Units.nonSI.Temperature_degC T "Air temperature in Celsius";
+algorithm
+  T := Tair - 273.16;
+
+  if (T < -20) then
+    xs :=0;
+  end if;
+
+  if ((T >= -20) and (T <= 0)) then
+    Ps := Modelica.Math.exp(6.4147+(22.376*T)/(271.68+T));
+    xs := 0.622*Ps / (Patm-Ps);
+  end if;
+
+  if ((T > 0) and (T <= 40)) then
+   Ps := Modelica.Math.exp(6.4147+(17.438*T)/(239.78+T));
+   xs := 0.622*Ps / (Patm-Ps);
+  end if;
+
+  if ((40 < T) and (T < 90)) then
+   TT := T/273.16;
+   Ps0 := 0.78614
+            + 10.7954*TT/(1+TT)
+            - 5.028*Modelica.Math.log10(1+TT)
+            + 1.50475e-5*(1.-1./(10^(8.2969*TT))
+            +  0.00042873*(10^(4.76955*TT/(1.+TT)))-1.);
+   Ps :=(10^Ps0)*100.;
+   xs := 0.622*Ps / (Patm-Ps);
+  end if;
+
+  if (T >= 90) then
+   xs := 0.5 + 0.001*T;
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+    Documentation(info="<html>
+<p>Problem: discontinuous function. Should be replaced by a continuous one. </p>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end XSat;
diff --git a/ThermoSysPro/Properties/FlueGases/package.mo b/ThermoSysPro/Properties/FlueGases/package.mo
index df6cac1a2025b21833a6175ce17f07760d5ad406..0fd6cc264c702e063261cb26179b3777d5cb6709 100644
--- a/ThermoSysPro/Properties/FlueGases/package.mo
+++ b/ThermoSysPro/Properties/FlueGases/package.mo
@@ -1,139 +1,139 @@
-within ThermoSysPro.Properties;
-package FlueGases "3 - Flue gases properties library"
-
-
-
-annotation (
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Window(
-    x=0.45,
-    y=0.01,
-    width=0.44,
-    height=0.65,
-    library=1,
-    autolayout=1),
-  Documentation(info="<html>
-<p><b>ThermoSysPro Version 3.2</b></h4>
-</html>"));
-end FlueGases;
+within ThermoSysPro.Properties;
+package FlueGases "3 - Flue gases properties library"
+
+
+
+annotation (
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Window(
+    x=0.45,
+    y=0.01,
+    width=0.44,
+    height=0.65,
+    library=1,
+    autolayout=1),
+  Documentation(info="<html>
+<p><b>ThermoSysPro Version 3.2</b></h4>
+</html>"));
+end FlueGases;
diff --git a/ThermoSysPro/Properties/FlueGases/package.order b/ThermoSysPro/Properties/FlueGases/package.order
index 12e6f7b457fd4abcfc3108cfbc0fad07521b2916..13a216999ee6eca3740be567100421e4ceab6012 100644
--- a/ThermoSysPro/Properties/FlueGases/package.order
+++ b/ThermoSysPro/Properties/FlueGases/package.order
@@ -1,18 +1,18 @@
-Absorb
-EmissivGP
-FlueGases_a
-FlueGases_Absorb
-FlueGases_cp
-FlueGases_cv
-FlueGases_drhodh
-FlueGases_drhodp
-FlueGases_h
-FlueGases_h_Ps
-FlueGases_k
-FlueGases_mu
-FlueGases_rho
-FlueGases_s
-FlueGases_T
-FlueGases_Xtot
-unsafeForJacobian
-XSat
+Absorb
+EmissivGP
+FlueGases_a
+FlueGases_Absorb
+FlueGases_cp
+FlueGases_cv
+FlueGases_drhodh
+FlueGases_drhodp
+FlueGases_h
+FlueGases_h_Ps
+FlueGases_k
+FlueGases_mu
+FlueGases_rho
+FlueGases_s
+FlueGases_T
+FlueGases_Xtot
+unsafeForJacobian
+XSat
diff --git a/ThermoSysPro/Properties/FlueGases/unsafeForJacobian.mo b/ThermoSysPro/Properties/FlueGases/unsafeForJacobian.mo
index f4188f36e4da5a44186f676f073dc413f4ed118a..519cb9085a9f697243cdbfe87732fd5b5406b13d 100644
--- a/ThermoSysPro/Properties/FlueGases/unsafeForJacobian.mo
+++ b/ThermoSysPro/Properties/FlueGases/unsafeForJacobian.mo
@@ -1,6 +1,6 @@
-within ThermoSysPro.Properties.FlueGases;
-partial function unsafeForJacobian
-  "Icon to mark functions that may not be used if analytic Jacobians are desired"
-extends Modelica.Icons.Function;
-  annotation (Icon(graphics));
-end unsafeForJacobian;
+within ThermoSysPro.Properties.FlueGases;
+partial function unsafeForJacobian
+  "Icon to mark functions that may not be used if analytic Jacobians are desired"
+extends Modelica.Icons.Function;
+  annotation (Icon(graphics));
+end unsafeForJacobian;
diff --git a/ThermoSysPro/Properties/Fluid/Density_Ph.mo b/ThermoSysPro/Properties/Fluid/Density_Ph.mo
index 473054aa7ad6e9e8a91a8234602fbc16a0cf31f4..b2b77157c079dcfc5d25c9649ee61b291301b4cd 100644
--- a/ThermoSysPro/Properties/Fluid/Density_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/Density_Ph.mo
@@ -1,82 +1,82 @@
-within ThermoSysPro.Properties.Fluid;
-function Density_Ph "Density computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.Density rho "Density (kg/m3)";
-
-// fluid==1 - Water/Steam
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    rho:=pro.d;
-
-  // C3H3F5
-  elseif fluid==2 then
-    pro := ThermoSysPro.Properties.Fluid.Ph(P, h, mode,fluid);
-    rho := pro.d;
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    rho := ThermoSysPro.Properties.FlueGases.FlueGases_rho(
-      PMF=P,
-      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-        PMF=P,
-        HMF=h,
-        Xco2=Xco2,
-        Xh2o=Xh2o,
-        Xo2=Xo2,
-        Xso2=Xso2),
-      Xco2=Xco2,
-      Xh2o=Xh2o,
-      Xo2=Xo2,
-      Xso2=Xso2);
-
-  // MoltenSalt
-  elseif fluid==4 then
-    rho := ThermoSysPro.Properties.MoltenSalt.Density_T(T=
-      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-
-  // Oil
-  elseif fluid==5 then
-    rho := ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(temp=
-      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    rho := ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P,
-      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h));
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-      P,
-      h,
-      mode);
-    rho:=pro.d;
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-  //LogVariable(P);
-
-  annotation(derivative=derDensity_derP_derh);
-end Density_Ph;
+within ThermoSysPro.Properties.Fluid;
+function Density_Ph "Density computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.Density rho "Density (kg/m3)";
+
+// fluid==1 - Water/Steam
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    rho:=pro.d;
+
+  // C3H3F5
+  elseif fluid==2 then
+    pro := ThermoSysPro.Properties.Fluid.Ph(P, h, mode,fluid);
+    rho := pro.d;
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    rho := ThermoSysPro.Properties.FlueGases.FlueGases_rho(
+      PMF=P,
+      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+        PMF=P,
+        HMF=h,
+        Xco2=Xco2,
+        Xh2o=Xh2o,
+        Xo2=Xo2,
+        Xso2=Xso2),
+      Xco2=Xco2,
+      Xh2o=Xh2o,
+      Xo2=Xo2,
+      Xso2=Xso2);
+
+  // MoltenSalt
+  elseif fluid==4 then
+    rho := ThermoSysPro.Properties.MoltenSalt.Density_T(T=
+      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+
+  // Oil
+  elseif fluid==5 then
+    rho := ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(temp=
+      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    rho := ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P,
+      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h));
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+      P,
+      h,
+      mode);
+    rho:=pro.d;
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+  //LogVariable(P);
+
+  annotation(derivative=derDensity_derP_derh);
+end Density_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/Density_derh_Ph.mo b/ThermoSysPro/Properties/Fluid/Density_derh_Ph.mo
index 2f345683292947ef9de532980136ac99d43b7912..11771944b68f6fbe10b1b030fcdb9b6428e38d4f 100644
--- a/ThermoSysPro/Properties/Fluid/Density_derh_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/Density_derh_Ph.mo
@@ -1,96 +1,96 @@
-within ThermoSysPro.Properties.Fluid;
-function Density_derh_Ph
-  "Density derivative w.r.t enthalpy computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy";
-
-// fluid==1 - Water/Steam
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-protected
-  Units.SI.SpecificEnthalpy delta_h=0.01*h;
-
-///annotation(derivative=derDensity_derh_derP_derh);
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    ddhp:=pro.ddhp;
-
-  // C3H3F5
-  elseif fluid==2 then
-    // u := ThermoSysPro.Properties.C3H3F5.SpecificInternalEnergy_Ph__NonFonctionnel(
-    //   P=P, h=h);
-    ddhp := -1e6;
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    ddhp := ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(
-      PMF=P,
-      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-        PMF=P,
-        HMF=h,
-        Xco2=Xco2,
-        Xh2o=Xh2o,
-        Xo2=Xo2,
-        Xso2=Xso2),
-      Xco2=Xco2,
-      Xh2o=Xh2o,
-      Xo2=Xo2,
-      Xso2=Xso2);
-
-   //ddhp := -1e6;
-
-  // MoltenSalt
-  elseif fluid==4 then
-    //ddhp := -1e6;
-    // u := ThermoSysPro.Properties.MoltenSalt.SpecificInternalEnergy_T__NonFonctionnel(
-    //   T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-    ddhp := (ThermoSysPro.Properties.MoltenSalt.Density_T(T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h+delta_h))
-        -ThermoSysPro.Properties.MoltenSalt.Density_T(T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h-delta_h)))
-      /(2*delta_h);
-//  //
-
-  // Oil
-  elseif fluid==5 then
-//   ddhp := -1e2;
-   ddhp := (ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h+delta_h))
-        -ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h-delta_h)))
-      /(2*delta_h);
-//  //
-  // DryAirIdealGas
-  elseif fluid==6 then
-    ddhp := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h+delta_h))
-        -ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h-delta_h)))
-      /(2*delta_h);
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-      P,
-      h,
-      mode);
-    ddhp:=pro.ddhp;
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end Density_derh_Ph;
+within ThermoSysPro.Properties.Fluid;
+function Density_derh_Ph
+  "Density derivative w.r.t enthalpy computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy";
+
+// fluid==1 - Water/Steam
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+protected
+  Units.SI.SpecificEnthalpy delta_h=0.01*h;
+
+///annotation(derivative=derDensity_derh_derP_derh);
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    ddhp:=pro.ddhp;
+
+  // C3H3F5
+  elseif fluid==2 then
+    // u := ThermoSysPro.Properties.C3H3F5.SpecificInternalEnergy_Ph__NonFonctionnel(
+    //   P=P, h=h);
+    ddhp := -1e6;
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    ddhp := ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(
+      PMF=P,
+      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+        PMF=P,
+        HMF=h,
+        Xco2=Xco2,
+        Xh2o=Xh2o,
+        Xo2=Xo2,
+        Xso2=Xso2),
+      Xco2=Xco2,
+      Xh2o=Xh2o,
+      Xo2=Xo2,
+      Xso2=Xso2);
+
+   //ddhp := -1e6;
+
+  // MoltenSalt
+  elseif fluid==4 then
+    //ddhp := -1e6;
+    // u := ThermoSysPro.Properties.MoltenSalt.SpecificInternalEnergy_T__NonFonctionnel(
+    //   T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+    ddhp := (ThermoSysPro.Properties.MoltenSalt.Density_T(T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h+delta_h))
+        -ThermoSysPro.Properties.MoltenSalt.Density_T(T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h-delta_h)))
+      /(2*delta_h);
+//  //
+
+  // Oil
+  elseif fluid==5 then
+//   ddhp := -1e2;
+   ddhp := (ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h+delta_h))
+        -ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h-delta_h)))
+      /(2*delta_h);
+//  //
+  // DryAirIdealGas
+  elseif fluid==6 then
+    ddhp := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h+delta_h))
+        -ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h-delta_h)))
+      /(2*delta_h);
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+      P,
+      h,
+      mode);
+    ddhp:=pro.ddhp;
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end Density_derh_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/Density_derp_Ph.mo b/ThermoSysPro/Properties/Fluid/Density_derp_Ph.mo
index 2f3ca325ecdb3e107e6b1067c8198467031610d3..b19bb8ca51b05c480b0e0320ac787ce4bec956bf 100644
--- a/ThermoSysPro/Properties/Fluid/Density_derp_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/Density_derp_Ph.mo
@@ -1,95 +1,95 @@
-within ThermoSysPro.Properties.Fluid;
-function Density_derp_Ph
-  "Density derivative w.r.t pressure computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.DerDensityByPressure ddph "density derivative by pressure";
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-protected
-  Units.SI.AbsolutePressure delta_P=0.0001*P;
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    ddph:=pro.ddph;
-
-  // C3H3F5
-
-  elseif fluid==2 then
-    // The properties are independents of the pressure
-    // **********************************************
-    // u := ThermoSysPro.Properties.C3H3F5.SpecificInternalEnergy_Ph__NonFonctionnel(
-    //   P=P, h=h);
-    ddph := 1e-8;
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    ddph := ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(
-      PMF=P,
-      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-        PMF=P,
-        HMF=h,
-        Xco2=Xco2,
-        Xh2o=Xh2o,
-        Xo2=Xo2,
-        Xso2=Xso2),
-      Xco2=Xco2,
-      Xh2o=Xh2o,
-      Xo2=Xo2,
-      Xso2=Xso2);
-
-  // MoltenSalt
-  elseif fluid==4 then
-    // The properties are independents of the pressure
-    // **********************************************
-    //ddph := 1/h;
-    ddph := 1e-8;
-    // u := ThermoSysPro.Properties.MoltenSalt.SpecificInternalEnergy_T__NonFonctionnel(
-    //   T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-//
-  // Oil
-  elseif fluid==5 then
-    // The properties are independent of the pressure
-    // **********************************************
-    ddph := 1e-8;
-//    ddph := (ThermoSysPro.Properties.Oil_TherminolVP1.Density_t(temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))
-//        -ThermoSysPro.Properties.Oil_TherminolVP1.Density_t(temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h)))
-//      /(2*delta_P) + 0.000001;
-
-  // DryAirIdealGas
-  elseif fluid==6 then
-    ddph := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P+delta_P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h))
-        -ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P-delta_P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)))
-      /(2*delta_P);
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-      P,
-      h,
-      mode);
-    ddph:=pro.ddph;
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end Density_derp_Ph;
+within ThermoSysPro.Properties.Fluid;
+function Density_derp_Ph
+  "Density derivative w.r.t pressure computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.DerDensityByPressure ddph "density derivative by pressure";
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+protected
+  Units.SI.AbsolutePressure delta_P=0.0001*P;
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    ddph:=pro.ddph;
+
+  // C3H3F5
+
+  elseif fluid==2 then
+    // The properties are independents of the pressure
+    // **********************************************
+    // u := ThermoSysPro.Properties.C3H3F5.SpecificInternalEnergy_Ph__NonFonctionnel(
+    //   P=P, h=h);
+    ddph := 1e-8;
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    ddph := ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(
+      PMF=P,
+      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+        PMF=P,
+        HMF=h,
+        Xco2=Xco2,
+        Xh2o=Xh2o,
+        Xo2=Xo2,
+        Xso2=Xso2),
+      Xco2=Xco2,
+      Xh2o=Xh2o,
+      Xo2=Xo2,
+      Xso2=Xso2);
+
+  // MoltenSalt
+  elseif fluid==4 then
+    // The properties are independents of the pressure
+    // **********************************************
+    //ddph := 1/h;
+    ddph := 1e-8;
+    // u := ThermoSysPro.Properties.MoltenSalt.SpecificInternalEnergy_T__NonFonctionnel(
+    //   T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+//
+  // Oil
+  elseif fluid==5 then
+    // The properties are independent of the pressure
+    // **********************************************
+    ddph := 1e-8;
+//    ddph := (ThermoSysPro.Properties.Oil_TherminolVP1.Density_t(temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))
+//        -ThermoSysPro.Properties.Oil_TherminolVP1.Density_t(temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h)))
+//      /(2*delta_P) + 0.000001;
+
+  // DryAirIdealGas
+  elseif fluid==6 then
+    ddph := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P+delta_P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h))
+        -ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=P-delta_P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)))
+      /(2*delta_P);
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+      P,
+      h,
+      mode);
+    ddph:=pro.ddph;
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end Density_derp_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/DynamicViscosity_Ph.mo b/ThermoSysPro/Properties/Fluid/DynamicViscosity_Ph.mo
index e59b9e6d21490077e3c17e84a47972da3bfd9e6a..a4ef447c172b5757981a3e705a1f4fe92706d735 100644
--- a/ThermoSysPro/Properties/Fluid/DynamicViscosity_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/DynamicViscosity_Ph.mo
@@ -1,86 +1,86 @@
-within ThermoSysPro.Properties.Fluid;
-function DynamicViscosity_Ph
-  "Dynamic Viscosity computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.DynamicViscosity mu "Dynamic Viscosity (Pa.s)";
-
-// fluid==1 - Water/Steam
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    mu := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
-
-  // C3H3F5
-  elseif fluid==2 then
-    pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(P=P, h=h);
-    //LogVariable(pro.x);
-    mu:= if pro.x < 1 then 0.0004 else 0.00001;
-    //assert(false, "??????????  fluid = 2: the function DynamicViscosity_Ph is not available; incorrect option ?????????");
-    //mu := 0.00001;
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    mu := ThermoSysPro.Properties.FlueGases.FlueGases_mu(
-      PMF=P,
-      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-        PMF=P,
-        HMF=h,
-        Xco2=Xco2,
-        Xh2o=Xh2o,
-        Xo2=Xo2,
-        Xso2=Xso2),
-      Xco2=Xco2,
-      Xh2o=Xh2o,
-      Xo2=Xo2,
-      Xso2=Xso2);
-
-  // MoltenSalt
-  elseif fluid==4 then
-    mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T=
-      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-
-  // Oil
-  elseif fluid==5 then
-    mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(temp=
-      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    mu := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
-      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
-      rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
-        P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
-
-  // Water/Steam  /// Simple
-  elseif fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    mu := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-  annotation(derivative=derDynamicViscosity_derP_derh);
-end DynamicViscosity_Ph;
+within ThermoSysPro.Properties.Fluid;
+function DynamicViscosity_Ph
+  "Dynamic Viscosity computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.DynamicViscosity mu "Dynamic Viscosity (Pa.s)";
+
+// fluid==1 - Water/Steam
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    mu := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
+
+  // C3H3F5
+  elseif fluid==2 then
+    pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(P=P, h=h);
+    //LogVariable(pro.x);
+    mu:= if pro.x < 1 then 0.0004 else 0.00001;
+    //assert(false, "??????????  fluid = 2: the function DynamicViscosity_Ph is not available; incorrect option ?????????");
+    //mu := 0.00001;
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    mu := ThermoSysPro.Properties.FlueGases.FlueGases_mu(
+      PMF=P,
+      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+        PMF=P,
+        HMF=h,
+        Xco2=Xco2,
+        Xh2o=Xh2o,
+        Xo2=Xo2,
+        Xso2=Xso2),
+      Xco2=Xco2,
+      Xh2o=Xh2o,
+      Xo2=Xo2,
+      Xso2=Xso2);
+
+  // MoltenSalt
+  elseif fluid==4 then
+    mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T=
+      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+
+  // Oil
+  elseif fluid==5 then
+    mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(temp=
+      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    mu := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
+      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
+      rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
+        P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
+
+  // Water/Steam  /// Simple
+  elseif fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    mu := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+  annotation(derivative=derDynamicViscosity_derP_derh);
+end DynamicViscosity_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/DynamicViscosity_rhoT.mo b/ThermoSysPro/Properties/Fluid/DynamicViscosity_rhoT.mo
index d7f152170183789c957801ee053da8cd88a49892..e4393375666b93b60e8ca00e6824f80775d75887 100644
--- a/ThermoSysPro/Properties/Fluid/DynamicViscosity_rhoT.mo
+++ b/ThermoSysPro/Properties/Fluid/DynamicViscosity_rhoT.mo
@@ -1,33 +1,33 @@
-within ThermoSysPro.Properties.Fluid;
-function DynamicViscosity_rhoT
-  "Dynamic Viscosity computation for all fluids (inputs: rho,T,fluid)"
-
-  input Units.SI.Density rho "Density";
-  input Units.SI.Temperature T "Temperature";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam  <br>7 - WaterSteamSimple </html>";
-
-  output Units.SI.DynamicViscosity mu "Dynamic Viscosity (Pa.s)";
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam  ///
-  if fluid==1 then
-    mu := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=rho,T=T);
-
-   //LogVariable(mu);
-
-  // Water/Steam  /// Simple
-  elseif fluid==7 then
-    mu := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=rho,T=T);
-    //LogVariable(mu);
-
-  else
-    assert(false, "incorrect fluid number");  ///
-
-  end if;
-
-  //annotation(derivative=derDynamicViscosity_derT_derrho);
-end DynamicViscosity_rhoT;
+within ThermoSysPro.Properties.Fluid;
+function DynamicViscosity_rhoT
+  "Dynamic Viscosity computation for all fluids (inputs: rho,T,fluid)"
+
+  input Units.SI.Density rho "Density";
+  input Units.SI.Temperature T "Temperature";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam  <br>7 - WaterSteamSimple </html>";
+
+  output Units.SI.DynamicViscosity mu "Dynamic Viscosity (Pa.s)";
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam  ///
+  if fluid==1 then
+    mu := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=rho,T=T);
+
+   //LogVariable(mu);
+
+  // Water/Steam  /// Simple
+  elseif fluid==7 then
+    mu := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=rho,T=T);
+    //LogVariable(mu);
+
+  else
+    assert(false, "incorrect fluid number");  ///
+
+  end if;
+
+  //annotation(derivative=derDynamicViscosity_derT_derrho);
+end DynamicViscosity_rhoT;
diff --git a/ThermoSysPro/Properties/Fluid/Interfaces/FluidType.mo b/ThermoSysPro/Properties/Fluid/Interfaces/FluidType.mo
index ba727d35b83899e6e5aaf036c67ae3fb1e589847..ef52be05af74289a783891f60ef055cb202e8a3c 100644
--- a/ThermoSysPro/Properties/Fluid/Interfaces/FluidType.mo
+++ b/ThermoSysPro/Properties/Fluid/Interfaces/FluidType.mo
@@ -1,9 +1,9 @@
-within ThermoSysPro.Properties.Fluid.Interfaces;
-type FluidType = enumeration(
-    WaterSteam "1 - IF97 water/steam (compressible)",
-    C3H3F5 "2 - C3H3F5",
-    FlueGases "3 - Flue gases (compressible)",
-    MoltenSalt "4 - Molten salt",
-    Oil_TherminolVP1 "5 - Oil Therminol VP1",
-    DryAirIdealGas "6 - Dry air (compressible)",
-    WaterSteamSimple "7 - Simplified water/steam (compressible)");
+within ThermoSysPro.Properties.Fluid.Interfaces;
+type FluidType = enumeration(
+    WaterSteam "1 - IF97 water/steam (compressible)",
+    C3H3F5 "2 - C3H3F5",
+    FlueGases "3 - Flue gases (compressible)",
+    MoltenSalt "4 - Molten salt",
+    Oil_TherminolVP1 "5 - Oil Therminol VP1",
+    DryAirIdealGas "6 - Dry air (compressible)",
+    WaterSteamSimple "7 - Simplified water/steam (compressible)");
diff --git a/ThermoSysPro/Properties/Fluid/Interfaces/FluidTypeColors.mo b/ThermoSysPro/Properties/Fluid/Interfaces/FluidTypeColors.mo
index b29346d7d50cce21c9298b8ced9159c2111b7719..4acb6b89f73b0a6a3cef239184da158d745b16d8 100644
--- a/ThermoSysPro/Properties/Fluid/Interfaces/FluidTypeColors.mo
+++ b/ThermoSysPro/Properties/Fluid/Interfaces/FluidTypeColors.mo
@@ -1,28 +1,28 @@
-within ThermoSysPro.Properties.Fluid.Interfaces;
-partial model FluidTypeColors "Fluid type colors"
-
-protected
-  constant Integer line_color_fluid_1[:] = {0,0,255} "Blue";
-  constant Integer line_color_fluid_2[:] = {238,46,47} "Red";
-  constant Integer line_color_fluid_3[:] = {0,140,72} "Green";
-  constant Integer line_color_fluid_4[:] = {217,67,180} "Magenta";
-  constant Integer line_color_fluid_5[:] = {162,29,33} "Brown";
-  constant Integer line_color_fluid_6[:] = {244,125,35} "Orange";
-  constant Integer line_color_fluid_7[:] = {102,44,145} "Purple";
-
-  constant Integer fill_color_fluid_1[:] = {0,0,255} "Blue";
-  constant Integer fill_color_fluid_2[:] = {238,46,47} "Red";
-  constant Integer fill_color_fluid_3[:] = {0,140,72} "Green";
-  constant Integer fill_color_fluid_4[:] = {217,67,180} "Magenta";
-  constant Integer fill_color_fluid_5[:] = {162,29,33} "Brown";
-  constant Integer fill_color_fluid_6[:] = {244,125,35} "Orange";
-  constant Integer fill_color_fluid_7[:] = {102,44,145} "Purple";
-
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false)),
-                                            Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end FluidTypeColors;
+within ThermoSysPro.Properties.Fluid.Interfaces;
+partial model FluidTypeColors "Fluid type colors"
+
+protected
+  constant Integer line_color_fluid_1[:] = {0,0,255} "Blue";
+  constant Integer line_color_fluid_2[:] = {238,46,47} "Red";
+  constant Integer line_color_fluid_3[:] = {0,140,72} "Green";
+  constant Integer line_color_fluid_4[:] = {217,67,180} "Magenta";
+  constant Integer line_color_fluid_5[:] = {162,29,33} "Brown";
+  constant Integer line_color_fluid_6[:] = {244,125,35} "Orange";
+  constant Integer line_color_fluid_7[:] = {102,44,145} "Purple";
+
+  constant Integer fill_color_fluid_1[:] = {0,0,255} "Blue";
+  constant Integer fill_color_fluid_2[:] = {238,46,47} "Red";
+  constant Integer fill_color_fluid_3[:] = {0,140,72} "Green";
+  constant Integer fill_color_fluid_4[:] = {217,67,180} "Magenta";
+  constant Integer fill_color_fluid_5[:] = {162,29,33} "Brown";
+  constant Integer fill_color_fluid_6[:] = {244,125,35} "Orange";
+  constant Integer fill_color_fluid_7[:] = {102,44,145} "Purple";
+
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false)),
+                                            Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end FluidTypeColors;
diff --git a/ThermoSysPro/Properties/Fluid/Interfaces/FluidTypeInterface.mo b/ThermoSysPro/Properties/Fluid/Interfaces/FluidTypeInterface.mo
index 30ce4104b44a34276b2cd02ed135a2702825d78d..073961d4cfc47d95c1f2de8fa07b59f8cde9d903 100644
--- a/ThermoSysPro/Properties/Fluid/Interfaces/FluidTypeInterface.mo
+++ b/ThermoSysPro/Properties/Fluid/Interfaces/FluidTypeInterface.mo
@@ -1,39 +1,39 @@
-within ThermoSysPro.Properties.Fluid.Interfaces;
-partial model FluidTypeInterface "Interface to the fluid type"
-  extends FluidTypeColors;
-  import ThermoSysPro.Properties.Fluid.Interfaces.FluidType;
-
-  parameter FluidType ftype=FluidType.WaterSteam "Fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer fluid=Integer(ftype) "Fluid number";
-  parameter Boolean isCompressible=(ftype==FluidType.WaterSteam or ftype==FluidType.FlueGases or ftype==FluidType.DryAirIdealGas or ftype==FluidType.WaterSteamSimple) "Compressible fluid" annotation(Evaluate=true);
-
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
-          Rectangle(
-          extent={{-100,100},{-80,80}},
-          lineColor=DynamicSelect({0,0,255},
-          if fluid == 1 then line_color_fluid_1
-          else if fluid == 2 then line_color_fluid_2
-          else if fluid == 3 then line_color_fluid_3
-          else if fluid == 4 then line_color_fluid_4
-          else if fluid == 5 then line_color_fluid_5
-          else if fluid == 6 then line_color_fluid_6
-          else if fluid == 7 then line_color_fluid_7
-          else {0,0,0}),
-          fillColor=DynamicSelect({0,0,255},
-          if fluid == 1 then fill_color_fluid_1
-          else if fluid == 2 then fill_color_fluid_2
-          else if fluid == 3 then fill_color_fluid_3
-          else if fluid == 4 then fill_color_fluid_4
-          else if fluid == 5 then fill_color_fluid_5
-          else if fluid == 6 then fill_color_fluid_6
-          else if fluid == 7 then fill_color_fluid_7
-          else {0,0,0}),
-          fillPattern=FillPattern.Solid)}), Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end FluidTypeInterface;
+within ThermoSysPro.Properties.Fluid.Interfaces;
+partial model FluidTypeInterface "Interface to the fluid type"
+  extends FluidTypeColors;
+  import ThermoSysPro.Properties.Fluid.Interfaces.FluidType;
+
+  parameter FluidType ftype=FluidType.WaterSteam "Fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer fluid=Integer(ftype) "Fluid number";
+  parameter Boolean isCompressible=(ftype==FluidType.WaterSteam or ftype==FluidType.FlueGases or ftype==FluidType.DryAirIdealGas or ftype==FluidType.WaterSteamSimple) "Compressible fluid" annotation(Evaluate=true);
+
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
+          Rectangle(
+          extent={{-100,100},{-80,80}},
+          lineColor=DynamicSelect({0,0,255},
+          if fluid == 1 then line_color_fluid_1
+          else if fluid == 2 then line_color_fluid_2
+          else if fluid == 3 then line_color_fluid_3
+          else if fluid == 4 then line_color_fluid_4
+          else if fluid == 5 then line_color_fluid_5
+          else if fluid == 6 then line_color_fluid_6
+          else if fluid == 7 then line_color_fluid_7
+          else {0,0,0}),
+          fillColor=DynamicSelect({0,0,255},
+          if fluid == 1 then fill_color_fluid_1
+          else if fluid == 2 then fill_color_fluid_2
+          else if fluid == 3 then fill_color_fluid_3
+          else if fluid == 4 then fill_color_fluid_4
+          else if fluid == 5 then fill_color_fluid_5
+          else if fluid == 6 then fill_color_fluid_6
+          else if fluid == 7 then fill_color_fluid_7
+          else {0,0,0}),
+          fillPattern=FillPattern.Solid)}), Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end FluidTypeInterface;
diff --git a/ThermoSysPro/Properties/Fluid/Interfaces/IF97Region.mo b/ThermoSysPro/Properties/Fluid/Interfaces/IF97Region.mo
index 2ccb764b3af7c564a7e1c44f8e3d1f30f0031b19..51c95d04901ac744b04543bce409e7d7f0357222 100644
--- a/ThermoSysPro/Properties/Fluid/Interfaces/IF97Region.mo
+++ b/ThermoSysPro/Properties/Fluid/Interfaces/IF97Region.mo
@@ -1,8 +1,8 @@
-within ThermoSysPro.Properties.Fluid.Interfaces;
-type IF97Region = enumeration(
-    All_regions "All regions - IF97 is selected automatically",
-    Region_1 "Region 1 - Liquid",
-    Region_2 "Region 2 - Vapor",
-    Region_3 "Region 3",
-    Region_4 "Region 4 - Saturation line",
-    Region_5 "Region 5") "IF97 Regions";
+within ThermoSysPro.Properties.Fluid.Interfaces;
+type IF97Region = enumeration(
+    All_regions "All regions - IF97 is selected automatically",
+    Region_1 "Region 1 - Liquid",
+    Region_2 "Region 2 - Vapor",
+    Region_3 "Region 3",
+    Region_4 "Region 4 - Saturation line",
+    Region_5 "Region 5") "IF97 Regions";
diff --git a/ThermoSysPro/Properties/Fluid/Interfaces/WaterSteamFluidType.mo b/ThermoSysPro/Properties/Fluid/Interfaces/WaterSteamFluidType.mo
index e98a5cd17061ed49b8c872dcf9ba766c46b01f03..615d7ac108ea76743328283f7ec85ab34f9400d6 100644
--- a/ThermoSysPro/Properties/Fluid/Interfaces/WaterSteamFluidType.mo
+++ b/ThermoSysPro/Properties/Fluid/Interfaces/WaterSteamFluidType.mo
@@ -1,4 +1,4 @@
-within ThermoSysPro.Properties.Fluid.Interfaces;
-type WaterSteamFluidType = enumeration(
-    WaterSteam "1 - IF97 water/steam (compressible)",
-    WaterSteamSimple "7 - Simplified water/steam (compressible)");
+within ThermoSysPro.Properties.Fluid.Interfaces;
+type WaterSteamFluidType = enumeration(
+    WaterSteam "1 - IF97 water/steam (compressible)",
+    WaterSteamSimple "7 - Simplified water/steam (compressible)");
diff --git a/ThermoSysPro/Properties/Fluid/Interfaces/WaterSteamFluidTypeInterface.mo b/ThermoSysPro/Properties/Fluid/Interfaces/WaterSteamFluidTypeInterface.mo
index d5ac90936f8f1e6355f4ecd150559beec72db4b8..68de6678640e38c94d4c001fd692b8c5c1a7206f 100644
--- a/ThermoSysPro/Properties/Fluid/Interfaces/WaterSteamFluidTypeInterface.mo
+++ b/ThermoSysPro/Properties/Fluid/Interfaces/WaterSteamFluidTypeInterface.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.Fluid.Interfaces;
-partial model WaterSteamFluidTypeInterface "Interface to the water/steam fluid type"
-  extends FluidTypeColors;
-  import ThermoSysPro.Properties.Fluid.Interfaces.FluidType;
-  import ThermoSysPro.Properties.Fluid.Interfaces.WaterSteamFluidType;
-
-  parameter WaterSteamFluidType wsftype=WaterSteamFluidType.WaterSteam "Water/steam fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
-
-protected
-  parameter Integer wsfluid=Integer(wsftype) "Fluid number";
-
-protected
-  parameter FluidType ftype=cvwsftype(wsftype) annotation(Evaluate=true);
-  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
-          Rectangle(
-          extent={{-100,100},{-80,80}},
-          lineColor=DynamicSelect({0,0,255},
-          if wsfluid == 1 then line_color_fluid_1
-          else if wsfluid == 2 then line_color_fluid_7
-          else {0,0,0}),
-          fillColor=DynamicSelect({0,0,255},
-          if wsfluid == 1 then fill_color_fluid_1
-          else if wsfluid == 2 then fill_color_fluid_7
-          else {0,0,0}),
-          fillPattern=FillPattern.Solid)}), Diagram(
-        coordinateSystem(preserveAspectRatio=false)),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end WaterSteamFluidTypeInterface;
+within ThermoSysPro.Properties.Fluid.Interfaces;
+partial model WaterSteamFluidTypeInterface "Interface to the water/steam fluid type"
+  extends FluidTypeColors;
+  import ThermoSysPro.Properties.Fluid.Interfaces.FluidType;
+  import ThermoSysPro.Properties.Fluid.Interfaces.WaterSteamFluidType;
+
+  parameter WaterSteamFluidType wsftype=WaterSteamFluidType.WaterSteam "Water/steam fluid type" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+protected
+  parameter Integer wsfluid=Integer(wsftype) "Fluid number";
+
+protected
+  parameter FluidType ftype=cvwsftype(wsftype) annotation(Evaluate=true);
+  annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
+          Rectangle(
+          extent={{-100,100},{-80,80}},
+          lineColor=DynamicSelect({0,0,255},
+          if wsfluid == 1 then line_color_fluid_1
+          else if wsfluid == 2 then line_color_fluid_7
+          else {0,0,0}),
+          fillColor=DynamicSelect({0,0,255},
+          if wsfluid == 1 then fill_color_fluid_1
+          else if wsfluid == 2 then fill_color_fluid_7
+          else {0,0,0}),
+          fillPattern=FillPattern.Solid)}), Diagram(
+        coordinateSystem(preserveAspectRatio=false)),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end WaterSteamFluidTypeInterface;
diff --git a/ThermoSysPro/Properties/Fluid/Interfaces/cvwsftype.mo b/ThermoSysPro/Properties/Fluid/Interfaces/cvwsftype.mo
index c89ddd456d62b6184274e48ee082acc614eb642f..d41e7fe78964604a43d95c733b86eed544f07be0 100644
--- a/ThermoSysPro/Properties/Fluid/Interfaces/cvwsftype.mo
+++ b/ThermoSysPro/Properties/Fluid/Interfaces/cvwsftype.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.Fluid.Interfaces;
-function cvwsftype "Converts water/steam fluid type into fluid type"
-  import ThermoSysPro.Properties.Fluid.Interfaces.FluidType;
-  import ThermoSysPro.Properties.Fluid.Interfaces.WaterSteamFluidType;
-
-  input WaterSteamFluidType wsftype;
-  output FluidType ftype;
-
-algorithm
-  ftype := if wsftype == WaterSteamFluidType.WaterSteam then FluidType.WaterSteam
-           else FluidType.WaterSteamSimple;
-
-end cvwsftype;
+within ThermoSysPro.Properties.Fluid.Interfaces;
+function cvwsftype "Converts water/steam fluid type into fluid type"
+  import ThermoSysPro.Properties.Fluid.Interfaces.FluidType;
+  import ThermoSysPro.Properties.Fluid.Interfaces.WaterSteamFluidType;
+
+  input WaterSteamFluidType wsftype;
+  output FluidType ftype;
+
+algorithm
+  ftype := if wsftype == WaterSteamFluidType.WaterSteam then FluidType.WaterSteam
+           else FluidType.WaterSteamSimple;
+
+end cvwsftype;
diff --git a/ThermoSysPro/Properties/Fluid/Interfaces/isCompatible.mo b/ThermoSysPro/Properties/Fluid/Interfaces/isCompatible.mo
index 1911daa5e8d06f9592fcd5faee9d98ed03d342ec..ecaf1051691d1dce661920065cfbd10006069405 100644
--- a/ThermoSysPro/Properties/Fluid/Interfaces/isCompatible.mo
+++ b/ThermoSysPro/Properties/Fluid/Interfaces/isCompatible.mo
@@ -1,32 +1,32 @@
-within ThermoSysPro.Properties.Fluid.Interfaces;
-function isCompatible "Determines whether fluids are comptaible"
-  input FluidType ftype[:] "Fluid type";
-  output Boolean compatible;
-
-  /* The size of each dimension of the compatibility table must be equal to the
-  number of elements in the FluidType enumeration */
-protected
-  Boolean compatibility_table[7, 7]=
-  [true,  false, false, false, false, false, true;
-   false, true,  false, false, false, false, false;
-   false, false, true,  false, false, false, false;
-   false, false, false, true,  false, false, false;
-   false, false, false, false, true,  false, false;
-   false, false, false, false, false, true,  false;
-   true,  false, false, false, false, false, true];
-
-algorithm
-
-  compatible := true;
-
-  for i in 1:size(ftype, 1) loop
-    for j in i + 1:size(ftype, 1) loop
-      compatible := compatible and compatibility_table[Integer(ftype[i]), Integer(ftype[j])];
-    end for;
-  end for;
-
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-</html>"));
-end isCompatible;
+within ThermoSysPro.Properties.Fluid.Interfaces;
+function isCompatible "Determines whether fluids are comptaible"
+  input FluidType ftype[:] "Fluid type";
+  output Boolean compatible;
+
+  /* The size of each dimension of the compatibility table must be equal to the
+  number of elements in the FluidType enumeration */
+protected
+  Boolean compatibility_table[7, 7]=
+  [true,  false, false, false, false, false, true;
+   false, true,  false, false, false, false, false;
+   false, false, true,  false, false, false, false;
+   false, false, false, true,  false, false, false;
+   false, false, false, false, true,  false, false;
+   false, false, false, false, false, true,  false;
+   true,  false, false, false, false, false, true];
+
+algorithm
+
+  compatible := true;
+
+  for i in 1:size(ftype, 1) loop
+    for j in i + 1:size(ftype, 1) loop
+      compatible := compatible and compatibility_table[Integer(ftype[i]), Integer(ftype[j])];
+    end for;
+  end for;
+
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+</html>"));
+end isCompatible;
diff --git a/ThermoSysPro/Properties/Fluid/Interfaces/package.order b/ThermoSysPro/Properties/Fluid/Interfaces/package.order
index 5f924d01b68a331335a15c0289a654feed16f4cc..682f9a3b5b896b77efe7c5979432c74a35cdc21d 100644
--- a/ThermoSysPro/Properties/Fluid/Interfaces/package.order
+++ b/ThermoSysPro/Properties/Fluid/Interfaces/package.order
@@ -1,8 +1,8 @@
-FluidType
-FluidTypeColors
-FluidTypeInterface
-WaterSteamFluidType
-WaterSteamFluidTypeInterface
-IF97Region
-isCompatible
-cvwsftype
+FluidType
+FluidTypeColors
+FluidTypeInterface
+WaterSteamFluidType
+WaterSteamFluidTypeInterface
+IF97Region
+isCompatible
+cvwsftype
diff --git a/ThermoSysPro/Properties/Fluid/IsentropicExponent_Ph.mo b/ThermoSysPro/Properties/Fluid/IsentropicExponent_Ph.mo
index f3249896124b5dca9863baf7376fb86e35b0891e..4f3a01eb2fdc8b675d8c9acfe32363f75f253aa0 100644
--- a/ThermoSysPro/Properties/Fluid/IsentropicExponent_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/IsentropicExponent_Ph.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Properties.Fluid;
-function IsentropicExponent_Ph
-  "Isentropic Exponent computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.IsentropicExponent Kappa "Isentropic Exponent (1)";
-
-protected
-  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data6
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    Kappa := ThermoSysPro.Properties.WaterSteam.IF97_Utilities.Standard.isentropicExponent_ph(p=P, h=h);
-
-  // // C3H3F5
-  // elseif fluid==2 then
-  //
-  // // FlueGas
-  // elseif fluid==3 then
-  //
-  // // MoltenSalt
-  // elseif fluid==4 then
-  //
-  // Oil
-  elseif fluid==5 then
-    Kappa := 1;
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    Kappa := ThermoSysPro.Properties.DryAirIdealGas.SpecificHeatCp_T(T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h))
-      / (ThermoSysPro.Properties.DryAirIdealGas.SpecificHeatCp_T(T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)) - Data6.specificGasConstant);
-
-  // Water/Steam  /// Simple
-  elseif fluid==7 then
-    //
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end IsentropicExponent_Ph;
+within ThermoSysPro.Properties.Fluid;
+function IsentropicExponent_Ph
+  "Isentropic Exponent computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.IsentropicExponent Kappa "Isentropic Exponent (1)";
+
+protected
+  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data6
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    Kappa := ThermoSysPro.Properties.WaterSteam.IF97_Utilities.Standard.isentropicExponent_ph(p=P, h=h);
+
+  // // C3H3F5
+  // elseif fluid==2 then
+  //
+  // // FlueGas
+  // elseif fluid==3 then
+  //
+  // // MoltenSalt
+  // elseif fluid==4 then
+  //
+  // Oil
+  elseif fluid==5 then
+    Kappa := 1;
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    Kappa := ThermoSysPro.Properties.DryAirIdealGas.SpecificHeatCp_T(T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h))
+      / (ThermoSysPro.Properties.DryAirIdealGas.SpecificHeatCp_T(T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)) - Data6.specificGasConstant);
+
+  // Water/Steam  /// Simple
+  elseif fluid==7 then
+    //
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end IsentropicExponent_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/IsobaricExpansionCoefficient_Ph.mo b/ThermoSysPro/Properties/Fluid/IsobaricExpansionCoefficient_Ph.mo
index a18977d9d36849a61630227de5d42faffd4e4a47..89e555c7be1883504479a4bcf4011719cebd3557 100644
--- a/ThermoSysPro/Properties/Fluid/IsobaricExpansionCoefficient_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/IsobaricExpansionCoefficient_Ph.mo
@@ -1,48 +1,48 @@
-within ThermoSysPro.Properties.Fluid;
-function IsobaricExpansionCoefficient_Ph
-  "Isobaric Expansion Coefficient computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.CubicExpansionCoefficient Beta
-    "Isobaric Expansion Coefficient (1/K)";
-
-algorithm
-  // // Water/Steam
-  // if fluid==1 then
-  //
-  // // C3H3F5
-  // elseif fluid==2 then
-  //
-  // // FlueGas
-  // elseif fluid==3 then
-  //
-  // // MoltenSalt
-  // elseif fluid==4 then
-  //
-  // // Oil
-  // elseif fluid==5 then
-
-  // Dry Air Ideal Gas
-  //elseif fluid==6 then
-  if fluid==6 then
-    Beta := ThermoSysPro.Properties.DryAirIdealGas.IsobaricExpansionCoefficient_T(
-      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h));
-
-  // Water/Steam  /// Simple
-  //elseif fluid==7 then
-    //
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end IsobaricExpansionCoefficient_Ph;
+within ThermoSysPro.Properties.Fluid;
+function IsobaricExpansionCoefficient_Ph
+  "Isobaric Expansion Coefficient computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.CubicExpansionCoefficient Beta
+    "Isobaric Expansion Coefficient (1/K)";
+
+algorithm
+  // // Water/Steam
+  // if fluid==1 then
+  //
+  // // C3H3F5
+  // elseif fluid==2 then
+  //
+  // // FlueGas
+  // elseif fluid==3 then
+  //
+  // // MoltenSalt
+  // elseif fluid==4 then
+  //
+  // // Oil
+  // elseif fluid==5 then
+
+  // Dry Air Ideal Gas
+  //elseif fluid==6 then
+  if fluid==6 then
+    Beta := ThermoSysPro.Properties.DryAirIdealGas.IsobaricExpansionCoefficient_T(
+      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h));
+
+  // Water/Steam  /// Simple
+  //elseif fluid==7 then
+    //
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end IsobaricExpansionCoefficient_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/PT.mo b/ThermoSysPro/Properties/Fluid/PT.mo
index c96c524d858a02c33cc78cac93a3d00a65799762..73fea191a92e62ebda9424d1ef5fe462ad3b843b 100644
--- a/ThermoSysPro/Properties/Fluid/PT.mo
+++ b/ThermoSysPro/Properties/Fluid/PT.mo
@@ -1,56 +1,56 @@
-within ThermoSysPro.Properties.Fluid;
-function PT
-  input Units.SI.AbsolutePressure P "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  input Integer mode = 0 "IF97 region - 0:automatic computation";
-  input Integer fluid = 1 "Fluid number - 1: IF97 - 7: SimpleWater";
-
-  output WaterSteam.Common.ThermoProperties_pT pro
-    annotation (Placement(transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-algorithm
-
-  if (fluid == 1) then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(
-      P,
-      T,
-      mode);
-  elseif (fluid == 7) then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_PT(
-      P,
-      T,
-      mode);
-  else
-    assert(false, "Prop.PT : incorrect fluid number");
-  end if;
-
-  annotation (
-    smoothOrder = 2,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Window(
-      x=0.06,
-      y=0.1,
-      width=0.75,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end PT;
+within ThermoSysPro.Properties.Fluid;
+function PT
+  input Units.SI.AbsolutePressure P "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  input Integer mode = 0 "IF97 region - 0:automatic computation";
+  input Integer fluid = 1 "Fluid number - 1: IF97 - 7: SimpleWater";
+
+  output WaterSteam.Common.ThermoProperties_pT pro
+    annotation (Placement(transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+algorithm
+
+  if (fluid == 1) then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(
+      P,
+      T,
+      mode);
+  elseif (fluid == 7) then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_PT(
+      P,
+      T,
+      mode);
+  else
+    assert(false, "Prop.PT : incorrect fluid number");
+  end if;
+
+  annotation (
+    smoothOrder = 2,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Window(
+      x=0.06,
+      y=0.1,
+      width=0.75,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end PT;
diff --git a/ThermoSysPro/Properties/Fluid/P_sat.mo b/ThermoSysPro/Properties/Fluid/P_sat.mo
index aea3783b0ed67f925d21a11bf53cfeb599acba8c..914f84ad5421fb95cad8b9fb348c2c223cbe478f 100644
--- a/ThermoSysPro/Properties/Fluid/P_sat.mo
+++ b/ThermoSysPro/Properties/Fluid/P_sat.mo
@@ -1,48 +1,48 @@
-within ThermoSysPro.Properties.Fluid;
-function P_sat
-  input Units.SI.Temperature T "Temperature (K)";
-  input Integer fluid  "Fluid number - 1: IF97 - 7: SimpleWater";
-
-  output Units.SI.AbsolutePressure P "Pressure";
-
-algorithm
-
-  if (fluid == 1) then
-      P :=ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T);
-  elseif (fluid == 7) then
-      P :=ThermoSysPro.Properties.WaterSteamSimple.Pressure.psat_T(T);
-  else
-    assert(false, "(P_sat) : incorrect fluid number");
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Window(
-      x=0.06,
-      y=0.1,
-      width=0.75,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end P_sat;
+within ThermoSysPro.Properties.Fluid;
+function P_sat
+  input Units.SI.Temperature T "Temperature (K)";
+  input Integer fluid  "Fluid number - 1: IF97 - 7: SimpleWater";
+
+  output Units.SI.AbsolutePressure P "Pressure";
+
+algorithm
+
+  if (fluid == 1) then
+      P :=ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T);
+  elseif (fluid == 7) then
+      P :=ThermoSysPro.Properties.WaterSteamSimple.Pressure.psat_T(T);
+  else
+    assert(false, "(P_sat) : incorrect fluid number");
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Window(
+      x=0.06,
+      y=0.1,
+      width=0.75,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end P_sat;
diff --git a/ThermoSysPro/Properties/Fluid/Ph.mo b/ThermoSysPro/Properties/Fluid/Ph.mo
index d0f2a1e203ab77e47736118e3992df84f3c38fd6..637abcebc35a1b6255dc59a3ca895efa43170fd4 100644
--- a/ThermoSysPro/Properties/Fluid/Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/Ph.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Properties.Fluid;
-function Ph
-  input Units.SI.AbsolutePressure P "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer mode = 0 "IF97 region - 0:automatic computation";
-  input Integer fluid = 1 "Fluid number - 1: IF97 - 2: C3H3F5 - 7: SimpleWater";
-
-  output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-algorithm
-
-  if (fluid == 1) then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
-  elseif (fluid == 2) then
-    pro := C3H3F5.C3H3F5_Ph(P, h);
-  elseif (fluid == 7) then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(P, h, mode);
-  else
-    assert(false, "Prop.Ph : incorrect fluid number");
-  end if;
-
-  annotation (
-    smoothOrder = 2,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Window(
-      x=0.06,
-      y=0.1,
-      width=0.75,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Ph;
+within ThermoSysPro.Properties.Fluid;
+function Ph
+  input Units.SI.AbsolutePressure P "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer mode = 0 "IF97 region - 0:automatic computation";
+  input Integer fluid = 1 "Fluid number - 1: IF97 - 2: C3H3F5 - 7: SimpleWater";
+
+  output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+algorithm
+
+  if (fluid == 1) then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
+  elseif (fluid == 2) then
+    pro := C3H3F5.C3H3F5_Ph(P, h);
+  elseif (fluid == 7) then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(P, h, mode);
+  else
+    assert(false, "Prop.Ph : incorrect fluid number");
+  end if;
+
+  annotation (
+    smoothOrder = 2,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Window(
+      x=0.06,
+      y=0.1,
+      width=0.75,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Ph;
diff --git a/ThermoSysPro/Properties/Fluid/Prandtl_Ph.mo b/ThermoSysPro/Properties/Fluid/Prandtl_Ph.mo
index f3f60edc60aa70f8fd4f3a4b60dbdfed0e36cd47..d43990ff292a93c1935a5585bd36f5edcb1456a1 100644
--- a/ThermoSysPro/Properties/Fluid/Prandtl_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/Prandtl_Ph.mo
@@ -1,94 +1,94 @@
-within ThermoSysPro.Properties.Fluid;
-function Prandtl_Ph
-  "Prandtl number computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy (J/kg)";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.PrandtlNumber Pr "Prandtl number";
-
-// fluid==1 - Water/Steam
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-/// Pr = mu * Cp / k
-algorithm
-  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    Pr := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=pro.d,T=pro.T) * pro.cp
-      / ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho=pro.d,T=pro.T,P=P,region=mode);
-
-  // // C3H3F5
-  // elseif fluid==2 then
-  //   T := ThermoSysPro.Properties.C3H3F5.Temperature_Ph(P=P, h=h);
-  //
-  // // FlueGas
-  // elseif fluid==3 then
-  //   assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-  //   T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
-  //     PMF=P,
-  //     HMF=h,
-  //     Xco2=Xco2,
-  //     Xh2o=Xh2o,
-  //     Xo2=Xo2,
-  //     Xso2=Xso2);
-
-  // MoltenSalt
-  elseif fluid==4 then
-    Pr := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(
-      T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h))
-      *ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T(
-      T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h))
-      /ThermoSysPro.Properties.MoltenSalt.ThermalConductivity_T(
-      T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-
-  // Oil
-  elseif fluid==5 then
-    Pr := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(
-      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))
-      *ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T(
-      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))
-      /ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(
-      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    Pr := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
-      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
-      rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
-        P=P,
-        T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)))
-      *ThermoSysPro.Properties.DryAirIdealGas.SpecificHeatCp_T(
-        T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h))
-      /ThermoSysPro.Properties.DryAirIdealGas.ThermalConductivity_Trho(
-        T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
-        rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
-          P=P,
-          T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
-    /// Utiliser variables intermédiaires (ie: protected) pour T et rho
-
-  elseif fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-      P,
-      h,
-      mode);
-     Pr := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=pro.d,T=pro.T) * pro.cp
-      /  ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(rho=pro.d,T=pro.T);
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end Prandtl_Ph;
+within ThermoSysPro.Properties.Fluid;
+function Prandtl_Ph
+  "Prandtl number computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy (J/kg)";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.PrandtlNumber Pr "Prandtl number";
+
+// fluid==1 - Water/Steam
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+/// Pr = mu * Cp / k
+algorithm
+  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    Pr := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=pro.d,T=pro.T) * pro.cp
+      / ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho=pro.d,T=pro.T,P=P,region=mode);
+
+  // // C3H3F5
+  // elseif fluid==2 then
+  //   T := ThermoSysPro.Properties.C3H3F5.Temperature_Ph(P=P, h=h);
+  //
+  // // FlueGas
+  // elseif fluid==3 then
+  //   assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+  //   T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
+  //     PMF=P,
+  //     HMF=h,
+  //     Xco2=Xco2,
+  //     Xh2o=Xh2o,
+  //     Xo2=Xo2,
+  //     Xso2=Xso2);
+
+  // MoltenSalt
+  elseif fluid==4 then
+    Pr := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(
+      T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h))
+      *ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T(
+      T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h))
+      /ThermoSysPro.Properties.MoltenSalt.ThermalConductivity_T(
+      T=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+
+  // Oil
+  elseif fluid==5 then
+    Pr := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(
+      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))
+      *ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T(
+      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))
+      /ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(
+      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    Pr := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
+      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
+      rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
+        P=P,
+        T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)))
+      *ThermoSysPro.Properties.DryAirIdealGas.SpecificHeatCp_T(
+        T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h))
+      /ThermoSysPro.Properties.DryAirIdealGas.ThermalConductivity_Trho(
+        T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
+        rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
+          P=P,
+          T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
+    /// Utiliser variables intermédiaires (ie: protected) pour T et rho
+
+  elseif fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+      P,
+      h,
+      mode);
+     Pr := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=pro.d,T=pro.T) * pro.cp
+      /  ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(rho=pro.d,T=pro.T);
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end Prandtl_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/Ps.mo b/ThermoSysPro/Properties/Fluid/Ps.mo
index 8a2e0e849b1e444df8efb2aac77c646a3eba427b..57194018b54d8cbfe53c338dc6418dc7fb340d7a 100644
--- a/ThermoSysPro/Properties/Fluid/Ps.mo
+++ b/ThermoSysPro/Properties/Fluid/Ps.mo
@@ -1,53 +1,53 @@
-within ThermoSysPro.Properties.Fluid;
-function Ps
-  input Units.SI.AbsolutePressure P "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  input Integer mode = 0 "IF97 region - 0:automatic computation";
-  input Integer fluid = 1 "Fluid number - 1: IF97 - 2: C3H3F5 - 7: SimpleWater";
-
-public
-  output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro
-    annotation (Placement(transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-algorithm
-
-  if (fluid == 1) then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps(P, s, mode);
-  elseif (fluid == 2) then
-    pro := C3H3F5.C3H3F5_Ps(P, s);
-  elseif (fluid == 7) then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ps(P, s, mode);
-  else
-    assert(false, "Prop.Ps : incorrect fluid number");
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Window(
-      x=0.06,
-      y=0.1,
-      width=0.75,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Ps;
+within ThermoSysPro.Properties.Fluid;
+function Ps
+  input Units.SI.AbsolutePressure P "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  input Integer mode = 0 "IF97 region - 0:automatic computation";
+  input Integer fluid = 1 "Fluid number - 1: IF97 - 2: C3H3F5 - 7: SimpleWater";
+
+public
+  output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro
+    annotation (Placement(transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+algorithm
+
+  if (fluid == 1) then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps(P, s, mode);
+  elseif (fluid == 2) then
+    pro := C3H3F5.C3H3F5_Ps(P, s);
+  elseif (fluid == 7) then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ps(P, s, mode);
+  else
+    assert(false, "Prop.Ps : incorrect fluid number");
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Window(
+      x=0.06,
+      y=0.1,
+      width=0.75,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Ps;
diff --git a/ThermoSysPro/Properties/Fluid/Reynolds_PhvD.mo b/ThermoSysPro/Properties/Fluid/Reynolds_PhvD.mo
index c2f78809084c546c3952a56ea2f3e3d41bf89675..28b8bb19443eb7e79aef84ff2e62198740692ed6 100644
--- a/ThermoSysPro/Properties/Fluid/Reynolds_PhvD.mo
+++ b/ThermoSysPro/Properties/Fluid/Reynolds_PhvD.mo
@@ -1,72 +1,72 @@
-within ThermoSysPro.Properties.Fluid;
-function Reynolds_PhvD
-  "Reynolds number computation for all fluids (inputs: P, h, fluid, v, D)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy (J/kg)";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Units.SI.Velocity v "Mean velocity of fluid flow";
-  input Units.SI.Length D
-    "Characteristic dimension (hydraulic diameter of pipes)";
-
-  output Units.SI.ReynoldsNumber Re "Reynolds number";
-
-// fluid==1 - Water/Steam
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-  Re := abs(v)*pro.d*D / ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
-
-  // // C3H3F5
-  // elseif fluid==2 then
-  //   T := ThermoSysPro.Properties.C3H3F5.Temperature_Ph(P=P, h=h);
-  //
-  // // FlueGas
-  // elseif fluid==3 then
-  //   assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-  //   T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
-  //     PMF=P,
-  //     HMF=h,
-  //     Xco2=Xco2,
-  //     Xh2o=Xh2o,
-  //     Xo2=Xo2,
-  //     Xso2=Xso2);
-  //
-  // // MoltenSalt
-  // elseif fluid==4 then
-  //   T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h);
-  //
-  // // Oil
-  // elseif fluid==5 then
-  //   T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h);
-  //
-  // // Dry Air Ideal Gas
-  // elseif fluid==6 then
-  //   T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h);
-
-  elseif fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-      P,
-      h,
-      mode);
-    Re := abs(v)*pro.d*D / ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end Reynolds_PhvD;
+within ThermoSysPro.Properties.Fluid;
+function Reynolds_PhvD
+  "Reynolds number computation for all fluids (inputs: P, h, fluid, v, D)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy (J/kg)";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Units.SI.Velocity v "Mean velocity of fluid flow";
+  input Units.SI.Length D
+    "Characteristic dimension (hydraulic diameter of pipes)";
+
+  output Units.SI.ReynoldsNumber Re "Reynolds number";
+
+// fluid==1 - Water/Steam
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+  Re := abs(v)*pro.d*D / ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
+
+  // // C3H3F5
+  // elseif fluid==2 then
+  //   T := ThermoSysPro.Properties.C3H3F5.Temperature_Ph(P=P, h=h);
+  //
+  // // FlueGas
+  // elseif fluid==3 then
+  //   assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+  //   T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
+  //     PMF=P,
+  //     HMF=h,
+  //     Xco2=Xco2,
+  //     Xh2o=Xh2o,
+  //     Xo2=Xo2,
+  //     Xso2=Xso2);
+  //
+  // // MoltenSalt
+  // elseif fluid==4 then
+  //   T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h);
+  //
+  // // Oil
+  // elseif fluid==5 then
+  //   T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h);
+  //
+  // // Dry Air Ideal Gas
+  // elseif fluid==6 then
+  //   T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h);
+
+  elseif fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+      P,
+      h,
+      mode);
+    Re := abs(v)*pro.d*D / ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end Reynolds_PhvD;
diff --git a/ThermoSysPro/Properties/Fluid/Reynolds_vrhoDmu.mo b/ThermoSysPro/Properties/Fluid/Reynolds_vrhoDmu.mo
index 0929a73fa84471145e107f5b803fa00433f8dd64..ecd273043c254754bbc7233ecf53dde5c75b04d2 100644
--- a/ThermoSysPro/Properties/Fluid/Reynolds_vrhoDmu.mo
+++ b/ThermoSysPro/Properties/Fluid/Reynolds_vrhoDmu.mo
@@ -1,25 +1,25 @@
-within ThermoSysPro.Properties.Fluid;
-function Reynolds_vrhoDmu
-  "Reynolds number computation for all fluids (inputs: v, rho, D, mu, fluid)"
-
-  input Units.SI.Velocity v "Mean velocity of fluid flow";
-  input Units.SI.Density rho "Fluid density";
-  input Units.SI.Length D
-    "Characteristic dimension (hydraulic diameter of pipes)";
-  input Units.SI.DynamicViscosity mu "Dynamic (absolute) viscosity";
-
-  //  input Integer fluid
-  //  "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  // input Integer mode=0 "IF97 region - 0:automatic computation";
-  // input Real Xco2=0 "CO2 mass fraction";
-  // input Real Xh2o=0 "H2O mass fraction";
-  // input Real Xo2=0 "O2 mass fraction";
-  // input Real Xso2=0 "SO2 mass fraction";
-
-  output Units.SI.ReynoldsNumber Re "Reynolds number";
-
-algorithm
-  ///////////////////////////////////// FONCTIONNE EN DIPHASIQUE ???
-  Re := abs(v)*rho*D/mu;
-
-end Reynolds_vrhoDmu;
+within ThermoSysPro.Properties.Fluid;
+function Reynolds_vrhoDmu
+  "Reynolds number computation for all fluids (inputs: v, rho, D, mu, fluid)"
+
+  input Units.SI.Velocity v "Mean velocity of fluid flow";
+  input Units.SI.Density rho "Fluid density";
+  input Units.SI.Length D
+    "Characteristic dimension (hydraulic diameter of pipes)";
+  input Units.SI.DynamicViscosity mu "Dynamic (absolute) viscosity";
+
+  //  input Integer fluid
+  //  "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  // input Integer mode=0 "IF97 region - 0:automatic computation";
+  // input Real Xco2=0 "CO2 mass fraction";
+  // input Real Xh2o=0 "H2O mass fraction";
+  // input Real Xo2=0 "O2 mass fraction";
+  // input Real Xso2=0 "SO2 mass fraction";
+
+  output Units.SI.ReynoldsNumber Re "Reynolds number";
+
+algorithm
+  ///////////////////////////////////// FONCTIONNE EN DIPHASIQUE ???
+  Re := abs(v)*rho*D/mu;
+
+end Reynolds_vrhoDmu;
diff --git a/ThermoSysPro/Properties/Fluid/SpecificEnthalpy_PT.mo b/ThermoSysPro/Properties/Fluid/SpecificEnthalpy_PT.mo
index 25b4061ee9abadd86d68cd928c94843a66b1f241..3273a240dea8483aea934e6e0c69961a04c44b29 100644
--- a/ThermoSysPro/Properties/Fluid/SpecificEnthalpy_PT.mo
+++ b/ThermoSysPro/Properties/Fluid/SpecificEnthalpy_PT.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.Properties.Fluid;
-function SpecificEnthalpy_PT "Specific Enthalpy computation for all fluids (inputs: P, T, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.Temperature T "Temperature (K)";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy (J/kg)";
-
-algorithm
-  // IF97 water/steam
-  if fluid == 1 then
-    h := ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(p=P, T=T, mode=mode);
-
-  // C3H3F5
-  elseif fluid == 2 then
-    assert(false, "For fluid = 2 (C3H3F5), function SpecificEnthalpy_PT is not available");
-    //h := ThermoSysPro.Properties.C3H3F5.Enthalpy_PT(P=P, T=T);
-
-  // Flue gases
-  elseif fluid == 3 then
-    /*
-    LogVariable(mode);
-    LogVariable(P);
-    LogVariable(h);
-    LogVariable(Xco2);
-    LogVariable(Xh2o);
-    LogVariable(Xo2);
-    LogVariable(Xso2);
-   */
-     assert(Xco2 + Xh2o + Xo2 + Xso2 > 0, "Wrong mass fraction definition");  // If fluid == 3, check that mass fractions are correctly provided as inputs
-     h := ThermoSysPro.Properties.FlueGases.FlueGases_h(
-       PMF=P,
-       TMF=T,
-       Xco2=Xco2,
-       Xh2o=Xh2o,
-       Xo2=Xo2,
-       Xso2=Xso2);
-
-  // Molten salt
-  elseif fluid == 4 then
-    h := ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T=T);
-
-  // Oil
-  elseif fluid == 5 then
-    h := ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(temp=T);
-
-  // Dry air ideal gas
-  elseif fluid == 6 then
-    h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T=T);
-
-  // Simple water/steam
-  elseif fluid == 7 then
-    h := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SpecificEnthalpy_PT(p=P, T=T, mode=mode);
-
-  // Wrong fluid number
-  else
-    assert(false, "SpecificEnthalpy_PT: Incorrect fluid number");  ///
-  end if;
-
-  annotation(derivative=derSpecificEnthalpy_derP_derT);
-end SpecificEnthalpy_PT;
+within ThermoSysPro.Properties.Fluid;
+function SpecificEnthalpy_PT "Specific Enthalpy computation for all fluids (inputs: P, T, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.Temperature T "Temperature (K)";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy (J/kg)";
+
+algorithm
+  // IF97 water/steam
+  if fluid == 1 then
+    h := ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(p=P, T=T, mode=mode);
+
+  // C3H3F5
+  elseif fluid == 2 then
+    assert(false, "For fluid = 2 (C3H3F5), function SpecificEnthalpy_PT is not available");
+    //h := ThermoSysPro.Properties.C3H3F5.Enthalpy_PT(P=P, T=T);
+
+  // Flue gases
+  elseif fluid == 3 then
+    /*
+    LogVariable(mode);
+    LogVariable(P);
+    LogVariable(h);
+    LogVariable(Xco2);
+    LogVariable(Xh2o);
+    LogVariable(Xo2);
+    LogVariable(Xso2);
+   */
+     assert(Xco2 + Xh2o + Xo2 + Xso2 > 0, "Wrong mass fraction definition");  // If fluid == 3, check that mass fractions are correctly provided as inputs
+     h := ThermoSysPro.Properties.FlueGases.FlueGases_h(
+       PMF=P,
+       TMF=T,
+       Xco2=Xco2,
+       Xh2o=Xh2o,
+       Xo2=Xo2,
+       Xso2=Xso2);
+
+  // Molten salt
+  elseif fluid == 4 then
+    h := ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T=T);
+
+  // Oil
+  elseif fluid == 5 then
+    h := ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(temp=T);
+
+  // Dry air ideal gas
+  elseif fluid == 6 then
+    h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T=T);
+
+  // Simple water/steam
+  elseif fluid == 7 then
+    h := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SpecificEnthalpy_PT(p=P, T=T, mode=mode);
+
+  // Wrong fluid number
+  else
+    assert(false, "SpecificEnthalpy_PT: Incorrect fluid number");  ///
+  end if;
+
+  annotation(derivative=derSpecificEnthalpy_derP_derT);
+end SpecificEnthalpy_PT;
diff --git a/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_PT.mo b/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_PT.mo
index 03cd56e41da9299df01126cb2242bcf4769c7259..c7b8766a7bdbb6442841f29396c4c1339ed2730e 100644
--- a/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_PT.mo
+++ b/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_PT.mo
@@ -1,64 +1,64 @@
-within ThermoSysPro.Properties.Fluid;
-function SpecificHeatCapacityCp_PT
-  "Specific Heat Capacity at constant P computation for all fluids (inputs: P, T, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.Temperature T "Temperature";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.SpecificHeatCapacity cp
-    "Specific Heat Capacity at constant P (J/kg/K)";
-
-// fluid==1 - Water/Steam
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(P, T, mode);
-    cp := pro.cp;
-
-  // C3H3F5
-  elseif fluid==2 then
-  //   cp :=
-  //     ThermoSysPro.Properties.C3H3F5.SpecificHeatCapacityCp_Ph__NonFonctionnel(
-  //     P=P, h=h);
-    assert(false, "?????????? fluid = 2: the function SpecificHeatCapacityCp_PT is not available; incorrect option ?????????");
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    cp := ThermoSysPro.Properties.FlueGases.FlueGases_cp(
-      PMF=P,
-      TMF=T,
-      Xco2=Xco2,
-      Xh2o=Xh2o,
-      Xo2=Xo2,
-      Xso2=Xso2);
-
-  // MoltenSalt
-  elseif fluid==4 then
-    cp := ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T(T=T);
-
-  // Oil
-  elseif fluid==5 then
-    cp := ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T(temp=T);
-
-  // Water/Steam
-  elseif fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_PT(P, T, mode);
-    cp := pro.cp;
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end SpecificHeatCapacityCp_PT;
+within ThermoSysPro.Properties.Fluid;
+function SpecificHeatCapacityCp_PT
+  "Specific Heat Capacity at constant P computation for all fluids (inputs: P, T, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.Temperature T "Temperature";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.SpecificHeatCapacity cp
+    "Specific Heat Capacity at constant P (J/kg/K)";
+
+// fluid==1 - Water/Steam
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(P, T, mode);
+    cp := pro.cp;
+
+  // C3H3F5
+  elseif fluid==2 then
+  //   cp :=
+  //     ThermoSysPro.Properties.C3H3F5.SpecificHeatCapacityCp_Ph__NonFonctionnel(
+  //     P=P, h=h);
+    assert(false, "?????????? fluid = 2: the function SpecificHeatCapacityCp_PT is not available; incorrect option ?????????");
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    cp := ThermoSysPro.Properties.FlueGases.FlueGases_cp(
+      PMF=P,
+      TMF=T,
+      Xco2=Xco2,
+      Xh2o=Xh2o,
+      Xo2=Xo2,
+      Xso2=Xso2);
+
+  // MoltenSalt
+  elseif fluid==4 then
+    cp := ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T(T=T);
+
+  // Oil
+  elseif fluid==5 then
+    cp := ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T(temp=T);
+
+  // Water/Steam
+  elseif fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_PT(P, T, mode);
+    cp := pro.cp;
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end SpecificHeatCapacityCp_PT;
diff --git a/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_Ph.mo b/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_Ph.mo
index c71d280f7ca61c10804a28ac7c6ba93f250b3ffd..456a9cfa99def7286697e7e6c4e8405f61bca483 100644
--- a/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_Ph.mo
@@ -1,78 +1,78 @@
-within ThermoSysPro.Properties.Fluid;
-function SpecificHeatCapacityCp_Ph
-  "Specific Heat Capacity at constant P computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.SpecificHeatCapacity cp
-    "Specific Heat Capacity at constant P (J/kg/K)";
-
-// fluid==1 - Water/Steam
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    cp:=pro.cp;
-
-  // C3H3F5
-  elseif fluid==2 then
-  //   cp :=
-  //     ThermoSysPro.Properties.C3H3F5.SpecificHeatCapacityCp_Ph__NonFonctionnel(
-  //     P=P, h=h);
-    assert(false, "?????????? fluid = 2: the function SpecificHeatCapacityCp_Ph is not available; incorrect option ?????????");
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    cp := ThermoSysPro.Properties.FlueGases.FlueGases_cp(
-      PMF=P,
-      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-        PMF=P,
-        HMF=h,
-        Xco2=Xco2,
-        Xh2o=Xh2o,
-        Xo2=Xo2,
-        Xso2=Xso2),
-      Xco2=Xco2,
-      Xh2o=Xh2o,
-      Xo2=Xo2,
-      Xso2=Xso2);
-
-  // MoltenSalt
-  elseif fluid==4 then
-    cp := ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T(T=
-      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-
-  // Oil
-  elseif fluid==5 then
-    cp := ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T(temp=
-      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
-
-  // Water/Steam
-  elseif fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-      P,
-      h,
-      mode);
-    cp:=pro.cp;
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end SpecificHeatCapacityCp_Ph;
+within ThermoSysPro.Properties.Fluid;
+function SpecificHeatCapacityCp_Ph
+  "Specific Heat Capacity at constant P computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.SpecificHeatCapacity cp
+    "Specific Heat Capacity at constant P (J/kg/K)";
+
+// fluid==1 - Water/Steam
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    cp:=pro.cp;
+
+  // C3H3F5
+  elseif fluid==2 then
+  //   cp :=
+  //     ThermoSysPro.Properties.C3H3F5.SpecificHeatCapacityCp_Ph__NonFonctionnel(
+  //     P=P, h=h);
+    assert(false, "?????????? fluid = 2: the function SpecificHeatCapacityCp_Ph is not available; incorrect option ?????????");
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    cp := ThermoSysPro.Properties.FlueGases.FlueGases_cp(
+      PMF=P,
+      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+        PMF=P,
+        HMF=h,
+        Xco2=Xco2,
+        Xh2o=Xh2o,
+        Xo2=Xo2,
+        Xso2=Xso2),
+      Xco2=Xco2,
+      Xh2o=Xh2o,
+      Xo2=Xo2,
+      Xso2=Xso2);
+
+  // MoltenSalt
+  elseif fluid==4 then
+    cp := ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T(T=
+      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+
+  // Oil
+  elseif fluid==5 then
+    cp := ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T(temp=
+      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
+
+  // Water/Steam
+  elseif fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+      P,
+      h,
+      mode);
+    cp:=pro.cp;
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end SpecificHeatCapacityCp_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/SpecificInternalEnergy_Ph_DO_NOT_USE.mo b/ThermoSysPro/Properties/Fluid/SpecificInternalEnergy_Ph_DO_NOT_USE.mo
index bf3a48de69a5aa978137161d8f8f4196e7110ceb..c75fcaf68e387a9d8deb4fa423c3f26b442267e9 100644
--- a/ThermoSysPro/Properties/Fluid/SpecificInternalEnergy_Ph_DO_NOT_USE.mo
+++ b/ThermoSysPro/Properties/Fluid/SpecificInternalEnergy_Ph_DO_NOT_USE.mo
@@ -1,96 +1,96 @@
-within ThermoSysPro.Properties.Fluid;
-function SpecificInternalEnergy_Ph_DO_NOT_USE
-  "Specific Internal Energy computation for all fluids (inputs: P, h, fluid). DO NOT USE (does not work with use-case 'DistributedVolumePartialModel'. Use u = h - P/rho instead)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.SpecificEnergy u "Specific Internal Energy (J/kg)";
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data6
-    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    u:=pro.u;
-
-  // // C3H3F5
-  // elseif fluid==2 then
-  //   u := ThermoSysPro.Properties.C3H3F5.SpecificInternalEnergy_Ph__NonFonctionnel(
-  //     P=P, h=h);
-  //
-
-  // // FlueGas
-   elseif fluid==3 then
-     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-  //   u := ThermoSysPro.Properties.FlueGases.FlueGases_u__NonFonctionnel(
-  //     PMF=P,
-  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-  //       PMF=P,
-  //       HMF=h,
-  //       Xco2=Xco2,
-  //       Xh2o=Xh2o,
-  //       Xo2=Xo2,
-  //       Xso2=Xso2),
-  //     Xco2=Xco2,
-  //     Xh2o=Xh2o,
-  //     Xo2=Xo2,
-  //     Xso2=Xso2);
-    u := h - P/( ThermoSysPro.Properties.FlueGases.FlueGases_rho(
-      PMF=P,
-      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-        PMF=P,
-        HMF=h,
-        Xco2=Xco2,
-        Xh2o=Xh2o,
-        Xo2=Xo2,
-        Xso2=Xso2),
-      Xco2=Xco2,
-      Xh2o=Xh2o,
-      Xo2=Xo2,
-      Xso2=Xso2));
-
-  // MoltenSalt
-  elseif fluid==4 then
-    u := h - P/( ThermoSysPro.Properties.MoltenSalt.Density_T(T=
-      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h)));
-
-  // Oil
-  elseif fluid==5 then
-    u := h - P/( ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(
-      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h)));
-
-  // DryAirIdealGas
-  elseif fluid==6 then
-    //u := h - P/( ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
-    //  P=P,T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));  /// Solution 1
-    u := h - Data6.specificGasConstant * ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h);
-
-  elseif  fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-      P,
-      h,
-      mode);
-    u:=pro.u;
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-annotation(derivative=derSpecificInternalEnergy_derP_derh);
-end SpecificInternalEnergy_Ph_DO_NOT_USE;
+within ThermoSysPro.Properties.Fluid;
+function SpecificInternalEnergy_Ph_DO_NOT_USE
+  "Specific Internal Energy computation for all fluids (inputs: P, h, fluid). DO NOT USE (does not work with use-case 'DistributedVolumePartialModel'. Use u = h - P/rho instead)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.SpecificEnergy u "Specific Internal Energy (J/kg)";
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+  ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas Data6
+    annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0)));
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    u:=pro.u;
+
+  // // C3H3F5
+  // elseif fluid==2 then
+  //   u := ThermoSysPro.Properties.C3H3F5.SpecificInternalEnergy_Ph__NonFonctionnel(
+  //     P=P, h=h);
+  //
+
+  // // FlueGas
+   elseif fluid==3 then
+     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+  //   u := ThermoSysPro.Properties.FlueGases.FlueGases_u__NonFonctionnel(
+  //     PMF=P,
+  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+  //       PMF=P,
+  //       HMF=h,
+  //       Xco2=Xco2,
+  //       Xh2o=Xh2o,
+  //       Xo2=Xo2,
+  //       Xso2=Xso2),
+  //     Xco2=Xco2,
+  //     Xh2o=Xh2o,
+  //     Xo2=Xo2,
+  //     Xso2=Xso2);
+    u := h - P/( ThermoSysPro.Properties.FlueGases.FlueGases_rho(
+      PMF=P,
+      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+        PMF=P,
+        HMF=h,
+        Xco2=Xco2,
+        Xh2o=Xh2o,
+        Xo2=Xo2,
+        Xso2=Xso2),
+      Xco2=Xco2,
+      Xh2o=Xh2o,
+      Xo2=Xo2,
+      Xso2=Xso2));
+
+  // MoltenSalt
+  elseif fluid==4 then
+    u := h - P/( ThermoSysPro.Properties.MoltenSalt.Density_T(T=
+      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h)));
+
+  // Oil
+  elseif fluid==5 then
+    u := h - P/( ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(
+      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h)));
+
+  // DryAirIdealGas
+  elseif fluid==6 then
+    //u := h - P/( ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
+    //  P=P,T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));  /// Solution 1
+    u := h - Data6.specificGasConstant * ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h);
+
+  elseif  fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+      P,
+      h,
+      mode);
+    u:=pro.u;
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+annotation(derivative=derSpecificInternalEnergy_derP_derh);
+end SpecificInternalEnergy_Ph_DO_NOT_USE;
diff --git a/ThermoSysPro/Properties/Fluid/T_sat.mo b/ThermoSysPro/Properties/Fluid/T_sat.mo
index c255ed12a4e6d62eeb0fe1b79cbf20fc801dcacf..a708af751f6e4e6cbabba5b13ac9a649cda7f0a4 100644
--- a/ThermoSysPro/Properties/Fluid/T_sat.mo
+++ b/ThermoSysPro/Properties/Fluid/T_sat.mo
@@ -1,48 +1,48 @@
-within ThermoSysPro.Properties.Fluid;
-function T_sat
-  input Units.SI.AbsolutePressure P "Pressure";
-  input Integer fluid  "Fluid number - 1: IF97 - 7: SimpleWater";
-
-  output Units.SI.Temperature T "Temperature (K)";
-
-algorithm
-
-  if (fluid == 1) then
-    T :=  ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(P);
-  elseif (fluid == 7) then
-    T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(P);
-  else
-    assert(false, "(T_sat) : incorrect fluid number");
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Window(
-      x=0.06,
-      y=0.1,
-      width=0.75,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end T_sat;
+within ThermoSysPro.Properties.Fluid;
+function T_sat
+  input Units.SI.AbsolutePressure P "Pressure";
+  input Integer fluid  "Fluid number - 1: IF97 - 7: SimpleWater";
+
+  output Units.SI.Temperature T "Temperature (K)";
+
+algorithm
+
+  if (fluid == 1) then
+    T :=  ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(P);
+  elseif (fluid == 7) then
+    T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(P);
+  else
+    assert(false, "(T_sat) : incorrect fluid number");
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Window(
+      x=0.06,
+      y=0.1,
+      width=0.75,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end T_sat;
diff --git a/ThermoSysPro/Properties/Fluid/Temperature_Ph.mo b/ThermoSysPro/Properties/Fluid/Temperature_Ph.mo
index 6fa9c0a949276d0ae7f4223102938d6718a19eac..1eb757517233149d829b7f00672d63d7ea874ae4 100644
--- a/ThermoSysPro/Properties/Fluid/Temperature_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/Temperature_Ph.mo
@@ -1,85 +1,85 @@
-within ThermoSysPro.Properties.Fluid;
-function Temperature_Ph
-  "Temperature computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.Temperature T "Temperature (K)";
-
-// fluid==1 - Water/Steam
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    T:=pro.T;
-
-  // C3H3F5
-  elseif fluid==2 then
-    pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(P=P, h=h);
-    //LogVariable(pro.x);
-    T:=pro.T;
-
-  // FlueGas
-  elseif fluid==3 then
-    /*
-    LogVariable(mode);
-    LogVariable(P);
-    LogVariable(h);
-    LogVariable(Xco2);
-    LogVariable(Xh2o);
-    LogVariable(Xo2);
-    LogVariable(Xso2);
-   */
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-
-    T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
-      PMF=P,
-      HMF=h,
-      Xco2=Xco2,
-      Xh2o=Xh2o,
-      Xo2=Xo2,
-      Xso2=Xso2);
-
-//    T := ThermoSysPro.Properties.FlueGases.FlueGases_T(P,h,Xco2,Xh2o,Xo2,Xso2);
-
-  // MoltenSalt
-  elseif fluid==4 then
-    T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h);
-
-  // Oil
-  elseif fluid==5 then
-    T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h);
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h);
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-      P,
-      h,
-      mode);
-    T:=pro.T;
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-  annotation(derivative=derTemperature_derP_derh);
-end Temperature_Ph;
+within ThermoSysPro.Properties.Fluid;
+function Temperature_Ph
+  "Temperature computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.Temperature T "Temperature (K)";
+
+// fluid==1 - Water/Steam
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    T:=pro.T;
+
+  // C3H3F5
+  elseif fluid==2 then
+    pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(P=P, h=h);
+    //LogVariable(pro.x);
+    T:=pro.T;
+
+  // FlueGas
+  elseif fluid==3 then
+    /*
+    LogVariable(mode);
+    LogVariable(P);
+    LogVariable(h);
+    LogVariable(Xco2);
+    LogVariable(Xh2o);
+    LogVariable(Xo2);
+    LogVariable(Xso2);
+   */
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+
+    T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
+      PMF=P,
+      HMF=h,
+      Xco2=Xco2,
+      Xh2o=Xh2o,
+      Xo2=Xo2,
+      Xso2=Xso2);
+
+//    T := ThermoSysPro.Properties.FlueGases.FlueGases_T(P,h,Xco2,Xh2o,Xo2,Xso2);
+
+  // MoltenSalt
+  elseif fluid==4 then
+    T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h);
+
+  // Oil
+  elseif fluid==5 then
+    T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h);
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h);
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+      P,
+      h,
+      mode);
+    T:=pro.T;
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+  annotation(derivative=derTemperature_derP_derh);
+end Temperature_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/ThermalConductivity_Ph.mo b/ThermoSysPro/Properties/Fluid/ThermalConductivity_Ph.mo
index a4a304b55423a5828c72e026224095dca3da96ff..2eb743795587928bf0394e6dbdee7a04b2ec6a27 100644
--- a/ThermoSysPro/Properties/Fluid/ThermalConductivity_Ph.mo
+++ b/ThermoSysPro/Properties/Fluid/ThermalConductivity_Ph.mo
@@ -1,81 +1,81 @@
-within ThermoSysPro.Properties.Fluid;
-function ThermalConductivity_Ph
-  "Thermal Conductivity computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-
-  output Units.SI.ThermalConductivity k "Thermal Conductivity (W/m/K)";
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
-  if fluid==1 then
-    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-      P,
-      h,
-      mode);
-    k := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho=pro.d,T=pro.T,P=P,region=mode);
-
-  // C3H3F5
-  elseif fluid==2 then
-  //   k := ThermoSysPro.Properties.C3H3F5.ThermalConductivity_Ph__NonFonctionnel(
-  //     P=P, h=h);
-    assert(false, "?????????? fluid = 2: the function ThermalConductivity_Ph is not available; incorrect option ?????????");
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    k := ThermoSysPro.Properties.FlueGases.FlueGases_k(
-      PMF=P,
-      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-        PMF=P,
-        HMF=h,
-        Xco2=Xco2,
-        Xh2o=Xh2o,
-        Xo2=Xo2,
-        Xso2=Xso2),
-      Xco2=Xco2,
-      Xh2o=Xh2o,
-      Xo2=Xo2,
-      Xso2=Xso2);
-
-  // MoltenSalt
-  elseif fluid==4 then
-    k := ThermoSysPro.Properties.MoltenSalt.ThermalConductivity_T(T=
-      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-
-  // Oil
-  elseif fluid==5 then
-    k := ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(temp=
-      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    k := ThermoSysPro.Properties.DryAirIdealGas.ThermalConductivity_Trho(
-      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
-      rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
-        P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-      P,
-      h,
-      mode);
-    k := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(rho=pro.d,T=pro.T);
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end ThermalConductivity_Ph;
+within ThermoSysPro.Properties.Fluid;
+function ThermalConductivity_Ph
+  "Thermal Conductivity computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+
+  output Units.SI.ThermalConductivity k "Thermal Conductivity (W/m/K)";
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
+  if fluid==1 then
+    pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+      P,
+      h,
+      mode);
+    k := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho=pro.d,T=pro.T,P=P,region=mode);
+
+  // C3H3F5
+  elseif fluid==2 then
+  //   k := ThermoSysPro.Properties.C3H3F5.ThermalConductivity_Ph__NonFonctionnel(
+  //     P=P, h=h);
+    assert(false, "?????????? fluid = 2: the function ThermalConductivity_Ph is not available; incorrect option ?????????");
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    k := ThermoSysPro.Properties.FlueGases.FlueGases_k(
+      PMF=P,
+      TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+        PMF=P,
+        HMF=h,
+        Xco2=Xco2,
+        Xh2o=Xh2o,
+        Xo2=Xo2,
+        Xso2=Xso2),
+      Xco2=Xco2,
+      Xh2o=Xh2o,
+      Xo2=Xo2,
+      Xso2=Xso2);
+
+  // MoltenSalt
+  elseif fluid==4 then
+    k := ThermoSysPro.Properties.MoltenSalt.ThermalConductivity_T(T=
+      ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+
+  // Oil
+  elseif fluid==5 then
+    k := ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(temp=
+      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h));
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    k := ThermoSysPro.Properties.DryAirIdealGas.ThermalConductivity_Trho(
+      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
+      rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
+        P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+      P,
+      h,
+      mode);
+    k := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(rho=pro.d,T=pro.T);
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end ThermalConductivity_Ph;
diff --git a/ThermoSysPro/Properties/Fluid/ThermalConductivity_rhoT.mo b/ThermoSysPro/Properties/Fluid/ThermalConductivity_rhoT.mo
index b2abcb9b66cfe82e1f4297b88cd27c0dc5cb6814..3137ac4f55139c76181b1c3be4e529e7b0da9550 100644
--- a/ThermoSysPro/Properties/Fluid/ThermalConductivity_rhoT.mo
+++ b/ThermoSysPro/Properties/Fluid/ThermalConductivity_rhoT.mo
@@ -1,32 +1,32 @@
-within ThermoSysPro.Properties.Fluid;
-function ThermalConductivity_rhoT
-  "Thermal Conductivity computation for all fluids (inputs: rho,T, fluid)"
-
-  input Units.SI.Density rho "Density";
-  input Units.SI.Temperature T "Temperature";
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Integer region "region (valid values: 1,2,4)";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam  <br>7 - WaterSteamSimple </html>";
-
-  output Units.SI.ThermalConductivity k "Thermal Conductivity (W/m/K)";
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam  ///
-  if fluid==1 then
-    k := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho=rho,T=T,P=P,region=region);
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-    k := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(rho=rho,T=T);
-    //LogVariable(k);
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end ThermalConductivity_rhoT;
+within ThermoSysPro.Properties.Fluid;
+function ThermalConductivity_rhoT
+  "Thermal Conductivity computation for all fluids (inputs: rho,T, fluid)"
+
+  input Units.SI.Density rho "Density";
+  input Units.SI.Temperature T "Temperature";
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Integer region "region (valid values: 1,2,4)";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam  <br>7 - WaterSteamSimple </html>";
+
+  output Units.SI.ThermalConductivity k "Thermal Conductivity (W/m/K)";
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam  ///
+  if fluid==1 then
+    k := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho=rho,T=T,P=P,region=region);
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+    k := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(rho=rho,T=T);
+    //LogVariable(k);
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end ThermalConductivity_rhoT;
diff --git a/ThermoSysPro/Properties/Fluid/Water_sat_P.mo b/ThermoSysPro/Properties/Fluid/Water_sat_P.mo
index e3581d323c48cab0fd6620639c949b59e29dd6cc..797ee8061a0ee3b81ae8558584225f63fad4254e 100644
--- a/ThermoSysPro/Properties/Fluid/Water_sat_P.mo
+++ b/ThermoSysPro/Properties/Fluid/Water_sat_P.mo
@@ -1,51 +1,51 @@
-within ThermoSysPro.Properties.Fluid;
-function Water_sat_P
-  input Units.SI.AbsolutePressure P "Pressure";
-  input Integer fluid  "Fluid number - 1: IF97 - 7: SimpleWater";
-
-  output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-100,50},{-60,90}}, rotation=
-            0)));
-  output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat     annotation (Placement(
-        transformation(extent={{60,50},{100,90}}, rotation=0)));
-algorithm
-
-  if (fluid == 1) then
-    (lsat,vsat) := ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-  elseif (fluid == 7) then
-    (lsat,vsat) := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(P);
-  else
-    assert(false, "(lsat,vsat) : incorrect fluid number");
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Window(
-      x=0.06,
-      y=0.1,
-      width=0.75,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Water_sat_P;
+within ThermoSysPro.Properties.Fluid;
+function Water_sat_P
+  input Units.SI.AbsolutePressure P "Pressure";
+  input Integer fluid  "Fluid number - 1: IF97 - 7: SimpleWater";
+
+  output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-100,50},{-60,90}}, rotation=
+            0)));
+  output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat     annotation (Placement(
+        transformation(extent={{60,50},{100,90}}, rotation=0)));
+algorithm
+
+  if (fluid == 1) then
+    (lsat,vsat) := ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+  elseif (fluid == 7) then
+    (lsat,vsat) := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(P);
+  else
+    assert(false, "(lsat,vsat) : incorrect fluid number");
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Window(
+      x=0.06,
+      y=0.1,
+      width=0.75,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Water_sat_P;
diff --git a/ThermoSysPro/Properties/Fluid/derDensity_derP_derh.mo b/ThermoSysPro/Properties/Fluid/derDensity_derP_derh.mo
index 95db71dcf281881b37f3d038399e5912fd9db0ae..b81c30cc6226510c990194f6cd20cbd69d5eeaf3 100644
--- a/ThermoSysPro/Properties/Fluid/derDensity_derP_derh.mo
+++ b/ThermoSysPro/Properties/Fluid/derDensity_derP_derh.mo
@@ -1,90 +1,90 @@
-within ThermoSysPro.Properties.Fluid;
-function derDensity_derP_derh
-  "der(Density) computation for all fluids (inputs: P, h, der(P), der(h), fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_P "Pressure time derivative (J/(kg*s))";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-
-  output Real der_rho "Density time derivative (kg/(m3*s))";
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph der_pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-protected
-  Units.SI.Temperature T "Temperature (K)";
-  Real der_T "Temperature time derivative (K/s)";
-
-///annotation(derivative(order=2)=derderDensity_derderP_derderh);
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    der_pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph_der(p=P,h=h,mode=mode,p_der=der_P,h_der=der_h);
-    der_rho := der_pro.d;
-
-  // // C3H3F5
-  // elseif fluid==2 then
-  //   rho := ThermoSysPro.Properties.C3H3F5.Density_Ph(P=P, h=h);
-  //
-  // // FlueGas
-   elseif fluid==3 then
-     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-  //   rho := ThermoSysPro.Properties.FlueGases.FlueGases_rho(
-  //     PMF=P,
-  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-  //       PMF=P,
-  //       HMF=h,
-  //       Xco2=Xco2,
-  //       Xh2o=Xh2o,
-  //       Xo2=Xo2,
-  //       Xso2=Xso2),
-  //     Xco2=Xco2,
-  //     Xh2o=Xh2o,
-  //     Xo2=Xo2,
-  //     Xso2=Xso2);
-
-  // MoltenSalt
-  //elseif fluid==4 then
-  elseif fluid==4 then
-    der_T := ThermoSysPro.Properties.MoltenSalt.derTemperature_derh(h=h, der_h=der_h);
-    der_rho := ThermoSysPro.Properties.MoltenSalt.derDensity_derT(T=T, der_T=der_T);
-
-  // Oil
-  elseif fluid==5 then
-    // der_rho := ThermoSysPro.Properties.Oil_TherminolVP1.Density_dert(
-    //   temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
-    //   der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
-    T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h);
-    der_T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h);
-    der_rho := ThermoSysPro.Properties.Oil_TherminolVP1.Density_derT(temp=T, der_temp=der_T);
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    der_rho := ThermoSysPro.Properties.DryAirIdealGas.derDensity_derP_derT(P=P,
-      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
-      der_P=der_P,
-      der_T=ThermoSysPro.Properties.DryAirIdealGas.derTemperature_derh(h=h,der_h=der_h));
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-    der_pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph_der( p=P,h=h,mode=mode,p_der=der_P,h_der=der_h);
-    der_rho := der_pro.d;
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derDensity_derP_derh;
+within ThermoSysPro.Properties.Fluid;
+function derDensity_derP_derh
+  "der(Density) computation for all fluids (inputs: P, h, der(P), der(h), fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_P "Pressure time derivative (J/(kg*s))";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+
+  output Real der_rho "Density time derivative (kg/(m3*s))";
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph der_pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+protected
+  Units.SI.Temperature T "Temperature (K)";
+  Real der_T "Temperature time derivative (K/s)";
+
+///annotation(derivative(order=2)=derderDensity_derderP_derderh);
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    der_pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph_der(p=P,h=h,mode=mode,p_der=der_P,h_der=der_h);
+    der_rho := der_pro.d;
+
+  // // C3H3F5
+  // elseif fluid==2 then
+  //   rho := ThermoSysPro.Properties.C3H3F5.Density_Ph(P=P, h=h);
+  //
+  // // FlueGas
+   elseif fluid==3 then
+     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+  //   rho := ThermoSysPro.Properties.FlueGases.FlueGases_rho(
+  //     PMF=P,
+  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+  //       PMF=P,
+  //       HMF=h,
+  //       Xco2=Xco2,
+  //       Xh2o=Xh2o,
+  //       Xo2=Xo2,
+  //       Xso2=Xso2),
+  //     Xco2=Xco2,
+  //     Xh2o=Xh2o,
+  //     Xo2=Xo2,
+  //     Xso2=Xso2);
+
+  // MoltenSalt
+  //elseif fluid==4 then
+  elseif fluid==4 then
+    der_T := ThermoSysPro.Properties.MoltenSalt.derTemperature_derh(h=h, der_h=der_h);
+    der_rho := ThermoSysPro.Properties.MoltenSalt.derDensity_derT(T=T, der_T=der_T);
+
+  // Oil
+  elseif fluid==5 then
+    // der_rho := ThermoSysPro.Properties.Oil_TherminolVP1.Density_dert(
+    //   temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
+    //   der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
+    T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h);
+    der_T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h);
+    der_rho := ThermoSysPro.Properties.Oil_TherminolVP1.Density_derT(temp=T, der_temp=der_T);
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    der_rho := ThermoSysPro.Properties.DryAirIdealGas.derDensity_derP_derT(P=P,
+      T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
+      der_P=der_P,
+      der_T=ThermoSysPro.Properties.DryAirIdealGas.derTemperature_derh(h=h,der_h=der_h));
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+    der_pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph_der( p=P,h=h,mode=mode,p_der=der_P,h_der=der_h);
+    der_rho := der_pro.d;
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derDensity_derP_derh;
diff --git a/ThermoSysPro/Properties/Fluid/derDensity_derh_derP_derh.mo b/ThermoSysPro/Properties/Fluid/derDensity_derh_derP_derh.mo
index ad3fb7e51dcee3697b69fbf39d5ac62bea6bf373..1d1bb632b29ff530c9cf8c3fe130fad783c2f53d 100644
--- a/ThermoSysPro/Properties/Fluid/derDensity_derh_derP_derh.mo
+++ b/ThermoSysPro/Properties/Fluid/derDensity_derh_derP_derh.mo
@@ -1,66 +1,66 @@
-within ThermoSysPro.Properties.Fluid;
-function derDensity_derh_derP_derh
-  "der(Density derivative w.r.t enthalpy) computation for all fluids (inputs: P, h, der(P), der(h), fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_P "Pressure time derivative (J/(kg*s))";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-
-  output Real der_ddhp "Time derivative of Density derivative by enthalpy";
-
-protected
-  Units.SI.Duration dt=1;
-  Units.SI.AbsolutePressure delta_P=0.01*P;
-  Units.SI.SpecificEnthalpy delta_h=0.01*h;
-
-///annotation(derivative(order=2)=derderDensity_derh_derderP_derderh);
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    //
-
-  // C3H3F5
-  elseif fluid==2 then
-    //
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    //
-
-  // MoltenSalt
-  elseif fluid==4 then
-    //
-
-  // Oil
-  elseif fluid==5 then
-    der_ddhp := (ThermoSysPro.Properties.Fluid.Density_derh_Ph(P=P+delta_P,h=h+delta_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2)
-      - ThermoSysPro.Properties.Fluid.Density_derh_Ph(P=P-delta_P,h=h-delta_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2))
-      / dt;
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    //
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-   //
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derDensity_derh_derP_derh;
+within ThermoSysPro.Properties.Fluid;
+function derDensity_derh_derP_derh
+  "der(Density derivative w.r.t enthalpy) computation for all fluids (inputs: P, h, der(P), der(h), fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_P "Pressure time derivative (J/(kg*s))";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+
+  output Real der_ddhp "Time derivative of Density derivative by enthalpy";
+
+protected
+  Units.SI.Duration dt=1;
+  Units.SI.AbsolutePressure delta_P=0.01*P;
+  Units.SI.SpecificEnthalpy delta_h=0.01*h;
+
+///annotation(derivative(order=2)=derderDensity_derh_derderP_derderh);
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    //
+
+  // C3H3F5
+  elseif fluid==2 then
+    //
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    //
+
+  // MoltenSalt
+  elseif fluid==4 then
+    //
+
+  // Oil
+  elseif fluid==5 then
+    der_ddhp := (ThermoSysPro.Properties.Fluid.Density_derh_Ph(P=P+delta_P,h=h+delta_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2)
+      - ThermoSysPro.Properties.Fluid.Density_derh_Ph(P=P-delta_P,h=h-delta_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2))
+      / dt;
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    //
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+   //
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derDensity_derh_derP_derh;
diff --git a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh.mo b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh.mo
index f6b652aff515dd7de6b0a7b013517fd0ae9c91ec..03dc4510efe1dd1c0bd6338f12e483385723e539 100644
--- a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh.mo
+++ b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh.mo
@@ -1,117 +1,117 @@
-within ThermoSysPro.Properties.Fluid;
-function derDynamicViscosity_derP_derh
-  "Dynamic Viscosity computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_rho "Density time derivative";
-  input Real der_T "Temperature time derivative";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-
-  output Real der_mu "Dynamic Viscosity time derivative";
-
-protected
-  constant Real Viscosity_c0 = 0.07551475951333098;
-  constant Real Viscosity_c1 = - 0.00027760397992950003;
-  constant Real Viscosity_c2 = 0.00000034888693;
-  constant Real Viscosity_c3 = - 0.00000000014739999;
-  Units.SI.Duration dt=1;
-  Units.SI.AbsolutePressure delta_P=0.001*P;
-  Units.SI.SpecificEnthalpy delta_h=0.001*h;
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
-  if fluid==1 then
-
-    //der_mu := 0.0;
-
-     der_mu :=(ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(
-     P=P + delta_P,
-     h=h + delta_h,
-     fluid=fluid,
-     mode=mode,
-     Xco2=Xco2,
-     Xh2o=Xh2o,
-     Xo2=Xo2,
-     Xso2=Xso2) - ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(
-     P=P - delta_P,
-     h=h - delta_h,
-     fluid=fluid,
-     mode=mode,
-     Xco2=Xco2,
-     Xh2o=Xh2o,
-     Xo2=Xo2,
-     Xso2=Xso2))/dt;
-
-  // C3H3F5
-  // elseif fluid==2 then
-  //   mu := ThermoSysPro.Properties.C3H3F5.DynamicViscosity_Ph__NonFonctionnel(P=
-  //     P, h=h);
-
-  // FlueGas
-  elseif fluid==3 then
-  // if fluid==3 then
-     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-  //   mu := ThermoSysPro.Properties.FlueGases.FlueGases_mu(
-  //     PMF=P,
-  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-  //       PMF=P,
-  //       HMF=h,
-  //       Xco2=Xco2,
-  //       Xh2o=Xh2o,
-  //       Xo2=Xo2,
-  //       Xso2=Xso2),
-  //     Xco2=Xco2,
-  //     Xh2o=Xh2o,
-  //     Xo2=Xo2,
-  //     Xso2=Xso2);
-
-  // MoltenSalt
-  // elseif fluid==4 then
-  //   mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T=
-  //     ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-
-  // Oil
-  //elseif fluid==5 then
-  elseif fluid==4 then
-    //der_mu := Viscosity_c1*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h) + 2*Viscosity_c2*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h)*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h) + 3*Viscosity_c3*(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))^2*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h);
-/*    der_mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_dert(
-      temp=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h),
-      der_temp=ThermoSysPro.Properties.MoltenSalt.Temperature_derh(h=h,der_h=der_h));
-*/
-  elseif fluid==5 then
-/*    der_mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_dert(
-      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
-      der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
-*/
-  // Dry Air Ideal Gas
-  // elseif fluid==6 then
-  //   mu := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
-  //     T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
-  //     rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
-  //       P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
-
-  elseif fluid==7 then
-    //der_mu := 0.0001;
-    //
-
-   //LogVariable(der_mu);
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derDynamicViscosity_derP_derh;
+within ThermoSysPro.Properties.Fluid;
+function derDynamicViscosity_derP_derh
+  "Dynamic Viscosity computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_rho "Density time derivative";
+  input Real der_T "Temperature time derivative";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+
+  output Real der_mu "Dynamic Viscosity time derivative";
+
+protected
+  constant Real Viscosity_c0 = 0.07551475951333098;
+  constant Real Viscosity_c1 = - 0.00027760397992950003;
+  constant Real Viscosity_c2 = 0.00000034888693;
+  constant Real Viscosity_c3 = - 0.00000000014739999;
+  Units.SI.Duration dt=1;
+  Units.SI.AbsolutePressure delta_P=0.001*P;
+  Units.SI.SpecificEnthalpy delta_h=0.001*h;
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
+  if fluid==1 then
+
+    //der_mu := 0.0;
+
+     der_mu :=(ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(
+     P=P + delta_P,
+     h=h + delta_h,
+     fluid=fluid,
+     mode=mode,
+     Xco2=Xco2,
+     Xh2o=Xh2o,
+     Xo2=Xo2,
+     Xso2=Xso2) - ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(
+     P=P - delta_P,
+     h=h - delta_h,
+     fluid=fluid,
+     mode=mode,
+     Xco2=Xco2,
+     Xh2o=Xh2o,
+     Xo2=Xo2,
+     Xso2=Xso2))/dt;
+
+  // C3H3F5
+  // elseif fluid==2 then
+  //   mu := ThermoSysPro.Properties.C3H3F5.DynamicViscosity_Ph__NonFonctionnel(P=
+  //     P, h=h);
+
+  // FlueGas
+  elseif fluid==3 then
+  // if fluid==3 then
+     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+  //   mu := ThermoSysPro.Properties.FlueGases.FlueGases_mu(
+  //     PMF=P,
+  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+  //       PMF=P,
+  //       HMF=h,
+  //       Xco2=Xco2,
+  //       Xh2o=Xh2o,
+  //       Xo2=Xo2,
+  //       Xso2=Xso2),
+  //     Xco2=Xco2,
+  //     Xh2o=Xh2o,
+  //     Xo2=Xo2,
+  //     Xso2=Xso2);
+
+  // MoltenSalt
+  // elseif fluid==4 then
+  //   mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T=
+  //     ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+
+  // Oil
+  //elseif fluid==5 then
+  elseif fluid==4 then
+    //der_mu := Viscosity_c1*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h) + 2*Viscosity_c2*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h)*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h) + 3*Viscosity_c3*(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))^2*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h);
+/*    der_mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_dert(
+      temp=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h),
+      der_temp=ThermoSysPro.Properties.MoltenSalt.Temperature_derh(h=h,der_h=der_h));
+*/
+  elseif fluid==5 then
+/*    der_mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_dert(
+      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
+      der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
+*/
+  // Dry Air Ideal Gas
+  // elseif fluid==6 then
+  //   mu := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
+  //     T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
+  //     rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
+  //       P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
+
+  elseif fluid==7 then
+    //der_mu := 0.0001;
+    //
+
+   //LogVariable(der_mu);
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derDynamicViscosity_derP_derh;
diff --git a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh_old.mo b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh_old.mo
index fabd26ec6eda87cd60e52a877e504f6971ec7b6e..8fb979e22167ae0480b108a607fa7845f6bdd243 100644
--- a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh_old.mo
+++ b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh_old.mo
@@ -1,82 +1,82 @@
-within ThermoSysPro.Properties.Fluid;
-function derDynamicViscosity_derP_derh_old
-  "Dynamic Viscosity computation for all fluids (inputs: P, h, fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_P "Pressure time derivative";
-  input Real der_h "Specific Enthalpy time derivative";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-
-  output Real der_mu "Dynamic Viscosity time derivative";
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
-        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
-
-algorithm
-  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
-//   if fluid==1 then
-//    der_mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_dert(
-//      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
-//      der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
-
-  //   pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
-  //   mu := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
-
-  // C3H3F5
-  // elseif fluid==2 then
-  //   mu := ThermoSysPro.Properties.C3H3F5.DynamicViscosity_Ph__NonFonctionnel(P=
-  //     P, h=h);
-
-  // FlueGas
-  // elseif fluid==3 then
-  //   assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-  //   mu := ThermoSysPro.Properties.FlueGases.FlueGases_mu(
-  //     PMF=P,
-  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-  //       PMF=P,
-  //       HMF=h,
-  //       Xco2=Xco2,
-  //       Xh2o=Xh2o,
-  //       Xo2=Xo2,
-  //       Xso2=Xso2),
-  //     Xco2=Xco2,
-  //     Xh2o=Xh2o,
-  //     Xo2=Xo2,
-  //     Xso2=Xso2);
-
-  // MoltenSalt
-  // elseif fluid==4 then
-  //   mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T=
-  //     ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-
-  // Oil
-  //elseif fluid==5 then
-  if fluid==5 then
-    der_mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_derT(
-      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
-      der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
-
-  // Dry Air Ideal Gas
-  // elseif fluid==6 then
-  //   mu := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
-  //     T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
-  //     rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
-  //       P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derDynamicViscosity_derP_derh_old;
+within ThermoSysPro.Properties.Fluid;
+function derDynamicViscosity_derP_derh_old
+  "Dynamic Viscosity computation for all fluids (inputs: P, h, fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_P "Pressure time derivative";
+  input Real der_h "Specific Enthalpy time derivative";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+
+  output Real der_mu "Dynamic Viscosity time derivative";
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (Placement(
+        transformation(extent={{-80,40},{-40,80}}, rotation=0)));
+
+algorithm
+  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
+//   if fluid==1 then
+//    der_mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_dert(
+//      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
+//      der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
+
+  //   pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
+  //   mu := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=pro.d,T=pro.T);
+
+  // C3H3F5
+  // elseif fluid==2 then
+  //   mu := ThermoSysPro.Properties.C3H3F5.DynamicViscosity_Ph__NonFonctionnel(P=
+  //     P, h=h);
+
+  // FlueGas
+  // elseif fluid==3 then
+  //   assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+  //   mu := ThermoSysPro.Properties.FlueGases.FlueGases_mu(
+  //     PMF=P,
+  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+  //       PMF=P,
+  //       HMF=h,
+  //       Xco2=Xco2,
+  //       Xh2o=Xh2o,
+  //       Xo2=Xo2,
+  //       Xso2=Xso2),
+  //     Xco2=Xco2,
+  //     Xh2o=Xh2o,
+  //     Xo2=Xo2,
+  //     Xso2=Xso2);
+
+  // MoltenSalt
+  // elseif fluid==4 then
+  //   mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T=
+  //     ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+
+  // Oil
+  //elseif fluid==5 then
+  if fluid==5 then
+    der_mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_derT(
+      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
+      der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
+
+  // Dry Air Ideal Gas
+  // elseif fluid==6 then
+  //   mu := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
+  //     T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
+  //     rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
+  //       P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derDynamicViscosity_derP_derh_old;
diff --git a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derT_derrho.mo b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derT_derrho.mo
index bb41a62aa111527e9e6d3f9152b5366cf1596fdb..fc3d1e1f897be301aca18522e6326ba44b97a587 100644
--- a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derT_derrho.mo
+++ b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derT_derrho.mo
@@ -1,96 +1,96 @@
-within ThermoSysPro.Properties.Fluid;
-function derDynamicViscosity_derT_derrho
-  "Dynamic Viscosity computation for all fluids"
-
-  input Units.SI.Density rho "Density";
-  input Units.SI.Temperature T "Temperature";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_rho "Density time derivative";
-  input Real der_T "Temperature time derivative";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-
-  output Real der_mu "Dynamic Viscosity time derivative";
-
-protected
-  constant Real Viscosity_c0 = 0.07551475951333098;
-  constant Real Viscosity_c1 = - 0.00027760397992950003;
-  constant Real Viscosity_c2 = 0.00000034888693;
-  constant Real Viscosity_c3 = - 0.00000000014739999;
-
-  //Modelica.SIunits.Duration dt=1;
-  //Modelica.SIunits.AbsolutePressure delta_rho = 0.01*rho;
-  //Modelica.SIunits.SpecificEnthalpy delta_T = 0.01*T;
-
-algorithm
-  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
-  //if fluid==1 then
-
-    //der_mu := 0.0;
-
-  // C3H3F5
-  // elseif fluid==2 then
-  //   mu := ThermoSysPro.Properties.C3H3F5.DynamicViscosity_Ph__NonFonctionnel(P=
-  //     P, h=h);
-
-  // FlueGas
-  // elseif fluid==3 then
-  if fluid==3 then
-     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-  //   mu := ThermoSysPro.Properties.FlueGases.FlueGases_mu(
-  //     PMF=P,
-  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
-  //       PMF=P,
-  //       HMF=h,
-  //       Xco2=Xco2,
-  //       Xh2o=Xh2o,
-  //       Xo2=Xo2,
-  //       Xso2=Xso2),
-  //     Xco2=Xco2,
-  //     Xh2o=Xh2o,
-  //     Xo2=Xo2,
-  //     Xso2=Xso2);
-
-  // MoltenSalt
-  // elseif fluid==4 then
-  //   mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T=
-  //     ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
-
-  // Oil
-  //elseif fluid==5 then
-  elseif fluid==4 then
-    //der_mu := Viscosity_c1*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h) + 2*Viscosity_c2*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h)*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h) + 3*Viscosity_c3*(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))^2*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h);
-/*    der_mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_dert(
-      temp=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h),
-      der_temp=ThermoSysPro.Properties.MoltenSalt.Temperature_derh(h=h,der_h=der_h));
-*/
-  elseif fluid==5 then
-/*    der_mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_dert(
-      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
-      der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
-*/
-  // Dry Air Ideal Gas
-  // elseif fluid==6 then
-  //   mu := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
-  //     T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
-  //     rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
-  //       P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
-
-  elseif fluid==7 then
-    //der_mu := 0.0001;
-    //
-
-   //LogVariable(der_mu);
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derDynamicViscosity_derT_derrho;
+within ThermoSysPro.Properties.Fluid;
+function derDynamicViscosity_derT_derrho
+  "Dynamic Viscosity computation for all fluids"
+
+  input Units.SI.Density rho "Density";
+  input Units.SI.Temperature T "Temperature";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_rho "Density time derivative";
+  input Real der_T "Temperature time derivative";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+
+  output Real der_mu "Dynamic Viscosity time derivative";
+
+protected
+  constant Real Viscosity_c0 = 0.07551475951333098;
+  constant Real Viscosity_c1 = - 0.00027760397992950003;
+  constant Real Viscosity_c2 = 0.00000034888693;
+  constant Real Viscosity_c3 = - 0.00000000014739999;
+
+  //Modelica.SIunits.Duration dt=1;
+  //Modelica.SIunits.AbsolutePressure delta_rho = 0.01*rho;
+  //Modelica.SIunits.SpecificEnthalpy delta_T = 0.01*T;
+
+algorithm
+  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
+  //if fluid==1 then
+
+    //der_mu := 0.0;
+
+  // C3H3F5
+  // elseif fluid==2 then
+  //   mu := ThermoSysPro.Properties.C3H3F5.DynamicViscosity_Ph__NonFonctionnel(P=
+  //     P, h=h);
+
+  // FlueGas
+  // elseif fluid==3 then
+  if fluid==3 then
+     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+  //   mu := ThermoSysPro.Properties.FlueGases.FlueGases_mu(
+  //     PMF=P,
+  //     TMF=ThermoSysPro.Properties.FlueGases.FlueGases_T(
+  //       PMF=P,
+  //       HMF=h,
+  //       Xco2=Xco2,
+  //       Xh2o=Xh2o,
+  //       Xo2=Xo2,
+  //       Xso2=Xso2),
+  //     Xco2=Xco2,
+  //     Xh2o=Xh2o,
+  //     Xo2=Xo2,
+  //     Xso2=Xso2);
+
+  // MoltenSalt
+  // elseif fluid==4 then
+  //   mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T=
+  //     ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h));
+
+  // Oil
+  //elseif fluid==5 then
+  elseif fluid==4 then
+    //der_mu := Viscosity_c1*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h) + 2*Viscosity_c2*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h)*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h) + 3*Viscosity_c3*(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h))^2*ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h);
+/*    der_mu := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_dert(
+      temp=ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h),
+      der_temp=ThermoSysPro.Properties.MoltenSalt.Temperature_derh(h=h,der_h=der_h));
+*/
+  elseif fluid==5 then
+/*    der_mu := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_dert(
+      temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=h),
+      der_temp=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h));
+*/
+  // Dry Air Ideal Gas
+  // elseif fluid==6 then
+  //   mu := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(
+  //     T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h),
+  //     rho=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(
+  //       P=P, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h)));
+
+  elseif fluid==7 then
+    //der_mu := 0.0001;
+    //
+
+   //LogVariable(der_mu);
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derDynamicViscosity_derT_derrho;
diff --git a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derrho_derT.mo b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derrho_derT.mo
index ef4dd1a256b2fb29dff91fb2b59ab16feb53e70c..88f988546574f84bca9d9560a5ffb7a1660bc196 100644
--- a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derrho_derT.mo
+++ b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derrho_derT.mo
@@ -1,51 +1,51 @@
-within ThermoSysPro.Properties.Fluid;
-function derDynamicViscosity_derrho_derT
-  "Dynamic Viscosity computation for all fluids"
-
-  input Units.SI.Density rho "Density";
-  input Units.SI.Temperature T "Temperature";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam  <br>7 - WaterSteamSimple </html>";
-  input Real der_rho "Density time derivative";
-  input Real der_T "Temperature time derivative";
-
-  output Real der_mu "Dynamic Viscosity time derivative";
-
-  //Modelica.SIunits.Duration dt=1;
-  //Modelica.SIunits.AbsolutePressure delta_rho = 0.01*rho;
-  //Modelica.SIunits.SpecificEnthalpy delta_T = 0.01*T;
-
-algorithm
-  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
-  if fluid==1 then
-
-    der_mu := 0.0;
-
-//     der_mu :=(ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(
-//     P=P + delta_P,
-//     h=h + delta_h,
-//     fluid=fluid,
-//     mode=mode,
-//     Xco2=Xco2,
-//     Xh2o=Xh2o,
-//     Xo2=Xo2,
-//     Xso2=Xso2) - ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(
-//     P=P - delta_P,
-//     h=h - delta_h,
-//     fluid=fluid,
-//     mode=mode,
-//     Xco2=Xco2,
-//     Xh2o=Xh2o,
-//     Xo2=Xo2,
-//     Xso2=Xso2))/dt;
-
-  elseif fluid==7 then
-    //der_mu := 0.0001;
-    //
-
-   //LogVariable(der_mu);
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derDynamicViscosity_derrho_derT;
+within ThermoSysPro.Properties.Fluid;
+function derDynamicViscosity_derrho_derT
+  "Dynamic Viscosity computation for all fluids"
+
+  input Units.SI.Density rho "Density";
+  input Units.SI.Temperature T "Temperature";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam  <br>7 - WaterSteamSimple </html>";
+  input Real der_rho "Density time derivative";
+  input Real der_T "Temperature time derivative";
+
+  output Real der_mu "Dynamic Viscosity time derivative";
+
+  //Modelica.SIunits.Duration dt=1;
+  //Modelica.SIunits.AbsolutePressure delta_rho = 0.01*rho;
+  //Modelica.SIunits.SpecificEnthalpy delta_T = 0.01*T;
+
+algorithm
+  // Water/Steam  /// FONCTIONNE EN DIPHASIQUE ???
+  if fluid==1 then
+
+    der_mu := 0.0;
+
+//     der_mu :=(ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(
+//     P=P + delta_P,
+//     h=h + delta_h,
+//     fluid=fluid,
+//     mode=mode,
+//     Xco2=Xco2,
+//     Xh2o=Xh2o,
+//     Xo2=Xo2,
+//     Xso2=Xso2) - ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(
+//     P=P - delta_P,
+//     h=h - delta_h,
+//     fluid=fluid,
+//     mode=mode,
+//     Xco2=Xco2,
+//     Xh2o=Xh2o,
+//     Xo2=Xo2,
+//     Xso2=Xso2))/dt;
+
+  elseif fluid==7 then
+    //der_mu := 0.0001;
+    //
+
+   //LogVariable(der_mu);
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derDynamicViscosity_derrho_derT;
diff --git a/ThermoSysPro/Properties/Fluid/derSpecificEnthalpy_derP_derT.mo b/ThermoSysPro/Properties/Fluid/derSpecificEnthalpy_derP_derT.mo
index 542799fa4e00e8ca3435e02cd538ba8123ee9e89..e04c7924713571f3beee27b5816958350af1662d 100644
--- a/ThermoSysPro/Properties/Fluid/derSpecificEnthalpy_derP_derT.mo
+++ b/ThermoSysPro/Properties/Fluid/derSpecificEnthalpy_derP_derT.mo
@@ -1,110 +1,110 @@
-within ThermoSysPro.Properties.Fluid;
-function derSpecificEnthalpy_derP_derT
-  "der(Specific enthalpy) computation for all fluids (inputs: P, h, der(P), der(T), fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.Temperature T "Temperature (K)";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_P "Pressure time derivative";
-  input Real der_T "Temperature time derivative";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-
-  output Real der_h "Specific enthalpy time derivative";
-
-protected
-  Units.SI.Duration dt=1;
-  Units.SI.AbsolutePressure delta_P=0.001*P;
-  Units.SI.TemperatureDifference delta_T=0.01*T;
-
-/////////////////////////////////////////////////////////////////
-  // Water/Steam, C3H3F5, FlueGas, MoltenSalt, Oil, DryAirIdealGas
-
-algorithm
-  // // Water/Steam
-  if fluid == 1 then
-  //   h := ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(p=P, T=T, mode=mode);
-
-    der_h :=(ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(
-    P=P + delta_P,
-    T=T + delta_T,
-    fluid=fluid,
-    mode=mode,
-    Xco2=Xco2,
-    Xh2o=Xh2o,
-    Xo2=Xo2,
-    Xso2=Xso2) - ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(
-    P=P - delta_P,
-    T=T - delta_T,
-    fluid=fluid,
-    mode=mode,
-    Xco2=Xco2,
-    Xh2o=Xh2o,
-    Xo2=Xo2,
-    Xso2=Xso2))/dt;
-
-  //  LogVariable(der_h);
-
-  // // C3H3F5
-  // elseif fluid==2 then
-  //   T := ThermoSysPro.Properties.C3H3F5.Temperature_Ph(P=P, h=h);
-  //
-
-  // // FlueGas
-  elseif fluid==3 then
-  //if fluid==3 then
-     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-  //   T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
-  //     PMF=P,
-  //     HMF=h,
-  //     Xco2=Xco2,
-  //     Xh2o=Xh2o,
-  //     Xo2=Xo2,
-  //     Xso2=Xso2);
-
-    der_h :=(ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(
-    P=P + delta_P,
-    T=T + delta_T,
-    fluid=fluid,
-    mode=mode,
-    Xco2=Xco2,
-    Xh2o=Xh2o,
-    Xo2=Xo2,
-    Xso2=Xso2) - ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(
-    P=P - delta_P,
-    T=T - delta_T,
-    fluid=fluid,
-    mode=mode,
-    Xco2=Xco2,
-    Xh2o=Xh2o,
-    Xo2=Xo2,
-    Xso2=Xso2))/dt;
-
-  // // MoltenSalt
-  // elseif fluid==4 then
-  //   h := ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T=T);
-    //der_h :=  1e-9;
-
-  // Oil
-  //elseif fluid==5 then
-  elseif fluid==5 then
-    der_h :=ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_derT(temp=T,
-      der_temp=der_T);
-
-  // // Dry Air Ideal Gas
-  // elseif fluid==6 then
-  //   h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T=T);
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derSpecificEnthalpy_derP_derT;
+within ThermoSysPro.Properties.Fluid;
+function derSpecificEnthalpy_derP_derT
+  "der(Specific enthalpy) computation for all fluids (inputs: P, h, der(P), der(T), fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.Temperature T "Temperature (K)";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_P "Pressure time derivative";
+  input Real der_T "Temperature time derivative";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+
+  output Real der_h "Specific enthalpy time derivative";
+
+protected
+  Units.SI.Duration dt=1;
+  Units.SI.AbsolutePressure delta_P=0.001*P;
+  Units.SI.TemperatureDifference delta_T=0.01*T;
+
+/////////////////////////////////////////////////////////////////
+  // Water/Steam, C3H3F5, FlueGas, MoltenSalt, Oil, DryAirIdealGas
+
+algorithm
+  // // Water/Steam
+  if fluid == 1 then
+  //   h := ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(p=P, T=T, mode=mode);
+
+    der_h :=(ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(
+    P=P + delta_P,
+    T=T + delta_T,
+    fluid=fluid,
+    mode=mode,
+    Xco2=Xco2,
+    Xh2o=Xh2o,
+    Xo2=Xo2,
+    Xso2=Xso2) - ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(
+    P=P - delta_P,
+    T=T - delta_T,
+    fluid=fluid,
+    mode=mode,
+    Xco2=Xco2,
+    Xh2o=Xh2o,
+    Xo2=Xo2,
+    Xso2=Xso2))/dt;
+
+  //  LogVariable(der_h);
+
+  // // C3H3F5
+  // elseif fluid==2 then
+  //   T := ThermoSysPro.Properties.C3H3F5.Temperature_Ph(P=P, h=h);
+  //
+
+  // // FlueGas
+  elseif fluid==3 then
+  //if fluid==3 then
+     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+  //   T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
+  //     PMF=P,
+  //     HMF=h,
+  //     Xco2=Xco2,
+  //     Xh2o=Xh2o,
+  //     Xo2=Xo2,
+  //     Xso2=Xso2);
+
+    der_h :=(ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(
+    P=P + delta_P,
+    T=T + delta_T,
+    fluid=fluid,
+    mode=mode,
+    Xco2=Xco2,
+    Xh2o=Xh2o,
+    Xo2=Xo2,
+    Xso2=Xso2) - ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(
+    P=P - delta_P,
+    T=T - delta_T,
+    fluid=fluid,
+    mode=mode,
+    Xco2=Xco2,
+    Xh2o=Xh2o,
+    Xo2=Xo2,
+    Xso2=Xso2))/dt;
+
+  // // MoltenSalt
+  // elseif fluid==4 then
+  //   h := ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T=T);
+    //der_h :=  1e-9;
+
+  // Oil
+  //elseif fluid==5 then
+  elseif fluid==5 then
+    der_h :=ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_derT(temp=T,
+      der_temp=der_T);
+
+  // // Dry Air Ideal Gas
+  // elseif fluid==6 then
+  //   h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T=T);
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derSpecificEnthalpy_derP_derT;
diff --git a/ThermoSysPro/Properties/Fluid/derSpecificInternalEnergy_derP_derh.mo b/ThermoSysPro/Properties/Fluid/derSpecificInternalEnergy_derP_derh.mo
index c586acd77756feeb0409a96139c07ab9306d54ea..5a583a7ff3c819a86ccb7dfbf98f06ee44496459 100644
--- a/ThermoSysPro/Properties/Fluid/derSpecificInternalEnergy_derP_derh.mo
+++ b/ThermoSysPro/Properties/Fluid/derSpecificInternalEnergy_derP_derh.mo
@@ -1,52 +1,52 @@
-within ThermoSysPro.Properties.Fluid;
-function derSpecificInternalEnergy_derP_derh
-  "der(Specific Internal Energy) computation for all fluids (inputs: P, h, der(P), der(h), fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_P "Pressure time derivative (J/(kg*s))";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-
-  output Real der_u "Specific Internal Energy time derivative (J/kg/s)";
-
-protected
-  Units.SI.Duration dt=1;
-  Units.SI.AbsolutePressure delta_P=0.01*P;
-  Units.SI.SpecificEnthalpy delta_h=0.01*h;
-
-algorithm
-  // Water/Steam, C3H3F5, FlueGas, MoltenSalt, Oil, DryAirIdealGas
-
-    der_u :=(ThermoSysPro.Properties.Fluid.SpecificInternalEnergy_Ph_DO_NOT_USE(
-    P=P + delta_P,
-    h=h + delta_h,
-    fluid=fluid,
-    mode=mode,
-    Xco2=Xco2,
-    Xh2o=Xh2o,
-    Xo2=Xo2,
-    Xso2=Xso2) -
-    ThermoSysPro.Properties.Fluid.SpecificInternalEnergy_Ph_DO_NOT_USE(
-    P=P - delta_P,
-    h=h - delta_h,
-    fluid=fluid,
-    mode=mode,
-    Xco2=Xco2,
-    Xh2o=Xh2o,
-    Xo2=Xo2,
-    Xso2=Xso2))/dt;
-
-  assert(fluid==1 or fluid==2 or fluid==3 or fluid==4 or fluid==5 or fluid==6, "incorrect fluid number");  ///
-
-end derSpecificInternalEnergy_derP_derh;
+within ThermoSysPro.Properties.Fluid;
+function derSpecificInternalEnergy_derP_derh
+  "der(Specific Internal Energy) computation for all fluids (inputs: P, h, der(P), der(h), fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_P "Pressure time derivative (J/(kg*s))";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+
+  output Real der_u "Specific Internal Energy time derivative (J/kg/s)";
+
+protected
+  Units.SI.Duration dt=1;
+  Units.SI.AbsolutePressure delta_P=0.01*P;
+  Units.SI.SpecificEnthalpy delta_h=0.01*h;
+
+algorithm
+  // Water/Steam, C3H3F5, FlueGas, MoltenSalt, Oil, DryAirIdealGas
+
+    der_u :=(ThermoSysPro.Properties.Fluid.SpecificInternalEnergy_Ph_DO_NOT_USE(
+    P=P + delta_P,
+    h=h + delta_h,
+    fluid=fluid,
+    mode=mode,
+    Xco2=Xco2,
+    Xh2o=Xh2o,
+    Xo2=Xo2,
+    Xso2=Xso2) -
+    ThermoSysPro.Properties.Fluid.SpecificInternalEnergy_Ph_DO_NOT_USE(
+    P=P - delta_P,
+    h=h - delta_h,
+    fluid=fluid,
+    mode=mode,
+    Xco2=Xco2,
+    Xh2o=Xh2o,
+    Xo2=Xo2,
+    Xso2=Xso2))/dt;
+
+  assert(fluid==1 or fluid==2 or fluid==3 or fluid==4 or fluid==5 or fluid==6, "incorrect fluid number");  ///
+
+end derSpecificInternalEnergy_derP_derh;
diff --git a/ThermoSysPro/Properties/Fluid/derTemperature_derP_derh.mo b/ThermoSysPro/Properties/Fluid/derTemperature_derP_derh.mo
index 32e71101d7ab7210db39f104a272dbd8b4b2f5f2..03c1dfad03882cabb3639e92b9606a517a0d9041 100644
--- a/ThermoSysPro/Properties/Fluid/derTemperature_derP_derh.mo
+++ b/ThermoSysPro/Properties/Fluid/derTemperature_derP_derh.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.Properties.Fluid;
-function derTemperature_derP_derh
-  "der(Temperature) computation for all fluids (inputs: P, h, fluid, der(P), der(h))"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_P "Pressure time derivative (J/(kg*s))";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-
-  output Real der_T "Temperature time derivative (K/s)";
-
-  //ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (extent=[-80,40; -40,80]);
-
-///annotation(derivative(order=2)=derderTemperature_derderP_derderh);
-
-algorithm
-//   // Water/Steam
-//   if fluid==1 then
-//     pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-//       P,
-//       h,
-//       mode);
-//     T:=pro.T;
-//
-//   // C3H3F5
-//   elseif fluid==2 then
-//     T := ThermoSysPro.Properties.C3H3F5.Temperature_Ph(P=P, h=h);
-//
-//   // FlueGas
-//   elseif fluid==3 then
-//     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-//     T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
-//       PMF=P,
-//       HMF=h,
-//       Xco2=Xco2,
-//       Xh2o=Xh2o,
-//       Xo2=Xo2,
-//       Xso2=Xso2);
-//
-//   // MoltenSalt
-//   elseif fluid==4 then
-//     T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h);
-
-  // Oil
-  //elseif fluid==5 then
-  if fluid==5 then
-    der_T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h);
-
-//   // Dry Air Ideal Gas
-//   elseif fluid==6 then
-//     T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h);
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derTemperature_derP_derh;
+within ThermoSysPro.Properties.Fluid;
+function derTemperature_derP_derh
+  "der(Temperature) computation for all fluids (inputs: P, h, fluid, der(P), der(h))"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_P "Pressure time derivative (J/(kg*s))";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+
+  output Real der_T "Temperature time derivative (K/s)";
+
+  //ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro annotation (extent=[-80,40; -40,80]);
+
+///annotation(derivative(order=2)=derderTemperature_derderP_derderh);
+
+algorithm
+//   // Water/Steam
+//   if fluid==1 then
+//     pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+//       P,
+//       h,
+//       mode);
+//     T:=pro.T;
+//
+//   // C3H3F5
+//   elseif fluid==2 then
+//     T := ThermoSysPro.Properties.C3H3F5.Temperature_Ph(P=P, h=h);
+//
+//   // FlueGas
+//   elseif fluid==3 then
+//     assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+//     T := ThermoSysPro.Properties.FlueGases.FlueGases_T(
+//       PMF=P,
+//       HMF=h,
+//       Xco2=Xco2,
+//       Xh2o=Xh2o,
+//       Xo2=Xo2,
+//       Xso2=Xso2);
+//
+//   // MoltenSalt
+//   elseif fluid==4 then
+//     T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h=h);
+
+  // Oil
+  //elseif fluid==5 then
+  if fluid==5 then
+    der_T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_derh(h=h,der_h=der_h);
+
+//   // Dry Air Ideal Gas
+//   elseif fluid==6 then
+//     T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h=h);
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derTemperature_derP_derh;
diff --git a/ThermoSysPro/Properties/Fluid/derderDensity_derderP_derderh.mo b/ThermoSysPro/Properties/Fluid/derderDensity_derderP_derderh.mo
index c33febc80df9a75e16ac46d243cb409eb7b35692..5182f596e3f3e35511a91144b815af984556d068 100644
--- a/ThermoSysPro/Properties/Fluid/derderDensity_derderP_derderh.mo
+++ b/ThermoSysPro/Properties/Fluid/derderDensity_derderP_derderh.mo
@@ -1,71 +1,71 @@
-within ThermoSysPro.Properties.Fluid;
-function derderDensity_derderP_derderh
-  "der(der(Density)) computation for all fluids (inputs: P, h, der(P), der(h), der(der(P)), der(der(h)), fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_P "Pressure time derivative (J/(kg*s))";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-  input Real der_2_P;
-  input Real der_2_h;
-  input Real der_2_Xco2=0;
-  input Real der_2_Xh2o=0;
-  input Real der_2_Xo2=0;
-  input Real der_2_Xso2=0;
-
-  output Real der_2_rho
-    "Time derivative of Density time derivative (kg/(m3*s2))";
-
-protected
-  Units.SI.Duration dt=1;
-  Units.SI.AbsolutePressure delta_P=0.01*P;
-  Units.SI.SpecificEnthalpy delta_h=0.01*h;
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    //
-
-  // C3H3F5
-  elseif fluid==2 then
-    //
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    //
-
-  // MoltenSalt
-  elseif fluid==4 then
-    //
-
-  // Oil
-  elseif fluid==5 then
-    der_2_rho := (ThermoSysPro.Properties.Fluid.derDensity_derP_derh(P=P+delta_P,h=h+delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2)
-      - ThermoSysPro.Properties.Fluid.derDensity_derP_derh(P=P-delta_P,h=h-delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2))
-      / dt;
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    //
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-   //
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derderDensity_derderP_derderh;
+within ThermoSysPro.Properties.Fluid;
+function derderDensity_derderP_derderh
+  "der(der(Density)) computation for all fluids (inputs: P, h, der(P), der(h), der(der(P)), der(der(h)), fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_P "Pressure time derivative (J/(kg*s))";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+  input Real der_2_P;
+  input Real der_2_h;
+  input Real der_2_Xco2=0;
+  input Real der_2_Xh2o=0;
+  input Real der_2_Xo2=0;
+  input Real der_2_Xso2=0;
+
+  output Real der_2_rho
+    "Time derivative of Density time derivative (kg/(m3*s2))";
+
+protected
+  Units.SI.Duration dt=1;
+  Units.SI.AbsolutePressure delta_P=0.01*P;
+  Units.SI.SpecificEnthalpy delta_h=0.01*h;
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    //
+
+  // C3H3F5
+  elseif fluid==2 then
+    //
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    //
+
+  // MoltenSalt
+  elseif fluid==4 then
+    //
+
+  // Oil
+  elseif fluid==5 then
+    der_2_rho := (ThermoSysPro.Properties.Fluid.derDensity_derP_derh(P=P+delta_P,h=h+delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2)
+      - ThermoSysPro.Properties.Fluid.derDensity_derP_derh(P=P-delta_P,h=h-delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2))
+      / dt;
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    //
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+   //
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derderDensity_derderP_derderh;
diff --git a/ThermoSysPro/Properties/Fluid/derderDensity_derh_derderP_derderh.mo b/ThermoSysPro/Properties/Fluid/derderDensity_derh_derderP_derderh.mo
index 39131032648f5cbd503a8c0910d710186f452381..17554e9b31811a0fc96b55a9c41243100db2a55d 100644
--- a/ThermoSysPro/Properties/Fluid/derderDensity_derh_derderP_derderh.mo
+++ b/ThermoSysPro/Properties/Fluid/derderDensity_derh_derderP_derderh.mo
@@ -1,71 +1,71 @@
-within ThermoSysPro.Properties.Fluid;
-function derderDensity_derh_derderP_derderh
-  "der(der(Density derivative w.r.t enthalpy)) computation for all fluids (inputs: P, h, der(P), der(h), der(der(P)), der(der(h)), fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_P "Pressure time derivative (J/(kg*s))";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-  input Real der_2_P;
-  input Real der_2_h;
-  input Real der_2_Xco2=0;
-  input Real der_2_Xh2o=0;
-  input Real der_2_Xo2=0;
-  input Real der_2_Xso2=0;
-
-  output Real der_2_ddhp
-    "Time derivative of time derivative of Density derivative by enthalpy";
-
-protected
-  Units.SI.Duration dt=1;
-  Units.SI.AbsolutePressure delta_P=0.01*P;
-  Units.SI.SpecificEnthalpy delta_h=0.01*h;
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    //
-
-  // C3H3F5
-  elseif fluid==2 then
-    //
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    //
-
-  // MoltenSalt
-  elseif fluid==4 then
-    //
-
-  // Oil
-  elseif fluid==5 then
-    der_2_ddhp := (ThermoSysPro.Properties.Fluid.derDensity_derh_derP_derh(P=P+delta_P,h=h+delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2)
-      - ThermoSysPro.Properties.Fluid.derDensity_derh_derP_derh(P=P-delta_P,h=h-delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2))
-      / dt;
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    //
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-   //
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derderDensity_derh_derderP_derderh;
+within ThermoSysPro.Properties.Fluid;
+function derderDensity_derh_derderP_derderh
+  "der(der(Density derivative w.r.t enthalpy)) computation for all fluids (inputs: P, h, der(P), der(h), der(der(P)), der(der(h)), fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_P "Pressure time derivative (J/(kg*s))";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+  input Real der_2_P;
+  input Real der_2_h;
+  input Real der_2_Xco2=0;
+  input Real der_2_Xh2o=0;
+  input Real der_2_Xo2=0;
+  input Real der_2_Xso2=0;
+
+  output Real der_2_ddhp
+    "Time derivative of time derivative of Density derivative by enthalpy";
+
+protected
+  Units.SI.Duration dt=1;
+  Units.SI.AbsolutePressure delta_P=0.01*P;
+  Units.SI.SpecificEnthalpy delta_h=0.01*h;
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    //
+
+  // C3H3F5
+  elseif fluid==2 then
+    //
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    //
+
+  // MoltenSalt
+  elseif fluid==4 then
+    //
+
+  // Oil
+  elseif fluid==5 then
+    der_2_ddhp := (ThermoSysPro.Properties.Fluid.derDensity_derh_derP_derh(P=P+delta_P,h=h+delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2)
+      - ThermoSysPro.Properties.Fluid.derDensity_derh_derP_derh(P=P-delta_P,h=h-delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2))
+      / dt;
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    //
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+   //
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derderDensity_derh_derderP_derderh;
diff --git a/ThermoSysPro/Properties/Fluid/derderTemperature_derderP_derderh.mo b/ThermoSysPro/Properties/Fluid/derderTemperature_derderP_derderh.mo
index 3a053980369a756cb55e9f4891cdd9be5e6a6396..278bf5152b9fa55e6c25e2cb84876c4ba6108e64 100644
--- a/ThermoSysPro/Properties/Fluid/derderTemperature_derderP_derderh.mo
+++ b/ThermoSysPro/Properties/Fluid/derderTemperature_derderP_derderh.mo
@@ -1,70 +1,70 @@
-within ThermoSysPro.Properties.Fluid;
-function derderTemperature_derderP_derderh
-  "der(der(Temperature)) computation for all fluids (inputs: P, h, der(P), der(h), der(der(P)), der(der(h)), fluid)"
-
-  input Units.SI.AbsolutePressure P "Pressure (Pa)";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer fluid
-    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
-  input Integer mode "IF97 region - 0:automatic computation";
-  input Real Xco2 "CO2 mass fraction";
-  input Real Xh2o "H2O mass fraction";
-  input Real Xo2 "O2 mass fraction";
-  input Real Xso2 "SO2 mass fraction";
-  input Real der_P "Pressure time derivative (J/(kg*s))";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-  input Real der_Xco2=0 "CO2 mass fraction";
-  input Real der_Xh2o=0 "H2O mass fraction";
-  input Real der_Xo2=0 "O2 mass fraction";
-  input Real der_Xso2=0 "SO2 mass fraction";
-  input Real der_2_P;
-  input Real der_2_h;
-  input Real der_2_Xco2=0;
-  input Real der_2_Xh2o=0;
-  input Real der_2_Xo2=0;
-  input Real der_2_Xso2=0;
-
-  output Real der_2_T "Time derivative of Temperature time derivative (K/s2)";
-
-protected
-  Units.SI.Duration dt=1;
-  Units.SI.AbsolutePressure delta_P=0.01*P;
-  Units.SI.SpecificEnthalpy delta_h=0.01*h;
-
-algorithm
-  // Water/Steam
-  if fluid==1 then
-    //
-
-  // C3H3F5
-  elseif fluid==2 then
-    //
-
-  // FlueGas
-  elseif fluid==3 then
-    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
-    //
-
-  // MoltenSalt
-  elseif fluid==4 then
-    //
-
-  // Oil
-  elseif fluid==5 then
-    der_2_T := (ThermoSysPro.Properties.Fluid.derTemperature_derP_derh(P=P+delta_P,h=h+delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2)
-      - ThermoSysPro.Properties.Fluid.derTemperature_derP_derh(P=P-delta_P,h=h-delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2))
-      / dt;
-
-  // Dry Air Ideal Gas
-  elseif fluid==6 then
-    //
-
-  // Water/Steam Simple
-  elseif  fluid==7 then
-   //
-
-  else
-    assert(false, "incorrect fluid number");  ///
-  end if;
-
-end derderTemperature_derderP_derderh;
+within ThermoSysPro.Properties.Fluid;
+function derderTemperature_derderP_derderh
+  "der(der(Temperature)) computation for all fluids (inputs: P, h, der(P), der(h), der(der(P)), der(der(h)), fluid)"
+
+  input Units.SI.AbsolutePressure P "Pressure (Pa)";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer fluid
+    "<html>Fluid number: <br>1 - Water/Steam <br>2 - C3H3F5 <br>3 - FlueGases <br>4 - MoltenSalt <br>5 - Oil <br>6 - DryAirIdealGas <br>7 - WaterSteamSimple </html>";
+  input Integer mode "IF97 region - 0:automatic computation";
+  input Real Xco2 "CO2 mass fraction";
+  input Real Xh2o "H2O mass fraction";
+  input Real Xo2 "O2 mass fraction";
+  input Real Xso2 "SO2 mass fraction";
+  input Real der_P "Pressure time derivative (J/(kg*s))";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+  input Real der_Xco2=0 "CO2 mass fraction";
+  input Real der_Xh2o=0 "H2O mass fraction";
+  input Real der_Xo2=0 "O2 mass fraction";
+  input Real der_Xso2=0 "SO2 mass fraction";
+  input Real der_2_P;
+  input Real der_2_h;
+  input Real der_2_Xco2=0;
+  input Real der_2_Xh2o=0;
+  input Real der_2_Xo2=0;
+  input Real der_2_Xso2=0;
+
+  output Real der_2_T "Time derivative of Temperature time derivative (K/s2)";
+
+protected
+  Units.SI.Duration dt=1;
+  Units.SI.AbsolutePressure delta_P=0.01*P;
+  Units.SI.SpecificEnthalpy delta_h=0.01*h;
+
+algorithm
+  // Water/Steam
+  if fluid==1 then
+    //
+
+  // C3H3F5
+  elseif fluid==2 then
+    //
+
+  // FlueGas
+  elseif fluid==3 then
+    assert(Xco2+Xh2o+Xo2+Xso2>0, "Wrong mass fraction definition");  /// Commentaire ajouté (si fluid==2, vérifie que les fractions massiques sont bien fournies en Input)
+    //
+
+  // MoltenSalt
+  elseif fluid==4 then
+    //
+
+  // Oil
+  elseif fluid==5 then
+    der_2_T := (ThermoSysPro.Properties.Fluid.derTemperature_derP_derh(P=P+delta_P,h=h+delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2)
+      - ThermoSysPro.Properties.Fluid.derTemperature_derP_derh(P=P-delta_P,h=h-delta_h,der_P=der_P,der_h=der_h,fluid=fluid,mode=mode,Xco2=Xco2,Xh2o=Xh2o,Xo2=Xo2,Xso2=Xso2))
+      / dt;
+
+  // Dry Air Ideal Gas
+  elseif fluid==6 then
+    //
+
+  // Water/Steam Simple
+  elseif  fluid==7 then
+   //
+
+  else
+    assert(false, "incorrect fluid number");  ///
+  end if;
+
+end derderTemperature_derderP_derderh;
diff --git a/ThermoSysPro/Properties/Fluid/package.mo b/ThermoSysPro/Properties/Fluid/package.mo
index 0da7b387c9bca3179f05a58fa1f9ae23e2cc19eb..b45ec367479f8d42411d193f563fe0218591e87f 100644
--- a/ThermoSysPro/Properties/Fluid/package.mo
+++ b/ThermoSysPro/Properties/Fluid/package.mo
@@ -1,179 +1,179 @@
-within ThermoSysPro.Properties;
-package Fluid "Generic fluid properties library"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-annotation (
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Documentation(info="<html>
-<p><b>ThermoSysPro Version 3.2</b> </p>
-<p>This library is an interface for the following fluid properties libraries:</p>
-<ol>
-<li>Water and steam (industrial IAPWS-IF97 standard)</li>
-<li>C3HF5</li>
-<li>Flue gases</li>
-<li>Molten salt</li>
-<li>Oil</li>
-<li>Dry air (ideal gas)</li>
-<li>Water and steam (simple implementation) </li>
-</ol>
-</html>"));
-end Fluid;
+within ThermoSysPro.Properties;
+package Fluid "Generic fluid properties library"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+annotation (
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Documentation(info="<html>
+<p><b>ThermoSysPro Version 3.2</b> </p>
+<p>This library is an interface for the following fluid properties libraries:</p>
+<ol>
+<li>Water and steam (industrial IAPWS-IF97 standard)</li>
+<li>C3HF5</li>
+<li>Flue gases</li>
+<li>Molten salt</li>
+<li>Oil</li>
+<li>Dry air (ideal gas)</li>
+<li>Water and steam (simple implementation) </li>
+</ol>
+</html>"));
+end Fluid;
diff --git a/ThermoSysPro/Properties/Fluid/package.order b/ThermoSysPro/Properties/Fluid/package.order
index 3fa62ed260580f7d2dfc5dc12d0124d91fc42e68..05d6b98135f95204cb34b8514025d34c5f7b5e80 100644
--- a/ThermoSysPro/Properties/Fluid/package.order
+++ b/ThermoSysPro/Properties/Fluid/package.order
@@ -1,35 +1,35 @@
-Ph
-Ps
-PT
-P_sat
-T_sat
-Water_sat_P
-Density_Ph
-DynamicViscosity_Ph
-DynamicViscosity_rhoT
-IsentropicExponent_Ph
-IsobaricExpansionCoefficient_Ph
-Prandtl_Ph
-Reynolds_PhvD
-Reynolds_vrhoDmu
-SpecificEnthalpy_PT
-SpecificHeatCapacityCp_Ph
-SpecificHeatCapacityCp_PT
-Temperature_Ph
-ThermalConductivity_Ph
-ThermalConductivity_rhoT
-SpecificInternalEnergy_Ph_DO_NOT_USE
-Density_derh_Ph
-Density_derp_Ph
-derDensity_derh_derP_derh
-derDensity_derP_derh
-derderDensity_derderP_derderh
-derderDensity_derh_derderP_derderh
-derderTemperature_derderP_derderh
-derDynamicViscosity_derP_derh
-derDynamicViscosity_derP_derh_old
-derSpecificEnthalpy_derP_derT
-derSpecificInternalEnergy_derP_derh
-derTemperature_derP_derh
-derDynamicViscosity_derT_derrho
-derDynamicViscosity_derrho_derT
+Ph
+Ps
+PT
+P_sat
+T_sat
+Water_sat_P
+Density_Ph
+DynamicViscosity_Ph
+DynamicViscosity_rhoT
+IsentropicExponent_Ph
+IsobaricExpansionCoefficient_Ph
+Prandtl_Ph
+Reynolds_PhvD
+Reynolds_vrhoDmu
+SpecificEnthalpy_PT
+SpecificHeatCapacityCp_Ph
+SpecificHeatCapacityCp_PT
+Temperature_Ph
+ThermalConductivity_Ph
+ThermalConductivity_rhoT
+SpecificInternalEnergy_Ph_DO_NOT_USE
+Density_derh_Ph
+Density_derp_Ph
+derDensity_derh_derP_derh
+derDensity_derP_derh
+derderDensity_derderP_derderh
+derderDensity_derh_derderP_derderh
+derderTemperature_derderP_derderh
+derDynamicViscosity_derP_derh
+derDynamicViscosity_derP_derh_old
+derSpecificEnthalpy_derP_derT
+derSpecificInternalEnergy_derP_derh
+derTemperature_derP_derh
+derDynamicViscosity_derT_derrho
+derDynamicViscosity_derrho_derT
diff --git a/ThermoSysPro/Properties/MoltenSalt/Density_T.mo b/ThermoSysPro/Properties/MoltenSalt/Density_T.mo
index 88f2224ddffb5127e5e54fa36d845b2038908b5a..f245b730c9a559177c19e9081814de8bba1916cc 100644
--- a/ThermoSysPro/Properties/MoltenSalt/Density_T.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/Density_T.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function Density_T "Density computation for Salt (input T)"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  output Units.SI.Density rho "Density (kg/m3)";
-
-algorithm
-  rho := 2263.87142553064 - 0.636188210739603*T;  // Stephanie SQMSolarSalt
-  //rho := 2263.7234 - 0.636*T;  // Stephanie SolarSalt
-
-  annotation(derivative = derDensity_derT);
-end Density_T;
+within ThermoSysPro.Properties.MoltenSalt;
+function Density_T "Density computation for Salt (input T)"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  output Units.SI.Density rho "Density (kg/m3)";
+
+algorithm
+  rho := 2263.87142553064 - 0.636188210739603*T;  // Stephanie SQMSolarSalt
+  //rho := 2263.7234 - 0.636*T;  // Stephanie SolarSalt
+
+  annotation(derivative = derDensity_derT);
+end Density_T;
diff --git a/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_T.mo b/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_T.mo
index dabfd6fc151835ea5c1c01fa55ff9554dff845e2..9ffc3a67dcfbf4e62431370bbe8b2ba4cbf79d39 100644
--- a/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_T.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_T.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function DynamicViscosity_T "Dynamic Viscosity computation for Salt (input T)"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  output Units.SI.DynamicViscosity mu "Dynamic Viscosity (Pa.s)";
-
-algorithm
-  //mu :=( 0.0755147595 - 0.00027760398*T + 3.4888693*1e-7*T^2 - 1.4739999*1e-10*T^3);   // temperature in °K
-
-  //New
-//    mu := (22.714 - 0.12*(T - 273.15) + 2.281*1e-7*(T - 273.15)**2 - 1.474*1e-10*(T - 273.15)**3);   // temperature in °C
-  mu :=if (T<=873.15) then ( 0.0755147595 - 0.00027760398*T + 3.4888693*1e-7*T^2 - 1.4739999*1e-10*T^3) else 0.0009916065819282893;      // temperature in °K
-
-end DynamicViscosity_T;
+within ThermoSysPro.Properties.MoltenSalt;
+function DynamicViscosity_T "Dynamic Viscosity computation for Salt (input T)"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  output Units.SI.DynamicViscosity mu "Dynamic Viscosity (Pa.s)";
+
+algorithm
+  //mu :=( 0.0755147595 - 0.00027760398*T + 3.4888693*1e-7*T^2 - 1.4739999*1e-10*T^3);   // temperature in °K
+
+  //New
+//    mu := (22.714 - 0.12*(T - 273.15) + 2.281*1e-7*(T - 273.15)**2 - 1.474*1e-10*(T - 273.15)**3);   // temperature in °C
+  mu :=if (T<=873.15) then ( 0.0755147595 - 0.00027760398*T + 3.4888693*1e-7*T^2 - 1.4739999*1e-10*T^3) else 0.0009916065819282893;      // temperature in °K
+
+end DynamicViscosity_T;
diff --git a/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_dert.mo b/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_dert.mo
index 4f77bd8ba2db38127c548d970f87d491fd52ef1d..c2f65505833636a31a6143e93e2868f53d485b7c 100644
--- a/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_dert.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_dert.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function DynamicViscosity_dert
-  "der Dynamic Viscosity computation for Salt (input T)"
-
-  input Units.SI.Temperature temp "Temperature (K)";
-  input Real der_temp "Fluid temperature time derivative (K/s)";
-  output Real der_mu "Dynamic Viscosity time derivative(Pa)";
-
-protected
-    constant Real Viscosity_c0 = 0.07551475951333098;
-    constant Real Viscosity_c1 = - 0.00027760397992950003;
-    constant Real Viscosity_c2 = 0.00000034888693;
-    constant Real Viscosity_c3 = - 0.00000000014739999;
-algorithm
-      der_mu := Viscosity_c1*der_temp + 2*Viscosity_c2*temp*der_temp + 3*Viscosity_c3*temp^2*der_temp;
-
-end DynamicViscosity_dert;
+within ThermoSysPro.Properties.MoltenSalt;
+function DynamicViscosity_dert
+  "der Dynamic Viscosity computation for Salt (input T)"
+
+  input Units.SI.Temperature temp "Temperature (K)";
+  input Real der_temp "Fluid temperature time derivative (K/s)";
+  output Real der_mu "Dynamic Viscosity time derivative(Pa)";
+
+protected
+    constant Real Viscosity_c0 = 0.07551475951333098;
+    constant Real Viscosity_c1 = - 0.00027760397992950003;
+    constant Real Viscosity_c2 = 0.00000034888693;
+    constant Real Viscosity_c3 = - 0.00000000014739999;
+algorithm
+      der_mu := Viscosity_c1*der_temp + 2*Viscosity_c2*temp*der_temp + 3*Viscosity_c3*temp^2*der_temp;
+
+end DynamicViscosity_dert;
diff --git a/ThermoSysPro/Properties/MoltenSalt/HitecLimits.mo b/ThermoSysPro/Properties/MoltenSalt/HitecLimits.mo
index 80bfb5e5249483b9d71cc3c71206d9e32c1ea974..c47b09438a618f63a059f6d9bf110355da0f63b0 100644
--- a/ThermoSysPro/Properties/MoltenSalt/HitecLimits.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/HitecLimits.mo
@@ -1,149 +1,149 @@
-within ThermoSysPro.Properties.MoltenSalt;
-package HitecLimits
-
-  constant Real MINPOS=1.0e-9
-    "minimal value for physical variables which are always > 0.0";
-
-  constant Units.SI.Density DMIN=1690.584 "Minimum density";
-  constant Units.SI.Density DMAX=1975.332 "Maximum densitye";
-  constant Units.SI.Density DNOM=1938.0 "Nominal density";
-  constant Units.SI.ThermalConductivity LAMMIN=0.239466
-    "Minimum thermal conductivity";
-  constant Units.SI.ThermalConductivity LAMNOM=0.46018
-    "Nominal thermal conductivity";
-  constant Units.SI.ThermalConductivity LAMMAX=0.493483
-    "Maximum thermal conductivity";
-  constant Units.SI.DynamicViscosity ETAMIN=9.93e-4 "Minimum dynamic viscosity";
-  constant Units.SI.DynamicViscosity ETAMAX=1.3e-2 "Maximum dynamic viscosity";
-  constant Units.SI.DynamicViscosity ETANOM=7.29e-3 "Nominal dynamic viscosity";
-
-  constant Units.SI.SpecificHeatCapacity CPMIN=MINPOS
-    "Minimum specific heat capacity";
-  constant Units.SI.SpecificHeatCapacity CPMAX=Modelica.Constants.inf
-    "Maximum specific heat capacity";
-  constant Units.SI.SpecificHeatCapacity CPNOM=1.571e3
-    "Nominal specific heat capacity";
-
-  constant Units.SI.Temperature TMIN=200 "Minimum temperature";
-  constant Units.SI.Temperature TMAX=10000 "Maximum temperature";
-  constant Units.SI.Temperature TNOM=800 "Nominal temperature";
-
-  annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end HitecLimits;
+within ThermoSysPro.Properties.MoltenSalt;
+package HitecLimits
+
+  constant Real MINPOS=1.0e-9
+    "minimal value for physical variables which are always > 0.0";
+
+  constant Units.SI.Density DMIN=1690.584 "Minimum density";
+  constant Units.SI.Density DMAX=1975.332 "Maximum densitye";
+  constant Units.SI.Density DNOM=1938.0 "Nominal density";
+  constant Units.SI.ThermalConductivity LAMMIN=0.239466
+    "Minimum thermal conductivity";
+  constant Units.SI.ThermalConductivity LAMNOM=0.46018
+    "Nominal thermal conductivity";
+  constant Units.SI.ThermalConductivity LAMMAX=0.493483
+    "Maximum thermal conductivity";
+  constant Units.SI.DynamicViscosity ETAMIN=9.93e-4 "Minimum dynamic viscosity";
+  constant Units.SI.DynamicViscosity ETAMAX=1.3e-2 "Maximum dynamic viscosity";
+  constant Units.SI.DynamicViscosity ETANOM=7.29e-3 "Nominal dynamic viscosity";
+
+  constant Units.SI.SpecificHeatCapacity CPMIN=MINPOS
+    "Minimum specific heat capacity";
+  constant Units.SI.SpecificHeatCapacity CPMAX=Modelica.Constants.inf
+    "Maximum specific heat capacity";
+  constant Units.SI.SpecificHeatCapacity CPNOM=1.571e3
+    "Nominal specific heat capacity";
+
+  constant Units.SI.Temperature TMIN=200 "Minimum temperature";
+  constant Units.SI.Temperature TMAX=10000 "Maximum temperature";
+  constant Units.SI.Temperature TNOM=800 "Nominal temperature";
+
+  annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end HitecLimits;
diff --git a/ThermoSysPro/Properties/MoltenSalt/SpecificEnthalpy_T.mo b/ThermoSysPro/Properties/MoltenSalt/SpecificEnthalpy_T.mo
index 029efafe9a06a97a03359276ad43fde9feea893e..c93dd2bea54218a88ae8ef5e1d0275835da51c5f 100644
--- a/ThermoSysPro/Properties/MoltenSalt/SpecificEnthalpy_T.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/SpecificEnthalpy_T.mo
@@ -1,39 +1,39 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function SpecificEnthalpy_T "Specific Enthalpy computation for Salt (input T)"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  output Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
-
-// STEPHANIE SQMSolarSalt
-protected
-  constant Real Enthalpy_c0 = -809884.394575425;
-  constant Real Enthalpy_c1 = 1516.31623195732;
-  constant Real enthC0 = -798297.6386;
-  constant Real enthC1 = 1396.02;
-  constant Real enthC2 = 0.086;
-
-algorithm
-  // T in K; h in J/kg ;
-
-  // h = 43801 for T=563K => Error For T= 505 h= -44000
-  //  STEPHANIE SQMSolarSalt: properties from manufacturer tables
-  // h:=Enthalpy_c0 + Enthalpy_c1 * T;
-
-  //New h = 14919.9 for T=563K => Error For T= 505 h= - ????
-  //h := -798297.6386 + 1396.0182*T + 0.086*T^2;
-  //h := enthC0 + enthC1*T + enthC2*T^2;
-
-  // T  in K and h in J/kg ;
-  //Sam
-  ///////////////////////////////////////////////////////////////////////////////////////
-  //case(18)    !Nitrate Salt, [kg/m3]
-  //xlo=493.; xhi=866.;     : Reduced freezing temp to 220C (493.15K),
-  //reference http://www.nrel.gov/csp/troughnet/pdfs/40028.pdf
-  //
-  ///////////   ********************* Nitrate Salt ***********************   ///////////
-  //
-  //H_salt = ......;
-  h :=1443*(T - 273.16) + 0.086*(T - 273.16)*(T - 273.16);
-
-annotation(derivative = derSpecificEnthalpy_derT, inverse(T = Temperature_h(h)));
-end SpecificEnthalpy_T;
+within ThermoSysPro.Properties.MoltenSalt;
+function SpecificEnthalpy_T "Specific Enthalpy computation for Salt (input T)"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  output Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
+
+// STEPHANIE SQMSolarSalt
+protected
+  constant Real Enthalpy_c0 = -809884.394575425;
+  constant Real Enthalpy_c1 = 1516.31623195732;
+  constant Real enthC0 = -798297.6386;
+  constant Real enthC1 = 1396.02;
+  constant Real enthC2 = 0.086;
+
+algorithm
+  // T in K; h in J/kg ;
+
+  // h = 43801 for T=563K => Error For T= 505 h= -44000
+  //  STEPHANIE SQMSolarSalt: properties from manufacturer tables
+  // h:=Enthalpy_c0 + Enthalpy_c1 * T;
+
+  //New h = 14919.9 for T=563K => Error For T= 505 h= - ????
+  //h := -798297.6386 + 1396.0182*T + 0.086*T^2;
+  //h := enthC0 + enthC1*T + enthC2*T^2;
+
+  // T  in K and h in J/kg ;
+  //Sam
+  ///////////////////////////////////////////////////////////////////////////////////////
+  //case(18)    !Nitrate Salt, [kg/m3]
+  //xlo=493.; xhi=866.;     : Reduced freezing temp to 220C (493.15K),
+  //reference http://www.nrel.gov/csp/troughnet/pdfs/40028.pdf
+  //
+  ///////////   ********************* Nitrate Salt ***********************   ///////////
+  //
+  //H_salt = ......;
+  h :=1443*(T - 273.16) + 0.086*(T - 273.16)*(T - 273.16);
+
+annotation(derivative = derSpecificEnthalpy_derT, inverse(T = Temperature_h(h)));
+end SpecificEnthalpy_T;
diff --git a/ThermoSysPro/Properties/MoltenSalt/SpecificHeatCapacityCp_T.mo b/ThermoSysPro/Properties/MoltenSalt/SpecificHeatCapacityCp_T.mo
index 3db90ce2c2ad8419c4cebd0727e377e6bc205a5a..8162d2f24aaea571155884c555f25898505b855c 100644
--- a/ThermoSysPro/Properties/MoltenSalt/SpecificHeatCapacityCp_T.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/SpecificHeatCapacityCp_T.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function SpecificHeatCapacityCp_T
-  "Specific Heat Capacity at fixed P computation for Salt (input T)"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  output Units.SI.SpecificHeatCapacity Cp "Specific Heat Capacity (J/kg/K)";
-
-algorithm
-  //Cp := 1396.11639230963 + 0.171740545944394*T;              // temperature in K
-
-  // New
-    Cp := 1443 + 0.172*(T - 273.15);
-    //Cp := 1448;
-
-end SpecificHeatCapacityCp_T;
+within ThermoSysPro.Properties.MoltenSalt;
+function SpecificHeatCapacityCp_T
+  "Specific Heat Capacity at fixed P computation for Salt (input T)"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  output Units.SI.SpecificHeatCapacity Cp "Specific Heat Capacity (J/kg/K)";
+
+algorithm
+  //Cp := 1396.11639230963 + 0.171740545944394*T;              // temperature in K
+
+  // New
+    Cp := 1443 + 0.172*(T - 273.15);
+    //Cp := 1448;
+
+end SpecificHeatCapacityCp_T;
diff --git a/ThermoSysPro/Properties/MoltenSalt/Temperature_derh.mo b/ThermoSysPro/Properties/MoltenSalt/Temperature_derh.mo
index 67e7895a4c678693e1d16d881d1c19a675e10c65..b4d2c0e5e9041fd465f5da3a5a0a28e119f535af 100644
--- a/ThermoSysPro/Properties/MoltenSalt/Temperature_derh.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/Temperature_derh.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function Temperature_derh
-  "derh(Temperature) computation for Salt (input der(h))"
-
-  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-  output Real der_temp "Fluid temperature time derivative (K/s)";
-
-protected
-    constant Real enthC0 = -798297.6386;
-    constant Real enthC1 = 1396.02;
-    constant Real enthC2 = 0.086;
-
-algorithm
-     der_temp:= 1/sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h)*der_h;
-end Temperature_derh;
+within ThermoSysPro.Properties.MoltenSalt;
+function Temperature_derh
+  "derh(Temperature) computation for Salt (input der(h))"
+
+  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+  output Real der_temp "Fluid temperature time derivative (K/s)";
+
+protected
+    constant Real enthC0 = -798297.6386;
+    constant Real enthC1 = 1396.02;
+    constant Real enthC2 = 0.086;
+
+algorithm
+     der_temp:= 1/sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h)*der_h;
+end Temperature_derh;
diff --git a/ThermoSysPro/Properties/MoltenSalt/Temperature_h.mo b/ThermoSysPro/Properties/MoltenSalt/Temperature_h.mo
index 20efbfc4b0aaf2b3362852b594ecb96b9a9c05c4..025b66db8c064f164a8f32a35c60232c1e1f0975 100644
--- a/ThermoSysPro/Properties/MoltenSalt/Temperature_h.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/Temperature_h.mo
@@ -1,39 +1,39 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function Temperature_h "Temperature computation for Salt (input h)"
-
-  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
-  output Units.SI.Temperature T "Temperature (K)";
-
-// STEPHANIE SolarSalt
-protected
-  constant Real enthC0 = -798297.6386;
-  constant Real enthC1 = 1396.02;
-  constant Real enthC2 = 0.086;
-
-// STEPHANIE SQMSolarSalt
-  constant Real Temperature_c0 = 534.117625216440;
-  constant Real Temperature_c1 = 0.000659475113943680;
-
-algorithm
-  // T in K; h in J/kg ;
-  // STEPHANIE SQMSolarSalt: properties from manufacturer tables
-  //T := Temperature_c0 + Temperature_c1 * h;  //  STEPHANIE SQMSolarSalt
-
-  //Error T= 563K for h= 43801 => T calculated with the function = 582.3 K(>>)
-  //T := (-enthC1 + sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h))/(2*enthC2);  // STEPHANIE SolarSalt
-  //T := max((-enthC1 + sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h))/(2*enthC2), 300);  // STEPHANIE SolarSalt
-
-  // T  in K and h in J/kg ;
-  //Sam
-  ///////////////////////////////////////////////////////////////////////////////////////
-  //case(18)    !Nitrate Salt, [kg/m3]
-  //xlo=493.; xhi=866.;     : Reduced freezing temp to 220C (493.15K),
-  //reference http://www.nrel.gov/csp/troughnet/pdfs/40028.pdf
-  //
-  ///////////   ********************* Nitrate Salt ***********************   ///////////
-  //
-
-  T := (-0.0000000000262 * h^2 + 0.0006923 * h + 0.03058) + 273.16;
-
-  annotation(derivative = derTemperature_derh);
-end Temperature_h;
+within ThermoSysPro.Properties.MoltenSalt;
+function Temperature_h "Temperature computation for Salt (input h)"
+
+  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
+  output Units.SI.Temperature T "Temperature (K)";
+
+// STEPHANIE SolarSalt
+protected
+  constant Real enthC0 = -798297.6386;
+  constant Real enthC1 = 1396.02;
+  constant Real enthC2 = 0.086;
+
+// STEPHANIE SQMSolarSalt
+  constant Real Temperature_c0 = 534.117625216440;
+  constant Real Temperature_c1 = 0.000659475113943680;
+
+algorithm
+  // T in K; h in J/kg ;
+  // STEPHANIE SQMSolarSalt: properties from manufacturer tables
+  //T := Temperature_c0 + Temperature_c1 * h;  //  STEPHANIE SQMSolarSalt
+
+  //Error T= 563K for h= 43801 => T calculated with the function = 582.3 K(>>)
+  //T := (-enthC1 + sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h))/(2*enthC2);  // STEPHANIE SolarSalt
+  //T := max((-enthC1 + sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h))/(2*enthC2), 300);  // STEPHANIE SolarSalt
+
+  // T  in K and h in J/kg ;
+  //Sam
+  ///////////////////////////////////////////////////////////////////////////////////////
+  //case(18)    !Nitrate Salt, [kg/m3]
+  //xlo=493.; xhi=866.;     : Reduced freezing temp to 220C (493.15K),
+  //reference http://www.nrel.gov/csp/troughnet/pdfs/40028.pdf
+  //
+  ///////////   ********************* Nitrate Salt ***********************   ///////////
+  //
+
+  T := (-0.0000000000262 * h^2 + 0.0006923 * h + 0.03058) + 273.16;
+
+  annotation(derivative = derTemperature_derh);
+end Temperature_h;
diff --git a/ThermoSysPro/Properties/MoltenSalt/TestTabSalt.mo b/ThermoSysPro/Properties/MoltenSalt/TestTabSalt.mo
index 61f797196af9e8473addb7c080271a0da210f606..612d2180d395a5ae34ff013579cd56897c5811a9 100644
--- a/ThermoSysPro/Properties/MoltenSalt/TestTabSalt.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/TestTabSalt.mo
@@ -1,106 +1,106 @@
-within ThermoSysPro.Properties.MoltenSalt;
-model TestTabSalt "TestTabSalt"
-
-  parameter Units.SI.Temperature T0=800 "initial temperature of the fluid";
-
-public
-  Units.SI.Density rho1(start=1800) "Fluid density ";
-
-  Units.SI.ThermalConductivity k(start=0.3) "Fluid thermal conductivity";
-  Units.SI.DynamicViscosity mu1(start=6.e-3) "Fluid dynamic viscosity ";
-
-  Units.SI.SpecificHeatCapacity cp(start=1571) "Fluid specific heat capacity";
-
-  Units.SI.Density rho11(start=1800) "Fluid density ";
-
-  Units.SI.ThermalConductivity k1(start=0.3) "Fluid thermal conductivity";
-  Units.SI.DynamicViscosity mu11(start=6.e-3) "Fluid dynamic viscosity ";
-
-  Units.SI.SpecificHeatCapacity cp1(start=1571) "Fluid specific heat capacity";
-
-  Properties.MoltenSalt.ThermoProperties_T pro1
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Properties.MoltenSalt.ThermoProperties_T pro11
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-
-equation
-    /* Fluid thermodynamic properties */
-    pro1 = ThermoSysPro.Properties.MoltenSalt.ThermoPropertiesFunction_T_1(T0);
-
-    rho1 = pro1.d;
-
-    cp = pro1.cp;
-
-    mu1 = pro1.mu;
-
-    k = pro1.k;
-
-  pro11 = ThermoSysPro.Properties.MoltenSalt.ThermoPropertiesFunction_T_2(T0);
-
-    rho11 = pro11.d;
-
-    cp1 = pro11.cp;
-
-    mu11 = pro11.mu;
-
-    k1 = pro11.k;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{-60,20},{-60,-20}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-    Window(
-      x=0.18,
-      y=0.05,
-      width=0.68,
-      height=0.94),
-    Documentation(info="<html>
-<p><h4>Copyright &copy; EDF 2002 - 2012</h4></p>
-<p><b>ThermoSysPro Version 3.1</b> </p>
-</html>",
-   revisions="<html>
-<u><p><b>Authors</u> : </p></b>
-<ul style='margin-top:0cm' type=disc>
-<li>
-    Baligh El Hefni</li>
-<li>
-    Daniel Bouskela</li>
-<li>
-    QiangQiang Zhang </li>
-</ul>
-</html>
-"));
-end TestTabSalt;
+within ThermoSysPro.Properties.MoltenSalt;
+model TestTabSalt "TestTabSalt"
+
+  parameter Units.SI.Temperature T0=800 "initial temperature of the fluid";
+
+public
+  Units.SI.Density rho1(start=1800) "Fluid density ";
+
+  Units.SI.ThermalConductivity k(start=0.3) "Fluid thermal conductivity";
+  Units.SI.DynamicViscosity mu1(start=6.e-3) "Fluid dynamic viscosity ";
+
+  Units.SI.SpecificHeatCapacity cp(start=1571) "Fluid specific heat capacity";
+
+  Units.SI.Density rho11(start=1800) "Fluid density ";
+
+  Units.SI.ThermalConductivity k1(start=0.3) "Fluid thermal conductivity";
+  Units.SI.DynamicViscosity mu11(start=6.e-3) "Fluid dynamic viscosity ";
+
+  Units.SI.SpecificHeatCapacity cp1(start=1571) "Fluid specific heat capacity";
+
+  Properties.MoltenSalt.ThermoProperties_T pro1
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Properties.MoltenSalt.ThermoProperties_T pro11
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+
+equation
+    /* Fluid thermodynamic properties */
+    pro1 = ThermoSysPro.Properties.MoltenSalt.ThermoPropertiesFunction_T_1(T0);
+
+    rho1 = pro1.d;
+
+    cp = pro1.cp;
+
+    mu1 = pro1.mu;
+
+    k = pro1.k;
+
+  pro11 = ThermoSysPro.Properties.MoltenSalt.ThermoPropertiesFunction_T_2(T0);
+
+    rho11 = pro11.d;
+
+    cp1 = pro11.cp;
+
+    mu11 = pro11.mu;
+
+    k1 = pro11.k;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{-60,20},{-60,-20}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+    Window(
+      x=0.18,
+      y=0.05,
+      width=0.68,
+      height=0.94),
+    Documentation(info="<html>
+<p><h4>Copyright &copy; EDF 2002 - 2012</h4></p>
+<p><b>ThermoSysPro Version 3.1</b> </p>
+</html>",
+   revisions="<html>
+<u><p><b>Authors</u> : </p></b>
+<ul style='margin-top:0cm' type=disc>
+<li>
+    Baligh El Hefni</li>
+<li>
+    Daniel Bouskela</li>
+<li>
+    QiangQiang Zhang </li>
+</ul>
+</html>
+"));
+end TestTabSalt;
diff --git a/ThermoSysPro/Properties/MoltenSalt/ThermalConductivity_T.mo b/ThermoSysPro/Properties/MoltenSalt/ThermalConductivity_T.mo
index b4877f825e19550f9918d6017cf79d7df911153b..2adc751b57f6529504bdd8aac697e5f173d6dbd9 100644
--- a/ThermoSysPro/Properties/MoltenSalt/ThermalConductivity_T.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/ThermalConductivity_T.mo
@@ -1,11 +1,11 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function ThermalConductivity_T
-  "Thermal Conductivity computation for Salt (input T)"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  output Units.SI.ThermalConductivity k "Thermal Conductivity (W/m/K)";
-
-algorithm
-  k := 0.3911015 + 0.00019*T;                                // temperature in °K
-
-end ThermalConductivity_T;
+within ThermoSysPro.Properties.MoltenSalt;
+function ThermalConductivity_T
+  "Thermal Conductivity computation for Salt (input T)"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  output Units.SI.ThermalConductivity k "Thermal Conductivity (W/m/K)";
+
+algorithm
+  k := 0.3911015 + 0.00019*T;                                // temperature in °K
+
+end ThermalConductivity_T;
diff --git a/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_1.mo b/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_1.mo
index 5a0b42a07a2efd25327f79d81e5a599d8337e973..9d9e8c46a7b2f82b079f3d38f0c8a7acf53faff7 100644
--- a/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_1.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_1.mo
@@ -1,46 +1,46 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function ThermoPropertiesFunction_T_1 "ThermoPropertiesFunction"
-  input Units.SI.Temperature T
-    "dimensionless derivatives of the Gibbs function";
-  output ThermoSysPro.Properties.MoltenSalt.ThermoProperties_T pro;
-//protected
-  //Real vt;
-  //Real vp;
-
-algorithm
-  //if (T-273)>538 then
-  if (T-273)>838 then
-    assert(false, "Molten salt_T: Temperature is too high (" + String(T-273) + ")");
-  elseif (T-273)<149 then
-    assert(false, "Molten salt_T: Temperature is too low (" + String(T-273) + ")");
-  else
-    pro.d := 1938.0-(0.732*(T-273-200));
-    pro.cp := 1561.7;
-    pro.k := 0.421-6.53e-4*(T-273-260);
-    pro.mu := Modelica.Math.exp(-4.343-2.0143*(Modelica.Math.log(T-273)-5.011));
-    //pro.mu :=(2.5-((T-273)-300)/(450-300))*0.001;
-    pro.ddpT := 1e-6;
-    pro.ddTp := -0.732;
-  end if;
-
-  annotation (smoothOrder=2,Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end ThermoPropertiesFunction_T_1;
+within ThermoSysPro.Properties.MoltenSalt;
+function ThermoPropertiesFunction_T_1 "ThermoPropertiesFunction"
+  input Units.SI.Temperature T
+    "dimensionless derivatives of the Gibbs function";
+  output ThermoSysPro.Properties.MoltenSalt.ThermoProperties_T pro;
+//protected
+  //Real vt;
+  //Real vp;
+
+algorithm
+  //if (T-273)>538 then
+  if (T-273)>838 then
+    assert(false, "Molten salt_T: Temperature is too high (" + String(T-273) + ")");
+  elseif (T-273)<149 then
+    assert(false, "Molten salt_T: Temperature is too low (" + String(T-273) + ")");
+  else
+    pro.d := 1938.0-(0.732*(T-273-200));
+    pro.cp := 1561.7;
+    pro.k := 0.421-6.53e-4*(T-273-260);
+    pro.mu := Modelica.Math.exp(-4.343-2.0143*(Modelica.Math.log(T-273)-5.011));
+    //pro.mu :=(2.5-((T-273)-300)/(450-300))*0.001;
+    pro.ddpT := 1e-6;
+    pro.ddTp := -0.732;
+  end if;
+
+  annotation (smoothOrder=2,Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end ThermoPropertiesFunction_T_1;
diff --git a/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_1_ErrT.mo b/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_1_ErrT.mo
index 058959e615bad13e53e009b382fa448c8a673567..25e13376cd7c91445c2dcbe9e4f9f9e3927ba910 100644
--- a/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_1_ErrT.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_1_ErrT.mo
@@ -1,46 +1,46 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function ThermoPropertiesFunction_T_1_ErrT "ThermoPropertiesFunction"
-  input Units.SI.Temperature T
-    "dimensionless derivatives of the Gibbs function";
-  output ThermoSysPro.Properties.MoltenSalt.ThermoProperties_T pro;
-//protected
-  //Real vt;
-  //Real vp;
-
-algorithm
-  //if (T-273)>538 then
-  if (T-273)>838 then
-    assert(false, "Molten salt_T: Temperature is too high (" + String(T-273) + ")");
-  elseif (T-273)<149 then
-    assert(false, "Molten salt_T: Temperature is too low (" + String(T-273) + ")");
-  else
-    pro.d := 1938.0-(0.732*(T-273-200));
-    pro.cp := 1561.7;
-    pro.k := 0.421-6.53e-4*(T-273-260);
-    pro.mu := Modelica.Math.exp(-4.343-2.0143*(Modelica.Math.log(T-273)-5.011));
-    //pro.mu :=(2.5-((T-273)-300)/(450-300))*0.001;
-    pro.ddpT := 1e-6;
-    pro.ddTp := -0.732;
-  end if;
-  LogVariable(T);
-  annotation (smoothOrder=2,Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end ThermoPropertiesFunction_T_1_ErrT;
+within ThermoSysPro.Properties.MoltenSalt;
+function ThermoPropertiesFunction_T_1_ErrT "ThermoPropertiesFunction"
+  input Units.SI.Temperature T
+    "dimensionless derivatives of the Gibbs function";
+  output ThermoSysPro.Properties.MoltenSalt.ThermoProperties_T pro;
+//protected
+  //Real vt;
+  //Real vp;
+
+algorithm
+  //if (T-273)>538 then
+  if (T-273)>838 then
+    assert(false, "Molten salt_T: Temperature is too high (" + String(T-273) + ")");
+  elseif (T-273)<149 then
+    assert(false, "Molten salt_T: Temperature is too low (" + String(T-273) + ")");
+  else
+    pro.d := 1938.0-(0.732*(T-273-200));
+    pro.cp := 1561.7;
+    pro.k := 0.421-6.53e-4*(T-273-260);
+    pro.mu := Modelica.Math.exp(-4.343-2.0143*(Modelica.Math.log(T-273)-5.011));
+    //pro.mu :=(2.5-((T-273)-300)/(450-300))*0.001;
+    pro.ddpT := 1e-6;
+    pro.ddTp := -0.732;
+  end if;
+  LogVariable(T);
+  annotation (smoothOrder=2,Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end ThermoPropertiesFunction_T_1_ErrT;
diff --git a/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_2.mo b/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_2.mo
index 9975d2ca1c94d9b19fd1f77db14b61afea95ae30..2bb4e4dc5af6d164b3ffb9dde8c0080d2aacb85c 100644
--- a/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_2.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_2.mo
@@ -1,87 +1,87 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function ThermoPropertiesFunction_T_2 "ThermoPropertiesFunction of Solt: KNO3-NaNO3
-"
-  input Units.SI.Temperature T
-    "dimensionless derivatives of the Gibbs function";
-  output ThermoSysPro.Properties.MoltenSalt.ThermoProperties_T pro;
-//protected
-  //Real vt;
-  //Real vp;
-
-algorithm
-  //if (T-273)>538 then
-  if (T-273)>838 then
-    assert(false, "Molten salt_T: Temperature is too high (" + String(T-273) + ")");
-  elseif (T-273)<149 then
-    assert(false, "Molten salt_T: Temperature is too low (" + String(T-273) + ")");
-  else
-
-//////////////////////////////////
-
-    //pro.cp := 1417.54 + 0.172*T;        // = 1561.7 à T=838.16
-    //pro.cp := 1464.84 + 0.172*T;        // = 1561.7 à T=563.15
-
-    //pro.cp := 1396.0182 + 0.172*T;      //Stephanie = 1539.84 à T=838.16
-
-    //pro.cp := 976.78 + 1.0634*T;        // Williams et al. [2006]   range of 770?1040 K
-    //pro.cp := 5806 - 10.833*T + 0.0072413*T*T;   //Janz et al     range of 426?776 K
-    //pro.cp := 1721.86;                  //moyenne  Williams et al. [2006]   div
-
-//////////////////////////////////
-
-//Stephanie  // for T= 500 °C or 773 °K => cp= 1529 J ke-1 K-1
-//Specific Heat Capacity
-//    pro.cp := 1443 + 0.172*(T - 273.15);                           // temperature in °C
-//    pro.cp := 1396.11639230963 + 0.171740545944394*T;              // temperature in °K
-//Thermal Conductivity
-//    pro.k := 0.443 + 0.00019*(T - 273.15);                         // temperature in °C
-//    pro.k := 0.3911015 + 0.00019*T;                                // temperature in °K
-//Dynamic Viscosity
-//    pro.mu := (22.714 - 0.12*(T - 273.15) + 2.281*1e-7*(T - 273.15)**2 - 1.474*1e-10*(T - 273.15)**3);   // temperature in °C
-//    pro.mu :=( 0.0755147595 - 0.00027760398*T + 3.4888693*1e-7*T^2 - 1.4739999*1e-10*T^3);   // temperature in °K
-//Density
-//    pro.d := 2090 - 0.636*(T - 273.15);                             // temperature in °C
-//    pro.d := 2263.7234- 0.636*T;                                    // temperature in °C
-
-//////////////////////////////////
-// CAS
-//    pro.d := 2090-0.636*T;      // kg m-3
-//    pro.cp := 1443+0.172*T;     // J ke-1 K-1
-//    pro.k := 0.443+0.00019*T;   // W m-1 k-1
-//    pro.mu := (22.714-0.12*T+2.281*T*0.0001*T-1.474*T*0.0001*T*0.001*T)/1000;    //Pa s(kg m-1 s-1)
-
-//////////////////////////////////
-//PHD
-    pro.d := 1938.0-(0.732*(T-273-200));
-
-    pro.cp := 1561.7;
-
-    pro.k := 0.421-6.53e-4*(T-273-260);
-    pro.mu := Modelica.Math.exp(-4.343-2.0143*(Modelica.Math.log(T-273)-5.011));
-    //pro.mu :=(2.5-((T-273)-300)/(450-300))*0.001;
-//
-    pro.ddpT := 1e-6;
-    pro.ddTp := -0.732;
-  end if;
-
-  annotation (smoothOrder=2,Icon(graphics={
-        Text(extent={{-136,102},{140,42}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "function")}),
-                           Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end ThermoPropertiesFunction_T_2;
+within ThermoSysPro.Properties.MoltenSalt;
+function ThermoPropertiesFunction_T_2 "ThermoPropertiesFunction of Solt: KNO3-NaNO3
+"
+  input Units.SI.Temperature T
+    "dimensionless derivatives of the Gibbs function";
+  output ThermoSysPro.Properties.MoltenSalt.ThermoProperties_T pro;
+//protected
+  //Real vt;
+  //Real vp;
+
+algorithm
+  //if (T-273)>538 then
+  if (T-273)>838 then
+    assert(false, "Molten salt_T: Temperature is too high (" + String(T-273) + ")");
+  elseif (T-273)<149 then
+    assert(false, "Molten salt_T: Temperature is too low (" + String(T-273) + ")");
+  else
+
+//////////////////////////////////
+
+    //pro.cp := 1417.54 + 0.172*T;        // = 1561.7 à T=838.16
+    //pro.cp := 1464.84 + 0.172*T;        // = 1561.7 à T=563.15
+
+    //pro.cp := 1396.0182 + 0.172*T;      //Stephanie = 1539.84 à T=838.16
+
+    //pro.cp := 976.78 + 1.0634*T;        // Williams et al. [2006]   range of 770?1040 K
+    //pro.cp := 5806 - 10.833*T + 0.0072413*T*T;   //Janz et al     range of 426?776 K
+    //pro.cp := 1721.86;                  //moyenne  Williams et al. [2006]   div
+
+//////////////////////////////////
+
+//Stephanie  // for T= 500 °C or 773 °K => cp= 1529 J ke-1 K-1
+//Specific Heat Capacity
+//    pro.cp := 1443 + 0.172*(T - 273.15);                           // temperature in °C
+//    pro.cp := 1396.11639230963 + 0.171740545944394*T;              // temperature in °K
+//Thermal Conductivity
+//    pro.k := 0.443 + 0.00019*(T - 273.15);                         // temperature in °C
+//    pro.k := 0.3911015 + 0.00019*T;                                // temperature in °K
+//Dynamic Viscosity
+//    pro.mu := (22.714 - 0.12*(T - 273.15) + 2.281*1e-7*(T - 273.15)**2 - 1.474*1e-10*(T - 273.15)**3);   // temperature in °C
+//    pro.mu :=( 0.0755147595 - 0.00027760398*T + 3.4888693*1e-7*T^2 - 1.4739999*1e-10*T^3);   // temperature in °K
+//Density
+//    pro.d := 2090 - 0.636*(T - 273.15);                             // temperature in °C
+//    pro.d := 2263.7234- 0.636*T;                                    // temperature in °C
+
+//////////////////////////////////
+// CAS
+//    pro.d := 2090-0.636*T;      // kg m-3
+//    pro.cp := 1443+0.172*T;     // J ke-1 K-1
+//    pro.k := 0.443+0.00019*T;   // W m-1 k-1
+//    pro.mu := (22.714-0.12*T+2.281*T*0.0001*T-1.474*T*0.0001*T*0.001*T)/1000;    //Pa s(kg m-1 s-1)
+
+//////////////////////////////////
+//PHD
+    pro.d := 1938.0-(0.732*(T-273-200));
+
+    pro.cp := 1561.7;
+
+    pro.k := 0.421-6.53e-4*(T-273-260);
+    pro.mu := Modelica.Math.exp(-4.343-2.0143*(Modelica.Math.log(T-273)-5.011));
+    //pro.mu :=(2.5-((T-273)-300)/(450-300))*0.001;
+//
+    pro.ddpT := 1e-6;
+    pro.ddTp := -0.732;
+  end if;
+
+  annotation (smoothOrder=2,Icon(graphics={
+        Text(extent={{-136,102},{140,42}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "function")}),
+                           Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end ThermoPropertiesFunction_T_2;
diff --git a/ThermoSysPro/Properties/MoltenSalt/ThermoProperties_T.mo b/ThermoSysPro/Properties/MoltenSalt/ThermoProperties_T.mo
index e9a07b924e1548019a8a6e130114c14373d26bf3..e40f127cd1320eae8f15e9376bd933cd94f5fcfb 100644
--- a/ThermoSysPro/Properties/MoltenSalt/ThermoProperties_T.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/ThermoProperties_T.mo
@@ -1,56 +1,56 @@
-within ThermoSysPro.Properties.MoltenSalt;
-record ThermoProperties_T
-  //ThermoSysPro.Units.AbsoluteTemperature T(
-    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.TMIN,
-    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.TMAX,
-    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.TNOM) "Temperature";
-  Units.SI.Density d(
-    min=HitecLimits.DMIN,
-    max=HitecLimits.DMAX,
-    nominal=HitecLimits.DNOM) "Density";
-  //Modelica.SIunits.SpecificEnergy u(
-    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.SEMIN,
-    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.SEMAX,
-    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.SENOM)
-    //"Specific inner energy";
-  //Modelica.SIunits.SpecificEntropy s(
-    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.SSMIN,
-    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.SSMAX,
-    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.SSNOM)
-    //"Specific entropy";
-  Units.SI.SpecificHeatCapacity cp(
-    min=HitecLimits.CPMIN,
-    max=HitecLimits.CPMAX,
-    nominal=HitecLimits.CPNOM) "Specific heat capacity at constant presure";
-
-  //Modelica.SIunits.DerDensityByEnthalpy ddhp
-    //"Derivative of density wrt. specific enthalpy at constant pressure";
-  //Modelica.SIunits.DerDensityByPressure ddph
-   // "Derivative of density wrt. pressure at constant specific enthalpy";
-  //Real duph(unit="m3/kg")
-    //"Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
-  //Real duhp(unit = "1")
-    //"Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
-  //ThermoSysPro.Units.MassFraction x "Vapor mass fraction";
-  Units.SI.ThermalConductivity k(
-    min=HitecLimits.LAMMIN,
-    max=HitecLimits.LAMMAX,
-    nominal=HitecLimits.LAMNOM);
-  Units.SI.DynamicViscosity mu(
-    min=HitecLimits.ETAMIN,
-    max=HitecLimits.ETAMAX,
-    nominal=HitecLimits.ETANOM);
-  Units.SI.DerDensityByTemperature ddTp;
-  Units.SI.DerDensityByPressure ddpT;
-  annotation (Icon(graphics={
-        Rectangle(
-          extent={{-100,60},{100,-90}},
-          lineColor={0,0,255},
-          fillColor={255,255,127},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-127,125},{127,65}}, textString=
-                                               "%name"),
-        Line(points={{-100,-40},{100,-40}}, color={0,0,0}),
-        Line(points={{-100,10},{100,10}}, color={0,0,0}),
-        Line(points={{0,60},{0,-90}}, color={0,0,0})}));
-end ThermoProperties_T;
+within ThermoSysPro.Properties.MoltenSalt;
+record ThermoProperties_T
+  //ThermoSysPro.Units.AbsoluteTemperature T(
+    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.TMIN,
+    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.TMAX,
+    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.TNOM) "Temperature";
+  Units.SI.Density d(
+    min=HitecLimits.DMIN,
+    max=HitecLimits.DMAX,
+    nominal=HitecLimits.DNOM) "Density";
+  //Modelica.SIunits.SpecificEnergy u(
+    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.SEMIN,
+    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.SEMAX,
+    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.SENOM)
+    //"Specific inner energy";
+  //Modelica.SIunits.SpecificEntropy s(
+    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.SSMIN,
+    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.SSMAX,
+    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.SSNOM)
+    //"Specific entropy";
+  Units.SI.SpecificHeatCapacity cp(
+    min=HitecLimits.CPMIN,
+    max=HitecLimits.CPMAX,
+    nominal=HitecLimits.CPNOM) "Specific heat capacity at constant presure";
+
+  //Modelica.SIunits.DerDensityByEnthalpy ddhp
+    //"Derivative of density wrt. specific enthalpy at constant pressure";
+  //Modelica.SIunits.DerDensityByPressure ddph
+   // "Derivative of density wrt. pressure at constant specific enthalpy";
+  //Real duph(unit="m3/kg")
+    //"Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
+  //Real duhp(unit = "1")
+    //"Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
+  //ThermoSysPro.Units.MassFraction x "Vapor mass fraction";
+  Units.SI.ThermalConductivity k(
+    min=HitecLimits.LAMMIN,
+    max=HitecLimits.LAMMAX,
+    nominal=HitecLimits.LAMNOM);
+  Units.SI.DynamicViscosity mu(
+    min=HitecLimits.ETAMIN,
+    max=HitecLimits.ETAMAX,
+    nominal=HitecLimits.ETANOM);
+  Units.SI.DerDensityByTemperature ddTp;
+  Units.SI.DerDensityByPressure ddpT;
+  annotation (Icon(graphics={
+        Rectangle(
+          extent={{-100,60},{100,-90}},
+          lineColor={0,0,255},
+          fillColor={255,255,127},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-127,125},{127,65}}, textString=
+                                               "%name"),
+        Line(points={{-100,-40},{100,-40}}, color={0,0,0}),
+        Line(points={{-100,10},{100,10}}, color={0,0,0}),
+        Line(points={{0,60},{0,-90}}, color={0,0,0})}));
+end ThermoProperties_T;
diff --git a/ThermoSysPro/Properties/MoltenSalt/ThermoProperties_h.mo b/ThermoSysPro/Properties/MoltenSalt/ThermoProperties_h.mo
index 38b858c1d7c1a9e87e86c06e24fe60fcf4b65cd7..7f1836127b75af29b19320618a9bf597d1e29a06 100644
--- a/ThermoSysPro/Properties/MoltenSalt/ThermoProperties_h.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/ThermoProperties_h.mo
@@ -1,56 +1,56 @@
-within ThermoSysPro.Properties.MoltenSalt;
-record ThermoProperties_h
-  //ThermoSysPro.Units.AbsoluteTemperature T(
-    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.TMIN,
-    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.TMAX,
-    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.TNOM) "Temperature";
-  Units.SI.Density d(
-    min=HitecLimits.DMIN,
-    max=HitecLimits.DMAX,
-    nominal=HitecLimits.DNOM) "Density";
-  //Modelica.SIunits.SpecificEnergy u(
-    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.SEMIN,
-    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.SEMAX,
-    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.SENOM)
-    //"Specific inner energy";
-  //Modelica.SIunits.SpecificEntropy s(
-    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.SSMIN,
-    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.SSMAX,
-    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.SSNOM)
-    //"Specific entropy";
-  Units.SI.SpecificHeatCapacity cp(
-    min=HitecLimits.CPMIN,
-    max=HitecLimits.CPMAX,
-    nominal=HitecLimits.CPNOM) "Specific heat capacity at constant presure";
-
-  //Modelica.SIunits.DerDensityByEnthalpy ddhp
-    //"Derivative of density wrt. specific enthalpy at constant pressure";
-  //Modelica.SIunits.DerDensityByPressure ddph
-   // "Derivative of density wrt. pressure at constant specific enthalpy";
-  //Real duph(unit="m3/kg")
-    //"Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
-  //Real duhp(unit = "1")
-    //"Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
-  //ThermoSysPro.Units.MassFraction x "Vapor mass fraction";
-  Units.SI.ThermalConductivity k(
-    min=HitecLimits.LAMMIN,
-    max=HitecLimits.LAMMAX,
-    nominal=HitecLimits.LAMNOM);
-  Units.SI.DynamicViscosity mu(
-    min=HitecLimits.ETAMIN,
-    max=HitecLimits.ETAMAX,
-    nominal=HitecLimits.ETANOM);
-  Units.SI.DerDensityByTemperature ddTp;
-  Units.SI.DerDensityByPressure ddpT;
-  annotation (Icon(graphics={
-        Rectangle(
-          extent={{-100,60},{100,-90}},
-          lineColor={28,108,200},
-          fillColor={255,255,127},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-127,125},{127,65}}, textString=
-                                               "%name"),
-        Line(points={{-100,-40},{100,-40}}, color={0,0,0}),
-        Line(points={{-100,10},{100,10}}, color={0,0,0}),
-        Line(points={{0,60},{0,-90}}, color={0,0,0})}));
-end ThermoProperties_h;
+within ThermoSysPro.Properties.MoltenSalt;
+record ThermoProperties_h
+  //ThermoSysPro.Units.AbsoluteTemperature T(
+    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.TMIN,
+    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.TMAX,
+    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.TNOM) "Temperature";
+  Units.SI.Density d(
+    min=HitecLimits.DMIN,
+    max=HitecLimits.DMAX,
+    nominal=HitecLimits.DNOM) "Density";
+  //Modelica.SIunits.SpecificEnergy u(
+    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.SEMIN,
+    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.SEMAX,
+    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.SENOM)
+    //"Specific inner energy";
+  //Modelica.SIunits.SpecificEntropy s(
+    //min=ThermoSysPro.Properties.WaterSteam.InitLimits.SSMIN,
+    //max=ThermoSysPro.Properties.WaterSteam.InitLimits.SSMAX,
+    //nominal=ThermoSysPro.Properties.WaterSteam.InitLimits.SSNOM)
+    //"Specific entropy";
+  Units.SI.SpecificHeatCapacity cp(
+    min=HitecLimits.CPMIN,
+    max=HitecLimits.CPMAX,
+    nominal=HitecLimits.CPNOM) "Specific heat capacity at constant presure";
+
+  //Modelica.SIunits.DerDensityByEnthalpy ddhp
+    //"Derivative of density wrt. specific enthalpy at constant pressure";
+  //Modelica.SIunits.DerDensityByPressure ddph
+   // "Derivative of density wrt. pressure at constant specific enthalpy";
+  //Real duph(unit="m3/kg")
+    //"Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
+  //Real duhp(unit = "1")
+    //"Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
+  //ThermoSysPro.Units.MassFraction x "Vapor mass fraction";
+  Units.SI.ThermalConductivity k(
+    min=HitecLimits.LAMMIN,
+    max=HitecLimits.LAMMAX,
+    nominal=HitecLimits.LAMNOM);
+  Units.SI.DynamicViscosity mu(
+    min=HitecLimits.ETAMIN,
+    max=HitecLimits.ETAMAX,
+    nominal=HitecLimits.ETANOM);
+  Units.SI.DerDensityByTemperature ddTp;
+  Units.SI.DerDensityByPressure ddpT;
+  annotation (Icon(graphics={
+        Rectangle(
+          extent={{-100,60},{100,-90}},
+          lineColor={28,108,200},
+          fillColor={255,255,127},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-127,125},{127,65}}, textString=
+                                               "%name"),
+        Line(points={{-100,-40},{100,-40}}, color={0,0,0}),
+        Line(points={{-100,10},{100,10}}, color={0,0,0}),
+        Line(points={{0,60},{0,-90}}, color={0,0,0})}));
+end ThermoProperties_h;
diff --git a/ThermoSysPro/Properties/MoltenSalt/derDensity_derT.mo b/ThermoSysPro/Properties/MoltenSalt/derDensity_derT.mo
index 670a9a915a9990c4d419984b86c3471913c13c68..d8ac431e8736b604ed39d896f2218d57c1c65e15 100644
--- a/ThermoSysPro/Properties/MoltenSalt/derDensity_derT.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/derDensity_derT.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function derDensity_derT "der(Density) computation for Salt (input der(T))"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  input Real der_T "Temperature time derivative (K/s)";
-  output Real der_rho "Density time derivative (kg/(m3*s))";
-
-protected
-    constant Real Density_c0 = 2263.87142553064;
-    constant Real Density_c1 = -0.636188210739603;
-
-algorithm
-  der_rho:= Density_c1 * der_T;  // STEPHANIE SQMSolarSalt
-
-end derDensity_derT;
+within ThermoSysPro.Properties.MoltenSalt;
+function derDensity_derT "der(Density) computation for Salt (input der(T))"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  input Real der_T "Temperature time derivative (K/s)";
+  output Real der_rho "Density time derivative (kg/(m3*s))";
+
+protected
+    constant Real Density_c0 = 2263.87142553064;
+    constant Real Density_c1 = -0.636188210739603;
+
+algorithm
+  der_rho:= Density_c1 * der_T;  // STEPHANIE SQMSolarSalt
+
+end derDensity_derT;
diff --git a/ThermoSysPro/Properties/MoltenSalt/derSpecificEnthalpy_derT.mo b/ThermoSysPro/Properties/MoltenSalt/derSpecificEnthalpy_derT.mo
index 18173caa834ad461015c52f82d738bacd08114bb..6f32b647a9f168d18e7627ba4e95af21b213c326 100644
--- a/ThermoSysPro/Properties/MoltenSalt/derSpecificEnthalpy_derT.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/derSpecificEnthalpy_derT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function derSpecificEnthalpy_derT
-  "der(Specific Enthalpy) computation for Salt (inputs: T, der(T))"
-
-  input Units.SI.Temperature T "Temperature (K)";
-  input Real der_temp "Temperature time derivative (K/s)";
-
-  output Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-
-// STEPHANIE SQMSolarSalt
-protected
-  constant Real Enthalpy_c0 = -809884.394575425;
-  constant Real Enthalpy_c1 = 1516.31623195732;
-
-algorithm
-  der_h := Enthalpy_c1 * der_temp;
-
-end derSpecificEnthalpy_derT;
+within ThermoSysPro.Properties.MoltenSalt;
+function derSpecificEnthalpy_derT
+  "der(Specific Enthalpy) computation for Salt (inputs: T, der(T))"
+
+  input Units.SI.Temperature T "Temperature (K)";
+  input Real der_temp "Temperature time derivative (K/s)";
+
+  output Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+
+// STEPHANIE SQMSolarSalt
+protected
+  constant Real Enthalpy_c0 = -809884.394575425;
+  constant Real Enthalpy_c1 = 1516.31623195732;
+
+algorithm
+  der_h := Enthalpy_c1 * der_temp;
+
+end derSpecificEnthalpy_derT;
diff --git a/ThermoSysPro/Properties/MoltenSalt/derTemperature_derh.mo b/ThermoSysPro/Properties/MoltenSalt/derTemperature_derh.mo
index e957410859607122f4183ff4dbe91791e444465a..b5d55c008af191c5dd9af669630493c14a65b022 100644
--- a/ThermoSysPro/Properties/MoltenSalt/derTemperature_derh.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/derTemperature_derh.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.MoltenSalt;
-function derTemperature_derh
-  "der(Temperature) computation for Salt (input der(h))"
-
-  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
-  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
-  output Real der_T "Fluid temperature time derivative (K/s)";
-
-protected
-    constant Real Temperature_c0 = 534.117625216440;
-    constant Real Temperature_c1 = 0.000659475113943680;
-
-algorithm
-      der_T:= Temperature_c1 * der_h;  // STEPHANIE SQMSolarSalt
-end derTemperature_derh;
+within ThermoSysPro.Properties.MoltenSalt;
+function derTemperature_derh
+  "der(Temperature) computation for Salt (input der(h))"
+
+  input Units.SI.SpecificEnthalpy h "Specific Enthalpy (J/kg)";
+  input Real der_h "Specific Enthalpy time derivative (J/(kg*s))";
+  output Real der_T "Fluid temperature time derivative (K/s)";
+
+protected
+    constant Real Temperature_c0 = 534.117625216440;
+    constant Real Temperature_c1 = 0.000659475113943680;
+
+algorithm
+      der_T:= Temperature_c1 * der_h;  // STEPHANIE SQMSolarSalt
+end derTemperature_derh;
diff --git a/ThermoSysPro/Properties/MoltenSalt/package.mo b/ThermoSysPro/Properties/MoltenSalt/package.mo
index dbc04a0487e73b45e9d042248680ad614f420898..86f0b0a89810e543674dc8acbb8125ad4257e1c3 100644
--- a/ThermoSysPro/Properties/MoltenSalt/package.mo
+++ b/ThermoSysPro/Properties/MoltenSalt/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Properties;
-package MoltenSalt "4 - Molten salt properties library"
-annotation (Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<p><b>ThermoSysPro Version 3.2</h4>
-</HTML>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end MoltenSalt;
+within ThermoSysPro.Properties;
+package MoltenSalt "4 - Molten salt properties library"
+annotation (Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<p><b>ThermoSysPro Version 3.2</h4>
+</HTML>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end MoltenSalt;
diff --git a/ThermoSysPro/Properties/MoltenSalt/package.order b/ThermoSysPro/Properties/MoltenSalt/package.order
index 9333a237d9e520975bc2da6e916f5183ea451127..0159261564df58061a61ad1124d384e592824ffd 100644
--- a/ThermoSysPro/Properties/MoltenSalt/package.order
+++ b/ThermoSysPro/Properties/MoltenSalt/package.order
@@ -1,18 +1,18 @@
-HitecLimits
-ThermoProperties_T
-ThermoPropertiesFunction_T_1
-Density_T
-derDensity_derT
-derSpecificEnthalpy_derT
-derTemperature_derh
-DynamicViscosity_dert
-DynamicViscosity_T
-SpecificEnthalpy_T
-SpecificHeatCapacityCp_T
-Temperature_derh
-Temperature_h
-TestTabSalt
-ThermalConductivity_T
-ThermoProperties_h
-ThermoPropertiesFunction_T_1_ErrT
-ThermoPropertiesFunction_T_2
+HitecLimits
+ThermoProperties_T
+ThermoPropertiesFunction_T_1
+Density_T
+derDensity_derT
+derSpecificEnthalpy_derT
+derTemperature_derh
+DynamicViscosity_dert
+DynamicViscosity_T
+SpecificEnthalpy_T
+SpecificHeatCapacityCp_T
+Temperature_derh
+Temperature_h
+TestTabSalt
+ThermalConductivity_T
+ThermoProperties_h
+ThermoPropertiesFunction_T_1_ErrT
+ThermoPropertiesFunction_T_2
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Density_T.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Density_T.mo
index 318ab7d2c061aa6ae0ebb2704990066afe63fb50..9f8e3c490cbd732f2e30d011e85b744a5706a8bd 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Density_T.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Density_T.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Density_T "Density as function of temperature"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.Density rho "Density (kg/m3)";
-protected
-    constant Real Density_c0 = 1156.4064882506063;
-    constant Real Density_c1 = 0.6335655001350703;
-    constant Real Density_c2 = -0.005323755286706528;
-    constant Real Density_c3 = 8.795308368738059e-6;
-    constant Real Density_c4 = -5.647327102558456e-9;
-algorithm
-        rho := Density_c0 + Density_c1 * temp + Density_c2 * temp ^ 2 + Density_c3 * temp ^ 3 + Density_c4 * temp ^ 4;
-   annotation(derivative = Density_derT, inverse(temp = Temperature_rho(rho)));
-end Density_T;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Density_T "Density as function of temperature"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.Density rho "Density (kg/m3)";
+protected
+    constant Real Density_c0 = 1156.4064882506063;
+    constant Real Density_c1 = 0.6335655001350703;
+    constant Real Density_c2 = -0.005323755286706528;
+    constant Real Density_c3 = 8.795308368738059e-6;
+    constant Real Density_c4 = -5.647327102558456e-9;
+algorithm
+        rho := Density_c0 + Density_c1 * temp + Density_c2 * temp ^ 2 + Density_c3 * temp ^ 3 + Density_c4 * temp ^ 4;
+   annotation(derivative = Density_derT, inverse(temp = Temperature_rho(rho)));
+end Density_T;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Density_derT.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Density_derT.mo
index da39321e4dc3b0118be83eb4d68795aaf0071f0c..7e4309560196d24d9a534e496aa479457191c1f5 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Density_derT.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Density_derT.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Density_derT
-  "Returns density time derivative as function of temperature and its derivative"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-    input Real der_temp "Fluid temperature time derivative (K/s)";
-    output Real der_rho "Density time derivative (kg/(m3*s))";
-protected
-    constant Real Density_c0 = 1156.4064882506063;
-    constant Real Density_c1 = 0.6335655001350703;
-    constant Real Density_c2 = -0.005323755286706528;
-    constant Real Density_c3 = 8.795308368738059e-6;
-    constant Real Density_c4 = -5.647327102558456e-9;
-algorithm
-        der_rho := Density_c1 * der_temp + 2 * Density_c2 * temp * der_temp + 3 * Density_c3 * temp ^ 2 * der_temp + 4 * Density_c4 * temp ^ 3 * der_temp;
-end Density_derT;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Density_derT
+  "Returns density time derivative as function of temperature and its derivative"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+    input Real der_temp "Fluid temperature time derivative (K/s)";
+    output Real der_rho "Density time derivative (kg/(m3*s))";
+protected
+    constant Real Density_c0 = 1156.4064882506063;
+    constant Real Density_c1 = 0.6335655001350703;
+    constant Real Density_c2 = -0.005323755286706528;
+    constant Real Density_c3 = 8.795308368738059e-6;
+    constant Real Density_c4 = -5.647327102558456e-9;
+algorithm
+        der_rho := Density_c1 * der_temp + 2 * Density_c2 * temp * der_temp + 3 * Density_c3 * temp ^ 2 * der_temp + 4 * Density_c4 * temp ^ 3 * der_temp;
+end Density_derT;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/DynamicViscosity_T.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/DynamicViscosity_T.mo
index 9eb90ccdc3bbb8a7153361bf17a15f01624237c6..6872c92c58cf2f9b2063f8cd7c99cd6e1428d8e8 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/DynamicViscosity_T.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/DynamicViscosity_T.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function DynamicViscosity_T
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.DynamicViscosity mu "Viscosity (Pa.s)";
-
-protected
-    constant Real Viscosity_cm2 = 66476.1563165124;
-    constant Real Viscosity_cm1 = -816.2382525469754;
-    constant Real Viscosity_c0 = 4.156281383007535;
-    constant Real Viscosity_c1 = -0.011190888024556169;
-    constant Real Viscosity_c2 = 0.000016779446462464305;
-    constant Real Viscosity_c3 = -1.3274228299674058e-8;
-    constant Real Viscosity_c4 = 4.327444414811259e-12;
-algorithm
-      mu := Viscosity_cm2 * temp ^ (-2) + Viscosity_cm1 * temp ^ (-1) + Viscosity_c0 + Viscosity_c1 * temp + Viscosity_c2 * temp ^ 2
-            + Viscosity_c3 * temp ^ 3 + Viscosity_c4 * temp ^ 4;
-   annotation(derivative = DynamicViscosity_derT);
-end DynamicViscosity_T;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function DynamicViscosity_T
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.DynamicViscosity mu "Viscosity (Pa.s)";
+
+protected
+    constant Real Viscosity_cm2 = 66476.1563165124;
+    constant Real Viscosity_cm1 = -816.2382525469754;
+    constant Real Viscosity_c0 = 4.156281383007535;
+    constant Real Viscosity_c1 = -0.011190888024556169;
+    constant Real Viscosity_c2 = 0.000016779446462464305;
+    constant Real Viscosity_c3 = -1.3274228299674058e-8;
+    constant Real Viscosity_c4 = 4.327444414811259e-12;
+algorithm
+      mu := Viscosity_cm2 * temp ^ (-2) + Viscosity_cm1 * temp ^ (-1) + Viscosity_c0 + Viscosity_c1 * temp + Viscosity_c2 * temp ^ 2
+            + Viscosity_c3 * temp ^ 3 + Viscosity_c4 * temp ^ 4;
+   annotation(derivative = DynamicViscosity_derT);
+end DynamicViscosity_T;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/DynamicViscosity_derT.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/DynamicViscosity_derT.mo
index f4faa6f7453e9fb77062271ffd742c1cfac0d134..6394901f1aac961a93c168859c3ce3a55833b0dc 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/DynamicViscosity_derT.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/DynamicViscosity_derT.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function DynamicViscosity_derT
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  input Real der_temp "Fluid temperature time derivative (K/S)";
-  output Real der_mu "dynamic viscosity time derivative (Pa)";
-protected
-    constant Real Viscosity_cm2 = 66476.1563165124;
-    constant Real Viscosity_cm1 = -816.2382525469754;
-    constant Real Viscosity_c0 = 4.156281383007535;
-    constant Real Viscosity_c1 = -0.011190888024556169;
-    constant Real Viscosity_c2 = 0.000016779446462464305;
-    constant Real Viscosity_c3 = -1.3274228299674058e-8;
-    constant Real Viscosity_c4 = 4.327444414811259e-12;
-algorithm
-    der_mu := -2 * Viscosity_cm2 * temp ^ (-3) * der_temp - 1 * Viscosity_cm1 * temp ^ (-2) * der_temp  + Viscosity_c1 * der_temp
-             + 2 * Viscosity_c2 * temp * der_temp + 3 * Viscosity_c3 * temp ^ 2 * der_temp + 4 * Viscosity_c4 * temp ^ 3 * der_temp;
-end DynamicViscosity_derT;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function DynamicViscosity_derT
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  input Real der_temp "Fluid temperature time derivative (K/S)";
+  output Real der_mu "dynamic viscosity time derivative (Pa)";
+protected
+    constant Real Viscosity_cm2 = 66476.1563165124;
+    constant Real Viscosity_cm1 = -816.2382525469754;
+    constant Real Viscosity_c0 = 4.156281383007535;
+    constant Real Viscosity_c1 = -0.011190888024556169;
+    constant Real Viscosity_c2 = 0.000016779446462464305;
+    constant Real Viscosity_c3 = -1.3274228299674058e-8;
+    constant Real Viscosity_c4 = 4.327444414811259e-12;
+algorithm
+    der_mu := -2 * Viscosity_cm2 * temp ^ (-3) * der_temp - 1 * Viscosity_cm1 * temp ^ (-2) * der_temp  + Viscosity_c1 * der_temp
+             + 2 * Viscosity_c2 * temp * der_temp + 3 * Viscosity_c3 * temp ^ 2 * der_temp + 4 * Viscosity_c4 * temp ^ 3 * der_temp;
+end DynamicViscosity_derT;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Enthalpy_T.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Enthalpy_T.mo
index 71fdca66887398b57fce3ecf62e1a4ae4829610d..399e2a264ad15d7bdf097ec820aa547e30d2fb05 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Enthalpy_T.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Enthalpy_T.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Enthalpy_T
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
-protected
-    constant Real Enthalpy_c0 = -293286.3733909648;
-    constant Real Enthalpy_c1 = 431.97125303499524;
-    constant Real Enthalpy_c2 = 2.4979677783334653;
-    constant Real Enthalpy_c3 = -0.001703284072503929;
-    constant Real Enthalpy_c4 = 9.291399490444641e-7;
-algorithm
-      h := Enthalpy_c0 + Enthalpy_c1 * temp + Enthalpy_c2 * temp ^ 2 + Enthalpy_c3 * temp ^ 3 + Enthalpy_c4 * temp ^ 4;
-   annotation(derivative = Enthalpy_derT, inverse(temp = Temperature_h(h)));
-end Enthalpy_T;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Enthalpy_T
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
+protected
+    constant Real Enthalpy_c0 = -293286.3733909648;
+    constant Real Enthalpy_c1 = 431.97125303499524;
+    constant Real Enthalpy_c2 = 2.4979677783334653;
+    constant Real Enthalpy_c3 = -0.001703284072503929;
+    constant Real Enthalpy_c4 = 9.291399490444641e-7;
+algorithm
+      h := Enthalpy_c0 + Enthalpy_c1 * temp + Enthalpy_c2 * temp ^ 2 + Enthalpy_c3 * temp ^ 3 + Enthalpy_c4 * temp ^ 4;
+   annotation(derivative = Enthalpy_derT, inverse(temp = Temperature_h(h)));
+end Enthalpy_T;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Enthalpy_derT.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Enthalpy_derT.mo
index 46c8f1d17a96c51cf4158744b3604e9b8c8dfb26..43bb59654b832b9d9255051a6d151e0de5f6d76c 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Enthalpy_derT.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Enthalpy_derT.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Enthalpy_derT
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-    input Real der_temp "Fluid temperature time derivative (K/s)";
-    output Real der_h "Enthalpy time derivative (J/(kg*s))";
-protected
-    constant Real Enthalpy_c0 = -293286.3733909648;
-    constant Real Enthalpy_c1 = 431.97125303499524;
-    constant Real Enthalpy_c2 = 2.4979677783334653;
-    constant Real Enthalpy_c3 = -0.001703284072503929;
-    constant Real Enthalpy_c4 = 9.291399490444641e-7;
-algorithm
-      der_h := Enthalpy_c1 * der_temp + 2 * Enthalpy_c2 * temp * der_temp + 3 * Enthalpy_c3 * temp ^ 2 * der_temp +
-               4 * Enthalpy_c4 * temp ^ 3 * der_temp;
-end Enthalpy_derT;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Enthalpy_derT
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+    input Real der_temp "Fluid temperature time derivative (K/s)";
+    output Real der_h "Enthalpy time derivative (J/(kg*s))";
+protected
+    constant Real Enthalpy_c0 = -293286.3733909648;
+    constant Real Enthalpy_c1 = 431.97125303499524;
+    constant Real Enthalpy_c2 = 2.4979677783334653;
+    constant Real Enthalpy_c3 = -0.001703284072503929;
+    constant Real Enthalpy_c4 = 9.291399490444641e-7;
+algorithm
+      der_h := Enthalpy_c1 * der_temp + 2 * Enthalpy_c2 * temp * der_temp + 3 * Enthalpy_c3 * temp ^ 2 * der_temp +
+               4 * Enthalpy_c4 * temp ^ 3 * der_temp;
+end Enthalpy_derT;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/SpecificHeatCp_T.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/SpecificHeatCp_T.mo
index 6c88c73cfaa34ff1eead73da14c403e04375f337..ed7aadaeeef077a978ec8559b9aebfd0064d93a9 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/SpecificHeatCp_T.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/SpecificHeatCp_T.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function SpecificHeatCp_T
-  "Specific heat capacity as function of temperature"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.SpecificHeatCapacity cp "Viscosity (Pa s)";
-protected
-    constant Real Cp_c0 = 1981.3598157651504;
-    constant Real Cp_c1 = -9.777411226193031;
-    constant Real Cp_c2 = 0.04589276204973768;
-    constant Real Cp_c3 = -0.0000720330461311355;
-    constant Real Cp_c4 = 4.0962689842346755e-8;
-algorithm
-      cp := Cp_c0 + Cp_c1 * temp + Cp_c2 * temp ^ 2 + Cp_c3 * temp ^ 3 + Cp_c4 * temp ^ 4;
-   annotation(inverse(temp = Temperature_cp(cp)), derivative = SpecificHeatCp_derT);
-end SpecificHeatCp_T;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function SpecificHeatCp_T
+  "Specific heat capacity as function of temperature"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.SpecificHeatCapacity cp "Viscosity (Pa s)";
+protected
+    constant Real Cp_c0 = 1981.3598157651504;
+    constant Real Cp_c1 = -9.777411226193031;
+    constant Real Cp_c2 = 0.04589276204973768;
+    constant Real Cp_c3 = -0.0000720330461311355;
+    constant Real Cp_c4 = 4.0962689842346755e-8;
+algorithm
+      cp := Cp_c0 + Cp_c1 * temp + Cp_c2 * temp ^ 2 + Cp_c3 * temp ^ 3 + Cp_c4 * temp ^ 4;
+   annotation(inverse(temp = Temperature_cp(cp)), derivative = SpecificHeatCp_derT);
+end SpecificHeatCp_T;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/SpecificHeatCp_derT.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/SpecificHeatCp_derT.mo
index 0699209e047f8886c7ae0622cf79285925a0ac98..b8033c83a7a73e168c354ba50af2cc0f1b96770e 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/SpecificHeatCp_derT.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/SpecificHeatCp_derT.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function SpecificHeatCp_derT "derivative of SpecificHeatCp_t"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  input Real der_temp "fluid temperature time derivative (K/s)";
-  output Real der_cp "specific heat capacity time derivative (J/kgKs)";
-protected
-    constant Real Cp_c0 = 1981.3598157651504;
-    constant Real Cp_c1 = -9.777411226193031;
-    constant Real Cp_c2 = 0.04589276204973768;
-    constant Real Cp_c3 = -0.0000720330461311355;
-    constant Real Cp_c4 = 4.0962689842346755e-8;
-algorithm
-   der_cp := Cp_c1 * der_temp + 2 * Cp_c2 * temp * der_temp + 3 * Cp_c3 * temp ^ 2 * der_temp + 4 * Cp_c4 * temp ^ 3 * der_temp;
-end SpecificHeatCp_derT;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function SpecificHeatCp_derT "derivative of SpecificHeatCp_t"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  input Real der_temp "fluid temperature time derivative (K/s)";
+  output Real der_cp "specific heat capacity time derivative (J/kgKs)";
+protected
+    constant Real Cp_c0 = 1981.3598157651504;
+    constant Real Cp_c1 = -9.777411226193031;
+    constant Real Cp_c2 = 0.04589276204973768;
+    constant Real Cp_c3 = -0.0000720330461311355;
+    constant Real Cp_c4 = 4.0962689842346755e-8;
+algorithm
+   der_cp := Cp_c1 * der_temp + 2 * Cp_c2 * temp * der_temp + 3 * Cp_c3 * temp ^ 2 * der_temp + 4 * Cp_c4 * temp ^ 3 * der_temp;
+end SpecificHeatCp_derT;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_cp.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_cp.mo
index 182ef74f4ef5f684c4e8963bab9d218a1b4b1f11..55485d34b1ec27be7b61908cf34f41dacc3d6861 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_cp.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_cp.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Temperature_cp "inverse function of SpecificHeatCp_t"
-  input Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-  constant Real temp_c0 = -1550.799964717781;
-  constant Real temp_c1 = 3.2657321743494627;
-  constant Real temp_c2 = -0.0024107039957429613;
-  constant Real temp_c3 = 8.707277494347506e-7;
-  constant Real temp_c4 = -1.15573614609828e-10;
-algorithm
-   temp := temp_c0 + temp_c1 * cp + temp_c2 * cp ^ 2 + temp_c3 * cp ^ 3 + temp_c4 * cp ^ 4;
-   annotation(inverse(cp = SpecificHeatCp_T(temp)), derivative = Temperature_dercp);
-end Temperature_cp;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Temperature_cp "inverse function of SpecificHeatCp_t"
+  input Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+  constant Real temp_c0 = -1550.799964717781;
+  constant Real temp_c1 = 3.2657321743494627;
+  constant Real temp_c2 = -0.0024107039957429613;
+  constant Real temp_c3 = 8.707277494347506e-7;
+  constant Real temp_c4 = -1.15573614609828e-10;
+algorithm
+   temp := temp_c0 + temp_c1 * cp + temp_c2 * cp ^ 2 + temp_c3 * cp ^ 3 + temp_c4 * cp ^ 4;
+   annotation(inverse(cp = SpecificHeatCp_T(temp)), derivative = Temperature_dercp);
+end Temperature_cp;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_dercp.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_dercp.mo
index a7d82db5f2a08f4475cecae0259dd002731877ea..0ad7bdf3e424078aad9609e004da01ddf438865e 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_dercp.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_dercp.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Temperature_dercp "derivative of Temperature_cp"
-  input Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
-  input Real der_cp "specific heat capacity time derivative (J/kgKs)";
-  output Real der_temp "fluid temperature time derivative (K/s)";
-protected
-  constant Real temp_c0 = -1550.799964717781;
-  constant Real temp_c1 = 3.2657321743494627;
-  constant Real temp_c2 = -0.0024107039957429613;
-  constant Real temp_c3 = 8.707277494347506e-7;
-  constant Real temp_c4 = -1.15573614609828e-10;
-algorithm
-   der_temp :=  temp_c1 * der_cp + 2 * temp_c2 * cp * der_cp + 3 * temp_c3 * cp ^ 2 * der_cp + 4 * temp_c4 * cp ^ 3 * der_cp;
-end Temperature_dercp;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Temperature_dercp "derivative of Temperature_cp"
+  input Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
+  input Real der_cp "specific heat capacity time derivative (J/kgKs)";
+  output Real der_temp "fluid temperature time derivative (K/s)";
+protected
+  constant Real temp_c0 = -1550.799964717781;
+  constant Real temp_c1 = 3.2657321743494627;
+  constant Real temp_c2 = -0.0024107039957429613;
+  constant Real temp_c3 = 8.707277494347506e-7;
+  constant Real temp_c4 = -1.15573614609828e-10;
+algorithm
+   der_temp :=  temp_c1 * der_cp + 2 * temp_c2 * cp * der_cp + 3 * temp_c3 * cp ^ 2 * der_cp + 4 * temp_c4 * cp ^ 3 * der_cp;
+end Temperature_dercp;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derh.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derh.mo
index 2a3235c419651b1a9f24502a21c12877e1842f44..2309d049e890d7f09ab9b335d5fe4bc801eecf93 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derh.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derh.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Temperature_derh
-  input Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
-    input Real der_h "Enthalpy time derivative (J/(kg*s))";
-    output Real der_temp "Fluid temperature time derivative (K/s)";
-protected
-    constant Real Temperature_c0 = 285.5140346333899;
-    constant Real Temperature_c1 = 0.0006466731366692376;
-    constant Real Temperature_c2 = -3.306821232762644e-10;
-    constant Real Temperature_c3 = 2.2587119472463197e-16;
-    constant Real Temperature_c4 = -8.27602313932381e-23;
-algorithm
-      der_temp := Temperature_c1 * der_h + 2 * Temperature_c2 * h * der_h + 3 * Temperature_c3 * h ^ 2 * der_h + 4 * Temperature_c4 * h ^ 3 * der_h;
-end Temperature_derh;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Temperature_derh
+  input Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
+    input Real der_h "Enthalpy time derivative (J/(kg*s))";
+    output Real der_temp "Fluid temperature time derivative (K/s)";
+protected
+    constant Real Temperature_c0 = 285.5140346333899;
+    constant Real Temperature_c1 = 0.0006466731366692376;
+    constant Real Temperature_c2 = -3.306821232762644e-10;
+    constant Real Temperature_c3 = 2.2587119472463197e-16;
+    constant Real Temperature_c4 = -8.27602313932381e-23;
+algorithm
+      der_temp := Temperature_c1 * der_h + 2 * Temperature_c2 * h * der_h + 3 * Temperature_c3 * h ^ 2 * der_h + 4 * Temperature_c4 * h ^ 3 * der_h;
+end Temperature_derh;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derk.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derk.mo
index 6503653e5662e0d034f1e9f2893de9b8a4666857..649b5ce8763d95886ef5c7cb29b66b5cf4a860ba 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derk.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derk.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Temperature_derk "derivative of Temperature_k"
-  input Units.SI.ThermalConductivity k "Thermal Conductivity (W/mK)";
-  input Real der_k "thermal conductivity time derivative (W/mKs)";
-  output Real der_temp "fluid temperature time derivative";
-protected
-    constant Real Temp_c0 = 475.2525031233294;
-    constant Real Temp_c1 = 18070.362425348725;
-    constant Real Temp_c2 = -358000.4271142386;
-    constant Real Temp_c3 = 2.593882865137215e6;
-    constant Real Temp_c4 = -7.422767475383265e6;
-algorithm
-   der_temp := Temp_c1 * der_k + 2 * Temp_c2 * k * der_k + 3 * Temp_c3 * k ^ 2 * der_k + 4 * Temp_c4 * k ^ 3 * der_k;
-end Temperature_derk;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Temperature_derk "derivative of Temperature_k"
+  input Units.SI.ThermalConductivity k "Thermal Conductivity (W/mK)";
+  input Real der_k "thermal conductivity time derivative (W/mKs)";
+  output Real der_temp "fluid temperature time derivative";
+protected
+    constant Real Temp_c0 = 475.2525031233294;
+    constant Real Temp_c1 = 18070.362425348725;
+    constant Real Temp_c2 = -358000.4271142386;
+    constant Real Temp_c3 = 2.593882865137215e6;
+    constant Real Temp_c4 = -7.422767475383265e6;
+algorithm
+   der_temp := Temp_c1 * der_k + 2 * Temp_c2 * k * der_k + 3 * Temp_c3 * k ^ 2 * der_k + 4 * Temp_c4 * k ^ 3 * der_k;
+end Temperature_derk;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derrho.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derrho.mo
index 40b8d76ddba898015a8e568eaff6b54b5bd133ce..3c6e97f9c41027410a51acbd5d3b81ca4d1be2b6 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derrho.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_derrho.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Temperature_derrho "derivative of Temperature_rho"
-  input Units.SI.Density rho "Density (kg/m3)";
-  input Real der_rho "Density time derivative (kg/(m3*s))";
-  output Real der_temp "Fluid temperature time derivative (K/s)";
-protected
-  constant Real Temp_c0 = 829.2269319387954;
-  constant Real Temp_c1 = -0.6032830735166413;
-  constant Real Temp_c2 = 0.0023861103439862656;
-  constant Real Temp_c3 = -3.586365918195385e-6;
-  constant Real Temp_c4 = 1.3461510759998317e-9;
-algorithm
-  der_temp :=  Temp_c1 * der_rho + 2 * Temp_c2 * rho * der_rho + 3 * Temp_c3 * rho ^ 2 *der_rho + 4 * Temp_c4 * rho ^ 3 * der_rho;
-end Temperature_derrho;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Temperature_derrho "derivative of Temperature_rho"
+  input Units.SI.Density rho "Density (kg/m3)";
+  input Real der_rho "Density time derivative (kg/(m3*s))";
+  output Real der_temp "Fluid temperature time derivative (K/s)";
+protected
+  constant Real Temp_c0 = 829.2269319387954;
+  constant Real Temp_c1 = -0.6032830735166413;
+  constant Real Temp_c2 = 0.0023861103439862656;
+  constant Real Temp_c3 = -3.586365918195385e-6;
+  constant Real Temp_c4 = 1.3461510759998317e-9;
+algorithm
+  der_temp :=  Temp_c1 * der_rho + 2 * Temp_c2 * rho * der_rho + 3 * Temp_c3 * rho ^ 2 *der_rho + 4 * Temp_c4 * rho ^ 3 * der_rho;
+end Temperature_derrho;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_h.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_h.mo
index ea85fac6918aaaad472e0596371372f726eb8c00..b83f9ecc14195d2c568c6b22a518990a8c77d435 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_h.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_h.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Temperature_h
-  input Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-    constant Real Temperature_c0 = 285.5140346333899;
-    constant Real Temperature_c1 = 0.0006466731366692376;
-    constant Real Temperature_c2 = -3.306821232762644e-10;
-    constant Real Temperature_c3 = 2.2587119472463197e-16;
-    constant Real Temperature_c4 = -8.27602313932381e-23;
-algorithm
-      temp := Temperature_c0 + Temperature_c1 * h + Temperature_c2 * h ^ 2 + Temperature_c3 * h ^ 3 + Temperature_c4 * h ^ 4;
-  annotation(derivative = Temperature_derh, inverse(h = Enthalpy_T(temp)));
-end Temperature_h;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Temperature_h
+  input Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+    constant Real Temperature_c0 = 285.5140346333899;
+    constant Real Temperature_c1 = 0.0006466731366692376;
+    constant Real Temperature_c2 = -3.306821232762644e-10;
+    constant Real Temperature_c3 = 2.2587119472463197e-16;
+    constant Real Temperature_c4 = -8.27602313932381e-23;
+algorithm
+      temp := Temperature_c0 + Temperature_c1 * h + Temperature_c2 * h ^ 2 + Temperature_c3 * h ^ 3 + Temperature_c4 * h ^ 4;
+  annotation(derivative = Temperature_derh, inverse(h = Enthalpy_T(temp)));
+end Temperature_h;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_k.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_k.mo
index 913d0a4ad9dc7df34e13b2be1aa9c40bc2281772..8973e80e3f4613c160614e3d4b5ed9bc6109806e 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_k.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_k.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Temperature_k "inverse function of ThermalConductivity_t"
-  input Units.SI.ThermalConductivity k "Thermal Conductivity";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-    constant Real Temp_c0 = 475.2525031233294;
-    constant Real Temp_c1 = 18070.362425348725;
-    constant Real Temp_c2 = -358000.4271142386;
-    constant Real Temp_c3 = 2.593882865137215e6;
-    constant Real Temp_c4 = -7.422767475383265e6;
-algorithm
-  temp := Temp_c0 + Temp_c1 * k + Temp_c2 * k ^ 2 + Temp_c3 * k ^ 3 + Temp_c4 * k ^ 4;
-  annotation(inverse(k = ThermalConductivity_T(temp)), derivative = Temperature_derk);
-end Temperature_k;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Temperature_k "inverse function of ThermalConductivity_t"
+  input Units.SI.ThermalConductivity k "Thermal Conductivity";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+    constant Real Temp_c0 = 475.2525031233294;
+    constant Real Temp_c1 = 18070.362425348725;
+    constant Real Temp_c2 = -358000.4271142386;
+    constant Real Temp_c3 = 2.593882865137215e6;
+    constant Real Temp_c4 = -7.422767475383265e6;
+algorithm
+  temp := Temp_c0 + Temp_c1 * k + Temp_c2 * k ^ 2 + Temp_c3 * k ^ 3 + Temp_c4 * k ^ 4;
+  annotation(inverse(k = ThermalConductivity_T(temp)), derivative = Temperature_derk);
+end Temperature_k;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_rho.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_rho.mo
index 93f9bf5003ab0cb731b2d8de1cdb21642a405777..57c7f5f8aec6a512384fc76c6edffc68bbc43521 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_rho.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/Temperature_rho.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function Temperature_rho "inverse of function Density_t"
-  input Units.SI.Density rho "Density (kg/m3)";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-  constant Real Temp_c0 = 829.2269319387954;
-  constant Real Temp_c1 = -0.6032830735166413;
-  constant Real Temp_c2 = 0.0023861103439862656;
-  constant Real Temp_c3 = -3.586365918195385e-6;
-  constant Real Temp_c4 = 1.3461510759998317e-9;
-algorithm
-  temp := Temp_c0 + Temp_c1 * rho + Temp_c2 * rho ^ 2 + Temp_c3 * rho ^ 3 + Temp_c4 * rho ^ 4;
- annotation(derivative = Temperature_derrho, inverse(rho = Density_T(temp)));
-end Temperature_rho;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function Temperature_rho "inverse of function Density_t"
+  input Units.SI.Density rho "Density (kg/m3)";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+  constant Real Temp_c0 = 829.2269319387954;
+  constant Real Temp_c1 = -0.6032830735166413;
+  constant Real Temp_c2 = 0.0023861103439862656;
+  constant Real Temp_c3 = -3.586365918195385e-6;
+  constant Real Temp_c4 = 1.3461510759998317e-9;
+algorithm
+  temp := Temp_c0 + Temp_c1 * rho + Temp_c2 * rho ^ 2 + Temp_c3 * rho ^ 3 + Temp_c4 * rho ^ 4;
+ annotation(derivative = Temperature_derrho, inverse(rho = Density_T(temp)));
+end Temperature_rho;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/ThermalConductivity_T.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/ThermalConductivity_T.mo
index 63120dc2f0979eb82d36ec26d4ab8fd62220f298..bf33cefe34966115af5a9504296029dfaeffdb70 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/ThermalConductivity_T.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/ThermalConductivity_T.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function ThermalConductivity_T
-  "thermal conductivity as function of fluid temperature"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.ThermalConductivity k "Viscosity (Pa s)";
-protected
-    constant Real Conductivity_c0 = 0.1511294630021525;
-    constant Real Conductivity_c1 = -0.000010409515731161305;
-    constant Real Conductivity_c2 = -1.1882172412077911e-7;
-    constant Real Conductivity_c3 = -7.181361572348715e-11;
-    constant Real Conductivity_c4 = 3.5395680933870214e-14;
-algorithm
-      k := Conductivity_c0 + Conductivity_c1 * temp + Conductivity_c2 * temp ^ 2 + Conductivity_c3 * temp ^ 3 + Conductivity_c4 * temp ^ 4;
-  annotation(inverse(temp = Temperature_k(k)), derivative = ThermalConductivity_derT);
-end ThermalConductivity_T;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function ThermalConductivity_T
+  "thermal conductivity as function of fluid temperature"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.ThermalConductivity k "Viscosity (Pa s)";
+protected
+    constant Real Conductivity_c0 = 0.1511294630021525;
+    constant Real Conductivity_c1 = -0.000010409515731161305;
+    constant Real Conductivity_c2 = -1.1882172412077911e-7;
+    constant Real Conductivity_c3 = -7.181361572348715e-11;
+    constant Real Conductivity_c4 = 3.5395680933870214e-14;
+algorithm
+      k := Conductivity_c0 + Conductivity_c1 * temp + Conductivity_c2 * temp ^ 2 + Conductivity_c3 * temp ^ 3 + Conductivity_c4 * temp ^ 4;
+  annotation(inverse(temp = Temperature_k(k)), derivative = ThermalConductivity_derT);
+end ThermalConductivity_T;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/ThermalConductivity_derT.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/ThermalConductivity_derT.mo
index 46a243c8f79160519fbaf1b58e8a99e4e6999724..45a9c1378c60f6a89324e3b9a3d085fc73eefd3a 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/ThermalConductivity_derT.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/ThermalConductivity_derT.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-function ThermalConductivity_derT "derivative of ThermalConductivity_T"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  input Real der_temp "fluid temperature time derivative (K/s)";
-  output Real der_k "thermal conductivity time derivative (W/mKs)";
-protected
-    constant Real Conductivity_c0 = 0.1511294630021525;
-    constant Real Conductivity_c1 = -0.000010409515731161305;
-    constant Real Conductivity_c2 = -1.1882172412077911e-7;
-    constant Real Conductivity_c3 = -7.181361572348715e-11;
-    constant Real Conductivity_c4 = 3.5395680933870214e-14;
-algorithm
-    der_k := Conductivity_c1 * der_temp + 2 * Conductivity_c2 * temp * der_temp + 3 * Conductivity_c3 * temp ^ 2 * der_temp
-             + 4 * Conductivity_c4 * temp ^ 3 * der_temp;
-end ThermalConductivity_derT;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+function ThermalConductivity_derT "derivative of ThermalConductivity_T"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  input Real der_temp "fluid temperature time derivative (K/s)";
+  output Real der_k "thermal conductivity time derivative (W/mKs)";
+protected
+    constant Real Conductivity_c0 = 0.1511294630021525;
+    constant Real Conductivity_c1 = -0.000010409515731161305;
+    constant Real Conductivity_c2 = -1.1882172412077911e-7;
+    constant Real Conductivity_c3 = -7.181361572348715e-11;
+    constant Real Conductivity_c4 = 3.5395680933870214e-14;
+algorithm
+    der_k := Conductivity_c1 * der_temp + 2 * Conductivity_c2 * temp * der_temp + 3 * Conductivity_c3 * temp ^ 2 * der_temp
+             + 4 * Conductivity_c4 * temp ^ 3 * der_temp;
+end ThermalConductivity_derT;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/TherminolVP1_Data.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/TherminolVP1_Data.mo
index 56e9b7f6e1438586acc8a524925daa16fd569f0c..e63ad72c75fb1c1c8ba6ae746d0b3da622327c45 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/TherminolVP1_Data.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/TherminolVP1_Data.mo
@@ -1,40 +1,40 @@
-within ThermoSysPro.Properties.Oil_TherminolVP1;
-record TherminolVP1_Data "Data for Oil from STEPHANIE Library"
-
-// STEPHANIE TherminolVP1
-  String mediumName = "TherminolVP1" "Name of the medium";
- // Temperature limits
-  Units.SI.Temperature maximum_temperature=405 + 273.15
-    "maximum fluid operating temperature allowed (K)";
-  Units.SI.Temperature minimum_temperature=15 + 273.15
-    "minimum fluid operating temperature allowed (K)";
- // Reference State
-  Units.SI.AbsolutePressure reference_pressure=101325
-    "Reference pressure of Medium: default 1 atmosphere";
-  Units.SI.SpecificEnthalpy reference_enthalpy=0
-    "Reference enthalpy of Medium: default @ 0 deg Celsius";
-  Units.SI.Temperature reference_temperature=323 + 273.15
-    "Reference Temperature of Medium: default 0 deg Celsius";
- // Default values (for initialization)
-  Units.SI.AbsolutePressure pressure_default=101325
-    "Default value for pressure of medium (for initialization)";
-  Units.SI.SpecificEnthalpy enthalpy_default=
-      ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(temp=323 + 273.15)
-    "Default value for enthalpy (@ 323ºC) of medium (for initialization)";
-  Units.SI.Temperature temperature_default=
-      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=enthalpy_default)
-    "Default value for temperature of medium (for initialization)";
-  Units.SI.Density density_default=
-      ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(temp=
-      temperature_default)
-    "Default value for density of medium (for initialization)";
-  Units.SI.DynamicViscosity dynamicViscosity_default=
-      ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(temp=
-      temperature_default)
-    "Default value for dynamic viscosity of medium (for initialization)";
- //
-  Boolean compressible = false "Wheter density depends on pressure or not";
-  Boolean usePartialDensityDerivatives = false
-    "=true if partial density derivatives with respect to state variables (e.g. pressure and enthalpy) are explicitely given as functions";
-
-end TherminolVP1_Data;
+within ThermoSysPro.Properties.Oil_TherminolVP1;
+record TherminolVP1_Data "Data for Oil from STEPHANIE Library"
+
+// STEPHANIE TherminolVP1
+  String mediumName = "TherminolVP1" "Name of the medium";
+ // Temperature limits
+  Units.SI.Temperature maximum_temperature=405 + 273.15
+    "maximum fluid operating temperature allowed (K)";
+  Units.SI.Temperature minimum_temperature=15 + 273.15
+    "minimum fluid operating temperature allowed (K)";
+ // Reference State
+  Units.SI.AbsolutePressure reference_pressure=101325
+    "Reference pressure of Medium: default 1 atmosphere";
+  Units.SI.SpecificEnthalpy reference_enthalpy=0
+    "Reference enthalpy of Medium: default @ 0 deg Celsius";
+  Units.SI.Temperature reference_temperature=323 + 273.15
+    "Reference Temperature of Medium: default 0 deg Celsius";
+ // Default values (for initialization)
+  Units.SI.AbsolutePressure pressure_default=101325
+    "Default value for pressure of medium (for initialization)";
+  Units.SI.SpecificEnthalpy enthalpy_default=
+      ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(temp=323 + 273.15)
+    "Default value for enthalpy (@ 323ºC) of medium (for initialization)";
+  Units.SI.Temperature temperature_default=
+      ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h=enthalpy_default)
+    "Default value for temperature of medium (for initialization)";
+  Units.SI.Density density_default=
+      ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(temp=
+      temperature_default)
+    "Default value for density of medium (for initialization)";
+  Units.SI.DynamicViscosity dynamicViscosity_default=
+      ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(temp=
+      temperature_default)
+    "Default value for dynamic viscosity of medium (for initialization)";
+ //
+  Boolean compressible = false "Wheter density depends on pressure or not";
+  Boolean usePartialDensityDerivatives = false
+    "=true if partial density derivatives with respect to state variables (e.g. pressure and enthalpy) are explicitely given as functions";
+
+end TherminolVP1_Data;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/package.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/package.mo
index 2ec157310fa74ea43703a6f904a9a30424991d46..7e9d3dedc346ae62df546b0b94daa82b112868ca 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/package.mo
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/package.mo
@@ -1,128 +1,128 @@
-within ThermoSysPro.Properties;
-package Oil_TherminolVP1 "5 - Thermal oil properties library from manufacturer tables at liquid state (incompressible fluid)"
-annotation (Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-</ul>
-</html>", info="<html>
-<p><b>ThermoSysPro Version 3.2</h4>
-</HTML>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Oil_TherminolVP1;
+within ThermoSysPro.Properties;
+package Oil_TherminolVP1 "5 - Thermal oil properties library from manufacturer tables at liquid state (incompressible fluid)"
+annotation (Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+</ul>
+</html>", info="<html>
+<p><b>ThermoSysPro Version 3.2</h4>
+</HTML>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Oil_TherminolVP1;
diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/package.order b/ThermoSysPro/Properties/Oil_TherminolVP1/package.order
index 03738bf12c0846de8ba3e8457d4480c290fce558..c7486df07bea255d71374c7770ed812916886e1c 100644
--- a/ThermoSysPro/Properties/Oil_TherminolVP1/package.order
+++ b/ThermoSysPro/Properties/Oil_TherminolVP1/package.order
@@ -1,19 +1,19 @@
-Density_derT
-Density_T
-DynamicViscosity_derT
-DynamicViscosity_T
-Enthalpy_derT
-Enthalpy_T
-SpecificHeatCp_derT
-SpecificHeatCp_T
-Temperature_cp
-Temperature_dercp
-Temperature_derh
-Temperature_derk
-Temperature_derrho
-Temperature_h
-Temperature_k
-Temperature_rho
-ThermalConductivity_derT
-ThermalConductivity_T
-TherminolVP1_Data
+Density_derT
+Density_T
+DynamicViscosity_derT
+DynamicViscosity_T
+Enthalpy_derT
+Enthalpy_T
+SpecificHeatCp_derT
+SpecificHeatCp_T
+Temperature_cp
+Temperature_dercp
+Temperature_derh
+Temperature_derk
+Temperature_derrho
+Temperature_h
+Temperature_k
+Temperature_rho
+ThermalConductivity_derT
+ThermalConductivity_T
+TherminolVP1_Data
diff --git a/ThermoSysPro/Properties/SolarSalt/Density_T.mo b/ThermoSysPro/Properties/SolarSalt/Density_T.mo
index a937d4fc293d80e9a3ccf10a6338d9df20a4c247..bd0aa2fba45bec132818b462479312fcf08aed0e 100644
--- a/ThermoSysPro/Properties/SolarSalt/Density_T.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Density_T.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Density_T
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.Density rho "Density (kg/m3)";
-protected
-    constant Real Density_c0 = 2263.7234;                //2090 - 0.636 (-273.15 + T)  = 2090 + 173.7234 - 0.636*T = 2263.7234 - 0.636*T
-    constant Real Density_c1 = - 0.636;
-
-algorithm
-      rho := Density_c0 + Density_c1 * temp;
-  annotation(derivative = Density_derT, inverse(temp = Temperature_rho(rho)));
-end Density_T;
+within ThermoSysPro.Properties.SolarSalt;
+function Density_T
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.Density rho "Density (kg/m3)";
+protected
+    constant Real Density_c0 = 2263.7234;                //2090 - 0.636 (-273.15 + T)  = 2090 + 173.7234 - 0.636*T = 2263.7234 - 0.636*T
+    constant Real Density_c1 = - 0.636;
+
+algorithm
+      rho := Density_c0 + Density_c1 * temp;
+  annotation(derivative = Density_derT, inverse(temp = Temperature_rho(rho)));
+end Density_T;
diff --git a/ThermoSysPro/Properties/SolarSalt/Density_derT.mo b/ThermoSysPro/Properties/SolarSalt/Density_derT.mo
index 4c51be5aa627064c204b6fed767ec426a6813ac1..fb30c31a059fd74da5fb145445aeca9ddfc4c7f3 100644
--- a/ThermoSysPro/Properties/SolarSalt/Density_derT.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Density_derT.mo
@@ -1,10 +1,10 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Density_derT
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-    input Real der_temp "Fluid temperature time derivative (K/s)";
-    output Real der_rho "Density time derivative (kg/(m3*s))";
-protected
-    constant Real Density_c1 = -0.636;
-algorithm
-   der_rho := Density_c1*der_temp;
-end Density_derT;
+within ThermoSysPro.Properties.SolarSalt;
+function Density_derT
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+    input Real der_temp "Fluid temperature time derivative (K/s)";
+    output Real der_rho "Density time derivative (kg/(m3*s))";
+protected
+    constant Real Density_c1 = -0.636;
+algorithm
+   der_rho := Density_c1*der_temp;
+end Density_derT;
diff --git a/ThermoSysPro/Properties/SolarSalt/DynamicViscosity_T.mo b/ThermoSysPro/Properties/SolarSalt/DynamicViscosity_T.mo
index c47e0f60e8378b52ef1eb2cbcb1a343128130e69..b59cb187a974e9de1bdc26031aed088fe0409685 100644
--- a/ThermoSysPro/Properties/SolarSalt/DynamicViscosity_T.mo
+++ b/ThermoSysPro/Properties/SolarSalt/DynamicViscosity_T.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.SolarSalt;
-function DynamicViscosity_T
-  input Units.SI.Temperature temp "Fluid temperature (K)";             //(22.714 - 0.12*(T - 273.15) + 2.281*10^(-4)*(T - 273.15)^2)/1000 - (1.474*10^(-7)*(T - 273.15)^3)/1000
-  output Units.SI.DynamicViscosity mu "Viscosity (Pa.s)";
-protected
-    constant Real Viscosity_c0 = 0.07551475951333098;
-    constant Real Viscosity_c1 = - 0.00027760397992950003;
-    constant Real Viscosity_c2 = 0.00000034888693;
-    constant Real Viscosity_c3 = - 0.00000000014739999;
-algorithm
-    mu := Viscosity_c0 + Viscosity_c1*temp + Viscosity_c2*temp^2 + Viscosity_c3*temp^3;
-  annotation(derivative = DynamicViscosity_derT, inverse(temp = Temperature_mu(mu)));
-end DynamicViscosity_T;
+within ThermoSysPro.Properties.SolarSalt;
+function DynamicViscosity_T
+  input Units.SI.Temperature temp "Fluid temperature (K)";             //(22.714 - 0.12*(T - 273.15) + 2.281*10^(-4)*(T - 273.15)^2)/1000 - (1.474*10^(-7)*(T - 273.15)^3)/1000
+  output Units.SI.DynamicViscosity mu "Viscosity (Pa.s)";
+protected
+    constant Real Viscosity_c0 = 0.07551475951333098;
+    constant Real Viscosity_c1 = - 0.00027760397992950003;
+    constant Real Viscosity_c2 = 0.00000034888693;
+    constant Real Viscosity_c3 = - 0.00000000014739999;
+algorithm
+    mu := Viscosity_c0 + Viscosity_c1*temp + Viscosity_c2*temp^2 + Viscosity_c3*temp^3;
+  annotation(derivative = DynamicViscosity_derT, inverse(temp = Temperature_mu(mu)));
+end DynamicViscosity_T;
diff --git a/ThermoSysPro/Properties/SolarSalt/DynamicViscosity_derT.mo b/ThermoSysPro/Properties/SolarSalt/DynamicViscosity_derT.mo
index 76c233144c25e365ea5d61388d4bcdd303eb40ed..277b65aa59def2e44f0edfb70db39d94d2761ba2 100644
--- a/ThermoSysPro/Properties/SolarSalt/DynamicViscosity_derT.mo
+++ b/ThermoSysPro/Properties/SolarSalt/DynamicViscosity_derT.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.SolarSalt;
-function DynamicViscosity_derT
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  input Real der_temp "Fluid temperature time derivative (K/S)";
-  output Real der_mu "dynamic viscosity time derivative (Pa)";
-protected
-    constant Real Viscosity_c0 = 0.07551475951333098;
-    constant Real Viscosity_c1 = - 0.00027760397992950003;
-    constant Real Viscosity_c2 = 0.00000034888693;
-    constant Real Viscosity_c3 = - 0.00000000014739999;
-algorithm
-    der_mu := Viscosity_c1*der_temp + 2*Viscosity_c2*temp*der_temp + 3*Viscosity_c3*temp^2*der_temp;
-end DynamicViscosity_derT;
+within ThermoSysPro.Properties.SolarSalt;
+function DynamicViscosity_derT
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  input Real der_temp "Fluid temperature time derivative (K/S)";
+  output Real der_mu "dynamic viscosity time derivative (Pa)";
+protected
+    constant Real Viscosity_c0 = 0.07551475951333098;
+    constant Real Viscosity_c1 = - 0.00027760397992950003;
+    constant Real Viscosity_c2 = 0.00000034888693;
+    constant Real Viscosity_c3 = - 0.00000000014739999;
+algorithm
+    der_mu := Viscosity_c1*der_temp + 2*Viscosity_c2*temp*der_temp + 3*Viscosity_c3*temp^2*der_temp;
+end DynamicViscosity_derT;
diff --git a/ThermoSysPro/Properties/SolarSalt/Enthalpy_T.mo b/ThermoSysPro/Properties/SolarSalt/Enthalpy_T.mo
index a421dcd9ce6ab1b82505dec5cdc3751c271b2a03..1bf36e5df9911d57aa508a0972046def58e016fc 100644
--- a/ThermoSysPro/Properties/SolarSalt/Enthalpy_T.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Enthalpy_T.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Enthalpy_T
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
-protected
-    constant Real Enthalpy_c0 = -798297.6386;
-    constant Real Enthalpy_c1 = 1396.0182;
-    constant Real Enthalpy_c2 = 0.086;
-algorithm
-     h := Enthalpy_c0 + Enthalpy_c1*temp + Enthalpy_c2*temp^2;
-  annotation(derivative = Enthalpy_derT, inverse(temp = Temperature_h(h)));
-end Enthalpy_T;
+within ThermoSysPro.Properties.SolarSalt;
+function Enthalpy_T
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
+protected
+    constant Real Enthalpy_c0 = -798297.6386;
+    constant Real Enthalpy_c1 = 1396.0182;
+    constant Real Enthalpy_c2 = 0.086;
+algorithm
+     h := Enthalpy_c0 + Enthalpy_c1*temp + Enthalpy_c2*temp^2;
+  annotation(derivative = Enthalpy_derT, inverse(temp = Temperature_h(h)));
+end Enthalpy_T;
diff --git a/ThermoSysPro/Properties/SolarSalt/Enthalpy_derT.mo b/ThermoSysPro/Properties/SolarSalt/Enthalpy_derT.mo
index 8d53a6987af313bf7c9b2f0557c1f10100eff98f..71f107189dc80f1abe51419009f2e052d8d1baa1 100644
--- a/ThermoSysPro/Properties/SolarSalt/Enthalpy_derT.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Enthalpy_derT.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Enthalpy_derT
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-    input Real der_temp "Fluid temperature time derivative (K/s)";
-    output Real der_h "Enthalpy time derivative (J/(kg*s))";
-protected
-    constant Real Enthalpy_c0 = -798297.6386;
-    constant Real Enthalpy_c1 = 1396.02;
-    constant Real Enthalpy_c2 = 0.086;
-algorithm
-    der_h := Enthalpy_c1*der_temp + 2*Enthalpy_c2*temp*der_temp;
-end Enthalpy_derT;
+within ThermoSysPro.Properties.SolarSalt;
+function Enthalpy_derT
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+    input Real der_temp "Fluid temperature time derivative (K/s)";
+    output Real der_h "Enthalpy time derivative (J/(kg*s))";
+protected
+    constant Real Enthalpy_c0 = -798297.6386;
+    constant Real Enthalpy_c1 = 1396.02;
+    constant Real Enthalpy_c2 = 0.086;
+algorithm
+    der_h := Enthalpy_c1*der_temp + 2*Enthalpy_c2*temp*der_temp;
+end Enthalpy_derT;
diff --git a/ThermoSysPro/Properties/SolarSalt/IsobaricExpansionCoefficient_T.mo b/ThermoSysPro/Properties/SolarSalt/IsobaricExpansionCoefficient_T.mo
index 11d6e80c332200193afdbe53e69100a1ff175bd1..32ae13c53ceac265795b454ed86a6bb49fbd86cb 100644
--- a/ThermoSysPro/Properties/SolarSalt/IsobaricExpansionCoefficient_T.mo
+++ b/ThermoSysPro/Properties/SolarSalt/IsobaricExpansionCoefficient_T.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.SolarSalt;
-function IsobaricExpansionCoefficient_T
-  "beta as function of temperature"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.CubicExpansionCoefficient beta
-    "isobaric expansion coefficient (1/K)";
-protected
-  constant Real betaC0 = 0.636;
-  constant Real betaC1 = 2263.72;
-  constant Real betaC2 = -0.636;
-algorithm
-   beta := betaC0/(betaC1 + betaC2*temp);
- annotation(inverse(temp = Temperature_beta(beta)),derivative = IsobaricExpansionCoefficient_derT);
-end IsobaricExpansionCoefficient_T;
+within ThermoSysPro.Properties.SolarSalt;
+function IsobaricExpansionCoefficient_T
+  "beta as function of temperature"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.CubicExpansionCoefficient beta
+    "isobaric expansion coefficient (1/K)";
+protected
+  constant Real betaC0 = 0.636;
+  constant Real betaC1 = 2263.72;
+  constant Real betaC2 = -0.636;
+algorithm
+   beta := betaC0/(betaC1 + betaC2*temp);
+ annotation(inverse(temp = Temperature_beta(beta)),derivative = IsobaricExpansionCoefficient_derT);
+end IsobaricExpansionCoefficient_T;
diff --git a/ThermoSysPro/Properties/SolarSalt/IsobaricExpansionCoefficient_derT.mo b/ThermoSysPro/Properties/SolarSalt/IsobaricExpansionCoefficient_derT.mo
index 120f0d3cd3b60f2243bf482b995f23caef98f2d6..46d2f15d5287c64d532bd80c9930f6e645431fc5 100644
--- a/ThermoSysPro/Properties/SolarSalt/IsobaricExpansionCoefficient_derT.mo
+++ b/ThermoSysPro/Properties/SolarSalt/IsobaricExpansionCoefficient_derT.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.SolarSalt;
-function IsobaricExpansionCoefficient_derT
-  "derivative of IsobaricExpansionCoefficient_T"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  input Real der_temp "fluid temperature time derivative (K/s)";
-  output Real der_beta "isobaric expansion coefficient time derivative (1/Ks)";
-protected
-  constant Real betaC0 = 0.636;
-  constant Real betaC1 = 2263.72;
-  constant Real betaC2 = -0.636;
-algorithm
-  der_beta := -((betaC0*betaC2)/(betaC1 + betaC2*temp)^2)*der_temp;
-end IsobaricExpansionCoefficient_derT;
+within ThermoSysPro.Properties.SolarSalt;
+function IsobaricExpansionCoefficient_derT
+  "derivative of IsobaricExpansionCoefficient_T"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  input Real der_temp "fluid temperature time derivative (K/s)";
+  output Real der_beta "isobaric expansion coefficient time derivative (1/Ks)";
+protected
+  constant Real betaC0 = 0.636;
+  constant Real betaC1 = 2263.72;
+  constant Real betaC2 = -0.636;
+algorithm
+  der_beta := -((betaC0*betaC2)/(betaC1 + betaC2*temp)^2)*der_temp;
+end IsobaricExpansionCoefficient_derT;
diff --git a/ThermoSysPro/Properties/SolarSalt/SpecificHeatCp_T.mo b/ThermoSysPro/Properties/SolarSalt/SpecificHeatCp_T.mo
index 142852dc250dfa13f8b7a7e77bf6dcceb6e5d18c..da051bf48274efa99878a560df6e30b2f59fe45d 100644
--- a/ThermoSysPro/Properties/SolarSalt/SpecificHeatCp_T.mo
+++ b/ThermoSysPro/Properties/SolarSalt/SpecificHeatCp_T.mo
@@ -1,11 +1,11 @@
-within ThermoSysPro.Properties.SolarSalt;
-function SpecificHeatCp_T
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
-protected
-    constant Real Cp_c0 = 1396.0182;                                     //1443 + 0.172 (-273.15 + T)
-    constant Real Cp_c1 = 0.172;
-algorithm
-      cp := Cp_c0 + Cp_c1*temp;
-  annotation(inverse(temp = Temperature_cp(cp)), derivative = SpecificHeatCp_derT);
-end SpecificHeatCp_T;
+within ThermoSysPro.Properties.SolarSalt;
+function SpecificHeatCp_T
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
+protected
+    constant Real Cp_c0 = 1396.0182;                                     //1443 + 0.172 (-273.15 + T)
+    constant Real Cp_c1 = 0.172;
+algorithm
+      cp := Cp_c0 + Cp_c1*temp;
+  annotation(inverse(temp = Temperature_cp(cp)), derivative = SpecificHeatCp_derT);
+end SpecificHeatCp_T;
diff --git a/ThermoSysPro/Properties/SolarSalt/SpecificHeatCp_derT.mo b/ThermoSysPro/Properties/SolarSalt/SpecificHeatCp_derT.mo
index edbb02bfe99700856d131daee6664fad88123ba0..90f4ce7e559746fed708b57a66f6c89d8d0e6bd8 100644
--- a/ThermoSysPro/Properties/SolarSalt/SpecificHeatCp_derT.mo
+++ b/ThermoSysPro/Properties/SolarSalt/SpecificHeatCp_derT.mo
@@ -1,10 +1,10 @@
-within ThermoSysPro.Properties.SolarSalt;
-function SpecificHeatCp_derT "derivative of SpecificHeatCp_T"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  input Real der_temp "fluid temperature time derivative (K/s)";
-  output Real der_cp "specific heat capacity time derivative (J/kgKs)";
-protected
-    constant Real Cp_c1 = 0.172;
-algorithm
-   der_cp := Cp_c1*der_temp;
-end SpecificHeatCp_derT;
+within ThermoSysPro.Properties.SolarSalt;
+function SpecificHeatCp_derT "derivative of SpecificHeatCp_T"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  input Real der_temp "fluid temperature time derivative (K/s)";
+  output Real der_cp "specific heat capacity time derivative (J/kgKs)";
+protected
+    constant Real Cp_c1 = 0.172;
+algorithm
+   der_cp := Cp_c1*der_temp;
+end SpecificHeatCp_derT;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_beta.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_beta.mo
index e6db45e29fff084b4d45e5724219497edbf4d94e..e6870c9db587d7828dac71b6005e7c09c19c7b56 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_beta.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_beta.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_beta "inverse function of IsobaricExpansionCoefficient_t"
-  input Units.SI.CubicExpansionCoefficient beta
-    "isobaric expansion coefficient (1/K)";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-  constant Real betaC0 = 0.636;
-  constant Real betaC1 = 2263.72;
-  constant Real betaC2 = -0.636;
-algorithm
-      temp := (betaC0 - beta*betaC1)/(beta*betaC2);
-   annotation(inverse(beta = IsobaricExpansionCoefficient_T(temp)), derivative = Temperature_derbeta);
-end Temperature_beta;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_beta "inverse function of IsobaricExpansionCoefficient_t"
+  input Units.SI.CubicExpansionCoefficient beta
+    "isobaric expansion coefficient (1/K)";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+  constant Real betaC0 = 0.636;
+  constant Real betaC1 = 2263.72;
+  constant Real betaC2 = -0.636;
+algorithm
+      temp := (betaC0 - beta*betaC1)/(beta*betaC2);
+   annotation(inverse(beta = IsobaricExpansionCoefficient_T(temp)), derivative = Temperature_derbeta);
+end Temperature_beta;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_cp.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_cp.mo
index dda5c81e8b5d68b2b9b2843c42197a5753fe03b8..142a6e0e5e19b0ef7f6684359c530c2aad6c309f 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_cp.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_cp.mo
@@ -1,11 +1,11 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_cp "inverse function of SpecificHeatCp_t"
-  input Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-  constant Real tempC0 = -8116.38;
-  constant Real tempC1 = 5.81395;
-algorithm
-   temp := tempC0 + tempC1*cp;
-   annotation(inverse(cp = SpecificHeatCp_T(temp)), derivative = Temperature_dercp);
-end Temperature_cp;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_cp "inverse function of SpecificHeatCp_t"
+  input Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+  constant Real tempC0 = -8116.38;
+  constant Real tempC1 = 5.81395;
+algorithm
+   temp := tempC0 + tempC1*cp;
+   annotation(inverse(cp = SpecificHeatCp_T(temp)), derivative = Temperature_dercp);
+end Temperature_cp;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_derbeta.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_derbeta.mo
index 446802f926a8f843911c209daba0cec1273b23f0..9a7903fa1f7722b546ae234158d1107f2176e0d0 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_derbeta.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_derbeta.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_derbeta "derivative of Temperature_beta"
-  input Units.SI.CubicExpansionCoefficient beta
-    "isobaric expansion coefficient (1/K)";
-  input Real der_beta "isobaric expansion coefficient time derivative (1/Ks)";
-  output Real der_temp "fluid temperature time derivative (K/s)";
-protected
-  constant Real betaC0 = 0.636;
-  constant Real betaC1 = 2263.72;
-  constant Real betaC2 = -0.636;
-algorithm
-  der_temp := (-(betaC1/(beta*betaC2)) - (betaC0 - beta*betaC1)/(beta^2*betaC2))*der_beta;
-end Temperature_derbeta;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_derbeta "derivative of Temperature_beta"
+  input Units.SI.CubicExpansionCoefficient beta
+    "isobaric expansion coefficient (1/K)";
+  input Real der_beta "isobaric expansion coefficient time derivative (1/Ks)";
+  output Real der_temp "fluid temperature time derivative (K/s)";
+protected
+  constant Real betaC0 = 0.636;
+  constant Real betaC1 = 2263.72;
+  constant Real betaC2 = -0.636;
+algorithm
+  der_temp := (-(betaC1/(beta*betaC2)) - (betaC0 - beta*betaC1)/(beta^2*betaC2))*der_beta;
+end Temperature_derbeta;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_dercp.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_dercp.mo
index b9803b4b2296d10180b4697b28e65fd0bff5f2ec..aad97763b8affb34bdbdd314a30146a4b1286e22 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_dercp.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_dercp.mo
@@ -1,10 +1,10 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_dercp "derivative of Temperature_cp"
-  input Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
-  input Real der_cp "specific heat capacity time derivative (J/kgKs)";
-  output Real der_temp "fluid temperature time derivative (K/s)";
-protected
-  constant Real tempC1 = 5.81395;
-algorithm
-   der_temp :=  tempC1*der_cp;
-end Temperature_dercp;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_dercp "derivative of Temperature_cp"
+  input Units.SI.SpecificHeatCapacity cp "Specific Heat Capacity (J/kgK)";
+  input Real der_cp "specific heat capacity time derivative (J/kgKs)";
+  output Real der_temp "fluid temperature time derivative (K/s)";
+protected
+  constant Real tempC1 = 5.81395;
+algorithm
+   der_temp :=  tempC1*der_cp;
+end Temperature_dercp;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_derh.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_derh.mo
index 4a043a3b6fbe975f57eea1451ebfde52734715c5..ec808cb40d47f4a6357d1b7dd3a3e2135d23cac5 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_derh.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_derh.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_derh
-  input Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
-    input Real der_h "Enthalpy time derivative (J/(kg*s))";
-    output Real der_temp "Fluid temperature time derivative (K/s)";
-protected
-    constant Real enthC0 = -798297.6386;
-    constant Real enthC1 = 1396.02;
-    constant Real enthC2 = 0.086;
-algorithm
-     der_temp:= 1/sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h)*der_h;
-end Temperature_derh;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_derh
+  input Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
+    input Real der_h "Enthalpy time derivative (J/(kg*s))";
+    output Real der_temp "Fluid temperature time derivative (K/s)";
+protected
+    constant Real enthC0 = -798297.6386;
+    constant Real enthC1 = 1396.02;
+    constant Real enthC2 = 0.086;
+algorithm
+     der_temp:= 1/sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h)*der_h;
+end Temperature_derh;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_derk.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_derk.mo
index fbf4405e5d40c04c02b492c15a1a6c26fe323a89..dfa9e1de1533c070cc9fbbde737aa84bfb99859c 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_derk.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_derk.mo
@@ -1,10 +1,10 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_derk "derivative of Temperature_k"
-  input Units.SI.ThermalConductivity k "Thermal Conductivity (W/mK)";
-  input Real der_k "thermal conductivity time derivative (W/mKs)";
-  output Real der_temp "fluid temperature time derivative";
-protected
-  constant Real tempC1 = 5263.16;
-algorithm
-   der_temp := tempC1*der_k;
-end Temperature_derk;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_derk "derivative of Temperature_k"
+  input Units.SI.ThermalConductivity k "Thermal Conductivity (W/mK)";
+  input Real der_k "thermal conductivity time derivative (W/mKs)";
+  output Real der_temp "fluid temperature time derivative";
+protected
+  constant Real tempC1 = 5263.16;
+algorithm
+   der_temp := tempC1*der_k;
+end Temperature_derk;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_dermu.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_dermu.mo
index b2dd9f77d81352a6f83f2eb04c763c019a1c10d1..783b111da6b4a5349a21498b672a179c8c2bf5a6 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_dermu.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_dermu.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_dermu "derivative of Temperature_mu"
-  input Units.SI.DynamicViscosity mu "Viscosity (Pa.s)";
-  input Real der_mu "Viscosity time derivative (Pa)";
-  output Real der_temp "Fluid temperature time derivative (K/s)";
-protected
-    constant Real viscC0 = 0.07551475951333098;
-    constant Real viscC1 = - 0.00027760397992950003;
-    constant Real viscC2 = 0.00000034888693;
-    constant Real viscC3 = - 0.00000000014739999;
-algorithm
-  der_temp :=(1/(6*viscC3))*(-(2*2^(1/3)*(viscC2^2 - 3*viscC1*viscC3)*(27*viscC3^2 - (27*viscC3^2*(2*viscC2^3 - 9*viscC1*viscC2*viscC3 +
-       27*(-mu + viscC0)*viscC3^2))/sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 - 9*viscC1*viscC2*viscC3 +
-       27*(-mu + viscC0)*viscC3^2)^2)))/(3*(-2*viscC2^3 + 9*viscC1*viscC2*viscC3 + 27*mu*viscC3^2 - 27*viscC0*viscC3^2 +
-       sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 - 9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2))^(4/3)) +
-       (2^(2/3)*(27*viscC3^2 - (27*viscC3^2*(2*viscC2^3 - 9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2))/sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 -
-       9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2)))/(3*(-2*viscC2^3 + 9*viscC1*viscC2*viscC3 + 27*mu*viscC3^2 - 27*viscC0*viscC3^2 +
-       sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 - 9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2))^(2/3)))*der_mu;
-end Temperature_dermu;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_dermu "derivative of Temperature_mu"
+  input Units.SI.DynamicViscosity mu "Viscosity (Pa.s)";
+  input Real der_mu "Viscosity time derivative (Pa)";
+  output Real der_temp "Fluid temperature time derivative (K/s)";
+protected
+    constant Real viscC0 = 0.07551475951333098;
+    constant Real viscC1 = - 0.00027760397992950003;
+    constant Real viscC2 = 0.00000034888693;
+    constant Real viscC3 = - 0.00000000014739999;
+algorithm
+  der_temp :=(1/(6*viscC3))*(-(2*2^(1/3)*(viscC2^2 - 3*viscC1*viscC3)*(27*viscC3^2 - (27*viscC3^2*(2*viscC2^3 - 9*viscC1*viscC2*viscC3 +
+       27*(-mu + viscC0)*viscC3^2))/sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 - 9*viscC1*viscC2*viscC3 +
+       27*(-mu + viscC0)*viscC3^2)^2)))/(3*(-2*viscC2^3 + 9*viscC1*viscC2*viscC3 + 27*mu*viscC3^2 - 27*viscC0*viscC3^2 +
+       sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 - 9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2))^(4/3)) +
+       (2^(2/3)*(27*viscC3^2 - (27*viscC3^2*(2*viscC2^3 - 9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2))/sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 -
+       9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2)))/(3*(-2*viscC2^3 + 9*viscC1*viscC2*viscC3 + 27*mu*viscC3^2 - 27*viscC0*viscC3^2 +
+       sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 - 9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2))^(2/3)))*der_mu;
+end Temperature_dermu;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_derrho.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_derrho.mo
index 38981d94685b9aaa44e5ed7d6b7a3245795f4e08..a00d00c3fb8cbc2f1befe9aee69777b77cd830b8 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_derrho.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_derrho.mo
@@ -1,10 +1,10 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_derrho "derivative of Temperature_rho"
-  input Units.SI.Density rho "Density (kg/m3)";
-  input Real der_rho "Density time derivative (kg/(m3*s))";
-  output Real der_temp "Fluid temperature time derivative (K/s)";
-protected
-  constant Real Temp_c1 = - 1.57233;
-algorithm
-  der_temp := Temp_c1*der_rho;
-end Temperature_derrho;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_derrho "derivative of Temperature_rho"
+  input Units.SI.Density rho "Density (kg/m3)";
+  input Real der_rho "Density time derivative (kg/(m3*s))";
+  output Real der_temp "Fluid temperature time derivative (K/s)";
+protected
+  constant Real Temp_c1 = - 1.57233;
+algorithm
+  der_temp := Temp_c1*der_rho;
+end Temperature_derrho;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_h.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_h.mo
index 427bf573077ab352fc5381b7057e9ac9e4d49622..1fa1f3762f51232908a834f6bec7f6aa4b4b2d28 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_h.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_h.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_h
-  input Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-    constant Real enthC0 = -798297.6386;
-    constant Real enthC1 = 1396.02;
-    constant Real enthC2 = 0.086;
-algorithm
-    temp := (-enthC1 + sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h))/(2*enthC2);
-  annotation(derivative = Temperature_derh, inverse(h = Enthalpy_T(temp)));
-end Temperature_h;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_h
+  input Units.SI.SpecificEnthalpy h "Enthalpy (J/kg)";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+    constant Real enthC0 = -798297.6386;
+    constant Real enthC1 = 1396.02;
+    constant Real enthC2 = 0.086;
+algorithm
+    temp := (-enthC1 + sqrt(enthC1^2 - 4*enthC0*enthC2 + 4*enthC2*h))/(2*enthC2);
+  annotation(derivative = Temperature_derh, inverse(h = Enthalpy_T(temp)));
+end Temperature_h;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_k.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_k.mo
index 275fed67421e55e48c0c6a54f78cd3d1df8e7fc4..4140ff93ff74217a6941e86faf2bd5b8c98a8416 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_k.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_k.mo
@@ -1,11 +1,11 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_k "inverse function of ThermalConductivity_t"
-  input Units.SI.ThermalConductivity k "Thermal Conductivity";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-  constant Real tempC0 = -2058.43;
-  constant Real tempC1 = 5263.16;
-algorithm
-  temp := tempC0 + tempC1*k;
-  annotation(inverse(k = ThermalConductivity_T(temp)), derivative = Temperature_derk);
-end Temperature_k;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_k "inverse function of ThermalConductivity_t"
+  input Units.SI.ThermalConductivity k "Thermal Conductivity";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+  constant Real tempC0 = -2058.43;
+  constant Real tempC1 = 5263.16;
+algorithm
+  temp := tempC0 + tempC1*k;
+  annotation(inverse(k = ThermalConductivity_T(temp)), derivative = Temperature_derk);
+end Temperature_k;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_mu.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_mu.mo
index a81c308933ba4acae0cdcf6f5d21801ca27a9c6a..b7ef13295ed90460a5faf72dabc07d2d0064386e 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_mu.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_mu.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_mu "inverse of DynamicViscosity_t"
-  input Units.SI.DynamicViscosity mu "Viscosity (Pa.s)";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-    constant Real viscC0 = 0.07551475951333098;
-    constant Real viscC1 = - 0.00027760397992950003;
-    constant Real viscC2 = 0.00000034888693;
-    constant Real viscC3 = - 0.00000000014739999;
-algorithm
-    temp := (1/(6*viscC3))*(-2*viscC2 + (2*2^(1/3)*(viscC2^2 - 3*viscC1*viscC3))/(-2*viscC2^3 +
-     9*viscC1*viscC2*viscC3 + 27*mu*viscC3^2 - 27*viscC0*viscC3^2 + sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 -
-     9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2))^(1/3) + 2^(2/3)*(-2*viscC2^3 + 9*viscC1*viscC2*viscC3 + 27*mu*viscC3^2 -
-     27*viscC0*viscC3^2 + sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 - 9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2))^(1/3));
-  annotation(derivative = Temperature_dermu, inverse(mu = DynamicViscosity_T(temp)));
-end Temperature_mu;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_mu "inverse of DynamicViscosity_t"
+  input Units.SI.DynamicViscosity mu "Viscosity (Pa.s)";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+    constant Real viscC0 = 0.07551475951333098;
+    constant Real viscC1 = - 0.00027760397992950003;
+    constant Real viscC2 = 0.00000034888693;
+    constant Real viscC3 = - 0.00000000014739999;
+algorithm
+    temp := (1/(6*viscC3))*(-2*viscC2 + (2*2^(1/3)*(viscC2^2 - 3*viscC1*viscC3))/(-2*viscC2^3 +
+     9*viscC1*viscC2*viscC3 + 27*mu*viscC3^2 - 27*viscC0*viscC3^2 + sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 -
+     9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2))^(1/3) + 2^(2/3)*(-2*viscC2^3 + 9*viscC1*viscC2*viscC3 + 27*mu*viscC3^2 -
+     27*viscC0*viscC3^2 + sqrt(-4*(viscC2^2 - 3*viscC1*viscC3)^3 + (2*viscC2^3 - 9*viscC1*viscC2*viscC3 + 27*(-mu + viscC0)*viscC3^2)^2))^(1/3));
+  annotation(derivative = Temperature_dermu, inverse(mu = DynamicViscosity_T(temp)));
+end Temperature_mu;
diff --git a/ThermoSysPro/Properties/SolarSalt/Temperature_rho.mo b/ThermoSysPro/Properties/SolarSalt/Temperature_rho.mo
index ee5681c524de8cec9dc6690b47517339941e7e9a..19c56505f39ad8cd7fbbabc6e9cbb3d03177ded3 100644
--- a/ThermoSysPro/Properties/SolarSalt/Temperature_rho.mo
+++ b/ThermoSysPro/Properties/SolarSalt/Temperature_rho.mo
@@ -1,11 +1,11 @@
-within ThermoSysPro.Properties.SolarSalt;
-function Temperature_rho "inverse of function Density_t"
-  input Units.SI.Density rho "Density (kg/m3)";
-  output Units.SI.Temperature temp "Fluid temperature (K)";
-protected
-  constant Real Temp_c0 = 3559.31;
-  constant Real Temp_c1 = - 1.57233;
-algorithm
-  temp := Temp_c0 + Temp_c1*rho;
- annotation(derivative = Temperature_derrho, inverse(rho = Density_T(temp)));
-end Temperature_rho;
+within ThermoSysPro.Properties.SolarSalt;
+function Temperature_rho "inverse of function Density_t"
+  input Units.SI.Density rho "Density (kg/m3)";
+  output Units.SI.Temperature temp "Fluid temperature (K)";
+protected
+  constant Real Temp_c0 = 3559.31;
+  constant Real Temp_c1 = - 1.57233;
+algorithm
+  temp := Temp_c0 + Temp_c1*rho;
+ annotation(derivative = Temperature_derrho, inverse(rho = Density_T(temp)));
+end Temperature_rho;
diff --git a/ThermoSysPro/Properties/SolarSalt/ThermalConductivity_T.mo b/ThermoSysPro/Properties/SolarSalt/ThermalConductivity_T.mo
index b82f91012d068eec41d8b58d76691860919f341f..7ff43017586f3846ad4b78d4ddb99415cea91bc5 100644
--- a/ThermoSysPro/Properties/SolarSalt/ThermalConductivity_T.mo
+++ b/ThermoSysPro/Properties/SolarSalt/ThermalConductivity_T.mo
@@ -1,11 +1,11 @@
-within ThermoSysPro.Properties.SolarSalt;
-function ThermalConductivity_T
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  output Units.SI.ThermalConductivity k "Thermal Conductivity";
-protected
-    constant Real Conductivity_c0 = 0.3911015;               // 0.443 + 0.00019 (-273.15 + T)
-    constant Real Conductivity_c1 = 0.00019;
-algorithm
-      k := Conductivity_c0 + Conductivity_c1*temp;
-  annotation(inverse(temp = Temperature_k(k)), derivative = ThermalConductivity_derT);
-end ThermalConductivity_T;
+within ThermoSysPro.Properties.SolarSalt;
+function ThermalConductivity_T
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  output Units.SI.ThermalConductivity k "Thermal Conductivity";
+protected
+    constant Real Conductivity_c0 = 0.3911015;               // 0.443 + 0.00019 (-273.15 + T)
+    constant Real Conductivity_c1 = 0.00019;
+algorithm
+      k := Conductivity_c0 + Conductivity_c1*temp;
+  annotation(inverse(temp = Temperature_k(k)), derivative = ThermalConductivity_derT);
+end ThermalConductivity_T;
diff --git a/ThermoSysPro/Properties/SolarSalt/ThermalConductivity_derT.mo b/ThermoSysPro/Properties/SolarSalt/ThermalConductivity_derT.mo
index d936794be3565afd39ae5ab9a027ece57738d308..8553b3103371a5078485dbb695f8ea84b09fd046 100644
--- a/ThermoSysPro/Properties/SolarSalt/ThermalConductivity_derT.mo
+++ b/ThermoSysPro/Properties/SolarSalt/ThermalConductivity_derT.mo
@@ -1,10 +1,10 @@
-within ThermoSysPro.Properties.SolarSalt;
-function ThermalConductivity_derT "derivative of ThermalConductivity_T"
-  input Units.SI.Temperature temp "Fluid temperature (K)";
-  input Real der_temp "fluid temperature time derivative (K/s)";
-  output Real der_k "thermal conductivity time derivative (W/mKs)";
-protected
-    constant Real Conductivity_c1 = 0.00019;
-algorithm
-    der_k := Conductivity_c1*der_temp;
-end ThermalConductivity_derT;
+within ThermoSysPro.Properties.SolarSalt;
+function ThermalConductivity_derT "derivative of ThermalConductivity_T"
+  input Units.SI.Temperature temp "Fluid temperature (K)";
+  input Real der_temp "fluid temperature time derivative (K/s)";
+  output Real der_k "thermal conductivity time derivative (W/mKs)";
+protected
+    constant Real Conductivity_c1 = 0.00019;
+algorithm
+    der_k := Conductivity_c1*der_temp;
+end ThermalConductivity_derT;
diff --git a/ThermoSysPro/Properties/SolarSalt/package.mo b/ThermoSysPro/Properties/SolarSalt/package.mo
index f26fd4659e7ed69f55446417deb02b4a7c22fc04..081ad86d1506b95c24273569b18e2a655b66cf73 100644
--- a/ThermoSysPro/Properties/SolarSalt/package.mo
+++ b/ThermoSysPro/Properties/SolarSalt/package.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.Properties;
-package SolarSalt "Molten salts properties library from manufacturer tables"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}), Documentation(info="<html>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>Implemented from&nbsp;the Stephanie&nbsp;tool.</h4>
-</html>"));
-end SolarSalt;
+within ThermoSysPro.Properties;
+package SolarSalt "Molten salts properties library from manufacturer tables"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}), Documentation(info="<html>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>Implemented from&nbsp;the Stephanie&nbsp;tool.</h4>
+</html>"));
+end SolarSalt;
diff --git a/ThermoSysPro/Properties/SolarSalt/package.order b/ThermoSysPro/Properties/SolarSalt/package.order
index 95bdf4a70e91bd6d44c709e677fdabc27a736b26..c63445b4c6b723343d316d1dec54a54d908fa29d 100644
--- a/ThermoSysPro/Properties/SolarSalt/package.order
+++ b/ThermoSysPro/Properties/SolarSalt/package.order
@@ -1,24 +1,24 @@
-Density_derT
-Density_T
-DynamicViscosity_derT
-DynamicViscosity_T
-Enthalpy_derT
-Enthalpy_T
-IsobaricExpansionCoefficient_derT
-IsobaricExpansionCoefficient_T
-SpecificHeatCp_derT
-SpecificHeatCp_T
-Temperature_beta
-Temperature_cp
-Temperature_derbeta
-Temperature_dercp
-Temperature_derh
-Temperature_derk
-Temperature_dermu
-Temperature_derrho
-Temperature_h
-Temperature_k
-Temperature_mu
-Temperature_rho
-ThermalConductivity_derT
-ThermalConductivity_T
+Density_derT
+Density_T
+DynamicViscosity_derT
+DynamicViscosity_T
+Enthalpy_derT
+Enthalpy_T
+IsobaricExpansionCoefficient_derT
+IsobaricExpansionCoefficient_T
+SpecificHeatCp_derT
+SpecificHeatCp_T
+Temperature_beta
+Temperature_cp
+Temperature_derbeta
+Temperature_dercp
+Temperature_derh
+Temperature_derk
+Temperature_dermu
+Temperature_derrho
+Temperature_h
+Temperature_k
+Temperature_mu
+Temperature_rho
+ThermalConductivity_derT
+ThermalConductivity_T
diff --git a/ThermoSysPro/Properties/WaterSolution/DTcristal_TX.mo b/ThermoSysPro/Properties/WaterSolution/DTcristal_TX.mo
index 6241348844a7db295717aa1eb33ca1067852d09d..bbf64f4304c22c704f9c01de461a0141084fd47f 100644
--- a/ThermoSysPro/Properties/WaterSolution/DTcristal_TX.mo
+++ b/ThermoSysPro/Properties/WaterSolution/DTcristal_TX.mo
@@ -1,51 +1,51 @@
-within ThermoSysPro.Properties.WaterSolution;
-function DTcristal_TX
-  "Temperature difference with the cristallisation of the H2O/LiBr solution as a function of T et Xh2o"
-  input Units.SI.Temperature T "Temperature";
-  input Real X "Water mass fraction in the solution";
-
-  output ThermoSysPro.Units.SI.TemperatureDifference DTc
-    "Temperature difference with cristallisation : > 0 = no cristallisation ; < 0 = cristallisation";
-
-protected
-  Real Xi "LiBr mass fraction in the solution";
-  Units.SI.Temperature Tc "Temperature in Celsius";
-  Units.SI.Temperature Tcrist "Cristallisation temperature in Celsius";
-
-algorithm
-  /* Units conversions */
-  Tc := T - 273.15;
-  Xi := 100*(1 - X);
-
-  /* Cristallisation temperature */
-  if (Xi < 0) then
-    Tcrist := 0;
-  elseif (Xi < 20) then
-    Tcrist := -0.1*Xi - 2.5e-2*Xi*Xi;
-  elseif (Xi < 39.2) then
-    Tcrist := -24.804347826087 + 2.43369565217391*Xi - 0.0896739130434783*Xi*Xi;
-  elseif (Xi < 49.2) then
-    Tcrist := -434.48275862069 + 15.3685385878489*Xi - 0.15303776683087*Xi*Xi;
-  elseif (Xi < 57.37) then
-    Tcrist := -1286.15172413793 + 41.6625287356322*Xi - 0.335632183908046*Xi*Xi;
-  elseif (Xi < 65.16) then
-    Tcrist := -1336.1 + 39.043*Xi - 0.2748*Xi*Xi;
-  elseif (Xi <= 70) then
-    Tcrist := -6266.7 + 175.74*Xi - 1.2114*Xi*Xi;
-  else
-    Tcrist := 1000;
-  end if;
-
-  /* Temperature difference with cristallisation */
-  DTc := Tc - Tcrist;
-
-  annotation (
-    smoothOrder=2,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end DTcristal_TX;
+within ThermoSysPro.Properties.WaterSolution;
+function DTcristal_TX
+  "Temperature difference with the cristallisation of the H2O/LiBr solution as a function of T et Xh2o"
+  input Units.SI.Temperature T "Temperature";
+  input Real X "Water mass fraction in the solution";
+
+  output ThermoSysPro.Units.SI.TemperatureDifference DTc
+    "Temperature difference with cristallisation : > 0 = no cristallisation ; < 0 = cristallisation";
+
+protected
+  Real Xi "LiBr mass fraction in the solution";
+  Units.SI.Temperature Tc "Temperature in Celsius";
+  Units.SI.Temperature Tcrist "Cristallisation temperature in Celsius";
+
+algorithm
+  /* Units conversions */
+  Tc := T - 273.15;
+  Xi := 100*(1 - X);
+
+  /* Cristallisation temperature */
+  if (Xi < 0) then
+    Tcrist := 0;
+  elseif (Xi < 20) then
+    Tcrist := -0.1*Xi - 2.5e-2*Xi*Xi;
+  elseif (Xi < 39.2) then
+    Tcrist := -24.804347826087 + 2.43369565217391*Xi - 0.0896739130434783*Xi*Xi;
+  elseif (Xi < 49.2) then
+    Tcrist := -434.48275862069 + 15.3685385878489*Xi - 0.15303776683087*Xi*Xi;
+  elseif (Xi < 57.37) then
+    Tcrist := -1286.15172413793 + 41.6625287356322*Xi - 0.335632183908046*Xi*Xi;
+  elseif (Xi < 65.16) then
+    Tcrist := -1336.1 + 39.043*Xi - 0.2748*Xi*Xi;
+  elseif (Xi <= 70) then
+    Tcrist := -6266.7 + 175.74*Xi - 1.2114*Xi*Xi;
+  else
+    Tcrist := 1000;
+  end if;
+
+  /* Temperature difference with cristallisation */
+  DTc := Tc - Tcrist;
+
+  annotation (
+    smoothOrder=2,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end DTcristal_TX;
diff --git a/ThermoSysPro/Properties/WaterSolution/MassFraction_eq_PT.mo b/ThermoSysPro/Properties/WaterSolution/MassFraction_eq_PT.mo
index f7e6980b0b28b7c2ec117738d908bb4893be1f36..2aa0bbb44dc6e928c1b434d3891f70cc25fbd1a1 100644
--- a/ThermoSysPro/Properties/WaterSolution/MassFraction_eq_PT.mo
+++ b/ThermoSysPro/Properties/WaterSolution/MassFraction_eq_PT.mo
@@ -1,53 +1,53 @@
-within ThermoSysPro.Properties.WaterSolution;
-function MassFraction_eq_PT
-  "Equilibrium mass fraction of the H2O/LiBr solution as a function of T et Xh2o"
-  input Units.SI.AbsolutePressure P "Pressure";
-  input Units.SI.Temperature T "Temperature";
-
-  output Real Xe "Equilibrium mass fraction";
-
-protected
-  Real lnP "ln de la pression en Pa";
-  Real lnPlim "limite des zones du ln de la pression en Pa";
-  Real Tinv "Inverse négatif de la température";
-
-  Real A1 "Coefficient directeur zone inférieure";
-  Real B1 "Ordonnée à l'origine zone inférieure";
-  Real A2 "Coefficient directeur zone supérieure";
-  Real B2 "Ordonnée à l'origine zone supérieure";
-  Real a "Coefficient directeur de la loi ln P lim = a (-1/T) + b";
-  Real b "Ordonnée à l'origine de la loi ln P lim = a (-1/T) + b";
-
-algorithm
-  /* Units conversions */
-  lnP := log(P);
-  Tinv := -1/T;
-
-  /* Computation of the coefficients */
-  A1 := 7.05850237E+03*Tinv*Tinv + 7.29531684E+01*Tinv + 2.64270714E-01;
-  B1 := -2.19138115E+05*Tinv*Tinv - 2.18532823E+03*Tinv - 5.01454826E+00;
-  A2 := 1.12723416E+04*Tinv*Tinv - 1.34083981E+01*Tinv + 4.63220115E-01;
-  B2 := 3.49286405E+05*Tinv*Tinv - 4.15474563E+02*Tinv - 9.41938792E+00;
-
-  /* Compuation of the zone limits */
-  a := 5379.103071;
-  b := 25.44182656;
-  lnPlim := a * Tinv + b;
-
-  /* Equilibrium pressure */
-  if (lnP < lnPlim) then
-    Xe := A1*lnP + B1;
-  else
-    Xe := A2*lnP + B2;
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end MassFraction_eq_PT;
+within ThermoSysPro.Properties.WaterSolution;
+function MassFraction_eq_PT
+  "Equilibrium mass fraction of the H2O/LiBr solution as a function of T et Xh2o"
+  input Units.SI.AbsolutePressure P "Pressure";
+  input Units.SI.Temperature T "Temperature";
+
+  output Real Xe "Equilibrium mass fraction";
+
+protected
+  Real lnP "ln de la pression en Pa";
+  Real lnPlim "limite des zones du ln de la pression en Pa";
+  Real Tinv "Inverse négatif de la température";
+
+  Real A1 "Coefficient directeur zone inférieure";
+  Real B1 "Ordonnée à l'origine zone inférieure";
+  Real A2 "Coefficient directeur zone supérieure";
+  Real B2 "Ordonnée à l'origine zone supérieure";
+  Real a "Coefficient directeur de la loi ln P lim = a (-1/T) + b";
+  Real b "Ordonnée à l'origine de la loi ln P lim = a (-1/T) + b";
+
+algorithm
+  /* Units conversions */
+  lnP := log(P);
+  Tinv := -1/T;
+
+  /* Computation of the coefficients */
+  A1 := 7.05850237E+03*Tinv*Tinv + 7.29531684E+01*Tinv + 2.64270714E-01;
+  B1 := -2.19138115E+05*Tinv*Tinv - 2.18532823E+03*Tinv - 5.01454826E+00;
+  A2 := 1.12723416E+04*Tinv*Tinv - 1.34083981E+01*Tinv + 4.63220115E-01;
+  B2 := 3.49286405E+05*Tinv*Tinv - 4.15474563E+02*Tinv - 9.41938792E+00;
+
+  /* Compuation of the zone limits */
+  a := 5379.103071;
+  b := 25.44182656;
+  lnPlim := a * Tinv + b;
+
+  /* Equilibrium pressure */
+  if (lnP < lnPlim) then
+    Xe := A1*lnP + B1;
+  else
+    Xe := A2*lnP + B2;
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end MassFraction_eq_PT;
diff --git a/ThermoSysPro/Properties/WaterSolution/Pressure_eq_TX.mo b/ThermoSysPro/Properties/WaterSolution/Pressure_eq_TX.mo
index 101eb90f1ab4185710e527429703d83a2c4711fb..78967201b2940c94077dc26a82638e0cb5eac9b6 100644
--- a/ThermoSysPro/Properties/WaterSolution/Pressure_eq_TX.mo
+++ b/ThermoSysPro/Properties/WaterSolution/Pressure_eq_TX.mo
@@ -1,93 +1,93 @@
-within ThermoSysPro.Properties.WaterSolution;
-function Pressure_eq_TX
-  "Equilibrium pressure of the H2O/LiBr solution as a funciton of T and Xh2o"
-  input Units.SI.Temperature T "Temperature";
-  input Real X "Water mass fraction in the solution";
-
-  output Units.SI.AbsolutePressure Pe "Equilibrium pressure of the solution";
-
-protected
-  Real a "Coefficient directeur de la loi ln P = a (-1/T) + b";
-  Real b "Ordonnée à l'origine de la loi ln P = a (-1/T) + b";
-  Real A1 "Coefficient directeur borne inférieure";
-  Real B1 "Ordonnée à l'origine borne inférieure";
-  Real A2 "Coefficient directeur borne supérieure";
-  Real B2 "Ordonnée à l'origine borne supérieure";
-
-// Table utilisée extraite d'un diagramme de Oldham
-// Xh2o     a               b
-// 1        5467.383523        26.36790788
-// 0.6        5379.103071        25.44182656
-// 0.55        5304.170432        24.93793936
-// 0.5        5438.215285        24.96552904
-// 0.45        5624.954368        25.04073086
-// 0.4        5862.125101        25.2166991
-// 0.35        6036.317803        25.22194134
-// 0.3        5904.887091        24.38414762
-
-algorithm
-  /* Cristallisaiton temperature */
-  if (X>0.6) then
-    A1 := 5467.383523;
-    A2 := 5379.103071;
-    B1 := 26.36790788;
-    B2 := 25.44182656;
-    a := A1 + (A2 - A1)/(0.6 - 1) * (X - 1);
-    b := B1 + (B2 - B1)/(0.6 - 1) * (X - 1);
-  elseif (X>0.55) then
-    A1 := 5379.103071;
-    A2 := 5304.170432;
-    B1 := 25.44182656;
-    B2 := 24.93793936;
-    a := A1 + (A2 - A1)/(0.55 - 0.6) * (X - 0.6);
-    b := B1 + (B2 - B1)/(0.55 - 0.6) * (X - 0.6);
-  elseif (X>0.5) then
-    A1 := 5304.170432;
-    A2 := 5438.215285;
-    B1 := 24.93793936;
-    B2 := 24.96552904;
-    a := A1 + (A2 - A1)/(0.5 - 0.55) * (X - 0.55);
-    b := B1 + (B2 - B1)/(0.5 - 0.55) * (X - 0.55);
-  elseif (X>0.45) then
-    A1 := 5438.215285;
-    A2 := 5624.954368;
-    B1 := 24.96552904;
-    B2 := 25.04073086;
-    a := A1 + (A2 - A1)/(0.45 - 0.5) * (X - 0.5);
-    b := B1 + (B2 - B1)/(0.45 - 0.5) * (X - 0.5);
-  elseif (X>0.4) then
-    A1 := 5624.954368;
-    A2 := 5862.125101;
-    B1 := 25.04073086;
-    B2 := 25.2166991;
-    a := A1 + (A2 - A1)/(0.4 - 0.45) * (X - 0.45);
-    b := B1 + (B2 - B1)/(0.4 - 0.45) * (X - 0.45);
-  elseif (X>0.35) then
-    A1 := 5862.125101;
-    A2 := 6036.317803;
-    B1 := 25.2166991;
-    B2 := 25.22194134;
-    a := A1 + (A2 - A1)/(0.35 - 0.4) * (X - 0.4);
-    b := B1 + (B2 - B1)/(0.35 - 0.4) * (X - 0.4);
-  else
-    A1 := 6036.317803;
-    A2 := 5904.887091;
-    B1 := 25.22194134;
-    B2 := 24.38414762;
-    a := A1 + (A2 - A1)/(0.3 - 0.35) * (X - 0.35);
-    b := B1 + (B2 - B1)/(0.3 - 0.35) * (X - 0.35);
-  end if;
-
-  /* Equilibrium pressure of the solution */
-  Pe := exp(a * (-1 / T) + b);
-
-  annotation (
-    smoothOrder=2,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Pressure_eq_TX;
+within ThermoSysPro.Properties.WaterSolution;
+function Pressure_eq_TX
+  "Equilibrium pressure of the H2O/LiBr solution as a funciton of T and Xh2o"
+  input Units.SI.Temperature T "Temperature";
+  input Real X "Water mass fraction in the solution";
+
+  output Units.SI.AbsolutePressure Pe "Equilibrium pressure of the solution";
+
+protected
+  Real a "Coefficient directeur de la loi ln P = a (-1/T) + b";
+  Real b "Ordonnée à l'origine de la loi ln P = a (-1/T) + b";
+  Real A1 "Coefficient directeur borne inférieure";
+  Real B1 "Ordonnée à l'origine borne inférieure";
+  Real A2 "Coefficient directeur borne supérieure";
+  Real B2 "Ordonnée à l'origine borne supérieure";
+
+// Table utilisée extraite d'un diagramme de Oldham
+// Xh2o     a               b
+// 1        5467.383523        26.36790788
+// 0.6        5379.103071        25.44182656
+// 0.55        5304.170432        24.93793936
+// 0.5        5438.215285        24.96552904
+// 0.45        5624.954368        25.04073086
+// 0.4        5862.125101        25.2166991
+// 0.35        6036.317803        25.22194134
+// 0.3        5904.887091        24.38414762
+
+algorithm
+  /* Cristallisaiton temperature */
+  if (X>0.6) then
+    A1 := 5467.383523;
+    A2 := 5379.103071;
+    B1 := 26.36790788;
+    B2 := 25.44182656;
+    a := A1 + (A2 - A1)/(0.6 - 1) * (X - 1);
+    b := B1 + (B2 - B1)/(0.6 - 1) * (X - 1);
+  elseif (X>0.55) then
+    A1 := 5379.103071;
+    A2 := 5304.170432;
+    B1 := 25.44182656;
+    B2 := 24.93793936;
+    a := A1 + (A2 - A1)/(0.55 - 0.6) * (X - 0.6);
+    b := B1 + (B2 - B1)/(0.55 - 0.6) * (X - 0.6);
+  elseif (X>0.5) then
+    A1 := 5304.170432;
+    A2 := 5438.215285;
+    B1 := 24.93793936;
+    B2 := 24.96552904;
+    a := A1 + (A2 - A1)/(0.5 - 0.55) * (X - 0.55);
+    b := B1 + (B2 - B1)/(0.5 - 0.55) * (X - 0.55);
+  elseif (X>0.45) then
+    A1 := 5438.215285;
+    A2 := 5624.954368;
+    B1 := 24.96552904;
+    B2 := 25.04073086;
+    a := A1 + (A2 - A1)/(0.45 - 0.5) * (X - 0.5);
+    b := B1 + (B2 - B1)/(0.45 - 0.5) * (X - 0.5);
+  elseif (X>0.4) then
+    A1 := 5624.954368;
+    A2 := 5862.125101;
+    B1 := 25.04073086;
+    B2 := 25.2166991;
+    a := A1 + (A2 - A1)/(0.4 - 0.45) * (X - 0.45);
+    b := B1 + (B2 - B1)/(0.4 - 0.45) * (X - 0.45);
+  elseif (X>0.35) then
+    A1 := 5862.125101;
+    A2 := 6036.317803;
+    B1 := 25.2166991;
+    B2 := 25.22194134;
+    a := A1 + (A2 - A1)/(0.35 - 0.4) * (X - 0.4);
+    b := B1 + (B2 - B1)/(0.35 - 0.4) * (X - 0.4);
+  else
+    A1 := 6036.317803;
+    A2 := 5904.887091;
+    B1 := 25.22194134;
+    B2 := 24.38414762;
+    a := A1 + (A2 - A1)/(0.3 - 0.35) * (X - 0.35);
+    b := B1 + (B2 - B1)/(0.3 - 0.35) * (X - 0.35);
+  end if;
+
+  /* Equilibrium pressure of the solution */
+  Pe := exp(a * (-1 / T) + b);
+
+  annotation (
+    smoothOrder=2,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Pressure_eq_TX;
diff --git a/ThermoSysPro/Properties/WaterSolution/SpecificEnthalpy_TX.mo b/ThermoSysPro/Properties/WaterSolution/SpecificEnthalpy_TX.mo
index a8a6c1caa70860a781b8d7c71dd070013fe88eb6..6921fd387b47c86c0b2e4ee487ea4ce1c97a2ae9 100644
--- a/ThermoSysPro/Properties/WaterSolution/SpecificEnthalpy_TX.mo
+++ b/ThermoSysPro/Properties/WaterSolution/SpecificEnthalpy_TX.mo
@@ -1,58 +1,58 @@
-within ThermoSysPro.Properties.WaterSolution;
-function SpecificEnthalpy_TX
-  "Specific enthalpy of the H2O/LiBr solution as a function of T and Xh2o"
-  input Units.SI.Temperature T "Temperature";
-  input Real X "Water mass fraction in the solution";
-
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy of the solution";
-
-protected
-  Real C1;
-  Real C2;
-  Real C3;
-  Real C4;
-  Real C5;
-  Real DXi;
-  Real Xi "LiBr mass fraction in the solution";
-  Units.SI.Temperature Tc "Temperature in Celsius";
-  Units.SI.SpecificEnthalpy H1
-    "Liquid LiBr specific enthalpy on the saturation line";
-  Units.SI.SpecificEnthalpy Hliq
-    "Liquid H2O specific enthalpy on the saturation line";
-  Units.SI.SpecificEnthalpy Dh
-    "Difference in specific enthalpy wrt. ideal mixing";
-
-algorithm
-  /* Liquid H2O specific enthalpy */
-  Hliq := ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(15e5, T, 1);
-
-  /* Units conversions */
-  Tc := T - 273.15;
-  Xi := 1 - X;
-  DXi := 2*Xi - 1;
-
-  /* LiBr specific entahlpy */
-  H1 := 0.5086682481e3 - 0.1862407335e2*Tc + 0.9859458321e-1*Tc*Tc -
-    0.2509791095e-4*Tc*Tc*Tc + 0.4158007710e-7*Tc*Tc*Tc*Tc;
-
-  /* Difference with ideal conditions */
-  C1 := -0.1021608631e4 + 0.3687726426e2*Tc - 0.1860514100*Tc*Tc - 0.7512766773e-5*Tc*Tc*Tc;
-  C2 := -0.5333082110e3 + 0.4028472553e2*Tc - 0.1911981148*Tc*Tc;
-  C3 := 0.4836280661e3 + 0.3991418127e2*Tc - 0.1992131652*Tc*Tc;
-  C4 := 0.1155132809e4 + 0.3335722311e2*Tc - 0.1782584073*Tc*Tc;
-  C5 := 0.6406219484e3 + 0.1310318363e2*Tc - 0.7751011421e-1*Tc*Tc;
-  Dh := (C1 + C2*DXi + C3*DXi*DXi + C4*DXi*DXi*DXi + C5*DXi*DXi*DXi*DXi)*Xi*(1 - Xi);
-
-  /* Specific entahlpy of the solution */
-  h := 1000 * (Xi * H1 + (1 - Xi) * Hliq/1000 + Dh);
-
-  annotation (
-    smoothOrder = 2,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end SpecificEnthalpy_TX;
+within ThermoSysPro.Properties.WaterSolution;
+function SpecificEnthalpy_TX
+  "Specific enthalpy of the H2O/LiBr solution as a function of T and Xh2o"
+  input Units.SI.Temperature T "Temperature";
+  input Real X "Water mass fraction in the solution";
+
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy of the solution";
+
+protected
+  Real C1;
+  Real C2;
+  Real C3;
+  Real C4;
+  Real C5;
+  Real DXi;
+  Real Xi "LiBr mass fraction in the solution";
+  Units.SI.Temperature Tc "Temperature in Celsius";
+  Units.SI.SpecificEnthalpy H1
+    "Liquid LiBr specific enthalpy on the saturation line";
+  Units.SI.SpecificEnthalpy Hliq
+    "Liquid H2O specific enthalpy on the saturation line";
+  Units.SI.SpecificEnthalpy Dh
+    "Difference in specific enthalpy wrt. ideal mixing";
+
+algorithm
+  /* Liquid H2O specific enthalpy */
+  Hliq := ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(15e5, T, 1);
+
+  /* Units conversions */
+  Tc := T - 273.15;
+  Xi := 1 - X;
+  DXi := 2*Xi - 1;
+
+  /* LiBr specific entahlpy */
+  H1 := 0.5086682481e3 - 0.1862407335e2*Tc + 0.9859458321e-1*Tc*Tc -
+    0.2509791095e-4*Tc*Tc*Tc + 0.4158007710e-7*Tc*Tc*Tc*Tc;
+
+  /* Difference with ideal conditions */
+  C1 := -0.1021608631e4 + 0.3687726426e2*Tc - 0.1860514100*Tc*Tc - 0.7512766773e-5*Tc*Tc*Tc;
+  C2 := -0.5333082110e3 + 0.4028472553e2*Tc - 0.1911981148*Tc*Tc;
+  C3 := 0.4836280661e3 + 0.3991418127e2*Tc - 0.1992131652*Tc*Tc;
+  C4 := 0.1155132809e4 + 0.3335722311e2*Tc - 0.1782584073*Tc*Tc;
+  C5 := 0.6406219484e3 + 0.1310318363e2*Tc - 0.7751011421e-1*Tc*Tc;
+  Dh := (C1 + C2*DXi + C3*DXi*DXi + C4*DXi*DXi*DXi + C5*DXi*DXi*DXi*DXi)*Xi*(1 - Xi);
+
+  /* Specific entahlpy of the solution */
+  h := 1000 * (Xi * H1 + (1 - Xi) * Hliq/1000 + Dh);
+
+  annotation (
+    smoothOrder = 2,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end SpecificEnthalpy_TX;
diff --git a/ThermoSysPro/Properties/WaterSolution/Temperature_hX.mo b/ThermoSysPro/Properties/WaterSolution/Temperature_hX.mo
index d0a3ec472c65cff6ac5278d30311f4af9285c784..0747282ecb3b126dfde4a92396ff7ecf10522817 100644
--- a/ThermoSysPro/Properties/WaterSolution/Temperature_hX.mo
+++ b/ThermoSysPro/Properties/WaterSolution/Temperature_hX.mo
@@ -1,36 +1,36 @@
-within ThermoSysPro.Properties.WaterSolution;
-function Temperature_hX
-  "Temperature of the H2O/LiBr solution as a function of h et Xh2o"
-  input Units.SI.SpecificEnthalpy h "Specific enthazlpy of the solution";
-  input Real X "Water mass fraction in the solution";
-
-  output Units.SI.Temperature T "Temperature";
-
-protected
-  Real A0;
-  Real A1;
-  Real A2;
-
-algorithm
-  /* Computation of the coefficients */
-  A0 := 7.073041837E+03*X*X*X*X*X - 2.659706323E+04*X*X*X*X + 3.968957688E+04*X*
-    X*X - 2.942661413E+04*X*X + 1.084550019E+04*X - 1.311645958E+03;
-  A1 := -5.155160151E-02*X*X*X*X*X + 1.831371685E-01*X*X*X*X - 2.547248076E-01*X
-    *X*X + 1.733914006E-01*X*X - 5.828427688E-02*X + 8.271482051E-03;
-  A2 := -2.816450830E-07*X*X*X*X*X*X + 1.181863048E-06*X*X*X*X*X -
-    2.027614981E-06*X*X*X*X + 1.818359590E-06*X*X*X - 8.983047414E-07*X*X +
-    2.318831106E-07*X - 2.454384671E-08;
-
-  /* Temperature */
-  T := A2*h*h + A1*h + A0;
-
-  annotation (
-    smoothOrder=2,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Temperature_hX;
+within ThermoSysPro.Properties.WaterSolution;
+function Temperature_hX
+  "Temperature of the H2O/LiBr solution as a function of h et Xh2o"
+  input Units.SI.SpecificEnthalpy h "Specific enthazlpy of the solution";
+  input Real X "Water mass fraction in the solution";
+
+  output Units.SI.Temperature T "Temperature";
+
+protected
+  Real A0;
+  Real A1;
+  Real A2;
+
+algorithm
+  /* Computation of the coefficients */
+  A0 := 7.073041837E+03*X*X*X*X*X - 2.659706323E+04*X*X*X*X + 3.968957688E+04*X*
+    X*X - 2.942661413E+04*X*X + 1.084550019E+04*X - 1.311645958E+03;
+  A1 := -5.155160151E-02*X*X*X*X*X + 1.831371685E-01*X*X*X*X - 2.547248076E-01*X
+    *X*X + 1.733914006E-01*X*X - 5.828427688E-02*X + 8.271482051E-03;
+  A2 := -2.816450830E-07*X*X*X*X*X*X + 1.181863048E-06*X*X*X*X*X -
+    2.027614981E-06*X*X*X*X + 1.818359590E-06*X*X*X - 8.983047414E-07*X*X +
+    2.318831106E-07*X - 2.454384671E-08;
+
+  /* Temperature */
+  T := A2*h*h + A1*h + A0;
+
+  annotation (
+    smoothOrder=2,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Temperature_hX;
diff --git a/ThermoSysPro/Properties/WaterSolution/package.mo b/ThermoSysPro/Properties/WaterSolution/package.mo
index e3239e6b587af1016aa4aea4a99efffb656e97f7..65c504ca045e93b39fe6f27a701f47d67ec70bd2 100644
--- a/ThermoSysPro/Properties/WaterSolution/package.mo
+++ b/ThermoSysPro/Properties/WaterSolution/package.mo
@@ -1,139 +1,139 @@
-within ThermoSysPro.Properties;
-package WaterSolution "Water solution properties library"
-
-
-
-annotation (
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Window(
-    x=0.45,
-    y=0.01,
-    width=0.44,
-    height=0.65,
-    library=1,
-    autolayout=1),
-  Documentation(info="<html>
-<p><b>ThermoSysPro Version 3.2</b></h4>
-</html>"));
-end WaterSolution;
+within ThermoSysPro.Properties;
+package WaterSolution "Water solution properties library"
+
+
+
+annotation (
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Window(
+    x=0.45,
+    y=0.01,
+    width=0.44,
+    height=0.65,
+    library=1,
+    autolayout=1),
+  Documentation(info="<html>
+<p><b>ThermoSysPro Version 3.2</b></h4>
+</html>"));
+end WaterSolution;
diff --git a/ThermoSysPro/Properties/WaterSteam/BaseIF97.mo b/ThermoSysPro/Properties/WaterSteam/BaseIF97.mo
index 8f43151f8b302277b472e1a7e918d7ae941490e6..7e9b0de0e2d231da8d134a55d796cdb89232eca2 100644
--- a/ThermoSysPro/Properties/WaterSteam/BaseIF97.mo
+++ b/ThermoSysPro/Properties/WaterSteam/BaseIF97.mo
@@ -1,7550 +1,7550 @@
-within ThermoSysPro.Properties.WaterSteam;
-package BaseIF97
-  "Modelica Physical Property Model: the new industrial formulation IAPWS-IF97"
-
-  import      ThermoSysPro.Units.SI;
-  record IterationData "constants for iterations internal to some functions"
-
-    extends Modelica.Icons.Record;
-    constant Integer IMAX=50
-      "maximum number of iterations for inverse functions";
-    constant Real DELP=1.0e-6 "maximum iteration error in pressure, Pa";
-    constant Real DELS=1.0e-8
-      "maximum iteration error in specific entropy, J/{kg.K}";
-    constant Real DELH=1.0e-8
-      "maximum iteration error in specific entthalpy, J/kg";
-    constant Real DELD=1.0e-8 "maximum iteration error in density, kg/m^3";
-  end IterationData;
-  //===================================================================
-  //                      Constant declarations
-
-  //===================================================================
-  record data "constant IF97 data and region limits"
-    extends Modelica.Icons.Record;
-    constant Units.SI.SpecificHeatCapacity RH2O=461.526
-      "specific gas constant of water vapour";
-    constant Units.SI.MolarMass MH2O=0.01801528 "molar weight of water";
-    constant Units.SI.Temperature TSTAR1=1386.0
-      "normalization temperature for region 1 IF97";
-    constant Units.SI.Pressure PSTAR1=16.53e6
-      "normalization pressure for region 1 IF97";
-    constant Units.SI.Temperature TSTAR2=540.0
-      "normalization temperature for region 2 IF97";
-    constant Units.SI.Pressure PSTAR2=1.0e6
-      "normalization pressure for region 2 IF97";
-    constant Units.SI.Temperature TSTAR5=1000.0
-      "normalization temperature for region 5 IF97";
-    constant Units.SI.Pressure PSTAR5=1.0e6
-      "normalization pressure for region 5 IF97";
-    constant Units.SI.SpecificEnthalpy HSTAR1=2.5e6
-      "normalization specific enthalpy for region 1 IF97";
-    constant Real IPSTAR=1.0e-6
-      "normalization pressure for inverse function in region 2 IF97";
-    constant Real IHSTAR=5.0e-7
-      "normalization specific enthalpy for inverse function in region 2 IF97";
-    constant Units.SI.Temperature TLIMIT1=623.15
-      "temperature limit between regions 1 and 3";
-    constant Units.SI.Temperature TLIMIT2=1073.15
-      "temperature limit between regions 2 and 5";
-    constant Units.SI.Temperature TLIMIT5=2273.15
-      "upper temperature limit of 5";
-    constant Units.SI.Pressure PLIMIT1=100.0e6
-      "upper pressure limit for regions 1, 2 and 3";
-    constant Units.SI.Pressure PLIMIT4A=16.5292e6
-      "pressure limit between regions 1 and 2, important for for two-phase (region 4)";
-    constant Units.SI.Pressure PLIMIT5=10.0e6
-      "upper limit of valid pressure in region 5";
-    constant Units.SI.Pressure PCRIT=22064000.0 "the critical pressure";
-    constant Units.SI.Temperature TCRIT=647.096 "the critical temperature";
-    constant Units.SI.Density DCRIT=322.0 "the critical density";
-    constant Units.SI.SpecificEntropy SCRIT=4412.02148223476
-      "the calculated specific entropy at the critical point";
-    constant Units.SI.SpecificEnthalpy HCRIT=2087546.84511715
-      "the calculated specific enthalpy at the critical point";
-    constant Real[5] n=array(0.34805185628969e3, -0.11671859879975e1,
-        0.10192970039326e-2, 0.57254459862746e3, 0.13918839778870e2)
-      "polynomial coefficients for boundary between regions 2 and 3";
-    annotation (Documentation(info="<HTML>
- <h4>Record description</h4>
-                           <p>Constants needed in the international steam properties IF97.
-                           SCRIT and HCRIT are calculated from Helmholtz function for region 3.</p>
-<h4>Version Info and Revision history
-</h4>
-<ul>
-<li>First implemented: <i>July, 2000</i>
-       by Hubertus Tummescheit
-       </li>
-</ul>
- <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
- </address>
-<ul>
- <li>Initial version: July 2000</li>
- <li>Documentation added: December 2002</li>
-</ul>
-</HTML>
-"));
-  end data;
-
-  record critical "critical point data"
-    extends Modelica.Icons.Record;
-    constant Units.SI.Pressure PCRIT=22064000.0 "the critical pressure";
-    constant Units.SI.Temperature TCRIT=647.096 "the critical temperature";
-    constant Units.SI.Density DCRIT=322.0 "the critical density";
-    constant Units.SI.SpecificEnthalpy HCRIT=2087546.84511715
-      "the calculated specific enthalpy at the critical point";
-    constant Units.SI.SpecificEntropy SCRIT=4412.02148223476
-      "the calculated specific entropy at the critical point";
-    annotation (Documentation(info="<HTML>
- <h4>Record description</h4>
- <p>Critical point data for IF97 steam properties. SCRIT and HCRIT are calculated from helmholtz function for region 3 </p>
-<h4>Version Info and Revision history
-</h4>
-<ul>
-<li>First implemented: <i>July, 2000</i>
-       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-       </li>
-</ul>
- <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
- </address>
-<ul>
- <li>Initial version: July 2000</li>
- <li>Documentation added: December 2002</li>
-</ul>
-</HTML>
-"));
-  end critical;
-
-  record triple "triple point data"
-    extends Modelica.Icons.Record;
-    constant Units.SI.Temperature Ttriple=273.16 "the triple point temperature";
-    constant Units.SI.Pressure ptriple=611.657 "the triple point temperature";
-    constant Units.SI.Density dltriple=999.792520031617642
-      "the triple point liquid density";
-    constant Units.SI.Density dvtriple=0.485457572477861372e-2
-      "the triple point vapour density";
-    annotation (Documentation(info="<HTML>
- <h4>Record description</h4>
- <p>Vapour/liquid/ice triple point data for IF97 steam properties.</p>
-<h4>Version Info and Revision history
-</h4>
-<ul>
-<li>First implemented: <i>July, 2000</i>
-       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-       </li>
-</ul>
- <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
- </address>
-<ul>
- <li>Initial version: July 2000</li>
- <li>Documentation added: December 2002</li>
-</ul>
-</HTML>
-"));
-  end triple;
-
-  package Regions
-    "functions to find the current region for given pairs of input variables"
-
-    //===================================================================
-    //                      "Public" functions
-
-    //===================================================================
-
-    function boundary23ofT
-      "boundary function for region boundary between regions 2 and 3 (input temperature)"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Temperature t "temperature (K)";
-      output Units.SI.Pressure p "pressure";
-    protected
-      constant Real[5] n=data.n;
-    algorithm
-      p := 1.0e6*(n[1] + t*(n[2] + t*n[3]));
-    end boundary23ofT;
-
-    function boundary23ofp
-      "boundary function for region boundary between regions 2 and 3 (input pressure)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.Temperature t "temperature (K)";
-    protected
-      constant Real[5] n=data.n;
-      Real pi "dimensionless pressure";
-    algorithm
-      pi := p/1.0e6;
-      assert(p > triple.ptriple,
-        "IF97 medium function boundary23ofp called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      t := n[4] + ((pi - n[5])/n[3])^0.5;
-    end boundary23ofp;
-
-    function hlowerofp5
-      "explicit lower specific enthalpy limit of region 5 as function of pressure"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real pi "dimensionless pressure";
-    algorithm
-      pi := p/data.PSTAR5;
-      assert(p > triple.ptriple,
-        "IF97 medium function hlowerofp5 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      h := 461526.*(9.01505286876203 + pi*(-0.00979043490246092 + (-0.0000203245575263501
-         + 3.36540214679088e-7*pi)*pi));
-    end hlowerofp5;
-
-    function hupperofp5
-      "explicit upper specific enthalpy limit of region 5 as function of pressure"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real pi "dimensionless pressure";
-    algorithm
-      pi := p/data.PSTAR5;
-      assert(p > triple.ptriple,
-        "IF97 medium function hupperofp5 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      h := 461526.*(15.9838891400332 + pi*(-0.000489898813722568 + (-5.01510211858761e-8
-         + 7.5006972718273e-8*pi)*pi));
-    end hupperofp5;
-
-    function slowerofp5
-      "explicit lower specific entropy limit of region 5 as function of pressure"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Real pi "dimensionless pressure";
-    algorithm
-      pi := p/data.PSTAR5;
-      assert(p > triple.ptriple,
-        "IF97 medium function slowerofp5 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      s := 461.526*(18.4296209980112 + pi*(-0.00730911805860036 + (-0.0000168348072093888
-         + 2.09066899426354e-7*pi)*pi) - Modelica.Math.log(pi));
-    end slowerofp5;
-
-    function supperofp5
-      "explicit upper specific entropy limit of region 5 as function of pressure"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Real pi "dimensionless pressure";
-    algorithm
-      pi := p/data.PSTAR5;
-      assert(p > triple.ptriple,
-        "IF97 medium function supperofp5 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      s := 461.526*(22.7281531474243 + pi*(-0.000656650220627603 + (-1.96109739782049e-8
-         + 2.19979537113031e-8*pi)*pi) - Modelica.Math.log(pi));
-    end supperofp5;
-
-    function hlowerofp1
-      "explicit lower specific enthalpy limit of region 1 as function of pressure"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real pi1 "dimensionless pressure";
-      Real[3] o "vector of auxiliary variables";
-    algorithm
-      pi1 := 7.1 - p/data.PSTAR1;
-      assert(p > triple.ptriple,
-        "IF97 medium function hlowerofp1 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      o[1] := pi1*pi1;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-
-      h := 639675.036*(0.173379420894777 + pi1*(-0.022914084306349 + pi1*(-0.00017146768241932
-         + pi1*(-4.18695814670391e-6 + pi1*(-2.41630417490008e-7 + pi1*(
-        1.73545618580828e-11 + o[1]*pi1*(8.43755552264362e-14 + o[2]*o[3]*pi1
-        *(5.35429206228374e-35 + o[1]*(-8.12140581014818e-38 + o[1]*o[2]*(-1.43870236842915e-44
-         + pi1*(1.73894459122923e-45 + (-7.06381628462585e-47 +
-        9.64504638626269e-49*pi1)*pi1)))))))))));
-    end hlowerofp1;
-
-    function hupperofp1
-      "explicit upper specific enthalpy limit of region 1 as function of pressure (meets region 4 saturation pressure curve at 623.15 K)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real pi1 "dimensionless pressure";
-      Real[3] o "vector of auxiliary variables";
-    algorithm
-      pi1 := 7.1 - p/data.PSTAR1;
-      assert(p > triple.ptriple,
-        "IF97 medium function hupperofp1 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      o[1] := pi1*pi1;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      h := 639675.036*(2.42896927729349 + pi1*(-0.00141131225285294 + pi1*(
-        0.00143759406818289 + pi1*(0.000125338925082983 + pi1*(
-        0.0000123617764767172 + pi1*(3.17834967400818e-6 + o[1]*pi1*(
-        1.46754947271665e-8 + o[2]*o[3]*pi1*(1.86779322717506e-17 + o[1]*(-4.18568363667416e-19
-         + o[1]*o[2]*(-9.19148577641497e-22 + pi1*(4.27026404402408e-22 + (-6.66749357417962e-23
-         + 3.49930466305574e-24*pi1)*pi1)))))))))));
-    end hupperofp1;
-
-    function slowerofp1
-      "explicit lower specific entropy limit of region 1 as function of pressure"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Real pi1 "dimensionless pressure";
-      Real[3] o "vector of auxiliary variables";
-    algorithm
-      pi1 := 7.1 - p/data.PSTAR1;
-      assert(p > triple.ptriple,
-        "IF97 medium function slowerofp1 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      o[1] := pi1*pi1;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      s := 461.526*(-0.0268080988194267 + pi1*(0.00834795890110168 + pi1*(-0.000486470924668433
-         + pi1*(-0.0000154902045012264 + pi1*(-1.07631751351358e-6 + pi1*(
-        9.64159058957115e-11 + o[1]*pi1*(4.81921078863103e-13 + o[2]*o[3]*pi1
-        *(2.7879623870968e-34 + o[1]*(-4.22182957646226e-37 + o[1]*o[2]*(-7.44601427465175e-44
-         + pi1*(8.99540001407168e-45 + (-3.65230274480299e-46 +
-        4.98464639687285e-48*pi1)*pi1)))))))))));
-    end slowerofp1;
-
-    function supperofp1
-      "explicit upper specific entropy limit of region 1 as function of pressure (meets region 4 saturation pressure curve at 623.15 K)"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Real pi1 "dimensionless pressure";
-      Real[3] o "vector of auxiliary variables";
-    algorithm
-      pi1 := 7.1 - p/data.PSTAR1;
-      assert(p > triple.ptriple,
-        "IF97 medium function supperofp1 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      o[1] := pi1*pi1;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      s := 461.526*(7.28316418503422 + pi1*(0.070602197808399 + pi1*(
-        0.0039229343647356 + pi1*(0.000313009170788845 + pi1*(
-        0.0000303619398631619 + pi1*(7.46739440045781e-6 + o[1]*pi1*(
-        3.40562176858676e-8 + o[2]*o[3]*pi1*(4.21886233340801e-17 + o[1]*(-9.44504571473549e-19
-         + o[1]*o[2]*(-2.06859611434475e-21 + pi1*(9.60758422254987e-22 + (-1.49967810652241e-22
-         + 7.86863124555783e-24*pi1)*pi1)))))))))));
-    end supperofp1;
-
-    function hlowerofp2
-      "explicit lower specific enthalpy limit of region 2 as function of pressure (meets region 4 saturation pressure curve at 623.15 K)"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real pi "dimensionless pressure";
-      Real q1 "auxiliary variable";
-      Real q2 "auxiliary variable";
-      Real[18] o "vector of auxiliary variables";
-    algorithm
-      pi := p/data.PSTAR2;
-      assert(p > triple.ptriple,
-        "IF97 medium function hlowerofp2 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      q1 := 572.54459862746 + 31.3220101646784*(-13.91883977887 + pi)^0.5;
-      q2 := -0.5 + 540./q1;
-      o[1] := q1*q1;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      o[4] := pi*pi;
-      o[5] := o[4]*o[4];
-      o[6] := q2*q2;
-      o[7] := o[6]*o[6];
-      o[8] := o[6]*o[7];
-      o[9] := o[5]*o[5];
-      o[10] := o[7]*o[7];
-      o[11] := o[9]*o[9];
-      o[12] := o[10]*o[10];
-      o[13] := o[12]*o[12];
-      o[14] := o[7]*q2;
-      o[15] := o[6]*q2;
-      o[16] := o[10]*o[6];
-      o[17] := o[13]*o[6];
-      o[18] := o[13]*o[6]*q2;
-      h := (4.63697573303507e9 + 3.74686560065793*o[2] + 3.57966647812489e-6*
-        o[1]*o[2] + 2.81881548488163e-13*o[3] - 7.64652332452145e7*q1 -
-        0.00450789338787835*o[2]*q1 - 1.55131504410292e-9*o[1]*o[2]*q1 + o[1]
-        *(2.51383707870341e6 - 4.78198198764471e6*o[10]*o[11]*o[12]*o[13]*o[4]
-         + 49.9651389369988*o[11]*o[12]*o[13]*o[4]*o[5]*o[7] + o[15]*o[4]*(
-        1.03746636552761e-13 - 0.00349547959376899*o[16] -
-        2.55074501962569e-7*o[8])*o[9] + (-242662.235426958*o[10]*o[12] -
-        3.46022402653609*o[16])*o[4]*o[5]*pi + o[4]*(0.109336249381227 -
-        2248.08924686956*o[14] - 354742.725841972*o[17] - 24.1331193696374*o[
-        6])*pi - 3.09081828396912e-19*o[11]*o[12]*o[5]*o[7]*pi -
-        1.24107527851371e-8*o[11]*o[13]*o[4]*o[5]*o[6]*o[7]*pi +
-        3.99891272904219*o[5]*o[8]*pi + 0.0641817365250892*o[10]*o[7]*o[9]*pi
-         + pi*(-4444.87643334512 - 75253.6156722047*o[14] - 43051.9020511789*
-        o[6] - 22926.6247146068*q2) + o[4]*(-8.23252840892034 -
-        3927.0508365636*o[15] - 239.325789467604*o[18] - 76407.3727417716*o[8]
-         - 94.4508644545118*q2) + 0.360567666582363*o[5]*(-0.0161221195808321
-         + q2)*(0.0338039844460968 + q2) + o[11]*(-0.000584580992538624*o[10]
-        *o[12]*o[7] + 1.33248030241755e6*o[12]*o[13]*q2) + o[9]*(-7.38502736990986e7
-        *o[18] + 0.0000224425477627799*o[6]*o[7]*q2) + o[4]*o[5]*(-2.08438767026518e8
-        *o[17] - 0.0000124971648677697*o[6] - 8442.30378348203*o[10]*o[6]*o[7]
-        *q2) + o[11]*o[9]*(4.73594929247646e-22*o[10]*o[12]*q2 -
-        13.6411358215175*o[10]*o[12]*o[13]*q2 + 5.52427169406836e-10*o[13]*o[
-        6]*o[7]*q2) + o[11]*o[5]*(2.67174673301715e-6*o[17] +
-        4.44545133805865e-18*o[12]*o[6]*q2 - 50.2465185106411*o[10]*o[13]*o[6]
-        *o[7]*q2)))/o[1];
-    end hlowerofp2;
-
-    function hupperofp2
-      "explicit upper specific enthalpy limit of region 2 as function of pressure"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real pi "dimensionless pressure";
-      Real[2] o "vector of auxiliary variables";
-    algorithm
-      pi := p/data.PSTAR2;
-      assert(p > triple.ptriple,
-        "IF97 medium function hupperofp2 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      o[1] := pi*pi;
-      o[2] := o[1]*o[1]*o[1];
-      h := 4.16066337647071e6 + pi*(-4518.48617188327 + pi*(-8.53409968320258
-         + pi*(0.109090430596056 + pi*(-0.000172486052272327 + pi*(
-        4.2261295097284e-15 + pi*(-1.27295130636232e-10 + pi*(-3.79407294691742e-25
-         + pi*(7.56960433802525e-23 + pi*(7.16825117265975e-32 + pi*(
-        3.37267475986401e-21 + (-7.5656940729795e-74 + o[1]*(-8.00969737237617e-134
-         + (1.6746290980312e-65 + pi*(-3.71600586812966e-69 + pi*(
-        8.06630589170884e-129 + (-1.76117969553159e-103 +
-        1.88543121025106e-84*pi)*pi)))*o[1]))*o[2]))))))))));
-    end hupperofp2;
-
-    function slowerofp2
-      "explicit lower specific entropy limit of region 2 as function of pressure (meets region 4 saturation pressure curve at 623.15 K)"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Real pi "dimensionless pressure";
-      Real q1 "auxiliary variable";
-      Real q2 "auxiliary variable";
-      Real[40] o "vector of auxiliary variables";
-    algorithm
-      pi := p/data.PSTAR2;
-      assert(p > triple.ptriple,
-        "IF97 medium function slowerofp2 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      q1 := 572.54459862746 + 31.3220101646784*(-13.91883977887 + pi)^0.5;
-      q2 := -0.5 + 540.0/q1;
-      o[1] := pi*pi;
-      o[2] := o[1]*pi;
-      o[3] := o[1]*o[1];
-      o[4] := o[1]*o[3]*pi;
-      o[5] := q1*q1;
-      o[6] := o[5]*q1;
-      o[7] := 1/o[5];
-      o[8] := 1/q1;
-      o[9] := o[5]*o[5];
-      o[10] := o[9]*q1;
-      o[11] := q2*q2;
-      o[12] := o[11]*q2;
-      o[13] := o[1]*o[3];
-      o[14] := o[11]*o[11];
-      o[15] := o[3]*o[3];
-      o[16] := o[1]*o[15];
-      o[17] := o[11]*o[14];
-      o[18] := o[11]*o[14]*q2;
-      o[19] := o[3]*pi;
-      o[20] := o[14]*o[14];
-      o[21] := o[11]*o[20];
-      o[22] := o[15]*pi;
-      o[23] := o[14]*o[20]*q2;
-      o[24] := o[20]*o[20];
-      o[25] := o[15]*o[15];
-      o[26] := o[25]*o[3];
-      o[27] := o[14]*o[24];
-      o[28] := o[25]*o[3]*pi;
-      o[29] := o[20]*o[24]*q2;
-      o[30] := o[15]*o[25];
-      o[31] := o[24]*o[24];
-      o[32] := o[11]*o[31]*q2;
-      o[33] := o[14]*o[31];
-      o[34] := o[1]*o[25]*o[3]*pi;
-      o[35] := o[11]*o[14]*o[31]*q2;
-      o[36] := o[1]*o[25]*o[3];
-      o[37] := o[1]*o[25];
-      o[38] := o[20]*o[24]*o[31]*q2;
-      o[39] := o[14]*q2;
-      o[40] := o[11]*o[31];
-
-      s := 461.526*(9.692768600217 + 1.22151969114703e-16*o[10] +
-        0.00018948987516315*o[1]*o[11] + 1.6714766451061e-11*o[12]*o[13] +
-        0.0039392777243355*o[1]*o[14] - 1.0406965210174e-19*o[14]*o[16] +
-        0.043797295650573*o[1]*o[18] - 2.2922076337661e-6*o[18]*o[19] -
-        2.0481737692309e-8*o[2] + 0.00003227767723857*o[12]*o[2] +
-        0.0015033924542148*o[17]*o[2] - 1.1256211360459e-11*o[15]*o[20] +
-        1.0018179379511e-9*o[11]*o[14]*o[16]*o[20] + 1.0234747095929e-13*o[16]
-        *o[21] - 1.9809712802088e-8*o[22]*o[23] + 0.0021171472321355*o[13]*o[
-        24] - 8.9185845355421e-25*o[26]*o[27] - 1.2790717852285e-8*o[11]*o[3]
-         - 4.8225372718507e-7*o[12]*o[3] - 7.3087610595061e-29*o[11]*o[20]*o[
-        24]*o[30] - 0.10693031879409*o[11]*o[24]*o[25]*o[31] +
-        4.2002467698208e-6*o[24]*o[26]*o[31] - 5.5414715350778e-17*o[20]*o[30]
-        *o[31] + 9.436970724121e-7*o[11]*o[20]*o[24]*o[30]*o[31] +
-        23.895741934104*o[13]*o[32] + 0.040668253562649*o[2]*o[32] -
-        3.0629316876232e-13*o[26]*o[32] + 0.000026674547914087*o[1]*o[33] +
-        8.2311340897998*o[15]*o[33] + 1.2768608934681e-15*o[34]*o[35] +
-        0.33662250574171*o[37]*o[38] + 5.905956432427e-18*o[4] +
-        0.038946842435739*o[29]*o[4] - 4.88368302964335e-6*o[5] -
-        3.34901734177133e6/o[6] + 2.58538448402683e-9*o[6] + 82839.5726841115
-        *o[7] - 5446.7940672972*o[8] - 8.40318337484194e-13*o[9] +
-        0.0017731742473213*pi + 0.045996013696365*o[11]*pi +
-        0.057581259083432*o[12]*pi + 0.05032527872793*o[17]*pi + o[8]*pi*(
-        9.63082563787332 - 0.008917431146179*q1) + 0.00811842799898148*q1 +
-        0.000033032641670203*o[1]*q2 - 4.3870667284435e-7*o[2]*q2 +
-        8.0882908646985e-11*o[14]*o[20]*o[24]*o[25]*q2 + 5.9056029685639e-26*
-        o[14]*o[24]*o[28]*q2 + 7.8847309559367e-10*o[3]*q2 -
-        3.7826947613457e-6*o[14]*o[24]*o[31]*o[36]*q2 + 1.2621808899101e-6*o[
-        11]*o[20]*o[4]*q2 + 540.*o[8]*(10.08665568018 - 0.000033032641670203*
-        o[1] - 6.2245802776607e-15*o[10] - 0.015757110897342*o[1]*o[12] -
-        5.0144299353183e-11*o[11]*o[13] + 4.1627860840696e-19*o[12]*o[16] -
-        0.306581069554011*o[1]*o[17] + 9.0049690883672e-11*o[15]*o[18] +
-        0.0000160454534363627*o[17]*o[19] + 4.3870667284435e-7*o[2] -
-        0.00009683303171571*o[11]*o[2] + 2.57526266427144e-7*o[14]*o[20]*o[22]
-         - 1.40254511313154e-8*o[16]*o[23] - 2.34560435076256e-9*o[14]*o[20]*
-        o[24]*o[25] - 1.24017662339842e-24*o[27]*o[28] - 7.8847309559367e-10*
-        o[3] + 1.44676118155521e-6*o[11]*o[3] + 1.90027787547159e-27*o[29]*o[
-        30] - 0.000960283724907132*o[1]*o[32] - 296.320827232793*o[15]*o[32]
-         - 4.97975748452559e-14*o[11]*o[14]*o[31]*o[34] +
-        2.21658861403112e-15*o[30]*o[35] + 0.000200482822351322*o[14]*o[24]*o[
-        31]*o[36] - 19.1874828272775*o[20]*o[24]*o[31]*o[37] -
-        0.0000547344301999018*o[30]*o[38] - 0.0090203547252888*o[2]*o[39] -
-        0.0000138839897890111*o[21]*o[4] - 0.973671060893475*o[20]*o[24]*o[4]
-         - 836.35096769364*o[13]*o[40] - 1.42338887469272*o[2]*o[40] +
-        1.07202609066812e-11*o[26]*o[40] + 0.0000150341259240398*o[5] -
-        1.8087714924605e-8*o[6] + 18605.6518987296*o[7] - 306.813232163376*o[
-        8] + 1.43632471334824e-11*o[9] + 1.13103675106207e-18*o[5]*o[9] -
-        0.017834862292358*pi - 0.172743777250296*o[11]*pi - 0.30195167236758*
-        o[39]*pi + o[8]*pi*(-49.6756947920742 + 0.045996013696365*q1) -
-        0.0003789797503263*o[1]*q2 - 0.033874355714168*o[11]*o[13]*o[14]*o[20]
-        *q2 - 1.0234747095929e-12*o[16]*o[20]*q2 + 1.78371690710842e-23*o[11]
-        *o[24]*o[26]*q2 + 2.558143570457e-8*o[3]*q2 + 5.3465159397045*o[24]*o[
-        25]*o[31]*q2 - 0.000201611844951398*o[11]*o[14]*o[20]*o[26]*o[31]*q2)
-         - Modelica.Math.log(pi));
-    end slowerofp2;
-
-    function supperofp2
-      "explicit upper specific entropy limit of region 2 as function of pressure"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Real pi "dimensionless pressure";
-      Real[2] o "vector of auxiliary variables";
-    algorithm
-      pi := p/data.PSTAR2;
-      assert(p > triple.ptriple,
-        "IF97 medium function supperofp2 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      o[1] := pi*pi;
-      o[2] := o[1]*o[1]*o[1];
-      s := 8505.73409708683 - 461.526*Modelica.Math.log(pi) + pi*(-3.36563543302584
-         + pi*(-0.00790283552165338 + pi*(0.0000915558349202221 + pi*(-1.59634706513e-7
-         + pi*(3.93449217595397e-18 + pi*(-1.18367426347994e-13 + pi*(
-        2.72575244843195e-15 + pi*(7.04803892603536e-26 + pi*(
-        6.67637687381772e-35 + pi*(3.1377970315132e-24 + (-7.04844558482265e-77
-         + o[1]*(-7.46289531275314e-137 + (1.55998511254305e-68 + pi*(-3.46166288915497e-72
-         + pi*(7.51557618628583e-132 + (-1.64086406733212e-106 +
-        1.75648443097063e-87*pi)*pi)))*o[1]))*o[2]*o[2]))))))))));
-    end supperofp2;
-
-    function d1n "density in region 1 as function of p and T"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.Density d "density";
-    protected
-      Real pi "dimensionless pressure";
-      Real pi1 "dimensionless pressure";
-      Real tau "dimensionless temperature";
-      Real tau1 "dimensionless temperature";
-      Real gpi "dimensionless Gibbs-derivative w.r.t. pi";
-      Real[11] o "auxiliary variables";
-    algorithm
-      pi := p/data.PSTAR1;
-      tau := data.TSTAR1/T;
-      pi1 := 7.1 - pi;
-      tau1 := tau - 1.222;
-      o[1] := tau1*tau1;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      o[4] := o[1]*o[2];
-      o[5] := o[1]*tau1;
-      o[6] := o[2]*tau1;
-      o[7] := pi1*pi1;
-      o[8] := o[7]*o[7];
-      o[9] := o[8]*o[8];
-      o[10] := o[3]*o[3];
-      o[11] := o[10]*o[10];
-      gpi := pi1*(pi1*((0.000095038934535162 + o[2]*(8.4812393955936e-6 +
-        2.55615384360309e-9*o[4]))/o[2] + pi1*((8.9701127632e-6 + (
-        2.60684891582404e-6 + 5.7366919751696e-13*o[2]*o[3])*o[5])/o[6] + pi1
-        *(2.02584984300585e-6/o[3] + o[7]*pi1*(o[8]*o[9]*pi1*(o[7]*(o[7]*o[8]
-        *(-7.63737668221055e-22/(o[1]*o[11]*o[2]) + pi1*(pi1*(-5.65070932023524e-23
-        /(o[11]*o[3]) + (2.99318679335866e-24*pi1)/(o[11]*o[3]*tau1)) +
-        3.5842867920213e-22/(o[1]*o[11]*o[2]*tau1))) - 3.33001080055983e-19/(
-        o[1]*o[10]*o[2]*o[3]*tau1)) + 1.44400475720615e-17/(o[10]*o[2]*o[3]*
-        tau1)) + (1.01874413933128e-8 + 1.39398969845072e-9*o[6])/(o[1]*o[3]*
-        tau1))))) + (0.00094368642146534 + o[5]*(0.00060003561586052 + (-0.000095322787813974
-         + o[1]*(8.8283690661692e-6 + 1.45389992595188e-15*o[1]*o[2]*o[3]))*
-        tau1))/o[5]) + (-0.00028319080123804 + o[1]*(0.00060706301565874 + o[
-        4]*(0.018990068218419 + tau1*(0.032529748770505 + (0.021841717175414
-         + 0.00005283835796993*o[1])*tau1))))/(o[3]*tau1);
-      d := p/(data.RH2O*T*pi*gpi);
-    end d1n;
-
-    function d2n "density in region 2  as function of p and T"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.Density d "density";
-    protected
-      Real pi "dimensionless pressure";
-      Real tau "dimensionless temperature";
-      Real tau2 "dimensionless temperature";
-      Real gpi "dimensionless Gibbs-derivative w.r.t. pi";
-      Real[12] o "auxiliary variables";
-    algorithm
-      pi := p/data.PSTAR2;
-      tau := data.TSTAR2/T;
-      tau2 := tau - 0.5;
-      o[1] := tau2*tau2;
-      o[2] := o[1]*tau2;
-      o[3] := o[1]*o[1];
-      o[4] := o[3]*o[3];
-      o[5] := o[4]*o[4];
-      o[6] := o[3]*o[4]*o[5]*tau2;
-      o[7] := o[3]*o[4]*tau2;
-      o[8] := o[1]*o[3]*o[4];
-      o[9] := pi*pi;
-      o[10] := o[9]*o[9];
-      o[11] := o[3]*o[5]*tau2;
-      o[12] := o[5]*o[5];
-      gpi := (1. + pi*(-0.0017731742473213 + tau2*(-0.017834862292358 + tau2*
-        (-0.045996013696365 + (-0.057581259083432 - 0.05032527872793*o[2])*
-        tau2)) + pi*(tau2*(-0.000066065283340406 + (-0.0003789797503263 + o[1]
-        *(-0.007878555448671 + o[2]*(-0.087594591301146 -
-        0.000053349095828174*o[6])))*tau2) + pi*(6.1445213076927e-8 + (
-        1.31612001853305e-6 + o[1]*(-0.00009683303171571 + o[2]*(-0.0045101773626444
-         - 0.122004760687947*o[6])))*tau2 + pi*(tau2*(-3.15389238237468e-9 +
-        (5.116287140914e-8 + 1.92901490874028e-6*tau2)*tau2) + pi*(
-        0.0000114610381688305*o[1]*o[3]*tau2 + pi*(o[2]*(-1.00288598706366e-10
-         + o[7]*(-0.012702883392813 - 143.374451604624*o[1]*o[5]*tau2)) + pi*
-        (-4.1341695026989e-17 + o[1]*o[4]*(-8.8352662293707e-6 -
-        0.272627897050173*o[8])*tau2 + pi*(o[4]*(9.0049690883672e-11 -
-        65.8490727183984*o[3]*o[4]*o[5]) + pi*(1.78287415218792e-7*o[7] + pi*
-        (o[3]*(1.0406965210174e-18 + o[1]*(-1.0234747095929e-12 -
-        1.0018179379511e-8*o[3])*o[3]) + o[10]*o[9]*((-1.29412653835176e-9 +
-        1.71088510070544*o[11])*o[6] + o[9]*(-6.05920510335078*o[12]*o[4]*o[5]
-        *tau2 + o[9]*(o[3]*o[5]*(1.78371690710842e-23 + o[1]*o[3]*o[4]*(
-        6.1258633752464e-12 - 0.000084004935396416*o[7])*tau2) + pi*(-1.24017662339842e-24
-        *o[11] + pi*(0.0000832192847496054*o[12]*o[3]*o[5]*tau2 + pi*(o[1]*o[
-        4]*o[5]*(1.75410265428146e-27 + (1.32995316841867e-15 -
-        0.0000226487297378904*o[1]*o[5])*o[8])*pi - 2.93678005497663e-14*o[1]
-        *o[12]*o[3]*tau2)))))))))))))))))/pi;
-      d := p/(data.RH2O*T*pi*gpi);
-    end d2n;
-
-    function dhot1ofp "density at upper temperature limit of region 1"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.Density d "density";
-    protected
-      Real pi "dimensionless pressure";
-      Real pi1 "dimensionless pressure";
-      Real[4] o "auxiliary variables";
-    algorithm
-      pi := p/data.PSTAR1;
-      pi1 := 7.1 - pi;
-      o[1] := pi1*pi1;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      o[4] := o[3]*o[3];
-      d := 57.4756752485113/(0.0737412153522555 + 0.000102697173772229*o[1]
-         + 1.99080616601101e-6*o[2] + 1.35549330686006e-17*o[2]*o[4] -
-        3.11228834832975e-19*o[1]*o[2]*o[4] - 7.02987180039442e-22*o[2]*o[3]*
-        o[4] - 5.17859076694812e-23*o[1]*o[2]*o[3]*o[4] + 0.00145092247736023
-        *pi1 + 0.0000114683182476084*o[1]*pi1 + 1.13217858826367e-8*o[1]*o[2]
-        *pi1 + 3.29199117056433e-22*o[2]*o[3]*o[4]*pi1 + 2.73712834080283e-24
-        *o[1]*o[2]*o[3]*o[4]*pi1);
-    end dhot1ofp;
-
-    function dupper1ofT "density at upper pressure limit of region 1"
-      extends Modelica.Icons.Function;
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.Density d "density";
-    protected
-      Real tau "dimensionless temperature";
-      Real[4] o "auxiliary variables";
-    algorithm
-      tau := 1386.0/T;
-      o[1] := tau*tau;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      o[4] := o[3]*o[3];
-      d := 57.4756752485113/(2.24144616859917 + 40.9288231166229*o[1] +
-        106.47246463213*o[2] + 88.4481480270751*o[1]*o[2] + 31.3207272417546*
-        o[3] + 5.47811738891798*o[1]*o[3] + 0.515626225030717*o[2]*o[3] +
-        0.0274905057899089*o[1]*o[2]*o[3] + 0.000853742979250503*o[4] +
-        0.0000155932210492199*o[1]*o[4] + 1.6621051480279e-7*o[2]*o[4] +
-        1.00606771839976e-9*o[1]*o[2]*o[4] + 3.27598951831994e-12*o[3]*o[4]
-         + 5.20162317530099e-15*o[1]*o[3]*o[4] + 3.33501889800275e-18*o[2]*o[
-        3]*o[4] + 5.50656040141221e-22*o[1]*o[2]*o[3]*o[4] - 13.5354267762204
-        *tau - 78.3629702507642*o[1]*tau - 109.374479648652*o[2]*tau -
-        57.9035658513312*o[1]*o[2]*tau - 14.215347150565*o[3]*tau -
-        1.80906759985501*o[1]*o[3]*tau - 0.127542214693871*o[2]*o[3]*tau -
-        0.0051779458313163*o[1]*o[2]*o[3]*tau - 0.000123304142684848*o[4]*tau
-         - 1.72405791469972e-6*o[1]*o[4]*tau - 1.39155695911655e-8*o[2]*o[4]*
-        tau - 6.23333356847138e-11*o[1]*o[2]*o[4]*tau - 1.44056015732082e-13*
-        o[3]*o[4]*tau - 1.50201626932938e-16*o[1]*o[3]*o[4]*tau -
-        5.34588682252967e-20*o[2]*o[3]*o[4]*tau - 2.73712834080283e-24*o[1]*o[
-        2]*o[3]*o[4]*tau);
-    end dupper1ofT;
-
-    function hl_p_R4b
-      "explicit approximation of liquid specific enthalpy on the boundary between regions 4 and 3"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real x "auxiliary variable";
-    algorithm
-        // documentation of accuray in notebook ~hubertus/props/IAPWS/R3Approx.nb
-      // boundary between region IVa and III
-      x := Modelica.Math.acos(p/data.PCRIT);
-      h := (1 + x*(-0.4945586958175176 + x*(1.346800016564904 + x*(-3.889388153209752
-         + x*(6.679385472887931 + x*(-6.75820241066552 + x*(3.558919744656498
-         + (-0.7179818554978939 - 0.0001152032945617821*x)*x)))))))*data.
-        HCRIT;
-      annotation(smoothOrder=5);
-    end hl_p_R4b;
-
-    function hv_p_R4b
-      "explicit approximation of vapour specific enthalpy on the boundary between regions 4 and 3"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real x "auxiliary variable";
-    algorithm
-      // boundary between region IVa and III
-      x := Modelica.Math.acos(p/data.PCRIT);
-      h := (1 + x*(0.4880153718655694 + x*(0.2079670746250689 + x*(-6.084122698421623
-         + x*(25.08887602293532 + x*(-48.38215180269516 + x*(
-        45.66489164833212 + (-16.98555442961553 + 0.0006616936460057691*x)*x)))))))
-        *data.HCRIT;
-      annotation(smoothOrder=5);
-    end hv_p_R4b;
-
-    function sl_p_R4b
-      "explicit approximation of liquid specific entropy on the boundary between regions 4 and 3"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Real x "auxiliary variable";
-    algorithm
-      // boundary between region IVa and III
-      x := Modelica.Math.acos(p/data.PCRIT);
-      s := (1 + x*(-0.36160692245648063 + x*(0.9962778630486647 + x*(-2.8595548144171103
-         + x*(4.906301159555333 + x*(-4.974092309614206 + x*(
-        2.6249651699204457 + (-0.5319954375299023 - 0.00008064497431880644*x)
-        *x)))))))*data.SCRIT;
-      annotation(smoothOrder=5);
-    end sl_p_R4b;
-
-    function sv_p_R4b
-      "explicit approximation of vapour specific entropy on the boundary between regions 4 and 3"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s;
-    protected
-      Real x "auxiliary variable";
-    algorithm
-        // documentation of accuray in notebook ~hubertus/props/IAPWS/R3Approx.nb
-      // boundary between region IVa and III
-      x := Modelica.Math.acos(p/data.PCRIT);
-      s := (1 + x*(0.35682641826674344 + x*(0.1642457027815487 + x*(-4.425350377422446
-         + x*(18.324477859983133 + x*(-35.338631625948665 + x*(
-        33.36181025816282 + (-12.408711490585757 + 0.0004810049834109226*x)*x)))))))
-        *data.SCRIT;
-      annotation(smoothOrder=5);
-    end sv_p_R4b;
-
-    function rhol_p_R4b
-      "explicit approximation of liquid density on the boundary between regions 4 and 3"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.Density dl "liquid density";
-    protected
-      Real x "auxiliary variable";
-    algorithm
-      if (p < data.PCRIT) then
-        x := Modelica.Math.acos(p/data.PCRIT);
-        dl := (1 + x*(1.903224079094824 + x*(-2.5314861802401123 + x*(-8.191449323843552
-           + x*(94.34196116778385 + x*(-369.3676833623383 + x*(
-          796.6627910598293 + x*(-994.5385383600702 + x*(673.2581177021598 +
-          (-191.43077336405156 + 0.00052536560808895*x)*x)))))))))*data.DCRIT;
-      else
-        dl := data.DCRIT;
-      end if;
-      annotation(smoothOrder=5);
-    end rhol_p_R4b;
-
-    function rhov_p_R4b
-      "explicit approximation of vapour density on the boundary between regions 4 and 2"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.Density dv "vapour density";
-    protected
-      Real x "auxiliary variable";
-    algorithm
-      if (p < data.PCRIT) then
-        x := Modelica.Math.acos(p/data.PCRIT);
-        dv := (1 + x*(-1.8463850803362596 + x*(-1.1447872718878493 + x*(
-          59.18702203076563 + x*(-403.5391431811611 + x*(1437.2007245332388
-           + x*(-3015.853540307519 + x*(3740.5790348670057 + x*(-2537.375817253895
-           + (725.8761975803782 - 0.0011151111658332337*x)*x)))))))))*data.
-          DCRIT;
-      else
-        dv := data.DCRIT;
-      end if;
-      annotation(smoothOrder=5);
-    end rhov_p_R4b;
-
-    function boilingcurve_p "properties on the boiling curve"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output
-        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
-                                                bpro "property record";
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                         g "dimensionless Gibbs funcion and dervatives";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
-                             f
-        "dimensionless Helmholtz function and dervatives";
-      Units.SI.Pressure plim=min(p, data.PCRIT - 1e-7)
-        "pressure limited to critical pressure - epsilon";
-      Boolean region3boundary "true if boundary between 2-phase and region 3";
-      Real pv "partial derivative of p w.r.t v";
-    algorithm
-      bpro.R := data.RH2O;
-      bpro.T := Basic.tsat(plim);
-      bpro.dpT := Basic.dptofT(bpro.T);
-      region3boundary := bpro.T > data.TLIMIT1;
-      if not region3boundary then
-        g := Basic.g1(p, bpro.T);
-        bpro.d := p/(bpro.R*bpro.T*g.pi*g.gpi);
-        bpro.h := if p > plim then data.HCRIT else bpro.R*bpro.T*g.tau*g.gtau;
-        bpro.s := g.R*(g.tau*g.gtau - g.g);
-        bpro.cp := -bpro.R*g.tau*g.tau*g.gtautau;
-        bpro.vt := bpro.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        bpro.vp := bpro.R*bpro.T/(p*p)*g.pi*g.pi*g.gpipi;
-        bpro.pt := -p/bpro.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
-        bpro.pd := -bpro.R*bpro.T*g.gpi*g.gpi/(g.gpipi);
-      else
-        bpro.d := rhol_p_R4b(plim);
-        f := Basic.f3(bpro.d, bpro.T);
-        bpro.h := hl_p_R4b(plim);
-        // bpro.R*bpro.T*(f.tau*f.ftau + f.delta*f.fdelta);
-        bpro.s := f.R*(f.tau*f.ftau - f.f);
-        bpro.cv := bpro.R*(-f.tau*f.tau*f.ftautau);
-        bpro.pt := bpro.R*bpro.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        bpro.pd := bpro.R*bpro.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        pv := (-f.d*f.d*bpro.pd);
-        bpro.vp := 1/pv;
-        bpro.vt := -bpro.pt/pv;
-      end if;
-    end boilingcurve_p;
-
-    function dewcurve_p "properties on the dew curve"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output
-        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
-                                                bpro "property record";
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                         g "dimensionless Gibbs funcion and dervatives";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
-                             f
-        "dimensionless Helmholtz function and dervatives";
-      Units.SI.Pressure plim=min(p, data.PCRIT - 1e-7)
-        "pressure limited to critical pressure - epsilon";
-      Boolean region3boundary "true if boundary between 2-phase and region 3";
-      Real pv "partial derivative of p w.r.t v";
-    algorithm
-      bpro.R := data.RH2O;
-      bpro.T := Basic.tsat(plim);
-      bpro.dpT := Basic.dptofT(bpro.T);
-      region3boundary := bpro.T > data.TLIMIT1;
-      if not region3boundary then
-        g := Basic.g2(p, bpro.T);
-        bpro.d := p/(bpro.R*bpro.T*g.pi*g.gpi);
-        bpro.h := if p > plim then data.HCRIT else bpro.R*bpro.T*g.tau*g.gtau;
-        bpro.s := g.R*(g.tau*g.gtau - g.g);
-        bpro.cp := -bpro.R*g.tau*g.tau*g.gtautau;
-        bpro.vt := bpro.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        bpro.vp := bpro.R*bpro.T/(p*p)*g.pi*g.pi*g.gpipi;
-        bpro.pt := -p/bpro.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
-        bpro.pd := -bpro.R*bpro.T*g.gpi*g.gpi/(g.gpipi);
-      else
-        bpro.d := rhov_p_R4b(plim);
-        f := Basic.f3(bpro.d, bpro.T);
-        bpro.h := hv_p_R4b(plim);
-        // bpro.R*bpro.T*(f.tau*f.ftau + f.delta*f.fdelta);
-        bpro.s := f.R*(f.tau*f.ftau - f.f);
-        bpro.cv := bpro.R*(-f.tau*f.tau*f.ftautau);
-        bpro.pt := bpro.R*bpro.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        bpro.pd := bpro.R*bpro.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        pv := (-f.d*f.d*bpro.pd);
-        bpro.vp := 1/pv;
-        bpro.vt := -bpro.pt/pv;
-      end if;
-    end dewcurve_p;
-
-    function hvl_p
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input
-        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
-                                               bpro "property record";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := bpro.h;
-      annotation (
-        derivative(noDerivative=bpro) = hvl_p_der,
-        Inline=false,
-        LateInline=true);
-    end hvl_p;
-
-    function hl_p
-      "liquid specific enthalpy on the boundary between regions 4 and 3 or 1"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := hvl_p(p, boilingcurve_p(p));
-    end hl_p;
-
-    function hv_p
-      "vapour specific enthalpy on the boundary between regions 4 and 3 or 2"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := hvl_p(p, dewcurve_p(p));
-    end hv_p;
-
-    function hvl_p_der
-      "derivative function for the specific enthalpy along the phase boundary"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input
-        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
-                                               bpro "property record";
-      input Real p_der "derivative of pressure";
-      output Real h_der
-        "time derivative of specific enthalpy along the phase boundary";
-    algorithm
-      h_der := (1/bpro.d - bpro.T*bpro.vt)*p_der + bpro.cp/bpro.dpT*p_der;
-    end hvl_p_der;
-
-    function rhovl_p
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input
-        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
-                                               bpro "property record";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := bpro.d;
-      annotation (
-        derivative(noDerivative=bpro) = rhovl_p_der,
-        Inline=false,
-        LateInline=true);
-    end rhovl_p;
-
-    function rhol_p "density of saturated water"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "saturation pressure";
-      output Units.SI.Density rho "density of steam at the condensation point";
-    algorithm
-      rho := rhovl_p(p, boilingcurve_p(p));
-    end rhol_p;
-
-    function rhov_p "density of saturated vapour"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "saturation pressure";
-      output Units.SI.Density rho "density of steam at the condensation point";
-    algorithm
-      rho := rhovl_p(p, dewcurve_p(p));
-    end rhov_p;
-
-    function rhovl_p_der
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "saturation pressure";
-      input
-        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
-                                               bpro "property record";
-      input Real p_der "derivative of pressure";
-      output Real d_der "time derivative of density along the phase boundary";
-    algorithm
-      d_der := -bpro.d*bpro.d*(bpro.vp + bpro.vt/bpro.dpT)*p_der;
-    end rhovl_p_der;
-
-    function sl_p
-      "liquid specific entropy on the boundary between regions 4 and 3 or 1"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Units.SI.Temperature Tsat "saturation temperature";
-      Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      if (p < data.PLIMIT4A) then
-        Tsat := Basic.tsat(p);
-        (h,s) := Isentropic.handsofpT1(p, Tsat);
-      elseif (p < data.PCRIT) then
-        s := sl_p_R4b(p);
-      else
-        s := data.SCRIT;
-      end if;
-    end sl_p;
-
-    function sv_p
-      "vapour specific entropy on the boundary between regions 4 and 3 or 2"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Units.SI.Temperature Tsat "saturation temperature";
-      Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      if (p < data.PLIMIT4A) then
-        Tsat := Basic.tsat(p);
-        (h,s) := Isentropic.handsofpT2(p, Tsat);
-      elseif (p < data.PCRIT) then
-        s := sv_p_R4b(p);
-      else
-        s := data.SCRIT;
-      end if;
-    end sv_p;
-
-    function rhol_T "density of saturated water"
-      extends Modelica.Icons.Function;
-      input Units.SI.Temperature T "temperature";
-      output Units.SI.Density d "density of water at the boiling point";
-    protected
-      Units.SI.Pressure p "saturation pressure";
-    algorithm
-      p := Basic.psat(T);
-      if T < data.TLIMIT1 then
-        d := d1n(p, T);
-      elseif T < data.TCRIT then
-        d := rhol_p_R4b(p);
-      else
-        d := data.DCRIT;
-      end if;
-    end rhol_T;
-
-    function rhov_T "density of saturated vapour"
-      extends Modelica.Icons.Function;
-      input Units.SI.Temperature T "temperature";
-      output Units.SI.Density d "density of steam at the condensation point";
-    protected
-      Units.SI.Pressure p "saturation pressure";
-    algorithm
-
-        // assert(T <= data.TCRIT,"input temperature has to be below the critical temperature");
-      p := Basic.psat(T);
-      if T < data.TLIMIT1 then
-        d := d2n(p, T);
-      elseif T < data.TCRIT then
-        d := rhov_p_R4b(p);
-      else
-        d := data.DCRIT;
-      end if;
-    end rhov_T;
-
-    function region_ph
-      "return the current region (valid values: 1,2,3,4,5) in IF97 for given pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-     input Integer phase=0
-        "phase: 2 for two-phase, 1 for one phase, 0 if not known";
-     input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
-      output Integer region "region (valid values: 1,2,3,4,5) in IF97";
-      // If mode is different from 0, no checking for the region is done and
-      // the mode is assumed to be the correct region. This can be used to
-      // implement e.g. water-only steamtables when mode == 1
-    protected
-      Boolean hsubcrit;
-      Units.SI.Temperature Ttest;
-      constant Real[5] n=data.n;
-      Units.SI.SpecificEnthalpy hl "bubble enthalpy";
-      Units.SI.SpecificEnthalpy hv "dew enthalpy";
-    algorithm
-      if (mode <> 0) then
-        region := mode;
-      else
-        // check for regions 1, 2, 3 and 4
-        hl := hl_p(p);
-        hv := hv_p(p);
-        if (phase == 2) then
-          region := 4;
-        else
-          // phase == 1 or 0, now check if we are in the legal area
-          if
-            (p < triple.ptriple) or (p > data.PLIMIT1) or (h < hlowerofp1(p)) or
-            ((p < 10.0e6) and (h > hupperofp5(p)))
-            or ((p >= 10.0e6) and (h > hupperofp2(p))) then
-            // outside of valid range
-            region := -1;
-          else
-            //region 5 and -1 check complete
-            hsubcrit := (h < data.HCRIT);
-            // simple precheck: very simple if pressure < PLIMIT4A
-            if (p < data.PLIMIT4A) then
-              // we can never be in region 3, so test for others
-              if hsubcrit then
-                if (phase == 1) then
-                  region := 1;
-                else
-                  if (h < Isentropic.hofpT1(p,Basic.tsat(p))) then
-                    region := 1;
-                  else
-                    region := 4;
-                  end if;
-                end if;
-                // external or internal phase check
-              else
-                if (h > hlowerofp5(p)) then
-                  // check for region 5
-                  if ((p < data.PLIMIT5) and (h < hupperofp5(p))) then
-                    region := 5;
-                  else
-                    region := -2;
-                    // pressure and specific enthalpy too high, but this should
-                  end if;
-                  // never happen
-                else
-                  if (phase == 1) then
-                    region := 2;
-                  else
-                    if (h > Isentropic.hofpT2(p,Basic.tsat(p))) then
-                      region := 2;
-                    else
-                      region := 4;
-                    end if;
-                  end if;  // external or internal phase check
-                end if;
-                // tests for region 2 or 5
-              end if;
-              // tests for sub or supercritical
-            else
-              // the pressure is over data.PLIMIT4A
-              if hsubcrit then
-                // region 1 or 3 or 4
-                if h < hupperofp1(p) then
-                  region := 1;
-                else
-                  if h < hl  or p > data.PCRIT then
-                    region := 3;
-                  else
-                    region :=4;
-                  end if;
-                end if;
-                // enf of test for region 1, 3 or 4
-              else
-                // region 2, 3 or 4
-                if (h > hlowerofp2(p)) then
-                  region := 2;
-                else
-                  if h > hv  or p > data.PCRIT then
-                    region := 3;
-                  else
-                    region := 4;
-                  end if;
-                end if;
-                // test for 2 and 3
-              end if;
-              // tests above PLIMIT4A
-            end if;
-            // above or below PLIMIT4A
-          end if;
-          // check for grand limits of p and h
-        end if;
-        // all tests with phase == 1
-      end if;
-      // mode was == 0
-      // assert(region > 0,"IF97 function called outside the valid range!");
-    end region_ph;
-
-    function region_ps
-      "return the current region (valid values: 1,2,3,4,5) in IF97 for given pressure and specific entropy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-     input Integer phase=
-                    0 "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-     input Integer mode=
-                   0 "mode: 0 means check, otherwise assume region=mode";
-      output Integer region "region (valid values: 1,2,3,4,5) in IF97";
-      //  If mode is different from 0, no checking for the region is done and
-      //    the mode is assumed to be the correct region. This can be used to
-      //    implement e.g. water-only steamtables when mode == 1
-    protected
-      Boolean ssubcrit;
-      Units.SI.Temperature Ttest;
-      constant Real[5] n=data.n;
-      Units.SI.SpecificEntropy sl "bubble entropy";
-      Units.SI.SpecificEntropy sv "dew entropy";
-    algorithm
-      if (mode <> 0) then
-        region := mode;
-      else
-        // check for regions 1, 2, 3, and 4
-        sl := sl_p(p);
-        sv := sv_p(p);
-        // check all cases two-phase
-        if (phase == 2) or (phase == 0 and s > sl and s < sv and p < data.PCRIT) then
-          region := 4;
-        else
-          // phase == 1
-          region := 0;
-          if (p < triple.ptriple) then
-            region := -2;
-          end if;
-          if (p > data.PLIMIT1) then
-            region := -3;
-          end if;
-          if ((p < 10.0e6) and (s > supperofp5(p))) then
-            region := -5;
-          end if;
-          if ((p >= 10.0e6) and (s > supperofp2(p))) then
-            region := -6;
-          end if;
-          if region < 0 then
-            assert(false, "region computation from p and s failed: function called outside the legal region");
-          else
-            ssubcrit := (s < data.SCRIT);
-            // simple precheck: very simple if pressure < PLIMIT4A
-            if (p < data.PLIMIT4A) then
-              // we can never be in region 3, so test for 1 and 2
-              if ssubcrit then
-                region := 1;
-              else
-                if (s > slowerofp5(p)) then
-                  // check for region 5
-                  if ((p < data.PLIMIT5) and (s < supperofp5(p))) then
-                    region := 5;
-                  else
-                    region := -1;
-                    // pressure and specific entropy too high, should never happen!
-                  end if;
-                else
-                  region := 2;
-                end if;
-                // tests for region 2 or 5
-              end if;
-              // tests for sub or supercritical
-            else
-              // the pressure is over data.PLIMIT4A
-              if ssubcrit then
-                // region 1 or 3
-                if s < supperofp1(p) then
-                  region := 1;
-                else
-                  if s < sl  or p > data.PCRIT then
-                    region := 3;
-                  else
-                    region := 4;
-                  end if;
-                end if;
-                // test for region 1, 3 or 4
-              else
-                // region 2, 3 or 4
-                if (s > slowerofp2(p)) then
-                  region := 2;
-                else
-                  if s > sv  or p > data.PCRIT then
-                    region := 3;
-                  else
-                    region := 4;
-                  end if;
-                end if;
-                // test for 2,3 and 4
-              end if;
-              // tests above PLIMIT4A
-            end if;
-            // above or below PLIMIT4A
-          end if;
-          // grand test for limits of p and s
-        end if;
-        // all tests with phase == 1
-      end if;
-      // mode was == 0
-    end region_ps;
-
-    function region_pT
-      "return the current region (valid values: 1,2,3,5) in IF97, given pressure and temperature"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
-      output Integer region
-        "region (valid values: 1,2,3,5) in IF97, region 4 is impossible!";
-    algorithm
-      if (mode <> 0) then
-        region := mode;
-      else
-        if p < data.PLIMIT4A then
-          //test for regions 1,2,5
-          if T > data.TLIMIT2 then
-            region := 5;
-          elseif T > Basic.tsat(p) then
-            region := 2;
-          else
-            region := 1;
-          end if;
-        else
-          //test for regions 1,2,3
-          if T < data.TLIMIT1 then
-            region := 1;
-          elseif T < boundary23ofp(p) then
-            region := 3;
-          else
-            region := 2;
-          end if;
-        end if;
-      end if;
-      // mode was == 0
-    end region_pT;
-
-    function region_dT
-      "return the current region (valid values: 1,2,3,4,5) in IF97, given density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature (K)";
-      input Integer phase= 0
-        "phase: 2 for two-phase, 1 for one phase, 0 if not known";
-      input Integer mode= 0 "mode: 0 means check, otherwise assume region=mode";
-      output Integer region "(valid values: 1,2,3,4,5) in IF97";
-    protected
-      Boolean Tovercrit "flag if overcritical temperature";
-      Units.SI.Pressure p23 "pressure needed to know if region 2 or 3";
-    algorithm
-      Tovercrit := T > data.TCRIT;
-      if (mode <> 0) then
-        region := mode;
-      else
-        p23 := boundary23ofT(T);
-        if T > data.TLIMIT2 then
-          if d < 20.5655874106483 then
-            // check for the density in the upper corner of validity!
-            region := 5;
-          else
-            assert(false,"out of valid region for IF97, pressure above region 5!");
-          end if;
-        elseif Tovercrit then
-          //check for regions 1, 2 or 3
-          if d > d2n(p23, T) and T > data.TLIMIT1 then
-            region := 3;
-          elseif T < data.TLIMIT1 then
-            region := 1;
-          else // d  < d2n(p23, T) and T > data.TLIMIT1
-            region := 2;
-          end if;
-          // below critical, check for regions 1, 2, 3 or 4
-        elseif (d > rhol_T(T)) then
-          // either 1 or 3
-          if T < data.TLIMIT1 then
-            region := 1;
-          else
-            region := 3;
-          end if;
-        elseif (d < rhov_T(T)) then
-          // not liquid, not 2-phase, and not region 5, so either 2 or 3 or illegal
-          if (d > d2n(p23, T) and T > data.TLIMIT1) then
-            region := 3;
-          else
-            region := 2;
-          end if;
-        else
-          region := 4;
-        end if;
-      end if;
-    end region_dT;
-
-    annotation (Documentation(info="<HTML><h4>Package description</h4>
- <p>Package <b>Regions</b> contains a large number of auxiliary functions which are neede to compute the current region
- of the IAPWS/IF97 for a given pair of input variables as quickly as possible. The focus of this implementation was on
- computational efficiency, not on compact code. Many of the function values calulated in these functions could be obtained
- using the fundamental functions of IAPWS/IF97, but with considerable overhead. If the region of IAPWS/IF97 is known in advance,
- the input variable mode can be set to the region, then the somewhat costly region checks are omitted.
- The checking for the phase has to be done outside the region functions because many properties are not
- differentiable at the region boundary. If the input phase is 2, the output region will be set to 4 immediately.</p>
- <h4>Package contents</h4>
- <p> The main 4 functions in this package are the functions returning the appropriate region for two input variables.
- <ul>
- <li>Function <b>region_ph</b> compute the region of IAPWS/IF97 for input pair pressure and specific enthalpy.</li>
- <li>Function <b>region_ps</b> compute the region of IAPWS/IF97 for input pair pressure and specific entropy</li>
- <li>Function <b>region_dT</b> compute the region of IAPWS/IF97 for input pair density and temperature.</li>
- <li>Function <b>region_pT</b> compute the region of IAPWS/IF97 for input pair pressure and temperature (only ine phase region).</li>
- </ul>
- <p>In addition, functions of the boiling and condensation curves compute the specific enthalpy, specific entropy, or density on these
- curves. The functions for the saturation pressure and temperature are included in the package <b>Basic</b> because they are part of
- the original <a href=\"IF97documentation/IF97.pdf\">IAPWS/IF97 standards document</a>. These functions are also aliased to
- be used directly from package <b>Water</b>.
- </p>
- <ul>
- <li>Function <b>hl_p</b> computes the liquid specific enthalpy as a function of pressure. For overcritical pressures,
- the critical specific enthalpy is returned. An approximation is used for temperatures > 623.15 K.</li>
- <li>Function <b>hv_p</b> computes the vapour specific enthalpy as a function of pressure. For overcritical pressures,
- the critical specific enthalpy is returned. An approximation is used for temperatures > 623.15 K.</li>
- <li>Function <b>sl_p</b> computes the liquid specific entropy as a function of pressure. For overcritical pressures,
- the critical  specific entropy is returned. An approximation is used for temperatures > 623.15 K.</li>
- <li>Function <b>sv_p</b> computes the vapour  specific entropy as a function of pressure. For overcritical pressures,
- the critical  specific entropyis returned. An approximation is used for temperatures > 623.15 K.</li>
- <li>Function <b>rhol_T</b> computes the liquid density as a function of temperature. For overcritical temperatures,
- the critical density is returned. An approximation is used for temperatures > 623.15 K.</li>
- <li>Function <b>rhol_T</b> computes the vapour density as a function of temperature. For overcritical temperatures,
- the critical density is returned. An approximation is used for temperatures > 623.15 K.</li>
- </ul>
- </p>
- <p>All other functions are auxiliary functions called from the region functions to check a specific boundary.</p>
- <ul>
- <li>Function <b>boundary23ofT</b> computes the boundary pressure between regions 2 and 3 (input temperature)</li>
- <li>Function <b>boundary23ofp</b> computes the boundary temperature between regions 2 and 3 (input pressure)</li>
- <li>Function <b>hlowerofp5</b> computes the lower specific enthalpy limit of region 5 (input p, T=1073.15 K)</li>
- <li>Function <b>hupperofp5</b> computes the upper specific enthalpy limit of region 5 (input p, T=2273.15 K)</li>
- <li>Function <b>slowerofp5</b> computes the lower specific entropy limit of region 5 (input p, T=1073.15 K)</li>
- <li>Function <b>supperofp5</b> computes the upper specific entropy limit of region 5 (input p, T=2273.15 K)</li>
- <li>Function <b>hlowerofp1</b> computes the lower specific enthalpy limit of region 1 (input p, T=273.15 K)</li>
- <li>Function <b>hupperofp1</b> computes the upper specific enthalpy limit of region 1 (input p, T=623.15 K)</li>
- <li>Function <b>slowerofp1</b> computes the lower specific entropy limit of region 1 (input p, T=273.15 K)</li>
- <li>Function <b>supperofp1</b> computes the upper specific entropy limit of region 1 (input p, T=623.15 K)</li>
- <li>Function <b>hlowerofp2</b> computes the lower specific enthalpy limit of region 2 (input p, T=623.15 K)</li>
- <li>Function <b>hupperofp2</b> computes the upper specific enthalpy limit of region 2 (input p, T=1073.15 K)</li>
- <li>Function <b>slowerofp2</b> computes the lower specific entropy limit of region 2 (input p, T=623.15 K)</li>
- <li>Function <b>supperofp2</b> computes the upper specific entropy limit of region 2 (input p, T=1073.15 K)</li>
- <li>Function <b>d1n</b> computes the density in region 1 as function of pressure and temperature</li>
- <li>Function <b>d2n</b> computes the density in region 2 as function of pressure and temperature</li>
- <li>Function <b>dhot1ofp</b> computes the hot density limit of region 1 (input p, T=623.15 K)</li>
- <li>Function <b>dupper1ofT</b>computes the high pressure density limit of region 1 (input T, p=100MPa)</li>
- <li>Function <b>hl_p_R4b</b> computes a high accuracy approximation to the liquid enthalpy for temperatures > 623.15 K (input p)</li>
- <li>Function <b>hv_p_R4b</b> computes a high accuracy approximation to the vapour enthalpy for temperatures > 623.15 K (input p)</li>
- <li>Function <b>sl_p_R4b</b> computes a high accuracy approximation to the liquid entropy for temperatures > 623.15 K (input p)</li>
- <li>Function <b>sv_p_R4b</b> computes a high accuracy approximation to the vapour entropy for temperatures > 623.15 K (input p)</li>
- <li>Function <b>rhol_p_R4b</b> computes a high accuracy approximation to the liquid density for temperatures > 623.15 K (input p)</li>
- <li>Function <b>rhov_p_R4b</b> computes a high accuracy approximation to the vapour density for temperatures > 623.15 K (input p)</li>
- </ul>
- </p>
-<h4>Version Info and Revision history
-</h4>
- <ul>
-<li>First implemented: <i>July, 2000</i>
-       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-       </li>
-</ul>
-<address>Authors: Hubertus Tummescheit, Jonas Eborn and Falko Jens Wagner<br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
- </address>
- <ul>
- <li>Initial version: July 2000</li>
- <li>Revised and extended for inclusion in Modelica.Thermal: December 2002</li>
-</ul>
-</HTML>
-"), Icon(graphics={
-          Text(
-            extent={{-102,0},{24,-26}},
-            lineColor={242,148,0},
-            textString=
-                 "Thermo"),
-          Text(
-            extent={{-4,8},{68,-34}},
-            lineColor={46,170,220},
-            textString=
-                 "SysPro"),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
-                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
-                -50,6},{-62,2}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
-                8},{-42,22},{-42,30},{-44,38}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
-                12},{-26,12},{-28,12},{-26,20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,30},{-6,26}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,36},{-6,32}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,42},{-6,38}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,48},{-6,44}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,32},{-2,28}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,38},{-2,34}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,44},{-2,40}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,50},{-2,46}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
-                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
-                -50,6},{-62,2}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Line(
-            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-            color={46,170,220},
-            thickness=0.5),
-          Polygon(
-            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-          Line(
-            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-            color={0,0,255},
-            smooth=Smooth.None),
-          Line(
-            points={{80,80},{100,100}},
-            color={0,0,255},
-            smooth=Smooth.None)}));
-  end Regions;
-  //===================================================================
-  //                      Base functions
-
-  //===================================================================
-
-  package Basic "Base functions as described in IAWPS/IF97"
-
-    function g1 "Gibbs function for region 1: g(p,T)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                                g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-    protected
-      Real pi1 "dimensionless pressure";
-      Real tau1 "dimensionless temperature";
-      Real[45] o "vector of auxiliary variables";
-    algorithm
-    //   assert(p > triple.ptriple,
-    //     "IF97 medium function g1 called with too low pressure\n" +
-    //     "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-    //   assert(p <= 100.0e6,
-    //     "IF97 medium function g1: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
-    //   assert(T >= 273.15,
-    //     "IF97 medium function g1: the temperature (= " + String(T) + " K)  is lower than 273.15 K!");
-      g.p := p;
-      g.T := T;
-      g.R := data.RH2O;
-      g.pi := max(p,triple.ptriple)/data.PSTAR1;
-      g.tau := data.TSTAR1/max(T,triple.Ttriple);
-      pi1 := 7.1000000000000 - g.pi;
-      tau1 := -1.22200000000000 + g.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];
-      g.g := pi1*(pi1*(pi1*(o[10]*(-0.000031679644845054 + o[2]*(-2.82707979853120e-6
-         - 8.5205128120103e-10*o[6])) + pi1*(o[12]*(-2.24252819080000e-6 + (-6.5171222895601e-7
-         - 1.43417299379240e-13*o[13])*o[7]) + pi1*(-4.0516996860117e-7*o[14]
-         + o[16]*((-1.27343017416410e-9 - 1.74248712306340e-10*o[11])*o[36]
-         + o[19]*(-6.8762131295531e-19*o[34] + o[15]*(1.44783078285210e-20*o[
-        32] + o[20]*(2.63357816627950e-23*o[30] + pi1*(-1.19476226400710e-23*
-        o[28] + pi1*(1.82280945814040e-24*o[26] - 9.3537087292458e-26*o[24]*
-        pi1))))))))) + o[8]*(-0.00047184321073267 + o[7]*(-0.000300017807930260
-         + (0.000047661393906987 + o[1]*(-4.4141845330846e-6 -
-        7.2694996297594e-16*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))))) + (
-        0.146329712131670 + tau1*(-0.84548187169114 + tau1*(-3.7563603672040
-         + tau1*(3.3855169168385 + tau1*(-0.95791963387872 + tau1*(
-        0.157720385132280 + (-0.0166164171995010 + 0.00081214629983568*tau1)*
-        tau1))))))/o[1];
-
-      g.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))));
-
-      g.gpipi := pi1*(o[10]*(-0.000190077869070324 + o[2]*(-0.0000169624787911872
-         - 5.1123076872062e-9*o[6])) + pi1*(o[12]*(-0.0000269103382896000 + (
-        -7.8205467474721e-6 - 1.72100759255088e-12*o[13])*o[7]) + pi1*(-8.1033993720234e-6
-        *o[14] + o[16]*((-7.1312089753190e-8 - 9.7579278891550e-9*o[11])*o[36]
-         + o[19]*(-2.88800951441230e-16*o[34] + o[15]*(7.3260237612316e-18*o[
-        32] + o[20]*(2.13846547101895e-20*o[30] + pi1*(-1.03944316968618e-20*
-        o[28] + pi1*(1.69521279607057e-21*o[26] - 9.2788790594118e-23*o[24]*
-        pi1))))))))) + o[8]*(-0.00094368642146534 + o[7]*(-0.00060003561586052
-         + (0.000095322787813974 + o[1]*(-8.8283690661692e-6 -
-        1.45389992595188e-15*o[9]))*tau1));
-
-      g.gtau := pi1*(o[38]*(-0.00254871721114236 + o[1]*(0.0042494411096112
-         + (0.0189900682184190 + (-0.0218417171754140 - 0.000158515073909790*
-        o[1])*o[1])*o[6])) + pi1*(o[10]*(0.00141552963219801 + o[2]*(
-        0.000047661393906987 + o[1]*(-0.0000132425535992538 -
-        1.23581493705910e-14*o[9]))) + pi1*(o[12]*(0.000126718579380216 -
-        5.1123076872062e-9*o[37]) + pi1*(o[39]*(0.0000112126409540000 + (
-        1.30342445791202e-6 - 1.43417299379240e-12*o[13])*o[7]) + pi1*(
-        3.2413597488094e-6*o[5] + o[16]*((1.40077319158051e-8 +
-        1.04549227383804e-9*o[11])*o[45] + o[19]*(1.99410180757040e-17*o[44]
-         + o[15]*(-4.4882754268415e-19*o[42] + o[20]*(-1.00075970318621e-21*o[
-        28] + pi1*(4.6595728296277e-22*o[26] + pi1*(-7.2912378325616e-23*o[24]
-         + 3.8350205789908e-24*o[41]*pi1))))))))))) + o[8]*(-0.292659424263340
-         + tau1*(0.84548187169114 + o[1]*(3.3855169168385 + tau1*(-1.91583926775744
-         + tau1*(0.47316115539684 + (-0.066465668798004 + 0.0040607314991784*
-        tau1)*tau1)))));
-
-      g.gtautau := pi1*(o[36]*(0.0254871721114236 + o[1]*(-0.033995528876889
-         + (-0.037980136436838 - 0.00031703014781958*o[2])*o[6])) + pi1*(o[12]
-        *(-0.0056621185287920 + o[6]*(-0.0000264851071985076 -
-        1.97730389929456e-13*o[9])) + pi1*((-0.00063359289690108 -
-        2.55615384360309e-8*o[37])*o[39] + pi1*(pi1*(-0.0000291722377392842*o[
-        38] + o[16]*(o[19]*(-5.9823054227112e-16*o[32] + o[15]*(o[20]*(
-        3.9029628424262e-20*o[26] + pi1*(-1.86382913185108e-20*o[24] + pi1*(
-        2.98940751135026e-21*o[41] - (1.61070864317613e-22*pi1)/(o[1]*o[22]*o[
-        3]*tau1)))) + 1.43624813658928e-17/(o[22]*tau1))) + (-1.68092782989661e-7
-         - 7.3184459168663e-9*o[11])/(o[2]*o[3]*tau1))) + (-0.000067275845724000
-         + (-3.9102733737361e-6 - 1.29075569441316e-11*o[13])*o[7])/(o[1]*o[2]
-        *tau1))))) + o[10]*(0.87797827279002 + tau1*(-1.69096374338228 + o[7]
-        *(-1.91583926775744 + tau1*(0.94632231079368 + (-0.199397006394012 +
-        0.0162429259967136*tau1)*tau1))));
-
-      g.gtaupi := o[38]*(0.00254871721114236 + o[1]*(-0.0042494411096112 + (-0.0189900682184190
-         + (0.0218417171754140 + 0.000158515073909790*o[1])*o[1])*o[6])) +
-        pi1*(o[10]*(-0.00283105926439602 + o[2]*(-0.000095322787813974 + o[1]
-        *(0.0000264851071985076 + 2.47162987411820e-14*o[9]))) + pi1*(o[12]*(
-        -0.00038015573814065 + 1.53369230616185e-8*o[37]) + pi1*(o[39]*(-0.000044850563816000
-         + (-5.2136978316481e-6 + 5.7366919751696e-12*o[13])*o[7]) + pi1*(-0.0000162067987440468
-        *o[5] + o[16]*((-1.12061855326441e-7 - 8.3639381907043e-9*o[11])*o[45]
-         + o[19]*(-4.1876137958978e-16*o[44] + o[15]*(1.03230334817355e-17*o[
-        42] + o[20]*(2.90220313924001e-20*o[28] + pi1*(-1.39787184888831e-20*
-        o[26] + pi1*(2.26028372809410e-21*o[24] - 1.22720658527705e-22*o[41]*
-        pi1))))))))));
-    end g1;
-
-    function g2 "Gibbs function for region 2: g(p,T)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                                g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-    protected
-      Real tau2 "dimensionless temperature";
-      Real[55] o "vector of auxiliary variables";
-    algorithm
-      g.p := p;
-      g.T := T;
-      g.R := data.RH2O;
-    //   assert(p > triple.ptriple,
-    //     "IF97 medium function g2 called with too low pressure\n" +
-    //     "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-    //   assert(p <= 100.0e6,
-    //     "IF97 medium function g2: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
-    //   assert(T >= 273.15,
-    //     "IF97 medium function g2: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
-    //   assert(T <= 1073.15,
-    //     "IF97 medium function g2: the input temperature (= " + String(T) + " K) is higher than the limit of 1073.15 K");
-      g.pi := max(p,triple.ptriple)/data.PSTAR2;
-      g.tau := data.TSTAR2/max(T,triple.Ttriple);
-      tau2 := -0.5 + g.tau;
-      o[1] := tau2*tau2;
-      o[2] := o[1]*tau2;
-      o[3] := -0.050325278727930*o[2];
-      o[4] := -0.057581259083432 + o[3];
-      o[5] := o[4]*tau2;
-      o[6] := -0.045996013696365 + o[5];
-      o[7] := o[6]*tau2;
-      o[8] := -0.0178348622923580 + o[7];
-      o[9] := o[8]*tau2;
-      o[10] := o[1]*o[1];
-      o[11] := o[10]*o[10];
-      o[12] := o[11]*o[11];
-      o[13] := o[10]*o[11]*o[12]*tau2;
-      o[14] := o[1]*o[10]*tau2;
-      o[15] := o[10]*o[11]*tau2;
-      o[16] := o[1]*o[12]*tau2;
-      o[17] := o[1]*o[11]*tau2;
-      o[18] := o[1]*o[10]*o[11];
-      o[19] := o[10]*o[11]*o[12];
-      o[20] := o[1]*o[10];
-      o[21] := g.pi*g.pi;
-      o[22] := o[21]*o[21];
-      o[23] := o[21]*o[22];
-      o[24] := o[10]*o[12]*tau2;
-      o[25] := o[12]*o[12];
-      o[26] := o[11]*o[12]*o[25]*tau2;
-      o[27] := o[10]*o[12];
-      o[28] := o[1]*o[10]*o[11]*tau2;
-      o[29] := o[10]*o[12]*o[25]*tau2;
-      o[30] := o[1]*o[10]*o[25]*tau2;
-      o[31] := o[1]*o[11]*o[12];
-      o[32] := o[1]*o[12];
-      o[33] := g.tau*g.tau;
-      o[34] := o[33]*o[33];
-      o[35] := -0.000053349095828174*o[13];
-      o[36] := -0.087594591301146 + o[35];
-      o[37] := o[2]*o[36];
-      o[38] := -0.0078785554486710 + o[37];
-      o[39] := o[1]*o[38];
-      o[40] := -0.00037897975032630 + o[39];
-      o[41] := o[40]*tau2;
-      o[42] := -0.000066065283340406 + o[41];
-      o[43] := o[42]*tau2;
-      o[44] := 5.7870447262208e-6*tau2;
-      o[45] := -0.301951672367580*o[2];
-      o[46] := -0.172743777250296 + o[45];
-      o[47] := o[46]*tau2;
-      o[48] := -0.091992027392730 + o[47];
-      o[49] := o[48]*tau2;
-      o[50] := o[1]*o[11];
-      o[51] := o[10]*o[11];
-      o[52] := o[11]*o[12]*o[25];
-      o[53] := o[10]*o[12]*o[25];
-      o[54] := o[1]*o[10]*o[25];
-      o[55] := o[11]*o[12]*tau2;
-
-      g.g := g.pi*(-0.00177317424732130 + o[9] + g.pi*(tau2*(-0.000033032641670203
-         + (-0.000189489875163150 + o[1]*(-0.0039392777243355 + (-0.043797295650573
-         - 0.0000266745479140870*o[13])*o[2]))*tau2) + g.pi*(
-        2.04817376923090e-8 + (4.3870667284435e-7 + o[1]*(-0.000032277677238570
-         + (-0.00150339245421480 - 0.040668253562649*o[13])*o[2]))*tau2 + g.
-        pi*(g.pi*(2.29220763376610e-6*o[14] + g.pi*((-1.67147664510610e-11 +
-        o[15]*(-0.00211714723213550 - 23.8957419341040*o[16]))*o[2] + g.pi*(-5.9059564324270e-18
-         + o[17]*(-1.26218088991010e-6 - 0.038946842435739*o[18]) + g.pi*(o[
-        11]*(1.12562113604590e-11 - 8.2311340897998*o[19]) + g.pi*(
-        1.98097128020880e-8*o[15] + g.pi*(o[10]*(1.04069652101740e-19 + (-1.02347470959290e-13
-         - 1.00181793795110e-9*o[10])*o[20]) + o[23]*(o[13]*(-8.0882908646985e-11
-         + 0.106930318794090*o[24]) + o[21]*(-0.33662250574171*o[26] + o[21]*
-        (o[27]*(8.9185845355421e-25 + (3.06293168762320e-13 -
-        4.2002467698208e-6*o[15])*o[28]) + g.pi*(-5.9056029685639e-26*o[24]
-         + g.pi*(3.7826947613457e-6*o[29] + g.pi*(-1.27686089346810e-15*o[30]
-         + o[31]*(7.3087610595061e-29 + o[18]*(5.5414715350778e-17 -
-        9.4369707241210e-7*o[32]))*g.pi)))))))))))) + tau2*(-7.8847309559367e-10
-         + (1.27907178522850e-8 + 4.8225372718507e-7*tau2)*tau2))))) + (-0.0056087911830200
-         + g.tau*(0.071452738814550 + g.tau*(-0.40710498239280 + g.tau*(
-        1.42408197144400 + g.tau*(-4.3839511194500 + g.tau*(-9.6927686002170
-         + g.tau*(10.0866556801800 + (-0.284086326077200 + 0.0212684635330700
-        *g.tau)*g.tau) + Modelica.Math.log(g.pi)))))))/(o[34]*g.tau);
-
-      g.gpi := (1.00000000000000 + g.pi*(-0.00177317424732130 + o[9] + g.pi*(
-        o[43] + g.pi*(6.1445213076927e-8 + (1.31612001853305e-6 + o[1]*(-0.000096833031715710
-         + (-0.0045101773626444 - 0.122004760687947*o[13])*o[2]))*tau2 + g.pi
-        *(g.pi*(0.0000114610381688305*o[14] + g.pi*((-1.00288598706366e-10 +
-        o[15]*(-0.0127028833928130 - 143.374451604624*o[16]))*o[2] + g.pi*(-4.1341695026989e-17
-         + o[17]*(-8.8352662293707e-6 - 0.272627897050173*o[18]) + g.pi*(o[11]
-        *(9.0049690883672e-11 - 65.849072718398*o[19]) + g.pi*(
-        1.78287415218792e-7*o[15] + g.pi*(o[10]*(1.04069652101740e-18 + (-1.02347470959290e-12
-         - 1.00181793795110e-8*o[10])*o[20]) + o[23]*(o[13]*(-1.29412653835176e-9
-         + 1.71088510070544*o[24]) + o[21]*(-6.0592051033508*o[26] + o[21]*(o[
-        27]*(1.78371690710842e-23 + (6.1258633752464e-12 -
-        0.000084004935396416*o[15])*o[28]) + g.pi*(-1.24017662339842e-24*o[24]
-         + g.pi*(0.000083219284749605*o[29] + g.pi*(-2.93678005497663e-14*o[
-        30] + o[31]*(1.75410265428146e-27 + o[18]*(1.32995316841867e-15 -
-        0.0000226487297378904*o[32]))*g.pi)))))))))))) + tau2*(-3.15389238237468e-9
-         + (5.1162871409140e-8 + 1.92901490874028e-6*tau2)*tau2))))))/g.pi;
-
-      g.gpipi := (-1.00000000000000 + o[21]*(o[43] + g.pi*(
-        1.22890426153854e-7 + (2.63224003706610e-6 + o[1]*(-0.000193666063431420
-         + (-0.0090203547252888 - 0.244009521375894*o[13])*o[2]))*tau2 + g.pi
-        *(g.pi*(0.000045844152675322*o[14] + g.pi*((-5.0144299353183e-10 + o[
-        15]*(-0.063514416964065 - 716.87225802312*o[16]))*o[2] + g.pi*(-2.48050170161934e-16
-         + o[17]*(-0.000053011597376224 - 1.63576738230104*o[18]) + g.pi*(o[
-        11]*(6.3034783618570e-10 - 460.94350902879*o[19]) + g.pi*(
-        1.42629932175034e-6*o[15] + g.pi*(o[10]*(9.3662686891566e-18 + (-9.2112723863361e-12
-         - 9.0163614415599e-8*o[10])*o[20]) + o[23]*(o[13]*(-1.94118980752764e-8
-         + 25.6632765105816*o[24]) + o[21]*(-103.006486756963*o[26] + o[21]*(
-        o[27]*(3.3890621235060e-22 + (1.16391404129682e-10 -
-        0.00159609377253190*o[15])*o[28]) + g.pi*(-2.48035324679684e-23*o[24]
-         + g.pi*(0.00174760497974171*o[29] + g.pi*(-6.4609161209486e-13*o[30]
-         + o[31]*(4.0344361048474e-26 + o[18]*(3.05889228736295e-14 -
-        0.00052092078397148*o[32]))*g.pi)))))))))))) + tau2*(-9.4616771471240e-9
-         + (1.53488614227420e-7 + o[44])*tau2)))))/o[21];
-
-      g.gtau := (0.0280439559151000 + g.tau*(-0.285810955258200 + g.tau*(
-        1.22131494717840 + g.tau*(-2.84816394288800 + g.tau*(4.3839511194500
-         + o[33]*(10.0866556801800 + (-0.56817265215440 + 0.063805390599210*g.
-         tau)*g.tau))))))/(o[33]*o[34]) + g.pi*(-0.0178348622923580 + o[49]
-         + g.pi*(-0.000033032641670203 + (-0.00037897975032630 + o[1]*(-0.0157571108973420
-         + (-0.306581069554011 - 0.00096028372490713*o[13])*o[2]))*tau2 + g.
-        pi*(4.3870667284435e-7 + o[1]*(-0.000096833031715710 + (-0.0090203547252888
-         - 1.42338887469272*o[13])*o[2]) + g.pi*(-7.8847309559367e-10 + g.pi*
-        (0.0000160454534363627*o[20] + g.pi*(o[1]*(-5.0144299353183e-11 + o[
-        15]*(-0.033874355714168 - 836.35096769364*o[16])) + g.pi*((-0.0000138839897890111
-         - 0.97367106089347*o[18])*o[50] + g.pi*(o[14]*(9.0049690883672e-11
-         - 296.320827232793*o[19]) + g.pi*(2.57526266427144e-7*o[51] + g.pi*(
-        o[2]*(4.1627860840696e-19 + (-1.02347470959290e-12 -
-        1.40254511313154e-8*o[10])*o[20]) + o[23]*(o[19]*(-2.34560435076256e-9
-         + 5.3465159397045*o[24]) + o[21]*(-19.1874828272775*o[52] + o[21]*(o[
-        16]*(1.78371690710842e-23 + (1.07202609066812e-11 -
-        0.000201611844951398*o[15])*o[28]) + g.pi*(-1.24017662339842e-24*o[27]
-         + g.pi*(0.000200482822351322*o[53] + g.pi*(-4.9797574845256e-14*o[54]
-         + (1.90027787547159e-27 + o[18]*(2.21658861403112e-15 -
-        0.000054734430199902*o[32]))*o[55]*g.pi)))))))))))) + (
-        2.55814357045700e-8 + 1.44676118155521e-6*tau2)*tau2))));
-
-      g.gtautau := (-0.168263735490600 + g.tau*(1.42905477629100 + g.tau*(-4.8852597887136
-         + g.tau*(8.5444918286640 + g.tau*(-8.7679022389000 + o[33]*(-0.56817265215440
-         + 0.127610781198420*g.tau)*g.tau)))))/(o[33]*o[34]*g.tau) + g.pi*(-0.091992027392730
-         + (-0.34548755450059 - 1.50975836183790*o[2])*tau2 + g.pi*(-0.00037897975032630
-         + o[1]*(-0.047271332692026 + (-1.83948641732407 - 0.033609930371750*
-        o[13])*o[2]) + g.pi*((-0.000193666063431420 + (-0.045101773626444 -
-        48.395221739552*o[13])*o[2])*tau2 + g.pi*(2.55814357045700e-8 +
-        2.89352236311042e-6*tau2 + g.pi*(0.000096272720618176*o[10]*tau2 + g.
-        pi*((-1.00288598706366e-10 + o[15]*(-0.50811533571252 -
-        28435.9329015838*o[16]))*tau2 + g.pi*(o[11]*(-0.000138839897890111 -
-        23.3681054614434*o[18])*tau2 + g.pi*((6.3034783618570e-10 -
-        10371.2289531477*o[19])*o[20] + g.pi*(3.09031519712573e-6*o[17] + g.
-        pi*(o[1]*(1.24883582522088e-18 + (-9.2112723863361e-12 -
-        1.82330864707100e-7*o[10])*o[20]) + o[23]*(o[1]*o[11]*o[12]*(-6.5676921821352e-8
-         + 261.979281045521*o[24])*tau2 + o[21]*(-1074.49903832754*o[1]*o[10]
-        *o[12]*o[25]*tau2 + o[21]*((3.3890621235060e-22 + (
-        3.6448887082716e-10 - 0.0094757567127157*o[15])*o[28])*o[32] + g.pi*(
-        -2.48035324679684e-23*o[16] + g.pi*(0.0104251067622687*o[1]*o[12]*o[
-        25]*tau2 + g.pi*(o[11]*o[12]*(4.7506946886790e-26 + o[18]*(
-        8.6446955947214e-14 - 0.00311986252139440*o[32]))*g.pi -
-        1.89230784411972e-12*o[10]*o[25]*tau2))))))))))))))));
-
-      g.gtaupi := -0.0178348622923580 + o[49] + g.pi*(-0.000066065283340406
-         + (-0.00075795950065260 + o[1]*(-0.0315142217946840 + (-0.61316213910802
-         - 0.00192056744981426*o[13])*o[2]))*tau2 + g.pi*(1.31612001853305e-6
-         + o[1]*(-0.000290499095147130 + (-0.0270610641758664 -
-        4.2701666240781*o[13])*o[2]) + g.pi*(-3.15389238237468e-9 + g.pi*(
-        0.000080227267181813*o[20] + g.pi*(o[1]*(-3.00865796119098e-10 + o[15]
-        *(-0.203246134285008 - 5018.1058061618*o[16])) + g.pi*((-0.000097187928523078
-         - 6.8156974262543*o[18])*o[50] + g.pi*(o[14]*(7.2039752706938e-10 -
-        2370.56661786234*o[19]) + g.pi*(2.31773639784430e-6*o[51] + g.pi*(o[2]
-        *(4.1627860840696e-18 + (-1.02347470959290e-11 - 1.40254511313154e-7*
-        o[10])*o[20]) + o[23]*(o[19]*(-3.7529669612201e-8 + 85.544255035272*o[
-        24]) + o[21]*(-345.37469089099*o[52] + o[21]*(o[16]*(
-        3.5674338142168e-22 + (2.14405218133624e-10 - 0.0040322368990280*o[15])
-        *o[28]) + g.pi*(-2.60437090913668e-23*o[27] + g.pi*(
-        0.0044106220917291*o[53] + g.pi*(-1.14534422144089e-12*o[54] + (
-        4.5606669011318e-26 + o[18]*(5.3198126736747e-14 -
-        0.00131362632479764*o[32]))*o[55]*g.pi)))))))))))) + (
-        1.02325742818280e-7 + o[44])*tau2)));
-    end g2;
-
-    function g2metastable
-      "Gibbs function for metastable part of region 2: g(p,T)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                                g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-    protected
-      Real pi "dimensionless pressure";
-      Real tau "dimensionless temperature";
-      Real tau2 "dimensionless temperature";
-      Real[27] o "vector of auxiliary variables";
-    algorithm
-      assert(p > triple.ptriple,
-        "IF97 medium function g2metastable called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      assert(p <= 100.0e6,
-        "IF97 medium function g2metastable: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
-      assert(T >= 273.15,
-        "IF97 medium function g2metastable: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
-      assert(T <= 1073.15,
-        "IF97 medium function g2metastable: the input temperature (= " + String(T) + " K) is higher than the limit of 1073.15 K");
-      g.p := p;
-      g.T := T;
-      g.R := data.RH2O;
-      g.pi := p/data.PSTAR2;
-      g.tau := data.TSTAR2/T;
-      tau2 := -0.5 + g.tau;
-      o[1] := tau2*tau2;
-      o[2] := o[1]*tau2;
-      o[3] := o[1]*o[1];
-      o[4] := o[1]*o[3];
-      o[5] := -0.0040813178534455*o[4];
-      o[6] := -0.072334555213245 + o[5];
-      o[7] := o[2]*o[6];
-      o[8] := -0.088223831943146 + o[7];
-      o[9] := o[1]*o[8];
-      o[10] := o[3]*o[3];
-      o[11] := o[10]*tau2;
-      o[12] := o[10]*o[3];
-      o[13] := o[1]*o[3]*tau2;
-      o[14] := g.tau*g.tau;
-      o[15] := o[14]*o[14];
-      o[16] := -0.015238081817394*o[11];
-      o[17] := -0.106091843797284 + o[16];
-      o[18] := o[17]*o[4];
-      o[19] := 0.0040195606760414 + o[18];
-      o[20] := o[19]*tau2;
-      o[21] := g.pi*g.pi;
-      o[22] := -0.0448944963879005*o[4];
-      o[23] := -0.361672776066225 + o[22];
-      o[24] := o[2]*o[23];
-      o[25] := -0.176447663886292 + o[24];
-      o[26] := o[25]*tau2;
-      o[27] := o[3]*tau2;
-
-      g.g := g.pi*(-0.0073362260186506 + o[9] + g.pi*(g.pi*((-0.0063498037657313
-         - 0.086043093028588*o[12])*o[3] + g.pi*(o[13]*(0.007532158152277 -
-        0.0079238375446139*o[2]) + o[11]*g.pi*(-0.00022888160778447 -
-        0.002645650148281*tau2))) + (0.0020097803380207 + (-0.053045921898642
-         - 0.007619040908697*o[11])*o[4])*tau2)) + (-0.00560879118302 + g.tau
-        *(0.07145273881455 + g.tau*(-0.4071049823928 + g.tau*(1.424081971444
-         + g.tau*(-4.38395111945 + g.tau*(-9.6937268393049 + g.tau*(
-        10.087275970006 + (-0.2840863260772 + 0.02126846353307*g.tau)*g.tau)
-         + Modelica.Math.log(g.pi)))))))/(o[15]*g.tau);
-
-      g.gpi := (1.0 + g.pi*(-0.0073362260186506 + o[9] + g.pi*(o[20] + g.pi*(
-        (-0.0190494112971939 - 0.258129279085764*o[12])*o[3] + g.pi*(o[13]*(
-        0.030128632609108 - 0.0316953501784556*o[2]) + o[11]*g.pi*(-0.00114440803892235
-         - 0.013228250741405*tau2))))))/g.pi;
-
-      g.gpipi := (-1. + o[21]*(o[20] + g.pi*((-0.0380988225943878 -
-        0.516258558171528*o[12])*o[3] + g.pi*(o[13]*(0.090385897827324 -
-        0.0950860505353668*o[2]) + o[11]*g.pi*(-0.0045776321556894 -
-        0.05291300296562*tau2)))))/o[21];
-
-      g.gtau := (0.0280439559151 + g.tau*(-0.2858109552582 + g.tau*(
-        1.2213149471784 + g.tau*(-2.848163942888 + g.tau*(4.38395111945 + o[
-        14]*(10.087275970006 + (-0.5681726521544 + 0.06380539059921*g.tau)*g.
-        tau))))))/(o[14]*o[15]) + g.pi*(o[26] + g.pi*(0.0020097803380207 + (-0.371321453290494
-         - 0.121904654539152*o[11])*o[4] + g.pi*((-0.0253992150629252 -
-        1.37668948845741*o[12])*o[2] + g.pi*((0.052725107065939 -
-        0.079238375446139*o[2])*o[4] + o[10]*g.pi*(-0.00205993447006023 -
-        0.02645650148281*tau2)))));
-
-      g.gtautau := (-0.1682637354906 + g.tau*(1.429054776291 + g.tau*(-4.8852597887136
-         + g.tau*(8.544491828664 + g.tau*(-8.7679022389 + o[14]*(-0.5681726521544
-         + 0.12761078119842*g.tau)*g.tau)))))/(o[14]*o[15]*g.tau) + g.pi*(-0.176447663886292
-         + o[2]*(-1.4466911042649 - 0.448944963879005*o[4]) + g.pi*((-2.22792871974296
-         - 1.82856981808728*o[11])*o[27] + g.pi*(o[1]*(-0.0761976451887756 -
-        20.6503423268611*o[12]) + g.pi*((0.316350642395634 -
-        0.713145379015251*o[2])*o[27] + o[13]*g.pi*(-0.0164794757604818 -
-        0.23810851334529*tau2)))));
-
-      g.gtaupi := o[26] + g.pi*(0.0040195606760414 + (-0.742642906580988 -
-        0.243809309078304*o[11])*o[4] + g.pi*((-0.0761976451887756 -
-        4.13006846537222*o[12])*o[2] + g.pi*((0.210900428263756 -
-        0.316953501784556*o[2])*o[4] + o[10]*g.pi*(-0.0102996723503012 -
-        0.13228250741405*tau2))));
-    end g2metastable;
-
-    function f3 "Helmholtz function for region 3: f(d,T)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature (K)";
-      output ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
-                                    f
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-    protected
-      Real[40] o "vector of auxiliary variables";
-    algorithm
-      f.T := T;
-      f.d := d;
-      f.R := data.RH2O;
-      f.tau := data.TCRIT/T;
-      f.delta := if (d == data.DCRIT and T == data.TCRIT) then 1 - Modelica.
-        Constants.eps else abs(d/data.DCRIT);
-      o[1] := f.tau*f.tau;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*f.tau;
-      o[4] := o[1]*f.tau;
-      o[5] := o[2]*o[2];
-      o[6] := o[1]*o[5]*f.tau;
-      o[7] := o[5]*f.tau;
-      o[8] := -0.64207765181607*o[1];
-      o[9] := 0.88521043984318 + o[8];
-      o[10] := o[7]*o[9];
-      o[11] := -1.15244078066810 + o[10];
-      o[12] := o[11]*o[2];
-      o[13] := -1.26543154777140 + o[12];
-      o[14] := o[1]*o[13];
-      o[15] := o[1]*o[2]*o[5]*f.tau;
-      o[16] := o[2]*o[5];
-      o[17] := o[1]*o[5];
-      o[18] := o[5]*o[5];
-      o[19] := o[1]*o[18]*o[2];
-      o[20] := o[1]*o[18]*o[2]*f.tau;
-      o[21] := o[18]*o[5];
-      o[22] := o[1]*o[18]*o[5];
-      o[23] := 0.251168168486160*o[2];
-      o[24] := 0.078841073758308 + o[23];
-      o[25] := o[15]*o[24];
-      o[26] := -6.1005234513930 + o[25];
-      o[27] := o[26]*f.tau;
-      o[28] := 9.7944563083754 + o[27];
-      o[29] := o[2]*o[28];
-      o[30] := -1.70429417648412 + o[29];
-      o[31] := o[1]*o[30];
-      o[32] := f.delta*f.delta;
-      o[33] := -10.9153200808732*o[1];
-      o[34] := 13.2781565976477 + o[33];
-      o[35] := o[34]*o[7];
-      o[36] := -6.9146446840086 + o[35];
-      o[37] := o[2]*o[36];
-      o[38] := -2.53086309554280 + o[37];
-      o[39] := o[38]*f.tau;
-      o[40] := o[18]*o[5]*f.tau;
-
-      f.f := -15.7328452902390 + f.tau*(20.9443969743070 + (-7.6867707878716
-         + o[3]*(2.61859477879540 + o[4]*(-2.80807811486200 + o[1]*(
-        1.20533696965170 - 0.0084566812812502*o[6]))))*f.tau) + f.delta*(o[14]
-         + f.delta*(0.38493460186671 + o[1]*(-0.85214708824206 + o[2]*(
-        4.8972281541877 + (-3.05026172569650 + o[15]*(0.039420536879154 +
-        0.125584084243080*o[2]))*f.tau)) + f.delta*(-0.279993296987100 + o[1]
-        *(1.38997995694600 + o[1]*(-2.01899150235700 + o[16]*(-0.0082147637173963
-         - 0.47596035734923*o[17]))) + f.delta*(0.043984074473500 + o[1]*(-0.44476435428739
-         + o[1]*(0.90572070719733 + 0.70522450087967*o[19])) + f.delta*(f.
-        delta*(-0.0221754008730960 + o[1]*(0.094260751665092 +
-        0.164362784479610*o[21]) + f.delta*(-0.0135033722413480*o[1] + f.
-        delta*(-0.0148343453524720*o[22] + f.delta*(o[1]*(0.00057922953628084
-         + 0.0032308904703711*o[21]) + f.delta*(0.000080964802996215 -
-        0.000044923899061815*f.delta*o[22] - 0.000165576797950370*f.tau)))))
-         + (0.107705126263320 + o[1]*(-0.32913623258954 - 0.50871062041158*o[
-        20]))*f.tau))))) + 1.06580700285130*Modelica.Math.log(f.delta);
-
-      f.fdelta := (1.06580700285130 + f.delta*(o[14] + f.delta*(
-        0.76986920373342 + o[31] + f.delta*(-0.83997989096130 + o[1]*(
-        4.1699398708380 + o[1]*(-6.0569745070710 + o[16]*(-0.0246442911521889
-         - 1.42788107204769*o[17]))) + f.delta*(0.175936297894000 + o[1]*(-1.77905741714956
-         + o[1]*(3.6228828287893 + 2.82089800351868*o[19])) + f.delta*(f.
-        delta*(-0.133052405238576 + o[1]*(0.56556450999055 + 0.98617670687766
-        *o[21]) + f.delta*(-0.094523605689436*o[1] + f.delta*(-0.118674762819776
-        *o[22] + f.delta*(o[1]*(0.0052130658265276 + 0.0290780142333399*o[21])
-         + f.delta*(0.00080964802996215 - 0.00049416288967996*f.delta*o[22]
-         - 0.00165576797950370*f.tau))))) + (0.53852563131660 + o[1]*(-1.64568116294770
-         - 2.54355310205790*o[20]))*f.tau))))))/f.delta;
-
-      f.fdeltadelta := (-1.06580700285130 + o[32]*(0.76986920373342 + o[31]
-         + f.delta*(-1.67995978192260 + o[1]*(8.3398797416760 + o[1]*(-12.1139490141420
-         + o[16]*(-0.049288582304378 - 2.85576214409538*o[17]))) + f.delta*(
-        0.52780889368200 + o[1]*(-5.3371722514487 + o[1]*(10.8686484863680 +
-        8.4626940105560*o[19])) + f.delta*(f.delta*(-0.66526202619288 + o[1]*
-        (2.82782254995276 + 4.9308835343883*o[21]) + f.delta*(-0.56714163413662
-        *o[1] + f.delta*(-0.83072333973843*o[22] + f.delta*(o[1]*(
-        0.041704526612220 + 0.232624113866719*o[21]) + f.delta*(
-        0.0072868322696594 - 0.0049416288967996*f.delta*o[22] -
-        0.0149019118155333*f.tau))))) + (2.15410252526640 + o[1]*(-6.5827246517908
-         - 10.1742124082316*o[20]))*f.tau)))))/o[32];
-
-      f.ftau := 20.9443969743070 + (-15.3735415757432 + o[3]*(
-        18.3301634515678 + o[4]*(-28.0807811486200 + o[1]*(14.4640436358204
-         - 0.194503669468755*o[6]))))*f.tau + f.delta*(o[39] + f.delta*(f.tau
-        *(-1.70429417648412 + o[2]*(29.3833689251262 + (-21.3518320798755 + o[
-        15]*(0.86725181134139 + 3.2651861903201*o[2]))*f.tau)) + f.delta*((
-        2.77995991389200 + o[1]*(-8.0759660094280 + o[16]*(-0.131436219478341
-         - 12.3749692910800*o[17])))*f.tau + f.delta*((-0.88952870857478 + o[
-        1]*(3.6228828287893 + 18.3358370228714*o[19]))*f.tau + f.delta*(
-        0.107705126263320 + o[1]*(-0.98740869776862 - 13.2264761307011*o[20])
-         + f.delta*((0.188521503330184 + 4.2734323964699*o[21])*f.tau + f.
-        delta*(-0.0270067444826960*f.tau + f.delta*(-0.38569297916427*o[40]
-         + f.delta*(f.delta*(-0.000165576797950370 - 0.00116802137560719*f.
-        delta*o[40]) + (0.00115845907256168 + 0.084003152229649*o[21])*f.tau)))))))));
-
-      f.ftautau := -15.3735415757432 + o[3]*(109.980980709407 + o[4]*(-252.727030337580
-         + o[1]*(159.104479994024 - 4.2790807283126*o[6]))) + f.delta*(-2.53086309554280
-         + o[2]*(-34.573223420043 + (185.894192367068 - 174.645121293971*o[1])
-        *o[7]) + f.delta*(-1.70429417648412 + o[2]*(146.916844625631 + (-128.110992479253
-         + o[15]*(18.2122880381691 + 81.629654758002*o[2]))*f.tau) + f.delta*
-        (2.77995991389200 + o[1]*(-24.2278980282840 + o[16]*(-1.97154329217511
-         - 309.374232277000*o[17])) + f.delta*(-0.88952870857478 + o[1]*(
-        10.8686484863680 + 458.39592557179*o[19]) + f.delta*(f.delta*(
-        0.188521503330184 + 106.835809911747*o[21] + f.delta*(-0.0270067444826960
-         + f.delta*(-9.6423244791068*o[21] + f.delta*(0.00115845907256168 +
-        2.10007880574121*o[21] - 0.0292005343901797*o[21]*o[32])))) + (-1.97481739553724
-         - 330.66190326753*o[20])*f.tau)))));
-
-      f.fdeltatau := o[39] + f.delta*(f.tau*(-3.4085883529682 + o[2]*(
-        58.766737850252 + (-42.703664159751 + o[15]*(1.73450362268278 +
-        6.5303723806402*o[2]))*f.tau)) + f.delta*((8.3398797416760 + o[1]*(-24.2278980282840
-         + o[16]*(-0.39430865843502 - 37.124907873240*o[17])))*f.tau + f.
-        delta*((-3.5581148342991 + o[1]*(14.4915313151573 + 73.343348091486*o[
-        19]))*f.tau + f.delta*(0.53852563131660 + o[1]*(-4.9370434888431 -
-        66.132380653505*o[20]) + f.delta*((1.13112901998110 +
-        25.6405943788192*o[21])*f.tau + f.delta*(-0.189047211378872*f.tau + f.
-         delta*(-3.08554383331418*o[40] + f.delta*(f.delta*(-0.00165576797950370
-         - 0.0128482351316791*f.delta*o[40]) + (0.0104261316530551 +
-        0.75602837006684*o[21])*f.tau))))))));
-    end f3;
-
-    function g5 "base function for region 5: g(p,T)"
-      import ThermoSysPro;
-            extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output ThermoSysPro.Properties.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-    protected
-            Real[11] o "vector of auxiliary variables";
-    algorithm
-    //         assert(p > triple.ptriple,
-    //           "IF97 medium function g5 called with too low pressure\n" +
-    //           "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-    //         assert(p <= data.PLIMIT5,
-    //           "IF97 medium function g5: input pressure (= " + String(p) + " Pa) is higher than 10 Mpa in region 5");
-    //         assert(T <= 2273.15,
-    //           "IF97 medium function g5: input temperature (= " + String(T) + " K) is higher than limit of 2273.15K in region 5");
-            g.p := p;
-            g.T := T;
-            g.R := data.RH2O;
-            g.pi := max(p,triple.ptriple)/data.PSTAR5;
-            g.tau := data.TSTAR5/max(T,triple.Ttriple);
-            o[1] := g.tau*g.tau;
-            o[2] := -0.0045942820899910*o[1];
-            o[3] := 0.00217746787145710 + o[2];
-            o[4] := o[3]*g.tau;
-            o[5] := o[1]*g.tau;
-            o[6] := o[1]*o[1];
-            o[7] := o[6]*o[6];
-            o[8] := o[7]*g.tau;
-            o[9] := -7.9449656719138e-6*o[8];
-            o[10] := g.pi*g.pi;
-            o[11] := -0.0137828462699730*o[1];
-
-            g.g := g.pi*(-0.000125631835895920 + o[4] + g.pi*(-3.9724828359569e-6*o[
-              8] + 1.29192282897840e-7*o[5]*g.pi)) + (-0.0248051489334660 + g.tau*(
-              0.36901534980333 + g.tau*(-3.11613182139250 + g.tau*(-13.1799836742010
-               + (6.8540841634434 - 0.32961626538917*g.tau)*g.tau +
-              Modelica.Math.log(g.pi)))))/o[5];
-
-            g.gpi := (1.0 + g.pi*(-0.000125631835895920 + o[4] + g.pi*(o[9] +
-              3.8757684869352e-7*o[5]*g.pi)))/g.pi;
-
-            g.gpipi := (-1.00000000000000 + o[10]*(o[9] + 7.7515369738704e-7*o[5]*g.
-               pi))/o[10];
-
-            g.gtau := g.pi*(0.00217746787145710 + o[11] + g.pi*(-0.000035752345523612
-              *o[7] + 3.8757684869352e-7*o[1]*g.pi)) + (0.074415446800398 + g.tau*(
-              -0.73803069960666 + (3.11613182139250 + o[1]*(6.8540841634434 -
-              0.65923253077834*g.tau))*g.tau))/o[6];
-
-            g.gtautau := (-0.297661787201592 + g.tau*(2.21409209881998 + (-6.2322636427850
-               - 0.65923253077834*o[5])*g.tau))/(o[6]*g.tau) + g.pi*(-0.0275656925399460
-              *g.tau + g.pi*(-0.000286018764188897*o[1]*o[6]*g.tau +
-              7.7515369738704e-7*g.pi*g.tau));
-
-            g.gtaupi := 0.00217746787145710 + o[11] + g.pi*(-0.000071504691047224*o[
-              7] + 1.16273054608056e-6*o[1]*g.pi);
-    end g5;
-
-    function gibbs "Gibbs function for region 1, 2 or 5: g(p,T,region)"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-     input Integer region "IF97 region, 1, 2 or 5";
-      output Real g "dimensionless Gibbs funcion";
-    protected
-      ThermoSysPro.Properties.Common.GibbsDerivs gibbs
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-    algorithm
-      assert(region == 1 or region == 2 or region == 5,
-        "IF97 medium function gibbs called with wrong region (= " + String(region) + ").\n" +
-        "Only regions 1, 2 or 5 are possible");
-      if region
-         == 1 then
-        gibbs
-       := g1(p,T);
-      elseif
-      region == 2 then
-        gibbs
-       := g2(p,T);
-      else
-        gibbs
-       := g5(p,T);
-      end if;
-      g :=
-    gibbs.g;
-    end gibbs;
-
-    function g1pitau "derivative of g wrt pi and tau"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Real pi "dimensionless pressure";
-      output Real tau "dimensionless temperature";
-      output Real gpi "dimensionless dervative of Gibbs function wrt pi";
-      output Real gtau "dimensionless dervative of Gibbs function wrt tau";
-    protected
-      Real pi1 "dimensionless pressure";
-      Real tau1 "dimensionless temperature";
-      Real[28] o "vector of auxiliary variables";
-    algorithm
-      assert(p > triple.ptriple,
-        "IF97 medium function g1pitau called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      assert(p <= 100.0e6,
-        "IF97 medium function g1pitau: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
-      assert(T >= 273.15,
-        "IF97 medium function g1pitau: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
-      pi := p/data.PSTAR1;
-      tau := data.TSTAR1/T;
-      pi1 := 7.1 - pi;
-      tau1 := -1.222 + tau;
-      o[1] := tau1*tau1;
-      o[2] := o[1]*tau1;
-      o[3] := 1/o[2];
-      o[4] := o[1]*o[1];
-      o[5] := o[4]*o[4];
-      o[6] := o[1]*o[5];
-      o[7] := o[1]*o[4];
-      o[8] := 1/o[4];
-      o[9] := o[1]*o[4]*o[5];
-      o[10] := o[4]*tau1;
-      o[11] := 1/o[10];
-      o[12] := o[4]*o[5];
-      o[13] := o[5]*tau1;
-      o[14] := 1/o[13];
-      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[5]*o[5];
-      o[22] := o[21]*o[21];
-      o[23] := o[22]*o[5]*tau1;
-      o[24] := 1/o[23];
-      o[25] := o[22]*o[5];
-      o[26] := 1/o[25];
-      o[27] := o[1]*o[22]*o[4]*tau1;
-      o[28] := 1/o[27];
-      gtau := pi1*((-0.00254871721114236 + o[1]*(0.00424944110961118 + (
-        0.018990068218419 + (-0.021841717175414 - 0.00015851507390979*o[1])*o[
-        1])*o[7]))/o[6] + pi1*(o[8]*(0.00141552963219801 + o[4]*(
-        0.000047661393906987 + o[1]*(-0.0000132425535992538 -
-        1.2358149370591e-14*o[9]))) + pi1*(o[11]*(0.000126718579380216 -
-        5.11230768720618e-9*o[6]) + pi1*((0.000011212640954 + (
-        1.30342445791202e-6 - 1.4341729937924e-12*o[12])*o[2])/o[7] + pi1*(
-        3.24135974880936e-6*o[14] + o[16]*((1.40077319158051e-8 +
-        1.04549227383804e-9*o[10])/o[12] + o[19]*(1.9941018075704e-17/(o[1]*o[
-        21]*o[4]*o[5]) + o[15]*(-4.48827542684151e-19/o[22] + o[20]*(-1.00075970318621e-21
-        *o[28] + pi1*(4.65957282962769e-22*o[26] + pi1*(-7.2912378325616e-23*
-        o[24] + (3.83502057899078e-24*pi1)/(o[1]*o[22]*o[5])))))))))))) + o[3]
-        *(-0.29265942426334 + tau1*(0.84548187169114 + o[1]*(3.3855169168385
-         + tau1*(-1.91583926775744 + tau1*(0.47316115539684 + (-0.066465668798004
-         + 0.0040607314991784*tau1)*tau1)))));
-      gpi := pi1*(pi1*((0.000095038934535162 + o[4]*(8.4812393955936e-6 +
-        2.55615384360309e-9*o[7]))*o[8] + pi1*(o[11]*(8.9701127632e-6 + (
-        2.60684891582404e-6 + 5.7366919751696e-13*o[12])*o[2]) + pi1*(
-        2.02584984300585e-6/o[5] + o[16]*(o[19]*(o[15]*(o[20]*(-7.63737668221055e-22
-        /(o[1]*o[22]*o[4]) + pi1*(3.5842867920213e-22*o[28] + pi1*(-5.65070932023524e-23
-        *o[26] + 2.99318679335866e-24*o[24]*pi1))) - 3.33001080055983e-19/(o[
-        1]*o[21]*o[4]*o[5]*tau1)) + 1.44400475720615e-17/(o[21]*o[4]*o[5]*
-        tau1)) + (1.01874413933128e-8 + 1.39398969845072e-9*o[10])/(o[1]*o[5]
-        *tau1))))) + o[3]*(0.00094368642146534 + o[2]*(0.00060003561586052 +
-        (-0.000095322787813974 + o[1]*(8.8283690661692e-6 +
-        1.45389992595188e-15*o[9]))*tau1))) + o[14]*(-0.00028319080123804 + o[
-        1]*(0.00060706301565874 + o[7]*(0.018990068218419 + tau1*(
-        0.032529748770505 + (0.021841717175414 + 0.00005283835796993*o[1])*
-        tau1))));
-    end g1pitau;
-
-    function g2pitau "derivative of g wrt pi and tau"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Real pi "dimensionless pressure";
-      output Real tau "dimensionless temperature";
-      output Real gpi "dimensionless dervative of Gibbs function wrt pi";
-      output Real gtau "dimensionless dervative of Gibbs function wrt tau";
-    protected
-      Real tau2 "dimensionless temperature";
-      Real[22] o "vector of auxiliary variables";
-    algorithm
-      assert(p > triple.ptriple,
-        "IF97 medium function g2pitau called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      assert(p <= 100.0e6,
-        "IF97 medium function g2pitau: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
-      assert(T >= 273.15,
-        "IF97 medium function g2pitau: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
-      assert(T <= 1073.15,
-        "IF97 medium function g2pitau: the input temperature (= " + String(T) + " K) is higher than the limit of 1073.15 K");
-      pi := p/data.PSTAR2;
-      tau := data.TSTAR2/T;
-      tau2 := -0.5 + tau;
-      o[1] := tau*tau;
-      o[2] := o[1]*o[1];
-      o[3] := tau2*tau2;
-      o[4] := o[3]*tau2;
-      o[5] := o[3]*o[3];
-      o[6] := o[5]*o[5];
-      o[7] := o[6]*o[6];
-      o[8] := o[5]*o[6]*o[7]*tau2;
-      o[9] := o[3]*o[5];
-      o[10] := o[5]*o[6]*tau2;
-      o[11] := o[3]*o[7]*tau2;
-      o[12] := o[3]*o[5]*o[6];
-      o[13] := o[3]*o[5]*tau2;
-      o[14] := o[5]*o[6]*o[7];
-      o[15] := pi*pi;
-      o[16] := o[15]*o[15];
-      o[17] := o[15]*o[16];
-      o[18] := o[5]*o[7]*tau2;
-      o[19] := o[7]*o[7];
-      o[20] := o[3]*o[5]*o[6]*tau2;
-      o[21] := o[5]*o[7];
-      o[22] := o[3]*o[7];
-      gtau := (0.0280439559151 + tau*(-0.2858109552582 + tau*(1.2213149471784
-         + tau*(-2.848163942888 + tau*(4.38395111945 + o[1]*(10.08665568018
-         + (-0.5681726521544 + 0.06380539059921*tau)*tau))))))/(o[1]*o[2]) +
-        pi*(-0.017834862292358 + tau2*(-0.09199202739273 + (-0.172743777250296
-         - 0.30195167236758*o[4])*tau2) + pi*(-0.000033032641670203 + (-0.0003789797503263
-         + o[3]*(-0.015757110897342 + o[4]*(-0.306581069554011 -
-        0.000960283724907132*o[8])))*tau2 + pi*(4.3870667284435e-7 + o[3]*(-0.00009683303171571
-         + o[4]*(-0.0090203547252888 - 1.42338887469272*o[8])) + pi*(-7.8847309559367e-10
-         + (2.558143570457e-8 + 1.44676118155521e-6*tau2)*tau2 + pi*(
-        0.0000160454534363627*o[9] + pi*((-5.0144299353183e-11 + o[10]*(-0.033874355714168
-         - 836.35096769364*o[11]))*o[3] + pi*((-0.0000138839897890111 -
-        0.973671060893475*o[12])*o[3]*o[6] + pi*(o[13]*(9.0049690883672e-11
-         - 296.320827232793*o[14]) + pi*(2.57526266427144e-7*o[5]*o[6] + pi*(
-        o[4]*(4.1627860840696e-19 + (-1.0234747095929e-12 -
-        1.40254511313154e-8*o[5])*o[9]) + o[17]*(o[14]*(-2.34560435076256e-9
-         + 5.3465159397045*o[18]) + o[15]*(-19.1874828272775*o[19]*o[6]*o[7]
-         + o[15]*(o[11]*(1.78371690710842e-23 + (1.07202609066812e-11 -
-        0.000201611844951398*o[10])*o[20]) + pi*(-1.24017662339842e-24*o[21]
-         + pi*(0.000200482822351322*o[19]*o[5]*o[7] + pi*(-4.97975748452559e-14
-        *o[19]*o[3]*o[5] + (1.90027787547159e-27 + o[12]*(
-        2.21658861403112e-15 - 0.0000547344301999018*o[22]))*o[6]*o[7]*pi*
-        tau2))))))))))))))));
-      gpi := (1. + pi*(-0.0017731742473213 + tau2*(-0.017834862292358 + tau2*
-        (-0.045996013696365 + (-0.057581259083432 - 0.05032527872793*o[4])*
-        tau2)) + pi*(tau2*(-0.000066065283340406 + (-0.0003789797503263 + o[3]
-        *(-0.007878555448671 + o[4]*(-0.087594591301146 -
-        0.000053349095828174*o[8])))*tau2) + pi*(6.1445213076927e-8 + (
-        1.31612001853305e-6 + o[3]*(-0.00009683303171571 + o[4]*(-0.0045101773626444
-         - 0.122004760687947*o[8])))*tau2 + pi*(tau2*(-3.15389238237468e-9 +
-        (5.116287140914e-8 + 1.92901490874028e-6*tau2)*tau2) + pi*(
-        0.0000114610381688305*o[13] + pi*((-1.00288598706366e-10 + o[10]*(-0.012702883392813
-         - 143.374451604624*o[11]))*o[4] + pi*(-4.1341695026989e-17 + (-8.8352662293707e-6
-         - 0.272627897050173*o[12])*o[3]*o[6]*tau2 + pi*((9.0049690883672e-11
-         - 65.8490727183984*o[14])*o[6] + pi*(1.78287415218792e-7*o[10] + pi*
-        (o[5]*(1.0406965210174e-18 + (-1.0234747095929e-12 -
-        1.0018179379511e-8*o[5])*o[9]) + o[17]*((-1.29412653835176e-9 +
-        1.71088510070544*o[18])*o[8] + o[15]*(-6.05920510335078*o[19]*o[6]*o[
-        7]*tau2 + o[15]*((1.78371690710842e-23 + (6.1258633752464e-12 -
-        0.000084004935396416*o[10])*o[20])*o[21] + pi*(-1.24017662339842e-24*
-        o[18] + pi*(0.0000832192847496054*o[19]*o[5]*o[7]*tau2 + pi*((
-        1.75410265428146e-27 + o[12]*(1.32995316841867e-15 -
-        0.0000226487297378904*o[22]))*o[3]*o[6]*o[7]*pi -
-        2.93678005497663e-14*o[19]*o[3]*o[5]*tau2)))))))))))))))))/pi;
-    end g2pitau;
-
-    function g5pitau "derivative of g wrt pi and tau"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Real pi "dimensionless pressure";
-      output Real tau "dimensionless temperature";
-      output Real gpi "dimensionless dervative of Gibbs function wrt pi";
-      output Real gtau "dimensionless dervative of Gibbs function wrt tau";
-    protected
-      Real[3] o "vector of auxiliary variables";
-    algorithm
-      assert(p > triple.ptriple,
-        "IF97 medium function g5pitau called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      assert(p <= data.PLIMIT5,
-        "IF97 medium function g5pitau: input pressure (= " + String(p) + " Pa) is higher than 10 Mpa in region 5");
-      assert(T <= 2273.15,
-        "IF97 medium function g5pitau: input temperature (= " + String(T) + " K) is higher than limit of 2273.15 K in region 5");
-      pi := p/data.PSTAR5;
-      tau := data.TSTAR5/T;
-      o[1] := tau*tau;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      gtau := pi*(0.0021774678714571 - 0.013782846269973*o[1] + pi*(-0.0000357523455236121
-        *o[3] + 3.8757684869352e-7*o[1]*pi)) + (0.074415446800398 + tau*(-0.73803069960666
-         + (3.1161318213925 + o[1]*(6.8540841634434 - 0.65923253077834*tau))*
-        tau))/o[2];
-      gpi := (1.0 + pi*(-0.00012563183589592 + (0.0021774678714571 -
-        0.004594282089991*o[1])*tau + pi*(-7.9449656719138e-6*o[3]*tau +
-        3.8757684869352e-7*o[1]*pi*tau)))/pi;
-    end g5pitau;
-
-    function f3deltatau "1st derivatives of f wrt delta and tau"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature (K)";
-      output Real delta "dimensionless density";
-      output Real tau "dimensionless temperature";
-      output Real fdelta
-        "dimensionless dervative of Helmholtz function wrt delta";
-      output Real ftau "dimensionless dervative of Helmholtz function wrt tau";
-    protected
-      Real[13] o "vector of auxiliary variables";
-    algorithm
-      tau := data.TCRIT/T;
-      delta := if (d == data.DCRIT and T == data.TCRIT) then 1 + Modelica.
-        Constants.eps else d/data.DCRIT;
-      o[1] := tau*tau;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      o[4] := o[3]*tau;
-      o[5] := o[1]*o[2]*o[3]*tau;
-      o[6] := o[2]*o[3];
-      o[7] := o[1]*o[3];
-      o[8] := o[3]*o[3];
-      o[9] := o[1]*o[2]*o[8];
-      o[10] := o[1]*o[2]*o[8]*tau;
-      o[11] := o[3]*o[8];
-      o[12] := o[1]*o[3]*o[8];
-      o[13] := o[3]*o[8]*tau;
-      fdelta := (1.0658070028513 + delta*(o[1]*(-1.2654315477714 + o[2]*(-1.1524407806681
-         + (0.88521043984318 - 0.64207765181607*o[1])*o[4])) + delta*(
-        0.76986920373342 + o[1]*(-1.70429417648412 + o[2]*(9.7944563083754 +
-        (-6.100523451393 + (0.078841073758308 + 0.25116816848616*o[2])*o[5])*
-        tau)) + delta*(-0.8399798909613 + o[1]*(4.169939870838 + o[1]*(-6.056974507071
-         + o[6]*(-0.0246442911521889 - 1.42788107204769*o[7]))) + delta*(
-        0.175936297894 + o[1]*(-1.77905741714956 + o[1]*(3.62288282878932 +
-        2.82089800351868*o[9])) + delta*(delta*(-0.133052405238576 + o[1]*(
-        0.565564509990552 + 0.98617670687766*o[11]) + delta*(-0.094523605689436
-        *o[1] + delta*(-0.118674762819776*o[12] + delta*(o[1]*(
-        0.00521306582652756 + 0.0290780142333399*o[11]) + delta*(
-        0.00080964802996215 - 0.000494162889679965*delta*o[12] -
-        0.0016557679795037*tau))))) + (0.5385256313166 + o[1]*(-1.6456811629477
-         - 2.5435531020579*o[10]))*tau))))))/delta;
-      ftau := 20.944396974307 + tau*(-15.3735415757432 + o[2]*tau*(
-        18.3301634515678 + o[1]*tau*(-28.08078114862 + o[1]*(14.4640436358204
-         - 0.194503669468755*o[1]*o[3]*tau)))) + delta*((-2.5308630955428 + o[
-        2]*(-6.9146446840086 + (13.2781565976477 - 10.9153200808732*o[1])*o[4]))
-        *tau + delta*(tau*(-1.70429417648412 + o[2]*(29.3833689251262 + (-21.3518320798755
-         + (0.867251811341388 + 3.26518619032008*o[2])*o[5])*tau)) + delta*((
-        2.779959913892 + o[1]*(-8.075966009428 + o[6]*(-0.131436219478341 -
-        12.37496929108*o[7])))*tau + delta*((-0.88952870857478 + o[1]*(
-        3.62288282878932 + 18.3358370228714*o[9]))*tau + delta*(
-        0.10770512626332 + o[1]*(-0.98740869776862 - 13.2264761307011*o[10])
-         + delta*((0.188521503330184 + 4.27343239646986*o[11])*tau + delta*(-0.027006744482696
-        *tau + delta*(-0.385692979164272*o[13] + delta*(delta*(-0.00016557679795037
-         - 0.00116802137560719*delta*o[13]) + (0.00115845907256168 +
-        0.0840031522296486*o[11])*tau)))))))));
-    end f3deltatau;
-
-    function tph1 "inverse function for region 1: T(p,h)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Units.SI.Temperature T "temperature (K)";
-    protected
-      Real pi "dimensionless pressure";
-      Real eta1 "dimensionless specific enthalpy";
-      Real[3] o "vector of auxiliary variables";
-    algorithm
-      assert(p > triple.ptriple,
-        "IF97 medium function tph1 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      pi := p/data.PSTAR2;
-      eta1 := h/data.HSTAR1 + 1.0;
-      o[1] := eta1*eta1;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      T := -238.724899245210 - 13.3917448726020*pi + eta1*(404.21188637945 +
-        43.211039183559*pi + eta1*(113.497468817180 - 54.010067170506*pi +
-        eta1*(30.5358922039160*pi + eta1*(-6.5964749423638*pi + o[1]*(-5.8457616048039
-         + o[2]*(pi*(0.0093965400878363 + (-0.0000258586412820730 +
-        6.6456186191635e-8*pi)*pi) + o[2]*o[3]*(-0.000152854824131400 + o[1]*
-        o[3]*(-1.08667076953770e-6 + pi*(1.15736475053400e-7 + pi*(-4.0644363084799e-9
-         + pi*(8.0670734103027e-11 + pi*(-9.3477771213947e-13 + (
-        5.8265442020601e-15 - 1.50201859535030e-17*pi)*pi))))))))))));
-    end tph1;
-
-    function tps1 "inverse function for region 1: T(p,s)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Temperature T "temperature (K)";
-    protected
-      constant Units.SI.Pressure pstar=1.0e6;
-      constant Units.SI.SpecificEntropy sstar=1.0e3;
-      Real pi "dimensionless pressure";
-      Real sigma1 "dimensionless specific entropy";
-      Real[6] o "vector of auxiliary variables";
-    algorithm
-      pi := p/pstar;
-      assert(p > triple.ptriple,
-        "IF97 medium function tps1 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-
-      sigma1 := s/sstar + 2.0;
-      o[1] := sigma1*sigma1;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      o[4] := o[3]*o[3];
-      o[5] := o[4]*o[4];
-      o[6] := o[1]*o[2]*o[4];
-
-      T := 174.782680583070 + sigma1*(34.806930892873 + sigma1*(
-        6.5292584978455 + (0.33039981775489 + o[3]*(-1.92813829231960e-7 -
-        2.49091972445730e-23*o[2]*o[4]))*sigma1)) + pi*(-0.261076364893320 +
-        pi*(0.00056608900654837 + pi*(o[1]*o[3]*(2.64004413606890e-13 +
-        7.8124600459723e-29*o[6]) - 3.07321999036680e-31*o[5]*pi) + sigma1*(-0.00032635483139717
-         + sigma1*(0.000044778286690632 + o[1]*o[2]*(-5.1322156908507e-10 -
-        4.2522657042207e-26*o[6])*sigma1))) + sigma1*(0.225929659815860 +
-        sigma1*(-0.064256463395226 + sigma1*(0.0078876289270526 + o[3]*sigma1
-        *(3.5672110607366e-10 + 1.73324969948950e-24*o[1]*o[4]*sigma1)))));
-    end tps1;
-
-    function tph2 "reverse function for region 2: T(p,h)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Units.SI.Temperature T "temperature (K)";
-    protected
-      Real pi "dimensionless pressure";
-      Real pi2b "dimensionless pressure";
-      Real pi2c "dimensionless pressure";
-      Real eta "dimensionless specific enthalpy";
-      Real etabc "dimensionless specific enthalpy";
-      Real eta2a "dimensionless specific enthalpy";
-      Real eta2b "dimensionless specific enthalpy";
-      Real eta2c "dimensionless specific enthalpy";
-      Real[8] o "vector of auxiliary variables";
-    algorithm
-      pi := p*data.IPSTAR;
-      eta := h*data.IHSTAR;
-      etabc := h*1.0e-3;
-      if (pi < 4.0) then
-        eta2a := eta - 2.1;
-        o[1] := eta2a*eta2a;
-        o[2] := o[1]*o[1];
-        o[3] := pi*pi;
-        o[4] := o[3]*o[3];
-        o[5] := o[3]*pi;
-        T := 1089.89523182880 + (1.84457493557900 - 0.0061707422868339*pi)*pi
-           + eta2a*(849.51654495535 - 4.1792700549624*pi + eta2a*(-107.817480918260
-           + (6.2478196935812 - 0.310780466295830*pi)*pi + eta2a*(
-          33.153654801263 - 17.3445631081140*pi + o[2]*(-7.4232016790248 + pi
-          *(-200.581768620960 + 11.6708730771070*pi) + o[1]*(271.960654737960
-          *pi + o[1]*(-455.11318285818*pi + eta2a*(1.38657242832260*o[4] + o[
-          1]*o[2]*(3091.96886047550*pi + o[1]*(11.7650487243560 + o[2]*(-13551.3342407750
-          *o[5] + o[2]*(-62.459855192507*o[3]*o[4]*pi + o[2]*(o[4]*(
-          235988.325565140 + 7399.9835474766*pi) + o[1]*(19127.7292396600*o[3]
-          *o[4] + o[1]*(o[3]*(1.28127984040460e8 - 551966.97030060*o[5]) + o[
-          1]*(-9.8554909623276e8*o[3] + o[1]*(2.82245469730020e9*o[3] + o[1]*
-          (o[3]*(-3.5948971410703e9 + 3.7154085996233e6*o[5]) + o[1]*pi*(
-          252266.403578720 + pi*(1.72273499131970e9 + pi*(1.28487346646500e7
-           + (-1.31052365450540e7 - 415351.64835634*o[3])*pi))))))))))))))))))));
-      elseif (pi < (0.12809002730136e-03*etabc - 0.67955786399241)*etabc +
-          0.90584278514723e3) then
-        eta2b := eta - 2.6;
-        pi2b := pi - 2.0;
-        o[1] := pi2b*pi2b;
-        o[2] := o[1]*pi2b;
-        o[3] := o[1]*o[1];
-        o[4] := eta2b*eta2b;
-        o[5] := o[4]*o[4];
-        o[6] := o[4]*o[5];
-        o[7] := o[5]*o[5];
-        T := 1489.50410795160 + 0.93747147377932*pi2b + eta2b*(
-          743.07798314034 + o[2]*(0.000110328317899990 - 1.75652339694070e-18
-          *o[1]*o[3]) + eta2b*(-97.708318797837 + pi2b*(3.3593118604916 +
-          pi2b*(-0.0218107553247610 + pi2b*(0.000189552483879020 + (
-          2.86402374774560e-7 - 8.1456365207833e-14*o[2])*pi2b))) + o[5]*(
-          3.3809355601454*pi2b + o[4]*(-0.108297844036770*o[1] + o[5]*(
-          2.47424647056740 + (0.168445396719040 + o[1]*(0.00308915411605370
-           - 0.0000107798573575120*pi2b))*pi2b + o[6]*(-0.63281320016026 +
-          pi2b*(0.73875745236695 + (-0.046333324635812 + o[1]*(-0.000076462712454814
-           + 2.82172816350400e-7*pi2b))*pi2b) + o[6]*(1.13859521296580 + pi2b
-          *(-0.47128737436186 + o[1]*(0.00135555045549490 + (
-          0.0000140523928183160 + 1.27049022719450e-6*pi2b)*pi2b)) + o[5]*(-0.47811863648625
-           + (0.150202731397070 + o[2]*(-0.0000310838143314340 + o[1]*(-1.10301392389090e-8
-           - 2.51805456829620e-11*pi2b)))*pi2b + o[5]*o[7]*(
-          0.0085208123431544 + pi2b*(-0.00217641142197500 + pi2b*(
-          0.000071280351959551 + o[1]*(-1.03027382121030e-6 + (
-          7.3803353468292e-8 + 8.6934156344163e-15*o[3])*pi2b))))))))))));
-      else
-        eta2c := eta - 1.8;
-        pi2c := pi + 25.0;
-        o[1] := pi2c*pi2c;
-        o[2] := o[1]*o[1];
-        o[3] := o[1]*o[2]*pi2c;
-        o[4] := 1/o[3];
-        o[5] := o[1]*o[2];
-        o[6] := eta2c*eta2c;
-        o[7] := o[2]*o[2];
-        o[8] := o[6]*o[6];
-        T := eta2c*((859777.22535580 + o[1]*(482.19755109255 +
-          1.12615974072300e-12*o[5]))/o[1] + eta2c*((-5.8340131851590e11 + (
-          2.08255445631710e10 + 31081.0884227140*o[2])*pi2c)/o[5] + o[6]*(o[8]
-          *(o[6]*(1.23245796908320e-7*o[5] + o[6]*(-1.16069211309840e-6*o[5]
-           + o[8]*(0.0000278463670885540*o[5] + (-0.00059270038474176*o[5] +
-          0.00129185829918780*o[5]*o[6])*o[8]))) - 10.8429848800770*pi2c) + o[
-          4]*(7.3263350902181e12 + o[7]*(3.7966001272486 + (-0.045364172676660
-           - 1.78049822406860e-11*o[2])*pi2c))))) + o[4]*(-3.2368398555242e12
-           + pi2c*(3.5825089945447e11 + pi2c*(-1.07830682174700e10 + o[1]*
-          pi2c*(610747.83564516 + pi2c*(-25745.7236041700 + (1208.23158659360
-           + 1.45591156586980e-13*o[5])*pi2c)))));
-      end if;
-    end tph2;
-
-    function tps2a "reverse function for region 2a: T(p,s)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Temperature T "temperature (K)";
-    protected
-      Real[12] o "vector of auxiliary variables";
-      constant Real IPSTAR=1.0e-6 "scaling variable";
-      constant Real ISSTAR2A=1/2000.0 "scaling variable";
-      Real pi "dimensionless pressure";
-      Real sigma2a "dimensionless specific entropy";
-    algorithm
-      pi := p*IPSTAR;
-      sigma2a := s*ISSTAR2A - 2.0;
-      o[1] := pi^0.5;
-      o[2] := sigma2a*sigma2a;
-      o[3] := o[2]*o[2];
-      o[4] := o[3]*o[3];
-      o[5] := o[4]*o[4];
-      o[6] := pi^0.25;
-      o[7] := o[2]*o[4]*o[5];
-      o[8] := 1/o[7];
-      o[9] := o[3]*sigma2a;
-      o[10] := o[2]*o[3]*sigma2a;
-      o[11] := o[3]*o[4]*sigma2a;
-      o[12] := o[2]*sigma2a;
-      T := ((-392359.83861984 + (515265.73827270 + o[3]*(40482.443161048 + o[
-        2]*o[3]*(-321.93790923902 + o[2]*(96.961424218694 - 22.8678463717730*
-        sigma2a))))*sigma2a)/(o[4]*o[5]) + o[6]*((-449429.14124357 + o[3]*(-5011.8336020166
-         + 0.35684463560015*o[4]*sigma2a))/(o[2]*o[5]*sigma2a) + o[6]*(o[8]*(
-        44235.335848190 + o[9]*(-13673.3888117080 + o[3]*(421632.60207864 + (
-        22516.9258374750 + o[10]*(474.42144865646 - 149.311307976470*sigma2a))
-        *sigma2a))) + o[6]*((-197811.263204520 - 23554.3994707600*sigma2a)/(o[
-        2]*o[3]*o[4]*sigma2a) + o[6]*((-19070.6163020760 + o[11]*(
-        55375.669883164 + (3829.3691437363 - 603.91860580567*o[2])*o[3]))*o[8]
-         + o[6]*((1936.31026203310 + o[2]*(4266.0643698610 + o[2]*o[3]*o[4]*(
-        -5978.0638872718 - 704.01463926862*o[9])))/(o[2]*o[4]*o[5]*sigma2a)
-         + o[1]*((338.36784107553 + o[12]*(20.8627866351870 + (
-        0.033834172656196 - 0.000043124428414893*o[12])*o[3]))*sigma2a + o[6]
-        *(166.537913564120 + sigma2a*(-139.862920558980 + o[3]*(-0.78849547999872
-         + (0.072132411753872 + o[3]*(-0.0059754839398283 + (-0.0000121413589539040
-         + 2.32270967338710e-7*o[2])*o[3]))*sigma2a)) + o[6]*(-10.5384635661940
-         + o[3]*(2.07189254965020 + (-0.072193155260427 + 2.07498870811200e-7
-        *o[4])*o[9]) + o[6]*(o[6]*(o[12]*(0.210375278936190 +
-        0.000256812397299990*o[3]*o[4]) + (-0.0127990029337810 -
-        8.2198102652018e-6*o[11])*o[6]*o[9]) + o[10]*(-0.0183406579113790 +
-        2.90362723486960e-7*o[2]*o[4]*sigma2a)))))))))))/(o[1]*pi);
-    end tps2a;
-
-    function tps2b "reverse function for region 2b: T(p,s)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Temperature T "temperature (K)";
-    protected
-      Real[8] o "vector of auxiliary variables";
-      constant Real IPSTAR=1.0e-6 "scaling variable";
-      constant Real ISSTAR2B=1/785.3 "scaling variable";
-      Real pi "dimensionless pressure";
-      Real sigma2b "dimensionless specific entropy";
-    algorithm
-      pi := p*IPSTAR;
-      sigma2b := 10.0 - s*ISSTAR2B;
-      o[1] := pi*pi;
-      o[2] := o[1]*o[1];
-      o[3] := sigma2b*sigma2b;
-      o[4] := o[3]*o[3];
-      o[5] := o[4]*o[4];
-      o[6] := o[3]*o[5]*sigma2b;
-      o[7] := o[3]*o[5];
-      o[8] := o[3]*sigma2b;
-      T := (316876.65083497 + 20.8641758818580*o[6] + pi*(-398593.99803599 -
-        21.8160585188770*o[6] + pi*(223697.851942420 + (-2784.17034458170 +
-        9.9207436071480*o[7])*sigma2b + pi*(-75197.512299157 + (
-        2970.86059511580 + o[7]*(-3.4406878548526 + 0.38815564249115*sigma2b))
-        *sigma2b + pi*(17511.2950857500 + sigma2b*(-1423.71128544490 + (
-        1.09438033641670 + 0.89971619308495*o[4])*o[4]*sigma2b) + pi*(-3375.9740098958
-         + (471.62885818355 + o[4]*(-1.91882419936790 + o[8]*(
-        0.41078580492196 - 0.33465378172097*sigma2b)))*sigma2b + pi*(
-        1387.00347775050 + sigma2b*(-406.63326195838 + sigma2b*(
-        41.727347159610 + o[3]*(2.19325494345320 + sigma2b*(-1.03200500090770
-         + (0.35882943516703 + 0.0052511453726066*o[8])*sigma2b)))) + pi*(
-        12.8389164507050 + sigma2b*(-2.86424372193810 + sigma2b*(
-        0.56912683664855 + (-0.099962954584931 + o[4]*(-0.0032632037778459 +
-        0.000233209225767230*sigma2b))*sigma2b)) + pi*(-0.153348098574500 + (
-        0.0290722882399020 + 0.00037534702741167*o[4])*sigma2b + pi*(
-        0.00172966917024110 + (-0.00038556050844504 - 0.000035017712292608*o[
-        3])*sigma2b + pi*(-0.0000145663936314920 + 5.6420857267269e-6*sigma2b
-         + pi*(4.1286150074605e-8 + (-2.06846711188240e-8 +
-        1.64093936747250e-9*sigma2b)*sigma2b))))))))))))/(o[1]*o[2]);
-    end tps2b;
-
-    function tps2c "reverse function for region 2c: T(p,s)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Temperature T "temperature (K)";
-    protected
-      constant Real IPSTAR=1.0e-6 "scaling variable";
-      constant Real ISSTAR2C=1/2925.1 "scaling variable";
-      Real pi "dimensionless pressure";
-      Real sigma2c "dimensionless specific entropy";
-      Real[3] o "vector of auxiliary variables";
-    algorithm
-      pi := p*IPSTAR;
-      sigma2c := 2.0 - s*ISSTAR2C;
-      o[1] := pi*pi;
-      o[2] := sigma2c*sigma2c;
-      o[3] := o[2]*o[2];
-      T := (909.68501005365 + 2404.56670884200*sigma2c + pi*(-591.62326387130
-         + pi*(541.45404128074 + sigma2c*(-270.983084111920 + (
-        979.76525097926 - 469.66772959435*sigma2c)*sigma2c) + pi*(
-        14.3992746047230 + (-19.1042042304290 + o[2]*(5.3299167111971 -
-        21.2529753759340*sigma2c))*sigma2c + pi*(-0.311473344137600 + (
-        0.60334840894623 - 0.042764839702509*sigma2c)*sigma2c + pi*(
-        0.0058185597255259 + (-0.0145970082847530 + 0.0056631175631027*o[3])*
-        sigma2c + pi*(-0.000076155864584577 + sigma2c*(0.000224403429193320
-         - 0.0000125610950134130*o[2]*sigma2c) + pi*(6.3323132660934e-7 + (-2.05419896753750e-6
-         + 3.6405370390082e-8*sigma2c)*sigma2c + pi*(-2.97598977892150e-9 +
-        1.01366185297630e-8*sigma2c + pi*(5.9925719692351e-12 + sigma2c*(-2.06778701051640e-11
-         + o[2]*(-2.08742781818860e-11 + (1.01621668250890e-10 -
-        1.64298282813470e-10*sigma2c)*sigma2c))))))))))))/o[1];
-    end tps2c;
-
-    function tps2 "reverse function for region 2: T(p,s)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Temperature T "temperature (K)";
-    protected
-      Real pi "dimensionless pressure";
-      constant Units.SI.SpecificEntropy SLIMIT=5.85e3
-        "subregion boundary specific entropy between regions 2a and 2b";
-    algorithm
-      if p < 4.0e6 then
-        T := tps2a(p, s);
-      elseif s > SLIMIT then
-        T := tps2b(p, s);
-      else
-        T := tps2c(p, s);
-      end if;
-    end tps2;
-
-    function tsat "region 4 saturation temperature as a function of pressure"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.Temperature t_sat "temperature";
-    protected
-      Real pi "dimensionless pressure";
-      Real[20] o "vector of auxiliary variables";
-    algorithm
-    //   assert(p > triple.ptriple,
-    //     "IF97 medium function tsat called with too low pressure\n" +
-    //     "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-    //  assert(p <= data.PCRIT,
-    //    "tsat: input pressure is higher than the critical point pressure");
-      pi := max(min(p,data.PCRIT),triple.ptriple)*data.IPSTAR;
-      o[1] := pi^0.25;
-      o[2] := -3.2325550322333e6*o[1];
-      o[3] := pi^0.5;
-      o[4] := -724213.16703206*o[3];
-      o[5] := 405113.40542057 + o[2] + o[4];
-      o[6] := -17.0738469400920*o[1];
-      o[7] := 14.9151086135300 + o[3] + o[6];
-      o[8] := -4.0*o[5]*o[7];
-      o[9] := 12020.8247024700*o[1];
-      o[10] := 1167.05214527670*o[3];
-      o[11] := -4823.2657361591 + o[10] + o[9];
-      o[12] := o[11]*o[11];
-      o[13] := o[12] + o[8];
-      o[14] := o[13]^0.5;
-      o[15] := -o[14];
-      o[16] := -12020.8247024700*o[1];
-      o[17] := -1167.05214527670*o[3];
-      o[18] := 4823.2657361591 + o[15] + o[16] + o[17];
-      o[19] := 1/o[18];
-      o[20] := 2.0*o[19]*o[5];
-
-      t_sat := 0.5*(650.17534844798 + o[20] - (-4.0*(-0.238555575678490 +
-        1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5);
-      annotation (derivative=tsat_der);
-    end tsat;
-
-    function dtsatofp "derivative of saturation temperature w.r.t. pressure"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Real dtsat(unit="K/Pa") "derivative of T w.r.t. p";
-    protected
-      Real pi "dimensionless pressure";
-      Real[49] o "vector of auxiliary variables";
-    algorithm
-      pi := p*data.IPSTAR;
-      o[1] := pi^0.75;
-      o[2] := 1/o[1];
-      o[3] := -4.268461735023*o[2];
-      o[4] := sqrt(pi);
-      o[5] := 1/o[4];
-      o[6] := 0.5*o[5];
-      o[7] := o[3] + o[6];
-      o[8] := pi^0.25;
-      o[9] := -3.2325550322333e6*o[8];
-      o[10] := -724213.16703206*o[4];
-      o[11] := 405113.40542057 + o[10] + o[9];
-      o[12] := -4*o[11]*o[7];
-      o[13] := -808138.758058325*o[2];
-      o[14] := -362106.58351603*o[5];
-      o[15] := o[13] + o[14];
-      o[16] := -17.073846940092*o[8];
-      o[17] := 14.91510861353 + o[16] + o[4];
-      o[18] := -4*o[15]*o[17];
-      o[19] := 3005.2061756175*o[2];
-      o[20] := 583.52607263835*o[5];
-      o[21] := o[19] + o[20];
-      o[22] := 12020.82470247*o[8];
-      o[23] := 1167.0521452767*o[4];
-      o[24] := -4823.2657361591 + o[22] + o[23];
-      o[25] := 2.0*o[21]*o[24];
-      o[26] := o[12] + o[18] + o[25];
-      o[27] := -4.0*o[11]*o[17];
-      o[28] := o[24]*o[24];
-      o[29] := o[27] + o[28];
-      o[30] := sqrt(o[29]);
-      o[31] := 1/o[30];
-      o[32] := (-o[30]);
-      o[33] := -12020.82470247*o[8];
-      o[34] := -1167.0521452767*o[4];
-      o[35] := 4823.2657361591 + o[32] + o[33] + o[34];
-      o[36] := o[30];
-      o[37] := -4823.2657361591 + o[22] + o[23] + o[36];
-      o[38] := o[37]*o[37];
-      o[39] := 1/o[38];
-      o[40] := -1.72207339365771*o[30];
-      o[41] := 21592.2055343628*o[8];
-      o[42] := o[30]*o[8];
-      o[43] := -8192.87114842946*o[4];
-      o[44] := -0.510632954559659*o[30]*o[4];
-      o[45] := -3100.02526152368*o[1];
-      o[46] := pi;
-      o[47] := 1295.95640782102*o[46];
-      o[48] := 2862.09212505088 + o[40] + o[41] + o[42] + o[43] + o[44] + o[
-        45] + o[47];
-      o[49] := 1/(o[35]*o[35]);
-      dtsat := data.IPSTAR*0.5*((2.0*o[15])/o[35] - 2.*o[11]*(-3005.2061756175
-        *o[2] - 0.5*o[26]*o[31] - 583.52607263835*o[5])*o[49] - (
-        20953.46356643991*(o[39]*(1295.95640782102 + 5398.05138359071*o[2] +
-        0.25*o[2]*o[30] - 0.861036696828853*o[26]*o[31] - 0.255316477279829*o[
-        26]*o[31]*o[4] - 4096.43557421473*o[5] - 0.255316477279829*o[30]*o[5]
-         - 2325.01894614276/o[8] + 0.5*o[26]*o[31]*o[8]) - 2.0*(o[19] + o[20]
-         + 0.5*o[26]*o[31])*o[48]*o[37]^(-3)))/sqrt(o[39]*o[48]));
-    end dtsatofp;
-
-    function tsat_der "derivative function for tsat"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Real der_p(unit="Pa/s") "pressure derivatrive";
-      output Real der_tsat(unit="K/s") "temperature derivative";
-    protected
-      Real dtp;
-    algorithm
-      dtp := dtsatofp(p);
-      der_tsat := dtp*der_p;
-    end tsat_der;
-
-    function psat "region 4 saturation pressure as a functionx of temperature"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.Pressure p_sat "pressure";
-    protected
-      Real[7] o "vector of auxiliary variables";
-      Real C "auxiliary variable";
-      Real B "auxiliary variable";
-      Real A "auxiliary variable";
-      Real Tlim=min(T, data.TCRIT);
-    algorithm
-      assert(T >= 273.16,
-        "IF97 medium function psat: input temperature (= " + String(triple.ptriple) + " K).\n" +
-        "lower than the triple point temperature 273.16 K");
-      o[1] := -650.17534844798 + Tlim;
-      o[2] := 1/o[1];
-      o[3] := -0.238555575678490*o[2];
-      o[4] := o[3] + Tlim "theta";
-      o[5] := -4823.2657361591*o[4] "n7*theta";
-      o[6] := o[4]*o[4] "theta^2";
-      o[7] := 14.9151086135300*o[6] "n6*theta^2";
-      C := 405113.40542057 + o[5] + o[7] "C";
-      B := -3.2325550322333e6 +12020.8247024700*o[4] - 17.0738469400920*o[6];
-      A := (-724213.16703206 + 1167.05214527670*o[4] + o[6]);
-      p_sat := 16.0e6*C*C*C*C*1/(-B + (-4.0*A*C + B*B)^0.5)^4.0;
-      annotation (derivative=psat_der);
-    end psat;
-
-    function dptofT
-      "derivative of pressure wrt temperature along the saturation pressure curve"
-      extends Modelica.Icons.Function;
-      input Units.SI.Temperature T "temperature (K)";
-      output Real dpt(unit = "Pa/K") "temperature derivative of pressure";
-    protected
-      Real[31] o "vector of auxiliary variables";
-      Real Tlim "temperature limited to TCRIT";
-    algorithm
-      Tlim := min(T, data.TCRIT);
-      o[1] := -650.17534844798 + Tlim;
-      o[2] := 1/o[1];
-      o[3] := -0.238555575678490*o[2];
-      o[4] := o[3] + Tlim "theta";
-      o[5] := -4823.2657361591*o[4];
-      o[6] := o[4]*o[4] "theta^2";
-      o[7] := 14.9151086135300*o[6];
-      o[8] := 405113.40542057 + o[5] + o[7];
-      o[9] := o[8]*o[8];
-      o[10] := o[9]*o[9];
-      o[11] := o[1]*o[1];
-      o[12] := 1/o[11];
-      o[13] := 0.238555575678490*o[12];
-      o[14] := 1.00000000000000 + o[13] "dtheta";
-      o[15] := 12020.8247024700*o[4];
-      o[16] := -17.0738469400920*o[6];
-      o[17] := -3.2325550322333e6 + o[15] + o[16];
-      o[18] := -4823.2657361591*o[14];
-      o[19] := 29.8302172270600*o[14]*o[4];
-      o[20] := o[18] + o[19];
-      o[21] := 1167.05214527670*o[4];
-      o[22] := -724213.16703206 + o[21] + o[6];
-      o[23] := o[17]*o[17];
-      o[24] := -4.0000000000000*o[22]*o[8];
-      o[25] := o[23] + o[24];
-      o[26] := sqrt(o[25]);
-      o[27] := -12020.8247024700*o[4];
-      o[28] := 17.0738469400920*o[6];
-      o[29] := 3.2325550322333e6 + o[26] + o[27] + o[28];
-      o[30] := o[29]*o[29];
-      o[31] := o[30]*o[30];
-      dpt := 1e6*((-64.0*o[10]*(-12020.8247024700*o[14] + 34.147693880184*o[
-        14]*o[4] + (0.5*(-4.0*o[20]*o[22] + 2.00000000000000*o[17]*(
-        12020.8247024700*o[14] - 34.147693880184*o[14]*o[4]) - 4.0*(
-        1167.05214527670*o[14] + 2.0*o[14]*o[4])*o[8]))/o[26]))/(o[29]*o[31])
-         + (64.*o[20]*o[8]*o[9])/o[31]);
-    end dptofT;
-
-    function d2ptofT
-      "Second derivative of pressure wrt temperature along the saturation pressure curve"
-      extends Modelica.Icons.Function;
-      input Units.SI.Temperature T "temperature (K)";
-      output Real dpT(unit = "Pa/K") "Temperature derivative of pressure";
-      output Real dpTT(unit = "Pa/(K.K)")
-        "Second temperature derivative of pressure";
-    protected
-      Real A "Auxiliary variable";
-      Real Ad "Auxiliary variable";
-      Real A1 "Auxiliary variable";
-      Real A2 "Auxiliary variable";
-      Real B "Auxiliary variable";
-      Real Bd "Auxiliary variable";
-      Real B1 "Auxiliary variable";
-      Real B2 "Auxiliary variable";
-      Real C "Auxiliary variable";
-      Real Cd "Auxiliary variable";
-      Real C1 "Auxiliary variable";
-      Real C2 "Auxiliary variable";
-      Real D "Auxiliary variable";
-      Real D1 "Auxiliary variable";
-      Real Dd "Auxiliary variable";
-      Real D2 "Auxiliary variable";
-    //   Real F "Auxiliary variable";
-    //   Real Fd "Auxiliary variable";
-      Real th "Auxiliary variable";
-      Real thd "Auxiliary variable";
-      Real thdd "Auxiliary variable";
-      Real v "Auxiliary variable";
-      Real v2 "Auxiliary variable";
-      Real v4 "Auxiliary variable";
-      Real v5 "Auxiliary variable";
-      Real v6 "Auxiliary variable";
-      Real[16] o "vector of auxiliary variables";
-      Real Tlim "temperature limited to TCRIT";
-      parameter Real[10] n =  {0.11670521452767e4,-0.72421316703206e6,
-                              -0.17073846940092e2, 0.12020824702470e5,
-                              -0.32325550322333e7, 0.14915108613530e2,
-                              -0.48232657361591e4, 0.40511340542057e6,
-                              -0.23855557567849,   0.65017534844798e3};
-    algorithm
-      Tlim := min(T, data.TCRIT);
-      o[1] := Tlim - n[10];
-      th := Tlim + n[9]/o[1];
-      o[2] := th*th "theta^2";
-      A := o[2] + n[1]*th + n[2];
-      B := n[3]*o[2] + n[4]*th + n[5];
-      C := n[6]*o[2] + n[7]*th + n[8];
-      o[3] := o[1]*o[1];
-      o[4] := o[3]*o[3];
-      D := (B*B-4.0*A*C);
-      o[5] := sqrt(D);
-      v := 1/(o[5]- B);
-      v2 := v*v;
-      v4 := v2*v2;
-      v5 := v4*v;
-      v6 := v4*v2;
-      o[6] := 2.0*C*v;
-      o[7] := o[6]*o[6];
-    //  F := o[7]*o[7]*1e6 "this is also psat, and correct";
-      thd := 1.0 - n[9]/o[3];
-      thdd :=  2.0*n[9]/(o[3]*o[1]);
-      Ad := 2.0*th + n[1];
-      Bd := 2.0*n[3]*th + n[4];
-      Cd := 2.0*n[6]*th + n[7];
-      Dd := 2*B*Bd -4*(Ad*C + Cd*A);
-      A1 := Ad*thd;
-      B1 := Bd*thd;
-      C1 := Cd*thd;
-      D1 := Dd*thd;
-      o[8] := C*C "C^2";
-      o[9] := o[8]*C "C^3";
-      o[10] := o[9]*C "C^4";
-      o[11] := 1/o[5] "1/sqrt(D)";
-      o[12] := (-B1 + 0.5*D1*o[11]) "-B1 + 1/2*D1/sqrt(D)";
-      o[13] := o[12]*o[12];
-      o[14] := C1*C1 "C1^2";
-      o[15] := B1*B1 "B1^2";
-      o[16] := D*o[5] "D^3/2";
-      // dpsat (=Fd) is correct
-      // Fd := 64.0*C*C*C*C1*v4-64.0*C*C*C*C*(-B1 + 0.5*D1/sqrt(D))*v5;
-      dpT := 64.0*(C1*o[9]*v4 - o[10]*o[12]*v5)*1.0e6 "dpsat";
-      A2 := Ad*thdd + thd*thd*2.0;
-      B2 := Bd*thdd + thd*thd*2.0*n[3];
-      C2 := Cd*thdd + thd*thd*2.0*n[6];
-      D2 := 2.0*(B*B2 + o[15]) -4.0*(A2*C + 2.0*A1*C1 + A*C2);
-      dpTT := ((192.0*o[8]*o[14] + 64.0*o[9]*C2)*v4 + (-512.0*C1*o[9]*o[12] - 64.0*o[10]*(-B2-0.25*D1*D1/o[16] + 0.5*D2*o[11]))*v5
-         +(320.0*o[10]*o[13])*v6)*1.0e6;
-    end d2ptofT;
-
-    function psat_der "derivative function for psat"
-      extends Modelica.Icons.Function;
-      input Units.SI.Temperature T "temperature (K)";
-      input Real der_T(unit = "K/s") "temperature derivative";
-      output Real der_psat(unit = "Pa/s") "pressure";
-    protected
-      Real dpt;
-    algorithm
-      dpt := dptofT(T);
-      der_psat := dpt*der_T;
-    end psat_der;
-
-    // Inverses p_hs from the 2001 assition to IAPWS97
-    function p1_hs "pressure as a function of ehtnalpy and entropy in region 1"
-      extends Modelica.Icons.Function;
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Pressure p "Pressure";
-      constant Real[:] n=
-        {-0.691997014660582,-0.183612548787560e2,-0.928332409297335e1,0.659639569909906e2,
-         -0.162060388912024e2,0.450620017338667e3,0.854680678224170e3,0.607523214001162e4,0.326487682621856e2,
-         -0.269408844582931e2,-0.319947848334300e3,-0.928354307043320e3,0.303634537455249e2,-0.650540422444146e2,
-         -0.430991316516130e4,-0.747512324096068e3,0.730000345529245e3,0.114284032569021e4,-0.436407041874559e3};
-      constant Real[:] I = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,4,4,5};
-      constant Real[:] J = {0,1,2,4,5,6,8,14,0,1,4,6,0,1,10,4,1,4,0};
-      constant Units.SI.SpecificEnthalpy hstar=3400e3 "normalization enthalpy";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEntropy sstar=7.6e3 "normalization entropy";
-    protected
-      Real eta = h/hstar "normalized specific enthalpy";
-      Real sigma = s/sstar "normalized specific entropy";
-    algorithm
-      p := sum(n[i]*(eta + 0.05)^I[i]*(sigma + 0.05)^J[i] for i in 1:19)*pstar;
-      annotation (
-          Documentation(                                                                                                    info="<html>
-<p>
-  Equation number 1 from:<br>
-  The International Association for the Properties of Water and Steam<br>
-  Gaithersburg, Maryland, USA<br>
-  September 2001<br>
-  Supplementary Release on&nbsp; Backward Equations for Pressure as a
-  Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
-  Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
-  </p>
-  </html>
-  "));
-    end p1_hs;
-
-    function h2ab_s "boundary between regions 2a and 2b"
-      extends Modelica.Icons.Function;
-      output Units.SI.SpecificEnthalpy h "Enthalpy";
-      input Units.SI.SpecificEntropy s "Entropy";
-    protected
-      constant Real[:] n = {-0.349898083432139e4,0.257560716905876e4,-0.421073558227969e3,0.276349063799944e2};
-      constant Units.SI.SpecificEnthalpy hstar=1e3 "normalization enthalpy";
-      constant Units.SI.SpecificEntropy sstar=1e3 "normalization entropy";
-      Real sigma = s/sstar "normalized specific entropy";
-    algorithm
-      h := (n[1] + n[2]*sigma + n[3]*sigma^2 + n[4]*sigma^3)*hstar;
-      annotation (
-          Documentation(                                                                                                    info="<html>
-  <p>
-  Equation number 2 from:<br>
-  The International Association for the Properties of Water and Steam<br>
-  Gaithersburg, Maryland, USA<br>
-  September 2001<br>
-  Supplementary Release on&nbsp; Backward Equations for Pressure as a
-  Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
-  Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
-  </p>
-  </html>
-  "));
-    end h2ab_s;
-
-    function p2a_hs
-      "pressure as a function of enthalpy and entropy in subregion 2a"
-      extends Modelica.Icons.Function;
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Pressure p "Pressure";
-      constant Real[:] n=
-        {-0.182575361923032e-1,-0.125229548799536,0.592290437320145,0.604769706185122e1,
-         0.238624965444474e3,-0.298639090222922e3,0.512250813040750e-1,-0.437266515606486,0.413336902999504,
-         -0.516468254574773e1,-0.557014838445711e1,0.128555037824478e2,0.114144108953290e2,-0.119504225652714e3,
-         -0.284777985961560e4,0.431757846408006e4,0.112894040802650e1,0.197409186206319e4,0.151612444706087e4,
-         0.141324451421235e-1,0.585501282219601,-0.297258075863012e1,0.594567314847319e1,-0.623656565798905e4,
-         0.965986235133332e4,0.681500934948134e1,-0.633207286824489e4,-0.558919224465760e1,0.400645798472063e-1};
-      constant Real[:] I = {0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,3,3,3,4,5,5,6,7};
-      constant Real[:] J = {1,3,6,16,20,22,0,1,2,3,5,6,10,16,20,22,3,16,20,0,2,3,6,16,16,3,16,3,1};
-      constant Units.SI.SpecificEnthalpy hstar=4200e3 "normalization enthalpy";
-      constant Units.SI.Pressure pstar=4e6 "normalization pressure";
-      constant Units.SI.SpecificEntropy sstar=12e3 "normalization entropy";
-    protected
-      Real eta = h/hstar "normalized specific enthalpy";
-      Real sigma = s/sstar "normalized specific entropy";
-    algorithm
-      p := sum(n[i]*(eta - 0.5)^I[i]*(sigma - 1.2)^J[i] for i in 1:29)^4*pstar;
-      annotation (
-          Documentation(                                                                                                    info="<html>
-  <p>
-  Equation number 3 from:<br>
-  The International Association for the Properties of Water and Steam<br>
-  Gaithersburg, Maryland, USA<br>
-  September 2001<br>
-  Supplementary Release on&nbsp; Backward Equations for Pressure as a
-  Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
-  Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
-  </p>
-  </html>
-  "));
-    end p2a_hs;
-
-  function p2b_hs
-      "pressure as a function of enthalpy and entropy in subregion 2a"
-    extends Modelica.Icons.Function;
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Pressure p "Pressure";
-    constant Real[:] n=
-      {0.801496989929495e-1,-0.543862807146111,0.337455597421283,0.890555451157450e1,
-       0.313840736431485e3,0.797367065977789,-0.121616973556240e1,0.872803386937477e1,-0.169769781757602e2,
-       -0.186552827328416e3,0.951159274344237e5,-0.189168510120494e2,-0.433407037194840e4,0.543212633012715e9,
-       0.144793408386013,0.128024559637516e3,-0.672309534071268e5,0.336972380095287e8,-0.586634196762720e3,
-       -0.221403224769889e11,0.171606668708389e4,-0.570817595806302e9,-0.312109693178482e4,-0.207841384633010e7,
-       0.305605946157786e13,0.322157004314333e4,0.326810259797295e12,-0.144104158934487e4,0.410694867802691e3,
-       0.109077066873024e12,-0.247964654258893e14,0.188801906865134e10,-0.123651009018773e15};
-    constant Real[:] I = {0,0,0,0,0,1,1,1,1,1,1,2,2,2,3,3,3,3,4,4,5,5,6,6,6,7,7,8,8,8,8,12,14};
-    constant Real[:] J = {0,1,2,4,8,0,1,2,3,5,12,1,6,18,0,1,7,12,1,16,1,12,1,8,18,1,16,1,3,14,18,10,16};
-      constant Units.SI.SpecificEnthalpy hstar=4100e3 "normalization enthalpy";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEntropy sstar=7.9e3 "normalization entropy";
-    protected
-    Real eta = h/hstar "normalized specific enthalpy";
-    Real sigma = s/sstar "normalized specific entropy";
-
-  algorithm
-    p := sum(n[i]*(eta - 0.6)^I[i]*(sigma - 1.01)^J[i] for i in 1:33)^4*pstar;
-    annotation (
-          Documentation(                                                                                                    info="<html>
-<p>
-Equation number 4 from:<br>
-The International Association for the Properties of Water and Steam<br>
-Gaithersburg, Maryland, USA<br>
-September 2001<br>
-Supplementary Release on&nbsp; Backward Equations for Pressure as a
-Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
-Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
-</p>
-      </html>
-"));
-  end p2b_hs;
-
-    function p2c_hs
-      "pressure as a function of enthalpy and entropy in subregion 2c"
-        extends Modelica.Icons.Function;
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Pressure p "Pressure";
-        constant Real[:] n=
-          {0.112225607199012,-0.339005953606712e1,-0.320503911730094e2,-0.197597305104900e3,
-           -0.407693861553446e3,0.132943775222331e5,0.170846839774007e1,0.373694198142245e2,0.358144365815434e4,
-           0.423014446424664e6,-0.751071025760063e9,0.523446127607898e2,-0.228351290812417e3,-0.960652417056937e6,
-           -0.807059292526074e8,0.162698017225669e13,0.772465073604171,0.463929973837746e5,-0.137317885134128e8,
-           0.170470392630512e13,-0.251104628187308e14,0.317748830835520e14,0.538685623675312e2,-0.553089094625169e5,
-           -0.102861522421405e7,0.204249418756234e13,0.273918446626977e9,-0.263963146312685e16,-0.107890854108088e10,
-           -0.296492620980124e11,-0.111754907323424e16};
-        constant Real[:] I = {0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,6,6,10,12,16};
-        constant Real[:] J = {0,1,2,3,4,8,0,2,5,8,14,2,3,7,10,18,0,5,8,16,18,18,1,4,6,14,8,18,7,7,10};
-      constant Units.SI.SpecificEnthalpy hstar=3500e3 "normalization enthalpy";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEntropy sstar=5.9e3 "normalization entropy";
-    protected
-        Real eta = h/hstar "normalized specific enthalpy";
-        Real sigma = s/sstar "normalized specific entropy";
-    algorithm
-        p := sum(n[i]*(eta - 0.7)^I[i]*(sigma - 1.1)^J[i] for i in 1:31)^4*pstar;
-        annotation (
-          Documentation(                                                                                                    info="<html>
-      <p>
-      Equation number 5 from:<br>
-      The International Association for the Properties of Water and Steam<br>
-      Gaithersburg, Maryland, USA<br>
-      September 2001<br>
-      Supplementary Release on&nbsp; Backward Equations for Pressure as a
-      Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
-      Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
-      </p>
-      </html>
-      "));
-    end p2c_hs;
-
-    // Inverses from the 2003 additions to IF97
-    function h3ab_p "ergion 3 a b boundary for pressure/enthalpy"
-        extends Modelica.Icons.Function;
-      output Units.SI.SpecificEnthalpy h "Enthalpy";
-      input Units.SI.Pressure p "Pressure";
-    protected
-        constant Real[:] n = {0.201464004206875e4,0.374696550136983e1,-0.219921901054187e-1,0.875131686009950e-4};
-      constant Units.SI.SpecificEnthalpy hstar=1000 "normalization enthalpy";
-      constant Units.SI.Pressure pstar=1e6 "normalization pressure";
-        Real pi = p/pstar "normalized specific pressure";
-
-    algorithm
-        h := (n[1] + n[2]*pi + n[3]*pi^2 + n[4]*pi^3)*hstar;
-        annotation (
-    Documentation(info="<html>
-      <p>
-      &nbsp;Equation number 1 from:<br>
-      <div style=\"text-align: center;\">&nbsp;[1] The international Association
-      for the Properties of Water and Steam<br>
-      &nbsp;Vejle, Denmark<br>
-      &nbsp;August 2003<br>
-      &nbsp;Supplementary Release on Backward Equations for the Fucnctions
-      T(p,h), v(p,h) and T(p,s), <br>
-      &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
-      the Thermodynamic Properties of<br>
-      &nbsp;Water and Steam</div>
-      </p>
-      </html>"));
-    end h3ab_p;
-
-    function T3a_ph "Region 3 a: inverse function T(p,h)"
-        extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "Pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Units.SI.Temp_K T "Temperature";
-    protected
-        constant Real[:] n=
-          {-0.133645667811215e-6,0.455912656802978e-5,-0.146294640700979e-4, 0.639341312970080e-2,0.372783927268847e3,
-           -0.718654377460447e4,0.573494752103400e6,-0.267569329111439e7,-0.334066283302614e-4,-0.245479214069597e-1,
-           0.478087847764996e2,0.764664131818904e-5,0.128350627676972e-2,0.171219081377331e-1,-0.851007304583213e1,
-           -0.136513461629781e-1,-0.384460997596657e-5,0.337423807911655e-2,-0.551624873066791,0.729202277107470,
-           -0.992522757376041e-2,-0.119308831407288,0.793929190615421,0.454270731799386,0.209998591259910,
-           -0.642109823904738e-2,-0.235155868604540e-1,0.252233108341612e-2,-0.764885133368119e-2,0.136176427574291e-1,
-           -0.133027883575669e-1};
-        constant Real[:] I = {-12,-12,-12,-12,-12,-12,-12,-12,-10,-10,
-                              -10,-8,-8,-8,-8,-5,-3,-2,-2,-2,-1,-1,0,0,1,3,3,4,4,10,12};
-        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 Units.SI.SpecificEnthalpy hstar=2300e3 "normalization enthalpy";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.Temp_K Tstar=760 "normalization temperature";
-        Real pi = p/pstar "normalized specific pressure";
-        Real eta = h/hstar "normalized specific enthalpy";
-    algorithm
-        T := sum(n[i]*(pi + 0.240)^I[i]*(eta - 0.615)^J[i] for i in 1:31)*Tstar;
-        annotation (
-          Documentation(
-     info="<html>
- <p>
- &nbsp;Equation number 2 from:<br>
- <div style=\"text-align: center;\">&nbsp;[1] The international Association
- for the Properties of Water and Steam<br>
- &nbsp;Vejle, Denmark<br>
- &nbsp;August 2003<br>
- &nbsp;Supplementary Release on Backward Equations for the Fucnctions
- T(p,h), v(p,h) and T(p,s), <br>
- &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
- the Thermodynamic Properties of<br>
- &nbsp;Water and Steam</div>
- </p>
- </html>"));
-    end T3a_ph;
-
-    function T3b_ph "Region 3 b: inverse function T(p,h)"
-        extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "Pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Units.SI.Temp_K T "Temperature";
-    protected
-        constant Real[:] n=
-          {0.323254573644920e-4,-0.127575556587181e-3,-0.475851877356068e-3,0.156183014181602e-2,
-           0.105724860113781,-0.858514221132534e2,0.724140095480911e3,0.296475810273257e-2,-0.592721983365988e-2,
-           -0.126305422818666e-1,-0.115716196364853,0.849000969739595e2,-0.108602260086615e-1,0.154304475328851e-1,
-           0.750455441524466e-1,0.252520973612982e-1,-0.602507901232996e-1,-0.307622221350501e1,-0.574011959864879e-1,
-           0.503471360939849e1,-0.925081888584834,0.391733882917546e1,-0.773146007130190e2,0.949308762098587e4,
-           -0.141043719679409e7,0.849166230819026e7,0.861095729446704,0.323346442811720,0.873281936020439,
-           -0.436653048526683,0.286596714529479,-0.131778331276228,0.676682064330275e-2};
-        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 Units.SI.Temp_K Tstar=860 "normalization temperature";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEnthalpy hstar=2800e3 "normalization enthalpy";
-        Real pi = p/pstar "normalized specific pressure";
-        Real eta = h/hstar "normalized specific enthalpy";
-    algorithm
-        T := sum(n[i]*(pi + 0.298)^I[i]*(eta - 0.720)^J[i] for i in 1:33)*Tstar;
-        annotation (
-          Documentation(
-     info="<html>
- <p>
- &nbsp;Equation number 3 from:<br>
- <div style=\"text-align: center;\">&nbsp;[1] The international Association
- for the Properties of Water and Steam<br>
- &nbsp;Vejle, Denmark<br>
- &nbsp;August 2003<br>
- &nbsp;Supplementary Release on Backward Equations for the Fucnctions
- T(p,h), v(p,h) and T(p,s), <br>
- &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
- the Thermodynamic Properties of<br>
- &nbsp;Water and Steam</div>
- </p>
- </html>"));
-    end T3b_ph;
-
-    function v3a_ph "Region 3 a: inverse function v(p,h)"
-        extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "Pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Units.SI.SpecificVolume v "specific volume";
-    protected
-        constant Real[:] n=
-          { 0.529944062966028e-2,-0.170099690234461,0.111323814312927e2,-0.217898123145125e4,
-           -0.506061827980875e-3,0.556495239685324,-0.943672726094016e1,-0.297856807561527,0.939353943717186e2,
-           0.192944939465981e-1,0.421740664704763,-0.368914126282330e7,-0.737566847600639e-2,-0.354753242424366,
-           -0.199768169338727e1,0.115456297059049e1,0.568366875815960e4,0.808169540124668e-2,0.172416341519307,
-           0.104270175292927e1,-0.297691372792847,0.560394465163593,0.275234661176914,-0.148347894866012,
-           -0.651142513478515e-1,-0.292468715386302e1,0.664876096952665e-1,0.352335014263844e1,-0.146340792313332e-1,
-           -0.224503486668184e1,0.110533464706142e1,-0.408757344495612e-1};
-        constant Real[:] I = {-12,-12,-12,-12,-10,-10,-10,-8,-8,-6,
-                              -6,-6,-4,-4,-3,-2,-2,-1,-1,-1,-1,0,0,1,1,1,2,2,3,4,5,8};
-        constant Real[:] J = {6,8,12,18,4,7,10,5,12,3,4,22,2,3,7,3,16,0,1,2,3,0,1,0,1,2,0,2,0,2,2,2};
-      constant Units.SI.Volume vstar=0.0028 "normalization temperature";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEnthalpy hstar=2100e3 "normalization enthalpy";
-        Real pi = p/pstar "normalized specific pressure";
-        Real eta = h/hstar "normalized specific enthalpy";
-    algorithm
-        v := sum(n[i]*(pi + 0.128)^I[i]*(eta - 0.727)^J[i] for i in 1:32)*vstar;
-        annotation (
-          Documentation(
-     info="<html>
- <p>
- &nbsp;Equation number 4 from:<br>
- <div style=\"text-align: center;\">&nbsp;[1] The international Association
- for the Properties of Water and Steam<br>
- &nbsp;Vejle, Denmark<br>
- &nbsp;August 2003<br>
- &nbsp;Supplementary Release on Backward Equations for the Fucnctions
- T(p,h), v(p,h) and T(p,s), <br>
- &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
- the Thermodynamic Properties of<br>
- &nbsp;Water and Steam</div>
- </p>
- </html>"));
-    end v3a_ph;
-
-    function v3b_ph "Region 3 b: inverse function v(p,h)"
-        extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "Pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Units.SI.SpecificVolume v "specific volume";
-    protected
-        constant Real[:] n=
-          { -0.225196934336318e-8,0.140674363313486e-7,0.233784085280560e-5,-0.331833715229001e-4,
-           0.107956778514318e-2,-0.271382067378863,0.107202262490333e1,-0.853821329075382,-0.215214194340526e-4,
-           0.769656088222730e-3,-0.431136580433864e-2,0.453342167309331,-0.507749535873652,-0.100475154528389e3,
-           -0.219201924648793,-0.321087965668917e1,0.607567815637771e3,0.557686450685932e-3,0.187499040029550,
-           0.905368030448107e-2,0.285417173048685,0.329924030996098e-1,0.239897419685483,0.482754995951394e1,
-           -0.118035753702231e2,0.169490044091791,-0.179967222507787e-1,0.371810116332674e-1,-0.536288335065096e-1,
-           0.160697101092520e1};
-        constant Real[:] I = {-12,-12,-8,-8,-8,-8,-8,-8,-6,-6,
-                              -6,-6,-6,-6,-4,-4,-4,-3,-3,-2,-2,-1,-1,-1,-1,0,1,1,2,2};
-        constant Real[:] J = {0,1,0,1,3,6,7,8,0,1,2,5,6,10,3,6,10,0,2,1,2,0,1,4,5,0,0,1,2,6};
-      constant Units.SI.Volume vstar=0.0088 "normalization temperature";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEnthalpy hstar=2800e3 "normalization enthalpy";
-        Real pi = p/pstar "normalized specific pressure";
-        Real eta = h/hstar "normalized specific enthalpy";
-    algorithm
-        v := sum(n[i]*(pi + 0.0661)^I[i]*(eta - 0.720)^J[i] for i in 1:30)*vstar;
-        annotation (
-          Documentation(
-     info="<html>
- <p>
- &nbsp;Equation number 5 from:<br>
- <div style=\"text-align: center;\">&nbsp;[1] The international Association
- for the Properties of Water and Steam<br>
- &nbsp;Vejle, Denmark<br>
- &nbsp;August 2003<br>
- &nbsp;Supplementary Release on Backward Equations for the Fucnctions
- T(p,h), v(p,h) and T(p,s), <br>
- &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
- the Thermodynamic Properties of<br>
- &nbsp;Water and Steam</div>
- </p>
- </html>"));
-    end v3b_ph;
-
-    function T3a_ps "Region 3 a: inverse function T(p,s)"
-        extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "Pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Temp_K T "Temperature";
-    protected
-        constant Real[:] n=
-          {0.150042008263875e10,-0.159397258480424e12,0.502181140217975e-3,-0.672057767855466e2,
-           0.145058545404456e4,-0.823889534888890e4,-0.154852214233853,0.112305046746695e2,-0.297000213482822e2,
-           0.438565132635495e11,0.137837838635464e-2,-0.297478527157462e1,0.971777947349413e13,-0.571527767052398e-4,
-           0.288307949778420e5,-0.744428289262703e14,0.128017324848921e2,-0.368275545889071e3,0.664768904779177e16,
-           0.449359251958880e-1,-0.422897836099655e1,-0.240614376434179,-0.474341365254924e1,0.724093999126110,
-           0.923874349695897,0.399043655281015e1,0.384066651868009e-1,-0.359344365571848e-2,-0.735196448821653,
-           0.188367048396131,0.141064266818704e-3,-0.257418501496337e-2,0.123220024851555e-2};
-        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 Units.SI.Temp_K Tstar=760 "normalization temperature";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEntropy sstar=4.4e3 "normalization entropy";
-        Real pi = p/pstar "normalized specific pressure";
-        Real sigma = s/sstar "normalized specific entropy";
-    algorithm
-        T := sum(n[i]*(pi + 0.240)^I[i]*(sigma - 0.703)^J[i] for i in 1:33)*Tstar;
-        annotation (
-          Documentation(
-     info="<html>
- <p>
- &nbsp;Equation number 6 from:<br>
- <div style=\"text-align: center;\">&nbsp;[1] The international Association
- for the Properties of Water and Steam<br>
- &nbsp;Vejle, Denmark<br>
- &nbsp;August 2003<br>
- &nbsp;Supplementary Release on Backward Equations for the Fucnctions
- T(p,h), v(p,h) and T(p,s), <br>
- &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
- the Thermodynamic Properties of<br>
- &nbsp;Water and Steam</div>
- </p>
- </html>"));
-    end T3a_ps;
-
-    function T3b_ps "Region 3 b: inverse function T(p,s)"
-        extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "Pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.Temp_K T "Temperature";
-    protected
-        constant Real[:] n=
-          {0.527111701601660,-0.401317830052742e2,0.153020073134484e3,-0.224799398218827e4,
-           -0.193993484669048,-0.140467557893768e1,0.426799878114024e2,0.752810643416743,0.226657238616417e2,
-           -0.622873556909932e3,-0.660823667935396,0.841267087271658,-0.253717501764397e2,0.485708963532948e3,
-           0.880531517490555e3,0.265015592794626e7,-0.359287150025783,-0.656991567673753e3,0.241768149185367e1,
-           0.856873461222588,0.655143675313458,-0.213535213206406,0.562974957606348e-2,-0.316955725450471e15,
-           -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 Units.SI.Temp_K Tstar=860 "normalization temperature";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEntropy sstar=5.3e3 "normalization entropy";
-        Real pi = p/pstar "normalized specific pressure";
-        Real sigma = s/sstar "normalized specific entropy";
-    algorithm
-        T := sum(n[i]*(pi + 0.760)^I[i]*(sigma - 0.818)^J[i] for i in 1:28)*Tstar;
-        annotation (
-          Documentation(
-     info="<html>
- <p>
- &nbsp;Equation number 7 from:<br>
- <div style=\"text-align: center;\">&nbsp;[1] The international Association
- for the Properties of Water and Steam<br>
- &nbsp;Vejle, Denmark<br>
- &nbsp;August 2003<br>
- &nbsp;Supplementary Release on Backward Equations for the Fucnctions
- T(p,h), v(p,h) and T(p,s), <br>
- &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
- the Thermodynamic Properties of<br>
- &nbsp;Water and Steam</div>
- </p>
- </html>"));
-    end T3b_ps;
-
-    function v3a_ps "Region 3 a: inverse function v(p,s)"
-        extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "Pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.SpecificVolume v "specific volume";
-    protected
-        constant Real[:] n=
-          {0.795544074093975e2,-0.238261242984590e4,0.176813100617787e5,-0.110524727080379e-2,
-           -0.153213833655326e2,0.297544599376982e3,-0.350315206871242e8,0.277513761062119,-0.523964271036888,
-           -0.148011182995403e6,0.160014899374266e7,0.170802322663427e13,0.246866996006494e-3,0.165326084797980e1,
-           -0.118008384666987,0.253798642355900e1,0.965127704669424,-0.282172420532826e2,0.203224612353823,
-           0.110648186063513e1,0.526127948451280,0.277000018736321,0.108153340501132e1,-0.744127885357893e-1,
-           0.164094443541384e-1,-0.680468275301065e-1,0.257988576101640e-1,-0.145749861944416e-3};
-        constant Real[:] I = {-12,-12,-12,-10,-10,-10,-10,-8,-8,-8,-8,-6,-5,-4,-3,-3,-2,-2,-1,-1,0,0,0,1,2,4,5,6};
-        constant Real[:] J = {10,12,14,4,8,10,20,5,6,14,16,28,1,5,2,4,3,8,1,2,0,1,3,0,0,2,2,0};
-      constant Units.SI.Volume vstar=0.0028 "normalization temperature";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEntropy sstar=4.4e3 "normalization entropy";
-        Real pi = p/pstar "normalized specific pressure";
-        Real sigma = s/sstar "normalized specific entropy";
-    algorithm
-        v := sum(n[i]*(pi + 0.187)^I[i]*(sigma - 0.755)^J[i] for i in 1:28)*vstar;
-        annotation (
-          Documentation(
-     info="<html>
- <p>
- &nbsp;Equation number 8 from:<br>
- <div style=\"text-align: center;\">&nbsp;[1] The international Association
- for the Properties of Water and Steam<br>
- &nbsp;Vejle, Denmark<br>
- &nbsp;August 2003<br>
- &nbsp;Supplementary Release on Backward Equations for the Fucnctions
- T(p,h), v(p,h) and T(p,s), <br>
- &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
- the Thermodynamic Properties of<br>
- &nbsp;Water and Steam</div>
- </p>
- </html>"));
-    end v3a_ps;
-
-    function v3b_ps "Region 3 b: inverse function v(p,s)"
-        extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "Pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.SpecificVolume v "specific volume";
-    protected
-        constant Real[:] n=
-          {0.591599780322238e-4,-0.185465997137856e-2,0.104190510480013e-1,0.598647302038590e-2,
-           -0.771391189901699,0.172549765557036e1,-0.467076079846526e-3,0.134533823384439e-1,-0.808094336805495e-1,
-           0.508139374365767,0.128584643361683e-2,-0.163899353915435e1,0.586938199318063e1,-0.292466667918613e1,
-           -0.614076301499537e-2,0.576199014049172e1,-0.121613320606788e2,0.167637540957944e1,-0.744135838773463e1,
-           0.378168091437659e-1,0.401432203027688e1,0.160279837479185e2,0.317848779347728e1,-0.358362310304853e1,
-           -0.115995260446827e7,0.199256573577909,-0.122270624794624,-0.191449143716586e2,-0.150448002905284e-1,
-           0.146407900162154e2,-0.327477787188230e1};
-        constant Real[:] I = {-12,-12,-12,-12,-12,-12,-10,-10,
-                              -10,-10,-8,-5,-5,-5,-4,-4,-4,-4,-3,-2,-2,-2,-2,-2,-2,0,0,0,1,1,2};
-        constant Real[:] J = {0,1,2,3,5,6,0,1,2,4,0,1,2,3,0,1,2,3,1,0,1,2,3,4,12,0,1,2,0,2,2};
-      constant Units.SI.Volume vstar=0.0088 "normalization temperature";
-      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
-      constant Units.SI.SpecificEntropy sstar=5.3e3 "normalization entropy";
-        Real pi = p/pstar "normalized specific pressure";
-        Real sigma = s/sstar "normalized specific entropy";
-    algorithm
-        v := sum(n[i]*(pi + 0.298)^I[i]*(sigma - 0.816)^J[i] for i in 1:31)*vstar;
-        annotation (
-          Documentation(
-     info="<html>
- <p>
- &nbsp;Equation number 9 from:<br>
- <div style=\"text-align: center;\">&nbsp;[1] The international Association
- for the Properties of Water and Steam<br>
- &nbsp;Vejle, Denmark<br>
- &nbsp;August 2003<br>
- &nbsp;Supplementary Release on Backward Equations for the Fucnctions
- T(p,h), v(p,h) and T(p,s), <br>
- &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
- the Thermodynamic Properties of<br>
- &nbsp;Water and Steam</div>
- </p>
- </html>"));
-    end v3b_ps;
-
-    function g1L3
-      "base function for region 1 with 3rd derivatives for sensitivities: g(p,T)"
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                      g
-        "dimensionless Gibbs function and derivatives up to 3rd derivatives";
-    protected
-      Real pi1;
-      Real tau1;
-      Real[55] o;
-    algorithm
-      assert(p > ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple,
-        "IF97 medium function g1 called with too low pressure\n" + "p = " +
-        String(p) + " Pa <= " + String(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
-         + " Pa (triple point pressure)");
-      assert(p <= 100.0e6,
-        "IF97 medium function g1: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
-      assert(T >= 273.15,
-        "IF97 medium function g1: the temperature (= " + String(T) + " K)  is lower than 273.15 K!");
-      g.p := p;
-      g.T := T;
-      g.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      g.pi := p/ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PSTAR1;
-      g.tau := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TSTAR1/T;
-      pi1 := 7.1 - g.pi;
-      tau1 := -1.222 + g.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] := 5.85475673349302e-8*o[11];
-      o[38] := o[1]*o[3];
-      o[39] := 1/o[38];
-      o[40] := 1/o[6];
-      o[41] := o[1]*o[22]*o[3];
-      o[42] := 1/o[41];
-      o[43] := 1/o[22];
-      o[44] := o[1]*o[2]*o[21]*o[3];
-      o[45] := 1/o[44];
-      o[46] := 1/o[13];
-      o[47] := -0.00031703014781958*o[2];
-      o[48] := o[1]*o[2]*tau1;
-      o[49] := 1/o[48];
-      o[50] := o[1]*o[22]*o[3]*tau1;
-      o[51] := 1/o[50];
-      o[52] := o[22]*tau1;
-      o[53] := 1/o[52];
-      o[54] := o[2]*o[3]*tau1;
-      o[55] := 1/o[54];
-
-      g.g := pi1*
-          (pi1*(pi1*(o[10]*(-0.000031679644845054 +
-       o[2]*(-2.8270797985312e-6-8.5205128120103e-10*o[6])) +
-       pi1*(o[12]*(-2.2425281908e-6 + (-6.5171222895601e-7 -
-       1.4341729937924e-13*o[13])*o[7]) + pi1*(-4.0516996860117e-7*o[14] +
-       o[16]*((-1.2734301741641e-9-1.7424871230634e-10*o[11])*o[36] +
-       o[19]*(-6.8762131295531e-19*o[34] + o[15]*(1.4478307828521e-20*o[32]
-       + o[20]*(2.6335781662795e-23*o[30] + pi1*(-1.1947622640071e-23*o[28]+
-       pi1*(1.8228094581404e-24*o[26]- 9.3537087292458e-26*o[24]*pi1)))))))))
-       + o[8]*(-0.00047184321073267 + o[7]*(-0.00030001780793026 +
-       (0.000047661393906987 +
-       o[1]*(-4.4141845330846e-6-7.2694996297594e-16*o[9]))*tau1))) +
-       o[5]*(0.00028319080123804 + o[1]*(-0.00060706301565874 +
-       o[6]*(-0.018990068218419 + tau1*(-0.032529748770505 +
-       (-0.021841717175414-0.00005283835796993*o[1])*tau1))))) +
-       (0.14632971213167 + tau1*(-0.84548187169114 + tau1*(-3.756360367204
-       + tau1*(3.3855169168385 + tau1*(-0.95791963387872 +
-       tau1*(0.15772038513228 + (-0.016616417199501 +
-       0.00081214629983568*tau1)*tau1))))))/o[1];
-
-       g.gpi :=  pi1*(pi1*(o[10]*(0.000095038934535162 + o[2]*(8.4812393955936e-6 +
-       2.55615384360309e-9*o[6])) + pi1*(o[12]*(8.9701127632e-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.33001080055983e-19*o[32] +
-       o[20]*(-7.63737668221055e-22*o[30] + pi1*(3.5842867920213e-22*o[28]
-       + pi1*(-5.65070932023524e-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.00028319080123804 + o[1]*(0.00060706301565874 +
-       o[6]*(0.018990068218419 + tau1*(0.032529748770505 +
-       (0.021841717175414 + 0.00005283835796993*o[1])*tau1))));
-
-       g.gpipi :=  pi1*(o[10]*(-0.000190077869070324 +
-       o[2]*(-0.0000169624787911872-5.11230768720618e-9*o[6])) +
-       pi1*(o[12]*(-0.0000269103382896 +
-       (-7.82054674747212e-6-1.72100759255088e-12*o[13])*o[7]) +
-       pi1*(-8.1033993720234e-6*o[14] +
-       o[16]*((-7.13120897531896e-8-9.75792788915504e-9*o[11])*o[36] +
-       o[19]*(-2.8880095144123e-16*o[34] +
-       o[15]*(7.32602376123163e-18*o[32] +
-       o[20]*(2.13846547101895e-20*o[30] + pi1*(-1.03944316968618e-20*o[28]+
-       pi1*(1.69521279607057e-21*o[26]-9.27887905941183e-23*o[24]*pi1)))))))))
-       + o[8]*(-0.00094368642146534 + o[7]*(-0.00060003561586052 +
-       (0.000095322787813974 +
-       o[1]*(-8.8283690661692e-6-1.45389992595188e-15*o[9]))*tau1));
-
-       g.gpipipi := o[10]*(0.000190077869070324 + o[2]*(0.0000169624787911872 +
-       5.11230768720618e-9*o[6])) + pi1*(o[12]*(0.0000538206765792 +
-       (0.0000156410934949442 + 3.44201518510176e-12*o[13])*o[7]) +
-       pi1*(0.0000243101981160702*o[14] + o[16]*(o[36]*(4.27872538519138e-7
-       + o[37]) + o[19]*(5.48721807738337e-15*o[34] +
-       o[15]*(-1.53846498985864e-16*o[32] +
-       o[20]*(-5.77385677175118e-19*o[30] + pi1*(2.9104408751213e-19*o[28]
-       + pi1*(-4.91611710860466e-20*o[26] +
-       2.78366371782355e-21*o[24]*pi1))))))));
-
-       g.gtau :=
-       pi1*(o[39]*(-0.00254871721114236 + o[1]*(0.00424944110961118 +
-       (0.018990068218419 +
-       (-0.021841717175414-0.00015851507390979*o[1])*o[1])*o[6])) +
-       pi1*(o[10]*(0.00141552963219801 + o[2]*(0.000047661393906987 +
-       o[1]*(-0.0000132425535992538-1.2358149370591e-14*o[9]))) +
-       pi1*(o[12]*(0.000126718579380216-5.11230768720618e-9*o[38]) +
-       pi1*(o[40]*(0.000011212640954 +
-       (1.30342445791202e-6-1.4341729937924e-12*o[13])*o[7]) +
-       pi1*(3.24135974880936e-6*o[5] + o[16]*((1.40077319158051e-8 +
-       1.04549227383804e-9*o[11])*o[46] + o[19]*(1.9941018075704e-17*o[45]
-       + o[15]*(-4.48827542684151e-19*o[43] +
-       o[20]*(-1.00075970318621e-21*o[28] + pi1*(4.65957282962769e-22*o[26]
-       + pi1*(-7.2912378325616e-23*o[24] +
-       3.83502057899078e-24*o[42]*pi1))))))))))) + o[8]*(-0.29265942426334
-       + tau1*(0.84548187169114 + o[1]*(3.3855169168385 +
-       tau1*(-1.91583926775744 + tau1*(0.47316115539684 +
-       (-0.066465668798004 + 0.0040607314991784*tau1)*tau1)))));
-
-       g.gtautau :=
-       pi1*(o[36]*(0.0254871721114236 + o[1]*(-0.0339955288768894 +
-       (-0.037980136436838 + o[47])*o[6])) +
-       pi1*(o[12]*(-0.00566211852879204 +
-       o[6]*(-0.0000264851071985076-1.97730389929456e-13*o[9])) +
-       pi1*((-0.00063359289690108-2.55615384360309e-8*o[38])*o[40] +
-       pi1*(o[49]*(-0.000067275845724 +
-       (-3.91027337373606e-6-1.29075569441316e-11*o[13])*o[7]) +
-       pi1*(-0.0000291722377392842*o[39] +
-       o[16]*((-1.68092782989661e-7-7.31844591686628e-9*o[11])*o[55] +
-       o[19]*(-5.9823054227112e-16*o[32] +
-       o[15]*(1.43624813658928e-17*o[53] +
-       o[20]*(3.90296284242622e-20*o[26] + pi1*(-1.86382913185108e-20*o[24]
-       +
-       pi1*(2.98940751135026e-21*o[42]-1.61070864317613e-22*o[51]*pi1)))))))))))
-       + o[10]*(0.87797827279002 + tau1*(-1.69096374338228 +
-       o[7]*(-1.91583926775744 + tau1*(0.94632231079368 +
-       (-0.199397006394012 + 0.0162429259967136*tau1)*tau1))));
-
-       g.gtautautau :=
-       pi1*(o[46]*(-0.28035889322566 + o[1]*(0.305959759892005 +
-       (0.113940409310514 + o[47])*o[6])) + pi1*(o[40]*(0.0283105926439602
-       + o[6]*(-0.0000264851071985076-2.96595584894183e-12*o[9])) +
-       pi1*((0.00380155738140648-1.02246153744124e-7*o[38])*o[49] +
-       pi1*(o[14]*(0.000470930920068 +
-       (0.0000156410934949442-1.03260455553053e-10*o[13])*o[7]) +
-       pi1*(0.000291722377392842*o[36] + o[16]*((2.1852061788656e-6 +
-       o[37])/o[9] + o[19]*(1.85451468104047e-14*o[43] +
-       o[15]*(-4.73961885074464e-16/(o[1]*o[22]) +
-       o[20]*(-1.56118513697049e-18*o[24] + pi1*(7.64169944058941e-19*o[42]
-       + pi1*(-1.25555115476711e-19*o[51] +
-       (6.92604716565734e-21*pi1)/(o[2]*o[22]*o[3])))))))))))) +
-       o[12]*(-3.51191309116008 + tau1*(5.07289123014684 +
-       o[2]*(0.94632231079368 + (-0.398794012788024 +
-       0.0487287779901408*tau1)*tau1)));
-
-       g.gpitau := o[39]*(0.00254871721114236
-       + o[1]*(-0.00424944110961118 + (-0.018990068218419 +
-       (0.021841717175414 + 0.00015851507390979*o[1])*o[1])*o[6])) +
-       pi1*(o[10]*(-0.00283105926439602 + o[2]*(-0.000095322787813974 +
-       o[1]*(0.0000264851071985076 + 2.4716298741182e-14*o[9]))) +
-       pi1*(o[12]*(-0.000380155738140648 + 1.53369230616185e-8*o[38]) +
-       pi1*(o[40]*(-0.000044850563816 + (-5.21369783164808e-6 +
-       5.7366919751696e-12*o[13])*o[7]) + pi1*(-0.0000162067987440468*o[5]
-       + o[16]*((-1.12061855326441e-7-8.36393819070432e-9*o[11])*o[46] +
-       o[19]*(-4.18761379589784e-16*o[45] +
-       o[15]*(1.03230334817355e-17*o[43] +
-       o[20]*(2.90220313924001e-20*o[28] + pi1*(-1.39787184888831e-20*o[26]
-       +
-       pi1*(2.2602837280941e-21*o[24]-1.22720658527705e-22*o[42]*pi1))))))))));
-
-       g.gpipitau := o[10]*(0.00283105926439602 + o[2]*(0.000095322787813974 +
-       o[1]*(-0.0000264851071985076-2.4716298741182e-14*o[9]))) +
-       pi1*(o[12]*(0.000760311476281296-3.06738461232371e-8*o[38]) +
-       pi1*(o[40]*(0.000134551691448 +
-       (0.0000156410934949442-1.72100759255088e-11*o[13])*o[7]) +
-       pi1*(0.0000648271949761872*o[5] + o[16]*((7.84432987285086e-7 +
-       o[37])*o[46] + o[19]*(8.37522759179568e-15*o[45] +
-       o[15]*(-2.2710673659818e-16*o[43] +
-       o[20]*(-8.12616878987203e-19*o[28] + pi1*(4.05382836177609e-19*o[26]
-       + pi1*(-6.78085118428229e-20*o[24] +
-       3.80434041435885e-21*o[42]*pi1)))))))));
-
-       g.gpitautau :=  o[36]*(-0.0254871721114236 + o[1]*(0.0339955288768894 +
-       (0.037980136436838 + 0.00031703014781958*o[2])*o[6])) +
-       pi1*(o[12]*(0.0113242370575841 + o[6]*(0.0000529702143970152 +
-       3.95460779858911e-13*o[9])) + pi1*((0.00190077869070324 +
-        7.66846153080927e-8*o[38])*o[40] + pi1*(o[49]*(0.000269103382896 +
-        (0.0000156410934949442 + 5.16302277765264e-11*o[13])*o[7]) +
-        pi1*(0.000145861188696421*o[39] + o[16]*((1.34474226391729e-6 +
-        o[37])*o[55] + o[19]*(1.25628413876935e-14*o[32] +
-        o[15]*(-3.30337071415535e-16*o[53] +
-        o[20]*(-1.1318592243036e-18*o[26] + pi1*(5.59148739555323e-19*o[24]
-        + pi1*(-9.26716328518579e-20*o[42] +5.1542676581636e-21*o[51]*pi1))))))))));
-    end g1L3;
-
-    function g2L3
-      "base function for region 2 with 3rd derivatives for sensitivities: g(p,T)"
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                      g
-        "dimensionless Gibbs function and derivatives up to 3rd derivatives";
-    protected
-      Real pi2;
-      Real tau2;
-      Real[82] o;
-    algorithm
-      assert(p > ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple,
-        "IF97 medium function g2 called with too low pressure\n" + "p = " +
-        String(p) + " Pa <= " + String(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
-         + " Pa (triple point pressure)");
-      assert(p <= 100.0e6,
-        "IF97 medium function g2: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
-      assert(T >= 273.15,
-        "IF97 medium function g2: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
-      assert(T <= 1073.15,
-        "IF97 medium function g2: the input temperature (= " + String(T) + " K) is higher than the limit of 1073.15 K");
-      g.p := p;
-      g.T := T;
-      g.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      g.pi := p/ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PSTAR2;
-      g.tau := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TSTAR2/T;
-      tau2 := -0.5 + g.tau;
-      o[1] := tau2*tau2;
-      o[2] := o[1]*tau2;
-      o[3] := -0.05032527872793*o[2];
-      o[4] := -0.057581259083432 + o[3];
-      o[5] := o[4]*tau2;
-      o[6] := -0.045996013696365 + o[5];
-      o[7] := o[6]*tau2;
-      o[8] := -0.017834862292358 + o[7];
-      o[9] := o[8]*tau2;
-      o[10] := o[1]*o[1];
-      o[11] := o[10]*o[10];
-      o[12] := o[11]*o[11];
-      o[13] := o[10]*o[11]*o[12]*tau2;
-      o[14] := o[1]*o[10]*tau2;
-      o[15] := o[10]*o[11]*tau2;
-      o[16] := o[1]*o[12]*tau2;
-      o[17] := o[1]*o[11]*tau2;
-      o[18] := o[1]*o[10]*o[11];
-      o[19] := o[10]*o[11]*o[12];
-      o[20] := o[1]*o[10];
-      o[21] := g.pi*g.pi;
-      o[22] := o[21]*o[21];
-      o[23] := o[21]*o[22];
-      o[24] := o[10]*o[12]*tau2;
-      o[25] := o[12]*o[12];
-       o[26] := o[11]*o[12]*o[25]*tau2;
-       o[27] := o[10]*o[12];
-       o[28] := o[1]*o[10]*o[11]*tau2;
-       o[29] := o[10]*o[12]*o[25]*tau2;
-       o[30] := o[1]*o[10]*o[25]*tau2;
-       o[31] := o[1]*o[11]*o[12];
-       o[32] := o[1]*o[12];
-       o[33] := g.tau*g.tau;
-       o[34] := o[33]*o[33];
-       o[35] := -0.000053349095828174*o[13];
-       o[36] := -0.087594591301146 + o[35];
-       o[37] := o[2]*o[36];
-       o[38] := -0.007878555448671 + o[37];
-       o[39] := o[1]*o[38];
-       o[40] := -0.0003789797503263 + o[39];
-       o[41] := o[40]*tau2;
-       o[42] := -0.000066065283340406 + o[41];
-       o[43] := o[42]*tau2;
-       o[44] := -0.244009521375894*o[13];
-       o[45] := -0.0090203547252888 + o[44];
-       o[46] := o[2]*o[45];
-       o[47] := -0.00019366606343142 + o[46];
-       o[48] := o[1]*o[47];
-       o[49] := 2.6322400370661e-6 + o[48];
-       o[50] := o[49]*tau2;
-       o[51] := 5.78704472622084e-6*tau2;
-       o[52] := o[21]*g.pi;
-       o[53] := 0.0000115740894524417*tau2;
-       o[54] := -0.30195167236758*o[2];
-       o[55] := -0.172743777250296 + o[54];
-       o[56] := o[55]*tau2;
-       o[57] := -0.09199202739273 + o[56];
-       o[58] := o[57]*tau2;
-       o[59] := o[1]*o[11];
-       o[60] := o[10]*o[11];
-       o[61] := o[11]*o[12]*o[25];
-       o[62] := o[10]*o[12]*o[25];
-       o[63] := o[1]*o[10]*o[25];
-       o[64] := o[11]*o[12]*tau2;
-       o[65] := -1.5097583618379*o[2];
-       o[66] := -0.345487554500592 + o[65];
-       o[67] := o[66]*tau2;
-       o[68] := o[10]*tau2;
-       o[69] := o[11]*tau2;
-       o[70] := o[1]*o[11]*o[12]*tau2;
-       o[71] := o[1]*o[10]*o[12]*o[25]*tau2;
-       o[72] := o[1]*o[12]*o[25]*tau2;
-       o[73] := o[10]*o[25]*tau2;
-       o[74] := o[11]*o[12];
-       o[75] := o[34]*o[34];
-       o[76] := -0.00192056744981426*o[13];
-       o[77] := -0.613162139108022 + o[76];
-       o[78] := o[2]*o[77];
-       o[79] := -0.031514221794684 + o[78];
-       o[80] := o[1]*o[79];
-       o[81] := -0.0007579595006526 + o[80];
-       o[82] := o[81]*tau2;
-
-      g.g := g.pi*(-0.0017731742473213 + o[9] + g.pi*(tau2*(-0.000033032641670203
-         + (-0.00018948987516315 + o[1]*(-0.0039392777243355 + (-0.043797295650573
-         - 0.000026674547914087*o[13])*o[2]))*tau2) + g.pi*(2.0481737692309e-8
-         + (4.3870667284435e-7 + o[1]*(-0.00003227767723857 + (-0.0015033924542148
-         - 0.040668253562649*o[13])*o[2]))*tau2 + g.pi*(g.pi*(
-        2.2922076337661e-6*o[14] + g.pi*((-1.6714766451061e-11 + o[15]*(-0.0021171472321355
-         - 23.895741934104*o[16]))*o[2] + g.pi*(-5.905956432427e-18 + o[17]*(-1.2621808899101e-6
-         - 0.038946842435739*o[18]) + g.pi*(o[11]*(1.1256211360459e-11 -
-        8.2311340897998*o[19]) + g.pi*(1.9809712802088e-8*o[15] + g.pi*(o[10]*(
-        1.0406965210174e-19 + (-1.0234747095929e-13 - 1.0018179379511e-9*o[10])
-        *o[20]) + o[23]*(o[13]*(-8.0882908646985e-11 + 0.10693031879409*o[24])
-         + o[21]*(-0.33662250574171*o[26] + o[21]*(o[27]*(8.9185845355421e-25
-         + (3.0629316876232e-13 - 4.2002467698208e-6*o[15])*o[28]) + g.pi*(-5.9056029685639e-26
-        *o[24] + g.pi*(3.7826947613457e-6*o[29] + g.pi*(-1.2768608934681e-15*o[
-        30] + o[31]*(7.3087610595061e-29 + o[18]*(5.5414715350778e-17 -
-        9.436970724121e-7*o[32]))*g.pi)))))))))))) + tau2*(-7.8847309559367e-10
-         + (1.2790717852285e-8 + 4.8225372718507e-7*tau2)*tau2))))) + (-0.00560879118302
-         + g.tau*(0.07145273881455 + g.tau*(-0.4071049823928 + g.tau*(
-        1.424081971444 + g.tau*(-4.38395111945 + g.tau*(-9.692768600217 + g.tau
-        *(10.08665568018 + (-0.2840863260772 + 0.02126846353307*g.tau)*g.tau)
-         + Modelica.Math.log(g.pi)))))))/(o[34]*g.tau);
-
-      g.gpi :=
-        (1.0 + g.pi*(-0.0017731742473213 + o[9] + g.pi*(o[43] +
-           g.pi*(6.1445213076927e-8 + (1.31612001853305e-6 +
-           o[1]*(-0.00009683303171571 +
-           (-0.0045101773626444-0.122004760687947*o[13])*o[2]))*tau2 +
-           g.pi*(g.pi*(0.0000114610381688305*o[14] + g.pi*((-1.00288598706366e-10 +
-           o[15]*(-0.012702883392813-143.374451604624*o[16]))*o[2] +
-           g.pi*(-4.1341695026989e-17 +
-           o[17]*(-8.8352662293707e-6-0.272627897050173*o[18]) +
-           g.pi*(o[11]*(9.0049690883672e-11-65.8490727183984*o[19]) +
-           g.pi*(1.78287415218792e-7*o[15] + g.pi*(o[10]*(1.0406965210174e-18 +
-           (-1.0234747095929e-12-1.0018179379511e-8*o[10])*o[20]) +
-           o[23]*(o[13]*(-1.29412653835176e-9 + 1.71088510070544*o[24]) +
-           o[21]*(-6.05920510335078*o[26] + o[21]*(o[27]*(1.78371690710842e-23 +
-           (6.1258633752464e-12-0.000084004935396416*o[15])*o[28]) +
-           g.pi*(-1.24017662339842e-24*o[24] + g.pi*(0.0000832192847496054*o[29] +
-           g.pi*(-2.93678005497663e-14*o[30] + o[31]*(1.75410265428146e-27 +
-           o[18]*(1.32995316841867e-15-0.0000226487297378904*o[32]))*g.pi))))))))))))
-           + tau2*(-3.15389238237468e-9 + (5.116287140914e-8 +
-           1.92901490874028e-6*tau2)*tau2))))))/g.pi;
-
-      g.gpipi :=
-          (-1.0 + o[21]*(o[43] + g.pi*(1.22890426153854e-7 + o[50] +
-           g.pi*(g.pi*(0.000045844152675322*o[14] + g.pi*((-5.0144299353183e-10 +
-           o[15]*(-0.063514416964065-716.87225802312*o[16]))*o[2] +
-           g.pi*(-2.48050170161934e-16 +
-           o[17]*(-0.0000530115973762242-1.63576738230104*o[18]) +
-           g.pi*(o[11]*(6.30347836185704e-10-460.943509028789*o[19]) +
-           g.pi*(1.42629932175034e-6*o[15] + g.pi*(o[10]*(9.3662686891566e-18 +
-           (-9.2112723863361e-12-9.0163614415599e-8*o[10])*o[20]) +
-           o[23]*(o[13]*(-1.94118980752764e-8 + 25.6632765105816*o[24]) +
-           o[21]*(-103.006486756963*o[26] + o[21]*(o[27]*(3.389062123506e-22 +
-           (1.16391404129682e-10-0.0015960937725319*o[15])*o[28]) +
-           g.pi*(-2.48035324679684e-23*o[24] + g.pi*(0.00174760497974171*o[29] +
-           g.pi*(-6.46091612094859e-13*o[30] + o[31]*(4.03443610484737e-26 +
-           o[18]*(3.05889228736295e-14-0.000520920783971479*o[32]))*g.pi))))))))))))
-           + tau2*(-9.46167714712404e-9 + (1.5348861422742e-7 +
-           o[51])*tau2)))))/o[21];
-
-      g.gpipipi :=
-            (2.0 + o[52]*(1.22890426153854e-7 + o[50] +
-           g.pi*(g.pi*(0.000137532458025966*o[14] + g.pi*((-2.00577197412732e-9 +
-           o[15]*(-0.25405766785626-2867.48903209248*o[16]))*o[2] +
-           g.pi*(-1.24025085080967e-15 +
-           o[17]*(-0.000265057986881121-8.17883691150519*o[18]) +
-           g.pi*(o[11]*(3.78208701711422e-9-2765.66105417273*o[19]) +
-           g.pi*(9.98409525225235e-6*o[15] + g.pi*(o[10]*(7.49301495132528e-17 +
-           (-7.36901790906888e-11-7.21308915324792e-7*o[10])*o[20]) +
-           o[23]*(o[13]*(-2.7176657305387e-7 + 359.285871148142*o[24]) +
-           o[21]*(-1648.10378811141*o[26] + o[21]*(o[27]*(6.1003118223108e-21 +
-           (2.09504527433427e-9-0.0287296879055743*o[15])*o[28]) +
-           g.pi*(-4.71267116891399e-22*o[24] + g.pi*(0.0349520995948343*o[29] +
-           g.pi*(-1.3567923853992e-11*o[30] + o[31]*(8.87575943066421e-25 +
-           o[18]*(6.72956303219848e-13-0.0114602572473725*o[32]))*g.pi))))))))))))
-           + tau2*(-1.89233542942481e-8 + (3.0697722845484e-7 +
-           o[53])*tau2))))/o[52];
-
-      g.gtau :=
-         (0.0280439559151 + g.tau*(-0.2858109552582 +
-           g.tau*(1.2213149471784 + g.tau*(-2.848163942888 + g.tau*(4.38395111945 +
-           o[33]*(10.08665568018 + (-0.5681726521544 +
-           0.06380539059921*g.tau)*g.tau))))))/(o[33]*o[34]) + g.pi*(-0.017834862292358
-           + o[58] + g.pi*(-0.000033032641670203 + (-0.0003789797503263 +
-           o[1]*(-0.015757110897342 +
-           (-0.306581069554011-0.000960283724907132*o[13])*o[2]))*tau2 +
-           g.pi*(4.3870667284435e-7 + o[1]*(-0.00009683303171571 +
-           (-0.0090203547252888-1.42338887469272*o[13])*o[2]) +
-           g.pi*(-7.8847309559367e-10 + g.pi*(0.0000160454534363627*o[20] +
-           g.pi*(o[1]*(-5.0144299353183e-11 +
-           o[15]*(-0.033874355714168-836.35096769364*o[16])) +
-           g.pi*((-0.0000138839897890111-0.973671060893475*o[18])*o[59] +
-           g.pi*(o[14]*(9.0049690883672e-11-296.320827232793*o[19]) +
-           g.pi*(2.57526266427144e-7*o[60] + g.pi*(o[2]*(4.1627860840696e-19 +
-           (-1.0234747095929e-12-1.40254511313154e-8*o[10])*o[20]) +
-           o[23]*(o[19]*(-2.34560435076256e-9 + 5.3465159397045*o[24]) +
-           o[21]*(-19.1874828272775*o[61] + o[21]*(o[16]*(1.78371690710842e-23 +
-           (1.07202609066812e-11-0.000201611844951398*o[15])*o[28]) +
-           g.pi*(-1.24017662339842e-24*o[27] + g.pi*(0.000200482822351322*o[62] +
-           g.pi*(-4.97975748452559e-14*o[63] + (1.90027787547159e-27 +
-           o[18]*(2.21658861403112e-15-0.0000547344301999018*o[32]))*o[64]*g.pi))))))))))))
-           + (2.558143570457e-8 + 1.44676118155521e-6*tau2)*tau2))));
-
-      g.gtautau :=
-            (-0.1682637354906 + g.tau*(1.429054776291 +
-           g.tau*(-4.8852597887136 + g.tau*(8.544491828664 + g.tau*(-8.7679022389 +
-           o[33]*(-0.5681726521544 +
-           0.12761078119842*g.tau)*g.tau)))))/(o[33]*o[34]*g.tau) +
-           g.pi*(-0.09199202739273 + o[67] + g.pi*(-0.0003789797503263 +
-           o[1]*(-0.047271332692026 +
-           (-1.83948641732407-0.0336099303717496*o[13])*o[2]) +
-           g.pi*((-0.00019366606343142 +
-           (-0.045101773626444-48.3952217395523*o[13])*o[2])*tau2 +
-           g.pi*(2.558143570457e-8 + 2.89352236311042e-6*tau2 +
-           g.pi*(0.0000962727206181762*o[68] +
-           g.pi*(g.pi*((-0.000138839897890111-23.3681054614434*o[18])*o[69] +
-           g.pi*((6.30347836185704e-10-10371.2289531477*o[19])*o[20] +
-           g.pi*(3.09031519712573e-6*o[17] + g.pi*(o[1]*(1.24883582522088e-18 +
-           (-9.2112723863361e-12-1.823308647071e-7*o[10])*o[20]) +
-           o[23]*((-6.56769218213518e-8 + 261.979281045521*o[24])*o[70] +
-           o[21]*(-1074.49903832754*o[71] + o[21]*((3.389062123506e-22 +
-           (3.64488870827161e-10-0.00947575671271573*o[15])*o[28])*o[32] +
-    g.pi*(-2.48035324679684e-23*o[16] + g.pi*(0.0104251067622687*o[72] +
-    g.pi*(-1.89230784411972e-12*o[73] + (4.75069468867897e-26 +
-    o[18]*(8.64469559472137e-14-0.0031198625213944*o[32]))*o[74]*g.pi))))))))))
-    + (-1.00288598706366e-10 +
-    o[15]*(-0.50811533571252-28435.9329015838*o[16]))*tau2))))));
-
-      g.gtautautau :=
-               (1.1778461484342 + g.tau*(-8.574328657746 + g.tau*(24.426298943568
-           + g.tau*(-34.177967314656 + (26.3037067167 +
-           0.12761078119842*o[34])*g.tau))))/o[75] +
-           g.pi*(-0.345487554500592-6.0390334473516*o[2] + g.pi*((-0.094542665384052
-           + (-9.19743208662033-1.14273763263949*o[13])*o[2])*tau2 +
-           g.pi*(-0.00019366606343142 +
-           (-0.180407094505776-1597.04231740523*o[13])*o[2] +
-           g.pi*(2.89352236311042e-6 + g.pi*(0.000481363603090881*o[10] +
-           g.pi*(-1.00288598706366e-10 +
-           o[15]*(-7.11361469997528-938385.785752264*o[16]) +
-           g.pi*(o[11]*(-0.001249559081011-537.466425613198*o[18]) +
-           g.pi*((3.78208701711422e-9-352621.784407023*o[19])*o[68] +
-           g.pi*(0.000033993467168383*o[59] + g.pi*((2.49767165044176e-18 +
-           (-7.36901790906888e-11-2.1879703764852e-6*o[10])*o[20])*tau2 +
-           o[23]*((-1.7732768891765e-6 + 12575.005490185*o[24])*o[31] +
-           o[21]*(-59097.4471080146*o[1]*o[10]*o[12]*o[25] +
-           o[21]*(o[12]*(6.1003118223108e-21 +
-           (1.20281327372963e-8-0.435884808784923*o[15])*o[28])*tau2 +
-    g.pi*(-4.71267116891399e-22*o[32] +
-    g.pi*(0.531680444875706*o[1]*o[12]*o[25] +
-    g.pi*(-7.00153902324298e-11*o[10]*o[25] +
-    o[1]*o[10]*o[12]*(1.14016672528295e-24 +
-    o[18]*(3.28498432599412e-12-0.174712301198087*o[32]))*g.pi*tau2))))))))))))))));
-
-      g.gpitau := -0.017834862292358 + o[58] + g.pi*
-                                             (-0.000066065283340406 + o[82]
-           + g.pi*(1.31612001853305e-6 + o[1]*(-0.00029049909514713 +
-           (-0.0270610641758664-4.27016662407815*o[13])*o[2]) +
-           g.pi*(-3.15389238237468e-9 + g.pi*(0.0000802272671818135*o[20] +
-           g.pi*(o[1]*(-3.00865796119098e-10 +
-           o[15]*(-0.203246134285008-5018.10580616184*o[16])) +
-           g.pi*((-0.0000971879285230777-6.81569742625432*o[18])*o[59] +
-           g.pi*(o[14]*(7.20397527069376e-10-2370.56661786234*o[19]) +
-           g.pi*(2.3177363978443e-6*o[60] + g.pi*(o[2]*(4.1627860840696e-18 +
-           (-1.0234747095929e-11-1.40254511313154e-7*o[10])*o[20]) +
-           o[23]*(o[19]*(-3.7529669612201e-8 + 85.544255035272*o[24]) +
-           o[21]*(-345.374690890994*o[61] + o[21]*(o[16]*(3.56743381421684e-22 +
-           (2.14405218133624e-10-0.00403223689902797*o[15])*o[28]) +
-           g.pi*(-2.60437090913668e-23*o[27] + g.pi*(0.00441062209172909*o[62] +
-           g.pi*(-1.14534422144089e-12*o[63] + (4.56066690113181e-26 +
-           o[18]*(5.31981267367469e-14-0.00131362632479764*o[32]))*o[64]*g.pi))))))))))))
-           + (1.0232574281828e-7 + o[51])*tau2)));
-
-      g.gpipitau := -0.000066065283340406 + o[82] + g.pi*
-                                                  (2.6322400370661e-6 +
-           o[1]*(-0.00058099819029426 +
-           (-0.0541221283517328-8.54033324815629*o[13])*o[2]) +
-           g.pi*(-9.46167714712404e-9 + g.pi*(0.000320909068727254*o[20] +
-           g.pi*(o[1]*(-1.50432898059549e-9 +
-           o[15]*(-1.01623067142504-25090.5290308092*o[16])) +
-           g.pi*((-0.000583127571138466-40.8941845575259*o[18])*o[59] +
-           g.pi*(o[14]*(5.04278268948563e-9-16593.9663250364*o[19]) +
-           g.pi*(0.0000185418911827544*o[60] + g.pi*(o[2]*(3.74650747566264e-17 +
-           (-9.2112723863361e-11-1.26229060181839e-6*o[10])*o[20]) +
-           o[23]*(o[19]*(-5.62945044183016e-7 + 1283.16382552908*o[24]) +
-           o[21]*(-5871.36974514691*o[61] + o[21]*(o[16]*(6.778124247012e-21 +
-           (4.07369914453886e-9-0.0766125010815314*o[15])*o[28]) +
-           g.pi*(-5.20874181827336e-22*o[27] + g.pi*(0.0926230639263108*o[62] +
-           g.pi*(-2.51975728716995e-11*o[63] + (1.04895338726032e-24 +
-           o[18]*(1.22355691494518e-12-0.0302134054703458*o[32]))*o[64]*g.pi))))))))))))
-           + (3.0697722845484e-7 + 0.0000173611341786625*tau2)*tau2));
-
-      g.gpitautau := -0.09199202739273 + o[67] + g.pi*
-                                               (-0.0007579595006526 +
-    o[1]*(-0.094542665384052 +
-    (-3.67897283464813-0.0672198607434992*o[13])*o[2]) +
-    g.pi*((-0.00058099819029426 +
-    (-0.135305320879332-145.185665218657*o[13])*o[2])*tau2 +
-    g.pi*(1.0232574281828e-7 + o[53] + g.pi*(0.000481363603090881*o[68] +
-    g.pi*(g.pi*((-0.000971879285230777-163.576738230104*o[18])*o[69] +
-    g.pi*((5.04278268948563e-9-82969.831625182*o[19])*o[20] +
-    g.pi*(0.0000278128367741315*o[17] + g.pi*(o[1]*(1.24883582522088e-17 +
-    (-9.2112723863361e-11-1.823308647071e-6*o[10])*o[20]) +
-    o[23]*((-1.05083074914163e-6 + 4191.66849672833*o[24])*o[70] +
-    o[21]*(-19340.9826898957*o[71] + o[21]*((6.778124247012e-21 +
-    (7.28977741654322e-9-0.189515134254314*o[15])*o[28])*o[32] +
-    g.pi*(-5.20874181827336e-22*o[16] + g.pi*(0.229352348769913*o[72] +
-    g.pi*(-4.35230804147537e-11*o[73] + (1.14016672528295e-24 +
-    o[18]*(2.07472694273313e-12-0.0748767005134657*o[32]))*o[74]*g.pi)))))))))) +
-     (-6.01731592238196e-10 + o[15]*(-3.04869201427512 - 170615.597409503*o[16]))
-                                                 *tau2)))));
-    end g2L3;
-
-    function f3L3
-      "Helmholtz function for region 3: f(d,T), including 3rd derivatives"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature (K)";
-      output ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
-                                                          f
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-    protected
-      Real tau "dimensionless temperature";
-      Real del "dimensionless density";
-      Real[62] o "vector of auxiliary variables";
-    algorithm
-      f.T := T;
-      f.d := d;
-      f.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      tau := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT/T;
-      del := if (d == ThermoSysPro.Properties.WaterSteam.BaseIF97.data.DCRIT and
-        T == ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT) then 1 -
-        Modelica.Constants.eps else abs(d/ThermoSysPro.Properties.WaterSteam.BaseIF97.data.DCRIT);
-      f.tau := tau;
-      f.delta := del;
-      o[1] := tau*tau;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*tau;
-      o[4] := o[1]*tau;
-      o[5] := o[2]*o[2];
-      o[6] := o[1]*o[5]*tau;
-      o[7] := o[5]*tau;
-      o[8] := -0.64207765181607*o[1];
-      o[9] := 0.88521043984318 + o[8];
-      o[10] := o[7]*o[9];
-      o[11] := -1.1524407806681 + o[10];
-      o[12] := o[11]*o[2];
-      o[13] := -1.2654315477714 + o[12];
-      o[14] := o[1]*o[13];
-      o[15] := o[1]*o[2]*o[5]*tau;
-      o[16] := o[2]*o[5];
-      o[17] := o[1]*o[5];
-      o[18] := o[5]*o[5];
-      o[19] := o[1]*o[18]*o[2];
-      o[20] := o[1]*o[18]*o[2]*tau;
-      o[21] := o[18]*o[5];
-      o[22] := o[1]*o[18]*o[5];
-      o[23] := 0.25116816848616*o[2];
-      o[24] := 0.078841073758308 + o[23];
-      o[25] := o[15]*o[24];
-      o[26] := -6.100523451393 + o[25];
-      o[27] := o[26]*tau;
-      o[28] := 9.7944563083754 + o[27];
-      o[29] := o[2]*o[28];
-      o[30] := -1.70429417648412 + o[29];
-      o[31] := o[1]*o[30];
-      o[32] := del*del;
-      o[33] := -2.85576214409538*o[17];
-      o[34] := -0.0492885823043778 + o[33];
-      o[35] := o[16]*o[34];
-      o[36] := -12.113949014142 + o[35];
-      o[37] := o[1]*o[36];
-      o[38] := 8.339879741676 + o[37];
-      o[39] := o[1]*o[38];
-      o[40] := del*o[32];
-      o[41] := -10.9153200808732*o[1];
-      o[42] := 13.2781565976477 + o[41];
-      o[43] := o[42]*o[7];
-      o[44] := -6.9146446840086 + o[43];
-      o[45] := o[2]*o[44];
-      o[46] := -2.5308630955428 + o[45];
-      o[47] := o[46]*tau;
-      o[48] := o[18]*o[5]*tau;
-      o[49] := -174.645121293971*o[1];
-      o[50] := 185.894192367068 + o[49];
-      o[51] := o[50]*o[7];
-      o[52] := -34.573223420043 + o[51];
-      o[53] := o[2]*o[52];
-      o[54] := 6.53037238064016*o[2];
-      o[55] := 1.73450362268278 + o[54];
-      o[56] := o[15]*o[55];
-      o[57] := -42.703664159751 + o[56];
-      o[58] := o[57]*tau;
-      o[59] := 58.7667378502524 + o[58];
-      o[60] := o[2]*o[59];
-      o[61] := -3.40858835296824 + o[60];
-      o[62] := o[61]*tau;
-
-      f.f := -15.732845290239 + tau*(20.944396974307 + (-7.6867707878716 + o[3]
-        *(2.6185947787954 + o[4]*(-2.808078114862 + o[1]*(1.2053369696517 -
-        0.0084566812812502*o[6]))))*tau) + del*(o[14] + del*(0.38493460186671
-         + o[1]*(-0.85214708824206 + o[2]*(4.8972281541877 + (-3.0502617256965
-         + o[15]*(0.039420536879154 + 0.12558408424308*o[2]))*tau)) + del*(-0.2799932969871
-         + o[1]*(1.389979956946 + o[1]*(-2.018991502357 + o[16]*(-0.0082147637173963
-         - 0.47596035734923*o[17]))) + del*(0.0439840744735 + o[1]*(-0.44476435428739
-         + o[1]*(0.90572070719733 + 0.70522450087967*o[19])) + del*(del*(-0.022175400873096
-         + o[1]*(0.094260751665092 + 0.16436278447961*o[21]) + del*(-0.013503372241348
-        *o[1] + del*(-0.014834345352472*o[22] + del*(o[1]*(0.00057922953628084
-         + 0.0032308904703711*o[21]) + del*(0.000080964802996215 -
-        0.000044923899061815*del*o[22] - 0.00016557679795037*tau))))) + (
-        0.10770512626332 + o[1]*(-0.32913623258954 - 0.50871062041158*o[20]))*
-        tau))))) + 1.0658070028513*Modelica.Math.log(del);
-
-      f.fdelta := (1.0658070028513 + del*
-                    (o[14] + del*(0.76986920373342 + o[31] + del*(-0.8399798909613+ o[1]*(
-        4.169939870838 + o[1]*(-6.056974507071 + o[16]*(-0.0246442911521889
-         - 1.42788107204769*o[17])))+del*(0.175936297894+o[1]*(-1.77905741714956
-         + o[1]*(3.62288282878932 + 2.82089800351868*o[19])) + del*   (del*(-0.133052405238576
-         + o[1]*(0.565564509990552 + 0.98617670687766*o[21]) + del*(-0.094523605689436*o[1] + del*
-        (-0.118674762819776*o[22] + del*(o[1]*(0.00521306582652756 + 0.0290780142333399*o[21])
-         + del*(0.00080964802996215 - 0.000494162889679965*del*o[22] -
-        0.0016557679795037*tau)))))+(0.5385256313166+o[1]*(-1.6456811629477-2.5435531020579*o[20]))*tau))))))/del;
-
-      f.fdeltadelta := (-1.0658070028513 + o[32]*
-                       (0.76986920373342 + o[31] + del*
-                                                   (-1.6799597819226 + o[39]
-         + del*(0.527808893682 + o[1]*(-5.33717225144868 + o[1]*(
-        10.868648486368 + 8.46269401055604*o[19])) + del*(del*
-        (-0.66526202619288 + o[1]*(2.82782254995276 + 4.9308835343883*o[21])
-         + del*                                                              (-0.567141634136616
-        *o[1] + del*
-        (-0.830723339738432*o[22] + del*
-                                      (o[1]*(0.0417045266122205 +
-        0.232624113866719*o[21]) + del*(0.00728683226965935 -
-        0.00494162889679965*del*o[22] - 0.0149019118155333*tau)))))          +(
-        2.1541025252664 + o[1]*(-6.5827246517908 - 10.1742124082316*o[20]))*
-        tau)))))                                                        /o[32];
-
-      f.fdeltadeltadelta :=
-                     (2.1316140057026 + o[40]*
-                                            (-1.6799597819226 + o[39] + del*
-                                                                        (
-        1.055617787364 + o[1]*                                                               (-10.6743445028974
-         + o[1]*(21.7372969727359 + 16.9253880211121*o[19]))
-                                         +del*(del*(-2.66104810477152+o[1]*(11.311290199811+19.7235341375532*o[21])
-     +del*(-2.83570817068308*o[1]+del*(-4.98434003843059*o[22]+del*(o[1]*(0.291931686285543+1.62836879706703*o[21])
-     +del*(0.0582946581572748-0.0444746600711968*del*o[22]-0.119215294524266*tau)))))+(6.4623075757992+o[1]*(-19.7481739553724
-         - 30.5226372246948*o[20]))       *tau))))/o[40];
-
-      f.ftau := 20.944396974307 +
-                         (-15.3735415757432 + o[3]*
-                                                 (18.3301634515678 + o[4]*
-                                                                        (-28.08078114862
-         + o[1]*(14.4640436358204 - 0.194503669468755*o[6]))))
-                                           *tau+del*(o[47]+del*(tau*(-1.70429417648412+o[2]*
-    (29.3833689251262 + (-21.3518320798755 + o[15]*(0.867251811341388 +
-        3.26518619032008*o[2]))*tau))
-    +del*((2.779959913892+o[1]*(-8.075966009428+o[16]*(-0.131436219478341-12.37496929108
-        *o[17])))     *tau+del*((-0.88952870857478+o[1]*(3.62288282878932+18.3358370228714*o[19]))*tau + del*
-       (0.10770512626332 + o[1]*(-0.98740869776862 - 13.2264761307011*o[20])
-         + del*                                                              ((
-        0.188521503330184 + 4.27343239646986*o[21])
-                      *tau+del*(-0.027006744482696*tau+del*(-0.385692979164272*o[48]+del*(del*(-0.00016557679795037
-         - 0.00116802137560719*del*o[48]) + (0.00115845907256168 +
-        0.0840031522296486*o[21])*tau)))))))));
-
-      f.ftautau := -15.3735415757432 + o[3]*
-                                   (109.980980709407 + o[4]*
-                                                          (-252.72703033758
-         + o[1]*(159.104479994024 - 4.2790807283126*o[6])))
-                                        +del*(-2.5308630955428+o[53]+del*(-1.70429417648412+o[2]*(
-        146.916844625631 + (-128.110992479253 + o[15]*(18.2122880381691 +
-        81.629654758002*o[2]))*tau) + del*(2.779959913892 + o[1]*(-24.227898028284
-         + o[16]*(-1.97154329217511 - 309.374232277*o[17])) + del*(-0.88952870857478
-         + o[1]*(10.868648486368 + 458.395925571786*o[19]) + del*   (del*(
-        0.188521503330184 + 106.835809911746*o[21] + del*
-                          (-0.027006744482696 + del*
-                                                  (-9.6423244791068*o[21] +
-        del*                                                                  (
-        0.00115845907256168 + 2.10007880574121*o[21] - 0.0292005343901797*o[
-        21]*o[32]))))                                   +(-1.97481739553724-330.661903267527*o[20])*tau)))));
-
-      f.ftautautau := o[2]*(549.904903547034 + o[4]*(-2021.81624270064 + o[1]*(1591.04479994024 -
-        89.8606952945646*o[6]))) + del*
-    (o[4]*(-138.292893680172 + (2416.62450077188 - 2619.67681940957*o[1])*o[7])
-         + del*                                                                 (o[4]*(
-        587.667378502524 + (-640.554962396265 + o[15]*(364.245760763383 +
-        1959.11171419205*o[2]))*tau) + del*((-48.455796056568 + o[16]*(-27.6016060904516
-         - 7424.98157464799*o[17]))*tau + del*                                  (del*(-1.97481739553724
-         - 7935.88567842065*o[20] + del*     (2564.05943788192*o[20] + o[32]*
-                                                                           (-231.415787498563
-        *o[20] + del*(50.4018913377892*o[20] - 0.700812825364314*o[20]*o[32]))))
-                                                                  +(21.7372969727359+
-        11001.5022137229*o[19])
-                      *tau))));
-
-      f.fdeltatau := o[47] + del*
-                        (o[62] + del*
-                                   ((8.339879741676 + o[1]*
-                                                         (-24.227898028284 +
-        o[16]*(-0.394308658435022 - 37.1249078732399*o[17])))
-                                            *tau+del*((-3.55811483429912+o[1]*(
-        14.4915313151573 + 73.3433480914857*o[19]))
-                                         *tau+del*(0.5385256313166+o[1]*(-4.9370434888431
-         - 66.1323806535054*o[20]) + del*    ((1.1311290199811 +
-        25.6405943788192*o[21])
-     *tau+del*(-0.189047211378872*tau+del*(-3.08554383331418*o[48]+del*(del*(-0.0016557679795037
-         - 0.0128482351316791*del*o[48]) + (0.0104261316530551 +
-        0.756028370066837*o[21])*tau))))))));
-
-      f.fdeltatautau := -2.5308630955428 + o[53] + del*
-                                           (-3.40858835296824 + o[2]*
-                                                                   (
-        293.833689251262 + (-256.221984958506 + o[15]*(36.4245760763383 +
-        163.259309516004*o[2]))*tau)                                  +del*(8.339879741676+o[1]*(-72.683694084852
-         + o[16]*(-5.91462987652534 - 928.122696830999*o[17])) + del*       (-3.55811483429912
-         + o[1]*(43.4745939454718 + 1833.58370228714*o[19]) + del*
-                                                  (del*(1.1311290199811 +
-        641.014859470479*o[21] + del*
-    (-0.189047211378872 + del*
-                            (-77.1385958328544*o[21] + del*
-                                                         (0.0104261316530551
-         + 18.9007092516709*o[21] - 0.321205878291977*o[21]*o[32]))))
-                                      +(-9.8740869776862-1653.30951633764*o[20])*tau))));
-
-      f.fdeltadeltatau := o[62] + del*
-                            ((16.679759483352 + o[1]*
-                                                   (-48.455796056568 + o[16]*
-                                                                           (-0.788617316870045
-         - 74.2498157464799*o[17])))
-                        *tau+del*((-10.6743445028974+o[1]*(43.4745939454718+
-        220.030044274457*o[19]))
-                       *tau+del*(2.1541025252664+o[1]*(-19.7481739553724-264.529522614022*o[20])
-     +del*((5.65564509990552+128.202971894096*o[21])*tau+del*(-1.13428326827323*tau+del*(-21.5988068331992
-        *o[48] + del*       (del*(-0.0149019118155333 - 0.128482351316791*del
-        *o[48]) + (0.0834090532244409 + 6.0482269605347*o[21])*tau)))))));
-    end f3L3;
-
-    function g5L3
-      "base function for region 5: g(p,T), including 3rd derivatives"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                      g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-    protected
-      Real tau "dimensionless temperature";
-      Real pi "dimensionless pressure";
-      Real[16] o "vector of auxiliary variables";
-    algorithm
-      assert(p > ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple,
-        "IF97 medium function g5 called with too low pressure\n" + "p = " +
-        String(p) + " Pa <= " + String(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
-         + " Pa (triple point pressure)");
-      assert(p <= ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT5,
-        "IF97 medium function g5: input pressure (= " + String(p) +
-        " Pa) is higher than 10 Mpa in region 5");
-      assert(T <= 2273.15,
-        "IF97 medium function g5: input temperature (= " + String(T) + " K) is higher than limit of 2273.15K in region 5");
-      g.p := p;
-      g.T := T;
-      g.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      pi := p/ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PSTAR5;
-      tau := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TSTAR5/T;
-      g.pi := pi;
-      g.tau := tau;
-      o[1] := tau*tau;
-      o[2] := -0.004594282089991*o[1];
-      o[3] := 0.0021774678714571 + o[2];
-      o[4] := o[3]*tau;
-      o[5] := o[1]*tau;
-      o[6] := o[1]*o[1];
-      o[7] := o[6]*o[6];
-      o[8] := o[7]*tau;
-      o[9] := -7.9449656719138e-6*o[8];
-      o[10] := pi*pi;
-      o[11] := o[10]*pi;
-      o[12] := -0.013782846269973*o[1];
-      o[13] := -0.027565692539946*tau;
-      o[14] := o[1]*o[6]*tau;
-      o[15] := o[1]*o[6];
-      o[16] := -0.0000715046910472242*o[7];
-      g.g := pi*(-0.00012563183589592 + o[4] + pi*(-3.9724828359569e-6*o[8] +
-        1.2919228289784e-7*o[5]*pi)) + (-0.024805148933466 + tau*(
-        0.36901534980333 + tau*(-3.1161318213925 + tau*(-13.179983674201 + (
-        6.8540841634434 - 0.32961626538917*tau)*tau + Modelica.Math.log(pi)))))
-        /o[5];
-      g.gpi := (1.0 + pi*(-0.00012563183589592 + o[4] + pi*(o[9] +
-        3.8757684869352e-7*o[5]*pi)))/pi;
-      g.gpipi := (-1.0 + o[10]*(o[9] + 7.7515369738704e-7*o[5]*pi))/o[10];
-      g.gpipipi := (2.0 + 7.7515369738704e-7*o[11]*o[5])/o[11];
-      g.gtau := pi*(0.0021774678714571 + o[12] + pi*(-0.0000357523455236121*o[7] +
-        3.8757684869352e-7*o[1]*pi)) + (0.074415446800398 + tau*(-0.73803069960666
-         + (3.1161318213925 + o[1]*(6.8540841634434 - 0.65923253077834*tau))*tau))/
-        o[6];
-      g.gtautau := (-0.297661787201592 + tau*(2.21409209881998 + (-6.232263642785
-         - 0.65923253077834*o[5])*tau))/(o[6]*tau) + pi*(o[13] + pi*(-0.000286018764188897
-        *o[14] + 7.7515369738704e-7*pi*tau));
-      g.gtautautau := pi*(-0.027565692539946 + (-0.00200213134932228*o[15] +
-        7.7515369738704e-7*pi)*pi) + (1.48830893600796 + tau*(-8.85636839527992 +
-        18.696790928355*tau))/o[15];
-      g.gpitau := 0.0021774678714571 + o[12] + pi*(o[16] + 1.16273054608056e-6*o[1]
-        *pi);
-      g.gpipitau := o[16] + 2.32546109216112e-6*o[1]*pi;
-      g.gpitautau := o[13] + pi*(-0.000572037528377794*o[14] + 2.32546109216112e-6*
-        pi*tau);
-    end g5L3;
-    annotation (Documentation(info="<HTML><h4>Package description</h4>
-          <p>Package BaseIF97/Basic computes the the fundamental functions for the 5 regions of the steam tables
-          as described in the standards document <a href=\"Documentation/IF97documentation/IF97.pdf\">IF97.pdf</a>. The code of these
-          functions has been generated using <b><i>Mathematica</i></b> and the add-on packages \"Format\" and \"Optimize\"
-          to generate highly efficient, expression-optimized C-code from a symbolic representation of the thermodynamic
-          functions. The C-code has than been transformed into Modelica code. An important feature of this optimization was to
-          simultaneously optimize the functions and the directional derivatives because they share many common subexpressions.</p>
-          <h4>Package contents</h4>
-          <p>
-          <ul>
-          <li>Function <b>g1</b> computes the dimensionless Gibbs function for region 1 and all derivatives up
-          to order 2 w.r.t pi and tau. Inputs: p and T.</li>
-          <li>Function <b>g2</b> computes the dimensionless Gibbs function  for region 2 and all derivatives up
-          to order 2 w.r.t pi and tau. Inputs: p and T.</li>
-          <li>Function <b>g2metastable</b> computes the dimensionless Gibbs function for metastable vapour
-          (adjacent to region 2 but 2-phase at equilibrium) and all derivatives up
-          to order 2 w.r.t pi and tau. Inputs: p and T.</li>
-          <li>Function <b>f3</b> computes the dimensionless Helmholtz function  for region 3 and all derivatives up
-          to order 2 w.r.t delta and tau. Inputs: d and T.</li>
-          <li>Function <b>g5</b>computes the dimensionless Gibbs function for region 5 and all derivatives up
-          to order 2 w.r.t pi and tau. Inputs: p and T.</li>
-          <li>Function <b>tph1</b> computes the inverse function T(p,h) in region 1.</li>
-          <li>Function <b>tph2</b> computes the inverse function T(p,h) in region 2.</li>
-          <li>Function <b>tps2a</b> computes the inverse function T(p,s) in region 2a.</li>
-          <li>Function <b>tps2b</b> computes the inverse function T(p,s) in region 2b.</li>
-          <li>Function <b>tps2c</b> computes the inverse function T(p,s) in region 2c.</li>
-          <li>Function <b>tps2</b> computes the inverse function T(p,s) in region 2.</li>
-          <li>Function <b>tsat</b> computes the saturation temperature as a function of pressure.</li>
-          <li>Function <b>dtsatofp</b> computes the derivative of the saturation temperature w.r.t. pressure as
-          a function of pressure.</li>
-          <li>Function <b>tsat_der</b> computes the Modelica derivative function of tsat.</li>
-          <li>Function <b>psat</b> computes the saturation pressure as a function of temperature.</li>
-          <li>Function <b>dptofT</b>  computes the derivative of the saturation pressure w.r.t. temperature as
-          a function of temperature.</li>
-          <li>Function <b>psat_der</b> computes the Modelica derivative function of psat.</li>
-          </ul>
-          </p>
-          <h4>Version Info and Revision history
-          </h4>
-          <ul>
-          <li>First implemented: <i>July, 2000</i>
-          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-          </li>
-          </ul>
-          <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
-          </address>
-          <ul>
-          <li>Initial version: July 2000</li>
-          <li>Documentation added: December 2002</li>
-          </ul>
-          </HTML>
-          "),   Documentation(
-     info="<html>
-       <p>
-       &nbsp;Equation from:<br>
-       <div style=\"text-align: center;\">&nbsp;[1] The international Association
-       for the Properties of Water and Steam<br>
-       &nbsp;Vejle, Denmark<br>
-       &nbsp;August 2003<br>
-       &nbsp;Supplementary Release on Backward Equations for the Fucnctions
-       T(p,h), v(p,h) and T(p,s), <br>
-       &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
-       the Thermodynamic Properties of<br>
-       &nbsp;Water and Steam</div>
-       </p>
-       </html>"),
-      Icon(graphics={
-          Text(
-            extent={{-102,0},{24,-26}},
-            lineColor={242,148,0},
-            textString=
-                 "Thermo"),
-          Text(
-            extent={{-4,8},{68,-34}},
-            lineColor={46,170,220},
-            textString=
-                 "SysPro"),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
-                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
-                -50,6},{-62,2}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
-                8},{-42,22},{-42,30},{-44,38}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
-                12},{-26,12},{-28,12},{-26,20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,30},{-6,26}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,36},{-6,32}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,42},{-6,38}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,48},{-6,44}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,32},{-2,28}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,38},{-2,34}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,44},{-2,40}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,50},{-2,46}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
-                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
-                -50,6},{-62,2}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Line(
-            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-            color={46,170,220},
-            thickness=0.5),
-          Polygon(
-            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-          Line(
-            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-            color={0,0,255},
-            smooth=Smooth.None),
-          Line(
-            points={{80,80},{100,100}},
-            color={0,0,255},
-            smooth=Smooth.None)}));
-  end Basic;
-
-  package Transport "transport properties for water according to IAPWS/IF97"
-
-    function visc_dT "dynamic viscosity eta(d,T), industrial formulation"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.DynamicViscosity eta "dynamic viscosity";
-    protected
-      constant Real n0=1.0 "viscosity coefficient";
-      constant Real n1=0.978197 "viscosity coefficient";
-      constant Real n2=0.579829 "viscosity coefficient";
-      constant Real n3=-0.202354 "viscosity coefficient";
-      constant Real[42] nn=array(0.5132047, 0.3205656, 0.0, 0.0, -0.7782567,
-          0.1885447, 0.2151778, 0.7317883, 1.241044, 1.476783, 0.0, 0.0, -0.2818107,
-           -1.070786, -1.263184, 0.0, 0.0, 0.0, 0.1778064, 0.460504,
-          0.2340379, -0.4924179, 0.0, 0.0, -0.0417661, 0.0, 0.0, 0.1600435,
-          0.0, 0.0, 0.0, -0.01578386, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.003629481,
-           0.0, 0.0) "viscosity coefficients";
-      constant Units.SI.Density rhostar=317.763 "scaling density";
-      constant Units.SI.DynamicViscosity etastar=55.071e-6 "scaling viscosity";
-      constant Units.SI.Temperature tstar=647.226 "scaling temperature";
-      Integer i "auxiliary variable";
-      Integer j "auxiliary variable";
-      Real delta "dimensionless density";
-      Real deltam1 "dimensionless density";
-      Real tau "dimensionless temperature";
-      Real taum1 "dimensionless temperature";
-      Real Psi0 "auxiliary variable";
-      Real Psi1 "auxiliary variable";
-      Real tfun "auxiliary variable";
-      Real rhofun "auxiliary variable";
-      Real Tc=T - 273.15 "Celsius temperature for region check";
-      //      Integer region "region of IF97";
-    algorithm
-      delta := max(d,triple.dvtriple)/rhostar;
-    //   assert(d > triple.dvtriple,
-    //     "IF97 medium function visc_dTp for viscosity called with too low density\n" +
-    //     "d = " + String(d) + " <= " + String(triple.dvtriple) + " (triple point density)");
-      deltam1 := delta - 1.0;
-      tau := tstar/T;
-      taum1 := tau - 1.0;
-      Psi0 := 1/(n0 + (n1 + (n2 + n3*tau)*tau)*tau)/(tau^0.5);
-      Psi1 := 0.0;
-      tfun := 1.0;
-      for i in 1:6 loop
-        if (i <> 1) then
-          tfun := tfun*taum1;
-        end if;
-        rhofun := 1.;
-        for j in 0:6 loop
-          if (j <> 0) then
-            rhofun := rhofun*deltam1;
-          end if;
-          Psi1 := Psi1 + nn[i + j*6]*tfun*rhofun;
-        end for;
-      end for;
-      eta := etastar*Psi0*Modelica.Math.exp(delta*Psi1);
-      annotation(smoothOrder=5);
-    end visc_dT;
-
-    function cond_dTp
-      "Thermal conductivity lam(d,T,p) (industrial use version) only in one-phase region"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature (K)";
-      input Units.SI.Pressure p "pressure";
-      input Integer phase=0 "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Boolean industrialMethod=true
-        "if true, the industrial method is used, otherwise the scientific one";
-      output Units.SI.ThermalConductivity lambda "thermal conductivity";
-    protected
-      Integer region(min=1, max=5) "IF97 region, valid values:1,2,3, and 5";
-      constant Real n0=1.0 "conductivity coefficient";
-      constant Real n1=6.978267 "conductivity coefficient";
-      constant Real n2=2.599096 "conductivity coefficient";
-      constant Real n3=-0.998254 "conductivity coefficient";
-      constant Real[30] nn=array(1.3293046, 1.7018363, 5.2246158, 8.7127675,
-          -1.8525999, -0.40452437, -2.2156845, -10.124111, -9.5000611,
-          0.9340469, 0.2440949, 1.6511057, 4.9874687, 4.3786606, 0.0,
-          0.018660751, -0.76736002, -0.27297694, -0.91783782, 0.0, -0.12961068,
-           0.37283344, -0.43083393, 0.0, 0.0, 0.044809953, -0.1120316,
-          0.13333849, 0.0, 0.0) "conductivity coefficient";
-      constant Units.SI.ThermalConductivity lamstar=0.4945
-        "scaling conductivity";
-      constant Units.SI.Density rhostar=317.763 "scaling density";
-      constant Units.SI.Temperature tstar=647.226 "scaling temperature";
-      constant Units.SI.Pressure pstar=22.115e6 "scaling pressure";
-      constant Units.SI.DynamicViscosity etastar=55.071e-6 "scaling viscosity";
-      Integer i "auxiliary variable";
-      Integer j "auxiliary variable";
-      Real delta "dimensionless density";
-      Real tau "dimensionless temperature";
-      Real deltam1 "dimensionless density";
-      Real taum1 "dimensionless temperature";
-      Real Lam0 "part of thermal conductivity";
-      Real Lam1 "part of thermal conductivity";
-      Real Lam2 "part of thermal conductivity";
-      Real tfun "auxiliary variable";
-      Real rhofun "auxiliary variable";
-      Real dpitau "auxiliary variable";
-      Real ddelpi "auxiliary variable";
-      Real d2 "auxiliary variable";
-      ThermoSysPro.Properties.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Real Tc=T - 273.15 "Celsius temperature for region check";
-      Real Chi "symmetrized compressibility";
-      // slightly different variables for industrial use
-      constant Units.SI.Density rhostar2=317.7 "Reference density";
-      constant Units.SI.Temperature Tstar2=647.25 "Reference temperature";
-      constant Units.SI.ThermalConductivity lambdastar=1
-        "Reference thermal conductivity";
-      parameter Real TREL=T/Tstar2 "Relative temperature";
-      parameter Real rhoREL=d/rhostar2 "Relative density";
-      Real lambdaREL "Relative thermal conductivity";
-      Real deltaTREL "Relative temperature increment";
-      constant Real[:] C={0.642857,-4.11717,-6.17937,0.00308976,0.0822994,
-          10.0932};
-      constant Real[:] dpar={0.0701309,0.0118520,0.00169937,-1.0200};
-      constant Real[:] b={-0.397070,0.400302,1.060000};
-      constant Real[:] B={-0.171587,2.392190};
-      constant Real[:] a={0.0102811,0.0299621,0.0156146,-0.00422464};
-      Real Q;
-      Real S;
-      Real lambdaREL2
-        "function, part of the interpolating equation of the thermal conductivity";
-      Real lambdaREL1
-        "function, part of the interpolating equation of the thermal conductivity";
-      Real lambdaREL0
-        "function, part of the interpolating equation of the thermal conductivity";
-    algorithm
-      // region := BaseIF97.Regions.region_dT(d,T,phase);
-      // simplified region check, assuming that calling arguments are legal
-      //  assert(phase <> 2,
-      //   "thermalConductivity can not be called with 2-phase inputs!");
-      assert(d > triple.dvtriple,
-        "IF97 medium function cond_dTp called with too low density\n" +
-        "d = " + String(d) + " <= " + String(triple.dvtriple) + " (triple point density)");
-      assert((p <= 100e6 and (Tc >= 0.0 and Tc <= 500)) or
-      (p <= 70e6 and (Tc > 500.0 and Tc <= 650)) or
-      (p <= 40e6 and (Tc > 650.0 and Tc <= 800)),
-      "IF97 medium function cond_dTp: thermal conductivity computed outside the range\n" +
-      "of validity of the IF97 formulation: p = " + String(p) + " Pa, Tc = " + String(Tc) + " K");
-      if industrialMethod == true then
-        deltaTREL := abs(TREL - 1) + C[4];
-        Q := 2 + C[5]/deltaTREL^(3/5);
-        if TREL >= 1 then
-          S := 1/deltaTREL;
-        else
-          S := C[6]/deltaTREL^(3/5);
-        end if;
-        lambdaREL2 := (dpar[1]/TREL^10 + dpar[2])*rhoREL^(9/5)*Modelica.Math.exp(C[1]*(1 - rhoREL^(14
-          /5))) + dpar[3]*S*rhoREL^Q*Modelica.Math.exp((Q/(1 + Q))*(1 -
-          rhoREL^(1 + Q))) + dpar[4]*Modelica.Math.exp(C[2]*TREL^(3/2) + C[3]
-          /rhoREL^5);
-        lambdaREL1 := b[1] + b[2]*rhoREL + b[3]*Modelica.Math.exp(B[1]*(
-          rhoREL + B[2])^2);
-        lambdaREL0 := TREL^(1/2)*sum(a[i]*TREL^(i - 1) for i in 1:4);
-        lambdaREL := lambdaREL0 + lambdaREL1 + lambdaREL2;
-        lambda := lambdaREL*lambdastar;
-      else
-        if p < data.PLIMIT4A then
-          //regions are 1 or 2,
-          if d > data.DCRIT then
-     region := 1;
-          else
-     region := 2;
-          end if;
-        else
-          //region is 3, or illegal
-          assert(false,
-            "the scientific method works only for temperatures up to 623.15 K");
-        end if;
-        tau := tstar/T;
-        delta := d/rhostar;
-        deltam1 := delta - 1.0;
-        taum1 := tau - 1.0;
-        Lam0 := 1/(n0 + (n1 + (n2 + n3*tau)*tau)*tau)/(tau^0.5);
-        Lam1 := 0.0;
-        tfun := 1.0;
-        for
-     i in 1:5 loop
-          if (i <> 1) then
-     tfun := tfun*taum1;
-          end if;
-          rhofun := 1.0;
-          for
-       j in 0:5 loop
-     if (j <> 0) then
-              rhofun := rhofun*deltam1;
-     end if;
-     Lam1 := Lam1 + nn[i + j*5]*tfun*rhofun;
-          end for;
-        end for;
-        if (region == 1) then
-          g := Basic.g1(p, T);
-          // dp/dT @ cont d = -g.p/g.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
-          dpitau := -tstar/pstar*(data.PSTAR1*(g.gpi - data.TSTAR1/T*g.gtaupi)
-            /g.gpipi/T);
-          ddelpi := -pstar/rhostar*data.RH2O/data.PSTAR1/data.PSTAR1*T*d*d*g.
-            gpipi;
-          Chi := delta*ddelpi;
-        elseif (region == 2) then
-          g := Basic.g2(p, T);
-          dpitau := -tstar/pstar*(data.PSTAR2*(g.gpi - data.TSTAR2/T*g.gtaupi)
-            /g.gpipi/T);
-          ddelpi := -pstar/rhostar*data.RH2O/data.PSTAR2/data.PSTAR2*T*d*d*g.
-            gpipi;
-          Chi := delta*ddelpi;
-          //         elseif (region == 3) then
-          //           f := Basic.f3(T, d);
-          //            dpitau := tstar/pstar*(f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau));
-          //           ddelpi := pstar*d*d/(rhostar*p*p)/(f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta));
-          //    Chi := delta*ddelpi;
-        else
-          assert(false,
-            "thermal conductivity can only be called in the one-phase regions below 623.15 K\n" +
-            "(p = " + String(p) + " Pa, T = " + String(T) + " K, region = " + String(region) + ")");
-        end if;
-        taum1 := 1/tau - 1;
-        d2 := deltam1*deltam1;
-        Lam2 := 0.0013848*etastar/visc_dT(d, T)/(tau*tau*delta*delta)*
-          dpitau*dpitau*max(Chi, Modelica.Constants.small)^0.4678*(delta)^0.5
-          *Modelica.Math.exp(-18.66*taum1*taum1 - d2*d2);
-        lambda := lamstar*(Lam0*Modelica.Math.exp(delta*Lam1) + Lam2);
-      end if;
-      annotation(smoothOrder=5);
-    end cond_dTp;
-
-    function surfaceTension
-      "surface tension in region 4 between steam and water"
-      extends Modelica.Icons.Function;
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.SurfaceTension sigma "surface tension in SI units";
-    protected
-      Real Theta "dimensionless temperature";
-    algorithm
-      Theta := min(1.0,T/data.TCRIT);
-      sigma := 235.8e-3*(1 - Theta)^1.256*(1 - 0.625*(1 - Theta));
-      annotation(smoothOrder=5);
-    end surfaceTension;
-
-    function cond_industrial_dT
-      "Thermal conductivity lam(d,T) (industrial use version) only in one-phase region"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.ThermalConductivity lambda "thermal conductivity";
-    protected
-      constant Units.SI.Density rhostar2=317.7 "Reference density";
-      constant Units.SI.Temperature Tstar2=647.25 "Reference temperature";
-      constant Units.SI.ThermalConductivity lambdastar=1
-        "Reference thermal conductivity";
-      constant Real[:] C={0.642857,-4.11717,-6.17937,0.00308976,0.0822994,
-          10.0932};
-      constant Real[:] dpar={0.0701309,0.0118520,0.00169937,-1.0200};
-      constant Real[:] b={-0.397070,0.400302,1.060000};
-      constant Real[:] B={-0.171587,2.392190};
-      constant Real[:] a={0.0102811,0.0299621,0.0156146,-0.00422464};
-      Integer region(min=1, max=5) "IF97 region, valid values:1,2,3, and 5";
-      Real TREL "Relative temperature";
-      Real rhoREL "Relative density";
-      Real lambdaREL "Relative thermal conductivity";
-      Real deltaTREL "Relative temperature increment";
-      Real Q;
-      Real S;
-      Real lambdaREL2
-        "function, part of the interpolating equation of the thermal conductivity";
-      Real lambdaREL1
-        "function, part of the interpolating equation of the thermal conductivity";
-      Real lambdaREL0
-        "function, part of the interpolating equation of the thermal conductivity";
-    algorithm
-      assert(d > triple.dvtriple,
-        "IF97 medium function cond_dTp called with too low density\n" +
-        "d = " + String(d) + " <= " + String(triple.dvtriple) + " (triple point density)");
-       TREL := T/Tstar2;
-       rhoREL := d/rhostar2;
-       deltaTREL := abs(TREL - 1) + C[4];
-       Q := 2 + C[5]/deltaTREL^(3/5);
-       S := if TREL >= 1 then  1/deltaTREL else C[6]/deltaTREL^(3/5);
-        lambdaREL2 := (dpar[1]/TREL^10 + dpar[2])*rhoREL^(9/5)*Modelica.Math.exp(C[1]*(1 - rhoREL^(14
-          /5))) + dpar[3]*S*rhoREL^Q*Modelica.Math.exp((Q/(1 + Q))*(1 -
-          rhoREL^(1 + Q))) + dpar[4]*Modelica.Math.exp(C[2]*TREL^(3/2) + C[3]
-          /rhoREL^5);
-        lambdaREL1 := b[1] + b[2]*rhoREL + b[3]*Modelica.Math.exp(B[1]*(
-          rhoREL + B[2])^2);
-        lambdaREL0 := TREL^(1/2)*sum(a[i]*TREL^(i - 1) for i in 1:4);
-        lambdaREL := lambdaREL0 + lambdaREL1 + lambdaREL2;
-        lambda := lambdaREL*lambdastar;
-      annotation(smoothOrder=5);
-    end cond_industrial_dT;
-    annotation (Documentation(info="<HTML><h4>Package description</h4>
-          <p></p>
-          <h4>Package contents</h4>
-          <p>
-          <ul>
-          <li>Function <b>visc_dTp</b> implements a function to compute the industrial formulation of the
-          dynamic viscosity of water as a function of density and temperature.
-          The details are described in the document <a href=\"IF97documentation/visc.pdf\">visc.pdf</a>.</li>
-          <li>Function <b>cond_dTp</b> implements a function to compute  the industrial formulation of the thermal conductivity of water as
-          a function of density, temperature and pressure. <b>Important note</b>: Obviously only two of the three
-          inputs are really needed, but using three inputs speeds up the computation and the three variables are known in most models anyways.
-          The inputs d,T and p have to be consistent.
-          The details are described in the document <a href=\"IF97documentation/surf.pdf\">surf.pdf</a>.</li>
-          <li>Function <b>surfaceTension</b> implements a function to compute the surface tension between vapour
-          and liquid water as a function of temperature.
-          The details are described in the document <a href=\"IF97documentation/thcond.pdf\">thcond.pdf</a>.</li>
-          </ul>
-          </p>
-          <h4>Version Info and Revision history
-          </h4>
-          <ul>
-          <li>First implemented: <i>October, 2002</i>
-          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-          </li>
-          </ul>
-          <address>Authors: Hubertus Tummescheit and Jonas Eborn<br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
-          </address>
-          <ul>
-          <li>Initial version: October 2002</li>
-          </ul>
-          </HTML>
-          "), Icon(graphics={
-          Text(
-            extent={{-102,0},{24,-26}},
-            lineColor={242,148,0},
-            textString=
-                 "Thermo"),
-          Text(
-            extent={{-4,8},{68,-34}},
-            lineColor={46,170,220},
-            textString=
-                 "SysPro"),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
-                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
-                -50,6},{-62,2}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
-                8},{-42,22},{-42,30},{-44,38}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
-                12},{-26,12},{-28,12},{-26,20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,30},{-6,26}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,36},{-6,32}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,42},{-6,38}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,48},{-6,44}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,32},{-2,28}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,38},{-2,34}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,44},{-2,40}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,50},{-2,46}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
-                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
-                -50,6},{-62,2}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Line(
-            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-            color={46,170,220},
-            thickness=0.5),
-          Polygon(
-            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-          Line(
-            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-            color={0,0,255},
-            smooth=Smooth.None),
-          Line(
-            points={{80,80},{100,100}},
-            color={0,0,255},
-            smooth=Smooth.None)}));
-  end Transport;
-
-  package Isentropic
-    "functions for calculating the isentropic enthalpy from pressure p and specific entropy s"
-
-    function hofpT1
-      "intermediate function for isentropic specific enthalpy in region 1"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real[13] o "vector of auxiliary variables";
-      Real pi1 "dimensionless pressure";
-      Real tau "dimensionless temperature";
-      Real tau1 "dimensionless temperature";
-    algorithm
-      tau := data.TSTAR1/T;
-      pi1 := 7.1 - p/data.PSTAR1;
-      assert(p > triple.ptriple,
-        "IF97 medium function hofpT1  called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      tau1 := -1.222 + tau;
-      o[1] := tau1*tau1;
-      o[2] := o[1]*tau1;
-      o[3] := o[1]*o[1];
-      o[4] := o[3]*o[3];
-      o[5] := o[1]*o[4];
-      o[6] := o[1]*o[3];
-      o[7] := o[3]*tau1;
-      o[8] := o[3]*o[4];
-      o[9] := pi1*pi1;
-      o[10] := o[9]*o[9];
-      o[11] := o[10]*o[10];
-      o[12] := o[4]*o[4];
-      o[13] := o[12]*o[12];
-
-      h := data.RH2O*T*tau*(pi1*((-0.00254871721114236 + o[1]*(
-        0.00424944110961118 + (0.018990068218419 + (-0.021841717175414 -
-        0.00015851507390979*o[1])*o[1])*o[6]))/o[5] + pi1*((
-        0.00141552963219801 + o[3]*(0.000047661393906987 + o[1]*(-0.0000132425535992538
-         - 1.2358149370591e-14*o[1]*o[3]*o[4])))/o[3] + pi1*((
-        0.000126718579380216 - 5.11230768720618e-9*o[5])/o[7] + pi1*((
-        0.000011212640954 + o[2]*(1.30342445791202e-6 - 1.4341729937924e-12*o[
-        8]))/o[6] + pi1*(o[9]*pi1*((1.40077319158051e-8 + 1.04549227383804e-9
-        *o[7])/o[8] + o[10]*o[11]*pi1*(1.9941018075704e-17/(o[1]*o[12]*o[3]*o[
-        4]) + o[9]*(-4.48827542684151e-19/o[13] + o[10]*o[9]*(pi1*(
-        4.65957282962769e-22/(o[13]*o[4]) + pi1*((3.83502057899078e-24*pi1)/(
-        o[1]*o[13]*o[4]) - 7.2912378325616e-23/(o[13]*o[4]*tau1))) -
-        1.00075970318621e-21/(o[1]*o[13]*o[3]*tau1))))) + 3.24135974880936e-6
-        /(o[4]*tau1)))))) + (-0.29265942426334 + tau1*(0.84548187169114 + o[1]
-        *(3.3855169168385 + tau1*(-1.91583926775744 + tau1*(0.47316115539684
-         + (-0.066465668798004 + 0.0040607314991784*tau1)*tau1)))))/o[2]);
-    end hofpT1;
-
-    function handsofpT1
-      "special function for specific enthalpy and specific entropy in region 1"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Real[28] o "vector of auxiliary variables";
-      Real pi1 "dimensionless pressure";
-      Real tau "dimensionless temperature";
-      Real tau1 "dimensionless temperature";
-      Real g "dimensionless Gibbs energy";
-      Real gtau "derivative of  dimensionless Gibbs energy w.r.t. tau";
-    algorithm
-      assert(p > triple.ptriple,
-        "IF97 medium function handsofpT1 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      tau := data.TSTAR1/T;
-      pi1 := 7.1 - p/data.PSTAR1;
-      tau1 := -1.222 + 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] := pi1*pi1;
-      o[15] := o[14]*pi1;
-      o[16] := o[14]*o[14];
-      o[17] := o[16]*o[16];
-      o[18] := o[16]*o[17]*pi1;
-      o[19] := o[14]*o[16];
-      o[20] := o[3]*o[3];
-      o[21] := o[20]*o[20];
-      o[22] := o[21]*o[3]*tau1;
-      o[23] := 1/o[22];
-      o[24] := o[21]*o[3];
-      o[25] := 1/o[24];
-      o[26] := o[1]*o[2]*o[21]*tau1;
-      o[27] := 1/o[26];
-      o[28] := o[1]*o[3];
-
-      g := pi1*(pi1*(pi1*(o[10]*(-0.000031679644845054 + o[2]*(-2.8270797985312e-6
-         - 8.5205128120103e-10*o[6])) + pi1*(o[12]*(-2.2425281908e-6 + (-6.5171222895601e-7
-         - 1.4341729937924e-13*o[13])*o[7]) + pi1*(-4.0516996860117e-7/o[3]
-         + o[15]*(o[18]*(o[14]*(o[19]*(2.6335781662795e-23/(o[1]*o[2]*o[21])
-         + pi1*(-1.1947622640071e-23*o[27] + pi1*(1.8228094581404e-24*o[25]
-         - 9.3537087292458e-26*o[23]*pi1))) + 1.4478307828521e-20/(o[1]*o[2]*
-        o[20]*o[3]*tau1)) - 6.8762131295531e-19/(o[2]*o[20]*o[3]*tau1)) + (-1.2734301741641e-9
-         - 1.7424871230634e-10*o[11])/(o[1]*o[3]*tau1))))) + o[8]*(-0.00047184321073267
-         + o[7]*(-0.00030001780793026 + (0.000047661393906987 + o[1]*(-4.4141845330846e-6
-         - 7.2694996297594e-16*o[9]))*tau1))) + o[5]*(0.00028319080123804 + o[
-        1]*(-0.00060706301565874 + o[6]*(-0.018990068218419 + tau1*(-0.032529748770505
-         + (-0.021841717175414 - 0.00005283835796993*o[1])*tau1))))) + (
-        0.14632971213167 + tau1*(-0.84548187169114 + tau1*(-3.756360367204 +
-        tau1*(3.3855169168385 + tau1*(-0.95791963387872 + tau1*(
-        0.15772038513228 + (-0.016616417199501 + 0.00081214629983568*tau1)*
-        tau1))))))/o[1];
-
-      gtau := pi1*((-0.00254871721114236 + o[1]*(0.00424944110961118 + (
-        0.018990068218419 + (-0.021841717175414 - 0.00015851507390979*o[1])*o[
-        1])*o[6]))/o[28] + pi1*(o[10]*(0.00141552963219801 + o[2]*(
-        0.000047661393906987 + o[1]*(-0.0000132425535992538 -
-        1.2358149370591e-14*o[9]))) + pi1*(o[12]*(0.000126718579380216 -
-        5.11230768720618e-9*o[28]) + pi1*((0.000011212640954 + (
-        1.30342445791202e-6 - 1.4341729937924e-12*o[13])*o[7])/o[6] + pi1*(
-        3.24135974880936e-6*o[5] + o[15]*((1.40077319158051e-8 +
-        1.04549227383804e-9*o[11])/o[13] + o[18]*(1.9941018075704e-17/(o[1]*o[
-        2]*o[20]*o[3]) + o[14]*(-4.48827542684151e-19/o[21] + o[19]*(-1.00075970318621e-21
-        *o[27] + pi1*(4.65957282962769e-22*o[25] + pi1*(-7.2912378325616e-23*
-        o[23] + (3.83502057899078e-24*pi1)/(o[1]*o[21]*o[3])))))))))))) + o[8]
-        *(-0.29265942426334 + tau1*(0.84548187169114 + o[1]*(3.3855169168385
-         + tau1*(-1.91583926775744 + tau1*(0.47316115539684 + (-0.066465668798004
-         + 0.0040607314991784*tau1)*tau1)))));
-
-      h := data.RH2O*T*tau*gtau;
-      s := data.RH2O*(tau*gtau - g);
-    end handsofpT1;
-
-    function hofps1 "function for isentropic specific enthalpy in region 1"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Units.SI.Temperature T "temperature (K)";
-    algorithm
-      T := Basic.tps1(p, s);
-      h := hofpT1(p, T);
-    end hofps1;
-
-    // for isentropic specific enthalpy get T(p,s), then use this
-    function hofpT2
-      "intermediate function for isentropic specific enthalpy in region 2"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real[16] o "vector of auxiliary variables";
-      Real pi "dimensionless pressure";
-      Real tau "dimensionless temperature";
-      Real tau2 "dimensionless temperature";
-    algorithm
-      assert(p > triple.ptriple,
-        "IF97 medium function hofpT2 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      pi := p/data.PSTAR2;
-      tau := data.TSTAR2/T;
-      tau2 := -0.5 + tau;
-      o[1] := tau*tau;
-      o[2] := o[1]*o[1];
-      o[3] := tau2*tau2;
-      o[4] := o[3]*tau2;
-      o[5] := o[3]*o[3];
-      o[6] := o[5]*o[5];
-      o[7] := o[6]*o[6];
-      o[8] := o[5]*o[6]*o[7]*tau2;
-      o[9] := o[3]*o[5];
-      o[10] := o[5]*o[6]*tau2;
-      o[11] := o[3]*o[7]*tau2;
-      o[12] := o[3]*o[5]*o[6];
-      o[13] := o[5]*o[6]*o[7];
-      o[14] := pi*pi;
-      o[15] := o[14]*o[14];
-      o[16] := o[7]*o[7];
-
-      h := data.RH2O*T*tau*((0.0280439559151 + tau*(-0.2858109552582 + tau*(
-        1.2213149471784 + tau*(-2.848163942888 + tau*(4.38395111945 + o[1]*(
-        10.08665568018 + (-0.5681726521544 + 0.06380539059921*tau)*tau))))))/
-        (o[1]*o[2]) + pi*(-0.017834862292358 + tau2*(-0.09199202739273 + (-0.172743777250296
-         - 0.30195167236758*o[4])*tau2) + pi*(-0.000033032641670203 + (-0.0003789797503263
-         + o[3]*(-0.015757110897342 + o[4]*(-0.306581069554011 -
-        0.000960283724907132*o[8])))*tau2 + pi*(4.3870667284435e-7 + o[3]*(-0.00009683303171571
-         + o[4]*(-0.0090203547252888 - 1.42338887469272*o[8])) + pi*(-7.8847309559367e-10
-         + (2.558143570457e-8 + 1.44676118155521e-6*tau2)*tau2 + pi*(
-        0.0000160454534363627*o[9] + pi*((-5.0144299353183e-11 + o[10]*(-0.033874355714168
-         - 836.35096769364*o[11]))*o[3] + pi*((-0.0000138839897890111 -
-        0.973671060893475*o[12])*o[3]*o[6] + pi*((9.0049690883672e-11 -
-        296.320827232793*o[13])*o[3]*o[5]*tau2 + pi*(2.57526266427144e-7*o[5]
-        *o[6] + pi*(o[4]*(4.1627860840696e-19 + (-1.0234747095929e-12 -
-        1.40254511313154e-8*o[5])*o[9]) + o[14]*o[15]*(o[13]*(-2.34560435076256e-9
-         + 5.3465159397045*o[5]*o[7]*tau2) + o[14]*(-19.1874828272775*o[16]*o[
-        6]*o[7] + o[14]*(o[11]*(1.78371690710842e-23 + (1.07202609066812e-11
-         - 0.000201611844951398*o[10])*o[3]*o[5]*o[6]*tau2) + pi*(-1.24017662339842e-24
-        *o[5]*o[7] + pi*(0.000200482822351322*o[16]*o[5]*o[7] + pi*(-4.97975748452559e-14
-        *o[16]*o[3]*o[5] + o[6]*o[7]*(1.90027787547159e-27 + o[12]*(
-        2.21658861403112e-15 - 0.0000547344301999018*o[3]*o[7]))*pi*tau2)))))))))))))))));
-    end hofpT2;
-
-    function handsofpT2
-      "function for isentropic specific enthalpy and specific entropy in region 2"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    protected
-      Real[22] o "vector of auxiliary variables";
-      Real pi "dimensionless pressure";
-      Real tau "dimensionless temperature";
-      Real tau2 "dimensionless temperature";
-      Real g "dimensionless Gibbs energy";
-      Real gtau "derivative of  dimensionless Gibbs energy w.r.t. tau";
-    algorithm
-      assert(p > triple.ptriple,
-        "IF97 medium function handsofpT2 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      tau := data.TSTAR2/T;
-      pi := p/data.PSTAR2;
-      tau2 := tau - 0.5;
-      o[1] := tau2*tau2;
-      o[2] := o[1]*tau2;
-      o[3] := o[1]*o[1];
-      o[4] := o[3]*o[3];
-      o[5] := o[4]*o[4];
-      o[6] := o[3]*o[4]*o[5]*tau2;
-      o[7] := o[1]*o[3]*tau2;
-      o[8] := o[3]*o[4]*tau2;
-      o[9] := o[1]*o[5]*tau2;
-      o[10] := o[1]*o[3]*o[4];
-      o[11] := o[3]*o[4]*o[5];
-      o[12] := o[1]*o[3];
-      o[13] := pi*pi;
-      o[14] := o[13]*o[13];
-      o[15] := o[13]*o[14];
-      o[16] := o[3]*o[5]*tau2;
-      o[17] := o[5]*o[5];
-      o[18] := o[3]*o[5];
-      o[19] := o[1]*o[3]*o[4]*tau2;
-      o[20] := o[1]*o[5];
-      o[21] := tau*tau;
-      o[22] := o[21]*o[21];
-
-      g := pi*(-0.0017731742473213 + tau2*(-0.017834862292358 + tau2*(-0.045996013696365
-         + (-0.057581259083432 - 0.05032527872793*o[2])*tau2)) + pi*(tau2*(-0.000033032641670203
-         + (-0.00018948987516315 + o[1]*(-0.0039392777243355 + o[2]*(-0.043797295650573
-         - 0.000026674547914087*o[6])))*tau2) + pi*(2.0481737692309e-8 + (
-        4.3870667284435e-7 + o[1]*(-0.00003227767723857 + o[2]*(-0.0015033924542148
-         - 0.040668253562649*o[6])))*tau2 + pi*(tau2*(-7.8847309559367e-10 +
-        (1.2790717852285e-8 + 4.8225372718507e-7*tau2)*tau2) + pi*(
-        2.2922076337661e-6*o[7] + pi*(o[2]*(-1.6714766451061e-11 + o[8]*(-0.0021171472321355
-         - 23.895741934104*o[9])) + pi*(-5.905956432427e-18 + o[1]*(-1.2621808899101e-6
-         - 0.038946842435739*o[10])*o[4]*tau2 + pi*((1.1256211360459e-11 -
-        8.2311340897998*o[11])*o[4] + pi*(1.9809712802088e-8*o[8] + pi*((
-        1.0406965210174e-19 + o[12]*(-1.0234747095929e-13 -
-        1.0018179379511e-9*o[3]))*o[3] + o[15]*((-8.0882908646985e-11 +
-        0.10693031879409*o[16])*o[6] + o[13]*(-0.33662250574171*o[17]*o[4]*o[
-        5]*tau2 + o[13]*(o[18]*(8.9185845355421e-25 + o[19]*(
-        3.0629316876232e-13 - 4.2002467698208e-6*o[8])) + pi*(-5.9056029685639e-26
-        *o[16] + pi*(3.7826947613457e-6*o[17]*o[3]*o[5]*tau2 + pi*(o[1]*(
-        7.3087610595061e-29 + o[10]*(5.5414715350778e-17 - 9.436970724121e-7*
-        o[20]))*o[4]*o[5]*pi - 1.2768608934681e-15*o[1]*o[17]*o[3]*tau2))))))))))))))))
-         + (-0.00560879118302 + tau*(0.07145273881455 + tau*(-0.4071049823928
-         + tau*(1.424081971444 + tau*(-4.38395111945 + tau*(-9.692768600217
-         + tau*(10.08665568018 + (-0.2840863260772 + 0.02126846353307*tau)*
-        tau) + Modelica.Math.log(pi)))))))/(o[22]*tau);
-
-      gtau := (0.0280439559151 + tau*(-0.2858109552582 + tau*(1.2213149471784
-         + tau*(-2.848163942888 + tau*(4.38395111945 + o[21]*(10.08665568018
-         + (-0.5681726521544 + 0.06380539059921*tau)*tau))))))/(o[21]*o[22])
-         + pi*(-0.017834862292358 + tau2*(-0.09199202739273 + (-0.172743777250296
-         - 0.30195167236758*o[2])*tau2) + pi*(-0.000033032641670203 + (-0.0003789797503263
-         + o[1]*(-0.015757110897342 + o[2]*(-0.306581069554011 -
-        0.000960283724907132*o[6])))*tau2 + pi*(4.3870667284435e-7 + o[1]*(-0.00009683303171571
-         + o[2]*(-0.0090203547252888 - 1.42338887469272*o[6])) + pi*(-7.8847309559367e-10
-         + (2.558143570457e-8 + 1.44676118155521e-6*tau2)*tau2 + pi*(
-        0.0000160454534363627*o[12] + pi*(o[1]*(-5.0144299353183e-11 + o[8]*(
-        -0.033874355714168 - 836.35096769364*o[9])) + pi*(o[1]*(-0.0000138839897890111
-         - 0.973671060893475*o[10])*o[4] + pi*((9.0049690883672e-11 -
-        296.320827232793*o[11])*o[7] + pi*(2.57526266427144e-7*o[3]*o[4] + pi
-        *(o[2]*(4.1627860840696e-19 + o[12]*(-1.0234747095929e-12 -
-        1.40254511313154e-8*o[3])) + o[15]*(o[11]*(-2.34560435076256e-9 +
-        5.3465159397045*o[16]) + o[13]*(-19.1874828272775*o[17]*o[4]*o[5] + o[
-        13]*((1.78371690710842e-23 + o[19]*(1.07202609066812e-11 -
-        0.000201611844951398*o[8]))*o[9] + pi*(-1.24017662339842e-24*o[18] +
-        pi*(0.000200482822351322*o[17]*o[3]*o[5] + pi*(-4.97975748452559e-14*
-        o[1]*o[17]*o[3] + (1.90027787547159e-27 + o[10]*(2.21658861403112e-15
-         - 0.0000547344301999018*o[20]))*o[4]*o[5]*pi*tau2))))))))))))))));
-
-      h := data.RH2O*T*tau*gtau;
-      s := data.RH2O*(tau*gtau - g);
-    end handsofpT2;
-
-    function hofps2 "function for isentropic specific enthalpy in region 2"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Units.SI.Temperature T "temperature (K)";
-    algorithm
-      T := Basic.tps2(p, s);
-      h := hofpT2(p, T);
-    end hofps2;
-    // region 3 extra functions
-
-    // for isentropic specific enthalpy get (d,T) = f(p,s), then use this
-    // which needs a bloody iteration, ...
-    // this is one thing that needs to be done somehow, ...
-
-    function hofdT3 "function for isentropic specific enthalpy in region 3"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real delta;
-      Real tau "dimensionless temperature";
-      Real[13] o "vector of auxiliary variables";
-      Real ftau "derivative of  dimensionless Helmholtz energy w.r.t. tau";
-      Real fdelta "derivative of  dimensionless Helmholtz energy w.r.t. delta";
-    algorithm
-      tau := data.TCRIT/T;
-      delta := d/data.DCRIT;
-      o[1] := tau*tau;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      o[4] := o[3]*tau;
-      o[5] := o[1]*o[2]*o[3]*tau;
-      o[6] := o[2]*o[3];
-      o[7] := o[1]*o[3];
-      o[8] := o[3]*o[3];
-      o[9] := o[1]*o[2]*o[8];
-      o[10] := o[1]*o[2]*o[8]*tau;
-      o[11] := o[3]*o[8];
-      o[12] := o[3]*o[8]*tau;
-      o[13] := o[1]*o[3]*o[8];
-
-      ftau := 20.944396974307 + tau*(-15.3735415757432 + o[2]*tau*(
-        18.3301634515678 + o[1]*tau*(-28.08078114862 + o[1]*(14.4640436358204
-         - 0.194503669468755*o[1]*o[3]*tau)))) + delta*((-2.5308630955428 + o[
-        2]*(-6.9146446840086 + (13.2781565976477 - 10.9153200808732*o[1])*o[4]))
-        *tau + delta*(tau*(-1.70429417648412 + o[2]*(29.3833689251262 + (-21.3518320798755
-         + (0.867251811341388 + 3.26518619032008*o[2])*o[5])*tau)) + delta*((
-        2.779959913892 + o[1]*(-8.075966009428 + o[6]*(-0.131436219478341 -
-        12.37496929108*o[7])))*tau + delta*((-0.88952870857478 + o[1]*(
-        3.62288282878932 + 18.3358370228714*o[9]))*tau + delta*(
-        0.10770512626332 + o[1]*(-0.98740869776862 - 13.2264761307011*o[10])
-         + delta*((0.188521503330184 + 4.27343239646986*o[11])*tau + delta*(-0.027006744482696
-        *tau + delta*(-0.385692979164272*o[12] + delta*(delta*(-0.00016557679795037
-         - 0.00116802137560719*delta*o[12]) + (0.00115845907256168 +
-        0.0840031522296486*o[11])*tau)))))))));
-
-      fdelta := (1.0658070028513 + delta*(o[1]*(-1.2654315477714 + o[2]*(-1.1524407806681
-         + (0.88521043984318 - 0.64207765181607*o[1])*o[4])) + delta*(
-        0.76986920373342 + o[1]*(-1.70429417648412 + o[2]*(9.7944563083754 +
-        (-6.100523451393 + (0.078841073758308 + 0.25116816848616*o[2])*o[5])*
-        tau)) + delta*(-0.8399798909613 + o[1]*(4.169939870838 + o[1]*(-6.056974507071
-         + o[6]*(-0.0246442911521889 - 1.42788107204769*o[7]))) + delta*(
-        0.175936297894 + o[1]*(-1.77905741714956 + o[1]*(3.62288282878932 +
-        2.82089800351868*o[9])) + delta*(delta*(-0.133052405238576 + o[1]*(
-        0.565564509990552 + 0.98617670687766*o[11]) + delta*(-0.094523605689436
-        *o[1] + delta*(-0.118674762819776*o[13] + delta*(o[1]*(
-        0.00521306582652756 + 0.0290780142333399*o[11]) + delta*(
-        0.00080964802996215 - 0.000494162889679965*delta*o[13] -
-        0.0016557679795037*tau))))) + (0.5385256313166 + o[1]*(-1.6456811629477
-         - 2.5435531020579*o[10]))*tau))))))/delta;
-
-      h := data.RH2O*T*(tau*ftau + delta*fdelta);
-    end hofdT3;
-
-    function hofps3 "isentropic specific enthalpy in region 3 h(p,s)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Units.SI.Density d "density";
-      Units.SI.Temperature T "temperature (K)";
-      Units.SI.Pressure delp=IterationData.DELP "iteration accuracy";
-      Units.SI.SpecificEntropy dels=IterationData.DELS "iteration accuracy";
-      Integer error "error if not 0";
-    algorithm
-      (d,T,error) := Inverses.dtofps3(p=p,s= s,delp= delp,dels= dels);
-      h := hofdT3(d, T);
-    end hofps3;
-
-    function hofpsdt3
-      "isentropic specific enthalpy in region 3 h(p,s) with given good guess in d and T"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Units.SI.Density dguess
-        "good guess density, e.g. from adjacent volume";
-      input Units.SI.Temperature Tguess
-        "good guess temperature, e.g. from adjacent volume";
-      input Units.SI.Pressure delp=IterationData.DELP "relative error in p";
-      input Units.SI.SpecificEntropy dels=IterationData.DELS
-        "relative error in s";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Units.SI.Density d "density";
-      Units.SI.Temperature T "temperature (K)";
-      Integer error "error flag";
-    algorithm
-      (d,T,error) := Inverses.dtofpsdt3(p=p,s= s,dguess= dguess,Tguess=
-        Tguess,delp= delp,dels= dels);
-      h := hofdT3(d, T);
-    end hofpsdt3;
-
-    function hofps4 "isentropic specific enthalpy in region 4 h(p,s)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Units.SI.Temp_K Tsat "saturation temperature";
-      Units.SI.MassFraction x "dryness fraction";
-      Units.SI.SpecificEntropy sl "saturated liquid specific entropy";
-      Units.SI.SpecificEntropy sv "saturated vapour specific entropy";
-      Units.SI.SpecificEnthalpy hl "saturated liquid specific enthalpy";
-      Units.SI.SpecificEnthalpy hv "saturated vapour specific enthalpy";
-    algorithm
-      if (p <= data.PLIMIT4A) then
-        Tsat := Basic.tsat(p);
-        (hl,sl) := handsofpT1(p, Tsat);
-        (hv,sv) := handsofpT2(p, Tsat);
-      elseif (p < data.PCRIT) then
-        sl := Regions.sl_p_R4b(p);
-        sv := Regions.sv_p_R4b(p);
-        hl := Regions.hl_p_R4b(p);
-        hv := Regions.hv_p_R4b(p);
-      end if;
-      x := max(min(if sl <> sv then (s - sl)/(sv - sl) else 1.0, 1.0),0.0);
-      h := hl + x*(hv - hl);
-    end hofps4;
-
-    function hofpT5 "specific enthalpy in region 5 h(p,T)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      Real[4] o "vector of auxiliary variables";
-      Real tau "dimensionless temperature";
-      Real pi "dimensionless pressure";
-    algorithm
-      tau := data.TSTAR5/T;
-      pi := p/data.PSTAR5;
-      assert(p > triple.ptriple,
-        "IF97 medium function hofpT5 called with too low pressure\n" +
-        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
-      o[1] := tau*tau;
-      o[2] := o[1]*o[1];
-      o[3] := pi*pi;
-      o[4] := o[2]*o[2];
-      h := data.RH2O*T*tau*(6.8540841634434 + 3.1161318213925/o[1] +
-        0.074415446800398/o[2] - 0.0000357523455236121*o[3]*o[4] +
-        0.0021774678714571*pi - 0.013782846269973*o[1]*pi +
-        3.8757684869352e-7*o[1]*o[3]*pi - 0.73803069960666/(o[1]*tau) -
-        0.65923253077834*tau);
-    end hofpT5;
-
-    function water_hisentropic
-      "isentropic specific enthalpy from p,s (preferably use water_hisentropic_dyn in dynamic simulation!)"
-      import ThermoSysPro;
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-     input Integer phase=
-                    0 "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      ThermoSysPro.Properties.Common.GibbsDerivs g
-        "derivatives of dimensionless Gibbs-function w.r.t dimensionless pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs f
-        "derivatives of dimensionless Helmholtz-function w.r.t dimensionless delta and tau";
-      Integer region(min=1, max=5) "IF97 region";
-      Integer error "error if not 0";
-      Units.SI.Temperature T "temperature";
-      Units.SI.Density d "density";
-    algorithm
-      region := Regions.region_ps(p=p,s= s,phase=phase);
-      if (region == 1) then
-        h := hofps1(p, s);
-      elseif (region == 2) then
-        h := hofps2(p, s);
-      elseif (region == 3) then
-        (d,T,error) := Inverses.dtofps3(p=p,s= s,delp= IterationData.DELP,dels=
-               IterationData.DELS);
-        h := hofdT3(d, T);
-      elseif (region == 4) then
-        h := hofps4(p, s);
-      elseif (region == 5) then
-        (T,error) := Inverses.tofps5(p=p,s= s,relds= IterationData.DELS);
-        h := hofpT5(p, T);
-      end if;
-    end water_hisentropic;
-
-    function water_hisentropic_dyn
-      "isentropic specific enthalpy from p,s and good guesses of d and T"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Units.SI.Density dguess
-        "good guess density, e.g. from adjacent volume";
-      input Units.SI.Temperature Tguess
-        "good guess temperature, e.g. from adjacent volume";
-      input Integer phase "1 for one phase, 2 for two phase";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    protected
-      ThermoSysPro.Properties.Common.GibbsDerivs g
-        "derivatives of dimensionless Gibbs-function w.r.t dimensionless pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs f
-        "derivatives of dimensionless Helmholtz-function w.r.t dimensionless delta and tau";
-      Integer region(min=1, max=5) "IF97 region";
-      Integer error "error if not 0";
-      Units.SI.Temperature T "temperature";
-      Units.SI.Density d "density";
-    algorithm
-      region := Regions.region_ps(p=p,s= s,phase= phase);
-      if (region == 1) then
-        h := hofps1(p, s);
-      elseif (region == 2) then
-        h := hofps2(p, s);
-      elseif (region == 3) then
-        h := hofpsdt3(p=p,s= s,dguess= dguess,Tguess= Tguess,delp=
-          IterationData.DELP,dels= IterationData.DELS);
-      elseif (region == 4) then
-        h := hofps4(p, s);
-      elseif (region == 5) then
-        (T,error) := Inverses.tofpst5(p=p,s= s,Tguess= Tguess,relds=
-          IterationData.DELS);
-        h := hofpT5(p, T);
-      end if;
-    end water_hisentropic_dyn;
-
-    annotation (Documentation(info="<HTML><h4>Package description</h4>
-          <p></p>
-          <h4>Package contents</h4>
-          <p>
-          <ul>
-          <li>Function <b>hofpT1</b> computes h(p,T) in region 1.</li>
-          <li>Function <b>handsofpT1</b> computes (s,h)=f(p,T) in region 1, needed for two-phase properties.</li>
-          <li>Function <b>hofps1</b> computes h(p,s) in region 1.</li>
-          <li>Function <b>hofpT2</b> computes h(p,T) in region 2.</li>
-          <li>Function <b>handsofpT2</b> computes (s,h)=f(p,T) in region 2, needed for two-phase properties.</li>
-          <li>Function <b>hofps2</b> computes h(p,s) in region 2.</li>
-          <li>Function <b>hofdT3</b> computes h(d,T) in region 3.</li>
-          <li>Function <b>hofpsdt3</b> computes h(p,s,dguess,Tguess) in region 3, where dguess and Tguess are initial guess
-          values for the density and temperature consistent with p and s.</li>
-          <li>Function <b>hofps4</b> computes h(p,s) in region 4.</li>
-          <li>Function <b>hofpT5</b> computes h(p,T) in region 5.</li>
-          <li>Function <b>water_hisentropic</b> computes h(p,s,phase) in all regions.
-          The phase input is needed due to discontinuous derivatives at the phase boundary.</li>
-          <li>Function <b>water_hisentropic_dyn</b> computes h(p,s,dguess,Tguess,phase) in all regions.
-          The phase input is needed due to discontinuous derivatives at the phase boundary. Tguess and dguess are initial guess
-          values for the density and temperature consistent with p and s. This function should be preferred in
-          dynamic simulations where good guesses are often available.</li>
-          </ul>
-          </p>
-          <h4>Version Info and Revision history
-          </h4>
-          <ul>
-          <li>First implemented: <i>July, 2000</i>
-          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-          </li>
-          </ul>
-          <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
-          </address>
-          <ul>
-          <li>Initial version: July 2000</li>
-          <li>Documentation added: December 2002</li>
-          </ul>
-          </HTML>
-          "), Icon(graphics={
-          Text(
-            extent={{-102,0},{24,-26}},
-            lineColor={242,148,0},
-            textString=
-                 "Thermo"),
-          Text(
-            extent={{-4,8},{68,-34}},
-            lineColor={46,170,220},
-            textString=
-                 "SysPro"),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
-                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
-                -50,6},{-62,2}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
-                8},{-42,22},{-42,30},{-44,38}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
-                12},{-26,12},{-28,12},{-26,20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,30},{-6,26}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,36},{-6,32}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,42},{-6,38}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,48},{-6,44}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,32},{-2,28}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,38},{-2,34}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,44},{-2,40}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,50},{-2,46}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
-                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
-                -50,6},{-62,2}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Line(
-            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-            color={46,170,220},
-            thickness=0.5),
-          Polygon(
-            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-          Line(
-            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-            color={0,0,255},
-            smooth=Smooth.None),
-          Line(
-            points={{80,80},{100,100}},
-            color={0,0,255},
-            smooth=Smooth.None)}));
-  end Isentropic;
-  //work needed: (Pr,lam,eta) = f(d,T,p, region?)
-  package Inverses "efficient inverses for selected pairs of variables"
-
-    //===================================================================
-    //            Iterative version for some pairs/regions
-
-    //===================================================================
-    function fixdT "region limits for inverse iteration in region 3"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Density din "density";
-      input Units.SI.Temperature Tin "temperature";
-      output Units.SI.Density dout "density";
-      output Units.SI.Temperature Tout "temperature";
-    protected
-      Units.SI.Temperature Tmin "approximation of minimum temperature";
-      Units.SI.Temperature Tmax "approximation of maximum temperature";
-    algorithm
-      if (din > 765.0) then
-        dout := 765.0;
-      elseif (din < 110.0) then
-        dout := 110.0;
-      else
-        dout := din;
-      end if;
-      if (dout < 390.0) then
-        Tmax := 554.3557377 + dout*0.809344262;
-      else
-        Tmax := 1116.85 - dout*0.632948717;
-      end if;
-      if (dout < data.DCRIT) then
-        Tmin := data.TCRIT*(1.0 - (dout - data.DCRIT)*(dout - data.DCRIT)/
-          1.0e6);
-      else
-        Tmin := data.TCRIT*(1.0 - (dout - data.DCRIT)*(dout - data.DCRIT)/
-          1.44e6);
-      end if;
-      if (Tin < Tmin) then
-        Tout := Tmin;
-      elseif (Tin > Tmax) then
-        Tout := Tmax;
-      else
-        Tout := Tin;
-      end if;
-    end fixdT;
-
-    function dofp13 "density at the boundary between regions 1 and 3"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.Density d "density";
-    protected
-      Real p2 "auxiliary variable";
-      Real[3] o "vector of auxiliary variables";
-    algorithm
-      p2 := 7.1 - 6.04960677555959e-8*p;
-      o[1] := p2*p2;
-      o[2] := o[1]*o[1];
-      o[3] := o[2]*o[2];
-      d := 57.4756752485113/(0.0737412153522555 + p2*(0.00145092247736023 +
-        p2*(0.000102697173772229 + p2*(0.0000114683182476084 + p2*(
-        1.99080616601101e-6 + o[1]*p2*(1.13217858826367e-8 + o[2]*o[3]*p2*(
-        1.35549330686006e-17 + o[1]*(-3.11228834832975e-19 + o[1]*o[2]*(-7.02987180039442e-22
-         + p2*(3.29199117056433e-22 + (-5.17859076694812e-23 +
-        2.73712834080283e-24*p2)*p2))))))))));
-
-    end dofp13;
-
-    function dofp23 "density at the boundary between regions 2 and 3"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output Units.SI.Density d "density";
-    protected
-      Units.SI.Temperature T;
-      Real[13] o "vector of auxiliary variables";
-      Real taug "auxiliary variable";
-      Real pi "dimensionless pressure";
-      Real gpi23
-        "derivative of g w.r.t. pi on the boundary between regions 2 and 3";
-    algorithm
-      pi := p/data.PSTAR2;
-      T := 572.54459862746 + 31.3220101646784*(-13.91883977887 + pi)^0.5;
-      o[1] := (-13.91883977887 + pi)^0.5;
-      taug := -0.5 + 540.0/(572.54459862746 + 31.3220101646784*o[1]);
-      o[2] := taug*taug;
-      o[3] := o[2]*taug;
-      o[4] := o[2]*o[2];
-      o[5] := o[4]*o[4];
-      o[6] := o[5]*o[5];
-      o[7] := o[4]*o[5]*o[6]*taug;
-      o[8] := o[4]*o[5]*taug;
-      o[9] := o[2]*o[4]*o[5];
-      o[10] := pi*pi;
-      o[11] := o[10]*o[10];
-      o[12] := o[4]*o[6]*taug;
-      o[13] := o[6]*o[6];
-
-      gpi23 := (1.0 + pi*(-0.0017731742473213 + taug*(-0.017834862292358 +
-        taug*(-0.045996013696365 + (-0.057581259083432 - 0.05032527872793*o[3])
-        *taug)) + pi*(taug*(-0.000066065283340406 + (-0.0003789797503263 + o[
-        2]*(-0.007878555448671 + o[3]*(-0.087594591301146 -
-        0.000053349095828174*o[7])))*taug) + pi*(6.1445213076927e-8 + (
-        1.31612001853305e-6 + o[2]*(-0.00009683303171571 + o[3]*(-0.0045101773626444
-         - 0.122004760687947*o[7])))*taug + pi*(taug*(-3.15389238237468e-9 +
-        (5.116287140914e-8 + 1.92901490874028e-6*taug)*taug) + pi*(
-        0.0000114610381688305*o[2]*o[4]*taug + pi*(o[3]*(-1.00288598706366e-10
-         + o[8]*(-0.012702883392813 - 143.374451604624*o[2]*o[6]*taug)) + pi*
-        (-4.1341695026989e-17 + o[2]*o[5]*(-8.8352662293707e-6 -
-        0.272627897050173*o[9])*taug + pi*(o[5]*(9.0049690883672e-11 -
-        65.8490727183984*o[4]*o[5]*o[6]) + pi*(1.78287415218792e-7*o[8] + pi*
-        (o[4]*(1.0406965210174e-18 + o[2]*(-1.0234747095929e-12 -
-        1.0018179379511e-8*o[4])*o[4]) + o[10]*o[11]*((-1.29412653835176e-9
-         + 1.71088510070544*o[12])*o[7] + o[10]*(-6.05920510335078*o[13]*o[5]
-        *o[6]*taug + o[10]*(o[4]*o[6]*(1.78371690710842e-23 + o[2]*o[4]*o[5]*
-        (6.1258633752464e-12 - 0.000084004935396416*o[8])*taug) + pi*(-1.24017662339842e-24
-        *o[12] + pi*(0.0000832192847496054*o[13]*o[4]*o[6]*taug + pi*(o[2]*o[
-        5]*o[6]*(1.75410265428146e-27 + (1.32995316841867e-15 -
-        0.0000226487297378904*o[2]*o[6])*o[9])*pi - 2.93678005497663e-14*o[13]
-        *o[2]*o[4]*taug)))))))))))))))))/pi;
-      d := p/(data.RH2O*T*pi*gpi23);
-    end dofp23;
-
-    function dofpt3 "inverse iteration in region 3: (d) = f(p,T)"
-      import ThermoSysPro;
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature (K)";
-      input Units.SI.Pressure delp "iteration converged if (p-pre(p) < delp)";
-      output Units.SI.Density d "density";
-      output Integer error=0 "error flag: iteration failed if different from 0";
-    protected
-      Units.SI.Density dguess "guess density";
-      Integer i=0 "loop counter";
-      Real dp "pressure difference";
-      Units.SI.Density deld "density step";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.NewtonDerivatives_pT nDerivs
-        "derivatives needed in Newton iteration";
-      Boolean found=false "flag for iteration success";
-      Boolean supercritical "flag, true for supercritical states";
-      Boolean liquid "flag, true for liquid states";
-      Units.SI.Density dmin "lower density limit";
-      Units.SI.Density dmax "upper density limit";
-      Units.SI.Temperature Tmax "maximum temperature";
-    algorithm
-      assert(p >= data.PLIMIT4A,
-        "BaseIF97.dofpt3: function called outside of region 3! p too low\n" +
-        "p = " + String(p) + " Pa < " + String(data.PLIMIT4A) + " Pa");
-      assert(T >= data.TLIMIT1,
-        "BaseIF97.dofpt3: function called outside of region 3! T too low\n" +
-        "T = " + String(T) + " K < " + String(data.TLIMIT1) + " K");
-      assert(p >= Regions.boundary23ofT(T),
-        "BaseIF97.dofpt3: function called outside of region 3! T too high\n" +
-        "p = " + String(p) + " Pa, T = " + String(T) + " K");
-      supercritical := p > data.PCRIT;
-      dmax := dofp13(p);
-      dmin := dofp23(p);
-      Tmax := Regions.boundary23ofp(p);
-      if supercritical then
-        dguess := dmin + (T - data.TLIMIT1)/(data.TLIMIT1 - Tmax)*(dmax -
-          dmin);
-        //this may need improvement!!
-      else
-        liquid := T < Basic.tsat(p);
-        if liquid then
-          dguess := 0.5*(Regions.rhol_p_R4b(p) + dmax);
-        else
-          dguess := 0.5*(Regions.rhov_p_R4b(p) + dmin);
-        end if;
-      end if;
-      while ((i < IterationData.IMAX) and not found) loop
-        d := dguess;
-        f := Basic.f3(d, T);
-        nDerivs :=ThermoSysPro.Properties.Common.Helmholtz_pT(f);
-        dp := nDerivs.p - p;
-        if (abs(dp/p) <= delp) then
-          found := true;
-        end if;
-        deld := dp/nDerivs.pd;
-        d := d - deld;
-        if d > dmin and d < dmax then
-          dguess := d;
-        else
-          if d > dmax then
-            dguess := dmax - sqrt(Modelica.Constants.eps);
-              // put it on the correct spot just inside the boundary here instead
-          else
-            dguess := dmin + sqrt(Modelica.Constants.eps);
-          end if;
-        end if;
-        i := i + 1;
-      end while;
-      if not found then
-        error := 1;
-      end if;
-      assert(error <> 1, "error in inverse function dofpt3: iteration failed");
-    end dofpt3;
-
-    // for all iteration functions: project to bounadries possible
-    // if p is input. Step 1 get dofpt_efficient(p,T) at boundary
-    // for T, use boundary itself if off limits, for d a bit inside
-
-    function dtofph3 "inverse iteration in region 3: (d,T) = f(p,h)"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Units.SI.Pressure delp "iteration accuracy";
-      input Units.SI.SpecificEnthalpy delh "iteration accuracy";
-      output Units.SI.Density d "density";
-      output Units.SI.Temperature T "temperature (K)";
-      output Integer error "error flag: iteration failed if different from 0";
-    protected
-      Units.SI.Temperature Tguess "initial temperature";
-      Units.SI.Density dguess "initial density";
-      Integer i "iteration counter";
-      Real dh "Newton-error in h-direction";
-      Real dp "Newton-error in p-direction";
-      Real det "determinant of directional derivatives";
-      Real deld "Newton-step in d-direction";
-      Real delt "Newton-step in T-direction";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.NewtonDerivatives_ph nDerivs
-        "derivatives needed in Newton iteration";
-      Boolean found=false "flag for iteration success";
-      Integer subregion "1 for subregion 3a, 2 for subregion 3b";
-    algorithm
-      if p < data.PCRIT then
-        // allow a 10 J margin inside the (well approximated) phase boundary
-        subregion := if h < (Regions.hl_p(p) + 10.0) then 1 else
-          if h > (Regions.hv_p(p) - 10.0) then 2 else 0;
-        assert(subregion <> 0,"inverse iteration of dt from ph called in 2 phase region: this can not work");
-      else
-        //supercritical
-        subregion := if h < Basic.h3ab_p(p) then 1 else 2;
-      end if;
-      T := if subregion == 1 then Basic.T3a_ph(p,h) else Basic.T3b_ph(p,h);
-      d := if subregion == 1 then 1/Basic.v3a_ph(p,h) else 1/Basic.v3b_ph(p,h);
-      i := 0;
-      error := 0;
-      while ((i < IterationData.IMAX) and not found) loop
-        f := Basic.f3(d, T);
-        nDerivs :=ThermoSysPro.Properties.Common.Helmholtz_ph(f);
-        dh := nDerivs.h - h;
-        dp := nDerivs.p - p;
-        if ((abs(dh/h) <= delh) and (abs(dp/p) <= delp)) then
-          found := true;
-        end if;
-        det := nDerivs.ht*nDerivs.pd - nDerivs.pt*nDerivs.hd;
-        delt := (nDerivs.pd*dh - nDerivs.hd*dp)/det;
-        deld := (nDerivs.ht*dp - nDerivs.pt*dh)/det;
-        T := T - delt;
-        d := d - deld;
-        dguess := d;
-        Tguess := T;
-        i := i + 1;
-        (d,T) := fixdT(dguess, Tguess);
-      end while;
-      if not found then
-        error := 1;
-      end if;
-      assert(error <> 1,
-        "error in inverse function dtofph3: iteration failed");
-    end dtofph3;
-
-    function dtofps3 "inverse iteration in region 3: (d,T) = f(p,s)"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Units.SI.Pressure delp "iteration accuracy";
-      input Units.SI.SpecificEntropy dels "iteration accuracy";
-      output Units.SI.Density d "density";
-      output Units.SI.Temperature T "temperature (K)";
-      output Integer error "error flag: iteration failed if different from 0";
-    protected
-      Units.SI.Temperature Tguess "initial temperature";
-      Units.SI.Density dguess "initial density";
-      Integer i "iteration counter";
-      Real ds "Newton-error in s-direction";
-      Real dp "Newton-error in p-direction";
-      Real det "determinant of directional derivatives";
-      Real deld "Newton-step in d-direction";
-      Real delt "Newton-step in T-direction";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.NewtonDerivatives_ps nDerivs
-        "derivatives needed in Newton iteration";
-      Boolean found "flag for iteration success";
-      Integer subregion "1 for subregion 3a, 2 for subregion 3b";
-    algorithm
-      i := 0;
-      error := 0;
-      found := false;
-      if p < data.PCRIT then
-        // allow a 1 J/K margin inside the (well approximated) phase boundary
-        subregion := if s < (Regions.sl_p(p) + 10.0) then 1 else
-          if s > (Regions.sv_p(p) - 10.0) then 2 else 0;
-        assert(subregion <> 0,"inverse iteration of dt from ps called in 2 phase region: this is illegal!");
-      else
-        subregion := if s < data.SCRIT then 1 else 2;
-      end if;
-      T := if subregion == 1 then Basic.T3a_ps(p,s) else Basic.T3b_ps(p,s);
-      d := if subregion == 1 then 1/Basic.v3a_ps(p,s) else 1/Basic.v3b_ps(p,s);
-      while ((i < IterationData.IMAX) and not found) loop
-        f := Basic.f3(d, T);
-        nDerivs :=ThermoSysPro.Properties.Common.Helmholtz_ps(f);
-        ds := nDerivs.s - s;
-        dp := nDerivs.p - p;
-        if ((abs(ds/s) <= dels) and (abs(dp/p) <= delp)) then
-          found := true;
-        end if;
-        det := nDerivs.st*nDerivs.pd - nDerivs.pt*nDerivs.sd;
-        delt := (nDerivs.pd*ds - nDerivs.sd*dp)/det;
-        deld := (nDerivs.st*dp - nDerivs.pt*ds)/det;
-        T := T - delt;
-        d := d - deld;
-        dguess := d;
-        Tguess := T;
-        i := i + 1;
-        (d,T) := fixdT(dguess, Tguess);
-      end while;
-      if not found then
-        error := 1;
-      end if;
-      assert(error <> 1,
-        "error in inverse function dtofps3: iteration failed");
-    end dtofps3;
-
-    function dtofpsdt3 "inverse iteration in region 3: (d,T) = f(p,s)"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Units.SI.Density dguess "guess density, e.g. from adjacent volume";
-      input Units.SI.Temperature Tguess
-        "guess temperature, e.g. from adjacent volume";
-      input Units.SI.Pressure delp "iteration accuracy";
-      input Units.SI.SpecificEntropy dels "iteration accuracy";
-      output Units.SI.Density d "density";
-      output Units.SI.Temperature T "temperature (K)";
-      output Integer error "error flag: iteration failed if different from 0";
-    protected
-      Integer i "iteration counter";
-      Real ds "Newton-error in s-direction";
-      Real dp "Newton-error in p-direction";
-      Real det "determinant of directional derivatives";
-      Real deld "Newton-step in d-direction";
-      Real delt "Newton-step in T-direction";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.NewtonDerivatives_ps nDerivs
-        "derivatives needed in Newton iteration";
-      Boolean found "flag for iteration success";
-      Units.SI.Density diter "density";
-      Units.SI.Temperature Titer "temperature (K)";
-    algorithm
-      i := 0;
-      error := 0;
-      found := false;
-      (diter,Titer) := fixdT(dguess, Tguess);
-      while ((i < IterationData.IMAX) and not found) loop
-        (d,T) := fixdT(diter, Titer);
-        f := Basic.f3(d, T);
-        nDerivs :=ThermoSysPro.Properties.Common.Helmholtz_ps(f);
-        ds := nDerivs.s - s;
-        dp := nDerivs.p - p;
-        if ((abs(ds/s) <= dels) and (abs(dp/p) <= delp)) then
-          found := true;
-        end if;
-        det := nDerivs.st*nDerivs.pd - nDerivs.pt*nDerivs.sd;
-        delt := (nDerivs.pd*ds - nDerivs.sd*dp)/det;
-        deld := (nDerivs.st*dp - nDerivs.pt*ds)/det;
-        T := T - delt;
-        d := d - deld;
-        diter := d;
-        Titer := T;
-        i := i + 1;
-      end while;
-      if not found then
-        error := 1;
-      end if;
-      assert(error <> 1,
-        "error in inverse function dtofpsdt3: iteration failed");
-    end dtofpsdt3;
-
-    function pofdt125 "inverse iteration in region 1,2 and 5: p = g(d,T)"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature (K)";
-      input Units.SI.Pressure reldd "relative iteration accuracy of density";
-      input Integer region
-        "region in IAPWS/IF97 in which inverse should be calculated";
-      output Units.SI.Pressure p "pressure";
-      output Integer error "error flag: iteration failed if different from 0";
-    protected
-      Integer i "counter for while-loop";
-      ThermoSysPro.Properties.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      Boolean found "flag if iteration has been successful";
-      Real dd
-        "difference between density for  guessed p and the current density";
-      Real delp "step in p in Newton-iteration";
-      Real relerr "relative error in d";
-      Units.SI.Pressure pguess1=1.0e6 "initial pressure guess in region 1";
-      Units.SI.Pressure pguess2 "initial pressure guess in region 2";
-      constant Units.SI.Pressure pguess5=0.5e6
-        "initial pressure guess in region 5";
-    algorithm
-      i := 0;
-      error := 0;
-      pguess2 := 42800*d;
-      found := false;
-      if region == 1 then
-        p := pguess1;
-      elseif region == 2 then
-        p := pguess2;
-      else
-        p := pguess5;
-      end if;
-      while ((i < IterationData.IMAX) and not found) loop
-        if region == 1 then
-          g := Basic.g1(p, T);
-        elseif region == 2 then
-          g := Basic.g2(p, T);
-        else
-          g := Basic.g5(p, T);
-        end if;
-        dd := p/(data.RH2O*T*g.pi*g.gpi) - d;
-        relerr := dd/d;
-        if (abs(relerr) < reldd) then
-          found := true;
-        end if;
-        delp := dd*(-p*p/(d*d*data.RH2O*T*g.pi*g.pi*g.gpipi));
-        p := p - delp;
-        i := i + 1;
-        if not found then
-          if p < triple.ptriple then
-            p := 2.0*triple.ptriple;
-          end if;
-          if p > data.PLIMIT1 then
-            p := 0.95*data.PLIMIT1;
-          end if;
-        end if;
-      end while;
-
-        // print("i = " + i2s(i) + ", p = " + r2s(p/1.0e5) + ", delp = " + r2s(delp*1.0e-5) + "\n");
-      if not found then
-        error := 1;
-      end if;
-      assert(error <> 1,
-        "error in inverse function pofdt125: iteration failed");
-    end pofdt125;
-
-    function tofph5 "inverse iteration in region 5: (p,T) = f(p,h)"
-      import ThermoSysPro;
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Units.SI.SpecificEnthalpy reldh "iteration accuracy";
-      output Units.SI.Temperature T "temperature (K)";
-      output Integer error "error flag: iteration failed if different from 0";
-
-    protected
-      ThermoSysPro.Properties.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      Units.SI.SpecificEnthalpy proh "h for current guess in T";
-      constant Units.SI.Temperature Tguess=1500 "initial temperature";
-      Integer i "iteration counter";
-      Real relerr "relative error in h";
-      Real dh "Newton-error in h-direction";
-      Real dT "Newton-step in T-direction";
-      Boolean found "flag for iteration success";
-    algorithm
-      i := 0;
-      error := 0;
-      T := Tguess;
-      found := false;
-      while ((i < IterationData.IMAX) and not found) loop
-        g := Basic.g5(p, T);
-        proh := data.RH2O*T*g.tau*g.gtau;
-        dh := proh - h;
-        relerr := dh/h;
-        if (abs(relerr) < reldh) then
-          found := true;
-        end if;
-        dT := dh/(-data.RH2O*g.tau*g.tau*g.gtautau);
-        T := T - dT;
-        i := i + 1;
-      end while;
-      if not found then
-        error := 1;
-      end if;
-      assert(error <> 1, "error in inverse function tofph5: iteration failed");
-    end tofph5;
-
-    function tofps5 "inverse iteration in region 5: (p,T) = f(p,s)"
-      import ThermoSysPro;
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Units.SI.SpecificEnthalpy relds "iteration accuracy";
-      output Units.SI.Temperature T "temperature (K)";
-      output Integer error "error flag: iteration failed if different from 0";
-
-    protected
-      ThermoSysPro.Properties.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      Units.SI.SpecificEntropy pros "s for current guess in T";
-      parameter Units.SI.Temperature Tguess=1500 "initial temperature";
-      Integer i "iteration counter";
-      Real relerr "relative error in s";
-      Real ds "Newton-error in s-direction";
-      Real dT "Newton-step in T-direction";
-      Boolean found "flag for iteration success";
-    algorithm
-      i := 0;
-      error := 0;
-      T := Tguess;
-      found := false;
-      while ((i < IterationData.IMAX) and not found) loop
-        g := Basic.g5(p, T);
-        pros := data.RH2O*(g.tau*g.gtau - g.g);
-        ds := pros - s;
-        relerr := ds/s;
-        if (abs(relerr) < relds) then
-          found := true;
-        end if;
-        dT := ds*T/(-data.RH2O*g.tau*g.tau*g.gtautau);
-        T := T - dT;
-        i := i + 1;
-      end while;
-      if not found then
-        error := 1;
-      end if;
-      assert(error <> 1, "error in inverse function tofps5: iteration failed");
-    end tofps5;
-
-    function tofpst5 "inverse iteration in region 5: (p,T) = f(p,s)"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Units.SI.Temperature Tguess
-        "guess temperature, e.g. from adjacent volume";
-      input Units.SI.SpecificEntropy relds "iteration accuracy";
-      output Units.SI.Temperature T "temperature (K)";
-      output Integer error "error flag: iteration failed if different from 0";
-
-    protected
-      ThermoSysPro.Properties.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      Units.SI.SpecificEntropy pros "s for current guess in T";
-      Integer i "iteration counter";
-      Real relerr "relative error in s";
-      Real ds "Newton-error in s-direction";
-      Real dT "Newton-step in T-direction";
-      Boolean found "flag for iteration success";
-    algorithm
-      i := 0;
-      error := 0;
-      T := Tguess;
-      found := false;
-      while ((i < IterationData.IMAX) and not found) loop
-        g := Basic.g5(p, T);
-        pros := data.RH2O*(g.tau*g.gtau - g.g);
-        ds := pros - s;
-        relerr := ds/s;
-        if (abs(relerr) < relds) then
-          found := true;
-        end if;
-        dT := ds*T/(-data.RH2O*g.tau*g.tau*g.gtautau);
-        T := T - dT;
-        i := i + 1;
-      end while;
-      if not found then
-        error := 1;
-      end if;
-      assert(error <> 1,
-        "error in inverse function tofpst5: iteration failed");
-    end tofpst5;
-
-    annotation (Documentation(info="<HTML><h4>Package description</h4>
-          <p></p>
-          <h4>Package contents</h4>
-          <p>
-          <ul>
-          <li>Function <b>fixdT</b> constrains density and temperature to allowed region</li>
-          <li>Function <b>dofp13</b> computes d as a function of p at boundary between regions 1 and 3</li>
-          <li>Function <b>dofp23</b> computes d as a function of p at boundary between regions 2 and 3</li>
-          <li>Function <b>dofpt3</b> iteration to compute d as a function of p and T in region 3</li>
-          <li>Function <b>dtofph3</b> iteration to compute d and T as a function of p and h in region 3</li>
-          <li>Function <b>dtofps3</b> iteration to compute d and T as a function of p and s in region 3</li>
-          <li>Function <b>dtofpsdt3</b> iteration to compute d and T as a function of p and s in region 3,
-          with initial guesses</li>
-          <li>Function <b>pofdt125</b> iteration to compute p as a function of p and T in regions 1, 2 and 5</li>
-          <li>Function <b>tofph5</b> iteration to compute T as a function of p and h in region 5</li>
-          <li>Function <b>tofps5</b> iteration to compute T as a function of p and s in region 5</li>
-          <li>Function <b>tofpst5</b> iteration to compute T as a function of p and s in region 5, with initial guess in T</li>
-          <li>Function <b></b></li>
-          </ul>
-          </p>
-          <h4>Version Info and Revision history
-          </h4>
-          <ul>
-          <li>First implemented: <i>July, 2000</i>
-          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-          </li>
-          </ul>
-          <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
-          </address>
-          <ul>
-          <li>Initial version: July 2000</li>
-          <li>Documentation added: December 2002</li>
-          </ul>
-          </HTML>
-          "), Icon(graphics={
-          Text(
-            extent={{-102,0},{24,-26}},
-            lineColor={242,148,0},
-            textString=
-                 "Thermo"),
-          Text(
-            extent={{-4,8},{68,-34}},
-            lineColor={46,170,220},
-            textString=
-                 "SysPro"),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
-                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
-                -50,6},{-62,2}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
-                8},{-42,22},{-42,30},{-44,38}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
-                12},{-26,12},{-28,12},{-26,20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,30},{-6,26}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,36},{-6,32}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,42},{-6,38}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,48},{-6,44}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,32},{-2,28}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,38},{-2,34}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,44},{-2,40}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,50},{-2,46}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
-                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
-                -50,6},{-62,2}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Line(
-            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-            color={46,170,220},
-            thickness=0.5),
-          Polygon(
-            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-          Line(
-            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-            color={0,0,255},
-            smooth=Smooth.None),
-          Line(
-            points={{80,80},{100,100}},
-            color={0,0,255},
-            smooth=Smooth.None)}));
-  end Inverses;
-
-  package TwoPhase
-    "steam properties in the two-phase rgion and on the phase boundaries"
-
-    function waterLiq_p "properties on the liquid phase boundary of region 4"
-      import ThermoSysPro;
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output ThermoSysPro.Properties.Common.PhaseBoundaryProperties liq
-        "liquid thermodynamic property collection";
-    protected
-      Units.SI.Temperature Tsat "saturation temperature";
-      Real dpT "derivative of saturation pressure wrt temperature";
-      Units.SI.Density dl "liquid density";
-      ThermoSysPro.Properties.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-    algorithm
-      Tsat := Basic.tsat(p);
-      dpT := Basic.dptofT(Tsat);
-      if p < data.PLIMIT4A then
-        g := Basic.g1(p, Tsat);
-        liq :=ThermoSysPro.Properties.Common.gibbsToBoundaryProps(g);
-      else
-        dl := Regions.rhol_p_R4b(p);
-        f := Basic.f3(dl, Tsat);
-        liq :=ThermoSysPro.Properties.Common.helmholtzToBoundaryProps(f);
-      end if;
-    end waterLiq_p;
-
-    function waterVap_p "properties on the vapour phase boundary of region 4"
-      import ThermoSysPro;
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      output ThermoSysPro.Properties.Common.PhaseBoundaryProperties vap
-        "vapour thermodynamic property collection";
-    protected
-      Units.SI.Temperature Tsat "saturation temperature";
-      Real dpT "derivative of saturation pressure wrt temperature";
-      Units.SI.Density dv "vapour density";
-      ThermoSysPro.Properties.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-    algorithm
-      Tsat := Basic.tsat(p);
-      dpT := Basic.dptofT(Tsat);
-      if p < data.PLIMIT4A then
-        g := Basic.g2(p, Tsat);
-        vap :=ThermoSysPro.Properties.Common.gibbsToBoundaryProps(g);
-      else
-        dv := Regions.rhov_p_R4b(p);
-        f := Basic.f3(dv, Tsat);
-        vap :=ThermoSysPro.Properties.Common.helmholtzToBoundaryProps(f);
-      end if;
-    end waterVap_p;
-
-    function waterSat_ph
-      "Water saturation properties in the 2-phase region (4) as f(p,h)"
-      import ThermoSysPro;
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output ThermoSysPro.Properties.Common.SaturationProperties pro
-        "thermodynamic property collection";
-    protected
-      Units.SI.Density dl "liquid density";
-      Units.SI.Density dv "vapour density";
-      ThermoSysPro.Properties.Common.GibbsDerivs gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.GibbsDerivs gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-    algorithm
-      pro.h := h;
-      pro.p := p;
-      pro.T := Basic.tsat(p);
-      pro.dpT := Basic.dptofT(pro.T);
-      if p < data.PLIMIT4A then
-        gl := Basic.g1(p, pro.T);
-        gv := Basic.g2(p, pro.T);
-        pro.liq :=ThermoSysPro.Properties.Common.gibbsToBoundaryProps(gl);
-        pro.vap :=ThermoSysPro.Properties.Common.gibbsToBoundaryProps(gv);
-      else
-        dl := Regions.rhol_p_R4b(p);
-        dv := Regions.rhov_p_R4b(p);
-        fl := Basic.f3(dl, pro.T);
-        fv := Basic.f3(dv, pro.T);
-        pro.liq :=ThermoSysPro.Properties.Common.helmholtzToBoundaryProps(fl);
-        pro.vap :=ThermoSysPro.Properties.Common.helmholtzToBoundaryProps(fv);
-      end if;
-      pro.x := if (h < pro.liq.h) then 0.0 else if (pro.vap.h <> pro.liq.h) then
-              (h - pro.liq.h)/(pro.vap.h - pro.liq.h) else 1.0;
-      pro.d := pro.liq.d*pro.vap.d/(pro.vap.d + pro.x*(pro.liq.d - pro.vap.d));
-      pro.u := pro.x*pro.vap.u + (1 - pro.x)*pro.liq.u;
-      pro.s := pro.x*pro.vap.s + (1 - pro.x)*pro.liq.s;
-      pro.cp := Modelica.Constants.inf;
-      pro.cv :=ThermoSysPro.Properties.Common.cv2Phase(
-            pro.liq,
-            pro.vap,
-            pro.x,
-            pro.T,
-            p);
-      pro.kappa := 1/(pro.d*p)*pro.dpT*pro.dpT*pro.T/pro.cv;
-      pro.R := data.RH2O;
-    end waterSat_ph;
-
-    function waterR4_ph
-      "Water/Steam properties in region 4 of IAPWS/IF97 (two-phase)"
-      import ThermoSysPro;
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-        "thermodynamic property collection";
-    protected
-      Units.SI.Density dl "liquid density";
-      Units.SI.Density dv "vapour density";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties vap
-        "phase boundary property record";
-      ThermoSysPro.Properties.Common.GibbsDerivs gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.GibbsDerivs gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Units.SI.SpecificHeatCapacity cv;
-      Real dpT "derivative of saturation curve";
-    algorithm
-      pro.T := Basic.tsat(p);
-      dpT := Basic.dptofT(pro.T);
-      dl := Regions.rhol_p_R4b(p);
-      dv := Regions.rhov_p_R4b(p);
-      if p < data.PLIMIT4A then
-        gl := Basic.g1(p, pro.T);
-        gv := Basic.g2(p, pro.T);
-        liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
-        vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
-      else
-        fl := Basic.f3(dl, pro.T);
-        fv := Basic.f3(dv, pro.T);
-        liq := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
-        vap := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
-      end if;
-      pro.x := if (vap.h <> liq.h) then (h - liq.h)/(vap.h - liq.h) else 1.0;
-      pro.d := liq.d*vap.d/(vap.d + pro.x*(liq.d - vap.d));
-      pro.u := pro.x*vap.u + (1 - pro.x)*liq.u;
-      pro.s := pro.x*vap.s + (1 - pro.x)*liq.s;
-      pro.cp := Modelica.Constants.inf;
-      cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(liq, vap, pro.x, pro.T, p);
-      pro.ddph := pro.d*(pro.d*cv/dpT + 1.0)/(dpT*pro.T);
-      pro.ddhp := -pro.d*pro.d/(dpT*pro.T);
-    end waterR4_ph;
-
-    function waterR4_dT "Water properties in region 4 as function of d and T"
-      import ThermoSysPro;
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "Density";
-      input Units.SI.Temperature T "temperature";
-      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_dT
-                                        pro "thermodynamic property collection";
-    protected
-      Units.SI.Density dl "liquid density";
-      Units.SI.Density dv "vapour density";
-      ThermoSysPro.Properties.Common.PhaseBoundaryProperties liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.Common.PhaseBoundaryProperties vap
-        "phase boundary property record";
-      ThermoSysPro.Properties.Common.GibbsDerivs gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.GibbsDerivs gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Real x "dryness fraction";
-      Real dpT "derivative of saturation curve";
-    algorithm
-      pro.p := Basic.psat(T);
-      dpT := Basic.dptofT(T);
-      dl := Regions.rhol_p_R4b(pro.p);
-      dv := Regions.rhov_p_R4b(pro.p);
-      if pro.p < data.PLIMIT4A then
-        gl := Basic.g1(pro.p, T);
-        gv := Basic.g2(pro.p, T);
-        liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(
-                                           gl);
-        vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(
-                                           gv);
-      else
-        fl := Basic.f3(dl, T);
-        fv := Basic.f3(dv, T);
-        liq := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(
-                                               fl);
-        vap := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(
-                                               fv);
-      end if;
-      x := if (vap.d <> liq.d) then (1/d - 1/liq.d)/(1/vap.d - 1/liq.d) else
-        1.0;
-      pro.u := x*vap.u + (1 - x)*liq.u;
-      pro.h := x*vap.h + (1 - x)*liq.h;
-      pro.cp := Modelica.Constants.inf;
-    //  pro.cv := Modelica.Media.Common.cv2Phase(liq, vap, x, T, pro.p);
-    //   pro.kappa := 1/(d*pro.p)*dpT*dpT*T/pro.cv;
-    //   pro.a := Modelica.Constants.inf;
-    //   pro.R := data.RH2O;
-      pro.dudT := (pro.p - T*dpT)/(d*d);
-    end waterR4_dT;
-    annotation (Documentation(info="<HTML><h4>Package description</h4>
-          <p>Package TwoPhase provides functions to compute the steam properties
-          in the two-phase region and on the phase boundaries</p>
-          <h4>Package contents</h4>
-          <p>
-          <ul>
-          <li>Function <b>WaterLiq_p</b> computes properties on the boiling boundary as a function of p</li>
-          <li>Function <b>WaterVap_p</b> computes properties on the dew line boundary as a function of p</li>
-          <li>Function <b>WaterSat_ph</b> computes properties on both phase boundaries and in the two
-          phase region as a function of p</li>
-          <li>Function <b>WaterR4_ph</b> computes dynamic simulation properties in region 4 with (p,h) as inputs</li>
-          <li>Function <b>WaterR4_dT</b> computes dynamic simulation properties in region 4 with (d,T) as inputs</li>
-          </ul>
-          </p>
-          <h4>Version Info and Revision history
-          </h4>
-          <ul>
-          <li>First implemented: <i>July, 2000</i>
-          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-          </li>
-          </ul>
-          <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
-          </address>
-          <ul>
-          <li>Initial version: July 2000</li>
-          <li>Documented and re-organized: January 2003</li>
-          </ul>
-          </HTML>
-"), Icon(graphics={
-          Text(
-            extent={{-102,0},{24,-26}},
-            lineColor={242,148,0},
-            textString=
-                 "Thermo"),
-          Text(
-            extent={{-4,8},{68,-34}},
-            lineColor={46,170,220},
-            textString=
-                 "SysPro"),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
-                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
-                -50,6},{-62,2}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
-                8},{-42,22},{-42,30},{-44,38}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
-                12},{-26,12},{-28,12},{-26,20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,30},{-6,26}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,36},{-6,32}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,42},{-6,38}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,48},{-6,44}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,32},{-2,28}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,38},{-2,34}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,44},{-2,40}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,50},{-2,46}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
-                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
-                -50,6},{-62,2}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Line(
-            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-            color={46,170,220},
-            thickness=0.5),
-          Polygon(
-            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-          Line(
-            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-            color={0,0,255},
-            smooth=Smooth.None),
-          Line(
-            points={{80,80},{100,100}},
-            color={0,0,255},
-            smooth=Smooth.None)}));
-  end TwoPhase;
-  annotation (Documentation(info="<HTML>
-    <h4>Version Info and Revision history
-        </h4>
-        <ul>
-        <li>First implemented: <i>July, 2000</i>
-        by Hubertus Tummescheit
-        for the ThermoFluid Library with help from Jonas Eborn and Falko Jens Wagner
-        </li>
-      <li>Code reorganization, enhanced documentation, additional functions:   <i>December, 2002</i>
-      by <a href=\"mailto:Hubertus.Tummescheit@modelon.se\">Hubertus Tummescheit</a> and moved to Modelica
-      properties library.</li>
-        </ul>
-      <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
-      </address>
-        <P>In September 1997, the International Association for the Properties
-        of Water and Steam (<A HREF=\"http://www.iapws.org\">IAPWS</A>) adopted a
-        new formulation for the thermodynamic properties of water and steam for
-        industrial use. This new industrial standard is called \"IAPWS Industrial
-        Formulation for the Thermodynamic Properties of Water and Steam\" (IAPWS-IF97).
-        The formulation IAPWS-IF97 replaces the previous industrial standard IFC-67.
-        <P>Based on this new formulation, a new steam table, titled \"<a
-        href=\"http://www.springer.de/cgi-bin/search_book.pl?isbn=3-540-64339-7\">Properties
-        of Water and Steam</a>\" by W. Wagner and A. Kruse, was published by
-        the Springer-Verlag, Berlin - New-York - Tokyo in April 1998. This
-        steam table, ref. <a href=\"#steamprop\">[1]</a> is bilingual (English /
-        German) and contains a complete description of the equations of
-        IAPWS-IF97. This reference is the authoritative source of information
-        for this implementation. A mostly identical version has been published by the International
-        Association for the Properties
-        of Water and Steam (<A HREF=\"http://www.iapws.org\">IAPWS</A>) with permission granted to re-publish the
-        information if credit is given to IAPWS. This document is distributed with this library as
-        <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a>.
-        In addition, the equations published by <A HREF=\"http://www.iapws..org\">IAPWS</A> for
-        the transport properties dynamic viscosity (standards document: <a href=\"IF97documentation/visc.pdf\">visc.pdf</a>)
-        and thermal conductivity (standards document: <a href=\"IF97documentation/thcond.pdf\">thcond.pdf</a>)
-        and equations for the surface tension (standards document: <a href=\"IF97documentation/surf.pdf\">surf.pdf</a>)
-        are also implemented in this library and included for reference.
-        <P>
-        The functions in BaseIF97.mo are low level functions which should
-        only be used in those exceptions when the standard user level
-        functions in Water.mo do not contain the wanted properties.
-        </p>
-<P>Based on IAPWS-IF97, Modelica functions are available for calculating
-the most common thermophysical properties (thermodynamic and transport
-properties). The implementation requires part of the common medium
-property infrastructure of the Modelica.Thermal.Properties library in the file
-Common.mo. There are a few extensions from the version of IF97 as
-documented in <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a> in order to improve performance for
-dynamic simulations. Input variables for calculating the properties are
-only implemented for a limited number of variable pairs which make sense as dynamic states: (p,h), (p,T), (p,s) and (d,T).
-<hr size=3 width=\"70%\">
-<p><a name=\"regions\"><h4>1. Structure and Regions of IAPWS-IF97</h4></a>
-<P>The IAPWS Industrial Formulation 1997 consists of
-a set of equations for different regions which cover the following range
-of validity:
-<table border=0 cellpadding=4 align=center>
-<tr>
-<td valign=\"top\">273,15 K &lt; <I>T</I> &lt; 1073,15 K</td>
-<td valign=\"top\"><I>p</I> &lt; 100 MPa</td>
-</tr>
-<tr>
-<td valign=\"top\">1073,15 K &lt; <I>T</I> &lt; 2273,15 K</td>
-<td valign=\"top\"><I>p</I> &lt; 10 MPa</td>
-</tr>
-</table><br>
-Figure 1 shows the 5 regions into which the entire range of validity of
-IAPWS-IF97 is divided. The boundaries of the regions can be directly taken
-from Fig. 1 except for the boundary between regions 2 and 3; this boundary,
-which corresponds approximately to the isentropic line <nobr><I>s</I> = 5.047 kJ kg
-<FONT SIZE=-1><sup>-1</sup></FONT>
-K<FONT SIZE=-1><sup>-1</sup></FONT>,</nobr> is defined
-by a corresponding auxiliary equation. Both regions 1 and 2 are individually
-covered by a fundamental equation for the specific Gibbs free energy <nobr><I>g</I>(<I>
-p</I>,<I>T </I>)</nobr>, region 3 by a fundamental equation for the specific Helmholtz
-free energy <nobr><I>f </I>(<I> <FONT FACE=\"Symbol\">r</FONT></I>,<I>T
-</I>)</nobr>, and the saturation curve, corresponding to region 4, by a saturation-pressure
-equation <nobr><I>p</I><FONT SIZE=-1><sub>s</sub></FONT>(<I>T</I>)</nobr>. The high-temperature
-region 5 is also covered by a <nobr><I>g</I>(<I> p</I>,<I>T </I>)</nobr> equation. These
-5 equations, shown in rectangular boxes in Fig. 1, form the so-called <I>basic
-equations</I>.
-      <p>
-      <img src=\"IF97documentation/if97.png\" alt=\"Regions and equations of IAPWS-IF97\"></p>
-      <p align=center>Figure 1: Regions and equations of IAPWS-IF97</p>
-<P>In addition to these basic equations, so-called <I>backward
-equations</I> are provided for regions 1, 2, and 4 in form of
-<nobr><I>T </I>(<I> p</I>,<I>h </I>)</nobr> and <nobr><I>T </I>(<I>
-p</I>,<I>s </I>)</nobr> for regions 1 and 2, and <nobr><I>T</I><FONT
-SIZE=-1><sub>s</sub> </FONT>(<I> p </I>)</nobr> for region 4. These
-backward equations, marked in grey in Fig. 1, were developed in such a
-way that they are numerically very consistent with the corresponding
-basic equation. Thus, properties as functions of&nbsp; <I>p</I>,<I>h
-</I>and of&nbsp;<I> p</I>,<I>s </I>for regions 1 and 2, and of
-<I>p</I> for region 4 can be calculated without any iteration. As a
-result of this special concept for the development of the new
-industrial standard IAPWS-IF97, the most important properties can be
-calculated extremely quickly. All modelica functions are optimized
-with regard to short computing times.
-<P>The complete description of the individual equations of the new industrial
-formulation IAPWS-IF97 is given in <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a>. Comprehensive information on
-IAPWS-IF97 (requirements, concept, accuracy, consistency along region boundaries,
-and the increase of computing speed in comparison with IFC-67, etc.) can
-be taken from <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a> or [2].
-<P><a name=\"steamprop\">[1]<I>Wagner, W., Kruse, A.</I> Properties of Water
-and Steam / Zustandsgr&ouml;&szlig;en von Wasser und Wasserdampf / IAPWS-IF97.
-Springer-Verlag, Berlin, 1998.
-<P>[2] <I>Wagner, W., Cooper, J. R., Dittmann, A., Kijima,
-J., Kretzschmar, H.-J., Kruse, A., Mare� R., Oguchi, K., Sato, H., St&ouml;cker,
-I., �fner, O., Takaishi, Y., Tanishita, I., Tr&uuml;benbach, J., and Willkommen,
-Th.</I> The IAPWS Industrial Formulation 1997 for the Thermodynamic Properties
-of Water and Steam. ASME Journal of Engineering for Gas Turbines and Power 122 (2000), 150 - 182.
-<p>
-<HR size=3 width=\"90%\">
-<h4>2. Calculable Properties      </h4>
-<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">
-       <tbody>
-       <tr>
-       <td valign=\"top\" bgcolor=\"#cccccc\"><br>
-      </td>
-      <td valign=\"top\" bgcolor=\"#cccccc\"><b>Common name</b><br>
-       </td>
-       <td valign=\"top\" bgcolor=\"#cccccc\"><b>Abbreviation </b><br>
-       </td>
-       <td valign=\"top\" bgcolor=\"#cccccc\"><b>Unit</b><br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">&nbsp;1<br>
-      </td>
-      <td valign=\"top\">Pressure</td>
-       <td valign=\"top\">p<br>
-        </td>
-       <td valign=\"top\">Pa<br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">&nbsp;2<br>
-      </td>
-      <td valign=\"top\">Temperature</td>
-       <td valign=\"top\">T<br>
-       </td>
-       <td valign=\"top\">K<br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">&nbsp;3<br>
-      </td>
-      <td valign=\"top\">Density</td>
-        <td valign=\"top\">d<br>
-        </td>
-       <td valign=\"top\">kg/m<sup>3</sup><br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">&nbsp;4<br>
-      </td>
-      <td valign=\"top\">Specific volume</td>
-        <td valign=\"top\">v<br>
-        </td>
-       <td valign=\"top\">m<sup>3</sup>/kg<br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">&nbsp;5<br>
-      </td>
-      <td valign=\"top\">Specific enthalpy</td>
-       <td valign=\"top\">h<br>
-       </td>
-       <td valign=\"top\">J/kg<br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">&nbsp;6<br>
-      </td>
-      <td valign=\"top\">Specific entropy</td>
-       <td valign=\"top\">s<br>
-       </td>
-       <td valign=\"top\">J/(kg K)<br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">&nbsp;7<br>
-      </td>
-      <td valign=\"top\">Specific internal energy<br>
-       </td>
-       <td valign=\"top\">u<br>
-       </td>
-       <td valign=\"top\">J/kg<br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">&nbsp;8<br>
-      </td>
-      <td valign=\"top\">Specific isobaric heat capacity</td>
-       <td valign=\"top\">c<font size=\"-1\"><sub>p</sub></font><br>
-       </td>
-       <td valign=\"top\">J/(kg K)<br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">&nbsp;9<br>
-      </td>
-      <td valign=\"top\">Specific isochoric heat capacity</td>
-       <td valign=\"top\">c<font size=\"-1\"><sub>v</sub></font><br>
-       </td>
-       <td valign=\"top\">J/(kg K)<br>
-       </td>
-       </tr>
-       <tr>
-       <td valign=\"top\">10<br>
-      </td>
-      <td valign=\"top\">Isentropic exponent, kappa<nobr>=       <font face=\"Symbol\">-</font>(v/p)
-(dp/dv)<font size=\"-1\"><sub>s</sub> </font></nobr></td>
-     <td valign=\"top\">kappa (     <font face=\"Symbol\">k</font>)<br>
-     </td>
-     <td valign=\"top\">1<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">11<br>
-      </td>
-      <td valign=\"top\">Speed of sound<br>
-     </td>
-     <td valign=\"top\">a<br>
-     </td>
-     <td valign=\"top\">m/s<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">12<br>
-      </td>
-      <td valign=\"top\">Dryness fraction<br>
-     </td>
-     <td valign=\"top\">x<br>
-     </td>
-     <td valign=\"top\">kg/kg<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">13<br>
-      </td>
-      <td valign=\"top\">Specific Helmholtz free energy,     f = u - Ts</td>
-     <td valign=\"top\">f<br>
-     </td>
-     <td valign=\"top\">J/kg<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">14<br>
-      </td>
-      <td valign=\"top\">Specific Gibbs free energy,     g = h - Ts</td>
-     <td valign=\"top\">g<br>
-     </td>
-     <td valign=\"top\">J/kg<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">15<br>
-      </td>
-      <td valign=\"top\">Isenthalpic exponent, <nobr> theta     = -(v/p)(dp/dv)<font
- size=\"-1\"><sub>h</sub></font></nobr></td>
-     <td valign=\"top\">theta (<font face=\"Symbol\">q</font>)<br>
-     </td>
-     <td valign=\"top\">1<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">16<br>
-      </td>
-      <td valign=\"top\">Isobaric volume expansion coefficient,     alpha = v<font
- size=\"-1\"><sup>-1</sup></font>       (dv/dT)<font size=\"-1\"><sub>p</sub>
-    </font></td>
-     <td valign=\"top\">alpha  (<font face=\"Symbol\">a</font>)<br>
-     </td>
-       <td valign=\"top\">1/K<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">17<br>
-      </td>
-      <td valign=\"top\">Isochoric pressure coefficient,     <nobr>beta = p<font
- size=\"-1\"><sup><font face=\"Symbol\">-</font>1</sup>     </font>(dp/dT)<font
- size=\"-1\"><sub>v</sub></font></nobr>     </td>
-     <td valign=\"top\">beta (<font face=\"Symbol\">b</font>)<br>
-     </td>
-     <td valign=\"top\">1/K<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">18<br>
-      </td>
-      <td valign=\"top\">Isothermal compressibility,     g<nobr>amma  = <font
- face=\"Symbol\">-</font>v        <sup><font size=\"-1\"><font face=\"Symbol\">-</font>1</font></sup>(dv/dp)<font
- size=\"-1\"><sub>T</sub></font></nobr> </td>
-        <td valign=\"top\">gamma (<font face=\"Symbol\">g</font>)<br>
-     </td>
-     <td valign=\"top\">1/Pa<br>
-     </td>
-     </tr>
-     <!-- <tr><td valign=\"top\">f</td><td valign=\"top\">Fugacity</td></tr> --> <tr>
-     <td valign=\"top\">19<br>
-      </td>
-      <td valign=\"top\">Dynamic viscosity</td>
-     <td valign=\"top\">eta (<font face=\"Symbol\">h</font>)<br>
-     </td>
-     <td valign=\"top\">Pa s<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">20<br>
-      </td>
-      <td valign=\"top\">Kinematic viscosity</td>
-     <td valign=\"top\">nu (<font face=\"Symbol\">n</font>)<br>
-     </td>
-     <td valign=\"top\">m<sup>2</sup>/s<br>
-     </td>
-     </tr>
-     <!-- <tr><td valign=\"top\">Pr</td><td valign=\"top\">Prandtl number</td></tr> --> <tr>
-     <td valign=\"top\">21<br>
-      </td>
-      <td valign=\"top\">Thermal conductivity</td>
-     <td valign=\"top\">lambda (<font face=\"Symbol\">l</font>)<br>
-     </td>
-     <td valign=\"top\">W/(m K)<br>
-     </td>
-     </tr>
-     <tr>
-     <td valign=\"top\">22 <br>
-      </td>
-      <td valign=\"top\">Surface tension</td>
-     <td valign=\"top\">sigma (<font face=\"Symbol\">s</font>)<br>
-     </td>
-     <td valign=\"top\">N/m<br>
-     </td>
-     </tr>
-  </tbody>
-</table>
-        <p>The properties 1-11 are calculated by default with the functions for dynamic
-        simulation, 2 of these variables are the dynamic states and are the inputs
-        to calculate all other properties. In addition to these properties
-        of general interest, the entries to the thermodynamic Jacobian matrix which render
-        the mass- and energy balances explicit in the input variables to the property calculation are also calculated.
-        For an explanatory example using pressure and specific enthalpy as states, see the Examples sub-package.</p>
-        <p>The high-level calls to steam properties are grouped into records comprising both the properties of general interest
-        and the entries to the thermodynamic Jacobian. If additional properties are
-        needed the low level functions in BaseIF97 provide more choice.</p>
-        <HR size=3 width=\"90%\">
-        <h4>Additional functions</h4>
-        <ul>
-        <li>Function <b>boundaryvals_p</b> computes the temperature and the specific enthalpy and
-        entropy on both phase boundaries as a function of p</li>
-        <li>Function <b>boundaryderivs_p</b> is the Modelica derivative function of <b>boundaryvals_p</b></li>
-        <li>Function <b>extraDerivs_ph</b> computes all entries to Bridgmans tables for all
-        one-phase regions of IF97 using inputs (p,h). All 336 directional derivatives of the
-        thermodynamic surface can be computed as a ratio of two entries in the return data, see package Common
-        for details.</li>
-        <li>Function <b>extraDerivs_pT</b> computes all entries to Bridgmans tables for all
-        one-phase regions of IF97 using inputs (p,T).</li>
-        </ul>
-        </p>
-        </HTML>"), Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end BaseIF97;
+within ThermoSysPro.Properties.WaterSteam;
+package BaseIF97
+  "Modelica Physical Property Model: the new industrial formulation IAPWS-IF97"
+
+  import      ThermoSysPro.Units.SI;
+  record IterationData "constants for iterations internal to some functions"
+
+    extends Modelica.Icons.Record;
+    constant Integer IMAX=50
+      "maximum number of iterations for inverse functions";
+    constant Real DELP=1.0e-6 "maximum iteration error in pressure, Pa";
+    constant Real DELS=1.0e-8
+      "maximum iteration error in specific entropy, J/{kg.K}";
+    constant Real DELH=1.0e-8
+      "maximum iteration error in specific entthalpy, J/kg";
+    constant Real DELD=1.0e-8 "maximum iteration error in density, kg/m^3";
+  end IterationData;
+  //===================================================================
+  //                      Constant declarations
+
+  //===================================================================
+  record data "constant IF97 data and region limits"
+    extends Modelica.Icons.Record;
+    constant Units.SI.SpecificHeatCapacity RH2O=461.526
+      "specific gas constant of water vapour";
+    constant Units.SI.MolarMass MH2O=0.01801528 "molar weight of water";
+    constant Units.SI.Temperature TSTAR1=1386.0
+      "normalization temperature for region 1 IF97";
+    constant Units.SI.Pressure PSTAR1=16.53e6
+      "normalization pressure for region 1 IF97";
+    constant Units.SI.Temperature TSTAR2=540.0
+      "normalization temperature for region 2 IF97";
+    constant Units.SI.Pressure PSTAR2=1.0e6
+      "normalization pressure for region 2 IF97";
+    constant Units.SI.Temperature TSTAR5=1000.0
+      "normalization temperature for region 5 IF97";
+    constant Units.SI.Pressure PSTAR5=1.0e6
+      "normalization pressure for region 5 IF97";
+    constant Units.SI.SpecificEnthalpy HSTAR1=2.5e6
+      "normalization specific enthalpy for region 1 IF97";
+    constant Real IPSTAR=1.0e-6
+      "normalization pressure for inverse function in region 2 IF97";
+    constant Real IHSTAR=5.0e-7
+      "normalization specific enthalpy for inverse function in region 2 IF97";
+    constant Units.SI.Temperature TLIMIT1=623.15
+      "temperature limit between regions 1 and 3";
+    constant Units.SI.Temperature TLIMIT2=1073.15
+      "temperature limit between regions 2 and 5";
+    constant Units.SI.Temperature TLIMIT5=2273.15
+      "upper temperature limit of 5";
+    constant Units.SI.Pressure PLIMIT1=100.0e6
+      "upper pressure limit for regions 1, 2 and 3";
+    constant Units.SI.Pressure PLIMIT4A=16.5292e6
+      "pressure limit between regions 1 and 2, important for for two-phase (region 4)";
+    constant Units.SI.Pressure PLIMIT5=10.0e6
+      "upper limit of valid pressure in region 5";
+    constant Units.SI.Pressure PCRIT=22064000.0 "the critical pressure";
+    constant Units.SI.Temperature TCRIT=647.096 "the critical temperature";
+    constant Units.SI.Density DCRIT=322.0 "the critical density";
+    constant Units.SI.SpecificEntropy SCRIT=4412.02148223476
+      "the calculated specific entropy at the critical point";
+    constant Units.SI.SpecificEnthalpy HCRIT=2087546.84511715
+      "the calculated specific enthalpy at the critical point";
+    constant Real[5] n=array(0.34805185628969e3, -0.11671859879975e1,
+        0.10192970039326e-2, 0.57254459862746e3, 0.13918839778870e2)
+      "polynomial coefficients for boundary between regions 2 and 3";
+    annotation (Documentation(info="<HTML>
+ <h4>Record description</h4>
+                           <p>Constants needed in the international steam properties IF97.
+                           SCRIT and HCRIT are calculated from Helmholtz function for region 3.</p>
+<h4>Version Info and Revision history
+</h4>
+<ul>
+<li>First implemented: <i>July, 2000</i>
+       by Hubertus Tummescheit
+       </li>
+</ul>
+ <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+ </address>
+<ul>
+ <li>Initial version: July 2000</li>
+ <li>Documentation added: December 2002</li>
+</ul>
+</HTML>
+"));
+  end data;
+
+  record critical "critical point data"
+    extends Modelica.Icons.Record;
+    constant Units.SI.Pressure PCRIT=22064000.0 "the critical pressure";
+    constant Units.SI.Temperature TCRIT=647.096 "the critical temperature";
+    constant Units.SI.Density DCRIT=322.0 "the critical density";
+    constant Units.SI.SpecificEnthalpy HCRIT=2087546.84511715
+      "the calculated specific enthalpy at the critical point";
+    constant Units.SI.SpecificEntropy SCRIT=4412.02148223476
+      "the calculated specific entropy at the critical point";
+    annotation (Documentation(info="<HTML>
+ <h4>Record description</h4>
+ <p>Critical point data for IF97 steam properties. SCRIT and HCRIT are calculated from helmholtz function for region 3 </p>
+<h4>Version Info and Revision history
+</h4>
+<ul>
+<li>First implemented: <i>July, 2000</i>
+       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+       </li>
+</ul>
+ <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+ </address>
+<ul>
+ <li>Initial version: July 2000</li>
+ <li>Documentation added: December 2002</li>
+</ul>
+</HTML>
+"));
+  end critical;
+
+  record triple "triple point data"
+    extends Modelica.Icons.Record;
+    constant Units.SI.Temperature Ttriple=273.16 "the triple point temperature";
+    constant Units.SI.Pressure ptriple=611.657 "the triple point temperature";
+    constant Units.SI.Density dltriple=999.792520031617642
+      "the triple point liquid density";
+    constant Units.SI.Density dvtriple=0.485457572477861372e-2
+      "the triple point vapour density";
+    annotation (Documentation(info="<HTML>
+ <h4>Record description</h4>
+ <p>Vapour/liquid/ice triple point data for IF97 steam properties.</p>
+<h4>Version Info and Revision history
+</h4>
+<ul>
+<li>First implemented: <i>July, 2000</i>
+       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+       </li>
+</ul>
+ <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+ </address>
+<ul>
+ <li>Initial version: July 2000</li>
+ <li>Documentation added: December 2002</li>
+</ul>
+</HTML>
+"));
+  end triple;
+
+  package Regions
+    "functions to find the current region for given pairs of input variables"
+
+    //===================================================================
+    //                      "Public" functions
+
+    //===================================================================
+
+    function boundary23ofT
+      "boundary function for region boundary between regions 2 and 3 (input temperature)"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Temperature t "temperature (K)";
+      output Units.SI.Pressure p "pressure";
+    protected
+      constant Real[5] n=data.n;
+    algorithm
+      p := 1.0e6*(n[1] + t*(n[2] + t*n[3]));
+    end boundary23ofT;
+
+    function boundary23ofp
+      "boundary function for region boundary between regions 2 and 3 (input pressure)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.Temperature t "temperature (K)";
+    protected
+      constant Real[5] n=data.n;
+      Real pi "dimensionless pressure";
+    algorithm
+      pi := p/1.0e6;
+      assert(p > triple.ptriple,
+        "IF97 medium function boundary23ofp called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      t := n[4] + ((pi - n[5])/n[3])^0.5;
+    end boundary23ofp;
+
+    function hlowerofp5
+      "explicit lower specific enthalpy limit of region 5 as function of pressure"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real pi "dimensionless pressure";
+    algorithm
+      pi := p/data.PSTAR5;
+      assert(p > triple.ptriple,
+        "IF97 medium function hlowerofp5 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      h := 461526.*(9.01505286876203 + pi*(-0.00979043490246092 + (-0.0000203245575263501
+         + 3.36540214679088e-7*pi)*pi));
+    end hlowerofp5;
+
+    function hupperofp5
+      "explicit upper specific enthalpy limit of region 5 as function of pressure"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real pi "dimensionless pressure";
+    algorithm
+      pi := p/data.PSTAR5;
+      assert(p > triple.ptriple,
+        "IF97 medium function hupperofp5 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      h := 461526.*(15.9838891400332 + pi*(-0.000489898813722568 + (-5.01510211858761e-8
+         + 7.5006972718273e-8*pi)*pi));
+    end hupperofp5;
+
+    function slowerofp5
+      "explicit lower specific entropy limit of region 5 as function of pressure"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Real pi "dimensionless pressure";
+    algorithm
+      pi := p/data.PSTAR5;
+      assert(p > triple.ptriple,
+        "IF97 medium function slowerofp5 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      s := 461.526*(18.4296209980112 + pi*(-0.00730911805860036 + (-0.0000168348072093888
+         + 2.09066899426354e-7*pi)*pi) - Modelica.Math.log(pi));
+    end slowerofp5;
+
+    function supperofp5
+      "explicit upper specific entropy limit of region 5 as function of pressure"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Real pi "dimensionless pressure";
+    algorithm
+      pi := p/data.PSTAR5;
+      assert(p > triple.ptriple,
+        "IF97 medium function supperofp5 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      s := 461.526*(22.7281531474243 + pi*(-0.000656650220627603 + (-1.96109739782049e-8
+         + 2.19979537113031e-8*pi)*pi) - Modelica.Math.log(pi));
+    end supperofp5;
+
+    function hlowerofp1
+      "explicit lower specific enthalpy limit of region 1 as function of pressure"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real pi1 "dimensionless pressure";
+      Real[3] o "vector of auxiliary variables";
+    algorithm
+      pi1 := 7.1 - p/data.PSTAR1;
+      assert(p > triple.ptriple,
+        "IF97 medium function hlowerofp1 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      o[1] := pi1*pi1;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+
+      h := 639675.036*(0.173379420894777 + pi1*(-0.022914084306349 + pi1*(-0.00017146768241932
+         + pi1*(-4.18695814670391e-6 + pi1*(-2.41630417490008e-7 + pi1*(
+        1.73545618580828e-11 + o[1]*pi1*(8.43755552264362e-14 + o[2]*o[3]*pi1
+        *(5.35429206228374e-35 + o[1]*(-8.12140581014818e-38 + o[1]*o[2]*(-1.43870236842915e-44
+         + pi1*(1.73894459122923e-45 + (-7.06381628462585e-47 +
+        9.64504638626269e-49*pi1)*pi1)))))))))));
+    end hlowerofp1;
+
+    function hupperofp1
+      "explicit upper specific enthalpy limit of region 1 as function of pressure (meets region 4 saturation pressure curve at 623.15 K)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real pi1 "dimensionless pressure";
+      Real[3] o "vector of auxiliary variables";
+    algorithm
+      pi1 := 7.1 - p/data.PSTAR1;
+      assert(p > triple.ptriple,
+        "IF97 medium function hupperofp1 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      o[1] := pi1*pi1;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      h := 639675.036*(2.42896927729349 + pi1*(-0.00141131225285294 + pi1*(
+        0.00143759406818289 + pi1*(0.000125338925082983 + pi1*(
+        0.0000123617764767172 + pi1*(3.17834967400818e-6 + o[1]*pi1*(
+        1.46754947271665e-8 + o[2]*o[3]*pi1*(1.86779322717506e-17 + o[1]*(-4.18568363667416e-19
+         + o[1]*o[2]*(-9.19148577641497e-22 + pi1*(4.27026404402408e-22 + (-6.66749357417962e-23
+         + 3.49930466305574e-24*pi1)*pi1)))))))))));
+    end hupperofp1;
+
+    function slowerofp1
+      "explicit lower specific entropy limit of region 1 as function of pressure"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Real pi1 "dimensionless pressure";
+      Real[3] o "vector of auxiliary variables";
+    algorithm
+      pi1 := 7.1 - p/data.PSTAR1;
+      assert(p > triple.ptriple,
+        "IF97 medium function slowerofp1 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      o[1] := pi1*pi1;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      s := 461.526*(-0.0268080988194267 + pi1*(0.00834795890110168 + pi1*(-0.000486470924668433
+         + pi1*(-0.0000154902045012264 + pi1*(-1.07631751351358e-6 + pi1*(
+        9.64159058957115e-11 + o[1]*pi1*(4.81921078863103e-13 + o[2]*o[3]*pi1
+        *(2.7879623870968e-34 + o[1]*(-4.22182957646226e-37 + o[1]*o[2]*(-7.44601427465175e-44
+         + pi1*(8.99540001407168e-45 + (-3.65230274480299e-46 +
+        4.98464639687285e-48*pi1)*pi1)))))))))));
+    end slowerofp1;
+
+    function supperofp1
+      "explicit upper specific entropy limit of region 1 as function of pressure (meets region 4 saturation pressure curve at 623.15 K)"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Real pi1 "dimensionless pressure";
+      Real[3] o "vector of auxiliary variables";
+    algorithm
+      pi1 := 7.1 - p/data.PSTAR1;
+      assert(p > triple.ptriple,
+        "IF97 medium function supperofp1 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      o[1] := pi1*pi1;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      s := 461.526*(7.28316418503422 + pi1*(0.070602197808399 + pi1*(
+        0.0039229343647356 + pi1*(0.000313009170788845 + pi1*(
+        0.0000303619398631619 + pi1*(7.46739440045781e-6 + o[1]*pi1*(
+        3.40562176858676e-8 + o[2]*o[3]*pi1*(4.21886233340801e-17 + o[1]*(-9.44504571473549e-19
+         + o[1]*o[2]*(-2.06859611434475e-21 + pi1*(9.60758422254987e-22 + (-1.49967810652241e-22
+         + 7.86863124555783e-24*pi1)*pi1)))))))))));
+    end supperofp1;
+
+    function hlowerofp2
+      "explicit lower specific enthalpy limit of region 2 as function of pressure (meets region 4 saturation pressure curve at 623.15 K)"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real pi "dimensionless pressure";
+      Real q1 "auxiliary variable";
+      Real q2 "auxiliary variable";
+      Real[18] o "vector of auxiliary variables";
+    algorithm
+      pi := p/data.PSTAR2;
+      assert(p > triple.ptriple,
+        "IF97 medium function hlowerofp2 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      q1 := 572.54459862746 + 31.3220101646784*(-13.91883977887 + pi)^0.5;
+      q2 := -0.5 + 540./q1;
+      o[1] := q1*q1;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      o[4] := pi*pi;
+      o[5] := o[4]*o[4];
+      o[6] := q2*q2;
+      o[7] := o[6]*o[6];
+      o[8] := o[6]*o[7];
+      o[9] := o[5]*o[5];
+      o[10] := o[7]*o[7];
+      o[11] := o[9]*o[9];
+      o[12] := o[10]*o[10];
+      o[13] := o[12]*o[12];
+      o[14] := o[7]*q2;
+      o[15] := o[6]*q2;
+      o[16] := o[10]*o[6];
+      o[17] := o[13]*o[6];
+      o[18] := o[13]*o[6]*q2;
+      h := (4.63697573303507e9 + 3.74686560065793*o[2] + 3.57966647812489e-6*
+        o[1]*o[2] + 2.81881548488163e-13*o[3] - 7.64652332452145e7*q1 -
+        0.00450789338787835*o[2]*q1 - 1.55131504410292e-9*o[1]*o[2]*q1 + o[1]
+        *(2.51383707870341e6 - 4.78198198764471e6*o[10]*o[11]*o[12]*o[13]*o[4]
+         + 49.9651389369988*o[11]*o[12]*o[13]*o[4]*o[5]*o[7] + o[15]*o[4]*(
+        1.03746636552761e-13 - 0.00349547959376899*o[16] -
+        2.55074501962569e-7*o[8])*o[9] + (-242662.235426958*o[10]*o[12] -
+        3.46022402653609*o[16])*o[4]*o[5]*pi + o[4]*(0.109336249381227 -
+        2248.08924686956*o[14] - 354742.725841972*o[17] - 24.1331193696374*o[
+        6])*pi - 3.09081828396912e-19*o[11]*o[12]*o[5]*o[7]*pi -
+        1.24107527851371e-8*o[11]*o[13]*o[4]*o[5]*o[6]*o[7]*pi +
+        3.99891272904219*o[5]*o[8]*pi + 0.0641817365250892*o[10]*o[7]*o[9]*pi
+         + pi*(-4444.87643334512 - 75253.6156722047*o[14] - 43051.9020511789*
+        o[6] - 22926.6247146068*q2) + o[4]*(-8.23252840892034 -
+        3927.0508365636*o[15] - 239.325789467604*o[18] - 76407.3727417716*o[8]
+         - 94.4508644545118*q2) + 0.360567666582363*o[5]*(-0.0161221195808321
+         + q2)*(0.0338039844460968 + q2) + o[11]*(-0.000584580992538624*o[10]
+        *o[12]*o[7] + 1.33248030241755e6*o[12]*o[13]*q2) + o[9]*(-7.38502736990986e7
+        *o[18] + 0.0000224425477627799*o[6]*o[7]*q2) + o[4]*o[5]*(-2.08438767026518e8
+        *o[17] - 0.0000124971648677697*o[6] - 8442.30378348203*o[10]*o[6]*o[7]
+        *q2) + o[11]*o[9]*(4.73594929247646e-22*o[10]*o[12]*q2 -
+        13.6411358215175*o[10]*o[12]*o[13]*q2 + 5.52427169406836e-10*o[13]*o[
+        6]*o[7]*q2) + o[11]*o[5]*(2.67174673301715e-6*o[17] +
+        4.44545133805865e-18*o[12]*o[6]*q2 - 50.2465185106411*o[10]*o[13]*o[6]
+        *o[7]*q2)))/o[1];
+    end hlowerofp2;
+
+    function hupperofp2
+      "explicit upper specific enthalpy limit of region 2 as function of pressure"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real pi "dimensionless pressure";
+      Real[2] o "vector of auxiliary variables";
+    algorithm
+      pi := p/data.PSTAR2;
+      assert(p > triple.ptriple,
+        "IF97 medium function hupperofp2 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      o[1] := pi*pi;
+      o[2] := o[1]*o[1]*o[1];
+      h := 4.16066337647071e6 + pi*(-4518.48617188327 + pi*(-8.53409968320258
+         + pi*(0.109090430596056 + pi*(-0.000172486052272327 + pi*(
+        4.2261295097284e-15 + pi*(-1.27295130636232e-10 + pi*(-3.79407294691742e-25
+         + pi*(7.56960433802525e-23 + pi*(7.16825117265975e-32 + pi*(
+        3.37267475986401e-21 + (-7.5656940729795e-74 + o[1]*(-8.00969737237617e-134
+         + (1.6746290980312e-65 + pi*(-3.71600586812966e-69 + pi*(
+        8.06630589170884e-129 + (-1.76117969553159e-103 +
+        1.88543121025106e-84*pi)*pi)))*o[1]))*o[2]))))))))));
+    end hupperofp2;
+
+    function slowerofp2
+      "explicit lower specific entropy limit of region 2 as function of pressure (meets region 4 saturation pressure curve at 623.15 K)"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Real pi "dimensionless pressure";
+      Real q1 "auxiliary variable";
+      Real q2 "auxiliary variable";
+      Real[40] o "vector of auxiliary variables";
+    algorithm
+      pi := p/data.PSTAR2;
+      assert(p > triple.ptriple,
+        "IF97 medium function slowerofp2 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      q1 := 572.54459862746 + 31.3220101646784*(-13.91883977887 + pi)^0.5;
+      q2 := -0.5 + 540.0/q1;
+      o[1] := pi*pi;
+      o[2] := o[1]*pi;
+      o[3] := o[1]*o[1];
+      o[4] := o[1]*o[3]*pi;
+      o[5] := q1*q1;
+      o[6] := o[5]*q1;
+      o[7] := 1/o[5];
+      o[8] := 1/q1;
+      o[9] := o[5]*o[5];
+      o[10] := o[9]*q1;
+      o[11] := q2*q2;
+      o[12] := o[11]*q2;
+      o[13] := o[1]*o[3];
+      o[14] := o[11]*o[11];
+      o[15] := o[3]*o[3];
+      o[16] := o[1]*o[15];
+      o[17] := o[11]*o[14];
+      o[18] := o[11]*o[14]*q2;
+      o[19] := o[3]*pi;
+      o[20] := o[14]*o[14];
+      o[21] := o[11]*o[20];
+      o[22] := o[15]*pi;
+      o[23] := o[14]*o[20]*q2;
+      o[24] := o[20]*o[20];
+      o[25] := o[15]*o[15];
+      o[26] := o[25]*o[3];
+      o[27] := o[14]*o[24];
+      o[28] := o[25]*o[3]*pi;
+      o[29] := o[20]*o[24]*q2;
+      o[30] := o[15]*o[25];
+      o[31] := o[24]*o[24];
+      o[32] := o[11]*o[31]*q2;
+      o[33] := o[14]*o[31];
+      o[34] := o[1]*o[25]*o[3]*pi;
+      o[35] := o[11]*o[14]*o[31]*q2;
+      o[36] := o[1]*o[25]*o[3];
+      o[37] := o[1]*o[25];
+      o[38] := o[20]*o[24]*o[31]*q2;
+      o[39] := o[14]*q2;
+      o[40] := o[11]*o[31];
+
+      s := 461.526*(9.692768600217 + 1.22151969114703e-16*o[10] +
+        0.00018948987516315*o[1]*o[11] + 1.6714766451061e-11*o[12]*o[13] +
+        0.0039392777243355*o[1]*o[14] - 1.0406965210174e-19*o[14]*o[16] +
+        0.043797295650573*o[1]*o[18] - 2.2922076337661e-6*o[18]*o[19] -
+        2.0481737692309e-8*o[2] + 0.00003227767723857*o[12]*o[2] +
+        0.0015033924542148*o[17]*o[2] - 1.1256211360459e-11*o[15]*o[20] +
+        1.0018179379511e-9*o[11]*o[14]*o[16]*o[20] + 1.0234747095929e-13*o[16]
+        *o[21] - 1.9809712802088e-8*o[22]*o[23] + 0.0021171472321355*o[13]*o[
+        24] - 8.9185845355421e-25*o[26]*o[27] - 1.2790717852285e-8*o[11]*o[3]
+         - 4.8225372718507e-7*o[12]*o[3] - 7.3087610595061e-29*o[11]*o[20]*o[
+        24]*o[30] - 0.10693031879409*o[11]*o[24]*o[25]*o[31] +
+        4.2002467698208e-6*o[24]*o[26]*o[31] - 5.5414715350778e-17*o[20]*o[30]
+        *o[31] + 9.436970724121e-7*o[11]*o[20]*o[24]*o[30]*o[31] +
+        23.895741934104*o[13]*o[32] + 0.040668253562649*o[2]*o[32] -
+        3.0629316876232e-13*o[26]*o[32] + 0.000026674547914087*o[1]*o[33] +
+        8.2311340897998*o[15]*o[33] + 1.2768608934681e-15*o[34]*o[35] +
+        0.33662250574171*o[37]*o[38] + 5.905956432427e-18*o[4] +
+        0.038946842435739*o[29]*o[4] - 4.88368302964335e-6*o[5] -
+        3.34901734177133e6/o[6] + 2.58538448402683e-9*o[6] + 82839.5726841115
+        *o[7] - 5446.7940672972*o[8] - 8.40318337484194e-13*o[9] +
+        0.0017731742473213*pi + 0.045996013696365*o[11]*pi +
+        0.057581259083432*o[12]*pi + 0.05032527872793*o[17]*pi + o[8]*pi*(
+        9.63082563787332 - 0.008917431146179*q1) + 0.00811842799898148*q1 +
+        0.000033032641670203*o[1]*q2 - 4.3870667284435e-7*o[2]*q2 +
+        8.0882908646985e-11*o[14]*o[20]*o[24]*o[25]*q2 + 5.9056029685639e-26*
+        o[14]*o[24]*o[28]*q2 + 7.8847309559367e-10*o[3]*q2 -
+        3.7826947613457e-6*o[14]*o[24]*o[31]*o[36]*q2 + 1.2621808899101e-6*o[
+        11]*o[20]*o[4]*q2 + 540.*o[8]*(10.08665568018 - 0.000033032641670203*
+        o[1] - 6.2245802776607e-15*o[10] - 0.015757110897342*o[1]*o[12] -
+        5.0144299353183e-11*o[11]*o[13] + 4.1627860840696e-19*o[12]*o[16] -
+        0.306581069554011*o[1]*o[17] + 9.0049690883672e-11*o[15]*o[18] +
+        0.0000160454534363627*o[17]*o[19] + 4.3870667284435e-7*o[2] -
+        0.00009683303171571*o[11]*o[2] + 2.57526266427144e-7*o[14]*o[20]*o[22]
+         - 1.40254511313154e-8*o[16]*o[23] - 2.34560435076256e-9*o[14]*o[20]*
+        o[24]*o[25] - 1.24017662339842e-24*o[27]*o[28] - 7.8847309559367e-10*
+        o[3] + 1.44676118155521e-6*o[11]*o[3] + 1.90027787547159e-27*o[29]*o[
+        30] - 0.000960283724907132*o[1]*o[32] - 296.320827232793*o[15]*o[32]
+         - 4.97975748452559e-14*o[11]*o[14]*o[31]*o[34] +
+        2.21658861403112e-15*o[30]*o[35] + 0.000200482822351322*o[14]*o[24]*o[
+        31]*o[36] - 19.1874828272775*o[20]*o[24]*o[31]*o[37] -
+        0.0000547344301999018*o[30]*o[38] - 0.0090203547252888*o[2]*o[39] -
+        0.0000138839897890111*o[21]*o[4] - 0.973671060893475*o[20]*o[24]*o[4]
+         - 836.35096769364*o[13]*o[40] - 1.42338887469272*o[2]*o[40] +
+        1.07202609066812e-11*o[26]*o[40] + 0.0000150341259240398*o[5] -
+        1.8087714924605e-8*o[6] + 18605.6518987296*o[7] - 306.813232163376*o[
+        8] + 1.43632471334824e-11*o[9] + 1.13103675106207e-18*o[5]*o[9] -
+        0.017834862292358*pi - 0.172743777250296*o[11]*pi - 0.30195167236758*
+        o[39]*pi + o[8]*pi*(-49.6756947920742 + 0.045996013696365*q1) -
+        0.0003789797503263*o[1]*q2 - 0.033874355714168*o[11]*o[13]*o[14]*o[20]
+        *q2 - 1.0234747095929e-12*o[16]*o[20]*q2 + 1.78371690710842e-23*o[11]
+        *o[24]*o[26]*q2 + 2.558143570457e-8*o[3]*q2 + 5.3465159397045*o[24]*o[
+        25]*o[31]*q2 - 0.000201611844951398*o[11]*o[14]*o[20]*o[26]*o[31]*q2)
+         - Modelica.Math.log(pi));
+    end slowerofp2;
+
+    function supperofp2
+      "explicit upper specific entropy limit of region 2 as function of pressure"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Real pi "dimensionless pressure";
+      Real[2] o "vector of auxiliary variables";
+    algorithm
+      pi := p/data.PSTAR2;
+      assert(p > triple.ptriple,
+        "IF97 medium function supperofp2 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      o[1] := pi*pi;
+      o[2] := o[1]*o[1]*o[1];
+      s := 8505.73409708683 - 461.526*Modelica.Math.log(pi) + pi*(-3.36563543302584
+         + pi*(-0.00790283552165338 + pi*(0.0000915558349202221 + pi*(-1.59634706513e-7
+         + pi*(3.93449217595397e-18 + pi*(-1.18367426347994e-13 + pi*(
+        2.72575244843195e-15 + pi*(7.04803892603536e-26 + pi*(
+        6.67637687381772e-35 + pi*(3.1377970315132e-24 + (-7.04844558482265e-77
+         + o[1]*(-7.46289531275314e-137 + (1.55998511254305e-68 + pi*(-3.46166288915497e-72
+         + pi*(7.51557618628583e-132 + (-1.64086406733212e-106 +
+        1.75648443097063e-87*pi)*pi)))*o[1]))*o[2]*o[2]))))))))));
+    end supperofp2;
+
+    function d1n "density in region 1 as function of p and T"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.Density d "density";
+    protected
+      Real pi "dimensionless pressure";
+      Real pi1 "dimensionless pressure";
+      Real tau "dimensionless temperature";
+      Real tau1 "dimensionless temperature";
+      Real gpi "dimensionless Gibbs-derivative w.r.t. pi";
+      Real[11] o "auxiliary variables";
+    algorithm
+      pi := p/data.PSTAR1;
+      tau := data.TSTAR1/T;
+      pi1 := 7.1 - pi;
+      tau1 := tau - 1.222;
+      o[1] := tau1*tau1;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      o[4] := o[1]*o[2];
+      o[5] := o[1]*tau1;
+      o[6] := o[2]*tau1;
+      o[7] := pi1*pi1;
+      o[8] := o[7]*o[7];
+      o[9] := o[8]*o[8];
+      o[10] := o[3]*o[3];
+      o[11] := o[10]*o[10];
+      gpi := pi1*(pi1*((0.000095038934535162 + o[2]*(8.4812393955936e-6 +
+        2.55615384360309e-9*o[4]))/o[2] + pi1*((8.9701127632e-6 + (
+        2.60684891582404e-6 + 5.7366919751696e-13*o[2]*o[3])*o[5])/o[6] + pi1
+        *(2.02584984300585e-6/o[3] + o[7]*pi1*(o[8]*o[9]*pi1*(o[7]*(o[7]*o[8]
+        *(-7.63737668221055e-22/(o[1]*o[11]*o[2]) + pi1*(pi1*(-5.65070932023524e-23
+        /(o[11]*o[3]) + (2.99318679335866e-24*pi1)/(o[11]*o[3]*tau1)) +
+        3.5842867920213e-22/(o[1]*o[11]*o[2]*tau1))) - 3.33001080055983e-19/(
+        o[1]*o[10]*o[2]*o[3]*tau1)) + 1.44400475720615e-17/(o[10]*o[2]*o[3]*
+        tau1)) + (1.01874413933128e-8 + 1.39398969845072e-9*o[6])/(o[1]*o[3]*
+        tau1))))) + (0.00094368642146534 + o[5]*(0.00060003561586052 + (-0.000095322787813974
+         + o[1]*(8.8283690661692e-6 + 1.45389992595188e-15*o[1]*o[2]*o[3]))*
+        tau1))/o[5]) + (-0.00028319080123804 + o[1]*(0.00060706301565874 + o[
+        4]*(0.018990068218419 + tau1*(0.032529748770505 + (0.021841717175414
+         + 0.00005283835796993*o[1])*tau1))))/(o[3]*tau1);
+      d := p/(data.RH2O*T*pi*gpi);
+    end d1n;
+
+    function d2n "density in region 2  as function of p and T"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.Density d "density";
+    protected
+      Real pi "dimensionless pressure";
+      Real tau "dimensionless temperature";
+      Real tau2 "dimensionless temperature";
+      Real gpi "dimensionless Gibbs-derivative w.r.t. pi";
+      Real[12] o "auxiliary variables";
+    algorithm
+      pi := p/data.PSTAR2;
+      tau := data.TSTAR2/T;
+      tau2 := tau - 0.5;
+      o[1] := tau2*tau2;
+      o[2] := o[1]*tau2;
+      o[3] := o[1]*o[1];
+      o[4] := o[3]*o[3];
+      o[5] := o[4]*o[4];
+      o[6] := o[3]*o[4]*o[5]*tau2;
+      o[7] := o[3]*o[4]*tau2;
+      o[8] := o[1]*o[3]*o[4];
+      o[9] := pi*pi;
+      o[10] := o[9]*o[9];
+      o[11] := o[3]*o[5]*tau2;
+      o[12] := o[5]*o[5];
+      gpi := (1. + pi*(-0.0017731742473213 + tau2*(-0.017834862292358 + tau2*
+        (-0.045996013696365 + (-0.057581259083432 - 0.05032527872793*o[2])*
+        tau2)) + pi*(tau2*(-0.000066065283340406 + (-0.0003789797503263 + o[1]
+        *(-0.007878555448671 + o[2]*(-0.087594591301146 -
+        0.000053349095828174*o[6])))*tau2) + pi*(6.1445213076927e-8 + (
+        1.31612001853305e-6 + o[1]*(-0.00009683303171571 + o[2]*(-0.0045101773626444
+         - 0.122004760687947*o[6])))*tau2 + pi*(tau2*(-3.15389238237468e-9 +
+        (5.116287140914e-8 + 1.92901490874028e-6*tau2)*tau2) + pi*(
+        0.0000114610381688305*o[1]*o[3]*tau2 + pi*(o[2]*(-1.00288598706366e-10
+         + o[7]*(-0.012702883392813 - 143.374451604624*o[1]*o[5]*tau2)) + pi*
+        (-4.1341695026989e-17 + o[1]*o[4]*(-8.8352662293707e-6 -
+        0.272627897050173*o[8])*tau2 + pi*(o[4]*(9.0049690883672e-11 -
+        65.8490727183984*o[3]*o[4]*o[5]) + pi*(1.78287415218792e-7*o[7] + pi*
+        (o[3]*(1.0406965210174e-18 + o[1]*(-1.0234747095929e-12 -
+        1.0018179379511e-8*o[3])*o[3]) + o[10]*o[9]*((-1.29412653835176e-9 +
+        1.71088510070544*o[11])*o[6] + o[9]*(-6.05920510335078*o[12]*o[4]*o[5]
+        *tau2 + o[9]*(o[3]*o[5]*(1.78371690710842e-23 + o[1]*o[3]*o[4]*(
+        6.1258633752464e-12 - 0.000084004935396416*o[7])*tau2) + pi*(-1.24017662339842e-24
+        *o[11] + pi*(0.0000832192847496054*o[12]*o[3]*o[5]*tau2 + pi*(o[1]*o[
+        4]*o[5]*(1.75410265428146e-27 + (1.32995316841867e-15 -
+        0.0000226487297378904*o[1]*o[5])*o[8])*pi - 2.93678005497663e-14*o[1]
+        *o[12]*o[3]*tau2)))))))))))))))))/pi;
+      d := p/(data.RH2O*T*pi*gpi);
+    end d2n;
+
+    function dhot1ofp "density at upper temperature limit of region 1"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.Density d "density";
+    protected
+      Real pi "dimensionless pressure";
+      Real pi1 "dimensionless pressure";
+      Real[4] o "auxiliary variables";
+    algorithm
+      pi := p/data.PSTAR1;
+      pi1 := 7.1 - pi;
+      o[1] := pi1*pi1;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      o[4] := o[3]*o[3];
+      d := 57.4756752485113/(0.0737412153522555 + 0.000102697173772229*o[1]
+         + 1.99080616601101e-6*o[2] + 1.35549330686006e-17*o[2]*o[4] -
+        3.11228834832975e-19*o[1]*o[2]*o[4] - 7.02987180039442e-22*o[2]*o[3]*
+        o[4] - 5.17859076694812e-23*o[1]*o[2]*o[3]*o[4] + 0.00145092247736023
+        *pi1 + 0.0000114683182476084*o[1]*pi1 + 1.13217858826367e-8*o[1]*o[2]
+        *pi1 + 3.29199117056433e-22*o[2]*o[3]*o[4]*pi1 + 2.73712834080283e-24
+        *o[1]*o[2]*o[3]*o[4]*pi1);
+    end dhot1ofp;
+
+    function dupper1ofT "density at upper pressure limit of region 1"
+      extends Modelica.Icons.Function;
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.Density d "density";
+    protected
+      Real tau "dimensionless temperature";
+      Real[4] o "auxiliary variables";
+    algorithm
+      tau := 1386.0/T;
+      o[1] := tau*tau;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      o[4] := o[3]*o[3];
+      d := 57.4756752485113/(2.24144616859917 + 40.9288231166229*o[1] +
+        106.47246463213*o[2] + 88.4481480270751*o[1]*o[2] + 31.3207272417546*
+        o[3] + 5.47811738891798*o[1]*o[3] + 0.515626225030717*o[2]*o[3] +
+        0.0274905057899089*o[1]*o[2]*o[3] + 0.000853742979250503*o[4] +
+        0.0000155932210492199*o[1]*o[4] + 1.6621051480279e-7*o[2]*o[4] +
+        1.00606771839976e-9*o[1]*o[2]*o[4] + 3.27598951831994e-12*o[3]*o[4]
+         + 5.20162317530099e-15*o[1]*o[3]*o[4] + 3.33501889800275e-18*o[2]*o[
+        3]*o[4] + 5.50656040141221e-22*o[1]*o[2]*o[3]*o[4] - 13.5354267762204
+        *tau - 78.3629702507642*o[1]*tau - 109.374479648652*o[2]*tau -
+        57.9035658513312*o[1]*o[2]*tau - 14.215347150565*o[3]*tau -
+        1.80906759985501*o[1]*o[3]*tau - 0.127542214693871*o[2]*o[3]*tau -
+        0.0051779458313163*o[1]*o[2]*o[3]*tau - 0.000123304142684848*o[4]*tau
+         - 1.72405791469972e-6*o[1]*o[4]*tau - 1.39155695911655e-8*o[2]*o[4]*
+        tau - 6.23333356847138e-11*o[1]*o[2]*o[4]*tau - 1.44056015732082e-13*
+        o[3]*o[4]*tau - 1.50201626932938e-16*o[1]*o[3]*o[4]*tau -
+        5.34588682252967e-20*o[2]*o[3]*o[4]*tau - 2.73712834080283e-24*o[1]*o[
+        2]*o[3]*o[4]*tau);
+    end dupper1ofT;
+
+    function hl_p_R4b
+      "explicit approximation of liquid specific enthalpy on the boundary between regions 4 and 3"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real x "auxiliary variable";
+    algorithm
+        // documentation of accuray in notebook ~hubertus/props/IAPWS/R3Approx.nb
+      // boundary between region IVa and III
+      x := Modelica.Math.acos(p/data.PCRIT);
+      h := (1 + x*(-0.4945586958175176 + x*(1.346800016564904 + x*(-3.889388153209752
+         + x*(6.679385472887931 + x*(-6.75820241066552 + x*(3.558919744656498
+         + (-0.7179818554978939 - 0.0001152032945617821*x)*x)))))))*data.
+        HCRIT;
+      annotation(smoothOrder=5);
+    end hl_p_R4b;
+
+    function hv_p_R4b
+      "explicit approximation of vapour specific enthalpy on the boundary between regions 4 and 3"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real x "auxiliary variable";
+    algorithm
+      // boundary between region IVa and III
+      x := Modelica.Math.acos(p/data.PCRIT);
+      h := (1 + x*(0.4880153718655694 + x*(0.2079670746250689 + x*(-6.084122698421623
+         + x*(25.08887602293532 + x*(-48.38215180269516 + x*(
+        45.66489164833212 + (-16.98555442961553 + 0.0006616936460057691*x)*x)))))))
+        *data.HCRIT;
+      annotation(smoothOrder=5);
+    end hv_p_R4b;
+
+    function sl_p_R4b
+      "explicit approximation of liquid specific entropy on the boundary between regions 4 and 3"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Real x "auxiliary variable";
+    algorithm
+      // boundary between region IVa and III
+      x := Modelica.Math.acos(p/data.PCRIT);
+      s := (1 + x*(-0.36160692245648063 + x*(0.9962778630486647 + x*(-2.8595548144171103
+         + x*(4.906301159555333 + x*(-4.974092309614206 + x*(
+        2.6249651699204457 + (-0.5319954375299023 - 0.00008064497431880644*x)
+        *x)))))))*data.SCRIT;
+      annotation(smoothOrder=5);
+    end sl_p_R4b;
+
+    function sv_p_R4b
+      "explicit approximation of vapour specific entropy on the boundary between regions 4 and 3"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s;
+    protected
+      Real x "auxiliary variable";
+    algorithm
+        // documentation of accuray in notebook ~hubertus/props/IAPWS/R3Approx.nb
+      // boundary between region IVa and III
+      x := Modelica.Math.acos(p/data.PCRIT);
+      s := (1 + x*(0.35682641826674344 + x*(0.1642457027815487 + x*(-4.425350377422446
+         + x*(18.324477859983133 + x*(-35.338631625948665 + x*(
+        33.36181025816282 + (-12.408711490585757 + 0.0004810049834109226*x)*x)))))))
+        *data.SCRIT;
+      annotation(smoothOrder=5);
+    end sv_p_R4b;
+
+    function rhol_p_R4b
+      "explicit approximation of liquid density on the boundary between regions 4 and 3"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.Density dl "liquid density";
+    protected
+      Real x "auxiliary variable";
+    algorithm
+      if (p < data.PCRIT) then
+        x := Modelica.Math.acos(p/data.PCRIT);
+        dl := (1 + x*(1.903224079094824 + x*(-2.5314861802401123 + x*(-8.191449323843552
+           + x*(94.34196116778385 + x*(-369.3676833623383 + x*(
+          796.6627910598293 + x*(-994.5385383600702 + x*(673.2581177021598 +
+          (-191.43077336405156 + 0.00052536560808895*x)*x)))))))))*data.DCRIT;
+      else
+        dl := data.DCRIT;
+      end if;
+      annotation(smoothOrder=5);
+    end rhol_p_R4b;
+
+    function rhov_p_R4b
+      "explicit approximation of vapour density on the boundary between regions 4 and 2"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.Density dv "vapour density";
+    protected
+      Real x "auxiliary variable";
+    algorithm
+      if (p < data.PCRIT) then
+        x := Modelica.Math.acos(p/data.PCRIT);
+        dv := (1 + x*(-1.8463850803362596 + x*(-1.1447872718878493 + x*(
+          59.18702203076563 + x*(-403.5391431811611 + x*(1437.2007245332388
+           + x*(-3015.853540307519 + x*(3740.5790348670057 + x*(-2537.375817253895
+           + (725.8761975803782 - 0.0011151111658332337*x)*x)))))))))*data.
+          DCRIT;
+      else
+        dv := data.DCRIT;
+      end if;
+      annotation(smoothOrder=5);
+    end rhov_p_R4b;
+
+    function boilingcurve_p "properties on the boiling curve"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output
+        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
+                                                bpro "property record";
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                         g "dimensionless Gibbs funcion and dervatives";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
+                             f
+        "dimensionless Helmholtz function and dervatives";
+      Units.SI.Pressure plim=min(p, data.PCRIT - 1e-7)
+        "pressure limited to critical pressure - epsilon";
+      Boolean region3boundary "true if boundary between 2-phase and region 3";
+      Real pv "partial derivative of p w.r.t v";
+    algorithm
+      bpro.R := data.RH2O;
+      bpro.T := Basic.tsat(plim);
+      bpro.dpT := Basic.dptofT(bpro.T);
+      region3boundary := bpro.T > data.TLIMIT1;
+      if not region3boundary then
+        g := Basic.g1(p, bpro.T);
+        bpro.d := p/(bpro.R*bpro.T*g.pi*g.gpi);
+        bpro.h := if p > plim then data.HCRIT else bpro.R*bpro.T*g.tau*g.gtau;
+        bpro.s := g.R*(g.tau*g.gtau - g.g);
+        bpro.cp := -bpro.R*g.tau*g.tau*g.gtautau;
+        bpro.vt := bpro.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        bpro.vp := bpro.R*bpro.T/(p*p)*g.pi*g.pi*g.gpipi;
+        bpro.pt := -p/bpro.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
+        bpro.pd := -bpro.R*bpro.T*g.gpi*g.gpi/(g.gpipi);
+      else
+        bpro.d := rhol_p_R4b(plim);
+        f := Basic.f3(bpro.d, bpro.T);
+        bpro.h := hl_p_R4b(plim);
+        // bpro.R*bpro.T*(f.tau*f.ftau + f.delta*f.fdelta);
+        bpro.s := f.R*(f.tau*f.ftau - f.f);
+        bpro.cv := bpro.R*(-f.tau*f.tau*f.ftautau);
+        bpro.pt := bpro.R*bpro.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        bpro.pd := bpro.R*bpro.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        pv := (-f.d*f.d*bpro.pd);
+        bpro.vp := 1/pv;
+        bpro.vt := -bpro.pt/pv;
+      end if;
+    end boilingcurve_p;
+
+    function dewcurve_p "properties on the dew curve"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output
+        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
+                                                bpro "property record";
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                         g "dimensionless Gibbs funcion and dervatives";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
+                             f
+        "dimensionless Helmholtz function and dervatives";
+      Units.SI.Pressure plim=min(p, data.PCRIT - 1e-7)
+        "pressure limited to critical pressure - epsilon";
+      Boolean region3boundary "true if boundary between 2-phase and region 3";
+      Real pv "partial derivative of p w.r.t v";
+    algorithm
+      bpro.R := data.RH2O;
+      bpro.T := Basic.tsat(plim);
+      bpro.dpT := Basic.dptofT(bpro.T);
+      region3boundary := bpro.T > data.TLIMIT1;
+      if not region3boundary then
+        g := Basic.g2(p, bpro.T);
+        bpro.d := p/(bpro.R*bpro.T*g.pi*g.gpi);
+        bpro.h := if p > plim then data.HCRIT else bpro.R*bpro.T*g.tau*g.gtau;
+        bpro.s := g.R*(g.tau*g.gtau - g.g);
+        bpro.cp := -bpro.R*g.tau*g.tau*g.gtautau;
+        bpro.vt := bpro.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        bpro.vp := bpro.R*bpro.T/(p*p)*g.pi*g.pi*g.gpipi;
+        bpro.pt := -p/bpro.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
+        bpro.pd := -bpro.R*bpro.T*g.gpi*g.gpi/(g.gpipi);
+      else
+        bpro.d := rhov_p_R4b(plim);
+        f := Basic.f3(bpro.d, bpro.T);
+        bpro.h := hv_p_R4b(plim);
+        // bpro.R*bpro.T*(f.tau*f.ftau + f.delta*f.fdelta);
+        bpro.s := f.R*(f.tau*f.ftau - f.f);
+        bpro.cv := bpro.R*(-f.tau*f.tau*f.ftautau);
+        bpro.pt := bpro.R*bpro.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        bpro.pd := bpro.R*bpro.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        pv := (-f.d*f.d*bpro.pd);
+        bpro.vp := 1/pv;
+        bpro.vt := -bpro.pt/pv;
+      end if;
+    end dewcurve_p;
+
+    function hvl_p
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input
+        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
+                                               bpro "property record";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := bpro.h;
+      annotation (
+        derivative(noDerivative=bpro) = hvl_p_der,
+        Inline=false,
+        LateInline=true);
+    end hvl_p;
+
+    function hl_p
+      "liquid specific enthalpy on the boundary between regions 4 and 3 or 1"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := hvl_p(p, boilingcurve_p(p));
+    end hl_p;
+
+    function hv_p
+      "vapour specific enthalpy on the boundary between regions 4 and 3 or 2"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := hvl_p(p, dewcurve_p(p));
+    end hv_p;
+
+    function hvl_p_der
+      "derivative function for the specific enthalpy along the phase boundary"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input
+        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
+                                               bpro "property record";
+      input Real p_der "derivative of pressure";
+      output Real h_der
+        "time derivative of specific enthalpy along the phase boundary";
+    algorithm
+      h_der := (1/bpro.d - bpro.T*bpro.vt)*p_der + bpro.cp/bpro.dpT*p_der;
+    end hvl_p_der;
+
+    function rhovl_p
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input
+        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
+                                               bpro "property record";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := bpro.d;
+      annotation (
+        derivative(noDerivative=bpro) = rhovl_p_der,
+        Inline=false,
+        LateInline=true);
+    end rhovl_p;
+
+    function rhol_p "density of saturated water"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "saturation pressure";
+      output Units.SI.Density rho "density of steam at the condensation point";
+    algorithm
+      rho := rhovl_p(p, boilingcurve_p(p));
+    end rhol_p;
+
+    function rhov_p "density of saturated vapour"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "saturation pressure";
+      output Units.SI.Density rho "density of steam at the condensation point";
+    algorithm
+      rho := rhovl_p(p, dewcurve_p(p));
+    end rhov_p;
+
+    function rhovl_p_der
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "saturation pressure";
+      input
+        ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties
+                                               bpro "property record";
+      input Real p_der "derivative of pressure";
+      output Real d_der "time derivative of density along the phase boundary";
+    algorithm
+      d_der := -bpro.d*bpro.d*(bpro.vp + bpro.vt/bpro.dpT)*p_der;
+    end rhovl_p_der;
+
+    function sl_p
+      "liquid specific entropy on the boundary between regions 4 and 3 or 1"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Units.SI.Temperature Tsat "saturation temperature";
+      Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      if (p < data.PLIMIT4A) then
+        Tsat := Basic.tsat(p);
+        (h,s) := Isentropic.handsofpT1(p, Tsat);
+      elseif (p < data.PCRIT) then
+        s := sl_p_R4b(p);
+      else
+        s := data.SCRIT;
+      end if;
+    end sl_p;
+
+    function sv_p
+      "vapour specific entropy on the boundary between regions 4 and 3 or 2"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Units.SI.Temperature Tsat "saturation temperature";
+      Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      if (p < data.PLIMIT4A) then
+        Tsat := Basic.tsat(p);
+        (h,s) := Isentropic.handsofpT2(p, Tsat);
+      elseif (p < data.PCRIT) then
+        s := sv_p_R4b(p);
+      else
+        s := data.SCRIT;
+      end if;
+    end sv_p;
+
+    function rhol_T "density of saturated water"
+      extends Modelica.Icons.Function;
+      input Units.SI.Temperature T "temperature";
+      output Units.SI.Density d "density of water at the boiling point";
+    protected
+      Units.SI.Pressure p "saturation pressure";
+    algorithm
+      p := Basic.psat(T);
+      if T < data.TLIMIT1 then
+        d := d1n(p, T);
+      elseif T < data.TCRIT then
+        d := rhol_p_R4b(p);
+      else
+        d := data.DCRIT;
+      end if;
+    end rhol_T;
+
+    function rhov_T "density of saturated vapour"
+      extends Modelica.Icons.Function;
+      input Units.SI.Temperature T "temperature";
+      output Units.SI.Density d "density of steam at the condensation point";
+    protected
+      Units.SI.Pressure p "saturation pressure";
+    algorithm
+
+        // assert(T <= data.TCRIT,"input temperature has to be below the critical temperature");
+      p := Basic.psat(T);
+      if T < data.TLIMIT1 then
+        d := d2n(p, T);
+      elseif T < data.TCRIT then
+        d := rhov_p_R4b(p);
+      else
+        d := data.DCRIT;
+      end if;
+    end rhov_T;
+
+    function region_ph
+      "return the current region (valid values: 1,2,3,4,5) in IF97 for given pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+     input Integer phase=0
+        "phase: 2 for two-phase, 1 for one phase, 0 if not known";
+     input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
+      output Integer region "region (valid values: 1,2,3,4,5) in IF97";
+      // If mode is different from 0, no checking for the region is done and
+      // the mode is assumed to be the correct region. This can be used to
+      // implement e.g. water-only steamtables when mode == 1
+    protected
+      Boolean hsubcrit;
+      Units.SI.Temperature Ttest;
+      constant Real[5] n=data.n;
+      Units.SI.SpecificEnthalpy hl "bubble enthalpy";
+      Units.SI.SpecificEnthalpy hv "dew enthalpy";
+    algorithm
+      if (mode <> 0) then
+        region := mode;
+      else
+        // check for regions 1, 2, 3 and 4
+        hl := hl_p(p);
+        hv := hv_p(p);
+        if (phase == 2) then
+          region := 4;
+        else
+          // phase == 1 or 0, now check if we are in the legal area
+          if
+            (p < triple.ptriple) or (p > data.PLIMIT1) or (h < hlowerofp1(p)) or
+            ((p < 10.0e6) and (h > hupperofp5(p)))
+            or ((p >= 10.0e6) and (h > hupperofp2(p))) then
+            // outside of valid range
+            region := -1;
+          else
+            //region 5 and -1 check complete
+            hsubcrit := (h < data.HCRIT);
+            // simple precheck: very simple if pressure < PLIMIT4A
+            if (p < data.PLIMIT4A) then
+              // we can never be in region 3, so test for others
+              if hsubcrit then
+                if (phase == 1) then
+                  region := 1;
+                else
+                  if (h < Isentropic.hofpT1(p,Basic.tsat(p))) then
+                    region := 1;
+                  else
+                    region := 4;
+                  end if;
+                end if;
+                // external or internal phase check
+              else
+                if (h > hlowerofp5(p)) then
+                  // check for region 5
+                  if ((p < data.PLIMIT5) and (h < hupperofp5(p))) then
+                    region := 5;
+                  else
+                    region := -2;
+                    // pressure and specific enthalpy too high, but this should
+                  end if;
+                  // never happen
+                else
+                  if (phase == 1) then
+                    region := 2;
+                  else
+                    if (h > Isentropic.hofpT2(p,Basic.tsat(p))) then
+                      region := 2;
+                    else
+                      region := 4;
+                    end if;
+                  end if;  // external or internal phase check
+                end if;
+                // tests for region 2 or 5
+              end if;
+              // tests for sub or supercritical
+            else
+              // the pressure is over data.PLIMIT4A
+              if hsubcrit then
+                // region 1 or 3 or 4
+                if h < hupperofp1(p) then
+                  region := 1;
+                else
+                  if h < hl  or p > data.PCRIT then
+                    region := 3;
+                  else
+                    region :=4;
+                  end if;
+                end if;
+                // enf of test for region 1, 3 or 4
+              else
+                // region 2, 3 or 4
+                if (h > hlowerofp2(p)) then
+                  region := 2;
+                else
+                  if h > hv  or p > data.PCRIT then
+                    region := 3;
+                  else
+                    region := 4;
+                  end if;
+                end if;
+                // test for 2 and 3
+              end if;
+              // tests above PLIMIT4A
+            end if;
+            // above or below PLIMIT4A
+          end if;
+          // check for grand limits of p and h
+        end if;
+        // all tests with phase == 1
+      end if;
+      // mode was == 0
+      // assert(region > 0,"IF97 function called outside the valid range!");
+    end region_ph;
+
+    function region_ps
+      "return the current region (valid values: 1,2,3,4,5) in IF97 for given pressure and specific entropy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+     input Integer phase=
+                    0 "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+     input Integer mode=
+                   0 "mode: 0 means check, otherwise assume region=mode";
+      output Integer region "region (valid values: 1,2,3,4,5) in IF97";
+      //  If mode is different from 0, no checking for the region is done and
+      //    the mode is assumed to be the correct region. This can be used to
+      //    implement e.g. water-only steamtables when mode == 1
+    protected
+      Boolean ssubcrit;
+      Units.SI.Temperature Ttest;
+      constant Real[5] n=data.n;
+      Units.SI.SpecificEntropy sl "bubble entropy";
+      Units.SI.SpecificEntropy sv "dew entropy";
+    algorithm
+      if (mode <> 0) then
+        region := mode;
+      else
+        // check for regions 1, 2, 3, and 4
+        sl := sl_p(p);
+        sv := sv_p(p);
+        // check all cases two-phase
+        if (phase == 2) or (phase == 0 and s > sl and s < sv and p < data.PCRIT) then
+          region := 4;
+        else
+          // phase == 1
+          region := 0;
+          if (p < triple.ptriple) then
+            region := -2;
+          end if;
+          if (p > data.PLIMIT1) then
+            region := -3;
+          end if;
+          if ((p < 10.0e6) and (s > supperofp5(p))) then
+            region := -5;
+          end if;
+          if ((p >= 10.0e6) and (s > supperofp2(p))) then
+            region := -6;
+          end if;
+          if region < 0 then
+            assert(false, "region computation from p and s failed: function called outside the legal region");
+          else
+            ssubcrit := (s < data.SCRIT);
+            // simple precheck: very simple if pressure < PLIMIT4A
+            if (p < data.PLIMIT4A) then
+              // we can never be in region 3, so test for 1 and 2
+              if ssubcrit then
+                region := 1;
+              else
+                if (s > slowerofp5(p)) then
+                  // check for region 5
+                  if ((p < data.PLIMIT5) and (s < supperofp5(p))) then
+                    region := 5;
+                  else
+                    region := -1;
+                    // pressure and specific entropy too high, should never happen!
+                  end if;
+                else
+                  region := 2;
+                end if;
+                // tests for region 2 or 5
+              end if;
+              // tests for sub or supercritical
+            else
+              // the pressure is over data.PLIMIT4A
+              if ssubcrit then
+                // region 1 or 3
+                if s < supperofp1(p) then
+                  region := 1;
+                else
+                  if s < sl  or p > data.PCRIT then
+                    region := 3;
+                  else
+                    region := 4;
+                  end if;
+                end if;
+                // test for region 1, 3 or 4
+              else
+                // region 2, 3 or 4
+                if (s > slowerofp2(p)) then
+                  region := 2;
+                else
+                  if s > sv  or p > data.PCRIT then
+                    region := 3;
+                  else
+                    region := 4;
+                  end if;
+                end if;
+                // test for 2,3 and 4
+              end if;
+              // tests above PLIMIT4A
+            end if;
+            // above or below PLIMIT4A
+          end if;
+          // grand test for limits of p and s
+        end if;
+        // all tests with phase == 1
+      end if;
+      // mode was == 0
+    end region_ps;
+
+    function region_pT
+      "return the current region (valid values: 1,2,3,5) in IF97, given pressure and temperature"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
+      output Integer region
+        "region (valid values: 1,2,3,5) in IF97, region 4 is impossible!";
+    algorithm
+      if (mode <> 0) then
+        region := mode;
+      else
+        if p < data.PLIMIT4A then
+          //test for regions 1,2,5
+          if T > data.TLIMIT2 then
+            region := 5;
+          elseif T > Basic.tsat(p) then
+            region := 2;
+          else
+            region := 1;
+          end if;
+        else
+          //test for regions 1,2,3
+          if T < data.TLIMIT1 then
+            region := 1;
+          elseif T < boundary23ofp(p) then
+            region := 3;
+          else
+            region := 2;
+          end if;
+        end if;
+      end if;
+      // mode was == 0
+    end region_pT;
+
+    function region_dT
+      "return the current region (valid values: 1,2,3,4,5) in IF97, given density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature (K)";
+      input Integer phase= 0
+        "phase: 2 for two-phase, 1 for one phase, 0 if not known";
+      input Integer mode= 0 "mode: 0 means check, otherwise assume region=mode";
+      output Integer region "(valid values: 1,2,3,4,5) in IF97";
+    protected
+      Boolean Tovercrit "flag if overcritical temperature";
+      Units.SI.Pressure p23 "pressure needed to know if region 2 or 3";
+    algorithm
+      Tovercrit := T > data.TCRIT;
+      if (mode <> 0) then
+        region := mode;
+      else
+        p23 := boundary23ofT(T);
+        if T > data.TLIMIT2 then
+          if d < 20.5655874106483 then
+            // check for the density in the upper corner of validity!
+            region := 5;
+          else
+            assert(false,"out of valid region for IF97, pressure above region 5!");
+          end if;
+        elseif Tovercrit then
+          //check for regions 1, 2 or 3
+          if d > d2n(p23, T) and T > data.TLIMIT1 then
+            region := 3;
+          elseif T < data.TLIMIT1 then
+            region := 1;
+          else // d  < d2n(p23, T) and T > data.TLIMIT1
+            region := 2;
+          end if;
+          // below critical, check for regions 1, 2, 3 or 4
+        elseif (d > rhol_T(T)) then
+          // either 1 or 3
+          if T < data.TLIMIT1 then
+            region := 1;
+          else
+            region := 3;
+          end if;
+        elseif (d < rhov_T(T)) then
+          // not liquid, not 2-phase, and not region 5, so either 2 or 3 or illegal
+          if (d > d2n(p23, T) and T > data.TLIMIT1) then
+            region := 3;
+          else
+            region := 2;
+          end if;
+        else
+          region := 4;
+        end if;
+      end if;
+    end region_dT;
+
+    annotation (Documentation(info="<HTML><h4>Package description</h4>
+ <p>Package <b>Regions</b> contains a large number of auxiliary functions which are neede to compute the current region
+ of the IAPWS/IF97 for a given pair of input variables as quickly as possible. The focus of this implementation was on
+ computational efficiency, not on compact code. Many of the function values calulated in these functions could be obtained
+ using the fundamental functions of IAPWS/IF97, but with considerable overhead. If the region of IAPWS/IF97 is known in advance,
+ the input variable mode can be set to the region, then the somewhat costly region checks are omitted.
+ The checking for the phase has to be done outside the region functions because many properties are not
+ differentiable at the region boundary. If the input phase is 2, the output region will be set to 4 immediately.</p>
+ <h4>Package contents</h4>
+ <p> The main 4 functions in this package are the functions returning the appropriate region for two input variables.
+ <ul>
+ <li>Function <b>region_ph</b> compute the region of IAPWS/IF97 for input pair pressure and specific enthalpy.</li>
+ <li>Function <b>region_ps</b> compute the region of IAPWS/IF97 for input pair pressure and specific entropy</li>
+ <li>Function <b>region_dT</b> compute the region of IAPWS/IF97 for input pair density and temperature.</li>
+ <li>Function <b>region_pT</b> compute the region of IAPWS/IF97 for input pair pressure and temperature (only ine phase region).</li>
+ </ul>
+ <p>In addition, functions of the boiling and condensation curves compute the specific enthalpy, specific entropy, or density on these
+ curves. The functions for the saturation pressure and temperature are included in the package <b>Basic</b> because they are part of
+ the original <a href=\"IF97documentation/IF97.pdf\">IAPWS/IF97 standards document</a>. These functions are also aliased to
+ be used directly from package <b>Water</b>.
+ </p>
+ <ul>
+ <li>Function <b>hl_p</b> computes the liquid specific enthalpy as a function of pressure. For overcritical pressures,
+ the critical specific enthalpy is returned. An approximation is used for temperatures > 623.15 K.</li>
+ <li>Function <b>hv_p</b> computes the vapour specific enthalpy as a function of pressure. For overcritical pressures,
+ the critical specific enthalpy is returned. An approximation is used for temperatures > 623.15 K.</li>
+ <li>Function <b>sl_p</b> computes the liquid specific entropy as a function of pressure. For overcritical pressures,
+ the critical  specific entropy is returned. An approximation is used for temperatures > 623.15 K.</li>
+ <li>Function <b>sv_p</b> computes the vapour  specific entropy as a function of pressure. For overcritical pressures,
+ the critical  specific entropyis returned. An approximation is used for temperatures > 623.15 K.</li>
+ <li>Function <b>rhol_T</b> computes the liquid density as a function of temperature. For overcritical temperatures,
+ the critical density is returned. An approximation is used for temperatures > 623.15 K.</li>
+ <li>Function <b>rhol_T</b> computes the vapour density as a function of temperature. For overcritical temperatures,
+ the critical density is returned. An approximation is used for temperatures > 623.15 K.</li>
+ </ul>
+ </p>
+ <p>All other functions are auxiliary functions called from the region functions to check a specific boundary.</p>
+ <ul>
+ <li>Function <b>boundary23ofT</b> computes the boundary pressure between regions 2 and 3 (input temperature)</li>
+ <li>Function <b>boundary23ofp</b> computes the boundary temperature between regions 2 and 3 (input pressure)</li>
+ <li>Function <b>hlowerofp5</b> computes the lower specific enthalpy limit of region 5 (input p, T=1073.15 K)</li>
+ <li>Function <b>hupperofp5</b> computes the upper specific enthalpy limit of region 5 (input p, T=2273.15 K)</li>
+ <li>Function <b>slowerofp5</b> computes the lower specific entropy limit of region 5 (input p, T=1073.15 K)</li>
+ <li>Function <b>supperofp5</b> computes the upper specific entropy limit of region 5 (input p, T=2273.15 K)</li>
+ <li>Function <b>hlowerofp1</b> computes the lower specific enthalpy limit of region 1 (input p, T=273.15 K)</li>
+ <li>Function <b>hupperofp1</b> computes the upper specific enthalpy limit of region 1 (input p, T=623.15 K)</li>
+ <li>Function <b>slowerofp1</b> computes the lower specific entropy limit of region 1 (input p, T=273.15 K)</li>
+ <li>Function <b>supperofp1</b> computes the upper specific entropy limit of region 1 (input p, T=623.15 K)</li>
+ <li>Function <b>hlowerofp2</b> computes the lower specific enthalpy limit of region 2 (input p, T=623.15 K)</li>
+ <li>Function <b>hupperofp2</b> computes the upper specific enthalpy limit of region 2 (input p, T=1073.15 K)</li>
+ <li>Function <b>slowerofp2</b> computes the lower specific entropy limit of region 2 (input p, T=623.15 K)</li>
+ <li>Function <b>supperofp2</b> computes the upper specific entropy limit of region 2 (input p, T=1073.15 K)</li>
+ <li>Function <b>d1n</b> computes the density in region 1 as function of pressure and temperature</li>
+ <li>Function <b>d2n</b> computes the density in region 2 as function of pressure and temperature</li>
+ <li>Function <b>dhot1ofp</b> computes the hot density limit of region 1 (input p, T=623.15 K)</li>
+ <li>Function <b>dupper1ofT</b>computes the high pressure density limit of region 1 (input T, p=100MPa)</li>
+ <li>Function <b>hl_p_R4b</b> computes a high accuracy approximation to the liquid enthalpy for temperatures > 623.15 K (input p)</li>
+ <li>Function <b>hv_p_R4b</b> computes a high accuracy approximation to the vapour enthalpy for temperatures > 623.15 K (input p)</li>
+ <li>Function <b>sl_p_R4b</b> computes a high accuracy approximation to the liquid entropy for temperatures > 623.15 K (input p)</li>
+ <li>Function <b>sv_p_R4b</b> computes a high accuracy approximation to the vapour entropy for temperatures > 623.15 K (input p)</li>
+ <li>Function <b>rhol_p_R4b</b> computes a high accuracy approximation to the liquid density for temperatures > 623.15 K (input p)</li>
+ <li>Function <b>rhov_p_R4b</b> computes a high accuracy approximation to the vapour density for temperatures > 623.15 K (input p)</li>
+ </ul>
+ </p>
+<h4>Version Info and Revision history
+</h4>
+ <ul>
+<li>First implemented: <i>July, 2000</i>
+       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+       </li>
+</ul>
+<address>Authors: Hubertus Tummescheit, Jonas Eborn and Falko Jens Wagner<br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+ </address>
+ <ul>
+ <li>Initial version: July 2000</li>
+ <li>Revised and extended for inclusion in Modelica.Thermal: December 2002</li>
+</ul>
+</HTML>
+"), Icon(graphics={
+          Text(
+            extent={{-102,0},{24,-26}},
+            lineColor={242,148,0},
+            textString=
+                 "Thermo"),
+          Text(
+            extent={{-4,8},{68,-34}},
+            lineColor={46,170,220},
+            textString=
+                 "SysPro"),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
+                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
+                -50,6},{-62,2}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
+                8},{-42,22},{-42,30},{-44,38}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
+                12},{-26,12},{-28,12},{-26,20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,30},{-6,26}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,36},{-6,32}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,42},{-6,38}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,48},{-6,44}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,32},{-2,28}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,38},{-2,34}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,44},{-2,40}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,50},{-2,46}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
+                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
+                -50,6},{-62,2}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Line(
+            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+            color={46,170,220},
+            thickness=0.5),
+          Polygon(
+            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+          Line(
+            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+            color={0,0,255},
+            smooth=Smooth.None),
+          Line(
+            points={{80,80},{100,100}},
+            color={0,0,255},
+            smooth=Smooth.None)}));
+  end Regions;
+  //===================================================================
+  //                      Base functions
+
+  //===================================================================
+
+  package Basic "Base functions as described in IAWPS/IF97"
+
+    function g1 "Gibbs function for region 1: g(p,T)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                                g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+    protected
+      Real pi1 "dimensionless pressure";
+      Real tau1 "dimensionless temperature";
+      Real[45] o "vector of auxiliary variables";
+    algorithm
+    //   assert(p > triple.ptriple,
+    //     "IF97 medium function g1 called with too low pressure\n" +
+    //     "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+    //   assert(p <= 100.0e6,
+    //     "IF97 medium function g1: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
+    //   assert(T >= 273.15,
+    //     "IF97 medium function g1: the temperature (= " + String(T) + " K)  is lower than 273.15 K!");
+      g.p := p;
+      g.T := T;
+      g.R := data.RH2O;
+      g.pi := max(p,triple.ptriple)/data.PSTAR1;
+      g.tau := data.TSTAR1/max(T,triple.Ttriple);
+      pi1 := 7.1000000000000 - g.pi;
+      tau1 := -1.22200000000000 + g.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];
+      g.g := pi1*(pi1*(pi1*(o[10]*(-0.000031679644845054 + o[2]*(-2.82707979853120e-6
+         - 8.5205128120103e-10*o[6])) + pi1*(o[12]*(-2.24252819080000e-6 + (-6.5171222895601e-7
+         - 1.43417299379240e-13*o[13])*o[7]) + pi1*(-4.0516996860117e-7*o[14]
+         + o[16]*((-1.27343017416410e-9 - 1.74248712306340e-10*o[11])*o[36]
+         + o[19]*(-6.8762131295531e-19*o[34] + o[15]*(1.44783078285210e-20*o[
+        32] + o[20]*(2.63357816627950e-23*o[30] + pi1*(-1.19476226400710e-23*
+        o[28] + pi1*(1.82280945814040e-24*o[26] - 9.3537087292458e-26*o[24]*
+        pi1))))))))) + o[8]*(-0.00047184321073267 + o[7]*(-0.000300017807930260
+         + (0.000047661393906987 + o[1]*(-4.4141845330846e-6 -
+        7.2694996297594e-16*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))))) + (
+        0.146329712131670 + tau1*(-0.84548187169114 + tau1*(-3.7563603672040
+         + tau1*(3.3855169168385 + tau1*(-0.95791963387872 + tau1*(
+        0.157720385132280 + (-0.0166164171995010 + 0.00081214629983568*tau1)*
+        tau1))))))/o[1];
+
+      g.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))));
+
+      g.gpipi := pi1*(o[10]*(-0.000190077869070324 + o[2]*(-0.0000169624787911872
+         - 5.1123076872062e-9*o[6])) + pi1*(o[12]*(-0.0000269103382896000 + (
+        -7.8205467474721e-6 - 1.72100759255088e-12*o[13])*o[7]) + pi1*(-8.1033993720234e-6
+        *o[14] + o[16]*((-7.1312089753190e-8 - 9.7579278891550e-9*o[11])*o[36]
+         + o[19]*(-2.88800951441230e-16*o[34] + o[15]*(7.3260237612316e-18*o[
+        32] + o[20]*(2.13846547101895e-20*o[30] + pi1*(-1.03944316968618e-20*
+        o[28] + pi1*(1.69521279607057e-21*o[26] - 9.2788790594118e-23*o[24]*
+        pi1))))))))) + o[8]*(-0.00094368642146534 + o[7]*(-0.00060003561586052
+         + (0.000095322787813974 + o[1]*(-8.8283690661692e-6 -
+        1.45389992595188e-15*o[9]))*tau1));
+
+      g.gtau := pi1*(o[38]*(-0.00254871721114236 + o[1]*(0.0042494411096112
+         + (0.0189900682184190 + (-0.0218417171754140 - 0.000158515073909790*
+        o[1])*o[1])*o[6])) + pi1*(o[10]*(0.00141552963219801 + o[2]*(
+        0.000047661393906987 + o[1]*(-0.0000132425535992538 -
+        1.23581493705910e-14*o[9]))) + pi1*(o[12]*(0.000126718579380216 -
+        5.1123076872062e-9*o[37]) + pi1*(o[39]*(0.0000112126409540000 + (
+        1.30342445791202e-6 - 1.43417299379240e-12*o[13])*o[7]) + pi1*(
+        3.2413597488094e-6*o[5] + o[16]*((1.40077319158051e-8 +
+        1.04549227383804e-9*o[11])*o[45] + o[19]*(1.99410180757040e-17*o[44]
+         + o[15]*(-4.4882754268415e-19*o[42] + o[20]*(-1.00075970318621e-21*o[
+        28] + pi1*(4.6595728296277e-22*o[26] + pi1*(-7.2912378325616e-23*o[24]
+         + 3.8350205789908e-24*o[41]*pi1))))))))))) + o[8]*(-0.292659424263340
+         + tau1*(0.84548187169114 + o[1]*(3.3855169168385 + tau1*(-1.91583926775744
+         + tau1*(0.47316115539684 + (-0.066465668798004 + 0.0040607314991784*
+        tau1)*tau1)))));
+
+      g.gtautau := pi1*(o[36]*(0.0254871721114236 + o[1]*(-0.033995528876889
+         + (-0.037980136436838 - 0.00031703014781958*o[2])*o[6])) + pi1*(o[12]
+        *(-0.0056621185287920 + o[6]*(-0.0000264851071985076 -
+        1.97730389929456e-13*o[9])) + pi1*((-0.00063359289690108 -
+        2.55615384360309e-8*o[37])*o[39] + pi1*(pi1*(-0.0000291722377392842*o[
+        38] + o[16]*(o[19]*(-5.9823054227112e-16*o[32] + o[15]*(o[20]*(
+        3.9029628424262e-20*o[26] + pi1*(-1.86382913185108e-20*o[24] + pi1*(
+        2.98940751135026e-21*o[41] - (1.61070864317613e-22*pi1)/(o[1]*o[22]*o[
+        3]*tau1)))) + 1.43624813658928e-17/(o[22]*tau1))) + (-1.68092782989661e-7
+         - 7.3184459168663e-9*o[11])/(o[2]*o[3]*tau1))) + (-0.000067275845724000
+         + (-3.9102733737361e-6 - 1.29075569441316e-11*o[13])*o[7])/(o[1]*o[2]
+        *tau1))))) + o[10]*(0.87797827279002 + tau1*(-1.69096374338228 + o[7]
+        *(-1.91583926775744 + tau1*(0.94632231079368 + (-0.199397006394012 +
+        0.0162429259967136*tau1)*tau1))));
+
+      g.gtaupi := o[38]*(0.00254871721114236 + o[1]*(-0.0042494411096112 + (-0.0189900682184190
+         + (0.0218417171754140 + 0.000158515073909790*o[1])*o[1])*o[6])) +
+        pi1*(o[10]*(-0.00283105926439602 + o[2]*(-0.000095322787813974 + o[1]
+        *(0.0000264851071985076 + 2.47162987411820e-14*o[9]))) + pi1*(o[12]*(
+        -0.00038015573814065 + 1.53369230616185e-8*o[37]) + pi1*(o[39]*(-0.000044850563816000
+         + (-5.2136978316481e-6 + 5.7366919751696e-12*o[13])*o[7]) + pi1*(-0.0000162067987440468
+        *o[5] + o[16]*((-1.12061855326441e-7 - 8.3639381907043e-9*o[11])*o[45]
+         + o[19]*(-4.1876137958978e-16*o[44] + o[15]*(1.03230334817355e-17*o[
+        42] + o[20]*(2.90220313924001e-20*o[28] + pi1*(-1.39787184888831e-20*
+        o[26] + pi1*(2.26028372809410e-21*o[24] - 1.22720658527705e-22*o[41]*
+        pi1))))))))));
+    end g1;
+
+    function g2 "Gibbs function for region 2: g(p,T)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                                g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+    protected
+      Real tau2 "dimensionless temperature";
+      Real[55] o "vector of auxiliary variables";
+    algorithm
+      g.p := p;
+      g.T := T;
+      g.R := data.RH2O;
+    //   assert(p > triple.ptriple,
+    //     "IF97 medium function g2 called with too low pressure\n" +
+    //     "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+    //   assert(p <= 100.0e6,
+    //     "IF97 medium function g2: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
+    //   assert(T >= 273.15,
+    //     "IF97 medium function g2: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
+    //   assert(T <= 1073.15,
+    //     "IF97 medium function g2: the input temperature (= " + String(T) + " K) is higher than the limit of 1073.15 K");
+      g.pi := max(p,triple.ptriple)/data.PSTAR2;
+      g.tau := data.TSTAR2/max(T,triple.Ttriple);
+      tau2 := -0.5 + g.tau;
+      o[1] := tau2*tau2;
+      o[2] := o[1]*tau2;
+      o[3] := -0.050325278727930*o[2];
+      o[4] := -0.057581259083432 + o[3];
+      o[5] := o[4]*tau2;
+      o[6] := -0.045996013696365 + o[5];
+      o[7] := o[6]*tau2;
+      o[8] := -0.0178348622923580 + o[7];
+      o[9] := o[8]*tau2;
+      o[10] := o[1]*o[1];
+      o[11] := o[10]*o[10];
+      o[12] := o[11]*o[11];
+      o[13] := o[10]*o[11]*o[12]*tau2;
+      o[14] := o[1]*o[10]*tau2;
+      o[15] := o[10]*o[11]*tau2;
+      o[16] := o[1]*o[12]*tau2;
+      o[17] := o[1]*o[11]*tau2;
+      o[18] := o[1]*o[10]*o[11];
+      o[19] := o[10]*o[11]*o[12];
+      o[20] := o[1]*o[10];
+      o[21] := g.pi*g.pi;
+      o[22] := o[21]*o[21];
+      o[23] := o[21]*o[22];
+      o[24] := o[10]*o[12]*tau2;
+      o[25] := o[12]*o[12];
+      o[26] := o[11]*o[12]*o[25]*tau2;
+      o[27] := o[10]*o[12];
+      o[28] := o[1]*o[10]*o[11]*tau2;
+      o[29] := o[10]*o[12]*o[25]*tau2;
+      o[30] := o[1]*o[10]*o[25]*tau2;
+      o[31] := o[1]*o[11]*o[12];
+      o[32] := o[1]*o[12];
+      o[33] := g.tau*g.tau;
+      o[34] := o[33]*o[33];
+      o[35] := -0.000053349095828174*o[13];
+      o[36] := -0.087594591301146 + o[35];
+      o[37] := o[2]*o[36];
+      o[38] := -0.0078785554486710 + o[37];
+      o[39] := o[1]*o[38];
+      o[40] := -0.00037897975032630 + o[39];
+      o[41] := o[40]*tau2;
+      o[42] := -0.000066065283340406 + o[41];
+      o[43] := o[42]*tau2;
+      o[44] := 5.7870447262208e-6*tau2;
+      o[45] := -0.301951672367580*o[2];
+      o[46] := -0.172743777250296 + o[45];
+      o[47] := o[46]*tau2;
+      o[48] := -0.091992027392730 + o[47];
+      o[49] := o[48]*tau2;
+      o[50] := o[1]*o[11];
+      o[51] := o[10]*o[11];
+      o[52] := o[11]*o[12]*o[25];
+      o[53] := o[10]*o[12]*o[25];
+      o[54] := o[1]*o[10]*o[25];
+      o[55] := o[11]*o[12]*tau2;
+
+      g.g := g.pi*(-0.00177317424732130 + o[9] + g.pi*(tau2*(-0.000033032641670203
+         + (-0.000189489875163150 + o[1]*(-0.0039392777243355 + (-0.043797295650573
+         - 0.0000266745479140870*o[13])*o[2]))*tau2) + g.pi*(
+        2.04817376923090e-8 + (4.3870667284435e-7 + o[1]*(-0.000032277677238570
+         + (-0.00150339245421480 - 0.040668253562649*o[13])*o[2]))*tau2 + g.
+        pi*(g.pi*(2.29220763376610e-6*o[14] + g.pi*((-1.67147664510610e-11 +
+        o[15]*(-0.00211714723213550 - 23.8957419341040*o[16]))*o[2] + g.pi*(-5.9059564324270e-18
+         + o[17]*(-1.26218088991010e-6 - 0.038946842435739*o[18]) + g.pi*(o[
+        11]*(1.12562113604590e-11 - 8.2311340897998*o[19]) + g.pi*(
+        1.98097128020880e-8*o[15] + g.pi*(o[10]*(1.04069652101740e-19 + (-1.02347470959290e-13
+         - 1.00181793795110e-9*o[10])*o[20]) + o[23]*(o[13]*(-8.0882908646985e-11
+         + 0.106930318794090*o[24]) + o[21]*(-0.33662250574171*o[26] + o[21]*
+        (o[27]*(8.9185845355421e-25 + (3.06293168762320e-13 -
+        4.2002467698208e-6*o[15])*o[28]) + g.pi*(-5.9056029685639e-26*o[24]
+         + g.pi*(3.7826947613457e-6*o[29] + g.pi*(-1.27686089346810e-15*o[30]
+         + o[31]*(7.3087610595061e-29 + o[18]*(5.5414715350778e-17 -
+        9.4369707241210e-7*o[32]))*g.pi)))))))))))) + tau2*(-7.8847309559367e-10
+         + (1.27907178522850e-8 + 4.8225372718507e-7*tau2)*tau2))))) + (-0.0056087911830200
+         + g.tau*(0.071452738814550 + g.tau*(-0.40710498239280 + g.tau*(
+        1.42408197144400 + g.tau*(-4.3839511194500 + g.tau*(-9.6927686002170
+         + g.tau*(10.0866556801800 + (-0.284086326077200 + 0.0212684635330700
+        *g.tau)*g.tau) + Modelica.Math.log(g.pi)))))))/(o[34]*g.tau);
+
+      g.gpi := (1.00000000000000 + g.pi*(-0.00177317424732130 + o[9] + g.pi*(
+        o[43] + g.pi*(6.1445213076927e-8 + (1.31612001853305e-6 + o[1]*(-0.000096833031715710
+         + (-0.0045101773626444 - 0.122004760687947*o[13])*o[2]))*tau2 + g.pi
+        *(g.pi*(0.0000114610381688305*o[14] + g.pi*((-1.00288598706366e-10 +
+        o[15]*(-0.0127028833928130 - 143.374451604624*o[16]))*o[2] + g.pi*(-4.1341695026989e-17
+         + o[17]*(-8.8352662293707e-6 - 0.272627897050173*o[18]) + g.pi*(o[11]
+        *(9.0049690883672e-11 - 65.849072718398*o[19]) + g.pi*(
+        1.78287415218792e-7*o[15] + g.pi*(o[10]*(1.04069652101740e-18 + (-1.02347470959290e-12
+         - 1.00181793795110e-8*o[10])*o[20]) + o[23]*(o[13]*(-1.29412653835176e-9
+         + 1.71088510070544*o[24]) + o[21]*(-6.0592051033508*o[26] + o[21]*(o[
+        27]*(1.78371690710842e-23 + (6.1258633752464e-12 -
+        0.000084004935396416*o[15])*o[28]) + g.pi*(-1.24017662339842e-24*o[24]
+         + g.pi*(0.000083219284749605*o[29] + g.pi*(-2.93678005497663e-14*o[
+        30] + o[31]*(1.75410265428146e-27 + o[18]*(1.32995316841867e-15 -
+        0.0000226487297378904*o[32]))*g.pi)))))))))))) + tau2*(-3.15389238237468e-9
+         + (5.1162871409140e-8 + 1.92901490874028e-6*tau2)*tau2))))))/g.pi;
+
+      g.gpipi := (-1.00000000000000 + o[21]*(o[43] + g.pi*(
+        1.22890426153854e-7 + (2.63224003706610e-6 + o[1]*(-0.000193666063431420
+         + (-0.0090203547252888 - 0.244009521375894*o[13])*o[2]))*tau2 + g.pi
+        *(g.pi*(0.000045844152675322*o[14] + g.pi*((-5.0144299353183e-10 + o[
+        15]*(-0.063514416964065 - 716.87225802312*o[16]))*o[2] + g.pi*(-2.48050170161934e-16
+         + o[17]*(-0.000053011597376224 - 1.63576738230104*o[18]) + g.pi*(o[
+        11]*(6.3034783618570e-10 - 460.94350902879*o[19]) + g.pi*(
+        1.42629932175034e-6*o[15] + g.pi*(o[10]*(9.3662686891566e-18 + (-9.2112723863361e-12
+         - 9.0163614415599e-8*o[10])*o[20]) + o[23]*(o[13]*(-1.94118980752764e-8
+         + 25.6632765105816*o[24]) + o[21]*(-103.006486756963*o[26] + o[21]*(
+        o[27]*(3.3890621235060e-22 + (1.16391404129682e-10 -
+        0.00159609377253190*o[15])*o[28]) + g.pi*(-2.48035324679684e-23*o[24]
+         + g.pi*(0.00174760497974171*o[29] + g.pi*(-6.4609161209486e-13*o[30]
+         + o[31]*(4.0344361048474e-26 + o[18]*(3.05889228736295e-14 -
+        0.00052092078397148*o[32]))*g.pi)))))))))))) + tau2*(-9.4616771471240e-9
+         + (1.53488614227420e-7 + o[44])*tau2)))))/o[21];
+
+      g.gtau := (0.0280439559151000 + g.tau*(-0.285810955258200 + g.tau*(
+        1.22131494717840 + g.tau*(-2.84816394288800 + g.tau*(4.3839511194500
+         + o[33]*(10.0866556801800 + (-0.56817265215440 + 0.063805390599210*g.
+         tau)*g.tau))))))/(o[33]*o[34]) + g.pi*(-0.0178348622923580 + o[49]
+         + g.pi*(-0.000033032641670203 + (-0.00037897975032630 + o[1]*(-0.0157571108973420
+         + (-0.306581069554011 - 0.00096028372490713*o[13])*o[2]))*tau2 + g.
+        pi*(4.3870667284435e-7 + o[1]*(-0.000096833031715710 + (-0.0090203547252888
+         - 1.42338887469272*o[13])*o[2]) + g.pi*(-7.8847309559367e-10 + g.pi*
+        (0.0000160454534363627*o[20] + g.pi*(o[1]*(-5.0144299353183e-11 + o[
+        15]*(-0.033874355714168 - 836.35096769364*o[16])) + g.pi*((-0.0000138839897890111
+         - 0.97367106089347*o[18])*o[50] + g.pi*(o[14]*(9.0049690883672e-11
+         - 296.320827232793*o[19]) + g.pi*(2.57526266427144e-7*o[51] + g.pi*(
+        o[2]*(4.1627860840696e-19 + (-1.02347470959290e-12 -
+        1.40254511313154e-8*o[10])*o[20]) + o[23]*(o[19]*(-2.34560435076256e-9
+         + 5.3465159397045*o[24]) + o[21]*(-19.1874828272775*o[52] + o[21]*(o[
+        16]*(1.78371690710842e-23 + (1.07202609066812e-11 -
+        0.000201611844951398*o[15])*o[28]) + g.pi*(-1.24017662339842e-24*o[27]
+         + g.pi*(0.000200482822351322*o[53] + g.pi*(-4.9797574845256e-14*o[54]
+         + (1.90027787547159e-27 + o[18]*(2.21658861403112e-15 -
+        0.000054734430199902*o[32]))*o[55]*g.pi)))))))))))) + (
+        2.55814357045700e-8 + 1.44676118155521e-6*tau2)*tau2))));
+
+      g.gtautau := (-0.168263735490600 + g.tau*(1.42905477629100 + g.tau*(-4.8852597887136
+         + g.tau*(8.5444918286640 + g.tau*(-8.7679022389000 + o[33]*(-0.56817265215440
+         + 0.127610781198420*g.tau)*g.tau)))))/(o[33]*o[34]*g.tau) + g.pi*(-0.091992027392730
+         + (-0.34548755450059 - 1.50975836183790*o[2])*tau2 + g.pi*(-0.00037897975032630
+         + o[1]*(-0.047271332692026 + (-1.83948641732407 - 0.033609930371750*
+        o[13])*o[2]) + g.pi*((-0.000193666063431420 + (-0.045101773626444 -
+        48.395221739552*o[13])*o[2])*tau2 + g.pi*(2.55814357045700e-8 +
+        2.89352236311042e-6*tau2 + g.pi*(0.000096272720618176*o[10]*tau2 + g.
+        pi*((-1.00288598706366e-10 + o[15]*(-0.50811533571252 -
+        28435.9329015838*o[16]))*tau2 + g.pi*(o[11]*(-0.000138839897890111 -
+        23.3681054614434*o[18])*tau2 + g.pi*((6.3034783618570e-10 -
+        10371.2289531477*o[19])*o[20] + g.pi*(3.09031519712573e-6*o[17] + g.
+        pi*(o[1]*(1.24883582522088e-18 + (-9.2112723863361e-12 -
+        1.82330864707100e-7*o[10])*o[20]) + o[23]*(o[1]*o[11]*o[12]*(-6.5676921821352e-8
+         + 261.979281045521*o[24])*tau2 + o[21]*(-1074.49903832754*o[1]*o[10]
+        *o[12]*o[25]*tau2 + o[21]*((3.3890621235060e-22 + (
+        3.6448887082716e-10 - 0.0094757567127157*o[15])*o[28])*o[32] + g.pi*(
+        -2.48035324679684e-23*o[16] + g.pi*(0.0104251067622687*o[1]*o[12]*o[
+        25]*tau2 + g.pi*(o[11]*o[12]*(4.7506946886790e-26 + o[18]*(
+        8.6446955947214e-14 - 0.00311986252139440*o[32]))*g.pi -
+        1.89230784411972e-12*o[10]*o[25]*tau2))))))))))))))));
+
+      g.gtaupi := -0.0178348622923580 + o[49] + g.pi*(-0.000066065283340406
+         + (-0.00075795950065260 + o[1]*(-0.0315142217946840 + (-0.61316213910802
+         - 0.00192056744981426*o[13])*o[2]))*tau2 + g.pi*(1.31612001853305e-6
+         + o[1]*(-0.000290499095147130 + (-0.0270610641758664 -
+        4.2701666240781*o[13])*o[2]) + g.pi*(-3.15389238237468e-9 + g.pi*(
+        0.000080227267181813*o[20] + g.pi*(o[1]*(-3.00865796119098e-10 + o[15]
+        *(-0.203246134285008 - 5018.1058061618*o[16])) + g.pi*((-0.000097187928523078
+         - 6.8156974262543*o[18])*o[50] + g.pi*(o[14]*(7.2039752706938e-10 -
+        2370.56661786234*o[19]) + g.pi*(2.31773639784430e-6*o[51] + g.pi*(o[2]
+        *(4.1627860840696e-18 + (-1.02347470959290e-11 - 1.40254511313154e-7*
+        o[10])*o[20]) + o[23]*(o[19]*(-3.7529669612201e-8 + 85.544255035272*o[
+        24]) + o[21]*(-345.37469089099*o[52] + o[21]*(o[16]*(
+        3.5674338142168e-22 + (2.14405218133624e-10 - 0.0040322368990280*o[15])
+        *o[28]) + g.pi*(-2.60437090913668e-23*o[27] + g.pi*(
+        0.0044106220917291*o[53] + g.pi*(-1.14534422144089e-12*o[54] + (
+        4.5606669011318e-26 + o[18]*(5.3198126736747e-14 -
+        0.00131362632479764*o[32]))*o[55]*g.pi)))))))))))) + (
+        1.02325742818280e-7 + o[44])*tau2)));
+    end g2;
+
+    function g2metastable
+      "Gibbs function for metastable part of region 2: g(p,T)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                                g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+    protected
+      Real pi "dimensionless pressure";
+      Real tau "dimensionless temperature";
+      Real tau2 "dimensionless temperature";
+      Real[27] o "vector of auxiliary variables";
+    algorithm
+      assert(p > triple.ptriple,
+        "IF97 medium function g2metastable called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      assert(p <= 100.0e6,
+        "IF97 medium function g2metastable: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
+      assert(T >= 273.15,
+        "IF97 medium function g2metastable: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
+      assert(T <= 1073.15,
+        "IF97 medium function g2metastable: the input temperature (= " + String(T) + " K) is higher than the limit of 1073.15 K");
+      g.p := p;
+      g.T := T;
+      g.R := data.RH2O;
+      g.pi := p/data.PSTAR2;
+      g.tau := data.TSTAR2/T;
+      tau2 := -0.5 + g.tau;
+      o[1] := tau2*tau2;
+      o[2] := o[1]*tau2;
+      o[3] := o[1]*o[1];
+      o[4] := o[1]*o[3];
+      o[5] := -0.0040813178534455*o[4];
+      o[6] := -0.072334555213245 + o[5];
+      o[7] := o[2]*o[6];
+      o[8] := -0.088223831943146 + o[7];
+      o[9] := o[1]*o[8];
+      o[10] := o[3]*o[3];
+      o[11] := o[10]*tau2;
+      o[12] := o[10]*o[3];
+      o[13] := o[1]*o[3]*tau2;
+      o[14] := g.tau*g.tau;
+      o[15] := o[14]*o[14];
+      o[16] := -0.015238081817394*o[11];
+      o[17] := -0.106091843797284 + o[16];
+      o[18] := o[17]*o[4];
+      o[19] := 0.0040195606760414 + o[18];
+      o[20] := o[19]*tau2;
+      o[21] := g.pi*g.pi;
+      o[22] := -0.0448944963879005*o[4];
+      o[23] := -0.361672776066225 + o[22];
+      o[24] := o[2]*o[23];
+      o[25] := -0.176447663886292 + o[24];
+      o[26] := o[25]*tau2;
+      o[27] := o[3]*tau2;
+
+      g.g := g.pi*(-0.0073362260186506 + o[9] + g.pi*(g.pi*((-0.0063498037657313
+         - 0.086043093028588*o[12])*o[3] + g.pi*(o[13]*(0.007532158152277 -
+        0.0079238375446139*o[2]) + o[11]*g.pi*(-0.00022888160778447 -
+        0.002645650148281*tau2))) + (0.0020097803380207 + (-0.053045921898642
+         - 0.007619040908697*o[11])*o[4])*tau2)) + (-0.00560879118302 + g.tau
+        *(0.07145273881455 + g.tau*(-0.4071049823928 + g.tau*(1.424081971444
+         + g.tau*(-4.38395111945 + g.tau*(-9.6937268393049 + g.tau*(
+        10.087275970006 + (-0.2840863260772 + 0.02126846353307*g.tau)*g.tau)
+         + Modelica.Math.log(g.pi)))))))/(o[15]*g.tau);
+
+      g.gpi := (1.0 + g.pi*(-0.0073362260186506 + o[9] + g.pi*(o[20] + g.pi*(
+        (-0.0190494112971939 - 0.258129279085764*o[12])*o[3] + g.pi*(o[13]*(
+        0.030128632609108 - 0.0316953501784556*o[2]) + o[11]*g.pi*(-0.00114440803892235
+         - 0.013228250741405*tau2))))))/g.pi;
+
+      g.gpipi := (-1. + o[21]*(o[20] + g.pi*((-0.0380988225943878 -
+        0.516258558171528*o[12])*o[3] + g.pi*(o[13]*(0.090385897827324 -
+        0.0950860505353668*o[2]) + o[11]*g.pi*(-0.0045776321556894 -
+        0.05291300296562*tau2)))))/o[21];
+
+      g.gtau := (0.0280439559151 + g.tau*(-0.2858109552582 + g.tau*(
+        1.2213149471784 + g.tau*(-2.848163942888 + g.tau*(4.38395111945 + o[
+        14]*(10.087275970006 + (-0.5681726521544 + 0.06380539059921*g.tau)*g.
+        tau))))))/(o[14]*o[15]) + g.pi*(o[26] + g.pi*(0.0020097803380207 + (-0.371321453290494
+         - 0.121904654539152*o[11])*o[4] + g.pi*((-0.0253992150629252 -
+        1.37668948845741*o[12])*o[2] + g.pi*((0.052725107065939 -
+        0.079238375446139*o[2])*o[4] + o[10]*g.pi*(-0.00205993447006023 -
+        0.02645650148281*tau2)))));
+
+      g.gtautau := (-0.1682637354906 + g.tau*(1.429054776291 + g.tau*(-4.8852597887136
+         + g.tau*(8.544491828664 + g.tau*(-8.7679022389 + o[14]*(-0.5681726521544
+         + 0.12761078119842*g.tau)*g.tau)))))/(o[14]*o[15]*g.tau) + g.pi*(-0.176447663886292
+         + o[2]*(-1.4466911042649 - 0.448944963879005*o[4]) + g.pi*((-2.22792871974296
+         - 1.82856981808728*o[11])*o[27] + g.pi*(o[1]*(-0.0761976451887756 -
+        20.6503423268611*o[12]) + g.pi*((0.316350642395634 -
+        0.713145379015251*o[2])*o[27] + o[13]*g.pi*(-0.0164794757604818 -
+        0.23810851334529*tau2)))));
+
+      g.gtaupi := o[26] + g.pi*(0.0040195606760414 + (-0.742642906580988 -
+        0.243809309078304*o[11])*o[4] + g.pi*((-0.0761976451887756 -
+        4.13006846537222*o[12])*o[2] + g.pi*((0.210900428263756 -
+        0.316953501784556*o[2])*o[4] + o[10]*g.pi*(-0.0102996723503012 -
+        0.13228250741405*tau2))));
+    end g2metastable;
+
+    function f3 "Helmholtz function for region 3: f(d,T)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature (K)";
+      output ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
+                                    f
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+    protected
+      Real[40] o "vector of auxiliary variables";
+    algorithm
+      f.T := T;
+      f.d := d;
+      f.R := data.RH2O;
+      f.tau := data.TCRIT/T;
+      f.delta := if (d == data.DCRIT and T == data.TCRIT) then 1 - Modelica.
+        Constants.eps else abs(d/data.DCRIT);
+      o[1] := f.tau*f.tau;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*f.tau;
+      o[4] := o[1]*f.tau;
+      o[5] := o[2]*o[2];
+      o[6] := o[1]*o[5]*f.tau;
+      o[7] := o[5]*f.tau;
+      o[8] := -0.64207765181607*o[1];
+      o[9] := 0.88521043984318 + o[8];
+      o[10] := o[7]*o[9];
+      o[11] := -1.15244078066810 + o[10];
+      o[12] := o[11]*o[2];
+      o[13] := -1.26543154777140 + o[12];
+      o[14] := o[1]*o[13];
+      o[15] := o[1]*o[2]*o[5]*f.tau;
+      o[16] := o[2]*o[5];
+      o[17] := o[1]*o[5];
+      o[18] := o[5]*o[5];
+      o[19] := o[1]*o[18]*o[2];
+      o[20] := o[1]*o[18]*o[2]*f.tau;
+      o[21] := o[18]*o[5];
+      o[22] := o[1]*o[18]*o[5];
+      o[23] := 0.251168168486160*o[2];
+      o[24] := 0.078841073758308 + o[23];
+      o[25] := o[15]*o[24];
+      o[26] := -6.1005234513930 + o[25];
+      o[27] := o[26]*f.tau;
+      o[28] := 9.7944563083754 + o[27];
+      o[29] := o[2]*o[28];
+      o[30] := -1.70429417648412 + o[29];
+      o[31] := o[1]*o[30];
+      o[32] := f.delta*f.delta;
+      o[33] := -10.9153200808732*o[1];
+      o[34] := 13.2781565976477 + o[33];
+      o[35] := o[34]*o[7];
+      o[36] := -6.9146446840086 + o[35];
+      o[37] := o[2]*o[36];
+      o[38] := -2.53086309554280 + o[37];
+      o[39] := o[38]*f.tau;
+      o[40] := o[18]*o[5]*f.tau;
+
+      f.f := -15.7328452902390 + f.tau*(20.9443969743070 + (-7.6867707878716
+         + o[3]*(2.61859477879540 + o[4]*(-2.80807811486200 + o[1]*(
+        1.20533696965170 - 0.0084566812812502*o[6]))))*f.tau) + f.delta*(o[14]
+         + f.delta*(0.38493460186671 + o[1]*(-0.85214708824206 + o[2]*(
+        4.8972281541877 + (-3.05026172569650 + o[15]*(0.039420536879154 +
+        0.125584084243080*o[2]))*f.tau)) + f.delta*(-0.279993296987100 + o[1]
+        *(1.38997995694600 + o[1]*(-2.01899150235700 + o[16]*(-0.0082147637173963
+         - 0.47596035734923*o[17]))) + f.delta*(0.043984074473500 + o[1]*(-0.44476435428739
+         + o[1]*(0.90572070719733 + 0.70522450087967*o[19])) + f.delta*(f.
+        delta*(-0.0221754008730960 + o[1]*(0.094260751665092 +
+        0.164362784479610*o[21]) + f.delta*(-0.0135033722413480*o[1] + f.
+        delta*(-0.0148343453524720*o[22] + f.delta*(o[1]*(0.00057922953628084
+         + 0.0032308904703711*o[21]) + f.delta*(0.000080964802996215 -
+        0.000044923899061815*f.delta*o[22] - 0.000165576797950370*f.tau)))))
+         + (0.107705126263320 + o[1]*(-0.32913623258954 - 0.50871062041158*o[
+        20]))*f.tau))))) + 1.06580700285130*Modelica.Math.log(f.delta);
+
+      f.fdelta := (1.06580700285130 + f.delta*(o[14] + f.delta*(
+        0.76986920373342 + o[31] + f.delta*(-0.83997989096130 + o[1]*(
+        4.1699398708380 + o[1]*(-6.0569745070710 + o[16]*(-0.0246442911521889
+         - 1.42788107204769*o[17]))) + f.delta*(0.175936297894000 + o[1]*(-1.77905741714956
+         + o[1]*(3.6228828287893 + 2.82089800351868*o[19])) + f.delta*(f.
+        delta*(-0.133052405238576 + o[1]*(0.56556450999055 + 0.98617670687766
+        *o[21]) + f.delta*(-0.094523605689436*o[1] + f.delta*(-0.118674762819776
+        *o[22] + f.delta*(o[1]*(0.0052130658265276 + 0.0290780142333399*o[21])
+         + f.delta*(0.00080964802996215 - 0.00049416288967996*f.delta*o[22]
+         - 0.00165576797950370*f.tau))))) + (0.53852563131660 + o[1]*(-1.64568116294770
+         - 2.54355310205790*o[20]))*f.tau))))))/f.delta;
+
+      f.fdeltadelta := (-1.06580700285130 + o[32]*(0.76986920373342 + o[31]
+         + f.delta*(-1.67995978192260 + o[1]*(8.3398797416760 + o[1]*(-12.1139490141420
+         + o[16]*(-0.049288582304378 - 2.85576214409538*o[17]))) + f.delta*(
+        0.52780889368200 + o[1]*(-5.3371722514487 + o[1]*(10.8686484863680 +
+        8.4626940105560*o[19])) + f.delta*(f.delta*(-0.66526202619288 + o[1]*
+        (2.82782254995276 + 4.9308835343883*o[21]) + f.delta*(-0.56714163413662
+        *o[1] + f.delta*(-0.83072333973843*o[22] + f.delta*(o[1]*(
+        0.041704526612220 + 0.232624113866719*o[21]) + f.delta*(
+        0.0072868322696594 - 0.0049416288967996*f.delta*o[22] -
+        0.0149019118155333*f.tau))))) + (2.15410252526640 + o[1]*(-6.5827246517908
+         - 10.1742124082316*o[20]))*f.tau)))))/o[32];
+
+      f.ftau := 20.9443969743070 + (-15.3735415757432 + o[3]*(
+        18.3301634515678 + o[4]*(-28.0807811486200 + o[1]*(14.4640436358204
+         - 0.194503669468755*o[6]))))*f.tau + f.delta*(o[39] + f.delta*(f.tau
+        *(-1.70429417648412 + o[2]*(29.3833689251262 + (-21.3518320798755 + o[
+        15]*(0.86725181134139 + 3.2651861903201*o[2]))*f.tau)) + f.delta*((
+        2.77995991389200 + o[1]*(-8.0759660094280 + o[16]*(-0.131436219478341
+         - 12.3749692910800*o[17])))*f.tau + f.delta*((-0.88952870857478 + o[
+        1]*(3.6228828287893 + 18.3358370228714*o[19]))*f.tau + f.delta*(
+        0.107705126263320 + o[1]*(-0.98740869776862 - 13.2264761307011*o[20])
+         + f.delta*((0.188521503330184 + 4.2734323964699*o[21])*f.tau + f.
+        delta*(-0.0270067444826960*f.tau + f.delta*(-0.38569297916427*o[40]
+         + f.delta*(f.delta*(-0.000165576797950370 - 0.00116802137560719*f.
+        delta*o[40]) + (0.00115845907256168 + 0.084003152229649*o[21])*f.tau)))))))));
+
+      f.ftautau := -15.3735415757432 + o[3]*(109.980980709407 + o[4]*(-252.727030337580
+         + o[1]*(159.104479994024 - 4.2790807283126*o[6]))) + f.delta*(-2.53086309554280
+         + o[2]*(-34.573223420043 + (185.894192367068 - 174.645121293971*o[1])
+        *o[7]) + f.delta*(-1.70429417648412 + o[2]*(146.916844625631 + (-128.110992479253
+         + o[15]*(18.2122880381691 + 81.629654758002*o[2]))*f.tau) + f.delta*
+        (2.77995991389200 + o[1]*(-24.2278980282840 + o[16]*(-1.97154329217511
+         - 309.374232277000*o[17])) + f.delta*(-0.88952870857478 + o[1]*(
+        10.8686484863680 + 458.39592557179*o[19]) + f.delta*(f.delta*(
+        0.188521503330184 + 106.835809911747*o[21] + f.delta*(-0.0270067444826960
+         + f.delta*(-9.6423244791068*o[21] + f.delta*(0.00115845907256168 +
+        2.10007880574121*o[21] - 0.0292005343901797*o[21]*o[32])))) + (-1.97481739553724
+         - 330.66190326753*o[20])*f.tau)))));
+
+      f.fdeltatau := o[39] + f.delta*(f.tau*(-3.4085883529682 + o[2]*(
+        58.766737850252 + (-42.703664159751 + o[15]*(1.73450362268278 +
+        6.5303723806402*o[2]))*f.tau)) + f.delta*((8.3398797416760 + o[1]*(-24.2278980282840
+         + o[16]*(-0.39430865843502 - 37.124907873240*o[17])))*f.tau + f.
+        delta*((-3.5581148342991 + o[1]*(14.4915313151573 + 73.343348091486*o[
+        19]))*f.tau + f.delta*(0.53852563131660 + o[1]*(-4.9370434888431 -
+        66.132380653505*o[20]) + f.delta*((1.13112901998110 +
+        25.6405943788192*o[21])*f.tau + f.delta*(-0.189047211378872*f.tau + f.
+         delta*(-3.08554383331418*o[40] + f.delta*(f.delta*(-0.00165576797950370
+         - 0.0128482351316791*f.delta*o[40]) + (0.0104261316530551 +
+        0.75602837006684*o[21])*f.tau))))))));
+    end f3;
+
+    function g5 "base function for region 5: g(p,T)"
+      import ThermoSysPro;
+            extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output ThermoSysPro.Properties.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+    protected
+            Real[11] o "vector of auxiliary variables";
+    algorithm
+    //         assert(p > triple.ptriple,
+    //           "IF97 medium function g5 called with too low pressure\n" +
+    //           "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+    //         assert(p <= data.PLIMIT5,
+    //           "IF97 medium function g5: input pressure (= " + String(p) + " Pa) is higher than 10 Mpa in region 5");
+    //         assert(T <= 2273.15,
+    //           "IF97 medium function g5: input temperature (= " + String(T) + " K) is higher than limit of 2273.15K in region 5");
+            g.p := p;
+            g.T := T;
+            g.R := data.RH2O;
+            g.pi := max(p,triple.ptriple)/data.PSTAR5;
+            g.tau := data.TSTAR5/max(T,triple.Ttriple);
+            o[1] := g.tau*g.tau;
+            o[2] := -0.0045942820899910*o[1];
+            o[3] := 0.00217746787145710 + o[2];
+            o[4] := o[3]*g.tau;
+            o[5] := o[1]*g.tau;
+            o[6] := o[1]*o[1];
+            o[7] := o[6]*o[6];
+            o[8] := o[7]*g.tau;
+            o[9] := -7.9449656719138e-6*o[8];
+            o[10] := g.pi*g.pi;
+            o[11] := -0.0137828462699730*o[1];
+
+            g.g := g.pi*(-0.000125631835895920 + o[4] + g.pi*(-3.9724828359569e-6*o[
+              8] + 1.29192282897840e-7*o[5]*g.pi)) + (-0.0248051489334660 + g.tau*(
+              0.36901534980333 + g.tau*(-3.11613182139250 + g.tau*(-13.1799836742010
+               + (6.8540841634434 - 0.32961626538917*g.tau)*g.tau +
+              Modelica.Math.log(g.pi)))))/o[5];
+
+            g.gpi := (1.0 + g.pi*(-0.000125631835895920 + o[4] + g.pi*(o[9] +
+              3.8757684869352e-7*o[5]*g.pi)))/g.pi;
+
+            g.gpipi := (-1.00000000000000 + o[10]*(o[9] + 7.7515369738704e-7*o[5]*g.
+               pi))/o[10];
+
+            g.gtau := g.pi*(0.00217746787145710 + o[11] + g.pi*(-0.000035752345523612
+              *o[7] + 3.8757684869352e-7*o[1]*g.pi)) + (0.074415446800398 + g.tau*(
+              -0.73803069960666 + (3.11613182139250 + o[1]*(6.8540841634434 -
+              0.65923253077834*g.tau))*g.tau))/o[6];
+
+            g.gtautau := (-0.297661787201592 + g.tau*(2.21409209881998 + (-6.2322636427850
+               - 0.65923253077834*o[5])*g.tau))/(o[6]*g.tau) + g.pi*(-0.0275656925399460
+              *g.tau + g.pi*(-0.000286018764188897*o[1]*o[6]*g.tau +
+              7.7515369738704e-7*g.pi*g.tau));
+
+            g.gtaupi := 0.00217746787145710 + o[11] + g.pi*(-0.000071504691047224*o[
+              7] + 1.16273054608056e-6*o[1]*g.pi);
+    end g5;
+
+    function gibbs "Gibbs function for region 1, 2 or 5: g(p,T,region)"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+     input Integer region "IF97 region, 1, 2 or 5";
+      output Real g "dimensionless Gibbs funcion";
+    protected
+      ThermoSysPro.Properties.Common.GibbsDerivs gibbs
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+    algorithm
+      assert(region == 1 or region == 2 or region == 5,
+        "IF97 medium function gibbs called with wrong region (= " + String(region) + ").\n" +
+        "Only regions 1, 2 or 5 are possible");
+      if region
+         == 1 then
+        gibbs
+       := g1(p,T);
+      elseif
+      region == 2 then
+        gibbs
+       := g2(p,T);
+      else
+        gibbs
+       := g5(p,T);
+      end if;
+      g :=
+    gibbs.g;
+    end gibbs;
+
+    function g1pitau "derivative of g wrt pi and tau"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Real pi "dimensionless pressure";
+      output Real tau "dimensionless temperature";
+      output Real gpi "dimensionless dervative of Gibbs function wrt pi";
+      output Real gtau "dimensionless dervative of Gibbs function wrt tau";
+    protected
+      Real pi1 "dimensionless pressure";
+      Real tau1 "dimensionless temperature";
+      Real[28] o "vector of auxiliary variables";
+    algorithm
+      assert(p > triple.ptriple,
+        "IF97 medium function g1pitau called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      assert(p <= 100.0e6,
+        "IF97 medium function g1pitau: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
+      assert(T >= 273.15,
+        "IF97 medium function g1pitau: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
+      pi := p/data.PSTAR1;
+      tau := data.TSTAR1/T;
+      pi1 := 7.1 - pi;
+      tau1 := -1.222 + tau;
+      o[1] := tau1*tau1;
+      o[2] := o[1]*tau1;
+      o[3] := 1/o[2];
+      o[4] := o[1]*o[1];
+      o[5] := o[4]*o[4];
+      o[6] := o[1]*o[5];
+      o[7] := o[1]*o[4];
+      o[8] := 1/o[4];
+      o[9] := o[1]*o[4]*o[5];
+      o[10] := o[4]*tau1;
+      o[11] := 1/o[10];
+      o[12] := o[4]*o[5];
+      o[13] := o[5]*tau1;
+      o[14] := 1/o[13];
+      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[5]*o[5];
+      o[22] := o[21]*o[21];
+      o[23] := o[22]*o[5]*tau1;
+      o[24] := 1/o[23];
+      o[25] := o[22]*o[5];
+      o[26] := 1/o[25];
+      o[27] := o[1]*o[22]*o[4]*tau1;
+      o[28] := 1/o[27];
+      gtau := pi1*((-0.00254871721114236 + o[1]*(0.00424944110961118 + (
+        0.018990068218419 + (-0.021841717175414 - 0.00015851507390979*o[1])*o[
+        1])*o[7]))/o[6] + pi1*(o[8]*(0.00141552963219801 + o[4]*(
+        0.000047661393906987 + o[1]*(-0.0000132425535992538 -
+        1.2358149370591e-14*o[9]))) + pi1*(o[11]*(0.000126718579380216 -
+        5.11230768720618e-9*o[6]) + pi1*((0.000011212640954 + (
+        1.30342445791202e-6 - 1.4341729937924e-12*o[12])*o[2])/o[7] + pi1*(
+        3.24135974880936e-6*o[14] + o[16]*((1.40077319158051e-8 +
+        1.04549227383804e-9*o[10])/o[12] + o[19]*(1.9941018075704e-17/(o[1]*o[
+        21]*o[4]*o[5]) + o[15]*(-4.48827542684151e-19/o[22] + o[20]*(-1.00075970318621e-21
+        *o[28] + pi1*(4.65957282962769e-22*o[26] + pi1*(-7.2912378325616e-23*
+        o[24] + (3.83502057899078e-24*pi1)/(o[1]*o[22]*o[5])))))))))))) + o[3]
+        *(-0.29265942426334 + tau1*(0.84548187169114 + o[1]*(3.3855169168385
+         + tau1*(-1.91583926775744 + tau1*(0.47316115539684 + (-0.066465668798004
+         + 0.0040607314991784*tau1)*tau1)))));
+      gpi := pi1*(pi1*((0.000095038934535162 + o[4]*(8.4812393955936e-6 +
+        2.55615384360309e-9*o[7]))*o[8] + pi1*(o[11]*(8.9701127632e-6 + (
+        2.60684891582404e-6 + 5.7366919751696e-13*o[12])*o[2]) + pi1*(
+        2.02584984300585e-6/o[5] + o[16]*(o[19]*(o[15]*(o[20]*(-7.63737668221055e-22
+        /(o[1]*o[22]*o[4]) + pi1*(3.5842867920213e-22*o[28] + pi1*(-5.65070932023524e-23
+        *o[26] + 2.99318679335866e-24*o[24]*pi1))) - 3.33001080055983e-19/(o[
+        1]*o[21]*o[4]*o[5]*tau1)) + 1.44400475720615e-17/(o[21]*o[4]*o[5]*
+        tau1)) + (1.01874413933128e-8 + 1.39398969845072e-9*o[10])/(o[1]*o[5]
+        *tau1))))) + o[3]*(0.00094368642146534 + o[2]*(0.00060003561586052 +
+        (-0.000095322787813974 + o[1]*(8.8283690661692e-6 +
+        1.45389992595188e-15*o[9]))*tau1))) + o[14]*(-0.00028319080123804 + o[
+        1]*(0.00060706301565874 + o[7]*(0.018990068218419 + tau1*(
+        0.032529748770505 + (0.021841717175414 + 0.00005283835796993*o[1])*
+        tau1))));
+    end g1pitau;
+
+    function g2pitau "derivative of g wrt pi and tau"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Real pi "dimensionless pressure";
+      output Real tau "dimensionless temperature";
+      output Real gpi "dimensionless dervative of Gibbs function wrt pi";
+      output Real gtau "dimensionless dervative of Gibbs function wrt tau";
+    protected
+      Real tau2 "dimensionless temperature";
+      Real[22] o "vector of auxiliary variables";
+    algorithm
+      assert(p > triple.ptriple,
+        "IF97 medium function g2pitau called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      assert(p <= 100.0e6,
+        "IF97 medium function g2pitau: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
+      assert(T >= 273.15,
+        "IF97 medium function g2pitau: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
+      assert(T <= 1073.15,
+        "IF97 medium function g2pitau: the input temperature (= " + String(T) + " K) is higher than the limit of 1073.15 K");
+      pi := p/data.PSTAR2;
+      tau := data.TSTAR2/T;
+      tau2 := -0.5 + tau;
+      o[1] := tau*tau;
+      o[2] := o[1]*o[1];
+      o[3] := tau2*tau2;
+      o[4] := o[3]*tau2;
+      o[5] := o[3]*o[3];
+      o[6] := o[5]*o[5];
+      o[7] := o[6]*o[6];
+      o[8] := o[5]*o[6]*o[7]*tau2;
+      o[9] := o[3]*o[5];
+      o[10] := o[5]*o[6]*tau2;
+      o[11] := o[3]*o[7]*tau2;
+      o[12] := o[3]*o[5]*o[6];
+      o[13] := o[3]*o[5]*tau2;
+      o[14] := o[5]*o[6]*o[7];
+      o[15] := pi*pi;
+      o[16] := o[15]*o[15];
+      o[17] := o[15]*o[16];
+      o[18] := o[5]*o[7]*tau2;
+      o[19] := o[7]*o[7];
+      o[20] := o[3]*o[5]*o[6]*tau2;
+      o[21] := o[5]*o[7];
+      o[22] := o[3]*o[7];
+      gtau := (0.0280439559151 + tau*(-0.2858109552582 + tau*(1.2213149471784
+         + tau*(-2.848163942888 + tau*(4.38395111945 + o[1]*(10.08665568018
+         + (-0.5681726521544 + 0.06380539059921*tau)*tau))))))/(o[1]*o[2]) +
+        pi*(-0.017834862292358 + tau2*(-0.09199202739273 + (-0.172743777250296
+         - 0.30195167236758*o[4])*tau2) + pi*(-0.000033032641670203 + (-0.0003789797503263
+         + o[3]*(-0.015757110897342 + o[4]*(-0.306581069554011 -
+        0.000960283724907132*o[8])))*tau2 + pi*(4.3870667284435e-7 + o[3]*(-0.00009683303171571
+         + o[4]*(-0.0090203547252888 - 1.42338887469272*o[8])) + pi*(-7.8847309559367e-10
+         + (2.558143570457e-8 + 1.44676118155521e-6*tau2)*tau2 + pi*(
+        0.0000160454534363627*o[9] + pi*((-5.0144299353183e-11 + o[10]*(-0.033874355714168
+         - 836.35096769364*o[11]))*o[3] + pi*((-0.0000138839897890111 -
+        0.973671060893475*o[12])*o[3]*o[6] + pi*(o[13]*(9.0049690883672e-11
+         - 296.320827232793*o[14]) + pi*(2.57526266427144e-7*o[5]*o[6] + pi*(
+        o[4]*(4.1627860840696e-19 + (-1.0234747095929e-12 -
+        1.40254511313154e-8*o[5])*o[9]) + o[17]*(o[14]*(-2.34560435076256e-9
+         + 5.3465159397045*o[18]) + o[15]*(-19.1874828272775*o[19]*o[6]*o[7]
+         + o[15]*(o[11]*(1.78371690710842e-23 + (1.07202609066812e-11 -
+        0.000201611844951398*o[10])*o[20]) + pi*(-1.24017662339842e-24*o[21]
+         + pi*(0.000200482822351322*o[19]*o[5]*o[7] + pi*(-4.97975748452559e-14
+        *o[19]*o[3]*o[5] + (1.90027787547159e-27 + o[12]*(
+        2.21658861403112e-15 - 0.0000547344301999018*o[22]))*o[6]*o[7]*pi*
+        tau2))))))))))))))));
+      gpi := (1. + pi*(-0.0017731742473213 + tau2*(-0.017834862292358 + tau2*
+        (-0.045996013696365 + (-0.057581259083432 - 0.05032527872793*o[4])*
+        tau2)) + pi*(tau2*(-0.000066065283340406 + (-0.0003789797503263 + o[3]
+        *(-0.007878555448671 + o[4]*(-0.087594591301146 -
+        0.000053349095828174*o[8])))*tau2) + pi*(6.1445213076927e-8 + (
+        1.31612001853305e-6 + o[3]*(-0.00009683303171571 + o[4]*(-0.0045101773626444
+         - 0.122004760687947*o[8])))*tau2 + pi*(tau2*(-3.15389238237468e-9 +
+        (5.116287140914e-8 + 1.92901490874028e-6*tau2)*tau2) + pi*(
+        0.0000114610381688305*o[13] + pi*((-1.00288598706366e-10 + o[10]*(-0.012702883392813
+         - 143.374451604624*o[11]))*o[4] + pi*(-4.1341695026989e-17 + (-8.8352662293707e-6
+         - 0.272627897050173*o[12])*o[3]*o[6]*tau2 + pi*((9.0049690883672e-11
+         - 65.8490727183984*o[14])*o[6] + pi*(1.78287415218792e-7*o[10] + pi*
+        (o[5]*(1.0406965210174e-18 + (-1.0234747095929e-12 -
+        1.0018179379511e-8*o[5])*o[9]) + o[17]*((-1.29412653835176e-9 +
+        1.71088510070544*o[18])*o[8] + o[15]*(-6.05920510335078*o[19]*o[6]*o[
+        7]*tau2 + o[15]*((1.78371690710842e-23 + (6.1258633752464e-12 -
+        0.000084004935396416*o[10])*o[20])*o[21] + pi*(-1.24017662339842e-24*
+        o[18] + pi*(0.0000832192847496054*o[19]*o[5]*o[7]*tau2 + pi*((
+        1.75410265428146e-27 + o[12]*(1.32995316841867e-15 -
+        0.0000226487297378904*o[22]))*o[3]*o[6]*o[7]*pi -
+        2.93678005497663e-14*o[19]*o[3]*o[5]*tau2)))))))))))))))))/pi;
+    end g2pitau;
+
+    function g5pitau "derivative of g wrt pi and tau"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Real pi "dimensionless pressure";
+      output Real tau "dimensionless temperature";
+      output Real gpi "dimensionless dervative of Gibbs function wrt pi";
+      output Real gtau "dimensionless dervative of Gibbs function wrt tau";
+    protected
+      Real[3] o "vector of auxiliary variables";
+    algorithm
+      assert(p > triple.ptriple,
+        "IF97 medium function g5pitau called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      assert(p <= data.PLIMIT5,
+        "IF97 medium function g5pitau: input pressure (= " + String(p) + " Pa) is higher than 10 Mpa in region 5");
+      assert(T <= 2273.15,
+        "IF97 medium function g5pitau: input temperature (= " + String(T) + " K) is higher than limit of 2273.15 K in region 5");
+      pi := p/data.PSTAR5;
+      tau := data.TSTAR5/T;
+      o[1] := tau*tau;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      gtau := pi*(0.0021774678714571 - 0.013782846269973*o[1] + pi*(-0.0000357523455236121
+        *o[3] + 3.8757684869352e-7*o[1]*pi)) + (0.074415446800398 + tau*(-0.73803069960666
+         + (3.1161318213925 + o[1]*(6.8540841634434 - 0.65923253077834*tau))*
+        tau))/o[2];
+      gpi := (1.0 + pi*(-0.00012563183589592 + (0.0021774678714571 -
+        0.004594282089991*o[1])*tau + pi*(-7.9449656719138e-6*o[3]*tau +
+        3.8757684869352e-7*o[1]*pi*tau)))/pi;
+    end g5pitau;
+
+    function f3deltatau "1st derivatives of f wrt delta and tau"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature (K)";
+      output Real delta "dimensionless density";
+      output Real tau "dimensionless temperature";
+      output Real fdelta
+        "dimensionless dervative of Helmholtz function wrt delta";
+      output Real ftau "dimensionless dervative of Helmholtz function wrt tau";
+    protected
+      Real[13] o "vector of auxiliary variables";
+    algorithm
+      tau := data.TCRIT/T;
+      delta := if (d == data.DCRIT and T == data.TCRIT) then 1 + Modelica.
+        Constants.eps else d/data.DCRIT;
+      o[1] := tau*tau;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      o[4] := o[3]*tau;
+      o[5] := o[1]*o[2]*o[3]*tau;
+      o[6] := o[2]*o[3];
+      o[7] := o[1]*o[3];
+      o[8] := o[3]*o[3];
+      o[9] := o[1]*o[2]*o[8];
+      o[10] := o[1]*o[2]*o[8]*tau;
+      o[11] := o[3]*o[8];
+      o[12] := o[1]*o[3]*o[8];
+      o[13] := o[3]*o[8]*tau;
+      fdelta := (1.0658070028513 + delta*(o[1]*(-1.2654315477714 + o[2]*(-1.1524407806681
+         + (0.88521043984318 - 0.64207765181607*o[1])*o[4])) + delta*(
+        0.76986920373342 + o[1]*(-1.70429417648412 + o[2]*(9.7944563083754 +
+        (-6.100523451393 + (0.078841073758308 + 0.25116816848616*o[2])*o[5])*
+        tau)) + delta*(-0.8399798909613 + o[1]*(4.169939870838 + o[1]*(-6.056974507071
+         + o[6]*(-0.0246442911521889 - 1.42788107204769*o[7]))) + delta*(
+        0.175936297894 + o[1]*(-1.77905741714956 + o[1]*(3.62288282878932 +
+        2.82089800351868*o[9])) + delta*(delta*(-0.133052405238576 + o[1]*(
+        0.565564509990552 + 0.98617670687766*o[11]) + delta*(-0.094523605689436
+        *o[1] + delta*(-0.118674762819776*o[12] + delta*(o[1]*(
+        0.00521306582652756 + 0.0290780142333399*o[11]) + delta*(
+        0.00080964802996215 - 0.000494162889679965*delta*o[12] -
+        0.0016557679795037*tau))))) + (0.5385256313166 + o[1]*(-1.6456811629477
+         - 2.5435531020579*o[10]))*tau))))))/delta;
+      ftau := 20.944396974307 + tau*(-15.3735415757432 + o[2]*tau*(
+        18.3301634515678 + o[1]*tau*(-28.08078114862 + o[1]*(14.4640436358204
+         - 0.194503669468755*o[1]*o[3]*tau)))) + delta*((-2.5308630955428 + o[
+        2]*(-6.9146446840086 + (13.2781565976477 - 10.9153200808732*o[1])*o[4]))
+        *tau + delta*(tau*(-1.70429417648412 + o[2]*(29.3833689251262 + (-21.3518320798755
+         + (0.867251811341388 + 3.26518619032008*o[2])*o[5])*tau)) + delta*((
+        2.779959913892 + o[1]*(-8.075966009428 + o[6]*(-0.131436219478341 -
+        12.37496929108*o[7])))*tau + delta*((-0.88952870857478 + o[1]*(
+        3.62288282878932 + 18.3358370228714*o[9]))*tau + delta*(
+        0.10770512626332 + o[1]*(-0.98740869776862 - 13.2264761307011*o[10])
+         + delta*((0.188521503330184 + 4.27343239646986*o[11])*tau + delta*(-0.027006744482696
+        *tau + delta*(-0.385692979164272*o[13] + delta*(delta*(-0.00016557679795037
+         - 0.00116802137560719*delta*o[13]) + (0.00115845907256168 +
+        0.0840031522296486*o[11])*tau)))))))));
+    end f3deltatau;
+
+    function tph1 "inverse function for region 1: T(p,h)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Units.SI.Temperature T "temperature (K)";
+    protected
+      Real pi "dimensionless pressure";
+      Real eta1 "dimensionless specific enthalpy";
+      Real[3] o "vector of auxiliary variables";
+    algorithm
+      assert(p > triple.ptriple,
+        "IF97 medium function tph1 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      pi := p/data.PSTAR2;
+      eta1 := h/data.HSTAR1 + 1.0;
+      o[1] := eta1*eta1;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      T := -238.724899245210 - 13.3917448726020*pi + eta1*(404.21188637945 +
+        43.211039183559*pi + eta1*(113.497468817180 - 54.010067170506*pi +
+        eta1*(30.5358922039160*pi + eta1*(-6.5964749423638*pi + o[1]*(-5.8457616048039
+         + o[2]*(pi*(0.0093965400878363 + (-0.0000258586412820730 +
+        6.6456186191635e-8*pi)*pi) + o[2]*o[3]*(-0.000152854824131400 + o[1]*
+        o[3]*(-1.08667076953770e-6 + pi*(1.15736475053400e-7 + pi*(-4.0644363084799e-9
+         + pi*(8.0670734103027e-11 + pi*(-9.3477771213947e-13 + (
+        5.8265442020601e-15 - 1.50201859535030e-17*pi)*pi))))))))))));
+    end tph1;
+
+    function tps1 "inverse function for region 1: T(p,s)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Temperature T "temperature (K)";
+    protected
+      constant Units.SI.Pressure pstar=1.0e6;
+      constant Units.SI.SpecificEntropy sstar=1.0e3;
+      Real pi "dimensionless pressure";
+      Real sigma1 "dimensionless specific entropy";
+      Real[6] o "vector of auxiliary variables";
+    algorithm
+      pi := p/pstar;
+      assert(p > triple.ptriple,
+        "IF97 medium function tps1 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+
+      sigma1 := s/sstar + 2.0;
+      o[1] := sigma1*sigma1;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      o[4] := o[3]*o[3];
+      o[5] := o[4]*o[4];
+      o[6] := o[1]*o[2]*o[4];
+
+      T := 174.782680583070 + sigma1*(34.806930892873 + sigma1*(
+        6.5292584978455 + (0.33039981775489 + o[3]*(-1.92813829231960e-7 -
+        2.49091972445730e-23*o[2]*o[4]))*sigma1)) + pi*(-0.261076364893320 +
+        pi*(0.00056608900654837 + pi*(o[1]*o[3]*(2.64004413606890e-13 +
+        7.8124600459723e-29*o[6]) - 3.07321999036680e-31*o[5]*pi) + sigma1*(-0.00032635483139717
+         + sigma1*(0.000044778286690632 + o[1]*o[2]*(-5.1322156908507e-10 -
+        4.2522657042207e-26*o[6])*sigma1))) + sigma1*(0.225929659815860 +
+        sigma1*(-0.064256463395226 + sigma1*(0.0078876289270526 + o[3]*sigma1
+        *(3.5672110607366e-10 + 1.73324969948950e-24*o[1]*o[4]*sigma1)))));
+    end tps1;
+
+    function tph2 "reverse function for region 2: T(p,h)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Units.SI.Temperature T "temperature (K)";
+    protected
+      Real pi "dimensionless pressure";
+      Real pi2b "dimensionless pressure";
+      Real pi2c "dimensionless pressure";
+      Real eta "dimensionless specific enthalpy";
+      Real etabc "dimensionless specific enthalpy";
+      Real eta2a "dimensionless specific enthalpy";
+      Real eta2b "dimensionless specific enthalpy";
+      Real eta2c "dimensionless specific enthalpy";
+      Real[8] o "vector of auxiliary variables";
+    algorithm
+      pi := p*data.IPSTAR;
+      eta := h*data.IHSTAR;
+      etabc := h*1.0e-3;
+      if (pi < 4.0) then
+        eta2a := eta - 2.1;
+        o[1] := eta2a*eta2a;
+        o[2] := o[1]*o[1];
+        o[3] := pi*pi;
+        o[4] := o[3]*o[3];
+        o[5] := o[3]*pi;
+        T := 1089.89523182880 + (1.84457493557900 - 0.0061707422868339*pi)*pi
+           + eta2a*(849.51654495535 - 4.1792700549624*pi + eta2a*(-107.817480918260
+           + (6.2478196935812 - 0.310780466295830*pi)*pi + eta2a*(
+          33.153654801263 - 17.3445631081140*pi + o[2]*(-7.4232016790248 + pi
+          *(-200.581768620960 + 11.6708730771070*pi) + o[1]*(271.960654737960
+          *pi + o[1]*(-455.11318285818*pi + eta2a*(1.38657242832260*o[4] + o[
+          1]*o[2]*(3091.96886047550*pi + o[1]*(11.7650487243560 + o[2]*(-13551.3342407750
+          *o[5] + o[2]*(-62.459855192507*o[3]*o[4]*pi + o[2]*(o[4]*(
+          235988.325565140 + 7399.9835474766*pi) + o[1]*(19127.7292396600*o[3]
+          *o[4] + o[1]*(o[3]*(1.28127984040460e8 - 551966.97030060*o[5]) + o[
+          1]*(-9.8554909623276e8*o[3] + o[1]*(2.82245469730020e9*o[3] + o[1]*
+          (o[3]*(-3.5948971410703e9 + 3.7154085996233e6*o[5]) + o[1]*pi*(
+          252266.403578720 + pi*(1.72273499131970e9 + pi*(1.28487346646500e7
+           + (-1.31052365450540e7 - 415351.64835634*o[3])*pi))))))))))))))))))));
+      elseif (pi < (0.12809002730136e-03*etabc - 0.67955786399241)*etabc +
+          0.90584278514723e3) then
+        eta2b := eta - 2.6;
+        pi2b := pi - 2.0;
+        o[1] := pi2b*pi2b;
+        o[2] := o[1]*pi2b;
+        o[3] := o[1]*o[1];
+        o[4] := eta2b*eta2b;
+        o[5] := o[4]*o[4];
+        o[6] := o[4]*o[5];
+        o[7] := o[5]*o[5];
+        T := 1489.50410795160 + 0.93747147377932*pi2b + eta2b*(
+          743.07798314034 + o[2]*(0.000110328317899990 - 1.75652339694070e-18
+          *o[1]*o[3]) + eta2b*(-97.708318797837 + pi2b*(3.3593118604916 +
+          pi2b*(-0.0218107553247610 + pi2b*(0.000189552483879020 + (
+          2.86402374774560e-7 - 8.1456365207833e-14*o[2])*pi2b))) + o[5]*(
+          3.3809355601454*pi2b + o[4]*(-0.108297844036770*o[1] + o[5]*(
+          2.47424647056740 + (0.168445396719040 + o[1]*(0.00308915411605370
+           - 0.0000107798573575120*pi2b))*pi2b + o[6]*(-0.63281320016026 +
+          pi2b*(0.73875745236695 + (-0.046333324635812 + o[1]*(-0.000076462712454814
+           + 2.82172816350400e-7*pi2b))*pi2b) + o[6]*(1.13859521296580 + pi2b
+          *(-0.47128737436186 + o[1]*(0.00135555045549490 + (
+          0.0000140523928183160 + 1.27049022719450e-6*pi2b)*pi2b)) + o[5]*(-0.47811863648625
+           + (0.150202731397070 + o[2]*(-0.0000310838143314340 + o[1]*(-1.10301392389090e-8
+           - 2.51805456829620e-11*pi2b)))*pi2b + o[5]*o[7]*(
+          0.0085208123431544 + pi2b*(-0.00217641142197500 + pi2b*(
+          0.000071280351959551 + o[1]*(-1.03027382121030e-6 + (
+          7.3803353468292e-8 + 8.6934156344163e-15*o[3])*pi2b))))))))))));
+      else
+        eta2c := eta - 1.8;
+        pi2c := pi + 25.0;
+        o[1] := pi2c*pi2c;
+        o[2] := o[1]*o[1];
+        o[3] := o[1]*o[2]*pi2c;
+        o[4] := 1/o[3];
+        o[5] := o[1]*o[2];
+        o[6] := eta2c*eta2c;
+        o[7] := o[2]*o[2];
+        o[8] := o[6]*o[6];
+        T := eta2c*((859777.22535580 + o[1]*(482.19755109255 +
+          1.12615974072300e-12*o[5]))/o[1] + eta2c*((-5.8340131851590e11 + (
+          2.08255445631710e10 + 31081.0884227140*o[2])*pi2c)/o[5] + o[6]*(o[8]
+          *(o[6]*(1.23245796908320e-7*o[5] + o[6]*(-1.16069211309840e-6*o[5]
+           + o[8]*(0.0000278463670885540*o[5] + (-0.00059270038474176*o[5] +
+          0.00129185829918780*o[5]*o[6])*o[8]))) - 10.8429848800770*pi2c) + o[
+          4]*(7.3263350902181e12 + o[7]*(3.7966001272486 + (-0.045364172676660
+           - 1.78049822406860e-11*o[2])*pi2c))))) + o[4]*(-3.2368398555242e12
+           + pi2c*(3.5825089945447e11 + pi2c*(-1.07830682174700e10 + o[1]*
+          pi2c*(610747.83564516 + pi2c*(-25745.7236041700 + (1208.23158659360
+           + 1.45591156586980e-13*o[5])*pi2c)))));
+      end if;
+    end tph2;
+
+    function tps2a "reverse function for region 2a: T(p,s)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Temperature T "temperature (K)";
+    protected
+      Real[12] o "vector of auxiliary variables";
+      constant Real IPSTAR=1.0e-6 "scaling variable";
+      constant Real ISSTAR2A=1/2000.0 "scaling variable";
+      Real pi "dimensionless pressure";
+      Real sigma2a "dimensionless specific entropy";
+    algorithm
+      pi := p*IPSTAR;
+      sigma2a := s*ISSTAR2A - 2.0;
+      o[1] := pi^0.5;
+      o[2] := sigma2a*sigma2a;
+      o[3] := o[2]*o[2];
+      o[4] := o[3]*o[3];
+      o[5] := o[4]*o[4];
+      o[6] := pi^0.25;
+      o[7] := o[2]*o[4]*o[5];
+      o[8] := 1/o[7];
+      o[9] := o[3]*sigma2a;
+      o[10] := o[2]*o[3]*sigma2a;
+      o[11] := o[3]*o[4]*sigma2a;
+      o[12] := o[2]*sigma2a;
+      T := ((-392359.83861984 + (515265.73827270 + o[3]*(40482.443161048 + o[
+        2]*o[3]*(-321.93790923902 + o[2]*(96.961424218694 - 22.8678463717730*
+        sigma2a))))*sigma2a)/(o[4]*o[5]) + o[6]*((-449429.14124357 + o[3]*(-5011.8336020166
+         + 0.35684463560015*o[4]*sigma2a))/(o[2]*o[5]*sigma2a) + o[6]*(o[8]*(
+        44235.335848190 + o[9]*(-13673.3888117080 + o[3]*(421632.60207864 + (
+        22516.9258374750 + o[10]*(474.42144865646 - 149.311307976470*sigma2a))
+        *sigma2a))) + o[6]*((-197811.263204520 - 23554.3994707600*sigma2a)/(o[
+        2]*o[3]*o[4]*sigma2a) + o[6]*((-19070.6163020760 + o[11]*(
+        55375.669883164 + (3829.3691437363 - 603.91860580567*o[2])*o[3]))*o[8]
+         + o[6]*((1936.31026203310 + o[2]*(4266.0643698610 + o[2]*o[3]*o[4]*(
+        -5978.0638872718 - 704.01463926862*o[9])))/(o[2]*o[4]*o[5]*sigma2a)
+         + o[1]*((338.36784107553 + o[12]*(20.8627866351870 + (
+        0.033834172656196 - 0.000043124428414893*o[12])*o[3]))*sigma2a + o[6]
+        *(166.537913564120 + sigma2a*(-139.862920558980 + o[3]*(-0.78849547999872
+         + (0.072132411753872 + o[3]*(-0.0059754839398283 + (-0.0000121413589539040
+         + 2.32270967338710e-7*o[2])*o[3]))*sigma2a)) + o[6]*(-10.5384635661940
+         + o[3]*(2.07189254965020 + (-0.072193155260427 + 2.07498870811200e-7
+        *o[4])*o[9]) + o[6]*(o[6]*(o[12]*(0.210375278936190 +
+        0.000256812397299990*o[3]*o[4]) + (-0.0127990029337810 -
+        8.2198102652018e-6*o[11])*o[6]*o[9]) + o[10]*(-0.0183406579113790 +
+        2.90362723486960e-7*o[2]*o[4]*sigma2a)))))))))))/(o[1]*pi);
+    end tps2a;
+
+    function tps2b "reverse function for region 2b: T(p,s)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Temperature T "temperature (K)";
+    protected
+      Real[8] o "vector of auxiliary variables";
+      constant Real IPSTAR=1.0e-6 "scaling variable";
+      constant Real ISSTAR2B=1/785.3 "scaling variable";
+      Real pi "dimensionless pressure";
+      Real sigma2b "dimensionless specific entropy";
+    algorithm
+      pi := p*IPSTAR;
+      sigma2b := 10.0 - s*ISSTAR2B;
+      o[1] := pi*pi;
+      o[2] := o[1]*o[1];
+      o[3] := sigma2b*sigma2b;
+      o[4] := o[3]*o[3];
+      o[5] := o[4]*o[4];
+      o[6] := o[3]*o[5]*sigma2b;
+      o[7] := o[3]*o[5];
+      o[8] := o[3]*sigma2b;
+      T := (316876.65083497 + 20.8641758818580*o[6] + pi*(-398593.99803599 -
+        21.8160585188770*o[6] + pi*(223697.851942420 + (-2784.17034458170 +
+        9.9207436071480*o[7])*sigma2b + pi*(-75197.512299157 + (
+        2970.86059511580 + o[7]*(-3.4406878548526 + 0.38815564249115*sigma2b))
+        *sigma2b + pi*(17511.2950857500 + sigma2b*(-1423.71128544490 + (
+        1.09438033641670 + 0.89971619308495*o[4])*o[4]*sigma2b) + pi*(-3375.9740098958
+         + (471.62885818355 + o[4]*(-1.91882419936790 + o[8]*(
+        0.41078580492196 - 0.33465378172097*sigma2b)))*sigma2b + pi*(
+        1387.00347775050 + sigma2b*(-406.63326195838 + sigma2b*(
+        41.727347159610 + o[3]*(2.19325494345320 + sigma2b*(-1.03200500090770
+         + (0.35882943516703 + 0.0052511453726066*o[8])*sigma2b)))) + pi*(
+        12.8389164507050 + sigma2b*(-2.86424372193810 + sigma2b*(
+        0.56912683664855 + (-0.099962954584931 + o[4]*(-0.0032632037778459 +
+        0.000233209225767230*sigma2b))*sigma2b)) + pi*(-0.153348098574500 + (
+        0.0290722882399020 + 0.00037534702741167*o[4])*sigma2b + pi*(
+        0.00172966917024110 + (-0.00038556050844504 - 0.000035017712292608*o[
+        3])*sigma2b + pi*(-0.0000145663936314920 + 5.6420857267269e-6*sigma2b
+         + pi*(4.1286150074605e-8 + (-2.06846711188240e-8 +
+        1.64093936747250e-9*sigma2b)*sigma2b))))))))))))/(o[1]*o[2]);
+    end tps2b;
+
+    function tps2c "reverse function for region 2c: T(p,s)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Temperature T "temperature (K)";
+    protected
+      constant Real IPSTAR=1.0e-6 "scaling variable";
+      constant Real ISSTAR2C=1/2925.1 "scaling variable";
+      Real pi "dimensionless pressure";
+      Real sigma2c "dimensionless specific entropy";
+      Real[3] o "vector of auxiliary variables";
+    algorithm
+      pi := p*IPSTAR;
+      sigma2c := 2.0 - s*ISSTAR2C;
+      o[1] := pi*pi;
+      o[2] := sigma2c*sigma2c;
+      o[3] := o[2]*o[2];
+      T := (909.68501005365 + 2404.56670884200*sigma2c + pi*(-591.62326387130
+         + pi*(541.45404128074 + sigma2c*(-270.983084111920 + (
+        979.76525097926 - 469.66772959435*sigma2c)*sigma2c) + pi*(
+        14.3992746047230 + (-19.1042042304290 + o[2]*(5.3299167111971 -
+        21.2529753759340*sigma2c))*sigma2c + pi*(-0.311473344137600 + (
+        0.60334840894623 - 0.042764839702509*sigma2c)*sigma2c + pi*(
+        0.0058185597255259 + (-0.0145970082847530 + 0.0056631175631027*o[3])*
+        sigma2c + pi*(-0.000076155864584577 + sigma2c*(0.000224403429193320
+         - 0.0000125610950134130*o[2]*sigma2c) + pi*(6.3323132660934e-7 + (-2.05419896753750e-6
+         + 3.6405370390082e-8*sigma2c)*sigma2c + pi*(-2.97598977892150e-9 +
+        1.01366185297630e-8*sigma2c + pi*(5.9925719692351e-12 + sigma2c*(-2.06778701051640e-11
+         + o[2]*(-2.08742781818860e-11 + (1.01621668250890e-10 -
+        1.64298282813470e-10*sigma2c)*sigma2c))))))))))))/o[1];
+    end tps2c;
+
+    function tps2 "reverse function for region 2: T(p,s)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Temperature T "temperature (K)";
+    protected
+      Real pi "dimensionless pressure";
+      constant Units.SI.SpecificEntropy SLIMIT=5.85e3
+        "subregion boundary specific entropy between regions 2a and 2b";
+    algorithm
+      if p < 4.0e6 then
+        T := tps2a(p, s);
+      elseif s > SLIMIT then
+        T := tps2b(p, s);
+      else
+        T := tps2c(p, s);
+      end if;
+    end tps2;
+
+    function tsat "region 4 saturation temperature as a function of pressure"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.Temperature t_sat "temperature";
+    protected
+      Real pi "dimensionless pressure";
+      Real[20] o "vector of auxiliary variables";
+    algorithm
+    //   assert(p > triple.ptriple,
+    //     "IF97 medium function tsat called with too low pressure\n" +
+    //     "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+    //  assert(p <= data.PCRIT,
+    //    "tsat: input pressure is higher than the critical point pressure");
+      pi := max(min(p,data.PCRIT),triple.ptriple)*data.IPSTAR;
+      o[1] := pi^0.25;
+      o[2] := -3.2325550322333e6*o[1];
+      o[3] := pi^0.5;
+      o[4] := -724213.16703206*o[3];
+      o[5] := 405113.40542057 + o[2] + o[4];
+      o[6] := -17.0738469400920*o[1];
+      o[7] := 14.9151086135300 + o[3] + o[6];
+      o[8] := -4.0*o[5]*o[7];
+      o[9] := 12020.8247024700*o[1];
+      o[10] := 1167.05214527670*o[3];
+      o[11] := -4823.2657361591 + o[10] + o[9];
+      o[12] := o[11]*o[11];
+      o[13] := o[12] + o[8];
+      o[14] := o[13]^0.5;
+      o[15] := -o[14];
+      o[16] := -12020.8247024700*o[1];
+      o[17] := -1167.05214527670*o[3];
+      o[18] := 4823.2657361591 + o[15] + o[16] + o[17];
+      o[19] := 1/o[18];
+      o[20] := 2.0*o[19]*o[5];
+
+      t_sat := 0.5*(650.17534844798 + o[20] - (-4.0*(-0.238555575678490 +
+        1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5);
+      annotation (derivative=tsat_der);
+    end tsat;
+
+    function dtsatofp "derivative of saturation temperature w.r.t. pressure"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Real dtsat(unit="K/Pa") "derivative of T w.r.t. p";
+    protected
+      Real pi "dimensionless pressure";
+      Real[49] o "vector of auxiliary variables";
+    algorithm
+      pi := p*data.IPSTAR;
+      o[1] := pi^0.75;
+      o[2] := 1/o[1];
+      o[3] := -4.268461735023*o[2];
+      o[4] := sqrt(pi);
+      o[5] := 1/o[4];
+      o[6] := 0.5*o[5];
+      o[7] := o[3] + o[6];
+      o[8] := pi^0.25;
+      o[9] := -3.2325550322333e6*o[8];
+      o[10] := -724213.16703206*o[4];
+      o[11] := 405113.40542057 + o[10] + o[9];
+      o[12] := -4*o[11]*o[7];
+      o[13] := -808138.758058325*o[2];
+      o[14] := -362106.58351603*o[5];
+      o[15] := o[13] + o[14];
+      o[16] := -17.073846940092*o[8];
+      o[17] := 14.91510861353 + o[16] + o[4];
+      o[18] := -4*o[15]*o[17];
+      o[19] := 3005.2061756175*o[2];
+      o[20] := 583.52607263835*o[5];
+      o[21] := o[19] + o[20];
+      o[22] := 12020.82470247*o[8];
+      o[23] := 1167.0521452767*o[4];
+      o[24] := -4823.2657361591 + o[22] + o[23];
+      o[25] := 2.0*o[21]*o[24];
+      o[26] := o[12] + o[18] + o[25];
+      o[27] := -4.0*o[11]*o[17];
+      o[28] := o[24]*o[24];
+      o[29] := o[27] + o[28];
+      o[30] := sqrt(o[29]);
+      o[31] := 1/o[30];
+      o[32] := (-o[30]);
+      o[33] := -12020.82470247*o[8];
+      o[34] := -1167.0521452767*o[4];
+      o[35] := 4823.2657361591 + o[32] + o[33] + o[34];
+      o[36] := o[30];
+      o[37] := -4823.2657361591 + o[22] + o[23] + o[36];
+      o[38] := o[37]*o[37];
+      o[39] := 1/o[38];
+      o[40] := -1.72207339365771*o[30];
+      o[41] := 21592.2055343628*o[8];
+      o[42] := o[30]*o[8];
+      o[43] := -8192.87114842946*o[4];
+      o[44] := -0.510632954559659*o[30]*o[4];
+      o[45] := -3100.02526152368*o[1];
+      o[46] := pi;
+      o[47] := 1295.95640782102*o[46];
+      o[48] := 2862.09212505088 + o[40] + o[41] + o[42] + o[43] + o[44] + o[
+        45] + o[47];
+      o[49] := 1/(o[35]*o[35]);
+      dtsat := data.IPSTAR*0.5*((2.0*o[15])/o[35] - 2.*o[11]*(-3005.2061756175
+        *o[2] - 0.5*o[26]*o[31] - 583.52607263835*o[5])*o[49] - (
+        20953.46356643991*(o[39]*(1295.95640782102 + 5398.05138359071*o[2] +
+        0.25*o[2]*o[30] - 0.861036696828853*o[26]*o[31] - 0.255316477279829*o[
+        26]*o[31]*o[4] - 4096.43557421473*o[5] - 0.255316477279829*o[30]*o[5]
+         - 2325.01894614276/o[8] + 0.5*o[26]*o[31]*o[8]) - 2.0*(o[19] + o[20]
+         + 0.5*o[26]*o[31])*o[48]*o[37]^(-3)))/sqrt(o[39]*o[48]));
+    end dtsatofp;
+
+    function tsat_der "derivative function for tsat"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Real der_p(unit="Pa/s") "pressure derivatrive";
+      output Real der_tsat(unit="K/s") "temperature derivative";
+    protected
+      Real dtp;
+    algorithm
+      dtp := dtsatofp(p);
+      der_tsat := dtp*der_p;
+    end tsat_der;
+
+    function psat "region 4 saturation pressure as a functionx of temperature"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.Pressure p_sat "pressure";
+    protected
+      Real[7] o "vector of auxiliary variables";
+      Real C "auxiliary variable";
+      Real B "auxiliary variable";
+      Real A "auxiliary variable";
+      Real Tlim=min(T, data.TCRIT);
+    algorithm
+      assert(T >= 273.16,
+        "IF97 medium function psat: input temperature (= " + String(triple.ptriple) + " K).\n" +
+        "lower than the triple point temperature 273.16 K");
+      o[1] := -650.17534844798 + Tlim;
+      o[2] := 1/o[1];
+      o[3] := -0.238555575678490*o[2];
+      o[4] := o[3] + Tlim "theta";
+      o[5] := -4823.2657361591*o[4] "n7*theta";
+      o[6] := o[4]*o[4] "theta^2";
+      o[7] := 14.9151086135300*o[6] "n6*theta^2";
+      C := 405113.40542057 + o[5] + o[7] "C";
+      B := -3.2325550322333e6 +12020.8247024700*o[4] - 17.0738469400920*o[6];
+      A := (-724213.16703206 + 1167.05214527670*o[4] + o[6]);
+      p_sat := 16.0e6*C*C*C*C*1/(-B + (-4.0*A*C + B*B)^0.5)^4.0;
+      annotation (derivative=psat_der);
+    end psat;
+
+    function dptofT
+      "derivative of pressure wrt temperature along the saturation pressure curve"
+      extends Modelica.Icons.Function;
+      input Units.SI.Temperature T "temperature (K)";
+      output Real dpt(unit = "Pa/K") "temperature derivative of pressure";
+    protected
+      Real[31] o "vector of auxiliary variables";
+      Real Tlim "temperature limited to TCRIT";
+    algorithm
+      Tlim := min(T, data.TCRIT);
+      o[1] := -650.17534844798 + Tlim;
+      o[2] := 1/o[1];
+      o[3] := -0.238555575678490*o[2];
+      o[4] := o[3] + Tlim "theta";
+      o[5] := -4823.2657361591*o[4];
+      o[6] := o[4]*o[4] "theta^2";
+      o[7] := 14.9151086135300*o[6];
+      o[8] := 405113.40542057 + o[5] + o[7];
+      o[9] := o[8]*o[8];
+      o[10] := o[9]*o[9];
+      o[11] := o[1]*o[1];
+      o[12] := 1/o[11];
+      o[13] := 0.238555575678490*o[12];
+      o[14] := 1.00000000000000 + o[13] "dtheta";
+      o[15] := 12020.8247024700*o[4];
+      o[16] := -17.0738469400920*o[6];
+      o[17] := -3.2325550322333e6 + o[15] + o[16];
+      o[18] := -4823.2657361591*o[14];
+      o[19] := 29.8302172270600*o[14]*o[4];
+      o[20] := o[18] + o[19];
+      o[21] := 1167.05214527670*o[4];
+      o[22] := -724213.16703206 + o[21] + o[6];
+      o[23] := o[17]*o[17];
+      o[24] := -4.0000000000000*o[22]*o[8];
+      o[25] := o[23] + o[24];
+      o[26] := sqrt(o[25]);
+      o[27] := -12020.8247024700*o[4];
+      o[28] := 17.0738469400920*o[6];
+      o[29] := 3.2325550322333e6 + o[26] + o[27] + o[28];
+      o[30] := o[29]*o[29];
+      o[31] := o[30]*o[30];
+      dpt := 1e6*((-64.0*o[10]*(-12020.8247024700*o[14] + 34.147693880184*o[
+        14]*o[4] + (0.5*(-4.0*o[20]*o[22] + 2.00000000000000*o[17]*(
+        12020.8247024700*o[14] - 34.147693880184*o[14]*o[4]) - 4.0*(
+        1167.05214527670*o[14] + 2.0*o[14]*o[4])*o[8]))/o[26]))/(o[29]*o[31])
+         + (64.*o[20]*o[8]*o[9])/o[31]);
+    end dptofT;
+
+    function d2ptofT
+      "Second derivative of pressure wrt temperature along the saturation pressure curve"
+      extends Modelica.Icons.Function;
+      input Units.SI.Temperature T "temperature (K)";
+      output Real dpT(unit = "Pa/K") "Temperature derivative of pressure";
+      output Real dpTT(unit = "Pa/(K.K)")
+        "Second temperature derivative of pressure";
+    protected
+      Real A "Auxiliary variable";
+      Real Ad "Auxiliary variable";
+      Real A1 "Auxiliary variable";
+      Real A2 "Auxiliary variable";
+      Real B "Auxiliary variable";
+      Real Bd "Auxiliary variable";
+      Real B1 "Auxiliary variable";
+      Real B2 "Auxiliary variable";
+      Real C "Auxiliary variable";
+      Real Cd "Auxiliary variable";
+      Real C1 "Auxiliary variable";
+      Real C2 "Auxiliary variable";
+      Real D "Auxiliary variable";
+      Real D1 "Auxiliary variable";
+      Real Dd "Auxiliary variable";
+      Real D2 "Auxiliary variable";
+    //   Real F "Auxiliary variable";
+    //   Real Fd "Auxiliary variable";
+      Real th "Auxiliary variable";
+      Real thd "Auxiliary variable";
+      Real thdd "Auxiliary variable";
+      Real v "Auxiliary variable";
+      Real v2 "Auxiliary variable";
+      Real v4 "Auxiliary variable";
+      Real v5 "Auxiliary variable";
+      Real v6 "Auxiliary variable";
+      Real[16] o "vector of auxiliary variables";
+      Real Tlim "temperature limited to TCRIT";
+      parameter Real[10] n =  {0.11670521452767e4,-0.72421316703206e6,
+                              -0.17073846940092e2, 0.12020824702470e5,
+                              -0.32325550322333e7, 0.14915108613530e2,
+                              -0.48232657361591e4, 0.40511340542057e6,
+                              -0.23855557567849,   0.65017534844798e3};
+    algorithm
+      Tlim := min(T, data.TCRIT);
+      o[1] := Tlim - n[10];
+      th := Tlim + n[9]/o[1];
+      o[2] := th*th "theta^2";
+      A := o[2] + n[1]*th + n[2];
+      B := n[3]*o[2] + n[4]*th + n[5];
+      C := n[6]*o[2] + n[7]*th + n[8];
+      o[3] := o[1]*o[1];
+      o[4] := o[3]*o[3];
+      D := (B*B-4.0*A*C);
+      o[5] := sqrt(D);
+      v := 1/(o[5]- B);
+      v2 := v*v;
+      v4 := v2*v2;
+      v5 := v4*v;
+      v6 := v4*v2;
+      o[6] := 2.0*C*v;
+      o[7] := o[6]*o[6];
+    //  F := o[7]*o[7]*1e6 "this is also psat, and correct";
+      thd := 1.0 - n[9]/o[3];
+      thdd :=  2.0*n[9]/(o[3]*o[1]);
+      Ad := 2.0*th + n[1];
+      Bd := 2.0*n[3]*th + n[4];
+      Cd := 2.0*n[6]*th + n[7];
+      Dd := 2*B*Bd -4*(Ad*C + Cd*A);
+      A1 := Ad*thd;
+      B1 := Bd*thd;
+      C1 := Cd*thd;
+      D1 := Dd*thd;
+      o[8] := C*C "C^2";
+      o[9] := o[8]*C "C^3";
+      o[10] := o[9]*C "C^4";
+      o[11] := 1/o[5] "1/sqrt(D)";
+      o[12] := (-B1 + 0.5*D1*o[11]) "-B1 + 1/2*D1/sqrt(D)";
+      o[13] := o[12]*o[12];
+      o[14] := C1*C1 "C1^2";
+      o[15] := B1*B1 "B1^2";
+      o[16] := D*o[5] "D^3/2";
+      // dpsat (=Fd) is correct
+      // Fd := 64.0*C*C*C*C1*v4-64.0*C*C*C*C*(-B1 + 0.5*D1/sqrt(D))*v5;
+      dpT := 64.0*(C1*o[9]*v4 - o[10]*o[12]*v5)*1.0e6 "dpsat";
+      A2 := Ad*thdd + thd*thd*2.0;
+      B2 := Bd*thdd + thd*thd*2.0*n[3];
+      C2 := Cd*thdd + thd*thd*2.0*n[6];
+      D2 := 2.0*(B*B2 + o[15]) -4.0*(A2*C + 2.0*A1*C1 + A*C2);
+      dpTT := ((192.0*o[8]*o[14] + 64.0*o[9]*C2)*v4 + (-512.0*C1*o[9]*o[12] - 64.0*o[10]*(-B2-0.25*D1*D1/o[16] + 0.5*D2*o[11]))*v5
+         +(320.0*o[10]*o[13])*v6)*1.0e6;
+    end d2ptofT;
+
+    function psat_der "derivative function for psat"
+      extends Modelica.Icons.Function;
+      input Units.SI.Temperature T "temperature (K)";
+      input Real der_T(unit = "K/s") "temperature derivative";
+      output Real der_psat(unit = "Pa/s") "pressure";
+    protected
+      Real dpt;
+    algorithm
+      dpt := dptofT(T);
+      der_psat := dpt*der_T;
+    end psat_der;
+
+    // Inverses p_hs from the 2001 assition to IAPWS97
+    function p1_hs "pressure as a function of ehtnalpy and entropy in region 1"
+      extends Modelica.Icons.Function;
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Pressure p "Pressure";
+      constant Real[:] n=
+        {-0.691997014660582,-0.183612548787560e2,-0.928332409297335e1,0.659639569909906e2,
+         -0.162060388912024e2,0.450620017338667e3,0.854680678224170e3,0.607523214001162e4,0.326487682621856e2,
+         -0.269408844582931e2,-0.319947848334300e3,-0.928354307043320e3,0.303634537455249e2,-0.650540422444146e2,
+         -0.430991316516130e4,-0.747512324096068e3,0.730000345529245e3,0.114284032569021e4,-0.436407041874559e3};
+      constant Real[:] I = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,4,4,5};
+      constant Real[:] J = {0,1,2,4,5,6,8,14,0,1,4,6,0,1,10,4,1,4,0};
+      constant Units.SI.SpecificEnthalpy hstar=3400e3 "normalization enthalpy";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEntropy sstar=7.6e3 "normalization entropy";
+    protected
+      Real eta = h/hstar "normalized specific enthalpy";
+      Real sigma = s/sstar "normalized specific entropy";
+    algorithm
+      p := sum(n[i]*(eta + 0.05)^I[i]*(sigma + 0.05)^J[i] for i in 1:19)*pstar;
+      annotation (
+          Documentation(                                                                                                    info="<html>
+<p>
+  Equation number 1 from:<br>
+  The International Association for the Properties of Water and Steam<br>
+  Gaithersburg, Maryland, USA<br>
+  September 2001<br>
+  Supplementary Release on&nbsp; Backward Equations for Pressure as a
+  Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
+  Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
+  </p>
+  </html>
+  "));
+    end p1_hs;
+
+    function h2ab_s "boundary between regions 2a and 2b"
+      extends Modelica.Icons.Function;
+      output Units.SI.SpecificEnthalpy h "Enthalpy";
+      input Units.SI.SpecificEntropy s "Entropy";
+    protected
+      constant Real[:] n = {-0.349898083432139e4,0.257560716905876e4,-0.421073558227969e3,0.276349063799944e2};
+      constant Units.SI.SpecificEnthalpy hstar=1e3 "normalization enthalpy";
+      constant Units.SI.SpecificEntropy sstar=1e3 "normalization entropy";
+      Real sigma = s/sstar "normalized specific entropy";
+    algorithm
+      h := (n[1] + n[2]*sigma + n[3]*sigma^2 + n[4]*sigma^3)*hstar;
+      annotation (
+          Documentation(                                                                                                    info="<html>
+  <p>
+  Equation number 2 from:<br>
+  The International Association for the Properties of Water and Steam<br>
+  Gaithersburg, Maryland, USA<br>
+  September 2001<br>
+  Supplementary Release on&nbsp; Backward Equations for Pressure as a
+  Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
+  Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
+  </p>
+  </html>
+  "));
+    end h2ab_s;
+
+    function p2a_hs
+      "pressure as a function of enthalpy and entropy in subregion 2a"
+      extends Modelica.Icons.Function;
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Pressure p "Pressure";
+      constant Real[:] n=
+        {-0.182575361923032e-1,-0.125229548799536,0.592290437320145,0.604769706185122e1,
+         0.238624965444474e3,-0.298639090222922e3,0.512250813040750e-1,-0.437266515606486,0.413336902999504,
+         -0.516468254574773e1,-0.557014838445711e1,0.128555037824478e2,0.114144108953290e2,-0.119504225652714e3,
+         -0.284777985961560e4,0.431757846408006e4,0.112894040802650e1,0.197409186206319e4,0.151612444706087e4,
+         0.141324451421235e-1,0.585501282219601,-0.297258075863012e1,0.594567314847319e1,-0.623656565798905e4,
+         0.965986235133332e4,0.681500934948134e1,-0.633207286824489e4,-0.558919224465760e1,0.400645798472063e-1};
+      constant Real[:] I = {0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,3,3,3,4,5,5,6,7};
+      constant Real[:] J = {1,3,6,16,20,22,0,1,2,3,5,6,10,16,20,22,3,16,20,0,2,3,6,16,16,3,16,3,1};
+      constant Units.SI.SpecificEnthalpy hstar=4200e3 "normalization enthalpy";
+      constant Units.SI.Pressure pstar=4e6 "normalization pressure";
+      constant Units.SI.SpecificEntropy sstar=12e3 "normalization entropy";
+    protected
+      Real eta = h/hstar "normalized specific enthalpy";
+      Real sigma = s/sstar "normalized specific entropy";
+    algorithm
+      p := sum(n[i]*(eta - 0.5)^I[i]*(sigma - 1.2)^J[i] for i in 1:29)^4*pstar;
+      annotation (
+          Documentation(                                                                                                    info="<html>
+  <p>
+  Equation number 3 from:<br>
+  The International Association for the Properties of Water and Steam<br>
+  Gaithersburg, Maryland, USA<br>
+  September 2001<br>
+  Supplementary Release on&nbsp; Backward Equations for Pressure as a
+  Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
+  Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
+  </p>
+  </html>
+  "));
+    end p2a_hs;
+
+  function p2b_hs
+      "pressure as a function of enthalpy and entropy in subregion 2a"
+    extends Modelica.Icons.Function;
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Pressure p "Pressure";
+    constant Real[:] n=
+      {0.801496989929495e-1,-0.543862807146111,0.337455597421283,0.890555451157450e1,
+       0.313840736431485e3,0.797367065977789,-0.121616973556240e1,0.872803386937477e1,-0.169769781757602e2,
+       -0.186552827328416e3,0.951159274344237e5,-0.189168510120494e2,-0.433407037194840e4,0.543212633012715e9,
+       0.144793408386013,0.128024559637516e3,-0.672309534071268e5,0.336972380095287e8,-0.586634196762720e3,
+       -0.221403224769889e11,0.171606668708389e4,-0.570817595806302e9,-0.312109693178482e4,-0.207841384633010e7,
+       0.305605946157786e13,0.322157004314333e4,0.326810259797295e12,-0.144104158934487e4,0.410694867802691e3,
+       0.109077066873024e12,-0.247964654258893e14,0.188801906865134e10,-0.123651009018773e15};
+    constant Real[:] I = {0,0,0,0,0,1,1,1,1,1,1,2,2,2,3,3,3,3,4,4,5,5,6,6,6,7,7,8,8,8,8,12,14};
+    constant Real[:] J = {0,1,2,4,8,0,1,2,3,5,12,1,6,18,0,1,7,12,1,16,1,12,1,8,18,1,16,1,3,14,18,10,16};
+      constant Units.SI.SpecificEnthalpy hstar=4100e3 "normalization enthalpy";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEntropy sstar=7.9e3 "normalization entropy";
+    protected
+    Real eta = h/hstar "normalized specific enthalpy";
+    Real sigma = s/sstar "normalized specific entropy";
+
+  algorithm
+    p := sum(n[i]*(eta - 0.6)^I[i]*(sigma - 1.01)^J[i] for i in 1:33)^4*pstar;
+    annotation (
+          Documentation(                                                                                                    info="<html>
+<p>
+Equation number 4 from:<br>
+The International Association for the Properties of Water and Steam<br>
+Gaithersburg, Maryland, USA<br>
+September 2001<br>
+Supplementary Release on&nbsp; Backward Equations for Pressure as a
+Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
+Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
+</p>
+      </html>
+"));
+  end p2b_hs;
+
+    function p2c_hs
+      "pressure as a function of enthalpy and entropy in subregion 2c"
+        extends Modelica.Icons.Function;
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Pressure p "Pressure";
+        constant Real[:] n=
+          {0.112225607199012,-0.339005953606712e1,-0.320503911730094e2,-0.197597305104900e3,
+           -0.407693861553446e3,0.132943775222331e5,0.170846839774007e1,0.373694198142245e2,0.358144365815434e4,
+           0.423014446424664e6,-0.751071025760063e9,0.523446127607898e2,-0.228351290812417e3,-0.960652417056937e6,
+           -0.807059292526074e8,0.162698017225669e13,0.772465073604171,0.463929973837746e5,-0.137317885134128e8,
+           0.170470392630512e13,-0.251104628187308e14,0.317748830835520e14,0.538685623675312e2,-0.553089094625169e5,
+           -0.102861522421405e7,0.204249418756234e13,0.273918446626977e9,-0.263963146312685e16,-0.107890854108088e10,
+           -0.296492620980124e11,-0.111754907323424e16};
+        constant Real[:] I = {0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,6,6,10,12,16};
+        constant Real[:] J = {0,1,2,3,4,8,0,2,5,8,14,2,3,7,10,18,0,5,8,16,18,18,1,4,6,14,8,18,7,7,10};
+      constant Units.SI.SpecificEnthalpy hstar=3500e3 "normalization enthalpy";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEntropy sstar=5.9e3 "normalization entropy";
+    protected
+        Real eta = h/hstar "normalized specific enthalpy";
+        Real sigma = s/sstar "normalized specific entropy";
+    algorithm
+        p := sum(n[i]*(eta - 0.7)^I[i]*(sigma - 1.1)^J[i] for i in 1:31)^4*pstar;
+        annotation (
+          Documentation(                                                                                                    info="<html>
+      <p>
+      Equation number 5 from:<br>
+      The International Association for the Properties of Water and Steam<br>
+      Gaithersburg, Maryland, USA<br>
+      September 2001<br>
+      Supplementary Release on&nbsp; Backward Equations for Pressure as a
+      Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
+      Formulation 1997 for the Thermodynamic Properties of Water and Steam<br>
+      </p>
+      </html>
+      "));
+    end p2c_hs;
+
+    // Inverses from the 2003 additions to IF97
+    function h3ab_p "ergion 3 a b boundary for pressure/enthalpy"
+        extends Modelica.Icons.Function;
+      output Units.SI.SpecificEnthalpy h "Enthalpy";
+      input Units.SI.Pressure p "Pressure";
+    protected
+        constant Real[:] n = {0.201464004206875e4,0.374696550136983e1,-0.219921901054187e-1,0.875131686009950e-4};
+      constant Units.SI.SpecificEnthalpy hstar=1000 "normalization enthalpy";
+      constant Units.SI.Pressure pstar=1e6 "normalization pressure";
+        Real pi = p/pstar "normalized specific pressure";
+
+    algorithm
+        h := (n[1] + n[2]*pi + n[3]*pi^2 + n[4]*pi^3)*hstar;
+        annotation (
+    Documentation(info="<html>
+      <p>
+      &nbsp;Equation number 1 from:<br>
+      <div style=\"text-align: center;\">&nbsp;[1] The international Association
+      for the Properties of Water and Steam<br>
+      &nbsp;Vejle, Denmark<br>
+      &nbsp;August 2003<br>
+      &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+      T(p,h), v(p,h) and T(p,s), <br>
+      &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+      the Thermodynamic Properties of<br>
+      &nbsp;Water and Steam</div>
+      </p>
+      </html>"));
+    end h3ab_p;
+
+    function T3a_ph "Region 3 a: inverse function T(p,h)"
+        extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "Pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Units.SI.Temp_K T "Temperature";
+    protected
+        constant Real[:] n=
+          {-0.133645667811215e-6,0.455912656802978e-5,-0.146294640700979e-4, 0.639341312970080e-2,0.372783927268847e3,
+           -0.718654377460447e4,0.573494752103400e6,-0.267569329111439e7,-0.334066283302614e-4,-0.245479214069597e-1,
+           0.478087847764996e2,0.764664131818904e-5,0.128350627676972e-2,0.171219081377331e-1,-0.851007304583213e1,
+           -0.136513461629781e-1,-0.384460997596657e-5,0.337423807911655e-2,-0.551624873066791,0.729202277107470,
+           -0.992522757376041e-2,-0.119308831407288,0.793929190615421,0.454270731799386,0.209998591259910,
+           -0.642109823904738e-2,-0.235155868604540e-1,0.252233108341612e-2,-0.764885133368119e-2,0.136176427574291e-1,
+           -0.133027883575669e-1};
+        constant Real[:] I = {-12,-12,-12,-12,-12,-12,-12,-12,-10,-10,
+                              -10,-8,-8,-8,-8,-5,-3,-2,-2,-2,-1,-1,0,0,1,3,3,4,4,10,12};
+        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 Units.SI.SpecificEnthalpy hstar=2300e3 "normalization enthalpy";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.Temp_K Tstar=760 "normalization temperature";
+        Real pi = p/pstar "normalized specific pressure";
+        Real eta = h/hstar "normalized specific enthalpy";
+    algorithm
+        T := sum(n[i]*(pi + 0.240)^I[i]*(eta - 0.615)^J[i] for i in 1:31)*Tstar;
+        annotation (
+          Documentation(
+     info="<html>
+ <p>
+ &nbsp;Equation number 2 from:<br>
+ <div style=\"text-align: center;\">&nbsp;[1] The international Association
+ for the Properties of Water and Steam<br>
+ &nbsp;Vejle, Denmark<br>
+ &nbsp;August 2003<br>
+ &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+ T(p,h), v(p,h) and T(p,s), <br>
+ &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+ the Thermodynamic Properties of<br>
+ &nbsp;Water and Steam</div>
+ </p>
+ </html>"));
+    end T3a_ph;
+
+    function T3b_ph "Region 3 b: inverse function T(p,h)"
+        extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "Pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Units.SI.Temp_K T "Temperature";
+    protected
+        constant Real[:] n=
+          {0.323254573644920e-4,-0.127575556587181e-3,-0.475851877356068e-3,0.156183014181602e-2,
+           0.105724860113781,-0.858514221132534e2,0.724140095480911e3,0.296475810273257e-2,-0.592721983365988e-2,
+           -0.126305422818666e-1,-0.115716196364853,0.849000969739595e2,-0.108602260086615e-1,0.154304475328851e-1,
+           0.750455441524466e-1,0.252520973612982e-1,-0.602507901232996e-1,-0.307622221350501e1,-0.574011959864879e-1,
+           0.503471360939849e1,-0.925081888584834,0.391733882917546e1,-0.773146007130190e2,0.949308762098587e4,
+           -0.141043719679409e7,0.849166230819026e7,0.861095729446704,0.323346442811720,0.873281936020439,
+           -0.436653048526683,0.286596714529479,-0.131778331276228,0.676682064330275e-2};
+        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 Units.SI.Temp_K Tstar=860 "normalization temperature";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEnthalpy hstar=2800e3 "normalization enthalpy";
+        Real pi = p/pstar "normalized specific pressure";
+        Real eta = h/hstar "normalized specific enthalpy";
+    algorithm
+        T := sum(n[i]*(pi + 0.298)^I[i]*(eta - 0.720)^J[i] for i in 1:33)*Tstar;
+        annotation (
+          Documentation(
+     info="<html>
+ <p>
+ &nbsp;Equation number 3 from:<br>
+ <div style=\"text-align: center;\">&nbsp;[1] The international Association
+ for the Properties of Water and Steam<br>
+ &nbsp;Vejle, Denmark<br>
+ &nbsp;August 2003<br>
+ &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+ T(p,h), v(p,h) and T(p,s), <br>
+ &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+ the Thermodynamic Properties of<br>
+ &nbsp;Water and Steam</div>
+ </p>
+ </html>"));
+    end T3b_ph;
+
+    function v3a_ph "Region 3 a: inverse function v(p,h)"
+        extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "Pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Units.SI.SpecificVolume v "specific volume";
+    protected
+        constant Real[:] n=
+          { 0.529944062966028e-2,-0.170099690234461,0.111323814312927e2,-0.217898123145125e4,
+           -0.506061827980875e-3,0.556495239685324,-0.943672726094016e1,-0.297856807561527,0.939353943717186e2,
+           0.192944939465981e-1,0.421740664704763,-0.368914126282330e7,-0.737566847600639e-2,-0.354753242424366,
+           -0.199768169338727e1,0.115456297059049e1,0.568366875815960e4,0.808169540124668e-2,0.172416341519307,
+           0.104270175292927e1,-0.297691372792847,0.560394465163593,0.275234661176914,-0.148347894866012,
+           -0.651142513478515e-1,-0.292468715386302e1,0.664876096952665e-1,0.352335014263844e1,-0.146340792313332e-1,
+           -0.224503486668184e1,0.110533464706142e1,-0.408757344495612e-1};
+        constant Real[:] I = {-12,-12,-12,-12,-10,-10,-10,-8,-8,-6,
+                              -6,-6,-4,-4,-3,-2,-2,-1,-1,-1,-1,0,0,1,1,1,2,2,3,4,5,8};
+        constant Real[:] J = {6,8,12,18,4,7,10,5,12,3,4,22,2,3,7,3,16,0,1,2,3,0,1,0,1,2,0,2,0,2,2,2};
+      constant Units.SI.Volume vstar=0.0028 "normalization temperature";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEnthalpy hstar=2100e3 "normalization enthalpy";
+        Real pi = p/pstar "normalized specific pressure";
+        Real eta = h/hstar "normalized specific enthalpy";
+    algorithm
+        v := sum(n[i]*(pi + 0.128)^I[i]*(eta - 0.727)^J[i] for i in 1:32)*vstar;
+        annotation (
+          Documentation(
+     info="<html>
+ <p>
+ &nbsp;Equation number 4 from:<br>
+ <div style=\"text-align: center;\">&nbsp;[1] The international Association
+ for the Properties of Water and Steam<br>
+ &nbsp;Vejle, Denmark<br>
+ &nbsp;August 2003<br>
+ &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+ T(p,h), v(p,h) and T(p,s), <br>
+ &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+ the Thermodynamic Properties of<br>
+ &nbsp;Water and Steam</div>
+ </p>
+ </html>"));
+    end v3a_ph;
+
+    function v3b_ph "Region 3 b: inverse function v(p,h)"
+        extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "Pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Units.SI.SpecificVolume v "specific volume";
+    protected
+        constant Real[:] n=
+          { -0.225196934336318e-8,0.140674363313486e-7,0.233784085280560e-5,-0.331833715229001e-4,
+           0.107956778514318e-2,-0.271382067378863,0.107202262490333e1,-0.853821329075382,-0.215214194340526e-4,
+           0.769656088222730e-3,-0.431136580433864e-2,0.453342167309331,-0.507749535873652,-0.100475154528389e3,
+           -0.219201924648793,-0.321087965668917e1,0.607567815637771e3,0.557686450685932e-3,0.187499040029550,
+           0.905368030448107e-2,0.285417173048685,0.329924030996098e-1,0.239897419685483,0.482754995951394e1,
+           -0.118035753702231e2,0.169490044091791,-0.179967222507787e-1,0.371810116332674e-1,-0.536288335065096e-1,
+           0.160697101092520e1};
+        constant Real[:] I = {-12,-12,-8,-8,-8,-8,-8,-8,-6,-6,
+                              -6,-6,-6,-6,-4,-4,-4,-3,-3,-2,-2,-1,-1,-1,-1,0,1,1,2,2};
+        constant Real[:] J = {0,1,0,1,3,6,7,8,0,1,2,5,6,10,3,6,10,0,2,1,2,0,1,4,5,0,0,1,2,6};
+      constant Units.SI.Volume vstar=0.0088 "normalization temperature";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEnthalpy hstar=2800e3 "normalization enthalpy";
+        Real pi = p/pstar "normalized specific pressure";
+        Real eta = h/hstar "normalized specific enthalpy";
+    algorithm
+        v := sum(n[i]*(pi + 0.0661)^I[i]*(eta - 0.720)^J[i] for i in 1:30)*vstar;
+        annotation (
+          Documentation(
+     info="<html>
+ <p>
+ &nbsp;Equation number 5 from:<br>
+ <div style=\"text-align: center;\">&nbsp;[1] The international Association
+ for the Properties of Water and Steam<br>
+ &nbsp;Vejle, Denmark<br>
+ &nbsp;August 2003<br>
+ &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+ T(p,h), v(p,h) and T(p,s), <br>
+ &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+ the Thermodynamic Properties of<br>
+ &nbsp;Water and Steam</div>
+ </p>
+ </html>"));
+    end v3b_ph;
+
+    function T3a_ps "Region 3 a: inverse function T(p,s)"
+        extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "Pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Temp_K T "Temperature";
+    protected
+        constant Real[:] n=
+          {0.150042008263875e10,-0.159397258480424e12,0.502181140217975e-3,-0.672057767855466e2,
+           0.145058545404456e4,-0.823889534888890e4,-0.154852214233853,0.112305046746695e2,-0.297000213482822e2,
+           0.438565132635495e11,0.137837838635464e-2,-0.297478527157462e1,0.971777947349413e13,-0.571527767052398e-4,
+           0.288307949778420e5,-0.744428289262703e14,0.128017324848921e2,-0.368275545889071e3,0.664768904779177e16,
+           0.449359251958880e-1,-0.422897836099655e1,-0.240614376434179,-0.474341365254924e1,0.724093999126110,
+           0.923874349695897,0.399043655281015e1,0.384066651868009e-1,-0.359344365571848e-2,-0.735196448821653,
+           0.188367048396131,0.141064266818704e-3,-0.257418501496337e-2,0.123220024851555e-2};
+        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 Units.SI.Temp_K Tstar=760 "normalization temperature";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEntropy sstar=4.4e3 "normalization entropy";
+        Real pi = p/pstar "normalized specific pressure";
+        Real sigma = s/sstar "normalized specific entropy";
+    algorithm
+        T := sum(n[i]*(pi + 0.240)^I[i]*(sigma - 0.703)^J[i] for i in 1:33)*Tstar;
+        annotation (
+          Documentation(
+     info="<html>
+ <p>
+ &nbsp;Equation number 6 from:<br>
+ <div style=\"text-align: center;\">&nbsp;[1] The international Association
+ for the Properties of Water and Steam<br>
+ &nbsp;Vejle, Denmark<br>
+ &nbsp;August 2003<br>
+ &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+ T(p,h), v(p,h) and T(p,s), <br>
+ &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+ the Thermodynamic Properties of<br>
+ &nbsp;Water and Steam</div>
+ </p>
+ </html>"));
+    end T3a_ps;
+
+    function T3b_ps "Region 3 b: inverse function T(p,s)"
+        extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "Pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.Temp_K T "Temperature";
+    protected
+        constant Real[:] n=
+          {0.527111701601660,-0.401317830052742e2,0.153020073134484e3,-0.224799398218827e4,
+           -0.193993484669048,-0.140467557893768e1,0.426799878114024e2,0.752810643416743,0.226657238616417e2,
+           -0.622873556909932e3,-0.660823667935396,0.841267087271658,-0.253717501764397e2,0.485708963532948e3,
+           0.880531517490555e3,0.265015592794626e7,-0.359287150025783,-0.656991567673753e3,0.241768149185367e1,
+           0.856873461222588,0.655143675313458,-0.213535213206406,0.562974957606348e-2,-0.316955725450471e15,
+           -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 Units.SI.Temp_K Tstar=860 "normalization temperature";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEntropy sstar=5.3e3 "normalization entropy";
+        Real pi = p/pstar "normalized specific pressure";
+        Real sigma = s/sstar "normalized specific entropy";
+    algorithm
+        T := sum(n[i]*(pi + 0.760)^I[i]*(sigma - 0.818)^J[i] for i in 1:28)*Tstar;
+        annotation (
+          Documentation(
+     info="<html>
+ <p>
+ &nbsp;Equation number 7 from:<br>
+ <div style=\"text-align: center;\">&nbsp;[1] The international Association
+ for the Properties of Water and Steam<br>
+ &nbsp;Vejle, Denmark<br>
+ &nbsp;August 2003<br>
+ &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+ T(p,h), v(p,h) and T(p,s), <br>
+ &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+ the Thermodynamic Properties of<br>
+ &nbsp;Water and Steam</div>
+ </p>
+ </html>"));
+    end T3b_ps;
+
+    function v3a_ps "Region 3 a: inverse function v(p,s)"
+        extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "Pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.SpecificVolume v "specific volume";
+    protected
+        constant Real[:] n=
+          {0.795544074093975e2,-0.238261242984590e4,0.176813100617787e5,-0.110524727080379e-2,
+           -0.153213833655326e2,0.297544599376982e3,-0.350315206871242e8,0.277513761062119,-0.523964271036888,
+           -0.148011182995403e6,0.160014899374266e7,0.170802322663427e13,0.246866996006494e-3,0.165326084797980e1,
+           -0.118008384666987,0.253798642355900e1,0.965127704669424,-0.282172420532826e2,0.203224612353823,
+           0.110648186063513e1,0.526127948451280,0.277000018736321,0.108153340501132e1,-0.744127885357893e-1,
+           0.164094443541384e-1,-0.680468275301065e-1,0.257988576101640e-1,-0.145749861944416e-3};
+        constant Real[:] I = {-12,-12,-12,-10,-10,-10,-10,-8,-8,-8,-8,-6,-5,-4,-3,-3,-2,-2,-1,-1,0,0,0,1,2,4,5,6};
+        constant Real[:] J = {10,12,14,4,8,10,20,5,6,14,16,28,1,5,2,4,3,8,1,2,0,1,3,0,0,2,2,0};
+      constant Units.SI.Volume vstar=0.0028 "normalization temperature";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEntropy sstar=4.4e3 "normalization entropy";
+        Real pi = p/pstar "normalized specific pressure";
+        Real sigma = s/sstar "normalized specific entropy";
+    algorithm
+        v := sum(n[i]*(pi + 0.187)^I[i]*(sigma - 0.755)^J[i] for i in 1:28)*vstar;
+        annotation (
+          Documentation(
+     info="<html>
+ <p>
+ &nbsp;Equation number 8 from:<br>
+ <div style=\"text-align: center;\">&nbsp;[1] The international Association
+ for the Properties of Water and Steam<br>
+ &nbsp;Vejle, Denmark<br>
+ &nbsp;August 2003<br>
+ &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+ T(p,h), v(p,h) and T(p,s), <br>
+ &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+ the Thermodynamic Properties of<br>
+ &nbsp;Water and Steam</div>
+ </p>
+ </html>"));
+    end v3a_ps;
+
+    function v3b_ps "Region 3 b: inverse function v(p,s)"
+        extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "Pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.SpecificVolume v "specific volume";
+    protected
+        constant Real[:] n=
+          {0.591599780322238e-4,-0.185465997137856e-2,0.104190510480013e-1,0.598647302038590e-2,
+           -0.771391189901699,0.172549765557036e1,-0.467076079846526e-3,0.134533823384439e-1,-0.808094336805495e-1,
+           0.508139374365767,0.128584643361683e-2,-0.163899353915435e1,0.586938199318063e1,-0.292466667918613e1,
+           -0.614076301499537e-2,0.576199014049172e1,-0.121613320606788e2,0.167637540957944e1,-0.744135838773463e1,
+           0.378168091437659e-1,0.401432203027688e1,0.160279837479185e2,0.317848779347728e1,-0.358362310304853e1,
+           -0.115995260446827e7,0.199256573577909,-0.122270624794624,-0.191449143716586e2,-0.150448002905284e-1,
+           0.146407900162154e2,-0.327477787188230e1};
+        constant Real[:] I = {-12,-12,-12,-12,-12,-12,-10,-10,
+                              -10,-10,-8,-5,-5,-5,-4,-4,-4,-4,-3,-2,-2,-2,-2,-2,-2,0,0,0,1,1,2};
+        constant Real[:] J = {0,1,2,3,5,6,0,1,2,4,0,1,2,3,0,1,2,3,1,0,1,2,3,4,12,0,1,2,0,2,2};
+      constant Units.SI.Volume vstar=0.0088 "normalization temperature";
+      constant Units.SI.Pressure pstar=100e6 "normalization pressure";
+      constant Units.SI.SpecificEntropy sstar=5.3e3 "normalization entropy";
+        Real pi = p/pstar "normalized specific pressure";
+        Real sigma = s/sstar "normalized specific entropy";
+    algorithm
+        v := sum(n[i]*(pi + 0.298)^I[i]*(sigma - 0.816)^J[i] for i in 1:31)*vstar;
+        annotation (
+          Documentation(
+     info="<html>
+ <p>
+ &nbsp;Equation number 9 from:<br>
+ <div style=\"text-align: center;\">&nbsp;[1] The international Association
+ for the Properties of Water and Steam<br>
+ &nbsp;Vejle, Denmark<br>
+ &nbsp;August 2003<br>
+ &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+ T(p,h), v(p,h) and T(p,s), <br>
+ &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+ the Thermodynamic Properties of<br>
+ &nbsp;Water and Steam</div>
+ </p>
+ </html>"));
+    end v3b_ps;
+
+    function g1L3
+      "base function for region 1 with 3rd derivatives for sensitivities: g(p,T)"
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                      g
+        "dimensionless Gibbs function and derivatives up to 3rd derivatives";
+    protected
+      Real pi1;
+      Real tau1;
+      Real[55] o;
+    algorithm
+      assert(p > ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple,
+        "IF97 medium function g1 called with too low pressure\n" + "p = " +
+        String(p) + " Pa <= " + String(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
+         + " Pa (triple point pressure)");
+      assert(p <= 100.0e6,
+        "IF97 medium function g1: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
+      assert(T >= 273.15,
+        "IF97 medium function g1: the temperature (= " + String(T) + " K)  is lower than 273.15 K!");
+      g.p := p;
+      g.T := T;
+      g.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      g.pi := p/ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PSTAR1;
+      g.tau := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TSTAR1/T;
+      pi1 := 7.1 - g.pi;
+      tau1 := -1.222 + g.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] := 5.85475673349302e-8*o[11];
+      o[38] := o[1]*o[3];
+      o[39] := 1/o[38];
+      o[40] := 1/o[6];
+      o[41] := o[1]*o[22]*o[3];
+      o[42] := 1/o[41];
+      o[43] := 1/o[22];
+      o[44] := o[1]*o[2]*o[21]*o[3];
+      o[45] := 1/o[44];
+      o[46] := 1/o[13];
+      o[47] := -0.00031703014781958*o[2];
+      o[48] := o[1]*o[2]*tau1;
+      o[49] := 1/o[48];
+      o[50] := o[1]*o[22]*o[3]*tau1;
+      o[51] := 1/o[50];
+      o[52] := o[22]*tau1;
+      o[53] := 1/o[52];
+      o[54] := o[2]*o[3]*tau1;
+      o[55] := 1/o[54];
+
+      g.g := pi1*
+          (pi1*(pi1*(o[10]*(-0.000031679644845054 +
+       o[2]*(-2.8270797985312e-6-8.5205128120103e-10*o[6])) +
+       pi1*(o[12]*(-2.2425281908e-6 + (-6.5171222895601e-7 -
+       1.4341729937924e-13*o[13])*o[7]) + pi1*(-4.0516996860117e-7*o[14] +
+       o[16]*((-1.2734301741641e-9-1.7424871230634e-10*o[11])*o[36] +
+       o[19]*(-6.8762131295531e-19*o[34] + o[15]*(1.4478307828521e-20*o[32]
+       + o[20]*(2.6335781662795e-23*o[30] + pi1*(-1.1947622640071e-23*o[28]+
+       pi1*(1.8228094581404e-24*o[26]- 9.3537087292458e-26*o[24]*pi1)))))))))
+       + o[8]*(-0.00047184321073267 + o[7]*(-0.00030001780793026 +
+       (0.000047661393906987 +
+       o[1]*(-4.4141845330846e-6-7.2694996297594e-16*o[9]))*tau1))) +
+       o[5]*(0.00028319080123804 + o[1]*(-0.00060706301565874 +
+       o[6]*(-0.018990068218419 + tau1*(-0.032529748770505 +
+       (-0.021841717175414-0.00005283835796993*o[1])*tau1))))) +
+       (0.14632971213167 + tau1*(-0.84548187169114 + tau1*(-3.756360367204
+       + tau1*(3.3855169168385 + tau1*(-0.95791963387872 +
+       tau1*(0.15772038513228 + (-0.016616417199501 +
+       0.00081214629983568*tau1)*tau1))))))/o[1];
+
+       g.gpi :=  pi1*(pi1*(o[10]*(0.000095038934535162 + o[2]*(8.4812393955936e-6 +
+       2.55615384360309e-9*o[6])) + pi1*(o[12]*(8.9701127632e-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.33001080055983e-19*o[32] +
+       o[20]*(-7.63737668221055e-22*o[30] + pi1*(3.5842867920213e-22*o[28]
+       + pi1*(-5.65070932023524e-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.00028319080123804 + o[1]*(0.00060706301565874 +
+       o[6]*(0.018990068218419 + tau1*(0.032529748770505 +
+       (0.021841717175414 + 0.00005283835796993*o[1])*tau1))));
+
+       g.gpipi :=  pi1*(o[10]*(-0.000190077869070324 +
+       o[2]*(-0.0000169624787911872-5.11230768720618e-9*o[6])) +
+       pi1*(o[12]*(-0.0000269103382896 +
+       (-7.82054674747212e-6-1.72100759255088e-12*o[13])*o[7]) +
+       pi1*(-8.1033993720234e-6*o[14] +
+       o[16]*((-7.13120897531896e-8-9.75792788915504e-9*o[11])*o[36] +
+       o[19]*(-2.8880095144123e-16*o[34] +
+       o[15]*(7.32602376123163e-18*o[32] +
+       o[20]*(2.13846547101895e-20*o[30] + pi1*(-1.03944316968618e-20*o[28]+
+       pi1*(1.69521279607057e-21*o[26]-9.27887905941183e-23*o[24]*pi1)))))))))
+       + o[8]*(-0.00094368642146534 + o[7]*(-0.00060003561586052 +
+       (0.000095322787813974 +
+       o[1]*(-8.8283690661692e-6-1.45389992595188e-15*o[9]))*tau1));
+
+       g.gpipipi := o[10]*(0.000190077869070324 + o[2]*(0.0000169624787911872 +
+       5.11230768720618e-9*o[6])) + pi1*(o[12]*(0.0000538206765792 +
+       (0.0000156410934949442 + 3.44201518510176e-12*o[13])*o[7]) +
+       pi1*(0.0000243101981160702*o[14] + o[16]*(o[36]*(4.27872538519138e-7
+       + o[37]) + o[19]*(5.48721807738337e-15*o[34] +
+       o[15]*(-1.53846498985864e-16*o[32] +
+       o[20]*(-5.77385677175118e-19*o[30] + pi1*(2.9104408751213e-19*o[28]
+       + pi1*(-4.91611710860466e-20*o[26] +
+       2.78366371782355e-21*o[24]*pi1))))))));
+
+       g.gtau :=
+       pi1*(o[39]*(-0.00254871721114236 + o[1]*(0.00424944110961118 +
+       (0.018990068218419 +
+       (-0.021841717175414-0.00015851507390979*o[1])*o[1])*o[6])) +
+       pi1*(o[10]*(0.00141552963219801 + o[2]*(0.000047661393906987 +
+       o[1]*(-0.0000132425535992538-1.2358149370591e-14*o[9]))) +
+       pi1*(o[12]*(0.000126718579380216-5.11230768720618e-9*o[38]) +
+       pi1*(o[40]*(0.000011212640954 +
+       (1.30342445791202e-6-1.4341729937924e-12*o[13])*o[7]) +
+       pi1*(3.24135974880936e-6*o[5] + o[16]*((1.40077319158051e-8 +
+       1.04549227383804e-9*o[11])*o[46] + o[19]*(1.9941018075704e-17*o[45]
+       + o[15]*(-4.48827542684151e-19*o[43] +
+       o[20]*(-1.00075970318621e-21*o[28] + pi1*(4.65957282962769e-22*o[26]
+       + pi1*(-7.2912378325616e-23*o[24] +
+       3.83502057899078e-24*o[42]*pi1))))))))))) + o[8]*(-0.29265942426334
+       + tau1*(0.84548187169114 + o[1]*(3.3855169168385 +
+       tau1*(-1.91583926775744 + tau1*(0.47316115539684 +
+       (-0.066465668798004 + 0.0040607314991784*tau1)*tau1)))));
+
+       g.gtautau :=
+       pi1*(o[36]*(0.0254871721114236 + o[1]*(-0.0339955288768894 +
+       (-0.037980136436838 + o[47])*o[6])) +
+       pi1*(o[12]*(-0.00566211852879204 +
+       o[6]*(-0.0000264851071985076-1.97730389929456e-13*o[9])) +
+       pi1*((-0.00063359289690108-2.55615384360309e-8*o[38])*o[40] +
+       pi1*(o[49]*(-0.000067275845724 +
+       (-3.91027337373606e-6-1.29075569441316e-11*o[13])*o[7]) +
+       pi1*(-0.0000291722377392842*o[39] +
+       o[16]*((-1.68092782989661e-7-7.31844591686628e-9*o[11])*o[55] +
+       o[19]*(-5.9823054227112e-16*o[32] +
+       o[15]*(1.43624813658928e-17*o[53] +
+       o[20]*(3.90296284242622e-20*o[26] + pi1*(-1.86382913185108e-20*o[24]
+       +
+       pi1*(2.98940751135026e-21*o[42]-1.61070864317613e-22*o[51]*pi1)))))))))))
+       + o[10]*(0.87797827279002 + tau1*(-1.69096374338228 +
+       o[7]*(-1.91583926775744 + tau1*(0.94632231079368 +
+       (-0.199397006394012 + 0.0162429259967136*tau1)*tau1))));
+
+       g.gtautautau :=
+       pi1*(o[46]*(-0.28035889322566 + o[1]*(0.305959759892005 +
+       (0.113940409310514 + o[47])*o[6])) + pi1*(o[40]*(0.0283105926439602
+       + o[6]*(-0.0000264851071985076-2.96595584894183e-12*o[9])) +
+       pi1*((0.00380155738140648-1.02246153744124e-7*o[38])*o[49] +
+       pi1*(o[14]*(0.000470930920068 +
+       (0.0000156410934949442-1.03260455553053e-10*o[13])*o[7]) +
+       pi1*(0.000291722377392842*o[36] + o[16]*((2.1852061788656e-6 +
+       o[37])/o[9] + o[19]*(1.85451468104047e-14*o[43] +
+       o[15]*(-4.73961885074464e-16/(o[1]*o[22]) +
+       o[20]*(-1.56118513697049e-18*o[24] + pi1*(7.64169944058941e-19*o[42]
+       + pi1*(-1.25555115476711e-19*o[51] +
+       (6.92604716565734e-21*pi1)/(o[2]*o[22]*o[3])))))))))))) +
+       o[12]*(-3.51191309116008 + tau1*(5.07289123014684 +
+       o[2]*(0.94632231079368 + (-0.398794012788024 +
+       0.0487287779901408*tau1)*tau1)));
+
+       g.gpitau := o[39]*(0.00254871721114236
+       + o[1]*(-0.00424944110961118 + (-0.018990068218419 +
+       (0.021841717175414 + 0.00015851507390979*o[1])*o[1])*o[6])) +
+       pi1*(o[10]*(-0.00283105926439602 + o[2]*(-0.000095322787813974 +
+       o[1]*(0.0000264851071985076 + 2.4716298741182e-14*o[9]))) +
+       pi1*(o[12]*(-0.000380155738140648 + 1.53369230616185e-8*o[38]) +
+       pi1*(o[40]*(-0.000044850563816 + (-5.21369783164808e-6 +
+       5.7366919751696e-12*o[13])*o[7]) + pi1*(-0.0000162067987440468*o[5]
+       + o[16]*((-1.12061855326441e-7-8.36393819070432e-9*o[11])*o[46] +
+       o[19]*(-4.18761379589784e-16*o[45] +
+       o[15]*(1.03230334817355e-17*o[43] +
+       o[20]*(2.90220313924001e-20*o[28] + pi1*(-1.39787184888831e-20*o[26]
+       +
+       pi1*(2.2602837280941e-21*o[24]-1.22720658527705e-22*o[42]*pi1))))))))));
+
+       g.gpipitau := o[10]*(0.00283105926439602 + o[2]*(0.000095322787813974 +
+       o[1]*(-0.0000264851071985076-2.4716298741182e-14*o[9]))) +
+       pi1*(o[12]*(0.000760311476281296-3.06738461232371e-8*o[38]) +
+       pi1*(o[40]*(0.000134551691448 +
+       (0.0000156410934949442-1.72100759255088e-11*o[13])*o[7]) +
+       pi1*(0.0000648271949761872*o[5] + o[16]*((7.84432987285086e-7 +
+       o[37])*o[46] + o[19]*(8.37522759179568e-15*o[45] +
+       o[15]*(-2.2710673659818e-16*o[43] +
+       o[20]*(-8.12616878987203e-19*o[28] + pi1*(4.05382836177609e-19*o[26]
+       + pi1*(-6.78085118428229e-20*o[24] +
+       3.80434041435885e-21*o[42]*pi1)))))))));
+
+       g.gpitautau :=  o[36]*(-0.0254871721114236 + o[1]*(0.0339955288768894 +
+       (0.037980136436838 + 0.00031703014781958*o[2])*o[6])) +
+       pi1*(o[12]*(0.0113242370575841 + o[6]*(0.0000529702143970152 +
+       3.95460779858911e-13*o[9])) + pi1*((0.00190077869070324 +
+        7.66846153080927e-8*o[38])*o[40] + pi1*(o[49]*(0.000269103382896 +
+        (0.0000156410934949442 + 5.16302277765264e-11*o[13])*o[7]) +
+        pi1*(0.000145861188696421*o[39] + o[16]*((1.34474226391729e-6 +
+        o[37])*o[55] + o[19]*(1.25628413876935e-14*o[32] +
+        o[15]*(-3.30337071415535e-16*o[53] +
+        o[20]*(-1.1318592243036e-18*o[26] + pi1*(5.59148739555323e-19*o[24]
+        + pi1*(-9.26716328518579e-20*o[42] +5.1542676581636e-21*o[51]*pi1))))))))));
+    end g1L3;
+
+    function g2L3
+      "base function for region 2 with 3rd derivatives for sensitivities: g(p,T)"
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                      g
+        "dimensionless Gibbs function and derivatives up to 3rd derivatives";
+    protected
+      Real pi2;
+      Real tau2;
+      Real[82] o;
+    algorithm
+      assert(p > ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple,
+        "IF97 medium function g2 called with too low pressure\n" + "p = " +
+        String(p) + " Pa <= " + String(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
+         + " Pa (triple point pressure)");
+      assert(p <= 100.0e6,
+        "IF97 medium function g2: the input pressure (= " + String(p) + " Pa) is higher than 100 Mpa");
+      assert(T >= 273.15,
+        "IF97 medium function g2: the temperature (= " + String(T) + " K) is lower than 273.15 K!");
+      assert(T <= 1073.15,
+        "IF97 medium function g2: the input temperature (= " + String(T) + " K) is higher than the limit of 1073.15 K");
+      g.p := p;
+      g.T := T;
+      g.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      g.pi := p/ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PSTAR2;
+      g.tau := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TSTAR2/T;
+      tau2 := -0.5 + g.tau;
+      o[1] := tau2*tau2;
+      o[2] := o[1]*tau2;
+      o[3] := -0.05032527872793*o[2];
+      o[4] := -0.057581259083432 + o[3];
+      o[5] := o[4]*tau2;
+      o[6] := -0.045996013696365 + o[5];
+      o[7] := o[6]*tau2;
+      o[8] := -0.017834862292358 + o[7];
+      o[9] := o[8]*tau2;
+      o[10] := o[1]*o[1];
+      o[11] := o[10]*o[10];
+      o[12] := o[11]*o[11];
+      o[13] := o[10]*o[11]*o[12]*tau2;
+      o[14] := o[1]*o[10]*tau2;
+      o[15] := o[10]*o[11]*tau2;
+      o[16] := o[1]*o[12]*tau2;
+      o[17] := o[1]*o[11]*tau2;
+      o[18] := o[1]*o[10]*o[11];
+      o[19] := o[10]*o[11]*o[12];
+      o[20] := o[1]*o[10];
+      o[21] := g.pi*g.pi;
+      o[22] := o[21]*o[21];
+      o[23] := o[21]*o[22];
+      o[24] := o[10]*o[12]*tau2;
+      o[25] := o[12]*o[12];
+       o[26] := o[11]*o[12]*o[25]*tau2;
+       o[27] := o[10]*o[12];
+       o[28] := o[1]*o[10]*o[11]*tau2;
+       o[29] := o[10]*o[12]*o[25]*tau2;
+       o[30] := o[1]*o[10]*o[25]*tau2;
+       o[31] := o[1]*o[11]*o[12];
+       o[32] := o[1]*o[12];
+       o[33] := g.tau*g.tau;
+       o[34] := o[33]*o[33];
+       o[35] := -0.000053349095828174*o[13];
+       o[36] := -0.087594591301146 + o[35];
+       o[37] := o[2]*o[36];
+       o[38] := -0.007878555448671 + o[37];
+       o[39] := o[1]*o[38];
+       o[40] := -0.0003789797503263 + o[39];
+       o[41] := o[40]*tau2;
+       o[42] := -0.000066065283340406 + o[41];
+       o[43] := o[42]*tau2;
+       o[44] := -0.244009521375894*o[13];
+       o[45] := -0.0090203547252888 + o[44];
+       o[46] := o[2]*o[45];
+       o[47] := -0.00019366606343142 + o[46];
+       o[48] := o[1]*o[47];
+       o[49] := 2.6322400370661e-6 + o[48];
+       o[50] := o[49]*tau2;
+       o[51] := 5.78704472622084e-6*tau2;
+       o[52] := o[21]*g.pi;
+       o[53] := 0.0000115740894524417*tau2;
+       o[54] := -0.30195167236758*o[2];
+       o[55] := -0.172743777250296 + o[54];
+       o[56] := o[55]*tau2;
+       o[57] := -0.09199202739273 + o[56];
+       o[58] := o[57]*tau2;
+       o[59] := o[1]*o[11];
+       o[60] := o[10]*o[11];
+       o[61] := o[11]*o[12]*o[25];
+       o[62] := o[10]*o[12]*o[25];
+       o[63] := o[1]*o[10]*o[25];
+       o[64] := o[11]*o[12]*tau2;
+       o[65] := -1.5097583618379*o[2];
+       o[66] := -0.345487554500592 + o[65];
+       o[67] := o[66]*tau2;
+       o[68] := o[10]*tau2;
+       o[69] := o[11]*tau2;
+       o[70] := o[1]*o[11]*o[12]*tau2;
+       o[71] := o[1]*o[10]*o[12]*o[25]*tau2;
+       o[72] := o[1]*o[12]*o[25]*tau2;
+       o[73] := o[10]*o[25]*tau2;
+       o[74] := o[11]*o[12];
+       o[75] := o[34]*o[34];
+       o[76] := -0.00192056744981426*o[13];
+       o[77] := -0.613162139108022 + o[76];
+       o[78] := o[2]*o[77];
+       o[79] := -0.031514221794684 + o[78];
+       o[80] := o[1]*o[79];
+       o[81] := -0.0007579595006526 + o[80];
+       o[82] := o[81]*tau2;
+
+      g.g := g.pi*(-0.0017731742473213 + o[9] + g.pi*(tau2*(-0.000033032641670203
+         + (-0.00018948987516315 + o[1]*(-0.0039392777243355 + (-0.043797295650573
+         - 0.000026674547914087*o[13])*o[2]))*tau2) + g.pi*(2.0481737692309e-8
+         + (4.3870667284435e-7 + o[1]*(-0.00003227767723857 + (-0.0015033924542148
+         - 0.040668253562649*o[13])*o[2]))*tau2 + g.pi*(g.pi*(
+        2.2922076337661e-6*o[14] + g.pi*((-1.6714766451061e-11 + o[15]*(-0.0021171472321355
+         - 23.895741934104*o[16]))*o[2] + g.pi*(-5.905956432427e-18 + o[17]*(-1.2621808899101e-6
+         - 0.038946842435739*o[18]) + g.pi*(o[11]*(1.1256211360459e-11 -
+        8.2311340897998*o[19]) + g.pi*(1.9809712802088e-8*o[15] + g.pi*(o[10]*(
+        1.0406965210174e-19 + (-1.0234747095929e-13 - 1.0018179379511e-9*o[10])
+        *o[20]) + o[23]*(o[13]*(-8.0882908646985e-11 + 0.10693031879409*o[24])
+         + o[21]*(-0.33662250574171*o[26] + o[21]*(o[27]*(8.9185845355421e-25
+         + (3.0629316876232e-13 - 4.2002467698208e-6*o[15])*o[28]) + g.pi*(-5.9056029685639e-26
+        *o[24] + g.pi*(3.7826947613457e-6*o[29] + g.pi*(-1.2768608934681e-15*o[
+        30] + o[31]*(7.3087610595061e-29 + o[18]*(5.5414715350778e-17 -
+        9.436970724121e-7*o[32]))*g.pi)))))))))))) + tau2*(-7.8847309559367e-10
+         + (1.2790717852285e-8 + 4.8225372718507e-7*tau2)*tau2))))) + (-0.00560879118302
+         + g.tau*(0.07145273881455 + g.tau*(-0.4071049823928 + g.tau*(
+        1.424081971444 + g.tau*(-4.38395111945 + g.tau*(-9.692768600217 + g.tau
+        *(10.08665568018 + (-0.2840863260772 + 0.02126846353307*g.tau)*g.tau)
+         + Modelica.Math.log(g.pi)))))))/(o[34]*g.tau);
+
+      g.gpi :=
+        (1.0 + g.pi*(-0.0017731742473213 + o[9] + g.pi*(o[43] +
+           g.pi*(6.1445213076927e-8 + (1.31612001853305e-6 +
+           o[1]*(-0.00009683303171571 +
+           (-0.0045101773626444-0.122004760687947*o[13])*o[2]))*tau2 +
+           g.pi*(g.pi*(0.0000114610381688305*o[14] + g.pi*((-1.00288598706366e-10 +
+           o[15]*(-0.012702883392813-143.374451604624*o[16]))*o[2] +
+           g.pi*(-4.1341695026989e-17 +
+           o[17]*(-8.8352662293707e-6-0.272627897050173*o[18]) +
+           g.pi*(o[11]*(9.0049690883672e-11-65.8490727183984*o[19]) +
+           g.pi*(1.78287415218792e-7*o[15] + g.pi*(o[10]*(1.0406965210174e-18 +
+           (-1.0234747095929e-12-1.0018179379511e-8*o[10])*o[20]) +
+           o[23]*(o[13]*(-1.29412653835176e-9 + 1.71088510070544*o[24]) +
+           o[21]*(-6.05920510335078*o[26] + o[21]*(o[27]*(1.78371690710842e-23 +
+           (6.1258633752464e-12-0.000084004935396416*o[15])*o[28]) +
+           g.pi*(-1.24017662339842e-24*o[24] + g.pi*(0.0000832192847496054*o[29] +
+           g.pi*(-2.93678005497663e-14*o[30] + o[31]*(1.75410265428146e-27 +
+           o[18]*(1.32995316841867e-15-0.0000226487297378904*o[32]))*g.pi))))))))))))
+           + tau2*(-3.15389238237468e-9 + (5.116287140914e-8 +
+           1.92901490874028e-6*tau2)*tau2))))))/g.pi;
+
+      g.gpipi :=
+          (-1.0 + o[21]*(o[43] + g.pi*(1.22890426153854e-7 + o[50] +
+           g.pi*(g.pi*(0.000045844152675322*o[14] + g.pi*((-5.0144299353183e-10 +
+           o[15]*(-0.063514416964065-716.87225802312*o[16]))*o[2] +
+           g.pi*(-2.48050170161934e-16 +
+           o[17]*(-0.0000530115973762242-1.63576738230104*o[18]) +
+           g.pi*(o[11]*(6.30347836185704e-10-460.943509028789*o[19]) +
+           g.pi*(1.42629932175034e-6*o[15] + g.pi*(o[10]*(9.3662686891566e-18 +
+           (-9.2112723863361e-12-9.0163614415599e-8*o[10])*o[20]) +
+           o[23]*(o[13]*(-1.94118980752764e-8 + 25.6632765105816*o[24]) +
+           o[21]*(-103.006486756963*o[26] + o[21]*(o[27]*(3.389062123506e-22 +
+           (1.16391404129682e-10-0.0015960937725319*o[15])*o[28]) +
+           g.pi*(-2.48035324679684e-23*o[24] + g.pi*(0.00174760497974171*o[29] +
+           g.pi*(-6.46091612094859e-13*o[30] + o[31]*(4.03443610484737e-26 +
+           o[18]*(3.05889228736295e-14-0.000520920783971479*o[32]))*g.pi))))))))))))
+           + tau2*(-9.46167714712404e-9 + (1.5348861422742e-7 +
+           o[51])*tau2)))))/o[21];
+
+      g.gpipipi :=
+            (2.0 + o[52]*(1.22890426153854e-7 + o[50] +
+           g.pi*(g.pi*(0.000137532458025966*o[14] + g.pi*((-2.00577197412732e-9 +
+           o[15]*(-0.25405766785626-2867.48903209248*o[16]))*o[2] +
+           g.pi*(-1.24025085080967e-15 +
+           o[17]*(-0.000265057986881121-8.17883691150519*o[18]) +
+           g.pi*(o[11]*(3.78208701711422e-9-2765.66105417273*o[19]) +
+           g.pi*(9.98409525225235e-6*o[15] + g.pi*(o[10]*(7.49301495132528e-17 +
+           (-7.36901790906888e-11-7.21308915324792e-7*o[10])*o[20]) +
+           o[23]*(o[13]*(-2.7176657305387e-7 + 359.285871148142*o[24]) +
+           o[21]*(-1648.10378811141*o[26] + o[21]*(o[27]*(6.1003118223108e-21 +
+           (2.09504527433427e-9-0.0287296879055743*o[15])*o[28]) +
+           g.pi*(-4.71267116891399e-22*o[24] + g.pi*(0.0349520995948343*o[29] +
+           g.pi*(-1.3567923853992e-11*o[30] + o[31]*(8.87575943066421e-25 +
+           o[18]*(6.72956303219848e-13-0.0114602572473725*o[32]))*g.pi))))))))))))
+           + tau2*(-1.89233542942481e-8 + (3.0697722845484e-7 +
+           o[53])*tau2))))/o[52];
+
+      g.gtau :=
+         (0.0280439559151 + g.tau*(-0.2858109552582 +
+           g.tau*(1.2213149471784 + g.tau*(-2.848163942888 + g.tau*(4.38395111945 +
+           o[33]*(10.08665568018 + (-0.5681726521544 +
+           0.06380539059921*g.tau)*g.tau))))))/(o[33]*o[34]) + g.pi*(-0.017834862292358
+           + o[58] + g.pi*(-0.000033032641670203 + (-0.0003789797503263 +
+           o[1]*(-0.015757110897342 +
+           (-0.306581069554011-0.000960283724907132*o[13])*o[2]))*tau2 +
+           g.pi*(4.3870667284435e-7 + o[1]*(-0.00009683303171571 +
+           (-0.0090203547252888-1.42338887469272*o[13])*o[2]) +
+           g.pi*(-7.8847309559367e-10 + g.pi*(0.0000160454534363627*o[20] +
+           g.pi*(o[1]*(-5.0144299353183e-11 +
+           o[15]*(-0.033874355714168-836.35096769364*o[16])) +
+           g.pi*((-0.0000138839897890111-0.973671060893475*o[18])*o[59] +
+           g.pi*(o[14]*(9.0049690883672e-11-296.320827232793*o[19]) +
+           g.pi*(2.57526266427144e-7*o[60] + g.pi*(o[2]*(4.1627860840696e-19 +
+           (-1.0234747095929e-12-1.40254511313154e-8*o[10])*o[20]) +
+           o[23]*(o[19]*(-2.34560435076256e-9 + 5.3465159397045*o[24]) +
+           o[21]*(-19.1874828272775*o[61] + o[21]*(o[16]*(1.78371690710842e-23 +
+           (1.07202609066812e-11-0.000201611844951398*o[15])*o[28]) +
+           g.pi*(-1.24017662339842e-24*o[27] + g.pi*(0.000200482822351322*o[62] +
+           g.pi*(-4.97975748452559e-14*o[63] + (1.90027787547159e-27 +
+           o[18]*(2.21658861403112e-15-0.0000547344301999018*o[32]))*o[64]*g.pi))))))))))))
+           + (2.558143570457e-8 + 1.44676118155521e-6*tau2)*tau2))));
+
+      g.gtautau :=
+            (-0.1682637354906 + g.tau*(1.429054776291 +
+           g.tau*(-4.8852597887136 + g.tau*(8.544491828664 + g.tau*(-8.7679022389 +
+           o[33]*(-0.5681726521544 +
+           0.12761078119842*g.tau)*g.tau)))))/(o[33]*o[34]*g.tau) +
+           g.pi*(-0.09199202739273 + o[67] + g.pi*(-0.0003789797503263 +
+           o[1]*(-0.047271332692026 +
+           (-1.83948641732407-0.0336099303717496*o[13])*o[2]) +
+           g.pi*((-0.00019366606343142 +
+           (-0.045101773626444-48.3952217395523*o[13])*o[2])*tau2 +
+           g.pi*(2.558143570457e-8 + 2.89352236311042e-6*tau2 +
+           g.pi*(0.0000962727206181762*o[68] +
+           g.pi*(g.pi*((-0.000138839897890111-23.3681054614434*o[18])*o[69] +
+           g.pi*((6.30347836185704e-10-10371.2289531477*o[19])*o[20] +
+           g.pi*(3.09031519712573e-6*o[17] + g.pi*(o[1]*(1.24883582522088e-18 +
+           (-9.2112723863361e-12-1.823308647071e-7*o[10])*o[20]) +
+           o[23]*((-6.56769218213518e-8 + 261.979281045521*o[24])*o[70] +
+           o[21]*(-1074.49903832754*o[71] + o[21]*((3.389062123506e-22 +
+           (3.64488870827161e-10-0.00947575671271573*o[15])*o[28])*o[32] +
+    g.pi*(-2.48035324679684e-23*o[16] + g.pi*(0.0104251067622687*o[72] +
+    g.pi*(-1.89230784411972e-12*o[73] + (4.75069468867897e-26 +
+    o[18]*(8.64469559472137e-14-0.0031198625213944*o[32]))*o[74]*g.pi))))))))))
+    + (-1.00288598706366e-10 +
+    o[15]*(-0.50811533571252-28435.9329015838*o[16]))*tau2))))));
+
+      g.gtautautau :=
+               (1.1778461484342 + g.tau*(-8.574328657746 + g.tau*(24.426298943568
+           + g.tau*(-34.177967314656 + (26.3037067167 +
+           0.12761078119842*o[34])*g.tau))))/o[75] +
+           g.pi*(-0.345487554500592-6.0390334473516*o[2] + g.pi*((-0.094542665384052
+           + (-9.19743208662033-1.14273763263949*o[13])*o[2])*tau2 +
+           g.pi*(-0.00019366606343142 +
+           (-0.180407094505776-1597.04231740523*o[13])*o[2] +
+           g.pi*(2.89352236311042e-6 + g.pi*(0.000481363603090881*o[10] +
+           g.pi*(-1.00288598706366e-10 +
+           o[15]*(-7.11361469997528-938385.785752264*o[16]) +
+           g.pi*(o[11]*(-0.001249559081011-537.466425613198*o[18]) +
+           g.pi*((3.78208701711422e-9-352621.784407023*o[19])*o[68] +
+           g.pi*(0.000033993467168383*o[59] + g.pi*((2.49767165044176e-18 +
+           (-7.36901790906888e-11-2.1879703764852e-6*o[10])*o[20])*tau2 +
+           o[23]*((-1.7732768891765e-6 + 12575.005490185*o[24])*o[31] +
+           o[21]*(-59097.4471080146*o[1]*o[10]*o[12]*o[25] +
+           o[21]*(o[12]*(6.1003118223108e-21 +
+           (1.20281327372963e-8-0.435884808784923*o[15])*o[28])*tau2 +
+    g.pi*(-4.71267116891399e-22*o[32] +
+    g.pi*(0.531680444875706*o[1]*o[12]*o[25] +
+    g.pi*(-7.00153902324298e-11*o[10]*o[25] +
+    o[1]*o[10]*o[12]*(1.14016672528295e-24 +
+    o[18]*(3.28498432599412e-12-0.174712301198087*o[32]))*g.pi*tau2))))))))))))))));
+
+      g.gpitau := -0.017834862292358 + o[58] + g.pi*
+                                             (-0.000066065283340406 + o[82]
+           + g.pi*(1.31612001853305e-6 + o[1]*(-0.00029049909514713 +
+           (-0.0270610641758664-4.27016662407815*o[13])*o[2]) +
+           g.pi*(-3.15389238237468e-9 + g.pi*(0.0000802272671818135*o[20] +
+           g.pi*(o[1]*(-3.00865796119098e-10 +
+           o[15]*(-0.203246134285008-5018.10580616184*o[16])) +
+           g.pi*((-0.0000971879285230777-6.81569742625432*o[18])*o[59] +
+           g.pi*(o[14]*(7.20397527069376e-10-2370.56661786234*o[19]) +
+           g.pi*(2.3177363978443e-6*o[60] + g.pi*(o[2]*(4.1627860840696e-18 +
+           (-1.0234747095929e-11-1.40254511313154e-7*o[10])*o[20]) +
+           o[23]*(o[19]*(-3.7529669612201e-8 + 85.544255035272*o[24]) +
+           o[21]*(-345.374690890994*o[61] + o[21]*(o[16]*(3.56743381421684e-22 +
+           (2.14405218133624e-10-0.00403223689902797*o[15])*o[28]) +
+           g.pi*(-2.60437090913668e-23*o[27] + g.pi*(0.00441062209172909*o[62] +
+           g.pi*(-1.14534422144089e-12*o[63] + (4.56066690113181e-26 +
+           o[18]*(5.31981267367469e-14-0.00131362632479764*o[32]))*o[64]*g.pi))))))))))))
+           + (1.0232574281828e-7 + o[51])*tau2)));
+
+      g.gpipitau := -0.000066065283340406 + o[82] + g.pi*
+                                                  (2.6322400370661e-6 +
+           o[1]*(-0.00058099819029426 +
+           (-0.0541221283517328-8.54033324815629*o[13])*o[2]) +
+           g.pi*(-9.46167714712404e-9 + g.pi*(0.000320909068727254*o[20] +
+           g.pi*(o[1]*(-1.50432898059549e-9 +
+           o[15]*(-1.01623067142504-25090.5290308092*o[16])) +
+           g.pi*((-0.000583127571138466-40.8941845575259*o[18])*o[59] +
+           g.pi*(o[14]*(5.04278268948563e-9-16593.9663250364*o[19]) +
+           g.pi*(0.0000185418911827544*o[60] + g.pi*(o[2]*(3.74650747566264e-17 +
+           (-9.2112723863361e-11-1.26229060181839e-6*o[10])*o[20]) +
+           o[23]*(o[19]*(-5.62945044183016e-7 + 1283.16382552908*o[24]) +
+           o[21]*(-5871.36974514691*o[61] + o[21]*(o[16]*(6.778124247012e-21 +
+           (4.07369914453886e-9-0.0766125010815314*o[15])*o[28]) +
+           g.pi*(-5.20874181827336e-22*o[27] + g.pi*(0.0926230639263108*o[62] +
+           g.pi*(-2.51975728716995e-11*o[63] + (1.04895338726032e-24 +
+           o[18]*(1.22355691494518e-12-0.0302134054703458*o[32]))*o[64]*g.pi))))))))))))
+           + (3.0697722845484e-7 + 0.0000173611341786625*tau2)*tau2));
+
+      g.gpitautau := -0.09199202739273 + o[67] + g.pi*
+                                               (-0.0007579595006526 +
+    o[1]*(-0.094542665384052 +
+    (-3.67897283464813-0.0672198607434992*o[13])*o[2]) +
+    g.pi*((-0.00058099819029426 +
+    (-0.135305320879332-145.185665218657*o[13])*o[2])*tau2 +
+    g.pi*(1.0232574281828e-7 + o[53] + g.pi*(0.000481363603090881*o[68] +
+    g.pi*(g.pi*((-0.000971879285230777-163.576738230104*o[18])*o[69] +
+    g.pi*((5.04278268948563e-9-82969.831625182*o[19])*o[20] +
+    g.pi*(0.0000278128367741315*o[17] + g.pi*(o[1]*(1.24883582522088e-17 +
+    (-9.2112723863361e-11-1.823308647071e-6*o[10])*o[20]) +
+    o[23]*((-1.05083074914163e-6 + 4191.66849672833*o[24])*o[70] +
+    o[21]*(-19340.9826898957*o[71] + o[21]*((6.778124247012e-21 +
+    (7.28977741654322e-9-0.189515134254314*o[15])*o[28])*o[32] +
+    g.pi*(-5.20874181827336e-22*o[16] + g.pi*(0.229352348769913*o[72] +
+    g.pi*(-4.35230804147537e-11*o[73] + (1.14016672528295e-24 +
+    o[18]*(2.07472694273313e-12-0.0748767005134657*o[32]))*o[74]*g.pi)))))))))) +
+     (-6.01731592238196e-10 + o[15]*(-3.04869201427512 - 170615.597409503*o[16]))
+                                                 *tau2)))));
+    end g2L3;
+
+    function f3L3
+      "Helmholtz function for region 3: f(d,T), including 3rd derivatives"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature (K)";
+      output ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
+                                                          f
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+    protected
+      Real tau "dimensionless temperature";
+      Real del "dimensionless density";
+      Real[62] o "vector of auxiliary variables";
+    algorithm
+      f.T := T;
+      f.d := d;
+      f.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      tau := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT/T;
+      del := if (d == ThermoSysPro.Properties.WaterSteam.BaseIF97.data.DCRIT and
+        T == ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT) then 1 -
+        Modelica.Constants.eps else abs(d/ThermoSysPro.Properties.WaterSteam.BaseIF97.data.DCRIT);
+      f.tau := tau;
+      f.delta := del;
+      o[1] := tau*tau;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*tau;
+      o[4] := o[1]*tau;
+      o[5] := o[2]*o[2];
+      o[6] := o[1]*o[5]*tau;
+      o[7] := o[5]*tau;
+      o[8] := -0.64207765181607*o[1];
+      o[9] := 0.88521043984318 + o[8];
+      o[10] := o[7]*o[9];
+      o[11] := -1.1524407806681 + o[10];
+      o[12] := o[11]*o[2];
+      o[13] := -1.2654315477714 + o[12];
+      o[14] := o[1]*o[13];
+      o[15] := o[1]*o[2]*o[5]*tau;
+      o[16] := o[2]*o[5];
+      o[17] := o[1]*o[5];
+      o[18] := o[5]*o[5];
+      o[19] := o[1]*o[18]*o[2];
+      o[20] := o[1]*o[18]*o[2]*tau;
+      o[21] := o[18]*o[5];
+      o[22] := o[1]*o[18]*o[5];
+      o[23] := 0.25116816848616*o[2];
+      o[24] := 0.078841073758308 + o[23];
+      o[25] := o[15]*o[24];
+      o[26] := -6.100523451393 + o[25];
+      o[27] := o[26]*tau;
+      o[28] := 9.7944563083754 + o[27];
+      o[29] := o[2]*o[28];
+      o[30] := -1.70429417648412 + o[29];
+      o[31] := o[1]*o[30];
+      o[32] := del*del;
+      o[33] := -2.85576214409538*o[17];
+      o[34] := -0.0492885823043778 + o[33];
+      o[35] := o[16]*o[34];
+      o[36] := -12.113949014142 + o[35];
+      o[37] := o[1]*o[36];
+      o[38] := 8.339879741676 + o[37];
+      o[39] := o[1]*o[38];
+      o[40] := del*o[32];
+      o[41] := -10.9153200808732*o[1];
+      o[42] := 13.2781565976477 + o[41];
+      o[43] := o[42]*o[7];
+      o[44] := -6.9146446840086 + o[43];
+      o[45] := o[2]*o[44];
+      o[46] := -2.5308630955428 + o[45];
+      o[47] := o[46]*tau;
+      o[48] := o[18]*o[5]*tau;
+      o[49] := -174.645121293971*o[1];
+      o[50] := 185.894192367068 + o[49];
+      o[51] := o[50]*o[7];
+      o[52] := -34.573223420043 + o[51];
+      o[53] := o[2]*o[52];
+      o[54] := 6.53037238064016*o[2];
+      o[55] := 1.73450362268278 + o[54];
+      o[56] := o[15]*o[55];
+      o[57] := -42.703664159751 + o[56];
+      o[58] := o[57]*tau;
+      o[59] := 58.7667378502524 + o[58];
+      o[60] := o[2]*o[59];
+      o[61] := -3.40858835296824 + o[60];
+      o[62] := o[61]*tau;
+
+      f.f := -15.732845290239 + tau*(20.944396974307 + (-7.6867707878716 + o[3]
+        *(2.6185947787954 + o[4]*(-2.808078114862 + o[1]*(1.2053369696517 -
+        0.0084566812812502*o[6]))))*tau) + del*(o[14] + del*(0.38493460186671
+         + o[1]*(-0.85214708824206 + o[2]*(4.8972281541877 + (-3.0502617256965
+         + o[15]*(0.039420536879154 + 0.12558408424308*o[2]))*tau)) + del*(-0.2799932969871
+         + o[1]*(1.389979956946 + o[1]*(-2.018991502357 + o[16]*(-0.0082147637173963
+         - 0.47596035734923*o[17]))) + del*(0.0439840744735 + o[1]*(-0.44476435428739
+         + o[1]*(0.90572070719733 + 0.70522450087967*o[19])) + del*(del*(-0.022175400873096
+         + o[1]*(0.094260751665092 + 0.16436278447961*o[21]) + del*(-0.013503372241348
+        *o[1] + del*(-0.014834345352472*o[22] + del*(o[1]*(0.00057922953628084
+         + 0.0032308904703711*o[21]) + del*(0.000080964802996215 -
+        0.000044923899061815*del*o[22] - 0.00016557679795037*tau))))) + (
+        0.10770512626332 + o[1]*(-0.32913623258954 - 0.50871062041158*o[20]))*
+        tau))))) + 1.0658070028513*Modelica.Math.log(del);
+
+      f.fdelta := (1.0658070028513 + del*
+                    (o[14] + del*(0.76986920373342 + o[31] + del*(-0.8399798909613+ o[1]*(
+        4.169939870838 + o[1]*(-6.056974507071 + o[16]*(-0.0246442911521889
+         - 1.42788107204769*o[17])))+del*(0.175936297894+o[1]*(-1.77905741714956
+         + o[1]*(3.62288282878932 + 2.82089800351868*o[19])) + del*   (del*(-0.133052405238576
+         + o[1]*(0.565564509990552 + 0.98617670687766*o[21]) + del*(-0.094523605689436*o[1] + del*
+        (-0.118674762819776*o[22] + del*(o[1]*(0.00521306582652756 + 0.0290780142333399*o[21])
+         + del*(0.00080964802996215 - 0.000494162889679965*del*o[22] -
+        0.0016557679795037*tau)))))+(0.5385256313166+o[1]*(-1.6456811629477-2.5435531020579*o[20]))*tau))))))/del;
+
+      f.fdeltadelta := (-1.0658070028513 + o[32]*
+                       (0.76986920373342 + o[31] + del*
+                                                   (-1.6799597819226 + o[39]
+         + del*(0.527808893682 + o[1]*(-5.33717225144868 + o[1]*(
+        10.868648486368 + 8.46269401055604*o[19])) + del*(del*
+        (-0.66526202619288 + o[1]*(2.82782254995276 + 4.9308835343883*o[21])
+         + del*                                                              (-0.567141634136616
+        *o[1] + del*
+        (-0.830723339738432*o[22] + del*
+                                      (o[1]*(0.0417045266122205 +
+        0.232624113866719*o[21]) + del*(0.00728683226965935 -
+        0.00494162889679965*del*o[22] - 0.0149019118155333*tau)))))          +(
+        2.1541025252664 + o[1]*(-6.5827246517908 - 10.1742124082316*o[20]))*
+        tau)))))                                                        /o[32];
+
+      f.fdeltadeltadelta :=
+                     (2.1316140057026 + o[40]*
+                                            (-1.6799597819226 + o[39] + del*
+                                                                        (
+        1.055617787364 + o[1]*                                                               (-10.6743445028974
+         + o[1]*(21.7372969727359 + 16.9253880211121*o[19]))
+                                         +del*(del*(-2.66104810477152+o[1]*(11.311290199811+19.7235341375532*o[21])
+     +del*(-2.83570817068308*o[1]+del*(-4.98434003843059*o[22]+del*(o[1]*(0.291931686285543+1.62836879706703*o[21])
+     +del*(0.0582946581572748-0.0444746600711968*del*o[22]-0.119215294524266*tau)))))+(6.4623075757992+o[1]*(-19.7481739553724
+         - 30.5226372246948*o[20]))       *tau))))/o[40];
+
+      f.ftau := 20.944396974307 +
+                         (-15.3735415757432 + o[3]*
+                                                 (18.3301634515678 + o[4]*
+                                                                        (-28.08078114862
+         + o[1]*(14.4640436358204 - 0.194503669468755*o[6]))))
+                                           *tau+del*(o[47]+del*(tau*(-1.70429417648412+o[2]*
+    (29.3833689251262 + (-21.3518320798755 + o[15]*(0.867251811341388 +
+        3.26518619032008*o[2]))*tau))
+    +del*((2.779959913892+o[1]*(-8.075966009428+o[16]*(-0.131436219478341-12.37496929108
+        *o[17])))     *tau+del*((-0.88952870857478+o[1]*(3.62288282878932+18.3358370228714*o[19]))*tau + del*
+       (0.10770512626332 + o[1]*(-0.98740869776862 - 13.2264761307011*o[20])
+         + del*                                                              ((
+        0.188521503330184 + 4.27343239646986*o[21])
+                      *tau+del*(-0.027006744482696*tau+del*(-0.385692979164272*o[48]+del*(del*(-0.00016557679795037
+         - 0.00116802137560719*del*o[48]) + (0.00115845907256168 +
+        0.0840031522296486*o[21])*tau)))))))));
+
+      f.ftautau := -15.3735415757432 + o[3]*
+                                   (109.980980709407 + o[4]*
+                                                          (-252.72703033758
+         + o[1]*(159.104479994024 - 4.2790807283126*o[6])))
+                                        +del*(-2.5308630955428+o[53]+del*(-1.70429417648412+o[2]*(
+        146.916844625631 + (-128.110992479253 + o[15]*(18.2122880381691 +
+        81.629654758002*o[2]))*tau) + del*(2.779959913892 + o[1]*(-24.227898028284
+         + o[16]*(-1.97154329217511 - 309.374232277*o[17])) + del*(-0.88952870857478
+         + o[1]*(10.868648486368 + 458.395925571786*o[19]) + del*   (del*(
+        0.188521503330184 + 106.835809911746*o[21] + del*
+                          (-0.027006744482696 + del*
+                                                  (-9.6423244791068*o[21] +
+        del*                                                                  (
+        0.00115845907256168 + 2.10007880574121*o[21] - 0.0292005343901797*o[
+        21]*o[32]))))                                   +(-1.97481739553724-330.661903267527*o[20])*tau)))));
+
+      f.ftautautau := o[2]*(549.904903547034 + o[4]*(-2021.81624270064 + o[1]*(1591.04479994024 -
+        89.8606952945646*o[6]))) + del*
+    (o[4]*(-138.292893680172 + (2416.62450077188 - 2619.67681940957*o[1])*o[7])
+         + del*                                                                 (o[4]*(
+        587.667378502524 + (-640.554962396265 + o[15]*(364.245760763383 +
+        1959.11171419205*o[2]))*tau) + del*((-48.455796056568 + o[16]*(-27.6016060904516
+         - 7424.98157464799*o[17]))*tau + del*                                  (del*(-1.97481739553724
+         - 7935.88567842065*o[20] + del*     (2564.05943788192*o[20] + o[32]*
+                                                                           (-231.415787498563
+        *o[20] + del*(50.4018913377892*o[20] - 0.700812825364314*o[20]*o[32]))))
+                                                                  +(21.7372969727359+
+        11001.5022137229*o[19])
+                      *tau))));
+
+      f.fdeltatau := o[47] + del*
+                        (o[62] + del*
+                                   ((8.339879741676 + o[1]*
+                                                         (-24.227898028284 +
+        o[16]*(-0.394308658435022 - 37.1249078732399*o[17])))
+                                            *tau+del*((-3.55811483429912+o[1]*(
+        14.4915313151573 + 73.3433480914857*o[19]))
+                                         *tau+del*(0.5385256313166+o[1]*(-4.9370434888431
+         - 66.1323806535054*o[20]) + del*    ((1.1311290199811 +
+        25.6405943788192*o[21])
+     *tau+del*(-0.189047211378872*tau+del*(-3.08554383331418*o[48]+del*(del*(-0.0016557679795037
+         - 0.0128482351316791*del*o[48]) + (0.0104261316530551 +
+        0.756028370066837*o[21])*tau))))))));
+
+      f.fdeltatautau := -2.5308630955428 + o[53] + del*
+                                           (-3.40858835296824 + o[2]*
+                                                                   (
+        293.833689251262 + (-256.221984958506 + o[15]*(36.4245760763383 +
+        163.259309516004*o[2]))*tau)                                  +del*(8.339879741676+o[1]*(-72.683694084852
+         + o[16]*(-5.91462987652534 - 928.122696830999*o[17])) + del*       (-3.55811483429912
+         + o[1]*(43.4745939454718 + 1833.58370228714*o[19]) + del*
+                                                  (del*(1.1311290199811 +
+        641.014859470479*o[21] + del*
+    (-0.189047211378872 + del*
+                            (-77.1385958328544*o[21] + del*
+                                                         (0.0104261316530551
+         + 18.9007092516709*o[21] - 0.321205878291977*o[21]*o[32]))))
+                                      +(-9.8740869776862-1653.30951633764*o[20])*tau))));
+
+      f.fdeltadeltatau := o[62] + del*
+                            ((16.679759483352 + o[1]*
+                                                   (-48.455796056568 + o[16]*
+                                                                           (-0.788617316870045
+         - 74.2498157464799*o[17])))
+                        *tau+del*((-10.6743445028974+o[1]*(43.4745939454718+
+        220.030044274457*o[19]))
+                       *tau+del*(2.1541025252664+o[1]*(-19.7481739553724-264.529522614022*o[20])
+     +del*((5.65564509990552+128.202971894096*o[21])*tau+del*(-1.13428326827323*tau+del*(-21.5988068331992
+        *o[48] + del*       (del*(-0.0149019118155333 - 0.128482351316791*del
+        *o[48]) + (0.0834090532244409 + 6.0482269605347*o[21])*tau)))))));
+    end f3L3;
+
+    function g5L3
+      "base function for region 5: g(p,T), including 3rd derivatives"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                      g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+    protected
+      Real tau "dimensionless temperature";
+      Real pi "dimensionless pressure";
+      Real[16] o "vector of auxiliary variables";
+    algorithm
+      assert(p > ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple,
+        "IF97 medium function g5 called with too low pressure\n" + "p = " +
+        String(p) + " Pa <= " + String(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
+         + " Pa (triple point pressure)");
+      assert(p <= ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT5,
+        "IF97 medium function g5: input pressure (= " + String(p) +
+        " Pa) is higher than 10 Mpa in region 5");
+      assert(T <= 2273.15,
+        "IF97 medium function g5: input temperature (= " + String(T) + " K) is higher than limit of 2273.15K in region 5");
+      g.p := p;
+      g.T := T;
+      g.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      pi := p/ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PSTAR5;
+      tau := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TSTAR5/T;
+      g.pi := pi;
+      g.tau := tau;
+      o[1] := tau*tau;
+      o[2] := -0.004594282089991*o[1];
+      o[3] := 0.0021774678714571 + o[2];
+      o[4] := o[3]*tau;
+      o[5] := o[1]*tau;
+      o[6] := o[1]*o[1];
+      o[7] := o[6]*o[6];
+      o[8] := o[7]*tau;
+      o[9] := -7.9449656719138e-6*o[8];
+      o[10] := pi*pi;
+      o[11] := o[10]*pi;
+      o[12] := -0.013782846269973*o[1];
+      o[13] := -0.027565692539946*tau;
+      o[14] := o[1]*o[6]*tau;
+      o[15] := o[1]*o[6];
+      o[16] := -0.0000715046910472242*o[7];
+      g.g := pi*(-0.00012563183589592 + o[4] + pi*(-3.9724828359569e-6*o[8] +
+        1.2919228289784e-7*o[5]*pi)) + (-0.024805148933466 + tau*(
+        0.36901534980333 + tau*(-3.1161318213925 + tau*(-13.179983674201 + (
+        6.8540841634434 - 0.32961626538917*tau)*tau + Modelica.Math.log(pi)))))
+        /o[5];
+      g.gpi := (1.0 + pi*(-0.00012563183589592 + o[4] + pi*(o[9] +
+        3.8757684869352e-7*o[5]*pi)))/pi;
+      g.gpipi := (-1.0 + o[10]*(o[9] + 7.7515369738704e-7*o[5]*pi))/o[10];
+      g.gpipipi := (2.0 + 7.7515369738704e-7*o[11]*o[5])/o[11];
+      g.gtau := pi*(0.0021774678714571 + o[12] + pi*(-0.0000357523455236121*o[7] +
+        3.8757684869352e-7*o[1]*pi)) + (0.074415446800398 + tau*(-0.73803069960666
+         + (3.1161318213925 + o[1]*(6.8540841634434 - 0.65923253077834*tau))*tau))/
+        o[6];
+      g.gtautau := (-0.297661787201592 + tau*(2.21409209881998 + (-6.232263642785
+         - 0.65923253077834*o[5])*tau))/(o[6]*tau) + pi*(o[13] + pi*(-0.000286018764188897
+        *o[14] + 7.7515369738704e-7*pi*tau));
+      g.gtautautau := pi*(-0.027565692539946 + (-0.00200213134932228*o[15] +
+        7.7515369738704e-7*pi)*pi) + (1.48830893600796 + tau*(-8.85636839527992 +
+        18.696790928355*tau))/o[15];
+      g.gpitau := 0.0021774678714571 + o[12] + pi*(o[16] + 1.16273054608056e-6*o[1]
+        *pi);
+      g.gpipitau := o[16] + 2.32546109216112e-6*o[1]*pi;
+      g.gpitautau := o[13] + pi*(-0.000572037528377794*o[14] + 2.32546109216112e-6*
+        pi*tau);
+    end g5L3;
+    annotation (Documentation(info="<HTML><h4>Package description</h4>
+          <p>Package BaseIF97/Basic computes the the fundamental functions for the 5 regions of the steam tables
+          as described in the standards document <a href=\"Documentation/IF97documentation/IF97.pdf\">IF97.pdf</a>. The code of these
+          functions has been generated using <b><i>Mathematica</i></b> and the add-on packages \"Format\" and \"Optimize\"
+          to generate highly efficient, expression-optimized C-code from a symbolic representation of the thermodynamic
+          functions. The C-code has than been transformed into Modelica code. An important feature of this optimization was to
+          simultaneously optimize the functions and the directional derivatives because they share many common subexpressions.</p>
+          <h4>Package contents</h4>
+          <p>
+          <ul>
+          <li>Function <b>g1</b> computes the dimensionless Gibbs function for region 1 and all derivatives up
+          to order 2 w.r.t pi and tau. Inputs: p and T.</li>
+          <li>Function <b>g2</b> computes the dimensionless Gibbs function  for region 2 and all derivatives up
+          to order 2 w.r.t pi and tau. Inputs: p and T.</li>
+          <li>Function <b>g2metastable</b> computes the dimensionless Gibbs function for metastable vapour
+          (adjacent to region 2 but 2-phase at equilibrium) and all derivatives up
+          to order 2 w.r.t pi and tau. Inputs: p and T.</li>
+          <li>Function <b>f3</b> computes the dimensionless Helmholtz function  for region 3 and all derivatives up
+          to order 2 w.r.t delta and tau. Inputs: d and T.</li>
+          <li>Function <b>g5</b>computes the dimensionless Gibbs function for region 5 and all derivatives up
+          to order 2 w.r.t pi and tau. Inputs: p and T.</li>
+          <li>Function <b>tph1</b> computes the inverse function T(p,h) in region 1.</li>
+          <li>Function <b>tph2</b> computes the inverse function T(p,h) in region 2.</li>
+          <li>Function <b>tps2a</b> computes the inverse function T(p,s) in region 2a.</li>
+          <li>Function <b>tps2b</b> computes the inverse function T(p,s) in region 2b.</li>
+          <li>Function <b>tps2c</b> computes the inverse function T(p,s) in region 2c.</li>
+          <li>Function <b>tps2</b> computes the inverse function T(p,s) in region 2.</li>
+          <li>Function <b>tsat</b> computes the saturation temperature as a function of pressure.</li>
+          <li>Function <b>dtsatofp</b> computes the derivative of the saturation temperature w.r.t. pressure as
+          a function of pressure.</li>
+          <li>Function <b>tsat_der</b> computes the Modelica derivative function of tsat.</li>
+          <li>Function <b>psat</b> computes the saturation pressure as a function of temperature.</li>
+          <li>Function <b>dptofT</b>  computes the derivative of the saturation pressure w.r.t. temperature as
+          a function of temperature.</li>
+          <li>Function <b>psat_der</b> computes the Modelica derivative function of psat.</li>
+          </ul>
+          </p>
+          <h4>Version Info and Revision history
+          </h4>
+          <ul>
+          <li>First implemented: <i>July, 2000</i>
+          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+          </li>
+          </ul>
+          <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+          </address>
+          <ul>
+          <li>Initial version: July 2000</li>
+          <li>Documentation added: December 2002</li>
+          </ul>
+          </HTML>
+          "),   Documentation(
+     info="<html>
+       <p>
+       &nbsp;Equation from:<br>
+       <div style=\"text-align: center;\">&nbsp;[1] The international Association
+       for the Properties of Water and Steam<br>
+       &nbsp;Vejle, Denmark<br>
+       &nbsp;August 2003<br>
+       &nbsp;Supplementary Release on Backward Equations for the Fucnctions
+       T(p,h), v(p,h) and T(p,s), <br>
+       &nbsp;v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
+       the Thermodynamic Properties of<br>
+       &nbsp;Water and Steam</div>
+       </p>
+       </html>"),
+      Icon(graphics={
+          Text(
+            extent={{-102,0},{24,-26}},
+            lineColor={242,148,0},
+            textString=
+                 "Thermo"),
+          Text(
+            extent={{-4,8},{68,-34}},
+            lineColor={46,170,220},
+            textString=
+                 "SysPro"),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
+                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
+                -50,6},{-62,2}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
+                8},{-42,22},{-42,30},{-44,38}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
+                12},{-26,12},{-28,12},{-26,20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,30},{-6,26}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,36},{-6,32}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,42},{-6,38}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,48},{-6,44}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,32},{-2,28}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,38},{-2,34}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,44},{-2,40}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,50},{-2,46}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
+                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
+                -50,6},{-62,2}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Line(
+            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+            color={46,170,220},
+            thickness=0.5),
+          Polygon(
+            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+          Line(
+            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+            color={0,0,255},
+            smooth=Smooth.None),
+          Line(
+            points={{80,80},{100,100}},
+            color={0,0,255},
+            smooth=Smooth.None)}));
+  end Basic;
+
+  package Transport "transport properties for water according to IAPWS/IF97"
+
+    function visc_dT "dynamic viscosity eta(d,T), industrial formulation"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.DynamicViscosity eta "dynamic viscosity";
+    protected
+      constant Real n0=1.0 "viscosity coefficient";
+      constant Real n1=0.978197 "viscosity coefficient";
+      constant Real n2=0.579829 "viscosity coefficient";
+      constant Real n3=-0.202354 "viscosity coefficient";
+      constant Real[42] nn=array(0.5132047, 0.3205656, 0.0, 0.0, -0.7782567,
+          0.1885447, 0.2151778, 0.7317883, 1.241044, 1.476783, 0.0, 0.0, -0.2818107,
+           -1.070786, -1.263184, 0.0, 0.0, 0.0, 0.1778064, 0.460504,
+          0.2340379, -0.4924179, 0.0, 0.0, -0.0417661, 0.0, 0.0, 0.1600435,
+          0.0, 0.0, 0.0, -0.01578386, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.003629481,
+           0.0, 0.0) "viscosity coefficients";
+      constant Units.SI.Density rhostar=317.763 "scaling density";
+      constant Units.SI.DynamicViscosity etastar=55.071e-6 "scaling viscosity";
+      constant Units.SI.Temperature tstar=647.226 "scaling temperature";
+      Integer i "auxiliary variable";
+      Integer j "auxiliary variable";
+      Real delta "dimensionless density";
+      Real deltam1 "dimensionless density";
+      Real tau "dimensionless temperature";
+      Real taum1 "dimensionless temperature";
+      Real Psi0 "auxiliary variable";
+      Real Psi1 "auxiliary variable";
+      Real tfun "auxiliary variable";
+      Real rhofun "auxiliary variable";
+      Real Tc=T - 273.15 "Celsius temperature for region check";
+      //      Integer region "region of IF97";
+    algorithm
+      delta := max(d,triple.dvtriple)/rhostar;
+    //   assert(d > triple.dvtriple,
+    //     "IF97 medium function visc_dTp for viscosity called with too low density\n" +
+    //     "d = " + String(d) + " <= " + String(triple.dvtriple) + " (triple point density)");
+      deltam1 := delta - 1.0;
+      tau := tstar/T;
+      taum1 := tau - 1.0;
+      Psi0 := 1/(n0 + (n1 + (n2 + n3*tau)*tau)*tau)/(tau^0.5);
+      Psi1 := 0.0;
+      tfun := 1.0;
+      for i in 1:6 loop
+        if (i <> 1) then
+          tfun := tfun*taum1;
+        end if;
+        rhofun := 1.;
+        for j in 0:6 loop
+          if (j <> 0) then
+            rhofun := rhofun*deltam1;
+          end if;
+          Psi1 := Psi1 + nn[i + j*6]*tfun*rhofun;
+        end for;
+      end for;
+      eta := etastar*Psi0*Modelica.Math.exp(delta*Psi1);
+      annotation(smoothOrder=5);
+    end visc_dT;
+
+    function cond_dTp
+      "Thermal conductivity lam(d,T,p) (industrial use version) only in one-phase region"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature (K)";
+      input Units.SI.Pressure p "pressure";
+      input Integer phase=0 "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Boolean industrialMethod=true
+        "if true, the industrial method is used, otherwise the scientific one";
+      output Units.SI.ThermalConductivity lambda "thermal conductivity";
+    protected
+      Integer region(min=1, max=5) "IF97 region, valid values:1,2,3, and 5";
+      constant Real n0=1.0 "conductivity coefficient";
+      constant Real n1=6.978267 "conductivity coefficient";
+      constant Real n2=2.599096 "conductivity coefficient";
+      constant Real n3=-0.998254 "conductivity coefficient";
+      constant Real[30] nn=array(1.3293046, 1.7018363, 5.2246158, 8.7127675,
+          -1.8525999, -0.40452437, -2.2156845, -10.124111, -9.5000611,
+          0.9340469, 0.2440949, 1.6511057, 4.9874687, 4.3786606, 0.0,
+          0.018660751, -0.76736002, -0.27297694, -0.91783782, 0.0, -0.12961068,
+           0.37283344, -0.43083393, 0.0, 0.0, 0.044809953, -0.1120316,
+          0.13333849, 0.0, 0.0) "conductivity coefficient";
+      constant Units.SI.ThermalConductivity lamstar=0.4945
+        "scaling conductivity";
+      constant Units.SI.Density rhostar=317.763 "scaling density";
+      constant Units.SI.Temperature tstar=647.226 "scaling temperature";
+      constant Units.SI.Pressure pstar=22.115e6 "scaling pressure";
+      constant Units.SI.DynamicViscosity etastar=55.071e-6 "scaling viscosity";
+      Integer i "auxiliary variable";
+      Integer j "auxiliary variable";
+      Real delta "dimensionless density";
+      Real tau "dimensionless temperature";
+      Real deltam1 "dimensionless density";
+      Real taum1 "dimensionless temperature";
+      Real Lam0 "part of thermal conductivity";
+      Real Lam1 "part of thermal conductivity";
+      Real Lam2 "part of thermal conductivity";
+      Real tfun "auxiliary variable";
+      Real rhofun "auxiliary variable";
+      Real dpitau "auxiliary variable";
+      Real ddelpi "auxiliary variable";
+      Real d2 "auxiliary variable";
+      ThermoSysPro.Properties.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Real Tc=T - 273.15 "Celsius temperature for region check";
+      Real Chi "symmetrized compressibility";
+      // slightly different variables for industrial use
+      constant Units.SI.Density rhostar2=317.7 "Reference density";
+      constant Units.SI.Temperature Tstar2=647.25 "Reference temperature";
+      constant Units.SI.ThermalConductivity lambdastar=1
+        "Reference thermal conductivity";
+      parameter Real TREL=T/Tstar2 "Relative temperature";
+      parameter Real rhoREL=d/rhostar2 "Relative density";
+      Real lambdaREL "Relative thermal conductivity";
+      Real deltaTREL "Relative temperature increment";
+      constant Real[:] C={0.642857,-4.11717,-6.17937,0.00308976,0.0822994,
+          10.0932};
+      constant Real[:] dpar={0.0701309,0.0118520,0.00169937,-1.0200};
+      constant Real[:] b={-0.397070,0.400302,1.060000};
+      constant Real[:] B={-0.171587,2.392190};
+      constant Real[:] a={0.0102811,0.0299621,0.0156146,-0.00422464};
+      Real Q;
+      Real S;
+      Real lambdaREL2
+        "function, part of the interpolating equation of the thermal conductivity";
+      Real lambdaREL1
+        "function, part of the interpolating equation of the thermal conductivity";
+      Real lambdaREL0
+        "function, part of the interpolating equation of the thermal conductivity";
+    algorithm
+      // region := BaseIF97.Regions.region_dT(d,T,phase);
+      // simplified region check, assuming that calling arguments are legal
+      //  assert(phase <> 2,
+      //   "thermalConductivity can not be called with 2-phase inputs!");
+      assert(d > triple.dvtriple,
+        "IF97 medium function cond_dTp called with too low density\n" +
+        "d = " + String(d) + " <= " + String(triple.dvtriple) + " (triple point density)");
+      assert((p <= 100e6 and (Tc >= 0.0 and Tc <= 500)) or
+      (p <= 70e6 and (Tc > 500.0 and Tc <= 650)) or
+      (p <= 40e6 and (Tc > 650.0 and Tc <= 800)),
+      "IF97 medium function cond_dTp: thermal conductivity computed outside the range\n" +
+      "of validity of the IF97 formulation: p = " + String(p) + " Pa, Tc = " + String(Tc) + " K");
+      if industrialMethod == true then
+        deltaTREL := abs(TREL - 1) + C[4];
+        Q := 2 + C[5]/deltaTREL^(3/5);
+        if TREL >= 1 then
+          S := 1/deltaTREL;
+        else
+          S := C[6]/deltaTREL^(3/5);
+        end if;
+        lambdaREL2 := (dpar[1]/TREL^10 + dpar[2])*rhoREL^(9/5)*Modelica.Math.exp(C[1]*(1 - rhoREL^(14
+          /5))) + dpar[3]*S*rhoREL^Q*Modelica.Math.exp((Q/(1 + Q))*(1 -
+          rhoREL^(1 + Q))) + dpar[4]*Modelica.Math.exp(C[2]*TREL^(3/2) + C[3]
+          /rhoREL^5);
+        lambdaREL1 := b[1] + b[2]*rhoREL + b[3]*Modelica.Math.exp(B[1]*(
+          rhoREL + B[2])^2);
+        lambdaREL0 := TREL^(1/2)*sum(a[i]*TREL^(i - 1) for i in 1:4);
+        lambdaREL := lambdaREL0 + lambdaREL1 + lambdaREL2;
+        lambda := lambdaREL*lambdastar;
+      else
+        if p < data.PLIMIT4A then
+          //regions are 1 or 2,
+          if d > data.DCRIT then
+     region := 1;
+          else
+     region := 2;
+          end if;
+        else
+          //region is 3, or illegal
+          assert(false,
+            "the scientific method works only for temperatures up to 623.15 K");
+        end if;
+        tau := tstar/T;
+        delta := d/rhostar;
+        deltam1 := delta - 1.0;
+        taum1 := tau - 1.0;
+        Lam0 := 1/(n0 + (n1 + (n2 + n3*tau)*tau)*tau)/(tau^0.5);
+        Lam1 := 0.0;
+        tfun := 1.0;
+        for
+     i in 1:5 loop
+          if (i <> 1) then
+     tfun := tfun*taum1;
+          end if;
+          rhofun := 1.0;
+          for
+       j in 0:5 loop
+     if (j <> 0) then
+              rhofun := rhofun*deltam1;
+     end if;
+     Lam1 := Lam1 + nn[i + j*5]*tfun*rhofun;
+          end for;
+        end for;
+        if (region == 1) then
+          g := Basic.g1(p, T);
+          // dp/dT @ cont d = -g.p/g.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
+          dpitau := -tstar/pstar*(data.PSTAR1*(g.gpi - data.TSTAR1/T*g.gtaupi)
+            /g.gpipi/T);
+          ddelpi := -pstar/rhostar*data.RH2O/data.PSTAR1/data.PSTAR1*T*d*d*g.
+            gpipi;
+          Chi := delta*ddelpi;
+        elseif (region == 2) then
+          g := Basic.g2(p, T);
+          dpitau := -tstar/pstar*(data.PSTAR2*(g.gpi - data.TSTAR2/T*g.gtaupi)
+            /g.gpipi/T);
+          ddelpi := -pstar/rhostar*data.RH2O/data.PSTAR2/data.PSTAR2*T*d*d*g.
+            gpipi;
+          Chi := delta*ddelpi;
+          //         elseif (region == 3) then
+          //           f := Basic.f3(T, d);
+          //            dpitau := tstar/pstar*(f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau));
+          //           ddelpi := pstar*d*d/(rhostar*p*p)/(f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta));
+          //    Chi := delta*ddelpi;
+        else
+          assert(false,
+            "thermal conductivity can only be called in the one-phase regions below 623.15 K\n" +
+            "(p = " + String(p) + " Pa, T = " + String(T) + " K, region = " + String(region) + ")");
+        end if;
+        taum1 := 1/tau - 1;
+        d2 := deltam1*deltam1;
+        Lam2 := 0.0013848*etastar/visc_dT(d, T)/(tau*tau*delta*delta)*
+          dpitau*dpitau*max(Chi, Modelica.Constants.small)^0.4678*(delta)^0.5
+          *Modelica.Math.exp(-18.66*taum1*taum1 - d2*d2);
+        lambda := lamstar*(Lam0*Modelica.Math.exp(delta*Lam1) + Lam2);
+      end if;
+      annotation(smoothOrder=5);
+    end cond_dTp;
+
+    function surfaceTension
+      "surface tension in region 4 between steam and water"
+      extends Modelica.Icons.Function;
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.SurfaceTension sigma "surface tension in SI units";
+    protected
+      Real Theta "dimensionless temperature";
+    algorithm
+      Theta := min(1.0,T/data.TCRIT);
+      sigma := 235.8e-3*(1 - Theta)^1.256*(1 - 0.625*(1 - Theta));
+      annotation(smoothOrder=5);
+    end surfaceTension;
+
+    function cond_industrial_dT
+      "Thermal conductivity lam(d,T) (industrial use version) only in one-phase region"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.ThermalConductivity lambda "thermal conductivity";
+    protected
+      constant Units.SI.Density rhostar2=317.7 "Reference density";
+      constant Units.SI.Temperature Tstar2=647.25 "Reference temperature";
+      constant Units.SI.ThermalConductivity lambdastar=1
+        "Reference thermal conductivity";
+      constant Real[:] C={0.642857,-4.11717,-6.17937,0.00308976,0.0822994,
+          10.0932};
+      constant Real[:] dpar={0.0701309,0.0118520,0.00169937,-1.0200};
+      constant Real[:] b={-0.397070,0.400302,1.060000};
+      constant Real[:] B={-0.171587,2.392190};
+      constant Real[:] a={0.0102811,0.0299621,0.0156146,-0.00422464};
+      Integer region(min=1, max=5) "IF97 region, valid values:1,2,3, and 5";
+      Real TREL "Relative temperature";
+      Real rhoREL "Relative density";
+      Real lambdaREL "Relative thermal conductivity";
+      Real deltaTREL "Relative temperature increment";
+      Real Q;
+      Real S;
+      Real lambdaREL2
+        "function, part of the interpolating equation of the thermal conductivity";
+      Real lambdaREL1
+        "function, part of the interpolating equation of the thermal conductivity";
+      Real lambdaREL0
+        "function, part of the interpolating equation of the thermal conductivity";
+    algorithm
+      assert(d > triple.dvtriple,
+        "IF97 medium function cond_dTp called with too low density\n" +
+        "d = " + String(d) + " <= " + String(triple.dvtriple) + " (triple point density)");
+       TREL := T/Tstar2;
+       rhoREL := d/rhostar2;
+       deltaTREL := abs(TREL - 1) + C[4];
+       Q := 2 + C[5]/deltaTREL^(3/5);
+       S := if TREL >= 1 then  1/deltaTREL else C[6]/deltaTREL^(3/5);
+        lambdaREL2 := (dpar[1]/TREL^10 + dpar[2])*rhoREL^(9/5)*Modelica.Math.exp(C[1]*(1 - rhoREL^(14
+          /5))) + dpar[3]*S*rhoREL^Q*Modelica.Math.exp((Q/(1 + Q))*(1 -
+          rhoREL^(1 + Q))) + dpar[4]*Modelica.Math.exp(C[2]*TREL^(3/2) + C[3]
+          /rhoREL^5);
+        lambdaREL1 := b[1] + b[2]*rhoREL + b[3]*Modelica.Math.exp(B[1]*(
+          rhoREL + B[2])^2);
+        lambdaREL0 := TREL^(1/2)*sum(a[i]*TREL^(i - 1) for i in 1:4);
+        lambdaREL := lambdaREL0 + lambdaREL1 + lambdaREL2;
+        lambda := lambdaREL*lambdastar;
+      annotation(smoothOrder=5);
+    end cond_industrial_dT;
+    annotation (Documentation(info="<HTML><h4>Package description</h4>
+          <p></p>
+          <h4>Package contents</h4>
+          <p>
+          <ul>
+          <li>Function <b>visc_dTp</b> implements a function to compute the industrial formulation of the
+          dynamic viscosity of water as a function of density and temperature.
+          The details are described in the document <a href=\"IF97documentation/visc.pdf\">visc.pdf</a>.</li>
+          <li>Function <b>cond_dTp</b> implements a function to compute  the industrial formulation of the thermal conductivity of water as
+          a function of density, temperature and pressure. <b>Important note</b>: Obviously only two of the three
+          inputs are really needed, but using three inputs speeds up the computation and the three variables are known in most models anyways.
+          The inputs d,T and p have to be consistent.
+          The details are described in the document <a href=\"IF97documentation/surf.pdf\">surf.pdf</a>.</li>
+          <li>Function <b>surfaceTension</b> implements a function to compute the surface tension between vapour
+          and liquid water as a function of temperature.
+          The details are described in the document <a href=\"IF97documentation/thcond.pdf\">thcond.pdf</a>.</li>
+          </ul>
+          </p>
+          <h4>Version Info and Revision history
+          </h4>
+          <ul>
+          <li>First implemented: <i>October, 2002</i>
+          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+          </li>
+          </ul>
+          <address>Authors: Hubertus Tummescheit and Jonas Eborn<br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+          </address>
+          <ul>
+          <li>Initial version: October 2002</li>
+          </ul>
+          </HTML>
+          "), Icon(graphics={
+          Text(
+            extent={{-102,0},{24,-26}},
+            lineColor={242,148,0},
+            textString=
+                 "Thermo"),
+          Text(
+            extent={{-4,8},{68,-34}},
+            lineColor={46,170,220},
+            textString=
+                 "SysPro"),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
+                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
+                -50,6},{-62,2}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
+                8},{-42,22},{-42,30},{-44,38}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
+                12},{-26,12},{-28,12},{-26,20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,30},{-6,26}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,36},{-6,32}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,42},{-6,38}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,48},{-6,44}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,32},{-2,28}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,38},{-2,34}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,44},{-2,40}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,50},{-2,46}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
+                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
+                -50,6},{-62,2}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Line(
+            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+            color={46,170,220},
+            thickness=0.5),
+          Polygon(
+            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+          Line(
+            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+            color={0,0,255},
+            smooth=Smooth.None),
+          Line(
+            points={{80,80},{100,100}},
+            color={0,0,255},
+            smooth=Smooth.None)}));
+  end Transport;
+
+  package Isentropic
+    "functions for calculating the isentropic enthalpy from pressure p and specific entropy s"
+
+    function hofpT1
+      "intermediate function for isentropic specific enthalpy in region 1"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real[13] o "vector of auxiliary variables";
+      Real pi1 "dimensionless pressure";
+      Real tau "dimensionless temperature";
+      Real tau1 "dimensionless temperature";
+    algorithm
+      tau := data.TSTAR1/T;
+      pi1 := 7.1 - p/data.PSTAR1;
+      assert(p > triple.ptriple,
+        "IF97 medium function hofpT1  called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      tau1 := -1.222 + tau;
+      o[1] := tau1*tau1;
+      o[2] := o[1]*tau1;
+      o[3] := o[1]*o[1];
+      o[4] := o[3]*o[3];
+      o[5] := o[1]*o[4];
+      o[6] := o[1]*o[3];
+      o[7] := o[3]*tau1;
+      o[8] := o[3]*o[4];
+      o[9] := pi1*pi1;
+      o[10] := o[9]*o[9];
+      o[11] := o[10]*o[10];
+      o[12] := o[4]*o[4];
+      o[13] := o[12]*o[12];
+
+      h := data.RH2O*T*tau*(pi1*((-0.00254871721114236 + o[1]*(
+        0.00424944110961118 + (0.018990068218419 + (-0.021841717175414 -
+        0.00015851507390979*o[1])*o[1])*o[6]))/o[5] + pi1*((
+        0.00141552963219801 + o[3]*(0.000047661393906987 + o[1]*(-0.0000132425535992538
+         - 1.2358149370591e-14*o[1]*o[3]*o[4])))/o[3] + pi1*((
+        0.000126718579380216 - 5.11230768720618e-9*o[5])/o[7] + pi1*((
+        0.000011212640954 + o[2]*(1.30342445791202e-6 - 1.4341729937924e-12*o[
+        8]))/o[6] + pi1*(o[9]*pi1*((1.40077319158051e-8 + 1.04549227383804e-9
+        *o[7])/o[8] + o[10]*o[11]*pi1*(1.9941018075704e-17/(o[1]*o[12]*o[3]*o[
+        4]) + o[9]*(-4.48827542684151e-19/o[13] + o[10]*o[9]*(pi1*(
+        4.65957282962769e-22/(o[13]*o[4]) + pi1*((3.83502057899078e-24*pi1)/(
+        o[1]*o[13]*o[4]) - 7.2912378325616e-23/(o[13]*o[4]*tau1))) -
+        1.00075970318621e-21/(o[1]*o[13]*o[3]*tau1))))) + 3.24135974880936e-6
+        /(o[4]*tau1)))))) + (-0.29265942426334 + tau1*(0.84548187169114 + o[1]
+        *(3.3855169168385 + tau1*(-1.91583926775744 + tau1*(0.47316115539684
+         + (-0.066465668798004 + 0.0040607314991784*tau1)*tau1)))))/o[2]);
+    end hofpT1;
+
+    function handsofpT1
+      "special function for specific enthalpy and specific entropy in region 1"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Real[28] o "vector of auxiliary variables";
+      Real pi1 "dimensionless pressure";
+      Real tau "dimensionless temperature";
+      Real tau1 "dimensionless temperature";
+      Real g "dimensionless Gibbs energy";
+      Real gtau "derivative of  dimensionless Gibbs energy w.r.t. tau";
+    algorithm
+      assert(p > triple.ptriple,
+        "IF97 medium function handsofpT1 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      tau := data.TSTAR1/T;
+      pi1 := 7.1 - p/data.PSTAR1;
+      tau1 := -1.222 + 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] := pi1*pi1;
+      o[15] := o[14]*pi1;
+      o[16] := o[14]*o[14];
+      o[17] := o[16]*o[16];
+      o[18] := o[16]*o[17]*pi1;
+      o[19] := o[14]*o[16];
+      o[20] := o[3]*o[3];
+      o[21] := o[20]*o[20];
+      o[22] := o[21]*o[3]*tau1;
+      o[23] := 1/o[22];
+      o[24] := o[21]*o[3];
+      o[25] := 1/o[24];
+      o[26] := o[1]*o[2]*o[21]*tau1;
+      o[27] := 1/o[26];
+      o[28] := o[1]*o[3];
+
+      g := pi1*(pi1*(pi1*(o[10]*(-0.000031679644845054 + o[2]*(-2.8270797985312e-6
+         - 8.5205128120103e-10*o[6])) + pi1*(o[12]*(-2.2425281908e-6 + (-6.5171222895601e-7
+         - 1.4341729937924e-13*o[13])*o[7]) + pi1*(-4.0516996860117e-7/o[3]
+         + o[15]*(o[18]*(o[14]*(o[19]*(2.6335781662795e-23/(o[1]*o[2]*o[21])
+         + pi1*(-1.1947622640071e-23*o[27] + pi1*(1.8228094581404e-24*o[25]
+         - 9.3537087292458e-26*o[23]*pi1))) + 1.4478307828521e-20/(o[1]*o[2]*
+        o[20]*o[3]*tau1)) - 6.8762131295531e-19/(o[2]*o[20]*o[3]*tau1)) + (-1.2734301741641e-9
+         - 1.7424871230634e-10*o[11])/(o[1]*o[3]*tau1))))) + o[8]*(-0.00047184321073267
+         + o[7]*(-0.00030001780793026 + (0.000047661393906987 + o[1]*(-4.4141845330846e-6
+         - 7.2694996297594e-16*o[9]))*tau1))) + o[5]*(0.00028319080123804 + o[
+        1]*(-0.00060706301565874 + o[6]*(-0.018990068218419 + tau1*(-0.032529748770505
+         + (-0.021841717175414 - 0.00005283835796993*o[1])*tau1))))) + (
+        0.14632971213167 + tau1*(-0.84548187169114 + tau1*(-3.756360367204 +
+        tau1*(3.3855169168385 + tau1*(-0.95791963387872 + tau1*(
+        0.15772038513228 + (-0.016616417199501 + 0.00081214629983568*tau1)*
+        tau1))))))/o[1];
+
+      gtau := pi1*((-0.00254871721114236 + o[1]*(0.00424944110961118 + (
+        0.018990068218419 + (-0.021841717175414 - 0.00015851507390979*o[1])*o[
+        1])*o[6]))/o[28] + pi1*(o[10]*(0.00141552963219801 + o[2]*(
+        0.000047661393906987 + o[1]*(-0.0000132425535992538 -
+        1.2358149370591e-14*o[9]))) + pi1*(o[12]*(0.000126718579380216 -
+        5.11230768720618e-9*o[28]) + pi1*((0.000011212640954 + (
+        1.30342445791202e-6 - 1.4341729937924e-12*o[13])*o[7])/o[6] + pi1*(
+        3.24135974880936e-6*o[5] + o[15]*((1.40077319158051e-8 +
+        1.04549227383804e-9*o[11])/o[13] + o[18]*(1.9941018075704e-17/(o[1]*o[
+        2]*o[20]*o[3]) + o[14]*(-4.48827542684151e-19/o[21] + o[19]*(-1.00075970318621e-21
+        *o[27] + pi1*(4.65957282962769e-22*o[25] + pi1*(-7.2912378325616e-23*
+        o[23] + (3.83502057899078e-24*pi1)/(o[1]*o[21]*o[3])))))))))))) + o[8]
+        *(-0.29265942426334 + tau1*(0.84548187169114 + o[1]*(3.3855169168385
+         + tau1*(-1.91583926775744 + tau1*(0.47316115539684 + (-0.066465668798004
+         + 0.0040607314991784*tau1)*tau1)))));
+
+      h := data.RH2O*T*tau*gtau;
+      s := data.RH2O*(tau*gtau - g);
+    end handsofpT1;
+
+    function hofps1 "function for isentropic specific enthalpy in region 1"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Units.SI.Temperature T "temperature (K)";
+    algorithm
+      T := Basic.tps1(p, s);
+      h := hofpT1(p, T);
+    end hofps1;
+
+    // for isentropic specific enthalpy get T(p,s), then use this
+    function hofpT2
+      "intermediate function for isentropic specific enthalpy in region 2"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real[16] o "vector of auxiliary variables";
+      Real pi "dimensionless pressure";
+      Real tau "dimensionless temperature";
+      Real tau2 "dimensionless temperature";
+    algorithm
+      assert(p > triple.ptriple,
+        "IF97 medium function hofpT2 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      pi := p/data.PSTAR2;
+      tau := data.TSTAR2/T;
+      tau2 := -0.5 + tau;
+      o[1] := tau*tau;
+      o[2] := o[1]*o[1];
+      o[3] := tau2*tau2;
+      o[4] := o[3]*tau2;
+      o[5] := o[3]*o[3];
+      o[6] := o[5]*o[5];
+      o[7] := o[6]*o[6];
+      o[8] := o[5]*o[6]*o[7]*tau2;
+      o[9] := o[3]*o[5];
+      o[10] := o[5]*o[6]*tau2;
+      o[11] := o[3]*o[7]*tau2;
+      o[12] := o[3]*o[5]*o[6];
+      o[13] := o[5]*o[6]*o[7];
+      o[14] := pi*pi;
+      o[15] := o[14]*o[14];
+      o[16] := o[7]*o[7];
+
+      h := data.RH2O*T*tau*((0.0280439559151 + tau*(-0.2858109552582 + tau*(
+        1.2213149471784 + tau*(-2.848163942888 + tau*(4.38395111945 + o[1]*(
+        10.08665568018 + (-0.5681726521544 + 0.06380539059921*tau)*tau))))))/
+        (o[1]*o[2]) + pi*(-0.017834862292358 + tau2*(-0.09199202739273 + (-0.172743777250296
+         - 0.30195167236758*o[4])*tau2) + pi*(-0.000033032641670203 + (-0.0003789797503263
+         + o[3]*(-0.015757110897342 + o[4]*(-0.306581069554011 -
+        0.000960283724907132*o[8])))*tau2 + pi*(4.3870667284435e-7 + o[3]*(-0.00009683303171571
+         + o[4]*(-0.0090203547252888 - 1.42338887469272*o[8])) + pi*(-7.8847309559367e-10
+         + (2.558143570457e-8 + 1.44676118155521e-6*tau2)*tau2 + pi*(
+        0.0000160454534363627*o[9] + pi*((-5.0144299353183e-11 + o[10]*(-0.033874355714168
+         - 836.35096769364*o[11]))*o[3] + pi*((-0.0000138839897890111 -
+        0.973671060893475*o[12])*o[3]*o[6] + pi*((9.0049690883672e-11 -
+        296.320827232793*o[13])*o[3]*o[5]*tau2 + pi*(2.57526266427144e-7*o[5]
+        *o[6] + pi*(o[4]*(4.1627860840696e-19 + (-1.0234747095929e-12 -
+        1.40254511313154e-8*o[5])*o[9]) + o[14]*o[15]*(o[13]*(-2.34560435076256e-9
+         + 5.3465159397045*o[5]*o[7]*tau2) + o[14]*(-19.1874828272775*o[16]*o[
+        6]*o[7] + o[14]*(o[11]*(1.78371690710842e-23 + (1.07202609066812e-11
+         - 0.000201611844951398*o[10])*o[3]*o[5]*o[6]*tau2) + pi*(-1.24017662339842e-24
+        *o[5]*o[7] + pi*(0.000200482822351322*o[16]*o[5]*o[7] + pi*(-4.97975748452559e-14
+        *o[16]*o[3]*o[5] + o[6]*o[7]*(1.90027787547159e-27 + o[12]*(
+        2.21658861403112e-15 - 0.0000547344301999018*o[3]*o[7]))*pi*tau2)))))))))))))))));
+    end hofpT2;
+
+    function handsofpT2
+      "function for isentropic specific enthalpy and specific entropy in region 2"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    protected
+      Real[22] o "vector of auxiliary variables";
+      Real pi "dimensionless pressure";
+      Real tau "dimensionless temperature";
+      Real tau2 "dimensionless temperature";
+      Real g "dimensionless Gibbs energy";
+      Real gtau "derivative of  dimensionless Gibbs energy w.r.t. tau";
+    algorithm
+      assert(p > triple.ptriple,
+        "IF97 medium function handsofpT2 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      tau := data.TSTAR2/T;
+      pi := p/data.PSTAR2;
+      tau2 := tau - 0.5;
+      o[1] := tau2*tau2;
+      o[2] := o[1]*tau2;
+      o[3] := o[1]*o[1];
+      o[4] := o[3]*o[3];
+      o[5] := o[4]*o[4];
+      o[6] := o[3]*o[4]*o[5]*tau2;
+      o[7] := o[1]*o[3]*tau2;
+      o[8] := o[3]*o[4]*tau2;
+      o[9] := o[1]*o[5]*tau2;
+      o[10] := o[1]*o[3]*o[4];
+      o[11] := o[3]*o[4]*o[5];
+      o[12] := o[1]*o[3];
+      o[13] := pi*pi;
+      o[14] := o[13]*o[13];
+      o[15] := o[13]*o[14];
+      o[16] := o[3]*o[5]*tau2;
+      o[17] := o[5]*o[5];
+      o[18] := o[3]*o[5];
+      o[19] := o[1]*o[3]*o[4]*tau2;
+      o[20] := o[1]*o[5];
+      o[21] := tau*tau;
+      o[22] := o[21]*o[21];
+
+      g := pi*(-0.0017731742473213 + tau2*(-0.017834862292358 + tau2*(-0.045996013696365
+         + (-0.057581259083432 - 0.05032527872793*o[2])*tau2)) + pi*(tau2*(-0.000033032641670203
+         + (-0.00018948987516315 + o[1]*(-0.0039392777243355 + o[2]*(-0.043797295650573
+         - 0.000026674547914087*o[6])))*tau2) + pi*(2.0481737692309e-8 + (
+        4.3870667284435e-7 + o[1]*(-0.00003227767723857 + o[2]*(-0.0015033924542148
+         - 0.040668253562649*o[6])))*tau2 + pi*(tau2*(-7.8847309559367e-10 +
+        (1.2790717852285e-8 + 4.8225372718507e-7*tau2)*tau2) + pi*(
+        2.2922076337661e-6*o[7] + pi*(o[2]*(-1.6714766451061e-11 + o[8]*(-0.0021171472321355
+         - 23.895741934104*o[9])) + pi*(-5.905956432427e-18 + o[1]*(-1.2621808899101e-6
+         - 0.038946842435739*o[10])*o[4]*tau2 + pi*((1.1256211360459e-11 -
+        8.2311340897998*o[11])*o[4] + pi*(1.9809712802088e-8*o[8] + pi*((
+        1.0406965210174e-19 + o[12]*(-1.0234747095929e-13 -
+        1.0018179379511e-9*o[3]))*o[3] + o[15]*((-8.0882908646985e-11 +
+        0.10693031879409*o[16])*o[6] + o[13]*(-0.33662250574171*o[17]*o[4]*o[
+        5]*tau2 + o[13]*(o[18]*(8.9185845355421e-25 + o[19]*(
+        3.0629316876232e-13 - 4.2002467698208e-6*o[8])) + pi*(-5.9056029685639e-26
+        *o[16] + pi*(3.7826947613457e-6*o[17]*o[3]*o[5]*tau2 + pi*(o[1]*(
+        7.3087610595061e-29 + o[10]*(5.5414715350778e-17 - 9.436970724121e-7*
+        o[20]))*o[4]*o[5]*pi - 1.2768608934681e-15*o[1]*o[17]*o[3]*tau2))))))))))))))))
+         + (-0.00560879118302 + tau*(0.07145273881455 + tau*(-0.4071049823928
+         + tau*(1.424081971444 + tau*(-4.38395111945 + tau*(-9.692768600217
+         + tau*(10.08665568018 + (-0.2840863260772 + 0.02126846353307*tau)*
+        tau) + Modelica.Math.log(pi)))))))/(o[22]*tau);
+
+      gtau := (0.0280439559151 + tau*(-0.2858109552582 + tau*(1.2213149471784
+         + tau*(-2.848163942888 + tau*(4.38395111945 + o[21]*(10.08665568018
+         + (-0.5681726521544 + 0.06380539059921*tau)*tau))))))/(o[21]*o[22])
+         + pi*(-0.017834862292358 + tau2*(-0.09199202739273 + (-0.172743777250296
+         - 0.30195167236758*o[2])*tau2) + pi*(-0.000033032641670203 + (-0.0003789797503263
+         + o[1]*(-0.015757110897342 + o[2]*(-0.306581069554011 -
+        0.000960283724907132*o[6])))*tau2 + pi*(4.3870667284435e-7 + o[1]*(-0.00009683303171571
+         + o[2]*(-0.0090203547252888 - 1.42338887469272*o[6])) + pi*(-7.8847309559367e-10
+         + (2.558143570457e-8 + 1.44676118155521e-6*tau2)*tau2 + pi*(
+        0.0000160454534363627*o[12] + pi*(o[1]*(-5.0144299353183e-11 + o[8]*(
+        -0.033874355714168 - 836.35096769364*o[9])) + pi*(o[1]*(-0.0000138839897890111
+         - 0.973671060893475*o[10])*o[4] + pi*((9.0049690883672e-11 -
+        296.320827232793*o[11])*o[7] + pi*(2.57526266427144e-7*o[3]*o[4] + pi
+        *(o[2]*(4.1627860840696e-19 + o[12]*(-1.0234747095929e-12 -
+        1.40254511313154e-8*o[3])) + o[15]*(o[11]*(-2.34560435076256e-9 +
+        5.3465159397045*o[16]) + o[13]*(-19.1874828272775*o[17]*o[4]*o[5] + o[
+        13]*((1.78371690710842e-23 + o[19]*(1.07202609066812e-11 -
+        0.000201611844951398*o[8]))*o[9] + pi*(-1.24017662339842e-24*o[18] +
+        pi*(0.000200482822351322*o[17]*o[3]*o[5] + pi*(-4.97975748452559e-14*
+        o[1]*o[17]*o[3] + (1.90027787547159e-27 + o[10]*(2.21658861403112e-15
+         - 0.0000547344301999018*o[20]))*o[4]*o[5]*pi*tau2))))))))))))))));
+
+      h := data.RH2O*T*tau*gtau;
+      s := data.RH2O*(tau*gtau - g);
+    end handsofpT2;
+
+    function hofps2 "function for isentropic specific enthalpy in region 2"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Units.SI.Temperature T "temperature (K)";
+    algorithm
+      T := Basic.tps2(p, s);
+      h := hofpT2(p, T);
+    end hofps2;
+    // region 3 extra functions
+
+    // for isentropic specific enthalpy get (d,T) = f(p,s), then use this
+    // which needs a bloody iteration, ...
+    // this is one thing that needs to be done somehow, ...
+
+    function hofdT3 "function for isentropic specific enthalpy in region 3"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real delta;
+      Real tau "dimensionless temperature";
+      Real[13] o "vector of auxiliary variables";
+      Real ftau "derivative of  dimensionless Helmholtz energy w.r.t. tau";
+      Real fdelta "derivative of  dimensionless Helmholtz energy w.r.t. delta";
+    algorithm
+      tau := data.TCRIT/T;
+      delta := d/data.DCRIT;
+      o[1] := tau*tau;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      o[4] := o[3]*tau;
+      o[5] := o[1]*o[2]*o[3]*tau;
+      o[6] := o[2]*o[3];
+      o[7] := o[1]*o[3];
+      o[8] := o[3]*o[3];
+      o[9] := o[1]*o[2]*o[8];
+      o[10] := o[1]*o[2]*o[8]*tau;
+      o[11] := o[3]*o[8];
+      o[12] := o[3]*o[8]*tau;
+      o[13] := o[1]*o[3]*o[8];
+
+      ftau := 20.944396974307 + tau*(-15.3735415757432 + o[2]*tau*(
+        18.3301634515678 + o[1]*tau*(-28.08078114862 + o[1]*(14.4640436358204
+         - 0.194503669468755*o[1]*o[3]*tau)))) + delta*((-2.5308630955428 + o[
+        2]*(-6.9146446840086 + (13.2781565976477 - 10.9153200808732*o[1])*o[4]))
+        *tau + delta*(tau*(-1.70429417648412 + o[2]*(29.3833689251262 + (-21.3518320798755
+         + (0.867251811341388 + 3.26518619032008*o[2])*o[5])*tau)) + delta*((
+        2.779959913892 + o[1]*(-8.075966009428 + o[6]*(-0.131436219478341 -
+        12.37496929108*o[7])))*tau + delta*((-0.88952870857478 + o[1]*(
+        3.62288282878932 + 18.3358370228714*o[9]))*tau + delta*(
+        0.10770512626332 + o[1]*(-0.98740869776862 - 13.2264761307011*o[10])
+         + delta*((0.188521503330184 + 4.27343239646986*o[11])*tau + delta*(-0.027006744482696
+        *tau + delta*(-0.385692979164272*o[12] + delta*(delta*(-0.00016557679795037
+         - 0.00116802137560719*delta*o[12]) + (0.00115845907256168 +
+        0.0840031522296486*o[11])*tau)))))))));
+
+      fdelta := (1.0658070028513 + delta*(o[1]*(-1.2654315477714 + o[2]*(-1.1524407806681
+         + (0.88521043984318 - 0.64207765181607*o[1])*o[4])) + delta*(
+        0.76986920373342 + o[1]*(-1.70429417648412 + o[2]*(9.7944563083754 +
+        (-6.100523451393 + (0.078841073758308 + 0.25116816848616*o[2])*o[5])*
+        tau)) + delta*(-0.8399798909613 + o[1]*(4.169939870838 + o[1]*(-6.056974507071
+         + o[6]*(-0.0246442911521889 - 1.42788107204769*o[7]))) + delta*(
+        0.175936297894 + o[1]*(-1.77905741714956 + o[1]*(3.62288282878932 +
+        2.82089800351868*o[9])) + delta*(delta*(-0.133052405238576 + o[1]*(
+        0.565564509990552 + 0.98617670687766*o[11]) + delta*(-0.094523605689436
+        *o[1] + delta*(-0.118674762819776*o[13] + delta*(o[1]*(
+        0.00521306582652756 + 0.0290780142333399*o[11]) + delta*(
+        0.00080964802996215 - 0.000494162889679965*delta*o[13] -
+        0.0016557679795037*tau))))) + (0.5385256313166 + o[1]*(-1.6456811629477
+         - 2.5435531020579*o[10]))*tau))))))/delta;
+
+      h := data.RH2O*T*(tau*ftau + delta*fdelta);
+    end hofdT3;
+
+    function hofps3 "isentropic specific enthalpy in region 3 h(p,s)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Units.SI.Density d "density";
+      Units.SI.Temperature T "temperature (K)";
+      Units.SI.Pressure delp=IterationData.DELP "iteration accuracy";
+      Units.SI.SpecificEntropy dels=IterationData.DELS "iteration accuracy";
+      Integer error "error if not 0";
+    algorithm
+      (d,T,error) := Inverses.dtofps3(p=p,s= s,delp= delp,dels= dels);
+      h := hofdT3(d, T);
+    end hofps3;
+
+    function hofpsdt3
+      "isentropic specific enthalpy in region 3 h(p,s) with given good guess in d and T"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Units.SI.Density dguess
+        "good guess density, e.g. from adjacent volume";
+      input Units.SI.Temperature Tguess
+        "good guess temperature, e.g. from adjacent volume";
+      input Units.SI.Pressure delp=IterationData.DELP "relative error in p";
+      input Units.SI.SpecificEntropy dels=IterationData.DELS
+        "relative error in s";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Units.SI.Density d "density";
+      Units.SI.Temperature T "temperature (K)";
+      Integer error "error flag";
+    algorithm
+      (d,T,error) := Inverses.dtofpsdt3(p=p,s= s,dguess= dguess,Tguess=
+        Tguess,delp= delp,dels= dels);
+      h := hofdT3(d, T);
+    end hofpsdt3;
+
+    function hofps4 "isentropic specific enthalpy in region 4 h(p,s)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Units.SI.Temp_K Tsat "saturation temperature";
+      Units.SI.MassFraction x "dryness fraction";
+      Units.SI.SpecificEntropy sl "saturated liquid specific entropy";
+      Units.SI.SpecificEntropy sv "saturated vapour specific entropy";
+      Units.SI.SpecificEnthalpy hl "saturated liquid specific enthalpy";
+      Units.SI.SpecificEnthalpy hv "saturated vapour specific enthalpy";
+    algorithm
+      if (p <= data.PLIMIT4A) then
+        Tsat := Basic.tsat(p);
+        (hl,sl) := handsofpT1(p, Tsat);
+        (hv,sv) := handsofpT2(p, Tsat);
+      elseif (p < data.PCRIT) then
+        sl := Regions.sl_p_R4b(p);
+        sv := Regions.sv_p_R4b(p);
+        hl := Regions.hl_p_R4b(p);
+        hv := Regions.hv_p_R4b(p);
+      end if;
+      x := max(min(if sl <> sv then (s - sl)/(sv - sl) else 1.0, 1.0),0.0);
+      h := hl + x*(hv - hl);
+    end hofps4;
+
+    function hofpT5 "specific enthalpy in region 5 h(p,T)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      Real[4] o "vector of auxiliary variables";
+      Real tau "dimensionless temperature";
+      Real pi "dimensionless pressure";
+    algorithm
+      tau := data.TSTAR5/T;
+      pi := p/data.PSTAR5;
+      assert(p > triple.ptriple,
+        "IF97 medium function hofpT5 called with too low pressure\n" +
+        "p = " + String(p) + " Pa <= " + String(triple.ptriple) + " Pa (triple point pressure)");
+      o[1] := tau*tau;
+      o[2] := o[1]*o[1];
+      o[3] := pi*pi;
+      o[4] := o[2]*o[2];
+      h := data.RH2O*T*tau*(6.8540841634434 + 3.1161318213925/o[1] +
+        0.074415446800398/o[2] - 0.0000357523455236121*o[3]*o[4] +
+        0.0021774678714571*pi - 0.013782846269973*o[1]*pi +
+        3.8757684869352e-7*o[1]*o[3]*pi - 0.73803069960666/(o[1]*tau) -
+        0.65923253077834*tau);
+    end hofpT5;
+
+    function water_hisentropic
+      "isentropic specific enthalpy from p,s (preferably use water_hisentropic_dyn in dynamic simulation!)"
+      import ThermoSysPro;
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+     input Integer phase=
+                    0 "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      ThermoSysPro.Properties.Common.GibbsDerivs g
+        "derivatives of dimensionless Gibbs-function w.r.t dimensionless pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs f
+        "derivatives of dimensionless Helmholtz-function w.r.t dimensionless delta and tau";
+      Integer region(min=1, max=5) "IF97 region";
+      Integer error "error if not 0";
+      Units.SI.Temperature T "temperature";
+      Units.SI.Density d "density";
+    algorithm
+      region := Regions.region_ps(p=p,s= s,phase=phase);
+      if (region == 1) then
+        h := hofps1(p, s);
+      elseif (region == 2) then
+        h := hofps2(p, s);
+      elseif (region == 3) then
+        (d,T,error) := Inverses.dtofps3(p=p,s= s,delp= IterationData.DELP,dels=
+               IterationData.DELS);
+        h := hofdT3(d, T);
+      elseif (region == 4) then
+        h := hofps4(p, s);
+      elseif (region == 5) then
+        (T,error) := Inverses.tofps5(p=p,s= s,relds= IterationData.DELS);
+        h := hofpT5(p, T);
+      end if;
+    end water_hisentropic;
+
+    function water_hisentropic_dyn
+      "isentropic specific enthalpy from p,s and good guesses of d and T"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Units.SI.Density dguess
+        "good guess density, e.g. from adjacent volume";
+      input Units.SI.Temperature Tguess
+        "good guess temperature, e.g. from adjacent volume";
+      input Integer phase "1 for one phase, 2 for two phase";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    protected
+      ThermoSysPro.Properties.Common.GibbsDerivs g
+        "derivatives of dimensionless Gibbs-function w.r.t dimensionless pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs f
+        "derivatives of dimensionless Helmholtz-function w.r.t dimensionless delta and tau";
+      Integer region(min=1, max=5) "IF97 region";
+      Integer error "error if not 0";
+      Units.SI.Temperature T "temperature";
+      Units.SI.Density d "density";
+    algorithm
+      region := Regions.region_ps(p=p,s= s,phase= phase);
+      if (region == 1) then
+        h := hofps1(p, s);
+      elseif (region == 2) then
+        h := hofps2(p, s);
+      elseif (region == 3) then
+        h := hofpsdt3(p=p,s= s,dguess= dguess,Tguess= Tguess,delp=
+          IterationData.DELP,dels= IterationData.DELS);
+      elseif (region == 4) then
+        h := hofps4(p, s);
+      elseif (region == 5) then
+        (T,error) := Inverses.tofpst5(p=p,s= s,Tguess= Tguess,relds=
+          IterationData.DELS);
+        h := hofpT5(p, T);
+      end if;
+    end water_hisentropic_dyn;
+
+    annotation (Documentation(info="<HTML><h4>Package description</h4>
+          <p></p>
+          <h4>Package contents</h4>
+          <p>
+          <ul>
+          <li>Function <b>hofpT1</b> computes h(p,T) in region 1.</li>
+          <li>Function <b>handsofpT1</b> computes (s,h)=f(p,T) in region 1, needed for two-phase properties.</li>
+          <li>Function <b>hofps1</b> computes h(p,s) in region 1.</li>
+          <li>Function <b>hofpT2</b> computes h(p,T) in region 2.</li>
+          <li>Function <b>handsofpT2</b> computes (s,h)=f(p,T) in region 2, needed for two-phase properties.</li>
+          <li>Function <b>hofps2</b> computes h(p,s) in region 2.</li>
+          <li>Function <b>hofdT3</b> computes h(d,T) in region 3.</li>
+          <li>Function <b>hofpsdt3</b> computes h(p,s,dguess,Tguess) in region 3, where dguess and Tguess are initial guess
+          values for the density and temperature consistent with p and s.</li>
+          <li>Function <b>hofps4</b> computes h(p,s) in region 4.</li>
+          <li>Function <b>hofpT5</b> computes h(p,T) in region 5.</li>
+          <li>Function <b>water_hisentropic</b> computes h(p,s,phase) in all regions.
+          The phase input is needed due to discontinuous derivatives at the phase boundary.</li>
+          <li>Function <b>water_hisentropic_dyn</b> computes h(p,s,dguess,Tguess,phase) in all regions.
+          The phase input is needed due to discontinuous derivatives at the phase boundary. Tguess and dguess are initial guess
+          values for the density and temperature consistent with p and s. This function should be preferred in
+          dynamic simulations where good guesses are often available.</li>
+          </ul>
+          </p>
+          <h4>Version Info and Revision history
+          </h4>
+          <ul>
+          <li>First implemented: <i>July, 2000</i>
+          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+          </li>
+          </ul>
+          <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+          </address>
+          <ul>
+          <li>Initial version: July 2000</li>
+          <li>Documentation added: December 2002</li>
+          </ul>
+          </HTML>
+          "), Icon(graphics={
+          Text(
+            extent={{-102,0},{24,-26}},
+            lineColor={242,148,0},
+            textString=
+                 "Thermo"),
+          Text(
+            extent={{-4,8},{68,-34}},
+            lineColor={46,170,220},
+            textString=
+                 "SysPro"),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
+                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
+                -50,6},{-62,2}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
+                8},{-42,22},{-42,30},{-44,38}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
+                12},{-26,12},{-28,12},{-26,20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,30},{-6,26}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,36},{-6,32}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,42},{-6,38}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,48},{-6,44}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,32},{-2,28}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,38},{-2,34}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,44},{-2,40}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,50},{-2,46}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
+                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
+                -50,6},{-62,2}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Line(
+            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+            color={46,170,220},
+            thickness=0.5),
+          Polygon(
+            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+          Line(
+            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+            color={0,0,255},
+            smooth=Smooth.None),
+          Line(
+            points={{80,80},{100,100}},
+            color={0,0,255},
+            smooth=Smooth.None)}));
+  end Isentropic;
+  //work needed: (Pr,lam,eta) = f(d,T,p, region?)
+  package Inverses "efficient inverses for selected pairs of variables"
+
+    //===================================================================
+    //            Iterative version for some pairs/regions
+
+    //===================================================================
+    function fixdT "region limits for inverse iteration in region 3"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Density din "density";
+      input Units.SI.Temperature Tin "temperature";
+      output Units.SI.Density dout "density";
+      output Units.SI.Temperature Tout "temperature";
+    protected
+      Units.SI.Temperature Tmin "approximation of minimum temperature";
+      Units.SI.Temperature Tmax "approximation of maximum temperature";
+    algorithm
+      if (din > 765.0) then
+        dout := 765.0;
+      elseif (din < 110.0) then
+        dout := 110.0;
+      else
+        dout := din;
+      end if;
+      if (dout < 390.0) then
+        Tmax := 554.3557377 + dout*0.809344262;
+      else
+        Tmax := 1116.85 - dout*0.632948717;
+      end if;
+      if (dout < data.DCRIT) then
+        Tmin := data.TCRIT*(1.0 - (dout - data.DCRIT)*(dout - data.DCRIT)/
+          1.0e6);
+      else
+        Tmin := data.TCRIT*(1.0 - (dout - data.DCRIT)*(dout - data.DCRIT)/
+          1.44e6);
+      end if;
+      if (Tin < Tmin) then
+        Tout := Tmin;
+      elseif (Tin > Tmax) then
+        Tout := Tmax;
+      else
+        Tout := Tin;
+      end if;
+    end fixdT;
+
+    function dofp13 "density at the boundary between regions 1 and 3"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.Density d "density";
+    protected
+      Real p2 "auxiliary variable";
+      Real[3] o "vector of auxiliary variables";
+    algorithm
+      p2 := 7.1 - 6.04960677555959e-8*p;
+      o[1] := p2*p2;
+      o[2] := o[1]*o[1];
+      o[3] := o[2]*o[2];
+      d := 57.4756752485113/(0.0737412153522555 + p2*(0.00145092247736023 +
+        p2*(0.000102697173772229 + p2*(0.0000114683182476084 + p2*(
+        1.99080616601101e-6 + o[1]*p2*(1.13217858826367e-8 + o[2]*o[3]*p2*(
+        1.35549330686006e-17 + o[1]*(-3.11228834832975e-19 + o[1]*o[2]*(-7.02987180039442e-22
+         + p2*(3.29199117056433e-22 + (-5.17859076694812e-23 +
+        2.73712834080283e-24*p2)*p2))))))))));
+
+    end dofp13;
+
+    function dofp23 "density at the boundary between regions 2 and 3"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output Units.SI.Density d "density";
+    protected
+      Units.SI.Temperature T;
+      Real[13] o "vector of auxiliary variables";
+      Real taug "auxiliary variable";
+      Real pi "dimensionless pressure";
+      Real gpi23
+        "derivative of g w.r.t. pi on the boundary between regions 2 and 3";
+    algorithm
+      pi := p/data.PSTAR2;
+      T := 572.54459862746 + 31.3220101646784*(-13.91883977887 + pi)^0.5;
+      o[1] := (-13.91883977887 + pi)^0.5;
+      taug := -0.5 + 540.0/(572.54459862746 + 31.3220101646784*o[1]);
+      o[2] := taug*taug;
+      o[3] := o[2]*taug;
+      o[4] := o[2]*o[2];
+      o[5] := o[4]*o[4];
+      o[6] := o[5]*o[5];
+      o[7] := o[4]*o[5]*o[6]*taug;
+      o[8] := o[4]*o[5]*taug;
+      o[9] := o[2]*o[4]*o[5];
+      o[10] := pi*pi;
+      o[11] := o[10]*o[10];
+      o[12] := o[4]*o[6]*taug;
+      o[13] := o[6]*o[6];
+
+      gpi23 := (1.0 + pi*(-0.0017731742473213 + taug*(-0.017834862292358 +
+        taug*(-0.045996013696365 + (-0.057581259083432 - 0.05032527872793*o[3])
+        *taug)) + pi*(taug*(-0.000066065283340406 + (-0.0003789797503263 + o[
+        2]*(-0.007878555448671 + o[3]*(-0.087594591301146 -
+        0.000053349095828174*o[7])))*taug) + pi*(6.1445213076927e-8 + (
+        1.31612001853305e-6 + o[2]*(-0.00009683303171571 + o[3]*(-0.0045101773626444
+         - 0.122004760687947*o[7])))*taug + pi*(taug*(-3.15389238237468e-9 +
+        (5.116287140914e-8 + 1.92901490874028e-6*taug)*taug) + pi*(
+        0.0000114610381688305*o[2]*o[4]*taug + pi*(o[3]*(-1.00288598706366e-10
+         + o[8]*(-0.012702883392813 - 143.374451604624*o[2]*o[6]*taug)) + pi*
+        (-4.1341695026989e-17 + o[2]*o[5]*(-8.8352662293707e-6 -
+        0.272627897050173*o[9])*taug + pi*(o[5]*(9.0049690883672e-11 -
+        65.8490727183984*o[4]*o[5]*o[6]) + pi*(1.78287415218792e-7*o[8] + pi*
+        (o[4]*(1.0406965210174e-18 + o[2]*(-1.0234747095929e-12 -
+        1.0018179379511e-8*o[4])*o[4]) + o[10]*o[11]*((-1.29412653835176e-9
+         + 1.71088510070544*o[12])*o[7] + o[10]*(-6.05920510335078*o[13]*o[5]
+        *o[6]*taug + o[10]*(o[4]*o[6]*(1.78371690710842e-23 + o[2]*o[4]*o[5]*
+        (6.1258633752464e-12 - 0.000084004935396416*o[8])*taug) + pi*(-1.24017662339842e-24
+        *o[12] + pi*(0.0000832192847496054*o[13]*o[4]*o[6]*taug + pi*(o[2]*o[
+        5]*o[6]*(1.75410265428146e-27 + (1.32995316841867e-15 -
+        0.0000226487297378904*o[2]*o[6])*o[9])*pi - 2.93678005497663e-14*o[13]
+        *o[2]*o[4]*taug)))))))))))))))))/pi;
+      d := p/(data.RH2O*T*pi*gpi23);
+    end dofp23;
+
+    function dofpt3 "inverse iteration in region 3: (d) = f(p,T)"
+      import ThermoSysPro;
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature (K)";
+      input Units.SI.Pressure delp "iteration converged if (p-pre(p) < delp)";
+      output Units.SI.Density d "density";
+      output Integer error=0 "error flag: iteration failed if different from 0";
+    protected
+      Units.SI.Density dguess "guess density";
+      Integer i=0 "loop counter";
+      Real dp "pressure difference";
+      Units.SI.Density deld "density step";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.NewtonDerivatives_pT nDerivs
+        "derivatives needed in Newton iteration";
+      Boolean found=false "flag for iteration success";
+      Boolean supercritical "flag, true for supercritical states";
+      Boolean liquid "flag, true for liquid states";
+      Units.SI.Density dmin "lower density limit";
+      Units.SI.Density dmax "upper density limit";
+      Units.SI.Temperature Tmax "maximum temperature";
+    algorithm
+      assert(p >= data.PLIMIT4A,
+        "BaseIF97.dofpt3: function called outside of region 3! p too low\n" +
+        "p = " + String(p) + " Pa < " + String(data.PLIMIT4A) + " Pa");
+      assert(T >= data.TLIMIT1,
+        "BaseIF97.dofpt3: function called outside of region 3! T too low\n" +
+        "T = " + String(T) + " K < " + String(data.TLIMIT1) + " K");
+      assert(p >= Regions.boundary23ofT(T),
+        "BaseIF97.dofpt3: function called outside of region 3! T too high\n" +
+        "p = " + String(p) + " Pa, T = " + String(T) + " K");
+      supercritical := p > data.PCRIT;
+      dmax := dofp13(p);
+      dmin := dofp23(p);
+      Tmax := Regions.boundary23ofp(p);
+      if supercritical then
+        dguess := dmin + (T - data.TLIMIT1)/(data.TLIMIT1 - Tmax)*(dmax -
+          dmin);
+        //this may need improvement!!
+      else
+        liquid := T < Basic.tsat(p);
+        if liquid then
+          dguess := 0.5*(Regions.rhol_p_R4b(p) + dmax);
+        else
+          dguess := 0.5*(Regions.rhov_p_R4b(p) + dmin);
+        end if;
+      end if;
+      while ((i < IterationData.IMAX) and not found) loop
+        d := dguess;
+        f := Basic.f3(d, T);
+        nDerivs :=ThermoSysPro.Properties.Common.Helmholtz_pT(f);
+        dp := nDerivs.p - p;
+        if (abs(dp/p) <= delp) then
+          found := true;
+        end if;
+        deld := dp/nDerivs.pd;
+        d := d - deld;
+        if d > dmin and d < dmax then
+          dguess := d;
+        else
+          if d > dmax then
+            dguess := dmax - sqrt(Modelica.Constants.eps);
+              // put it on the correct spot just inside the boundary here instead
+          else
+            dguess := dmin + sqrt(Modelica.Constants.eps);
+          end if;
+        end if;
+        i := i + 1;
+      end while;
+      if not found then
+        error := 1;
+      end if;
+      assert(error <> 1, "error in inverse function dofpt3: iteration failed");
+    end dofpt3;
+
+    // for all iteration functions: project to bounadries possible
+    // if p is input. Step 1 get dofpt_efficient(p,T) at boundary
+    // for T, use boundary itself if off limits, for d a bit inside
+
+    function dtofph3 "inverse iteration in region 3: (d,T) = f(p,h)"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Units.SI.Pressure delp "iteration accuracy";
+      input Units.SI.SpecificEnthalpy delh "iteration accuracy";
+      output Units.SI.Density d "density";
+      output Units.SI.Temperature T "temperature (K)";
+      output Integer error "error flag: iteration failed if different from 0";
+    protected
+      Units.SI.Temperature Tguess "initial temperature";
+      Units.SI.Density dguess "initial density";
+      Integer i "iteration counter";
+      Real dh "Newton-error in h-direction";
+      Real dp "Newton-error in p-direction";
+      Real det "determinant of directional derivatives";
+      Real deld "Newton-step in d-direction";
+      Real delt "Newton-step in T-direction";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.NewtonDerivatives_ph nDerivs
+        "derivatives needed in Newton iteration";
+      Boolean found=false "flag for iteration success";
+      Integer subregion "1 for subregion 3a, 2 for subregion 3b";
+    algorithm
+      if p < data.PCRIT then
+        // allow a 10 J margin inside the (well approximated) phase boundary
+        subregion := if h < (Regions.hl_p(p) + 10.0) then 1 else
+          if h > (Regions.hv_p(p) - 10.0) then 2 else 0;
+        assert(subregion <> 0,"inverse iteration of dt from ph called in 2 phase region: this can not work");
+      else
+        //supercritical
+        subregion := if h < Basic.h3ab_p(p) then 1 else 2;
+      end if;
+      T := if subregion == 1 then Basic.T3a_ph(p,h) else Basic.T3b_ph(p,h);
+      d := if subregion == 1 then 1/Basic.v3a_ph(p,h) else 1/Basic.v3b_ph(p,h);
+      i := 0;
+      error := 0;
+      while ((i < IterationData.IMAX) and not found) loop
+        f := Basic.f3(d, T);
+        nDerivs :=ThermoSysPro.Properties.Common.Helmholtz_ph(f);
+        dh := nDerivs.h - h;
+        dp := nDerivs.p - p;
+        if ((abs(dh/h) <= delh) and (abs(dp/p) <= delp)) then
+          found := true;
+        end if;
+        det := nDerivs.ht*nDerivs.pd - nDerivs.pt*nDerivs.hd;
+        delt := (nDerivs.pd*dh - nDerivs.hd*dp)/det;
+        deld := (nDerivs.ht*dp - nDerivs.pt*dh)/det;
+        T := T - delt;
+        d := d - deld;
+        dguess := d;
+        Tguess := T;
+        i := i + 1;
+        (d,T) := fixdT(dguess, Tguess);
+      end while;
+      if not found then
+        error := 1;
+      end if;
+      assert(error <> 1,
+        "error in inverse function dtofph3: iteration failed");
+    end dtofph3;
+
+    function dtofps3 "inverse iteration in region 3: (d,T) = f(p,s)"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Units.SI.Pressure delp "iteration accuracy";
+      input Units.SI.SpecificEntropy dels "iteration accuracy";
+      output Units.SI.Density d "density";
+      output Units.SI.Temperature T "temperature (K)";
+      output Integer error "error flag: iteration failed if different from 0";
+    protected
+      Units.SI.Temperature Tguess "initial temperature";
+      Units.SI.Density dguess "initial density";
+      Integer i "iteration counter";
+      Real ds "Newton-error in s-direction";
+      Real dp "Newton-error in p-direction";
+      Real det "determinant of directional derivatives";
+      Real deld "Newton-step in d-direction";
+      Real delt "Newton-step in T-direction";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.NewtonDerivatives_ps nDerivs
+        "derivatives needed in Newton iteration";
+      Boolean found "flag for iteration success";
+      Integer subregion "1 for subregion 3a, 2 for subregion 3b";
+    algorithm
+      i := 0;
+      error := 0;
+      found := false;
+      if p < data.PCRIT then
+        // allow a 1 J/K margin inside the (well approximated) phase boundary
+        subregion := if s < (Regions.sl_p(p) + 10.0) then 1 else
+          if s > (Regions.sv_p(p) - 10.0) then 2 else 0;
+        assert(subregion <> 0,"inverse iteration of dt from ps called in 2 phase region: this is illegal!");
+      else
+        subregion := if s < data.SCRIT then 1 else 2;
+      end if;
+      T := if subregion == 1 then Basic.T3a_ps(p,s) else Basic.T3b_ps(p,s);
+      d := if subregion == 1 then 1/Basic.v3a_ps(p,s) else 1/Basic.v3b_ps(p,s);
+      while ((i < IterationData.IMAX) and not found) loop
+        f := Basic.f3(d, T);
+        nDerivs :=ThermoSysPro.Properties.Common.Helmholtz_ps(f);
+        ds := nDerivs.s - s;
+        dp := nDerivs.p - p;
+        if ((abs(ds/s) <= dels) and (abs(dp/p) <= delp)) then
+          found := true;
+        end if;
+        det := nDerivs.st*nDerivs.pd - nDerivs.pt*nDerivs.sd;
+        delt := (nDerivs.pd*ds - nDerivs.sd*dp)/det;
+        deld := (nDerivs.st*dp - nDerivs.pt*ds)/det;
+        T := T - delt;
+        d := d - deld;
+        dguess := d;
+        Tguess := T;
+        i := i + 1;
+        (d,T) := fixdT(dguess, Tguess);
+      end while;
+      if not found then
+        error := 1;
+      end if;
+      assert(error <> 1,
+        "error in inverse function dtofps3: iteration failed");
+    end dtofps3;
+
+    function dtofpsdt3 "inverse iteration in region 3: (d,T) = f(p,s)"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Units.SI.Density dguess "guess density, e.g. from adjacent volume";
+      input Units.SI.Temperature Tguess
+        "guess temperature, e.g. from adjacent volume";
+      input Units.SI.Pressure delp "iteration accuracy";
+      input Units.SI.SpecificEntropy dels "iteration accuracy";
+      output Units.SI.Density d "density";
+      output Units.SI.Temperature T "temperature (K)";
+      output Integer error "error flag: iteration failed if different from 0";
+    protected
+      Integer i "iteration counter";
+      Real ds "Newton-error in s-direction";
+      Real dp "Newton-error in p-direction";
+      Real det "determinant of directional derivatives";
+      Real deld "Newton-step in d-direction";
+      Real delt "Newton-step in T-direction";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.NewtonDerivatives_ps nDerivs
+        "derivatives needed in Newton iteration";
+      Boolean found "flag for iteration success";
+      Units.SI.Density diter "density";
+      Units.SI.Temperature Titer "temperature (K)";
+    algorithm
+      i := 0;
+      error := 0;
+      found := false;
+      (diter,Titer) := fixdT(dguess, Tguess);
+      while ((i < IterationData.IMAX) and not found) loop
+        (d,T) := fixdT(diter, Titer);
+        f := Basic.f3(d, T);
+        nDerivs :=ThermoSysPro.Properties.Common.Helmholtz_ps(f);
+        ds := nDerivs.s - s;
+        dp := nDerivs.p - p;
+        if ((abs(ds/s) <= dels) and (abs(dp/p) <= delp)) then
+          found := true;
+        end if;
+        det := nDerivs.st*nDerivs.pd - nDerivs.pt*nDerivs.sd;
+        delt := (nDerivs.pd*ds - nDerivs.sd*dp)/det;
+        deld := (nDerivs.st*dp - nDerivs.pt*ds)/det;
+        T := T - delt;
+        d := d - deld;
+        diter := d;
+        Titer := T;
+        i := i + 1;
+      end while;
+      if not found then
+        error := 1;
+      end if;
+      assert(error <> 1,
+        "error in inverse function dtofpsdt3: iteration failed");
+    end dtofpsdt3;
+
+    function pofdt125 "inverse iteration in region 1,2 and 5: p = g(d,T)"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature (K)";
+      input Units.SI.Pressure reldd "relative iteration accuracy of density";
+      input Integer region
+        "region in IAPWS/IF97 in which inverse should be calculated";
+      output Units.SI.Pressure p "pressure";
+      output Integer error "error flag: iteration failed if different from 0";
+    protected
+      Integer i "counter for while-loop";
+      ThermoSysPro.Properties.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      Boolean found "flag if iteration has been successful";
+      Real dd
+        "difference between density for  guessed p and the current density";
+      Real delp "step in p in Newton-iteration";
+      Real relerr "relative error in d";
+      Units.SI.Pressure pguess1=1.0e6 "initial pressure guess in region 1";
+      Units.SI.Pressure pguess2 "initial pressure guess in region 2";
+      constant Units.SI.Pressure pguess5=0.5e6
+        "initial pressure guess in region 5";
+    algorithm
+      i := 0;
+      error := 0;
+      pguess2 := 42800*d;
+      found := false;
+      if region == 1 then
+        p := pguess1;
+      elseif region == 2 then
+        p := pguess2;
+      else
+        p := pguess5;
+      end if;
+      while ((i < IterationData.IMAX) and not found) loop
+        if region == 1 then
+          g := Basic.g1(p, T);
+        elseif region == 2 then
+          g := Basic.g2(p, T);
+        else
+          g := Basic.g5(p, T);
+        end if;
+        dd := p/(data.RH2O*T*g.pi*g.gpi) - d;
+        relerr := dd/d;
+        if (abs(relerr) < reldd) then
+          found := true;
+        end if;
+        delp := dd*(-p*p/(d*d*data.RH2O*T*g.pi*g.pi*g.gpipi));
+        p := p - delp;
+        i := i + 1;
+        if not found then
+          if p < triple.ptriple then
+            p := 2.0*triple.ptriple;
+          end if;
+          if p > data.PLIMIT1 then
+            p := 0.95*data.PLIMIT1;
+          end if;
+        end if;
+      end while;
+
+        // print("i = " + i2s(i) + ", p = " + r2s(p/1.0e5) + ", delp = " + r2s(delp*1.0e-5) + "\n");
+      if not found then
+        error := 1;
+      end if;
+      assert(error <> 1,
+        "error in inverse function pofdt125: iteration failed");
+    end pofdt125;
+
+    function tofph5 "inverse iteration in region 5: (p,T) = f(p,h)"
+      import ThermoSysPro;
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Units.SI.SpecificEnthalpy reldh "iteration accuracy";
+      output Units.SI.Temperature T "temperature (K)";
+      output Integer error "error flag: iteration failed if different from 0";
+
+    protected
+      ThermoSysPro.Properties.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      Units.SI.SpecificEnthalpy proh "h for current guess in T";
+      constant Units.SI.Temperature Tguess=1500 "initial temperature";
+      Integer i "iteration counter";
+      Real relerr "relative error in h";
+      Real dh "Newton-error in h-direction";
+      Real dT "Newton-step in T-direction";
+      Boolean found "flag for iteration success";
+    algorithm
+      i := 0;
+      error := 0;
+      T := Tguess;
+      found := false;
+      while ((i < IterationData.IMAX) and not found) loop
+        g := Basic.g5(p, T);
+        proh := data.RH2O*T*g.tau*g.gtau;
+        dh := proh - h;
+        relerr := dh/h;
+        if (abs(relerr) < reldh) then
+          found := true;
+        end if;
+        dT := dh/(-data.RH2O*g.tau*g.tau*g.gtautau);
+        T := T - dT;
+        i := i + 1;
+      end while;
+      if not found then
+        error := 1;
+      end if;
+      assert(error <> 1, "error in inverse function tofph5: iteration failed");
+    end tofph5;
+
+    function tofps5 "inverse iteration in region 5: (p,T) = f(p,s)"
+      import ThermoSysPro;
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Units.SI.SpecificEnthalpy relds "iteration accuracy";
+      output Units.SI.Temperature T "temperature (K)";
+      output Integer error "error flag: iteration failed if different from 0";
+
+    protected
+      ThermoSysPro.Properties.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      Units.SI.SpecificEntropy pros "s for current guess in T";
+      parameter Units.SI.Temperature Tguess=1500 "initial temperature";
+      Integer i "iteration counter";
+      Real relerr "relative error in s";
+      Real ds "Newton-error in s-direction";
+      Real dT "Newton-step in T-direction";
+      Boolean found "flag for iteration success";
+    algorithm
+      i := 0;
+      error := 0;
+      T := Tguess;
+      found := false;
+      while ((i < IterationData.IMAX) and not found) loop
+        g := Basic.g5(p, T);
+        pros := data.RH2O*(g.tau*g.gtau - g.g);
+        ds := pros - s;
+        relerr := ds/s;
+        if (abs(relerr) < relds) then
+          found := true;
+        end if;
+        dT := ds*T/(-data.RH2O*g.tau*g.tau*g.gtautau);
+        T := T - dT;
+        i := i + 1;
+      end while;
+      if not found then
+        error := 1;
+      end if;
+      assert(error <> 1, "error in inverse function tofps5: iteration failed");
+    end tofps5;
+
+    function tofpst5 "inverse iteration in region 5: (p,T) = f(p,s)"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Units.SI.Temperature Tguess
+        "guess temperature, e.g. from adjacent volume";
+      input Units.SI.SpecificEntropy relds "iteration accuracy";
+      output Units.SI.Temperature T "temperature (K)";
+      output Integer error "error flag: iteration failed if different from 0";
+
+    protected
+      ThermoSysPro.Properties.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      Units.SI.SpecificEntropy pros "s for current guess in T";
+      Integer i "iteration counter";
+      Real relerr "relative error in s";
+      Real ds "Newton-error in s-direction";
+      Real dT "Newton-step in T-direction";
+      Boolean found "flag for iteration success";
+    algorithm
+      i := 0;
+      error := 0;
+      T := Tguess;
+      found := false;
+      while ((i < IterationData.IMAX) and not found) loop
+        g := Basic.g5(p, T);
+        pros := data.RH2O*(g.tau*g.gtau - g.g);
+        ds := pros - s;
+        relerr := ds/s;
+        if (abs(relerr) < relds) then
+          found := true;
+        end if;
+        dT := ds*T/(-data.RH2O*g.tau*g.tau*g.gtautau);
+        T := T - dT;
+        i := i + 1;
+      end while;
+      if not found then
+        error := 1;
+      end if;
+      assert(error <> 1,
+        "error in inverse function tofpst5: iteration failed");
+    end tofpst5;
+
+    annotation (Documentation(info="<HTML><h4>Package description</h4>
+          <p></p>
+          <h4>Package contents</h4>
+          <p>
+          <ul>
+          <li>Function <b>fixdT</b> constrains density and temperature to allowed region</li>
+          <li>Function <b>dofp13</b> computes d as a function of p at boundary between regions 1 and 3</li>
+          <li>Function <b>dofp23</b> computes d as a function of p at boundary between regions 2 and 3</li>
+          <li>Function <b>dofpt3</b> iteration to compute d as a function of p and T in region 3</li>
+          <li>Function <b>dtofph3</b> iteration to compute d and T as a function of p and h in region 3</li>
+          <li>Function <b>dtofps3</b> iteration to compute d and T as a function of p and s in region 3</li>
+          <li>Function <b>dtofpsdt3</b> iteration to compute d and T as a function of p and s in region 3,
+          with initial guesses</li>
+          <li>Function <b>pofdt125</b> iteration to compute p as a function of p and T in regions 1, 2 and 5</li>
+          <li>Function <b>tofph5</b> iteration to compute T as a function of p and h in region 5</li>
+          <li>Function <b>tofps5</b> iteration to compute T as a function of p and s in region 5</li>
+          <li>Function <b>tofpst5</b> iteration to compute T as a function of p and s in region 5, with initial guess in T</li>
+          <li>Function <b></b></li>
+          </ul>
+          </p>
+          <h4>Version Info and Revision history
+          </h4>
+          <ul>
+          <li>First implemented: <i>July, 2000</i>
+          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+          </li>
+          </ul>
+          <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+          </address>
+          <ul>
+          <li>Initial version: July 2000</li>
+          <li>Documentation added: December 2002</li>
+          </ul>
+          </HTML>
+          "), Icon(graphics={
+          Text(
+            extent={{-102,0},{24,-26}},
+            lineColor={242,148,0},
+            textString=
+                 "Thermo"),
+          Text(
+            extent={{-4,8},{68,-34}},
+            lineColor={46,170,220},
+            textString=
+                 "SysPro"),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
+                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
+                -50,6},{-62,2}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
+                8},{-42,22},{-42,30},{-44,38}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
+                12},{-26,12},{-28,12},{-26,20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,30},{-6,26}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,36},{-6,32}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,42},{-6,38}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,48},{-6,44}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,32},{-2,28}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,38},{-2,34}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,44},{-2,40}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,50},{-2,46}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
+                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
+                -50,6},{-62,2}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Line(
+            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+            color={46,170,220},
+            thickness=0.5),
+          Polygon(
+            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+          Line(
+            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+            color={0,0,255},
+            smooth=Smooth.None),
+          Line(
+            points={{80,80},{100,100}},
+            color={0,0,255},
+            smooth=Smooth.None)}));
+  end Inverses;
+
+  package TwoPhase
+    "steam properties in the two-phase rgion and on the phase boundaries"
+
+    function waterLiq_p "properties on the liquid phase boundary of region 4"
+      import ThermoSysPro;
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output ThermoSysPro.Properties.Common.PhaseBoundaryProperties liq
+        "liquid thermodynamic property collection";
+    protected
+      Units.SI.Temperature Tsat "saturation temperature";
+      Real dpT "derivative of saturation pressure wrt temperature";
+      Units.SI.Density dl "liquid density";
+      ThermoSysPro.Properties.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+    algorithm
+      Tsat := Basic.tsat(p);
+      dpT := Basic.dptofT(Tsat);
+      if p < data.PLIMIT4A then
+        g := Basic.g1(p, Tsat);
+        liq :=ThermoSysPro.Properties.Common.gibbsToBoundaryProps(g);
+      else
+        dl := Regions.rhol_p_R4b(p);
+        f := Basic.f3(dl, Tsat);
+        liq :=ThermoSysPro.Properties.Common.helmholtzToBoundaryProps(f);
+      end if;
+    end waterLiq_p;
+
+    function waterVap_p "properties on the vapour phase boundary of region 4"
+      import ThermoSysPro;
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      output ThermoSysPro.Properties.Common.PhaseBoundaryProperties vap
+        "vapour thermodynamic property collection";
+    protected
+      Units.SI.Temperature Tsat "saturation temperature";
+      Real dpT "derivative of saturation pressure wrt temperature";
+      Units.SI.Density dv "vapour density";
+      ThermoSysPro.Properties.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+    algorithm
+      Tsat := Basic.tsat(p);
+      dpT := Basic.dptofT(Tsat);
+      if p < data.PLIMIT4A then
+        g := Basic.g2(p, Tsat);
+        vap :=ThermoSysPro.Properties.Common.gibbsToBoundaryProps(g);
+      else
+        dv := Regions.rhov_p_R4b(p);
+        f := Basic.f3(dv, Tsat);
+        vap :=ThermoSysPro.Properties.Common.helmholtzToBoundaryProps(f);
+      end if;
+    end waterVap_p;
+
+    function waterSat_ph
+      "Water saturation properties in the 2-phase region (4) as f(p,h)"
+      import ThermoSysPro;
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output ThermoSysPro.Properties.Common.SaturationProperties pro
+        "thermodynamic property collection";
+    protected
+      Units.SI.Density dl "liquid density";
+      Units.SI.Density dv "vapour density";
+      ThermoSysPro.Properties.Common.GibbsDerivs gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.GibbsDerivs gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+    algorithm
+      pro.h := h;
+      pro.p := p;
+      pro.T := Basic.tsat(p);
+      pro.dpT := Basic.dptofT(pro.T);
+      if p < data.PLIMIT4A then
+        gl := Basic.g1(p, pro.T);
+        gv := Basic.g2(p, pro.T);
+        pro.liq :=ThermoSysPro.Properties.Common.gibbsToBoundaryProps(gl);
+        pro.vap :=ThermoSysPro.Properties.Common.gibbsToBoundaryProps(gv);
+      else
+        dl := Regions.rhol_p_R4b(p);
+        dv := Regions.rhov_p_R4b(p);
+        fl := Basic.f3(dl, pro.T);
+        fv := Basic.f3(dv, pro.T);
+        pro.liq :=ThermoSysPro.Properties.Common.helmholtzToBoundaryProps(fl);
+        pro.vap :=ThermoSysPro.Properties.Common.helmholtzToBoundaryProps(fv);
+      end if;
+      pro.x := if (h < pro.liq.h) then 0.0 else if (pro.vap.h <> pro.liq.h) then
+              (h - pro.liq.h)/(pro.vap.h - pro.liq.h) else 1.0;
+      pro.d := pro.liq.d*pro.vap.d/(pro.vap.d + pro.x*(pro.liq.d - pro.vap.d));
+      pro.u := pro.x*pro.vap.u + (1 - pro.x)*pro.liq.u;
+      pro.s := pro.x*pro.vap.s + (1 - pro.x)*pro.liq.s;
+      pro.cp := Modelica.Constants.inf;
+      pro.cv :=ThermoSysPro.Properties.Common.cv2Phase(
+            pro.liq,
+            pro.vap,
+            pro.x,
+            pro.T,
+            p);
+      pro.kappa := 1/(pro.d*p)*pro.dpT*pro.dpT*pro.T/pro.cv;
+      pro.R := data.RH2O;
+    end waterSat_ph;
+
+    function waterR4_ph
+      "Water/Steam properties in region 4 of IAPWS/IF97 (two-phase)"
+      import ThermoSysPro;
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+        "thermodynamic property collection";
+    protected
+      Units.SI.Density dl "liquid density";
+      Units.SI.Density dv "vapour density";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties vap
+        "phase boundary property record";
+      ThermoSysPro.Properties.Common.GibbsDerivs gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.GibbsDerivs gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Units.SI.SpecificHeatCapacity cv;
+      Real dpT "derivative of saturation curve";
+    algorithm
+      pro.T := Basic.tsat(p);
+      dpT := Basic.dptofT(pro.T);
+      dl := Regions.rhol_p_R4b(p);
+      dv := Regions.rhov_p_R4b(p);
+      if p < data.PLIMIT4A then
+        gl := Basic.g1(p, pro.T);
+        gv := Basic.g2(p, pro.T);
+        liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
+        vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
+      else
+        fl := Basic.f3(dl, pro.T);
+        fv := Basic.f3(dv, pro.T);
+        liq := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
+        vap := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
+      end if;
+      pro.x := if (vap.h <> liq.h) then (h - liq.h)/(vap.h - liq.h) else 1.0;
+      pro.d := liq.d*vap.d/(vap.d + pro.x*(liq.d - vap.d));
+      pro.u := pro.x*vap.u + (1 - pro.x)*liq.u;
+      pro.s := pro.x*vap.s + (1 - pro.x)*liq.s;
+      pro.cp := Modelica.Constants.inf;
+      cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(liq, vap, pro.x, pro.T, p);
+      pro.ddph := pro.d*(pro.d*cv/dpT + 1.0)/(dpT*pro.T);
+      pro.ddhp := -pro.d*pro.d/(dpT*pro.T);
+    end waterR4_ph;
+
+    function waterR4_dT "Water properties in region 4 as function of d and T"
+      import ThermoSysPro;
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "Density";
+      input Units.SI.Temperature T "temperature";
+      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_dT
+                                        pro "thermodynamic property collection";
+    protected
+      Units.SI.Density dl "liquid density";
+      Units.SI.Density dv "vapour density";
+      ThermoSysPro.Properties.Common.PhaseBoundaryProperties liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.Common.PhaseBoundaryProperties vap
+        "phase boundary property record";
+      ThermoSysPro.Properties.Common.GibbsDerivs gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.GibbsDerivs gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Real x "dryness fraction";
+      Real dpT "derivative of saturation curve";
+    algorithm
+      pro.p := Basic.psat(T);
+      dpT := Basic.dptofT(T);
+      dl := Regions.rhol_p_R4b(pro.p);
+      dv := Regions.rhov_p_R4b(pro.p);
+      if pro.p < data.PLIMIT4A then
+        gl := Basic.g1(pro.p, T);
+        gv := Basic.g2(pro.p, T);
+        liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(
+                                           gl);
+        vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(
+                                           gv);
+      else
+        fl := Basic.f3(dl, T);
+        fv := Basic.f3(dv, T);
+        liq := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(
+                                               fl);
+        vap := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(
+                                               fv);
+      end if;
+      x := if (vap.d <> liq.d) then (1/d - 1/liq.d)/(1/vap.d - 1/liq.d) else
+        1.0;
+      pro.u := x*vap.u + (1 - x)*liq.u;
+      pro.h := x*vap.h + (1 - x)*liq.h;
+      pro.cp := Modelica.Constants.inf;
+    //  pro.cv := Modelica.Media.Common.cv2Phase(liq, vap, x, T, pro.p);
+    //   pro.kappa := 1/(d*pro.p)*dpT*dpT*T/pro.cv;
+    //   pro.a := Modelica.Constants.inf;
+    //   pro.R := data.RH2O;
+      pro.dudT := (pro.p - T*dpT)/(d*d);
+    end waterR4_dT;
+    annotation (Documentation(info="<HTML><h4>Package description</h4>
+          <p>Package TwoPhase provides functions to compute the steam properties
+          in the two-phase region and on the phase boundaries</p>
+          <h4>Package contents</h4>
+          <p>
+          <ul>
+          <li>Function <b>WaterLiq_p</b> computes properties on the boiling boundary as a function of p</li>
+          <li>Function <b>WaterVap_p</b> computes properties on the dew line boundary as a function of p</li>
+          <li>Function <b>WaterSat_ph</b> computes properties on both phase boundaries and in the two
+          phase region as a function of p</li>
+          <li>Function <b>WaterR4_ph</b> computes dynamic simulation properties in region 4 with (p,h) as inputs</li>
+          <li>Function <b>WaterR4_dT</b> computes dynamic simulation properties in region 4 with (d,T) as inputs</li>
+          </ul>
+          </p>
+          <h4>Version Info and Revision history
+          </h4>
+          <ul>
+          <li>First implemented: <i>July, 2000</i>
+          by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+          </li>
+          </ul>
+          <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+          </address>
+          <ul>
+          <li>Initial version: July 2000</li>
+          <li>Documented and re-organized: January 2003</li>
+          </ul>
+          </HTML>
+"), Icon(graphics={
+          Text(
+            extent={{-102,0},{24,-26}},
+            lineColor={242,148,0},
+            textString=
+                 "Thermo"),
+          Text(
+            extent={{-4,8},{68,-34}},
+            lineColor={46,170,220},
+            textString=
+                 "SysPro"),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
+                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
+                -50,6},{-62,2}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
+                8},{-42,22},{-42,30},{-44,38}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
+                12},{-26,12},{-28,12},{-26,20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,30},{-6,26}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,36},{-6,32}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,42},{-6,38}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,48},{-6,44}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,32},{-2,28}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,38},{-2,34}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,44},{-2,40}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,50},{-2,46}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
+                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
+                -50,6},{-62,2}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Line(
+            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+            color={46,170,220},
+            thickness=0.5),
+          Polygon(
+            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+          Line(
+            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+            color={0,0,255},
+            smooth=Smooth.None),
+          Line(
+            points={{80,80},{100,100}},
+            color={0,0,255},
+            smooth=Smooth.None)}));
+  end TwoPhase;
+  annotation (Documentation(info="<HTML>
+    <h4>Version Info and Revision history
+        </h4>
+        <ul>
+        <li>First implemented: <i>July, 2000</i>
+        by Hubertus Tummescheit
+        for the ThermoFluid Library with help from Jonas Eborn and Falko Jens Wagner
+        </li>
+      <li>Code reorganization, enhanced documentation, additional functions:   <i>December, 2002</i>
+      by <a href=\"mailto:Hubertus.Tummescheit@modelon.se\">Hubertus Tummescheit</a> and moved to Modelica
+      properties library.</li>
+        </ul>
+      <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+      </address>
+        <P>In September 1997, the International Association for the Properties
+        of Water and Steam (<A HREF=\"http://www.iapws.org\">IAPWS</A>) adopted a
+        new formulation for the thermodynamic properties of water and steam for
+        industrial use. This new industrial standard is called \"IAPWS Industrial
+        Formulation for the Thermodynamic Properties of Water and Steam\" (IAPWS-IF97).
+        The formulation IAPWS-IF97 replaces the previous industrial standard IFC-67.
+        <P>Based on this new formulation, a new steam table, titled \"<a
+        href=\"http://www.springer.de/cgi-bin/search_book.pl?isbn=3-540-64339-7\">Properties
+        of Water and Steam</a>\" by W. Wagner and A. Kruse, was published by
+        the Springer-Verlag, Berlin - New-York - Tokyo in April 1998. This
+        steam table, ref. <a href=\"#steamprop\">[1]</a> is bilingual (English /
+        German) and contains a complete description of the equations of
+        IAPWS-IF97. This reference is the authoritative source of information
+        for this implementation. A mostly identical version has been published by the International
+        Association for the Properties
+        of Water and Steam (<A HREF=\"http://www.iapws.org\">IAPWS</A>) with permission granted to re-publish the
+        information if credit is given to IAPWS. This document is distributed with this library as
+        <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a>.
+        In addition, the equations published by <A HREF=\"http://www.iapws..org\">IAPWS</A> for
+        the transport properties dynamic viscosity (standards document: <a href=\"IF97documentation/visc.pdf\">visc.pdf</a>)
+        and thermal conductivity (standards document: <a href=\"IF97documentation/thcond.pdf\">thcond.pdf</a>)
+        and equations for the surface tension (standards document: <a href=\"IF97documentation/surf.pdf\">surf.pdf</a>)
+        are also implemented in this library and included for reference.
+        <P>
+        The functions in BaseIF97.mo are low level functions which should
+        only be used in those exceptions when the standard user level
+        functions in Water.mo do not contain the wanted properties.
+        </p>
+<P>Based on IAPWS-IF97, Modelica functions are available for calculating
+the most common thermophysical properties (thermodynamic and transport
+properties). The implementation requires part of the common medium
+property infrastructure of the Modelica.Thermal.Properties library in the file
+Common.mo. There are a few extensions from the version of IF97 as
+documented in <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a> in order to improve performance for
+dynamic simulations. Input variables for calculating the properties are
+only implemented for a limited number of variable pairs which make sense as dynamic states: (p,h), (p,T), (p,s) and (d,T).
+<hr size=3 width=\"70%\">
+<p><a name=\"regions\"><h4>1. Structure and Regions of IAPWS-IF97</h4></a>
+<P>The IAPWS Industrial Formulation 1997 consists of
+a set of equations for different regions which cover the following range
+of validity:
+<table border=0 cellpadding=4 align=center>
+<tr>
+<td valign=\"top\">273,15 K &lt; <I>T</I> &lt; 1073,15 K</td>
+<td valign=\"top\"><I>p</I> &lt; 100 MPa</td>
+</tr>
+<tr>
+<td valign=\"top\">1073,15 K &lt; <I>T</I> &lt; 2273,15 K</td>
+<td valign=\"top\"><I>p</I> &lt; 10 MPa</td>
+</tr>
+</table><br>
+Figure 1 shows the 5 regions into which the entire range of validity of
+IAPWS-IF97 is divided. The boundaries of the regions can be directly taken
+from Fig. 1 except for the boundary between regions 2 and 3; this boundary,
+which corresponds approximately to the isentropic line <nobr><I>s</I> = 5.047 kJ kg
+<FONT SIZE=-1><sup>-1</sup></FONT>
+K<FONT SIZE=-1><sup>-1</sup></FONT>,</nobr> is defined
+by a corresponding auxiliary equation. Both regions 1 and 2 are individually
+covered by a fundamental equation for the specific Gibbs free energy <nobr><I>g</I>(<I>
+p</I>,<I>T </I>)</nobr>, region 3 by a fundamental equation for the specific Helmholtz
+free energy <nobr><I>f </I>(<I> <FONT FACE=\"Symbol\">r</FONT></I>,<I>T
+</I>)</nobr>, and the saturation curve, corresponding to region 4, by a saturation-pressure
+equation <nobr><I>p</I><FONT SIZE=-1><sub>s</sub></FONT>(<I>T</I>)</nobr>. The high-temperature
+region 5 is also covered by a <nobr><I>g</I>(<I> p</I>,<I>T </I>)</nobr> equation. These
+5 equations, shown in rectangular boxes in Fig. 1, form the so-called <I>basic
+equations</I>.
+      <p>
+      <img src=\"IF97documentation/if97.png\" alt=\"Regions and equations of IAPWS-IF97\"></p>
+      <p align=center>Figure 1: Regions and equations of IAPWS-IF97</p>
+<P>In addition to these basic equations, so-called <I>backward
+equations</I> are provided for regions 1, 2, and 4 in form of
+<nobr><I>T </I>(<I> p</I>,<I>h </I>)</nobr> and <nobr><I>T </I>(<I>
+p</I>,<I>s </I>)</nobr> for regions 1 and 2, and <nobr><I>T</I><FONT
+SIZE=-1><sub>s</sub> </FONT>(<I> p </I>)</nobr> for region 4. These
+backward equations, marked in grey in Fig. 1, were developed in such a
+way that they are numerically very consistent with the corresponding
+basic equation. Thus, properties as functions of&nbsp; <I>p</I>,<I>h
+</I>and of&nbsp;<I> p</I>,<I>s </I>for regions 1 and 2, and of
+<I>p</I> for region 4 can be calculated without any iteration. As a
+result of this special concept for the development of the new
+industrial standard IAPWS-IF97, the most important properties can be
+calculated extremely quickly. All modelica functions are optimized
+with regard to short computing times.
+<P>The complete description of the individual equations of the new industrial
+formulation IAPWS-IF97 is given in <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a>. Comprehensive information on
+IAPWS-IF97 (requirements, concept, accuracy, consistency along region boundaries,
+and the increase of computing speed in comparison with IFC-67, etc.) can
+be taken from <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a> or [2].
+<P><a name=\"steamprop\">[1]<I>Wagner, W., Kruse, A.</I> Properties of Water
+and Steam / Zustandsgr&ouml;&szlig;en von Wasser und Wasserdampf / IAPWS-IF97.
+Springer-Verlag, Berlin, 1998.
+<P>[2] <I>Wagner, W., Cooper, J. R., Dittmann, A., Kijima,
+J., Kretzschmar, H.-J., Kruse, A., Mare� R., Oguchi, K., Sato, H., St&ouml;cker,
+I., �fner, O., Takaishi, Y., Tanishita, I., Tr&uuml;benbach, J., and Willkommen,
+Th.</I> The IAPWS Industrial Formulation 1997 for the Thermodynamic Properties
+of Water and Steam. ASME Journal of Engineering for Gas Turbines and Power 122 (2000), 150 - 182.
+<p>
+<HR size=3 width=\"90%\">
+<h4>2. Calculable Properties      </h4>
+<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">
+       <tbody>
+       <tr>
+       <td valign=\"top\" bgcolor=\"#cccccc\"><br>
+      </td>
+      <td valign=\"top\" bgcolor=\"#cccccc\"><b>Common name</b><br>
+       </td>
+       <td valign=\"top\" bgcolor=\"#cccccc\"><b>Abbreviation </b><br>
+       </td>
+       <td valign=\"top\" bgcolor=\"#cccccc\"><b>Unit</b><br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">&nbsp;1<br>
+      </td>
+      <td valign=\"top\">Pressure</td>
+       <td valign=\"top\">p<br>
+        </td>
+       <td valign=\"top\">Pa<br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">&nbsp;2<br>
+      </td>
+      <td valign=\"top\">Temperature</td>
+       <td valign=\"top\">T<br>
+       </td>
+       <td valign=\"top\">K<br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">&nbsp;3<br>
+      </td>
+      <td valign=\"top\">Density</td>
+        <td valign=\"top\">d<br>
+        </td>
+       <td valign=\"top\">kg/m<sup>3</sup><br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">&nbsp;4<br>
+      </td>
+      <td valign=\"top\">Specific volume</td>
+        <td valign=\"top\">v<br>
+        </td>
+       <td valign=\"top\">m<sup>3</sup>/kg<br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">&nbsp;5<br>
+      </td>
+      <td valign=\"top\">Specific enthalpy</td>
+       <td valign=\"top\">h<br>
+       </td>
+       <td valign=\"top\">J/kg<br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">&nbsp;6<br>
+      </td>
+      <td valign=\"top\">Specific entropy</td>
+       <td valign=\"top\">s<br>
+       </td>
+       <td valign=\"top\">J/(kg K)<br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">&nbsp;7<br>
+      </td>
+      <td valign=\"top\">Specific internal energy<br>
+       </td>
+       <td valign=\"top\">u<br>
+       </td>
+       <td valign=\"top\">J/kg<br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">&nbsp;8<br>
+      </td>
+      <td valign=\"top\">Specific isobaric heat capacity</td>
+       <td valign=\"top\">c<font size=\"-1\"><sub>p</sub></font><br>
+       </td>
+       <td valign=\"top\">J/(kg K)<br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">&nbsp;9<br>
+      </td>
+      <td valign=\"top\">Specific isochoric heat capacity</td>
+       <td valign=\"top\">c<font size=\"-1\"><sub>v</sub></font><br>
+       </td>
+       <td valign=\"top\">J/(kg K)<br>
+       </td>
+       </tr>
+       <tr>
+       <td valign=\"top\">10<br>
+      </td>
+      <td valign=\"top\">Isentropic exponent, kappa<nobr>=       <font face=\"Symbol\">-</font>(v/p)
+(dp/dv)<font size=\"-1\"><sub>s</sub> </font></nobr></td>
+     <td valign=\"top\">kappa (     <font face=\"Symbol\">k</font>)<br>
+     </td>
+     <td valign=\"top\">1<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">11<br>
+      </td>
+      <td valign=\"top\">Speed of sound<br>
+     </td>
+     <td valign=\"top\">a<br>
+     </td>
+     <td valign=\"top\">m/s<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">12<br>
+      </td>
+      <td valign=\"top\">Dryness fraction<br>
+     </td>
+     <td valign=\"top\">x<br>
+     </td>
+     <td valign=\"top\">kg/kg<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">13<br>
+      </td>
+      <td valign=\"top\">Specific Helmholtz free energy,     f = u - Ts</td>
+     <td valign=\"top\">f<br>
+     </td>
+     <td valign=\"top\">J/kg<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">14<br>
+      </td>
+      <td valign=\"top\">Specific Gibbs free energy,     g = h - Ts</td>
+     <td valign=\"top\">g<br>
+     </td>
+     <td valign=\"top\">J/kg<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">15<br>
+      </td>
+      <td valign=\"top\">Isenthalpic exponent, <nobr> theta     = -(v/p)(dp/dv)<font
+ size=\"-1\"><sub>h</sub></font></nobr></td>
+     <td valign=\"top\">theta (<font face=\"Symbol\">q</font>)<br>
+     </td>
+     <td valign=\"top\">1<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">16<br>
+      </td>
+      <td valign=\"top\">Isobaric volume expansion coefficient,     alpha = v<font
+ size=\"-1\"><sup>-1</sup></font>       (dv/dT)<font size=\"-1\"><sub>p</sub>
+    </font></td>
+     <td valign=\"top\">alpha  (<font face=\"Symbol\">a</font>)<br>
+     </td>
+       <td valign=\"top\">1/K<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">17<br>
+      </td>
+      <td valign=\"top\">Isochoric pressure coefficient,     <nobr>beta = p<font
+ size=\"-1\"><sup><font face=\"Symbol\">-</font>1</sup>     </font>(dp/dT)<font
+ size=\"-1\"><sub>v</sub></font></nobr>     </td>
+     <td valign=\"top\">beta (<font face=\"Symbol\">b</font>)<br>
+     </td>
+     <td valign=\"top\">1/K<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">18<br>
+      </td>
+      <td valign=\"top\">Isothermal compressibility,     g<nobr>amma  = <font
+ face=\"Symbol\">-</font>v        <sup><font size=\"-1\"><font face=\"Symbol\">-</font>1</font></sup>(dv/dp)<font
+ size=\"-1\"><sub>T</sub></font></nobr> </td>
+        <td valign=\"top\">gamma (<font face=\"Symbol\">g</font>)<br>
+     </td>
+     <td valign=\"top\">1/Pa<br>
+     </td>
+     </tr>
+     <!-- <tr><td valign=\"top\">f</td><td valign=\"top\">Fugacity</td></tr> --> <tr>
+     <td valign=\"top\">19<br>
+      </td>
+      <td valign=\"top\">Dynamic viscosity</td>
+     <td valign=\"top\">eta (<font face=\"Symbol\">h</font>)<br>
+     </td>
+     <td valign=\"top\">Pa s<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">20<br>
+      </td>
+      <td valign=\"top\">Kinematic viscosity</td>
+     <td valign=\"top\">nu (<font face=\"Symbol\">n</font>)<br>
+     </td>
+     <td valign=\"top\">m<sup>2</sup>/s<br>
+     </td>
+     </tr>
+     <!-- <tr><td valign=\"top\">Pr</td><td valign=\"top\">Prandtl number</td></tr> --> <tr>
+     <td valign=\"top\">21<br>
+      </td>
+      <td valign=\"top\">Thermal conductivity</td>
+     <td valign=\"top\">lambda (<font face=\"Symbol\">l</font>)<br>
+     </td>
+     <td valign=\"top\">W/(m K)<br>
+     </td>
+     </tr>
+     <tr>
+     <td valign=\"top\">22 <br>
+      </td>
+      <td valign=\"top\">Surface tension</td>
+     <td valign=\"top\">sigma (<font face=\"Symbol\">s</font>)<br>
+     </td>
+     <td valign=\"top\">N/m<br>
+     </td>
+     </tr>
+  </tbody>
+</table>
+        <p>The properties 1-11 are calculated by default with the functions for dynamic
+        simulation, 2 of these variables are the dynamic states and are the inputs
+        to calculate all other properties. In addition to these properties
+        of general interest, the entries to the thermodynamic Jacobian matrix which render
+        the mass- and energy balances explicit in the input variables to the property calculation are also calculated.
+        For an explanatory example using pressure and specific enthalpy as states, see the Examples sub-package.</p>
+        <p>The high-level calls to steam properties are grouped into records comprising both the properties of general interest
+        and the entries to the thermodynamic Jacobian. If additional properties are
+        needed the low level functions in BaseIF97 provide more choice.</p>
+        <HR size=3 width=\"90%\">
+        <h4>Additional functions</h4>
+        <ul>
+        <li>Function <b>boundaryvals_p</b> computes the temperature and the specific enthalpy and
+        entropy on both phase boundaries as a function of p</li>
+        <li>Function <b>boundaryderivs_p</b> is the Modelica derivative function of <b>boundaryvals_p</b></li>
+        <li>Function <b>extraDerivs_ph</b> computes all entries to Bridgmans tables for all
+        one-phase regions of IF97 using inputs (p,h). All 336 directional derivatives of the
+        thermodynamic surface can be computed as a ratio of two entries in the return data, see package Common
+        for details.</li>
+        <li>Function <b>extraDerivs_pT</b> computes all entries to Bridgmans tables for all
+        one-phase regions of IF97 using inputs (p,T).</li>
+        </ul>
+        </p>
+        </HTML>"), Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end BaseIF97;
diff --git a/ThermoSysPro/Properties/WaterSteam/Common.mo b/ThermoSysPro/Properties/WaterSteam/Common.mo
index 6f3f645596263413dc1093285a7b08917dde433d..2484169bb5eaefa01e84b72649c28ccf0848e465 100644
--- a/ThermoSysPro/Properties/WaterSteam/Common.mo
+++ b/ThermoSysPro/Properties/WaterSteam/Common.mo
@@ -1,1779 +1,1779 @@
-within ThermoSysPro.Properties.WaterSteam;
-package Common
-  import      ThermoSysPro.Units.SI;
-
-  record HelmholtzData
-    Units.SI.Density d;
-    Units.SI.Temperature T;
-    Units.SI.SpecificHeatCapacity R;
-    annotation (
-      Window(
-        x=0.16,
-        y=0.26,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name"),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end HelmholtzData;
-
-  record GibbsData
-    Units.SI.AbsolutePressure p;
-    Units.SI.Temperature T;
-    Units.SI.SpecificHeatCapacity R;
-    annotation (
-      Window(
-        x=0.16,
-        y=0.26,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name"),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end GibbsData;
-
-  record GibbsDerivs
-    "derivatives of dimensionless Gibbs-function w.r.t dimensionless pressure and temperature"
-    extends Modelica.Icons.Record;
-    Units.SI.Pressure p "pressure";
-    Units.SI.Temperature T "temperature";
-    Units.SI.SpecificHeatCapacity R "specific heat capacity";
-    Real pi(unit="1") "dimensionless pressure";
-    Real tau(unit="1") "dimensionless temperature";
-    Real g(unit="1") "dimensionless Gibbs-function";
-    Real gpi(unit="1") "derivative of g w.r.t. pi";
-    Real gpipi(unit="1") "2nd derivative of g w.r.t. pi";
-    Real gtau(unit="1") "derivative of g w.r.t. tau";
-    Real gtautau(unit="1") "2nd derivative of g w.r.t tau";
-    Real gtaupi(unit="1") "mixed derivative of g w.r.t. pi and tau";
-  end GibbsDerivs;
-
-  record HelmholtzDerivs
-    "derivatives of dimensionless Helmholtz-function w.r.t dimensionless pressuredensity and temperature"
-    extends Modelica.Icons.Record;
-    Units.SI.Density d "density";
-    Units.SI.Temperature T "temperature";
-    Units.SI.SpecificHeatCapacity R "specific heat capacity";
-    Real delta(unit="1") "dimensionless density";
-    Real tau(unit="1") "dimensionless temperature";
-    Real f(unit="1") "dimensionless Helmholtz-function";
-    Real fdelta(unit="1") "derivative of f w.r.t. delta";
-    Real fdeltadelta(unit="1") "2nd derivative of f w.r.t. delta";
-    Real ftau(unit="1") "derivative of f w.r.t. tau";
-    Real ftautau(unit="1") "2nd derivative of f w.r.t. tau";
-    Real fdeltatau(unit="1") "mixed derivative of f w.r.t. delta and tau";
-  end HelmholtzDerivs;
-
-  record ThermoProperties_ph
-    Units.SI.Temperature T(
-      min=InitLimits.TMIN,
-      max=InitLimits.TMAX,
-      nominal=InitLimits.TNOM) "Temperature";
-    Units.SI.Density d(
-      min=InitLimits.DMIN,
-      max=InitLimits.DMAX,
-      nominal=InitLimits.DNOM) "Density";
-    Units.SI.SpecificEnergy u(
-      min=InitLimits.SEMIN,
-      max=InitLimits.SEMAX,
-      nominal=InitLimits.SENOM) "Specific inner energy";
-    Units.SI.SpecificEntropy s(
-      min=InitLimits.SSMIN,
-      max=InitLimits.SSMAX,
-      nominal=InitLimits.SSNOM) "Specific entropy";
-    Units.SI.SpecificHeatCapacity cp(
-      min=InitLimits.CPMIN,
-      max=InitLimits.CPMAX,
-      nominal=InitLimits.CPNOM) "Specific heat capacity at constant presure";
-    Units.SI.DerDensityByEnthalpy ddhp
-      "Derivative of density wrt. specific enthalpy at constant pressure";
-    Units.SI.DerDensityByPressure ddph
-      "Derivative of density wrt. pressure at constant specific enthalpy";
-    Real duph(unit="m3/kg")
-      "Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
-    Real duhp(unit = "1")
-      "Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
-    ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
-    annotation (
-      Window(
-        x=0.21,
-        y=0.32,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name"),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end ThermoProperties_ph;
-
-  function gibbsToProps_ph
-    input GibbsDerivs g "dimensionless derivatives of the Gibbs function";
-    output ThermoProperties_ph pro;
-  protected
-    Real vt;
-    Real vp;
-  algorithm
-    pro.T := min(max(g.T, InitLimits.TMIN), InitLimits.TMAX);
-    pro.d := max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)/(g.R*pro.T*g.pi*g.gpi);
-    pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-    pro.s := g.R*(g.tau*g.gtau - g.g);
-    pro.cp := -g.R*g.tau*g.tau*g.gtautau;
-    vt := g.R/max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-    vp := g.R*g.T/(max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
-          *max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple))*g.pi*g.pi*g.gpipi;
-    pro.ddhp := -pro.d*pro.d*vt/(pro.cp);
-    pro.ddph := -pro.d*pro.d*(vp*pro.cp - vt/pro.d + g.T*vt*vt)/pro.cp;
-    pro.duph := -1/pro.d + g.p/(pro.d*pro.d)*pro.ddph;
-    pro.duhp := 1 + g.p/(pro.d*pro.d)*pro.ddhp;
-    annotation (
-      Window(
-        x=0.05,
-        y=0.05,
-        width=0.54,
-        height=0.72),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-132,102},{144,42}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"),   DymolaStoredErrors,
-      Diagram(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics));
-  end gibbsToProps_ph;
-
-  record NewtonDerivatives_ph
-    Units.SI.AbsolutePressure p;
-    Units.SI.SpecificEnthalpy h;
-    Real pd;
-    Real pt;
-    Real hd;
-    Real ht;
-    annotation (
-      Window(
-        x=0.25,
-        y=0.33,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name"),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end NewtonDerivatives_ph;
-
-  function helmholtzToProps_ph
-    input HelmholtzDerivs f
-      "dimensionless derivatives of the Helmholtz function";
-    output ThermoProperties_ph pro;
-  protected
-    Real pd;
-    Real pt;
-  protected
-   Real cv "Heat capacity at constant volume";
-  algorithm
-    pro.d := f.d;
-    pro.T := f.T;
-    pro.s := f.R*(f.tau*f.ftau - f.f);
-    pro.u := f.R*f.T*f.tau*f.ftau;
-    cv := f.R*(-f.tau*f.tau*f.ftautau);
-    // calculating cp near the critical point may be troublesome (cp -> inf).
-    pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
-              *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-    pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    pro.ddph := (f.d*(cv*f.d + pt))/(f.d*f.d*pd*cv + f.T*pt*pt);
-    pro.ddhp := -f.d*f.d*pt/(f.d*f.d*pd*cv + f.T*pt*pt);
-    annotation (
-      Icon(graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"),   Diagram(graphics));
-  end helmholtzToProps_ph;
-
-  record PhaseBoundaryProperties
-    "thermodynamic base properties on the phase boundary"
-    extends Modelica.Icons.Record;
-    Units.SI.Density d "density";
-    Units.SI.SpecificEnthalpy h "specific enthalpy";
-    Units.SI.SpecificEnergy u "inner energy";
-    Units.SI.SpecificEntropy s "specific entropy";
-    Units.SI.SpecificHeatCapacity cp "heat capacity at constant pressure";
-    Units.SI.SpecificHeatCapacity cv "heat capacity at constant volume";
-    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-      "derivative of pressure wrt temperature";
-    ThermoSysPro.Units.xSI.DerPressureByDensity pd
-      "derivative of pressure wrt density";
-  end PhaseBoundaryProperties;
-
-  function gibbsToBoundaryProps
-    "calulate phase boundary property record from dimensionless Gibbs function"
-
-    extends Modelica.Icons.Function;
-    input GibbsDerivs g "dimensionless derivatives of Gibbs function";
-    output PhaseBoundaryProperties sat "phase boundary properties";
-  protected
-    Real vt "derivative of specific volume w.r.t. temperature";
-    Real vp "derivative of specific volume w.r.t. pressure";
-  algorithm
-    sat.d := g.p/(g.R*g.T*g.pi*g.gpi);
-    sat.h := g.R*g.T*g.tau*g.gtau;
-    sat.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-    sat.s := g.R*(g.tau*g.gtau - g.g);
-    sat.cp := -g.R*g.tau*g.tau*g.gtautau;
-    sat.cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi - g.
-       tau*g.gtaupi)/(g.gpipi));
-    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-    // sat.kappa := -1/(sat.d*g.p)*sat.cp/(vp*sat.cp + vt*vt*g.T);
-    sat.pt := -g.p/g.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
-    sat.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-  end gibbsToBoundaryProps;
-
-  function helmholtzToBoundaryProps
-    "calulate phase boundary property record from dimensionless Helmholtz function"
-
-    extends Modelica.Icons.Function;
-    input HelmholtzDerivs f "dimensionless derivatives of Helmholtz function";
-    output PhaseBoundaryProperties sat "phase boundary property record";
-  protected
-    Units.SI.Pressure p "pressure";
-  algorithm
-    p := f.R*f.d*f.T*f.delta*f.fdelta;
-    sat.d := f.d;
-    sat.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
-    sat.s := f.R*(f.tau*f.ftau - f.f);
-    sat.u := f.R*f.T*f.tau*f.ftau;
-    sat.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau*f.
-       fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-    sat.cv := f.R*(-f.tau*f.tau*f.ftautau);
-    sat.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    sat.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-  end helmholtzToBoundaryProps;
-
-  function HelmholtzOfph
-
-  protected
-    Units.SI.SpecificHeatCapacity cv;
-  public
-    input HelmholtzDerivs f
-      "Dérivées adimensionnelles de la fonction de Helmholtz"
-      annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=
-             0)));
-    input HelmholtzData dTR annotation (Placement(transformation(extent={{15,15},
-              {85,85}}, rotation=0)));
-    output NewtonDerivatives_ph nderivs annotation (Placement(transformation(
-            extent={{-85,-85},{-15,-15}}, rotation=0)));
-  algorithm
-    cv := -dTR.R*(f.tau*f.tau*f.ftautau);
-    nderivs.p := dTR.d*dTR.R*dTR.T*f.delta*f.fdelta;
-    nderivs.h := dTR.R*dTR.T*(f.tau*f.ftau + f.delta*f.fdelta);
-    nderivs.pd := dTR.R*dTR.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    nderivs.pt := dTR.R*dTR.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    nderivs.ht := cv + nderivs.pt/dTR.d;
-    nderivs.hd := (nderivs.pd - dTR.T*nderivs.pt/dTR.d)/dTR.d;
-    annotation (
-      Window(
-        x=0.09,
-        y=0.21,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end HelmholtzOfph;
-
-  function cv2Phase
-    input PhaseBoundaryProperties liq;
-    input PhaseBoundaryProperties vap;
-    input Real x "Vapor mass fraction";
-    input Units.SI.Temperature T;
-    input Units.SI.AbsolutePressure p;
-    output Units.SI.SpecificHeatCapacity cv;
-
-  protected
-    Real dpT;
-    Real dxv;
-    Real dvT;
-    Real dvTl;
-    Real dvTv;
-    Real duTl;
-    Real duTv;
-    Real dxt;
-  algorithm
-    dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d - vap.d) else 0.0;
-    dpT := (vap.s - liq.s)*dxv;
-    // wrong at critical point
-    dvTl := (liq.pt - dpT)/liq.pd/liq.d/liq.d;
-    dvTv := (vap.pt - dpT)/vap.pd/vap.d/vap.d;
-    dxt := -dxv*(dvTl + x*(dvTv - dvTl));
-    duTl := liq.cv + (T*liq.pt - p)*dvTl;
-    duTv := vap.cv + (T*vap.pt - p)*dvTv;
-    cv := duTl + x*(duTv - duTl) + dxt*(vap.u - liq.u);
-    annotation (
-      Window(
-        x=0.08,
-        y=0.14,
-        width=0.6,
-        height=0.61),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end cv2Phase;
-
-  record NewtonDerivatives_ps
-    Units.SI.AbsolutePressure p;
-    Units.SI.SpecificEntropy s;
-    Real pd;
-    Real pt;
-    Real sd;
-    Real st;
-    annotation (
-      Window(
-        x=0.15,
-        y=0.3,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end NewtonDerivatives_ps;
-
-  function HelmholtzOfps
-
-  protected
-    Units.SI.SpecificHeatCapacity cv;
-  public
-    input HelmholtzDerivs f
-      "Dérivées adimensionnelles de la fonction de Helmholtz"
-      annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=
-             0)));
-    input HelmholtzData dTR annotation (Placement(transformation(extent={{15,15},
-              {85,85}}, rotation=0)));
-    output NewtonDerivatives_ps nderivs annotation (Placement(transformation(
-            extent={{-85,-85},{-15,-15}}, rotation=0)));
-  algorithm
-
-    cv := -dTR.R*(f.tau*f.tau*f.ftautau);
-    nderivs.p := dTR.d*dTR.R*dTR.T*f.delta*f.fdelta;
-    nderivs.s := dTR.R*(f.tau*f.ftau - f.f);
-    nderivs.pd := dTR.R*dTR.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    nderivs.pt := dTR.R*dTR.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    nderivs.st := cv/dTR.T;
-    nderivs.sd := -nderivs.pt/(dTR.d*dTR.d);
-    annotation (
-      Window(
-        x=0.03,
-        y=0.14,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end HelmholtzOfps;
-
-  record PropThermoSat
-    Units.SI.AbsolutePressure P "Pressure";
-    Units.SI.Temperature T "Temperature";
-    Units.SI.Density rho "Density";
-    Units.SI.SpecificEnthalpy h "Specific enthalpy";
-    Units.SI.SpecificHeatCapacity cp
-      "Specific heat capacity at constant pressure";
-    Real pt "Derivative of pressure wrt. temperature";
-    Units.SI.SpecificHeatCapacity cv
-      "Specific heat capacity at constant volume";
-    /*
-  Modelica.SIunits.SpecificEnergy u "Specific inner energy";
-  Modelica.SIunits.SpecificEntropy s "Specific entropy";
-  Real pd "Derivative of pressure wrt. density";
-  */
-    annotation (
-      Window(
-        x=0.15,
-        y=0.32,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name"),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end PropThermoSat;
-
-  function gibbsRho
-    input Units.SI.AbsolutePressure P "Pressure";
-    input Units.SI.Temperature T "Temperature";
-
-    output Units.SI.Density rho "density";
-    input GibbsDerivs g "Dérivées de la fonction de Gibbs"
-      annotation (Placement(transformation(extent={{-70,-70},{70,70}}, rotation=
-             0)));
-  algorithm
-
-    rho := max(P, ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)/(ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O
-           *max(T, ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.Ttriple)*g.pi*g.gpi);
-    annotation (
-      Window(
-        x=0.2,
-        y=0.26,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end gibbsRho;
-
-  function gibbsPropsSat
-    input Units.SI.AbsolutePressure P "Pressure";
-    input Units.SI.Temperature T "Temperature";
-
-    input GibbsDerivs g "Dérivées de la fonction de Gibbs"
-      annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=
-             0)));
-    output PropThermoSat sat annotation (Placement(transformation(extent={{15,
-              15},{85,85}}, rotation=0)));
-  algorithm
-
-    sat.P := max(P,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple);
-    sat.T := max(T,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.Ttriple);
-    sat.rho := sat.P/(ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*sat.T*g.pi*g.gpi);
-    sat.h := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*sat.T*g.tau*g.gtau;
-    /*
-  sat.u := sat.T*ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*(g.tau*g.gtau - g.pi*g.gpi);
-  sat.s := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*(g.tau*g.gtau - g.g);
-  */
-    sat.cp := -ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*g.tau*g.tau*g.gtautau;
-    /*
-  sat.cv :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O
-           *(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/(g.gpipi));
-  sat.pt := -sat.P/sat.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
-  sat.pd := -ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*sat.T*g.gpi*g.gpi/(g.gpipi);
-  */
-    annotation (
-      Window(
-        x=0.25,
-        y=0.27,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end gibbsPropsSat;
-
-  function gibbsToProps_pT
-    input GibbsDerivs g "dimensionless derivatives of the Gibbs funciton";
-    output ThermoProperties_pT pro;
-  protected
-    Real vt;
-    Real vp;
-
-  algorithm
-    pro.d := max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
-             /(g.R*g.T*g.pi*g.gpi);
-    pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-    pro.h := g.R*g.T*g.tau*g.gtau;
-    pro.s := g.R*(g.tau*g.gtau - g.g);
-    pro.cp := -g.R*g.tau*g.tau*g.gtautau;
-    vt := g.R/max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
-          *(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-    vp := g.R*g.T/(max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
-          *max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple))*g.pi*g.pi*g.gpipi;
-    pro.ddpT := -(pro.d*pro.d)*vp;
-    pro.ddTp := -(pro.d*pro.d)*vt;
-    pro.duTp := pro.cp - g.p*vt;
-    pro.dupT := -g.T*vt - g.p*vp;
-    annotation (
-      Window(
-        x=0.06,
-        y=0.13,
-        width=0.73,
-        height=0.76),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end gibbsToProps_pT;
-
-  record ThermoProperties_pT
-    Units.SI.Density d(
-      min=InitLimits.DMIN,
-      max=InitLimits.DMAX,
-      nominal=InitLimits.DNOM) "Density";
-    Units.SI.SpecificEnthalpy h(
-      min=InitLimits.SHMIN,
-      max=InitLimits.SHMAX,
-      nominal=InitLimits.SHNOM) "Specific enthalpy";
-    Units.SI.SpecificEnergy u(
-      min=InitLimits.SEMIN,
-      max=InitLimits.SEMAX,
-      nominal=InitLimits.SENOM) "Specific inner energy";
-    Units.SI.SpecificEntropy s(
-      min=InitLimits.SSMIN,
-      max=InitLimits.SSMAX,
-      nominal=InitLimits.SSNOM) "Specific entropy";
-    Units.SI.SpecificHeatCapacity cp(
-      min=InitLimits.CPMIN,
-      max=InitLimits.CPMAX,
-      nominal=InitLimits.CPNOM) "Specific heat capacity at constant presure";
-    Units.SI.DerDensityByTemperature ddTp
-      "Derivative of the density wrt. temperature at constant pressure";
-    Units.SI.DerDensityByPressure ddpT
-      "Derivative of the density wrt. presure at constant temperature";
-    Units.SI.DerEnergyByPressure dupT
-      "Derivative of the inner energy wrt. pressure at constant temperature";
-    Units.SI.SpecificHeatCapacity duTp
-      "Derivative of the inner energy wrt. temperature at constant pressure";
-    ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
-    annotation (
-      Window(
-        x=0.23,
-        y=0.19,
-        width=0.68,
-        height=0.71),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name"),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end ThermoProperties_pT;
-
-  function gibbsToProps_ps
-    input GibbsDerivs g "dimensionless derivatives of the Gibbs function";
-    output ThermoProperties_ps pro;
-  protected
-    Real vt;
-    Real vp;
-  algorithm
-
-    pro.T := g.T;
-    pro.d := g.p/(g.R*pro.T*g.pi*g.gpi);
-    pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-    pro.h := g.R*g.T*g.tau*g.gtau;
-    pro.cp := -g.R*g.tau*g.tau*g.gtautau;
-    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-    pro.ddsp := -pro.d*pro.d*vt*g.T/(pro.cp);
-    pro.ddps := -pro.d*pro.d*(vp + g.T*vt*vt/pro.cp);
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Window(
-        x=0.13,
-        y=0.26,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end gibbsToProps_ps;
-
-  record ThermoProperties_ps
-    Units.SI.Temperature T(
-      min=InitLimits.TMIN,
-      max=InitLimits.TMAX,
-      nominal=InitLimits.TNOM) "Temperature";
-    Units.SI.Density d(
-      min=InitLimits.DMIN,
-      max=InitLimits.DMAX,
-      nominal=InitLimits.DNOM) "Density";
-    Units.SI.SpecificEnergy u(
-      min=InitLimits.SEMIN,
-      max=InitLimits.SEMAX,
-      nominal=InitLimits.SENOM) "Specific inner energy";
-    Units.SI.SpecificEnthalpy h(
-      min=InitLimits.SHMIN,
-      max=InitLimits.SHMAX,
-      nominal=InitLimits.SHNOM) "Specific enthalpy";
-    Units.SI.SpecificHeatCapacity cp(
-      min=InitLimits.CPMIN,
-      max=InitLimits.CPMAX,
-      nominal=InitLimits.CPNOM) "Specific heat capacity at constant pressure";
-    ThermoSysPro.Units.xSI.DerDensityByEntropy ddsp
-      "Derivative of the density wrt. specific entropy at constant pressure";
-    Units.SI.DerDensityByPressure ddps
-      "Derivative of the density wrt. pressure at constant specific entropy";
-    ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
-    annotation (
-      Window(
-        x=0.31,
-        y=0.2,
-        width=0.6,
-        height=0.6),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name"),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.5</b></p>
-</HTML>
-"));
-  end ThermoProperties_ps;
-
-  function helmholtzToProps_ps
-    input HelmholtzDerivs f
-      "dimensionless derivatives of the Helmholtz function";
-    output ThermoProperties_ps pro;
-  protected
-    Real pd;
-    Real pt;
-  protected
-    Real cv "Heat capacity at constant volume";
-  algorithm
-
-    pro.d := f.d;
-    pro.T := f.T;
-    pro.u := f.R*f.T*f.tau*f.ftau;
-    pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
-
-    // calculating cp near the critical point may be troublesome (cp -> inf).
-    pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
-      *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-    cv := f.R*(-f.tau*f.tau*f.ftautau);
-    pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    pro.ddps := f.d*f.d*cv/(pd*f.d*f.d*cv + pt*pt*f.T);
-    pro.ddsp := -f.d*f.d*pt*f.T/(f.d*f.d*pd*cv + f.T*pt*pt);
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Window(
-        x=0.13,
-        y=0.25,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end helmholtzToProps_ps;
-
-  function gibbsToProps_dT
-    input GibbsDerivs g;
-    output ThermoProperties_dT pro;
-  protected
-    Real vt "derivative of specific volume w.r.t. temperature";
-    Real vp "derivative of specific volume w.r.t. pressure";
-  algorithm
-    pro.p := g.p;
-    pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-    pro.h := g.R*g.T*g.tau*g.gtau;
-    pro.s := g.R*(g.tau*g.gtau - g.g);
-    pro.cp := -g.R*g.tau*g.tau*g.gtautau;
-    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-    pro.dudT := pro.cp + g.T*vt*vt/vp;
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Window(
-        x=0.08,
-        y=0.23,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end gibbsToProps_dT;
-
-  record ThermoProperties_dT
-    Units.SI.AbsolutePressure p(
-      min=InitLimits.PMIN,
-      max=InitLimits.PMAX,
-      nominal=InitLimits.PNOM) "Pressure";
-    Units.SI.SpecificEnthalpy h(
-      min=InitLimits.SHMIN,
-      max=InitLimits.SHMAX,
-      nominal=InitLimits.SHNOM) "Specific enthalpy";
-    Units.SI.SpecificEnergy u(
-      min=InitLimits.SEMIN,
-      max=InitLimits.SEMAX,
-      nominal=InitLimits.SENOM) "Specific inner energy";
-    Units.SI.SpecificEntropy s(
-      min=InitLimits.SSMIN,
-      max=InitLimits.SSMAX,
-      nominal=InitLimits.SSNOM) "Specific entropy";
-    Units.SI.SpecificHeatCapacity cp(
-      min=InitLimits.CPMIN,
-      max=InitLimits.CPMAX,
-      nominal=InitLimits.CPNOM) "Specific heat capacity at constant pressure";
-    Real dudT
-      "Derivative of the inner energy wrt. density at constant temperature";
-    ThermoSysPro.Units.SI.MassFraction x "Vapor mas fraction";
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0}),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end ThermoProperties_dT;
-
-  function helmholtzToProps_dT
-    input HelmholtzDerivs f;
-    output ThermoProperties_dT pro;
-  protected
-    Real pt "derivative of presure w.r.t. temperature";
-    Real pv "derivative of pressure w.r.t. specific volume";
-
-  algorithm
-    pro.p := f.R*f.d*f.T*f.delta*f.fdelta;
-    pro.s := f.R*(f.tau*f.ftau - f.f);
-    pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
-    pro.u := f.R*f.T*f.tau*f.ftau;
-    pv := -1/(f.d*f.d)*f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.
-      fdeltadelta);
-    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    // calculating cp near the critical point may be troublesome (cp -> inf).
-    pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
-      *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-    pro.dudT := (pro.p - f.T*pt)/(f.d*f.d);
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Window(
-        x=0.09,
-        y=0.22,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end helmholtzToProps_dT;
-
-  record NewtonDerivatives_pT
-    Units.SI.AbsolutePressure p "Pressure";
-    ThermoSysPro.Units.xSI.DerPressureByDensity pd
-      "derivative of pressure wrt. density";
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Rectangle(
-            extent={{-100,50},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,127},
-            fillPattern=FillPattern.Solid),
-          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-          Line(points={{-100,0},{100,0}}, color={0,0,0}),
-          Line(points={{0,50},{0,-100}}, color={0,0,0}),
-          Text(extent={{-127,115},{127,55}}, textString=
-                                                 "%name")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end NewtonDerivatives_pT;
-
-  function HelmholtzOfpT
-
-    input HelmholtzDerivs f;
-    output NewtonDerivatives_pT nderivs annotation (Placement(transformation(
-            extent={{-85,-85},{-15,-15}}, rotation=0)));
-  algorithm
-
-    nderivs.p := f.d*f.R*f.T*f.delta*f.fdelta;
-    nderivs.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Window(
-        x=0.11,
-        y=0.25,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end HelmholtzOfpT;
-
-  function helmholtzToProps_pT
-    input HelmholtzDerivs f;
-    output ThermoProperties_pT pro;
-  protected
-    Real pd "derivative of pressure wrt. density";
-    Real pt "derivative of pressure wrt. temperature";
-    Real pv "derivative of pressure wrt. specific volume";
-  protected
-   Real cv "Heat capacity at constant volume";
-  algorithm
-
-    pro.d := f.d;
-    pro.s := f.R*(f.tau*f.ftau - f.f);
-    pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
-    pro.u := f.R*f.T*f.tau*f.ftau;
-    pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    cv := f.R*(-f.tau*f.tau*f.ftautau);
-    pv := -1/(f.d*f.d)*pd;
-    // calculating cp near the critical point may be troublesome (cp -> inf).
-    pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
-      *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-    pro.ddTp := -pt/pd;
-    pro.ddpT := 1/pd;
-    pro.dupT := (f.d - f.T*pt)/(f.d*f.d*pd);
-    pro.duTp := (-cv*f.d*f.d*pd + pt*f.d - f.T*pt*pt)/(f.d*f.d*
-      pd);
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction"),
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name")}),
-      Window(
-        x=0.32,
-        y=0.14,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end helmholtzToProps_pT;
-
-  record miniProp "Test record for derivatives"
-    Units.SI.Temperature T "Temperature";
-    Units.SI.Density d "Density";
-  end miniProp;
-
-  record IF97PhaseBoundaryProperties
-    "thermodynamic base properties on the phase boundary for IF97 steam tables"
-    extends Modelica.Icons.Record;
-    Units.SI.SpecificHeatCapacity R "specific heat capacity";
-    Units.SI.Temperature T "temperature";
-    Units.SI.Density d "density";
-    Units.SI.SpecificEnthalpy h "specific enthalpy";
-    Units.SI.SpecificEntropy s "specific entropy";
-    Units.SI.SpecificHeatCapacity cp "heat capacity at constant pressure";
-    Units.SI.SpecificHeatCapacity cv "heat capacity at constant volume";
-    ThermoSysPro.Units.xSI.DerPressureByTemperature dpT
-      "dp/dT derivative of saturation curve";
-    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-      "derivative of pressure wrt temperature";
-    ThermoSysPro.Units.xSI.DerPressureByDensity pd
-      "derivative of pressure wrt density";
-    Real vt(unit="m3/(kg.K)")
-      "derivative of specific volume w.r.t. temperature";
-    Real vp(unit="m3/(kg.Pa)") "derivative of specific volume w.r.t. pressure";
-  end IF97PhaseBoundaryProperties;
-
-  function water_ph_r4
-    input Units.SI.AbsolutePressure p;
-    input Units.SI.SpecificEnthalpy h;
-
-  protected
-    Real x;
-    Real dpT;
-  public
-    output ThermoProperties_ph pro;
-  protected
-    PhaseBoundaryProperties liq;
-    PhaseBoundaryProperties vap;
-    GibbsDerivs gl;
-    GibbsDerivs gv;
-    HelmholtzDerivs fl;
-    HelmholtzDerivs fv;
-    Units.SI.Density dl;
-    Units.SI.Density dv;
-    Real cv "Heat capacity at constant volume";
-  algorithm
-    pro.T := BaseIF97.Basic.tsat(p);
-    dpT := BaseIF97.Basic.dptofT(pro.T);
-    dl := BaseIF97.Regions.rhol_p_R4b(p);
-    dv := BaseIF97.Regions.rhov_p_R4b(p);
-    if p < BaseIF97.data.PLIMIT4A then
-      gl := BaseIF97.Basic.g1(p, pro.T);
-      gv := BaseIF97.Basic.g2(p, pro.T);
-      liq := gibbsToBoundaryProps(gl);
-      vap := gibbsToBoundaryProps(gv);
-    else
-      fl := BaseIF97.Basic.f3(dl, pro.T);
-      fv := BaseIF97.Basic.f3(dv, pro.T);
-      liq := helmholtzToBoundaryProps(fl);
-      vap := helmholtzToBoundaryProps(fv);
-    end if;
-    x := if (vap.h <> liq.h) then (h - liq.h)/(vap.h - liq.h) else 1.0;
-    cv := cv2Phase(
-        liq=liq,
-        vap=vap,
-        x=x,
-        p=p,
-        T=pro.T);
-    pro.d := liq.d*vap.d/(vap.d + x*(liq.d - vap.d));
-    pro.x := x;
-    pro.u := x*vap.u + (1 - x)*liq.u;
-    pro.s := x*vap.s + (1 - x)*liq.s;
-    pro.cp := x*vap.cp + (1 - x)*liq.cp;
-    pro.ddph := pro.d*(pro.d*cv/dpT + 1.0)/(dpT*pro.T);
-    pro.ddhp := -pro.d*pro.d/(dpT*pro.T);
-    annotation (
-      Icon(graphics={
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name"),
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.2</b></p>
-</HTML>
-"));
-  end water_ph_r4;
-
-  function water_ps_r4
-    input Units.SI.AbsolutePressure p "pressure";
-    input Units.SI.SpecificEntropy s "specific entropy";
-
-  protected
-    Real x;
-    Real dpT;
-  public
-    output ThermoProperties_ps pro;
-  protected
-    PhaseBoundaryProperties liq;
-    PhaseBoundaryProperties vap;
-    GibbsDerivs gl
-      "dimensionless Gibbs function and derivatives wrt dimensionless presure and temperature";
-    GibbsDerivs gv
-      "dimensionless Gibbs function and derivatives wrt dimensionless presure and temperature";
-    HelmholtzDerivs fl
-      "dimensionless Helmholtz function and derivatives wrt dimensionless presure and temperature";
-    HelmholtzDerivs fv
-      "dimensionless Helmholtz function and derivatives wrt dimensionless presure and temperature";
-    Real cv "Heat capacity at constant volume";
-    Units.SI.Density dl;
-    Units.SI.Density dv;
-  algorithm
-
-    pro.T := BaseIF97.Basic.tsat(p);
-    dpT := BaseIF97.Basic.dptofT(pro.T);
-
-    dl := BaseIF97.Regions.rhol_p_R4b(p);
-    dv := BaseIF97.Regions.rhov_p_R4b(p);
-    if p < BaseIF97.data.PLIMIT4A then
-      gl := BaseIF97.Basic.g1(p, pro.T);
-      gv := BaseIF97.Basic.g2(p, pro.T);
-      liq := gibbsToBoundaryProps(gl);
-      vap := gibbsToBoundaryProps(gv);
-    else
-      fl := BaseIF97.Basic.f3(dl, pro.T);
-      fv := BaseIF97.Basic.f3(dv, pro.T);
-      liq := helmholtzToBoundaryProps(fl);
-      vap := helmholtzToBoundaryProps(fv);
-    end if;
-    x := if (vap.s <> liq.s) then (s - liq.s)/(vap.s - liq.s) else 1.0;
-    pro.x := x;
-    pro.d := liq.d*vap.d/(vap.d + x*(liq.d - vap.d));
-    pro.u := x*vap.u + (1 - x)*liq.u;
-    pro.h := x*vap.h + (1 - x)*liq.h;
-    pro.cp := Modelica.Constants.inf;
-    cv := cv2Phase(
-        liq,
-        vap,
-        x,
-        pro.T,
-        p);
-    pro.ddps := cv*pro.d*pro.d/(dpT*dpT*pro.T);
-    pro.ddsp := -pro.d*pro.d/dpT;
-    annotation (
-      Icon(graphics={
-          Text(extent={{-134,104},{142,44}}, textString=
-                                                 "%name"),
-          Ellipse(
-            extent={{-100,40},{100,-100}},
-            lineColor={255,127,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Text(
-            extent={{-84,-4},{84,-52}},
-            lineColor={255,127,0},
-            textString=
-                 "fonction")}),
-      Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-  end water_ps_r4;
-
-  record IF97TwoPhaseAnalytic
-    "Intermediate property data record for IF97, analytic Jacobian version"
-    extends Modelica.Icons.Record;
-    Integer phase "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-    Integer region(min=1, max=5) "IF 97 region";
-    Units.SI.Pressure p "pressure";
-    Units.SI.Temperature T "temperature";
-    Units.SI.SpecificEnthalpy h "specific enthalpy";
-    Units.SI.SpecificHeatCapacity R "gas constant";
-    Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    Real cpt "derivative of cp w.r.t. temperature";
-    Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    Real cvt "derivative of cv w.r.t. temperature";
-    Units.SI.Density rho "density";
-    Units.SI.SpecificEntropy s "specific entropy";
-    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-      "derivative of pressure wrt temperature";
-    ThermoSysPro.Units.xSI.DerPressureByDensity pd
-      "derivative of pressure wrt density";
-    Real ptt "2nd derivative of pressure wrt temperature";
-    Real pdd "2nd derivative of pressure wrt density";
-    Real ptd "mixed derivative of pressure w.r.t. density and temperature";
-    Real vt "derivative of specific volume w.r.t. temperature";
-    Real vp "derivative of specific volume w.r.t. pressure";
-    Real vtt "2nd derivative of specific volume w.r.t. temperature";
-    Real vpp "2nd derivative of specific volume w.r.t. pressure";
-    Real vtp
-      "mixed derivative of specific volume w.r.t. pressure and temperature";
-    Real x "dryness fraction";
-    Real dpT "dp/dT derivative of saturation curve";
-  end IF97TwoPhaseAnalytic;
-
-  record IF97BaseTwoPhase "Intermediate property data record for IF 97"
-    extends Modelica.Icons.Record;
-    Integer phase "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-    Integer region(min=1, max=5) "IF 97 region";
-    Units.SI.Pressure p "pressure";
-    Units.SI.Temperature T "temperature";
-    Units.SI.SpecificEnthalpy h "specific enthalpy";
-    Units.SI.SpecificHeatCapacity R "gas constant";
-    Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    Units.SI.Density rho "density";
-    Units.SI.SpecificEntropy s "specific entropy";
-    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-      "derivative of pressure wrt temperature";
-    ThermoSysPro.Units.xSI.DerPressureByDensity pd
-      "derivative of pressure wrt density";
-    Real vt "derivative of specific volume w.r.t. temperature";
-    Real vp "derivative of specific volume w.r.t. pressure";
-    Real x "dryness fraction";
-    Real dpT "dp/dT derivative of saturation curve";
-  end IF97BaseTwoPhase;
-
-  record GibbsDerivs3rd
-    "derivatives of dimensionless Gibbs-function w.r.t dimensionless pressure and temperature, including 3rd derivatives"
-    extends Modelica.Icons.Record;
-    Units.SI.Pressure p "pressure";
-    Units.SI.Temperature T "temperature";
-    Units.SI.SpecificHeatCapacity R "specific heat capacity";
-    Real pi(unit="1") "dimensionless pressure";
-    Real tau(unit="1") "dimensionless temperature";
-    Real g(unit="1") "dimensionless Gibbs-function";
-    Real gpi(unit="1") "derivative of g w.r.t. pi";
-    Real gpipi(unit="1") "2nd derivative of g w.r.t. pi";
-    Real gpipipi(unit="1") "3rd derivative of g w.r.t. pi";
-    Real gtau(unit="1") "derivative of g w.r.t. tau";
-    Real gtautau(unit="1") "2nd derivative of g w.r.t tau";
-    Real gtautautau(unit="1") "3rd derivative of g w.r.t tau";
-    Real gpitau(unit="1") "mixed derivative of g w.r.t. pi and tau";
-    Real gpitautau(unit="1") "mixed derivative of g w.r.t. pi and tau (2nd)";
-    Real gpipitau(unit="1") "mixed derivative of g w.r.t. pi (2nd) and tau";
-  end GibbsDerivs3rd;
-
-  function gibbsToBoundaryProps3rd
-    "calulate phase boundary property record from dimensionless Gibbs function"
-    extends Modelica.Icons.Function;
-    input ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
-      "dimensionless derivatives of Gibbs function";
-    output ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
-      sat "phase boundary properties";
-  protected
-    Real v "specific volume";
-    Real vp3 "Third power of vp";
-    Real ivp3 "Inverse of third power of vp";
-  algorithm
-    sat.d := g.p/(g.R*g.T*g.pi*g.gpi);
-    sat.h := g.R*g.T*g.tau*g.gtau;
-    sat.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
-    sat.s := g.R*(g.tau*g.gtau - g.g);
-    sat.cp := -g.R*g.tau*g.tau*g.gtautau;
-    sat.cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gpitau)*(g.gpi - g.
-       tau*g.gpitau)/(g.gpipi));
-    sat.pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-    sat.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-    v := 1/sat.d;
-    sat.vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-    sat.vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
-    sat.vtt := g.R*g.pi/g.p*g.tau/g.T*g.tau*g.gpitautau;
-    sat.vtp := g.R*g.pi*g.pi/(g.p*g.p)*(g.gpipi - g.tau*g.gpipitau);
-    sat.vpp := g.R*g.T*g.pi*g.pi*g.pi/(g.p*g.p*g.p)*g.gpipipi;
-    sat.cpt := g.R*g.tau*g.tau/g.T*(2*g.gtautau + g.tau*g.gtautautau);
-    vp3 := sat.vp*sat.vp*sat.vp;
-    ivp3 := 1/vp3;
-    sat.ptt := -(sat.vtt*sat.vp*sat.vp -2.0*sat.vt*sat.vtp*sat.vp + sat.vt*sat.vt*sat.vpp)*ivp3;
-    sat.pdd := -sat.vpp*ivp3*v*v*v*v - 2*v*sat.pd "= pvv/d^4";
-    sat.ptd := (sat.vtp*sat.vp-sat.vt*sat.vpp)*ivp3/(sat.d*sat.d) "= -ptv/d^2";
-    sat.cvt := (vp3*sat.cpt + sat.vp*sat.vp*sat.vt*sat.vt + 3.0*sat.vp*sat.vp*g.T*sat.vt*sat.vtt - 3.0*sat.vtp*sat.vp*g.T*sat.vt*sat.vt + g.T*sat.vt*sat.vt*sat.vt*sat.vpp)*ivp3;
-  end gibbsToBoundaryProps3rd;
-
-  record HelmholtzDerivs3rd
-    "derivatives of dimensionless Helmholtz-function w.r.t dimensionless pressuredensity and temperature, including 3rd derivatives"
-    extends Modelica.Icons.Record;
-    Units.SI.Density d "density";
-    Units.SI.Temperature T "temperature";
-    Units.SI.SpecificHeatCapacity R "specific heat capacity";
-    Real delta(unit="1") "dimensionless density";
-    Real tau(unit="1") "dimensionless temperature";
-    Real f(unit="1") "dimensionless Helmholtz-function";
-    Real fdelta(unit="1") "derivative of f w.r.t. delta";
-    Real fdeltadelta(unit="1") "2nd derivative of f w.r.t. delta";
-    Real fdeltadeltadelta(unit="1") "3rd derivative of f w.r.t. delta";
-    Real ftau(unit="1") "derivative of f w.r.t. tau";
-    Real ftautau(unit="1") "2nd derivative of f w.r.t. tau";
-    Real ftautautau(unit="1") "3rd derivative of f w.r.t. tau";
-    Real fdeltatau(unit="1") "mixed derivative of f w.r.t. delta and tau";
-    Real fdeltadeltatau(unit="1")
-      "mixed derivative of f w.r.t. delta (2nd) and tau";
-    Real fdeltatautau(unit="1")
-      "mixed derivative of f w.r.t. delta and tau (2nd) ";
-  end HelmholtzDerivs3rd;
-
-  function helmholtzToBoundaryProps3rd
-    "calulate phase boundary property record from dimensionless Helmholtz function"
-
-    extends Modelica.Icons.Function;
-    input ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
-      "dimensionless derivatives of Helmholtz function";
-    output ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
-      sat "phase boundary property record";
-  protected
-    Units.SI.Pressure p "pressure";
-  algorithm
-    p := f.R*f.d*f.T*f.delta*f.fdelta;
-    sat.d := f.d;
-    sat.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
-    sat.s := f.R*(f.tau*f.ftau - f.f);
-    sat.u := f.R*f.T*f.tau*f.ftau;
-    sat.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau*f.
-       fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
-    sat.cv := f.R*(-f.tau*f.tau*f.ftautau);
-    sat.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-    sat.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-    sat.pdd := f.R*f.T*f.delta/f.d*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
-             f.delta*f.delta*f.fdeltadeltadelta);
-    sat.ptt := f.R*f.d*f.delta*f.tau*f.tau/f.T*f.fdeltatautau;
-    sat.ptd := f.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
-               -f.delta*f.tau*f.fdeltadeltatau);
-    sat.cvt := f.R*f.tau*f.tau/f.T*(2.0*f.ftautau + f.tau*f.ftautautau);
-
-    annotation (Icon(graphics));
-  end helmholtzToBoundaryProps3rd;
-
-  record IF97PhaseBoundaryProperties3rd
-    "Thermodynamic base properties on the phase boundary, Analytic Jacobian verModelica.SIunitson"
-    extends Modelica.Icons.Record;
-    Units.SI.SpecificHeatCapacity R "specific heat capacity";
-    Units.SI.Temperature T "temperature";
-    Units.SI.Density d "denModelica.SIunitsty";
-    Units.SI.SpecificEnthalpy h "specific enthalpy";
-    Units.SI.SpecificEntropy s "specific entropy";
-    Units.SI.SpecificHeatCapacity cp "heat capacity at constant pressure";
-    Units.SI.SpecificHeatCapacity cv "heat capacity at constant volume";
-    ThermoSysPro.Units.xSI.DerPressureByTemperature dpT
-      "dp/dT derivative of saturation curve";
-    Real dpTT(unit = "Pa/(K.K)") "Second derivative of saturation curve";
-    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-      "derivative of pressure wrt temperature";
-    ThermoSysPro.Units.xSI.DerPressureByDensity pd
-      "derivative of pressure wrt denModelica.SIunitsty";
-    Real vt(unit="m3/(kg.K)")
-      "derivative of specific volume w.r.t. temperature";
-    Real vp(unit="m3/(kg.Pa)") "derivative of specific volume w.r.t. pressure";
-    Real cvt "Derivative of cv w.r.t. temperature";
-    Real cpt "Derivative of cp w.r.t. temperature";
-    Real ptt "2nd derivative of pressure wrt temperature";
-    Real pdd "2nd derivative of pressure wrt denModelica.SIunitsty";
-    Real ptd
-      "Mixed derivative of pressure w.r.t. denModelica.SIunitsty and temperature";
-    Real vtt "2nd derivative of specific volume w.r.t. temperature";
-    Real vpp "2nd derivative of specific volume w.r.t. pressure";
-    Real vtp
-      "Mixed derivative of specific volume w.r.t. pressure and temperature";
-  end IF97PhaseBoundaryProperties3rd;
-
-  record PhaseBoundaryProperties3rd
-    "thermodynamic base properties on the phase boundary"
-    extends Modelica.Icons.Record;
-    Units.SI.Temperature T "Temperature";
-    ThermoSysPro.Units.xSI.DerPressureByTemperature dpT
-      "dp/dT derivative of saturation curve";
-    Units.SI.Density d "Density";
-    Units.SI.SpecificEnthalpy h "Specific enthalpy";
-    Units.SI.SpecificEnergy u "Inner energy";
-    Units.SI.SpecificEntropy s "Specific entropy";
-    Units.SI.SpecificHeatCapacity cp "Heat capacity at constant pressure";
-    Units.SI.SpecificHeatCapacity cv "Heat capacity at constant volume";
-    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-      "Derivative of pressure wrt temperature";
-    ThermoSysPro.Units.xSI.DerPressureByDensity pd
-      "Derivative of pressure wrt density";
-    Real cvt "Derivative of cv w.r.t. temperature";
-    Real cpt "Derivative of cp w.r.t. temperature";
-    Real ptt "2nd derivative of pressure wrt temperature";
-    Real pdd "2nd derivative of pressure wrt density";
-    Real ptd "Mixed derivative of pressure w.r.t. density and temperature";
-    Real vt "Derivative of specific volume w.r.t. temperature";
-    Real vp "Derivative of specific volume w.r.t. pressure";
-    Real vtt "2nd derivative of specific volume w.r.t. temperature";
-    Real vpp "2nd derivative of specific volume w.r.t. pressure";
-    Real vtp
-      "Mixed derivative of specific volume w.r.t. pressure and temperature";
-  end PhaseBoundaryProperties3rd;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49,
-      library=1,
-      autolayout=1),
-    Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-
-end Common;
+within ThermoSysPro.Properties.WaterSteam;
+package Common
+  import      ThermoSysPro.Units.SI;
+
+  record HelmholtzData
+    Units.SI.Density d;
+    Units.SI.Temperature T;
+    Units.SI.SpecificHeatCapacity R;
+    annotation (
+      Window(
+        x=0.16,
+        y=0.26,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name"),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end HelmholtzData;
+
+  record GibbsData
+    Units.SI.AbsolutePressure p;
+    Units.SI.Temperature T;
+    Units.SI.SpecificHeatCapacity R;
+    annotation (
+      Window(
+        x=0.16,
+        y=0.26,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name"),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end GibbsData;
+
+  record GibbsDerivs
+    "derivatives of dimensionless Gibbs-function w.r.t dimensionless pressure and temperature"
+    extends Modelica.Icons.Record;
+    Units.SI.Pressure p "pressure";
+    Units.SI.Temperature T "temperature";
+    Units.SI.SpecificHeatCapacity R "specific heat capacity";
+    Real pi(unit="1") "dimensionless pressure";
+    Real tau(unit="1") "dimensionless temperature";
+    Real g(unit="1") "dimensionless Gibbs-function";
+    Real gpi(unit="1") "derivative of g w.r.t. pi";
+    Real gpipi(unit="1") "2nd derivative of g w.r.t. pi";
+    Real gtau(unit="1") "derivative of g w.r.t. tau";
+    Real gtautau(unit="1") "2nd derivative of g w.r.t tau";
+    Real gtaupi(unit="1") "mixed derivative of g w.r.t. pi and tau";
+  end GibbsDerivs;
+
+  record HelmholtzDerivs
+    "derivatives of dimensionless Helmholtz-function w.r.t dimensionless pressuredensity and temperature"
+    extends Modelica.Icons.Record;
+    Units.SI.Density d "density";
+    Units.SI.Temperature T "temperature";
+    Units.SI.SpecificHeatCapacity R "specific heat capacity";
+    Real delta(unit="1") "dimensionless density";
+    Real tau(unit="1") "dimensionless temperature";
+    Real f(unit="1") "dimensionless Helmholtz-function";
+    Real fdelta(unit="1") "derivative of f w.r.t. delta";
+    Real fdeltadelta(unit="1") "2nd derivative of f w.r.t. delta";
+    Real ftau(unit="1") "derivative of f w.r.t. tau";
+    Real ftautau(unit="1") "2nd derivative of f w.r.t. tau";
+    Real fdeltatau(unit="1") "mixed derivative of f w.r.t. delta and tau";
+  end HelmholtzDerivs;
+
+  record ThermoProperties_ph
+    Units.SI.Temperature T(
+      min=InitLimits.TMIN,
+      max=InitLimits.TMAX,
+      nominal=InitLimits.TNOM) "Temperature";
+    Units.SI.Density d(
+      min=InitLimits.DMIN,
+      max=InitLimits.DMAX,
+      nominal=InitLimits.DNOM) "Density";
+    Units.SI.SpecificEnergy u(
+      min=InitLimits.SEMIN,
+      max=InitLimits.SEMAX,
+      nominal=InitLimits.SENOM) "Specific inner energy";
+    Units.SI.SpecificEntropy s(
+      min=InitLimits.SSMIN,
+      max=InitLimits.SSMAX,
+      nominal=InitLimits.SSNOM) "Specific entropy";
+    Units.SI.SpecificHeatCapacity cp(
+      min=InitLimits.CPMIN,
+      max=InitLimits.CPMAX,
+      nominal=InitLimits.CPNOM) "Specific heat capacity at constant presure";
+    Units.SI.DerDensityByEnthalpy ddhp
+      "Derivative of density wrt. specific enthalpy at constant pressure";
+    Units.SI.DerDensityByPressure ddph
+      "Derivative of density wrt. pressure at constant specific enthalpy";
+    Real duph(unit="m3/kg")
+      "Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
+    Real duhp(unit = "1")
+      "Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
+    ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
+    annotation (
+      Window(
+        x=0.21,
+        y=0.32,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name"),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end ThermoProperties_ph;
+
+  function gibbsToProps_ph
+    input GibbsDerivs g "dimensionless derivatives of the Gibbs function";
+    output ThermoProperties_ph pro;
+  protected
+    Real vt;
+    Real vp;
+  algorithm
+    pro.T := min(max(g.T, InitLimits.TMIN), InitLimits.TMAX);
+    pro.d := max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)/(g.R*pro.T*g.pi*g.gpi);
+    pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+    pro.s := g.R*(g.tau*g.gtau - g.g);
+    pro.cp := -g.R*g.tau*g.tau*g.gtautau;
+    vt := g.R/max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+    vp := g.R*g.T/(max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
+          *max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple))*g.pi*g.pi*g.gpipi;
+    pro.ddhp := -pro.d*pro.d*vt/(pro.cp);
+    pro.ddph := -pro.d*pro.d*(vp*pro.cp - vt/pro.d + g.T*vt*vt)/pro.cp;
+    pro.duph := -1/pro.d + g.p/(pro.d*pro.d)*pro.ddph;
+    pro.duhp := 1 + g.p/(pro.d*pro.d)*pro.ddhp;
+    annotation (
+      Window(
+        x=0.05,
+        y=0.05,
+        width=0.54,
+        height=0.72),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-132,102},{144,42}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"),   DymolaStoredErrors,
+      Diagram(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics));
+  end gibbsToProps_ph;
+
+  record NewtonDerivatives_ph
+    Units.SI.AbsolutePressure p;
+    Units.SI.SpecificEnthalpy h;
+    Real pd;
+    Real pt;
+    Real hd;
+    Real ht;
+    annotation (
+      Window(
+        x=0.25,
+        y=0.33,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name"),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end NewtonDerivatives_ph;
+
+  function helmholtzToProps_ph
+    input HelmholtzDerivs f
+      "dimensionless derivatives of the Helmholtz function";
+    output ThermoProperties_ph pro;
+  protected
+    Real pd;
+    Real pt;
+  protected
+   Real cv "Heat capacity at constant volume";
+  algorithm
+    pro.d := f.d;
+    pro.T := f.T;
+    pro.s := f.R*(f.tau*f.ftau - f.f);
+    pro.u := f.R*f.T*f.tau*f.ftau;
+    cv := f.R*(-f.tau*f.tau*f.ftautau);
+    // calculating cp near the critical point may be troublesome (cp -> inf).
+    pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
+              *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+    pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    pro.ddph := (f.d*(cv*f.d + pt))/(f.d*f.d*pd*cv + f.T*pt*pt);
+    pro.ddhp := -f.d*f.d*pt/(f.d*f.d*pd*cv + f.T*pt*pt);
+    annotation (
+      Icon(graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"),   Diagram(graphics));
+  end helmholtzToProps_ph;
+
+  record PhaseBoundaryProperties
+    "thermodynamic base properties on the phase boundary"
+    extends Modelica.Icons.Record;
+    Units.SI.Density d "density";
+    Units.SI.SpecificEnthalpy h "specific enthalpy";
+    Units.SI.SpecificEnergy u "inner energy";
+    Units.SI.SpecificEntropy s "specific entropy";
+    Units.SI.SpecificHeatCapacity cp "heat capacity at constant pressure";
+    Units.SI.SpecificHeatCapacity cv "heat capacity at constant volume";
+    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+      "derivative of pressure wrt temperature";
+    ThermoSysPro.Units.xSI.DerPressureByDensity pd
+      "derivative of pressure wrt density";
+  end PhaseBoundaryProperties;
+
+  function gibbsToBoundaryProps
+    "calulate phase boundary property record from dimensionless Gibbs function"
+
+    extends Modelica.Icons.Function;
+    input GibbsDerivs g "dimensionless derivatives of Gibbs function";
+    output PhaseBoundaryProperties sat "phase boundary properties";
+  protected
+    Real vt "derivative of specific volume w.r.t. temperature";
+    Real vp "derivative of specific volume w.r.t. pressure";
+  algorithm
+    sat.d := g.p/(g.R*g.T*g.pi*g.gpi);
+    sat.h := g.R*g.T*g.tau*g.gtau;
+    sat.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+    sat.s := g.R*(g.tau*g.gtau - g.g);
+    sat.cp := -g.R*g.tau*g.tau*g.gtautau;
+    sat.cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi - g.
+       tau*g.gtaupi)/(g.gpipi));
+    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+    // sat.kappa := -1/(sat.d*g.p)*sat.cp/(vp*sat.cp + vt*vt*g.T);
+    sat.pt := -g.p/g.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
+    sat.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+  end gibbsToBoundaryProps;
+
+  function helmholtzToBoundaryProps
+    "calulate phase boundary property record from dimensionless Helmholtz function"
+
+    extends Modelica.Icons.Function;
+    input HelmholtzDerivs f "dimensionless derivatives of Helmholtz function";
+    output PhaseBoundaryProperties sat "phase boundary property record";
+  protected
+    Units.SI.Pressure p "pressure";
+  algorithm
+    p := f.R*f.d*f.T*f.delta*f.fdelta;
+    sat.d := f.d;
+    sat.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
+    sat.s := f.R*(f.tau*f.ftau - f.f);
+    sat.u := f.R*f.T*f.tau*f.ftau;
+    sat.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau*f.
+       fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+    sat.cv := f.R*(-f.tau*f.tau*f.ftautau);
+    sat.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    sat.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+  end helmholtzToBoundaryProps;
+
+  function HelmholtzOfph
+
+  protected
+    Units.SI.SpecificHeatCapacity cv;
+  public
+    input HelmholtzDerivs f
+      "Dérivées adimensionnelles de la fonction de Helmholtz"
+      annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=
+             0)));
+    input HelmholtzData dTR annotation (Placement(transformation(extent={{15,15},
+              {85,85}}, rotation=0)));
+    output NewtonDerivatives_ph nderivs annotation (Placement(transformation(
+            extent={{-85,-85},{-15,-15}}, rotation=0)));
+  algorithm
+    cv := -dTR.R*(f.tau*f.tau*f.ftautau);
+    nderivs.p := dTR.d*dTR.R*dTR.T*f.delta*f.fdelta;
+    nderivs.h := dTR.R*dTR.T*(f.tau*f.ftau + f.delta*f.fdelta);
+    nderivs.pd := dTR.R*dTR.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    nderivs.pt := dTR.R*dTR.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    nderivs.ht := cv + nderivs.pt/dTR.d;
+    nderivs.hd := (nderivs.pd - dTR.T*nderivs.pt/dTR.d)/dTR.d;
+    annotation (
+      Window(
+        x=0.09,
+        y=0.21,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end HelmholtzOfph;
+
+  function cv2Phase
+    input PhaseBoundaryProperties liq;
+    input PhaseBoundaryProperties vap;
+    input Real x "Vapor mass fraction";
+    input Units.SI.Temperature T;
+    input Units.SI.AbsolutePressure p;
+    output Units.SI.SpecificHeatCapacity cv;
+
+  protected
+    Real dpT;
+    Real dxv;
+    Real dvT;
+    Real dvTl;
+    Real dvTv;
+    Real duTl;
+    Real duTv;
+    Real dxt;
+  algorithm
+    dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d - vap.d) else 0.0;
+    dpT := (vap.s - liq.s)*dxv;
+    // wrong at critical point
+    dvTl := (liq.pt - dpT)/liq.pd/liq.d/liq.d;
+    dvTv := (vap.pt - dpT)/vap.pd/vap.d/vap.d;
+    dxt := -dxv*(dvTl + x*(dvTv - dvTl));
+    duTl := liq.cv + (T*liq.pt - p)*dvTl;
+    duTv := vap.cv + (T*vap.pt - p)*dvTv;
+    cv := duTl + x*(duTv - duTl) + dxt*(vap.u - liq.u);
+    annotation (
+      Window(
+        x=0.08,
+        y=0.14,
+        width=0.6,
+        height=0.61),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end cv2Phase;
+
+  record NewtonDerivatives_ps
+    Units.SI.AbsolutePressure p;
+    Units.SI.SpecificEntropy s;
+    Real pd;
+    Real pt;
+    Real sd;
+    Real st;
+    annotation (
+      Window(
+        x=0.15,
+        y=0.3,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end NewtonDerivatives_ps;
+
+  function HelmholtzOfps
+
+  protected
+    Units.SI.SpecificHeatCapacity cv;
+  public
+    input HelmholtzDerivs f
+      "Dérivées adimensionnelles de la fonction de Helmholtz"
+      annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=
+             0)));
+    input HelmholtzData dTR annotation (Placement(transformation(extent={{15,15},
+              {85,85}}, rotation=0)));
+    output NewtonDerivatives_ps nderivs annotation (Placement(transformation(
+            extent={{-85,-85},{-15,-15}}, rotation=0)));
+  algorithm
+
+    cv := -dTR.R*(f.tau*f.tau*f.ftautau);
+    nderivs.p := dTR.d*dTR.R*dTR.T*f.delta*f.fdelta;
+    nderivs.s := dTR.R*(f.tau*f.ftau - f.f);
+    nderivs.pd := dTR.R*dTR.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    nderivs.pt := dTR.R*dTR.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    nderivs.st := cv/dTR.T;
+    nderivs.sd := -nderivs.pt/(dTR.d*dTR.d);
+    annotation (
+      Window(
+        x=0.03,
+        y=0.14,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end HelmholtzOfps;
+
+  record PropThermoSat
+    Units.SI.AbsolutePressure P "Pressure";
+    Units.SI.Temperature T "Temperature";
+    Units.SI.Density rho "Density";
+    Units.SI.SpecificEnthalpy h "Specific enthalpy";
+    Units.SI.SpecificHeatCapacity cp
+      "Specific heat capacity at constant pressure";
+    Real pt "Derivative of pressure wrt. temperature";
+    Units.SI.SpecificHeatCapacity cv
+      "Specific heat capacity at constant volume";
+    /*
+  Modelica.SIunits.SpecificEnergy u "Specific inner energy";
+  Modelica.SIunits.SpecificEntropy s "Specific entropy";
+  Real pd "Derivative of pressure wrt. density";
+  */
+    annotation (
+      Window(
+        x=0.15,
+        y=0.32,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name"),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end PropThermoSat;
+
+  function gibbsRho
+    input Units.SI.AbsolutePressure P "Pressure";
+    input Units.SI.Temperature T "Temperature";
+
+    output Units.SI.Density rho "density";
+    input GibbsDerivs g "Dérivées de la fonction de Gibbs"
+      annotation (Placement(transformation(extent={{-70,-70},{70,70}}, rotation=
+             0)));
+  algorithm
+
+    rho := max(P, ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)/(ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O
+           *max(T, ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.Ttriple)*g.pi*g.gpi);
+    annotation (
+      Window(
+        x=0.2,
+        y=0.26,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end gibbsRho;
+
+  function gibbsPropsSat
+    input Units.SI.AbsolutePressure P "Pressure";
+    input Units.SI.Temperature T "Temperature";
+
+    input GibbsDerivs g "Dérivées de la fonction de Gibbs"
+      annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=
+             0)));
+    output PropThermoSat sat annotation (Placement(transformation(extent={{15,
+              15},{85,85}}, rotation=0)));
+  algorithm
+
+    sat.P := max(P,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple);
+    sat.T := max(T,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.Ttriple);
+    sat.rho := sat.P/(ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*sat.T*g.pi*g.gpi);
+    sat.h := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*sat.T*g.tau*g.gtau;
+    /*
+  sat.u := sat.T*ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*(g.tau*g.gtau - g.pi*g.gpi);
+  sat.s := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*(g.tau*g.gtau - g.g);
+  */
+    sat.cp := -ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*g.tau*g.tau*g.gtautau;
+    /*
+  sat.cv :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O
+           *(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/(g.gpipi));
+  sat.pt := -sat.P/sat.T*(g.gpi - g.tau*g.gtaupi)/(g.gpipi*g.pi);
+  sat.pd := -ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O*sat.T*g.gpi*g.gpi/(g.gpipi);
+  */
+    annotation (
+      Window(
+        x=0.25,
+        y=0.27,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end gibbsPropsSat;
+
+  function gibbsToProps_pT
+    input GibbsDerivs g "dimensionless derivatives of the Gibbs funciton";
+    output ThermoProperties_pT pro;
+  protected
+    Real vt;
+    Real vp;
+
+  algorithm
+    pro.d := max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
+             /(g.R*g.T*g.pi*g.gpi);
+    pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+    pro.h := g.R*g.T*g.tau*g.gtau;
+    pro.s := g.R*(g.tau*g.gtau - g.g);
+    pro.cp := -g.R*g.tau*g.tau*g.gtautau;
+    vt := g.R/max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
+          *(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+    vp := g.R*g.T/(max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple)
+          *max(g.p,ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple))*g.pi*g.pi*g.gpipi;
+    pro.ddpT := -(pro.d*pro.d)*vp;
+    pro.ddTp := -(pro.d*pro.d)*vt;
+    pro.duTp := pro.cp - g.p*vt;
+    pro.dupT := -g.T*vt - g.p*vp;
+    annotation (
+      Window(
+        x=0.06,
+        y=0.13,
+        width=0.73,
+        height=0.76),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end gibbsToProps_pT;
+
+  record ThermoProperties_pT
+    Units.SI.Density d(
+      min=InitLimits.DMIN,
+      max=InitLimits.DMAX,
+      nominal=InitLimits.DNOM) "Density";
+    Units.SI.SpecificEnthalpy h(
+      min=InitLimits.SHMIN,
+      max=InitLimits.SHMAX,
+      nominal=InitLimits.SHNOM) "Specific enthalpy";
+    Units.SI.SpecificEnergy u(
+      min=InitLimits.SEMIN,
+      max=InitLimits.SEMAX,
+      nominal=InitLimits.SENOM) "Specific inner energy";
+    Units.SI.SpecificEntropy s(
+      min=InitLimits.SSMIN,
+      max=InitLimits.SSMAX,
+      nominal=InitLimits.SSNOM) "Specific entropy";
+    Units.SI.SpecificHeatCapacity cp(
+      min=InitLimits.CPMIN,
+      max=InitLimits.CPMAX,
+      nominal=InitLimits.CPNOM) "Specific heat capacity at constant presure";
+    Units.SI.DerDensityByTemperature ddTp
+      "Derivative of the density wrt. temperature at constant pressure";
+    Units.SI.DerDensityByPressure ddpT
+      "Derivative of the density wrt. presure at constant temperature";
+    Units.SI.DerEnergyByPressure dupT
+      "Derivative of the inner energy wrt. pressure at constant temperature";
+    Units.SI.SpecificHeatCapacity duTp
+      "Derivative of the inner energy wrt. temperature at constant pressure";
+    ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
+    annotation (
+      Window(
+        x=0.23,
+        y=0.19,
+        width=0.68,
+        height=0.71),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name"),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end ThermoProperties_pT;
+
+  function gibbsToProps_ps
+    input GibbsDerivs g "dimensionless derivatives of the Gibbs function";
+    output ThermoProperties_ps pro;
+  protected
+    Real vt;
+    Real vp;
+  algorithm
+
+    pro.T := g.T;
+    pro.d := g.p/(g.R*pro.T*g.pi*g.gpi);
+    pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+    pro.h := g.R*g.T*g.tau*g.gtau;
+    pro.cp := -g.R*g.tau*g.tau*g.gtautau;
+    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+    pro.ddsp := -pro.d*pro.d*vt*g.T/(pro.cp);
+    pro.ddps := -pro.d*pro.d*(vp + g.T*vt*vt/pro.cp);
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Window(
+        x=0.13,
+        y=0.26,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end gibbsToProps_ps;
+
+  record ThermoProperties_ps
+    Units.SI.Temperature T(
+      min=InitLimits.TMIN,
+      max=InitLimits.TMAX,
+      nominal=InitLimits.TNOM) "Temperature";
+    Units.SI.Density d(
+      min=InitLimits.DMIN,
+      max=InitLimits.DMAX,
+      nominal=InitLimits.DNOM) "Density";
+    Units.SI.SpecificEnergy u(
+      min=InitLimits.SEMIN,
+      max=InitLimits.SEMAX,
+      nominal=InitLimits.SENOM) "Specific inner energy";
+    Units.SI.SpecificEnthalpy h(
+      min=InitLimits.SHMIN,
+      max=InitLimits.SHMAX,
+      nominal=InitLimits.SHNOM) "Specific enthalpy";
+    Units.SI.SpecificHeatCapacity cp(
+      min=InitLimits.CPMIN,
+      max=InitLimits.CPMAX,
+      nominal=InitLimits.CPNOM) "Specific heat capacity at constant pressure";
+    ThermoSysPro.Units.xSI.DerDensityByEntropy ddsp
+      "Derivative of the density wrt. specific entropy at constant pressure";
+    Units.SI.DerDensityByPressure ddps
+      "Derivative of the density wrt. pressure at constant specific entropy";
+    ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
+    annotation (
+      Window(
+        x=0.31,
+        y=0.2,
+        width=0.6,
+        height=0.6),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name"),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.5</b></p>
+</HTML>
+"));
+  end ThermoProperties_ps;
+
+  function helmholtzToProps_ps
+    input HelmholtzDerivs f
+      "dimensionless derivatives of the Helmholtz function";
+    output ThermoProperties_ps pro;
+  protected
+    Real pd;
+    Real pt;
+  protected
+    Real cv "Heat capacity at constant volume";
+  algorithm
+
+    pro.d := f.d;
+    pro.T := f.T;
+    pro.u := f.R*f.T*f.tau*f.ftau;
+    pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
+
+    // calculating cp near the critical point may be troublesome (cp -> inf).
+    pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
+      *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+    cv := f.R*(-f.tau*f.tau*f.ftautau);
+    pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    pro.ddps := f.d*f.d*cv/(pd*f.d*f.d*cv + pt*pt*f.T);
+    pro.ddsp := -f.d*f.d*pt*f.T/(f.d*f.d*pd*cv + f.T*pt*pt);
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Window(
+        x=0.13,
+        y=0.25,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end helmholtzToProps_ps;
+
+  function gibbsToProps_dT
+    input GibbsDerivs g;
+    output ThermoProperties_dT pro;
+  protected
+    Real vt "derivative of specific volume w.r.t. temperature";
+    Real vp "derivative of specific volume w.r.t. pressure";
+  algorithm
+    pro.p := g.p;
+    pro.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+    pro.h := g.R*g.T*g.tau*g.gtau;
+    pro.s := g.R*(g.tau*g.gtau - g.g);
+    pro.cp := -g.R*g.tau*g.tau*g.gtautau;
+    vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+    vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+    pro.dudT := pro.cp + g.T*vt*vt/vp;
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Window(
+        x=0.08,
+        y=0.23,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end gibbsToProps_dT;
+
+  record ThermoProperties_dT
+    Units.SI.AbsolutePressure p(
+      min=InitLimits.PMIN,
+      max=InitLimits.PMAX,
+      nominal=InitLimits.PNOM) "Pressure";
+    Units.SI.SpecificEnthalpy h(
+      min=InitLimits.SHMIN,
+      max=InitLimits.SHMAX,
+      nominal=InitLimits.SHNOM) "Specific enthalpy";
+    Units.SI.SpecificEnergy u(
+      min=InitLimits.SEMIN,
+      max=InitLimits.SEMAX,
+      nominal=InitLimits.SENOM) "Specific inner energy";
+    Units.SI.SpecificEntropy s(
+      min=InitLimits.SSMIN,
+      max=InitLimits.SSMAX,
+      nominal=InitLimits.SSNOM) "Specific entropy";
+    Units.SI.SpecificHeatCapacity cp(
+      min=InitLimits.CPMIN,
+      max=InitLimits.CPMAX,
+      nominal=InitLimits.CPNOM) "Specific heat capacity at constant pressure";
+    Real dudT
+      "Derivative of the inner energy wrt. density at constant temperature";
+    ThermoSysPro.Units.SI.MassFraction x "Vapor mas fraction";
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0}),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end ThermoProperties_dT;
+
+  function helmholtzToProps_dT
+    input HelmholtzDerivs f;
+    output ThermoProperties_dT pro;
+  protected
+    Real pt "derivative of presure w.r.t. temperature";
+    Real pv "derivative of pressure w.r.t. specific volume";
+
+  algorithm
+    pro.p := f.R*f.d*f.T*f.delta*f.fdelta;
+    pro.s := f.R*(f.tau*f.ftau - f.f);
+    pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
+    pro.u := f.R*f.T*f.tau*f.ftau;
+    pv := -1/(f.d*f.d)*f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.
+      fdeltadelta);
+    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    // calculating cp near the critical point may be troublesome (cp -> inf).
+    pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
+      *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+    pro.dudT := (pro.p - f.T*pt)/(f.d*f.d);
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Window(
+        x=0.09,
+        y=0.22,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end helmholtzToProps_dT;
+
+  record NewtonDerivatives_pT
+    Units.SI.AbsolutePressure p "Pressure";
+    ThermoSysPro.Units.xSI.DerPressureByDensity pd
+      "derivative of pressure wrt. density";
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Rectangle(
+            extent={{-100,50},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,127},
+            fillPattern=FillPattern.Solid),
+          Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+          Line(points={{-100,0},{100,0}}, color={0,0,0}),
+          Line(points={{0,50},{0,-100}}, color={0,0,0}),
+          Text(extent={{-127,115},{127,55}}, textString=
+                                                 "%name")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end NewtonDerivatives_pT;
+
+  function HelmholtzOfpT
+
+    input HelmholtzDerivs f;
+    output NewtonDerivatives_pT nderivs annotation (Placement(transformation(
+            extent={{-85,-85},{-15,-15}}, rotation=0)));
+  algorithm
+
+    nderivs.p := f.d*f.R*f.T*f.delta*f.fdelta;
+    nderivs.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Window(
+        x=0.11,
+        y=0.25,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end HelmholtzOfpT;
+
+  function helmholtzToProps_pT
+    input HelmholtzDerivs f;
+    output ThermoProperties_pT pro;
+  protected
+    Real pd "derivative of pressure wrt. density";
+    Real pt "derivative of pressure wrt. temperature";
+    Real pv "derivative of pressure wrt. specific volume";
+  protected
+   Real cv "Heat capacity at constant volume";
+  algorithm
+
+    pro.d := f.d;
+    pro.s := f.R*(f.tau*f.ftau - f.f);
+    pro.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
+    pro.u := f.R*f.T*f.tau*f.ftau;
+    pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    cv := f.R*(-f.tau*f.tau*f.ftautau);
+    pv := -1/(f.d*f.d)*pd;
+    // calculating cp near the critical point may be troublesome (cp -> inf).
+    pro.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau
+      *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+    pro.ddTp := -pt/pd;
+    pro.ddpT := 1/pd;
+    pro.dupT := (f.d - f.T*pt)/(f.d*f.d*pd);
+    pro.duTp := (-cv*f.d*f.d*pd + pt*f.d - f.T*pt*pt)/(f.d*f.d*
+      pd);
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction"),
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name")}),
+      Window(
+        x=0.32,
+        y=0.14,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end helmholtzToProps_pT;
+
+  record miniProp "Test record for derivatives"
+    Units.SI.Temperature T "Temperature";
+    Units.SI.Density d "Density";
+  end miniProp;
+
+  record IF97PhaseBoundaryProperties
+    "thermodynamic base properties on the phase boundary for IF97 steam tables"
+    extends Modelica.Icons.Record;
+    Units.SI.SpecificHeatCapacity R "specific heat capacity";
+    Units.SI.Temperature T "temperature";
+    Units.SI.Density d "density";
+    Units.SI.SpecificEnthalpy h "specific enthalpy";
+    Units.SI.SpecificEntropy s "specific entropy";
+    Units.SI.SpecificHeatCapacity cp "heat capacity at constant pressure";
+    Units.SI.SpecificHeatCapacity cv "heat capacity at constant volume";
+    ThermoSysPro.Units.xSI.DerPressureByTemperature dpT
+      "dp/dT derivative of saturation curve";
+    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+      "derivative of pressure wrt temperature";
+    ThermoSysPro.Units.xSI.DerPressureByDensity pd
+      "derivative of pressure wrt density";
+    Real vt(unit="m3/(kg.K)")
+      "derivative of specific volume w.r.t. temperature";
+    Real vp(unit="m3/(kg.Pa)") "derivative of specific volume w.r.t. pressure";
+  end IF97PhaseBoundaryProperties;
+
+  function water_ph_r4
+    input Units.SI.AbsolutePressure p;
+    input Units.SI.SpecificEnthalpy h;
+
+  protected
+    Real x;
+    Real dpT;
+  public
+    output ThermoProperties_ph pro;
+  protected
+    PhaseBoundaryProperties liq;
+    PhaseBoundaryProperties vap;
+    GibbsDerivs gl;
+    GibbsDerivs gv;
+    HelmholtzDerivs fl;
+    HelmholtzDerivs fv;
+    Units.SI.Density dl;
+    Units.SI.Density dv;
+    Real cv "Heat capacity at constant volume";
+  algorithm
+    pro.T := BaseIF97.Basic.tsat(p);
+    dpT := BaseIF97.Basic.dptofT(pro.T);
+    dl := BaseIF97.Regions.rhol_p_R4b(p);
+    dv := BaseIF97.Regions.rhov_p_R4b(p);
+    if p < BaseIF97.data.PLIMIT4A then
+      gl := BaseIF97.Basic.g1(p, pro.T);
+      gv := BaseIF97.Basic.g2(p, pro.T);
+      liq := gibbsToBoundaryProps(gl);
+      vap := gibbsToBoundaryProps(gv);
+    else
+      fl := BaseIF97.Basic.f3(dl, pro.T);
+      fv := BaseIF97.Basic.f3(dv, pro.T);
+      liq := helmholtzToBoundaryProps(fl);
+      vap := helmholtzToBoundaryProps(fv);
+    end if;
+    x := if (vap.h <> liq.h) then (h - liq.h)/(vap.h - liq.h) else 1.0;
+    cv := cv2Phase(
+        liq=liq,
+        vap=vap,
+        x=x,
+        p=p,
+        T=pro.T);
+    pro.d := liq.d*vap.d/(vap.d + x*(liq.d - vap.d));
+    pro.x := x;
+    pro.u := x*vap.u + (1 - x)*liq.u;
+    pro.s := x*vap.s + (1 - x)*liq.s;
+    pro.cp := x*vap.cp + (1 - x)*liq.cp;
+    pro.ddph := pro.d*(pro.d*cv/dpT + 1.0)/(dpT*pro.T);
+    pro.ddhp := -pro.d*pro.d/(dpT*pro.T);
+    annotation (
+      Icon(graphics={
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name"),
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.2</b></p>
+</HTML>
+"));
+  end water_ph_r4;
+
+  function water_ps_r4
+    input Units.SI.AbsolutePressure p "pressure";
+    input Units.SI.SpecificEntropy s "specific entropy";
+
+  protected
+    Real x;
+    Real dpT;
+  public
+    output ThermoProperties_ps pro;
+  protected
+    PhaseBoundaryProperties liq;
+    PhaseBoundaryProperties vap;
+    GibbsDerivs gl
+      "dimensionless Gibbs function and derivatives wrt dimensionless presure and temperature";
+    GibbsDerivs gv
+      "dimensionless Gibbs function and derivatives wrt dimensionless presure and temperature";
+    HelmholtzDerivs fl
+      "dimensionless Helmholtz function and derivatives wrt dimensionless presure and temperature";
+    HelmholtzDerivs fv
+      "dimensionless Helmholtz function and derivatives wrt dimensionless presure and temperature";
+    Real cv "Heat capacity at constant volume";
+    Units.SI.Density dl;
+    Units.SI.Density dv;
+  algorithm
+
+    pro.T := BaseIF97.Basic.tsat(p);
+    dpT := BaseIF97.Basic.dptofT(pro.T);
+
+    dl := BaseIF97.Regions.rhol_p_R4b(p);
+    dv := BaseIF97.Regions.rhov_p_R4b(p);
+    if p < BaseIF97.data.PLIMIT4A then
+      gl := BaseIF97.Basic.g1(p, pro.T);
+      gv := BaseIF97.Basic.g2(p, pro.T);
+      liq := gibbsToBoundaryProps(gl);
+      vap := gibbsToBoundaryProps(gv);
+    else
+      fl := BaseIF97.Basic.f3(dl, pro.T);
+      fv := BaseIF97.Basic.f3(dv, pro.T);
+      liq := helmholtzToBoundaryProps(fl);
+      vap := helmholtzToBoundaryProps(fv);
+    end if;
+    x := if (vap.s <> liq.s) then (s - liq.s)/(vap.s - liq.s) else 1.0;
+    pro.x := x;
+    pro.d := liq.d*vap.d/(vap.d + x*(liq.d - vap.d));
+    pro.u := x*vap.u + (1 - x)*liq.u;
+    pro.h := x*vap.h + (1 - x)*liq.h;
+    pro.cp := Modelica.Constants.inf;
+    cv := cv2Phase(
+        liq,
+        vap,
+        x,
+        pro.T,
+        p);
+    pro.ddps := cv*pro.d*pro.d/(dpT*dpT*pro.T);
+    pro.ddsp := -pro.d*pro.d/dpT;
+    annotation (
+      Icon(graphics={
+          Text(extent={{-134,104},{142,44}}, textString=
+                                                 "%name"),
+          Ellipse(
+            extent={{-100,40},{100,-100}},
+            lineColor={255,127,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Text(
+            extent={{-84,-4},{84,-52}},
+            lineColor={255,127,0},
+            textString=
+                 "fonction")}),
+      Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+  end water_ps_r4;
+
+  record IF97TwoPhaseAnalytic
+    "Intermediate property data record for IF97, analytic Jacobian version"
+    extends Modelica.Icons.Record;
+    Integer phase "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+    Integer region(min=1, max=5) "IF 97 region";
+    Units.SI.Pressure p "pressure";
+    Units.SI.Temperature T "temperature";
+    Units.SI.SpecificEnthalpy h "specific enthalpy";
+    Units.SI.SpecificHeatCapacity R "gas constant";
+    Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    Real cpt "derivative of cp w.r.t. temperature";
+    Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    Real cvt "derivative of cv w.r.t. temperature";
+    Units.SI.Density rho "density";
+    Units.SI.SpecificEntropy s "specific entropy";
+    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+      "derivative of pressure wrt temperature";
+    ThermoSysPro.Units.xSI.DerPressureByDensity pd
+      "derivative of pressure wrt density";
+    Real ptt "2nd derivative of pressure wrt temperature";
+    Real pdd "2nd derivative of pressure wrt density";
+    Real ptd "mixed derivative of pressure w.r.t. density and temperature";
+    Real vt "derivative of specific volume w.r.t. temperature";
+    Real vp "derivative of specific volume w.r.t. pressure";
+    Real vtt "2nd derivative of specific volume w.r.t. temperature";
+    Real vpp "2nd derivative of specific volume w.r.t. pressure";
+    Real vtp
+      "mixed derivative of specific volume w.r.t. pressure and temperature";
+    Real x "dryness fraction";
+    Real dpT "dp/dT derivative of saturation curve";
+  end IF97TwoPhaseAnalytic;
+
+  record IF97BaseTwoPhase "Intermediate property data record for IF 97"
+    extends Modelica.Icons.Record;
+    Integer phase "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+    Integer region(min=1, max=5) "IF 97 region";
+    Units.SI.Pressure p "pressure";
+    Units.SI.Temperature T "temperature";
+    Units.SI.SpecificEnthalpy h "specific enthalpy";
+    Units.SI.SpecificHeatCapacity R "gas constant";
+    Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    Units.SI.Density rho "density";
+    Units.SI.SpecificEntropy s "specific entropy";
+    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+      "derivative of pressure wrt temperature";
+    ThermoSysPro.Units.xSI.DerPressureByDensity pd
+      "derivative of pressure wrt density";
+    Real vt "derivative of specific volume w.r.t. temperature";
+    Real vp "derivative of specific volume w.r.t. pressure";
+    Real x "dryness fraction";
+    Real dpT "dp/dT derivative of saturation curve";
+  end IF97BaseTwoPhase;
+
+  record GibbsDerivs3rd
+    "derivatives of dimensionless Gibbs-function w.r.t dimensionless pressure and temperature, including 3rd derivatives"
+    extends Modelica.Icons.Record;
+    Units.SI.Pressure p "pressure";
+    Units.SI.Temperature T "temperature";
+    Units.SI.SpecificHeatCapacity R "specific heat capacity";
+    Real pi(unit="1") "dimensionless pressure";
+    Real tau(unit="1") "dimensionless temperature";
+    Real g(unit="1") "dimensionless Gibbs-function";
+    Real gpi(unit="1") "derivative of g w.r.t. pi";
+    Real gpipi(unit="1") "2nd derivative of g w.r.t. pi";
+    Real gpipipi(unit="1") "3rd derivative of g w.r.t. pi";
+    Real gtau(unit="1") "derivative of g w.r.t. tau";
+    Real gtautau(unit="1") "2nd derivative of g w.r.t tau";
+    Real gtautautau(unit="1") "3rd derivative of g w.r.t tau";
+    Real gpitau(unit="1") "mixed derivative of g w.r.t. pi and tau";
+    Real gpitautau(unit="1") "mixed derivative of g w.r.t. pi and tau (2nd)";
+    Real gpipitau(unit="1") "mixed derivative of g w.r.t. pi (2nd) and tau";
+  end GibbsDerivs3rd;
+
+  function gibbsToBoundaryProps3rd
+    "calulate phase boundary property record from dimensionless Gibbs function"
+    extends Modelica.Icons.Function;
+    input ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
+      "dimensionless derivatives of Gibbs function";
+    output ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
+      sat "phase boundary properties";
+  protected
+    Real v "specific volume";
+    Real vp3 "Third power of vp";
+    Real ivp3 "Inverse of third power of vp";
+  algorithm
+    sat.d := g.p/(g.R*g.T*g.pi*g.gpi);
+    sat.h := g.R*g.T*g.tau*g.gtau;
+    sat.u := g.T*g.R*(g.tau*g.gtau - g.pi*g.gpi);
+    sat.s := g.R*(g.tau*g.gtau - g.g);
+    sat.cp := -g.R*g.tau*g.tau*g.gtautau;
+    sat.cv := g.R*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gpitau)*(g.gpi - g.
+       tau*g.gpitau)/(g.gpipi));
+    sat.pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+    sat.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+    v := 1/sat.d;
+    sat.vt := g.R/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+    sat.vp := g.R*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi;
+    sat.vtt := g.R*g.pi/g.p*g.tau/g.T*g.tau*g.gpitautau;
+    sat.vtp := g.R*g.pi*g.pi/(g.p*g.p)*(g.gpipi - g.tau*g.gpipitau);
+    sat.vpp := g.R*g.T*g.pi*g.pi*g.pi/(g.p*g.p*g.p)*g.gpipipi;
+    sat.cpt := g.R*g.tau*g.tau/g.T*(2*g.gtautau + g.tau*g.gtautautau);
+    vp3 := sat.vp*sat.vp*sat.vp;
+    ivp3 := 1/vp3;
+    sat.ptt := -(sat.vtt*sat.vp*sat.vp -2.0*sat.vt*sat.vtp*sat.vp + sat.vt*sat.vt*sat.vpp)*ivp3;
+    sat.pdd := -sat.vpp*ivp3*v*v*v*v - 2*v*sat.pd "= pvv/d^4";
+    sat.ptd := (sat.vtp*sat.vp-sat.vt*sat.vpp)*ivp3/(sat.d*sat.d) "= -ptv/d^2";
+    sat.cvt := (vp3*sat.cpt + sat.vp*sat.vp*sat.vt*sat.vt + 3.0*sat.vp*sat.vp*g.T*sat.vt*sat.vtt - 3.0*sat.vtp*sat.vp*g.T*sat.vt*sat.vt + g.T*sat.vt*sat.vt*sat.vt*sat.vpp)*ivp3;
+  end gibbsToBoundaryProps3rd;
+
+  record HelmholtzDerivs3rd
+    "derivatives of dimensionless Helmholtz-function w.r.t dimensionless pressuredensity and temperature, including 3rd derivatives"
+    extends Modelica.Icons.Record;
+    Units.SI.Density d "density";
+    Units.SI.Temperature T "temperature";
+    Units.SI.SpecificHeatCapacity R "specific heat capacity";
+    Real delta(unit="1") "dimensionless density";
+    Real tau(unit="1") "dimensionless temperature";
+    Real f(unit="1") "dimensionless Helmholtz-function";
+    Real fdelta(unit="1") "derivative of f w.r.t. delta";
+    Real fdeltadelta(unit="1") "2nd derivative of f w.r.t. delta";
+    Real fdeltadeltadelta(unit="1") "3rd derivative of f w.r.t. delta";
+    Real ftau(unit="1") "derivative of f w.r.t. tau";
+    Real ftautau(unit="1") "2nd derivative of f w.r.t. tau";
+    Real ftautautau(unit="1") "3rd derivative of f w.r.t. tau";
+    Real fdeltatau(unit="1") "mixed derivative of f w.r.t. delta and tau";
+    Real fdeltadeltatau(unit="1")
+      "mixed derivative of f w.r.t. delta (2nd) and tau";
+    Real fdeltatautau(unit="1")
+      "mixed derivative of f w.r.t. delta and tau (2nd) ";
+  end HelmholtzDerivs3rd;
+
+  function helmholtzToBoundaryProps3rd
+    "calulate phase boundary property record from dimensionless Helmholtz function"
+
+    extends Modelica.Icons.Function;
+    input ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
+      "dimensionless derivatives of Helmholtz function";
+    output ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
+      sat "phase boundary property record";
+  protected
+    Units.SI.Pressure p "pressure";
+  algorithm
+    p := f.R*f.d*f.T*f.delta*f.fdelta;
+    sat.d := f.d;
+    sat.h := f.R*f.T*(f.tau*f.ftau + f.delta*f.fdelta);
+    sat.s := f.R*(f.tau*f.ftau - f.f);
+    sat.u := f.R*f.T*f.tau*f.ftau;
+    sat.cp := f.R*(-f.tau*f.tau*f.ftautau + (f.delta*f.fdelta - f.delta*f.tau*f.
+       fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta));
+    sat.cv := f.R*(-f.tau*f.tau*f.ftautau);
+    sat.pt := f.R*f.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+    sat.pd := f.R*f.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+    sat.pdd := f.R*f.T*f.delta/f.d*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
+             f.delta*f.delta*f.fdeltadeltadelta);
+    sat.ptt := f.R*f.d*f.delta*f.tau*f.tau/f.T*f.fdeltatautau;
+    sat.ptd := f.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
+               -f.delta*f.tau*f.fdeltadeltatau);
+    sat.cvt := f.R*f.tau*f.tau/f.T*(2.0*f.ftautau + f.tau*f.ftautautau);
+
+    annotation (Icon(graphics));
+  end helmholtzToBoundaryProps3rd;
+
+  record IF97PhaseBoundaryProperties3rd
+    "Thermodynamic base properties on the phase boundary, Analytic Jacobian verModelica.SIunitson"
+    extends Modelica.Icons.Record;
+    Units.SI.SpecificHeatCapacity R "specific heat capacity";
+    Units.SI.Temperature T "temperature";
+    Units.SI.Density d "denModelica.SIunitsty";
+    Units.SI.SpecificEnthalpy h "specific enthalpy";
+    Units.SI.SpecificEntropy s "specific entropy";
+    Units.SI.SpecificHeatCapacity cp "heat capacity at constant pressure";
+    Units.SI.SpecificHeatCapacity cv "heat capacity at constant volume";
+    ThermoSysPro.Units.xSI.DerPressureByTemperature dpT
+      "dp/dT derivative of saturation curve";
+    Real dpTT(unit = "Pa/(K.K)") "Second derivative of saturation curve";
+    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+      "derivative of pressure wrt temperature";
+    ThermoSysPro.Units.xSI.DerPressureByDensity pd
+      "derivative of pressure wrt denModelica.SIunitsty";
+    Real vt(unit="m3/(kg.K)")
+      "derivative of specific volume w.r.t. temperature";
+    Real vp(unit="m3/(kg.Pa)") "derivative of specific volume w.r.t. pressure";
+    Real cvt "Derivative of cv w.r.t. temperature";
+    Real cpt "Derivative of cp w.r.t. temperature";
+    Real ptt "2nd derivative of pressure wrt temperature";
+    Real pdd "2nd derivative of pressure wrt denModelica.SIunitsty";
+    Real ptd
+      "Mixed derivative of pressure w.r.t. denModelica.SIunitsty and temperature";
+    Real vtt "2nd derivative of specific volume w.r.t. temperature";
+    Real vpp "2nd derivative of specific volume w.r.t. pressure";
+    Real vtp
+      "Mixed derivative of specific volume w.r.t. pressure and temperature";
+  end IF97PhaseBoundaryProperties3rd;
+
+  record PhaseBoundaryProperties3rd
+    "thermodynamic base properties on the phase boundary"
+    extends Modelica.Icons.Record;
+    Units.SI.Temperature T "Temperature";
+    ThermoSysPro.Units.xSI.DerPressureByTemperature dpT
+      "dp/dT derivative of saturation curve";
+    Units.SI.Density d "Density";
+    Units.SI.SpecificEnthalpy h "Specific enthalpy";
+    Units.SI.SpecificEnergy u "Inner energy";
+    Units.SI.SpecificEntropy s "Specific entropy";
+    Units.SI.SpecificHeatCapacity cp "Heat capacity at constant pressure";
+    Units.SI.SpecificHeatCapacity cv "Heat capacity at constant volume";
+    ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+      "Derivative of pressure wrt temperature";
+    ThermoSysPro.Units.xSI.DerPressureByDensity pd
+      "Derivative of pressure wrt density";
+    Real cvt "Derivative of cv w.r.t. temperature";
+    Real cpt "Derivative of cp w.r.t. temperature";
+    Real ptt "2nd derivative of pressure wrt temperature";
+    Real pdd "2nd derivative of pressure wrt density";
+    Real ptd "Mixed derivative of pressure w.r.t. density and temperature";
+    Real vt "Derivative of specific volume w.r.t. temperature";
+    Real vp "Derivative of specific volume w.r.t. pressure";
+    Real vtt "2nd derivative of specific volume w.r.t. temperature";
+    Real vpp "2nd derivative of specific volume w.r.t. pressure";
+    Real vtp
+      "Mixed derivative of specific volume w.r.t. pressure and temperature";
+  end PhaseBoundaryProperties3rd;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49,
+      library=1,
+      autolayout=1),
+    Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+
+end Common;
diff --git a/ThermoSysPro/Properties/WaterSteam/IF97_Utilities.mo b/ThermoSysPro/Properties/WaterSteam/IF97_Utilities.mo
index f647ec803280bc2769ffec5cb6963744f4476b6e..37c3fbca343190919b1ccb8b5749afc3e0fd74a6 100644
--- a/ThermoSysPro/Properties/WaterSteam/IF97_Utilities.mo
+++ b/ThermoSysPro/Properties/WaterSteam/IF97_Utilities.mo
@@ -1,4461 +1,4461 @@
-within ThermoSysPro.Properties.WaterSteam;
-package IF97_Utilities
-  "Low level and utility computation for high accuracy water properties according to the IAPWS/IF97 standard"
-
-  replaceable record iter =
-      ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData;
-//   function isentropicEnthalpy
-//     "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
-//     extends Modelica.Icons.Function;
-//     input SI.Pressure p "pressure";
-//     input SI.SpecificEntropy s "specific entropy";
-//     input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known";
-//     output SI.SpecificEnthalpy h "specific enthalpy";
-//   algorithm
-//    h := BaseIF97.Isentropic.water_hisentropic(p,s,phase);
-//   end isentropicEnthalpy;
-
-public
-  package AnalyticDerivatives "Functions with analytic derivatives"
-
-    import ThermoSysPro.Properties.WaterSteam.BaseIF97.*;
-
-    function waterBasePropAnalytic_ph "intermediate property record for water"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase =  0
-        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-      input Integer region = 0
-        "if 0, do region computation, otherwise assume the region is this input";
-      output ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                            g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
-                                                                f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      Integer error "error flag for inverse iterations";
-      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
-      Units.SI.Density d_liq "liquid density";
-      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
-      Units.SI.Density d_vap "vapour density";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
-                                                                        liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
-                                                                        vap
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                            gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                            gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
-                                                                fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
-                                                                fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Units.SI.Temperature t1
-        "temperature at phase boundary, using inverse from region 1";
-      Units.SI.Temperature t2
-        "temperature at phase boundary, using inverse from region 2";
-      /// new stuff, for analytic Jacobian
-      Real dxv "der of x wrt v";
-      Real dxd "der of x wrt d";
-      Real dvTl "der of v wrt T at boiling";
-      Real dvTv "der of v wrt T at dew";
-      Real dxT "der of x wrt T";
-      Real duTl "der of u wrt T at boiling";
-      Real duTv "der of u wrt T at dew";
-      Real dpTT "2nd der of p wrt T";
-      Real dxdd "2nd der of x wrt d";
-      Real dxTd "2nd der of x wrt d and T";
-      Real dvTTl "2nd der of v wrt T at boiling";
-      Real dvTTv "2nd der of v wrt T at dew";
-      Real dxTT " 2nd der of x wrt T";
-      Real duTTl "2nd der of u wrt T at boiling";
-      Real duTTv "2nd der of u wrt T at dew";
-      Real vp3 "vp^3";
-      Real ivp3 "1/vp3";
-      Units.SI.SpecificVolume v;
-      // cvt is in aux record
-      // Real detpht;
-    algorithm
-      aux.region := if region == 0 then
-        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ph(
-                                                              p=p,h= h,phase= phase)) else region;
-      aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1;
-      // LogVariable(p);
-      // LogVariable(h);
-      // LogVariable(aux.region);
-      aux.p := max(p,611.657);
-      aux.h := max(h,1e3);
-      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      if (aux.region == 1) or (aux.region == 2) or (aux.region == 5) then
-        if (aux.region == 1) then
-          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(
-                                       aux.p, aux.h);
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
-                                   p, aux.T);
-          aux.x := 0.0;
-        elseif (aux.region == 2) then
-          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(
-                                       aux.p, aux.h);
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
-                                   p, aux.T);
-          aux.x := 1.0;
-        else /* region must be 5 here */
-          (
-    aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofph5(
-              p=aux.p,
-              h=aux.h,
-              reldh=1.0e-7);
-          assert(error == 0, "error in inverse iteration of steam tables");
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(
-                                   p, aux.T);
-          aux.x := 1.0;
-        end if;
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
-        aux.dpT := -aux.vt/aux.vp;
-        aux.vtt := aux.R*g.pi/p*g.tau/aux.T*g.tau*g.gpitautau;
-        aux.vtp := aux.R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        aux.vpp := aux.R*aux.T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        aux.cpt := aux.R*g.tau*g.tau/aux.T*(2*g.gtautau + g.tau*g.gtautautau);
-        aux.pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-        aux.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-        v := 1/aux.rho;
-        vp3 := aux.vp*aux.vp*aux.vp;
-        ivp3 := 1/vp3;
-        aux.ptt := -(aux.vtt*aux.vp*aux.vp -2.0*aux.vt*aux.vtp*aux.vp +aux.vt*aux.vt*aux.vpp)*ivp3;
-        aux.pdd := -aux.vpp*ivp3*v*v*v*v - 2*v*aux.pd "= pvv/d^4";
-        aux.ptd := (aux.vtp*aux.vp-aux.vt*aux.vpp)*ivp3*v*v "= -ptv/d^2";
-        aux.cvt := (vp3*aux.cpt + aux.vp*aux.vp*aux.vt*aux.vt + 3.0*aux.vp*aux.vp*aux.T*aux.vt*aux.vtt
-      - 3.0*aux.vtp*aux.vp*aux.T*aux.vt*aux.vt + aux.T*aux.vt*aux.vt*aux.vt*aux.vpp)*ivp3;
-      elseif (aux.region == 3) then
-        (aux.rho,aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofph3(
-                                                           p=aux.p,h=aux.h,delp= 1.0e-7,delh=
-          1.0e-6);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
-                                 aux.rho, aux.T);
-        aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta);
-        aux.s := aux.R*(f.tau*f.ftau - f.f);
-        aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        aux.cv := abs(aux.R*(-f.tau*f.tau*f.ftautau))
-          "can be close to neg. infinity near critical point";
-        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
-        aux.x := 0.0;
-        aux.dpT := aux.pt; /*safety against div-by-0 in initialization*/
-        aux.pdd := aux.R*aux.T*f.delta/aux.rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
-             f.delta*f.delta*f.fdeltadeltadelta);
-        aux.ptt := aux.R*aux.rho*f.delta*f.tau*f.tau/aux.T*f.fdeltatautau;
-        aux.ptd := aux.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
-      -f.delta*f.tau*f.fdeltadeltatau);
-        aux.cvt := aux.R*f.tau*f.tau/aux.T*(2.0*f.ftautau + f.tau*f.ftautautau);
-        aux.cpt := (aux.cvt*aux.pd + aux.cv*aux.ptd + (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt/(aux.rho*aux.rho)
-      - aux.cp*aux.ptd)/aux.pd;
-      elseif (aux.region == 4) then
-        h_liq := hl_p(p);
-        h_vap := hv_p(p);
-        aux.x := if (h_vap <> h_liq) then (h - h_liq)/(h_vap - h_liq) else 1.0;
-        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
-          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(
-                                    aux.p, h_liq);
-          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(
-                                    aux.p, h_vap);
-          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
-                                    aux.p, t1);
-          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
-                                    aux.p, t2);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(
-            gl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(
-            gv);
-          aux.T := t1 + aux.x*(t2 - t1);
-        else
-          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(
-                                       aux.p);
-          // how to avoid ?
-          d_liq := rhol_T(aux.T);
-          d_vap := rhov_T(aux.T);
-          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
-                                    d_liq, aux.T);
-          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
-                                    d_vap, aux.T);
-          liq :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(
-            fl);
-          vap :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(
-            fv);
-          //  aux.dpT := BaseIF97.Basic.dptofT(aux.T);
-        end if;
-        aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d));
-        dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d-vap.d) else 0.0;
-        dxd := -dxv/(aux.rho*aux.rho);
-        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*dxv else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
-                                                                                           aux.T);
-        dvTl := (liq.pt -aux.dpT)/(liq.pd*liq.d*liq.d);
-        dvTv := (vap.pt -aux.dpT)/(vap.pd*vap.d*vap.d);
-        dxT := -dxv*(dvTl + aux.x*(dvTv-dvTl));
-        duTl := liq.cv + (aux.T*liq.pt-p)*dvTl;
-        duTv := vap.cv + (aux.T*vap.pt-p)*dvTv;
-        aux.cv := duTl + aux.x*(duTv-duTl) + dxT * (vap.u-liq.u);
-        dpTT := dxv*(vap.cv/aux.T-liq.cv/aux.T + dvTv*(vap.pt-aux.dpT)-dvTl*(liq.pt-aux.dpT));
-        dxdd := 2.0*dxv/(aux.rho*aux.rho*aux.rho);
-        dxTd := dxv*dxv*(dvTv-dvTl)/(aux.rho*aux.rho);
-        dvTTl := ((liq.ptt-dpTT)/(liq.d*liq.d) + dvTl*(liq.d*dvTl*(2.0*liq.pd + liq.d*liq.pdd)
-             -2.0*liq.ptd))/liq.pd;
-        dvTTv := ((vap.ptt-dpTT)/(vap.d*vap.d) + dvTv*(vap.d*dvTv*(2.0*vap.pd + vap.d*vap.pdd)
-             -2.0*vap.ptd))/vap.pd;
-        dxTT := -dxv*(2.0*dxT*(dvTv-dvTl) + dvTTl + aux.x*(dvTTv-dvTTl));
-        duTTl := liq.cvt +(liq.pt-aux.dpT + aux.T*(2.0*liq.ptt -liq.d*liq.d*liq.ptd *dvTl))*dvTl + (aux.T*
-          liq.pt - p)*dvTTl;
-        duTTv := vap.cvt +(vap.pt-aux.dpT + aux.T*(2.0*vap.ptt -vap.d*vap.d*vap.ptd *dvTv))*dvTv + (aux.T*
-          vap.pt - p)*dvTTv;
-        aux.cvt := duTTl + aux.x *(duTTv -duTTl) + 2.0*dxT*(duTv-duTl) + dxTT *(vap.u-liq.u);
-        aux.s := liq.s + aux.x*(vap.s - liq.s);
-        // next ones are only for cases where region 4 is called improperly
-        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp); // undefined
-        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt); // dpT
-        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd); // 0.0
-        aux.vt := dvTl + aux.x*(dvTv-dvTl) +dxT*(1/vap.d-1/liq.d);
-        // v = vl + x*(vv-vl)
-        aux.vp := aux.vt/aux.dpT;
-        aux.pdd := 0.0;
-        aux.ptd := 0.0;
-        aux.ptt := dpTT;
-        aux.vtt := dvTTl + aux.x*(dvTTv-dvTTl);
-        aux.vtp := aux.vtt/aux.dpT;
-        //hpp := vp - T*vtp = aux.vt/aux.dpT - T*aux.vtt/aux.dpT;
-      else
-        assert(false, "error in region computation of IF97 steam tables"
-        + "(p = " + String(p) + ", h = " + String(h) + ")");
-      end if;
-      annotation (Icon(graphics));
-    end waterBasePropAnalytic_ph;
-
-    function waterBasePropAnalytic_pT
-      "intermediate property record for water (p and T prefered states)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region = 0
-        "if 0, do region computation, otherwise assume the region is this input";
-      output ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                            g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
-                                                                f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      Real vp3 "vp^3";
-      Real ivp3 "1/vp3";
-      Units.SI.SpecificVolume v;
-      Integer error "error flag for inverse iterations";
-    algorithm
-      aux.phase := 1;
-      aux.region := if region == 0 then ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(
-                                                                   p=p,T= T) else region;
-      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      aux.p := p;
-      aux.T := T;
-      if (aux.region == 1) or (aux.region == 2) or (aux.region == 5) then
-        if (aux.region == 1) then
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
-                                   p, T);
-          aux.x := 0.0;
-        elseif (aux.region == 2) then
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
-                                   p, T);
-          aux.x := 1.0;
-        else
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(
-                                   p, T);
-          aux.x := 1.0;
-        end if;
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := p/(aux.R*T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
-        aux.x := 0.0;
-        aux.vtt := aux.R*g.pi/aux.p*g.tau/aux.T*g.tau*g.gpitautau;
-        aux.vtp := aux.R*g.pi*g.pi/(aux.p*aux.p)*(g.gpipi - g.tau*g.gpipitau);
-        aux.vpp := aux.R*aux.T*g.pi*g.pi*g.pi/(aux.p*aux.p*aux.p)*g.gpipipi;
-        aux.cpt := aux.R*g.tau*g.tau/aux.T*(2*g.gtautau + g.tau*g.gtautautau);
-        aux.pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-        aux.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-        v := 1/aux.rho;
-        vp3 := aux.vp*aux.vp*aux.vp;
-        ivp3 := 1/vp3;
-        aux.ptt := -(aux.vtt*aux.vp*aux.vp -2.0*aux.vt*aux.vtp*aux.vp +aux.vt*aux.vt*aux.vpp)*ivp3;
-        aux.pdd := -aux.vpp*ivp3*v*v*v*v - 2*v*aux.pd;
-        aux.ptd := (aux.vtp*aux.vp-aux.vt*aux.vpp)*ivp3*v*v "= -ptv/d^2";
-        aux.cvt := (vp3*aux.cpt + aux.vp*aux.vp*aux.vt*aux.vt + 3.0*aux.vp*aux.vp*aux.T*aux.vt*aux.vtt
-      - 3.0*aux.vtp*aux.vp*aux.T*aux.vt*aux.vt + aux.T*aux.vt*aux.vt*aux.vt*aux.vpp)*ivp3;
-      elseif (aux.region == 3) then
-        (aux.rho,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(
-                                                    p=p,T= T,delp= 1.0e-7);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
-                                 aux.rho, T);
-        aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta);
-        aux.s := aux.R*(f.tau*f.ftau - f.f);
-        aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
-        aux.x := 0.0;
-        aux.pdd := aux.R*aux.T*f.delta/aux.rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
-             f.delta*f.delta*f.fdeltadeltadelta);
-        aux.ptt := aux.R*aux.rho*f.delta*f.tau*f.tau/aux.T*f.fdeltatautau;
-        aux.ptd := aux.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
-      -f.delta*f.tau*f.fdeltadeltatau);
-        aux.cvt := aux.R*f.tau*f.tau/aux.T*(2.0*f.ftautau + f.tau*f.ftautautau);
-        aux.cpt := (aux.cvt*aux.pd + aux.cv*aux.ptd + (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt/(aux.rho*aux.rho)
-      - aux.pt*aux.ptd)/aux.pd;
-      else
-        assert(false, "error in region computation of IF97 steam tables"
-        + "(p = " + String(p) + ", T = " + String(T) + ")");
-      end if;
-    end waterBasePropAnalytic_pT;
-
-    function waterBasePropAnalytic_dT
-      "intermediate property record for water (d and T prefered states)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density rho "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-      input Integer region = 0
-        "if 0, do region computation, otherwise assume the region is this input";
-      output ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-    protected
-      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
-      Units.SI.Density d_liq "liquid density";
-      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
-      Units.SI.Density d_vap "vapour density";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                            g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
-                                                                f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
-                                                                        liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
-                                                                        vap
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                            gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                                            gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
-                                                                fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
-                                                                fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Integer error "error flag for inverse iterations";
-      /// new stuff, for analytic Jacobian
-      Real dxv "der of x wrt v";
-      Real dxd "der of x wrt d";
-      Real dvTl "der of v wrt T at boiling";
-      Real dvTv "der of v wrt T at dew";
-      Real dxT "der of x wrt T";
-      Real duTl "der of u wrt T at boiling";
-      Real duTv "der of u wrt T at dew";
-      Real dpTT "2nd der of p wrt T";
-      Real dxdd "2nd der of x wrt d";
-      Real dxTd "2nd der of x wrt d and T";
-      Real dvTTl "2nd der of v wrt T at boiling";
-      Real dvTTv "2nd der of v wrt T at dew";
-      Real dxTT " 2nd der of x wrt T";
-      Real duTTl "2nd der of u wrt T at boiling";
-      Real duTTv "2nd der of u wrt T at dew";
-      // cvt is in aux record
-      Real vp3 "vp^3";
-      Real ivp3 "1/vp3";
-      Units.SI.SpecificVolume v;
-    algorithm
-      aux.region := if region == 0 then
-        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_dT(
-                                                              d=rho,T= T,phase= phase)) else region;
-      aux.phase := if aux.region == 4 then 2 else 1;
-      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      aux.rho := rho;
-      aux.T := T;
-      if (aux.region == 1) or (aux.region == 2) or (aux.region == 5) then
-        if (aux.region == 1) then
-          (
-    aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
-              d=rho,
-              T=T,
-              reldd=1.0e-9,
-              region=1);
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
-                                   aux.p, T);
-          aux.x := 0.0;
-        elseif (aux.region == 2) then
-          (
-    aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
-              d=rho,
-              T=T,
-              reldd=1.0e-8,
-              region=2);
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
-                                   aux.p, T);
-          aux.x := 1.0;
-        else
-          (
-    aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
-              d=rho,
-              T=T,
-              reldd=1.0e-8,
-              region=5);
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
-                                   aux.p, T);
-          aux.x := 1.0;
-        end if;
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := aux.p/(aux.R*T*g.pi*g.gpi);
-        aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
-        aux.vtt := aux.R*g.pi/aux.p*g.tau/aux.T*g.tau*g.gpitautau;
-        aux.vtp := aux.R*g.pi*g.pi/(aux.p*aux.p)*(g.gpipi - g.tau*g.gpipitau);
-        aux.vpp := aux.R*aux.T*g.pi*g.pi*g.pi/(aux.p*aux.p*aux.p)*g.gpipipi;
-        aux.cpt := aux.R*g.tau*g.tau/aux.T*(2*g.gtautau + g.tau*g.gtautautau);
-        aux.pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-        aux.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-        v := 1/aux.rho;
-        vp3 := aux.vp*aux.vp*aux.vp;
-        ivp3 := 1/vp3;
-        aux.ptt := -(aux.vtt*aux.vp*aux.vp -2.0*aux.vt*aux.vtp*aux.vp +aux.vt*aux.vt*aux.vpp)*ivp3;
-        aux.pdd := -aux.vpp*ivp3*v*v*v*v - 2*v*aux.pd;
-        aux.ptd := (aux.vtp*aux.vp-aux.vt*aux.vpp)*ivp3*v*v "= -ptv/d^2";
-        aux.cvt := (vp3*aux.cpt + aux.vp*aux.vp*aux.vt*aux.vt + 3.0*aux.vp*aux.vp*aux.T*aux.vt*aux.vtt
-      - 3.0*aux.vtp*aux.vp*aux.T*aux.vt*aux.vt + aux.T*aux.vt*aux.vt*aux.vt*aux.vpp)*ivp3;
-      elseif (aux.region == 3) then
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
-                                 rho, T);
-        aux.p := aux.R*rho*T*f.delta*f.fdelta;
-        aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta);
-        aux.s := aux.R*(f.tau*f.ftau - f.f);
-        aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        aux.pt := aux.R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
-        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
-        aux.x := 0.0;
-        aux.dpT := aux.pt; /*safety against div-by-0 in initialization*/
-        aux.pdd := aux.R*aux.T*f.delta/aux.rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
-             f.delta*f.delta*f.fdeltadeltadelta);
-        aux.ptt := aux.R*aux.rho*f.delta*f.tau*f.tau/aux.T*f.fdeltatautau;
-        aux.ptd := aux.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
-      -f.delta*f.tau*f.fdeltadeltatau);
-        aux.cvt := aux.R*f.tau*f.tau/aux.T*(2.0*f.ftautau + f.tau*f.ftautautau);
-        aux.cpt := (aux.cvt*aux.pd + aux.cv*aux.ptd + (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt/(aux.rho*aux.rho)
-      - aux.pt*aux.ptd)/aux.pd;
-      elseif (aux.region == 4) then
-        aux.p := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(
-                                     T);
-        d_liq := rhol_T(T);
-        d_vap := rhov_T(T);
-        h_liq := hl_p(aux.p);
-        h_vap := hv_p(aux.p);
-        aux.x := if (d_vap <> d_liq) then (1/rho - 1/d_liq)/(1/d_vap - 1/d_liq) else 1.0;
-        aux.h := h_liq + aux.x*(h_vap - h_liq);
-        if T <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TLIMIT1 then
-          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
-                                    aux.p, T);
-          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
-                                    aux.p, T);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(
-            gl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(
-            gv);
-        else
-          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
-                                    d_liq, T);
-          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
-                                    d_vap, T);
-          liq :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(
-            fl);
-          vap :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(
-            fv);
-        end if;
-        aux.s := liq.s + aux.x*(vap.s - liq.s);
-        dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d-vap.d) else 0.0;
-        dxd := -dxv/(aux.rho*aux.rho);
-        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*dxv else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
-                                                                                           aux.T);
-        dvTl := (liq.pt -aux.dpT)/(liq.pd*liq.d*liq.d);
-        dvTv := (vap.pt -aux.dpT)/(vap.pd*vap.d*vap.d);
-        dxT := -dxv*(dvTl + aux.x*(dvTv-dvTl));
-        duTl := liq.cv + (aux.T*liq.pt-aux.p)*dvTl;
-        duTv := vap.cv + (aux.T*vap.pt-aux.p)*dvTv;
-        aux.cv := duTl + aux.x*(duTv-duTl) + dxT * (vap.u-liq.u);
-        dpTT := dxv*(vap.cv/aux.T-liq.cv/aux.T + dvTv*(vap.pt-aux.dpT)-dvTl*(liq.pt-aux.dpT));
-        dxdd := 2.0*dxv/(aux.rho*aux.rho*aux.rho);
-        dxTd := dxv*dxv*(dvTv-dvTl)/(aux.rho*aux.rho);
-        dvTTl := ((liq.ptt-dpTT)/(liq.d*liq.d) + dvTl*(liq.d*dvTl*(2.0*liq.pd + liq.d*liq.pdd)
-             -2.0*liq.ptd))/liq.pd;
-        dvTTv := ((vap.ptt-dpTT)/(vap.d*vap.d) + dvTv*(vap.d*dvTv*(2.0*vap.pd + vap.d*vap.pdd)
-             -2.0*vap.ptd))/vap.pd;
-        dxTT := -dxv*(2.0*dxT*(dvTv-dvTl) + dvTTl + aux.x*(dvTTv-dvTTl));
-        duTTl := liq.cvt +(liq.pt-aux.dpT + aux.T*(2.0*liq.ptt -liq.d*liq.d*liq.ptd *dvTl))*dvTl + (aux.T*
-                liq.pt - aux.p)*dvTTl;
-        duTTv := vap.cvt +(vap.pt-aux.dpT + aux.T*(2.0*vap.ptt -vap.d*vap.d*vap.ptd *dvTv))*dvTv + (aux.T*
-                vap.pt - aux.p)*dvTTv;
-        aux.cvt := duTTl + aux.x *(duTTv -duTTl) + 2.0*dxT*(duTv-duTl) + dxTT *(vap.u-liq.u);
-        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
-        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
-        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
-        aux.ptt := dpTT;
-      else
-        assert(false, "error in region computation of IF97 steam tables"
-        + "(rho = " + String(rho) + ", T = " + String(T) + ")");
-      end if;
-    end waterBasePropAnalytic_dT;
-
-    function waterBaseProp_ps "intermediate property record for water"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Integer phase = 0
-        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-      input Integer region = 0
-        "if 0, do region computation, otherwise assume the region is this input";
-      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      Integer error "error flag for inverse iterations";
-      Units.SI.SpecificEntropy s_liq "liquid specific entropy";
-      Units.SI.Density d_liq "liquid density";
-      Units.SI.SpecificEntropy s_vap "vapour specific entropy";
-      Units.SI.Density d_vap "vapour density";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties vap
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Units.SI.Temperature t1
-        "temperature at phase boundary, using inverse from region 1";
-      Units.SI.Temperature t2
-        "temperature at phase boundary, using inverse from region 2";
-    algorithm
-      aux.region := if region == 0 then
-        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(
-                                                              p=p,s=s,phase=phase)) else region;
-      aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1;
-      aux.p := p;
-      aux.s := s;
-      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      if (aux.region == 1) then
-        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(
-                                     p, s);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
-                               p, aux.T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 0.0;
-      elseif (aux.region == 2) then
-        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(
-                                     p, s);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                               p, aux.T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 1.0;
-      elseif (aux.region == 3) then
-        (aux.rho,aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(
-                                                           p=p,s=s,delp=1.0e-7,dels=
-          1.0e-6);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                               aux.rho, aux.T);
-        aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta);
-        aux.s := aux.R*(f.tau*f.ftau - f.f);
-        aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
-        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
-        aux.x := 0.0;
-      elseif (aux.region == 4) then
-        s_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(
-                                       p);
-        s_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(
-                                       p);
-        aux.x := if (s_vap <> s_liq) then (s - s_liq)/(s_vap - s_liq) else 1.0;
-        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
-          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(
-                                    p, s_liq);
-          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(
-                                    p, s_vap);
-          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
-                                  p, t1);
-          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                                  p, t2);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
-          aux.T := t1 + aux.x*(t2 - t1);
-        else
-          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(
-                                       p);
-          d_liq := rhol_T(aux.T);
-          d_vap := rhov_T(aux.T);
-          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                                  d_liq, aux.T);
-          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                                  d_vap, aux.T);
-          liq :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
-          vap :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
-        end if;
-        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else
-             ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
-                                   aux.T);
-        aux.h := liq.h + aux.x*(vap.h - liq.h);
-        aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d));
-        aux.cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(
-              liq,
-              vap,
-              aux.x,
-              aux.T,
-              p);
-        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
-        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
-        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
-      elseif (aux.region == 5) then
-        (aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(
-                                                  p=p,s=s,relds= 1.0e-7);
-        assert(error == 0, "error in inverse iteration of steam tables");
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(
-                               p, aux.T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-      else
-        assert(false, "error in region computation of IF97 steam tables"
-        + "(p = " + String(p) + ", s = " + String(s) + ")");
-      end if;
-    end waterBaseProp_ps;
-
-    replaceable record iter =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData;
-
-    function phase_ph "phase as a function of  pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Integer phase "true if in liquid or gas or supercritical region";
-    algorithm
-      phase := if ((h < hl_p(p) or h > hv_p(p)) or p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT)
-                                                                                               then
-                                                                                 1 else 2;
-      annotation (InlineNoEvent=false);
-    end phase_ph;
-
-    function phase_dT "phase as a function of  pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density rho "density";
-      input Units.SI.Temperature T "temperature";
-      output Integer phase "true if in liquid or gas or supercritical region";
-    algorithm
-      phase := if not ((rho < rhol_T(T) and rho > rhov_T(T)) and T <
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT) then
-                         1 else 2;
-      annotation (InlineNoEvent=false);
-    end phase_dT;
-
-    function rho_props_ph
-      "density as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := aux.rho;
-
-      annotation (
-        derivative(noDerivative=aux) = rho_ph_d,
-        Inline=false,
-        LateInline=true);
-    end rho_props_ph;
-
-    function rho_ph "density as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := rho_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end rho_ph;
-
-    function rho_ph_d "derivative function of rho_ph"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real p_d "derivative of pressure";
-      input Real h_d "derivative of specific enthalpy";
-      output Real rho_d "derivative of density";
-    algorithm
-      if (aux.region == 4) then
-        rho_d := (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T))*p_d
-           + (-aux.rho*aux.rho/(aux.dpT*aux.T))*h_d;
-      elseif (aux.region == 3) then
-        rho_d := ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd*
-          aux.cv + aux.T*aux.pt*aux.pt))*p_d + (-aux.rho*aux.rho*aux.pt/(aux.
-          rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_d;
-      else
-        //regions 1,2,5
-        rho_d := (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux.
-          vt*aux.vt)/aux.cp)*p_d + (-aux.rho*aux.rho*aux.vt/(aux.cp))*h_d;
-      end if;
-
-      annotation (derivative(noDerivative=aux) = rho_ph_dd);
-    end rho_ph_d;
-
-    function rho_ph_dd "Second order derivative function of rho_ph"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real p_d "derivative of pressure";
-      input Real h_d "derivative of specific enthalpy";
-      input Real p_dd "second derivative of pressure";
-      input Real h_dd "second derivative of specific enthalpy";
-      output Real rho_dd "Second derivative of density";
-    protected
-      Units.SI.DerDensityByPressure ddph "Derivative of d by p at constant h";
-      Units.SI.DerDensityByEnthalpy ddhp "Derivative of d by h at constant p";
-      Real ddph_ph "Derivative of ddph by p";
-      Real ddph_hp "Derivative of ddph by h";
-      Real ddhp_hp "Derivative of ddhp by h";
-      Real ddhp_ph "Derivative of ddhp by p";
-    algorithm
-      ddph := ddph_props(p,h,aux);
-      ddhp := ddhp_props(p,h,aux);
-      (ddph_ph,ddph_hp) := ddph_ph_dd(p,h,aux);
-      (ddhp_hp,ddhp_ph) := ddhp_ph_dd(p,h,aux);
-      rho_dd := ddph*p_dd + 2.0*ddhp_ph*p_d*h_d + ddph_ph*p_d*p_d + ddhp_hp*h_d*h_d + ddhp*h_dd;
-    end rho_ph_dd;
-
-    function T_props_ph
-      "temperature as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic
-        properties "auxiliary record";
-      output Units.SI.Temperature T "temperature";
-    algorithm
-      T := properties.T;
-
-      annotation (derivative(noDerivative=properties) = T_ph_der,
-        Inline=false,
-        LateInline=true);
-    end T_props_ph;
-
-    function T_ph "temperature as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Temperature T "Temperature";
-    algorithm
-      T := T_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end T_ph;
-
-    function T_ph_der "derivative function of T_ph"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real h_der "derivative of specific enthalpy";
-      output Real T_der "derivative of temperature";
-    algorithm
-      if (aux.region == 4) then
-        T_der := 1/aux.dpT*p_der;
-      elseif (aux.region == 3) then
-        T_der := ((-aux.rho*aux.pd + aux.T*aux.pt)/(aux.rho*aux.rho*aux.pd*aux.cv
-           + aux.T*aux.pt*aux.pt))*p_der + ((aux.rho*aux.rho*aux.pd)/(aux.rho*aux.
-           rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_der;
-      else
-        //regions 1,2 or 5
-        T_der := ((-1/aux.rho + aux.T*aux.vt)/aux.cp)*p_der + (1/aux.cp)*h_der;
-      end if;
-    end T_ph_der;
-
-    function s_props_ph
-      "specific entropy as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic
-        properties "auxiliary record";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := properties.s;
-
-      annotation (derivative(noDerivative=properties) = s_ph_der,
-    Inline=false,
-    LateInline=true);
-    end s_props_ph;
-
-    function s_ph
-      "specific entropy as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase =   0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := s_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end s_ph;
-
-    function s_ph_der
-      "specific entropy as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real h_der "derivative of specific enthalpy";
-      output Real s_der "derivative of entropy";
-    algorithm
-      s_der := -1/(aux.rho*aux.T)*p_der + 1/aux.T*h_der;
-    end s_ph_der;
-
-    function cv_props_ph
-      "specific heat capacity at constant volume as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := aux.cv;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cv_props_ph;
-
-    function cv_ph
-      "specific heat capacity at constant volume as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := cv_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end cv_ph;
-
-    function regionAssertReal "assert function for inlining"
-      extends Modelica.Icons.Function;
-      input Boolean check "condition to check";
-      output Real dummy "dummy output";
-    algorithm
-      assert(check, "this function can not be called with two-phase inputs!");
-    end regionAssertReal;
-
-    function cp_props_ph
-      "specific heat capacity at constant pressure as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := aux.cp;
-
-      annotation (
-        Inline=false,
-        LateInline=true,
-      derivative(noDerivative=aux) = cp_ph_der);
-    end cp_props_ph;
-
-    function cp_ph
-      "specific heat capacity at constant pressure as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := cp_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end cp_ph;
-
-    function cp_ph_der "derivative function of cp_ph"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real h_der "derivative of specific enthalpy";
-      output Real cp_der "derivative of heat capacity";
-    protected
-      Real detPH "Determinant";
-      Real dht;
-      Real dhd;
-      Real ddhp;
-      Real ddph;
-      Real dtph;
-      Real dthp;
-      Real detPH_d;
-      Real dcp_d;
-    algorithm
-      if (aux.region == 4) then
-        cp_der := 0.0;
-      elseif (aux.region == 3) then
-        detPH := aux.cp*aux.pd;
-        dht := aux.cv + aux.pt/aux.rho;
-        dhd := (aux.pd - aux.T*aux.pt/aux.rho)/aux.rho;
-        ddph := dht/ detPH;
-        ddhp := -aux.pt/detPH;
-        dtph := -dhd/detPH;
-        dthp := aux.pd/detPH;
-        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt/aux.rho)
-            -aux.ptt*aux.pd) *aux.T/(aux.rho*aux.rho);
-        dcp_d :=(detPH_d - aux.cp*aux.pdd)/aux.pd;
-        cp_der := (ddph * dcp_d + dtph * aux.cpt)*p_der +
-           (ddhp * dcp_d + dthp * aux.cpt)*h_der;
-      else
-        //regions 1,2 or 5
-        cp_der := (-(aux.T * aux.vtt * aux.cp + aux.cpt/aux.rho - aux.cpt * aux.T * aux.vt) / aux.cp)*p_der +
-          aux.cpt/aux.cp*h_der;
-      end if;
-      annotation (Documentation(info="<html></html>"));
-    end cp_ph_der;
-
-    function beta_props_ph
-      "isobaric expansion coefficient as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := if aux.region == 3 or aux.region == 4 then
-        aux.pt/(aux.rho*aux.pd) else
-        aux.vt*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end beta_props_ph;
-
-    function beta_ph
-      "isobaric expansion coefficient as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := beta_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end beta_ph;
-
-    function kappa_props_ph
-      "isothermal compressibility factor as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := if aux.region == 3 or aux.region == 4 then
-        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end kappa_props_ph;
-
-    function kappa_ph
-      "isothermal compressibility factor as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := kappa_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end kappa_ph;
-
-    function velocityOfSound_props_ph
-      "speed of sound as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      // dp/drho at constant s
-      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
-        if aux.region == 4 then
-        sqrt(1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T))) else
-             sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end velocityOfSound_props_ph;
-
-    function velocityOfSound_ph
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      v_sound := velocityOfSound_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end velocityOfSound_ph;
-
-    function isentropicExponent_props_ph
-      "isentropic exponent as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
-             if aux.region == 4 then 1/(aux.rho*p)*aux.dpT*aux.dpT*aux.T/aux.cv else
-        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_props_ph;
-
-    function isentropicExponent_ph
-      "isentropic exponent as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase =   0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := isentropicExponent_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_ph;
-
-    function ddph_props "density derivative by pressure"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.DerDensityByPressure ddph
-        "density derivative by pressure";
-    algorithm
-      ddph := if aux.region == 3 then
-        ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)) else
-        if aux.region == 4 then  (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) else
-             (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux.vt*aux.vt)/aux.cp);
-
-      annotation (
-        Inline=false,
-        LateInline=true,
-        derivative(noDerivative=aux) = ddph_ph_der);
-    end ddph_props;
-
-    function ddph "density derivative by pressure"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.DerDensityByPressure ddph
-        "density derivative by pressure";
-    algorithm
-      ddph := ddph_props(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end ddph;
-
-    function ddph_ph_der "derivative function of ddph"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real h_der "derivative of specific enthalpy";
-      output Real ddph_der "Gradient of ddph";
-    protected
-      Units.SI.SpecificVolume v=1/aux.rho;
-      Real detPH "Determinant";
-      Real dht;
-      Real dhd;
-      Real ddhp;
-      Real ddph;
-      Real dtph;
-      Real dthp;
-      Real detPH_d;
-      Real detPH_t;
-      Real dhtt;
-      Real dhtd;
-      Real ddph_t;
-      Real ddph_d;
-      Real ddhp_t;
-      Real ddhp_d;
-    algorithm
-      if (aux.region == 4) then
-
-        dht := aux.cv + aux.dpT * v;
-        dhd := -aux.T * aux.dpT*v*v;
-        detPH := -aux.dpT * dhd;
-        dtph := 1.0 / aux.dpT;
-        ddph := dht / detPH;
-        ddhp := -aux.dpT / detPH;
-        detPH_t := 2.0 * aux.ptt / aux.dpT + 1.0 / aux.T; /* = detPH_t / detPH */
-        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
-
-        dhtt := aux.cvt + aux.ptt * v;
-        dhtd := -(aux.T * aux.ptt + aux.dpT) *v*v;
-        ddhp_t := ddhp * (aux.ptt / aux.dpT - detPH_t);
-        ddhp_d := ddhp * (-detPH_d);
-        ddph_t := ddph * (dhtt / dht - detPH_t);
-        ddph_d := ddph * (dhtd / dht - detPH_d);
-        ddph_der := (ddph * ddph_d + dtph * ddph_t)*p_der + (ddhp * ddph_d)*h_der;
-      else
-        detPH := aux.cp*aux.pd;
-        dht := aux.cv + aux.pt*v;
-        dhd := (aux.pd - aux.T*aux.pt*v)*v;
-        ddph := dht/ detPH;
-        ddhp := -aux.pt/detPH;
-        dtph := -dhd/detPH;
-        dthp := aux.pd/detPH;
-        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt*v)
-            -aux.ptt*aux.pd) *aux.T*v*v;
-        detPH_t := aux.cvt*aux.pd + aux.cv*aux.ptd +
-            (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt*v*v;
-        dhtt := aux.cvt + aux.ptt*v;
-        dhtd := (aux.ptd - (aux.T * aux.ptt + aux.pt)*v) *v;
-        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
-        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
-        ddhp_t := ddhp * (aux.ptt / aux.pt - detPH_t / detPH);
-        ddhp_d := ddhp * (aux.ptd / aux.pt - detPH_d / detPH);
-        ddph_der := (ddph * ddph_d + dtph * ddph_t)*p_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
-
-      end if;
-    end ddph_ph_der;
-
-    function ddph_ph_dd "Second derivatives function of density"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Real ddph_ph "Second derivative of density by p at constant h";
-      output Real ddph_hp "Second mixed derivative of density by p and h";
-    protected
-      Units.SI.SpecificVolume v=1/aux.rho;
-      Real detPH "Determinant";
-      Real dht;
-      Real dhd;
-      Real ddhp;
-      Real ddph;
-      Real dtph;
-      Real dthp;
-      Real detPH_d;
-      Real detPH_t;
-      Real dhtt;
-      Real dhtd;
-      Real ddph_t;
-      Real ddph_d;
-      Real ddhp_t;
-      Real ddhp_d;
-    algorithm
-      if (aux.region == 4) then
-        dht := aux.cv + aux.dpT * v;
-        dhd := -aux.T * aux.dpT*v*v;
-        detPH := -aux.dpT * dhd;
-        dtph := 1.0 / aux.dpT;
-        ddph := dht / detPH;
-        ddhp := -aux.dpT / detPH;
-        detPH_t := 2.0 * aux.ptt / aux.dpT + 1.0 / aux.T; /* = detPH_t / detPH */
-        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
-        dhtt := aux.cvt + aux.ptt * v;
-        dhtd := -(aux.T * aux.ptt + aux.dpT) *v*v;
-        ddhp_t := ddhp * (aux.ptt / aux.dpT - detPH_t);
-        ddhp_d := ddhp * (-detPH_d);
-        ddph_t := ddph * (dhtt / dht - detPH_t);
-        ddph_d := ddph * (dhtd / dht - detPH_d);
-        ddph_ph := (ddph * ddph_d + dtph * ddph_t);
-        ddph_hp := (ddhp * ddph_d);
-      else
-        detPH := aux.cp*aux.pd;
-        dht := aux.cv + aux.pt*v;
-        dhd := (aux.pd - aux.T*aux.pt*v)*v;
-        ddph := dht/ detPH;
-        ddhp := -aux.pt/detPH;
-        dtph := -dhd/detPH;
-        dthp := aux.pd/detPH;
-        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt*v)
-            -aux.ptt*aux.pd) *aux.T*v*v;
-        detPH_t := aux.cvt*aux.pd + aux.cv*aux.ptd +
-            (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt*v*v;
-        dhtt := aux.cvt + aux.ptt*v;
-        dhtd := (aux.ptd - (aux.T * aux.ptt + aux.pt)*v) *v;
-        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
-        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
-        ddhp_t := ddhp * (aux.ptt / aux.pt - detPH_t / detPH);
-        ddhp_d := ddhp * (aux.ptd / aux.pt - detPH_d / detPH);
-        ddph_ph := (ddph * ddph_d + dtph * ddph_t);
-        ddph_hp := (ddph * ddhp_d + dtph * ddhp_t);
-      end if;
-    end ddph_ph_dd;
-
-    function ddhp_props "density derivative by specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.DerDensityByEnthalpy ddhp
-        "density derivative by specific enthalpy";
-    algorithm
-      ddhp := if aux.region == 3 then
-        -aux.rho*aux.rho*aux.pt/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt) else
-        if aux.region == 4 then -aux.rho*aux.rho/(aux.dpT*aux.T) else
-             -aux.rho*aux.rho*aux.vt/(aux.cp);
-
-      annotation (
-        Inline=false,
-        LateInline=true,
-      derivative(noDerivative=aux) = ddhp_ph_der);
-    end ddhp_props;
-
-    function ddhp "density derivative by specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.DerDensityByEnthalpy ddhp
-        "density derivative by specific enthalpy";
-    algorithm
-      ddhp := ddhp_props(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
-    end ddhp;
-
-    function ddhp_ph_der "derivative function of ddhp"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real h_der "derivative of specific enthalpy";
-      output Real ddhp_der "Gradient of ddhp";
-    protected
-      Units.SI.SpecificVolume v=1/aux.rho;
-      Real detPH "Determinant";
-      Real dht;
-      Real dhd;
-      Real ddhp;
-      Real ddph;
-      Real dtph;
-      Real dthp;
-      Real detPH_d;
-      Real detPH_t;
-      Real dhtt;
-      Real dhtd;
-      Real ddhp_d;
-      Real ddhp_t;
-      Real ddph_d;
-    algorithm
-      if (aux.region == 4) then
-
-        dht := aux.cv + aux.dpT * v;
-        dhd := -aux.T * aux.dpT*v*v;
-        detPH := -aux.dpT * dhd;
-        dtph := 1.0 / aux.dpT;
-        ddph := dht / detPH;
-        ddhp := -aux.dpT / detPH;
-        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
-        dhtt := aux.cvt + aux.ptt * v;
-        dhtd := -(aux.T * aux.ptt + aux.dpT) *v*v;
-        ddhp_d := ddhp * (-detPH_d);
-        ddph_d := ddph * (dhtd / dht - detPH_d);
-        ddhp_der := (ddhp * ddhp_d)*h_der + (ddhp * ddph_d)*p_der;
-      else
-        detPH := aux.cp*aux.pd;
-        dht := aux.cv + aux.pt*v;
-        dhd := (aux.pd - aux.T*aux.pt*v)*v;
-        ddph := dht/ detPH;
-        ddhp := -aux.pt/detPH;
-        dtph := -dhd/detPH;
-        dthp := aux.pd/detPH;
-        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt*v)
-            -aux.ptt*aux.pd) *aux.T*v*v;
-        detPH_t := aux.cvt*aux.pd + aux.cv*aux.ptd +
-            (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt*v*v;
-        dhtt := aux.cvt + aux.ptt*v;
-        dhtd := (aux.ptd - (aux.T * aux.ptt + aux.pt)*v) *v;
-        ddhp_t := ddhp * (aux.ptt / aux.pt - detPH_t / detPH);
-        ddhp_d := ddhp * (aux.ptd / aux.pt - detPH_d / detPH);
-        ddhp_der := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
-      end if;
-    end ddhp_ph_der;
-
-    function ddhp_ph_dd "Second derivatives of density w.r.t h and p"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Real ddhp_hp "Second derivative of density by h at constant p";
-      output Real ddhp_ph "Second mixed derivative of density by p and h";
-    protected
-      Units.SI.SpecificVolume v=1/aux.rho;
-      Real detPH "Determinant";
-      Real dht;
-      Real dhd;
-      Real ddhp;
-      Real ddph;
-      Real dtph;
-      Real dthp;
-      Real detPH_d;
-      Real detPH_t;
-      Real dhtt;
-      Real dhtd;
-      Real ddhp_d;
-      Real ddhp_t;
-      Real ddph_d;
-    algorithm
-      if (aux.region == 4) then
-        dht := aux.cv + aux.dpT * v;
-        dhd := -aux.T * aux.dpT*v*v;
-        detPH := -aux.dpT * dhd;
-        dtph := 1.0 / aux.dpT;
-        ddph := dht / detPH;
-        ddhp := -aux.dpT / detPH;
-        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
-        dhtt := aux.cvt + aux.ptt * v;
-        dhtd := -(aux.T * aux.ptt + aux.dpT) *v*v;
-        ddhp_d := ddhp * (-detPH_d);
-        ddph_d := ddph * (dhtd / dht - detPH_d);
-        ddhp_hp := (ddhp * ddhp_d);
-        ddhp_ph := (ddhp * ddph_d);
-      else
-        detPH := aux.cp*aux.pd;
-        dht := aux.cv + aux.pt*v;
-        dhd := (aux.pd - aux.T*aux.pt*v)*v;
-        ddph := dht/ detPH;
-        ddhp := -aux.pt/detPH;
-        dtph := -dhd/detPH;
-        dthp := aux.pd/detPH;
-        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt*v)
-            -aux.ptt*aux.pd) *aux.T*v*v;
-        detPH_t := aux.cvt*aux.pd + aux.cv*aux.ptd +
-            (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt*v*v;
-        dhtt := aux.cvt + aux.ptt*v;
-        dhtd := (aux.ptd - (aux.T * aux.ptt + aux.pt)*v) *v;
-        ddhp_t := ddhp * (aux.ptt / aux.pt - detPH_t / detPH);
-        ddhp_d := ddhp * (aux.ptd / aux.pt - detPH_d / detPH);
-        ddhp_hp :=  (ddhp * ddhp_d + dthp * ddhp_t);
-        ddhp_hp :=  (ddph * ddhp_d + dtph * ddhp_t);
-      end if;
-    end ddhp_ph_dd;
-
-    function rho_props_pT "density as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := aux.rho;
-
-      annotation (
-        derivative(noDerivative=aux) = rho_pT_der,
-        Inline=false,
-        LateInline=true);
-    end rho_props_pT;
-
-    function rho_pT "density as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := rho_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
-    end rho_pT;
-
-    function h_props_pT
-      "specific enthalpy as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := aux.h;
-
-      annotation (
-        derivative(noDerivative=aux) = h_pT_der,
-        Inline=false,
-        LateInline=true);
-    end h_props_pT;
-
-    function h_pT "specific enthalpy as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "Temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := h_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
-    end h_pT;
-
-    function h_pT_der "derivative function of h_pT"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real T_der "derivative of temperature";
-      output Real h_der "derivative of specific enthalpy";
-    algorithm
-      if (aux.region == 3) then
-        h_der := ((-aux.rho*aux.pd + T*aux.pt)/(aux.rho*aux.rho*aux.pd))*p_der +
-          ((aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho
-          *aux.pd))*T_der;
-      else
-        //regions 1,2 or 5
-        h_der := (1/aux.rho - aux.T*aux.vt)*p_der + aux.cp*T_der;
-      end if;
-    end h_pT_der;
-
-    function rho_pT_der "derivative function of rho_pT"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real T_der "derivative of temperature";
-      output Real rho_der "derivative of density";
-    algorithm
-      if (aux.region == 3) then
-        rho_der := (1/aux.pd)*p_der - (aux.pt/aux.pd)*T_der;
-      else
-        //regions 1,2 or 5
-        rho_der := (-aux.rho*aux.rho*aux.vp)*p_der + (-aux.rho*aux.rho*aux.vt)*
-          T_der;
-      end if;
-    end rho_pT_der;
-
-    function s_props_pT
-      "specific entropy as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := aux.s;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end s_props_pT;
-
-    function s_pT "temperature as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := s_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end s_pT;
-
-    function cv_props_pT
-      "specific heat capacity at constant volume as function of pressure and temperature"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := aux.cv;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cv_props_pT;
-
-    function cv_pT
-      "specific heat capacity at constant volume as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := cv_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end cv_pT;
-
-    function cp_props_pT
-      "specific heat capacity at constant pressure as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := if aux.region == 3 then
-        (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd) else
-        aux.cp;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cp_props_pT;
-
-    function cp_pT
-      "specific heat capacity at constant pressure as function of pressure and temperature"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := cp_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end cp_pT;
-
-    function beta_props_pT
-      "isobaric expansion coefficient as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := if aux.region == 3 then
-        aux.pt/(aux.rho*aux.pd) else
-        aux.vt*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end beta_props_pT;
-
-    function beta_pT
-      "isobaric expansion coefficient as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := beta_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end beta_pT;
-
-    function kappa_props_pT
-      "isothermal compressibility factor as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := if aux.region == 3 then
-        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end kappa_props_pT;
-
-    function kappa_pT
-      "isothermal compressibility factor as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := kappa_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end kappa_pT;
-
-    function velocityOfSound_props_pT
-      "speed of sound as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      // dp/drho at constant s
-      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
-        sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end velocityOfSound_props_pT;
-
-    function velocityOfSound_pT
-      "speed of sound as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      v_sound := velocityOfSound_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
-    end velocityOfSound_pT;
-
-    function isentropicExponent_props_pT
-      "isentropic exponent as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
-        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_props_pT;
-
-    function isentropicExponent_pT
-      "isentropic exponent as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := isentropicExponent_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_pT;
-
-    function h_props_dT
-      "specific enthalpy as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := aux.h;
-
-      annotation (
-        derivative(noDerivative=aux) = h_dT_der,
-        Inline=false,
-        LateInline=true);
-    end h_props_dT;
-
-    function h_dT "specific enthalpy as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := h_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
-    end h_dT;
-
-    function h_dT_der "derivative function of h_dT"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real d_der "derivative of density";
-      input Real T_der "derivative of temperature";
-      output Real h_der "derivative of specific enthalpy";
-    algorithm
-      if (aux.region == 3) then
-        h_der := ((-d*aux.pd + T*aux.pt)/(d*d))*d_der + ((aux.cv*d + aux.pt)/d)*
-          T_der;
-      elseif (aux.region == 4) then
-        h_der := T*aux.dpT/(d*d)*d_der + ((aux.cv*d + aux.dpT)/d)*T_der;
-      else
-        //regions 1,2 or 5
-        h_der := (-(-1/d + T*aux.vt)/(d*d*aux.vp))*d_der + ((aux.vp*aux.cp - aux.
-          vt/d + T*aux.vt*aux.vt)/aux.vp)*T_der;
-      end if;
-    end h_dT_der;
-
-    function p_props_dT "pressure as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.Pressure p "pressure";
-    algorithm
-      p := aux.p;
-
-      annotation (
-        derivative(noDerivative=aux) = p_dT_der,
-        Inline=false,
-        LateInline=true);
-    end p_props_dT;
-
-    function p_dT "pressure as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Pressure p "pressure";
-    algorithm
-      p := p_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
-    end p_dT;
-
-    function p_dT_der "derivative function of p_dT"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      input Real d_der "derivative of density";
-      input Real T_der "derivative of temperature";
-      output Real p_der "derivative of pressure";
-    algorithm
-      if (aux.region == 3) then
-        p_der := aux.pd*d_der + aux.pt*T_der;
-      elseif (aux.region == 4) then
-        p_der := aux.dpT*T_der;
-        /*density derivative is 0.0*/
-      else
-        //regions 1,2 or 5
-        p_der := (-1/(d*d*aux.vp))*d_der + (-aux.vt/aux.vp)*T_der;
-      end if;
-    end p_dT_der;
-
-    function s_props_dT
-      "specific entropy as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := aux.s;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end s_props_dT;
-
-    function s_dT "temperature as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := s_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
-    end s_dT;
-
-    function cv_props_dT
-      "specific heat capacity at constant volume as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := aux.cv;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cv_props_dT;
-
-    function cv_dT
-      "specific heat capacity at constant volume as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := cv_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
-    end cv_dT;
-
-    function cp_props_dT
-      "specific heat capacity at constant pressure as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := aux.cp;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cp_props_dT;
-
-    function cp_dT
-      "specific heat capacity at constant pressure as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := cp_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
-    end cp_dT;
-
-    function beta_props_dT
-      "isobaric expansion coefficient as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := if aux.region == 3 or aux.region == 4 then
-        aux.pt/(aux.rho*aux.pd) else
-        aux.vt*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end beta_props_dT;
-
-    function beta_dT
-      "isobaric expansion coefficient as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := beta_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
-    end beta_dT;
-
-    function kappa_props_dT
-      "isothermal compressibility factor as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := if aux.region == 3 or aux.region == 4 then
-        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end kappa_props_dT;
-
-    function kappa_dT
-      "isothermal compressibility factor as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := kappa_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
-    end kappa_dT;
-
-    function velocityOfSound_props_dT
-      "speed of sound as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      // dp/drho at constant s
-      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
-        if aux.region == 4 then
-        sqrt(1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T))) else
-             sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end velocityOfSound_props_dT;
-
-    function velocityOfSound_dT
-      "speed of sound as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      v_sound := velocityOfSound_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
-    end velocityOfSound_dT;
-
-    function isentropicExponent_props_dT
-      "isentropic exponent as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
-        "auxiliary record";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := if aux.region == 3 then 1/(aux.rho*aux.p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
-             if aux.region == 4 then 1/(aux.rho*aux.p)*aux.dpT*aux.dpT*aux.T/aux.cv else
-        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_props_dT;
-
-    function isentropicExponent_dT
-      "isentropic exponent as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := isentropicExponent_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_dT;
-
-  public
-    function hl_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p
-      "compute the saturated liquid specific h(p)";
-    function hv_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p
-      "compute the saturated vapour specific h(p)";
-
-    function sl_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p
-      "compute the saturated liquid specific s(p)";
-    function sv_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p
-      "compute the saturated vapour specific s(p)";
-
-    function rhol_T =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_T
-      "compute the saturated liquid d(T)";
-    function rhov_T =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_T
-      "compute the saturated vapour d(T)";
-
-    function rhol_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_p
-      "compute the saturated liquid d(p)";
-    function rhov_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_p
-      "compute the saturated vapour d(p)";
-
-    function dynamicViscosity =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.visc_dT
-      "compute eta(d,T) in the one-phase region";
-    function thermalConductivity =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.cond_industrial_dT
-      "compute lambda(d,T) in the one-phase region";
-    function surfaceTension =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.surfaceTension
-      "compute sigma(T) at saturation T";
-
-  //   function isentropicEnthalpy
-  //     "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
-  //     extends Modelica.Icons.Function;
-  //     input SI.Pressure p "pressure";
-  //     input SI.SpecificEntropy s "specific entropy";
-  //     input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known";
-  //     output SI.SpecificEnthalpy h "specific enthalpy";
-  //   algorithm
-  //    h := BaseIF97.Isentropic.water_hisentropic(p,s,phase);
-  //   end isentropicEnthalpy;
-
-    function isentropicEnthalpy
-      "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := isentropicEnthalpy_props(p, s, waterBaseProp_ps(p, s, phase, region));
-    end isentropicEnthalpy;
-
-    function isentropicEnthalpy_props
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificEnthalpy h "isentropic enthalpay";
-    algorithm
-      h := aux.h;
-
-      annotation (derivative(noDerivative=aux) = isentropicEnthalpy_der,
-    Inline=false,
-    LateInline=true);
-    end isentropicEnthalpy_props;
-
-    function isentropicEnthalpy_der
-      "derivative of isentropic specific enthalpy from p,s"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      input Real p_der "pressure derivative";
-      input Real s_der "entropy derivative";
-      output Real h_der "specific enthalpy derivative";
-    algorithm
-      h_der := 1/aux.rho*p_der + aux.T*s_der;
-    end isentropicEnthalpy_der;
-
-    function dynamicIsentropicEnthalpy
-      "isentropic specific enthalpy from p,s and good guesses of d and T"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Units.SI.Density dguess
-        "good guess density, e.g. from adjacent volume";
-      input Units.SI.Temperature Tguess
-        "good guess temperature, e.g. from adjacent volume";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-     h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.water_hisentropic_dyn(
-                                                    p,s,dguess,Tguess,0);
-    end dynamicIsentropicEnthalpy;
-
-    annotation (Icon(graphics={
-          Text(
-            extent={{-102,0},{24,-26}},
-            lineColor={242,148,0},
-            textString=
-                 "Thermo"),
-          Text(
-            extent={{-4,8},{68,-34}},
-            lineColor={46,170,220},
-            textString=
-                 "SysPro"),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
-                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
-                -50,6},{-62,2}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
-                8},{-42,22},{-42,30},{-44,38}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
-                12},{-26,12},{-28,12},{-26,20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,30},{-6,26}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,36},{-6,32}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,42},{-6,38}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,48},{-6,44}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,32},{-2,28}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,38},{-2,34}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,44},{-2,40}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,50},{-2,46}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
-                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
-                -50,6},{-62,2}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Line(
-            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-            color={46,170,220},
-            thickness=0.5),
-          Polygon(
-            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-          Line(
-            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-            color={0,0,255},
-            smooth=Smooth.None),
-          Line(
-            points={{80,80},{100,100}},
-            color={0,0,255},
-            smooth=Smooth.None)}));
-  end AnalyticDerivatives;
-
-  package Standard "Standard version without Anaytic Jacobians"
-
-    import ThermoSysPro.Properties.WaterSteam.BaseIF97.*;
-
-    replaceable record iter =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData;
-
-    function waterBaseProp_ph "intermediate property record for water"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase =  0
-        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-      input Integer region = 0
-        "if 0, do region computation, otherwise assume the region is this input";
-      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      Integer error "error flag for inverse iterations";
-      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
-      Units.SI.Density d_liq "liquid density";
-      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
-      Units.SI.Density d_vap "vapour density";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties vap
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Units.SI.Temperature t1
-        "temperature at phase boundary, using inverse from region 1";
-      Units.SI.Temperature t2
-        "temperature at phase boundary, using inverse from region 2";
-    algorithm
-      aux.region := if region == 0 then
-        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ph(
-                                                              p=p,h= h,phase= phase)) else region;
-      aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1;
-      aux.p := max(p,611.657);
-      aux.h := max(h,1e3);
-      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      if (aux.region == 1) then
-        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(
-                                     aux.p, aux.h);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
-                               p, aux.T);
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 0.0;
-        aux.dpT := -aux.vt/aux.vp;
-      elseif (aux.region == 2) then
-        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(
-                                     aux.p, aux.h);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                               p, aux.T);
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 1.0;
-        aux.dpT := -aux.vt/aux.vp;
-      elseif (aux.region == 3) then
-        (aux.rho,aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofph3(
-                                                           p=aux.p,h=aux.h,delp= 1.0e-7,delh=
-                1.0e-6);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                               aux.rho, aux.T);
-        aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta);
-        aux.s := aux.R*(f.tau*f.ftau - f.f);
-        aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        aux.cv := abs(aux.R*(-f.tau*f.tau*f.ftautau))
-          "can be close to neg. infinity near critical point";
-        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
-        aux.x := 0.0;
-        aux.dpT := aux.pt; /*safety against div-by-0 in initialization*/
-      elseif (aux.region == 4) then
-        h_liq := hl_p(p);
-        h_vap := hv_p(p);
-        aux.x := if (h_vap <> h_liq) then (h - h_liq)/(h_vap - h_liq) else 1.0;
-        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
-          t1:= ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(
-                                   aux.p, h_liq);
-          t2:= ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(
-                                   aux.p, h_vap);
-          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
-                                  aux.p, t1);
-          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                                  aux.p, t2);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
-          aux.T := t1 + aux.x*(t2-t1);
-        else
-          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(
-                                       aux.p); // how to avoid ?
-          d_liq:= rhol_T(aux.T);
-          d_vap:= rhov_T(aux.T);
-          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                                  d_liq, aux.T);
-          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                                  d_vap, aux.T);
-          liq :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
-          vap :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
-        end if;
-        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
-                                                                                              aux.T);
-        aux.s := liq.s + aux.x*(vap.s - liq.s);
-        aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d));
-        aux.cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(
-              liq,
-              vap,
-              aux.x,
-              aux.T,
-              p);
-        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
-        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
-        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
-      elseif (aux.region == 5) then
-        (aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofph5(
-                                                  p=aux.p,h= aux.h,reldh= 1.0e-7);
-        assert(error == 0, "error in inverse iteration of steam tables");
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(
-                               aux.p, aux.T);
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.dpT := -aux.vt/aux.vp;
-      else
-        assert(false, "error in region computation of IF97 steam tables"
-        + "(p = " + String(p) + ", h = " + String(h) + ")");
-      end if;
-    end waterBaseProp_ph;
-
-    function waterBaseProp_ps "intermediate property record for water"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Integer phase = 0
-        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-      input Integer region = 0
-        "if 0, do region computation, otherwise assume the region is this input";
-      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      Integer error "error flag for inverse iterations";
-      Units.SI.SpecificEntropy s_liq "liquid specific entropy";
-      Units.SI.Density d_liq "liquid density";
-      Units.SI.SpecificEntropy s_vap "vapour specific entropy";
-      Units.SI.Density d_vap "vapour density";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties vap
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Units.SI.Temperature t1
-        "temperature at phase boundary, using inverse from region 1";
-      Units.SI.Temperature t2
-        "temperature at phase boundary, using inverse from region 2";
-    algorithm
-      aux.region := if region == 0 then
-        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(
-                                                              p=p,s=s,phase=phase)) else region;
-      aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1;
-      aux.p := p;
-      aux.s := s;
-      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      if (aux.region == 1) then
-        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(
-                                     p, s);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
-                               p, aux.T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 0.0;
-      elseif (aux.region == 2) then
-        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(
-                                     p, s);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                               p, aux.T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 1.0;
-      elseif (aux.region == 3) then
-        (aux.rho,aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(
-                                                           p=p,s=s,delp=1.0e-7,dels=
-          1.0e-6);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                               aux.rho, aux.T);
-        aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta);
-        aux.s := aux.R*(f.tau*f.ftau - f.f);
-        aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
-        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
-        aux.x := 0.0;
-      elseif (aux.region == 4) then
-        s_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(
-                                       p);
-        s_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(
-                                       p);
-        aux.x := if (s_vap <> s_liq) then (s - s_liq)/(s_vap - s_liq) else 1.0;
-        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
-          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(
-                                    p, s_liq);
-          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(
-                                    p, s_vap);
-          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
-                                  p, t1);
-          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                                  p, t2);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
-          aux.T := t1 + aux.x*(t2 - t1);
-        else
-          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(
-                                       p);
-          d_liq := rhol_T(aux.T);
-          d_vap := rhov_T(aux.T);
-          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                                  d_liq, aux.T);
-          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                                  d_vap, aux.T);
-          liq :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
-          vap :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
-        end if;
-        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else
-             ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
-                                   aux.T);
-        aux.h := liq.h + aux.x*(vap.h - liq.h);
-        aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d));
-        aux.cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(
-              liq,
-              vap,
-              aux.x,
-              aux.T,
-              p);
-        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
-        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
-        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
-      elseif (aux.region == 5) then
-        (aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(
-                                                  p=p,s=s,relds= 1.0e-7);
-        assert(error == 0, "error in inverse iteration of steam tables");
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(
-                               p, aux.T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-      else
-        assert(false, "error in region computation of IF97 steam tables"
-        + "(p = " + String(p) + ", s = " + String(s) + ")");
-      end if;
-    end waterBaseProp_ps;
-
-    function rho_props_ps
-      "density as function of pressure and specific entropy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
-        properties "auxiliary record";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := properties.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end rho_props_ps;
-
-    function rho_ps "density as function of pressure and specific entropy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := rho_props_ps(p, s, waterBaseProp_ps(p, s, phase, region));
-    end rho_ps;
-
-    function T_props_ps
-      "temperature as function of pressure and specific entropy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
-        properties "auxiliary record";
-      output Units.SI.Temperature T "temperature";
-    algorithm
-      T := properties.T;
-
-      annotation (Inline=false,
-                  LateInline=true);
-    end T_props_ps;
-
-    function T_ps "temperature as function of pressure and specific entropy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Temperature T "Temperature";
-    algorithm
-      T := T_props_ps(p, s, waterBaseProp_ps(p, s, phase, region));
-    end T_ps;
-
-    function h_props_ps
-      "specific enthalpy as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := aux.h;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end h_props_ps;
-
-    function h_ps "specific enthalpy as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := h_props_ps(p, s, waterBaseProp_ps(p, s, phase, region));
-    end h_ps;
-
-    function phase_ps "phase as a function of  pressure and specific entropy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      output Integer phase "true if in liquid or gas or supercritical region";
-    algorithm
-      phase := if ((s < sl_p(p) or s > sv_p(p)) or p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT)
-                                                                                               then
-                                                                                 1 else 2;
-      annotation (InlineNoEvent=false);
-    end phase_ps;
-
-    function phase_ph "phase as a function of  pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      output Integer phase "true if in liquid or gas or supercritical region";
-    algorithm
-      phase := if ((h < hl_p(p) or h > hv_p(p)) or p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT)
-                                                                                               then
-                                                                                 1 else 2;
-      annotation (InlineNoEvent=false);
-    end phase_ph;
-
-    function phase_dT "phase as a function of  pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density rho "density";
-      input Units.SI.Temperature T "temperature";
-      output Integer phase "true if in liquid or gas or supercritical region";
-    algorithm
-      phase := if not ((rho < rhol_T(T) and rho > rhov_T(T)) and T <
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT) then
-                         1 else 2;
-      annotation (InlineNoEvent=false);
-    end phase_dT;
-
-    function rho_props_ph
-      "density as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
-        properties "auxiliary record";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := properties.rho;
-
-      annotation (
-        derivative(noDerivative=properties) = rho_ph_der,
-        Inline=false,
-        LateInline=true);
-    end rho_props_ph;
-
-    function rho_ph "density as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := rho_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
-    end rho_ph;
-
-    function rho_ph_der "derivative function of rho_ph"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real h_der "derivative of specific enthalpy";
-      output Real rho_der "derivative of density";
-    algorithm
-      if (aux.region == 4) then
-        rho_der := (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T))*p_der
-           + (-aux.rho*aux.rho/(aux.dpT*aux.T))*h_der;
-      elseif (aux.region == 3) then
-        rho_der := ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd*
-          aux.cv + aux.T*aux.pt*aux.pt))*p_der + (-aux.rho*aux.rho*aux.pt/(aux.
-          rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_der;
-      else
-        //regions 1,2,5
-        rho_der := (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux.
-          vt*aux.vt)/aux.cp)*p_der + (-aux.rho*aux.rho*aux.vt/(aux.cp))*h_der;
-      end if;
-    end rho_ph_der;
-
-    function T_props_ph
-      "temperature as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
-        properties "auxiliary record";
-      output Units.SI.Temperature T "temperature";
-    algorithm
-      T := properties.T;
-
-      annotation (derivative(noDerivative=properties) = T_ph_der,
-        Inline=false,
-        LateInline=true);
-    end T_props_ph;
-
-    function T_ph "temperature as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Temperature T "Temperature";
-    algorithm
-      T := T_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
-    end T_ph;
-
-    function T_ph_der "derivative function of T_ph"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real h_der "derivative of specific enthalpy";
-      output Real T_der "derivative of temperature";
-    algorithm
-      if (aux.region == 4) then
-        T_der := 1/aux.dpT*p_der;
-      elseif (aux.region == 3) then
-        T_der := ((-aux.rho*aux.pd + aux.T*aux.pt)/(aux.rho*aux.rho*aux.pd*aux.cv
-           + aux.T*aux.pt*aux.pt))*p_der + ((aux.rho*aux.rho*aux.pd)/(aux.rho*aux.
-           rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_der;
-      else
-        //regions 1,2 or 5
-        T_der := ((-1/aux.rho + aux.T*aux.vt)/aux.cp)*p_der + (1/aux.cp)*h_der;
-      end if;
-    end T_ph_der;
-
-    function s_props_ph
-      "specific entropy as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
-        properties "auxiliary record";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := properties.s;
-
-      annotation (derivative(noDerivative=properties) = s_ph_der,
-    Inline=false,
-    LateInline=true);
-    end s_props_ph;
-
-    function s_ph
-      "specific entropy as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase =   0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := s_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
-    end s_ph;
-
-    function s_ph_der
-      "specific entropy as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real h_der "derivative of specific enthalpy";
-      output Real s_der "derivative of entropy";
-    algorithm
-      s_der := -1/(aux.rho*aux.T)*p_der + 1/aux.T*h_der;
-    end s_ph_der;
-
-    function cv_props_ph
-      "specific heat capacity at constant volume as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := aux.cv;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cv_props_ph;
-
-    function cv_ph
-      "specific heat capacity at constant volume as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := cv_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
-    end cv_ph;
-
-    function regionAssertReal "assert function for inlining"
-      extends Modelica.Icons.Function;
-      input Boolean check "condition to check";
-      output Real dummy "dummy output";
-    algorithm
-      assert(check, "this function can not be called with two-phase inputs!");
-    end regionAssertReal;
-
-    function cp_props_ph
-      "specific heat capacity at constant pressure as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := aux.cp;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cp_props_ph;
-
-    function cp_ph
-      "specific heat capacity at constant pressure as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := cp_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
-    end cp_ph;
-
-    function beta_props_ph
-      "isobaric expansion coefficient as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := if aux.region == 3 or aux.region == 4 then
-        aux.pt/(aux.rho*aux.pd) else
-        aux.vt*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end beta_props_ph;
-
-    function beta_ph
-      "isobaric expansion coefficient as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := beta_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
-    end beta_ph;
-
-    function kappa_props_ph
-      "isothermal compressibility factor as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := if aux.region == 3 or aux.region == 4 then
-        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end kappa_props_ph;
-
-    function kappa_ph
-      "isothermal compressibility factor as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := kappa_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
-    end kappa_ph;
-
-    function velocityOfSound_props_ph
-      "speed of sound as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      // dp/drho at constant s
-      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
-        if aux.region == 4 then
-        sqrt(1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T))) else
-             sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end velocityOfSound_props_ph;
-
-    function velocityOfSound_ph
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      v_sound := velocityOfSound_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
-    end velocityOfSound_ph;
-
-    function isentropicExponent_props_ph
-      "isentropic exponent as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
-             if aux.region == 4 then 1/(aux.rho*p)*aux.dpT*aux.dpT*aux.T/aux.cv else
-        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_props_ph;
-
-    function isentropicExponent_ph
-      "isentropic exponent as function of pressure and specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase =   0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := isentropicExponent_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_ph;
-
-    function ddph_props "density derivative by pressure"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.DerDensityByPressure ddph
-        "density derivative by pressure";
-    algorithm
-      ddph := if aux.region == 3 then
-        ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)) else
-        if aux.region == 4 then  (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) else
-             (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux.vt*aux.vt)/aux.cp);
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end ddph_props;
-
-    function ddph "density derivative by pressure"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.DerDensityByPressure ddph
-        "density derivative by pressure";
-    algorithm
-      ddph := ddph_props(p, h, waterBaseProp_ph(p, h, phase, region));
-    end ddph;
-
-    function ddhp_props "density derivative by specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.DerDensityByEnthalpy ddhp
-        "density derivative by specific enthalpy";
-    algorithm
-      ddhp := if aux.region == 3 then
-        -aux.rho*aux.rho*aux.pt/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt) else
-        if aux.region == 4 then -aux.rho*aux.rho/(aux.dpT*aux.T) else
-             -aux.rho*aux.rho*aux.vt/(aux.cp);
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end ddhp_props;
-
-    function ddhp "density derivative by specific enthalpy"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEnthalpy h "specific enthalpy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.DerDensityByEnthalpy ddhp
-        "density derivative by specific enthalpy";
-    algorithm
-      ddhp := ddhp_props(p, h, waterBaseProp_ph(p, h, phase, region));
-    end ddhp;
-
-    function waterBaseProp_pT
-      "intermediate property record for water (p and T prefered states)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region = 0
-        "if 0, do region computation, otherwise assume the region is this input";
-      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      Integer error "error flag for inverse iterations";
-    algorithm
-      aux.phase := 1;
-      aux.region := if region == 0 then ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(
-                                                                   p=p,T= T) else region;
-      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      aux.p := p;
-      aux.T := T;
-      if (aux.region == 1) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
-                               p, T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := p/(aux.R*T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 0.0;
-      elseif (aux.region == 2) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                               p, T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := p/(aux.R*T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 1.0;
-      elseif (aux.region == 3) then
-        (aux.rho,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(
-                                                    p=p,T= T,delp= 1.0e-7);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                               aux.rho, T);
-        aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta);
-        aux.s := aux.R*(f.tau*f.ftau - f.f);
-        aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
-        aux.x := 0.0;
-      elseif (aux.region == 5) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(
-                               p, T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := p/(aux.R*T*g.pi*g.gpi);
-        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-      else
-        assert(false, "error in region computation of IF97 steam tables"
-         + "(p = " + String(p) + ", T = " + String(T) + ")");
-      end if;
-    end waterBaseProp_pT;
-
-    function rho_props_pT "density as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := aux.rho;
-
-      annotation (
-        derivative(noDerivative=aux) = rho_pT_der,
-        Inline=false,
-        LateInline=true);
-    end rho_props_pT;
-
-    function rho_pT "density as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Density rho "density";
-    algorithm
-      rho := rho_props_pT(p, T, waterBaseProp_pT(p, T, region));
-    end rho_pT;
-
-    function h_props_pT
-      "specific enthalpy as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := aux.h;
-
-      annotation (
-        derivative(noDerivative=aux) = h_pT_der,
-        Inline=false,
-        LateInline=true);
-    end h_props_pT;
-
-    function h_pT "specific enthalpy as function or pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "Temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := h_props_pT(p, T, waterBaseProp_pT(p, T, region));
-    end h_pT;
-
-    function h_pT_der "derivative function of h_pT"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real T_der "derivative of temperature";
-      output Real h_der "derivative of specific enthalpy";
-    algorithm
-      if (aux.region == 3) then
-        h_der := ((-aux.rho*aux.pd + T*aux.pt)/(aux.rho*aux.rho*aux.pd))*p_der +
-          ((aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho
-          *aux.pd))*T_der;
-      else
-        //regions 1,2 or 5
-        h_der := (1/aux.rho - aux.T*aux.vt)*p_der + aux.cp*T_der;
-      end if;
-    end h_pT_der;
-
-    function rho_pT_der "derivative function of rho_pT"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      input Real p_der "derivative of pressure";
-      input Real T_der "derivative of temperature";
-      output Real rho_der "derivative of density";
-    algorithm
-      if (aux.region == 3) then
-        rho_der := (1/aux.pd)*p_der - (aux.pt/aux.pd)*T_der;
-      else
-        //regions 1,2 or 5
-        rho_der := (-aux.rho*aux.rho*aux.vp)*p_der + (-aux.rho*aux.rho*aux.vt)*
-          T_der;
-      end if;
-    end rho_pT_der;
-
-    function s_props_pT
-      "specific entropy as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := aux.s;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end s_props_pT;
-
-    function s_pT "temperature as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := s_props_pT(p, T, waterBaseProp_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end s_pT;
-
-    function cv_props_pT
-      "specific heat capacity at constant volume as function of pressure and temperature"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := aux.cv;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cv_props_pT;
-
-    function cv_pT
-      "specific heat capacity at constant volume as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := cv_props_pT(p, T, waterBaseProp_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end cv_pT;
-
-    function cp_props_pT
-      "specific heat capacity at constant pressure as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := if aux.region == 3 then
-        (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd) else
-        aux.cp;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cp_props_pT;
-
-    function cp_pT
-      "specific heat capacity at constant pressure as function of pressure and temperature"
-
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := cp_props_pT(p, T, waterBaseProp_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end cp_pT;
-
-    function beta_props_pT
-      "isobaric expansion coefficient as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := if aux.region == 3 then
-        aux.pt/(aux.rho*aux.pd) else
-        aux.vt*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end beta_props_pT;
-
-    function beta_pT
-      "isobaric expansion coefficient as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := beta_props_pT(p, T, waterBaseProp_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end beta_pT;
-
-    function kappa_props_pT
-      "isothermal compressibility factor as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := if aux.region == 3 then
-        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end kappa_props_pT;
-
-    function kappa_pT
-      "isothermal compressibility factor as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := kappa_props_pT(p, T, waterBaseProp_pT(p, T, region));
-      annotation (InlineNoEvent=false);
-    end kappa_pT;
-
-    function velocityOfSound_props_pT
-      "speed of sound as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      // dp/drho at constant s
-      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
-        sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end velocityOfSound_props_pT;
-
-    function velocityOfSound_pT
-      "speed of sound as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      v_sound := velocityOfSound_props_pT(p, T, waterBaseProp_pT(p, T, region));
-    end velocityOfSound_pT;
-
-    function isentropicExponent_props_pT
-      "isentropic exponent as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
-        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_props_pT;
-
-    function isentropicExponent_pT
-      "isentropic exponent as function of pressure and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.Temperature T "temperature";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := isentropicExponent_props_pT(p, T, waterBaseProp_pT(p, T, region));
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_pT;
-
-    function waterBaseProp_dT
-      "intermediate property record for water (d and T prefered states)"
-      import ThermoSysPro;
-      extends Modelica.Icons.Function;
-      input Units.SI.Density rho "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-      input Integer region = 0
-        "if 0, do region computation, otherwise assume the region is this input";
-      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-    protected
-      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
-      Units.SI.Density d_liq "liquid density";
-      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
-      Units.SI.Density d_vap "vapour density";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.PhaseBoundaryProperties liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.Common.PhaseBoundaryProperties vap
-        "phase boundary property record";
-      ThermoSysPro.Properties.Common.GibbsDerivs gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.GibbsDerivs gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Integer error "error flag for inverse iterations";
-    algorithm
-      aux.region := if region == 0 then
-        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_dT(
-                                                              d=rho,T= T,phase= phase)) else region;
-      aux.phase := if aux.region == 4 then 2 else 1;
-      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      aux.rho := rho;
-      aux.T := T;
-      if (aux.region == 1) then
-        (aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
-                                                    d=rho,T= T,reldd= 1.0e-8,region=
-                 1);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
-                               aux.p, T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := aux.p/(aux.R*T*g.pi*g.gpi);
-        aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 0.0;
-      elseif (aux.region == 2) then
-        (aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
-                                                    d=rho,T= T,reldd= 1.0e-8,region=
-                 2);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                               aux.p, T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := aux.p/(aux.R*T*g.pi*g.gpi);
-        aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-        aux.x := 1.0;
-      elseif (aux.region == 3) then
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                               rho, T);
-        aux.p := aux.R*rho*T*f.delta*f.fdelta;
-        aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta);
-        aux.s := aux.R*(f.tau*f.ftau - f.f);
-        aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        aux.pt := aux.R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
-        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
-        aux.x := 0.0;
-      elseif (aux.region == 4) then
-        aux.p := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(
-                                     T);
-        aux.dpT := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
-                                         T);
-        d_liq := rhol_T(T);
-        d_vap := rhov_T(T);
-        h_liq := hl_p(aux.p);
-        h_vap := hv_p(aux.p);
-        aux.x := if (d_vap <> d_liq) then (1/rho - 1/d_liq)/(1/d_vap - 1/d_liq) else
-        1.0;
-        aux.h := h_liq + aux.x*(h_vap - h_liq);
-        if T <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TLIMIT1 then
-          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
-                                  aux.p, T);
-          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                                  aux.p, T);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
-        else
-          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                                  d_liq, T);
-          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
-                                  d_vap, T);
-          liq :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
-          vap :=
-            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
-        end if;
-        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
-                                                                                              aux.T);
-        aux.s := liq.s + aux.x*(vap.s - liq.s);
-        aux.cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(
-              liq,
-              vap,
-              aux.x,
-              aux.T,
-              aux.p);
-        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
-        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
-        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
-      elseif (aux.region == 5) then
-        (aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
-                                                    d=rho,T= T,reldd= 1.0e-8,region=5);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
-                               aux.p, T);
-        aux.h := aux.R*aux.T*g.tau*g.gtau;
-        aux.s := aux.R*(g.tau*g.gtau - g.g);
-        aux.rho := aux.p/(aux.R*T*g.pi*g.gpi);
-        aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi;
-        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
-        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
-      else
-        assert(false, "error in region computation of IF97 steam tables"
-         + "(rho = " + String(rho) + ", T = " + String(T) + ")");
-      end if;
-    end waterBaseProp_dT;
-
-    function h_props_dT
-      "specific enthalpy as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := aux.h;
-
-      annotation (
-        derivative(noDerivative=aux) = h_dT_der,
-        Inline=false,
-        LateInline=true);
-    end h_props_dT;
-
-    function h_dT "specific enthalpy as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := h_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
-    end h_dT;
-
-    function h_dT_der "derivative function of h_dT"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      input Real d_der "derivative of density";
-      input Real T_der "derivative of temperature";
-      output Real h_der "derivative of specific enthalpy";
-    algorithm
-      if (aux.region == 3) then
-        h_der := ((-d*aux.pd + T*aux.pt)/(d*d))*d_der + ((aux.cv*d + aux.pt)/d)*
-          T_der;
-      elseif (aux.region == 4) then
-        h_der := T*aux.dpT/(d*d)*d_der + ((aux.cv*d + aux.dpT)/d)*T_der;
-      else
-        //regions 1,2 or 5
-        h_der := (-(-1/d + T*aux.vt)/(d*d*aux.vp))*d_der + ((aux.vp*aux.cp - aux.
-          vt/d + T*aux.vt*aux.vt)/aux.vp)*T_der;
-      end if;
-    end h_dT_der;
-
-    function p_props_dT "pressure as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.Pressure p "pressure";
-    algorithm
-      p := aux.p;
-
-      annotation (
-        derivative(noDerivative=aux) = p_dT_der,
-        Inline=false,
-        LateInline=true);
-    end p_props_dT;
-
-    function p_dT "pressure as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Pressure p "pressure";
-    algorithm
-      p := p_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
-    end p_dT;
-
-    function p_dT_der "derivative function of p_dT"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      input Real d_der "derivative of density";
-      input Real T_der "derivative of temperature";
-      output Real p_der "derivative of pressure";
-    algorithm
-      if (aux.region == 3) then
-        p_der := aux.pd*d_der + aux.pt*T_der;
-      elseif (aux.region == 4) then
-        p_der := aux.dpT*T_der;
-        /*density derivative is 0.0*/
-      else
-        //regions 1,2 or 5
-        p_der := (-1/(d*d*aux.vp))*d_der + (-aux.vt/aux.vp)*T_der;
-      end if;
-    end p_dT_der;
-
-    function s_props_dT
-      "specific entropy as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := aux.s;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end s_props_dT;
-
-    function s_dT "temperature as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "Temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEntropy s "specific entropy";
-    algorithm
-      s := s_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
-    end s_dT;
-
-    function cv_props_dT
-      "specific heat capacity at constant volume as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := aux.cv;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cv_props_dT;
-
-    function cv_dT
-      "specific heat capacity at constant volume as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-    algorithm
-      cv := cv_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
-    end cv_dT;
-
-    function cp_props_dT
-      "specific heat capacity at constant pressure as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := aux.cp;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end cp_props_dT;
-
-    function cp_dT
-      "specific heat capacity at constant pressure as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-    algorithm
-      cp := cp_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
-    end cp_dT;
-
-    function beta_props_dT
-      "isobaric expansion coefficient as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := if aux.region == 3 or aux.region == 4 then
-        aux.pt/(aux.rho*aux.pd) else
-        aux.vt*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end beta_props_dT;
-
-    function beta_dT
-      "isobaric expansion coefficient as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.RelativePressureCoefficient beta
-        "isobaric expansion coefficient";
-    algorithm
-      beta := beta_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
-    end beta_dT;
-
-    function kappa_props_dT
-      "isothermal compressibility factor as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := if aux.region == 3 or aux.region == 4 then
-        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end kappa_props_dT;
-
-    function kappa_dT
-      "isothermal compressibility factor as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.IsothermalCompressibility kappa
-        "isothermal compressibility factor";
-    algorithm
-      kappa := kappa_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
-    end kappa_dT;
-
-    function velocityOfSound_props_dT
-      "speed of sound as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      // dp/drho at constant s
-      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
-        if aux.region == 4 then
-        sqrt(1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T))) else
-             sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end velocityOfSound_props_dT;
-
-    function velocityOfSound_dT
-      "speed of sound as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.Velocity v_sound "speed of sound";
-    algorithm
-      v_sound := velocityOfSound_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
-    end velocityOfSound_dT;
-
-    function isentropicExponent_props_dT
-      "isentropic exponent as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := if aux.region == 3 then 1/(aux.rho*aux.p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
-             if aux.region == 4 then 1/(aux.rho*aux.p)*aux.dpT*aux.dpT*aux.T/aux.cv else
-        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
-
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_props_dT;
-
-    function isentropicExponent_dT
-      "isentropic exponent as function of density and temperature"
-      extends Modelica.Icons.Function;
-      input Units.SI.Density d "density";
-      input Units.SI.Temperature T "temperature";
-      input Integer phase =  0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region =  0
-        "if 0, region is unknown, otherwise known and this input";
-      output Real gamma "isentropic exponent";
-    algorithm
-      gamma := isentropicExponent_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
-      annotation (
-        Inline=false,
-        LateInline=true);
-    end isentropicExponent_dT;
-
-  public
-    function hl_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p
-      "compute the saturated liquid specific h(p)";
-    function hv_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p
-      "compute the saturated vapour specific h(p)";
-
-    function sl_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p
-      "compute the saturated liquid specific s(p)";
-    function sv_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p
-      "compute the saturated vapour specific s(p)";
-
-    function rhol_T =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_T
-      "compute the saturated liquid d(T)";
-    function rhov_T =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_T
-      "compute the saturated vapour d(T)";
-
-    function rhol_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_p
-      "compute the saturated liquid d(p)";
-    function rhov_p =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_p
-      "compute the saturated vapour d(p)";
-
-    function dynamicViscosity =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.visc_dT
-      "compute eta(d,T) in the one-phase region";
-    function thermalConductivity =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.cond_industrial_dT
-      "compute lambda(d,T) in the one-phase region";
-    function surfaceTension =
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.surfaceTension
-      "compute sigma(T) at saturation T";
-
-  //   function isentropicEnthalpy
-  //     "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
-  //     extends Modelica.Icons.Function;
-  //     input SI.Pressure p "pressure";
-  //     input SI.SpecificEntropy s "specific entropy";
-  //     input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known";
-  //     output SI.SpecificEnthalpy h "specific enthalpy";
-  //   algorithm
-  //    h := BaseIF97.Isentropic.water_hisentropic(p,s,phase);
-  //   end isentropicEnthalpy;
-
-    function isentropicEnthalpy
-      "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      input Integer region = 0
-        "if 0, region is unknown, otherwise known and this input";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-      h := isentropicEnthalpy_props(p, s, waterBaseProp_ps(p, s, phase, region));
-    end isentropicEnthalpy;
-
-    function isentropicEnthalpy_props
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      output Units.SI.SpecificEnthalpy h "isentropic enthalpay";
-    algorithm
-      h := aux.h;
-
-      annotation (derivative(noDerivative=aux) = isentropicEnthalpy_der,
-    Inline=false,
-    LateInline=true);
-    end isentropicEnthalpy_props;
-
-    function isentropicEnthalpy_der
-      "derivative of isentropic specific enthalpy from p,s"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
-        "auxiliary record";
-      input Real p_der "pressure derivative";
-      input Real s_der "entropy derivative";
-      output Real h_der "specific enthalpy derivative";
-    algorithm
-      h_der := 1/aux.rho*p_der + aux.T*s_der;
-    end isentropicEnthalpy_der;
-
-    function dynamicIsentropicEnthalpy
-      "isentropic specific enthalpy from p,s and good guesses of d and T"
-      extends Modelica.Icons.Function;
-      input Units.SI.Pressure p "pressure";
-      input Units.SI.SpecificEntropy s "specific entropy";
-      input Units.SI.Density dguess
-        "good guess density, e.g. from adjacent volume";
-      input Units.SI.Temperature Tguess
-        "good guess temperature, e.g. from adjacent volume";
-      input Integer phase = 0
-        "2 for two-phase, 1 for one-phase, 0 if not known";
-      output Units.SI.SpecificEnthalpy h "specific enthalpy";
-    algorithm
-     h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.water_hisentropic_dyn(
-                                                    p,s,dguess,Tguess,0);
-    end dynamicIsentropicEnthalpy;
-
-    annotation (Icon(graphics={
-          Text(
-            extent={{-102,0},{24,-26}},
-            lineColor={242,148,0},
-            textString=
-                 "Thermo"),
-          Text(
-            extent={{-4,8},{68,-34}},
-            lineColor={46,170,220},
-            textString=
-                 "SysPro"),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
-                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
-                -50,6},{-62,2}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
-                8},{-42,22},{-42,30},{-44,38}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
-                12},{-26,12},{-28,12},{-26,20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,30},{-6,26}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,36},{-6,32}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,42},{-6,38}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,48},{-6,44}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,32},{-2,28}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,38},{-2,34}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,44},{-2,40}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,50},{-2,46}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
-                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
-                -50,6},{-62,2}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Line(
-            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-            color={46,170,220},
-            thickness=0.5),
-          Polygon(
-            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-          Line(
-            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-            color={0,0,255},
-            smooth=Smooth.None),
-          Line(
-            points={{80,80},{100,100}},
-            color={0,0,255},
-            smooth=Smooth.None)}));
-  end Standard;
-  annotation (Documentation(info="<HTML>
-      <h4>Package description:</h4>
-      <p>This package provides high accuracy physical properties for water according
-      to the IAPWS/IF97 standard. It has been part of the ThermoFluid Modelica library and been extended,
-      reorganized and documented to become part of the Modelica Standard library.</p>
-      <p>An important feature that distinguishes this implementation of the IF97 steam property standard
-      is that this implementation has been explicitly designed to work well in dynamic simulations. Computational
-      performance has been of high importance. This means that there often exist several ways to get the same result
-      from different functions if one of the functions is called often but can be optimized for that purpose.
-      </p>
-      <p>
-      The original documentation of the IAPWS/IF97 steam properties can freely be distributed with computer
-      implementations, so for curious minds the complete standard documentation is provided with the Modelica
-      properties library. The following documents are included
-      (in directory Modelica\\help\\IF97documentation):
-      <ul>
-      <li><a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a> The standards document for the main part of the IF97.</li>
-      <li><a href=\"IF97documentation/Back3.pdf\">Back3.pdf</a> The backwards equations for region 3.</li>
-      <li><a href=\"IF97documentation/crits.pdf\">crits.pdf</a> The critical point data.</li>
-      <li><a href=\"IF97documentation/meltsub.pdf\">meltsub.pdf</a> The melting- and sublimation line formulation (in IF97_Utilities.BaseIF97.IceBoundaries)</li>
-      <li><a href=\"IF97documentation/surf.pdf\">surf.pdf</a> The surface tension standard definition</li>
-      <li><a href=\"IF97documentation/thcond.pdf\">thcond.pdf</a> The thermal conductivity standard definition</li>
-      <li><a href=\"IF97documentation/visc.pdf\">visc.pdf</a> The viscosity standard definition</li>
-      </ul>
-      </p>
-      <h4>Package contents
-      </h4>
-      <p>
-      <ul>
-      <li>Package <b>BaseIF97</b> contains the implementation of the IAPWS-IF97 as described in
-      <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a>. The explicit backwards equations for region 3 from
-      <a href=\"IF97documentation/Back3.pdf\">Back3.pdf</a> are implemented as initial values for an inverse iteration of the exact
-      function in IF97 for the input pairs (p,h) and (p,s).
-      The low-level functions in BaseIF97 are not needed for standard simulation usage,
-      but can be useful for experts and some special purposes.</li>
-      <li>Function <b>water_ph</b> returns all properties needed for a dynamic control volume model and properties of general
-      interest using pressure p and specific entropy enthalpy h as dynamic states in the record ThermoProperties_ph. </li>
-      <li>Function <b>water_ps</b> returns all properties needed for a dynamic control volume model and properties of general
-      interest using pressure p and specific entropy s as dynamic states in the record ThermoProperties_ps. </li>
-      <li>Function <b>water_dT</b> returns all properties needed for a dynamic control volume model and properties of general
-      interest using density d and temperature T as dynamic states in the record ThermoProperties_dT. </li>
-      <li>Function <b>water_pT</b> returns all properties needed for a dynamic control volume model and properties of general
-      interest using pressure p and temperature T as dynamic states in the record ThermoProperties_pT. Due to the coupling of
-      pressure and temperature in the two-phase region, this model can obviously
-      only be used for one-phase models or models treating both phases independently.</li>
-      <li>Function <b>hl_p</b> computes the liquid specific enthalpy as a function of pressure. For overcritical pressures,
-      the critical specific enthalpy is returned</li>
-      <li>Function <b>hv_p</b> computes the vapour specific enthalpy as a function of pressure. For overcritical pressures,
-      the critical specific enthalpy is returned</li>
-      <li>Function <b>sl_p</b> computes the liquid specific entropy as a function of pressure. For overcritical pressures,
-      the critical  specific entropy is returned</li>
-      <li>Function <b>sv_p</b> computes the vapour  specific entropy as a function of pressure. For overcritical pressures,
-      the critical  specific entropyis returned</li>
-      <li>Function <b>rhol_T</b> computes the liquid density as a function of temperature. For overcritical temperatures,
-      the critical density is returned</li>
-      <li>Function <b>rhol_T</b> computes the vapour density as a function of temperature. For overcritical temperatures,
-      the critical density is returned</li>
-      <li>Function <b>dynamicViscosity</b> computes the dynamic viscosity as a function of density and temperature.</li>
-      <li>Function <b>thermalConductivity</b> computes the thermal conductivity as a function of density, temperature and pressure.
-      <b>Important note</b>: Obviously only two of the three
-      inputs are really needed, but using three inputs speeds up the computation and the three variables
-      are known in most models anyways. The inputs d,T and p have to be consistent.</li>
-      <li>Function <b>surfaceTension</b> computes the surface tension between vapour
-          and liquid water as a function of temperature.</li>
-      <li>Function <b>isentropicEnthalpy</b> computes the specific enthalpy h(p,s,phase) in all regions.
-          The phase input is needed due to discontinuous derivatives at the phase boundary.</li>
-      <li>Function <b>dynamicIsentropicEnthalpy</b> computes the specific enthalpy h(p,s,,dguess,Tguess,phase) in all regions.
-          The phase input is needed due to discontinuous derivatives at the phase boundary. Tguess and dguess are initial guess
-          values for the density and temperature consistent with p and s. This function should be preferred in
-          dynamic simulations where good guesses are often available.</li>
-      </ul>
-      </p>
-      <h4>Version Info and Revision history
-      </h4>
-      <ul>
-      <li>First implemented: <i>July, 2000</i>
-      by Hubertus Tummescheit for the ThermoFluid Library with help from Jonas Eborn and Falko Jens Wagner
-      </li>
-      <li>Code reorganization, enhanced documentation, additional functions:   <i>December, 2002</i>
-      by <a href=\"mailto:Hubertus.Tummescheit@modelon.se\">Hubertus Tummescheit</a> and moved to Modelica
-      properties library.</li>
-      </ul>
-      <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
-      </address>
-      </HTML>", revisions="<h4>Intermediate release notes during development<\\h4>
-<p>Currenly the Events/noEvents switch is only implmented for p-h states. Only after testing that implmentation, it will be extended to dT.</p>"),
-      Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end IF97_Utilities;
+within ThermoSysPro.Properties.WaterSteam;
+package IF97_Utilities
+  "Low level and utility computation for high accuracy water properties according to the IAPWS/IF97 standard"
+
+  replaceable record iter =
+      ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData;
+//   function isentropicEnthalpy
+//     "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
+//     extends Modelica.Icons.Function;
+//     input SI.Pressure p "pressure";
+//     input SI.SpecificEntropy s "specific entropy";
+//     input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known";
+//     output SI.SpecificEnthalpy h "specific enthalpy";
+//   algorithm
+//    h := BaseIF97.Isentropic.water_hisentropic(p,s,phase);
+//   end isentropicEnthalpy;
+
+public
+  package AnalyticDerivatives "Functions with analytic derivatives"
+
+    import ThermoSysPro.Properties.WaterSteam.BaseIF97.*;
+
+    function waterBasePropAnalytic_ph "intermediate property record for water"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase =  0
+        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+      input Integer region = 0
+        "if 0, do region computation, otherwise assume the region is this input";
+      output ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                            g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
+                                                                f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      Integer error "error flag for inverse iterations";
+      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
+      Units.SI.Density d_liq "liquid density";
+      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
+      Units.SI.Density d_vap "vapour density";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
+                                                                        liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
+                                                                        vap
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                            gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                            gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
+                                                                fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
+                                                                fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Units.SI.Temperature t1
+        "temperature at phase boundary, using inverse from region 1";
+      Units.SI.Temperature t2
+        "temperature at phase boundary, using inverse from region 2";
+      /// new stuff, for analytic Jacobian
+      Real dxv "der of x wrt v";
+      Real dxd "der of x wrt d";
+      Real dvTl "der of v wrt T at boiling";
+      Real dvTv "der of v wrt T at dew";
+      Real dxT "der of x wrt T";
+      Real duTl "der of u wrt T at boiling";
+      Real duTv "der of u wrt T at dew";
+      Real dpTT "2nd der of p wrt T";
+      Real dxdd "2nd der of x wrt d";
+      Real dxTd "2nd der of x wrt d and T";
+      Real dvTTl "2nd der of v wrt T at boiling";
+      Real dvTTv "2nd der of v wrt T at dew";
+      Real dxTT " 2nd der of x wrt T";
+      Real duTTl "2nd der of u wrt T at boiling";
+      Real duTTv "2nd der of u wrt T at dew";
+      Real vp3 "vp^3";
+      Real ivp3 "1/vp3";
+      Units.SI.SpecificVolume v;
+      // cvt is in aux record
+      // Real detpht;
+    algorithm
+      aux.region := if region == 0 then
+        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ph(
+                                                              p=p,h= h,phase= phase)) else region;
+      aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1;
+      // LogVariable(p);
+      // LogVariable(h);
+      // LogVariable(aux.region);
+      aux.p := max(p,611.657);
+      aux.h := max(h,1e3);
+      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      if (aux.region == 1) or (aux.region == 2) or (aux.region == 5) then
+        if (aux.region == 1) then
+          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(
+                                       aux.p, aux.h);
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
+                                   p, aux.T);
+          aux.x := 0.0;
+        elseif (aux.region == 2) then
+          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(
+                                       aux.p, aux.h);
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
+                                   p, aux.T);
+          aux.x := 1.0;
+        else /* region must be 5 here */
+          (
+    aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofph5(
+              p=aux.p,
+              h=aux.h,
+              reldh=1.0e-7);
+          assert(error == 0, "error in inverse iteration of steam tables");
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(
+                                   p, aux.T);
+          aux.x := 1.0;
+        end if;
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
+        aux.dpT := -aux.vt/aux.vp;
+        aux.vtt := aux.R*g.pi/p*g.tau/aux.T*g.tau*g.gpitautau;
+        aux.vtp := aux.R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        aux.vpp := aux.R*aux.T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        aux.cpt := aux.R*g.tau*g.tau/aux.T*(2*g.gtautau + g.tau*g.gtautautau);
+        aux.pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+        aux.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+        v := 1/aux.rho;
+        vp3 := aux.vp*aux.vp*aux.vp;
+        ivp3 := 1/vp3;
+        aux.ptt := -(aux.vtt*aux.vp*aux.vp -2.0*aux.vt*aux.vtp*aux.vp +aux.vt*aux.vt*aux.vpp)*ivp3;
+        aux.pdd := -aux.vpp*ivp3*v*v*v*v - 2*v*aux.pd "= pvv/d^4";
+        aux.ptd := (aux.vtp*aux.vp-aux.vt*aux.vpp)*ivp3*v*v "= -ptv/d^2";
+        aux.cvt := (vp3*aux.cpt + aux.vp*aux.vp*aux.vt*aux.vt + 3.0*aux.vp*aux.vp*aux.T*aux.vt*aux.vtt
+      - 3.0*aux.vtp*aux.vp*aux.T*aux.vt*aux.vt + aux.T*aux.vt*aux.vt*aux.vt*aux.vpp)*ivp3;
+      elseif (aux.region == 3) then
+        (aux.rho,aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofph3(
+                                                           p=aux.p,h=aux.h,delp= 1.0e-7,delh=
+          1.0e-6);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
+                                 aux.rho, aux.T);
+        aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta);
+        aux.s := aux.R*(f.tau*f.ftau - f.f);
+        aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        aux.cv := abs(aux.R*(-f.tau*f.tau*f.ftautau))
+          "can be close to neg. infinity near critical point";
+        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
+        aux.x := 0.0;
+        aux.dpT := aux.pt; /*safety against div-by-0 in initialization*/
+        aux.pdd := aux.R*aux.T*f.delta/aux.rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
+             f.delta*f.delta*f.fdeltadeltadelta);
+        aux.ptt := aux.R*aux.rho*f.delta*f.tau*f.tau/aux.T*f.fdeltatautau;
+        aux.ptd := aux.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
+      -f.delta*f.tau*f.fdeltadeltatau);
+        aux.cvt := aux.R*f.tau*f.tau/aux.T*(2.0*f.ftautau + f.tau*f.ftautautau);
+        aux.cpt := (aux.cvt*aux.pd + aux.cv*aux.ptd + (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt/(aux.rho*aux.rho)
+      - aux.cp*aux.ptd)/aux.pd;
+      elseif (aux.region == 4) then
+        h_liq := hl_p(p);
+        h_vap := hv_p(p);
+        aux.x := if (h_vap <> h_liq) then (h - h_liq)/(h_vap - h_liq) else 1.0;
+        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
+          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(
+                                    aux.p, h_liq);
+          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(
+                                    aux.p, h_vap);
+          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
+                                    aux.p, t1);
+          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
+                                    aux.p, t2);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(
+            gl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(
+            gv);
+          aux.T := t1 + aux.x*(t2 - t1);
+        else
+          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(
+                                       aux.p);
+          // how to avoid ?
+          d_liq := rhol_T(aux.T);
+          d_vap := rhov_T(aux.T);
+          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
+                                    d_liq, aux.T);
+          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
+                                    d_vap, aux.T);
+          liq :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(
+            fl);
+          vap :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(
+            fv);
+          //  aux.dpT := BaseIF97.Basic.dptofT(aux.T);
+        end if;
+        aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d));
+        dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d-vap.d) else 0.0;
+        dxd := -dxv/(aux.rho*aux.rho);
+        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*dxv else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
+                                                                                           aux.T);
+        dvTl := (liq.pt -aux.dpT)/(liq.pd*liq.d*liq.d);
+        dvTv := (vap.pt -aux.dpT)/(vap.pd*vap.d*vap.d);
+        dxT := -dxv*(dvTl + aux.x*(dvTv-dvTl));
+        duTl := liq.cv + (aux.T*liq.pt-p)*dvTl;
+        duTv := vap.cv + (aux.T*vap.pt-p)*dvTv;
+        aux.cv := duTl + aux.x*(duTv-duTl) + dxT * (vap.u-liq.u);
+        dpTT := dxv*(vap.cv/aux.T-liq.cv/aux.T + dvTv*(vap.pt-aux.dpT)-dvTl*(liq.pt-aux.dpT));
+        dxdd := 2.0*dxv/(aux.rho*aux.rho*aux.rho);
+        dxTd := dxv*dxv*(dvTv-dvTl)/(aux.rho*aux.rho);
+        dvTTl := ((liq.ptt-dpTT)/(liq.d*liq.d) + dvTl*(liq.d*dvTl*(2.0*liq.pd + liq.d*liq.pdd)
+             -2.0*liq.ptd))/liq.pd;
+        dvTTv := ((vap.ptt-dpTT)/(vap.d*vap.d) + dvTv*(vap.d*dvTv*(2.0*vap.pd + vap.d*vap.pdd)
+             -2.0*vap.ptd))/vap.pd;
+        dxTT := -dxv*(2.0*dxT*(dvTv-dvTl) + dvTTl + aux.x*(dvTTv-dvTTl));
+        duTTl := liq.cvt +(liq.pt-aux.dpT + aux.T*(2.0*liq.ptt -liq.d*liq.d*liq.ptd *dvTl))*dvTl + (aux.T*
+          liq.pt - p)*dvTTl;
+        duTTv := vap.cvt +(vap.pt-aux.dpT + aux.T*(2.0*vap.ptt -vap.d*vap.d*vap.ptd *dvTv))*dvTv + (aux.T*
+          vap.pt - p)*dvTTv;
+        aux.cvt := duTTl + aux.x *(duTTv -duTTl) + 2.0*dxT*(duTv-duTl) + dxTT *(vap.u-liq.u);
+        aux.s := liq.s + aux.x*(vap.s - liq.s);
+        // next ones are only for cases where region 4 is called improperly
+        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp); // undefined
+        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt); // dpT
+        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd); // 0.0
+        aux.vt := dvTl + aux.x*(dvTv-dvTl) +dxT*(1/vap.d-1/liq.d);
+        // v = vl + x*(vv-vl)
+        aux.vp := aux.vt/aux.dpT;
+        aux.pdd := 0.0;
+        aux.ptd := 0.0;
+        aux.ptt := dpTT;
+        aux.vtt := dvTTl + aux.x*(dvTTv-dvTTl);
+        aux.vtp := aux.vtt/aux.dpT;
+        //hpp := vp - T*vtp = aux.vt/aux.dpT - T*aux.vtt/aux.dpT;
+      else
+        assert(false, "error in region computation of IF97 steam tables"
+        + "(p = " + String(p) + ", h = " + String(h) + ")");
+      end if;
+      annotation (Icon(graphics));
+    end waterBasePropAnalytic_ph;
+
+    function waterBasePropAnalytic_pT
+      "intermediate property record for water (p and T prefered states)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region = 0
+        "if 0, do region computation, otherwise assume the region is this input";
+      output ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                            g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
+                                                                f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      Real vp3 "vp^3";
+      Real ivp3 "1/vp3";
+      Units.SI.SpecificVolume v;
+      Integer error "error flag for inverse iterations";
+    algorithm
+      aux.phase := 1;
+      aux.region := if region == 0 then ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(
+                                                                   p=p,T= T) else region;
+      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      aux.p := p;
+      aux.T := T;
+      if (aux.region == 1) or (aux.region == 2) or (aux.region == 5) then
+        if (aux.region == 1) then
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
+                                   p, T);
+          aux.x := 0.0;
+        elseif (aux.region == 2) then
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
+                                   p, T);
+          aux.x := 1.0;
+        else
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(
+                                   p, T);
+          aux.x := 1.0;
+        end if;
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := p/(aux.R*T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
+        aux.x := 0.0;
+        aux.vtt := aux.R*g.pi/aux.p*g.tau/aux.T*g.tau*g.gpitautau;
+        aux.vtp := aux.R*g.pi*g.pi/(aux.p*aux.p)*(g.gpipi - g.tau*g.gpipitau);
+        aux.vpp := aux.R*aux.T*g.pi*g.pi*g.pi/(aux.p*aux.p*aux.p)*g.gpipipi;
+        aux.cpt := aux.R*g.tau*g.tau/aux.T*(2*g.gtautau + g.tau*g.gtautautau);
+        aux.pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+        aux.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+        v := 1/aux.rho;
+        vp3 := aux.vp*aux.vp*aux.vp;
+        ivp3 := 1/vp3;
+        aux.ptt := -(aux.vtt*aux.vp*aux.vp -2.0*aux.vt*aux.vtp*aux.vp +aux.vt*aux.vt*aux.vpp)*ivp3;
+        aux.pdd := -aux.vpp*ivp3*v*v*v*v - 2*v*aux.pd;
+        aux.ptd := (aux.vtp*aux.vp-aux.vt*aux.vpp)*ivp3*v*v "= -ptv/d^2";
+        aux.cvt := (vp3*aux.cpt + aux.vp*aux.vp*aux.vt*aux.vt + 3.0*aux.vp*aux.vp*aux.T*aux.vt*aux.vtt
+      - 3.0*aux.vtp*aux.vp*aux.T*aux.vt*aux.vt + aux.T*aux.vt*aux.vt*aux.vt*aux.vpp)*ivp3;
+      elseif (aux.region == 3) then
+        (aux.rho,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(
+                                                    p=p,T= T,delp= 1.0e-7);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
+                                 aux.rho, T);
+        aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta);
+        aux.s := aux.R*(f.tau*f.ftau - f.f);
+        aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
+        aux.x := 0.0;
+        aux.pdd := aux.R*aux.T*f.delta/aux.rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
+             f.delta*f.delta*f.fdeltadeltadelta);
+        aux.ptt := aux.R*aux.rho*f.delta*f.tau*f.tau/aux.T*f.fdeltatautau;
+        aux.ptd := aux.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
+      -f.delta*f.tau*f.fdeltadeltatau);
+        aux.cvt := aux.R*f.tau*f.tau/aux.T*(2.0*f.ftautau + f.tau*f.ftautautau);
+        aux.cpt := (aux.cvt*aux.pd + aux.cv*aux.ptd + (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt/(aux.rho*aux.rho)
+      - aux.pt*aux.ptd)/aux.pd;
+      else
+        assert(false, "error in region computation of IF97 steam tables"
+        + "(p = " + String(p) + ", T = " + String(T) + ")");
+      end if;
+    end waterBasePropAnalytic_pT;
+
+    function waterBasePropAnalytic_dT
+      "intermediate property record for water (d and T prefered states)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density rho "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+      input Integer region = 0
+        "if 0, do region computation, otherwise assume the region is this input";
+      output ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+    protected
+      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
+      Units.SI.Density d_liq "liquid density";
+      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
+      Units.SI.Density d_vap "vapour density";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                            g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
+                                                                f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
+                                                                        liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd
+                                                                        vap
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                            gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                                            gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
+                                                                fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
+                                                                fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Integer error "error flag for inverse iterations";
+      /// new stuff, for analytic Jacobian
+      Real dxv "der of x wrt v";
+      Real dxd "der of x wrt d";
+      Real dvTl "der of v wrt T at boiling";
+      Real dvTv "der of v wrt T at dew";
+      Real dxT "der of x wrt T";
+      Real duTl "der of u wrt T at boiling";
+      Real duTv "der of u wrt T at dew";
+      Real dpTT "2nd der of p wrt T";
+      Real dxdd "2nd der of x wrt d";
+      Real dxTd "2nd der of x wrt d and T";
+      Real dvTTl "2nd der of v wrt T at boiling";
+      Real dvTTv "2nd der of v wrt T at dew";
+      Real dxTT " 2nd der of x wrt T";
+      Real duTTl "2nd der of u wrt T at boiling";
+      Real duTTv "2nd der of u wrt T at dew";
+      // cvt is in aux record
+      Real vp3 "vp^3";
+      Real ivp3 "1/vp3";
+      Units.SI.SpecificVolume v;
+    algorithm
+      aux.region := if region == 0 then
+        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_dT(
+                                                              d=rho,T= T,phase= phase)) else region;
+      aux.phase := if aux.region == 4 then 2 else 1;
+      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      aux.rho := rho;
+      aux.T := T;
+      if (aux.region == 1) or (aux.region == 2) or (aux.region == 5) then
+        if (aux.region == 1) then
+          (
+    aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
+              d=rho,
+              T=T,
+              reldd=1.0e-9,
+              region=1);
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
+                                   aux.p, T);
+          aux.x := 0.0;
+        elseif (aux.region == 2) then
+          (
+    aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
+              d=rho,
+              T=T,
+              reldd=1.0e-8,
+              region=2);
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
+                                   aux.p, T);
+          aux.x := 1.0;
+        else
+          (
+    aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
+              d=rho,
+              T=T,
+              reldd=1.0e-8,
+              region=5);
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
+                                   aux.p, T);
+          aux.x := 1.0;
+        end if;
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := aux.p/(aux.R*T*g.pi*g.gpi);
+        aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
+        aux.vtt := aux.R*g.pi/aux.p*g.tau/aux.T*g.tau*g.gpitautau;
+        aux.vtp := aux.R*g.pi*g.pi/(aux.p*aux.p)*(g.gpipi - g.tau*g.gpipitau);
+        aux.vpp := aux.R*aux.T*g.pi*g.pi*g.pi/(aux.p*aux.p*aux.p)*g.gpipipi;
+        aux.cpt := aux.R*g.tau*g.tau/aux.T*(2*g.gtautau + g.tau*g.gtautautau);
+        aux.pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+        aux.pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+        v := 1/aux.rho;
+        vp3 := aux.vp*aux.vp*aux.vp;
+        ivp3 := 1/vp3;
+        aux.ptt := -(aux.vtt*aux.vp*aux.vp -2.0*aux.vt*aux.vtp*aux.vp +aux.vt*aux.vt*aux.vpp)*ivp3;
+        aux.pdd := -aux.vpp*ivp3*v*v*v*v - 2*v*aux.pd;
+        aux.ptd := (aux.vtp*aux.vp-aux.vt*aux.vpp)*ivp3*v*v "= -ptv/d^2";
+        aux.cvt := (vp3*aux.cpt + aux.vp*aux.vp*aux.vt*aux.vt + 3.0*aux.vp*aux.vp*aux.T*aux.vt*aux.vtt
+      - 3.0*aux.vtp*aux.vp*aux.T*aux.vt*aux.vt + aux.T*aux.vt*aux.vt*aux.vt*aux.vpp)*ivp3;
+      elseif (aux.region == 3) then
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
+                                 rho, T);
+        aux.p := aux.R*rho*T*f.delta*f.fdelta;
+        aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta);
+        aux.s := aux.R*(f.tau*f.ftau - f.f);
+        aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        aux.pt := aux.R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
+        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
+        aux.x := 0.0;
+        aux.dpT := aux.pt; /*safety against div-by-0 in initialization*/
+        aux.pdd := aux.R*aux.T*f.delta/aux.rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
+             f.delta*f.delta*f.fdeltadeltadelta);
+        aux.ptt := aux.R*aux.rho*f.delta*f.tau*f.tau/aux.T*f.fdeltatautau;
+        aux.ptd := aux.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
+      -f.delta*f.tau*f.fdeltadeltatau);
+        aux.cvt := aux.R*f.tau*f.tau/aux.T*(2.0*f.ftautau + f.tau*f.ftautautau);
+        aux.cpt := (aux.cvt*aux.pd + aux.cv*aux.ptd + (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt/(aux.rho*aux.rho)
+      - aux.pt*aux.ptd)/aux.pd;
+      elseif (aux.region == 4) then
+        aux.p := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(
+                                     T);
+        d_liq := rhol_T(T);
+        d_vap := rhov_T(T);
+        h_liq := hl_p(aux.p);
+        h_vap := hv_p(aux.p);
+        aux.x := if (d_vap <> d_liq) then (1/rho - 1/d_liq)/(1/d_vap - 1/d_liq) else 1.0;
+        aux.h := h_liq + aux.x*(h_vap - h_liq);
+        if T <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TLIMIT1 then
+          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
+                                    aux.p, T);
+          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
+                                    aux.p, T);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(
+            gl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(
+            gv);
+        else
+          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
+                                    d_liq, T);
+          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
+                                    d_vap, T);
+          liq :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(
+            fl);
+          vap :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(
+            fv);
+        end if;
+        aux.s := liq.s + aux.x*(vap.s - liq.s);
+        dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d-vap.d) else 0.0;
+        dxd := -dxv/(aux.rho*aux.rho);
+        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*dxv else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
+                                                                                           aux.T);
+        dvTl := (liq.pt -aux.dpT)/(liq.pd*liq.d*liq.d);
+        dvTv := (vap.pt -aux.dpT)/(vap.pd*vap.d*vap.d);
+        dxT := -dxv*(dvTl + aux.x*(dvTv-dvTl));
+        duTl := liq.cv + (aux.T*liq.pt-aux.p)*dvTl;
+        duTv := vap.cv + (aux.T*vap.pt-aux.p)*dvTv;
+        aux.cv := duTl + aux.x*(duTv-duTl) + dxT * (vap.u-liq.u);
+        dpTT := dxv*(vap.cv/aux.T-liq.cv/aux.T + dvTv*(vap.pt-aux.dpT)-dvTl*(liq.pt-aux.dpT));
+        dxdd := 2.0*dxv/(aux.rho*aux.rho*aux.rho);
+        dxTd := dxv*dxv*(dvTv-dvTl)/(aux.rho*aux.rho);
+        dvTTl := ((liq.ptt-dpTT)/(liq.d*liq.d) + dvTl*(liq.d*dvTl*(2.0*liq.pd + liq.d*liq.pdd)
+             -2.0*liq.ptd))/liq.pd;
+        dvTTv := ((vap.ptt-dpTT)/(vap.d*vap.d) + dvTv*(vap.d*dvTv*(2.0*vap.pd + vap.d*vap.pdd)
+             -2.0*vap.ptd))/vap.pd;
+        dxTT := -dxv*(2.0*dxT*(dvTv-dvTl) + dvTTl + aux.x*(dvTTv-dvTTl));
+        duTTl := liq.cvt +(liq.pt-aux.dpT + aux.T*(2.0*liq.ptt -liq.d*liq.d*liq.ptd *dvTl))*dvTl + (aux.T*
+                liq.pt - aux.p)*dvTTl;
+        duTTv := vap.cvt +(vap.pt-aux.dpT + aux.T*(2.0*vap.ptt -vap.d*vap.d*vap.ptd *dvTv))*dvTv + (aux.T*
+                vap.pt - aux.p)*dvTTv;
+        aux.cvt := duTTl + aux.x *(duTTv -duTTl) + 2.0*dxT*(duTv-duTl) + dxTT *(vap.u-liq.u);
+        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
+        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
+        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
+        aux.ptt := dpTT;
+      else
+        assert(false, "error in region computation of IF97 steam tables"
+        + "(rho = " + String(rho) + ", T = " + String(T) + ")");
+      end if;
+    end waterBasePropAnalytic_dT;
+
+    function waterBaseProp_ps "intermediate property record for water"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Integer phase = 0
+        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+      input Integer region = 0
+        "if 0, do region computation, otherwise assume the region is this input";
+      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      Integer error "error flag for inverse iterations";
+      Units.SI.SpecificEntropy s_liq "liquid specific entropy";
+      Units.SI.Density d_liq "liquid density";
+      Units.SI.SpecificEntropy s_vap "vapour specific entropy";
+      Units.SI.Density d_vap "vapour density";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties vap
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Units.SI.Temperature t1
+        "temperature at phase boundary, using inverse from region 1";
+      Units.SI.Temperature t2
+        "temperature at phase boundary, using inverse from region 2";
+    algorithm
+      aux.region := if region == 0 then
+        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(
+                                                              p=p,s=s,phase=phase)) else region;
+      aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1;
+      aux.p := p;
+      aux.s := s;
+      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      if (aux.region == 1) then
+        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(
+                                     p, s);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
+                               p, aux.T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 0.0;
+      elseif (aux.region == 2) then
+        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(
+                                     p, s);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                               p, aux.T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 1.0;
+      elseif (aux.region == 3) then
+        (aux.rho,aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(
+                                                           p=p,s=s,delp=1.0e-7,dels=
+          1.0e-6);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                               aux.rho, aux.T);
+        aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta);
+        aux.s := aux.R*(f.tau*f.ftau - f.f);
+        aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
+        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
+        aux.x := 0.0;
+      elseif (aux.region == 4) then
+        s_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(
+                                       p);
+        s_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(
+                                       p);
+        aux.x := if (s_vap <> s_liq) then (s - s_liq)/(s_vap - s_liq) else 1.0;
+        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
+          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(
+                                    p, s_liq);
+          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(
+                                    p, s_vap);
+          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
+                                  p, t1);
+          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                                  p, t2);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
+          aux.T := t1 + aux.x*(t2 - t1);
+        else
+          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(
+                                       p);
+          d_liq := rhol_T(aux.T);
+          d_vap := rhov_T(aux.T);
+          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                                  d_liq, aux.T);
+          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                                  d_vap, aux.T);
+          liq :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
+          vap :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
+        end if;
+        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else
+             ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
+                                   aux.T);
+        aux.h := liq.h + aux.x*(vap.h - liq.h);
+        aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d));
+        aux.cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(
+              liq,
+              vap,
+              aux.x,
+              aux.T,
+              p);
+        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
+        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
+        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
+      elseif (aux.region == 5) then
+        (aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(
+                                                  p=p,s=s,relds= 1.0e-7);
+        assert(error == 0, "error in inverse iteration of steam tables");
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(
+                               p, aux.T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+      else
+        assert(false, "error in region computation of IF97 steam tables"
+        + "(p = " + String(p) + ", s = " + String(s) + ")");
+      end if;
+    end waterBaseProp_ps;
+
+    replaceable record iter =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData;
+
+    function phase_ph "phase as a function of  pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Integer phase "true if in liquid or gas or supercritical region";
+    algorithm
+      phase := if ((h < hl_p(p) or h > hv_p(p)) or p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT)
+                                                                                               then
+                                                                                 1 else 2;
+      annotation (InlineNoEvent=false);
+    end phase_ph;
+
+    function phase_dT "phase as a function of  pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density rho "density";
+      input Units.SI.Temperature T "temperature";
+      output Integer phase "true if in liquid or gas or supercritical region";
+    algorithm
+      phase := if not ((rho < rhol_T(T) and rho > rhov_T(T)) and T <
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT) then
+                         1 else 2;
+      annotation (InlineNoEvent=false);
+    end phase_dT;
+
+    function rho_props_ph
+      "density as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := aux.rho;
+
+      annotation (
+        derivative(noDerivative=aux) = rho_ph_d,
+        Inline=false,
+        LateInline=true);
+    end rho_props_ph;
+
+    function rho_ph "density as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := rho_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end rho_ph;
+
+    function rho_ph_d "derivative function of rho_ph"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real p_d "derivative of pressure";
+      input Real h_d "derivative of specific enthalpy";
+      output Real rho_d "derivative of density";
+    algorithm
+      if (aux.region == 4) then
+        rho_d := (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T))*p_d
+           + (-aux.rho*aux.rho/(aux.dpT*aux.T))*h_d;
+      elseif (aux.region == 3) then
+        rho_d := ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd*
+          aux.cv + aux.T*aux.pt*aux.pt))*p_d + (-aux.rho*aux.rho*aux.pt/(aux.
+          rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_d;
+      else
+        //regions 1,2,5
+        rho_d := (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux.
+          vt*aux.vt)/aux.cp)*p_d + (-aux.rho*aux.rho*aux.vt/(aux.cp))*h_d;
+      end if;
+
+      annotation (derivative(noDerivative=aux) = rho_ph_dd);
+    end rho_ph_d;
+
+    function rho_ph_dd "Second order derivative function of rho_ph"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real p_d "derivative of pressure";
+      input Real h_d "derivative of specific enthalpy";
+      input Real p_dd "second derivative of pressure";
+      input Real h_dd "second derivative of specific enthalpy";
+      output Real rho_dd "Second derivative of density";
+    protected
+      Units.SI.DerDensityByPressure ddph "Derivative of d by p at constant h";
+      Units.SI.DerDensityByEnthalpy ddhp "Derivative of d by h at constant p";
+      Real ddph_ph "Derivative of ddph by p";
+      Real ddph_hp "Derivative of ddph by h";
+      Real ddhp_hp "Derivative of ddhp by h";
+      Real ddhp_ph "Derivative of ddhp by p";
+    algorithm
+      ddph := ddph_props(p,h,aux);
+      ddhp := ddhp_props(p,h,aux);
+      (ddph_ph,ddph_hp) := ddph_ph_dd(p,h,aux);
+      (ddhp_hp,ddhp_ph) := ddhp_ph_dd(p,h,aux);
+      rho_dd := ddph*p_dd + 2.0*ddhp_ph*p_d*h_d + ddph_ph*p_d*p_d + ddhp_hp*h_d*h_d + ddhp*h_dd;
+    end rho_ph_dd;
+
+    function T_props_ph
+      "temperature as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic
+        properties "auxiliary record";
+      output Units.SI.Temperature T "temperature";
+    algorithm
+      T := properties.T;
+
+      annotation (derivative(noDerivative=properties) = T_ph_der,
+        Inline=false,
+        LateInline=true);
+    end T_props_ph;
+
+    function T_ph "temperature as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Temperature T "Temperature";
+    algorithm
+      T := T_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end T_ph;
+
+    function T_ph_der "derivative function of T_ph"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real h_der "derivative of specific enthalpy";
+      output Real T_der "derivative of temperature";
+    algorithm
+      if (aux.region == 4) then
+        T_der := 1/aux.dpT*p_der;
+      elseif (aux.region == 3) then
+        T_der := ((-aux.rho*aux.pd + aux.T*aux.pt)/(aux.rho*aux.rho*aux.pd*aux.cv
+           + aux.T*aux.pt*aux.pt))*p_der + ((aux.rho*aux.rho*aux.pd)/(aux.rho*aux.
+           rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_der;
+      else
+        //regions 1,2 or 5
+        T_der := ((-1/aux.rho + aux.T*aux.vt)/aux.cp)*p_der + (1/aux.cp)*h_der;
+      end if;
+    end T_ph_der;
+
+    function s_props_ph
+      "specific entropy as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic
+        properties "auxiliary record";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := properties.s;
+
+      annotation (derivative(noDerivative=properties) = s_ph_der,
+    Inline=false,
+    LateInline=true);
+    end s_props_ph;
+
+    function s_ph
+      "specific entropy as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase =   0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := s_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end s_ph;
+
+    function s_ph_der
+      "specific entropy as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real h_der "derivative of specific enthalpy";
+      output Real s_der "derivative of entropy";
+    algorithm
+      s_der := -1/(aux.rho*aux.T)*p_der + 1/aux.T*h_der;
+    end s_ph_der;
+
+    function cv_props_ph
+      "specific heat capacity at constant volume as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := aux.cv;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cv_props_ph;
+
+    function cv_ph
+      "specific heat capacity at constant volume as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := cv_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end cv_ph;
+
+    function regionAssertReal "assert function for inlining"
+      extends Modelica.Icons.Function;
+      input Boolean check "condition to check";
+      output Real dummy "dummy output";
+    algorithm
+      assert(check, "this function can not be called with two-phase inputs!");
+    end regionAssertReal;
+
+    function cp_props_ph
+      "specific heat capacity at constant pressure as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := aux.cp;
+
+      annotation (
+        Inline=false,
+        LateInline=true,
+      derivative(noDerivative=aux) = cp_ph_der);
+    end cp_props_ph;
+
+    function cp_ph
+      "specific heat capacity at constant pressure as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := cp_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end cp_ph;
+
+    function cp_ph_der "derivative function of cp_ph"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real h_der "derivative of specific enthalpy";
+      output Real cp_der "derivative of heat capacity";
+    protected
+      Real detPH "Determinant";
+      Real dht;
+      Real dhd;
+      Real ddhp;
+      Real ddph;
+      Real dtph;
+      Real dthp;
+      Real detPH_d;
+      Real dcp_d;
+    algorithm
+      if (aux.region == 4) then
+        cp_der := 0.0;
+      elseif (aux.region == 3) then
+        detPH := aux.cp*aux.pd;
+        dht := aux.cv + aux.pt/aux.rho;
+        dhd := (aux.pd - aux.T*aux.pt/aux.rho)/aux.rho;
+        ddph := dht/ detPH;
+        ddhp := -aux.pt/detPH;
+        dtph := -dhd/detPH;
+        dthp := aux.pd/detPH;
+        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt/aux.rho)
+            -aux.ptt*aux.pd) *aux.T/(aux.rho*aux.rho);
+        dcp_d :=(detPH_d - aux.cp*aux.pdd)/aux.pd;
+        cp_der := (ddph * dcp_d + dtph * aux.cpt)*p_der +
+           (ddhp * dcp_d + dthp * aux.cpt)*h_der;
+      else
+        //regions 1,2 or 5
+        cp_der := (-(aux.T * aux.vtt * aux.cp + aux.cpt/aux.rho - aux.cpt * aux.T * aux.vt) / aux.cp)*p_der +
+          aux.cpt/aux.cp*h_der;
+      end if;
+      annotation (Documentation(info="<html></html>"));
+    end cp_ph_der;
+
+    function beta_props_ph
+      "isobaric expansion coefficient as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := if aux.region == 3 or aux.region == 4 then
+        aux.pt/(aux.rho*aux.pd) else
+        aux.vt*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end beta_props_ph;
+
+    function beta_ph
+      "isobaric expansion coefficient as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := beta_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end beta_ph;
+
+    function kappa_props_ph
+      "isothermal compressibility factor as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := if aux.region == 3 or aux.region == 4 then
+        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end kappa_props_ph;
+
+    function kappa_ph
+      "isothermal compressibility factor as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := kappa_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end kappa_ph;
+
+    function velocityOfSound_props_ph
+      "speed of sound as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      // dp/drho at constant s
+      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
+        if aux.region == 4 then
+        sqrt(1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T))) else
+             sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end velocityOfSound_props_ph;
+
+    function velocityOfSound_ph
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      v_sound := velocityOfSound_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end velocityOfSound_ph;
+
+    function isentropicExponent_props_ph
+      "isentropic exponent as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
+             if aux.region == 4 then 1/(aux.rho*p)*aux.dpT*aux.dpT*aux.T/aux.cv else
+        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_props_ph;
+
+    function isentropicExponent_ph
+      "isentropic exponent as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase =   0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := isentropicExponent_props_ph(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_ph;
+
+    function ddph_props "density derivative by pressure"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.DerDensityByPressure ddph
+        "density derivative by pressure";
+    algorithm
+      ddph := if aux.region == 3 then
+        ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)) else
+        if aux.region == 4 then  (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) else
+             (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux.vt*aux.vt)/aux.cp);
+
+      annotation (
+        Inline=false,
+        LateInline=true,
+        derivative(noDerivative=aux) = ddph_ph_der);
+    end ddph_props;
+
+    function ddph "density derivative by pressure"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.DerDensityByPressure ddph
+        "density derivative by pressure";
+    algorithm
+      ddph := ddph_props(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end ddph;
+
+    function ddph_ph_der "derivative function of ddph"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real h_der "derivative of specific enthalpy";
+      output Real ddph_der "Gradient of ddph";
+    protected
+      Units.SI.SpecificVolume v=1/aux.rho;
+      Real detPH "Determinant";
+      Real dht;
+      Real dhd;
+      Real ddhp;
+      Real ddph;
+      Real dtph;
+      Real dthp;
+      Real detPH_d;
+      Real detPH_t;
+      Real dhtt;
+      Real dhtd;
+      Real ddph_t;
+      Real ddph_d;
+      Real ddhp_t;
+      Real ddhp_d;
+    algorithm
+      if (aux.region == 4) then
+
+        dht := aux.cv + aux.dpT * v;
+        dhd := -aux.T * aux.dpT*v*v;
+        detPH := -aux.dpT * dhd;
+        dtph := 1.0 / aux.dpT;
+        ddph := dht / detPH;
+        ddhp := -aux.dpT / detPH;
+        detPH_t := 2.0 * aux.ptt / aux.dpT + 1.0 / aux.T; /* = detPH_t / detPH */
+        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
+
+        dhtt := aux.cvt + aux.ptt * v;
+        dhtd := -(aux.T * aux.ptt + aux.dpT) *v*v;
+        ddhp_t := ddhp * (aux.ptt / aux.dpT - detPH_t);
+        ddhp_d := ddhp * (-detPH_d);
+        ddph_t := ddph * (dhtt / dht - detPH_t);
+        ddph_d := ddph * (dhtd / dht - detPH_d);
+        ddph_der := (ddph * ddph_d + dtph * ddph_t)*p_der + (ddhp * ddph_d)*h_der;
+      else
+        detPH := aux.cp*aux.pd;
+        dht := aux.cv + aux.pt*v;
+        dhd := (aux.pd - aux.T*aux.pt*v)*v;
+        ddph := dht/ detPH;
+        ddhp := -aux.pt/detPH;
+        dtph := -dhd/detPH;
+        dthp := aux.pd/detPH;
+        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt*v)
+            -aux.ptt*aux.pd) *aux.T*v*v;
+        detPH_t := aux.cvt*aux.pd + aux.cv*aux.ptd +
+            (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt*v*v;
+        dhtt := aux.cvt + aux.ptt*v;
+        dhtd := (aux.ptd - (aux.T * aux.ptt + aux.pt)*v) *v;
+        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
+        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
+        ddhp_t := ddhp * (aux.ptt / aux.pt - detPH_t / detPH);
+        ddhp_d := ddhp * (aux.ptd / aux.pt - detPH_d / detPH);
+        ddph_der := (ddph * ddph_d + dtph * ddph_t)*p_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
+
+      end if;
+    end ddph_ph_der;
+
+    function ddph_ph_dd "Second derivatives function of density"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Real ddph_ph "Second derivative of density by p at constant h";
+      output Real ddph_hp "Second mixed derivative of density by p and h";
+    protected
+      Units.SI.SpecificVolume v=1/aux.rho;
+      Real detPH "Determinant";
+      Real dht;
+      Real dhd;
+      Real ddhp;
+      Real ddph;
+      Real dtph;
+      Real dthp;
+      Real detPH_d;
+      Real detPH_t;
+      Real dhtt;
+      Real dhtd;
+      Real ddph_t;
+      Real ddph_d;
+      Real ddhp_t;
+      Real ddhp_d;
+    algorithm
+      if (aux.region == 4) then
+        dht := aux.cv + aux.dpT * v;
+        dhd := -aux.T * aux.dpT*v*v;
+        detPH := -aux.dpT * dhd;
+        dtph := 1.0 / aux.dpT;
+        ddph := dht / detPH;
+        ddhp := -aux.dpT / detPH;
+        detPH_t := 2.0 * aux.ptt / aux.dpT + 1.0 / aux.T; /* = detPH_t / detPH */
+        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
+        dhtt := aux.cvt + aux.ptt * v;
+        dhtd := -(aux.T * aux.ptt + aux.dpT) *v*v;
+        ddhp_t := ddhp * (aux.ptt / aux.dpT - detPH_t);
+        ddhp_d := ddhp * (-detPH_d);
+        ddph_t := ddph * (dhtt / dht - detPH_t);
+        ddph_d := ddph * (dhtd / dht - detPH_d);
+        ddph_ph := (ddph * ddph_d + dtph * ddph_t);
+        ddph_hp := (ddhp * ddph_d);
+      else
+        detPH := aux.cp*aux.pd;
+        dht := aux.cv + aux.pt*v;
+        dhd := (aux.pd - aux.T*aux.pt*v)*v;
+        ddph := dht/ detPH;
+        ddhp := -aux.pt/detPH;
+        dtph := -dhd/detPH;
+        dthp := aux.pd/detPH;
+        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt*v)
+            -aux.ptt*aux.pd) *aux.T*v*v;
+        detPH_t := aux.cvt*aux.pd + aux.cv*aux.ptd +
+            (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt*v*v;
+        dhtt := aux.cvt + aux.ptt*v;
+        dhtd := (aux.ptd - (aux.T * aux.ptt + aux.pt)*v) *v;
+        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
+        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
+        ddhp_t := ddhp * (aux.ptt / aux.pt - detPH_t / detPH);
+        ddhp_d := ddhp * (aux.ptd / aux.pt - detPH_d / detPH);
+        ddph_ph := (ddph * ddph_d + dtph * ddph_t);
+        ddph_hp := (ddph * ddhp_d + dtph * ddhp_t);
+      end if;
+    end ddph_ph_dd;
+
+    function ddhp_props "density derivative by specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.DerDensityByEnthalpy ddhp
+        "density derivative by specific enthalpy";
+    algorithm
+      ddhp := if aux.region == 3 then
+        -aux.rho*aux.rho*aux.pt/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt) else
+        if aux.region == 4 then -aux.rho*aux.rho/(aux.dpT*aux.T) else
+             -aux.rho*aux.rho*aux.vt/(aux.cp);
+
+      annotation (
+        Inline=false,
+        LateInline=true,
+      derivative(noDerivative=aux) = ddhp_ph_der);
+    end ddhp_props;
+
+    function ddhp "density derivative by specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.DerDensityByEnthalpy ddhp
+        "density derivative by specific enthalpy";
+    algorithm
+      ddhp := ddhp_props(p, h, waterBasePropAnalytic_ph(p, h, phase, region));
+    end ddhp;
+
+    function ddhp_ph_der "derivative function of ddhp"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real h_der "derivative of specific enthalpy";
+      output Real ddhp_der "Gradient of ddhp";
+    protected
+      Units.SI.SpecificVolume v=1/aux.rho;
+      Real detPH "Determinant";
+      Real dht;
+      Real dhd;
+      Real ddhp;
+      Real ddph;
+      Real dtph;
+      Real dthp;
+      Real detPH_d;
+      Real detPH_t;
+      Real dhtt;
+      Real dhtd;
+      Real ddhp_d;
+      Real ddhp_t;
+      Real ddph_d;
+    algorithm
+      if (aux.region == 4) then
+
+        dht := aux.cv + aux.dpT * v;
+        dhd := -aux.T * aux.dpT*v*v;
+        detPH := -aux.dpT * dhd;
+        dtph := 1.0 / aux.dpT;
+        ddph := dht / detPH;
+        ddhp := -aux.dpT / detPH;
+        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
+        dhtt := aux.cvt + aux.ptt * v;
+        dhtd := -(aux.T * aux.ptt + aux.dpT) *v*v;
+        ddhp_d := ddhp * (-detPH_d);
+        ddph_d := ddph * (dhtd / dht - detPH_d);
+        ddhp_der := (ddhp * ddhp_d)*h_der + (ddhp * ddph_d)*p_der;
+      else
+        detPH := aux.cp*aux.pd;
+        dht := aux.cv + aux.pt*v;
+        dhd := (aux.pd - aux.T*aux.pt*v)*v;
+        ddph := dht/ detPH;
+        ddhp := -aux.pt/detPH;
+        dtph := -dhd/detPH;
+        dthp := aux.pd/detPH;
+        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt*v)
+            -aux.ptt*aux.pd) *aux.T*v*v;
+        detPH_t := aux.cvt*aux.pd + aux.cv*aux.ptd +
+            (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt*v*v;
+        dhtt := aux.cvt + aux.ptt*v;
+        dhtd := (aux.ptd - (aux.T * aux.ptt + aux.pt)*v) *v;
+        ddhp_t := ddhp * (aux.ptt / aux.pt - detPH_t / detPH);
+        ddhp_d := ddhp * (aux.ptd / aux.pt - detPH_d / detPH);
+        ddhp_der := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
+      end if;
+    end ddhp_ph_der;
+
+    function ddhp_ph_dd "Second derivatives of density w.r.t h and p"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Real ddhp_hp "Second derivative of density by h at constant p";
+      output Real ddhp_ph "Second mixed derivative of density by p and h";
+    protected
+      Units.SI.SpecificVolume v=1/aux.rho;
+      Real detPH "Determinant";
+      Real dht;
+      Real dhd;
+      Real ddhp;
+      Real ddph;
+      Real dtph;
+      Real dthp;
+      Real detPH_d;
+      Real detPH_t;
+      Real dhtt;
+      Real dhtd;
+      Real ddhp_d;
+      Real ddhp_t;
+      Real ddph_d;
+    algorithm
+      if (aux.region == 4) then
+        dht := aux.cv + aux.dpT * v;
+        dhd := -aux.T * aux.dpT*v*v;
+        detPH := -aux.dpT * dhd;
+        dtph := 1.0 / aux.dpT;
+        ddph := dht / detPH;
+        ddhp := -aux.dpT / detPH;
+        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
+        dhtt := aux.cvt + aux.ptt * v;
+        dhtd := -(aux.T * aux.ptt + aux.dpT) *v*v;
+        ddhp_d := ddhp * (-detPH_d);
+        ddph_d := ddph * (dhtd / dht - detPH_d);
+        ddhp_hp := (ddhp * ddhp_d);
+        ddhp_ph := (ddhp * ddph_d);
+      else
+        detPH := aux.cp*aux.pd;
+        dht := aux.cv + aux.pt*v;
+        dhd := (aux.pd - aux.T*aux.pt*v)*v;
+        ddph := dht/ detPH;
+        ddhp := -aux.pt/detPH;
+        dtph := -dhd/detPH;
+        dthp := aux.pd/detPH;
+        detPH_d := aux.cv*aux.pdd + (2.0*aux.pt *(aux.ptd - aux.pt*v)
+            -aux.ptt*aux.pd) *aux.T*v*v;
+        detPH_t := aux.cvt*aux.pd + aux.cv*aux.ptd +
+            (aux.pt + 2.0*aux.T*aux.ptt)*aux.pt*v*v;
+        dhtt := aux.cvt + aux.ptt*v;
+        dhtd := (aux.ptd - (aux.T * aux.ptt + aux.pt)*v) *v;
+        ddhp_t := ddhp * (aux.ptt / aux.pt - detPH_t / detPH);
+        ddhp_d := ddhp * (aux.ptd / aux.pt - detPH_d / detPH);
+        ddhp_hp :=  (ddhp * ddhp_d + dthp * ddhp_t);
+        ddhp_hp :=  (ddph * ddhp_d + dtph * ddhp_t);
+      end if;
+    end ddhp_ph_dd;
+
+    function rho_props_pT "density as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := aux.rho;
+
+      annotation (
+        derivative(noDerivative=aux) = rho_pT_der,
+        Inline=false,
+        LateInline=true);
+    end rho_props_pT;
+
+    function rho_pT "density as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := rho_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
+    end rho_pT;
+
+    function h_props_pT
+      "specific enthalpy as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := aux.h;
+
+      annotation (
+        derivative(noDerivative=aux) = h_pT_der,
+        Inline=false,
+        LateInline=true);
+    end h_props_pT;
+
+    function h_pT "specific enthalpy as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "Temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := h_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
+    end h_pT;
+
+    function h_pT_der "derivative function of h_pT"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real T_der "derivative of temperature";
+      output Real h_der "derivative of specific enthalpy";
+    algorithm
+      if (aux.region == 3) then
+        h_der := ((-aux.rho*aux.pd + T*aux.pt)/(aux.rho*aux.rho*aux.pd))*p_der +
+          ((aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho
+          *aux.pd))*T_der;
+      else
+        //regions 1,2 or 5
+        h_der := (1/aux.rho - aux.T*aux.vt)*p_der + aux.cp*T_der;
+      end if;
+    end h_pT_der;
+
+    function rho_pT_der "derivative function of rho_pT"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real T_der "derivative of temperature";
+      output Real rho_der "derivative of density";
+    algorithm
+      if (aux.region == 3) then
+        rho_der := (1/aux.pd)*p_der - (aux.pt/aux.pd)*T_der;
+      else
+        //regions 1,2 or 5
+        rho_der := (-aux.rho*aux.rho*aux.vp)*p_der + (-aux.rho*aux.rho*aux.vt)*
+          T_der;
+      end if;
+    end rho_pT_der;
+
+    function s_props_pT
+      "specific entropy as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := aux.s;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end s_props_pT;
+
+    function s_pT "temperature as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := s_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end s_pT;
+
+    function cv_props_pT
+      "specific heat capacity at constant volume as function of pressure and temperature"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := aux.cv;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cv_props_pT;
+
+    function cv_pT
+      "specific heat capacity at constant volume as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := cv_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end cv_pT;
+
+    function cp_props_pT
+      "specific heat capacity at constant pressure as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := if aux.region == 3 then
+        (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd) else
+        aux.cp;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cp_props_pT;
+
+    function cp_pT
+      "specific heat capacity at constant pressure as function of pressure and temperature"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := cp_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end cp_pT;
+
+    function beta_props_pT
+      "isobaric expansion coefficient as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := if aux.region == 3 then
+        aux.pt/(aux.rho*aux.pd) else
+        aux.vt*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end beta_props_pT;
+
+    function beta_pT
+      "isobaric expansion coefficient as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := beta_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end beta_pT;
+
+    function kappa_props_pT
+      "isothermal compressibility factor as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := if aux.region == 3 then
+        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end kappa_props_pT;
+
+    function kappa_pT
+      "isothermal compressibility factor as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := kappa_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end kappa_pT;
+
+    function velocityOfSound_props_pT
+      "speed of sound as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      // dp/drho at constant s
+      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
+        sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end velocityOfSound_props_pT;
+
+    function velocityOfSound_pT
+      "speed of sound as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      v_sound := velocityOfSound_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
+    end velocityOfSound_pT;
+
+    function isentropicExponent_props_pT
+      "isentropic exponent as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
+        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_props_pT;
+
+    function isentropicExponent_pT
+      "isentropic exponent as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := isentropicExponent_props_pT(p, T, waterBasePropAnalytic_pT(p, T, region));
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_pT;
+
+    function h_props_dT
+      "specific enthalpy as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := aux.h;
+
+      annotation (
+        derivative(noDerivative=aux) = h_dT_der,
+        Inline=false,
+        LateInline=true);
+    end h_props_dT;
+
+    function h_dT "specific enthalpy as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := h_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
+    end h_dT;
+
+    function h_dT_der "derivative function of h_dT"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real d_der "derivative of density";
+      input Real T_der "derivative of temperature";
+      output Real h_der "derivative of specific enthalpy";
+    algorithm
+      if (aux.region == 3) then
+        h_der := ((-d*aux.pd + T*aux.pt)/(d*d))*d_der + ((aux.cv*d + aux.pt)/d)*
+          T_der;
+      elseif (aux.region == 4) then
+        h_der := T*aux.dpT/(d*d)*d_der + ((aux.cv*d + aux.dpT)/d)*T_der;
+      else
+        //regions 1,2 or 5
+        h_der := (-(-1/d + T*aux.vt)/(d*d*aux.vp))*d_der + ((aux.vp*aux.cp - aux.
+          vt/d + T*aux.vt*aux.vt)/aux.vp)*T_der;
+      end if;
+    end h_dT_der;
+
+    function p_props_dT "pressure as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.Pressure p "pressure";
+    algorithm
+      p := aux.p;
+
+      annotation (
+        derivative(noDerivative=aux) = p_dT_der,
+        Inline=false,
+        LateInline=true);
+    end p_props_dT;
+
+    function p_dT "pressure as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Pressure p "pressure";
+    algorithm
+      p := p_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
+    end p_dT;
+
+    function p_dT_der "derivative function of p_dT"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      input Real d_der "derivative of density";
+      input Real T_der "derivative of temperature";
+      output Real p_der "derivative of pressure";
+    algorithm
+      if (aux.region == 3) then
+        p_der := aux.pd*d_der + aux.pt*T_der;
+      elseif (aux.region == 4) then
+        p_der := aux.dpT*T_der;
+        /*density derivative is 0.0*/
+      else
+        //regions 1,2 or 5
+        p_der := (-1/(d*d*aux.vp))*d_der + (-aux.vt/aux.vp)*T_der;
+      end if;
+    end p_dT_der;
+
+    function s_props_dT
+      "specific entropy as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := aux.s;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end s_props_dT;
+
+    function s_dT "temperature as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := s_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
+    end s_dT;
+
+    function cv_props_dT
+      "specific heat capacity at constant volume as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := aux.cv;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cv_props_dT;
+
+    function cv_dT
+      "specific heat capacity at constant volume as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := cv_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
+    end cv_dT;
+
+    function cp_props_dT
+      "specific heat capacity at constant pressure as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := aux.cp;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cp_props_dT;
+
+    function cp_dT
+      "specific heat capacity at constant pressure as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := cp_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
+    end cp_dT;
+
+    function beta_props_dT
+      "isobaric expansion coefficient as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := if aux.region == 3 or aux.region == 4 then
+        aux.pt/(aux.rho*aux.pd) else
+        aux.vt*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end beta_props_dT;
+
+    function beta_dT
+      "isobaric expansion coefficient as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := beta_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
+    end beta_dT;
+
+    function kappa_props_dT
+      "isothermal compressibility factor as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := if aux.region == 3 or aux.region == 4 then
+        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end kappa_props_dT;
+
+    function kappa_dT
+      "isothermal compressibility factor as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := kappa_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
+    end kappa_dT;
+
+    function velocityOfSound_props_dT
+      "speed of sound as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      // dp/drho at constant s
+      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
+        if aux.region == 4 then
+        sqrt(1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T))) else
+             sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end velocityOfSound_props_dT;
+
+    function velocityOfSound_dT
+      "speed of sound as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      v_sound := velocityOfSound_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
+    end velocityOfSound_dT;
+
+    function isentropicExponent_props_dT
+      "isentropic exponent as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97TwoPhaseAnalytic aux
+        "auxiliary record";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := if aux.region == 3 then 1/(aux.rho*aux.p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
+             if aux.region == 4 then 1/(aux.rho*aux.p)*aux.dpT*aux.dpT*aux.T/aux.cv else
+        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_props_dT;
+
+    function isentropicExponent_dT
+      "isentropic exponent as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := isentropicExponent_props_dT(d, T, waterBasePropAnalytic_dT(d, T, phase, region));
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_dT;
+
+  public
+    function hl_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p
+      "compute the saturated liquid specific h(p)";
+    function hv_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p
+      "compute the saturated vapour specific h(p)";
+
+    function sl_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p
+      "compute the saturated liquid specific s(p)";
+    function sv_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p
+      "compute the saturated vapour specific s(p)";
+
+    function rhol_T =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_T
+      "compute the saturated liquid d(T)";
+    function rhov_T =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_T
+      "compute the saturated vapour d(T)";
+
+    function rhol_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_p
+      "compute the saturated liquid d(p)";
+    function rhov_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_p
+      "compute the saturated vapour d(p)";
+
+    function dynamicViscosity =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.visc_dT
+      "compute eta(d,T) in the one-phase region";
+    function thermalConductivity =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.cond_industrial_dT
+      "compute lambda(d,T) in the one-phase region";
+    function surfaceTension =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.surfaceTension
+      "compute sigma(T) at saturation T";
+
+  //   function isentropicEnthalpy
+  //     "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
+  //     extends Modelica.Icons.Function;
+  //     input SI.Pressure p "pressure";
+  //     input SI.SpecificEntropy s "specific entropy";
+  //     input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known";
+  //     output SI.SpecificEnthalpy h "specific enthalpy";
+  //   algorithm
+  //    h := BaseIF97.Isentropic.water_hisentropic(p,s,phase);
+  //   end isentropicEnthalpy;
+
+    function isentropicEnthalpy
+      "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := isentropicEnthalpy_props(p, s, waterBaseProp_ps(p, s, phase, region));
+    end isentropicEnthalpy;
+
+    function isentropicEnthalpy_props
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificEnthalpy h "isentropic enthalpay";
+    algorithm
+      h := aux.h;
+
+      annotation (derivative(noDerivative=aux) = isentropicEnthalpy_der,
+    Inline=false,
+    LateInline=true);
+    end isentropicEnthalpy_props;
+
+    function isentropicEnthalpy_der
+      "derivative of isentropic specific enthalpy from p,s"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      input Real p_der "pressure derivative";
+      input Real s_der "entropy derivative";
+      output Real h_der "specific enthalpy derivative";
+    algorithm
+      h_der := 1/aux.rho*p_der + aux.T*s_der;
+    end isentropicEnthalpy_der;
+
+    function dynamicIsentropicEnthalpy
+      "isentropic specific enthalpy from p,s and good guesses of d and T"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Units.SI.Density dguess
+        "good guess density, e.g. from adjacent volume";
+      input Units.SI.Temperature Tguess
+        "good guess temperature, e.g. from adjacent volume";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+     h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.water_hisentropic_dyn(
+                                                    p,s,dguess,Tguess,0);
+    end dynamicIsentropicEnthalpy;
+
+    annotation (Icon(graphics={
+          Text(
+            extent={{-102,0},{24,-26}},
+            lineColor={242,148,0},
+            textString=
+                 "Thermo"),
+          Text(
+            extent={{-4,8},{68,-34}},
+            lineColor={46,170,220},
+            textString=
+                 "SysPro"),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
+                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
+                -50,6},{-62,2}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
+                8},{-42,22},{-42,30},{-44,38}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
+                12},{-26,12},{-28,12},{-26,20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,30},{-6,26}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,36},{-6,32}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,42},{-6,38}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,48},{-6,44}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,32},{-2,28}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,38},{-2,34}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,44},{-2,40}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,50},{-2,46}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
+                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
+                -50,6},{-62,2}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Line(
+            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+            color={46,170,220},
+            thickness=0.5),
+          Polygon(
+            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+          Line(
+            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+            color={0,0,255},
+            smooth=Smooth.None),
+          Line(
+            points={{80,80},{100,100}},
+            color={0,0,255},
+            smooth=Smooth.None)}));
+  end AnalyticDerivatives;
+
+  package Standard "Standard version without Anaytic Jacobians"
+
+    import ThermoSysPro.Properties.WaterSteam.BaseIF97.*;
+
+    replaceable record iter =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData;
+
+    function waterBaseProp_ph "intermediate property record for water"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase =  0
+        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+      input Integer region = 0
+        "if 0, do region computation, otherwise assume the region is this input";
+      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      Integer error "error flag for inverse iterations";
+      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
+      Units.SI.Density d_liq "liquid density";
+      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
+      Units.SI.Density d_vap "vapour density";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties vap
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Units.SI.Temperature t1
+        "temperature at phase boundary, using inverse from region 1";
+      Units.SI.Temperature t2
+        "temperature at phase boundary, using inverse from region 2";
+    algorithm
+      aux.region := if region == 0 then
+        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ph(
+                                                              p=p,h= h,phase= phase)) else region;
+      aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1;
+      aux.p := max(p,611.657);
+      aux.h := max(h,1e3);
+      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      if (aux.region == 1) then
+        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(
+                                     aux.p, aux.h);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
+                               p, aux.T);
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 0.0;
+        aux.dpT := -aux.vt/aux.vp;
+      elseif (aux.region == 2) then
+        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(
+                                     aux.p, aux.h);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                               p, aux.T);
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 1.0;
+        aux.dpT := -aux.vt/aux.vp;
+      elseif (aux.region == 3) then
+        (aux.rho,aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofph3(
+                                                           p=aux.p,h=aux.h,delp= 1.0e-7,delh=
+                1.0e-6);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                               aux.rho, aux.T);
+        aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta);
+        aux.s := aux.R*(f.tau*f.ftau - f.f);
+        aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        aux.cv := abs(aux.R*(-f.tau*f.tau*f.ftautau))
+          "can be close to neg. infinity near critical point";
+        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
+        aux.x := 0.0;
+        aux.dpT := aux.pt; /*safety against div-by-0 in initialization*/
+      elseif (aux.region == 4) then
+        h_liq := hl_p(p);
+        h_vap := hv_p(p);
+        aux.x := if (h_vap <> h_liq) then (h - h_liq)/(h_vap - h_liq) else 1.0;
+        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
+          t1:= ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(
+                                   aux.p, h_liq);
+          t2:= ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(
+                                   aux.p, h_vap);
+          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
+                                  aux.p, t1);
+          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                                  aux.p, t2);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
+          aux.T := t1 + aux.x*(t2-t1);
+        else
+          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(
+                                       aux.p); // how to avoid ?
+          d_liq:= rhol_T(aux.T);
+          d_vap:= rhov_T(aux.T);
+          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                                  d_liq, aux.T);
+          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                                  d_vap, aux.T);
+          liq :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
+          vap :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
+        end if;
+        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
+                                                                                              aux.T);
+        aux.s := liq.s + aux.x*(vap.s - liq.s);
+        aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d));
+        aux.cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(
+              liq,
+              vap,
+              aux.x,
+              aux.T,
+              p);
+        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
+        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
+        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
+      elseif (aux.region == 5) then
+        (aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofph5(
+                                                  p=aux.p,h= aux.h,reldh= 1.0e-7);
+        assert(error == 0, "error in inverse iteration of steam tables");
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(
+                               aux.p, aux.T);
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.dpT := -aux.vt/aux.vp;
+      else
+        assert(false, "error in region computation of IF97 steam tables"
+        + "(p = " + String(p) + ", h = " + String(h) + ")");
+      end if;
+    end waterBaseProp_ph;
+
+    function waterBaseProp_ps "intermediate property record for water"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Integer phase = 0
+        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+      input Integer region = 0
+        "if 0, do region computation, otherwise assume the region is this input";
+      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      Integer error "error flag for inverse iterations";
+      Units.SI.SpecificEntropy s_liq "liquid specific entropy";
+      Units.SI.Density d_liq "liquid density";
+      Units.SI.SpecificEntropy s_vap "vapour specific entropy";
+      Units.SI.Density d_vap "vapour density";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties vap
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Units.SI.Temperature t1
+        "temperature at phase boundary, using inverse from region 1";
+      Units.SI.Temperature t2
+        "temperature at phase boundary, using inverse from region 2";
+    algorithm
+      aux.region := if region == 0 then
+        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(
+                                                              p=p,s=s,phase=phase)) else region;
+      aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1;
+      aux.p := p;
+      aux.s := s;
+      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      if (aux.region == 1) then
+        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(
+                                     p, s);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
+                               p, aux.T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 0.0;
+      elseif (aux.region == 2) then
+        aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(
+                                     p, s);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                               p, aux.T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 1.0;
+      elseif (aux.region == 3) then
+        (aux.rho,aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(
+                                                           p=p,s=s,delp=1.0e-7,dels=
+          1.0e-6);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                               aux.rho, aux.T);
+        aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta);
+        aux.s := aux.R*(f.tau*f.ftau - f.f);
+        aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
+        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
+        aux.x := 0.0;
+      elseif (aux.region == 4) then
+        s_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(
+                                       p);
+        s_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(
+                                       p);
+        aux.x := if (s_vap <> s_liq) then (s - s_liq)/(s_vap - s_liq) else 1.0;
+        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
+          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(
+                                    p, s_liq);
+          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(
+                                    p, s_vap);
+          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
+                                  p, t1);
+          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                                  p, t2);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
+          aux.T := t1 + aux.x*(t2 - t1);
+        else
+          aux.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(
+                                       p);
+          d_liq := rhol_T(aux.T);
+          d_vap := rhov_T(aux.T);
+          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                                  d_liq, aux.T);
+          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                                  d_vap, aux.T);
+          liq :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
+          vap :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
+        end if;
+        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else
+             ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
+                                   aux.T);
+        aux.h := liq.h + aux.x*(vap.h - liq.h);
+        aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d));
+        aux.cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(
+              liq,
+              vap,
+              aux.x,
+              aux.T,
+              p);
+        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
+        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
+        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
+      elseif (aux.region == 5) then
+        (aux.T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(
+                                                  p=p,s=s,relds= 1.0e-7);
+        assert(error == 0, "error in inverse iteration of steam tables");
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(
+                               p, aux.T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.rho := p/(aux.R*aux.T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+      else
+        assert(false, "error in region computation of IF97 steam tables"
+        + "(p = " + String(p) + ", s = " + String(s) + ")");
+      end if;
+    end waterBaseProp_ps;
+
+    function rho_props_ps
+      "density as function of pressure and specific entropy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
+        properties "auxiliary record";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := properties.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end rho_props_ps;
+
+    function rho_ps "density as function of pressure and specific entropy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := rho_props_ps(p, s, waterBaseProp_ps(p, s, phase, region));
+    end rho_ps;
+
+    function T_props_ps
+      "temperature as function of pressure and specific entropy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
+        properties "auxiliary record";
+      output Units.SI.Temperature T "temperature";
+    algorithm
+      T := properties.T;
+
+      annotation (Inline=false,
+                  LateInline=true);
+    end T_props_ps;
+
+    function T_ps "temperature as function of pressure and specific entropy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Temperature T "Temperature";
+    algorithm
+      T := T_props_ps(p, s, waterBaseProp_ps(p, s, phase, region));
+    end T_ps;
+
+    function h_props_ps
+      "specific enthalpy as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := aux.h;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end h_props_ps;
+
+    function h_ps "specific enthalpy as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := h_props_ps(p, s, waterBaseProp_ps(p, s, phase, region));
+    end h_ps;
+
+    function phase_ps "phase as a function of  pressure and specific entropy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      output Integer phase "true if in liquid or gas or supercritical region";
+    algorithm
+      phase := if ((s < sl_p(p) or s > sv_p(p)) or p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT)
+                                                                                               then
+                                                                                 1 else 2;
+      annotation (InlineNoEvent=false);
+    end phase_ps;
+
+    function phase_ph "phase as a function of  pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      output Integer phase "true if in liquid or gas or supercritical region";
+    algorithm
+      phase := if ((h < hl_p(p) or h > hv_p(p)) or p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT)
+                                                                                               then
+                                                                                 1 else 2;
+      annotation (InlineNoEvent=false);
+    end phase_ph;
+
+    function phase_dT "phase as a function of  pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density rho "density";
+      input Units.SI.Temperature T "temperature";
+      output Integer phase "true if in liquid or gas or supercritical region";
+    algorithm
+      phase := if not ((rho < rhol_T(T) and rho > rhov_T(T)) and T <
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT) then
+                         1 else 2;
+      annotation (InlineNoEvent=false);
+    end phase_dT;
+
+    function rho_props_ph
+      "density as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
+        properties "auxiliary record";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := properties.rho;
+
+      annotation (
+        derivative(noDerivative=properties) = rho_ph_der,
+        Inline=false,
+        LateInline=true);
+    end rho_props_ph;
+
+    function rho_ph "density as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := rho_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
+    end rho_ph;
+
+    function rho_ph_der "derivative function of rho_ph"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real h_der "derivative of specific enthalpy";
+      output Real rho_der "derivative of density";
+    algorithm
+      if (aux.region == 4) then
+        rho_der := (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T))*p_der
+           + (-aux.rho*aux.rho/(aux.dpT*aux.T))*h_der;
+      elseif (aux.region == 3) then
+        rho_der := ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd*
+          aux.cv + aux.T*aux.pt*aux.pt))*p_der + (-aux.rho*aux.rho*aux.pt/(aux.
+          rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_der;
+      else
+        //regions 1,2,5
+        rho_der := (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux.
+          vt*aux.vt)/aux.cp)*p_der + (-aux.rho*aux.rho*aux.vt/(aux.cp))*h_der;
+      end if;
+    end rho_ph_der;
+
+    function T_props_ph
+      "temperature as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
+        properties "auxiliary record";
+      output Units.SI.Temperature T "temperature";
+    algorithm
+      T := properties.T;
+
+      annotation (derivative(noDerivative=properties) = T_ph_der,
+        Inline=false,
+        LateInline=true);
+    end T_props_ph;
+
+    function T_ph "temperature as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Temperature T "Temperature";
+    algorithm
+      T := T_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
+    end T_ph;
+
+    function T_ph_der "derivative function of T_ph"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real h_der "derivative of specific enthalpy";
+      output Real T_der "derivative of temperature";
+    algorithm
+      if (aux.region == 4) then
+        T_der := 1/aux.dpT*p_der;
+      elseif (aux.region == 3) then
+        T_der := ((-aux.rho*aux.pd + aux.T*aux.pt)/(aux.rho*aux.rho*aux.pd*aux.cv
+           + aux.T*aux.pt*aux.pt))*p_der + ((aux.rho*aux.rho*aux.pd)/(aux.rho*aux.
+           rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_der;
+      else
+        //regions 1,2 or 5
+        T_der := ((-1/aux.rho + aux.T*aux.vt)/aux.cp)*p_der + (1/aux.cp)*h_der;
+      end if;
+    end T_ph_der;
+
+    function s_props_ph
+      "specific entropy as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase
+        properties "auxiliary record";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := properties.s;
+
+      annotation (derivative(noDerivative=properties) = s_ph_der,
+    Inline=false,
+    LateInline=true);
+    end s_props_ph;
+
+    function s_ph
+      "specific entropy as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase =   0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := s_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
+    end s_ph;
+
+    function s_ph_der
+      "specific entropy as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real h_der "derivative of specific enthalpy";
+      output Real s_der "derivative of entropy";
+    algorithm
+      s_der := -1/(aux.rho*aux.T)*p_der + 1/aux.T*h_der;
+    end s_ph_der;
+
+    function cv_props_ph
+      "specific heat capacity at constant volume as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := aux.cv;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cv_props_ph;
+
+    function cv_ph
+      "specific heat capacity at constant volume as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := cv_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
+    end cv_ph;
+
+    function regionAssertReal "assert function for inlining"
+      extends Modelica.Icons.Function;
+      input Boolean check "condition to check";
+      output Real dummy "dummy output";
+    algorithm
+      assert(check, "this function can not be called with two-phase inputs!");
+    end regionAssertReal;
+
+    function cp_props_ph
+      "specific heat capacity at constant pressure as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := aux.cp;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cp_props_ph;
+
+    function cp_ph
+      "specific heat capacity at constant pressure as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := cp_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
+    end cp_ph;
+
+    function beta_props_ph
+      "isobaric expansion coefficient as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := if aux.region == 3 or aux.region == 4 then
+        aux.pt/(aux.rho*aux.pd) else
+        aux.vt*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end beta_props_ph;
+
+    function beta_ph
+      "isobaric expansion coefficient as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := beta_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
+    end beta_ph;
+
+    function kappa_props_ph
+      "isothermal compressibility factor as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := if aux.region == 3 or aux.region == 4 then
+        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end kappa_props_ph;
+
+    function kappa_ph
+      "isothermal compressibility factor as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := kappa_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
+    end kappa_ph;
+
+    function velocityOfSound_props_ph
+      "speed of sound as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      // dp/drho at constant s
+      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
+        if aux.region == 4 then
+        sqrt(1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T))) else
+             sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end velocityOfSound_props_ph;
+
+    function velocityOfSound_ph
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      v_sound := velocityOfSound_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
+    end velocityOfSound_ph;
+
+    function isentropicExponent_props_ph
+      "isentropic exponent as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
+             if aux.region == 4 then 1/(aux.rho*p)*aux.dpT*aux.dpT*aux.T/aux.cv else
+        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_props_ph;
+
+    function isentropicExponent_ph
+      "isentropic exponent as function of pressure and specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase =   0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := isentropicExponent_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_ph;
+
+    function ddph_props "density derivative by pressure"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.DerDensityByPressure ddph
+        "density derivative by pressure";
+    algorithm
+      ddph := if aux.region == 3 then
+        ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)) else
+        if aux.region == 4 then  (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) else
+             (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux.vt*aux.vt)/aux.cp);
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end ddph_props;
+
+    function ddph "density derivative by pressure"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.DerDensityByPressure ddph
+        "density derivative by pressure";
+    algorithm
+      ddph := ddph_props(p, h, waterBaseProp_ph(p, h, phase, region));
+    end ddph;
+
+    function ddhp_props "density derivative by specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.DerDensityByEnthalpy ddhp
+        "density derivative by specific enthalpy";
+    algorithm
+      ddhp := if aux.region == 3 then
+        -aux.rho*aux.rho*aux.pt/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt) else
+        if aux.region == 4 then -aux.rho*aux.rho/(aux.dpT*aux.T) else
+             -aux.rho*aux.rho*aux.vt/(aux.cp);
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end ddhp_props;
+
+    function ddhp "density derivative by specific enthalpy"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEnthalpy h "specific enthalpy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.DerDensityByEnthalpy ddhp
+        "density derivative by specific enthalpy";
+    algorithm
+      ddhp := ddhp_props(p, h, waterBaseProp_ph(p, h, phase, region));
+    end ddhp;
+
+    function waterBaseProp_pT
+      "intermediate property record for water (p and T prefered states)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region = 0
+        "if 0, do region computation, otherwise assume the region is this input";
+      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      Integer error "error flag for inverse iterations";
+    algorithm
+      aux.phase := 1;
+      aux.region := if region == 0 then ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(
+                                                                   p=p,T= T) else region;
+      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      aux.p := p;
+      aux.T := T;
+      if (aux.region == 1) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
+                               p, T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := p/(aux.R*T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 0.0;
+      elseif (aux.region == 2) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                               p, T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := p/(aux.R*T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 1.0;
+      elseif (aux.region == 3) then
+        (aux.rho,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(
+                                                    p=p,T= T,delp= 1.0e-7);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                               aux.rho, T);
+        aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta);
+        aux.s := aux.R*(f.tau*f.ftau - f.f);
+        aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
+        aux.x := 0.0;
+      elseif (aux.region == 5) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(
+                               p, T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := p/(aux.R*T*g.pi*g.gpi);
+        aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+      else
+        assert(false, "error in region computation of IF97 steam tables"
+         + "(p = " + String(p) + ", T = " + String(T) + ")");
+      end if;
+    end waterBaseProp_pT;
+
+    function rho_props_pT "density as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := aux.rho;
+
+      annotation (
+        derivative(noDerivative=aux) = rho_pT_der,
+        Inline=false,
+        LateInline=true);
+    end rho_props_pT;
+
+    function rho_pT "density as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Density rho "density";
+    algorithm
+      rho := rho_props_pT(p, T, waterBaseProp_pT(p, T, region));
+    end rho_pT;
+
+    function h_props_pT
+      "specific enthalpy as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := aux.h;
+
+      annotation (
+        derivative(noDerivative=aux) = h_pT_der,
+        Inline=false,
+        LateInline=true);
+    end h_props_pT;
+
+    function h_pT "specific enthalpy as function or pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "Temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := h_props_pT(p, T, waterBaseProp_pT(p, T, region));
+    end h_pT;
+
+    function h_pT_der "derivative function of h_pT"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real T_der "derivative of temperature";
+      output Real h_der "derivative of specific enthalpy";
+    algorithm
+      if (aux.region == 3) then
+        h_der := ((-aux.rho*aux.pd + T*aux.pt)/(aux.rho*aux.rho*aux.pd))*p_der +
+          ((aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho
+          *aux.pd))*T_der;
+      else
+        //regions 1,2 or 5
+        h_der := (1/aux.rho - aux.T*aux.vt)*p_der + aux.cp*T_der;
+      end if;
+    end h_pT_der;
+
+    function rho_pT_der "derivative function of rho_pT"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      input Real p_der "derivative of pressure";
+      input Real T_der "derivative of temperature";
+      output Real rho_der "derivative of density";
+    algorithm
+      if (aux.region == 3) then
+        rho_der := (1/aux.pd)*p_der - (aux.pt/aux.pd)*T_der;
+      else
+        //regions 1,2 or 5
+        rho_der := (-aux.rho*aux.rho*aux.vp)*p_der + (-aux.rho*aux.rho*aux.vt)*
+          T_der;
+      end if;
+    end rho_pT_der;
+
+    function s_props_pT
+      "specific entropy as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := aux.s;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end s_props_pT;
+
+    function s_pT "temperature as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := s_props_pT(p, T, waterBaseProp_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end s_pT;
+
+    function cv_props_pT
+      "specific heat capacity at constant volume as function of pressure and temperature"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := aux.cv;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cv_props_pT;
+
+    function cv_pT
+      "specific heat capacity at constant volume as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := cv_props_pT(p, T, waterBaseProp_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end cv_pT;
+
+    function cp_props_pT
+      "specific heat capacity at constant pressure as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := if aux.region == 3 then
+        (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd) else
+        aux.cp;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cp_props_pT;
+
+    function cp_pT
+      "specific heat capacity at constant pressure as function of pressure and temperature"
+
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := cp_props_pT(p, T, waterBaseProp_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end cp_pT;
+
+    function beta_props_pT
+      "isobaric expansion coefficient as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := if aux.region == 3 then
+        aux.pt/(aux.rho*aux.pd) else
+        aux.vt*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end beta_props_pT;
+
+    function beta_pT
+      "isobaric expansion coefficient as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := beta_props_pT(p, T, waterBaseProp_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end beta_pT;
+
+    function kappa_props_pT
+      "isothermal compressibility factor as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := if aux.region == 3 then
+        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end kappa_props_pT;
+
+    function kappa_pT
+      "isothermal compressibility factor as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := kappa_props_pT(p, T, waterBaseProp_pT(p, T, region));
+      annotation (InlineNoEvent=false);
+    end kappa_pT;
+
+    function velocityOfSound_props_pT
+      "speed of sound as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      // dp/drho at constant s
+      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
+        sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end velocityOfSound_props_pT;
+
+    function velocityOfSound_pT
+      "speed of sound as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      v_sound := velocityOfSound_props_pT(p, T, waterBaseProp_pT(p, T, region));
+    end velocityOfSound_pT;
+
+    function isentropicExponent_props_pT
+      "isentropic exponent as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
+        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_props_pT;
+
+    function isentropicExponent_pT
+      "isentropic exponent as function of pressure and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.Temperature T "temperature";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := isentropicExponent_props_pT(p, T, waterBaseProp_pT(p, T, region));
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_pT;
+
+    function waterBaseProp_dT
+      "intermediate property record for water (d and T prefered states)"
+      import ThermoSysPro;
+      extends Modelica.Icons.Function;
+      input Units.SI.Density rho "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+      input Integer region = 0
+        "if 0, do region computation, otherwise assume the region is this input";
+      output ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+    protected
+      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
+      Units.SI.Density d_liq "liquid density";
+      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
+      Units.SI.Density d_vap "vapour density";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.PhaseBoundaryProperties liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.Common.PhaseBoundaryProperties vap
+        "phase boundary property record";
+      ThermoSysPro.Properties.Common.GibbsDerivs gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.GibbsDerivs gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.Common.HelmholtzDerivs fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Integer error "error flag for inverse iterations";
+    algorithm
+      aux.region := if region == 0 then
+        (if phase == 2 then 4 else ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_dT(
+                                                              d=rho,T= T,phase= phase)) else region;
+      aux.phase := if aux.region == 4 then 2 else 1;
+      aux.R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      aux.rho := rho;
+      aux.T := T;
+      if (aux.region == 1) then
+        (aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
+                                                    d=rho,T= T,reldd= 1.0e-8,region=
+                 1);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
+                               aux.p, T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := aux.p/(aux.R*T*g.pi*g.gpi);
+        aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 0.0;
+      elseif (aux.region == 2) then
+        (aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
+                                                    d=rho,T= T,reldd= 1.0e-8,region=
+                 2);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                               aux.p, T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := aux.p/(aux.R*T*g.pi*g.gpi);
+        aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+        aux.x := 1.0;
+      elseif (aux.region == 3) then
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                               rho, T);
+        aux.p := aux.R*rho*T*f.delta*f.fdelta;
+        aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta);
+        aux.s := aux.R*(f.tau*f.ftau - f.f);
+        aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        aux.pt := aux.R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd);
+        aux.cv := aux.R*(-f.tau*f.tau*f.ftautau);
+        aux.x := 0.0;
+      elseif (aux.region == 4) then
+        aux.p := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(
+                                     T);
+        aux.dpT := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
+                                         T);
+        d_liq := rhol_T(T);
+        d_vap := rhov_T(T);
+        h_liq := hl_p(aux.p);
+        h_vap := hv_p(aux.p);
+        aux.x := if (d_vap <> d_liq) then (1/rho - 1/d_liq)/(1/d_vap - 1/d_liq) else
+        1.0;
+        aux.h := h_liq + aux.x*(h_vap - h_liq);
+        if T <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TLIMIT1 then
+          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(
+                                  aux.p, T);
+          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                                  aux.p, T);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps(gv);
+        else
+          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                                  d_liq, T);
+          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(
+                                  d_vap, T);
+          liq :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fl);
+          vap :=
+            ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps(fv);
+        end if;
+        aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(
+                                                                                              aux.T);
+        aux.s := liq.s + aux.x*(vap.s - liq.s);
+        aux.cv := ThermoSysPro.Properties.WaterSteam.Common.cv2Phase(
+              liq,
+              vap,
+              aux.x,
+              aux.T,
+              aux.p);
+        aux.cp := liq.cp + aux.x*(vap.cp - liq.cp);
+        aux.pt := liq.pt + aux.x*(vap.pt - liq.pt);
+        aux.pd := liq.pd + aux.x*(vap.pd - liq.pd);
+      elseif (aux.region == 5) then
+        (aux.p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(
+                                                    d=rho,T= T,reldd= 1.0e-8,region=5);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(
+                               aux.p, T);
+        aux.h := aux.R*aux.T*g.tau*g.gtau;
+        aux.s := aux.R*(g.tau*g.gtau - g.g);
+        aux.rho := aux.p/(aux.R*T*g.pi*g.gpi);
+        aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi;
+        aux.cp := -aux.R*g.tau*g.tau*g.gtautau;
+        aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi));
+      else
+        assert(false, "error in region computation of IF97 steam tables"
+         + "(rho = " + String(rho) + ", T = " + String(T) + ")");
+      end if;
+    end waterBaseProp_dT;
+
+    function h_props_dT
+      "specific enthalpy as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := aux.h;
+
+      annotation (
+        derivative(noDerivative=aux) = h_dT_der,
+        Inline=false,
+        LateInline=true);
+    end h_props_dT;
+
+    function h_dT "specific enthalpy as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := h_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
+    end h_dT;
+
+    function h_dT_der "derivative function of h_dT"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      input Real d_der "derivative of density";
+      input Real T_der "derivative of temperature";
+      output Real h_der "derivative of specific enthalpy";
+    algorithm
+      if (aux.region == 3) then
+        h_der := ((-d*aux.pd + T*aux.pt)/(d*d))*d_der + ((aux.cv*d + aux.pt)/d)*
+          T_der;
+      elseif (aux.region == 4) then
+        h_der := T*aux.dpT/(d*d)*d_der + ((aux.cv*d + aux.dpT)/d)*T_der;
+      else
+        //regions 1,2 or 5
+        h_der := (-(-1/d + T*aux.vt)/(d*d*aux.vp))*d_der + ((aux.vp*aux.cp - aux.
+          vt/d + T*aux.vt*aux.vt)/aux.vp)*T_der;
+      end if;
+    end h_dT_der;
+
+    function p_props_dT "pressure as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.Pressure p "pressure";
+    algorithm
+      p := aux.p;
+
+      annotation (
+        derivative(noDerivative=aux) = p_dT_der,
+        Inline=false,
+        LateInline=true);
+    end p_props_dT;
+
+    function p_dT "pressure as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Pressure p "pressure";
+    algorithm
+      p := p_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
+    end p_dT;
+
+    function p_dT_der "derivative function of p_dT"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      input Real d_der "derivative of density";
+      input Real T_der "derivative of temperature";
+      output Real p_der "derivative of pressure";
+    algorithm
+      if (aux.region == 3) then
+        p_der := aux.pd*d_der + aux.pt*T_der;
+      elseif (aux.region == 4) then
+        p_der := aux.dpT*T_der;
+        /*density derivative is 0.0*/
+      else
+        //regions 1,2 or 5
+        p_der := (-1/(d*d*aux.vp))*d_der + (-aux.vt/aux.vp)*T_der;
+      end if;
+    end p_dT_der;
+
+    function s_props_dT
+      "specific entropy as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := aux.s;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end s_props_dT;
+
+    function s_dT "temperature as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "Temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEntropy s "specific entropy";
+    algorithm
+      s := s_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
+    end s_dT;
+
+    function cv_props_dT
+      "specific heat capacity at constant volume as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := aux.cv;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cv_props_dT;
+
+    function cv_dT
+      "specific heat capacity at constant volume as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+    algorithm
+      cv := cv_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
+    end cv_dT;
+
+    function cp_props_dT
+      "specific heat capacity at constant pressure as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := aux.cp;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end cp_props_dT;
+
+    function cp_dT
+      "specific heat capacity at constant pressure as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+    algorithm
+      cp := cp_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
+    end cp_dT;
+
+    function beta_props_dT
+      "isobaric expansion coefficient as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := if aux.region == 3 or aux.region == 4 then
+        aux.pt/(aux.rho*aux.pd) else
+        aux.vt*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end beta_props_dT;
+
+    function beta_dT
+      "isobaric expansion coefficient as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.RelativePressureCoefficient beta
+        "isobaric expansion coefficient";
+    algorithm
+      beta := beta_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
+    end beta_dT;
+
+    function kappa_props_dT
+      "isothermal compressibility factor as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := if aux.region == 3 or aux.region == 4 then
+        1/(aux.rho*aux.pd) else -aux.vp*aux.rho;
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end kappa_props_dT;
+
+    function kappa_dT
+      "isothermal compressibility factor as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.IsothermalCompressibility kappa
+        "isothermal compressibility factor";
+    algorithm
+      kappa := kappa_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
+    end kappa_dT;
+
+    function velocityOfSound_props_dT
+      "speed of sound as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      // dp/drho at constant s
+      v_sound := if aux.region == 3 then sqrt((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)) else
+        if aux.region == 4 then
+        sqrt(1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T))) else
+             sqrt(-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T)));
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end velocityOfSound_props_dT;
+
+    function velocityOfSound_dT
+      "speed of sound as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.Velocity v_sound "speed of sound";
+    algorithm
+      v_sound := velocityOfSound_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
+    end velocityOfSound_dT;
+
+    function isentropicExponent_props_dT
+      "isentropic exponent as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := if aux.region == 3 then 1/(aux.rho*aux.p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else
+             if aux.region == 4 then 1/(aux.rho*aux.p)*aux.dpT*aux.dpT*aux.T/aux.cv else
+        -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);
+
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_props_dT;
+
+    function isentropicExponent_dT
+      "isentropic exponent as function of density and temperature"
+      extends Modelica.Icons.Function;
+      input Units.SI.Density d "density";
+      input Units.SI.Temperature T "temperature";
+      input Integer phase =  0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region =  0
+        "if 0, region is unknown, otherwise known and this input";
+      output Real gamma "isentropic exponent";
+    algorithm
+      gamma := isentropicExponent_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));
+      annotation (
+        Inline=false,
+        LateInline=true);
+    end isentropicExponent_dT;
+
+  public
+    function hl_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p
+      "compute the saturated liquid specific h(p)";
+    function hv_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p
+      "compute the saturated vapour specific h(p)";
+
+    function sl_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p
+      "compute the saturated liquid specific s(p)";
+    function sv_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p
+      "compute the saturated vapour specific s(p)";
+
+    function rhol_T =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_T
+      "compute the saturated liquid d(T)";
+    function rhov_T =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_T
+      "compute the saturated vapour d(T)";
+
+    function rhol_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_p
+      "compute the saturated liquid d(p)";
+    function rhov_p =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_p
+      "compute the saturated vapour d(p)";
+
+    function dynamicViscosity =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.visc_dT
+      "compute eta(d,T) in the one-phase region";
+    function thermalConductivity =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.cond_industrial_dT
+      "compute lambda(d,T) in the one-phase region";
+    function surfaceTension =
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.surfaceTension
+      "compute sigma(T) at saturation T";
+
+  //   function isentropicEnthalpy
+  //     "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
+  //     extends Modelica.Icons.Function;
+  //     input SI.Pressure p "pressure";
+  //     input SI.SpecificEntropy s "specific entropy";
+  //     input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known";
+  //     output SI.SpecificEnthalpy h "specific enthalpy";
+  //   algorithm
+  //    h := BaseIF97.Isentropic.water_hisentropic(p,s,phase);
+  //   end isentropicEnthalpy;
+
+    function isentropicEnthalpy
+      "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      input Integer region = 0
+        "if 0, region is unknown, otherwise known and this input";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+      h := isentropicEnthalpy_props(p, s, waterBaseProp_ps(p, s, phase, region));
+    end isentropicEnthalpy;
+
+    function isentropicEnthalpy_props
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      output Units.SI.SpecificEnthalpy h "isentropic enthalpay";
+    algorithm
+      h := aux.h;
+
+      annotation (derivative(noDerivative=aux) = isentropicEnthalpy_der,
+    Inline=false,
+    LateInline=true);
+    end isentropicEnthalpy_props;
+
+    function isentropicEnthalpy_der
+      "derivative of isentropic specific enthalpy from p,s"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input ThermoSysPro.Properties.WaterSteam.Common.IF97BaseTwoPhase aux
+        "auxiliary record";
+      input Real p_der "pressure derivative";
+      input Real s_der "entropy derivative";
+      output Real h_der "specific enthalpy derivative";
+    algorithm
+      h_der := 1/aux.rho*p_der + aux.T*s_der;
+    end isentropicEnthalpy_der;
+
+    function dynamicIsentropicEnthalpy
+      "isentropic specific enthalpy from p,s and good guesses of d and T"
+      extends Modelica.Icons.Function;
+      input Units.SI.Pressure p "pressure";
+      input Units.SI.SpecificEntropy s "specific entropy";
+      input Units.SI.Density dguess
+        "good guess density, e.g. from adjacent volume";
+      input Units.SI.Temperature Tguess
+        "good guess temperature, e.g. from adjacent volume";
+      input Integer phase = 0
+        "2 for two-phase, 1 for one-phase, 0 if not known";
+      output Units.SI.SpecificEnthalpy h "specific enthalpy";
+    algorithm
+     h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.water_hisentropic_dyn(
+                                                    p,s,dguess,Tguess,0);
+    end dynamicIsentropicEnthalpy;
+
+    annotation (Icon(graphics={
+          Text(
+            extent={{-102,0},{24,-26}},
+            lineColor={242,148,0},
+            textString=
+                 "Thermo"),
+          Text(
+            extent={{-4,8},{68,-34}},
+            lineColor={46,170,220},
+            textString=
+                 "SysPro"),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
+                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
+                -50,6},{-62,2}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
+                8},{-42,22},{-42,30},{-44,38}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
+                12},{-26,12},{-28,12},{-26,20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,30},{-6,26}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,36},{-6,32}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,42},{-6,38}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,48},{-6,44}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,32},{-2,28}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,38},{-2,34}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,44},{-2,40}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,50},{-2,46}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
+                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
+                -50,6},{-62,2}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Line(
+            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+            color={46,170,220},
+            thickness=0.5),
+          Polygon(
+            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+          Line(
+            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+            color={0,0,255},
+            smooth=Smooth.None),
+          Line(
+            points={{80,80},{100,100}},
+            color={0,0,255},
+            smooth=Smooth.None)}));
+  end Standard;
+  annotation (Documentation(info="<HTML>
+      <h4>Package description:</h4>
+      <p>This package provides high accuracy physical properties for water according
+      to the IAPWS/IF97 standard. It has been part of the ThermoFluid Modelica library and been extended,
+      reorganized and documented to become part of the Modelica Standard library.</p>
+      <p>An important feature that distinguishes this implementation of the IF97 steam property standard
+      is that this implementation has been explicitly designed to work well in dynamic simulations. Computational
+      performance has been of high importance. This means that there often exist several ways to get the same result
+      from different functions if one of the functions is called often but can be optimized for that purpose.
+      </p>
+      <p>
+      The original documentation of the IAPWS/IF97 steam properties can freely be distributed with computer
+      implementations, so for curious minds the complete standard documentation is provided with the Modelica
+      properties library. The following documents are included
+      (in directory Modelica\\help\\IF97documentation):
+      <ul>
+      <li><a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a> The standards document for the main part of the IF97.</li>
+      <li><a href=\"IF97documentation/Back3.pdf\">Back3.pdf</a> The backwards equations for region 3.</li>
+      <li><a href=\"IF97documentation/crits.pdf\">crits.pdf</a> The critical point data.</li>
+      <li><a href=\"IF97documentation/meltsub.pdf\">meltsub.pdf</a> The melting- and sublimation line formulation (in IF97_Utilities.BaseIF97.IceBoundaries)</li>
+      <li><a href=\"IF97documentation/surf.pdf\">surf.pdf</a> The surface tension standard definition</li>
+      <li><a href=\"IF97documentation/thcond.pdf\">thcond.pdf</a> The thermal conductivity standard definition</li>
+      <li><a href=\"IF97documentation/visc.pdf\">visc.pdf</a> The viscosity standard definition</li>
+      </ul>
+      </p>
+      <h4>Package contents
+      </h4>
+      <p>
+      <ul>
+      <li>Package <b>BaseIF97</b> contains the implementation of the IAPWS-IF97 as described in
+      <a href=\"IF97documentation/IF97.pdf\">IF97.pdf</a>. The explicit backwards equations for region 3 from
+      <a href=\"IF97documentation/Back3.pdf\">Back3.pdf</a> are implemented as initial values for an inverse iteration of the exact
+      function in IF97 for the input pairs (p,h) and (p,s).
+      The low-level functions in BaseIF97 are not needed for standard simulation usage,
+      but can be useful for experts and some special purposes.</li>
+      <li>Function <b>water_ph</b> returns all properties needed for a dynamic control volume model and properties of general
+      interest using pressure p and specific entropy enthalpy h as dynamic states in the record ThermoProperties_ph. </li>
+      <li>Function <b>water_ps</b> returns all properties needed for a dynamic control volume model and properties of general
+      interest using pressure p and specific entropy s as dynamic states in the record ThermoProperties_ps. </li>
+      <li>Function <b>water_dT</b> returns all properties needed for a dynamic control volume model and properties of general
+      interest using density d and temperature T as dynamic states in the record ThermoProperties_dT. </li>
+      <li>Function <b>water_pT</b> returns all properties needed for a dynamic control volume model and properties of general
+      interest using pressure p and temperature T as dynamic states in the record ThermoProperties_pT. Due to the coupling of
+      pressure and temperature in the two-phase region, this model can obviously
+      only be used for one-phase models or models treating both phases independently.</li>
+      <li>Function <b>hl_p</b> computes the liquid specific enthalpy as a function of pressure. For overcritical pressures,
+      the critical specific enthalpy is returned</li>
+      <li>Function <b>hv_p</b> computes the vapour specific enthalpy as a function of pressure. For overcritical pressures,
+      the critical specific enthalpy is returned</li>
+      <li>Function <b>sl_p</b> computes the liquid specific entropy as a function of pressure. For overcritical pressures,
+      the critical  specific entropy is returned</li>
+      <li>Function <b>sv_p</b> computes the vapour  specific entropy as a function of pressure. For overcritical pressures,
+      the critical  specific entropyis returned</li>
+      <li>Function <b>rhol_T</b> computes the liquid density as a function of temperature. For overcritical temperatures,
+      the critical density is returned</li>
+      <li>Function <b>rhol_T</b> computes the vapour density as a function of temperature. For overcritical temperatures,
+      the critical density is returned</li>
+      <li>Function <b>dynamicViscosity</b> computes the dynamic viscosity as a function of density and temperature.</li>
+      <li>Function <b>thermalConductivity</b> computes the thermal conductivity as a function of density, temperature and pressure.
+      <b>Important note</b>: Obviously only two of the three
+      inputs are really needed, but using three inputs speeds up the computation and the three variables
+      are known in most models anyways. The inputs d,T and p have to be consistent.</li>
+      <li>Function <b>surfaceTension</b> computes the surface tension between vapour
+          and liquid water as a function of temperature.</li>
+      <li>Function <b>isentropicEnthalpy</b> computes the specific enthalpy h(p,s,phase) in all regions.
+          The phase input is needed due to discontinuous derivatives at the phase boundary.</li>
+      <li>Function <b>dynamicIsentropicEnthalpy</b> computes the specific enthalpy h(p,s,,dguess,Tguess,phase) in all regions.
+          The phase input is needed due to discontinuous derivatives at the phase boundary. Tguess and dguess are initial guess
+          values for the density and temperature consistent with p and s. This function should be preferred in
+          dynamic simulations where good guesses are often available.</li>
+      </ul>
+      </p>
+      <h4>Version Info and Revision history
+      </h4>
+      <ul>
+      <li>First implemented: <i>July, 2000</i>
+      by Hubertus Tummescheit for the ThermoFluid Library with help from Jonas Eborn and Falko Jens Wagner
+      </li>
+      <li>Code reorganization, enhanced documentation, additional functions:   <i>December, 2002</i>
+      by <a href=\"mailto:Hubertus.Tummescheit@modelon.se\">Hubertus Tummescheit</a> and moved to Modelica
+      properties library.</li>
+      </ul>
+      <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+      </address>
+      </HTML>", revisions="<h4>Intermediate release notes during development<\\h4>
+<p>Currenly the Events/noEvents switch is only implmented for p-h states. Only after testing that implmentation, it will be extended to dT.</p>"),
+      Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end IF97_Utilities;
diff --git a/ThermoSysPro/Properties/WaterSteam/IF97_packages.mo b/ThermoSysPro/Properties/WaterSteam/IF97_packages.mo
index e4d6fc6e237ccc5d743aa97382b421297b9680fc..c73974e557d3a0a44501525752d07c2f4fa24534 100644
--- a/ThermoSysPro/Properties/WaterSteam/IF97_packages.mo
+++ b/ThermoSysPro/Properties/WaterSteam/IF97_packages.mo
@@ -1,5246 +1,5246 @@
-within ThermoSysPro.Properties.WaterSteam;
-package IF97_packages
-
-  package IF97_wAJ
-      constant IF97_wAJ.Spline_Utilities.Data IF97_spline(
-        ndim = 1,
-        ncontrol = 100,
-        degree = 3,
-        knots = {
-        2.93063160225403e-007, 2.93063160225403e-007, 2.93063160225403e-007, 2.93063160225403e-007,
-        0.0150553301018805, 0.0225746360796844, 0.0300841766610507, 0.0375864719559614,
-        0.0450833779282367, 0.0525763026035424, 0.0600663541987385, 0.0675544420190098,
-        0.0750413446792581, 0.0825277558142009, 0.0900143143696351, 0.0975016244159301,
-        0.104990267916964, 0.11248081283071, 0.119973818177067, 0.127469837190213,
-        0.134969419310924, 0.14247311152242, 0.149981459358957, 0.157495007796453,
-        0.165014302152702, 0.172539889069826, 0.180072317615317, 0.187612140514708,
-        0.195159915514515, 0.202716206865773, 0.21028158691427, 0.217856637782066,
-        0.225441953125109, 0.233038139953034, 0.240645820499176, 0.248265634131007,
-        0.255898239293619, 0.26354431548115, 0.271204565233372, 0.278879716156774,
-        0.286570522971491, 0.294277769587339, 0.302002271213962, 0.309744876511783,
-        0.317506469792076, 0.325287973276035, 0.333090349424309, 0.340914603350119,
-        0.348761785330786, 0.356632993434437, 0.364529376280738, 0.372452135957019,
-        0.380402531113975, 0.388381880268579, 0.39639156534589, 0.404433035496425,
-        0.412507811231662, 0.420617488927502, 0.42876374575417, 0.436948345101518,
-        0.445173142581185, 0.453440092702033, 0.461751256332929, 0.470108809087968,
-        0.478515050793845, 0.486972416228223, 0.495483487352128, 0.50405100729972,
-        0.512677896436249, 0.521367270850924, 0.53012246371707, 0.538947050028345,
-        0.547844875307676, 0.556820088984304, 0.565877183242573, 0.575021038260507,
-        0.584256974874285, 0.593590815826759, 0.603028956896544, 0.612578449397273,
-        0.622247095874125, 0.632043561486359, 0.641977504873387, 0.652059734791795,
-        0.662302403295546, 0.672719253852374, 0.6833259549907, 0.694140568427125,
-        0.705184226398132, 0.716482126202646, 0.728064988229839, 0.739971159691273,
-        0.752249564928059, 0.764963678571606, 0.77819659006882, 0.79205900502822,
-        0.806726369054731, 0.822437269975835, 0.839573763094594, 0.858852425095749,
-        1, 1, 1, 1},
-        controlPoints = [
-        6.41617166788097; 6.59657375859249; 6.85956502478188; 7.19550228677957;
-        7.44003141655459; 7.67746343199683; 7.90809030002524; 8.1321863948823;
-        8.35001072138466; 8.56180824123764; 8.76781112389037; 8.96823977601129;
-        9.16330374171574; 9.35320248746118; 9.53812609634101; 9.71825588651749;
-        9.89376496619584; 10.064818734583; 10.2315753364618; 10.394186076569;
-        10.552795798896; 10.7075432351955; 10.8585613263155; 11.0059775194514;
-        11.1499140439677; 11.2904881680785; 11.427812438369; 11.561994903882;
-        11.6931393262684; 11.8213453773153; 11.9467088249962; 12.0693217090492;
-        12.1892725069664; 12.3066462911727; 12.421524878079; 12.5339869696189;
-        12.644108287808; 12.7519617028068; 12.8576173549182; 12.9611427709053;
-        13.06260297498; 13.1620605947781; 13.25957596261; 13.355207212251;
-        13.4490103715159; 13.5410394508422; 13.6313465280923; 13.7199818297721;
-        13.8069938088494; 13.892429219348; 13.9763331878828; 14.0587492822951;
-        14.1397195775398; 14.2192847189711; 14.297483983169; 14.3743553364442;
-        14.4499354911556; 14.524259959973; 14.5973631082143; 14.6692782043857;
-        14.740037469051; 14.8096721221595; 14.8782124289575; 14.9456877446163;
-        15.0121265577065; 15.0775565326579; 15.1420045513451; 15.2054967539465;
-        15.2680585792283; 15.3297148044048; 15.3904895847271; 15.4504064929423;
-        15.5094885587568; 15.5677583084284; 15.6252378046292; 15.6819486867911;
-        15.7379122123276; 15.7931492995096; 15.8476805734722; 15.9015264179811;
-        15.9547070373259; 16.0072425350593; 16.0591530191528; 16.11045874587;
-        16.1611803164475; 16.211338938197; 16.2609567565343; 16.3100572327281;
-        16.3586655540358; 16.4068088127073; 16.4545163733577; 16.501817689937;
-        16.5487496364798; 16.5953631575021; 16.6418467771832; 16.6879750106034;
-        16.7343150270632; 16.8752144692458; 16.9266730020941; 16.9094578790152]);
-
-    function Water_Ph
-      input Units.SI.AbsolutePressure p "Pressure";
-      input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-      input Integer mode = 0 "IF97 region. 0:automatic";
-
-    protected
-      Integer phase;
-      Integer region;
-      Integer error;
-      Units.SI.Temperature T;
-      Units.SI.Density d;
-      Boolean supercritical;
-
-    public
-      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-        annotation (Placement(transformation(extent={{-90,15},{-43.3333,61.6667}},
-              rotation=0)));
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                         g annotation (Placement(transformation(extent={{-90,
-                -85},{-43.3333,-38.3333}}, rotation=0)));
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
-                             f
-        annotation (Placement(transformation(extent={{-23.3333,-85},{23.3333,
-                -38.3333}}, rotation=0)));
-    algorithm
-
-      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-      phase := if ((h < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p))
-                   or (h > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p))
-                   or supercritical) then 1 else 2;
-      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ph(p, h, phase, mode);
-      if (region == 1) then
-        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(p, h);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ph(g);
-        pro.x := if (supercritical) then -1 else 0;
-      elseif (region == 2) then
-        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(p, h);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ph(g);
-        pro.x := if (supercritical) then -1 else 1;
-      elseif (region == 3) then
-        (d,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofph3(p=p, h=h, delp=1.0e-7, delh=1.0e-6);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(d, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToProps_ph(f);
-
-        if (h >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.HCRIT) then
-          pro.x := if (supercritical) then -1 else 1;
-        else
-          pro.x := if (supercritical) then -1 else 0;
-        end if;
-      elseif (region == 4) then
-        pro := ThermoSysPro.Properties.WaterSteam.Common.water_ph_r4(p, h);
-      elseif (region == 5) then
-        (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofph5(p=p, h=h, reldh=1.0e-7);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ph(g);
-        pro.x := if (supercritical) then -1 else 1;
-      else
-        assert(false, "Water_Ph: Incorrect region number (" + String(region) + ")");
-      end if;
-      annotation (
-        derivative(noDerivative=mode) = Water_Ph_der,
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Window(
-          x=0.06,
-          y=0.1,
-          width=0.75,
-          height=0.73),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end Water_Ph;
-
-    function Water_Ps
-      input Units.SI.AbsolutePressure p "Pressure";
-      input Units.SI.SpecificEntropy s "Specific entropy";
-      input Integer mode = 0 "IF97 region. 0:automatic";
-
-    protected
-      Integer phase;
-      Integer region;
-      Integer error;
-      Units.SI.Temperature T;
-      Units.SI.Density d;
-      Boolean supercritical;
-
-    public
-      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro;
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                         g annotation (Placement(transformation(extent={{-90,
-                -85},{-43.3333,-38.3333}}, rotation=0)));
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
-                             f
-        annotation (Placement(transformation(extent={{-23.3333,-85},{23.3333,
-                -38.3333}}, rotation=0)));
-    algorithm
-
-      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-      phase := if ((s < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(p))
-                   or (s > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(p))
-                   or supercritical) then 1 else 2;
-
-      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(p, s, phase, mode);
-      if (region == 1) then
-        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(p, s);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ps(g);
-        pro.x := if (supercritical) then -1 else 0;
-      elseif (region == 2) then
-        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(p, s);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ps(g);
-        pro.x := if (supercritical) then -1 else 1;
-      elseif (region == 3) then
-        (d,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(p=p, s=s, delp=1.0e-7, dels=1.0e-6);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(d, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToProps_ps(f);
-        pro.x := if (supercritical) then -1 else 0;
-      elseif (region == 4) then
-        pro := ThermoSysPro.Properties.WaterSteam.Common.water_ps_r4(p, s);
-      elseif (region == 5) then
-        (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(p=p, s=s, relds=1.0e-7);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ps(g);
-        pro.x := if (supercritical) then -1 else 1;
-      else
-        assert(false, "Water_Ps: Incorrect region number");
-      end if;
-      annotation (
-        derivative(noDerivative=mode) = Water_Ps_der,
-        Window(
-          x=0.22,
-          y=0.2,
-          width=0.6,
-          height=0.6),
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end Water_Ps;
-
-    function Water_sat_P
-      input Units.SI.AbsolutePressure P "Pressure";
-
-    protected
-      Units.SI.Temperature T;
-
-    public
-      output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat
-                                  lsat annotation (Placement(transformation(
-              extent={{-85,15},{-15,85}}, rotation=0)));
-      output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat
-                                  vsat annotation (Placement(transformation(
-              extent={{15,15},{85,85}}, rotation=0)));
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                         gl annotation (Placement(transformation(extent={{-85,
-                -85},{-15,-15}}, rotation=0)));
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                         gv annotation (Placement(transformation(extent={{15,
-                -85},{85,-15}}, rotation=0)));
-    algorithm
-
-      /*  if (not (P < SteamIF97.data.plimit4a)) then
-    assert(false, "Eau_sat_P: Pression > 16.5292e6 Pa");
-  end if;*/
-
-      T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(P);
-
-      gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(P, T);
-      lsat := ThermoSysPro.Properties.WaterSteam.Common.gibbsPropsSat(
-                                   P, T, gl);
-
-      gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(P, T);
-      vsat := ThermoSysPro.Properties.WaterSteam.Common.gibbsPropsSat(
-                                   P, T, gv);
-      //
-      annotation (
-        derivative = Water_sat_P_der,
-        Window(
-          x=0.34,
-          y=0.21,
-          width=0.6,
-          height=0.6),
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end Water_sat_P;
-
-    function DynamicViscosity_rhoT
-      input Units.SI.Density rho "Density";
-      input Units.SI.Temperature T "Temperature";
-
-      output Units.SI.DynamicViscosity mu "Dynamic viscosity";
-    algorithm
-
-      mu := ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.visc_dT(rho, T);
-      annotation (
-        smoothOrder=2,
-        Window(
-          x=0.34,
-          y=0.34,
-          width=0.6,
-          height=0.6),
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end DynamicViscosity_rhoT;
-
-    function ThermalConductivity_rhoT
-      input Units.SI.Density rho "Density";
-      input Units.SI.Temperature T "Temperature";
-      input Units.SI.AbsolutePressure P "Pressure";
-      input Integer region = 0 "IF97 region. 0:automatic";
-
-      output Units.SI.ThermalConductivity lambda "Thermal conductivity";
-    algorithm
-
-      lambda := ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.cond_industrial_dT(rho, T);
-      annotation (
-        smoothOrder=2,
-        Window(
-          x=0.34,
-          y=0.34,
-          width=0.6,
-          height=0.6),
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end ThermalConductivity_rhoT;
-
-    function SurfaceTension_T
-      input Units.SI.Temperature T "Temperature";
-
-      output Units.SI.SurfaceTension sigma "Surface tension";
-    algorithm
-
-      sigma := ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.surfaceTension(T);
-      annotation (
-        smoothOrder=2,
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Window(
-          x=0.33,
-          y=0.34,
-          width=0.6,
-          height=0.6),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end SurfaceTension_T;
-
-    function SpecificEnthalpy_PT
-      input Units.SI.AbsolutePressure p "Pressure";
-      input Units.SI.Temperature T "Temperature";
-      input Integer mode = 0 "IF97 region. 0:automatic";
-
-      output Units.SI.SpecificEnthalpy H "Specific enthalpy";
-
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT
-                                 pro;
-    algorithm
-
-      pro := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_PT(p, T, mode);
-      H := pro.h;
-      annotation (
-        derivative(noDerivative=mode) = SpecificEnthalpy_PT_der,
-        Icon(graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end SpecificEnthalpy_PT;
-
-    function Pressure_sat_hl
-      input Units.SI.SpecificEnthalpy hl
-        "Liquid specific enthalpy on the saturation line";
-
-      output Units.SI.AbsolutePressure P
-        "Liquid pressure on the saturation line";
-    protected
-      Units.SI.AbsolutePressure tmp[1];
-    algorithm
-
-      assert(hl > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple),
-        "Pressure_sat_hl called with too low specific enthalpy (below triple point)");
-      assert(hl < ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.HCRIT,
-        "Pressure_sat_hl called with too high specific enthalpy (above critical point)");
-
-      tmp := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.safeEvaluate(IF97_spline, hl/ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.HCRIT);
-      P := Modelica.Math.exp(tmp[1]);
-      annotation (
-        derivative = Pressure_sat_hl_der,
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Version 1.2</b> </p>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro_AJ Version 2.0</b></p>
-</HTML>
-"));
-    end Pressure_sat_hl;
-
-    function Water_PT
-      input Units.SI.AbsolutePressure p "Pressure";
-      input Units.SI.Temperature T "Temperature";
-      input Integer mode=0 "IF97 region. 0:automatic";
-      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro;
-
-    protected
-      Integer region;
-      Boolean supercritical;
-      Integer error;
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f;
-      Units.SI.Density d;
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g;
-    algorithm
-
-      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(p, T, mode);
-      if (region == 1) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_pT(g);
-        pro.x := if (supercritical) then -1 else 0;
-      elseif (region == 2) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_pT(g);
-        pro.x := if (supercritical) then -1 else 1;
-      elseif (region == 3) then
-        (d,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(p=p, T=T, delp=ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData.DELP);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(d, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToProps_pT(f);
-        pro.x := if (supercritical) then -1 else 0;
-      elseif (region == 5) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
-        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_pT(g);
-        pro.x := if (supercritical) then -1 else 1;
-      else
-        assert(false, "Water_PT: Incorrect region number");
-      end if;
-
-      annotation (
-        derivative(noDerivative=mode) = Water_PT_der,
-        Icon(graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end Water_PT;
-
-      function Pressure_sat_hl_der
-      input Units.SI.SpecificEnthalpy hl
-        "Liquid specific enthalpy on the saturation line";
-        input Real hl_der;
-
-        output Real P_der;
-    protected
-      Units.SI.AbsolutePressure P[1] "Liquid pressure on the saturation line";
-        Real tmp[1];
-      algorithm
-
-        assert(hl > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple),
-        "Pressure_sat_hl_der called with too low specific enthalpy (below triple point)");
-        assert(hl < ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.HCRIT,
-        "Pressure_sat_hl_der called with too high specific enthalpy (above critical point)");
-
-        (P,tmp) := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.safeEvaluateDer(IF97_spline, hl/ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.HCRIT);
-        P_der := Modelica.Math.exp(P[1])*tmp[1]*hl_der;
-      annotation (
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Version 1.2</b> </p>
-<p>Needs to be redone. Iterative functions don&apos;t work for Analytic Jacobian</p>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro_AJ Version 2.0</b></p>
-</HTML>
-"));
-      end Pressure_sat_hl_der;
-
-    function Water_Ph_der "Derivative function of Water_Ph"
-      input Units.SI.AbsolutePressure p "Pressure";
-      input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-      input Integer mode = 0 "Région IF97 - 0:calcul automatique";
-      //input CombiPlant.ThermoFluidPro.Media.Common.IF97TwoPhaseAnalytic aux "auxiliary record";
-
-      input Real p_der "derivative of Pressure";
-      input Real h_der "derivative of Specific enthalpy";
-
-      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph der_pro
-        "Derivative";
-
-    protected
-      Integer phase;
-      Integer region;
-      Boolean supercritical;
-
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      Units.SI.Temperature T;
-      Units.SI.SpecificHeatCapacity R "gas constant";
-      Units.SI.Density rho "density";
-      Real vt "derivative of specific volume w.r.t. temperature";
-      Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-      Real vp "derivative of specific volume w.r.t. pressure";
-      ThermoSysPro.Units.xSI.DerPressureByDensity pd
-        "derivative of pressure wrt density";
-      ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-        "derivative of pressure wrt temperature";
-      Real dpT "dp/dT derivative of saturation curve";
-      Real dxv "der of x wrt v";
-      Real dvTl "der of v wrt T at boiling";
-      Real dvTv "der of v wrt T at dew";
-      Real dxT "der of x wrt T";
-      Real duTl "der of u wrt T at boiling";
-      Real duTv "der of u wrt T at dew";
-      Real vtt "2nd derivative of specific volume w.r.t. temperature";
-      Real cpt "derivative of cp w.r.t. temperature";
-      Real cvt "derivative of cv w.r.t. temperature";
-      Real dpTT "2nd der of p wrt T";
-      Real dxdd "2nd der of x wrt d";
-      Real dxTd "2nd der of x wrt d and T";
-      Real dvTTl "2nd der of v wrt T at boiling";
-      Real dvTTv "2nd der of v wrt T at dew";
-      Real dxTT " 2nd der of x wrt T";
-      Real duTTl "2nd der of u wrt T at boiling";
-      Real duTTv "2nd der of u wrt T at dew";
-
-      Integer error "error flag for inverse iterations";
-      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
-      Units.SI.Density d_liq "liquid density";
-      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
-      Units.SI.Density d_vap "vapour density";
-      Real x "dryness fraction";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd vap
-        "phase boundary property record";
-
-      Units.SI.Temperature t1
-        "temperature at phase boundary, using inverse from region 1";
-      Units.SI.Temperature t2
-        "temperature at phase boundary, using inverse from region 2";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Units.SI.SpecificVolume v;
-
-      Real ptt "2nd derivative of pressure wrt temperature";
-      Real pdd "2nd derivative of pressure wrt density";
-      Real ptd "mixed derivative of pressure w.r.t. density and temperature";
-      Real vpp "2nd derivative of specific volume w.r.t. pressure";
-      Real vtp
-        "mixed derivative of specific volume w.r.t. pressure and temperature";
-
-      Real vp3 "vp^3";
-      Real ivp3 "1/vp3";
-
-      Real detPH "Determinant";
-      Real dht;
-      Real dhd;
-      Real ddhp;
-      Real ddph;
-      Real dtph;
-      Real dthp;
-      Real detPH_d;
-      Real detPH_t;
-      Real dhtt;
-      Real dhtd;
-      Real ddph_t;
-      Real ddph_d;
-      Real ddhp_t;
-      Real ddhp_d;
-
-      Real duhp_t;
-      Real duph_t;
-      Real duph_d;
-
-      Real dupp;
-      Real duph;
-      Real duhh;
-
-      Real dcp_d;
-
-      Real rho2 "square of density";
-      Real rho3 "cube of density";
-      Real cp3 "cube of specific heat capacity";
-      Real cpcpp;
-      Real quotient;
-      Real vt2;
-      Real pt2;
-      Real pt3;
-
-    algorithm
-      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-      phase := if ((h < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p)) or
-                   (h > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p)) or
-                   supercritical) then 1 else 2;
-      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ph(p, h, phase, mode);
-
-      R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      if (region == 1) then
-        // get variables
-        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(p,h);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, T);
-        rho := p/(R*T*g.pi*g.gpi);
-        rho2 := rho*rho;
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        vt2 := vt*vt;
-        cp := -R*g.tau*g.tau*g.gtautau;
-        cp3 := cp*cp*cp;
-        cpcpp := cp*cp*p;
-        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        v := 1/rho;
-        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
-        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
-        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-        vp3 := vp*vp*vp;
-        ivp3 := 1/vp3;
-        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt2*vpp)*ivp3;
-        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd "= pvv/d^4";
-        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
-        cvt := (vp3*cpt + vp*vp*vt2 + 3.0*vp*vp*T*vt*vtt
-          - 3.0*vtp*vp*T*vt2 + T*vt2*vt*vpp)*ivp3;
-
-        // not in cache
-        detPH := cp*pd;
-        dht := cv + pt/rho;
-        dhd := (pd - T*pt/rho)/rho;
-        ddph := dht/ detPH;
-        ddhp := -pt/detPH;
-        dtph := -dhd/detPH;
-        dthp := pd/detPH;
-        detPH_d := cv*pdd + (2.0*pt *(ptd - pt/rho) - ptt*pd)*T/(rho2);
-        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/rho2;
-        dhtt := cvt + ptt*v;
-        dhtd := (ptd - (T * ptt + pt)*v) *v;
-        ddhp_t := ddhp * (ptt / pt - detPH_t / detPH);
-        ddhp_d := ddhp * (ptd / pt - detPH_d / detPH);
-        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
-        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
-        dupp :=-(2.0*cp3*vp + cp3*p*vpp - 2.0*cp*cp*vt*v -
-              2.0*cpcpp*vtp*v - cpcpp*vt*vp + 2.0*cp*cp*T*vt2 +
-              3.0*cpcpp*vt*T*vtp - 4.0*T*vtt*cp*p*vt*v +
-              3.0*T*T*vtt*cp*p*vt2 + cp*p*vtt/rho2 - cpt*p*vt/rho2 +
-              2.0*cpt*p*vt2*v*T - cpt*p*vt2*T^2) / cp3;
-        duph := -(vtp*cpcpp + cp*cp*vt - cp*p*vtt*v + 2.0*cp*p*vt*T*vtt +
-              cpt*p*vt*v - cpt*p*vt2*T)/cp3;
-        duhh := -p*(cp*vtt - cpt*vt) / cp3;
-
-        // calculate derivatives
-        der_pro.x := 0.0;
-        der_pro.duhp := duph*p_der + duhh*h_der;
-        der_pro.duph :=  dupp*p_der + duph* h_der;
-        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
-        der_pro.ddhp := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
-        der_pro.cp := (-(T * vtt * cp + cpt/rho - cpt * T * vt) / cp)*p_der +
-          cpt/cp*h_der;
-        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
-        der_pro.u := (-(p*vp*cp + cp*v - p*vt*v + p*vt2 *T)/cp)*p_der + ((cp - p*vt)/cp)*h_der;
-        der_pro.T := ((-v + T*vt)/cp)*p_der + (1/cp)*h_der;
-        der_pro.d := (-rho2*(vp*cp - vt/rho + T*vt2)/cp)*p_der + (-rho2*vt/(cp))*h_der;
-
-      elseif (region == 2) then
-        // get variables
-        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(p, h);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, T);
-        rho := p/(R*T*g.pi*g.gpi);
-        rho2 := rho*rho;
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        vt2 := vt*vt;
-        cp := -R*g.tau*g.tau*g.gtautau;
-        cp3 := cp*cp*cp;
-        cpcpp := cp*cp*p;
-        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        v := 1/rho;
-        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
-        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
-        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-        vp3 := vp*vp*vp;
-        ivp3 := 1/vp3;
-        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt2*vpp)*ivp3;
-        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd "= pvv/d^4";
-        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
-        cvt := (vp3*cpt + vp*vp*vt2 + 3.0*vp*vp*T*vt*vtt
-          - 3.0*vtp*vp*T*vt2 + T*vt2*vt*vpp)*ivp3;
-
-        // not in cache
-        detPH := cp*pd;
-        dht := cv + pt/rho;
-        dhd := (pd - T*pt/rho)/rho;
-        ddph := dht/ detPH;
-        ddhp := -pt/detPH;
-        dtph := -dhd/detPH;
-        dthp := pd/detPH;
-        detPH_d := cv*pdd + (2.0*pt *(ptd - pt/rho) - ptt*pd)*T/(rho2);
-        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/rho2;
-        dhtt := cvt + ptt*v;
-        dhtd := (ptd - (T * ptt + pt)*v) *v;
-        ddhp_t := ddhp * (ptt / pt - detPH_t / detPH);
-        ddhp_d := ddhp * (ptd / pt - detPH_d / detPH);
-        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
-        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
-        dupp :=-(2.0*cp3*vp + cp3*p*vpp - 2.0*cp*cp*vt*v -
-              2.0*cpcpp*vtp*v - cpcpp*vt*vp + 2.0*cp*cp*T*vt2 +
-              3.0*cpcpp*vt*T*vtp - 4.0*T*vtt*cp*p*vt*v +
-              3.0*T*T*vtt*cp*p*vt2 + cp*p*vtt/rho2 - cpt*p*vt/rho2 +
-              2.0*cpt*p*vt2*v*T - cpt*p*vt2*T^2) / cp3;
-        duph := -(vtp*cpcpp + cp*cp*vt - cp*p*vtt*v + 2.0*cp*p*vt*T*vtt +
-              cpt*p*vt*v - cpt*p*vt2*T)/cp3;
-        duhh := -p*(cp*vtt - cpt*vt) / cp3;
-
-        // calculate derivatives
-        der_pro.x := 0.0;
-        der_pro.duhp := duph*p_der + duhh*h_der;
-        der_pro.duph :=  dupp*p_der + duph* h_der;
-        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
-        der_pro.ddhp := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
-        der_pro.cp := (-(T * vtt * cp + cpt/rho - cpt * T * vt) / cp)*p_der + cpt/cp*h_der;
-        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
-        der_pro.u := (-(p*vp*cp + cp*v - p*vt*v + p*vt2 *T)/cp)*p_der + ((cp - p*vt)/cp)*h_der;
-        der_pro.T := ((-v + T*vt)/cp)*p_der + (1/cp)*h_der;
-        der_pro.d := (-rho2*(vp*cp - vt/rho + T*vt2)/cp)*p_der + (-rho2*vt/(cp))*h_der;
-
-      elseif (region == 3) then
-        // get variables
-        (rho,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofph3(p,h,delp=1.0e-7,delh=1.0e-6);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(rho, T);
-
-        rho2 := rho*rho;
-        rho3 := rho*rho2;
-        v := 1/rho;
-        pd := R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        pt := R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        pt2 := pt*pt;
-        pt3 := pt2*pt;
-        cv := abs(R*(-f.tau*f.tau*f.ftautau))
-          "can be close to neg. infinity near critical point";
-        cp := (rho2*pd*cv + T*pt2)/(rho2*pd);
-        pdd := R*T*f.delta/rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
-             f.delta*f.delta*f.fdeltadeltadelta);
-        ptt := R*rho*f.delta*f.tau*f.tau/T*f.fdeltatautau;
-        ptd := R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
-             -f.delta*f.tau*f.fdeltadeltatau);
-        cvt := R*f.tau*f.tau/T*(2.0*f.ftautau + f.tau*f.ftautautau);
-        cpt := (cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/(rho2) - cp*ptd)/pd;
-
-        // not in cache
-        detPH := cp*pd;
-        dht := cv + pt/rho;
-        dhd := (pd - T*pt/rho)/rho;
-        ddph := dht/ detPH;
-        ddhp := -pt/detPH;
-        dtph := -dhd/detPH;
-        dthp := pd/detPH;
-        detPH_d := cv*pdd + (2.0*pt *(ptd - pt/rho) - ptt*pd) *T/(rho2);
-        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/rho2;
-        dhtt := cvt + ptt*v;
-        dhtd := (ptd - (T * ptt + pt)*v) *v;
-        ddhp_t := ddhp * (ptt / pt - detPH_t / detPH);
-        ddhp_d := ddhp * (ptd / pt - detPH_d / detPH);
-        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
-        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
-
-        dcp_d :=(detPH_d - cp*pdd)/pd;
-
-        quotient := 1/(cv*rho2*pd + T*pt2)^3;
-        dupp := -(-4.0*ptt*p*cv*rho2*pd*T*pt + 2.0*p*cvt*rho2*T*pt2*pd -
-              2.0*ptt*p*T*pt2*rho*pd + 3.0*p*cv^2*rho3*ptd*T*pt +
-              3.0*p*cv*rho*T^2*pt2*ptt - 2.0*pt*p*cv*rho3*ptd*pd +
-              4.0*pt2*p*cv*rho2*ptd*T - 2.0*T^2*pt2*pt3 - 4.0*pt2*cv^2*rho3*pd*T -
-              4.0*pt3*cv*rho2*T*pd - p*cvt*rho*T^2*pt3 + ptt*p*cv*rho3*pd^2 -
-              2.0*p*cv^2*rho2*rho2*ptd*pd + 2.0*p*cv*rho2*pt2*pd +
-              2.0*p*cv*rho*pt3*T - pt*p*cvt*rho3*pd^2 + ptd*p*rho*T*pt3 +
-              5.0*pt*p*cv^2*rho3*pd + 2*pt*p*cv^2*rho2*rho2*pdd + pt2*p*cv*rho3*pdd +
-              2.0*pt2*pt2*p*T - 2.0*cv^3*rho3*rho2*pd^2 - 2.0*pt*cv^2*rho2*rho2*pd^2-
-              2.0*pt2*pt2*cv*rho*T^2 + 2.0*ptt*p*T^2*pt3 - pt3*p*rho*pd +
-              2.0*p*cv^3*rho2*rho2*pd + p*cv^3*rho2*rho3*pdd)*quotient/rho;
-        duph := (-2.0*ptt*p*cv*rho2*pd*T*pt + p*cvt*rho2*T*pt2*pd -
-              2.0*ptt*p*T*pt2*rho*pd - 2.0*pt*p*cv*rho3*ptd*pd +
-              2.0*pt2*p*cv*rho2*ptd*T - T^2*pt3*pt2 - 2*pt3*cv*rho2*T*pd +
-              ptt*p*cv*rho3*pd^2 - p*cv^2*rho2*rho2*ptd*pd + 2.0*p*cv*rho2*pt2*pd -
-              pt*p*cvt*rho3*pd^2 + ptd*p*rho*T*pt3 + 2.0*pt*p*cv^2*rho3*pd +
-              pt*p*cv^2*rho2*rho2*pdd + pt2*p*cv*rho3*pdd + pt2*pt2*p*T -
-              pt*cv^2*rho2*rho2*pd^2 + ptt*p*T^2*pt3 - pt3*p*rho*pd)*quotient;
-        duhh := p*(-pt3*T*ptd + 2.0*ptd*cv*rho2*pd*pt - 2.0*pt2*cv*rho*pd +
-              pt*cvt*rho2*pd^2 - pt2*cv*rho2*pdd + 2.0*pt2*T*ptt*pd -
-              ptt*cv*rho2*pd^2 + pt3*pd)*rho2 *quotient;
-
-        // calculate derivatives
-        der_pro.x := 0.0;
-        der_pro.duhp := duph*p_der + duhh*h_der;
-        der_pro.duph := dupp*p_der + duph* h_der;
-        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
-        der_pro.ddhp := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
-        der_pro.cp := (ddph * dcp_d + dtph * cpt)*p_der +
-           (ddhp * dcp_d + dthp * cpt)*h_der;
-        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
-        der_pro.u := ((cv*rho2*pd - pt*p + T*pt2)/(cv*rho2*pd + T*pt2))*h_der +
-           ((cv*rho2*pd - p*cv*rho - pt*p + T*pt2)/(rho*(cv*rho2*pd + T*pt2)))*p_der;
-        der_pro.T := ((-rho*pd + T*pt)/(rho2*pd*cv+ T*pt*pt))*p_der +
-           ((rho2*pd)/(rho2*pd*cv + T*pt2))*h_der;
-        der_pro.d := ((rho*(cv*rho + pt))/(rho2*pd*cv + T*pt2))*p_der +
-          (-rho2*pt/(rho2*pd*cv + T*pt2))*h_der;
-
-      elseif (region == 4) then
-        // get variables
-        h_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p);
-        h_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p);
-        x := if (h_vap <> h_liq) then (h - h_liq)/(h_vap - h_liq) else 1.0;
-
-        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
-          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(p, h_liq);
-          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(p, h_vap);
-          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, t1);
-          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, t2);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(gl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(gv);
-          T := t1 + x*(t2 - t1);
-        else
-          T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(p);
-          // how to avoid ?
-
-          d_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_T(T);
-          d_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_T(T);
-          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(d_liq, T);
-          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(d_vap, T);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(fl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(fv);
-          //  dpT := BaseIF97.Basic.dptofT(T);
-        end if;
-
-        rho := liq.d*vap.d/(vap.d + x*(liq.d - vap.d));
-        rho2 := rho*rho;
-        rho3 := rho*rho2;
-        v := 1/rho;
-        dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d-vap.d) else 0.0;
-        dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*dxv else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(T);
-
-        dvTl := (liq.pt -dpT)/(liq.pd*liq.d*liq.d);
-        dvTv := (vap.pt -dpT)/(vap.pd*vap.d*vap.d);
-        dxT := -dxv*(dvTl + x*(dvTv-dvTl));
-        duTl := liq.cv + (T*liq.pt-p)*dvTl;
-        duTv := vap.cv + (T*vap.pt-p)*dvTv;
-        cv := duTl + x*(duTv-duTl) + dxT * (vap.u-liq.u);
-        dpTT := dxv*(vap.cv/T-liq.cv/T + dvTv*(vap.pt-dpT)-dvTl*(liq.pt-dpT));
-        dxdd := 2.0*dxv/(rho3);
-        dxTd := dxv*dxv*(dvTv-dvTl)/(rho2);
-        dvTTl := ((liq.ptt-dpTT)/(liq.d*liq.d) + dvTl*(liq.d*dvTl*(2.0*liq.pd + liq.d*liq.pdd)
-             -2.0*liq.ptd))/liq.pd;
-        dvTTv := ((vap.ptt-dpTT)/(vap.d*vap.d) + dvTv*(vap.d*dvTv*(2.0*vap.pd + vap.d*vap.pdd)
-             -2.0*vap.ptd))/vap.pd;
-        dxTT := -dxv*(2.0*dxT*(dvTv-dvTl) + dvTTl + x*(dvTTv-dvTTl));
-        duTTl := liq.cvt +(liq.pt-dpT + T*(2.0*liq.ptt -liq.d*liq.d*liq.ptd *dvTl))*dvTl + (T*
-          liq.pt - p)*dvTTl;
-        duTTv := vap.cvt +(vap.pt-dpT + T*(2.0*vap.ptt -vap.d*vap.d*vap.ptd *dvTv))*dvTv + (T*
-          vap.pt - p)*dvTTv;
-        cvt := duTTl + x *(duTTv -duTTl) + 2.0*dxT*(duTv-duTl) + dxTT *(vap.u-liq.u);
-        ptt := dpTT;
-
-        // not in cache
-        dht := cv + dpT * v;
-        dhd := -T * dpT*v*v;
-        detPH := -dpT * dhd;
-        dtph := 1.0 / dpT;
-        ddph := dht / detPH;
-        ddhp := -dpT / detPH;
-        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
-        detPH_t := 2.0 * ptt / dpT + 1.0 / T; /* = detPH_t / detPH */
-        dhtt := cvt + ptt * v;
-        dhtd := -(T * ptt + dpT) *v*v;
-        ddhp_t := ddhp * (ptt / dpT - detPH_t);
-        ddhp_d := ddhp * (-detPH_d);
-        ddph_t := ddph * (dhtt / dht - detPH_t);
-        ddph_d := ddph * (dhtd / dht - detPH_d);
-        duhp_t := (ddhp * dpT + p * ddhp_t) / (rho2);
-        duph_t :=(ddph*dpT + p*ddph_t)/(rho2);
-        duph_d :=((-2.0*ddph/rho + ddph_d)*p + 1.0)/(rho2);
-
-        // calculate derivatives
-        der_pro.x := if (h_vap <> h_liq) then h_der/(h_vap - h_liq) else 0.0;
-        der_pro.duhp := (dtph * duhp_t)*p_der;
-        der_pro.duph :=  (ddph * duph_d + dtph * duph_t)*p_der + (dtph * duhp_t)* h_der;
-        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der + (ddhp * ddph_d)*h_der;
-        der_pro.ddhp := (ddhp * ddhp_d)*h_der + (ddhp * ddph_d)*p_der;
-        der_pro.cp :=0.0;
-        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
-        der_pro.u := ((ddph*p/rho - 1.0)/rho)*p_der + (ddhp*p/(rho2) + 1.0)*h_der;
-        der_pro.T := 1/dpT*p_der;
-        der_pro.d := (rho*(rho*cv/dpT + 1.0)/(dpT*T))*p_der
-           + (-rho2/(dpT*T))*h_der;
-
-      elseif (region == 5) then
-        // get variables
-        (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofph5(p,h,reldh=1.0e-7);
-        assert(error == 0, "error in inverse iteration of steam tables");
-
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(p, T);
-        rho := p/(R*T*g.pi*g.gpi);
-        rho2 := rho*rho;
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        vt2 := vt*vt;
-        cp := -R*g.tau*g.tau*g.gtautau;
-        cp3 := cp*cp*cp;
-        cpcpp := cp*cp*p;
-        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        v := 1/rho;
-        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
-        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
-        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-        vp3 := vp*vp*vp;
-        ivp3 := 1/vp3;
-        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt2*vpp)*ivp3;
-        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd "= pvv/d^4";
-        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
-        cvt := (vp3*cpt + vp*vp*vt2 + 3.0*vp*vp*T*vt*vtt
-          - 3.0*vtp*vp*T*vt2 + T*vt2*vt*vpp)*ivp3;
-
-        // not in cache
-        detPH := cp*pd;
-        dht := cv + pt/rho;
-        dhd := (pd - T*pt/rho)/rho;
-        ddph := dht/ detPH;
-        ddhp := -pt/detPH;
-        dtph := -dhd/detPH;
-        dthp := pd/detPH;
-        detPH_d := cv*pdd + (2.0*pt *(ptd - pt/rho) - ptt*pd)*T/(rho2);
-        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/rho2;
-        dhtt := cvt + ptt*v;
-        dhtd := (ptd - (T * ptt + pt)*v) *v;
-        ddhp_t := ddhp * (ptt / pt - detPH_t / detPH);
-        ddhp_d := ddhp * (ptd / pt - detPH_d / detPH);
-        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
-        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
-        dupp :=-(2.0*cp3*vp + cp3*p*vpp - 2.0*cp*cp*vt*v -
-              2.0*cpcpp*vtp*v - cpcpp*vt*vp + 2.0*cp*cp*T*vt2 +
-              3.0*cpcpp*vt*T*vtp - 4.0*T*vtt*cp*p*vt*v +
-              3.0*T*T*vtt*cp*p*vt2 + cp*p*vtt/rho2 - cpt*p*vt/rho2 +
-              2.0*cpt*p*vt2*v*T - cpt*p*vt2*T^2) / cp3;
-        duph := -(vtp*cpcpp + cp*cp*vt - cp*p*vtt*v + 2.0*cp*p*vt*T*vtt +
-              cpt*p*vt*v - cpt*p*vt2*T)/cp3;
-        duhh := -p*(cp*vtt - cpt*vt) / cp3;
-
-        // calculate derivatives
-        der_pro.x := 0.0;
-        der_pro.duhp := duph*p_der + duhh*h_der;
-        der_pro.duph :=  dupp*p_der + duph* h_der;
-        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
-        der_pro.ddhp := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
-           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
-        der_pro.cp := (-(T * vtt * cp + cpt/rho - cpt * T * vt) / cp)*p_der + cpt/cp*h_der;
-        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
-        der_pro.u := (-(p*vp*cp + cp*v - p*vt*v + p*vt2 *T)/cp)*p_der + ((cp - p*vt)/cp)*h_der;
-        der_pro.T := ((-v + T*vt)/cp)*p_der + (1/cp)*h_der;
-        der_pro.d := (-rho2*(vp*cp - vt/rho + T*vt2)/cp)*p_der + (-rho2*vt/(cp))*h_der;
-
-      else
-        assert(false, "Water_Ph_der: Incorrect region number");
-      end if;
-
-      annotation (
-        Window(
-          x=0.22,
-          y=0.2,
-          width=0.6,
-          height=0.6),
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end Water_Ph_der;
-
-    function Water_Ps_der
-      input Units.SI.AbsolutePressure p "Pression";
-      input Units.SI.SpecificEntropy s "Entropie spécifique";
-      input Integer mode = 0 "Région IF97 - 0:calcul automatique";
-
-      input Real p_der "derivative of Pressure";
-      input Real s_der "derivative of Specific enthropy";
-
-    protected
-      Boolean supercritical;
-
-      // variables taken from auxiliary record
-      Integer phase "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
-      Integer region(min=1, max=5) "IF 97 region";
-      Units.SI.Temperature T "temperature";
-      Units.SI.SpecificEnthalpy h "specific enthalpy";
-      Units.SI.SpecificHeatCapacity R "gas constant";
-      Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-      Real cpt "derivative of cp w.r.t. temperature";
-      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-      Real cvt "derivative of cv w.r.t. temperature";
-      Units.SI.Density rho "density";
-      ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-        "derivative of pressure wrt temperature";
-      ThermoSysPro.Units.xSI.DerPressureByDensity pd
-        "derivative of pressure wrt density";
-      Real ptt "2nd derivative of pressure wrt temperature";
-      Real pdd "2nd derivative of pressure wrt density";
-      Real ptd "mixed derivative of pressure w.r.t. density and temperature";
-      Real vt "derivative of specific volume w.r.t. temperature";
-      Real vp "derivative of specific volume w.r.t. pressure";
-      Real vtt "2nd derivative of specific volume w.r.t. temperature";
-      Real vpp "2nd derivative of specific volume w.r.t. pressure";
-      Real vtp
-        "mixed derivative of specific volume w.r.t. pressure and temperature";
-      Real x "dryness fraction";
-      Real dpT "dp/dT derivative of saturation curve";
-      Units.SI.SpecificEntropy auxs "specific entropy";
-
-      // variables taken from waterBaseProp_ps
-      Integer error "error flag for inverse iterations";
-      Units.SI.SpecificEntropy s_liq "liquid specific entropy";
-      Units.SI.Density d_liq "liquid density";
-      Units.SI.SpecificEntropy s_vap "vapour specific entropy";
-      Units.SI.Density d_vap "vapour density";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd liq
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd vap
-        "phase boundary property record";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd gl
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd gv
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd fl
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd fv
-        "dimensionless Helmholtz function and dervatives wrt delta and tau";
-      Units.SI.Temperature t1
-        "temperature at phase boundary, using inverse from region 1";
-      Units.SI.Temperature t2
-        "temperature at phase boundary, using inverse from region 2";
-
-      // variables needed
-      Real detPH;
-      Real dtsp;
-      Real dtps;
-      Real ddsp;
-      Real ddps;
-      Real dsd;
-
-      Real detPH_t;
-      Real detPH_d;
-
-      Real dcp_t;
-      Real dcp_d;
-
-      Real dcps;
-      Real dcpp;
-
-      Real dxv;
-      Real dxd;
-      Real dvTl;
-      Real dvTv;
-      Real dxT;
-      Real duTl;
-      Real duTv;
-      Real dpTT;
-      Real dxdd;
-      Real dxTd;
-      Real dvTTl;
-      Real dvTTv;
-      Real dxTT;
-      Real duTTl;
-      Real duTTv;
-
-      Real rho2;
-      Real cp3;
-      Real invcp3;
-      Real cpinv;
-      Real vt2;
-      Real pt2;
-      Real pt3;
-      Real quotient;
-
-    public
-      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro_der;
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                               g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau"                    annotation (Placement(
-            transformation(extent={{-90,-85},{-43.3333,-38.3333}}, rotation=0)));
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
-                                                   f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau"
-        annotation (Placement(transformation(extent={{-23.3333,-85},{23.3333,
-                -38.3333}}, rotation=0)));
-    algorithm
-      //assert(false,"Water_ph: Derivatives of cp not yet functional");
-      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-      phase := if ((s < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(p)) or
-                   (s > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(p)) or
-                    supercritical) then 1 else 2;
-
-      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(p, s, phase, mode);
-
-      R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      auxs := s;
-      if (region == 1) then
-        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(p, s);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, T);
-
-        h := R*T*g.tau*g.gtau;
-        rho := p/(R*T*g.pi*g.gpi);
-        rho2 := rho*rho;
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        vt2 := vt*vt;
-        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        cp := -R*g.tau*g.tau*g.gtautau;
-        cpinv := 1/cp;
-        cp3 := cp*cp*cp;
-        invcp3 := 1/cp3;
-        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
-        x := 0.0;
-        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
-        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
-
-        // calculate derivative
-
-        pro_der.cp := cpinv*T*(-(vtt*cp-cpt*vt)*p_der + cpt*s_der);
-        pro_der.x := 0.0;
-        pro_der.ddps := (-rho2*(cp3*vpp + 3.0*cp*cp*T*vt*vtp +
-                3.0*T*T*vtt*cp*vt2 - T*T*vt2*vt*cpt + T*vt2*vt*cp)*invcp3)*p_der +
-                (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp - cpt*T*vt2 +
-                cp*vt2)*invcp3)*s_der;
-        pro_der.ddsp := (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp -
-                cpt*T*vt2 + cp*vt2)*invcp3)*p_der +
-                (-rho2*(-cpt*T*vt + cp*vt + T*vtt*cp)*T*invcp3)*s_der;
-        pro_der.h := p_der/rho + T*s_der;
-        pro_der.u := cpinv*(-p*(vp*cp+T*vt2)*p_der + (cp-p*vt)*T*s_der);
-        pro_der.d := cpinv*(-rho2 *(vp*cp+T*vt2)*p_der + (-rho2*vt*T)*s_der);
-        pro_der.T := (T*cpinv)*(vt*p_der  + s_der);
-
-      elseif (region == 2) then
-        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(p, s);
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, T);
-
-        h := R*T*g.tau*g.gtau;
-        rho := p/(R*T*g.pi*g.gpi);
-        rho2 := rho*rho;
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        vt2 := vt*vt;
-        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        cp := -R*g.tau*g.tau*g.gtautau;
-        cpinv := 1/cp;
-        cp3 := cp*cp*cp;
-        invcp3 := 1/cp3;
-        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
-        x := 0.0;
-        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
-        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
-
-        // calculate derivative
-
-        pro_der.cp := cpinv*T*(-(vtt*cp-cpt*vt)*p_der + cpt*s_der);
-        pro_der.x := 0.0;
-        pro_der.ddps := (-rho2*(cp3*vpp + 3.0*cp*cp*T*vt*vtp +
-                3.0*T*T*vtt*cp*vt2 - T*T*vt2*vt*cpt + T*vt2*vt*cp)*invcp3)*p_der +
-                (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp - cpt*T*vt2 +
-                cp*vt2)*invcp3)*s_der;
-        pro_der.ddsp := (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp -
-                cpt*T*vt2 + cp*vt2)*invcp3)*p_der +
-                (-rho2*(-cpt*T*vt + cp*vt + T*vtt*cp)*T*invcp3)*s_der;
-        pro_der.h := p_der/rho + T*s_der;
-        pro_der.u := cpinv*(-p*(vp*cp+T*vt2)*p_der + (cp-p*vt)*T*s_der);
-        pro_der.d := cpinv*(-rho2 *(vp*cp+T*vt2)*p_der + (-rho2*vt*T)*s_der);
-        pro_der.T := (T*cpinv)*(vt*p_der  + s_der);
-
-      elseif (region == 3) then
-        (rho,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(p,s,delp=1.0e-7,dels=1.0e-6);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(rho, T);
-
-        rho2 := rho*rho;
-        h := R*T*(f.tau*f.ftau + f.delta*f.fdelta);
-        auxs := R*(f.tau*f.ftau - f.f);
-        pd := R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        pt := R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        pt2 := pt*pt;
-        pt3 := pt2*pt;
-        cv := abs(R*(-f.tau*f.tau*f.ftautau))
-          "can be close to neg. infinity near critical point";
-        cp := (rho2*pd*cv + T*pt*pt)/(rho*rho*pd);
-        pdd := R*T*f.delta/rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
-             f.delta*f.delta*f.fdeltadeltadelta);
-        ptt := R*rho*f.delta*f.tau*f.tau/T*f.fdeltatautau;
-        ptd := R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
-             -f.delta*f.tau*f.fdeltadeltatau);
-        cvt := R*f.tau*f.tau/T*(2.0*f.ftautau + f.tau*f.ftautautau);
-        x := 0.0;
-
-        // Not in cache
-        dsd := -pt/rho2;
-        detPH := cp*pd;
-
-        dtsp :=T*pd/detPH;
-        dtps :=-T*dsd/detPH;
-        ddsp :=-T*pt/detPH;
-        ddps :=cv/detPH;
-
-        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/(rho2);
-        detPH_d := cv*pdd + (2.0*pt*(ptd - pt/rho) - ptt*pd)*T/(rho2);
-
-        dcp_t :=(detPH_t - cp*ptd)/pd;
-        dcp_d :=(detPH_d - cp*pdd)/pd;
-
-        dcps := ddsp * dcp_d + dtsp * dcp_t;
-        dcpp := ddps * dcp_d + dtps * dcp_t;
-
-        quotient := 1/(cv*rho2*pd + pt2*T);
-
-        pro_der.cp := dcps*s_der + dcpp*p_der;
-        pro_der.x := 0.0;
-        pro_der.ddps := rho2/(quotient*quotient*quotient)*(-(-cvt*T^2*pt3 + 3.0*cv^2*T*pt*rho2*ptd +
-                3.0*cv*T^2*pt2*ptt + cv*T*pt3 - 2.0*cv^2*rho*pt2*T +
-                cv^3*rho2*rho2*pdd)*p_der +
-                (pt2*T*cvt*rho2*pd + 2*pt2*T*cv*rho2*ptd + pt3*T^2*ptt -
-                pt2*cv*rho2*pd - 2.0*pt*T*ptt*cv*rho2*pd + cv^2*rho2*rho2*pt*pdd -
-                2.0*cv*rho*T*pt3 - cv^2*rho2*rho2*ptd*pd)*T*s_der);
-        pro_der.ddsp := quotient/(rho2*T*pt2)*(-(pt2*T*cvt*rho2*pd + 2.0*pt2*T*cv*rho2*ptd +
-                pt3*T^2*ptt - pt2*cv*rho2*pd - 2.0*pt*T*ptt*cv*rho2*pd +
-                cv^2*rho2*rho2*pt*pdd - 2.0*cv*rho*T*pt3 - cv^2*rho2*rho2*ptd*pd)*p_der -
-                (rho^3*pd^2*T*pt*cvt + 2.0*rho2*rho*pd*T*pt*cv*ptd +
-                2.0*rho*pd*T^2*pt2*ptt - rho2*rho*pd^2*pt*cv - ptt*rho2*rho*T*pd^2*cv -
-                T*pt2*rho2*rho*cv*pdd - T^2*pt3*rho*ptd + 2.0*T^2*pt2*pt2)*s_der);
-        pro_der.h := p_der/rho + T*s_der;
-        pro_der.u := quotient*((cv*rho2*pd-pt*p + pt2*T)*T*s_der + cv*p*p_der);
-        pro_der.d := rho2*quotient*(-T*pt*s_der + cv*p_der);
-        pro_der.T := T*quotient*(pt*p_der + rho2*pd*s_der);
-
-      elseif (region == 4) then
-        s_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(p);
-        s_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(p);
-        x := if (s_vap <> s_liq) then (s - s_liq)/(s_vap - s_liq) else 1.0;
-        if p < ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
-          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(p, s_liq);
-          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(p, s_vap);
-          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, t1);
-          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, t2);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(gl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(gv);
-          T := t1 + x*(t2 - t1);
-        else
-          T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(p);
-          d_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_T(T);
-          d_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_T(T);
-          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(d_liq, T);
-          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(d_vap, T);
-          liq := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(fl);
-          vap := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(fv);
-        end if;
-        dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else
-             ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(T);
-        h := h + x*(vap.h - liq.h);
-        rho := liq.d*vap.d/(vap.d + x*(liq.d - vap.d));
-        rho2 := rho*rho;
-        //cp := liq.cp + x*(vap.cp - liq.cp);
-        //pt := liq.pt + x*(vap.pt - liq.pt);
-        //pd := liq.pd + x*(vap.pd - liq.pd);
-
-        dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d-vap.d) else 0.0;
-        dxd := -dxv/(rho2);
-        dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*dxv else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(T);
-        dvTl := (liq.pt -dpT)/(liq.pd*liq.d*liq.d);
-        dvTv := (vap.pt -dpT)/(vap.pd*vap.d*vap.d);
-        dxT := -dxv*(dvTl + x*(dvTv-dvTl));
-        duTl := liq.cv + (T*liq.pt-p)*dvTl;
-        duTv := vap.cv + (T*vap.pt-p)*dvTv;
-        cv := duTl + x*(duTv-duTl) + dxT * (vap.u-liq.u);
-        dpTT := dxv*(vap.cv/T-liq.cv/T + dvTv*(vap.pt-dpT)-dvTl*(liq.pt-dpT));
-        dxdd := 2.0*dxv/(rho2*rho);
-        dxTd := dxv*dxv*(dvTv-dvTl)/(rho2);
-        dvTTl := ((liq.ptt-dpTT)/(liq.d*liq.d) + dvTl*(liq.d*dvTl*(2.0*liq.pd + liq.d*liq.pdd)
-             -2.0*liq.ptd))/liq.pd;
-        dvTTv := ((vap.ptt-dpTT)/(vap.d*vap.d) + dvTv*(vap.d*dvTv*(2.0*vap.pd + vap.d*vap.pdd)
-             -2.0*vap.ptd))/vap.pd;
-        dxTT := -dxv*(2.0*dxT*(dvTv-dvTl) + dvTTl + x*(dvTTv-dvTTl));
-        duTTl := liq.cvt +(liq.pt-dpT + T*(2.0*liq.ptt -liq.d*liq.d*liq.ptd *dvTl))*dvTl + (T*
-          liq.pt - p)*dvTTl;
-        duTTv := vap.cvt +(vap.pt-dpT + T*(2.0*vap.ptt -vap.d*vap.d*vap.ptd *dvTv))*dvTv + (T*
-          vap.pt - p)*dvTTv;
-        cvt := duTTl + x *(duTTv -duTTl) + 2.0*dxT*(duTv-duTl) + dxTT *(vap.u-liq.u);
-
-        // not in cache
-        detPH := T*dpT*dpT/(rho2);
-        dtps := 1.0 / dpT;
-        ddsp := -T*dpT/detPH;
-        ddps := cv/detPH;
-
-        ptt :=dpTT;
-
-        // calculate derivatives
-        pro_der.x := if (s_vap <> s_liq) then s_der/(s_vap - s_liq) else 0.0;
-        pro_der.ddps := (-rho2*(-cvt*T*dpT + 3.0*cv*T*ptt + cv*dpT -
-                2.0*cv^2*rho) / (dpT*dpT*dpT*dpT*T*T))*p_der +
-                ((T*ptt - 2.0*cv*rho)*rho2 / (dpT*dpT*dpT*T))*s_der;
-        pro_der.ddsp := (-(T*ptt - 2.0*cv*rho) / (rho2*T*dpT))*p_der +
-                (-2.0 /rho)*s_der;
-        pro_der.cp := 0.0;
-        pro_der.h := p_der/rho + T*s_der;
-        pro_der.u := (ddps*p/rho2)*p_der + (ddsp*p/rho2 + T)*s_der;
-        pro_der.d := ddps*p_der + ddsp*s_der;
-        pro_der.T := dtps*p_der;
-
-      elseif (region == 5) then
-        (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(p,s,relds=1.0e-7);
-        assert(error == 0, "error in inverse iteration of steam tables");
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(p, T);
-        h := R*T*g.tau*g.gtau;
-        rho := p/(R*T*g.pi*g.gpi);
-        rho2 := rho*rho;
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        vt2 := vt*vt;
-        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        cp := -R*g.tau*g.tau*g.gtautau;
-        cpinv := 1/cp;
-        cp3 := cp*cp*cp;
-        invcp3 := 1/cp3;
-        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
-        x := 0.0;
-        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
-        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
-
-        // calculate derivative
-
-        pro_der.cp := cpinv*T*(-(vtt*cp-cpt*vt)*p_der + cpt*s_der);
-        pro_der.x := 0.0;
-        pro_der.ddps := (-rho2*(cp3*vpp + 3.0*cp*cp*T*vt*vtp +
-                3.0*T*T*vtt*cp*vt2 - T*T*vt2*vt*cpt + T*vt2*vt*cp)*invcp3)*p_der +
-                (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp - cpt*T*vt2 +
-                cp*vt2)*invcp3)*s_der;
-        pro_der.ddsp := (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp -
-                cpt*T*vt2 + cp*vt2)*invcp3)*p_der +
-                (-rho2*(-cpt*T*vt + cp*vt + T*vtt*cp)*T*invcp3)*s_der;
-        pro_der.h := p_der/rho + T*s_der;
-        pro_der.u := cpinv*(-p*(vp*cp+T*vt2)*p_der + (cp-p*vt)*T*s_der);
-        pro_der.d := cpinv*(-rho2 *(vp*cp+T*vt2)*p_der + (-rho2*vt*T)*s_der);
-        pro_der.T := (T*cpinv)*(vt*p_der  + s_der);
-      else
-        assert(false, "Water_Ps_der: Incorrect region number");
-      end if;
-      annotation (
-        Window(
-          x=0.22,
-          y=0.2,
-          width=0.6,
-          height=0.6),
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end Water_Ps_der;
-
-    function Water_PT_der
-      input Units.SI.AbsolutePressure p "pressure";
-      input Units.SI.Temperature T "Temperature";
-      input Integer mode = 0 "Région IF97 - 0:calcul automatique";
-
-      input Real p_der "Pression";
-      input Real T_der "Température";
-
-      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro_der;
-    protected
-      Integer region;
-      Boolean supercritical;
-      Integer error;
-
-      Units.SI.Density d;
-
-      // From aux record
-      Units.SI.Pressure p_aux "pressure";
-      Units.SI.Temperature T_aux "temperature";
-      Units.SI.SpecificEnthalpy h "specific enthalpy";
-      Units.SI.SpecificHeatCapacity R "gas constant";
-      Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-      Real cpt "derivative of cp w.r.t. temperature";
-      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-      Real cvt "derivative of cv w.r.t. temperature";
-      Units.SI.Density rho "density";
-      Units.SI.SpecificEntropy s "specific entropy";
-      ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-        "derivative of pressure wrt temperature";
-      ThermoSysPro.Units.xSI.DerPressureByDensity pd
-        "derivative of pressure wrt density";
-      Real ptt "2nd derivative of pressure wrt temperature";
-      Real pdd "2nd derivative of pressure wrt density";
-      Real ptd "mixed derivative of pressure w.r.t. density and temperature";
-      Real vt "derivative of specific volume w.r.t. temperature";
-      Real vp "derivative of specific volume w.r.t. pressure";
-      Real vtt "2nd derivative of specific volume w.r.t. temperature";
-      Real vpp "2nd derivative of specific volume w.r.t. pressure";
-      Real vtp
-        "mixed derivative of specific volume w.r.t. pressure and temperature";
-      Real x "dryness fraction";
-      Real dpT "dp/dT derivative of saturation curve";
-
-      // needed
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-      Real vp3 "vp^3";
-      Real ivp3 "1/vp3";
-      Units.SI.SpecificVolume v;
-
-      Real rho2;
-      Real quotient;
-      Real quotient2;
-      Real pd2;
-      Real pd3;
-      Real pt2;
-      Real pt3;
-    algorithm
-
-      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(p, T, mode);
-      R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      if (region == 1) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, T);
-        x := 0.0;
-
-        h := R*T*g.tau*g.gtau;
-        s := R*(g.tau*g.gtau - g.g);
-        rho := p/(R*T*g.pi*g.gpi);
-        rho2 := rho*rho;
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        cp := -R*g.tau*g.tau*g.gtautau;
-        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
-        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
-        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
-        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-        v := 1/rho;
-        vp3 := vp*vp*vp;
-        ivp3 := 1/vp3;
-        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt*vt*vpp)*ivp3;
-        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd;
-        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
-        cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
-              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
-
-        // calculate the derivatives
-        pro_der.x := 0;
-        pro_der.duTp := (-vt - T*vtt - p*vtp)*p_der +
-              (cpt - p*vtt)*T_der;
-        pro_der.dupT := (-T*vtp - vp - p*vpp)*p_der +
-              (-vt - T*vtt - p*vtp)*T_der;
-        pro_der.ddpT := -rho2*(vpp*p_der + vtp*T_der);
-        pro_der.ddTp := -rho2*(vtp*p_der + vtt*T_der);
-        pro_der.cp := (-T*vtt)*p_der + cpt*T_der;
-        pro_der.s := (-vt)*p_der + (cp/T)*T_der;
-        pro_der.u := (v-T*vt)*p_der + (cp-p*vt)*T_der;
-        pro_der.h := (v - T*vt)*p_der + cp*T_der;
-        pro_der.d := -rho2*(vp*p_der + vt*T_der);
-
-      elseif (region == 2) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, T);
-        x := 1.0;
-
-        h := R*T*g.tau*g.gtau;
-        s := R*(g.tau*g.gtau - g.g);
-        rho := p/(R*T*g.pi*g.gpi);
-        rho2 := rho*rho;
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        cp := -R*g.tau*g.tau*g.gtautau;
-        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
-        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
-        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
-        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-        v := 1/rho;
-        vp3 := vp*vp*vp;
-        ivp3 := 1/vp3;
-        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt*vt*vpp)*ivp3;
-        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd;
-        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
-        cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
-              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
-
-        // calculate the derivatives
-        pro_der.x := 0;
-        pro_der.duTp := (-vt - T*vtt - p*vtp)*p_der +
-              (cpt - p*vtt)*T_der;
-        pro_der.dupT := (-T*vtp - vp - p*vpp)*p_der +
-              (-vt - T*vtt - p*vtp)*T_der;
-        pro_der.ddpT := -rho2*(vpp*p_der + vtp*T_der);
-        pro_der.ddTp := -rho2*(vtp*p_der + vtt*T_der);
-        pro_der.cp := (-T*vtt)*p_der + cpt*T_der;
-        pro_der.s := (-vt)*p_der + (cp/T)*T_der;
-        pro_der.u := (v-T*vt)*p_der + (cp-p*vt)*T_der;
-        pro_der.h := (v - T*vt)*p_der + cp*T_der;
-        pro_der.d := -rho2*(vp*p_der + vt*T_der);
-      elseif (region == 3) then
-        (rho,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(p,T,delp= 1.0e-7);
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(rho, T);
-
-        rho2 := rho*rho;
-        h := R*T*(f.tau*f.ftau + f.delta*f.fdelta);
-        s := R*(f.tau*f.ftau - f.f);
-        pd := R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        pd2 := pd*pd;
-        pd3 := pd*pd2;
-        pt := R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        pt2 := pt*pt;
-        pt3 := pt*pt*pt;
-        cv := R*(-f.tau*f.tau*f.ftautau);
-        x := 0.0;
-        pdd := R*T*f.delta/rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
-             f.delta*f.delta*f.fdeltadeltadelta);
-        ptt := R*rho*f.delta*f.tau*f.tau/T*f.fdeltatautau;
-        ptd := R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau -
-              f.delta*f.tau*f.fdeltadeltatau);
-        cvt := R*f.tau*f.tau/T*(2.0*f.ftautau + f.tau*f.ftautautau);
-        cpt := (cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/(rho2) -
-              pt*ptd)/pd;
-
-        // calculate the derivatives
-        pro_der.x := 0;
-        quotient := 1/(rho2*pd);
-        quotient2 := quotient/(rho*pd2);
-        pro_der.duTp := quotient2*(-(rho*pd2*T*ptt + ptd*rho*pd*p - 2.0*rho*pd*pt*T*ptd +
-              rho*pd2*pt - 2.0*pt*pd*p + 2.0*pd*pt2*T - pt*pdd*rho*p + pdd*rho*pt2*T)*p_der +
-              (rho2*rho*pd3*cvt - rho*pd2*ptt*p + 3.0*rho*pd2*pt*T*ptt +
-              2.0*ptd*rho*pd*pt*p - 3.0*ptd*rho*pd*pt2*T + rho*pd2*pt2 -
-              2.0*pt2*pd*p + 2.0*T*pt3*pd - pt2*pdd*rho*p + T*pt3*pdd*rho)*T_der);
-        pro_der.dupT := quotient2 *((rho*pd2 - rho*pd*T*ptd - 2.0*pd*p +
-              2.0*pd*T*pt - pdd*rho*p + pdd*rho*T*pt)*p_der -
-              (rho*pd2*T*ptt + ptd*rho*pd*p - 2.0*rho*pd*pt*T*ptd +
-              rho*pd2*pt - 2.0*pt*pd*p + 2.0*pd*pt2*T - pt*pdd*rho*p +
-              pdd*rho*pt2*T)*T_der);
-        pro_der.ddpT := -(1/pd3)*(pdd*p_der + (ptd*pd - pt*pdd)*T_der);
-        pro_der.ddTp := -(1/pd3)*((ptd*pd - pt*pdd)*p_der +
-              (ptt*pd2 - 2.0*pt*ptd*pd + pt2*pdd)*T_der);
-        pro_der.cp := quotient2*(-T*(rho*pd2*ptt - 2.0*rho*pd*pt*ptd +
-              2.0*pd*pt2 + pdd*rho*pt^2)*p_der +
-              (rho2*rho*pd3*cvt + 3.0*rho*pd2*pt*T*ptt + rho*pd2*pt2 -
-              3.0*ptd*rho*pd*pt2*T + 2.0*T*pt3*pd + T*pt3*pdd*rho)*T_der);
-        pro_der.s := quotient*(-pt*p_der + (cv*rho2*pd/T+pt2)*T_der);
-        pro_der.u := quotient*(-(-rho*pd + T*pt)*p_der +
-              (cv*rho2*pd - pt*p + pt2*T)*T_der);
-        pro_der.h := quotient*((-rho*pd + T*pt)*p_der +
-              (rho2*pd*cv + T*pt*pt)*T_der);
-        pro_der.d := (1/pd)*(p_der - pt*T_der);
-
-      elseif (region == 5) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(p, T);
-        x := 1.0;
-
-        h := R*T*g.tau*g.gtau;
-        s := R*(g.tau*g.gtau - g.g);
-        rho := p/(R*T*g.pi*g.gpi);
-        rho2 := rho*rho;
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
-        cp := -R*g.tau*g.tau*g.gtautau;
-        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
-        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
-        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
-        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
-        v := 1/rho;
-        vp3 := vp*vp*vp;
-        ivp3 := 1/vp3;
-        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt*vt*vpp)*ivp3;
-        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd;
-        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
-        cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
-              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
-
-        // calculate the derivatives
-        pro_der.x := 0;
-        pro_der.duTp := (-vt - T*vtt - p*vtp)*p_der +
-              (cpt - p*vtt)*T_der;
-        pro_der.dupT := (-T*vtp - vp - p*vpp)*p_der +
-              (-vt - T*vtt - p*vtp)*T_der;
-        pro_der.ddpT := -rho2*(vpp*p_der + vtp*T_der);
-        pro_der.ddTp := -rho2*(vtp*p_der + vtt*T_der);
-        pro_der.cp := (-T*vtt)*p_der + cpt*T_der;
-        pro_der.s := (-vt)*p_der + (cp/T)*T_der;
-        pro_der.u := (v-T*vt)*p_der + (cp-p*vt)*T_der;
-        pro_der.h := (v - T*vt)*p_der + cp*T_der;
-        pro_der.d := -rho2*(vp*p_der + vt*T_der);
-      else
-        assert(false, "Water_pT_der: error in region computation of IF97 steam tables"
-        + "(p = " + String(p) + ", T = " + String(T) + ", region = " + String(region) + ")");
-      end if;
-
-      annotation (
-        Icon(graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end Water_PT_der;
-
-    function Water_sat_P_der
-      input Units.SI.AbsolutePressure P "Pression";
-
-      input Real P_der "derivative of pressure";
-
-    protected
-      Units.SI.Temperature T;
-      ThermoSysPro.Units.xSI.DerPressureByTemperature dpT
-        "dp/dT derivative of saturation curve";
-      Units.SI.Density d "density";
-      Units.SI.SpecificHeatCapacity cp
-        "Chaleur spécifique à pression constante";
-      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-      Real vt(unit="m3/(kg.K)")
-        "derivative of specific volume w.r.t. temperature";
-      Real vp(unit="m3/(kg.Pa)")
-        "derivative of specific volume w.r.t. pressure";
-      ThermoSysPro.Units.xSI.DerPressureByDensity pd
-        "Derivative of pressure wrt density";
-
-      Real vp3 "Third power of vp";
-      Real ivp3 "Inverse of third power of vp";
-
-      Real cvt "Derivative of cv w.r.t. temperature";
-      Real cpt "Derivative of cp w.r.t. temperature";
-
-      Real ptt "2nd derivative of pressure wrt temperature";
-      /*
-  Real pdd "2nd derivative of pressure wrt density";
-  Real ptd "Mixed derivative of pressure w.r.t. density and temperature";
-  */
-      Real vtt "2nd derivative of specific volume w.r.t. temperature";
-      Real vpp "2nd derivative of specific volume w.r.t. pressure";
-      Real vtp
-        "Mixed derivative of specific volume w.r.t. pressure and temperature";
-
-      Real v "specific volume";
-      Real pv;
-      //Real ptv;
-
-      Real tp;
-      Real p2;
-      Real pi2;
-
-    public
-      output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat dlsat
-                                        annotation (Placement(transformation(
-              extent={{-85,15},{-15,85}}, rotation=0)));
-      output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat dvsat
-                                        annotation (Placement(transformation(
-              extent={{15,15},{85,85}}, rotation=0)));
-    protected
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                               gl
-                               annotation (Placement(transformation(extent={{
-                -85,-85},{-15,-15}}, rotation=0)));
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
-                                               gv
-                               annotation (Placement(transformation(extent={{15,
-                -85},{85,-15}}, rotation=0)));
-
-    algorithm
-      /*  if (not (P < SteamIF97.data.plimit4a)) then
-    assert(false, "Eau_sat_P: Pression > 16.5292e6 Pa");
-  end if;*/
-
-      T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(P);
-
-      // get Gibbs derivatives of third order
-      gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(P, T);
-      gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(P, T);
-
-      // Precalculs
-      dpT := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(T);
-      ptt := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.d2ptofT(T);
-      tp := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dtsatofp(P);
-      p2 := gl.p*gl.p;
-      pi2 := gl.pi*gl.pi;
-
-      // compute variables for liquid
-      d := gl.p/(gl.R*T*gl.pi*gl.gpi);
-      vp := gl.R*T/(p2)*pi2*gl.gpipi;
-      vt := gl.R/gl.p*gl.pi*(gl.gpi - gl.tau*gl.gpitau);
-      cp := -gl.R*gl.tau*gl.tau*gl.gtautau;
-      v :=1/d;
-      cv := gl.R*(-gl.tau*gl.tau*gl.gtautau +
-          (gl.gpi - gl.tau*gl.gpitau)*(gl.gpi - gl.tau*gl.gpitau)/(gl.gpipi));
-
-      // variables needed only for derivitve of cp
-
-      pd := -gl.R*T*gl.gpi*gl.gpi/(gl.gpipi);
-      pv := -pd*d*d;
-
-      vtt := gl.R*gl.pi/gl.p*gl.tau/T*gl.tau*gl.gpitautau;
-
-      vtp := gl.R*pi2/(p2)*(gl.gpipi - gl.tau*gl.gpipitau);
-      vpp := gl.R*T*pi2*gl.pi/(p2*gl.p)*gl.gpipipi;
-      vp3 := vp*vp*vp;
-      ivp3 := 1/vp3;
-      /*
-  ptt := -(vtt*vp*vp -2.0*vt*vtp*vp + vt*vt*vpp)*ivp3;
-
-  ptd := (vtp*vp-vt*vpp)*ivp3/(d*d) "= -ptv/d^2";
-  ptv := -ptd/(v*v);
-  */
-
-      cpt := gl.R*gl.tau*gl.tau/T*(2*gl.gtautau + gl.tau*gl.gtautautau);
-      cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
-              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
-
-      // compute derivatives for liquid
-      //dlsat.u := (cv + (T*dpT - P)*vt)*tp*P_der;
-      dlsat.pt := ptt*tp*P_der;
-      dlsat.cv := cvt*tp*P_der;
-      dlsat.cp := (cvt*tp + vp*dpT + ((v*pv + T*dpT)*vtp + (vp*pv + tp*dpT)*vt))*P_der;
-      //dlsat.cp := (cvt + (vt*dpT + ptt*v) + ((v*pv + T*dpT)*vtt + (vt*pv + v*ptv + dpT + T*ptt)*vt))*tp*P_der;
-      dlsat.h := (v - T*vt)*P_der + cp/dpT*P_der;
-      dlsat.rho := -d*d*(vp + vt/dpT)*P_der;
-      dlsat.T := tp*P_der;
-      dlsat.P := P_der;
-
-      p2 := gv.p*gv.p;
-      pi2 := gv.pi*gv.pi;
-
-      // compute variables for liquid
-      d := gv.p/(gv.R*T*gv.pi*gv.gpi);
-      vp := gv.R*T/(p2)*pi2*gv.gpipi;
-      vt := gv.R/gv.p*gv.pi*(gv.gpi - gv.tau*gv.gpitau);
-      cp := -gv.R*gv.tau*gv.tau*gv.gtautau;
-      v :=1/d;
-      cv := gv.R*(-gv.tau*gv.tau*gv.gtautau +
-        (gv.gpi - gv.tau*gv.gpitau)*(gv.gpi - gv.tau*gv.gpitau)/(gv.gpipi));
-
-      // variables needed only for derivitve of cp
-
-      pd := -gv.R*T*gv.gpi*gv.gpi/(gv.gpipi);
-      pv := -pd*d*d;
-
-      vtt := gv.R*gv.pi/gv.p*gv.tau/T*gv.tau*gv.gpitautau;
-
-      vtp := gv.R*pi2/(p2)*(gv.gpipi - gv.tau*gv.gpipitau);
-      vpp := gv.R*T*pi2*gv.pi/(p2*gv.p)*gv.gpipipi;
-      vp3 := vp*vp*vp;
-      ivp3 := 1/vp3;
-      /*
-  ptt := -(vtt*vp*vp -2.0*vt*vtp*vp + vt*vt*vpp)*ivp3;
-
-  ptd := (vtp*vp-vt*vpp)*ivp3/(d*d) "= -ptv/d^2";
-  ptv := -ptd/(v*v);
-  */
-
-      cpt := gv.R*gv.tau*gv.tau/T*(2*gv.gtautau + gv.tau*gv.gtautautau);
-      cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
-              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
-
-      // Compute the derivatives for vapour
-      //dvsat.u := (cv + (T*dpT - P)*vt)*tp*P_der;
-      dvsat.pt := ptt*tp*P_der;
-      dvsat.cv := cvt*tp*P_der;
-      dvsat.cp := (cvt*tp + vp*dpT + ((v*pv + T*dpT)*vtp + (vp*pv + tp*dpT)*vt))*P_der;
-      //dlsat.cp := (cvt + (vt*dpT + ptt*v) + ((v*pv + T*dpT)*vtt + (vt*pv + v*ptv + dpT + T*ptt)*vt))*tp*P_der;
-      dvsat.h := (v - T*vt)*P_der + cp/dpT*P_der;
-      dvsat.rho := -d*d*(vp + vt/dpT)*P_der;
-      dvsat.T := tp *P_der;
-      dvsat.P := P_der;
-
-      annotation (
-        Window(
-          x=0.34,
-          y=0.21,
-          width=0.6,
-          height=0.6),
-        Icon(coordinateSystem(
-            preserveAspectRatio=false,
-            extent={{-100,-100},{100,100}},
-            grid={2,2}), graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end Water_sat_P_der;
-
-    function SpecificEnthalpy_PT_der
-      input Units.SI.AbsolutePressure p "pressure";
-      input Units.SI.Temperature T "Temperature";
-      input Integer mode = 0 "Région IF97 - 0:calcul automatique";
-
-      input Real p_der "Pression";
-      input Real T_der "Température";
-
-      output Real H "specific enthalpy";
-    protected
-      Integer region;
-      Boolean supercritical;
-      Integer error;
-
-      Units.SI.SpecificHeatCapacity R "gas constant";
-      Units.SI.SpecificHeatCapacity cp "specific heat capacity";
-      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
-      Units.SI.Density rho "density";
-      ThermoSysPro.Units.xSI.DerPressureByTemperature pt
-        "derivative of pressure wrt temperature";
-      ThermoSysPro.Units.xSI.DerPressureByDensity pd
-        "derivative of pressure wrt density";
-
-      Real vt "derivative of specific volume w.r.t. temperature";
-
-      // needed
-      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
-        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
-      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
-        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
-
-      Real rho2;
-
-    algorithm
-      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(p, T, mode);
-      R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-      if (region == 1) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
-
-        rho := p/(R*T*g.pi*g.gpi);
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        cp := -R*g.tau*g.tau*g.gtautau;
-
-        H := (1/rho - T*vt)*p_der + cp*T_der;
-
-      elseif (region == 2) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
-        rho := p/(R*T*g.pi*g.gpi);
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        cp := -R*g.tau*g.tau*g.gtautau;
-
-        H := (1/rho - T*vt)*p_der + cp*T_der;
-      elseif (region == 3) then
-        (rho,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(p,T,delp= 1.0e-7);
-        rho2 := rho*rho;
-        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(rho, T);
-
-        pd := R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-        pt := R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-        cv := R*(-f.tau*f.tau*f.ftautau);
-
-        H := 1/(rho2*pd)*((-rho*pd + T*pt)*p_der +
-              (rho2*pd*cv + T*pt*p)*T_der);
-
-      elseif (region == 5) then
-        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
-        rho := p/(R*T*g.pi*g.gpi);
-        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
-        cp := -R*g.tau*g.tau*g.gtautau;
-
-        H := (1/rho - T*vt)*p_der + cp*T_der;
-      else
-        assert(false, "Water_pT_der: error in region computation of IF97 steam tables"
-        + "(p = " + String(p) + ", T = " + String(T) + ", region = " + String(region) + ")");
-      end if;
-
-      annotation (
-        Icon(graphics={
-            Text(extent={{-134,104},{142,44}}, textString=
-                                                   "%name"),
-            Ellipse(
-              extent={{-100,40},{100,-100}},
-              lineColor={255,127,0},
-              fillColor={255,255,255},
-              fillPattern=FillPattern.Solid),
-            Text(
-              extent={{-84,-4},{84,-52}},
-              lineColor={255,127,0},
-              textString=
-                   "fonction")}),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-    end SpecificEnthalpy_PT_der;
-
-    package Unused
-      "unused functions for which no analytic derivative can be provided"
-      function Water_rhoT
-        input Units.SI.Density rho "Masse volumique";
-        input Units.SI.Temperature T "Température";
-        input Integer phase "2: diphasique, 1 sinon";
-        input Integer mode = 0 "Région IF97 - 0:calcul automatique";
-        output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_dT
-                                          pro;
-
-      protected
-        Integer region;
-        Integer error;
-        Boolean supercritical;
-        Units.SI.AbsolutePressure p;
-      protected
-        ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                           g annotation (Placement(transformation(extent={{-90,
-                  -85},{-43.3333,-38.3333}}, rotation=0)));
-        ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
-                               f
-          annotation (Placement(transformation(extent={{-23.3333,-85},{23.3333,
-                  -38.3333}}, rotation=0)));
-      algorithm
-        region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_dT(rho, T, phase, mode);
-        if (region == 1) then
-          (p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(d=rho, T=T, reldd=ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData.DELD, region=1);
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
-          supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-          pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_dT(
-                                        g);
-          pro.x := if (supercritical) then -1 else 0;
-        elseif (region == 2) then
-          (p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(d=rho, T=T, reldd=ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData.DELD, region=2);
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
-          supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-          pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_dT(
-                                        g);
-          pro.x := if (supercritical) then -1 else 1;
-        elseif (region == 3) then
-          f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(rho, T);
-          pro := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToProps_dT(
-                                            f);
-          pro.x := if (supercritical) then -1 else 0;
-          supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-        elseif (region == 4) then
-          pro := ThermoSysPro.Properties.WaterSteam.BaseIF97.TwoPhase.waterR4_dT(d=rho, T=T);
-        elseif (region == 5) then
-          (p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(d=rho, T=T, reldd=ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData.DELD, region=5);
-          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
-          supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
-          pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_dT(
-                                        g);
-          pro.x := if (supercritical) then -1 else 1;
-        else
-          assert(false, "Eau_rhoT: Numéro de région incorrect");
-        end if;
-        annotation (
-          Window(
-            x=0.3,
-            y=0.14,
-            width=0.6,
-            height=0.6),
-          Icon(coordinateSystem(
-              preserveAspectRatio=false,
-              extent={{-100,-100},{100,100}},
-              grid={2,2}), graphics={
-              Text(extent={{-134,104},{142,44}}, textString=
-                                                     "%name"),
-              Ellipse(
-                extent={{-100,40},{100,-100}},
-                lineColor={255,127,0},
-                fillColor={255,255,255},
-                fillPattern=FillPattern.Solid),
-              Text(
-                extent={{-84,-4},{84,-52}},
-                lineColor={255,127,0},
-                textString=
-                     "fonction"),
-              Ellipse(
-                extent={{-100,100},{-60,-100}},
-                lineColor={255,0,0},
-                fillColor={255,0,0},
-                fillPattern=FillPattern.Solid)}),
-          Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-      end Water_rhoT;
-
-      function Water_h_is
-        input Units.SI.AbsolutePressure p;
-        input Units.SI.SpecificEntropy s;
-        input Integer phase;
-        input Integer mode = 0;
-        output Units.SI.SpecificEnthalpy h;
-
-      protected
-        Integer region;
-        Integer error;
-        Units.SI.Temperature T;
-        Units.SI.Density d;
-      protected
-        ThermoSysPro.Properties.WaterSteam.Common.HelmholtzData
-                             dTR(R=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O)
-          annotation (Placement(transformation(extent={{-85,15},{-15,85}},
-                rotation=0)));
-        ThermoSysPro.Properties.WaterSteam.Common.GibbsData
-                         pTR(R=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O)
-          annotation (Placement(transformation(extent={{15,15},{85,85}},
-                rotation=0)));
-        ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
-                           g annotation (Placement(transformation(extent={{-85,
-                  -85},{-15,-15}}, rotation=0)));
-        ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
-                               f annotation (Placement(transformation(extent={{
-                  15,-85},{85,-15}}, rotation=0)));
-      algorithm
-
-        region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(p, s, phase, mode);
-        if (region == 1) then
-          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofps1(p, s);
-        elseif (region == 2) then
-          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofps2(p, s);
-        elseif (region == 3) then
-          (d,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(p=p, s=s, delp=1.0e-7, dels=1.0e-6);
-          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofdT3(d, T);
-        elseif (region == 4) then
-          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofps4(p, s);
-        elseif (region == 5) then
-          (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(p=p, s=s, relds=1.0e-7);
-          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofpT5(p, T);
-        else
-          assert(false, "Eau_H_is: Numéro de région incorrect");
-        end if;
-        annotation (
-          Window(
-            x=0.27,
-            y=0.15,
-            width=0.6,
-            height=0.6),
-          Icon(coordinateSystem(
-              preserveAspectRatio=false,
-              extent={{-100,-100},{100,100}},
-              grid={2,2}), graphics={
-              Text(extent={{-134,104},{142,44}}, textString=
-                                                     "%name"),
-              Ellipse(
-                extent={{-100,40},{100,-100}},
-                lineColor={255,127,0},
-                fillColor={255,255,255},
-                fillPattern=FillPattern.Solid),
-              Text(
-                extent={{-84,-4},{84,-52}},
-                lineColor={255,127,0},
-                textString=
-                     "fonction"),
-              Ellipse(
-                extent={{-100,100},{-60,-100}},
-                lineColor={255,0,0},
-                fillColor={255,0,0},
-                fillPattern=FillPattern.Solid)}),
-          Documentation(info="<html>
-<p><b>Version 1.4</b></p>
-</HTML>
-"));
-      end Water_h_is;
-      annotation (Icon(graphics={
-            Text(
-              extent={{-102,0},{24,-26}},
-              lineColor={242,148,0},
-              textString=
-                   "Thermo"),
-            Text(
-              extent={{-4,8},{68,-34}},
-              lineColor={46,170,220},
-              textString=
-                   "SysPro"),
-            Polygon(
-              points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},
-                  {42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},
-                  {-50,6},{-62,2}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{
-                  -46,8},{-42,22},{-42,30},{-44,38}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{
-                  -12,12},{-26,12},{-28,12},{-26,20}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-8,30},{-6,26}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-8,36},{-6,32}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-8,42},{-6,38}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-8,48},{-6,44}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-4,32},{-2,28}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-4,38},{-2,34}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-4,44},{-2,40}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-4,50},{-2,46}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                  20}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},
-                  {42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},
-                  {-50,6},{-62,2}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Line(
-              points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-              color={46,170,220},
-              thickness=0.5),
-            Line(
-              points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-              color={46,170,220},
-              thickness=0.5),
-            Line(
-              points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-              color={46,170,220},
-              thickness=0.5),
-            Polygon(
-              points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-            Line(
-              points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-              color={0,0,255},
-              smooth=Smooth.None),
-            Line(
-              points={{80,80},{100,100}},
-              color={0,0,255},
-              smooth=Smooth.None)}));
-    end Unused;
-
-    package Spline_Utilities
-      constant Spline_Utilities.Modelica_Interpolation.Bspline1D.Data IF97_spline(
-          ndim = 1,
-          ncontrol = 100,
-          degree = 3,
-          knots = {
-          2.93063160225403e-007, 2.93063160225403e-007, 2.93063160225403e-007, 2.93063160225403e-007,
-          0.0150553301018805, 0.0225746360796844, 0.0300841766610507, 0.0375864719559614,
-          0.0450833779282367, 0.0525763026035424, 0.0600663541987385, 0.0675544420190098,
-          0.0750413446792581, 0.0825277558142009, 0.0900143143696351, 0.0975016244159301,
-          0.104990267916964, 0.11248081283071, 0.119973818177067, 0.127469837190213,
-          0.134969419310924, 0.14247311152242, 0.149981459358957, 0.157495007796453,
-          0.165014302152702, 0.172539889069826, 0.180072317615317, 0.187612140514708,
-          0.195159915514515, 0.202716206865773, 0.21028158691427, 0.217856637782066,
-          0.225441953125109, 0.233038139953034, 0.240645820499176, 0.248265634131007,
-          0.255898239293619, 0.26354431548115, 0.271204565233372, 0.278879716156774,
-          0.286570522971491, 0.294277769587339, 0.302002271213962, 0.309744876511783,
-          0.317506469792076, 0.325287973276035, 0.333090349424309, 0.340914603350119,
-          0.348761785330786, 0.356632993434437, 0.364529376280738, 0.372452135957019,
-          0.380402531113975, 0.388381880268579, 0.39639156534589, 0.404433035496425,
-          0.412507811231662, 0.420617488927502, 0.42876374575417, 0.436948345101518,
-          0.445173142581185, 0.453440092702033, 0.461751256332929, 0.470108809087968,
-          0.478515050793845, 0.486972416228223, 0.495483487352128, 0.50405100729972,
-          0.512677896436249, 0.521367270850924, 0.53012246371707, 0.538947050028345,
-          0.547844875307676, 0.556820088984304, 0.565877183242573, 0.575021038260507,
-          0.584256974874285, 0.593590815826759, 0.603028956896544, 0.612578449397273,
-          0.622247095874125, 0.632043561486359, 0.641977504873387, 0.652059734791795,
-          0.662302403295546, 0.672719253852374, 0.6833259549907, 0.694140568427125,
-          0.705184226398132, 0.716482126202646, 0.728064988229839, 0.739971159691273,
-          0.752249564928059, 0.764963678571606, 0.77819659006882, 0.79205900502822,
-          0.806726369054731, 0.822437269975835, 0.839573763094594, 0.858852425095749,
-          1, 1, 1, 1},
-          controlPoints = [
-          6.41617166788097; 6.59657375859249; 6.85956502478188; 7.19550228677957;
-          7.44003141655459; 7.67746343199683; 7.90809030002524; 8.1321863948823;
-          8.35001072138466; 8.56180824123764; 8.76781112389037; 8.96823977601129;
-          9.16330374171574; 9.35320248746118; 9.53812609634101; 9.71825588651749;
-          9.89376496619584; 10.064818734583; 10.2315753364618; 10.394186076569;
-          10.552795798896; 10.7075432351955; 10.8585613263155; 11.0059775194514;
-          11.1499140439677; 11.2904881680785; 11.427812438369; 11.561994903882;
-          11.6931393262684; 11.8213453773153; 11.9467088249962; 12.0693217090492;
-          12.1892725069664; 12.3066462911727; 12.421524878079; 12.5339869696189;
-          12.644108287808; 12.7519617028068; 12.8576173549182; 12.9611427709053;
-          13.06260297498; 13.1620605947781; 13.25957596261; 13.355207212251;
-          13.4490103715159; 13.5410394508422; 13.6313465280923; 13.7199818297721;
-          13.8069938088494; 13.892429219348; 13.9763331878828; 14.0587492822951;
-          14.1397195775398; 14.2192847189711; 14.297483983169; 14.3743553364442;
-          14.4499354911556; 14.524259959973; 14.5973631082143; 14.6692782043857;
-          14.740037469051; 14.8096721221595; 14.8782124289575; 14.9456877446163;
-          15.0121265577065; 15.0775565326579; 15.1420045513451; 15.2054967539465;
-          15.2680585792283; 15.3297148044048; 15.3904895847271; 15.4504064929423;
-          15.5094885587568; 15.5677583084284; 15.6252378046292; 15.6819486867911;
-          15.7379122123276; 15.7931492995096; 15.8476805734722; 15.9015264179811;
-          15.9547070373259; 16.0072425350593; 16.0591530191528; 16.11045874587;
-          16.1611803164475; 16.211338938197; 16.2609567565343; 16.3100572327281;
-          16.3586655540358; 16.4068088127073; 16.4545163733577; 16.501817689937;
-          16.5487496364798; 16.5953631575021; 16.6418467771832; 16.6879750106034;
-          16.7343150270632; 16.8752144692458; 16.9266730020941; 16.9094578790152]);
-
-      record Data "Datastructure of a Bspline"
-        parameter Integer ndim(min=1)
-          "Number of dimensions of one control point";
-        parameter Integer ncontrol(min=1) "Number of control points";
-        parameter Integer degree(min=1) "Polynomial degree of the Bspline";
-        Real knots[ncontrol+degree+1] "Knot vector of the Bspline";
-        Real controlPoints[ncontrol,ndim] "[i,:] is data of control point i";
-      end Data;
-
-      function safeEvaluate
-        "Evaluate Bspline at one parameter safely, i.e. points outside the domain of the spline are moved inside the domain."
-        extends Modelica.Icons.Function;
-        input Data spline "Bspline to be evaluated";
-        input Real u "Parameter value at which Bspline shall be evaluated";
-        output Real x[spline.ndim] "Value of Bspline at u";
-      protected
-        Real eps = 1e-10 "accurate enough?";
-        Real umin =  spline.knots[1] + eps*abs(spline.knots[1]);
-        Real umax =  spline.knots[end] - eps*abs(spline.knots[end]);
-        Real ulim;
-      algorithm
-        ulim := min(max(u,umin),umax);
-        x := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.evaluate(spline, ulim);
-      end safeEvaluate;
-
-        function safeEvaluateDer
-        "Evaluate Bspline at one parameter safely, i.e. points outside the domain of the spline are moved inside the domain."
-          extends Modelica.Icons.Function;
-          input Data spline "Bspline to be evaluated";
-          input Real u "Parameter value at which Bspline shall be evaluated";
-          output Real x[spline.ndim] "Value of Bspline at u";
-          output Real xd[spline.ndim] "First derivative of Bspline at u";
-      protected
-          Real eps = 1e-10 "accurate enough?";
-          Real umin =  spline.knots[1] + eps*abs(spline.knots[1]);
-          Real umax =  spline.knots[end] - eps*abs(spline.knots[end]);
-          Real ulim;
-        algorithm
-          ulim := min(max(u,umin),umax);
-          (x,xd) := evaluateDer(spline, ulim);
-        end safeEvaluateDer;
-
-      function evaluate "Evaluate Bspline at one parameter"
-        extends Modelica.Icons.Function;
-        input Data spline "Bspline to be evaluated";
-        input Real u "Parameter value at which Bspline shall be evaluated";
-        output Real x[spline.ndim] "Value of Bspline at u";
-
-      protected
-        Integer span;
-        Real N[spline.degree+1];
-      algorithm
-        x := zeros(spline.ndim);
-        span := Utilities.n_findSpan(spline.degree, u, spline.knots);
-        N := Utilities.n_BasisFuns(span, u, spline.degree, spline.knots);
-
-        for i in 1:spline.ndim loop
-          x[i] := N*spline.controlPoints[span-spline.degree:span,i];
-        end for;
-      end evaluate;
-
-      function evaluateDer
-        "Evaluate Bspline and its first derivative at one parameter"
-        extends Modelica.Icons.Function;
-        input Data spline "Bspline to be evaluated";
-        input Real u "Parameter value at which Bspline shall be evaluated";
-        output Real x[spline.ndim] "Value of Bspline at u";
-        output Real xd[spline.ndim] "First derivative of Bspline at u";
-      protected
-        Integer span;
-        Real N[2,spline.degree+1];
-      algorithm
-        //Grenzwert von rechts lim (h->0) (f(x+h)-f(x))/h
-        x := zeros(spline.ndim);
-        xd := zeros(spline.ndim);
-
-        span := Utilities.n_findSpan(spline.degree, u, spline.knots);
-        N := Utilities.n_DersBasisFuns(span, u, spline.degree, 1, spline.knots);
-
-        for i in 1:spline.ndim loop
-          x[i] := N[1,:]*spline.controlPoints[span-spline.degree:span,i];
-          xd[i] := N[2,:]*spline.controlPoints[span-spline.degree:span,i];
-        end for;
-
-      end evaluateDer;
-
-      package Utilities "spline utility functions"
-        function n_BasisFuns "Compute the nonvanishing basis functions"
-          extends Modelica.Icons.Function;
-          input Integer i "index";
-          input Real u "parameter";
-          input Integer p "degree";
-          input Real knots[:] "knot vector";
-          output Real N[p+1] "Basis functions";
-        protected
-          Integer j;
-          Integer r;
-          Real left[p+1];
-          Real right[p+1];
-          Real temp;
-          Real saved;
-        algorithm
-          /*
-           The NURBS Book: Algorithm A2.2 (page 70)
-        */
-          N[1] := 1;
-          for j in 1:p loop
-            left[j] := u - knots[i+1-j];
-            right[j] := knots[i+j] - u;
-            saved := 0.0;
-
-            for r in 1:j loop
-              temp := N[r]/(right[r]+left[j-r+1]);
-              N[r] := saved + right[r]*temp;
-              saved := left[j-r+1]*temp;
-
-            end for;
-            N[j+1] := saved;
-          end for;
-        end n_BasisFuns;
-
-        function n_DersBasisFuns
-          "Compute nonzero basis functions and their derivatives"
-          extends Modelica.Icons.Function;
-          input Integer i "index";
-          input Real u "parameter";
-          input Integer p "degree";
-          input Integer n "n-th derivative";
-          input Real knots[:] "knot vector";
-          output Real ders[n+1,p+1] "ders[k,:] is (k-1)-th derivative";
-        protected
-          Integer j;
-          Integer r;
-          Real left[p+1];
-          Real right[p+1];
-          Real temp;
-          Real saved;
-          Real ndu[p+1,p+1];
-          Integer s1;
-          Integer s2;
-          Integer j1;
-          Integer j2;
-          Real a[2,p+1];
-          Real d;
-          Integer rk;
-          Integer pk;
-          Integer prod;
-          Integer tt;
-        algorithm
-          /*
-           The NURBS Book: Algorithm A2.3 (page 72)
-        */
-          ndu[1,1] := 1;
-          for j in 1:p loop
-            left[j] := u - knots[i+1-j];
-            right[j] := knots[i+j] - u;
-            saved := 0.0;
-
-            for r in 1:j loop
-              ndu[j+1,r] := right[r]+left[j-r+1];
-              temp := ndu[r,j]/ndu[j+1,r];
-              ndu[r,j+1] := saved + right[r]*temp;
-              saved := left[j-r+1]*temp;
-
-            end for;
-            ndu[j+1,j+1] := saved;
-          end for;
-
-          for j in 1:p+1 loop
-            ders[1,j] := ndu[j,p+1];
-          end for;
-
-          for r in 1:p+1 loop
-            s1 := 1;
-            s2 := 2;
-            a[1,1] := 1.0;
-
-            for k in 1:n loop
-              d := 0.0;
-              rk := r-k-1;
-              pk := p-k;
-
-              if r-1>=k then
-                a[s2,1] := a[s1,1]/ndu[pk+2,rk+1];
-                d := a[s2,1]*ndu[rk+1,pk+1];
-
-              end if;
-
-              if rk >= -1 then
-                j1 :=1;
-
-              else
-                j1 :=-rk;
-
-              end if;
-
-              if r-1 <= pk+1 then
-                j2 := k-1;
-
-              else
-                j2 := p-r+1;
-
-              end if;
-
-              for j in j1:j2 loop
-                a[s2,j+1] :=(a[s1, j + 1] - a[s1, j])/ndu[pk + 2, rk + j + 1];
-                d :=d + a[s2, j + 1]*ndu[rk + j + 1, pk + 1];
-
-              end for;
-
-              if r-1 <= pk then
-                a[s2,k+1] := -a[s1,k]/ndu[pk+2,r];
-                d := d + a[s2,k+1]*ndu[r,pk+1];
-
-              end if;
-
-              ders[k+1,r] := d;
-              tt := s1;
-              s1 := s2;
-              s2 := tt;
-
-            end for;
-          end for;
-
-          prod := p;
-
-          for k in 1:n loop
-
-            for j in 1:p+1 loop
-              ders[k+1,j] := ders[k+1,j]*prod;
-
-            end for;
-            prod := prod*(p-k);
-
-          end for;
-
-        end n_DersBasisFuns;
-
-        function n_findSpan "Determine the knot span index"
-          extends Modelica.Icons.Function;
-          input Integer p "degree";
-          input Real u "parameter";
-          input Real knots[:] "knot vector";
-          output Integer i "The knot span index";
-        protected
-          Integer n;
-          Integer low;
-          Integer high;
-          Integer mid;
-        algorithm
-          /*
-           The NURBS Book: Algorithm A2.1 (page 68)
-        */
-          n:=size(knots,1)-p-1;
-
-          if abs(u-knots[n+1])<10e-12 then
-            i := n;
-          elseif abs(u-knots[1])<10e-12 then
-            i := 1;
-          else
-            low := p;
-            high := n+1;
-            mid := integer((low+high)/2);
-
-            while
-              (u<knots[mid] or u>=knots[mid+1]) loop
-              assert(low+1<high,"Value must be within limits for Utilities.n_findSpan");
-
-              if (u<knots[mid]) then
-                high := mid;
-
-              else
-                low := mid;
-
-              end if;
-              mid := integer((low+high)/2);
-
-            end while;
-            i := mid;
-
-          end if;
-        end n_findSpan;
-
-        annotation (Icon(graphics={
-              Text(
-                extent={{-102,0},{24,-26}},
-                lineColor={242,148,0},
-                textString=
-                     "Thermo"),
-              Text(
-                extent={{-4,8},{68,-34}},
-                lineColor={46,170,220},
-                textString=
-                     "SysPro"),
-              Polygon(
-                points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},
-                    {42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,
-                    10},{-50,6},{-62,2}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{
-                    -46,8},{-42,22},{-42,30},{-44,38}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{
-                    -12,12},{-26,12},{-28,12},{-26,20}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-8,30},{-6,26}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-8,36},{-6,32}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-8,42},{-6,38}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-8,48},{-6,44}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-4,32},{-2,28}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-4,38},{-2,34}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-4,44},{-2,40}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-4,50},{-2,46}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{
-                    -2,20}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},
-                    {42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},
-                    {-50,6},{-62,2}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Line(
-                points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-                color={46,170,220},
-                thickness=0.5),
-              Line(
-                points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-                color={46,170,220},
-                thickness=0.5),
-              Line(
-                points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-                color={46,170,220},
-                thickness=0.5),
-              Polygon(
-                points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-              Line(
-                points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-                color={0,0,255},
-                smooth=Smooth.None),
-              Line(
-                points={{80,80},{100,100}},
-                color={0,0,255},
-                smooth=Smooth.None)}));
-      end Utilities;
-
-      function linspace "Returns a vector with linear spacing"
-        input Real min;
-        input Real max;
-        input Integer npoints;
-
-        output Real[npoints] res;
-
-      protected
-        Real delta;
-      algorithm
-        res[1] := min;
-        res[end] := max;
-
-        delta := (max - min)/npoints;
-
-        for i in 2:npoints-1 loop
-          res[i] := res[i-1] + delta;
-        end for;
-
-      end linspace;
-
-      function dumpOneSpline
-        "Write Modelica.Interpolation.Bspline1D.Data to file as record (not finished)."
-        import Util = Modelica.Utilities;
-        input String fileName "file name";
-        input String splineName "Name of the spline in the array of records.";
-        input
-          ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Data
-                                                                                               spline "Data.";
-        input Boolean lastSpline = false;
-        output Boolean status "true if succesful.";
-      protected
-        constant Integer recordsPerLine =  4;
-        Integer nKnots;
-        Integer n;
-        Integer nLeftovers;
-      algorithm
-        assert(spline.ndim == 1, "Bailing out - spline.ndim != 1");
-        // This is only for testing. In the end we'd like to append multiple spline records to a file.
-        //Util.Files.removeFile(fileName);
-        Util.Streams.print("record IF97_spline = ThermoSysPro_addon.IF97.SplineUtilities.Modelica_Interpolation.Bspline1D.Data(", fileName);
-        Util.Streams.print("    ndim = " + integerString(spline.ndim) + ",", fileName);
-        Util.Streams.print("    ncontrol = " + integerString(spline.ncontrol) + ",", fileName);
-        Util.Streams.print("    degree = " + integerString(spline.degree) + ",", fileName);
-        nKnots := size(spline.knots, 1);
-        Util.Streams.print("    knots = {", fileName);
-        // print the knots
-        n := integer(nKnots/recordsPerLine);
-        nLeftovers := nKnots - n*recordsPerLine;
-        // if nLeftOvers == 0 we output the last four records separately
-        // or else we end up with "...xxx, xxx, }" (trailing ',') instead of "...xxx, xxx }"
-        if nLeftovers == 0 then
-          for j in 1:n-1 loop
-            Util.Streams.print("    " + String(spline.knots[recordsPerLine * j - 3], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j - 2], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j - 1], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j], significantDigits=15) + ",",  fileName);
-          end for;
-          Util.Streams.print("    " + String(spline.knots[nKnots - 3], significantDigits=15) + ", " + String(spline.knots[nKnots - 2], significantDigits=15) + ", " + String(spline.knots[nKnots - 1], significantDigits=15) + ", " + String(spline.knots[nKnots], significantDigits=15),  fileName);
-        else
-          for j in 1:n loop
-            Util.Streams.print("    " + String(spline.knots[recordsPerLine * j - 3], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j - 2], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j - 1], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j], significantDigits=15) + ",",  fileName);
-          end for;
-          if nLeftovers == 3 then
-            Util.Streams.print("    " + String(spline.knots[nKnots - 2], significantDigits=15) + ", " + String(spline.knots[nKnots - 1], significantDigits=15) + ", " + String(spline.knots[nKnots], significantDigits=15),  fileName);
-          elseif nLeftovers == 2 then
-            Util.Streams.print("    " + String(spline.knots[nKnots - 1], significantDigits=15) + ", " + String(spline.knots[nKnots], significantDigits=15), fileName);
-          elseif nLeftovers == 1 then
-            Util.Streams.print("    " + String(spline.knots[nKnots], significantDigits=15), fileName);
-          end if;
-        end if;
-        Util.Streams.print("    },", fileName);
-        // print the control points
-        // ncontrol = #controlPoints
-        Util.Streams.print("    controlPoints = [", fileName);
-        n := integer(spline.ncontrol / recordsPerLine);
-        nLeftovers := spline.ncontrol - n * recordsPerLine;
-        // Take care of the case when nLeftovers == 0, see the knot comment above for an explanation.
-        if nLeftovers == 0 then
-          for j in 1:n-1 loop
-            Util.Streams.print("    " + String(spline.controlPoints[recordsPerLine * j - 3, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j - 2, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j, 1], significantDigits=15) + ";",  fileName);
-          end for;
-          Util.Streams.print("    " + String(spline.controlPoints[spline.ncontrol - 3, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol - 2, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol, 1], significantDigits=15),  fileName);
-        else
-          for j in 1:n loop
-            Util.Streams.print("    " + String(spline.controlPoints[recordsPerLine * j - 3, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j - 2, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j, 1], significantDigits=15) + ";",  fileName);
-          end for;
-          if nLeftovers == 3 then
-            Util.Streams.print("    " + String(spline.controlPoints[spline.ncontrol - 2, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol, 1], significantDigits=15),  fileName);
-          elseif nLeftovers == 2 then
-            Util.Streams.print("    " + String(spline.controlPoints[spline.ncontrol - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol, 1], significantDigits=15),  fileName);
-          elseif nLeftovers == 1 then
-            Util.Streams.print("    " + String(spline.controlPoints[spline.ncontrol, 1], significantDigits=15),  fileName);
-          end if;
-        end if;
-        if lastSpline then
-           Util.Streams.print("    ])", fileName);
-        else
-          Util.Streams.print("    ]),", fileName);
-        end if;
-        Util.Streams.print("end IF97_spline;",fileName);
-        status := true;
-        annotation ();
-      end dumpOneSpline;
-
-      package Modelica_Interpolation
-        package Table1D "Table interpolation in one dimension"
-
-          function init "Initialize 1-dim. table interpolation"
-            extends Modelica.Icons.Function;
-            input Real table[:, :] "[x, y1(x), y2(x), ..., yn(x)] data points";
-            input Integer degree(min=1) = 1
-              "Polynomial degree of interpolation";
-            output Bspline1D.Data tableSpline(
-              ndim=size(table, 2) - 1,
-              ncontrol=size(table, 1),
-              degree=degree)
-              "Table data in a form which can be quickly interpolated";
-          protected
-            Integer nknots=size(tableSpline.knots, 1);
-            Integer ndim=size(table, 2);
-          algorithm
-            //the first column is the parametrization
-            tableSpline := Bspline1D.init(
-                        table[:, 2:ndim],
-                        table[:, 1],
-                        degree,
-                        false);
-          end init;
-
-          function evaluate "Evaluate Table data at one parameter"
-            extends Modelica.Icons.Function;
-            input Bspline1D.Data tableSpline "Bspline table to be evaluated";
-            input Real x "Parameter value at which table shall be evaluated";
-            output Real y[tableSpline.ndim] "Value of table at x";
-          algorithm
-            y := Bspline1D.evaluate(tableSpline, x);
-          end evaluate;
-
-         function evaluateDer
-            "Evaluate Table data and first derivative at one parameter"
-            extends Modelica.Icons.Function;
-            input
-              ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Data
-              tableSpline "Bspline table to be evaluated";
-            input Real x
-              "Parameter value at which the table shall be evaluated";
-            output Real y[tableSpline.ndim] "Value of the table at x";
-            output Real yd[tableSpline.ndim]
-              "Value of the first derivative at x";
-         algorithm
-            (y,yd) := Bspline1D.evaluateDer(tableSpline, x);
-         end evaluateDer;
-
-          function evaluateDer2
-            "Evaluate Table data and first and second derivative at one parameter"
-            extends Modelica.Icons.Function;
-            input Bspline1D.Data tableSpline "Bspline table to be evaluated";
-            input Real x
-              "Parameter value at which the table shall be evaluated";
-            output Real y[tableSpline.ndim] "Value of the table at x";
-            output Real yd[tableSpline.ndim]
-              "Value of the first derivative at x";
-            output Real ydd[tableSpline.ndim]
-              "Value of the second derivative at x";
-          algorithm
-            (y,yd,ydd) := Bspline1D.evaluateDer2(tableSpline, x);
-          end evaluateDer2;
-
-          annotation (
-            Window(
-              x=0.45,
-              y=0.01,
-              width=0.44,
-              height=0.65,
-              library=1,
-              autolayout=1),
-            Documentation(info="With this package interpolation with B-Splines
-of 1-dim. tables is provided."));
-        end Table1D;
-
-        package Bspline1D "1-dimensional Bspline interpolation"
-
-        record Data "Datastructure of a Bspline"
-          parameter Integer ndim(min=1) "Number of dimensions of one control point";
-          parameter Integer ncontrol(min=1) "Number of control points";
-          parameter Integer degree(min=1) "Polynomial degree of the Bspline";
-          Real knots[ncontrol+degree+1] "Knot vector of the Bspline";
-          Real controlPoints[ncontrol,ndim] "[i,:] is data of control point i";
-        end Data;
-
-        record ParametrizationType "will be later replaced by enumeration"
-          constant Integer Equidistant=1 "not recommended";
-          constant Integer ChordLength=2;
-          constant Integer Centripetal=3 "recommended";
-          constant Integer Foley=4;
-          constant Integer Angular=5;
-          constant Integer AreaBased=6;
-        end ParametrizationType;
-
-          function evaluate "Evaluate Bspline at one parameter"
-            extends Modelica.Icons.Function;
-            input Data spline "Bspline to be evaluated";
-            input Real u "Parameter value at which Bspline shall be evaluated";
-            output Real x[spline.ndim] "Value of Bspline at u";
-
-          protected
-           Integer span;
-           Real N[spline.degree+1];
-          algorithm
-            x := zeros(spline.ndim);
-           span := Utilities.n_findSpan(spline.degree,u,spline.knots);
-            N := Utilities.n_BasisFuns(span,u,spline.degree,spline.knots);
-
-            for i in 1:spline.ndim loop
-             x[i] := N*spline.controlPoints[span-spline.degree:span,i];
-            end for;
-          end evaluate;
-
-          function evaluateDer
-            "Evaluate Bspline and its first derivative at one parameter"
-            extends Modelica.Icons.Function;
-            input Data spline "Bspline to be evaluated";
-            input Real u "Parameter value at which Bspline shall be evaluated";
-            output Real x[spline.ndim] "Value of Bspline at u";
-            output Real xd[spline.ndim] "First derivative of Bspline at u";
-          protected
-           Integer span;
-           Real N[2,spline.degree+1];
-          algorithm
-            //Grenzwert von rechts lim (h->0) (f(x+h)-f(x))/h
-            x := zeros(spline.ndim);
-           xd := zeros(spline.ndim);
-
-           span := Utilities.n_findSpan(spline.degree,u,spline.knots);
-            N := Utilities.n_DersBasisFuns(span,u,spline.degree,1,spline.knots);
-
-            for i in 1:spline.ndim loop
-             x[i] := N[1,:]*spline.controlPoints[span-spline.degree:span,i];
-             xd[i] := N[2,:]*spline.controlPoints[span-spline.degree:span,i];
-            end for;
-
-          end evaluateDer;
-
-          function evaluateDer2
-            "Evaluate Bspline and its first and second derivatives at one parameter"
-            extends Modelica.Icons.Function;
-            input Data spline "Bspline to be evaluated";
-            input Real u "Parameter value at which Bspline shall be evaluated";
-            output Real x[spline.ndim] "Value of Bspline at u";
-            output Real xd[spline.ndim] "First derivative of Bspline at u";
-            output Real xdd[spline.ndim] "Second derivative of Bspline at u";
-          protected
-            Integer span;
-           Real N[3,spline.degree+1];
-          algorithm
-            x := zeros(spline.ndim);
-           xd := zeros(spline.ndim);
-           xdd := zeros(spline.ndim);
-
-           span := Utilities.n_findSpan(spline.degree,u,spline.knots);
-            N := Utilities.n_DersBasisFuns(span,u,spline.degree,2,spline.knots);
-
-            for i in 1:spline.ndim loop
-             x[i] := N[1,:]*spline.controlPoints[span-spline.degree:span,i];
-             xd[i] := N[2,:]*spline.controlPoints[span-spline.degree:span,i];
-             xdd[i] := N[3,:]*spline.controlPoints[span-spline.degree:span,i];
-            end for;
-          end evaluateDer2;
-
-          function evaluateDerN
-            "Evaluate k-th derivative of Bspline at one parameter"
-            extends Modelica.Icons.Function;
-            input Data spline "Bspline to be evaluated";
-            input Real u "Parameter value at which Bspline shall be evaluated";
-            input Integer k(min=0)
-              "Differentation order (0: function value, 1: first derivative, ...)";
-            output Real x_derN[spline.ndim] "k-th derivative of Bspline at u";
-
-          protected
-           Integer span;
-           Real N[k+1,spline.degree+1];
-          algorithm
-            x_derN := zeros(spline.ndim);
-
-           span := Utilities.n_findSpan(spline.degree,u,spline.knots);
-            N := Utilities.n_DersBasisFuns(span,u,spline.degree,k,spline.knots);
-
-            for i in 1:spline.ndim loop
-             x_derN[i] := N[k+1,:]*spline.controlPoints[span-spline.degree:span,i];
-            end for;
-
-          end evaluateDerN;
-
-          function init
-            "Initialize Bspline (end conditions are automatically selected, see docu)"
-            extends Modelica.Icons.Function;
-            input Real points[:, :]
-              "[i,:] is point i on the curve to be interpolated";
-            input Real param[size(points, 1)]
-              "parameterization of the data points (not necessarily in the range 0..1)";
-            input Integer degree(min=1) = 3
-              "Polynomial degree of interpolation (max number of points -1)";
-            input Boolean Bessel = true
-              "If true and degree=3, Bessel end condition is used";
-            output Data spline(
-              ndim=size(points, 2),
-              ncontrol=if Bessel and degree == 3 then size(points, 1) + 2 else
-                  size(points, 1),
-              degree=degree)
-              "Bspline in a form which can be quickly interpolated";
-          protected
-            Integer nknots=size(spline.knots, 1);
-            Integer ndim=size(points, 2);
-          algorithm
-            if (degree == 3 and Bessel) then
-             //Interpolation with Bessel end-conditions
-              spline :=
-                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Utilities.interpolationBessel(
-                points, param);
-            else
-              //Interpolation without specifying the end-conditions
-              spline :=
-                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Utilities.interpolation(
-                          points,
-                          param,
-                          degree);
-            end if;
-          end init;
-
-          function initDer
-            "Initialize Bspline which interpolates the points and first derivatives"
-            extends Modelica.Icons.Function;
-            input Real points[:, :]
-              "[i,:] is point i on the curve to be interpolated";
-            input Real derivs[size(points,1), size(points,2)]
-              "derivs[i,:] is the derivative at points[i,:]";
-            input Real param[size(points, 1)]
-              "parameterization of the data points (not necessarily in the range 0..1)";
-            input Integer degree(min=2) = 3 "Polynomial degree of interpolation (max: number of points -1)
-    at the moment degree=3 is supported";
-            output Data spline(
-              ndim=size(points, 2),
-              ncontrol=2*size(points, 1),
-              degree=degree)
-              "Bspline in a form which can be quickly interpolated";
-          protected
-            Integer nknots=size(spline.knots, 1);
-            Integer ndim=size(points, 2);
-          algorithm
-            spline := Utilities.interpolationder(
-                      points,
-                      derivs,
-                      param,
-                      degree);
-          end initDer;
-
-          function parametrization
-            "Automatic parameterization of a Bspline in the range 0..1 (if ndim > 1)"
-            extends Modelica.Icons.Function;
-            input Real points[:, :]
-              "[i,:] is point i on the curve to be interpolated";
-            input Integer paramType=ParametrizationType.Centripetal
-              "type of parametrization";
-            output Real param[size(points, 1)]
-              "parametrization of the data points";
-
-          protected
-          Real pi=3.141592653589;
-          Integer i;
-          Integer n_points;
-          Real d;
-          Real d_1[size(points, 2)];
-          Real d_2[size(points, 2)];
-          Real d_3[size(points, 2)];
-          Real phi_1;
-          Real phi_2;
-          Real lambda;
-          Real nu;
-          algorithm
-          //The following types of parametrization are described in the book of
-          //Gerald Farin, Curves and Surfaces in CAGD (page 161 'Finding a Knot
-          //Sequence'). For a comparison of the different parametrizations see
-          //the diploma thesis of Gerhard Schillhuber: 'Geometrische Modellierung
-          //oszillationsarmer Trajektorien von Industrierobotern (TU München)'
-          //(only available in german)
-          n_points := size(points,1);
-            if paramType == ParametrizationType.Equidistant then
-            //---EQUIDISTANT---
-            //the parameters are choosen equidistant
-              param := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.linspace(
-                                0, 1, size(points, 1));
-
-            elseif paramType == ParametrizationType.ChordLength then
-             param[1] := 0;
-            //---CHORD-LENGTH---
-            //the parameters are choosen proportional to the distances of the points
-              for i in 2:n_points loop
-                d := Utilities.norm(points[i,:] - points[i-1,:]);
-                param[i] := param[i-1]+d;
-              end for;
-              param := param / param[n_points];
-
-            elseif paramType == ParametrizationType.Centripetal then
-             param[1] := 0;
-            //---CENTRIPETAL---
-            //the idea of the centriptal parametrization is to minimize the centripetal
-            //force of an object moving on the curve.
-              for i in 2:n_points loop
-                d := Utilities.norm(points[i,:] - points[i-1,:]);
-                param[i] := param[i-1]+sqrt(d);
-              end for;
-              param := param / param[n_points];
-
-            elseif paramType == ParametrizationType.Foley then
-             param[1] := 0;
-            //---FOLEY---
-            //for computing the parameter the distances and the angle formed by the points
-            //are needed.
-
-              d_2 := (points[2,:] - points[1,:]);
-              d_3 := (points[3,:] - points[2,:]);
-              phi_2 := min(pi - acos((d_2 * d_3) / (Utilities.norm(d_2)*Utilities.norm(d_3))),pi/2);
-              d := Utilities.norm(d_2)*(1 +
-                  3/2 * phi_2 * Utilities.norm(d_3) / (Utilities.norm(d_2)+Utilities.norm(d_3)));
-              param[2] := param[1]+d;
-
-              for i in 3:n_points-1 loop
-                d_1 := (points[i-1,:] - points[i-2,:]);
-                d_2 := (points[i,:] - points[i-1,:]);
-                d_3 := (points[i+1,:] - points[i,:]);
-                phi_1 := min(pi - acos((d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2))),pi/2);
-                phi_2 := min(pi - acos((d_2 * d_3) / (Utilities.norm(d_2)*Utilities.norm(d_3))),pi/2);
-                d := Utilities.norm(d_2)*(1 +
-                    3/2 * phi_1 * Utilities.norm(d_1) / (Utilities.norm(d_1)+Utilities.norm(d_2)) +
-                    3/2 * phi_2 * Utilities.norm(d_3) / (Utilities.norm(d_2)+Utilities.norm(d_3)));
-
-                param[i] := param[i-1]+d;
-              end for;
-
-              d_1 := (points[n_points-1,:] - points[n_points-2,:]);
-              d_2 := (points[n_points,:] - points[n_points-1,:]);
-              phi_1 := min(pi - acos((d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2))),pi/2);
-              d := Utilities.norm(d_2)*(1 +
-                  3/2 * phi_1 * Utilities.norm(d_1) / (Utilities.norm(d_1)+Utilities.norm(d_2)));
-              param[n_points] := param[n_points-1]+d;
-
-              param := param / param[n_points];
-
-            elseif paramType == ParametrizationType.Angular then
-             param[1] := 0;
-            //---ANGULAR---
-            //this param. is like the Foley parametrization (distances and the angle
-            //are needed).
-             lambda := 1.5;
-              for i in 2:n_points-1 loop
-                d_1 := (points[i,:] - points[i-1,:]);
-                d_2 := (points[i+1,:] - points[i,:]);
-                phi_1 := acos((d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2)));
-
-                d := sqrt(Utilities.norm(d_1))*(1 + lambda*phi_1/pi);
-                param[i] := param[i-1]+d;
-              end for;
-              d_1 := (points[n_points-2,:] - points[n_points-1,:]);
-              d_2 := (points[n_points-1,:] - points[n_points,:]);
-              phi_1 := acos((d_2 * d_1) / (Utilities.norm(d_1)*Utilities.norm(d_2)));
-              d := sqrt(Utilities.norm(d_2))*(1 + lambda*phi_1/pi);
-              param[n_points] := param[n_points-1]+d;
-
-              param := param / param[n_points];
-
-            elseif paramType == ParametrizationType.AreaBased then
-             lambda := 2/3;
-            //---AREA-BASED---
-            //the parameters are choosen proportional to the area of the parallelograms
-            //formed by the points.
-              nu := 0.3;
-              param[1] := 0;
-              d_2 := (points[2,:] - points[1,:]);
-              d_3 := (points[3,:] - points[2,:]);
-              phi_2 := max(acos((-d_2 * d_3) / (Utilities.norm(d_2)*Utilities.norm(d_3))),pi/2);
-              d := nu*Utilities.norm(d_2) + (1-nu)*(sin(phi_2)*Utilities.norm(d_3)) / Utilities.norm(d_3);
-              param[2] := param[1]+d;
-
-              for i in 3:n_points-1 loop
-                d_1 := (points[i-1,:] - points[i-2,:]);
-                d_2 := (points[i,:] - points[i-1,:]);
-                d_3 := (points[i+1,:] - points[i,:]);
-                phi_1 := max(acos((-d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2))),pi/2);
-                phi_2 := max(acos((-d_2 * d_3) / (Utilities.norm(d_2)*Utilities.norm(d_3))),pi/2);
-
-                d := lambda*Utilities.norm(d_2) +
-                    (1-lambda)*(sin(phi_1)*Utilities.norm(d_1)+sin(phi_2)*Utilities.norm(d_3)) /
-                      (Utilities.norm(d_1)+Utilities.norm(d_3));
-                param[i] := param[i-1]+d;
-              end for;
-              d_1 := (points[n_points-1,:] - points[n_points-2,:]);
-              d_2 := (points[n_points,:] - points[n_points-1,:]);
-              phi_1 := max(acos((-d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2))),pi/2);
-              d := nu*Utilities.norm(d_2) + (1-nu)*(sin(phi_1)*Utilities.norm(d_1)) / Utilities.norm(d_1);
-              param[n_points] := param[n_points-1]+d;
-
-              param := param / param[n_points];
-
-            end if;
-          end parametrization;
-
-          function plot
-            "Plot Bspline curve (currently not fully functional, since feature in Dymola missing)"
-            extends Modelica.Icons.Function;
-            input Data spline "Bspline to be plotted";
-            input Integer npoints=100 "Number of points";
-            output Real x[npoints,spline.ndim+1]
-              "Table with u and function value at Bspline curve points";
-          algorithm
-
-          end plot;
-
-          package Utilities "Utility functions for package Bspline1D"
-
-            function interpolation
-              "Interpolation of the points with a Bspline of degree n"
-              extends Modelica.Icons.Function;
-              input Real points[:, :]
-                "[i,:] is point i on the curve to be interpolated";
-              input Real param[size(points, 1)]
-                "parameterization of the data points (not necessarily in the range 0..1)";
-              input Integer degree(min=1) = 3
-                "Polynomial degree of interpolation";
-              output Data spline(
-                ndim=size(points, 2),
-                ncontrol=size(points, 1),
-                degree=degree)
-                "Bspline in a form which can be quickly interpolated";
-            protected
-              Real ctrlp[spline.ncontrol,spline.ndim];
-              Real k[spline.ncontrol+degree+1];
-            algorithm
-
-             //old
-             //(ctrlp,k) := interpolation_raw(points,param,degree);
-             (ctrlp,k) := interpolation_bandmatrix(points,param,degree);
-
-             spline.controlPoints := ctrlp;
-             spline.knots := k;
-
-            end interpolation;
-
-            function interpolation_bandmatrix "Interpolation of the points with a Bspline of degree n. Do NOT return a Bspline struct.
-  Return the the raw information of control points and knots."
-              import U =
-                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Utilities;
-              extends Modelica.Icons.Function;
-              input Real points[:, :]
-                "[i,:] is point i on the curve to be interpolated";
-              input Real param[size(points, 1)]
-                "parameterization of the data points (not necessarily in the range 0..1)";
-              input Integer degree(min=1) = 3
-                "Polynomial degree of interpolation";
-              output Real controlPoints[size(points, 1),size(points, 2)]
-                "Control points";
-              output Real knots[size(points, 1)+degree+1] "knots";
-            protected
-              Integer nknots=size(knots, 1);
-              Integer ndim=size(points, 2);
-              Integer npoints;
-              Integer knots_tech;
-              //Real S[size(points,1),size(points,1)];
-
-              Real u;
-              Integer span;
-              Real evalBasisFuns[degree+1];
-              Real Band[3*degree+1,size(points,1)];
-              Integer kl = degree;
-              Integer ku = degree;
-              Integer info=0;
-              String sout;
-            algorithm
-              /*
-  The NURBS Book: Global Interpolation (page 364)
-  */
-              npoints := size(points,1);
-
-             // build the knots
-             //     1:  knots = parameter (for testing)
-             //     2:  knots are built with averaging
-             //     3:  knots equidistant (for testing)
-             knots_tech := 2;
-
-             if knots_tech == 1 then
-                knots[1:degree] := ones(degree)*param[1];
-                knots[degree+1:npoints+degree] := param;
-                knots[npoints+degree+1:npoints+2*degree] := ones(degree)*param[npoints];
-
-             end if;
-
-             if knots_tech == 2 then
-             // with averaging to avoid a singularity system of equation
-                knots[1:degree+1] := ones(degree+1)*param[1];
-                for j in 1:npoints-degree-1 loop
-                   knots[degree+j+1] := sum(param[j+1:j+degree])/degree;
-                end for;
-                knots[npoints+1:npoints+degree+1] := ones(degree+1)*param[npoints];
-
-             end if;
-
-             if knots_tech == 3 then
-                knots[1:degree+1] := ones(degree+1)*param[1];
-                for j in 1:npoints-1 loop
-                   knots[degree+j+1] := j/(npoints-1);
-                end for;
-                knots[npoints+degree+1:npoints+2*degree] := ones(degree)*param[npoints];
-
-             end if;
-
-             // build the equation system
-            // S := zeros(npoints,npoints);
-
-             for i in 1:npoints loop
-               u := param[i];
-               span := U.n_findSpan(degree,u,knots);
-               //S[i,span-degree:span] := n_BasisFuns(span,u,degree,knots);
-               evalBasisFuns := U.n_BasisFuns(span,u,degree,knots);
-
-               for j in 1:degree+1 loop
-                 Band[kl+1+ku+i-span+degree-j+1,span-degree+j-1]:=evalBasisFuns[j];
-            //Band[kl+1+ku+i-span+degree-j+1,span-degree+j-1]:=10*i+span-degree-1+j;
-
-               end for;
-
-             end for;
-
-            /*
-for i in 1:npoints loop
-    sout :="i = " + String(i) + ":";
-    for j in 1:degree+1 loop
-      sout :=sout + "   " + String(Band[j, i]);
-    end for;
-    Utilities.ModelicaMessage(sout + "\n");
-end for;
-*/
-
-             // solve the equation system
-              (controlPoints,info) :=
-                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Utilities.solveBandedWithMatrix(
-                            kl,
-                            ku,
-                            Band,
-                            points);
-             // assert(info == 0, "Error when computing spline coefficients");
-
-            if info <> 0 then
-              // if solving with band matrix is not succesful, use full matrix
-              (controlPoints,knots) := U.interpolation_raw(points,param,degree);
-
-            end if;
-
-            end interpolation_bandmatrix;
-
-            function interpolation_raw "Interpolation of the points with a Bspline of degree n. Do NOT return a Bspline struct.
-  Return the the raw information of control points and knots."
-            //  import Modelica_Interpolation;
-              extends Modelica.Icons.Function;
-              input Real points[:, :]
-                "[i,:] is point i on the curve to be interpolated";
-              input Real param[size(points, 1)]
-                "parameterization of the data points (not necessarily in the range 0..1)";
-              input Integer degree(min=1) = 3
-                "Polynomial degree of interpolation";
-              output Real controlPoints[size(points, 1),size(points, 2)]
-                "Control points";
-              output Real knots[size(points, 1)+degree+1] "knots";
-            protected
-              Integer nknots=size(knots, 1);
-              Integer ndim=size(points, 2);
-              Integer npoints;
-              Integer knots_tech;
-              Real S[size(points,1),size(points,1)];
-              Real u;
-              Integer span;
-            algorithm
-              /*
-  The NURBS Book: Global Interpolation (page 364)
-  */
-              npoints := size(points,1);
-
-             // build the knots
-             //     1:  knots = parameter (for testing)
-             //     2:  knots are built with averaging
-             //     3:  knots equidistant (for testing)
-             knots_tech := 2;
-
-             if knots_tech == 1 then
-                knots[1:degree] := ones(degree)*param[1];
-                knots[degree+1:npoints+degree] := param;
-                knots[npoints+degree+1:npoints+2*degree] := ones(degree)*param[npoints];
-
-             end if;
-
-             if knots_tech == 2 then
-             // with averaging to avoid a singularity system of equation
-                knots[1:degree+1] := ones(degree+1)*param[1];
-                for j in 1:npoints-degree-1 loop
-                   knots[degree+j+1] := sum(param[j+1:j+degree])/degree;
-                end for;
-                knots[npoints+1:npoints+degree+1] := ones(degree+1)*param[npoints];
-
-             end if;
-
-             if knots_tech == 3 then
-                knots[1:degree+1] := ones(degree+1)*param[1];
-                for j in 1:npoints-1 loop
-                   knots[degree+j+1] := j/(npoints-1);
-                end for;
-                knots[npoints+degree+1:npoints+2*degree] := ones(degree)*param[npoints];
-
-             end if;
-
-             // build the equation system
-             S := zeros(npoints,npoints);
-
-             for i in 1:npoints loop
-               u := param[i];
-               span := n_findSpan(degree,u,knots);
-               S[i,span-degree:span] := n_BasisFuns(span,u,degree,knots);
-
-             end for;
-
-             // solve the equation system
-              controlPoints :=
-                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Utilities.solveMatrix(
-                S, points);
-
-            end interpolation_raw;
-
-            function interpolationBessel
-              "Interpolation of the points with a Bspline of degree 3 and Bessel end condition"
-            //  import Modelica_Interpolation;
-              extends Modelica.Icons.Function;
-              input Real points[:, :]
-                "[i,:] is point i on the curve to be interpolated";
-              input Real param[size(points, 1)]
-                "parameterization of the data points (not necessarily in the range 0..1)";
-              output Data Bspline(
-                ndim=size(points, 2),
-                ncontrol=(size(points, 1) + 2),
-                degree=3) "Bspline in a form which can be quickly interpolated";
-            protected
-              Integer ndim=size(points, 2);
-              Real S[size(points,1)-2,size(points,1)-2];
-              Real u;
-              Real u2;
-              Real nik[4];
-              Real nik2[4];
-              Integer degree;
-              Real knots[size(points,1)+2*3];
-              Integer n_data;
-              Real alpha;
-              Real beta;
-              Real a[ndim];
-              Real rs[        ndim];
-              Real re[                 ndim];
-              Real p_vec[Bspline.ncontrol-4,Bspline.ndim];
-              Integer span;
-            algorithm
-              /*
-  Farin: Curves and Surfaces for CAGD (page 157)
-  */
-              degree := 3;
-
-             n_data := size(points,1);
-
-             //build the knots
-
-             knots[1:degree] := ones(3)*param[1];
-             knots[degree+1:n_data+degree] := param;
-             knots[n_data+degree+1:n_data+2*degree] := ones(3)*param[n_data];
-
-              Bspline.controlPoints := zeros(n_data+2,Bspline.ndim);
-             Bspline.controlPoints[1,:] := points[1,:];
-             Bspline.controlPoints[n_data+2,:] := points[n_data,:];
-
-             alpha := (param[3]-param[2])/(param[3]-param[1]);
-             beta := 1-alpha;
-             a := (points[2,:] - (alpha^2)*points[1,:] - (beta^2)*points[3,:])/(2*alpha*beta);
-             Bspline.controlPoints[2,:] := (2/3)*(alpha*points[1,:] + beta*a) + points[1,:]/3;
-
-             alpha := (param[n_data-2]-param[n_data-1])/(param[n_data-2]-param[n_data]);
-             beta := (1-alpha);
-             a := (points[n_data-1,:] - (alpha^2)*points[n_data,:] - (beta^2)*points[n_data-2,:])/(2*alpha*beta);
-             Bspline.controlPoints[n_data+1,:] := (2/3)*(alpha*points[n_data,:] + beta*a) + points[n_data,:]/3;
-
-             // build the equation system
-             S := zeros(n_data-2,n_data-2);
-
-             u2 := param[2];
-             span := n_findSpan(degree,u2,knots);
-             nik2 := n_BasisFuns(span,u2,degree,knots);
-             S[1,1:2] := nik2[2:3];
-             rs := points[2,:] - Bspline.controlPoints[2,:]*nik2[1];
-
-             for i in 1:n_data-4 loop
-               u := param[i+2];
-               span := n_findSpan(degree,u,knots);
-              nik := n_BasisFuns(span,u,degree,knots);
-               S[i+1,i:i+2] := nik[1:3];
-
-             end for;
-             u := param[n_data-1];
-             span := n_findSpan(degree,u,knots);
-             nik := n_BasisFuns(span,u,degree,knots);
-             S[n_data-2,n_data-3:n_data-2] := nik[1:2];
-
-             re := points[n_data-1,:] - Bspline.controlPoints[n_data+1,:]*nik[3];
-             p_vec[1,:] := rs;
-             p_vec[2:n_data-3,:] := points[3:n_data-2,:];
-             p_vec[n_data-2,:] := re;
-
-             // solve the equation system
-              Bspline.controlPoints[3:n_data, :] :=
-                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Utilities.solveMatrix(
-                S, p_vec);
-
-             Bspline.knots := knots;
-
-            end interpolationBessel;
-
-            function interpolationder
-              "Interpolation of the points and its first derivatives with a Bspline of degree n"
-            //  import Modelica_Interpolation;
-              extends Modelica.Icons.Function;
-              input Real points[:, :]
-                "[i,:] is point i on the curve to be interpolated";
-              input Real derivs[size(points,1), size(points,2)]
-                "derivs[i,:] is the derivative at points[i,:]";
-              input Real param[size(points, 1)]
-                "parameterization of the data points (not necessarily in the range 0..1)";
-              input Integer degree(min=2) = 3
-                "Polynomial degree of interpolation";
-              output Data spline(
-                ndim=size(points, 2),
-                ncontrol=2*size(points, 1),
-                degree=degree)
-                "Bspline in a form which can be quickly interpolated";
-            protected
-              Integer nknots=size(spline.knots, 1);
-              Integer ndim=size(points, 2);
-              Integer npoints;
-              Integer i;
-              Integer k;
-              Real S[2*size(points,1),2*size(points,1)];
-              Real u;
-              Real b[2*size(points,1),size(points, 2)];
-              Integer span;
-              Real N[2,degree+1];
-            algorithm
-              /*
-  The NURBS Book: Global Interpolation (page 373)
-
-  */
-              npoints := size(points,1);
-
-             // compute the knots
-             // the goal is a banded linear system
-
-             k :=  integer(degree/2);
-             spline.knots[1:degree+1] := ones(degree+1)*param[1];
-
-             if degree == 2*k then
-               //degree is even
-               k := k-1;
-
-               for j in 1:k loop
-               spline.knots[degree+1+j] := param[j+1];
-
-              end for;
-
-              for j in 1:npoints-(k+1) loop
-                spline.knots[degree+k+2*j] := (param[j+k]+param[j+k+1])/2;
-                spline.knots[degree+k+2*j+1] := param[j+k+1];
-
-              end for;
-
-              for j in 1:k loop
-               spline.knots[2*npoints-k+j] := param[npoints-k+j-1];
-
-              end for;
-
-             else
-               //degree is odd
-
-              for j in 1:k loop
-               spline.knots[degree+1+j] := spline.knots[degree+1] + j*(param[k+1]-param[1])/k;
-
-              end for;
-
-              for j in 1:npoints-(k+1) loop
-                spline.knots[degree+k+2*j] := (2*param[j+k]+param[j+k+1])/3;
-                spline.knots[degree+k+2*j+1] := (param[j+k]+2*param[j+k+1])/3;
-
-              end for;
-
-              for j in 1:k loop
-               spline.knots[2*npoints-k+j] := spline.knots[2*npoints-k] + j*(param[npoints]-param[npoints-k])/k;
-
-              end for;
-
-             end if;
-
-             spline.knots[2*npoints+1:2*npoints+degree+1] := ones(degree+1)*param[npoints];
-
-             // build the equation system
-             S := zeros(2*npoints,2*npoints);
-
-             for i in 1:npoints loop
-               u := param[i];
-               span := n_findSpan(spline.degree,u,spline.knots);
-               N := Utilities.n_DersBasisFuns(span,u,spline.degree,1,spline.knots);
-               S[2*i-1:2*i,span-spline.degree:span] := N;
-               b[2*i-1,:] := points[i,:];
-              b[2*i,:] := derivs[i,:];
-
-             end for;
-
-             // solve the equation system
-              spline.controlPoints :=
-                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Utilities.solveMatrix(
-                S, b);
-            end interpolationder;
-
-            function n_BasisFuns "Compute the nonvanishing basis functions"
-             extends Modelica.Icons.Function;
-              input Integer i "index";
-              input Real u "parameter";
-              input Integer p "degree";
-              input Real knots[:] "knot vector";
-              output Real N[p+1] "Basis functions";
-            protected
-              Integer j;
-              Integer r;
-              Real left[p+1];
-              Real right[p+1];
-              Real temp;
-              Real saved;
-            algorithm
-             /*
-  The NURBS Book: Algorithm A2.2 (page 70)
-  */
-              N[1] := 1;
-              for j in 1:p loop
-               left[j] := u - knots[i+1-j];
-               right[j] := knots[i+j] - u;
-               saved := 0.0;
-
-               for r in 1:j loop
-                temp := N[r]/(right[r]+left[j-r+1]);
-                N[r] := saved + right[r]*temp;
-                saved := left[j-r+1]*temp;
-
-              end for;
-              N[j+1] := saved;
-              end for;
-            end n_BasisFuns;
-
-            function n_DersBasisFuns
-              "Compute nonzero basis functions and their derivatives"
-             extends Modelica.Icons.Function;
-              input Integer i "index";
-              input Real u "parameter";
-              input Integer p "degree";
-              input Integer n "n-th derivative";
-              input Real knots[:] "knot vector";
-              output Real ders[n+1,p+1] "ders[k,:] is (k-1)-th derivative";
-            protected
-              Integer j;
-              Integer r;
-              Real left[p+1];
-              Real right[p+1];
-              Real temp;
-              Real saved;
-              Real ndu[p+1,p+1];
-              Integer s1;
-              Integer s2;
-              Integer j1;
-              Integer j2;
-              Real a[2,p+1];
-              Real d;
-              Integer rk;
-              Integer pk;
-              Integer prod;
-              Integer tt;
-            algorithm
-             /*
-  The NURBS Book: Algorithm A2.3 (page 72)
-  */
-              ndu[1,1] := 1;
-              for j in 1:p loop
-               left[j] := u - knots[i+1-j];
-               right[j] := knots[i+j] - u;
-               saved := 0.0;
-
-               for r in 1:j loop
-                ndu[j+1,r] := right[r]+left[j-r+1];
-                temp := ndu[r,j]/ndu[j+1,r];
-                ndu[r,j+1] := saved + right[r]*temp;
-                saved := left[j-r+1]*temp;
-
-              end for;
-              ndu[j+1,j+1] := saved;
-              end for;
-
-              for j in 1:p+1 loop
-               ders[1,j] := ndu[j,p+1];
-              end for;
-
-              for r in 1:p+1 loop
-               s1 := 1;
-               s2 := 2;
-               a[1,1] := 1.0;
-
-               for k in 1:n loop
-                d := 0.0;
-                rk := r-k-1;
-                pk := p-k;
-
-                if r-1>=k then
-                 a[s2,1] := a[s1,1]/ndu[pk+2,rk+1];
-                 d := a[s2,1]*ndu[rk+1,pk+1];
-
-                end if;
-
-                if rk >= -1 then
-                 j1 :=1;
-
-                else
-                 j1 :=-rk;
-
-                end if;
-
-                if r-1 <= pk+1 then
-                 j2 := k-1;
-
-                else
-                 j2 := p-r+1;
-
-                end if;
-
-                for j in j1:j2 loop
-                 a[s2,j+1] :=(a[s1, j + 1] - a[s1, j])/ndu[pk + 2, rk + j + 1];
-                 d :=d + a[s2, j + 1]*ndu[rk + j + 1, pk + 1];
-
-                end for;
-
-                if r-1 <= pk then
-                 a[s2,k+1] := -a[s1,k]/ndu[pk+2,r];
-                 d := d + a[s2,k+1]*ndu[r,pk+1];
-
-                end if;
-
-                ders[k+1,r] := d;
-                tt := s1;
-                s1 := s2;
-                s2 := tt;
-
-               end for;
-              end for;
-
-              prod := p;
-
-             for k in 1:n loop
-
-               for j in 1:p+1 loop
-                ders[k+1,j] := ders[k+1,j]*prod;
-
-               end for;
-               prod := prod*(p-k);
-
-             end for;
-
-            end n_DersBasisFuns;
-
-            function n_findSpan "Determine the knot span index"
-             extends Modelica.Icons.Function;
-              input Integer p "degree";
-              input Real u "parameter";
-              input Real knots[:] "knot vector";
-              output Integer i "The knot span index";
-            protected
-              Integer n;
-              Integer low;
-              Integer high;
-              Integer mid;
-            algorithm
-             /*
-  The NURBS Book: Algorithm A2.1 (page 68)
-  */
-              n:=size(knots,1)-p-1;
-
-             if abs(u-knots[n+1])<10e-12 then
-              i := n;
-
-             else
-              low := p;
-              high := n+1;
-              mid := integer((low+high)/2);
-
-              while
-                   (u<knots[mid] or u>=knots[mid+1]) loop
-                   assert(low+1<high,"Value must be within limits for Bspline1D.Utilities.n_findSpan");
-
-               if (u<knots[mid]) then
-                 high := mid;
-
-               else
-                 low := mid;
-
-               end if;
-               mid := integer((low+high)/2);
-
-              end while;
-              i := mid;
-
-             end if;
-            end n_findSpan;
-
-            function norm "The euklidian norm of a vector"
-             extends Modelica.Icons.Function;
-              input Real v[:] "A vector";
-              output Real n "The norm of the vector";
-            algorithm
-              n:=sqrt(v*v);
-            end norm;
-          annotation (
-            Window(
-              x=0.45,
-              y=0.01,
-              width=0.44,
-              height=0.65,
-              library=1,
-              autolayout=1),
-            Documentation(info="<HTML>
-<p>
-Utility functions are provided here which are usually not called directly
-by a user, but are needed in the functions of this package
-</p>
-<p>
-The following functions are supported:
-</p>
-<pre>
-  interpolation          Compute the interpolation Bspline
-  interpolation_raw      Compute the interpolation Bspline, but only return the control points
-                                                                                           and the knots
-  interpolationBessel    Compute the interpolation Bspline with Bessel end-conditions
-  interpolationDer       Compute the interpolation Bspline when the first derivative are given
-  n_BasisFuns            Compute the non zero basis functions of the Bspline
-  n_DersBasisFuns        Compute the non zero basis functions and their derivatives
-  n_findSpan             Compute the interval in which the parameter lies
-  norm                   The euklidian norm of a vector
-</pre>
-<p><b>Release Notes:</b></p>
-<ul>
-<li><i>Sept. 13, 2002</i>
-       by Gerhard Schillhuber:<br>
-       first version implemented
-</li>
-<li><i>Oct. 17, 2002</i>
-       by Gerhard Schillhuber:<br>
-       new function: interpolation_raw. return only the control points and the knots.
-                       'interpolation' calls 'interpolation_raw'.
-</li>
-</ul>
-<br>
-<p><b>Copyright (C) 2002, Modelica Association and DLR.</b></p>
-<p><i>
-This package is <b>free</b> software. It can be redistributed and/or modified
-under the terms of the <b>Modelica license</b>, see the license conditions
-and the accompanying <b>disclaimer</b> in the documentation of package
-Modelica in file \"Modelica/package.mo\".
-</i></p>
-</HTML>
-"));
-          end Utilities;
-        annotation (
-          Window(
-            x=0.45,
-            y=0.01,
-            width=0.44,
-            height=0.65,
-            library=1,
-            autolayout=1),
-          Documentation(info="<HTML>
-<p>
-With this package 1-dimensional interpolation with B-Splines
-is performed.
-</p>
-<p>
-The following functions are supported:
-</p>
-<pre>
-  init          Initialize interpolation
-  initDer       Initialize interpolation (points and first derivatives are given)
-  evaluate      Determine data at one point by interpolation
-  evaluateDer   Determine data and first derivative at one point by interpolation
-  evaluateDer2  Determine data, first and second derivative at one point by interpolation
-  evaluateDerN  Determine the n-th derivative at one point by interpolation
-  plot          Compute all data needed to make a nice plot of the data and plot it
-                (since in Dymola plotArray cannot be called in a function, currently
-                just the plot data is computed and returned. In a calling script
-                this data can be used to plot it with operator plotArray).
-</pre>
-<p><b>Release Notes:</b></p>
-<ul>
-<li><i>Sept. 13, 2002</i>
-       by Gerhard Schillhuber:<br>
-       first version implemented
-</li>
-</ul>
-<br>
-<p><b>Copyright (C) 2002, Modelica Association and DLR.</b></p>
-<p><i>
-This package is <b>free</b> software. It can be redistributed and/or modified
-under the terms of the <b>Modelica license</b>, see the license conditions
-and the accompanying <b>disclaimer</b> in the documentation of package
-Modelica in file \"Modelica/package.mo\".
-</i></p>
-</HTML>
-"));
-        end Bspline1D;
-
-        package Utilities "Utility functions for package Interpolation"
-
-          function curveLength "Computes the length of the curve from a to b"
-            import
-              ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation;
-           extends Modelica.Icons.Function;
-           input Modelica_Interpolation.Bspline1D.Data                                         spline
-              "Bspline data";
-           input Real a "left end";
-           input Real b "right end";
-           input Real err = 1e-8 "relative error";
-           output Real I "curve length from a to b";
-
-          protected
-            Real m;
-            Real h;
-            Real alpha;
-            Real beta;
-            Real x1 = 0.942882415695480;
-            Real x2 = 0.641853342345781;
-            Real x3 = 0.236383199662150;
-           Real x[13];
-           Real y[13];
-           Real fa;
-           Real fb;
-           Real i1;
-           Real i2;
-           Real is;
-           Real erri1;
-           Real erri2;
-           Real R;
-           Real tol;
-           Real eps = 1e-16;
-           Integer s;
-
-          package internal "Funtions to be used only in function curveLength"
-              import
-                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation;
-
-           function quadStep "Recursive function used by curveLength"
-            input ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Data
-                  spline;
-            input Real a "right interval end";
-            input Real b "left interval end";
-            input Real fa "function value at a";
-            input Real fb "function value at b";
-            input Real is "first approximation of the integral";
-            output Real I "Integral value";
-              protected
-            Real m;
-            Real h;
-            Real alpha;
-            Real beta;
-            Real x[5];
-            Real y[5];
-            Real mll;
-            Real ml;
-            Real mr;
-            Real mrr;
-            Real fmll;
-            Real fml;
-            Real fm;
-            Real fmr;
-            Real fmrr;
-            Real i1;
-            Real i2;
-           algorithm
-             h := (b-a)/2; m := (a+b)/2;
-             alpha := sqrt(2/3); beta := 1/sqrt(5);
-             mll := m-alpha*h; ml := m-beta*h; mr := m+beta*h; mrr := m+alpha*h;
-             x := {mll,ml,m,mr,mrr};
-             y := eval(spline,x);
-             fmll := y[1]; fml := y[2]; fm := y[3]; fmr := y[4]; fmrr := y[5];
-             i2 := (h/6)*(fa+fb+5*(fml+fmr));
-             i1 := (h/1470)*(77*(fa+fb)+432*(fmll+fmrr)+625*(fml+fmr)
-                +672*fm);
-
-             if
-               (is+(i1-i2)==is) or (mll<=a) or (b<=mrr) then
-               I := i1;
-
-             else
-               I := quadStep(spline,a,mll,fa,fmll,is)+
-                 quadStep(spline,mll,ml,fmll,fml,is)+
-                 quadStep(spline,ml,m,fml,fm,is)+
-                 quadStep(spline,m,mr,fm,fmr,is)+
-                 quadStep(spline,mr,mrr,fmr,fmrr,is)+
-                 quadStep(spline,mrr,b,fmrr,fb,is);
-
-             end if;
-           end quadStep;
-
-           function eval "evaluate the integrand"
-             input Modelica_Interpolation.Bspline1D.Data spline "Bspline data";
-             input Real u[:]
-                  "parameters at which the integrand shall be evaluated";
-             output Real f[size(u,1)];
-              protected
-             Real xd[spline.ndim];
-             Integer n;
-           algorithm
-             //the integrand is sqrt(xd*xd) (where xd is the first derivative)
-            n := size(u,1);
-
-            for i in 1:n loop
-              xd := Modelica_Interpolation.Bspline1D.evaluateDerN(spline,u[i],1);
-             f[i] := sqrt(xd*xd);
-
-            end for;
-           end eval;
-          end internal;
-
-          algorithm
-           /*
-        Numerically evaluate integral using adaptive
-        Lobatto rule.
-        see Walter Gander: Adaptive Quadrature - Revisited, 1998
-                        ftp.inf.ethz.ch in doc/tech-reports/1998/306.ps
-
-        x[:] are the nodes
-        y[:] = f(x[:]) are function values at the nodes
-                here (arc length computation): the integrand f is the
-                absolute value of the first derivative of the curve (Bspline)
-        */
-           tol := err;
-            m := (a+b)/2; h:=(b - a)/2;
-            alpha := sqrt(2/3); beta:=1/sqrt(5);
-            x := {a,m-x1*h,m-alpha*h,m-x2*h,m-beta*h,m-x3*h,m,m+x3*h,
-                  m+beta*h,m+x2*h,m+alpha*h,m+x1*h,b};
-            y := internal.eval(spline,x);
-            fa := y[1]; fb := y[13];
-            i2 := (h/6)*(y[1]+y[13]+5*(y[5]+y[9]));
-            i1 := (h/1470)*(77*(y[1]+y[13])+432*(y[3]+y[11])+
-               625*(y[5]+y[9])+672*y[7]);
-            is := h*(0.0158271919734802*(y[1]+y[13])+0.0942738402188500
-               *(y[2]+y[12])+0.155071987336585*(y[3]+y[11])+0.188821573960182
-                               *(y[4]+y[10])+0.199773405226859
-               *(y[5]+y[9])+0.224926465333340*(y[6]+y[8])
-               +0.242611071901408*y[7]);
-            s := sign(is);
-            if
-              (s==0) then s := 1; end if;
-            erri1 := abs(i1-is);
-            erri2 := abs(i2-is);
-            R := 1;
-            if
-              (erri2<>0) then R := erri1/erri2; end if;
-            if
-              (R>0 and R<1) then tol := tol/R; end if;
-            is := s*abs(is)*tol/eps;
-            if
-              (is==0) then is := b-a; end if;
-            I := internal.quadStep(spline,a,b,fa,fb,is);
-
-          end curveLength;
-
-          function dgbsv
-            "Solve real system of linear equations A*X=B with a banded A matrix and a B matrix (copy from protected package Matrices.Lapack)"
-            extends Modelica.Icons.Function;
-                input Integer n "Number of equations";
-                input Integer kLower "Number of lower bands";
-                input Integer kUpper "Number of upper bands";
-                input Real A[2*kLower + kUpper + 1, n];
-                input Real B[n, :];
-                output Real X[n, size(B, 2)]=B;
-                output Integer info;
-
-          protected
-                Real Awork[size(A, 1), size(A, 2)]=A;
-                Integer ipiv[n];
-
-              external "FORTRAN 77" dgbsv(n, kLower, kUpper, size(B, 2), Awork, size(
-                  Awork, 1), ipiv, X, n, info) annotation (Library="Lapack");
-                annotation (
-                  Documentation(info="Lapack documentation:
-Purpose
-=======
-DGBSV computes the solution to a real system of linear equations
-A * X = B, where A is a band matrix of order N with KL subdiagonals
-and KU superdiagonals, and X and B are N-by-NRHS matrices.
-The LU decomposition with partial pivoting and row interchanges is
-used to factor A as A = L * U, where L is a product of permutation
-and unit lower triangular matrices with KL subdiagonals, and U is
-upper triangular with KL+KU superdiagonals.  The factored form of A
-is then used to solve the system of equations A * X = B.
-Arguments
-=========
-N       (input) INTEGER
-        The number of linear equations, i.e., the order of the
-        matrix A.  N >= 0.
-KL      (input) INTEGER
-        The number of subdiagonals within the band of A.  KL >= 0.
-KU      (input) INTEGER
-        The number of superdiagonals within the band of A.  KU >= 0.
-NRHS    (input) INTEGER
-        The number of right hand sides, i.e., the number of columns
-        of the matrix B.  NRHS >= 0.
-AB      (input/output) DOUBLE PRECISION array, dimension (LDAB,N)
-        On entry, the matrix A in band storage, in rows KL+1 to
-        2*KL+KU+1; rows 1 to KL of the array need not be set.
-        The j-th column of A is stored in the j-th column of the
-        array AB as follows:
-        AB(KL+KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+KL)
-        On exit, details of the factorization: U is stored as an
-        upper triangular band matrix with KL+KU superdiagonals in
-        rows 1 to KL+KU+1, and the multipliers used during the
-        factorization are stored in rows KL+KU+2 to 2*KL+KU+1.
-        See below for further details.
-LDAB    (input) INTEGER
-        The leading dimension of the array AB.  LDAB >= 2*KL+KU+1.
-IPIV    (output) INTEGER array, dimension (N)
-        The pivot indices that define the permutation matrix P;
-        row i of the matrix was interchanged with row IPIV(i).
-B       (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
-        On entry, the N-by-NRHS right hand side matrix B.
-        On exit, if INFO = 0, the N-by-NRHS solution matrix X.
-LDB     (input) INTEGER
-        The leading dimension of the array B.  LDB >= max(1,N).
-INFO    (output) INTEGER
-        = 0:  successful exit
-        < 0:  if INFO = -i, the i-th argument had an illegal value
-        > 0:  if INFO = i, U(i,i) is exactly zero.  The factorization
-              has been completed, but the factor U is exactly
-              singular, and the solution has not been computed.
-Further Details
-===============
-The band storage scheme is illustrated by the following example, when
-M = N = 6, KL = 2, KU = 1:
-On entry:                       On exit:
-    *    *    *    +    +    +       *    *    *   u14  u25  u36
-    *    *    +    +    +    +       *    *   u13  u24  u35  u46
-    *   a12  a23  a34  a45  a56      *   u12  u23  u34  u45  u56
-   a11  a22  a33  a44  a55  a66     u11  u22  u33  u44  u55  u66
-   a21  a32  a43  a54  a65   *      m21  m32  m43  m54  m65   *
-   a31  a42  a53  a64   *    *      m31  m42  m53  m64   *    *
-Array elements marked * are not used by the routine; elements marked
-+ need not be set on entry, but are required by the routine to store
-elements of U because of fill-in resulting from the row interchanges."),
-                  Window(
-                    x=0.4,
-                    y=0.4,
-                    width=0.6,
-                    height=0.6));
-          end dgbsv;
-
-          function dgesv
-            "Solve real system of linear equations A*X=B with a B matrix (copy from protected package Matrices.Lapack)"
-            extends Modelica.Icons.Function;
-            input Real A[:, size(A, 1)];
-            input Real B[size(A, 1), :];
-            output Real X[size(A, 1), size(B, 2)]=B;
-            output Integer info;
-          protected
-            Real Awork[size(A, 1), size(A, 1)]=A;
-            Integer ipiv[size(A, 1)];
-
-          external "FORTRAN 77" dgesv(size(A, 1), size(B, 2), Awork, size(A, 1), ipiv,
-               X, size(A, 1), info) annotation (Library="Lapack");
-            annotation (
-              Documentation(info="Lapack documentation:
-    Purpose
-    =======
-    DGESV computes the solution to a real system of linear equations
-       A * X = B,
-    where A is an N-by-N matrix and X and B are N-by-NRHS matrices.
-    The LU decomposition with partial pivoting and row interchanges is
-    used to factor A as
-       A = P * L * U,
-    where P is a permutation matrix, L is unit lower triangular, and U is
-
-    upper triangular.  The factored form of A is then used to solve the
-    system of equations A * X = B.
-    Arguments
-    =========
-    N       (input) INTEGER
-            The number of linear equations, i.e., the order of the
-            matrix A.  N >= 0.
-    NRHS    (input) INTEGER
-            The number of right hand sides, i.e., the number of columns
-            of the matrix B.  NRHS >= 0.
-    A       (input/output) DOUBLE PRECISION array, dimension (LDA,N)
-            On entry, the N-by-N coefficient matrix A.
-            On exit, the factors L and U from the factorization
-            A = P*L*U; the unit diagonal elements of L are not stored.
-    LDA     (input) INTEGER
-            The leading dimension of the array A.  LDA >= max(1,N).
-    IPIV    (output) INTEGER array, dimension (N)
-            The pivot indices that define the permutation matrix P;
-            row i of the matrix was interchanged with row IPIV(i).
-    B       (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
-            On entry, the N-by-NRHS matrix of right hand side matrix B.
-            On exit, if INFO = 0, the N-by-NRHS solution matrix X.
-    LDB     (input) INTEGER
-            The leading dimension of the array B.  LDB >= max(1,N).
-    INFO    (output) INTEGER
-            = 0:  successful exit
-            < 0:  if INFO = -i, the i-th argument had an illegal value
-            > 0:  if INFO = i, U(i,i) is exactly zero.  The factorization
-
-                  has been completed, but the factor U is exactly
-                  singular, so the solution could not be computed.
-"),           Window(
-                x=0.4,
-                y=0.4,
-                width=0.6,
-                height=0.6));
-          end dgesv;
-
-          function dummy "Dummy Bspline"
-            // import Modelica_Interpolation;
-           extends Modelica.Icons.Function;
-            input Integer nd "Dimension";
-            input Integer nc "Number of control points";
-            input Integer deg "degree";
-            output
-              ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Data
-              spline(
-              ndim=nd,
-              ncontrol=nc,
-              degree=deg) "A dummy Bspline with zero entries";
-          protected
-            Integer j;
-          algorithm
-            j:=1;
-          end dummy;
-
-          function getNumberControlPoints "Return the number of control points"
-           extends Modelica.Icons.Function;
-            input Real r[:, :]
-              "r[i,:] is position vector to point i on the curve";
-            input Integer degree "degree of the Bspline";
-            output Integer ncontrol "number of control points";
-          protected
-            Integer n;
-            Integer multi;
-            Integer begin;
-            Real delta[size(r,2)];
-            Integer j;
-            Integer jstart;
-          algorithm
-           n := size(r,1);
-
-           //delete multiple start data points
-           multi := 1;
-
-           for j in 1:n-1 loop
-            delta := r[1,:] - r[1+j,:];
-
-            if sqrt(delta*delta) < 1e-12 then
-             multi := multi + 1;
-
-            end if;
-
-           end for;
-           begin := multi;
-
-           //delete multiple end data points
-           multi := 0;
-
-           for j in 1:n-1 loop
-            delta := r[n,:] - r[n-j,:];
-
-            if sqrt(delta*delta) < 1e-12 then
-             multi := multi + 1;
-
-            end if;
-
-           end for;
-           n := n-multi;
-
-           ncontrol := n;
-           jstart := begin;
-
-           for j in begin+1:n-1 loop
-             delta := r[j,:] - r[j-1,:];
-
-             if sqrt(delta*delta) < 1e-12 then
-
-               if j-1-jstart >= 1 and j-1-jstart < degree then
-                 //an interpolation with a Bspline of degree = p needs
-                 //p+1 data points. If there are less than p+1, insert
-                 //virtual data points to get p+1.
-               ncontrol := ncontrol + degree - (j-1 - jstart);
-
-              end if;
-              jstart := j;
-              delta := r[j+1,:] - r[j,:];
-
-              if sqrt(delta*delta) < 1e-12 then
-               //triple data point; delete one data point
-               ncontrol := ncontrol - 1;
-               jstart := j+1;
-
-              end if;
-
-             end if;
-            end for;
-
-            //end
-            if n-jstart < degree then
-             ncontrol := ncontrol + degree - (n-jstart);
-            end if;
-
-           //multiple start data points
-           ncontrol := ncontrol - begin + 1;
-
-           //if Bessel and degree==3 then size(r, 1)+2 else size(r, 1)
-
-          end getNumberControlPoints;
-
-          function getNumberControlPoints2
-            "Return the number of control points"
-           extends Modelica.Icons.Function;
-            input Real r[:, :]
-              "r[i,:] is position vector to point i on the curve";
-            input Real T[size(r, 1), 3, 3]
-              "T[i,:,:] is transformation matrix from base frame to path frame at point i";
-            input Integer degree "degree of the Bspline";
-            output Integer ncontrol "number of control points";
-          protected
-           Integer n;
-            Real data[size(r,1),7];
-            Real q[4];
-            Real q_old[     4];
-          algorithm
-           n := size(r,1);
-
-           data := zeros(size(r,1),7);
-            data[:,1:3] := r;
-
-            // T2Quat
-            // Get the quaternions of the transformation matrix
-            // Choose the quaternions (+q or -q) which form the smallest angle with
-            // the previous quaternions
-            for i in 1:size(r,1) loop
-              q := T2quat(T[i, :, :]);
-
-             if (i > 1 and (q_old*q) < 0) then
-                q := -q;
-
-            end if;
-            data[i,4:7] := q;
-            q_old := q;
-            end for;
-
-            ncontrol := getNumberControlPoints(data,degree);
-
-          end getNumberControlPoints2;
-
-          function quat2T
-            "Compute transformation matrix from non-consistent quaternions"
-            extends Modelica.Icons.Function;
-            input Real q[4] "Quaternions (non-consistent)";
-            output Real T[3,3] "orthogonal transformation matrix";
-
-          algorithm
-           T[1,1] := q[1]^2 + q[2]^2 - q[3]^2 - q[4]^2;
-           T[2,2] := q[1]^2 - q[2]^2 + q[3]^2 - q[4]^2;
-           T[3,3] := q[1]^2 - q[2]^2 - q[3]^2 + q[4]^2;
-           T[1,2] := 2*(q[2]*q[3] + q[1]*q[4]);
-           T[1,3] := 2*(q[2]*q[4] - q[1]*q[3]);
-           T[2,1] := 2*(q[2]*q[3] - q[1]*q[4]);
-           T[2,3] := 2*(q[3]*q[4] + q[1]*q[2]);
-           T[3,1] := 2*(q[2]*q[4] + q[1]*q[3]);
-           T[3,2] := 2*(q[3]*q[4] - q[1]*q[2]);
-           //make the quaternions consistent
-           T := T/(q*q);
-
-          end quat2T;
-
-          function solveBandedWithMatrix
-            "Solve linear system with banded system matrix and right hand side matrix (similar to Modelica.Matrices.solve)"
-            extends Modelica.Icons.Function;
-            input Integer kLower "Number of lower bands";
-            input Integer kUpper "Number of upper bands";
-            input Real A[2*kLower + kUpper + 1, :] "Matrix A of A*X = B";
-            input Real B[size(A, 2), :] "Matrix B of A*X = B";
-            output Real X[size(A, 2), size(B, 2)]=B
-              "Matrix X such that A*X = B";
-            output Integer info;
-          algorithm
-            (X,info) := dgbsv(size(A,2), kLower, kUpper, A, B);
-            assert(info == 0, "Solving a linear system of equations with function
-\"Modelica_Interpolation.Utilities.solveBandedWithMatrix\" is not possible, since matrix A
-is singular, i.e., no unique solution exists.");
-          end solveBandedWithMatrix;
-
-          function solveMatrix
-            "Solve linear system with right hand side matrix (similar to Modelica_Interpolation.Utilities.solveMatrix)"
-            extends Modelica.Icons.Function;
-            input Real A[:, size(A, 1)] "Matrix A of A*X = B";
-            input Real B[size(A, 1), :] "Matrix B of A*X = B";
-            output Real X[size(B, 1), size(B, 2)]=B
-              "Matrix X such that A*X = B";
-          protected
-            Integer info;
-          algorithm
-            (X,info) := dgesv(A, B);
-            assert(info == 0, "Solving a linear system of equations with function
-\"Modelica_Interpolation.Utilities.solveMatrix\" is not possible, since matrix A
-is singular, i.e., no unique solution exists.");
-          end solveMatrix;
-
-          function T2quat "Compute Quaternions from a transformation matrix"
-            extends Modelica.Icons.Function;
-            input Real T[3,3] "transformation matrix";
-            output Real q[4] "Quaternions of T (q and -q have same T)";
-
-          protected
-            Real branch "only for test purposes";
-            Real paux;
-            Real paux4;
-            Real c1;
-            Real c2;
-            Real c3;
-            Real c4;
-            Real p4limit=0.1;
-            Real c4limit=4*p4limit*p4limit;
-
-          algorithm
-           c1 := 1 + T[1,1] - T[2,2] - T[3,3];
-           c2 := 1 + T[2,2] - T[1,1] - T[3,3];
-           c3 := 1 + T[3,3] - T[1,1] - T[2,2];
-           c4 := 1 + T[1,1] + T[2,2] + T[3,3];
-
-           if (c4 > c4limit) or (c4 > c1 and c4 > c2 and c4 > c3) then
-              branch := 4;
-              paux := sqrt(c4)/2;
-              paux4 := 4*paux;
-              q := {paux,
-                   (T[2,3] - T[3,2])/paux4,
-                   (T[3,1] - T[1,3])/paux4,
-                   (T[1,2] - T[2,1])/paux4};
-
-           elseif c1 > c2 and c1 > c3 and c1 > c4 then
-              branch := 1;
-              paux := sqrt(c1)/2;
-              paux4 := 4*paux;
-              q := {(T[2,3] - T[3,2])/paux4,
-                   paux,
-                   (T[1,2] + T[2,1])/paux4,
-                   (T[1,3] + T[3,1])/paux4};
-
-           elseif c2 > c1 and c2 > c3 and c2 > c4 then
-              branch := 2;
-              paux := sqrt(c2)/2;
-              paux4 := 4*paux;
-              q := {(T[3,1] - T[1,3])/paux4,
-                   (T[1,2] + T[2,1])/paux4,
-                   paux,
-                   (T[2,3] + T[3,2])/paux4};
-
-           else
-              branch := 3;
-              paux := sqrt(c3)/2;
-              paux4 := 4*paux;
-              q := {(T[1,2] - T[2,1])/paux4,
-                   (T[1,3] + T[3,1])/paux4,
-                   (T[2,3] + T[3,2])/paux4,
-                   paux};
-
-           end if;
-
-          end T2quat;
-        annotation (
-          Window(
-            x=0.45,
-            y=0.01,
-            width=0.44,
-            height=0.65,
-            library=1,
-            autolayout=1),
-          Documentation(info="<HTML>
-<p>
-Utility functions are provided here which are usually not called directly
-by a user, but are needed in the functions of this package
-</p>
-<p>
-The following functions are supported:
-</p>
-<pre>
-  curveLength                          Compute the length of a curve with adaptive quadrature
-  dummy                                return a dummy Bspline with zero entries
-  getNumberControlPoints        Compute the number of control points for the given data points
-  getNumberControlPoints2        Compute the number of control points for the given data points
-                                                                                                  and transformation matrices
-  quat2T                               Compute the transformation matrix of the given quaternions
-  T2quat                               Compute the quaternions of the given transformation matrix
-</pre>
-<p><b>Release Notes:</b></p>
-<ul>
-<li><i>Sept. 13, 2002</i>
-       by Gerhard Schillhuber:<br>
-       first version implemented
-</li>
-<li><i>Oct. 17, 2002</i>
-       by Gerhard Schillhuber:<br>
-       new functions: getNumberControlPoints, getNumberControlPoints2
-                               compute the number of control points for the given data points. It's needed
-                               to initialize the curve.
-</li>
-</ul>
-<br>
-<p><b>Copyright (C) 2002, Modelica Association and DLR.</b></p>
-<p><i>
-This package is <b>free</b> software. It can be redistributed and/or modified
-under the terms of the <b>Modelica license</b>, see the license conditions
-and the accompanying <b>disclaimer</b> in the documentation of package
-Modelica in file \"Modelica/package.mo\".
-</i></p>
-</HTML>
-"));
-        end Utilities;
-        annotation (Icon(graphics={
-              Text(
-                extent={{-102,0},{24,-26}},
-                lineColor={242,148,0},
-                textString=
-                     "Thermo"),
-              Text(
-                extent={{-4,8},{68,-34}},
-                lineColor={46,170,220},
-                textString=
-                     "SysPro"),
-              Polygon(
-                points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},
-                    {42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,
-                    10},{-50,6},{-62,2}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{
-                    -46,8},{-42,22},{-42,30},{-44,38}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{
-                    -12,12},{-26,12},{-28,12},{-26,20}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-8,30},{-6,26}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-8,36},{-6,32}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-8,42},{-6,38}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-8,48},{-6,44}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-4,32},{-2,28}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-4,38},{-2,34}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-4,44},{-2,40}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Rectangle(
-                extent={{-4,50},{-2,46}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{
-                    -2,20}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Polygon(
-                points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},
-                    {42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},
-                    {-50,6},{-62,2}},
-                lineColor={242,148,0},
-                fillColor={242,148,0},
-                fillPattern=FillPattern.Solid),
-              Line(
-                points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-                color={46,170,220},
-                thickness=0.5),
-              Line(
-                points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-                color={46,170,220},
-                thickness=0.5),
-              Line(
-                points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-                color={46,170,220},
-                thickness=0.5),
-              Polygon(
-                points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-                lineColor={46,170,220},
-                fillColor={46,170,220},
-                fillPattern=FillPattern.Solid),
-              Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-              Line(
-                points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-                color={0,0,255},
-                smooth=Smooth.None),
-              Line(
-                points={{80,80},{100,100}},
-                color={0,0,255},
-                smooth=Smooth.None)}));
-      end Modelica_Interpolation;
-
-      model PhaseBoundary "Model used to create the phase boundary"
-
-        parameter Integer npoints=100;
-        Real p[npoints] "pressure";
-        Real hl[npoints] "liquid specific enthalpy";
-        Real hv[npoints] "vapour specific enthalpy";
-
-        parameter Real TMAX=ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.TCRIT;
-        //parameter Real TMAX=32.938;
-        parameter Real TMIN = ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.Ttriple-0.01;
-      protected
-        Real[npoints] T "temperature";
-
-      algorithm
-        T := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.linspace(
-                      TMIN,TMAX,npoints);
-
-        p[1]  := ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple;
-        for i in 2:npoints-1 loop
-          p[i]  := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T[i]);
-        end for;
-        p[end]  := ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.PCRIT;
-
-        for i in 1:npoints loop
-          hl[i] := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p[i]);
-          hv[i] := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p[i]);
-        end for;
-
-        annotation (
-          Icon(graphics));
-      end PhaseBoundary;
-      annotation (Icon(graphics={
-            Text(
-              extent={{-102,0},{24,-26}},
-              lineColor={242,148,0},
-              textString=
-                   "Thermo"),
-            Text(
-              extent={{-4,8},{68,-34}},
-              lineColor={46,170,220},
-              textString=
-                   "SysPro"),
-            Polygon(
-              points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},
-                  {42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},
-                  {-50,6},{-62,2}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{
-                  -46,8},{-42,22},{-42,30},{-44,38}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{
-                  -12,12},{-26,12},{-28,12},{-26,20}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-8,30},{-6,26}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-8,36},{-6,32}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-8,42},{-6,38}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-8,48},{-6,44}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-4,32},{-2,28}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-4,38},{-2,34}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-4,44},{-2,40}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Rectangle(
-              extent={{-4,50},{-2,46}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                  20}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Polygon(
-              points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},
-                  {42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},
-                  {-50,6},{-62,2}},
-              lineColor={242,148,0},
-              fillColor={242,148,0},
-              fillPattern=FillPattern.Solid),
-            Line(
-              points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-              color={46,170,220},
-              thickness=0.5),
-            Line(
-              points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-              color={46,170,220},
-              thickness=0.5),
-            Line(
-              points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-              color={46,170,220},
-              thickness=0.5),
-            Polygon(
-              points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-              lineColor={46,170,220},
-              fillColor={46,170,220},
-              fillPattern=FillPattern.Solid),
-            Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-            Line(
-              points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-              color={0,0,255},
-              smooth=Smooth.None),
-            Line(
-              points={{80,80},{100,100}},
-              color={0,0,255},
-              smooth=Smooth.None)}));
-    end Spline_Utilities;
-
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2},
-          initialScale=0.1), graphics={
-          Text(
-            extent={{-102,0},{24,-26}},
-            lineColor={242,148,0},
-            textString=
-                 "Thermo"),
-          Text(
-            extent={{-4,8},{68,-34}},
-            lineColor={46,170,220},
-            textString=
-                 "SysPro"),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
-                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
-                -50,6},{-62,2}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
-                8},{-42,22},{-42,30},{-44,38}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
-                12},{-26,12},{-28,12},{-26,20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,30},{-6,26}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,36},{-6,32}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,42},{-6,38}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-8,48},{-6,44}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,32},{-2,28}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,38},{-2,34}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,44},{-2,40}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-4,50},{-2,46}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
-                20}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
-                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
-                -50,6},{-62,2}},
-            lineColor={242,148,0},
-            fillColor={242,148,0},
-            fillPattern=FillPattern.Solid),
-          Line(
-            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-            color={46,170,220},
-            thickness=0.5),
-          Line(
-            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-            color={46,170,220},
-            thickness=0.5),
-          Polygon(
-            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-            lineColor={46,170,220},
-            fillColor={46,170,220},
-            fillPattern=FillPattern.Solid),
-          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-          Line(
-            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-            color={0,0,255},
-            smooth=Smooth.None),
-          Line(
-            points={{80,80},{100,100}},
-            color={0,0,255},
-            smooth=Smooth.None)}),
-      Window(
-        x=0.05,
-        y=0.51,
-        width=0.25,
-        height=0.26,
-        library=1,
-        autolayout=1),
-      Documentation(info="<html>
-<p><b>Version 1.2</b></p>
-</HTML>
-"));
-  end IF97_wAJ;
-  annotation (Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end IF97_packages;
+within ThermoSysPro.Properties.WaterSteam;
+package IF97_packages
+
+  package IF97_wAJ
+      constant IF97_wAJ.Spline_Utilities.Data IF97_spline(
+        ndim = 1,
+        ncontrol = 100,
+        degree = 3,
+        knots = {
+        2.93063160225403e-007, 2.93063160225403e-007, 2.93063160225403e-007, 2.93063160225403e-007,
+        0.0150553301018805, 0.0225746360796844, 0.0300841766610507, 0.0375864719559614,
+        0.0450833779282367, 0.0525763026035424, 0.0600663541987385, 0.0675544420190098,
+        0.0750413446792581, 0.0825277558142009, 0.0900143143696351, 0.0975016244159301,
+        0.104990267916964, 0.11248081283071, 0.119973818177067, 0.127469837190213,
+        0.134969419310924, 0.14247311152242, 0.149981459358957, 0.157495007796453,
+        0.165014302152702, 0.172539889069826, 0.180072317615317, 0.187612140514708,
+        0.195159915514515, 0.202716206865773, 0.21028158691427, 0.217856637782066,
+        0.225441953125109, 0.233038139953034, 0.240645820499176, 0.248265634131007,
+        0.255898239293619, 0.26354431548115, 0.271204565233372, 0.278879716156774,
+        0.286570522971491, 0.294277769587339, 0.302002271213962, 0.309744876511783,
+        0.317506469792076, 0.325287973276035, 0.333090349424309, 0.340914603350119,
+        0.348761785330786, 0.356632993434437, 0.364529376280738, 0.372452135957019,
+        0.380402531113975, 0.388381880268579, 0.39639156534589, 0.404433035496425,
+        0.412507811231662, 0.420617488927502, 0.42876374575417, 0.436948345101518,
+        0.445173142581185, 0.453440092702033, 0.461751256332929, 0.470108809087968,
+        0.478515050793845, 0.486972416228223, 0.495483487352128, 0.50405100729972,
+        0.512677896436249, 0.521367270850924, 0.53012246371707, 0.538947050028345,
+        0.547844875307676, 0.556820088984304, 0.565877183242573, 0.575021038260507,
+        0.584256974874285, 0.593590815826759, 0.603028956896544, 0.612578449397273,
+        0.622247095874125, 0.632043561486359, 0.641977504873387, 0.652059734791795,
+        0.662302403295546, 0.672719253852374, 0.6833259549907, 0.694140568427125,
+        0.705184226398132, 0.716482126202646, 0.728064988229839, 0.739971159691273,
+        0.752249564928059, 0.764963678571606, 0.77819659006882, 0.79205900502822,
+        0.806726369054731, 0.822437269975835, 0.839573763094594, 0.858852425095749,
+        1, 1, 1, 1},
+        controlPoints = [
+        6.41617166788097; 6.59657375859249; 6.85956502478188; 7.19550228677957;
+        7.44003141655459; 7.67746343199683; 7.90809030002524; 8.1321863948823;
+        8.35001072138466; 8.56180824123764; 8.76781112389037; 8.96823977601129;
+        9.16330374171574; 9.35320248746118; 9.53812609634101; 9.71825588651749;
+        9.89376496619584; 10.064818734583; 10.2315753364618; 10.394186076569;
+        10.552795798896; 10.7075432351955; 10.8585613263155; 11.0059775194514;
+        11.1499140439677; 11.2904881680785; 11.427812438369; 11.561994903882;
+        11.6931393262684; 11.8213453773153; 11.9467088249962; 12.0693217090492;
+        12.1892725069664; 12.3066462911727; 12.421524878079; 12.5339869696189;
+        12.644108287808; 12.7519617028068; 12.8576173549182; 12.9611427709053;
+        13.06260297498; 13.1620605947781; 13.25957596261; 13.355207212251;
+        13.4490103715159; 13.5410394508422; 13.6313465280923; 13.7199818297721;
+        13.8069938088494; 13.892429219348; 13.9763331878828; 14.0587492822951;
+        14.1397195775398; 14.2192847189711; 14.297483983169; 14.3743553364442;
+        14.4499354911556; 14.524259959973; 14.5973631082143; 14.6692782043857;
+        14.740037469051; 14.8096721221595; 14.8782124289575; 14.9456877446163;
+        15.0121265577065; 15.0775565326579; 15.1420045513451; 15.2054967539465;
+        15.2680585792283; 15.3297148044048; 15.3904895847271; 15.4504064929423;
+        15.5094885587568; 15.5677583084284; 15.6252378046292; 15.6819486867911;
+        15.7379122123276; 15.7931492995096; 15.8476805734722; 15.9015264179811;
+        15.9547070373259; 16.0072425350593; 16.0591530191528; 16.11045874587;
+        16.1611803164475; 16.211338938197; 16.2609567565343; 16.3100572327281;
+        16.3586655540358; 16.4068088127073; 16.4545163733577; 16.501817689937;
+        16.5487496364798; 16.5953631575021; 16.6418467771832; 16.6879750106034;
+        16.7343150270632; 16.8752144692458; 16.9266730020941; 16.9094578790152]);
+
+    function Water_Ph
+      input Units.SI.AbsolutePressure p "Pressure";
+      input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+      input Integer mode = 0 "IF97 region. 0:automatic";
+
+    protected
+      Integer phase;
+      Integer region;
+      Integer error;
+      Units.SI.Temperature T;
+      Units.SI.Density d;
+      Boolean supercritical;
+
+    public
+      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+        annotation (Placement(transformation(extent={{-90,15},{-43.3333,61.6667}},
+              rotation=0)));
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                         g annotation (Placement(transformation(extent={{-90,
+                -85},{-43.3333,-38.3333}}, rotation=0)));
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
+                             f
+        annotation (Placement(transformation(extent={{-23.3333,-85},{23.3333,
+                -38.3333}}, rotation=0)));
+    algorithm
+
+      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+      phase := if ((h < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p))
+                   or (h > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p))
+                   or supercritical) then 1 else 2;
+      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ph(p, h, phase, mode);
+      if (region == 1) then
+        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(p, h);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ph(g);
+        pro.x := if (supercritical) then -1 else 0;
+      elseif (region == 2) then
+        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(p, h);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ph(g);
+        pro.x := if (supercritical) then -1 else 1;
+      elseif (region == 3) then
+        (d,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofph3(p=p, h=h, delp=1.0e-7, delh=1.0e-6);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(d, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToProps_ph(f);
+
+        if (h >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.HCRIT) then
+          pro.x := if (supercritical) then -1 else 1;
+        else
+          pro.x := if (supercritical) then -1 else 0;
+        end if;
+      elseif (region == 4) then
+        pro := ThermoSysPro.Properties.WaterSteam.Common.water_ph_r4(p, h);
+      elseif (region == 5) then
+        (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofph5(p=p, h=h, reldh=1.0e-7);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ph(g);
+        pro.x := if (supercritical) then -1 else 1;
+      else
+        assert(false, "Water_Ph: Incorrect region number (" + String(region) + ")");
+      end if;
+      annotation (
+        derivative(noDerivative=mode) = Water_Ph_der,
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Window(
+          x=0.06,
+          y=0.1,
+          width=0.75,
+          height=0.73),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end Water_Ph;
+
+    function Water_Ps
+      input Units.SI.AbsolutePressure p "Pressure";
+      input Units.SI.SpecificEntropy s "Specific entropy";
+      input Integer mode = 0 "IF97 region. 0:automatic";
+
+    protected
+      Integer phase;
+      Integer region;
+      Integer error;
+      Units.SI.Temperature T;
+      Units.SI.Density d;
+      Boolean supercritical;
+
+    public
+      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro;
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                         g annotation (Placement(transformation(extent={{-90,
+                -85},{-43.3333,-38.3333}}, rotation=0)));
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
+                             f
+        annotation (Placement(transformation(extent={{-23.3333,-85},{23.3333,
+                -38.3333}}, rotation=0)));
+    algorithm
+
+      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+      phase := if ((s < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(p))
+                   or (s > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(p))
+                   or supercritical) then 1 else 2;
+
+      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(p, s, phase, mode);
+      if (region == 1) then
+        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(p, s);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ps(g);
+        pro.x := if (supercritical) then -1 else 0;
+      elseif (region == 2) then
+        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(p, s);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ps(g);
+        pro.x := if (supercritical) then -1 else 1;
+      elseif (region == 3) then
+        (d,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(p=p, s=s, delp=1.0e-7, dels=1.0e-6);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(d, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToProps_ps(f);
+        pro.x := if (supercritical) then -1 else 0;
+      elseif (region == 4) then
+        pro := ThermoSysPro.Properties.WaterSteam.Common.water_ps_r4(p, s);
+      elseif (region == 5) then
+        (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(p=p, s=s, relds=1.0e-7);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_ps(g);
+        pro.x := if (supercritical) then -1 else 1;
+      else
+        assert(false, "Water_Ps: Incorrect region number");
+      end if;
+      annotation (
+        derivative(noDerivative=mode) = Water_Ps_der,
+        Window(
+          x=0.22,
+          y=0.2,
+          width=0.6,
+          height=0.6),
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end Water_Ps;
+
+    function Water_sat_P
+      input Units.SI.AbsolutePressure P "Pressure";
+
+    protected
+      Units.SI.Temperature T;
+
+    public
+      output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat
+                                  lsat annotation (Placement(transformation(
+              extent={{-85,15},{-15,85}}, rotation=0)));
+      output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat
+                                  vsat annotation (Placement(transformation(
+              extent={{15,15},{85,85}}, rotation=0)));
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                         gl annotation (Placement(transformation(extent={{-85,
+                -85},{-15,-15}}, rotation=0)));
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                         gv annotation (Placement(transformation(extent={{15,
+                -85},{85,-15}}, rotation=0)));
+    algorithm
+
+      /*  if (not (P < SteamIF97.data.plimit4a)) then
+    assert(false, "Eau_sat_P: Pression > 16.5292e6 Pa");
+  end if;*/
+
+      T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(P);
+
+      gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(P, T);
+      lsat := ThermoSysPro.Properties.WaterSteam.Common.gibbsPropsSat(
+                                   P, T, gl);
+
+      gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(P, T);
+      vsat := ThermoSysPro.Properties.WaterSteam.Common.gibbsPropsSat(
+                                   P, T, gv);
+      //
+      annotation (
+        derivative = Water_sat_P_der,
+        Window(
+          x=0.34,
+          y=0.21,
+          width=0.6,
+          height=0.6),
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end Water_sat_P;
+
+    function DynamicViscosity_rhoT
+      input Units.SI.Density rho "Density";
+      input Units.SI.Temperature T "Temperature";
+
+      output Units.SI.DynamicViscosity mu "Dynamic viscosity";
+    algorithm
+
+      mu := ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.visc_dT(rho, T);
+      annotation (
+        smoothOrder=2,
+        Window(
+          x=0.34,
+          y=0.34,
+          width=0.6,
+          height=0.6),
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end DynamicViscosity_rhoT;
+
+    function ThermalConductivity_rhoT
+      input Units.SI.Density rho "Density";
+      input Units.SI.Temperature T "Temperature";
+      input Units.SI.AbsolutePressure P "Pressure";
+      input Integer region = 0 "IF97 region. 0:automatic";
+
+      output Units.SI.ThermalConductivity lambda "Thermal conductivity";
+    algorithm
+
+      lambda := ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.cond_industrial_dT(rho, T);
+      annotation (
+        smoothOrder=2,
+        Window(
+          x=0.34,
+          y=0.34,
+          width=0.6,
+          height=0.6),
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end ThermalConductivity_rhoT;
+
+    function SurfaceTension_T
+      input Units.SI.Temperature T "Temperature";
+
+      output Units.SI.SurfaceTension sigma "Surface tension";
+    algorithm
+
+      sigma := ThermoSysPro.Properties.WaterSteam.BaseIF97.Transport.surfaceTension(T);
+      annotation (
+        smoothOrder=2,
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Window(
+          x=0.33,
+          y=0.34,
+          width=0.6,
+          height=0.6),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end SurfaceTension_T;
+
+    function SpecificEnthalpy_PT
+      input Units.SI.AbsolutePressure p "Pressure";
+      input Units.SI.Temperature T "Temperature";
+      input Integer mode = 0 "IF97 region. 0:automatic";
+
+      output Units.SI.SpecificEnthalpy H "Specific enthalpy";
+
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT
+                                 pro;
+    algorithm
+
+      pro := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_PT(p, T, mode);
+      H := pro.h;
+      annotation (
+        derivative(noDerivative=mode) = SpecificEnthalpy_PT_der,
+        Icon(graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end SpecificEnthalpy_PT;
+
+    function Pressure_sat_hl
+      input Units.SI.SpecificEnthalpy hl
+        "Liquid specific enthalpy on the saturation line";
+
+      output Units.SI.AbsolutePressure P
+        "Liquid pressure on the saturation line";
+    protected
+      Units.SI.AbsolutePressure tmp[1];
+    algorithm
+
+      assert(hl > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple),
+        "Pressure_sat_hl called with too low specific enthalpy (below triple point)");
+      assert(hl < ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.HCRIT,
+        "Pressure_sat_hl called with too high specific enthalpy (above critical point)");
+
+      tmp := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.safeEvaluate(IF97_spline, hl/ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.HCRIT);
+      P := Modelica.Math.exp(tmp[1]);
+      annotation (
+        derivative = Pressure_sat_hl_der,
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Version 1.2</b> </p>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro_AJ Version 2.0</b></p>
+</HTML>
+"));
+    end Pressure_sat_hl;
+
+    function Water_PT
+      input Units.SI.AbsolutePressure p "Pressure";
+      input Units.SI.Temperature T "Temperature";
+      input Integer mode=0 "IF97 region. 0:automatic";
+      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro;
+
+    protected
+      Integer region;
+      Boolean supercritical;
+      Integer error;
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f;
+      Units.SI.Density d;
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g;
+    algorithm
+
+      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(p, T, mode);
+      if (region == 1) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_pT(g);
+        pro.x := if (supercritical) then -1 else 0;
+      elseif (region == 2) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_pT(g);
+        pro.x := if (supercritical) then -1 else 1;
+      elseif (region == 3) then
+        (d,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(p=p, T=T, delp=ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData.DELP);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(d, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToProps_pT(f);
+        pro.x := if (supercritical) then -1 else 0;
+      elseif (region == 5) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
+        pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_pT(g);
+        pro.x := if (supercritical) then -1 else 1;
+      else
+        assert(false, "Water_PT: Incorrect region number");
+      end if;
+
+      annotation (
+        derivative(noDerivative=mode) = Water_PT_der,
+        Icon(graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end Water_PT;
+
+      function Pressure_sat_hl_der
+      input Units.SI.SpecificEnthalpy hl
+        "Liquid specific enthalpy on the saturation line";
+        input Real hl_der;
+
+        output Real P_der;
+    protected
+      Units.SI.AbsolutePressure P[1] "Liquid pressure on the saturation line";
+        Real tmp[1];
+      algorithm
+
+        assert(hl > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple),
+        "Pressure_sat_hl_der called with too low specific enthalpy (below triple point)");
+        assert(hl < ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.HCRIT,
+        "Pressure_sat_hl_der called with too high specific enthalpy (above critical point)");
+
+        (P,tmp) := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.safeEvaluateDer(IF97_spline, hl/ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.HCRIT);
+        P_der := Modelica.Math.exp(P[1])*tmp[1]*hl_der;
+      annotation (
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Version 1.2</b> </p>
+<p>Needs to be redone. Iterative functions don&apos;t work for Analytic Jacobian</p>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro_AJ Version 2.0</b></p>
+</HTML>
+"));
+      end Pressure_sat_hl_der;
+
+    function Water_Ph_der "Derivative function of Water_Ph"
+      input Units.SI.AbsolutePressure p "Pressure";
+      input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+      input Integer mode = 0 "Région IF97 - 0:calcul automatique";
+      //input CombiPlant.ThermoFluidPro.Media.Common.IF97TwoPhaseAnalytic aux "auxiliary record";
+
+      input Real p_der "derivative of Pressure";
+      input Real h_der "derivative of Specific enthalpy";
+
+      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph der_pro
+        "Derivative";
+
+    protected
+      Integer phase;
+      Integer region;
+      Boolean supercritical;
+
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      Units.SI.Temperature T;
+      Units.SI.SpecificHeatCapacity R "gas constant";
+      Units.SI.Density rho "density";
+      Real vt "derivative of specific volume w.r.t. temperature";
+      Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+      Real vp "derivative of specific volume w.r.t. pressure";
+      ThermoSysPro.Units.xSI.DerPressureByDensity pd
+        "derivative of pressure wrt density";
+      ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+        "derivative of pressure wrt temperature";
+      Real dpT "dp/dT derivative of saturation curve";
+      Real dxv "der of x wrt v";
+      Real dvTl "der of v wrt T at boiling";
+      Real dvTv "der of v wrt T at dew";
+      Real dxT "der of x wrt T";
+      Real duTl "der of u wrt T at boiling";
+      Real duTv "der of u wrt T at dew";
+      Real vtt "2nd derivative of specific volume w.r.t. temperature";
+      Real cpt "derivative of cp w.r.t. temperature";
+      Real cvt "derivative of cv w.r.t. temperature";
+      Real dpTT "2nd der of p wrt T";
+      Real dxdd "2nd der of x wrt d";
+      Real dxTd "2nd der of x wrt d and T";
+      Real dvTTl "2nd der of v wrt T at boiling";
+      Real dvTTv "2nd der of v wrt T at dew";
+      Real dxTT " 2nd der of x wrt T";
+      Real duTTl "2nd der of u wrt T at boiling";
+      Real duTTv "2nd der of u wrt T at dew";
+
+      Integer error "error flag for inverse iterations";
+      Units.SI.SpecificEnthalpy h_liq "liquid specific enthalpy";
+      Units.SI.Density d_liq "liquid density";
+      Units.SI.SpecificEnthalpy h_vap "vapour specific enthalpy";
+      Units.SI.Density d_vap "vapour density";
+      Real x "dryness fraction";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd vap
+        "phase boundary property record";
+
+      Units.SI.Temperature t1
+        "temperature at phase boundary, using inverse from region 1";
+      Units.SI.Temperature t2
+        "temperature at phase boundary, using inverse from region 2";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Units.SI.SpecificVolume v;
+
+      Real ptt "2nd derivative of pressure wrt temperature";
+      Real pdd "2nd derivative of pressure wrt density";
+      Real ptd "mixed derivative of pressure w.r.t. density and temperature";
+      Real vpp "2nd derivative of specific volume w.r.t. pressure";
+      Real vtp
+        "mixed derivative of specific volume w.r.t. pressure and temperature";
+
+      Real vp3 "vp^3";
+      Real ivp3 "1/vp3";
+
+      Real detPH "Determinant";
+      Real dht;
+      Real dhd;
+      Real ddhp;
+      Real ddph;
+      Real dtph;
+      Real dthp;
+      Real detPH_d;
+      Real detPH_t;
+      Real dhtt;
+      Real dhtd;
+      Real ddph_t;
+      Real ddph_d;
+      Real ddhp_t;
+      Real ddhp_d;
+
+      Real duhp_t;
+      Real duph_t;
+      Real duph_d;
+
+      Real dupp;
+      Real duph;
+      Real duhh;
+
+      Real dcp_d;
+
+      Real rho2 "square of density";
+      Real rho3 "cube of density";
+      Real cp3 "cube of specific heat capacity";
+      Real cpcpp;
+      Real quotient;
+      Real vt2;
+      Real pt2;
+      Real pt3;
+
+    algorithm
+      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+      phase := if ((h < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p)) or
+                   (h > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p)) or
+                   supercritical) then 1 else 2;
+      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ph(p, h, phase, mode);
+
+      R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      if (region == 1) then
+        // get variables
+        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(p,h);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, T);
+        rho := p/(R*T*g.pi*g.gpi);
+        rho2 := rho*rho;
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        vt2 := vt*vt;
+        cp := -R*g.tau*g.tau*g.gtautau;
+        cp3 := cp*cp*cp;
+        cpcpp := cp*cp*p;
+        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        v := 1/rho;
+        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
+        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
+        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+        vp3 := vp*vp*vp;
+        ivp3 := 1/vp3;
+        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt2*vpp)*ivp3;
+        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd "= pvv/d^4";
+        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
+        cvt := (vp3*cpt + vp*vp*vt2 + 3.0*vp*vp*T*vt*vtt
+          - 3.0*vtp*vp*T*vt2 + T*vt2*vt*vpp)*ivp3;
+
+        // not in cache
+        detPH := cp*pd;
+        dht := cv + pt/rho;
+        dhd := (pd - T*pt/rho)/rho;
+        ddph := dht/ detPH;
+        ddhp := -pt/detPH;
+        dtph := -dhd/detPH;
+        dthp := pd/detPH;
+        detPH_d := cv*pdd + (2.0*pt *(ptd - pt/rho) - ptt*pd)*T/(rho2);
+        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/rho2;
+        dhtt := cvt + ptt*v;
+        dhtd := (ptd - (T * ptt + pt)*v) *v;
+        ddhp_t := ddhp * (ptt / pt - detPH_t / detPH);
+        ddhp_d := ddhp * (ptd / pt - detPH_d / detPH);
+        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
+        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
+        dupp :=-(2.0*cp3*vp + cp3*p*vpp - 2.0*cp*cp*vt*v -
+              2.0*cpcpp*vtp*v - cpcpp*vt*vp + 2.0*cp*cp*T*vt2 +
+              3.0*cpcpp*vt*T*vtp - 4.0*T*vtt*cp*p*vt*v +
+              3.0*T*T*vtt*cp*p*vt2 + cp*p*vtt/rho2 - cpt*p*vt/rho2 +
+              2.0*cpt*p*vt2*v*T - cpt*p*vt2*T^2) / cp3;
+        duph := -(vtp*cpcpp + cp*cp*vt - cp*p*vtt*v + 2.0*cp*p*vt*T*vtt +
+              cpt*p*vt*v - cpt*p*vt2*T)/cp3;
+        duhh := -p*(cp*vtt - cpt*vt) / cp3;
+
+        // calculate derivatives
+        der_pro.x := 0.0;
+        der_pro.duhp := duph*p_der + duhh*h_der;
+        der_pro.duph :=  dupp*p_der + duph* h_der;
+        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
+        der_pro.ddhp := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
+        der_pro.cp := (-(T * vtt * cp + cpt/rho - cpt * T * vt) / cp)*p_der +
+          cpt/cp*h_der;
+        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
+        der_pro.u := (-(p*vp*cp + cp*v - p*vt*v + p*vt2 *T)/cp)*p_der + ((cp - p*vt)/cp)*h_der;
+        der_pro.T := ((-v + T*vt)/cp)*p_der + (1/cp)*h_der;
+        der_pro.d := (-rho2*(vp*cp - vt/rho + T*vt2)/cp)*p_der + (-rho2*vt/(cp))*h_der;
+
+      elseif (region == 2) then
+        // get variables
+        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(p, h);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, T);
+        rho := p/(R*T*g.pi*g.gpi);
+        rho2 := rho*rho;
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        vt2 := vt*vt;
+        cp := -R*g.tau*g.tau*g.gtautau;
+        cp3 := cp*cp*cp;
+        cpcpp := cp*cp*p;
+        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        v := 1/rho;
+        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
+        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
+        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+        vp3 := vp*vp*vp;
+        ivp3 := 1/vp3;
+        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt2*vpp)*ivp3;
+        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd "= pvv/d^4";
+        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
+        cvt := (vp3*cpt + vp*vp*vt2 + 3.0*vp*vp*T*vt*vtt
+          - 3.0*vtp*vp*T*vt2 + T*vt2*vt*vpp)*ivp3;
+
+        // not in cache
+        detPH := cp*pd;
+        dht := cv + pt/rho;
+        dhd := (pd - T*pt/rho)/rho;
+        ddph := dht/ detPH;
+        ddhp := -pt/detPH;
+        dtph := -dhd/detPH;
+        dthp := pd/detPH;
+        detPH_d := cv*pdd + (2.0*pt *(ptd - pt/rho) - ptt*pd)*T/(rho2);
+        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/rho2;
+        dhtt := cvt + ptt*v;
+        dhtd := (ptd - (T * ptt + pt)*v) *v;
+        ddhp_t := ddhp * (ptt / pt - detPH_t / detPH);
+        ddhp_d := ddhp * (ptd / pt - detPH_d / detPH);
+        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
+        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
+        dupp :=-(2.0*cp3*vp + cp3*p*vpp - 2.0*cp*cp*vt*v -
+              2.0*cpcpp*vtp*v - cpcpp*vt*vp + 2.0*cp*cp*T*vt2 +
+              3.0*cpcpp*vt*T*vtp - 4.0*T*vtt*cp*p*vt*v +
+              3.0*T*T*vtt*cp*p*vt2 + cp*p*vtt/rho2 - cpt*p*vt/rho2 +
+              2.0*cpt*p*vt2*v*T - cpt*p*vt2*T^2) / cp3;
+        duph := -(vtp*cpcpp + cp*cp*vt - cp*p*vtt*v + 2.0*cp*p*vt*T*vtt +
+              cpt*p*vt*v - cpt*p*vt2*T)/cp3;
+        duhh := -p*(cp*vtt - cpt*vt) / cp3;
+
+        // calculate derivatives
+        der_pro.x := 0.0;
+        der_pro.duhp := duph*p_der + duhh*h_der;
+        der_pro.duph :=  dupp*p_der + duph* h_der;
+        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
+        der_pro.ddhp := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
+        der_pro.cp := (-(T * vtt * cp + cpt/rho - cpt * T * vt) / cp)*p_der + cpt/cp*h_der;
+        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
+        der_pro.u := (-(p*vp*cp + cp*v - p*vt*v + p*vt2 *T)/cp)*p_der + ((cp - p*vt)/cp)*h_der;
+        der_pro.T := ((-v + T*vt)/cp)*p_der + (1/cp)*h_der;
+        der_pro.d := (-rho2*(vp*cp - vt/rho + T*vt2)/cp)*p_der + (-rho2*vt/(cp))*h_der;
+
+      elseif (region == 3) then
+        // get variables
+        (rho,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofph3(p,h,delp=1.0e-7,delh=1.0e-6);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(rho, T);
+
+        rho2 := rho*rho;
+        rho3 := rho*rho2;
+        v := 1/rho;
+        pd := R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        pt := R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        pt2 := pt*pt;
+        pt3 := pt2*pt;
+        cv := abs(R*(-f.tau*f.tau*f.ftautau))
+          "can be close to neg. infinity near critical point";
+        cp := (rho2*pd*cv + T*pt2)/(rho2*pd);
+        pdd := R*T*f.delta/rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
+             f.delta*f.delta*f.fdeltadeltadelta);
+        ptt := R*rho*f.delta*f.tau*f.tau/T*f.fdeltatautau;
+        ptd := R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
+             -f.delta*f.tau*f.fdeltadeltatau);
+        cvt := R*f.tau*f.tau/T*(2.0*f.ftautau + f.tau*f.ftautautau);
+        cpt := (cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/(rho2) - cp*ptd)/pd;
+
+        // not in cache
+        detPH := cp*pd;
+        dht := cv + pt/rho;
+        dhd := (pd - T*pt/rho)/rho;
+        ddph := dht/ detPH;
+        ddhp := -pt/detPH;
+        dtph := -dhd/detPH;
+        dthp := pd/detPH;
+        detPH_d := cv*pdd + (2.0*pt *(ptd - pt/rho) - ptt*pd) *T/(rho2);
+        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/rho2;
+        dhtt := cvt + ptt*v;
+        dhtd := (ptd - (T * ptt + pt)*v) *v;
+        ddhp_t := ddhp * (ptt / pt - detPH_t / detPH);
+        ddhp_d := ddhp * (ptd / pt - detPH_d / detPH);
+        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
+        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
+
+        dcp_d :=(detPH_d - cp*pdd)/pd;
+
+        quotient := 1/(cv*rho2*pd + T*pt2)^3;
+        dupp := -(-4.0*ptt*p*cv*rho2*pd*T*pt + 2.0*p*cvt*rho2*T*pt2*pd -
+              2.0*ptt*p*T*pt2*rho*pd + 3.0*p*cv^2*rho3*ptd*T*pt +
+              3.0*p*cv*rho*T^2*pt2*ptt - 2.0*pt*p*cv*rho3*ptd*pd +
+              4.0*pt2*p*cv*rho2*ptd*T - 2.0*T^2*pt2*pt3 - 4.0*pt2*cv^2*rho3*pd*T -
+              4.0*pt3*cv*rho2*T*pd - p*cvt*rho*T^2*pt3 + ptt*p*cv*rho3*pd^2 -
+              2.0*p*cv^2*rho2*rho2*ptd*pd + 2.0*p*cv*rho2*pt2*pd +
+              2.0*p*cv*rho*pt3*T - pt*p*cvt*rho3*pd^2 + ptd*p*rho*T*pt3 +
+              5.0*pt*p*cv^2*rho3*pd + 2*pt*p*cv^2*rho2*rho2*pdd + pt2*p*cv*rho3*pdd +
+              2.0*pt2*pt2*p*T - 2.0*cv^3*rho3*rho2*pd^2 - 2.0*pt*cv^2*rho2*rho2*pd^2-
+              2.0*pt2*pt2*cv*rho*T^2 + 2.0*ptt*p*T^2*pt3 - pt3*p*rho*pd +
+              2.0*p*cv^3*rho2*rho2*pd + p*cv^3*rho2*rho3*pdd)*quotient/rho;
+        duph := (-2.0*ptt*p*cv*rho2*pd*T*pt + p*cvt*rho2*T*pt2*pd -
+              2.0*ptt*p*T*pt2*rho*pd - 2.0*pt*p*cv*rho3*ptd*pd +
+              2.0*pt2*p*cv*rho2*ptd*T - T^2*pt3*pt2 - 2*pt3*cv*rho2*T*pd +
+              ptt*p*cv*rho3*pd^2 - p*cv^2*rho2*rho2*ptd*pd + 2.0*p*cv*rho2*pt2*pd -
+              pt*p*cvt*rho3*pd^2 + ptd*p*rho*T*pt3 + 2.0*pt*p*cv^2*rho3*pd +
+              pt*p*cv^2*rho2*rho2*pdd + pt2*p*cv*rho3*pdd + pt2*pt2*p*T -
+              pt*cv^2*rho2*rho2*pd^2 + ptt*p*T^2*pt3 - pt3*p*rho*pd)*quotient;
+        duhh := p*(-pt3*T*ptd + 2.0*ptd*cv*rho2*pd*pt - 2.0*pt2*cv*rho*pd +
+              pt*cvt*rho2*pd^2 - pt2*cv*rho2*pdd + 2.0*pt2*T*ptt*pd -
+              ptt*cv*rho2*pd^2 + pt3*pd)*rho2 *quotient;
+
+        // calculate derivatives
+        der_pro.x := 0.0;
+        der_pro.duhp := duph*p_der + duhh*h_der;
+        der_pro.duph := dupp*p_der + duph* h_der;
+        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
+        der_pro.ddhp := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
+        der_pro.cp := (ddph * dcp_d + dtph * cpt)*p_der +
+           (ddhp * dcp_d + dthp * cpt)*h_der;
+        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
+        der_pro.u := ((cv*rho2*pd - pt*p + T*pt2)/(cv*rho2*pd + T*pt2))*h_der +
+           ((cv*rho2*pd - p*cv*rho - pt*p + T*pt2)/(rho*(cv*rho2*pd + T*pt2)))*p_der;
+        der_pro.T := ((-rho*pd + T*pt)/(rho2*pd*cv+ T*pt*pt))*p_der +
+           ((rho2*pd)/(rho2*pd*cv + T*pt2))*h_der;
+        der_pro.d := ((rho*(cv*rho + pt))/(rho2*pd*cv + T*pt2))*p_der +
+          (-rho2*pt/(rho2*pd*cv + T*pt2))*h_der;
+
+      elseif (region == 4) then
+        // get variables
+        h_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p);
+        h_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p);
+        x := if (h_vap <> h_liq) then (h - h_liq)/(h_vap - h_liq) else 1.0;
+
+        if p <ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
+          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph1(p, h_liq);
+          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tph2(p, h_vap);
+          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, t1);
+          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, t2);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(gl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(gv);
+          T := t1 + x*(t2 - t1);
+        else
+          T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(p);
+          // how to avoid ?
+
+          d_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_T(T);
+          d_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_T(T);
+          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(d_liq, T);
+          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(d_vap, T);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(fl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(fv);
+          //  dpT := BaseIF97.Basic.dptofT(T);
+        end if;
+
+        rho := liq.d*vap.d/(vap.d + x*(liq.d - vap.d));
+        rho2 := rho*rho;
+        rho3 := rho*rho2;
+        v := 1/rho;
+        dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d-vap.d) else 0.0;
+        dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*dxv else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(T);
+
+        dvTl := (liq.pt -dpT)/(liq.pd*liq.d*liq.d);
+        dvTv := (vap.pt -dpT)/(vap.pd*vap.d*vap.d);
+        dxT := -dxv*(dvTl + x*(dvTv-dvTl));
+        duTl := liq.cv + (T*liq.pt-p)*dvTl;
+        duTv := vap.cv + (T*vap.pt-p)*dvTv;
+        cv := duTl + x*(duTv-duTl) + dxT * (vap.u-liq.u);
+        dpTT := dxv*(vap.cv/T-liq.cv/T + dvTv*(vap.pt-dpT)-dvTl*(liq.pt-dpT));
+        dxdd := 2.0*dxv/(rho3);
+        dxTd := dxv*dxv*(dvTv-dvTl)/(rho2);
+        dvTTl := ((liq.ptt-dpTT)/(liq.d*liq.d) + dvTl*(liq.d*dvTl*(2.0*liq.pd + liq.d*liq.pdd)
+             -2.0*liq.ptd))/liq.pd;
+        dvTTv := ((vap.ptt-dpTT)/(vap.d*vap.d) + dvTv*(vap.d*dvTv*(2.0*vap.pd + vap.d*vap.pdd)
+             -2.0*vap.ptd))/vap.pd;
+        dxTT := -dxv*(2.0*dxT*(dvTv-dvTl) + dvTTl + x*(dvTTv-dvTTl));
+        duTTl := liq.cvt +(liq.pt-dpT + T*(2.0*liq.ptt -liq.d*liq.d*liq.ptd *dvTl))*dvTl + (T*
+          liq.pt - p)*dvTTl;
+        duTTv := vap.cvt +(vap.pt-dpT + T*(2.0*vap.ptt -vap.d*vap.d*vap.ptd *dvTv))*dvTv + (T*
+          vap.pt - p)*dvTTv;
+        cvt := duTTl + x *(duTTv -duTTl) + 2.0*dxT*(duTv-duTl) + dxTT *(vap.u-liq.u);
+        ptt := dpTT;
+
+        // not in cache
+        dht := cv + dpT * v;
+        dhd := -T * dpT*v*v;
+        detPH := -dpT * dhd;
+        dtph := 1.0 / dpT;
+        ddph := dht / detPH;
+        ddhp := -dpT / detPH;
+        detPH_d := -2.0 * v;                   /* = detPH_d / detPH */
+        detPH_t := 2.0 * ptt / dpT + 1.0 / T; /* = detPH_t / detPH */
+        dhtt := cvt + ptt * v;
+        dhtd := -(T * ptt + dpT) *v*v;
+        ddhp_t := ddhp * (ptt / dpT - detPH_t);
+        ddhp_d := ddhp * (-detPH_d);
+        ddph_t := ddph * (dhtt / dht - detPH_t);
+        ddph_d := ddph * (dhtd / dht - detPH_d);
+        duhp_t := (ddhp * dpT + p * ddhp_t) / (rho2);
+        duph_t :=(ddph*dpT + p*ddph_t)/(rho2);
+        duph_d :=((-2.0*ddph/rho + ddph_d)*p + 1.0)/(rho2);
+
+        // calculate derivatives
+        der_pro.x := if (h_vap <> h_liq) then h_der/(h_vap - h_liq) else 0.0;
+        der_pro.duhp := (dtph * duhp_t)*p_der;
+        der_pro.duph :=  (ddph * duph_d + dtph * duph_t)*p_der + (dtph * duhp_t)* h_der;
+        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der + (ddhp * ddph_d)*h_der;
+        der_pro.ddhp := (ddhp * ddhp_d)*h_der + (ddhp * ddph_d)*p_der;
+        der_pro.cp :=0.0;
+        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
+        der_pro.u := ((ddph*p/rho - 1.0)/rho)*p_der + (ddhp*p/(rho2) + 1.0)*h_der;
+        der_pro.T := 1/dpT*p_der;
+        der_pro.d := (rho*(rho*cv/dpT + 1.0)/(dpT*T))*p_der
+           + (-rho2/(dpT*T))*h_der;
+
+      elseif (region == 5) then
+        // get variables
+        (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofph5(p,h,reldh=1.0e-7);
+        assert(error == 0, "error in inverse iteration of steam tables");
+
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(p, T);
+        rho := p/(R*T*g.pi*g.gpi);
+        rho2 := rho*rho;
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        vt2 := vt*vt;
+        cp := -R*g.tau*g.tau*g.gtautau;
+        cp3 := cp*cp*cp;
+        cpcpp := cp*cp*p;
+        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        v := 1/rho;
+        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
+        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
+        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+        vp3 := vp*vp*vp;
+        ivp3 := 1/vp3;
+        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt2*vpp)*ivp3;
+        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd "= pvv/d^4";
+        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
+        cvt := (vp3*cpt + vp*vp*vt2 + 3.0*vp*vp*T*vt*vtt
+          - 3.0*vtp*vp*T*vt2 + T*vt2*vt*vpp)*ivp3;
+
+        // not in cache
+        detPH := cp*pd;
+        dht := cv + pt/rho;
+        dhd := (pd - T*pt/rho)/rho;
+        ddph := dht/ detPH;
+        ddhp := -pt/detPH;
+        dtph := -dhd/detPH;
+        dthp := pd/detPH;
+        detPH_d := cv*pdd + (2.0*pt *(ptd - pt/rho) - ptt*pd)*T/(rho2);
+        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/rho2;
+        dhtt := cvt + ptt*v;
+        dhtd := (ptd - (T * ptt + pt)*v) *v;
+        ddhp_t := ddhp * (ptt / pt - detPH_t / detPH);
+        ddhp_d := ddhp * (ptd / pt - detPH_d / detPH);
+        ddph_t := ddph * (dhtt / dht - detPH_t / detPH);
+        ddph_d := ddph * (dhtd / dht - detPH_d / detPH);
+        dupp :=-(2.0*cp3*vp + cp3*p*vpp - 2.0*cp*cp*vt*v -
+              2.0*cpcpp*vtp*v - cpcpp*vt*vp + 2.0*cp*cp*T*vt2 +
+              3.0*cpcpp*vt*T*vtp - 4.0*T*vtt*cp*p*vt*v +
+              3.0*T*T*vtt*cp*p*vt2 + cp*p*vtt/rho2 - cpt*p*vt/rho2 +
+              2.0*cpt*p*vt2*v*T - cpt*p*vt2*T^2) / cp3;
+        duph := -(vtp*cpcpp + cp*cp*vt - cp*p*vtt*v + 2.0*cp*p*vt*T*vtt +
+              cpt*p*vt*v - cpt*p*vt2*T)/cp3;
+        duhh := -p*(cp*vtt - cpt*vt) / cp3;
+
+        // calculate derivatives
+        der_pro.x := 0.0;
+        der_pro.duhp := duph*p_der + duhh*h_der;
+        der_pro.duph :=  dupp*p_der + duph* h_der;
+        der_pro.ddph := (ddph * ddph_d + dtph * ddph_t)*p_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*h_der;
+        der_pro.ddhp := (ddhp * ddhp_d + dthp * ddhp_t)*h_der +
+           (ddph * ddhp_d + dtph * ddhp_t)*p_der;
+        der_pro.cp := (-(T * vtt * cp + cpt/rho - cpt * T * vt) / cp)*p_der + cpt/cp*h_der;
+        der_pro.s := -1/(rho*T)*p_der + 1/T*h_der;
+        der_pro.u := (-(p*vp*cp + cp*v - p*vt*v + p*vt2 *T)/cp)*p_der + ((cp - p*vt)/cp)*h_der;
+        der_pro.T := ((-v + T*vt)/cp)*p_der + (1/cp)*h_der;
+        der_pro.d := (-rho2*(vp*cp - vt/rho + T*vt2)/cp)*p_der + (-rho2*vt/(cp))*h_der;
+
+      else
+        assert(false, "Water_Ph_der: Incorrect region number");
+      end if;
+
+      annotation (
+        Window(
+          x=0.22,
+          y=0.2,
+          width=0.6,
+          height=0.6),
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end Water_Ph_der;
+
+    function Water_Ps_der
+      input Units.SI.AbsolutePressure p "Pression";
+      input Units.SI.SpecificEntropy s "Entropie spécifique";
+      input Integer mode = 0 "Région IF97 - 0:calcul automatique";
+
+      input Real p_der "derivative of Pressure";
+      input Real s_der "derivative of Specific enthropy";
+
+    protected
+      Boolean supercritical;
+
+      // variables taken from auxiliary record
+      Integer phase "phase: 2 for two-phase, 1 for one phase, 0 if unknown";
+      Integer region(min=1, max=5) "IF 97 region";
+      Units.SI.Temperature T "temperature";
+      Units.SI.SpecificEnthalpy h "specific enthalpy";
+      Units.SI.SpecificHeatCapacity R "gas constant";
+      Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+      Real cpt "derivative of cp w.r.t. temperature";
+      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+      Real cvt "derivative of cv w.r.t. temperature";
+      Units.SI.Density rho "density";
+      ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+        "derivative of pressure wrt temperature";
+      ThermoSysPro.Units.xSI.DerPressureByDensity pd
+        "derivative of pressure wrt density";
+      Real ptt "2nd derivative of pressure wrt temperature";
+      Real pdd "2nd derivative of pressure wrt density";
+      Real ptd "mixed derivative of pressure w.r.t. density and temperature";
+      Real vt "derivative of specific volume w.r.t. temperature";
+      Real vp "derivative of specific volume w.r.t. pressure";
+      Real vtt "2nd derivative of specific volume w.r.t. temperature";
+      Real vpp "2nd derivative of specific volume w.r.t. pressure";
+      Real vtp
+        "mixed derivative of specific volume w.r.t. pressure and temperature";
+      Real x "dryness fraction";
+      Real dpT "dp/dT derivative of saturation curve";
+      Units.SI.SpecificEntropy auxs "specific entropy";
+
+      // variables taken from waterBaseProp_ps
+      Integer error "error flag for inverse iterations";
+      Units.SI.SpecificEntropy s_liq "liquid specific entropy";
+      Units.SI.Density d_liq "liquid density";
+      Units.SI.SpecificEntropy s_vap "vapour specific entropy";
+      Units.SI.Density d_vap "vapour density";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd liq
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.PhaseBoundaryProperties3rd vap
+        "phase boundary property record";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd gl
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd gv
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd fl
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd fv
+        "dimensionless Helmholtz function and dervatives wrt delta and tau";
+      Units.SI.Temperature t1
+        "temperature at phase boundary, using inverse from region 1";
+      Units.SI.Temperature t2
+        "temperature at phase boundary, using inverse from region 2";
+
+      // variables needed
+      Real detPH;
+      Real dtsp;
+      Real dtps;
+      Real ddsp;
+      Real ddps;
+      Real dsd;
+
+      Real detPH_t;
+      Real detPH_d;
+
+      Real dcp_t;
+      Real dcp_d;
+
+      Real dcps;
+      Real dcpp;
+
+      Real dxv;
+      Real dxd;
+      Real dvTl;
+      Real dvTv;
+      Real dxT;
+      Real duTl;
+      Real duTv;
+      Real dpTT;
+      Real dxdd;
+      Real dxTd;
+      Real dvTTl;
+      Real dvTTv;
+      Real dxTT;
+      Real duTTl;
+      Real duTTv;
+
+      Real rho2;
+      Real cp3;
+      Real invcp3;
+      Real cpinv;
+      Real vt2;
+      Real pt2;
+      Real pt3;
+      Real quotient;
+
+    public
+      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro_der;
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                               g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau"                    annotation (Placement(
+            transformation(extent={{-90,-85},{-43.3333,-38.3333}}, rotation=0)));
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd
+                                                   f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau"
+        annotation (Placement(transformation(extent={{-23.3333,-85},{23.3333,
+                -38.3333}}, rotation=0)));
+    algorithm
+      //assert(false,"Water_ph: Derivatives of cp not yet functional");
+      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+      phase := if ((s < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(p)) or
+                   (s > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(p)) or
+                    supercritical) then 1 else 2;
+
+      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(p, s, phase, mode);
+
+      R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      auxs := s;
+      if (region == 1) then
+        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(p, s);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, T);
+
+        h := R*T*g.tau*g.gtau;
+        rho := p/(R*T*g.pi*g.gpi);
+        rho2 := rho*rho;
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        vt2 := vt*vt;
+        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        cp := -R*g.tau*g.tau*g.gtautau;
+        cpinv := 1/cp;
+        cp3 := cp*cp*cp;
+        invcp3 := 1/cp3;
+        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
+        x := 0.0;
+        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
+        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
+
+        // calculate derivative
+
+        pro_der.cp := cpinv*T*(-(vtt*cp-cpt*vt)*p_der + cpt*s_der);
+        pro_der.x := 0.0;
+        pro_der.ddps := (-rho2*(cp3*vpp + 3.0*cp*cp*T*vt*vtp +
+                3.0*T*T*vtt*cp*vt2 - T*T*vt2*vt*cpt + T*vt2*vt*cp)*invcp3)*p_der +
+                (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp - cpt*T*vt2 +
+                cp*vt2)*invcp3)*s_der;
+        pro_der.ddsp := (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp -
+                cpt*T*vt2 + cp*vt2)*invcp3)*p_der +
+                (-rho2*(-cpt*T*vt + cp*vt + T*vtt*cp)*T*invcp3)*s_der;
+        pro_der.h := p_der/rho + T*s_der;
+        pro_der.u := cpinv*(-p*(vp*cp+T*vt2)*p_der + (cp-p*vt)*T*s_der);
+        pro_der.d := cpinv*(-rho2 *(vp*cp+T*vt2)*p_der + (-rho2*vt*T)*s_der);
+        pro_der.T := (T*cpinv)*(vt*p_der  + s_der);
+
+      elseif (region == 2) then
+        T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(p, s);
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, T);
+
+        h := R*T*g.tau*g.gtau;
+        rho := p/(R*T*g.pi*g.gpi);
+        rho2 := rho*rho;
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        vt2 := vt*vt;
+        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        cp := -R*g.tau*g.tau*g.gtautau;
+        cpinv := 1/cp;
+        cp3 := cp*cp*cp;
+        invcp3 := 1/cp3;
+        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
+        x := 0.0;
+        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
+        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
+
+        // calculate derivative
+
+        pro_der.cp := cpinv*T*(-(vtt*cp-cpt*vt)*p_der + cpt*s_der);
+        pro_der.x := 0.0;
+        pro_der.ddps := (-rho2*(cp3*vpp + 3.0*cp*cp*T*vt*vtp +
+                3.0*T*T*vtt*cp*vt2 - T*T*vt2*vt*cpt + T*vt2*vt*cp)*invcp3)*p_der +
+                (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp - cpt*T*vt2 +
+                cp*vt2)*invcp3)*s_der;
+        pro_der.ddsp := (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp -
+                cpt*T*vt2 + cp*vt2)*invcp3)*p_der +
+                (-rho2*(-cpt*T*vt + cp*vt + T*vtt*cp)*T*invcp3)*s_der;
+        pro_der.h := p_der/rho + T*s_der;
+        pro_der.u := cpinv*(-p*(vp*cp+T*vt2)*p_der + (cp-p*vt)*T*s_der);
+        pro_der.d := cpinv*(-rho2 *(vp*cp+T*vt2)*p_der + (-rho2*vt*T)*s_der);
+        pro_der.T := (T*cpinv)*(vt*p_der  + s_der);
+
+      elseif (region == 3) then
+        (rho,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(p,s,delp=1.0e-7,dels=1.0e-6);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(rho, T);
+
+        rho2 := rho*rho;
+        h := R*T*(f.tau*f.ftau + f.delta*f.fdelta);
+        auxs := R*(f.tau*f.ftau - f.f);
+        pd := R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        pt := R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        pt2 := pt*pt;
+        pt3 := pt2*pt;
+        cv := abs(R*(-f.tau*f.tau*f.ftautau))
+          "can be close to neg. infinity near critical point";
+        cp := (rho2*pd*cv + T*pt*pt)/(rho*rho*pd);
+        pdd := R*T*f.delta/rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
+             f.delta*f.delta*f.fdeltadeltadelta);
+        ptt := R*rho*f.delta*f.tau*f.tau/T*f.fdeltatautau;
+        ptd := R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
+             -f.delta*f.tau*f.fdeltadeltatau);
+        cvt := R*f.tau*f.tau/T*(2.0*f.ftautau + f.tau*f.ftautautau);
+        x := 0.0;
+
+        // Not in cache
+        dsd := -pt/rho2;
+        detPH := cp*pd;
+
+        dtsp :=T*pd/detPH;
+        dtps :=-T*dsd/detPH;
+        ddsp :=-T*pt/detPH;
+        ddps :=cv/detPH;
+
+        detPH_t := cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/(rho2);
+        detPH_d := cv*pdd + (2.0*pt*(ptd - pt/rho) - ptt*pd)*T/(rho2);
+
+        dcp_t :=(detPH_t - cp*ptd)/pd;
+        dcp_d :=(detPH_d - cp*pdd)/pd;
+
+        dcps := ddsp * dcp_d + dtsp * dcp_t;
+        dcpp := ddps * dcp_d + dtps * dcp_t;
+
+        quotient := 1/(cv*rho2*pd + pt2*T);
+
+        pro_der.cp := dcps*s_der + dcpp*p_der;
+        pro_der.x := 0.0;
+        pro_der.ddps := rho2/(quotient*quotient*quotient)*(-(-cvt*T^2*pt3 + 3.0*cv^2*T*pt*rho2*ptd +
+                3.0*cv*T^2*pt2*ptt + cv*T*pt3 - 2.0*cv^2*rho*pt2*T +
+                cv^3*rho2*rho2*pdd)*p_der +
+                (pt2*T*cvt*rho2*pd + 2*pt2*T*cv*rho2*ptd + pt3*T^2*ptt -
+                pt2*cv*rho2*pd - 2.0*pt*T*ptt*cv*rho2*pd + cv^2*rho2*rho2*pt*pdd -
+                2.0*cv*rho*T*pt3 - cv^2*rho2*rho2*ptd*pd)*T*s_der);
+        pro_der.ddsp := quotient/(rho2*T*pt2)*(-(pt2*T*cvt*rho2*pd + 2.0*pt2*T*cv*rho2*ptd +
+                pt3*T^2*ptt - pt2*cv*rho2*pd - 2.0*pt*T*ptt*cv*rho2*pd +
+                cv^2*rho2*rho2*pt*pdd - 2.0*cv*rho*T*pt3 - cv^2*rho2*rho2*ptd*pd)*p_der -
+                (rho^3*pd^2*T*pt*cvt + 2.0*rho2*rho*pd*T*pt*cv*ptd +
+                2.0*rho*pd*T^2*pt2*ptt - rho2*rho*pd^2*pt*cv - ptt*rho2*rho*T*pd^2*cv -
+                T*pt2*rho2*rho*cv*pdd - T^2*pt3*rho*ptd + 2.0*T^2*pt2*pt2)*s_der);
+        pro_der.h := p_der/rho + T*s_der;
+        pro_der.u := quotient*((cv*rho2*pd-pt*p + pt2*T)*T*s_der + cv*p*p_der);
+        pro_der.d := rho2*quotient*(-T*pt*s_der + cv*p_der);
+        pro_der.T := T*quotient*(pt*p_der + rho2*pd*s_der);
+
+      elseif (region == 4) then
+        s_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sl_p(p);
+        s_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.sv_p(p);
+        x := if (s_vap <> s_liq) then (s - s_liq)/(s_vap - s_liq) else 1.0;
+        if p < ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PLIMIT4A then
+          t1 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps1(p, s_liq);
+          t2 := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tps2(p, s_vap);
+          gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, t1);
+          gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, t2);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(gl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.gibbsToBoundaryProps3rd(gv);
+          T := t1 + x*(t2 - t1);
+        else
+          T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(p);
+          d_liq := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_T(T);
+          d_vap := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_T(T);
+          fl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(d_liq, T);
+          fv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(d_vap, T);
+          liq := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(fl);
+          vap := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToBoundaryProps3rd(fv);
+        end if;
+        dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else
+             ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(T);
+        h := h + x*(vap.h - liq.h);
+        rho := liq.d*vap.d/(vap.d + x*(liq.d - vap.d));
+        rho2 := rho*rho;
+        //cp := liq.cp + x*(vap.cp - liq.cp);
+        //pt := liq.pt + x*(vap.pt - liq.pt);
+        //pd := liq.pd + x*(vap.pd - liq.pd);
+
+        dxv := if (liq.d <> vap.d) then liq.d*vap.d/(liq.d-vap.d) else 0.0;
+        dxd := -dxv/(rho2);
+        dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*dxv else ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(T);
+        dvTl := (liq.pt -dpT)/(liq.pd*liq.d*liq.d);
+        dvTv := (vap.pt -dpT)/(vap.pd*vap.d*vap.d);
+        dxT := -dxv*(dvTl + x*(dvTv-dvTl));
+        duTl := liq.cv + (T*liq.pt-p)*dvTl;
+        duTv := vap.cv + (T*vap.pt-p)*dvTv;
+        cv := duTl + x*(duTv-duTl) + dxT * (vap.u-liq.u);
+        dpTT := dxv*(vap.cv/T-liq.cv/T + dvTv*(vap.pt-dpT)-dvTl*(liq.pt-dpT));
+        dxdd := 2.0*dxv/(rho2*rho);
+        dxTd := dxv*dxv*(dvTv-dvTl)/(rho2);
+        dvTTl := ((liq.ptt-dpTT)/(liq.d*liq.d) + dvTl*(liq.d*dvTl*(2.0*liq.pd + liq.d*liq.pdd)
+             -2.0*liq.ptd))/liq.pd;
+        dvTTv := ((vap.ptt-dpTT)/(vap.d*vap.d) + dvTv*(vap.d*dvTv*(2.0*vap.pd + vap.d*vap.pdd)
+             -2.0*vap.ptd))/vap.pd;
+        dxTT := -dxv*(2.0*dxT*(dvTv-dvTl) + dvTTl + x*(dvTTv-dvTTl));
+        duTTl := liq.cvt +(liq.pt-dpT + T*(2.0*liq.ptt -liq.d*liq.d*liq.ptd *dvTl))*dvTl + (T*
+          liq.pt - p)*dvTTl;
+        duTTv := vap.cvt +(vap.pt-dpT + T*(2.0*vap.ptt -vap.d*vap.d*vap.ptd *dvTv))*dvTv + (T*
+          vap.pt - p)*dvTTv;
+        cvt := duTTl + x *(duTTv -duTTl) + 2.0*dxT*(duTv-duTl) + dxTT *(vap.u-liq.u);
+
+        // not in cache
+        detPH := T*dpT*dpT/(rho2);
+        dtps := 1.0 / dpT;
+        ddsp := -T*dpT/detPH;
+        ddps := cv/detPH;
+
+        ptt :=dpTT;
+
+        // calculate derivatives
+        pro_der.x := if (s_vap <> s_liq) then s_der/(s_vap - s_liq) else 0.0;
+        pro_der.ddps := (-rho2*(-cvt*T*dpT + 3.0*cv*T*ptt + cv*dpT -
+                2.0*cv^2*rho) / (dpT*dpT*dpT*dpT*T*T))*p_der +
+                ((T*ptt - 2.0*cv*rho)*rho2 / (dpT*dpT*dpT*T))*s_der;
+        pro_der.ddsp := (-(T*ptt - 2.0*cv*rho) / (rho2*T*dpT))*p_der +
+                (-2.0 /rho)*s_der;
+        pro_der.cp := 0.0;
+        pro_der.h := p_der/rho + T*s_der;
+        pro_der.u := (ddps*p/rho2)*p_der + (ddsp*p/rho2 + T)*s_der;
+        pro_der.d := ddps*p_der + ddsp*s_der;
+        pro_der.T := dtps*p_der;
+
+      elseif (region == 5) then
+        (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(p,s,relds=1.0e-7);
+        assert(error == 0, "error in inverse iteration of steam tables");
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(p, T);
+        h := R*T*g.tau*g.gtau;
+        rho := p/(R*T*g.pi*g.gpi);
+        rho2 := rho*rho;
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        vt2 := vt*vt;
+        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        cp := -R*g.tau*g.tau*g.gtautau;
+        cpinv := 1/cp;
+        cp3 := cp*cp*cp;
+        invcp3 := 1/cp3;
+        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
+        x := 0.0;
+        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
+        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
+
+        // calculate derivative
+
+        pro_der.cp := cpinv*T*(-(vtt*cp-cpt*vt)*p_der + cpt*s_der);
+        pro_der.x := 0.0;
+        pro_der.ddps := (-rho2*(cp3*vpp + 3.0*cp*cp*T*vt*vtp +
+                3.0*T*T*vtt*cp*vt2 - T*T*vt2*vt*cpt + T*vt2*vt*cp)*invcp3)*p_der +
+                (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp - cpt*T*vt2 +
+                cp*vt2)*invcp3)*s_der;
+        pro_der.ddsp := (-rho2*T*(2.0*vtt*T*vt*cp + cp*cp*vtp -
+                cpt*T*vt2 + cp*vt2)*invcp3)*p_der +
+                (-rho2*(-cpt*T*vt + cp*vt + T*vtt*cp)*T*invcp3)*s_der;
+        pro_der.h := p_der/rho + T*s_der;
+        pro_der.u := cpinv*(-p*(vp*cp+T*vt2)*p_der + (cp-p*vt)*T*s_der);
+        pro_der.d := cpinv*(-rho2 *(vp*cp+T*vt2)*p_der + (-rho2*vt*T)*s_der);
+        pro_der.T := (T*cpinv)*(vt*p_der  + s_der);
+      else
+        assert(false, "Water_Ps_der: Incorrect region number");
+      end if;
+      annotation (
+        Window(
+          x=0.22,
+          y=0.2,
+          width=0.6,
+          height=0.6),
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end Water_Ps_der;
+
+    function Water_PT_der
+      input Units.SI.AbsolutePressure p "pressure";
+      input Units.SI.Temperature T "Temperature";
+      input Integer mode = 0 "Région IF97 - 0:calcul automatique";
+
+      input Real p_der "Pression";
+      input Real T_der "Température";
+
+      output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro_der;
+    protected
+      Integer region;
+      Boolean supercritical;
+      Integer error;
+
+      Units.SI.Density d;
+
+      // From aux record
+      Units.SI.Pressure p_aux "pressure";
+      Units.SI.Temperature T_aux "temperature";
+      Units.SI.SpecificEnthalpy h "specific enthalpy";
+      Units.SI.SpecificHeatCapacity R "gas constant";
+      Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+      Real cpt "derivative of cp w.r.t. temperature";
+      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+      Real cvt "derivative of cv w.r.t. temperature";
+      Units.SI.Density rho "density";
+      Units.SI.SpecificEntropy s "specific entropy";
+      ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+        "derivative of pressure wrt temperature";
+      ThermoSysPro.Units.xSI.DerPressureByDensity pd
+        "derivative of pressure wrt density";
+      Real ptt "2nd derivative of pressure wrt temperature";
+      Real pdd "2nd derivative of pressure wrt density";
+      Real ptd "mixed derivative of pressure w.r.t. density and temperature";
+      Real vt "derivative of specific volume w.r.t. temperature";
+      Real vp "derivative of specific volume w.r.t. pressure";
+      Real vtt "2nd derivative of specific volume w.r.t. temperature";
+      Real vpp "2nd derivative of specific volume w.r.t. pressure";
+      Real vtp
+        "mixed derivative of specific volume w.r.t. pressure and temperature";
+      Real x "dryness fraction";
+      Real dpT "dp/dT derivative of saturation curve";
+
+      // needed
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+      Real vp3 "vp^3";
+      Real ivp3 "1/vp3";
+      Units.SI.SpecificVolume v;
+
+      Real rho2;
+      Real quotient;
+      Real quotient2;
+      Real pd2;
+      Real pd3;
+      Real pt2;
+      Real pt3;
+    algorithm
+
+      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(p, T, mode);
+      R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      if (region == 1) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(p, T);
+        x := 0.0;
+
+        h := R*T*g.tau*g.gtau;
+        s := R*(g.tau*g.gtau - g.g);
+        rho := p/(R*T*g.pi*g.gpi);
+        rho2 := rho*rho;
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        cp := -R*g.tau*g.tau*g.gtautau;
+        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
+        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
+        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
+        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+        v := 1/rho;
+        vp3 := vp*vp*vp;
+        ivp3 := 1/vp3;
+        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt*vt*vpp)*ivp3;
+        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd;
+        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
+        cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
+              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
+
+        // calculate the derivatives
+        pro_der.x := 0;
+        pro_der.duTp := (-vt - T*vtt - p*vtp)*p_der +
+              (cpt - p*vtt)*T_der;
+        pro_der.dupT := (-T*vtp - vp - p*vpp)*p_der +
+              (-vt - T*vtt - p*vtp)*T_der;
+        pro_der.ddpT := -rho2*(vpp*p_der + vtp*T_der);
+        pro_der.ddTp := -rho2*(vtp*p_der + vtt*T_der);
+        pro_der.cp := (-T*vtt)*p_der + cpt*T_der;
+        pro_der.s := (-vt)*p_der + (cp/T)*T_der;
+        pro_der.u := (v-T*vt)*p_der + (cp-p*vt)*T_der;
+        pro_der.h := (v - T*vt)*p_der + cp*T_der;
+        pro_der.d := -rho2*(vp*p_der + vt*T_der);
+
+      elseif (region == 2) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(p, T);
+        x := 1.0;
+
+        h := R*T*g.tau*g.gtau;
+        s := R*(g.tau*g.gtau - g.g);
+        rho := p/(R*T*g.pi*g.gpi);
+        rho2 := rho*rho;
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        cp := -R*g.tau*g.tau*g.gtautau;
+        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
+        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
+        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
+        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+        v := 1/rho;
+        vp3 := vp*vp*vp;
+        ivp3 := 1/vp3;
+        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt*vt*vpp)*ivp3;
+        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd;
+        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
+        cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
+              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
+
+        // calculate the derivatives
+        pro_der.x := 0;
+        pro_der.duTp := (-vt - T*vtt - p*vtp)*p_der +
+              (cpt - p*vtt)*T_der;
+        pro_der.dupT := (-T*vtp - vp - p*vpp)*p_der +
+              (-vt - T*vtt - p*vtp)*T_der;
+        pro_der.ddpT := -rho2*(vpp*p_der + vtp*T_der);
+        pro_der.ddTp := -rho2*(vtp*p_der + vtt*T_der);
+        pro_der.cp := (-T*vtt)*p_der + cpt*T_der;
+        pro_der.s := (-vt)*p_der + (cp/T)*T_der;
+        pro_der.u := (v-T*vt)*p_der + (cp-p*vt)*T_der;
+        pro_der.h := (v - T*vt)*p_der + cp*T_der;
+        pro_der.d := -rho2*(vp*p_der + vt*T_der);
+      elseif (region == 3) then
+        (rho,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(p,T,delp= 1.0e-7);
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(rho, T);
+
+        rho2 := rho*rho;
+        h := R*T*(f.tau*f.ftau + f.delta*f.fdelta);
+        s := R*(f.tau*f.ftau - f.f);
+        pd := R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        pd2 := pd*pd;
+        pd3 := pd*pd2;
+        pt := R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        pt2 := pt*pt;
+        pt3 := pt*pt*pt;
+        cv := R*(-f.tau*f.tau*f.ftautau);
+        x := 0.0;
+        pdd := R*T*f.delta/rho*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
+             f.delta*f.delta*f.fdeltadeltadelta);
+        ptt := R*rho*f.delta*f.tau*f.tau/T*f.fdeltatautau;
+        ptd := R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau -
+              f.delta*f.tau*f.fdeltadeltatau);
+        cvt := R*f.tau*f.tau/T*(2.0*f.ftautau + f.tau*f.ftautautau);
+        cpt := (cvt*pd + cv*ptd + (pt + 2.0*T*ptt)*pt/(rho2) -
+              pt*ptd)/pd;
+
+        // calculate the derivatives
+        pro_der.x := 0;
+        quotient := 1/(rho2*pd);
+        quotient2 := quotient/(rho*pd2);
+        pro_der.duTp := quotient2*(-(rho*pd2*T*ptt + ptd*rho*pd*p - 2.0*rho*pd*pt*T*ptd +
+              rho*pd2*pt - 2.0*pt*pd*p + 2.0*pd*pt2*T - pt*pdd*rho*p + pdd*rho*pt2*T)*p_der +
+              (rho2*rho*pd3*cvt - rho*pd2*ptt*p + 3.0*rho*pd2*pt*T*ptt +
+              2.0*ptd*rho*pd*pt*p - 3.0*ptd*rho*pd*pt2*T + rho*pd2*pt2 -
+              2.0*pt2*pd*p + 2.0*T*pt3*pd - pt2*pdd*rho*p + T*pt3*pdd*rho)*T_der);
+        pro_der.dupT := quotient2 *((rho*pd2 - rho*pd*T*ptd - 2.0*pd*p +
+              2.0*pd*T*pt - pdd*rho*p + pdd*rho*T*pt)*p_der -
+              (rho*pd2*T*ptt + ptd*rho*pd*p - 2.0*rho*pd*pt*T*ptd +
+              rho*pd2*pt - 2.0*pt*pd*p + 2.0*pd*pt2*T - pt*pdd*rho*p +
+              pdd*rho*pt2*T)*T_der);
+        pro_der.ddpT := -(1/pd3)*(pdd*p_der + (ptd*pd - pt*pdd)*T_der);
+        pro_der.ddTp := -(1/pd3)*((ptd*pd - pt*pdd)*p_der +
+              (ptt*pd2 - 2.0*pt*ptd*pd + pt2*pdd)*T_der);
+        pro_der.cp := quotient2*(-T*(rho*pd2*ptt - 2.0*rho*pd*pt*ptd +
+              2.0*pd*pt2 + pdd*rho*pt^2)*p_der +
+              (rho2*rho*pd3*cvt + 3.0*rho*pd2*pt*T*ptt + rho*pd2*pt2 -
+              3.0*ptd*rho*pd*pt2*T + 2.0*T*pt3*pd + T*pt3*pdd*rho)*T_der);
+        pro_der.s := quotient*(-pt*p_der + (cv*rho2*pd/T+pt2)*T_der);
+        pro_der.u := quotient*(-(-rho*pd + T*pt)*p_der +
+              (cv*rho2*pd - pt*p + pt2*T)*T_der);
+        pro_der.h := quotient*((-rho*pd + T*pt)*p_der +
+              (rho2*pd*cv + T*pt*pt)*T_der);
+        pro_der.d := (1/pd)*(p_der - pt*T_der);
+
+      elseif (region == 5) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5L3(p, T);
+        x := 1.0;
+
+        h := R*T*g.tau*g.gtau;
+        s := R*(g.tau*g.gtau - g.g);
+        rho := p/(R*T*g.pi*g.gpi);
+        rho2 := rho*rho;
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+        vp := R*T/(p*p)*g.pi*g.pi*g.gpipi;
+        cp := -R*g.tau*g.tau*g.gtautau;
+        cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gpitau)*(g.gpi - g.tau*g.gpitau)/g.gpipi));
+        vtt := R*g.pi/p*g.tau/T*g.tau*g.gpitautau;
+        vtp := R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+        vpp := R*T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+        cpt := R*g.tau*g.tau/T*(2*g.gtautau + g.tau*g.gtautautau);
+        pt := -g.p/g.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+        pd := -g.R*g.T*g.gpi*g.gpi/(g.gpipi);
+        v := 1/rho;
+        vp3 := vp*vp*vp;
+        ivp3 := 1/vp3;
+        ptt := -(vtt*vp*vp -2.0*vt*vtp*vp +vt*vt*vpp)*ivp3;
+        pdd := -vpp*ivp3/(rho2*rho2) - 2*v*pd;
+        ptd := (vtp*vp-vt*vpp)*ivp3/rho2 "= -ptv/d^2";
+        cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
+              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
+
+        // calculate the derivatives
+        pro_der.x := 0;
+        pro_der.duTp := (-vt - T*vtt - p*vtp)*p_der +
+              (cpt - p*vtt)*T_der;
+        pro_der.dupT := (-T*vtp - vp - p*vpp)*p_der +
+              (-vt - T*vtt - p*vtp)*T_der;
+        pro_der.ddpT := -rho2*(vpp*p_der + vtp*T_der);
+        pro_der.ddTp := -rho2*(vtp*p_der + vtt*T_der);
+        pro_der.cp := (-T*vtt)*p_der + cpt*T_der;
+        pro_der.s := (-vt)*p_der + (cp/T)*T_der;
+        pro_der.u := (v-T*vt)*p_der + (cp-p*vt)*T_der;
+        pro_der.h := (v - T*vt)*p_der + cp*T_der;
+        pro_der.d := -rho2*(vp*p_der + vt*T_der);
+      else
+        assert(false, "Water_pT_der: error in region computation of IF97 steam tables"
+        + "(p = " + String(p) + ", T = " + String(T) + ", region = " + String(region) + ")");
+      end if;
+
+      annotation (
+        Icon(graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end Water_PT_der;
+
+    function Water_sat_P_der
+      input Units.SI.AbsolutePressure P "Pression";
+
+      input Real P_der "derivative of pressure";
+
+    protected
+      Units.SI.Temperature T;
+      ThermoSysPro.Units.xSI.DerPressureByTemperature dpT
+        "dp/dT derivative of saturation curve";
+      Units.SI.Density d "density";
+      Units.SI.SpecificHeatCapacity cp
+        "Chaleur spécifique à pression constante";
+      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+      Real vt(unit="m3/(kg.K)")
+        "derivative of specific volume w.r.t. temperature";
+      Real vp(unit="m3/(kg.Pa)")
+        "derivative of specific volume w.r.t. pressure";
+      ThermoSysPro.Units.xSI.DerPressureByDensity pd
+        "Derivative of pressure wrt density";
+
+      Real vp3 "Third power of vp";
+      Real ivp3 "Inverse of third power of vp";
+
+      Real cvt "Derivative of cv w.r.t. temperature";
+      Real cpt "Derivative of cp w.r.t. temperature";
+
+      Real ptt "2nd derivative of pressure wrt temperature";
+      /*
+  Real pdd "2nd derivative of pressure wrt density";
+  Real ptd "Mixed derivative of pressure w.r.t. density and temperature";
+  */
+      Real vtt "2nd derivative of specific volume w.r.t. temperature";
+      Real vpp "2nd derivative of specific volume w.r.t. pressure";
+      Real vtp
+        "Mixed derivative of specific volume w.r.t. pressure and temperature";
+
+      Real v "specific volume";
+      Real pv;
+      //Real ptv;
+
+      Real tp;
+      Real p2;
+      Real pi2;
+
+    public
+      output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat dlsat
+                                        annotation (Placement(transformation(
+              extent={{-85,15},{-15,85}}, rotation=0)));
+      output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat dvsat
+                                        annotation (Placement(transformation(
+              extent={{15,15},{85,85}}, rotation=0)));
+    protected
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                               gl
+                               annotation (Placement(transformation(extent={{
+                -85,-85},{-15,-15}}, rotation=0)));
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd
+                                               gv
+                               annotation (Placement(transformation(extent={{15,
+                -85},{85,-15}}, rotation=0)));
+
+    algorithm
+      /*  if (not (P < SteamIF97.data.plimit4a)) then
+    assert(false, "Eau_sat_P: Pression > 16.5292e6 Pa");
+  end if;*/
+
+      T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(P);
+
+      // get Gibbs derivatives of third order
+      gl := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(P, T);
+      gv := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(P, T);
+
+      // Precalculs
+      dpT := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dptofT(T);
+      ptt := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.d2ptofT(T);
+      tp := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dtsatofp(P);
+      p2 := gl.p*gl.p;
+      pi2 := gl.pi*gl.pi;
+
+      // compute variables for liquid
+      d := gl.p/(gl.R*T*gl.pi*gl.gpi);
+      vp := gl.R*T/(p2)*pi2*gl.gpipi;
+      vt := gl.R/gl.p*gl.pi*(gl.gpi - gl.tau*gl.gpitau);
+      cp := -gl.R*gl.tau*gl.tau*gl.gtautau;
+      v :=1/d;
+      cv := gl.R*(-gl.tau*gl.tau*gl.gtautau +
+          (gl.gpi - gl.tau*gl.gpitau)*(gl.gpi - gl.tau*gl.gpitau)/(gl.gpipi));
+
+      // variables needed only for derivitve of cp
+
+      pd := -gl.R*T*gl.gpi*gl.gpi/(gl.gpipi);
+      pv := -pd*d*d;
+
+      vtt := gl.R*gl.pi/gl.p*gl.tau/T*gl.tau*gl.gpitautau;
+
+      vtp := gl.R*pi2/(p2)*(gl.gpipi - gl.tau*gl.gpipitau);
+      vpp := gl.R*T*pi2*gl.pi/(p2*gl.p)*gl.gpipipi;
+      vp3 := vp*vp*vp;
+      ivp3 := 1/vp3;
+      /*
+  ptt := -(vtt*vp*vp -2.0*vt*vtp*vp + vt*vt*vpp)*ivp3;
+
+  ptd := (vtp*vp-vt*vpp)*ivp3/(d*d) "= -ptv/d^2";
+  ptv := -ptd/(v*v);
+  */
+
+      cpt := gl.R*gl.tau*gl.tau/T*(2*gl.gtautau + gl.tau*gl.gtautautau);
+      cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
+              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
+
+      // compute derivatives for liquid
+      //dlsat.u := (cv + (T*dpT - P)*vt)*tp*P_der;
+      dlsat.pt := ptt*tp*P_der;
+      dlsat.cv := cvt*tp*P_der;
+      dlsat.cp := (cvt*tp + vp*dpT + ((v*pv + T*dpT)*vtp + (vp*pv + tp*dpT)*vt))*P_der;
+      //dlsat.cp := (cvt + (vt*dpT + ptt*v) + ((v*pv + T*dpT)*vtt + (vt*pv + v*ptv + dpT + T*ptt)*vt))*tp*P_der;
+      dlsat.h := (v - T*vt)*P_der + cp/dpT*P_der;
+      dlsat.rho := -d*d*(vp + vt/dpT)*P_der;
+      dlsat.T := tp*P_der;
+      dlsat.P := P_der;
+
+      p2 := gv.p*gv.p;
+      pi2 := gv.pi*gv.pi;
+
+      // compute variables for liquid
+      d := gv.p/(gv.R*T*gv.pi*gv.gpi);
+      vp := gv.R*T/(p2)*pi2*gv.gpipi;
+      vt := gv.R/gv.p*gv.pi*(gv.gpi - gv.tau*gv.gpitau);
+      cp := -gv.R*gv.tau*gv.tau*gv.gtautau;
+      v :=1/d;
+      cv := gv.R*(-gv.tau*gv.tau*gv.gtautau +
+        (gv.gpi - gv.tau*gv.gpitau)*(gv.gpi - gv.tau*gv.gpitau)/(gv.gpipi));
+
+      // variables needed only for derivitve of cp
+
+      pd := -gv.R*T*gv.gpi*gv.gpi/(gv.gpipi);
+      pv := -pd*d*d;
+
+      vtt := gv.R*gv.pi/gv.p*gv.tau/T*gv.tau*gv.gpitautau;
+
+      vtp := gv.R*pi2/(p2)*(gv.gpipi - gv.tau*gv.gpipitau);
+      vpp := gv.R*T*pi2*gv.pi/(p2*gv.p)*gv.gpipipi;
+      vp3 := vp*vp*vp;
+      ivp3 := 1/vp3;
+      /*
+  ptt := -(vtt*vp*vp -2.0*vt*vtp*vp + vt*vt*vpp)*ivp3;
+
+  ptd := (vtp*vp-vt*vpp)*ivp3/(d*d) "= -ptv/d^2";
+  ptv := -ptd/(v*v);
+  */
+
+      cpt := gv.R*gv.tau*gv.tau/T*(2*gv.gtautau + gv.tau*gv.gtautautau);
+      cvt := (vp3*cpt + vp*vp*vt*vt + 3.0*vp*vp*T*vt*vtt -
+              3.0*vtp*vp*T*vt*vt + T*vt*vt*vt*vpp)*ivp3;
+
+      // Compute the derivatives for vapour
+      //dvsat.u := (cv + (T*dpT - P)*vt)*tp*P_der;
+      dvsat.pt := ptt*tp*P_der;
+      dvsat.cv := cvt*tp*P_der;
+      dvsat.cp := (cvt*tp + vp*dpT + ((v*pv + T*dpT)*vtp + (vp*pv + tp*dpT)*vt))*P_der;
+      //dlsat.cp := (cvt + (vt*dpT + ptt*v) + ((v*pv + T*dpT)*vtt + (vt*pv + v*ptv + dpT + T*ptt)*vt))*tp*P_der;
+      dvsat.h := (v - T*vt)*P_der + cp/dpT*P_der;
+      dvsat.rho := -d*d*(vp + vt/dpT)*P_der;
+      dvsat.T := tp *P_der;
+      dvsat.P := P_der;
+
+      annotation (
+        Window(
+          x=0.34,
+          y=0.21,
+          width=0.6,
+          height=0.6),
+        Icon(coordinateSystem(
+            preserveAspectRatio=false,
+            extent={{-100,-100},{100,100}},
+            grid={2,2}), graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end Water_sat_P_der;
+
+    function SpecificEnthalpy_PT_der
+      input Units.SI.AbsolutePressure p "pressure";
+      input Units.SI.Temperature T "Temperature";
+      input Integer mode = 0 "Région IF97 - 0:calcul automatique";
+
+      input Real p_der "Pression";
+      input Real T_der "Température";
+
+      output Real H "specific enthalpy";
+    protected
+      Integer region;
+      Boolean supercritical;
+      Integer error;
+
+      Units.SI.SpecificHeatCapacity R "gas constant";
+      Units.SI.SpecificHeatCapacity cp "specific heat capacity";
+      Units.SI.SpecificHeatCapacity cv "specific heat capacity";
+      Units.SI.Density rho "density";
+      ThermoSysPro.Units.xSI.DerPressureByTemperature pt
+        "derivative of pressure wrt temperature";
+      ThermoSysPro.Units.xSI.DerPressureByDensity pd
+        "derivative of pressure wrt density";
+
+      Real vt "derivative of specific volume w.r.t. temperature";
+
+      // needed
+      ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs g
+        "dimensionless Gibbs funcion and dervatives wrt pi and tau";
+      ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs f
+        "dimensionless Helmholtz funcion and dervatives wrt delta and tau";
+
+      Real rho2;
+
+    algorithm
+      supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+      region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_pT(p, T, mode);
+      R :=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+      if (region == 1) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
+
+        rho := p/(R*T*g.pi*g.gpi);
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        cp := -R*g.tau*g.tau*g.gtautau;
+
+        H := (1/rho - T*vt)*p_der + cp*T_der;
+
+      elseif (region == 2) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
+        rho := p/(R*T*g.pi*g.gpi);
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        cp := -R*g.tau*g.tau*g.gtautau;
+
+        H := (1/rho - T*vt)*p_der + cp*T_der;
+      elseif (region == 3) then
+        (rho,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dofpt3(p,T,delp= 1.0e-7);
+        rho2 := rho*rho;
+        f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(rho, T);
+
+        pd := R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+        pt := R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+        cv := R*(-f.tau*f.tau*f.ftautau);
+
+        H := 1/(rho2*pd)*((-rho*pd + T*pt)*p_der +
+              (rho2*pd*cv + T*pt*p)*T_der);
+
+      elseif (region == 5) then
+        g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
+        rho := p/(R*T*g.pi*g.gpi);
+        vt := R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi);
+        cp := -R*g.tau*g.tau*g.gtautau;
+
+        H := (1/rho - T*vt)*p_der + cp*T_der;
+      else
+        assert(false, "Water_pT_der: error in region computation of IF97 steam tables"
+        + "(p = " + String(p) + ", T = " + String(T) + ", region = " + String(region) + ")");
+      end if;
+
+      annotation (
+        Icon(graphics={
+            Text(extent={{-134,104},{142,44}}, textString=
+                                                   "%name"),
+            Ellipse(
+              extent={{-100,40},{100,-100}},
+              lineColor={255,127,0},
+              fillColor={255,255,255},
+              fillPattern=FillPattern.Solid),
+            Text(
+              extent={{-84,-4},{84,-52}},
+              lineColor={255,127,0},
+              textString=
+                   "fonction")}),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+    end SpecificEnthalpy_PT_der;
+
+    package Unused
+      "unused functions for which no analytic derivative can be provided"
+      function Water_rhoT
+        input Units.SI.Density rho "Masse volumique";
+        input Units.SI.Temperature T "Température";
+        input Integer phase "2: diphasique, 1 sinon";
+        input Integer mode = 0 "Région IF97 - 0:calcul automatique";
+        output ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_dT
+                                          pro;
+
+      protected
+        Integer region;
+        Integer error;
+        Boolean supercritical;
+        Units.SI.AbsolutePressure p;
+      protected
+        ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                           g annotation (Placement(transformation(extent={{-90,
+                  -85},{-43.3333,-38.3333}}, rotation=0)));
+        ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
+                               f
+          annotation (Placement(transformation(extent={{-23.3333,-85},{23.3333,
+                  -38.3333}}, rotation=0)));
+      algorithm
+        region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_dT(rho, T, phase, mode);
+        if (region == 1) then
+          (p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(d=rho, T=T, reldd=ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData.DELD, region=1);
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1(p, T);
+          supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+          pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_dT(
+                                        g);
+          pro.x := if (supercritical) then -1 else 0;
+        elseif (region == 2) then
+          (p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(d=rho, T=T, reldd=ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData.DELD, region=2);
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2(p, T);
+          supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+          pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_dT(
+                                        g);
+          pro.x := if (supercritical) then -1 else 1;
+        elseif (region == 3) then
+          f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3(rho, T);
+          pro := ThermoSysPro.Properties.WaterSteam.Common.helmholtzToProps_dT(
+                                            f);
+          pro.x := if (supercritical) then -1 else 0;
+          supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+        elseif (region == 4) then
+          pro := ThermoSysPro.Properties.WaterSteam.BaseIF97.TwoPhase.waterR4_dT(d=rho, T=T);
+        elseif (region == 5) then
+          (p,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.pofdt125(d=rho, T=T, reldd=ThermoSysPro.Properties.WaterSteam.BaseIF97.IterationData.DELD, region=5);
+          g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g5(p, T);
+          supercritical := (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT);
+          pro := ThermoSysPro.Properties.WaterSteam.Common.gibbsToProps_dT(
+                                        g);
+          pro.x := if (supercritical) then -1 else 1;
+        else
+          assert(false, "Eau_rhoT: Numéro de région incorrect");
+        end if;
+        annotation (
+          Window(
+            x=0.3,
+            y=0.14,
+            width=0.6,
+            height=0.6),
+          Icon(coordinateSystem(
+              preserveAspectRatio=false,
+              extent={{-100,-100},{100,100}},
+              grid={2,2}), graphics={
+              Text(extent={{-134,104},{142,44}}, textString=
+                                                     "%name"),
+              Ellipse(
+                extent={{-100,40},{100,-100}},
+                lineColor={255,127,0},
+                fillColor={255,255,255},
+                fillPattern=FillPattern.Solid),
+              Text(
+                extent={{-84,-4},{84,-52}},
+                lineColor={255,127,0},
+                textString=
+                     "fonction"),
+              Ellipse(
+                extent={{-100,100},{-60,-100}},
+                lineColor={255,0,0},
+                fillColor={255,0,0},
+                fillPattern=FillPattern.Solid)}),
+          Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+      end Water_rhoT;
+
+      function Water_h_is
+        input Units.SI.AbsolutePressure p;
+        input Units.SI.SpecificEntropy s;
+        input Integer phase;
+        input Integer mode = 0;
+        output Units.SI.SpecificEnthalpy h;
+
+      protected
+        Integer region;
+        Integer error;
+        Units.SI.Temperature T;
+        Units.SI.Density d;
+      protected
+        ThermoSysPro.Properties.WaterSteam.Common.HelmholtzData
+                             dTR(R=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O)
+          annotation (Placement(transformation(extent={{-85,15},{-15,85}},
+                rotation=0)));
+        ThermoSysPro.Properties.WaterSteam.Common.GibbsData
+                         pTR(R=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O)
+          annotation (Placement(transformation(extent={{15,15},{85,85}},
+                rotation=0)));
+        ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs
+                           g annotation (Placement(transformation(extent={{-85,
+                  -85},{-15,-15}}, rotation=0)));
+        ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs
+                               f annotation (Placement(transformation(extent={{
+                  15,-85},{85,-15}}, rotation=0)));
+      algorithm
+
+        region := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.region_ps(p, s, phase, mode);
+        if (region == 1) then
+          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofps1(p, s);
+        elseif (region == 2) then
+          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofps2(p, s);
+        elseif (region == 3) then
+          (d,T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.dtofps3(p=p, s=s, delp=1.0e-7, dels=1.0e-6);
+          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofdT3(d, T);
+        elseif (region == 4) then
+          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofps4(p, s);
+        elseif (region == 5) then
+          (T,error) := ThermoSysPro.Properties.WaterSteam.BaseIF97.Inverses.tofps5(p=p, s=s, relds=1.0e-7);
+          h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Isentropic.hofpT5(p, T);
+        else
+          assert(false, "Eau_H_is: Numéro de région incorrect");
+        end if;
+        annotation (
+          Window(
+            x=0.27,
+            y=0.15,
+            width=0.6,
+            height=0.6),
+          Icon(coordinateSystem(
+              preserveAspectRatio=false,
+              extent={{-100,-100},{100,100}},
+              grid={2,2}), graphics={
+              Text(extent={{-134,104},{142,44}}, textString=
+                                                     "%name"),
+              Ellipse(
+                extent={{-100,40},{100,-100}},
+                lineColor={255,127,0},
+                fillColor={255,255,255},
+                fillPattern=FillPattern.Solid),
+              Text(
+                extent={{-84,-4},{84,-52}},
+                lineColor={255,127,0},
+                textString=
+                     "fonction"),
+              Ellipse(
+                extent={{-100,100},{-60,-100}},
+                lineColor={255,0,0},
+                fillColor={255,0,0},
+                fillPattern=FillPattern.Solid)}),
+          Documentation(info="<html>
+<p><b>Version 1.4</b></p>
+</HTML>
+"));
+      end Water_h_is;
+      annotation (Icon(graphics={
+            Text(
+              extent={{-102,0},{24,-26}},
+              lineColor={242,148,0},
+              textString=
+                   "Thermo"),
+            Text(
+              extent={{-4,8},{68,-34}},
+              lineColor={46,170,220},
+              textString=
+                   "SysPro"),
+            Polygon(
+              points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},
+                  {42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},
+                  {-50,6},{-62,2}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{
+                  -46,8},{-42,22},{-42,30},{-44,38}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{
+                  -12,12},{-26,12},{-28,12},{-26,20}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-8,30},{-6,26}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-8,36},{-6,32}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-8,42},{-6,38}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-8,48},{-6,44}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-4,32},{-2,28}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-4,38},{-2,34}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-4,44},{-2,40}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-4,50},{-2,46}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                  20}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},
+                  {42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},
+                  {-50,6},{-62,2}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Line(
+              points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+              color={46,170,220},
+              thickness=0.5),
+            Line(
+              points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+              color={46,170,220},
+              thickness=0.5),
+            Line(
+              points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+              color={46,170,220},
+              thickness=0.5),
+            Polygon(
+              points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+            Line(
+              points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+              color={0,0,255},
+              smooth=Smooth.None),
+            Line(
+              points={{80,80},{100,100}},
+              color={0,0,255},
+              smooth=Smooth.None)}));
+    end Unused;
+
+    package Spline_Utilities
+      constant Spline_Utilities.Modelica_Interpolation.Bspline1D.Data IF97_spline(
+          ndim = 1,
+          ncontrol = 100,
+          degree = 3,
+          knots = {
+          2.93063160225403e-007, 2.93063160225403e-007, 2.93063160225403e-007, 2.93063160225403e-007,
+          0.0150553301018805, 0.0225746360796844, 0.0300841766610507, 0.0375864719559614,
+          0.0450833779282367, 0.0525763026035424, 0.0600663541987385, 0.0675544420190098,
+          0.0750413446792581, 0.0825277558142009, 0.0900143143696351, 0.0975016244159301,
+          0.104990267916964, 0.11248081283071, 0.119973818177067, 0.127469837190213,
+          0.134969419310924, 0.14247311152242, 0.149981459358957, 0.157495007796453,
+          0.165014302152702, 0.172539889069826, 0.180072317615317, 0.187612140514708,
+          0.195159915514515, 0.202716206865773, 0.21028158691427, 0.217856637782066,
+          0.225441953125109, 0.233038139953034, 0.240645820499176, 0.248265634131007,
+          0.255898239293619, 0.26354431548115, 0.271204565233372, 0.278879716156774,
+          0.286570522971491, 0.294277769587339, 0.302002271213962, 0.309744876511783,
+          0.317506469792076, 0.325287973276035, 0.333090349424309, 0.340914603350119,
+          0.348761785330786, 0.356632993434437, 0.364529376280738, 0.372452135957019,
+          0.380402531113975, 0.388381880268579, 0.39639156534589, 0.404433035496425,
+          0.412507811231662, 0.420617488927502, 0.42876374575417, 0.436948345101518,
+          0.445173142581185, 0.453440092702033, 0.461751256332929, 0.470108809087968,
+          0.478515050793845, 0.486972416228223, 0.495483487352128, 0.50405100729972,
+          0.512677896436249, 0.521367270850924, 0.53012246371707, 0.538947050028345,
+          0.547844875307676, 0.556820088984304, 0.565877183242573, 0.575021038260507,
+          0.584256974874285, 0.593590815826759, 0.603028956896544, 0.612578449397273,
+          0.622247095874125, 0.632043561486359, 0.641977504873387, 0.652059734791795,
+          0.662302403295546, 0.672719253852374, 0.6833259549907, 0.694140568427125,
+          0.705184226398132, 0.716482126202646, 0.728064988229839, 0.739971159691273,
+          0.752249564928059, 0.764963678571606, 0.77819659006882, 0.79205900502822,
+          0.806726369054731, 0.822437269975835, 0.839573763094594, 0.858852425095749,
+          1, 1, 1, 1},
+          controlPoints = [
+          6.41617166788097; 6.59657375859249; 6.85956502478188; 7.19550228677957;
+          7.44003141655459; 7.67746343199683; 7.90809030002524; 8.1321863948823;
+          8.35001072138466; 8.56180824123764; 8.76781112389037; 8.96823977601129;
+          9.16330374171574; 9.35320248746118; 9.53812609634101; 9.71825588651749;
+          9.89376496619584; 10.064818734583; 10.2315753364618; 10.394186076569;
+          10.552795798896; 10.7075432351955; 10.8585613263155; 11.0059775194514;
+          11.1499140439677; 11.2904881680785; 11.427812438369; 11.561994903882;
+          11.6931393262684; 11.8213453773153; 11.9467088249962; 12.0693217090492;
+          12.1892725069664; 12.3066462911727; 12.421524878079; 12.5339869696189;
+          12.644108287808; 12.7519617028068; 12.8576173549182; 12.9611427709053;
+          13.06260297498; 13.1620605947781; 13.25957596261; 13.355207212251;
+          13.4490103715159; 13.5410394508422; 13.6313465280923; 13.7199818297721;
+          13.8069938088494; 13.892429219348; 13.9763331878828; 14.0587492822951;
+          14.1397195775398; 14.2192847189711; 14.297483983169; 14.3743553364442;
+          14.4499354911556; 14.524259959973; 14.5973631082143; 14.6692782043857;
+          14.740037469051; 14.8096721221595; 14.8782124289575; 14.9456877446163;
+          15.0121265577065; 15.0775565326579; 15.1420045513451; 15.2054967539465;
+          15.2680585792283; 15.3297148044048; 15.3904895847271; 15.4504064929423;
+          15.5094885587568; 15.5677583084284; 15.6252378046292; 15.6819486867911;
+          15.7379122123276; 15.7931492995096; 15.8476805734722; 15.9015264179811;
+          15.9547070373259; 16.0072425350593; 16.0591530191528; 16.11045874587;
+          16.1611803164475; 16.211338938197; 16.2609567565343; 16.3100572327281;
+          16.3586655540358; 16.4068088127073; 16.4545163733577; 16.501817689937;
+          16.5487496364798; 16.5953631575021; 16.6418467771832; 16.6879750106034;
+          16.7343150270632; 16.8752144692458; 16.9266730020941; 16.9094578790152]);
+
+      record Data "Datastructure of a Bspline"
+        parameter Integer ndim(min=1)
+          "Number of dimensions of one control point";
+        parameter Integer ncontrol(min=1) "Number of control points";
+        parameter Integer degree(min=1) "Polynomial degree of the Bspline";
+        Real knots[ncontrol+degree+1] "Knot vector of the Bspline";
+        Real controlPoints[ncontrol,ndim] "[i,:] is data of control point i";
+      end Data;
+
+      function safeEvaluate
+        "Evaluate Bspline at one parameter safely, i.e. points outside the domain of the spline are moved inside the domain."
+        extends Modelica.Icons.Function;
+        input Data spline "Bspline to be evaluated";
+        input Real u "Parameter value at which Bspline shall be evaluated";
+        output Real x[spline.ndim] "Value of Bspline at u";
+      protected
+        Real eps = 1e-10 "accurate enough?";
+        Real umin =  spline.knots[1] + eps*abs(spline.knots[1]);
+        Real umax =  spline.knots[end] - eps*abs(spline.knots[end]);
+        Real ulim;
+      algorithm
+        ulim := min(max(u,umin),umax);
+        x := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.evaluate(spline, ulim);
+      end safeEvaluate;
+
+        function safeEvaluateDer
+        "Evaluate Bspline at one parameter safely, i.e. points outside the domain of the spline are moved inside the domain."
+          extends Modelica.Icons.Function;
+          input Data spline "Bspline to be evaluated";
+          input Real u "Parameter value at which Bspline shall be evaluated";
+          output Real x[spline.ndim] "Value of Bspline at u";
+          output Real xd[spline.ndim] "First derivative of Bspline at u";
+      protected
+          Real eps = 1e-10 "accurate enough?";
+          Real umin =  spline.knots[1] + eps*abs(spline.knots[1]);
+          Real umax =  spline.knots[end] - eps*abs(spline.knots[end]);
+          Real ulim;
+        algorithm
+          ulim := min(max(u,umin),umax);
+          (x,xd) := evaluateDer(spline, ulim);
+        end safeEvaluateDer;
+
+      function evaluate "Evaluate Bspline at one parameter"
+        extends Modelica.Icons.Function;
+        input Data spline "Bspline to be evaluated";
+        input Real u "Parameter value at which Bspline shall be evaluated";
+        output Real x[spline.ndim] "Value of Bspline at u";
+
+      protected
+        Integer span;
+        Real N[spline.degree+1];
+      algorithm
+        x := zeros(spline.ndim);
+        span := Utilities.n_findSpan(spline.degree, u, spline.knots);
+        N := Utilities.n_BasisFuns(span, u, spline.degree, spline.knots);
+
+        for i in 1:spline.ndim loop
+          x[i] := N*spline.controlPoints[span-spline.degree:span,i];
+        end for;
+      end evaluate;
+
+      function evaluateDer
+        "Evaluate Bspline and its first derivative at one parameter"
+        extends Modelica.Icons.Function;
+        input Data spline "Bspline to be evaluated";
+        input Real u "Parameter value at which Bspline shall be evaluated";
+        output Real x[spline.ndim] "Value of Bspline at u";
+        output Real xd[spline.ndim] "First derivative of Bspline at u";
+      protected
+        Integer span;
+        Real N[2,spline.degree+1];
+      algorithm
+        //Grenzwert von rechts lim (h->0) (f(x+h)-f(x))/h
+        x := zeros(spline.ndim);
+        xd := zeros(spline.ndim);
+
+        span := Utilities.n_findSpan(spline.degree, u, spline.knots);
+        N := Utilities.n_DersBasisFuns(span, u, spline.degree, 1, spline.knots);
+
+        for i in 1:spline.ndim loop
+          x[i] := N[1,:]*spline.controlPoints[span-spline.degree:span,i];
+          xd[i] := N[2,:]*spline.controlPoints[span-spline.degree:span,i];
+        end for;
+
+      end evaluateDer;
+
+      package Utilities "spline utility functions"
+        function n_BasisFuns "Compute the nonvanishing basis functions"
+          extends Modelica.Icons.Function;
+          input Integer i "index";
+          input Real u "parameter";
+          input Integer p "degree";
+          input Real knots[:] "knot vector";
+          output Real N[p+1] "Basis functions";
+        protected
+          Integer j;
+          Integer r;
+          Real left[p+1];
+          Real right[p+1];
+          Real temp;
+          Real saved;
+        algorithm
+          /*
+           The NURBS Book: Algorithm A2.2 (page 70)
+        */
+          N[1] := 1;
+          for j in 1:p loop
+            left[j] := u - knots[i+1-j];
+            right[j] := knots[i+j] - u;
+            saved := 0.0;
+
+            for r in 1:j loop
+              temp := N[r]/(right[r]+left[j-r+1]);
+              N[r] := saved + right[r]*temp;
+              saved := left[j-r+1]*temp;
+
+            end for;
+            N[j+1] := saved;
+          end for;
+        end n_BasisFuns;
+
+        function n_DersBasisFuns
+          "Compute nonzero basis functions and their derivatives"
+          extends Modelica.Icons.Function;
+          input Integer i "index";
+          input Real u "parameter";
+          input Integer p "degree";
+          input Integer n "n-th derivative";
+          input Real knots[:] "knot vector";
+          output Real ders[n+1,p+1] "ders[k,:] is (k-1)-th derivative";
+        protected
+          Integer j;
+          Integer r;
+          Real left[p+1];
+          Real right[p+1];
+          Real temp;
+          Real saved;
+          Real ndu[p+1,p+1];
+          Integer s1;
+          Integer s2;
+          Integer j1;
+          Integer j2;
+          Real a[2,p+1];
+          Real d;
+          Integer rk;
+          Integer pk;
+          Integer prod;
+          Integer tt;
+        algorithm
+          /*
+           The NURBS Book: Algorithm A2.3 (page 72)
+        */
+          ndu[1,1] := 1;
+          for j in 1:p loop
+            left[j] := u - knots[i+1-j];
+            right[j] := knots[i+j] - u;
+            saved := 0.0;
+
+            for r in 1:j loop
+              ndu[j+1,r] := right[r]+left[j-r+1];
+              temp := ndu[r,j]/ndu[j+1,r];
+              ndu[r,j+1] := saved + right[r]*temp;
+              saved := left[j-r+1]*temp;
+
+            end for;
+            ndu[j+1,j+1] := saved;
+          end for;
+
+          for j in 1:p+1 loop
+            ders[1,j] := ndu[j,p+1];
+          end for;
+
+          for r in 1:p+1 loop
+            s1 := 1;
+            s2 := 2;
+            a[1,1] := 1.0;
+
+            for k in 1:n loop
+              d := 0.0;
+              rk := r-k-1;
+              pk := p-k;
+
+              if r-1>=k then
+                a[s2,1] := a[s1,1]/ndu[pk+2,rk+1];
+                d := a[s2,1]*ndu[rk+1,pk+1];
+
+              end if;
+
+              if rk >= -1 then
+                j1 :=1;
+
+              else
+                j1 :=-rk;
+
+              end if;
+
+              if r-1 <= pk+1 then
+                j2 := k-1;
+
+              else
+                j2 := p-r+1;
+
+              end if;
+
+              for j in j1:j2 loop
+                a[s2,j+1] :=(a[s1, j + 1] - a[s1, j])/ndu[pk + 2, rk + j + 1];
+                d :=d + a[s2, j + 1]*ndu[rk + j + 1, pk + 1];
+
+              end for;
+
+              if r-1 <= pk then
+                a[s2,k+1] := -a[s1,k]/ndu[pk+2,r];
+                d := d + a[s2,k+1]*ndu[r,pk+1];
+
+              end if;
+
+              ders[k+1,r] := d;
+              tt := s1;
+              s1 := s2;
+              s2 := tt;
+
+            end for;
+          end for;
+
+          prod := p;
+
+          for k in 1:n loop
+
+            for j in 1:p+1 loop
+              ders[k+1,j] := ders[k+1,j]*prod;
+
+            end for;
+            prod := prod*(p-k);
+
+          end for;
+
+        end n_DersBasisFuns;
+
+        function n_findSpan "Determine the knot span index"
+          extends Modelica.Icons.Function;
+          input Integer p "degree";
+          input Real u "parameter";
+          input Real knots[:] "knot vector";
+          output Integer i "The knot span index";
+        protected
+          Integer n;
+          Integer low;
+          Integer high;
+          Integer mid;
+        algorithm
+          /*
+           The NURBS Book: Algorithm A2.1 (page 68)
+        */
+          n:=size(knots,1)-p-1;
+
+          if abs(u-knots[n+1])<10e-12 then
+            i := n;
+          elseif abs(u-knots[1])<10e-12 then
+            i := 1;
+          else
+            low := p;
+            high := n+1;
+            mid := integer((low+high)/2);
+
+            while
+              (u<knots[mid] or u>=knots[mid+1]) loop
+              assert(low+1<high,"Value must be within limits for Utilities.n_findSpan");
+
+              if (u<knots[mid]) then
+                high := mid;
+
+              else
+                low := mid;
+
+              end if;
+              mid := integer((low+high)/2);
+
+            end while;
+            i := mid;
+
+          end if;
+        end n_findSpan;
+
+        annotation (Icon(graphics={
+              Text(
+                extent={{-102,0},{24,-26}},
+                lineColor={242,148,0},
+                textString=
+                     "Thermo"),
+              Text(
+                extent={{-4,8},{68,-34}},
+                lineColor={46,170,220},
+                textString=
+                     "SysPro"),
+              Polygon(
+                points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},
+                    {42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,
+                    10},{-50,6},{-62,2}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{
+                    -46,8},{-42,22},{-42,30},{-44,38}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{
+                    -12,12},{-26,12},{-28,12},{-26,20}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-8,30},{-6,26}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-8,36},{-6,32}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-8,42},{-6,38}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-8,48},{-6,44}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-4,32},{-2,28}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-4,38},{-2,34}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-4,44},{-2,40}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-4,50},{-2,46}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{
+                    -2,20}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},
+                    {42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},
+                    {-50,6},{-62,2}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Line(
+                points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+                color={46,170,220},
+                thickness=0.5),
+              Line(
+                points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+                color={46,170,220},
+                thickness=0.5),
+              Line(
+                points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+                color={46,170,220},
+                thickness=0.5),
+              Polygon(
+                points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+              Line(
+                points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+                color={0,0,255},
+                smooth=Smooth.None),
+              Line(
+                points={{80,80},{100,100}},
+                color={0,0,255},
+                smooth=Smooth.None)}));
+      end Utilities;
+
+      function linspace "Returns a vector with linear spacing"
+        input Real min;
+        input Real max;
+        input Integer npoints;
+
+        output Real[npoints] res;
+
+      protected
+        Real delta;
+      algorithm
+        res[1] := min;
+        res[end] := max;
+
+        delta := (max - min)/npoints;
+
+        for i in 2:npoints-1 loop
+          res[i] := res[i-1] + delta;
+        end for;
+
+      end linspace;
+
+      function dumpOneSpline
+        "Write Modelica.Interpolation.Bspline1D.Data to file as record (not finished)."
+        import Util = Modelica.Utilities;
+        input String fileName "file name";
+        input String splineName "Name of the spline in the array of records.";
+        input
+          ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Data
+                                                                                               spline "Data.";
+        input Boolean lastSpline = false;
+        output Boolean status "true if succesful.";
+      protected
+        constant Integer recordsPerLine =  4;
+        Integer nKnots;
+        Integer n;
+        Integer nLeftovers;
+      algorithm
+        assert(spline.ndim == 1, "Bailing out - spline.ndim != 1");
+        // This is only for testing. In the end we'd like to append multiple spline records to a file.
+        //Util.Files.removeFile(fileName);
+        Util.Streams.print("record IF97_spline = ThermoSysPro_addon.IF97.SplineUtilities.Modelica_Interpolation.Bspline1D.Data(", fileName);
+        Util.Streams.print("    ndim = " + integerString(spline.ndim) + ",", fileName);
+        Util.Streams.print("    ncontrol = " + integerString(spline.ncontrol) + ",", fileName);
+        Util.Streams.print("    degree = " + integerString(spline.degree) + ",", fileName);
+        nKnots := size(spline.knots, 1);
+        Util.Streams.print("    knots = {", fileName);
+        // print the knots
+        n := integer(nKnots/recordsPerLine);
+        nLeftovers := nKnots - n*recordsPerLine;
+        // if nLeftOvers == 0 we output the last four records separately
+        // or else we end up with "...xxx, xxx, }" (trailing ',') instead of "...xxx, xxx }"
+        if nLeftovers == 0 then
+          for j in 1:n-1 loop
+            Util.Streams.print("    " + String(spline.knots[recordsPerLine * j - 3], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j - 2], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j - 1], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j], significantDigits=15) + ",",  fileName);
+          end for;
+          Util.Streams.print("    " + String(spline.knots[nKnots - 3], significantDigits=15) + ", " + String(spline.knots[nKnots - 2], significantDigits=15) + ", " + String(spline.knots[nKnots - 1], significantDigits=15) + ", " + String(spline.knots[nKnots], significantDigits=15),  fileName);
+        else
+          for j in 1:n loop
+            Util.Streams.print("    " + String(spline.knots[recordsPerLine * j - 3], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j - 2], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j - 1], significantDigits=15) + ", " + String(spline.knots[recordsPerLine * j], significantDigits=15) + ",",  fileName);
+          end for;
+          if nLeftovers == 3 then
+            Util.Streams.print("    " + String(spline.knots[nKnots - 2], significantDigits=15) + ", " + String(spline.knots[nKnots - 1], significantDigits=15) + ", " + String(spline.knots[nKnots], significantDigits=15),  fileName);
+          elseif nLeftovers == 2 then
+            Util.Streams.print("    " + String(spline.knots[nKnots - 1], significantDigits=15) + ", " + String(spline.knots[nKnots], significantDigits=15), fileName);
+          elseif nLeftovers == 1 then
+            Util.Streams.print("    " + String(spline.knots[nKnots], significantDigits=15), fileName);
+          end if;
+        end if;
+        Util.Streams.print("    },", fileName);
+        // print the control points
+        // ncontrol = #controlPoints
+        Util.Streams.print("    controlPoints = [", fileName);
+        n := integer(spline.ncontrol / recordsPerLine);
+        nLeftovers := spline.ncontrol - n * recordsPerLine;
+        // Take care of the case when nLeftovers == 0, see the knot comment above for an explanation.
+        if nLeftovers == 0 then
+          for j in 1:n-1 loop
+            Util.Streams.print("    " + String(spline.controlPoints[recordsPerLine * j - 3, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j - 2, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j, 1], significantDigits=15) + ";",  fileName);
+          end for;
+          Util.Streams.print("    " + String(spline.controlPoints[spline.ncontrol - 3, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol - 2, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol, 1], significantDigits=15),  fileName);
+        else
+          for j in 1:n loop
+            Util.Streams.print("    " + String(spline.controlPoints[recordsPerLine * j - 3, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j - 2, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[recordsPerLine * j, 1], significantDigits=15) + ";",  fileName);
+          end for;
+          if nLeftovers == 3 then
+            Util.Streams.print("    " + String(spline.controlPoints[spline.ncontrol - 2, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol, 1], significantDigits=15),  fileName);
+          elseif nLeftovers == 2 then
+            Util.Streams.print("    " + String(spline.controlPoints[spline.ncontrol - 1, 1], significantDigits=15) + "; " + String(spline.controlPoints[spline.ncontrol, 1], significantDigits=15),  fileName);
+          elseif nLeftovers == 1 then
+            Util.Streams.print("    " + String(spline.controlPoints[spline.ncontrol, 1], significantDigits=15),  fileName);
+          end if;
+        end if;
+        if lastSpline then
+           Util.Streams.print("    ])", fileName);
+        else
+          Util.Streams.print("    ]),", fileName);
+        end if;
+        Util.Streams.print("end IF97_spline;",fileName);
+        status := true;
+        annotation ();
+      end dumpOneSpline;
+
+      package Modelica_Interpolation
+        package Table1D "Table interpolation in one dimension"
+
+          function init "Initialize 1-dim. table interpolation"
+            extends Modelica.Icons.Function;
+            input Real table[:, :] "[x, y1(x), y2(x), ..., yn(x)] data points";
+            input Integer degree(min=1) = 1
+              "Polynomial degree of interpolation";
+            output Bspline1D.Data tableSpline(
+              ndim=size(table, 2) - 1,
+              ncontrol=size(table, 1),
+              degree=degree)
+              "Table data in a form which can be quickly interpolated";
+          protected
+            Integer nknots=size(tableSpline.knots, 1);
+            Integer ndim=size(table, 2);
+          algorithm
+            //the first column is the parametrization
+            tableSpline := Bspline1D.init(
+                        table[:, 2:ndim],
+                        table[:, 1],
+                        degree,
+                        false);
+          end init;
+
+          function evaluate "Evaluate Table data at one parameter"
+            extends Modelica.Icons.Function;
+            input Bspline1D.Data tableSpline "Bspline table to be evaluated";
+            input Real x "Parameter value at which table shall be evaluated";
+            output Real y[tableSpline.ndim] "Value of table at x";
+          algorithm
+            y := Bspline1D.evaluate(tableSpline, x);
+          end evaluate;
+
+         function evaluateDer
+            "Evaluate Table data and first derivative at one parameter"
+            extends Modelica.Icons.Function;
+            input
+              ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Data
+              tableSpline "Bspline table to be evaluated";
+            input Real x
+              "Parameter value at which the table shall be evaluated";
+            output Real y[tableSpline.ndim] "Value of the table at x";
+            output Real yd[tableSpline.ndim]
+              "Value of the first derivative at x";
+         algorithm
+            (y,yd) := Bspline1D.evaluateDer(tableSpline, x);
+         end evaluateDer;
+
+          function evaluateDer2
+            "Evaluate Table data and first and second derivative at one parameter"
+            extends Modelica.Icons.Function;
+            input Bspline1D.Data tableSpline "Bspline table to be evaluated";
+            input Real x
+              "Parameter value at which the table shall be evaluated";
+            output Real y[tableSpline.ndim] "Value of the table at x";
+            output Real yd[tableSpline.ndim]
+              "Value of the first derivative at x";
+            output Real ydd[tableSpline.ndim]
+              "Value of the second derivative at x";
+          algorithm
+            (y,yd,ydd) := Bspline1D.evaluateDer2(tableSpline, x);
+          end evaluateDer2;
+
+          annotation (
+            Window(
+              x=0.45,
+              y=0.01,
+              width=0.44,
+              height=0.65,
+              library=1,
+              autolayout=1),
+            Documentation(info="With this package interpolation with B-Splines
+of 1-dim. tables is provided."));
+        end Table1D;
+
+        package Bspline1D "1-dimensional Bspline interpolation"
+
+        record Data "Datastructure of a Bspline"
+          parameter Integer ndim(min=1) "Number of dimensions of one control point";
+          parameter Integer ncontrol(min=1) "Number of control points";
+          parameter Integer degree(min=1) "Polynomial degree of the Bspline";
+          Real knots[ncontrol+degree+1] "Knot vector of the Bspline";
+          Real controlPoints[ncontrol,ndim] "[i,:] is data of control point i";
+        end Data;
+
+        record ParametrizationType "will be later replaced by enumeration"
+          constant Integer Equidistant=1 "not recommended";
+          constant Integer ChordLength=2;
+          constant Integer Centripetal=3 "recommended";
+          constant Integer Foley=4;
+          constant Integer Angular=5;
+          constant Integer AreaBased=6;
+        end ParametrizationType;
+
+          function evaluate "Evaluate Bspline at one parameter"
+            extends Modelica.Icons.Function;
+            input Data spline "Bspline to be evaluated";
+            input Real u "Parameter value at which Bspline shall be evaluated";
+            output Real x[spline.ndim] "Value of Bspline at u";
+
+          protected
+           Integer span;
+           Real N[spline.degree+1];
+          algorithm
+            x := zeros(spline.ndim);
+           span := Utilities.n_findSpan(spline.degree,u,spline.knots);
+            N := Utilities.n_BasisFuns(span,u,spline.degree,spline.knots);
+
+            for i in 1:spline.ndim loop
+             x[i] := N*spline.controlPoints[span-spline.degree:span,i];
+            end for;
+          end evaluate;
+
+          function evaluateDer
+            "Evaluate Bspline and its first derivative at one parameter"
+            extends Modelica.Icons.Function;
+            input Data spline "Bspline to be evaluated";
+            input Real u "Parameter value at which Bspline shall be evaluated";
+            output Real x[spline.ndim] "Value of Bspline at u";
+            output Real xd[spline.ndim] "First derivative of Bspline at u";
+          protected
+           Integer span;
+           Real N[2,spline.degree+1];
+          algorithm
+            //Grenzwert von rechts lim (h->0) (f(x+h)-f(x))/h
+            x := zeros(spline.ndim);
+           xd := zeros(spline.ndim);
+
+           span := Utilities.n_findSpan(spline.degree,u,spline.knots);
+            N := Utilities.n_DersBasisFuns(span,u,spline.degree,1,spline.knots);
+
+            for i in 1:spline.ndim loop
+             x[i] := N[1,:]*spline.controlPoints[span-spline.degree:span,i];
+             xd[i] := N[2,:]*spline.controlPoints[span-spline.degree:span,i];
+            end for;
+
+          end evaluateDer;
+
+          function evaluateDer2
+            "Evaluate Bspline and its first and second derivatives at one parameter"
+            extends Modelica.Icons.Function;
+            input Data spline "Bspline to be evaluated";
+            input Real u "Parameter value at which Bspline shall be evaluated";
+            output Real x[spline.ndim] "Value of Bspline at u";
+            output Real xd[spline.ndim] "First derivative of Bspline at u";
+            output Real xdd[spline.ndim] "Second derivative of Bspline at u";
+          protected
+            Integer span;
+           Real N[3,spline.degree+1];
+          algorithm
+            x := zeros(spline.ndim);
+           xd := zeros(spline.ndim);
+           xdd := zeros(spline.ndim);
+
+           span := Utilities.n_findSpan(spline.degree,u,spline.knots);
+            N := Utilities.n_DersBasisFuns(span,u,spline.degree,2,spline.knots);
+
+            for i in 1:spline.ndim loop
+             x[i] := N[1,:]*spline.controlPoints[span-spline.degree:span,i];
+             xd[i] := N[2,:]*spline.controlPoints[span-spline.degree:span,i];
+             xdd[i] := N[3,:]*spline.controlPoints[span-spline.degree:span,i];
+            end for;
+          end evaluateDer2;
+
+          function evaluateDerN
+            "Evaluate k-th derivative of Bspline at one parameter"
+            extends Modelica.Icons.Function;
+            input Data spline "Bspline to be evaluated";
+            input Real u "Parameter value at which Bspline shall be evaluated";
+            input Integer k(min=0)
+              "Differentation order (0: function value, 1: first derivative, ...)";
+            output Real x_derN[spline.ndim] "k-th derivative of Bspline at u";
+
+          protected
+           Integer span;
+           Real N[k+1,spline.degree+1];
+          algorithm
+            x_derN := zeros(spline.ndim);
+
+           span := Utilities.n_findSpan(spline.degree,u,spline.knots);
+            N := Utilities.n_DersBasisFuns(span,u,spline.degree,k,spline.knots);
+
+            for i in 1:spline.ndim loop
+             x_derN[i] := N[k+1,:]*spline.controlPoints[span-spline.degree:span,i];
+            end for;
+
+          end evaluateDerN;
+
+          function init
+            "Initialize Bspline (end conditions are automatically selected, see docu)"
+            extends Modelica.Icons.Function;
+            input Real points[:, :]
+              "[i,:] is point i on the curve to be interpolated";
+            input Real param[size(points, 1)]
+              "parameterization of the data points (not necessarily in the range 0..1)";
+            input Integer degree(min=1) = 3
+              "Polynomial degree of interpolation (max number of points -1)";
+            input Boolean Bessel = true
+              "If true and degree=3, Bessel end condition is used";
+            output Data spline(
+              ndim=size(points, 2),
+              ncontrol=if Bessel and degree == 3 then size(points, 1) + 2 else
+                  size(points, 1),
+              degree=degree)
+              "Bspline in a form which can be quickly interpolated";
+          protected
+            Integer nknots=size(spline.knots, 1);
+            Integer ndim=size(points, 2);
+          algorithm
+            if (degree == 3 and Bessel) then
+             //Interpolation with Bessel end-conditions
+              spline :=
+                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Utilities.interpolationBessel(
+                points, param);
+            else
+              //Interpolation without specifying the end-conditions
+              spline :=
+                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Utilities.interpolation(
+                          points,
+                          param,
+                          degree);
+            end if;
+          end init;
+
+          function initDer
+            "Initialize Bspline which interpolates the points and first derivatives"
+            extends Modelica.Icons.Function;
+            input Real points[:, :]
+              "[i,:] is point i on the curve to be interpolated";
+            input Real derivs[size(points,1), size(points,2)]
+              "derivs[i,:] is the derivative at points[i,:]";
+            input Real param[size(points, 1)]
+              "parameterization of the data points (not necessarily in the range 0..1)";
+            input Integer degree(min=2) = 3 "Polynomial degree of interpolation (max: number of points -1)
+    at the moment degree=3 is supported";
+            output Data spline(
+              ndim=size(points, 2),
+              ncontrol=2*size(points, 1),
+              degree=degree)
+              "Bspline in a form which can be quickly interpolated";
+          protected
+            Integer nknots=size(spline.knots, 1);
+            Integer ndim=size(points, 2);
+          algorithm
+            spline := Utilities.interpolationder(
+                      points,
+                      derivs,
+                      param,
+                      degree);
+          end initDer;
+
+          function parametrization
+            "Automatic parameterization of a Bspline in the range 0..1 (if ndim > 1)"
+            extends Modelica.Icons.Function;
+            input Real points[:, :]
+              "[i,:] is point i on the curve to be interpolated";
+            input Integer paramType=ParametrizationType.Centripetal
+              "type of parametrization";
+            output Real param[size(points, 1)]
+              "parametrization of the data points";
+
+          protected
+          Real pi=3.141592653589;
+          Integer i;
+          Integer n_points;
+          Real d;
+          Real d_1[size(points, 2)];
+          Real d_2[size(points, 2)];
+          Real d_3[size(points, 2)];
+          Real phi_1;
+          Real phi_2;
+          Real lambda;
+          Real nu;
+          algorithm
+          //The following types of parametrization are described in the book of
+          //Gerald Farin, Curves and Surfaces in CAGD (page 161 'Finding a Knot
+          //Sequence'). For a comparison of the different parametrizations see
+          //the diploma thesis of Gerhard Schillhuber: 'Geometrische Modellierung
+          //oszillationsarmer Trajektorien von Industrierobotern (TU München)'
+          //(only available in german)
+          n_points := size(points,1);
+            if paramType == ParametrizationType.Equidistant then
+            //---EQUIDISTANT---
+            //the parameters are choosen equidistant
+              param := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.linspace(
+                                0, 1, size(points, 1));
+
+            elseif paramType == ParametrizationType.ChordLength then
+             param[1] := 0;
+            //---CHORD-LENGTH---
+            //the parameters are choosen proportional to the distances of the points
+              for i in 2:n_points loop
+                d := Utilities.norm(points[i,:] - points[i-1,:]);
+                param[i] := param[i-1]+d;
+              end for;
+              param := param / param[n_points];
+
+            elseif paramType == ParametrizationType.Centripetal then
+             param[1] := 0;
+            //---CENTRIPETAL---
+            //the idea of the centriptal parametrization is to minimize the centripetal
+            //force of an object moving on the curve.
+              for i in 2:n_points loop
+                d := Utilities.norm(points[i,:] - points[i-1,:]);
+                param[i] := param[i-1]+sqrt(d);
+              end for;
+              param := param / param[n_points];
+
+            elseif paramType == ParametrizationType.Foley then
+             param[1] := 0;
+            //---FOLEY---
+            //for computing the parameter the distances and the angle formed by the points
+            //are needed.
+
+              d_2 := (points[2,:] - points[1,:]);
+              d_3 := (points[3,:] - points[2,:]);
+              phi_2 := min(pi - acos((d_2 * d_3) / (Utilities.norm(d_2)*Utilities.norm(d_3))),pi/2);
+              d := Utilities.norm(d_2)*(1 +
+                  3/2 * phi_2 * Utilities.norm(d_3) / (Utilities.norm(d_2)+Utilities.norm(d_3)));
+              param[2] := param[1]+d;
+
+              for i in 3:n_points-1 loop
+                d_1 := (points[i-1,:] - points[i-2,:]);
+                d_2 := (points[i,:] - points[i-1,:]);
+                d_3 := (points[i+1,:] - points[i,:]);
+                phi_1 := min(pi - acos((d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2))),pi/2);
+                phi_2 := min(pi - acos((d_2 * d_3) / (Utilities.norm(d_2)*Utilities.norm(d_3))),pi/2);
+                d := Utilities.norm(d_2)*(1 +
+                    3/2 * phi_1 * Utilities.norm(d_1) / (Utilities.norm(d_1)+Utilities.norm(d_2)) +
+                    3/2 * phi_2 * Utilities.norm(d_3) / (Utilities.norm(d_2)+Utilities.norm(d_3)));
+
+                param[i] := param[i-1]+d;
+              end for;
+
+              d_1 := (points[n_points-1,:] - points[n_points-2,:]);
+              d_2 := (points[n_points,:] - points[n_points-1,:]);
+              phi_1 := min(pi - acos((d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2))),pi/2);
+              d := Utilities.norm(d_2)*(1 +
+                  3/2 * phi_1 * Utilities.norm(d_1) / (Utilities.norm(d_1)+Utilities.norm(d_2)));
+              param[n_points] := param[n_points-1]+d;
+
+              param := param / param[n_points];
+
+            elseif paramType == ParametrizationType.Angular then
+             param[1] := 0;
+            //---ANGULAR---
+            //this param. is like the Foley parametrization (distances and the angle
+            //are needed).
+             lambda := 1.5;
+              for i in 2:n_points-1 loop
+                d_1 := (points[i,:] - points[i-1,:]);
+                d_2 := (points[i+1,:] - points[i,:]);
+                phi_1 := acos((d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2)));
+
+                d := sqrt(Utilities.norm(d_1))*(1 + lambda*phi_1/pi);
+                param[i] := param[i-1]+d;
+              end for;
+              d_1 := (points[n_points-2,:] - points[n_points-1,:]);
+              d_2 := (points[n_points-1,:] - points[n_points,:]);
+              phi_1 := acos((d_2 * d_1) / (Utilities.norm(d_1)*Utilities.norm(d_2)));
+              d := sqrt(Utilities.norm(d_2))*(1 + lambda*phi_1/pi);
+              param[n_points] := param[n_points-1]+d;
+
+              param := param / param[n_points];
+
+            elseif paramType == ParametrizationType.AreaBased then
+             lambda := 2/3;
+            //---AREA-BASED---
+            //the parameters are choosen proportional to the area of the parallelograms
+            //formed by the points.
+              nu := 0.3;
+              param[1] := 0;
+              d_2 := (points[2,:] - points[1,:]);
+              d_3 := (points[3,:] - points[2,:]);
+              phi_2 := max(acos((-d_2 * d_3) / (Utilities.norm(d_2)*Utilities.norm(d_3))),pi/2);
+              d := nu*Utilities.norm(d_2) + (1-nu)*(sin(phi_2)*Utilities.norm(d_3)) / Utilities.norm(d_3);
+              param[2] := param[1]+d;
+
+              for i in 3:n_points-1 loop
+                d_1 := (points[i-1,:] - points[i-2,:]);
+                d_2 := (points[i,:] - points[i-1,:]);
+                d_3 := (points[i+1,:] - points[i,:]);
+                phi_1 := max(acos((-d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2))),pi/2);
+                phi_2 := max(acos((-d_2 * d_3) / (Utilities.norm(d_2)*Utilities.norm(d_3))),pi/2);
+
+                d := lambda*Utilities.norm(d_2) +
+                    (1-lambda)*(sin(phi_1)*Utilities.norm(d_1)+sin(phi_2)*Utilities.norm(d_3)) /
+                      (Utilities.norm(d_1)+Utilities.norm(d_3));
+                param[i] := param[i-1]+d;
+              end for;
+              d_1 := (points[n_points-1,:] - points[n_points-2,:]);
+              d_2 := (points[n_points,:] - points[n_points-1,:]);
+              phi_1 := max(acos((-d_1 * d_2) / (Utilities.norm(d_1)*Utilities.norm(d_2))),pi/2);
+              d := nu*Utilities.norm(d_2) + (1-nu)*(sin(phi_1)*Utilities.norm(d_1)) / Utilities.norm(d_1);
+              param[n_points] := param[n_points-1]+d;
+
+              param := param / param[n_points];
+
+            end if;
+          end parametrization;
+
+          function plot
+            "Plot Bspline curve (currently not fully functional, since feature in Dymola missing)"
+            extends Modelica.Icons.Function;
+            input Data spline "Bspline to be plotted";
+            input Integer npoints=100 "Number of points";
+            output Real x[npoints,spline.ndim+1]
+              "Table with u and function value at Bspline curve points";
+          algorithm
+
+          end plot;
+
+          package Utilities "Utility functions for package Bspline1D"
+
+            function interpolation
+              "Interpolation of the points with a Bspline of degree n"
+              extends Modelica.Icons.Function;
+              input Real points[:, :]
+                "[i,:] is point i on the curve to be interpolated";
+              input Real param[size(points, 1)]
+                "parameterization of the data points (not necessarily in the range 0..1)";
+              input Integer degree(min=1) = 3
+                "Polynomial degree of interpolation";
+              output Data spline(
+                ndim=size(points, 2),
+                ncontrol=size(points, 1),
+                degree=degree)
+                "Bspline in a form which can be quickly interpolated";
+            protected
+              Real ctrlp[spline.ncontrol,spline.ndim];
+              Real k[spline.ncontrol+degree+1];
+            algorithm
+
+             //old
+             //(ctrlp,k) := interpolation_raw(points,param,degree);
+             (ctrlp,k) := interpolation_bandmatrix(points,param,degree);
+
+             spline.controlPoints := ctrlp;
+             spline.knots := k;
+
+            end interpolation;
+
+            function interpolation_bandmatrix "Interpolation of the points with a Bspline of degree n. Do NOT return a Bspline struct.
+  Return the the raw information of control points and knots."
+              import U =
+                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Utilities;
+              extends Modelica.Icons.Function;
+              input Real points[:, :]
+                "[i,:] is point i on the curve to be interpolated";
+              input Real param[size(points, 1)]
+                "parameterization of the data points (not necessarily in the range 0..1)";
+              input Integer degree(min=1) = 3
+                "Polynomial degree of interpolation";
+              output Real controlPoints[size(points, 1),size(points, 2)]
+                "Control points";
+              output Real knots[size(points, 1)+degree+1] "knots";
+            protected
+              Integer nknots=size(knots, 1);
+              Integer ndim=size(points, 2);
+              Integer npoints;
+              Integer knots_tech;
+              //Real S[size(points,1),size(points,1)];
+
+              Real u;
+              Integer span;
+              Real evalBasisFuns[degree+1];
+              Real Band[3*degree+1,size(points,1)];
+              Integer kl = degree;
+              Integer ku = degree;
+              Integer info=0;
+              String sout;
+            algorithm
+              /*
+  The NURBS Book: Global Interpolation (page 364)
+  */
+              npoints := size(points,1);
+
+             // build the knots
+             //     1:  knots = parameter (for testing)
+             //     2:  knots are built with averaging
+             //     3:  knots equidistant (for testing)
+             knots_tech := 2;
+
+             if knots_tech == 1 then
+                knots[1:degree] := ones(degree)*param[1];
+                knots[degree+1:npoints+degree] := param;
+                knots[npoints+degree+1:npoints+2*degree] := ones(degree)*param[npoints];
+
+             end if;
+
+             if knots_tech == 2 then
+             // with averaging to avoid a singularity system of equation
+                knots[1:degree+1] := ones(degree+1)*param[1];
+                for j in 1:npoints-degree-1 loop
+                   knots[degree+j+1] := sum(param[j+1:j+degree])/degree;
+                end for;
+                knots[npoints+1:npoints+degree+1] := ones(degree+1)*param[npoints];
+
+             end if;
+
+             if knots_tech == 3 then
+                knots[1:degree+1] := ones(degree+1)*param[1];
+                for j in 1:npoints-1 loop
+                   knots[degree+j+1] := j/(npoints-1);
+                end for;
+                knots[npoints+degree+1:npoints+2*degree] := ones(degree)*param[npoints];
+
+             end if;
+
+             // build the equation system
+            // S := zeros(npoints,npoints);
+
+             for i in 1:npoints loop
+               u := param[i];
+               span := U.n_findSpan(degree,u,knots);
+               //S[i,span-degree:span] := n_BasisFuns(span,u,degree,knots);
+               evalBasisFuns := U.n_BasisFuns(span,u,degree,knots);
+
+               for j in 1:degree+1 loop
+                 Band[kl+1+ku+i-span+degree-j+1,span-degree+j-1]:=evalBasisFuns[j];
+            //Band[kl+1+ku+i-span+degree-j+1,span-degree+j-1]:=10*i+span-degree-1+j;
+
+               end for;
+
+             end for;
+
+            /*
+for i in 1:npoints loop
+    sout :="i = " + String(i) + ":";
+    for j in 1:degree+1 loop
+      sout :=sout + "   " + String(Band[j, i]);
+    end for;
+    Utilities.ModelicaMessage(sout + "\n");
+end for;
+*/
+
+             // solve the equation system
+              (controlPoints,info) :=
+                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Utilities.solveBandedWithMatrix(
+                            kl,
+                            ku,
+                            Band,
+                            points);
+             // assert(info == 0, "Error when computing spline coefficients");
+
+            if info <> 0 then
+              // if solving with band matrix is not succesful, use full matrix
+              (controlPoints,knots) := U.interpolation_raw(points,param,degree);
+
+            end if;
+
+            end interpolation_bandmatrix;
+
+            function interpolation_raw "Interpolation of the points with a Bspline of degree n. Do NOT return a Bspline struct.
+  Return the the raw information of control points and knots."
+            //  import Modelica_Interpolation;
+              extends Modelica.Icons.Function;
+              input Real points[:, :]
+                "[i,:] is point i on the curve to be interpolated";
+              input Real param[size(points, 1)]
+                "parameterization of the data points (not necessarily in the range 0..1)";
+              input Integer degree(min=1) = 3
+                "Polynomial degree of interpolation";
+              output Real controlPoints[size(points, 1),size(points, 2)]
+                "Control points";
+              output Real knots[size(points, 1)+degree+1] "knots";
+            protected
+              Integer nknots=size(knots, 1);
+              Integer ndim=size(points, 2);
+              Integer npoints;
+              Integer knots_tech;
+              Real S[size(points,1),size(points,1)];
+              Real u;
+              Integer span;
+            algorithm
+              /*
+  The NURBS Book: Global Interpolation (page 364)
+  */
+              npoints := size(points,1);
+
+             // build the knots
+             //     1:  knots = parameter (for testing)
+             //     2:  knots are built with averaging
+             //     3:  knots equidistant (for testing)
+             knots_tech := 2;
+
+             if knots_tech == 1 then
+                knots[1:degree] := ones(degree)*param[1];
+                knots[degree+1:npoints+degree] := param;
+                knots[npoints+degree+1:npoints+2*degree] := ones(degree)*param[npoints];
+
+             end if;
+
+             if knots_tech == 2 then
+             // with averaging to avoid a singularity system of equation
+                knots[1:degree+1] := ones(degree+1)*param[1];
+                for j in 1:npoints-degree-1 loop
+                   knots[degree+j+1] := sum(param[j+1:j+degree])/degree;
+                end for;
+                knots[npoints+1:npoints+degree+1] := ones(degree+1)*param[npoints];
+
+             end if;
+
+             if knots_tech == 3 then
+                knots[1:degree+1] := ones(degree+1)*param[1];
+                for j in 1:npoints-1 loop
+                   knots[degree+j+1] := j/(npoints-1);
+                end for;
+                knots[npoints+degree+1:npoints+2*degree] := ones(degree)*param[npoints];
+
+             end if;
+
+             // build the equation system
+             S := zeros(npoints,npoints);
+
+             for i in 1:npoints loop
+               u := param[i];
+               span := n_findSpan(degree,u,knots);
+               S[i,span-degree:span] := n_BasisFuns(span,u,degree,knots);
+
+             end for;
+
+             // solve the equation system
+              controlPoints :=
+                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Utilities.solveMatrix(
+                S, points);
+
+            end interpolation_raw;
+
+            function interpolationBessel
+              "Interpolation of the points with a Bspline of degree 3 and Bessel end condition"
+            //  import Modelica_Interpolation;
+              extends Modelica.Icons.Function;
+              input Real points[:, :]
+                "[i,:] is point i on the curve to be interpolated";
+              input Real param[size(points, 1)]
+                "parameterization of the data points (not necessarily in the range 0..1)";
+              output Data Bspline(
+                ndim=size(points, 2),
+                ncontrol=(size(points, 1) + 2),
+                degree=3) "Bspline in a form which can be quickly interpolated";
+            protected
+              Integer ndim=size(points, 2);
+              Real S[size(points,1)-2,size(points,1)-2];
+              Real u;
+              Real u2;
+              Real nik[4];
+              Real nik2[4];
+              Integer degree;
+              Real knots[size(points,1)+2*3];
+              Integer n_data;
+              Real alpha;
+              Real beta;
+              Real a[ndim];
+              Real rs[        ndim];
+              Real re[                 ndim];
+              Real p_vec[Bspline.ncontrol-4,Bspline.ndim];
+              Integer span;
+            algorithm
+              /*
+  Farin: Curves and Surfaces for CAGD (page 157)
+  */
+              degree := 3;
+
+             n_data := size(points,1);
+
+             //build the knots
+
+             knots[1:degree] := ones(3)*param[1];
+             knots[degree+1:n_data+degree] := param;
+             knots[n_data+degree+1:n_data+2*degree] := ones(3)*param[n_data];
+
+              Bspline.controlPoints := zeros(n_data+2,Bspline.ndim);
+             Bspline.controlPoints[1,:] := points[1,:];
+             Bspline.controlPoints[n_data+2,:] := points[n_data,:];
+
+             alpha := (param[3]-param[2])/(param[3]-param[1]);
+             beta := 1-alpha;
+             a := (points[2,:] - (alpha^2)*points[1,:] - (beta^2)*points[3,:])/(2*alpha*beta);
+             Bspline.controlPoints[2,:] := (2/3)*(alpha*points[1,:] + beta*a) + points[1,:]/3;
+
+             alpha := (param[n_data-2]-param[n_data-1])/(param[n_data-2]-param[n_data]);
+             beta := (1-alpha);
+             a := (points[n_data-1,:] - (alpha^2)*points[n_data,:] - (beta^2)*points[n_data-2,:])/(2*alpha*beta);
+             Bspline.controlPoints[n_data+1,:] := (2/3)*(alpha*points[n_data,:] + beta*a) + points[n_data,:]/3;
+
+             // build the equation system
+             S := zeros(n_data-2,n_data-2);
+
+             u2 := param[2];
+             span := n_findSpan(degree,u2,knots);
+             nik2 := n_BasisFuns(span,u2,degree,knots);
+             S[1,1:2] := nik2[2:3];
+             rs := points[2,:] - Bspline.controlPoints[2,:]*nik2[1];
+
+             for i in 1:n_data-4 loop
+               u := param[i+2];
+               span := n_findSpan(degree,u,knots);
+              nik := n_BasisFuns(span,u,degree,knots);
+               S[i+1,i:i+2] := nik[1:3];
+
+             end for;
+             u := param[n_data-1];
+             span := n_findSpan(degree,u,knots);
+             nik := n_BasisFuns(span,u,degree,knots);
+             S[n_data-2,n_data-3:n_data-2] := nik[1:2];
+
+             re := points[n_data-1,:] - Bspline.controlPoints[n_data+1,:]*nik[3];
+             p_vec[1,:] := rs;
+             p_vec[2:n_data-3,:] := points[3:n_data-2,:];
+             p_vec[n_data-2,:] := re;
+
+             // solve the equation system
+              Bspline.controlPoints[3:n_data, :] :=
+                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Utilities.solveMatrix(
+                S, p_vec);
+
+             Bspline.knots := knots;
+
+            end interpolationBessel;
+
+            function interpolationder
+              "Interpolation of the points and its first derivatives with a Bspline of degree n"
+            //  import Modelica_Interpolation;
+              extends Modelica.Icons.Function;
+              input Real points[:, :]
+                "[i,:] is point i on the curve to be interpolated";
+              input Real derivs[size(points,1), size(points,2)]
+                "derivs[i,:] is the derivative at points[i,:]";
+              input Real param[size(points, 1)]
+                "parameterization of the data points (not necessarily in the range 0..1)";
+              input Integer degree(min=2) = 3
+                "Polynomial degree of interpolation";
+              output Data spline(
+                ndim=size(points, 2),
+                ncontrol=2*size(points, 1),
+                degree=degree)
+                "Bspline in a form which can be quickly interpolated";
+            protected
+              Integer nknots=size(spline.knots, 1);
+              Integer ndim=size(points, 2);
+              Integer npoints;
+              Integer i;
+              Integer k;
+              Real S[2*size(points,1),2*size(points,1)];
+              Real u;
+              Real b[2*size(points,1),size(points, 2)];
+              Integer span;
+              Real N[2,degree+1];
+            algorithm
+              /*
+  The NURBS Book: Global Interpolation (page 373)
+
+  */
+              npoints := size(points,1);
+
+             // compute the knots
+             // the goal is a banded linear system
+
+             k :=  integer(degree/2);
+             spline.knots[1:degree+1] := ones(degree+1)*param[1];
+
+             if degree == 2*k then
+               //degree is even
+               k := k-1;
+
+               for j in 1:k loop
+               spline.knots[degree+1+j] := param[j+1];
+
+              end for;
+
+              for j in 1:npoints-(k+1) loop
+                spline.knots[degree+k+2*j] := (param[j+k]+param[j+k+1])/2;
+                spline.knots[degree+k+2*j+1] := param[j+k+1];
+
+              end for;
+
+              for j in 1:k loop
+               spline.knots[2*npoints-k+j] := param[npoints-k+j-1];
+
+              end for;
+
+             else
+               //degree is odd
+
+              for j in 1:k loop
+               spline.knots[degree+1+j] := spline.knots[degree+1] + j*(param[k+1]-param[1])/k;
+
+              end for;
+
+              for j in 1:npoints-(k+1) loop
+                spline.knots[degree+k+2*j] := (2*param[j+k]+param[j+k+1])/3;
+                spline.knots[degree+k+2*j+1] := (param[j+k]+2*param[j+k+1])/3;
+
+              end for;
+
+              for j in 1:k loop
+               spline.knots[2*npoints-k+j] := spline.knots[2*npoints-k] + j*(param[npoints]-param[npoints-k])/k;
+
+              end for;
+
+             end if;
+
+             spline.knots[2*npoints+1:2*npoints+degree+1] := ones(degree+1)*param[npoints];
+
+             // build the equation system
+             S := zeros(2*npoints,2*npoints);
+
+             for i in 1:npoints loop
+               u := param[i];
+               span := n_findSpan(spline.degree,u,spline.knots);
+               N := Utilities.n_DersBasisFuns(span,u,spline.degree,1,spline.knots);
+               S[2*i-1:2*i,span-spline.degree:span] := N;
+               b[2*i-1,:] := points[i,:];
+              b[2*i,:] := derivs[i,:];
+
+             end for;
+
+             // solve the equation system
+              spline.controlPoints :=
+                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Utilities.solveMatrix(
+                S, b);
+            end interpolationder;
+
+            function n_BasisFuns "Compute the nonvanishing basis functions"
+             extends Modelica.Icons.Function;
+              input Integer i "index";
+              input Real u "parameter";
+              input Integer p "degree";
+              input Real knots[:] "knot vector";
+              output Real N[p+1] "Basis functions";
+            protected
+              Integer j;
+              Integer r;
+              Real left[p+1];
+              Real right[p+1];
+              Real temp;
+              Real saved;
+            algorithm
+             /*
+  The NURBS Book: Algorithm A2.2 (page 70)
+  */
+              N[1] := 1;
+              for j in 1:p loop
+               left[j] := u - knots[i+1-j];
+               right[j] := knots[i+j] - u;
+               saved := 0.0;
+
+               for r in 1:j loop
+                temp := N[r]/(right[r]+left[j-r+1]);
+                N[r] := saved + right[r]*temp;
+                saved := left[j-r+1]*temp;
+
+              end for;
+              N[j+1] := saved;
+              end for;
+            end n_BasisFuns;
+
+            function n_DersBasisFuns
+              "Compute nonzero basis functions and their derivatives"
+             extends Modelica.Icons.Function;
+              input Integer i "index";
+              input Real u "parameter";
+              input Integer p "degree";
+              input Integer n "n-th derivative";
+              input Real knots[:] "knot vector";
+              output Real ders[n+1,p+1] "ders[k,:] is (k-1)-th derivative";
+            protected
+              Integer j;
+              Integer r;
+              Real left[p+1];
+              Real right[p+1];
+              Real temp;
+              Real saved;
+              Real ndu[p+1,p+1];
+              Integer s1;
+              Integer s2;
+              Integer j1;
+              Integer j2;
+              Real a[2,p+1];
+              Real d;
+              Integer rk;
+              Integer pk;
+              Integer prod;
+              Integer tt;
+            algorithm
+             /*
+  The NURBS Book: Algorithm A2.3 (page 72)
+  */
+              ndu[1,1] := 1;
+              for j in 1:p loop
+               left[j] := u - knots[i+1-j];
+               right[j] := knots[i+j] - u;
+               saved := 0.0;
+
+               for r in 1:j loop
+                ndu[j+1,r] := right[r]+left[j-r+1];
+                temp := ndu[r,j]/ndu[j+1,r];
+                ndu[r,j+1] := saved + right[r]*temp;
+                saved := left[j-r+1]*temp;
+
+              end for;
+              ndu[j+1,j+1] := saved;
+              end for;
+
+              for j in 1:p+1 loop
+               ders[1,j] := ndu[j,p+1];
+              end for;
+
+              for r in 1:p+1 loop
+               s1 := 1;
+               s2 := 2;
+               a[1,1] := 1.0;
+
+               for k in 1:n loop
+                d := 0.0;
+                rk := r-k-1;
+                pk := p-k;
+
+                if r-1>=k then
+                 a[s2,1] := a[s1,1]/ndu[pk+2,rk+1];
+                 d := a[s2,1]*ndu[rk+1,pk+1];
+
+                end if;
+
+                if rk >= -1 then
+                 j1 :=1;
+
+                else
+                 j1 :=-rk;
+
+                end if;
+
+                if r-1 <= pk+1 then
+                 j2 := k-1;
+
+                else
+                 j2 := p-r+1;
+
+                end if;
+
+                for j in j1:j2 loop
+                 a[s2,j+1] :=(a[s1, j + 1] - a[s1, j])/ndu[pk + 2, rk + j + 1];
+                 d :=d + a[s2, j + 1]*ndu[rk + j + 1, pk + 1];
+
+                end for;
+
+                if r-1 <= pk then
+                 a[s2,k+1] := -a[s1,k]/ndu[pk+2,r];
+                 d := d + a[s2,k+1]*ndu[r,pk+1];
+
+                end if;
+
+                ders[k+1,r] := d;
+                tt := s1;
+                s1 := s2;
+                s2 := tt;
+
+               end for;
+              end for;
+
+              prod := p;
+
+             for k in 1:n loop
+
+               for j in 1:p+1 loop
+                ders[k+1,j] := ders[k+1,j]*prod;
+
+               end for;
+               prod := prod*(p-k);
+
+             end for;
+
+            end n_DersBasisFuns;
+
+            function n_findSpan "Determine the knot span index"
+             extends Modelica.Icons.Function;
+              input Integer p "degree";
+              input Real u "parameter";
+              input Real knots[:] "knot vector";
+              output Integer i "The knot span index";
+            protected
+              Integer n;
+              Integer low;
+              Integer high;
+              Integer mid;
+            algorithm
+             /*
+  The NURBS Book: Algorithm A2.1 (page 68)
+  */
+              n:=size(knots,1)-p-1;
+
+             if abs(u-knots[n+1])<10e-12 then
+              i := n;
+
+             else
+              low := p;
+              high := n+1;
+              mid := integer((low+high)/2);
+
+              while
+                   (u<knots[mid] or u>=knots[mid+1]) loop
+                   assert(low+1<high,"Value must be within limits for Bspline1D.Utilities.n_findSpan");
+
+               if (u<knots[mid]) then
+                 high := mid;
+
+               else
+                 low := mid;
+
+               end if;
+               mid := integer((low+high)/2);
+
+              end while;
+              i := mid;
+
+             end if;
+            end n_findSpan;
+
+            function norm "The euklidian norm of a vector"
+             extends Modelica.Icons.Function;
+              input Real v[:] "A vector";
+              output Real n "The norm of the vector";
+            algorithm
+              n:=sqrt(v*v);
+            end norm;
+          annotation (
+            Window(
+              x=0.45,
+              y=0.01,
+              width=0.44,
+              height=0.65,
+              library=1,
+              autolayout=1),
+            Documentation(info="<HTML>
+<p>
+Utility functions are provided here which are usually not called directly
+by a user, but are needed in the functions of this package
+</p>
+<p>
+The following functions are supported:
+</p>
+<pre>
+  interpolation          Compute the interpolation Bspline
+  interpolation_raw      Compute the interpolation Bspline, but only return the control points
+                                                                                           and the knots
+  interpolationBessel    Compute the interpolation Bspline with Bessel end-conditions
+  interpolationDer       Compute the interpolation Bspline when the first derivative are given
+  n_BasisFuns            Compute the non zero basis functions of the Bspline
+  n_DersBasisFuns        Compute the non zero basis functions and their derivatives
+  n_findSpan             Compute the interval in which the parameter lies
+  norm                   The euklidian norm of a vector
+</pre>
+<p><b>Release Notes:</b></p>
+<ul>
+<li><i>Sept. 13, 2002</i>
+       by Gerhard Schillhuber:<br>
+       first version implemented
+</li>
+<li><i>Oct. 17, 2002</i>
+       by Gerhard Schillhuber:<br>
+       new function: interpolation_raw. return only the control points and the knots.
+                       'interpolation' calls 'interpolation_raw'.
+</li>
+</ul>
+<br>
+<p><b>Copyright (C) 2002, Modelica Association and DLR.</b></p>
+<p><i>
+This package is <b>free</b> software. It can be redistributed and/or modified
+under the terms of the <b>Modelica license</b>, see the license conditions
+and the accompanying <b>disclaimer</b> in the documentation of package
+Modelica in file \"Modelica/package.mo\".
+</i></p>
+</HTML>
+"));
+          end Utilities;
+        annotation (
+          Window(
+            x=0.45,
+            y=0.01,
+            width=0.44,
+            height=0.65,
+            library=1,
+            autolayout=1),
+          Documentation(info="<HTML>
+<p>
+With this package 1-dimensional interpolation with B-Splines
+is performed.
+</p>
+<p>
+The following functions are supported:
+</p>
+<pre>
+  init          Initialize interpolation
+  initDer       Initialize interpolation (points and first derivatives are given)
+  evaluate      Determine data at one point by interpolation
+  evaluateDer   Determine data and first derivative at one point by interpolation
+  evaluateDer2  Determine data, first and second derivative at one point by interpolation
+  evaluateDerN  Determine the n-th derivative at one point by interpolation
+  plot          Compute all data needed to make a nice plot of the data and plot it
+                (since in Dymola plotArray cannot be called in a function, currently
+                just the plot data is computed and returned. In a calling script
+                this data can be used to plot it with operator plotArray).
+</pre>
+<p><b>Release Notes:</b></p>
+<ul>
+<li><i>Sept. 13, 2002</i>
+       by Gerhard Schillhuber:<br>
+       first version implemented
+</li>
+</ul>
+<br>
+<p><b>Copyright (C) 2002, Modelica Association and DLR.</b></p>
+<p><i>
+This package is <b>free</b> software. It can be redistributed and/or modified
+under the terms of the <b>Modelica license</b>, see the license conditions
+and the accompanying <b>disclaimer</b> in the documentation of package
+Modelica in file \"Modelica/package.mo\".
+</i></p>
+</HTML>
+"));
+        end Bspline1D;
+
+        package Utilities "Utility functions for package Interpolation"
+
+          function curveLength "Computes the length of the curve from a to b"
+            import
+              ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation;
+           extends Modelica.Icons.Function;
+           input Modelica_Interpolation.Bspline1D.Data                                         spline
+              "Bspline data";
+           input Real a "left end";
+           input Real b "right end";
+           input Real err = 1e-8 "relative error";
+           output Real I "curve length from a to b";
+
+          protected
+            Real m;
+            Real h;
+            Real alpha;
+            Real beta;
+            Real x1 = 0.942882415695480;
+            Real x2 = 0.641853342345781;
+            Real x3 = 0.236383199662150;
+           Real x[13];
+           Real y[13];
+           Real fa;
+           Real fb;
+           Real i1;
+           Real i2;
+           Real is;
+           Real erri1;
+           Real erri2;
+           Real R;
+           Real tol;
+           Real eps = 1e-16;
+           Integer s;
+
+          package internal "Funtions to be used only in function curveLength"
+              import
+                ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation;
+
+           function quadStep "Recursive function used by curveLength"
+            input ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Data
+                  spline;
+            input Real a "right interval end";
+            input Real b "left interval end";
+            input Real fa "function value at a";
+            input Real fb "function value at b";
+            input Real is "first approximation of the integral";
+            output Real I "Integral value";
+              protected
+            Real m;
+            Real h;
+            Real alpha;
+            Real beta;
+            Real x[5];
+            Real y[5];
+            Real mll;
+            Real ml;
+            Real mr;
+            Real mrr;
+            Real fmll;
+            Real fml;
+            Real fm;
+            Real fmr;
+            Real fmrr;
+            Real i1;
+            Real i2;
+           algorithm
+             h := (b-a)/2; m := (a+b)/2;
+             alpha := sqrt(2/3); beta := 1/sqrt(5);
+             mll := m-alpha*h; ml := m-beta*h; mr := m+beta*h; mrr := m+alpha*h;
+             x := {mll,ml,m,mr,mrr};
+             y := eval(spline,x);
+             fmll := y[1]; fml := y[2]; fm := y[3]; fmr := y[4]; fmrr := y[5];
+             i2 := (h/6)*(fa+fb+5*(fml+fmr));
+             i1 := (h/1470)*(77*(fa+fb)+432*(fmll+fmrr)+625*(fml+fmr)
+                +672*fm);
+
+             if
+               (is+(i1-i2)==is) or (mll<=a) or (b<=mrr) then
+               I := i1;
+
+             else
+               I := quadStep(spline,a,mll,fa,fmll,is)+
+                 quadStep(spline,mll,ml,fmll,fml,is)+
+                 quadStep(spline,ml,m,fml,fm,is)+
+                 quadStep(spline,m,mr,fm,fmr,is)+
+                 quadStep(spline,mr,mrr,fmr,fmrr,is)+
+                 quadStep(spline,mrr,b,fmrr,fb,is);
+
+             end if;
+           end quadStep;
+
+           function eval "evaluate the integrand"
+             input Modelica_Interpolation.Bspline1D.Data spline "Bspline data";
+             input Real u[:]
+                  "parameters at which the integrand shall be evaluated";
+             output Real f[size(u,1)];
+              protected
+             Real xd[spline.ndim];
+             Integer n;
+           algorithm
+             //the integrand is sqrt(xd*xd) (where xd is the first derivative)
+            n := size(u,1);
+
+            for i in 1:n loop
+              xd := Modelica_Interpolation.Bspline1D.evaluateDerN(spline,u[i],1);
+             f[i] := sqrt(xd*xd);
+
+            end for;
+           end eval;
+          end internal;
+
+          algorithm
+           /*
+        Numerically evaluate integral using adaptive
+        Lobatto rule.
+        see Walter Gander: Adaptive Quadrature - Revisited, 1998
+                        ftp.inf.ethz.ch in doc/tech-reports/1998/306.ps
+
+        x[:] are the nodes
+        y[:] = f(x[:]) are function values at the nodes
+                here (arc length computation): the integrand f is the
+                absolute value of the first derivative of the curve (Bspline)
+        */
+           tol := err;
+            m := (a+b)/2; h:=(b - a)/2;
+            alpha := sqrt(2/3); beta:=1/sqrt(5);
+            x := {a,m-x1*h,m-alpha*h,m-x2*h,m-beta*h,m-x3*h,m,m+x3*h,
+                  m+beta*h,m+x2*h,m+alpha*h,m+x1*h,b};
+            y := internal.eval(spline,x);
+            fa := y[1]; fb := y[13];
+            i2 := (h/6)*(y[1]+y[13]+5*(y[5]+y[9]));
+            i1 := (h/1470)*(77*(y[1]+y[13])+432*(y[3]+y[11])+
+               625*(y[5]+y[9])+672*y[7]);
+            is := h*(0.0158271919734802*(y[1]+y[13])+0.0942738402188500
+               *(y[2]+y[12])+0.155071987336585*(y[3]+y[11])+0.188821573960182
+                               *(y[4]+y[10])+0.199773405226859
+               *(y[5]+y[9])+0.224926465333340*(y[6]+y[8])
+               +0.242611071901408*y[7]);
+            s := sign(is);
+            if
+              (s==0) then s := 1; end if;
+            erri1 := abs(i1-is);
+            erri2 := abs(i2-is);
+            R := 1;
+            if
+              (erri2<>0) then R := erri1/erri2; end if;
+            if
+              (R>0 and R<1) then tol := tol/R; end if;
+            is := s*abs(is)*tol/eps;
+            if
+              (is==0) then is := b-a; end if;
+            I := internal.quadStep(spline,a,b,fa,fb,is);
+
+          end curveLength;
+
+          function dgbsv
+            "Solve real system of linear equations A*X=B with a banded A matrix and a B matrix (copy from protected package Matrices.Lapack)"
+            extends Modelica.Icons.Function;
+                input Integer n "Number of equations";
+                input Integer kLower "Number of lower bands";
+                input Integer kUpper "Number of upper bands";
+                input Real A[2*kLower + kUpper + 1, n];
+                input Real B[n, :];
+                output Real X[n, size(B, 2)]=B;
+                output Integer info;
+
+          protected
+                Real Awork[size(A, 1), size(A, 2)]=A;
+                Integer ipiv[n];
+
+              external "FORTRAN 77" dgbsv(n, kLower, kUpper, size(B, 2), Awork, size(
+                  Awork, 1), ipiv, X, n, info) annotation (Library="Lapack");
+                annotation (
+                  Documentation(info="Lapack documentation:
+Purpose
+=======
+DGBSV computes the solution to a real system of linear equations
+A * X = B, where A is a band matrix of order N with KL subdiagonals
+and KU superdiagonals, and X and B are N-by-NRHS matrices.
+The LU decomposition with partial pivoting and row interchanges is
+used to factor A as A = L * U, where L is a product of permutation
+and unit lower triangular matrices with KL subdiagonals, and U is
+upper triangular with KL+KU superdiagonals.  The factored form of A
+is then used to solve the system of equations A * X = B.
+Arguments
+=========
+N       (input) INTEGER
+        The number of linear equations, i.e., the order of the
+        matrix A.  N >= 0.
+KL      (input) INTEGER
+        The number of subdiagonals within the band of A.  KL >= 0.
+KU      (input) INTEGER
+        The number of superdiagonals within the band of A.  KU >= 0.
+NRHS    (input) INTEGER
+        The number of right hand sides, i.e., the number of columns
+        of the matrix B.  NRHS >= 0.
+AB      (input/output) DOUBLE PRECISION array, dimension (LDAB,N)
+        On entry, the matrix A in band storage, in rows KL+1 to
+        2*KL+KU+1; rows 1 to KL of the array need not be set.
+        The j-th column of A is stored in the j-th column of the
+        array AB as follows:
+        AB(KL+KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+KL)
+        On exit, details of the factorization: U is stored as an
+        upper triangular band matrix with KL+KU superdiagonals in
+        rows 1 to KL+KU+1, and the multipliers used during the
+        factorization are stored in rows KL+KU+2 to 2*KL+KU+1.
+        See below for further details.
+LDAB    (input) INTEGER
+        The leading dimension of the array AB.  LDAB >= 2*KL+KU+1.
+IPIV    (output) INTEGER array, dimension (N)
+        The pivot indices that define the permutation matrix P;
+        row i of the matrix was interchanged with row IPIV(i).
+B       (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
+        On entry, the N-by-NRHS right hand side matrix B.
+        On exit, if INFO = 0, the N-by-NRHS solution matrix X.
+LDB     (input) INTEGER
+        The leading dimension of the array B.  LDB >= max(1,N).
+INFO    (output) INTEGER
+        = 0:  successful exit
+        < 0:  if INFO = -i, the i-th argument had an illegal value
+        > 0:  if INFO = i, U(i,i) is exactly zero.  The factorization
+              has been completed, but the factor U is exactly
+              singular, and the solution has not been computed.
+Further Details
+===============
+The band storage scheme is illustrated by the following example, when
+M = N = 6, KL = 2, KU = 1:
+On entry:                       On exit:
+    *    *    *    +    +    +       *    *    *   u14  u25  u36
+    *    *    +    +    +    +       *    *   u13  u24  u35  u46
+    *   a12  a23  a34  a45  a56      *   u12  u23  u34  u45  u56
+   a11  a22  a33  a44  a55  a66     u11  u22  u33  u44  u55  u66
+   a21  a32  a43  a54  a65   *      m21  m32  m43  m54  m65   *
+   a31  a42  a53  a64   *    *      m31  m42  m53  m64   *    *
+Array elements marked * are not used by the routine; elements marked
++ need not be set on entry, but are required by the routine to store
+elements of U because of fill-in resulting from the row interchanges."),
+                  Window(
+                    x=0.4,
+                    y=0.4,
+                    width=0.6,
+                    height=0.6));
+          end dgbsv;
+
+          function dgesv
+            "Solve real system of linear equations A*X=B with a B matrix (copy from protected package Matrices.Lapack)"
+            extends Modelica.Icons.Function;
+            input Real A[:, size(A, 1)];
+            input Real B[size(A, 1), :];
+            output Real X[size(A, 1), size(B, 2)]=B;
+            output Integer info;
+          protected
+            Real Awork[size(A, 1), size(A, 1)]=A;
+            Integer ipiv[size(A, 1)];
+
+          external "FORTRAN 77" dgesv(size(A, 1), size(B, 2), Awork, size(A, 1), ipiv,
+               X, size(A, 1), info) annotation (Library="Lapack");
+            annotation (
+              Documentation(info="Lapack documentation:
+    Purpose
+    =======
+    DGESV computes the solution to a real system of linear equations
+       A * X = B,
+    where A is an N-by-N matrix and X and B are N-by-NRHS matrices.
+    The LU decomposition with partial pivoting and row interchanges is
+    used to factor A as
+       A = P * L * U,
+    where P is a permutation matrix, L is unit lower triangular, and U is
+
+    upper triangular.  The factored form of A is then used to solve the
+    system of equations A * X = B.
+    Arguments
+    =========
+    N       (input) INTEGER
+            The number of linear equations, i.e., the order of the
+            matrix A.  N >= 0.
+    NRHS    (input) INTEGER
+            The number of right hand sides, i.e., the number of columns
+            of the matrix B.  NRHS >= 0.
+    A       (input/output) DOUBLE PRECISION array, dimension (LDA,N)
+            On entry, the N-by-N coefficient matrix A.
+            On exit, the factors L and U from the factorization
+            A = P*L*U; the unit diagonal elements of L are not stored.
+    LDA     (input) INTEGER
+            The leading dimension of the array A.  LDA >= max(1,N).
+    IPIV    (output) INTEGER array, dimension (N)
+            The pivot indices that define the permutation matrix P;
+            row i of the matrix was interchanged with row IPIV(i).
+    B       (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
+            On entry, the N-by-NRHS matrix of right hand side matrix B.
+            On exit, if INFO = 0, the N-by-NRHS solution matrix X.
+    LDB     (input) INTEGER
+            The leading dimension of the array B.  LDB >= max(1,N).
+    INFO    (output) INTEGER
+            = 0:  successful exit
+            < 0:  if INFO = -i, the i-th argument had an illegal value
+            > 0:  if INFO = i, U(i,i) is exactly zero.  The factorization
+
+                  has been completed, but the factor U is exactly
+                  singular, so the solution could not be computed.
+"),           Window(
+                x=0.4,
+                y=0.4,
+                width=0.6,
+                height=0.6));
+          end dgesv;
+
+          function dummy "Dummy Bspline"
+            // import Modelica_Interpolation;
+           extends Modelica.Icons.Function;
+            input Integer nd "Dimension";
+            input Integer nc "Number of control points";
+            input Integer deg "degree";
+            output
+              ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.Modelica_Interpolation.Bspline1D.Data
+              spline(
+              ndim=nd,
+              ncontrol=nc,
+              degree=deg) "A dummy Bspline with zero entries";
+          protected
+            Integer j;
+          algorithm
+            j:=1;
+          end dummy;
+
+          function getNumberControlPoints "Return the number of control points"
+           extends Modelica.Icons.Function;
+            input Real r[:, :]
+              "r[i,:] is position vector to point i on the curve";
+            input Integer degree "degree of the Bspline";
+            output Integer ncontrol "number of control points";
+          protected
+            Integer n;
+            Integer multi;
+            Integer begin;
+            Real delta[size(r,2)];
+            Integer j;
+            Integer jstart;
+          algorithm
+           n := size(r,1);
+
+           //delete multiple start data points
+           multi := 1;
+
+           for j in 1:n-1 loop
+            delta := r[1,:] - r[1+j,:];
+
+            if sqrt(delta*delta) < 1e-12 then
+             multi := multi + 1;
+
+            end if;
+
+           end for;
+           begin := multi;
+
+           //delete multiple end data points
+           multi := 0;
+
+           for j in 1:n-1 loop
+            delta := r[n,:] - r[n-j,:];
+
+            if sqrt(delta*delta) < 1e-12 then
+             multi := multi + 1;
+
+            end if;
+
+           end for;
+           n := n-multi;
+
+           ncontrol := n;
+           jstart := begin;
+
+           for j in begin+1:n-1 loop
+             delta := r[j,:] - r[j-1,:];
+
+             if sqrt(delta*delta) < 1e-12 then
+
+               if j-1-jstart >= 1 and j-1-jstart < degree then
+                 //an interpolation with a Bspline of degree = p needs
+                 //p+1 data points. If there are less than p+1, insert
+                 //virtual data points to get p+1.
+               ncontrol := ncontrol + degree - (j-1 - jstart);
+
+              end if;
+              jstart := j;
+              delta := r[j+1,:] - r[j,:];
+
+              if sqrt(delta*delta) < 1e-12 then
+               //triple data point; delete one data point
+               ncontrol := ncontrol - 1;
+               jstart := j+1;
+
+              end if;
+
+             end if;
+            end for;
+
+            //end
+            if n-jstart < degree then
+             ncontrol := ncontrol + degree - (n-jstart);
+            end if;
+
+           //multiple start data points
+           ncontrol := ncontrol - begin + 1;
+
+           //if Bessel and degree==3 then size(r, 1)+2 else size(r, 1)
+
+          end getNumberControlPoints;
+
+          function getNumberControlPoints2
+            "Return the number of control points"
+           extends Modelica.Icons.Function;
+            input Real r[:, :]
+              "r[i,:] is position vector to point i on the curve";
+            input Real T[size(r, 1), 3, 3]
+              "T[i,:,:] is transformation matrix from base frame to path frame at point i";
+            input Integer degree "degree of the Bspline";
+            output Integer ncontrol "number of control points";
+          protected
+           Integer n;
+            Real data[size(r,1),7];
+            Real q[4];
+            Real q_old[     4];
+          algorithm
+           n := size(r,1);
+
+           data := zeros(size(r,1),7);
+            data[:,1:3] := r;
+
+            // T2Quat
+            // Get the quaternions of the transformation matrix
+            // Choose the quaternions (+q or -q) which form the smallest angle with
+            // the previous quaternions
+            for i in 1:size(r,1) loop
+              q := T2quat(T[i, :, :]);
+
+             if (i > 1 and (q_old*q) < 0) then
+                q := -q;
+
+            end if;
+            data[i,4:7] := q;
+            q_old := q;
+            end for;
+
+            ncontrol := getNumberControlPoints(data,degree);
+
+          end getNumberControlPoints2;
+
+          function quat2T
+            "Compute transformation matrix from non-consistent quaternions"
+            extends Modelica.Icons.Function;
+            input Real q[4] "Quaternions (non-consistent)";
+            output Real T[3,3] "orthogonal transformation matrix";
+
+          algorithm
+           T[1,1] := q[1]^2 + q[2]^2 - q[3]^2 - q[4]^2;
+           T[2,2] := q[1]^2 - q[2]^2 + q[3]^2 - q[4]^2;
+           T[3,3] := q[1]^2 - q[2]^2 - q[3]^2 + q[4]^2;
+           T[1,2] := 2*(q[2]*q[3] + q[1]*q[4]);
+           T[1,3] := 2*(q[2]*q[4] - q[1]*q[3]);
+           T[2,1] := 2*(q[2]*q[3] - q[1]*q[4]);
+           T[2,3] := 2*(q[3]*q[4] + q[1]*q[2]);
+           T[3,1] := 2*(q[2]*q[4] + q[1]*q[3]);
+           T[3,2] := 2*(q[3]*q[4] - q[1]*q[2]);
+           //make the quaternions consistent
+           T := T/(q*q);
+
+          end quat2T;
+
+          function solveBandedWithMatrix
+            "Solve linear system with banded system matrix and right hand side matrix (similar to Modelica.Matrices.solve)"
+            extends Modelica.Icons.Function;
+            input Integer kLower "Number of lower bands";
+            input Integer kUpper "Number of upper bands";
+            input Real A[2*kLower + kUpper + 1, :] "Matrix A of A*X = B";
+            input Real B[size(A, 2), :] "Matrix B of A*X = B";
+            output Real X[size(A, 2), size(B, 2)]=B
+              "Matrix X such that A*X = B";
+            output Integer info;
+          algorithm
+            (X,info) := dgbsv(size(A,2), kLower, kUpper, A, B);
+            assert(info == 0, "Solving a linear system of equations with function
+\"Modelica_Interpolation.Utilities.solveBandedWithMatrix\" is not possible, since matrix A
+is singular, i.e., no unique solution exists.");
+          end solveBandedWithMatrix;
+
+          function solveMatrix
+            "Solve linear system with right hand side matrix (similar to Modelica_Interpolation.Utilities.solveMatrix)"
+            extends Modelica.Icons.Function;
+            input Real A[:, size(A, 1)] "Matrix A of A*X = B";
+            input Real B[size(A, 1), :] "Matrix B of A*X = B";
+            output Real X[size(B, 1), size(B, 2)]=B
+              "Matrix X such that A*X = B";
+          protected
+            Integer info;
+          algorithm
+            (X,info) := dgesv(A, B);
+            assert(info == 0, "Solving a linear system of equations with function
+\"Modelica_Interpolation.Utilities.solveMatrix\" is not possible, since matrix A
+is singular, i.e., no unique solution exists.");
+          end solveMatrix;
+
+          function T2quat "Compute Quaternions from a transformation matrix"
+            extends Modelica.Icons.Function;
+            input Real T[3,3] "transformation matrix";
+            output Real q[4] "Quaternions of T (q and -q have same T)";
+
+          protected
+            Real branch "only for test purposes";
+            Real paux;
+            Real paux4;
+            Real c1;
+            Real c2;
+            Real c3;
+            Real c4;
+            Real p4limit=0.1;
+            Real c4limit=4*p4limit*p4limit;
+
+          algorithm
+           c1 := 1 + T[1,1] - T[2,2] - T[3,3];
+           c2 := 1 + T[2,2] - T[1,1] - T[3,3];
+           c3 := 1 + T[3,3] - T[1,1] - T[2,2];
+           c4 := 1 + T[1,1] + T[2,2] + T[3,3];
+
+           if (c4 > c4limit) or (c4 > c1 and c4 > c2 and c4 > c3) then
+              branch := 4;
+              paux := sqrt(c4)/2;
+              paux4 := 4*paux;
+              q := {paux,
+                   (T[2,3] - T[3,2])/paux4,
+                   (T[3,1] - T[1,3])/paux4,
+                   (T[1,2] - T[2,1])/paux4};
+
+           elseif c1 > c2 and c1 > c3 and c1 > c4 then
+              branch := 1;
+              paux := sqrt(c1)/2;
+              paux4 := 4*paux;
+              q := {(T[2,3] - T[3,2])/paux4,
+                   paux,
+                   (T[1,2] + T[2,1])/paux4,
+                   (T[1,3] + T[3,1])/paux4};
+
+           elseif c2 > c1 and c2 > c3 and c2 > c4 then
+              branch := 2;
+              paux := sqrt(c2)/2;
+              paux4 := 4*paux;
+              q := {(T[3,1] - T[1,3])/paux4,
+                   (T[1,2] + T[2,1])/paux4,
+                   paux,
+                   (T[2,3] + T[3,2])/paux4};
+
+           else
+              branch := 3;
+              paux := sqrt(c3)/2;
+              paux4 := 4*paux;
+              q := {(T[1,2] - T[2,1])/paux4,
+                   (T[1,3] + T[3,1])/paux4,
+                   (T[2,3] + T[3,2])/paux4,
+                   paux};
+
+           end if;
+
+          end T2quat;
+        annotation (
+          Window(
+            x=0.45,
+            y=0.01,
+            width=0.44,
+            height=0.65,
+            library=1,
+            autolayout=1),
+          Documentation(info="<HTML>
+<p>
+Utility functions are provided here which are usually not called directly
+by a user, but are needed in the functions of this package
+</p>
+<p>
+The following functions are supported:
+</p>
+<pre>
+  curveLength                          Compute the length of a curve with adaptive quadrature
+  dummy                                return a dummy Bspline with zero entries
+  getNumberControlPoints        Compute the number of control points for the given data points
+  getNumberControlPoints2        Compute the number of control points for the given data points
+                                                                                                  and transformation matrices
+  quat2T                               Compute the transformation matrix of the given quaternions
+  T2quat                               Compute the quaternions of the given transformation matrix
+</pre>
+<p><b>Release Notes:</b></p>
+<ul>
+<li><i>Sept. 13, 2002</i>
+       by Gerhard Schillhuber:<br>
+       first version implemented
+</li>
+<li><i>Oct. 17, 2002</i>
+       by Gerhard Schillhuber:<br>
+       new functions: getNumberControlPoints, getNumberControlPoints2
+                               compute the number of control points for the given data points. It's needed
+                               to initialize the curve.
+</li>
+</ul>
+<br>
+<p><b>Copyright (C) 2002, Modelica Association and DLR.</b></p>
+<p><i>
+This package is <b>free</b> software. It can be redistributed and/or modified
+under the terms of the <b>Modelica license</b>, see the license conditions
+and the accompanying <b>disclaimer</b> in the documentation of package
+Modelica in file \"Modelica/package.mo\".
+</i></p>
+</HTML>
+"));
+        end Utilities;
+        annotation (Icon(graphics={
+              Text(
+                extent={{-102,0},{24,-26}},
+                lineColor={242,148,0},
+                textString=
+                     "Thermo"),
+              Text(
+                extent={{-4,8},{68,-34}},
+                lineColor={46,170,220},
+                textString=
+                     "SysPro"),
+              Polygon(
+                points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},
+                    {42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,
+                    10},{-50,6},{-62,2}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{
+                    -46,8},{-42,22},{-42,30},{-44,38}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{
+                    -12,12},{-26,12},{-28,12},{-26,20}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-8,30},{-6,26}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-8,36},{-6,32}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-8,42},{-6,38}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-8,48},{-6,44}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-4,32},{-2,28}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-4,38},{-2,34}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-4,44},{-2,40}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Rectangle(
+                extent={{-4,50},{-2,46}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{
+                    -2,20}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Polygon(
+                points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},
+                    {42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},
+                    {-50,6},{-62,2}},
+                lineColor={242,148,0},
+                fillColor={242,148,0},
+                fillPattern=FillPattern.Solid),
+              Line(
+                points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+                color={46,170,220},
+                thickness=0.5),
+              Line(
+                points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+                color={46,170,220},
+                thickness=0.5),
+              Line(
+                points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+                color={46,170,220},
+                thickness=0.5),
+              Polygon(
+                points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+                lineColor={46,170,220},
+                fillColor={46,170,220},
+                fillPattern=FillPattern.Solid),
+              Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+              Line(
+                points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+                color={0,0,255},
+                smooth=Smooth.None),
+              Line(
+                points={{80,80},{100,100}},
+                color={0,0,255},
+                smooth=Smooth.None)}));
+      end Modelica_Interpolation;
+
+      model PhaseBoundary "Model used to create the phase boundary"
+
+        parameter Integer npoints=100;
+        Real p[npoints] "pressure";
+        Real hl[npoints] "liquid specific enthalpy";
+        Real hv[npoints] "vapour specific enthalpy";
+
+        parameter Real TMAX=ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.TCRIT;
+        //parameter Real TMAX=32.938;
+        parameter Real TMIN = ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.Ttriple-0.01;
+      protected
+        Real[npoints] T "temperature";
+
+      algorithm
+        T := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Spline_Utilities.linspace(
+                      TMIN,TMAX,npoints);
+
+        p[1]  := ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple;
+        for i in 2:npoints-1 loop
+          p[i]  := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T[i]);
+        end for;
+        p[end]  := ThermoSysPro.Properties.WaterSteam.BaseIF97.critical.PCRIT;
+
+        for i in 1:npoints loop
+          hl[i] := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p[i]);
+          hv[i] := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p[i]);
+        end for;
+
+        annotation (
+          Icon(graphics));
+      end PhaseBoundary;
+      annotation (Icon(graphics={
+            Text(
+              extent={{-102,0},{24,-26}},
+              lineColor={242,148,0},
+              textString=
+                   "Thermo"),
+            Text(
+              extent={{-4,8},{68,-34}},
+              lineColor={46,170,220},
+              textString=
+                   "SysPro"),
+            Polygon(
+              points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},
+                  {42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},
+                  {-50,6},{-62,2}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{
+                  -46,8},{-42,22},{-42,30},{-44,38}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{
+                  -12,12},{-26,12},{-28,12},{-26,20}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-8,30},{-6,26}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-8,36},{-6,32}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-8,42},{-6,38}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-8,48},{-6,44}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-4,32},{-2,28}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-4,38},{-2,34}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-4,44},{-2,40}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Rectangle(
+              extent={{-4,50},{-2,46}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                  20}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Polygon(
+              points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},
+                  {42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},
+                  {-50,6},{-62,2}},
+              lineColor={242,148,0},
+              fillColor={242,148,0},
+              fillPattern=FillPattern.Solid),
+            Line(
+              points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+              color={46,170,220},
+              thickness=0.5),
+            Line(
+              points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+              color={46,170,220},
+              thickness=0.5),
+            Line(
+              points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+              color={46,170,220},
+              thickness=0.5),
+            Polygon(
+              points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+              lineColor={46,170,220},
+              fillColor={46,170,220},
+              fillPattern=FillPattern.Solid),
+            Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+            Line(
+              points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+              color={0,0,255},
+              smooth=Smooth.None),
+            Line(
+              points={{80,80},{100,100}},
+              color={0,0,255},
+              smooth=Smooth.None)}));
+    end Spline_Utilities;
+
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2},
+          initialScale=0.1), graphics={
+          Text(
+            extent={{-102,0},{24,-26}},
+            lineColor={242,148,0},
+            textString=
+                 "Thermo"),
+          Text(
+            extent={{-4,8},{68,-34}},
+            lineColor={46,170,220},
+            textString=
+                 "SysPro"),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{
+                42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{
+                -50,6},{-62,2}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,
+                8},{-42,22},{-42,30},{-44,38}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,
+                12},{-26,12},{-28,12},{-26,20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,30},{-6,26}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,36},{-6,32}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,42},{-6,38}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-8,48},{-6,44}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,32},{-2,28}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,38},{-2,34}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,44},{-2,40}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-4,50},{-2,46}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,
+                20}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{
+                42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{
+                -50,6},{-62,2}},
+            lineColor={242,148,0},
+            fillColor={242,148,0},
+            fillPattern=FillPattern.Solid),
+          Line(
+            points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+            color={46,170,220},
+            thickness=0.5),
+          Line(
+            points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+            color={46,170,220},
+            thickness=0.5),
+          Polygon(
+            points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+            lineColor={46,170,220},
+            fillColor={46,170,220},
+            fillPattern=FillPattern.Solid),
+          Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+          Line(
+            points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+            color={0,0,255},
+            smooth=Smooth.None),
+          Line(
+            points={{80,80},{100,100}},
+            color={0,0,255},
+            smooth=Smooth.None)}),
+      Window(
+        x=0.05,
+        y=0.51,
+        width=0.25,
+        height=0.26,
+        library=1,
+        autolayout=1),
+      Documentation(info="<html>
+<p><b>Version 1.2</b></p>
+</HTML>
+"));
+  end IF97_wAJ;
+  annotation (Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end IF97_packages;
diff --git a/ThermoSysPro/Properties/WaterSteam/InitLimits.mo b/ThermoSysPro/Properties/WaterSteam/InitLimits.mo
index c38dd6c9bb737fbb8eccd35d4d0067ec84f13ecf..078fde98d8ce8fbf92990c8f50128ab8be08e149 100644
--- a/ThermoSysPro/Properties/WaterSteam/InitLimits.mo
+++ b/ThermoSysPro/Properties/WaterSteam/InitLimits.mo
@@ -1,218 +1,218 @@
-within ThermoSysPro.Properties.WaterSteam;
-package InitLimits
-  constant Real MINPOS=1.0e-9
-    "minimal value for physical variables which are always > 0.0";
-
-  constant Units.SI.Area AMIN=MINPOS "Minimum surface";
-  constant Units.SI.Area AMAX=1.0e5 "Maximum surface";
-  constant Units.SI.Area ANOM=1.0 "Nominal surface";
-  constant Units.SI.Density DMIN=MINPOS "Minimum density";
-  constant Units.SI.Density DMAX=1.0e5 "Maximum densitye";
-  constant Units.SI.Density DNOM=998.0 "Nominal density";
-  constant Units.SI.ThermalConductivity LAMMIN=MINPOS
-    "Minimum thermal conductivity";
-  constant Units.SI.ThermalConductivity LAMNOM=1.0
-    "Nominal thermal conductivity";
-  constant Units.SI.ThermalConductivity LAMMAX=1000.0
-    "Maximum thermal conductivity";
-  constant Units.SI.DynamicViscosity ETAMIN=MINPOS "Minimum dynamic viscosity";
-  constant Units.SI.DynamicViscosity ETAMAX=1.0e8 "Maximum dynamic viscosity";
-  constant Units.SI.DynamicViscosity ETANOM=100.0 "Nominal dynamic viscosity";
-  constant Units.SI.Energy EMIN=-1.0e10 "Minimum energy";
-  constant Units.SI.Energy EMAX=1.0e10 "Maximum energy";
-  constant Units.SI.Energy ENOM=1.0e3 "Nominal energy";
-  constant Units.SI.Entropy SMIN=-1.0e6 "Minimum entropy";
-  constant Units.SI.Entropy SMAX=1.0e6 "Maximum entropy";
-  constant Units.SI.Entropy SNOM=1.0e3 "Nominal entropy";
-  constant Units.SI.MassFlowRate MDOTMIN=-1.0e5 "Minimum mass flow rate";
-  constant Units.SI.MassFlowRate MDOTMAX=1.0e5 "Maximum mass flow rate";
-  constant Units.SI.MassFlowRate MDOTNOM=1.0 "Nominal mass flow rate";
-  constant ThermoSysPro.Units.SI.MassFraction MASSXMIN=-1.0*MINPOS
-    "Minimum mass fraction";
-  constant ThermoSysPro.Units.SI.MassFraction MASSXMAX=1.0
-    "Maximum mass fraction";
-  constant ThermoSysPro.Units.SI.MassFraction MASSXNOM=0.1
-    "Nominal mass fraction";
-  constant Units.SI.Mass MMIN=1.0*MINPOS "Minimum mass";
-  constant Units.SI.Mass MMAX=1.0e8 "Maximum mass";
-  constant Units.SI.Mass MNOM=1.0 "Nominal mass";
-  constant Units.SI.Power POWMIN=-1.0e8 "Minimum power";
-  constant Units.SI.Power POWMAX=1.0e8 "Maximum power";
-  constant Units.SI.Power POWNOM=1.0e3 "Nominal power";
-  constant Units.SI.AbsolutePressure PMIN=100.0 "Minimum pressure";
-  constant Units.SI.AbsolutePressure PMAX=1.0e9 "Maximum pressure";
-  constant Units.SI.AbsolutePressure PNOM=1.0e5 "Nominal pressure";
-  constant Units.SI.AbsolutePressure COMPPMIN=-1.0*MINPOS "Minimum pressure";
-  constant Units.SI.AbsolutePressure COMPPMAX=1.0e8 "Maximum pressure";
-  constant Units.SI.AbsolutePressure COMPPNOM=1.0e5 "Nominal pressure";
-  constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMIN=1.0
-    "Minimum isentropic exponent";
-  constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMAX=Modelica.Constants.inf
-    "Maximum isentropic exponent";
-  constant Units.SI.RatioOfSpecificHeatCapacities KAPPANOM=1.2
-    "Nominal isentropic exponent";
-  constant Units.SI.SpecificEnergy SEMIN=-1.0e8 "Minimum specific energy";
-  constant Units.SI.SpecificEnergy SEMAX=1.0e8 "Maximum specific energy";
-  constant Units.SI.SpecificEnergy SENOM=1.0e6 "Nominal specific energy";
-  constant Units.SI.SpecificEnthalpy SHMIN=-1.0e6 "Minimum specific enthalpy";
-  constant Units.SI.SpecificEnthalpy SHMAX=1.0e8 "Maximum specific enthalpy";
-  constant Units.SI.SpecificEnthalpy SHNOM=1.0e6 "Nominal specific enthalpy";
-  constant Units.SI.SpecificEntropy SSMIN=-1.0e6 "Minimum specific entropy";
-  constant Units.SI.SpecificEntropy SSMAX=1.0e6 "Maximum specific entropy";
-  constant Units.SI.SpecificEntropy SSNOM=1.0e3 "Nominal specific entropy";
-  constant Units.SI.SpecificHeatCapacity CPMIN=MINPOS
-    "Minimum specific heat capacity";
-  constant Units.SI.SpecificHeatCapacity CPMAX=Modelica.Constants.inf
-    "Maximum specific heat capacity";
-  constant Units.SI.SpecificHeatCapacity CPNOM=1.0e3
-    "Nominal specific heat capacity";
-  constant Units.SI.Temperature TMIN=200 "Minimum temperature";
-  constant Units.SI.Temperature TMAX=6000 "Maximum temperature";
-  constant Units.SI.Temperature TNOM=320.0 "Nominal temperature";
-  constant Units.SI.ThermalConductivity LMIN=MINPOS
-    "Minimum thermal conductivity";
-  constant Units.SI.ThermalConductivity LMAX=500.0
-    "Maximum thermal conductivity";
-  constant Units.SI.ThermalConductivity LNOM=1.0 "Nominal thermal conductivity";
-  constant Units.SI.Velocity VELMIN=-1.0e5 "Minimum velocity";
-  constant Units.SI.Velocity VELMAX=Modelica.Constants.inf "Maximum velocity";
-  constant Units.SI.Velocity VELNOM=1.0 "Nominal velocity";
-  constant Units.SI.Volume VMIN=0.0 "Minimum volume";
-  constant Units.SI.Volume VMAX=1.0e5 "Maximum volume";
-  constant Units.SI.Volume VNOM=1.0e-3 "Nominal volume";
-
-  annotation (
-    Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.51,
-      height=0.74,
-      library=1,
-      autolayout=1),
-    Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library  (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-
-end InitLimits;
+within ThermoSysPro.Properties.WaterSteam;
+package InitLimits
+  constant Real MINPOS=1.0e-9
+    "minimal value for physical variables which are always > 0.0";
+
+  constant Units.SI.Area AMIN=MINPOS "Minimum surface";
+  constant Units.SI.Area AMAX=1.0e5 "Maximum surface";
+  constant Units.SI.Area ANOM=1.0 "Nominal surface";
+  constant Units.SI.Density DMIN=MINPOS "Minimum density";
+  constant Units.SI.Density DMAX=1.0e5 "Maximum densitye";
+  constant Units.SI.Density DNOM=998.0 "Nominal density";
+  constant Units.SI.ThermalConductivity LAMMIN=MINPOS
+    "Minimum thermal conductivity";
+  constant Units.SI.ThermalConductivity LAMNOM=1.0
+    "Nominal thermal conductivity";
+  constant Units.SI.ThermalConductivity LAMMAX=1000.0
+    "Maximum thermal conductivity";
+  constant Units.SI.DynamicViscosity ETAMIN=MINPOS "Minimum dynamic viscosity";
+  constant Units.SI.DynamicViscosity ETAMAX=1.0e8 "Maximum dynamic viscosity";
+  constant Units.SI.DynamicViscosity ETANOM=100.0 "Nominal dynamic viscosity";
+  constant Units.SI.Energy EMIN=-1.0e10 "Minimum energy";
+  constant Units.SI.Energy EMAX=1.0e10 "Maximum energy";
+  constant Units.SI.Energy ENOM=1.0e3 "Nominal energy";
+  constant Units.SI.Entropy SMIN=-1.0e6 "Minimum entropy";
+  constant Units.SI.Entropy SMAX=1.0e6 "Maximum entropy";
+  constant Units.SI.Entropy SNOM=1.0e3 "Nominal entropy";
+  constant Units.SI.MassFlowRate MDOTMIN=-1.0e5 "Minimum mass flow rate";
+  constant Units.SI.MassFlowRate MDOTMAX=1.0e5 "Maximum mass flow rate";
+  constant Units.SI.MassFlowRate MDOTNOM=1.0 "Nominal mass flow rate";
+  constant ThermoSysPro.Units.SI.MassFraction MASSXMIN=-1.0*MINPOS
+    "Minimum mass fraction";
+  constant ThermoSysPro.Units.SI.MassFraction MASSXMAX=1.0
+    "Maximum mass fraction";
+  constant ThermoSysPro.Units.SI.MassFraction MASSXNOM=0.1
+    "Nominal mass fraction";
+  constant Units.SI.Mass MMIN=1.0*MINPOS "Minimum mass";
+  constant Units.SI.Mass MMAX=1.0e8 "Maximum mass";
+  constant Units.SI.Mass MNOM=1.0 "Nominal mass";
+  constant Units.SI.Power POWMIN=-1.0e8 "Minimum power";
+  constant Units.SI.Power POWMAX=1.0e8 "Maximum power";
+  constant Units.SI.Power POWNOM=1.0e3 "Nominal power";
+  constant Units.SI.AbsolutePressure PMIN=100.0 "Minimum pressure";
+  constant Units.SI.AbsolutePressure PMAX=1.0e9 "Maximum pressure";
+  constant Units.SI.AbsolutePressure PNOM=1.0e5 "Nominal pressure";
+  constant Units.SI.AbsolutePressure COMPPMIN=-1.0*MINPOS "Minimum pressure";
+  constant Units.SI.AbsolutePressure COMPPMAX=1.0e8 "Maximum pressure";
+  constant Units.SI.AbsolutePressure COMPPNOM=1.0e5 "Nominal pressure";
+  constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMIN=1.0
+    "Minimum isentropic exponent";
+  constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMAX=Modelica.Constants.inf
+    "Maximum isentropic exponent";
+  constant Units.SI.RatioOfSpecificHeatCapacities KAPPANOM=1.2
+    "Nominal isentropic exponent";
+  constant Units.SI.SpecificEnergy SEMIN=-1.0e8 "Minimum specific energy";
+  constant Units.SI.SpecificEnergy SEMAX=1.0e8 "Maximum specific energy";
+  constant Units.SI.SpecificEnergy SENOM=1.0e6 "Nominal specific energy";
+  constant Units.SI.SpecificEnthalpy SHMIN=-1.0e6 "Minimum specific enthalpy";
+  constant Units.SI.SpecificEnthalpy SHMAX=1.0e8 "Maximum specific enthalpy";
+  constant Units.SI.SpecificEnthalpy SHNOM=1.0e6 "Nominal specific enthalpy";
+  constant Units.SI.SpecificEntropy SSMIN=-1.0e6 "Minimum specific entropy";
+  constant Units.SI.SpecificEntropy SSMAX=1.0e6 "Maximum specific entropy";
+  constant Units.SI.SpecificEntropy SSNOM=1.0e3 "Nominal specific entropy";
+  constant Units.SI.SpecificHeatCapacity CPMIN=MINPOS
+    "Minimum specific heat capacity";
+  constant Units.SI.SpecificHeatCapacity CPMAX=Modelica.Constants.inf
+    "Maximum specific heat capacity";
+  constant Units.SI.SpecificHeatCapacity CPNOM=1.0e3
+    "Nominal specific heat capacity";
+  constant Units.SI.Temperature TMIN=200 "Minimum temperature";
+  constant Units.SI.Temperature TMAX=6000 "Maximum temperature";
+  constant Units.SI.Temperature TNOM=320.0 "Nominal temperature";
+  constant Units.SI.ThermalConductivity LMIN=MINPOS
+    "Minimum thermal conductivity";
+  constant Units.SI.ThermalConductivity LMAX=500.0
+    "Maximum thermal conductivity";
+  constant Units.SI.ThermalConductivity LNOM=1.0 "Nominal thermal conductivity";
+  constant Units.SI.Velocity VELMIN=-1.0e5 "Minimum velocity";
+  constant Units.SI.Velocity VELMAX=Modelica.Constants.inf "Maximum velocity";
+  constant Units.SI.Velocity VELNOM=1.0 "Nominal velocity";
+  constant Units.SI.Volume VMIN=0.0 "Minimum volume";
+  constant Units.SI.Volume VMAX=1.0e5 "Maximum volume";
+  constant Units.SI.Volume VNOM=1.0e-3 "Nominal volume";
+
+  annotation (
+    Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.51,
+      height=0.74,
+      library=1,
+      autolayout=1),
+    Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library  (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+
+end InitLimits;
diff --git a/ThermoSysPro/Properties/WaterSteam/Region.mo b/ThermoSysPro/Properties/WaterSteam/Region.mo
index 8b320097db0888edc4c819c0b927a4284354efbb..46dc13bba4dccf63abd499778095ad456cc6ba96 100644
--- a/ThermoSysPro/Properties/WaterSteam/Region.mo
+++ b/ThermoSysPro/Properties/WaterSteam/Region.mo
@@ -1,419 +1,419 @@
-within ThermoSysPro.Properties.WaterSteam;
-package Region
-  function boilingcurveL3_p "properties on the boiling curve"
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "pressure";
-    output
-      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
-      bpro "property record";
-  protected
-    ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
-      "dimensionless Gibbs funcion and dervatives";
-    ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
-      "dimensionless Helmholtz function and dervatives";
-    Units.SI.Pressure plim=min(p, ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
-         - 1e-7) "pressure limited to critical pressure - epsilon";
-    Units.SI.SpecificVolume v "Specific Volume";
-    Real vp3 "vp^3";
-    Real ivp3 "1/vp^3";
-    Real pv "partial derivative of p w.r.t v";
-    Real pv2 "pv^2";
-    Real pv3 "pv^3";
-    Real ptv "2nd partial derivative of p w.r.t t and v";
-    Real pvv "2nd partial derivative of p w.r.t v and v";
-  algorithm
-    g.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
-    bpro.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(plim);
-    (bpro.dpT,bpro.dpTT) :=
-      ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.d2ptofT(bpro.T);
-    // need derivative of dpT
-  //  g.Region3boundary := bpro.T > data.TLIMIT1;
-    if not bpro.T > ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TLIMIT1 then
-      g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
-                      p, bpro.T);
-      bpro.d := p/(g.R*bpro.T*g.pi*g.gpi);
-      bpro.h := if p > plim then ThermoSysPro.Properties.WaterSteam.BaseIF97.data.HCRIT
-         else g.R*bpro.T*g.tau*g.gtau;
-      bpro.s := g.R*(g.tau*g.gtau - g.g);
-      bpro.cp := -g.R*g.tau*g.tau*g.gtautau;
-      bpro.vt := g.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-      bpro.vp := g.R*bpro.T/(p*p)*g.pi*g.pi*g.gpipi;
-      bpro.pt := -p/bpro.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-      bpro.pd := -g.R*bpro.T*g.gpi*g.gpi/(g.gpipi);
-      bpro.vtt := g.R*g.pi/p*g.tau/bpro.T*g.tau*g.gpitautau;
-      bpro.vtp := g.R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-      bpro.vpp := g.R*bpro.T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-      bpro.cpt := g.R*g.tau*g.tau/bpro.T*(2*g.gtautau + g.tau*g.gtautautau);
-      v := 1/bpro.d;
-      vp3 := bpro.vp*bpro.vp*bpro.vp;
-      ivp3 := 1/vp3;
-      bpro.ptt := -(bpro.vtt*bpro.vp*bpro.vp -2.0*bpro.vt*bpro.vtp*bpro.vp +bpro.vt*bpro.vt*bpro.vpp)*ivp3;
-      bpro.pdd := -bpro.vpp*ivp3*v*v*v*v - 2*v*bpro.pd "= pvv/d^4";
-      bpro.ptd := (bpro.vtp*bpro.vp-bpro.vt*bpro.vpp)*ivp3*v*v "= -ptv/d^2";
-      bpro.cvt := (vp3*bpro.cpt + bpro.vp*bpro.vp*bpro.vt*bpro.vt + 3.0*bpro.vp*bpro.vp*bpro.T*bpro.vt*bpro.vtt
-        - 3.0*bpro.vtp*bpro.vp*bpro.T*bpro.vt*bpro.vt + bpro.T*bpro.vt*bpro.vt*bpro.vt*bpro.vpp)*ivp3;
-    else
-      bpro.d :=
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_p_R4b(plim);
-      f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
-                      bpro.d, bpro.T);
-      bpro.h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p_R4b(
-        plim);
-      // g.R*bpro.T*(f.tau*f.ftau + f.delta*f.fdelta);
-      bpro.s := f.R*(f.tau*f.ftau - f.f);
-      bpro.cv := g.R*(-f.tau*f.tau*f.ftautau);
-      bpro.pt := g.R*bpro.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-      bpro.pd := g.R*bpro.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-      pv := (-f.d*f.d*bpro.pd);
-      bpro.vp := 1/pv;
-      bpro.vt := -bpro.pt/pv;
-      bpro.pdd := f.R*bpro.T*f.delta/bpro.d*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
-           f.delta*f.delta*f.fdeltadeltadelta);
-      bpro.ptt := f.R*bpro.d*f.delta*f.tau*f.tau/bpro.T*f.fdeltatautau;
-      bpro.ptd := f.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
-       -f.delta*f.tau*f.fdeltadeltatau);
-      bpro.cvt := f.R*f.tau*f.tau/bpro.T*(2.0*f.ftautau + f.tau*f.ftautautau);
-      bpro.cpt := (bpro.cvt*bpro.pd + bpro.cv*bpro.ptd + (bpro.pt + 2.0*bpro.T*bpro.ptt)*bpro.pt/(bpro.d*bpro.d)
-       - bpro.cp*bpro.ptd)/bpro.pd;
-      pv2 := pv*pv;
-      pv3 := pv2*pv;
-      pvv := bpro.pdd*f.d*f.d*f.d*f.d;
-      ptv := (-f.d*f.d*bpro.ptd);
-      bpro.vpp := -pvv/pv3;
-      bpro.vtt := -(bpro.ptt*pv2 -2.0*bpro.pt*ptv*pv + bpro.pt*bpro.pt*pvv)/pv3;
-      bpro.vtp := (-ptv*pv + bpro.pt*pvv)/pv3;
-    end if;
-  end boilingcurveL3_p;
-
-  function dewcurveL3_p "properties on the dew curve"
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "pressure";
-    output
-      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
-      bpro "property record";
-  protected
-    ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
-      "dimensionless Gibbs funcion and dervatives";
-    ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
-      "dimensionless Helmholtz function and dervatives";
-    Units.SI.Pressure plim=min(p, ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
-         - 1e-7) "pressure limited to critical pressure - epsilon";
-    Units.SI.SpecificVolume v "Specific Volume";
-    Real vp3 "vp^3";
-    Real ivp3 "1/vp^3";
-    Real pv "partial derivative of p w.r.t v";
-    Real pv2 "pv^2";
-    Real pv3 "pv^3";
-    Real ptv "2nd partial derivative of p w.r.t t and v";
-    Real pvv "2nd partial derivative of p w.r.t v and v";
-  algorithm
-    bpro.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(plim);
-    (bpro.dpT,bpro.dpTT) :=
-      ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.d2ptofT(bpro.T);
-    // need derivative of dpT
-  //  bpro.region3boundary := bpro.T > data.TLIMIT1;
-    if not bpro.T > ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TLIMIT1 then
-      g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
-                      p, bpro.T);
-      bpro.d := p/(g.R*bpro.T*g.pi*g.gpi);
-      bpro.h := if p > plim then ThermoSysPro.Properties.WaterSteam.BaseIF97.data.HCRIT
-         else g.R*bpro.T*g.tau*g.gtau;
-      bpro.s := g.R*(g.tau*g.gtau - g.g);
-      bpro.cp := -g.R*g.tau*g.tau*g.gtautau;
-      bpro.vt := g.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
-      bpro.vp := g.R*bpro.T/(p*p)*g.pi*g.pi*g.gpipi;
-      bpro.pt := -p/bpro.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
-      bpro.pd := -g.R*bpro.T*g.gpi*g.gpi/(g.gpipi);
-      bpro.vtt := g.R*g.pi/p*g.tau/bpro.T*g.tau*g.gpitautau;
-      bpro.vtp := g.R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
-      bpro.vpp := g.R*bpro.T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
-      bpro.cpt := g.R*g.tau*g.tau/bpro.T*(2*g.gtautau + g.tau*g.gtautautau);
-      v := 1/bpro.d;
-      vp3 := bpro.vp*bpro.vp*bpro.vp;
-      ivp3 := 1/vp3;
-      bpro.ptt := -(bpro.vtt*bpro.vp*bpro.vp -2.0*bpro.vt*bpro.vtp*bpro.vp +bpro.vt*bpro.vt*bpro.vpp)*ivp3;
-      bpro.pdd := -bpro.vpp*ivp3*v*v*v*v - 2*v*bpro.pd "= pvv/d^4";
-      bpro.ptd := (bpro.vtp*bpro.vp-bpro.vt*bpro.vpp)*ivp3*v*v "= -ptv/d^2";
-      bpro.cvt := (vp3*bpro.cpt + bpro.vp*bpro.vp*bpro.vt*bpro.vt + 3.0*bpro.vp*bpro.vp*bpro.T*bpro.vt*bpro.vtt
-        - 3.0*bpro.vtp*bpro.vp*bpro.T*bpro.vt*bpro.vt + bpro.T*bpro.vt*bpro.vt*bpro.vt*bpro.vpp)*ivp3;
-    else
-      bpro.d :=
-        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_p_R4b(plim);
-      f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
-                      bpro.d, bpro.T);
-      bpro.h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p_R4b(
-        plim);
-      // f.R*bpro.T*(f.tau*f.ftau + f.delta*f.fdelta);
-      bpro.s := f.R*(f.tau*f.ftau - f.f);
-      bpro.cv := f.R*(-f.tau*f.tau*f.ftautau);
-      bpro.pt := f.R*bpro.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
-      bpro.pd := f.R*bpro.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
-      pv := (-f.d*f.d*bpro.pd);
-      bpro.vp := 1/pv;
-      bpro.vt := -bpro.pt/pv;
-      bpro.pdd := f.R*bpro.T*f.delta/bpro.d*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
-           f.delta*f.delta*f.fdeltadeltadelta);
-      bpro.ptt := f.R*bpro.d*f.delta*f.tau*f.tau/bpro.T*f.fdeltatautau;
-      bpro.ptd := f.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
-    -f.delta*f.tau*f.fdeltadeltatau);
-      bpro.cvt := f.R*f.tau*f.tau/bpro.T*(2.0*f.ftautau + f.tau*f.ftautautau);
-      bpro.cpt := (bpro.cvt*bpro.pd + bpro.cv*bpro.ptd + (bpro.pt + 2.0*bpro.T*bpro.ptt)*bpro.pt/(bpro.d*bpro.d)
-    - bpro.cp*bpro.ptd)/bpro.pd;
-      pv2 := pv*pv;
-      pv3 := pv2*pv;
-      pvv := bpro.pdd*f.d*f.d*f.d*f.d;
-      ptv := (-f.d*f.d*bpro.ptd);
-      bpro.vpp := -pvv/pv3;
-      bpro.vtt := -(bpro.ptt*pv2 -2.0*bpro.pt*ptv*pv + bpro.pt*bpro.pt*pvv)/pv3;
-      bpro.vtp := (-ptv*pv + bpro.pt*pvv)/pv3;
-    end if;
-  end dewcurveL3_p;
-
-  function hvl_dp
-    "derivative function for the specific enthalpy along the phase boundary"
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "pressure";
-    input
-      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
-      bpro "property record";
-    output Real dh_dp
-      "derivative of specific enthalpy along the phase boundary";
-  algorithm
-      dh_dp := (1/bpro.d - bpro.T*bpro.vt) + bpro.cp/bpro.dpT;
-      // dh_dp_der := vp - (T*vpt + dTp*vt) + d/dp(cp/(dp/dT))
-    annotation (
-      derivative(noDerivative=bpro) = hvl_dp_der,
-      Inline=false,
-      LateInline=true);
-  end hvl_dp;
-
-  function hvl_dp_der
-    "derivative function for the specific enthalpy along the phase boundary"
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "pressure";
-    input
-      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
-      bpro "property record";
-    input Real p_der "Pressure derivative";
-    output Real dh_dp_der
-      "Second derivative of specific enthalpy along the phase boundary";
-  protected
-    Real cpp "Derivative of cp w.r.t. p";
-    Real pv "partial derivative of p w.r.t. v";
-    Real pv2 "pv*pv";
-    Real pv3 "pv*pv*pv";
-    Real ptv "2nd partial derivative of p w.r.t t and v";
-    Real pvv "2nd partial derivative of p w.r.t v and v";
-  algorithm
-    pv :=-bpro.d*bpro.d*bpro.pd;
-    pv2 := pv*pv;
-    pv3 := pv2*pv;
-    pvv := bpro.pdd*bpro.d*bpro.d*bpro.d*bpro.d;
-    ptv := (-bpro.d*bpro.d*bpro.ptd);
-    cpp := (bpro.T*(bpro.ptt*pv2 - 2.0*bpro.pt*ptv*pv + bpro.pt*bpro.pt*pvv))/pv3
-      "T*(ptt*pv^2 - 2*pt*ptv*pv + pt^2*pvv)/pv^3";
-    dh_dp_der := 0.0;
-  //   dh_dp_der := 1/pv - (bpro.T*bpro.vtp + bpro.dpT*bpro.vt) +
-  //     cpp/bpro.dpT - bpro.cp*(bpro.dpTT*bpro.dpT)/(bpro.dpT*bpro.dpT);
-  //     //d/dp(cp/(dp/dT))
-
-    annotation (Icon(graphics={Rectangle(
-            extent={{-100,100},{100,-100}},
-            lineColor={255,0,0},
-            lineThickness=0.5)}));
-  end hvl_dp_der;
-
-    function dhl_dp
-    "derivative of liquid specific enthalpy on the boundary between regions 4 and 3 or 1 w.r.t pressure"
-
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "pressure";
-    output Units.SI.DerEnthalpyByPressure dh_dp
-      "specific enthalpy derivative w.r.t. pressure";
-    algorithm
-    dh_dp := ThermoSysPro.Properties.WaterSteam.Region.hvl_dp(p,
-      ThermoSysPro.Properties.WaterSteam.Region.boilingcurveL3_p(p));
-    annotation(smoothOrder=2);
-    end dhl_dp;
-
-  function dhv_dp
-    "derivative of vapour specific enthalpy on the boundary between regions 4 and 3 or 1 w.r.t pressure"
-
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "pressure";
-    output Units.SI.DerEnthalpyByPressure dh_dp
-      "specific enthalpy derivative w.r.t. pressure";
-  algorithm
-    dh_dp := ThermoSysPro.Properties.WaterSteam.Region.hvl_dp(p,
-      ThermoSysPro.Properties.WaterSteam.Region.dewcurveL3_p(p));
-    annotation(smoothOrder=2);
-  end dhv_dp;
-
-  function drhovl_dp
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "saturation pressure";
-    input
-      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
-      bpro "property record";
-    output Real dd_dp(unit="kg/(m3.Pa)")
-      "derivative of density along the phase boundary";
-  algorithm
-    dd_dp := -bpro.d*bpro.d*(bpro.vp + bpro.vt/bpro.dpT);
-    annotation (
-      derivative(noDerivative=bpro) = drhovl_dp_der,
-      Inline=false,
-      LateInline=true);
-  end drhovl_dp;
-
-  function drhol_dp "derivative of density of saturated water w.r.t. pressure"
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "saturation pressure";
-    output Units.SI.DerDensityByPressure dd_dp
-      "derivative of density of water at the boiling point";
-  algorithm
-    dd_dp := ThermoSysPro.Properties.WaterSteam.Region.drhovl_dp(p,
-      ThermoSysPro.Properties.WaterSteam.Region.boilingcurveL3_p(p));
-  end drhol_dp;
-
-  function drhov_dp "derivative of density of saturated steam w.r.t. pressure"
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "saturation pressure";
-    output Units.SI.DerDensityByPressure dd_dp
-      "derivative of density of water at the boiling point";
-  algorithm
-    dd_dp := ThermoSysPro.Properties.WaterSteam.Region.drhovl_dp(p,
-      ThermoSysPro.Properties.WaterSteam.Region.dewcurveL3_p(p));
-  end drhov_dp;
-
-  function drhovl_dp_der
-    "Time derivative of density derivative along phase boundary"
-    extends Modelica.Icons.Function;
-    input Units.SI.Pressure p "saturation pressure";
-    input
-      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
-      bpro "property record";
-    input Real p_der "Time derivative of pressure";
-    output Real dd_dp_der "derivative of density along the phase boundary";
-  algorithm
-    dd_dp_der := 0.0;
-  end drhovl_dp_der;
-  annotation (Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end Region;
+within ThermoSysPro.Properties.WaterSteam;
+package Region
+  function boilingcurveL3_p "properties on the boiling curve"
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "pressure";
+    output
+      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
+      bpro "property record";
+  protected
+    ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
+      "dimensionless Gibbs funcion and dervatives";
+    ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
+      "dimensionless Helmholtz function and dervatives";
+    Units.SI.Pressure plim=min(p, ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
+         - 1e-7) "pressure limited to critical pressure - epsilon";
+    Units.SI.SpecificVolume v "Specific Volume";
+    Real vp3 "vp^3";
+    Real ivp3 "1/vp^3";
+    Real pv "partial derivative of p w.r.t v";
+    Real pv2 "pv^2";
+    Real pv3 "pv^3";
+    Real ptv "2nd partial derivative of p w.r.t t and v";
+    Real pvv "2nd partial derivative of p w.r.t v and v";
+  algorithm
+    g.R := ThermoSysPro.Properties.WaterSteam.BaseIF97.data.RH2O;
+    bpro.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(plim);
+    (bpro.dpT,bpro.dpTT) :=
+      ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.d2ptofT(bpro.T);
+    // need derivative of dpT
+  //  g.Region3boundary := bpro.T > data.TLIMIT1;
+    if not bpro.T > ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TLIMIT1 then
+      g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g1L3(
+                      p, bpro.T);
+      bpro.d := p/(g.R*bpro.T*g.pi*g.gpi);
+      bpro.h := if p > plim then ThermoSysPro.Properties.WaterSteam.BaseIF97.data.HCRIT
+         else g.R*bpro.T*g.tau*g.gtau;
+      bpro.s := g.R*(g.tau*g.gtau - g.g);
+      bpro.cp := -g.R*g.tau*g.tau*g.gtautau;
+      bpro.vt := g.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+      bpro.vp := g.R*bpro.T/(p*p)*g.pi*g.pi*g.gpipi;
+      bpro.pt := -p/bpro.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+      bpro.pd := -g.R*bpro.T*g.gpi*g.gpi/(g.gpipi);
+      bpro.vtt := g.R*g.pi/p*g.tau/bpro.T*g.tau*g.gpitautau;
+      bpro.vtp := g.R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+      bpro.vpp := g.R*bpro.T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+      bpro.cpt := g.R*g.tau*g.tau/bpro.T*(2*g.gtautau + g.tau*g.gtautautau);
+      v := 1/bpro.d;
+      vp3 := bpro.vp*bpro.vp*bpro.vp;
+      ivp3 := 1/vp3;
+      bpro.ptt := -(bpro.vtt*bpro.vp*bpro.vp -2.0*bpro.vt*bpro.vtp*bpro.vp +bpro.vt*bpro.vt*bpro.vpp)*ivp3;
+      bpro.pdd := -bpro.vpp*ivp3*v*v*v*v - 2*v*bpro.pd "= pvv/d^4";
+      bpro.ptd := (bpro.vtp*bpro.vp-bpro.vt*bpro.vpp)*ivp3*v*v "= -ptv/d^2";
+      bpro.cvt := (vp3*bpro.cpt + bpro.vp*bpro.vp*bpro.vt*bpro.vt + 3.0*bpro.vp*bpro.vp*bpro.T*bpro.vt*bpro.vtt
+        - 3.0*bpro.vtp*bpro.vp*bpro.T*bpro.vt*bpro.vt + bpro.T*bpro.vt*bpro.vt*bpro.vt*bpro.vpp)*ivp3;
+    else
+      bpro.d :=
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhol_p_R4b(plim);
+      f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
+                      bpro.d, bpro.T);
+      bpro.h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p_R4b(
+        plim);
+      // g.R*bpro.T*(f.tau*f.ftau + f.delta*f.fdelta);
+      bpro.s := f.R*(f.tau*f.ftau - f.f);
+      bpro.cv := g.R*(-f.tau*f.tau*f.ftautau);
+      bpro.pt := g.R*bpro.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+      bpro.pd := g.R*bpro.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+      pv := (-f.d*f.d*bpro.pd);
+      bpro.vp := 1/pv;
+      bpro.vt := -bpro.pt/pv;
+      bpro.pdd := f.R*bpro.T*f.delta/bpro.d*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
+           f.delta*f.delta*f.fdeltadeltadelta);
+      bpro.ptt := f.R*bpro.d*f.delta*f.tau*f.tau/bpro.T*f.fdeltatautau;
+      bpro.ptd := f.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
+       -f.delta*f.tau*f.fdeltadeltatau);
+      bpro.cvt := f.R*f.tau*f.tau/bpro.T*(2.0*f.ftautau + f.tau*f.ftautautau);
+      bpro.cpt := (bpro.cvt*bpro.pd + bpro.cv*bpro.ptd + (bpro.pt + 2.0*bpro.T*bpro.ptt)*bpro.pt/(bpro.d*bpro.d)
+       - bpro.cp*bpro.ptd)/bpro.pd;
+      pv2 := pv*pv;
+      pv3 := pv2*pv;
+      pvv := bpro.pdd*f.d*f.d*f.d*f.d;
+      ptv := (-f.d*f.d*bpro.ptd);
+      bpro.vpp := -pvv/pv3;
+      bpro.vtt := -(bpro.ptt*pv2 -2.0*bpro.pt*ptv*pv + bpro.pt*bpro.pt*pvv)/pv3;
+      bpro.vtp := (-ptv*pv + bpro.pt*pvv)/pv3;
+    end if;
+  end boilingcurveL3_p;
+
+  function dewcurveL3_p "properties on the dew curve"
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "pressure";
+    output
+      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
+      bpro "property record";
+  protected
+    ThermoSysPro.Properties.WaterSteam.Common.GibbsDerivs3rd g
+      "dimensionless Gibbs funcion and dervatives";
+    ThermoSysPro.Properties.WaterSteam.Common.HelmholtzDerivs3rd f
+      "dimensionless Helmholtz function and dervatives";
+    Units.SI.Pressure plim=min(p, ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
+         - 1e-7) "pressure limited to critical pressure - epsilon";
+    Units.SI.SpecificVolume v "Specific Volume";
+    Real vp3 "vp^3";
+    Real ivp3 "1/vp^3";
+    Real pv "partial derivative of p w.r.t v";
+    Real pv2 "pv^2";
+    Real pv3 "pv^3";
+    Real ptv "2nd partial derivative of p w.r.t t and v";
+    Real pvv "2nd partial derivative of p w.r.t v and v";
+  algorithm
+    bpro.T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(plim);
+    (bpro.dpT,bpro.dpTT) :=
+      ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.d2ptofT(bpro.T);
+    // need derivative of dpT
+  //  bpro.region3boundary := bpro.T > data.TLIMIT1;
+    if not bpro.T > ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TLIMIT1 then
+      g := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.g2L3(
+                      p, bpro.T);
+      bpro.d := p/(g.R*bpro.T*g.pi*g.gpi);
+      bpro.h := if p > plim then ThermoSysPro.Properties.WaterSteam.BaseIF97.data.HCRIT
+         else g.R*bpro.T*g.tau*g.gtau;
+      bpro.s := g.R*(g.tau*g.gtau - g.g);
+      bpro.cp := -g.R*g.tau*g.tau*g.gtautau;
+      bpro.vt := g.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gpitau);
+      bpro.vp := g.R*bpro.T/(p*p)*g.pi*g.pi*g.gpipi;
+      bpro.pt := -p/bpro.T*(g.gpi - g.tau*g.gpitau)/(g.gpipi*g.pi);
+      bpro.pd := -g.R*bpro.T*g.gpi*g.gpi/(g.gpipi);
+      bpro.vtt := g.R*g.pi/p*g.tau/bpro.T*g.tau*g.gpitautau;
+      bpro.vtp := g.R*g.pi*g.pi/(p*p)*(g.gpipi - g.tau*g.gpipitau);
+      bpro.vpp := g.R*bpro.T*g.pi*g.pi*g.pi/(p*p*p)*g.gpipipi;
+      bpro.cpt := g.R*g.tau*g.tau/bpro.T*(2*g.gtautau + g.tau*g.gtautautau);
+      v := 1/bpro.d;
+      vp3 := bpro.vp*bpro.vp*bpro.vp;
+      ivp3 := 1/vp3;
+      bpro.ptt := -(bpro.vtt*bpro.vp*bpro.vp -2.0*bpro.vt*bpro.vtp*bpro.vp +bpro.vt*bpro.vt*bpro.vpp)*ivp3;
+      bpro.pdd := -bpro.vpp*ivp3*v*v*v*v - 2*v*bpro.pd "= pvv/d^4";
+      bpro.ptd := (bpro.vtp*bpro.vp-bpro.vt*bpro.vpp)*ivp3*v*v "= -ptv/d^2";
+      bpro.cvt := (vp3*bpro.cpt + bpro.vp*bpro.vp*bpro.vt*bpro.vt + 3.0*bpro.vp*bpro.vp*bpro.T*bpro.vt*bpro.vtt
+        - 3.0*bpro.vtp*bpro.vp*bpro.T*bpro.vt*bpro.vt + bpro.T*bpro.vt*bpro.vt*bpro.vt*bpro.vpp)*ivp3;
+    else
+      bpro.d :=
+        ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.rhov_p_R4b(plim);
+      f := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.f3L3(
+                      bpro.d, bpro.T);
+      bpro.h := ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p_R4b(
+        plim);
+      // f.R*bpro.T*(f.tau*f.ftau + f.delta*f.fdelta);
+      bpro.s := f.R*(f.tau*f.ftau - f.f);
+      bpro.cv := f.R*(-f.tau*f.tau*f.ftautau);
+      bpro.pt := f.R*bpro.d*f.delta*(f.fdelta - f.tau*f.fdeltatau);
+      bpro.pd := f.R*bpro.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta);
+      pv := (-f.d*f.d*bpro.pd);
+      bpro.vp := 1/pv;
+      bpro.vt := -bpro.pt/pv;
+      bpro.pdd := f.R*bpro.T*f.delta/bpro.d*(2.0*f.fdelta + 4.0*f.delta*f.fdeltadelta +
+           f.delta*f.delta*f.fdeltadeltadelta);
+      bpro.ptt := f.R*bpro.d*f.delta*f.tau*f.tau/bpro.T*f.fdeltatautau;
+      bpro.ptd := f.R*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta - 2.0*f.tau*f.fdeltatau
+    -f.delta*f.tau*f.fdeltadeltatau);
+      bpro.cvt := f.R*f.tau*f.tau/bpro.T*(2.0*f.ftautau + f.tau*f.ftautautau);
+      bpro.cpt := (bpro.cvt*bpro.pd + bpro.cv*bpro.ptd + (bpro.pt + 2.0*bpro.T*bpro.ptt)*bpro.pt/(bpro.d*bpro.d)
+    - bpro.cp*bpro.ptd)/bpro.pd;
+      pv2 := pv*pv;
+      pv3 := pv2*pv;
+      pvv := bpro.pdd*f.d*f.d*f.d*f.d;
+      ptv := (-f.d*f.d*bpro.ptd);
+      bpro.vpp := -pvv/pv3;
+      bpro.vtt := -(bpro.ptt*pv2 -2.0*bpro.pt*ptv*pv + bpro.pt*bpro.pt*pvv)/pv3;
+      bpro.vtp := (-ptv*pv + bpro.pt*pvv)/pv3;
+    end if;
+  end dewcurveL3_p;
+
+  function hvl_dp
+    "derivative function for the specific enthalpy along the phase boundary"
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "pressure";
+    input
+      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
+      bpro "property record";
+    output Real dh_dp
+      "derivative of specific enthalpy along the phase boundary";
+  algorithm
+      dh_dp := (1/bpro.d - bpro.T*bpro.vt) + bpro.cp/bpro.dpT;
+      // dh_dp_der := vp - (T*vpt + dTp*vt) + d/dp(cp/(dp/dT))
+    annotation (
+      derivative(noDerivative=bpro) = hvl_dp_der,
+      Inline=false,
+      LateInline=true);
+  end hvl_dp;
+
+  function hvl_dp_der
+    "derivative function for the specific enthalpy along the phase boundary"
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "pressure";
+    input
+      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
+      bpro "property record";
+    input Real p_der "Pressure derivative";
+    output Real dh_dp_der
+      "Second derivative of specific enthalpy along the phase boundary";
+  protected
+    Real cpp "Derivative of cp w.r.t. p";
+    Real pv "partial derivative of p w.r.t. v";
+    Real pv2 "pv*pv";
+    Real pv3 "pv*pv*pv";
+    Real ptv "2nd partial derivative of p w.r.t t and v";
+    Real pvv "2nd partial derivative of p w.r.t v and v";
+  algorithm
+    pv :=-bpro.d*bpro.d*bpro.pd;
+    pv2 := pv*pv;
+    pv3 := pv2*pv;
+    pvv := bpro.pdd*bpro.d*bpro.d*bpro.d*bpro.d;
+    ptv := (-bpro.d*bpro.d*bpro.ptd);
+    cpp := (bpro.T*(bpro.ptt*pv2 - 2.0*bpro.pt*ptv*pv + bpro.pt*bpro.pt*pvv))/pv3
+      "T*(ptt*pv^2 - 2*pt*ptv*pv + pt^2*pvv)/pv^3";
+    dh_dp_der := 0.0;
+  //   dh_dp_der := 1/pv - (bpro.T*bpro.vtp + bpro.dpT*bpro.vt) +
+  //     cpp/bpro.dpT - bpro.cp*(bpro.dpTT*bpro.dpT)/(bpro.dpT*bpro.dpT);
+  //     //d/dp(cp/(dp/dT))
+
+    annotation (Icon(graphics={Rectangle(
+            extent={{-100,100},{100,-100}},
+            lineColor={255,0,0},
+            lineThickness=0.5)}));
+  end hvl_dp_der;
+
+    function dhl_dp
+    "derivative of liquid specific enthalpy on the boundary between regions 4 and 3 or 1 w.r.t pressure"
+
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "pressure";
+    output Units.SI.DerEnthalpyByPressure dh_dp
+      "specific enthalpy derivative w.r.t. pressure";
+    algorithm
+    dh_dp := ThermoSysPro.Properties.WaterSteam.Region.hvl_dp(p,
+      ThermoSysPro.Properties.WaterSteam.Region.boilingcurveL3_p(p));
+    annotation(smoothOrder=2);
+    end dhl_dp;
+
+  function dhv_dp
+    "derivative of vapour specific enthalpy on the boundary between regions 4 and 3 or 1 w.r.t pressure"
+
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "pressure";
+    output Units.SI.DerEnthalpyByPressure dh_dp
+      "specific enthalpy derivative w.r.t. pressure";
+  algorithm
+    dh_dp := ThermoSysPro.Properties.WaterSteam.Region.hvl_dp(p,
+      ThermoSysPro.Properties.WaterSteam.Region.dewcurveL3_p(p));
+    annotation(smoothOrder=2);
+  end dhv_dp;
+
+  function drhovl_dp
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "saturation pressure";
+    input
+      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
+      bpro "property record";
+    output Real dd_dp(unit="kg/(m3.Pa)")
+      "derivative of density along the phase boundary";
+  algorithm
+    dd_dp := -bpro.d*bpro.d*(bpro.vp + bpro.vt/bpro.dpT);
+    annotation (
+      derivative(noDerivative=bpro) = drhovl_dp_der,
+      Inline=false,
+      LateInline=true);
+  end drhovl_dp;
+
+  function drhol_dp "derivative of density of saturated water w.r.t. pressure"
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "saturation pressure";
+    output Units.SI.DerDensityByPressure dd_dp
+      "derivative of density of water at the boiling point";
+  algorithm
+    dd_dp := ThermoSysPro.Properties.WaterSteam.Region.drhovl_dp(p,
+      ThermoSysPro.Properties.WaterSteam.Region.boilingcurveL3_p(p));
+  end drhol_dp;
+
+  function drhov_dp "derivative of density of saturated steam w.r.t. pressure"
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "saturation pressure";
+    output Units.SI.DerDensityByPressure dd_dp
+      "derivative of density of water at the boiling point";
+  algorithm
+    dd_dp := ThermoSysPro.Properties.WaterSteam.Region.drhovl_dp(p,
+      ThermoSysPro.Properties.WaterSteam.Region.dewcurveL3_p(p));
+  end drhov_dp;
+
+  function drhovl_dp_der
+    "Time derivative of density derivative along phase boundary"
+    extends Modelica.Icons.Function;
+    input Units.SI.Pressure p "saturation pressure";
+    input
+      ThermoSysPro.Properties.WaterSteam.Common.IF97PhaseBoundaryProperties3rd
+      bpro "property record";
+    input Real p_der "Time derivative of pressure";
+    output Real dd_dp_der "derivative of density along the phase boundary";
+  algorithm
+    dd_dp_der := 0.0;
+  end drhovl_dp_der;
+  annotation (Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end Region;
diff --git a/ThermoSysPro/Properties/WaterSteam/package.mo b/ThermoSysPro/Properties/WaterSteam/package.mo
index 69617e7587c31c43d0cf2c3b9b26aae5d9712332..08327dce3c86dd1289b36894a5154fe20f67aba3 100644
--- a/ThermoSysPro/Properties/WaterSteam/package.mo
+++ b/ThermoSysPro/Properties/WaterSteam/package.mo
@@ -1,142 +1,142 @@
-within ThermoSysPro.Properties;
-package WaterSteam "1 - Water/steam properties library (IAPWS-IF97)"
-
-
-  replaceable package IF97 =
-      ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ;
-
-annotation (
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Documentation(info="<html>
-<p><b>ThermoSysPro Version 1.2</b> </p>
-<p>This library implements the IAPWS-IF97 standard for the thermodynamic properties of water and steam.</h4>
-</html>"));
-end WaterSteam;
+within ThermoSysPro.Properties;
+package WaterSteam "1 - Water/steam properties library (IAPWS-IF97)"
+
+
+  replaceable package IF97 =
+      ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ;
+
+annotation (
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Documentation(info="<html>
+<p><b>ThermoSysPro Version 1.2</b> </p>
+<p>This library implements the IAPWS-IF97 standard for the thermodynamic properties of water and steam.</h4>
+</html>"));
+end WaterSteam;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1Td_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1Td_dT.mo
index 2bf9adee8971babdae66cc7ce489c6243b3c0b43..917c9653380859dbdb4f508dc48ed297893af7c3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1Td_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1Td_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function dlambda1Td_dT
-  "Derivative of conductivity wrt. specific enthalpy at constant pressure in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dlambdaTd
-    "Derivative of conductivity wrt. temperature at constant density";
-protected
-  lambda1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dlambdaTd :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    d,
-    T);
-
-end dlambda1Td_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function dlambda1Td_dT
+  "Derivative of conductivity wrt. specific enthalpy at constant pressure in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dlambdaTd
+    "Derivative of conductivity wrt. temperature at constant density";
+protected
+  lambda1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dlambdaTd :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    d,
+    T);
+
+end dlambda1Td_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1dT_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1dT_dT.mo
index 83138ad0eb0fa742147ef30f7476fab9270f9fdb..5f28978fdf8132a4a145e5ae6b3b6176ed8eccb9 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1dT_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1dT_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function dlambda1dT_dT
-  "Derivative of conductivity wrt. pressure at constant specific enthalpy in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dlambdadT
-    "Derivative of conductivity wrt. density at constant temperature";
-protected
-  lambda1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dlambdadT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    d,
-    T);
-
-end dlambda1dT_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function dlambda1dT_dT
+  "Derivative of conductivity wrt. pressure at constant specific enthalpy in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dlambdadT
+    "Derivative of conductivity wrt. density at constant temperature";
+protected
+  lambda1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dlambdadT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    d,
+    T);
+
+end dlambda1dT_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1hp_Ph.mo
index 407b79558ded6f81a8994dd3763aedc47d29fd13..2f76499d65bc582db53f106d4f489d1f5ade3f44 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function dlambda1hp_Ph
-  "Derivative of conductivity wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dlambdahp
-    "Derivative of conductivity wrt. specific enthalpy at constant pressure";
-protected
-  lambda1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dlambdahp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    p,
-    h);
-
-end dlambda1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function dlambda1hp_Ph
+  "Derivative of conductivity wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dlambdahp
+    "Derivative of conductivity wrt. specific enthalpy at constant pressure";
+protected
+  lambda1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dlambdahp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    p,
+    h);
+
+end dlambda1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1ph_Ph.mo
index ba34442965a7e9988f9b3405b8543a67def935b7..a526d2ec46f321c070a30f719643485c460b2675 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda1ph_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function dlambda1ph_Ph
-  "Derivative of conductivity wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dlambdaph
-    "Derivative of conductivity wrt. pressure at constant specific enthalpy";
-protected
-  lambda1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dlambdaph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    p,
-    h);
-
-end dlambda1ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function dlambda1ph_Ph
+  "Derivative of conductivity wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dlambdaph
+    "Derivative of conductivity wrt. pressure at constant specific enthalpy";
+protected
+  lambda1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dlambdaph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    p,
+    h);
+
+end dlambda1ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2Td_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2Td_dT.mo
index 68f257d690effcd84ab2997d4424e54ea3bf9180..2241b1fb7c6c183a83c810d7893bedbe51b128db 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2Td_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2Td_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function dlambda2Td_dT
-  "Derivative of conductivity wrt. specific enthalpy at constant pressure in vapor region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dlambdaTd
-    "Derivative of conductivity wrt.  temperature at constant density";
-protected
-  lambda2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dlambdaTd :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    d,
-    T);
-
-end dlambda2Td_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function dlambda2Td_dT
+  "Derivative of conductivity wrt. specific enthalpy at constant pressure in vapor region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dlambdaTd
+    "Derivative of conductivity wrt.  temperature at constant density";
+protected
+  lambda2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dlambdaTd :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    d,
+    T);
+
+end dlambda2Td_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2dT_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2dT_dT.mo
index ae1d01579638802f5a3c45a3b5b83856a93e57e0..19531cd52d34f55e309b66fcf32e30cde38cad61 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2dT_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2dT_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function dlambda2dT_dT
-  "Derivative of conductivity wrt. pressure at constant specific enthalpy in vapor region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dlambdadT
-    "Derivative of conductivity wrt. density at constant temperature";
-protected
-  lambda2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dlambdadT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    d,
-    T);
-
-end dlambda2dT_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function dlambda2dT_dT
+  "Derivative of conductivity wrt. pressure at constant specific enthalpy in vapor region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dlambdadT
+    "Derivative of conductivity wrt. density at constant temperature";
+protected
+  lambda2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dlambdadT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    d,
+    T);
+
+end dlambda2dT_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2hp_Ph.mo
index 9faf572378d87a2e5d873514df929c784c6125a6..3600d4e148d683e43ec504b001d48c8c42006678 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function dlambda2hp_Ph
-  "Derivative of conductivity wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dlambdahp
-    "Derivative of conductivity wrt. specific enthalpy at constant pressure";
-protected
-  lambda2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dlambdahp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    p,
-    h);
-
-end dlambda2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function dlambda2hp_Ph
+  "Derivative of conductivity wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dlambdahp
+    "Derivative of conductivity wrt. specific enthalpy at constant pressure";
+protected
+  lambda2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dlambdahp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    p,
+    h);
+
+end dlambda2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2ph_Ph.mo
index be0e5644e0148584d32a60c5b0cdc05932b5e75e..ebaf501f663b7505ac06a3460bd2d913c7cb42d4 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/dlambda2ph_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function dlambda2ph_Ph
-  "Derivative of conductivity wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dlambdaph
-    "Derivative of conductivity wrt. pressure at constant specific enthalpy";
-protected
-  lambda2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dlambdaph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    p,
-    h);
-
-end dlambda2ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function dlambda2ph_Ph
+  "Derivative of conductivity wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dlambdaph
+    "Derivative of conductivity wrt. pressure at constant specific enthalpy";
+protected
+  lambda2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dlambdaph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    p,
+    h);
+
+end dlambda2ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_Ph.mo
index d75bbbb3d65b4d3dee4001c8ec926b555407f606..2426766e710f03f97a0dbfcf373731593e2600ac 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function lambda1_Ph
-  "Conductivity in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
-protected
-  lambda1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  lambda :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    h);
-
-end lambda1_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function lambda1_Ph
+  "Conductivity in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
+protected
+  lambda1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  lambda :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    h);
+
+end lambda1_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_Ph_coef.mo
index aeed501de8a8cb03ac145f3a861eb5b7d90584a5..0471e07dbf216b34cfb2726f8ed0d85b74281606 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_Ph_coef.mo
@@ -1,30 +1,30 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-record lambda1_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=5.452677e-01,
-    c10=-6.984453e-11,
-    c01=5.724819e-07,
-    c20=-8.605931e-19,
-    c11=1.529135e-15,
-    c02=-9.436446e-13,
-    c30=3.467945e-28,
-    c21=1.728908e-24,
-    c12=-1.087772e-21,
-    c03=7.614081e-19,
-    c40=5.673171e-35,
-    c31=-3.281411e-32,
-    c22=3.121527e-30,
-    c13=4.133284e-28,
-    c04=-3.767334e-25,
-    c50=-3.225145e-46,
-    c41=-1.691485e-40,
-    c32=6.735025e-38,
-    c23=-8.798974e-36,
-    c14=3.762968e-34,
-    c05=6.501393e-32);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end lambda1_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+record lambda1_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=5.452677e-01,
+    c10=-6.984453e-11,
+    c01=5.724819e-07,
+    c20=-8.605931e-19,
+    c11=1.529135e-15,
+    c02=-9.436446e-13,
+    c30=3.467945e-28,
+    c21=1.728908e-24,
+    c12=-1.087772e-21,
+    c03=7.614081e-19,
+    c40=5.673171e-35,
+    c31=-3.281411e-32,
+    c22=3.121527e-30,
+    c13=4.133284e-28,
+    c04=-3.767334e-25,
+    c50=-3.225145e-46,
+    c41=-1.691485e-40,
+    c32=6.735025e-38,
+    c23=-8.798974e-36,
+    c14=3.762968e-34,
+    c05=6.501393e-32);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end lambda1_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_dT.mo
index ce8a3f10464db6a20633e42de40cc9b80a40aa47..a141c194c78c4e539dd3f94bd8b587864fc88dc1 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_dT.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function lambda1_dT
-  "Conductivity in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
-protected
-  lambda1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  lambda :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    d,
-    T);
-
-end lambda1_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function lambda1_dT
+  "Conductivity in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
+protected
+  lambda1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  lambda :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    d,
+    T);
+
+end lambda1_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_dT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_dT_coef.mo
index d90bb30d2ff96399e43c531bdeef159cb9318b27..9b10b3d61ed5c9b0350f8ca14f89842de0f6bcb8 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_dT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda1_dT_coef.mo
@@ -1,30 +1,30 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-record lambda1_dT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=5.205361e+03,
-    c10=-1.772777e+01,
-    c01=-1.564808e+01,
-    c20=2.329584e-02,
-    c11=4.996610e-02,
-    c02=9.785300e-03,
-    c30=-1.527146e-05,
-    c21=-5.470372e-05,
-    c12=-3.927909e-05,
-    c03=1.027220e-05,
-    c40=5.321984e-09,
-    c31=2.481199e-08,
-    c22=3.743489e-08,
-    c13=6.013180e-10,
-    c04=-1.296152e-08,
-    c50=-8.543528e-13,
-    c41=-4.008923e-12,
-    c32=-1.016585e-11,
-    c23=-5.064400e-12,
-    c14=5.631431e-12,
-    c05=3.515174e-12);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end lambda1_dT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+record lambda1_dT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=5.205361e+03,
+    c10=-1.772777e+01,
+    c01=-1.564808e+01,
+    c20=2.329584e-02,
+    c11=4.996610e-02,
+    c02=9.785300e-03,
+    c30=-1.527146e-05,
+    c21=-5.470372e-05,
+    c12=-3.927909e-05,
+    c03=1.027220e-05,
+    c40=5.321984e-09,
+    c31=2.481199e-08,
+    c22=3.743489e-08,
+    c13=6.013180e-10,
+    c04=-1.296152e-08,
+    c50=-8.543528e-13,
+    c41=-4.008923e-12,
+    c32=-1.016585e-11,
+    c23=-5.064400e-12,
+    c14=5.631431e-12,
+    c05=3.515174e-12);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end lambda1_dT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_Ph.mo
index aadd2b83726dd9cdfa069dea0ebfef01273b2344..6357dcc11e733ec7a8aaaea08b5cd95539d852f9 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function lambda2_Ph
-  "Conductivity in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
-protected
-  lambda2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  lambda :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    p,
-    h);
-
-end lambda2_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function lambda2_Ph
+  "Conductivity in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
+protected
+  lambda2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  lambda :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    p,
+    h);
+
+end lambda2_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_Ph_coef.mo
index f0f76d24178571ffc9c144e5a14ddd08460ded36..779b2a873e07f1844d036a7c0f1531fb7ebb5d63 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_Ph_coef.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-record lambda2_Ph_coef
-  extends Modelica.Icons.Record;
-
-   extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=4.685560e-01,
-    c10=1.002884e-08,
-    c01=-3.807181e-07,
-    c20=-1.441261e-17,
-    c11=-3.045428e-15,
-    c02=1.024663e-13,
-    c30=-5.492118e-26,
-    c21=4.957386e-24,
-    c12=2.051417e-22,
-    c03=-7.708932e-21);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end lambda2_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+record lambda2_Ph_coef
+  extends Modelica.Icons.Record;
+
+   extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=4.685560e-01,
+    c10=1.002884e-08,
+    c01=-3.807181e-07,
+    c20=-1.441261e-17,
+    c11=-3.045428e-15,
+    c02=1.024663e-13,
+    c30=-5.492118e-26,
+    c21=4.957386e-24,
+    c12=2.051417e-22,
+    c03=-7.708932e-21);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end lambda2_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_dT.mo
index 911815f2ee6b8b24116aad127595fb7768e7314c..fb19c55abf1b767b8ad0cb8eb4774df794953d7d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_dT.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-function lambda2_dT
-  "Conductivity in vapor region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
-protected
-  lambda2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  lambda :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    d,
-    T);
-
-end lambda2_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+function lambda2_dT
+  "Conductivity in vapor region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
+protected
+  lambda2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  lambda :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    d,
+    T);
+
+end lambda2_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_dT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_dT_coef.mo
index 7c7326c1c3841473f86899d0642ddbb586e58590..5845d6d2befe5d4be6f11fad35444c5d1e784361 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_dT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/lambda2_dT_coef.mo
@@ -1,30 +1,30 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
-record lambda2_dT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=1.972922e-02,
-    c10=5.074409e-03,
-    c01=-8.056885e-05,
-    c20=-7.940187e-06,
-    c11=-1.746871e-05,
-    c02=3.351452e-07,
-    c30=6.366310e-09,
-    c21=2.130434e-08,
-    c12=2.262123e-08,
-    c03=-2.777033e-10,
-    c40=-2.696194e-12,
-    c31=-1.132599e-11,
-    c22=-1.496962e-11,
-    c13=-1.236448e-11,
-    c04=1.220489e-13,
-    c50=-2.635185e-15,
-    c41=1.145604e-14,
-    c32=-3.134673e-15,
-    c23=4.288593e-15,
-    c14=2.343478e-15,
-    c05=-2.147268e-17);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end lambda2_dT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Conductivity;
+record lambda2_dT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=1.972922e-02,
+    c10=5.074409e-03,
+    c01=-8.056885e-05,
+    c20=-7.940187e-06,
+    c11=-1.746871e-05,
+    c02=3.351452e-07,
+    c30=6.366310e-09,
+    c21=2.130434e-08,
+    c12=2.262123e-08,
+    c03=-2.777033e-10,
+    c40=-2.696194e-12,
+    c31=-1.132599e-11,
+    c22=-1.496962e-11,
+    c13=-1.236448e-11,
+    c04=1.220489e-13,
+    c50=-2.635185e-15,
+    c41=1.145604e-14,
+    c32=-3.134673e-15,
+    c23=4.288593e-15,
+    c14=2.343478e-15,
+    c05=-2.147268e-17);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end lambda2_dT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/package.mo
index e474ac2c1eea76fb8bcc16c702beae5e31f2b5c8..1b8dfd4af9b0bc8f8797b929adc41fd5fafdfa7f 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Conductivity "Polynomials of conductivity"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>SurfaceTension</b> contains polynomial functions to compute surface tension. </span></p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Conductivity;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Conductivity "Polynomials of conductivity"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>SurfaceTension</b> contains polynomial functions to compute surface tension. </span></p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Conductivity;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/package.order
index f417f5d56b1f9706abc8934e287961a03393ee45..4c7af3e2352840a9b9670b80485aeed323a5d984 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Conductivity/package.order
@@ -1,16 +1,16 @@
-lambda1_Ph_coef
-lambda1_Ph
-dlambda1ph_Ph
-dlambda1hp_Ph
-lambda2_Ph_coef
-lambda2_Ph
-dlambda2ph_Ph
-dlambda2hp_Ph
-lambda1_dT_coef
-lambda1_dT
-dlambda1dT_dT
-dlambda1Td_dT
-lambda2_dT_coef
-lambda2_dT
-dlambda2dT_dT
-dlambda2Td_dT
+lambda1_Ph_coef
+lambda1_Ph
+dlambda1ph_Ph
+dlambda1hp_Ph
+lambda2_Ph_coef
+lambda2_Ph
+dlambda2ph_Ph
+dlambda2hp_Ph
+lambda1_dT_coef
+lambda1_dT
+dlambda1dT_dT
+dlambda1Td_dT
+lambda2_dT_coef
+lambda2_dT
+dlambda2dT_dT
+dlambda2Td_dT
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_PT.mo
index ab2ce010861a811b76c0f2135f2e44f8ce6d4ab6..d05193b0ddb2a304c4763ad577481477b27d599a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_PT.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d1_PT "Density in liquid region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.Density d "Density";
-protected
-  d1_PT_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    T);
-
-end d1_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d1_PT "Density in liquid region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.Density d "Density";
+protected
+  d1_PT_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    T);
+
+end d1_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_PT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_PT_coef.mo
index 260f576aad15b4c20e732f621b9c422caa4c68ad..c4069adb19de9e6d2e866a4030a28ab418d4e58f 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_PT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_PT_coef.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-record d1_PT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=-1.829480e+03,
-    c10=3.054319e-05,
-    c01=2.781477e+01,
-    c20=3.828328e-14,
-    c11=-3.043374e-07,
-    c02=-9.811186e-02,
-    c30=8.084907e-22,
-    c21=-6.519321e-16,
-    c12=1.176861e-09,
-    c03=1.443719e-04,
-    c40=-6.330092e-32,
-    c31=-4.041731e-24,
-    c22=2.507897e-18,
-    c13=-2.063206e-12,
-    c04=-6.651181e-08,
-    c50=-3.239489e-39,
-    c41=1.530767e-33,
-    c32=4.801971e-27,
-    c23=-2.757629e-21,
-    c14=1.380801e-15,
-    c05=-1.948287e-11);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end d1_PT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+record d1_PT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=-1.829480e+03,
+    c10=3.054319e-05,
+    c01=2.781477e+01,
+    c20=3.828328e-14,
+    c11=-3.043374e-07,
+    c02=-9.811186e-02,
+    c30=8.084907e-22,
+    c21=-6.519321e-16,
+    c12=1.176861e-09,
+    c03=1.443719e-04,
+    c40=-6.330092e-32,
+    c31=-4.041731e-24,
+    c22=2.507897e-18,
+    c13=-2.063206e-12,
+    c04=-6.651181e-08,
+    c50=-3.239489e-39,
+    c41=1.530767e-33,
+    c32=4.801971e-27,
+    c23=-2.757629e-21,
+    c14=1.380801e-15,
+    c05=-1.948287e-11);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end d1_PT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ph.mo
index 7ef5331ff17e76851db676058780b1b3d0429d70..07a2b60108dccbc108c4292d082ddd459f8d6d7c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d1_Ph
-  "Density in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.Density d "Density";
-protected
-  d1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    p,
-    h);
-
-end d1_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d1_Ph
+  "Density in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.Density d "Density";
+protected
+  d1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    p,
+    h);
+
+end d1_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ph_coef.mo
index d371689cf44ac02fad47a9c3b11b94d5c79a52cd..414c9f475fd0e36a0cdfa5390e84aa81c53902b7 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ph_coef.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-record d1_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=1.005457e+03,
-    c10=4.112059e-07,
-    c01=-7.025326e-05,
-    c20=-1.685565e-15,
-    c11=6.942597e-13,
-    c02=-1.146613e-10);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end d1_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+record d1_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=1.005457e+03,
+    c10=4.112059e-07,
+    c01=-7.025326e-05,
+    c20=-1.685565e-15,
+    c11=6.942597e-13,
+    c02=-1.146613e-10);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end d1_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ps.mo
index ee58e701b84938ae222fe5543883faa32887ef64..af6b0a4556fc8eec362fda6b9c978f8cbac49c5f 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ps.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d1_Ps
-  "Density in liquid region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Units.SI.Density d "Density";
-protected
-  d1_Ps_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    p,
-    s);
-
-end d1_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d1_Ps
+  "Density in liquid region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Units.SI.Density d "Density";
+protected
+  d1_Ps_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    p,
+    s);
+
+end d1_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ps_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ps_coef.mo
index 337e9a0617dde0afd70b3cd1d667c0fda5f35ad8..e9f6b4de87fd6ba70da716fe3ec85b8850be6609 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ps_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1_Ps_coef.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-record d1_Ps_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=9.980313e+02,
-    c10=3.263070e-07,
-    c01=6.573635e-03,
-    c20=-4.169014e-16,
-    c11=9.483072e-11,
-    c02=-2.791938e-05);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end d1_Ps_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+record d1_Ps_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=9.980313e+02,
+    c10=3.263070e-07,
+    c01=6.573635e-03,
+    c20=-4.169014e-16,
+    c11=9.483072e-11,
+    c02=-2.791938e-05);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end d1_Ps_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1sat_T.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1sat_T.mo
index 05b01e48166be2f4088e28cb549f006bc04011bf..b2abdb14a3840b0ae34ac5c1274555019eed63d6 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1sat_T.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1sat_T.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d1sat_T "density at liquid saturation for given temperature"
-
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.Density d "density";
-protected
-  d1sat_T_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(coef, T);
-
-end d1sat_T;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d1sat_T "density at liquid saturation for given temperature"
+
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.Density d "density";
+protected
+  d1sat_T_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(coef, T);
+
+end d1sat_T;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1sat_T_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1sat_T_coef.mo
index 65ebc80edb1738c66148821f3ac3f152bca37d21..6dd6943f4fa1d67af1fb0bc1a82073bec2f17831 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d1sat_T_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d1sat_T_coef.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-record d1sat_T_coef
-  extends Modelica.Icons.Record;
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
-      c0=5.42712985E+03,
-      c1=-7.25236552E+01,
-      c2=4.33707300E-01,
-      c3=-1.21145352E-03,
-      c4=1.60102374E-06,
-      c5=-8.12916005E-10);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end d1sat_T_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+record d1sat_T_coef
+  extends Modelica.Icons.Record;
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
+      c0=5.42712985E+03,
+      c1=-7.25236552E+01,
+      c2=4.33707300E-01,
+      c3=-1.21145352E-03,
+      c4=1.60102374E-06,
+      c5=-8.12916005E-10);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end d1sat_T_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_PT.mo
index cccf3107080f9f913ab0efa24a87af616909f3cb..28c736b4a1725614ac230618dc66ec77553a4848 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_PT.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2_PT "Density in vapor region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.Density d "Density";
-protected
-  d1_PT_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    p,
-    T);
-
-end d2_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2_PT "Density in vapor region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.Density d "Density";
+protected
+  d1_PT_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    p,
+    T);
+
+end d2_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_PT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_PT_coef.mo
index c6daa08f698cdfa51fb2b73a10a0c71944905ce2..86e370ebdbdbdb1d5ae789eaa97f804b9d318f4b 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_PT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_PT_coef.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-record d2_PT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=8.573340e+01,
-    c10=2.032089e-05,
-    c01=-3.131904e-01,
-    c20=9.742006e-15,
-    c11=-2.602836e-08,
-    c02=3.165324e-04,
-    c30=-1.477236e-22,
-    c21=7.411890e-18,
-    c12=8.461200e-12,
-    c03=-9.503033e-08);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end d2_PT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+record d2_PT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=8.573340e+01,
+    c10=2.032089e-05,
+    c01=-3.131904e-01,
+    c20=9.742006e-15,
+    c11=-2.602836e-08,
+    c02=3.165324e-04,
+    c30=-1.477236e-22,
+    c21=7.411890e-18,
+    c12=8.461200e-12,
+    c03=-9.503033e-08);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end d2_PT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ph.mo
index b6ac13acc3c5a829fca6e0336d4672d1ebea4abe..c16415271b9c4edf868b24a348c1b68052fb900c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2_Ph
-  "Density in steam region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.Density d "Density";
-protected
-  d2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    h);
-
-end d2_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2_Ph
+  "Density in steam region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.Density d "Density";
+protected
+  d2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    h);
+
+end d2_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ph_coef.mo
index 9c76f835ca6578c9ff0d02992febdbbf96ba09c3..1957604bf9f6a9c3c679bde88b01be8465a55987 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ph_coef.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-record d2_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=2938,
-    c10=4.925e-05,
-    c01=-0.003494,
-    c20=-3.152e-13,
-    c11=-2.816e-11,
-    c02=1.626e-09,
-    c30=-3.393e-21,
-    c21=2.994e-19,
-    c12=4.719e-18,
-    c03=-3.697e-16,
-    c40=3.707e-29,
-    c31=-7.735e-29,
-    c22=-6.358e-26,
-    c13=-1.101e-25,
-    c04=4.114e-23,
-    c50=-1.176e-37,
-    c41=-1.311e-36,
-    c32=3.631e-35,
-    c23=4.188e-33,
-    c14=-2.086e-32,
-    c05=-1.796e-30);
-
-     annotation (Icon(graphics,
-                      coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end d2_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+record d2_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=2938,
+    c10=4.925e-05,
+    c01=-0.003494,
+    c20=-3.152e-13,
+    c11=-2.816e-11,
+    c02=1.626e-09,
+    c30=-3.393e-21,
+    c21=2.994e-19,
+    c12=4.719e-18,
+    c03=-3.697e-16,
+    c40=3.707e-29,
+    c31=-7.735e-29,
+    c22=-6.358e-26,
+    c13=-1.101e-25,
+    c04=4.114e-23,
+    c50=-1.176e-37,
+    c41=-1.311e-36,
+    c32=3.631e-35,
+    c23=4.188e-33,
+    c14=-2.086e-32,
+    c05=-1.796e-30);
+
+     annotation (Icon(graphics,
+                      coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end d2_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ps.mo
index aba8e184ce3763928a0dffa284509562bcb22319..9d5073df55b641bcca1cca04be7c7fdfb865ed74 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ps.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2_Ps
-  "Density in liquid region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Units.SI.Density d "Density";
-protected
-  d2_Ps_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
-    s);
-
-end d2_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2_Ps
+  "Density in liquid region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Units.SI.Density d "Density";
+protected
+  d2_Ps_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
+    s);
+
+end d2_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ps_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ps_coef.mo
index e9e64d87aef76762a708d93f3a298d27f9c1a644..f948d975c1180b0ca07bc784b64b3decc8d14be4 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ps_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2_Ps_coef.mo
@@ -1,25 +1,25 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-record d2_Ps_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=-1.166923e+03,
-    c10=-2.232163e+02,
-    c01=5.607440e-01,
-    c20=8.114333e+01,
-    c11=-4.192922e-03,
-    c02=-8.206701e-05,
-    c30=-1.000655e+01,
-    c21=-3.733483e-03,
-    c12=2.577362e-06,
-    c03=4.905100e-09,
-    c40=8.072126e-01,
-    c31=-4.421570e-04,
-    c22=4.654613e-07,
-    c13=-2.235287e-10,
-    c04=-9.381426e-14);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end d2_Ps_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+record d2_Ps_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=-1.166923e+03,
+    c10=-2.232163e+02,
+    c01=5.607440e-01,
+    c20=8.114333e+01,
+    c11=-4.192922e-03,
+    c02=-8.206701e-05,
+    c30=-1.000655e+01,
+    c21=-3.733483e-03,
+    c12=2.577362e-06,
+    c03=4.905100e-09,
+    c40=8.072126e-01,
+    c31=-4.421570e-04,
+    c22=4.654613e-07,
+    c13=-2.235287e-10,
+    c04=-9.381426e-14);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end d2_Ps_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1hh_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1hh_Ph.mo
index 37e760c1c9b671a27ccb6fb15f71fb00a21525ab..c7692e500d082ef7ed1905476b32d836778bdf29 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1hh_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1hh_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2d1hh_Ph
-  "Second derivative of density wrt. enthalpy in liquid region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real d2dhh;
-protected
-  d1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2dhh :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_yy(
-    coef,
-    p,
-    h);
-
-end d2d1hh_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2d1hh_Ph
+  "Second derivative of density wrt. enthalpy in liquid region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real d2dhh;
+protected
+  d1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2dhh :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_yy(
+    coef,
+    p,
+    h);
+
+end d2d1hh_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1hp_Ph.mo
index 97a1b320d2591d88e5a697507b18c140220a495b..e2e3e90cc1f0b07cb4c52174ee7d55a0babedd7d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2d1hp_Ph
-  "Second derivative of density wrt. enthalpy and pressure in liquid region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
- output Real d2dhp;
-
-protected
-  d1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2dhp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xy(
-    coef,
-    p,
-    h);
-
-end d2d1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2d1hp_Ph
+  "Second derivative of density wrt. enthalpy and pressure in liquid region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+ output Real d2dhp;
+
+protected
+  d1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2dhp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xy(
+    coef,
+    p,
+    h);
+
+end d2d1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1pp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1pp_Ph.mo
index 9ac3ef9507a0a71114f46cc4463fbfbb663295b3..00c2549b1fe58916f78a47a45e718321075b18fe 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1pp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d1pp_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2d1pp_Ph
-  "Second derivative of density wrt. pressure in liquid region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real d2dpp;
-protected
-  d1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2dpp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xx(
-    coef,
-    p,
-    h);
-
-end d2d1pp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2d1pp_Ph
+  "Second derivative of density wrt. pressure in liquid region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real d2dpp;
+protected
+  d1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2dpp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xx(
+    coef,
+    p,
+    h);
+
+end d2d1pp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2hh_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2hh_Ph.mo
index 5c44fa14fb8cf87a661c404d1878e3eab070e95e..04e51a77a798ee366cf095edcb062c331942ed0a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2hh_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2hh_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2d2hh_Ph
-  "Second derivative of density wrt. enthalpy in vapor region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real d2dhh;
-protected
-  d2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2dhh :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative2_yy(
-    coef,
-    p,
-    h);
-
-end d2d2hh_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2d2hh_Ph
+  "Second derivative of density wrt. enthalpy in vapor region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real d2dhh;
+protected
+  d2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2dhh :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative2_yy(
+    coef,
+    p,
+    h);
+
+end d2d2hh_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2hp_Ph.mo
index c78ae7d0b43cee6a783674d2f7d9816c89a31b2c..b2edf8d6dd4c3d55e79ac7f0ec945457440899d7 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2d2hp_Ph
-  "Second derivative of density wrt. enthalpy and pressure in vapor region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
- output Real d2dhp;
-
-protected
-  d2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2dhp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative2_xy(
-    coef,
-    p,
-    h);
-
-end d2d2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2d2hp_Ph
+  "Second derivative of density wrt. enthalpy and pressure in vapor region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+ output Real d2dhp;
+
+protected
+  d2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2dhp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative2_xy(
+    coef,
+    p,
+    h);
+
+end d2d2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2pp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2pp_Ph.mo
index 7774c00f64b2b0846c6c502c22d18365efb1c4eb..9da8d39e0fdd7e634b8fdc99ea91b114a6ed7e80 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2pp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2d2pp_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2d2pp_Ph
-  "Second derivative of density wrt. pressure in vapor region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real d2dpp;
-protected
-  d2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2dpp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative2_xx(
-    coef,
-    p,
-    h);
-
-end d2d2pp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2d2pp_Ph
+  "Second derivative of density wrt. pressure in vapor region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real d2dpp;
+protected
+  d2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2dpp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative2_xx(
+    coef,
+    p,
+    h);
+
+end d2d2pp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2sat_T.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2sat_T.mo
index 8d2a3465472adaa284e3abe6c129a55314df654a..e3060fbd3adf104ced3d6f8990c5bab5c5c4400e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2sat_T.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2sat_T.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function d2sat_T "density at vapor saturation for given temperature"
-
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.Density d "density";
-protected
-  d2sat_T_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-  d := 10^(ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(coef, T));
-
-end d2sat_T;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function d2sat_T "density at vapor saturation for given temperature"
+
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.Density d "density";
+protected
+  d2sat_T_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+  d := 10^(ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(coef, T));
+
+end d2sat_T;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2sat_T_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2sat_T_coef.mo
index 401eed1001e1ed9b85980ca440baba2fb1ad9a9d..a4f61f1ad54876359118416108cbb9ba2fa1259e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/d2sat_T_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/d2sat_T_coef.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-record d2sat_T_coef
-  extends Modelica.Icons.Record;
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
-        c0=-1.83956723E+01,
-        c1=9.80585592E-02,
-        c2=-1.73543962E-04,
-        c3=1.10814001E-07);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end d2sat_T_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+record d2sat_T_coef
+  extends Modelica.Icons.Record;
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
+        c0=-1.83956723E+01,
+        c1=9.80585592E-02,
+        c2=-1.73543962E-04,
+        c3=1.10814001E-07);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end d2sat_T_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1Tp_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1Tp_PT.mo
index b8b7eeaf0ef8d1c2f7c4892acd10b4332e5ab475..e2dac7bea4a97f29e05b79adeb04fffc76e3da12 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1Tp_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1Tp_PT.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd1Tp_PT
-  "Derivative of density wrt. temperature at constant pressure in liquid region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "temperature";
-  output Units.SI.DerDensityByTemperature ddTp
-    "Derivative of density wrt. temperature at constant pressure";
-protected
-  d1_PT_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddTp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    p,
-    T);
-
-end dd1Tp_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd1Tp_PT
+  "Derivative of density wrt. temperature at constant pressure in liquid region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "temperature";
+  output Units.SI.DerDensityByTemperature ddTp
+    "Derivative of density wrt. temperature at constant pressure";
+protected
+  d1_PT_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddTp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    p,
+    T);
+
+end dd1Tp_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1hp_Ph.mo
index 2f56235d1347f76c744e69ee30518b8d6f057c35..475219ddfc85c9634784cbecaba0abc2daa84eb3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1hp_Ph.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd1hp_Ph
-  "Derivative of density wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.DerDensityByEnthalpy ddhp
-    "Derivative of density wrt. specific enthalpy at constant pressure";
-protected
-  d1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddhp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    p,
-    h);
-
-end dd1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd1hp_Ph
+  "Derivative of density wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.DerDensityByEnthalpy ddhp
+    "Derivative of density wrt. specific enthalpy at constant pressure";
+protected
+  d1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddhp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    p,
+    h);
+
+end dd1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1pT_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1pT_PT.mo
index 77363db81fa47019757af395ace3c028fd4a2b10..c362d3791e528829b315bdec838b85d958a867eb 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1pT_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1pT_PT.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd1pT_PT
-  "Derivative of density wrt. pressure at constant temperature in liquid region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "temperature";
-  output Units.SI.DerDensityByPressure ddpT
-    "Derivative of density wrt. pressure at constant specific entropy";
-protected
-  d1_PT_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddpT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    p,
-    T);
-
-end dd1pT_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd1pT_PT
+  "Derivative of density wrt. pressure at constant temperature in liquid region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "temperature";
+  output Units.SI.DerDensityByPressure ddpT
+    "Derivative of density wrt. pressure at constant specific entropy";
+protected
+  d1_PT_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddpT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    p,
+    T);
+
+end dd1pT_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1ph_Ph.mo
index 463c5d64f86eda38eb22bfb2ac373b6446814cbe..0f061590b3c83f7dc2d3635f63acf06bbe51efd9 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1ph_Ph.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd1ph_Ph
-  "Derivative of density wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.DerDensityByPressure ddph
-    "Derivative of density wrt. pressure at constant specific enthalpy";
-protected
-  d1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    p,
-    h);
-
-end dd1ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd1ph_Ph
+  "Derivative of density wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.DerDensityByPressure ddph
+    "Derivative of density wrt. pressure at constant specific enthalpy";
+protected
+  d1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    p,
+    h);
+
+end dd1ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1ps_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1ps_Ps.mo
index 2f4732d318eb0b5cb8ad0bf91f3a22377b1a7c04..2efb0b0b70b1839fdf2f1a07095f4bbfd0ae1a5e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1ps_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1ps_Ps.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd1ps_Ps
-  "Derivative of density wrt. pressure at constant specific entropy in liquid region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Units.SI.DerDensityByPressure ddps
-    "Derivative of density wrt. pressure at constant specific entropy";
-protected
-  d1_Ps_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddps :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    p,
-    s);
-
-end dd1ps_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd1ps_Ps
+  "Derivative of density wrt. pressure at constant specific entropy in liquid region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Units.SI.DerDensityByPressure ddps
+    "Derivative of density wrt. pressure at constant specific entropy";
+protected
+  d1_Ps_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddps :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    p,
+    s);
+
+end dd1ps_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1sp_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1sp_Ps.mo
index 849ecf5daa55a645fb0b2736caaa012e74c872ed..61f5f9e3469451b81ca04eddb36474a10d05673d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1sp_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd1sp_Ps.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd1sp_Ps
-  "Derivative of density wrt. specific entropy at constant pressure in liquid region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output ThermoSysPro.Units.xSI.DerDensityByEntropy ddsp
-    "Derivative of density wrt. specific enthalpy at constant pressure";
-protected
-  d1_Ps_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddsp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    p,
-    s);
-
-end dd1sp_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd1sp_Ps
+  "Derivative of density wrt. specific entropy at constant pressure in liquid region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output ThermoSysPro.Units.xSI.DerDensityByEntropy ddsp
+    "Derivative of density wrt. specific enthalpy at constant pressure";
+protected
+  d1_Ps_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddsp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    p,
+    s);
+
+end dd1sp_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2Tp_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2Tp_PT.mo
index 6a4011f3744aa1c92a6134f15bcc105332f1e509..5e50080791c5390a2d5b8186244ac357a22cab97 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2Tp_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2Tp_PT.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd2Tp_PT
-  "Derivative of density wrt. temperature at constant pressure in vapor region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "temperature";
-  output Units.SI.DerDensityByTemperature ddTp
-    "Derivative of density wrt. temperature at constant pressure";
-protected
-  d1_PT_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddTp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    p,
-    T);
-
-end dd2Tp_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd2Tp_PT
+  "Derivative of density wrt. temperature at constant pressure in vapor region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "temperature";
+  output Units.SI.DerDensityByTemperature ddTp
+    "Derivative of density wrt. temperature at constant pressure";
+protected
+  d1_PT_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddTp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    p,
+    T);
+
+end dd2Tp_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2hp_Ph.mo
index 6bc0d52456f47c8865ea7a267e81e98deb5c8768..e4e886d8f9e090de91c757dec9d7809a84befe15 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2hp_Ph.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd2hp_Ph
-  "Derivative of density wrt. specific enthalpy at constant pressure in steam region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.DerDensityByEnthalpy ddhp
-    "Derivative of density wrt. specific enthalpy at constant pressure";
-protected
-  d2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddhp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    p,
-    h);
-
-end dd2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd2hp_Ph
+  "Derivative of density wrt. specific enthalpy at constant pressure in steam region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.DerDensityByEnthalpy ddhp
+    "Derivative of density wrt. specific enthalpy at constant pressure";
+protected
+  d2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddhp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    p,
+    h);
+
+end dd2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2pT_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2pT_PT.mo
index 493f80049336f08477c1c97a6ad4804ddcf3b114..ffb5fb840aa978c9db05987d85274653b6853798 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2pT_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2pT_PT.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd2pT_PT
-  "Derivative of density wrt. pressure at constant temperature in vapor region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "temperature";
-  output Units.SI.DerDensityByPressure ddpT
-    "Derivative of density wrt. pressure at constant specific entropy";
-protected
-  d1_PT_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddpT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    p,
-    T);
-
-end dd2pT_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd2pT_PT
+  "Derivative of density wrt. pressure at constant temperature in vapor region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "temperature";
+  output Units.SI.DerDensityByPressure ddpT
+    "Derivative of density wrt. pressure at constant specific entropy";
+protected
+  d1_PT_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddpT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    p,
+    T);
+
+end dd2pT_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2ph_Ph.mo
index 8b347238907d86e17b3aa73de509abf5c70ccb59..e6b4d28f6de9ab84da6eb8c6ce712b48e5170c31 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2ph_Ph.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd2ph_Ph
-  "Derivative of density wrt. pressure at constant specific enthalpy in steam region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.DerDensityByPressure ddph
-    "Derivative of density wrt. pressure at constant specific enthalpy";
-protected
-  d2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    p,
-    h);
-
-end dd2ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd2ph_Ph
+  "Derivative of density wrt. pressure at constant specific enthalpy in steam region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.DerDensityByPressure ddph
+    "Derivative of density wrt. pressure at constant specific enthalpy";
+protected
+  d2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    p,
+    h);
+
+end dd2ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2ps_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2ps_Ps.mo
index a3648976c5a9d92f677fef4abfec39f7cfc2037a..4e8ccfbde14881cc1f6a4fa9eb44049f9235b823 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2ps_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2ps_Ps.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd2ps_Ps
-  "Derivative of density wrt. pressure at constant specific entropy in liquid region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Units.SI.DerDensityByPressure ddps
-    "Derivative of density wrt. pressure at constant specific entropy";
-protected
-  d2_Ps_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddps := 1/log(10)/p*
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
-    s);
-
-end dd2ps_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd2ps_Ps
+  "Derivative of density wrt. pressure at constant specific entropy in liquid region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Units.SI.DerDensityByPressure ddps
+    "Derivative of density wrt. pressure at constant specific entropy";
+protected
+  d2_Ps_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddps := 1/log(10)/p*
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
+    s);
+
+end dd2ps_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2sp_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2sp_Ps.mo
index 189a7d6dae3edbd20708ed6dd7ed9ed5dcad2e2f..61438b9932b250d287a2b6a5f10f876e8d2f2da0 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2sp_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/dd2sp_Ps.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Density;
-function dd2sp_Ps
-  "Derivative of density wrt. specific entropy at constant pressure in liquid region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output ThermoSysPro.Units.xSI.DerDensityByEntropy ddsp
-    "Derivative of density wrt. specific enthalpy at constant pressure";
-protected
-  d2_Ps_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  ddsp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
-    s);
-
-end dd2sp_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Density;
+function dd2sp_Ps
+  "Derivative of density wrt. specific entropy at constant pressure in liquid region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output ThermoSysPro.Units.xSI.DerDensityByEntropy ddsp
+    "Derivative of density wrt. specific enthalpy at constant pressure";
+protected
+  d2_Ps_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  ddsp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
+    s);
+
+end dd2sp_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Density/package.mo
index 47ba18ba5d51c06cd2ebbf6205a2488ff80f5498..edff7ec4535639002c7e5f2f0cf2c09b9ed6f74e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Density "Polynomials of density"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Density</b> contains polynomial functions to compute density. </span></p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Density;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Density "Polynomials of density"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Density</b> contains polynomial functions to compute density. </span></p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Density;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Density/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Density/package.order
index be9a4be05e215a4108198dadbb12730cda489618..0b1951b42d09fb5782360a04d1c2f2b81ff45a15 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Density/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Density/package.order
@@ -1,34 +1,34 @@
-d1_Ph_coef
-d1_Ph
-dd1ph_Ph
-dd1hp_Ph
-d2d1hp_Ph
-d2d1pp_Ph
-d2d1hh_Ph
-d2_Ph_coef
-d2_Ph
-dd2ph_Ph
-dd2hp_Ph
-d2d2hp_Ph
-d2d2pp_Ph
-d2d2hh_Ph
-d1_Ps_coef
-d1_Ps
-dd1ps_Ps
-dd1sp_Ps
-d2_Ps_coef
-d2_Ps
-dd2ps_Ps
-dd2sp_Ps
-d1_PT_coef
-d1_PT
-dd1pT_PT
-dd1Tp_PT
-d2_PT_coef
-d2_PT
-dd2pT_PT
-dd2Tp_PT
-d1sat_T_coef
-d1sat_T
-d2sat_T_coef
-d2sat_T
+d1_Ph_coef
+d1_Ph
+dd1ph_Ph
+dd1hp_Ph
+d2d1hp_Ph
+d2d1pp_Ph
+d2d1hh_Ph
+d2_Ph_coef
+d2_Ph
+dd2ph_Ph
+dd2hp_Ph
+d2d2hp_Ph
+d2d2pp_Ph
+d2d2hh_Ph
+d1_Ps_coef
+d1_Ps
+dd1ps_Ps
+dd1sp_Ps
+d2_Ps_coef
+d2_Ps
+dd2ps_Ps
+dd2sp_Ps
+d1_PT_coef
+d1_PT
+dd1pT_PT
+dd1Tp_PT
+d2_PT_coef
+d2_PT
+dd2pT_PT
+dd2Tp_PT
+d1sat_T_coef
+d1sat_T
+d2sat_T_coef
+d2sat_T
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1hh_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1hh_Ph.mo
index 362d22a50dae0b2b3a3c3587546ccd9809086fcd..09ff533214169c0b6a8a8bf54c3a12a9186cbe3d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1hh_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1hh_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function d2u1hh_Ph "Second derivative of specific inner energy wrt. enthalpy in liquid region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real d2uhh;
-protected
-  u1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2uhh := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_yy(coef, p, h);
-
-end d2u1hh_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function d2u1hh_Ph "Second derivative of specific inner energy wrt. enthalpy in liquid region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real d2uhh;
+protected
+  u1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2uhh := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_yy(coef, p, h);
+
+end d2u1hh_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1hp_Ph.mo
index e6708c2311eef457a9d4b2b5e0493648f0d3aad3..3a5c03514032925bee19654f37d5a6e8c5df8baa 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1hp_Ph.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function d2u1hp_Ph "Second derivative of specific inner energy wrt. enthalpy and pressure in liquid region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real d2uhp;
-
-protected
-  u1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2uhp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xy(coef, p, h);
-
-end d2u1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function d2u1hp_Ph "Second derivative of specific inner energy wrt. enthalpy and pressure in liquid region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real d2uhp;
+
+protected
+  u1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2uhp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xy(coef, p, h);
+
+end d2u1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1pp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1pp_Ph.mo
index e022eb780cf6542c217e29069752bf60f3f3a100..20d06006daec3b1dbc2db361de2113569fcf2b70 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1pp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u1pp_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function d2u1pp_Ph "Second derivative of specific inner energy wrt. pressure in liquid region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real d2upp;
-protected
-  u1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2upp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xx(coef, p, h);
-
-end d2u1pp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function d2u1pp_Ph "Second derivative of specific inner energy wrt. pressure in liquid region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real d2upp;
+protected
+  u1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2upp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xx(coef, p, h);
+
+end d2u1pp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2hh_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2hh_Ph.mo
index bf03e62204b5f753861e3f371467e25739925930..1ef11641851ee1f7e152479a098fbda7f10f8c81 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2hh_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2hh_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function d2u2hh_Ph "Second derivative of specific inner energy wrt. enthalpy in vapor region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real d2uhh;
-protected
-  u2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2uhh := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_yy(coef, p, h);
-
-end d2u2hh_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function d2u2hh_Ph "Second derivative of specific inner energy wrt. enthalpy in vapor region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real d2uhh;
+protected
+  u2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2uhh := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_yy(coef, p, h);
+
+end d2u2hh_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2hp_Ph.mo
index ac19ec7b2964326c18a97be4fed592e99d60e66a..e35f145e2951ea90228ada45c66ebd81146daca9 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2hp_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function d2u2hp_Ph "Second derivative of specific inner energy wrt. enthalpy and pressure in vapor region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real d2uhp;
-protected
-  u2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2uhp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xy(coef, p, h);
-
-end d2u2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function d2u2hp_Ph "Second derivative of specific inner energy wrt. enthalpy and pressure in vapor region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real d2uhp;
+protected
+  u2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2uhp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xy(coef, p, h);
+
+end d2u2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2pp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2pp_Ph.mo
index 0d52bd525f5f17565ece1e0a4cf3682d225fedf3..1a2dbb306bebac555981415a2b85621439b68a34 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2pp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/d2u2pp_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function d2u2pp_Ph "Second derivative of specific inner energy wrt. pressure in vapor region for given pressure and enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real d2upp;
-protected
-  u2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2upp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xx(coef, p, h);
-
-end d2u2pp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function d2u2pp_Ph "Second derivative of specific inner energy wrt. pressure in vapor region for given pressure and enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real d2upp;
+protected
+  u2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2upp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative2_xx(coef, p, h);
+
+end d2u2pp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1Tp_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1Tp_PT.mo
index 18a9d0159d1a6aa43820d00c428e742f452ce92f..ef4988260de2e122e128daabbf6727eb115e250a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1Tp_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1Tp_PT.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function du1Tp_PT "Derivative of inner energy wrt. temperature at constant pressure in liquid region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-
-  output Units.SI.SpecificHeatCapacity duTp "Derivative of density wrt. temperature at constant pressure";
-protected
-  u1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  duTp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(coef, p, T);
-
-end du1Tp_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function du1Tp_PT "Derivative of inner energy wrt. temperature at constant pressure in liquid region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+
+  output Units.SI.SpecificHeatCapacity duTp "Derivative of density wrt. temperature at constant pressure";
+protected
+  u1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  duTp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(coef, p, T);
+
+end du1Tp_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1hp_Ph.mo
index e1e54970fa40f5eb27550147db8f8eb0f2765d6a..71fbef0b2c1d8ac3061f5d25b8cb8a5b7f086546 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1hp_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function du1hp_Ph "Derivative of specific inner energy wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real duhp(unit = "1") "Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
-protected
-  u1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  duhp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(coef, p, h);
-
-end du1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function du1hp_Ph "Derivative of specific inner energy wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real duhp(unit = "1") "Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
+protected
+  u1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  duhp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(coef, p, h);
+
+end du1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1pT_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1pT_PT.mo
index f431b2cf9d08ceeed6046d8588e3d130c2559770..f924a9b2a66ab116263061dac5b170658efdcae2 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1pT_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1pT_PT.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function du1pT_PT "Derivative of inner energy wrt. pressure at constant temperature in liquid region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-
-  output Units.SI.DerEnergyByPressure dupT "Derivative of inner energy wrt. pressure at constant specific entropy";
-protected
-  u1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dupT := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(coef, p, T);
-
-end du1pT_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function du1pT_PT "Derivative of inner energy wrt. pressure at constant temperature in liquid region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+
+  output Units.SI.DerEnergyByPressure dupT "Derivative of inner energy wrt. pressure at constant specific entropy";
+protected
+  u1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dupT := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(coef, p, T);
+
+end du1pT_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1ph_Ph.mo
index a9b54ea8cbd2b21e0ed02cf99bffbef0aa413da4..ba8ce0d4f96af957246283c050670dc4458b6d01 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du1ph_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function du1ph_Ph "Derivative of specific inner energy wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real duph(unit="m3/kg") "Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
-protected
-  u1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  duph := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(coef, p, h);
-
-end du1ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function du1ph_Ph "Derivative of specific inner energy wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real duph(unit="m3/kg") "Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
+protected
+  u1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  duph := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(coef, p, h);
+
+end du1ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2Tp_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2Tp_PT.mo
index a60319e2251c6eb0f24ca099831b089da5c884a9..0f256f1e112585b066601c97b3c5ad7c5ae438bd 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2Tp_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2Tp_PT.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function du2Tp_PT "Derivative of inner energy wrt. temperature at constant pressure in vapor region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-
-  output Units.SI.SpecificHeatCapacity duTp "Derivative of density wrt. temperature at constant pressure";
-protected
-  u2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  duTp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(coef, p, T);
-
-end du2Tp_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function du2Tp_PT "Derivative of inner energy wrt. temperature at constant pressure in vapor region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+
+  output Units.SI.SpecificHeatCapacity duTp "Derivative of density wrt. temperature at constant pressure";
+protected
+  u2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  duTp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(coef, p, T);
+
+end du2Tp_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2hp_Ph.mo
index 2b4f7fc6cab662edffcb2c5a1786a28ab0ffc7dc..899ae16e8a3e04e5e51a78976a386583309ff776 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2hp_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function du2hp_Ph "Derivative of specific inner energy wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real duhp(unit = "1") "Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
-protected
-  u2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  duhp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(coef, p, h);
-
-end du2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function du2hp_Ph "Derivative of specific inner energy wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real duhp(unit = "1") "Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
+protected
+  u2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  duhp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(coef, p, h);
+
+end du2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2pT_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2pT_PT.mo
index a800a6b151068ece7a6631fc7fd8548db9f9fb4c..862e6e8fa3f7e73ec0287f99a29ac42b205de9fd 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2pT_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2pT_PT.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function du2pT_PT "Derivative of inner energy wrt. pressure at constant temperature in vapor region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-
-  output Units.SI.DerEnergyByPressure dupT "Derivative of inner energy wrt. pressure at constant specific entropy";
-protected
-  u2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dupT := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(coef, p, T);
-
-end du2pT_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function du2pT_PT "Derivative of inner energy wrt. pressure at constant temperature in vapor region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+
+  output Units.SI.DerEnergyByPressure dupT "Derivative of inner energy wrt. pressure at constant specific entropy";
+protected
+  u2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dupT := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(coef, p, T);
+
+end du2pT_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2ph_Ph.mo
index 84266bcfcd67ae7a6c174a9acf0a23e85389fa05..0b603ce7b5831e2308c5c4b5873793161dbfab1c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/du2ph_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function du2ph_Ph "Derivative of specific inner energy wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real duph(unit="m3/kg") "Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
-protected
-  u2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  duph := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(coef, p, h);
-
-end du2ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function du2ph_Ph "Derivative of specific inner energy wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real duph(unit="m3/kg") "Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
+protected
+  u2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  duph := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(coef, p, h);
+
+end du2ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/package.mo
index b338a7967122ba707c299659632f47a0ccafd9ad..598ba8d1415d3412d95d70745227f9f202fec4d8 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Energy "Polynomials of specific inner energy"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package<b> Energy</b> contains polynomial functions to compute energy. </span></p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Energy;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Energy "Polynomials of specific inner energy"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package<b> Energy</b> contains polynomial functions to compute energy. </span></p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Energy;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Energy/package.order
index edeb640ada429c6b8f0baf196bfbac84d57781d7..701107eb190d62c1fcf9d643bb442b87df5cfe8c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/package.order
@@ -1,22 +1,22 @@
-u1_Ph_coef
-u1_Ph
-du1ph_Ph
-du1hp_Ph
-d2u1hp_Ph
-d2u1pp_Ph
-d2u1hh_Ph
-u2_Ph_coef
-u2_Ph
-du2ph_Ph
-du2hp_Ph
-d2u2hp_Ph
-d2u2pp_Ph
-d2u2hh_Ph
-u1_PT_coef
-u1_PT
-du1pT_PT
-du1Tp_PT
-u2_PT_coef
-u2_PT
-du2pT_PT
-du2Tp_PT
+u1_Ph_coef
+u1_Ph
+du1ph_Ph
+du1hp_Ph
+d2u1hp_Ph
+d2u1pp_Ph
+d2u1hh_Ph
+u2_Ph_coef
+u2_Ph
+du2ph_Ph
+du2hp_Ph
+d2u2hp_Ph
+d2u2pp_Ph
+d2u2hh_Ph
+u1_PT_coef
+u1_PT
+du1pT_PT
+du1Tp_PT
+u2_PT_coef
+u2_PT
+du2pT_PT
+du2Tp_PT
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_PT.mo
index 06d0fc53fc4d1aff8230ccc7f2b12e27774a8578..e7b37dd398339905c13d233de72e54261b8b8e4d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_PT.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function u1_PT
-  "Specific inner energy in liquid region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.SpecificEnergy u "Specific inner energy";
-  u1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  u := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    T);
-
-end u1_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function u1_PT
+  "Specific inner energy in liquid region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.SpecificEnergy u "Specific inner energy";
+  u1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  u := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    T);
+
+end u1_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_PT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_PT_coef.mo
index 9946b3dda5f7b6b31063a65e8bbd825cd10efd9a..65d37184db95e90fc583715822a5ef4ef09db21a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_PT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_PT_coef.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-record u1_PT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=-1.199077e+07,
-    c10=3.933724e-02,
-    c01=1.294203e+05,
-    c20=-3.373270e-10,
-    c11=-2.689978e-04,
-    c02=-5.708589e+02,
-    c30=2.481700e-19,
-    c21=2.378897e-12,
-    c12=5.482753e-07,
-    c03=1.289251e+00,
-    c40=-4.631300e-27,
-    c31=1.419574e-21,
-    c22=-5.929846e-15,
-    c13=-1.809839e-10,
-    c04=-1.449570e-03,
-    c50=1.702200e-35,
-    c41=4.617004e-31,
-    c32=-2.467419e-24,
-    c23=4.993837e-18,
-    c14=-3.200878e-13,
-    c05=6.530896e-07);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end u1_PT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+record u1_PT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=-1.199077e+07,
+    c10=3.933724e-02,
+    c01=1.294203e+05,
+    c20=-3.373270e-10,
+    c11=-2.689978e-04,
+    c02=-5.708589e+02,
+    c30=2.481700e-19,
+    c21=2.378897e-12,
+    c12=5.482753e-07,
+    c03=1.289251e+00,
+    c40=-4.631300e-27,
+    c31=1.419574e-21,
+    c22=-5.929846e-15,
+    c13=-1.809839e-10,
+    c04=-1.449570e-03,
+    c50=1.702200e-35,
+    c41=4.617004e-31,
+    c32=-2.467419e-24,
+    c23=4.993837e-18,
+    c14=-3.200878e-13,
+    c05=6.530896e-07);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end u1_PT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_Ph.mo
index f128d8f3546c5d8a758bfdcd2c2112b9406da12e..c96e88216d1593ac585a281268dd9506c5171de0 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function u1_Ph "Specific inner energy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Units.SI.SpecificEnergy u "Specific inner energy";
-protected
-  u1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  u := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(coef, p, h);
-
-end u1_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function u1_Ph "Specific inner energy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Units.SI.SpecificEnergy u "Specific inner energy";
+protected
+  u1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  u := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(coef, p, h);
+
+end u1_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_Ph_coef.mo
index 77bcd6045441a25223917bd1c22ae564b18c6c4b..bec6963f13ea5767565f369e730bcac229d607b5 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u1_Ph_coef.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-record u1_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=-8.183623e+02,
-    c10=-9.814738e-04,
-    c01=1.006746e+00,
-    c20=7.668813e-13,
-    c11=-2.138554e-10,
-    c02=-6.488963e-09);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end u1_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+record u1_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=-8.183623e+02,
+    c10=-9.814738e-04,
+    c01=1.006746e+00,
+    c20=7.668813e-13,
+    c11=-2.138554e-10,
+    c02=-6.488963e-09);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end u1_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_PT.mo
index d3407956b5ab12dc246634878f992d7a65c66961..265cde3cce8148096ef560ee30e1a937faf26a94 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_PT.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function u2_PT "Specific inner energy in vapor region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-
-  output Units.SI.SpecificEnergy u "Specific inner energy";
-protected
-  u2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  u := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(coef, p, T);
-
-end u2_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function u2_PT "Specific inner energy in vapor region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+
+  output Units.SI.SpecificEnergy u "Specific inner energy";
+protected
+  u2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  u := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(coef, p, T);
+
+end u2_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_PT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_PT_coef.mo
index 53b44a0549cea7adbc875ea66b430ab234531777..9a21018acf572ee920d354be63fdca5110de86d8 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_PT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_PT_coef.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-record u2_PT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=1.822267e+06,
-    c10=-5.532014e-02,
-    c01=1.840048e+03,
-    c20=1.288956e-10,
-    c11=6.553801e-05,
-    c02=-2.793637e-01,
-    c30=-4.283469e-20,
-    c21=-8.415179e-14,
-    c12=-1.945450e-08,
-    c03=1.669594e-04);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end u2_PT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+record u2_PT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=1.822267e+06,
+    c10=-5.532014e-02,
+    c01=1.840048e+03,
+    c20=1.288956e-10,
+    c11=6.553801e-05,
+    c02=-2.793637e-01,
+    c30=-4.283469e-20,
+    c21=-8.415179e-14,
+    c12=-1.945450e-08,
+    c03=1.669594e-04);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end u2_PT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_Ph.mo
index 9d9cf4a85180bda75233e7ab92da0f260bfdbea4..f209b849bc7feadef4cafc5ec15d4daa34801d6d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-function u2_Ph "Specific inner energy in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Units.SI.SpecificEnergy u "Specific inner energy";
-protected
-  u2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  u := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(coef, p, h);
-
-end u2_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+function u2_Ph "Specific inner energy in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Units.SI.SpecificEnergy u "Specific inner energy";
+protected
+  u2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  u := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(coef, p, h);
+
+end u2_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_Ph_coef.mo
index 466684e5bca3467884affcbc9253f078157cdfcb..fa60c4c8ba7753a5bde2e8933cbabc44c0da51c4 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Energy/u2_Ph_coef.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Energy;
-record u2_Ph_coef
-  extends Modelica.Icons.Record;
-
-   extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=4.060030e+05,
-    c10=-1.900410e-03,
-    c01=8.048624e-01,
-    c20=-1.701173e-11,
-    c11=1.148079e-09,
-    c02=-1.321884e-08,
-    c30=3.221281e-20,
-    c21=2.194292e-18,
-    c12=-1.550691e-16,
-    c03=1.945920e-15);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end u2_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Energy;
+record u2_Ph_coef
+  extends Modelica.Icons.Record;
+
+   extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=4.060030e+05,
+    c10=-1.900410e-03,
+    c01=8.048624e-01,
+    c20=-1.701173e-11,
+    c11=1.148079e-09,
+    c02=-1.321884e-08,
+    c30=3.221281e-20,
+    c21=2.194292e-18,
+    c12=-1.550691e-16,
+    c03=1.945920e-15);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end u2_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/d2h1satpp_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/d2h1satpp_P.mo
index e8c3022c57cd751a859c30dc9446aaf4215e0e62..0a387601555547a6429703de198ae27afe2426c0 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/d2h1satpp_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/d2h1satpp_P.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function d2h1satpp_P
-  "derivative of specific enthalpy at liquid saturation wrt. pressure"
-
-  input Units.SI.Pressure p "pressure";
-  output Real d2hpp "second derivative of enthalpy";
-protected
-  h1sat_P_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-  d2hpp := coef.a*coef.b*(coef.b-1)*abs(p)^(coef.b-2);
-end d2h1satpp_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function d2h1satpp_P
+  "derivative of specific enthalpy at liquid saturation wrt. pressure"
+
+  input Units.SI.Pressure p "pressure";
+  output Real d2hpp "second derivative of enthalpy";
+protected
+  h1sat_P_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+  d2hpp := coef.a*coef.b*(coef.b-1)*abs(p)^(coef.b-2);
+end d2h1satpp_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/d2h2satpp_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/d2h2satpp_P.mo
index d3abe490f4c7ca3c2d8dc8fa04cb16d17fc65325..fb34b14fdb70f07ee5e677f7fbe2d7262ce69b56 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/d2h2satpp_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/d2h2satpp_P.mo
@@ -1,28 +1,28 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function d2h2satpp_P
-  "derivative of specific enthalpy at vapor saturation wrt. pressure"
-
-  input Units.SI.Pressure p "pressure";
-  output Real d2hpp "derivative of enthalpy";
-
-protected
-  h2sat_P_coef1 coef1;
-  h2sat_P_coef2 coef2;
-  h2sat_P_coef2 coef3;
-
-algorithm
-  if p < 8.7075e5 then
-     d2hpp := coef1.a*coef1.b*abs(p)^(coef1.b-1);
-    else
-      if p < 93.285e5 then
-      d2hpp :=
-        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5_derivative2(
-         coef2, p);
-      else
-      d2hpp :=
-        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative2(
-         coef3, p);
-      end if;
-   end if;
-
-end d2h2satpp_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function d2h2satpp_P
+  "derivative of specific enthalpy at vapor saturation wrt. pressure"
+
+  input Units.SI.Pressure p "pressure";
+  output Real d2hpp "derivative of enthalpy";
+
+protected
+  h2sat_P_coef1 coef1;
+  h2sat_P_coef2 coef2;
+  h2sat_P_coef2 coef3;
+
+algorithm
+  if p < 8.7075e5 then
+     d2hpp := coef1.a*coef1.b*abs(p)^(coef1.b-1);
+    else
+      if p < 93.285e5 then
+      d2hpp :=
+        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5_derivative2(
+         coef2, p);
+      else
+      d2hpp :=
+        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative2(
+         coef3, p);
+      end if;
+   end if;
+
+end d2h2satpp_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1Td_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1Td_dT.mo
index 2163ca980e5b85372ab4cc02003c794420033af9..1b4981c85d49b614821fb9eee88e3c8774a9a96f 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1Td_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1Td_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh1Td_dT
-  "Derivative of specific enthalpy wrt. specific entropy at constant density in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dhTd
-    "Derivative of specific enthalpy wrt. temperature at constant density";
-protected
-  h1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhTd :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    d,
-    T);
-
-end dh1Td_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh1Td_dT
+  "Derivative of specific enthalpy wrt. specific entropy at constant density in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dhTd
+    "Derivative of specific enthalpy wrt. temperature at constant density";
+protected
+  h1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhTd :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    d,
+    T);
+
+end dh1Td_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1Tp_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1Tp_PT.mo
index d22ba110f13b012247988bc12ed18286a6f64b06..21de83bc3b256720cda09c42f1226c08cd1dceae 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1Tp_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1Tp_PT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh1Tp_PT
-  "Derivative of specific enthalpy wrt. specific entropy at constant pressure in liquid region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  output Real dhTp
-    "Derivative of specific enthalpy wrt. temperature at constant pressure";
-protected
-  h1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhTp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    p,
-    T);
-
-end dh1Tp_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh1Tp_PT
+  "Derivative of specific enthalpy wrt. specific entropy at constant pressure in liquid region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  output Real dhTp
+    "Derivative of specific enthalpy wrt. temperature at constant pressure";
+protected
+  h1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhTp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    p,
+    T);
+
+end dh1Tp_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1dT_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1dT_dT.mo
index 0fffea821c866570cffc39b6f2f8143469e2cb5a..e840ea4b94c47e846b6d5adbec716bae2f8026ba 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1dT_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1dT_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh1dT_dT
-  "Derivative of specific enthalpy wrt. density at constant specific enthalpy in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dhdT
-    "Derivative of specific enthalpy wrt. density at constant temperature";
-protected
-  h1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhdT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    d,
-    T);
-
-end dh1dT_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh1dT_dT
+  "Derivative of specific enthalpy wrt. density at constant specific enthalpy in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dhdT
+    "Derivative of specific enthalpy wrt. density at constant temperature";
+protected
+  h1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhdT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    d,
+    T);
+
+end dh1dT_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1pT_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1pT_PT.mo
index 41dfb47996354fdaa2061e08287afa1a9b7c8be4..963e5bb5666011b1131a8ea5f0f3135c3fb7c6c6 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1pT_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1pT_PT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh1pT_PT
-  "Derivative of specific enthalpy wrt. pressure at constant specific enthalpy in liquid region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  output Real dhpT
-    "Derivative of specific enthalpy wrt. pressure at constant temperature";
-protected
-  h1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhpT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    p,
-    T);
-
-end dh1pT_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh1pT_PT
+  "Derivative of specific enthalpy wrt. pressure at constant specific enthalpy in liquid region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  output Real dhpT
+    "Derivative of specific enthalpy wrt. pressure at constant temperature";
+protected
+  h1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhpT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    p,
+    T);
+
+end dh1pT_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1ps_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1ps_Ps.mo
index 4e0e08eb3f080d0dfe1290b8b3ad7ec563b30e02..1c5b0d473442908188e9c7d7907778832f38202a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1ps_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1ps_Ps.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh1ps_Ps
-  "Derivative of specific enthalpy wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Real dhps
-    "Derivative of specific enthalpy wrt. pressure at constant specific entropy";
-protected
-  h1_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhps :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    p,
-    s);
-
-end dh1ps_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh1ps_Ps
+  "Derivative of specific enthalpy wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Real dhps
+    "Derivative of specific enthalpy wrt. pressure at constant specific entropy";
+protected
+  h1_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhps :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    p,
+    s);
+
+end dh1ps_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1satp_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1satp_P.mo
index 912b0d3522f4b624aecb6cae02eb734e666d2209..231860f353130f4b3c7126aba29d02a20cad953d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1satp_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1satp_P.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh1satp_P
-  "derivative of specific enthalpy at liquid saturation wrt. pressure"
-
-  input Units.SI.Pressure p "pressure";
-  output Real dhp(unit="m3/kg") "derivative of enthalpy";
-protected
-  h1sat_P_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-  dhp := coef.a*coef.b*abs(p)^(coef.b-1);
-end dh1satp_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh1satp_P
+  "derivative of specific enthalpy at liquid saturation wrt. pressure"
+
+  input Units.SI.Pressure p "pressure";
+  output Real dhp(unit="m3/kg") "derivative of enthalpy";
+protected
+  h1sat_P_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+  dhp := coef.a*coef.b*abs(p)^(coef.b-1);
+end dh1satp_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1sp_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1sp_Ps.mo
index d6ea04a2d7f504f92241f7d206a96dfbfe206dfa..e057e7d2fad2d934d61012b4f2bed69a009fc2bb 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1sp_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh1sp_Ps.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh1sp_Ps
-  "Derivative of specific enthalpy wrt. specific entropy at constant pressure in liquid region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Real dhsp
-    "Derivative of specific enthalpy wrt. specific enthalpy at constant pressure";
-protected
-  h1_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhsp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    p,
-    s);
-
-end dh1sp_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh1sp_Ps
+  "Derivative of specific enthalpy wrt. specific entropy at constant pressure in liquid region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Real dhsp
+    "Derivative of specific enthalpy wrt. specific enthalpy at constant pressure";
+protected
+  h1_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhsp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    p,
+    s);
+
+end dh1sp_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2Td_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2Td_dT.mo
index d3f2b12ea77ff41c0b1150ee8b44d48d91150e9f..338e54b3528728ee0c46a2d7914bbb1d256b9061 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2Td_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2Td_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh2Td_dT
-  "Derivative of specific enthalpy wrt. specific entropy at constant density in vapor region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dhTd
-    "Derivative of specific enthalpy wrt. temperature at constant density";
-protected
-  h2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhTd :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    d,
-    T);
-
-end dh2Td_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh2Td_dT
+  "Derivative of specific enthalpy wrt. specific entropy at constant density in vapor region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dhTd
+    "Derivative of specific enthalpy wrt. temperature at constant density";
+protected
+  h2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhTd :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    d,
+    T);
+
+end dh2Td_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2Tp_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2Tp_PT.mo
index f5fb36900fb44db5e1bbf40b9f2a71e495426b47..931b52b2f297005975046bf4f222f5bfd10ad8f9 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2Tp_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2Tp_PT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh2Tp_PT
-  "Derivative of specific enthalpy wrt. specific entropy at constant pressure in vapor region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  output Real dhTp
-    "Derivative of specific enthalpy wrt. temperature at constant pressure";
-protected
-  h2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhTp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    p,
-    T);
-
-end dh2Tp_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh2Tp_PT
+  "Derivative of specific enthalpy wrt. specific entropy at constant pressure in vapor region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  output Real dhTp
+    "Derivative of specific enthalpy wrt. temperature at constant pressure";
+protected
+  h2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhTp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    p,
+    T);
+
+end dh2Tp_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2dT_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2dT_dT.mo
index e3aed33a1ee6afd9269279c6bf30a4fead6a7d73..590e51223259c6a9c300d15f844de60bff26b5fe 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2dT_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2dT_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh2dT_dT
-  "Derivative of specific enthalpy wrt. density at constant specific enthalpy in vapor region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dhdT
-    "Derivative of specific enthalpy wrt. density at constant temperature";
-protected
-  h2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhdT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    d,
-    T);
-
-end dh2dT_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh2dT_dT
+  "Derivative of specific enthalpy wrt. density at constant specific enthalpy in vapor region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dhdT
+    "Derivative of specific enthalpy wrt. density at constant temperature";
+protected
+  h2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhdT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    d,
+    T);
+
+end dh2dT_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2pT_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2pT_PT.mo
index c84a0ce75940efc5f0cae60597829e57293796cc..36aa130e8146342c13ccd7bc06e644e9f4548929 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2pT_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2pT_PT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh2pT_PT
-  "Derivative of specific enthalpy wrt. pressure at constant specific enthalpy in vapor region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  output Real dhpT
-    "Derivative of specific enthalpy wrt. pressure at constant specific entropy";
-protected
-  h2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhpT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    p,
-    T);
-
-end dh2pT_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh2pT_PT
+  "Derivative of specific enthalpy wrt. pressure at constant specific enthalpy in vapor region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  output Real dhpT
+    "Derivative of specific enthalpy wrt. pressure at constant specific entropy";
+protected
+  h2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhpT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    p,
+    T);
+
+end dh2pT_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2ps_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2ps_Ps.mo
index 6aa384dab290e6ad4f739bf5a9ccb609c5a6b47a..5089408441b078b05cc9d13d44d16907c3432b5c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2ps_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2ps_Ps.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh2ps_Ps
-  "Derivative of specific enthalpy wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Real dhps
-    "Derivative of specific enthalpy wrt. pressure at constant specific entropy";
-protected
-  h2_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhps := 1/log(10)/p*
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
-    s);
-
-end dh2ps_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh2ps_Ps
+  "Derivative of specific enthalpy wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Real dhps
+    "Derivative of specific enthalpy wrt. pressure at constant specific entropy";
+protected
+  h2_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhps := 1/log(10)/p*
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
+    s);
+
+end dh2ps_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2satp_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2satp_P.mo
index 109abad04d72431851a5eb49c58ce5451c4c233e..21abd7db7634fe6d1b219036e29be81b6b33de36 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2satp_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2satp_P.mo
@@ -1,28 +1,28 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh2satp_P
-  "derivative of specific enthalpy at vapor saturation wrt. pressure"
-
-  input Units.SI.Pressure p "pressure";
-  output Real dhp(unit="m3/kg") "derivative of enthalpy";
-
-protected
-  h2sat_P_coef1 coef1;
-  h2sat_P_coef2 coef2;
-  h2sat_P_coef2 coef3;
-
-algorithm
-  if p < 8.7075e5 then
-     dhp := coef1.a*coef1.b*abs(p)^(coef1.b-1);
-    else
-      if p < 93.285e5 then
-      dhp :=
-        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5_derivative(
-        coef2, p);
-      else
-      dhp :=
-        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(
-        coef3, p);
-      end if;
-   end if;
-
-end dh2satp_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh2satp_P
+  "derivative of specific enthalpy at vapor saturation wrt. pressure"
+
+  input Units.SI.Pressure p "pressure";
+  output Real dhp(unit="m3/kg") "derivative of enthalpy";
+
+protected
+  h2sat_P_coef1 coef1;
+  h2sat_P_coef2 coef2;
+  h2sat_P_coef2 coef3;
+
+algorithm
+  if p < 8.7075e5 then
+     dhp := coef1.a*coef1.b*abs(p)^(coef1.b-1);
+    else
+      if p < 93.285e5 then
+      dhp :=
+        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5_derivative(
+        coef2, p);
+      else
+      dhp :=
+        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(
+        coef3, p);
+      end if;
+   end if;
+
+end dh2satp_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2sp_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2sp_Ps.mo
index ebf1a3047f11fffddabc9682695ffd0be60f3715..19f73985e172d51387ab9fb3db953e0a59fd91e8 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2sp_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/dh2sp_Ps.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function dh2sp_Ps
-  "Derivative of specific enthalpy wrt. specific entropy at constant pressure in vapor region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Real dhsp
-    "Derivative of specific enthalpy wrt. specific entropy at constant pressure";
-protected
-  h2_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dhsp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
-    s);
-
-end dh2sp_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function dh2sp_Ps
+  "Derivative of specific enthalpy wrt. specific entropy at constant pressure in vapor region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Real dhsp
+    "Derivative of specific enthalpy wrt. specific entropy at constant pressure";
+protected
+  h2_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dhsp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
+    s);
+
+end dh2sp_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_PT.mo
index 2b3700fa95826d535047cfcc71e6ba9a4600b3c9..e6938293b62ca0179ea75af3a37897df5d0133c9 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_PT.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function h1_PT
-  "Specific enthalpy in liquid region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
-protected
-  h1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    T);
-
-end h1_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function h1_PT
+  "Specific enthalpy in liquid region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
+protected
+  h1_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    T);
+
+end h1_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_PT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_PT_coef.mo
index f06094460c1f26e4a63349df82846c9930a28999..40d733228941f0342bf5562c5a289382cc7bc2a4 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_PT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_PT_coef.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h1_PT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=-1.210342e+07,
-    c10=3.932901e-02,
-    c01=1.310565e+05,
-    c20=-3.425284e-10,
-    c11=-2.572281e-04,
-    c02=-5.801243e+02,
-    c30=1.974339e-19,
-    c21=2.427381e-12,
-    c12=4.966543e-07,
-    c03=1.314839e+00,
-    c40=-4.256626e-27,
-    c31=1.512868e-21,
-    c22=-6.054694e-15,
-    c13=-8.389491e-11,
-    c04=-1.484055e-03,
-    c50=1.597043e-35,
-    c41=1.356624e-31,
-    c32=-2.492294e-24,
-    c23=5.082575e-18,
-    c14=-3.822957e-13,
-    c05=6.712484e-07);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h1_PT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h1_PT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=-1.210342e+07,
+    c10=3.932901e-02,
+    c01=1.310565e+05,
+    c20=-3.425284e-10,
+    c11=-2.572281e-04,
+    c02=-5.801243e+02,
+    c30=1.974339e-19,
+    c21=2.427381e-12,
+    c12=4.966543e-07,
+    c03=1.314839e+00,
+    c40=-4.256626e-27,
+    c31=1.512868e-21,
+    c22=-6.054694e-15,
+    c13=-8.389491e-11,
+    c04=-1.484055e-03,
+    c50=1.597043e-35,
+    c41=1.356624e-31,
+    c32=-2.492294e-24,
+    c23=5.082575e-18,
+    c14=-3.822957e-13,
+    c05=6.712484e-07);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h1_PT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_Ps.mo
index c0338cb6d0890f3238bcac5290b1934f8a65d8bd..2d988df3a763349093c198640e0fdea799ea8290 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_Ps.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function h1_Ps
-  "Specific enthalpy in liquid region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
-protected
-  h1_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    p,
-    s);
-
-end h1_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function h1_Ps
+  "Specific enthalpy in liquid region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
+protected
+  h1_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    p,
+    s);
+
+end h1_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_Ps_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_Ps_coef.mo
index 99f49aadab220fc34118eec772fef533e1baaba8..93bb340bd022775771d4272e1e9516d990fd0d47 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_Ps_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_Ps_coef.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h1_Ps_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00 =  1.171467e+04,
-    c10 =  9.332002e-04,
-    c01 =  2.457972e+02,
-    c20 =  -3.775739e-13,
-    c11 =  1.102563e-07,
-    c02 =  4.913871e-02);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h1_Ps_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h1_Ps_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00 =  1.171467e+04,
+    c10 =  9.332002e-04,
+    c01 =  2.457972e+02,
+    c20 =  -3.775739e-13,
+    c11 =  1.102563e-07,
+    c02 =  4.913871e-02);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h1_Ps_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_dT.mo
index 658f211981f0958dd7e77b3b3e785e6e5cea52c1..aac9808ce5f2b6453701c5adfc0e60403474dd5a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_dT.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function h1_dT
-  "Specific enthalpy in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
-protected
-  h1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    d,
-    T);
-
-end h1_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function h1_dT
+  "Specific enthalpy in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
+protected
+  h1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    d,
+    T);
+
+end h1_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_dT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_dT_coef.mo
index fa38677d27f48047f98646c47555fd3efe289844..2cf346ac7974def1c0ef4c30c60ca9dff425a914 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_dT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1_dT_coef.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h1_dT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=-2.252639e+09,
-    c10=8.489281e+06,
-    c01=8.778907e+06,
-    c20=-1.271348e+04,
-    c11=-2.742816e+04,
-    c02=-1.297164e+04,
-    c30=9.555032e+00,
-    c21=3.138232e+01,
-    c12=3.210542e+01,
-    c03=8.942146e+00,
-    c40=-3.644105e-03,
-    c31=-1.572657e-02,
-    c22=-2.548579e-02,
-    c13=-1.576212e-02,
-    c04=-2.891150e-03,
-    c50=5.701269e-07,
-    c41=2.941663e-06,
-    c32=6.548900e-06,
-    c23=6.610104e-06,
-    c14=2.703402e-06,
-    c05=3.809620e-07);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h1_dT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h1_dT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=-2.252639e+09,
+    c10=8.489281e+06,
+    c01=8.778907e+06,
+    c20=-1.271348e+04,
+    c11=-2.742816e+04,
+    c02=-1.297164e+04,
+    c30=9.555032e+00,
+    c21=3.138232e+01,
+    c12=3.210542e+01,
+    c03=8.942146e+00,
+    c40=-3.644105e-03,
+    c31=-1.572657e-02,
+    c22=-2.548579e-02,
+    c13=-1.576212e-02,
+    c04=-2.891150e-03,
+    c50=5.701269e-07,
+    c41=2.941663e-06,
+    c32=6.548900e-06,
+    c23=6.610104e-06,
+    c14=2.703402e-06,
+    c05=3.809620e-07);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h1_dT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1sat_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1sat_P.mo
index 61d03e0ce3d8619094119c58bd7911fb49da23ed..e67ba1abf4ed65f4979c41deaa08607f9b174257 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1sat_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1sat_P.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function h1sat_P "specific enthalpy at liquid saturation for given pressure"
-
-  input Units.SI.Pressure p "pressure";
-  output Units.SI.SpecificEnthalpy h "specific enthalpy";
-protected
-  h1sat_P_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
- h := coef.a0 + coef.a*abs(p)^coef.b;
-
-end h1sat_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function h1sat_P "specific enthalpy at liquid saturation for given pressure"
+
+  input Units.SI.Pressure p "pressure";
+  output Units.SI.SpecificEnthalpy h "specific enthalpy";
+protected
+  h1sat_P_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+ h := coef.a0 + coef.a*abs(p)^coef.b;
+
+end h1sat_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1sat_P_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1sat_P_coef.mo
index 43f8a4c274c059764577e6ad12c56e88c1d7309c..fc6454ba4a8738c8c99c0cad7836cfa8414555f3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1sat_P_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h1sat_P_coef.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h1sat_P_coef
-  extends Modelica.Icons.Record;
-
-   constant Real a0 =  -5.551e+04;
-   constant Real a =   2.111e+04;
-   constant Real b =      0.2643;
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h1sat_P_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h1sat_P_coef
+  extends Modelica.Icons.Record;
+
+   constant Real a0 =  -5.551e+04;
+   constant Real a =   2.111e+04;
+   constant Real b =      0.2643;
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h1sat_P_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_PT.mo
index f60faa4a73f6cc75b442503634b17ddc7add3a13..733711b026f72ebc00d767e1687fd94c51afa7f7 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_PT.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function h2_PT
-  "Specific enthalpy in vapor region for given pressure and temperature"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
-protected
-  h2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    p,
-    T);
-
-end h2_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function h2_PT
+  "Specific enthalpy in vapor region for given pressure and temperature"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
+protected
+  h2_PT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    p,
+    T);
+
+end h2_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_PT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_PT_coef.mo
index 8ba8e0f1afcd53149e4ecd0911f2a75b3fbdfb18..a6071650fe83eaa9856bd950bc061e73861234cf 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_PT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_PT_coef.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h2_PT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=1.778741e+06,
-    c10=-6.997339e-02,
-    c01=2.423675e+03,
-    c20=1.958603e-10,
-    c11=8.100784e-05,
-    c02=-3.747139e-01,
-    c30=-1.016123e-19,
-    c21=-1.234548e-13,
-    c12=-2.324528e-08,
-    c03=1.891004e-04);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h2_PT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h2_PT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=1.778741e+06,
+    c10=-6.997339e-02,
+    c01=2.423675e+03,
+    c20=1.958603e-10,
+    c11=8.100784e-05,
+    c02=-3.747139e-01,
+    c30=-1.016123e-19,
+    c21=-1.234548e-13,
+    c12=-2.324528e-08,
+    c03=1.891004e-04);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h2_PT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_Ps.mo
index 3286adcc54746f0c905e15be92813e27303d41c3..7c48ec719ab5ffcbe2f000c242a4b9a8a77f0d0d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_Ps.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function h2_Ps
-  "Specific enthalpy in vapor region for given pressure and specific entropy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
-protected
-  h2_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
-    s);
-
-end h2_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function h2_Ps
+  "Specific enthalpy in vapor region for given pressure and specific entropy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
+protected
+  h2_Ps_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p),
+    s);
+
+end h2_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_Ps_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_Ps_coef.mo
index 8ee4cbe8487f731b8b9e17d5abb545301dbe1e74..bc63e177670a7e7f82b2ba7832baa51f2a2abc07 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_Ps_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_Ps_coef.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h2_Ps_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00 =  6.132959e+08,
-c10 =  -2.090378e+08,
-c01 =  -2.096829e+05,
-c20 =  2.789470e+07,
-c11 =  5.782221e+04,
-c02 =  2.838398e+01,
-c30 =  -1.784663e+06,
-c21 =  -5.859196e+03,
-c12 =  -5.896443e+00,
-c03 =  -1.893956e-03,
-c40 =  4.926275e+04,
-c31 =  2.623248e+02,
-c22 =  3.947919e-01,
-c13 =  2.640003e-04,
-c04 =  6.193561e-08,
-c50 =  -2.859106e+02,
-c41 =  -4.148007e+00,
-c32 =  -8.852846e-03,
-c23 =  -8.588732e-06,
-c14 =  -4.362390e-09,
-c05 =  -7.815188e-13);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h2_Ps_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h2_Ps_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00 =  6.132959e+08,
+c10 =  -2.090378e+08,
+c01 =  -2.096829e+05,
+c20 =  2.789470e+07,
+c11 =  5.782221e+04,
+c02 =  2.838398e+01,
+c30 =  -1.784663e+06,
+c21 =  -5.859196e+03,
+c12 =  -5.896443e+00,
+c03 =  -1.893956e-03,
+c40 =  4.926275e+04,
+c31 =  2.623248e+02,
+c22 =  3.947919e-01,
+c13 =  2.640003e-04,
+c04 =  6.193561e-08,
+c50 =  -2.859106e+02,
+c41 =  -4.148007e+00,
+c32 =  -8.852846e-03,
+c23 =  -8.588732e-06,
+c14 =  -4.362390e-09,
+c05 =  -7.815188e-13);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h2_Ps_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_dT.mo
index 4ea72c5a2b2c923cbdb1a4ffd283780f9def57f9..7261d5397301299ad6a21497badc13834ef75661 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_dT.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function h2_dT
-  "Specific enthalpy in vapor region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
-protected
-  h1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    d,
-    T);
-
-end h2_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function h2_dT
+  "Specific enthalpy in vapor region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.SpecificEnthalpy h "Specific enthalpy";
+protected
+  h1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  h := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    d,
+    T);
+
+end h2_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_dT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_dT_coef.mo
index 5933d1c1b6015ba728219ba84f9fcf24e668e386..106d7ea2df662cdf03770659b237fdb3763f9eb3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_dT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2_dT_coef.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h2_dT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=1.981268e+06,
-    c10=-1.283811e+04,
-    c01=1.794505e+03,
-    c20=1.453968e+01,
-    c11=1.368782e+01,
-    c02=1.770706e-01,
-    c30=-4.932515e-03,
-    c21=-9.713758e-03,
-    c12=-3.878955e-03,
-    c03=4.262431e-05);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h2_dT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h2_dT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=1.981268e+06,
+    c10=-1.283811e+04,
+    c01=1.794505e+03,
+    c20=1.453968e+01,
+    c11=1.368782e+01,
+    c02=1.770706e-01,
+    c30=-4.932515e-03,
+    c21=-9.713758e-03,
+    c12=-3.878955e-03,
+    c03=4.262431e-05);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h2_dT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P.mo
index 24779766bfb7c97ff06805c774e2bd0d58edc4f4..ded148a6d49d7f86bdd4a8c58b9c25dd5ef3e11d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P.mo
@@ -1,28 +1,28 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-function h2sat_P "specific enthalpy at vapor saturation for given pressure"
-
-  input Units.SI.Pressure p "pressure";
-  output Units.SI.SpecificEnthalpy h "specific enthalpy";
-
-protected
-  h2sat_P_coef1 coef1;
-  h2sat_P_coef2 coef2;
-  h2sat_P_coef3 coef3;
-
-algorithm
-   if p < 8.7075e5 then
-     h := coef1.a0 + coef1.a*abs(p)^coef1.b;
-    else
-      if p < 93.285e5 then
-      h :=
-        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(
-        coef2, p);
-      else
-      h :=
-        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(
-        coef3, p);
-      end if;
-   end if;
-
- //h:=ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p);
-end h2sat_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+function h2sat_P "specific enthalpy at vapor saturation for given pressure"
+
+  input Units.SI.Pressure p "pressure";
+  output Units.SI.SpecificEnthalpy h "specific enthalpy";
+
+protected
+  h2sat_P_coef1 coef1;
+  h2sat_P_coef2 coef2;
+  h2sat_P_coef3 coef3;
+
+algorithm
+   if p < 8.7075e5 then
+     h := coef1.a0 + coef1.a*abs(p)^coef1.b;
+    else
+      if p < 93.285e5 then
+      h :=
+        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(
+        coef2, p);
+      else
+      h :=
+        ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(
+        coef3, p);
+      end if;
+   end if;
+
+ //h:=ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p);
+end h2sat_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef1.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef1.mo
index 55da3dee8eaf65f368913992e908ae810768271f..174d8302d745f4886db80af2497d61f04ff5133c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef1.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef1.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h2sat_P_coef1
-  extends Modelica.Icons.Record;
-
-  constant Real a0 =   2.242e+06;
-  constant Real a =   1.381e+05;
-  constant Real b =     0.09867;
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h2sat_P_coef1;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h2sat_P_coef1
+  extends Modelica.Icons.Record;
+
+  constant Real a0 =   2.242e+06;
+  constant Real a =   1.381e+05;
+  constant Real b =     0.09867;
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h2sat_P_coef1;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef2.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef2.mo
index 152ac172e96edff7c27703daa512956acca92774..04a851b0d84358bc6f557b0d0d8b43b75b8c7c88 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef2.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef2.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h2sat_P_coef2
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
-    c4=-5.295450709151908e-23,
-    c3=1.395998647281974e-15,
-    c2=-1.415784081274956e-08,
-    c1=5.366818361099557e-02,
-    c0=2.737576737978614e+06);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h2sat_P_coef2;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h2sat_P_coef2
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
+    c4=-5.295450709151908e-23,
+    c3=1.395998647281974e-15,
+    c2=-1.415784081274956e-08,
+    c1=5.366818361099557e-02,
+    c0=2.737576737978614e+06);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h2sat_P_coef2;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef3.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef3.mo
index abffdd7fec70d538e189556a8525a9bc5397f7cc..6f488133d4ddcec23de09b01d3c18130ff5413dd 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef3.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/h2sat_P_coef3.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
-record h2sat_P_coef3
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
-    c6=-3.735e-37,
-    c5=2.48e-29,
-    c4=-6.566e-22,
-    c3=8.838e-15,
-    c2=-6.44e-08,
-    c1=0.2298,
-    c0=2.491e+06);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end h2sat_P_coef3;
+within ThermoSysPro.Properties.WaterSteamSimple.Enthalpy;
+record h2sat_P_coef3
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
+    c6=-3.735e-37,
+    c5=2.48e-29,
+    c4=-6.566e-22,
+    c3=8.838e-15,
+    c2=-6.44e-08,
+    c1=0.2298,
+    c0=2.491e+06);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end h2sat_P_coef3;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/package.mo
index a3c5a7ff4736e85c5bd5e0c6996e86864f29219b..1a263dd1ae4f9a0fd0033565e7474b6a458012d4 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Enthalpy "Polynomials of specific enthalpy"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Enthalpy</b> contains polynomial functions to compute enthalpy. </span></p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Enthalpy;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Enthalpy "Polynomials of specific enthalpy"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Enthalpy</b> contains polynomial functions to compute enthalpy. </span></p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Enthalpy;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/package.order
index 9d3298abdc851f6eb1b50ad865f74d47824cafb0..fb005b3fabe7a984ce604200ef3bad8d4b3f8217 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Enthalpy/package.order
@@ -1,34 +1,34 @@
-h1sat_P_coef
-h1sat_P
-dh1satp_P
-d2h1satpp_P
-h2sat_P_coef1
-h2sat_P_coef2
-h2sat_P_coef3
-h2sat_P
-dh2satp_P
-d2h2satpp_P
-h1_Ps_coef
-h1_Ps
-dh1ps_Ps
-dh1sp_Ps
-h2_Ps_coef
-h2_Ps
-dh2ps_Ps
-dh2sp_Ps
-h1_PT_coef
-h1_PT
-dh1pT_PT
-dh1Tp_PT
-h2_PT_coef
-h2_PT
-dh2pT_PT
-dh2Tp_PT
-h1_dT_coef
-h1_dT
-dh1dT_dT
-dh1Td_dT
-h2_dT_coef
-h2_dT
-dh2dT_dT
-dh2Td_dT
+h1sat_P_coef
+h1sat_P
+dh1satp_P
+d2h1satpp_P
+h2sat_P_coef1
+h2sat_P_coef2
+h2sat_P_coef3
+h2sat_P
+dh2satp_P
+d2h2satpp_P
+h1_Ps_coef
+h1_Ps
+dh1ps_Ps
+dh1sp_Ps
+h2_Ps_coef
+h2_Ps
+dh2ps_Ps
+dh2sp_Ps
+h1_PT_coef
+h1_PT
+dh1pT_PT
+dh1Tp_PT
+h2_PT_coef
+h2_PT
+dh2pT_PT
+dh2Tp_PT
+h1_dT_coef
+h1_dT
+dh1dT_dT
+dh1Td_dT
+h2_dT_coef
+h2_dT
+dh2dT_dT
+dh2Td_dT
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1hp_Ph.mo
index a29da662f617bfba939a3f979c804a6a3ae6544c..45a96a944baa7a9cd0ecc96938df5a9aeca3ba33 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1hp_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function ds1hp_Ph "Derivative of specific entropy wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
- output Real dshp
-    "Derivative of specific entropy wrt. specific enthalpy at constant pressure";
-protected
-  s1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dshp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    p,
-    h);
-
-end ds1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function ds1hp_Ph "Derivative of specific entropy wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+ output Real dshp
+    "Derivative of specific entropy wrt. specific enthalpy at constant pressure";
+protected
+  s1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dshp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    p,
+    h);
+
+end ds1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1ph_Ph.mo
index b0886e85b8bfcbb73d8912633a6f6766c5d514cb..fa53a7273f2d490ad174b6eac61a491138d00f97 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1ph_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function ds1ph_Ph "Derivative of specific entropy wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
- output Real dsph
-    "Derivative of specific entropy wrt. pressure at constant specific enthalpy";
-protected
-  s1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dsph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    p,
-    h);
-
-end ds1ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function ds1ph_Ph "Derivative of specific entropy wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+ output Real dsph
+    "Derivative of specific entropy wrt. pressure at constant specific enthalpy";
+protected
+  s1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dsph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    p,
+    h);
+
+end ds1ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1satp_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1satp_P.mo
index c49688885368a68a365eeaf87fb2e320bbe3eedb..9479a70cdac6a8bca0b1e3739e35f7273a3ceb73 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1satp_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds1satp_P.mo
@@ -1,11 +1,11 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function ds1satp_P "Derivative of specific entropy wrt. pressure at liquid saturation for given pressure"
-  input Units.SI.Pressure p "pressure";
-  output Real dsp(unit="m3/(kg.K)") "derivative of entropy";
-protected
-  s1sat_P_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-  dsp :=1/log(10)/p*
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(
-    coef, ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p));
-end ds1satp_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function ds1satp_P "Derivative of specific entropy wrt. pressure at liquid saturation for given pressure"
+  input Units.SI.Pressure p "pressure";
+  output Real dsp(unit="m3/(kg.K)") "derivative of entropy";
+protected
+  s1sat_P_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+  dsp :=1/log(10)/p*
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(
+    coef, ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p));
+end ds1satp_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2hp_Ph.mo
index ea876b9cb5d33391a7f101b798dc52e3cd7a3c69..61f0793cfac51e47d238cad621fb3ba329773236 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2hp_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function ds2hp_Ph "Derivative of specific entropy wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dshp
-    "Derivative of specific entropy wrt. specific enthalpy at constant pressure";
-protected
-  s2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-   dshp:= coef.c1 +
-          coef.c2*2*h;
-
-end ds2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function ds2hp_Ph "Derivative of specific entropy wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dshp
+    "Derivative of specific entropy wrt. specific enthalpy at constant pressure";
+protected
+  s2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+   dshp:= coef.c1 +
+          coef.c2*2*h;
+
+end ds2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2ph_Ph.mo
index 3f668df2d523b2bacbd183278d8d98e68b1dfc33..be8eb9af53b3b9309fd2696c2991080035566650 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2ph_Ph.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function ds2ph_Ph "Derivative of specific entropy wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dsph
-    "Derivative of specific entropy wrt. pressure at constant specific enthalpy";
-protected
-  s2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-   dsph:= coef.a/log(10)/p;
-
-end ds2ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function ds2ph_Ph "Derivative of specific entropy wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dsph
+    "Derivative of specific entropy wrt. pressure at constant specific enthalpy";
+protected
+  s2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+   dsph:= coef.a/log(10)/p;
+
+end ds2ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2satp_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2satp_P.mo
index 6a483d8c6e63157cfc0ee12bf4f3cba5a8cf8a47..33b5a1db595bd974ce21d2c591dd3fef5b2ce106 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2satp_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/ds2satp_P.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function ds2satp_P "Derivative of specific entropy wrt. pressure at vapor saturation for given pressure"
-  input Units.SI.Pressure p "pressure";
-  output Real dsp(unit="m3/(kg.K)") "derivative of entropy";
-
-protected
-  s2sat_P_coef1 coef1;
-  s2sat_P_coef2 coef2;
-
-algorithm
-  if p < 15.85e5 then
-    dsp := 1/log(10)/p*ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5_derivative(coef1, ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p));
-  else
-    dsp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(coef2, p);
-  end if;
-
-end ds2satp_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function ds2satp_P "Derivative of specific entropy wrt. pressure at vapor saturation for given pressure"
+  input Units.SI.Pressure p "pressure";
+  output Real dsp(unit="m3/(kg.K)") "derivative of entropy";
+
+protected
+  s2sat_P_coef1 coef1;
+  s2sat_P_coef2 coef2;
+
+algorithm
+  if p < 15.85e5 then
+    dsp := 1/log(10)/p*ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5_derivative(coef1, ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p));
+  else
+    dsp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(coef2, p);
+  end if;
+
+end ds2satp_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/package.mo
index 9bf9f3c68d4359f24da60102d7c14dc213234798..db82404106909204f80544011a4a11ffae12b420 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Entropy "Polynomials of specific entropy"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Entropy</b> contains polynomial functions to compute entropy. </span></p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Entropy;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Entropy "Polynomials of specific entropy"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Entropy</b> contains polynomial functions to compute entropy. </span></p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Entropy;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/package.order
index 17e0f65f7a5f6ab0be0a40546fa56742358f6068..8ce8b3a9d1af8372528ece8664ee1029019cf8a7 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/package.order
@@ -1,15 +1,15 @@
-s1_Ph_coef
-s1_Ph
-ds1ph_Ph
-ds1hp_Ph
-s2_Ph_coef
-s2_Ph
-ds2ph_Ph
-ds2hp_Ph
-s1sat_P_coef
-s1sat_P
-ds1satp_P
-s2sat_P_coef1
-s2sat_P_coef2
-s2sat_P
-ds2satp_P
+s1_Ph_coef
+s1_Ph
+ds1ph_Ph
+ds1hp_Ph
+s2_Ph_coef
+s2_Ph
+ds2ph_Ph
+ds2hp_Ph
+s1sat_P_coef
+s1sat_P
+ds1satp_P
+s2sat_P_coef1
+s2sat_P_coef2
+s2sat_P
+ds2satp_P
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1_Ph.mo
index 9f3204469c854186bf514f3596cd39267f213f5a..fe060b1b84b68f92ed04230f57f2e55463b0c9c0 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1_Ph.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function s1_Ph "Specific entropy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.SpecificEntropy s "Specific entropy";
-protected
-  s1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  s := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    p,
-    h);
-
-end s1_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function s1_Ph "Specific entropy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.SpecificEntropy s "Specific entropy";
+protected
+  s1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  s := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    p,
+    h);
+
+end s1_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1_Ph_coef.mo
index 65e642119eec5ad2fdfff1ca96a25c63f29fdf4a..ff69ff7e09afadaf2467535524e28bf90605274e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1_Ph_coef.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-record s1_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=3.288493e+01,
-    c10=-3.150501e-06,
-    c01=3.245253e-03,
-    c20=1.085679e-15,
-    c11=5.702081e-13,
-    c02=-6.104960e-10);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end s1_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+record s1_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=3.288493e+01,
+    c10=-3.150501e-06,
+    c01=3.245253e-03,
+    c20=1.085679e-15,
+    c11=5.702081e-13,
+    c02=-6.104960e-10);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end s1_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1sat_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1sat_P.mo
index d53ef489b90debb2cdb6feb077979981dc499c39..e38474fa33850e47334a18216e2dcf5aa62a58ae 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1sat_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1sat_P.mo
@@ -1,10 +1,10 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function s1sat_P "Specific entropy at liquid saturation for given pressure"
-  input Units.SI.Pressure p "pressure";
-  output Units.SI.SpecificEntropy s "specific entropy";
-protected
-  s1sat_P_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-  s := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(
-    coef, ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p));
-end s1sat_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function s1sat_P "Specific entropy at liquid saturation for given pressure"
+  input Units.SI.Pressure p "pressure";
+  output Units.SI.SpecificEntropy s "specific entropy";
+protected
+  s1sat_P_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+  s := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(
+    coef, ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p));
+end s1sat_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1sat_P_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1sat_P_coef.mo
index 0bcd06b0837fda6f0ba00c98c40a5f2983163a5f..fde52f46673e62692f0e05594c6f4fbc38f0e354 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1sat_P_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s1sat_P_coef.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-record s1sat_P_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
-    c7 = 4.783031268042318e+00,
-    c6 =  -1.596826783529359e+02,
-    c5 = 2.241912955256332e+03,
-    c4 = -1.713580461176007e+04,
-    c3 = 7.692114721625441e+04,
-    c2 = -2.025392377804540e+05,
-    c1 = 2.898136070796547e+05,
-    c0 = -1.741778192246134e+05);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end s1sat_P_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+record s1sat_P_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
+    c7 = 4.783031268042318e+00,
+    c6 =  -1.596826783529359e+02,
+    c5 = 2.241912955256332e+03,
+    c4 = -1.713580461176007e+04,
+    c3 = 7.692114721625441e+04,
+    c2 = -2.025392377804540e+05,
+    c1 = 2.898136070796547e+05,
+    c0 = -1.741778192246134e+05);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end s1sat_P_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2_Ph.mo
index c96f44a9e75774214318f39a994cce80f954f991..e27724003ad2a6f71df119d18902ef26ccfdd08c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2_Ph.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function s2_Ph "Specific entropy in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.SpecificEntropy s "Specific entropy";
-protected
-  s2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  s := coef.c0 + coef.a*
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(abs(p)) + coef.c1
-    *h + coef.c2*h^2;
-
-end s2_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function s2_Ph "Specific entropy in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.SpecificEntropy s "Specific entropy";
+protected
+  s2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  s := coef.c0 + coef.a*
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(abs(p)) + coef.c1
+    *h + coef.c2*h^2;
+
+end s2_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2_Ph_coef.mo
index d3e7f9f4953eb4d2f1a926872acd2d36eb756eba..a3a734d3445df0ba03b9cf13ecdb85654eb88240 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2_Ph_coef.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-record s2_Ph_coef
-  extends Modelica.Icons.Record;
-
-  constant Real a =   -988.3;
-  constant Real c0 =    3065;
-  constant Real c1 =  0.0045;
-  constant Real c2 =  -4.101e-10;
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end s2_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+record s2_Ph_coef
+  extends Modelica.Icons.Record;
+
+  constant Real a =   -988.3;
+  constant Real c0 =    3065;
+  constant Real c1 =  0.0045;
+  constant Real c2 =  -4.101e-10;
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end s2_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P.mo
index 8be34692863d16eb3597e445a517cba4af8cf7f5..14db3ee3866005c415f09457c4dd32202d419c27 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-function s2sat_P "Specific entropy at vapor saturation for given pressure"
-  input Units.SI.Pressure p "pressure";
-  output Units.SI.SpecificEntropy s "specific entropy";
-
-protected
-  s2sat_P_coef1 coef1;
-  s2sat_P_coef2 coef2;
-
-algorithm
-  if p < 15.85e5 then
-    s := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(coef1, ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p));
-  else
-    s := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(coef2, p);
-  end if;
-end s2sat_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+function s2sat_P "Specific entropy at vapor saturation for given pressure"
+  input Units.SI.Pressure p "pressure";
+  output Units.SI.SpecificEntropy s "specific entropy";
+
+protected
+  s2sat_P_coef1 coef1;
+  s2sat_P_coef2 coef2;
+
+algorithm
+  if p < 15.85e5 then
+    s := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(coef1, ThermoSysPro.Properties.WaterSteamSimple.Utilities.logBase10(p));
+  else
+    s := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(coef2, p);
+  end if;
+end s2sat_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P_coef1.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P_coef1.mo
index bf30ff5b9eabb24a9586b2842a4c280ddf11d203..9d0177aad2b1900abfb70f95f4ac34b9602d67b0 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P_coef1.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P_coef1.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-record s2sat_P_coef1
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
-    c5=0,
-    c4=0,
-    c3=0,
-    c2=1.559066410833765e+01,
-    c1=-9.382592335419915e+02,
-    c0=1.165455266377105e+04);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end s2sat_P_coef1;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+record s2sat_P_coef1
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
+    c5=0,
+    c4=0,
+    c3=0,
+    c2=1.559066410833765e+01,
+    c1=-9.382592335419915e+02,
+    c0=1.165455266377105e+04);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end s2sat_P_coef1;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P_coef2.mo b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P_coef2.mo
index ed14626ac3726a5d1f9f248b666ba63bfc53afe7..ecca56ae7e32973663f295687ae5af353e4e4d7e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P_coef2.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Entropy/s2sat_P_coef2.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
-record s2sat_P_coef2
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
-      c7=-3.987096553509901e-47,
-      c6=2.971445178363267e-39,
-      c5=-9.186442753507775e-32,
-      c4=1.535714267785520e-24,
-      c3=-1.528004525781256e-17,
-      c2=9.443878492492247e-11,
-      c1=-4.196847249952369e-04,
-      c0=6.903980457955598e+03);
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end s2sat_P_coef2;
+within ThermoSysPro.Properties.WaterSteamSimple.Entropy;
+record s2sat_P_coef2
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
+      c7=-3.987096553509901e-47,
+      c6=2.971445178363267e-39,
+      c5=-9.186442753507775e-32,
+      c4=1.535714267785520e-24,
+      c3=-1.528004525781256e-17,
+      c2=9.443878492492247e-11,
+      c1=-4.196847249952369e-04,
+      c0=6.903980457955598e+03);
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end s2sat_P_coef2;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp1_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp1_Ph.mo
index 5c09728bc9259604dd09584ed5ccb44a921775ed..494010cef0319717eff92c3a574d927356aa7d1a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp1_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp1_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function cp1_Ph
-  "Specific heat capacity at constant presure in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.SpecificHeatCapacity cp
-    "Specific heat capacity at constant presure";
-protected
-  cp1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  cp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    h);
-
-end cp1_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function cp1_Ph
+  "Specific heat capacity at constant presure in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.SpecificHeatCapacity cp
+    "Specific heat capacity at constant presure";
+protected
+  cp1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  cp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    h);
+
+end cp1_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp1_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp1_Ph_coef.mo
index 09a76b4a6b2915c0e5a7628fd6869dd5a799ba35..219556923e2ec29f42b898a879250732aaf8ac48 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp1_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp1_Ph_coef.mo
@@ -1,30 +1,30 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-record cp1_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=4.207662e+03,
-    c10=-3.773690e-06,
-    c01=-3.744316e-04,
-    c20=-2.140615e-15,
-    c11=6.690603e-12,
-    c02=1.265071e-09,
-    c30=1.460525e-21,
-    c21=-1.698335e-19,
-    c12=-1.423996e-17,
-    c03=-4.448595e-16,
-    c40=-2.553418e-29,
-    c31=4.136914e-27,
-    c22=-4.694246e-25,
-    c13=5.232495e-23,
-    c04=-1.101472e-21,
-    c50=6.623097e-38,
-    c41=2.378719e-35,
-    c32=-7.976355e-33,
-    c23=9.128781e-31,
-    c14=-5.496190e-29,
-    c05=1.162449e-27);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end cp1_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+record cp1_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=4.207662e+03,
+    c10=-3.773690e-06,
+    c01=-3.744316e-04,
+    c20=-2.140615e-15,
+    c11=6.690603e-12,
+    c02=1.265071e-09,
+    c30=1.460525e-21,
+    c21=-1.698335e-19,
+    c12=-1.423996e-17,
+    c03=-4.448595e-16,
+    c40=-2.553418e-29,
+    c31=4.136914e-27,
+    c22=-4.694246e-25,
+    c13=5.232495e-23,
+    c04=-1.101472e-21,
+    c50=6.623097e-38,
+    c41=2.378719e-35,
+    c32=-7.976355e-33,
+    c23=9.128781e-31,
+    c14=-5.496190e-29,
+    c05=1.162449e-27);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end cp1_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp2_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp2_Ph.mo
index 8aacacd8687732b50f0dd54e7ead86474adeb494..e07de3c30dd089ee7ce5b3d0f80da2956d5f2643 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp2_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp2_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function cp2_Ph
-  "Specific heat capacity at constant presure in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.SpecificHeatCapacity cp
-    "Specific heat capacity at constant presure";
-protected
-  cp2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  cp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    h);
-
-end cp2_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function cp2_Ph
+  "Specific heat capacity at constant presure in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.SpecificHeatCapacity cp
+    "Specific heat capacity at constant presure";
+protected
+  cp2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  cp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    h);
+
+end cp2_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp2_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp2_Ph_coef.mo
index 6a2a0b99fa3df70d8ac4e590cb59d4a887b8ae5a..9668b1af94303498adeda22eac2eedc7d1abaa8a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp2_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cp2_Ph_coef.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-record cp2_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=-4400,
-    c10=0.003162,
-    c01=0.009958,
-    c20=-2.36e-11,
-    c11=-2.249e-09,
-    c02=-5.926e-09,
-    c30=1.036e-19,
-    c21=1.214e-17,
-    c12=5.98e-16,
-    c03=1.669e-15,
-    c40=-3.998e-28,
-    c31=-2.848e-26,
-    c22=-2.12e-24,
-    c13=-7.018e-23,
-    c04=-2.209e-22,
-    c50=7.818e-37,
-    c41=4.299e-35,
-    c32=2.099e-33,
-    c23=1.245e-31,
-    c14=3.061e-30,
-    c05=1.113e-29);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end cp2_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+record cp2_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=-4400,
+    c10=0.003162,
+    c01=0.009958,
+    c20=-2.36e-11,
+    c11=-2.249e-09,
+    c02=-5.926e-09,
+    c30=1.036e-19,
+    c21=1.214e-17,
+    c12=5.98e-16,
+    c03=1.669e-15,
+    c40=-3.998e-28,
+    c31=-2.848e-26,
+    c22=-2.12e-24,
+    c13=-7.018e-23,
+    c04=-2.209e-22,
+    c50=7.818e-37,
+    c41=4.299e-35,
+    c32=2.099e-33,
+    c23=1.245e-31,
+    c14=3.061e-30,
+    c05=1.113e-29);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end cp2_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv1_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv1_Ph.mo
index cd955b1c90a8b4180a58be90534783e2be105697..016c1324b4f4333ad0b8a40e9e6187156661ac9a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv1_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv1_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function cv1_Ph
-  "Specific heat capacity at constant volume in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.SpecificHeatCapacity cv
-    "Specific heat capacity at constant volume";
-protected
-  cv1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  cv := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    h);
-
-end cv1_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function cv1_Ph
+  "Specific heat capacity at constant volume in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.SpecificHeatCapacity cv
+    "Specific heat capacity at constant volume";
+protected
+  cv1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  cv := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    h);
+
+end cv1_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv1_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv1_Ph_coef.mo
index 31fccd92e6865b7f32c5a989844f79cd0141bd4e..1634090cc9c59b3364ea01c69c21b50adbff92b0 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv1_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv1_Ph_coef.mo
@@ -1,30 +1,30 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-record cv1_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00 =  4.304834e+03,
-    c10 =  -3.760969e-06,
-    c01 =  -1.530567e-03,
-    c20 =  1.927013e-13,
-    c11 =  -5.657385e-13,
-    c02 =  1.346921e-09,
-    c30 =  -7.039089e-21,
-    c21 =  3.116868e-19,
-    c12 =  -7.644685e-18,
-    c03 =  -2.161111e-15,
-    c40 =  8.260882e-29,
-    c31 =  -1.684752e-27,
-    c22 =  -1.752758e-25,
-    c13 =  6.726723e-24,
-    c04 =  1.694097e-21,
-    c50 =  -3.168745e-37,
-    c41 =  1.231252e-36,
-    c32 =  2.357419e-34,
-    c23 =  8.508953e-32,
-    c14 =  -4.647867e-30,
-    c05 =  -3.860965e-28);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end cv1_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+record cv1_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00 =  4.304834e+03,
+    c10 =  -3.760969e-06,
+    c01 =  -1.530567e-03,
+    c20 =  1.927013e-13,
+    c11 =  -5.657385e-13,
+    c02 =  1.346921e-09,
+    c30 =  -7.039089e-21,
+    c21 =  3.116868e-19,
+    c12 =  -7.644685e-18,
+    c03 =  -2.161111e-15,
+    c40 =  8.260882e-29,
+    c31 =  -1.684752e-27,
+    c22 =  -1.752758e-25,
+    c13 =  6.726723e-24,
+    c04 =  1.694097e-21,
+    c50 =  -3.168745e-37,
+    c41 =  1.231252e-36,
+    c32 =  2.357419e-34,
+    c23 =  8.508953e-32,
+    c14 =  -4.647867e-30,
+    c05 =  -3.860965e-28);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end cv1_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv2_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv2_Ph.mo
index 715bcc1a3825bba963d7844b65f753164db04555..ef3ebc572f3ba067fff88a0fdab5742d1574a75e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv2_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv2_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function cv2_Ph
-  "Specific heat capacity at constant volume in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.SpecificHeatCapacity cv
-    "Specific heat capacity at constant volume";
-protected
-  cv2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  cv := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    p,
-    h);
-
-end cv2_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function cv2_Ph
+  "Specific heat capacity at constant volume in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.SpecificHeatCapacity cv
+    "Specific heat capacity at constant volume";
+protected
+  cv2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  cv := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    p,
+    h);
+
+end cv2_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv2_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv2_Ph_coef.mo
index 9fbe33b4471a7ea5f7bdf6189cd546cee322bdfc..fd53488448ea5cfb14422825e074ff7e92a38e16 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv2_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/cv2_Ph_coef.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-record cv2_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00 =  6.341265e+03,
-    c10 =  9.157602e-05,
-    c01 =  -3.468356e-03,
-    c20 =  -1.075238e-12,
-    c11 =  -1.720256e-11,
-    c02 =  8.051195e-10,
-    c30 =  2.904533e-21,
-    c21 =  1.341240e-19,
-    c12 =  3.664923e-19,
-    c03 =  -5.649382e-17);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end cv2_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+record cv2_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00 =  6.341265e+03,
+    c10 =  9.157602e-05,
+    c01 =  -3.468356e-03,
+    c20 =  -1.075238e-12,
+    c11 =  -1.720256e-11,
+    c02 =  8.051195e-10,
+    c30 =  2.904533e-21,
+    c21 =  1.341240e-19,
+    c12 =  3.664923e-19,
+    c03 =  -5.649382e-17);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end cv2_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp1hp_Ph.mo
index f39ecabc4264aab0d3589790a50303c82aea7f5d..f34af13365516ea01676ac54632c247afbe4ccef 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp1hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function dcp1hp_Ph
-  "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
- output Real dcphp
-    "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure";
-protected
-  cp1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dcphp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    p,
-    h);
-
-end dcp1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function dcp1hp_Ph
+  "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+ output Real dcphp
+    "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure";
+protected
+  cp1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dcphp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    p,
+    h);
+
+end dcp1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp1ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp1ph_Ph.mo
index f1641205e415a7511191bf00c40e8d16560913da..4de67e557f18be6e75945c9f90cf557c7eb8c981 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp1ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp1ph_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function dcp1ph_Ph
-  "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
- output Real dcpph
-    "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy";
-protected
-  cp1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dcpph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    p,
-    h);
-
-end dcp1ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function dcp1ph_Ph
+  "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+ output Real dcpph
+    "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy";
+protected
+  cp1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dcpph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    p,
+    h);
+
+end dcp1ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp2hp_Ph.mo
index 67e915b8a0ff77fe0f52ee4119350dac1bb68d6e..bccd23172d0981b04c78ecfd1258edf0558a8f32 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp2hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function dcp2hp_Ph
-  "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dcphp
-    "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure";
-protected
-  cp2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dcphp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    p,
-    h);
-
-end dcp2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function dcp2hp_Ph
+  "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dcphp
+    "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure";
+protected
+  cp2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dcphp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    p,
+    h);
+
+end dcp2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp2ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp2ph_Ph.mo
index 805614e1815a54599ea612e36fbbaf455767c09c..68a2be8911985b98371423ac9eaa55391e1c4a44 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp2ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcp2ph_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function dcp2ph_Ph
-  "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dcpph
-    "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy";
-protected
-  cp2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dcpph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    p,
-    h);
-
-end dcp2ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function dcp2ph_Ph
+  "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dcpph
+    "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy";
+protected
+  cp2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dcpph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    p,
+    h);
+
+end dcp2ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv1hp_Ph.mo
index df48362b74c063828e15df0dc584b5dab036dcd6..74d43aacc0a4325326e385e2a592dc39bed14983 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv1hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function dcv1hp_Ph
-  "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
- output Real dcvhp
-    "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure";
-protected
-  cv1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dcvhp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    p,
-    h);
-
-end dcv1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function dcv1hp_Ph
+  "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+ output Real dcvhp
+    "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure";
+protected
+  cv1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dcvhp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    p,
+    h);
+
+end dcv1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv1ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv1ph_Ph.mo
index ee86d5692cb39e2060e8eb5ec727936810b90243..e7a9c35ba2092910c8d864939f75a3cd21cd7c91 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv1ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv1ph_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function dcv1ph_Ph
-  "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
- output Real dcvph
-    "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy";
-protected
-  cv1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dcvph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    p,
-    h);
-
-end dcv1ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function dcv1ph_Ph
+  "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+ output Real dcvph
+    "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy";
+protected
+  cv1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dcvph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    p,
+    h);
+
+end dcv1ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv2hp_Ph.mo
index 29e1e8bd540aed35a350dc28b28668c6855b4207..2445a2ef0d96193e5a62ba15ad88a2da61d86f34 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv2hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function dcv2hp_Ph
-  "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dcvhp
-    "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure";
-protected
-  cv2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dcvhp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    p,
-    h);
-
-end dcv2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function dcv2hp_Ph
+  "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dcvhp
+    "Derivative of specific heat capacity wrt. specific enthalpy at constant pressure";
+protected
+  cv2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dcvhp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    p,
+    h);
+
+end dcv2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv2ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv2ph_Ph.mo
index a7fd70ff875bfd0ca891ec06a1fa09587bba09a7..562946cde045d7381fdb5ed0075869598bd47dec 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv2ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/dcv2ph_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
-function dcv2ph_Ph
-  "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dcvph
-    "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy";
-protected
-  cv2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dcvph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    p,
-    h);
-
-end dcv2ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity;
+function dcv2ph_Ph
+  "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dcvph
+    "Derivative of specific heat capacity wrt. pressure at constant specific enthalpy";
+protected
+  cv2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dcvph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    p,
+    h);
+
+end dcv2ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/package.mo
index 9c2e7ed684ecdbcc5ba7d702f12d90d2f3d4f166..0cff1de63bd660bc40e81e5953c20f9b18977518 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package HeatCapacity "Polynomials of specific heat capacity"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>HeatCapacity</b> contains polynomial functions to compute heat capacity. </span></p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end HeatCapacity;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package HeatCapacity "Polynomials of specific heat capacity"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>HeatCapacity</b> contains polynomial functions to compute heat capacity. </span></p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end HeatCapacity;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/package.order b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/package.order
index b345f2092caecb28e2a6db16f9b207e6c1179936..30519180b5ff96941c345b18725311157619d32a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/HeatCapacity/package.order
@@ -1,16 +1,16 @@
-cp1_Ph_coef
-cp1_Ph
-dcp1ph_Ph
-dcp1hp_Ph
-cp2_Ph_coef
-cp2_Ph
-dcp2ph_Ph
-dcp2hp_Ph
-cv1_Ph_coef
-cv1_Ph
-dcv1ph_Ph
-dcv1hp_Ph
-cv2_Ph_coef
-cv2_Ph
-dcv2ph_Ph
-dcv2hp_Ph
+cp1_Ph_coef
+cp1_Ph
+dcp1ph_Ph
+dcp1hp_Ph
+cp2_Ph_coef
+cp2_Ph
+dcp2ph_Ph
+dcp2hp_Ph
+cv1_Ph_coef
+cv1_Ph
+dcv1ph_Ph
+dcv1hp_Ph
+cv2_Ph_coef
+cv2_Ph
+dcv2ph_Ph
+dcv2hp_Ph
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/InitLimits/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/InitLimits/package.mo
index 183e4ccbda8cd43d1f618eaaed54872ceade71fb..76c0b2965033989fb946ea788fcc9c2e35fdfe98 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/InitLimits/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/InitLimits/package.mo
@@ -1,214 +1,214 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package InitLimits
-
-  constant Real MINPOS=1.0e-9
-  "minimal value for physical variables which are always > 0.0";
-
-constant Units.SI.Area AMIN=MINPOS "Minimum surface";
-constant Units.SI.Area AMAX=1.0e5 "Maximum surface";
-constant Units.SI.Area ANOM=1.0 "Nominal surface";
-constant Units.SI.Density DMIN=MINPOS "Minimum density";
-constant Units.SI.Density DMAX=1.0e5 "Maximum densitye";
-constant Units.SI.Density DNOM=998.0 "Nominal density";
-constant Units.SI.ThermalConductivity LAMMIN=MINPOS
-  "Minimum thermal conductivity";
-constant Units.SI.ThermalConductivity LAMNOM=1.0 "Nominal thermal conductivity";
-constant Units.SI.ThermalConductivity LAMMAX=1000.0
-  "Maximum thermal conductivity";
-constant Units.SI.DynamicViscosity ETAMIN=MINPOS "Minimum dynamic viscosity";
-constant Units.SI.DynamicViscosity ETAMAX=1.0e8 "Maximum dynamic viscosity";
-constant Units.SI.DynamicViscosity ETANOM=100.0 "Nominal dynamic viscosity";
-constant Units.SI.Energy EMIN=-1.0e10 "Minimum energy";
-constant Units.SI.Energy EMAX=1.0e10 "Maximum energy";
-constant Units.SI.Energy ENOM=1.0e3 "Nominal energy";
-constant Units.SI.Entropy SMIN=-1.0e6 "Minimum entropy";
-constant Units.SI.Entropy SMAX=1.0e6 "Maximum entropy";
-constant Units.SI.Entropy SNOM=1.0e3 "Nominal entropy";
-constant Units.SI.MassFlowRate MDOTMIN=-1.0e5 "Minimum mass flow rate";
-constant Units.SI.MassFlowRate MDOTMAX=1.0e5 "Maximum mass flow rate";
-constant Units.SI.MassFlowRate MDOTNOM=1.0 "Nominal mass flow rate";
-constant ThermoSysPro.Units.SI.MassFraction MASSXMIN=-1.0*MINPOS
-  "Minimum mass fraction";
-constant ThermoSysPro.Units.SI.MassFraction MASSXMAX=1.0
-  "Maximum mass fraction";
-constant ThermoSysPro.Units.SI.MassFraction MASSXNOM=0.1
-  "Nominal mass fraction";
-constant Units.SI.Mass MMIN=1.0*MINPOS "Minimum mass";
-constant Units.SI.Mass MMAX=1.0e8 "Maximum mass";
-constant Units.SI.Mass MNOM=1.0 "Nominal mass";
-constant Units.SI.Power POWMIN=-1.0e8 "Minimum power";
-constant Units.SI.Power POWMAX=1.0e8 "Maximum power";
-constant Units.SI.Power POWNOM=1.0e3 "Nominal power";
-constant Units.SI.AbsolutePressure PMIN=100.0 "Minimum pressure";
-constant Units.SI.AbsolutePressure PMAX=1.0e9 "Maximum pressure";
-constant Units.SI.AbsolutePressure PNOM=1.0e5 "Nominal pressure";
-constant Units.SI.AbsolutePressure COMPPMIN=-1.0*MINPOS "Minimum pressure";
-constant Units.SI.AbsolutePressure COMPPMAX=1.0e8 "Maximum pressure";
-constant Units.SI.AbsolutePressure COMPPNOM=1.0e5 "Nominal pressure";
-constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMIN=1.0
-  "Minimum isentropic exponent";
-constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMAX=Modelica.Constants.inf
-  "Maximum isentropic exponent";
-constant Units.SI.RatioOfSpecificHeatCapacities KAPPANOM=1.2
-  "Nominal isentropic exponent";
-constant Units.SI.SpecificEnergy SEMIN=-1.0e8 "Minimum specific energy";
-constant Units.SI.SpecificEnergy SEMAX=1.0e8 "Maximum specific energy";
-constant Units.SI.SpecificEnergy SENOM=1.0e6 "Nominal specific energy";
-constant Units.SI.SpecificEnthalpy SHMIN=-1.0e6 "Minimum specific enthalpy";
-constant Units.SI.SpecificEnthalpy SHMAX=1.0e8 "Maximum specific enthalpy";
-constant Units.SI.SpecificEnthalpy SHNOM=1.0e6 "Nominal specific enthalpy";
-constant Units.SI.SpecificEntropy SSMIN=-1.0e6 "Minimum specific entropy";
-constant Units.SI.SpecificEntropy SSMAX=1.0e6 "Maximum specific entropy";
-constant Units.SI.SpecificEntropy SSNOM=1.0e3 "Nominal specific entropy";
-constant Units.SI.SpecificHeatCapacity CPMIN=MINPOS
-  "Minimum specific heat capacity";
-constant Units.SI.SpecificHeatCapacity CPMAX=Modelica.Constants.inf
-  "Maximum specific heat capacity";
-constant Units.SI.SpecificHeatCapacity CPNOM=1.0e3
-  "Nominal specific heat capacity";
-constant Units.SI.Temperature TMIN=200 "Minimum temperature";
-constant Units.SI.Temperature TMAX=6000 "Maximum temperature";
-constant Units.SI.Temperature TNOM=320.0 "Nominal temperature";
-constant Units.SI.ThermalConductivity LMIN=MINPOS
-  "Minimum thermal conductivity";
-constant Units.SI.ThermalConductivity LMAX=500.0 "Maximum thermal conductivity";
-constant Units.SI.ThermalConductivity LNOM=1.0 "Nominal thermal conductivity";
-constant Units.SI.Velocity VELMIN=-1.0e5 "Minimum velocity";
-constant Units.SI.Velocity VELMAX=Modelica.Constants.inf "Maximum velocity";
-constant Units.SI.Velocity VELNOM=1.0 "Nominal velocity";
-constant Units.SI.Volume VMIN=0.0 "Minimum volume";
-constant Units.SI.Volume VMAX=1.0e5 "Maximum volume";
-constant Units.SI.Volume VNOM=1.0e-3 "Nominal volume";
-
-
-  annotation (
-    Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.51,
-      height=0.74,
-      library=1,
-      autolayout=1),
-    Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library  (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-
-
-end InitLimits;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package InitLimits
+
+  constant Real MINPOS=1.0e-9
+  "minimal value for physical variables which are always > 0.0";
+
+constant Units.SI.Area AMIN=MINPOS "Minimum surface";
+constant Units.SI.Area AMAX=1.0e5 "Maximum surface";
+constant Units.SI.Area ANOM=1.0 "Nominal surface";
+constant Units.SI.Density DMIN=MINPOS "Minimum density";
+constant Units.SI.Density DMAX=1.0e5 "Maximum densitye";
+constant Units.SI.Density DNOM=998.0 "Nominal density";
+constant Units.SI.ThermalConductivity LAMMIN=MINPOS
+  "Minimum thermal conductivity";
+constant Units.SI.ThermalConductivity LAMNOM=1.0 "Nominal thermal conductivity";
+constant Units.SI.ThermalConductivity LAMMAX=1000.0
+  "Maximum thermal conductivity";
+constant Units.SI.DynamicViscosity ETAMIN=MINPOS "Minimum dynamic viscosity";
+constant Units.SI.DynamicViscosity ETAMAX=1.0e8 "Maximum dynamic viscosity";
+constant Units.SI.DynamicViscosity ETANOM=100.0 "Nominal dynamic viscosity";
+constant Units.SI.Energy EMIN=-1.0e10 "Minimum energy";
+constant Units.SI.Energy EMAX=1.0e10 "Maximum energy";
+constant Units.SI.Energy ENOM=1.0e3 "Nominal energy";
+constant Units.SI.Entropy SMIN=-1.0e6 "Minimum entropy";
+constant Units.SI.Entropy SMAX=1.0e6 "Maximum entropy";
+constant Units.SI.Entropy SNOM=1.0e3 "Nominal entropy";
+constant Units.SI.MassFlowRate MDOTMIN=-1.0e5 "Minimum mass flow rate";
+constant Units.SI.MassFlowRate MDOTMAX=1.0e5 "Maximum mass flow rate";
+constant Units.SI.MassFlowRate MDOTNOM=1.0 "Nominal mass flow rate";
+constant ThermoSysPro.Units.SI.MassFraction MASSXMIN=-1.0*MINPOS
+  "Minimum mass fraction";
+constant ThermoSysPro.Units.SI.MassFraction MASSXMAX=1.0
+  "Maximum mass fraction";
+constant ThermoSysPro.Units.SI.MassFraction MASSXNOM=0.1
+  "Nominal mass fraction";
+constant Units.SI.Mass MMIN=1.0*MINPOS "Minimum mass";
+constant Units.SI.Mass MMAX=1.0e8 "Maximum mass";
+constant Units.SI.Mass MNOM=1.0 "Nominal mass";
+constant Units.SI.Power POWMIN=-1.0e8 "Minimum power";
+constant Units.SI.Power POWMAX=1.0e8 "Maximum power";
+constant Units.SI.Power POWNOM=1.0e3 "Nominal power";
+constant Units.SI.AbsolutePressure PMIN=100.0 "Minimum pressure";
+constant Units.SI.AbsolutePressure PMAX=1.0e9 "Maximum pressure";
+constant Units.SI.AbsolutePressure PNOM=1.0e5 "Nominal pressure";
+constant Units.SI.AbsolutePressure COMPPMIN=-1.0*MINPOS "Minimum pressure";
+constant Units.SI.AbsolutePressure COMPPMAX=1.0e8 "Maximum pressure";
+constant Units.SI.AbsolutePressure COMPPNOM=1.0e5 "Nominal pressure";
+constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMIN=1.0
+  "Minimum isentropic exponent";
+constant Units.SI.RatioOfSpecificHeatCapacities KAPPAMAX=Modelica.Constants.inf
+  "Maximum isentropic exponent";
+constant Units.SI.RatioOfSpecificHeatCapacities KAPPANOM=1.2
+  "Nominal isentropic exponent";
+constant Units.SI.SpecificEnergy SEMIN=-1.0e8 "Minimum specific energy";
+constant Units.SI.SpecificEnergy SEMAX=1.0e8 "Maximum specific energy";
+constant Units.SI.SpecificEnergy SENOM=1.0e6 "Nominal specific energy";
+constant Units.SI.SpecificEnthalpy SHMIN=-1.0e6 "Minimum specific enthalpy";
+constant Units.SI.SpecificEnthalpy SHMAX=1.0e8 "Maximum specific enthalpy";
+constant Units.SI.SpecificEnthalpy SHNOM=1.0e6 "Nominal specific enthalpy";
+constant Units.SI.SpecificEntropy SSMIN=-1.0e6 "Minimum specific entropy";
+constant Units.SI.SpecificEntropy SSMAX=1.0e6 "Maximum specific entropy";
+constant Units.SI.SpecificEntropy SSNOM=1.0e3 "Nominal specific entropy";
+constant Units.SI.SpecificHeatCapacity CPMIN=MINPOS
+  "Minimum specific heat capacity";
+constant Units.SI.SpecificHeatCapacity CPMAX=Modelica.Constants.inf
+  "Maximum specific heat capacity";
+constant Units.SI.SpecificHeatCapacity CPNOM=1.0e3
+  "Nominal specific heat capacity";
+constant Units.SI.Temperature TMIN=200 "Minimum temperature";
+constant Units.SI.Temperature TMAX=6000 "Maximum temperature";
+constant Units.SI.Temperature TNOM=320.0 "Nominal temperature";
+constant Units.SI.ThermalConductivity LMIN=MINPOS
+  "Minimum thermal conductivity";
+constant Units.SI.ThermalConductivity LMAX=500.0 "Maximum thermal conductivity";
+constant Units.SI.ThermalConductivity LNOM=1.0 "Nominal thermal conductivity";
+constant Units.SI.Velocity VELMIN=-1.0e5 "Minimum velocity";
+constant Units.SI.Velocity VELMAX=Modelica.Constants.inf "Maximum velocity";
+constant Units.SI.Velocity VELNOM=1.0 "Nominal velocity";
+constant Units.SI.Volume VMIN=0.0 "Minimum volume";
+constant Units.SI.Volume VMAX=1.0e5 "Maximum volume";
+constant Units.SI.Volume VNOM=1.0e-3 "Nominal volume";
+
+
+  annotation (
+    Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.51,
+      height=0.74,
+      library=1,
+      autolayout=1),
+    Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library  (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+
+
+end InitLimits;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/InitLimits/package.order b/ThermoSysPro/Properties/WaterSteamSimple/InitLimits/package.order
index 906759bb24b7615fae9eddeea585b73d29cc0b6a..7cc4d49dba83b2caaea493fce10aace9998241f0 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/InitLimits/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/InitLimits/package.order
@@ -1,64 +1,64 @@
-MINPOS
-AMIN
-AMAX
-ANOM
-DMIN
-DMAX
-DNOM
-LAMMIN
-LAMNOM
-LAMMAX
-ETAMIN
-ETAMAX
-ETANOM
-EMIN
-EMAX
-ENOM
-SMIN
-SMAX
-SNOM
-MDOTMIN
-MDOTMAX
-MDOTNOM
-MASSXMIN
-MASSXMAX
-MASSXNOM
-MMIN
-MMAX
-MNOM
-POWMIN
-POWMAX
-POWNOM
-PMIN
-PMAX
-PNOM
-COMPPMIN
-COMPPMAX
-COMPPNOM
-KAPPAMIN
-KAPPAMAX
-KAPPANOM
-SEMIN
-SEMAX
-SENOM
-SHMIN
-SHMAX
-SHNOM
-SSMIN
-SSMAX
-SSNOM
-CPMIN
-CPMAX
-CPNOM
-TMIN
-TMAX
-TNOM
-LMIN
-LMAX
-LNOM
-VELMIN
-VELMAX
-VELNOM
-VMIN
-VMAX
-VNOM
+MINPOS
+AMIN
+AMAX
+ANOM
+DMIN
+DMAX
+DNOM
+LAMMIN
+LAMNOM
+LAMMAX
+ETAMIN
+ETAMAX
+ETANOM
+EMIN
+EMAX
+ENOM
+SMIN
+SMAX
+SNOM
+MDOTMIN
+MDOTMAX
+MDOTNOM
+MASSXMIN
+MASSXMAX
+MASSXNOM
+MMIN
+MMAX
+MNOM
+POWMIN
+POWMAX
+POWNOM
+PMIN
+PMAX
+PNOM
+COMPPMIN
+COMPPMAX
+COMPPNOM
+KAPPAMIN
+KAPPAMAX
+KAPPANOM
+SEMIN
+SEMAX
+SENOM
+SHMIN
+SHMAX
+SHNOM
+SSMIN
+SSMAX
+SSNOM
+CPMIN
+CPMAX
+CPNOM
+TMIN
+TMAX
+TNOM
+LMIN
+LMAX
+LNOM
+VELMIN
+VELMAX
+VELNOM
+VMIN
+VMAX
+VNOM
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/d2psatTT_T.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/d2psatTT_T.mo
index f7c9e69c76e5c17a8155fec808502185b2cd7f96..2913072f2e2b7411e4275d07e20201836b887340 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/d2psatTT_T.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/d2psatTT_T.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-function d2psatTT_T "Second derivative of saturation pressure wrt. temperature"
-  input Units.SI.Temperature T "Temperature";
-  output Real d2pTT "Second derivative of pressure";
-protected
-  psat_T_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  d2pTT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative2(
-    coef, T);
-
-end d2psatTT_T;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+function d2psatTT_T "Second derivative of saturation pressure wrt. temperature"
+  input Units.SI.Temperature T "Temperature";
+  output Real d2pTT "Second derivative of pressure";
+protected
+  psat_T_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  d2pTT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative2(
+    coef, T);
+
+end d2psatTT_T;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpTd_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpTd_dT.mo
index b417fe3e5fd9938eeb5a0c71403d299bef301e40..7858e2560920c8e02bf8e82f3c35d37f11e2e6cd 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpTd_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpTd_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-function dpTd_dT
-  "Derivative of pressure wrt. specific entropy at constant density in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dpTd "Derivative of pressure wrt. temperature at constant density";
-protected
- p_dT_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dpTd :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    d,
-    T);
-
-end dpTd_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+function dpTd_dT
+  "Derivative of pressure wrt. specific entropy at constant density in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dpTd "Derivative of pressure wrt. temperature at constant density";
+protected
+ p_dT_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dpTd :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    d,
+    T);
+
+end dpTd_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpdT_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpdT_dT.mo
index 475410c89404eff531e21e6b38e36c17078a7c99..3a045741d5bc27cf62bcc9ba56db0f3ed9805294 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpdT_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpdT_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-function dpdT_dT
-  "Derivative of pressure wrt. density at constant specific enthalpy in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dpdT "Derivative of pressure wrt. density at constant temperature";
-protected
-  p_dT_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dpdT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    d,
-    T);
-
-end dpdT_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+function dpdT_dT
+  "Derivative of pressure wrt. density at constant specific enthalpy in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dpdT "Derivative of pressure wrt. density at constant temperature";
+protected
+  p_dT_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dpdT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    d,
+    T);
+
+end dpdT_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpsat1h_h.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpsat1h_h.mo
index c105237437548ff79d9f5c0e5e58986dcdb6593f..0694e47062e33ef82f41d5b4a2762ad9a7d9aefa 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpsat1h_h.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpsat1h_h.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-function dpsat1h_h "Derivative of saturation pressure wrt. specific enthalpy"
-  input Units.SI.SpecificEnthalpy h "Enthalpy";
-  output Real dph "Pressure";
-protected
-  psat1_h_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5_derivative(
-    coef, h);
-
-end dpsat1h_h;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+function dpsat1h_h "Derivative of saturation pressure wrt. specific enthalpy"
+  input Units.SI.SpecificEnthalpy h "Enthalpy";
+  output Real dph "Pressure";
+protected
+  psat1_h_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5_derivative(
+    coef, h);
+
+end dpsat1h_h;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpsatT_T.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpsatT_T.mo
index 95f4fd767130fcf6c6fbf29cfdfdf9af2d08ff32..18a73ede541a29f5a58d638d37c56c7a57ef2208 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpsatT_T.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/dpsatT_T.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-function dpsatT_T "Derivative of saturation pressure wrt. temperature"
-  input Units.SI.Temperature T "Temperature";
-  output Real dpT "Derivative of pressure";
-protected
-  psat_T_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dpT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(
-    coef, T);
-
-end dpsatT_T;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+function dpsatT_T "Derivative of saturation pressure wrt. temperature"
+  input Units.SI.Temperature T "Temperature";
+  output Real dpT "Derivative of pressure";
+protected
+  psat_T_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dpT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(
+    coef, T);
+
+end dpsatT_T;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/p_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/p_dT.mo
index 660804d0c02e9382ec014f3391905c413735a3d4..1c267cabc76ba80274280c0428344bc4c159f316 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/p_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/p_dT.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-function p_dT "Pressure in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.Pressure p "Pressure";
-protected
-  p_dT_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  p := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    d,
-    T);
-
-end p_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+function p_dT "Pressure in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.Pressure p "Pressure";
+protected
+  p_dT_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  p := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    d,
+    T);
+
+end p_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/p_dT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/p_dT_coef.mo
index 487d6205869f88e9549df56c27f9646e527df26a..69fd7384473e93f9a1ada6feacab719cc464ed9d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/p_dT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/p_dT_coef.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-record p_dT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=6.038e+07,
-    c10=6.363e+05,
-    c01=-4.033e+05,
-    c20=197.5,
-    c11=-2881,
-    c02=912.4,
-    c30=-0.1172,
-    c21=-1.324,
-    c12=4.474,
-    c03=-0.8923,
-    c40=-0.003126,
-    c31=0.004181,
-    c22=-0.0001604,
-    c13=-0.002129,
-    c04=0.0003892,
-    c50=2.222e-06,
-    c41=-1.743e-08,
-    c32=-1.245e-06,
-    c23=3.575e-07,
-    c14=3.257e-07,
-    c05=-6.216e-08);
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end p_dT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+record p_dT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=6.038e+07,
+    c10=6.363e+05,
+    c01=-4.033e+05,
+    c20=197.5,
+    c11=-2881,
+    c02=912.4,
+    c30=-0.1172,
+    c21=-1.324,
+    c12=4.474,
+    c03=-0.8923,
+    c40=-0.003126,
+    c31=0.004181,
+    c22=-0.0001604,
+    c13=-0.002129,
+    c04=0.0003892,
+    c50=2.222e-06,
+    c41=-1.743e-08,
+    c32=-1.245e-06,
+    c23=3.575e-07,
+    c14=3.257e-07,
+    c05=-6.216e-08);
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end p_dT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/package.mo
index 9d9e53a978ca25fb4c478423f284b971da1050cb..386e3938bfb16d08d0a90b09573e329131686227 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Pressure "Polynomials of pressure"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>SurfaceTension</b> contains polynomial functions to compute pressure. </span></p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Pressure;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Pressure "Polynomials of pressure"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>SurfaceTension</b> contains polynomial functions to compute pressure. </span></p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Pressure;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/package.order
index d9dfe3ba5ed43a97882f8b5ca04f2d36164f5cd1..63c868f6c7d555f7e27a22d2a7b257fabb8005e3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/package.order
@@ -1,11 +1,11 @@
-psat1_h_coef
-psat1_h
-dpsat1h_h
-p_dT_coef
-p_dT
-dpdT_dT
-dpTd_dT
-psat_T_coef
-psat_T
-dpsatT_T
-d2psatTT_T
+psat1_h_coef
+psat1_h
+dpsat1h_h
+p_dT_coef
+p_dT
+dpdT_dT
+dpTd_dT
+psat_T_coef
+psat_T
+dpsatT_T
+d2psatTT_T
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat1_h.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat1_h.mo
index ecfdbd5fd85477d55db6aadb8fa6a87a397f497b..861e772dcb0f7ec84525d10ccf34f7a14b680034 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat1_h.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat1_h.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-function psat1_h "Saturation pressure for given specific enthalpy"
-  input Units.SI.SpecificEnthalpy h "Enthalpy";
-  output Units.SI.Pressure p "Pressure";
-protected
-  psat1_h_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  p := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(
-    coef, h);
-
-end psat1_h;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+function psat1_h "Saturation pressure for given specific enthalpy"
+  input Units.SI.SpecificEnthalpy h "Enthalpy";
+  output Units.SI.Pressure p "Pressure";
+protected
+  psat1_h_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  p := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(
+    coef, h);
+
+end psat1_h;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat1_h_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat1_h_coef.mo
index a453fc35daa00721bcf13e7aad26979d8c506ee4..9f7a2e56543da310ed7480dacfa604b8b7ebe652 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat1_h_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat1_h_coef.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-record psat1_h_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
-    c5=-3.796712e-24,
-    c4=1.178722e-17,
-    c3=-5.695964e-12,
-    c2=-3.306483e-07,
-    c1=1.014721e+00,
-    c0=-1.181642e+05);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end psat1_h_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+record psat1_h_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
+    c5=-3.796712e-24,
+    c4=1.178722e-17,
+    c3=-5.695964e-12,
+    c2=-3.306483e-07,
+    c1=1.014721e+00,
+    c0=-1.181642e+05);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end psat1_h_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat_T.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat_T.mo
index 9c6b07a594b0d67fb568bfaf179a8b47bf785a5a..c96443fca4029d3e44f6ed3e566287018cc0e3c0 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat_T.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat_T.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-function psat_T "Saturation pressure for given temperature"
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.Pressure p "Pressure";
-protected
-  psat_T_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  p := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(
-    coef, T);
-
-end psat_T;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+function psat_T "Saturation pressure for given temperature"
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.Pressure p "Pressure";
+protected
+  psat_T_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  p := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(
+    coef, T);
+
+end psat_T;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat_T_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat_T_coef.mo
index ba1b9101f3df5b9a1aad417a4240383d6d8ceb97..4e750bca9f269bc5fb1b6ac7757f194e9c2eafaa 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat_T_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Pressure/psat_T_coef.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
-record psat_T_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
-    c7=7.677448367806697e-11,
-    c6=-2.327974895639335e-07,
-    c5=2.984399245658974e-04,
-    c4=-2.081210501212062e-01,
-    c3=8.527291155079814e+01,
-    c2=-2.055993982138471e+04,
-    c1=2.704822454027627e+06,
-    c0=-1.499284498173245e+08);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end psat_T_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Pressure;
+record psat_T_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
+    c7=7.677448367806697e-11,
+    c6=-2.327974895639335e-07,
+    c5=2.984399245658974e-04,
+    c4=-2.081210501212062e-01,
+    c3=8.527291155079814e+01,
+    c2=-2.055993982138471e+04,
+    c1=2.704822454027627e+06,
+    c0=-1.499284498173245e+08);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end psat_T_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/PropThermoSat.mo b/ThermoSysPro/Properties/WaterSteamSimple/PropThermoSat.mo
index 09b9cb965aad9ecbb305b6b9adc6547d5bca333d..c7dd596634a37884e3c3598feb27add23e4c414b 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/PropThermoSat.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/PropThermoSat.mo
@@ -1,37 +1,37 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-record PropThermoSat
-  Units.SI.AbsolutePressure P "Pressure";
-  Units.SI.Temperature T "Temperature";
-  Units.SI.Density rho "Density";
-  Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  Units.SI.SpecificHeatCapacity cp "Specific heat capacity at constant pressure";
-  Real pt "Derivative of pressure wrt. temperature";
-  Units.SI.SpecificHeatCapacity cv "Specific heat capacity at constant volume";
-  annotation (
-    Window(
-      x=0.15,
-      y=0.32,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,50},{100,-100}},
-          lineColor={28,108,200},
-          fillColor={255,255,127},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-127,115},{127,55}}, textString=
-                                               "%name"),
-        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-        Line(points={{-100,0},{100,0}}, color={0,0,0}),
-        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-    Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end PropThermoSat;
+within ThermoSysPro.Properties.WaterSteamSimple;
+record PropThermoSat
+  Units.SI.AbsolutePressure P "Pressure";
+  Units.SI.Temperature T "Temperature";
+  Units.SI.Density rho "Density";
+  Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  Units.SI.SpecificHeatCapacity cp "Specific heat capacity at constant pressure";
+  Real pt "Derivative of pressure wrt. temperature";
+  Units.SI.SpecificHeatCapacity cv "Specific heat capacity at constant volume";
+  annotation (
+    Window(
+      x=0.15,
+      y=0.32,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,50},{100,-100}},
+          lineColor={28,108,200},
+          fillColor={255,255,127},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-127,115},{127,55}}, textString=
+                                               "%name"),
+        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+        Line(points={{-100,0},{100,0}}, color={0,0,0}),
+        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+    Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end PropThermoSat;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/DynamicViscosity_rhoT.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/DynamicViscosity_rhoT.mo
index df753c0aaa449e4391c525aa62f852a56635f5ec..41221af0af5af6e6c32df890ab947efba56b9e52 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/DynamicViscosity_rhoT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/DynamicViscosity_rhoT.mo
@@ -1,64 +1,64 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function DynamicViscosity_rhoT
-  input Units.SI.Density rho "Density";
-  input Units.SI.Temperature T "Temperature";
-
-  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
-
-protected
-  Units.SI.Density d1sat;
-  Units.SI.Density d2sat;
-  Real x;
-
-algorithm
-  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1sat_T(T);
-  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2sat_T(T);
-  if T < ThermoSysPro.Properties.WaterSteamSimple.critical.TCRIT then
-    if rho > d1sat then
-      mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(rho, T);
-    elseif rho < d2sat then
-      mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(rho, T);
-    else
-       x := (rho-d1sat)/(d2sat - d1sat);
-         mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(d1sat, T)*(1 - x)
-               + ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(d2sat, T)*x;
-    end if;
-  else
-    if rho > ThermoSysPro.Properties.WaterSteamSimple.critical.DCRIT then
-      mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(rho, T);
-    else
-      mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(rho, T);
-    end if;
-  end if;
-
-  annotation (
-    smoothOrder=2,
-    Window(
-      x=0.34,
-      y=0.34,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end DynamicViscosity_rhoT;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function DynamicViscosity_rhoT
+  input Units.SI.Density rho "Density";
+  input Units.SI.Temperature T "Temperature";
+
+  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
+
+protected
+  Units.SI.Density d1sat;
+  Units.SI.Density d2sat;
+  Real x;
+
+algorithm
+  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1sat_T(T);
+  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2sat_T(T);
+  if T < ThermoSysPro.Properties.WaterSteamSimple.critical.TCRIT then
+    if rho > d1sat then
+      mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(rho, T);
+    elseif rho < d2sat then
+      mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(rho, T);
+    else
+       x := (rho-d1sat)/(d2sat - d1sat);
+         mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(d1sat, T)*(1 - x)
+               + ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(d2sat, T)*x;
+    end if;
+  else
+    if rho > ThermoSysPro.Properties.WaterSteamSimple.critical.DCRIT then
+      mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(rho, T);
+    else
+      mu := ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(rho, T);
+    end if;
+  end if;
+
+  annotation (
+    smoothOrder=2,
+    Window(
+      x=0.34,
+      y=0.34,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end DynamicViscosity_rhoT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Pressure_sat_hl.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Pressure_sat_hl.mo
index a7dd4aa1ce9d4d2073d0b10dc2e87d6af9b25f3a..0bb37c8c8d02cce8c3b32b20d648afe7881bb582 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Pressure_sat_hl.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Pressure_sat_hl.mo
@@ -1,41 +1,41 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function Pressure_sat_hl
-  input Units.SI.SpecificEnthalpy hl "Liquid specific enthalpy on the saturation line";
-
-  output Units.SI.AbsolutePressure p "Liquid pressure on the saturation line";
-
-algorithm
-  assert(hl > ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(
-    ThermoSysPro.Properties.WaterSteamSimple.triple.ptriple),
-    "Pressure_sat_hl called with too low specific enthalpy (below triple point)");
-  assert(hl < ThermoSysPro.Properties.WaterSteamSimple.critical.HCRIT,
-    "Pressure_sat_hl called with too high specific enthalpy (above critical point)");
-
-  p := ThermoSysPro.Properties.WaterSteamSimple.Pressure.psat1_h(hl);
-  annotation (
-    derivative = Pressure_sat_hl_der,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Version 1.2</b> </p>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro_AJ Version 2.0</b></p>
-</HTML>
-"));
-end Pressure_sat_hl;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function Pressure_sat_hl
+  input Units.SI.SpecificEnthalpy hl "Liquid specific enthalpy on the saturation line";
+
+  output Units.SI.AbsolutePressure p "Liquid pressure on the saturation line";
+
+algorithm
+  assert(hl > ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(
+    ThermoSysPro.Properties.WaterSteamSimple.triple.ptriple),
+    "Pressure_sat_hl called with too low specific enthalpy (below triple point)");
+  assert(hl < ThermoSysPro.Properties.WaterSteamSimple.critical.HCRIT,
+    "Pressure_sat_hl called with too high specific enthalpy (above critical point)");
+
+  p := ThermoSysPro.Properties.WaterSteamSimple.Pressure.psat1_h(hl);
+  annotation (
+    derivative = Pressure_sat_hl_der,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Version 1.2</b> </p>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro_AJ Version 2.0</b></p>
+</HTML>
+"));
+end Pressure_sat_hl;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Pressure_sat_hl_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Pressure_sat_hl_der.mo
index 42fda2285fa6dd426dafcd2834e66147ecc50cde..2810027809e27bb20c2279f35f9e6fd51238cdb2 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Pressure_sat_hl_der.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Pressure_sat_hl_der.mo
@@ -1,42 +1,42 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function Pressure_sat_hl_der
-  input Units.SI.SpecificEnthalpy hl "Liquid specific enthalpy on the saturation line";
-  input Real hl_der;
-
-  output Real p_der;
-
-algorithm
-  assert(hl > ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(
-    ThermoSysPro.Properties.WaterSteamSimple.triple.ptriple),
-    "Pressure_sat_hl_der called with too low specific enthalpy (below triple point)");
-  assert(hl < ThermoSysPro.Properties.WaterSteamSimple.critical.HCRIT,
-    "Pressure_sat_hl_der called with too high specific enthalpy (above critical point)");
-
-  p_der := hl_der*ThermoSysPro.Properties.WaterSteamSimple.Pressure.dpsat1h_h(hl);
-annotation (
-  Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                             "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-             "fonction")}),
-  Documentation(info="<html>
-<p><b>Version 1.2</b> </p>
-<p>Needs to be redone. Iterative functions don&apos;t work for Analytic Jacobian</p>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro_AJ Version 2.0</b></p>
-</HTML>
-"));
-end Pressure_sat_hl_der;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function Pressure_sat_hl_der
+  input Units.SI.SpecificEnthalpy hl "Liquid specific enthalpy on the saturation line";
+  input Real hl_der;
+
+  output Real p_der;
+
+algorithm
+  assert(hl > ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(
+    ThermoSysPro.Properties.WaterSteamSimple.triple.ptriple),
+    "Pressure_sat_hl_der called with too low specific enthalpy (below triple point)");
+  assert(hl < ThermoSysPro.Properties.WaterSteamSimple.critical.HCRIT,
+    "Pressure_sat_hl_der called with too high specific enthalpy (above critical point)");
+
+  p_der := hl_der*ThermoSysPro.Properties.WaterSteamSimple.Pressure.dpsat1h_h(hl);
+annotation (
+  Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                             "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+             "fonction")}),
+  Documentation(info="<html>
+<p><b>Version 1.2</b> </p>
+<p>Needs to be redone. Iterative functions don&apos;t work for Analytic Jacobian</p>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro_AJ Version 2.0</b></p>
+</HTML>
+"));
+end Pressure_sat_hl_der;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT.mo
index 4a2dcf4d77b056cb7c69807c23fdaa4770ef422a..f3f07c5a4556491ebb0973777ae116f3cd694ed3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT.mo
@@ -1,48 +1,48 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function SpecificEnthalpy_PT
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  input Integer mode = 0 "IF97 region. 0:automatic";
-
-  output Units.SI.SpecificEnthalpy H "Specific enthalpy";
-
-protected
-  Integer region;
-  Boolean supercritical;
-
-algorithm
-  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
-
-  region := ThermoSysPro.Properties.WaterSteamSimple.region_pT(p, T, mode);
-
-  if (region == 1) then
-    H := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1_PT(p, T);
-  elseif (region == 2) then
-    H := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2_PT(p, T);
-  else
-    assert(false, "Water_PT: Incorrect region number");
-  end if;
-
-  annotation (
-    derivative(noDerivative=mode) = SpecificEnthalpy_PT_der,
-    Icon(graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end SpecificEnthalpy_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function SpecificEnthalpy_PT
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  input Integer mode = 0 "IF97 region. 0:automatic";
+
+  output Units.SI.SpecificEnthalpy H "Specific enthalpy";
+
+protected
+  Integer region;
+  Boolean supercritical;
+
+algorithm
+  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
+
+  region := ThermoSysPro.Properties.WaterSteamSimple.region_pT(p, T, mode);
+
+  if (region == 1) then
+    H := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1_PT(p, T);
+  elseif (region == 2) then
+    H := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2_PT(p, T);
+  else
+    assert(false, "Water_PT: Incorrect region number");
+  end if;
+
+  annotation (
+    derivative(noDerivative=mode) = SpecificEnthalpy_PT_der,
+    Icon(graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end SpecificEnthalpy_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT_der.mo
index bec128a1198119a8c28ed53f50e595fb9b4361c3..ec4f385f2e94f737b23dbb3ef1a2b8dbc7a8df2a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT_der.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT_der.mo
@@ -1,58 +1,58 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function SpecificEnthalpy_PT_der
-  input Units.SI.AbsolutePressure p "pressure";
-  input Units.SI.Temperature T "Temperature";
-  input Integer mode = 0 "Région IF97 - 0:calcul automatique";
-
-  input Real p_der "Pression";
-  input Real T_der "Température";
-
-  output Real h_der "specific enthalpy";
-
-protected
-  Integer region;
-  Boolean supercritical;
-  Real dhp;
-  Real dhT;
-
-algorithm
-  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
-
-  region := ThermoSysPro.Properties.WaterSteamSimple.region_pT(p, T, mode);
-
-  // Partial derivatives
-  if (region == 1) then
-    dhp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1pT_PT(p, T);
-    dhT := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1Tp_PT(p, T);
-  elseif (region == 2) then
-    dhp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2pT_PT(p, T);
-    dhT := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2Tp_PT(p, T);
-  else
-    assert(false, "Water_PT: Incorrect region number");
-  end if;
-
-  // Temporal derivative
-  h_der:=dhp*p_der + dhT*T_der;
-
-  annotation (
-    Icon(graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end SpecificEnthalpy_PT_der;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function SpecificEnthalpy_PT_der
+  input Units.SI.AbsolutePressure p "pressure";
+  input Units.SI.Temperature T "Temperature";
+  input Integer mode = 0 "Région IF97 - 0:calcul automatique";
+
+  input Real p_der "Pression";
+  input Real T_der "Température";
+
+  output Real h_der "specific enthalpy";
+
+protected
+  Integer region;
+  Boolean supercritical;
+  Real dhp;
+  Real dhT;
+
+algorithm
+  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
+
+  region := ThermoSysPro.Properties.WaterSteamSimple.region_pT(p, T, mode);
+
+  // Partial derivatives
+  if (region == 1) then
+    dhp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1pT_PT(p, T);
+    dhT := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1Tp_PT(p, T);
+  elseif (region == 2) then
+    dhp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2pT_PT(p, T);
+    dhT := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2Tp_PT(p, T);
+  else
+    assert(false, "Water_PT: Incorrect region number");
+  end if;
+
+  // Temporal derivative
+  h_der:=dhp*p_der + dhT*T_der;
+
+  annotation (
+    Icon(graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end SpecificEnthalpy_PT_der;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SurfaceTension_T.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SurfaceTension_T.mo
index 03d62994d7f06c8dff59bc15e1196a506c83ee60..a8071b9e5bcb952513657e5f2006dfba72b4276a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SurfaceTension_T.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SurfaceTension_T.mo
@@ -1,40 +1,40 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function SurfaceTension_T
-  input Units.SI.Temperature T "Temperature";
-
-  output Units.SI.SurfaceTension sigma "Surface tension";
-
-algorithm
-  sigma := ThermoSysPro.Properties.WaterSteamSimple.SurfaceTension.SurfaceTension_T(T);
-
-  annotation (
-    smoothOrder=2,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Window(
-      x=0.33,
-      y=0.34,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end SurfaceTension_T;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function SurfaceTension_T
+  input Units.SI.Temperature T "Temperature";
+
+  output Units.SI.SurfaceTension sigma "Surface tension";
+
+algorithm
+  sigma := ThermoSysPro.Properties.WaterSteamSimple.SurfaceTension.SurfaceTension_T(T);
+
+  annotation (
+    smoothOrder=2,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Window(
+      x=0.33,
+      y=0.34,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end SurfaceTension_T;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/ThermalConductivity_rhoT.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/ThermalConductivity_rhoT.mo
index f4a551f80714a7e1671ff1b5d2579b50c4f51a12..f04086b9f4e727f9c669d89866282d91069f9866 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/ThermalConductivity_rhoT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/ThermalConductivity_rhoT.mo
@@ -1,56 +1,56 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function ThermalConductivity_rhoT
-  input Units.SI.Density rho "Density";
-  input Units.SI.Temperature T "Temperature";
-
-  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
-
-protected
-  Units.SI.Density d1sat;
-  Units.SI.Density d2sat;
-  Real x;
-
-algorithm
-  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1sat_T(T);
-  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2sat_T(T);
-
-  if rho > d1sat then
-    lambda := ThermoSysPro.Properties.WaterSteamSimple.Conductivity.lambda1_dT(rho, T);
-  elseif rho < d2sat then
-    lambda := ThermoSysPro.Properties.WaterSteamSimple.Conductivity.lambda2_dT(rho, T);
-  else
-     x := (rho-d1sat)/(d2sat - d1sat);
-    lambda := ThermoSysPro.Properties.WaterSteamSimple.Conductivity.lambda1_dT(d1sat, T)*(1 - x)
-              + ThermoSysPro.Properties.WaterSteamSimple.Conductivity.lambda2_dT(d2sat, T)*x;
-  end if;
-  annotation (
-    smoothOrder=2,
-    Window(
-      x=0.34,
-      y=0.34,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end ThermalConductivity_rhoT;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function ThermalConductivity_rhoT
+  input Units.SI.Density rho "Density";
+  input Units.SI.Temperature T "Temperature";
+
+  output Units.SI.ThermalConductivity lambda "Thermal conductivity";
+
+protected
+  Units.SI.Density d1sat;
+  Units.SI.Density d2sat;
+  Real x;
+
+algorithm
+  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1sat_T(T);
+  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2sat_T(T);
+
+  if rho > d1sat then
+    lambda := ThermoSysPro.Properties.WaterSteamSimple.Conductivity.lambda1_dT(rho, T);
+  elseif rho < d2sat then
+    lambda := ThermoSysPro.Properties.WaterSteamSimple.Conductivity.lambda2_dT(rho, T);
+  else
+     x := (rho-d1sat)/(d2sat - d1sat);
+    lambda := ThermoSysPro.Properties.WaterSteamSimple.Conductivity.lambda1_dT(d1sat, T)*(1 - x)
+              + ThermoSysPro.Properties.WaterSteamSimple.Conductivity.lambda2_dT(d2sat, T)*x;
+  end if;
+  annotation (
+    smoothOrder=2,
+    Window(
+      x=0.34,
+      y=0.34,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end ThermalConductivity_rhoT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_PT.mo
index 1e6673924d095c190394eb672caf51a5f51aa694..479543c1ad549e5509633dd628cddbfb64ad8cc8 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_PT.mo
@@ -1,47 +1,47 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function Water_PT
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  input Integer mode=0 "IF97 region. 0:automatic";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_pT pro;
-
-protected
-  Integer region;
-  Boolean supercritical;
-
-algorithm
-  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
-
-  region := ThermoSysPro.Properties.WaterSteamSimple.region_pT(p, T, mode);
-
-  if (region == 1) then
-    ThermoSysPro.Properties.WaterSteamSimple.prop1_PT(p, T);
-  elseif (region == 2) then
-    ThermoSysPro.Properties.WaterSteamSimple.prop2_PT(p, T);
-  else
-    assert(false, "Water_PT: Incorrect region number");
-  end if;
-
-  annotation (
-    Icon(graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Water_PT;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function Water_PT
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  input Integer mode=0 "IF97 region. 0:automatic";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_pT pro;
+
+protected
+  Integer region;
+  Boolean supercritical;
+
+algorithm
+  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
+
+  region := ThermoSysPro.Properties.WaterSteamSimple.region_pT(p, T, mode);
+
+  if (region == 1) then
+    ThermoSysPro.Properties.WaterSteamSimple.prop1_PT(p, T);
+  elseif (region == 2) then
+    ThermoSysPro.Properties.WaterSteamSimple.prop2_PT(p, T);
+  else
+    assert(false, "Water_PT: Incorrect region number");
+  end if;
+
+  annotation (
+    Icon(graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Water_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph.mo
index 05ccbbd39668cf4d651e9e62a3bfe52c2dc11511..90913ac3f09f6508519a5dc31efb7b0e06cc5a72 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph.mo
@@ -1,64 +1,64 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function Water_Ph
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer mode = 0 "IF97 region. 0:automatic";
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-90,15},{-43.3333,61.6667}},
-          rotation=0)));
-
-  //Integer phase;
-protected
-  Integer  region;
-
-algorithm
-  //phase := ThermoSysPro.Properties.WaterSteamSimple.phase_ph(p,h);
- // region :=ThermoSysPro.Properties.WaterSteamSimple.region_ph(p,h,phase,mode);
-  region := ThermoSysPro.Properties.WaterSteamSimple.region_ph(
-    p,
-    h,
-    mode);
-
-  if (region == 1) then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.prop1_Ph(p, h);
-  elseif (region == 2) then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.prop2_Ph(p, h);
-  elseif (region == 4) then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.prop4_Ph(p, h);
-  else
-    assert(false, "Water_Ph: Incorrect region number (" + String(region) + ")");
-  end if;
-
-  //derivative(noDerivative=mode) = ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph_der,
-
-  annotation (
-  derivative(noDerivative=mode) = ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph_der,
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Window(
-      x=0.06,
-      y=0.1,
-      width=0.75,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Water_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function Water_Ph
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer mode = 0 "IF97 region. 0:automatic";
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-90,15},{-43.3333,61.6667}},
+          rotation=0)));
+
+  //Integer phase;
+protected
+  Integer  region;
+
+algorithm
+  //phase := ThermoSysPro.Properties.WaterSteamSimple.phase_ph(p,h);
+ // region :=ThermoSysPro.Properties.WaterSteamSimple.region_ph(p,h,phase,mode);
+  region := ThermoSysPro.Properties.WaterSteamSimple.region_ph(
+    p,
+    h,
+    mode);
+
+  if (region == 1) then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.prop1_Ph(p, h);
+  elseif (region == 2) then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.prop2_Ph(p, h);
+  elseif (region == 4) then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.prop4_Ph(p, h);
+  else
+    assert(false, "Water_Ph: Incorrect region number (" + String(region) + ")");
+  end if;
+
+  //derivative(noDerivative=mode) = ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph_der,
+
+  annotation (
+  derivative(noDerivative=mode) = ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph_der,
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Window(
+      x=0.06,
+      y=0.1,
+      width=0.75,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Water_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph_der.mo
index e218c375df464b181c81a516ac23e16d4d0ac8de..76d5c490dd1a2b0124883d5ca7d794b0e74f2ddb 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph_der.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph_der.mo
@@ -1,60 +1,60 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function Water_Ph_der "Derivative function of Water_Ph"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  input Integer mode = 0 "Région IF97 - 0:calcul automatique";
-  //input CombiPlant.ThermoFluidPro.Media.Common.IF97TwoPhaseAnalytic aux "auxiliary record";
-
-  input Real p_der "derivative of Pressure";
-  input Real h_der "derivative of Specific enthalpy";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph der_pro "Derivative";
-
-protected
-  Integer region;
- // Integer phase;
-
-algorithm
-  //phase := ThermoSysPro.Properties.WaterSteamSimple.phase_ph(p,h);
-  //region :=ThermoSysPro.Properties.WaterSteamSimple.region_ph(p,h,phase,mode);
-  region := ThermoSysPro.Properties.WaterSteamSimple.region_ph(p, h, mode);
-  if (region == 1) then
-    der_pro := ThermoSysPro.Properties.WaterSteamSimple.prop1_Ph_der(p, h, p_der, h_der);
-  elseif (region == 2) then
-    der_pro := ThermoSysPro.Properties.WaterSteamSimple.prop2_Ph_der(p, h, p_der, h_der);
-  elseif (region == 4) then
-    der_pro := ThermoSysPro.Properties.WaterSteamSimple.prop4_Ph_der(p, h, p_der, h_der);
-  else
-    assert(false, "Water_Ph: Incorrect region number (" + String(region) + ")");
-  end if;
-
-  annotation (
-    Window(
-      x=0.22,
-      y=0.2,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Water_Ph_der;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function Water_Ph_der "Derivative function of Water_Ph"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  input Integer mode = 0 "Région IF97 - 0:calcul automatique";
+  //input CombiPlant.ThermoFluidPro.Media.Common.IF97TwoPhaseAnalytic aux "auxiliary record";
+
+  input Real p_der "derivative of Pressure";
+  input Real h_der "derivative of Specific enthalpy";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph der_pro "Derivative";
+
+protected
+  Integer region;
+ // Integer phase;
+
+algorithm
+  //phase := ThermoSysPro.Properties.WaterSteamSimple.phase_ph(p,h);
+  //region :=ThermoSysPro.Properties.WaterSteamSimple.region_ph(p,h,phase,mode);
+  region := ThermoSysPro.Properties.WaterSteamSimple.region_ph(p, h, mode);
+  if (region == 1) then
+    der_pro := ThermoSysPro.Properties.WaterSteamSimple.prop1_Ph_der(p, h, p_der, h_der);
+  elseif (region == 2) then
+    der_pro := ThermoSysPro.Properties.WaterSteamSimple.prop2_Ph_der(p, h, p_der, h_der);
+  elseif (region == 4) then
+    der_pro := ThermoSysPro.Properties.WaterSteamSimple.prop4_Ph_der(p, h, p_der, h_der);
+  else
+    assert(false, "Water_Ph: Incorrect region number (" + String(region) + ")");
+  end if;
+
+  annotation (
+    Window(
+      x=0.22,
+      y=0.2,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Water_Ph_der;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ps.mo
index 44c3f13e512bc213c148a5ae2b0b65a2bbbca35b..dd0c0d8b9d6999514b5c046302dc29cb58d170eb 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ps.mo
@@ -1,55 +1,55 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function Water_Ps
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-  input Integer mode = 0 "IF97 region. 0:automatic";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ps pro;
-
-protected
-  Integer region;
-//  Integer phase;
-
-algorithm
-  //phase := ThermoSysPro.Properties.WaterSteamSimple.phase_ps(p, s);
-  region := ThermoSysPro.Properties.WaterSteamSimple.region_ps(p, s, mode);
-
-  if (region == 1) then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.prop1_Ps(p, s);
-  elseif (region == 2) then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.prop2_Ps(p, s);
-  elseif (region == 4) then
-    pro := ThermoSysPro.Properties.WaterSteamSimple.prop4_Ps(p, s);
-  else
-    assert(false, "Water_Ps: Incorrect region number (" + String(region) + ")");
-  end if;
-  annotation (
-    Window(
-      x=0.22,
-      y=0.2,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Water_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function Water_Ps
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+  input Integer mode = 0 "IF97 region. 0:automatic";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ps pro;
+
+protected
+  Integer region;
+//  Integer phase;
+
+algorithm
+  //phase := ThermoSysPro.Properties.WaterSteamSimple.phase_ps(p, s);
+  region := ThermoSysPro.Properties.WaterSteamSimple.region_ps(p, s, mode);
+
+  if (region == 1) then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.prop1_Ps(p, s);
+  elseif (region == 2) then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.prop2_Ps(p, s);
+  elseif (region == 4) then
+    pro := ThermoSysPro.Properties.WaterSteamSimple.prop4_Ps(p, s);
+  else
+    assert(false, "Water_Ps: Incorrect region number (" + String(region) + ")");
+  end if;
+  annotation (
+    Window(
+      x=0.22,
+      y=0.2,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Water_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_sat_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_sat_P.mo
index 6b7d032d3734d086d19eb10759574c632c724974..1e1a1ff3d76a2b32ee44d55a2fcf561131e5c4af 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_sat_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_sat_P.mo
@@ -1,49 +1,49 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function Water_sat_P
-  input Units.SI.AbsolutePressure p "Pressure";
-
-protected
-  Units.SI.Temperature T;
-
-  // Use ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat
-  // instead of ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat
-  // to be compatible with OpenModelica
-public
-  output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=0)));
-  output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-    annotation (Placement(transformation(extent={{15,15},{85,85}}, rotation=0)));
-algorithm
-  lsat := ThermoSysPro.Properties.WaterSteamSimple.propsat1_P(p);
-  vsat := ThermoSysPro.Properties.WaterSteamSimple.propsat2_P(p);
-  annotation (
-    derivative = Water_sat_P_der,
-    Window(
-      x=0.34,
-      y=0.21,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Water_sat_P;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function Water_sat_P
+  input Units.SI.AbsolutePressure p "Pressure";
+
+protected
+  Units.SI.Temperature T;
+
+  // Use ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat
+  // instead of ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat
+  // to be compatible with OpenModelica
+public
+  output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=0)));
+  output ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+    annotation (Placement(transformation(extent={{15,15},{85,85}}, rotation=0)));
+algorithm
+  lsat := ThermoSysPro.Properties.WaterSteamSimple.propsat1_P(p);
+  vsat := ThermoSysPro.Properties.WaterSteamSimple.propsat2_P(p);
+  annotation (
+    derivative = Water_sat_P_der,
+    Window(
+      x=0.34,
+      y=0.21,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Water_sat_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_sat_P_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_sat_P_der.mo
index d42f08e54592958664a77c0aa902ce201f065c89..4eec49bd0a02901e01a36bf5862337a8a1fdf51a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_sat_P_der.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_sat_P_der.mo
@@ -1,43 +1,43 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
-function Water_sat_P_der
-  input Units.SI.AbsolutePressure p "Pression";
-  input Real p_der "derivative of pressure";
-
-public
-  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat dlsat
-    annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=0)));
-  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat dvsat
-    annotation (Placement(transformation(extent={{15,15},{85,85}}, rotation=0)));
-algorithm
-  dlsat := ThermoSysPro.Properties.WaterSteamSimple.propsat1_P_der(p, p_der);
-  dvsat := ThermoSysPro.Properties.WaterSteamSimple.propsat2_P_der(p, p_der);
-  annotation (
-    Window(
-      x=0.34,
-      y=0.21,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(extent={{-134,104},{142,44}}, textString=
-                                               "%name"),
-        Ellipse(
-          extent={{-100,40},{100,-100}},
-          lineColor={255,127,0},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-84,-4},{84,-52}},
-          lineColor={255,127,0},
-          textString=
-               "fonction")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end Water_sat_P_der;
+within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater;
+function Water_sat_P_der
+  input Units.SI.AbsolutePressure p "Pression";
+  input Real p_der "derivative of pressure";
+
+public
+  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat dlsat
+    annotation (Placement(transformation(extent={{-85,15},{-15,85}}, rotation=0)));
+  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat dvsat
+    annotation (Placement(transformation(extent={{15,15},{85,85}}, rotation=0)));
+algorithm
+  dlsat := ThermoSysPro.Properties.WaterSteamSimple.propsat1_P_der(p, p_der);
+  dvsat := ThermoSysPro.Properties.WaterSteamSimple.propsat2_P_der(p, p_der);
+  annotation (
+    Window(
+      x=0.34,
+      y=0.21,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(extent={{-134,104},{142,44}}, textString=
+                                               "%name"),
+        Ellipse(
+          extent={{-100,40},{100,-100}},
+          lineColor={255,127,0},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-84,-4},{84,-52}},
+          lineColor={255,127,0},
+          textString=
+               "fonction")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end Water_sat_P_der;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/package.mo
index a44fe7777eb02af34a36ff7f7dd33fbc605dde6b..2bdaedcdc12cc8f527a43e26940d372fe4c829bb 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/package.mo
@@ -1,135 +1,135 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package SimpleWater
-
-
-
-  annotation (
-    Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}),
-    Window(
-      x=0.05,
-      y=0.51,
-      width=0.25,
-      height=0.26,
-      library=1,
-      autolayout=1),
-    Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>SimpleWater</b> contains functions to compute thermodynamics properties. </span></p>
-</html>"));
-end SimpleWater;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package SimpleWater
+
+
+
+  annotation (
+    Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}),
+    Window(
+      x=0.05,
+      y=0.51,
+      width=0.25,
+      height=0.26,
+      library=1,
+      autolayout=1),
+    Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>SimpleWater</b> contains functions to compute thermodynamics properties. </span></p>
+</html>"));
+end SimpleWater;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/package.order b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/package.order
index 82a96527a751d2f36259d478256819480a8b72a7..b94c23977f8b95f9df09e3e1e522963850e22ab9 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/package.order
@@ -1,13 +1,13 @@
-Water_Ph
-Water_Ps
-Water_PT
-Water_sat_P
-DynamicViscosity_rhoT
-ThermalConductivity_rhoT
-SurfaceTension_T
-SpecificEnthalpy_PT
-Pressure_sat_hl
-Pressure_sat_hl_der
-Water_Ph_der
-Water_sat_P_der
-SpecificEnthalpy_PT_der
+Water_Ph
+Water_Ps
+Water_PT
+Water_sat_P
+DynamicViscosity_rhoT
+ThermalConductivity_rhoT
+SurfaceTension_T
+SpecificEnthalpy_PT
+Pressure_sat_hl
+Pressure_sat_hl_der
+Water_Ph_der
+Water_sat_P_der
+SpecificEnthalpy_PT_der
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/SurfaceTension_T.mo b/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/SurfaceTension_T.mo
index ba5790ea425d57b3357130056b309466506f0473..608997049c902d7a0f51bf7167cebeb968810242 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/SurfaceTension_T.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/SurfaceTension_T.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SurfaceTension;
-function SurfaceTension_T "Surface tension for given temperature"
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.SurfaceTension sigma "Surface tension";
-protected
-  SurfaceTension_T_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  sigma :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(coef,
-    T);
-
-end SurfaceTension_T;
+within ThermoSysPro.Properties.WaterSteamSimple.SurfaceTension;
+function SurfaceTension_T "Surface tension for given temperature"
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.SurfaceTension sigma "Surface tension";
+protected
+  SurfaceTension_T_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  sigma :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order5(coef,
+    T);
+
+end SurfaceTension_T;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/SurfaceTension_T_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/SurfaceTension_T_coef.mo
index e475d3b38e443a110d50552113ee8c6406c04d8d..ef6749a30e73b3e86f07949399864beca3a1cc14 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/SurfaceTension_T_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/SurfaceTension_T_coef.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.SurfaceTension;
-record SurfaceTension_T_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
-    c5=1.375111e-14,
-    c4=-2.834172e-11,
-    c3=2.324307e-08,
-    c2=-9.664378e-06,
-    c1=1.868712e-03,
-    c0=-5.047045e-02);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end SurfaceTension_T_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.SurfaceTension;
+record SurfaceTension_T_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5(
+    c5=1.375111e-14,
+    c4=-2.834172e-11,
+    c3=2.324307e-08,
+    c2=-9.664378e-06,
+    c1=1.868712e-03,
+    c0=-5.047045e-02);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end SurfaceTension_T_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/package.mo
index 88000e9e9443fdce4670c0e29a8521da901d3308..d4b152a99069d647a44c1b0af49d3ceae087238a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package SurfaceTension "Polynomials of surface tension"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b>Package description</b> </p>
-<p>Package <b>SurfaceTension</b> contains polynomial functions to compute surface tension. </p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end SurfaceTension;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package SurfaceTension "Polynomials of surface tension"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b>Package description</b> </p>
+<p>Package <b>SurfaceTension</b> contains polynomial functions to compute surface tension. </p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end SurfaceTension;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/package.order b/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/package.order
index a6e2a2d5199507894847f00e04863f9c46547eb9..7a8efd4626e259b74209818cb4d8232b50b80732 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/SurfaceTension/package.order
@@ -1,2 +1,2 @@
-SurfaceTension_T_coef
-SurfaceTension_T
+SurfaceTension_T_coef
+SurfaceTension_T
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T1_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T1_Ph.mo
index e0db785f56bd9be3ac97026e9a14b50b1fcb4a4a..2c88270c836cc898612aa7eabf5f7b5d2a3a49d6 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T1_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T1_Ph.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-function T1_Ph "Temperature in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.Temperature T "Temperature";
-
-protected
-  T1_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  T := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(coef, p, h);
-
-end T1_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+function T1_Ph "Temperature in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.Temperature T "Temperature";
+
+protected
+  T1_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  T := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(coef, p, h);
+
+end T1_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T1_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T1_Ph_coef.mo
index 29fd6bec78bb73470a0bf6d7805aaaf97d7dd84f..bf41df153237b8c7b6a93233acb46c3cbcc8d462 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T1_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T1_Ph_coef.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-record T1_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=2.717696e+02,
-    c10=-2.672714e-07,
-    c01=2.545454e-04,
-    c20=-4.619256e-16,
-    c11=2.760164e-13,
-    c02=-2.374125e-11);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end T1_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+record T1_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=2.717696e+02,
+    c10=-2.672714e-07,
+    c01=2.545454e-04,
+    c20=-4.619256e-16,
+    c11=2.760164e-13,
+    c02=-2.374125e-11);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end T1_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T2_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T2_Ph.mo
index f4625679557f0dc00e02c29e39a5ff0cd488259c..f626e0840b0707eaf67ef6b5604f4d37d22739d2 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T2_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T2_Ph.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-function T2_Ph "Temperature in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Units.SI.Temperature T "Temperature";
-protected
-  T2_Ph_coef coef
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  T := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    h);
-
-end T2_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+function T2_Ph "Temperature in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Units.SI.Temperature T "Temperature";
+protected
+  T2_Ph_coef coef
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  T := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    h);
+
+end T2_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T2_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T2_Ph_coef.mo
index c9984740dc2f55c5339002186c29fb25fa14a469..56e7307ebdf229aee615638b0dd45de53492ae41 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T2_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/T2_Ph_coef.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-record T2_Ph_coef
-  extends Modelica.Icons.Record;
-
-   extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=-388.7,
-    c10=0.0001269,
-    c01=-3.105e-05,
-    c20=-2.383e-12,
-    c11=-5.914e-11,
-    c02=1.593e-10,
-    c30=1.476e-20,
-    c21=1.103e-18,
-    c12=7.178e-18,
-    c03=-1.012e-17,
-    c40=-3.495e-29,
-    c31=-4.88e-27,
-    c22=-1.604e-25,
-    c13=1.829e-25,
-    c04=-2.691e-24,
-    c50=1.04e-38,
-    c41=6.524e-36,
-    c32=3.839e-34,
-    c23=7.204e-33,
-    c14=-5.351e-32,
-    c05=2.963e-31);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end T2_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+record T2_Ph_coef
+  extends Modelica.Icons.Record;
+
+   extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=-388.7,
+    c10=0.0001269,
+    c01=-3.105e-05,
+    c20=-2.383e-12,
+    c11=-5.914e-11,
+    c02=1.593e-10,
+    c30=1.476e-20,
+    c21=1.103e-18,
+    c12=7.178e-18,
+    c03=-1.012e-17,
+    c40=-3.495e-29,
+    c31=-4.88e-27,
+    c22=-1.604e-25,
+    c13=1.829e-25,
+    c04=-2.691e-24,
+    c50=1.04e-38,
+    c41=6.524e-36,
+    c32=3.839e-34,
+    c23=7.204e-33,
+    c14=-5.351e-32,
+    c05=2.963e-31);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end T2_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/Tsat_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/Tsat_P.mo
index ec6d0f11f5d45a605913869db01ffe615d069366..13d48adf1a25d15e99d0d671405d9c4758f4f524 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/Tsat_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/Tsat_P.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-function Tsat_P "temperature at saturation for given pressure"
-  input Units.SI.AbsolutePressure p "Pressure";
-  output Units.SI.Temperature T "Temperature";
-protected
-  Tsat_P_coef coef annotation (Placement(transformation(extent={{-100,
-            80},{-80,100}})));
-algorithm
-
-  T := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(coef, p);
-
-end Tsat_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+function Tsat_P "temperature at saturation for given pressure"
+  input Units.SI.AbsolutePressure p "Pressure";
+  output Units.SI.Temperature T "Temperature";
+protected
+  Tsat_P_coef coef annotation (Placement(transformation(extent={{-100,
+            80},{-80,100}})));
+algorithm
+
+  T := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(coef, p);
+
+end Tsat_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/Tsat_P_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/Tsat_P_coef.mo
index 7cf9285602a4f4b768ba0d5ff127324a4608a4e9..b85a173f639a5acae982c1abcff2d820c2561558 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/Tsat_P_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/Tsat_P_coef.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-record Tsat_P_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
-    c7=6.068643e-47,
-    c6=-4.883642e-39,
-    c5=1.566811e-31,
-    c4=-2.555574e-24,
-    c3=2.238987e-17,
-    c2=-1.025730e-10,
-    c1=2.309995e-04,
-    c0=3.137379e+02);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end Tsat_P_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+record Tsat_P_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
+    c7=6.068643e-47,
+    c6=-4.883642e-39,
+    c5=1.566811e-31,
+    c4=-2.555574e-24,
+    c3=2.238987e-17,
+    c2=-1.025730e-10,
+    c1=2.309995e-04,
+    c0=3.137379e+02);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end Tsat_P_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT1hp_Ph.mo
index 87287617083bf6fa5ff79d6930e22badd9fbe2bd..be2552a97a305cd8e78cb3cba6a64776621209ee 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT1hp_Ph.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-function dT1hp_Ph "Derivative of temperature wrt. enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real dThp "Derivative of temperature wrt. specific enthalpy at constant pressure";
-protected
-  T1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dThp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(coef, p, h);
-
-end dT1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+function dT1hp_Ph "Derivative of temperature wrt. enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real dThp "Derivative of temperature wrt. specific enthalpy at constant pressure";
+protected
+  T1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dThp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(coef, p, h);
+
+end dT1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT1ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT1ph_Ph.mo
index 0e43e09ed4d3be8b591f548d195223ccd5971a34..544880e4929f3c8c73e58a4e2619f52cc83fb7dd 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT1ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT1ph_Ph.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-function dT1ph_Ph "Derivative of temperature wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dTph "Derivative of temperature wrt. pressure at constant specific enthalpy";
-
-protected
-  T1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dTph := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(coef, p, h);
-
-end dT1ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+function dT1ph_Ph "Derivative of temperature wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dTph "Derivative of temperature wrt. pressure at constant specific enthalpy";
+
+protected
+  T1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dTph := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(coef, p, h);
+
+end dT1ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT2hp_Ph.mo
index 5192bcce6df22aa381dbb272a865819c7e275aa1..17b1df82db8c0560a1d4d5d0ef7e995f45928b82 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT2hp_Ph.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-function dT2hp_Ph "Derivative of temperature wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real dThp "Derivative of temperature wrt. specific enthalpy at constant pressure";
-protected
-  T2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dThp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(coef, p, h);
-
-end dT2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+function dT2hp_Ph "Derivative of temperature wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real dThp "Derivative of temperature wrt. specific enthalpy at constant pressure";
+protected
+  T2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dThp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(coef, p, h);
+
+end dT2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT2ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT2ph_Ph.mo
index 844a70582be5c12887bf923a3f4df00edaf72698..1255013755070d7e95022e0626f065bccb67d3c1 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT2ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dT2ph_Ph.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-function dT2ph_Ph "Derivative of temperature wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output Real dTph "Derivative of temperature wrt. pressure at constant specific enthalpy";
-protected
- T2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dTph := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(coef, p, h);
-
-end dT2ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+function dT2ph_Ph "Derivative of temperature wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output Real dTph "Derivative of temperature wrt. pressure at constant specific enthalpy";
+protected
+ T2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dTph := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(coef, p, h);
+
+end dT2ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dTsatp_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dTsatp_P.mo
index d80eac77d8b6cbe1d9797a767a7ef1bdb1a58038..388cc7841c1ded7f3c9b4661a36bfb9e3a5af5ea 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dTsatp_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/dTsatp_P.mo
@@ -1,12 +1,12 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
-function dTsatp_P "Derivative of temperature at saturation wrt. pressure"
-  input Units.SI.AbsolutePressure p "Pressure";
-  output Real dTp "Derivative of temperature wrt. pressure";
-protected
-  Tsat_P_coef coef annotation (Placement(transformation(extent={{-100,
-            80},{-80,100}})));
-algorithm
-
-  dTp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(coef, p);
-
-end dTsatp_P;
+within ThermoSysPro.Properties.WaterSteamSimple.Temperature;
+function dTsatp_P "Derivative of temperature at saturation wrt. pressure"
+  input Units.SI.AbsolutePressure p "Pressure";
+  output Real dTp "Derivative of temperature wrt. pressure";
+protected
+  Tsat_P_coef coef annotation (Placement(transformation(extent={{-100,
+            80},{-80,100}})));
+algorithm
+
+  dTp := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(coef, p);
+
+end dTsatp_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/package.mo
index e08f3ad3f824c768651909b2c54ac10ec610292a..828b86d33de1848409e4580f474ac433da82968b 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Temperature "Polynomials of temperature"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Temperature</b> contains polynomial functions to compute temperature. </span></p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Temperature;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Temperature "Polynomials of temperature"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Temperature</b> contains polynomial functions to compute temperature. </span></p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Temperature;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/package.order
index 2f33e30435fcc411c8cc43467d3fc5745a0ef00c..bf00db63f448c52c4ca8f6fd99538a388fe51018 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Temperature/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Temperature/package.order
@@ -1,11 +1,11 @@
-T1_Ph_coef
-T1_Ph
-dT1ph_Ph
-dT1hp_Ph
-T2_Ph_coef
-T2_Ph
-dT2ph_Ph
-dT2hp_Ph
-Tsat_P_coef
-Tsat_P
-dTsatp_P
+T1_Ph_coef
+T1_Ph
+dT1ph_Ph
+dT1hp_Ph
+T2_Ph_coef
+T2_Ph
+dT2ph_Ph
+dT2hp_Ph
+Tsat_P_coef
+Tsat_P
+dTsatp_P
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_pT.mo b/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_pT.mo
index 992da2f6bf125e8246866774993d75f8054fd8eb..31bfae00413175810dc378f5199cf6e1bb1b149a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_pT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_pT.mo
@@ -1,60 +1,60 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-record ThermoProperties_pT
-  Units.SI.Density d(
-    min=WaterSteam.InitLimits.DMIN,
-    max=WaterSteam.InitLimits.DMAX,
-    nominal=WaterSteam.InitLimits.DNOM) "Density";
-  Units.SI.SpecificEnthalpy h(
-    min=WaterSteam.InitLimits.SHMIN,
-    max=WaterSteam.InitLimits.SHMAX,
-    nominal=WaterSteam.InitLimits.SHNOM) "Specific enthalpy";
-  Units.SI.SpecificEnergy u(
-    min=WaterSteam.InitLimits.SEMIN,
-    max=WaterSteam.InitLimits.SEMAX,
-    nominal=WaterSteam.InitLimits.SENOM) "Specific inner energy";
-  Units.SI.SpecificEntropy s(
-    min=WaterSteam.InitLimits.SSMIN,
-    max=WaterSteam.InitLimits.SSMAX,
-    nominal=WaterSteam.InitLimits.SSNOM) "Specific entropy";
-  Units.SI.SpecificHeatCapacity cp(
-    min=WaterSteam.InitLimits.CPMIN,
-    max=WaterSteam.InitLimits.CPMAX,
-    nominal=WaterSteam.InitLimits.CPNOM)
-    "Specific heat capacity at constant presure";
-  Units.SI.DerDensityByTemperature ddTp
-    "Derivative of the density wrt. temperature at constant pressure";
-  Units.SI.DerDensityByPressure ddpT
-    "Derivative of the density wrt. presure at constant temperature";
-  Units.SI.DerEnergyByPressure dupT
-    "Derivative of the inner energy wrt. pressure at constant temperature";
-  Units.SI.SpecificHeatCapacity duTp
-    "Derivative of the inner energy wrt. temperature at constant pressure";
-  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
-  annotation (
-    Window(
-      x=0.23,
-      y=0.19,
-      width=0.68,
-      height=0.71),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,50},{100,-100}},
-          lineColor={28,108,200},
-          fillColor={255,255,127},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-127,115},{127,55}}, textString=
-                                               "%name"),
-        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-        Line(points={{-100,0},{100,0}}, color={0,0,0}),
-        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-    Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end ThermoProperties_pT;
+within ThermoSysPro.Properties.WaterSteamSimple;
+record ThermoProperties_pT
+  Units.SI.Density d(
+    min=WaterSteam.InitLimits.DMIN,
+    max=WaterSteam.InitLimits.DMAX,
+    nominal=WaterSteam.InitLimits.DNOM) "Density";
+  Units.SI.SpecificEnthalpy h(
+    min=WaterSteam.InitLimits.SHMIN,
+    max=WaterSteam.InitLimits.SHMAX,
+    nominal=WaterSteam.InitLimits.SHNOM) "Specific enthalpy";
+  Units.SI.SpecificEnergy u(
+    min=WaterSteam.InitLimits.SEMIN,
+    max=WaterSteam.InitLimits.SEMAX,
+    nominal=WaterSteam.InitLimits.SENOM) "Specific inner energy";
+  Units.SI.SpecificEntropy s(
+    min=WaterSteam.InitLimits.SSMIN,
+    max=WaterSteam.InitLimits.SSMAX,
+    nominal=WaterSteam.InitLimits.SSNOM) "Specific entropy";
+  Units.SI.SpecificHeatCapacity cp(
+    min=WaterSteam.InitLimits.CPMIN,
+    max=WaterSteam.InitLimits.CPMAX,
+    nominal=WaterSteam.InitLimits.CPNOM)
+    "Specific heat capacity at constant presure";
+  Units.SI.DerDensityByTemperature ddTp
+    "Derivative of the density wrt. temperature at constant pressure";
+  Units.SI.DerDensityByPressure ddpT
+    "Derivative of the density wrt. presure at constant temperature";
+  Units.SI.DerEnergyByPressure dupT
+    "Derivative of the inner energy wrt. pressure at constant temperature";
+  Units.SI.SpecificHeatCapacity duTp
+    "Derivative of the inner energy wrt. temperature at constant pressure";
+  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
+  annotation (
+    Window(
+      x=0.23,
+      y=0.19,
+      width=0.68,
+      height=0.71),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,50},{100,-100}},
+          lineColor={28,108,200},
+          fillColor={255,255,127},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-127,115},{127,55}}, textString=
+                                               "%name"),
+        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+        Line(points={{-100,0},{100,0}}, color={0,0,0}),
+        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+    Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end ThermoProperties_pT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_ph.mo
index 855178b58d2fee35c7848e84920742ee542fa853..56ce0c36e8829cfa5ab8c61229ef7be2125253f9 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_ph.mo
@@ -1,60 +1,60 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-record ThermoProperties_ph
-  Units.SI.Temperature T(
-    min=InitLimits.TMIN,
-    max=InitLimits.TMAX,
-    nominal=InitLimits.TNOM) "Temperature";
-  Units.SI.Density d(
-    min=InitLimits.DMIN,
-    max=InitLimits.DMAX,
-    nominal=InitLimits.DNOM) "Density";
-  Units.SI.SpecificEnergy u(
-    min=InitLimits.SEMIN,
-    max=InitLimits.SEMAX,
-    nominal=InitLimits.SENOM) "Specific inner energy";
-  Units.SI.SpecificEntropy s(
-    min=InitLimits.SSMIN,
-    max=InitLimits.SSMAX,
-    nominal=InitLimits.SSNOM) "Specific entropy";
-  Units.SI.SpecificHeatCapacity cp(
-    min=InitLimits.CPMIN,
-    max=InitLimits.CPMAX,
-    nominal=InitLimits.CPNOM) "Specific heat capacity at constant presure";
-  Units.SI.DerDensityByEnthalpy ddhp
-    "Derivative of density wrt. specific enthalpy at constant pressure";
-  Units.SI.DerDensityByPressure ddph
-    "Derivative of density wrt. pressure at constant specific enthalpy";
-  Real duph(unit="m3/kg")
-    "Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
-  Real duhp(unit = "1")
-    "Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
-  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
-
-  annotation (
-    Window(
-      x=0.21,
-      y=0.32,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,50},{100,-100}},
-          lineColor={28,108,200},
-          fillColor={255,255,127},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-127,115},{127,55}}, textString=
-                                               "%name"),
-        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-        Line(points={{-100,0},{100,0}}, color={0,0,0}),
-        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-    Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-end ThermoProperties_ph;
+within ThermoSysPro.Properties.WaterSteamSimple;
+record ThermoProperties_ph
+  Units.SI.Temperature T(
+    min=InitLimits.TMIN,
+    max=InitLimits.TMAX,
+    nominal=InitLimits.TNOM) "Temperature";
+  Units.SI.Density d(
+    min=InitLimits.DMIN,
+    max=InitLimits.DMAX,
+    nominal=InitLimits.DNOM) "Density";
+  Units.SI.SpecificEnergy u(
+    min=InitLimits.SEMIN,
+    max=InitLimits.SEMAX,
+    nominal=InitLimits.SENOM) "Specific inner energy";
+  Units.SI.SpecificEntropy s(
+    min=InitLimits.SSMIN,
+    max=InitLimits.SSMAX,
+    nominal=InitLimits.SSNOM) "Specific entropy";
+  Units.SI.SpecificHeatCapacity cp(
+    min=InitLimits.CPMIN,
+    max=InitLimits.CPMAX,
+    nominal=InitLimits.CPNOM) "Specific heat capacity at constant presure";
+  Units.SI.DerDensityByEnthalpy ddhp
+    "Derivative of density wrt. specific enthalpy at constant pressure";
+  Units.SI.DerDensityByPressure ddph
+    "Derivative of density wrt. pressure at constant specific enthalpy";
+  Real duph(unit="m3/kg")
+    "Derivative of specific inner energy wrt. pressure at constant specific enthalpy";
+  Real duhp(unit = "1")
+    "Derivative of specific inner energy wrt. specific enthalpy at constant pressure";
+  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
+
+  annotation (
+    Window(
+      x=0.21,
+      y=0.32,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,50},{100,-100}},
+          lineColor={28,108,200},
+          fillColor={255,255,127},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-127,115},{127,55}}, textString=
+                                               "%name"),
+        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+        Line(points={{-100,0},{100,0}}, color={0,0,0}),
+        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+    Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+end ThermoProperties_ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_ps.mo
index 80a49131aa1b793c92aa8a3e6e0667a96ac07421..604b6cca547451a707166588d5d271c4d78270ce 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/ThermoProperties_ps.mo
@@ -1,56 +1,56 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-record ThermoProperties_ps
-  Units.SI.Temperature T(
-    min=WaterSteam.InitLimits.TMIN,
-    max=WaterSteam.InitLimits.TMAX,
-    nominal=WaterSteam.InitLimits.TNOM) "Temperature";
-  Units.SI.Density d(
-    min=WaterSteam.InitLimits.DMIN,
-    max=WaterSteam.InitLimits.DMAX,
-    nominal=WaterSteam.InitLimits.DNOM) "Density";
-  Units.SI.SpecificEnergy u(
-    min=WaterSteam.InitLimits.SEMIN,
-    max=WaterSteam.InitLimits.SEMAX,
-    nominal=WaterSteam.InitLimits.SENOM) "Specific inner energy";
-  Units.SI.SpecificEnthalpy h(
-    min=WaterSteam.InitLimits.SHMIN,
-    max=WaterSteam.InitLimits.SHMAX,
-    nominal=WaterSteam.InitLimits.SHNOM) "Specific enthalpy";
-  Units.SI.SpecificHeatCapacity cp(
-    min=WaterSteam.InitLimits.CPMIN,
-    max=WaterSteam.InitLimits.CPMAX,
-    nominal=WaterSteam.InitLimits.CPNOM)
-    "Specific heat capacity at constant pressure";
-  ThermoSysPro.Units.xSI.DerDensityByEntropy ddsp
-    "Derivative of the density wrt. specific entropy at constant pressure";
-  Units.SI.DerDensityByPressure ddps
-    "Derivative of the density wrt. pressure at constant specific entropy";
-  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
-  annotation (
-    Window(
-      x=0.31,
-      y=0.2,
-      width=0.6,
-      height=0.6),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,50},{100,-100}},
-          lineColor={28,108,200},
-          fillColor={255,255,127},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-127,115},{127,55}}, textString=
-                                               "%name"),
-        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
-        Line(points={{-100,0},{100,0}}, color={0,0,0}),
-        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
-    Documentation(info="<html>
-<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
-</HTML>
-<html>
-<p><b>Version 1.5</b></p>
-</HTML>
-"));
-end ThermoProperties_ps;
+within ThermoSysPro.Properties.WaterSteamSimple;
+record ThermoProperties_ps
+  Units.SI.Temperature T(
+    min=WaterSteam.InitLimits.TMIN,
+    max=WaterSteam.InitLimits.TMAX,
+    nominal=WaterSteam.InitLimits.TNOM) "Temperature";
+  Units.SI.Density d(
+    min=WaterSteam.InitLimits.DMIN,
+    max=WaterSteam.InitLimits.DMAX,
+    nominal=WaterSteam.InitLimits.DNOM) "Density";
+  Units.SI.SpecificEnergy u(
+    min=WaterSteam.InitLimits.SEMIN,
+    max=WaterSteam.InitLimits.SEMAX,
+    nominal=WaterSteam.InitLimits.SENOM) "Specific inner energy";
+  Units.SI.SpecificEnthalpy h(
+    min=WaterSteam.InitLimits.SHMIN,
+    max=WaterSteam.InitLimits.SHMAX,
+    nominal=WaterSteam.InitLimits.SHNOM) "Specific enthalpy";
+  Units.SI.SpecificHeatCapacity cp(
+    min=WaterSteam.InitLimits.CPMIN,
+    max=WaterSteam.InitLimits.CPMAX,
+    nominal=WaterSteam.InitLimits.CPNOM)
+    "Specific heat capacity at constant pressure";
+  ThermoSysPro.Units.xSI.DerDensityByEntropy ddsp
+    "Derivative of the density wrt. specific entropy at constant pressure";
+  Units.SI.DerDensityByPressure ddps
+    "Derivative of the density wrt. pressure at constant specific entropy";
+  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
+  annotation (
+    Window(
+      x=0.31,
+      y=0.2,
+      width=0.6,
+      height=0.6),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,50},{100,-100}},
+          lineColor={28,108,200},
+          fillColor={255,255,127},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-127,115},{127,55}}, textString=
+                                               "%name"),
+        Line(points={{-100,-50},{100,-50}}, color={0,0,0}),
+        Line(points={{-100,0},{100,0}}, color={0,0,0}),
+        Line(points={{0,50},{0,-100}}, color={0,0,0})}),
+    Documentation(info="<html>
+<p><b>Adapted from the ThermoFlow library (H. Tummescheit)</b></p>
+</HTML>
+<html>
+<p><b>Version 1.5</b></p>
+</HTML>
+"));
+end ThermoProperties_ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order13.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order13.mo
index ee3a7d5fa86d33080f9927c079ab5ca5cded6cab..350b2e062edabdda2da48e71d6ead5a4c53e20af 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order13.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order13.mo
@@ -1,23 +1,23 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-record coef_x_order13
-  extends Modelica.Icons.Record;
-
-  constant Real c13 =  0;
-  constant Real c12 =  0;
-  constant Real c11 =  0;
-  constant Real c10 =  0;
-  constant Real c9 =  0;
-  constant Real c8 =  0;
-  constant Real c7 =  0;
-  constant Real c6 =  0;
-  constant Real c5 =  0;
-  constant Real c4 =  0;
-  constant Real c3 =  0;
-  constant Real c2 =  0;
-  constant Real c1 =  0;
-  constant Real c0 =  0;
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end coef_x_order13;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+record coef_x_order13
+  extends Modelica.Icons.Record;
+
+  constant Real c13 =  0;
+  constant Real c12 =  0;
+  constant Real c11 =  0;
+  constant Real c10 =  0;
+  constant Real c9 =  0;
+  constant Real c8 =  0;
+  constant Real c7 =  0;
+  constant Real c6 =  0;
+  constant Real c5 =  0;
+  constant Real c4 =  0;
+  constant Real c3 =  0;
+  constant Real c2 =  0;
+  constant Real c1 =  0;
+  constant Real c0 =  0;
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end coef_x_order13;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order5.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order5.mo
index 1e157841d88ccd3b0b3373562e422b4e51e4804a..79f69fb2e61bae292b68b2cb5095a25ca7063c59 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order5.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order5.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-record coef_x_order5
-  extends Modelica.Icons.Record;
-
-  constant Real c7 =  0;
-  constant Real c6 =  0;
-  constant Real c5 =  0;
-  constant Real c4 =  0;
-  constant Real c3 =  0;
-  constant Real c2 =  0;
-  constant Real c1 =  0;
-  constant Real c0 =  0;
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end coef_x_order5;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+record coef_x_order5
+  extends Modelica.Icons.Record;
+
+  constant Real c7 =  0;
+  constant Real c6 =  0;
+  constant Real c5 =  0;
+  constant Real c4 =  0;
+  constant Real c3 =  0;
+  constant Real c2 =  0;
+  constant Real c1 =  0;
+  constant Real c0 =  0;
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end coef_x_order5;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order7.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order7.mo
index d07d887f7536c2c5e2d60b66b9a93440c94b43bb..6d6b8bd245f6d3963ce2b4fee2e641ecc65b2b27 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order7.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order7.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-record coef_x_order7
-  extends Modelica.Icons.Record;
-
-  constant Real c7 =  0;
-  constant Real c6 =  0;
-  constant Real c5 =  0;
-  constant Real c4 =  0;
-  constant Real c3 =  0;
-  constant Real c2 =  0;
-  constant Real c1 =  0;
-  constant Real c0 =  0;
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end coef_x_order7;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+record coef_x_order7
+  extends Modelica.Icons.Record;
+
+  constant Real c7 =  0;
+  constant Real c6 =  0;
+  constant Real c5 =  0;
+  constant Real c4 =  0;
+  constant Real c3 =  0;
+  constant Real c2 =  0;
+  constant Real c1 =  0;
+  constant Real c0 =  0;
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end coef_x_order7;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order9.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order9.mo
index 5c7656377a46a4960e06356fd17b83379d7824bb..c5a8ce68696f1683ac9580b71e3a0e02df7c96e3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order9.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_x_order9.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-record coef_x_order9
-  extends Modelica.Icons.Record;
-  constant Real c9 =  0;
-  constant Real c8 =  0;
-  constant Real c7 =  0;
-  constant Real c6 =  0;
-  constant Real c5 =  0;
-  constant Real c4 =  0;
-  constant Real c3 =  0;
-  constant Real c2 =  0;
-  constant Real c1 =  0;
-  constant Real c0 =  0;
-
-   annotation (Icon(graphics,
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end coef_x_order9;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+record coef_x_order9
+  extends Modelica.Icons.Record;
+  constant Real c9 =  0;
+  constant Real c8 =  0;
+  constant Real c7 =  0;
+  constant Real c6 =  0;
+  constant Real c5 =  0;
+  constant Real c4 =  0;
+  constant Real c3 =  0;
+  constant Real c2 =  0;
+  constant Real c1 =  0;
+  constant Real c0 =  0;
+
+   annotation (Icon(graphics,
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end coef_x_order9;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_xy_order3.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_xy_order3.mo
index 4e0317de30e99389fffcd06e0ab61344081ba573..0897a6e21e8dc1e9b72c13bf16cbdd6c6edf2312 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_xy_order3.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_xy_order3.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-record coef_xy_order3
-  extends Modelica.Icons.Record;
-  constant Real c00 =  0;
-  constant Real c01 =  0;
-  constant Real c10 =  0;
-  constant Real c02 =  0;
-  constant Real c11 =  0;
-  constant Real c20 =  0;
-  constant Real c03 =  0;
-  constant Real c12 =  0;
-  constant Real c21 =  0;
-  constant Real c30 =  0;
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end coef_xy_order3;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+record coef_xy_order3
+  extends Modelica.Icons.Record;
+  constant Real c00 =  0;
+  constant Real c01 =  0;
+  constant Real c10 =  0;
+  constant Real c02 =  0;
+  constant Real c11 =  0;
+  constant Real c20 =  0;
+  constant Real c03 =  0;
+  constant Real c12 =  0;
+  constant Real c21 =  0;
+  constant Real c30 =  0;
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end coef_xy_order3;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_xy_order5.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_xy_order5.mo
index ef4e1b154b34c9021837a39a7a1d21fe4b14cbb9..6397625d7d6ec70502c9d03c39a3a2747759db25 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_xy_order5.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/coef_xy_order5.mo
@@ -1,28 +1,28 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-record coef_xy_order5
-  extends Modelica.Icons.Record;
-  constant Real c00 =  0;
-  constant Real c01 =  0;
-  constant Real c10 =  0;
-  constant Real c02 =  0;
-  constant Real c11 =  0;
-  constant Real c20 =  0;
-  constant Real c03 =  0;
-  constant Real c12 =  0;
-  constant Real c21 =  0;
-  constant Real c30 =  0;
-  constant Real c04 =  0;
-  constant Real c13 =  0;
-  constant Real c22 =  0;
-  constant Real c31 =  0;
-  constant Real c40 =  0;
-  constant Real c05 =  0;
-  constant Real c14 =  0;
-  constant Real c23 =  0;
-  constant Real c32 =  0;
-  constant Real c41 =  0;
-  constant Real c50 =  0;
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end coef_xy_order5;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+record coef_xy_order5
+  extends Modelica.Icons.Record;
+  constant Real c00 =  0;
+  constant Real c01 =  0;
+  constant Real c10 =  0;
+  constant Real c02 =  0;
+  constant Real c11 =  0;
+  constant Real c20 =  0;
+  constant Real c03 =  0;
+  constant Real c12 =  0;
+  constant Real c21 =  0;
+  constant Real c30 =  0;
+  constant Real c04 =  0;
+  constant Real c13 =  0;
+  constant Real c22 =  0;
+  constant Real c31 =  0;
+  constant Real c40 =  0;
+  constant Real c05 =  0;
+  constant Real c14 =  0;
+  constant Real c23 =  0;
+  constant Real c32 =  0;
+  constant Real c41 =  0;
+  constant Real c50 =  0;
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end coef_xy_order5;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/logBase10.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/logBase10.mo
index 74726b049e41c27ba94e6971e88f422324607669..3bf2bc9d69dab30dcc7d8a3090ff070c5ee3cb6d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/logBase10.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/logBase10.mo
@@ -1,8 +1,8 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function logBase10
-  input Real x;
-  output Real y;
-algorithm
-  //y:= log10(x);
-  y:=log10(abs(x)+1e-10);
-end logBase10;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function logBase10
+  input Real x;
+  output Real y;
+algorithm
+  //y:= log10(x);
+  y:=log10(abs(x)+1e-10);
+end logBase10;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/package.mo
index 93fa87f276d20656705ea68ab4f7ee72c2c439ae..d2709ee4392127a23331e1f77c485ea79daf1d72 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Utilities
-
-
-
-      annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</b> </span></p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Utilities</b> contains basic polynomials functions and their derivates.</span></p>
-</html>",       revisions="<h4>Intermediate release notes during development<\\h4>
-<p>Currenly the Events/noEvents switch is only implmented for p-h states. Only after testing that implmentation, it will be extended to dT.</p>"),
-      Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Utilities;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Utilities
+
+
+
+      annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</b> </span></p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>Utilities</b> contains basic polynomials functions and their derivates.</span></p>
+</html>",       revisions="<h4>Intermediate release notes during development<\\h4>
+<p>Currenly the Events/noEvents switch is only implmented for p-h states. Only after testing that implmentation, it will be extended to dT.</p>"),
+      Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Utilities;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/package.order
index 4f52726e827e71bfaad9b51a59e1346ba34bf9e1..b5be18d5b9496f510f0a9e92d1c7e9b53a182703 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/package.order
@@ -1,28 +1,28 @@
-coef_xy_order5
-polynomial_xy_order5
-polynomial_xy_order5_derivative_x
-polynomial_xy_order5_derivative_y
-polynomial_xy_order5_derivative2_xy
-polynomial_xy_order5_derivative2_xx
-polynomial_xy_order5_derivative2_yy
-coef_xy_order3
-polynomial_xy_order3
-polynomial_xy_order3_derivative_x
-polynomial_xy_order3_derivative_y
-polynomial_xy_order3_derivative2_xy
-polynomial_xy_order3_derivative2_xx
-polynomial_xy_order3_derivative2_yy
-coef_x_order5
-polynomial_x_order5
-polynomial_x_order5_derivative
-polynomial_x_order5_derivative2
-coef_x_order7
-polynomial_x_order7
-polynomial_x_order7_derivative
-polynomial_x_order7_derivative2
-coef_x_order9
-polynomial_x_order9
-polynomial_x_order9_derivative
-logBase10
-coef_x_order13
-polynomial_x_order13
+coef_xy_order5
+polynomial_xy_order5
+polynomial_xy_order5_derivative_x
+polynomial_xy_order5_derivative_y
+polynomial_xy_order5_derivative2_xy
+polynomial_xy_order5_derivative2_xx
+polynomial_xy_order5_derivative2_yy
+coef_xy_order3
+polynomial_xy_order3
+polynomial_xy_order3_derivative_x
+polynomial_xy_order3_derivative_y
+polynomial_xy_order3_derivative2_xy
+polynomial_xy_order3_derivative2_xx
+polynomial_xy_order3_derivative2_yy
+coef_x_order5
+polynomial_x_order5
+polynomial_x_order5_derivative
+polynomial_x_order5_derivative2
+coef_x_order7
+polynomial_x_order7
+polynomial_x_order7_derivative
+polynomial_x_order7_derivative2
+coef_x_order9
+polynomial_x_order9
+polynomial_x_order9_derivative
+logBase10
+coef_x_order13
+polynomial_x_order13
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order13.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order13.mo
index 7566635953fab170783a94aa2a9fe4b9b908c22a..5f779f7655af0d9e1bdd7c4b968c1ed25fc9542d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order13.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order13.mo
@@ -1,23 +1,23 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_x_order13
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order13 coef;
-  input Real x;
-  output Real polynomial;
-
-algorithm
-  polynomial := coef.c0 +
-                coef.c1*x +
-                coef.c2*x^2 +
-                coef.c3*x^3 +
-                coef.c4*x^4 +
-                coef.c5*x^5 +
-                coef.c6*x^6 +
-                coef.c7*x^7 +
-                coef.c8*x^8 +
-                coef.c9*x^9 +
-                coef.c10*x^10 +
-                coef.c11*x^11 +
-                coef.c12*x^12 +
-                coef.c13*x^13;
-
-end polynomial_x_order13;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_x_order13
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order13 coef;
+  input Real x;
+  output Real polynomial;
+
+algorithm
+  polynomial := coef.c0 +
+                coef.c1*x +
+                coef.c2*x^2 +
+                coef.c3*x^3 +
+                coef.c4*x^4 +
+                coef.c5*x^5 +
+                coef.c6*x^6 +
+                coef.c7*x^7 +
+                coef.c8*x^8 +
+                coef.c9*x^9 +
+                coef.c10*x^10 +
+                coef.c11*x^11 +
+                coef.c12*x^12 +
+                coef.c13*x^13;
+
+end polynomial_x_order13;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5.mo
index 5aa289f229b4fc2b8ae1a3180141f38288829ee5..e7d71ce5a01eb9a58772bbc946012e8ed5d3e3b6 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_x_order5
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5 coef;
-  input Real x;
-  output Real polynomial;
-
-algorithm
-  polynomial := coef.c0 +
-                coef.c1*x +
-                coef.c2*x^2 +
-                coef.c3*x^3 +
-                coef.c4*x^4 +
-                coef.c5*x^5;
-
-end polynomial_x_order5;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_x_order5
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5 coef;
+  input Real x;
+  output Real polynomial;
+
+algorithm
+  polynomial := coef.c0 +
+                coef.c1*x +
+                coef.c2*x^2 +
+                coef.c3*x^3 +
+                coef.c4*x^4 +
+                coef.c5*x^5;
+
+end polynomial_x_order5;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5_derivative.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5_derivative.mo
index fde360650cb6736231f5204069db090a2d07b35c..5923f408b50afcbf37de75418b8101e11f8cef2c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5_derivative.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5_derivative.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_x_order5_derivative
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5 coef;
-  input Real x;
-  output Real der_polynomial_x;
-
-algorithm
-  der_polynomial_x := coef.c1 +
-                      coef.c2*2*x +
-                      coef.c3*3*x^2 +
-                      coef.c4*4*x^3 +
-                      coef.c5*5*x^4;
-
-end polynomial_x_order5_derivative;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_x_order5_derivative
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5 coef;
+  input Real x;
+  output Real der_polynomial_x;
+
+algorithm
+  der_polynomial_x := coef.c1 +
+                      coef.c2*2*x +
+                      coef.c3*3*x^2 +
+                      coef.c4*4*x^3 +
+                      coef.c5*5*x^4;
+
+end polynomial_x_order5_derivative;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5_derivative2.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5_derivative2.mo
index 44067594aefb558c79c7a8f475dbddfabbb905d7..7ac41efe3cddcac96820a66d0c71e93076e53b91 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5_derivative2.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order5_derivative2.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_x_order5_derivative2
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5 coef;
-  input Real x;
-  output Real der2_polynomial_x;
-
-algorithm
-  der2_polynomial_x :=coef.c2*2 +
-                      coef.c3*3*2*x +
-                      coef.c4*4*3*x^2 +
-                      coef.c5*5*4*x^3;
-
-end polynomial_x_order5_derivative2;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_x_order5_derivative2
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order5 coef;
+  input Real x;
+  output Real der2_polynomial_x;
+
+algorithm
+  der2_polynomial_x :=coef.c2*2 +
+                      coef.c3*3*2*x +
+                      coef.c4*4*3*x^2 +
+                      coef.c5*5*4*x^3;
+
+end polynomial_x_order5_derivative2;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7.mo
index 355ab27491005f37d9fda21652ea3322615103d5..47b6d829a1647b505e0e48a1c74abfc5f6f6ce44 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_x_order7
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7 coef;
-  input Real x;
-  output Real polynomial;
-
-algorithm
-  polynomial := coef.c0 +
-                coef.c1*x +
-                coef.c2*x^2 +
-                coef.c3*x^3 +
-                coef.c4*x^4 +
-                coef.c5*x^5 +
-                coef.c6*x^6 +
-                coef.c7*x^7;
-
-end polynomial_x_order7;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_x_order7
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7 coef;
+  input Real x;
+  output Real polynomial;
+
+algorithm
+  polynomial := coef.c0 +
+                coef.c1*x +
+                coef.c2*x^2 +
+                coef.c3*x^3 +
+                coef.c4*x^4 +
+                coef.c5*x^5 +
+                coef.c6*x^6 +
+                coef.c7*x^7;
+
+end polynomial_x_order7;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7_derivative.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7_derivative.mo
index fe7a8368081fc531fa3228a1fe65bc3c145d1c5b..263b4cb29284f42e8afc294f1b27aed1b2bb9ae6 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7_derivative.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7_derivative.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_x_order7_derivative
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7 coef;
-  input Real x;
-  output Real der_polynomial_x;
-
-algorithm
-  der_polynomial_x := coef.c1 +
-                      coef.c2*2*x +
-                      coef.c3*3*x^2 +
-                      coef.c4*4*x^3 +
-                      coef.c5*5*x^4 +
-                      coef.c6*6*x^5 +
-                      coef.c7*7*x^6;
-
-end polynomial_x_order7_derivative;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_x_order7_derivative
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7 coef;
+  input Real x;
+  output Real der_polynomial_x;
+
+algorithm
+  der_polynomial_x := coef.c1 +
+                      coef.c2*2*x +
+                      coef.c3*3*x^2 +
+                      coef.c4*4*x^3 +
+                      coef.c5*5*x^4 +
+                      coef.c6*6*x^5 +
+                      coef.c7*7*x^6;
+
+end polynomial_x_order7_derivative;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7_derivative2.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7_derivative2.mo
index b7fd2ffd562e4af1542f993346ce5805f4a8d452..4cee2f3474e94aa8ca1a56deac30607699378dcd 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7_derivative2.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order7_derivative2.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_x_order7_derivative2
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7 coef;
-  input Real x;
-  output Real der2_polynomial_x;
-
-algorithm
-  der2_polynomial_x :=coef.c2*2 +
-                      coef.c3*3*2*x +
-                      coef.c4*4*3*x^2 +
-                      coef.c5*5*4*x^3 +
-                      coef.c6*6*5*x^4 +
-                      coef.c7*7*6*x^5;
-
-end polynomial_x_order7_derivative2;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_x_order7_derivative2
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7 coef;
+  input Real x;
+  output Real der2_polynomial_x;
+
+algorithm
+  der2_polynomial_x :=coef.c2*2 +
+                      coef.c3*3*2*x +
+                      coef.c4*4*3*x^2 +
+                      coef.c5*5*4*x^3 +
+                      coef.c6*6*5*x^4 +
+                      coef.c7*7*6*x^5;
+
+end polynomial_x_order7_derivative2;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order9.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order9.mo
index 7465281044ae93bf4df7317a7f510a3a0b2d89ea..3b66925ec7a1b16a7d78e873b286c981ea58b0d2 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order9.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order9.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_x_order9
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order9 coef;
-  input Real x;
-  output Real polynomial;
-
-algorithm
-  polynomial := coef.c0 +
-                coef.c1*x +
-                coef.c2*x^2 +
-                coef.c3*x^3 +
-                coef.c4*x^4 +
-                coef.c5*x^5 +
-                coef.c6*x^6 +
-                coef.c7*x^7 +
-                coef.c8*x^8 +
-                coef.c9*x^9;
-
-end polynomial_x_order9;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_x_order9
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order9 coef;
+  input Real x;
+  output Real polynomial;
+
+algorithm
+  polynomial := coef.c0 +
+                coef.c1*x +
+                coef.c2*x^2 +
+                coef.c3*x^3 +
+                coef.c4*x^4 +
+                coef.c5*x^5 +
+                coef.c6*x^6 +
+                coef.c7*x^7 +
+                coef.c8*x^8 +
+                coef.c9*x^9;
+
+end polynomial_x_order9;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order9_derivative.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order9_derivative.mo
index 393503e846734064abd698d5b8d94b800d8a61a9..74df19bbb4f78601f384d392e0084328961b2a62 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order9_derivative.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_x_order9_derivative.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_x_order9_derivative
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order9 coef;
-  input Real x;
-  output Real der_polynomial_x;
-
-algorithm
-  der_polynomial_x := coef.c1 +
-                      coef.c2*2*x +
-                      coef.c3*3*x^2 +
-                      coef.c4*4*x^3 +
-                      coef.c5*5*x^4 +
-                      coef.c6*6*x^5 +
-                      coef.c7*7*x^6 +
-                      coef.c8*8*x^7 +
-                      coef.c9*9*x^8;
-end polynomial_x_order9_derivative;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_x_order9_derivative
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order9 coef;
+  input Real x;
+  output Real der_polynomial_x;
+
+algorithm
+  der_polynomial_x := coef.c1 +
+                      coef.c2*2*x +
+                      coef.c3*3*x^2 +
+                      coef.c4*4*x^3 +
+                      coef.c5*5*x^4 +
+                      coef.c6*6*x^5 +
+                      coef.c7*7*x^6 +
+                      coef.c8*8*x^7 +
+                      coef.c9*9*x^8;
+end polynomial_x_order9_derivative;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3.mo
index 56af8af7f0c1adf9657a84c8f4726da87e581e32..8ca4912072a6ffbc16b7f5375606fc086408967d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order3
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
-  input Real x;
-  input Real y;
-  output Real polynomial;
-
-algorithm
-  polynomial := coef.c00 +
-                coef.c10*x +
-                coef.c01*y +
-                coef.c20*x^2 +
-                coef.c11*x*y +
-                coef.c02*y^2 +
-                coef.c30*x^3 +
-                coef.c21*x^2*y +
-                coef.c12*x*y^2 +
-                coef.c03*y^3;
-
-end polynomial_xy_order3;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order3
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
+  input Real x;
+  input Real y;
+  output Real polynomial;
+
+algorithm
+  polynomial := coef.c00 +
+                coef.c10*x +
+                coef.c01*y +
+                coef.c20*x^2 +
+                coef.c11*x*y +
+                coef.c02*y^2 +
+                coef.c30*x^3 +
+                coef.c21*x^2*y +
+                coef.c12*x*y^2 +
+                coef.c03*y^3;
+
+end polynomial_xy_order3;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_xx.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_xx.mo
index dd7e67cd35b2492f6845d46cac73c1868b79afca..25c81386a47ded98a3a8e8b4699f4491e5a17afd 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_xx.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_xx.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order3_derivative2_xx
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
-  input Real x;
-  input Real y;
-  output Real der2_polynomial_xx;
-
-algorithm
-  der2_polynomial_xx := coef.c20*2 +
-                       coef.c30*6*x +
-                       coef.c21*2*y;
-
-end polynomial_xy_order3_derivative2_xx;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order3_derivative2_xx
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
+  input Real x;
+  input Real y;
+  output Real der2_polynomial_xx;
+
+algorithm
+  der2_polynomial_xx := coef.c20*2 +
+                       coef.c30*6*x +
+                       coef.c21*2*y;
+
+end polynomial_xy_order3_derivative2_xx;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_xy.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_xy.mo
index 1c2cb14f4246a1ee216efb2ef29bf820a9e8306e..d7adf3da415cdbf26f422e82abe72a9308c4cb1a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_xy.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_xy.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order3_derivative2_xy
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
-  input Real x;
-  input Real y;
-  output Real der2_polynomial_xy;
-
-algorithm
-  der2_polynomial_xy := coef.c11 +
-                        coef.c21*2*x +
-                        coef.c12*2*y;
-
-end polynomial_xy_order3_derivative2_xy;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order3_derivative2_xy
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
+  input Real x;
+  input Real y;
+  output Real der2_polynomial_xy;
+
+algorithm
+  der2_polynomial_xy := coef.c11 +
+                        coef.c21*2*x +
+                        coef.c12*2*y;
+
+end polynomial_xy_order3_derivative2_xy;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_yy.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_yy.mo
index 92d4ade5e7c1eb777d6e4ee0b66385ec5a2f094d..a4cfc7bef4fb02871021983f2bfdbf20e160fc1b 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_yy.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative2_yy.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order3_derivative2_yy
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
-  input Real x;
-  input Real y;
-  output Real der2_polynomial_yy;
-
-algorithm
-  der2_polynomial_yy := coef.c02*2 +
-                       coef.c12*x*2 +
-                       coef.c03*6*y;
-
-end polynomial_xy_order3_derivative2_yy;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order3_derivative2_yy
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
+  input Real x;
+  input Real y;
+  output Real der2_polynomial_yy;
+
+algorithm
+  der2_polynomial_yy := coef.c02*2 +
+                       coef.c12*x*2 +
+                       coef.c03*6*y;
+
+end polynomial_xy_order3_derivative2_yy;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative_x.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative_x.mo
index ca40352a930225719fead378bc000b6cbd724199..9fbb4cef1e1b4334633584c2d7ab1d76195ec9e6 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative_x.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative_x.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order3_derivative_x
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
-  input Real x;
-  input Real y;
-  output Real der_polynomial_x;
-
-algorithm
-  der_polynomial_x := coef.c10 +
-                      coef.c20*2*x +
-                      coef.c11*y +
-                      coef.c30*3*x^2 +
-                      coef.c21*2*x*y +
-                      coef.c12*y^2;
-
-end polynomial_xy_order3_derivative_x;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order3_derivative_x
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
+  input Real x;
+  input Real y;
+  output Real der_polynomial_x;
+
+algorithm
+  der_polynomial_x := coef.c10 +
+                      coef.c20*2*x +
+                      coef.c11*y +
+                      coef.c30*3*x^2 +
+                      coef.c21*2*x*y +
+                      coef.c12*y^2;
+
+end polynomial_xy_order3_derivative_x;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative_y.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative_y.mo
index eba49b68cb7f67d3c6d3cba78bfb91fadcddf331..9dd45276b398750b35788676d2403b940d81946a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative_y.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order3_derivative_y.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order3_derivative_y
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
-  input Real x;
-  input Real y;
-  output Real der_polynomial_y;
-
-algorithm
-  der_polynomial_y := coef.c01 +
-                      coef.c11*x +
-                      coef.c02*2*y +
-                      coef.c21*x^2 +
-                      coef.c12*x*2*y +
-                      coef.c03*3*y^2;
-
-end polynomial_xy_order3_derivative_y;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order3_derivative_y
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3 coef;
+  input Real x;
+  input Real y;
+  output Real der_polynomial_y;
+
+algorithm
+  der_polynomial_y := coef.c01 +
+                      coef.c11*x +
+                      coef.c02*2*y +
+                      coef.c21*x^2 +
+                      coef.c12*x*2*y +
+                      coef.c03*3*y^2;
+
+end polynomial_xy_order3_derivative_y;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5.mo
index ea023ee851b1b633dbc473c7f3934d14cde4b780..9d230065fd7e4e50cc89550bf5b710d3a475e3ca 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order5
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
-  input Real x;
-  input Real y;
-  output Real polynomial;
-
-algorithm
-  polynomial := coef.c00 +
-                coef.c10*x +
-                coef.c01*y +
-                coef.c20*x^2 +
-                coef.c11*x*y +
-                coef.c02*y^2 +
-                coef.c30*x^3 +
-                coef.c21*x^2*y +
-                coef.c12*x*y^2 +
-                coef.c03*y^3 +
-                coef.c40*x^4 +
-                coef.c31*x^3*y +
-                coef.c22*x^2*y^2 +
-                coef.c13*x*y^3 +
-                coef.c04*y^4 +
-                coef.c50*x^5 +
-                coef.c41*x^4*y +
-                coef.c32*x^3*y^2 +
-                coef.c23*x^2*y^3 +
-                coef.c14*x*y^4 +
-                coef.c05*y^5;
-
-end polynomial_xy_order5;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order5
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
+  input Real x;
+  input Real y;
+  output Real polynomial;
+
+algorithm
+  polynomial := coef.c00 +
+                coef.c10*x +
+                coef.c01*y +
+                coef.c20*x^2 +
+                coef.c11*x*y +
+                coef.c02*y^2 +
+                coef.c30*x^3 +
+                coef.c21*x^2*y +
+                coef.c12*x*y^2 +
+                coef.c03*y^3 +
+                coef.c40*x^4 +
+                coef.c31*x^3*y +
+                coef.c22*x^2*y^2 +
+                coef.c13*x*y^3 +
+                coef.c04*y^4 +
+                coef.c50*x^5 +
+                coef.c41*x^4*y +
+                coef.c32*x^3*y^2 +
+                coef.c23*x^2*y^3 +
+                coef.c14*x*y^4 +
+                coef.c05*y^5;
+
+end polynomial_xy_order5;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_xx.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_xx.mo
index 5cd5796b12fe13453d7655d56ab4706aa96ecb38..1a92722487708e9721f5e37264f5183ef607f9e5 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_xx.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_xx.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order5_derivative2_xx
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
-  input Real x;
-  input Real y;
-  output Real der2_polynomial_xx;
-
-algorithm
-  der2_polynomial_xx := coef.c20*2 +
-                       coef.c30*6*x +
-                       coef.c21*2*y +
-                       coef.c40*12*x^2 +
-                       coef.c31*6*x*y +
-                       coef.c22*2*y^2 +
-                       coef.c50*20*x^3 +
-                       coef.c41*12*x^2*y +
-                       coef.c32*6*x*y^2 +
-                       coef.c23*2*y^3;
-
-end polynomial_xy_order5_derivative2_xx;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order5_derivative2_xx
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
+  input Real x;
+  input Real y;
+  output Real der2_polynomial_xx;
+
+algorithm
+  der2_polynomial_xx := coef.c20*2 +
+                       coef.c30*6*x +
+                       coef.c21*2*y +
+                       coef.c40*12*x^2 +
+                       coef.c31*6*x*y +
+                       coef.c22*2*y^2 +
+                       coef.c50*20*x^3 +
+                       coef.c41*12*x^2*y +
+                       coef.c32*6*x*y^2 +
+                       coef.c23*2*y^3;
+
+end polynomial_xy_order5_derivative2_xx;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_xy.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_xy.mo
index 852540074ebcd45d7d95e85feac83952e4401e12..e68d620c5dadba12f6da5a5c4d86f2ac0099c36f 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_xy.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_xy.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order5_derivative2_xy
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
-  input Real x;
-  input Real y;
-  output Real der2_polynomial_xy;
-
-algorithm
-  der2_polynomial_xy := coef.c11 +
-                        coef.c21*2*x +
-                        coef.c12*2*y +
-                        coef.c31*3*x^2 +
-                        coef.c22*2*x*2*y +
-                        coef.c13*3*y^2 +
-                        coef.c41*4*x^3 +
-                        coef.c32*3*x^2*2*y +
-                        coef.c23*2*x*3*y^2 +
-                        coef.c14*4*y^3;
-
-end polynomial_xy_order5_derivative2_xy;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order5_derivative2_xy
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
+  input Real x;
+  input Real y;
+  output Real der2_polynomial_xy;
+
+algorithm
+  der2_polynomial_xy := coef.c11 +
+                        coef.c21*2*x +
+                        coef.c12*2*y +
+                        coef.c31*3*x^2 +
+                        coef.c22*2*x*2*y +
+                        coef.c13*3*y^2 +
+                        coef.c41*4*x^3 +
+                        coef.c32*3*x^2*2*y +
+                        coef.c23*2*x*3*y^2 +
+                        coef.c14*4*y^3;
+
+end polynomial_xy_order5_derivative2_xy;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_yy.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_yy.mo
index 103297b62b87d2eb3ca92cb23f59ebdcd2ad6252..62c7e647ee4d85cb00ff732a153ebe738ba350ac 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_yy.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative2_yy.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order5_derivative2_yy
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
-  input Real x;
-  input Real y;
-  output Real der2_polynomial_yy;
-
-algorithm
-  der2_polynomial_yy := coef.c02*2 +
-                       coef.c12*x*2 +
-                       coef.c03*6*y +
-                       coef.c22*x^2*2 +
-                       coef.c13*x*6*y +
-                       coef.c04*12*y^2 +
-                       coef.c32*x^3*2 +
-                       coef.c23*x^2*6*y +
-                       coef.c14*x*12*y^2 +
-                       coef.c05*20*y^3;
-
-end polynomial_xy_order5_derivative2_yy;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order5_derivative2_yy
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
+  input Real x;
+  input Real y;
+  output Real der2_polynomial_yy;
+
+algorithm
+  der2_polynomial_yy := coef.c02*2 +
+                       coef.c12*x*2 +
+                       coef.c03*6*y +
+                       coef.c22*x^2*2 +
+                       coef.c13*x*6*y +
+                       coef.c04*12*y^2 +
+                       coef.c32*x^3*2 +
+                       coef.c23*x^2*6*y +
+                       coef.c14*x*12*y^2 +
+                       coef.c05*20*y^3;
+
+end polynomial_xy_order5_derivative2_yy;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative_x.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative_x.mo
index 68ab15ae4debb0d0d2b6705daa1142ef867af0c8..f1da6efa6fb2923e555d959ac70e72f1a52f8cf3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative_x.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative_x.mo
@@ -1,25 +1,25 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order5_derivative_x
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
-  input Real x;
-  input Real y;
-  output Real der_polynomial_x;
-
-algorithm
-  der_polynomial_x := coef.c10 +
-                      coef.c20*2*x +
-                      coef.c11*y +
-                      coef.c30*3*x^2 +
-                      coef.c21*2*x*y +
-                      coef.c12*y^2 +
-                      coef.c40*4*x^3 +
-                      coef.c31*3*x^2*y +
-                      coef.c22*2*x*y^2 +
-                      coef.c13*y^3 +
-                      coef.c50*5*x^4 +
-                      coef.c41*4*x^3*y +
-                      coef.c32*3*x^2*y^2 +
-                      coef.c23*2*x*y^3 +
-                      coef.c14*y^4;
-
-end polynomial_xy_order5_derivative_x;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order5_derivative_x
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
+  input Real x;
+  input Real y;
+  output Real der_polynomial_x;
+
+algorithm
+  der_polynomial_x := coef.c10 +
+                      coef.c20*2*x +
+                      coef.c11*y +
+                      coef.c30*3*x^2 +
+                      coef.c21*2*x*y +
+                      coef.c12*y^2 +
+                      coef.c40*4*x^3 +
+                      coef.c31*3*x^2*y +
+                      coef.c22*2*x*y^2 +
+                      coef.c13*y^3 +
+                      coef.c50*5*x^4 +
+                      coef.c41*4*x^3*y +
+                      coef.c32*3*x^2*y^2 +
+                      coef.c23*2*x*y^3 +
+                      coef.c14*y^4;
+
+end polynomial_xy_order5_derivative_x;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative_y.mo b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative_y.mo
index b6c6f47bae40464430f8a0ef9e0d8fd81e001900..454cee553ad7e999c63f15d926352ff60158c234 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative_y.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Utilities/polynomial_xy_order5_derivative_y.mo
@@ -1,25 +1,25 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
-function polynomial_xy_order5_derivative_y
-  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
-  input Real x;
-  input Real y;
-  output Real der_polynomial_y;
-
-algorithm
-  der_polynomial_y := coef.c01 +
-                      coef.c11*x +
-                      coef.c02*2*y +
-                      coef.c21*x^2 +
-                      coef.c12*x*2*y +
-                      coef.c03*3*y^2 +
-                      coef.c31*x^3 +
-                      coef.c22*x^2*2*y +
-                      coef.c13*x*3*y^2 +
-                      coef.c04*4*y^3 +
-                      coef.c41*x^4 +
-                      coef.c32*x^3*2*y +
-                      coef.c23*x^2*3*y^2 +
-                      coef.c14*x*4*y^3 +
-                      coef.c05*5*y^4;
-
-end polynomial_xy_order5_derivative_y;
+within ThermoSysPro.Properties.WaterSteamSimple.Utilities;
+function polynomial_xy_order5_derivative_y
+  input ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5 coef;
+  input Real x;
+  input Real y;
+  output Real der_polynomial_y;
+
+algorithm
+  der_polynomial_y := coef.c01 +
+                      coef.c11*x +
+                      coef.c02*2*y +
+                      coef.c21*x^2 +
+                      coef.c12*x*2*y +
+                      coef.c03*3*y^2 +
+                      coef.c31*x^3 +
+                      coef.c22*x^2*2*y +
+                      coef.c13*x*3*y^2 +
+                      coef.c04*4*y^3 +
+                      coef.c41*x^4 +
+                      coef.c32*x^3*2*y +
+                      coef.c23*x^2*3*y^2 +
+                      coef.c14*x*4*y^3 +
+                      coef.c05*5*y^4;
+
+end polynomial_xy_order5_derivative_y;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test1_IF97.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test1_IF97.mo
index a91bab994e7151798cee6540b8bd9fc613df99e4..f92f5dc43627c9a9f74fe8fd4335925fe75d6a11 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test1_IF97.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test1_IF97.mo
@@ -1,91 +1,91 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
-model Test1_IF97
-  import ThermoSysPro;
-  parameter Integer fluid = 1;
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(
-                                  P0=6e5) annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(mode=0,
-      option_temperature=2)         annotation (Placement(transformation(extent=
-           {{-104,-10},{-84,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1(fluid=fluid)
-    annotation (Placement(transformation(extent={{-26,30},{-6,50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump2(fluid=fluid)
-    annotation (Placement(transformation(extent={{-26,-50},{-6,-30}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD(fluid=fluid)
-                                                  annotation (Placement(
-        transformation(extent={{-46,-10},{-26,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve1
-    annotation (Placement(transformation(extent={{14,30},{34,50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve2
-    annotation (Placement(transformation(extent={{12,-50},{32,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(fluid=fluid)
-                                                  annotation (Placement(
-        transformation(extent={{34,-10},{54,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP(fluid=fluid)
-                                        annotation (Placement(transformation(
-          extent={{-76,-10},{-56,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1(fluid=fluid)
-                                         annotation (Placement(transformation(
-          extent={{64,-10},{84,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Duration=10000,
-    Initialvalue=1e5,
-    Finalvalue=4e6) annotation (Placement(transformation(extent={{-130,-40},{
-            -110,-20}}, rotation=0)));
-equation
-  connect(volumeD.Cs1,staticCentrifugalPump1. C1) annotation (Line(points={{-36,
-          10},{-36,40},{-26,40}}, color={0,0,255}));
-  connect(volumeD.Cs2,staticCentrifugalPump2. C1) annotation (Line(points={{-36,
-          -9.8},{-36,-40},{-26,-40}}, color={0,0,255}));
-  connect(staticCentrifugalPump1.C2,idealCheckValve1. C1) annotation (Line(
-        points={{-6,40},{14,40}}, color={0,0,255}));
-  connect(idealCheckValve1.C2,volumeC. Ce2) annotation (Line(points={{34,40},{
-          44,40},{44,9}}, color={0,0,255}));
-  connect(idealCheckValve2.C2,volumeC. Ce3) annotation (Line(points={{32,-40},{
-          44,-40},{44,-10}}, color={0,0,255}));
-  connect(staticCentrifugalPump2.C2,idealCheckValve2. C1) annotation (Line(
-        points={{-6,-40},{12,-40}}, color={0,0,255}));
-  connect(perteDP.C2,volumeD. Ce)
-    annotation (Line(points={{-56,0},{-46,0}}, color={0,0,255}));
-  connect(volumeC.Cs,perteDP1. C1)
-    annotation (Line(points={{54,0},{64,0}}, color={0,0,255}));
-  connect(sourceP.C, perteDP.C1)
-    annotation (Line(points={{-84,0},{-76,0}}, color={0,0,255}));
-  connect(perteDP1.C2, puitsP.C)
-    annotation (Line(points={{84,0},{90,0}}, color={0,0,255}));
-  connect(rampe.y, sourceP.ISpecificEnthalpy)
-    annotation (Line(points={{-109,-30},{-94,-30},{-94,-5}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
-    __Dymola_experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end Test1_IF97;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
+model Test1_IF97
+  import ThermoSysPro;
+  parameter Integer fluid = 1;
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(
+                                  P0=6e5) annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(mode=0,
+      option_temperature=2)         annotation (Placement(transformation(extent=
+           {{-104,-10},{-84,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1(fluid=fluid)
+    annotation (Placement(transformation(extent={{-26,30},{-6,50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump2(fluid=fluid)
+    annotation (Placement(transformation(extent={{-26,-50},{-6,-30}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD(fluid=fluid)
+                                                  annotation (Placement(
+        transformation(extent={{-46,-10},{-26,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve1
+    annotation (Placement(transformation(extent={{14,30},{34,50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve2
+    annotation (Placement(transformation(extent={{12,-50},{32,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(fluid=fluid)
+                                                  annotation (Placement(
+        transformation(extent={{34,-10},{54,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP(fluid=fluid)
+                                        annotation (Placement(transformation(
+          extent={{-76,-10},{-56,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1(fluid=fluid)
+                                         annotation (Placement(transformation(
+          extent={{64,-10},{84,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Duration=10000,
+    Initialvalue=1e5,
+    Finalvalue=4e6) annotation (Placement(transformation(extent={{-130,-40},{
+            -110,-20}}, rotation=0)));
+equation
+  connect(volumeD.Cs1,staticCentrifugalPump1. C1) annotation (Line(points={{-36,
+          10},{-36,40},{-26,40}}, color={0,0,255}));
+  connect(volumeD.Cs2,staticCentrifugalPump2. C1) annotation (Line(points={{-36,
+          -9.8},{-36,-40},{-26,-40}}, color={0,0,255}));
+  connect(staticCentrifugalPump1.C2,idealCheckValve1. C1) annotation (Line(
+        points={{-6,40},{14,40}}, color={0,0,255}));
+  connect(idealCheckValve1.C2,volumeC. Ce2) annotation (Line(points={{34,40},{
+          44,40},{44,9}}, color={0,0,255}));
+  connect(idealCheckValve2.C2,volumeC. Ce3) annotation (Line(points={{32,-40},{
+          44,-40},{44,-10}}, color={0,0,255}));
+  connect(staticCentrifugalPump2.C2,idealCheckValve2. C1) annotation (Line(
+        points={{-6,-40},{12,-40}}, color={0,0,255}));
+  connect(perteDP.C2,volumeD. Ce)
+    annotation (Line(points={{-56,0},{-46,0}}, color={0,0,255}));
+  connect(volumeC.Cs,perteDP1. C1)
+    annotation (Line(points={{54,0},{64,0}}, color={0,0,255}));
+  connect(sourceP.C, perteDP.C1)
+    annotation (Line(points={{-84,0},{-76,0}}, color={0,0,255}));
+  connect(perteDP1.C2, puitsP.C)
+    annotation (Line(points={{84,0},{90,0}}, color={0,0,255}));
+  connect(rampe.y, sourceP.ISpecificEnthalpy)
+    annotation (Line(points={{-109,-30},{-94,-30},{-94,-5}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
+    __Dymola_experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end Test1_IF97;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test1_polynomial.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test1_polynomial.mo
index d4c5645017cbf7c184074b309a0668d14af744b9..c6b3c1855cf50a9b5661fbf70c15be2860e88b53 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test1_polynomial.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test1_polynomial.mo
@@ -1,90 +1,90 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
-model Test1_polynomial
-  import ThermoSysPro;
-  parameter Integer fluid = 3;
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(
-                                  P0=6e5) annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(mode=0,
-      option_temperature=2)         annotation (Placement(transformation(extent=
-           {{-104,-10},{-84,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1(fluid=fluid)
-    annotation (Placement(transformation(extent={{-20,30},{0,50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump2(fluid=fluid)
-    annotation (Placement(transformation(extent={{-20,-50},{0,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD(fluid=fluid)
-                                                  annotation (Placement(
-        transformation(extent={{-46,-10},{-26,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve1
-    annotation (Placement(transformation(extent={{14,30},{34,50}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve2
-    annotation (Placement(transformation(extent={{12,-50},{32,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(fluid=fluid)
-                                                  annotation (Placement(
-        transformation(extent={{34,-10},{54,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP(fluid=fluid)
-                                        annotation (Placement(transformation(
-          extent={{-76,-10},{-56,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1(fluid=fluid)
-                                         annotation (Placement(transformation(
-          extent={{64,-10},{84,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Duration=10000,
-    Initialvalue=1e5,
-    Finalvalue=4e6) annotation (Placement(transformation(extent={{-128,-42},{
-            -108,-22}}, rotation=0)));
-equation
-  connect(volumeD.Cs1,staticCentrifugalPump1. C1) annotation (Line(points={{-36,
-          10},{-36,40},{-20,40}}, color={0,0,255}));
-  connect(volumeD.Cs2,staticCentrifugalPump2. C1) annotation (Line(points={{-36,
-          -9.8},{-36,-40},{-20,-40}}, color={0,0,255}));
-  connect(staticCentrifugalPump1.C2,idealCheckValve1. C1) annotation (Line(
-        points={{0,40},{14,40}}, color={0,0,255}));
-  connect(idealCheckValve1.C2,volumeC. Ce2) annotation (Line(points={{34,40},{
-          44,40},{44,9}}, color={0,0,255}));
-  connect(idealCheckValve2.C2,volumeC. Ce3) annotation (Line(points={{32,-40},{
-          44,-40},{44,-10}}, color={0,0,255}));
-  connect(staticCentrifugalPump2.C2,idealCheckValve2. C1) annotation (Line(
-        points={{0,-40},{12,-40}}, color={0,0,255}));
-  connect(perteDP.C2,volumeD. Ce)
-    annotation (Line(points={{-56,0},{-46,0}}, color={0,0,255}));
-  connect(volumeC.Cs,perteDP1. C1)
-    annotation (Line(points={{54,0},{64,0}}, color={0,0,255}));
-  connect(sourceP.C, perteDP.C1)
-    annotation (Line(points={{-84,0},{-76,0}}, color={0,0,255}));
-  connect(perteDP1.C2, puitsP.C)
-    annotation (Line(points={{84,0},{90,0}}, color={0,0,255}));
-  connect(rampe.y, sourceP.ISpecificEnthalpy)
-    annotation (Line(points={{-107,-32},{-94,-32},{-94,-5}}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
-    __Dymola_experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end Test1_polynomial;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
+model Test1_polynomial
+  import ThermoSysPro;
+  parameter Integer fluid = 3;
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(
+                                  P0=6e5) annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(mode=0,
+      option_temperature=2)         annotation (Placement(transformation(extent=
+           {{-104,-10},{-84,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump1(fluid=fluid)
+    annotation (Placement(transformation(extent={{-20,30},{0,50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Machines.StaticCentrifugalPump staticCentrifugalPump2(fluid=fluid)
+    annotation (Placement(transformation(extent={{-20,-50},{0,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD(fluid=fluid)
+                                                  annotation (Placement(
+        transformation(extent={{-46,-10},{-26,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve1
+    annotation (Placement(transformation(extent={{14,30},{34,50}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.IdealCheckValve idealCheckValve2
+    annotation (Placement(transformation(extent={{12,-50},{32,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(fluid=fluid)
+                                                  annotation (Placement(
+        transformation(extent={{34,-10},{54,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP(fluid=fluid)
+                                        annotation (Placement(transformation(
+          extent={{-76,-10},{-56,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1(fluid=fluid)
+                                         annotation (Placement(transformation(
+          extent={{64,-10},{84,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Duration=10000,
+    Initialvalue=1e5,
+    Finalvalue=4e6) annotation (Placement(transformation(extent={{-128,-42},{
+            -108,-22}}, rotation=0)));
+equation
+  connect(volumeD.Cs1,staticCentrifugalPump1. C1) annotation (Line(points={{-36,
+          10},{-36,40},{-20,40}}, color={0,0,255}));
+  connect(volumeD.Cs2,staticCentrifugalPump2. C1) annotation (Line(points={{-36,
+          -9.8},{-36,-40},{-20,-40}}, color={0,0,255}));
+  connect(staticCentrifugalPump1.C2,idealCheckValve1. C1) annotation (Line(
+        points={{0,40},{14,40}}, color={0,0,255}));
+  connect(idealCheckValve1.C2,volumeC. Ce2) annotation (Line(points={{34,40},{
+          44,40},{44,9}}, color={0,0,255}));
+  connect(idealCheckValve2.C2,volumeC. Ce3) annotation (Line(points={{32,-40},{
+          44,-40},{44,-10}}, color={0,0,255}));
+  connect(staticCentrifugalPump2.C2,idealCheckValve2. C1) annotation (Line(
+        points={{0,-40},{12,-40}}, color={0,0,255}));
+  connect(perteDP.C2,volumeD. Ce)
+    annotation (Line(points={{-56,0},{-46,0}}, color={0,0,255}));
+  connect(volumeC.Cs,perteDP1. C1)
+    annotation (Line(points={{54,0},{64,0}}, color={0,0,255}));
+  connect(sourceP.C, perteDP.C1)
+    annotation (Line(points={{-84,0},{-76,0}}, color={0,0,255}));
+  connect(perteDP1.C2, puitsP.C)
+    annotation (Line(points={{84,0},{90,0}}, color={0,0,255}));
+  connect(rampe.y, sourceP.ISpecificEnthalpy)
+    annotation (Line(points={{-107,-32},{-94,-32},{-94,-5}}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
+    __Dymola_experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end Test1_polynomial;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test2_IF97.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test2_IF97.mo
index fb1e80a6004d8eba3f094555fdba78ffd587f63d..a431765dc4c53483e2689fb83b9c2917b0932a5d 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test2_IF97.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test2_IF97.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
-model Test2_IF97
-  import ThermoSysPro;
-  parameter Integer fluid = 1;
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(P0=600000)
-                                          annotation (Placement(transformation(
-          extent={{80,-10},{100,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(mode=0,
-      option_temperature=2,
-    P0=1000000)                     annotation (Placement(transformation(extent=
-           {{-100,-10},{-80,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD(fluid=fluid)
-                                                  annotation (Placement(
-        transformation(extent={{-10,-10},{10,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP(fluid=fluid)
-                                        annotation (Placement(transformation(
-          extent={{-60,-10},{-40,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1(fluid=fluid)
-                                         annotation (Placement(transformation(
-          extent={{40,-10},{60,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Duration=10000,
-    Initialvalue=1e5,
-    Finalvalue=4e6) annotation (Placement(transformation(extent={{-120,-40},{
-            -100,-20}}, rotation=0)));
-equation
-  connect(perteDP.C2,volumeD. Ce)
-    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,255}));
-  connect(sourceP.C, perteDP.C1)
-    annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255}));
-  connect(perteDP1.C2, puitsP.C)
-    annotation (Line(points={{60,0},{80,0}}, color={0,0,255}));
-  connect(rampe.y, sourceP.ISpecificEnthalpy)
-    annotation (Line(points={{-99,-30},{-90,-30},{-90,-5}}));
-  connect(volumeD.Cs3, perteDP1.C1) annotation (Line(points={{10,0},{40,0}},
-        color={0,0,255}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
-    __Dymola_experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end Test2_IF97;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
+model Test2_IF97
+  import ThermoSysPro;
+  parameter Integer fluid = 1;
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(P0=600000)
+                                          annotation (Placement(transformation(
+          extent={{80,-10},{100,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(mode=0,
+      option_temperature=2,
+    P0=1000000)                     annotation (Placement(transformation(extent=
+           {{-100,-10},{-80,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD(fluid=fluid)
+                                                  annotation (Placement(
+        transformation(extent={{-10,-10},{10,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP(fluid=fluid)
+                                        annotation (Placement(transformation(
+          extent={{-60,-10},{-40,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1(fluid=fluid)
+                                         annotation (Placement(transformation(
+          extent={{40,-10},{60,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Duration=10000,
+    Initialvalue=1e5,
+    Finalvalue=4e6) annotation (Placement(transformation(extent={{-120,-40},{
+            -100,-20}}, rotation=0)));
+equation
+  connect(perteDP.C2,volumeD. Ce)
+    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,255}));
+  connect(sourceP.C, perteDP.C1)
+    annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255}));
+  connect(perteDP1.C2, puitsP.C)
+    annotation (Line(points={{60,0},{80,0}}, color={0,0,255}));
+  connect(rampe.y, sourceP.ISpecificEnthalpy)
+    annotation (Line(points={{-99,-30},{-90,-30},{-90,-5}}));
+  connect(volumeD.Cs3, perteDP1.C1) annotation (Line(points={{10,0},{40,0}},
+        color={0,0,255}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
+    __Dymola_experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end Test2_IF97;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test2_polynomial.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test2_polynomial.mo
index 5b652a84c4c2cc396d07fd8ccbd60fb36c9394ae..bbb19bfa979b3b85a63c32a56e135156ca41bc77 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test2_polynomial.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test2_polynomial.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
-model Test2_polynomial
-  import ThermoSysPro;
-  parameter Integer fluid = 3;
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(P0=600000, mode=
-       0)                                 annotation (Placement(transformation(
-          extent={{80,-10},{100,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(mode=0,
-      option_temperature=2,
-    P0=1000000)                     annotation (Placement(transformation(extent=
-           {{-100,-10},{-80,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD(fluid=fluid)
-                                                  annotation (Placement(
-        transformation(extent={{-10,-10},{10,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP(fluid=fluid)
-                                        annotation (Placement(transformation(
-          extent={{-60,-10},{-40,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1(fluid=fluid)
-                                         annotation (Placement(transformation(
-          extent={{40,-10},{60,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
-    Duration=10000,
-    Initialvalue=1e5,
-    Finalvalue=4e6) annotation (Placement(transformation(extent={{-118,-40},{
-            -98,-20}}, rotation=0)));
-equation
-  connect(perteDP.C2,volumeD. Ce)
-    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,255}));
-  connect(sourceP.C, perteDP.C1)
-    annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255}));
-  connect(perteDP1.C2, puitsP.C)
-    annotation (Line(points={{60,0},{80,0}}, color={0,0,255}));
-  connect(rampe.y, sourceP.ISpecificEnthalpy)
-    annotation (Line(points={{-97,-30},{-90,-30},{-90,-5}}));
-  connect(volumeD.Cs3, perteDP1.C1) annotation (Line(points={{10,0},{40,0}},
-        color={0,0,255}));
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Window(
-      x=0.28,
-      y=0.03,
-      width=0.5,
-      height=0.6),
-    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
-    __Dymola_experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end Test2_polynomial;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
+model Test2_polynomial
+  import ThermoSysPro;
+  parameter Integer fluid = 3;
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP puitsP(P0=600000, mode=
+       0)                                 annotation (Placement(transformation(
+          extent={{80,-10},{100,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP(mode=0,
+      option_temperature=2,
+    P0=1000000)                     annotation (Placement(transformation(extent=
+           {{-100,-10},{-80,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeD volumeD(fluid=fluid)
+                                                  annotation (Placement(
+        transformation(extent={{-10,-10},{10,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP(fluid=fluid)
+                                        annotation (Placement(transformation(
+          extent={{-60,-10},{-40,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe perteDP1(fluid=fluid)
+                                         annotation (Placement(transformation(
+          extent={{40,-10},{60,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(
+    Duration=10000,
+    Initialvalue=1e5,
+    Finalvalue=4e6) annotation (Placement(transformation(extent={{-118,-40},{
+            -98,-20}}, rotation=0)));
+equation
+  connect(perteDP.C2,volumeD. Ce)
+    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,255}));
+  connect(sourceP.C, perteDP.C1)
+    annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255}));
+  connect(perteDP1.C2, puitsP.C)
+    annotation (Line(points={{60,0},{80,0}}, color={0,0,255}));
+  connect(rampe.y, sourceP.ISpecificEnthalpy)
+    annotation (Line(points={{-97,-30},{-90,-30},{-90,-5}}));
+  connect(volumeD.Cs3, perteDP1.C1) annotation (Line(points={{10,0},{40,0}},
+        color={0,0,255}));
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Window(
+      x=0.28,
+      y=0.03,
+      width=0.5,
+      height=0.6),
+    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
+    __Dymola_experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end Test2_polynomial;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test3_IF97.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test3_IF97.mo
index a200c68dce1f95060d5cee2758646f8c6dde1c96..f87ba57aba32c7a54103cf4ef1a8fb5cf38d5b52 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test3_IF97.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test3_IF97.mo
@@ -1,114 +1,114 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
-model Test3_IF97
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-98,40},{-78,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe
-    annotation (Placement(transformation(extent={{-70,40},{-50,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1
-    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve
-    annotation (Placement(transformation(
-        origin={-46,-10},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1
-    annotation (Placement(transformation(
-        origin={-46,-70},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2
-    annotation (Placement(transformation(extent={{-20,16},{0,36}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve3
-    annotation (Placement(transformation(extent={{20,16},{40,36}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve4
-    annotation (Placement(transformation(extent={{0,-44},{20,-24}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe2
-    annotation (Placement(transformation(extent={{50,10},{70,30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{80,10},{100,30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V4(Starttime=4, Duration=
-       2)         annotation (Placement(transformation(extent={{-40,60},{-20,80}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V5(Initialvalue=1)
-    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V3(
-    Initialvalue=1,
-    Finalvalue=0,
-    Starttime=4,
-    Duration=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V1
-    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V2
-    annotation (Placement(transformation(extent={{-100,-80},{-80,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(V=1e-18)
-    annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(V=1e-18)
-    annotation (Placement(transformation(extent={{-50,-30},{-30,-50}}, rotation=
-           0)));
-equation
-  connect(sourceP.C, lumpedStraightPipe.C1)
-    annotation (Line(points={{-78,50},{-70,50}}, color={0,0,255}));
-  connect(sourceP1.C, lumpedStraightPipe1.C1)
-    annotation (Line(points={{-80,-90},{-70,-90}}, color={0,0,255}));
-  connect(lumpedStraightPipe1.C2, controlValve1.C1) annotation (Line(points={{
-          -50,-90},{-40,-90},{-40,-80}}, color={0,0,255}));
-  connect(controlValve4.C2, sinkP.C)
-    annotation (Line(points={{20,-40},{40,-40}}, color={0,0,255}));
-  connect(controlValve2.C2, controlValve3.C1)
-    annotation (Line(points={{0,20},{20,20}}, color={0,0,255}));
-  connect(controlValve3.C2, lumpedStraightPipe2.C1)
-    annotation (Line(points={{40,20},{50,20}}, color={0,0,255}));
-  connect(lumpedStraightPipe2.C2, sinkP1.C)
-    annotation (Line(points={{70,20},{80,20}}, color={0,0,255}));
-  connect(V4.y, controlValve2.Ouv) annotation (Line(points={{-19,70},{-10,70},{
-          -10,37}}));
-  connect(V5.y, controlValve3.Ouv) annotation (Line(points={{21,70},{30,70},{30,
-          37}}));
-  connect(V3.y, controlValve4.Ouv) annotation (Line(points={{1,-10},{10,-10},{
-          10,-23}}));
-  connect(V1.y, controlValve.Ouv) annotation (Line(points={{-79,-10},{-57,-10}}));
-  connect(V2.y, controlValve1.Ouv) annotation (Line(points={{-79,-70},{-57,-70}}));
-  connect(volumeC.Cs, controlValve2.C1)
-    annotation (Line(points={{-30,20},{-20,20}}, color={0,0,255}));
-  connect(lumpedStraightPipe.C2, volumeC.Ce2) annotation (Line(points={{-50,50},
-          {-40,50},{-40,29}}, color={0,0,255}));
-  connect(volumeC.Ce3, controlValve.C2) annotation (Line(points={{-40,10},{-40,
-          0}}));
-  connect(controlValve.C1, volumeA.Cs2) annotation (Line(points={{-40,-20},{-40,
-          -30}}));
-  connect(volumeA.Cs1, controlValve4.C1)
-    annotation (Line(points={{-30,-40},{0,-40}}, color={0,0,255}));
-  connect(volumeA.Ce2, controlValve1.C2)
-    annotation (Line(points={{-40,-49.8},{-40,-60}}));
-  annotation (Diagram(graphics),
-    experiment(StopTime=10000),
-    __Dymola_experimentSetupOutput,
-    Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end Test3_IF97;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
+model Test3_IF97
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-98,40},{-78,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe
+    annotation (Placement(transformation(extent={{-70,40},{-50,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1
+    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve
+    annotation (Placement(transformation(
+        origin={-46,-10},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1
+    annotation (Placement(transformation(
+        origin={-46,-70},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2
+    annotation (Placement(transformation(extent={{-20,16},{0,36}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve3
+    annotation (Placement(transformation(extent={{20,16},{40,36}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve4
+    annotation (Placement(transformation(extent={{0,-44},{20,-24}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe2
+    annotation (Placement(transformation(extent={{50,10},{70,30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{80,10},{100,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V4(Starttime=4, Duration=
+       2)         annotation (Placement(transformation(extent={{-40,60},{-20,80}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V5(Initialvalue=1)
+    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V3(
+    Initialvalue=1,
+    Finalvalue=0,
+    Starttime=4,
+    Duration=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V1
+    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V2
+    annotation (Placement(transformation(extent={{-100,-80},{-80,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(V=1e-18)
+    annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(V=1e-18)
+    annotation (Placement(transformation(extent={{-50,-30},{-30,-50}}, rotation=
+           0)));
+equation
+  connect(sourceP.C, lumpedStraightPipe.C1)
+    annotation (Line(points={{-78,50},{-70,50}}, color={0,0,255}));
+  connect(sourceP1.C, lumpedStraightPipe1.C1)
+    annotation (Line(points={{-80,-90},{-70,-90}}, color={0,0,255}));
+  connect(lumpedStraightPipe1.C2, controlValve1.C1) annotation (Line(points={{
+          -50,-90},{-40,-90},{-40,-80}}, color={0,0,255}));
+  connect(controlValve4.C2, sinkP.C)
+    annotation (Line(points={{20,-40},{40,-40}}, color={0,0,255}));
+  connect(controlValve2.C2, controlValve3.C1)
+    annotation (Line(points={{0,20},{20,20}}, color={0,0,255}));
+  connect(controlValve3.C2, lumpedStraightPipe2.C1)
+    annotation (Line(points={{40,20},{50,20}}, color={0,0,255}));
+  connect(lumpedStraightPipe2.C2, sinkP1.C)
+    annotation (Line(points={{70,20},{80,20}}, color={0,0,255}));
+  connect(V4.y, controlValve2.Ouv) annotation (Line(points={{-19,70},{-10,70},{
+          -10,37}}));
+  connect(V5.y, controlValve3.Ouv) annotation (Line(points={{21,70},{30,70},{30,
+          37}}));
+  connect(V3.y, controlValve4.Ouv) annotation (Line(points={{1,-10},{10,-10},{
+          10,-23}}));
+  connect(V1.y, controlValve.Ouv) annotation (Line(points={{-79,-10},{-57,-10}}));
+  connect(V2.y, controlValve1.Ouv) annotation (Line(points={{-79,-70},{-57,-70}}));
+  connect(volumeC.Cs, controlValve2.C1)
+    annotation (Line(points={{-30,20},{-20,20}}, color={0,0,255}));
+  connect(lumpedStraightPipe.C2, volumeC.Ce2) annotation (Line(points={{-50,50},
+          {-40,50},{-40,29}}, color={0,0,255}));
+  connect(volumeC.Ce3, controlValve.C2) annotation (Line(points={{-40,10},{-40,
+          0}}));
+  connect(controlValve.C1, volumeA.Cs2) annotation (Line(points={{-40,-20},{-40,
+          -30}}));
+  connect(volumeA.Cs1, controlValve4.C1)
+    annotation (Line(points={{-30,-40},{0,-40}}, color={0,0,255}));
+  connect(volumeA.Ce2, controlValve1.C2)
+    annotation (Line(points={{-40,-49.8},{-40,-60}}));
+  annotation (Diagram(graphics),
+    experiment(StopTime=10000),
+    __Dymola_experimentSetupOutput,
+    Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end Test3_IF97;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test3_polynomial.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test3_polynomial.mo
index 56685aa5c897762dd1361ed50bfe5f56cb477390..c63b593f62833683eded430cab7e08eee98c399a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test3_polynomial.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/Test3_polynomial.mo
@@ -1,111 +1,111 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
-model Test3_polynomial
-
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
-    annotation (Placement(transformation(extent={{-98,40},{-78,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(fluid=3)
-    annotation (Placement(transformation(extent={{-70,40},{-50,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(fluid=3)
-    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve(fluid=3)
-    annotation (Placement(transformation(
-        origin={-46,-10},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1(fluid=3)
-    annotation (Placement(transformation(
-        origin={-46,-70},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2(fluid=3)
-    annotation (Placement(transformation(extent={{-20,16},{0,36}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve3(fluid=3)
-    annotation (Placement(transformation(extent={{20,16},{40,36}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve4(fluid=3)
-    annotation (Placement(transformation(extent={{0,-44},{20,-24}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
-    annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(fluid=3)
-    annotation (Placement(transformation(extent={{50,10},{70,30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
-    annotation (Placement(transformation(extent={{80,10},{100,30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V4(Starttime=4, Duration=
-       2)         annotation (Placement(transformation(extent={{-40,60},{-20,80}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V5(Initialvalue=1)
-    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V3(
-    Initialvalue=1,
-    Finalvalue=0,
-    Starttime=4,
-    Duration=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V1
-    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V2
-    annotation (Placement(transformation(extent={{-100,-80},{-80,-60}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(V=1e-18, fluid=3)
-    annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(V=1e-18, fluid=3)
-    annotation (Placement(transformation(extent={{-50,-30},{-30,-50}}, rotation=
-           0)));
-equation
-  connect(sourceP.C, lumpedStraightPipe.C1)
-    annotation (Line(points={{-78,50},{-70,50}}, color={0,0,255}));
-  connect(sourceP1.C, lumpedStraightPipe1.C1)
-    annotation (Line(points={{-80,-90},{-70,-90}}, color={0,0,255}));
-  connect(lumpedStraightPipe1.C2, controlValve1.C1) annotation (Line(points={{
-          -50,-90},{-40,-90},{-40,-80}}, color={0,0,255}));
-  connect(controlValve4.C2, sinkP.C)
-    annotation (Line(points={{20,-40},{40,-40}}, color={0,0,255}));
-  connect(controlValve2.C2, controlValve3.C1)
-    annotation (Line(points={{0,20},{20,20}}, color={0,0,255}));
-  connect(controlValve3.C2, lumpedStraightPipe2.C1)
-    annotation (Line(points={{40,20},{50,20}}, color={0,0,255}));
-  connect(lumpedStraightPipe2.C2, sinkP1.C)
-    annotation (Line(points={{70,20},{80,20}}, color={0,0,255}));
-  connect(V4.y, controlValve2.Ouv) annotation (Line(points={{-19,70},{-10,70},{
-          -10,37}}));
-  connect(V5.y, controlValve3.Ouv) annotation (Line(points={{21,70},{30,70},{30,
-          37}}));
-  connect(V3.y, controlValve4.Ouv) annotation (Line(points={{1,-10},{10,-10},{
-          10,-23}}));
-  connect(V1.y, controlValve.Ouv) annotation (Line(points={{-79,-10},{-57,-10}}));
-  connect(V2.y, controlValve1.Ouv) annotation (Line(points={{-79,-70},{-57,-70}}));
-  connect(volumeC.Cs, controlValve2.C1)
-    annotation (Line(points={{-30,20},{-20,20}}, color={0,0,255}));
-  connect(lumpedStraightPipe.C2, volumeC.Ce2) annotation (Line(points={{-50,50},
-          {-40,50},{-40,29}}, color={0,0,255}));
-  connect(volumeC.Ce3, controlValve.C2) annotation (Line(points={{-40,10},{-40,
-          0}}));
-  connect(controlValve.C1, volumeA.Cs2) annotation (Line(points={{-40,-20},{-40,
-          -30}}));
-  connect(volumeA.Cs1, controlValve4.C1)
-    annotation (Line(points={{-30,-40},{0,-40}}, color={0,0,255}));
-  connect(volumeA.Ce2, controlValve1.C2)
-    annotation (Line(points={{-40,-49.8},{-40,-60}}));
-  annotation (Diagram(graphics), Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end Test3_polynomial;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation.Bench;
+model Test3_polynomial
+
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP
+    annotation (Placement(transformation(extent={{-98,40},{-78,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SourceP sourceP1
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe(fluid=3)
+    annotation (Placement(transformation(extent={{-70,40},{-50,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(fluid=3)
+    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve(fluid=3)
+    annotation (Placement(transformation(
+        origin={-46,-10},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve1(fluid=3)
+    annotation (Placement(transformation(
+        origin={-46,-70},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve2(fluid=3)
+    annotation (Placement(transformation(extent={{-20,16},{0,36}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve3(fluid=3)
+    annotation (Placement(transformation(extent={{20,16},{40,36}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve controlValve4(fluid=3)
+    annotation (Placement(transformation(extent={{0,-44},{20,-24}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP
+    annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(fluid=3)
+    annotation (Placement(transformation(extent={{50,10},{70,30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.SinkP sinkP1
+    annotation (Placement(transformation(extent={{80,10},{100,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V4(Starttime=4, Duration=
+       2)         annotation (Placement(transformation(extent={{-40,60},{-20,80}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V5(Initialvalue=1)
+    annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V3(
+    Initialvalue=1,
+    Finalvalue=0,
+    Starttime=4,
+    Duration=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V1
+    annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe V2
+    annotation (Placement(transformation(extent={{-100,-80},{-80,-60}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC volumeC(V=1e-18, fluid=3)
+    annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(V=1e-18, fluid=3)
+    annotation (Placement(transformation(extent={{-50,-30},{-30,-50}}, rotation=
+           0)));
+equation
+  connect(sourceP.C, lumpedStraightPipe.C1)
+    annotation (Line(points={{-78,50},{-70,50}}, color={0,0,255}));
+  connect(sourceP1.C, lumpedStraightPipe1.C1)
+    annotation (Line(points={{-80,-90},{-70,-90}}, color={0,0,255}));
+  connect(lumpedStraightPipe1.C2, controlValve1.C1) annotation (Line(points={{
+          -50,-90},{-40,-90},{-40,-80}}, color={0,0,255}));
+  connect(controlValve4.C2, sinkP.C)
+    annotation (Line(points={{20,-40},{40,-40}}, color={0,0,255}));
+  connect(controlValve2.C2, controlValve3.C1)
+    annotation (Line(points={{0,20},{20,20}}, color={0,0,255}));
+  connect(controlValve3.C2, lumpedStraightPipe2.C1)
+    annotation (Line(points={{40,20},{50,20}}, color={0,0,255}));
+  connect(lumpedStraightPipe2.C2, sinkP1.C)
+    annotation (Line(points={{70,20},{80,20}}, color={0,0,255}));
+  connect(V4.y, controlValve2.Ouv) annotation (Line(points={{-19,70},{-10,70},{
+          -10,37}}));
+  connect(V5.y, controlValve3.Ouv) annotation (Line(points={{21,70},{30,70},{30,
+          37}}));
+  connect(V3.y, controlValve4.Ouv) annotation (Line(points={{1,-10},{10,-10},{
+          10,-23}}));
+  connect(V1.y, controlValve.Ouv) annotation (Line(points={{-79,-10},{-57,-10}}));
+  connect(V2.y, controlValve1.Ouv) annotation (Line(points={{-79,-70},{-57,-70}}));
+  connect(volumeC.Cs, controlValve2.C1)
+    annotation (Line(points={{-30,20},{-20,20}}, color={0,0,255}));
+  connect(lumpedStraightPipe.C2, volumeC.Ce2) annotation (Line(points={{-50,50},
+          {-40,50},{-40,29}}, color={0,0,255}));
+  connect(volumeC.Ce3, controlValve.C2) annotation (Line(points={{-40,10},{-40,
+          0}}));
+  connect(controlValve.C1, volumeA.Cs2) annotation (Line(points={{-40,-20},{-40,
+          -30}}));
+  connect(volumeA.Cs1, controlValve4.C1)
+    annotation (Line(points={{-30,-40},{0,-40}}, color={0,0,255}));
+  connect(volumeA.Ce2, controlValve1.C2)
+    annotation (Line(points={{-40,-49.8},{-40,-60}}));
+  annotation (Diagram(graphics), Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end Test3_polynomial;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/package.mo
index 9a4da51e5620d1add8ad4a16a628c85c279a3779..3c8c98826e5dc1455371992d6d701bd7ce43bb4e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/package.mo
@@ -1,117 +1,117 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-package Bench
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Bench;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+package Bench
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Bench;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/package.order
index ad3bbd5fc9ebdda5a72dec8ccf85a10ad56caaee..7682b6341c61fa1636615ec6a0389dd4b6761107 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/Bench/package.order
@@ -1,6 +1,6 @@
-Test1_IF97
-Test1_polynomial
-Test2_IF97
-Test2_polynomial
-Test3_IF97
-Test3_polynomial
+Test1_IF97
+Test1_polynomial
+Test2_IF97
+Test2_polynomial
+Test3_IF97
+Test3_polynomial
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_T.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_T.mo
index d153e90e6f7ddac7d9426359e1d225f475427a66..59376d3aae4dac42007b1d56a5fa924f5c139edb 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_T.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_T.mo
@@ -1,63 +1,63 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model calculette_T
-  parameter Units.SI.Temperature T_min=275;
-  parameter Units.SI.Temperature T_max=350;
-  parameter Units.SI.Density d=15;
-  Units.SI.Temperature T;
-
-  Units.SI.Density d1sat;
-  Units.SI.Density d2sat;
-  Units.SI.SurfaceTension sigma_polynomial;
-  Units.SI.SurfaceTension sigma_IF97;
-
-  Units.SI.Pressure Psat;
-  Units.SI.DynamicViscosity mu1;
-  Units.SI.DynamicViscosity mu2;
-  Units.SI.DynamicViscosity mu_polynomial "Dynamic viscosity";
-  Units.SI.DynamicViscosity mu_IF97 "Dynamic viscosity";
-  Real titre;
-protected
-  parameter Units.SI.Time dt=10000;
-  Real x = time/dt;
-
-equation
-  T = T_min + x*(T_max - T_min);
-
-  d1sat = ThermoSysPro.Properties.WaterSteamSimple.Density.d1sat_T(T);
-  d2sat = ThermoSysPro.Properties.WaterSteamSimple.Density.d2sat_T(T);
-
-  sigma_polynomial = ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SurfaceTension_T(T);
-  sigma_IF97 = ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.SurfaceTension_T(T);
-
-  Psat = ThermoSysPro.Properties.WaterSteamSimple.Pressure.psat_T(T);
-  mu1 = ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(d, T);
-  mu2 = ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(d, T);
-
-    mu_polynomial =
-    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(
-    d, T);
-    mu_IF97 = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(d,T);
-    titre = min(1,max(0,d2sat*(1-d1sat/d)/(d2sat - d1sat)));
-     annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
-                      coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)),
-    experiment(StopTime=10000, __Dymola_NumberOfIntervals=50000),
-    __Dymola_experimentSetupOutput);
-end calculette_T;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model calculette_T
+  parameter Units.SI.Temperature T_min=275;
+  parameter Units.SI.Temperature T_max=350;
+  parameter Units.SI.Density d=15;
+  Units.SI.Temperature T;
+
+  Units.SI.Density d1sat;
+  Units.SI.Density d2sat;
+  Units.SI.SurfaceTension sigma_polynomial;
+  Units.SI.SurfaceTension sigma_IF97;
+
+  Units.SI.Pressure Psat;
+  Units.SI.DynamicViscosity mu1;
+  Units.SI.DynamicViscosity mu2;
+  Units.SI.DynamicViscosity mu_polynomial "Dynamic viscosity";
+  Units.SI.DynamicViscosity mu_IF97 "Dynamic viscosity";
+  Real titre;
+protected
+  parameter Units.SI.Time dt=10000;
+  Real x = time/dt;
+
+equation
+  T = T_min + x*(T_max - T_min);
+
+  d1sat = ThermoSysPro.Properties.WaterSteamSimple.Density.d1sat_T(T);
+  d2sat = ThermoSysPro.Properties.WaterSteamSimple.Density.d2sat_T(T);
+
+  sigma_polynomial = ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SurfaceTension_T(T);
+  sigma_IF97 = ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.SurfaceTension_T(T);
+
+  Psat = ThermoSysPro.Properties.WaterSteamSimple.Pressure.psat_T(T);
+  mu1 = ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(d, T);
+  mu2 = ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(d, T);
+
+    mu_polynomial =
+    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(
+    d, T);
+    mu_IF97 = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(d,T);
+    titre = min(1,max(0,d2sat*(1-d1sat/d)/(d2sat - d1sat)));
+     annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
+                      coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)),
+    experiment(StopTime=10000, __Dymola_NumberOfIntervals=50000),
+    __Dymola_experimentSetupOutput);
+end calculette_T;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_d.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_d.mo
index 7a5f26321a698f420b1e7794b2d0e4adabdd95ca..76adf5b021f7544b7581d97f7ef82035d7449b8c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_d.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_d.mo
@@ -1,63 +1,63 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model calculette_d
-  parameter Units.SI.Temperature T=350;
-  parameter Units.SI.Density d_min=0.1;
-  parameter Units.SI.Density d_max=1000;
-  Units.SI.Density d;
-  Units.SI.Pressure p;
-  Units.SI.DynamicViscosity mu_polynomial "Dynamic viscosity";
-  Units.SI.ThermalConductivity lambda_polynomial "Thermal conductivity";
-  Units.SI.DynamicViscosity mu_IF97 "Dynamic viscosity";
-  Units.SI.ThermalConductivity lambda_IF97 "Thermal conductivity";
-
-  Units.SI.DynamicViscosity mu1;
-  Units.SI.DynamicViscosity mu2;
-
-  Units.SI.Density d1sat;
-  Units.SI.Density d2sat;
-  Real titre;
-
-protected
-  parameter Units.SI.Time dt=10000;
-  Real x = time/dt;
-
-equation
-  d = d_min + x*(d_max - d_min);
-  p = ThermoSysPro.Properties.WaterSteamSimple.Pressure.p_dT(d, T);
-  mu_polynomial =
-    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(
-    d, T);
-  lambda_polynomial =
-    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(
-    d, T);
-  mu_IF97 = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(d,T);
-  lambda_IF97 = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(d,T,p);
-  mu1 = ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(d, T);
-  mu2 = ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(d, T);
-  d1sat = ThermoSysPro.Properties.WaterSteamSimple.Density.d1sat_T(T);
-  d2sat = ThermoSysPro.Properties.WaterSteamSimple.Density.d2sat_T(T);
-  titre = min(1,max(0,d2sat*(1-d1sat/d)/(d2sat - d1sat)));
-
-    annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
-                     coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)),
-    experiment(StopTime=10000, __Dymola_NumberOfIntervals=50000),
-    __Dymola_experimentSetupOutput);
-end calculette_d;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model calculette_d
+  parameter Units.SI.Temperature T=350;
+  parameter Units.SI.Density d_min=0.1;
+  parameter Units.SI.Density d_max=1000;
+  Units.SI.Density d;
+  Units.SI.Pressure p;
+  Units.SI.DynamicViscosity mu_polynomial "Dynamic viscosity";
+  Units.SI.ThermalConductivity lambda_polynomial "Thermal conductivity";
+  Units.SI.DynamicViscosity mu_IF97 "Dynamic viscosity";
+  Units.SI.ThermalConductivity lambda_IF97 "Thermal conductivity";
+
+  Units.SI.DynamicViscosity mu1;
+  Units.SI.DynamicViscosity mu2;
+
+  Units.SI.Density d1sat;
+  Units.SI.Density d2sat;
+  Real titre;
+
+protected
+  parameter Units.SI.Time dt=10000;
+  Real x = time/dt;
+
+equation
+  d = d_min + x*(d_max - d_min);
+  p = ThermoSysPro.Properties.WaterSteamSimple.Pressure.p_dT(d, T);
+  mu_polynomial =
+    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(
+    d, T);
+  lambda_polynomial =
+    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(
+    d, T);
+  mu_IF97 = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(d,T);
+  lambda_IF97 = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(d,T,p);
+  mu1 = ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu1_dT(d, T);
+  mu2 = ThermoSysPro.Properties.WaterSteamSimple.Viscosity.mu2_dT(d, T);
+  d1sat = ThermoSysPro.Properties.WaterSteamSimple.Density.d1sat_T(T);
+  d2sat = ThermoSysPro.Properties.WaterSteamSimple.Density.d2sat_T(T);
+  titre = min(1,max(0,d2sat*(1-d1sat/d)/(d2sat - d1sat)));
+
+    annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
+                     coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)),
+    experiment(StopTime=10000, __Dymola_NumberOfIntervals=50000),
+    __Dymola_experimentSetupOutput);
+end calculette_d;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_h.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_h.mo
index 5badcd4f71063d4b8ea89f3f04c713371caacde7..094047f1ab908b2ec1a4a54b8267a8993d3a95a3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_h.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_h.mo
@@ -1,60 +1,60 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model calculette_h
-  parameter Units.SI.Pressure p=50e5;
-  parameter Units.SI.SpecificEnthalpy h_min=1e5;
-  parameter Units.SI.SpecificEnthalpy h_max=5e6;
-  Units.SI.SpecificEnthalpy h;
-  Units.SI.SpecificEnthalpy h1sat;
-  Units.SI.SpecificEnthalpy h2sat;
-  Units.SI.Temperature T1;
-  Units.SI.Temperature Tsat1;
-  Units.SI.SpecificEnthalpy h1sat_IF97;
-  Units.SI.SpecificEnthalpy h2sat_IF97;
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
-  ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro_polynomial;
-
-protected
-  parameter Units.SI.Time dt=10000;
-  Real x = time/dt;
-
-equation
-  h = h_min + x*(h_max - h_min);
-  pro_IF97 = ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_Ph(p,h);
-  pro_polynomial =
-    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
-    p,
-    h,
-    0);
-
-  h1sat = ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
-  h1sat_IF97 = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p);
-
-  h2sat = ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
-  T1 = ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h);
-  Tsat1 = ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
-
-  h2sat_IF97 = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p);
-   annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
-                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)),
-    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
-    __Dymola_experimentSetupOutput);
-end calculette_h;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model calculette_h
+  parameter Units.SI.Pressure p=50e5;
+  parameter Units.SI.SpecificEnthalpy h_min=1e5;
+  parameter Units.SI.SpecificEnthalpy h_max=5e6;
+  Units.SI.SpecificEnthalpy h;
+  Units.SI.SpecificEnthalpy h1sat;
+  Units.SI.SpecificEnthalpy h2sat;
+  Units.SI.Temperature T1;
+  Units.SI.Temperature Tsat1;
+  Units.SI.SpecificEnthalpy h1sat_IF97;
+  Units.SI.SpecificEnthalpy h2sat_IF97;
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
+  ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro_polynomial;
+
+protected
+  parameter Units.SI.Time dt=10000;
+  Real x = time/dt;
+
+equation
+  h = h_min + x*(h_max - h_min);
+  pro_IF97 = ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_Ph(p,h);
+  pro_polynomial =
+    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(
+    p,
+    h,
+    0);
+
+  h1sat = ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
+  h1sat_IF97 = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p);
+
+  h2sat = ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
+  T1 = ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h);
+  Tsat1 = ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
+
+  h2sat_IF97 = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p);
+   annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
+                    coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)),
+    experiment(StopTime=10000, __Dymola_NumberOfIntervals=5000),
+    __Dymola_experimentSetupOutput);
+end calculette_h;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_p.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_p.mo
index 9c7fe84daac8f1cdccdb8f5e4f6dd77319de3ea0..acd24327f8aa69e80273caada7873668a479e187 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_p.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/calculette_p.mo
@@ -1,58 +1,58 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model calculette_p
-  parameter Units.SI.SpecificEnthalpy h=5e5;
-  parameter Units.SI.Pressure p_min=0.1e5;
-  parameter Units.SI.Pressure p_max=220e5;
-  Units.SI.Pressure p;
-  Units.SI.SpecificEnthalpy h1sat;
-  Units.SI.SpecificEnthalpy h2sat;
-  Units.SI.SpecificEntropy s1sat;
-  Units.SI.SpecificEntropy s2sat;
-  Units.SI.SpecificEnthalpy h1sat_IF97;
-  Units.SI.SpecificEnthalpy h2sat_IF97;
-  Units.SI.Temperature T1;
-  Units.SI.Temperature Tsat1;
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
-  ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro_polynomial;
-protected
-  parameter Units.SI.Time dt=10000;
-  Real x = time/dt;
-
-equation
-  p = p_min + x*(p_max - p_min);
-  pro_IF97 = ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_Ph(p,h);
-  pro_polynomial =
-    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h);
-  h1sat = ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
-  h2sat = ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
-  T1 = ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h);
-  Tsat1 = ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
-  h1sat_IF97 = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p);
-  h2sat_IF97 = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p);
-  s1sat = ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1sat_P(p);
-  s2sat = ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2sat_P(p);
-
-    annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
-                     coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)),
-    experiment(StopTime=10000, __Dymola_NumberOfIntervals=50000),
-    __Dymola_experimentSetupOutput);
-end calculette_p;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model calculette_p
+  parameter Units.SI.SpecificEnthalpy h=5e5;
+  parameter Units.SI.Pressure p_min=0.1e5;
+  parameter Units.SI.Pressure p_max=220e5;
+  Units.SI.Pressure p;
+  Units.SI.SpecificEnthalpy h1sat;
+  Units.SI.SpecificEnthalpy h2sat;
+  Units.SI.SpecificEntropy s1sat;
+  Units.SI.SpecificEntropy s2sat;
+  Units.SI.SpecificEnthalpy h1sat_IF97;
+  Units.SI.SpecificEnthalpy h2sat_IF97;
+  Units.SI.Temperature T1;
+  Units.SI.Temperature Tsat1;
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
+  ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro_polynomial;
+protected
+  parameter Units.SI.Time dt=10000;
+  Real x = time/dt;
+
+equation
+  p = p_min + x*(p_max - p_min);
+  pro_IF97 = ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_Ph(p,h);
+  pro_polynomial =
+    ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h);
+  h1sat = ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
+  h2sat = ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
+  T1 = ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h);
+  Tsat1 = ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
+  h1sat_IF97 = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p);
+  h2sat_IF97 = ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p);
+  s1sat = ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1sat_P(p);
+  s2sat = ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2sat_P(p);
+
+    annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})},
+                     coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)),
+    experiment(StopTime=10000, __Dymola_NumberOfIntervals=50000),
+    __Dymola_experimentSetupOutput);
+end calculette_p;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_dT.mo
index a76fb5dd19ed1bc54b475e3644e3e115530b0838..86fb667e81d2ff35b4d49da0be99a02aa0fd8043 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_dT.mo
@@ -1,91 +1,91 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model generate_data_dT
-  import ThermoSysPro.Units.SI.*;
-  parameter Density d_min = 15;
-  parameter Density d_max = 1000;
-  parameter Density delta_d(min = 1) = 25;
-  parameter Temperature T_min = 290;
-  parameter Temperature T_max = 1000;
-  parameter Temperature  delta_T(min = 1) = 50;
-
-  Units.SI.DynamicViscosity mu_polynomial "Dynamic viscosity";
-  Units.SI.ThermalConductivity lambda_polynomial "Thermal conductivity";
-  Units.SI.DynamicViscosity mu_IF97 "Dynamic viscosity";
-  Units.SI.ThermalConductivity lambda_IF97 "Thermal conductivity";
-
-protected
-  parameter Integer n_d =  integer((d_max - d_min)/delta_d);
-  parameter Integer n_T = integer((T_max - T_min)/delta_T);
-
-  Integer i_mat;
-public
-  Real res_polynomial[n_d*n_T,4];
-  Real res_IF97[n_d*n_T,4];
-
-public
-   output AbsolutePressure d[n_d];
-   output SpecificEnthalpy T[n_T];
-
-algorithm
-  i_mat :=0;
-  for i_d in 1:n_d loop
-    d[i_d] := d_min + (i_d-1)*delta_d;
-    for i_T in 1:n_T loop
-      T[i_T] := T_min + (i_T-1)*delta_T;
-
-      //Properties
-      mu_polynomial :=
-        ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(
-        d[i_d], T[i_T]);
-
-      lambda_polynomial :=
-        ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(
-        d[i_d], T[i_T]);
-
-      mu_IF97 := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(
-         d[i_d],
-         T[i_T]);
-
-      lambda_IF97 := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(
-          d[i_d],
-         T[i_T],0,0);
-
-      //Store results
-      i_mat := i_mat + 1;
-      res_polynomial[i_mat,1] := d[i_d];
-      res_polynomial[i_mat,2] := T[i_T];
-      res_polynomial[i_mat,3] := mu_polynomial;
-      res_polynomial[i_mat,4] := lambda_polynomial;
-
-      res_IF97[i_mat,1] := d[i_d];
-      res_IF97[i_mat,2] := T[i_T];
-      res_IF97[i_mat,3] := mu_IF97;
-      res_IF97[i_mat,4] := lambda_IF97;
-
-    end for;
-
-  end for;
-
- //Write results
- DymolaCommands.MatrixIO.writeMatrix("res_polynomial_lbdmu_dT.mat","res_polynomial",res_polynomial);
- DymolaCommands.MatrixIO.writeMatrix("res_IF97_lbdmu_dT.mat","res_IF97",res_IF97);
-
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end generate_data_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model generate_data_dT
+  import ThermoSysPro.Units.SI.*;
+  parameter Density d_min = 15;
+  parameter Density d_max = 1000;
+  parameter Density delta_d(min = 1) = 25;
+  parameter Temperature T_min = 290;
+  parameter Temperature T_max = 1000;
+  parameter Temperature  delta_T(min = 1) = 50;
+
+  Units.SI.DynamicViscosity mu_polynomial "Dynamic viscosity";
+  Units.SI.ThermalConductivity lambda_polynomial "Thermal conductivity";
+  Units.SI.DynamicViscosity mu_IF97 "Dynamic viscosity";
+  Units.SI.ThermalConductivity lambda_IF97 "Thermal conductivity";
+
+protected
+  parameter Integer n_d =  integer((d_max - d_min)/delta_d);
+  parameter Integer n_T = integer((T_max - T_min)/delta_T);
+
+  Integer i_mat;
+public
+  Real res_polynomial[n_d*n_T,4];
+  Real res_IF97[n_d*n_T,4];
+
+public
+   output AbsolutePressure d[n_d];
+   output SpecificEnthalpy T[n_T];
+
+algorithm
+  i_mat :=0;
+  for i_d in 1:n_d loop
+    d[i_d] := d_min + (i_d-1)*delta_d;
+    for i_T in 1:n_T loop
+      T[i_T] := T_min + (i_T-1)*delta_T;
+
+      //Properties
+      mu_polynomial :=
+        ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(
+        d[i_d], T[i_T]);
+
+      lambda_polynomial :=
+        ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(
+        d[i_d], T[i_T]);
+
+      mu_IF97 := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(
+         d[i_d],
+         T[i_T]);
+
+      lambda_IF97 := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(
+          d[i_d],
+         T[i_T],0,0);
+
+      //Store results
+      i_mat := i_mat + 1;
+      res_polynomial[i_mat,1] := d[i_d];
+      res_polynomial[i_mat,2] := T[i_T];
+      res_polynomial[i_mat,3] := mu_polynomial;
+      res_polynomial[i_mat,4] := lambda_polynomial;
+
+      res_IF97[i_mat,1] := d[i_d];
+      res_IF97[i_mat,2] := T[i_T];
+      res_IF97[i_mat,3] := mu_IF97;
+      res_IF97[i_mat,4] := lambda_IF97;
+
+    end for;
+
+  end for;
+
+ //Write results
+ DymolaCommands.MatrixIO.writeMatrix("res_polynomial_lbdmu_dT.mat","res_polynomial",res_polynomial);
+ DymolaCommands.MatrixIO.writeMatrix("res_IF97_lbdmu_dT.mat","res_IF97",res_IF97);
+
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end generate_data_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_lowpressure_ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_lowpressure_ph.mo
index b9df9e4086e9562aad618e588bc382a19ce55d5d..574e12d5655f83eff80933ffbbcada63af7ccddc 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_lowpressure_ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_lowpressure_ph.mo
@@ -1,98 +1,98 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model generate_data_lowpressure_ph
-  import ThermoSysPro.Units.SI.*;
-  parameter Pressure p_min = 0.01e5;
-  parameter Pressure p_max = 10e5;
-  parameter Pressure delta_p(min = 1) = 1e5;
-  parameter SpecificEnthalpy h_min = 1e5;
-  parameter SpecificEnthalpy h_max = 5e6;
-  parameter SpecificEnthalpy  delta_h(min = 1) = 0.1e5;
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_polynomial;
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
- // Integer i_p;
- // Integer i_h;
-protected
-  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
-  parameter Integer n_h = integer((h_max - h_min)/delta_h);
-
-  Integer i_mat;
-  Real res_polynomial[n_p*n_h,12];
-  Real res_IF97[n_p*n_h,12];
-
-public
-   output AbsolutePressure p[n_p];
-   output SpecificEnthalpy h[n_h];
-
-algorithm
-  i_mat :=0;
-  for i_p in 1:n_p loop
-    p[i_p] := p_min + (i_p-1)*delta_p;
-    for i_h in 1:n_h loop
-      h[i_h] := h_min + (i_h-1)*delta_h;
-
-      //Properties
-      pro_IF97 := ThermoSysPro.Properties.Fluid.Ph(
-         p[i_p],
-         h[i_h],
-         0,1);
-
-       pro_polynomial := ThermoSysPro.Properties.Fluid.Ph(
-         p[i_p],
-         h[i_h],
-         0,3);
-
-      //Store results
-      i_mat := i_mat + 1;
-      res_polynomial[i_mat,1] := p[i_p];
-      res_polynomial[i_mat,2] := h[i_h];
-      res_polynomial[i_mat,3] := pro_polynomial.x;
-      res_polynomial[i_mat,4] := pro_polynomial.T;
-      res_polynomial[i_mat,5] := pro_polynomial.d;
-      res_polynomial[i_mat,6] := pro_polynomial.u;
-      res_polynomial[i_mat,7] := pro_polynomial.s;
-      res_polynomial[i_mat,8] := pro_polynomial.cp;
-      res_polynomial[i_mat,9] := pro_polynomial.ddhp;
-      res_polynomial[i_mat,10] := pro_polynomial.ddph;
-      res_polynomial[i_mat,11] := pro_polynomial.duph;
-      res_polynomial[i_mat,12] := pro_polynomial.duhp;
-
-      res_IF97[i_mat,1] := p[i_p];
-      res_IF97[i_mat,2] := h[i_h];
-      res_IF97[i_mat,3] := pro_IF97.x;
-      res_IF97[i_mat,4] := pro_IF97.T;
-      res_IF97[i_mat,5] := pro_IF97.d;
-      res_IF97[i_mat,6] := pro_IF97.u;
-      res_IF97[i_mat,7] := pro_IF97.s;
-      res_IF97[i_mat,8] := pro_IF97.cp;
-      res_IF97[i_mat,9] := pro_IF97.ddhp;
-      res_IF97[i_mat,10] := pro_IF97.ddph;
-      res_IF97[i_mat,11] := pro_IF97.duph;
-      res_IF97[i_mat,12] := pro_IF97.duhp;
-    end for;
-
-  end for;
-
- //Write results
- DymolaCommands.MatrixIO.writeMatrix("res_polynomial_lowpressure_ph.mat","res_polynomial",res_polynomial);
- DymolaCommands.MatrixIO.writeMatrix("res_IF97_lowpressure_ph.mat","res_IF97",res_IF97);
-
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end generate_data_lowpressure_ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model generate_data_lowpressure_ph
+  import ThermoSysPro.Units.SI.*;
+  parameter Pressure p_min = 0.01e5;
+  parameter Pressure p_max = 10e5;
+  parameter Pressure delta_p(min = 1) = 1e5;
+  parameter SpecificEnthalpy h_min = 1e5;
+  parameter SpecificEnthalpy h_max = 5e6;
+  parameter SpecificEnthalpy  delta_h(min = 1) = 0.1e5;
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_polynomial;
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
+ // Integer i_p;
+ // Integer i_h;
+protected
+  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
+  parameter Integer n_h = integer((h_max - h_min)/delta_h);
+
+  Integer i_mat;
+  Real res_polynomial[n_p*n_h,12];
+  Real res_IF97[n_p*n_h,12];
+
+public
+   output AbsolutePressure p[n_p];
+   output SpecificEnthalpy h[n_h];
+
+algorithm
+  i_mat :=0;
+  for i_p in 1:n_p loop
+    p[i_p] := p_min + (i_p-1)*delta_p;
+    for i_h in 1:n_h loop
+      h[i_h] := h_min + (i_h-1)*delta_h;
+
+      //Properties
+      pro_IF97 := ThermoSysPro.Properties.Fluid.Ph(
+         p[i_p],
+         h[i_h],
+         0,1);
+
+       pro_polynomial := ThermoSysPro.Properties.Fluid.Ph(
+         p[i_p],
+         h[i_h],
+         0,3);
+
+      //Store results
+      i_mat := i_mat + 1;
+      res_polynomial[i_mat,1] := p[i_p];
+      res_polynomial[i_mat,2] := h[i_h];
+      res_polynomial[i_mat,3] := pro_polynomial.x;
+      res_polynomial[i_mat,4] := pro_polynomial.T;
+      res_polynomial[i_mat,5] := pro_polynomial.d;
+      res_polynomial[i_mat,6] := pro_polynomial.u;
+      res_polynomial[i_mat,7] := pro_polynomial.s;
+      res_polynomial[i_mat,8] := pro_polynomial.cp;
+      res_polynomial[i_mat,9] := pro_polynomial.ddhp;
+      res_polynomial[i_mat,10] := pro_polynomial.ddph;
+      res_polynomial[i_mat,11] := pro_polynomial.duph;
+      res_polynomial[i_mat,12] := pro_polynomial.duhp;
+
+      res_IF97[i_mat,1] := p[i_p];
+      res_IF97[i_mat,2] := h[i_h];
+      res_IF97[i_mat,3] := pro_IF97.x;
+      res_IF97[i_mat,4] := pro_IF97.T;
+      res_IF97[i_mat,5] := pro_IF97.d;
+      res_IF97[i_mat,6] := pro_IF97.u;
+      res_IF97[i_mat,7] := pro_IF97.s;
+      res_IF97[i_mat,8] := pro_IF97.cp;
+      res_IF97[i_mat,9] := pro_IF97.ddhp;
+      res_IF97[i_mat,10] := pro_IF97.ddph;
+      res_IF97[i_mat,11] := pro_IF97.duph;
+      res_IF97[i_mat,12] := pro_IF97.duhp;
+    end for;
+
+  end for;
+
+ //Write results
+ DymolaCommands.MatrixIO.writeMatrix("res_polynomial_lowpressure_ph.mat","res_polynomial",res_polynomial);
+ DymolaCommands.MatrixIO.writeMatrix("res_IF97_lowpressure_ph.mat","res_IF97",res_IF97);
+
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end generate_data_lowpressure_ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_supercritique_ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_supercritique_ph.mo
index dda84b77ab8c3971f916b02a2367e8782fa0be55..b14b702b5f3b60f1d1b7ed522265e03efa4bd1bf 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_supercritique_ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_supercritique_ph.mo
@@ -1,97 +1,97 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model generate_data_supercritique_ph
-  import ThermoSysPro.Units.SI.*;
-  parameter Pressure p_min = 200e5;
-  parameter Pressure p_max = 400e5;
-  parameter Pressure delta_p(min = 1) = 10e5;
-  parameter SpecificEnthalpy h_min = 1e5;
-  parameter SpecificEnthalpy h_max = 4e6;
-  parameter SpecificEnthalpy  delta_h(min = 1) = 0.1e5;
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_polynomial;
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
-
-protected
-  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
-  parameter Integer n_h = integer((h_max - h_min)/delta_h);
-
-  Integer i_mat;
-  Real res_polynomial[n_p*n_h,12];
-  Real res_IF97[n_p*n_h,12];
-
-public
-   output AbsolutePressure p[n_p];
-   output SpecificEnthalpy h[n_h];
-
-algorithm
-  i_mat :=0;
-  for i_p in 1:n_p loop
-    p[i_p] := p_min + (i_p-1)*delta_p;
-    for i_h in 1:n_h loop
-      h[i_h] := h_min + (i_h-1)*delta_h;
-
-      //Properties
-      pro_IF97 := ThermoSysPro.Properties.Fluid.Ph(
-         p[i_p],
-         h[i_h],
-         0,1);
-
-       pro_polynomial := ThermoSysPro.Properties.Fluid.Ph(
-         p[i_p],
-         h[i_h],
-         0,3);
-
-      //Store results
-      i_mat := i_mat + 1;
-      res_polynomial[i_mat,1] := p[i_p];
-      res_polynomial[i_mat,2] := h[i_h];
-      res_polynomial[i_mat,3] := pro_polynomial.x;
-      res_polynomial[i_mat,4] := pro_polynomial.T;
-      res_polynomial[i_mat,5] := pro_polynomial.d;
-      res_polynomial[i_mat,6] := pro_polynomial.u;
-      res_polynomial[i_mat,7] := pro_polynomial.s;
-      res_polynomial[i_mat,8] := pro_polynomial.cp;
-      res_polynomial[i_mat,9] := pro_polynomial.ddhp;
-      res_polynomial[i_mat,10] := pro_polynomial.ddph;
-      res_polynomial[i_mat,11] := pro_polynomial.duph;
-      res_polynomial[i_mat,12] := pro_polynomial.duhp;
-
-      res_IF97[i_mat,1] := p[i_p];
-      res_IF97[i_mat,2] := h[i_h];
-      res_IF97[i_mat,3] := pro_IF97.x;
-      res_IF97[i_mat,4] := pro_IF97.T;
-      res_IF97[i_mat,5] := pro_IF97.d;
-      res_IF97[i_mat,6] := pro_IF97.u;
-      res_IF97[i_mat,7] := pro_IF97.s;
-      res_IF97[i_mat,8] := pro_IF97.cp;
-      res_IF97[i_mat,9] := pro_IF97.ddhp;
-      res_IF97[i_mat,10] := pro_IF97.ddph;
-      res_IF97[i_mat,11] := pro_IF97.duph;
-      res_IF97[i_mat,12] := pro_IF97.duhp;
-    end for;
-
-  end for;
-
- //Write results
- DymolaCommands.MatrixIO.writeMatrix("res_polynomial_supercritique_ph.mat","res_polynomial",res_polynomial);
- DymolaCommands.MatrixIO.writeMatrix("res_IF97_supercritique_ph.mat","res_IF97",res_IF97);
-
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end generate_data_supercritique_ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model generate_data_supercritique_ph
+  import ThermoSysPro.Units.SI.*;
+  parameter Pressure p_min = 200e5;
+  parameter Pressure p_max = 400e5;
+  parameter Pressure delta_p(min = 1) = 10e5;
+  parameter SpecificEnthalpy h_min = 1e5;
+  parameter SpecificEnthalpy h_max = 4e6;
+  parameter SpecificEnthalpy  delta_h(min = 1) = 0.1e5;
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_polynomial;
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
+
+protected
+  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
+  parameter Integer n_h = integer((h_max - h_min)/delta_h);
+
+  Integer i_mat;
+  Real res_polynomial[n_p*n_h,12];
+  Real res_IF97[n_p*n_h,12];
+
+public
+   output AbsolutePressure p[n_p];
+   output SpecificEnthalpy h[n_h];
+
+algorithm
+  i_mat :=0;
+  for i_p in 1:n_p loop
+    p[i_p] := p_min + (i_p-1)*delta_p;
+    for i_h in 1:n_h loop
+      h[i_h] := h_min + (i_h-1)*delta_h;
+
+      //Properties
+      pro_IF97 := ThermoSysPro.Properties.Fluid.Ph(
+         p[i_p],
+         h[i_h],
+         0,1);
+
+       pro_polynomial := ThermoSysPro.Properties.Fluid.Ph(
+         p[i_p],
+         h[i_h],
+         0,3);
+
+      //Store results
+      i_mat := i_mat + 1;
+      res_polynomial[i_mat,1] := p[i_p];
+      res_polynomial[i_mat,2] := h[i_h];
+      res_polynomial[i_mat,3] := pro_polynomial.x;
+      res_polynomial[i_mat,4] := pro_polynomial.T;
+      res_polynomial[i_mat,5] := pro_polynomial.d;
+      res_polynomial[i_mat,6] := pro_polynomial.u;
+      res_polynomial[i_mat,7] := pro_polynomial.s;
+      res_polynomial[i_mat,8] := pro_polynomial.cp;
+      res_polynomial[i_mat,9] := pro_polynomial.ddhp;
+      res_polynomial[i_mat,10] := pro_polynomial.ddph;
+      res_polynomial[i_mat,11] := pro_polynomial.duph;
+      res_polynomial[i_mat,12] := pro_polynomial.duhp;
+
+      res_IF97[i_mat,1] := p[i_p];
+      res_IF97[i_mat,2] := h[i_h];
+      res_IF97[i_mat,3] := pro_IF97.x;
+      res_IF97[i_mat,4] := pro_IF97.T;
+      res_IF97[i_mat,5] := pro_IF97.d;
+      res_IF97[i_mat,6] := pro_IF97.u;
+      res_IF97[i_mat,7] := pro_IF97.s;
+      res_IF97[i_mat,8] := pro_IF97.cp;
+      res_IF97[i_mat,9] := pro_IF97.ddhp;
+      res_IF97[i_mat,10] := pro_IF97.ddph;
+      res_IF97[i_mat,11] := pro_IF97.duph;
+      res_IF97[i_mat,12] := pro_IF97.duhp;
+    end for;
+
+  end for;
+
+ //Write results
+ DymolaCommands.MatrixIO.writeMatrix("res_polynomial_supercritique_ph.mat","res_polynomial",res_polynomial);
+ DymolaCommands.MatrixIO.writeMatrix("res_IF97_supercritique_ph.mat","res_IF97",res_IF97);
+
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end generate_data_supercritique_ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_twophase_ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_twophase_ph.mo
index a6deb5b117486a18454290d3340f2e6b596d5e6b..6828b9cfce22003a63fb5cfcd8e58c677f16c433 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_twophase_ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_twophase_ph.mo
@@ -1,98 +1,98 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model generate_data_twophase_ph
-  import ThermoSysPro.Units.SI.*;
-  parameter Pressure p_min = 1e5;
-  parameter Pressure p_max = 220e5;
-  parameter Pressure delta_p(min = 1) = 20e5;
-  parameter SpecificEnthalpy h_min = 1e5;
-  parameter SpecificEnthalpy h_max = 4e6;
-  parameter SpecificEnthalpy  delta_h(min = 1) = 0.1e5;
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_polynomial;
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
- // Integer i_p;
- // Integer i_h;
-protected
-  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
-  parameter Integer n_h = integer((h_max - h_min)/delta_h);
-
-  Integer i_mat;
-  Real res_polynomial[n_p*n_h,12];
-  Real res_IF97[n_p*n_h,12];
-
-public
-   output AbsolutePressure p[n_p];
-   output SpecificEnthalpy h[n_h];
-
-algorithm
-  i_mat :=0;
-  for i_p in 1:n_p loop
-    p[i_p] := p_min + (i_p-1)*delta_p;
-    for i_h in 1:n_h loop
-      h[i_h] := h_min + (i_h-1)*delta_h;
-
-      //Properties
-      pro_IF97 := ThermoSysPro.Properties.Fluid.Ph(
-         p[i_p],
-         h[i_h],
-         0,1);
-
-       pro_polynomial := ThermoSysPro.Properties.Fluid.Ph(
-         p[i_p],
-         h[i_h],
-         0,3);
-
-      //Store results
-      i_mat := i_mat + 1;
-      res_polynomial[i_mat,1] := p[i_p];
-      res_polynomial[i_mat,2] := h[i_h];
-      res_polynomial[i_mat,3] := pro_polynomial.x;
-      res_polynomial[i_mat,4] := pro_polynomial.T;
-      res_polynomial[i_mat,5] := pro_polynomial.d;
-      res_polynomial[i_mat,6] := pro_polynomial.u;
-      res_polynomial[i_mat,7] := pro_polynomial.s;
-      res_polynomial[i_mat,8] := pro_polynomial.cp;
-      res_polynomial[i_mat,9] := pro_polynomial.ddhp;
-      res_polynomial[i_mat,10] := pro_polynomial.ddph;
-      res_polynomial[i_mat,11] := pro_polynomial.duph;
-      res_polynomial[i_mat,12] := pro_polynomial.duhp;
-
-      res_IF97[i_mat,1] := p[i_p];
-      res_IF97[i_mat,2] := h[i_h];
-      res_IF97[i_mat,3] := pro_IF97.x;
-      res_IF97[i_mat,4] := pro_IF97.T;
-      res_IF97[i_mat,5] := pro_IF97.d;
-      res_IF97[i_mat,6] := pro_IF97.u;
-      res_IF97[i_mat,7] := pro_IF97.s;
-      res_IF97[i_mat,8] := pro_IF97.cp;
-      res_IF97[i_mat,9] := pro_IF97.ddhp;
-      res_IF97[i_mat,10] := pro_IF97.ddph;
-      res_IF97[i_mat,11] := pro_IF97.duph;
-      res_IF97[i_mat,12] := pro_IF97.duhp;
-    end for;
-
-  end for;
-
- //Write results
- DymolaCommands.MatrixIO.writeMatrix("res_polynomial_twophase_ph.mat","res_polynomial",res_polynomial);
- DymolaCommands.MatrixIO.writeMatrix("res_IF97_twophase_ph.mat","res_IF97",res_IF97);
-
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end generate_data_twophase_ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model generate_data_twophase_ph
+  import ThermoSysPro.Units.SI.*;
+  parameter Pressure p_min = 1e5;
+  parameter Pressure p_max = 220e5;
+  parameter Pressure delta_p(min = 1) = 20e5;
+  parameter SpecificEnthalpy h_min = 1e5;
+  parameter SpecificEnthalpy h_max = 4e6;
+  parameter SpecificEnthalpy  delta_h(min = 1) = 0.1e5;
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_polynomial;
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_IF97;
+ // Integer i_p;
+ // Integer i_h;
+protected
+  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
+  parameter Integer n_h = integer((h_max - h_min)/delta_h);
+
+  Integer i_mat;
+  Real res_polynomial[n_p*n_h,12];
+  Real res_IF97[n_p*n_h,12];
+
+public
+   output AbsolutePressure p[n_p];
+   output SpecificEnthalpy h[n_h];
+
+algorithm
+  i_mat :=0;
+  for i_p in 1:n_p loop
+    p[i_p] := p_min + (i_p-1)*delta_p;
+    for i_h in 1:n_h loop
+      h[i_h] := h_min + (i_h-1)*delta_h;
+
+      //Properties
+      pro_IF97 := ThermoSysPro.Properties.Fluid.Ph(
+         p[i_p],
+         h[i_h],
+         0,1);
+
+       pro_polynomial := ThermoSysPro.Properties.Fluid.Ph(
+         p[i_p],
+         h[i_h],
+         0,3);
+
+      //Store results
+      i_mat := i_mat + 1;
+      res_polynomial[i_mat,1] := p[i_p];
+      res_polynomial[i_mat,2] := h[i_h];
+      res_polynomial[i_mat,3] := pro_polynomial.x;
+      res_polynomial[i_mat,4] := pro_polynomial.T;
+      res_polynomial[i_mat,5] := pro_polynomial.d;
+      res_polynomial[i_mat,6] := pro_polynomial.u;
+      res_polynomial[i_mat,7] := pro_polynomial.s;
+      res_polynomial[i_mat,8] := pro_polynomial.cp;
+      res_polynomial[i_mat,9] := pro_polynomial.ddhp;
+      res_polynomial[i_mat,10] := pro_polynomial.ddph;
+      res_polynomial[i_mat,11] := pro_polynomial.duph;
+      res_polynomial[i_mat,12] := pro_polynomial.duhp;
+
+      res_IF97[i_mat,1] := p[i_p];
+      res_IF97[i_mat,2] := h[i_h];
+      res_IF97[i_mat,3] := pro_IF97.x;
+      res_IF97[i_mat,4] := pro_IF97.T;
+      res_IF97[i_mat,5] := pro_IF97.d;
+      res_IF97[i_mat,6] := pro_IF97.u;
+      res_IF97[i_mat,7] := pro_IF97.s;
+      res_IF97[i_mat,8] := pro_IF97.cp;
+      res_IF97[i_mat,9] := pro_IF97.ddhp;
+      res_IF97[i_mat,10] := pro_IF97.ddph;
+      res_IF97[i_mat,11] := pro_IF97.duph;
+      res_IF97[i_mat,12] := pro_IF97.duhp;
+    end for;
+
+  end for;
+
+ //Write results
+ DymolaCommands.MatrixIO.writeMatrix("res_polynomial_twophase_ph.mat","res_polynomial",res_polynomial);
+ DymolaCommands.MatrixIO.writeMatrix("res_IF97_twophase_ph.mat","res_IF97",res_IF97);
+
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end generate_data_twophase_ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_twophase_ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_twophase_ps.mo
index 62f754213869a594c0c28ba07195a1dbd31c264c..9bfe466479dcfff34364cdb6fc7767c82d161432 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_twophase_ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_twophase_ps.mo
@@ -1,94 +1,94 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model generate_data_twophase_ps
-  import ThermoSysPro.Units.SI.*;
-  parameter Pressure p_min = 1e5;
-  parameter Pressure p_max = 150e5;
-  parameter Pressure delta_p(min = 1) = 10e5;
-  parameter SpecificEnthalpy s_min = 1000;
-  parameter SpecificEnthalpy s_max = 8000;
-  parameter SpecificEnthalpy  delta_s(min = 1) = 100;
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro_polynomial;
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro_IF97;
-
-protected
-  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
-  parameter Integer n_s = integer((s_max - s_min)/delta_s);
-
-  Integer i_mat;
-  Real res_polynomial[n_p*n_s,10];
-  Real res_IF97[n_p*n_s,10];
-
-public
-   output AbsolutePressure p[n_p];
-   output SpecificEnthalpy s[n_s];
-
-algorithm
-  i_mat :=0;
-  for i_p in 1:n_p loop
-    p[i_p] := p_min + (i_p-1)*delta_p;
-    for i_s in 1:n_s loop
-      s[i_s] := s_min + (i_s-1)*delta_s;
-
-      //Properties
-      pro_IF97 := ThermoSysPro.Properties.Fluid.Ps(
-         p[i_p],
-         s[i_s],
-         0,3);
-
-      pro_polynomial := ThermoSysPro.Properties.Fluid.Ps(
-         p[i_p],
-         s[i_s],
-         0,3);
-
-      //Store results
-      i_mat := i_mat + 1;
-      res_polynomial[i_mat,1] := p[i_p];
-      res_polynomial[i_mat,2] := s[i_s];
-      res_polynomial[i_mat,3] := pro_polynomial.x;
-      res_polynomial[i_mat,4] := pro_polynomial.T;
-      res_polynomial[i_mat,5] := pro_polynomial.d;
-      res_polynomial[i_mat,6] := pro_polynomial.u;
-      res_polynomial[i_mat,7] := pro_polynomial.h;
-      res_polynomial[i_mat,8] := pro_polynomial.cp;
-      res_polynomial[i_mat,9] := pro_polynomial.ddsp;
-      res_polynomial[i_mat,10] := pro_polynomial.ddps;
-
-      res_IF97[i_mat,1] := p[i_p];
-      res_IF97[i_mat,2] := s[i_s];
-      res_IF97[i_mat,3] := pro_IF97.x;
-      res_IF97[i_mat,4] := pro_IF97.T;
-      res_IF97[i_mat,5] := pro_IF97.d;
-      res_IF97[i_mat,6] := pro_IF97.u;
-      res_IF97[i_mat,7] := pro_IF97.h;
-      res_IF97[i_mat,8] := pro_IF97.cp;
-      res_IF97[i_mat,9] := pro_IF97.ddsp;
-      res_IF97[i_mat,10] := pro_IF97.ddps;
-
-    end for;
-
-  end for;
-
- //Write results
- DymolaCommands.MatrixIO.writeMatrix("res_polynomial_twophase_ps.mat","res_polynomial",res_polynomial);
- DymolaCommands.MatrixIO.writeMatrix("res_IF97_twophase_ps.mat","res_IF97",res_IF97);
-
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end generate_data_twophase_ps;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model generate_data_twophase_ps
+  import ThermoSysPro.Units.SI.*;
+  parameter Pressure p_min = 1e5;
+  parameter Pressure p_max = 150e5;
+  parameter Pressure delta_p(min = 1) = 10e5;
+  parameter SpecificEnthalpy s_min = 1000;
+  parameter SpecificEnthalpy s_max = 8000;
+  parameter SpecificEnthalpy  delta_s(min = 1) = 100;
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro_polynomial;
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro_IF97;
+
+protected
+  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
+  parameter Integer n_s = integer((s_max - s_min)/delta_s);
+
+  Integer i_mat;
+  Real res_polynomial[n_p*n_s,10];
+  Real res_IF97[n_p*n_s,10];
+
+public
+   output AbsolutePressure p[n_p];
+   output SpecificEnthalpy s[n_s];
+
+algorithm
+  i_mat :=0;
+  for i_p in 1:n_p loop
+    p[i_p] := p_min + (i_p-1)*delta_p;
+    for i_s in 1:n_s loop
+      s[i_s] := s_min + (i_s-1)*delta_s;
+
+      //Properties
+      pro_IF97 := ThermoSysPro.Properties.Fluid.Ps(
+         p[i_p],
+         s[i_s],
+         0,3);
+
+      pro_polynomial := ThermoSysPro.Properties.Fluid.Ps(
+         p[i_p],
+         s[i_s],
+         0,3);
+
+      //Store results
+      i_mat := i_mat + 1;
+      res_polynomial[i_mat,1] := p[i_p];
+      res_polynomial[i_mat,2] := s[i_s];
+      res_polynomial[i_mat,3] := pro_polynomial.x;
+      res_polynomial[i_mat,4] := pro_polynomial.T;
+      res_polynomial[i_mat,5] := pro_polynomial.d;
+      res_polynomial[i_mat,6] := pro_polynomial.u;
+      res_polynomial[i_mat,7] := pro_polynomial.h;
+      res_polynomial[i_mat,8] := pro_polynomial.cp;
+      res_polynomial[i_mat,9] := pro_polynomial.ddsp;
+      res_polynomial[i_mat,10] := pro_polynomial.ddps;
+
+      res_IF97[i_mat,1] := p[i_p];
+      res_IF97[i_mat,2] := s[i_s];
+      res_IF97[i_mat,3] := pro_IF97.x;
+      res_IF97[i_mat,4] := pro_IF97.T;
+      res_IF97[i_mat,5] := pro_IF97.d;
+      res_IF97[i_mat,6] := pro_IF97.u;
+      res_IF97[i_mat,7] := pro_IF97.h;
+      res_IF97[i_mat,8] := pro_IF97.cp;
+      res_IF97[i_mat,9] := pro_IF97.ddsp;
+      res_IF97[i_mat,10] := pro_IF97.ddps;
+
+    end for;
+
+  end for;
+
+ //Write results
+ DymolaCommands.MatrixIO.writeMatrix("res_polynomial_twophase_ps.mat","res_polynomial",res_polynomial);
+ DymolaCommands.MatrixIO.writeMatrix("res_IF97_twophase_ps.mat","res_IF97",res_IF97);
+
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end generate_data_twophase_ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_watersat.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_watersat.mo
index a92ecc4e509856ae44c66f3c40a51ac919a2d90b..5cad59bfa63888c6e1183ede0f6b8ce71b673906 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_watersat.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/generate_data_watersat.mo
@@ -1,95 +1,95 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Validation;
-model generate_data_watersat
-  import ThermoSysPro.Units.SI.*;
-  parameter Pressure p_min = 1e5;
-  parameter Pressure p_max = 220e5;
-  parameter Pressure delta_p(min = 1) = 20e5;
-
-  ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat pro1_polynomial;
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat pro1_IF97;
-  ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat pro2_polynomial;
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat pro2_IF97;
-
- // Integer i_p;
- // Integer i_h;
-protected
-  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
-
-  Integer i_mat;
-  Real res1_polynomial[n_p,6];
-  Real res1_IF97[n_p,6];
-  Real res2_polynomial[n_p,6];
-  Real res2_IF97[n_p,6];
-public
-   output AbsolutePressure p[n_p];
-
-algorithm
-  i_mat :=0;
-  for i_p in 1:n_p loop
-    p[i_p] := p_min + (i_p-1)*delta_p;
-
-      //Properties
-    (pro1_IF97,pro2_IF97) :=
-      ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(p[i_p]);
-
-      (pro1_polynomial,pro2_polynomial) := ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(
-         p[i_p]);
-
-      //Store results
-      i_mat := i_mat + 1;
-
-      //Liquid
-      res1_polynomial[i_mat,1] := 1;
-      res1_polynomial[i_mat,2] := p[i_p];
-      res1_polynomial[i_mat,3] := pro1_polynomial.T;
-      res1_polynomial[i_mat,4] := pro1_polynomial.rho;
-      res1_polynomial[i_mat,5] := pro1_polynomial.h;
-      res1_polynomial[i_mat,6] := pro1_polynomial.cp;
-
-      res1_IF97[i_mat,1] := 1;
-      res1_IF97[i_mat,2] := p[i_p];
-      res1_IF97[i_mat,3] := pro1_IF97.T;
-      res1_IF97[i_mat,4] := pro1_IF97.rho;
-      res1_IF97[i_mat,5] := pro1_IF97.h;
-      res1_IF97[i_mat,6] := pro1_IF97.cp;
-
-      //Vapour
-      res2_polynomial[i_mat,1] := 1;
-      res2_polynomial[i_mat,2] := p[i_p];
-      res2_polynomial[i_mat,3] := pro2_polynomial.T;
-      res2_polynomial[i_mat,4] := pro2_polynomial.rho;
-      res2_polynomial[i_mat,5] := pro2_polynomial.h;
-      res2_polynomial[i_mat,6] := pro2_polynomial.cp;
-
-      res2_IF97[i_mat,1] := 1;
-      res2_IF97[i_mat,2] := p[i_p];
-      res2_IF97[i_mat,3] := pro2_IF97.T;
-      res2_IF97[i_mat,4] := pro2_IF97.rho;
-      res2_IF97[i_mat,5] := pro2_IF97.h;
-      res2_IF97[i_mat,6] := pro2_IF97.cp;
-  end for;
-
- //Write results
- DymolaCommands.MatrixIO.writeMatrix("res_polynomial_sat1.mat","res1_polynomial",res1_polynomial);
- DymolaCommands.MatrixIO.writeMatrix("res_IF97_sat1.mat","res1_IF97",res1_IF97);
- DymolaCommands.MatrixIO.writeMatrix("res_polynomial_sat2.mat","res2_polynomial",res2_polynomial);
- DymolaCommands.MatrixIO.writeMatrix("res_IF97_sat2.mat","res2_IF97",res2_IF97);
-  annotation (Icon(graphics={
-        Rectangle(
-          lineColor={200,200,200},
-          fillColor={248,248,248},
-          fillPattern=FillPattern.HorizontalCylinder,
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Rectangle(
-          lineColor={128,128,128},
-          extent={{-100.0,-100.0},{100.0,100.0}},
-          radius=25.0),
-        Polygon(
-          origin={8.0,14.0},
-          lineColor={78,138,73},
-          fillColor={78,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
-end generate_data_watersat;
+within ThermoSysPro.Properties.WaterSteamSimple.Validation;
+model generate_data_watersat
+  import ThermoSysPro.Units.SI.*;
+  parameter Pressure p_min = 1e5;
+  parameter Pressure p_max = 220e5;
+  parameter Pressure delta_p(min = 1) = 20e5;
+
+  ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat pro1_polynomial;
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat pro1_IF97;
+  ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat pro2_polynomial;
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat pro2_IF97;
+
+ // Integer i_p;
+ // Integer i_h;
+protected
+  parameter Integer n_p =  integer((p_max - p_min)/delta_p);
+
+  Integer i_mat;
+  Real res1_polynomial[n_p,6];
+  Real res1_IF97[n_p,6];
+  Real res2_polynomial[n_p,6];
+  Real res2_IF97[n_p,6];
+public
+   output AbsolutePressure p[n_p];
+
+algorithm
+  i_mat :=0;
+  for i_p in 1:n_p loop
+    p[i_p] := p_min + (i_p-1)*delta_p;
+
+      //Properties
+    (pro1_IF97,pro2_IF97) :=
+      ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(p[i_p]);
+
+      (pro1_polynomial,pro2_polynomial) := ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(
+         p[i_p]);
+
+      //Store results
+      i_mat := i_mat + 1;
+
+      //Liquid
+      res1_polynomial[i_mat,1] := 1;
+      res1_polynomial[i_mat,2] := p[i_p];
+      res1_polynomial[i_mat,3] := pro1_polynomial.T;
+      res1_polynomial[i_mat,4] := pro1_polynomial.rho;
+      res1_polynomial[i_mat,5] := pro1_polynomial.h;
+      res1_polynomial[i_mat,6] := pro1_polynomial.cp;
+
+      res1_IF97[i_mat,1] := 1;
+      res1_IF97[i_mat,2] := p[i_p];
+      res1_IF97[i_mat,3] := pro1_IF97.T;
+      res1_IF97[i_mat,4] := pro1_IF97.rho;
+      res1_IF97[i_mat,5] := pro1_IF97.h;
+      res1_IF97[i_mat,6] := pro1_IF97.cp;
+
+      //Vapour
+      res2_polynomial[i_mat,1] := 1;
+      res2_polynomial[i_mat,2] := p[i_p];
+      res2_polynomial[i_mat,3] := pro2_polynomial.T;
+      res2_polynomial[i_mat,4] := pro2_polynomial.rho;
+      res2_polynomial[i_mat,5] := pro2_polynomial.h;
+      res2_polynomial[i_mat,6] := pro2_polynomial.cp;
+
+      res2_IF97[i_mat,1] := 1;
+      res2_IF97[i_mat,2] := p[i_p];
+      res2_IF97[i_mat,3] := pro2_IF97.T;
+      res2_IF97[i_mat,4] := pro2_IF97.rho;
+      res2_IF97[i_mat,5] := pro2_IF97.h;
+      res2_IF97[i_mat,6] := pro2_IF97.cp;
+  end for;
+
+ //Write results
+ DymolaCommands.MatrixIO.writeMatrix("res_polynomial_sat1.mat","res1_polynomial",res1_polynomial);
+ DymolaCommands.MatrixIO.writeMatrix("res_IF97_sat1.mat","res1_IF97",res1_IF97);
+ DymolaCommands.MatrixIO.writeMatrix("res_polynomial_sat2.mat","res2_polynomial",res2_polynomial);
+ DymolaCommands.MatrixIO.writeMatrix("res_IF97_sat2.mat","res2_IF97",res2_IF97);
+  annotation (Icon(graphics={
+        Rectangle(
+          lineColor={200,200,200},
+          fillColor={248,248,248},
+          fillPattern=FillPattern.HorizontalCylinder,
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Rectangle(
+          lineColor={128,128,128},
+          extent={{-100.0,-100.0},{100.0,100.0}},
+          radius=25.0),
+        Polygon(
+          origin={8.0,14.0},
+          lineColor={78,138,73},
+          fillColor={78,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}));
+end generate_data_watersat;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Validation/package.mo
index 5aa3569473cbc6ec6c817388b779c22387f98d69..1d951875e4d9f2434582414a7fa6933444457dc9 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/package.mo
@@ -1,117 +1,117 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Validation
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Validation;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Validation
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Validation;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Validation/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Validation/package.order
index 8c0c32d8a12d747e0e5bd3f4c34761642fad204b..04ff7bc82b75bdff098d4a39009cb5f88a18cc38 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Validation/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Validation/package.order
@@ -1,11 +1,11 @@
-generate_data_supercritique_ph
-generate_data_twophase_ph
-generate_data_lowpressure_ph
-calculette_h
-calculette_p
-Bench
-generate_data_watersat
-generate_data_dT
-generate_data_twophase_ps
-calculette_T
-calculette_d
+generate_data_supercritique_ph
+generate_data_twophase_ph
+generate_data_lowpressure_ph
+calculette_h
+calculette_p
+Bench
+generate_data_watersat
+generate_data_dT
+generate_data_twophase_ps
+calculette_T
+calculette_d
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1Td_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1Td_dT.mo
index 063dbf6421fceb35a101970863d8cca82ef736a7..9e2c3b5c0adfd262ea2b166ced9eda3c3c34c9a2 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1Td_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1Td_dT.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function dmu1Td_dT
-  "Derivative of viscosity wrt. specific enthalpy at constant pressure in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dmuTd
-    "Derivative of viscosity wrt. temperature at constant density";
-protected
-  mu1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dmuTd :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(
-    coef,
-    T);
-
-end dmu1Td_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function dmu1Td_dT
+  "Derivative of viscosity wrt. specific enthalpy at constant pressure in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dmuTd
+    "Derivative of viscosity wrt. temperature at constant density";
+protected
+  mu1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dmuTd :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7_derivative(
+    coef,
+    T);
+
+end dmu1Td_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1dT_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1dT_dT.mo
index 874eaae11856e74e957d79f58e74e2558205cbfa..87ed15eb1ac7cca0caa49a7db2e102904aa072a1 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1dT_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1dT_dT.mo
@@ -1,14 +1,14 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function dmu1dT_dT
-  "Derivative of viscosity wrt. pressure at constant specific enthalpy in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dmudT
-    "Derivative of viscosity wrt. density at constant temperature";
-protected
-  mu1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dmudT := 0;
-
-end dmu1dT_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function dmu1dT_dT
+  "Derivative of viscosity wrt. pressure at constant specific enthalpy in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dmudT
+    "Derivative of viscosity wrt. density at constant temperature";
+protected
+  mu1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dmudT := 0;
+
+end dmu1dT_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1hp_Ph.mo
index 3f445a6b0519b069b212541f73cd74268c7359eb..fcf9acf3d5503b9fd379e1464bc08ef983a6c453 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function dmu1hp_Ph
-  "Derivative of viscosity wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dmuhp
-    "Derivative of viscosity wrt. specific enthalpy at constant pressure";
-protected
-  mu1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dmuhp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
-    coef,
-    p,
-    h);
-
-end dmu1hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function dmu1hp_Ph
+  "Derivative of viscosity wrt. specific enthalpy at constant pressure in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dmuhp
+    "Derivative of viscosity wrt. specific enthalpy at constant pressure";
+protected
+  mu1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dmuhp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_y(
+    coef,
+    p,
+    h);
+
+end dmu1hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1ph_Ph.mo
index e35dcf43fcb9771ffde1a8c1c9a93be2e684121f..c63a9cfdbf3c43ad3bc9d73291eb7d6a97559a0b 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu1ph_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function dmu1ph_Ph
-  "Derivative of viscosity wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dmuph
-    "Derivative of viscosity wrt. pressure at constant specific enthalpy";
-protected
-  mu1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dmuph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
-    coef,
-    p,
-    h);
-
-end dmu1ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function dmu1ph_Ph
+  "Derivative of viscosity wrt. pressure at constant specific enthalpy in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dmuph
+    "Derivative of viscosity wrt. pressure at constant specific enthalpy";
+protected
+  mu1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dmuph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5_derivative_x(
+    coef,
+    p,
+    h);
+
+end dmu1ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2Td_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2Td_dT.mo
index f853670b52d538af9b7a35b679693b55f822e280..1110ff9fe4d228a5c404ef673c7b09785bea30a8 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2Td_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2Td_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function dmu2Td_dT
-  "Derivative of viscosity wrt. specific enthalpy at constant pressure in vapor region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dmuTd
-    "Derivative of viscosity wrt. temperature at constant density";
-protected
-  mu2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dmuTd :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    T,
-    d);
-
-end dmu2Td_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function dmu2Td_dT
+  "Derivative of viscosity wrt. specific enthalpy at constant pressure in vapor region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dmuTd
+    "Derivative of viscosity wrt. temperature at constant density";
+protected
+  mu2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dmuTd :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    T,
+    d);
+
+end dmu2Td_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2dT_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2dT_dT.mo
index 24d06db1bdf21e7841bcc275e67a11bd25998581..1007d2661f96893218bfeba259843e8116e72971 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2dT_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2dT_dT.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function dmu2dT_dT
-  "Derivative of viscosity wrt. pressure at constant specific enthalpy in vapor region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Real dmudT
-    "Derivative of viscosity wrt. density at constant temperature";
-protected
-  mu2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dmudT :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    d,
-    T);
-
-end dmu2dT_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function dmu2dT_dT
+  "Derivative of viscosity wrt. pressure at constant specific enthalpy in vapor region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Real dmudT
+    "Derivative of viscosity wrt. density at constant temperature";
+protected
+  mu2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dmudT :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    d,
+    T);
+
+end dmu2dT_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2hp_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2hp_Ph.mo
index eb0cb93cbcf5ef6150da02aec817b616b5a62240..5fa49c120a5dfa23acffc98322bbad8fb08a7acc 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2hp_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2hp_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function dmu2hp_Ph
-  "Derivative of viscosity wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dmuhp
-    "Derivative of viscosity wrt. specific enthalpy at constant pressure";
-protected
-  mu2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dmuhp :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
-    coef,
-    p,
-    h);
-
-end dmu2hp_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function dmu2hp_Ph
+  "Derivative of viscosity wrt. specific enthalpy at constant pressure in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dmuhp
+    "Derivative of viscosity wrt. specific enthalpy at constant pressure";
+protected
+  mu2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dmuhp :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_y(
+    coef,
+    p,
+    h);
+
+end dmu2hp_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2ph_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2ph_Ph.mo
index 18f06315a558b6ef117b3254511fc2e296af4857..87ba9ba4fcd3d660f0a9007fbf40fb6217a24107 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2ph_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/dmu2ph_Ph.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function dmu2ph_Ph
-  "Derivative of viscosity wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Real dmuph
-    "Derivative of viscosity wrt. pressure at constant specific enthalpy";
-protected
-  mu2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  dmuph :=
-    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
-    coef,
-    p,
-    h);
-
-end dmu2ph_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function dmu2ph_Ph
+  "Derivative of viscosity wrt. pressure at constant specific enthalpy in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Real dmuph
+    "Derivative of viscosity wrt. pressure at constant specific enthalpy";
+protected
+  mu2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  dmuph :=
+    ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3_derivative_x(
+    coef,
+    p,
+    h);
+
+end dmu2ph_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_Ph.mo
index afad85b9a58eb789046c7b76aa55cf85548c126a..bf414423aff31c200925646bbf822a877b06bdf7 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_Ph.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function mu1_Ph
-  "Viscosity in liquid region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
-protected
-  mu1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  mu := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
-    coef,
-    p,
-    h);
-
-end mu1_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function mu1_Ph
+  "Viscosity in liquid region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
+protected
+  mu1_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  mu := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order5(
+    coef,
+    p,
+    h);
+
+end mu1_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_Ph_coef.mo
index c9c73a5aa5294d8918ddfea70425fd9039fe8dcb..9687ce6330533989630df6f02f886c1759f5c555 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_Ph_coef.mo
@@ -1,30 +1,30 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-record mu1_Ph_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
-    c00=5.452677e-01,
-    c10=-6.984453e-11,
-    c01=5.724819e-07,
-    c20=-8.605931e-19,
-    c11=1.529135e-15,
-    c02=-9.436446e-13,
-    c30=3.467945e-28,
-    c21=1.728908e-24,
-    c12=-1.087772e-21,
-    c03=7.614081e-19,
-    c40=5.673171e-35,
-    c31=-3.281411e-32,
-    c22=3.121527e-30,
-    c13=4.133284e-28,
-    c04=-3.767334e-25,
-    c50=-3.225145e-46,
-    c41=-1.691485e-40,
-    c32=6.735025e-38,
-    c23=-8.798974e-36,
-    c14=3.762968e-34,
-    c05=6.501393e-32);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end mu1_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+record mu1_Ph_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order5(
+    c00=5.452677e-01,
+    c10=-6.984453e-11,
+    c01=5.724819e-07,
+    c20=-8.605931e-19,
+    c11=1.529135e-15,
+    c02=-9.436446e-13,
+    c30=3.467945e-28,
+    c21=1.728908e-24,
+    c12=-1.087772e-21,
+    c03=7.614081e-19,
+    c40=5.673171e-35,
+    c31=-3.281411e-32,
+    c22=3.121527e-30,
+    c13=4.133284e-28,
+    c04=-3.767334e-25,
+    c50=-3.225145e-46,
+    c41=-1.691485e-40,
+    c32=6.735025e-38,
+    c23=-8.798974e-36,
+    c14=3.762968e-34,
+    c05=6.501393e-32);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end mu1_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_dT.mo
index 107b3da8b567d053a2968216bfda9bb495c7d1e5..63b518caae56452f01fdb7f77fecf05cb8dfb152 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_dT.mo
@@ -1,13 +1,13 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function mu1_dT "Viscosity in liquid region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
-protected
-  mu1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  mu := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(
-    coef,T);
-
-end mu1_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function mu1_dT "Viscosity in liquid region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
+protected
+  mu1_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  mu := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_x_order7(
+    coef,T);
+
+end mu1_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_dT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_dT_coef.mo
index df10dc50bac2f70c9f253b4e5504ffd7232d9839..8a1f19adf83b6facdc9e993b2a99ba82f9b45814 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_dT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu1_dT_coef.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-record mu1_dT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
-   c0=3.29092297E-01,
-   c1=-4.27172409E-03,
-   c2=2.29860442E-05,
-   c3=-6.54673011E-08,
-   c4=1.03964666E-10,
-   c5=-8.72289050E-14,
-   c6=3.02014260E-17,
-   c7=0);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end mu1_dT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+record mu1_dT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_x_order7(
+   c0=3.29092297E-01,
+   c1=-4.27172409E-03,
+   c2=2.29860442E-05,
+   c3=-6.54673011E-08,
+   c4=1.03964666E-10,
+   c5=-8.72289050E-14,
+   c6=3.02014260E-17,
+   c7=0);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end mu1_dT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_Ph.mo
index 3195c3970ab7592321088e38b4992145d2f59a28..7a0d3a1a255900f253a717227cd61012b25bdeef 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_Ph.mo
@@ -1,16 +1,16 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function mu2_Ph
-  "Viscosity in vapor region for given pressure and specific enthalpy"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
-protected
-  mu2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  mu := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    p,
-    h);
-
-end mu2_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function mu2_Ph
+  "Viscosity in vapor region for given pressure and specific enthalpy"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
+protected
+  mu2_Ph_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  mu := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    p,
+    h);
+
+end mu2_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_Ph_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_Ph_coef.mo
index 484f658422f43620eb216d57e914e6e5e1f671ae..6871d2b09ac0cfe288367b8c0b2f9d0341577653 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_Ph_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_Ph_coef.mo
@@ -1,20 +1,20 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-record mu2_Ph_coef
-  extends Modelica.Icons.Record;
-
-   extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00=4.685560e-01,
-    c10=1.002884e-08,
-    c01=-3.807181e-07,
-    c20=-1.441261e-17,
-    c11=-3.045428e-15,
-    c02=1.024663e-13,
-    c30=-5.492118e-26,
-    c21=4.957386e-24,
-    c12=2.051417e-22,
-    c03=-7.708932e-21);
-
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end mu2_Ph_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+record mu2_Ph_coef
+  extends Modelica.Icons.Record;
+
+   extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00=4.685560e-01,
+    c10=1.002884e-08,
+    c01=-3.807181e-07,
+    c20=-1.441261e-17,
+    c11=-3.045428e-15,
+    c02=1.024663e-13,
+    c30=-5.492118e-26,
+    c21=4.957386e-24,
+    c12=2.051417e-22,
+    c03=-7.708932e-21);
+
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end mu2_Ph_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_dT.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_dT.mo
index f8d3bfe0576d262bf7af81cd0b80b653910defa4..f29ff4dfcba511570cedf08eb2a84b1cb153e859 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_dT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_dT.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-function mu2_dT "Viscosity in vapor region for given density and temperature"
-  input Units.SI.Density d "Density";
-  input Units.SI.Temperature T "Temperature";
-  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
-protected
-  mu2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
-algorithm
-
-  mu := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
-    coef,
-    d,
-    T);
-
-end mu2_dT;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+function mu2_dT "Viscosity in vapor region for given density and temperature"
+  input Units.SI.Density d "Density";
+  input Units.SI.Temperature T "Temperature";
+  output Units.SI.DynamicViscosity mu "Dynamic viscosity";
+protected
+  mu2_dT_coef coef annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
+algorithm
+
+  mu := ThermoSysPro.Properties.WaterSteamSimple.Utilities.polynomial_xy_order3(
+    coef,
+    d,
+    T);
+
+end mu2_dT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_dT_coef.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_dT_coef.mo
index 213e0dad51e10d7c635fbef23016f8da1df133fd..e5136d16cb5db50911fcca422adeb49ea8f65bb6 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_dT_coef.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/mu2_dT_coef.mo
@@ -1,15 +1,15 @@
-within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
-record mu2_dT_coef
-  extends Modelica.Icons.Record;
-
-  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
-    c00 =  -6.342606e-06,
-    c10 =  4.371500e-09,
-    c01 =  4.976104e-08,
-    c20 =  1.038249e-10,
-    c11 =  1.710167e-11,
-    c02 =  -5.808535e-12);
-  annotation (Icon(graphics,
-                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
-        coordinateSystem(preserveAspectRatio=false)));
-end mu2_dT_coef;
+within ThermoSysPro.Properties.WaterSteamSimple.Viscosity;
+record mu2_dT_coef
+  extends Modelica.Icons.Record;
+
+  extends ThermoSysPro.Properties.WaterSteamSimple.Utilities.coef_xy_order3(
+    c00 =  -6.342606e-06,
+    c10 =  4.371500e-09,
+    c01 =  4.976104e-08,
+    c20 =  1.038249e-10,
+    c11 =  1.710167e-11,
+    c02 =  -5.808535e-12);
+  annotation (Icon(graphics,
+                   coordinateSystem(preserveAspectRatio=false)), Diagram(graphics,
+        coordinateSystem(preserveAspectRatio=false)));
+end mu2_dT_coef;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/package.mo
index 1305f41a7c3f9034d7615771bc2c67df86616547..1a17694f4063a9db4833a5630067360b6bc8346e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/package.mo
@@ -1,123 +1,123 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-package Viscosity "Polynomials of viscosity"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
-<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>SurfaceTension</b> contains polynomial functions to compute viscosity. </span></p>
-</html>"),
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}));
-end Viscosity;
+within ThermoSysPro.Properties.WaterSteamSimple;
+package Viscosity "Polynomials of viscosity"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b><span style=\"font-family: MS Shell Dlg 2;\">Package description</span></b> </p>
+<p><span style=\"font-family: MS Shell Dlg 2;\">Package <b>SurfaceTension</b> contains polynomial functions to compute viscosity. </span></p>
+</html>"),
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}));
+end Viscosity;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/package.order b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/package.order
index df6922b7f8c189f21c2961dce327d249fb382fc6..778817eaf57f7d4fd134a3b83937c762c73732ea 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/Viscosity/package.order
@@ -1,16 +1,16 @@
-mu1_Ph_coef
-mu1_Ph
-dmu1ph_Ph
-dmu1hp_Ph
-mu2_Ph_coef
-mu2_Ph
-dmu2ph_Ph
-dmu2hp_Ph
-mu1_dT_coef
-mu1_dT
-dmu1dT_dT
-dmu1Td_dT
-mu2_dT_coef
-mu2_dT
-dmu2dT_dT
-dmu2Td_dT
+mu1_Ph_coef
+mu1_Ph
+dmu1ph_Ph
+dmu1hp_Ph
+mu2_Ph_coef
+mu2_Ph
+dmu2ph_Ph
+dmu2hp_Ph
+mu1_dT_coef
+mu1_dT
+dmu1dT_dT
+dmu1Td_dT
+mu2_dT_coef
+mu2_dT
+dmu2dT_dT
+dmu2Td_dT
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/critical.mo b/ThermoSysPro/Properties/WaterSteamSimple/critical.mo
index 10ca62d18eaf1003886fc7f70a3a83d99d409bbe..2d5ba17e6343fe1faa52c775d43db772faf87f98 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/critical.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/critical.mo
@@ -1,31 +1,31 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-record critical "critical point data"
-  extends Modelica.Icons.Record;
-  constant Units.SI.Pressure PCRIT=22064000.0 "the critical pressure";
-  constant Units.SI.Temperature TCRIT=647.096 "the critical temperature";
-  constant Units.SI.Density DCRIT=322.0 "the critical density";
-  constant Units.SI.SpecificEnthalpy HCRIT=2087546.84511715 "the calculated specific enthalpy at the critical point";
-  constant Units.SI.SpecificEntropy SCRIT=4412.02148223476 "the calculated specific entropy at the critical point";
-  annotation (Documentation(info="<HTML>
- <h4>Record description</h4>
- <p>Critical point data for IF97 steam properties. SCRIT and HCRIT are calculated from helmholtz function for region 3 </p>
-<h4>Version Info and Revision history
-</h4>
-<ul>
-<li>First implemented: <i>July, 2000</i>
-       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-       </li>
-</ul>
- <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
- </address>
-<ul>
- <li>Initial version: July 2000</li>
- <li>Documentation added: December 2002</li>
-</ul>
-</HTML>
-"));
-end critical;
+within ThermoSysPro.Properties.WaterSteamSimple;
+record critical "critical point data"
+  extends Modelica.Icons.Record;
+  constant Units.SI.Pressure PCRIT=22064000.0 "the critical pressure";
+  constant Units.SI.Temperature TCRIT=647.096 "the critical temperature";
+  constant Units.SI.Density DCRIT=322.0 "the critical density";
+  constant Units.SI.SpecificEnthalpy HCRIT=2087546.84511715 "the calculated specific enthalpy at the critical point";
+  constant Units.SI.SpecificEntropy SCRIT=4412.02148223476 "the calculated specific entropy at the critical point";
+  annotation (Documentation(info="<HTML>
+ <h4>Record description</h4>
+ <p>Critical point data for IF97 steam properties. SCRIT and HCRIT are calculated from helmholtz function for region 3 </p>
+<h4>Version Info and Revision history
+</h4>
+<ul>
+<li>First implemented: <i>July, 2000</i>
+       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+       </li>
+</ul>
+ <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+ </address>
+<ul>
+ <li>Initial version: July 2000</li>
+ <li>Documentation added: December 2002</li>
+</ul>
+</HTML>
+"));
+end critical;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/package.mo b/ThermoSysPro/Properties/WaterSteamSimple/package.mo
index 60c986117ecd4ce6d164e6536c094db805867bef..74b584c32eb87106ffed1a34043a1acb143756d8 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/package.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/package.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.Properties;
-package WaterSteamSimple "7 - Water/steam properties library (simple implementation)"
-
-
-
-annotation (
-  Icon(coordinateSystem(
-      preserveAspectRatio=false,
-      extent={{-100,-100},{100,100}},
-      grid={2,2},
-      initialScale=0.1), graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
-            0,255}),
-      Line(points={{80,80},{100,100}}, color={0,0,255})}),
-  Window(
-    x=0.05,
-    y=0.26,
-    width=0.25,
-    height=0.25,
-    library=1,
-    autolayout=1),
-  Documentation(info="<html>
-<p><b>ThermoSysPro Version 3.2 </h4>
-<p><span style=\"font-family: MS Shell Dlg 2;\">This library implements the thermodynamic properties for water and steam using simple polynomials.</span></h4>
-</html>", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li><span style=\"font-family: MS Shell Dlg 2;\">First implemented: March, 2017 by Sherpa Engineering for EDF.</span></li>
-</ul>
-</html>"));
-end WaterSteamSimple;
+within ThermoSysPro.Properties;
+package WaterSteamSimple "7 - Water/steam properties library (simple implementation)"
+
+
+
+annotation (
+  Icon(coordinateSystem(
+      preserveAspectRatio=false,
+      extent={{-100,-100},{100,100}},
+      grid={2,2},
+      initialScale=0.1), graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, color={0,
+            0,255}),
+      Line(points={{80,80},{100,100}}, color={0,0,255})}),
+  Window(
+    x=0.05,
+    y=0.26,
+    width=0.25,
+    height=0.25,
+    library=1,
+    autolayout=1),
+  Documentation(info="<html>
+<p><b>ThermoSysPro Version 3.2 </h4>
+<p><span style=\"font-family: MS Shell Dlg 2;\">This library implements the thermodynamic properties for water and steam using simple polynomials.</span></h4>
+</html>", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li><span style=\"font-family: MS Shell Dlg 2;\">First implemented: March, 2017 by Sherpa Engineering for EDF.</span></li>
+</ul>
+</html>"));
+end WaterSteamSimple;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/package.order b/ThermoSysPro/Properties/WaterSteamSimple/package.order
index b42741c342eb9416884b593d3a46e37fd6358d32..b1916dfd34d9c14949f07c0f4b3e8162d2ca4004 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/package.order
+++ b/ThermoSysPro/Properties/WaterSteamSimple/package.order
@@ -1,40 +1,40 @@
-SimpleWater
-critical
-triple
-ThermoProperties_ph
-ThermoProperties_pT
-ThermoProperties_ps
-PropThermoSat
-region_ph
-phase_ph
-prop1_Ph
-prop2_Ph
-prop4_Ph
-prop1_Ph_der
-prop2_Ph_der
-prop4_Ph_der
-region_ps
-phase_ps
-prop1_Ps
-prop2_Ps
-prop4_Ps
-region_pT
-prop1_PT
-prop2_PT
-propsat1_P
-propsat2_P
-propsat1_P_der
-propsat2_P_der
-Temperature
-Energy
-Density
-HeatCapacity
-Entropy
-Enthalpy
-Conductivity
-Viscosity
-Pressure
-SurfaceTension
-InitLimits
-Utilities
-Validation
+SimpleWater
+critical
+triple
+ThermoProperties_ph
+ThermoProperties_pT
+ThermoProperties_ps
+PropThermoSat
+region_ph
+phase_ph
+prop1_Ph
+prop2_Ph
+prop4_Ph
+prop1_Ph_der
+prop2_Ph_der
+prop4_Ph_der
+region_ps
+phase_ps
+prop1_Ps
+prop2_Ps
+prop4_Ps
+region_pT
+prop1_PT
+prop2_PT
+propsat1_P
+propsat2_P
+propsat1_P_der
+propsat2_P_der
+Temperature
+Energy
+Density
+HeatCapacity
+Entropy
+Enthalpy
+Conductivity
+Viscosity
+Pressure
+SurfaceTension
+InitLimits
+Utilities
+Validation
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/phase_ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/phase_ph.mo
index e840761819cab35c22f50cb5b07c88e037e4dba6..ac404efc81a762a94c16f2cd871b2c26f0909fcf 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/phase_ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/phase_ph.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function phase_ph "Returns the current phase"
-  input Units.SI.Pressure p "pressure";
-  input Units.SI.SpecificEnthalpy h "specific enthalpy";
-
-  output Integer phase=0 "phase: 2 for two-phase, 1 for one phase";
-
-protected
-  Units.SI.SpecificEnthalpy h1sat "bubble enthalpy";
-  Units.SI.SpecificEnthalpy h2sat "dew enthalpy";
-  Boolean supercritical;
-
-algorithm
-  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
-  h1sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
-  h2sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
-  phase := if ((h < h1sat) or (h > h2sat) or supercritical) then 1 else 2;
-
-end phase_ph;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function phase_ph "Returns the current phase"
+  input Units.SI.Pressure p "pressure";
+  input Units.SI.SpecificEnthalpy h "specific enthalpy";
+
+  output Integer phase=0 "phase: 2 for two-phase, 1 for one phase";
+
+protected
+  Units.SI.SpecificEnthalpy h1sat "bubble enthalpy";
+  Units.SI.SpecificEnthalpy h2sat "dew enthalpy";
+  Boolean supercritical;
+
+algorithm
+  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
+  h1sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
+  h2sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
+  phase := if ((h < h1sat) or (h > h2sat) or supercritical) then 1 else 2;
+
+end phase_ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/phase_ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/phase_ps.mo
index 7a2f1a6d321461869ccea1a80af6ce1e90be1378..ac96b3a3159a3db0e5a60a85e83fb57c12872b94 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/phase_ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/phase_ps.mo
@@ -1,18 +1,18 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function phase_ps "Returns the current phase"
-  input Units.SI.Pressure p "pressure";
-  input Units.SI.SpecificEntropy s "specific entropy";
- output Integer phase=0 "phase: 2 for two-phase, 1 for one phase";
-
-protected
-  Units.SI.SpecificEntropy s1sat "bubble entropy";
-  Units.SI.SpecificEntropy s2sat "dew entropy";
-  Boolean supercritical;
-
-algorithm
-  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
-  s1sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1sat_P(p);
-  s2sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2sat_P(p);
-  phase := if ((s < s1sat) or (s > s2sat) or supercritical) then 1 else 2;
-
-end phase_ps;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function phase_ps "Returns the current phase"
+  input Units.SI.Pressure p "pressure";
+  input Units.SI.SpecificEntropy s "specific entropy";
+ output Integer phase=0 "phase: 2 for two-phase, 1 for one phase";
+
+protected
+  Units.SI.SpecificEntropy s1sat "bubble entropy";
+  Units.SI.SpecificEntropy s2sat "dew entropy";
+  Boolean supercritical;
+
+algorithm
+  supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
+  s1sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1sat_P(p);
+  s2sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2sat_P(p);
+  phase := if ((s < s1sat) or (s > s2sat) or supercritical) then 1 else 2;
+
+end phase_ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop1_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop1_PT.mo
index f525298a2f2161fd987fc87fd160a6eb425778cd..261a477452a5b846e8f9c483253302ce84a2bf56 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop1_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop1_PT.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop1_PT "Thermodynamics properties in region 1, independent variables p and T "
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_pT pro;
-
-algorithm
-  pro.h := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1_PT(p, T);
-  pro.s := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1_Ph(p, pro.h);
-  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, pro.h);
-  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, pro.h);
-  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, pro.h);
-  pro.ddTp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1Tp_PT(p, T);
-  pro.ddpT := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1pT_PT(p, T);
-  pro.duTp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1Tp_PT(p, T);
-  pro.dupT := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1pT_PT(p, T);
-  pro.x :=0;
-end prop1_PT;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop1_PT "Thermodynamics properties in region 1, independent variables p and T "
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_pT pro;
+
+algorithm
+  pro.h := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1_PT(p, T);
+  pro.s := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1_Ph(p, pro.h);
+  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, pro.h);
+  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, pro.h);
+  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, pro.h);
+  pro.ddTp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1Tp_PT(p, T);
+  pro.ddpT := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1pT_PT(p, T);
+  pro.duTp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1Tp_PT(p, T);
+  pro.dupT := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1pT_PT(p, T);
+  pro.x :=0;
+end prop1_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ph.mo
index b22e5a0656a63d056ee3ca95e7eeee0068343cd8..f6d3397b12e91e6b84ec829a090e75e906e5ca16 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ph.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop1_Ph "Thermodynamics properties in region 1, independent variables p and h"
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
- output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro;
-
-algorithm
-  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h);
-  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, h);
-  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, h);
-  pro.s := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1_Ph(p, h);
-  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, h);
-  pro.ddhp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1hp_Ph(p, h);
-  pro.ddph := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h);
-  pro.duph := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h);
-  pro.duhp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1hp_Ph(p, h);
-  pro.x :=0;
-end prop1_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop1_Ph "Thermodynamics properties in region 1, independent variables p and h"
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+ output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro;
+
+algorithm
+  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h);
+  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, h);
+  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, h);
+  pro.s := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1_Ph(p, h);
+  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, h);
+  pro.ddhp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1hp_Ph(p, h);
+  pro.ddph := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h);
+  pro.duph := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h);
+  pro.duhp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1hp_Ph(p, h);
+  pro.x :=0;
+end prop1_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ph_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ph_der.mo
index 6ca61d14ca3cddf9d076053cc297f12e41ece246..ec3fe2df5a6e919899bbc93c9d94e276f9e73e9a 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ph_der.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ph_der.mo
@@ -1,62 +1,62 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop1_Ph_der
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  input Real p_der "derivative of Pressure";
-  input Real h_der "derivative of Specific enthalpy";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph der_pro "Derivative";
-
-protected
-  Real dTp "Derivative of temperature wrt. pressure";
-  Real dTh "Derivative of temperature wrt. enthalpy";
-  Real ddp "Derivative of density wrt. pressure";
-  Real ddh "Derivative of density wrt. enthalpy";
-  Real dup "Derivative of specific inner energy wrt. pressure";
-  Real duh "Derivative of specific inner energy wrt. enthalpy";
-  Real dsp "Derivative of specific entropy wrt. pressure";
-  Real dsh "Derivative of specific entropy wrt. enthalpy";
-  Real dcp "Derivative of specific heat capacity wrt. pressure";
-  Real dch "Derivative of specific heat capacity wrt. enthalpy";
-  Real d2dhp "Second derivative of density wrt. enthalpy and pressure";
-  Real d2dhh "Second derivative of density wrt. enthalpy";
-  Real d2dpp "Second derivative of density wrt. pressure";
-  Real d2uhp "Second derivative of specific inner energy wrt. enthalpy and pressure";
-  Real d2uhh "Second derivative of specific inner energy wrt. enthalpy";
-  Real d2upp "Second derivative of specific inner energy wrt. pressure";
-
-algorithm
-  //First derivatives
-  dTp := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dT1ph_Ph(p, h);
-  dTh := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dT1ph_Ph(p, h);
-  ddp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h);
-  ddh := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h);
-  dup := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h);
-  duh := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h);
-  dsp := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds1ph_Ph(p, h);
-  dsh := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds1ph_Ph(p, h);
-  dcp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp1ph_Ph(p, h);
-  dch := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp1ph_Ph(p, h);
-
-  der_pro.T := dTp*p_der + dTh*h_der;
-  der_pro.d := ddp*p_der + ddh*h_der;
-  der_pro.u := dup*p_der + duh*h_der;
-  der_pro.s := dsp*p_der + dsh*h_der;
-  der_pro.cp := dcp*p_der + dch*h_der;
-  der_pro.x :=0;
-
-  //Second derivatives
-  d2dhp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d1hp_Ph(p, h);
-  d2dhh := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d1hh_Ph(p, h);
-  d2dpp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d1pp_Ph(p, h);
-  d2uhp := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u1hp_Ph(p, h);
-  d2uhh := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u1hh_Ph(p, h);
-  d2upp := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u1pp_Ph(p, h);
-
-  der_pro.ddhp := d2dhp*p_der + d2dhh*h_der;
-  der_pro.ddph := d2dpp*p_der + d2dhp*h_der;
-  der_pro.duph := d2uhp*p_der + d2uhh*h_der;
-  der_pro.duhp := d2upp*p_der + d2uhp*h_der;
-
-end prop1_Ph_der;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop1_Ph_der
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  input Real p_der "derivative of Pressure";
+  input Real h_der "derivative of Specific enthalpy";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph der_pro "Derivative";
+
+protected
+  Real dTp "Derivative of temperature wrt. pressure";
+  Real dTh "Derivative of temperature wrt. enthalpy";
+  Real ddp "Derivative of density wrt. pressure";
+  Real ddh "Derivative of density wrt. enthalpy";
+  Real dup "Derivative of specific inner energy wrt. pressure";
+  Real duh "Derivative of specific inner energy wrt. enthalpy";
+  Real dsp "Derivative of specific entropy wrt. pressure";
+  Real dsh "Derivative of specific entropy wrt. enthalpy";
+  Real dcp "Derivative of specific heat capacity wrt. pressure";
+  Real dch "Derivative of specific heat capacity wrt. enthalpy";
+  Real d2dhp "Second derivative of density wrt. enthalpy and pressure";
+  Real d2dhh "Second derivative of density wrt. enthalpy";
+  Real d2dpp "Second derivative of density wrt. pressure";
+  Real d2uhp "Second derivative of specific inner energy wrt. enthalpy and pressure";
+  Real d2uhh "Second derivative of specific inner energy wrt. enthalpy";
+  Real d2upp "Second derivative of specific inner energy wrt. pressure";
+
+algorithm
+  //First derivatives
+  dTp := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dT1ph_Ph(p, h);
+  dTh := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dT1ph_Ph(p, h);
+  ddp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h);
+  ddh := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h);
+  dup := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h);
+  duh := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h);
+  dsp := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds1ph_Ph(p, h);
+  dsh := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds1ph_Ph(p, h);
+  dcp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp1ph_Ph(p, h);
+  dch := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp1ph_Ph(p, h);
+
+  der_pro.T := dTp*p_der + dTh*h_der;
+  der_pro.d := ddp*p_der + ddh*h_der;
+  der_pro.u := dup*p_der + duh*h_der;
+  der_pro.s := dsp*p_der + dsh*h_der;
+  der_pro.cp := dcp*p_der + dch*h_der;
+  der_pro.x :=0;
+
+  //Second derivatives
+  d2dhp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d1hp_Ph(p, h);
+  d2dhh := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d1hh_Ph(p, h);
+  d2dpp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d1pp_Ph(p, h);
+  d2uhp := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u1hp_Ph(p, h);
+  d2uhh := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u1hh_Ph(p, h);
+  d2upp := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u1pp_Ph(p, h);
+
+  der_pro.ddhp := d2dhp*p_der + d2dhh*h_der;
+  der_pro.ddph := d2dpp*p_der + d2dhp*h_der;
+  der_pro.duph := d2uhp*p_der + d2uhh*h_der;
+  der_pro.duhp := d2upp*p_der + d2uhp*h_der;
+
+end prop1_Ph_der;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ps.mo
index 3ffab8140b308cd403d116bdfd6543ecdd63972c..3b1baa224269dc38ce204c7f11941cc0d5fecdc3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop1_Ps.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop1_Ps "Thermodynamics properties in region 1, independent variables p and s "
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ps pro;
-
-algorithm
-  pro.h := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1_Ps(p, s);
-  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, pro.h);
-  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, pro.h);
-  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, pro.h);
-  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, pro.h);
-  pro.ddsp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1sp_Ps(p, s);
-  pro.ddps := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ps_Ps(p, s);
-  pro.x :=0;
-end prop1_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop1_Ps "Thermodynamics properties in region 1, independent variables p and s "
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ps pro;
+
+algorithm
+  pro.h := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1_Ps(p, s);
+  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, pro.h);
+  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, pro.h);
+  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, pro.h);
+  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, pro.h);
+  pro.ddsp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1sp_Ps(p, s);
+  pro.ddps := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ps_Ps(p, s);
+  pro.x :=0;
+end prop1_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop2_PT.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop2_PT.mo
index c460d62796ae5ec9b4a470f34d3a70c883891091..7b24a52c036da5609949f336f0ffafc03a6c6ec7 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop2_PT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop2_PT.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop2_PT "Thermodynamics properties in region 2, independent variables p and T "
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_pT pro;
-
-algorithm
-  pro.h := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2_PT(p, T);
-  pro.s := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2_Ph(p, pro.h);
-  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, pro.h);
-  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, pro.h);
-  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, pro.h);
-  pro.ddTp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2Tp_PT(p, T);
-  pro.ddpT := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2pT_PT(p, T);
-  pro.duTp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2Tp_PT(p, T);
-  pro.dupT := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2pT_PT(p, T);
-  pro.x :=0;
-end prop2_PT;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop2_PT "Thermodynamics properties in region 2, independent variables p and T "
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_pT pro;
+
+algorithm
+  pro.h := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2_PT(p, T);
+  pro.s := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2_Ph(p, pro.h);
+  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, pro.h);
+  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, pro.h);
+  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, pro.h);
+  pro.ddTp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2Tp_PT(p, T);
+  pro.ddpT := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2pT_PT(p, T);
+  pro.duTp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2Tp_PT(p, T);
+  pro.dupT := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2pT_PT(p, T);
+  pro.x :=0;
+end prop2_PT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ph.mo
index 050129e5c71cbedce0b1ac9a345457d8b5d8f6eb..0959d3dc9c275b55a01c58f4e5cfff6d994bb7e6 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ph.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop2_Ph "Thermodynamics properties in region 2, independent variables p and h "
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro;
-
-algorithm
-  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T2_Ph(p, h);
-  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, h);
-  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, h);
-  pro.s := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2_Ph(p, h);
-  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, h);
-  pro.ddhp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2hp_Ph(p, h);
-  pro.ddph := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h);
-  pro.duph := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h);
-  pro.duhp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2hp_Ph(p, h);
-  pro.x :=1;
-end prop2_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop2_Ph "Thermodynamics properties in region 2, independent variables p and h "
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro;
+
+algorithm
+  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T2_Ph(p, h);
+  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, h);
+  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, h);
+  pro.s := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2_Ph(p, h);
+  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, h);
+  pro.ddhp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2hp_Ph(p, h);
+  pro.ddph := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h);
+  pro.duph := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h);
+  pro.duhp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2hp_Ph(p, h);
+  pro.x :=1;
+end prop2_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ph_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ph_der.mo
index 4111d1f81f7510e10951bb30edc5bb973a1f1515..674b3d2a05a91656c3e7d022ac536acc41afd085 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ph_der.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ph_der.mo
@@ -1,62 +1,62 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop2_Ph_der
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  input Real p_der "derivative of Pressure";
-  input Real h_der "derivative of Specific enthalpy";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph der_pro "Derivative";
-
-protected
-  Real dTp "Derivative of temperature wrt. pressure";
-  Real dTh "Derivative of temperature wrt. enthalpy";
-  Real ddp "Derivative of density wrt. pressure";
-  Real ddh "Derivative of density wrt. enthalpy";
-  Real dup "Derivative of specific inner energy wrt. pressure";
-  Real duh "Derivative of specific inner energy wrt. enthalpy";
-  Real dsp "Derivative of specific entropy wrt. pressure";
-  Real dsh "Derivative of specific entropy wrt. enthalpy";
-  Real dcp "Derivative of specific heat capacity wrt. pressure";
-  Real dch "Derivative of specific heat capacity wrt. enthalpy";
-  Real d2dhp "Second derivative of density wrt. enthalpy and pressure";
-  Real d2dhh "Second derivative of density wrt. enthalpy";
-  Real d2dpp "Second derivative of density wrt. pressure";
-  Real d2uhp "Second derivative of specific inner energy wrt. enthalpy and pressure";
-  Real d2uhh "Second derivative of specific inner energy wrt. enthalpy";
-  Real d2upp "Second derivative of specific inner energy wrt. pressure";
-
-algorithm
-  //First derivatives
-  dTp := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dT2ph_Ph(p, h);
-  dTh := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dT2ph_Ph(p, h);
-  ddp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h);
-  ddh := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h);
-  dup := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h);
-  duh := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h);
-  dsp := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds2ph_Ph(p, h);
-  dsh := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds2ph_Ph(p, h);
-  dcp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp2ph_Ph(p, h);
-  dch := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp2ph_Ph(p, h);
-
-  der_pro.T := dTp*p_der + dTh*h_der;
-  der_pro.d := ddp*p_der + ddh*h_der;
-  der_pro.u := dup*p_der + duh*h_der;
-  der_pro.s := dsp*p_der + dsh*h_der;
-  der_pro.cp := dcp*p_der + dch*h_der;
-  der_pro.x :=0;
-
-  //Second derivatives
-  d2dhp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d2hp_Ph(p, h);
-  d2dhh := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d2hh_Ph(p, h);
-  d2dpp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d2pp_Ph(p, h);
-  d2uhp := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u2hp_Ph(p, h);
-  d2uhh := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u2hh_Ph(p, h);
-  d2upp := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u2pp_Ph(p, h);
-
-  der_pro.ddhp := d2dhp*p_der + d2dhh*h_der;
-  der_pro.ddph := d2dpp*p_der + d2dhp*h_der;
-  der_pro.duph := d2uhp*p_der + d2uhh*h_der;
-  der_pro.duhp := d2upp*p_der + d2uhp*h_der;
-
-end prop2_Ph_der;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop2_Ph_der
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  input Real p_der "derivative of Pressure";
+  input Real h_der "derivative of Specific enthalpy";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph der_pro "Derivative";
+
+protected
+  Real dTp "Derivative of temperature wrt. pressure";
+  Real dTh "Derivative of temperature wrt. enthalpy";
+  Real ddp "Derivative of density wrt. pressure";
+  Real ddh "Derivative of density wrt. enthalpy";
+  Real dup "Derivative of specific inner energy wrt. pressure";
+  Real duh "Derivative of specific inner energy wrt. enthalpy";
+  Real dsp "Derivative of specific entropy wrt. pressure";
+  Real dsh "Derivative of specific entropy wrt. enthalpy";
+  Real dcp "Derivative of specific heat capacity wrt. pressure";
+  Real dch "Derivative of specific heat capacity wrt. enthalpy";
+  Real d2dhp "Second derivative of density wrt. enthalpy and pressure";
+  Real d2dhh "Second derivative of density wrt. enthalpy";
+  Real d2dpp "Second derivative of density wrt. pressure";
+  Real d2uhp "Second derivative of specific inner energy wrt. enthalpy and pressure";
+  Real d2uhh "Second derivative of specific inner energy wrt. enthalpy";
+  Real d2upp "Second derivative of specific inner energy wrt. pressure";
+
+algorithm
+  //First derivatives
+  dTp := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dT2ph_Ph(p, h);
+  dTh := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dT2ph_Ph(p, h);
+  ddp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h);
+  ddh := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h);
+  dup := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h);
+  duh := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h);
+  dsp := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds2ph_Ph(p, h);
+  dsh := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds2ph_Ph(p, h);
+  dcp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp2ph_Ph(p, h);
+  dch := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp2ph_Ph(p, h);
+
+  der_pro.T := dTp*p_der + dTh*h_der;
+  der_pro.d := ddp*p_der + ddh*h_der;
+  der_pro.u := dup*p_der + duh*h_der;
+  der_pro.s := dsp*p_der + dsh*h_der;
+  der_pro.cp := dcp*p_der + dch*h_der;
+  der_pro.x :=0;
+
+  //Second derivatives
+  d2dhp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d2hp_Ph(p, h);
+  d2dhh := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d2hh_Ph(p, h);
+  d2dpp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d2pp_Ph(p, h);
+  d2uhp := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u2hp_Ph(p, h);
+  d2uhh := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u2hh_Ph(p, h);
+  d2upp := ThermoSysPro.Properties.WaterSteamSimple.Energy.d2u2pp_Ph(p, h);
+
+  der_pro.ddhp := d2dhp*p_der + d2dhh*h_der;
+  der_pro.ddph := d2dpp*p_der + d2dhp*h_der;
+  der_pro.duph := d2uhp*p_der + d2uhh*h_der;
+  der_pro.duhp := d2upp*p_der + d2uhp*h_der;
+
+end prop2_Ph_der;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ps.mo
index cb0ac3fb5a20961337f7c2958a38b57bf8f2c65c..3b2ffe67ff1fc682d8e28d75ce49a7bc5b187dcc 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop2_Ps.mo
@@ -1,17 +1,17 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop2_Ps "Thermodynamics properties in region 2, independent variables p and h "
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ps pro;
-
-algorithm
-  pro.h := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2_Ps(p, s);
-  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T2_Ph(p, pro.h);
-  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, pro.h);
-  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, pro.h);
-  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, pro.h);
-  pro.ddsp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2sp_Ps(p, s);
-  pro.ddps := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ps_Ps(p, s);
-  pro.x :=1;
-end prop2_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop2_Ps "Thermodynamics properties in region 2, independent variables p and h "
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ps pro;
+
+algorithm
+  pro.h := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2_Ps(p, s);
+  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T2_Ph(p, pro.h);
+  pro.d := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, pro.h);
+  pro.u := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, pro.h);
+  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, pro.h);
+  pro.ddsp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2sp_Ps(p, s);
+  pro.ddps := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ps_Ps(p, s);
+  pro.x :=1;
+end prop2_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ph.mo
index 467c0652a86090736c4cd8b8a1d1b5aeab0224c7..6fb2f102a27698a20f07faa65a932465ff68698c 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ph.mo
@@ -1,87 +1,87 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop4_Ph "Thermodynamics properties in region 4, independent variables p and h "
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro;
-
-protected
-  Units.SI.SpecificEnthalpy h1sat "Specific enthalpy at liquid saturation";
-  Units.SI.SpecificEnthalpy h2sat "Specific enthalpy at vapor saturation";
-  Units.SI.Temperature T1sat "Temperature at liquid saturation";
-  Units.SI.Temperature T2sat "Temperature at vapor saturation";
-  Units.SI.Density d1sat "Density at liquid saturation";
-  Units.SI.Density d2sat "Density at vapor saturation";
-  Units.SI.SpecificEnergy u1sat "Specific inner energy at liquid saturation";
-  Units.SI.SpecificEnergy u2sat "Specific inner energy at vapor saturation";
-  Units.SI.SpecificEntropy s1sat "Specific entropy at liquid saturation";
-  Units.SI.SpecificEntropy s2sat "Specific entropy at vapor saturation";
-  Units.SI.SpecificHeatCapacity cp1sat
-    "Specific heat capacity at liquid saturation";
-  Units.SI.SpecificHeatCapacity cp2sat
-    "Specific heat capacity at vapor saturation";
-  Units.SI.DerDensityByPressure dd1satp
-    "Derivate of density at liquid saturation wrt. pressure";
-  Units.SI.DerDensityByPressure dd2satp
-    "Derivative of density at vapor saturation wrt. pressure";
-  Real du1satp(unit="m3/kg")
-    "Derivative of specific inner energy at liquid saturation wrt. pressure";
-  Real du2satp(unit="m3/kg")
-    "Derivative of specific inner energy at vapor saturation wrt. pressure";
-  Real dxh(unit="kg/J") "Derivative of quality wrt. enthalpy";
-  Real dxp(unit="1/Pa") "Derivative of quality wrt. pressure";
-  Real dh1satp(unit="m3/kg")
-    "Derivative of specific enthalpy at liquid saturation wrt. pressure";
-  Real dh2satp(unit="m3/kg")
-    "Derivative of specific enthalpy at vapor saturation wrt. pressure";
-  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
-
-algorithm
-  h1sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
-  h2sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
-
-  T1sat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h1sat);
-  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, h1sat);
-  u1sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, h1sat);
-  s1sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1_Ph(p, h1sat);
-  cp1sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p,
-    h1sat);
-  T2sat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T2_Ph(p, h2sat);
-  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, h2sat);
-  u2sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, h2sat);
-  s2sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2_Ph(p, h2sat);
-  cp2sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, h2sat);
-
-  x :=(h - h1sat)/(h2sat - h1sat);
-  pro.x := x;
-  pro.T := (1-x)*T1sat + x*T2sat;
-
-  pro.d := 1/((1-x)/d1sat + x/d2sat);
-
-  pro.u := (1-x)*u1sat + x*u2sat;
-
-  pro.s := (1-x)*s1sat + x*s2sat;
-
-  pro.cp := (1-x)*cp1sat + x*cp2sat;
-
-  // Derivatives
-  dxh :=1/(h2sat - h1sat);
-  dxp := -(dh1satp + x*(dh2satp - dh1satp))/(h2sat - h1sat);
-
-  dd1satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h1sat);
-  du1satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h1sat);
-  dd2satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h2sat);
-  du2satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h2sat);
-
-  dh1satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1satp_P(p);
-  dh2satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2satp_P(p);
-
-  pro.ddhp := - pro.d^2*(-dxh/d1sat + dxh/d2sat);
-
-  pro.ddph := - pro.d^2*(-dxp/d1sat + (1-x)*(-1/d1sat^2)*dd1satp + dxp/d2sat + x*(-1/d2sat^2)*dd2satp);
-
-  pro.duph := -dxp*u1sat + (1-x)*du1satp + dxp*u2sat + x*du2satp;
-
-  pro.duhp := -dxh*u1sat + dxh*u2sat;
-
-end prop4_Ph;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop4_Ph "Thermodynamics properties in region 4, independent variables p and h "
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph pro;
+
+protected
+  Units.SI.SpecificEnthalpy h1sat "Specific enthalpy at liquid saturation";
+  Units.SI.SpecificEnthalpy h2sat "Specific enthalpy at vapor saturation";
+  Units.SI.Temperature T1sat "Temperature at liquid saturation";
+  Units.SI.Temperature T2sat "Temperature at vapor saturation";
+  Units.SI.Density d1sat "Density at liquid saturation";
+  Units.SI.Density d2sat "Density at vapor saturation";
+  Units.SI.SpecificEnergy u1sat "Specific inner energy at liquid saturation";
+  Units.SI.SpecificEnergy u2sat "Specific inner energy at vapor saturation";
+  Units.SI.SpecificEntropy s1sat "Specific entropy at liquid saturation";
+  Units.SI.SpecificEntropy s2sat "Specific entropy at vapor saturation";
+  Units.SI.SpecificHeatCapacity cp1sat
+    "Specific heat capacity at liquid saturation";
+  Units.SI.SpecificHeatCapacity cp2sat
+    "Specific heat capacity at vapor saturation";
+  Units.SI.DerDensityByPressure dd1satp
+    "Derivate of density at liquid saturation wrt. pressure";
+  Units.SI.DerDensityByPressure dd2satp
+    "Derivative of density at vapor saturation wrt. pressure";
+  Real du1satp(unit="m3/kg")
+    "Derivative of specific inner energy at liquid saturation wrt. pressure";
+  Real du2satp(unit="m3/kg")
+    "Derivative of specific inner energy at vapor saturation wrt. pressure";
+  Real dxh(unit="kg/J") "Derivative of quality wrt. enthalpy";
+  Real dxp(unit="1/Pa") "Derivative of quality wrt. pressure";
+  Real dh1satp(unit="m3/kg")
+    "Derivative of specific enthalpy at liquid saturation wrt. pressure";
+  Real dh2satp(unit="m3/kg")
+    "Derivative of specific enthalpy at vapor saturation wrt. pressure";
+  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
+
+algorithm
+  h1sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
+  h2sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
+
+  T1sat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h1sat);
+  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, h1sat);
+  u1sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, h1sat);
+  s1sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1_Ph(p, h1sat);
+  cp1sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p,
+    h1sat);
+  T2sat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T2_Ph(p, h2sat);
+  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, h2sat);
+  u2sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, h2sat);
+  s2sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2_Ph(p, h2sat);
+  cp2sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, h2sat);
+
+  x :=(h - h1sat)/(h2sat - h1sat);
+  pro.x := x;
+  pro.T := (1-x)*T1sat + x*T2sat;
+
+  pro.d := 1/((1-x)/d1sat + x/d2sat);
+
+  pro.u := (1-x)*u1sat + x*u2sat;
+
+  pro.s := (1-x)*s1sat + x*s2sat;
+
+  pro.cp := (1-x)*cp1sat + x*cp2sat;
+
+  // Derivatives
+  dxh :=1/(h2sat - h1sat);
+  dxp := -(dh1satp + x*(dh2satp - dh1satp))/(h2sat - h1sat);
+
+  dd1satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h1sat);
+  du1satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h1sat);
+  dd2satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h2sat);
+  du2satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h2sat);
+
+  dh1satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1satp_P(p);
+  dh2satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2satp_P(p);
+
+  pro.ddhp := - pro.d^2*(-dxh/d1sat + dxh/d2sat);
+
+  pro.ddph := - pro.d^2*(-dxp/d1sat + (1-x)*(-1/d1sat^2)*dd1satp + dxp/d2sat + x*(-1/d2sat^2)*dd2satp);
+
+  pro.duph := -dxp*u1sat + (1-x)*du1satp + dxp*u2sat + x*du2satp;
+
+  pro.duhp := -dxh*u1sat + dxh*u2sat;
+
+end prop4_Ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ph_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ph_der.mo
index 0f728f62d71288b8adf2e01dda26e43366c0f95f..4bc34e18597b6b826f07a1772b4a32efcb2ddf26 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ph_der.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ph_der.mo
@@ -1,175 +1,175 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop4_Ph_der
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
-
-  input Real p_der "derivative of Pressure";
-  input Real h_der "derivative of Specific enthalpy";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph der_pro "Derivative";
-
-protected
-  Units.SI.SpecificEnthalpy h1sat "Specific enthalpy at liquid saturation";
-  Units.SI.SpecificEnthalpy h2sat "Specific enthalpy at vapor saturation";
-  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
-  Real dxh "Derivative of quality wrt. enthalpy";
-  Real dxp "Derivative of quality wrt. pressure";
-  Real x_der "Derivative of quality wrt. time";
-  Units.SI.Density d1sat "Density at liquid saturation";
-  Units.SI.Density d2sat "Density at vapor saturation";
-  Units.SI.SpecificEnergy u1sat "Specific inner energy at liquid saturation";
-  Units.SI.SpecificEnergy u2sat "Specific inner energy at vapor saturation";
-  Units.SI.SpecificEntropy s1sat "Specific entropy at liquid saturation";
-  Units.SI.SpecificEntropy s2sat "Specific entropy at vapor saturation";
-  Units.SI.SpecificHeatCapacity cp1sat
-    "Specific heat capacity at liquid saturation";
-  Units.SI.SpecificHeatCapacity cp2sat
-    "Specific heat capacity at vapor saturation";
-  Units.SI.DerDensityByPressure dd1satp
-    "Derivative of density at liquid saturation wrt. pressure";
-  Units.SI.DerDensityByPressure dd2satp
-    "Derivative of density at vapor saturation wrt. pressure";
-  Real du1satp
-    "Derivative of specific inner energy at liquid saturation wrt. pressure";
-  Real du2satp
-    "Derivative of specific inner energy at vapor saturation wrt. pressure";
-  Real ds1satp
-    "Derivative of specific entropy at liquid saturation wrt. pressure";
-  Real ds2satp
-    "Derivative of specific entropy at vapor saturation wrt. pressure";
-  Real dcp1satp
-    "Derivative of specific heat capacity at liquid saturation wrt. pressure";
-  Real dcp2satp
-    "Derivative of specific heat capacity at vapor saturation wrt. pressure";
-  Real dh1satp
-    "Derivative of specific enthalpy at liquid saturation wrt. pressure";
-  Real dh2satp
-    "Derivative of specific enthalpy at vapor saturation wrt. pressure";
-  Real d2h1satpp;
-  Real d2h2satpp;
-
-  Real u1sat_der
-    "Derivative of specific inner energy at liquid saturation wrt. time";
-  Real u2sat_der
-    "Derivative of specific inner energy at vapor saturation wrt. time";
-  Real d1sat_der "Derivative of density at liquid saturation wrt. time";
-  Real d2sat_der "Derivative of density at vapor saturation wrt. time";
-  Real s1sat_der
-    "Derivative of specific entropy at liquid saturation wrt. time";
-  Real s2sat_der "Derivative of specific entropy at vapor saturation wrt. time";
-  Real cp1sat_der
-    "Derivative of specific heat capacity at liquid saturation wrt. time";
-  Real cp2sat_der
-    "Derivative of specific heat capacity at vapor saturation wrt. time";
-
-  Units.SI.Density d "Density";
-  Real d_der "Derivative of density wrt. time";
-  Real d2xhp "Second derivative of quality wrt. enthalpy and pressure";
-  Real d2xhh "Second derivative of quality wrt. enthalpy";
-  Real d2xpp "Second derivative of quality wrt. pressure";
-  Real dxh_der;
-  Real dxp_der;
-
-  Real d2d1satpp;
-  Real d2d2satpp;
-  Real dd1satp_der;
-  Real dd2satp_der;
-  Real du1satp_der;
-  Real du2satp_der;
-
-algorithm
-  h1sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
-  h2sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
-  dh1satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1satp_P(p);
-  dh2satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2satp_P(p);
-  d2h1satpp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.d2h1satpp_P(p);
-  d2h2satpp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.d2h2satpp_P(p);
-
-  x :=(h - h1sat)/(h2sat - h1sat);
-  dxh :=1/(h2sat - h1sat);
-  dxp := -(dh1satp + x*(dh2satp - dh1satp))/(h2sat - h1sat);
-  d2xhp := -dxh^2*(dh2satp - dh1satp);
-  d2xhh := 0;
-  d2xpp := (-(d2h1satpp+dxp*(dh2satp-dh1satp)+x*(d2h2satpp-d2h1satpp))-dxp*(dh2satp - dh1satp))/(h2sat - h1sat);
-  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, h1sat);
-  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, h2sat);
-  d := 1/((1-x)/d1sat + x/d2sat);
-  dd1satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h1sat);
-  dd2satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h2sat);
-  d2d1satpp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d1pp_Ph(p, h1sat);
-  d2d2satpp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d2pp_Ph(p, h2sat);
-
-  u1sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, h1sat);
-  u2sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, h2sat);
-  du1satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h1sat);
-  du2satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h2sat);
-
-  s1sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1_Ph(p, h1sat);
-  s2sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2_Ph(p, h2sat);
-  ds1satp := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds1ph_Ph(p, h1sat);
-  ds2satp := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds2ph_Ph(p, h2sat);
-
-  cp1sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, h1sat);
-  cp2sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, h2sat);
-  dcp1satp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp1ph_Ph(p, h1sat);
-  dcp2satp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp2ph_Ph(p, h2sat);
-
-  // Quality derivative
-  x_der := dxp*p_der + dxh*h_der;
-  der_pro.x := x_der;
-
-  // Specific inner energy derivative
-  u1sat_der :=du1satp*p_der;
-  u2sat_der :=du2satp*p_der;
-  der_pro.u := -x_der*u1sat + (1-x)*u1sat_der + x_der*u2sat + x*u2sat_der;
-
-  // Specific entropy derivative
-  s1sat_der :=ds1satp*p_der;
-  s2sat_der :=ds2satp*p_der;
-  der_pro.s := -x_der*s1sat + (1-x)*s1sat_der + x_der*s2sat + x*s2sat_der;
-
-  // Specific heat capacity derivative
-  cp1sat_der :=dcp1satp*p_der;
-  cp2sat_der :=dcp2satp*p_der;
-  der_pro.cp := -x_der*cp1sat + (1-x)*cp1sat_der + x_der*cp2sat + x*cp2sat_der;
-
-  // Density derivative
-  d1sat_der :=dd1satp*p_der;
-  d2sat_der :=dd2satp*p_der;
-  d_der := -x_der/d1sat + (1 - x)*(-1/d1sat^2)*d1sat_der + x_der/d2sat + x*(-1/d2sat^2)*d2sat_der;
-  der_pro.d := d_der;
-
-  // Temperature derivative
-  der_pro.T := 0;
-
-  //Second derivative
-  dxh_der := d2xhh*h_der;
-  dxp_der := d2xpp*p_der;
-  dd1satp_der := d2d1satpp*p_der;
-  dd2satp_der := d2d2satpp*p_der;
-
-  der_pro.ddhp := -2*d*d_der*(-dxh/d1sat + dxh/d2sat)
-                  - d^2*(-dxh_der/d1sat - dxh*(-1/d1sat^2)*d1sat_der
-                         +dxh_der/d2sat + dxh*(-1/d2sat^2)*d2sat_der);
-
-  der_pro.ddph := -2*d_der*(-dxp/d1sat + (1-x)*(-1/d1sat^2)*dd1satp + dxp/d2sat + x*(-1/d2sat^2)*dd2satp)
-                  -d^2*(-dxp_der/d1sat
-                        -dxp*(-1/d1sat^2)*d1sat_der
-                        -x_der*(-1/d1sat^2)*dd1satp
-                        +(1-x)*(2/d1sat^2*d1sat_der)*dd1satp
-                        +(1-x)*(-1/d1sat^2)*dd1satp_der
-                        +dxp_der/d2sat
-                        +dxp*(-1/d2sat^2)*d2sat_der
-                        +x_der*(-1/d2sat^2)*dd2satp
-                        +x*(2/d2sat^2*d2sat_der)*dd2satp
-                        +x*(-1/d2sat^2)*dd2satp_der);
-
-  der_pro.duph := -dxp_der*u1sat - dxp*u1sat_der
-                  -x_der*du1satp + (1-x)*du1satp_der
-                  +dxp_der*u2sat + dxp*u2sat_der
-                  +x_der*du2satp + x*du2satp_der;
-
-  der_pro.duhp := -dxh_der*u1sat - dxh*u1sat_der
-                  +dxh_der*u2sat + dxh*u2sat_der;
-
-end prop4_Ph_der;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop4_Ph_der
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEnthalpy h "Specific enthalpy";
+
+  input Real p_der "derivative of Pressure";
+  input Real h_der "derivative of Specific enthalpy";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ph der_pro "Derivative";
+
+protected
+  Units.SI.SpecificEnthalpy h1sat "Specific enthalpy at liquid saturation";
+  Units.SI.SpecificEnthalpy h2sat "Specific enthalpy at vapor saturation";
+  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
+  Real dxh "Derivative of quality wrt. enthalpy";
+  Real dxp "Derivative of quality wrt. pressure";
+  Real x_der "Derivative of quality wrt. time";
+  Units.SI.Density d1sat "Density at liquid saturation";
+  Units.SI.Density d2sat "Density at vapor saturation";
+  Units.SI.SpecificEnergy u1sat "Specific inner energy at liquid saturation";
+  Units.SI.SpecificEnergy u2sat "Specific inner energy at vapor saturation";
+  Units.SI.SpecificEntropy s1sat "Specific entropy at liquid saturation";
+  Units.SI.SpecificEntropy s2sat "Specific entropy at vapor saturation";
+  Units.SI.SpecificHeatCapacity cp1sat
+    "Specific heat capacity at liquid saturation";
+  Units.SI.SpecificHeatCapacity cp2sat
+    "Specific heat capacity at vapor saturation";
+  Units.SI.DerDensityByPressure dd1satp
+    "Derivative of density at liquid saturation wrt. pressure";
+  Units.SI.DerDensityByPressure dd2satp
+    "Derivative of density at vapor saturation wrt. pressure";
+  Real du1satp
+    "Derivative of specific inner energy at liquid saturation wrt. pressure";
+  Real du2satp
+    "Derivative of specific inner energy at vapor saturation wrt. pressure";
+  Real ds1satp
+    "Derivative of specific entropy at liquid saturation wrt. pressure";
+  Real ds2satp
+    "Derivative of specific entropy at vapor saturation wrt. pressure";
+  Real dcp1satp
+    "Derivative of specific heat capacity at liquid saturation wrt. pressure";
+  Real dcp2satp
+    "Derivative of specific heat capacity at vapor saturation wrt. pressure";
+  Real dh1satp
+    "Derivative of specific enthalpy at liquid saturation wrt. pressure";
+  Real dh2satp
+    "Derivative of specific enthalpy at vapor saturation wrt. pressure";
+  Real d2h1satpp;
+  Real d2h2satpp;
+
+  Real u1sat_der
+    "Derivative of specific inner energy at liquid saturation wrt. time";
+  Real u2sat_der
+    "Derivative of specific inner energy at vapor saturation wrt. time";
+  Real d1sat_der "Derivative of density at liquid saturation wrt. time";
+  Real d2sat_der "Derivative of density at vapor saturation wrt. time";
+  Real s1sat_der
+    "Derivative of specific entropy at liquid saturation wrt. time";
+  Real s2sat_der "Derivative of specific entropy at vapor saturation wrt. time";
+  Real cp1sat_der
+    "Derivative of specific heat capacity at liquid saturation wrt. time";
+  Real cp2sat_der
+    "Derivative of specific heat capacity at vapor saturation wrt. time";
+
+  Units.SI.Density d "Density";
+  Real d_der "Derivative of density wrt. time";
+  Real d2xhp "Second derivative of quality wrt. enthalpy and pressure";
+  Real d2xhh "Second derivative of quality wrt. enthalpy";
+  Real d2xpp "Second derivative of quality wrt. pressure";
+  Real dxh_der;
+  Real dxp_der;
+
+  Real d2d1satpp;
+  Real d2d2satpp;
+  Real dd1satp_der;
+  Real dd2satp_der;
+  Real du1satp_der;
+  Real du2satp_der;
+
+algorithm
+  h1sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
+  h2sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
+  dh1satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1satp_P(p);
+  dh2satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2satp_P(p);
+  d2h1satpp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.d2h1satpp_P(p);
+  d2h2satpp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.d2h2satpp_P(p);
+
+  x :=(h - h1sat)/(h2sat - h1sat);
+  dxh :=1/(h2sat - h1sat);
+  dxp := -(dh1satp + x*(dh2satp - dh1satp))/(h2sat - h1sat);
+  d2xhp := -dxh^2*(dh2satp - dh1satp);
+  d2xhh := 0;
+  d2xpp := (-(d2h1satpp+dxp*(dh2satp-dh1satp)+x*(d2h2satpp-d2h1satpp))-dxp*(dh2satp - dh1satp))/(h2sat - h1sat);
+  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, h1sat);
+  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, h2sat);
+  d := 1/((1-x)/d1sat + x/d2sat);
+  dd1satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h1sat);
+  dd2satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h2sat);
+  d2d1satpp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d1pp_Ph(p, h1sat);
+  d2d2satpp := ThermoSysPro.Properties.WaterSteamSimple.Density.d2d2pp_Ph(p, h2sat);
+
+  u1sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, h1sat);
+  u2sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, h2sat);
+  du1satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h1sat);
+  du2satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h2sat);
+
+  s1sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1_Ph(p, h1sat);
+  s2sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2_Ph(p, h2sat);
+  ds1satp := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds1ph_Ph(p, h1sat);
+  ds2satp := ThermoSysPro.Properties.WaterSteamSimple.Entropy.ds2ph_Ph(p, h2sat);
+
+  cp1sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, h1sat);
+  cp2sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, h2sat);
+  dcp1satp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp1ph_Ph(p, h1sat);
+  dcp2satp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp2ph_Ph(p, h2sat);
+
+  // Quality derivative
+  x_der := dxp*p_der + dxh*h_der;
+  der_pro.x := x_der;
+
+  // Specific inner energy derivative
+  u1sat_der :=du1satp*p_der;
+  u2sat_der :=du2satp*p_der;
+  der_pro.u := -x_der*u1sat + (1-x)*u1sat_der + x_der*u2sat + x*u2sat_der;
+
+  // Specific entropy derivative
+  s1sat_der :=ds1satp*p_der;
+  s2sat_der :=ds2satp*p_der;
+  der_pro.s := -x_der*s1sat + (1-x)*s1sat_der + x_der*s2sat + x*s2sat_der;
+
+  // Specific heat capacity derivative
+  cp1sat_der :=dcp1satp*p_der;
+  cp2sat_der :=dcp2satp*p_der;
+  der_pro.cp := -x_der*cp1sat + (1-x)*cp1sat_der + x_der*cp2sat + x*cp2sat_der;
+
+  // Density derivative
+  d1sat_der :=dd1satp*p_der;
+  d2sat_der :=dd2satp*p_der;
+  d_der := -x_der/d1sat + (1 - x)*(-1/d1sat^2)*d1sat_der + x_der/d2sat + x*(-1/d2sat^2)*d2sat_der;
+  der_pro.d := d_der;
+
+  // Temperature derivative
+  der_pro.T := 0;
+
+  //Second derivative
+  dxh_der := d2xhh*h_der;
+  dxp_der := d2xpp*p_der;
+  dd1satp_der := d2d1satpp*p_der;
+  dd2satp_der := d2d2satpp*p_der;
+
+  der_pro.ddhp := -2*d*d_der*(-dxh/d1sat + dxh/d2sat)
+                  - d^2*(-dxh_der/d1sat - dxh*(-1/d1sat^2)*d1sat_der
+                         +dxh_der/d2sat + dxh*(-1/d2sat^2)*d2sat_der);
+
+  der_pro.ddph := -2*d_der*(-dxp/d1sat + (1-x)*(-1/d1sat^2)*dd1satp + dxp/d2sat + x*(-1/d2sat^2)*dd2satp)
+                  -d^2*(-dxp_der/d1sat
+                        -dxp*(-1/d1sat^2)*d1sat_der
+                        -x_der*(-1/d1sat^2)*dd1satp
+                        +(1-x)*(2/d1sat^2*d1sat_der)*dd1satp
+                        +(1-x)*(-1/d1sat^2)*dd1satp_der
+                        +dxp_der/d2sat
+                        +dxp*(-1/d2sat^2)*d2sat_der
+                        +x_der*(-1/d2sat^2)*dd2satp
+                        +x*(2/d2sat^2*d2sat_der)*dd2satp
+                        +x*(-1/d2sat^2)*dd2satp_der);
+
+  der_pro.duph := -dxp_der*u1sat - dxp*u1sat_der
+                  -x_der*du1satp + (1-x)*du1satp_der
+                  +dxp_der*u2sat + dxp*u2sat_der
+                  +x_der*du2satp + x*du2satp_der;
+
+  der_pro.duhp := -dxh_der*u1sat - dxh*u1sat_der
+                  +dxh_der*u2sat + dxh*u2sat_der;
+
+end prop4_Ph_der;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ps.mo
index 927ef904b47fd61b3cf93245fc36dcb9151e8b3f..747bcd00648a754f74468a463e1d52d7f1a99a9e 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/prop4_Ps.mo
@@ -1,85 +1,85 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function prop4_Ps "Thermodynamics properties in region 4, independent variables p and h "
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Units.SI.SpecificEntropy s "Specific entropy";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ps pro;
-
-protected
-  Units.SI.SpecificEnthalpy h1sat "Specific enthalpy at liquid saturation";
-  Units.SI.SpecificEnthalpy h2sat "Specific enthalpy at vapor saturation";
-  Units.SI.Temperature T1sat "Temperature at liquid saturation";
-  Units.SI.Temperature T2sat "Temperature at vapor saturation";
-  Units.SI.Density d1sat "Density at liquid saturation";
-  Units.SI.Density d2sat "Density at vapor saturation";
-  Units.SI.SpecificEnergy u1sat "Specific inner energy at liquid saturation";
-  Units.SI.SpecificEnergy u2sat "Specific inner energy at vapor saturation";
-  Units.SI.SpecificEntropy s1sat "Specific entropy at liquid saturation";
-  Units.SI.SpecificEntropy s2sat "Specific entropy at vapor saturation";
-  Units.SI.SpecificHeatCapacity cp1sat
-    "Specific heat capacity at liquid saturation";
-  Units.SI.SpecificHeatCapacity cp2sat
-    "Specific heat capacity at vapor saturation";
-  Units.SI.DerDensityByPressure dd1satp
-    "Derivate of density at liquid saturation wrt. pressure";
-  Units.SI.DerDensityByPressure dd2satp
-    "Derivative of density at vapor saturation wrt. pressure";
-  Real du1satp(unit="m3/kg")
-    "Derivative of specific inner energy at liquid saturation wrt. pressure";
-  Real du2satp(unit="m3/kg")
-    "Derivative of specific inner energy at vapor saturation wrt. pressure";
-  Real dxp(unit="1/Pa") "Derivative of quality wrt. pressure";
-  Real dxs "Derivative of quality wrt. entropy";
-  Real dh1satp(unit="m3/kg")
-    "Derivative of specific enthalpy at liquid saturation wrt. pressure";
-  Real dh2satp(unit="m3/kg")
-    "Derivative of specific enthalpy at vapor saturation wrt. pressure";
-  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
-
-algorithm
-  h1sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
-  h2sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
-
-  T1sat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h1sat);
-  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, h1sat);
-  u1sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, h1sat);
-  cp1sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p,
-    h1sat);
-  T2sat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T2_Ph(p, h2sat);
-  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, h2sat);
-  u2sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, h2sat);
-  cp2sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, h2sat);
-
-  s1sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1sat_P(p);
-  s2sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2sat_P(p);
-
-  x :=(s - s1sat)/(s2sat - s1sat);
-  pro.x := x;
-
-  pro.h :=(1-x)*h1sat + x*h2sat;
-
-  pro.T := (1-x)*T1sat + x*T2sat;
-
-  pro.d := 1/((1-x)/d1sat + x/d2sat);
-
-  pro.u := (1-x)*u1sat + x*u2sat;
-
-  pro.cp := (1-x)*cp1sat + x*cp2sat;
-
-  // Derivatives
-  dxs := 1/(s2sat - s1sat);
-  dxp := -(dh1satp + x*(dh2satp - dh1satp))/(h2sat - h1sat);
-
-  dd1satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h1sat);
-  du1satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h1sat);
-  dd2satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h2sat);
-  du2satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h2sat);
-
-  dh1satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1satp_P(p);
-  dh2satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2satp_P(p);
-
-  pro.ddsp := - pro.d^2*(-dxs/d1sat + dxs/d2sat);
-
-  pro.ddps := - pro.d^2*(-dxp/d1sat + (1-x)*(-1/d1sat^2)*dd1satp + dxp/d2sat + x*(-1/d2sat^2)*dd2satp);
-
-end prop4_Ps;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function prop4_Ps "Thermodynamics properties in region 4, independent variables p and h "
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Units.SI.SpecificEntropy s "Specific entropy";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.ThermoProperties_ps pro;
+
+protected
+  Units.SI.SpecificEnthalpy h1sat "Specific enthalpy at liquid saturation";
+  Units.SI.SpecificEnthalpy h2sat "Specific enthalpy at vapor saturation";
+  Units.SI.Temperature T1sat "Temperature at liquid saturation";
+  Units.SI.Temperature T2sat "Temperature at vapor saturation";
+  Units.SI.Density d1sat "Density at liquid saturation";
+  Units.SI.Density d2sat "Density at vapor saturation";
+  Units.SI.SpecificEnergy u1sat "Specific inner energy at liquid saturation";
+  Units.SI.SpecificEnergy u2sat "Specific inner energy at vapor saturation";
+  Units.SI.SpecificEntropy s1sat "Specific entropy at liquid saturation";
+  Units.SI.SpecificEntropy s2sat "Specific entropy at vapor saturation";
+  Units.SI.SpecificHeatCapacity cp1sat
+    "Specific heat capacity at liquid saturation";
+  Units.SI.SpecificHeatCapacity cp2sat
+    "Specific heat capacity at vapor saturation";
+  Units.SI.DerDensityByPressure dd1satp
+    "Derivate of density at liquid saturation wrt. pressure";
+  Units.SI.DerDensityByPressure dd2satp
+    "Derivative of density at vapor saturation wrt. pressure";
+  Real du1satp(unit="m3/kg")
+    "Derivative of specific inner energy at liquid saturation wrt. pressure";
+  Real du2satp(unit="m3/kg")
+    "Derivative of specific inner energy at vapor saturation wrt. pressure";
+  Real dxp(unit="1/Pa") "Derivative of quality wrt. pressure";
+  Real dxs "Derivative of quality wrt. entropy";
+  Real dh1satp(unit="m3/kg")
+    "Derivative of specific enthalpy at liquid saturation wrt. pressure";
+  Real dh2satp(unit="m3/kg")
+    "Derivative of specific enthalpy at vapor saturation wrt. pressure";
+  ThermoSysPro.Units.SI.MassFraction x "Vapor mass fraction";
+
+algorithm
+  h1sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h1sat_P(p);
+  h2sat := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.h2sat_P(p);
+
+  T1sat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T1_Ph(p, h1sat);
+  d1sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, h1sat);
+  u1sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u1_Ph(p, h1sat);
+  cp1sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p,
+    h1sat);
+  T2sat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.T2_Ph(p, h2sat);
+  d2sat := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, h2sat);
+  u2sat := ThermoSysPro.Properties.WaterSteamSimple.Energy.u2_Ph(p, h2sat);
+  cp2sat := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, h2sat);
+
+  s1sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s1sat_P(p);
+  s2sat := ThermoSysPro.Properties.WaterSteamSimple.Entropy.s2sat_P(p);
+
+  x :=(s - s1sat)/(s2sat - s1sat);
+  pro.x := x;
+
+  pro.h :=(1-x)*h1sat + x*h2sat;
+
+  pro.T := (1-x)*T1sat + x*T2sat;
+
+  pro.d := 1/((1-x)/d1sat + x/d2sat);
+
+  pro.u := (1-x)*u1sat + x*u2sat;
+
+  pro.cp := (1-x)*cp1sat + x*cp2sat;
+
+  // Derivatives
+  dxs := 1/(s2sat - s1sat);
+  dxp := -(dh1satp + x*(dh2satp - dh1satp))/(h2sat - h1sat);
+
+  dd1satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, h1sat);
+  du1satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du1ph_Ph(p, h1sat);
+  dd2satp := ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, h2sat);
+  du2satp := ThermoSysPro.Properties.WaterSteamSimple.Energy.du2ph_Ph(p, h2sat);
+
+  dh1satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1satp_P(p);
+  dh2satp := ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2satp_P(p);
+
+  pro.ddsp := - pro.d^2*(-dxs/d1sat + dxs/d2sat);
+
+  pro.ddps := - pro.d^2*(-dxp/d1sat + (1-x)*(-1/d1sat^2)*dd1satp + dxp/d2sat + x*(-1/d2sat^2)*dd2satp);
+
+end prop4_Ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/propsat1_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/propsat1_P.mo
index c475e0a258394cd33df7288b62b9a29569bb9f91..5759eb07e6e7c7ea62ed53bdcfb74351c7ae7043 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/propsat1_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/propsat1_P.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function propsat1_P
-  input Units.SI.AbsolutePressure p "Pressure";
-  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat pro;
-
-protected
-  Units.SI.SpecificEnthalpy hl "Bubble enthalpy";
-
-algorithm
-  hl := Enthalpy.h1sat_P(p);
-
-  pro.P := p;
-  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
-  pro.rho := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, hl);
-  pro.h := hl;
-  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, hl);
-  pro.pt := 1; //NA
-  pro.cv := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cv1_Ph(p, hl);
-end propsat1_P;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function propsat1_P
+  input Units.SI.AbsolutePressure p "Pressure";
+  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat pro;
+
+protected
+  Units.SI.SpecificEnthalpy hl "Bubble enthalpy";
+
+algorithm
+  hl := Enthalpy.h1sat_P(p);
+
+  pro.P := p;
+  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
+  pro.rho := ThermoSysPro.Properties.WaterSteamSimple.Density.d1_Ph(p, hl);
+  pro.h := hl;
+  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp1_Ph(p, hl);
+  pro.pt := 1; //NA
+  pro.cv := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cv1_Ph(p, hl);
+end propsat1_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/propsat1_P_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/propsat1_P_der.mo
index e8be1448aa794a8e86c0dda12e2e15e656cd1515..812b6c41986f39ae487053af0798a379b23b3a37 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/propsat1_P_der.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/propsat1_P_der.mo
@@ -1,21 +1,21 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function propsat1_P_der
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Real p_der "Derivative of Pressure";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat der_pro;
-
-protected
-  Units.SI.SpecificEnthalpy hl "Bubble enthalpy";
-
-algorithm
-  hl := Enthalpy.h1sat_P(p);
-
-  der_pro.P := 1;
-  der_pro.T := p_der*ThermoSysPro.Properties.WaterSteamSimple.Temperature.dTsatp_P(p);
-  der_pro.rho := p_der*ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, hl);
-  der_pro.h := p_der*ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1satp_P(p);
-  der_pro.cp := p_der*ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp1ph_Ph(p, hl);
-  der_pro.pt := 1; //NA
-  der_pro.cv := p_der*ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcv1ph_Ph(p, hl);
-end propsat1_P_der;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function propsat1_P_der
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Real p_der "Derivative of Pressure";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat der_pro;
+
+protected
+  Units.SI.SpecificEnthalpy hl "Bubble enthalpy";
+
+algorithm
+  hl := Enthalpy.h1sat_P(p);
+
+  der_pro.P := 1;
+  der_pro.T := p_der*ThermoSysPro.Properties.WaterSteamSimple.Temperature.dTsatp_P(p);
+  der_pro.rho := p_der*ThermoSysPro.Properties.WaterSteamSimple.Density.dd1ph_Ph(p, hl);
+  der_pro.h := p_der*ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh1satp_P(p);
+  der_pro.cp := p_der*ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp1ph_Ph(p, hl);
+  der_pro.pt := 1; //NA
+  der_pro.cv := p_der*ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcv1ph_Ph(p, hl);
+end propsat1_P_der;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/propsat2_P.mo b/ThermoSysPro/Properties/WaterSteamSimple/propsat2_P.mo
index 215774f6ed5b8bd11037c2d2d1050227fbb85750..638e19168721b538c70c06262f905b4ac4cdafd2 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/propsat2_P.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/propsat2_P.mo
@@ -1,19 +1,19 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function propsat2_P
-  input Units.SI.AbsolutePressure p "Pressure";
-  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat pro;
-
-protected
-  Units.SI.SpecificEnthalpy hv "Dew enthalpy";
-
-algorithm
-  hv := Enthalpy.h2sat_P(p);
-
-  pro.P := p;
-  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
-  pro.rho := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, hv);
-  pro.h := hv;
-  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, hv);
-  pro.pt := 1; //NA
-  pro.cv := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cv2_Ph(p, hv);
-end propsat2_P;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function propsat2_P
+  input Units.SI.AbsolutePressure p "Pressure";
+  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat pro;
+
+protected
+  Units.SI.SpecificEnthalpy hv "Dew enthalpy";
+
+algorithm
+  hv := Enthalpy.h2sat_P(p);
+
+  pro.P := p;
+  pro.T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
+  pro.rho := ThermoSysPro.Properties.WaterSteamSimple.Density.d2_Ph(p, hv);
+  pro.h := hv;
+  pro.cp := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cp2_Ph(p, hv);
+  pro.pt := 1; //NA
+  pro.cv := ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.cv2_Ph(p, hv);
+end propsat2_P;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/propsat2_P_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/propsat2_P_der.mo
index 489c35e02c401d3f97acf87021c12e7529ae4436..8e739d80b939385674bfacbb44cccc818f5c5eb6 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/propsat2_P_der.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/propsat2_P_der.mo
@@ -1,21 +1,21 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function propsat2_P_der
-  input Units.SI.AbsolutePressure p "Pressure";
-  input Real p_der "Derivative of Pressure";
-
-  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat der_pro;
-
-protected
-  Units.SI.SpecificEnthalpy hv "Dew enthalpy";
-
-algorithm
-  hv := Enthalpy.h2sat_P(p);
-
-  der_pro.P := 1;
-  der_pro.T := p_der*ThermoSysPro.Properties.WaterSteamSimple.Temperature.dTsatp_P(p);
-  der_pro.rho := p_der*ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, hv);
-  der_pro.h := p_der*ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2satp_P(p);
-  der_pro.cp := p_der*ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp2ph_Ph(p, hv);
-  der_pro.pt := 1; //NA
-  der_pro.cv := p_der*ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcv2ph_Ph(p, hv);
-end propsat2_P_der;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function propsat2_P_der
+  input Units.SI.AbsolutePressure p "Pressure";
+  input Real p_der "Derivative of Pressure";
+
+  output ThermoSysPro.Properties.WaterSteamSimple.PropThermoSat der_pro;
+
+protected
+  Units.SI.SpecificEnthalpy hv "Dew enthalpy";
+
+algorithm
+  hv := Enthalpy.h2sat_P(p);
+
+  der_pro.P := 1;
+  der_pro.T := p_der*ThermoSysPro.Properties.WaterSteamSimple.Temperature.dTsatp_P(p);
+  der_pro.rho := p_der*ThermoSysPro.Properties.WaterSteamSimple.Density.dd2ph_Ph(p, hv);
+  der_pro.h := p_der*ThermoSysPro.Properties.WaterSteamSimple.Enthalpy.dh2satp_P(p);
+  der_pro.cp := p_der*ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcp2ph_Ph(p, hv);
+  der_pro.pt := 1; //NA
+  der_pro.cv := p_der*ThermoSysPro.Properties.WaterSteamSimple.HeatCapacity.dcv2ph_Ph(p, hv);
+end propsat2_P_der;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/region_pT.mo b/ThermoSysPro/Properties/WaterSteamSimple/region_pT.mo
index 861324f36ee1afbc4bb6f60e8a2ea8b91d641f18..2eace2f63cef9b21f872ae5bf8776ccf659cd76f 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/region_pT.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/region_pT.mo
@@ -1,25 +1,25 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function region_pT "Returns the current region (valid values: 1,2) for given pressure and temperature"
-  input Units.SI.Pressure p "Pressure";
-  input Units.SI.Temperature T "Temperature";
-  input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
-
-  output Integer region "Region (valid values: 1,2)";
-
-protected
-  Units.SI.Temperature Tsat "Bubble entropy";
-  Units.SI.SpecificEnthalpy sv "Dew entropy";
-
-algorithm
-  Tsat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
-  if (mode <> 0) then
-    region := mode;
-  else
-    if T > Tsat then
-      region:= 2;
-    else
-      region := 1;
-    end if;
-  end if;
-
-end region_pT;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function region_pT "Returns the current region (valid values: 1,2) for given pressure and temperature"
+  input Units.SI.Pressure p "Pressure";
+  input Units.SI.Temperature T "Temperature";
+  input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
+
+  output Integer region "Region (valid values: 1,2)";
+
+protected
+  Units.SI.Temperature Tsat "Bubble entropy";
+  Units.SI.SpecificEnthalpy sv "Dew entropy";
+
+algorithm
+  Tsat := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p);
+  if (mode <> 0) then
+    region := mode;
+  else
+    if T > Tsat then
+      region:= 2;
+    else
+      region := 1;
+    end if;
+  end if;
+
+end region_pT;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/region_ph.mo b/ThermoSysPro/Properties/WaterSteamSimple/region_ph.mo
index acf1b840cf111e08cd8343865e5fcefcd45a64eb..e34f7676b5449eb8b4806f9d3dda90e330aa35b5 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/region_ph.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/region_ph.mo
@@ -1,47 +1,47 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function region_ph "Returns the current region (valid values: 1,2,4) for given pressure and specific enthalpy"
-  input Units.SI.Pressure p "pressure";
-  input Units.SI.SpecificEnthalpy h "specific enthalpy";
-// input Integer phase=0 "phase: 2 for two-phase, 1 for one phase";
- input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
-
- output Integer region "region (valid values: 1,2,4)";
-  // If mode is different from 0, no checking for the region is done and
-  // the mode is assumed to be the correct region. This can be used to
-  // implement e.g. water-only steamtables when mode == 1
-
-protected
-  Units.SI.SpecificEnthalpy hl "bubble enthalpy";
-  Units.SI.SpecificEnthalpy hv "dew enthalpy";
-  Integer phase;
-  Boolean supercritical;
-
-algorithm
-  if (mode <> 0) then
-    region := mode;
-  else
-    // check for regions 1, 2 and 4
-    supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
-    if supercritical then
-      if h < ThermoSysPro.Properties.WaterSteamSimple.critical.HCRIT then
-       region:= 1;
-      else
-       region:= 2;
-      end if;
-    else
-      hl := Enthalpy.h1sat_P(p);
-      hv := Enthalpy.h2sat_P(p);
-      phase := if ((h < hl) or (h > hv)) then 1 else 2;
-      if (phase == 2) then
-        region := 4;
-      else
-        if (h < hl) then
-          region:= 1;
-        elseif (h>hv) then
-          region := 2;
-        end if;
-      end if;
-    end if;
-  end if;
-
-end region_ph;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function region_ph "Returns the current region (valid values: 1,2,4) for given pressure and specific enthalpy"
+  input Units.SI.Pressure p "pressure";
+  input Units.SI.SpecificEnthalpy h "specific enthalpy";
+// input Integer phase=0 "phase: 2 for two-phase, 1 for one phase";
+ input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
+
+ output Integer region "region (valid values: 1,2,4)";
+  // If mode is different from 0, no checking for the region is done and
+  // the mode is assumed to be the correct region. This can be used to
+  // implement e.g. water-only steamtables when mode == 1
+
+protected
+  Units.SI.SpecificEnthalpy hl "bubble enthalpy";
+  Units.SI.SpecificEnthalpy hv "dew enthalpy";
+  Integer phase;
+  Boolean supercritical;
+
+algorithm
+  if (mode <> 0) then
+    region := mode;
+  else
+    // check for regions 1, 2 and 4
+    supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
+    if supercritical then
+      if h < ThermoSysPro.Properties.WaterSteamSimple.critical.HCRIT then
+       region:= 1;
+      else
+       region:= 2;
+      end if;
+    else
+      hl := Enthalpy.h1sat_P(p);
+      hv := Enthalpy.h2sat_P(p);
+      phase := if ((h < hl) or (h > hv)) then 1 else 2;
+      if (phase == 2) then
+        region := 4;
+      else
+        if (h < hl) then
+          region:= 1;
+        elseif (h>hv) then
+          region := 2;
+        end if;
+      end if;
+    end if;
+  end if;
+
+end region_ph;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/region_ps.mo b/ThermoSysPro/Properties/WaterSteamSimple/region_ps.mo
index e9fa75adb130952e041ba8fe51524b55776fc1ee..1b543e4d077c325170d0d9051a7c4067eb001f80 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/region_ps.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/region_ps.mo
@@ -1,46 +1,46 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-function region_ps "Returns the current region (valid values: 1,2,4) for given pressure and specific entropy"
-  input Units.SI.Pressure p "pressure";
-  input Units.SI.SpecificEntropy s "specific entropy";
-  input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
-  output Integer region "region (valid values: 1,2,4)";
-  // If mode is different from 0, no checking for the region is done and
-  // the mode is assumed to be the correct region. This can be used to
-  // implement e.g. water-only steamtables when mode == 1
-
-protected
-  Units.SI.SpecificEntropy sl "bubble entropy";
-  Units.SI.SpecificEntropy sv "dew entropy";
-
-  Integer phase;
-  Boolean supercritical;
-
-algorithm
-   if (mode <> 0) then
-     region := mode;
-   else
-     // check for regions 1, 2 and 4
-     supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
-     if supercritical then
-       if s < ThermoSysPro.Properties.WaterSteamSimple.critical.SCRIT then
-        region:= 1;
-       else
-        region:= 2;
-       end if;
-     else
-       sl := Entropy.s1sat_P(p);
-       sv := Entropy.s2sat_P(p);
-       phase := if ((s < sl) or (s > sv)) then 1 else 2;
-       if (phase == 2) then
-         region := 4;
-       else
-         if (s < sl) then
-           region:= 1;
-         elseif (s > sv) then
-           region := 2;
-         end if;
-       end if;
-     end if;
-   end if;
-
-end region_ps;
+within ThermoSysPro.Properties.WaterSteamSimple;
+function region_ps "Returns the current region (valid values: 1,2,4) for given pressure and specific entropy"
+  input Units.SI.Pressure p "pressure";
+  input Units.SI.SpecificEntropy s "specific entropy";
+  input Integer mode=0 "mode: 0 means check, otherwise assume region=mode";
+  output Integer region "region (valid values: 1,2,4)";
+  // If mode is different from 0, no checking for the region is done and
+  // the mode is assumed to be the correct region. This can be used to
+  // implement e.g. water-only steamtables when mode == 1
+
+protected
+  Units.SI.SpecificEntropy sl "bubble entropy";
+  Units.SI.SpecificEntropy sv "dew entropy";
+
+  Integer phase;
+  Boolean supercritical;
+
+algorithm
+   if (mode <> 0) then
+     region := mode;
+   else
+     // check for regions 1, 2 and 4
+     supercritical := (p > ThermoSysPro.Properties.WaterSteamSimple.critical.PCRIT);
+     if supercritical then
+       if s < ThermoSysPro.Properties.WaterSteamSimple.critical.SCRIT then
+        region:= 1;
+       else
+        region:= 2;
+       end if;
+     else
+       sl := Entropy.s1sat_P(p);
+       sv := Entropy.s2sat_P(p);
+       phase := if ((s < sl) or (s > sv)) then 1 else 2;
+       if (phase == 2) then
+         region := 4;
+       else
+         if (s < sl) then
+           region:= 1;
+         elseif (s > sv) then
+           region := 2;
+         end if;
+       end if;
+     end if;
+   end if;
+
+end region_ps;
diff --git a/ThermoSysPro/Properties/WaterSteamSimple/triple.mo b/ThermoSysPro/Properties/WaterSteamSimple/triple.mo
index 89a8c015e86b881a7a7af7f4959c053f56ee7cab..2fa7a3925b0e19ba49ae8071589d72dba5ed0de3 100644
--- a/ThermoSysPro/Properties/WaterSteamSimple/triple.mo
+++ b/ThermoSysPro/Properties/WaterSteamSimple/triple.mo
@@ -1,30 +1,30 @@
-within ThermoSysPro.Properties.WaterSteamSimple;
-record triple "triple point data"
-  extends Modelica.Icons.Record;
-  constant Units.SI.Temperature Ttriple=273.16 "the triple point temperature";
-  constant Units.SI.Pressure ptriple=611.657 "the triple point temperature";
-  constant Units.SI.Density dltriple=999.792520031617642 "the triple point liquid density";
-  constant Units.SI.Density dvtriple=0.485457572477861372e-2 "the triple point vapour density";
-  annotation (Documentation(info="<HTML>
- <h4>Record description</h4>
- <p>Vapour/liquid/ice triple point data for IF97 steam properties.</p>
-<h4>Version Info and Revision history
-</h4>
-<ul>
-<li>First implemented: <i>July, 2000</i>
-       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
-       </li>
-</ul>
- <address>Author: Hubertus Tummescheit, <br>
-      Modelon AB<br>
-      Ideon Science Park<br>
-      SE-22370 Lund, Sweden<br>
-      email: hubertus@modelon.se
- </address>
-<ul>
- <li>Initial version: July 2000</li>
- <li>Documentation added: December 2002</li>
-</ul>
-</HTML>
-"));
-end triple;
+within ThermoSysPro.Properties.WaterSteamSimple;
+record triple "triple point data"
+  extends Modelica.Icons.Record;
+  constant Units.SI.Temperature Ttriple=273.16 "the triple point temperature";
+  constant Units.SI.Pressure ptriple=611.657 "the triple point temperature";
+  constant Units.SI.Density dltriple=999.792520031617642 "the triple point liquid density";
+  constant Units.SI.Density dvtriple=0.485457572477861372e-2 "the triple point vapour density";
+  annotation (Documentation(info="<HTML>
+ <h4>Record description</h4>
+ <p>Vapour/liquid/ice triple point data for IF97 steam properties.</p>
+<h4>Version Info and Revision history
+</h4>
+<ul>
+<li>First implemented: <i>July, 2000</i>
+       by <a href=\"http://www.control.lth.se/~hubertus/\">Hubertus Tummescheit</a>
+       </li>
+</ul>
+ <address>Author: Hubertus Tummescheit, <br>
+      Modelon AB<br>
+      Ideon Science Park<br>
+      SE-22370 Lund, Sweden<br>
+      email: hubertus@modelon.se
+ </address>
+<ul>
+ <li>Initial version: July 2000</li>
+ <li>Documentation added: December 2002</li>
+</ul>
+</HTML>
+"));
+end triple;
diff --git a/ThermoSysPro/Properties/package.mo b/ThermoSysPro/Properties/package.mo
index e7933f6fffcc3cab8a58fca18d0d83745b99c662..876034c57b59ffaef26373d99ea2bf656eaf7b1c 100644
--- a/ThermoSysPro/Properties/package.mo
+++ b/ThermoSysPro/Properties/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro;
-package Properties "Fluids properties library"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Properties;
+within ThermoSysPro;
+package Properties "Fluids properties library"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Properties;
diff --git a/ThermoSysPro/Properties/package.order b/ThermoSysPro/Properties/package.order
index 6d851e1a6c21b2c12239ebe152e2fc5928bbcf67..46af4f53215cacfce158a20b87a1d6cf2cef09c3 100644
--- a/ThermoSysPro/Properties/package.order
+++ b/ThermoSysPro/Properties/package.order
@@ -1,12 +1,12 @@
-Fluid
-WaterSteam
-C3H3F5
-FlueGases
-MoltenSalt
-Oil_TherminolVP1
-DryAirIdealGas
-WaterSteamSimple
-WaterSolution
-SolarSalt
-ModelicaMediaFlueGases
-Common
+Fluid
+WaterSteam
+C3H3F5
+FlueGases
+MoltenSalt
+Oil_TherminolVP1
+DryAirIdealGas
+WaterSteamSimple
+WaterSolution
+SolarSalt
+ModelicaMediaFlueGases
+Common
diff --git a/ThermoSysPro/Solar/Collectors/FresnelField.mo b/ThermoSysPro/Solar/Collectors/FresnelField.mo
index 3d824f889e4c90570724101d20efe70c2222f47b..4dd76ecfb0f11f5f170d8605098c6d1608a74ad7 100644
--- a/ThermoSysPro/Solar/Collectors/FresnelField.mo
+++ b/ThermoSysPro/Solar/Collectors/FresnelField.mo
@@ -1,216 +1,216 @@
-within ThermoSysPro.Solar.Collectors;
-model FresnelField "Fresnel field"
-  parameter Units.SI.Area A=10e4 "Aperture area of a train";
-  parameter Integer mode_efficency=1 "1:Definition of each parameter : rho, a, tau , geo. 2:Definition of the global optical efficency";
-  parameter Real eta0=0.625 "Global optical efficency at normal irradiation";
-  parameter Real rho=0.935 "Reflexivity of the primary reflector";
-  parameter Real a=0.955 "Absorptivity of the collector";
-  parameter Real tau=0.965 "Transmissivity of the glass envelope";
-  parameter Real geo=0.725 "Geometric default factor";
-  parameter Real dispo=1 "Mean disponibility of the field";
-  parameter Real clean=1 "Mean cleanliness factor";
-  parameter Units.SI.Length h=7.4 "Height of a collector";
-  parameter ThermoSysPro.Units.SI.Length Lc=44.8 "Length of a collector";
-  parameter Units.SI.Length w=11.46 "Aperture width of a collector";
-  parameter Units.SI.CoefficientOfHeatTransfer hc=1 "Heat transfer coefficient";
-  parameter Boolean thermalLossPhy=true "true: thermal loss using a physical equation - false: thermal loss using a polynomial equation f(deltaT)";
-  parameter Units.SI.Diameter D=0.07 "External tube diameter (active if thermalLossPhy=true)";
-  parameter Real F12=1 "View factor to surroundings radiation heat loss (active if thermalLossPhy=true)";
-  parameter Real Emi=0.8 "Tube emissivity (active if thermalLossPhy=true)";
-  parameter Real A1=0.1598 "x coefficient of the linear thermal loss caracteristics Qloss=f(deltaT) (active if thermalLossPhy=false)";
-  parameter Real A2=0.0057 "x^2 coefficient of the linear thermal loss caracteristics Qloss=f(deltaT) (active if thermalLossPhy=false)";
-  parameter Real B0=0.995 "Constant coefficient of the KT caracteristics KT=f(thetaT)";
-  parameter Real B1=-4e-4 "x coefficient of the KT caracteristics KT=f(thetaT)";
-  parameter Real B2=-3e-5 "x^2 coefficient of the KT caracteristics KT=f(thetaT)";
-  parameter Real B3=1e-6 "x^3 coefficient of the KT caracteristics KT=f(thetaT)";
-  parameter Real B4=-5e-8 "x^4 coefficient of the KT caracteristics KT=f(thetaT)";
-  parameter Real B5=3e-10 "x^5 coefficient of the KT caracteristics KT=f(thetaT)";
-  parameter Real B6=0 "x^6 coefficient of the KT caracteristics KT=f(thetaT)";
-  parameter Units.SI.Temperature T0=300 "Atmospheric temperature";
-  parameter Integer Ns=10 "Number of cells (sections) in the field";
-  parameter ThermoSysPro.Units.nonSI.Angle_deg SunA0=90 "Sun azimuth angle by default";
-  parameter ThermoSysPro.Units.nonSI.Angle_deg SunG0=1e-6 "Sun elevation angle by default";
-  parameter Units.SI.Irradiance SunDNI0=1000 "Direct normal irradiance by default";
-  parameter Real trackingFactor=1 "Mean sun tracking system factor";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1e-6 "epsilon";
-
-public
-  Units.SI.Length L(start=44.8) "Length of a train";
-  Units.SI.Power dPth[Ns](start=fill(80e7/Ns, Ns)) "Thermal Power transfered to the fluid for each section";
-  Real ETA0(start=0.625) "Definition of efficency at normal irradiation";
-  Real sin_alphaS(start=1) "Used in the definition of thetaL and thetaT";
-  ThermoSysPro.Units.nonSI.Angle_deg thetaT(start=0) "Transversal incidence angle";
-  ThermoSysPro.Units.nonSI.Angle_deg thetaL(start=0) "Longitudinal incidence angle";
-  Real track "Mean sun tracking system factor";
-  Units.SI.Power Pth(start=563e6) "Thermal Power transfered to the the fluid";
-  Units.SI.Power Qrec(start=625e6) "Thermal Power received by the receptor";
-  Units.SI.Power Qloss(start=625e5) "Thermal loss on the receptor";
-  Real KT(start=1) "Transversal incidence modifier fonction";
-  Real KL(start=1) "Longitudinal incidence modifier fonction";
-  ThermoSysPro.Units.SI.TemperatureDifference deltaT[Ns](start=fill(50, Ns)) "Mean tempertaure difference";
-  ThermoSysPro.Units.nonSI.Angle_deg gammaS(start=90) "Sun azimuth angle";
-  ThermoSysPro.Units.nonSI.Angle_deg alphaS(start=1e-6) "Sun elevation angle";
-  Units.SI.Irradiance DNI(start=2000) "Direct normal irradiance";
-  Units.SI.Temperature T[Ns](start=fill(300, Ns)) "Pipe wall Temperature ";
-  Units.SI.Power dQloss[Ns](start=fill(563e6/Ns, Ns)) "Thermal loss on the receptor by each cell (section)";
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal SunG
-    "Azimuthal angle of the sun as function of time"
-    annotation (Placement(transformation(
-        origin={68,70},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal SunDNI
-    "Direct Normal Irradiance as fnction of time"
-    annotation (Placement(transformation(
-        origin={110,40},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal SunA
-    "Elevation angle of the sun as function of time"
-    annotation (Placement(transformation(
-        origin={92,70},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-  ThermoSysPro.Thermal.Connectors.ThermalPort P[Ns]
-    "Thermal Power transfered to the fluid"
-    annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=
-            0)));
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Track "Track"
-    annotation (Placement(transformation(
-        origin={-90,70},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-equation
-  /* Input connectors */
-  alphaS = SunA.signal;
-  gammaS = SunG.signal;
-  DNI = SunDNI.signal;
-  track = Track.signal;
-
-  if (cardinality(SunA) == 0) then
-    SunA.signal = SunA0;
-  end if;
-
-  if (cardinality(SunG) == 0) then
-    SunG.signal = SunG0;
-  end if;
-
-  if (cardinality(SunDNI) == 0) then
-    SunDNI.signal = SunDNI0;
-  end if;
-
-  if (cardinality(Track) == 0) then
-    Track.signal = trackingFactor;
-  end if;
-
-  /* Output connectors */
-  P.W = -dPth;
-  P.T = T;
-
-  /* Power conservation + Thermal loss on the receptor */
-  for i in 1:Ns loop
-    /* Power conservation + Thermal loss on the receptor */
-    deltaT[i] = T[i] - T0;
-    dQloss[i] = if thermalLossPhy then pi*D*L/Ns*(0.5*F12*Emi*5.67e-8*(T[i]^4 - (0.0552*T0^(1.5))^4) + hc*(T[i] - T0)) else L/Ns*(A1*deltaT[i] + A2*deltaT[i]^2);
-    dPth[i] = Qrec/Ns - dQloss[i];
-  end for;
-
-  Pth = sum(dPth);
-  Qloss = Qrec - Pth;
-
-  /* Definition of thetaT and thetaL */
-  sin_alphaS = abs(sin(pi*alphaS/180));
-  thetaT = if noEvent(sin_alphaS <= eps) then 90 else 180*atan(sin(pi*gammaS/180)/tan(pi*alphaS/180))/pi;
-  thetaL = 180*acos(sqrt(1 - (cos(pi*alphaS/180)*cos(pi*gammaS/180))^2))/pi;
-
-  /* Optical efficency at normal irradiation */
-  if (mode_efficency == 1) then
-    ETA0 = rho*a*tau*geo;
-  else
-    ETA0 = eta0;
-  end if;
-
-  /* Definition of KT */
-  KT = B6*abs(thetaT)^6 + B5*abs(thetaT)^5 + B4*abs(thetaT)^4 + B3*abs(thetaT)^3 + B2*abs(thetaT)^2 + B1*abs(thetaT) + B0;
-
-  /* Definition of KL */
-  KL = cos(pi*thetaL/180)*(1 - h*tan(pi*thetaL/180)/Lc);
-
-  /* Thermal Power received by the receptor */
-  Qrec = A*DNI*ETA0*KT*KL*dispo*track*clean;
-
-  /* Length of the pipe and pipe section */
-  L = A/w;
-
-  annotation (Icon(graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{100,22},{60,60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-84,-10},{-80,-60}},
-          lineColor={255,255,0},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,56},{-80,-24},{-16,-56}}, color={255,255,0}),
-        Line(points={{80,52},{-80,-28},{-24,-56}}, color={255,255,0}),
-        Line(points={{80,48},{-80,-32},{-32,-56}}, color={255,255,0}),
-        Line(points={{80,44},{-80,-36},{-40,-56}}, color={255,255,0}),
-        Line(points={{80,40},{-80,-40},{-48,-56}}, color={255,255,0}),
-        Line(points={{80,36},{-80,-44},{-56,-56}}, color={255,255,0}),
-        Line(points={{80,32},{-80,-48},{-64,-56}}, color={255,255,0}),
-        Ellipse(extent={{22,-28},{86,-40}}, lineColor={0,0,255}),
-        Rectangle(
-          extent={{-74,-56},{0,-60}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-                            Diagram(graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{100,22},{60,60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-84,-10},{-80,-60}},
-          lineColor={255,255,0},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,56},{-80,-24},{-16,-56}}, color={255,255,0}),
-        Line(points={{80,52},{-80,-28},{-24,-56}}, color={255,255,0}),
-        Line(points={{80,48},{-80,-32},{-32,-56}}, color={255,255,0}),
-        Line(points={{80,44},{-80,-36},{-40,-56}}, color={255,255,0}),
-        Line(points={{80,40},{-80,-40},{-48,-56}}, color={255,255,0}),
-        Line(points={{80,36},{-80,-44},{-56,-56}}, color={255,255,0}),
-        Line(points={{80,32},{-80,-48},{-64,-56}}, color={255,255,0}),
-        Ellipse(extent={{22,-28},{86,-40}}, lineColor={0,0,255}),
-        Rectangle(
-          extent={{-74,-56},{0,-60}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2021</h4>
-<h4>ThermoSysPro Version 4.0</h4>
-<p>This component model is documented in Sect. 16.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
-</html>",
-   revisions="<html>
-</html>"));
-end FresnelField;
+within ThermoSysPro.Solar.Collectors;
+model FresnelField "Fresnel field"
+  parameter Units.SI.Area A=10e4 "Aperture area of a train";
+  parameter Integer mode_efficency=1 "1:Definition of each parameter : rho, a, tau , geo. 2:Definition of the global optical efficency";
+  parameter Real eta0=0.625 "Global optical efficency at normal irradiation";
+  parameter Real rho=0.935 "Reflexivity of the primary reflector";
+  parameter Real a=0.955 "Absorptivity of the collector";
+  parameter Real tau=0.965 "Transmissivity of the glass envelope";
+  parameter Real geo=0.725 "Geometric default factor";
+  parameter Real dispo=1 "Mean disponibility of the field";
+  parameter Real clean=1 "Mean cleanliness factor";
+  parameter Units.SI.Length h=7.4 "Height of a collector";
+  parameter ThermoSysPro.Units.SI.Length Lc=44.8 "Length of a collector";
+  parameter Units.SI.Length w=11.46 "Aperture width of a collector";
+  parameter Units.SI.CoefficientOfHeatTransfer hc=1 "Heat transfer coefficient";
+  parameter Boolean thermalLossPhy=true "true: thermal loss using a physical equation - false: thermal loss using a polynomial equation f(deltaT)";
+  parameter Units.SI.Diameter D=0.07 "External tube diameter (active if thermalLossPhy=true)";
+  parameter Real F12=1 "View factor to surroundings radiation heat loss (active if thermalLossPhy=true)";
+  parameter Real Emi=0.8 "Tube emissivity (active if thermalLossPhy=true)";
+  parameter Real A1=0.1598 "x coefficient of the linear thermal loss caracteristics Qloss=f(deltaT) (active if thermalLossPhy=false)";
+  parameter Real A2=0.0057 "x^2 coefficient of the linear thermal loss caracteristics Qloss=f(deltaT) (active if thermalLossPhy=false)";
+  parameter Real B0=0.995 "Constant coefficient of the KT caracteristics KT=f(thetaT)";
+  parameter Real B1=-4e-4 "x coefficient of the KT caracteristics KT=f(thetaT)";
+  parameter Real B2=-3e-5 "x^2 coefficient of the KT caracteristics KT=f(thetaT)";
+  parameter Real B3=1e-6 "x^3 coefficient of the KT caracteristics KT=f(thetaT)";
+  parameter Real B4=-5e-8 "x^4 coefficient of the KT caracteristics KT=f(thetaT)";
+  parameter Real B5=3e-10 "x^5 coefficient of the KT caracteristics KT=f(thetaT)";
+  parameter Real B6=0 "x^6 coefficient of the KT caracteristics KT=f(thetaT)";
+  parameter Units.SI.Temperature T0=300 "Atmospheric temperature";
+  parameter Integer Ns=10 "Number of cells (sections) in the field";
+  parameter ThermoSysPro.Units.nonSI.Angle_deg SunA0=90 "Sun azimuth angle by default";
+  parameter ThermoSysPro.Units.nonSI.Angle_deg SunG0=1e-6 "Sun elevation angle by default";
+  parameter Units.SI.Irradiance SunDNI0=1000 "Direct normal irradiance by default";
+  parameter Real trackingFactor=1 "Mean sun tracking system factor";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1e-6 "epsilon";
+
+public
+  Units.SI.Length L(start=44.8) "Length of a train";
+  Units.SI.Power dPth[Ns](start=fill(80e7/Ns, Ns)) "Thermal Power transfered to the fluid for each section";
+  Real ETA0(start=0.625) "Definition of efficency at normal irradiation";
+  Real sin_alphaS(start=1) "Used in the definition of thetaL and thetaT";
+  ThermoSysPro.Units.nonSI.Angle_deg thetaT(start=0) "Transversal incidence angle";
+  ThermoSysPro.Units.nonSI.Angle_deg thetaL(start=0) "Longitudinal incidence angle";
+  Real track "Mean sun tracking system factor";
+  Units.SI.Power Pth(start=563e6) "Thermal Power transfered to the the fluid";
+  Units.SI.Power Qrec(start=625e6) "Thermal Power received by the receptor";
+  Units.SI.Power Qloss(start=625e5) "Thermal loss on the receptor";
+  Real KT(start=1) "Transversal incidence modifier fonction";
+  Real KL(start=1) "Longitudinal incidence modifier fonction";
+  ThermoSysPro.Units.SI.TemperatureDifference deltaT[Ns](start=fill(50, Ns)) "Mean tempertaure difference";
+  ThermoSysPro.Units.nonSI.Angle_deg gammaS(start=90) "Sun azimuth angle";
+  ThermoSysPro.Units.nonSI.Angle_deg alphaS(start=1e-6) "Sun elevation angle";
+  Units.SI.Irradiance DNI(start=2000) "Direct normal irradiance";
+  Units.SI.Temperature T[Ns](start=fill(300, Ns)) "Pipe wall Temperature ";
+  Units.SI.Power dQloss[Ns](start=fill(563e6/Ns, Ns)) "Thermal loss on the receptor by each cell (section)";
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal SunG
+    "Azimuthal angle of the sun as function of time"
+    annotation (Placement(transformation(
+        origin={68,70},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal SunDNI
+    "Direct Normal Irradiance as fnction of time"
+    annotation (Placement(transformation(
+        origin={110,40},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal SunA
+    "Elevation angle of the sun as function of time"
+    annotation (Placement(transformation(
+        origin={92,70},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+  ThermoSysPro.Thermal.Connectors.ThermalPort P[Ns]
+    "Thermal Power transfered to the fluid"
+    annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=
+            0)));
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Track "Track"
+    annotation (Placement(transformation(
+        origin={-90,70},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+equation
+  /* Input connectors */
+  alphaS = SunA.signal;
+  gammaS = SunG.signal;
+  DNI = SunDNI.signal;
+  track = Track.signal;
+
+  if (cardinality(SunA) == 0) then
+    SunA.signal = SunA0;
+  end if;
+
+  if (cardinality(SunG) == 0) then
+    SunG.signal = SunG0;
+  end if;
+
+  if (cardinality(SunDNI) == 0) then
+    SunDNI.signal = SunDNI0;
+  end if;
+
+  if (cardinality(Track) == 0) then
+    Track.signal = trackingFactor;
+  end if;
+
+  /* Output connectors */
+  P.W = -dPth;
+  P.T = T;
+
+  /* Power conservation + Thermal loss on the receptor */
+  for i in 1:Ns loop
+    /* Power conservation + Thermal loss on the receptor */
+    deltaT[i] = T[i] - T0;
+    dQloss[i] = if thermalLossPhy then pi*D*L/Ns*(0.5*F12*Emi*5.67e-8*(T[i]^4 - (0.0552*T0^(1.5))^4) + hc*(T[i] - T0)) else L/Ns*(A1*deltaT[i] + A2*deltaT[i]^2);
+    dPth[i] = Qrec/Ns - dQloss[i];
+  end for;
+
+  Pth = sum(dPth);
+  Qloss = Qrec - Pth;
+
+  /* Definition of thetaT and thetaL */
+  sin_alphaS = abs(sin(pi*alphaS/180));
+  thetaT = if noEvent(sin_alphaS <= eps) then 90 else 180*atan(sin(pi*gammaS/180)/tan(pi*alphaS/180))/pi;
+  thetaL = 180*acos(sqrt(1 - (cos(pi*alphaS/180)*cos(pi*gammaS/180))^2))/pi;
+
+  /* Optical efficency at normal irradiation */
+  if (mode_efficency == 1) then
+    ETA0 = rho*a*tau*geo;
+  else
+    ETA0 = eta0;
+  end if;
+
+  /* Definition of KT */
+  KT = B6*abs(thetaT)^6 + B5*abs(thetaT)^5 + B4*abs(thetaT)^4 + B3*abs(thetaT)^3 + B2*abs(thetaT)^2 + B1*abs(thetaT) + B0;
+
+  /* Definition of KL */
+  KL = cos(pi*thetaL/180)*(1 - h*tan(pi*thetaL/180)/Lc);
+
+  /* Thermal Power received by the receptor */
+  Qrec = A*DNI*ETA0*KT*KL*dispo*track*clean;
+
+  /* Length of the pipe and pipe section */
+  L = A/w;
+
+  annotation (Icon(graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{100,22},{60,60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-84,-10},{-80,-60}},
+          lineColor={255,255,0},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,56},{-80,-24},{-16,-56}}, color={255,255,0}),
+        Line(points={{80,52},{-80,-28},{-24,-56}}, color={255,255,0}),
+        Line(points={{80,48},{-80,-32},{-32,-56}}, color={255,255,0}),
+        Line(points={{80,44},{-80,-36},{-40,-56}}, color={255,255,0}),
+        Line(points={{80,40},{-80,-40},{-48,-56}}, color={255,255,0}),
+        Line(points={{80,36},{-80,-44},{-56,-56}}, color={255,255,0}),
+        Line(points={{80,32},{-80,-48},{-64,-56}}, color={255,255,0}),
+        Ellipse(extent={{22,-28},{86,-40}}, lineColor={0,0,255}),
+        Rectangle(
+          extent={{-74,-56},{0,-60}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+                            Diagram(graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{100,22},{60,60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-84,-10},{-80,-60}},
+          lineColor={255,255,0},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,56},{-80,-24},{-16,-56}}, color={255,255,0}),
+        Line(points={{80,52},{-80,-28},{-24,-56}}, color={255,255,0}),
+        Line(points={{80,48},{-80,-32},{-32,-56}}, color={255,255,0}),
+        Line(points={{80,44},{-80,-36},{-40,-56}}, color={255,255,0}),
+        Line(points={{80,40},{-80,-40},{-48,-56}}, color={255,255,0}),
+        Line(points={{80,36},{-80,-44},{-56,-56}}, color={255,255,0}),
+        Line(points={{80,32},{-80,-48},{-64,-56}}, color={255,255,0}),
+        Ellipse(extent={{22,-28},{86,-40}}, lineColor={0,0,255}),
+        Rectangle(
+          extent={{-74,-56},{0,-60}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2021</h4>
+<h4>ThermoSysPro Version 4.0</h4>
+<p>This component model is documented in Sect. 16.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </p>
+</html>",
+   revisions="<html>
+</html>"));
+end FresnelField;
diff --git a/ThermoSysPro/Solar/Collectors/SolarCollector.mo b/ThermoSysPro/Solar/Collectors/SolarCollector.mo
index 7f3b45ac56cb4c94f77c35aaec593e89bbdd72cd..2043eaff0da7c0d709abed521ff3a29402e8d2f7 100644
--- a/ThermoSysPro/Solar/Collectors/SolarCollector.mo
+++ b/ThermoSysPro/Solar/Collectors/SolarCollector.mo
@@ -1,336 +1,336 @@
-within ThermoSysPro.Solar.Collectors;
-model SolarCollector "Solar Collector"
-  parameter Units.SI.Length f=1 "Focal length";
-  parameter Real RimAngle=70 "Rim Angle";
-  parameter Units.SI.Length L=1 "Absorber pipe length or collector length";
-  parameter Integer Ns=10 "Number of cells";
-  parameter Units.SI.Diameter DTube=0.1 "Tube diameter";
-  parameter Units.SI.Diameter DGlass=0.11 "Glass diameter";
-  parameter Units.SI.Length e=1.e-4 "Glass thickness";
-  parameter Real F12=1 "View factor to surroundings,radiation heat loss";
-  parameter Real TauN=0.91 "Glass transmittivity at normal incidence";
-  parameter Real AlphaN=0.97 "Tube absorptivity at normal incidence";
-  parameter Real AlphaGlass=0.03 "Glass absorptivity at normal incidence";
-  parameter Real EpsTube=0.06 "Tube emissivity";
-  parameter Real EpsGlass=0.86 "Glass emissivity";
-  parameter Real R=0.8 "Mirror reflectivity";
-  parameter Real Gamma=0.83 "Intercept factor";
-  parameter Units.SI.ThermalConductivity Lambda=0.00262
-    "Gas thermal conductivity";
-  parameter Units.SI.CoefficientOfHeatTransfer h=3.06
-    "Heat transfer coefficient";
-  parameter Units.SI.SpecificHeatCapacity cp_glass=720 "Glass heat capacity";
-  parameter Units.SI.Density rho_glass=2500 "Glass density";
-  parameter Units.SI.Temperature T0=350
-    "Initial temperature (active if steady_state=false)";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  constant Real sigma=5.67e-8 "Bolzmann constant";
-
-public
-  Real PhiSun(start=1) "Radiation flux";
-  Real Theta(start=0) "Incidence angle";
-  Units.SI.Temperature Twall[Ns](start=fill(350, Ns)) "Pipe wall temperature";
-  Units.SI.Temperature Tatm(start=300) "Atmospheric temperature";
-  Real WTube[Ns](start=fill(1,Ns)) "Flux to the pipe";
-  Units.SI.Area AReflector(start=1) "Reflector surface";
-  Units.SI.Area AGlass(start=1) "Glass surface";
-  Units.SI.Area ATube(start=1) "Pipe surface";
-  Units.SI.Mass dM(start=1) "Glass mass";
-  Real OptEff(start=1) "Optical efficiency";
-  Real IAM(start=1) "Incidence angle modifier";
-  Real TauAlphaN(start=1) "Transmittivity-absorptivity factor";
-  Units.SI.Power WRadWall[Ns](start=fill(0, Ns)) "Radiation of the wall";
-  Units.SI.Power WConvWall[Ns](start=fill(0, Ns)) "Convection of the wall";
-  Units.SI.Power WCondWall[Ns](start=fill(0, Ns)) "Conduction of the wall";
-  Units.SI.Power WRadGlass[Ns](start=fill(0, Ns))
-    "Radiation of the glass layer";
-  Units.SI.Power WConvGlass[Ns](start=fill(0, Ns))
-    "Convection of the glass layer";
-  Units.SI.Power WAbsGlass[Ns](start=fill(0, Ns))
-    "Absorption of the glass layer";
-  Units.SI.Temperature Tsky(start=300) "Sky temperature";
-  Units.SI.Temperature Tglass[Ns](start=fill(300, Ns)) "Glass temperature";
-  //Modelica.SIunits.Power WW ;
-
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISun
-    "Flux (W/m²)"
-    annotation (Placement(transformation(extent={{-250,100},{-230,120}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IncidenceAngle
-    "Degré"
-    annotation (Placement(transformation(extent={{-250,50},{-230,70}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal AtmTemp
-    "Atmospheric temperature (K)"
-    annotation (Placement(transformation(extent={{-250,150},{-230,170}},
-          rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort ITemperature[Ns]
-    annotation (Placement(transformation(extent={{-63,-63},{-43,-43}}, rotation=
-           0)));
-initial equation
-  if steady_state then
-    for i in 1:Ns loop
-      der(Tglass[i]) = 0;
-    end for;
-
-  else
-    for i in 1:Ns loop
-      Tglass[i] = T0;
-    end for;
-  end if;
-
-equation
-  /* Input connectors */
-  PhiSun = ISun.signal;
-  Theta = IncidenceAngle.signal;
-  Tatm = AtmTemp.signal;
-
-  /* Reflector area */
-  AReflector = f*4*Modelica.Math.tan(RimAngle*pi/180./2)*L;
-
-  /* Glass area */
-  AGlass = pi*DGlass*L;
-
-  /* Glass mass of one section */
-  dM = rho_glass*pi*((DGlass + 2*e)^2 - DGlass^2)/4*L/Ns;
-
-  /* Pipe area */
-  ATube = pi*DTube*L;
-
-  /* Incidence angle modifier model */
-  IAM = Modelica.Math.cos(Theta*pi/180);
-
-  /* Transmittivity-absorptivity factor */
-  TauAlphaN = TauN*AlphaN*1/(1-(1-TauN)*(AlphaN));
-
-  /* Optical efficiency */
-  OptEff = IAM*TauAlphaN*Gamma*R;
-
-  /* Sky temperature */
-  Tsky = 0.0552*Tatm^(1.5);
-
-  for i in 1:Ns loop
-    /* Input connectors */
-    Twall[i] = ITemperature[i].T;
-
-    /* Output connectors */
-    ITemperature[i].W = WTube[i];
-
-    /* Wall */
-    WRadWall[i] = ATube/Ns*sigma*EpsTube*(Twall[i]^(4) - Tglass[i]^(4));
-    WConvWall[i] = 0;
-    WCondWall[i] = ATube/Ns*Lambda*(Twall[i] - Tglass[i])/(DTube/2*Modelica.Math.log(DGlass/DTube));
-
-    /* Glass */
-    WRadGlass[i] = F12*AGlass/Ns*sigma*EpsGlass*(Tglass[i]^(4) - Tsky^(4));
-    WConvGlass[i] = AGlass/Ns*h*(Tglass[i] - Tatm);
-    WAbsGlass[i] = PhiSun*AReflector/Ns*AlphaGlass*IAM*Gamma*R;
-
-    /* Glass balance */
-    dM*cp_glass*der(Tglass[i]) = WAbsGlass[i] + WCondWall[i] + WConvWall[i] + WRadWall[i] - WConvGlass[i] - WRadGlass[i];
-
-    /* Flux to the pipe */
-    -WTube[i] = OptEff*PhiSun*AReflector/Ns - WRadGlass[i] - WConvGlass[i];
-  end for;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-60},{130,180}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-230,180},{124,-44}},
-          lineColor={255,170,85},
-          lineThickness=0.5,
-          fillColor={184,230,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-86,11},{-90,1},{-92,-3},{-94,-7},{-96,-11},{-100,-15},{-104,
-              -19},{-108,-23},{-112,-27},{-118,-31},{-124,-35},{-132,-37},{-140,
-              -39},{-142,-39},{-148,-39},{-154,-39},{-162,-39},{-172,-37},{-180,
-              -35},{-186,-33},{-190,-31},{-198,-27},{-204,-23},{-210,-17},{-216,
-              -11},{-220,-5},{-224,3},{-226,9},{-226,11},{-86,11}},
-          lineColor={0,0,0},
-          lineThickness=0.5),
-        Polygon(
-          points={{118,101},{114,91},{112,87},{110,83},{108,79},{104,75},{100,
-              71},{96,67},{92,63},{86,59},{80,55},{72,53},{64,51},{62,51},{56,
-              51},{50,51},{42,51},{32,53},{24,55},{18,57},{14,59},{6,63},{0,67},
-              {-6,73},{-12,79},{-16,85},{-20,93},{-22,99},{-22,101},{118,101}},
-          lineColor={0,0,0},
-          lineThickness=0.5),
-        Line(
-          points={{-126,-35},{80,55}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-226,11},{-22,101}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-86,11},{118,101}},
-          color={0,0,0},
-          thickness=0.5),
-        Ellipse(
-          extent={{-164,66},{-150,53}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-162,64},{-153,55}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={0,127,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-159,66},{45,156}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-153,54},{51,144}},
-          color={0,0,0},
-          thickness=0.5),
-        Ellipse(
-          extent={{-166,-11},{-148,-29}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{40,156},{54,143}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-158,64},{-152,66},{46,154},{50,146},{-154,56},{-158,64}},
-          lineColor={0,127,0},
-          lineThickness=0.5,
-          fillColor={0,127,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{43,154},{52,145}},
-          lineColor={0,127,0},
-          lineThickness=0.5,
-          fillColor={0,127,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-156,60},{-156,-42}},
-          color={255,0,0},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{48,150},{48,48}},
-          color={255,0,0},
-          pattern=LinePattern.Dot)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-60},{130,180}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Polygon(
-          points={{-86,4},{-90,-6},{-92,-10},{-94,-14},{-96,-18},{-100,-22},{
-              -104,-26},{-108,-30},{-112,-34},{-118,-38},{-124,-42},{-132,-44},
-              {-140,-46},{-142,-46},{-148,-46},{-154,-46},{-162,-46},{-172,-44},
-              {-180,-42},{-186,-40},{-190,-38},{-198,-34},{-204,-30},{-210,-24},
-              {-216,-18},{-220,-12},{-224,-4},{-226,2},{-226,4},{-86,4}},
-          lineColor={0,0,0},
-          lineThickness=0.5),
-        Polygon(
-          points={{118,94},{114,84},{112,80},{110,76},{108,72},{104,68},{100,64},
-              {96,60},{92,56},{86,52},{80,48},{72,46},{64,44},{62,44},{56,44},{
-              50,44},{42,44},{32,46},{24,48},{18,50},{14,52},{6,56},{0,60},{-6,
-              66},{-12,72},{-16,78},{-20,86},{-22,92},{-22,94},{118,94}},
-          lineColor={0,0,0},
-          lineThickness=0.5),
-        Line(
-          points={{-126,-42},{80,48}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-226,4},{-22,94}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-86,4},{118,94}},
-          color={0,0,0},
-          thickness=0.5),
-        Ellipse(
-          extent={{-168,82},{-142,56}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={127,0,127},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-164,78},{-146,60}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={0,127,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-159,81},{45,171}},
-          color={0,0,0},
-          thickness=0.5),
-        Ellipse(
-          extent={{37,172},{63,146}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={127,0,127},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-149,57},{55,147}},
-          color={0,0,0},
-          thickness=0.5),
-        Polygon(
-          points={{-146,72},{-152,84},{44,170},{56,148},{-142,60},{-146,72}},
-          lineColor={127,0,127},
-          lineThickness=0.5,
-          fillColor={127,0,127},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-150,78},{-156,82},{-146,86},{-144,78},{-150,78},{-150,78}},
-          lineColor={127,0,127},
-          lineThickness=0.5,
-          fillColor={127,0,127},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-150,58},{-146,64},{-142,66},{-138,62},{-146,58},{-150,58}},
-          lineColor={127,0,127},
-          lineThickness=0.5,
-          fillColor={127,0,127},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-166,-18},{-148,-36}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={215,215,215},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-228,173},{120,-47}},
-          lineColor={255,170,85},
-          lineThickness=0.5)}),
-    Window(
-      x=0.16,
-      y=0.03,
-      width=0.81,
-      height=0.9),
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Guillaume Larrignon</li>
-<li>Baligh El Hefni</li>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b></p>
-<p><b>ThermoSysPro Version 3.2</b></p>
-<p>This component model is documented in Sect. 16.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>
-"));
-end SolarCollector;
+within ThermoSysPro.Solar.Collectors;
+model SolarCollector "Solar Collector"
+  parameter Units.SI.Length f=1 "Focal length";
+  parameter Real RimAngle=70 "Rim Angle";
+  parameter Units.SI.Length L=1 "Absorber pipe length or collector length";
+  parameter Integer Ns=10 "Number of cells";
+  parameter Units.SI.Diameter DTube=0.1 "Tube diameter";
+  parameter Units.SI.Diameter DGlass=0.11 "Glass diameter";
+  parameter Units.SI.Length e=1.e-4 "Glass thickness";
+  parameter Real F12=1 "View factor to surroundings,radiation heat loss";
+  parameter Real TauN=0.91 "Glass transmittivity at normal incidence";
+  parameter Real AlphaN=0.97 "Tube absorptivity at normal incidence";
+  parameter Real AlphaGlass=0.03 "Glass absorptivity at normal incidence";
+  parameter Real EpsTube=0.06 "Tube emissivity";
+  parameter Real EpsGlass=0.86 "Glass emissivity";
+  parameter Real R=0.8 "Mirror reflectivity";
+  parameter Real Gamma=0.83 "Intercept factor";
+  parameter Units.SI.ThermalConductivity Lambda=0.00262
+    "Gas thermal conductivity";
+  parameter Units.SI.CoefficientOfHeatTransfer h=3.06
+    "Heat transfer coefficient";
+  parameter Units.SI.SpecificHeatCapacity cp_glass=720 "Glass heat capacity";
+  parameter Units.SI.Density rho_glass=2500 "Glass density";
+  parameter Units.SI.Temperature T0=350
+    "Initial temperature (active if steady_state=false)";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  constant Real sigma=5.67e-8 "Bolzmann constant";
+
+public
+  Real PhiSun(start=1) "Radiation flux";
+  Real Theta(start=0) "Incidence angle";
+  Units.SI.Temperature Twall[Ns](start=fill(350, Ns)) "Pipe wall temperature";
+  Units.SI.Temperature Tatm(start=300) "Atmospheric temperature";
+  Real WTube[Ns](start=fill(1,Ns)) "Flux to the pipe";
+  Units.SI.Area AReflector(start=1) "Reflector surface";
+  Units.SI.Area AGlass(start=1) "Glass surface";
+  Units.SI.Area ATube(start=1) "Pipe surface";
+  Units.SI.Mass dM(start=1) "Glass mass";
+  Real OptEff(start=1) "Optical efficiency";
+  Real IAM(start=1) "Incidence angle modifier";
+  Real TauAlphaN(start=1) "Transmittivity-absorptivity factor";
+  Units.SI.Power WRadWall[Ns](start=fill(0, Ns)) "Radiation of the wall";
+  Units.SI.Power WConvWall[Ns](start=fill(0, Ns)) "Convection of the wall";
+  Units.SI.Power WCondWall[Ns](start=fill(0, Ns)) "Conduction of the wall";
+  Units.SI.Power WRadGlass[Ns](start=fill(0, Ns))
+    "Radiation of the glass layer";
+  Units.SI.Power WConvGlass[Ns](start=fill(0, Ns))
+    "Convection of the glass layer";
+  Units.SI.Power WAbsGlass[Ns](start=fill(0, Ns))
+    "Absorption of the glass layer";
+  Units.SI.Temperature Tsky(start=300) "Sky temperature";
+  Units.SI.Temperature Tglass[Ns](start=fill(300, Ns)) "Glass temperature";
+  //Modelica.SIunits.Power WW ;
+
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISun
+    "Flux (W/m²)"
+    annotation (Placement(transformation(extent={{-250,100},{-230,120}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IncidenceAngle
+    "Degré"
+    annotation (Placement(transformation(extent={{-250,50},{-230,70}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal AtmTemp
+    "Atmospheric temperature (K)"
+    annotation (Placement(transformation(extent={{-250,150},{-230,170}},
+          rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort ITemperature[Ns]
+    annotation (Placement(transformation(extent={{-63,-63},{-43,-43}}, rotation=
+           0)));
+initial equation
+  if steady_state then
+    for i in 1:Ns loop
+      der(Tglass[i]) = 0;
+    end for;
+
+  else
+    for i in 1:Ns loop
+      Tglass[i] = T0;
+    end for;
+  end if;
+
+equation
+  /* Input connectors */
+  PhiSun = ISun.signal;
+  Theta = IncidenceAngle.signal;
+  Tatm = AtmTemp.signal;
+
+  /* Reflector area */
+  AReflector = f*4*Modelica.Math.tan(RimAngle*pi/180./2)*L;
+
+  /* Glass area */
+  AGlass = pi*DGlass*L;
+
+  /* Glass mass of one section */
+  dM = rho_glass*pi*((DGlass + 2*e)^2 - DGlass^2)/4*L/Ns;
+
+  /* Pipe area */
+  ATube = pi*DTube*L;
+
+  /* Incidence angle modifier model */
+  IAM = Modelica.Math.cos(Theta*pi/180);
+
+  /* Transmittivity-absorptivity factor */
+  TauAlphaN = TauN*AlphaN*1/(1-(1-TauN)*(AlphaN));
+
+  /* Optical efficiency */
+  OptEff = IAM*TauAlphaN*Gamma*R;
+
+  /* Sky temperature */
+  Tsky = 0.0552*Tatm^(1.5);
+
+  for i in 1:Ns loop
+    /* Input connectors */
+    Twall[i] = ITemperature[i].T;
+
+    /* Output connectors */
+    ITemperature[i].W = WTube[i];
+
+    /* Wall */
+    WRadWall[i] = ATube/Ns*sigma*EpsTube*(Twall[i]^(4) - Tglass[i]^(4));
+    WConvWall[i] = 0;
+    WCondWall[i] = ATube/Ns*Lambda*(Twall[i] - Tglass[i])/(DTube/2*Modelica.Math.log(DGlass/DTube));
+
+    /* Glass */
+    WRadGlass[i] = F12*AGlass/Ns*sigma*EpsGlass*(Tglass[i]^(4) - Tsky^(4));
+    WConvGlass[i] = AGlass/Ns*h*(Tglass[i] - Tatm);
+    WAbsGlass[i] = PhiSun*AReflector/Ns*AlphaGlass*IAM*Gamma*R;
+
+    /* Glass balance */
+    dM*cp_glass*der(Tglass[i]) = WAbsGlass[i] + WCondWall[i] + WConvWall[i] + WRadWall[i] - WConvGlass[i] - WRadGlass[i];
+
+    /* Flux to the pipe */
+    -WTube[i] = OptEff*PhiSun*AReflector/Ns - WRadGlass[i] - WConvGlass[i];
+  end for;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-60},{130,180}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-230,180},{124,-44}},
+          lineColor={255,170,85},
+          lineThickness=0.5,
+          fillColor={184,230,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-86,11},{-90,1},{-92,-3},{-94,-7},{-96,-11},{-100,-15},{-104,
+              -19},{-108,-23},{-112,-27},{-118,-31},{-124,-35},{-132,-37},{-140,
+              -39},{-142,-39},{-148,-39},{-154,-39},{-162,-39},{-172,-37},{-180,
+              -35},{-186,-33},{-190,-31},{-198,-27},{-204,-23},{-210,-17},{-216,
+              -11},{-220,-5},{-224,3},{-226,9},{-226,11},{-86,11}},
+          lineColor={0,0,0},
+          lineThickness=0.5),
+        Polygon(
+          points={{118,101},{114,91},{112,87},{110,83},{108,79},{104,75},{100,
+              71},{96,67},{92,63},{86,59},{80,55},{72,53},{64,51},{62,51},{56,
+              51},{50,51},{42,51},{32,53},{24,55},{18,57},{14,59},{6,63},{0,67},
+              {-6,73},{-12,79},{-16,85},{-20,93},{-22,99},{-22,101},{118,101}},
+          lineColor={0,0,0},
+          lineThickness=0.5),
+        Line(
+          points={{-126,-35},{80,55}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-226,11},{-22,101}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-86,11},{118,101}},
+          color={0,0,0},
+          thickness=0.5),
+        Ellipse(
+          extent={{-164,66},{-150,53}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-162,64},{-153,55}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={0,127,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-159,66},{45,156}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-153,54},{51,144}},
+          color={0,0,0},
+          thickness=0.5),
+        Ellipse(
+          extent={{-166,-11},{-148,-29}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{40,156},{54,143}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-158,64},{-152,66},{46,154},{50,146},{-154,56},{-158,64}},
+          lineColor={0,127,0},
+          lineThickness=0.5,
+          fillColor={0,127,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{43,154},{52,145}},
+          lineColor={0,127,0},
+          lineThickness=0.5,
+          fillColor={0,127,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-156,60},{-156,-42}},
+          color={255,0,0},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{48,150},{48,48}},
+          color={255,0,0},
+          pattern=LinePattern.Dot)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-60},{130,180}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Polygon(
+          points={{-86,4},{-90,-6},{-92,-10},{-94,-14},{-96,-18},{-100,-22},{
+              -104,-26},{-108,-30},{-112,-34},{-118,-38},{-124,-42},{-132,-44},
+              {-140,-46},{-142,-46},{-148,-46},{-154,-46},{-162,-46},{-172,-44},
+              {-180,-42},{-186,-40},{-190,-38},{-198,-34},{-204,-30},{-210,-24},
+              {-216,-18},{-220,-12},{-224,-4},{-226,2},{-226,4},{-86,4}},
+          lineColor={0,0,0},
+          lineThickness=0.5),
+        Polygon(
+          points={{118,94},{114,84},{112,80},{110,76},{108,72},{104,68},{100,64},
+              {96,60},{92,56},{86,52},{80,48},{72,46},{64,44},{62,44},{56,44},{
+              50,44},{42,44},{32,46},{24,48},{18,50},{14,52},{6,56},{0,60},{-6,
+              66},{-12,72},{-16,78},{-20,86},{-22,92},{-22,94},{118,94}},
+          lineColor={0,0,0},
+          lineThickness=0.5),
+        Line(
+          points={{-126,-42},{80,48}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-226,4},{-22,94}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-86,4},{118,94}},
+          color={0,0,0},
+          thickness=0.5),
+        Ellipse(
+          extent={{-168,82},{-142,56}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={127,0,127},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-164,78},{-146,60}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={0,127,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-159,81},{45,171}},
+          color={0,0,0},
+          thickness=0.5),
+        Ellipse(
+          extent={{37,172},{63,146}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={127,0,127},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-149,57},{55,147}},
+          color={0,0,0},
+          thickness=0.5),
+        Polygon(
+          points={{-146,72},{-152,84},{44,170},{56,148},{-142,60},{-146,72}},
+          lineColor={127,0,127},
+          lineThickness=0.5,
+          fillColor={127,0,127},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-150,78},{-156,82},{-146,86},{-144,78},{-150,78},{-150,78}},
+          lineColor={127,0,127},
+          lineThickness=0.5,
+          fillColor={127,0,127},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-150,58},{-146,64},{-142,66},{-138,62},{-146,58},{-150,58}},
+          lineColor={127,0,127},
+          lineThickness=0.5,
+          fillColor={127,0,127},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-166,-18},{-148,-36}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={215,215,215},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-228,173},{120,-47}},
+          lineColor={255,170,85},
+          lineThickness=0.5)}),
+    Window(
+      x=0.16,
+      y=0.03,
+      width=0.81,
+      height=0.9),
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Guillaume Larrignon</li>
+<li>Baligh El Hefni</li>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b></p>
+<p><b>ThermoSysPro Version 3.2</b></p>
+<p>This component model is documented in Sect. 16.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>
+"));
+end SolarCollector;
diff --git a/ThermoSysPro/Solar/Collectors/package.mo b/ThermoSysPro/Solar/Collectors/package.mo
index 99def9402090cd65f1fba56316cd9616485ed616..bfffff39c61fec15aaa92a5a83d360b6d54bb6d1 100644
--- a/ThermoSysPro/Solar/Collectors/package.mo
+++ b/ThermoSysPro/Solar/Collectors/package.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.Solar;
-package Collectors "Solar collectors"
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Collectors;
+within ThermoSysPro.Solar;
+package Collectors "Solar collectors"
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Collectors;
diff --git a/ThermoSysPro/Solar/Collectors/package.order b/ThermoSysPro/Solar/Collectors/package.order
index 77a9536312989cbe88b3267173214406e80df220..919af55b7e8bec238a90e410806023f3ba7792ae 100644
--- a/ThermoSysPro/Solar/Collectors/package.order
+++ b/ThermoSysPro/Solar/Collectors/package.order
@@ -1,2 +1,2 @@
-FresnelField
-SolarCollector
+FresnelField
+SolarCollector
diff --git a/ThermoSysPro/Solar/HeatExchangers/DynamicOnePhaseFlowPipe_Oil.mo b/ThermoSysPro/Solar/HeatExchangers/DynamicOnePhaseFlowPipe_Oil.mo
index 7988c3e9a4b7e7dcd5346ca40f3b38b0b689537f..ad056a990689a50361e0968ee6630953a726e71d 100644
--- a/ThermoSysPro/Solar/HeatExchangers/DynamicOnePhaseFlowPipe_Oil.mo
+++ b/ThermoSysPro/Solar/HeatExchangers/DynamicOnePhaseFlowPipe_Oil.mo
@@ -1,316 +1,316 @@
-within ThermoSysPro.Solar.HeatExchangers;
-model DynamicOnePhaseFlowPipe_Oil "Dynamic one-phase flow pipe Oil"
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
-  parameter Real rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real dpfCorr=1.00
-    "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Real hcCorr=1.00
-    "Corrective term for the heat exchange coefficient (hc) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)";
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
- // parameter Boolean inertia=true
- //   "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
- // parameter Boolean dynamic_mass_balance=true
- //   "true: dynamic mass balance equation - false: static mass balance equation";
-
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
-  parameter Integer option_temperature=1
-    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
-  parameter Boolean continuous_flow_reversal=true
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-  parameter Integer N=Ns + 1
-    "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Internal cross sectional pipe area";
-  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-  parameter Units.SI.Area dSi=pi*Di*dx1
-    "Internal heat exchange area for a node";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boudary of node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the water side for node i";
-  Units.SI.Power W1t "Total power exchanged on the water side";
-  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
-       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
-  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Fluid Reynolds number in hydraulic node i";
-  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i";
-  Units.SI.ThermalConductivity k[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Fluid thermal conductivity in node i";
-  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
-  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Fluid dynamic viscosity in hydraulic node i";
-  Units.SI.SpecificHeatCapacity cp[N - 1](start=fill(4000, N - 1), nominal=fill(
-        4000, N - 1)) "Fluid specific heat capacity";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real khi[N] "Hydraulic pressure loss coefficient in node i";
-  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i";
-  Units.SI.Area Stot "Internal heat exchange area";
-
-public
-  WaterSteam.Connectors.FluidInlet C1
-                                    annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-  WaterSteam.Connectors.FluidOutlet C2
-                                    annotation (Placement(transformation(extent=
-           {{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-initial equation
-  if steady_state then
-    for i in 2:N loop
-      der(h[i]) = 0;
-    end for;
-  else
-    Tp = T0;
-
-    if (option_temperature == 1) then
-      for i in 2:N loop
-//EEEEEEEEEreur
-        //h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P[i], T0[i - 1], mode);
-        h[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T( T0[i - 1]);
-      end for;
-    elseif (option_temperature == 2) then
-      for i in 2:N loop
-        h[i] = h0[i - 1];
-      end for;
-    else
-      assert(false, "DynamicOnePhaseFlowPipe: incorrect option");
-    end if;
-  end if;
-
-//  if dynamic_mass_balance then
-//    for i in 2:N loop
-//      der(P[i]) = 0;
-//    end for;
-//  end if;
-
-//  if inertia then
-//    if dynamic_mass_balance then
-//      for i in 1:N loop
-//        der(Q[i]) = 0;
-//      end for;
-//    else
-//      der(Q[1]) = 0;
-//    end if;
-//  end if;
-
-equation
-
-  /* Wall temperature */
-  Tp = CTh.T;
-  CTh.W = dW1;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol;
-  h[N + 1] = C2.h_vol;
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-//    if dynamic_mass_balance then
-//      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
-//    else
-      0 = Q[i] - Q[i + 1];
-//    end if;
-
-    /* Energy balance equation */
-//    if dynamic_mass_balance then
-//      A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-//    else
-      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-//    end if;
-
-    /* Heat transfer at the wall */
-    dW1[i] = hc[i]*dSi*(Tp[i] - T1[i]);
-
-    /* Fluid thermodynamic properties */
-    T1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h[i + 1]);
-    rho1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T1[i]);
-    cp[i] =ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T( T1[i]);
-    mu1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(T1[i]);
-    k[i] = ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(T1[i]);
-
-    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
-    //hc[i] = noEvent(if ((Re1[i] > 1.e-6) and (Pr[i] > 1.e-6)) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 0);
-    if noEvent( Re1[i] > 2000) then
-      hc[i] = noEvent(if (Pr[i] > 1.e-6) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 200);
-    else
-      // Lévêque equation
-      hc[i] = hcCorr*3.66*k[i]/D;
-    end if;
-
-    Pr[i] = mu1[i]*cp[i]/k[i];
-    Re1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2/(pi*Di*mu1[i])));
-
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
-        hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*Modelica.Math.sin(pi
-        *Q[i]/2/Qeps) + h[i + 1] + h[i]));
-    else
-      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
-    end if;
-
-    /* Momentum balance equation */
-//    if inertia then
-//      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
-//    else
-      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-//    end if;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = noEvent(Q[i]*abs(Q[i])*(1/rhoc[i + 1] - 1/rhoc[i])/A^2);
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rho2[i]));
-
-    khi[i] = lambda[i]*dx2/D;
-
-    lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-
-    Re2[i] = noEvent(abs(4*Q[i]/(pi*Di*mu2[i])));
-
-    /* Fluid thermodynamic properties */
-    T2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(hb[i]);
-    rho2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T2[i]);
-    mu2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(T2[i]);
-
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  //proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1], mode);
-  //proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1],h[N + 1], mode);
-  //rhoc[1] = proc[1].d;
-  //rhoc[N + 1] = proc[2].d;
-
-  rhoc[1] = rho1[1];
-  rhoc[N + 1] = rhoc[N];
-
-  W1t = sum(dW1);
-
-  Stot = dSi*Ns;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={0,0,127},
-          fillPattern=FillPattern.Solid),
-        Line(points={{60,20},{60,-20}}, color={255,255,255}),
-        Line(points={{20,20},{20,-20}}, color={255,255,255}),
-        Line(points={{-20,20},{-20,-20}}, color={255,255,255}),
-        Line(points={{-60,20},{-60,-20}}, color={255,255,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={0,0,127},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,20},{-60,-20}}, color={255,255,255}),
-        Line(points={{-20,20},{-20,-20}}, color={255,255,255}),
-        Line(points={{20,20},{20,-20}}, color={255,255,255}),
-        Line(points={{60,20},{60,-20}}, color={255,255,255})}),
-    Window(
-      x=0.18,
-      y=0.05,
-      width=0.68,
-      height=0.94),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</h4></p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end DynamicOnePhaseFlowPipe_Oil;
+within ThermoSysPro.Solar.HeatExchangers;
+model DynamicOnePhaseFlowPipe_Oil "Dynamic one-phase flow pipe Oil"
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
+  parameter Real rugosrel=0.0007 "Pipe relative roughness";
+  parameter Integer ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real dpfCorr=1.00
+    "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Real hcCorr=1.00
+    "Corrective term for the heat exchange coefficient (hc) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)";
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
+ // parameter Boolean inertia=true
+ //   "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+ // parameter Boolean dynamic_mass_balance=true
+ //   "true: dynamic mass balance equation - false: static mass balance equation";
+
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
+  parameter Integer option_temperature=1
+    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
+  parameter Boolean continuous_flow_reversal=true
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+  parameter Integer N=Ns + 1
+    "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Internal cross sectional pipe area";
+  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+  parameter Units.SI.Area dSi=pi*Di*dx1
+    "Internal heat exchange area for a node";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boudary of node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the water side for node i";
+  Units.SI.Power W1t "Total power exchanged on the water side";
+  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
+       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
+  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Fluid Reynolds number in hydraulic node i";
+  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i";
+  Units.SI.ThermalConductivity k[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Fluid thermal conductivity in node i";
+  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
+  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Fluid dynamic viscosity in hydraulic node i";
+  Units.SI.SpecificHeatCapacity cp[N - 1](start=fill(4000, N - 1), nominal=fill(
+        4000, N - 1)) "Fluid specific heat capacity";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real khi[N] "Hydraulic pressure loss coefficient in node i";
+  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i";
+  Units.SI.Area Stot "Internal heat exchange area";
+
+public
+  WaterSteam.Connectors.FluidInlet C1
+                                    annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+  WaterSteam.Connectors.FluidOutlet C2
+                                    annotation (Placement(transformation(extent=
+           {{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+initial equation
+  if steady_state then
+    for i in 2:N loop
+      der(h[i]) = 0;
+    end for;
+  else
+    Tp = T0;
+
+    if (option_temperature == 1) then
+      for i in 2:N loop
+//EEEEEEEEEreur
+        //h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P[i], T0[i - 1], mode);
+        h[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T( T0[i - 1]);
+      end for;
+    elseif (option_temperature == 2) then
+      for i in 2:N loop
+        h[i] = h0[i - 1];
+      end for;
+    else
+      assert(false, "DynamicOnePhaseFlowPipe: incorrect option");
+    end if;
+  end if;
+
+//  if dynamic_mass_balance then
+//    for i in 2:N loop
+//      der(P[i]) = 0;
+//    end for;
+//  end if;
+
+//  if inertia then
+//    if dynamic_mass_balance then
+//      for i in 1:N loop
+//        der(Q[i]) = 0;
+//      end for;
+//    else
+//      der(Q[1]) = 0;
+//    end if;
+//  end if;
+
+equation
+
+  /* Wall temperature */
+  Tp = CTh.T;
+  CTh.W = dW1;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol;
+  h[N + 1] = C2.h_vol;
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+//    if dynamic_mass_balance then
+//      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
+//    else
+      0 = Q[i] - Q[i + 1];
+//    end if;
+
+    /* Energy balance equation */
+//    if dynamic_mass_balance then
+//      A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+//    else
+      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+//    end if;
+
+    /* Heat transfer at the wall */
+    dW1[i] = hc[i]*dSi*(Tp[i] - T1[i]);
+
+    /* Fluid thermodynamic properties */
+    T1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h[i + 1]);
+    rho1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T1[i]);
+    cp[i] =ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T( T1[i]);
+    mu1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(T1[i]);
+    k[i] = ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(T1[i]);
+
+    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
+    //hc[i] = noEvent(if ((Re1[i] > 1.e-6) and (Pr[i] > 1.e-6)) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 0);
+    if noEvent( Re1[i] > 2000) then
+      hc[i] = noEvent(if (Pr[i] > 1.e-6) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 200);
+    else
+      // Lévêque equation
+      hc[i] = hcCorr*3.66*k[i]/D;
+    end if;
+
+    Pr[i] = mu1[i]*cp[i]/k[i];
+    Re1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2/(pi*Di*mu1[i])));
+
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
+        hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*Modelica.Math.sin(pi
+        *Q[i]/2/Qeps) + h[i + 1] + h[i]));
+    else
+      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
+    end if;
+
+    /* Momentum balance equation */
+//    if inertia then
+//      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
+//    else
+      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+//    end if;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = noEvent(Q[i]*abs(Q[i])*(1/rhoc[i + 1] - 1/rhoc[i])/A^2);
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rho2[i]));
+
+    khi[i] = lambda[i]*dx2/D;
+
+    lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+
+    Re2[i] = noEvent(abs(4*Q[i]/(pi*Di*mu2[i])));
+
+    /* Fluid thermodynamic properties */
+    T2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(hb[i]);
+    rho2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T2[i]);
+    mu2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(T2[i]);
+
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  //proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1], mode);
+  //proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1],h[N + 1], mode);
+  //rhoc[1] = proc[1].d;
+  //rhoc[N + 1] = proc[2].d;
+
+  rhoc[1] = rho1[1];
+  rhoc[N + 1] = rhoc[N];
+
+  W1t = sum(dW1);
+
+  Stot = dSi*Ns;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={0,0,127},
+          fillPattern=FillPattern.Solid),
+        Line(points={{60,20},{60,-20}}, color={255,255,255}),
+        Line(points={{20,20},{20,-20}}, color={255,255,255}),
+        Line(points={{-20,20},{-20,-20}}, color={255,255,255}),
+        Line(points={{-60,20},{-60,-20}}, color={255,255,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={0,0,127},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,20},{-60,-20}}, color={255,255,255}),
+        Line(points={{-20,20},{-20,-20}}, color={255,255,255}),
+        Line(points={{20,20},{20,-20}}, color={255,255,255}),
+        Line(points={{60,20},{60,-20}}, color={255,255,255})}),
+    Window(
+      x=0.18,
+      y=0.05,
+      width=0.68,
+      height=0.94),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</h4></p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end DynamicOnePhaseFlowPipe_Oil;
diff --git a/ThermoSysPro/Solar/HeatExchangers/DynamicOnePhaseFlowPipe_SaltOil.mo b/ThermoSysPro/Solar/HeatExchangers/DynamicOnePhaseFlowPipe_SaltOil.mo
index 80aadb132856e0eac340801ec0b8896738c5e0cc..abce106f7f601e62856311febdc1c9831d3b88c5 100644
--- a/ThermoSysPro/Solar/HeatExchangers/DynamicOnePhaseFlowPipe_SaltOil.mo
+++ b/ThermoSysPro/Solar/HeatExchangers/DynamicOnePhaseFlowPipe_SaltOil.mo
@@ -1,290 +1,290 @@
-within ThermoSysPro.Solar.HeatExchangers;
-model DynamicOnePhaseFlowPipe_SaltOil "Dynamic one-phase flow pipe Salt-Oil"
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
-  parameter Real rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real dpfCorr=1.00
-    "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Real hcCorr=1.00
-    "Corrective term for the heat exchange coefficient (hc) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false)";
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false)";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from  h0 ";
-  parameter Boolean continuous_flow_reversal=true
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer fluid=1 "1: Oil (TherminolVP1) - 2: Salt (KNO3-NaNO3)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-  parameter Integer N=Ns + 1
-    "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Internal cross sectional pipe area";
-  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-  parameter Units.SI.Area dSi=pi*Di*dx1
-    "Internal heat exchange area for a node";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boudary of node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the water side for node i";
-  Units.SI.Power W1t "Total power exchanged on the water side";
-  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
-       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
-  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Fluid Reynolds number in hydraulic node i";
-  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i";
-  Units.SI.ThermalConductivity k[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Fluid thermal conductivity in node i";
-  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
-  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Fluid dynamic viscosity in hydraulic node i";
-  Units.SI.SpecificHeatCapacity cp[N - 1](start=fill(4000, N - 1), nominal=fill(
-        4000, N - 1)) "Fluid specific heat capacity";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real khi[N] "Hydraulic pressure loss coefficient in node i";
-  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i";
-  Units.SI.Area Stot "Internal heat exchange area";
-
-public
-  WaterSteam.Connectors.FluidInlet C1
-                                    annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-  WaterSteam.Connectors.FluidOutlet C2
-                                    annotation (Placement(transformation(extent=
-           {{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-initial equation
-  if steady_state then
-    for i in 2:N loop
-      der(h[i]) = 0;
-    end for;
-  else
-    Tp = T0;
-
-    for i in 2:N loop
-      h[i] = h0[i - 1];
-    end for;
-  end if;
-
-equation
-
-  /* Wall temperature */
-  Tp = CTh.T;
-  CTh.W = dW1;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol;
-  h[N + 1] = C2.h_vol;
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-    0 = Q[i] - Q[i + 1];
-
-    /* Energy balance equation */
-    A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-
-    /* Heat transfer at the wall */
-    dW1[i] = hc[i]*dSi*(Tp[i] - T1[i]);
-
-    /* Fluid thermodynamic properties */
-    if (fluid == 1) then
-      T1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h[i + 1]);
-      rho1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T1[i]);
-      cp[i] = ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T( T1[i]);
-      mu1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(T1[i]);
-      k[i] = ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(T1[i]);
-    elseif (fluid == 2) then
-      T1[i] = ThermoSysPro.Properties.MoltenSalt.Temperature_h(h[i + 1]);
-      rho1[i] = ThermoSysPro.Properties.MoltenSalt.Density_T(T1[i]);
-      cp[i] = ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T( T1[i]);
-      mu1[i] = ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T1[i]);
-      k[i] = ThermoSysPro.Properties.MoltenSalt.ThermalConductivity_T(T1[i]);
-    else
-      assert(false, "DynamicOnePhaseFlowPipe_SaltOil: invalid option");
-    end if;
-
-    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
-    //hc[i] = noEvent(if ((Re1[i] > 1.e-6) and (Pr[i] > 1.e-6)) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 0);
-    if noEvent( Re1[i] > 2000) then
-      hc[i] = noEvent(if (Pr[i] > 1.e-6) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 200);
-    else
-      // Lévêque equation
-      hc[i] = hcCorr*3.66*k[i]/D;
-    end if;
-
-    Pr[i] = mu1[i]*cp[i]/k[i];
-    Re1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2/(pi*Di*mu1[i])));
-
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
-        hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*Modelica.Math.sin(pi
-        *Q[i]/2/Qeps) + h[i + 1] + h[i]));
-    else
-      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
-    end if;
-
-    /* Momentum balance equation */
-    P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = noEvent(Q[i]*abs(Q[i])*(1/rhoc[i + 1] - 1/rhoc[i])/A^2);
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rho2[i]));
-
-    khi[i] = lambda[i]*dx2/D;
-
-    lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-
-    Re2[i] = noEvent(abs(4*Q[i]/(pi*Di*mu2[i])));
-
-    /* Fluid thermodynamic properties */
-    if (fluid == 1) then
-      T2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(hb[i]);
-      rho2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T2[i]);
-      mu2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(T2[i]);
-    elseif (fluid == 2) then
-      T2[i] = ThermoSysPro.Properties.MoltenSalt.Temperature_h(hb[i]);
-      rho2[i] = ThermoSysPro.Properties.MoltenSalt.Density_T(T2[i]);
-      mu2[i] = ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T2[i]);
-    else
-      assert(false, "DynamicOnePhaseFlowPipe_SaltOil: invalid option");
-    end if;
-
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  //proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1], mode);
-  //proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1],h[N + 1], mode);
-  //rhoc[1] = proc[1].d;
-  //rhoc[N + 1] = proc[2].d;
-
-  rhoc[1] = rho1[1];
-  rhoc[N + 1] = rhoc[N];
-
-  W1t = sum(dW1);
-
-  Stot = dSi*Ns;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={78,78,235},
-          fillPattern=FillPattern.Solid),
-        Line(points={{60,20},{60,-20}}, color={255,255,255}),
-        Line(points={{20,20},{20,-20}}, color={255,255,255}),
-        Line(points={{-20,20},{-20,-20}}, color={255,255,255}),
-        Line(points={{-60,20},{-60,-20}}, color={255,255,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={78,78,235},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,20},{-60,-20}}, color={255,255,255}),
-        Line(points={{-20,20},{-20,-20}}, color={255,255,255}),
-        Line(points={{20,20},{20,-20}}, color={255,255,255}),
-        Line(points={{60,20},{60,-20}}, color={255,255,255})}),
-    Window(
-      x=0.18,
-      y=0.05,
-      width=0.68,
-      height=0.94),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</h4></p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end DynamicOnePhaseFlowPipe_SaltOil;
+within ThermoSysPro.Solar.HeatExchangers;
+model DynamicOnePhaseFlowPipe_SaltOil "Dynamic one-phase flow pipe Salt-Oil"
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
+  parameter Real rugosrel=0.0007 "Pipe relative roughness";
+  parameter Integer ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real dpfCorr=1.00
+    "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Real hcCorr=1.00
+    "Corrective term for the heat exchange coefficient (hc) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false)";
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false)";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from  h0 ";
+  parameter Boolean continuous_flow_reversal=true
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer fluid=1 "1: Oil (TherminolVP1) - 2: Salt (KNO3-NaNO3)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+  parameter Integer N=Ns + 1
+    "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Internal cross sectional pipe area";
+  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+  parameter Units.SI.Area dSi=pi*Di*dx1
+    "Internal heat exchange area for a node";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boudary of node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the water side for node i";
+  Units.SI.Power W1t "Total power exchanged on the water side";
+  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
+       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
+  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Fluid Reynolds number in hydraulic node i";
+  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i";
+  Units.SI.ThermalConductivity k[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Fluid thermal conductivity in node i";
+  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
+  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Fluid dynamic viscosity in hydraulic node i";
+  Units.SI.SpecificHeatCapacity cp[N - 1](start=fill(4000, N - 1), nominal=fill(
+        4000, N - 1)) "Fluid specific heat capacity";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real khi[N] "Hydraulic pressure loss coefficient in node i";
+  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i";
+  Units.SI.Area Stot "Internal heat exchange area";
+
+public
+  WaterSteam.Connectors.FluidInlet C1
+                                    annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+  WaterSteam.Connectors.FluidOutlet C2
+                                    annotation (Placement(transformation(extent=
+           {{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+initial equation
+  if steady_state then
+    for i in 2:N loop
+      der(h[i]) = 0;
+    end for;
+  else
+    Tp = T0;
+
+    for i in 2:N loop
+      h[i] = h0[i - 1];
+    end for;
+  end if;
+
+equation
+
+  /* Wall temperature */
+  Tp = CTh.T;
+  CTh.W = dW1;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol;
+  h[N + 1] = C2.h_vol;
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+    0 = Q[i] - Q[i + 1];
+
+    /* Energy balance equation */
+    A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+
+    /* Heat transfer at the wall */
+    dW1[i] = hc[i]*dSi*(Tp[i] - T1[i]);
+
+    /* Fluid thermodynamic properties */
+    if (fluid == 1) then
+      T1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h[i + 1]);
+      rho1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T1[i]);
+      cp[i] = ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T( T1[i]);
+      mu1[i] = ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(T1[i]);
+      k[i] = ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(T1[i]);
+    elseif (fluid == 2) then
+      T1[i] = ThermoSysPro.Properties.MoltenSalt.Temperature_h(h[i + 1]);
+      rho1[i] = ThermoSysPro.Properties.MoltenSalt.Density_T(T1[i]);
+      cp[i] = ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T( T1[i]);
+      mu1[i] = ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T1[i]);
+      k[i] = ThermoSysPro.Properties.MoltenSalt.ThermalConductivity_T(T1[i]);
+    else
+      assert(false, "DynamicOnePhaseFlowPipe_SaltOil: invalid option");
+    end if;
+
+    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
+    //hc[i] = noEvent(if ((Re1[i] > 1.e-6) and (Pr[i] > 1.e-6)) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 0);
+    if noEvent( Re1[i] > 2000) then
+      hc[i] = noEvent(if (Pr[i] > 1.e-6) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 200);
+    else
+      // Lévêque equation
+      hc[i] = hcCorr*3.66*k[i]/D;
+    end if;
+
+    Pr[i] = mu1[i]*cp[i]/k[i];
+    Re1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2/(pi*Di*mu1[i])));
+
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
+        hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*Modelica.Math.sin(pi
+        *Q[i]/2/Qeps) + h[i + 1] + h[i]));
+    else
+      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
+    end if;
+
+    /* Momentum balance equation */
+    P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = noEvent(Q[i]*abs(Q[i])*(1/rhoc[i + 1] - 1/rhoc[i])/A^2);
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rho2[i]));
+
+    khi[i] = lambda[i]*dx2/D;
+
+    lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+
+    Re2[i] = noEvent(abs(4*Q[i]/(pi*Di*mu2[i])));
+
+    /* Fluid thermodynamic properties */
+    if (fluid == 1) then
+      T2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(hb[i]);
+      rho2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T2[i]);
+      mu2[i] = ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(T2[i]);
+    elseif (fluid == 2) then
+      T2[i] = ThermoSysPro.Properties.MoltenSalt.Temperature_h(hb[i]);
+      rho2[i] = ThermoSysPro.Properties.MoltenSalt.Density_T(T2[i]);
+      mu2[i] = ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(T2[i]);
+    else
+      assert(false, "DynamicOnePhaseFlowPipe_SaltOil: invalid option");
+    end if;
+
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  //proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1], mode);
+  //proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1],h[N + 1], mode);
+  //rhoc[1] = proc[1].d;
+  //rhoc[N + 1] = proc[2].d;
+
+  rhoc[1] = rho1[1];
+  rhoc[N + 1] = rhoc[N];
+
+  W1t = sum(dW1);
+
+  Stot = dSi*Ns;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={78,78,235},
+          fillPattern=FillPattern.Solid),
+        Line(points={{60,20},{60,-20}}, color={255,255,255}),
+        Line(points={{20,20},{20,-20}}, color={255,255,255}),
+        Line(points={{-20,20},{-20,-20}}, color={255,255,255}),
+        Line(points={{-60,20},{-60,-20}}, color={255,255,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={78,78,235},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,20},{-60,-20}}, color={255,255,255}),
+        Line(points={{-20,20},{-20,-20}}, color={255,255,255}),
+        Line(points={{20,20},{20,-20}}, color={255,255,255}),
+        Line(points={{60,20},{60,-20}}, color={255,255,255})}),
+    Window(
+      x=0.18,
+      y=0.05,
+      width=0.68,
+      height=0.94),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</h4></p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end DynamicOnePhaseFlowPipe_SaltOil;
diff --git a/ThermoSysPro/Solar/HeatExchangers/package.mo b/ThermoSysPro/Solar/HeatExchangers/package.mo
index 527fc5d9774db3796f3188eead48c294bad7dbdc..54ec684640a3e734dfe6345fa4c83f804f928aa7 100644
--- a/ThermoSysPro/Solar/HeatExchangers/package.mo
+++ b/ThermoSysPro/Solar/HeatExchangers/package.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.Solar;
-package HeatExchangers "HeatExchangers"
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end HeatExchangers;
+within ThermoSysPro.Solar;
+package HeatExchangers "HeatExchangers"
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end HeatExchangers;
diff --git a/ThermoSysPro/Solar/HeatExchangers/package.order b/ThermoSysPro/Solar/HeatExchangers/package.order
index 8c0348f38bb72428374544694f0c7b13824533dc..c9edcd98b9301a5cf88bd0cc54e9725009986c4f 100644
--- a/ThermoSysPro/Solar/HeatExchangers/package.order
+++ b/ThermoSysPro/Solar/HeatExchangers/package.order
@@ -1,2 +1,2 @@
-DynamicOnePhaseFlowPipe_Oil
-DynamicOnePhaseFlowPipe_SaltOil
+DynamicOnePhaseFlowPipe_Oil
+DynamicOnePhaseFlowPipe_SaltOil
diff --git a/ThermoSysPro/Solar/Junctions/MassFlowMultiplier.mo b/ThermoSysPro/Solar/Junctions/MassFlowMultiplier.mo
index 57839a5f1163a1610dd97ca9a26477c38c76d9c0..6e9a87520e2ec3550b52407a3ffcd8fe899452a4 100644
--- a/ThermoSysPro/Solar/Junctions/MassFlowMultiplier.mo
+++ b/ThermoSysPro/Solar/Junctions/MassFlowMultiplier.mo
@@ -1,86 +1,86 @@
-within ThermoSysPro.Solar.Junctions;
-model MassFlowMultiplier "Mass flow multipliier"
-  parameter Real alpha=2 "Flow multiplier";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-
-public
-  WaterSteam.Connectors.FluidInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  WaterSteam.Connectors.FluidOutlet Cs                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  /* Fluid pressure */
-  P = Ce.P;
-  P = Cs.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ce.h_vol = h;
-  Cs.h_vol = h;
-
-  /* Mass balance equation */
-  0 = alpha*Ce.Q - Cs.Q;
-
-  /* Energy balance equation */
-  0 = alpha*Ce.Q*Ce.h - Cs.Q*Cs.h;
-
-  /* Fluid thermodynamic properties */
-  T = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,60},{-100,-60},{90,0},{-100,60}},
-          lineColor={0,0,255},
-          fillColor={0,127,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-60,24},{-20,-16}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "%alpha")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,60},{-100,-60},{90,0},{-100,60}},
-          lineColor={0,0,255},
-          fillColor={0,127,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-60,24},{-20,-16}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "%alpha")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end MassFlowMultiplier;
+within ThermoSysPro.Solar.Junctions;
+model MassFlowMultiplier "Mass flow multipliier"
+  parameter Real alpha=2 "Flow multiplier";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+
+public
+  WaterSteam.Connectors.FluidInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  WaterSteam.Connectors.FluidOutlet Cs                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  /* Fluid pressure */
+  P = Ce.P;
+  P = Cs.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ce.h_vol = h;
+  Cs.h_vol = h;
+
+  /* Mass balance equation */
+  0 = alpha*Ce.Q - Cs.Q;
+
+  /* Energy balance equation */
+  0 = alpha*Ce.Q*Ce.h - Cs.Q*Cs.h;
+
+  /* Fluid thermodynamic properties */
+  T = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,60},{-100,-60},{90,0},{-100,60}},
+          lineColor={0,0,255},
+          fillColor={0,127,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-60,24},{-20,-16}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "%alpha")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,60},{-100,-60},{90,0},{-100,60}},
+          lineColor={0,0,255},
+          fillColor={0,127,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-60,24},{-20,-16}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "%alpha")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end MassFlowMultiplier;
diff --git a/ThermoSysPro/Solar/Junctions/package.mo b/ThermoSysPro/Solar/Junctions/package.mo
index 37b14c703ea88219ce0e16135c51c4fe2c51c92d..6a8e358c97e0e6a00d58a002bd53ff7ec02e1c06 100644
--- a/ThermoSysPro/Solar/Junctions/package.mo
+++ b/ThermoSysPro/Solar/Junctions/package.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.Solar;
-package Junctions "Junctions"
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Junctions;
+within ThermoSysPro.Solar;
+package Junctions "Junctions"
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Junctions;
diff --git a/ThermoSysPro/Solar/Junctions/package.order b/ThermoSysPro/Solar/Junctions/package.order
index 7a83801cc5de77bbc093e29fca95fb0b3f07f900..17b4a8a02d2689c2409b6547b5e7b3874da5fea4 100644
--- a/ThermoSysPro/Solar/Junctions/package.order
+++ b/ThermoSysPro/Solar/Junctions/package.order
@@ -1 +1 @@
-MassFlowMultiplier
+MassFlowMultiplier
diff --git a/ThermoSysPro/Solar/package.mo b/ThermoSysPro/Solar/package.mo
index c18abeefd1a13d2e17f07ded10cd0cf761c74744..39c9fb93e8a8dbaf19b23ca5e3fc4aea8561c248 100644
--- a/ThermoSysPro/Solar/package.mo
+++ b/ThermoSysPro/Solar/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro;
-package Solar "Solar components library"
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Solar;
+within ThermoSysPro;
+package Solar "Solar components library"
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Solar;
diff --git a/ThermoSysPro/Solar/package.order b/ThermoSysPro/Solar/package.order
index 1431dbdfc542e9ff0de35a0919f237ac593bb8c4..b8ae24d03a3c6662824ab92c95b2b8a14c161ccd 100644
--- a/ThermoSysPro/Solar/package.order
+++ b/ThermoSysPro/Solar/package.order
@@ -1,3 +1,3 @@
-Collectors
-HeatExchangers
-Junctions
+Collectors
+HeatExchangers
+Junctions
diff --git a/ThermoSysPro/Thermal/BoundaryConditions/HeatSink.mo b/ThermoSysPro/Thermal/BoundaryConditions/HeatSink.mo
index 65252daed4e00eed8a4a29bf10efc1702a0c193a..e1af03add7d53700690c97672a2363006009d0be 100644
--- a/ThermoSysPro/Thermal/BoundaryConditions/HeatSink.mo
+++ b/ThermoSysPro/Thermal/BoundaryConditions/HeatSink.mo
@@ -1,64 +1,64 @@
-within ThermoSysPro.Thermal.BoundaryConditions;
-model HeatSink "Heat sink"
-
-  parameter Integer N=1;
-
-public
-  Units.SI.Temperature T[N] "Sink temperature";
-  Units.SI.Power W[N] "Heat power received by the sink";
-
-public
-  input ThermoSysPro.Thermal.Connectors.ThermalPort C[N]
-                                                       annotation (Placement(
-        transformation(extent={{-10,-108},{10,-88}}, rotation=0)));
-equation
-
-  T = C.T;
-  W = C.W;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,127,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-40,40},{40,-38}},
-          lineColor={0,0,255},
-          textString =                       "C"),
-        Line(points={{0,-40},{0,-88}}),
-        Line(points={{-12,-60},{0,-40}}),
-        Line(points={{12,-60},{0,-40}})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,127,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-40},{0,-88}}),
-        Line(points={{-12,-60},{0,-40}}),
-        Text(
-          extent={{-40,40},{40,-38}},
-          lineColor={0,0,255},
-          textString =                       "C"),
-        Line(points={{12,-60},{0,-40}})}),
-    Window(
-      x=0.33,
-      y=0.21,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 3.0</b></p>
-</HTML>
-"));
-end HeatSink;
+within ThermoSysPro.Thermal.BoundaryConditions;
+model HeatSink "Heat sink"
+
+  parameter Integer N=1;
+
+public
+  Units.SI.Temperature T[N] "Sink temperature";
+  Units.SI.Power W[N] "Heat power received by the sink";
+
+public
+  input ThermoSysPro.Thermal.Connectors.ThermalPort C[N]
+                                                       annotation (Placement(
+        transformation(extent={{-10,-108},{10,-88}}, rotation=0)));
+equation
+
+  T = C.T;
+  W = C.W;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,127,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-40,40},{40,-38}},
+          lineColor={0,0,255},
+          textString =                       "C"),
+        Line(points={{0,-40},{0,-88}}),
+        Line(points={{-12,-60},{0,-40}}),
+        Line(points={{12,-60},{0,-40}})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,127,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-40},{0,-88}}),
+        Line(points={{-12,-60},{0,-40}}),
+        Text(
+          extent={{-40,40},{40,-38}},
+          lineColor={0,0,255},
+          textString =                       "C"),
+        Line(points={{12,-60},{0,-40}})}),
+    Window(
+      x=0.33,
+      y=0.21,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 3.0</b></p>
+</HTML>
+"));
+end HeatSink;
diff --git a/ThermoSysPro/Thermal/BoundaryConditions/HeatSource.mo b/ThermoSysPro/Thermal/BoundaryConditions/HeatSource.mo
index 680c7ec2edd7d21920042074dc535f8bd0e36e9f..2f83b6d1b555f84096ae51d57f214095d0a1c6d2 100644
--- a/ThermoSysPro/Thermal/BoundaryConditions/HeatSource.mo
+++ b/ThermoSysPro/Thermal/BoundaryConditions/HeatSource.mo
@@ -1,84 +1,84 @@
-within ThermoSysPro.Thermal.BoundaryConditions;
-model HeatSource "Heat source"
-  parameter Units.SI.Temperature T0[:]={300}
-    "Source temperature (active if option_temperature=1)";
-  parameter Units.SI.Power W0[:]={2e6}
-    "Heat power emitted by the source (active if option_temperature=2)";
-  parameter Integer option_temperature=1
-    "1:temperature fixed - 2:heat power fixed";
-
-protected
-  parameter Integer N=size(T0,1);
-
-public
-  ThermoSysPro.Thermal.Connectors.ThermalPort C[N]     annotation (Placement(
-        transformation(extent={{-10,-108},{10,-88}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal ISignal
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-equation
-
-  if (cardinality(ISignal) == 0) then
-    if (option_temperature == 1) then
-      C.T = T0;
-    elseif (option_temperature == 2) then
-      C.W = -W0;
-    else
-      assert(false, "HeatSource : incorrect option");
-    end if;
-
-    ISignal.signal = 0;
-  else
-    if (option_temperature == 1) then
-      C.T = fill(ISignal.signal, N);
-    elseif (option_temperature == 2) then
-      C.W = fill(-ISignal.signal, N);
-    else
-      assert(false, "HeatSource : incorrect option");
-    end if;
-  end if;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,127,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-40,40},{40,-38}}, textString=
-                                             "C"),
-        Line(points={{0,-40},{0,-88}}),
-        Line(points={{0,-88},{12,-68}}),
-        Line(points={{0,-88},{-14,-68}})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,127,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-40},{0,-88}}),
-        Line(points={{0,-88},{-14,-68}}),
-        Line(points={{0,-88},{12,-68}}),
-        Text(extent={{-40,40},{40,-38}}, textString=
-                                             "C")}),
-    Window(
-      x=0.33,
-      y=0.21,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end HeatSource;
+within ThermoSysPro.Thermal.BoundaryConditions;
+model HeatSource "Heat source"
+  parameter Units.SI.Temperature T0[:]={300}
+    "Source temperature (active if option_temperature=1)";
+  parameter Units.SI.Power W0[:]={2e6}
+    "Heat power emitted by the source (active if option_temperature=2)";
+  parameter Integer option_temperature=1
+    "1:temperature fixed - 2:heat power fixed";
+
+protected
+  parameter Integer N=size(T0,1);
+
+public
+  ThermoSysPro.Thermal.Connectors.ThermalPort C[N]     annotation (Placement(
+        transformation(extent={{-10,-108},{10,-88}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal ISignal
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+equation
+
+  if (cardinality(ISignal) == 0) then
+    if (option_temperature == 1) then
+      C.T = T0;
+    elseif (option_temperature == 2) then
+      C.W = -W0;
+    else
+      assert(false, "HeatSource : incorrect option");
+    end if;
+
+    ISignal.signal = 0;
+  else
+    if (option_temperature == 1) then
+      C.T = fill(ISignal.signal, N);
+    elseif (option_temperature == 2) then
+      C.W = fill(-ISignal.signal, N);
+    else
+      assert(false, "HeatSource : incorrect option");
+    end if;
+  end if;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,127,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-40,40},{40,-38}}, textString=
+                                             "C"),
+        Line(points={{0,-40},{0,-88}}),
+        Line(points={{0,-88},{12,-68}}),
+        Line(points={{0,-88},{-14,-68}})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,127,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-40},{0,-88}}),
+        Line(points={{0,-88},{-14,-68}}),
+        Line(points={{0,-88},{12,-68}}),
+        Text(extent={{-40,40},{40,-38}}, textString=
+                                             "C")}),
+    Window(
+      x=0.33,
+      y=0.21,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end HeatSource;
diff --git a/ThermoSysPro/Thermal/BoundaryConditions/package.mo b/ThermoSysPro/Thermal/BoundaryConditions/package.mo
index 1e17c941d34265cdb690473f0e92491b097a9255..f6598059b8805c92065e9002b458a396c55ee563 100644
--- a/ThermoSysPro/Thermal/BoundaryConditions/package.mo
+++ b/ThermoSysPro/Thermal/BoundaryConditions/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Thermal;
-package BoundaryConditions "Boundary conditions"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end BoundaryConditions;
+within ThermoSysPro.Thermal;
+package BoundaryConditions "Boundary conditions"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end BoundaryConditions;
diff --git a/ThermoSysPro/Thermal/BoundaryConditions/package.order b/ThermoSysPro/Thermal/BoundaryConditions/package.order
index cc1cc731beedbdb64936df1b048a1c329b62d2e4..2c53e9137bdcb607a5472b9a777e5889f8d03719 100644
--- a/ThermoSysPro/Thermal/BoundaryConditions/package.order
+++ b/ThermoSysPro/Thermal/BoundaryConditions/package.order
@@ -1,2 +1,2 @@
-HeatSink
-HeatSource
+HeatSink
+HeatSource
diff --git a/ThermoSysPro/Thermal/Connectors.mo b/ThermoSysPro/Thermal/Connectors.mo
index 097ace177e8f320ddc39dd23719eccb775409bbe..abf5407f32b09eb030195649f9536a26d8428513 100644
--- a/ThermoSysPro/Thermal/Connectors.mo
+++ b/ThermoSysPro/Thermal/Connectors.mo
@@ -1,152 +1,152 @@
-within ThermoSysPro.Thermal;
-package Connectors "Connectors"
-  connector ThermalPort "Thermal connector"
-    Units.SI.Temperature T "Temperature";
-    flow Units.SI.HeatFlowRate W
-      "Thermal flow rate. Positive when going into the component";
-    annotation (
-      Diagram(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics),
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,100},{100,-100}},
-            lineColor={0,0,0},
-            fillPattern=FillPattern.Sphere,
-            fillColor={255,127,0})}),
-      Window(
-        x=0.12,
-        y=0.27,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-  end ThermalPort;
-  annotation (Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end Connectors;
+within ThermoSysPro.Thermal;
+package Connectors "Connectors"
+  connector ThermalPort "Thermal connector"
+    Units.SI.Temperature T "Temperature";
+    flow Units.SI.HeatFlowRate W
+      "Thermal flow rate. Positive when going into the component";
+    annotation (
+      Diagram(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics),
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,100},{100,-100}},
+            lineColor={0,0,0},
+            fillPattern=FillPattern.Sphere,
+            fillColor={255,127,0})}),
+      Window(
+        x=0.12,
+        y=0.27,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+  end ThermalPort;
+  annotation (Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end Connectors;
diff --git a/ThermoSysPro/Thermal/HeatTransfer/ConvectiveHeatFlow.mo b/ThermoSysPro/Thermal/HeatTransfer/ConvectiveHeatFlow.mo
index 2220f2756956e9d55a0cbba8f14a44d2b795f34a..e1ece6bf5f26c75d95d3b43154193128f7ed78d1 100644
--- a/ThermoSysPro/Thermal/HeatTransfer/ConvectiveHeatFlow.mo
+++ b/ThermoSysPro/Thermal/HeatTransfer/ConvectiveHeatFlow.mo
@@ -1,70 +1,70 @@
-within ThermoSysPro.Thermal.HeatTransfer;
-model ConvectiveHeatFlow "Convective heat flow"
-  parameter Units.SI.Area A[:]={1} "Heat exchange surface";
-  parameter Units.SI.CoefficientOfHeatTransfer k[:]={1000}
-    "Heat exchange coefficient";
-
-protected
-  parameter Integer N=size(A, 1);
-public
-  ThermoSysPro.Thermal.Connectors.ThermalPort C1       annotation (Placement(
-        transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort C2       annotation (Placement(
-        transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-equation
-
-  C1.W = k*A*(C1.T - C2.T);
-  C1.W = -C2.W;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-15,65},{15,65},{0,90},{-15,65}},
-          lineColor={255,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{0,70},{0,40},{-20,30},{20,10},{-20,-10},{20,-30},{0,-40},{0,
-              -70}},
-          color={255,0,0},
-          thickness=0.5),
-        Polygon(
-          points={{-15,-65},{15,-65},{0,-90},{-15,-65}},
-          lineColor={255,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-15,65},{15,65},{0,90},{-15,65}},
-          lineColor={255,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{0,70},{0,40},{-20,30},{20,10},{-20,-10},{20,-30},{0,-40},{0,
-              -70}},
-          color={255,0,0},
-          thickness=0.5),
-        Polygon(
-          points={{-15,-65},{15,-65},{0,-90},{-15,-65}},
-          lineColor={255,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.24,
-      y=0.27,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end ConvectiveHeatFlow;
+within ThermoSysPro.Thermal.HeatTransfer;
+model ConvectiveHeatFlow "Convective heat flow"
+  parameter Units.SI.Area A[:]={1} "Heat exchange surface";
+  parameter Units.SI.CoefficientOfHeatTransfer k[:]={1000}
+    "Heat exchange coefficient";
+
+protected
+  parameter Integer N=size(A, 1);
+public
+  ThermoSysPro.Thermal.Connectors.ThermalPort C1       annotation (Placement(
+        transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort C2       annotation (Placement(
+        transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+equation
+
+  C1.W = k*A*(C1.T - C2.T);
+  C1.W = -C2.W;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-15,65},{15,65},{0,90},{-15,65}},
+          lineColor={255,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{0,70},{0,40},{-20,30},{20,10},{-20,-10},{20,-30},{0,-40},{0,
+              -70}},
+          color={255,0,0},
+          thickness=0.5),
+        Polygon(
+          points={{-15,-65},{15,-65},{0,-90},{-15,-65}},
+          lineColor={255,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-15,65},{15,65},{0,90},{-15,65}},
+          lineColor={255,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{0,70},{0,40},{-20,30},{20,10},{-20,-10},{20,-30},{0,-40},{0,
+              -70}},
+          color={255,0,0},
+          thickness=0.5),
+        Polygon(
+          points={{-15,-65},{15,-65},{0,-90},{-15,-65}},
+          lineColor={255,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.24,
+      y=0.27,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end ConvectiveHeatFlow;
diff --git a/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWall.mo b/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWall.mo
index dc600e18b29ff8a9c1da6fa976fb776fb6b63219..3007dfc7e97c116023b3db11adf15e7729219600 100644
--- a/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWall.mo
+++ b/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWall.mo
@@ -1,165 +1,165 @@
-within ThermoSysPro.Thermal.HeatTransfer;
-model HeatExchangerWall "Heat exchanger wall"
-  parameter Real ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Length L=1 "Tube length";
-  parameter Units.SI.Diameter D=0.2 "Internal tube diameter";
-  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
-  parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity";
-  parameter Integer Ns=1 "Number of sections inside the wall";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Units.SI.SpecificHeatCapacity cpw=1000
-    "Wall specific heat capacity (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.Density rhow=7800
-    "Wall density (active if dynamic_energy_balance=true)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
-  parameter Units.SI.Temperature T0=350
-    "Initial temperature (active if dynamic_energy_balance=true and steady_state=false)"
-    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
-          steady_state));
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.Length dx=L/Ns "Section length";
-  parameter Units.SI.Mass dM=ntubes*rhow*pi*((D + 2*e)^2 - D^2)/4*dx
-    "Wall section mass";
-
-public
-  Units.SI.Power dW1[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
-    "Power in section i of side 1";
-  Units.SI.Power dW2[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
-    "Power in section i of side 2";
-  Units.SI.Temperature Tp1[Ns](start=fill(300, Ns))
-    "Wall temperature in section i of side 1";
-  Units.SI.Temperature Tp2[Ns](start=fill(300, Ns))
-    "Wall temperature in section i of side 2";
-  Units.SI.Temperature Tp[Ns](start=fill(300, Ns))
-    "Average wall temperature in section i";
-
-  ThermoSysPro.Thermal.Connectors.ThermalPort WT2[Ns] "Side 2"
-    annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort WT1[Ns] "Side 1"
-    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
-            0)));
-initial equation
-  if dynamic_energy_balance then
-    if steady_state then
-      for i in 1:Ns loop
-        der(Tp[i]) = 0;
-      end for;
-    else
-      for i in 1:Ns loop
-        Tp[i] = T0;
-      end for;
-    end if;
-  end if;
-
-equation
-
-  WT1.T = Tp1;
-  WT1.W = dW1;
-
-  WT2.T = Tp2;
-  WT2.W = dW2;
-
-  for i in 1:Ns loop
-    /* Heat transfer on side 1 (internal) */
-    dW1[i] = 2*pi*dx*ntubes*lambda*(Tp1[i] - Tp[i])/(Modelica.Math.log(1 + e/D));
-
-    /* Heat transfer on side 2 (external) */
-    dW2[i] = 2*pi*dx*ntubes*lambda*(Tp2[i] - Tp[i])/(Modelica.Math.log(1 + e/(e + D)));
-
-    /* Thermal inertia */
-    if dynamic_energy_balance then
-      dM*cpw*der(Tp[i]) = dW2[i] + dW1[i];
-    else
-      0 = dW2[i] + dW1[i];
-    end if;
-
-  end for;
-
-  annotation (
-    Icon(graphics={
-        Rectangle(
-          extent={{-100,10},{100,-10}},
-          lineColor={0,0,0},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-80,40},{-20,20}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "2"),
-        Text(
-          extent={{-80,-20},{-20,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "1"),
-        Text(
-          extent={{20,40},{98,20}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "External"),
-        Text(
-          extent={{20,-20},{98,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Internal")}),
-    Diagram(graphics={
-        Rectangle(
-          extent={{-100,10},{100,-10}},
-          lineColor={0,0,0},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-80,30},{-20,10}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Side 2"),
-        Text(
-          extent={{-80,-10},{-20,-30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Side 1"),
-        Text(
-          extent={{20,-10},{98,-30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Internal"),
-        Text(
-          extent={{20,30},{98,10}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "External")}),
-    DymolaStoredErrors,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
-<p><b>ThermoSysPro Version 4.0</b> </p>
-<p>This component model is documented in Sect. 9.4.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Guillaume Larrignon </li>
-</ul>
-</html>"));
-end HeatExchangerWall;
+within ThermoSysPro.Thermal.HeatTransfer;
+model HeatExchangerWall "Heat exchanger wall"
+  parameter Real ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Length L=1 "Tube length";
+  parameter Units.SI.Diameter D=0.2 "Internal tube diameter";
+  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
+  parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity";
+  parameter Integer Ns=1 "Number of sections inside the wall";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Units.SI.SpecificHeatCapacity cpw=1000
+    "Wall specific heat capacity (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.Density rhow=7800
+    "Wall density (active if dynamic_energy_balance=true)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance));
+  parameter Units.SI.Temperature T0=350
+    "Initial temperature (active if dynamic_energy_balance=true and steady_state=false)"
+    annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+          steady_state));
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.Length dx=L/Ns "Section length";
+  parameter Units.SI.Mass dM=ntubes*rhow*pi*((D + 2*e)^2 - D^2)/4*dx
+    "Wall section mass";
+
+public
+  Units.SI.Power dW1[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
+    "Power in section i of side 1";
+  Units.SI.Power dW2[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
+    "Power in section i of side 2";
+  Units.SI.Temperature Tp1[Ns](start=fill(300, Ns))
+    "Wall temperature in section i of side 1";
+  Units.SI.Temperature Tp2[Ns](start=fill(300, Ns))
+    "Wall temperature in section i of side 2";
+  Units.SI.Temperature Tp[Ns](start=fill(300, Ns))
+    "Average wall temperature in section i";
+
+  ThermoSysPro.Thermal.Connectors.ThermalPort WT2[Ns] "Side 2"
+    annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort WT1[Ns] "Side 1"
+    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
+            0)));
+initial equation
+  if dynamic_energy_balance then
+    if steady_state then
+      for i in 1:Ns loop
+        der(Tp[i]) = 0;
+      end for;
+    else
+      for i in 1:Ns loop
+        Tp[i] = T0;
+      end for;
+    end if;
+  end if;
+
+equation
+
+  WT1.T = Tp1;
+  WT1.W = dW1;
+
+  WT2.T = Tp2;
+  WT2.W = dW2;
+
+  for i in 1:Ns loop
+    /* Heat transfer on side 1 (internal) */
+    dW1[i] = 2*pi*dx*ntubes*lambda*(Tp1[i] - Tp[i])/(Modelica.Math.log(1 + e/D));
+
+    /* Heat transfer on side 2 (external) */
+    dW2[i] = 2*pi*dx*ntubes*lambda*(Tp2[i] - Tp[i])/(Modelica.Math.log(1 + e/(e + D)));
+
+    /* Thermal inertia */
+    if dynamic_energy_balance then
+      dM*cpw*der(Tp[i]) = dW2[i] + dW1[i];
+    else
+      0 = dW2[i] + dW1[i];
+    end if;
+
+  end for;
+
+  annotation (
+    Icon(graphics={
+        Rectangle(
+          extent={{-100,10},{100,-10}},
+          lineColor={0,0,0},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-80,40},{-20,20}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "2"),
+        Text(
+          extent={{-80,-20},{-20,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "1"),
+        Text(
+          extent={{20,40},{98,20}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "External"),
+        Text(
+          extent={{20,-20},{98,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Internal")}),
+    Diagram(graphics={
+        Rectangle(
+          extent={{-100,10},{100,-10}},
+          lineColor={0,0,0},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-80,30},{-20,10}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Side 2"),
+        Text(
+          extent={{-80,-10},{-20,-30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Side 1"),
+        Text(
+          extent={{20,-10},{98,-30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Internal"),
+        Text(
+          extent={{20,30},{98,10}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "External")}),
+    DymolaStoredErrors,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</b> </p>
+<p><b>ThermoSysPro Version 4.0</b> </p>
+<p>This component model is documented in Sect. 9.4.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Guillaume Larrignon </li>
+</ul>
+</html>"));
+end HeatExchangerWall;
diff --git a/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWallCounterFlow.mo b/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWallCounterFlow.mo
index 09b43d8b8230f36fc045b4a94176bda08e820403..33bd4311cb5290f79e15f45715821599e954eeab 100644
--- a/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWallCounterFlow.mo
+++ b/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWallCounterFlow.mo
@@ -1,180 +1,180 @@
-within ThermoSysPro.Thermal.HeatTransfer;
-model HeatExchangerWallCounterFlow "Heat exchanger wall counter flow "
-  parameter Units.SI.Length L=1 "Tube length";
-  parameter Units.SI.Diameter D=0.2 "Internal tube diameter";
-  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
-  parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity";
-  parameter Integer Ns=1 "Number of sections inside the wall";
-  parameter Units.SI.SpecificHeatCapacity cpw=1000
-    "Wall specific heat capacity";
-  parameter Units.SI.Density rhow=7800 "Wall density";
-  parameter Units.SI.Temperature T0=350
-    "Initial temperature (active if steady_state=false)";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0";
-  parameter Real ntubes=1 "Number of pipes in parallel";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.Length dx=L/Ns "Section length";
-  parameter Units.SI.Mass dM=ntubes*rhow*pi*((D + 2*e)^2 - D^2)/4*dx
-    "Wall section mass";
-
-public
-  Units.SI.Power dW1[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
-    "Power in section i of side 1";
-  Units.SI.Power dW2[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
-    "Power in section i of side 2";
-  Units.SI.Temperature Tp1[Ns](start=fill(300, Ns))
-    "Wall temperature in section i of side 1";
-  Units.SI.Temperature Tp2[Ns](start=fill(300, Ns))
-    "Wall temperature in section i of side 2";
-  Units.SI.Temperature Tp[Ns](start=fill(300, Ns))
-    "Average wall temperature in section i";
-
-  ThermoSysPro.Thermal.Connectors.ThermalPort WT2[Ns] "Side 2"
-    annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort WT1[Ns] "Side 1"
-    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
-            0)));
-initial equation
-  if steady_state then
-    for i in 1:Ns loop
-      der(Tp[i]) = 0;
-    end for;
-
-  else
-    for i in 1:Ns loop
-      Tp[i] = T0;
-    end for;
-  end if;
-
-equation
-
-  WT1.T = Tp1;
-  WT1.W = dW1;
-
-  WT2.T = Tp2;
-  WT2.W = dW2;
-
-  for i in 1:Ns loop
-    /* Heat transfer on side 1 (internal) */
-    dW1[i] = 2*pi*dx*ntubes*lambda*(Tp1[i] - Tp[i])/(Modelica.Math.log(1 + e/D));
-
-    /* Heat transfer on side 2 (external) */
-    dW2[Ns-i+1] = 2*pi*dx*ntubes*lambda*(Tp2[Ns-i+1] - Tp[i])/(Modelica.Math.log(1 + e/(e + D)));
-
-    /* Thermal inertia */
-    dM*cpw*der(Tp[i]) = dW2[Ns-i+1] + dW1[i];
-  end for;
-
-  annotation (
-    Icon(graphics={
-        Rectangle(
-          extent={{-100,10},{100,-10}},
-          lineColor={0,0,0},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-80,40},{-20,20}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "2"),
-        Text(
-          extent={{-80,-20},{-20,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "1"),
-        Text(
-          extent={{20,40},{98,20}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "External"),
-        Text(
-          extent={{20,-20},{98,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Internal"),
-        Line(
-          points={{62,45},{100,45}},
-          color={255,0,0},
-          thickness=0.5),
-        Line(
-          points={{-100,-45},{-62,-45}},
-          color={0,0,255},
-          thickness=0.5),
-        Polygon(
-          points={{-80,-35},{-60,-45},{-80,-55},{-80,-35}},
-          lineColor={0,0,255},
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{80,55},{60,45},{80,35},{80,55}},
-          lineColor={0,0,255},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Diagram(graphics={
-        Rectangle(
-          extent={{-100,10},{100,-10}},
-          lineColor={0,0,0},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-80,30},{-20,10}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Side 2"),
-        Text(
-          extent={{-80,-10},{-20,-30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Side 1"),
-        Text(
-          extent={{20,-10},{98,-30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Internal"),
-        Text(
-          extent={{20,30},{98,10}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "External"),
-        Line(
-          points={{-98,-26},{-80,-26}},
-          color={0,0,255},
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{96,30},{78,30}},
-          color={255,0,0},
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.Filled})}),
-    DymolaStoredErrors,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2014</h4></p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Guillaume Larrignon </li>
-</ul>
-</html>"));
-end HeatExchangerWallCounterFlow;
+within ThermoSysPro.Thermal.HeatTransfer;
+model HeatExchangerWallCounterFlow "Heat exchanger wall counter flow "
+  parameter Units.SI.Length L=1 "Tube length";
+  parameter Units.SI.Diameter D=0.2 "Internal tube diameter";
+  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
+  parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity";
+  parameter Integer Ns=1 "Number of sections inside the wall";
+  parameter Units.SI.SpecificHeatCapacity cpw=1000
+    "Wall specific heat capacity";
+  parameter Units.SI.Density rhow=7800 "Wall density";
+  parameter Units.SI.Temperature T0=350
+    "Initial temperature (active if steady_state=false)";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0";
+  parameter Real ntubes=1 "Number of pipes in parallel";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.Length dx=L/Ns "Section length";
+  parameter Units.SI.Mass dM=ntubes*rhow*pi*((D + 2*e)^2 - D^2)/4*dx
+    "Wall section mass";
+
+public
+  Units.SI.Power dW1[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
+    "Power in section i of side 1";
+  Units.SI.Power dW2[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
+    "Power in section i of side 2";
+  Units.SI.Temperature Tp1[Ns](start=fill(300, Ns))
+    "Wall temperature in section i of side 1";
+  Units.SI.Temperature Tp2[Ns](start=fill(300, Ns))
+    "Wall temperature in section i of side 2";
+  Units.SI.Temperature Tp[Ns](start=fill(300, Ns))
+    "Average wall temperature in section i";
+
+  ThermoSysPro.Thermal.Connectors.ThermalPort WT2[Ns] "Side 2"
+    annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort WT1[Ns] "Side 1"
+    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
+            0)));
+initial equation
+  if steady_state then
+    for i in 1:Ns loop
+      der(Tp[i]) = 0;
+    end for;
+
+  else
+    for i in 1:Ns loop
+      Tp[i] = T0;
+    end for;
+  end if;
+
+equation
+
+  WT1.T = Tp1;
+  WT1.W = dW1;
+
+  WT2.T = Tp2;
+  WT2.W = dW2;
+
+  for i in 1:Ns loop
+    /* Heat transfer on side 1 (internal) */
+    dW1[i] = 2*pi*dx*ntubes*lambda*(Tp1[i] - Tp[i])/(Modelica.Math.log(1 + e/D));
+
+    /* Heat transfer on side 2 (external) */
+    dW2[Ns-i+1] = 2*pi*dx*ntubes*lambda*(Tp2[Ns-i+1] - Tp[i])/(Modelica.Math.log(1 + e/(e + D)));
+
+    /* Thermal inertia */
+    dM*cpw*der(Tp[i]) = dW2[Ns-i+1] + dW1[i];
+  end for;
+
+  annotation (
+    Icon(graphics={
+        Rectangle(
+          extent={{-100,10},{100,-10}},
+          lineColor={0,0,0},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-80,40},{-20,20}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "2"),
+        Text(
+          extent={{-80,-20},{-20,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "1"),
+        Text(
+          extent={{20,40},{98,20}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "External"),
+        Text(
+          extent={{20,-20},{98,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Internal"),
+        Line(
+          points={{62,45},{100,45}},
+          color={255,0,0},
+          thickness=0.5),
+        Line(
+          points={{-100,-45},{-62,-45}},
+          color={0,0,255},
+          thickness=0.5),
+        Polygon(
+          points={{-80,-35},{-60,-45},{-80,-55},{-80,-35}},
+          lineColor={0,0,255},
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{80,55},{60,45},{80,35},{80,55}},
+          lineColor={0,0,255},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Diagram(graphics={
+        Rectangle(
+          extent={{-100,10},{100,-10}},
+          lineColor={0,0,0},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-80,30},{-20,10}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Side 2"),
+        Text(
+          extent={{-80,-10},{-20,-30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Side 1"),
+        Text(
+          extent={{20,-10},{98,-30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Internal"),
+        Text(
+          extent={{20,30},{98,10}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "External"),
+        Line(
+          points={{-98,-26},{-80,-26}},
+          color={0,0,255},
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{96,30},{78,30}},
+          color={255,0,0},
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.Filled})}),
+    DymolaStoredErrors,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2014</h4></p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Guillaume Larrignon </li>
+</ul>
+</html>"));
+end HeatExchangerWallCounterFlow;
diff --git a/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWallWithLosses.mo b/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWallWithLosses.mo
index 7f5398e7816a27f8600989820347b49f53a122c6..108387905f57a4df7847a54d5a266c8e2afdc075 100644
--- a/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWallWithLosses.mo
+++ b/ThermoSysPro/Thermal/HeatTransfer/HeatExchangerWallWithLosses.mo
@@ -1,301 +1,301 @@
-within ThermoSysPro.Thermal.HeatTransfer;
-model HeatExchangerWallWithLosses "Heat exchanger wall"
-  parameter Units.SI.Length L=10 "Tube length";
-  parameter Units.SI.Diameter D=0.03 "Internal tube diameter";
-  parameter Units.SI.Diameter D_rec=24 "receiver diameter";
-  parameter Units.SI.Diameter L_rec=10 "receiver height (characteristic length";
-  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
-  parameter Real Sc=0.5
-    "Decrease factor of the external heat exchange surface for Solar Receiver or Boiler ";
-
-  parameter Units.SI.ThermalConductivity lambda=21
-    "Thermal conductivity of the pipes";
-  parameter Real Eps=0.6 "Tube emissivity";
-  parameter Units.SI.Thickness e_ins=0.1 "Insulation thickness";
-  parameter Units.SI.ThermalConductivity lambda_ins=0.035
-    "Equivalent thermal conductivity of Insulation + pipes";
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-
-  parameter Real hcCorr1=1.00
-    "Corrective term for Forced convection losses coefficient for each node";
-  parameter Real hcCorr2=1.00
-    "Corrective term for Natural convection losses coefficient for each node";
-
-  parameter Integer Ns=1 "Number of sections inside the wall";
-  parameter Units.SI.SpecificHeatCapacity cpw=480 "Wall specific heat capacity";
-  parameter Units.SI.Density rhow=7800 "Wall density";
-  parameter Units.SI.Temperature T0=350
-    "Initial temperature (active if steady_state=false)";
-
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0";
-  parameter Real ntubes=1 "Number of pipes in parallel";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  constant Real sigma=5.67e-8 "Bolzmann constant";
-  parameter Units.SI.Length dx=L/Ns "Section length";
-  parameter Real ksD=(D+2*e)/(2*D_rec) "apparent roughness of the receiver";
-  parameter Units.SI.Mass dM=ntubes*rhow*pi*((D + 2*e)^2 - D^2)/4*dx
-    "Wall section mass";
-public
-  Units.SI.Power dW1[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
-    "Power in section i of side 1";
-  Units.SI.Power dW2[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
-    "Power in section i of side 2";
-  Units.SI.Power WRad[Ns](start=fill(0, Ns)) "Radiation of the wall layer";
-  Units.SI.Power WConv[Ns](start=fill(0, Ns)) "Convection of the wall layer";
-  Units.SI.Power Wrad_Total;
-  Units.SI.Power Wconv_Total;
-  Units.SI.Temperature Tatm(start=300) "Atmospheric temperature";
-  Units.SI.Temperature Tfilm(start=300) "mean fluid temperature";
-  Units.SI.ThermalConductivity lambda_air(start=0.03)
-    "Air thermal conductivity";
-  Units.SI.Density rho_air(start=1) "Air density";
-  Units.SI.Density mu_air(start=1e-6) "Air viscosity";
-  Units.SI.Temperature Tsky(start=300) "Sky temperature";
-  Units.SI.Temperature Tp1[Ns](start=fill(300, Ns))
-    "Wall temperature in section i of side 1";
-  Units.SI.Temperature Tp2[Ns](start=fill(300, Ns))
-    "Wall temperature in section i of side 2";
-  Units.SI.Temperature Tp[Ns](start=fill(300, Ns))
-    "Average wall temperature in section i";
-  Units.SI.Temperature Tpm(start=300) "Average wall temperature";
-  Units.SI.CoefficientOfHeatTransfer hc_n[Ns](start=fill(5, Ns))
-    "Natural Convection losses coefficient";
-  Units.SI.CoefficientOfHeatTransfer hc_f(start=11)
-    "Forced Convection losses coefficient";
-  Units.SI.CoefficientOfHeatTransfer hc_f1(start=11)
-    "Forced Convection losses coefficient";
-  Units.SI.CoefficientOfHeatTransfer hc_f2(start=11)
-    "Forced Convection losses coefficient";
-  Units.SI.CoefficientOfHeatTransfer hc_f3(start=11)
-    "Forced Convection losses coefficient";
-  Units.SI.CoefficientOfHeatTransfer hc[Ns](start=fill(5, Ns))
-    "Mixed Convection losses coefficient";
-  Units.SI.Velocity v_wind(start=2) "Wind Velocity";
-  Units.SI.ReynoldsNumber Re(start=6.e4) "Fluid Reynolds number ";
-  Units.SI.GrashofNumber Gr[Ns](start=fill(1.e9, Ns)) "Fluid Grashof number ";
- //Modelica.SIunits.Power WLosses[Ns](start=fill(10,Ns));
-
-  ThermoSysPro.Thermal.Connectors.ThermalPort WT2[Ns] "Side 2"
-    annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort WT1[Ns] "Side 1"
-    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
-            0)));
-  InstrumentationAndControl.Connectors.InputReal AtmTemp
-    "Atmospheric temperature (K)"
-    annotation (Placement(transformation(extent={{-120,30},{-100,50}}, rotation=
-           0)));
-  InstrumentationAndControl.Connectors.InputReal WindVelo "wind velocity"
-    annotation (Placement(transformation(extent={{-120,64},{-100,84}}, rotation=
-           0)));
-initial equation
-
-   if steady_state then
-    for i in 1:Ns loop
-      der(Tp[i]) = 0;
-    end for;
-
-  else
-    for i in 1:Ns loop
-      Tp[i] = T0;
-    end for;
-  end if;
-
-equation
-
-  WT1.T = Tp1;
-  WT1.W = dW1;
-
-  WT2.T = Tp2;
-  WT2.W = dW2;
-
-  /* Input connectors */
-  Tatm = AtmTemp.signal;
-  Tfilm=  (Tatm+565.+273.15)/2;
-
-/*
-  rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(1e5, Tatm, 0, 0, 0.22, 0);
-  mu_air = ThermoSysPro.Properties.FlueGases.FlueGases_mu(1e5, Tatm, 0, 0, 0.22, 0);
-  lambda_air = ThermoSysPro.Properties.FlueGases.FlueGases_k(1e5, Tatm, 0, 0, 0.22, 0);
-  rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(1e5, Tatm, 0, 0, 0.22, 0) + 0.01;
-  mu_air = ThermoSysPro.Properties.FlueGases.FlueGases_mu(1e5, Tatm, 0, 0, 0.22, 0) + 1e-8;
-  lambda_air = ThermoSysPro.Properties.FlueGases.FlueGases_k(1e5, Tatm, 0, 0, 0.22, 0) +0.001;
-*/
-
-  rho_air=  1.293*273/Tatm;
-  mu_air=  8.8848e-15*Tatm^3-3.2398e-11*Tatm^2+6.2657e-8*Tatm+2.3543e-6;
-  lambda_air=  Tatm^3*1.5207e-11-4.857e-8*Tatm^2+1.0184e-4*Tatm-3.9333e-4;
-
-  v_wind = WindVelo.signal;
-
-  /* Sky temperature */
-  Tsky = 0.0552*Tatm^(1.5);
-
-  /*Average wall temperature*/
-  Tpm = sum(Tp2)/Ns;
-
-  /* Convection Losses coefficient (using the Siebers & Kraabel correlation) */
-  hc_f1 = noEvent(if ( Re < 7e5) and ( Re > 1.e-6) then hcCorr1*lambda_air/D_rec*(0.3+(0.488*Re^0.5*(1+(Re/282000)^0.625)^0.8)) else
-     if ( Re < 2.2e7) and ( Re > 7e5) then hcCorr1*lambda_air/D_rec*2.57e-3*Re^0.98 else
-     if (Re >= 2.2e7) then hcCorr1*lambda_air/D_rec*0.0455*Re^0.81 else 1e-6);
-  hc_f2 = noEvent(if ( Re < 1.8e5) and ( Re > 1.e-6) then hcCorr1*lambda_air/D_rec*(0.3+(0.488*Re^0.5*(1+(Re/282000)^0.625)^0.8)) else
-     if ( Re < 4e6) and ( Re > 1.8e5) then hcCorr1*lambda_air/D_rec*13.5e-3*Re^0.89 else
-     if (Re >= 4e6) then hcCorr1*lambda_air/D_rec*0.0455*Re^0.81 else 1e-6);
-  hc_f3 = noEvent(if ( Re < 1e5) and ( Re > 1.e-6) then hcCorr1*lambda_air/D_rec*(0.3+(0.488*Re^0.5*(1+(Re/282000)^0.625)^0.8)) else
-     if (Re >= 1e5) then hcCorr1*lambda_air/D_rec*0.0455*Re^0.81 else 1e-6);
-
-  hc_f = noEvent(if (ksD<150e-5) and
-                                  (ksD>1e-10) then hc_f1 else if (ksD<700e-5) and (ksD>=150e-5) then hc_f2 else  hc_f3);
-
-  Re = rho_air*v_wind*D_rec/mu_air;
-
-  for i in 1:Ns loop
-    /* natural Convection Losses coefficient */
-    hc_n[i] = noEvent(if (lambda_air*Gr[i]*Tp2[i]) > 0 then hcCorr2*lambda_air/L_rec*0.098*Gr[i]^(1/3)*(Tp2[i]/Tatm)^(-0.14) else 1);
-
-    /* Air volumetric expansion coefficient beta=1/Tatm */
-    Gr[i] = noEvent( if (Tpm > Tatm) then g*(1/Tatm)*(Tpm-Tatm)*L_rec^3*rho_air^2/mu_air^2 else 1e-6);
-
-    /* Mixed Convection Losses coefficient */
-    hc[i] = (hc_n[i]^3.2+hc_f^3.2)^(1/3.2);
-  end for;
-
-  for i in 1:Ns loop
-    /* Heat transfer on side 1 (internal) */
-    dW1[i] = pi*dx*ntubes*lambda*(Tp1[i] - Tp[i])/(Modelica.Math.log(1 + e/D));
-
-    /* Heat transfer on side 2 (external) */
-    dW2[i]- WRad[i] - WConv[i] = pi*dx*ntubes*lambda*(Tp2[i] - Tp[i])/(Modelica.Math.log(1 + e/(e + D)));
-
-    /* Thermal inertia */
-    dM*cpw*der(Tp[i]) = dW2[i] + dW1[i] - WRad[i] - WConv[i];
-
-    /* Heat losses on the 0.5 of the side 2 (convection, ratiation) */
-    /*--------------------------------------------------------------*/
-    /* Radiation losses: For Separation between cylinders = 0     => F12= 0.6366 */
-    WRad[i] = noEvent( if (Tp2[i] > Tsky) then ( 0.5*0.6366*Sc*pi*(D+2*e)*dx*ntubes*sigma*Eps*(Tp2[i]^(4) - Tsky^(4)) + 0.5*0.6366*Sc*pi*(D+2*e)*dx*ntubes*sigma*Eps*(Tp2[i]^(4) - Tatm^(4))) else  0);
-
-    /* Convection and conduction losses: For the conduction losses: the Receiver is considered as plain wall and */
-    /* For simplify: We take the Temperature of the Inside of the Insulation wall is equal to Tp1 and Outside Temperature to Tatm */
-    WConv[i] = noEvent( if (Tp2[i] > Tatm) then (Sc*pi*(D+2*e)*dx*ntubes*hc[i]*(Tp2[i] - Tatm)) + (Sc*pi*(D+2*e)*dx*ntubes*lambda_ins/e_ins)*(Tp1[i] - Tatm) else 0);
-
-    //WLosses [i] = WConv[i] + WRad[i];
-
-  end for;
-
-Wrad_Total=sum(WRad);
-Wconv_Total=sum(WConv);
-
-  annotation (
-    Icon(graphics={
-        Rectangle(
-          extent={{-100,10},{100,-10}},
-          lineColor={0,0,0},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.CrossDiag),
-        Text(
-          extent={{-80,40},{-20,20}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "2"),
-        Text(
-          extent={{-80,-20},{-20,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "1"),
-        Text(
-          extent={{20,40},{98,20}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "External"),
-        Text(
-          extent={{20,-20},{98,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Internal"),
-        Text(
-          extent={{-94,62},{-20,40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "With Losses"),
-        Text(
-          extent={{-122,32},{-100,16}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Tatm"),
-        Text(
-          extent={{-122,70},{-96,50}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "v_wind")}),
-    Diagram(graphics={
-        Rectangle(
-          extent={{-100,10},{100,-10}},
-          lineColor={0,0,0},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-80,30},{-20,10}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Side 2"),
-        Text(
-          extent={{-80,-10},{-20,-30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Side 1"),
-        Text(
-          extent={{20,-10},{98,-30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Internal"),
-        Text(
-          extent={{20,30},{98,10}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "External"),
-        Text(
-          extent={{-96,66},{-22,44}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "With Losses")}),
-    DymolaStoredErrors,
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Marie-Agnes Garnero</li>
-<li>Guillaume Larrignon</li>
-</ul>
-</html>"));
-end HeatExchangerWallWithLosses;
+within ThermoSysPro.Thermal.HeatTransfer;
+model HeatExchangerWallWithLosses "Heat exchanger wall"
+  parameter Units.SI.Length L=10 "Tube length";
+  parameter Units.SI.Diameter D=0.03 "Internal tube diameter";
+  parameter Units.SI.Diameter D_rec=24 "receiver diameter";
+  parameter Units.SI.Diameter L_rec=10 "receiver height (characteristic length";
+  parameter Units.SI.Thickness e=2.e-3 "Wall thickness";
+  parameter Real Sc=0.5
+    "Decrease factor of the external heat exchange surface for Solar Receiver or Boiler ";
+
+  parameter Units.SI.ThermalConductivity lambda=21
+    "Thermal conductivity of the pipes";
+  parameter Real Eps=0.6 "Tube emissivity";
+  parameter Units.SI.Thickness e_ins=0.1 "Insulation thickness";
+  parameter Units.SI.ThermalConductivity lambda_ins=0.035
+    "Equivalent thermal conductivity of Insulation + pipes";
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+
+  parameter Real hcCorr1=1.00
+    "Corrective term for Forced convection losses coefficient for each node";
+  parameter Real hcCorr2=1.00
+    "Corrective term for Natural convection losses coefficient for each node";
+
+  parameter Integer Ns=1 "Number of sections inside the wall";
+  parameter Units.SI.SpecificHeatCapacity cpw=480 "Wall specific heat capacity";
+  parameter Units.SI.Density rhow=7800 "Wall density";
+  parameter Units.SI.Temperature T0=350
+    "Initial temperature (active if steady_state=false)";
+
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0";
+  parameter Real ntubes=1 "Number of pipes in parallel";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  constant Real sigma=5.67e-8 "Bolzmann constant";
+  parameter Units.SI.Length dx=L/Ns "Section length";
+  parameter Real ksD=(D+2*e)/(2*D_rec) "apparent roughness of the receiver";
+  parameter Units.SI.Mass dM=ntubes*rhow*pi*((D + 2*e)^2 - D^2)/4*dx
+    "Wall section mass";
+public
+  Units.SI.Power dW1[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
+    "Power in section i of side 1";
+  Units.SI.Power dW2[Ns](start=fill(3.e5, Ns), nominal=fill(3.e5, Ns))
+    "Power in section i of side 2";
+  Units.SI.Power WRad[Ns](start=fill(0, Ns)) "Radiation of the wall layer";
+  Units.SI.Power WConv[Ns](start=fill(0, Ns)) "Convection of the wall layer";
+  Units.SI.Power Wrad_Total;
+  Units.SI.Power Wconv_Total;
+  Units.SI.Temperature Tatm(start=300) "Atmospheric temperature";
+  Units.SI.Temperature Tfilm(start=300) "mean fluid temperature";
+  Units.SI.ThermalConductivity lambda_air(start=0.03)
+    "Air thermal conductivity";
+  Units.SI.Density rho_air(start=1) "Air density";
+  Units.SI.Density mu_air(start=1e-6) "Air viscosity";
+  Units.SI.Temperature Tsky(start=300) "Sky temperature";
+  Units.SI.Temperature Tp1[Ns](start=fill(300, Ns))
+    "Wall temperature in section i of side 1";
+  Units.SI.Temperature Tp2[Ns](start=fill(300, Ns))
+    "Wall temperature in section i of side 2";
+  Units.SI.Temperature Tp[Ns](start=fill(300, Ns))
+    "Average wall temperature in section i";
+  Units.SI.Temperature Tpm(start=300) "Average wall temperature";
+  Units.SI.CoefficientOfHeatTransfer hc_n[Ns](start=fill(5, Ns))
+    "Natural Convection losses coefficient";
+  Units.SI.CoefficientOfHeatTransfer hc_f(start=11)
+    "Forced Convection losses coefficient";
+  Units.SI.CoefficientOfHeatTransfer hc_f1(start=11)
+    "Forced Convection losses coefficient";
+  Units.SI.CoefficientOfHeatTransfer hc_f2(start=11)
+    "Forced Convection losses coefficient";
+  Units.SI.CoefficientOfHeatTransfer hc_f3(start=11)
+    "Forced Convection losses coefficient";
+  Units.SI.CoefficientOfHeatTransfer hc[Ns](start=fill(5, Ns))
+    "Mixed Convection losses coefficient";
+  Units.SI.Velocity v_wind(start=2) "Wind Velocity";
+  Units.SI.ReynoldsNumber Re(start=6.e4) "Fluid Reynolds number ";
+  Units.SI.GrashofNumber Gr[Ns](start=fill(1.e9, Ns)) "Fluid Grashof number ";
+ //Modelica.SIunits.Power WLosses[Ns](start=fill(10,Ns));
+
+  ThermoSysPro.Thermal.Connectors.ThermalPort WT2[Ns] "Side 2"
+    annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort WT1[Ns] "Side 1"
+    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
+            0)));
+  InstrumentationAndControl.Connectors.InputReal AtmTemp
+    "Atmospheric temperature (K)"
+    annotation (Placement(transformation(extent={{-120,30},{-100,50}}, rotation=
+           0)));
+  InstrumentationAndControl.Connectors.InputReal WindVelo "wind velocity"
+    annotation (Placement(transformation(extent={{-120,64},{-100,84}}, rotation=
+           0)));
+initial equation
+
+   if steady_state then
+    for i in 1:Ns loop
+      der(Tp[i]) = 0;
+    end for;
+
+  else
+    for i in 1:Ns loop
+      Tp[i] = T0;
+    end for;
+  end if;
+
+equation
+
+  WT1.T = Tp1;
+  WT1.W = dW1;
+
+  WT2.T = Tp2;
+  WT2.W = dW2;
+
+  /* Input connectors */
+  Tatm = AtmTemp.signal;
+  Tfilm=  (Tatm+565.+273.15)/2;
+
+/*
+  rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(1e5, Tatm, 0, 0, 0.22, 0);
+  mu_air = ThermoSysPro.Properties.FlueGases.FlueGases_mu(1e5, Tatm, 0, 0, 0.22, 0);
+  lambda_air = ThermoSysPro.Properties.FlueGases.FlueGases_k(1e5, Tatm, 0, 0, 0.22, 0);
+  rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(1e5, Tatm, 0, 0, 0.22, 0) + 0.01;
+  mu_air = ThermoSysPro.Properties.FlueGases.FlueGases_mu(1e5, Tatm, 0, 0, 0.22, 0) + 1e-8;
+  lambda_air = ThermoSysPro.Properties.FlueGases.FlueGases_k(1e5, Tatm, 0, 0, 0.22, 0) +0.001;
+*/
+
+  rho_air=  1.293*273/Tatm;
+  mu_air=  8.8848e-15*Tatm^3-3.2398e-11*Tatm^2+6.2657e-8*Tatm+2.3543e-6;
+  lambda_air=  Tatm^3*1.5207e-11-4.857e-8*Tatm^2+1.0184e-4*Tatm-3.9333e-4;
+
+  v_wind = WindVelo.signal;
+
+  /* Sky temperature */
+  Tsky = 0.0552*Tatm^(1.5);
+
+  /*Average wall temperature*/
+  Tpm = sum(Tp2)/Ns;
+
+  /* Convection Losses coefficient (using the Siebers & Kraabel correlation) */
+  hc_f1 = noEvent(if ( Re < 7e5) and ( Re > 1.e-6) then hcCorr1*lambda_air/D_rec*(0.3+(0.488*Re^0.5*(1+(Re/282000)^0.625)^0.8)) else
+     if ( Re < 2.2e7) and ( Re > 7e5) then hcCorr1*lambda_air/D_rec*2.57e-3*Re^0.98 else
+     if (Re >= 2.2e7) then hcCorr1*lambda_air/D_rec*0.0455*Re^0.81 else 1e-6);
+  hc_f2 = noEvent(if ( Re < 1.8e5) and ( Re > 1.e-6) then hcCorr1*lambda_air/D_rec*(0.3+(0.488*Re^0.5*(1+(Re/282000)^0.625)^0.8)) else
+     if ( Re < 4e6) and ( Re > 1.8e5) then hcCorr1*lambda_air/D_rec*13.5e-3*Re^0.89 else
+     if (Re >= 4e6) then hcCorr1*lambda_air/D_rec*0.0455*Re^0.81 else 1e-6);
+  hc_f3 = noEvent(if ( Re < 1e5) and ( Re > 1.e-6) then hcCorr1*lambda_air/D_rec*(0.3+(0.488*Re^0.5*(1+(Re/282000)^0.625)^0.8)) else
+     if (Re >= 1e5) then hcCorr1*lambda_air/D_rec*0.0455*Re^0.81 else 1e-6);
+
+  hc_f = noEvent(if (ksD<150e-5) and
+                                  (ksD>1e-10) then hc_f1 else if (ksD<700e-5) and (ksD>=150e-5) then hc_f2 else  hc_f3);
+
+  Re = rho_air*v_wind*D_rec/mu_air;
+
+  for i in 1:Ns loop
+    /* natural Convection Losses coefficient */
+    hc_n[i] = noEvent(if (lambda_air*Gr[i]*Tp2[i]) > 0 then hcCorr2*lambda_air/L_rec*0.098*Gr[i]^(1/3)*(Tp2[i]/Tatm)^(-0.14) else 1);
+
+    /* Air volumetric expansion coefficient beta=1/Tatm */
+    Gr[i] = noEvent( if (Tpm > Tatm) then g*(1/Tatm)*(Tpm-Tatm)*L_rec^3*rho_air^2/mu_air^2 else 1e-6);
+
+    /* Mixed Convection Losses coefficient */
+    hc[i] = (hc_n[i]^3.2+hc_f^3.2)^(1/3.2);
+  end for;
+
+  for i in 1:Ns loop
+    /* Heat transfer on side 1 (internal) */
+    dW1[i] = pi*dx*ntubes*lambda*(Tp1[i] - Tp[i])/(Modelica.Math.log(1 + e/D));
+
+    /* Heat transfer on side 2 (external) */
+    dW2[i]- WRad[i] - WConv[i] = pi*dx*ntubes*lambda*(Tp2[i] - Tp[i])/(Modelica.Math.log(1 + e/(e + D)));
+
+    /* Thermal inertia */
+    dM*cpw*der(Tp[i]) = dW2[i] + dW1[i] - WRad[i] - WConv[i];
+
+    /* Heat losses on the 0.5 of the side 2 (convection, ratiation) */
+    /*--------------------------------------------------------------*/
+    /* Radiation losses: For Separation between cylinders = 0     => F12= 0.6366 */
+    WRad[i] = noEvent( if (Tp2[i] > Tsky) then ( 0.5*0.6366*Sc*pi*(D+2*e)*dx*ntubes*sigma*Eps*(Tp2[i]^(4) - Tsky^(4)) + 0.5*0.6366*Sc*pi*(D+2*e)*dx*ntubes*sigma*Eps*(Tp2[i]^(4) - Tatm^(4))) else  0);
+
+    /* Convection and conduction losses: For the conduction losses: the Receiver is considered as plain wall and */
+    /* For simplify: We take the Temperature of the Inside of the Insulation wall is equal to Tp1 and Outside Temperature to Tatm */
+    WConv[i] = noEvent( if (Tp2[i] > Tatm) then (Sc*pi*(D+2*e)*dx*ntubes*hc[i]*(Tp2[i] - Tatm)) + (Sc*pi*(D+2*e)*dx*ntubes*lambda_ins/e_ins)*(Tp1[i] - Tatm) else 0);
+
+    //WLosses [i] = WConv[i] + WRad[i];
+
+  end for;
+
+Wrad_Total=sum(WRad);
+Wconv_Total=sum(WConv);
+
+  annotation (
+    Icon(graphics={
+        Rectangle(
+          extent={{-100,10},{100,-10}},
+          lineColor={0,0,0},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.CrossDiag),
+        Text(
+          extent={{-80,40},{-20,20}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "2"),
+        Text(
+          extent={{-80,-20},{-20,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "1"),
+        Text(
+          extent={{20,40},{98,20}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "External"),
+        Text(
+          extent={{20,-20},{98,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Internal"),
+        Text(
+          extent={{-94,62},{-20,40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "With Losses"),
+        Text(
+          extent={{-122,32},{-100,16}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Tatm"),
+        Text(
+          extent={{-122,70},{-96,50}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "v_wind")}),
+    Diagram(graphics={
+        Rectangle(
+          extent={{-100,10},{100,-10}},
+          lineColor={0,0,0},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-80,30},{-20,10}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Side 2"),
+        Text(
+          extent={{-80,-10},{-20,-30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Side 1"),
+        Text(
+          extent={{20,-10},{98,-30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Internal"),
+        Text(
+          extent={{20,30},{98,10}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "External"),
+        Text(
+          extent={{-96,66},{-22,44}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "With Losses")}),
+    DymolaStoredErrors,
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Marie-Agnes Garnero</li>
+<li>Guillaume Larrignon</li>
+</ul>
+</html>"));
+end HeatExchangerWallWithLosses;
diff --git a/ThermoSysPro/Thermal/HeatTransfer/package.mo b/ThermoSysPro/Thermal/HeatTransfer/package.mo
index 0d764af9edb10e4eed1aaaee5ae8afe7ea90e139..0e63d0a3b5a2325ee57e7a9e34741af62904417e 100644
--- a/ThermoSysPro/Thermal/HeatTransfer/package.mo
+++ b/ThermoSysPro/Thermal/HeatTransfer/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.Thermal;
-package HeatTransfer "Heat transfer"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end HeatTransfer;
+within ThermoSysPro.Thermal;
+package HeatTransfer "Heat transfer"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end HeatTransfer;
diff --git a/ThermoSysPro/Thermal/HeatTransfer/package.order b/ThermoSysPro/Thermal/HeatTransfer/package.order
index 0cc8afcc0601033d95aef27c27067fb59313d09b..9694609e615daad134a5c6615f205c8efa7a1ec0 100644
--- a/ThermoSysPro/Thermal/HeatTransfer/package.order
+++ b/ThermoSysPro/Thermal/HeatTransfer/package.order
@@ -1,4 +1,4 @@
-ConvectiveHeatFlow
-HeatExchangerWall
-HeatExchangerWallCounterFlow
-HeatExchangerWallWithLosses
+ConvectiveHeatFlow
+HeatExchangerWall
+HeatExchangerWallCounterFlow
+HeatExchangerWallWithLosses
diff --git a/ThermoSysPro/Thermal/package.mo b/ThermoSysPro/Thermal/package.mo
index 836c7f54a9d5b67dae5a814f2ba3e5bc74e22b1e..291a06f55717e665f61cdbc2b757fe3308f4e68f 100644
--- a/ThermoSysPro/Thermal/package.mo
+++ b/ThermoSysPro/Thermal/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro;
-package Thermal "Thermal components library"
-
-
-
-  annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Thermal;
+within ThermoSysPro;
+package Thermal "Thermal components library"
+
+
+
+  annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Thermal;
diff --git a/ThermoSysPro/Units.mo b/ThermoSysPro/Units.mo
index 84ab9d24591fae7ebf8bbe415afb2224a235e2ed..c238344d2d9b46f001735bd731f3a5b16fbbaf98 100644
--- a/ThermoSysPro/Units.mo
+++ b/ThermoSysPro/Units.mo
@@ -1,1196 +1,1196 @@
-within ThermoSysPro;
-package Units "Additional SI and non-SI units"
-
-  package SI
-    "Library of type and unit definitions based on SI units according to ISO 31-1992"
-    extends Modelica.Icons.Package;
-
-    // Space and Time (chapter 1 of ISO 31-1992)
-
-    type Angle = Real (
-        final quantity="Angle",
-        final unit="rad",
-        displayUnit="deg");
-    type SolidAngle = Real (final quantity="SolidAngle", final unit="sr");
-    type Length = Real (final quantity="Length", final unit="m");
-    type PathLength = Length;
-    type Position = Length;
-    type Distance = Length (min=0);
-    type Breadth = Length(min=0);
-    type Height = Length(min=0);
-    type Thickness = Length(min=0);
-    type Radius = Length(min=0);
-    type Diameter = Length(min=0);
-    type Area = Real (final quantity="Area", final unit="m2");
-    type Volume = Real (final quantity="Volume", final unit="m3");
-    type Time = Real (final quantity="Time", final unit="s");
-    type Duration = Time;
-    type AngularVelocity = Real (
-        final quantity="AngularVelocity",
-        final unit="rad/s");
-    type AngularAcceleration = Real (final quantity="AngularAcceleration", final unit=
-               "rad/s2");
-    type Velocity = Real (final quantity="Velocity", final unit="m/s");
-    type Acceleration = Real (final quantity="Acceleration", final unit="m/s2");
-
-    // Periodic and related phenomens (chapter 2 of ISO 31-1992)
-    type Period = Real (final quantity="Time", final unit="s");
-    type Frequency = Real (final quantity="Frequency", final unit="Hz");
-    type AngularFrequency = Real (final quantity="AngularFrequency", final unit=
-            "rad/s");
-    type Wavelength = Real (final quantity="Wavelength", final unit="m");
-    type Wavelenght = Wavelength;
-    // For compatibility reasons only
-    type WaveNumber = Real (final quantity="WaveNumber", final unit="m-1");
-    type CircularWaveNumber = Real (final quantity="CircularWaveNumber", final unit=
-               "rad/m");
-    type AmplitudeLevelDifference = Real (final quantity=
-            "AmplitudeLevelDifference", final unit="dB");
-    type PowerLevelDifference = Real (final quantity="PowerLevelDifference",
-          final unit="dB");
-    type DampingCoefficient = Real (final quantity="DampingCoefficient", final unit=
-               "s-1");
-    type LogarithmicDecrement = Real (final quantity="LogarithmicDecrement",
-          final unit="1/S");
-    type AttenuationCoefficient = Real (final quantity="AttenuationCoefficient",
-          final unit="m-1");
-    type PhaseCoefficient = Real (final quantity="PhaseCoefficient", final unit=
-            "m-1");
-    type PropagationCoefficient = Real (final quantity="PropagationCoefficient",
-          final unit="m-1");
-    // added to ISO-chapter
-    type Damping = DampingCoefficient;
-
-    // Mechanics (chapter 3 of ISO 31-1992)
-    type Mass = Real (
-        quantity="Mass",
-        final unit="kg",
-        min=0);
-    type Density = Real (
-        final quantity="Density",
-        final unit="kg/m3",
-        displayUnit="g/cm3",
-        min=0.0);
-    type RelativeDensity = Real (
-        final quantity="RelativeDensity",
-        final unit="1",
-        min=0.0);
-    type SpecificVolume = Real (
-        final quantity="SpecificVolume",
-        final unit="m3/kg",
-        min=0.0);
-    type LinearDensity = Real (
-        final quantity="LinearDensity",
-        final unit="kg/m",
-        min=0);
-    type SurfaceDensity = Real (
-        final quantity="SurfaceDensity",
-        final unit="kg/m2",
-        min=0);
-    type Momentum = Real (final quantity="Momentum", final unit="kg.m/s");
-    type Impulse = Real (final quantity="Impulse", final unit="N.s");
-    type AngularMomentum = Real (final quantity="AngularMomentum", final unit=
-            "kg.m2/s");
-    type AngularImpulse = Real (final quantity="AngularImpulse", final unit=
-            "N.m.s");
-    type MomentOfInertia = Real (final quantity="MomentOfInertia", final unit=
-            "kg.m2");
-    type Inertia = MomentOfInertia;
-    type Force = Real (final quantity="Force", final unit="N");
-    type TranslationalSpringConstant=Real(final quantity="TranslationalSpringConstant", final unit="N/m");
-    type TranslationalDampingConstant=Real(final quantity="TranslationalDampingConstant", final unit="N.s/m");
-    type Weight = Force;
-    type Torque = Real (final quantity="Torque", final unit="N.m");
-    type ElectricalTorqueConstant = Real(final quantity="ElectricalTorqueConstant", final unit= "N.m/A");
-    type MomentOfForce = Torque;
-    type ImpulseFlowRate = Real (final quantity="ImpulseFlowRate", final unit="N");
-    type AngularImpulseFlowRate = Real (final quantity="AngularImpulseFlowRate", final unit= "N.m");
-    type RotationalSpringConstant=Real(final quantity="RotationalSpringConstant", final unit="N.m/rad");
-    type RotationalDampingConstant=Real(final quantity="RotationalDampingConstant", final unit="N.m.s/rad");
-    type Pressure = Real (
-        final quantity="Pressure",
-        final unit="Pa",
-        displayUnit="bar");
-    type AbsolutePressure = Pressure (min=0.0, nominal = 1e5);
-    type PressureDifference = Pressure;
-    type BulkModulus = AbsolutePressure;
-    type Stress = Real (final unit="Pa");
-    type NormalStress = Stress;
-    type ShearStress = Stress;
-    type Strain = Real (final quantity="Strain", final unit="1");
-    type LinearStrain = Strain;
-    type ShearStrain = Strain;
-    type VolumeStrain = Real (final quantity="VolumeStrain", final unit="1");
-    type PoissonNumber = Real (final quantity="PoissonNumber", final unit="1");
-    type ModulusOfElasticity = Stress;
-    type ShearModulus = Stress;
-    type SecondMomentOfArea = Real (final quantity="SecondMomentOfArea", final unit=
-               "m4");
-    type SecondPolarMomentOfArea = SecondMomentOfArea;
-    type SectionModulus = Real (final quantity="SectionModulus", final unit="m3");
-    type CoefficientOfFriction = Real (final quantity="CoefficientOfFriction",
-          final unit="1");
-    type DynamicViscosity = Real (
-        final quantity="DynamicViscosity",
-        final unit="Pa.s",
-        min=0);
-    type KinematicViscosity = Real (
-        final quantity="KinematicViscosity",
-        final unit="m2/s",
-        min=0);
-    type SurfaceTension = Real (final quantity="SurfaceTension", final unit="N/m");
-    type Work = Real (final quantity="Work", final unit="J");
-    type Energy = Real (final quantity="Energy", final unit="J");
-    type EnergyDensity = Real (final quantity="EnergyDensity", final unit="J/m3");
-    type PotentialEnergy = Energy;
-    type KineticEnergy = Energy;
-    type Power = Real (final quantity="Power", final unit="W");
-    type EnergyFlowRate = Power;
-    type EnthalpyFlowRate = Real (final quantity="EnthalpyFlowRate", final unit=
-            "W");
-    type Efficiency = Real (
-        final quantity="Efficiency",
-        final unit="1",
-        min=0);
-    type MassFlowRate = Real (quantity="MassFlowRate", final unit="kg/s");
-    type VolumeFlowRate = Real (final quantity="VolumeFlowRate", final unit=
-            "m3/s");
-    // added to ISO-chapter 3
-    type MomentumFlux = Real (final quantity="MomentumFlux", final unit="N");
-    type AngularMomentumFlux = Real (final quantity="AngularMomentumFlux", final unit=
-               "N.m");
-
-    // Heat (chapter 4 of ISO 31-1992)
-    type ThermodynamicTemperature = Real (
-        final quantity="ThermodynamicTemperature",
-        final unit="K",
-        min = 0.0,
-        start = 288.15,
-        nominal = 300,
-        displayUnit="degC")
-      "Absolute temperature (use type TemperatureDifference for relative temperatures)"                   annotation(absoluteValue=true);
-    type Temp_K = ThermodynamicTemperature;
-    type Temperature = ThermodynamicTemperature;
-    type TemperatureDifference = Real (
-        final quantity="ThermodynamicTemperature",
-        final unit="K") annotation(absoluteValue=false);
-    type TemperatureSlope = Real (final quantity="TemperatureSlope",
-        final unit="K/s");
-    type LinearTemperatureCoefficient = Real(final quantity = "LinearTemperatureCoefficient", final unit="1/K");
-    type QuadraticTemperatureCoefficient = Real(final quantity = "QuadraticTemperatureCoefficient", final unit="1/K2");
-    type LinearExpansionCoefficient = Real (final quantity=
-            "LinearExpansionCoefficient", final unit="1/K");
-    type CubicExpansionCoefficient = Real (final quantity=
-            "CubicExpansionCoefficient", final unit="1/K");
-    type RelativePressureCoefficient = Real (final quantity=
-            "RelativePressureCoefficient", final unit="1/K");
-    type PressureCoefficient = Real (final quantity="PressureCoefficient", final unit=
-               "Pa/K");
-    type Compressibility = Real (final quantity="Compressibility", final unit=
-            "1/Pa");
-    type IsothermalCompressibility = Compressibility;
-    type IsentropicCompressibility = Compressibility;
-    type Heat = Real (final quantity="Energy", final unit="J");
-    type HeatFlowRate = Real (final quantity="Power", final unit="W");
-    type HeatFlux = Real (final quantity="HeatFlux", final unit="W/m2");
-    type DensityOfHeatFlowRate = Real (final quantity="DensityOfHeatFlowRate",
-          final unit="W/m2");
-    type ThermalConductivity = Real (final quantity="ThermalConductivity", final unit=
-               "W/(m.K)");
-    type CoefficientOfHeatTransfer = Real (final quantity=
-            "CoefficientOfHeatTransfer", final unit="W/(m2.K)");
-    type SurfaceCoefficientOfHeatTransfer = CoefficientOfHeatTransfer;
-    type ThermalInsulance = Real (final quantity="ThermalInsulance", final unit=
-            "m2.K/W");
-    type ThermalResistance = Real (final quantity="ThermalResistance", final unit=
-           "K/W");
-    type ThermalConductance = Real (final quantity="ThermalConductance", final unit=
-               "W/K");
-    type ThermalDiffusivity = Real (final quantity="ThermalDiffusivity", final unit=
-               "m2/s");
-    type HeatCapacity = Real (final quantity="HeatCapacity", final unit="J/K");
-    type SpecificHeatCapacity = Real (final quantity="SpecificHeatCapacity",
-          final unit="J/(kg.K)");
-    type SpecificHeatCapacityAtConstantPressure = SpecificHeatCapacity;
-    type SpecificHeatCapacityAtConstantVolume = SpecificHeatCapacity;
-    type SpecificHeatCapacityAtSaturation = SpecificHeatCapacity;
-    type RatioOfSpecificHeatCapacities = Real (final quantity=
-            "RatioOfSpecificHeatCapacities", final unit="1");
-    type IsentropicExponent = Real (final quantity="IsentropicExponent", final unit=
-               "1");
-    type Entropy = Real (final quantity="Entropy", final unit="J/K");
-    type EntropyFlowRate = Real (final quantity="EntropyFlowRate", final unit="J/(K.s)");
-    type SpecificEntropy = Real (final quantity="SpecificEntropy",
-                                 final unit="J/(kg.K)");
-    type InternalEnergy = Heat;
-    type Enthalpy = Heat;
-    type HelmholtzFreeEnergy = Heat;
-    type GibbsFreeEnergy = Heat;
-    type SpecificEnergy = Real (final quantity="SpecificEnergy",
-                                final unit="J/kg");
-    type SpecificInternalEnergy = SpecificEnergy;
-    type SpecificEnthalpy = SpecificEnergy;
-    type SpecificHelmholtzFreeEnergy = SpecificEnergy;
-    type SpecificGibbsFreeEnergy = SpecificEnergy;
-    type MassieuFunction = Real (final quantity="MassieuFunction", final unit=
-            "J/K");
-    type PlanckFunction = Real (final quantity="PlanckFunction", final unit="J/K");
-    // added to ISO-chapter 4
-    type DerDensityByEnthalpy = Real (final unit="kg.s2/m5");
-    type DerDensityByPressure = Real (final unit="s2/m2");
-    type DerDensityByTemperature = Real (final unit="kg/(m3.K)");
-    type DerEnthalpyByPressure = Real (final unit="J.m.s2/kg2");
-    type DerEnergyByDensity = Real (final unit="J.m3/kg");
-    type DerEnergyByPressure = Real (final unit="J.m.s2/kg");
-    type DerPressureByDensity = Real (final unit="Pa.m3/kg");
-    type DerPressureByTemperature = Real (final unit="Pa/K");
-
-    // Electricity and Magnetism (chapter 5 of ISO 31-1992)
-    type ElectricCurrent = Real (final quantity="ElectricCurrent", final unit="A");
-    type Current = ElectricCurrent;
-    type CurrentSlope = Real(final quantity="CurrentSlope", final unit="A/s");
-    type ElectricCharge = Real (final quantity="ElectricCharge", final unit="C");
-    type Charge = ElectricCharge;
-    type VolumeDensityOfCharge = Real (
-        final quantity="VolumeDensityOfCharge",
-        final unit="C/m3",
-        min=0);
-    type SurfaceDensityOfCharge = Real (
-        final quantity="SurfaceDensityOfCharge",
-        final unit="C/m2",
-        min=0);
-    type ElectricFieldStrength = Real (final quantity="ElectricFieldStrength",
-          final unit="V/m");
-    type ElectricPotential = Real (final quantity="ElectricPotential", final unit=
-           "V");
-    type Voltage = ElectricPotential;
-    type PotentialDifference = ElectricPotential;
-    type ElectromotiveForce = ElectricPotential;
-    type VoltageSecond = Real (final quantity="VoltageSecond", final unit="V.s")
-      "Voltage second";
-    type VoltageSlope = Real(final quantity="VoltageSlope", final unit="V/s");
-    type ElectricFluxDensity = Real (final quantity="ElectricFluxDensity", final unit=
-               "C/m2");
-    type ElectricFlux = Real (final quantity="ElectricFlux", final unit="C");
-    type Capacitance = Real (
-        final quantity="Capacitance",
-        final unit="F",
-        min=0);
-    type CapacitancePerArea =
-                Real (final quantity="CapacitancePerArea", final unit="F/m2")
-      "Capacitance per area";
-    type Permittivity = Real (
-        final quantity="Permittivity",
-        final unit="F/m",
-        min=0);
-    type PermittivityOfVacuum = Permittivity;
-    type RelativePermittivity = Real (final quantity="RelativePermittivity",
-          final unit="1");
-    type ElectricSusceptibility = Real (final quantity="ElectricSusceptibility",
-          final unit="1");
-    type ElectricPolarization = Real (final quantity="ElectricPolarization",
-          final unit="C/m2");
-    type Electrization = Real (final quantity="Electrization", final unit="V/m");
-    type ElectricDipoleMoment = Real (final quantity="ElectricDipoleMoment",
-          final unit="C.m");
-    type CurrentDensity = Real (final quantity="CurrentDensity", final unit=
-            "A/m2");
-    type LinearCurrentDensity = Real (final quantity="LinearCurrentDensity",
-          final unit="A/m");
-    type MagneticFieldStrength = Real (final quantity="MagneticFieldStrength",
-          final unit="A/m");
-    type MagneticPotential = Real (final quantity="MagneticPotential", final unit="A");
-    type MagneticPotentialDifference = Real (final quantity=
-            "MagneticPotential", final unit="A");
-    type MagnetomotiveForce = Real (final quantity="MagnetomotiveForce", final unit=
-               "A");
-    type CurrentLinkage = Real (final quantity="CurrentLinkage", final unit="A");
-    type MagneticFluxDensity = Real (final quantity="MagneticFluxDensity", final unit=
-               "T");
-    type MagneticFlux = Real (final quantity="MagneticFlux", final unit="Wb");
-    type MagneticVectorPotential = Real (final quantity="MagneticVectorPotential",
-            final unit="Wb/m");
-    type Inductance = Real (
-        final quantity="Inductance",
-        final unit="H");
-    type SelfInductance = Inductance(min=0);
-    type MutualInductance = Inductance;
-    type CouplingCoefficient = Real (final quantity="CouplingCoefficient", final unit=
-               "1");
-    type LeakageCoefficient = Real (final quantity="LeakageCoefficient", final unit=
-               "1");
-    type Permeability = Real (final quantity="Permeability", final unit="H/m");
-    type PermeabilityOfVacuum = Permeability;
-    type RelativePermeability = Real (final quantity="RelativePermeability",
-          final unit="1");
-    type MagneticSusceptibility = Real (final quantity="MagneticSusceptibility",
-          final unit="1");
-    type ElectromagneticMoment = Real (final quantity="ElectromagneticMoment",
-          final unit="A.m2");
-    type MagneticDipoleMoment = Real (final quantity="MagneticDipoleMoment",
-          final unit="Wb.m");
-    type Magnetization = Real (final quantity="Magnetization", final unit="A/m");
-    type MagneticPolarization = Real (final quantity="MagneticPolarization",
-          final unit="T");
-    type ElectromagneticEnergyDensity = Real (final quantity="EnergyDensity",
-          final unit="J/m3");
-    type PoyntingVector = Real (final quantity="PoyntingVector", final unit=
-            "W/m2");
-    type Resistance = Real (
-        final quantity="Resistance",
-        final unit="Ohm");
-    type Resistivity = Real (final quantity="Resistivity", final unit="Ohm.m");
-    type Conductivity = Real (final quantity="Conductivity", final unit="S/m");
-    type Reluctance = Real (final quantity="Reluctance", final unit="H-1");
-    type Permeance = Real (final quantity="Permeance", final unit="H");
-    type PhaseDifference = Real (
-        final quantity="Angle",
-        final unit="rad",
-        displayUnit="deg");
-    type Impedance = Resistance;
-    type ModulusOfImpedance = Resistance;
-    type Reactance = Resistance;
-    type QualityFactor = Real (final quantity="QualityFactor", final unit="1");
-    type LossAngle = Real (
-        final quantity="Angle",
-        final unit="rad",
-        displayUnit="deg");
-    type Conductance = Real (
-        final quantity="Conductance",
-        final unit="S");
-    type Admittance = Conductance;
-    type ModulusOfAdmittance = Conductance;
-    type Susceptance = Conductance;
-    type InstantaneousPower = Real (final quantity="Power", final unit="W");
-    type ActivePower = Real (final quantity="Power", final unit="W");
-    type ApparentPower = Real (final quantity="Power", final unit="VA");
-    type ReactivePower = Real (final quantity="Power", final unit="var");
-    type PowerFactor = Real (final quantity="PowerFactor", final unit="1");
-
-    // added to ISO-chapter 5
-    type Transconductance = Real (final quantity="Transconductance", final unit=
-            "A/V2");
-    type InversePotential = Real (final quantity="InversePotential", final unit=
-            "1/V");
-    type ElectricalForceConstant = Real (
-         final quantity="ElectricalForceConstant",
-         final unit = "N/A");
-
-    // Light and Related Electromagnetic Radiations (chapter 6 of ISO 31-1992)
-    type RadiantEnergy = Real (final quantity="Energy", final unit="J");
-    type RadiantEnergyDensity = Real (final quantity="EnergyDensity", final unit=
-            "J/m3");
-    type SpectralRadiantEnergyDensity = Real (final quantity=
-            "SpectralRadiantEnergyDensity", final unit="J/m4");
-    type RadiantPower = Real (final quantity="Power", final unit="W");
-    type RadiantEnergyFluenceRate = Real (final quantity=
-            "RadiantEnergyFluenceRate", final unit="W/m2");
-    type RadiantIntensity = Real (final quantity="RadiantIntensity", final unit=
-            "W/sr");
-    type Radiance = Real (final quantity="Radiance", final unit="W/(sr.m2)");
-    type RadiantExtiance = Real (final quantity="RadiantExtiance", final unit=
-            "W/m2");
-    type Irradiance = Real (final quantity="Irradiance", final unit="W/m2");
-    type Emissivity = Real (final quantity="Emissivity", final unit="1");
-    type SpectralEmissivity = Real (final quantity="SpectralEmissivity", final unit=
-               "1");
-    type DirectionalSpectralEmissivity = Real (final quantity=
-            "DirectionalSpectralEmissivity", final unit="1");
-    type LuminousIntensity = Real (final quantity="LuminousIntensity", final unit=
-           "cd");
-    type LuminousFlux = Real (final quantity="LuminousFlux", final unit="lm");
-    type QuantityOfLight = Real (final quantity="QuantityOfLight", final unit=
-            "lm.s");
-    type Luminance = Real (final quantity="Luminance", final unit="cd/m2");
-    type LuminousExitance = Real (final quantity="LuminousExitance", final unit=
-            "lm/m2");
-    type Illuminance = Real (final quantity="Illuminance", final unit="lx");
-    type LightExposure = Real (final quantity="LightExposure", final unit="lx.s");
-    type LuminousEfficacy = Real (final quantity="LuminousEfficacy", final unit=
-            "lm/W");
-    type SpectralLuminousEfficacy = Real (final quantity=
-            "SpectralLuminousEfficacy", final unit="lm/W");
-    type LuminousEfficiency = Real (final quantity="LuminousEfficiency", final unit=
-               "1");
-    type SpectralLuminousEfficiency = Real (final quantity=
-            "SpectralLuminousEfficiency", final unit="1");
-    type CIESpectralTristimulusValues = Real (final quantity=
-            "CIESpectralTristimulusValues", final unit="1");
-    type ChromaticityCoordinates = Real (final quantity="CromaticityCoordinates",
-            final unit="1");
-    type SpectralAbsorptionFactor = Real (final quantity=
-            "SpectralAbsorptionFactor", final unit="1");
-    type SpectralReflectionFactor = Real (final quantity=
-            "SpectralReflectionFactor", final unit="1");
-    type SpectralTransmissionFactor = Real (final quantity=
-            "SpectralTransmissionFactor", final unit="1");
-    type SpectralRadianceFactor = Real (final quantity="SpectralRadianceFactor",
-          final unit="1");
-    type LinearAttenuationCoefficient = Real (final quantity=
-            "AttenuationCoefficient", final unit="m-1");
-    type LinearAbsorptionCoefficient = Real (final quantity=
-            "LinearAbsorptionCoefficient", final unit="m-1");
-    type MolarAbsorptionCoefficient = Real (final quantity=
-            "MolarAbsorptionCoefficient", final unit="m2/mol");
-    type RefractiveIndex = Real (final quantity="RefractiveIndex", final unit="1");
-
-    // Acoustics (chapter 7 of ISO 31-1992)
-    type StaticPressure = AbsolutePressure;
-    type SoundPressure = StaticPressure;
-    type SoundParticleDisplacement = Real (final quantity="Length", final unit=
-            "m");
-    type SoundParticleVelocity = Real (final quantity="Velocity", final unit=
-            "m/s");
-    type SoundParticleAcceleration = Real (final quantity="Acceleration", final unit=
-               "m/s2");
-    type VelocityOfSound = Real (final quantity="Velocity", final unit="m/s");
-    type SoundEnergyDensity = Real (final quantity="EnergyDensity", final unit=
-            "J/m3");
-    type SoundPower = Real (final quantity="Power", final unit="W");
-    type SoundIntensity = Real (final quantity="SoundIntensity", final unit=
-            "W/m2");
-    type AcousticImpedance = Real (final quantity="AcousticImpedance", final unit=
-           "Pa.s/m3");
-    type SpecificAcousticImpedance = Real (final quantity=
-            "SpecificAcousticImpedance", final unit="Pa.s/m");
-    type MechanicalImpedance = Real (final quantity="MechanicalImpedance", final unit=
-               "N.s/m");
-    type SoundPressureLevel = Real (final quantity="SoundPressureLevel", final unit=
-               "dB");
-    type SoundPowerLevel = Real (final quantity="SoundPowerLevel", final unit=
-            "dB");
-    type DissipationCoefficient = Real (final quantity="DissipationCoefficient",
-          final unit="1");
-    type ReflectionCoefficient = Real (final quantity="ReflectionCoefficient",
-          final unit="1");
-    type TransmissionCoefficient = Real (final quantity="TransmissionCoefficient",
-            final unit="1");
-    type AcousticAbsorptionCoefficient = Real (final quantity=
-            "AcousticAbsorptionCoefficient", final unit="1");
-    type SoundReductionIndex = Real (final quantity="SoundReductionIndex", final unit=
-               "dB");
-    type EquivalentAbsorptionArea = Real (final quantity="Area", final unit="m2");
-    type ReverberationTime = Real (final quantity="Time", final unit="s");
-    type LoudnessLevel = Real (final quantity="LoudnessLevel", final unit=
-            "phon");
-    type Loudness = Real (final quantity="Loudness", final unit="sone");
-    type LoundnessLevel = Real (final quantity="LoundnessLevel", final unit=
-            "phon") "Obsolete type, use LoudnessLevel instead!";
-    type Loundness = Real (final quantity="Loundness", final unit="sone")
-      "Obsolete type, use Loudness instead!";
-
-    // Physical chemistry and molecular physics (chapter 8 of ISO 31-1992)
-    type RelativeAtomicMass = Real (final quantity="RelativeAtomicMass", final unit=
-               "1");
-    type RelativeMolecularMass = Real (final quantity="RelativeMolecularMass",
-          final unit="1");
-    type NumberOfMolecules = Real (final quantity="NumberOfMolecules", final unit=
-           "1");
-    type AmountOfSubstance = Real (
-        final quantity="AmountOfSubstance",
-        final unit="mol",
-        min=0);
-    type MolarMass = Real (final quantity="MolarMass", final unit="kg/mol",min=0);
-    type MolarVolume = Real (final quantity="MolarVolume", final unit="m3/mol", min=0);
-    type MolarDensity = Real (final quantity="MolarDensity", unit="mol/m3");
-    type MolarEnergy = Real (final quantity="MolarEnergy", final unit="J/mol", nominal=2e4);
-    type MolarInternalEnergy = MolarEnergy;
-    type MolarHeatCapacity = Real (final quantity="MolarHeatCapacity", final unit=
-           "J/(mol.K)");
-    type MolarEntropy = Real (final quantity="MolarEntropy", final unit=
-            "J/(mol.K)");
-    type MolarEnthalpy = MolarEnergy;
-    type MolarFlowRate = Real (final quantity="MolarFlowRate", final unit=
-            "mol/s");
-    type NumberDensityOfMolecules = Real (final quantity=
-            "NumberDensityOfMolecules", final unit="m-3");
-    type MolecularConcentration = Real (final quantity="MolecularConcentration",
-          final unit="m-3");
-    type MassConcentration = Real (final quantity="MassConcentration", final unit=
-           "kg/m3");
-    type MassFraction = Real (final quantity="MassFraction", final unit="1",
-                              min=0, max=1);
-    type Concentration = Real (final quantity="Concentration", final unit=
-            "mol/m3");
-    type VolumeFraction = Real (final quantity="VolumeFraction", final unit="1");
-    type MoleFraction = Real (final quantity="MoleFraction", final unit="1",
-                              min = 0, max = 1);
-    type ChemicalPotential = Real (final quantity="ChemicalPotential", final unit=
-           "J/mol");
-    type AbsoluteActivity = Real (final quantity="AbsoluteActivity", final unit=
-            "1");
-    type PartialPressure = AbsolutePressure;
-    type Fugacity = Real (final quantity="Fugacity", final unit="Pa");
-    type StandardAbsoluteActivity = Real (final quantity=
-            "StandardAbsoluteActivity", final unit="1");
-    type ActivityCoefficient = Real (final quantity="ActivityCoefficient", final unit=
-               "1");
-    type ActivityOfSolute = Real (final quantity="ActivityOfSolute", final unit=
-            "1");
-    type ActivityCoefficientOfSolute = Real (final quantity=
-            "ActivityCoefficientOfSolute", final unit="1");
-    type StandardAbsoluteActivityOfSolute = Real (final quantity=
-            "StandardAbsoluteActivityOfSolute", final unit="1");
-    type ActivityOfSolvent = Real (final quantity="ActivityOfSolvent", final unit=
-           "1");
-    type OsmoticCoefficientOfSolvent = Real (final quantity=
-            "OsmoticCoefficientOfSolvent", final unit="1");
-    type StandardAbsoluteActivityOfSolvent = Real (final quantity=
-            "StandardAbsoluteActivityOfSolvent", final unit="1");
-    type OsmoticPressure = Real (
-        final quantity="Pressure",
-        final unit="Pa",
-        displayUnit="bar",
-        min=0);
-    type StoichiometricNumber = Real (final quantity="StoichiometricNumber",
-          final unit="1");
-    type Affinity = Real (final quantity="Affinity", final unit="J/mol");
-    type MassOfMolecule = Real (final quantity="Mass", final unit="kg");
-    type ElectricDipoleMomentOfMolecule = Real (final quantity=
-            "ElectricDipoleMomentOfMolecule", final unit="C.m");
-    type ElectricPolarizabilityOfAMolecule = Real (final quantity=
-            "ElectricPolarizabilityOfAMolecule", final unit="C.m2/V");
-    type MicrocanonicalPartitionFunction = Real (final quantity=
-            "MicrocanonicalPartitionFunction", final unit="1");
-    type CanonicalPartitionFunction = Real (final quantity=
-            "CanonicalPartitionFunction", final unit="1");
-    type GrandCanonicalPartitionFunction = Real (final quantity=
-            "GrandCanonicalPartitionFunction", final unit="1");
-    type MolecularPartitionFunction = Real (final quantity=
-            "MolecularPartitionFunction", final unit="1");
-    type StatisticalWeight = Real (final quantity="StatisticalWeight", final unit=
-           "1");
-    type MeanFreePath = Length;
-    type DiffusionCoefficient = Real (final quantity="DiffusionCoefficient",
-          final unit="m2/s");
-    type ThermalDiffusionRatio = Real (final quantity="ThermalDiffusionRatio",
-          final unit="1");
-    type ThermalDiffusionFactor = Real (final quantity="ThermalDiffusionFactor",
-          final unit="1");
-    type ThermalDiffusionCoefficient = Real (final quantity=
-            "ThermalDiffusionCoefficient", final unit="m2/s");
-    type ElementaryCharge = Real (final quantity="ElementaryCharge", final unit=
-            "C");
-    type ChargeNumberOfIon = Real (final quantity="ChargeNumberOfIon", final unit=
-           "1");
-    type FaradayConstant = Real (final quantity="FaradayConstant", final unit=
-            "C/mol");
-    type IonicStrength = Real (final quantity="IonicStrength", final unit=
-            "mol/kg");
-    type DegreeOfDissociation = Real (final quantity="DegreeOfDissociation",
-          final unit="1");
-    type ElectrolyticConductivity = Real (final quantity=
-            "ElectrolyticConductivity", final unit="S/m");
-    type MolarConductivity = Real (final quantity="MolarConductivity", final unit=
-           "S.m2/mol");
-    type TransportNumberOfIonic = Real (final quantity="TransportNumberOfIonic",
-          final unit="1");
-
-    // Atomic and Nuclear Physics (chapter 9 of ISO 31-1992)
-    type ProtonNumber = Real (final quantity="ProtonNumber", final unit="1");
-    type NeutronNumber = Real (final quantity="NeutronNumber", final unit="1");
-    type NucleonNumber = Real (final quantity="NucleonNumber", final unit="1");
-    type AtomicMassConstant = Real (final quantity="Mass", final unit="kg");
-    type MassOfElectron = Real (final quantity="Mass", final unit="kg");
-    type MassOfProton = Real (final quantity="Mass", final unit="kg");
-    type MassOfNeutron = Real (final quantity="Mass", final unit="kg");
-    type HartreeEnergy = Real (final quantity="Energy", final unit="J");
-    type MagneticMomentOfParticle = Real (final quantity=
-            "MagneticMomentOfParticle", final unit="A.m2");
-    type BohrMagneton = MagneticMomentOfParticle;
-    type NuclearMagneton = MagneticMomentOfParticle;
-    type GyromagneticCoefficient = Real (final quantity="GyromagneticCoefficient",
-            final unit="A.m2/(J.s)");
-    type GFactorOfAtom = Real (final quantity="GFactorOfAtom", final unit="1");
-    type GFactorOfNucleus = Real (final quantity="GFactorOfNucleus", final unit=
-            "1");
-    type LarmorAngularFrequency = Real (final quantity="AngularFrequency", final unit=
-               "s-1");
-    type NuclearPrecessionAngularFrequency = Real (final quantity=
-            "AngularFrequency", final unit="s-1");
-    type CyclotronAngularFrequency = Real (final quantity="AngularFrequency",
-          final unit="s-1");
-    type NuclearQuadrupoleMoment = Real (final quantity="NuclearQuadrupoleMoment",
-            final unit="m2");
-    type NuclearRadius = Real (final quantity="Length", final unit="m");
-    type ElectronRadius = Real (final quantity="Length", final unit="m");
-    type ComptonWavelength = Real (final quantity="Length", final unit="m");
-    type MassExcess = Real (final quantity="Mass", final unit="kg");
-    type MassDefect = Real (final quantity="Mass", final unit="kg");
-    type RelativeMassExcess = Real (final quantity="RelativeMassExcess", final unit=
-               "1");
-    type RelativeMassDefect = Real (final quantity="RelativeMassDefect", final unit=
-               "1");
-    type PackingFraction = Real (final quantity="PackingFraction", final unit="1");
-    type BindingFraction = Real (final quantity="BindingFraction", final unit="1");
-    type MeanLife = Real (final quantity="Time", final unit="s");
-    type LevelWidth = Real (final quantity="LevelWidth", final unit="J");
-    type Activity = Real (final quantity="Activity", final unit="Bq");
-    type SpecificActivity = Real (final quantity="SpecificActivity", final unit=
-            "Bq/kg");
-    type DecayConstant = Real (final quantity="DecayConstant", final unit="s-1");
-    type HalfLife = Real (final quantity="Time", final unit="s");
-    type AlphaDisintegrationEnergy = Real (final quantity="Energy", final unit=
-            "J");
-    type MaximumBetaParticleEnergy = Real (final quantity="Energy", final unit=
-            "J");
-    type BetaDisintegrationEnergy = Real (final quantity="Energy", final unit="J");
-
-    // Nuclear Reactions and Ionizing Radiations (chapter 10 of ISO 31-1992)
-    type ReactionEnergy = Real (final quantity="Energy", final unit="J");
-    type ResonanceEnergy = Real (final quantity="Energy", final unit="J");
-    type CrossSection = Real (final quantity="Area", final unit="m2");
-    type TotalCrossSection = Real (final quantity="Area", final unit="m2");
-    type AngularCrossSection = Real (final quantity="AngularCrossSection", final unit=
-               "m2/sr");
-    type SpectralCrossSection = Real (final quantity="SpectralCrossSection",
-          final unit="m2/J");
-    type SpectralAngularCrossSection = Real (final quantity=
-            "SpectralAngularCrossSection", final unit="m2/(sr.J)");
-    type MacroscopicCrossSection = Real (final quantity="MacroscopicCrossSection",
-            final unit="m-1");
-    type TotalMacroscopicCrossSection = Real (final quantity=
-            "TotalMacroscopicCrossSection", final unit="m-1");
-    type ParticleFluence = Real (final quantity="ParticleFluence", final unit=
-            "m-2");
-    type ParticleFluenceRate = Real (final quantity="ParticleFluenceRate", final unit=
-               "s-1.m2");
-    type EnergyFluence = Real (final quantity="EnergyFluence", final unit="J/m2");
-    type EnergyFluenceRate = Real (final quantity="EnergyFluenceRate", final unit=
-           "W/m2");
-    type CurrentDensityOfParticles = Real (final quantity=
-            "CurrentDensityOfParticles", final unit="m-2.s-1");
-    type MassAttenuationCoefficient = Real (final quantity=
-            "MassAttenuationCoefficient", final unit="m2/kg");
-    type MolarAttenuationCoefficient = Real (final quantity=
-            "MolarAttenuationCoefficient", final unit="m2/mol");
-    type AtomicAttenuationCoefficient = Real (final quantity=
-            "AtomicAttenuationCoefficient", final unit="m2");
-    type HalfThickness = Real (final quantity="Length", final unit="m");
-    type TotalLinearStoppingPower = Real (final quantity=
-            "TotalLinearStoppingPower", final unit="J/m");
-    type TotalAtomicStoppingPower = Real (final quantity=
-            "TotalAtomicStoppingPower", final unit="J.m2");
-    type TotalMassStoppingPower = Real (final quantity="TotalMassStoppingPower",
-          final unit="J.m2/kg");
-    type MeanLinearRange = Real (final quantity="Length", final unit="m");
-    type MeanMassRange = Real (final quantity="MeanMassRange", final unit="kg/m2");
-    type LinearIonization = Real (final quantity="LinearIonization", final unit=
-            "m-1");
-    type TotalIonization = Real (final quantity="TotalIonization", final unit="1");
-    type Mobility = Real (final quantity="Mobility", final unit="m2/(V.s)");
-    type IonNumberDensity = Real (final quantity="IonNumberDensity", final unit=
-            "m-3");
-    type RecombinationCoefficient = Real (final quantity=
-            "RecombinationCoefficient", final unit="m3/s");
-    type NeutronNumberDensity = Real (final quantity="NeutronNumberDensity",
-          final unit="m-3");
-    type NeutronSpeed = Real (final quantity="Velocity", final unit="m/s");
-    type NeutronFluenceRate = Real (final quantity="NeutronFluenceRate", final unit=
-               "s-1.m-2");
-    type TotalNeutronSourceDensity = Real (final quantity=
-            "TotalNeutronSourceDesity", final unit="s-1.m-3");
-    type SlowingDownDensity = Real (final quantity="SlowingDownDensity", final unit=
-               "s-1.m-3");
-    type ResonanceEscapeProbability = Real (final quantity=
-            "ResonanceEscapeProbability", final unit="1");
-    type Lethargy = Real (final quantity="Lethargy", final unit="1");
-    type SlowingDownArea = Real (final quantity="Area", final unit="m2");
-    type DiffusionArea = Real (final quantity="Area", final unit="m2");
-    type MigrationArea = Real (final quantity="Area", final unit="m2");
-    type SlowingDownLength = Real (final quantity="SLength", final unit="m");
-    type DiffusionLength = Length;
-    type MigrationLength = Length;
-    type NeutronYieldPerFission = Real (final quantity="NeutronYieldPerFission",
-          final unit="1");
-    type NeutronYieldPerAbsorption = Real (final quantity=
-            "NeutronYieldPerAbsorption", final unit="1");
-    type FastFissionFactor = Real (final quantity="FastFissionFactor", final unit=
-           "1");
-    type ThermalUtilizationFactor = Real (final quantity=
-            "ThermalUtilizationFactor", final unit="1");
-    type NonLeakageProbability = Real (final quantity="NonLeakageProbability",
-          final unit="1");
-    type Reactivity = Real (final quantity="Reactivity", final unit="1");
-    type ReactorTimeConstant = Real (final quantity="Time", final unit="s");
-    type EnergyImparted = Real (final quantity="Energy", final unit="J");
-    type MeanEnergyImparted = Real (final quantity="Energy", final unit="J");
-    type SpecificEnergyImparted = Real (final quantity="SpecificEnergy", final unit=
-               "Gy");
-    type AbsorbedDose = Real (final quantity="AbsorbedDose", final unit="Gy");
-    type DoseEquivalent = Real (final quantity="DoseEquivalent", final unit="Sv");
-    type AbsorbedDoseRate = Real (final quantity="AbsorbedDoseRate", final unit=
-            "Gy/s");
-    type LinearEnergyTransfer = Real (final quantity="LinearEnergyTransfer",
-          final unit="J/m");
-    type Kerma = Real (final quantity="Kerma", final unit="Gy");
-    type KermaRate = Real (final quantity="KermaRate", final unit="Gy/s");
-    type MassEnergyTransferCoefficient = Real (final quantity=
-            "MassEnergyTransferCoefficient", final unit="m2/kg");
-    type Exposure = Real (final quantity="Exposure", final unit="C/kg");
-    type ExposureRate = Real (final quantity="ExposureRate", final unit=
-            "C/(kg.s)");
-
-    // chapter 11 is not defined in ISO 31-1992
-
-    // Characteristic Numbers (chapter 12 of ISO 31-1992)
-    type ReynoldsNumber = Real (final quantity="ReynoldsNumber", final unit="1");
-    type EulerNumber = Real (final quantity="EulerNumber", final unit="1");
-    type FroudeNumber = Real (final quantity="FroudeNumber", final unit="1");
-    type GrashofNumber = Real (final quantity="GrashofNumber", final unit="1");
-    type WeberNumber = Real (final quantity="WeberNumber", final unit="1");
-    type MachNumber = Real (final quantity="MachNumber", final unit="1");
-    type KnudsenNumber = Real (final quantity="KnudsenNumber", final unit="1");
-    type StrouhalNumber = Real (final quantity="StrouhalNumber", final unit="1");
-    type FourierNumber = Real (final quantity="FourierNumber", final unit="1");
-    type PecletNumber = Real (final quantity="PecletNumber", final unit="1");
-    type RayleighNumber = Real (final quantity="RayleighNumber", final unit="1");
-    type NusseltNumber = Real (final quantity="NusseltNumber", final unit="1");
-    type BiotNumber = NusseltNumber;
-    // The Biot number (Bi) is used when
-    // the Nusselt number is reserved
-    // for convective transport of heat.
-    type StantonNumber = Real (final quantity="StantonNumber", final unit="1");
-    type FourierNumberOfMassTransfer = Real (final quantity=
-            "FourierNumberOfMassTransfer", final unit="1");
-    type PecletNumberOfMassTransfer = Real (final quantity=
-            "PecletNumberOfMassTransfer", final unit="1");
-    type GrashofNumberOfMassTransfer = Real (final quantity=
-            "GrashofNumberOfMassTransfer", final unit="1");
-    type NusseltNumberOfMassTransfer = Real (final quantity=
-            "NusseltNumberOfMassTransfer", final unit="1");
-    type StantonNumberOfMassTransfer = Real (final quantity=
-            "StantonNumberOfMassTransfer", final unit="1");
-    type PrandtlNumber = Real (final quantity="PrandtlNumber", final unit="1");
-    type SchmidtNumber = Real (final quantity="SchmidtNumber", final unit="1");
-    type LewisNumber = Real (final quantity="LewisNumber", final unit="1");
-    type MagneticReynoldsNumber = Real (final quantity="MagneticReynoldsNumber",
-          final unit="1");
-    type AlfvenNumber = Real (final quantity="AlfvenNumber", final unit="1");
-    type HartmannNumber = Real (final quantity="HartmannNumber", final unit="1");
-    type CowlingNumber = Real (final quantity="CowlingNumber", final unit="1");
-
-    // Solid State Physics (chapter 13 of ISO 31-1992)
-    type BraggAngle = Angle;
-    type OrderOfReflexion = Real (final quantity="OrderOfReflexion", final unit=
-            "1");
-    type ShortRangeOrderParameter = Real (final quantity="RangeOrderParameter",
-          final unit="1");
-    type LongRangeOrderParameter = Real (final quantity="RangeOrderParameter",
-          final unit="1");
-    type DebyeWallerFactor = Real (final quantity="DebyeWallerFactor", final unit=
-           "1");
-    type CircularWavenumber = Real (final quantity="CircularWavenumber", final unit=
-               "m-1");
-    type FermiCircularWavenumber = Real (final quantity="FermiCircularWavenumber",
-            final unit="m-1");
-    type DebyeCircularWavenumber = Real (final quantity="DebyeCircularWavenumber",
-            final unit="m-1");
-    type DebyeCircularFrequency = Real (final quantity="AngularFrequency", final unit=
-               "s-1");
-    type DebyeTemperature = ThermodynamicTemperature;
-    type SpectralConcentration = Real (final quantity="SpectralConcentration",
-          final unit="s/m3");
-    type GrueneisenParameter = Real (final quantity="GrueneisenParameter", final unit=
-               "1");
-    type MadelungConstant = Real (final quantity="MadelungConstant", final unit=
-            "1");
-    type DensityOfStates = Real (final quantity="DensityOfStates", final unit=
-            "J-1/m-3");
-    type ResidualResistivity = Real (final quantity="ResidualResistivity", final unit=
-               "Ohm.m");
-    type LorenzCoefficient = Real (final quantity="LorenzCoefficient", final unit=
-           "V2/K2");
-    type HallCoefficient = Real (final quantity="HallCoefficient", final unit=
-            "m3/C");
-    type ThermoelectromotiveForce = Real (final quantity=
-            "ThermoelectromotiveForce", final unit="V");
-    type SeebeckCoefficient = Real (final quantity="SeebeckCoefficient", final unit=
-               "V/K");
-    type PeltierCoefficient = Real (final quantity="PeltierCoefficient", final unit=
-               "V");
-    type ThomsonCoefficient = Real (final quantity="ThomsonCoefficient", final unit=
-               "V/K");
-    type RichardsonConstant = Real (final quantity="RichardsonConstant", final unit=
-               "A/(m2.K2)");
-    type FermiEnergy = Real (final quantity="Energy", final unit="eV");
-    type GapEnergy = Real (final quantity="Energy", final unit="eV");
-    type DonorIonizationEnergy = Real (final quantity="Energy", final unit="eV");
-    type AcceptorIonizationEnergy = Real (final quantity="Energy", final unit=
-            "eV");
-    type ActivationEnergy = Real (final quantity="Energy", final unit="eV");
-    type FermiTemperature = ThermodynamicTemperature;
-    type ElectronNumberDensity = Real (final quantity="ElectronNumberDensity",
-          final unit="m-3");
-    type HoleNumberDensity = Real (final quantity="HoleNumberDensity", final unit=
-           "m-3");
-    type IntrinsicNumberDensity = Real (final quantity="IntrinsicNumberDensity",
-          final unit="m-3");
-    type DonorNumberDensity = Real (final quantity="DonorNumberDensity", final unit=
-               "m-3");
-    type AcceptorNumberDensity = Real (final quantity="AcceptorNumberDensity",
-          final unit="m-3");
-    type EffectiveMass = Mass;
-    type MobilityRatio = Real (final quantity="MobilityRatio", final unit="1");
-    type RelaxationTime = Time;
-    type CarrierLifeTime = Time;
-    type ExchangeIntegral = Real (final quantity="Energy", final unit="eV");
-    type CurieTemperature = ThermodynamicTemperature;
-    type NeelTemperature = ThermodynamicTemperature;
-    type LondonPenetrationDepth = Length;
-    type CoherenceLength = Length;
-    type LandauGinzburgParameter = Real (final quantity="LandauGinzburgParameter",
-            final unit="1");
-    type FluxiodQuantum = Real (final quantity="FluxiodQuantum", final unit="Wb");
-
-    type TimeAging = Real (final quantity="1/Modelica.SIunits.Time",final unit="1/s");
-    type ChargeAging = Real (final quantity="1/Modelica.SIunits.ElectricCharge",final unit="1/(A.s)");
-
-   // Other types not defined in ISO 31-1992
-    type PerUnit = Real(unit = "1");
-    type DimensionlessRatio = Real(unit = "1");
-
-   // Complex types for electrical systems (not defined in ISO 31-1992)
-    operator record ComplexCurrent =
-      Complex(redeclare ThermoSysPro.Units.SI.Current re,
-               redeclare ThermoSysPro.Units.SI.Current im)
-      "Complex electrical current";
-    operator record ComplexCurrentSlope =
-      Complex(redeclare ThermoSysPro.Units.SI.CurrentSlope re,
-               redeclare ThermoSysPro.Units.SI.CurrentSlope im)
-      "Complex current slope";
-    operator record ComplexCurrentDensity =
-      Complex(redeclare ThermoSysPro.Units.SI.CurrentDensity re,
-               redeclare ThermoSysPro.Units.SI.CurrentDensity im)
-      "Complex electrical current density";
-    operator record ComplexElectricPotential =
-      Complex(redeclare ThermoSysPro.Units.SI.ElectricPotential re,
-               redeclare ThermoSysPro.Units.SI.ElectricPotential im)
-      "Complex electric potential";
-    operator record ComplexPotentialDifference =
-      Complex(redeclare ThermoSysPro.Units.SI.PotentialDifference re,
-               redeclare ThermoSysPro.Units.SI.PotentialDifference im)
-      "Complex electric potential difference";
-    operator record ComplexVoltage =
-      Complex(redeclare ThermoSysPro.Units.SI.Voltage re,
-               redeclare ThermoSysPro.Units.SI.Voltage im)
-      "Complex electrical voltage";
-    operator record ComplexVoltageSlope =
-      Complex(redeclare ThermoSysPro.Units.SI.VoltageSlope re,
-               redeclare ThermoSysPro.Units.SI.VoltageSlope im)
-      "Complex voltage slope";
-    operator record ComplexElectricFieldStrength =
-      Complex(redeclare ThermoSysPro.Units.SI.ElectricFieldStrength re,
-               redeclare ThermoSysPro.Units.SI.ElectricFieldStrength im)
-      "Complex electric field strength";
-    operator record ComplexElectricFluxDensity =
-      Complex(redeclare ThermoSysPro.Units.SI.ElectricFluxDensity re,
-               redeclare ThermoSysPro.Units.SI.ElectricFluxDensity im)
-      "Complex electric flux density";
-    operator record ComplexElectricFlux =
-      Complex(redeclare ThermoSysPro.Units.SI.ElectricFlux re,
-               redeclare ThermoSysPro.Units.SI.ElectricFlux im)
-      "Complex electric flux";
-    operator record ComplexMagneticFieldStrength =
-      Complex(redeclare ThermoSysPro.Units.SI.MagneticFieldStrength re,
-               redeclare ThermoSysPro.Units.SI.MagneticFieldStrength im)
-      "Complex magnetic field strength";
-    operator record ComplexMagneticPotential =
-      Complex(redeclare ThermoSysPro.Units.SI.MagneticPotential re,
-               redeclare ThermoSysPro.Units.SI.MagneticPotential im)
-      "Complex magnetic potential";
-    operator record ComplexMagneticPotentialDifference =
-      Complex(redeclare ThermoSysPro.Units.SI.MagneticPotentialDifference re,
-               redeclare ThermoSysPro.Units.SI.MagneticPotentialDifference im)
-      "Complex magnetic potential difference";
-    operator record ComplexMagnetomotiveForce =
-      Complex(redeclare ThermoSysPro.Units.SI.MagnetomotiveForce re,
-               redeclare ThermoSysPro.Units.SI.MagnetomotiveForce im)
-      "Complex magneto motive force";
-    operator record ComplexMagneticFluxDensity =
-      Complex(redeclare ThermoSysPro.Units.SI.MagneticFluxDensity re,
-               redeclare ThermoSysPro.Units.SI.MagneticFluxDensity im)
-      "Complex magnetic flux density";
-    operator record ComplexMagneticFlux =
-      Complex(redeclare ThermoSysPro.Units.SI.MagneticFlux re,
-               redeclare ThermoSysPro.Units.SI.MagneticFlux im)
-      "Complex magnetic flux";
-    operator record ComplexReluctance =
-      Complex(redeclare ThermoSysPro.Units.SI.Reluctance re,
-               redeclare ThermoSysPro.Units.SI.Reluctance im)
-                                                         "Complex reluctance"
-      annotation (Documentation(info="<html>
-<p>
-Since magnetic material properties like reluctance and permeance often are anisotropic resp. salient,
-a special operator instead of multiplication (compare: tensor vs. vector) is required.
-<a href=\"modelica://Modelica.Magnetic.FundamentalWave\">Modelica.Magnetic.FundamentalWave</a> uses a
-special record <a href=\"modelica://Modelica.Magnetic.FundamentalWave.Types.Salient\">Salient</a>
-which is only valid in the rotor-fixed coordinate system.
-</p>
-<p>
-<b>Note:</b> To avoid confusion, no magnetic material properties should be defined as Complex units.
-</p>
-</html>"));
-    operator record ComplexImpedance =
-      Complex(redeclare Resistance re,
-               redeclare Reactance im) "Complex electrical impedance";
-    operator record ComplexAdmittance =
-      Complex(redeclare Conductance re,
-               redeclare Susceptance im) "Complex electrical admittance";
-    operator record ComplexPower =
-      Complex(redeclare ActivePower re,
-               redeclare ReactivePower im) "Complex electrical power";
-    annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-              -100},{100,100}}), graphics={
-          Line(
-            points={{-66,78},{-66,-40}},
-            color={64,64,64}),
-          Ellipse(
-            extent={{12,36},{68,-38}},
-            lineColor={64,64,64},
-            fillColor={175,175,175},
-            fillPattern=FillPattern.Solid),
-          Rectangle(
-            extent={{-74,78},{-66,-40}},
-            lineColor={64,64,64},
-            fillColor={175,175,175},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-66,-4},{-66,6},{-16,56},{-16,46},{-66,-4}},
-            lineColor={64,64,64},
-            fillColor={175,175,175},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{-46,16},{-40,22},{-2,-40},{-10,-40},{-46,16}},
-            lineColor={64,64,64},
-            fillColor={175,175,175},
-            fillPattern=FillPattern.Solid),
-          Ellipse(
-            extent={{22,26},{58,-28}},
-            lineColor={64,64,64},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.Solid),
-          Polygon(
-            points={{68,2},{68,-46},{64,-60},{58,-68},{48,-72},{18,-72},{18,-64},
-                {46,-64},{54,-60},{58,-54},{60,-46},{60,-26},{64,-20},{68,-6},{68,
-                2}},
-            lineColor={64,64,64},
-            smooth=Smooth.Bezier,
-            fillColor={175,175,175},
-            fillPattern=FillPattern.Solid)}), Documentation(info="<html>
-<p>This package provides predefined types, such as <i>Mass</i>, <i>Angle</i>, <i>Time</i>, based on the international standard on units, e.g., </p>
-<p><code>   <b>type</b> Angle = Real(<b>final</b> quantity = &quot;Angle&quot;,</code></p>
-<p><code>                     <b>final</b> unit     = &quot;rad&quot;,</code></p>
-<p><code>                     displayUnit    = &quot;deg&quot;);</code> </p>
-<p><br>Copyright &copy; 1998-2016, Modelica Association and DLR. </p>
-<p>This package is copied from package Modelica.SIunits in Modelica package version 3.2.2.</p>
-</html>",   revisions="<html>
-<ul>
-<li><i>May 25, 2011</i> by Stefan Wischhusen:<br/>Added molar units for energy and enthalpy.</li>
-<li><i>Jan. 27, 2010</i> by Christian Kral:<br/>Added complex units.</li>
-<li><i>Dec. 14, 2005</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Add User&#39;;s Guide and removed &quot;min&quot; values for Resistance and Conductance.</li>
-<li><i>October 21, 2002</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> and Christian Schweiger:<br/>Added new package <b>Conversions</b>. Corrected typo <i>Wavelenght</i>.</li>
-<li><i>June 6, 2000</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Introduced the following new types<br/>type Temperature = ThermodynamicTemperature;<br/>types DerDensityByEnthalpy, DerDensityByPressure, DerDensityByTemperature, DerEnthalpyByPressure, DerEnergyByDensity, DerEnergyByPressure<br/>Attribute &quot;final&quot; removed from min and max values in order that these values can still be changed to narrow the allowed range of values.<br/>Quantity=&quot;Stress&quot; removed from type &quot;Stress&quot;, in order that a type &quot;Stress&quot; can be connected to a type &quot;Pressure&quot;.</li>
-<li><i>Oct. 27, 1999</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>New types due to electrical library: Transconductance, InversePotential, Damping.</li>
-<li><i>Sept. 18, 1999</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Renamed from SIunit to SIunits. Subpackages expanded, i.e., the SIunits package, does no longer contain subpackages.</li>
-<li><i>Aug 12, 1999</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Type &quot;Pressure&quot; renamed to &quot;AbsolutePressure&quot; and introduced a new type &quot;Pressure&quot; which does not contain a minimum of zero in order to allow convenient handling of relative pressure. Redefined BulkModulus as an alias to AbsolutePressure instead of Stress, since needed in hydraulics.</li>
-<li><i>June 29, 1999</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Bug-fix: Double definition of &quot;Compressibility&quot; removed and appropriate &quot;extends Heat&quot; clause introduced in package SolidStatePhysics to incorporate ThermodynamicTemperature.</li>
-<li><i>April 8, 1998</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> and Astrid Jaschinski:<br/>Complete ISO 31 chapters realized.</li>
-<li><i>Nov. 15, 1997</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> and Hubertus Tummescheit:<br/>Some chapters realized.</li>
-</ul>
-</html>"));
-  end SI;
-
-  package nonSI
-    type Time_minute = Real(final quantity="Time", final unit="min");
-    type Angle_deg =  Real (final quantity="Angle", final unit="deg") annotation (
-       Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-    type AngularVelocity_rpm = Real (final quantity="Angular velocity", final unit="rev/min") annotation (Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-    type Temperature_degC =   Real (final quantity="ThermodynamicTemperature", final unit=
-                                                                                        "degC")
-       annotation (Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-    type Pressure_bar = Real (final quantity="Pressure", final unit="bar");
-    type Power_kW = Real(final quantity="Power", final unit="kW");
-    type Power_MW = Real(final quantity="Power", final unit="MW");
-    type VolumeFlowRate_m3h = Real(final quantity="VolumeFlowRate", final unit="m3/h");
-  end nonSI;
-
-  package xSI "Additional SI units"
-    type PressureLossCoefficient =Real (final quantity="Pressure loss coefficient", final unit="m-4")
-                                                                annotation (
-        Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-    type DerDensityByEnthalpy = Real (final unit="kg2/(m3.J)");
-    type DerDensityByEntropy = Real (final quantity="DerDensityByEntropy", final unit=
-               "kg2.K/(m3.J)");
-    type DerEnergyByTemperature = Real (final quantity="Derivative of the specific energy wrt. the temperature", final unit=
-                                                                                                    "J/(kg.K)")
-      annotation (Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-    type DerEnergyByPressure = Real (final quantity="DerEnergyByPressure", final unit=
-               "J/Pa");
-    type DerEntropyByTemperature = Real (final quantity="DerEntropyByTemperature",
-           final unit="J/K2");
-    type DerEntropyByPressure = Real (final quantity="DerEntropyByPressure",
-          final unit="J/(K.Pa)");
-    type DerPressureByDensity = Real (final quantity="DerPressureByDensity",
-          final unit="Pa.m3/kg");
-    type DerPressureBySpecificVolume = Real (final quantity=
-            "DerPressureBySpecificVolume", final unit="Pa.kg/m3");
-    type DerPressureByTemperature = Real (final quantity=
-            "DerPressureByTemperature", final unit="Pa/K");
-    type DerVolumeByTemperature = Real (final quantity="DerVolumeByTemperature",
-          final unit="m3/K");
-    type DerVolumeByPressure = Real (final quantity="DerVolumeByPressure", final unit=
-               "m3/Pa");
-    type Cv = Real (final quantity="Cv U.S.", final unit="m4/(s.N5)")
-                                                                    annotation (
-        Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-    type SonicConductance = Real (final quantity="Sonic conductance", final unit="m3/(s.Pa)")
-                                                                annotation (
-        Documentation(info="<html>
-<p><b>Version 1.0</b></p>
-</HTML>
-"));
-    type IdealGasConstant = Real (final quantity="Ideal gas constant", final unit="J/(kg.K)");
-    type ViscousFriction = Real (final quantity="Viscous friction", final unit="N/(m/s)");
-  end xSI;
-  annotation (
-    Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}),
-    Documentation(info="<html>
-</html>"));
-
-end Units;
+within ThermoSysPro;
+package Units "Additional SI and non-SI units"
+
+  package SI
+    "Library of type and unit definitions based on SI units according to ISO 31-1992"
+    extends Modelica.Icons.Package;
+
+    // Space and Time (chapter 1 of ISO 31-1992)
+
+    type Angle = Real (
+        final quantity="Angle",
+        final unit="rad",
+        displayUnit="deg");
+    type SolidAngle = Real (final quantity="SolidAngle", final unit="sr");
+    type Length = Real (final quantity="Length", final unit="m");
+    type PathLength = Length;
+    type Position = Length;
+    type Distance = Length (min=0);
+    type Breadth = Length(min=0);
+    type Height = Length(min=0);
+    type Thickness = Length(min=0);
+    type Radius = Length(min=0);
+    type Diameter = Length(min=0);
+    type Area = Real (final quantity="Area", final unit="m2");
+    type Volume = Real (final quantity="Volume", final unit="m3");
+    type Time = Real (final quantity="Time", final unit="s");
+    type Duration = Time;
+    type AngularVelocity = Real (
+        final quantity="AngularVelocity",
+        final unit="rad/s");
+    type AngularAcceleration = Real (final quantity="AngularAcceleration", final unit=
+               "rad/s2");
+    type Velocity = Real (final quantity="Velocity", final unit="m/s");
+    type Acceleration = Real (final quantity="Acceleration", final unit="m/s2");
+
+    // Periodic and related phenomens (chapter 2 of ISO 31-1992)
+    type Period = Real (final quantity="Time", final unit="s");
+    type Frequency = Real (final quantity="Frequency", final unit="Hz");
+    type AngularFrequency = Real (final quantity="AngularFrequency", final unit=
+            "rad/s");
+    type Wavelength = Real (final quantity="Wavelength", final unit="m");
+    type Wavelenght = Wavelength;
+    // For compatibility reasons only
+    type WaveNumber = Real (final quantity="WaveNumber", final unit="m-1");
+    type CircularWaveNumber = Real (final quantity="CircularWaveNumber", final unit=
+               "rad/m");
+    type AmplitudeLevelDifference = Real (final quantity=
+            "AmplitudeLevelDifference", final unit="dB");
+    type PowerLevelDifference = Real (final quantity="PowerLevelDifference",
+          final unit="dB");
+    type DampingCoefficient = Real (final quantity="DampingCoefficient", final unit=
+               "s-1");
+    type LogarithmicDecrement = Real (final quantity="LogarithmicDecrement",
+          final unit="1/S");
+    type AttenuationCoefficient = Real (final quantity="AttenuationCoefficient",
+          final unit="m-1");
+    type PhaseCoefficient = Real (final quantity="PhaseCoefficient", final unit=
+            "m-1");
+    type PropagationCoefficient = Real (final quantity="PropagationCoefficient",
+          final unit="m-1");
+    // added to ISO-chapter
+    type Damping = DampingCoefficient;
+
+    // Mechanics (chapter 3 of ISO 31-1992)
+    type Mass = Real (
+        quantity="Mass",
+        final unit="kg",
+        min=0);
+    type Density = Real (
+        final quantity="Density",
+        final unit="kg/m3",
+        displayUnit="g/cm3",
+        min=0.0);
+    type RelativeDensity = Real (
+        final quantity="RelativeDensity",
+        final unit="1",
+        min=0.0);
+    type SpecificVolume = Real (
+        final quantity="SpecificVolume",
+        final unit="m3/kg",
+        min=0.0);
+    type LinearDensity = Real (
+        final quantity="LinearDensity",
+        final unit="kg/m",
+        min=0);
+    type SurfaceDensity = Real (
+        final quantity="SurfaceDensity",
+        final unit="kg/m2",
+        min=0);
+    type Momentum = Real (final quantity="Momentum", final unit="kg.m/s");
+    type Impulse = Real (final quantity="Impulse", final unit="N.s");
+    type AngularMomentum = Real (final quantity="AngularMomentum", final unit=
+            "kg.m2/s");
+    type AngularImpulse = Real (final quantity="AngularImpulse", final unit=
+            "N.m.s");
+    type MomentOfInertia = Real (final quantity="MomentOfInertia", final unit=
+            "kg.m2");
+    type Inertia = MomentOfInertia;
+    type Force = Real (final quantity="Force", final unit="N");
+    type TranslationalSpringConstant=Real(final quantity="TranslationalSpringConstant", final unit="N/m");
+    type TranslationalDampingConstant=Real(final quantity="TranslationalDampingConstant", final unit="N.s/m");
+    type Weight = Force;
+    type Torque = Real (final quantity="Torque", final unit="N.m");
+    type ElectricalTorqueConstant = Real(final quantity="ElectricalTorqueConstant", final unit= "N.m/A");
+    type MomentOfForce = Torque;
+    type ImpulseFlowRate = Real (final quantity="ImpulseFlowRate", final unit="N");
+    type AngularImpulseFlowRate = Real (final quantity="AngularImpulseFlowRate", final unit= "N.m");
+    type RotationalSpringConstant=Real(final quantity="RotationalSpringConstant", final unit="N.m/rad");
+    type RotationalDampingConstant=Real(final quantity="RotationalDampingConstant", final unit="N.m.s/rad");
+    type Pressure = Real (
+        final quantity="Pressure",
+        final unit="Pa",
+        displayUnit="bar");
+    type AbsolutePressure = Pressure (min=0.0, nominal = 1e5);
+    type PressureDifference = Pressure;
+    type BulkModulus = AbsolutePressure;
+    type Stress = Real (final unit="Pa");
+    type NormalStress = Stress;
+    type ShearStress = Stress;
+    type Strain = Real (final quantity="Strain", final unit="1");
+    type LinearStrain = Strain;
+    type ShearStrain = Strain;
+    type VolumeStrain = Real (final quantity="VolumeStrain", final unit="1");
+    type PoissonNumber = Real (final quantity="PoissonNumber", final unit="1");
+    type ModulusOfElasticity = Stress;
+    type ShearModulus = Stress;
+    type SecondMomentOfArea = Real (final quantity="SecondMomentOfArea", final unit=
+               "m4");
+    type SecondPolarMomentOfArea = SecondMomentOfArea;
+    type SectionModulus = Real (final quantity="SectionModulus", final unit="m3");
+    type CoefficientOfFriction = Real (final quantity="CoefficientOfFriction",
+          final unit="1");
+    type DynamicViscosity = Real (
+        final quantity="DynamicViscosity",
+        final unit="Pa.s",
+        min=0);
+    type KinematicViscosity = Real (
+        final quantity="KinematicViscosity",
+        final unit="m2/s",
+        min=0);
+    type SurfaceTension = Real (final quantity="SurfaceTension", final unit="N/m");
+    type Work = Real (final quantity="Work", final unit="J");
+    type Energy = Real (final quantity="Energy", final unit="J");
+    type EnergyDensity = Real (final quantity="EnergyDensity", final unit="J/m3");
+    type PotentialEnergy = Energy;
+    type KineticEnergy = Energy;
+    type Power = Real (final quantity="Power", final unit="W");
+    type EnergyFlowRate = Power;
+    type EnthalpyFlowRate = Real (final quantity="EnthalpyFlowRate", final unit=
+            "W");
+    type Efficiency = Real (
+        final quantity="Efficiency",
+        final unit="1",
+        min=0);
+    type MassFlowRate = Real (quantity="MassFlowRate", final unit="kg/s");
+    type VolumeFlowRate = Real (final quantity="VolumeFlowRate", final unit=
+            "m3/s");
+    // added to ISO-chapter 3
+    type MomentumFlux = Real (final quantity="MomentumFlux", final unit="N");
+    type AngularMomentumFlux = Real (final quantity="AngularMomentumFlux", final unit=
+               "N.m");
+
+    // Heat (chapter 4 of ISO 31-1992)
+    type ThermodynamicTemperature = Real (
+        final quantity="ThermodynamicTemperature",
+        final unit="K",
+        min = 0.0,
+        start = 288.15,
+        nominal = 300,
+        displayUnit="degC")
+      "Absolute temperature (use type TemperatureDifference for relative temperatures)"                   annotation(absoluteValue=true);
+    type Temp_K = ThermodynamicTemperature;
+    type Temperature = ThermodynamicTemperature;
+    type TemperatureDifference = Real (
+        final quantity="ThermodynamicTemperature",
+        final unit="K") annotation(absoluteValue=false);
+    type TemperatureSlope = Real (final quantity="TemperatureSlope",
+        final unit="K/s");
+    type LinearTemperatureCoefficient = Real(final quantity = "LinearTemperatureCoefficient", final unit="1/K");
+    type QuadraticTemperatureCoefficient = Real(final quantity = "QuadraticTemperatureCoefficient", final unit="1/K2");
+    type LinearExpansionCoefficient = Real (final quantity=
+            "LinearExpansionCoefficient", final unit="1/K");
+    type CubicExpansionCoefficient = Real (final quantity=
+            "CubicExpansionCoefficient", final unit="1/K");
+    type RelativePressureCoefficient = Real (final quantity=
+            "RelativePressureCoefficient", final unit="1/K");
+    type PressureCoefficient = Real (final quantity="PressureCoefficient", final unit=
+               "Pa/K");
+    type Compressibility = Real (final quantity="Compressibility", final unit=
+            "1/Pa");
+    type IsothermalCompressibility = Compressibility;
+    type IsentropicCompressibility = Compressibility;
+    type Heat = Real (final quantity="Energy", final unit="J");
+    type HeatFlowRate = Real (final quantity="Power", final unit="W");
+    type HeatFlux = Real (final quantity="HeatFlux", final unit="W/m2");
+    type DensityOfHeatFlowRate = Real (final quantity="DensityOfHeatFlowRate",
+          final unit="W/m2");
+    type ThermalConductivity = Real (final quantity="ThermalConductivity", final unit=
+               "W/(m.K)");
+    type CoefficientOfHeatTransfer = Real (final quantity=
+            "CoefficientOfHeatTransfer", final unit="W/(m2.K)");
+    type SurfaceCoefficientOfHeatTransfer = CoefficientOfHeatTransfer;
+    type ThermalInsulance = Real (final quantity="ThermalInsulance", final unit=
+            "m2.K/W");
+    type ThermalResistance = Real (final quantity="ThermalResistance", final unit=
+           "K/W");
+    type ThermalConductance = Real (final quantity="ThermalConductance", final unit=
+               "W/K");
+    type ThermalDiffusivity = Real (final quantity="ThermalDiffusivity", final unit=
+               "m2/s");
+    type HeatCapacity = Real (final quantity="HeatCapacity", final unit="J/K");
+    type SpecificHeatCapacity = Real (final quantity="SpecificHeatCapacity",
+          final unit="J/(kg.K)");
+    type SpecificHeatCapacityAtConstantPressure = SpecificHeatCapacity;
+    type SpecificHeatCapacityAtConstantVolume = SpecificHeatCapacity;
+    type SpecificHeatCapacityAtSaturation = SpecificHeatCapacity;
+    type RatioOfSpecificHeatCapacities = Real (final quantity=
+            "RatioOfSpecificHeatCapacities", final unit="1");
+    type IsentropicExponent = Real (final quantity="IsentropicExponent", final unit=
+               "1");
+    type Entropy = Real (final quantity="Entropy", final unit="J/K");
+    type EntropyFlowRate = Real (final quantity="EntropyFlowRate", final unit="J/(K.s)");
+    type SpecificEntropy = Real (final quantity="SpecificEntropy",
+                                 final unit="J/(kg.K)");
+    type InternalEnergy = Heat;
+    type Enthalpy = Heat;
+    type HelmholtzFreeEnergy = Heat;
+    type GibbsFreeEnergy = Heat;
+    type SpecificEnergy = Real (final quantity="SpecificEnergy",
+                                final unit="J/kg");
+    type SpecificInternalEnergy = SpecificEnergy;
+    type SpecificEnthalpy = SpecificEnergy;
+    type SpecificHelmholtzFreeEnergy = SpecificEnergy;
+    type SpecificGibbsFreeEnergy = SpecificEnergy;
+    type MassieuFunction = Real (final quantity="MassieuFunction", final unit=
+            "J/K");
+    type PlanckFunction = Real (final quantity="PlanckFunction", final unit="J/K");
+    // added to ISO-chapter 4
+    type DerDensityByEnthalpy = Real (final unit="kg.s2/m5");
+    type DerDensityByPressure = Real (final unit="s2/m2");
+    type DerDensityByTemperature = Real (final unit="kg/(m3.K)");
+    type DerEnthalpyByPressure = Real (final unit="J.m.s2/kg2");
+    type DerEnergyByDensity = Real (final unit="J.m3/kg");
+    type DerEnergyByPressure = Real (final unit="J.m.s2/kg");
+    type DerPressureByDensity = Real (final unit="Pa.m3/kg");
+    type DerPressureByTemperature = Real (final unit="Pa/K");
+
+    // Electricity and Magnetism (chapter 5 of ISO 31-1992)
+    type ElectricCurrent = Real (final quantity="ElectricCurrent", final unit="A");
+    type Current = ElectricCurrent;
+    type CurrentSlope = Real(final quantity="CurrentSlope", final unit="A/s");
+    type ElectricCharge = Real (final quantity="ElectricCharge", final unit="C");
+    type Charge = ElectricCharge;
+    type VolumeDensityOfCharge = Real (
+        final quantity="VolumeDensityOfCharge",
+        final unit="C/m3",
+        min=0);
+    type SurfaceDensityOfCharge = Real (
+        final quantity="SurfaceDensityOfCharge",
+        final unit="C/m2",
+        min=0);
+    type ElectricFieldStrength = Real (final quantity="ElectricFieldStrength",
+          final unit="V/m");
+    type ElectricPotential = Real (final quantity="ElectricPotential", final unit=
+           "V");
+    type Voltage = ElectricPotential;
+    type PotentialDifference = ElectricPotential;
+    type ElectromotiveForce = ElectricPotential;
+    type VoltageSecond = Real (final quantity="VoltageSecond", final unit="V.s")
+      "Voltage second";
+    type VoltageSlope = Real(final quantity="VoltageSlope", final unit="V/s");
+    type ElectricFluxDensity = Real (final quantity="ElectricFluxDensity", final unit=
+               "C/m2");
+    type ElectricFlux = Real (final quantity="ElectricFlux", final unit="C");
+    type Capacitance = Real (
+        final quantity="Capacitance",
+        final unit="F",
+        min=0);
+    type CapacitancePerArea =
+                Real (final quantity="CapacitancePerArea", final unit="F/m2")
+      "Capacitance per area";
+    type Permittivity = Real (
+        final quantity="Permittivity",
+        final unit="F/m",
+        min=0);
+    type PermittivityOfVacuum = Permittivity;
+    type RelativePermittivity = Real (final quantity="RelativePermittivity",
+          final unit="1");
+    type ElectricSusceptibility = Real (final quantity="ElectricSusceptibility",
+          final unit="1");
+    type ElectricPolarization = Real (final quantity="ElectricPolarization",
+          final unit="C/m2");
+    type Electrization = Real (final quantity="Electrization", final unit="V/m");
+    type ElectricDipoleMoment = Real (final quantity="ElectricDipoleMoment",
+          final unit="C.m");
+    type CurrentDensity = Real (final quantity="CurrentDensity", final unit=
+            "A/m2");
+    type LinearCurrentDensity = Real (final quantity="LinearCurrentDensity",
+          final unit="A/m");
+    type MagneticFieldStrength = Real (final quantity="MagneticFieldStrength",
+          final unit="A/m");
+    type MagneticPotential = Real (final quantity="MagneticPotential", final unit="A");
+    type MagneticPotentialDifference = Real (final quantity=
+            "MagneticPotential", final unit="A");
+    type MagnetomotiveForce = Real (final quantity="MagnetomotiveForce", final unit=
+               "A");
+    type CurrentLinkage = Real (final quantity="CurrentLinkage", final unit="A");
+    type MagneticFluxDensity = Real (final quantity="MagneticFluxDensity", final unit=
+               "T");
+    type MagneticFlux = Real (final quantity="MagneticFlux", final unit="Wb");
+    type MagneticVectorPotential = Real (final quantity="MagneticVectorPotential",
+            final unit="Wb/m");
+    type Inductance = Real (
+        final quantity="Inductance",
+        final unit="H");
+    type SelfInductance = Inductance(min=0);
+    type MutualInductance = Inductance;
+    type CouplingCoefficient = Real (final quantity="CouplingCoefficient", final unit=
+               "1");
+    type LeakageCoefficient = Real (final quantity="LeakageCoefficient", final unit=
+               "1");
+    type Permeability = Real (final quantity="Permeability", final unit="H/m");
+    type PermeabilityOfVacuum = Permeability;
+    type RelativePermeability = Real (final quantity="RelativePermeability",
+          final unit="1");
+    type MagneticSusceptibility = Real (final quantity="MagneticSusceptibility",
+          final unit="1");
+    type ElectromagneticMoment = Real (final quantity="ElectromagneticMoment",
+          final unit="A.m2");
+    type MagneticDipoleMoment = Real (final quantity="MagneticDipoleMoment",
+          final unit="Wb.m");
+    type Magnetization = Real (final quantity="Magnetization", final unit="A/m");
+    type MagneticPolarization = Real (final quantity="MagneticPolarization",
+          final unit="T");
+    type ElectromagneticEnergyDensity = Real (final quantity="EnergyDensity",
+          final unit="J/m3");
+    type PoyntingVector = Real (final quantity="PoyntingVector", final unit=
+            "W/m2");
+    type Resistance = Real (
+        final quantity="Resistance",
+        final unit="Ohm");
+    type Resistivity = Real (final quantity="Resistivity", final unit="Ohm.m");
+    type Conductivity = Real (final quantity="Conductivity", final unit="S/m");
+    type Reluctance = Real (final quantity="Reluctance", final unit="H-1");
+    type Permeance = Real (final quantity="Permeance", final unit="H");
+    type PhaseDifference = Real (
+        final quantity="Angle",
+        final unit="rad",
+        displayUnit="deg");
+    type Impedance = Resistance;
+    type ModulusOfImpedance = Resistance;
+    type Reactance = Resistance;
+    type QualityFactor = Real (final quantity="QualityFactor", final unit="1");
+    type LossAngle = Real (
+        final quantity="Angle",
+        final unit="rad",
+        displayUnit="deg");
+    type Conductance = Real (
+        final quantity="Conductance",
+        final unit="S");
+    type Admittance = Conductance;
+    type ModulusOfAdmittance = Conductance;
+    type Susceptance = Conductance;
+    type InstantaneousPower = Real (final quantity="Power", final unit="W");
+    type ActivePower = Real (final quantity="Power", final unit="W");
+    type ApparentPower = Real (final quantity="Power", final unit="VA");
+    type ReactivePower = Real (final quantity="Power", final unit="var");
+    type PowerFactor = Real (final quantity="PowerFactor", final unit="1");
+
+    // added to ISO-chapter 5
+    type Transconductance = Real (final quantity="Transconductance", final unit=
+            "A/V2");
+    type InversePotential = Real (final quantity="InversePotential", final unit=
+            "1/V");
+    type ElectricalForceConstant = Real (
+         final quantity="ElectricalForceConstant",
+         final unit = "N/A");
+
+    // Light and Related Electromagnetic Radiations (chapter 6 of ISO 31-1992)
+    type RadiantEnergy = Real (final quantity="Energy", final unit="J");
+    type RadiantEnergyDensity = Real (final quantity="EnergyDensity", final unit=
+            "J/m3");
+    type SpectralRadiantEnergyDensity = Real (final quantity=
+            "SpectralRadiantEnergyDensity", final unit="J/m4");
+    type RadiantPower = Real (final quantity="Power", final unit="W");
+    type RadiantEnergyFluenceRate = Real (final quantity=
+            "RadiantEnergyFluenceRate", final unit="W/m2");
+    type RadiantIntensity = Real (final quantity="RadiantIntensity", final unit=
+            "W/sr");
+    type Radiance = Real (final quantity="Radiance", final unit="W/(sr.m2)");
+    type RadiantExtiance = Real (final quantity="RadiantExtiance", final unit=
+            "W/m2");
+    type Irradiance = Real (final quantity="Irradiance", final unit="W/m2");
+    type Emissivity = Real (final quantity="Emissivity", final unit="1");
+    type SpectralEmissivity = Real (final quantity="SpectralEmissivity", final unit=
+               "1");
+    type DirectionalSpectralEmissivity = Real (final quantity=
+            "DirectionalSpectralEmissivity", final unit="1");
+    type LuminousIntensity = Real (final quantity="LuminousIntensity", final unit=
+           "cd");
+    type LuminousFlux = Real (final quantity="LuminousFlux", final unit="lm");
+    type QuantityOfLight = Real (final quantity="QuantityOfLight", final unit=
+            "lm.s");
+    type Luminance = Real (final quantity="Luminance", final unit="cd/m2");
+    type LuminousExitance = Real (final quantity="LuminousExitance", final unit=
+            "lm/m2");
+    type Illuminance = Real (final quantity="Illuminance", final unit="lx");
+    type LightExposure = Real (final quantity="LightExposure", final unit="lx.s");
+    type LuminousEfficacy = Real (final quantity="LuminousEfficacy", final unit=
+            "lm/W");
+    type SpectralLuminousEfficacy = Real (final quantity=
+            "SpectralLuminousEfficacy", final unit="lm/W");
+    type LuminousEfficiency = Real (final quantity="LuminousEfficiency", final unit=
+               "1");
+    type SpectralLuminousEfficiency = Real (final quantity=
+            "SpectralLuminousEfficiency", final unit="1");
+    type CIESpectralTristimulusValues = Real (final quantity=
+            "CIESpectralTristimulusValues", final unit="1");
+    type ChromaticityCoordinates = Real (final quantity="CromaticityCoordinates",
+            final unit="1");
+    type SpectralAbsorptionFactor = Real (final quantity=
+            "SpectralAbsorptionFactor", final unit="1");
+    type SpectralReflectionFactor = Real (final quantity=
+            "SpectralReflectionFactor", final unit="1");
+    type SpectralTransmissionFactor = Real (final quantity=
+            "SpectralTransmissionFactor", final unit="1");
+    type SpectralRadianceFactor = Real (final quantity="SpectralRadianceFactor",
+          final unit="1");
+    type LinearAttenuationCoefficient = Real (final quantity=
+            "AttenuationCoefficient", final unit="m-1");
+    type LinearAbsorptionCoefficient = Real (final quantity=
+            "LinearAbsorptionCoefficient", final unit="m-1");
+    type MolarAbsorptionCoefficient = Real (final quantity=
+            "MolarAbsorptionCoefficient", final unit="m2/mol");
+    type RefractiveIndex = Real (final quantity="RefractiveIndex", final unit="1");
+
+    // Acoustics (chapter 7 of ISO 31-1992)
+    type StaticPressure = AbsolutePressure;
+    type SoundPressure = StaticPressure;
+    type SoundParticleDisplacement = Real (final quantity="Length", final unit=
+            "m");
+    type SoundParticleVelocity = Real (final quantity="Velocity", final unit=
+            "m/s");
+    type SoundParticleAcceleration = Real (final quantity="Acceleration", final unit=
+               "m/s2");
+    type VelocityOfSound = Real (final quantity="Velocity", final unit="m/s");
+    type SoundEnergyDensity = Real (final quantity="EnergyDensity", final unit=
+            "J/m3");
+    type SoundPower = Real (final quantity="Power", final unit="W");
+    type SoundIntensity = Real (final quantity="SoundIntensity", final unit=
+            "W/m2");
+    type AcousticImpedance = Real (final quantity="AcousticImpedance", final unit=
+           "Pa.s/m3");
+    type SpecificAcousticImpedance = Real (final quantity=
+            "SpecificAcousticImpedance", final unit="Pa.s/m");
+    type MechanicalImpedance = Real (final quantity="MechanicalImpedance", final unit=
+               "N.s/m");
+    type SoundPressureLevel = Real (final quantity="SoundPressureLevel", final unit=
+               "dB");
+    type SoundPowerLevel = Real (final quantity="SoundPowerLevel", final unit=
+            "dB");
+    type DissipationCoefficient = Real (final quantity="DissipationCoefficient",
+          final unit="1");
+    type ReflectionCoefficient = Real (final quantity="ReflectionCoefficient",
+          final unit="1");
+    type TransmissionCoefficient = Real (final quantity="TransmissionCoefficient",
+            final unit="1");
+    type AcousticAbsorptionCoefficient = Real (final quantity=
+            "AcousticAbsorptionCoefficient", final unit="1");
+    type SoundReductionIndex = Real (final quantity="SoundReductionIndex", final unit=
+               "dB");
+    type EquivalentAbsorptionArea = Real (final quantity="Area", final unit="m2");
+    type ReverberationTime = Real (final quantity="Time", final unit="s");
+    type LoudnessLevel = Real (final quantity="LoudnessLevel", final unit=
+            "phon");
+    type Loudness = Real (final quantity="Loudness", final unit="sone");
+    type LoundnessLevel = Real (final quantity="LoundnessLevel", final unit=
+            "phon") "Obsolete type, use LoudnessLevel instead!";
+    type Loundness = Real (final quantity="Loundness", final unit="sone")
+      "Obsolete type, use Loudness instead!";
+
+    // Physical chemistry and molecular physics (chapter 8 of ISO 31-1992)
+    type RelativeAtomicMass = Real (final quantity="RelativeAtomicMass", final unit=
+               "1");
+    type RelativeMolecularMass = Real (final quantity="RelativeMolecularMass",
+          final unit="1");
+    type NumberOfMolecules = Real (final quantity="NumberOfMolecules", final unit=
+           "1");
+    type AmountOfSubstance = Real (
+        final quantity="AmountOfSubstance",
+        final unit="mol",
+        min=0);
+    type MolarMass = Real (final quantity="MolarMass", final unit="kg/mol",min=0);
+    type MolarVolume = Real (final quantity="MolarVolume", final unit="m3/mol", min=0);
+    type MolarDensity = Real (final quantity="MolarDensity", unit="mol/m3");
+    type MolarEnergy = Real (final quantity="MolarEnergy", final unit="J/mol", nominal=2e4);
+    type MolarInternalEnergy = MolarEnergy;
+    type MolarHeatCapacity = Real (final quantity="MolarHeatCapacity", final unit=
+           "J/(mol.K)");
+    type MolarEntropy = Real (final quantity="MolarEntropy", final unit=
+            "J/(mol.K)");
+    type MolarEnthalpy = MolarEnergy;
+    type MolarFlowRate = Real (final quantity="MolarFlowRate", final unit=
+            "mol/s");
+    type NumberDensityOfMolecules = Real (final quantity=
+            "NumberDensityOfMolecules", final unit="m-3");
+    type MolecularConcentration = Real (final quantity="MolecularConcentration",
+          final unit="m-3");
+    type MassConcentration = Real (final quantity="MassConcentration", final unit=
+           "kg/m3");
+    type MassFraction = Real (final quantity="MassFraction", final unit="1",
+                              min=0, max=1);
+    type Concentration = Real (final quantity="Concentration", final unit=
+            "mol/m3");
+    type VolumeFraction = Real (final quantity="VolumeFraction", final unit="1");
+    type MoleFraction = Real (final quantity="MoleFraction", final unit="1",
+                              min = 0, max = 1);
+    type ChemicalPotential = Real (final quantity="ChemicalPotential", final unit=
+           "J/mol");
+    type AbsoluteActivity = Real (final quantity="AbsoluteActivity", final unit=
+            "1");
+    type PartialPressure = AbsolutePressure;
+    type Fugacity = Real (final quantity="Fugacity", final unit="Pa");
+    type StandardAbsoluteActivity = Real (final quantity=
+            "StandardAbsoluteActivity", final unit="1");
+    type ActivityCoefficient = Real (final quantity="ActivityCoefficient", final unit=
+               "1");
+    type ActivityOfSolute = Real (final quantity="ActivityOfSolute", final unit=
+            "1");
+    type ActivityCoefficientOfSolute = Real (final quantity=
+            "ActivityCoefficientOfSolute", final unit="1");
+    type StandardAbsoluteActivityOfSolute = Real (final quantity=
+            "StandardAbsoluteActivityOfSolute", final unit="1");
+    type ActivityOfSolvent = Real (final quantity="ActivityOfSolvent", final unit=
+           "1");
+    type OsmoticCoefficientOfSolvent = Real (final quantity=
+            "OsmoticCoefficientOfSolvent", final unit="1");
+    type StandardAbsoluteActivityOfSolvent = Real (final quantity=
+            "StandardAbsoluteActivityOfSolvent", final unit="1");
+    type OsmoticPressure = Real (
+        final quantity="Pressure",
+        final unit="Pa",
+        displayUnit="bar",
+        min=0);
+    type StoichiometricNumber = Real (final quantity="StoichiometricNumber",
+          final unit="1");
+    type Affinity = Real (final quantity="Affinity", final unit="J/mol");
+    type MassOfMolecule = Real (final quantity="Mass", final unit="kg");
+    type ElectricDipoleMomentOfMolecule = Real (final quantity=
+            "ElectricDipoleMomentOfMolecule", final unit="C.m");
+    type ElectricPolarizabilityOfAMolecule = Real (final quantity=
+            "ElectricPolarizabilityOfAMolecule", final unit="C.m2/V");
+    type MicrocanonicalPartitionFunction = Real (final quantity=
+            "MicrocanonicalPartitionFunction", final unit="1");
+    type CanonicalPartitionFunction = Real (final quantity=
+            "CanonicalPartitionFunction", final unit="1");
+    type GrandCanonicalPartitionFunction = Real (final quantity=
+            "GrandCanonicalPartitionFunction", final unit="1");
+    type MolecularPartitionFunction = Real (final quantity=
+            "MolecularPartitionFunction", final unit="1");
+    type StatisticalWeight = Real (final quantity="StatisticalWeight", final unit=
+           "1");
+    type MeanFreePath = Length;
+    type DiffusionCoefficient = Real (final quantity="DiffusionCoefficient",
+          final unit="m2/s");
+    type ThermalDiffusionRatio = Real (final quantity="ThermalDiffusionRatio",
+          final unit="1");
+    type ThermalDiffusionFactor = Real (final quantity="ThermalDiffusionFactor",
+          final unit="1");
+    type ThermalDiffusionCoefficient = Real (final quantity=
+            "ThermalDiffusionCoefficient", final unit="m2/s");
+    type ElementaryCharge = Real (final quantity="ElementaryCharge", final unit=
+            "C");
+    type ChargeNumberOfIon = Real (final quantity="ChargeNumberOfIon", final unit=
+           "1");
+    type FaradayConstant = Real (final quantity="FaradayConstant", final unit=
+            "C/mol");
+    type IonicStrength = Real (final quantity="IonicStrength", final unit=
+            "mol/kg");
+    type DegreeOfDissociation = Real (final quantity="DegreeOfDissociation",
+          final unit="1");
+    type ElectrolyticConductivity = Real (final quantity=
+            "ElectrolyticConductivity", final unit="S/m");
+    type MolarConductivity = Real (final quantity="MolarConductivity", final unit=
+           "S.m2/mol");
+    type TransportNumberOfIonic = Real (final quantity="TransportNumberOfIonic",
+          final unit="1");
+
+    // Atomic and Nuclear Physics (chapter 9 of ISO 31-1992)
+    type ProtonNumber = Real (final quantity="ProtonNumber", final unit="1");
+    type NeutronNumber = Real (final quantity="NeutronNumber", final unit="1");
+    type NucleonNumber = Real (final quantity="NucleonNumber", final unit="1");
+    type AtomicMassConstant = Real (final quantity="Mass", final unit="kg");
+    type MassOfElectron = Real (final quantity="Mass", final unit="kg");
+    type MassOfProton = Real (final quantity="Mass", final unit="kg");
+    type MassOfNeutron = Real (final quantity="Mass", final unit="kg");
+    type HartreeEnergy = Real (final quantity="Energy", final unit="J");
+    type MagneticMomentOfParticle = Real (final quantity=
+            "MagneticMomentOfParticle", final unit="A.m2");
+    type BohrMagneton = MagneticMomentOfParticle;
+    type NuclearMagneton = MagneticMomentOfParticle;
+    type GyromagneticCoefficient = Real (final quantity="GyromagneticCoefficient",
+            final unit="A.m2/(J.s)");
+    type GFactorOfAtom = Real (final quantity="GFactorOfAtom", final unit="1");
+    type GFactorOfNucleus = Real (final quantity="GFactorOfNucleus", final unit=
+            "1");
+    type LarmorAngularFrequency = Real (final quantity="AngularFrequency", final unit=
+               "s-1");
+    type NuclearPrecessionAngularFrequency = Real (final quantity=
+            "AngularFrequency", final unit="s-1");
+    type CyclotronAngularFrequency = Real (final quantity="AngularFrequency",
+          final unit="s-1");
+    type NuclearQuadrupoleMoment = Real (final quantity="NuclearQuadrupoleMoment",
+            final unit="m2");
+    type NuclearRadius = Real (final quantity="Length", final unit="m");
+    type ElectronRadius = Real (final quantity="Length", final unit="m");
+    type ComptonWavelength = Real (final quantity="Length", final unit="m");
+    type MassExcess = Real (final quantity="Mass", final unit="kg");
+    type MassDefect = Real (final quantity="Mass", final unit="kg");
+    type RelativeMassExcess = Real (final quantity="RelativeMassExcess", final unit=
+               "1");
+    type RelativeMassDefect = Real (final quantity="RelativeMassDefect", final unit=
+               "1");
+    type PackingFraction = Real (final quantity="PackingFraction", final unit="1");
+    type BindingFraction = Real (final quantity="BindingFraction", final unit="1");
+    type MeanLife = Real (final quantity="Time", final unit="s");
+    type LevelWidth = Real (final quantity="LevelWidth", final unit="J");
+    type Activity = Real (final quantity="Activity", final unit="Bq");
+    type SpecificActivity = Real (final quantity="SpecificActivity", final unit=
+            "Bq/kg");
+    type DecayConstant = Real (final quantity="DecayConstant", final unit="s-1");
+    type HalfLife = Real (final quantity="Time", final unit="s");
+    type AlphaDisintegrationEnergy = Real (final quantity="Energy", final unit=
+            "J");
+    type MaximumBetaParticleEnergy = Real (final quantity="Energy", final unit=
+            "J");
+    type BetaDisintegrationEnergy = Real (final quantity="Energy", final unit="J");
+
+    // Nuclear Reactions and Ionizing Radiations (chapter 10 of ISO 31-1992)
+    type ReactionEnergy = Real (final quantity="Energy", final unit="J");
+    type ResonanceEnergy = Real (final quantity="Energy", final unit="J");
+    type CrossSection = Real (final quantity="Area", final unit="m2");
+    type TotalCrossSection = Real (final quantity="Area", final unit="m2");
+    type AngularCrossSection = Real (final quantity="AngularCrossSection", final unit=
+               "m2/sr");
+    type SpectralCrossSection = Real (final quantity="SpectralCrossSection",
+          final unit="m2/J");
+    type SpectralAngularCrossSection = Real (final quantity=
+            "SpectralAngularCrossSection", final unit="m2/(sr.J)");
+    type MacroscopicCrossSection = Real (final quantity="MacroscopicCrossSection",
+            final unit="m-1");
+    type TotalMacroscopicCrossSection = Real (final quantity=
+            "TotalMacroscopicCrossSection", final unit="m-1");
+    type ParticleFluence = Real (final quantity="ParticleFluence", final unit=
+            "m-2");
+    type ParticleFluenceRate = Real (final quantity="ParticleFluenceRate", final unit=
+               "s-1.m2");
+    type EnergyFluence = Real (final quantity="EnergyFluence", final unit="J/m2");
+    type EnergyFluenceRate = Real (final quantity="EnergyFluenceRate", final unit=
+           "W/m2");
+    type CurrentDensityOfParticles = Real (final quantity=
+            "CurrentDensityOfParticles", final unit="m-2.s-1");
+    type MassAttenuationCoefficient = Real (final quantity=
+            "MassAttenuationCoefficient", final unit="m2/kg");
+    type MolarAttenuationCoefficient = Real (final quantity=
+            "MolarAttenuationCoefficient", final unit="m2/mol");
+    type AtomicAttenuationCoefficient = Real (final quantity=
+            "AtomicAttenuationCoefficient", final unit="m2");
+    type HalfThickness = Real (final quantity="Length", final unit="m");
+    type TotalLinearStoppingPower = Real (final quantity=
+            "TotalLinearStoppingPower", final unit="J/m");
+    type TotalAtomicStoppingPower = Real (final quantity=
+            "TotalAtomicStoppingPower", final unit="J.m2");
+    type TotalMassStoppingPower = Real (final quantity="TotalMassStoppingPower",
+          final unit="J.m2/kg");
+    type MeanLinearRange = Real (final quantity="Length", final unit="m");
+    type MeanMassRange = Real (final quantity="MeanMassRange", final unit="kg/m2");
+    type LinearIonization = Real (final quantity="LinearIonization", final unit=
+            "m-1");
+    type TotalIonization = Real (final quantity="TotalIonization", final unit="1");
+    type Mobility = Real (final quantity="Mobility", final unit="m2/(V.s)");
+    type IonNumberDensity = Real (final quantity="IonNumberDensity", final unit=
+            "m-3");
+    type RecombinationCoefficient = Real (final quantity=
+            "RecombinationCoefficient", final unit="m3/s");
+    type NeutronNumberDensity = Real (final quantity="NeutronNumberDensity",
+          final unit="m-3");
+    type NeutronSpeed = Real (final quantity="Velocity", final unit="m/s");
+    type NeutronFluenceRate = Real (final quantity="NeutronFluenceRate", final unit=
+               "s-1.m-2");
+    type TotalNeutronSourceDensity = Real (final quantity=
+            "TotalNeutronSourceDesity", final unit="s-1.m-3");
+    type SlowingDownDensity = Real (final quantity="SlowingDownDensity", final unit=
+               "s-1.m-3");
+    type ResonanceEscapeProbability = Real (final quantity=
+            "ResonanceEscapeProbability", final unit="1");
+    type Lethargy = Real (final quantity="Lethargy", final unit="1");
+    type SlowingDownArea = Real (final quantity="Area", final unit="m2");
+    type DiffusionArea = Real (final quantity="Area", final unit="m2");
+    type MigrationArea = Real (final quantity="Area", final unit="m2");
+    type SlowingDownLength = Real (final quantity="SLength", final unit="m");
+    type DiffusionLength = Length;
+    type MigrationLength = Length;
+    type NeutronYieldPerFission = Real (final quantity="NeutronYieldPerFission",
+          final unit="1");
+    type NeutronYieldPerAbsorption = Real (final quantity=
+            "NeutronYieldPerAbsorption", final unit="1");
+    type FastFissionFactor = Real (final quantity="FastFissionFactor", final unit=
+           "1");
+    type ThermalUtilizationFactor = Real (final quantity=
+            "ThermalUtilizationFactor", final unit="1");
+    type NonLeakageProbability = Real (final quantity="NonLeakageProbability",
+          final unit="1");
+    type Reactivity = Real (final quantity="Reactivity", final unit="1");
+    type ReactorTimeConstant = Real (final quantity="Time", final unit="s");
+    type EnergyImparted = Real (final quantity="Energy", final unit="J");
+    type MeanEnergyImparted = Real (final quantity="Energy", final unit="J");
+    type SpecificEnergyImparted = Real (final quantity="SpecificEnergy", final unit=
+               "Gy");
+    type AbsorbedDose = Real (final quantity="AbsorbedDose", final unit="Gy");
+    type DoseEquivalent = Real (final quantity="DoseEquivalent", final unit="Sv");
+    type AbsorbedDoseRate = Real (final quantity="AbsorbedDoseRate", final unit=
+            "Gy/s");
+    type LinearEnergyTransfer = Real (final quantity="LinearEnergyTransfer",
+          final unit="J/m");
+    type Kerma = Real (final quantity="Kerma", final unit="Gy");
+    type KermaRate = Real (final quantity="KermaRate", final unit="Gy/s");
+    type MassEnergyTransferCoefficient = Real (final quantity=
+            "MassEnergyTransferCoefficient", final unit="m2/kg");
+    type Exposure = Real (final quantity="Exposure", final unit="C/kg");
+    type ExposureRate = Real (final quantity="ExposureRate", final unit=
+            "C/(kg.s)");
+
+    // chapter 11 is not defined in ISO 31-1992
+
+    // Characteristic Numbers (chapter 12 of ISO 31-1992)
+    type ReynoldsNumber = Real (final quantity="ReynoldsNumber", final unit="1");
+    type EulerNumber = Real (final quantity="EulerNumber", final unit="1");
+    type FroudeNumber = Real (final quantity="FroudeNumber", final unit="1");
+    type GrashofNumber = Real (final quantity="GrashofNumber", final unit="1");
+    type WeberNumber = Real (final quantity="WeberNumber", final unit="1");
+    type MachNumber = Real (final quantity="MachNumber", final unit="1");
+    type KnudsenNumber = Real (final quantity="KnudsenNumber", final unit="1");
+    type StrouhalNumber = Real (final quantity="StrouhalNumber", final unit="1");
+    type FourierNumber = Real (final quantity="FourierNumber", final unit="1");
+    type PecletNumber = Real (final quantity="PecletNumber", final unit="1");
+    type RayleighNumber = Real (final quantity="RayleighNumber", final unit="1");
+    type NusseltNumber = Real (final quantity="NusseltNumber", final unit="1");
+    type BiotNumber = NusseltNumber;
+    // The Biot number (Bi) is used when
+    // the Nusselt number is reserved
+    // for convective transport of heat.
+    type StantonNumber = Real (final quantity="StantonNumber", final unit="1");
+    type FourierNumberOfMassTransfer = Real (final quantity=
+            "FourierNumberOfMassTransfer", final unit="1");
+    type PecletNumberOfMassTransfer = Real (final quantity=
+            "PecletNumberOfMassTransfer", final unit="1");
+    type GrashofNumberOfMassTransfer = Real (final quantity=
+            "GrashofNumberOfMassTransfer", final unit="1");
+    type NusseltNumberOfMassTransfer = Real (final quantity=
+            "NusseltNumberOfMassTransfer", final unit="1");
+    type StantonNumberOfMassTransfer = Real (final quantity=
+            "StantonNumberOfMassTransfer", final unit="1");
+    type PrandtlNumber = Real (final quantity="PrandtlNumber", final unit="1");
+    type SchmidtNumber = Real (final quantity="SchmidtNumber", final unit="1");
+    type LewisNumber = Real (final quantity="LewisNumber", final unit="1");
+    type MagneticReynoldsNumber = Real (final quantity="MagneticReynoldsNumber",
+          final unit="1");
+    type AlfvenNumber = Real (final quantity="AlfvenNumber", final unit="1");
+    type HartmannNumber = Real (final quantity="HartmannNumber", final unit="1");
+    type CowlingNumber = Real (final quantity="CowlingNumber", final unit="1");
+
+    // Solid State Physics (chapter 13 of ISO 31-1992)
+    type BraggAngle = Angle;
+    type OrderOfReflexion = Real (final quantity="OrderOfReflexion", final unit=
+            "1");
+    type ShortRangeOrderParameter = Real (final quantity="RangeOrderParameter",
+          final unit="1");
+    type LongRangeOrderParameter = Real (final quantity="RangeOrderParameter",
+          final unit="1");
+    type DebyeWallerFactor = Real (final quantity="DebyeWallerFactor", final unit=
+           "1");
+    type CircularWavenumber = Real (final quantity="CircularWavenumber", final unit=
+               "m-1");
+    type FermiCircularWavenumber = Real (final quantity="FermiCircularWavenumber",
+            final unit="m-1");
+    type DebyeCircularWavenumber = Real (final quantity="DebyeCircularWavenumber",
+            final unit="m-1");
+    type DebyeCircularFrequency = Real (final quantity="AngularFrequency", final unit=
+               "s-1");
+    type DebyeTemperature = ThermodynamicTemperature;
+    type SpectralConcentration = Real (final quantity="SpectralConcentration",
+          final unit="s/m3");
+    type GrueneisenParameter = Real (final quantity="GrueneisenParameter", final unit=
+               "1");
+    type MadelungConstant = Real (final quantity="MadelungConstant", final unit=
+            "1");
+    type DensityOfStates = Real (final quantity="DensityOfStates", final unit=
+            "J-1/m-3");
+    type ResidualResistivity = Real (final quantity="ResidualResistivity", final unit=
+               "Ohm.m");
+    type LorenzCoefficient = Real (final quantity="LorenzCoefficient", final unit=
+           "V2/K2");
+    type HallCoefficient = Real (final quantity="HallCoefficient", final unit=
+            "m3/C");
+    type ThermoelectromotiveForce = Real (final quantity=
+            "ThermoelectromotiveForce", final unit="V");
+    type SeebeckCoefficient = Real (final quantity="SeebeckCoefficient", final unit=
+               "V/K");
+    type PeltierCoefficient = Real (final quantity="PeltierCoefficient", final unit=
+               "V");
+    type ThomsonCoefficient = Real (final quantity="ThomsonCoefficient", final unit=
+               "V/K");
+    type RichardsonConstant = Real (final quantity="RichardsonConstant", final unit=
+               "A/(m2.K2)");
+    type FermiEnergy = Real (final quantity="Energy", final unit="eV");
+    type GapEnergy = Real (final quantity="Energy", final unit="eV");
+    type DonorIonizationEnergy = Real (final quantity="Energy", final unit="eV");
+    type AcceptorIonizationEnergy = Real (final quantity="Energy", final unit=
+            "eV");
+    type ActivationEnergy = Real (final quantity="Energy", final unit="eV");
+    type FermiTemperature = ThermodynamicTemperature;
+    type ElectronNumberDensity = Real (final quantity="ElectronNumberDensity",
+          final unit="m-3");
+    type HoleNumberDensity = Real (final quantity="HoleNumberDensity", final unit=
+           "m-3");
+    type IntrinsicNumberDensity = Real (final quantity="IntrinsicNumberDensity",
+          final unit="m-3");
+    type DonorNumberDensity = Real (final quantity="DonorNumberDensity", final unit=
+               "m-3");
+    type AcceptorNumberDensity = Real (final quantity="AcceptorNumberDensity",
+          final unit="m-3");
+    type EffectiveMass = Mass;
+    type MobilityRatio = Real (final quantity="MobilityRatio", final unit="1");
+    type RelaxationTime = Time;
+    type CarrierLifeTime = Time;
+    type ExchangeIntegral = Real (final quantity="Energy", final unit="eV");
+    type CurieTemperature = ThermodynamicTemperature;
+    type NeelTemperature = ThermodynamicTemperature;
+    type LondonPenetrationDepth = Length;
+    type CoherenceLength = Length;
+    type LandauGinzburgParameter = Real (final quantity="LandauGinzburgParameter",
+            final unit="1");
+    type FluxiodQuantum = Real (final quantity="FluxiodQuantum", final unit="Wb");
+
+    type TimeAging = Real (final quantity="1/Modelica.SIunits.Time",final unit="1/s");
+    type ChargeAging = Real (final quantity="1/Modelica.SIunits.ElectricCharge",final unit="1/(A.s)");
+
+   // Other types not defined in ISO 31-1992
+    type PerUnit = Real(unit = "1");
+    type DimensionlessRatio = Real(unit = "1");
+
+   // Complex types for electrical systems (not defined in ISO 31-1992)
+    operator record ComplexCurrent =
+      Complex(redeclare ThermoSysPro.Units.SI.Current re,
+               redeclare ThermoSysPro.Units.SI.Current im)
+      "Complex electrical current";
+    operator record ComplexCurrentSlope =
+      Complex(redeclare ThermoSysPro.Units.SI.CurrentSlope re,
+               redeclare ThermoSysPro.Units.SI.CurrentSlope im)
+      "Complex current slope";
+    operator record ComplexCurrentDensity =
+      Complex(redeclare ThermoSysPro.Units.SI.CurrentDensity re,
+               redeclare ThermoSysPro.Units.SI.CurrentDensity im)
+      "Complex electrical current density";
+    operator record ComplexElectricPotential =
+      Complex(redeclare ThermoSysPro.Units.SI.ElectricPotential re,
+               redeclare ThermoSysPro.Units.SI.ElectricPotential im)
+      "Complex electric potential";
+    operator record ComplexPotentialDifference =
+      Complex(redeclare ThermoSysPro.Units.SI.PotentialDifference re,
+               redeclare ThermoSysPro.Units.SI.PotentialDifference im)
+      "Complex electric potential difference";
+    operator record ComplexVoltage =
+      Complex(redeclare ThermoSysPro.Units.SI.Voltage re,
+               redeclare ThermoSysPro.Units.SI.Voltage im)
+      "Complex electrical voltage";
+    operator record ComplexVoltageSlope =
+      Complex(redeclare ThermoSysPro.Units.SI.VoltageSlope re,
+               redeclare ThermoSysPro.Units.SI.VoltageSlope im)
+      "Complex voltage slope";
+    operator record ComplexElectricFieldStrength =
+      Complex(redeclare ThermoSysPro.Units.SI.ElectricFieldStrength re,
+               redeclare ThermoSysPro.Units.SI.ElectricFieldStrength im)
+      "Complex electric field strength";
+    operator record ComplexElectricFluxDensity =
+      Complex(redeclare ThermoSysPro.Units.SI.ElectricFluxDensity re,
+               redeclare ThermoSysPro.Units.SI.ElectricFluxDensity im)
+      "Complex electric flux density";
+    operator record ComplexElectricFlux =
+      Complex(redeclare ThermoSysPro.Units.SI.ElectricFlux re,
+               redeclare ThermoSysPro.Units.SI.ElectricFlux im)
+      "Complex electric flux";
+    operator record ComplexMagneticFieldStrength =
+      Complex(redeclare ThermoSysPro.Units.SI.MagneticFieldStrength re,
+               redeclare ThermoSysPro.Units.SI.MagneticFieldStrength im)
+      "Complex magnetic field strength";
+    operator record ComplexMagneticPotential =
+      Complex(redeclare ThermoSysPro.Units.SI.MagneticPotential re,
+               redeclare ThermoSysPro.Units.SI.MagneticPotential im)
+      "Complex magnetic potential";
+    operator record ComplexMagneticPotentialDifference =
+      Complex(redeclare ThermoSysPro.Units.SI.MagneticPotentialDifference re,
+               redeclare ThermoSysPro.Units.SI.MagneticPotentialDifference im)
+      "Complex magnetic potential difference";
+    operator record ComplexMagnetomotiveForce =
+      Complex(redeclare ThermoSysPro.Units.SI.MagnetomotiveForce re,
+               redeclare ThermoSysPro.Units.SI.MagnetomotiveForce im)
+      "Complex magneto motive force";
+    operator record ComplexMagneticFluxDensity =
+      Complex(redeclare ThermoSysPro.Units.SI.MagneticFluxDensity re,
+               redeclare ThermoSysPro.Units.SI.MagneticFluxDensity im)
+      "Complex magnetic flux density";
+    operator record ComplexMagneticFlux =
+      Complex(redeclare ThermoSysPro.Units.SI.MagneticFlux re,
+               redeclare ThermoSysPro.Units.SI.MagneticFlux im)
+      "Complex magnetic flux";
+    operator record ComplexReluctance =
+      Complex(redeclare ThermoSysPro.Units.SI.Reluctance re,
+               redeclare ThermoSysPro.Units.SI.Reluctance im)
+                                                         "Complex reluctance"
+      annotation (Documentation(info="<html>
+<p>
+Since magnetic material properties like reluctance and permeance often are anisotropic resp. salient,
+a special operator instead of multiplication (compare: tensor vs. vector) is required.
+<a href=\"modelica://Modelica.Magnetic.FundamentalWave\">Modelica.Magnetic.FundamentalWave</a> uses a
+special record <a href=\"modelica://Modelica.Magnetic.FundamentalWave.Types.Salient\">Salient</a>
+which is only valid in the rotor-fixed coordinate system.
+</p>
+<p>
+<b>Note:</b> To avoid confusion, no magnetic material properties should be defined as Complex units.
+</p>
+</html>"));
+    operator record ComplexImpedance =
+      Complex(redeclare Resistance re,
+               redeclare Reactance im) "Complex electrical impedance";
+    operator record ComplexAdmittance =
+      Complex(redeclare Conductance re,
+               redeclare Susceptance im) "Complex electrical admittance";
+    operator record ComplexPower =
+      Complex(redeclare ActivePower re,
+               redeclare ReactivePower im) "Complex electrical power";
+    annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
+              -100},{100,100}}), graphics={
+          Line(
+            points={{-66,78},{-66,-40}},
+            color={64,64,64}),
+          Ellipse(
+            extent={{12,36},{68,-38}},
+            lineColor={64,64,64},
+            fillColor={175,175,175},
+            fillPattern=FillPattern.Solid),
+          Rectangle(
+            extent={{-74,78},{-66,-40}},
+            lineColor={64,64,64},
+            fillColor={175,175,175},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-66,-4},{-66,6},{-16,56},{-16,46},{-66,-4}},
+            lineColor={64,64,64},
+            fillColor={175,175,175},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{-46,16},{-40,22},{-2,-40},{-10,-40},{-46,16}},
+            lineColor={64,64,64},
+            fillColor={175,175,175},
+            fillPattern=FillPattern.Solid),
+          Ellipse(
+            extent={{22,26},{58,-28}},
+            lineColor={64,64,64},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.Solid),
+          Polygon(
+            points={{68,2},{68,-46},{64,-60},{58,-68},{48,-72},{18,-72},{18,-64},
+                {46,-64},{54,-60},{58,-54},{60,-46},{60,-26},{64,-20},{68,-6},{68,
+                2}},
+            lineColor={64,64,64},
+            smooth=Smooth.Bezier,
+            fillColor={175,175,175},
+            fillPattern=FillPattern.Solid)}), Documentation(info="<html>
+<p>This package provides predefined types, such as <i>Mass</i>, <i>Angle</i>, <i>Time</i>, based on the international standard on units, e.g., </p>
+<p><code>   <b>type</b> Angle = Real(<b>final</b> quantity = &quot;Angle&quot;,</code></p>
+<p><code>                     <b>final</b> unit     = &quot;rad&quot;,</code></p>
+<p><code>                     displayUnit    = &quot;deg&quot;);</code> </p>
+<p><br>Copyright &copy; 1998-2016, Modelica Association and DLR. </p>
+<p>This package is copied from package Modelica.SIunits in Modelica package version 3.2.2.</p>
+</html>",   revisions="<html>
+<ul>
+<li><i>May 25, 2011</i> by Stefan Wischhusen:<br/>Added molar units for energy and enthalpy.</li>
+<li><i>Jan. 27, 2010</i> by Christian Kral:<br/>Added complex units.</li>
+<li><i>Dec. 14, 2005</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Add User&#39;;s Guide and removed &quot;min&quot; values for Resistance and Conductance.</li>
+<li><i>October 21, 2002</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> and Christian Schweiger:<br/>Added new package <b>Conversions</b>. Corrected typo <i>Wavelenght</i>.</li>
+<li><i>June 6, 2000</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Introduced the following new types<br/>type Temperature = ThermodynamicTemperature;<br/>types DerDensityByEnthalpy, DerDensityByPressure, DerDensityByTemperature, DerEnthalpyByPressure, DerEnergyByDensity, DerEnergyByPressure<br/>Attribute &quot;final&quot; removed from min and max values in order that these values can still be changed to narrow the allowed range of values.<br/>Quantity=&quot;Stress&quot; removed from type &quot;Stress&quot;, in order that a type &quot;Stress&quot; can be connected to a type &quot;Pressure&quot;.</li>
+<li><i>Oct. 27, 1999</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>New types due to electrical library: Transconductance, InversePotential, Damping.</li>
+<li><i>Sept. 18, 1999</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Renamed from SIunit to SIunits. Subpackages expanded, i.e., the SIunits package, does no longer contain subpackages.</li>
+<li><i>Aug 12, 1999</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Type &quot;Pressure&quot; renamed to &quot;AbsolutePressure&quot; and introduced a new type &quot;Pressure&quot; which does not contain a minimum of zero in order to allow convenient handling of relative pressure. Redefined BulkModulus as an alias to AbsolutePressure instead of Stress, since needed in hydraulics.</li>
+<li><i>June 29, 1999</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br/>Bug-fix: Double definition of &quot;Compressibility&quot; removed and appropriate &quot;extends Heat&quot; clause introduced in package SolidStatePhysics to incorporate ThermodynamicTemperature.</li>
+<li><i>April 8, 1998</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> and Astrid Jaschinski:<br/>Complete ISO 31 chapters realized.</li>
+<li><i>Nov. 15, 1997</i> by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> and Hubertus Tummescheit:<br/>Some chapters realized.</li>
+</ul>
+</html>"));
+  end SI;
+
+  package nonSI
+    type Time_minute = Real(final quantity="Time", final unit="min");
+    type Angle_deg =  Real (final quantity="Angle", final unit="deg") annotation (
+       Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+    type AngularVelocity_rpm = Real (final quantity="Angular velocity", final unit="rev/min") annotation (Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+    type Temperature_degC =   Real (final quantity="ThermodynamicTemperature", final unit=
+                                                                                        "degC")
+       annotation (Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+    type Pressure_bar = Real (final quantity="Pressure", final unit="bar");
+    type Power_kW = Real(final quantity="Power", final unit="kW");
+    type Power_MW = Real(final quantity="Power", final unit="MW");
+    type VolumeFlowRate_m3h = Real(final quantity="VolumeFlowRate", final unit="m3/h");
+  end nonSI;
+
+  package xSI "Additional SI units"
+    type PressureLossCoefficient =Real (final quantity="Pressure loss coefficient", final unit="m-4")
+                                                                annotation (
+        Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+    type DerDensityByEnthalpy = Real (final unit="kg2/(m3.J)");
+    type DerDensityByEntropy = Real (final quantity="DerDensityByEntropy", final unit=
+               "kg2.K/(m3.J)");
+    type DerEnergyByTemperature = Real (final quantity="Derivative of the specific energy wrt. the temperature", final unit=
+                                                                                                    "J/(kg.K)")
+      annotation (Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+    type DerEnergyByPressure = Real (final quantity="DerEnergyByPressure", final unit=
+               "J/Pa");
+    type DerEntropyByTemperature = Real (final quantity="DerEntropyByTemperature",
+           final unit="J/K2");
+    type DerEntropyByPressure = Real (final quantity="DerEntropyByPressure",
+          final unit="J/(K.Pa)");
+    type DerPressureByDensity = Real (final quantity="DerPressureByDensity",
+          final unit="Pa.m3/kg");
+    type DerPressureBySpecificVolume = Real (final quantity=
+            "DerPressureBySpecificVolume", final unit="Pa.kg/m3");
+    type DerPressureByTemperature = Real (final quantity=
+            "DerPressureByTemperature", final unit="Pa/K");
+    type DerVolumeByTemperature = Real (final quantity="DerVolumeByTemperature",
+          final unit="m3/K");
+    type DerVolumeByPressure = Real (final quantity="DerVolumeByPressure", final unit=
+               "m3/Pa");
+    type Cv = Real (final quantity="Cv U.S.", final unit="m4/(s.N5)")
+                                                                    annotation (
+        Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+    type SonicConductance = Real (final quantity="Sonic conductance", final unit="m3/(s.Pa)")
+                                                                annotation (
+        Documentation(info="<html>
+<p><b>Version 1.0</b></p>
+</HTML>
+"));
+    type IdealGasConstant = Real (final quantity="Ideal gas constant", final unit="J/(kg.K)");
+    type ViscousFriction = Real (final quantity="Viscous friction", final unit="N/(m/s)");
+  end xSI;
+  annotation (
+    Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}),
+    Documentation(info="<html>
+</html>"));
+
+end Units;
diff --git a/ThermoSysPro/UsersGuide.mo b/ThermoSysPro/UsersGuide.mo
index 426f27f9772969de0022ac558f4cfbf51a3c0c8d..ad1443bbeb134876dad7f08e6e9df48a38f376ef 100644
--- a/ThermoSysPro/UsersGuide.mo
+++ b/ThermoSysPro/UsersGuide.mo
@@ -1,1256 +1,1256 @@
-within ThermoSysPro;
-package UsersGuide "ThermoSysPro Licence and Users Guide"
-
-  class ReleaseNotes "Release notes"
-
-  class Version_2_0 "Version 2.0"
-
-      annotation (Documentation(info="<html>
-<h3><font color=\"#008000\">Version 2.0 (January 24, 2011)</font></h3>
-<p> This is the first open source release of the library.
-</p>
-</html>
-"), Icon(graphics={
-          Ellipse(
-            lineColor={75,138,73},
-            fillColor={75,138,73},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-100.0,-100.0},{100.0,100.0}}),
-          Polygon(origin={-4.167,-15.0},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-            smooth=Smooth.Bezier),
-          Ellipse(origin={7.5,56.5},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-12.5,-12.5},{12.5,12.5}})}));
-  end Version_2_0;
-
-  class Version_3_0 "Version 3.0"
-
-      annotation (Documentation(info="<html>
-<p><b><span style=\"font-size: 10pt; color: #008000;\">Version 3.0 (December 20, 2011)</span></b></p>
-<p align=\"center\"><b><span style=\"font-size: 16pt;\">ThermoSysPro modifications from version 2.0</span></b> </p>
-<p>Analytic jacobian is added to the library.</p>
-<p>The examples package is added to the library.</p>
-<p>Other modifications:</p>
-<ul>
-<li>Component MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Introduction of two new parameters z1 and z2 </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of parameters TwoPhaseFlowPipe.z1, and TwoPhaseFlowPipe.z2. Old values z1 = 0 and z2 = 0. New values z1 = z1 and z2 = z2. </p>
-<ul>
-<li>Package Units </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit AbsoluteTemperature </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit DifferentialTemperature </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit&nbsp; AbsolutePressure </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit DifferentialPressure </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit SpecificEnthalpy </p>
-<ul>
-<li>Component&nbsp; ElectroMechanics.Machines.SynchronousMotor </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter permanent_meca changed to steady_stae_mech </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter Coupleur changed to mech_coupling </p>
-<ul>
-<li>Component&nbsp; ElectroMechanics.Machines.Shaft </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter permanent_meca changed to steady_state_mech </p>
-<ul>
-<li>Package Properties.WaterSteam.IF97_packages </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New IF97 package with analytic jacobian </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Removal of the old IF97 package </p>
-<ul>
-<li>Function IF97.SplineUtilities.Modelica_Interpolation.Bspline1D.parametrization </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">arccos changed to acos </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.CheckValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding modifier (start=false, fixed=true) for variables touvert and tferme. </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.IdealCheckValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding modifier (start=false, fixed=true) for variables touvert and tferme. </p>
-<ul>
-<li>Component FlueGases.PressureLosses.CheckValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding modifier (start=false, fixed=true) for variables touvert and tferme. </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding a default value to parameter T0 </p>
-<ul>
-<li>Package Functions </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothStep </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothSign </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothAbs </p>
-<ul>
-<li>Component WaterSteam.Machines.DynamicCentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Use of function SmoothSign for computation of Cf. </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter continuous_flow_reversal </p>
-<ul>
-<li>Component WaterSteam.Machines.StaticCentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter continuous_flow_reversal </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Removing input commandePompe </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Input VRotation changed to rpm_or_mpower </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter MPower </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter fixed_rot_or_power </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Efficiency characteristics rh=a*Qv^2/R^2 + b*Qv/R + c changed to rh=a*Qv*abs(Qv)/R^2+b*Qv/R+c to ensure convergence for fixed mechanical power </p>
-<ul>
-<li>Component<span style=\"color: #ff0000;\"> </span>WaterSteam.PressureLoses.LumpedStraightPipe &lt;====== </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of default value of parameter rugosrel. Old value: 0, new value 0.0001. </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding initial equation:&nbsp; der(Q) = 0 </p>
-<ul>
-<li>Component WaterSteam.Volumes.TwoPhaseVolume </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Property prol is computed at pressure (P + Pfond)/2 instead of P. </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter dpfCorr </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter hcCorr </p>
-<ul>
-<li>Component WaterSteam.HeatExchanger.DynamicTwoPhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter dpfCorr </p>
-<ul>
-<li>Component Thermal.HeatTransfer.HeatExchangerWall </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Wall 1 becomes the internal wall </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Wall 2 becomes the external wall </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Heat flux through external wall is corrected </p>
-<ul>
-<li>Component WaterSteam.HeatExchanger. StaticWaterWaterExchangerDTorWorEff </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of the power equation for case exchanger_type = 3. </p>
-<ul>
-<li>Component WaterSteam.HeatExchanger.TemperatureWallBoiler </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of some parameter default values </p>
-<ul>
-<li>Function Correlations.PressureLosses.WBWaterSteamPressureLosses </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">b0 is bounded to 0.01 </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Gm^2 is replaced by Gm*abs(Gm) </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding equation dpa := 0. </p>
-<ul>
-<li>Function Properties.WaterSteam.BaseIF97.Basic.psat </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Calls to LogVariable removed. </p>
-<ul>
-<li>Component Combustion.BoundaryConditions.FuelSourcePQ </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Handling of input signals corrected. </p>
-<ul>
-<li>Component MultiFluid.HeatExchangers.NTUTechnologicalExchangerWaterSteamFlueGases </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of computation of variable mono. </p>
-<ul>
-<li>Component WaterSteam.Machines.StodolaTurbine </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of default value for parameter Qmax. Old Value=15, new value=1. </p>
-<ul>
-<li>Function Correlation.Thermal.WBInternalHeatTransferCoefficient </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function. </p>
-<ul>
-<li>Component WaterSteamHeatExchangers.TemperatureWallBoiler </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Call to WBInternalHeatTransferCoefficient instead of separate calls to WBInternalOnePhaseFlowHeatTransferCoefficient and WBInternalTwoPhaseFlowHeatTransferCoefficient </p>
-<ul>
-<li>Component WaterSteam.Junctions.Mixer3 </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Bug correction: flow from port Ce3 added in mass balance and energy balance equations. </p>
-<ul>
-<li>Component WaterSteam.BoundaryConditions.RefQ </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of default value for Q0. Old value=1.e5. New value=10. </p>
-<ul>
-<li>Component WaterSteam.Junctions.StaticDrum </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of comment for parameter x </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding thermal connector Cth and variable T </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of energy balance equation to take into account external energy supply. </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding equation Cth.T = T; </p>
-<ul>
-<li>Package Thermal.BoundaryConditions </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component HeatSink </p>
-<ul>
-<li>Package WaterSteam.BoundaryConditions </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New components PlugA, PlugB </p>
-<ul>
-<li>Component InstrumentationAndControl.Blocks.Tables.Table1D </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Dymola specific function Interpolate is replaced by ThermoSysPro.Functions.LinearInterpolation. </p>
-<ul>
-<li>Component InstrumentationAndControl.Blocks.Tables.Table1DTemps </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Dymola specific function Interpolate is replaced by ThermoSysPro.Functions.LinearInterpolation. </p>
-<ul>
-<li>Function Functions.LinearInterpolation </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Output DeltaYX is removed. </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function calls Functions.LinearInterpolation_i, which returns DelTaXY. </p>
-<ul>
-<li>Function Functions.TableLinearInterpolation </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Outputs DeltaYX and DeltaYP are removed. </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function calls Functions.TableLinearInterpolation_i, which returns DelTaXY and DeltaYP. </p>
-<ul>
-<li>Function Correlations.Misc..WBCorrectiveDiameterCoefficient </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unused variables Z1, Z2 are removed. </p>
-<ul>
-<li>Function Correlations.Thermal.WBCrossedCurrentConvectiveHeatTranferCoefficient </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unused variables Z1, Z2 are removed. </p>
-<ul>
-<li>Function Correlations.Thermal.WBLongitudinalCurrentConvectiveHeatTranferCoefficient </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unused variables Z1, Z2 are removed. </p>
-<ul>
-<li>Function Correlations.Thermal.WBRadiativeHeatTranferCoefficient </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unused variables Z1, Z2, Z3, Z4 are removed. </p>
-<ul>
-<li>Component WaterSteam.Machines.SteamEngine </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.ControlValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.DynamicCheckValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.DynamicReliefValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
-<ul>
-<li>Component FlueGases.PressureLosses.ControlValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
-<ul>
-<li>Package Functions </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is removed. One should use function LinearInterpolation instead. </p>
-<ul>
-<li>Package Units </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unit RotationVelocity renamed to AngularVelocity_rpm </p>
-</html>"), Icon(graphics={
-          Ellipse(
-            lineColor={75,138,73},
-            fillColor={75,138,73},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-100.0,-100.0},{100.0,100.0}}),
-          Polygon(origin={-4.167,-15.0},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-            smooth=Smooth.Bezier),
-          Ellipse(origin={7.5,56.5},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-12.5,-12.5},{12.5,12.5}})}));
-  end Version_3_0;
-
-  class Version_3_1 "Version 3.1"
-
-      annotation (Documentation(info="<html>
-<p><b><span style=\"font-size: 10pt; color: #008000;\">Version 3.1 (June 12, 2014)</span></b> </p>
-<p align=\"center\"><b><span style=\"font-size: 16pt;\">ThermoSysPro modifications from version 3.0</span></b> </p>
-<p>&nbsp; </p>
-<ul>
-<li>Component ElectroMechanics.BoundaryConditions.SourceMechanicalPower </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation M.Ctr*abs(M.w) = IPower.signal is replaced by M.Ctr*M.w = IPower.signal </p>
-<ul>
-<li>Package ElectroMechanics.BoundaryConditions </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SourceAngularVelocity </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SourceTorque </p>
-<ul>
-<li>Package Function </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothMax </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothMin </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothCond </p>
-<ul>
-<li>Package WaterSteam.Machines </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component CentrifugalPump, replaces old components DynamicCentrifugalPump and StaticCentrifugalPump. </p>
-<ul>
-<li>Component WaterSteam.Machines.DynamicCentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Obsolete component, replaced by component CentrifugalPump </p>
-<ul>
-<li>Component WaterSteam.Machines.StaticCentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Obsolete component, replaced by component CentrifugalPump </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter dynamic_energy_balance is removed </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter dynamic_energy_balance is removed </p>
-<ul>
-<li>Function Properties.CH3F5.CH3F5_Ps </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of x for one-phase flow (liquid or vapor) </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.SimpleDynamicCondenser </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of Wout </p>
-<ul>
-<li>Component WaterSteam.Volumes.TwoPhaseVolume </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction: Cl.a = true (instead of Cl.b = true) </p>
-<ul>
-<li>Component FlueGases.HeatExchangers. StaticWallFlueGasesExchanger </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of dW[i] </p>
-<ul>
-<li>Component WaterSteam.Junctions.SteamDryer </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the mass balance equations </p>
-<ul>
-<li>Component Combustion.CombustionChambers.GenericCombustionChamber </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of HFuel </p>
-<ul>
-<li>Component Combustion.CombustionChambers.GTCombustionChamber </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of HFuel </p>
-<ul>
-<li>Component WaterSteam.Volumes.Tank </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter k is replaced by parameters ke1, ke2, ks1, ks2. </p>
-<ul>
-<li>Function Functions. LinearInterpolation_i </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of Y </p>
-<ul>
-<li>Package Units </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unit SpecificEnthalpy removed </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unit AbsolutePressure removed </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unit AbsoluteTemperature removed </p>
-<ul>
-<li>Package WaterSteam.HeatExchangers </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicWaterHeating </p>
-<ul>
-<li>Package WaterSteam.Volumes </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component TwoPhaseCavity </p>
-<ul>
-<li>Component FlueGases.Volumes.VolumeATh </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modifier stateSelect removed </p>
-<ul>
-<li>Component FlueGases.Volumes.VolumeBTh </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modifier stateSelect removed </p>
-<ul>
-<li>Component FlueGases.Volumes.VolumeCTh </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modifier stateSelect removed </p>
-<ul>
-<li>Component FlueGases.Volumes.VolumeDTh </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modifier stateSelect removed </p>
-<ul>
-<li>Component WaterSteam.Machines.Compressor </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">xm is bounded by min value 0.01 (to avoid division by zero in case fluid is water, which should not happen in a compressor). </p>
-<ul>
-<li>Component FlueGases.PressureLosses.SingularPressureLoss </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Default value for parameter K changed to 1.e-3. </p>
-<ul>
-<li>Component WaterSteam.Machines.StodolaTurbine </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Extension of the computation of xm and Q for supercritical regimes. </p>
-<ul>
-<li>Component WaterSteam.Boilers.ElectricBoiler </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of deltaH. </p>
-<ul>
-<li>Component WaterSteam.Machines.StaticCentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Value of rh is changed. Old value: 0.05 - New value: 0.20 </p>
-<ul>
-<li>Component WaterSolution.Machines.StaticCentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Value of rh is changed. Old value: 0.05 - New value: 0.20 </p>
-<ul>
-<li>Component FlueGases.Machines.StaticFan </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Value of rh is changed. Old value: 0.05 - New value: 0.20 </p>
-<ul>
-<li>Package Functions </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New functions SplineInterpolation and TableSplineInterpolation </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package Utilities </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function LinearInterpolation_i&nbsp; moved to Functions.Utilities </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function TableLinearInterpolation_i&nbsp; moved to Functions.Utilities </p>
-<ul>
-<li>Package Functions.Utilities </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function CubicHermite </p>
-<ul>
-<li>Block InstrumentationAndControl.Blocks.Table.Table1D </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Block InstrumentationAndControl.Blocks.Table.Table1DTemps </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Block InstrumentationAndControl.Blocks.Table.Table2D </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Component WaterSteam.Machines.CentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Linear interpolation of F and G is replaced by spline interpolation </p>
-<ul>
-<li>Component FlueGases.PressureLosses.ControlValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.ControlValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.DynamicCheckValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.DynamicReliefValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Component WaterSteam.Machines.SteamEngine </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Function Correlation.Misc.WBCorrectiveDiameterCoefficient </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Function Correlation.Thermal. WBCrossedCurrentConvectiveHeatTransferCoefficient </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Function Correlation.Thermal. WBLongitudinalCurrentConvectiveHeatTransferCoefficient </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Function Correlation.Thermal. WBRadiativeHeatTransferCoefficient </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.TwoPhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding noEvent for the computation of hi and Xtt </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Extension of the computation of hc for laminar flows </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicWaterWaterExchanger </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of the computation of DPc and DPf. Previous&nbsp; version: DPc[i] = p_Kc*Qc[i]^2/(2*rhoc[i]); DPf[i] = p_Kf*Qf[i]^2/(2*rhof[i]); New version: DPc[i] = p_Kc*Qc[i]^2/rhoc[i]; DPf[i] = p_Kf*Qf[i]^2/rhof[i]; </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.StaticWaterWaterExchanger </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of the computation of DPc and DPf. Previous&nbsp; version: DPc[i] = p_Kc*Qc[i]^2/(2*rhoc[i]); DPf[i] = p_Kf*Qf[i]^2/(2*rhof[i]); New version: DPc[i] = p_Kc*Qc[i]^2/rhoc[i]; DPf[i] = p_Kf*Qf[i]^2/rhof[i]; </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.NTUWaterHeating </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of the value of eps. Previous value:&nbsp; 1. New value: 1.e-3. </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adaptation to the supercritical phase </p>
-<ul>
-<li>Package WaterSteam.HeatExchangers </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicWaterHeatingOnePipe </p>
-<ul>
-<li>Package Thermal.HeatTransfer </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component HeatExchangerWallCounterFlow </p>
-<ul>
-<li>Package Properties </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package MoltenSalt </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package Oil_TherminolVP1 </p>
-<ul>
-<li>Component WaterSteam.Machines.StodolaTurbine </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation xm = if noEvent(Ps &gt; pcrit) then 1 else (1 + pros1.x)/2; is replaced by xm = 1; </p>
-<ul>
-<li>Component WaterSteam.Volumes.Tank </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter dynamic_mass_balance </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New equation A*(pro.ddph*der(P) + pro.ddhp*der(h))*z + A*rho*der(z) = BQ; when dynamic_mass_balance = true </p>
-</html>"), Icon(graphics={
-          Ellipse(
-            lineColor={75,138,73},
-            fillColor={75,138,73},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-100.0,-100.0},{100.0,100.0}}),
-          Polygon(origin={-4.167,-15.0},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-            smooth=Smooth.Bezier),
-          Ellipse(origin={7.5,56.5},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-12.5,-12.5},{12.5,12.5}})}));
-  end Version_3_1;
-
-  class Version_3_2 "Version 3.2"
-
-      annotation (Documentation(info="<html>
-<p><b><span style=\"font-size: 10pt; color: #008000;\">Version 3.2 (August 5, 2020)</span></b> </p>
-<p align=\"center\"><b><span style=\"font-size: 16pt;\">ThermoSysPro modifications from version 3.1</span></b></p>
-<p>&nbsp; </p>
-<ul>
-<li>Package Correlations </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New Function Misc.Function_FM </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New Function Thermal.Function_U1 </p>
-<ul>
-<li>Component FlueGases.HeatExchangers.StaticFluegasesFluegasesExchangerKS </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Introduction of connector&nbsp; InputReal Kcorr and variable Kcor </p>
-<ul>
-<li>Components FlueGases.Volumes.VolumesATh; VolumesBTh; VolumesCTh and VolumesDTh </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New&nbsp; parameters&nbsp;hr, Xco20, Xh2o0, Xo20, Xso20 </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Initial section is modified to replace state variable T with state variable h. </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P,&nbsp;T,&nbsp;Xco2,&nbsp;Xh2o,&nbsp;Xo2,&nbsp;Xso2)*der(P) +&nbsp;ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P,&nbsp;T,&nbsp;Xco2,&nbsp;Xh2o,&nbsp;Xo2,&nbsp;Xso2)*cp*der(T))&nbsp;=&nbsp;BQ; is replaced by&nbsp;V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P,&nbsp;T,&nbsp;Xco2,&nbsp;Xh2o,&nbsp;Xo2,&nbsp;Xso2)*der(P) +&nbsp;ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P,&nbsp;T,&nbsp;Xco2,&nbsp;Xh2o,&nbsp;Xo2,&nbsp;Xso2)*der(h&nbsp;-&nbsp;Xh2o*hr))&nbsp;=&nbsp;BQ; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation V*((h*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P) + (h*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*cp*der(T)) = BH; is replaced by&nbsp; V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P) + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH; </p>
-<ul>
-<li>Component FlueGases.Volumes.VolumesATh&nbsp; and VolumesBTh </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;BH&nbsp;=&nbsp;Ce1.Q*he1 + Ce2.Q*he2 - Cs1.Q*hs1 - Cs2.Q*hs2 + Cth.W; &nbsp;is replaced by&nbsp; BH&nbsp;=&nbsp;Ce1.Q*(he1&nbsp;-&nbsp;Ce1.Xh2o*hr)&nbsp;+&nbsp;Ce2.Q*(he2&nbsp;-&nbsp;Ce2.Xh2o*hr)&nbsp;-&nbsp;Cs1.Q*(hs1&nbsp;-&nbsp;Cs1.Xh2o*hr)&nbsp;-&nbsp;Cs2.Q*(hs2&nbsp;-&nbsp;Cs2.Xh2o*hr)&nbsp;+&nbsp;Cth.W; </p>
-<ul>
-<li>Component FlueGases.Volumes.VolumesCTh </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation BH = Ce1.Q*he1 + Ce2.Q*he2 + Ce3.Q*he3 - Cs.Q*hs + Cth.W; is replaced by&nbsp; BH = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) + Ce3.Q*(he3 - Ce3.Xh2o*hr) - Cs.Q*(hs - Cs.Xh2o*hr) + Cth.W; </p>
-<ul>
-<li>Component FlueGases.Volumes.VolumesDTh </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation BH = Ce1.Q*he1 &ndash; Cs1.Q*hs1 &ndash; Cs2.Q*hs2 &ndash; Cs3.Q*hs3 + Cth.W; is replaced by&nbsp; &nbsp;BH&nbsp;=&nbsp;Ce.Q*(he&nbsp;-&nbsp;Ce.Xh2o*hr)&nbsp;-&nbsp;Cs1.Q*(hs1&nbsp;-&nbsp;Cs1.Xh2o*hr)&nbsp;-&nbsp;Cs2.Q*(hs2&nbsp;-&nbsp;Cs2.Xh2o*hr)&nbsp;-&nbsp;Cs3.Q*(hs3&nbsp;-&nbsp;Cs3.Xh2o*hr)&nbsp;+&nbsp;Cth.W; </p>
-<ul>
-<li>Component FlueGases.Junctions.Mixer2 </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation 0&nbsp;=&nbsp;Ce1.Q*he1&nbsp;+&nbsp;Ce2.Q*he2&nbsp;-&nbsp;Cs.Q*hs; is replaced by&nbsp;&nbsp; 0&nbsp;=&nbsp;Ce1.Q*(he1&nbsp;-&nbsp;Ce1.Xh2o*hr)&nbsp;+&nbsp;Ce2.Q*(he2&nbsp;-&nbsp;Ce2.Xh2o*hr)&nbsp;-&nbsp;Cs.Q*(hs&nbsp;-&nbsp;Cs.Xh2o*hr); </p>
-<ul>
-<li>Component FlueGases.Junctions.Splitter2 </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation 0&nbsp;=&nbsp;Ce.Q*he - Cs1.Q*hs1 - Cs2.Q*hs2 is replaced by&nbsp;&nbsp; 0&nbsp;=&nbsp;Ce.Q*(he - Ce.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr); </p>
-<ul>
-<li>Package FlueGases.BoundaryConditions </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SourceQX </p>
-<ul>
-<li>Package Combustion.CombustionChambers </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component GenericCombustion1D </p>
-<ul>
-<li>Component CombustionChamber.GenericCombustion </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equations &nbsp;Hfuel = Cpfuel*Tfuel;&nbsp;&nbsp;&nbsp; Hcv = Cpcd*Tsf;&nbsp; Hbf = Cpcd*Tbf; &nbsp;are replaced by Hfuel = Cpfuel*(Tfuel - 273.16);&nbsp; Hcv = Cpcd*(Tsf - 273.16);&nbsp; Hbf = Cpcd*(Tbf - 273.16); </p>
-<ul>
-<li>Component Combustion.CombustionChambers.GTCombustionChamber </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation Wcpat&nbsp;=&nbsp;Qea*XQat*(Hiscpat&nbsp;-&nbsp;Hecpat)/eta_isc; is replaced by Wcpat&nbsp;=&nbsp;Qea*XQat*(Hiscpat&nbsp;-&nbsp;Hecpat)*eta_isc; </p>
-<ul>
-<li>Component Combustion.BoundaryConditions.FuelSourcePQ </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp;</span></span><span style=\"font-family: Courier New;\">Parameter rho=0.72 is replaced by rho=720 </p>
-<ul>
-<li>Package Properties </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New Package Properties.DryAirIdealGas </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New Package Properties.SolarSalt </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package Properties.Fluid has been completed </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package Properties.C3H3F5 has been completed </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package Properties.MoltenSalt has been completed </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package Properties.Oil_TherminolVP1 has been completed </p>
-<ul>
-<li>Package ThermoSysPro </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package Solar </p>
-<ul>
-<li>Package Thermal.HeatTransfer </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component HeatExchangerWallWithLosses </p>
-<ul>
-<li>Package WaterSteam.HeatExchangers </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component CoolingTower </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicOnePhaseFlowShell </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicTwoPhaseFlowRiser </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicTwoFlowHeatExchangerShell </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SteamGenerator_1SG </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SteamGenerator_4SG </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component StaticCondenserHEI </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Component TemperatureWallBoiler is removed </p>
-<ul>
-<li>Package WaterSteam.Volumes </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component TwoPhaseCavityOnePipe </p>
-<ul>
-<li>Component WaterSteam.Machines.StodolaTurbine </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter eta_is_wet(start=0.83) &quot;Isentropic efficiency for wet steam&quot;; eta_is_wet = xm*eta_is; </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.LumpedStraightPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter ntubes </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation mu&nbsp;=&nbsp;ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho,&nbsp;T); is replaced by mu&nbsp;=&nbsp;ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm,h,fluid,mode, 0.1,0.1,0.1,0); for fluid = 2 </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.InvSingularPressureLoss </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation deltaP&nbsp;=&nbsp;if&nbsp;noEvent(abs(Q)&nbsp;&lt;&nbsp;Qeps)&nbsp;then&nbsp;1.e10&nbsp;else&nbsp;K*ThermoSysPro.Functions.ThermoSquare(Q,&nbsp;eps)/rho; is replaced by deltaP&nbsp;=&nbsp;if&nbsp;noEvent(abs(Q)&nbsp;&lt;&nbsp;Qeps)&nbsp;then&nbsp;1.e-10&nbsp;else&nbsp;K*ThermoSysPro.Functions.ThermoSquare(Q,&nbsp;eps)/rho; </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation hc[i] = hcCorr*3.66*k[i]/D; &nbsp;is replaced by hc[i] = hcCorr*k[i]/D*max(4.36,0.023*Re1[i]^0.8*Pr[i]^0.4); </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation dpa[i] = noEvent(Q[i]* abs Q[i]*(1/rhoc[i + 1] - 1/rhoc[i])/A^2); is replaced by dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2; </p>
-<ul>
-<li>Component WaterSteam. HeatExchangers.DynamicTwoPhaseFlowPipe </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation xv1[i] = pro1[i].x); is replaced by xv1[i] = if noEvent((P[i+1] &gt; pcrit) or (T1[i] &gt; Tcrit)) then 1 else pro1[i].x; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;xv2[i] = pro2[i].x); is replaced by xv2[i]&nbsp;=&nbsp;if&nbsp;noEvent(((P[i]&nbsp;+&nbsp;P[i&nbsp;+&nbsp;1])/2&nbsp;&gt;&nbsp;pcrit)&nbsp;or&nbsp;(T2[i]&nbsp;&gt;&nbsp;Tcrit))&nbsp;then&nbsp;1&nbsp;else&nbsp;pro2[i].x; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation dpa[i] = noEvent(Q[i]* abs Q[i]*(1/rhoc[i + 1] - 1/rhoc[i])/A^2); is replaced by dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2; </p>
-<ul>
-<li>Component WaterSteam.Junctions.SteamExtractionSplitter </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter&nbsp;Real&nbsp;alpha&nbsp;=&nbsp;1&nbsp;&quot;Steam&nbsp;extraction&nbsp;rate&nbsp;(0&nbsp;&lt;=&nbsp;alpha&nbsp;&lt;=&nbsp;1)&quot;; is replaced by&nbsp; parameter&nbsp;Real&nbsp;alpha&nbsp;=&nbsp;1&nbsp;&quot;Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 &lt;= alpha &lt;= 1)&quot;; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation x_ex = 1 - alpha*(1 - proe.x); is replaced by x_ex = alpha*proe.x; </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicCondenser </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Component is replaced by new component DynamicCondenser (from SEPTEN) </p>
-<ul>
-<li>Component&nbsp; WaterSteam.HeatExchangers.DynamicWaterWaterExchanger </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation DPc[i]&nbsp;=&nbsp;p_Kc*Qc[i]^2/rhoc[i]; is replaced by DPc[i]&nbsp;=&nbsp;p_Kc*ThermoSysPro.Functions.ThermoSquare(Qc[i],&nbsp;1.e-3)/rhoc[i]; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation DPf[i]&nbsp;=&nbsp;p_Kf*Qf[i]^2/rhof[i]; is replaced &nbsp;by DPf[i]&nbsp;=&nbsp;p_Kf*ThermoSysPro.Functions.ThermoSquare(Qf[i],&nbsp;1.e-3)/rhof[i]; </p>
-<ul>
-<li>Component&nbsp; WaterSteam.HeatExchangers.StaticWaterWaterExchanger </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation DPc&nbsp;=&nbsp;p_Kc*Qc^2/rhoc; is replaced by DPc&nbsp;=&nbsp;p_Kc*ThermoSysPro.Functions.ThermoSquare(Qc,&nbsp;1.e-3)/rhoc; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation DPf&nbsp;=&nbsp;p_Kf*Qf^2/rhof; is replaced by DPf&nbsp;=&nbsp;p_Kf*ThermoSysPro.Functions.ThermoSquare(Qf,&nbsp;1.e-3)/rhof; </p>
-<ul>
-<li>Component&nbsp; WaterSteam.Machines.CentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter Integer mode=0&nbsp; is replaced by&nbsp; parameter Integer mode=1&nbsp;</p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp;</span></span><span style=\"font-family: Courier New;\">Equation Wm - Wr = 0; is replaced by Cm - Cr = 0; &nbsp;</p>
-<ul>
-<li>Component&nbsp; WaterSteam.Machines.DynamicCentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter Integer mode=0&nbsp; is replaced by&nbsp; parameter Integer mode=1&nbsp; </p>
-<ul>
-<li>Component&nbsp; WaterSteam.Machines.StaticCentrifugalPump </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter Integer mode=0&nbsp; is replaced by&nbsp; parameter Integer mode=1&nbsp; </p>
-<ul>
-<li>Component&nbsp; WaterSteam.Volumes.Pressurizer </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter Real Cevap=0.5 &quot;Evaporation coefficient&quot;; &nbsp;is replaced by&nbsp; parameter Real Cevap=0.1 &quot;Evaporation coefficient&quot;; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;&nbsp;Qcond&nbsp;=&nbsp;noEvent(Ccond*rhov*Vv*(hvs&nbsp;-&nbsp;hv)/(hvs&nbsp;-&nbsp;hls)&nbsp;+&nbsp;(Cas.Q*(hls&nbsp;-&nbsp;Cas.h) +&nbsp;0.5*(Wpv&nbsp;+&nbsp;abs(Wpv))&nbsp;+&nbsp;Wlv)/(hv&nbsp;-&nbsp;hls));&nbsp; is replaced by&nbsp; Qcond = Ccond*rhov*Vv*(hvs - hv)/(hvs - hls); </p>
-<ul>
-<li>Component&nbsp; WaterSteam.Junctions.SteamDryer </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Deleted variable Real&nbsp;eta1(start=1.0)&nbsp;&quot;Vapor&nbsp;mass&nbsp;fraction&nbsp;at&nbsp;outlet&nbsp;(0&nbsp;&lt;&nbsp;eta&nbsp;&lt;=&nbsp;1)&quot;; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">&nbsp;Deleted equation eta1 = noEvent(max(xe, eta)); </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;Csl.h_vol&nbsp;=&nbsp;noEvent(if&nbsp;&nbsp;(Csv.Q&nbsp;&gt;&nbsp;0)&nbsp;then&nbsp;(if&nbsp;(xe&nbsp;&gt;&nbsp;0)&nbsp;then&nbsp;lsat1.h&nbsp;else&nbsp;Cev.h)&nbsp;else&nbsp;&nbsp;h); is replaced by Csl.h_vol&nbsp;=&nbsp;noEvent(if&nbsp;(xe&nbsp;&gt;&nbsp;0)&nbsp;then&nbsp;lsat1.h&nbsp;else&nbsp;Cev.h); </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;Csv.Q&nbsp;=&nbsp;Cev.Q*xe/eta1; is replaced by Csv.Q&nbsp;=&nbsp;noEvent(if&nbsp;(xe&nbsp;&gt;&nbsp;0)&nbsp;then&nbsp;Cev.Q*(1-eta*(1-xe))&nbsp;else&nbsp;0); </p>
-<ul>
-<li>Component&nbsp; MultiFluids.Machines.AlternatingEngine </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter Pnom is removed </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Constant&nbsp;Real&nbsp;Gamma=1.3333&nbsp;&quot;Flue&nbsp;gases&nbsp;gamma&nbsp;=&nbsp;Cp/Cv&quot;; is replaced by parameter Real Gamma=1.3333 &quot;Flue gases gamma = Cp/Cv&quot;; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;Tfcb&nbsp;=&nbsp;(Wcomb&nbsp;-&nbsp;Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp,&nbsp;(Tfcp&nbsp;+&nbsp;Tfcb)/2,&nbsp;XsfCO2,&nbsp;XsfH2O,&nbsp;XsfO2,&nbsp;XsfSO2)/0.75/Qsf&nbsp;+&nbsp;Tfcp; &nbsp;is replaced by&nbsp; Tfcb = Wcomb/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/Qsf + Tfcp; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation &nbsp;&nbsp;if&nbsp;(Wmeca&nbsp;&gt;&nbsp;(Pnom&nbsp;*&nbsp;0.5))&nbsp;then Welec&nbsp;=&nbsp;(Wmeca*Relec)*(0.0479*Cosphi&nbsp;+&nbsp;0.952); &nbsp;&nbsp;else Welec&nbsp;=&nbsp;(Wmeca*Relec_red)*(0.0479*Cosphi&nbsp;+&nbsp;0.952); &nbsp;&nbsp;end&nbsp;if; &nbsp;is replaced by Welec&nbsp;=&nbsp;Wmeca*Relec; </p>
-<ul>
-<li>Component&nbsp; MultiFluids.Boilers.FossilFuelBoiler </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter&nbsp; Boiler_efficiency_type&nbsp;=&nbsp;1 &quot;1:&nbsp;Taking into account LHV&nbsp;only&nbsp;-&nbsp;2:&nbsp;Using&nbsp;the&nbsp;total&nbsp;incoming&nbsp;power&quot;; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation eta_boil&nbsp;=&nbsp;100*Wboil/Wfuel; is replaced by if&nbsp;(Boiler_efficiency_type&nbsp;==&nbsp;1)&nbsp;then eta_boil&nbsp;=&nbsp;100*Wboil/Wfuel; else eta_boil&nbsp;=&nbsp;100*Wboil/Wtot; end&nbsp;if; </p>
-<ul>
-<li>Package InstrumentationAndControl </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New block AdaptorForFMU.AdaptorModelicaTSP </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New block AdaptorForFMU.AdaptorTSPModelica </p>
-<ul>
-<li>All components MultiFluids.Machines.CHPEngine* </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter Pnom is removed </p>
-<ul>
-<li>Component FlueGases.HeatExchangers.StaticWallFlueGasesExchanger </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter Surf_ext becomes public </p>
-<ul>
-<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlow </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Component is renamed as DynamicOnePhaseFlowShell </p>
-<ul>
-<li>Component WaterSteam.Volumes.Tank </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">The momentum balance equations are replaced by singular pressure losses that represent the pressure losses at the orifices. </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.DynamicCheckValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">The spring torque Cr is removed. </p>
-<ul>
-<li>Component WaterSteam.PressureLosses.DynamicReliefValve </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Component is completely modified (previous version was incorrect). </p>
-</html>"), Icon(graphics={
-          Ellipse(
-            lineColor={75,138,73},
-            fillColor={75,138,73},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-100.0,-100.0},{100.0,100.0}}),
-          Polygon(origin={-4.167,-15.0},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-            smooth=Smooth.Bezier),
-          Ellipse(origin={7.5,56.5},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-12.5,-12.5},{12.5,12.5}})}));
-  end Version_3_2;
-
-  class Version_4_0 "Version 4.0"
-
-      annotation (Documentation(info="<html>
-<p><b><span style=\"font-size: 10pt; color: #008000;\">Version 4.0 (June 7, 2022)</span></b> </p>
-<p align=\"center\"><b><span style=\"font-size: 16pt;\">ThermoSysPro modifications from version 3.2</span></b></p>
-<p>&nbsp; </p>
-<ul>
-<li>New package ThermoSysPro.Fluid </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package utilizes new fluid connectors that can handle all fluids in package ThermoSysPro.Properties. </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package handles thermal diffusion as a new option. </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package replaces packages ThermoSysPro.Combustion, ThermoSysPro.FlueGases, ThermoSysPro.MultiFluids, ThermoSysPro.WaterSolution and ThermoSysPro.WaterSteam. </p>
-<ul>
-<li>Component ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterWaterExchanger </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;DPc[i] = p_Kc*ThermoSysPro.Functions.ThermoSquare(Qc[i], 1.e-3)/rhoc[i]; &nbsp;is replaced by&nbsp; DPc[i] = p_Kc*Qc[i]^2/rhoc[i]; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;DPf[i] = p_Kf*ThermoSysPro.Functions.ThermoSquare(Qf[i], 1.e-3)/rhof[i]; &nbsp;is replaced by&nbsp; DPf[i] = p_Kf*Qf[i]^2/rhof[i]; </p>
-<ul>
-<li>Component ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchanger </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;DPc = p_Kc*ThermoSysPro.Functions.ThermoSquare(Qc, 1.e-3)/rhoc; &nbsp;is replaced by&nbsp; DPc = p_Kc*Qc^2/rhoc; </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;DPf = p_Kf*ThermoSysPro.Functions.ThermoSquare(Qf, 1.e-3)/rhof; &nbsp;is replaced by&nbsp; DPf = p_Kf*Qf^2/rhof; </p>
-<ul>
-<li>Component ThermoSysPro.Fluid.Machines.Generator_11 </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; C</span></span><span style=\"font-family: Courier New;\">omponent is duplicated in package ThermoSysPro.ElectroMechanics.Machines for package Fluid </p>
-<ul>
-<li>Component ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall</li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New option: dynamic_energy_balance </p>
-<ul>
-<li>Package ThermoSysPro.Units</li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package: SI that duplicates package Modelica.SIunits </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package: nonSI </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package: xSI </p>
-<ul>
-<li>All components in package ThermoSysPro</li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">ThermoSysPro.Units.xSI.DifferentialTemperature is replaced by ThermoSysPro.Units.SI.TemperatureDifference </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">ThermoSysPro.Units.xSI.DifferentialPressure is replaced by ThermoSysPro.Units.SI.PressureDifference </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">ThermoSysPro.Units.xSI.MassFraction is replaced by ThermoSysPro.Units.SI.MassFraction </p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">All references to Modelica.SIunits are replaced by references to ThermoSysPro.Units </p>
-<ul>
-<li>Component ThermoSysPro.Solar.Collectors.FresnelField </li>
-</ul>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter: Lc</p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter: <code>trackingFactor</code></p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter: <code>thermalLossPhy</code></p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation <code>KL&nbsp;=<span style=\"color: #ff0000;\">&nbsp;cos</span>(pi*thetaL/180)*(1&nbsp;-&nbsp;h*<span style=\"color: #ff0000;\">tan</span>(pi*thetaL/180)/L); is replaced by KL&nbsp;=<span style=\"color: #ff0000;\">&nbsp;cos</span>(pi*thetaL/180)*(1&nbsp;-&nbsp;h*<span style=\"color: #ff0000;\">tan</span>(pi*thetaL/180)/Lc);</code></p>
-<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation <code>dQloss[i]&nbsp;=&nbsp;pi*D*L/Ns*(0.5*F12*Emi*5.67e-8*(T[i]^4&nbsp;-&nbsp;(0.0552*T0^(1.5))^4)&nbsp;+&nbsp;hc*(T[i]&nbsp;-&nbsp;T0)); is replaced by dQloss[i]&nbsp;=&nbsp;<span style=\"color: #0000ff;\">if&nbsp;</span>thermalLossPhy<span style=\"color: #0000ff;\">&nbsp;then&nbsp;</span>pi*D*L/Ns*(0.5*F12*Emi*5.67e-8*(T[i]^4&nbsp;-&nbsp;(0.0552*T0^(1.5))^4)&nbsp;+&nbsp;hc*(T[i]&nbsp;-&nbsp;T0))<span style=\"color: #0000ff;\">&nbsp;else&nbsp;</span>L/Ns*(A1*deltaT[i]&nbsp;+&nbsp;A2*deltaT[i]^2);</code></p>
-</html>"), Icon(graphics={
-          Ellipse(
-            lineColor={75,138,73},
-            fillColor={75,138,73},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-100.0,-100.0},{100.0,100.0}}),
-          Polygon(origin={-4.167,-15.0},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-            smooth=Smooth.Bezier),
-          Ellipse(origin={7.5,56.5},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-12.5,-12.5},{12.5,12.5}})}));
-  end Version_4_0;
-    annotation (Documentation(info="<html>
-<h3><font color=\"#008000\" size=5>Release notes</font></h3>
-<p>
-This section summarizes the changes that have been performed
-on the ThermoSysPro library.
-</html>
-"), Icon(graphics={
-          Ellipse(
-            lineColor={75,138,73},
-            fillColor={75,138,73},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-100.0,-100.0},{100.0,100.0}}),
-          Polygon(origin={-4.167,-15.0},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-            smooth=Smooth.Bezier),
-          Ellipse(origin={7.5,56.5},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-12.5,-12.5},{12.5,12.5}})}));
-  end ReleaseNotes;
-
-  class Contact "Contact"
-
-    annotation (Documentation(info="<html>
-<h3><font color=\"#008000\" size=5>Contact
-</font></h3>
-<dl><dt>The development of the ThermoSysPro library is organized by<br/></dt>
-<dd>Daniel Bouskela<br/></dd>
-<dd>EDF/R&AMP;D</dd>
-<dd>6, quai Watier</dd>
-<dd>F-78401 Chatou Cedex</dd>
-<dd>France<br/></dd>
-<dd>email: <a href=\"mailto:daniel.bouskela@edf.fr\">daniel.bouskela@edf.fr</a></dd>
-</dl></html>"), Icon(graphics={
-          Ellipse(
-            lineColor={75,138,73},
-            fillColor={75,138,73},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-100.0,-100.0},{100.0,100.0}}),
-          Polygon(origin={-4.167,-15.0},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-            smooth=Smooth.Bezier),
-          Ellipse(origin={7.5,56.5},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-12.5,-12.5},{12.5,12.5}})}));
-
-  end Contact;
-
-  class ThermoSysProLicense "License"
-
-    annotation (Documentation(info="<html>
-<h3><font color=\"#008000\" size=5>The ThermoSysPro License
-</font></h3>
-<p>The use of the ThermoSysPro Library is granted by EDF under the provisions of Modelica License 2.</p>
-<p>Packages <b>Neutronics</b> and <b>InstrumentationAndControl.BFE</b> are not released under open source license.</p>
-<hr>
-<h4><a name=\"ModelicaLicense2\"></a>The Modelica License 2</h4>
-<p>
-<b>Preamble.</b> The goal of this license is that Modelica related
-model libraries, software, images, documents, data files etc. can be
-used freely in the original or a modified form, in open source and in
-commercial environments (as long as the license conditions below are
-fulfilled, in particular sections 2c) and 2d). The Original Work is
-provided free of charge and the use is completely at your own risk.
-Developers of free Modelica packages are encouraged to utilize this
-license for their work.</p>
-
-<p>
-The Modelica License applies to any Original Work that contains the
-following licensing notice adjacent to the copyright notice(s) for
-this Original Work:</p>
-<p><b>Licensed
-by the Modelica Association under the Modelica License 2</b></p>
-
-<p><b>1. Definitions.</b></p>
-<ol>
- <li>&ldquo;License&rdquo; is this Modelica License.</li>
-
- <li>
- &ldquo;Original Work&rdquo; is any work of authorship, including
- software, images, documents, data files, that contains the above
- licensing notice or that is packed together with a licensing notice
- referencing it.</li>
-
- <li>
- &ldquo;Licensor&rdquo; is the provider of the Original Work who has
- placed this licensing notice adjacent to the copyright notice(s) for
- the Original Work. The Original Work is either directly provided by
- the owner of the Original Work, or by a licensee of the owner.</li>
-
- <li>
- &ldquo;Derivative Work&rdquo; is any modification of the Original
- Work which represents, as a whole, an original work of authorship.
- For the matter of clarity and as examples: </li>
-
- <ol>
-  <li>
-  Derivative Work shall not include work that remains separable from
-  the Original Work, as well as merely extracting a part of the
-  Original Work without modifying it.</li>
-
-  <li>
-  Derivative Work shall not include (a) fixing of errors and/or (b)
-  adding vendor specific Modelica annotations and/or (c) using a
-  subset of the classes of a Modelica package, and/or (d) using a
-  different representation, e.g., a binary representation.</li>
-
-  <li>
-  Derivative Work shall include classes that are copied from the
-  Original Work where declarations, equations or the documentation
-  are modified.</li>
-
-  <li>
-  Derivative Work shall include executables to simulate the models
-  that are generated by a Modelica translator based on the Original
-  Work (of a Modelica package).</li>
- </ol>
-
- <li>
- &ldquo;Modified Work&rdquo; is any modification of the Original Work
- with the following exceptions: (a) fixing of errors and/or (b)
- adding vendor specific Modelica annotations and/or (c) using a
- subset of the classes of a Modelica package, and/or (d) using a
- different representation, e.g., a binary representation.</li>
-
- <li>
- &quot;Source Code&quot; means the preferred form of the Original
- Work for making modifications to it and all available documentation
- describing how to modify the Original Work.</li>
-
- <li>
- &ldquo;You&rdquo; means an individual or a legal entity exercising
- rights under, and complying with all of the terms of, this License.</li>
-
- <li>
- &ldquo;Modelica package&rdquo; means any Modelica library that is
- defined with the<br>&ldquo;<FONT FACE=\"Courier New, monospace\"><FONT SIZE=2 STYLE=\"font-size: 9pt\"><b>package</b></FONT></FONT><FONT FACE=\"Courier New, monospace\"><FONT SIZE=2 STYLE=\"font-size: 9pt\">
- &lt;Name&gt; ... </FONT></FONT><FONT FACE=\"Courier New, monospace\"><FONT SIZE=2 STYLE=\"font-size: 9pt\"><b>end</b></FONT></FONT><FONT FACE=\"Courier New, monospace\"><FONT SIZE=2 STYLE=\"font-size: 9pt\">
- &lt;Name&gt;;</FONT></FONT>&ldquo; Modelica language element.</li>
-</ol>
-
-<p>
-<b>2. Grant of Copyright License.</b> Licensor grants You a
-worldwide, royalty-free, non-exclusive, sublicensable license, for
-the duration of the copyright, to do the following:</p>
-
-<ol>
- <li><p>
- To reproduce the Original Work in copies, either alone or as part of
- a collection.</li></p>
- <li><p>
- To create Derivative Works according to Section 1d) of this License.</li></p>
- <li><p>
- To distribute or communicate to the public copies of the <u>Original
- Work</u> or a <u>Derivative Work</u> under <u>this License</u>. No
- fee, neither as a copyright-license fee, nor as a selling fee for
- the copy as such may be charged under this License. Furthermore, a
- verbatim copy of this License must be included in any copy of the
- Original Work or a Derivative Work under this License.<br>      For
- the matter of clarity, it is permitted A) to distribute or
- communicate such copies as part of a (possible commercial)
- collection where other parts are provided under different licenses
- and a license fee is charged for the other parts only and B) to
- charge for mere printing and shipping costs.</li></p>
- <li><p>
- To distribute or communicate to the public copies of a <u>Derivative
- Work</u>, alternatively to Section 2c), under <u>any other license</u>
- of your choice, especially also under a license for
- commercial/proprietary software, as long as You comply with Sections
- 3, 4 and 8 below. <br>      For the matter of clarity, no
- restrictions regarding fees, either as to a copyright-license fee or
- as to a selling fee for the copy as such apply.</li></p>
- <li><p>
- To perform the Original Work publicly.</li></p>
- <li><p>
- To display the Original Work publicly.</li></p>
-</ol>
-
-<p>
-<b>3. Acceptance.</b> Any use of the Original Work or a
-Derivative Work, or any action according to either Section 2a) to 2f)
-above constitutes Your acceptance of this License.</p>
-
-<p>
-<b>4. Designation of Derivative Works and of Modified Works.
-</b>The identifying designation of Derivative Work and of Modified
-Work must be different to the corresponding identifying designation
-of the Original Work. This means especially that the (root-level)
-name of a Modelica package under this license must be changed if the
-package is modified (besides fixing of errors, adding vendor specific
-Modelica annotations, using a subset of the classes of a Modelica
-package, or using another representation, e.g. a binary
-representation).</p>
-
-<p>
-<b>5. Grant of Patent License.</b>
-Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license,
-under patent claims owned by the Licensor or licensed to the Licensor by
-the owners of the Original Work that are embodied in the Original Work
-as furnished by the Licensor, for the duration of the patents,
-to make, use, sell, offer for sale, have made, and import the Original Work
-and Derivative Works under the conditions as given in Section 2.
-For the matter of clarity, the license regarding Derivative Works covers
-patent claims to the extent as they are embodied in the Original Work only.</p>
-
-<p>
-<b>6. Provision of Source Code.</b> Licensor agrees to provide
-You with a copy of the Source Code of the Original Work but reserves
-the right to decide freely on the manner of how the Original Work is
-provided.<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For the matter of clarity, Licensor might provide only a binary
-representation of the Original Work. In that case, You may (a) either
-reproduce the Source Code from the binary representation if this is
-possible (e.g., by performing a copy of an encrypted Modelica
-package, if encryption allows the copy operation) or (b) request the
-Source Code from the Licensor who will provide it to You.</p>
-
-<p>
-<b>7. Exclusions from License Grant.</b> Neither the names of
-Licensor, nor the names of any contributors to the Original Work, nor
-any of their trademarks or service marks, may be used to endorse or
-promote products derived from this Original Work without express
-prior permission of the Licensor. Except as otherwise expressly
-stated in this License and in particular in Sections 2 and 5, nothing
-in this License grants any license to Licensor&rsquo;s trademarks,
-copyrights, patents, trade secrets or any other intellectual
-property, and no patent license is granted to make, use, sell, offer
-for sale, have made, or import embodiments of any patent claims.<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No license is granted to the trademarks of
-Licensor even if such trademarks are included in the Original Work,
-except as expressly stated in this License. Nothing in this License
-shall be interpreted to prohibit Licensor from licensing under terms
-different from this License any Original Work that Licensor otherwise
-would have a right to license.</p>
-
-<p>
-<b>8. Attribution Rights.</b> You must retain in the Source
-Code of the Original Work and of any Derivative Works that You
-create, all author, copyright, patent, or trademark notices, as well
-as any descriptive text identified therein as an &quot;Attribution
-Notice&quot;. The same applies to the licensing notice of this
-License in the Original Work. For the matter of clarity, &ldquo;author
-notice&rdquo; means the notice that identifies the original
-author(s). <br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You must cause the Source Code for any Derivative
-Works that You create to carry a prominent Attribution Notice
-reasonably calculated to inform recipients that You have modified the
-Original Work. <br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In case the Original Work or Derivative Work is not provided in
-Source Code, the Attribution Notices shall be appropriately
-displayed, e.g., in the documentation of the Derivative Work.</p>
-
-<p><b>9. Disclaimer
-of Warranty. <br></b><u><b>The Original Work is provided under this
-License on an &quot;as is&quot; basis and without warranty, either
-express or implied, including, without limitation, the warranties of
-non-infringement, merchantability or fitness for a particular
-purpose. The entire risk as to the quality of the Original Work is
-with You.</b></u><b> </b>This disclaimer of warranty constitutes an
-essential part of this License. No license to the Original Work is
-granted by this License except under this disclaimer.</p>
-
-<p>
-<b>10. Limitation of Liability.</b> Under no circumstances and
-under no legal theory, whether in tort (including negligence),
-contract, or otherwise, shall the Licensor, the owner or a licensee
-of the Original Work be liable to anyone for any direct, indirect,
-general, special, incidental, or consequential damages of any
-character arising as a result of this License or the use of the
-Original Work including, without limitation, damages for loss of
-goodwill, work stoppage, computer failure or malfunction, or any and
-all other commercial damages or losses. This limitation of liability
-shall not apply to the extent applicable law prohibits such
-limitation.</p>
-
-<p>
-<b>11. Termination.</b> This License conditions your rights to
-undertake the activities listed in Section 2 and 5, including your
-right to create Derivative Works based upon the Original Work, and
-doing so without observing these terms and conditions is prohibited
-by copyright law and international treaty. Nothing in this License is
-intended to affect copyright exceptions and limitations. This License
-shall terminate immediately and You may no longer exercise any of the
-rights granted to You by this License upon your failure to observe
-the conditions of this license.</p>
-
-<p>
-<b>12. Termination for Patent Action.</b> This License shall
-terminate automatically and You may no longer exercise any of the
-rights granted to You by this License as of the date You commence an
-action, including a cross-claim or counterclaim, against Licensor,
-any owners of the Original Work or any licensee alleging that the
-Original Work infringes a patent. This termination provision shall
-not apply for an action alleging patent infringement through
-combinations of the Original Work under combination with other
-software or hardware.</p>
-
-<p>
-<b>13. Jurisdiction.</b> Any action or suit relating to this
-License may be brought only in the courts of a jurisdiction wherein
-the Licensor resides and under the laws of that jurisdiction
-excluding its conflict-of-law provisions. The application of the
-United Nations Convention on Contracts for the International Sale of
-Goods is expressly excluded. Any use of the Original Work outside the
-scope of this License or after its termination shall be subject to
-the requirements and penalties of copyright or patent law in the
-appropriate jurisdiction. This section shall survive the termination
-of this License.</p>
-
-<p>
-<b>14. Attorneys&rsquo; Fees.</b> In any action to enforce the
-terms of this License or seeking damages relating thereto, the
-prevailing party shall be entitled to recover its costs and expenses,
-including, without limitation, reasonable attorneys' fees and costs
-incurred in connection with such action, including any appeal of such
-action. This section shall survive the termination of this License.</p>
-
-<p>
-<b>15. Miscellaneous.</b>
-</p>
-<ol>
- <li>If any
- provision of this License is held to be unenforceable, such
- provision shall be reformed only to the extent necessary to make it
- enforceable.</li>
-
- <li>No verbal
- ancillary agreements have been made. Changes and additions to this
- License must appear in writing to be valid. This also applies to
- changing the clause pertaining to written form.</li>
-
- <li>You may use the
- Original Work in all ways not otherwise restricted or conditioned by
- this License or by law, and Licensor promises not to interfere with
- or be responsible for such uses by You.</li>
-</ol>
-
-<p>
-<br>
-</p>
-
-</html>
-"), Icon(graphics={
-          Ellipse(
-            lineColor={75,138,73},
-            fillColor={75,138,73},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-100.0,-100.0},{100.0,100.0}}),
-          Polygon(origin={-4.167,-15.0},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-            smooth=Smooth.Bezier),
-          Ellipse(origin={7.5,56.5},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-12.5,-12.5},{12.5,12.5}})}));
-
-  end ThermoSysProLicense;
-
-  class ThermoSysProDocumentation "Documentation"
-
-    annotation (Documentation(info="<html>
-<p><b><span style=\"font-size: 12pt; color: #008000;\">Documentation </span></b></p>
-<p>A <a href=\"https://www.modelica.org/events/modelica2011/Proceedings/pages/papers/15_2_ID_115_a_fv.pdf\">conference paper</a> explains the fundamentals of the library.</p>
-<p>The <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a> is available from Springer.</p>
-<p>The full documentation of the library is still under construction. </p>
-</html>"), Icon(graphics={
-          Ellipse(
-            lineColor={75,138,73},
-            fillColor={75,138,73},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-100.0,-100.0},{100.0,100.0}}),
-          Polygon(origin={-4.167,-15.0},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-            smooth=Smooth.Bezier),
-          Ellipse(origin={7.5,56.5},
-            fillColor={255,255,255},
-            pattern=LinePattern.None,
-            fillPattern=FillPattern.Solid,
-            extent={{-12.5,-12.5},{12.5,12.5}})}));
-
-  end ThermoSysProDocumentation;
-  annotation (DocumentationClass=true, Documentation(info="<html>
-<p><b><span style=\"font-size: 12pt; color: #008000;\">Users Guide of the ThermoSysPro Library</span></b></p>
-<p>ThermoSysPro is a library for the modelling and simulation of power plants and energy systems. It is developed with the Modelica language from the <a href=\"http://www.Modelica.org\">Modelica Association</a>. It provides components in various disciplines related to the modelling of power plants and energy systems. </p>
-<p> See <a href='https://thermosyspro.gitlab.io/documentation/'> the online documentation</a> (to be updated soon).</h4>
-</html>"),
-    Icon(graphics={
-        Ellipse(
-          lineColor={75,138,73},
-          fillColor={75,138,73},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          extent={{-100.0,-100.0},{100.0,100.0}}),
-        Polygon(origin={-4.167,-15.0},
-          fillColor={255,255,255},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
-          smooth=Smooth.Bezier),
-        Ellipse(origin={7.5,56.5},
-          fillColor={255,255,255},
-          pattern=LinePattern.None,
-          fillPattern=FillPattern.Solid,
-          extent={{-12.5,-12.5},{12.5,12.5}})}));
-end UsersGuide;
+within ThermoSysPro;
+package UsersGuide "ThermoSysPro Licence and Users Guide"
+
+  class ReleaseNotes "Release notes"
+
+  class Version_2_0 "Version 2.0"
+
+      annotation (Documentation(info="<html>
+<h3><font color=\"#008000\">Version 2.0 (January 24, 2011)</font></h3>
+<p> This is the first open source release of the library.
+</p>
+</html>
+"), Icon(graphics={
+          Ellipse(
+            lineColor={75,138,73},
+            fillColor={75,138,73},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-100.0,-100.0},{100.0,100.0}}),
+          Polygon(origin={-4.167,-15.0},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+            smooth=Smooth.Bezier),
+          Ellipse(origin={7.5,56.5},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-12.5,-12.5},{12.5,12.5}})}));
+  end Version_2_0;
+
+  class Version_3_0 "Version 3.0"
+
+      annotation (Documentation(info="<html>
+<p><b><span style=\"font-size: 10pt; color: #008000;\">Version 3.0 (December 20, 2011)</span></b></p>
+<p align=\"center\"><b><span style=\"font-size: 16pt;\">ThermoSysPro modifications from version 2.0</span></b> </p>
+<p>Analytic jacobian is added to the library.</p>
+<p>The examples package is added to the library.</p>
+<p>Other modifications:</p>
+<ul>
+<li>Component MultiFluids.HeatExchangers.DynamicExchangerWaterSteamFlueGases </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Introduction of two new parameters z1 and z2 </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of parameters TwoPhaseFlowPipe.z1, and TwoPhaseFlowPipe.z2. Old values z1 = 0 and z2 = 0. New values z1 = z1 and z2 = z2. </p>
+<ul>
+<li>Package Units </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit AbsoluteTemperature </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit DifferentialTemperature </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit&nbsp; AbsolutePressure </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit DifferentialPressure </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New unit SpecificEnthalpy </p>
+<ul>
+<li>Component&nbsp; ElectroMechanics.Machines.SynchronousMotor </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter permanent_meca changed to steady_stae_mech </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter Coupleur changed to mech_coupling </p>
+<ul>
+<li>Component&nbsp; ElectroMechanics.Machines.Shaft </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter permanent_meca changed to steady_state_mech </p>
+<ul>
+<li>Package Properties.WaterSteam.IF97_packages </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New IF97 package with analytic jacobian </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Removal of the old IF97 package </p>
+<ul>
+<li>Function IF97.SplineUtilities.Modelica_Interpolation.Bspline1D.parametrization </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">arccos changed to acos </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.CheckValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding modifier (start=false, fixed=true) for variables touvert and tferme. </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.IdealCheckValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding modifier (start=false, fixed=true) for variables touvert and tferme. </p>
+<ul>
+<li>Component FlueGases.PressureLosses.CheckValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding modifier (start=false, fixed=true) for variables touvert and tferme. </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding a default value to parameter T0 </p>
+<ul>
+<li>Package Functions </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothStep </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothSign </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothAbs </p>
+<ul>
+<li>Component WaterSteam.Machines.DynamicCentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Use of function SmoothSign for computation of Cf. </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter continuous_flow_reversal </p>
+<ul>
+<li>Component WaterSteam.Machines.StaticCentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter continuous_flow_reversal </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Removing input commandePompe </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Input VRotation changed to rpm_or_mpower </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter MPower </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter fixed_rot_or_power </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Efficiency characteristics rh=a*Qv^2/R^2 + b*Qv/R + c changed to rh=a*Qv*abs(Qv)/R^2+b*Qv/R+c to ensure convergence for fixed mechanical power </p>
+<ul>
+<li>Component<span style=\"color: #ff0000;\"> </span>WaterSteam.PressureLoses.LumpedStraightPipe &lt;====== </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of default value of parameter rugosrel. Old value: 0, new value 0.0001. </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding initial equation:&nbsp; der(Q) = 0 </p>
+<ul>
+<li>Component WaterSteam.Volumes.TwoPhaseVolume </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Property prol is computed at pressure (P + Pfond)/2 instead of P. </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter dpfCorr </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter hcCorr </p>
+<ul>
+<li>Component WaterSteam.HeatExchanger.DynamicTwoPhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter dpfCorr </p>
+<ul>
+<li>Component Thermal.HeatTransfer.HeatExchangerWall </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Wall 1 becomes the internal wall </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Wall 2 becomes the external wall </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Heat flux through external wall is corrected </p>
+<ul>
+<li>Component WaterSteam.HeatExchanger. StaticWaterWaterExchangerDTorWorEff </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of the power equation for case exchanger_type = 3. </p>
+<ul>
+<li>Component WaterSteam.HeatExchanger.TemperatureWallBoiler </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of some parameter default values </p>
+<ul>
+<li>Function Correlations.PressureLosses.WBWaterSteamPressureLosses </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">b0 is bounded to 0.01 </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Gm^2 is replaced by Gm*abs(Gm) </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding equation dpa := 0. </p>
+<ul>
+<li>Function Properties.WaterSteam.BaseIF97.Basic.psat </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Calls to LogVariable removed. </p>
+<ul>
+<li>Component Combustion.BoundaryConditions.FuelSourcePQ </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Handling of input signals corrected. </p>
+<ul>
+<li>Component MultiFluid.HeatExchangers.NTUTechnologicalExchangerWaterSteamFlueGases </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of computation of variable mono. </p>
+<ul>
+<li>Component WaterSteam.Machines.StodolaTurbine </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of default value for parameter Qmax. Old Value=15, new value=1. </p>
+<ul>
+<li>Function Correlation.Thermal.WBInternalHeatTransferCoefficient </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function. </p>
+<ul>
+<li>Component WaterSteamHeatExchangers.TemperatureWallBoiler </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Call to WBInternalHeatTransferCoefficient instead of separate calls to WBInternalOnePhaseFlowHeatTransferCoefficient and WBInternalTwoPhaseFlowHeatTransferCoefficient </p>
+<ul>
+<li>Component WaterSteam.Junctions.Mixer3 </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Bug correction: flow from port Ce3 added in mass balance and energy balance equations. </p>
+<ul>
+<li>Component WaterSteam.BoundaryConditions.RefQ </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of default value for Q0. Old value=1.e5. New value=10. </p>
+<ul>
+<li>Component WaterSteam.Junctions.StaticDrum </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of comment for parameter x </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding thermal connector Cth and variable T </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of energy balance equation to take into account external energy supply. </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding equation Cth.T = T; </p>
+<ul>
+<li>Package Thermal.BoundaryConditions </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component HeatSink </p>
+<ul>
+<li>Package WaterSteam.BoundaryConditions </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New components PlugA, PlugB </p>
+<ul>
+<li>Component InstrumentationAndControl.Blocks.Tables.Table1D </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Dymola specific function Interpolate is replaced by ThermoSysPro.Functions.LinearInterpolation. </p>
+<ul>
+<li>Component InstrumentationAndControl.Blocks.Tables.Table1DTemps </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Dymola specific function Interpolate is replaced by ThermoSysPro.Functions.LinearInterpolation. </p>
+<ul>
+<li>Function Functions.LinearInterpolation </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Output DeltaYX is removed. </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function calls Functions.LinearInterpolation_i, which returns DelTaXY. </p>
+<ul>
+<li>Function Functions.TableLinearInterpolation </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Outputs DeltaYX and DeltaYP are removed. </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function calls Functions.TableLinearInterpolation_i, which returns DelTaXY and DeltaYP. </p>
+<ul>
+<li>Function Correlations.Misc..WBCorrectiveDiameterCoefficient </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unused variables Z1, Z2 are removed. </p>
+<ul>
+<li>Function Correlations.Thermal.WBCrossedCurrentConvectiveHeatTranferCoefficient </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unused variables Z1, Z2 are removed. </p>
+<ul>
+<li>Function Correlations.Thermal.WBLongitudinalCurrentConvectiveHeatTranferCoefficient </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unused variables Z1, Z2 are removed. </p>
+<ul>
+<li>Function Correlations.Thermal.WBRadiativeHeatTranferCoefficient </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unused variables Z1, Z2, Z3, Z4 are removed. </p>
+<ul>
+<li>Component WaterSteam.Machines.SteamEngine </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.ControlValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.DynamicCheckValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.DynamicReliefValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
+<ul>
+<li>Component FlueGases.PressureLosses.ControlValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is replaced by function LinearInterpolation </p>
+<ul>
+<li>Package Functions </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function Interpolation is removed. One should use function LinearInterpolation instead. </p>
+<ul>
+<li>Package Units </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unit RotationVelocity renamed to AngularVelocity_rpm </p>
+</html>"), Icon(graphics={
+          Ellipse(
+            lineColor={75,138,73},
+            fillColor={75,138,73},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-100.0,-100.0},{100.0,100.0}}),
+          Polygon(origin={-4.167,-15.0},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+            smooth=Smooth.Bezier),
+          Ellipse(origin={7.5,56.5},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-12.5,-12.5},{12.5,12.5}})}));
+  end Version_3_0;
+
+  class Version_3_1 "Version 3.1"
+
+      annotation (Documentation(info="<html>
+<p><b><span style=\"font-size: 10pt; color: #008000;\">Version 3.1 (June 12, 2014)</span></b> </p>
+<p align=\"center\"><b><span style=\"font-size: 16pt;\">ThermoSysPro modifications from version 3.0</span></b> </p>
+<p>&nbsp; </p>
+<ul>
+<li>Component ElectroMechanics.BoundaryConditions.SourceMechanicalPower </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation M.Ctr*abs(M.w) = IPower.signal is replaced by M.Ctr*M.w = IPower.signal </p>
+<ul>
+<li>Package ElectroMechanics.BoundaryConditions </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SourceAngularVelocity </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SourceTorque </p>
+<ul>
+<li>Package Function </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothMax </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothMin </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function SmoothCond </p>
+<ul>
+<li>Package WaterSteam.Machines </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component CentrifugalPump, replaces old components DynamicCentrifugalPump and StaticCentrifugalPump. </p>
+<ul>
+<li>Component WaterSteam.Machines.DynamicCentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Obsolete component, replaced by component CentrifugalPump </p>
+<ul>
+<li>Component WaterSteam.Machines.StaticCentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Obsolete component, replaced by component CentrifugalPump </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter dynamic_energy_balance is removed </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter dynamic_energy_balance is removed </p>
+<ul>
+<li>Function Properties.CH3F5.CH3F5_Ps </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of x for one-phase flow (liquid or vapor) </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.SimpleDynamicCondenser </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of Wout </p>
+<ul>
+<li>Component WaterSteam.Volumes.TwoPhaseVolume </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction: Cl.a = true (instead of Cl.b = true) </p>
+<ul>
+<li>Component FlueGases.HeatExchangers. StaticWallFlueGasesExchanger </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of dW[i] </p>
+<ul>
+<li>Component WaterSteam.Junctions.SteamDryer </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the mass balance equations </p>
+<ul>
+<li>Component Combustion.CombustionChambers.GenericCombustionChamber </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of HFuel </p>
+<ul>
+<li>Component Combustion.CombustionChambers.GTCombustionChamber </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of HFuel </p>
+<ul>
+<li>Component WaterSteam.Volumes.Tank </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter k is replaced by parameters ke1, ke2, ks1, ks2. </p>
+<ul>
+<li>Function Functions. LinearInterpolation_i </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of Y </p>
+<ul>
+<li>Package Units </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unit SpecificEnthalpy removed </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unit AbsolutePressure removed </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Unit AbsoluteTemperature removed </p>
+<ul>
+<li>Package WaterSteam.HeatExchangers </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicWaterHeating </p>
+<ul>
+<li>Package WaterSteam.Volumes </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component TwoPhaseCavity </p>
+<ul>
+<li>Component FlueGases.Volumes.VolumeATh </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modifier stateSelect removed </p>
+<ul>
+<li>Component FlueGases.Volumes.VolumeBTh </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modifier stateSelect removed </p>
+<ul>
+<li>Component FlueGases.Volumes.VolumeCTh </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modifier stateSelect removed </p>
+<ul>
+<li>Component FlueGases.Volumes.VolumeDTh </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modifier stateSelect removed </p>
+<ul>
+<li>Component WaterSteam.Machines.Compressor </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">xm is bounded by min value 0.01 (to avoid division by zero in case fluid is water, which should not happen in a compressor). </p>
+<ul>
+<li>Component FlueGases.PressureLosses.SingularPressureLoss </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Default value for parameter K changed to 1.e-3. </p>
+<ul>
+<li>Component WaterSteam.Machines.StodolaTurbine </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Extension of the computation of xm and Q for supercritical regimes. </p>
+<ul>
+<li>Component WaterSteam.Boilers.ElectricBoiler </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Correction of the computation of deltaH. </p>
+<ul>
+<li>Component WaterSteam.Machines.StaticCentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Value of rh is changed. Old value: 0.05 - New value: 0.20 </p>
+<ul>
+<li>Component WaterSolution.Machines.StaticCentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Value of rh is changed. Old value: 0.05 - New value: 0.20 </p>
+<ul>
+<li>Component FlueGases.Machines.StaticFan </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Value of rh is changed. Old value: 0.05 - New value: 0.20 </p>
+<ul>
+<li>Package Functions </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New functions SplineInterpolation and TableSplineInterpolation </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package Utilities </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function LinearInterpolation_i&nbsp; moved to Functions.Utilities </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Function TableLinearInterpolation_i&nbsp; moved to Functions.Utilities </p>
+<ul>
+<li>Package Functions.Utilities </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New function CubicHermite </p>
+<ul>
+<li>Block InstrumentationAndControl.Blocks.Table.Table1D </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Block InstrumentationAndControl.Blocks.Table.Table1DTemps </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Block InstrumentationAndControl.Blocks.Table.Table2D </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Component WaterSteam.Machines.CentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Linear interpolation of F and G is replaced by spline interpolation </p>
+<ul>
+<li>Component FlueGases.PressureLosses.ControlValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.ControlValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.DynamicCheckValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.DynamicReliefValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Component WaterSteam.Machines.SteamEngine </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Function Correlation.Misc.WBCorrectiveDiameterCoefficient </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Function Correlation.Thermal. WBCrossedCurrentConvectiveHeatTransferCoefficient </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Function Correlation.Thermal. WBLongitudinalCurrentConvectiveHeatTransferCoefficient </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Function Correlation.Thermal. WBRadiativeHeatTransferCoefficient </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New interpolating option: spline interpolation </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.TwoPhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adding noEvent for the computation of hi and Xtt </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Extension of the computation of hc for laminar flows </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicWaterWaterExchanger </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of the computation of DPc and DPf. Previous&nbsp; version: DPc[i] = p_Kc*Qc[i]^2/(2*rhoc[i]); DPf[i] = p_Kf*Qf[i]^2/(2*rhof[i]); New version: DPc[i] = p_Kc*Qc[i]^2/rhoc[i]; DPf[i] = p_Kf*Qf[i]^2/rhof[i]; </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.StaticWaterWaterExchanger </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of the computation of DPc and DPf. Previous&nbsp; version: DPc[i] = p_Kc*Qc[i]^2/(2*rhoc[i]); DPf[i] = p_Kf*Qf[i]^2/(2*rhof[i]); New version: DPc[i] = p_Kc*Qc[i]^2/rhoc[i]; DPf[i] = p_Kf*Qf[i]^2/rhof[i]; </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.NTUWaterHeating </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Modification of the value of eps. Previous value:&nbsp; 1. New value: 1.e-3. </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Adaptation to the supercritical phase </p>
+<ul>
+<li>Package WaterSteam.HeatExchangers </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicWaterHeatingOnePipe </p>
+<ul>
+<li>Package Thermal.HeatTransfer </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component HeatExchangerWallCounterFlow </p>
+<ul>
+<li>Package Properties </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package MoltenSalt </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package Oil_TherminolVP1 </p>
+<ul>
+<li>Component WaterSteam.Machines.StodolaTurbine </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation xm = if noEvent(Ps &gt; pcrit) then 1 else (1 + pros1.x)/2; is replaced by xm = 1; </p>
+<ul>
+<li>Component WaterSteam.Volumes.Tank </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter dynamic_mass_balance </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New equation A*(pro.ddph*der(P) + pro.ddhp*der(h))*z + A*rho*der(z) = BQ; when dynamic_mass_balance = true </p>
+</html>"), Icon(graphics={
+          Ellipse(
+            lineColor={75,138,73},
+            fillColor={75,138,73},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-100.0,-100.0},{100.0,100.0}}),
+          Polygon(origin={-4.167,-15.0},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+            smooth=Smooth.Bezier),
+          Ellipse(origin={7.5,56.5},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-12.5,-12.5},{12.5,12.5}})}));
+  end Version_3_1;
+
+  class Version_3_2 "Version 3.2"
+
+      annotation (Documentation(info="<html>
+<p><b><span style=\"font-size: 10pt; color: #008000;\">Version 3.2 (August 5, 2020)</span></b> </p>
+<p align=\"center\"><b><span style=\"font-size: 16pt;\">ThermoSysPro modifications from version 3.1</span></b></p>
+<p>&nbsp; </p>
+<ul>
+<li>Package Correlations </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New Function Misc.Function_FM </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New Function Thermal.Function_U1 </p>
+<ul>
+<li>Component FlueGases.HeatExchangers.StaticFluegasesFluegasesExchangerKS </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Introduction of connector&nbsp; InputReal Kcorr and variable Kcor </p>
+<ul>
+<li>Components FlueGases.Volumes.VolumesATh; VolumesBTh; VolumesCTh and VolumesDTh </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New&nbsp; parameters&nbsp;hr, Xco20, Xh2o0, Xo20, Xso20 </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Initial section is modified to replace state variable T with state variable h. </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P,&nbsp;T,&nbsp;Xco2,&nbsp;Xh2o,&nbsp;Xo2,&nbsp;Xso2)*der(P) +&nbsp;ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P,&nbsp;T,&nbsp;Xco2,&nbsp;Xh2o,&nbsp;Xo2,&nbsp;Xso2)*cp*der(T))&nbsp;=&nbsp;BQ; is replaced by&nbsp;V*(ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P,&nbsp;T,&nbsp;Xco2,&nbsp;Xh2o,&nbsp;Xo2,&nbsp;Xso2)*der(P) +&nbsp;ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P,&nbsp;T,&nbsp;Xco2,&nbsp;Xh2o,&nbsp;Xo2,&nbsp;Xso2)*der(h&nbsp;-&nbsp;Xh2o*hr))&nbsp;=&nbsp;BQ; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation V*((h*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P) + (h*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*cp*der(T)) = BH; is replaced by&nbsp; V*(((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodp(P, T, Xco2, Xh2o, Xo2, Xso2) - 1)*der(P) + ((h - Xh2o*hr)*ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(P, T, Xco2, Xh2o, Xo2, Xso2) + rho)*der(h - Xh2o*hr)) = BH; </p>
+<ul>
+<li>Component FlueGases.Volumes.VolumesATh&nbsp; and VolumesBTh </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;BH&nbsp;=&nbsp;Ce1.Q*he1 + Ce2.Q*he2 - Cs1.Q*hs1 - Cs2.Q*hs2 + Cth.W; &nbsp;is replaced by&nbsp; BH&nbsp;=&nbsp;Ce1.Q*(he1&nbsp;-&nbsp;Ce1.Xh2o*hr)&nbsp;+&nbsp;Ce2.Q*(he2&nbsp;-&nbsp;Ce2.Xh2o*hr)&nbsp;-&nbsp;Cs1.Q*(hs1&nbsp;-&nbsp;Cs1.Xh2o*hr)&nbsp;-&nbsp;Cs2.Q*(hs2&nbsp;-&nbsp;Cs2.Xh2o*hr)&nbsp;+&nbsp;Cth.W; </p>
+<ul>
+<li>Component FlueGases.Volumes.VolumesCTh </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation BH = Ce1.Q*he1 + Ce2.Q*he2 + Ce3.Q*he3 - Cs.Q*hs + Cth.W; is replaced by&nbsp; BH = Ce1.Q*(he1 - Ce1.Xh2o*hr) + Ce2.Q*(he2 - Ce2.Xh2o*hr) + Ce3.Q*(he3 - Ce3.Xh2o*hr) - Cs.Q*(hs - Cs.Xh2o*hr) + Cth.W; </p>
+<ul>
+<li>Component FlueGases.Volumes.VolumesDTh </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation BH = Ce1.Q*he1 &ndash; Cs1.Q*hs1 &ndash; Cs2.Q*hs2 &ndash; Cs3.Q*hs3 + Cth.W; is replaced by&nbsp; &nbsp;BH&nbsp;=&nbsp;Ce.Q*(he&nbsp;-&nbsp;Ce.Xh2o*hr)&nbsp;-&nbsp;Cs1.Q*(hs1&nbsp;-&nbsp;Cs1.Xh2o*hr)&nbsp;-&nbsp;Cs2.Q*(hs2&nbsp;-&nbsp;Cs2.Xh2o*hr)&nbsp;-&nbsp;Cs3.Q*(hs3&nbsp;-&nbsp;Cs3.Xh2o*hr)&nbsp;+&nbsp;Cth.W; </p>
+<ul>
+<li>Component FlueGases.Junctions.Mixer2 </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation 0&nbsp;=&nbsp;Ce1.Q*he1&nbsp;+&nbsp;Ce2.Q*he2&nbsp;-&nbsp;Cs.Q*hs; is replaced by&nbsp;&nbsp; 0&nbsp;=&nbsp;Ce1.Q*(he1&nbsp;-&nbsp;Ce1.Xh2o*hr)&nbsp;+&nbsp;Ce2.Q*(he2&nbsp;-&nbsp;Ce2.Xh2o*hr)&nbsp;-&nbsp;Cs.Q*(hs&nbsp;-&nbsp;Cs.Xh2o*hr); </p>
+<ul>
+<li>Component FlueGases.Junctions.Splitter2 </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation 0&nbsp;=&nbsp;Ce.Q*he - Cs1.Q*hs1 - Cs2.Q*hs2 is replaced by&nbsp;&nbsp; 0&nbsp;=&nbsp;Ce.Q*(he - Ce.Xh2o*hr) - Cs1.Q*(hs1 - Cs1.Xh2o*hr) - Cs2.Q*(hs2 - Cs2.Xh2o*hr); </p>
+<ul>
+<li>Package FlueGases.BoundaryConditions </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SourceQX </p>
+<ul>
+<li>Package Combustion.CombustionChambers </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component GenericCombustion1D </p>
+<ul>
+<li>Component CombustionChamber.GenericCombustion </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equations &nbsp;Hfuel = Cpfuel*Tfuel;&nbsp;&nbsp;&nbsp; Hcv = Cpcd*Tsf;&nbsp; Hbf = Cpcd*Tbf; &nbsp;are replaced by Hfuel = Cpfuel*(Tfuel - 273.16);&nbsp; Hcv = Cpcd*(Tsf - 273.16);&nbsp; Hbf = Cpcd*(Tbf - 273.16); </p>
+<ul>
+<li>Component Combustion.CombustionChambers.GTCombustionChamber </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation Wcpat&nbsp;=&nbsp;Qea*XQat*(Hiscpat&nbsp;-&nbsp;Hecpat)/eta_isc; is replaced by Wcpat&nbsp;=&nbsp;Qea*XQat*(Hiscpat&nbsp;-&nbsp;Hecpat)*eta_isc; </p>
+<ul>
+<li>Component Combustion.BoundaryConditions.FuelSourcePQ </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp;</span></span><span style=\"font-family: Courier New;\">Parameter rho=0.72 is replaced by rho=720 </p>
+<ul>
+<li>Package Properties </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New Package Properties.DryAirIdealGas </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New Package Properties.SolarSalt </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package Properties.Fluid has been completed </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package Properties.C3H3F5 has been completed </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package Properties.MoltenSalt has been completed </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package Properties.Oil_TherminolVP1 has been completed </p>
+<ul>
+<li>Package ThermoSysPro </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package Solar </p>
+<ul>
+<li>Package Thermal.HeatTransfer </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component HeatExchangerWallWithLosses </p>
+<ul>
+<li>Package WaterSteam.HeatExchangers </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component CoolingTower </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicOnePhaseFlowShell </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicTwoPhaseFlowRiser </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component DynamicTwoFlowHeatExchangerShell </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SteamGenerator_1SG </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component SteamGenerator_4SG </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component StaticCondenserHEI </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Component TemperatureWallBoiler is removed </p>
+<ul>
+<li>Package WaterSteam.Volumes </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New component TwoPhaseCavityOnePipe </p>
+<ul>
+<li>Component WaterSteam.Machines.StodolaTurbine </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter eta_is_wet(start=0.83) &quot;Isentropic efficiency for wet steam&quot;; eta_is_wet = xm*eta_is; </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.LumpedStraightPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter ntubes </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation mu&nbsp;=&nbsp;ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho,&nbsp;T); is replaced by mu&nbsp;=&nbsp;ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm,h,fluid,mode, 0.1,0.1,0.1,0); for fluid = 2 </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.InvSingularPressureLoss </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation deltaP&nbsp;=&nbsp;if&nbsp;noEvent(abs(Q)&nbsp;&lt;&nbsp;Qeps)&nbsp;then&nbsp;1.e10&nbsp;else&nbsp;K*ThermoSysPro.Functions.ThermoSquare(Q,&nbsp;eps)/rho; is replaced by deltaP&nbsp;=&nbsp;if&nbsp;noEvent(abs(Q)&nbsp;&lt;&nbsp;Qeps)&nbsp;then&nbsp;1.e-10&nbsp;else&nbsp;K*ThermoSysPro.Functions.ThermoSquare(Q,&nbsp;eps)/rho; </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation hc[i] = hcCorr*3.66*k[i]/D; &nbsp;is replaced by hc[i] = hcCorr*k[i]/D*max(4.36,0.023*Re1[i]^0.8*Pr[i]^0.4); </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation dpa[i] = noEvent(Q[i]* abs Q[i]*(1/rhoc[i + 1] - 1/rhoc[i])/A^2); is replaced by dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2; </p>
+<ul>
+<li>Component WaterSteam. HeatExchangers.DynamicTwoPhaseFlowPipe </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation xv1[i] = pro1[i].x); is replaced by xv1[i] = if noEvent((P[i+1] &gt; pcrit) or (T1[i] &gt; Tcrit)) then 1 else pro1[i].x; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;xv2[i] = pro2[i].x); is replaced by xv2[i]&nbsp;=&nbsp;if&nbsp;noEvent(((P[i]&nbsp;+&nbsp;P[i&nbsp;+&nbsp;1])/2&nbsp;&gt;&nbsp;pcrit)&nbsp;or&nbsp;(T2[i]&nbsp;&gt;&nbsp;Tcrit))&nbsp;then&nbsp;1&nbsp;else&nbsp;pro2[i].x; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation dpa[i] = noEvent(Q[i]* abs Q[i]*(1/rhoc[i + 1] - 1/rhoc[i])/A^2); is replaced by dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2; </p>
+<ul>
+<li>Component WaterSteam.Junctions.SteamExtractionSplitter </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter&nbsp;Real&nbsp;alpha&nbsp;=&nbsp;1&nbsp;&quot;Steam&nbsp;extraction&nbsp;rate&nbsp;(0&nbsp;&lt;=&nbsp;alpha&nbsp;&lt;=&nbsp;1)&quot;; is replaced by&nbsp; parameter&nbsp;Real&nbsp;alpha&nbsp;=&nbsp;1&nbsp;&quot;Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 &lt;= alpha &lt;= 1)&quot;; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation x_ex = 1 - alpha*(1 - proe.x); is replaced by x_ex = alpha*proe.x; </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicCondenser </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Component is replaced by new component DynamicCondenser (from SEPTEN) </p>
+<ul>
+<li>Component&nbsp; WaterSteam.HeatExchangers.DynamicWaterWaterExchanger </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation DPc[i]&nbsp;=&nbsp;p_Kc*Qc[i]^2/rhoc[i]; is replaced by DPc[i]&nbsp;=&nbsp;p_Kc*ThermoSysPro.Functions.ThermoSquare(Qc[i],&nbsp;1.e-3)/rhoc[i]; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation DPf[i]&nbsp;=&nbsp;p_Kf*Qf[i]^2/rhof[i]; is replaced &nbsp;by DPf[i]&nbsp;=&nbsp;p_Kf*ThermoSysPro.Functions.ThermoSquare(Qf[i],&nbsp;1.e-3)/rhof[i]; </p>
+<ul>
+<li>Component&nbsp; WaterSteam.HeatExchangers.StaticWaterWaterExchanger </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation DPc&nbsp;=&nbsp;p_Kc*Qc^2/rhoc; is replaced by DPc&nbsp;=&nbsp;p_Kc*ThermoSysPro.Functions.ThermoSquare(Qc,&nbsp;1.e-3)/rhoc; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation DPf&nbsp;=&nbsp;p_Kf*Qf^2/rhof; is replaced by DPf&nbsp;=&nbsp;p_Kf*ThermoSysPro.Functions.ThermoSquare(Qf,&nbsp;1.e-3)/rhof; </p>
+<ul>
+<li>Component&nbsp; WaterSteam.Machines.CentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter Integer mode=0&nbsp; is replaced by&nbsp; parameter Integer mode=1&nbsp;</p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp;</span></span><span style=\"font-family: Courier New;\">Equation Wm - Wr = 0; is replaced by Cm - Cr = 0; &nbsp;</p>
+<ul>
+<li>Component&nbsp; WaterSteam.Machines.DynamicCentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter Integer mode=0&nbsp; is replaced by&nbsp; parameter Integer mode=1&nbsp; </p>
+<ul>
+<li>Component&nbsp; WaterSteam.Machines.StaticCentrifugalPump </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter Integer mode=0&nbsp; is replaced by&nbsp; parameter Integer mode=1&nbsp; </p>
+<ul>
+<li>Component&nbsp; WaterSteam.Volumes.Pressurizer </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">parameter Real Cevap=0.5 &quot;Evaporation coefficient&quot;; &nbsp;is replaced by&nbsp; parameter Real Cevap=0.1 &quot;Evaporation coefficient&quot;; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;&nbsp;Qcond&nbsp;=&nbsp;noEvent(Ccond*rhov*Vv*(hvs&nbsp;-&nbsp;hv)/(hvs&nbsp;-&nbsp;hls)&nbsp;+&nbsp;(Cas.Q*(hls&nbsp;-&nbsp;Cas.h) +&nbsp;0.5*(Wpv&nbsp;+&nbsp;abs(Wpv))&nbsp;+&nbsp;Wlv)/(hv&nbsp;-&nbsp;hls));&nbsp; is replaced by&nbsp; Qcond = Ccond*rhov*Vv*(hvs - hv)/(hvs - hls); </p>
+<ul>
+<li>Component&nbsp; WaterSteam.Junctions.SteamDryer </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Deleted variable Real&nbsp;eta1(start=1.0)&nbsp;&quot;Vapor&nbsp;mass&nbsp;fraction&nbsp;at&nbsp;outlet&nbsp;(0&nbsp;&lt;&nbsp;eta&nbsp;&lt;=&nbsp;1)&quot;; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">&nbsp;Deleted equation eta1 = noEvent(max(xe, eta)); </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;Csl.h_vol&nbsp;=&nbsp;noEvent(if&nbsp;&nbsp;(Csv.Q&nbsp;&gt;&nbsp;0)&nbsp;then&nbsp;(if&nbsp;(xe&nbsp;&gt;&nbsp;0)&nbsp;then&nbsp;lsat1.h&nbsp;else&nbsp;Cev.h)&nbsp;else&nbsp;&nbsp;h); is replaced by Csl.h_vol&nbsp;=&nbsp;noEvent(if&nbsp;(xe&nbsp;&gt;&nbsp;0)&nbsp;then&nbsp;lsat1.h&nbsp;else&nbsp;Cev.h); </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;Csv.Q&nbsp;=&nbsp;Cev.Q*xe/eta1; is replaced by Csv.Q&nbsp;=&nbsp;noEvent(if&nbsp;(xe&nbsp;&gt;&nbsp;0)&nbsp;then&nbsp;Cev.Q*(1-eta*(1-xe))&nbsp;else&nbsp;0); </p>
+<ul>
+<li>Component&nbsp; MultiFluids.Machines.AlternatingEngine </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter Pnom is removed </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Constant&nbsp;Real&nbsp;Gamma=1.3333&nbsp;&quot;Flue&nbsp;gases&nbsp;gamma&nbsp;=&nbsp;Cp/Cv&quot;; is replaced by parameter Real Gamma=1.3333 &quot;Flue gases gamma = Cp/Cv&quot;; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;Tfcb&nbsp;=&nbsp;(Wcomb&nbsp;-&nbsp;Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp,&nbsp;(Tfcp&nbsp;+&nbsp;Tfcb)/2,&nbsp;XsfCO2,&nbsp;XsfH2O,&nbsp;XsfO2,&nbsp;XsfSO2)/0.75/Qsf&nbsp;+&nbsp;Tfcp; &nbsp;is replaced by&nbsp; Tfcb = Wcomb/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/Qsf + Tfcp; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation &nbsp;&nbsp;if&nbsp;(Wmeca&nbsp;&gt;&nbsp;(Pnom&nbsp;*&nbsp;0.5))&nbsp;then Welec&nbsp;=&nbsp;(Wmeca*Relec)*(0.0479*Cosphi&nbsp;+&nbsp;0.952); &nbsp;&nbsp;else Welec&nbsp;=&nbsp;(Wmeca*Relec_red)*(0.0479*Cosphi&nbsp;+&nbsp;0.952); &nbsp;&nbsp;end&nbsp;if; &nbsp;is replaced by Welec&nbsp;=&nbsp;Wmeca*Relec; </p>
+<ul>
+<li>Component&nbsp; MultiFluids.Boilers.FossilFuelBoiler </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter&nbsp; Boiler_efficiency_type&nbsp;=&nbsp;1 &quot;1:&nbsp;Taking into account LHV&nbsp;only&nbsp;-&nbsp;2:&nbsp;Using&nbsp;the&nbsp;total&nbsp;incoming&nbsp;power&quot;; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation eta_boil&nbsp;=&nbsp;100*Wboil/Wfuel; is replaced by if&nbsp;(Boiler_efficiency_type&nbsp;==&nbsp;1)&nbsp;then eta_boil&nbsp;=&nbsp;100*Wboil/Wfuel; else eta_boil&nbsp;=&nbsp;100*Wboil/Wtot; end&nbsp;if; </p>
+<ul>
+<li>Package InstrumentationAndControl </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New block AdaptorForFMU.AdaptorModelicaTSP </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New block AdaptorForFMU.AdaptorTSPModelica </p>
+<ul>
+<li>All components MultiFluids.Machines.CHPEngine* </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter Pnom is removed </p>
+<ul>
+<li>Component FlueGases.HeatExchangers.StaticWallFlueGasesExchanger </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Parameter Surf_ext becomes public </p>
+<ul>
+<li>Component WaterSteam.HeatExchangers.DynamicOnePhaseFlow </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Component is renamed as DynamicOnePhaseFlowShell </p>
+<ul>
+<li>Component WaterSteam.Volumes.Tank </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">The momentum balance equations are replaced by singular pressure losses that represent the pressure losses at the orifices. </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.DynamicCheckValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">The spring torque Cr is removed. </p>
+<ul>
+<li>Component WaterSteam.PressureLosses.DynamicReliefValve </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Component is completely modified (previous version was incorrect). </p>
+</html>"), Icon(graphics={
+          Ellipse(
+            lineColor={75,138,73},
+            fillColor={75,138,73},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-100.0,-100.0},{100.0,100.0}}),
+          Polygon(origin={-4.167,-15.0},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+            smooth=Smooth.Bezier),
+          Ellipse(origin={7.5,56.5},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-12.5,-12.5},{12.5,12.5}})}));
+  end Version_3_2;
+
+  class Version_4_0 "Version 4.0"
+
+      annotation (Documentation(info="<html>
+<p><b><span style=\"font-size: 10pt; color: #008000;\">Version 4.0 (June 7, 2022)</span></b> </p>
+<p align=\"center\"><b><span style=\"font-size: 16pt;\">ThermoSysPro modifications from version 3.2</span></b></p>
+<p>&nbsp; </p>
+<ul>
+<li>New package ThermoSysPro.Fluid </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package utilizes new fluid connectors that can handle all fluids in package ThermoSysPro.Properties. </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package handles thermal diffusion as a new option. </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Package replaces packages ThermoSysPro.Combustion, ThermoSysPro.FlueGases, ThermoSysPro.MultiFluids, ThermoSysPro.WaterSolution and ThermoSysPro.WaterSteam. </p>
+<ul>
+<li>Component ThermoSysPro.WaterSteam.HeatExchangers.DynamicWaterWaterExchanger </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;DPc[i] = p_Kc*ThermoSysPro.Functions.ThermoSquare(Qc[i], 1.e-3)/rhoc[i]; &nbsp;is replaced by&nbsp; DPc[i] = p_Kc*Qc[i]^2/rhoc[i]; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;DPf[i] = p_Kf*ThermoSysPro.Functions.ThermoSquare(Qf[i], 1.e-3)/rhof[i]; &nbsp;is replaced by&nbsp; DPf[i] = p_Kf*Qf[i]^2/rhof[i]; </p>
+<ul>
+<li>Component ThermoSysPro.WaterSteam.HeatExchangers.StaticWaterWaterExchanger </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;DPc = p_Kc*ThermoSysPro.Functions.ThermoSquare(Qc, 1.e-3)/rhoc; &nbsp;is replaced by&nbsp; DPc = p_Kc*Qc^2/rhoc; </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation&nbsp;DPf = p_Kf*ThermoSysPro.Functions.ThermoSquare(Qf, 1.e-3)/rhof; &nbsp;is replaced by&nbsp; DPf = p_Kf*Qf^2/rhof; </p>
+<ul>
+<li>Component ThermoSysPro.Fluid.Machines.Generator_11 </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; C</span></span><span style=\"font-family: Courier New;\">omponent is duplicated in package ThermoSysPro.ElectroMechanics.Machines for package Fluid </p>
+<ul>
+<li>Component ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall</li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New option: dynamic_energy_balance </p>
+<ul>
+<li>Package ThermoSysPro.Units</li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package: SI that duplicates package Modelica.SIunits </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package: nonSI </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New package: xSI </p>
+<ul>
+<li>All components in package ThermoSysPro</li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">ThermoSysPro.Units.xSI.DifferentialTemperature is replaced by ThermoSysPro.Units.SI.TemperatureDifference </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">ThermoSysPro.Units.xSI.DifferentialPressure is replaced by ThermoSysPro.Units.SI.PressureDifference </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">ThermoSysPro.Units.xSI.MassFraction is replaced by ThermoSysPro.Units.SI.MassFraction </p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">All references to Modelica.SIunits are replaced by references to ThermoSysPro.Units </p>
+<ul>
+<li>Component ThermoSysPro.Solar.Collectors.FresnelField </li>
+</ul>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter: Lc</p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter: <code>trackingFactor</code></p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">New parameter: <code>thermalLossPhy</code></p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation <code>KL&nbsp;=<span style=\"color: #ff0000;\">&nbsp;cos</span>(pi*thetaL/180)*(1&nbsp;-&nbsp;h*<span style=\"color: #ff0000;\">tan</span>(pi*thetaL/180)/L); is replaced by KL&nbsp;=<span style=\"color: #ff0000;\">&nbsp;cos</span>(pi*thetaL/180)*(1&nbsp;-&nbsp;h*<span style=\"color: #ff0000;\">tan</span>(pi*thetaL/180)/Lc);</code></p>
+<p style=\"margin-left: 60px;\"><span style=\"font-family: Courier New;\">o<span style=\"font-family: Times New Roman; font-size: 7pt;\">&nbsp;&nbsp; </span></span><span style=\"font-family: Courier New;\">Equation <code>dQloss[i]&nbsp;=&nbsp;pi*D*L/Ns*(0.5*F12*Emi*5.67e-8*(T[i]^4&nbsp;-&nbsp;(0.0552*T0^(1.5))^4)&nbsp;+&nbsp;hc*(T[i]&nbsp;-&nbsp;T0)); is replaced by dQloss[i]&nbsp;=&nbsp;<span style=\"color: #0000ff;\">if&nbsp;</span>thermalLossPhy<span style=\"color: #0000ff;\">&nbsp;then&nbsp;</span>pi*D*L/Ns*(0.5*F12*Emi*5.67e-8*(T[i]^4&nbsp;-&nbsp;(0.0552*T0^(1.5))^4)&nbsp;+&nbsp;hc*(T[i]&nbsp;-&nbsp;T0))<span style=\"color: #0000ff;\">&nbsp;else&nbsp;</span>L/Ns*(A1*deltaT[i]&nbsp;+&nbsp;A2*deltaT[i]^2);</code></p>
+</html>"), Icon(graphics={
+          Ellipse(
+            lineColor={75,138,73},
+            fillColor={75,138,73},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-100.0,-100.0},{100.0,100.0}}),
+          Polygon(origin={-4.167,-15.0},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+            smooth=Smooth.Bezier),
+          Ellipse(origin={7.5,56.5},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-12.5,-12.5},{12.5,12.5}})}));
+  end Version_4_0;
+    annotation (Documentation(info="<html>
+<h3><font color=\"#008000\" size=5>Release notes</font></h3>
+<p>
+This section summarizes the changes that have been performed
+on the ThermoSysPro library.
+</html>
+"), Icon(graphics={
+          Ellipse(
+            lineColor={75,138,73},
+            fillColor={75,138,73},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-100.0,-100.0},{100.0,100.0}}),
+          Polygon(origin={-4.167,-15.0},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+            smooth=Smooth.Bezier),
+          Ellipse(origin={7.5,56.5},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-12.5,-12.5},{12.5,12.5}})}));
+  end ReleaseNotes;
+
+  class Contact "Contact"
+
+    annotation (Documentation(info="<html>
+<h3><font color=\"#008000\" size=5>Contact
+</font></h3>
+<dl><dt>The development of the ThermoSysPro library is organized by<br/></dt>
+<dd>Daniel Bouskela<br/></dd>
+<dd>EDF/R&AMP;D</dd>
+<dd>6, quai Watier</dd>
+<dd>F-78401 Chatou Cedex</dd>
+<dd>France<br/></dd>
+<dd>email: <a href=\"mailto:daniel.bouskela@edf.fr\">daniel.bouskela@edf.fr</a></dd>
+</dl></html>"), Icon(graphics={
+          Ellipse(
+            lineColor={75,138,73},
+            fillColor={75,138,73},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-100.0,-100.0},{100.0,100.0}}),
+          Polygon(origin={-4.167,-15.0},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+            smooth=Smooth.Bezier),
+          Ellipse(origin={7.5,56.5},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-12.5,-12.5},{12.5,12.5}})}));
+
+  end Contact;
+
+  class ThermoSysProLicense "License"
+
+    annotation (Documentation(info="<html>
+<h3><font color=\"#008000\" size=5>The ThermoSysPro License
+</font></h3>
+<p>The use of the ThermoSysPro Library is granted by EDF under the provisions of Modelica License 2.</p>
+<p>Packages <b>Neutronics</b> and <b>InstrumentationAndControl.BFE</b> are not released under open source license.</p>
+<hr>
+<h4><a name=\"ModelicaLicense2\"></a>The Modelica License 2</h4>
+<p>
+<b>Preamble.</b> The goal of this license is that Modelica related
+model libraries, software, images, documents, data files etc. can be
+used freely in the original or a modified form, in open source and in
+commercial environments (as long as the license conditions below are
+fulfilled, in particular sections 2c) and 2d). The Original Work is
+provided free of charge and the use is completely at your own risk.
+Developers of free Modelica packages are encouraged to utilize this
+license for their work.</p>
+
+<p>
+The Modelica License applies to any Original Work that contains the
+following licensing notice adjacent to the copyright notice(s) for
+this Original Work:</p>
+<p><b>Licensed
+by the Modelica Association under the Modelica License 2</b></p>
+
+<p><b>1. Definitions.</b></p>
+<ol>
+ <li>&ldquo;License&rdquo; is this Modelica License.</li>
+
+ <li>
+ &ldquo;Original Work&rdquo; is any work of authorship, including
+ software, images, documents, data files, that contains the above
+ licensing notice or that is packed together with a licensing notice
+ referencing it.</li>
+
+ <li>
+ &ldquo;Licensor&rdquo; is the provider of the Original Work who has
+ placed this licensing notice adjacent to the copyright notice(s) for
+ the Original Work. The Original Work is either directly provided by
+ the owner of the Original Work, or by a licensee of the owner.</li>
+
+ <li>
+ &ldquo;Derivative Work&rdquo; is any modification of the Original
+ Work which represents, as a whole, an original work of authorship.
+ For the matter of clarity and as examples: </li>
+
+ <ol>
+  <li>
+  Derivative Work shall not include work that remains separable from
+  the Original Work, as well as merely extracting a part of the
+  Original Work without modifying it.</li>
+
+  <li>
+  Derivative Work shall not include (a) fixing of errors and/or (b)
+  adding vendor specific Modelica annotations and/or (c) using a
+  subset of the classes of a Modelica package, and/or (d) using a
+  different representation, e.g., a binary representation.</li>
+
+  <li>
+  Derivative Work shall include classes that are copied from the
+  Original Work where declarations, equations or the documentation
+  are modified.</li>
+
+  <li>
+  Derivative Work shall include executables to simulate the models
+  that are generated by a Modelica translator based on the Original
+  Work (of a Modelica package).</li>
+ </ol>
+
+ <li>
+ &ldquo;Modified Work&rdquo; is any modification of the Original Work
+ with the following exceptions: (a) fixing of errors and/or (b)
+ adding vendor specific Modelica annotations and/or (c) using a
+ subset of the classes of a Modelica package, and/or (d) using a
+ different representation, e.g., a binary representation.</li>
+
+ <li>
+ &quot;Source Code&quot; means the preferred form of the Original
+ Work for making modifications to it and all available documentation
+ describing how to modify the Original Work.</li>
+
+ <li>
+ &ldquo;You&rdquo; means an individual or a legal entity exercising
+ rights under, and complying with all of the terms of, this License.</li>
+
+ <li>
+ &ldquo;Modelica package&rdquo; means any Modelica library that is
+ defined with the<br>&ldquo;<FONT FACE=\"Courier New, monospace\"><FONT SIZE=2 STYLE=\"font-size: 9pt\"><b>package</b></FONT></FONT><FONT FACE=\"Courier New, monospace\"><FONT SIZE=2 STYLE=\"font-size: 9pt\">
+ &lt;Name&gt; ... </FONT></FONT><FONT FACE=\"Courier New, monospace\"><FONT SIZE=2 STYLE=\"font-size: 9pt\"><b>end</b></FONT></FONT><FONT FACE=\"Courier New, monospace\"><FONT SIZE=2 STYLE=\"font-size: 9pt\">
+ &lt;Name&gt;;</FONT></FONT>&ldquo; Modelica language element.</li>
+</ol>
+
+<p>
+<b>2. Grant of Copyright License.</b> Licensor grants You a
+worldwide, royalty-free, non-exclusive, sublicensable license, for
+the duration of the copyright, to do the following:</p>
+
+<ol>
+ <li><p>
+ To reproduce the Original Work in copies, either alone or as part of
+ a collection.</li></p>
+ <li><p>
+ To create Derivative Works according to Section 1d) of this License.</li></p>
+ <li><p>
+ To distribute or communicate to the public copies of the <u>Original
+ Work</u> or a <u>Derivative Work</u> under <u>this License</u>. No
+ fee, neither as a copyright-license fee, nor as a selling fee for
+ the copy as such may be charged under this License. Furthermore, a
+ verbatim copy of this License must be included in any copy of the
+ Original Work or a Derivative Work under this License.<br>      For
+ the matter of clarity, it is permitted A) to distribute or
+ communicate such copies as part of a (possible commercial)
+ collection where other parts are provided under different licenses
+ and a license fee is charged for the other parts only and B) to
+ charge for mere printing and shipping costs.</li></p>
+ <li><p>
+ To distribute or communicate to the public copies of a <u>Derivative
+ Work</u>, alternatively to Section 2c), under <u>any other license</u>
+ of your choice, especially also under a license for
+ commercial/proprietary software, as long as You comply with Sections
+ 3, 4 and 8 below. <br>      For the matter of clarity, no
+ restrictions regarding fees, either as to a copyright-license fee or
+ as to a selling fee for the copy as such apply.</li></p>
+ <li><p>
+ To perform the Original Work publicly.</li></p>
+ <li><p>
+ To display the Original Work publicly.</li></p>
+</ol>
+
+<p>
+<b>3. Acceptance.</b> Any use of the Original Work or a
+Derivative Work, or any action according to either Section 2a) to 2f)
+above constitutes Your acceptance of this License.</p>
+
+<p>
+<b>4. Designation of Derivative Works and of Modified Works.
+</b>The identifying designation of Derivative Work and of Modified
+Work must be different to the corresponding identifying designation
+of the Original Work. This means especially that the (root-level)
+name of a Modelica package under this license must be changed if the
+package is modified (besides fixing of errors, adding vendor specific
+Modelica annotations, using a subset of the classes of a Modelica
+package, or using another representation, e.g. a binary
+representation).</p>
+
+<p>
+<b>5. Grant of Patent License.</b>
+Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license,
+under patent claims owned by the Licensor or licensed to the Licensor by
+the owners of the Original Work that are embodied in the Original Work
+as furnished by the Licensor, for the duration of the patents,
+to make, use, sell, offer for sale, have made, and import the Original Work
+and Derivative Works under the conditions as given in Section 2.
+For the matter of clarity, the license regarding Derivative Works covers
+patent claims to the extent as they are embodied in the Original Work only.</p>
+
+<p>
+<b>6. Provision of Source Code.</b> Licensor agrees to provide
+You with a copy of the Source Code of the Original Work but reserves
+the right to decide freely on the manner of how the Original Work is
+provided.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For the matter of clarity, Licensor might provide only a binary
+representation of the Original Work. In that case, You may (a) either
+reproduce the Source Code from the binary representation if this is
+possible (e.g., by performing a copy of an encrypted Modelica
+package, if encryption allows the copy operation) or (b) request the
+Source Code from the Licensor who will provide it to You.</p>
+
+<p>
+<b>7. Exclusions from License Grant.</b> Neither the names of
+Licensor, nor the names of any contributors to the Original Work, nor
+any of their trademarks or service marks, may be used to endorse or
+promote products derived from this Original Work without express
+prior permission of the Licensor. Except as otherwise expressly
+stated in this License and in particular in Sections 2 and 5, nothing
+in this License grants any license to Licensor&rsquo;s trademarks,
+copyrights, patents, trade secrets or any other intellectual
+property, and no patent license is granted to make, use, sell, offer
+for sale, have made, or import embodiments of any patent claims.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No license is granted to the trademarks of
+Licensor even if such trademarks are included in the Original Work,
+except as expressly stated in this License. Nothing in this License
+shall be interpreted to prohibit Licensor from licensing under terms
+different from this License any Original Work that Licensor otherwise
+would have a right to license.</p>
+
+<p>
+<b>8. Attribution Rights.</b> You must retain in the Source
+Code of the Original Work and of any Derivative Works that You
+create, all author, copyright, patent, or trademark notices, as well
+as any descriptive text identified therein as an &quot;Attribution
+Notice&quot;. The same applies to the licensing notice of this
+License in the Original Work. For the matter of clarity, &ldquo;author
+notice&rdquo; means the notice that identifies the original
+author(s). <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You must cause the Source Code for any Derivative
+Works that You create to carry a prominent Attribution Notice
+reasonably calculated to inform recipients that You have modified the
+Original Work. <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In case the Original Work or Derivative Work is not provided in
+Source Code, the Attribution Notices shall be appropriately
+displayed, e.g., in the documentation of the Derivative Work.</p>
+
+<p><b>9. Disclaimer
+of Warranty. <br></b><u><b>The Original Work is provided under this
+License on an &quot;as is&quot; basis and without warranty, either
+express or implied, including, without limitation, the warranties of
+non-infringement, merchantability or fitness for a particular
+purpose. The entire risk as to the quality of the Original Work is
+with You.</b></u><b> </b>This disclaimer of warranty constitutes an
+essential part of this License. No license to the Original Work is
+granted by this License except under this disclaimer.</p>
+
+<p>
+<b>10. Limitation of Liability.</b> Under no circumstances and
+under no legal theory, whether in tort (including negligence),
+contract, or otherwise, shall the Licensor, the owner or a licensee
+of the Original Work be liable to anyone for any direct, indirect,
+general, special, incidental, or consequential damages of any
+character arising as a result of this License or the use of the
+Original Work including, without limitation, damages for loss of
+goodwill, work stoppage, computer failure or malfunction, or any and
+all other commercial damages or losses. This limitation of liability
+shall not apply to the extent applicable law prohibits such
+limitation.</p>
+
+<p>
+<b>11. Termination.</b> This License conditions your rights to
+undertake the activities listed in Section 2 and 5, including your
+right to create Derivative Works based upon the Original Work, and
+doing so without observing these terms and conditions is prohibited
+by copyright law and international treaty. Nothing in this License is
+intended to affect copyright exceptions and limitations. This License
+shall terminate immediately and You may no longer exercise any of the
+rights granted to You by this License upon your failure to observe
+the conditions of this license.</p>
+
+<p>
+<b>12. Termination for Patent Action.</b> This License shall
+terminate automatically and You may no longer exercise any of the
+rights granted to You by this License as of the date You commence an
+action, including a cross-claim or counterclaim, against Licensor,
+any owners of the Original Work or any licensee alleging that the
+Original Work infringes a patent. This termination provision shall
+not apply for an action alleging patent infringement through
+combinations of the Original Work under combination with other
+software or hardware.</p>
+
+<p>
+<b>13. Jurisdiction.</b> Any action or suit relating to this
+License may be brought only in the courts of a jurisdiction wherein
+the Licensor resides and under the laws of that jurisdiction
+excluding its conflict-of-law provisions. The application of the
+United Nations Convention on Contracts for the International Sale of
+Goods is expressly excluded. Any use of the Original Work outside the
+scope of this License or after its termination shall be subject to
+the requirements and penalties of copyright or patent law in the
+appropriate jurisdiction. This section shall survive the termination
+of this License.</p>
+
+<p>
+<b>14. Attorneys&rsquo; Fees.</b> In any action to enforce the
+terms of this License or seeking damages relating thereto, the
+prevailing party shall be entitled to recover its costs and expenses,
+including, without limitation, reasonable attorneys' fees and costs
+incurred in connection with such action, including any appeal of such
+action. This section shall survive the termination of this License.</p>
+
+<p>
+<b>15. Miscellaneous.</b>
+</p>
+<ol>
+ <li>If any
+ provision of this License is held to be unenforceable, such
+ provision shall be reformed only to the extent necessary to make it
+ enforceable.</li>
+
+ <li>No verbal
+ ancillary agreements have been made. Changes and additions to this
+ License must appear in writing to be valid. This also applies to
+ changing the clause pertaining to written form.</li>
+
+ <li>You may use the
+ Original Work in all ways not otherwise restricted or conditioned by
+ this License or by law, and Licensor promises not to interfere with
+ or be responsible for such uses by You.</li>
+</ol>
+
+<p>
+<br>
+</p>
+
+</html>
+"), Icon(graphics={
+          Ellipse(
+            lineColor={75,138,73},
+            fillColor={75,138,73},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-100.0,-100.0},{100.0,100.0}}),
+          Polygon(origin={-4.167,-15.0},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+            smooth=Smooth.Bezier),
+          Ellipse(origin={7.5,56.5},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-12.5,-12.5},{12.5,12.5}})}));
+
+  end ThermoSysProLicense;
+
+  class ThermoSysProDocumentation "Documentation"
+
+    annotation (Documentation(info="<html>
+<p><b><span style=\"font-size: 12pt; color: #008000;\">Documentation </span></b></p>
+<p>A <a href=\"https://www.modelica.org/events/modelica2011/Proceedings/pages/papers/15_2_ID_115_a_fv.pdf\">conference paper</a> explains the fundamentals of the library.</p>
+<p>The <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a> is available from Springer.</p>
+<p>The full documentation of the library is still under construction. </p>
+</html>"), Icon(graphics={
+          Ellipse(
+            lineColor={75,138,73},
+            fillColor={75,138,73},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-100.0,-100.0},{100.0,100.0}}),
+          Polygon(origin={-4.167,-15.0},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+            smooth=Smooth.Bezier),
+          Ellipse(origin={7.5,56.5},
+            fillColor={255,255,255},
+            pattern=LinePattern.None,
+            fillPattern=FillPattern.Solid,
+            extent={{-12.5,-12.5},{12.5,12.5}})}));
+
+  end ThermoSysProDocumentation;
+  annotation (DocumentationClass=true, Documentation(info="<html>
+<p><b><span style=\"font-size: 12pt; color: #008000;\">Users Guide of the ThermoSysPro Library</span></b></p>
+<p>ThermoSysPro is a library for the modelling and simulation of power plants and energy systems. It is developed with the Modelica language from the <a href=\"http://www.Modelica.org\">Modelica Association</a>. It provides components in various disciplines related to the modelling of power plants and energy systems. </p>
+<p> See <a href='https://thermosyspro.gitlab.io/documentation/'> the online documentation</a> (to be updated soon).</h4>
+</html>"),
+    Icon(graphics={
+        Ellipse(
+          lineColor={75,138,73},
+          fillColor={75,138,73},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          extent={{-100.0,-100.0},{100.0,100.0}}),
+        Polygon(origin={-4.167,-15.0},
+          fillColor={255,255,255},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}},
+          smooth=Smooth.Bezier),
+        Ellipse(origin={7.5,56.5},
+          fillColor={255,255,255},
+          pattern=LinePattern.None,
+          fillPattern=FillPattern.Solid,
+          extent={{-12.5,-12.5},{12.5,12.5}})}));
+end UsersGuide;
diff --git a/ThermoSysPro/WaterSolution/BoundaryConditions/RefP.mo b/ThermoSysPro/WaterSolution/BoundaryConditions/RefP.mo
index 884d8d38df2ec8cf15224d9db52942f978ef2545..edcc069e289d8cf60229679c713bd135e0a51ae2 100644
--- a/ThermoSysPro/WaterSolution/BoundaryConditions/RefP.mo
+++ b/ThermoSysPro/WaterSolution/BoundaryConditions/RefP.mo
@@ -1,88 +1,88 @@
-within ThermoSysPro.WaterSolution.BoundaryConditions;
-model RefP "Fixed pressure reference"
-  parameter Units.SI.AbsolutePressure P0=1.e5 "Fixed fluid pressure";
-
-  Connectors.WaterSolutionInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.WaterSolutionOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  C1.P = C2.P;
-  C1.T = C2.T;
-  C1.Q = C2.Q;
-  C1.Xh2o = C2.Xh2o;
-
-  C1.P = IPressure.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "P")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "P")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefP;
+within ThermoSysPro.WaterSolution.BoundaryConditions;
+model RefP "Fixed pressure reference"
+  parameter Units.SI.AbsolutePressure P0=1.e5 "Fixed fluid pressure";
+
+  Connectors.WaterSolutionInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.WaterSolutionOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  C1.P = C2.P;
+  C1.T = C2.T;
+  C1.Q = C2.Q;
+  C1.Xh2o = C2.Xh2o;
+
+  C1.P = IPressure.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "P")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "P")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefP;
diff --git a/ThermoSysPro/WaterSolution/BoundaryConditions/RefQ.mo b/ThermoSysPro/WaterSolution/BoundaryConditions/RefQ.mo
index f79590494caece8efb664ac6eae19c62259e52e4..0a4ff6c5ec7e3d6cf8002cfa76f0603d8ab6ab47 100644
--- a/ThermoSysPro/WaterSolution/BoundaryConditions/RefQ.mo
+++ b/ThermoSysPro/WaterSolution/BoundaryConditions/RefQ.mo
@@ -1,88 +1,88 @@
-within ThermoSysPro.WaterSolution.BoundaryConditions;
-model RefQ "Fixed mass flow reference"
-  parameter Units.SI.MassFlowRate Q0=1.e5 "Fixed fluid mass flow";
-
-  Connectors.WaterSolutionInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.WaterSolutionOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  C1.P = C2.P;
-  C1.T = C2.T;
-  C1.Q = C2.Q;
-  C1.Xh2o = C2.Xh2o;
-
-  C1.Q = IMassFlow.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Q")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefQ;
+within ThermoSysPro.WaterSolution.BoundaryConditions;
+model RefQ "Fixed mass flow reference"
+  parameter Units.SI.MassFlowRate Q0=1.e5 "Fixed fluid mass flow";
+
+  Connectors.WaterSolutionInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.WaterSolutionOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  C1.P = C2.P;
+  C1.T = C2.T;
+  C1.Q = C2.Q;
+  C1.Xh2o = C2.Xh2o;
+
+  C1.Q = IMassFlow.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Q")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefQ;
diff --git a/ThermoSysPro/WaterSolution/BoundaryConditions/RefT.mo b/ThermoSysPro/WaterSolution/BoundaryConditions/RefT.mo
index 489a1545097ce0350d5f0c6e420b2c73193301b8..5faafb983d847b48712e19acba4527bd050ff459 100644
--- a/ThermoSysPro/WaterSolution/BoundaryConditions/RefT.mo
+++ b/ThermoSysPro/WaterSolution/BoundaryConditions/RefT.mo
@@ -1,88 +1,88 @@
-within ThermoSysPro.WaterSolution.BoundaryConditions;
-model RefT "Fixed temperature reference"
-  parameter Units.SI.Temperature T0=320 "Fixed fluid temperature";
-
-  Connectors.WaterSolutionInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.WaterSolutionOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  C1.P = C2.P;
-  C1.T = C2.T;
-  C1.Q = C2.Q;
-  C1.Xh2o = C2.Xh2o;
-
-  C1.T = ITemperature.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefT;
+within ThermoSysPro.WaterSolution.BoundaryConditions;
+model RefT "Fixed temperature reference"
+  parameter Units.SI.Temperature T0=320 "Fixed fluid temperature";
+
+  Connectors.WaterSolutionInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.WaterSolutionOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  C1.P = C2.P;
+  C1.T = C2.T;
+  C1.Q = C2.Q;
+  C1.Xh2o = C2.Xh2o;
+
+  C1.T = ITemperature.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefT;
diff --git a/ThermoSysPro/WaterSolution/BoundaryConditions/RefXh2o.mo b/ThermoSysPro/WaterSolution/BoundaryConditions/RefXh2o.mo
index 412a3877905c7550ab1f38e2ba82b14fe2aa70a1..57ab92802b2bde22e662f0cd0d8717c689574927 100644
--- a/ThermoSysPro/WaterSolution/BoundaryConditions/RefXh2o.mo
+++ b/ThermoSysPro/WaterSolution/BoundaryConditions/RefXh2o.mo
@@ -1,88 +1,88 @@
-within ThermoSysPro.WaterSolution.BoundaryConditions;
-model RefXh2o "Fixed Xh20 reference"
-  parameter Real Xh2o0=0.5 "Fixed Xh2o";
-
-  Connectors.WaterSolutionInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.WaterSolutionOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IXh2o
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(IXh2o) == 0) then
-    IXh2o.signal = Xh2o0;
-  end if;
-
-  C1.P = C2.P;
-  C1.T = C2.T;
-  C1.Q = C2.Q;
-  C1.Xh2o = C2.Xh2o;
-
-  C1.Xh2o = IXh2o.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Xh2o")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Xh2o")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefXh2o;
+within ThermoSysPro.WaterSolution.BoundaryConditions;
+model RefXh2o "Fixed Xh20 reference"
+  parameter Real Xh2o0=0.5 "Fixed Xh2o";
+
+  Connectors.WaterSolutionInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.WaterSolutionOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IXh2o
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(IXh2o) == 0) then
+    IXh2o.signal = Xh2o0;
+  end if;
+
+  C1.P = C2.P;
+  C1.T = C2.T;
+  C1.Q = C2.Q;
+  C1.Xh2o = C2.Xh2o;
+
+  C1.Xh2o = IXh2o.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Xh2o")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Xh2o")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefXh2o;
diff --git a/ThermoSysPro/WaterSolution/BoundaryConditions/Sink.mo b/ThermoSysPro/WaterSolution/BoundaryConditions/Sink.mo
index 06e7a94f68225a9a5c7d4fc08a93945568bb9d6d..92970f58f907a067a0ccc41c38872013c156698c 100644
--- a/ThermoSysPro/WaterSolution/BoundaryConditions/Sink.mo
+++ b/ThermoSysPro/WaterSolution/BoundaryConditions/Sink.mo
@@ -1,75 +1,75 @@
-within ThermoSysPro.WaterSolution.BoundaryConditions;
-model Sink "Sink"
-
-public
-  Units.SI.AbsolutePressure P "Sink pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.Temperature T "Sink Temperature";
-  Real Xh2o "h2o mas fraction";
-
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-equation
-
-  Ce.Xh2o = Xh2o;
-  Ce.T = T;
-  Ce.Q = Q;
-  Ce.P = P;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          lineThickness=1,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Polygon(
-          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          lineThickness=1,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Sink;
+within ThermoSysPro.WaterSolution.BoundaryConditions;
+model Sink "Sink"
+
+public
+  Units.SI.AbsolutePressure P "Sink pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.Temperature T "Sink Temperature";
+  Real Xh2o "h2o mas fraction";
+
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+equation
+
+  Ce.Xh2o = Xh2o;
+  Ce.T = T;
+  Ce.Q = Q;
+  Ce.P = P;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          lineThickness=1,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Polygon(
+          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          lineThickness=1,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Sink;
diff --git a/ThermoSysPro/WaterSolution/BoundaryConditions/SinkP.mo b/ThermoSysPro/WaterSolution/BoundaryConditions/SinkP.mo
index fe0fe9e65b8d991040344f877dfb09d1b690595e..5b447be252ec644fea01b27c96b255c2fd8c18f6 100644
--- a/ThermoSysPro/WaterSolution/BoundaryConditions/SinkP.mo
+++ b/ThermoSysPro/WaterSolution/BoundaryConditions/SinkP.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.WaterSolution.BoundaryConditions;
-model SinkP "Pressure sink"
-  parameter Units.SI.AbsolutePressure P0=300000 "Source pressure";
-  parameter Units.SI.Temperature T0=290 "Source temperature";
-  parameter Real Xh2o0=0.05 "Source water mass fraction";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.SpecificEnthalpy Xh2o "Water mass fraction";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(
-        origin={50,0},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IXh2o
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.WaterSolutionInlet C
-                                annotation (Placement(transformation(extent={{
-            -110,-10},{-90,10}}, rotation=0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-  C.Xh2o = Xh2o;
-
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  T = ITemperature.signal;
-
-  if (cardinality(IXh2o) == 0) then
-    IXh2o.signal = Xh2o0;
-  end if;
-
-  Xh2o = IXh2o.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Text(extent={{40,28},{58,8}}, textString=
-                                          "P"),
-        Text(extent={{-28,60},{-10,40}}, textString=
-                                             "T"),
-        Text(extent={{-28,-40},{-10,-60}}, textString=
-                                               "Xh2o"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          lineThickness=1,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-94,26},{98,-30}}, textString=
-                                             "P")}),
-    Window(
-      x=0.06,
-      y=0.16,
-      width=0.67,
-      height=0.71),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Text(extent={{-28,60},{-10,40}}, textString=
-                                             "T"),
-        Text(extent={{40,28},{58,8}}, textString=
-                                          "P"),
-        Text(extent={{-28,-40},{-10,-60}}, textString=
-                                               "Xh2o"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          lineThickness=1,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-94,26},{98,-30}}, textString=
-                                             "P")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SinkP;
+within ThermoSysPro.WaterSolution.BoundaryConditions;
+model SinkP "Pressure sink"
+  parameter Units.SI.AbsolutePressure P0=300000 "Source pressure";
+  parameter Units.SI.Temperature T0=290 "Source temperature";
+  parameter Real Xh2o0=0.05 "Source water mass fraction";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.SpecificEnthalpy Xh2o "Water mass fraction";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(
+        origin={50,0},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IXh2o
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.WaterSolutionInlet C
+                                annotation (Placement(transformation(extent={{
+            -110,-10},{-90,10}}, rotation=0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+  C.Xh2o = Xh2o;
+
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  T = ITemperature.signal;
+
+  if (cardinality(IXh2o) == 0) then
+    IXh2o.signal = Xh2o0;
+  end if;
+
+  Xh2o = IXh2o.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Text(extent={{40,28},{58,8}}, textString=
+                                          "P"),
+        Text(extent={{-28,60},{-10,40}}, textString=
+                                             "T"),
+        Text(extent={{-28,-40},{-10,-60}}, textString=
+                                               "Xh2o"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          lineThickness=1,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-94,26},{98,-30}}, textString=
+                                             "P")}),
+    Window(
+      x=0.06,
+      y=0.16,
+      width=0.67,
+      height=0.71),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Text(extent={{-28,60},{-10,40}}, textString=
+                                             "T"),
+        Text(extent={{40,28},{58,8}}, textString=
+                                          "P"),
+        Text(extent={{-28,-40},{-10,-60}}, textString=
+                                               "Xh2o"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          lineThickness=1,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-94,26},{98,-30}}, textString=
+                                             "P")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SinkP;
diff --git a/ThermoSysPro/WaterSolution/BoundaryConditions/SourceP.mo b/ThermoSysPro/WaterSolution/BoundaryConditions/SourceP.mo
index 3c731bc9e068c88d74b1c0bb8afc519ed5b8369d..a43de9be291b9c2e5d4061c82e759efd26eb57a9 100644
--- a/ThermoSysPro/WaterSolution/BoundaryConditions/SourceP.mo
+++ b/ThermoSysPro/WaterSolution/BoundaryConditions/SourceP.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.WaterSolution.BoundaryConditions;
-model SourceP "Pressure source"
-  parameter Units.SI.AbsolutePressure P0=300000 "Source pressure";
-  parameter Units.SI.Temperature T0=290 "Source temperature";
-  parameter Real Xh2o0=0.5 "Source water mass fraction";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.SpecificEnthalpy Xh2o "Water mass fraction";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IXh2o
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.WaterSolutionOutlet C
-                                annotation (Placement(transformation(extent={{
-            90,-10},{110,10}}, rotation=0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.T = T;
-  C.Xh2o = Xh2o;
-
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  T = ITemperature.signal;
-
-  if (cardinality(IXh2o) == 0) then
-    IXh2o.signal = Xh2o0;
-  end if;
-
-  Xh2o = IXh2o.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-58,30},{-40,10}}, textString=
-                                             "P"),
-        Text(extent={{-28,60},{-10,40}}, textString=
-                                             "T"),
-        Text(extent={{-28,-40},{-10,-60}}, textString=
-                                               "Xh20"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          lineThickness=1,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-96,28},{96,-28}}, textString=
-                                             "S")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-28,60},{-10,40}}, textString=
-                                             "T"),
-        Text(extent={{-58,30},{-40,10}}, textString=
-                                             "P"),
-        Text(extent={{-28,-40},{-10,-60}}, textString=
-                                               "h"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          lineThickness=1,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-96,28},{96,-28}}, textString=
-                                             "S")}),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SourceP;
+within ThermoSysPro.WaterSolution.BoundaryConditions;
+model SourceP "Pressure source"
+  parameter Units.SI.AbsolutePressure P0=300000 "Source pressure";
+  parameter Units.SI.Temperature T0=290 "Source temperature";
+  parameter Real Xh2o0=0.5 "Source water mass fraction";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.SpecificEnthalpy Xh2o "Water mass fraction";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IXh2o
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.WaterSolutionOutlet C
+                                annotation (Placement(transformation(extent={{
+            90,-10},{110,10}}, rotation=0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.T = T;
+  C.Xh2o = Xh2o;
+
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  T = ITemperature.signal;
+
+  if (cardinality(IXh2o) == 0) then
+    IXh2o.signal = Xh2o0;
+  end if;
+
+  Xh2o = IXh2o.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-58,30},{-40,10}}, textString=
+                                             "P"),
+        Text(extent={{-28,60},{-10,40}}, textString=
+                                             "T"),
+        Text(extent={{-28,-40},{-10,-60}}, textString=
+                                               "Xh20"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          lineThickness=1,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-96,28},{96,-28}}, textString=
+                                             "S")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-28,60},{-10,40}}, textString=
+                                             "T"),
+        Text(extent={{-58,30},{-40,10}}, textString=
+                                             "P"),
+        Text(extent={{-28,-40},{-10,-60}}, textString=
+                                               "h"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-40,40},{-40,-40},{40,-40},{-40,40}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          lineThickness=1,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-96,28},{96,-28}}, textString=
+                                             "S")}),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SourceP;
diff --git a/ThermoSysPro/WaterSolution/BoundaryConditions/SourcePQ.mo b/ThermoSysPro/WaterSolution/BoundaryConditions/SourcePQ.mo
index fc320e2ee099c33cb2fd2761646733d81fc5454a..44ae056f19fe96bcac2e0e85d12838d0b76e412f 100644
--- a/ThermoSysPro/WaterSolution/BoundaryConditions/SourcePQ.mo
+++ b/ThermoSysPro/WaterSolution/BoundaryConditions/SourcePQ.mo
@@ -1,69 +1,69 @@
-within ThermoSysPro.WaterSolution.BoundaryConditions;
-model SourcePQ "Pressure and mass flow source"
-
-  parameter Units.SI.AbsolutePressure P=1.e5 "Source presure";
-  parameter Units.SI.MassFlowRate Q=10 "Mass flow rate";
-  parameter Units.SI.Temperature T=300 "Source temperature";
-  parameter Real Xh2o=0.05 "h2o mass fraction";
-
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  Cs.Xh2o = Xh2o;
-  Cs.T = T;
-  Cs.Q = Q;
-  Cs.P = P;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Polygon(
-          points={{-40,-40},{-40,40},{40,-40},{-40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={160,160,164},
-          fillPattern=FillPattern.Solid),
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Polygon(
-          points={{-40,-40},{-40,40},{40,-40},{-40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SourcePQ;
+within ThermoSysPro.WaterSolution.BoundaryConditions;
+model SourcePQ "Pressure and mass flow source"
+
+  parameter Units.SI.AbsolutePressure P=1.e5 "Source presure";
+  parameter Units.SI.MassFlowRate Q=10 "Mass flow rate";
+  parameter Units.SI.Temperature T=300 "Source temperature";
+  parameter Real Xh2o=0.05 "h2o mass fraction";
+
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  Cs.Xh2o = Xh2o;
+  Cs.T = T;
+  Cs.Q = Q;
+  Cs.P = P;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Polygon(
+          points={{-40,-40},{-40,40},{40,-40},{-40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={160,160,164},
+          fillPattern=FillPattern.Solid),
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Polygon(
+          points={{-40,-40},{-40,40},{40,-40},{-40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SourcePQ;
diff --git a/ThermoSysPro/WaterSolution/BoundaryConditions/package.mo b/ThermoSysPro/WaterSolution/BoundaryConditions/package.mo
index a48528bd333f5a86aa4780700918bc32f8b66ea0..00757e94857397a03ec80b08d577ee8674213e45 100644
--- a/ThermoSysPro/WaterSolution/BoundaryConditions/package.mo
+++ b/ThermoSysPro/WaterSolution/BoundaryConditions/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSolution;
-package BoundaryConditions "Boundary conditions"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end BoundaryConditions;
+within ThermoSysPro.WaterSolution;
+package BoundaryConditions "Boundary conditions"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end BoundaryConditions;
diff --git a/ThermoSysPro/WaterSolution/Connectors.mo b/ThermoSysPro/WaterSolution/Connectors.mo
index 3d3667ec50a7e554307aa742b7b368a8ca4dc116..0bc7eab63a4ea3686f2ffa0276c48abdbb91efb5 100644
--- a/ThermoSysPro/WaterSolution/Connectors.mo
+++ b/ThermoSysPro/WaterSolution/Connectors.mo
@@ -1,203 +1,203 @@
-within ThermoSysPro.WaterSolution;
-package Connectors "Connectors"
-  connector WaterSolutionInlet "Water solution inlet"
-    Units.SI.AbsolutePressure P "Fluid pressure in the control volume";
-    Units.SI.Temperature T "Fluid temperature in the control volume";
-    Units.SI.MassFlowRate Q
-      "Mass flow of the fluid crossing the boundary of the control volume";
-    Real Xh2o "H20 mass fraction of the solution in the control volume";
-
-    input Boolean a=true
-      "Pseudo-variable for the verification of the connection orientation";
-    output Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,-100},{100,100}},
-            lineColor={0,0,0},
-            fillColor={0,0,255},
-            fillPattern=FillPattern.Solid), Line(points={{-100,100},{100,-100}},
-              color={255,255,255})}),
-      Window(
-        x=0.31,
-        y=0.13,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-  end WaterSolutionInlet;
-
-  connector WaterSolutionOutlet "Water solution outlet"
-    Units.SI.AbsolutePressure P "Fluid pressure in the control volume";
-    Units.SI.Temperature T "Fluid temperature in the control volume";
-    Units.SI.MassFlowRate Q
-      "Mass flow of the fluid crossing the boundary of the control volume";
-    Real Xh2o "H20 mass fraction of the solution in the control volume";
-
-    output Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    input Boolean b=true
-      "Pseudo-variable for the verification of the connection orientation";
-
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,-100},{102,100}},
-            lineColor={0,0,0},
-            fillColor={255,85,85},
-            fillPattern=FillPattern.Solid), Line(points={{-100,100},{102,-100}},
-              color={255,255,255})}),
-      Window(
-        x=0.31,
-        y=0.13,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-  end WaterSolutionOutlet;
-  annotation (Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end Connectors;
+within ThermoSysPro.WaterSolution;
+package Connectors "Connectors"
+  connector WaterSolutionInlet "Water solution inlet"
+    Units.SI.AbsolutePressure P "Fluid pressure in the control volume";
+    Units.SI.Temperature T "Fluid temperature in the control volume";
+    Units.SI.MassFlowRate Q
+      "Mass flow of the fluid crossing the boundary of the control volume";
+    Real Xh2o "H20 mass fraction of the solution in the control volume";
+
+    input Boolean a=true
+      "Pseudo-variable for the verification of the connection orientation";
+    output Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,-100},{100,100}},
+            lineColor={0,0,0},
+            fillColor={0,0,255},
+            fillPattern=FillPattern.Solid), Line(points={{-100,100},{100,-100}},
+              color={255,255,255})}),
+      Window(
+        x=0.31,
+        y=0.13,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+  end WaterSolutionInlet;
+
+  connector WaterSolutionOutlet "Water solution outlet"
+    Units.SI.AbsolutePressure P "Fluid pressure in the control volume";
+    Units.SI.Temperature T "Fluid temperature in the control volume";
+    Units.SI.MassFlowRate Q
+      "Mass flow of the fluid crossing the boundary of the control volume";
+    Real Xh2o "H20 mass fraction of the solution in the control volume";
+
+    output Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    input Boolean b=true
+      "Pseudo-variable for the verification of the connection orientation";
+
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,-100},{102,100}},
+            lineColor={0,0,0},
+            fillColor={255,85,85},
+            fillPattern=FillPattern.Solid), Line(points={{-100,100},{102,-100}},
+              color={255,255,255})}),
+      Window(
+        x=0.31,
+        y=0.13,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+  end WaterSolutionOutlet;
+  annotation (Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end Connectors;
diff --git a/ThermoSysPro/WaterSolution/HeatExchangers/ExchangerEfficiency.mo b/ThermoSysPro/WaterSolution/HeatExchangers/ExchangerEfficiency.mo
index 3be1b102ba4b2c35a7bdd0e76f07811424c4eb70..8bcdb00f32f2b7fbac43020d0912854a0a43bcf0 100644
--- a/ThermoSysPro/WaterSolution/HeatExchangers/ExchangerEfficiency.mo
+++ b/ThermoSysPro/WaterSolution/HeatExchangers/ExchangerEfficiency.mo
@@ -1,171 +1,171 @@
-within ThermoSysPro.WaterSolution.HeatExchangers;
-model ExchangerEfficiency
-  "H2O/LiBr solution heat exchanger with prescribed efficiency"
-  parameter Real Eff=0.9
-    "Thermal exchange efficiency (between 0 and 1 =W/Wmax)";
-  parameter Units.SI.AbsolutePressure DPc=0
-    "Pressure loss in the hot fluid as a percent of the pressure at the inlet";
-  parameter Units.SI.AbsolutePressure DPf=0
-    "Pressure loss in the cold fluid as a percent of the pressure at the inlet";
-
-public
-  Units.SI.Power W(start=1e6) "Power exchanged";
-  Units.SI.Temperature Tec(start=500) "Hot fluid temperature at the inlet";
-  Units.SI.Temperature Tsc(start=400) "Hot fluid temperature at the outlet";
-  Units.SI.Temperature Tef(start=350) "Cold fluid temperature at the inlet";
-  Units.SI.Temperature Tsf(start=450) "Cold fluid temperature at the outlet";
-  Units.SI.SpecificEnthalpy Hec(start=5e5)
-    "Hot fluid specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hsc(start=2e5)
-    "Hot fluid specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy Hef(start=1e5)
-    "Cold fluid specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hsf(start=4e5)
-    "Cold fluid specific enthalpy at the outlet";
-  Units.SI.Power Wmax(start=1e6) "Maximum exchangeable power";
-  Units.SI.Power Wmaxf(start=1e6) "Maximum power acceptable by the cold fluid";
-  Units.SI.Power Wmaxc(start=1e6) "Maximum power releasable by the hot fluid";
-  Units.SI.SpecificEnthalpy Hmaxf(start=1e5)
-    "Maximum specific enthalpy reachable by the cold fluid";
-  Units.SI.SpecificEnthalpy Hminc(start=1e5)
-    "Minimum specific enthalpy reachable by the hot fluid";
-  Real Xc(start=0.5) "H2O mass fraction in the hot fluid";
-  Real Xf(start=0.5) "H2O mass fraction in the cold fluid";
-  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
-  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
-  Units.SI.SpecificEnthalpy Hliq(start=4e5)
-    "Liquid water specific enthalpy at the cold inlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DTc_ec(start=10)
-    "Difference with the cristallisation temperature at the hot inlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DTc_sc(start=10)
-    "Difference with the cristallisation temperature at the hot outlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DTc_ef(start=10)
-    "Difference with the cristallisation temperature at the cold inlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DTc_sf(start=10)
-    "Difference with the cristallisation temperature at the cold outlet";
-
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ef
-    annotation (Placement(transformation(extent={{-110,-8},{-90,12}}, rotation=
-            0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ec
-    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
-           0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Sc
-    annotation (Placement(transformation(extent={{48,-70},{68,-50}}, rotation=0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Sf
-    annotation (Placement(transformation(extent={{90,-8},{110,12}}, rotation=0)));
-equation
-
-  /* Mass flow rates */
-  Ec.Q = Sc.Q;
-  Ef.Q = Sf.Q;
-
-  Qc = Ec.Q;
-  Qf = Ef.Q;
-
- /* H2O mass fractions */
-  Ec.Xh2o = Sc.Xh2o;
-  Ef.Xh2o = Sf.Xh2o;
-
-  Xc = Ec.Xh2o;
-  Xf = Ef.Xh2o;
-
- /* Specific enthalpies at the inlet and at the outlet */
-  Hec = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Tec, Xc);
-  Hef = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Tef, Xf);
-  W = Qf*(Hsf - Hef);
-  W = Qc*(Hec - Hsc);
-
-  Hliq = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(1e5, Tef, 1);
-
-  /* Temperatures at the inlet and at the outlet */
-  Tec = Ec.T;
-  Tsc = Sc.T;
-  Tef = Ef.T;
-  Tsf = Sf.T;
-
-  /* Temperature differences with cristallisation */
-  DTc_ec = ThermoSysPro.Properties.WaterSolution.DTcristal_TX(Ec.T, Xc);
-  DTc_sc = ThermoSysPro.Properties.WaterSolution.DTcristal_TX(Sc.T, Xc);
-  DTc_ef = ThermoSysPro.Properties.WaterSolution.DTcristal_TX(Ef.T, Xf);
-  DTc_sf = ThermoSysPro.Properties.WaterSolution.DTcristal_TX(Sf.T, Xf);
-
-  /* Temperatures at the outlet */
-  Tsf = ThermoSysPro.Properties.WaterSolution.Temperature_hX(Hsf, Xf);
-  Tsc = ThermoSysPro.Properties.WaterSolution.Temperature_hX(Hsc, Xc);
-
-  /* Pressures */
-  Sc.P = if (Qc > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
-  Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100;
-
-  /* Hypothesis : counter-current heat exchanger */
-
-  /* Maximum exchangeable power on the cold side */
-  Hmaxf = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Tec, Xf);
-  Wmaxf = Qf * (Hmaxf - Hef);
-
-  /* Maximum exchangeable power on the hot side */
-  Hminc = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Tef, Xc);
-  Wmaxc = Qc * (Hec - Hminc);
-
-  /* Power exchanged */
-  Wmax = min(Wmaxf, Wmaxc);
-  W = Eff*Wmax;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-56,-50},{-56,2},{2,2},{60,2},{60,-50}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-50,66},{46,-2}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Line(points={{-100,60},{100,-60}}, color={0,0,255})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-58,-50},{-58,0},{0,0},{58,0},{58,-50}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-50,66},{46,-2}},
-          lineColor={0,0,255},
-          textString=
-               "E"),
-        Line(points={{-100,60},{100,-60}}, color={0,0,255})}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-end ExchangerEfficiency;
+within ThermoSysPro.WaterSolution.HeatExchangers;
+model ExchangerEfficiency
+  "H2O/LiBr solution heat exchanger with prescribed efficiency"
+  parameter Real Eff=0.9
+    "Thermal exchange efficiency (between 0 and 1 =W/Wmax)";
+  parameter Units.SI.AbsolutePressure DPc=0
+    "Pressure loss in the hot fluid as a percent of the pressure at the inlet";
+  parameter Units.SI.AbsolutePressure DPf=0
+    "Pressure loss in the cold fluid as a percent of the pressure at the inlet";
+
+public
+  Units.SI.Power W(start=1e6) "Power exchanged";
+  Units.SI.Temperature Tec(start=500) "Hot fluid temperature at the inlet";
+  Units.SI.Temperature Tsc(start=400) "Hot fluid temperature at the outlet";
+  Units.SI.Temperature Tef(start=350) "Cold fluid temperature at the inlet";
+  Units.SI.Temperature Tsf(start=450) "Cold fluid temperature at the outlet";
+  Units.SI.SpecificEnthalpy Hec(start=5e5)
+    "Hot fluid specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hsc(start=2e5)
+    "Hot fluid specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy Hef(start=1e5)
+    "Cold fluid specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hsf(start=4e5)
+    "Cold fluid specific enthalpy at the outlet";
+  Units.SI.Power Wmax(start=1e6) "Maximum exchangeable power";
+  Units.SI.Power Wmaxf(start=1e6) "Maximum power acceptable by the cold fluid";
+  Units.SI.Power Wmaxc(start=1e6) "Maximum power releasable by the hot fluid";
+  Units.SI.SpecificEnthalpy Hmaxf(start=1e5)
+    "Maximum specific enthalpy reachable by the cold fluid";
+  Units.SI.SpecificEnthalpy Hminc(start=1e5)
+    "Minimum specific enthalpy reachable by the hot fluid";
+  Real Xc(start=0.5) "H2O mass fraction in the hot fluid";
+  Real Xf(start=0.5) "H2O mass fraction in the cold fluid";
+  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+  Units.SI.SpecificEnthalpy Hliq(start=4e5)
+    "Liquid water specific enthalpy at the cold inlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DTc_ec(start=10)
+    "Difference with the cristallisation temperature at the hot inlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DTc_sc(start=10)
+    "Difference with the cristallisation temperature at the hot outlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DTc_ef(start=10)
+    "Difference with the cristallisation temperature at the cold inlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DTc_sf(start=10)
+    "Difference with the cristallisation temperature at the cold outlet";
+
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ef
+    annotation (Placement(transformation(extent={{-110,-8},{-90,12}}, rotation=
+            0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ec
+    annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=
+           0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Sc
+    annotation (Placement(transformation(extent={{48,-70},{68,-50}}, rotation=0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Sf
+    annotation (Placement(transformation(extent={{90,-8},{110,12}}, rotation=0)));
+equation
+
+  /* Mass flow rates */
+  Ec.Q = Sc.Q;
+  Ef.Q = Sf.Q;
+
+  Qc = Ec.Q;
+  Qf = Ef.Q;
+
+ /* H2O mass fractions */
+  Ec.Xh2o = Sc.Xh2o;
+  Ef.Xh2o = Sf.Xh2o;
+
+  Xc = Ec.Xh2o;
+  Xf = Ef.Xh2o;
+
+ /* Specific enthalpies at the inlet and at the outlet */
+  Hec = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Tec, Xc);
+  Hef = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Tef, Xf);
+  W = Qf*(Hsf - Hef);
+  W = Qc*(Hec - Hsc);
+
+  Hliq = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(1e5, Tef, 1);
+
+  /* Temperatures at the inlet and at the outlet */
+  Tec = Ec.T;
+  Tsc = Sc.T;
+  Tef = Ef.T;
+  Tsf = Sf.T;
+
+  /* Temperature differences with cristallisation */
+  DTc_ec = ThermoSysPro.Properties.WaterSolution.DTcristal_TX(Ec.T, Xc);
+  DTc_sc = ThermoSysPro.Properties.WaterSolution.DTcristal_TX(Sc.T, Xc);
+  DTc_ef = ThermoSysPro.Properties.WaterSolution.DTcristal_TX(Ef.T, Xf);
+  DTc_sf = ThermoSysPro.Properties.WaterSolution.DTcristal_TX(Sf.T, Xf);
+
+  /* Temperatures at the outlet */
+  Tsf = ThermoSysPro.Properties.WaterSolution.Temperature_hX(Hsf, Xf);
+  Tsc = ThermoSysPro.Properties.WaterSolution.Temperature_hX(Hsc, Xc);
+
+  /* Pressures */
+  Sc.P = if (Qc > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100;
+  Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100;
+
+  /* Hypothesis : counter-current heat exchanger */
+
+  /* Maximum exchangeable power on the cold side */
+  Hmaxf = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Tec, Xf);
+  Wmaxf = Qf * (Hmaxf - Hef);
+
+  /* Maximum exchangeable power on the hot side */
+  Hminc = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Tef, Xc);
+  Wmaxc = Qc * (Hec - Hminc);
+
+  /* Power exchanged */
+  Wmax = min(Wmaxf, Wmaxc);
+  W = Eff*Wmax;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-56,-50},{-56,2},{2,2},{60,2},{60,-50}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-50,66},{46,-2}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Line(points={{-100,60},{100,-60}}, color={0,0,255})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-58,-50},{-58,0},{0,0},{58,0},{58,-50}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-50,66},{46,-2}},
+          lineColor={0,0,255},
+          textString=
+               "E"),
+        Line(points={{-100,60},{100,-60}}, color={0,0,255})}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+end ExchangerEfficiency;
diff --git a/ThermoSysPro/WaterSolution/HeatExchangers/package.mo b/ThermoSysPro/WaterSolution/HeatExchangers/package.mo
index bf242cf8ac1baebc0f86326fd4b7bde2df883538..8e82f730af4687b7890979876ee0e6eab09a64a2 100644
--- a/ThermoSysPro/WaterSolution/HeatExchangers/package.mo
+++ b/ThermoSysPro/WaterSolution/HeatExchangers/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.WaterSolution;
-package HeatExchangers "Heat exchangers"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end HeatExchangers;
+within ThermoSysPro.WaterSolution;
+package HeatExchangers "Heat exchangers"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end HeatExchangers;
diff --git a/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerP.mo b/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerP.mo
index d13253997f33ef0f99d17ef5fb68b8461e7db78b..3122e5cceba9d703dc3ccbf4b8f8394543e08adb 100644
--- a/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerP.mo
+++ b/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerP.mo
@@ -1,65 +1,65 @@
-within ThermoSysPro.WaterSolution.LoopBreakers;
-model LoopBreakerP "Pressure loop breaker for the water solution connector"
-
-
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  Cs.Q = Ce.Q;
-  Cs.T = Ce.T;
-  Cs.Xh2o = Ce.Xh2o;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={127,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-42,38},{38,-42}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={127,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,38},{40,-42}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerP;
+within ThermoSysPro.WaterSolution.LoopBreakers;
+model LoopBreakerP "Pressure loop breaker for the water solution connector"
+
+
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  Cs.Q = Ce.Q;
+  Cs.T = Ce.T;
+  Cs.Xh2o = Ce.Xh2o;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={127,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-42,38},{38,-42}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={127,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,38},{40,-42}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerP;
diff --git a/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerQ.mo b/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerQ.mo
index 48bcd9ce6b772d0c5e5a4c8e107789dc7ceaaeda..4f598446c5d702cbe3d4d53e8f8a17b38cbd4f7f 100644
--- a/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerQ.mo
+++ b/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerQ.mo
@@ -1,65 +1,65 @@
-within ThermoSysPro.WaterSolution.LoopBreakers;
-model LoopBreakerQ "Mass flow loop breaker for the water solution connector"
-
-
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  Cs.P = Ce.P;
-  Cs.T = Ce.T;
-  Cs.Xh2o = Ce.Xh2o;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={127,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-42,38},{38,-42}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={127,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,38},{40,-42}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerQ;
+within ThermoSysPro.WaterSolution.LoopBreakers;
+model LoopBreakerQ "Mass flow loop breaker for the water solution connector"
+
+
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  Cs.P = Ce.P;
+  Cs.T = Ce.T;
+  Cs.Xh2o = Ce.Xh2o;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={127,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-42,38},{38,-42}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={127,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,38},{40,-42}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerQ;
diff --git a/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerT.mo b/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerT.mo
index 80869e26895285c607c71505b87987f0c24edfa5..dd107ce2fe508208684a4602695855fb8ea85a3e 100644
--- a/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerT.mo
+++ b/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerT.mo
@@ -1,65 +1,65 @@
-within ThermoSysPro.WaterSolution.LoopBreakers;
-model LoopBreakerT "Temperature loop breaker for the water solution connector"
-
-
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  Cs.P = Ce.P;
-  Cs.Q = Ce.Q;
-  Cs.Xh2o = Ce.Xh2o;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={127,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-42,38},{38,-42}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={127,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,38},{40,-42}},
-          lineColor={0,0,255},
-          textString=
-               "T")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerT;
+within ThermoSysPro.WaterSolution.LoopBreakers;
+model LoopBreakerT "Temperature loop breaker for the water solution connector"
+
+
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  Cs.P = Ce.P;
+  Cs.Q = Ce.Q;
+  Cs.Xh2o = Ce.Xh2o;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={127,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-42,38},{38,-42}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={127,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,38},{40,-42}},
+          lineColor={0,0,255},
+          textString=
+               "T")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerT;
diff --git a/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerXh2o.mo b/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerXh2o.mo
index 6cde90b5aaddcbb33c8040a593da03c759809d75..7301d99bb3b69a2c2f8428e70d82fa777d74a880 100644
--- a/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerXh2o.mo
+++ b/ThermoSysPro/WaterSolution/LoopBreakers/LoopBreakerXh2o.mo
@@ -1,65 +1,65 @@
-within ThermoSysPro.WaterSolution.LoopBreakers;
-model LoopBreakerXh2o "Xh20 loop breaker for the water solution connector"
-
-
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  Cs.Q = Ce.Q;
-  Cs.T = Ce.T;
-  Cs.P = Ce.P;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={127,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-42,38},{38,-42}},
-          lineColor={0,0,255},
-          textString=
-               "Xh2o")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={127,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,38},{40,-42}},
-          lineColor={0,0,255},
-          textString=
-               "Xh2o")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerXh2o;
+within ThermoSysPro.WaterSolution.LoopBreakers;
+model LoopBreakerXh2o "Xh20 loop breaker for the water solution connector"
+
+
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet Cs
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  Cs.Q = Ce.Q;
+  Cs.T = Ce.T;
+  Cs.P = Ce.P;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={127,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-42,38},{38,-42}},
+          lineColor={0,0,255},
+          textString=
+               "Xh2o")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={127,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,38},{40,-42}},
+          lineColor={0,0,255},
+          textString=
+               "Xh2o")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerXh2o;
diff --git a/ThermoSysPro/WaterSolution/LoopBreakers/package.mo b/ThermoSysPro/WaterSolution/LoopBreakers/package.mo
index ac022fc5a9c86916a9fd85e05ee9cb278c2d5a84..e0c27ae8e075a0e588fb7440445cca0391b5b301 100644
--- a/ThermoSysPro/WaterSolution/LoopBreakers/package.mo
+++ b/ThermoSysPro/WaterSolution/LoopBreakers/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSolution;
-package LoopBreakers "Loop breakers"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end LoopBreakers;
+within ThermoSysPro.WaterSolution;
+package LoopBreakers "Loop breakers"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end LoopBreakers;
diff --git a/ThermoSysPro/WaterSolution/Machines/StaticCentrifugalPump.mo b/ThermoSysPro/WaterSolution/Machines/StaticCentrifugalPump.mo
index 2c64ebc2e5d08399d4191f88c7cb0d3290a365d4..d01191c942cb32cdeb2a649eee30e05953c453fe 100644
--- a/ThermoSysPro/WaterSolution/Machines/StaticCentrifugalPump.mo
+++ b/ThermoSysPro/WaterSolution/Machines/StaticCentrifugalPump.mo
@@ -1,145 +1,145 @@
-within ThermoSysPro.WaterSolution.Machines;
-model StaticCentrifugalPump "Water solution static centrifugal pump"
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
-    "Rotational speed";
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
-    "Nominal rotational speed";
-  parameter Real rm=0.85
-    "Product of the pump mechanical and electrical efficiencies";
-  parameter Boolean adiabatic_compression=false
-    "true: adiabatic compression - false: non adiabatic compression";
-  parameter Units.SI.Density rho=1000 "Fluid density";
-
-  parameter Real a1=-88.67
-    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-  parameter Real a2=0
-    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
-  parameter Real a3=43.15
-    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter Real b1=-3.7751
-    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
-  parameter Real b2=3.61
-    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
-  parameter Real b3=-0.0075464
-    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Real eps=1.e-6 "Small number";
-  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
-
-public
-  Real rh "Hydraulic efficiency";
-  Units.SI.Length hn(start=10) "Pump head";
-  Real R "Ratio VRot/VRotn (s.u.)";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow";
-  Units.SI.Power Wh "Hydraulic power";
-  Units.SI.Power Wm "Motor power";
-  Units.SI.AbsolutePressure deltaP
-    "Pressure difference between the outlet and the inlet";
-  Units.SI.SpecificEnthalpy h1 "Fluid specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy h2 "Fluid specific enthalpy at the outlet";
-  Units.SI.SpecificEnthalpy deltaH
-    "Specific enthalpy variation between the outlet and the inlet";
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandePompe
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal VRotation
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  if (cardinality(commandePompe) == 0) then
-    commandePompe.signal = true;
-  end if;
-
-  if (cardinality(VRotation) == 0) then
-    VRotation.signal = VRot;
-  end if;
-
-  deltaP = C2.P - C1.P;
-  deltaH = h2 - h1;
-
-  deltaP = rho*g*hn;
-
-  if adiabatic_compression then
-    deltaH = 0;
-  else
-    deltaH = g*hn/rh;
-  end if;
-
-  C1.Xh2o = C2.Xh2o;
-
-  C1.Q = C2.Q;
-  Q = C1.Q;
-  Q = Qv*rho;
-
-  /* Pump position (started or stopped) */
-  R = if commandePompe.signal then VRotation.signal/VRotn else 0;
-
-  /* Pump characteristics */
-  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
-  rh = noEvent(max(if (abs(R) > eps) then b1*Qv^2/R^2 + b2*Qv/R + b3 else b3, rhmin));
-
-  /* Mechanical power */
-  Wm = Q*deltaH/rm;
-
-  /* Hydraulic power */
-  Wh = Qv*deltaP/rh;
-
-  /* Computation of the fluid specific enthalpy at the inlet and at the outlet */
-  h1 = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(C1.T, C1.Xh2o);
-  h2 = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(C2.T, C2.Xh2o);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,0},{80,0}}),
-        Line(points={{80,0},{2,60}}),
-        Line(points={{80,0},{0,-60}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,0},{80,0}}),
-        Line(points={{80,0},{2,60}}),
-        Line(points={{80,0},{0,-60}})}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end StaticCentrifugalPump;
+within ThermoSysPro.WaterSolution.Machines;
+model StaticCentrifugalPump "Water solution static centrifugal pump"
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
+    "Rotational speed";
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
+    "Nominal rotational speed";
+  parameter Real rm=0.85
+    "Product of the pump mechanical and electrical efficiencies";
+  parameter Boolean adiabatic_compression=false
+    "true: adiabatic compression - false: non adiabatic compression";
+  parameter Units.SI.Density rho=1000 "Fluid density";
+
+  parameter Real a1=-88.67
+    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+  parameter Real a2=0
+    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
+  parameter Real a3=43.15
+    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter Real b1=-3.7751
+    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
+  parameter Real b2=3.61
+    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
+  parameter Real b3=-0.0075464
+    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Real eps=1.e-6 "Small number";
+  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
+
+public
+  Real rh "Hydraulic efficiency";
+  Units.SI.Length hn(start=10) "Pump head";
+  Real R "Ratio VRot/VRotn (s.u.)";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow";
+  Units.SI.Power Wh "Hydraulic power";
+  Units.SI.Power Wm "Motor power";
+  Units.SI.AbsolutePressure deltaP
+    "Pressure difference between the outlet and the inlet";
+  Units.SI.SpecificEnthalpy h1 "Fluid specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy h2 "Fluid specific enthalpy at the outlet";
+  Units.SI.SpecificEnthalpy deltaH
+    "Specific enthalpy variation between the outlet and the inlet";
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandePompe
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal VRotation
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  if (cardinality(commandePompe) == 0) then
+    commandePompe.signal = true;
+  end if;
+
+  if (cardinality(VRotation) == 0) then
+    VRotation.signal = VRot;
+  end if;
+
+  deltaP = C2.P - C1.P;
+  deltaH = h2 - h1;
+
+  deltaP = rho*g*hn;
+
+  if adiabatic_compression then
+    deltaH = 0;
+  else
+    deltaH = g*hn/rh;
+  end if;
+
+  C1.Xh2o = C2.Xh2o;
+
+  C1.Q = C2.Q;
+  Q = C1.Q;
+  Q = Qv*rho;
+
+  /* Pump position (started or stopped) */
+  R = if commandePompe.signal then VRotation.signal/VRotn else 0;
+
+  /* Pump characteristics */
+  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
+  rh = noEvent(max(if (abs(R) > eps) then b1*Qv^2/R^2 + b2*Qv/R + b3 else b3, rhmin));
+
+  /* Mechanical power */
+  Wm = Q*deltaH/rm;
+
+  /* Hydraulic power */
+  Wh = Qv*deltaP/rh;
+
+  /* Computation of the fluid specific enthalpy at the inlet and at the outlet */
+  h1 = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(C1.T, C1.Xh2o);
+  h2 = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(C2.T, C2.Xh2o);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,0},{80,0}}),
+        Line(points={{80,0},{2,60}}),
+        Line(points={{80,0},{0,-60}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,0},{80,0}}),
+        Line(points={{80,0},{2,60}}),
+        Line(points={{80,0},{0,-60}})}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end StaticCentrifugalPump;
diff --git a/ThermoSysPro/WaterSolution/Machines/StaticCentrifugalPumpNom.mo b/ThermoSysPro/WaterSolution/Machines/StaticCentrifugalPumpNom.mo
index 286cf236f24c29ecbe5b2d04e9b79f1030124c88..1eba06c24a8735fa0d4c067158baebb041a69202 100644
--- a/ThermoSysPro/WaterSolution/Machines/StaticCentrifugalPumpNom.mo
+++ b/ThermoSysPro/WaterSolution/Machines/StaticCentrifugalPumpNom.mo
@@ -1,83 +1,83 @@
-within ThermoSysPro.WaterSolution.Machines;
-model StaticCentrifugalPumpNom
-  "Static centrigugal pump with nominal operating point"
-  parameter Units.SI.MassFlowRate Qnom=1 "Nominal mass flow";
-  parameter ThermoSysPro.Units.SI.PressureDifference DPnom=1e5
-    "Nominal pressure increase";
-  parameter Real A=0.15 "x^2 coef. of the pump characteristics (A>0)";
-  parameter Real B=0.35 "x coef. of the pump characteristics (B>0)";
-  parameter Real eta=0.9 "Hydraulic efficiency";
-
-public
-  ThermoSysPro.Units.SI.PressureDifference deltaP(start=1e5)
-    "Pressure difference between the outlet and the inlet";
-  Units.SI.SpecificEnthalpy He(start=1e3)
-    "Fluid specific enthalpy at the inlet";
-  Units.SI.SpecificEnthalpy Hs(start=1e3)
-    "Fluid specific enthalpy at the outlet";
-  Units.SI.Power W(start=1e6) "Mechanical power of the pump";
-
-  Connectors.WaterSolutionInlet Ce
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
-           0)));
-  Connectors.WaterSolutionOutlet Cs
-    annotation (Placement(transformation(extent={{80,40},{100,60}}, rotation=0)));
-equation
-
-  Cs.Xh2o = Ce.Xh2o;
-  Cs.Q = Ce.Q;
-
-  deltaP = Cs.P - Ce.P;
-
-  /* Fluid specific enthalpy at the inlet */
-  He = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Ce.T,Ce.Xh2o);
-
-  /* Fluid specific enthalpy at the outlet */
-  Hs = He + W/Ce.Q;
-
-  /* Fluid temperature at the outlet */
-  Cs.T = ThermoSysPro.Properties.WaterSolution.Temperature_hX(Hs,Cs.Xh2o);
-
-  /* Fluid pressure at the outlet - The density is supposed to be constant */
-  (deltaP/DPnom - 1) = - A * (Ce.Q/Qnom - 1) * abs(Ce.Q/Qnom - 1) - B * (Ce.Q/Qnom - 1);
-
-  /* Pump mechanical power */
-  W = Ce.Q*deltaP/eta;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{64,-18},{42,-64},{-22,-80},{-68,-60},{-90,-20},{-90,20},{-70,
-              60},{-30,80},{90,80},{90,20},{54,20},{64,-18}},
-          lineColor={0,0,0},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{64,-18},{42,-64},{-22,-80},{-68,-60},{-90,-20},{-90,20},{-70,
-              60},{-30,80},{90,80},{90,20},{54,20},{64,-18}},
-          lineColor={0,0,0},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride </li>
-</ul>
-</html>"));
-end StaticCentrifugalPumpNom;
+within ThermoSysPro.WaterSolution.Machines;
+model StaticCentrifugalPumpNom
+  "Static centrigugal pump with nominal operating point"
+  parameter Units.SI.MassFlowRate Qnom=1 "Nominal mass flow";
+  parameter ThermoSysPro.Units.SI.PressureDifference DPnom=1e5
+    "Nominal pressure increase";
+  parameter Real A=0.15 "x^2 coef. of the pump characteristics (A>0)";
+  parameter Real B=0.35 "x coef. of the pump characteristics (B>0)";
+  parameter Real eta=0.9 "Hydraulic efficiency";
+
+public
+  ThermoSysPro.Units.SI.PressureDifference deltaP(start=1e5)
+    "Pressure difference between the outlet and the inlet";
+  Units.SI.SpecificEnthalpy He(start=1e3)
+    "Fluid specific enthalpy at the inlet";
+  Units.SI.SpecificEnthalpy Hs(start=1e3)
+    "Fluid specific enthalpy at the outlet";
+  Units.SI.Power W(start=1e6) "Mechanical power of the pump";
+
+  Connectors.WaterSolutionInlet Ce
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
+           0)));
+  Connectors.WaterSolutionOutlet Cs
+    annotation (Placement(transformation(extent={{80,40},{100,60}}, rotation=0)));
+equation
+
+  Cs.Xh2o = Ce.Xh2o;
+  Cs.Q = Ce.Q;
+
+  deltaP = Cs.P - Ce.P;
+
+  /* Fluid specific enthalpy at the inlet */
+  He = ThermoSysPro.Properties.WaterSolution.SpecificEnthalpy_TX(Ce.T,Ce.Xh2o);
+
+  /* Fluid specific enthalpy at the outlet */
+  Hs = He + W/Ce.Q;
+
+  /* Fluid temperature at the outlet */
+  Cs.T = ThermoSysPro.Properties.WaterSolution.Temperature_hX(Hs,Cs.Xh2o);
+
+  /* Fluid pressure at the outlet - The density is supposed to be constant */
+  (deltaP/DPnom - 1) = - A * (Ce.Q/Qnom - 1) * abs(Ce.Q/Qnom - 1) - B * (Ce.Q/Qnom - 1);
+
+  /* Pump mechanical power */
+  W = Ce.Q*deltaP/eta;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{64,-18},{42,-64},{-22,-80},{-68,-60},{-90,-20},{-90,20},{-70,
+              60},{-30,80},{90,80},{90,20},{54,20},{64,-18}},
+          lineColor={0,0,0},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{64,-18},{42,-64},{-22,-80},{-68,-60},{-90,-20},{-90,20},{-70,
+              60},{-30,80},{90,80},{90,20},{54,20},{64,-18}},
+          lineColor={0,0,0},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride </li>
+</ul>
+</html>"));
+end StaticCentrifugalPumpNom;
diff --git a/ThermoSysPro/WaterSolution/Machines/package.mo b/ThermoSysPro/WaterSolution/Machines/package.mo
index ec397de5911f794b107ab102348763d0acea5b9f..143ef3e670527fc6468335f029ba4b5de565a2ef 100644
--- a/ThermoSysPro/WaterSolution/Machines/package.mo
+++ b/ThermoSysPro/WaterSolution/Machines/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSolution;
-package Machines "Machines"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Machines;
+within ThermoSysPro.WaterSolution;
+package Machines "Machines"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Machines;
diff --git a/ThermoSysPro/WaterSolution/PressureLosses/SingularPressureLoss.mo b/ThermoSysPro/WaterSolution/PressureLosses/SingularPressureLoss.mo
index 6851148fba0eaee0d5adf0fd50e50965ba6d0155..c6399fb96891731e02cf940fcc681314b07d2842 100644
--- a/ThermoSysPro/WaterSolution/PressureLosses/SingularPressureLoss.mo
+++ b/ThermoSysPro/WaterSolution/PressureLosses/SingularPressureLoss.mo
@@ -1,81 +1,81 @@
-within ThermoSysPro.WaterSolution.PressureLosses;
-model SingularPressureLoss "Singular pressure loss"
-  parameter Real K=10 "Friction pressure loss coefficient";
-  parameter Units.SI.Density rho=1000 "Fluid density";
-
-protected
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  ThermoSysPro.Units.SI.PressureDifference deltaPf(start=1.e2)
-    "Friction pressure loss";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet C1
-    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet C2
-    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-equation
-
-  C1.P - C2.P = deltaPf;
-  C1.T = C2.T;
-  C1.Q = C2.Q;
-
-  C2.Xh2o = C1.Xh2o;
-
-  Q = C1.Q;
-  T = C1.T;
-
-  /* Pressure loss */
-  deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,18},{-20,10},{0,8},{20,10},{40,18},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,18},{-20,10},{0,8},{20,10},{40,18},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SingularPressureLoss;
+within ThermoSysPro.WaterSolution.PressureLosses;
+model SingularPressureLoss "Singular pressure loss"
+  parameter Real K=10 "Friction pressure loss coefficient";
+  parameter Units.SI.Density rho=1000 "Fluid density";
+
+protected
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  ThermoSysPro.Units.SI.PressureDifference deltaPf(start=1.e2)
+    "Friction pressure loss";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionInlet C1
+    annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSolution.Connectors.WaterSolutionOutlet C2
+    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+equation
+
+  C1.P - C2.P = deltaPf;
+  C1.T = C2.T;
+  C1.Q = C2.Q;
+
+  C2.Xh2o = C1.Xh2o;
+
+  Q = C1.Q;
+  T = C1.T;
+
+  /* Pressure loss */
+  deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,18},{-20,10},{0,8},{20,10},{40,18},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,18},{-20,10},{0,8},{20,10},{40,18},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SingularPressureLoss;
diff --git a/ThermoSysPro/WaterSolution/PressureLosses/package.mo b/ThermoSysPro/WaterSolution/PressureLosses/package.mo
index e2d7901d051564fa8df443cead77516c2a250f09..32c23cd3e91a46023d9e9fdc8288d54ac43bdbef 100644
--- a/ThermoSysPro/WaterSolution/PressureLosses/package.mo
+++ b/ThermoSysPro/WaterSolution/PressureLosses/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.WaterSolution;
-package PressureLosses "Pressure losses"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end PressureLosses;
+within ThermoSysPro.WaterSolution;
+package PressureLosses "Pressure losses"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end PressureLosses;
diff --git a/ThermoSysPro/WaterSolution/package.mo b/ThermoSysPro/WaterSolution/package.mo
index 7f933c5dd4a0658f2c2c16e1c5e84b6b1126d548..dba3e67e07c935b59147b486f36a3a6f3ddcb3ee 100644
--- a/ThermoSysPro/WaterSolution/package.mo
+++ b/ThermoSysPro/WaterSolution/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro;
-package WaterSolution "Water solution components library"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end WaterSolution;
+within ThermoSysPro;
+package WaterSolution "Water solution components library"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end WaterSolution;
diff --git a/ThermoSysPro/WaterSteam/Boilers/ElectricBoiler.mo b/ThermoSysPro/WaterSteam/Boilers/ElectricBoiler.mo
index ba65987cca1dc3a03689ae4873932fe8033019cb..abb9fa265ed8b77b9e4ab522f6691074b5394381 100644
--- a/ThermoSysPro/WaterSteam/Boilers/ElectricBoiler.mo
+++ b/ThermoSysPro/WaterSteam/Boilers/ElectricBoiler.mo
@@ -1,105 +1,105 @@
-within ThermoSysPro.WaterSteam.Boilers;
-model ElectricBoiler "Electric boiler"
-  parameter Units.SI.Power W=1e6 "Electrical power";
-  parameter Real eta = 100 "Boiler efficiency (percent)";
-  parameter ThermoSysPro.Units.SI.PressureDifference deltaP=0
-    "Pressure loss";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature Te(start=300) "Inlet temperature";
-  Units.SI.Temperature Ts(start=500) "Outlet temperature";
-  Units.SI.MassFlowRate Q(start=100) "Mass flow";
-  Units.SI.SpecificEnthalpy deltaH
-    "Specific enthalpy variation between the outlet and the inlet";
-
-public
-  Connectors.FluidInlet Ce
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs
-                          annotation (Placement(transformation(extent={{90,-8},
-            {110,12}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-equation
-
-  Ce.P - Cs.P = deltaP;
-
-  Ce.Q = Cs.Q;
-  Q = Ce.Q;
-
-  Cs.h - Ce.h = deltaH;
-
-  /* Flow reversal */
-  0 = if (Q > 0) then Ce.h - Ce.h_vol else Cs.h - Cs.h_vol;
-
-  /* Specific enthalpy variation between the outlet and the inlet */
-  W*eta/100 = Q*deltaH;
-
-  /* Fluid thermodynamic properties */
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ce.P, Ce.h, mode);
-  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cs.P, Cs.h, mode);
-
-  Te = proe.T;
-  Ts = pros.T;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,54},{-30,2},{30,2},{-24,-52},{-28,-56}},
-          color={255,0,0},
-          thickness=0.5),
-        Polygon(
-          points={{-26,-50},{-22,-54},{-28,-56},{-26,-50}},
-          lineColor={255,0,0},
-          lineThickness=0.5,
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,80},{100,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,-48},{-20,-54},{-28,-56},{-26,-48}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,54},{-30,2},{30,2},{-24,-52},{-28,-56}},
-          color={255,0,0},
-          thickness=1)}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end ElectricBoiler;
+within ThermoSysPro.WaterSteam.Boilers;
+model ElectricBoiler "Electric boiler"
+  parameter Units.SI.Power W=1e6 "Electrical power";
+  parameter Real eta = 100 "Boiler efficiency (percent)";
+  parameter ThermoSysPro.Units.SI.PressureDifference deltaP=0
+    "Pressure loss";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature Te(start=300) "Inlet temperature";
+  Units.SI.Temperature Ts(start=500) "Outlet temperature";
+  Units.SI.MassFlowRate Q(start=100) "Mass flow";
+  Units.SI.SpecificEnthalpy deltaH
+    "Specific enthalpy variation between the outlet and the inlet";
+
+public
+  Connectors.FluidInlet Ce
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs
+                          annotation (Placement(transformation(extent={{90,-8},
+            {110,12}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+equation
+
+  Ce.P - Cs.P = deltaP;
+
+  Ce.Q = Cs.Q;
+  Q = Ce.Q;
+
+  Cs.h - Ce.h = deltaH;
+
+  /* Flow reversal */
+  0 = if (Q > 0) then Ce.h - Ce.h_vol else Cs.h - Cs.h_vol;
+
+  /* Specific enthalpy variation between the outlet and the inlet */
+  W*eta/100 = Q*deltaH;
+
+  /* Fluid thermodynamic properties */
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ce.P, Ce.h, mode);
+  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cs.P, Cs.h, mode);
+
+  Te = proe.T;
+  Ts = pros.T;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,54},{-30,2},{30,2},{-24,-52},{-28,-56}},
+          color={255,0,0},
+          thickness=0.5),
+        Polygon(
+          points={{-26,-50},{-22,-54},{-28,-56},{-26,-50}},
+          lineColor={255,0,0},
+          lineThickness=0.5,
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,80},{100,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,-48},{-20,-54},{-28,-56},{-26,-48}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,54},{-30,2},{30,2},{-24,-52},{-28,-56}},
+          color={255,0,0},
+          thickness=1)}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end ElectricBoiler;
diff --git a/ThermoSysPro/WaterSteam/Boilers/package.mo b/ThermoSysPro/WaterSteam/Boilers/package.mo
index 9d4ce837bc6798e180a745f873b5d22374df74cf..83535a6c7f35080b74791012daf09344be36e03d 100644
--- a/ThermoSysPro/WaterSteam/Boilers/package.mo
+++ b/ThermoSysPro/WaterSteam/Boilers/package.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.WaterSteam;
-package Boilers "Boilers"
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Boilers;
+within ThermoSysPro.WaterSteam;
+package Boilers "Boilers"
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Boilers;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/PlugA.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/PlugA.mo
index ef0488af28ade985d73c39a0bbc67ba6fb8bbee6..41d81b4a7e80ce0f21bfde4d1af4eb145a67dad7 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/PlugA.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/PlugA.mo
@@ -1,58 +1,58 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model PlugA "Plug"
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-  Connectors.FluidOutlet C                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 3.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end PlugA;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model PlugA "Plug"
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+  Connectors.FluidOutlet C                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 3.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end PlugA;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/PlugB.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/PlugB.mo
index c889719b62e0d06dc84028ac51481907b7960d8e..b1bafa617ef82aa5d59c0406cc16f209da6a8bb0 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/PlugB.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/PlugB.mo
@@ -1,59 +1,59 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model PlugB "Plug"
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-  Connectors.FluidInlet C
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-92,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 3.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end PlugB;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model PlugB "Plug"
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+  Connectors.FluidInlet C
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-92,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 3.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end PlugB;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/RefH.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/RefH.mo
index 6879fcd208c42e26d9a619b202b702ac0e7c643d..1e1a67d6ec228c0cf1d4c4ea333b05e932f23c74 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/RefH.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/RefH.mo
@@ -1,106 +1,106 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model RefH "Fixed specific enthalpy reference"
-  parameter Units.SI.SpecificEnthalpy h0=1.e5 "Fixed fluid specific enthalpy";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(ISpecificEnthalpy) == 0) then
-    ISpecificEnthalpy.signal = h0;
-  end if;
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  Q = C1.Q;
-  C1.h = ISpecificEnthalpy.signal;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "H")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "H")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefH;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model RefH "Fixed specific enthalpy reference"
+  parameter Units.SI.SpecificEnthalpy h0=1.e5 "Fixed fluid specific enthalpy";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(ISpecificEnthalpy) == 0) then
+    ISpecificEnthalpy.signal = h0;
+  end if;
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  Q = C1.Q;
+  C1.h = ISpecificEnthalpy.signal;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "H")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "H")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefH;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/RefP.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/RefP.mo
index a38381bac4042a030abc2d8c46e1c0cbf89c4661..9b4e79b67537f0529b16e71740372548b5ae3387 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/RefP.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/RefP.mo
@@ -1,109 +1,109 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model RefP "Fixed pressure reference"
-  parameter Units.SI.AbsolutePressure P0=1.e5 "Fixed fluid pressure";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  Q = C1.Q;
-  h = C1.h;
-
-  C1.P = IPressure.signal;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "P")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "P")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefP;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model RefP "Fixed pressure reference"
+  parameter Units.SI.AbsolutePressure P0=1.e5 "Fixed fluid pressure";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  Q = C1.Q;
+  h = C1.h;
+
+  C1.P = IPressure.signal;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "P")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "P")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefP;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/RefQ.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/RefQ.mo
index d1f6b156913977ee381b26792a2571b0c15fbc1b..fc98e6f6a79814092db3d3a4478b36713770dd94 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/RefQ.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/RefQ.mo
@@ -1,105 +1,105 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model RefQ "Fixed mass flow reference"
-  parameter Units.SI.MassFlowRate Q0=10 "Fixed fluid mass flow";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q "Mass flow rate";
-
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  Q = C1.Q;
-  Q = IMassFlow.signal;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Q")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.0</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefQ;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model RefQ "Fixed mass flow reference"
+  parameter Units.SI.MassFlowRate Q0=10 "Fixed fluid mass flow";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q "Mass flow rate";
+
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  Q = C1.Q;
+  Q = IMassFlow.signal;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Q")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.0</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefQ;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/RefT.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/RefT.mo
index 57adf9dd26fa85e02b0aae171b03fd279bc9c5df..617b43bd5717173a806a0c7233864f2acfbf7100 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/RefT.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/RefT.mo
@@ -1,114 +1,114 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model RefT "Fixed temperature reference"
-  parameter Units.SI.Temperature T0=290 "Fixed fluid temperature";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-
-equation
-  if (cardinality(ITemperature) == 0) then
-    ITemperature.signal = T0;
-  end if;
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  P = C1.P;
-  Q = C1.Q;
-  h = C1.h;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Computation of the fluid specific enthalpy */
-  h = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P, ITemperature.signal, mode);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,100},{0,40}}, color={0,0,255}),
-        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
-        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
-        Line(points={{40,0},{90,0}}, color={0,0,255}),
-        Text(
-          extent={{-28,30},{28,-26}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T")}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end RefT;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model RefT "Fixed temperature reference"
+  parameter Units.SI.Temperature T0=290 "Fixed fluid temperature";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+
+equation
+  if (cardinality(ITemperature) == 0) then
+    ITemperature.signal = T0;
+  end if;
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  P = C1.P;
+  Q = C1.Q;
+  h = C1.h;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Computation of the fluid specific enthalpy */
+  h = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P, ITemperature.signal, mode);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,100},{0,40}}, color={0,0,255}),
+        Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}),
+        Line(points={{-90,0},{-40,0}}, color={0,0,255}),
+        Line(points={{40,0},{90,0}}, color={0,0,255}),
+        Text(
+          extent={{-28,30},{28,-26}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T")}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end RefT;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/Sink.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/Sink.mo
index 4cc5755378cf214bd6096dbf16800dad7fe333e8..1d874a7d2cbdf2fec6663944767a525cc80ee0c2 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/Sink.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/Sink.mo
@@ -1,78 +1,78 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model Sink "Water/steam sink"
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.FluidInlet C
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  /* Specific enthalpy */
-  if (cardinality(ISpecificEnthalpy) == 0) then
-    ISpecificEnthalpy.signal = h0;
-  end if;
-
-  h = ISpecificEnthalpy.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(extent={{10,-40},{30,-60}}, textString=
-                                           "h"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{10,-40},{30,-60}}, textString=
-                                           "h"),
-        Line(points={{-92,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}})}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Sink;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model Sink "Water/steam sink"
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.FluidInlet C
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  /* Specific enthalpy */
+  if (cardinality(ISpecificEnthalpy) == 0) then
+    ISpecificEnthalpy.signal = h0;
+  end if;
+
+  h = ISpecificEnthalpy.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(extent={{10,-40},{30,-60}}, textString=
+                                           "h"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{10,-40},{30,-60}}, textString=
+                                           "h"),
+        Line(points={{-92,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}})}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Sink;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/SinkP.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/SinkP.mo
index 698d8241e3dd07598e74a9b5865f220b02924a67..c7c3633299b3ca02b6aff86f659b7965b08adbc0 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/SinkP.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/SinkP.mo
@@ -1,125 +1,125 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model SinkP "Water/steam sink with fixed pressure"
-  parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure";
-  parameter Units.SI.Temperature T0=290
-    "Sink temperature (active if option_temperature=1)";
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Sink specific enthalpy (active if option_temperature=2)";
-  parameter Integer option_temperature=1
-    "1:temperature fixed - 2:specific enthalpy fixed";
-  parameter Integer mode=1
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.SpecificEnthalpy h "Fluid enthalpy";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(
-        origin={50,0},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.FluidInlet C       annotation (Placement(transformation(extent={{
-            -110,-10},{-90,10}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  if (cardinality(ITemperature) == 0) then
-      ITemperature.signal = T0;
-  end if;
-
-  if (cardinality(ISpecificEnthalpy) == 0) then
-      ISpecificEnthalpy.signal = h0;
-  end if;
-
-  if (option_temperature == 1) then
-    T = ITemperature.signal;
-    h = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P, T, 0);
-  elseif (option_temperature == 2) then
-    h = ISpecificEnthalpy.signal;
-    T = pro.T;
-  else
-    assert(false, "SinkPressureWaterSteam: incorrect option");
-  end if;
-
-  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Line(points={{-40,0},{-58,-10}}),
-        Text(extent={{40,28},{58,8}}, textString=
-                                          "P"),
-        Text(extent={{-40,-40},{-10,-60}}, textString=
-                                             "h / T"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-94,26},{98,-30}}, textString=
-                                             "P")}),
-    Window(
-      x=0.06,
-      y=0.16,
-      width=0.67,
-      height=0.71),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-58,10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-40,0},{-58,-10}}),
-        Text(extent={{-94,26},{98,-30}}, textString=
-                                             "P"),
-        Text(extent={{40,28},{58,8}}, textString=
-                                          "P"),
-        Text(extent={{-40,-40},{-10,-60}}, textString=
-                                             "h / T")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SinkP;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model SinkP "Water/steam sink with fixed pressure"
+  parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure";
+  parameter Units.SI.Temperature T0=290
+    "Sink temperature (active if option_temperature=1)";
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Sink specific enthalpy (active if option_temperature=2)";
+  parameter Integer option_temperature=1
+    "1:temperature fixed - 2:specific enthalpy fixed";
+  parameter Integer mode=1
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.SpecificEnthalpy h "Fluid enthalpy";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(
+        origin={50,0},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.FluidInlet C       annotation (Placement(transformation(extent={{
+            -110,-10},{-90,10}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  if (cardinality(ITemperature) == 0) then
+      ITemperature.signal = T0;
+  end if;
+
+  if (cardinality(ISpecificEnthalpy) == 0) then
+      ISpecificEnthalpy.signal = h0;
+  end if;
+
+  if (option_temperature == 1) then
+    T = ITemperature.signal;
+    h = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P, T, 0);
+  elseif (option_temperature == 2) then
+    h = ISpecificEnthalpy.signal;
+    T = pro.T;
+  else
+    assert(false, "SinkPressureWaterSteam: incorrect option");
+  end if;
+
+  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Line(points={{-40,0},{-58,-10}}),
+        Text(extent={{40,28},{58,8}}, textString=
+                                          "P"),
+        Text(extent={{-40,-40},{-10,-60}}, textString=
+                                             "h / T"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-94,26},{98,-30}}, textString=
+                                             "P")}),
+    Window(
+      x=0.06,
+      y=0.16,
+      width=0.67,
+      height=0.71),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-58,10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-40,0},{-58,-10}}),
+        Text(extent={{-94,26},{98,-30}}, textString=
+                                             "P"),
+        Text(extent={{40,28},{58,8}}, textString=
+                                          "P"),
+        Text(extent={{-40,-40},{-10,-60}}, textString=
+                                             "h / T")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SinkP;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/SinkPQ.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/SinkPQ.mo
index 4357f09ecc99f2403130fc7eef74a215d4e25c66..98385c74aeb4611c6b6ff6ea868265fec1308575 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/SinkPQ.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/SinkPQ.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model SinkPQ "Water/steam sink with fixed pressure and mass flow rate"
-  parameter Units.SI.AbsolutePressure P0=100000
-    "Fluid pressure (active if IPressure connector is not connected)";
-  parameter Units.SI.MassFlowRate Q0=100
-    "Mass flow (active if IMassFlow connector is not connected)";
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(
-        origin={50,0},
-        extent={{-10,-10},{10,10}},
-        rotation=180)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.FluidInlet C
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  /* Mass flow */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Specific enthalpy */
-  if (cardinality(ISpecificEnthalpy) == 0) then
-    ISpecificEnthalpy.signal = h0;
-  end if;
-
-  h = ISpecificEnthalpy.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(extent={{40,30},{60,10}}, textString=
-                                           "P"),
-        Text(extent={{12,60},{32,40}}, textString=
-                                           "Q"),
-        Text(extent={{10,-40},{30,-60}}, textString=
-                                           "h"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-20,20},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "P Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{12,60},{32,40}}, textString=
-                                           "Q"),
-        Text(extent={{40,32},{60,12}}, textString=
-                                           "P"),
-        Text(extent={{10,-40},{30,-60}}, textString=
-                                           "h"),
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(
-          extent={{-20,22},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "P Q")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SinkPQ;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model SinkPQ "Water/steam sink with fixed pressure and mass flow rate"
+  parameter Units.SI.AbsolutePressure P0=100000
+    "Fluid pressure (active if IPressure connector is not connected)";
+  parameter Units.SI.MassFlowRate Q0=100
+    "Mass flow (active if IMassFlow connector is not connected)";
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(
+        origin={50,0},
+        extent={{-10,-10},{10,10}},
+        rotation=180)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.FluidInlet C
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  /* Mass flow */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Specific enthalpy */
+  if (cardinality(ISpecificEnthalpy) == 0) then
+    ISpecificEnthalpy.signal = h0;
+  end if;
+
+  h = ISpecificEnthalpy.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(extent={{40,30},{60,10}}, textString=
+                                           "P"),
+        Text(extent={{12,60},{32,40}}, textString=
+                                           "Q"),
+        Text(extent={{10,-40},{30,-60}}, textString=
+                                           "h"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-20,20},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "P Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{12,60},{32,40}}, textString=
+                                           "Q"),
+        Text(extent={{40,32},{60,12}}, textString=
+                                           "P"),
+        Text(extent={{10,-40},{30,-60}}, textString=
+                                           "h"),
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(
+          extent={{-20,22},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "P Q")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SinkPQ;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/SinkQ.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/SinkQ.mo
index 622d83627e65abad21518447d0bfe791dfe8f1b1..df69464b8a911b34908b156f3cdc309dbed33d8b 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/SinkQ.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/SinkQ.mo
@@ -1,106 +1,106 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model SinkQ "Water/steam sink with fixed mass flow rate"
-  parameter Units.SI.MassFlowRate Q0=100
-    "Mass flow (active if IMassFlow connector is not connected)";
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.FluidInlet C
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  /* Mass flow */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Specific enthalpy */
-  if (cardinality(ISpecificEnthalpy) == 0) then
-    ISpecificEnthalpy.signal = h0;
-  end if;
-
-  h = ISpecificEnthalpy.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(extent={{12,60},{32,40}}, textString=
-                                           "Q"),
-        Text(extent={{10,-40},{30,-60}}, textString=
-                                           "h"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-20,20},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{12,60},{32,40}}, textString=
-                                           "Q"),
-        Text(extent={{10,-40},{30,-60}}, textString=
-                                           "h"),
-        Line(points={{-90,0},{-40,0},{-54,10}}),
-        Line(points={{-54,-10},{-40,0}}),
-        Text(
-          extent={{-20,22},{22,-24}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SinkQ;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model SinkQ "Water/steam sink with fixed mass flow rate"
+  parameter Units.SI.MassFlowRate Q0=100
+    "Mass flow (active if IMassFlow connector is not connected)";
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.FluidInlet C
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  /* Mass flow */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Specific enthalpy */
+  if (cardinality(ISpecificEnthalpy) == 0) then
+    ISpecificEnthalpy.signal = h0;
+  end if;
+
+  h = ISpecificEnthalpy.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(extent={{12,60},{32,40}}, textString=
+                                           "Q"),
+        Text(extent={{10,-40},{30,-60}}, textString=
+                                           "h"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-20,20},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{12,60},{32,40}}, textString=
+                                           "Q"),
+        Text(extent={{10,-40},{30,-60}}, textString=
+                                           "h"),
+        Line(points={{-90,0},{-40,0},{-54,10}}),
+        Line(points={{-54,-10},{-40,0}}),
+        Text(
+          extent={{-20,22},{22,-24}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SinkQ;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/Source.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/Source.mo
index ac2b2611f91af6d9bbe9cba358f91950e5c9bb83..f45ef9d17aaa3a2aca237e8ab9d4d9380b18245d 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/Source.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/Source.mo
@@ -1,77 +1,77 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model Source "Water/steam source"
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.FluidOutlet C                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  /* Specific enthalpy */
-  if (cardinality(ISpecificEnthalpy) == 0) then
-    ISpecificEnthalpy.signal = h0;
-  end if;
-
-  h = ISpecificEnthalpy.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-30,-40},{-12,-60}}, textString=
-                                             "h"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-32,-40},{-12,-60}}, textString=
-                                             "h")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Source;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model Source "Water/steam source"
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.FluidOutlet C                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  /* Specific enthalpy */
+  if (cardinality(ISpecificEnthalpy) == 0) then
+    ISpecificEnthalpy.signal = h0;
+  end if;
+
+  h = ISpecificEnthalpy.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-30,-40},{-12,-60}}, textString=
+                                             "h"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-32,-40},{-12,-60}}, textString=
+                                             "h")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Source;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/SourceP.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/SourceP.mo
index 67a7d2668eae5a43712a041866e420a1c2fb83e8..2f3de75319ba59e8e74206df0b80e09062075933 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/SourceP.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/SourceP.mo
@@ -1,122 +1,122 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model SourceP "Water/steam source with fixed pressure"
-  parameter Units.SI.AbsolutePressure P0=300000 "Source pressure";
-  parameter Units.SI.Temperature T0=290
-    "Source temperature (active if option_temperature=1)";
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Source specific enthalpy (active if option_temperature=2)";
-  parameter Integer option_temperature=1
-    "1:temperature fixed - 2:specific enthalpy fixed";
-  parameter Integer mode=1
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.SpecificEnthalpy h "Fluid enthalpy";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.FluidOutlet C      annotation (Placement(transformation(extent={{
-            90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  if (cardinality(ITemperature) == 0) then
-      ITemperature.signal = T0;
-  end if;
-
-  if (cardinality(ISpecificEnthalpy) == 0) then
-      ISpecificEnthalpy.signal = h0;
-  end if;
-
-  if (option_temperature == 1) then
-    T = ITemperature.signal;
-    h = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P, T, 0);
-  elseif (option_temperature == 2) then
-    h = ISpecificEnthalpy.signal;
-    T = pro.T;
-  else
-    assert(false, "SourcePressureWaterSteam: incorrect option");
-  end if;
-
-  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-58,30},{-40,10}}, textString=
-                                             "P"),
-        Text(extent={{-40,-40},{-10,-60}}, textString=
-                                             "h / T"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-94,28},{98,-28}}, textString=
-                                           "P")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-94,28},{98,-28}}, textString=
-                                           "P"),
-        Text(extent={{-58,30},{-40,10}}, textString=
-                                             "P"),
-        Text(extent={{-40,-40},{-10,-60}}, textString=
-                                             "h / T")}),
-    Window(
-      x=0.45,
-      y=0.01,
-      width=0.35,
-      height=0.49),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SourceP;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model SourceP "Water/steam source with fixed pressure"
+  parameter Units.SI.AbsolutePressure P0=300000 "Source pressure";
+  parameter Units.SI.Temperature T0=290
+    "Source temperature (active if option_temperature=1)";
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Source specific enthalpy (active if option_temperature=2)";
+  parameter Integer option_temperature=1
+    "1:temperature fixed - 2:specific enthalpy fixed";
+  parameter Integer mode=1
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.SpecificEnthalpy h "Fluid enthalpy";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.FluidOutlet C      annotation (Placement(transformation(extent={{
+            90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  if (cardinality(ITemperature) == 0) then
+      ITemperature.signal = T0;
+  end if;
+
+  if (cardinality(ISpecificEnthalpy) == 0) then
+      ISpecificEnthalpy.signal = h0;
+  end if;
+
+  if (option_temperature == 1) then
+    T = ITemperature.signal;
+    h = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P, T, 0);
+  elseif (option_temperature == 2) then
+    h = ISpecificEnthalpy.signal;
+    T = pro.T;
+  else
+    assert(false, "SourcePressureWaterSteam: incorrect option");
+  end if;
+
+  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-58,30},{-40,10}}, textString=
+                                             "P"),
+        Text(extent={{-40,-40},{-10,-60}}, textString=
+                                             "h / T"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-94,28},{98,-28}}, textString=
+                                           "P")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-94,28},{98,-28}}, textString=
+                                           "P"),
+        Text(extent={{-58,30},{-40,10}}, textString=
+                                             "P"),
+        Text(extent={{-40,-40},{-10,-60}}, textString=
+                                             "h / T")}),
+    Window(
+      x=0.45,
+      y=0.01,
+      width=0.35,
+      height=0.49),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SourceP;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/SourcePQ.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/SourcePQ.mo
index dd4e9f7cd90919e611ea1b272aa75361c4de7ae2..45433db542ec74c42f71ac1c648e30759c1578dd 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/SourcePQ.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/SourcePQ.mo
@@ -1,121 +1,121 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model SourcePQ "Water/steam source with fixed pressure and mass flow rate"
-  parameter Units.SI.AbsolutePressure P0=300000
-    "Fluid pressure (active if IPressure connector is not connected)";
-  parameter Units.SI.MassFlowRate Q0=100
-    "Mass flow (active if IMassFlow connector is not connected)";
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.FluidOutlet C                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  /* Mass flow */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Pressure */
-  if (cardinality(IPressure) == 0) then
-    IPressure.signal = P0;
-  end if;
-
-  P = IPressure.signal;
-
-  /* Specific enthalpy */
-  if (cardinality(ISpecificEnthalpy) == 0) then
-    ISpecificEnthalpy.signal = h0;
-  end if;
-
-  h = ISpecificEnthalpy.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-58,30},{-40,10}}, textString=
-                                             "P"),
-        Text(extent={{-28,60},{-10,40}}, textString=
-                                             "Q"),
-        Text(extent={{-30,-40},{-12,-60}}, textString=
-                                             "h"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-22,20},{20,-24}},
-          lineColor={0,0,255},
-          textString=
-               "P Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-30,60},{-10,40}}, textString=
-                                             "Q"),
-        Text(extent={{-60,30},{-40,10}}, textString=
-                                             "P"),
-        Text(extent={{-32,-40},{-12,-60}}, textString=
-                                             "h"),
-        Text(
-          extent={{-22,20},{20,-24}},
-          lineColor={0,0,255},
-          textString=
-               "P Q")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SourcePQ;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model SourcePQ "Water/steam source with fixed pressure and mass flow rate"
+  parameter Units.SI.AbsolutePressure P0=300000
+    "Fluid pressure (active if IPressure connector is not connected)";
+  parameter Units.SI.MassFlowRate Q0=100
+    "Mass flow (active if IMassFlow connector is not connected)";
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.FluidOutlet C                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  /* Mass flow */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Pressure */
+  if (cardinality(IPressure) == 0) then
+    IPressure.signal = P0;
+  end if;
+
+  P = IPressure.signal;
+
+  /* Specific enthalpy */
+  if (cardinality(ISpecificEnthalpy) == 0) then
+    ISpecificEnthalpy.signal = h0;
+  end if;
+
+  h = ISpecificEnthalpy.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-58,30},{-40,10}}, textString=
+                                             "P"),
+        Text(extent={{-28,60},{-10,40}}, textString=
+                                             "Q"),
+        Text(extent={{-30,-40},{-12,-60}}, textString=
+                                             "h"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-22,20},{20,-24}},
+          lineColor={0,0,255},
+          textString=
+               "P Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-30,60},{-10,40}}, textString=
+                                             "Q"),
+        Text(extent={{-60,30},{-40,10}}, textString=
+                                             "P"),
+        Text(extent={{-32,-40},{-12,-60}}, textString=
+                                             "h"),
+        Text(
+          extent={{-22,20},{20,-24}},
+          lineColor={0,0,255},
+          textString=
+               "P Q")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SourcePQ;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/SourceQ.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/SourceQ.mo
index da2bf26fa0b82ba67e56b69a5abbd554dfb5fbab..57734aceb5541f59488b780cf58bd424c8969af6 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/SourceQ.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/SourceQ.mo
@@ -1,105 +1,105 @@
-within ThermoSysPro.WaterSteam.BoundaryConditions;
-model SourceQ "Water/steam source with fixed mass flow rate"
-  parameter Units.SI.MassFlowRate Q0=100
-    "Mass flow (active if IMassFlow connector is not connected)";
-  parameter Units.SI.SpecificEnthalpy h0=100000
-    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
-
-public
-  Units.SI.AbsolutePressure P "Fluid pressure";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
-    annotation (Placement(transformation(
-        origin={0,50},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
-    annotation (Placement(transformation(
-        origin={0,-50},
-        extent={{10,-10},{-10,10}},
-        rotation=270)));
-  Connectors.FluidOutlet C                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C.P = P;
-  C.Q = Q;
-  C.h_vol = h;
-
-  /* Mass flow */
-  if (cardinality(IMassFlow) == 0) then
-    IMassFlow.signal = Q0;
-  end if;
-
-  Q = IMassFlow.signal;
-
-  /* Specific enthalpy */
-  if (cardinality(ISpecificEnthalpy) == 0) then
-    ISpecificEnthalpy.signal = h0;
-  end if;
-
-  h = ISpecificEnthalpy.signal;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-28,60},{-10,40}}, textString=
-                                             "Q"),
-        Text(extent={{-30,-40},{-12,-60}}, textString=
-                                             "h"),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-20,22},{18,-20}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{40,0},{90,0},{72,10}}),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{90,0},{72,-10}}),
-        Text(extent={{-30,60},{-10,40}}, textString=
-                                             "Q"),
-        Text(extent={{-32,-40},{-12,-60}}, textString=
-                                             "h"),
-        Text(
-          extent={{-20,22},{18,-20}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Window(
-      x=0.23,
-      y=0.15,
-      width=0.81,
-      height=0.71),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SourceQ;
+within ThermoSysPro.WaterSteam.BoundaryConditions;
+model SourceQ "Water/steam source with fixed mass flow rate"
+  parameter Units.SI.MassFlowRate Q0=100
+    "Mass flow (active if IMassFlow connector is not connected)";
+  parameter Units.SI.SpecificEnthalpy h0=100000
+    "Fluid specific enthalpy (active if IEnthalpy connector is not connected)";
+
+public
+  Units.SI.AbsolutePressure P "Fluid pressure";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow
+    annotation (Placement(transformation(
+        origin={0,50},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy
+    annotation (Placement(transformation(
+        origin={0,-50},
+        extent={{10,-10},{-10,10}},
+        rotation=270)));
+  Connectors.FluidOutlet C                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C.P = P;
+  C.Q = Q;
+  C.h_vol = h;
+
+  /* Mass flow */
+  if (cardinality(IMassFlow) == 0) then
+    IMassFlow.signal = Q0;
+  end if;
+
+  Q = IMassFlow.signal;
+
+  /* Specific enthalpy */
+  if (cardinality(ISpecificEnthalpy) == 0) then
+    ISpecificEnthalpy.signal = h0;
+  end if;
+
+  h = ISpecificEnthalpy.signal;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-28,60},{-10,40}}, textString=
+                                             "Q"),
+        Text(extent={{-30,-40},{-12,-60}}, textString=
+                                             "h"),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-20,22},{18,-20}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{40,0},{90,0},{72,10}}),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{90,0},{72,-10}}),
+        Text(extent={{-30,60},{-10,40}}, textString=
+                                             "Q"),
+        Text(extent={{-32,-40},{-12,-60}}, textString=
+                                             "h"),
+        Text(
+          extent={{-20,22},{18,-20}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Window(
+      x=0.23,
+      y=0.15,
+      width=0.81,
+      height=0.71),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SourceQ;
diff --git a/ThermoSysPro/WaterSteam/BoundaryConditions/package.mo b/ThermoSysPro/WaterSteam/BoundaryConditions/package.mo
index f6d87df8f8e89dac9ddd0628a7e6f37989543b17..a55f60e9667d4d26dcac9f9d9d2a30005aab7f3b 100644
--- a/ThermoSysPro/WaterSteam/BoundaryConditions/package.mo
+++ b/ThermoSysPro/WaterSteam/BoundaryConditions/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSteam;
-package BoundaryConditions "Boundary conditions"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end BoundaryConditions;
+within ThermoSysPro.WaterSteam;
+package BoundaryConditions "Boundary conditions"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end BoundaryConditions;
diff --git a/ThermoSysPro/WaterSteam/Connectors.mo b/ThermoSysPro/WaterSteam/Connectors.mo
index edde8ce776ab67bdfdf25ee576eff4ed87fc9eac..8cf261434b20b9a3e107d79d760319b1b0b29044 100644
--- a/ThermoSysPro/WaterSteam/Connectors.mo
+++ b/ThermoSysPro/WaterSteam/Connectors.mo
@@ -1,289 +1,289 @@
-within ThermoSysPro.WaterSteam;
-package Connectors "Connectors"
-  connector FluidInlet "Water/steam inlet fluid connector"
-    Units.SI.AbsolutePressure P(start=1.e5)
-      "Fluid pressure in the control volume";
-    Units.SI.SpecificEnthalpy h_vol(start=1.e5)
-      "Fluid specific enthalpy in the control volume";
-    Units.SI.MassFlowRate Q(start=500)
-      "Mass flow rate of the fluid crossing the boundary of the control volume";
-    Units.SI.SpecificEnthalpy h(start=1.e5)
-      "Specific enthalpy of the fluid crossing the boundary of the control volume";
-
-    input Boolean a=true
-      "Pseudo-variable for the verification of the connection orientation";
-    output Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,100},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={0,0,255},
-            fillPattern=FillPattern.Solid)}),
-      Window(
-        x=0.27,
-        y=0.33,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-  end FluidInlet;
-
-  connector FluidInletI "Internal water/steam inlet fluid connector"
-    Units.SI.AbsolutePressure P(start=1.e5)
-      "Fluid pressure in the control volume";
-    Units.SI.SpecificEnthalpy h_vol(start=1.e5)
-      "Fluid specific enthalpy in the control volume";
-    Units.SI.MassFlowRate Q(start=500)
-      "Mass flow rate of the fluid crossing the boundary of the control volume";
-    Units.SI.SpecificEnthalpy h(start=1.e5)
-      "Specific enthalpy of the fluid crossing the boundary of the control volume";
-
-    input Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    output Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-      annotation (
-        Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,100},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.CrossDiag)}),
-        Window(
-          x=0.27,
-          y=0.17,
-          width=0.6,
-          height=0.6),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-  end FluidInletI;
-
-  connector FluidOutlet "Water/steam outlet fluid connector"
-    Units.SI.AbsolutePressure P(start=1.e5)
-      "Fluid pressure in the control volume";
-    Units.SI.SpecificEnthalpy h_vol(start=1.e5)
-      "Fluid specific enthalpy in the control volume";
-    Units.SI.MassFlowRate Q(start=500)
-      "Mass flow rate of the fluid crossing the boundary of the control volume";
-    Units.SI.SpecificEnthalpy h(start=1.e5)
-      "Specific enthalpy of the fluid crossing the boundary of the control volume";
-
-    output Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    input Boolean b=true
-      "Pseudo-variable for the verification of the connection orientation";
-    annotation (
-      Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,100},{100,-100}},
-            lineColor={0,0,255},
-            fillColor={255,0,0},
-            fillPattern=FillPattern.Solid)}),
-      Window(
-        x=0.26,
-        y=0.39,
-        width=0.6,
-        height=0.6),
-      Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-  end FluidOutlet;
-
-  connector FluidOutletI "Internal water/steam outlet fluid connector"
-    Units.SI.AbsolutePressure P(start=1.e5)
-      "Fluid pressure in the control volume";
-    Units.SI.SpecificEnthalpy h_vol(start=1.e5)
-      "Fluid specific enthalpy in the control volume";
-    Units.SI.MassFlowRate Q(start=500)
-      "Mass flow rate of the fluid crossing the boundary of the control volume";
-    Units.SI.SpecificEnthalpy h(start=1.e5)
-      "Specific enthalpy of the fluid crossing the boundary of the control volume";
-
-    output Boolean a
-      "Pseudo-variable for the verification of the connection orientation";
-    input Boolean b
-      "Pseudo-variable for the verification of the connection orientation";
-      annotation (
-        Icon(coordinateSystem(
-          preserveAspectRatio=false,
-          extent={{-100,-100},{100,100}},
-          grid={2,2}), graphics={Rectangle(
-            extent={{-100,100},{100,-100}},
-            lineColor={255,0,0},
-            fillColor={255,255,255},
-            fillPattern=FillPattern.CrossDiag)}),
-        Window(
-          x=0.45,
-          y=0.01,
-          width=0.35,
-          height=0.49),
-        Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-  end FluidOutletI;
-  annotation (Icon(graphics={
-        Text(
-          extent={{-102,0},{24,-26}},
-          lineColor={242,148,0},
-          textString=
-               "Thermo"),
-        Text(
-          extent={{-4,8},{68,-34}},
-          lineColor={46,170,220},
-          textString=
-               "SysPro"),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
-              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
-              {-62,2}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
-              {-42,22},{-42,30},{-44,38}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-              {-26,12},{-28,12},{-26,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,30},{-6,26}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,36},{-6,32}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,42},{-6,38}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-8,48},{-6,44}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,32},{-2,28}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,38},{-2,34}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,44},{-2,40}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-4,50},{-2,46}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
-              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
-              {-62,2}},
-          lineColor={242,148,0},
-          fillColor={242,148,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-          color={46,170,220},
-          thickness=0.5),
-        Line(
-          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-          color={46,170,220},
-          thickness=0.5),
-        Polygon(
-          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-          lineColor={46,170,220},
-          fillColor={46,170,220},
-          fillPattern=FillPattern.Solid),
-        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-        Line(
-          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-          color={0,0,255},
-          smooth=Smooth.None),
-        Line(
-          points={{80,80},{100,100}},
-          color={0,0,255},
-          smooth=Smooth.None)}));
-
-end Connectors;
+within ThermoSysPro.WaterSteam;
+package Connectors "Connectors"
+  connector FluidInlet "Water/steam inlet fluid connector"
+    Units.SI.AbsolutePressure P(start=1.e5)
+      "Fluid pressure in the control volume";
+    Units.SI.SpecificEnthalpy h_vol(start=1.e5)
+      "Fluid specific enthalpy in the control volume";
+    Units.SI.MassFlowRate Q(start=500)
+      "Mass flow rate of the fluid crossing the boundary of the control volume";
+    Units.SI.SpecificEnthalpy h(start=1.e5)
+      "Specific enthalpy of the fluid crossing the boundary of the control volume";
+
+    input Boolean a=true
+      "Pseudo-variable for the verification of the connection orientation";
+    output Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,100},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={0,0,255},
+            fillPattern=FillPattern.Solid)}),
+      Window(
+        x=0.27,
+        y=0.33,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+  end FluidInlet;
+
+  connector FluidInletI "Internal water/steam inlet fluid connector"
+    Units.SI.AbsolutePressure P(start=1.e5)
+      "Fluid pressure in the control volume";
+    Units.SI.SpecificEnthalpy h_vol(start=1.e5)
+      "Fluid specific enthalpy in the control volume";
+    Units.SI.MassFlowRate Q(start=500)
+      "Mass flow rate of the fluid crossing the boundary of the control volume";
+    Units.SI.SpecificEnthalpy h(start=1.e5)
+      "Specific enthalpy of the fluid crossing the boundary of the control volume";
+
+    input Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    output Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+      annotation (
+        Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,100},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.CrossDiag)}),
+        Window(
+          x=0.27,
+          y=0.17,
+          width=0.6,
+          height=0.6),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+  end FluidInletI;
+
+  connector FluidOutlet "Water/steam outlet fluid connector"
+    Units.SI.AbsolutePressure P(start=1.e5)
+      "Fluid pressure in the control volume";
+    Units.SI.SpecificEnthalpy h_vol(start=1.e5)
+      "Fluid specific enthalpy in the control volume";
+    Units.SI.MassFlowRate Q(start=500)
+      "Mass flow rate of the fluid crossing the boundary of the control volume";
+    Units.SI.SpecificEnthalpy h(start=1.e5)
+      "Specific enthalpy of the fluid crossing the boundary of the control volume";
+
+    output Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    input Boolean b=true
+      "Pseudo-variable for the verification of the connection orientation";
+    annotation (
+      Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,100},{100,-100}},
+            lineColor={0,0,255},
+            fillColor={255,0,0},
+            fillPattern=FillPattern.Solid)}),
+      Window(
+        x=0.26,
+        y=0.39,
+        width=0.6,
+        height=0.6),
+      Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+  end FluidOutlet;
+
+  connector FluidOutletI "Internal water/steam outlet fluid connector"
+    Units.SI.AbsolutePressure P(start=1.e5)
+      "Fluid pressure in the control volume";
+    Units.SI.SpecificEnthalpy h_vol(start=1.e5)
+      "Fluid specific enthalpy in the control volume";
+    Units.SI.MassFlowRate Q(start=500)
+      "Mass flow rate of the fluid crossing the boundary of the control volume";
+    Units.SI.SpecificEnthalpy h(start=1.e5)
+      "Specific enthalpy of the fluid crossing the boundary of the control volume";
+
+    output Boolean a
+      "Pseudo-variable for the verification of the connection orientation";
+    input Boolean b
+      "Pseudo-variable for the verification of the connection orientation";
+      annotation (
+        Icon(coordinateSystem(
+          preserveAspectRatio=false,
+          extent={{-100,-100},{100,100}},
+          grid={2,2}), graphics={Rectangle(
+            extent={{-100,100},{100,-100}},
+            lineColor={255,0,0},
+            fillColor={255,255,255},
+            fillPattern=FillPattern.CrossDiag)}),
+        Window(
+          x=0.45,
+          y=0.01,
+          width=0.35,
+          height=0.49),
+        Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+  end FluidOutletI;
+  annotation (Icon(graphics={
+        Text(
+          extent={{-102,0},{24,-26}},
+          lineColor={242,148,0},
+          textString=
+               "Thermo"),
+        Text(
+          extent={{-4,8},{68,-34}},
+          lineColor={46,170,220},
+          textString=
+               "SysPro"),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,
+              8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},
+              {-62,2}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},
+              {-42,22},{-42,30},{-44,38}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+              {-26,12},{-28,12},{-26,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,30},{-6,26}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,36},{-6,32}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,42},{-6,38}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-8,48},{-6,44}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,32},{-2,28}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,38},{-2,34}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,44},{-2,40}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-4,50},{-2,46}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,
+              6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},
+              {-62,2}},
+          lineColor={242,148,0},
+          fillColor={242,148,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+          color={46,170,220},
+          thickness=0.5),
+        Line(
+          points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+          color={46,170,220},
+          thickness=0.5),
+        Polygon(
+          points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+          lineColor={46,170,220},
+          fillColor={46,170,220},
+          fillPattern=FillPattern.Solid),
+        Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+        Line(
+          points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+          color={0,0,255},
+          smooth=Smooth.None),
+        Line(
+          points={{80,80},{100,100}},
+          color={0,0,255},
+          smooth=Smooth.None)}));
+
+end Connectors;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/CoolingTower.mo b/ThermoSysPro/WaterSteam/HeatExchangers/CoolingTower.mo
index efd0ba39ccb2df13ebdd152c12d3222997a4d0f5..ce910f6bf4fda1af53bdb17169dbc5be054d7150 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/CoolingTower.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/CoolingTower.mo
@@ -1,586 +1,586 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model CoolingTower "Cooling tower"
-
-  parameter Integer fluid=1
-    "<html>Fluid number: <br>1 - Water/Steam <br>7 - WaterSteamSimple </html>";
-  parameter Units.SI.AbsolutePressure Patm=101325
-    "Pressure above the fluid level";
-  parameter Units.SI.MassFlowRate Qesp=0.001;
-
-  // ---------------------   Geometrical parameters ------------------------------------------
-  parameter Units.SI.Area A=13114 "Tower cross-sectional aera";
-  parameter Real a1=1/z1 "Water/air interfacial area for the packing (m2/m3)";
-  parameter Units.SI.Height z1=1.6 "Height of the packing heat exchange zone";
-
-  // ----------------------  Mixing law parameters -------------------------------------------
-  parameter Real lambda=1.227 "Beta packing exchange parameter";
-  parameter Real Y=0.51 "Beta packing exchange parameter";
-  parameter Real p_Beta1=0
-    "If > 0, fixed transfert coefficient for the evporating mass (otherwise, this coef. is computed)";
-  Real Beta1
-    "Coefficient de tranfert de masse d'évaporation calculé avec nn et lambda (packing)";
-
-  // ---------------------- Air parameter at the inlet of the tower --------------------------
-  parameter Real Xo2as(start=0.234) "O2 mass fraction in dry air";
-
-  parameter Boolean steady_state=true "true: start from steady state";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real g=9.81 "Gravity constant";
-
-  // ----------------------  Zone 1 : packing   --------------------------
-public
-  parameter Boolean packing_zone_activated=true
-    "true: activation of the packing zone";
-
-  Units.SI.Volume dV "Volume of the packing exchange zone";
-  Real xeH2o "Air humidity at the inlet (kg/kg)";
-  Units.SI.MassFlowRate QsAir2
-    "Ambiant air mass flow at the inlet of the packing zone";
-  Units.SI.SpecificEnthalpy HmAir2(start=100000)
-    "Ambiant air specific enthalpy at the inlet of the packing zone";
-  Units.SI.AbsolutePressure PeAir2
-    "Ambiant air pressure at the inlet of the packing zone";
-  Units.SI.Temperature Teair1(start=284.16)
-    "Ambiant air temperature at the inlet of the packing zone";
-  Real xeH2o1 "Ambiant air humidity at the inlet of the packing zone (kg/kg)";
-  Units.SI.MassFlowRate QsAir1
-    "Hot air mass flow at the outlet of the packing zone";
-  Units.SI.SpecificEnthalpy HmAir1(start=100000)
-    "Hot air specific enthalpy at the outlet of the packing zone";
-  Units.SI.Temperature Tsair1(start=300)
-    "Hot air temperature at the outlet of the packing zone";
-  Real xsH2o1 "Hot air humidity at the outlet of the packing zone (kg/kg)";
-  Real xsO2 "Hot air O2 mass fraction at the outlet of the packing zone";
-  Units.SI.AbsolutePressure PeEau1
-    "Hot water pressure at the inlet of the packing zone";
-  Units.SI.MassFlowRate QeEau1
-    "Hot water mass flow rate at the inlet of the packing zone";
-  Units.SI.SpecificEnthalpy HeEau1
-    "Hot water specific enthalpy at the inlet of the packing zone";
-  Units.SI.Temperature Teeau1
-    "Hot water temperature at the inlet of the packing zone";
-  Units.SI.MassFlowRate QsEau1
-    "Cold water pressure at the outlet of the packing zone";
-  Units.SI.Temperature Tseau1(start=300)
-    "Cold water tempretaure at the outlet of the packing zone";
-  Units.SI.SpecificEnthalpy HmEau1(start=200000)
-    "Cold water specific enthalpy at the outlet of the packing zone";
-  Units.SI.Power dw1
-    "Cooling power given by water convection and evaporation in the packing zone";
-  Units.SI.SpecificEnthalpy Hs1 "Air specific enthalpy in the packing zone";
-  Units.SI.SpecificEnthalpy Hse1
-    "Air specific enthalpy saturated at Teau in the packing zone";
-  Units.SI.MassFlowRate Qevap1 "Evaporation mass flow in the packing zone";
-  Units.SI.Volume Vair1(start=20000) "Air volume in the packing zone";
-  Units.SI.Volume Veau1(start=2000) "Water volume in the packing zone";
-  Units.SI.Density rhoEair1 "Air density at the inlet";
-  Units.SI.DynamicViscosity muEair1 "Air viscosity at the inlet";
-  Units.SI.SpecificHeatCapacity CpEair1
-    "Air specific heat capacity at the inlet";
-  Units.SI.ThermalConductivity lambdaEair1
-    "Air thermal conductivity at the inlet";
-  Units.SI.Density rhoSair1 "Air density at the outlet";
-  Units.SI.DynamicViscosity muSair1 "Air viscosity at the outlet";
-  Units.SI.SpecificHeatCapacity CpSair1
-    "Air specific heat capacity at the outlet";
-  Units.SI.ThermalConductivity lambdaSair1
-    "Air thermal conductivity at the outlet";
-  Units.SI.Density rho1 "Water density";
-
-  // ----------------------  Zone 2 : rain   --------------------------
-  parameter Boolean rain_zone_activated=true "Activation of the rain zone";
-  parameter Units.SI.Area A2=A "Flow cross-sectional area in the tower";
-  parameter Units.SI.Height z2=z1
-    "Height of the exchange zone in the rain zone";
-  parameter Units.SI.Diameter Dg=0.005 "Droplets diameter";
-  parameter Real p_Beta2=0
-    "If > 0, the mass transfer coef. is fixed, otherwise it is computed";
-
-  Real Beta2 "Transfer coefficient for the rain";
-  Units.SI.Velocity Ug(start=1) "Droplets velocity";
-  Units.SI.Velocity Ua "Air velocity";
-  Real a2 "Interfacial area water/air (m2/m3) (rain zone)";
-  Units.SI.PrandtlNumber Pr "Droplets Prandtl number";
-  Units.SI.NusseltNumber Nu "Droplets Nusselt number";
-  Units.SI.ReynoldsNumber Re "Droplets Reynols number";
-  Units.SI.Volume dV2 "Volume of the rain exchange zone";
-  Units.SI.MassFlowRate QeAir2
-    "Air mass flow rate at the inlet of the rain zone";
-  Units.SI.SpecificEnthalpy HeAir2
-    "Air specific enthalpy at the inlet of the rain zone";
-  Units.SI.Temperature Teair2 "Air temperature at the inlet of the rain zone";
-  Units.SI.Temperature Tsair2 "Air temperature at the outlet of the rain zone";
-  Units.SI.Temperature Teeau2
-    "Hot water temperature at the inlet of the rain zone";
-  Units.SI.Temperature Tseau2
-    "Cold water temperature at the outlet of the rain zone";
-  Units.SI.MassFlowRate QsEau2
-    "Cold water mass flow rate at the outlet of the rain zone";
-  Units.SI.MassFlowRate Qevap2 "Evaporation mass flow rate in the rain zone";
-  Real xsH2o2 "Air humidity at the outlet of the rain zone (kg/kg)";
-  Units.SI.Power dw2
-    "Thermal power exchanged between the air and the droplets by convection and evaporation in the rain zone";
-  Units.SI.SpecificEnthalpy Hs2
-    "Air specific enthalpy at temprature Tair in the rain zone";
-  Units.SI.SpecificEnthalpy Hse2
-    "Air specific enthalpy saturated at temperature Teau in the rain zone";
-  Real ng "Number of droplets";
-  Units.SI.Volume Vair2(start=20000) "Air volume in the rain exchange zone";
-  Units.SI.Volume Veau2(start=2000) "Water volume in the rain exchange zone";
-  Units.SI.SpecificEnthalpy HmEau2(start=200000)
-    "Average specific enthalpy in the rain zone";
-  Units.SI.Area SEAU "Contact area air/water";
-  Units.SI.Density rhoEair2(start=1) "Air density at the inlet";
-  Units.SI.DynamicViscosity muEair2(start=1e-6) "Air viscosity at the inlet";
-  Units.SI.SpecificHeatCapacity CpEair2(start=1000)
-    "Air specific heat capacity at the inlet";
-  Units.SI.ThermalConductivity lambdaEair2(start=0.05)
-    "Air thermal conductivity at the inlet";
-  Units.SI.Density rhoSair2 "Air density at the outlet";
-  Units.SI.DynamicViscosity muSair2(start=1e-6) "Air viscosity at the outlet";
-  Units.SI.SpecificHeatCapacity CpSair2(start=1000)
-    "Air specific heat capacity at the outlet";
-  Units.SI.ThermalConductivity lambdaSair2(start=0.05)
-    "Air thermal conductivity at the outlet";
-  Units.SI.Density rho2(start=995) "Water density";
-  Real ddairhp1 "dérivé de la masse volumique de l'air par rapport à H paching";
-  Real ddairhp2 "dérivé de la masse volumique de l'air par rapport à H pluie";
-  Real Xh2oTeau1 "Fraction massique en H2o de l'air a Teeau zone 1";
-  Real Xh2oTeau2 "Fraction massique en H2o de l'air a Teeau zone 1";
-
-public
-  Connectors.FluidInlet Cws1 "Cooling water inlet"
-                                    annotation (Placement(transformation(extent=
-           {{-90,-50},{-70,-30}}, rotation=0)));
-  Connectors.FluidOutlet Cws2 "Cooling water outlet"
-                                    annotation (Placement(transformation(extent=
-           {{-110,-100},{-90,-80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_input1
-    "Packing zone water/steam properties"
-    annotation (Placement(transformation(extent={{-100,60},{-80,86}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_output1
-    "Packing zone water/steam properties"
-    annotation (Placement(transformation(extent={{-100,20},{-80,46}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_input2
-    "Rain zone water/steam properties"
-    annotation (Placement(transformation(extent={{80,60},{100,86}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_output2
-    "Rain zone water/steam properties"
-    annotation (Placement(transformation(extent={{80,20},{100,46}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cair1 "Air inlet"
-                              annotation (Placement(transformation(extent={{-10,
-            -111},{10,-91}}, rotation=0)));
-  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cair2 "Air outlet"
-                              annotation (Placement(transformation(extent={{-10,
-            90},{10,110}}, rotation=0)));
-
-initial equation
-
-  if steady_state then
-    if (rain_zone_activated == true) and (packing_zone_activated == true) then
-      der(HmAir1) = 0;
-      der(HmEau1) = 0;
-      //////////der(HmAir2) = 0;
-      der(HmEau2) = 0;
-    elseif (packing_zone_activated == true) then
-      der(HmAir1) = 0;
-      der(HmEau1) = 0;
-    elseif (rain_zone_activated == true) then
-      der(HmAir2) = 0;
-      der(HmEau2) = 0;
-    end if;
-  else
-    if (rain_zone_activated == true) and (packing_zone_activated == true) then
-      HmAir1 =  HeAir2;
-      HmEau1 =  HeEau1;
-      HmAir2 =  HeAir2;
-      HmEau2 =  HeEau1;
-    elseif (packing_zone_activated == true) then
-      HmAir1 =  HeAir2;
-      HmEau1 =  HeEau1;
-    elseif (rain_zone_activated == true) then
-      HmAir2 =  HeAir2;
-      HmEau2 =  HeEau1;
-    end if;
-  end if;
-
-equation
-
-  /* Unconnected connectors */
-  if (cardinality(Cws1) == 0) then
-    Cws1.Q = 0;
-    Cws1.h = 1.e5;
-    Cws1.b = true;
-  end if;
-
-  if (cardinality(Cws2) == 0) then
-    Cws2.Q = 0;
-    Cws2.h = 1.e5;
-    Cws2.a = true;
-  end if;
-
-  /* Air inlet */
-  PeAir2 = Cair1.P;
-  Teair2 = Cair1.T;
-  QeAir2 = Cair1.Q;
-  xeH2o  = Cair1.Xh2o;
-
-  /* Water inlet */
-  QeEau1 = Cws1.Q;
-  HeEau1 = Cws1.h;
-  PeEau1 = Cws1.P;
-
-  /* Air outlet */
-  Cair2.P = Cair1.P;
-  Cair2.T = Tsair1;
-  Cair2.Q = QsAir1;
-
-  xsO2   = Xo2as*(1-xsH2o1);
-
-  Cair2.Xco2 = 0;
-  Cair2.Xh2o = xsH2o1;
-  Cair2.Xo2  = xsO2;
-  Cair2.Xso2 = 0;
-
-  /* Water outlet */
-  Cws2.Q = QsEau2;
-  Cws2.P = PeEau1;
-
-  //--------------------------------------------------------------------
-  // Zone 1 : packing
-  //--------------------------------------------------------------------
-
-  /* Volume of the packing exchange zone */
-  dV = A*z1;
-  dV = Vair1 + Veau1;
-
-  /* Mass balance equation for the air */
-  der(Vair1)*rhoSair1 + Vair1*ddairhp1*der(HmAir1) = QsAir2 - QsAir1 + Qevap1;
-
-  /* Energy balance equation for the air */
-  Vair1*(PeAir2/rhoSair1*ddairhp1 + rhoSair1)*der(HmAir1) = QsAir2*HmAir2 - QsAir1*HmAir1 + dw1;
-
-  /* Energy balance equation for the water */
-  Veau1*(PeAir2/pro_output1.d*pro_output1.ddph + pro_output1.d) * der(HmEau1) = QeEau1*HeEau1 - QsEau1*HmEau1 - dw1;
-
-  /* Beta computed or fixed for the packing zone */
-  if (p_Beta1 > 0) then
-     Beta1 = p_Beta1;
-  else
-    Beta1 = QeEau1/(a1*dV)*lambda*(QsAir2/QeEau1)^Y;
-  end if;
-
-  /* Air humidity at the outlet of the zone */
-  xsH2o1 = xeH2o1 + Qevap1/QsAir2;
-
-  //--------------------------------------------------------------------
-  // Zone 2 : rain
-  //--------------------------------------------------------------------
-
-  /* Volume of the rain exchange zone */
-  dV2 = A2*z2;
-  dV2 = Vair2 + Veau2;
-
-  /* Mass balance equation for the air */
-  der(Vair2)*rhoSair2 + Vair2*ddairhp2*der(HmAir2) = QeAir2 - QsAir2 + Qevap2;
-
-  /* Energy balance equation for the air */
-  Vair2*(PeAir2/rhoSair2*ddairhp2 + rhoSair2)*der(HmAir2) = QeAir2*HeAir2 - QsAir2*HmAir2 + dw2;
-
-  /* Energy balance equation for the water */
-  Veau2*(PeAir2/pro_output2.d*pro_output2.ddph + pro_output2.d) * der(HmEau2) = QsEau1* HmEau1   - QsEau2* HmEau2   - dw2;
-
-  /* Beta computed or fixed for the rain zone */
-  if (p_Beta2 > 0) then
-     Beta2 = p_Beta2;
-  else
-     Beta2 = lambdaEair2*Nu/(0.92*CpEair2*Dg);
-  end if;
-
-  /* Air humidity at the outlet of the zone */
-  xsH2o2 = xeH2o + Qevap2/QeAir2;
-  xeH2o1 = xsH2o2;
-
-  if (rain_zone_activated == true) and (packing_zone_activated == true) then
-
-    /* Mass balance equation for the water in zone 1 */
-    der(Veau1)*pro_output1.d + Veau1*pro_output1.ddhp*der(HmEau1) = QeEau1 - QsEau1 - Qevap1;
-
-    /* Power exchanged between water and air in zone 1 */
-    dw1 = Beta1 *(Hse1 - Hs1)*a1*dV;
-
-    /* Evaporation mass flow rate in zone 1 */
-    Qevap1 = Beta1*(ThermoSysPro.Properties.FlueGases.XSat(Teeau1, PeAir2) - xeH2o1)*Vair1/z1;
-
-    /* Mass balance equation for the water in zone 2 */
-    der(Veau2)*pro_output2.d + Veau2*pro_output2.ddhp*der(HmEau2) = QsEau1 - QsEau2 - Qevap2;
-
-    /* Power exchanged between the droplets and the air in zone 2 */
-    dw2 = Beta2 *(Hse2 - Hs2)*a2*dV2;
-
-    /* Evaporation mass flow rate in zone 2 */
-    Qevap2 = Beta2*(ThermoSysPro.Properties.FlueGases.XSat(Teeau2, PeAir2) - xeH2o)*Vair2/z2;
-
-    // convergence si permanent false
-    //????????? correcte ????????????
-    QsEau1 - QsEau2 = Qevap2;
-
-    Cws1.h_vol = HmEau1;
-    Cws2.h_vol = HmEau2;
-
-  elseif (packing_zone_activated == true) then   // Packing zone
-
-    /* Mass balance equation for the water in zone 1 */
-    der(Veau1)*pro_output1.d + Veau1*pro_output1.ddhp*der(HmEau1) = QeEau1 - QsEau1 - Qevap1;
-
-    /* Power exchanged between water and air in zone 1 */
-    dw1 = Beta1 *(Hse1 - Hs1)*a1*dV;
-
-    /* Evaporation mass flow rate in zone 1 */
-    Qevap1 = Beta1*(ThermoSysPro.Properties.FlueGases.XSat(Teeau1, PeAir2) - xeH2o1)*Vair1/z1;
-
-    Veau2 = 0;
-
-    /* Power exchanged between the droplets and the air in zone 2 */
-    dw2 = 0;
-
-    /* Evaporation mass flow rate in zone 2 */
-    Qevap2 =  0;
-
-    HmEau2 = HmEau1;
-
-    Cws1.h_vol = HmEau1;
-    Cws2.h_vol = HmEau1;
-
-  elseif (rain_zone_activated == true) then  // Rain zone
-
-    Veau1 = 0;
-
-    /* Power exchanged between water and air in zone 1 */
-    dw1 = 0;
-
-    /* Evaporation mass flow rate in zone 1 */
-    Qevap1  =  0;
-
-    /* Mass balance equation in zone 2 */
-    der(Veau2)*pro_output2.d + Veau2*pro_output2.ddhp*der(HmEau2) = QsEau1 - QsEau2 - Qevap2;
-
-    /* Power exchanged between the droplets and the air in zone 2 */
-    dw2 = Beta2 *(Hse2-Hs2)*a2*dV2;
-
-    /* Evaporation mass flow rate in zone 2 */
-    Qevap2 = Beta2*(ThermoSysPro.Properties.FlueGases.XSat(Teeau2, PeAir2) - xeH2o)*Vair2/z2;
-
-    HmEau1 = HeEau1;
-
-    Cws1.h_vol = HmEau2;
-    Cws2.h_vol = HmEau2;
-
-  end if;
-
-  /* Reynols number for the droplets */
-  Re = rhoEair2*abs(Ug + Ua)*Dg/muEair2;
-
-  /* Prandtl number */
-  Pr = muEair2*CpEair2/lambdaEair2;
-
-  /* Nusselt number */
-  Nu = 2 + 0.6*Re^0.5*Pr^(1/3);
-
-  /* Air/water interfacial area for the rain zone */
-  a2 = SEAU/dV2;
-
-  /* Number of droplets */
-  ng = QsEau1/(4/3*pi*(Dg/2)^3*rho2);
-
-  /* Air/water contact area */
-  SEAU = ng * 4 * pi * (Dg/2)^2;
-
-  /* Air velocity */
-  Ua= Cair1.Q/(rhoEair2*A2);
-
-  /* Droplets velocity */
-  der(Ug) = -18*muEair2*(1 + 0.15*Re^0.687)/(rho2*Dg^2)*(Ug + Ua)^2 + g;
-
-  //--------------------------------------------------------------------
-  // Fluid thermodynamic properties in the packing zone
-  //--------------------------------------------------------------------
-
-  /* Air properties as a function of temperature and humidity */
-
-  // Air inlet
-  rhoEair1 = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-  CpEair1  = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-  muEair1  = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-  lambdaEair1 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-
-  // Air outlet
-  rhoSair1 = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
-  CpSair1  = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
-  muSair1  = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
-  lambdaSair1 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
-
-  // Air temperature at the inlet of zone 1
-  // changed from Fluegases_T to FlueGases_h to provide a differentiable function
-  HmAir2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1-xsH2o2), Cair1.Xso2);
-
-
-  // Air temperature at the outlet of zone 1
-  // changed from Fluegases_T to FlueGases_h to provide a differentiable function
-  HmAir1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Tsair1, Cair1.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair1.Xso2);
-
-  //
-  Xh2oTeau1 = ThermoSysPro.Properties.FlueGases.XSat(Teeau1, PeAir2);
-
-  // Specific enthalpy of the air saturated with water
-  Hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-  Hse1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teeau1, Cair1.Xco2, Xh2oTeau1,  Xo2as*(1 - Xh2oTeau1), Cair1.Xso2);
-
-  // Partial derivatives of the air density
-  ddairhp1 = ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
-  ddairhp2 = ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(Cair1.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-
-  /* Water properties as a function of pressure and specific enthalpy */
-
-  // Water inlet
-  pro_input1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(PeEau1, HeEau1, mode);
-  Teeau1 = pro_input1.T;
-  rho1 = pro_input1.d;
-
-  // Water outlet
-  pro_output1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(PeEau1, HmEau1, mode);
-  Tseau1 = pro_output1.T;
-
-  //--------------------------------------------------------------------
-  // Fluid thermodynamic properties in the rain zone
-  //--------------------------------------------------------------------
-
-  /* Air properties as a function of temperature and humidity */
-
-  // Air inlet
-  rhoEair2 = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  CpEair2  = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  muEair2  = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  lambdaEair2 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-
-  // Air outlet
-  rhoSair2 = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-  CpSair2 = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-  muSair2 = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-  lambdaSair2 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-
-  // Air specific enthalpy at the inlet
-  HeAir2  =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-
-  // Air temperature at the outlet
-  // changed from Fluegases_T to FlueGases_h to provide a differentiable function
-  HmAir2  = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
-
-  //
-  Xh2oTeau2 = ThermoSysPro.Properties.FlueGases.XSat(Teeau2, PeAir2);
-
-  // Specific enthalpy of the air saturated with water
-  Hs2  =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
-  Hse2 =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teeau2, Cair1.Xco2, Xh2oTeau2, Xo2as*(1 - Xh2oTeau2), Cair1.Xso2);
-
-  // Water inlet
-  pro_input2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(PeEau1, HmEau1, mode);
-  Teeau2 = pro_input2.T;
-  rho2 = pro_input2.d;
-
-  // Water outlet
-  pro_output2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(PeEau1, HmEau2, mode);
-  Tseau2 = pro_output2.T;
-
-annotation (Icon(graphics={
-        Rectangle(
-          extent={{-90,-80},{90,-100}},
-          lineColor={85,170,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-74,-42},{76,-48}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{76,-48},{62,-100},{40,-48},{20,-100},{2,-48},{-20,-100},{-40,
-              -48},{-60,-100},{-74,-48}},
-          color={0,0,255},
-          thickness=0.5),
-        Polygon(
-          points={{90,-82},{90,-100},{100,-100},{90,-82}},
-          lineColor={85,170,255},
-          lineThickness=1,
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-100,-100},{-70,-40},{-58,0},{-56,20},{-60,60},{-68,100},{70,
-              100},{60,60},{56,20},{58,0},{74,-42},{100,-100},{-100,-100}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{0,0},{0,40}},
-          color={255,0,0},
-          thickness=1),
-        Polygon(
-          points={{0,60},{-10,40},{10,40},{0,60}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-                            Diagram(graphics={
-        Rectangle(
-          extent={{-90,-80},{90,-100}},
-          lineColor={85,170,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-74,-42},{76,-48}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{76,-48},{62,-100},{40,-48},{20,-100},{2,-48},{-20,-100},{-40,
-              -48},{-60,-100},{-74,-48}},
-          color={0,0,255},
-          thickness=0.5),
-        Polygon(
-          points={{90,-80},{90,-100},{100,-100},{90,-80}},
-          lineColor={85,170,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-100,-100},{-70,-40},{-58,0},{-56,20},{-60,60},{-68,100},{70,
-              100},{60,60},{56,20},{58,0},{74,-42},{100,-100},{-100,-100}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{0,0},{0,40}},
-          color={255,0,0},
-          thickness=1),
-        Polygon(
-          points={{0,60},{-10,40},{10,40},{0,60}},
-          lineColor={255,0,0},
-          lineThickness=1,
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end CoolingTower;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model CoolingTower "Cooling tower"
+
+  parameter Integer fluid=1
+    "<html>Fluid number: <br>1 - Water/Steam <br>7 - WaterSteamSimple </html>";
+  parameter Units.SI.AbsolutePressure Patm=101325
+    "Pressure above the fluid level";
+  parameter Units.SI.MassFlowRate Qesp=0.001;
+
+  // ---------------------   Geometrical parameters ------------------------------------------
+  parameter Units.SI.Area A=13114 "Tower cross-sectional aera";
+  parameter Real a1=1/z1 "Water/air interfacial area for the packing (m2/m3)";
+  parameter Units.SI.Height z1=1.6 "Height of the packing heat exchange zone";
+
+  // ----------------------  Mixing law parameters -------------------------------------------
+  parameter Real lambda=1.227 "Beta packing exchange parameter";
+  parameter Real Y=0.51 "Beta packing exchange parameter";
+  parameter Real p_Beta1=0
+    "If > 0, fixed transfert coefficient for the evporating mass (otherwise, this coef. is computed)";
+  Real Beta1
+    "Coefficient de tranfert de masse d'évaporation calculé avec nn et lambda (packing)";
+
+  // ---------------------- Air parameter at the inlet of the tower --------------------------
+  parameter Real Xo2as(start=0.234) "O2 mass fraction in dry air";
+
+  parameter Boolean steady_state=true "true: start from steady state";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real g=9.81 "Gravity constant";
+
+  // ----------------------  Zone 1 : packing   --------------------------
+public
+  parameter Boolean packing_zone_activated=true
+    "true: activation of the packing zone";
+
+  Units.SI.Volume dV "Volume of the packing exchange zone";
+  Real xeH2o "Air humidity at the inlet (kg/kg)";
+  Units.SI.MassFlowRate QsAir2
+    "Ambiant air mass flow at the inlet of the packing zone";
+  Units.SI.SpecificEnthalpy HmAir2(start=100000)
+    "Ambiant air specific enthalpy at the inlet of the packing zone";
+  Units.SI.AbsolutePressure PeAir2
+    "Ambiant air pressure at the inlet of the packing zone";
+  Units.SI.Temperature Teair1(start=284.16)
+    "Ambiant air temperature at the inlet of the packing zone";
+  Real xeH2o1 "Ambiant air humidity at the inlet of the packing zone (kg/kg)";
+  Units.SI.MassFlowRate QsAir1
+    "Hot air mass flow at the outlet of the packing zone";
+  Units.SI.SpecificEnthalpy HmAir1(start=100000)
+    "Hot air specific enthalpy at the outlet of the packing zone";
+  Units.SI.Temperature Tsair1(start=300)
+    "Hot air temperature at the outlet of the packing zone";
+  Real xsH2o1 "Hot air humidity at the outlet of the packing zone (kg/kg)";
+  Real xsO2 "Hot air O2 mass fraction at the outlet of the packing zone";
+  Units.SI.AbsolutePressure PeEau1
+    "Hot water pressure at the inlet of the packing zone";
+  Units.SI.MassFlowRate QeEau1
+    "Hot water mass flow rate at the inlet of the packing zone";
+  Units.SI.SpecificEnthalpy HeEau1
+    "Hot water specific enthalpy at the inlet of the packing zone";
+  Units.SI.Temperature Teeau1
+    "Hot water temperature at the inlet of the packing zone";
+  Units.SI.MassFlowRate QsEau1
+    "Cold water pressure at the outlet of the packing zone";
+  Units.SI.Temperature Tseau1(start=300)
+    "Cold water tempretaure at the outlet of the packing zone";
+  Units.SI.SpecificEnthalpy HmEau1(start=200000)
+    "Cold water specific enthalpy at the outlet of the packing zone";
+  Units.SI.Power dw1
+    "Cooling power given by water convection and evaporation in the packing zone";
+  Units.SI.SpecificEnthalpy Hs1 "Air specific enthalpy in the packing zone";
+  Units.SI.SpecificEnthalpy Hse1
+    "Air specific enthalpy saturated at Teau in the packing zone";
+  Units.SI.MassFlowRate Qevap1 "Evaporation mass flow in the packing zone";
+  Units.SI.Volume Vair1(start=20000) "Air volume in the packing zone";
+  Units.SI.Volume Veau1(start=2000) "Water volume in the packing zone";
+  Units.SI.Density rhoEair1 "Air density at the inlet";
+  Units.SI.DynamicViscosity muEair1 "Air viscosity at the inlet";
+  Units.SI.SpecificHeatCapacity CpEair1
+    "Air specific heat capacity at the inlet";
+  Units.SI.ThermalConductivity lambdaEair1
+    "Air thermal conductivity at the inlet";
+  Units.SI.Density rhoSair1 "Air density at the outlet";
+  Units.SI.DynamicViscosity muSair1 "Air viscosity at the outlet";
+  Units.SI.SpecificHeatCapacity CpSair1
+    "Air specific heat capacity at the outlet";
+  Units.SI.ThermalConductivity lambdaSair1
+    "Air thermal conductivity at the outlet";
+  Units.SI.Density rho1 "Water density";
+
+  // ----------------------  Zone 2 : rain   --------------------------
+  parameter Boolean rain_zone_activated=true "Activation of the rain zone";
+  parameter Units.SI.Area A2=A "Flow cross-sectional area in the tower";
+  parameter Units.SI.Height z2=z1
+    "Height of the exchange zone in the rain zone";
+  parameter Units.SI.Diameter Dg=0.005 "Droplets diameter";
+  parameter Real p_Beta2=0
+    "If > 0, the mass transfer coef. is fixed, otherwise it is computed";
+
+  Real Beta2 "Transfer coefficient for the rain";
+  Units.SI.Velocity Ug(start=1) "Droplets velocity";
+  Units.SI.Velocity Ua "Air velocity";
+  Real a2 "Interfacial area water/air (m2/m3) (rain zone)";
+  Units.SI.PrandtlNumber Pr "Droplets Prandtl number";
+  Units.SI.NusseltNumber Nu "Droplets Nusselt number";
+  Units.SI.ReynoldsNumber Re "Droplets Reynols number";
+  Units.SI.Volume dV2 "Volume of the rain exchange zone";
+  Units.SI.MassFlowRate QeAir2
+    "Air mass flow rate at the inlet of the rain zone";
+  Units.SI.SpecificEnthalpy HeAir2
+    "Air specific enthalpy at the inlet of the rain zone";
+  Units.SI.Temperature Teair2 "Air temperature at the inlet of the rain zone";
+  Units.SI.Temperature Tsair2 "Air temperature at the outlet of the rain zone";
+  Units.SI.Temperature Teeau2
+    "Hot water temperature at the inlet of the rain zone";
+  Units.SI.Temperature Tseau2
+    "Cold water temperature at the outlet of the rain zone";
+  Units.SI.MassFlowRate QsEau2
+    "Cold water mass flow rate at the outlet of the rain zone";
+  Units.SI.MassFlowRate Qevap2 "Evaporation mass flow rate in the rain zone";
+  Real xsH2o2 "Air humidity at the outlet of the rain zone (kg/kg)";
+  Units.SI.Power dw2
+    "Thermal power exchanged between the air and the droplets by convection and evaporation in the rain zone";
+  Units.SI.SpecificEnthalpy Hs2
+    "Air specific enthalpy at temprature Tair in the rain zone";
+  Units.SI.SpecificEnthalpy Hse2
+    "Air specific enthalpy saturated at temperature Teau in the rain zone";
+  Real ng "Number of droplets";
+  Units.SI.Volume Vair2(start=20000) "Air volume in the rain exchange zone";
+  Units.SI.Volume Veau2(start=2000) "Water volume in the rain exchange zone";
+  Units.SI.SpecificEnthalpy HmEau2(start=200000)
+    "Average specific enthalpy in the rain zone";
+  Units.SI.Area SEAU "Contact area air/water";
+  Units.SI.Density rhoEair2(start=1) "Air density at the inlet";
+  Units.SI.DynamicViscosity muEair2(start=1e-6) "Air viscosity at the inlet";
+  Units.SI.SpecificHeatCapacity CpEair2(start=1000)
+    "Air specific heat capacity at the inlet";
+  Units.SI.ThermalConductivity lambdaEair2(start=0.05)
+    "Air thermal conductivity at the inlet";
+  Units.SI.Density rhoSair2 "Air density at the outlet";
+  Units.SI.DynamicViscosity muSair2(start=1e-6) "Air viscosity at the outlet";
+  Units.SI.SpecificHeatCapacity CpSair2(start=1000)
+    "Air specific heat capacity at the outlet";
+  Units.SI.ThermalConductivity lambdaSair2(start=0.05)
+    "Air thermal conductivity at the outlet";
+  Units.SI.Density rho2(start=995) "Water density";
+  Real ddairhp1 "dérivé de la masse volumique de l'air par rapport à H paching";
+  Real ddairhp2 "dérivé de la masse volumique de l'air par rapport à H pluie";
+  Real Xh2oTeau1 "Fraction massique en H2o de l'air a Teeau zone 1";
+  Real Xh2oTeau2 "Fraction massique en H2o de l'air a Teeau zone 1";
+
+public
+  Connectors.FluidInlet Cws1 "Cooling water inlet"
+                                    annotation (Placement(transformation(extent=
+           {{-90,-50},{-70,-30}}, rotation=0)));
+  Connectors.FluidOutlet Cws2 "Cooling water outlet"
+                                    annotation (Placement(transformation(extent=
+           {{-110,-100},{-90,-80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_input1
+    "Packing zone water/steam properties"
+    annotation (Placement(transformation(extent={{-100,60},{-80,86}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_output1
+    "Packing zone water/steam properties"
+    annotation (Placement(transformation(extent={{-100,20},{-80,46}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_input2
+    "Rain zone water/steam properties"
+    annotation (Placement(transformation(extent={{80,60},{100,86}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro_output2
+    "Rain zone water/steam properties"
+    annotation (Placement(transformation(extent={{80,20},{100,46}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesInlet Cair1 "Air inlet"
+                              annotation (Placement(transformation(extent={{-10,
+            -111},{10,-91}}, rotation=0)));
+  ThermoSysPro.FlueGases.Connectors.FlueGasesOutlet Cair2 "Air outlet"
+                              annotation (Placement(transformation(extent={{-10,
+            90},{10,110}}, rotation=0)));
+
+initial equation
+
+  if steady_state then
+    if (rain_zone_activated == true) and (packing_zone_activated == true) then
+      der(HmAir1) = 0;
+      der(HmEau1) = 0;
+      //////////der(HmAir2) = 0;
+      der(HmEau2) = 0;
+    elseif (packing_zone_activated == true) then
+      der(HmAir1) = 0;
+      der(HmEau1) = 0;
+    elseif (rain_zone_activated == true) then
+      der(HmAir2) = 0;
+      der(HmEau2) = 0;
+    end if;
+  else
+    if (rain_zone_activated == true) and (packing_zone_activated == true) then
+      HmAir1 =  HeAir2;
+      HmEau1 =  HeEau1;
+      HmAir2 =  HeAir2;
+      HmEau2 =  HeEau1;
+    elseif (packing_zone_activated == true) then
+      HmAir1 =  HeAir2;
+      HmEau1 =  HeEau1;
+    elseif (rain_zone_activated == true) then
+      HmAir2 =  HeAir2;
+      HmEau2 =  HeEau1;
+    end if;
+  end if;
+
+equation
+
+  /* Unconnected connectors */
+  if (cardinality(Cws1) == 0) then
+    Cws1.Q = 0;
+    Cws1.h = 1.e5;
+    Cws1.b = true;
+  end if;
+
+  if (cardinality(Cws2) == 0) then
+    Cws2.Q = 0;
+    Cws2.h = 1.e5;
+    Cws2.a = true;
+  end if;
+
+  /* Air inlet */
+  PeAir2 = Cair1.P;
+  Teair2 = Cair1.T;
+  QeAir2 = Cair1.Q;
+  xeH2o  = Cair1.Xh2o;
+
+  /* Water inlet */
+  QeEau1 = Cws1.Q;
+  HeEau1 = Cws1.h;
+  PeEau1 = Cws1.P;
+
+  /* Air outlet */
+  Cair2.P = Cair1.P;
+  Cair2.T = Tsair1;
+  Cair2.Q = QsAir1;
+
+  xsO2   = Xo2as*(1-xsH2o1);
+
+  Cair2.Xco2 = 0;
+  Cair2.Xh2o = xsH2o1;
+  Cair2.Xo2  = xsO2;
+  Cair2.Xso2 = 0;
+
+  /* Water outlet */
+  Cws2.Q = QsEau2;
+  Cws2.P = PeEau1;
+
+  //--------------------------------------------------------------------
+  // Zone 1 : packing
+  //--------------------------------------------------------------------
+
+  /* Volume of the packing exchange zone */
+  dV = A*z1;
+  dV = Vair1 + Veau1;
+
+  /* Mass balance equation for the air */
+  der(Vair1)*rhoSair1 + Vair1*ddairhp1*der(HmAir1) = QsAir2 - QsAir1 + Qevap1;
+
+  /* Energy balance equation for the air */
+  Vair1*(PeAir2/rhoSair1*ddairhp1 + rhoSair1)*der(HmAir1) = QsAir2*HmAir2 - QsAir1*HmAir1 + dw1;
+
+  /* Energy balance equation for the water */
+  Veau1*(PeAir2/pro_output1.d*pro_output1.ddph + pro_output1.d) * der(HmEau1) = QeEau1*HeEau1 - QsEau1*HmEau1 - dw1;
+
+  /* Beta computed or fixed for the packing zone */
+  if (p_Beta1 > 0) then
+     Beta1 = p_Beta1;
+  else
+    Beta1 = QeEau1/(a1*dV)*lambda*(QsAir2/QeEau1)^Y;
+  end if;
+
+  /* Air humidity at the outlet of the zone */
+  xsH2o1 = xeH2o1 + Qevap1/QsAir2;
+
+  //--------------------------------------------------------------------
+  // Zone 2 : rain
+  //--------------------------------------------------------------------
+
+  /* Volume of the rain exchange zone */
+  dV2 = A2*z2;
+  dV2 = Vair2 + Veau2;
+
+  /* Mass balance equation for the air */
+  der(Vair2)*rhoSair2 + Vair2*ddairhp2*der(HmAir2) = QeAir2 - QsAir2 + Qevap2;
+
+  /* Energy balance equation for the air */
+  Vair2*(PeAir2/rhoSair2*ddairhp2 + rhoSair2)*der(HmAir2) = QeAir2*HeAir2 - QsAir2*HmAir2 + dw2;
+
+  /* Energy balance equation for the water */
+  Veau2*(PeAir2/pro_output2.d*pro_output2.ddph + pro_output2.d) * der(HmEau2) = QsEau1* HmEau1   - QsEau2* HmEau2   - dw2;
+
+  /* Beta computed or fixed for the rain zone */
+  if (p_Beta2 > 0) then
+     Beta2 = p_Beta2;
+  else
+     Beta2 = lambdaEair2*Nu/(0.92*CpEair2*Dg);
+  end if;
+
+  /* Air humidity at the outlet of the zone */
+  xsH2o2 = xeH2o + Qevap2/QeAir2;
+  xeH2o1 = xsH2o2;
+
+  if (rain_zone_activated == true) and (packing_zone_activated == true) then
+
+    /* Mass balance equation for the water in zone 1 */
+    der(Veau1)*pro_output1.d + Veau1*pro_output1.ddhp*der(HmEau1) = QeEau1 - QsEau1 - Qevap1;
+
+    /* Power exchanged between water and air in zone 1 */
+    dw1 = Beta1 *(Hse1 - Hs1)*a1*dV;
+
+    /* Evaporation mass flow rate in zone 1 */
+    Qevap1 = Beta1*(ThermoSysPro.Properties.FlueGases.XSat(Teeau1, PeAir2) - xeH2o1)*Vair1/z1;
+
+    /* Mass balance equation for the water in zone 2 */
+    der(Veau2)*pro_output2.d + Veau2*pro_output2.ddhp*der(HmEau2) = QsEau1 - QsEau2 - Qevap2;
+
+    /* Power exchanged between the droplets and the air in zone 2 */
+    dw2 = Beta2 *(Hse2 - Hs2)*a2*dV2;
+
+    /* Evaporation mass flow rate in zone 2 */
+    Qevap2 = Beta2*(ThermoSysPro.Properties.FlueGases.XSat(Teeau2, PeAir2) - xeH2o)*Vair2/z2;
+
+    // convergence si permanent false
+    //????????? correcte ????????????
+    QsEau1 - QsEau2 = Qevap2;
+
+    Cws1.h_vol = HmEau1;
+    Cws2.h_vol = HmEau2;
+
+  elseif (packing_zone_activated == true) then   // Packing zone
+
+    /* Mass balance equation for the water in zone 1 */
+    der(Veau1)*pro_output1.d + Veau1*pro_output1.ddhp*der(HmEau1) = QeEau1 - QsEau1 - Qevap1;
+
+    /* Power exchanged between water and air in zone 1 */
+    dw1 = Beta1 *(Hse1 - Hs1)*a1*dV;
+
+    /* Evaporation mass flow rate in zone 1 */
+    Qevap1 = Beta1*(ThermoSysPro.Properties.FlueGases.XSat(Teeau1, PeAir2) - xeH2o1)*Vair1/z1;
+
+    Veau2 = 0;
+
+    /* Power exchanged between the droplets and the air in zone 2 */
+    dw2 = 0;
+
+    /* Evaporation mass flow rate in zone 2 */
+    Qevap2 =  0;
+
+    HmEau2 = HmEau1;
+
+    Cws1.h_vol = HmEau1;
+    Cws2.h_vol = HmEau1;
+
+  elseif (rain_zone_activated == true) then  // Rain zone
+
+    Veau1 = 0;
+
+    /* Power exchanged between water and air in zone 1 */
+    dw1 = 0;
+
+    /* Evaporation mass flow rate in zone 1 */
+    Qevap1  =  0;
+
+    /* Mass balance equation in zone 2 */
+    der(Veau2)*pro_output2.d + Veau2*pro_output2.ddhp*der(HmEau2) = QsEau1 - QsEau2 - Qevap2;
+
+    /* Power exchanged between the droplets and the air in zone 2 */
+    dw2 = Beta2 *(Hse2-Hs2)*a2*dV2;
+
+    /* Evaporation mass flow rate in zone 2 */
+    Qevap2 = Beta2*(ThermoSysPro.Properties.FlueGases.XSat(Teeau2, PeAir2) - xeH2o)*Vair2/z2;
+
+    HmEau1 = HeEau1;
+
+    Cws1.h_vol = HmEau2;
+    Cws2.h_vol = HmEau2;
+
+  end if;
+
+  /* Reynols number for the droplets */
+  Re = rhoEair2*abs(Ug + Ua)*Dg/muEair2;
+
+  /* Prandtl number */
+  Pr = muEair2*CpEair2/lambdaEair2;
+
+  /* Nusselt number */
+  Nu = 2 + 0.6*Re^0.5*Pr^(1/3);
+
+  /* Air/water interfacial area for the rain zone */
+  a2 = SEAU/dV2;
+
+  /* Number of droplets */
+  ng = QsEau1/(4/3*pi*(Dg/2)^3*rho2);
+
+  /* Air/water contact area */
+  SEAU = ng * 4 * pi * (Dg/2)^2;
+
+  /* Air velocity */
+  Ua= Cair1.Q/(rhoEair2*A2);
+
+  /* Droplets velocity */
+  der(Ug) = -18*muEair2*(1 + 0.15*Re^0.687)/(rho2*Dg^2)*(Ug + Ua)^2 + g;
+
+  //--------------------------------------------------------------------
+  // Fluid thermodynamic properties in the packing zone
+  //--------------------------------------------------------------------
+
+  /* Air properties as a function of temperature and humidity */
+
+  // Air inlet
+  rhoEair1 = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+  CpEair1  = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+  muEair1  = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+  lambdaEair1 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+
+  // Air outlet
+  rhoSair1 = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
+  CpSair1  = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
+  muSair1  = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
+  lambdaSair1 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
+
+  // Air temperature at the inlet of zone 1
+  // changed from Fluegases_T to FlueGases_h to provide a differentiable function
+  HmAir2 = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1-xsH2o2), Cair1.Xso2);
+
+
+  // Air temperature at the outlet of zone 1
+  // changed from Fluegases_T to FlueGases_h to provide a differentiable function
+  HmAir1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Tsair1, Cair1.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair1.Xso2);
+
+  //
+  Xh2oTeau1 = ThermoSysPro.Properties.FlueGases.XSat(Teeau1, PeAir2);
+
+  // Specific enthalpy of the air saturated with water
+  Hs1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teair1, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+  Hse1 = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teeau1, Cair1.Xco2, Xh2oTeau1,  Xo2as*(1 - Xh2oTeau1), Cair1.Xso2);
+
+  // Partial derivatives of the air density
+  ddairhp1 = ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(Cair1.P, Tsair1, Cair2.Xco2, xsH2o1, Xo2as*(1 - xsH2o1), Cair2.Xso2);
+  ddairhp2 = ThermoSysPro.Properties.FlueGases.FlueGases_drhodh(Cair1.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+
+  /* Water properties as a function of pressure and specific enthalpy */
+
+  // Water inlet
+  pro_input1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(PeEau1, HeEau1, mode);
+  Teeau1 = pro_input1.T;
+  rho1 = pro_input1.d;
+
+  // Water outlet
+  pro_output1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(PeEau1, HmEau1, mode);
+  Tseau1 = pro_output1.T;
+
+  //--------------------------------------------------------------------
+  // Fluid thermodynamic properties in the rain zone
+  //--------------------------------------------------------------------
+
+  /* Air properties as a function of temperature and humidity */
+
+  // Air inlet
+  rhoEair2 = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  CpEair2  = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  muEair2  = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  lambdaEair2 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+
+  // Air outlet
+  rhoSair2 = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+  CpSair2 = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+  muSair2 = ThermoSysPro.Properties.FlueGases.FlueGases_mu(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+  lambdaSair2 = ThermoSysPro.Properties.FlueGases.FlueGases_k(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+
+  // Air specific enthalpy at the inlet
+  HeAir2  =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+
+  // Air temperature at the outlet
+  // changed from Fluegases_T to FlueGases_h to provide a differentiable function
+  HmAir2  = ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair2.P, Tsair2, Cair1.Xco2, xsH2o2, Xo2as*(1 - xsH2o2), Cair1.Xso2);
+
+  //
+  Xh2oTeau2 = ThermoSysPro.Properties.FlueGases.XSat(Teeau2, PeAir2);
+
+  // Specific enthalpy of the air saturated with water
+  Hs2  =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teair2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2);
+  Hse2 =  ThermoSysPro.Properties.FlueGases.FlueGases_h(Cair1.P, Teeau2, Cair1.Xco2, Xh2oTeau2, Xo2as*(1 - Xh2oTeau2), Cair1.Xso2);
+
+  // Water inlet
+  pro_input2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(PeEau1, HmEau1, mode);
+  Teeau2 = pro_input2.T;
+  rho2 = pro_input2.d;
+
+  // Water outlet
+  pro_output2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(PeEau1, HmEau2, mode);
+  Tseau2 = pro_output2.T;
+
+annotation (Icon(graphics={
+        Rectangle(
+          extent={{-90,-80},{90,-100}},
+          lineColor={85,170,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-74,-42},{76,-48}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{76,-48},{62,-100},{40,-48},{20,-100},{2,-48},{-20,-100},{-40,
+              -48},{-60,-100},{-74,-48}},
+          color={0,0,255},
+          thickness=0.5),
+        Polygon(
+          points={{90,-82},{90,-100},{100,-100},{90,-82}},
+          lineColor={85,170,255},
+          lineThickness=1,
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-100,-100},{-70,-40},{-58,0},{-56,20},{-60,60},{-68,100},{70,
+              100},{60,60},{56,20},{58,0},{74,-42},{100,-100},{-100,-100}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{0,0},{0,40}},
+          color={255,0,0},
+          thickness=1),
+        Polygon(
+          points={{0,60},{-10,40},{10,40},{0,60}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+                            Diagram(graphics={
+        Rectangle(
+          extent={{-90,-80},{90,-100}},
+          lineColor={85,170,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-74,-42},{76,-48}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{76,-48},{62,-100},{40,-48},{20,-100},{2,-48},{-20,-100},{-40,
+              -48},{-60,-100},{-74,-48}},
+          color={0,0,255},
+          thickness=0.5),
+        Polygon(
+          points={{90,-80},{90,-100},{100,-100},{90,-80}},
+          lineColor={85,170,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-100,-100},{-70,-40},{-58,0},{-56,20},{-60,60},{-68,100},{70,
+              100},{60,60},{56,20},{58,0},{74,-42},{100,-100},{-100,-100}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{0,0},{0,40}},
+          color={255,0,0},
+          thickness=1),
+        Polygon(
+          points={{0,60},{-10,40},{10,40},{0,60}},
+          lineColor={255,0,0},
+          lineThickness=1,
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end CoolingTower;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicCondenser.mo b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicCondenser.mo
index 538898d62271312fb7bd5f5f1a3cabefcafa2ddb..2a3765827e1faf9f5a7bc20491ec99b68bb72017 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicCondenser.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicCondenser.mo
@@ -1,279 +1,279 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model DynamicCondenser "Dynamic Cavity"
-  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
-  parameter Real Vf0=0.066
-    "Fraction of initial liquid volume in the Cavity (0 < Vf0 < 1)";
-  parameter Units.SI.Pressure P0c=1e4 "INitial pressure in the Cavity";
-  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
-  parameter Units.SI.Length Lv=15 "Cavity length";
-  parameter Units.SI.Length L2=14 "Pipes length";
-  parameter Units.SI.Length Lc=2.5
-    "support plate spacing in cooling zone(Chicanes)";
-  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
-  parameter Units.SI.Thickness ec=2.e-3 "Thickness of the cooling pipes";
-  parameter Integer Ns=10 "Number of segments for pipes";
-  parameter Integer ntubest=10000 "Number of total pipes in Cavity ";
-  parameter Integer ntubesV=200 "Numbers of pipes in a vertical plan in Cavity";
-  parameter Units.SI.SpecificHeatCapacity cp=460
-    "Specific heat capacity of the metal of the cooling pipes";
-  parameter Units.SI.Density rho=7900
-    "Density of the metal of the cooling pipes";
-  parameter Units.SI.ThermalConductivity lambda=26
-    "Wall thermal conductivity of the cooling pipes";
-  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000
-  //  "Heat transfer coefficient between the vapor and the cooling pipes";
-
-  Volumes.TwoPhaseCavityOnePipe DynamicCondenser(
-    Vf0=Vf0,
-    P0=P0c,
-    Ns=Ns,
-    L2=L2,
-    NbTubT=ntubest,
-    Lc=Lc,
-    NbTubV=ntubesV,
-    Dext=Dc + 2*ec,
-    R=Rv,
-    L=Lv,
-    Vertical=true)
-    annotation (                        Placement(transformation(extent={{-100,
-            -100},{100,100}}, rotation=0)));
-  DynamicOnePhaseFlowPipe pipe_3(
-    option_temperature=2,
-    advection=true,
-    mode=0,
-    continuous_flow_reversal=true,
-    D=Dc,
-    L=L2,
-    ntubes=ntubest,
-    Ns=Ns)
-    annotation (Placement(transformation(extent={{-58,-20},{54,18}}, rotation=0)));
-  Connectors.FluidInletI C1vap "Vapor inlet"
-    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Connectors.FluidOutletI C2ex "Condensed water extraction outlet"
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Connectors.FluidInletI Ce1 "Cooling water inlet"
-    annotation (Placement(transformation(extent={{-110,-11},{-90,9}}, rotation=
-            0)));
-  Connectors.FluidOutletI Ce2 "Cooling water outlet"
-    annotation (Placement(transformation(extent={{89,-11},{109,9}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
-    annotation (Placement(transformation(extent={{98,-62},{118,-42}}, rotation=
-            0)));
-
-  Connectors.FluidInletI C1 "Extra water inlet"
-    annotation (Placement(transformation(extent={{-107,71},{-87,91}}, rotation=
-            0)));
-  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    L=L2,
-    Ns=Ns,
-    ntubes=ntubest)
-    annotation (Placement(transformation(extent={{-58,-4},{54,40}}, rotation=0)));
-  Connectors.FluidInletI C2vap "Vapor inlet"
-    annotation (Placement(transformation(extent={{-63,90},{-43,110}}, rotation=
-            0)));
-equation
-
-  if (cardinality(C1) == 1) then
-    C1.Q = 0;
-    C1.h = 1.e5;
-    C1.b = true;
-  end if;
-
-  if (cardinality(C2vap) == 1) then
-    C2vap.Q = 0;
-    C2vap.h = 1.e5;
-    C2vap.b = true;
-  end if;
-
-  connect(DynamicCondenser.Cl, C2ex)
-                               annotation (Line(points={{7.10543e-015,-73.3333},
-          {7.10543e-015,-98},{0,-98},{0,-100}}, color={0,0,255}));
-  connect(C1, DynamicCondenser.Ce)
-    annotation (Line(points={{-97,81},{-80,81},{-80,54},{-78,54},{-78,52.6667},
-          {-76.5714,52.6667}}));
-  connect(DynamicCondenser.yLevel, sortieReelle)
-    annotation (Line(points={{98.8571,-31.3333},{94,-31.3333},{94,-52},{108,-52}}));
-  connect(DynamicCondenser.Cth3, Wall_3.WT2)
-                                      annotation (Line(points={{-0.571429,
-          37.3333},{-2,32},{-2,22.4}}, color={191,95,0}));
-  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{-2,13.6},{-2,11.375},
-          {-2,9.15},{-2,4.7}},                      color={191,95,0}));
-  connect(DynamicCondenser.CvBP, C1vap)
-    annotation (Line(points={{-0.571429,73.3333},{-0.571429,92},{0,92},{0,100}}));
-  connect(C2vap, DynamicCondenser.CvGCT)
-    annotation (Line(points={{-53,100},{-42.8571,100},{-42.8571,73.3333}}));
-  connect(pipe_3.C2, Ce2) annotation (Line(
-      points={{54,-1},{99,-1}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(pipe_3.C1, Ce1)
-    annotation (Line(points={{-58,-1},{-100,-1}}, thickness=0.5));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={Text(
-          extent={{6,114},{32,98}},
-          lineColor={0,0,255},
-          textString=
-               "BP")}),Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{100,58},{80,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,58},{-80,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,24},{-80,18}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-20},{-80,-26}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-42},{-80,-48}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,24},{20,18}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-42},{20,-48}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-20},{20,-26}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-20},{-30,-26}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-42},{-30,-48}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,24},{-30,18}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,100},{-20,98},{-40,94},{-60,88},{-80,78},{-92,66},{-96,62},
-              {-96,62},{-100,58},{100,58},{96,62},{92,66},{86,72},{80,78},{60,
-              88},{40,94},{20,98},{0,100}},
-          lineColor={0,0,255},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-100},{-20,-98},{-40,-96},{-60,-90},{-80,-80},{-92,-68},{
-              -96,-64},{-100,-60},{-100,-60},{98,-60},{100,-60},{96,-64},{92,
-              -68},{80,-80},{60,-90},{40,-96},{20,-98},{0,-100}},
-          lineColor={0,0,255},
-          fillColor={53,117,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{100,-60},{80,-80},{80,-60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,-60},{-80,-60},{-80,-80},{-100,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,58},{-80,58},{-80,78},{-100,58}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{100,58},{80,58},{80,78},{100,58}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-64},{-80,-70}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-64},{20,-70}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-64},{-30,-70}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,2},{-80,-4}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,2},{20,-4}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,2},{-30,-4}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,46},{-80,40}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,46},{20,40}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,46},{-30,40}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{90,8},{80,20}}, color={255,0,0}),
-        Line(points={{90,-10},{80,-22}}, color={255,0,0}),
-        Line(points={{90,-1},{78,-1}}, color={255,0,0}),
-        Line(points={{-90,9},{-80,20}}, color={0,0,255}),
-        Line(points={{-90,-10},{-80,-24}}, color={0,0,255}),
-        Line(points={{-90,-1},{-76,-1}}, color={0,0,255})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 9.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>"));
-end DynamicCondenser;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model DynamicCondenser "Dynamic Cavity"
+  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
+  parameter Real Vf0=0.066
+    "Fraction of initial liquid volume in the Cavity (0 < Vf0 < 1)";
+  parameter Units.SI.Pressure P0c=1e4 "INitial pressure in the Cavity";
+  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
+  parameter Units.SI.Length Lv=15 "Cavity length";
+  parameter Units.SI.Length L2=14 "Pipes length";
+  parameter Units.SI.Length Lc=2.5
+    "support plate spacing in cooling zone(Chicanes)";
+  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
+  parameter Units.SI.Thickness ec=2.e-3 "Thickness of the cooling pipes";
+  parameter Integer Ns=10 "Number of segments for pipes";
+  parameter Integer ntubest=10000 "Number of total pipes in Cavity ";
+  parameter Integer ntubesV=200 "Numbers of pipes in a vertical plan in Cavity";
+  parameter Units.SI.SpecificHeatCapacity cp=460
+    "Specific heat capacity of the metal of the cooling pipes";
+  parameter Units.SI.Density rho=7900
+    "Density of the metal of the cooling pipes";
+  parameter Units.SI.ThermalConductivity lambda=26
+    "Wall thermal conductivity of the cooling pipes";
+  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000
+  //  "Heat transfer coefficient between the vapor and the cooling pipes";
+
+  Volumes.TwoPhaseCavityOnePipe DynamicCondenser(
+    Vf0=Vf0,
+    P0=P0c,
+    Ns=Ns,
+    L2=L2,
+    NbTubT=ntubest,
+    Lc=Lc,
+    NbTubV=ntubesV,
+    Dext=Dc + 2*ec,
+    R=Rv,
+    L=Lv,
+    Vertical=true)
+    annotation (                        Placement(transformation(extent={{-100,
+            -100},{100,100}}, rotation=0)));
+  DynamicOnePhaseFlowPipe pipe_3(
+    option_temperature=2,
+    advection=true,
+    mode=0,
+    continuous_flow_reversal=true,
+    D=Dc,
+    L=L2,
+    ntubes=ntubest,
+    Ns=Ns)
+    annotation (Placement(transformation(extent={{-58,-20},{54,18}}, rotation=0)));
+  Connectors.FluidInletI C1vap "Vapor inlet"
+    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Connectors.FluidOutletI C2ex "Condensed water extraction outlet"
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Connectors.FluidInletI Ce1 "Cooling water inlet"
+    annotation (Placement(transformation(extent={{-110,-11},{-90,9}}, rotation=
+            0)));
+  Connectors.FluidOutletI Ce2 "Cooling water outlet"
+    annotation (Placement(transformation(extent={{89,-11},{109,9}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
+    annotation (Placement(transformation(extent={{98,-62},{118,-42}}, rotation=
+            0)));
+
+  Connectors.FluidInletI C1 "Extra water inlet"
+    annotation (Placement(transformation(extent={{-107,71},{-87,91}}, rotation=
+            0)));
+  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    L=L2,
+    Ns=Ns,
+    ntubes=ntubest)
+    annotation (Placement(transformation(extent={{-58,-4},{54,40}}, rotation=0)));
+  Connectors.FluidInletI C2vap "Vapor inlet"
+    annotation (Placement(transformation(extent={{-63,90},{-43,110}}, rotation=
+            0)));
+equation
+
+  if (cardinality(C1) == 1) then
+    C1.Q = 0;
+    C1.h = 1.e5;
+    C1.b = true;
+  end if;
+
+  if (cardinality(C2vap) == 1) then
+    C2vap.Q = 0;
+    C2vap.h = 1.e5;
+    C2vap.b = true;
+  end if;
+
+  connect(DynamicCondenser.Cl, C2ex)
+                               annotation (Line(points={{7.10543e-15,-73.3333},
+          {7.10543e-15,-98},{0,-98},{0,-100}},  color={0,0,255}));
+  connect(C1, DynamicCondenser.Ce)
+    annotation (Line(points={{-97,81},{-80,81},{-80,54},{-78,54},{-78,52.6667},
+          {-76.5714,52.6667}}));
+  connect(DynamicCondenser.yLevel, sortieReelle)
+    annotation (Line(points={{98.8571,-31.3333},{94,-31.3333},{94,-52},{108,-52}}));
+  connect(DynamicCondenser.Cth3, Wall_3.WT2)
+                                      annotation (Line(points={{-0.571429,
+          37.3333},{-2,32},{-2,22.4}}, color={191,95,0}));
+  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{-2,13.6},{-2,11.375},
+          {-2,9.15},{-2,4.7}},                      color={191,95,0}));
+  connect(DynamicCondenser.CvBP, C1vap)
+    annotation (Line(points={{-0.571429,73.3333},{-0.571429,92},{0,92},{0,100}}));
+  connect(C2vap, DynamicCondenser.CvGCT)
+    annotation (Line(points={{-53,100},{-42.8571,100},{-42.8571,73.3333}}));
+  connect(pipe_3.C2, Ce2) annotation (Line(
+      points={{54,-1},{99,-1}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(pipe_3.C1, Ce1)
+    annotation (Line(points={{-58,-1},{-100,-1}}, thickness=0.5));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={Text(
+          extent={{6,114},{32,98}},
+          lineColor={0,0,255},
+          textString=
+               "BP")}),Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{100,58},{80,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,58},{-80,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,24},{-80,18}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-20},{-80,-26}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-42},{-80,-48}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,24},{20,18}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-42},{20,-48}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-20},{20,-26}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-20},{-30,-26}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-42},{-30,-48}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,24},{-30,18}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,100},{-20,98},{-40,94},{-60,88},{-80,78},{-92,66},{-96,62},
+              {-96,62},{-100,58},{100,58},{96,62},{92,66},{86,72},{80,78},{60,
+              88},{40,94},{20,98},{0,100}},
+          lineColor={0,0,255},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-100},{-20,-98},{-40,-96},{-60,-90},{-80,-80},{-92,-68},{
+              -96,-64},{-100,-60},{-100,-60},{98,-60},{100,-60},{96,-64},{92,
+              -68},{80,-80},{60,-90},{40,-96},{20,-98},{0,-100}},
+          lineColor={0,0,255},
+          fillColor={53,117,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{100,-60},{80,-80},{80,-60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,-60},{-80,-60},{-80,-80},{-100,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,58},{-80,58},{-80,78},{-100,58}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{100,58},{80,58},{80,78},{100,58}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-64},{-80,-70}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-64},{20,-70}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-64},{-30,-70}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,2},{-80,-4}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,2},{20,-4}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,2},{-30,-4}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,46},{-80,40}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,46},{20,40}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,46},{-30,40}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{90,8},{80,20}}, color={255,0,0}),
+        Line(points={{90,-10},{80,-22}}, color={255,0,0}),
+        Line(points={{90,-1},{78,-1}}, color={255,0,0}),
+        Line(points={{-90,9},{-80,20}}, color={0,0,255}),
+        Line(points={{-90,-10},{-80,-24}}, color={0,0,255}),
+        Line(points={{-90,-1},{-76,-1}}, color={0,0,255})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 9.5.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>"));
+end DynamicCondenser;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicOnePhaseFlowPipe.mo
index 72112eca82142bb547b512d544fd09ba637bd921..742073414f1351d458e69077cacc39d5b179b90c 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicOnePhaseFlowPipe.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicOnePhaseFlowPipe.mo
@@ -1,336 +1,336 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model DynamicOnePhaseFlowPipe "Dynamic one-phase flow pipe"
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
-  parameter Real rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real dpfCorr=1.00
-    "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Real hcCorr=1.00
-    "Corrective term for the heat exchange coefficient (hc) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)";
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_mass_balance=true)";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
-  parameter Integer option_temperature=1
-    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
-  parameter Boolean continuous_flow_reversal=true
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-  parameter Integer N=Ns + 1
-    "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Internal cross sectional pipe area";
-  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-  parameter Units.SI.Area dSi=pi*Di*dx1
-    "Internal heat exchange area for a node";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boudary of node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the water side for node i";
-  Units.SI.Power W1t "Total power exchanged on the water side";
-  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
-       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
-  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Fluid Reynolds number in hydraulic node i";
-  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i";
-  Units.SI.ThermalConductivity k[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Fluid thermal conductivity in node i";
-  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
-  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Fluid dynamic viscosity in hydraulic node i";
-  Units.SI.SpecificHeatCapacity cp[N - 1](start=fill(4000, N - 1), nominal=fill(
-        4000, N - 1)) "Fluid specific heat capacity";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real khi[N] "Hydraulic pressure loss coefficient in node i";
-  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[
-                                                              N - 1]
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
-                                                              2]
-    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[
-                                                              N]
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat[
-                                                        N - 1]
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat[
-                                                        N - 1]
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-public
-  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
-           {{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-initial equation
-  if steady_state then
-    for i in 2:N loop
-      der(h[i]) = 0;
-    end for;
-  else
-    Tp = T0;
-
-    if (option_temperature == 1) then
-      for i in 2:N loop
-        h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P[i], T0[i - 1], mode);
-      end for;
-    elseif (option_temperature == 2) then
-      for i in 2:N loop
-        h[i] = h0[i - 1];
-      end for;
-    else
-      assert(false, "DynamicOnePhaseFlowPipe: incorrect option");
-    end if;
-  end if;
-
-  if dynamic_mass_balance then
-    for i in 2:N loop
-      der(P[i]) = 0;
-    end for;
-  end if;
-
-  if inertia then
-    if dynamic_mass_balance then
-      for i in 1:N loop
-        der(Q[i]) = 0;
-      end for;
-    else
-      der(Q[1]) = 0;
-    end if;
-  end if;
-
-equation
-
-  /* Wall temperature */
-  Tp = CTh.T;
-  CTh.W = dW1;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol;
-  h[N + 1] = C2.h_vol;
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-    if dynamic_mass_balance then
-      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
-    else
-      0 = Q[i] - Q[i + 1];
-    end if;
-
-    /* Energy balance equation */
-    if dynamic_mass_balance then
-      if simplified_dynamic_energy_balance then
-        A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-      else
-        A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-      end if;
-    else
-      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-    end if;
-
-    /* Heat transfer at the wall */
-    dW1[i] = hc[i]*dSi*(Tp[i] - T1[i]);
-
-    /* Fluid thermodynamic properties */
-    pro1[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[i + 1], h[i + 1], mode);
-
-    rho1[i] = pro1[i].d;
-    T1[i] = pro1[i].T;
-
-    (lsat[i],vsat[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P[i + 1]);
-
-    cp[i] = pro1[i].cp;
-
-    mu1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho1[i], T1[i]);
-    k[i] = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho1[i], T1[i],P[i + 1]));
-
-    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
-    if noEvent(Re1[i] > 2000) then
-      hc[i] = hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4;
-    else
-      hc[i] = hcCorr*k[i]/D*max(4.36,0.023*Re1[i]^0.8*Pr[i]^0.4);
-    end if;
-
-    Pr[i] = mu1[i]*cp[i]/k[i];
-    Re1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2/(pi*Di*mu1[i])));
-
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
-        hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*Modelica.Math.sin(pi
-        *Q[i]/2/Qeps) + h[i + 1] + h[i]));
-    else
-      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
-    end if;
-
-    /* Momentum balance equation */
-    if inertia then
-      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
-    else
-      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-    end if;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rho2[i]));
-
-    khi[i] = lambda[i]*dx2/D;
-
-    lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-
-    Re2[i] = noEvent(abs(4*Q[i]/(pi*Di*mu2[i])));
-
-    /* Fluid thermodynamic properties */
-    pro2[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P[i] + P[i + 1])/2, hb[i], mode);
-
-    rho2[i] = pro2[i].d;
-    T2[i] = pro2[i].T;
-
-    mu2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho2[i], T2[i]);
-
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1], mode);
-  proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1],h[N + 1], mode);
-
-  rhoc[1] = proc[1].d;
-  rhoc[N + 1] = proc[2].d;
-
-  W1t = sum(dW1);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{-60,20},{-60,-20}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-    Window(
-      x=0.18,
-      y=0.05,
-      width=0.68,
-      height=0.94),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end DynamicOnePhaseFlowPipe;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model DynamicOnePhaseFlowPipe "Dynamic one-phase flow pipe"
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
+  parameter Real rugosrel=0.0007 "Pipe relative roughness";
+  parameter Real ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real dpfCorr=1.00
+    "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Real hcCorr=1.00
+    "Corrective term for the heat exchange coefficient (hc) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)";
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_mass_balance=true)";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
+  parameter Integer option_temperature=1
+    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
+  parameter Boolean continuous_flow_reversal=true
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+  parameter Integer N=Ns + 1
+    "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Internal cross sectional pipe area";
+  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+  parameter Units.SI.Area dSi=pi*Di*dx1
+    "Internal heat exchange area for a node";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boudary of node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the water side for node i";
+  Units.SI.Power W1t "Total power exchanged on the water side";
+  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
+       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
+  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Fluid Reynolds number in hydraulic node i";
+  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i";
+  Units.SI.ThermalConductivity k[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Fluid thermal conductivity in node i";
+  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
+  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Fluid dynamic viscosity in hydraulic node i";
+  Units.SI.SpecificHeatCapacity cp[N - 1](start=fill(4000, N - 1), nominal=fill(
+        4000, N - 1)) "Fluid specific heat capacity";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real khi[N] "Hydraulic pressure loss coefficient in node i";
+  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[
+                                                              N - 1]
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
+                                                              2]
+    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[
+                                                              N]
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat[
+                                                        N - 1]
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat[
+                                                        N - 1]
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+public
+  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
+           {{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+initial equation
+  if steady_state then
+    for i in 2:N loop
+      der(h[i]) = 0;
+    end for;
+  else
+    Tp = T0;
+
+    if (option_temperature == 1) then
+      for i in 2:N loop
+        h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P[i], T0[i - 1], mode);
+      end for;
+    elseif (option_temperature == 2) then
+      for i in 2:N loop
+        h[i] = h0[i - 1];
+      end for;
+    else
+      assert(false, "DynamicOnePhaseFlowPipe: incorrect option");
+    end if;
+  end if;
+
+  if dynamic_mass_balance then
+    for i in 2:N loop
+      der(P[i]) = 0;
+    end for;
+  end if;
+
+  if inertia then
+    if dynamic_mass_balance then
+      for i in 1:N loop
+        der(Q[i]) = 0;
+      end for;
+    else
+      der(Q[1]) = 0;
+    end if;
+  end if;
+
+equation
+
+  /* Wall temperature */
+  Tp = CTh.T;
+  CTh.W = dW1;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol;
+  h[N + 1] = C2.h_vol;
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+    if dynamic_mass_balance then
+      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
+    else
+      0 = Q[i] - Q[i + 1];
+    end if;
+
+    /* Energy balance equation */
+    if dynamic_mass_balance then
+      if simplified_dynamic_energy_balance then
+        A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+      else
+        A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+      end if;
+    else
+      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+    end if;
+
+    /* Heat transfer at the wall */
+    dW1[i] = hc[i]*dSi*(Tp[i] - T1[i]);
+
+    /* Fluid thermodynamic properties */
+    pro1[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[i + 1], h[i + 1], mode);
+
+    rho1[i] = pro1[i].d;
+    T1[i] = pro1[i].T;
+
+    (lsat[i],vsat[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P[i + 1]);
+
+    cp[i] = pro1[i].cp;
+
+    mu1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho1[i], T1[i]);
+    k[i] = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho1[i], T1[i],P[i + 1]));
+
+    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
+    if noEvent(Re1[i] > 2000) then
+      hc[i] = hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4;
+    else
+      hc[i] = hcCorr*k[i]/D*max(4.36,0.023*Re1[i]^0.8*Pr[i]^0.4);
+    end if;
+
+    Pr[i] = mu1[i]*cp[i]/k[i];
+    Re1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2/(pi*Di*mu1[i])));
+
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
+        hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*Modelica.Math.sin(pi
+        *Q[i]/2/Qeps) + h[i + 1] + h[i]));
+    else
+      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
+    end if;
+
+    /* Momentum balance equation */
+    if inertia then
+      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
+    else
+      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+    end if;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rho2[i]));
+
+    khi[i] = lambda[i]*dx2/D;
+
+    lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+
+    Re2[i] = noEvent(abs(4*Q[i]/(pi*Di*mu2[i])));
+
+    /* Fluid thermodynamic properties */
+    pro2[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P[i] + P[i + 1])/2, hb[i], mode);
+
+    rho2[i] = pro2[i].d;
+    T2[i] = pro2[i].T;
+
+    mu2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho2[i], T2[i]);
+
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1], mode);
+  proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1],h[N + 1], mode);
+
+  rhoc[1] = proc[1].d;
+  rhoc[N + 1] = proc[2].d;
+
+  W1t = sum(dW1);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{-60,20},{-60,-20}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+    Window(
+      x=0.18,
+      y=0.05,
+      width=0.68,
+      height=0.94),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end DynamicOnePhaseFlowPipe;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicOnePhaseFlowShell.mo b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicOnePhaseFlowShell.mo
index 4e5baccac4fe9117e786fffe842a6d9a65cd85c1..b3a9784f4eaa4eee762f0340e1f408729b39dcef 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicOnePhaseFlowShell.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicOnePhaseFlowShell.mo
@@ -1,473 +1,473 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model DynamicOnePhaseFlowShell "Dynamic one-phase flow shell"
-  parameter Integer option_arrangement = 1 "1:triangle - 2: square";
-  parameter Units.SI.Length L=12 "Shell length";
-  parameter Units.SI.Diameter Ds=1 "shell internal diameter";
-  parameter Units.SI.Diameter De=0.019 "tube external diameter";
-  parameter Units.SI.Distance dc=0.030 "Central distance of two tubes";
-  parameter Units.SI.Length B=1.2 "distance between two plates in the shell";
-  parameter Real rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=500 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real dpfCorr=1.00
-    "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Real hcCorr=1.00
-    "Corrective term for the heat exchange coefficient (hc) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)";
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true)";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
-  parameter Integer option_temperature=1
-    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
-  parameter Boolean continuous_flow_reversal=true
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Units.SI.Area As=B*Ds*dt/dc
-    "maximum cross sectional area of flow in shell";
-  parameter Units.SI.Area A=pi*Ds^2/4 - ntubes*pi*De^2/4
-    "Liquid cross sectional in shell";
-
-protected
-  parameter Integer Nb = integer(floor(L/B));
-  parameter Units.SI.Distance dt=dc - De "distance between two tubes";
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-  parameter Integer N=Ns + 1
-    "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Diameter Deq=if (option_arrangement == 1) then (3.464*dc^2
-       - pi*De^2)/(pi*De) else if (option_arrangement == 2) then (4*dc^2 - pi*
-      De^2)/(pi*De) else De
-    "equivalent diameter of triangle arrangement between tubes";
-  parameter Units.SI.Area dSi=pi*De*ntubes*dx1
-    "Internal heat exchange area for a node";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boudary of node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the water side for node i";
-  Units.SI.Power W1t "Total power exchanged on the water side";
-  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
-       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
-  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Fluid Reynolds number in hydraulic node i";
-  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i";
-  Units.SI.ThermalConductivity k[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Fluid thermal conductivity in node i";
-  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
-  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Fluid dynamic viscosity in hydraulic node i";
-  Units.SI.SpecificHeatCapacity cp[N - 1](start=fill(4000, N - 1), nominal=fill(
-        4000, N - 1)) "Fluid specific heat capacity";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i";
-  Units.SI.Diameter Deq1;
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[
-                                                              N - 1]
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
-                                                              2]
-    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[
-                                                              N]
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat[
-                                                        N - 1]
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat[
-                                                        N - 1]
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-public
-  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
-           {{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-initial equation
-  if steady_state then
-    for i in 2:N loop
-      der(h[i]) = 0;
-    end for;
-  else
-    if (option_temperature == 1) then
-      for i in 2:N loop
-        h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(
-          P[i],
-          T0[i - 1],
-          mode);
-      end for;
-    elseif (option_temperature == 2) then
-      for i in 2:N loop
-        h[i] = h0[i - 1];
-      end for;
-    else
-      assert(false, "DynamicOnePhaseFlowPipe: incorrect option");
-    end if;
-  end if;
-
-  if dynamic_mass_balance then
-    for i in 2:N loop
-      der(P[i]) = 0;
-    end for;
-  end if;
-
-  if inertia then
-    if dynamic_mass_balance then
-      for i in 1:N loop
-        der(Q[i]) = 0;
-      end for;
-    else
-      der(Q[1]) = 0;
-    end if;
-  end if;
-
-equation
-
-  /* Wall temperature */
-  Tp = CTh.T;
-  CTh.W = dW1;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol;
-  h[N + 1] = C2.h_vol;
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-    if dynamic_mass_balance then
-      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
-    else
-      0 = Q[i] - Q[i + 1];
-    end if;
-
-    /* Energy balance equation */
-    if dynamic_energy_balance then
-      if simplified_dynamic_energy_balance then
-        A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-      else
-        A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-      end if;
-    else
-      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-    end if;
-
-    /* Heat transfer at the wall */
-    dW1[i] = hc[i]*dSi*(Tp[i] - T1[i]);
-
-    /* Fluid thermodynamic properties */
-    pro1[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[i + 1], h[i + 1], mode);
-
-    rho1[i] = pro1[i].d;
-    T1[i] = pro1[i].T;
-
-    (lsat[i],vsat[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P[i + 1]);
-
-    cp[i] = pro1[i].cp;
-
-    mu1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho1[i], T1[i]);
-    k[i] = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho1[i], T1[i], P[i + 1]));
-
-    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
-    Pr[i] = mu1[i]*cp[i]/k[i];
-    Re1[i] = noEvent(abs(De*(Q[i] + Q[i + 1])/(2*As*mu1[i])));
-
-    hc[i] = hcCorr*(noEvent(if (Re1[i] < 2000) then 0.5*(k[i]/De)*Re1[i]^0.507*Pr[i]^0.33 else if ((Re1[i] > 2000) and (Re1[i] < 1e6)) then 0.36 * (k[i]/De) *Re1[i]^0.55*Pr[i]^0.33 else 0.023*k[i]/De*Re1[i]^0.8*Pr[i]^0.4));
-    //hc[i] = noEvent(if ((Re1[i] > 1.e-6) and (Pr[i] > 1.e-6)) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 0);
-
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
-        hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*Modelica.Math.sin(pi*Q[i]/2/Qeps) + h[i + 1] + h[i]));
-    else
-      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
-    end if;
-
-    /* Momentum balance equation */
-    if inertia then
-      1/As*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
-    else
-      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-    end if;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/As^2;
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Fluid thermodynamic properties */
-    pro2[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P[i] + P[i + 1])/2,hb[i], mode);
-
-    rho2[i] = pro2[i].d;
-    T2[i] = pro2[i].T;
-
-    mu2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho2[i], T2[i]);
-    //Re2[i] = noEvent(abs(Deq*Q[i]/(As*mu2[i])));
-    Re2[i] = noEvent(De*abs(Q[i])/(As*mu2[i]));
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    // Ds/dc is the number of rows
-    //dpf[i] = noEvent(dpfCorr*Ds/dc*lambda[i]*Q[i]*abs(Q[i])/(2*As^2*rho2[i]));
-   dpf[i] = noEvent(dpfCorr*Ds/dc*(Nb +1)*lambda[i]*Q[i]*abs(Q[i])/(2*As^2*rho2[i])/N);
-
-    //lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/De))^(-2) else 0.01;
-    lambda[i] = Modelica.Math.exp(0.576-0.19*Modelica.Math.log(Re2[i]));
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1], mode);
-  proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1], h[N + 1], mode);
-
-  rhoc[1] = proc[1].d;
-  rhoc[N + 1] = proc[2].d;
-
-  W1t = sum(dW1);
-
-  Deq1 = Deq;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}}),
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{60,10},{60,-30}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{20,30},{20,-10}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-20,10},{-20,-30}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-60,30},{-60,-10}},
-          color={0,0,0},
-          thickness=1),
-        Line(points={{-20,29},{-20,11}}, color={255,255,255}),
-        Line(points={{-60,-10},{-60,-30}}, color={255,255,255}),
-        Line(points={{20,-10},{20,-30}}, color={255,255,255}),
-        Line(points={{60,30},{60,11}}, color={255,255,255}),
-        Ellipse(
-          extent={{-31,-35},{31,-95}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{14,-47},{24,-57}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-24,-74},{-14,-84}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{14,-73},{24,-83}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-14,-60},{-4,-70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{6,-60},{16,-70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{18,-60},{28,-70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-12,-81},{-2,-91}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{2,-82},{12,-92}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{2,-39},{12,-49}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-29,-61},{-19,-71}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-5,-50},{5,-60}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-12,-39},{-2,-49}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-4,-69},{6,-79}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-24,-47},{-14,-57}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-60,30},{-60,-10}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-20,11},{-20,-29}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{20,30},{20,-10}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{60,10},{60,-30}},
-          color={0,0,0},
-          thickness=1),
-        Line(points={{-20,30},{-20,12}}, color={255,255,255}),
-        Line(points={{-60,-9},{-60,-29}}, color={255,255,255}),
-        Line(points={{20,-9},{20,-29}}, color={255,255,255}),
-        Line(points={{60,31},{60,12}}, color={255,255,255})}),
-    Window(
-      x=0.18,
-      y=0.05,
-      width=0.68,
-      height=0.94),
-    Documentation(info="<html>
-<h4>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 9.4.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-<p>Nota: component model name in title of Sect. 9.4.3.3 in book is incorrectly given as DynamicTwoPhaseFlowShell, instead of DynamicOnePhaseFlowShell</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela</li>
-<li>Jiahui Lu</li>
-</ul>
-</html>"));
-end DynamicOnePhaseFlowShell;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model DynamicOnePhaseFlowShell "Dynamic one-phase flow shell"
+  parameter Integer option_arrangement = 1 "1:triangle - 2: square";
+  parameter Units.SI.Length L=12 "Shell length";
+  parameter Units.SI.Diameter Ds=1 "shell internal diameter";
+  parameter Units.SI.Diameter De=0.019 "tube external diameter";
+  parameter Units.SI.Distance dc=0.030 "Central distance of two tubes";
+  parameter Units.SI.Length B=1.2 "distance between two plates in the shell";
+  parameter Real rugosrel=0.0007 "Pipe relative roughness";
+  parameter Integer ntubes=500 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real dpfCorr=1.00
+    "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Real hcCorr=1.00
+    "Corrective term for the heat exchange coefficient (hc) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.Temperature T0[Ns]=fill(290, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)";
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true)";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
+  parameter Integer option_temperature=1
+    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
+  parameter Boolean continuous_flow_reversal=true
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Units.SI.Area As=B*Ds*dt/dc
+    "maximum cross sectional area of flow in shell";
+  parameter Units.SI.Area A=pi*Ds^2/4 - ntubes*pi*De^2/4
+    "Liquid cross sectional in shell";
+
+protected
+  parameter Integer Nb = integer(floor(L/B));
+  parameter Units.SI.Distance dt=dc - De "distance between two tubes";
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+  parameter Integer N=Ns + 1
+    "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Diameter Deq=if (option_arrangement == 1) then (3.464*dc^2
+       - pi*De^2)/(pi*De) else if (option_arrangement == 2) then (4*dc^2 - pi*
+      De^2)/(pi*De) else De
+    "equivalent diameter of triangle arrangement between tubes";
+  parameter Units.SI.Area dSi=pi*De*ntubes*dx1
+    "Internal heat exchange area for a node";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boudary of node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the water side for node i";
+  Units.SI.Power W1t "Total power exchanged on the water side";
+  Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal=
+       fill(200, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Fluid Reynolds number in thermal node i";
+  Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Fluid Reynolds number in hydraulic node i";
+  Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i";
+  Units.SI.ThermalConductivity k[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Fluid thermal conductivity in node i";
+  Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i";
+  Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Fluid dynamic viscosity in hydraulic node i";
+  Units.SI.SpecificHeatCapacity cp[N - 1](start=fill(4000, N - 1), nominal=fill(
+        4000, N - 1)) "Fluid specific heat capacity";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i";
+  Units.SI.Diameter Deq1;
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[
+                                                              N - 1]
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
+                                                              2]
+    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[
+                                                              N]
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat[
+                                                        N - 1]
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat[
+                                                        N - 1]
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+public
+  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
+           {{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+initial equation
+  if steady_state then
+    for i in 2:N loop
+      der(h[i]) = 0;
+    end for;
+  else
+    if (option_temperature == 1) then
+      for i in 2:N loop
+        h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(
+          P[i],
+          T0[i - 1],
+          mode);
+      end for;
+    elseif (option_temperature == 2) then
+      for i in 2:N loop
+        h[i] = h0[i - 1];
+      end for;
+    else
+      assert(false, "DynamicOnePhaseFlowPipe: incorrect option");
+    end if;
+  end if;
+
+  if dynamic_mass_balance then
+    for i in 2:N loop
+      der(P[i]) = 0;
+    end for;
+  end if;
+
+  if inertia then
+    if dynamic_mass_balance then
+      for i in 1:N loop
+        der(Q[i]) = 0;
+      end for;
+    else
+      der(Q[1]) = 0;
+    end if;
+  end if;
+
+equation
+
+  /* Wall temperature */
+  Tp = CTh.T;
+  CTh.W = dW1;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol;
+  h[N + 1] = C2.h_vol;
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+    if dynamic_mass_balance then
+      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
+    else
+      0 = Q[i] - Q[i + 1];
+    end if;
+
+    /* Energy balance equation */
+    if dynamic_energy_balance then
+      if simplified_dynamic_energy_balance then
+        A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+      else
+        A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+      end if;
+    else
+      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+    end if;
+
+    /* Heat transfer at the wall */
+    dW1[i] = hc[i]*dSi*(Tp[i] - T1[i]);
+
+    /* Fluid thermodynamic properties */
+    pro1[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[i + 1], h[i + 1], mode);
+
+    rho1[i] = pro1[i].d;
+    T1[i] = pro1[i].T;
+
+    (lsat[i],vsat[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P[i + 1]);
+
+    cp[i] = pro1[i].cp;
+
+    mu1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho1[i], T1[i]);
+    k[i] = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho1[i], T1[i], P[i + 1]));
+
+    /* Heat exchange coefficient (using the Dittus-Boelter correlation) */
+    Pr[i] = mu1[i]*cp[i]/k[i];
+    Re1[i] = noEvent(abs(De*(Q[i] + Q[i + 1])/(2*As*mu1[i])));
+
+    hc[i] = hcCorr*(noEvent(if (Re1[i] < 2000) then 0.5*(k[i]/De)*Re1[i]^0.507*Pr[i]^0.33 else if ((Re1[i] > 2000) and (Re1[i] < 1e6)) then 0.36 * (k[i]/De) *Re1[i]^0.55*Pr[i]^0.33 else 0.023*k[i]/De*Re1[i]^0.8*Pr[i]^0.4));
+    //hc[i] = noEvent(if ((Re1[i] > 1.e-6) and (Pr[i] > 1.e-6)) then hcCorr*0.023*k[i]/D*Re1[i]^0.8*Pr[i]^0.4 else 0);
+
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
+        hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*Modelica.Math.sin(pi*Q[i]/2/Qeps) + h[i + 1] + h[i]));
+    else
+      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
+    end if;
+
+    /* Momentum balance equation */
+    if inertia then
+      1/As*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
+    else
+      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+    end if;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/As^2;
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Fluid thermodynamic properties */
+    pro2[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P[i] + P[i + 1])/2,hb[i], mode);
+
+    rho2[i] = pro2[i].d;
+    T2[i] = pro2[i].T;
+
+    mu2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho2[i], T2[i]);
+    //Re2[i] = noEvent(abs(Deq*Q[i]/(As*mu2[i])));
+    Re2[i] = noEvent(De*abs(Q[i])/(As*mu2[i]));
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    // Ds/dc is the number of rows
+    //dpf[i] = noEvent(dpfCorr*Ds/dc*lambda[i]*Q[i]*abs(Q[i])/(2*As^2*rho2[i]));
+   dpf[i] = noEvent(dpfCorr*Ds/dc*(Nb +1)*lambda[i]*Q[i]*abs(Q[i])/(2*As^2*rho2[i])/N);
+
+    //lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/De))^(-2) else 0.01;
+    lambda[i] = Modelica.Math.exp(0.576-0.19*Modelica.Math.log(Re2[i]));
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1], mode);
+  proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1], h[N + 1], mode);
+
+  rhoc[1] = proc[1].d;
+  rhoc[N + 1] = proc[2].d;
+
+  W1t = sum(dW1);
+
+  Deq1 = Deq;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}}),
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{60,10},{60,-30}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{20,30},{20,-10}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-20,10},{-20,-30}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-60,30},{-60,-10}},
+          color={0,0,0},
+          thickness=1),
+        Line(points={{-20,29},{-20,11}}, color={255,255,255}),
+        Line(points={{-60,-10},{-60,-30}}, color={255,255,255}),
+        Line(points={{20,-10},{20,-30}}, color={255,255,255}),
+        Line(points={{60,30},{60,11}}, color={255,255,255}),
+        Ellipse(
+          extent={{-31,-35},{31,-95}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{14,-47},{24,-57}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-24,-74},{-14,-84}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{14,-73},{24,-83}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-14,-60},{-4,-70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{6,-60},{16,-70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{18,-60},{28,-70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-12,-81},{-2,-91}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{2,-82},{12,-92}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{2,-39},{12,-49}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-29,-61},{-19,-71}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-5,-50},{5,-60}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-12,-39},{-2,-49}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-4,-69},{6,-79}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-24,-47},{-14,-57}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-60,30},{-60,-10}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-20,11},{-20,-29}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{20,30},{20,-10}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{60,10},{60,-30}},
+          color={0,0,0},
+          thickness=1),
+        Line(points={{-20,30},{-20,12}}, color={255,255,255}),
+        Line(points={{-60,-9},{-60,-29}}, color={255,255,255}),
+        Line(points={{20,-9},{20,-29}}, color={255,255,255}),
+        Line(points={{60,31},{60,12}}, color={255,255,255})}),
+    Window(
+      x=0.18,
+      y=0.05,
+      width=0.68,
+      height=0.94),
+    Documentation(info="<html>
+<h4>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 9.4.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+<p>Nota: component model name in title of Sect. 9.4.3.3 in book is incorrectly given as DynamicTwoPhaseFlowShell, instead of DynamicOnePhaseFlowShell</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela</li>
+<li>Jiahui Lu</li>
+</ul>
+</html>"));
+end DynamicOnePhaseFlowShell;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoFlowHeatExchangerShell.mo b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoFlowHeatExchangerShell.mo
index 757c247de511b0050d5d5d11afc7e12235e7d53b..aaee3eea7da92a965dfac40c6f421e6cf4ec1bd1 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoFlowHeatExchangerShell.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoFlowHeatExchangerShell.mo
@@ -1,127 +1,127 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model DynamicTwoFlowHeatExchangerShell
-  "Dynamic exchanger water/steam - water/steam"
-  import ThermoSysPro;
-
-  parameter ThermoSysPro.Units.SI.Length L=1 "Exchanger length";
-  parameter ThermoSysPro.Units.SI.Position z1=0 "Exchanger inlet altitude";
-  parameter ThermoSysPro.Units.SI.Position z2=0 "Exchanger outlet altitude";
-  parameter Integer Ns=1 "Numver of segments";
-  parameter ThermoSysPro.Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
-  parameter ThermoSysPro.Units.SI.Diameter Dext=0.11 "Pipe external diameter";
-  //parameter Modelica.SIunits.Diameter Ds = 0.39 "shell internal diameter";
-  //parameter Modelica.SIunits.Diameter De = 0.019 "tube external diameter";
-  parameter Integer Ntubes=1 "Number of pipes in parallel";
-
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowShell
-    DynamicOnePhaseFlowShell(
-    Ns=Ns,
-    L=L,
-    ntubes=Ntubes,
-    De=Dext) annotation (Placement(transformation(extent={{-10,30},{10,10}},
-          rotation=0)));
-  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
-    L=L,
-    D=Dint,
-    Ns=Ns,
-    ntubes=Ntubes)                       annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  DynamicOnePhaseFlowPipe OnePhaseFlowPipe(
-    L=L,
-    D=Dint,
-    ntubes=Ntubes,
-    Ns=Ns,
-    z1=z1,
-    z2=z2)
-    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
-            0)));
-  Connectors.FluidInletI Cfg1
-    annotation (Placement(transformation(extent={{-10,40},{10,60}}, rotation=0)));
-  Connectors.FluidOutletI Cfg2
-    annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=
-            0)));
-  Connectors.FluidInletI Cws1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutletI Cws2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-  connect(Cws2,OnePhaseFlowPipe. C2)
-                                   annotation (Line(
-      points={{100,0},{40,0},{40,-20},{10,-20}},
-      color={255,0,0},
-      thickness=0.5));
-  connect(Cws1,OnePhaseFlowPipe. C1)
-    annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}}, thickness=
-          0.5));
-  connect(ExchangerWall.WT1,OnePhaseFlowPipe. CTh)
-    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
-  connect(DynamicOnePhaseFlowShell.CTh, ExchangerWall.WT2)
-    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
-  connect(DynamicOnePhaseFlowShell.C2, Cfg2)
-                                            annotation (Line(
-      points={{10,20},{32,20},{32,-50},{0,-50}},
-      color={0,0,0},
-      thickness=1));
-  connect(DynamicOnePhaseFlowShell.C1, Cfg1)
-                                            annotation (Line(
-      points={{-10,20},{-26,20},{-26,50},{0,50}},
-      color={0,0,0},
-      thickness=1));
-  annotation (Diagram(graphics),
-                       Icon(graphics={
-        Rectangle(
-          extent={{-100,50},{100,-50}},
-          lineColor={0,0,255},
-          fillColor={85,85,255},
-          fillPattern=FillPattern.Backward),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={255,127,0}),
-        Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={0,0,0},
-          fillColor={192,192,192},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={85,170,255}),
-        Line(points={{-60,50},{-60,-50}}),
-        Line(points={{-20,50},{-20,-50}}),
-        Line(points={{20,50},{20,-50}}),
-        Line(points={{60,50},{60,-50}}),
-        Line(
-          points={{-60,-30},{-60,-50}},
-          color={255,255,255},
-          thickness=1),
-        Line(
-          points={{-20,50},{-20,30}},
-          color={255,255,255},
-          thickness=1),
-        Line(
-          points={{20,-30},{20,-50}},
-          color={255,255,255},
-          thickness=1),
-        Line(
-          points={{60,50},{60,30}},
-          color={255,255,255},
-          thickness=1)}),
-    Documentation(revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Guillaume Larrignon</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-"));
-end DynamicTwoFlowHeatExchangerShell;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model DynamicTwoFlowHeatExchangerShell
+  "Dynamic exchanger water/steam - water/steam"
+  import ThermoSysPro;
+
+  parameter ThermoSysPro.Units.SI.Length L=1 "Exchanger length";
+  parameter ThermoSysPro.Units.SI.Position z1=0 "Exchanger inlet altitude";
+  parameter ThermoSysPro.Units.SI.Position z2=0 "Exchanger outlet altitude";
+  parameter Integer Ns=1 "Numver of segments";
+  parameter ThermoSysPro.Units.SI.Diameter Dint=0.1 "Pipe internal diameter";
+  parameter ThermoSysPro.Units.SI.Diameter Dext=0.11 "Pipe external diameter";
+  //parameter Modelica.SIunits.Diameter Ds = 0.39 "shell internal diameter";
+  //parameter Modelica.SIunits.Diameter De = 0.019 "tube external diameter";
+  parameter Integer Ntubes=1 "Number of pipes in parallel";
+
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowShell
+    DynamicOnePhaseFlowShell(
+    Ns=Ns,
+    L=L,
+    ntubes=Ntubes,
+    De=Dext) annotation (Placement(transformation(extent={{-10,30},{10,10}},
+          rotation=0)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(
+    L=L,
+    D=Dint,
+    Ns=Ns,
+    ntubes=Ntubes)                       annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  DynamicOnePhaseFlowPipe OnePhaseFlowPipe(
+    L=L,
+    D=Dint,
+    ntubes=Ntubes,
+    Ns=Ns,
+    z1=z1,
+    z2=z2)
+    annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=
+            0)));
+  Connectors.FluidInletI Cfg1
+    annotation (Placement(transformation(extent={{-10,40},{10,60}}, rotation=0)));
+  Connectors.FluidOutletI Cfg2
+    annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=
+            0)));
+  Connectors.FluidInletI Cws1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutletI Cws2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+  connect(Cws2,OnePhaseFlowPipe. C2)
+                                   annotation (Line(
+      points={{100,0},{40,0},{40,-20},{10,-20}},
+      color={255,0,0},
+      thickness=0.5));
+  connect(Cws1,OnePhaseFlowPipe. C1)
+    annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}}, thickness=
+          0.5));
+  connect(ExchangerWall.WT1,OnePhaseFlowPipe. CTh)
+    annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0}));
+  connect(DynamicOnePhaseFlowShell.CTh, ExchangerWall.WT2)
+    annotation (Line(points={{0,17},{0,2}}, color={191,95,0}));
+  connect(DynamicOnePhaseFlowShell.C2, Cfg2)
+                                            annotation (Line(
+      points={{10,20},{32,20},{32,-50},{0,-50}},
+      color={0,0,0},
+      thickness=1));
+  connect(DynamicOnePhaseFlowShell.C1, Cfg1)
+                                            annotation (Line(
+      points={{-10,20},{-26,20},{-26,50},{0,50}},
+      color={0,0,0},
+      thickness=1));
+  annotation (Diagram(graphics),
+                       Icon(graphics={
+        Rectangle(
+          extent={{-100,50},{100,-50}},
+          lineColor={0,0,255},
+          fillColor={85,85,255},
+          fillPattern=FillPattern.Backward),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={255,127,0}),
+        Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={0,0,0},
+          fillColor={192,192,192},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={85,170,255}),
+        Line(points={{-60,50},{-60,-50}}),
+        Line(points={{-20,50},{-20,-50}}),
+        Line(points={{20,50},{20,-50}}),
+        Line(points={{60,50},{60,-50}}),
+        Line(
+          points={{-60,-30},{-60,-50}},
+          color={255,255,255},
+          thickness=1),
+        Line(
+          points={{-20,50},{-20,30}},
+          color={255,255,255},
+          thickness=1),
+        Line(
+          points={{20,-30},{20,-50}},
+          color={255,255,255},
+          thickness=1),
+        Line(
+          points={{60,50},{60,30}},
+          color={255,255,255},
+          thickness=1)}),
+    Documentation(revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Guillaume Larrignon</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+"));
+end DynamicTwoFlowHeatExchangerShell;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoPhaseFlowPipe.mo
index dce73769809bf701c159f9dc9e26e698d24fcbae..db184de86bf03612e49ce0183be32bf2e93ca17e 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoPhaseFlowPipe.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoPhaseFlowPipe.mo
@@ -1,484 +1,484 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model DynamicTwoPhaseFlowPipe "Dynamic two-phase flow pipe"
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
-  parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real rgliss=1 "Phase slip coefficient";
-  parameter Integer a=4200 "Phase pressure loss coefficient";
-  parameter Real dpfCorr=1.00
-    "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.Temperature T0[Ns]=fill(300, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)"
-    annotation (Evaluate=false);
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_mass_balance=true)";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
-  parameter Integer option_temperature=1
-    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
-  parameter Boolean continuous_flow_reversal=true
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-   parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-  parameter Integer N=Ns + 1
-    "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Internal cross sectional pipe area";
-  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-  parameter Units.SI.Area dSi=pi*Di*dx1
-    "Internal heat exchange area for a node";
-  parameter Real Mmol=18.015 "Water molar mass";
-  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
-    "Critical pressure";
-  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
-    "Critical temperature";
-  parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple
-    "Triple point pressure";
-  parameter Real xb1=0.0002 "Min value for vapor mass fraction";
-  parameter Real xb2=0.85 "Max value for vapor mass fraction";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill(
-        1.e5, N + 1)) "Bounded fluid pressure in node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boudary of node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the liquid side for node i";
-  Units.SI.Power W1t "Total power exchanged on the liquid side";
-  Units.SI.Temperature Tp1[N - 1](each start=500.0)
-    "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal=
-       fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1),
-      nominal=fill(200, N - 1))
-    "Fluid heat exchange coefficient in node i for the liquid fraction";
-  Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal=
-        fill(200, N - 1))
-    "Fluid heat exchange coefficient in node i for the vapor fraction";
-  Real S[N - 1] "Corrective terme correctif for nucleation removal";
-  Real E[N - 1] "Corrective term for hcl";
-  Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal=
-        fill(5.e5, N - 1))
-    "Fluid heat exchange coefficient for vaporization in thermal node i";
-  Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid";
-  Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Reynolds number in hydraulic node i for the liquid";
-  Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill(
-        5.e5, N - 1)) "Reynolds number in thermal node i for the vapor";
-  Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N))
-    "Reynolds number in hydraulic node i for the vapor";
-  Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i for the liquid";
-  Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i for the vapor";
-  Units.SI.ThermalConductivity kl[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Thermal conductivity in node i for the liquid";
-  Units.SI.ThermalConductivity kv[N - 1](start=fill(0.03, N - 1), nominal=fill(
-        0.03, N - 1)) "Thermal conductivity in node i for the vapor";
-  Real xv1[N - 1] "Vapor mass fraction in thermal node i";
-  Real xv2[N] "Vapor mass fraction in hydraulic node i";
-  Real xbs[N - 1] "Bounded upper value for the vapor mass fraction";
-  Real xbi[N - 1] "Bounded lower value for the vapor mass fraction";
-  Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid";
-  Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Dynamic viscosity in hydraulic node i for the liquid";
-  Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill(
-        1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor";
-  Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N))
-    "Dynamic viscosity in hydraulic node i for the vapor";
-  Units.SI.SpecificHeatCapacity cpl[N - 1](start=fill(4000, N - 1), nominal=
-        fill(4000, N - 1)) "Specific heat capacity for the liquid";
-  Units.SI.SpecificHeatCapacity cpv[N - 1](start=fill(2000, N - 1), nominal=
-        fill(2000, N - 1)) "Specific heat capacity for the vapor";
-  Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1))
-    "Boiling number";
-  Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Martinelli number";
-  Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill(
-        2.e6, N - 1)) "Specific enthalpy for vaporisation";
-  Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1))
-    "Fluid density in thermal node i for the liquid";
-  Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N))
-    "Fluid density in hydraulic node i for the liquid";
-  Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i for the vapor";
-  Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i for the vapor";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real khi[N] "Hydraulic pressure loss coefficient in node i";
-  Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i for the liquid";
-  Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i for the vapor)";
-  Real filo[N] "Pressure loss coefficient for two-phase flow";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[
-                                                              N - 1]
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
-                                                              2]
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[
-                                                              N]
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[
-                                                         N]
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[
-                                                         N]
-    annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[
-                                                         N - 1]
-    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[
-                                                         N - 1]
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-public
-  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
-    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
-  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
-           {{90,-10},{110,10}}, rotation=0)));
-initial equation
-  if steady_state then
-    for i in 2:N loop
-      der(h[i]) = 0;
-    end for;
-  else
-    if (option_temperature == 1) then
-      for i in 2:N loop
-        h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Pb[i], T0[i - 1], mode);
-      end for;
-    elseif (option_temperature == 2) then
-      for i in 2:N loop
-        h[i] = h0[i - 1];
-      end for;
-    else
-      assert(false, "DynamicTwoPhaseFlowPipe: incorrect option");
-    end if;
-  end if;
-
-  if dynamic_mass_balance then
-    for i in 2:N loop
-      der(P[i]) = 0;
-    end for;
-  end if;
-
-  if inertia then
-    if dynamic_mass_balance then
-      for i in 1:N loop
-        der(Q[i]) = 0;
-      end for;
-    else
-      der(Q[1]) = 0;
-    end if;
-  end if;
-
-equation
-
-  /* Wall temperature */
-  Tp1 = CTh.T;
-  CTh.W = dW1;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol;
-  h[N + 1] = C2.h_vol;
-
-  Pb[1] = max(min(P[1], pcrit - 1), ptriple);
-  Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple);
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-    if dynamic_mass_balance then
-      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
-    else
-      0 = Q[i] - Q[i + 1];
-    end if;
-
-    /* Energy balance equation */
-    if dynamic_mass_balance then
-      if simplified_dynamic_energy_balance then
-        A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-      else
-        A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-      end if;
-    else
-      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
-    end if;
-
-    /* Heat transfer at the wall */
-    dW1[i] = hi[i]*dSi*(Tp1[i] - T1[i]);
-
-    if noEvent(xv1[i] < xb1) then
-      hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]);
-      Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^
-        0.1;
-    elseif noEvent(xv1[i] > xb2) then
-      hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*
-        hcl[i] + S[i]*heb[i]);
-      Xtt[i] = ((1 - xb2)/xb2)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^
-        0.1;
-    else
-      hi[i] = E[i]*hcl[i] + S[i]*heb[i];
-      Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[
-        i])^0.1;
-    end if;
-
-    E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1;
-
-    Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4
-      *(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5);
-
-    S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0);
-
-    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-
-      Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)
-      ^0.67 else 100);
-/*
-    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-
-      Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(max(abs(dW1[i]),1)/dSi)
-      ^0.67 else 100);
-*/
-    hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl[
-      i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0);
-
-    hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv[
-      i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0);
-
-    Prl[i] = mul1[i]*cpl[i]/kl[i];
-    Prv[i] = muv1[i]*cpv[i]/kv[i];
-
-    Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i])));
-    Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i])));
-
-    /* Fluid thermodynamic properties */
-    pro1[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[i + 1], h[i + 1]);
-
-    rho1[i] = pro1[i].d;
-    T1[i] = pro1[i].T;
-    xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x;
-
-    (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P[i + 1]);
-
-    if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
-      xbs[i]   = 0;
-      xbi[i]   = 1;
-      rhol1[i] = pro1[i].d;
-      rhov1[i] = pro1[i].d;
-      cpl[i]   = pro1[i].cp;
-      cpv[i]   = pro1[i].cp;
-      lv[i]    = 1;
-    else
-      xbs[i]   = min(pro1[i].x, 0.90);
-      xbi[i]   = max(pro1[i].x, 0.10);
-      rhol1[i] = max(pro1[i].d, lsat1[i].rho);
-      rhov1[i] = min(pro1[i].d, vsat1[i].rho);
-      cpl[i]   = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp;
-      cpv[i]   = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp;
-      lv[i]    = vsat1[i].h - lsat1[i].h;
-    end if;
-
-    mul1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol1[i], T1[i]);
-    muv1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov1[i], T1[i]);
-
-    kl[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1]);
-    kv[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1]);
-
-    Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
-
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
-              hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*
-        Modelica.Math.sin(pi*Q[i]/2/Qeps) + h[i + 1] + h[i]));
-    else
-      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
-    end if;
-
-    /* Momentum balance equation */
-    if inertia then
-      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
-    else
-      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-    end if;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i]));
-
-    khi[i] = filo[i]*lambdal[i]*dx2/D;
-
-    lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-    lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-
-    Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i])));
-    Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i])));
-
-    if noEvent(xv2[i] < 0) then
-      filo[i] = 1;
-    else
-      if noEvent((xv2[i] >= 0) and (xv2[i] < 0.8)) then
-        filo[i] = 1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84);
-      else
-        filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)
-        /exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i];
-      end if;
-    end if;
-
-    /* Fluid thermodynamic properties */
-    pro2[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P[i] + P[i + 1])/2, hb[i]);
-
-    rho2[i] = pro2[i].d;
-    xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x;
-    T2[i] = pro2[i].T;
-
-    (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P((P[i] + P[i + 1])/2);
-
-    rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else max(pro2[i].d, lsat2[i].rho);
-    rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else min(pro2[i].d, vsat2[i].rho);
-
-    mul2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol2[i], T2[i]);
-    muv2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov2[i], T2[i]);
-
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1]);
-  proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1], h[N + 1]);
-
-  rhoc[1] = proc[1].d;
-  rhoc[N + 1] = proc[2].d;
-
-  W1t = sum(dW1);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,0},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,0}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{100,0}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,0},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,20},{-60,-20}}),
-        Line(points={{-20,20},{-20,-20}}),
-        Line(points={{20,20},{20,-20}}),
-        Line(points={{60,20},{60,-20}})}),
-    Window(
-      x=0.16,
-      y=0.07,
-      width=0.71,
-      height=0.85),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 9.4.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni</li>
-<li>Guillaume Larrignon </li>
-</ul>
-</html>"));
-end DynamicTwoPhaseFlowPipe;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model DynamicTwoPhaseFlowPipe "Dynamic two-phase flow pipe"
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.2 "Internal pipe diameter";
+  parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness";
+  parameter Integer ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real rgliss=1 "Phase slip coefficient";
+  parameter Integer a=4200 "Phase pressure loss coefficient";
+  parameter Real dpfCorr=1.00
+    "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.Temperature T0[Ns]=fill(300, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)"
+    annotation (Evaluate=false);
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_mass_balance=true)";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
+  parameter Integer option_temperature=1
+    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
+  parameter Boolean continuous_flow_reversal=true
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+   parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+  parameter Integer N=Ns + 1
+    "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Internal cross sectional pipe area";
+  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+  parameter Units.SI.Area dSi=pi*Di*dx1
+    "Internal heat exchange area for a node";
+  parameter Real Mmol=18.015 "Water molar mass";
+  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
+    "Critical pressure";
+  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
+    "Critical temperature";
+  parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple
+    "Triple point pressure";
+  parameter Real xb1=0.0002 "Min value for vapor mass fraction";
+  parameter Real xb2=0.85 "Max value for vapor mass fraction";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill(
+        1.e5, N + 1)) "Bounded fluid pressure in node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boudary of node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the liquid side for node i";
+  Units.SI.Power W1t "Total power exchanged on the liquid side";
+  Units.SI.Temperature Tp1[N - 1](each start=500.0)
+    "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal=
+       fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1),
+      nominal=fill(200, N - 1))
+    "Fluid heat exchange coefficient in node i for the liquid fraction";
+  Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal=
+        fill(200, N - 1))
+    "Fluid heat exchange coefficient in node i for the vapor fraction";
+  Real S[N - 1] "Corrective terme correctif for nucleation removal";
+  Real E[N - 1] "Corrective term for hcl";
+  Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal=
+        fill(5.e5, N - 1))
+    "Fluid heat exchange coefficient for vaporization in thermal node i";
+  Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid";
+  Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Reynolds number in hydraulic node i for the liquid";
+  Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill(
+        5.e5, N - 1)) "Reynolds number in thermal node i for the vapor";
+  Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N))
+    "Reynolds number in hydraulic node i for the vapor";
+  Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i for the liquid";
+  Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i for the vapor";
+  Units.SI.ThermalConductivity kl[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Thermal conductivity in node i for the liquid";
+  Units.SI.ThermalConductivity kv[N - 1](start=fill(0.03, N - 1), nominal=fill(
+        0.03, N - 1)) "Thermal conductivity in node i for the vapor";
+  Real xv1[N - 1] "Vapor mass fraction in thermal node i";
+  Real xv2[N] "Vapor mass fraction in hydraulic node i";
+  Real xbs[N - 1] "Bounded upper value for the vapor mass fraction";
+  Real xbi[N - 1] "Bounded lower value for the vapor mass fraction";
+  Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid";
+  Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Dynamic viscosity in hydraulic node i for the liquid";
+  Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill(
+        1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor";
+  Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N))
+    "Dynamic viscosity in hydraulic node i for the vapor";
+  Units.SI.SpecificHeatCapacity cpl[N - 1](start=fill(4000, N - 1), nominal=
+        fill(4000, N - 1)) "Specific heat capacity for the liquid";
+  Units.SI.SpecificHeatCapacity cpv[N - 1](start=fill(2000, N - 1), nominal=
+        fill(2000, N - 1)) "Specific heat capacity for the vapor";
+  Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1))
+    "Boiling number";
+  Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Martinelli number";
+  Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill(
+        2.e6, N - 1)) "Specific enthalpy for vaporisation";
+  Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1))
+    "Fluid density in thermal node i for the liquid";
+  Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N))
+    "Fluid density in hydraulic node i for the liquid";
+  Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i for the vapor";
+  Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i for the vapor";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real khi[N] "Hydraulic pressure loss coefficient in node i";
+  Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i for the liquid";
+  Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i for the vapor)";
+  Real filo[N] "Pressure loss coefficient for two-phase flow";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[
+                                                              N - 1]
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
+                                                              2]
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[
+                                                              N]
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[
+                                                         N]
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[
+                                                         N]
+    annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[
+                                                         N - 1]
+    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[
+                                                         N - 1]
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+public
+  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns]
+    annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
+  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
+           {{90,-10},{110,10}}, rotation=0)));
+initial equation
+  if steady_state then
+    for i in 2:N loop
+      der(h[i]) = 0;
+    end for;
+  else
+    if (option_temperature == 1) then
+      for i in 2:N loop
+        h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Pb[i], T0[i - 1], mode);
+      end for;
+    elseif (option_temperature == 2) then
+      for i in 2:N loop
+        h[i] = h0[i - 1];
+      end for;
+    else
+      assert(false, "DynamicTwoPhaseFlowPipe: incorrect option");
+    end if;
+  end if;
+
+  if dynamic_mass_balance then
+    for i in 2:N loop
+      der(P[i]) = 0;
+    end for;
+  end if;
+
+  if inertia then
+    if dynamic_mass_balance then
+      for i in 1:N loop
+        der(Q[i]) = 0;
+      end for;
+    else
+      der(Q[1]) = 0;
+    end if;
+  end if;
+
+equation
+
+  /* Wall temperature */
+  Tp1 = CTh.T;
+  CTh.W = dW1;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol;
+  h[N + 1] = C2.h_vol;
+
+  Pb[1] = max(min(P[1], pcrit - 1), ptriple);
+  Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple);
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+    if dynamic_mass_balance then
+      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
+    else
+      0 = Q[i] - Q[i + 1];
+    end if;
+
+    /* Energy balance equation */
+    if dynamic_mass_balance then
+      if simplified_dynamic_energy_balance then
+        A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+      else
+        A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+      end if;
+    else
+      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i];
+    end if;
+
+    /* Heat transfer at the wall */
+    dW1[i] = hi[i]*dSi*(Tp1[i] - T1[i]);
+
+    if noEvent(xv1[i] < xb1) then
+      hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]);
+      Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^
+        0.1;
+    elseif noEvent(xv1[i] > xb2) then
+      hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*
+        hcl[i] + S[i]*heb[i]);
+      Xtt[i] = ((1 - xb2)/xb2)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^
+        0.1;
+    else
+      hi[i] = E[i]*hcl[i] + S[i]*heb[i];
+      Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[
+        i])^0.1;
+    end if;
+
+    E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1;
+
+    Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4
+      *(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5);
+
+    S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0);
+
+    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-
+      Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)
+      ^0.67 else 100);
+/*
+    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-
+      Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(max(abs(dW1[i]),1)/dSi)
+      ^0.67 else 100);
+*/
+    hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl[
+      i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0);
+
+    hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv[
+      i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0);
+
+    Prl[i] = mul1[i]*cpl[i]/kl[i];
+    Prv[i] = muv1[i]*cpv[i]/kv[i];
+
+    Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i])));
+    Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i])));
+
+    /* Fluid thermodynamic properties */
+    pro1[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[i + 1], h[i + 1]);
+
+    rho1[i] = pro1[i].d;
+    T1[i] = pro1[i].T;
+    xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x;
+
+    (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P[i + 1]);
+
+    if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
+      xbs[i]   = 0;
+      xbi[i]   = 1;
+      rhol1[i] = pro1[i].d;
+      rhov1[i] = pro1[i].d;
+      cpl[i]   = pro1[i].cp;
+      cpv[i]   = pro1[i].cp;
+      lv[i]    = 1;
+    else
+      xbs[i]   = min(pro1[i].x, 0.90);
+      xbi[i]   = max(pro1[i].x, 0.10);
+      rhol1[i] = max(pro1[i].d, lsat1[i].rho);
+      rhov1[i] = min(pro1[i].d, vsat1[i].rho);
+      cpl[i]   = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp;
+      cpv[i]   = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp;
+      lv[i]    = vsat1[i].h - lsat1[i].h;
+    end if;
+
+    mul1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol1[i], T1[i]);
+    muv1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov1[i], T1[i]);
+
+    kl[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1]);
+    kv[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1]);
+
+    Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
+
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
+              hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*
+        Modelica.Math.sin(pi*Q[i]/2/Qeps) + h[i + 1] + h[i]));
+    else
+      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
+    end if;
+
+    /* Momentum balance equation */
+    if inertia then
+      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
+    else
+      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+    end if;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i]));
+
+    khi[i] = filo[i]*lambdal[i]*dx2/D;
+
+    lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+    lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+
+    Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i])));
+    Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i])));
+
+    if noEvent(xv2[i] < 0) then
+      filo[i] = 1;
+    else
+      if noEvent((xv2[i] >= 0) and (xv2[i] < 0.8)) then
+        filo[i] = 1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84);
+      else
+        filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)
+        /exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i];
+      end if;
+    end if;
+
+    /* Fluid thermodynamic properties */
+    pro2[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P[i] + P[i + 1])/2, hb[i]);
+
+    rho2[i] = pro2[i].d;
+    xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x;
+    T2[i] = pro2[i].T;
+
+    (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P((P[i] + P[i + 1])/2);
+
+    rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else max(pro2[i].d, lsat2[i].rho);
+    rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else min(pro2[i].d, vsat2[i].rho);
+
+    mul2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol2[i], T2[i]);
+    muv2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov2[i], T2[i]);
+
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1]);
+  proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1], h[N + 1]);
+
+  rhoc[1] = proc[1].d;
+  rhoc[N + 1] = proc[2].d;
+
+  W1t = sum(dW1);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,0},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,0}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{100,0}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,0},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,20},{-60,-20}}),
+        Line(points={{-20,20},{-20,-20}}),
+        Line(points={{20,20},{20,-20}}),
+        Line(points={{60,20},{60,-20}})}),
+    Window(
+      x=0.16,
+      y=0.07,
+      width=0.71,
+      height=0.85),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 9.4.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni</li>
+<li>Guillaume Larrignon </li>
+</ul>
+</html>"));
+end DynamicTwoPhaseFlowPipe;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoPhaseFlowRiser.mo
index da9ddb7c198f47b2f649debca59345b71ff3f5f0..15c212fa2c0a3bca7eb5f0cb4e7f8ae81986bef4 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoPhaseFlowRiser.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicTwoPhaseFlowRiser.mo
@@ -1,534 +1,534 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model DynamicTwoPhaseFlowRiser "Riser: Dynamic two-phase flow pipe"
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.02 "Hydraulic diameter";
-  parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
-  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
-  parameter Real rgliss=1 "Phase slip coefficient";
-  parameter Integer a=4200 "Phase pressure loss coefficient";
-  parameter Real dpfCorr=1.00
-    "Corrective term for the friction pressure loss (dpf) for each node";
-  parameter Real hcCorr=1.00
-    "Corrective term for the heat exchange coefficient (hc) for each node";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Units.SI.Temperature T0[Ns]=fill(300, Ns)
-    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)"
-    annotation (Evaluate=false);
-  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
-    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
-  parameter Boolean inertia=true
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean advection=false
-    "true: momentum balance equation with advection terme - false: without advection terme";
-  parameter Boolean dynamic_mass_balance=true
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean simplified_dynamic_energy_balance=true
-    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_mass_balance=true)";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
-  parameter Integer option_temperature=1
-    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
-  parameter Boolean continuous_flow_reversal=true
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-   parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-  parameter Integer N=Ns + 1
-    "Number of hydraulic nodes (= number of thermal nodes + 1)";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Internal cross sectional pipe area";
-  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
-  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
-  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
-  parameter Units.SI.Area dSi=pi*Di*dx1
-    "Internal heat exchange area for a node";
-  parameter Real Mmol=18.015 "Water molar mass";
-  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
-    "Critical pressure";
-  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
-    "Critical temperature";
-  parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple
-    "Triple point pressure";
-  parameter Real xb1=0.0002 "Min value for vapor mass fraction";
-  parameter Real xb2=0.85 "Max value for vapor mass fraction";
-
-public
-  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
-        N + 1)) "Fluid pressure in node i";
-  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
-    "Mass flow rate in node i";
-  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
-        N + 1)) "Fluid specific enthalpy in node i";
-  Units.SI.SpecificEnthalpy hb[N]
-    "Fluid specific enthalpy at the boundary of node i";
-  Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill(
-        1.e5, N + 1)) "Bounded fluid pressure in node i";
-  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i";
-  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i";
-  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
-    "Fluid density at the boudary of node i";
-  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the liquid side for node i";
-  Units.SI.Power dW2[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
-    "Thermal power exchanged on the liquid side for node i";
-  Units.SI.Power W1t "Total power exchanged on the liquid side";
-  Units.SI.Temperature Tp1[N - 1](each start=500.0)
-    "Wall temperature in node i";
-  Units.SI.Temperature Tp2[N - 1](each start=500.0)
-    "Wall temperature in node i";
-  Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal=
-       fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i";
-  Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1),
-      nominal=fill(200, N - 1))
-    "Fluid heat exchange coefficient in node i for the liquid fraction";
-  Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal=
-        fill(200, N - 1))
-    "Fluid heat exchange coefficient in node i for the vapor fraction";
-  Real S[N - 1] "Corrective terme correctif for nucleation removal";
-  Real E[N - 1] "Corrective term for hcl";
-  Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal=
-        fill(5.e5, N - 1))
-    "Fluid heat exchange coefficient for vaporization in thermal node i";
-  Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
-        0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid";
-  Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
-    "Reynolds number in hydraulic node i for the liquid";
-  Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill(
-        5.e5, N - 1)) "Reynolds number in thermal node i for the vapor";
-  Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N))
-    "Reynolds number in hydraulic node i for the vapor";
-  Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i for the liquid";
-  Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Fluid Prandtl number in node i for the vapor";
-  Units.SI.ThermalConductivity kl[N - 1](start=fill(0.6, N - 1), nominal=fill(
-        0.6, N - 1)) "Thermal conductivity in node i for the liquid";
-  Units.SI.ThermalConductivity kv[N - 1](start=fill(0.03, N - 1), nominal=fill(
-        0.03, N - 1)) "Thermal conductivity in node i for the vapor";
-  Real xv1[N - 1] "Vapor mass fraction in thermal node i";
-  Real xv2[N] "Vapor mass fraction in hydraulic node i";
-  Real xbs[N - 1] "Bounded upper value for the vapor mass fraction";
-  Real xbi[N - 1] "Bounded lower value for the vapor mass fraction";
-  Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
-        2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid";
-  Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
-    "Dynamic viscosity in hydraulic node i for the liquid";
-  Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill(
-        1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor";
-  Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N))
-    "Dynamic viscosity in hydraulic node i for the vapor";
-  Units.SI.SpecificHeatCapacity cpl[N - 1](start=fill(4000, N - 1), nominal=
-        fill(4000, N - 1)) "Specific heat capacity for the liquid";
-  Units.SI.SpecificHeatCapacity cpv[N - 1](start=fill(2000, N - 1), nominal=
-        fill(2000, N - 1)) "Specific heat capacity for the vapor";
-  Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1))
-    "Boiling number";
-  Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Martinelli number";
-  Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill(
-        2.e6, N - 1)) "Specific enthalpy for vaporisation";
-  Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1))
-    "Fluid density in thermal node i for the liquid";
-  Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N))
-    "Fluid density in hydraulic node i for the liquid";
-  Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
-    "Fluid density in thermal node i for the vapor";
-  Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N))
-    "Fluid density in hydraulic node i for the vapor";
-  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
-  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
-  ThermoSysPro.Units.SI.PressureDifference dpa[N]
-    "Advection term for the mass balance equation in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpf[N]
-    "Friction pressure loss in node i";
-  ThermoSysPro.Units.SI.PressureDifference dpg[N]
-    "Gravity pressure loss in node i";
-  Real khi[N] "Hydraulic pressure loss coefficient in node i";
-  Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i for the liquid";
-  Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N))
-    "Friction pressure loss coefficient in node i for the vapor)";
-  Real filo[N] "Pressure loss coefficient for two-phase flow";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[
-                                                              N - 1]
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
-                                                              2]
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[
-                                                              N]
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[
-                                                         N]
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[
-                                                         N]
-    annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[
-                                                         N - 1]
-    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[
-                                                         N - 1]
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-public
-  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
-           {{-110,0},{-90,20}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh1[Ns]
-    annotation (Placement(transformation(extent={{-10,60},{10,80}}, rotation=0)));
-  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
-           {{90,0},{110,20}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort CTh2[Ns]
-    annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=
-            0)));
-initial equation
-  if steady_state then
-    for i in 2:N loop
-      der(h[i]) = 0;
-    end for;
-  else
-    if (option_temperature == 1) then
-      for i in 2:N loop
-        h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Pb[i], T0[i - 1], mode);
-      end for;
-    elseif (option_temperature == 2) then
-      for i in 2:N loop
-        h[i] = h0[i - 1];
-      end for;
-    else
-      assert(false, "DynamicTwoPhaseFlowPipe: incorrect option");
-    end if;
-  end if;
-
-  if dynamic_mass_balance then
-    for i in 2:N loop
-      der(P[i]) = 0;
-    end for;
-  end if;
-
-  if inertia then
-    if dynamic_mass_balance then
-      for i in 1:N loop
-        der(Q[i]) = 0;
-      end for;
-    else
-      der(Q[1]) = 0;
-    end if;
-  end if;
-
-equation
-
-  /* Wall temperature */
-  Tp1 = CTh1.T;
-  CTh1.W = dW1;
-
-  Tp2 = CTh2.T;
-  CTh2.W = dW2;
-
-  /* Pipe boundaries */
-  P[1] = C1.P;
-  P[N + 1] = C2.P;
-
-  Q[1] = C1.Q;
-  Q[N] = C2.Q;
-
-  hb[1] = C1.h;
-  hb[N] = C2.h;
-
-  h[1] = C1.h_vol;
-  h[N + 1] = C2.h_vol;
-
-  Pb[1] = max(min(P[1], pcrit - 1), ptriple);
-  Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple);
-
-  /* Mass and energy balance equations (thermal nodes) */
-  for i in 1:N - 1 loop
-    /* Mass balance equation */
-    if dynamic_mass_balance then
-      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
-    else
-      0 = Q[i] - Q[i + 1];
-    end if;
-
-    /* Energy balance equation */
-    if dynamic_mass_balance then
-      if simplified_dynamic_energy_balance then
-        A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + dW2[i];
-      else
-        A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + dW2[i];
-      end if;
-    else
-      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + dW2[i];
-    end if;
-
-    /* Heat transfer at the wall */
-    dW1[i] = hcCorr*hi[i]*dSi*(Tp1[i] - T1[i]);
-    dW2[i] = hcCorr*hi[i]*dSi*(Tp2[i] - T1[i]);
-
-    //*** Calcul de la corrélation d'échange thermique
-    // Corrélation de Thom
-    //hi_1[i] =  max(1970*exp(P[i + 1]/43.5e5)*(Tp1[i] - Tsat[i]), 5000);
-    //hi_2[i] =  max(1970*exp(P[i + 1]/43.5e5)*(Tp2[i] - Tsat[i]), 5000);
-
-    if noEvent(xv1[i] < xb1) then
-      hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]);
-      Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^
-        0.1;
-    elseif noEvent(xv1[i] > xb2) then
-      hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*
-        hcl[i] + S[i]*heb[i]);
-      Xtt[i] = ((1 - xb2)/xb2)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^
-        0.1;
-    else
-      hi[i] = E[i]*hcl[i] + S[i]*heb[i];
-      Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[
-        i])^0.1;
-    end if;
-
-    E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1;
-
-    Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4
-      *(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5);
-
-    S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0);
-
-    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-
-      Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)
-      ^0.67 else 100);
-
-    hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl[
-      i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0);
-
-    hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv[
-      i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0);
-
-    Prl[i] = mul1[i]*cpl[i]/kl[i];
-    Prv[i] = muv1[i]*cpv[i]/kv[i];
-
-    Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i])));
-    Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i])));
-
-    /* Fluid thermodynamic properties */
-    pro1[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[i + 1], h[i + 1]);
-
-    rho1[i] = pro1[i].d;
-    T1[i] = pro1[i].T;
-    xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x;
-
-    (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P[i + 1]);
-
-    if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
-      xbs[i]   = 0;
-      xbi[i]   = 1;
-      rhol1[i] = pro1[i].d;
-      rhov1[i] = pro1[i].d;
-      cpl[i]   = pro1[i].cp;
-      cpv[i]   = pro1[i].cp;
-      lv[i]    = 1;
-    else
-      xbs[i]   = min(pro1[i].x, 0.90);
-      xbi[i]   = max(pro1[i].x, 0.10);
-      rhol1[i] = max(pro1[i].d, lsat1[i].rho);
-      rhov1[i] = min(pro1[i].d, vsat1[i].rho);
-      cpl[i]   = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp;
-      cpv[i]   = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp;
-      lv[i]    = vsat1[i].h - lsat1[i].h;
-    end if;
-
-    mul1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol1[i], T1[i]);
-    muv1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov1[i], T1[i]);
-
-    kl[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1]);
-    kv[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1]);
-
-    Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
-
-  end for;
-
-  /* Momentum balance equations (hydraulic nodes) */
-  for i in 1:N loop
-    /* Flow reversal */
-    if continuous_flow_reversal then
-      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
-              hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*
-        Modelica.Math.sin(pi*Q[i]/2/Qeps) + h[i + 1] + h[i]));
-    else
-      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
-    end if;
-
-    /* Momentum balance equation */
-    if inertia then
-      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
-    else
-      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
-    end if;
-
-    /* Advection term */
-    if advection then
-      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
-    else
-      dpa[i] = 0;
-    end if;
-
-    /* Gravity pressure losses */
-    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-
-    /* Friction pressure losses */
-    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i]));
-
-    khi[i] = filo[i]*lambdal[i]*dx2/D;
-
-    lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-    lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01;
-
-    Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i])));
-    Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i])));
-
-    if noEvent(xv2[i] < 0) then
-      filo[i] = 1;
-    else
-      if noEvent((xv2[i] >= 0) and (xv2[i] < 0.8)) then
-        filo[i] = 1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84);
-      else
-        filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)
-        /exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i];
-      end if;
-    end if;
-
-    /* Fluid thermodynamic properties */
-    pro2[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P[i] + P[i + 1])/2, hb[i]);
-
-    rho2[i] = pro2[i].d;
-    xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x;
-    T2[i] = pro2[i].T;
-
-    (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P((P[i] + P[i + 1])/2);
-
-    rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else max(pro2[i].d, lsat2[i].rho);
-    rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else min(pro2[i].d, vsat2[i].rho);
-
-    mul2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol2[i], T2[i]);
-    muv2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov2[i], T2[i]);
-
-  end for;
-
-  /* Fluid densities at the boundaries of the nodes */
-  for i in 2:N loop
-    rhoc[i] = rho1[i - 1];
-  end for;
-
-  proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1]);
-  proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1], h[N + 1]);
-
-  rhoc[1] = proc[1].d;
-  rhoc[N + 1] = proc[2].d;
-
-  W1t = sum(dW1);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,-20},{100,-40}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,0},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,0},{-60,-40}}),
-        Line(points={{-20,0},{-20,-40}}),
-        Line(points={{20,0},{20,-40}}),
-        Line(points={{60,0},{60,-40}}),
-        Rectangle(
-          extent={{-100,60},{100,40}},
-          lineColor={28,108,200},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,40},{100,20}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,0}},
-          lineColor={28,108,200},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,60},{-60,20}}),
-        Line(points={{-20,60},{-20,20}}),
-        Line(points={{20,60},{20,20}}),
-        Line(points={{60,60},{60,20}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,0},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,-20},{100,-40}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,0},{-60,-40}}),
-        Line(points={{-20,0},{-20,-40}}),
-        Line(points={{20,0},{20,-40}}),
-        Line(points={{60,0},{60,-40}}),
-        Rectangle(
-          extent={{-100,60},{100,40}},
-          lineColor={28,108,200},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,40},{100,20}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{100,0}},
-          lineColor={28,108,200},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-60,60},{-60,20}}),
-        Line(points={{-20,60},{-20,20}}),
-        Line(points={{20,60},{20,20}}),
-        Line(points={{60,60},{60,20}})}),
-    Window(
-      x=0.16,
-      y=0.07,
-      width=0.71,
-      height=0.85),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DynamicTwoPhaseFlowRiser;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model DynamicTwoPhaseFlowRiser "Riser: Dynamic two-phase flow pipe"
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.02 "Hydraulic diameter";
+  parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness";
+  parameter Integer ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Position z1=0 "Pipe inlet altitude";
+  parameter Units.SI.Position z2=0 "Pipe outlet altitude";
+  parameter Real rgliss=1 "Phase slip coefficient";
+  parameter Integer a=4200 "Phase pressure loss coefficient";
+  parameter Real dpfCorr=1.00
+    "Corrective term for the friction pressure loss (dpf) for each node";
+  parameter Real hcCorr=1.00
+    "Corrective term for the heat exchange coefficient (hc) for each node";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Units.SI.Temperature T0[Ns]=fill(300, Ns)
+    "Initial fluid temperature (active if steady_state = false and option_temperature = 1)"
+    annotation (Evaluate=false);
+  parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns)
+    "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)";
+  parameter Boolean inertia=true
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean advection=false
+    "true: momentum balance equation with advection terme - false: without advection terme";
+  parameter Boolean dynamic_mass_balance=true
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean simplified_dynamic_energy_balance=true
+    "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_mass_balance=true)";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)";
+  parameter Integer option_temperature=1
+    "1:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)";
+  parameter Boolean continuous_flow_reversal=true
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+   parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+  parameter Integer N=Ns + 1
+    "Number of hydraulic nodes (= number of thermal nodes + 1)";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Internal cross sectional pipe area";
+  parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter";
+  parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node";
+  parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node";
+  parameter Units.SI.Area dSi=pi*Di*dx1
+    "Internal heat exchange area for a node";
+  parameter Real Mmol=18.015 "Water molar mass";
+  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
+    "Critical pressure";
+  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
+    "Critical temperature";
+  parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple
+    "Triple point pressure";
+  parameter Real xb1=0.0002 "Min value for vapor mass fraction";
+  parameter Real xb2=0.85 "Max value for vapor mass fraction";
+
+public
+  Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5,
+        N + 1)) "Fluid pressure in node i";
+  Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N))
+    "Mass flow rate in node i";
+  Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6,
+        N + 1)) "Fluid specific enthalpy in node i";
+  Units.SI.SpecificEnthalpy hb[N]
+    "Fluid specific enthalpy at the boundary of node i";
+  Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill(
+        1.e5, N + 1)) "Bounded fluid pressure in node i";
+  Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i";
+  Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i";
+  Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1))
+    "Fluid density at the boudary of node i";
+  Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the liquid side for node i";
+  Units.SI.Power dW2[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1))
+    "Thermal power exchanged on the liquid side for node i";
+  Units.SI.Power W1t "Total power exchanged on the liquid side";
+  Units.SI.Temperature Tp1[N - 1](each start=500.0)
+    "Wall temperature in node i";
+  Units.SI.Temperature Tp2[N - 1](each start=500.0)
+    "Wall temperature in node i";
+  Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal=
+       fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i";
+  Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1),
+      nominal=fill(200, N - 1))
+    "Fluid heat exchange coefficient in node i for the liquid fraction";
+  Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal=
+        fill(200, N - 1))
+    "Fluid heat exchange coefficient in node i for the vapor fraction";
+  Real S[N - 1] "Corrective terme correctif for nucleation removal";
+  Real E[N - 1] "Corrective term for hcl";
+  Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal=
+        fill(5.e5, N - 1))
+    "Fluid heat exchange coefficient for vaporization in thermal node i";
+  Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill(
+        0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid";
+  Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N))
+    "Reynolds number in hydraulic node i for the liquid";
+  Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill(
+        5.e5, N - 1)) "Reynolds number in thermal node i for the vapor";
+  Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N))
+    "Reynolds number in hydraulic node i for the vapor";
+  Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i for the liquid";
+  Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Fluid Prandtl number in node i for the vapor";
+  Units.SI.ThermalConductivity kl[N - 1](start=fill(0.6, N - 1), nominal=fill(
+        0.6, N - 1)) "Thermal conductivity in node i for the liquid";
+  Units.SI.ThermalConductivity kv[N - 1](start=fill(0.03, N - 1), nominal=fill(
+        0.03, N - 1)) "Thermal conductivity in node i for the vapor";
+  Real xv1[N - 1] "Vapor mass fraction in thermal node i";
+  Real xv2[N] "Vapor mass fraction in hydraulic node i";
+  Real xbs[N - 1] "Bounded upper value for the vapor mass fraction";
+  Real xbi[N - 1] "Bounded lower value for the vapor mass fraction";
+  Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill(
+        2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid";
+  Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N))
+    "Dynamic viscosity in hydraulic node i for the liquid";
+  Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill(
+        1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor";
+  Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N))
+    "Dynamic viscosity in hydraulic node i for the vapor";
+  Units.SI.SpecificHeatCapacity cpl[N - 1](start=fill(4000, N - 1), nominal=
+        fill(4000, N - 1)) "Specific heat capacity for the liquid";
+  Units.SI.SpecificHeatCapacity cpv[N - 1](start=fill(2000, N - 1), nominal=
+        fill(2000, N - 1)) "Specific heat capacity for the vapor";
+  Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1))
+    "Boiling number";
+  Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Martinelli number";
+  Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill(
+        2.e6, N - 1)) "Specific enthalpy for vaporisation";
+  Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1))
+    "Fluid density in thermal node i for the liquid";
+  Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N))
+    "Fluid density in hydraulic node i for the liquid";
+  Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1))
+    "Fluid density in thermal node i for the vapor";
+  Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N))
+    "Fluid density in hydraulic node i for the vapor";
+  Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i";
+  Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i";
+  ThermoSysPro.Units.SI.PressureDifference dpa[N]
+    "Advection term for the mass balance equation in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpf[N]
+    "Friction pressure loss in node i";
+  ThermoSysPro.Units.SI.PressureDifference dpg[N]
+    "Gravity pressure loss in node i";
+  Real khi[N] "Hydraulic pressure loss coefficient in node i";
+  Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i for the liquid";
+  Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N))
+    "Friction pressure loss coefficient in node i for the vapor)";
+  Real filo[N] "Pressure loss coefficient for two-phase flow";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[
+                                                              N - 1]
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
+                                                              2]
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[
+                                                              N]
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[
+                                                         N]
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[
+                                                         N]
+    annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[
+                                                         N - 1]
+    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[
+                                                         N - 1]
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+public
+  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
+           {{-110,0},{-90,20}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh1[Ns]
+    annotation (Placement(transformation(extent={{-10,60},{10,80}}, rotation=0)));
+  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
+           {{90,0},{110,20}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort CTh2[Ns]
+    annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=
+            0)));
+initial equation
+  if steady_state then
+    for i in 2:N loop
+      der(h[i]) = 0;
+    end for;
+  else
+    if (option_temperature == 1) then
+      for i in 2:N loop
+        h[i] = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(Pb[i], T0[i - 1], mode);
+      end for;
+    elseif (option_temperature == 2) then
+      for i in 2:N loop
+        h[i] = h0[i - 1];
+      end for;
+    else
+      assert(false, "DynamicTwoPhaseFlowPipe: incorrect option");
+    end if;
+  end if;
+
+  if dynamic_mass_balance then
+    for i in 2:N loop
+      der(P[i]) = 0;
+    end for;
+  end if;
+
+  if inertia then
+    if dynamic_mass_balance then
+      for i in 1:N loop
+        der(Q[i]) = 0;
+      end for;
+    else
+      der(Q[1]) = 0;
+    end if;
+  end if;
+
+equation
+
+  /* Wall temperature */
+  Tp1 = CTh1.T;
+  CTh1.W = dW1;
+
+  Tp2 = CTh2.T;
+  CTh2.W = dW2;
+
+  /* Pipe boundaries */
+  P[1] = C1.P;
+  P[N + 1] = C2.P;
+
+  Q[1] = C1.Q;
+  Q[N] = C2.Q;
+
+  hb[1] = C1.h;
+  hb[N] = C2.h;
+
+  h[1] = C1.h_vol;
+  h[N + 1] = C2.h_vol;
+
+  Pb[1] = max(min(P[1], pcrit - 1), ptriple);
+  Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple);
+
+  /* Mass and energy balance equations (thermal nodes) */
+  for i in 1:N - 1 loop
+    /* Mass balance equation */
+    if dynamic_mass_balance then
+      A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = Q[i] - Q[i + 1];
+    else
+      0 = Q[i] - Q[i + 1];
+    end if;
+
+    /* Energy balance equation */
+    if dynamic_mass_balance then
+      if simplified_dynamic_energy_balance then
+        A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + dW2[i];
+      else
+        A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + dW2[i];
+      end if;
+    else
+      A*rho1[i]*der(h[i + 1])*dx1 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + dW2[i];
+    end if;
+
+    /* Heat transfer at the wall */
+    dW1[i] = hcCorr*hi[i]*dSi*(Tp1[i] - T1[i]);
+    dW2[i] = hcCorr*hi[i]*dSi*(Tp2[i] - T1[i]);
+
+    //*** Calcul de la corrélation d'échange thermique
+    // Corrélation de Thom
+    //hi_1[i] =  max(1970*exp(P[i + 1]/43.5e5)*(Tp1[i] - Tsat[i]), 5000);
+    //hi_2[i] =  max(1970*exp(P[i + 1]/43.5e5)*(Tp2[i] - Tsat[i]), 5000);
+
+    if noEvent(xv1[i] < xb1) then
+      hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]);
+      Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^
+        0.1;
+    elseif noEvent(xv1[i] > xb2) then
+      hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*
+        hcl[i] + S[i]*heb[i]);
+      Xtt[i] = ((1 - xb2)/xb2)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^
+        0.1;
+    else
+      hi[i] = E[i]*hcl[i] + S[i]*heb[i];
+      Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[
+        i])^0.1;
+    end if;
+
+    E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1;
+
+    Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4
+      *(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5);
+
+    S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0);
+
+    heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-
+      Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)
+      ^0.67 else 100);
+
+    hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl[
+      i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0);
+
+    hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv[
+      i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0);
+
+    Prl[i] = mul1[i]*cpl[i]/kl[i];
+    Prv[i] = muv1[i]*cpv[i]/kv[i];
+
+    Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i])));
+    Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i])));
+
+    /* Fluid thermodynamic properties */
+    pro1[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[i + 1], h[i + 1]);
+
+    rho1[i] = pro1[i].d;
+    T1[i] = pro1[i].T;
+    xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x;
+
+    (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P[i + 1]);
+
+    if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
+      xbs[i]   = 0;
+      xbi[i]   = 1;
+      rhol1[i] = pro1[i].d;
+      rhov1[i] = pro1[i].d;
+      cpl[i]   = pro1[i].cp;
+      cpv[i]   = pro1[i].cp;
+      lv[i]    = 1;
+    else
+      xbs[i]   = min(pro1[i].x, 0.90);
+      xbi[i]   = max(pro1[i].x, 0.10);
+      rhol1[i] = max(pro1[i].d, lsat1[i].rho);
+      rhov1[i] = min(pro1[i].d, vsat1[i].rho);
+      cpl[i]   = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp;
+      cpv[i]   = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp;
+      lv[i]    = vsat1[i].h - lsat1[i].h;
+    end if;
+
+    mul1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol1[i], T1[i]);
+    muv1[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov1[i], T1[i]);
+
+    kl[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1]);
+    kv[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1]);
+
+    Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
+
+  end for;
+
+  /* Momentum balance equations (hydraulic nodes) */
+  for i in 1:N loop
+    /* Flow reversal */
+    if continuous_flow_reversal then
+      0 = noEvent(if (Q[i] > Qeps) then hb[i] - h[i] else if (Q[i] < -Qeps) then
+              hb[i] - h[i + 1] else hb[i] - 0.5*((h[i] - h[i + 1])*
+        Modelica.Math.sin(pi*Q[i]/2/Qeps) + h[i + 1] + h[i]));
+    else
+      0 = if (Q[i] > 0) then hb[i] - h[i] else hb[i] - h[i + 1];
+    end if;
+
+    /* Momentum balance equation */
+    if inertia then
+      1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i];
+    else
+      P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0;
+    end if;
+
+    /* Advection term */
+    if advection then
+      dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2;
+    else
+      dpa[i] = 0;
+    end if;
+
+    /* Gravity pressure losses */
+    dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
+
+    /* Friction pressure losses */
+    dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i]));
+
+    khi[i] = filo[i]*lambdal[i]*dx2/D;
+
+    lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+    lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01;
+
+    Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i])));
+    Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i])));
+
+    if noEvent(xv2[i] < 0) then
+      filo[i] = 1;
+    else
+      if noEvent((xv2[i] >= 0) and (xv2[i] < 0.8)) then
+        filo[i] = 1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84);
+      else
+        filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)
+        /exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i];
+      end if;
+    end if;
+
+    /* Fluid thermodynamic properties */
+    pro2[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P[i] + P[i + 1])/2, hb[i]);
+
+    rho2[i] = pro2[i].d;
+    xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x;
+    T2[i] = pro2[i].T;
+
+    (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P((P[i] + P[i + 1])/2);
+
+    rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else max(pro2[i].d, lsat2[i].rho);
+    rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else min(pro2[i].d, vsat2[i].rho);
+
+    mul2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol2[i], T2[i]);
+    muv2[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhov2[i], T2[i]);
+
+  end for;
+
+  /* Fluid densities at the boundaries of the nodes */
+  for i in 2:N loop
+    rhoc[i] = rho1[i - 1];
+  end for;
+
+  proc[1] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[1], h[1]);
+  proc[2] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P[N + 1], h[N + 1]);
+
+  rhoc[1] = proc[1].d;
+  rhoc[N + 1] = proc[2].d;
+
+  W1t = sum(dW1);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,-20},{100,-40}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,0},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,0},{-60,-40}}),
+        Line(points={{-20,0},{-20,-40}}),
+        Line(points={{20,0},{20,-40}}),
+        Line(points={{60,0},{60,-40}}),
+        Rectangle(
+          extent={{-100,60},{100,40}},
+          lineColor={28,108,200},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,40},{100,20}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,0}},
+          lineColor={28,108,200},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,60},{-60,20}}),
+        Line(points={{-20,60},{-20,20}}),
+        Line(points={{20,60},{20,20}}),
+        Line(points={{60,60},{60,20}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,0},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,-20},{100,-40}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,0},{-60,-40}}),
+        Line(points={{-20,0},{-20,-40}}),
+        Line(points={{20,0},{20,-40}}),
+        Line(points={{60,0},{60,-40}}),
+        Rectangle(
+          extent={{-100,60},{100,40}},
+          lineColor={28,108,200},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,40},{100,20}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{100,0}},
+          lineColor={28,108,200},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-60,60},{-60,20}}),
+        Line(points={{-20,60},{-20,20}}),
+        Line(points={{20,60},{20,20}}),
+        Line(points={{60,60},{60,20}})}),
+    Window(
+      x=0.16,
+      y=0.07,
+      width=0.71,
+      height=0.85),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DynamicTwoPhaseFlowRiser;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterHeating.mo b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterHeating.mo
index 604ba3c5075d2b1e0d5ea5563648ac2a3e845128..1021f8d6ed3dd49e4f073074e631087e8b688b6c 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterHeating.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterHeating.mo
@@ -1,405 +1,405 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model DynamicWaterHeating "Dynamic water heater"
-  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
-  parameter Real Vf0=0.066
-    "Fraction of initial liquid volume in the Cavity (0 < Vf0 < 1)";
-  parameter Units.SI.Pressure P0c=1e5 "INitial pressure in the Cavity";
-  //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area";
-  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
-  parameter Units.SI.Length L1=12.5
-    " Length of drowned pipes in liquid (pipes 1)";
-  parameter Units.SI.Length L2=12.5 " Length of Pipe 2 (in steam)";
-  parameter Units.SI.Length L3=25 " Length of Pipe 3 (in steam)";
-  parameter Units.SI.Length Lc=2.5
-    "support plate spacing in cooling zone(Chicanes)";
-  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
-  parameter Units.SI.Thickness ec=2.e-3 " Thickness of the cooling pipes";
-  parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter";
-  parameter Units.SI.Length PasL=0.03
-    "Longitudinal step or Length bottom pipes triangular step";
-  parameter Units.SI.Length PasT=0.03 " Transverse step or pipes step";
-  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
-  parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe";
-  parameter Integer ntubes1=500
-    "Numbers of the pipes drowned in water  for pipes 1 (drowned pipes in liquid)";
-  parameter Integer ntubes2=500
-    "Numbers of the pipes immersed in steam = NbTub2, for pipes 2";
-  parameter Integer ntubes3=500
-    "Numbers of the pipes immersed in steam for pipes 3";
-  parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)";
-  parameter Units.SI.SpecificHeatCapacity cp=460
-    "Specific heat capacity of the metal of the cooling pipes";
-  parameter Units.SI.Density rho=7900
-    "Density of the metal of the cooling pipes";
-  parameter Units.SI.ThermalConductivity lambda=26
-    "Wall thermal conductivity of the cooling pipes";
-  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000
-  //  "Heat transfer coefficient between the vapor and the cooling pipes";
-  parameter Real DpfCorr= 1.00
-    "Corrective term for friction pressure loss (dpf) in node i";
-  parameter Real COP0v = 1.0
-    "Corrective term for Heat exchange coefficient or Fouling coefficient steam side";
-  parameter Real COP0l = 1
-    "Corrective term for Heat exchange coefficient or Fouling coefficient liquid side";
-
-  Volumes.TwoPhaseCavity WaterHeating(
-    Vf0=Vf0,
-    P0=P0c,
-    Ns=Ns,
-    L2=L2,
-    NbTub1=ntubes1,
-    NbTubV=ntubesV,
-    DIc=DIc,
-    R=Rv,
-    Dext=Dc + 2*ec,
-    COPv=COP0v,
-    COPl=COP0l,
-    Lc=Lc,
-    PasL=PasL,
-    PasT=PasT,
-    L1=L1,
-    L3=L3,
-    NbTub2=ntubes2,
-    NbTub3=ntubes3)
-    annotation (                        Placement(transformation(extent={{-100,
-            -100},{100,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
-    option_temperature=2,
-    advection=true,
-    mode=0,
-    continuous_flow_reversal=true,
-    D=Dc,
-    Ns=Ns*2,
-    dpfCorr=DpfCorr,
-    inertia=true,
-    L=L3,
-    ntubes=ntubes3,
-    Q(start=fill(300, Ns*2 + 1)),
-    P(start=fill(200e5, 2*Ns + 2)))
-    annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0)));
-  Connectors.FluidInletI C1vap "Vapor inlet"
-    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Connectors.FluidOutletI C2ex "Condensed water extraction outlet"
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Connectors.FluidInletI Ce1 "Cooling water inlet"
-    annotation (Placement(transformation(extent={{-110,-55},{-90,-35}},
-          rotation=0)));
-  Connectors.FluidOutletI Ce2 "Cooling water outlet"
-    annotation (Placement(transformation(extent={{-110,34},{-90,54}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
-    annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation=
-            0)));
-
-  Connectors.FluidInletI C1 "Extra water inlet"
-    annotation (Placement(transformation(extent={{-74,82},{-54,102}}, rotation=
-            0)));
-  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    Ns=Ns*2,
-    L=L3,
-    ntubes=ntubes3)
-    annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe pipe_1(
-    option_temperature=2,
-    advection=true,
-    mode=0,
-    continuous_flow_reversal=true,
-    D=Dc,
-    Ns=Ns,
-    ntubes=ntubes1,
-    dpfCorr=DpfCorr,
-    Q(start=fill(200, Ns + 1)),
-    L=L1,
-    P(start=fill(200e5, Ns + 2)))
-    annotation (Placement(transformation(extent={{-35,-77},{60,-43}}, rotation=
-            0)));
-  Thermal.HeatTransfer.HeatExchangerWall Wall_1(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    Ns=Ns,
-    ntubes=ntubes1,
-    L=L1)
-    annotation (Placement(transformation(extent={{-35,-69},{59,-21}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe pipe_2(
-    option_temperature=2,
-    advection=true,
-    mode=0,
-    continuous_flow_reversal=true,
-    D=Dc,
-    Ns=Ns,
-    dpfCorr=DpfCorr,
-    Q(start=fill(200, Ns + 1)),
-    inertia=true,
-    L=L2,
-    ntubes=ntubes2,
-    P(start=fill(200e5, Ns + 2)))
-    annotation (Placement(transformation(extent={{60,11},{-35,45}}, rotation=0)));
-
-  Thermal.HeatTransfer.HeatExchangerWall Wall_2(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    Ns=Ns,
-    L=L2,
-    ntubes=ntubes2)
-    annotation (Placement(transformation(extent={{-35,21},{59,69}}, rotation=0)));
-  Volumes.VolumeC volumeC(
-    mode=1,
-    h0=890e3,
-    dynamic_mass_balance=true)  annotation (Placement(transformation(extent={{
-            -56,35},{-74,53}}, rotation=0)));
-  Volumes.VolumeD volumeD(
-    mode=1,
-    h0=790e3,
-    dynamic_mass_balance=false)
-                   annotation (Placement(transformation(extent={{-74,-54},{-56,
-            -36}}, rotation=0)));
-  Volumes.VolumeD volumeD1(
-    mode=1,
-    h0=850e3,
-    dynamic_mass_balance=true)
-                   annotation (Placement(transformation(
-        origin={75,-33},
-        extent={{-9,-9},{9,9}},
-        rotation=90)));
-equation
-
-  if (cardinality(C1) == 1) then
-    C1.Q = 0;
-    C1.h = 1.e5;
-    C1.b = true;
-  end if;
-
-  connect(C1vap, WaterHeating.Cv)
-                                annotation (Line(points={{0,100},{0,73.3333},{
-          -0.571429,73.3333}}));
-  connect(WaterHeating.Cl, C2ex)
-                               annotation (Line(points={{-0.571429,-73.3333},{
-          -0.571429,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}}, color={0,0,255}));
-  connect(C1, WaterHeating.Ce)
-    annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-42.8571,73.3333}}));
-  connect(WaterHeating.yLevel, sortieReelle)
-    annotation (Line(points={{100,-30},{94,-30},{94,-76},{102,-76}}));
-  connect(WaterHeating.Cth2, Wall_2.WT2)
-    annotation (Line(points={{12.5714,61},{12.5714,55.4},{12,55.4},{12,49.8}},
-        color={191,95,0}));
-  connect(Wall_2.WT1, pipe_2.CTh) annotation (Line(points={{12,40.2},{12,33.1},
-          {12.5,33.1}}, color={191,95,0}));
-  connect(WaterHeating.Cth1, Wall_1.WT2)
-                                      annotation (Line(points={{12.5714,-31},{
-          12.5714,-35.5},{12,-35.5},{12,-40.2}}, color={191,95,0}));
-  connect(Wall_1.WT1, pipe_1.CTh) annotation (Line(points={{12,-49.8},{12,-54.4},
-          {12.5,-54.4},{12.5,-54.9}}, color={191,95,0}));
-  connect(WaterHeating.Cth3, Wall_3.WT2)
-                                      annotation (Line(points={{12.5714,12.6667},
-          {12.5714,8.33335},{13,8.33335},{13,4.8}}, color={191,95,0}));
-  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4},
-          {12.5,-10.4},{12.5,-11.9}}, color={191,95,0}));
-  connect(Ce1, volumeD.Ce)
-    annotation (Line(points={{-100,-45},{-74,-45}}, thickness=1));
-  connect(volumeD.Cs2, pipe_1.C1) annotation (Line(
-      points={{-65,-53.82},{-65,-60},{-35,-60}},
-      color={0,0,255},
-      thickness=1));
-  connect(pipe_3.C2, volumeC.Ce3) annotation (Line(
-      points={{60,-17},{70,-17},{70,20},{-65,20},{-65,35}},
-      color={95,95,95},
-      thickness=1));
-  connect(pipe_2.C2, volumeC.Ce1) annotation (Line(
-      points={{-35,28},{-46,28},{-46,44},{-56,44}},
-      color={0,0,255},
-      thickness=1));
-  connect(volumeD.Cs1, pipe_3.C1) annotation (Line(
-      points={{-65,-36},{-66,-36},{-66,-17},{-35,-17}},
-      color={95,95,95},
-      thickness=1));
-  connect(Ce2, volumeC.Cs) annotation (Line(
-      points={{-100,44},{-74,44}},
-      color={95,95,95},
-      thickness=1));
-  connect(volumeD1.Ce, pipe_1.C2) annotation (Line(
-      points={{75,-42},{68,-42},{68,-60},{60,-60}},
-      color={0,0,255},
-      thickness=1));
-  connect(volumeD1.Cs3, pipe_2.C1) annotation (Line(
-      points={{75,-24},{76,-24},{76,28},{60,28}},
-      color={0,0,255},
-      thickness=1));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-116,-56},{-90,-72}},
-          lineColor={0,0,255},
-          textString=
-               "IN"),
-        Text(
-          extent={{-110,67},{-86,53}},
-          lineColor={0,0,255},
-          textString=
-               "OUT"),
-        Text(
-          extent={{10,104},{38,89}},
-          lineColor={0,0,255},
-          textString=
-               "Steam")}),
-                       Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-100,0},{-74,-90}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{60,-8},{0,-14}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,14},{-74,8}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{60,14},{16,8}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{60,-90},{-100,-90}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{60,90},{-100,90}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-100,0},{76,0}},
-          color={0,0,255},
-          thickness=0.5),
-        Rectangle(
-          extent={{-74,-52},{60,-90}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,90},{-74,0}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-8},{-74,-14}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-30},{-74,-36}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-54},{-74,-60}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,36},{-74,30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,60},{-74,54}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{
-              94,-40},{84,-60},{70,-80},{60,-90},{60,90}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{66,14},{60,-14}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{70,36},{16,30}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{78,60},{16,54}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{74,-30},{16,-36}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}},
-          lineColor={255,170,170},
-          lineThickness=0.5,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-76},{72,-76}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0.5),
-        Rectangle(
-          extent={{74,36},{68,-36}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{82,60},{76,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{76,-54},{16,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-68},{78,-68}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0.5),
-        Line(
-          points={{-74,-58},{84,-58}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0.5)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 9.5.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>"));
-end DynamicWaterHeating;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model DynamicWaterHeating "Dynamic water heater"
+  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
+  parameter Real Vf0=0.066
+    "Fraction of initial liquid volume in the Cavity (0 < Vf0 < 1)";
+  parameter Units.SI.Pressure P0c=1e5 "INitial pressure in the Cavity";
+  //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area";
+  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
+  parameter Units.SI.Length L1=12.5
+    " Length of drowned pipes in liquid (pipes 1)";
+  parameter Units.SI.Length L2=12.5 " Length of Pipe 2 (in steam)";
+  parameter Units.SI.Length L3=25 " Length of Pipe 3 (in steam)";
+  parameter Units.SI.Length Lc=2.5
+    "support plate spacing in cooling zone(Chicanes)";
+  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
+  parameter Units.SI.Thickness ec=2.e-3 " Thickness of the cooling pipes";
+  parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter";
+  parameter Units.SI.Length PasL=0.03
+    "Longitudinal step or Length bottom pipes triangular step";
+  parameter Units.SI.Length PasT=0.03 " Transverse step or pipes step";
+  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
+  parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe";
+  parameter Integer ntubes1=500
+    "Numbers of the pipes drowned in water  for pipes 1 (drowned pipes in liquid)";
+  parameter Integer ntubes2=500
+    "Numbers of the pipes immersed in steam = NbTub2, for pipes 2";
+  parameter Integer ntubes3=500
+    "Numbers of the pipes immersed in steam for pipes 3";
+  parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)";
+  parameter Units.SI.SpecificHeatCapacity cp=460
+    "Specific heat capacity of the metal of the cooling pipes";
+  parameter Units.SI.Density rho=7900
+    "Density of the metal of the cooling pipes";
+  parameter Units.SI.ThermalConductivity lambda=26
+    "Wall thermal conductivity of the cooling pipes";
+  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000
+  //  "Heat transfer coefficient between the vapor and the cooling pipes";
+  parameter Real DpfCorr= 1.00
+    "Corrective term for friction pressure loss (dpf) in node i";
+  parameter Real COP0v = 1.0
+    "Corrective term for Heat exchange coefficient or Fouling coefficient steam side";
+  parameter Real COP0l = 1
+    "Corrective term for Heat exchange coefficient or Fouling coefficient liquid side";
+
+  Volumes.TwoPhaseCavity WaterHeating(
+    Vf0=Vf0,
+    P0=P0c,
+    Ns=Ns,
+    L2=L2,
+    NbTub1=ntubes1,
+    NbTubV=ntubesV,
+    DIc=DIc,
+    R=Rv,
+    Dext=Dc + 2*ec,
+    COPv=COP0v,
+    COPl=COP0l,
+    Lc=Lc,
+    PasL=PasL,
+    PasT=PasT,
+    L1=L1,
+    L3=L3,
+    NbTub2=ntubes2,
+    NbTub3=ntubes3)
+    annotation (                        Placement(transformation(extent={{-100,
+            -100},{100,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
+    option_temperature=2,
+    advection=true,
+    mode=0,
+    continuous_flow_reversal=true,
+    D=Dc,
+    Ns=Ns*2,
+    dpfCorr=DpfCorr,
+    inertia=true,
+    L=L3,
+    ntubes=ntubes3,
+    Q(start=fill(300, Ns*2 + 1)),
+    P(start=fill(200e5, 2*Ns + 2)))
+    annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0)));
+  Connectors.FluidInletI C1vap "Vapor inlet"
+    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Connectors.FluidOutletI C2ex "Condensed water extraction outlet"
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Connectors.FluidInletI Ce1 "Cooling water inlet"
+    annotation (Placement(transformation(extent={{-110,-55},{-90,-35}},
+          rotation=0)));
+  Connectors.FluidOutletI Ce2 "Cooling water outlet"
+    annotation (Placement(transformation(extent={{-110,34},{-90,54}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
+    annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation=
+            0)));
+
+  Connectors.FluidInletI C1 "Extra water inlet"
+    annotation (Placement(transformation(extent={{-74,82},{-54,102}}, rotation=
+            0)));
+  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    Ns=Ns*2,
+    L=L3,
+    ntubes=ntubes3)
+    annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe pipe_1(
+    option_temperature=2,
+    advection=true,
+    mode=0,
+    continuous_flow_reversal=true,
+    D=Dc,
+    Ns=Ns,
+    ntubes=ntubes1,
+    dpfCorr=DpfCorr,
+    Q(start=fill(200, Ns + 1)),
+    L=L1,
+    P(start=fill(200e5, Ns + 2)))
+    annotation (Placement(transformation(extent={{-35,-77},{60,-43}}, rotation=
+            0)));
+  Thermal.HeatTransfer.HeatExchangerWall Wall_1(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    Ns=Ns,
+    ntubes=ntubes1,
+    L=L1)
+    annotation (Placement(transformation(extent={{-35,-69},{59,-21}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe pipe_2(
+    option_temperature=2,
+    advection=true,
+    mode=0,
+    continuous_flow_reversal=true,
+    D=Dc,
+    Ns=Ns,
+    dpfCorr=DpfCorr,
+    Q(start=fill(200, Ns + 1)),
+    inertia=true,
+    L=L2,
+    ntubes=ntubes2,
+    P(start=fill(200e5, Ns + 2)))
+    annotation (Placement(transformation(extent={{60,11},{-35,45}}, rotation=0)));
+
+  Thermal.HeatTransfer.HeatExchangerWall Wall_2(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    Ns=Ns,
+    L=L2,
+    ntubes=ntubes2)
+    annotation (Placement(transformation(extent={{-35,21},{59,69}}, rotation=0)));
+  Volumes.VolumeC volumeC(
+    mode=1,
+    h0=890e3,
+    dynamic_mass_balance=true)  annotation (Placement(transformation(extent={{
+            -56,35},{-74,53}}, rotation=0)));
+  Volumes.VolumeD volumeD(
+    mode=1,
+    h0=790e3,
+    dynamic_mass_balance=false)
+                   annotation (Placement(transformation(extent={{-74,-54},{-56,
+            -36}}, rotation=0)));
+  Volumes.VolumeD volumeD1(
+    mode=1,
+    h0=850e3,
+    dynamic_mass_balance=true)
+                   annotation (Placement(transformation(
+        origin={75,-33},
+        extent={{-9,-9},{9,9}},
+        rotation=90)));
+equation
+
+  if (cardinality(C1) == 1) then
+    C1.Q = 0;
+    C1.h = 1.e5;
+    C1.b = true;
+  end if;
+
+  connect(C1vap, WaterHeating.Cv)
+                                annotation (Line(points={{0,100},{0,73.3333},{
+          -0.571429,73.3333}}));
+  connect(WaterHeating.Cl, C2ex)
+                               annotation (Line(points={{-0.571429,-73.3333},{
+          -0.571429,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}}, color={0,0,255}));
+  connect(C1, WaterHeating.Ce)
+    annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-42.8571,73.3333}}));
+  connect(WaterHeating.yLevel, sortieReelle)
+    annotation (Line(points={{100,-30},{94,-30},{94,-76},{102,-76}}));
+  connect(WaterHeating.Cth2, Wall_2.WT2)
+    annotation (Line(points={{12.5714,61},{12.5714,55.4},{12,55.4},{12,49.8}},
+        color={191,95,0}));
+  connect(Wall_2.WT1, pipe_2.CTh) annotation (Line(points={{12,40.2},{12,33.1},
+          {12.5,33.1}}, color={191,95,0}));
+  connect(WaterHeating.Cth1, Wall_1.WT2)
+                                      annotation (Line(points={{12.5714,-31},{
+          12.5714,-35.5},{12,-35.5},{12,-40.2}}, color={191,95,0}));
+  connect(Wall_1.WT1, pipe_1.CTh) annotation (Line(points={{12,-49.8},{12,-54.4},
+          {12.5,-54.4},{12.5,-54.9}}, color={191,95,0}));
+  connect(WaterHeating.Cth3, Wall_3.WT2)
+                                      annotation (Line(points={{12.5714,12.6667},
+          {12.5714,8.33335},{13,8.33335},{13,4.8}}, color={191,95,0}));
+  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4},
+          {12.5,-10.4},{12.5,-11.9}}, color={191,95,0}));
+  connect(Ce1, volumeD.Ce)
+    annotation (Line(points={{-100,-45},{-74,-45}}, thickness=1));
+  connect(volumeD.Cs2, pipe_1.C1) annotation (Line(
+      points={{-65,-53.82},{-65,-60},{-35,-60}},
+      color={0,0,255},
+      thickness=1));
+  connect(pipe_3.C2, volumeC.Ce3) annotation (Line(
+      points={{60,-17},{70,-17},{70,20},{-65,20},{-65,35}},
+      color={95,95,95},
+      thickness=1));
+  connect(pipe_2.C2, volumeC.Ce1) annotation (Line(
+      points={{-35,28},{-46,28},{-46,44},{-56,44}},
+      color={0,0,255},
+      thickness=1));
+  connect(volumeD.Cs1, pipe_3.C1) annotation (Line(
+      points={{-65,-36},{-66,-36},{-66,-17},{-35,-17}},
+      color={95,95,95},
+      thickness=1));
+  connect(Ce2, volumeC.Cs) annotation (Line(
+      points={{-100,44},{-74,44}},
+      color={95,95,95},
+      thickness=1));
+  connect(volumeD1.Ce, pipe_1.C2) annotation (Line(
+      points={{75,-42},{68,-42},{68,-60},{60,-60}},
+      color={0,0,255},
+      thickness=1));
+  connect(volumeD1.Cs3, pipe_2.C1) annotation (Line(
+      points={{75,-24},{76,-24},{76,28},{60,28}},
+      color={0,0,255},
+      thickness=1));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-116,-56},{-90,-72}},
+          lineColor={0,0,255},
+          textString=
+               "IN"),
+        Text(
+          extent={{-110,67},{-86,53}},
+          lineColor={0,0,255},
+          textString=
+               "OUT"),
+        Text(
+          extent={{10,104},{38,89}},
+          lineColor={0,0,255},
+          textString=
+               "Steam")}),
+                       Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-100,0},{-74,-90}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{60,-8},{0,-14}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,14},{-74,8}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{60,14},{16,8}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{60,-90},{-100,-90}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{60,90},{-100,90}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-100,0},{76,0}},
+          color={0,0,255},
+          thickness=0.5),
+        Rectangle(
+          extent={{-74,-52},{60,-90}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,90},{-74,0}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-8},{-74,-14}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-30},{-74,-36}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-54},{-74,-60}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,36},{-74,30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,60},{-74,54}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{
+              94,-40},{84,-60},{70,-80},{60,-90},{60,90}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{66,14},{60,-14}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{70,36},{16,30}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{78,60},{16,54}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{74,-30},{16,-36}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}},
+          lineColor={255,170,170},
+          lineThickness=0.5,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-76},{72,-76}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0.5),
+        Rectangle(
+          extent={{74,36},{68,-36}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{82,60},{76,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{76,-54},{16,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-68},{78,-68}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0.5),
+        Line(
+          points={{-74,-58},{84,-58}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0.5)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 9.5.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>"));
+end DynamicWaterHeating;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterHeatingOnePipe.mo b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterHeatingOnePipe.mo
index 4c55db58024462e5fd54849c170128822a7706b0..144524796921c2bbe0e334eba2f4b77d81608779 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterHeatingOnePipe.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterHeatingOnePipe.mo
@@ -1,300 +1,300 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model DynamicWaterHeatingOnePipe "Dynamic WaterHeating"
-  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
-  parameter Real Vf0=0.066
-    "Fraction of initial liquid volume in the Cavity (0 < Vf0 < 1)";
-  parameter Units.SI.Pressure P0c=1e5 "INitial pressure in the Cavity";
-  //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area";
-  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
-  parameter Units.SI.Length L1=12.5
-    " Length of drowned pipes in liquid (pipes 1)";
-  parameter Units.SI.Length L2=12.5 " Length of Pipe 2 (in steam)";
-  parameter Units.SI.Length L3=25 " Length of Pipe 3 (in steam)";
-  parameter Units.SI.Length Lc=2.5
-    "support plate spacing in cooling zone(Chicanes)";
-  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
-  parameter Units.SI.Thickness ec=2.e-3 " Thickness of the cooling pipes";
-  parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter";
-  parameter Units.SI.Length PasL=0.03
-    "Longitudianl step or Length bottom pipes triangular step";
-  parameter Units.SI.Length PasT=0.03 " Transverse step or pipes step";
-  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
-  parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe";
-  parameter Integer ntubes1=500
-    "Numbers of drowned pipes in liquid for pipes 1";
-  parameter Integer ntubes2=500
-    "Numbers of the pipes immersed in steam = NbTub2, for pipes 2";
-  parameter Integer ntubes3=500
-    "Numbers of the pipes immersed in steam, for pipe 3";
-  parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)";
-  parameter Units.SI.SpecificHeatCapacity cp=460
-    "Specific heat capacity of the metal of the cooling pipes";
-  parameter Units.SI.Density rho=7900
-    "Density of the metal of the cooling pipes";
-  parameter Units.SI.ThermalConductivity lambda=26
-    "Wall thermal conductivity of the cooling pipes";
-  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000
-  //  "Heat transfer coefficient between the vapor and the cooling pipes";
-  parameter Real DpfCorr= 1.00
-    "Corrective terme for friction pressure loss (dpf) in node i";
-  parameter Real COP0v = 1.0
-    "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side";
-  parameter Real COP0l = 1
-    "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side";
-
-  Volumes.TwoPhaseCavity WaterHeating(
-    Vf0=Vf0,
-    P0=P0c,
-    Ns=Ns,
-    L2=L2,
-    NbTub1=ntubes1,
-    NbTubV=ntubesV,
-    DIc=DIc,
-    R=Rv,
-    Dext=Dc + 2*ec,
-    COPv=COP0v,
-    COPl=COP0l,
-    Lc=Lc,
-    PasL=PasL,
-    PasT=PasT,
-    L1=L1,
-    L3=L3,
-    NbTub2=ntubes2,
-    NbTub3=ntubes3)
-    annotation (                        Placement(transformation(extent={{-100,
-            -100},{100,100}}, rotation=0)));
-  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
-    option_temperature=2,
-    advection=true,
-    mode=0,
-    continuous_flow_reversal=true,
-    D=Dc,
-    Ns=Ns*2,
-    dpfCorr=DpfCorr,
-    inertia=true,
-    L=L3,
-    ntubes=ntubes3,
-    Q(start=fill(300, Ns*2 + 1)))
-    annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0)));
-  Connectors.FluidInletI C1vap "Vapor inlet"
-    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Connectors.FluidOutletI C2ex "Condensed water extraction outlet"
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Connectors.FluidInletI Ce1 "Cooling water inlet"
-    annotation (Placement(transformation(extent={{-110,-55},{-90,-35}},
-          rotation=0)));
-  Connectors.FluidOutletI Ce2 "Cooling water outlet"
-    annotation (Placement(transformation(extent={{-110,34},{-90,54}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
-    annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation=
-            0)));
-
-  Connectors.FluidInletI C1 "Extra water inlet"
-    annotation (Placement(transformation(extent={{-74,82},{-54,102}}, rotation=
-            0)));
-  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
-    D=Dc,
-    e=ec,
-    lambda=lambda,
-    cpw=cp,
-    rhow=rho,
-    Ns=Ns*2,
-    L=L3,
-    ntubes=ntubes3)
-    annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0)));
-
-equation
-  if (cardinality(C1) == 1) then
-    C1.Q = 0;
-    C1.h = 1.e5;
-    C1.b = true;
-  end if;
-
-  connect(C1vap, WaterHeating.Cv)
-                                annotation (Line(points={{0,100},{0,73.3333},{
-          -0.571429,73.3333}}));
-  connect(WaterHeating.Cl, C2ex)
-                               annotation (Line(points={{-0.571429,-73.3333},{
-          -0.571429,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}}, color={0,0,255}));
-  connect(C1, WaterHeating.Ce)
-    annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-42.8571,73.3333}}));
-  connect(WaterHeating.yLevel, sortieReelle)
-    annotation (Line(points={{100,-30},{94,-30},{94,-76},{102,-76}}));
-  connect(WaterHeating.Cth3, Wall_3.WT2)
-                                      annotation (Line(points={{12.5714,12.6667},
-          {12.5714,8.33335},{13,8.33335},{13,4.8}}, color={191,95,0}));
-  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4},
-          {12.5,-10.4},{12.5,-11.9}}, color={191,95,0}));
-  connect(pipe_3.C2, Ce2) annotation (Line(
-      points={{60,-17},{78,-17},{78,44},{-100,44}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(pipe_3.C1, Ce1) annotation (Line(points={{-35,-17},{-68,-17},{-68,-45},
-          {-100,-45}}, thickness=0.5));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-116,-56},{-90,-72}},
-          lineColor={0,0,255},
-          textString=
-               "IN"),
-        Text(
-          extent={{-110,67},{-86,53}},
-          lineColor={0,0,255},
-          textString=
-               "OUT"),
-        Text(
-          extent={{10,104},{38,89}},
-          lineColor={0,0,255},
-          textString=
-               "Steam")}),
-                       Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-100,0},{-74,-90}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{60,-8},{0,-14}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,14},{-74,8}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{60,14},{16,8}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{60,-90},{-100,-90}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{60,90},{-100,90}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-100,0},{76,0}},
-          color={0,0,255},
-          thickness=0.5),
-        Rectangle(
-          extent={{-74,-52},{60,-90}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,90},{-74,0}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-8},{-74,-14}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-30},{-74,-36}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,-54},{-74,-60}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,36},{-74,30}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{16,60},{-74,54}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{
-              94,-40},{84,-60},{70,-80},{60,-90},{60,90}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{66,14},{60,-14}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{70,36},{16,30}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{78,60},{16,54}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{74,-30},{16,-36}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}},
-          lineColor={255,170,170},
-          lineThickness=0.5,
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-76},{72,-76}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0.5),
-        Rectangle(
-          extent={{74,36},{68,-36}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{82,60},{76,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{76,-54},{16,-60}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-74,-68},{78,-68}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0.5),
-        Line(
-          points={{-74,-58},{84,-58}},
-          color={255,255,255},
-          pattern=LinePattern.Dash,
-          thickness=0.5)}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>",
-   info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2014</h4></p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>"));
-end DynamicWaterHeatingOnePipe;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model DynamicWaterHeatingOnePipe "Dynamic WaterHeating"
+  //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume";
+  parameter Real Vf0=0.066
+    "Fraction of initial liquid volume in the Cavity (0 < Vf0 < 1)";
+  parameter Units.SI.Pressure P0c=1e5 "INitial pressure in the Cavity";
+  //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area";
+  parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area";
+  parameter Units.SI.Length L1=12.5
+    " Length of drowned pipes in liquid (pipes 1)";
+  parameter Units.SI.Length L2=12.5 " Length of Pipe 2 (in steam)";
+  parameter Units.SI.Length L3=25 " Length of Pipe 3 (in steam)";
+  parameter Units.SI.Length Lc=2.5
+    "support plate spacing in cooling zone(Chicanes)";
+  parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes";
+  parameter Units.SI.Thickness ec=2.e-3 " Thickness of the cooling pipes";
+  parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter";
+  parameter Units.SI.Length PasL=0.03
+    "Longitudianl step or Length bottom pipes triangular step";
+  parameter Units.SI.Length PasT=0.03 " Transverse step or pipes step";
+  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
+  parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe";
+  parameter Integer ntubes1=500
+    "Numbers of drowned pipes in liquid for pipes 1";
+  parameter Integer ntubes2=500
+    "Numbers of the pipes immersed in steam = NbTub2, for pipes 2";
+  parameter Integer ntubes3=500
+    "Numbers of the pipes immersed in steam, for pipe 3";
+  parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)";
+  parameter Units.SI.SpecificHeatCapacity cp=460
+    "Specific heat capacity of the metal of the cooling pipes";
+  parameter Units.SI.Density rho=7900
+    "Density of the metal of the cooling pipes";
+  parameter Units.SI.ThermalConductivity lambda=26
+    "Wall thermal conductivity of the cooling pipes";
+  //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000
+  //  "Heat transfer coefficient between the vapor and the cooling pipes";
+  parameter Real DpfCorr= 1.00
+    "Corrective terme for friction pressure loss (dpf) in node i";
+  parameter Real COP0v = 1.0
+    "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side";
+  parameter Real COP0l = 1
+    "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side";
+
+  Volumes.TwoPhaseCavity WaterHeating(
+    Vf0=Vf0,
+    P0=P0c,
+    Ns=Ns,
+    L2=L2,
+    NbTub1=ntubes1,
+    NbTubV=ntubesV,
+    DIc=DIc,
+    R=Rv,
+    Dext=Dc + 2*ec,
+    COPv=COP0v,
+    COPl=COP0l,
+    Lc=Lc,
+    PasL=PasL,
+    PasT=PasT,
+    L1=L1,
+    L3=L3,
+    NbTub2=ntubes2,
+    NbTub3=ntubes3)
+    annotation (                        Placement(transformation(extent={{-100,
+            -100},{100,100}}, rotation=0)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
+    option_temperature=2,
+    advection=true,
+    mode=0,
+    continuous_flow_reversal=true,
+    D=Dc,
+    Ns=Ns*2,
+    dpfCorr=DpfCorr,
+    inertia=true,
+    L=L3,
+    ntubes=ntubes3,
+    Q(start=fill(300, Ns*2 + 1)))
+    annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0)));
+  Connectors.FluidInletI C1vap "Vapor inlet"
+    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Connectors.FluidOutletI C2ex "Condensed water extraction outlet"
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Connectors.FluidInletI Ce1 "Cooling water inlet"
+    annotation (Placement(transformation(extent={{-110,-55},{-90,-35}},
+          rotation=0)));
+  Connectors.FluidOutletI Ce2 "Cooling water outlet"
+    annotation (Placement(transformation(extent={{-110,34},{-90,54}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle
+    annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation=
+            0)));
+
+  Connectors.FluidInletI C1 "Extra water inlet"
+    annotation (Placement(transformation(extent={{-74,82},{-54,102}}, rotation=
+            0)));
+  Thermal.HeatTransfer.HeatExchangerWall Wall_3(
+    D=Dc,
+    e=ec,
+    lambda=lambda,
+    cpw=cp,
+    rhow=rho,
+    Ns=Ns*2,
+    L=L3,
+    ntubes=ntubes3)
+    annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0)));
+
+equation
+  if (cardinality(C1) == 1) then
+    C1.Q = 0;
+    C1.h = 1.e5;
+    C1.b = true;
+  end if;
+
+  connect(C1vap, WaterHeating.Cv)
+                                annotation (Line(points={{0,100},{0,73.3333},{
+          -0.571429,73.3333}}));
+  connect(WaterHeating.Cl, C2ex)
+                               annotation (Line(points={{-0.571429,-73.3333},{
+          -0.571429,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}}, color={0,0,255}));
+  connect(C1, WaterHeating.Ce)
+    annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-42.8571,73.3333}}));
+  connect(WaterHeating.yLevel, sortieReelle)
+    annotation (Line(points={{100,-30},{94,-30},{94,-76},{102,-76}}));
+  connect(WaterHeating.Cth3, Wall_3.WT2)
+                                      annotation (Line(points={{12.5714,12.6667},
+          {12.5714,8.33335},{13,8.33335},{13,4.8}}, color={191,95,0}));
+  connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4},
+          {12.5,-10.4},{12.5,-11.9}}, color={191,95,0}));
+  connect(pipe_3.C2, Ce2) annotation (Line(
+      points={{60,-17},{78,-17},{78,44},{-100,44}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(pipe_3.C1, Ce1) annotation (Line(points={{-35,-17},{-68,-17},{-68,-45},
+          {-100,-45}}, thickness=0.5));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-116,-56},{-90,-72}},
+          lineColor={0,0,255},
+          textString=
+               "IN"),
+        Text(
+          extent={{-110,67},{-86,53}},
+          lineColor={0,0,255},
+          textString=
+               "OUT"),
+        Text(
+          extent={{10,104},{38,89}},
+          lineColor={0,0,255},
+          textString=
+               "Steam")}),
+                       Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-100,0},{-74,-90}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{60,-8},{0,-14}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,14},{-74,8}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{60,14},{16,8}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{60,-90},{-100,-90}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{60,90},{-100,90}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-100,0},{76,0}},
+          color={0,0,255},
+          thickness=0.5),
+        Rectangle(
+          extent={{-74,-52},{60,-90}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,90},{-74,0}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-8},{-74,-14}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-30},{-74,-36}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,-54},{-74,-60}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,36},{-74,30}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{16,60},{-74,54}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{
+              94,-40},{84,-60},{70,-80},{60,-90},{60,90}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{66,14},{60,-14}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{70,36},{16,30}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{78,60},{16,54}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{74,-30},{16,-36}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}},
+          lineColor={255,170,170},
+          lineThickness=0.5,
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-76},{72,-76}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0.5),
+        Rectangle(
+          extent={{74,36},{68,-36}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{82,60},{76,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{76,-54},{16,-60}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-74,-68},{78,-68}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0.5),
+        Line(
+          points={{-74,-58},{84,-58}},
+          color={255,255,255},
+          pattern=LinePattern.Dash,
+          thickness=0.5)}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>",
+   info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2014</h4></p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>"));
+end DynamicWaterHeatingOnePipe;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterWaterExchanger.mo b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterWaterExchanger.mo
index 9896ad6b54b38dbd61734b23113899a59270ad38..4d32a60faac11036d73afe4266cea333c5837dea 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterWaterExchanger.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/DynamicWaterWaterExchanger.mo
@@ -1,331 +1,331 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model DynamicWaterWaterExchanger "Dynamic plate heat exchanger"
-  parameter Units.SI.ThermalConductivity lambdam=15.0
-    "Metal thermal conductivity";
-  parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000
-    "Heat transfer coefficient for the hot side if not computed by the correlations";
-  parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000
-    "Heat transfer coefficient for the cold side if not computed by the correlations";
-  parameter Real p_Kc=100
-    "Pressure loss coefficient for the hot side if not computed by the correlations";
-  parameter Real p_Kf=100
-    "Pressure loss coefficient for the cold side if not computed by the correlations";
-  parameter Units.SI.Volume Vc=1 "Hot side volume";
-  parameter Units.SI.Volume Vf=1 "Cold side volume";
-  parameter Units.SI.Thickness emetal=0.0006 "Wall thickness";
-  parameter Units.SI.Area Sp=2 "Plate area";
-  parameter Real nbp=499 "Number of plates";
-  parameter Real c1=1.12647 "Correction coefficient";
-  parameter Integer N=10 "Number of segments";
-  parameter Boolean steady_state=true "true: start from steady state";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot fluid";
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold fluid";
-  parameter Integer modec=0
-    "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer modef=0
-    "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-  parameter Integer heat_exchange_correlation=1
-    "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations";
-  parameter Integer pressure_loss_correlation=1
-    "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations";
-
-public
-  Units.SI.Power dW[N] "Thermal power exchanged between the two sides";
-  ThermoSysPro.Units.SI.PressureDifference DPc[N]
-    "Pressure loss of the hot fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPf[N]
-    "Pressure loss of the cold fluid";
-  Units.SI.CoefficientOfHeatTransfer hc[N]
-    "Heat transfer coefficient of the hot fluid";
-  Units.SI.CoefficientOfHeatTransfer hf[N]
-    "Heat transfer coefficient of the cold fluid";
-  Units.SI.CoefficientOfHeatTransfer K[N] "Global heat transfer coefficient";
-  Units.SI.Area dS "Heat exchange surface";
-  Units.SI.Temperature Tec "Fluid temperature at the hot inlet";
-  Units.SI.Temperature Tsc "Fluid temperature at the hot outlet";
-  Units.SI.Temperature Tef "Fluid temperature at the cold inlet";
-  Units.SI.Temperature Tsf "Fluid temperature at the cold outlet";
-  Units.SI.AbsolutePressure Pcc[N + 1]
-    "Hot fluid pressure at the boundary of section i";
-  Units.SI.MassFlowRate Qcc[N + 1]
-    "Hot fluid mass flow rate at the boundary of section i";
-  Units.SI.SpecificEnthalpy Hcc[N + 1]
-    "Hot fluid specific enthalpy at the boundary of section i";
-  Units.SI.AbsolutePressure Pcf[N + 1]
-    "Cold fluid pressure at the boundary of section i";
-  Units.SI.MassFlowRate Qcf[N + 1]
-    "Cold fluid mass flow rate at the boundary of section i";
-  Units.SI.SpecificEnthalpy Hcf[N + 1]
-    "Cold fluid specific enthalpy at the boundary of section i";
-  Units.SI.MassFlowRate Qc[N](start=fill(500, N))
-    "Mass flow rate of the hot fluid";
-  Units.SI.MassFlowRate Qf[N](start=fill(500, N))
-    "Mass flow rate of the cold fluid";
-  Real qmc[N];
-  Real qmf[N];
-  Real quc[N];
-  Real quf[N];
-  Real M;
-  Units.SI.Density rhoc[N](start=fill(998, N)) "Hot fluid density";
-  Units.SI.Density rhof[N](start=fill(998, N)) "Cold fluid density";
-  Units.SI.DynamicViscosity muc[N](start=fill(1.e-3, N))
-    "Hot fluid dynamic viscosity";
-  Units.SI.DynamicViscosity muf[N](start=fill(1.e-3, N))
-    "Cold fluid dynamic viscosity";
-  Units.SI.ThermalConductivity lambdac[N](start=fill(0.602698, N))
-    "Hot fluid thermal conductivity";
-  Units.SI.ThermalConductivity lambdaf[N](start=fill(0.597928, N))
-    "Cold fluid thermal conductivity";
-  Units.SI.Temperature Tmc[N](start=fill(290, N))
-    "Hot fluid average temperature";
-  Units.SI.Temperature Tmf[N](start=fill(290, N))
-    "Cold fluid average temperature";
-  Units.SI.AbsolutePressure Pmc[N](start=fill(1.e5, N))
-    "Hot fluid average pressure";
-  Units.SI.AbsolutePressure Pmf[N](start=fill(1.e5, N))
-    "Cold fluid average pressure";
-  Units.SI.SpecificEnthalpy Hmc[N](start=fill(100000, N))
-    "Hot fluid average specific enthalpy";
-  Units.SI.SpecificEnthalpy Hmf[N](start=fill(100000, N))
-    "Cold fluid average specific enthalpy";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
-                                                              N]
-    "Propriétés du fluide chaud" annotation (Placement(transformation(extent={{
-            -60,-100},{-40,-80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prof[
-                                                              N]
-    "Propriétés du fluide froid" annotation (Placement(transformation(extent={{
-            -100,-100},{-80,-80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    "Propriétés du fluide chaud en entrée" annotation (Placement(transformation(
-          extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    "Propriétés du fluide chaud en sortie" annotation (Placement(transformation(
-          extent={{20,80},{40,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    "Propriétés du fluide froid en entrée"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    "Propriétés du fluide froid en sortie"
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-public
-  Connectors.FluidInlet Ec          annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-  Connectors.FluidInlet Ef          annotation (Placement(transformation(extent=
-           {{-60,-70},{-40,-50}}, rotation=0)));
-  Connectors.FluidOutlet Sf         annotation (Placement(transformation(extent=
-           {{40,-70},{60,-50}}, rotation=0)));
-  Connectors.FluidOutlet Sc         annotation (Placement(transformation(extent=
-           {{90,-10},{110,10}}, rotation=0)));
-initial equation
-  if steady_state then
-    for i in 1:N loop
-      der(Hmc[i]) = 0;
-      der(Hmf[i]) = 0;
-    end for;
-  else
-    for i in 1:N loop
-      Hmc[i] = if (Ec.Q >= 0) then Ec.h else Sc.h;
-      Hmf[i] = if (Ef.Q >= 0) then Ef.h else Sf.h;
-    end for;
-  end if;
-
-equation
-  Ec.P = Pcc[1];
-  Sc.P = Pcc[N + 1];
-  Ec.Q = Qcc[1];
-  Sc.Q = Qcc[N + 1];
-  Ec.h = Hcc[1];
-  Sc.h = Hcc[N + 1];
-
-  Ef.P = Pcf[N + 1];
-  Sf.P = Pcf[1];
-  Ef.Q = Qcf[N + 1];
-  Sf.Q = Qcf[1];
-  Ef.h = Hcf[N + 1];
-  Sf.h = Hcf[1];
-
-  /* Flow reversal */
-  0 = if (Ec.Q > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
-  0 = if (Ef.Q > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
-
-  /* Exchange area for the plate exchanger */
-  dS = (nbp - 2)*Sp/N;
-  M = (nbp - 1)/2;
-
-  for i in 1:N loop
-    /* Mass flow rates */
-    Qcc[i] = Qcc[i + 1];
-    Qcf[i] = Qcf[i + 1];
-
-    Qc[i] = Qcc[i];
-    Qf[i] = Qcf[i];
-
-    /* Pressure losses */
-    Pcc[i + 1] = if (Qc[i] > 0) then Pcc[i] - DPc[i]/N else Pcc[i] + DPc[i]/N;
-    Pcf[i + 1] = if (Qf[i] > 0) then Pcf[i] + DPf[i]/N else Pcf[i] - DPf[i]/N;
-
-    /* Heat transfer */
-    /* K = 1/(1/hc + 1/hf + emetal/lambdam) */
-    K[i] = hc[i]*hf[i]/(hc[i] + hf[i] + hc[i]*hf[i]*emetal/lambdam);
-    dW[i] = K[i]*dS*(Tmc[i] - Tmf[i]);
-
-    Vc/N*rhoc[i]*der(Hmc[i]) = Qcc[i]*Hcc[i] - Qcc[i + 1]*Hcc[i + 1] - dW[i];
-
-    Vf/N*rhof[i]*der(Hmf[i]) = -Qcf[i]*Hcf[i] + Qcf[i + 1]*Hcf[i + 1] + dW[i];
-
-    /* Heat trasnfer correlations */
-    qmc[i] = noEvent(abs(Qc[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muc[i])*M));
-    qmf[i] = noEvent(abs(Qf[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muf[i])*M));
-
-    if (heat_exchange_correlation == 0) then
-      hc[i] = p_hc;
-      hf[i] = p_hf;
-    elseif (heat_exchange_correlation == 1) then
-      hc[i] = noEvent(if (qmc[i] < 1.e-3) then 0 else 11.245*abs(qmc[i])^0.8*
-        abs(muc[i]*proc[i].cp/lambdac[i])^0.4*lambdac[i]);
-      hf[i] = noEvent(if (qmf[i] < 1.e-3) then 0 else 11.245*abs(qmf[i])^0.8*
-        abs(muf[i]*prof[i].cp/lambdaf[i])^0.4*lambdaf[i]);
-    else
-      hc[i] = 0;
-      hf[i] = 0;
-      assert(false,
-        "DynamicWaterWaterExchanger: incorrect heat exchange correlation number");
-    end if;
-
-    /* Pressure losses correlations */
-    quc[i] = noEvent(abs(Qc[i])/M);
-    quf[i] = noEvent(abs(Qf[i])/M);
-
-    if (pressure_loss_correlation == 0) then
-      DPc[i] = p_Kc*Qc[i]^2/rhoc[i];
-      DPf[i] = p_Kf*Qf[i]^2/rhof[i];
-    elseif (pressure_loss_correlation == 1) then
-      DPc[i] = noEvent(if (qmc[i] < 1.e-3) then 0 else c1*14423.2/rhoc[i]*abs(
-        qmc[i])^(-0.097)*quc[i]^2*(1472.47 + 1.54*(M - 1)/2 + 104.97*abs(qmc[i])
-        ^(-0.25)));
-      DPf[i] = noEvent(if (qmf[i] < 1.e-3) then 0 else 14423.2/rhof[i]*abs(qmf[
-        i])^(-0.097)*quf[i]^2*(1472.47 + 1.54*(M - 1)/2 + 104.97*abs(qmf[i])^(-0.25)));
-    else
-      DPc[i] = 0;
-      DPf[i] = 0;
-      assert(false,
-        "DynamicWaterWaterExchanger: incorrect pressure loss correlation number");
-    end if;
-
-    /* Fluid thermodynamic properties */
-    Pmc[i] = (Pcc[i] + Pcc[i + 1])/2;
-    Pmf[i] = (Pcf[i] + Pcf[i + 1])/2;
-    Hmc[i] = (Hcc[i] + Hcc[i + 1])/2;
-    Hmf[i] = (Hcf[i] + Hcf[i + 1])/2;
-
-    proc[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmc[i], Hmc[i], modec);
-    prof[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmf[i], Hmf[i], modef);
-
-    Tmc[i] = proc[i].T;
-    Tmf[i] = prof[i].T;
-
-    if (p_rhoc > 0) then
-      rhoc[i] = p_rhoc;
-    else
-      rhoc[i] = proc[i].d;
-    end if;
-
-    if (p_rhof > 0) then
-      rhof[i] = p_rhof;
-    else
-      rhof[i] = prof[i].d;
-    end if;
-
-    muc[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhoc[i], Tmc[i]);
-    muf[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhof[i], Tmf[i]);
-
-    lambdac[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhoc[i], Tmc[i], Pmc[i]);
-    lambdaf[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhof[i], Tmf[i], Pmf[i]);
-  end for;
-
-  /* Fluid temperatures at the inlet and the outlet of the exchanger */
-  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, modec);
-  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, modec);
-
-  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, modef);
-  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, modef);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-  Tef = profe.T;
-  Tsf = profs.T;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,0},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,60},{-80,-60}}),
-        Line(points={{80,60},{80,-60}}),
-        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={0,
-              0,255}),
-        Line(
-          points={{-40,60},{-40,-60}},
-          color={0,0,255},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{0,60},{0,-60}},
-          color={0,0,255},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{40,60},{40,-60}},
-          color={0,0,255},
-          pattern=LinePattern.Dot)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,60},{-80,-60}}),
-        Line(points={{80,60},{80,-60}}),
-        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={0,
-              0,255}),
-        Line(
-          points={{-40,60},{-40,-60}},
-          color={0,0,255},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{0,60},{0,-60}},
-          color={0,0,255},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{40,60},{40,-60}},
-          color={0,0,255},
-          pattern=LinePattern.Dot)}),
-    Window(
-      x=0.04,
-      y=0.05,
-      width=0.93,
-      height=0.91),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</h4>
-<p><b>ThermoSysPro Version 4.0</h4>
-<p>This component model is documented in Sect. 9.6.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DynamicWaterWaterExchanger;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model DynamicWaterWaterExchanger "Dynamic plate heat exchanger"
+  parameter Units.SI.ThermalConductivity lambdam=15.0
+    "Metal thermal conductivity";
+  parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000
+    "Heat transfer coefficient for the hot side if not computed by the correlations";
+  parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000
+    "Heat transfer coefficient for the cold side if not computed by the correlations";
+  parameter Real p_Kc=100
+    "Pressure loss coefficient for the hot side if not computed by the correlations";
+  parameter Real p_Kf=100
+    "Pressure loss coefficient for the cold side if not computed by the correlations";
+  parameter Units.SI.Volume Vc=1 "Hot side volume";
+  parameter Units.SI.Volume Vf=1 "Cold side volume";
+  parameter Units.SI.Thickness emetal=0.0006 "Wall thickness";
+  parameter Units.SI.Area Sp=2 "Plate area";
+  parameter Real nbp=499 "Number of plates";
+  parameter Real c1=1.12647 "Correction coefficient";
+  parameter Integer N=10 "Number of segments";
+  parameter Boolean steady_state=true "true: start from steady state";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot fluid";
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold fluid";
+  parameter Integer modec=0
+    "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer modef=0
+    "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+  parameter Integer heat_exchange_correlation=1
+    "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations";
+  parameter Integer pressure_loss_correlation=1
+    "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations";
+
+public
+  Units.SI.Power dW[N] "Thermal power exchanged between the two sides";
+  ThermoSysPro.Units.SI.PressureDifference DPc[N]
+    "Pressure loss of the hot fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPf[N]
+    "Pressure loss of the cold fluid";
+  Units.SI.CoefficientOfHeatTransfer hc[N]
+    "Heat transfer coefficient of the hot fluid";
+  Units.SI.CoefficientOfHeatTransfer hf[N]
+    "Heat transfer coefficient of the cold fluid";
+  Units.SI.CoefficientOfHeatTransfer K[N] "Global heat transfer coefficient";
+  Units.SI.Area dS "Heat exchange surface";
+  Units.SI.Temperature Tec "Fluid temperature at the hot inlet";
+  Units.SI.Temperature Tsc "Fluid temperature at the hot outlet";
+  Units.SI.Temperature Tef "Fluid temperature at the cold inlet";
+  Units.SI.Temperature Tsf "Fluid temperature at the cold outlet";
+  Units.SI.AbsolutePressure Pcc[N + 1]
+    "Hot fluid pressure at the boundary of section i";
+  Units.SI.MassFlowRate Qcc[N + 1]
+    "Hot fluid mass flow rate at the boundary of section i";
+  Units.SI.SpecificEnthalpy Hcc[N + 1]
+    "Hot fluid specific enthalpy at the boundary of section i";
+  Units.SI.AbsolutePressure Pcf[N + 1]
+    "Cold fluid pressure at the boundary of section i";
+  Units.SI.MassFlowRate Qcf[N + 1]
+    "Cold fluid mass flow rate at the boundary of section i";
+  Units.SI.SpecificEnthalpy Hcf[N + 1]
+    "Cold fluid specific enthalpy at the boundary of section i";
+  Units.SI.MassFlowRate Qc[N](start=fill(500, N))
+    "Mass flow rate of the hot fluid";
+  Units.SI.MassFlowRate Qf[N](start=fill(500, N))
+    "Mass flow rate of the cold fluid";
+  Real qmc[N];
+  Real qmf[N];
+  Real quc[N];
+  Real quf[N];
+  Real M;
+  Units.SI.Density rhoc[N](start=fill(998, N)) "Hot fluid density";
+  Units.SI.Density rhof[N](start=fill(998, N)) "Cold fluid density";
+  Units.SI.DynamicViscosity muc[N](start=fill(1.e-3, N))
+    "Hot fluid dynamic viscosity";
+  Units.SI.DynamicViscosity muf[N](start=fill(1.e-3, N))
+    "Cold fluid dynamic viscosity";
+  Units.SI.ThermalConductivity lambdac[N](start=fill(0.602698, N))
+    "Hot fluid thermal conductivity";
+  Units.SI.ThermalConductivity lambdaf[N](start=fill(0.597928, N))
+    "Cold fluid thermal conductivity";
+  Units.SI.Temperature Tmc[N](start=fill(290, N))
+    "Hot fluid average temperature";
+  Units.SI.Temperature Tmf[N](start=fill(290, N))
+    "Cold fluid average temperature";
+  Units.SI.AbsolutePressure Pmc[N](start=fill(1.e5, N))
+    "Hot fluid average pressure";
+  Units.SI.AbsolutePressure Pmf[N](start=fill(1.e5, N))
+    "Cold fluid average pressure";
+  Units.SI.SpecificEnthalpy Hmc[N](start=fill(100000, N))
+    "Hot fluid average specific enthalpy";
+  Units.SI.SpecificEnthalpy Hmf[N](start=fill(100000, N))
+    "Cold fluid average specific enthalpy";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[
+                                                              N]
+    "Propriétés du fluide chaud" annotation (Placement(transformation(extent={{
+            -60,-100},{-40,-80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prof[
+                                                              N]
+    "Propriétés du fluide froid" annotation (Placement(transformation(extent={{
+            -100,-100},{-80,-80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    "Propriétés du fluide chaud en entrée" annotation (Placement(transformation(
+          extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    "Propriétés du fluide chaud en sortie" annotation (Placement(transformation(
+          extent={{20,80},{40,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    "Propriétés du fluide froid en entrée"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    "Propriétés du fluide froid en sortie"
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+public
+  Connectors.FluidInlet Ec          annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+  Connectors.FluidInlet Ef          annotation (Placement(transformation(extent=
+           {{-60,-70},{-40,-50}}, rotation=0)));
+  Connectors.FluidOutlet Sf         annotation (Placement(transformation(extent=
+           {{40,-70},{60,-50}}, rotation=0)));
+  Connectors.FluidOutlet Sc         annotation (Placement(transformation(extent=
+           {{90,-10},{110,10}}, rotation=0)));
+initial equation
+  if steady_state then
+    for i in 1:N loop
+      der(Hmc[i]) = 0;
+      der(Hmf[i]) = 0;
+    end for;
+  else
+    for i in 1:N loop
+      Hmc[i] = if (Ec.Q >= 0) then Ec.h else Sc.h;
+      Hmf[i] = if (Ef.Q >= 0) then Ef.h else Sf.h;
+    end for;
+  end if;
+
+equation
+  Ec.P = Pcc[1];
+  Sc.P = Pcc[N + 1];
+  Ec.Q = Qcc[1];
+  Sc.Q = Qcc[N + 1];
+  Ec.h = Hcc[1];
+  Sc.h = Hcc[N + 1];
+
+  Ef.P = Pcf[N + 1];
+  Sf.P = Pcf[1];
+  Ef.Q = Qcf[N + 1];
+  Sf.Q = Qcf[1];
+  Ef.h = Hcf[N + 1];
+  Sf.h = Hcf[1];
+
+  /* Flow reversal */
+  0 = if (Ec.Q > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
+  0 = if (Ef.Q > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
+
+  /* Exchange area for the plate exchanger */
+  dS = (nbp - 2)*Sp/N;
+  M = (nbp - 1)/2;
+
+  for i in 1:N loop
+    /* Mass flow rates */
+    Qcc[i] = Qcc[i + 1];
+    Qcf[i] = Qcf[i + 1];
+
+    Qc[i] = Qcc[i];
+    Qf[i] = Qcf[i];
+
+    /* Pressure losses */
+    Pcc[i + 1] = if (Qc[i] > 0) then Pcc[i] - DPc[i]/N else Pcc[i] + DPc[i]/N;
+    Pcf[i + 1] = if (Qf[i] > 0) then Pcf[i] + DPf[i]/N else Pcf[i] - DPf[i]/N;
+
+    /* Heat transfer */
+    /* K = 1/(1/hc + 1/hf + emetal/lambdam) */
+    K[i] = hc[i]*hf[i]/(hc[i] + hf[i] + hc[i]*hf[i]*emetal/lambdam);
+    dW[i] = K[i]*dS*(Tmc[i] - Tmf[i]);
+
+    Vc/N*rhoc[i]*der(Hmc[i]) = Qcc[i]*Hcc[i] - Qcc[i + 1]*Hcc[i + 1] - dW[i];
+
+    Vf/N*rhof[i]*der(Hmf[i]) = -Qcf[i]*Hcf[i] + Qcf[i + 1]*Hcf[i + 1] + dW[i];
+
+    /* Heat trasnfer correlations */
+    qmc[i] = noEvent(abs(Qc[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muc[i])*M));
+    qmf[i] = noEvent(abs(Qf[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muf[i])*M));
+
+    if (heat_exchange_correlation == 0) then
+      hc[i] = p_hc;
+      hf[i] = p_hf;
+    elseif (heat_exchange_correlation == 1) then
+      hc[i] = noEvent(if (qmc[i] < 1.e-3) then 0 else 11.245*abs(qmc[i])^0.8*
+        abs(muc[i]*proc[i].cp/lambdac[i])^0.4*lambdac[i]);
+      hf[i] = noEvent(if (qmf[i] < 1.e-3) then 0 else 11.245*abs(qmf[i])^0.8*
+        abs(muf[i]*prof[i].cp/lambdaf[i])^0.4*lambdaf[i]);
+    else
+      hc[i] = 0;
+      hf[i] = 0;
+      assert(false,
+        "DynamicWaterWaterExchanger: incorrect heat exchange correlation number");
+    end if;
+
+    /* Pressure losses correlations */
+    quc[i] = noEvent(abs(Qc[i])/M);
+    quf[i] = noEvent(abs(Qf[i])/M);
+
+    if (pressure_loss_correlation == 0) then
+      DPc[i] = p_Kc*Qc[i]^2/rhoc[i];
+      DPf[i] = p_Kf*Qf[i]^2/rhof[i];
+    elseif (pressure_loss_correlation == 1) then
+      DPc[i] = noEvent(if (qmc[i] < 1.e-3) then 0 else c1*14423.2/rhoc[i]*abs(
+        qmc[i])^(-0.097)*quc[i]^2*(1472.47 + 1.54*(M - 1)/2 + 104.97*abs(qmc[i])
+        ^(-0.25)));
+      DPf[i] = noEvent(if (qmf[i] < 1.e-3) then 0 else 14423.2/rhof[i]*abs(qmf[
+        i])^(-0.097)*quf[i]^2*(1472.47 + 1.54*(M - 1)/2 + 104.97*abs(qmf[i])^(-0.25)));
+    else
+      DPc[i] = 0;
+      DPf[i] = 0;
+      assert(false,
+        "DynamicWaterWaterExchanger: incorrect pressure loss correlation number");
+    end if;
+
+    /* Fluid thermodynamic properties */
+    Pmc[i] = (Pcc[i] + Pcc[i + 1])/2;
+    Pmf[i] = (Pcf[i] + Pcf[i + 1])/2;
+    Hmc[i] = (Hcc[i] + Hcc[i + 1])/2;
+    Hmf[i] = (Hcf[i] + Hcf[i + 1])/2;
+
+    proc[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmc[i], Hmc[i], modec);
+    prof[i] = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmf[i], Hmf[i], modef);
+
+    Tmc[i] = proc[i].T;
+    Tmf[i] = prof[i].T;
+
+    if (p_rhoc > 0) then
+      rhoc[i] = p_rhoc;
+    else
+      rhoc[i] = proc[i].d;
+    end if;
+
+    if (p_rhof > 0) then
+      rhof[i] = p_rhof;
+    else
+      rhof[i] = prof[i].d;
+    end if;
+
+    muc[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhoc[i], Tmc[i]);
+    muf[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhof[i], Tmf[i]);
+
+    lambdac[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhoc[i], Tmc[i], Pmc[i]);
+    lambdaf[i] = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhof[i], Tmf[i], Pmf[i]);
+  end for;
+
+  /* Fluid temperatures at the inlet and the outlet of the exchanger */
+  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, modec);
+  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, modec);
+
+  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, modef);
+  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, modef);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+  Tef = profe.T;
+  Tsf = profs.T;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,0},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,60},{-80,-60}}),
+        Line(points={{80,60},{80,-60}}),
+        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={0,
+              0,255}),
+        Line(
+          points={{-40,60},{-40,-60}},
+          color={0,0,255},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{0,60},{0,-60}},
+          color={0,0,255},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{40,60},{40,-60}},
+          color={0,0,255},
+          pattern=LinePattern.Dot)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,60},{-80,-60}}),
+        Line(points={{80,60},{80,-60}}),
+        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={0,
+              0,255}),
+        Line(
+          points={{-40,60},{-40,-60}},
+          color={0,0,255},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{0,60},{0,-60}},
+          color={0,0,255},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{40,60},{40,-60}},
+          color={0,0,255},
+          pattern=LinePattern.Dot)}),
+    Window(
+      x=0.04,
+      y=0.05,
+      width=0.93,
+      height=0.91),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</h4>
+<p><b>ThermoSysPro Version 4.0</h4>
+<p>This component model is documented in Sect. 9.6.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DynamicWaterWaterExchanger;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/NTUWaterHeating.mo b/ThermoSysPro/WaterSteam/HeatExchangers/NTUWaterHeating.mo
index cd474c82614b67cfd228c3095126a2f10f7f278f..81ec6237457133de9d11265d2536fb378387cbe3 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/NTUWaterHeating.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/NTUWaterHeating.mo
@@ -1,512 +1,512 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model NTUWaterHeating "NTU water heater"
-  parameter Real lambdaE=0 "Pressure loss coefficient on the water side";
-  parameter Units.SI.Area SCondDes=3000
-    "Exchange surface for the condensation and deheating";
-  parameter Units.SI.CoefficientOfHeatTransfer KCond=1
-    "Heat transfer coefficient for the condensation";
-  parameter Units.SI.Area SPurge=0 "Drain surface - if > 0: with drain cooling";
-  parameter Units.SI.CoefficientOfHeatTransfer KPurge=1
-    "Heat transfer coefficient for the drain cooling";
-  parameter Integer mode_eeF=0
-    "IF97 region at the inlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_seF=0
-    "IF97 region at the outlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_evC=0
-    "IF97 region at the inlet of the vapor side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_mF=0
-    "IF97 region in the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_epC=0
-    "IF97 region at the inlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_spC=0
-    "IF97 region at the outlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_flash=0
-    "IF97 region in the flash zone of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-
-public
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.SpecificEnthalpy HsateC(start=300e3, min=0)
-    "Saturation specific enthalpy of the water at the pressure of the vapor inlet";
-  Units.SI.SpecificEnthalpy HsatvC(start=2500e3, min=0)
-    "Saturation specific enthalpy of the vapor at the pressure of the vapor inlet";
-  Units.SI.Area SDes(start=0) "Heat exchange surface for deheating";
-  Units.SI.SpecificEnthalpy HeiF(start=200e3)
-    "Fluid specific enthalpy after drain cooling";
-  Units.SI.SpecificEnthalpy HDesF(start=200e3)
-    "Fluid specific enthalpy after deheating";
-  Units.SI.Temperature TeiF(start=400, min=0)
-    "Fluid temperature after drain cooling";
-  Units.SI.Temperature TsatC(start=400, min=0) "Saturation temperature";
-  Units.SI.Power W(start=1) "Total heat power transfered to the cooling water";
-  Units.SI.Power Wdes(start=1) "Energy transfer during deheating";
-  Units.SI.Power Wcond(start=1) "Energy transfer during condensation";
-  Units.SI.Power Wflash(start=1)
-    "Energy transfer during partial vaporisation in the drain";
-  Units.SI.Power Wpurge(start=1) "Energy transfer during drain cooling";
-  Units.SI.SpecificEnthalpy Hep(start=3e5)
-    "Mixing specific enthalpy of the drain and the condensate";
-  Units.SI.Density rho(start=1e3, min=0) "Average water density";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proeeF
-    "Water inlet fluid properties (4F)"
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proseF
-    "Water outlet fluid properties (1F)"
-    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prospC
-    "Drain outlet fluid properties (4C)"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Connectors.FluidInlet Ee(h_vol(start=200e3)) "Water inlet"
-                          annotation (Placement(transformation(extent={{-92,-10},
-            {-112,10}}, rotation=0)));
-  Connectors.FluidOutlet Se "Water outlet"
-                          annotation (Placement(transformation(extent={{110,-10},
-            {90,10}}, rotation=0)));
-  Connectors.FluidInlet Ep(h_vol(start=200e3)) "Drain inlet"
-                          annotation (Placement(transformation(extent={{-50,24},
-            {-70,44}}, rotation=0)));
-  Connectors.FluidOutlet Sp "Drain outlet"
-                          annotation (Placement(transformation(extent={{-50,-43},
-            {-70,-23}}, rotation=0)));
-  Connectors.FluidInlet Ev(h_vol(start=200e3)) "Vapor inlet"
-                          annotation (Placement(transformation(extent={{70,22},
-            {50,42}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proevC
-    "Vapor inlet fluid properties (1C)"
-    annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsatC
-    "Saturation conditions for the liquid phase"
-    annotation (Placement(transformation(extent={{10,40},{30,60}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsatC
-    "Saturation conditions for the vapor phase"
-    annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promeF
-    "Average water fluid properties (between 4F and 3F)"
-    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmC
-    "Deheating average fluid properties (between 1C and 2C)"
-    annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promcF
-    "Average deheating fluid properties (between 3F and 2F)"
-    annotation (Placement(transformation(extent={{50,-100},{70,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesF
-    "Deheating inlet fluid properties (2F)"
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmF
-    "Average deheating fluid properties (between 2F and 1F)"
-    annotation (Placement(transformation(extent={{20,-100},{40,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prosp
-    "Drain outlet fluid properties before cooling (near 3C)"
-    annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompC
-    "Average fluid properties in the drain (between 3C and 4C)"
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompF
-    "Average water fluid properties (between 4F and 3F)"
-    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proecF
-    "Water fluid properties (3F)"
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph flashepC
-    "Flash fluid properties (near 4C)"
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-equation
-
-  /* Unconnected connectors */
-  if cardinality(Ep) == 0 then
-    Ep.Q = 1e-6;
-    Ep.h = 100e3;
-    Ep.P = 1e5;
-    Ep.b = true;
-  end if;
-
-  // Cooling pipe
-  //-------------
-
-  /* Flow reversal for the cooling water pipe */
-  0 = if noEvent(Ee.Q > 0) then Ee.h - Ee.h_vol else Se.h - Se.h_vol;
-
-  /* Mass balance equation for the water pipe */
-  Se.Q = Ee.Q;
-
-  /* Pressure loss equation in the water pipe */
-  Ee.P - Se.P = lambdaE*ThermoSysPro.Functions.ThermoSquare(Ee.Q, eps)/rho;
-
-  /* Heating power released to the cooling pipe */
-  W = Se.Q*(Se.h - Ee.h);
-
-  // Water/steam cavity
-  //-------------------
-
-  /* Fluid pressure */
-  P = Ev.P;
-  P = Sp.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Sp.h_vol = h;
-  Ev.h_vol = h;
-  Ep.h_vol = h;
-
-  /* Mass balance equation */
-  Sp.Q = Ev.Q + Ep.Q;
-
-  /* Energy balance equations */
-
-  // Deheating zone
-  //---------------
-
-  /* Heat power, fluid specific enthalpy on the cold side and deheating surface */
-  /* If deheating is present */
-  if noEvent(HsatvC < Ev.h) then
-    Wdes = Ev.Q*(Ev.h - HsatvC);
-    Wdes = Ee.Q*(Se.h - HDesF);
-    Wdes = noEvent(min(Ev.Q*prodesmC.cp, Ee.Q*prodesmF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, prodesmC.cp, prodesmF.cp,
-           KCond/2, SDes, 1) *(proevC.T - prodesF.T));
-  /* If deheating is absent */
-  else
-    Wdes = 1e-9;
-    HDesF = Se.h;
-    SDes = 1e-9;
-  end if;
-
-  // Condensation zone
-  //------------------
-
-  /* Heat power, fluid specific enthalpy at the outlet of the condensation zone and vapor mass flow rate at the inlet */
-  if noEvent(Ev.h < HsatvC) then
-    Wcond = Ev.Q*(Ev.h - HsateC) + Wflash;
-  else
-    Wcond = Ev.Q*(HsatvC - HsateC) + Wflash;
-  end if;
-
-  Wcond = Ee.Q*(HDesF - HeiF);
-  Wcond = Ee.Q*promcF.cp*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, 1.e20, promcF.cp, KCond, (SCondDes-SDes), 0.5)*(TsatC - TeiF);
-
-  // Flash zone
-  //-----------
-
-  /* Heat power in case of partial vaporization in the drain */
-  if (flashepC.x > 0) then
-    Wflash = Ep.Q*(Ep.h - HsateC);
-  else
-    Wflash = 0;
-  end if;
-
-  /* Condition for partial vaporisation in the drain (flash) */
-  if (flashepC.x > 0) then
-    Hep = HsateC;
-  else
-    Sp.Q*Hep = HsateC*Ev.Q + Ep.h*Ep.Q;
-  end if;
-
-  // Drain cooling zone
-  //-------------------
-
-  /* Power, fluid specific enthalpy at the cold outlet and temperature of the drain outlet */
-  if noEvent(SPurge > 0) then
-    Wpurge = Sp.Q*(Hep - Sp.h);
-    Wpurge = Ee.Q*(HeiF - Ee.h);
-    Wpurge = noEvent(min(Sp.Q*prompC.cp, Ee.Q*prompF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Sp.Q, Ee.Q, prompC.cp, prompF.cp,
-              KPurge, SPurge, 0)*(prosp.T - proeeF.T));
-    TeiF = proecF.T;
-  else
-    HeiF = Ee.h;
-    Wpurge = 0;
-    Hep = Sp.h;
-    TeiF = proeeF.T;
-  end if;
-
-  /* Fluid thermodynamic properties */
-  proeeF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ee.P, Ee.h, mode_eeF);
-  proseF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Se.P, Se.h, mode_seF);
-  promeF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ee.P + Se.P)/2,(Ee.h + Se.h)/2, mode_eeF);
-  proevC = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, Ev.h, mode_evC);
-  prospC = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sp.P, Sp.h, mode_spC);
-  prosp  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, Hep, mode_spC);
-  prodesF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Se.P, HDesF, mode_seF);
-  prompC  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, (Hep + Sp.h)/2, mode_spC);
-  prodesmC = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, (vsatC.h + Ev.h)/2, mode_evC);
-  prompF  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ee.P, (Ee.h + HeiF)/2, mode_eeF);
-  promcF  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ee.P + Se.P)/2, (HeiF + HDesF)/2, mode_mF);
-  prodesmF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Se.P, (HDesF + Se.h)/2, mode_seF);
-  proecF  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ee.P, HeiF, mode_eeF);
-  flashepC = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, Ep.h, mode_flash);
-
-  /* Fluid density */
-  rho = promeF.d;
-
-  /* Saturation point at the vapor inlet pressure */
-  (lsatC,vsatC) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Ev.P);
-
-  TsatC  = lsatC.T;
-  HsateC = lsatC.h;
-  HsatvC = vsatC.h;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2},
-        initialScale=0.01), graphics={
-        Ellipse(
-          extent={{-100,-30},{-36,32}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{38,-30},{102,32}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,32},{72,-30}},
-          lineColor={85,255,85},
-          lineThickness=0.5,
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-70,32},{74,32},{74,32}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-70,-30},{74,-30},{74,-30}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{74,32},{74,-30}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{74,0},{102,0}},
-          color={0,0,0},
-          thickness=0.5),
-        Rectangle(
-          extent={{-58,-14},{74,-16}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-58,16},{74,14}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-78,-16},{-44,16}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-76,-14},{-48,14}},
-          lineColor={0,255,0},
-          lineThickness=1,
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-62,14},{72,-14}},
-          lineColor={85,255,85},
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-94,-12},{74,-12}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-94,-18},{74,-18}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-86,-24},{74,-24}},
-          color={0,0,255},
-          pattern=LinePattern.Dash)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2},
-        initialScale=0.01), graphics={
-        Line(
-          points={{-40,-40},{20,-24}},
-          color={0,0,255},
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-40,-20},{-20,0}},
-          color={255,0,0},
-          thickness=0.5),
-        Line(
-          points={{-20,0},{20,0}},
-          color={255,0,0},
-          thickness=0.5),
-        Line(
-          points={{60,0},{80,20}},
-          color={255,0,0},
-          thickness=0.5),
-        Text(
-          extent={{76,28},{84,20}},
-          lineColor={255,0,0},
-          lineThickness=0.5,
-          textString=
-               "1C"),
-        Text(
-          extent={{56,10},{64,2}},
-          lineColor={255,0,0},
-          lineThickness=0.5,
-          textString=
-               "2C"),
-        Text(
-          extent={{-24,8},{-16,0}},
-          lineColor={255,0,0},
-          lineThickness=0.5,
-          textString=
-               "3C"),
-        Text(
-          extent={{-44,-10},{-36,-18}},
-          lineColor={255,0,0},
-          lineThickness=0.5,
-          textString=
-               "4C"),
-        Text(
-          extent={{76,-10},{82,-16}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "1F"),
-        Text(
-          extent={{58,-18},{64,-24}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "2F"),
-        Text(
-          extent={{-22,-38},{-16,-44}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "3F"),
-        Text(
-          extent={{-42,-44},{-36,-50}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "4F"),
-        Line(
-          points={{20,0},{60,0}},
-          color={255,0,0},
-          thickness=0.5,
-          arrow={Arrow.Filled,Arrow.None}),
-        Line(
-          points={{20,-24},{80,-8}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-40,8},{-24,2}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Drain"),
-        Text(
-          extent={{66,-18},{82,-24}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Deheating"),
-        Text(
-          extent={{-36,-18},{-16,-24}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Drain cooling"),
-        Line(
-          points={{-26,4},{-22,0}},
-          color={0,0,0},
-          thickness=0.5,
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-40,-20},{-40,-40}},
-          color={0,0,0},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{-20,0},{-20,-34}},
-          color={0,0,0},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{60,0},{60,-14}},
-          color={0,0,0},
-          pattern=LinePattern.Dot),
-        Line(
-          points={{80,20},{80,-8}},
-          color={0,0,0},
-          pattern=LinePattern.Dot),
-        Text(
-          extent={{48,50},{74,44}},
-          lineColor={0,0,255},
-          textString=
-               "Vapor inlet"),
-        Text(
-          extent={{-74,52},{-48,46}},
-          lineColor={0,0,255},
-          textString=
-               "Drain inlet"),
-        Text(
-          extent={{-74,-16},{-48,-22}},
-          lineColor={0,0,255},
-          textString=
-               "Drain outlet"),
-        Text(
-          extent={{-114,18},{-88,12}},
-          lineColor={0,0,255},
-          textString=
-               "Water inlet"),
-        Text(
-          extent={{86,18},{112,12}},
-          lineColor={0,0,255},
-          textString=
-               "Water outlet"),
-        Text(
-          extent={{12,-10},{34,-18}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Condensation"),
-        Text(
-          extent={{-26,-4},{-12,-8}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          textString=
-               "Flash")}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2014</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 9.5.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end NTUWaterHeating;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model NTUWaterHeating "NTU water heater"
+  parameter Real lambdaE=0 "Pressure loss coefficient on the water side";
+  parameter Units.SI.Area SCondDes=3000
+    "Exchange surface for the condensation and deheating";
+  parameter Units.SI.CoefficientOfHeatTransfer KCond=1
+    "Heat transfer coefficient for the condensation";
+  parameter Units.SI.Area SPurge=0 "Drain surface - if > 0: with drain cooling";
+  parameter Units.SI.CoefficientOfHeatTransfer KPurge=1
+    "Heat transfer coefficient for the drain cooling";
+  parameter Integer mode_eeF=0
+    "IF97 region at the inlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_seF=0
+    "IF97 region at the outlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_evC=0
+    "IF97 region at the inlet of the vapor side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_mF=0
+    "IF97 region in the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_epC=0
+    "IF97 region at the inlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_spC=0
+    "IF97 region at the outlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_flash=0
+    "IF97 region in the flash zone of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.SpecificEnthalpy HsateC(start=300e3, min=0)
+    "Saturation specific enthalpy of the water at the pressure of the vapor inlet";
+  Units.SI.SpecificEnthalpy HsatvC(start=2500e3, min=0)
+    "Saturation specific enthalpy of the vapor at the pressure of the vapor inlet";
+  Units.SI.Area SDes(start=0) "Heat exchange surface for deheating";
+  Units.SI.SpecificEnthalpy HeiF(start=200e3)
+    "Fluid specific enthalpy after drain cooling";
+  Units.SI.SpecificEnthalpy HDesF(start=200e3)
+    "Fluid specific enthalpy after deheating";
+  Units.SI.Temperature TeiF(start=400, min=0)
+    "Fluid temperature after drain cooling";
+  Units.SI.Temperature TsatC(start=400, min=0) "Saturation temperature";
+  Units.SI.Power W(start=1) "Total heat power transfered to the cooling water";
+  Units.SI.Power Wdes(start=1) "Energy transfer during deheating";
+  Units.SI.Power Wcond(start=1) "Energy transfer during condensation";
+  Units.SI.Power Wflash(start=1)
+    "Energy transfer during partial vaporisation in the drain";
+  Units.SI.Power Wpurge(start=1) "Energy transfer during drain cooling";
+  Units.SI.SpecificEnthalpy Hep(start=3e5)
+    "Mixing specific enthalpy of the drain and the condensate";
+  Units.SI.Density rho(start=1e3, min=0) "Average water density";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proeeF
+    "Water inlet fluid properties (4F)"
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proseF
+    "Water outlet fluid properties (1F)"
+    annotation (Placement(transformation(extent={{-70,-100},{-50,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prospC
+    "Drain outlet fluid properties (4C)"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Connectors.FluidInlet Ee(h_vol(start=200e3)) "Water inlet"
+                          annotation (Placement(transformation(extent={{-92,-10},
+            {-112,10}}, rotation=0)));
+  Connectors.FluidOutlet Se "Water outlet"
+                          annotation (Placement(transformation(extent={{110,-10},
+            {90,10}}, rotation=0)));
+  Connectors.FluidInlet Ep(h_vol(start=200e3)) "Drain inlet"
+                          annotation (Placement(transformation(extent={{-50,24},
+            {-70,44}}, rotation=0)));
+  Connectors.FluidOutlet Sp "Drain outlet"
+                          annotation (Placement(transformation(extent={{-50,-43},
+            {-70,-23}}, rotation=0)));
+  Connectors.FluidInlet Ev(h_vol(start=200e3)) "Vapor inlet"
+                          annotation (Placement(transformation(extent={{70,22},
+            {50,42}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proevC
+    "Vapor inlet fluid properties (1C)"
+    annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsatC
+    "Saturation conditions for the liquid phase"
+    annotation (Placement(transformation(extent={{10,40},{30,60}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsatC
+    "Saturation conditions for the vapor phase"
+    annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promeF
+    "Average water fluid properties (between 4F and 3F)"
+    annotation (Placement(transformation(extent={{-40,-100},{-20,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmC
+    "Deheating average fluid properties (between 1C and 2C)"
+    annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promcF
+    "Average deheating fluid properties (between 3F and 2F)"
+    annotation (Placement(transformation(extent={{50,-100},{70,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesF
+    "Deheating inlet fluid properties (2F)"
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmF
+    "Average deheating fluid properties (between 2F and 1F)"
+    annotation (Placement(transformation(extent={{20,-100},{40,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prosp
+    "Drain outlet fluid properties before cooling (near 3C)"
+    annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompC
+    "Average fluid properties in the drain (between 3C and 4C)"
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompF
+    "Average water fluid properties (between 4F and 3F)"
+    annotation (Placement(transformation(extent={{-100,-60},{-80,-40}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proecF
+    "Water fluid properties (3F)"
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph flashepC
+    "Flash fluid properties (near 4C)"
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+equation
+
+  /* Unconnected connectors */
+  if cardinality(Ep) == 0 then
+    Ep.Q = 1e-6;
+    Ep.h = 100e3;
+    Ep.P = 1e5;
+    Ep.b = true;
+  end if;
+
+  // Cooling pipe
+  //-------------
+
+  /* Flow reversal for the cooling water pipe */
+  0 = if noEvent(Ee.Q > 0) then Ee.h - Ee.h_vol else Se.h - Se.h_vol;
+
+  /* Mass balance equation for the water pipe */
+  Se.Q = Ee.Q;
+
+  /* Pressure loss equation in the water pipe */
+  Ee.P - Se.P = lambdaE*ThermoSysPro.Functions.ThermoSquare(Ee.Q, eps)/rho;
+
+  /* Heating power released to the cooling pipe */
+  W = Se.Q*(Se.h - Ee.h);
+
+  // Water/steam cavity
+  //-------------------
+
+  /* Fluid pressure */
+  P = Ev.P;
+  P = Sp.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Sp.h_vol = h;
+  Ev.h_vol = h;
+  Ep.h_vol = h;
+
+  /* Mass balance equation */
+  Sp.Q = Ev.Q + Ep.Q;
+
+  /* Energy balance equations */
+
+  // Deheating zone
+  //---------------
+
+  /* Heat power, fluid specific enthalpy on the cold side and deheating surface */
+  /* If deheating is present */
+  if noEvent(HsatvC < Ev.h) then
+    Wdes = Ev.Q*(Ev.h - HsatvC);
+    Wdes = Ee.Q*(Se.h - HDesF);
+    Wdes = noEvent(min(Ev.Q*prodesmC.cp, Ee.Q*prodesmF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, prodesmC.cp, prodesmF.cp,
+           KCond/2, SDes, 1) *(proevC.T - prodesF.T));
+  /* If deheating is absent */
+  else
+    Wdes = 1e-9;
+    HDesF = Se.h;
+    SDes = 1e-9;
+  end if;
+
+  // Condensation zone
+  //------------------
+
+  /* Heat power, fluid specific enthalpy at the outlet of the condensation zone and vapor mass flow rate at the inlet */
+  if noEvent(Ev.h < HsatvC) then
+    Wcond = Ev.Q*(Ev.h - HsateC) + Wflash;
+  else
+    Wcond = Ev.Q*(HsatvC - HsateC) + Wflash;
+  end if;
+
+  Wcond = Ee.Q*(HDesF - HeiF);
+  Wcond = Ee.Q*promcF.cp*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, 1.e20, promcF.cp, KCond, (SCondDes-SDes), 0.5)*(TsatC - TeiF);
+
+  // Flash zone
+  //-----------
+
+  /* Heat power in case of partial vaporization in the drain */
+  if (flashepC.x > 0) then
+    Wflash = Ep.Q*(Ep.h - HsateC);
+  else
+    Wflash = 0;
+  end if;
+
+  /* Condition for partial vaporisation in the drain (flash) */
+  if (flashepC.x > 0) then
+    Hep = HsateC;
+  else
+    Sp.Q*Hep = HsateC*Ev.Q + Ep.h*Ep.Q;
+  end if;
+
+  // Drain cooling zone
+  //-------------------
+
+  /* Power, fluid specific enthalpy at the cold outlet and temperature of the drain outlet */
+  if noEvent(SPurge > 0) then
+    Wpurge = Sp.Q*(Hep - Sp.h);
+    Wpurge = Ee.Q*(HeiF - Ee.h);
+    Wpurge = noEvent(min(Sp.Q*prompC.cp, Ee.Q*prompF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Sp.Q, Ee.Q, prompC.cp, prompF.cp,
+              KPurge, SPurge, 0)*(prosp.T - proeeF.T));
+    TeiF = proecF.T;
+  else
+    HeiF = Ee.h;
+    Wpurge = 0;
+    Hep = Sp.h;
+    TeiF = proeeF.T;
+  end if;
+
+  /* Fluid thermodynamic properties */
+  proeeF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ee.P, Ee.h, mode_eeF);
+  proseF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Se.P, Se.h, mode_seF);
+  promeF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ee.P + Se.P)/2,(Ee.h + Se.h)/2, mode_eeF);
+  proevC = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, Ev.h, mode_evC);
+  prospC = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sp.P, Sp.h, mode_spC);
+  prosp  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, Hep, mode_spC);
+  prodesF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Se.P, HDesF, mode_seF);
+  prompC  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, (Hep + Sp.h)/2, mode_spC);
+  prodesmC = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, (vsatC.h + Ev.h)/2, mode_evC);
+  prompF  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ee.P, (Ee.h + HeiF)/2, mode_eeF);
+  promcF  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ee.P + Se.P)/2, (HeiF + HDesF)/2, mode_mF);
+  prodesmF = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Se.P, (HDesF + Se.h)/2, mode_seF);
+  proecF  = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ee.P, HeiF, mode_eeF);
+  flashepC = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ev.P, Ep.h, mode_flash);
+
+  /* Fluid density */
+  rho = promeF.d;
+
+  /* Saturation point at the vapor inlet pressure */
+  (lsatC,vsatC) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Ev.P);
+
+  TsatC  = lsatC.T;
+  HsateC = lsatC.h;
+  HsatvC = vsatC.h;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2},
+        initialScale=0.01), graphics={
+        Ellipse(
+          extent={{-100,-30},{-36,32}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{38,-30},{102,32}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,32},{72,-30}},
+          lineColor={85,255,85},
+          lineThickness=0.5,
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-70,32},{74,32},{74,32}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-70,-30},{74,-30},{74,-30}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{74,32},{74,-30}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{74,0},{102,0}},
+          color={0,0,0},
+          thickness=0.5),
+        Rectangle(
+          extent={{-58,-14},{74,-16}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-58,16},{74,14}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-78,-16},{-44,16}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-76,-14},{-48,14}},
+          lineColor={0,255,0},
+          lineThickness=1,
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-62,14},{72,-14}},
+          lineColor={85,255,85},
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-94,-12},{74,-12}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-94,-18},{74,-18}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-86,-24},{74,-24}},
+          color={0,0,255},
+          pattern=LinePattern.Dash)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2},
+        initialScale=0.01), graphics={
+        Line(
+          points={{-40,-40},{20,-24}},
+          color={0,0,255},
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-40,-20},{-20,0}},
+          color={255,0,0},
+          thickness=0.5),
+        Line(
+          points={{-20,0},{20,0}},
+          color={255,0,0},
+          thickness=0.5),
+        Line(
+          points={{60,0},{80,20}},
+          color={255,0,0},
+          thickness=0.5),
+        Text(
+          extent={{76,28},{84,20}},
+          lineColor={255,0,0},
+          lineThickness=0.5,
+          textString=
+               "1C"),
+        Text(
+          extent={{56,10},{64,2}},
+          lineColor={255,0,0},
+          lineThickness=0.5,
+          textString=
+               "2C"),
+        Text(
+          extent={{-24,8},{-16,0}},
+          lineColor={255,0,0},
+          lineThickness=0.5,
+          textString=
+               "3C"),
+        Text(
+          extent={{-44,-10},{-36,-18}},
+          lineColor={255,0,0},
+          lineThickness=0.5,
+          textString=
+               "4C"),
+        Text(
+          extent={{76,-10},{82,-16}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "1F"),
+        Text(
+          extent={{58,-18},{64,-24}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "2F"),
+        Text(
+          extent={{-22,-38},{-16,-44}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "3F"),
+        Text(
+          extent={{-42,-44},{-36,-50}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "4F"),
+        Line(
+          points={{20,0},{60,0}},
+          color={255,0,0},
+          thickness=0.5,
+          arrow={Arrow.Filled,Arrow.None}),
+        Line(
+          points={{20,-24},{80,-8}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-40,8},{-24,2}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Drain"),
+        Text(
+          extent={{66,-18},{82,-24}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Deheating"),
+        Text(
+          extent={{-36,-18},{-16,-24}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Drain cooling"),
+        Line(
+          points={{-26,4},{-22,0}},
+          color={0,0,0},
+          thickness=0.5,
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-40,-20},{-40,-40}},
+          color={0,0,0},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{-20,0},{-20,-34}},
+          color={0,0,0},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{60,0},{60,-14}},
+          color={0,0,0},
+          pattern=LinePattern.Dot),
+        Line(
+          points={{80,20},{80,-8}},
+          color={0,0,0},
+          pattern=LinePattern.Dot),
+        Text(
+          extent={{48,50},{74,44}},
+          lineColor={0,0,255},
+          textString=
+               "Vapor inlet"),
+        Text(
+          extent={{-74,52},{-48,46}},
+          lineColor={0,0,255},
+          textString=
+               "Drain inlet"),
+        Text(
+          extent={{-74,-16},{-48,-22}},
+          lineColor={0,0,255},
+          textString=
+               "Drain outlet"),
+        Text(
+          extent={{-114,18},{-88,12}},
+          lineColor={0,0,255},
+          textString=
+               "Water inlet"),
+        Text(
+          extent={{86,18},{112,12}},
+          lineColor={0,0,255},
+          textString=
+               "Water outlet"),
+        Text(
+          extent={{12,-10},{34,-18}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Condensation"),
+        Text(
+          extent={{-26,-4},{-12,-8}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          textString=
+               "Flash")}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2014</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 9.5.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end NTUWaterHeating;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/SimpleDynamicCondenser.mo b/ThermoSysPro/WaterSteam/HeatExchangers/SimpleDynamicCondenser.mo
index cb20ecbc25a2f4073f3090dd6006d80d3d0adf99..ecd167618a1958c6d8d960b578f5de249c5c1036 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/SimpleDynamicCondenser.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/SimpleDynamicCondenser.mo
@@ -1,396 +1,396 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model SimpleDynamicCondenser
-  parameter Units.SI.Volume V=1 "Cavity volume";
-  parameter Units.SI.Area A=1 "Cavity cross-sectional area";
-  parameter Real Vf0=0.5
-    "Fraction of initial water volume in the drum (active if steady_state=false)";
-  parameter Units.SI.AbsolutePressure P0=0.1e5
-    "Fluid initial pressure (active if steady_state=false)";
-  parameter Boolean gravity_pressure=false
-    "true: fluid pressure at the bottom of the cavity includes gravity term - false: without gravity term";
-  parameter Real Ccond=0.01 "Condensation coefficient";
-  parameter Real Cevap=0.09 "Evaporation coefficient";
-  parameter Real Xlo=0.0025
-    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
-  parameter Real Xvo=0.9975
-    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
-  parameter Units.SI.Area Avl=A
-    "Heat exchange surface between the liquid and gas phases";
-  parameter Real Kvl=1000
-    "Heat exchange coefficient between the liquid and gas phases";
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.02 "Pipe internal diameter";
-  parameter Units.SI.Length e=2.e-3 "Wall thickness";
-  parameter Units.SI.Position z1=0 "Inlet altitude";
-  parameter Units.SI.Position z2=0 "Outlet altitude";
-  parameter Units.SI.Length rugosrel=0.0007 "Pipe roughness";
-  parameter Real lambda= 0.03
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Units.SI.Area At=ntubes*pi*D^2/4
-    "Internal pipe cross-section area (cooling fluid)";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, Vl0)";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-
-public
-  Units.SI.Density rhom(start=998) "Liquid phase density";
-  ThermoSysPro.Units.SI.PressureDifference dpf "Friction pressure loss";
-  ThermoSysPro.Units.SI.PressureDifference dpg "Gravity pressure loss";
-  Real khi "Hydraulic pressure loss coefficient";
-  Units.SI.AbsolutePressure P "Fluid average pressure";
-  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity";
-  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy";
-  Units.SI.Temperature Tl "Liquid phase temperature";
-  Units.SI.Temperature Tv "Gas phase temperature";
-  Units.SI.Volume Vl "Liquid phase volume";
-  Units.SI.Volume Vv "Gas phase volume";
-  Real xl(start=0.0) "Mass vapor fraction in the liquid phase";
-  Real xv(start=1) "Mass vapor fraction in the gas phase";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Gas phase density";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phaser";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase";
-  Units.SI.Power Wvl
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  Units.SI.Power Wout "Thermal power exchanged from the steam to the pipes";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-100,80},{-80,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Propriétés de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{10,40},{30,60}}, rotation=0)));
-  Connectors.FluidInlet Cv     annotation (Placement(transformation(extent={{
-            -10,90},{10,110}}, rotation=0)));
-  Connectors.FluidOutlet Cl     annotation (Placement(transformation(extent={{
-            -8,-110},{12,-90}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yNiveau          annotation (Placement(
-        transformation(extent={{100,-82},{120,-62}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-public
-  Connectors.FluidInlet Cee    annotation (Placement(transformation(extent={{
-            -110,-32},{-90,-12}}, rotation=0)));
-  Connectors.FluidOutlet Cse   annotation (Placement(transformation(extent={{90,
-            -30},{110,-10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    "Propriétés de l'eau "                   annotation (Placement(
-        transformation(extent={{40,20},{60,40}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(hl) = 0;
-    der(hv) = 0;
-    der(Vl) = 0;
-    der(P) = 0;
-  else
-    hl = lsat.h;
-    hv = vsat.h;
-    Vl = Vf0*V;
-    P = P0;
-  end if;
-
-equation
-
-  /* Unconnected connectors */
-  if (cardinality(Cl) == 0) then
-    Cl.Q = 0;
-    Cl.h = 1.e5;
-    Cl.a = true;
-  end if;
-
-  if (cardinality(Cv) == 0) then
-    Cv.Q = 0;
-    Cv.h = 1.e5;
-    Cv.b = true;
-  end if;
-
-  if (cardinality(Cee) == 0) then
-    Cee.Q = 0;
-    Cee.h = 1.e5;
-    Cee.b = true;
-  end if;
-
-  if (cardinality(Cse) == 0) then
-    Cse.Q = 0;
-    Cse.h = 1.e5;
-    Cse.a = true;
-  end if;
-
-  Cl.P = Pfond;
-  Cv.P = P;
-
-  V = Vl + Vv;
-
-  Cee.Q = Cse.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Cee.Q > Qeps) then Cee.h - Cee.h_vol else if (Cee.Q < -Qeps) then
-      Cse.h - Cse.h_vol else Cee.h - 0.5*((Cee.h_vol - Cse.h_vol)*Modelica.Math.sin(pi
-      *Cee.Q/2/Qeps) + Cee.h_vol + Cse.h_vol));
-  else
-    0 = if (Cee.Q > 0) then Cee.h - Cee.h_vol else Cse.h - Cse.h_vol;
-  end if;
-
-  /* Pressure at the bottom of the condenser */
-  Pfond = if gravity_pressure then P + prod.d*g*Vl/A else P;
-
-  /* Water mass balance equation */
-  BQl = -Cl.Q + Qcond - Qevap;
-  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-
-  /* Vapor mass balance equation */
-  BQv = Cv.Q + Qevap - Qcond;
-  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-
-  /* Water energy balance equation */
-  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wvl;
-  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-
-  Cl.h_vol = hl;
-
-  /* Vapor energy balance equation */
-  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Wout;
-  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-
-  Cv.h_vol = hv;
-
-  /* Heat transfer between the water and the vapor */
-  Wvl = Kvl*Avl*(Tv - Tl);
-
-  /* Condensation and evaporation mass flow rates */
-  Qcond = if  (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
-  Qevap = if noEvent((xl > Xlo)) then Cevap*rhol*Vl*(xl - Xlo) else 0;
-
-  /* Water level */
-  yNiveau.signal = Vl/A;
-
-  /* Thermal power exchanged from the steam to the pipes */
-  Wout = -Cv.Q*(Cv.h - hl);
-  Wout = -Cee.Q*(Cse.h - Cee.h);
-
-  /* Pressure losses in the pipes */
-  dpf = khi*ThermoSysPro.Functions.ThermoSquare(Cee.Q,eps)/(2*At^2*rhom);
-  //dpg = rhom*g*(z2 - z1)*L;
-  dpg = rhom*g*(z2 - z1);
-
-  khi = lambda*L/D;
-
-  Cee.P - Cse.P = dpf + dpg;
-
-  /* Fluid thermodynamic properties */
-  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P,hl,0);
-  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P,hv,0);
-  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond,Cl.h,0);
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Cee.P+Cse.P)/2, (Cee.h+Cse.h)/2, mode);
-
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-
-  rhom = proe.d;
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-  rhov = prov.d;
-  xv = prov.x;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{100,20},{80,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{-80,-60}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,6},{-80,0}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-18},{-80,-24}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-40},{-80,-46}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,6},{20,0}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-40},{20,-46}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-18},{20,-24}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-18},{-30,-24}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-40},{-30,-46}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,6},{-30,0}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,-72},{100,-100}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20},
-              {-20,100}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20},
-              {-20,100}},
-          color={0,0,255},
-          thickness=0.5),
-        Rectangle(
-          extent={{100,20},{80,-60}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,20},{-80,-60}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,6},{-80,0}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-18},{-80,-24}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-40},{-80,-46}},
-          lineColor={0,0,255},
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,6},{20,0}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-40},{20,-46}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{80,-18},{20,-24}},
-          lineColor={0,0,255},
-          fillColor={255,170,170},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-18},{-30,-24}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,-40},{-30,-46}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{30,6},{-30,0}},
-          lineColor={0,0,255},
-          fillColor={170,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-100,-72},{100,-100}},
-          lineColor={0,0,255},
-          lineThickness=0.5,
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-2,102},{-22,100},{-42,94},{-62,82},{-82,62},{-94,42},{-100,
-              22},{-100,20},{-98,20},{100,20},{100,20},{96,28},{90,42},{78,62},
-              {58,82},{38,94},{18,100},{-2,102}},
-          lineColor={0,0,255},
-          fillColor={175,175,175},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-66,66},{72,22}},
-          lineColor={0,0,255},
-          fillColor={175,175,175},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Simple")}),
-    Window(
-      x=0.11,
-      y=0.06,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2014</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 9.5.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end SimpleDynamicCondenser;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model SimpleDynamicCondenser
+  parameter Units.SI.Volume V=1 "Cavity volume";
+  parameter Units.SI.Area A=1 "Cavity cross-sectional area";
+  parameter Real Vf0=0.5
+    "Fraction of initial water volume in the drum (active if steady_state=false)";
+  parameter Units.SI.AbsolutePressure P0=0.1e5
+    "Fluid initial pressure (active if steady_state=false)";
+  parameter Boolean gravity_pressure=false
+    "true: fluid pressure at the bottom of the cavity includes gravity term - false: without gravity term";
+  parameter Real Ccond=0.01 "Condensation coefficient";
+  parameter Real Cevap=0.09 "Evaporation coefficient";
+  parameter Real Xlo=0.0025
+    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
+  parameter Real Xvo=0.9975
+    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
+  parameter Units.SI.Area Avl=A
+    "Heat exchange surface between the liquid and gas phases";
+  parameter Real Kvl=1000
+    "Heat exchange coefficient between the liquid and gas phases";
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.02 "Pipe internal diameter";
+  parameter Units.SI.Length e=2.e-3 "Wall thickness";
+  parameter Units.SI.Position z1=0 "Inlet altitude";
+  parameter Units.SI.Position z2=0 "Outlet altitude";
+  parameter Units.SI.Length rugosrel=0.0007 "Pipe roughness";
+  parameter Real lambda= 0.03
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  parameter Integer ntubes=1 "Number of pipes in parallel";
+  parameter Units.SI.Area At=ntubes*pi*D^2/4
+    "Internal pipe cross-section area (cooling fluid)";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, Vl0)";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+
+public
+  Units.SI.Density rhom(start=998) "Liquid phase density";
+  ThermoSysPro.Units.SI.PressureDifference dpf "Friction pressure loss";
+  ThermoSysPro.Units.SI.PressureDifference dpg "Gravity pressure loss";
+  Real khi "Hydraulic pressure loss coefficient";
+  Units.SI.AbsolutePressure P "Fluid average pressure";
+  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity";
+  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy";
+  Units.SI.Temperature Tl "Liquid phase temperature";
+  Units.SI.Temperature Tv "Gas phase temperature";
+  Units.SI.Volume Vl "Liquid phase volume";
+  Units.SI.Volume Vv "Gas phase volume";
+  Real xl(start=0.0) "Mass vapor fraction in the liquid phase";
+  Real xv(start=1) "Mass vapor fraction in the gas phase";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Gas phase density";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phaser";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase";
+  Units.SI.Power Wvl
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  Units.SI.Power Wout "Thermal power exchanged from the steam to the pipes";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-100,80},{-80,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Propriétés de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{10,40},{30,60}}, rotation=0)));
+  Connectors.FluidInlet Cv     annotation (Placement(transformation(extent={{
+            -10,90},{10,110}}, rotation=0)));
+  Connectors.FluidOutlet Cl     annotation (Placement(transformation(extent={{
+            -8,-110},{12,-90}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yNiveau          annotation (Placement(
+        transformation(extent={{100,-82},{120,-62}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+public
+  Connectors.FluidInlet Cee    annotation (Placement(transformation(extent={{
+            -110,-32},{-90,-12}}, rotation=0)));
+  Connectors.FluidOutlet Cse   annotation (Placement(transformation(extent={{90,
+            -30},{110,-10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    "Propriétés de l'eau "                   annotation (Placement(
+        transformation(extent={{40,20},{60,40}}, rotation=0)));
+initial equation
+  if steady_state then
+    der(hl) = 0;
+    der(hv) = 0;
+    der(Vl) = 0;
+    der(P) = 0;
+  else
+    hl = lsat.h;
+    hv = vsat.h;
+    Vl = Vf0*V;
+    P = P0;
+  end if;
+
+equation
+
+  /* Unconnected connectors */
+  if (cardinality(Cl) == 0) then
+    Cl.Q = 0;
+    Cl.h = 1.e5;
+    Cl.a = true;
+  end if;
+
+  if (cardinality(Cv) == 0) then
+    Cv.Q = 0;
+    Cv.h = 1.e5;
+    Cv.b = true;
+  end if;
+
+  if (cardinality(Cee) == 0) then
+    Cee.Q = 0;
+    Cee.h = 1.e5;
+    Cee.b = true;
+  end if;
+
+  if (cardinality(Cse) == 0) then
+    Cse.Q = 0;
+    Cse.h = 1.e5;
+    Cse.a = true;
+  end if;
+
+  Cl.P = Pfond;
+  Cv.P = P;
+
+  V = Vl + Vv;
+
+  Cee.Q = Cse.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Cee.Q > Qeps) then Cee.h - Cee.h_vol else if (Cee.Q < -Qeps) then
+      Cse.h - Cse.h_vol else Cee.h - 0.5*((Cee.h_vol - Cse.h_vol)*Modelica.Math.sin(pi
+      *Cee.Q/2/Qeps) + Cee.h_vol + Cse.h_vol));
+  else
+    0 = if (Cee.Q > 0) then Cee.h - Cee.h_vol else Cse.h - Cse.h_vol;
+  end if;
+
+  /* Pressure at the bottom of the condenser */
+  Pfond = if gravity_pressure then P + prod.d*g*Vl/A else P;
+
+  /* Water mass balance equation */
+  BQl = -Cl.Q + Qcond - Qevap;
+  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+
+  /* Vapor mass balance equation */
+  BQv = Cv.Q + Qevap - Qcond;
+  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+
+  /* Water energy balance equation */
+  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wvl;
+  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+
+  Cl.h_vol = hl;
+
+  /* Vapor energy balance equation */
+  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Wout;
+  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+
+  Cv.h_vol = hv;
+
+  /* Heat transfer between the water and the vapor */
+  Wvl = Kvl*Avl*(Tv - Tl);
+
+  /* Condensation and evaporation mass flow rates */
+  Qcond = if  (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
+  Qevap = if noEvent((xl > Xlo)) then Cevap*rhol*Vl*(xl - Xlo) else 0;
+
+  /* Water level */
+  yNiveau.signal = Vl/A;
+
+  /* Thermal power exchanged from the steam to the pipes */
+  Wout = -Cv.Q*(Cv.h - hl);
+  Wout = -Cee.Q*(Cse.h - Cee.h);
+
+  /* Pressure losses in the pipes */
+  dpf = khi*ThermoSysPro.Functions.ThermoSquare(Cee.Q,eps)/(2*At^2*rhom);
+  //dpg = rhom*g*(z2 - z1)*L;
+  dpg = rhom*g*(z2 - z1);
+
+  khi = lambda*L/D;
+
+  Cee.P - Cse.P = dpf + dpg;
+
+  /* Fluid thermodynamic properties */
+  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P,hl,0);
+  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P,hv,0);
+  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond,Cl.h,0);
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Cee.P+Cse.P)/2, (Cee.h+Cse.h)/2, mode);
+
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+
+  rhom = proe.d;
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+  rhov = prov.d;
+  xv = prov.x;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{100,20},{80,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{-80,-60}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,6},{-80,0}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-18},{-80,-24}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-40},{-80,-46}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,6},{20,0}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-40},{20,-46}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-18},{20,-24}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-18},{-30,-24}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-40},{-30,-46}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,6},{-30,0}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,-72},{100,-100}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20},
+              {-20,100}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20},
+              {-20,100}},
+          color={0,0,255},
+          thickness=0.5),
+        Rectangle(
+          extent={{100,20},{80,-60}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,20},{-80,-60}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,6},{-80,0}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-18},{-80,-24}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-40},{-80,-46}},
+          lineColor={0,0,255},
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,6},{20,0}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-40},{20,-46}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{80,-18},{20,-24}},
+          lineColor={0,0,255},
+          fillColor={255,170,170},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-18},{-30,-24}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,-40},{-30,-46}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{30,6},{-30,0}},
+          lineColor={0,0,255},
+          fillColor={170,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-100,-72},{100,-100}},
+          lineColor={0,0,255},
+          lineThickness=0.5,
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-2,102},{-22,100},{-42,94},{-62,82},{-82,62},{-94,42},{-100,
+              22},{-100,20},{-98,20},{100,20},{100,20},{96,28},{90,42},{78,62},
+              {58,82},{38,94},{18,100},{-2,102}},
+          lineColor={0,0,255},
+          fillColor={175,175,175},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-66,66},{72,22}},
+          lineColor={0,0,255},
+          fillColor={175,175,175},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Simple")}),
+    Window(
+      x=0.11,
+      y=0.06,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2014</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 9.5.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end SimpleDynamicCondenser;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/SimpleStaticCondenser.mo b/ThermoSysPro/WaterSteam/HeatExchangers/SimpleStaticCondenser.mo
index 2d33bbbea00128966ce58b9f9993038f2762b8be..3b8d744b3d3795cda36699ae4999190436af88cf 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/SimpleStaticCondenser.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/SimpleStaticCondenser.mo
@@ -1,240 +1,240 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model SimpleStaticCondenser "Simple static condenser"
-  parameter Real Kc=10 "Friction pressure loss coefficient for the hot side";
-  parameter Real Kf=10 "Friction pressure loss coefficient for the cold side";
-  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
-  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
-  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
-  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot side";
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold side";
-  parameter Integer modec=0
-    "IF97 region of the water for the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer modecs=0
-    "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer modef=0
-    "IF97 region of the water for the cold side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.Power W(start=1e6)
-    "Power exchanged from the hot side to the cold side";
-  Units.SI.Temperature Tec(start=500)
-    "Fluid temperature at the inlet of the hot side";
-  Units.SI.Temperature Tsc(start=400)
-    "Fluid temperature at the outlet of the hot side";
-  Units.SI.Temperature Tef(start=350)
-    "Fluid temperature at the inlet of the cold side";
-  Units.SI.Temperature Tsf(start=350)
-    "Fluid temperature at the outlet of the cold side";
-  ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3)
-    "Friction pressure loss in the hot side";
-  ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2)
-    "Gravity pressure loss in the hot side";
-  ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3)
-    "Total pressure loss in the hot side";
-  ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3)
-    "Friction pressure loss in the cold side";
-  ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2)
-    "Gravity pressure loss in the cold side";
-  ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3)
-    "Total pressure loss in the cold side";
-  Units.SI.Density rhoc(start=998) "Density of the fluid in the hot side";
-  Units.SI.Density rhof(start=998) "Density of the fluid in the cold side";
-  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
-  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
-
-public
-  Connectors.FluidInlet Ec
-                          annotation (Placement(transformation(extent={{-70,
-            -110},{-50,-90}}, rotation=0)));
-  Connectors.FluidInlet Ef
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet Sf
-                          annotation (Placement(transformation(extent={{90,-11},
-            {110,9}}, rotation=0)));
-  Connectors.FluidOutlet Sc
-                          annotation (Placement(transformation(extent={{50,-110},
-            {70,-90}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{40,80},{60,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promc
-    annotation (Placement(transformation(extent={{0,-100},{20,-80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-equation
-
-  /* Flow reversal in the hot side */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Qc > Qeps) then Ec.h - Ec.h_vol else if (Qc < -Qeps) then
-        Sc.h - Sc.h_vol else Ec.h - 0.5*((Ec.h_vol - Sc.h_vol)*Modelica.Math.sin(pi
-        *Qc/2/Qeps) + Ec.h_vol + Sc.h_vol));
-  else
-    0 = if (Qc > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
-  end if;
-
-  /* Flow reversal in the cold side */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Qf > Qeps) then Ef.h - Ef.h_vol else if (Qf < -Qeps) then
-        Sf.h - Sf.h_vol else Ef.h - 0.5*((Ef.h_vol - Sf.h_vol)*Modelica.Math.sin(pi
-        *Qf/2/Qeps) + Ef.h_vol + Sf.h_vol));
-  else
-    0 = if (Qf > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
-  end if;
-
-  /* Flows in both sides */
-  Ec.Q = Sc.Q;
-  Qc = Ec.Q;
-
-  Ef.Q = Sf.Q;
-  Qf = Ef.Q;
-
-  /* The fluid specific enthalpy at the outlet of the hot side is assumed to be at the saturation point */
-  Sc.h = lsat.h;
-
-  /* Power exchanged between the two sides */
-  W = Qf*(Sf.h - Ef.h);
-  W = Qc*(Ec.h - Sc.h);
-
-  /* Pressure losses in the hot side */
-  Ec.P - Sc.P = DPc;
-
-  DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
-  DPgc = rhoc*g*(z2c - z1c);
-  DPc  = DPfc + DPgc;
-
-  /* Pressure losses in the cold side */
-  Ef.P - Sf.P = DPf;
-
-  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
-  DPgf = rhof*g*(z2f - z1f);
-  DPf  = DPff + DPgf;
-
-  /* Fluid thermodynamic properties in the hot side */
-  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, modec);
-  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, modecs);
-  promc = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, modec);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Ec.P);
-
-  if (p_rhoc > 0) then
-    rhoc = p_rhoc;
-  else
-    rhoc = promc.d;
-  end if;
-
-  /* Fluid thermodynamic properties in the cold side */
-  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, modef);
-  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, modef);
-  promf = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ef.P + Sf.P)/2, (Ef.h + Sf.h)/2, modef);
-
-  Tef = profe.T;
-  Tsf = profs.T;
-
-  if (p_rhof > 0) then
-    rhof = p_rhof;
-  else
-    rhof = promf.d;
-  end if;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Line(
-          points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-110,21},{-90,11}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Cold inlet"),
-        Text(
-          extent={{-46,-93},{-26,-103}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Hot inlet"),
-        Text(
-          extent={{28,-93},{48,-103}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Hot outlet"),
-        Text(
-          extent={{88,20},{110,9}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Cold outlet")}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end SimpleStaticCondenser;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model SimpleStaticCondenser "Simple static condenser"
+  parameter Real Kc=10 "Friction pressure loss coefficient for the hot side";
+  parameter Real Kf=10 "Friction pressure loss coefficient for the cold side";
+  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
+  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
+  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
+  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot side";
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold side";
+  parameter Integer modec=0
+    "IF97 region of the water for the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer modecs=0
+    "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer modef=0
+    "IF97 region of the water for the cold side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.Power W(start=1e6)
+    "Power exchanged from the hot side to the cold side";
+  Units.SI.Temperature Tec(start=500)
+    "Fluid temperature at the inlet of the hot side";
+  Units.SI.Temperature Tsc(start=400)
+    "Fluid temperature at the outlet of the hot side";
+  Units.SI.Temperature Tef(start=350)
+    "Fluid temperature at the inlet of the cold side";
+  Units.SI.Temperature Tsf(start=350)
+    "Fluid temperature at the outlet of the cold side";
+  ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3)
+    "Friction pressure loss in the hot side";
+  ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2)
+    "Gravity pressure loss in the hot side";
+  ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3)
+    "Total pressure loss in the hot side";
+  ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3)
+    "Friction pressure loss in the cold side";
+  ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2)
+    "Gravity pressure loss in the cold side";
+  ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3)
+    "Total pressure loss in the cold side";
+  Units.SI.Density rhoc(start=998) "Density of the fluid in the hot side";
+  Units.SI.Density rhof(start=998) "Density of the fluid in the cold side";
+  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+
+public
+  Connectors.FluidInlet Ec
+                          annotation (Placement(transformation(extent={{-70,
+            -110},{-50,-90}}, rotation=0)));
+  Connectors.FluidInlet Ef
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet Sf
+                          annotation (Placement(transformation(extent={{90,-11},
+            {110,9}}, rotation=0)));
+  Connectors.FluidOutlet Sc
+                          annotation (Placement(transformation(extent={{50,-110},
+            {70,-90}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{40,80},{60,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promc
+    annotation (Placement(transformation(extent={{0,-100},{20,-80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+equation
+
+  /* Flow reversal in the hot side */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Qc > Qeps) then Ec.h - Ec.h_vol else if (Qc < -Qeps) then
+        Sc.h - Sc.h_vol else Ec.h - 0.5*((Ec.h_vol - Sc.h_vol)*Modelica.Math.sin(pi
+        *Qc/2/Qeps) + Ec.h_vol + Sc.h_vol));
+  else
+    0 = if (Qc > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
+  end if;
+
+  /* Flow reversal in the cold side */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Qf > Qeps) then Ef.h - Ef.h_vol else if (Qf < -Qeps) then
+        Sf.h - Sf.h_vol else Ef.h - 0.5*((Ef.h_vol - Sf.h_vol)*Modelica.Math.sin(pi
+        *Qf/2/Qeps) + Ef.h_vol + Sf.h_vol));
+  else
+    0 = if (Qf > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
+  end if;
+
+  /* Flows in both sides */
+  Ec.Q = Sc.Q;
+  Qc = Ec.Q;
+
+  Ef.Q = Sf.Q;
+  Qf = Ef.Q;
+
+  /* The fluid specific enthalpy at the outlet of the hot side is assumed to be at the saturation point */
+  Sc.h = lsat.h;
+
+  /* Power exchanged between the two sides */
+  W = Qf*(Sf.h - Ef.h);
+  W = Qc*(Ec.h - Sc.h);
+
+  /* Pressure losses in the hot side */
+  Ec.P - Sc.P = DPc;
+
+  DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
+  DPgc = rhoc*g*(z2c - z1c);
+  DPc  = DPfc + DPgc;
+
+  /* Pressure losses in the cold side */
+  Ef.P - Sf.P = DPf;
+
+  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
+  DPgf = rhof*g*(z2f - z1f);
+  DPf  = DPff + DPgf;
+
+  /* Fluid thermodynamic properties in the hot side */
+  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, modec);
+  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, modecs);
+  promc = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, modec);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Ec.P);
+
+  if (p_rhoc > 0) then
+    rhoc = p_rhoc;
+  else
+    rhoc = promc.d;
+  end if;
+
+  /* Fluid thermodynamic properties in the cold side */
+  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, modef);
+  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, modef);
+  promf = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ef.P + Sf.P)/2, (Ef.h + Sf.h)/2, modef);
+
+  Tef = profe.T;
+  Tsf = profs.T;
+
+  if (p_rhof > 0) then
+    rhof = p_rhof;
+  else
+    rhof = promf.d;
+  end if;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Line(
+          points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-110,21},{-90,11}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Cold inlet"),
+        Text(
+          extent={{-46,-93},{-26,-103}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Hot inlet"),
+        Text(
+          extent={{28,-93},{48,-103}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Hot outlet"),
+        Text(
+          extent={{88,20},{110,9}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Cold outlet")}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end SimpleStaticCondenser;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/StaticCondenser.mo b/ThermoSysPro/WaterSteam/HeatExchangers/StaticCondenser.mo
index 173d36565124728c76a8600cf3b68b8e094e4283..785862f5a6b696dae0f151d54c3210aa960d072c 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/StaticCondenser.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/StaticCondenser.mo
@@ -1,356 +1,356 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model StaticCondenser "Static condenser"
-  parameter Units.SI.Area SCO=10000 "Heat exchange surface";
-  parameter Real CPCE=0.02
-    "Pressure loss coefficient for the water side (Pa.s²/(kg.m**3))";
-  parameter Units.SI.Height z=0.5 "Water level in the condenser";
-  parameter Units.SI.CoefficientOfHeatTransfer KCO=1
-    "Reference heat exchange coefficient";
-  parameter Units.SI.MassFlowRate QC0=100 "Reference mass flow rate";
-  parameter Units.SI.Temperature Tref=293 "Reference temperature";
-  parameter Real COPR=1 "Reference fouling coefficient";
-  parameter Real COP=1 "Actual fouling coefficient";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer mode_ee=1
-    "IF97 region at the water inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_se=1
-    "IF97 region at the water outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_ex=0
-    "IF97 region at the extraction point. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Qee(start=10)
-    "Cooling water mass flow rate at the inlet";
-  Units.SI.SpecificEnthalpy Hee(start=250000)
-    "Cooling water specific anthalpy at the inlet";
-  Units.SI.AbsolutePressure Pee(start=1.e5)
-    "Cooling water pressure at the inlet";
-  Units.SI.MassFlowRate Qep(start=10) "Drain mass flow rate at the inlet";
-  Units.SI.SpecificEnthalpy Hep(start=1000000)
-    "Drain specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qev(start=10) "Vapor mass flow rate at the inlet";
-  Units.SI.SpecificEnthalpy Hev(start=2500000)
-    "Vapor specific enthalpy at the inlet";
-  Units.SI.MassFlowRate Qvt(start=10)
-    "Vapor mass flow rate leaving the turbine";
-  Units.SI.SpecificEnthalpy Hvt(start=2500000)
-    "Vapor specific enthalpy leaving the turbine";
-  Units.SI.MassFlowRate Qse(start=10)
-    "Cooling water mass flow rate at the outlet";
-  Units.SI.SpecificEnthalpy Hse(start=500000)
-    "Cooling water specific enthalpy at the outlet";
-  Units.SI.AbsolutePressure Pse(start=1.e5)
-    "Cooling water pressure at the outlet";
-  Units.SI.MassFlowRate Qex(start=10) "Drain mass flow rate at the outlet";
-  Units.SI.SpecificEnthalpy Hex(start=500000)
-    "Drain specific enthalpy at the outlet";
-  Units.SI.AbsolutePressure Pex(start=1.e5) "Drain pressure at the outlet";
-  Units.SI.SpecificEnthalpy Hsate(start=200000)
-    "Water specific enthalpy at the saturation point";
-  Units.SI.AbsolutePressure Pcond(start=17000)
-    "Vapor pressure inside the condenser";
-  Units.SI.Temperature Tsat(start=500)
-    "Water temperature at the saturation point";
-  Units.SI.Temperature Tee(start=300) "Cooling water temperature at the inlet";
-  Units.SI.Temperature Tse(start=400) "Cooling water temperature at the outlet";
-  Units.SI.Density rho_ee(start=900) "Cooling water density at the inlet";
-  Units.SI.Density rho_ex(start=900) "Water density at the extraction point";
-  Units.SI.CoefficientOfHeatTransfer KT1(start=50)
-    "First reference value for the exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer KT2(start=50)
-    "Second reference value for the exchange coefficient";
-  Units.SI.CoefficientOfHeatTransfer XKCO(start=200)
-    "Heat transfer coefficient";
-  Units.SI.SpecificEnthalpy Hmv(start=2500000)
-    "Fluid input average specific enthalpy";
-  Units.SI.SpecificEnthalpy Hml(start=250000)
-    "Extraction water average specific enthalpy";
-  Units.SI.Power W "Heat power released to the cold source";
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cee "Cooling water inlet"
-    annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cse "Cooling water outlet"
-    annotation (Placement(transformation(extent={{90,-72},{114,-50}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cex "Extraction water"
-    annotation (Placement(transformation(extent={{-12,-114},{14,-90}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cvt "Turbine outlet"
-    annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proex
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prose
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cep "Drain inlet"
-    annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cev "Vapor inlet"
-    annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation=
-            0)));
-equation
-
-  /* Unconnected connectors */
-  if (cardinality(Cev) == 0) then
-    Cev.Q = 0;
-    Cev.h = 1.e5;
-    Cev.b = true;
-  end if;
-
-  if (cardinality(Cep) == 0) then
-    Cep.Q = 0;
-    Cep.h = 1.e5;
-    Cep.b = true;
-  end if;
-
-  Qep = Cep.Q;
-  Hep = Cep.h;
-
-  Qev = Cev.Q;
-  Hev = Cev.h;
-
-  Qvt = Cvt.Q;
-  Hvt = Cvt.h;
-
-  Qee = Cee.Q;
-  Hee = Cee.h;
-  Pee = Cee.P;
-
-  Qse = Cse.Q;
-  Hse = Cse.h;
-  Pse = Cse.P;
-
-  Qex = Cex.Q;
-  Pex = Cex.P;
-
-  // Cooling pipe
-  //-------------
-
-  /* Flow reversal for the cooling water pipe */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Qee > Qeps) then Cee.h - Cee.h_vol else if (Qee < -Qeps) then
-      Cse.h - Cse.h_vol else Cee.h - 0.5*((Cee.h_vol - Cse.h_vol)*Modelica.Math.sin(pi
-      *Qee/2/Qeps) + Cee.h_vol + Cse.h_vol));
-  else
-    0 = if (Qee > 0) then Cee.h - Cee.h_vol else Cse.h - Cse.h_vol;
-  end if;
-
-  /* Mass balance equation for the water pipe */
-  Qee = Qse;
-
-  /* Pressure loss equation in the water pipe */
-  Pse = noEvent(if (rho_ee > 0) then Pee - (CPCE * ThermoSysPro.Functions.ThermoSquare(Qee, eps)/ rho_ee) else Pee);
-
-  /* Heating power released to the cooling pipe */
-  W = Qee*(Hse - Hee);
-
-  // Water/steam cavity
-  //-------------------
-
-  /* Fluid pressure */
-  Pcond = Cep.P;
-  Pcond = Cev.P;
-  Pcond = Cvt.P;
-
-  /* Extraction water pressure */
-  Pex = Pcond + rho_ex*g*z;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Hmv = Cvt.h_vol;
-  Hmv = Cep.h_vol;
-  Hmv = Cev.h_vol;
-  Hex = Cex.h_vol;
-
-  /* Mass balance equation */
-  Qex = Qvt + Qep + Qev;
-
-  /* Energy balance equations */
-
-  /* Input heating power */
-  W = Qvt*(Hvt - Hsate) + Qep*(Hep - Hsate) + Qev*(Hev - Hsate);
-
-  /* Fluid input average specific enthalpy */
-  Hmv = (Hvt*Qvt + Hev*Qev + Hep*Qep) / Qex;
-
-  /* Extraction water average specific enthalpy */
-  Hml = (Hsate + Hex)/2;
-
-  /* Extraction water specific enthalpy */
-  Hex = noEvent(if (rho_ex > 0) then Hsate + ((Pex - Pcond)/rho_ex) else Hsate);
-
-  /* First reference value for the exchange coefficient */
-  KT1 = -0.05*(Tref - 273.16)^2 + 3.3*(Tref - 273.16) + 52;
-
-  /* Second reference value for the exchange coefficient */
-  KT2 = -0.05*(Tee - 273.16)^2 + 3.3*(Tee - 273.16) + 52;
-
-  /* Heat exchange coefficient */
-  XKCO = KCO*(COP/COPR)*(KT2/KT1)*ThermoSysPro.Functions.ThermoRoot(Qee/QC0, Modelica.Constants.eps);
-
-  /* Fluid saturation teperature */
-  0 = Tsat - Tse - (Tsat - Tee)*exp(XKCO*SCO*((Tee - Tse)/W));
-
-  /* Fluid thermodynamic properties */
-  proee = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pee, Hee, mode_ee);
-  proex = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pex, Hex, mode_ex);
-  prose = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode_se);
-
-  rho_ee = proee.d;
-  rho_ex = proex.d;
-
-  Tee = proee.T;
-  Tse = prose.T;
-
-  /* Vapor pressure inside the condenser */
-  Pcond = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Tsat);
-
-  /* Fluid thermodynamic properties at the saturation point*/
-  (lsat1,vsat1) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Pcond);
-
-  Hsate = lsat1.h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-22,88},{20,70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Turbine outlet"),
-        Text(
-          extent={{-82,24},{-52,16}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Drain inlet"),
-        Text(
-          extent={{-24,-52},{26,-72}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Extraction water"),
-        Text(
-          extent={{38,-58},{86,-66}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Cooling water outlet"),
-        Text(
-          extent={{-86,-52},{-32,-74}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Cooling water inlet"),
-        Text(
-          extent={{-86,66},{-50,54}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Vapor inlet"),
-        Line(
-          points={{0,8},{0,-70}},
-          color={0,0,0},
-          thickness=1),
-        Polygon(
-          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{-100,8},{100,8}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
-              -32},{-90,-32},{-90,-38},{100,-38}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-86},{100,80},{-100,80},{-100,-86},{100,-86}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
-              -32},{-90,-32},{-90,-38},{100,-38}},
-          color={0,0,255},
-          thickness=0.5),
-        Polygon(
-          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{0,8},{0,-70}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-100,8},{100,8}},
-          color={0,0,255},
-          thickness=0.5)}),
-    Window(
-      x=0.09,
-      y=0.08,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2014</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 9.7.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StaticCondenser;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model StaticCondenser "Static condenser"
+  parameter Units.SI.Area SCO=10000 "Heat exchange surface";
+  parameter Real CPCE=0.02
+    "Pressure loss coefficient for the water side (Pa.s²/(kg.m**3))";
+  parameter Units.SI.Height z=0.5 "Water level in the condenser";
+  parameter Units.SI.CoefficientOfHeatTransfer KCO=1
+    "Reference heat exchange coefficient";
+  parameter Units.SI.MassFlowRate QC0=100 "Reference mass flow rate";
+  parameter Units.SI.Temperature Tref=293 "Reference temperature";
+  parameter Real COPR=1 "Reference fouling coefficient";
+  parameter Real COP=1 "Actual fouling coefficient";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer mode_ee=1
+    "IF97 region at the water inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_se=1
+    "IF97 region at the water outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_ex=0
+    "IF97 region at the extraction point. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Qee(start=10)
+    "Cooling water mass flow rate at the inlet";
+  Units.SI.SpecificEnthalpy Hee(start=250000)
+    "Cooling water specific anthalpy at the inlet";
+  Units.SI.AbsolutePressure Pee(start=1.e5)
+    "Cooling water pressure at the inlet";
+  Units.SI.MassFlowRate Qep(start=10) "Drain mass flow rate at the inlet";
+  Units.SI.SpecificEnthalpy Hep(start=1000000)
+    "Drain specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qev(start=10) "Vapor mass flow rate at the inlet";
+  Units.SI.SpecificEnthalpy Hev(start=2500000)
+    "Vapor specific enthalpy at the inlet";
+  Units.SI.MassFlowRate Qvt(start=10)
+    "Vapor mass flow rate leaving the turbine";
+  Units.SI.SpecificEnthalpy Hvt(start=2500000)
+    "Vapor specific enthalpy leaving the turbine";
+  Units.SI.MassFlowRate Qse(start=10)
+    "Cooling water mass flow rate at the outlet";
+  Units.SI.SpecificEnthalpy Hse(start=500000)
+    "Cooling water specific enthalpy at the outlet";
+  Units.SI.AbsolutePressure Pse(start=1.e5)
+    "Cooling water pressure at the outlet";
+  Units.SI.MassFlowRate Qex(start=10) "Drain mass flow rate at the outlet";
+  Units.SI.SpecificEnthalpy Hex(start=500000)
+    "Drain specific enthalpy at the outlet";
+  Units.SI.AbsolutePressure Pex(start=1.e5) "Drain pressure at the outlet";
+  Units.SI.SpecificEnthalpy Hsate(start=200000)
+    "Water specific enthalpy at the saturation point";
+  Units.SI.AbsolutePressure Pcond(start=17000)
+    "Vapor pressure inside the condenser";
+  Units.SI.Temperature Tsat(start=500)
+    "Water temperature at the saturation point";
+  Units.SI.Temperature Tee(start=300) "Cooling water temperature at the inlet";
+  Units.SI.Temperature Tse(start=400) "Cooling water temperature at the outlet";
+  Units.SI.Density rho_ee(start=900) "Cooling water density at the inlet";
+  Units.SI.Density rho_ex(start=900) "Water density at the extraction point";
+  Units.SI.CoefficientOfHeatTransfer KT1(start=50)
+    "First reference value for the exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer KT2(start=50)
+    "Second reference value for the exchange coefficient";
+  Units.SI.CoefficientOfHeatTransfer XKCO(start=200)
+    "Heat transfer coefficient";
+  Units.SI.SpecificEnthalpy Hmv(start=2500000)
+    "Fluid input average specific enthalpy";
+  Units.SI.SpecificEnthalpy Hml(start=250000)
+    "Extraction water average specific enthalpy";
+  Units.SI.Power W "Heat power released to the cold source";
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cee "Cooling water inlet"
+    annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cse "Cooling water outlet"
+    annotation (Placement(transformation(extent={{90,-72},{114,-50}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cex "Extraction water"
+    annotation (Placement(transformation(extent={{-12,-114},{14,-90}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cvt "Turbine outlet"
+    annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proex
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prose
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cep "Drain inlet"
+    annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cev "Vapor inlet"
+    annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation=
+            0)));
+equation
+
+  /* Unconnected connectors */
+  if (cardinality(Cev) == 0) then
+    Cev.Q = 0;
+    Cev.h = 1.e5;
+    Cev.b = true;
+  end if;
+
+  if (cardinality(Cep) == 0) then
+    Cep.Q = 0;
+    Cep.h = 1.e5;
+    Cep.b = true;
+  end if;
+
+  Qep = Cep.Q;
+  Hep = Cep.h;
+
+  Qev = Cev.Q;
+  Hev = Cev.h;
+
+  Qvt = Cvt.Q;
+  Hvt = Cvt.h;
+
+  Qee = Cee.Q;
+  Hee = Cee.h;
+  Pee = Cee.P;
+
+  Qse = Cse.Q;
+  Hse = Cse.h;
+  Pse = Cse.P;
+
+  Qex = Cex.Q;
+  Pex = Cex.P;
+
+  // Cooling pipe
+  //-------------
+
+  /* Flow reversal for the cooling water pipe */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Qee > Qeps) then Cee.h - Cee.h_vol else if (Qee < -Qeps) then
+      Cse.h - Cse.h_vol else Cee.h - 0.5*((Cee.h_vol - Cse.h_vol)*Modelica.Math.sin(pi
+      *Qee/2/Qeps) + Cee.h_vol + Cse.h_vol));
+  else
+    0 = if (Qee > 0) then Cee.h - Cee.h_vol else Cse.h - Cse.h_vol;
+  end if;
+
+  /* Mass balance equation for the water pipe */
+  Qee = Qse;
+
+  /* Pressure loss equation in the water pipe */
+  Pse = noEvent(if (rho_ee > 0) then Pee - (CPCE * ThermoSysPro.Functions.ThermoSquare(Qee, eps)/ rho_ee) else Pee);
+
+  /* Heating power released to the cooling pipe */
+  W = Qee*(Hse - Hee);
+
+  // Water/steam cavity
+  //-------------------
+
+  /* Fluid pressure */
+  Pcond = Cep.P;
+  Pcond = Cev.P;
+  Pcond = Cvt.P;
+
+  /* Extraction water pressure */
+  Pex = Pcond + rho_ex*g*z;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Hmv = Cvt.h_vol;
+  Hmv = Cep.h_vol;
+  Hmv = Cev.h_vol;
+  Hex = Cex.h_vol;
+
+  /* Mass balance equation */
+  Qex = Qvt + Qep + Qev;
+
+  /* Energy balance equations */
+
+  /* Input heating power */
+  W = Qvt*(Hvt - Hsate) + Qep*(Hep - Hsate) + Qev*(Hev - Hsate);
+
+  /* Fluid input average specific enthalpy */
+  Hmv = (Hvt*Qvt + Hev*Qev + Hep*Qep) / Qex;
+
+  /* Extraction water average specific enthalpy */
+  Hml = (Hsate + Hex)/2;
+
+  /* Extraction water specific enthalpy */
+  Hex = noEvent(if (rho_ex > 0) then Hsate + ((Pex - Pcond)/rho_ex) else Hsate);
+
+  /* First reference value for the exchange coefficient */
+  KT1 = -0.05*(Tref - 273.16)^2 + 3.3*(Tref - 273.16) + 52;
+
+  /* Second reference value for the exchange coefficient */
+  KT2 = -0.05*(Tee - 273.16)^2 + 3.3*(Tee - 273.16) + 52;
+
+  /* Heat exchange coefficient */
+  XKCO = KCO*(COP/COPR)*(KT2/KT1)*ThermoSysPro.Functions.ThermoRoot(Qee/QC0, Modelica.Constants.eps);
+
+  /* Fluid saturation teperature */
+  0 = Tsat - Tse - (Tsat - Tee)*exp(XKCO*SCO*((Tee - Tse)/W));
+
+  /* Fluid thermodynamic properties */
+  proee = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pee, Hee, mode_ee);
+  proex = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pex, Hex, mode_ex);
+  prose = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode_se);
+
+  rho_ee = proee.d;
+  rho_ex = proex.d;
+
+  Tee = proee.T;
+  Tse = prose.T;
+
+  /* Vapor pressure inside the condenser */
+  Pcond = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Tsat);
+
+  /* Fluid thermodynamic properties at the saturation point*/
+  (lsat1,vsat1) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Pcond);
+
+  Hsate = lsat1.h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-22,88},{20,70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Turbine outlet"),
+        Text(
+          extent={{-82,24},{-52,16}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Drain inlet"),
+        Text(
+          extent={{-24,-52},{26,-72}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Extraction water"),
+        Text(
+          extent={{38,-58},{86,-66}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Cooling water outlet"),
+        Text(
+          extent={{-86,-52},{-32,-74}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Cooling water inlet"),
+        Text(
+          extent={{-86,66},{-50,54}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Vapor inlet"),
+        Line(
+          points={{0,8},{0,-70}},
+          color={0,0,0},
+          thickness=1),
+        Polygon(
+          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{-100,8},{100,8}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
+              -32},{-90,-32},{-90,-38},{100,-38}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-86},{100,80},{-100,80},{-100,-86},{100,-86}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
+              -32},{-90,-32},{-90,-38},{100,-38}},
+          color={0,0,255},
+          thickness=0.5),
+        Polygon(
+          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{0,8},{0,-70}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-100,8},{100,8}},
+          color={0,0,255},
+          thickness=0.5)}),
+    Window(
+      x=0.09,
+      y=0.08,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2014</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 9.7.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StaticCondenser;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/StaticCondenserHEI.mo b/ThermoSysPro/WaterSteam/HeatExchangers/StaticCondenserHEI.mo
index 24754881b780f5b356df45a26e21be38f7fb7a9f..a0751639a25f8a0ecbe3eba4d5ccac3f920dd5a7 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/StaticCondenserHEI.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/StaticCondenserHEI.mo
@@ -1,509 +1,509 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model StaticCondenserHEI "HEI Static condenser"
-
-  parameter Real Kf=0 "Friction pressure loss coefficient for the cold side";
-  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
-  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
-  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
-  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
-  parameter Real Ucorr=1.00
-    "Corrective term for the heat transfert coefficient (U) for calibration";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot side";
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold side";
-  parameter Integer modec=0
-    "IF97 region of the water for the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer modecs=0
-    "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer modef=0
-    "IF97 region of the water for the cold side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer Tube_Material1=1 "Material of the tubes type 1. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material2=1 "Material of the tubes type 2. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material3=1 "Material of the tubes type 3. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material4=1 "Material of the tubes type 4. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material5=1 "Material of the tubes type 5. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Integer Tube_Material6=1 "Material of the tubes type 6. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
-    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
-    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
-  parameter Real nb_pass=2 "number of water passes";
-  parameter Real nb_tube1=12000
-    "Number of tubes type 1. For exemple tubes of the condensing zone";
-  parameter Real nb_tube2=900
-    "Number of tubes type 2. For exemple gaz removal tubes";
-  parameter Real nb_tube3=700
-    "Number of tubes type 3. For exemple impingement tubes";
-  parameter Real nb_tube4=200 "Number of tubes type 4";
-  parameter Real nb_tube5=200 "Number of tubes type 5";
-  parameter Real nb_tube6=200 "Number of tubes type 6";
-  parameter Units.SI.Thickness e_tube1=0.7e-3 "Tubes thickness type 1";
-  parameter Units.SI.Thickness e_tube2=0.7e-3 "Tubes thickness type 2";
-  parameter Units.SI.Thickness e_tube3=1e-3 "Tubes thickness type 3";
-  parameter Units.SI.Thickness e_tube4=1e-3 "Tubes thickness type 4";
-  parameter Units.SI.Thickness e_tube5=1e-3 "Tubes thickness type 5";
-  parameter Units.SI.Thickness e_tube6=1e-3 "Tubes thickness type 6";
-  parameter Units.SI.Diameter D_tube1=25.4e-3
-    "External diameter of tubes type 1";
-  parameter Units.SI.Diameter D_tube2=25.4e-3
-    "External diameter of tubes type 2";
-  parameter Units.SI.Diameter D_tube3=25.4e-3
-    "External diameter of tubes type 3";
-  parameter Units.SI.Diameter D_tube4=25.4e-3
-    "External diameter of tubes type 4";
-  parameter Units.SI.Diameter D_tube5=25.4e-3
-    "External diameter of tubes type 5";
-  parameter Units.SI.Diameter D_tube6=25.4e-3
-    "External diameter of tubes type 6";
-  parameter Units.SI.Length L_tube1=10 "Tubes length type 1";
-  parameter Units.SI.Length L_tube2=10 "Tubes length type 2";
-  parameter Units.SI.Length L_tube3=10 "Tubes length type 3";
-  parameter Units.SI.Length L_tube4=10 "Tubes length type 4";
-  parameter Units.SI.Length L_tube5=10 "Tubes length type 5";
-  parameter Units.SI.Length L_tube6=10 "Tubes length type 6";
-  parameter Real FC=0.95 "Correction factor for cleanless";
-
-  parameter Units.SI.Pressure Poffset=0
-    "Offset applied on the pressure provided by HEI";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-  Units.SI.Diameter D_tubes "Weight average diameter of tubes";
-  Units.SI.Thickness e_tubes "Weight average thickness of tubes";
-  Units.SI.Area S_pass(start=3) "Passage section of cold water";
-  Units.SI.Area S_ech1(start=10000) "Heat exchange surface tubes type 1";
-  Units.SI.Area S_ech2(start=10000) "Heat exchange surface tubes type 2";
-  Units.SI.Area S_ech3(start=10000) "Heat exchange surface tubes type 3";
-  Units.SI.Area S_ech4(start=10000) "Heat exchange surface tubes type 4";
-  Units.SI.Area S_ech5(start=10000) "Heat exchange surface tubes type 5";
-  Units.SI.Area S_ech6(start=10000) "Heat exchange surface tubes type 6";
-  Real FM1 "Correction factor for material and gauge tubes type 1";
-  Real FM2 "Correction factor for material and gauge tubes type 2";
-  Real FM3 "Correction factor for material and gauge tubes type 3";
-  Real FM4 "Correction factor for material and gauge tubes type 4";
-  Real FM5 "Correction factor for material and gauge tubes type 5";
-  Real FM6 "Correction factor for material and gauge tubes type 6";
-
-public
-  Units.SI.Power W(start=1e6)
-    "Power exchanged from the hot side to the cold side";
-  Units.SI.Temperature Tec(start=500)
-    "Fluid temperature at the inlet of the hot side";
-  Units.SI.Temperature Tsc(start=400)
-    "Fluid temperature at the outlet of the hot side";
-  Units.SI.Temperature Tef(start=350)
-    "Fluid temperature at the inlet of the cold side";
-  Units.SI.Temperature Tsf(start=350)
-    "Fluid temperature at the outlet of the cold side";
-  Units.SI.Pressure DPgc(start=1e2) "Gravity pressure loss in the hot side";
-  Units.SI.Pressure DPff(start=1e3) "Friction pressure loss in the cold side";
-  Units.SI.Pressure DPgf(start=1e2) "Gravity pressure loss in the cold side";
-  Units.SI.Pressure DPf(start=1e3) "Total pressure loss in the cold side";
-  Units.SI.Density rhof(start=998) "Density of the fluid in the cold side";
-  Units.SI.Density rho_ex(start=950) "Water density at the extraction point";
-
-  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
-  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
-  Units.SI.Area S_ech(start=10000) "Heat exchange surface";
-  Units.SI.Velocity Vf "Velocity of cold water";
-  Real Fw "Correction factor for water";
-  Units.SI.CoefficientOfHeatTransfer U1
-    "Uncorrected heat transfert coefficient";
-  Real FM "Overall correction factor for material and gauge";
-  Units.SI.CoefficientOfHeatTransfer U "Heat transfert coefficient";
-  Units.SI.Temperature Tcut_off "Saturation temperature at pressure cut off";
-  Units.SI.Pressure Psat_att(start=6000) "Expected saturation pressure HEI";
-  Units.SI.Pressure Pcut_off "Pressure cut off";
-  Units.SI.Pressure Pzero_load "Pressure zero load";
-  Units.SI.Pressure Pcond(start=6000)
-    "Expected corrected saturation pressure HEI";
-  Units.SI.Temperature Tsat(start=310)
-    "Expected corrected saturation temperature HEI";
-  Units.SI.Power Wcut_off(start=5e5)
-    "Power exchanged from the hot side to the cold side at Pcut_off";
-  Units.SI.Temperature TTD "Terminal Temperature Difference";
-  Integer HEI "Applicabiltity of the standards HEI. 0:NO - 1:OK";
-  Units.SI.Temperature Tsat_att(start=310)
-    "Expected saturation temperature HEI";
-  Units.SI.SpecificHeatCapacity Cpmf(start=950)
-    "Average of specific heat capacity of cold water";
-  Units.SI.SpecificEnthalpy Hmv(start=2500000)
-    "Fluid input average specific enthalpy";
-  Units.SI.SpecificEnthalpy Hml(start=100000)
-    "Extraction water average specific enthalpy";
-  Units.SI.SpecificEnthalpy Hex(start=100000)
-    "Drain specific enthalpy at the outlet";
-
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cee "Cooling water inlet"
-    annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cse "Cooling water outlet"
-    annotation (Placement(transformation(extent={{90,-72},{114,-50}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cex "Extraction water"
-    annotation (Placement(transformation(extent={{-12,-114},{14,-90}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cvt "Turbine outlet"
-    annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cep "Drain inlet"
-    annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
-public
-  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cev "Vapor inlet"
-    annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation=
-            0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
-    "Proprietes eau"
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-equation
-  // Water/steam cavity
-  //-------------------
-
-  /* Unconnected connectors */
-  if (cardinality(Cev) == 0) then
-    Cev.Q = 0;
-    Cev.h = 1.e5;
-    Cev.b = true;
-  end if;
-
-  if (cardinality(Cep) == 0) then
-    Cep.Q = 0;
-    Cep.h = 1.e5;
-    Cep.b = true;
-  end if;
-
-  /* Fluid pressure */
-  Pcond = Cep.P;
-  Pcond = Cev.P;
-  Pcond = Cvt.P;
-
-  /* Extraction water pressure */
-  Cex.P = Pcond + rho_ex*g*(z2c-z1c);
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Hmv = Cvt.h_vol;
-  Hmv = Cep.h_vol;
-  Hmv = Cev.h_vol;
-  Hex = Cex.h_vol;
-
-  /* Flows in both sides */
-  Qc = Cex.Q;
-  Cee.Q = Cse.Q;
-  Qf = Cee.Q;
-
-  /* Flow reversal in the cold side */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Qf > Qeps) then Cee.h - Cee.h_vol else if (Qf < -Qeps) then
-        Cse.h - Cse.h_vol else Cee.h - 0.5*((Cee.h_vol - Cse.h_vol)*Modelica.Math.sin(pi
-        *Qf/2/Qeps) + Cee.h_vol + Cse.h_vol));
-  else
-    0 = if (Qf > 0) then Cee.h - Cee.h_vol else Cse.h - Cse.h_vol;
-  end if;
-
-  /* Mixer: mass balance equation */
-  Qc = Cvt.Q + Cep.Q + Cev.Q;
-
-  /* Fluid input average specific enthalpy */
-  Hmv = (Cvt.Q*Cvt.h  + Cep.Q*Cep.h + Cev.Q*Cev.h)/Qc;
-
-  /* Extraction water average specific enthalpy */
-  Hml = (lsat.h + Hex)/2;
-
-  /* Extraction water specific enthalpy */
-  Hex = noEvent(if (rho_ex > 0) then lsat.h + ((Cex.P - Pcond)/rho_ex) else lsat.h);
-
-  /* Input power */
-  W = Cvt.Q*(Cvt.h - lsat.h) + Cep.Q*(Cep.h - lsat.h) + Cev.Q*(Cev.h - lsat.h);
-
-  /* Power exchanged between the two sides */
-  W = Qf*(Cse.h - Cee.h);
-
-  /* Gravity pressure losses in the hot side */
-  DPgc = rho_ex*g*(z2c - z1c);
-
-  /* Pressure losses in the cold side */
-  Cee.P - Cse.P = DPf;
-
-  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
-  DPgf = rhof*g*(z2f - z1f);
-  DPf  = DPff + DPgf;
-
-  /* Fluid thermodynamic properties in the hot side */
-  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cvt.P, Hmv, modec);
-  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cex.P, Cex.h, modecs);
-  //procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pcond + Cex.P)/2, (lsat.h + Cex.h)/2, modecs);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Pcond);
-
-  if (p_rhoc > 0) then
-    rho_ex = p_rhoc;
-  else
-    rho_ex = procs.d;
-  end if;
-
-  /* Fluid thermodynamic properties in the cold side */
-  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cee.P, Cee.h, modef);
-  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cse.P, Cse.h, modef);
-  promf = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Cee.P + Cse.P)/2, (Cee.h + Cse.h)/2, modef);
-
-  Tef = profe.T;
-  Tsf = profs.T;
-
-  if (p_rhof > 0) then
-    rhof = p_rhof;
-  else
-    rhof = promf.d;
-  end if;
-
-  /* Calculation of the heat exchange surface */
-  S_ech1 = pi*D_tube1*L_tube1*nb_tube1;
-  S_ech2 = pi*D_tube2*L_tube2*nb_tube2;
-  S_ech3 = pi*D_tube3*L_tube3*nb_tube3;
-  S_ech4 = pi*D_tube4*L_tube4*nb_tube4;
-  S_ech5 = pi*D_tube5*L_tube5*nb_tube5;
-  S_ech6 = pi*D_tube6*L_tube6*nb_tube6;
-  S_ech = S_ech1 + S_ech2 + S_ech3 + S_ech4 + S_ech5 + S_ech6;
-
- /* Calculation of the passage section of cold water */
-  S_pass = (D_tube1/2-e_tube1)^2*pi*nb_tube1/nb_pass + (D_tube2/2-e_tube2)^2*pi*nb_tube2/nb_pass + (D_tube3/2-e_tube3)^2*pi*nb_tube3/nb_pass + (D_tube4/2-e_tube4)^2*pi*nb_tube4/nb_pass + (D_tube5/2-e_tube5)^2*pi*nb_tube5/nb_pass +(D_tube6/2-e_tube6)^2*pi*nb_tube6/nb_pass;
-
-  /* Calculation of the velocity of cold water */
-  Vf = Qf/rhof/S_pass;
-
-  /* Calculation of the correction factor for water from the HEI standard 10th édition */
-  Fw = -2.104072e-04*(Tef-273.15)^2 + 1.974994e-02*(Tef-273.15) + 6.639699e-01;
-
-  /* Calculation of weight average diameter of tubes */
-  D_tubes = (D_tube1*nb_tube1 + D_tube2*nb_tube2 + D_tube3*nb_tube3 + D_tube4*nb_tube4 + D_tube5*nb_tube5 + D_tube6*nb_tube6)/(nb_tube1 + nb_tube2 + nb_tube3 + nb_tube4 + nb_tube5 + nb_tube6);
-
-  /* Calculation of the uncorrected heat transfert coefficient from the HEI standard 10th édition */
-  U1 = ThermoSysPro.Correlations.Thermal.Function_U1(D_tubes,Vf);
-
-  /* Calculation of the Weight average thickness of tubes */
-  e_tubes = (e_tube1*nb_tube1+e_tube2*nb_tube2+e_tube3*nb_tube3+e_tube4*nb_tube4+e_tube5*nb_tube5+e_tube6*nb_tube6)/(nb_tube1+nb_tube2+nb_tube3+nb_tube4+nb_tube5+nb_tube6);
-
-  /* Calculation of the Correction factor for material and gauge from the HEI standard 10th édition */
-  FM1 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube1,Tube_Material1);
-  FM2 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube2,Tube_Material2);
-  FM3 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube3,Tube_Material3);
-  FM4 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube4,Tube_Material4);
-  FM5 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube5,Tube_Material5);
-  FM6 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube6,Tube_Material6);
-  FM = (FM1*S_ech1 + FM2*S_ech2 + FM3*S_ech3 + FM4*S_ech4 + FM5*S_ech5 + FM6*S_ech6)/S_ech;
-
-  /* Calculation of the heat transfert coefficient from the HEI standard 10th édition */
-  U = Ucorr*U1*FM*FC*Fw;
-  //U = U1*FM*FC*Fw + Ucorr;
-
-  /* Calculation of Average of specific heat capacity of cold water */
-  Cpmf = promf.cp;
-
-  /* Calculation of Expected saturation temperature HEI */
-  Tsat_att = Tef + (W/(Qf*Cpmf))*(1/(1-Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf))));
-
-  /* Calculation of Expected saturation pressure HEI */
-  Psat_att = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Tsat_att);
-
-  /* Calculation of Pressure cut off HEI */
-  Pcut_off = (5.752433E-04*(Tef-273.15)^3 + 1.735162E-02*(Tef-273.15)^2 + 8.052739E-02*(Tef-273.15) + 2.109159E+01)*100;
-
-  /*Calculation of the saturation Temperature at Pressure cut off HEI */
-  Tcut_off = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Pcut_off);
-
-  /* Calculation of Pressure zero load HEI */
-  Pzero_load = (5.008000E-04*(Tef-273.15)^3 + 2.039549E-02*(Tef-273.15)^2 + 2.277566E-01*(Tef-273.15) + 1.027824E+01)*100;
-
-  /* Calculation of power exchanged from the hot side to the cold side at Pcut_off */
-  Tcut_off = Tef + (Wcut_off/(Qf*Cpmf))*(1/(1-Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf))));
-
-  /* Calculation of Expected corrected saturation pressure HEI */
-  if (Psat_att < Pcut_off) then
-    Pcond = (Pcut_off-Pzero_load)/Wcut_off*W+Pzero_load+Poffset;
-  else
-    Pcond = Psat_att + Poffset;
-  end if;
-
-  /* Calculation of Expected corrected saturation pressure HEI */
-    Tsat = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Pcond);
-
-  /* Calculation of the Terminal Temperature Difference */
-  TTD = Tsat - Tsf;
-
-  /* The standards HEI aren't applicable if the terminal temperature difference is less than 2,78 K */
-  if (TTD > 2.78) then
-    HEI = 1;
-  else
-    HEI = 0;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-22,88},{20,70}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Turbine outlet"),
-        Text(
-          extent={{-82,24},{-52,16}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Drain inlet"),
-        Text(
-          extent={{-24,-52},{26,-72}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Extraction water"),
-        Text(
-          extent={{38,-58},{86,-66}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Cooling water outlet"),
-        Text(
-          extent={{-86,-52},{-32,-74}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Cooling water inlet"),
-        Text(
-          extent={{-86,66},{-50,54}},
-          lineColor={0,0,0},
-          lineThickness=1,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0},
-          textString=
-               "Vapor inlet"),
-        Line(
-          points={{0,8},{0,-70}},
-          color={0,0,0},
-          thickness=1),
-        Polygon(
-          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{-100,8},{100,8}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(
-          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
-              -32},{-90,-32},{-90,-38},{100,-38}},
-          color={28,108,200},
-          thickness=0.5),
-        Text(
-          extent={{-80,60},{72,12}},
-          lineColor={28,108,200},
-          textString="HEI")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{100,-86},{100,100},{-100,100},{-100,-86},{100,-86}},
-          lineColor={28,108,200},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
-              -32},{-90,-32},{-90,-38},{100,-38}},
-          color={28,108,200},
-          thickness=0.5),
-        Polygon(
-          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillPattern=FillPattern.Sphere,
-          fillColor={191,0,0}),
-        Line(
-          points={{0,8},{0,-70}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{-100,8},{100,8}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-80,84},{72,36}},
-          lineColor={28,108,200},
-          textString="HEI")}),
-    Window(
-      x=0.09,
-      y=0.08,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StaticCondenserHEI;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model StaticCondenserHEI "HEI Static condenser"
+
+  parameter Real Kf=0 "Friction pressure loss coefficient for the cold side";
+  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
+  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
+  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
+  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
+  parameter Real Ucorr=1.00
+    "Corrective term for the heat transfert coefficient (U) for calibration";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot side";
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold side";
+  parameter Integer modec=0
+    "IF97 region of the water for the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer modecs=0
+    "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer modef=0
+    "IF97 region of the water for the cold side. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer Tube_Material1=1 "Material of the tubes type 1. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material2=1 "Material of the tubes type 2. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material3=1 "Material of the tubes type 3. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material4=1 "Material of the tubes type 4. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material5=1 "Material of the tubes type 5. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Integer Tube_Material6=1 "Material of the tubes type 6. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel 
+    - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) 
+    - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)";
+  parameter Real nb_pass=2 "number of water passes";
+  parameter Real nb_tube1=12000
+    "Number of tubes type 1. For exemple tubes of the condensing zone";
+  parameter Real nb_tube2=900
+    "Number of tubes type 2. For exemple gaz removal tubes";
+  parameter Real nb_tube3=700
+    "Number of tubes type 3. For exemple impingement tubes";
+  parameter Real nb_tube4=200 "Number of tubes type 4";
+  parameter Real nb_tube5=200 "Number of tubes type 5";
+  parameter Real nb_tube6=200 "Number of tubes type 6";
+  parameter Units.SI.Thickness e_tube1=0.7e-3 "Tubes thickness type 1";
+  parameter Units.SI.Thickness e_tube2=0.7e-3 "Tubes thickness type 2";
+  parameter Units.SI.Thickness e_tube3=1e-3 "Tubes thickness type 3";
+  parameter Units.SI.Thickness e_tube4=1e-3 "Tubes thickness type 4";
+  parameter Units.SI.Thickness e_tube5=1e-3 "Tubes thickness type 5";
+  parameter Units.SI.Thickness e_tube6=1e-3 "Tubes thickness type 6";
+  parameter Units.SI.Diameter D_tube1=25.4e-3
+    "External diameter of tubes type 1";
+  parameter Units.SI.Diameter D_tube2=25.4e-3
+    "External diameter of tubes type 2";
+  parameter Units.SI.Diameter D_tube3=25.4e-3
+    "External diameter of tubes type 3";
+  parameter Units.SI.Diameter D_tube4=25.4e-3
+    "External diameter of tubes type 4";
+  parameter Units.SI.Diameter D_tube5=25.4e-3
+    "External diameter of tubes type 5";
+  parameter Units.SI.Diameter D_tube6=25.4e-3
+    "External diameter of tubes type 6";
+  parameter Units.SI.Length L_tube1=10 "Tubes length type 1";
+  parameter Units.SI.Length L_tube2=10 "Tubes length type 2";
+  parameter Units.SI.Length L_tube3=10 "Tubes length type 3";
+  parameter Units.SI.Length L_tube4=10 "Tubes length type 4";
+  parameter Units.SI.Length L_tube5=10 "Tubes length type 5";
+  parameter Units.SI.Length L_tube6=10 "Tubes length type 6";
+  parameter Real FC=0.95 "Correction factor for cleanless";
+
+  parameter Units.SI.Pressure Poffset=0
+    "Offset applied on the pressure provided by HEI";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+  Units.SI.Diameter D_tubes "Weight average diameter of tubes";
+  Units.SI.Thickness e_tubes "Weight average thickness of tubes";
+  Units.SI.Area S_pass(start=3) "Passage section of cold water";
+  Units.SI.Area S_ech1(start=10000) "Heat exchange surface tubes type 1";
+  Units.SI.Area S_ech2(start=10000) "Heat exchange surface tubes type 2";
+  Units.SI.Area S_ech3(start=10000) "Heat exchange surface tubes type 3";
+  Units.SI.Area S_ech4(start=10000) "Heat exchange surface tubes type 4";
+  Units.SI.Area S_ech5(start=10000) "Heat exchange surface tubes type 5";
+  Units.SI.Area S_ech6(start=10000) "Heat exchange surface tubes type 6";
+  Real FM1 "Correction factor for material and gauge tubes type 1";
+  Real FM2 "Correction factor for material and gauge tubes type 2";
+  Real FM3 "Correction factor for material and gauge tubes type 3";
+  Real FM4 "Correction factor for material and gauge tubes type 4";
+  Real FM5 "Correction factor for material and gauge tubes type 5";
+  Real FM6 "Correction factor for material and gauge tubes type 6";
+
+public
+  Units.SI.Power W(start=1e6)
+    "Power exchanged from the hot side to the cold side";
+  Units.SI.Temperature Tec(start=500)
+    "Fluid temperature at the inlet of the hot side";
+  Units.SI.Temperature Tsc(start=400)
+    "Fluid temperature at the outlet of the hot side";
+  Units.SI.Temperature Tef(start=350)
+    "Fluid temperature at the inlet of the cold side";
+  Units.SI.Temperature Tsf(start=350)
+    "Fluid temperature at the outlet of the cold side";
+  Units.SI.Pressure DPgc(start=1e2) "Gravity pressure loss in the hot side";
+  Units.SI.Pressure DPff(start=1e3) "Friction pressure loss in the cold side";
+  Units.SI.Pressure DPgf(start=1e2) "Gravity pressure loss in the cold side";
+  Units.SI.Pressure DPf(start=1e3) "Total pressure loss in the cold side";
+  Units.SI.Density rhof(start=998) "Density of the fluid in the cold side";
+  Units.SI.Density rho_ex(start=950) "Water density at the extraction point";
+
+  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+  Units.SI.Area S_ech(start=10000) "Heat exchange surface";
+  Units.SI.Velocity Vf "Velocity of cold water";
+  Real Fw "Correction factor for water";
+  Units.SI.CoefficientOfHeatTransfer U1
+    "Uncorrected heat transfert coefficient";
+  Real FM "Overall correction factor for material and gauge";
+  Units.SI.CoefficientOfHeatTransfer U "Heat transfert coefficient";
+  Units.SI.Temperature Tcut_off "Saturation temperature at pressure cut off";
+  Units.SI.Pressure Psat_att(start=6000) "Expected saturation pressure HEI";
+  Units.SI.Pressure Pcut_off "Pressure cut off";
+  Units.SI.Pressure Pzero_load "Pressure zero load";
+  Units.SI.Pressure Pcond(start=6000)
+    "Expected corrected saturation pressure HEI";
+  Units.SI.Temperature Tsat(start=310)
+    "Expected corrected saturation temperature HEI";
+  Units.SI.Power Wcut_off(start=5e5)
+    "Power exchanged from the hot side to the cold side at Pcut_off";
+  Units.SI.Temperature TTD "Terminal Temperature Difference";
+  Integer HEI "Applicabiltity of the standards HEI. 0:NO - 1:OK";
+  Units.SI.Temperature Tsat_att(start=310)
+    "Expected saturation temperature HEI";
+  Units.SI.SpecificHeatCapacity Cpmf(start=950)
+    "Average of specific heat capacity of cold water";
+  Units.SI.SpecificEnthalpy Hmv(start=2500000)
+    "Fluid input average specific enthalpy";
+  Units.SI.SpecificEnthalpy Hml(start=100000)
+    "Extraction water average specific enthalpy";
+  Units.SI.SpecificEnthalpy Hex(start=100000)
+    "Drain specific enthalpy at the outlet";
+
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cee "Cooling water inlet"
+    annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cse "Cooling water outlet"
+    annotation (Placement(transformation(extent={{90,-72},{114,-50}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutlet Cex "Extraction water"
+    annotation (Placement(transformation(extent={{-12,-114},{14,-90}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cvt "Turbine outlet"
+    annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cep "Drain inlet"
+    annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
+public
+  ThermoSysPro.WaterSteam.Connectors.FluidInlet Cev "Vapor inlet"
+    annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation=
+            0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
+    "Proprietes eau"
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+equation
+  // Water/steam cavity
+  //-------------------
+
+  /* Unconnected connectors */
+  if (cardinality(Cev) == 0) then
+    Cev.Q = 0;
+    Cev.h = 1.e5;
+    Cev.b = true;
+  end if;
+
+  if (cardinality(Cep) == 0) then
+    Cep.Q = 0;
+    Cep.h = 1.e5;
+    Cep.b = true;
+  end if;
+
+  /* Fluid pressure */
+  Pcond = Cep.P;
+  Pcond = Cev.P;
+  Pcond = Cvt.P;
+
+  /* Extraction water pressure */
+  Cex.P = Pcond + rho_ex*g*(z2c-z1c);
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Hmv = Cvt.h_vol;
+  Hmv = Cep.h_vol;
+  Hmv = Cev.h_vol;
+  Hex = Cex.h_vol;
+
+  /* Flows in both sides */
+  Qc = Cex.Q;
+  Cee.Q = Cse.Q;
+  Qf = Cee.Q;
+
+  /* Flow reversal in the cold side */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Qf > Qeps) then Cee.h - Cee.h_vol else if (Qf < -Qeps) then
+        Cse.h - Cse.h_vol else Cee.h - 0.5*((Cee.h_vol - Cse.h_vol)*Modelica.Math.sin(pi
+        *Qf/2/Qeps) + Cee.h_vol + Cse.h_vol));
+  else
+    0 = if (Qf > 0) then Cee.h - Cee.h_vol else Cse.h - Cse.h_vol;
+  end if;
+
+  /* Mixer: mass balance equation */
+  Qc = Cvt.Q + Cep.Q + Cev.Q;
+
+  /* Fluid input average specific enthalpy */
+  Hmv = (Cvt.Q*Cvt.h  + Cep.Q*Cep.h + Cev.Q*Cev.h)/Qc;
+
+  /* Extraction water average specific enthalpy */
+  Hml = (lsat.h + Hex)/2;
+
+  /* Extraction water specific enthalpy */
+  Hex = noEvent(if (rho_ex > 0) then lsat.h + ((Cex.P - Pcond)/rho_ex) else lsat.h);
+
+  /* Input power */
+  W = Cvt.Q*(Cvt.h - lsat.h) + Cep.Q*(Cep.h - lsat.h) + Cev.Q*(Cev.h - lsat.h);
+
+  /* Power exchanged between the two sides */
+  W = Qf*(Cse.h - Cee.h);
+
+  /* Gravity pressure losses in the hot side */
+  DPgc = rho_ex*g*(z2c - z1c);
+
+  /* Pressure losses in the cold side */
+  Cee.P - Cse.P = DPf;
+
+  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
+  DPgf = rhof*g*(z2f - z1f);
+  DPf  = DPff + DPgf;
+
+  /* Fluid thermodynamic properties in the hot side */
+  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cvt.P, Hmv, modec);
+  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cex.P, Cex.h, modecs);
+  //procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pcond + Cex.P)/2, (lsat.h + Cex.h)/2, modecs);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Pcond);
+
+  if (p_rhoc > 0) then
+    rho_ex = p_rhoc;
+  else
+    rho_ex = procs.d;
+  end if;
+
+  /* Fluid thermodynamic properties in the cold side */
+  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cee.P, Cee.h, modef);
+  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cse.P, Cse.h, modef);
+  promf = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Cee.P + Cse.P)/2, (Cee.h + Cse.h)/2, modef);
+
+  Tef = profe.T;
+  Tsf = profs.T;
+
+  if (p_rhof > 0) then
+    rhof = p_rhof;
+  else
+    rhof = promf.d;
+  end if;
+
+  /* Calculation of the heat exchange surface */
+  S_ech1 = pi*D_tube1*L_tube1*nb_tube1;
+  S_ech2 = pi*D_tube2*L_tube2*nb_tube2;
+  S_ech3 = pi*D_tube3*L_tube3*nb_tube3;
+  S_ech4 = pi*D_tube4*L_tube4*nb_tube4;
+  S_ech5 = pi*D_tube5*L_tube5*nb_tube5;
+  S_ech6 = pi*D_tube6*L_tube6*nb_tube6;
+  S_ech = S_ech1 + S_ech2 + S_ech3 + S_ech4 + S_ech5 + S_ech6;
+
+ /* Calculation of the passage section of cold water */
+  S_pass = (D_tube1/2-e_tube1)^2*pi*nb_tube1/nb_pass + (D_tube2/2-e_tube2)^2*pi*nb_tube2/nb_pass + (D_tube3/2-e_tube3)^2*pi*nb_tube3/nb_pass + (D_tube4/2-e_tube4)^2*pi*nb_tube4/nb_pass + (D_tube5/2-e_tube5)^2*pi*nb_tube5/nb_pass +(D_tube6/2-e_tube6)^2*pi*nb_tube6/nb_pass;
+
+  /* Calculation of the velocity of cold water */
+  Vf = Qf/rhof/S_pass;
+
+  /* Calculation of the correction factor for water from the HEI standard 10th édition */
+  Fw = -2.104072e-04*(Tef-273.15)^2 + 1.974994e-02*(Tef-273.15) + 6.639699e-01;
+
+  /* Calculation of weight average diameter of tubes */
+  D_tubes = (D_tube1*nb_tube1 + D_tube2*nb_tube2 + D_tube3*nb_tube3 + D_tube4*nb_tube4 + D_tube5*nb_tube5 + D_tube6*nb_tube6)/(nb_tube1 + nb_tube2 + nb_tube3 + nb_tube4 + nb_tube5 + nb_tube6);
+
+  /* Calculation of the uncorrected heat transfert coefficient from the HEI standard 10th édition */
+  U1 = ThermoSysPro.Correlations.Thermal.Function_U1(D_tubes,Vf);
+
+  /* Calculation of the Weight average thickness of tubes */
+  e_tubes = (e_tube1*nb_tube1+e_tube2*nb_tube2+e_tube3*nb_tube3+e_tube4*nb_tube4+e_tube5*nb_tube5+e_tube6*nb_tube6)/(nb_tube1+nb_tube2+nb_tube3+nb_tube4+nb_tube5+nb_tube6);
+
+  /* Calculation of the Correction factor for material and gauge from the HEI standard 10th édition */
+  FM1 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube1,Tube_Material1);
+  FM2 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube2,Tube_Material2);
+  FM3 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube3,Tube_Material3);
+  FM4 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube4,Tube_Material4);
+  FM5 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube5,Tube_Material5);
+  FM6 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube6,Tube_Material6);
+  FM = (FM1*S_ech1 + FM2*S_ech2 + FM3*S_ech3 + FM4*S_ech4 + FM5*S_ech5 + FM6*S_ech6)/S_ech;
+
+  /* Calculation of the heat transfert coefficient from the HEI standard 10th édition */
+  U = Ucorr*U1*FM*FC*Fw;
+  //U = U1*FM*FC*Fw + Ucorr;
+
+  /* Calculation of Average of specific heat capacity of cold water */
+  Cpmf = promf.cp;
+
+  /* Calculation of Expected saturation temperature HEI */
+  Tsat_att = Tef + (W/(Qf*Cpmf))*(1/(1-Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf))));
+
+  /* Calculation of Expected saturation pressure HEI */
+  Psat_att = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Tsat_att);
+
+  /* Calculation of Pressure cut off HEI */
+  Pcut_off = (5.752433E-04*(Tef-273.15)^3 + 1.735162E-02*(Tef-273.15)^2 + 8.052739E-02*(Tef-273.15) + 2.109159E+01)*100;
+
+  /*Calculation of the saturation Temperature at Pressure cut off HEI */
+  Tcut_off = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Pcut_off);
+
+  /* Calculation of Pressure zero load HEI */
+  Pzero_load = (5.008000E-04*(Tef-273.15)^3 + 2.039549E-02*(Tef-273.15)^2 + 2.277566E-01*(Tef-273.15) + 1.027824E+01)*100;
+
+  /* Calculation of power exchanged from the hot side to the cold side at Pcut_off */
+  Tcut_off = Tef + (Wcut_off/(Qf*Cpmf))*(1/(1-Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf))));
+
+  /* Calculation of Expected corrected saturation pressure HEI */
+  if (Psat_att < Pcut_off) then
+    Pcond = (Pcut_off-Pzero_load)/Wcut_off*W+Pzero_load+Poffset;
+  else
+    Pcond = Psat_att + Poffset;
+  end if;
+
+  /* Calculation of Expected corrected saturation pressure HEI */
+    Tsat = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Pcond);
+
+  /* Calculation of the Terminal Temperature Difference */
+  TTD = Tsat - Tsf;
+
+  /* The standards HEI aren't applicable if the terminal temperature difference is less than 2,78 K */
+  if (TTD > 2.78) then
+    HEI = 1;
+  else
+    HEI = 0;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-22,88},{20,70}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Turbine outlet"),
+        Text(
+          extent={{-82,24},{-52,16}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Drain inlet"),
+        Text(
+          extent={{-24,-52},{26,-72}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Extraction water"),
+        Text(
+          extent={{38,-58},{86,-66}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Cooling water outlet"),
+        Text(
+          extent={{-86,-52},{-32,-74}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Cooling water inlet"),
+        Text(
+          extent={{-86,66},{-50,54}},
+          lineColor={0,0,0},
+          lineThickness=1,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0},
+          textString=
+               "Vapor inlet"),
+        Line(
+          points={{0,8},{0,-70}},
+          color={0,0,0},
+          thickness=1),
+        Polygon(
+          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{-100,8},{100,8}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(
+          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
+              -32},{-90,-32},{-90,-38},{100,-38}},
+          color={28,108,200},
+          thickness=0.5),
+        Text(
+          extent={{-80,60},{72,12}},
+          lineColor={28,108,200},
+          textString="HEI")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{100,-86},{100,100},{-100,100},{-100,-86},{100,-86}},
+          lineColor={28,108,200},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80,
+              -32},{-90,-32},{-90,-38},{100,-38}},
+          color={28,108,200},
+          thickness=0.5),
+        Polygon(
+          points={{0,-90},{-11,-70},{11,-70},{0,-90}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillPattern=FillPattern.Sphere,
+          fillColor={191,0,0}),
+        Line(
+          points={{0,8},{0,-70}},
+          color={0,0,0},
+          thickness=1),
+        Line(
+          points={{-100,8},{100,8}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-80,84},{72,36}},
+          lineColor={28,108,200},
+          textString="HEI")}),
+    Window(
+      x=0.09,
+      y=0.08,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StaticCondenserHEI;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/StaticWaterWaterExchanger.mo b/ThermoSysPro/WaterSteam/HeatExchangers/StaticWaterWaterExchanger.mo
index e1a4ec3ab0afce630b08bec895e2f342c48f95d9..dfd98c7871b0b976dc00d3fd4d43f79722cea3f4 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/StaticWaterWaterExchanger.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/StaticWaterWaterExchanger.mo
@@ -1,292 +1,292 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model StaticWaterWaterExchanger "Static plate heat exchanger"
-  parameter Units.SI.ThermalConductivity lambdam=15.0
-    "Metal thermal conductivity";
-  parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000
-    "Heat transfer coefficient for the hot side if not computed by the correlations";
-  parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000
-    "Heat transfer coefficient for the cold side if not computed by the correlations";
-  parameter Real p_Kc=100
-    "Pressure loss coefficient for the hot side if not computed by the correlations";
-  parameter Real p_Kf=100
-    "Pressure loss coefficient for the cold side if not computed by the correlations";
-  parameter Units.SI.Thickness emetal=0.0006 "Wall thickness";
-  parameter Units.SI.Area Sp=2 "Plate area";
-  parameter Real nbp=499 "Number of plates";
-  parameter Real c1=1.12647 "Correction coefficient";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot fluid";
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold fluid";
-  parameter Integer modec=0
-    "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer modef=0
-    "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-  parameter Integer exchanger_type=1
-    "Exchanger type - 1: countercurrent. 2: cocurrent";
-  parameter Integer heat_exchange_correlation=1
-    "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations";
-  parameter Integer pressure_loss_correlation=1
-    "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations";
-
-public
-  Units.SI.Power W "Thermal power exchanged between the two sides";
-  ThermoSysPro.Units.SI.PressureDifference DPc
-    "Pressure loss of the hot fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPf
-    "Pressure loss of the cold fluid";
-  Units.SI.CoefficientOfHeatTransfer hc
-    "Heat transfer coefficient of the hot fluid";
-  Units.SI.CoefficientOfHeatTransfer hf
-    "Heat transfer coefficient of the cold fluid";
-  Units.SI.CoefficientOfHeatTransfer K "Global heat transfer coefficient";
-  Units.SI.Area S "Heat exchange surface";
-  Units.SI.Temperature Tec "Fluid temperature at the hot inlet";
-  Units.SI.Temperature Tsc "Fluid temperature at the hot outlet";
-  Units.SI.Temperature Tef "Fluid temperature at the cold inlet";
-  Units.SI.Temperature Tsf "Fluid temperature at the cold outlet";
-  ThermoSysPro.Units.SI.TemperatureDifference DTm
-    "Difference in average temperature";
-  ThermoSysPro.Units.SI.TemperatureDifference DT1
-    "Temperature difference at the inlet of the exchanger";
-  ThermoSysPro.Units.SI.TemperatureDifference DT2
-    "Temperature difference at the outlet of the exchanger";
-  Real DT12 "DT1/DT2 (s.u.)";
-  Units.SI.MassFlowRate Qc(start=500) "Mass flow rate of the hot fluid";
-  Units.SI.MassFlowRate Qf(start=500) "Mass flow rate of the cold fluid";
-  Real qmc;
-  Real qmf;
-  Real quc;
-  Real quf;
-  Real N;
-  Units.SI.Density rhoc(start=998) "Hot fluid density";
-  Units.SI.Density rhof(start=998) "Cold fluid density";
-  Units.SI.DynamicViscosity muc(start=1.e-3) "Hot fluid dynamic viscosity";
-  Units.SI.DynamicViscosity muf(start=1.e-3) "Cold fluid dynamic viscosity";
-  Units.SI.ThermalConductivity lambdac(start=0.602698)
-    "Hot fluid thermal conductivity";
-  Units.SI.ThermalConductivity lambdaf(start=0.597928)
-    "Cold fluid thermal conductivity";
-  Units.SI.Temperature Tmc(start=290) "Hot fluid average temperature";
-  Units.SI.Temperature Tmf(start=290) "Cold fluid average temperature";
-  Units.SI.AbsolutePressure Pmc(start=1.e5) "Hot fluid average pressure";
-  Units.SI.AbsolutePressure Pmf(start=1.e5) "Cold fluid average pressure";
-  Units.SI.SpecificEnthalpy Hmc(start=100000)
-    "Hot fluid average specific enthalpy";
-  Units.SI.SpecificEnthalpy Hmf(start=100000)
-    "Cold fluid average specific enthalpy";
-
-public
-  Connectors.FluidInlet Ec
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidInlet Ef
-                          annotation (Placement(transformation(extent={{-60,-70},
-            {-40,-50}}, rotation=0)));
-  Connectors.FluidOutlet Sf
-                          annotation (Placement(transformation(extent={{40,-70},
-            {60,-50}}, rotation=0)));
-  Connectors.FluidOutlet Sc
-                          annotation (Placement(transformation(extent={{90,-8},
-            {110,12}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    annotation (Placement(transformation(extent={{-20,-100},{0,-80}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prof
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-equation
-
-  /* Mass flow rates */
-  Ec.Q = Sc.Q;
-  Ef.Q = Sf.Q;
-
-  Qc = Ec.Q;
-  Qf = Ef.Q;
-
-  /* Pressures */
-  Sc.P = if Qc > 0 then Ec.P - DPc else Ec.P + DPc;
-  Sf.P = if Qf > 0 then Ef.P - DPf else Ef.P + DPf;
-
-  /* Flow reversal */
-  0 = if (Qc > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
-  0 = if (Qf > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
-
-  /* Heat exchanges between the hot and cold fluids */
-  K = hc*hf/(hc + hf + hc*hf*emetal/lambdam);
-  W = K*S*DTm;
-
-  if (abs(Qc) > 1.e-3) then
-    W = Qc*proc.cp*(Tec - Tsc);
-  else
-    Tec = Tsc;
-  end if;
-
-  if (abs(Qf) > 1.e-3) then
-    W = Qf*prof.cp*(Tsf - Tef);
-  else
-    Tef = Tsf;
-  end if;
-
-  /* Difference in average temperatures */
-  if noEvent(((DT1 > DT2) and (DT2 > 0)) or ((DT1 < DT2) and (DT2 < 0))) then
-    DTm = (DT1 - DT2)/Modelica.Math.log(DT1/DT2);
-  else
-    DTm = (DT1 + DT2)/2;
-  end if;
-
-  if (exchanger_type == 1) then
-    /* Counter-current heat exchanger */
-    DT1 = Tec - Tsf;
-    DT2 = Tsc - Tef;
-  elseif (exchanger_type == 2) then
-    /* Co-current heat exchanger */
-    DT1 = Tec - Tef;
-    DT2 = Tsc - Tsf;
-  else
-    DT1 = 0;
-    DT2 = 0;
-    assert(false, "StaticWaterWaterExchanger: incorrect exchanger type");
-  end if;
-
-  DT12 = if noEvent(abs(DT2) > Modelica.Constants.eps) then DT1/DT2 else 0;
-
-  /* Heat exchange area (for the plate heat exchanger) */
-  S = (nbp - 2)*Sp;
-  N = (nbp - 1)/2;
-
-  /* Heat exchange coefficients */
-  qmc = noEvent(abs(Qc)/(muc*N));
-  qmf = noEvent(abs(Qf)/(muf*N));
-
-  if (heat_exchange_correlation == 0) then
-    hc = p_hc;
-    hf = p_hf;
-  elseif (heat_exchange_correlation == 1) then
-    hc = noEvent(if (qmc < 1.e-3) then 0 else 11.245*qmc^0.8*abs(muc*proc.cp/
-      lambdac)^0.4*lambdac);
-    hf = noEvent(if (qmf < 1.e-3) then 0 else 11.245*qmf^0.8*abs(muf*prof.cp/
-      lambdaf)^0.4*lambdaf);
-  else
-    hc = 0;
-    hf = 0;
-    assert(false, "StaticWaterWaterExchanger: incorrect heat exchange correlation number");
-  end if;
-
-  /* Pressure losses */
-  quc = noEvent(abs(Qc)/N);
-  quf = noEvent(abs(Qf)/N);
-
-  if (pressure_loss_correlation == 0) then
-      DPc = p_Kc*Qc^2/rhoc;
-      DPf = p_Kf*Qf^2/rhof;
-  elseif (pressure_loss_correlation == 1) then
-    DPc = noEvent(if (qmc < 1.e-3) then 0 else c1*14423.2/rhoc*qmc^(-0.097)*quc
-      ^2*(1472.47 + 1.54*(N - 1)/2 + 104.97*qmc^(-0.25)));
-    DPf = noEvent(if (qmf < 1.e-3) then 0 else 14423.2/rhof*qmf^(-0.097)*quf^2*
-      (1472.47 + 1.54*(N - 1)/2 + 104.97*qmf^(-0.25)));
-  else
-    DPc = 0;
-    DPf = 0;
-    assert(false,
-      "StaticWaterWaterExchanger: incorrect pressure loss correlation number");
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pmc = (Ec.P + Sc.P)/2;
-  Pmf = (Ef.P + Sf.P)/2;
-  Hmc = (Ec.h + Sc.h)/2;
-  Hmf = (Ef.h + Sf.h)/2;
-
-  proc = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmc, Hmc, modec);
-  prof = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmf, Hmf, modef);
-
-  Tmc = proc.T;
-  Tmf = prof.T;
-
-  if (p_rhoc > 0) then
-    rhoc = p_rhoc;
-  else
-    rhoc = proc.d;
-  end if;
-
-  if (p_rhof > 0) then
-    rhof = p_rhof;
-  else
-    rhof = prof.d;
-  end if;
-
-  muc = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhoc, Tmc);
-  muf = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhof, Tmf);
-
-  lambdac = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhoc, Tmc, Pmc);
-  lambdaf = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhof, Tmf, Pmf);
-
-  /* Calcul des températures en entrée et en sortie de l'échangeur */
-  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, modec);
-  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, modec);
-
-  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, modef);
-  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, modef);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-  Tef = profe.T;
-  Tsf = profs.T;
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,60},{-80,-60}}),
-        Line(points={{80,60},{80,-60}}),
-        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={0,
-              0,255})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,60},{-80,-60}}),
-        Line(points={{80,60},{80,-60}}),
-        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={0,
-              0,255})}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2021</h4>
-<p><b>ThermoSysPro Version 4.0</h4>
-<p>This component model is documented in Sect. 9.6.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end StaticWaterWaterExchanger;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model StaticWaterWaterExchanger "Static plate heat exchanger"
+  parameter Units.SI.ThermalConductivity lambdam=15.0
+    "Metal thermal conductivity";
+  parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000
+    "Heat transfer coefficient for the hot side if not computed by the correlations";
+  parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000
+    "Heat transfer coefficient for the cold side if not computed by the correlations";
+  parameter Real p_Kc=100
+    "Pressure loss coefficient for the hot side if not computed by the correlations";
+  parameter Real p_Kf=100
+    "Pressure loss coefficient for the cold side if not computed by the correlations";
+  parameter Units.SI.Thickness emetal=0.0006 "Wall thickness";
+  parameter Units.SI.Area Sp=2 "Plate area";
+  parameter Real nbp=499 "Number of plates";
+  parameter Real c1=1.12647 "Correction coefficient";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot fluid";
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold fluid";
+  parameter Integer modec=0
+    "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer modef=0
+    "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+  parameter Integer exchanger_type=1
+    "Exchanger type - 1: countercurrent. 2: cocurrent";
+  parameter Integer heat_exchange_correlation=1
+    "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations";
+  parameter Integer pressure_loss_correlation=1
+    "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations";
+
+public
+  Units.SI.Power W "Thermal power exchanged between the two sides";
+  ThermoSysPro.Units.SI.PressureDifference DPc
+    "Pressure loss of the hot fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPf
+    "Pressure loss of the cold fluid";
+  Units.SI.CoefficientOfHeatTransfer hc
+    "Heat transfer coefficient of the hot fluid";
+  Units.SI.CoefficientOfHeatTransfer hf
+    "Heat transfer coefficient of the cold fluid";
+  Units.SI.CoefficientOfHeatTransfer K "Global heat transfer coefficient";
+  Units.SI.Area S "Heat exchange surface";
+  Units.SI.Temperature Tec "Fluid temperature at the hot inlet";
+  Units.SI.Temperature Tsc "Fluid temperature at the hot outlet";
+  Units.SI.Temperature Tef "Fluid temperature at the cold inlet";
+  Units.SI.Temperature Tsf "Fluid temperature at the cold outlet";
+  ThermoSysPro.Units.SI.TemperatureDifference DTm
+    "Difference in average temperature";
+  ThermoSysPro.Units.SI.TemperatureDifference DT1
+    "Temperature difference at the inlet of the exchanger";
+  ThermoSysPro.Units.SI.TemperatureDifference DT2
+    "Temperature difference at the outlet of the exchanger";
+  Real DT12 "DT1/DT2 (s.u.)";
+  Units.SI.MassFlowRate Qc(start=500) "Mass flow rate of the hot fluid";
+  Units.SI.MassFlowRate Qf(start=500) "Mass flow rate of the cold fluid";
+  Real qmc;
+  Real qmf;
+  Real quc;
+  Real quf;
+  Real N;
+  Units.SI.Density rhoc(start=998) "Hot fluid density";
+  Units.SI.Density rhof(start=998) "Cold fluid density";
+  Units.SI.DynamicViscosity muc(start=1.e-3) "Hot fluid dynamic viscosity";
+  Units.SI.DynamicViscosity muf(start=1.e-3) "Cold fluid dynamic viscosity";
+  Units.SI.ThermalConductivity lambdac(start=0.602698)
+    "Hot fluid thermal conductivity";
+  Units.SI.ThermalConductivity lambdaf(start=0.597928)
+    "Cold fluid thermal conductivity";
+  Units.SI.Temperature Tmc(start=290) "Hot fluid average temperature";
+  Units.SI.Temperature Tmf(start=290) "Cold fluid average temperature";
+  Units.SI.AbsolutePressure Pmc(start=1.e5) "Hot fluid average pressure";
+  Units.SI.AbsolutePressure Pmf(start=1.e5) "Cold fluid average pressure";
+  Units.SI.SpecificEnthalpy Hmc(start=100000)
+    "Hot fluid average specific enthalpy";
+  Units.SI.SpecificEnthalpy Hmf(start=100000)
+    "Cold fluid average specific enthalpy";
+
+public
+  Connectors.FluidInlet Ec
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidInlet Ef
+                          annotation (Placement(transformation(extent={{-60,-70},
+            {-40,-50}}, rotation=0)));
+  Connectors.FluidOutlet Sf
+                          annotation (Placement(transformation(extent={{40,-70},
+            {60,-50}}, rotation=0)));
+  Connectors.FluidOutlet Sc
+                          annotation (Placement(transformation(extent={{90,-8},
+            {110,12}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    annotation (Placement(transformation(extent={{-60,-100},{-40,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    annotation (Placement(transformation(extent={{-20,-100},{0,-80}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prof
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+equation
+
+  /* Mass flow rates */
+  Ec.Q = Sc.Q;
+  Ef.Q = Sf.Q;
+
+  Qc = Ec.Q;
+  Qf = Ef.Q;
+
+  /* Pressures */
+  Sc.P = if Qc > 0 then Ec.P - DPc else Ec.P + DPc;
+  Sf.P = if Qf > 0 then Ef.P - DPf else Ef.P + DPf;
+
+  /* Flow reversal */
+  0 = if (Qc > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
+  0 = if (Qf > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
+
+  /* Heat exchanges between the hot and cold fluids */
+  K = hc*hf/(hc + hf + hc*hf*emetal/lambdam);
+  W = K*S*DTm;
+
+  if (abs(Qc) > 1.e-3) then
+    W = Qc*proc.cp*(Tec - Tsc);
+  else
+    Tec = Tsc;
+  end if;
+
+  if (abs(Qf) > 1.e-3) then
+    W = Qf*prof.cp*(Tsf - Tef);
+  else
+    Tef = Tsf;
+  end if;
+
+  /* Difference in average temperatures */
+  if noEvent(((DT1 > DT2) and (DT2 > 0)) or ((DT1 < DT2) and (DT2 < 0))) then
+    DTm = (DT1 - DT2)/Modelica.Math.log(DT1/DT2);
+  else
+    DTm = (DT1 + DT2)/2;
+  end if;
+
+  if (exchanger_type == 1) then
+    /* Counter-current heat exchanger */
+    DT1 = Tec - Tsf;
+    DT2 = Tsc - Tef;
+  elseif (exchanger_type == 2) then
+    /* Co-current heat exchanger */
+    DT1 = Tec - Tef;
+    DT2 = Tsc - Tsf;
+  else
+    DT1 = 0;
+    DT2 = 0;
+    assert(false, "StaticWaterWaterExchanger: incorrect exchanger type");
+  end if;
+
+  DT12 = if noEvent(abs(DT2) > Modelica.Constants.eps) then DT1/DT2 else 0;
+
+  /* Heat exchange area (for the plate heat exchanger) */
+  S = (nbp - 2)*Sp;
+  N = (nbp - 1)/2;
+
+  /* Heat exchange coefficients */
+  qmc = noEvent(abs(Qc)/(muc*N));
+  qmf = noEvent(abs(Qf)/(muf*N));
+
+  if (heat_exchange_correlation == 0) then
+    hc = p_hc;
+    hf = p_hf;
+  elseif (heat_exchange_correlation == 1) then
+    hc = noEvent(if (qmc < 1.e-3) then 0 else 11.245*qmc^0.8*abs(muc*proc.cp/
+      lambdac)^0.4*lambdac);
+    hf = noEvent(if (qmf < 1.e-3) then 0 else 11.245*qmf^0.8*abs(muf*prof.cp/
+      lambdaf)^0.4*lambdaf);
+  else
+    hc = 0;
+    hf = 0;
+    assert(false, "StaticWaterWaterExchanger: incorrect heat exchange correlation number");
+  end if;
+
+  /* Pressure losses */
+  quc = noEvent(abs(Qc)/N);
+  quf = noEvent(abs(Qf)/N);
+
+  if (pressure_loss_correlation == 0) then
+      DPc = p_Kc*Qc^2/rhoc;
+      DPf = p_Kf*Qf^2/rhof;
+  elseif (pressure_loss_correlation == 1) then
+    DPc = noEvent(if (qmc < 1.e-3) then 0 else c1*14423.2/rhoc*qmc^(-0.097)*quc
+      ^2*(1472.47 + 1.54*(N - 1)/2 + 104.97*qmc^(-0.25)));
+    DPf = noEvent(if (qmf < 1.e-3) then 0 else 14423.2/rhof*qmf^(-0.097)*quf^2*
+      (1472.47 + 1.54*(N - 1)/2 + 104.97*qmf^(-0.25)));
+  else
+    DPc = 0;
+    DPf = 0;
+    assert(false,
+      "StaticWaterWaterExchanger: incorrect pressure loss correlation number");
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pmc = (Ec.P + Sc.P)/2;
+  Pmf = (Ef.P + Sf.P)/2;
+  Hmc = (Ec.h + Sc.h)/2;
+  Hmf = (Ef.h + Sf.h)/2;
+
+  proc = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmc, Hmc, modec);
+  prof = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pmf, Hmf, modef);
+
+  Tmc = proc.T;
+  Tmf = prof.T;
+
+  if (p_rhoc > 0) then
+    rhoc = p_rhoc;
+  else
+    rhoc = proc.d;
+  end if;
+
+  if (p_rhof > 0) then
+    rhof = p_rhof;
+  else
+    rhof = prof.d;
+  end if;
+
+  muc = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhoc, Tmc);
+  muf = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhof, Tmf);
+
+  lambdac = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhoc, Tmc, Pmc);
+  lambdaf = ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhof, Tmf, Pmf);
+
+  /* Calcul des températures en entrée et en sortie de l'échangeur */
+  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, modec);
+  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, modec);
+
+  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, modef);
+  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, modef);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+  Tef = profe.T;
+  Tsf = profs.T;
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,60},{-80,-60}}),
+        Line(points={{80,60},{80,-60}}),
+        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={0,
+              0,255})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,60},{-80,-60}}),
+        Line(points={{80,60},{80,-60}}),
+        Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={0,
+              0,255})}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2021</h4>
+<p><b>ThermoSysPro Version 4.0</h4>
+<p>This component model is documented in Sect. 9.6.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end StaticWaterWaterExchanger;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/StaticWaterWaterExchangerDTorWorEff.mo b/ThermoSysPro/WaterSteam/HeatExchangers/StaticWaterWaterExchangerDTorWorEff.mo
index 5a0f00964fcfd14aefb177d38aa1629872b35c61..bf7fd71c8313503ea574d8d9080f0a452d9db388 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/StaticWaterWaterExchangerDTorWorEff.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/StaticWaterWaterExchangerDTorWorEff.mo
@@ -1,401 +1,401 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model StaticWaterWaterExchangerDTorWorEff
-  "Static water/water heat exchanger with fixed delta temperature, delta power or efficiency"
-  parameter Integer exchanger_type=1
-    "Exchanger type - 1: Delta temperature is fixed - 2: delta power is fixed - 3: efficiency is fixed";
-  parameter ThermoSysPro.Units.SI.TemperatureDifference DTfroid=0
-    "Temperature difference between the cold inlet and the cold outlet (active if exchanger_type=1)";
-  parameter Units.SI.Power DW=0
-    "Power increase on the cold side (active if exchanger_type=2)";
-  parameter Real EffEch=0.9
-    "Thermal exchange efficiency (=W/Wmax) (active if exchanger_type=3)";
-  parameter Real Kc=10 "Pressure loss coefficient for the hot fluid";
-  parameter Real Kf=10 "Pressure loss coefficient for the cold fluid";
-  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
-  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
-  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
-  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Units.SI.Density p_rhoc=0
-    "If > 0, fixed fluid density for the hot fluid";
-  parameter Units.SI.Density p_rhof=0
-    "If > 0, fixed fluid density for the cold fluid";
-  parameter Integer modec=0
-    "IF97 region of the water for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer modecs=0
-    "IF97 region of the water at the outlet of the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer modef=0
-    "IF97 region of the water for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.Power W(start=1e6)
-    "Power exchanged from the hot fluid to the cold fluid";
-  Units.SI.Temperature Tec(start=500)
-    "Fluid temperature at the inlet of the hot side";
-  Units.SI.Temperature Tsc(start=400)
-    "Fluid temperature at the outlet of the hot side";
-  Units.SI.Temperature Tef(start=350)
-    "Fluid temperature at the inlet of the cold side";
-  Units.SI.Temperature Tsf(start=450)
-    "Fluid temperature at the outlet of the cold side";
-  Units.SI.Temperature Tsatsf
-    "Saturation temperature at the outlet of the cold side";
-  ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3)
-    "Friction pressure loss for the hot fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2)
-    "Gravity pressure loss for the hot fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3)
-    "Total pressure loss for the hot fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3)
-    "Friction pressure loss for the cold fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2)
-    "Gravity pressure loss for the cold fluid";
-  ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3)
-    "Total pressure loss for the cold fluid";
-  Units.SI.Density rhoc(start=998) "Hot fluid density";
-  Units.SI.Density rhof(start=998) "Cold fluid density";
-  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
-  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
-
-public
-  Connectors.FluidInlet Ec "Hot inlet"
-                          annotation (Placement(transformation(extent={{-50,31},
-            {-30,51}}, rotation=0)));
-  Connectors.FluidInlet Ef "Cold inlet"
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet Sf "Cold outlet"
-                          annotation (Placement(transformation(extent={{90,-9},
-            {110,11}}, rotation=0)));
-  Connectors.FluidOutlet Sc "Hot outlet"
-                          annotation (Placement(transformation(extent={{30,31},
-            {50,51}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
-    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT profPT
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promc
-    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
-    annotation (Placement(transformation(extent={{40,80},{60,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-equation
-
-  /* Flow reversal for the hot fluid */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Qc > Qeps) then Ec.h - Ec.h_vol else if (Qc < -Qeps) then
-        Sc.h - Sc.h_vol else Ec.h - 0.5*((Ec.h_vol - Sc.h_vol)*Modelica.Math.sin(pi
-        *Qc/2/Qeps) + Ec.h_vol + Sc.h_vol));
-  else
-    0 = if (Qc > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
-  end if;
-
-  /* Flow reversal for the cold fluid */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Qf > Qeps) then Ef.h - Ef.h_vol else if (Qf < -Qeps) then
-        Sf.h - Sf.h_vol else Ef.h - 0.5*((Ef.h_vol - Sf.h_vol)*Modelica.Math.sin(pi
-        *Qf/2/Qeps) + Ef.h_vol + Sf.h_vol));
-  else
-    0 = if (Qf > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
-  end if;
-
-  /* Mass flow rates */
-  Ec.Q = Sc.Q;
-  Qc = Ec.Q;
-
-  Ef.Q = Sf.Q;
-  Qf = Ef.Q;
-
-  /* Power exchanged between the hot and cold fluids */
-  if (exchanger_type == 1) then
-    W = Qf*(Sf.h - Ef.h);
-    W = Qc*(Ec.h - Sc.h);
-
-    Sf.h = profPT.h;
-    Tsf = Tef + DTfroid;
-  elseif (exchanger_type == 2) then
-    W = Qf*(Sf.h - Ef.h);
-
-    DW = Qf*(Sf.h - Ef.h);
-    DW = Qc*(Ec.h - Sc.h);
-
-    Tsf = profs.T;
-  elseif (exchanger_type == 3) then
-    if ((proce.x > 0) and (proce.x < 1) and ((profe.x < 1e-5) or (profe.x > 0.999999))) then
-       W = Qf*profe.cp*EffEch*(Tec - Tef);
-    elseif ((profe.x > 0) and (profe.x < 1)) then
-       W = Qc*proce.cp*EffEch*(Tec - Tef);
-    else
-       W = noEvent(min(Qc*proce.cp, Qf*profe.cp)*EffEch*(Tec - Tef));
-    end if;
-
-    Sf.h = Ef.h + W/Qf;
-    Sc.h = Ec.h - W/Qc;
-
-    Tsf = profs.T;
-  else
-    assert(false, "StaticWaterWaterExchangerDTorWorEff: invalid option");
-  end if;
-
-  /* Pressure losses for the hot fluid */
-  Ec.P - Sc.P = DPc;
-
-  DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
-  DPgc = rhoc*g*(z2c - z1c);
-  DPc  = DPfc + DPgc;
-
-  /* Pressure losses for the cold fluid */
-  Ef.P - Sf.P = DPf;
-
-  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
-  DPgf = rhof*g*(z2f - z1f);
-  DPf  = DPff + DPgf;
-
-  /* Fluid thermodynamic properties for the hot fluid */
-  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, modec);
-  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, modecs);
-  promc = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, modec);
-
-  Tec = proce.T;
-  Tsc = procs.T;
-
-  if (p_rhoc > 0) then
-    rhoc = p_rhoc;
-  else
-    rhoc = promc.d;
-  end if;
-
-  /* Fluid thermodynamic properties for the cold fluid */
-  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, modef);
-  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, modef);
-  promf = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ef.P+Sf.P)/2, (Ef.h + Sf.h)/2, modef);
-
-  Tef = profe.T;
-
-  if (p_rhof > 0) then
-    rhof = p_rhof;
-  else
-    rhof = promf.d;
-  end if;
-
-  /* Fluid thermodynamic properties at the saturation point at the outlet of the cold side */
-  Tsatsf = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Sf.P);
-  profPT = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Sf.P, Tsf, 0);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{38,-31},{102,31}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-102,-31},{-38,31}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-70,31},{70,-31}},
-          lineColor={255,255,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-72,31},{72,31},{72,31}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-72,-31},{72,-31},{72,-31}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{68,-17},{100,-1}},
-          color={0,255,255},
-          thickness=1),
-        Rectangle(
-          extent={{-64,2},{68,2}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-96,5},{-64,21}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{-64,-17},{-64,-7}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{-64,-8},{-64,2}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{68,11},{68,21}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{68,2},{68,12}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{0,31},{0,-23}},
-          color={0,0,0},
-          thickness=0.5),
-        Rectangle(
-          extent={{-64,21},{68,21}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-64,-17},{68,-17}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{0,31},{0,-23}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Text(
-          extent={{-108,28},{-92,22}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "E_Froid"),
-        Text(
-          extent={{96,28},{112,22}},
-          lineColor={0,0,255},
-          fillColor={255,213,170},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "S_Froid"),
-        Ellipse(
-          extent={{38,-31},{102,31}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-102,-31},{-38,31}},
-          lineColor={0,0,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-70,31},{70,-31}},
-          lineColor={255,255,0},
-          lineThickness=0.5,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-72,31},{72,31},{72,31}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-72,-31},{72,-31},{72,-31}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{68,-17},{100,-1}},
-          color={0,255,255},
-          thickness=1),
-        Rectangle(
-          extent={{-64,-15},{68,-17}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-64,2},{68,0}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-64,21},{68,19}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-64,-7},{68,-9}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-96,5},{-64,21}},
-          color={0,255,255},
-          thickness=1),
-        Rectangle(
-          extent={{-64,11},{68,9}},
-          lineColor={0,255,255},
-          lineThickness=1,
-          fillColor={0,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-64,-17},{-64,-7}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{68,-9},{68,1}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{68,10},{68,20}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{-64,1},{-64,11}},
-          color={0,255,255},
-          thickness=1),
-        Line(
-          points={{0,31},{0,-23}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Window(
-      x=0.05,
-      y=0.01,
-      width=0.93,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.0</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end StaticWaterWaterExchangerDTorWorEff;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model StaticWaterWaterExchangerDTorWorEff
+  "Static water/water heat exchanger with fixed delta temperature, delta power or efficiency"
+  parameter Integer exchanger_type=1
+    "Exchanger type - 1: Delta temperature is fixed - 2: delta power is fixed - 3: efficiency is fixed";
+  parameter ThermoSysPro.Units.SI.TemperatureDifference DTfroid=0
+    "Temperature difference between the cold inlet and the cold outlet (active if exchanger_type=1)";
+  parameter Units.SI.Power DW=0
+    "Power increase on the cold side (active if exchanger_type=2)";
+  parameter Real EffEch=0.9
+    "Thermal exchange efficiency (=W/Wmax) (active if exchanger_type=3)";
+  parameter Real Kc=10 "Pressure loss coefficient for the hot fluid";
+  parameter Real Kf=10 "Pressure loss coefficient for the cold fluid";
+  parameter Units.SI.Position z1c=0 "Hot inlet altitude";
+  parameter Units.SI.Position z2c=0 "Hot outlet altitude";
+  parameter Units.SI.Position z1f=0 "Cold inlet altitude";
+  parameter Units.SI.Position z2f=0 "Cold outlet altitude";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Units.SI.Density p_rhoc=0
+    "If > 0, fixed fluid density for the hot fluid";
+  parameter Units.SI.Density p_rhof=0
+    "If > 0, fixed fluid density for the cold fluid";
+  parameter Integer modec=0
+    "IF97 region of the water for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer modecs=0
+    "IF97 region of the water at the outlet of the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer modef=0
+    "IF97 region of the water for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.Power W(start=1e6)
+    "Power exchanged from the hot fluid to the cold fluid";
+  Units.SI.Temperature Tec(start=500)
+    "Fluid temperature at the inlet of the hot side";
+  Units.SI.Temperature Tsc(start=400)
+    "Fluid temperature at the outlet of the hot side";
+  Units.SI.Temperature Tef(start=350)
+    "Fluid temperature at the inlet of the cold side";
+  Units.SI.Temperature Tsf(start=450)
+    "Fluid temperature at the outlet of the cold side";
+  Units.SI.Temperature Tsatsf
+    "Saturation temperature at the outlet of the cold side";
+  ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3)
+    "Friction pressure loss for the hot fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2)
+    "Gravity pressure loss for the hot fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3)
+    "Total pressure loss for the hot fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3)
+    "Friction pressure loss for the cold fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2)
+    "Gravity pressure loss for the cold fluid";
+  ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3)
+    "Total pressure loss for the cold fluid";
+  Units.SI.Density rhoc(start=998) "Hot fluid density";
+  Units.SI.Density rhof(start=998) "Cold fluid density";
+  Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+  Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+
+public
+  Connectors.FluidInlet Ec "Hot inlet"
+                          annotation (Placement(transformation(extent={{-50,31},
+            {-30,51}}, rotation=0)));
+  Connectors.FluidInlet Ef "Cold inlet"
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet Sf "Cold outlet"
+                          annotation (Placement(transformation(extent={{90,-9},
+            {110,11}}, rotation=0)));
+  Connectors.FluidOutlet Sc "Hot outlet"
+                          annotation (Placement(transformation(extent={{30,31},
+            {50,51}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs
+    annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT profPT
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promc
+    annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf
+    annotation (Placement(transformation(extent={{40,80},{60,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+equation
+
+  /* Flow reversal for the hot fluid */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Qc > Qeps) then Ec.h - Ec.h_vol else if (Qc < -Qeps) then
+        Sc.h - Sc.h_vol else Ec.h - 0.5*((Ec.h_vol - Sc.h_vol)*Modelica.Math.sin(pi
+        *Qc/2/Qeps) + Ec.h_vol + Sc.h_vol));
+  else
+    0 = if (Qc > 0) then Ec.h - Ec.h_vol else Sc.h - Sc.h_vol;
+  end if;
+
+  /* Flow reversal for the cold fluid */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Qf > Qeps) then Ef.h - Ef.h_vol else if (Qf < -Qeps) then
+        Sf.h - Sf.h_vol else Ef.h - 0.5*((Ef.h_vol - Sf.h_vol)*Modelica.Math.sin(pi
+        *Qf/2/Qeps) + Ef.h_vol + Sf.h_vol));
+  else
+    0 = if (Qf > 0) then Ef.h - Ef.h_vol else Sf.h - Sf.h_vol;
+  end if;
+
+  /* Mass flow rates */
+  Ec.Q = Sc.Q;
+  Qc = Ec.Q;
+
+  Ef.Q = Sf.Q;
+  Qf = Ef.Q;
+
+  /* Power exchanged between the hot and cold fluids */
+  if (exchanger_type == 1) then
+    W = Qf*(Sf.h - Ef.h);
+    W = Qc*(Ec.h - Sc.h);
+
+    Sf.h = profPT.h;
+    Tsf = Tef + DTfroid;
+  elseif (exchanger_type == 2) then
+    W = Qf*(Sf.h - Ef.h);
+
+    DW = Qf*(Sf.h - Ef.h);
+    DW = Qc*(Ec.h - Sc.h);
+
+    Tsf = profs.T;
+  elseif (exchanger_type == 3) then
+    if ((proce.x > 0) and (proce.x < 1) and ((profe.x < 1e-5) or (profe.x > 0.999999))) then
+       W = Qf*profe.cp*EffEch*(Tec - Tef);
+    elseif ((profe.x > 0) and (profe.x < 1)) then
+       W = Qc*proce.cp*EffEch*(Tec - Tef);
+    else
+       W = noEvent(min(Qc*proce.cp, Qf*profe.cp)*EffEch*(Tec - Tef));
+    end if;
+
+    Sf.h = Ef.h + W/Qf;
+    Sc.h = Ec.h - W/Qc;
+
+    Tsf = profs.T;
+  else
+    assert(false, "StaticWaterWaterExchangerDTorWorEff: invalid option");
+  end if;
+
+  /* Pressure losses for the hot fluid */
+  Ec.P - Sc.P = DPc;
+
+  DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc;
+  DPgc = rhoc*g*(z2c - z1c);
+  DPc  = DPfc + DPgc;
+
+  /* Pressure losses for the cold fluid */
+  Ef.P - Sf.P = DPf;
+
+  DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
+  DPgf = rhof*g*(z2f - z1f);
+  DPf  = DPff + DPgf;
+
+  /* Fluid thermodynamic properties for the hot fluid */
+  proce = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ec.P, Ec.h, modec);
+  procs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sc.P, Sc.h, modecs);
+  promc = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, modec);
+
+  Tec = proce.T;
+  Tsc = procs.T;
+
+  if (p_rhoc > 0) then
+    rhoc = p_rhoc;
+  else
+    rhoc = promc.d;
+  end if;
+
+  /* Fluid thermodynamic properties for the cold fluid */
+  profe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ef.P, Ef.h, modef);
+  profs = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Sf.P, Sf.h, modef);
+  promf = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Ef.P+Sf.P)/2, (Ef.h + Sf.h)/2, modef);
+
+  Tef = profe.T;
+
+  if (p_rhof > 0) then
+    rhof = p_rhof;
+  else
+    rhof = promf.d;
+  end if;
+
+  /* Fluid thermodynamic properties at the saturation point at the outlet of the cold side */
+  Tsatsf = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(Sf.P);
+  profPT = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Sf.P, Tsf, 0);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{38,-31},{102,31}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-102,-31},{-38,31}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-70,31},{70,-31}},
+          lineColor={255,255,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-72,31},{72,31},{72,31}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-72,-31},{72,-31},{72,-31}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{68,-17},{100,-1}},
+          color={0,255,255},
+          thickness=1),
+        Rectangle(
+          extent={{-64,2},{68,2}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-96,5},{-64,21}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{-64,-17},{-64,-7}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{-64,-8},{-64,2}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{68,11},{68,21}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{68,2},{68,12}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{0,31},{0,-23}},
+          color={0,0,0},
+          thickness=0.5),
+        Rectangle(
+          extent={{-64,21},{68,21}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-64,-17},{68,-17}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{0,31},{0,-23}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Text(
+          extent={{-108,28},{-92,22}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "E_Froid"),
+        Text(
+          extent={{96,28},{112,22}},
+          lineColor={0,0,255},
+          fillColor={255,213,170},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "S_Froid"),
+        Ellipse(
+          extent={{38,-31},{102,31}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-102,-31},{-38,31}},
+          lineColor={0,0,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-70,31},{70,-31}},
+          lineColor={255,255,0},
+          lineThickness=0.5,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-72,31},{72,31},{72,31}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{-72,-31},{72,-31},{72,-31}},
+          color={0,0,0},
+          thickness=0.5),
+        Line(
+          points={{68,-17},{100,-1}},
+          color={0,255,255},
+          thickness=1),
+        Rectangle(
+          extent={{-64,-15},{68,-17}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-64,2},{68,0}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-64,21},{68,19}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-64,-7},{68,-9}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-96,5},{-64,21}},
+          color={0,255,255},
+          thickness=1),
+        Rectangle(
+          extent={{-64,11},{68,9}},
+          lineColor={0,255,255},
+          lineThickness=1,
+          fillColor={0,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-64,-17},{-64,-7}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{68,-9},{68,1}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{68,10},{68,20}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{-64,1},{-64,11}},
+          color={0,255,255},
+          thickness=1),
+        Line(
+          points={{0,31},{0,-23}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Window(
+      x=0.05,
+      y=0.01,
+      width=0.93,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.0</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end StaticWaterWaterExchangerDTorWorEff;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_1SG.mo b/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_1SG.mo
index 7abce3e3a1cf9af383dc176d24cbf503876e1045..42178587648228bd3e40ea3b6959d999dd4c4e26 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_1SG.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_1SG.mo
@@ -1,310 +1,310 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model SteamGenerator_1SG "Individual steam generator"
-  parameter Real H0_Mix_AlimDomeGV=1194812.89980521;
-
-public
-  DynamicOnePhaseFlowPipe UtubeHotLeg(
-    option_temperature=2,
-    mode=0,
-    steady_state=true,
-    L=10.848,
-    D=0.01687,
-    z2=10.848,
-    P(start={15548026.5769975,15539261.5405584,15513354.8857262,
-          15479081.1128903,15444819.5699875,15410560.6427763,15395560}),
-    h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393,
-          1346263.00297153,1326153.46646787,1326153}),
-    Tp(start={564,562,560,559,568}),
-    Ns=5,
-    inertia=false,
-    dpfCorr=0.17,
-    hcCorr=5,
-    ntubes=5340)
-    annotation (Placement(transformation(
-        origin={-67,-41.5},
-        extent={{30.5,-15},{-30.5,15}},
-        rotation=270)));
-  DynamicOnePhaseFlowPipe UtubeColdtLeg(
-    option_temperature=2,
-    mode=0,
-    steady_state=true,
-    L=10.848,
-    D=0.01687,
-    P(start={15393431.1040249,15393244.2635501,15392971.9441869,
-          15392877.0660053,15392915.6467518,15393000.8344321,15393020}),
-    h(start={1326153.46646787,1310848.36111251,1299218.76228131,
-          1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}),
-    Tp(start={584,580,575,571,568}),
-    Ns=5,
-    inertia=false,
-    dpfCorr=0.17,
-    hcCorr=5,
-    z1=10.848,
-    ntubes=5340)
-    annotation (Placement(transformation(
-        origin={67,-41.5},
-        extent={{30.5,-14},{-30.5,14}},
-        rotation=90)));
-  Volumes.DynamicDrum DomeGV(
-    hl(start=1257382.15477056),
-    hv(start=2771260.46625813),
-    steady_state=true,
-    cpp=500,
-    L=8.625,
-    Vf0=0.1,
-    Cd(P(start=67.9e5)),
-    zl(fixed=false, start=0.66),
-    R=4.2818979,
-    Mp=32000)                      annotation (Placement(transformation(extent=
-            {{-22,64},{22,107}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
-    L=1,
-    D=0.95886,
-    lambda=0.03) annotation (Placement(transformation(
-        origin={0,42},
-        extent={{-5,-10},{5,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC MixAlimDomeGV(
-    h0=H0_Mix_AlimDomeGV,
-    steady_state=true,
-    h(start=1194851.37111438),
-    V=0.01,
-    dynamic_mass_balance=false) " "
-    annotation (Placement(transformation(
-        origin={94,63},
-        extent={{-8,-8},{8,8}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
-      K=1e-4)
-    annotation (Placement(transformation(
-        origin={94,88},
-        extent={{-6,-7},{6,7}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
-    p_rho=0,
-    mode=0,
-    C2(P(start=6829391.22090726), Q(fixed=false, start=6643)),
-    K=0.172144)                    annotation (Placement(transformation(extent={{47,53},
-            {57,73}},          rotation=0)));
-  ThermoSysPro.WaterSteam.Sensors.SensorP CapteurPAlim
-    annotation (Placement(transformation(
-        origin={99,30},
-        extent={{-6,-6},{6,6}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI
-    annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet
-    annotation (Placement(transformation(extent={{42,102},{62,122}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet1
-    annotation (Placement(transformation(extent={{-56,-132},{-36,-112}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI1
-    annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
-    annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
-            0)));
-  PressureLosses.LumpedStraightPipe DownComerGV(
-    p_rho=0,
-    h(start=1194851.3),
-    mode=1,
-    z1=10.8,
-    C1(
-      h_vol(start=1.1733e6),
-      h(start=1.1733e6),
-      Q(start=7525.84),
-      P(start=6829391.22090726)),
-    L=10.8,
-    D=0.216,
-    C2(
-      h_vol(start=1.1733e6),
-      Q(start=7525.84),
-      h(start=1.1733e6),
-      P(fixed=false, start=68.4935e5)),
-    lambda=0.08,
-    ntubes=32,
-    Q(start=7525.84/4)) "DownComerGV"
-                     annotation (Placement(transformation(
-        origin={94.5,-41},
-        extent={{-31,16.5},{31,-16.5}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    L=10.848,
-    D=0.01687,
-    e=2.18e-3,
-    lambda=23,
-    cpw=503,
-    rhow=8430,
-    Tp(start={571,568,566,564,562}),
-    Ns=5,
-    ntubes=5340)  annotation (Placement(transformation(
-        origin={-44,-41},
-        extent={{-33,-16},{33,16}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
-    L=10.848,
-    D=0.01687,
-    e=2.18e-3,
-    lambda=23,
-    cpw=503,
-    rhow=8430,
-    Tp(start={563,560,558,557,556}),
-    Ns=5,
-    ntubes=5340)  annotation (Placement(transformation(
-        origin={44,-41},
-        extent={{-33,16},{33,-16}},
-        rotation=270)));
-
-  DynamicTwoPhaseFlowRiser RiserGV(
-    Ns=5,
-    P(start={6866734.60449511,6862203.90250626,6853535.24564075,
-          6846247.08251367,6840314.83135013,6834912.1497303,6828884.49246047}),
-    h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846,
-          1525552.01981793,1595519.78942018,1595519.78863864}),
-    Tp1(start={563.831094899634,562.971714357892,562.213228673834,
-          561.552482471836,560.975882549024}),
-    Tp2(start={563.831094899634,562.971714357892,562.213228673834,
-          561.552482471836,560.975882549024}),
-    D=0.03689,
-    inertia=false,
-    L=10.848,
-    z2=10.848,
-    hcCorr=5,
-    dpfCorr=1,
-    ntubes=5340,
-    Q(start={8600/4,8600/4,8600/4,8600/4,8600/4,8600/4}))
-               annotation (Placement(transformation(
-        origin={-2.5,-41},
-        extent={{-32,31.5},{32,-31.5}},
-        rotation=90)));
-  Volumes.VolumeC volumeA(
-    P0=68.4935e5,
-    h0=1185.2e3,
-    dynamic_mass_balance=true)
-                          annotation (Placement(transformation(
-        origin={1,-90},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  Volumes.VolumeC volumeA1(dynamic_mass_balance=true)
-                           annotation (Placement(transformation(
-        origin={0,18},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line(
-      points={{-67,-11},{-67,-2},{67,-2},{67,-11}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2)
-    annotation (Line(points={{94,71},{94,82}}, thickness=0.5));
-  connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line(
-      points={{57,63},{86,63}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line(
-      points={{94,55},{94.2,36}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(DPnulle_AlimDwnc.C1, fluidInlet)
-    annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}}));
-  connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line(
-      points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line(
-      points={{67,-72},{68,-78},{68,-122},{46,-122}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(CapteurPAlim.C2, DownComerGV.C1)      annotation (Line(
-      points={{94.2,23.88},{94.2,26.44},{94.5,26.44},{94.5,-10}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line(
-      points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}},
-      color={191,95,0},
-      thickness=0.5));
-  connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line(
-      points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}},
-      color={191,95,0},
-      thickness=0.5));
-  connect(DownComerGV.C2, volumeA.Ce1)      annotation (Line(points={{94.5,-72},
-          {94.5,-108},{1,-108},{1,-100}}, color={0,0,255}));
-  connect(volumeA.Cs, RiserGV.C1)
-                                annotation (Line(points={{1,-80},{0.65,-80},{
-          0.65,-73}}, color={0,0,255}));
-  connect(RiserGV.C2, volumeA1.Ce1)
-                                  annotation (Line(points={{0.65,-9},{
-          -6.12303e-016,-9},{-6.12303e-016,8}}, color={0,0,255}));
-  connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{
-          6.12303e-016,28},{-6.12303e-016,28},{-6.12303e-016,37}}, color={0,0,
-          255}));
-  connect(heatExchangerWall.WT2, RiserGV.CTh2)
-                                             annotation (Line(points={{-40.8,
-          -41},{-18.25,-41}}, color={191,95,0}));
-  connect(RiserGV.CTh1, heatExchangerWall1.WT2)
-                                              annotation (Line(points={{19.55,
-          -41},{40.8,-41}}, color={191,95,0}));
-  connect(DomeGV.Cv, fluidOutletI) annotation (Line(points={{22,107},{22,124},{
-          0,124},{0,149}}, color={255,0,0}));
-  connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{
-          6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255}));
-  connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{40,
-          76.9},{40,63},{47,63}},    color={0,0,255}));
-  connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,
-          85.5},{32,128},{-34,128},{-34,96},{-52,96}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-150,-150},{150,150}},
-        initialScale=0.1), graphics={Text(
-          extent={{55,81},{55,75}},
-          lineColor={0,0,255},
-          textString=
-               "petit DP"), Text(
-          extent={{-126,153},{-84,123}},
-          lineColor={0,0,255},
-          textString="= 1 SG")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-150,-150},{150,150}},
-        initialScale=0.1), graphics={
-        Ellipse(
-          extent={{-42,150},{42,108}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={0,128,255}),
-        Rectangle(
-          extent={{-42,131},{42,80}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={0,128,255}),
-        Ellipse(
-          extent={{-36,-108},{36,-150}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={0,128,255}),
-        Rectangle(
-          extent={{-42,86},{42,56}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={170,213,255}),
-        Rectangle(
-          extent={{-36,42},{36,-128}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={170,213,255}),
-        Polygon(
-          points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={170,213,255})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end SteamGenerator_1SG;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model SteamGenerator_1SG "Individual steam generator"
+  parameter Real H0_Mix_AlimDomeGV=1194812.89980521;
+
+public
+  DynamicOnePhaseFlowPipe UtubeHotLeg(
+    option_temperature=2,
+    mode=0,
+    steady_state=true,
+    L=10.848,
+    D=0.01687,
+    z2=10.848,
+    P(start={15548026.5769975,15539261.5405584,15513354.8857262,
+          15479081.1128903,15444819.5699875,15410560.6427763,15395560}),
+    h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393,
+          1346263.00297153,1326153.46646787,1326153}),
+    Tp(start={564,562,560,559,568}),
+    Ns=5,
+    inertia=false,
+    dpfCorr=0.17,
+    hcCorr=5,
+    ntubes=5340)
+    annotation (Placement(transformation(
+        origin={-67,-41.5},
+        extent={{30.5,-15},{-30.5,15}},
+        rotation=270)));
+  DynamicOnePhaseFlowPipe UtubeColdtLeg(
+    option_temperature=2,
+    mode=0,
+    steady_state=true,
+    L=10.848,
+    D=0.01687,
+    P(start={15393431.1040249,15393244.2635501,15392971.9441869,
+          15392877.0660053,15392915.6467518,15393000.8344321,15393020}),
+    h(start={1326153.46646787,1310848.36111251,1299218.76228131,
+          1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}),
+    Tp(start={584,580,575,571,568}),
+    Ns=5,
+    inertia=false,
+    dpfCorr=0.17,
+    hcCorr=5,
+    z1=10.848,
+    ntubes=5340)
+    annotation (Placement(transformation(
+        origin={67,-41.5},
+        extent={{30.5,-14},{-30.5,14}},
+        rotation=90)));
+  Volumes.DynamicDrum DomeGV(
+    hl(start=1257382.15477056),
+    hv(start=2771260.46625813),
+    steady_state=true,
+    cpp=500,
+    L=8.625,
+    Vf0=0.1,
+    Cd(P(start=67.9e5)),
+    zl(fixed=false, start=0.66),
+    R=4.2818979,
+    Mp=32000)                      annotation (Placement(transformation(extent=
+            {{-22,64},{22,107}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
+    L=1,
+    D=0.95886,
+    lambda=0.03) annotation (Placement(transformation(
+        origin={0,42},
+        extent={{-5,-10},{5,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC MixAlimDomeGV(
+    h0=H0_Mix_AlimDomeGV,
+    steady_state=true,
+    h(start=1194851.37111438),
+    V=0.01,
+    dynamic_mass_balance=false) " "
+    annotation (Placement(transformation(
+        origin={94,63},
+        extent={{-8,-8},{8,8}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
+      K=1e-4)
+    annotation (Placement(transformation(
+        origin={94,88},
+        extent={{-6,-7},{6,7}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
+    p_rho=0,
+    mode=0,
+    C2(P(start=6829391.22090726), Q(fixed=false, start=6643)),
+    K=0.172144)                    annotation (Placement(transformation(extent={{47,53},
+            {57,73}},          rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorP CapteurPAlim
+    annotation (Placement(transformation(
+        origin={99,30},
+        extent={{-6,-6},{6,6}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI
+    annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet
+    annotation (Placement(transformation(extent={{42,102},{62,122}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet1
+    annotation (Placement(transformation(extent={{-56,-132},{-36,-112}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI1
+    annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
+    annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
+            0)));
+  PressureLosses.LumpedStraightPipe DownComerGV(
+    p_rho=0,
+    h(start=1194851.3),
+    mode=1,
+    z1=10.8,
+    C1(
+      h_vol(start=1.1733e6),
+      h(start=1.1733e6),
+      Q(start=7525.84),
+      P(start=6829391.22090726)),
+    L=10.8,
+    D=0.216,
+    C2(
+      h_vol(start=1.1733e6),
+      Q(start=7525.84),
+      h(start=1.1733e6),
+      P(fixed=false, start=68.4935e5)),
+    lambda=0.08,
+    ntubes=32,
+    Q(start=7525.84/4)) "DownComerGV"
+                     annotation (Placement(transformation(
+        origin={94.5,-41},
+        extent={{-31,16.5},{31,-16.5}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    Tp(start={571,568,566,564,562}),
+    Ns=5,
+    ntubes=5340)  annotation (Placement(transformation(
+        origin={-44,-41},
+        extent={{-33,-16},{33,16}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    Tp(start={563,560,558,557,556}),
+    Ns=5,
+    ntubes=5340)  annotation (Placement(transformation(
+        origin={44,-41},
+        extent={{-33,16},{33,-16}},
+        rotation=270)));
+
+  DynamicTwoPhaseFlowRiser RiserGV(
+    Ns=5,
+    P(start={6866734.60449511,6862203.90250626,6853535.24564075,
+          6846247.08251367,6840314.83135013,6834912.1497303,6828884.49246047}),
+    h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846,
+          1525552.01981793,1595519.78942018,1595519.78863864}),
+    Tp1(start={563.831094899634,562.971714357892,562.213228673834,
+          561.552482471836,560.975882549024}),
+    Tp2(start={563.831094899634,562.971714357892,562.213228673834,
+          561.552482471836,560.975882549024}),
+    D=0.03689,
+    inertia=false,
+    L=10.848,
+    z2=10.848,
+    hcCorr=5,
+    dpfCorr=1,
+    ntubes=5340,
+    Q(start={8600/4,8600/4,8600/4,8600/4,8600/4,8600/4}))
+               annotation (Placement(transformation(
+        origin={-2.5,-41},
+        extent={{-32,31.5},{32,-31.5}},
+        rotation=90)));
+  Volumes.VolumeC volumeA(
+    P0=68.4935e5,
+    h0=1185.2e3,
+    dynamic_mass_balance=true)
+                          annotation (Placement(transformation(
+        origin={1,-90},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  Volumes.VolumeC volumeA1(dynamic_mass_balance=true)
+                           annotation (Placement(transformation(
+        origin={0,18},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line(
+      points={{-67,-11},{-67,-2},{67,-2},{67,-11}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2)
+    annotation (Line(points={{94,71},{94,82}}, thickness=0.5));
+  connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line(
+      points={{57,63},{86,63}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line(
+      points={{94,55},{94.2,36}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(DPnulle_AlimDwnc.C1, fluidInlet)
+    annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}}));
+  connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line(
+      points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line(
+      points={{67,-72},{68,-78},{68,-122},{46,-122}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(CapteurPAlim.C2, DownComerGV.C1)      annotation (Line(
+      points={{94.2,23.88},{94.2,26.44},{94.5,26.44},{94.5,-10}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line(
+      points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line(
+      points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(DownComerGV.C2, volumeA.Ce1)      annotation (Line(points={{94.5,-72},
+          {94.5,-108},{1,-108},{1,-100}}, color={0,0,255}));
+  connect(volumeA.Cs, RiserGV.C1)
+                                annotation (Line(points={{1,-80},{0.65,-80},{
+          0.65,-73}}, color={0,0,255}));
+  connect(RiserGV.C2, volumeA1.Ce1)
+                                  annotation (Line(points={{0.65,-9},{
+          -6.12303e-016,-9},{-6.12303e-016,8}}, color={0,0,255}));
+  connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{
+          6.12303e-016,28},{-6.12303e-016,28},{-6.12303e-016,37}}, color={0,0,
+          255}));
+  connect(heatExchangerWall.WT2, RiserGV.CTh2)
+                                             annotation (Line(points={{-40.8,
+          -41},{-18.25,-41}}, color={191,95,0}));
+  connect(RiserGV.CTh1, heatExchangerWall1.WT2)
+                                              annotation (Line(points={{19.55,
+          -41},{40.8,-41}}, color={191,95,0}));
+  connect(DomeGV.Cv, fluidOutletI) annotation (Line(points={{22,107},{22,124},{
+          0,124},{0,149}}, color={255,0,0}));
+  connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{
+          6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255}));
+  connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{40,
+          76.9},{40,63},{47,63}},    color={0,0,255}));
+  connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,
+          85.5},{32,128},{-34,128},{-34,96},{-52,96}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={Text(
+          extent={{55,81},{55,75}},
+          lineColor={0,0,255},
+          textString=
+               "petit DP"), Text(
+          extent={{-126,153},{-84,123}},
+          lineColor={0,0,255},
+          textString="= 1 SG")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={
+        Ellipse(
+          extent={{-42,150},{42,108}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,131},{42,80}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Ellipse(
+          extent={{-36,-108},{36,-150}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,86},{42,56}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={170,213,255}),
+        Rectangle(
+          extent={{-36,42},{36,-128}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={170,213,255}),
+        Polygon(
+          points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={170,213,255})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end SteamGenerator_1SG;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_1SG_purges.mo b/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_1SG_purges.mo
new file mode 100644
index 0000000000000000000000000000000000000000..cfe8f004ad9f0c070422151e1e42787c3ca02249
--- /dev/null
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_1SG_purges.mo
@@ -0,0 +1,324 @@
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model SteamGenerator_1SG_purges "Individual steam generator"
+  parameter Real H0_Mix_AlimDomeGV=1194812.89980521;
+  parameter Integer ntubes=5342;
+
+public
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg(
+    option_temperature=2,
+    mode=0,
+    steady_state=true,
+    L=10.848,
+    D=0.01687,
+    z2=10.848,
+    P(start={15548026.576998,15539261.540558,15513354.885726,15479081.11289,
+          15444819.569988,15410560.642776,15395560}),
+    h(start={1483455.66417054,1452982.36179149,1407381.72335656,
+          1372666.398393,1346263.00297153,1326153.46646787,1326153}),
+    Tp(start={564,562,560,559,568}),
+    Ns=5,
+    inertia=false,
+    dpfCorr=0.17,
+    hcCorr=5,
+    ntubes=ntubes)
+                 annotation (Placement(transformation(
+        origin={-67,-41.5},
+        extent={{30.5,-15},{-30.5,15}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg(
+    option_temperature=2,
+    mode=0,
+    steady_state=true,
+    L=10.848,
+    D=0.01687,
+    P(start={15393431.104025,15393244.26355,15392971.944187,15392877.066005,
+          15392915.646752,15393000.834432,15393020}),
+    h(start={1326153.46646787,1310848.36111251,1299218.76228131,
+          1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}),
+    Tp(start={584,580,575,571,568}),
+    Ns=5,
+    inertia=false,
+    dpfCorr=0.17,
+    hcCorr=5,
+    z1=10.848,
+    ntubes=ntubes)
+                 annotation (Placement(transformation(
+        origin={67,-41.5},
+        extent={{30.5,-14},{-30.5,14}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum                           DomeGV(
+    hl(start=1257382.15477056),
+    hv(start=2771260.46625813),
+    steady_state=true,
+    cpp=500,
+    L=8.625,
+    Vf0=0.1,
+    Cd(P(start=67.9e5)),
+    zl(fixed=false, start=0.66),
+    R=4.2818979,
+    Mp=32000) annotation (Placement(transformation(extent={{-22,64},{22,107}},
+          rotation=0)));
+    //redeclare package SinkAndSource = SinkAndSource,
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
+    L=1,
+    D=0.95886,
+    lambda=0.03) annotation (Placement(transformation(
+        origin={0,42},
+        extent={{-5,-10},{5,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC         MixAlimDomeGV(
+    h0=H0_Mix_AlimDomeGV,
+    steady_state=true,
+    h(start=1194851.37111438),
+    V=0.01,
+    dynamic_mass_balance=false) " " annotation (Placement(transformation(
+        origin={94,61},
+        extent={{-8,-8},{8,8}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
+    K=1e-4)
+    annotation (Placement(transformation(
+        origin={94,88},
+        extent={{-6,-7},{6,7}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
+    p_rho=0,
+    mode=0,
+    C2(P(start=6829391.22090726), Q(fixed=false, start=6643)),
+    K=0.172144)                    annotation (Placement(transformation(extent={{47,53},
+            {57,73}},          rotation=0)));
+  ThermoSysPro.WaterSteam.Sensors.SensorP CapteurPAlim
+    annotation (Placement(transformation(
+        origin={99,30},
+        extent={{-6,-6},{6,6}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI annotation (Placement(transformation(extent={{
+            -10,139},{10,159}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet annotation (Placement(transformation(extent={{42,102},
+            {62,122}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet1 annotation (
+      Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI1 annotation (
+      Placement(transformation(extent={{36,-132},{56,-112}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
+    annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DownComerGV(
+    p_rho=0,
+    h(start=1194851.3),
+    mode=1,
+    z1=10.8,
+    C1(
+      h_vol(start=1.1733e6),
+      h(start=1.1733e6),
+      Q(start=7525.84),
+      P(start=6829391.22090726)),
+    L=10.8,
+    D=0.216,
+    C2(
+      h_vol(start=1.1733e6),
+      Q(start=7525.84),
+      h(start=1.1733e6),
+      P(fixed=false, start=6849350)),
+    lambda=0.08,
+    ntubes=32,
+    Q(start=7525.84/4)) "DownComerGV" annotation (Placement(transformation(
+        origin={94.5,-41},
+        extent={{-31,16.5},{31,-16.5}},
+        rotation=270)));
+
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    Tp(start={571,568,566,564,562}),
+    Ns=5,
+    ntubes=ntubes)
+                 annotation (Placement(transformation(
+        origin={-44,-41},
+        extent={{-33,-16},{33,16}},
+        rotation=270)));
+  ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    Tp(start={563,560,558,557,556}),
+    Ns=5,
+    ntubes=ntubes)
+                 annotation (Placement(transformation(
+        origin={44,-41},
+        extent={{-33,16},{33,-16}},
+        rotation=270)));
+
+  ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV(
+    Ns=5,
+    P(start={6866734.6044951,6862203.9025063,6853535.2456408,6846247.0825137,
+          6840314.8313501,6834912.1497303,6828884.4924605}),
+    h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846,
+          1525552.01981793,1595519.78942018,1595519.78863864}),
+    Tp1(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,
+          560.97588254902}),
+    Tp2(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,
+          560.97588254902}),
+    D=0.03689,
+    inertia=false,
+    L=10.848,
+    z2=10.848,
+    hcCorr=5,
+    dpfCorr=1,
+    ntubes=ntubes,
+    Q(start={8600/4,8600/4,8600/4,8600/4,8600/4,8600/4})) annotation (Placement(
+        transformation(
+        origin={-2.5,-41},
+        extent={{-32,31.5},{32,-31.5}},
+        rotation=90)));
+
+  ThermoSysPro.WaterSteam.Volumes.VolumeA volumeA(
+    P0=6849350,
+    h0=1185.2e3,
+    dynamic_mass_balance=true) annotation (Placement(transformation(
+        origin={1,-96},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC         volumeA1(
+      dynamic_mass_balance=true) annotation (Placement(transformation(
+        origin={0,18},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI2 annotation (Placement(transformation(extent={{
+            36,-98},{46,-88}}), iconTransformation(extent={{36,-98},{46,-88}})));
+
+equation
+   /* Unconnected connectors */
+  if (cardinality(fluidOutletI2) == 1) then
+    fluidOutletI2.Q = 0;
+    fluidOutletI2.h = 1.e5;
+    fluidOutletI2.a = true;
+  end if;
+
+  connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line(
+      points={{-67,-11},{-67,-2},{67,-2},{67,-11}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2)
+    annotation (Line(points={{94,69},{94,82}}, thickness=0.5));
+  connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line(
+      points={{57,63},{72,63},{72,61},{86,61}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line(
+      points={{94,53},{94.2,36}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(DPnulle_AlimDwnc.C1, fluidInlet)
+    annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}}));
+  connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line(
+      points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line(
+      points={{67,-72},{68,-78},{68,-122},{46,-122}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(CapteurPAlim.C2, DownComerGV.C1)      annotation (Line(
+      points={{94.2,23.88},{94.2,26.44},{94.5,26.44},{94.5,-10}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line(
+      points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line(
+      points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(RiserGV.C2, volumeA1.Ce1)
+                                  annotation (Line(points={{0.65,-9},{
+          -6.12303e-016,-9},{-6.12303e-016,8}}, color={0,0,255}));
+  connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{
+          6.12303e-016,28},{-6.12303e-016,28},{-6.12303e-016,37}}, color={0,0,
+          255}));
+  connect(heatExchangerWall.WT2, RiserGV.CTh2)
+                                             annotation (Line(points={{-40.8,
+          -41},{-18.25,-41}}, color={191,95,0}));
+  connect(RiserGV.CTh1, heatExchangerWall1.WT2)
+                                              annotation (Line(points={{19.55,
+          -41},{40.8,-41}}, color={191,95,0}));
+  connect(DomeGV.Cv, fluidOutletI) annotation (Line(points={{22,107},{22,
+          124},{0,124},{0,149}},
+                           color={255,0,0}));
+  connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{
+          6.12303e-16,47},{6.12303e-16,52},{22,52},{22,64}},   color={0,0,255}));
+  connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},
+          {40,76.9},{40,63},{47,63}},color={0,0,255}));
+  connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{
+          32,85.5},{32,128},{-34,128},{-34,96},{-52,96}},
+                                                       color={0,0,255}));
+  connect(volumeA.Cs2, fluidOutletI2) annotation (Line(points={{11,-96},{26,-96},
+          {26,-93},{41,-93}}, color={0,0,255}));
+  connect(RiserGV.C1, volumeA.Cs1) annotation (Line(points={{0.65,-73},{0,-73},{
+          0,-86},{1,-86}}, color={0,0,255}));
+  connect(DownComerGV.C2, volumeA.Ce1) annotation (Line(points={{94.5,-72},{48,-72},
+          {48,-106},{1,-106}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={Text(
+          extent={{55,81},{55,75}},
+          lineColor={0,0,255},
+          textString=
+               "petit DP"), Text(
+          extent={{-126,153},{-84,123}},
+          lineColor={0,0,255},
+          textString="= 1 SG")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={
+        Ellipse(
+          extent={{-42,150},{42,108}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,131},{42,80}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Ellipse(
+          extent={{-36,-108},{36,-150}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,86},{42,56}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={170,213,255}),
+        Rectangle(
+          extent={{-36,42},{36,-128}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={170,213,255}),
+        Polygon(
+          points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={170,213,255})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end SteamGenerator_1SG_purges;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_4SG.mo b/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_4SG.mo
index d44d239c0bbf617dcfe98a32bdc1cc9ff3e328ad..24b21a42276619f0e9b046d61b6df8ea2576add0 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_4SG.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/SteamGenerator_4SG.mo
@@ -1,320 +1,320 @@
-within ThermoSysPro.WaterSteam.HeatExchangers;
-model SteamGenerator_4SG "Equivalent of four steam generators"
-  parameter Real H0_Mix_AlimDomeGV=1194812.89980521;
-
-public
-  DynamicOnePhaseFlowPipe UtubeHotLeg(
-    option_temperature=2,
-    mode=0,
-    steady_state=true,
-    L=10.848,
-    D=0.01687,
-    z2=10.848,
-    P(start={15548026.5769975,15539261.5405584,15513354.8857262,
-          15479081.1128903,15444819.5699875,15410560.6427763,15395560}),
-    h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393,
-          1346263.00297153,1326153.46646787,1326153}),
-    Tp(start={564,562,560,559,568}),
-    Ns=5,
-    ntubes=21360,
-    inertia=false,
-    dpfCorr=0.17,
-    hcCorr=5)
-    annotation (Placement(transformation(
-        origin={-67,-41.5},
-        extent={{30.5,-15},{-30.5,15}},
-        rotation=270)));
-  DynamicOnePhaseFlowPipe UtubeColdtLeg(
-    option_temperature=2,
-    mode=0,
-    steady_state=true,
-    L=10.848,
-    D=0.01687,
-    z1=10.848,
-    P(start={15393431.1040249,15393244.2635501,15392971.9441869,
-          15392877.0660053,15392915.6467518,15393000.8344321,15393020}),
-    h(start={1326153.46646787,1310848.36111251,1299218.76228131,
-          1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}),
-    Tp(start={584,580,575,571,568}),
-    ntubes=21360,
-    inertia=false,
-    dpfCorr=0.17,
-    hcCorr=5,
-    Ns=5)
-    annotation (Placement(transformation(
-        origin={67,-41.5},
-        extent={{30.5,-14},{-30.5,14}},
-        rotation=90)));
-  Volumes.DynamicDrum DomeGV(
-    hl(start=1257382.15477056),
-    hv(start=2771260.46625813),
-    steady_state=true,
-    Mp=32000,
-    cpp=500,
-    R=4.2818979,
-    L=8.625,
-    Vf0=0.1,
-    Cd(P(start=67.9e5)),
-    zl(fixed=false, start=0.66))   annotation (Placement(transformation(extent=
-            {{-22,64},{22,107}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
-    L=1,
-    D=0.95886,
-    lambda=0.03) annotation (Placement(transformation(
-        origin={0,39.5},
-        extent={{-7.5,-10},{7.5,10}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeC MixAlimDomeGV(
-    h0=H0_Mix_AlimDomeGV,
-    steady_state=true,
-    h(start=1194851.37111438),
-    V=0.01,
-    dynamic_mass_balance=false) " "
-    annotation (Placement(transformation(
-        origin={94,63},
-        extent={{-8,-8},{8,8}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
-      K=1e-4, rho(start=839))
-    annotation (Placement(transformation(
-        origin={94,88},
-        extent={{-6,-7},{6,7}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
-    p_rho=0,
-    mode=0,
-    C2(P(start=6829391.22090726), Q(fixed=false, start=6643)),
-    K=0.172144,
-    rho(start=742))                annotation (Placement(transformation(extent={{47,53},
-            {57,73}},          rotation=0)));
-
-  ThermoSysPro.WaterSteam.Sensors.SensorP CapteurPAlim
-    annotation (Placement(transformation(
-        origin={99,30},
-        extent={{-6,-6},{6,6}},
-        rotation=270)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI
-    annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet
-    annotation (Placement(transformation(extent={{42,102},{62,122}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet1
-    annotation (Placement(transformation(extent={{-56,-132},{-36,-112}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI1
-    annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
-    annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
-            0)));
-  PressureLosses.LumpedStraightPipe DownComerGV(
-    p_rho=0,
-    h(start=1194851.3),
-    mode=1,
-    z1=10.8,
-    C1(
-      h_vol(start=1.1733e6),
-      h(start=1.1733e6),
-      Q(start=7525.84),
-      P(start=6829391.22090726)),
-    Q(start=7525.84),
-    L=10.8,
-    D=0.216,
-    ntubes=128,
-    C2(
-      h_vol(start=1.1733e6),
-      Q(start=7525.84),
-      h(start=1.1733e6),
-      P(fixed=false, start=68.4935e5)),
-    lambda=0.08) "DownComerGV"
-                     annotation (Placement(transformation(
-        origin={94.5,-41},
-        extent={{-31,16.5},{31,-16.5}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
-    L=10.848,
-    D=0.01687,
-    e=2.18e-3,
-    lambda=23,
-    cpw=503,
-    rhow=8430,
-    ntubes=21360,
-    Tp(start={571,568,566,564,562}),
-    Ns=5)         annotation (Placement(transformation(
-        origin={-44,-41},
-        extent={{-33,-16},{33,16}},
-        rotation=270)));
-  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
-    L=10.848,
-    D=0.01687,
-    e=2.18e-3,
-    lambda=23,
-    cpw=503,
-    rhow=8430,
-    ntubes=21360,
-    Tp(start={563,560,558,557,556}),
-    Ns=5)         annotation (Placement(transformation(
-        origin={44,-41},
-        extent={{-33,16},{33,-16}},
-        rotation=270)));
-
-  DynamicTwoPhaseFlowRiser RiserGV(
-    Ns=5,
-    P(start={6866734.60449511,6862203.90250626,6853535.24564075,
-          6846247.08251367,6840314.83135013,6834912.1497303,6828884.49246047}),
-    Q(start={8600,8600,8600,8600,8600,8600}),
-    h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846,
-          1525552.01981793,1595519.78942018,1595519.78863864}),
-    Tp1(start={563.831094899634,562.971714357892,562.213228673834,
-          561.552482471836,560.975882549024}),
-    Tp2(start={563.831094899634,562.971714357892,562.213228673834,
-          561.552482471836,560.975882549024}),
-    D=0.03689,
-    inertia=false,
-    ntubes=22056,
-    L=10.848,
-    z2=10.848,
-    hcCorr=5)  annotation (Placement(transformation(
-        origin={-2.5,-41},
-        extent={{-32,31.5},{32,-31.5}},
-        rotation=90)));
-
-  Volumes.VolumeC volumeA(
-    P0=68.4935e5,
-    h0=1185.2e3,
-    dynamic_mass_balance=true)
-                          annotation (Placement(transformation(
-        origin={0.5,-92},
-        extent={{-8,-8.5},{8,8.5}},
-        rotation=90)));
-  Volumes.VolumeC volumeA1(dynamic_mass_balance=true)
-                           annotation (Placement(transformation(
-        origin={0,16},
-        extent={{-8,-9},{8,9}},
-        rotation=90)));
-  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_Vapeur(K=
-        1e-4, Q(start=2113))
-    annotation (Placement(transformation(
-        origin={-0.5,124},
-        extent={{6,-6.5},{-6,6.5}},
-        rotation=270)));
-equation
-
-  connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line(
-      points={{-67,-11},{-67,-2},{67,-2},{67,-11}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2)
-    annotation (Line(points={{94,71},{94,82}}, thickness=0.5));
-  connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line(
-      points={{57,63},{86,63}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line(
-      points={{94,55},{94.2,36}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(DPnulle_AlimDwnc.C1, fluidInlet)
-    annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}}));
-  connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line(
-      points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line(
-      points={{67,-72},{68,-78},{68,-122},{46,-122}},
-      color={127,0,0},
-      thickness=0.5));
-  connect(CapteurPAlim.C2, DownComerGV.C1)      annotation (Line(
-      points={{94.2,23.88},{94.2,26.44},{94.5,26.44},{94.5,-10}},
-      color={0,0,255},
-      thickness=0.5));
-  connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line(
-      points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}},
-      color={191,95,0},
-      thickness=0.5));
-  connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line(
-      points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}},
-      color={191,95,0},
-      thickness=0.5));
-  connect(DownComerGV.C2, volumeA.Ce1)      annotation (Line(points={{94.5,-72},
-          {94.5,-108},{0.5,-108},{0.5,-100}}, color={0,0,255}));
-  connect(volumeA.Cs, RiserGV.C1)
-                                annotation (Line(points={{0.5,-84},{0.65,-84},{
-          0.65,-73}}, color={0,0,255}));
-  connect(RiserGV.C2, volumeA1.Ce1)
-                                  annotation (Line(points={{0.65,-9},{
-          -5.51073e-016,-9},{-5.51073e-016,8}}, color={0,0,255}));
-  connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{
-          5.51073e-016,24},{-6.12303e-016,24},{-6.12303e-016,32}}, color={0,0,
-          255}));
-  connect(heatExchangerWall.WT2, RiserGV.CTh2)
-                                             annotation (Line(points={{-40.8,
-          -41},{-18.25,-41}}, color={191,95,0}));
-  connect(RiserGV.CTh1, heatExchangerWall1.WT2)
-                                              annotation (Line(points={{19.55,-41},
-          {40.8,-41}},                        color={191,95,0}));
-  connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{
-          6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255}));
-  connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{40,
-          76.9},{40,63},{47,63}},    color={0,0,255}));
-  connect(DomeGV.Cv, DPnulle_Vapeur.C1) annotation (Line(points={{22,107},{22,
-          118},{-0.5,118}}, color={255,0,0}));
-  connect(DPnulle_Vapeur.C2, fluidOutletI) annotation (Line(points={{-0.5,130},
-          {0,130},{0,149}}, color={255,0,0}));
-  connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,
-          85.5},{32,116},{-34,116},{-34,96},{-52,96}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-150,-150},{150,150}},
-        initialScale=0.1), graphics={Text(
-          extent={{55,81},{55,75}},
-          lineColor={0,0,255},
-          textString=
-               "petit DP"), Text(
-          extent={{-126,153},{-84,123}},
-          lineColor={0,0,255},
-          textString="= 4 SG")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-150,-150},{150,150}},
-        initialScale=0.1), graphics={
-        Ellipse(
-          extent={{-42,150},{42,108}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={0,128,255}),
-        Rectangle(
-          extent={{-42,131},{42,80}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={0,128,255}),
-        Ellipse(
-          extent={{-36,-108},{36,-150}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={0,128,255}),
-        Rectangle(
-          extent={{-42,86},{42,56}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={170,213,255}),
-        Rectangle(
-          extent={{-36,42},{36,-128}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={170,213,255}),
-        Polygon(
-          points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={170,213,255})}),
-    Documentation(revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>", info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>"));
-end SteamGenerator_4SG;
+within ThermoSysPro.WaterSteam.HeatExchangers;
+model SteamGenerator_4SG "Equivalent of four steam generators"
+  parameter Real H0_Mix_AlimDomeGV=1194812.89980521;
+
+public
+  DynamicOnePhaseFlowPipe UtubeHotLeg(
+    option_temperature=2,
+    mode=0,
+    steady_state=true,
+    L=10.848,
+    D=0.01687,
+    z2=10.848,
+    P(start={15548026.5769975,15539261.5405584,15513354.8857262,
+          15479081.1128903,15444819.5699875,15410560.6427763,15395560}),
+    h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393,
+          1346263.00297153,1326153.46646787,1326153}),
+    Tp(start={564,562,560,559,568}),
+    Ns=5,
+    ntubes=21360,
+    inertia=false,
+    dpfCorr=0.17,
+    hcCorr=5)
+    annotation (Placement(transformation(
+        origin={-67,-41.5},
+        extent={{30.5,-15},{-30.5,15}},
+        rotation=270)));
+  DynamicOnePhaseFlowPipe UtubeColdtLeg(
+    option_temperature=2,
+    mode=0,
+    steady_state=true,
+    L=10.848,
+    D=0.01687,
+    z1=10.848,
+    P(start={15393431.1040249,15393244.2635501,15392971.9441869,
+          15392877.0660053,15392915.6467518,15393000.8344321,15393020}),
+    h(start={1326153.46646787,1310848.36111251,1299218.76228131,
+          1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}),
+    Tp(start={584,580,575,571,568}),
+    ntubes=21360,
+    inertia=false,
+    dpfCorr=0.17,
+    hcCorr=5,
+    Ns=5)
+    annotation (Placement(transformation(
+        origin={67,-41.5},
+        extent={{30.5,-14},{-30.5,14}},
+        rotation=90)));
+  Volumes.DynamicDrum DomeGV(
+    hl(start=1257382.15477056),
+    hv(start=2771260.46625813),
+    steady_state=true,
+    Mp=32000,
+    cpp=500,
+    R=4.2818979,
+    L=8.625,
+    Vf0=0.1,
+    Cd(P(start=67.9e5)),
+    zl(fixed=false, start=0.66))   annotation (Placement(transformation(extent=
+            {{-22,64},{22,107}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
+    L=1,
+    D=0.95886,
+    lambda=0.03) annotation (Placement(transformation(
+        origin={0,39.5},
+        extent={{-7.5,-10},{7.5,10}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeC MixAlimDomeGV(
+    h0=H0_Mix_AlimDomeGV,
+    steady_state=true,
+    h(start=1194851.37111438),
+    V=0.01,
+    dynamic_mass_balance=false) " "
+    annotation (Placement(transformation(
+        origin={94,63},
+        extent={{-8,-8},{8,8}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
+      K=1e-4, rho(start=839))
+    annotation (Placement(transformation(
+        origin={94,88},
+        extent={{-6,-7},{6,7}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
+    p_rho=0,
+    mode=0,
+    C2(P(start=6829391.22090726), Q(fixed=false, start=6643)),
+    K=0.172144,
+    rho(start=742))                annotation (Placement(transformation(extent={{47,53},
+            {57,73}},          rotation=0)));
+
+  ThermoSysPro.WaterSteam.Sensors.SensorP CapteurPAlim
+    annotation (Placement(transformation(
+        origin={99,30},
+        extent={{-6,-6},{6,6}},
+        rotation=270)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI
+    annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet
+    annotation (Placement(transformation(extent={{42,102},{62,122}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI fluidInlet1
+    annotation (Placement(transformation(extent={{-56,-132},{-36,-112}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI fluidOutletI1
+    annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
+    annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
+            0)));
+  PressureLosses.LumpedStraightPipe DownComerGV(
+    p_rho=0,
+    h(start=1194851.3),
+    mode=1,
+    z1=10.8,
+    C1(
+      h_vol(start=1.1733e6),
+      h(start=1.1733e6),
+      Q(start=7525.84),
+      P(start=6829391.22090726)),
+    Q(start=7525.84),
+    L=10.8,
+    D=0.216,
+    ntubes=128,
+    C2(
+      h_vol(start=1.1733e6),
+      Q(start=7525.84),
+      h(start=1.1733e6),
+      P(fixed=false, start=68.4935e5)),
+    lambda=0.08) "DownComerGV"
+                     annotation (Placement(transformation(
+        origin={94.5,-41},
+        extent={{-31,16.5},{31,-16.5}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    ntubes=21360,
+    Tp(start={571,568,566,564,562}),
+    Ns=5)         annotation (Placement(transformation(
+        origin={-44,-41},
+        extent={{-33,-16},{33,16}},
+        rotation=270)));
+  Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
+    L=10.848,
+    D=0.01687,
+    e=2.18e-3,
+    lambda=23,
+    cpw=503,
+    rhow=8430,
+    ntubes=21360,
+    Tp(start={563,560,558,557,556}),
+    Ns=5)         annotation (Placement(transformation(
+        origin={44,-41},
+        extent={{-33,16},{33,-16}},
+        rotation=270)));
+
+  DynamicTwoPhaseFlowRiser RiserGV(
+    Ns=5,
+    P(start={6866734.60449511,6862203.90250626,6853535.24564075,
+          6846247.08251367,6840314.83135013,6834912.1497303,6828884.49246047}),
+    Q(start={8600,8600,8600,8600,8600,8600}),
+    h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846,
+          1525552.01981793,1595519.78942018,1595519.78863864}),
+    Tp1(start={563.831094899634,562.971714357892,562.213228673834,
+          561.552482471836,560.975882549024}),
+    Tp2(start={563.831094899634,562.971714357892,562.213228673834,
+          561.552482471836,560.975882549024}),
+    D=0.03689,
+    inertia=false,
+    ntubes=22056,
+    L=10.848,
+    z2=10.848,
+    hcCorr=5)  annotation (Placement(transformation(
+        origin={-2.5,-41},
+        extent={{-32,31.5},{32,-31.5}},
+        rotation=90)));
+
+  Volumes.VolumeC volumeA(
+    P0=68.4935e5,
+    h0=1185.2e3,
+    dynamic_mass_balance=true)
+                          annotation (Placement(transformation(
+        origin={0.5,-92},
+        extent={{-8,-8.5},{8,8.5}},
+        rotation=90)));
+  Volumes.VolumeC volumeA1(dynamic_mass_balance=true)
+                           annotation (Placement(transformation(
+        origin={0,16},
+        extent={{-8,-9},{8,9}},
+        rotation=90)));
+  ThermoSysPro.WaterSteam.PressureLosses.SingularPressureLoss DPnulle_Vapeur(K=
+        1e-4, Q(start=2113))
+    annotation (Placement(transformation(
+        origin={-0.5,124},
+        extent={{6,-6.5},{-6,6.5}},
+        rotation=270)));
+equation
+
+  connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line(
+      points={{-67,-11},{-67,-2},{67,-2},{67,-11}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2)
+    annotation (Line(points={{94,71},{94,82}}, thickness=0.5));
+  connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line(
+      points={{57,63},{86,63}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line(
+      points={{94,55},{94.2,36}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(DPnulle_AlimDwnc.C1, fluidInlet)
+    annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}}));
+  connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line(
+      points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line(
+      points={{67,-72},{68,-78},{68,-122},{46,-122}},
+      color={127,0,0},
+      thickness=0.5));
+  connect(CapteurPAlim.C2, DownComerGV.C1)      annotation (Line(
+      points={{94.2,23.88},{94.2,26.44},{94.5,26.44},{94.5,-10}},
+      color={0,0,255},
+      thickness=0.5));
+  connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line(
+      points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line(
+      points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}},
+      color={191,95,0},
+      thickness=0.5));
+  connect(DownComerGV.C2, volumeA.Ce1)      annotation (Line(points={{94.5,-72},
+          {94.5,-108},{0.5,-108},{0.5,-100}}, color={0,0,255}));
+  connect(volumeA.Cs, RiserGV.C1)
+                                annotation (Line(points={{0.5,-84},{0.65,-84},{
+          0.65,-73}}, color={0,0,255}));
+  connect(RiserGV.C2, volumeA1.Ce1)
+                                  annotation (Line(points={{0.65,-9},{
+          -5.51073e-016,-9},{-5.51073e-016,8}}, color={0,0,255}));
+  connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{
+          5.51073e-016,24},{-6.12303e-016,24},{-6.12303e-016,32}}, color={0,0,
+          255}));
+  connect(heatExchangerWall.WT2, RiserGV.CTh2)
+                                             annotation (Line(points={{-40.8,
+          -41},{-18.25,-41}}, color={191,95,0}));
+  connect(RiserGV.CTh1, heatExchangerWall1.WT2)
+                                              annotation (Line(points={{19.55,-41},
+          {40.8,-41}},                        color={191,95,0}));
+  connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{
+          6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255}));
+  connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{40,
+          76.9},{40,63},{47,63}},    color={0,0,255}));
+  connect(DomeGV.Cv, DPnulle_Vapeur.C1) annotation (Line(points={{22,107},{22,
+          118},{-0.5,118}}, color={255,0,0}));
+  connect(DPnulle_Vapeur.C2, fluidOutletI) annotation (Line(points={{-0.5,130},
+          {0,130},{0,149}}, color={255,0,0}));
+  connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,
+          85.5},{32,116},{-34,116},{-34,96},{-52,96}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={Text(
+          extent={{55,81},{55,75}},
+          lineColor={0,0,255},
+          textString=
+               "petit DP"), Text(
+          extent={{-126,153},{-84,123}},
+          lineColor={0,0,255},
+          textString="= 4 SG")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-150,-150},{150,150}},
+        initialScale=0.1), graphics={
+        Ellipse(
+          extent={{-42,150},{42,108}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,131},{42,80}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Ellipse(
+          extent={{-36,-108},{36,-150}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={0,128,255}),
+        Rectangle(
+          extent={{-42,86},{42,56}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={170,213,255}),
+        Rectangle(
+          extent={{-36,42},{36,-128}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={170,213,255}),
+        Polygon(
+          points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={170,213,255})}),
+    Documentation(revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>", info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>"));
+end SteamGenerator_4SG;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/package.mo b/ThermoSysPro/WaterSteam/HeatExchangers/package.mo
index 7f4e658ffb645863a8a06d2ce40feb718bfbc126..30f3f28ff2a9c9f053ea47a98a8725f9acc6483f 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/package.mo
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSteam;
-package HeatExchangers "Heat exchangers"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end HeatExchangers;
+within ThermoSysPro.WaterSteam;
+package HeatExchangers "Heat exchangers"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end HeatExchangers;
diff --git a/ThermoSysPro/WaterSteam/HeatExchangers/package.order b/ThermoSysPro/WaterSteam/HeatExchangers/package.order
index 3e42bb2c23282d88812c346898ba624731eddb15..c3637bd25902129848eb93d2998fcfa3a95bb84e 100644
--- a/ThermoSysPro/WaterSteam/HeatExchangers/package.order
+++ b/ThermoSysPro/WaterSteam/HeatExchangers/package.order
@@ -1,19 +1,20 @@
-CoolingTower
-DynamicCondenser
-DynamicOnePhaseFlowPipe
-DynamicOnePhaseFlowShell
-DynamicTwoFlowHeatExchangerShell
-DynamicTwoPhaseFlowPipe
-DynamicTwoPhaseFlowRiser
-DynamicWaterHeating
-DynamicWaterHeatingOnePipe
-DynamicWaterWaterExchanger
-NTUWaterHeating
-SimpleDynamicCondenser
-SimpleStaticCondenser
-StaticCondenser
-StaticCondenserHEI
-StaticWaterWaterExchanger
-StaticWaterWaterExchangerDTorWorEff
-SteamGenerator_1SG
-SteamGenerator_4SG
+CoolingTower
+DynamicCondenser
+DynamicOnePhaseFlowPipe
+DynamicOnePhaseFlowShell
+DynamicTwoFlowHeatExchangerShell
+DynamicTwoPhaseFlowPipe
+DynamicTwoPhaseFlowRiser
+DynamicWaterHeating
+DynamicWaterHeatingOnePipe
+DynamicWaterWaterExchanger
+NTUWaterHeating
+SimpleDynamicCondenser
+SimpleStaticCondenser
+StaticCondenser
+StaticCondenserHEI
+StaticWaterWaterExchanger
+StaticWaterWaterExchangerDTorWorEff
+SteamGenerator_1SG
+SteamGenerator_4SG
+SteamGenerator_1SG_purges
diff --git a/ThermoSysPro/WaterSteam/Junctions/DeheaterMixer2.mo b/ThermoSysPro/WaterSteam/Junctions/DeheaterMixer2.mo
index 770c2c9e76ab29a2fbbb78841b8d8c7ead451931..2dab2d616f26a313cc8ddc672859bc1747ac67ff 100644
--- a/ThermoSysPro/WaterSteam/Junctions/DeheaterMixer2.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/DeheaterMixer2.mo
@@ -1,104 +1,104 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model DeheaterMixer2
-  parameter Units.SI.Temperature Tmax=700 "Maximum fluid temperature";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P(start=50e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T(start=600) "Fluid temperature";
-  Units.SI.SpecificEnthalpy hmax(start=10e5) "Maximum fluid specific enthalpy";
-
-public
-  Connectors.FluidInlet Ce_mix
-    annotation (Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=
-            0)));
-  Connectors.FluidOutlet Cs      annotation (Placement(transformation(extent={{
-            90,50},{110,70}}, rotation=0)));
-public
-  Connectors.FluidInlet Ce
-    annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=
-            0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,82},{-80,102}}, rotation=
-           0)));
-equation
-
-  /* Fluid pressure */
-  P = Ce.P;
-  P = Ce_mix.P;
-  P = Cs.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ce.h_vol = h;
-  Cs.h_vol = h;
-  Ce_mix.h_vol = h;
-
-  /* Mass balance equation */
-  0 = Ce.Q + Ce_mix.Q - Cs.Q;
-
-  /* Energy balance equation */
-  0 = Ce.Q*Ce.h + Ce_mix.Q*Ce_mix.h - Cs.Q*Cs.h;
-
-  /* The flow at the mixing inlet is such as to ensure T <= Tmax */
-  if T <= Tmax then
-    Ce_mix.Q = 0;
-  else
-    h = hmax;
-  end if;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, 1);
-
-  T = pro.T;
-
-  hmax = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P, Tmax, mode);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{
-              100,40},{100,80},{-100,80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-16,72},{24,32}},
-          lineColor={0,0,255},
-          textString=
-               "D")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{
-              100,40},{100,80},{-100,80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-16,72},{24,32}},
-          lineColor={0,0,255},
-          textString=
-               "D")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DeheaterMixer2;
+within ThermoSysPro.WaterSteam.Junctions;
+model DeheaterMixer2
+  parameter Units.SI.Temperature Tmax=700 "Maximum fluid temperature";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P(start=50e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T(start=600) "Fluid temperature";
+  Units.SI.SpecificEnthalpy hmax(start=10e5) "Maximum fluid specific enthalpy";
+
+public
+  Connectors.FluidInlet Ce_mix
+    annotation (Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=
+            0)));
+  Connectors.FluidOutlet Cs      annotation (Placement(transformation(extent={{
+            90,50},{110,70}}, rotation=0)));
+public
+  Connectors.FluidInlet Ce
+    annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=
+            0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,82},{-80,102}}, rotation=
+           0)));
+equation
+
+  /* Fluid pressure */
+  P = Ce.P;
+  P = Ce_mix.P;
+  P = Cs.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ce.h_vol = h;
+  Cs.h_vol = h;
+  Ce_mix.h_vol = h;
+
+  /* Mass balance equation */
+  0 = Ce.Q + Ce_mix.Q - Cs.Q;
+
+  /* Energy balance equation */
+  0 = Ce.Q*Ce.h + Ce_mix.Q*Ce_mix.h - Cs.Q*Cs.h;
+
+  /* The flow at the mixing inlet is such as to ensure T <= Tmax */
+  if T <= Tmax then
+    Ce_mix.Q = 0;
+  else
+    h = hmax;
+  end if;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, 1);
+
+  T = pro.T;
+
+  hmax = ThermoSysPro.Properties.WaterSteam.IF97.SpecificEnthalpy_PT(P, Tmax, mode);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{
+              100,40},{100,80},{-100,80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-16,72},{24,32}},
+          lineColor={0,0,255},
+          textString=
+               "D")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{
+              100,40},{100,80},{-100,80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-16,72},{24,32}},
+          lineColor={0,0,255},
+          textString=
+               "D")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DeheaterMixer2;
diff --git a/ThermoSysPro/WaterSteam/Junctions/MassFlowMultiplier.mo b/ThermoSysPro/WaterSteam/Junctions/MassFlowMultiplier.mo
index bf3956596aa25f477efd4b02d373877ab1a3fc65..f2c0ec504b53cbb970f3f78a7cb241bc2743ef56 100644
--- a/ThermoSysPro/WaterSteam/Junctions/MassFlowMultiplier.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/MassFlowMultiplier.mo
@@ -1,99 +1,99 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model MassFlowMultiplier "Mass flow multipliier"
-  parameter Real alpha=2 "Flow multiplier";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.Density rho(start=998) "Fluid density";
-
-public
-  Connectors.FluidInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet Cs                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Water-steam properties"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-
-  /* Fluid pressure */
-  P = Ce.P;
-  P = Cs.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ce.h_vol = h;
-  Cs.h_vol = h;
-
-  /* Mass balance equation */
-  0 = alpha*Ce.Q - Cs.Q;
-
-  /* Energy balance equation */
-  0 = alpha*Ce.Q*Ce.h - Cs.Q*Cs.h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,60},{-100,-60},{90,0},{-100,60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-60,24},{-20,-16}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "%alpha")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,60},{-100,-60},{90,0},{-100,60}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-60,24},{-20,-16}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "%alpha")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end MassFlowMultiplier;
+within ThermoSysPro.WaterSteam.Junctions;
+model MassFlowMultiplier "Mass flow multipliier"
+  parameter Real alpha=2 "Flow multiplier";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.Density rho(start=998) "Fluid density";
+
+public
+  Connectors.FluidInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet Cs                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Water-steam properties"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+
+  /* Fluid pressure */
+  P = Ce.P;
+  P = Cs.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ce.h_vol = h;
+  Cs.h_vol = h;
+
+  /* Mass balance equation */
+  0 = alpha*Ce.Q - Cs.Q;
+
+  /* Energy balance equation */
+  0 = alpha*Ce.Q*Ce.h - Cs.Q*Cs.h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,60},{-100,-60},{90,0},{-100,60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-60,24},{-20,-16}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "%alpha")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,60},{-100,-60},{90,0},{-100,60}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-60,24},{-20,-16}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "%alpha")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end MassFlowMultiplier;
diff --git a/ThermoSysPro/WaterSteam/Junctions/Mixer2.mo b/ThermoSysPro/WaterSteam/Junctions/Mixer2.mo
index 04a897836df2a41055b7b925e310134a33edbbad..bc2be95b3f7338c177472766dfe8ebc0b710346e 100644
--- a/ThermoSysPro/WaterSteam/Junctions/Mixer2.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/Mixer2.mo
@@ -1,113 +1,113 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model Mixer2 "Mixer with two inlets"
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-
-public
-  Connectors.FluidInlet Ce2
-    annotation (Placement(transformation(extent={{-50,-110},{-30,-90}},
-          rotation=0)));
-  Connectors.FluidOutlet Cs                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-public
-  Connectors.FluidInlet Ce1
-    annotation (Placement(transformation(extent={{-50,90},{-30,110}}, rotation=
-            0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for inlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.5;
-  end if;
-
-  /* Fluid pressure */
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Cs.h_vol = h;
-
-  /* Mass balance equation */
-  0 = Ce1.Q + Ce2.Q - Cs.Q;
-
-  /* Energy balance equation */
-  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs.Q*Cs.h;
-
-  /* Mass flow at outlet 1 */
-  if (cardinality(Ialpha1) <> 0) then
-    Ce1.Q = Ialpha1.signal*Cs.Q;
-  end if;
-
-  alpha1 = Ce1.Q/Cs.Q;
-  Oalpha1.signal = alpha1;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
-              -20,100},{-60,100},{-60,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-60,80},{-20,40}}, textString=
-                                     "1"),
-        Text(extent={{-60,-40},{-20,-80}}, textString=
-                             "2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
-              -20,100},{-60,100},{-60,-100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-60,80},{-20,40}}, textString=
-                                     "1"),
-        Text(extent={{-60,-40},{-20,-80}}, textString=
-                             "2")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Mixer2;
+within ThermoSysPro.WaterSteam.Junctions;
+model Mixer2 "Mixer with two inlets"
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+
+public
+  Connectors.FluidInlet Ce2
+    annotation (Placement(transformation(extent={{-50,-110},{-30,-90}},
+          rotation=0)));
+  Connectors.FluidOutlet Cs                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+public
+  Connectors.FluidInlet Ce1
+    annotation (Placement(transformation(extent={{-50,90},{-30,110}}, rotation=
+            0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for inlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.5;
+  end if;
+
+  /* Fluid pressure */
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Cs.h_vol = h;
+
+  /* Mass balance equation */
+  0 = Ce1.Q + Ce2.Q - Cs.Q;
+
+  /* Energy balance equation */
+  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs.Q*Cs.h;
+
+  /* Mass flow at outlet 1 */
+  if (cardinality(Ialpha1) <> 0) then
+    Ce1.Q = Ialpha1.signal*Cs.Q;
+  end if;
+
+  alpha1 = Ce1.Q/Cs.Q;
+  Oalpha1.signal = alpha1;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
+              -20,100},{-60,100},{-60,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-60,80},{-20,40}}, textString=
+                                     "1"),
+        Text(extent={{-60,-40},{-20,-80}}, textString=
+                             "2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
+              -20,100},{-60,100},{-60,-100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-60,80},{-20,40}}, textString=
+                                     "1"),
+        Text(extent={{-60,-40},{-20,-80}}, textString=
+                             "2")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Mixer2;
diff --git a/ThermoSysPro/WaterSteam/Junctions/Mixer3.mo b/ThermoSysPro/WaterSteam/Junctions/Mixer3.mo
index 12fdd5df037271ae019312924116500b39acc9c7..aae272ee3180ea7bcd1374989ae7c4df35a71d6c 100644
--- a/ThermoSysPro/WaterSteam/Junctions/Mixer3.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/Mixer3.mo
@@ -1,139 +1,139 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model Mixer3 "Mixer with three inlets"
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
-  Real alpha2 "Extraction coefficient for inlet 2 (<=1)";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-
-public
-  Connectors.FluidInlet Ce2
-    annotation (Placement(transformation(extent={{-50,-110},{-30,-90}},
-          rotation=0)));
-  Connectors.FluidOutlet Cs                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-public
-  Connectors.FluidInlet Ce1
-    annotation (Placement(transformation(extent={{-50,90},{-30,110}}, rotation=
-            0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for inlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  Connectors.FluidInlet Ce3
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha2
-    "Extraction coefficient for inlet 2 (<=1)"
-    annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}, rotation=
-           0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha2
-    annotation (Placement(transformation(extent={{-20,-70},{0,-50}}, rotation=0)));
-equation
-
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.3;
-  end if;
-
-  if (cardinality(Ialpha2) == 0) then
-    Ialpha2.signal = 0.3;
-  end if;
-
-  /* Fluid pressure */
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Cs.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Ce3.h_vol = h;
-  Cs.h_vol = h;
-
-  /* Mass balance equation */
-  0 = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q;
-
-  /* Energy balance equation */
-  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h;
-
-  /* Mass flow at outlet 1 */
-  if (cardinality(Ialpha1) <> 0) then
-    Ce1.Q = Ialpha1.signal*Cs.Q;
-  end if;
-
-  if (cardinality(Ialpha2) <> 0) then
-    Ce2.Q = Ialpha2.signal*Cs.Q;
-  end if;
-
-  alpha1 =  Ce1.Q/Cs.Q;
-  Oalpha1.signal = alpha1;
-
-  alpha2 =  Ce2.Q/Cs.Q;
-  Oalpha2.signal = alpha2;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{
-              -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60,
-              100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-60,80},{-20,40}}, textString=
-                                     "1"),
-        Text(extent={{-60,-40},{-20,-80}}, textString=
-                             "2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{
-              -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60,
-              100}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{-60,80},{-20,40}}, textString=
-                                     "1"),
-        Text(extent={{-60,-40},{-20,-80}}, textString=
-                             "2")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Mixer3;
+within ThermoSysPro.WaterSteam.Junctions;
+model Mixer3 "Mixer with three inlets"
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
+  Real alpha2 "Extraction coefficient for inlet 2 (<=1)";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+
+public
+  Connectors.FluidInlet Ce2
+    annotation (Placement(transformation(extent={{-50,-110},{-30,-90}},
+          rotation=0)));
+  Connectors.FluidOutlet Cs                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+public
+  Connectors.FluidInlet Ce1
+    annotation (Placement(transformation(extent={{-50,90},{-30,110}}, rotation=
+            0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for inlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  Connectors.FluidInlet Ce3
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha2
+    "Extraction coefficient for inlet 2 (<=1)"
+    annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}, rotation=
+           0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha2
+    annotation (Placement(transformation(extent={{-20,-70},{0,-50}}, rotation=0)));
+equation
+
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.3;
+  end if;
+
+  if (cardinality(Ialpha2) == 0) then
+    Ialpha2.signal = 0.3;
+  end if;
+
+  /* Fluid pressure */
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Cs.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Ce3.h_vol = h;
+  Cs.h_vol = h;
+
+  /* Mass balance equation */
+  0 = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q;
+
+  /* Energy balance equation */
+  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h;
+
+  /* Mass flow at outlet 1 */
+  if (cardinality(Ialpha1) <> 0) then
+    Ce1.Q = Ialpha1.signal*Cs.Q;
+  end if;
+
+  if (cardinality(Ialpha2) <> 0) then
+    Ce2.Q = Ialpha2.signal*Cs.Q;
+  end if;
+
+  alpha1 =  Ce1.Q/Cs.Q;
+  Oalpha1.signal = alpha1;
+
+  alpha2 =  Ce2.Q/Cs.Q;
+  Oalpha2.signal = alpha2;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{
+              -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60,
+              100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-60,80},{-20,40}}, textString=
+                                     "1"),
+        Text(extent={{-60,-40},{-20,-80}}, textString=
+                             "2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{
+              -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60,
+              100}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{-60,80},{-20,40}}, textString=
+                                     "1"),
+        Text(extent={{-60,-40},{-20,-80}}, textString=
+                             "2")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Mixer3;
diff --git a/ThermoSysPro/WaterSteam/Junctions/Mixer8.mo b/ThermoSysPro/WaterSteam/Junctions/Mixer8.mo
index 1928bd5321d000177092b11280762a008d5f0a95..aa1d7fb9642cc79997f0d42d78d94a7069dbda2d 100644
--- a/ThermoSysPro/WaterSteam/Junctions/Mixer8.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/Mixer8.mo
@@ -1,207 +1,207 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model Mixer8 "Mixer with eight inlets"
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-
-  Connectors.FluidInlet Ce5
-    annotation (                             layer="icon", Placement(
-        transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
-  Connectors.FluidInlet Ce6
-    annotation (                              layer="icon", Placement(
-        transformation(extent={{-112,-109},{-92,-89}}, rotation=0)));
-  Connectors.FluidInlet Ce7
-    annotation (                             layer="icon", Placement(
-        transformation(extent={{-40,-109},{-20,-89}}, rotation=0)));
-  Connectors.FluidInlet Ce3
-                           annotation (                            layer="icon",
-      Placement(transformation(extent={{-112,90},{-92,110}}, rotation=0)));
-  Connectors.FluidInlet Ce2
-                           annotation (                           layer="icon",
-      Placement(transformation(extent={{-40,90},{-20,110}}, rotation=0)));
-  Connectors.FluidInlet Ce1
-                           annotation (                          layer="icon",
-      Placement(transformation(extent={{20,92},{40,112}}, rotation=0)));
-  Connectors.FluidOutlet Cs
-                           annotation (                           layer="icon",
-      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  Connectors.FluidInlet Ce8
-                           annotation (                            layer="icon",
-      Placement(transformation(extent={{20,-109},{40,-89}}, rotation=0)));
-
-  Connectors.FluidInlet Ce4
-    annotation (                             layer="icon", Placement(
-        transformation(extent={{-112,30},{-92,50}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
-            0)));
-equation
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.b = true;
-  end if;
-
-  if (cardinality(Ce4) == 0) then
-    Ce4.Q = 0;
-    Ce4.h = 1.e5;
-    Ce4.b = true;
-  end if;
-
-  if (cardinality(Ce5) == 0) then
-    Ce5.Q = 0;
-    Ce5.h = 1.e5;
-    Ce5.b = true;
-  end if;
-
-  if (cardinality(Ce6) == 0) then
-    Ce6.Q = 0;
-    Ce6.h = 1.e5;
-    Ce6.b = true;
-  end if;
-
-  if (cardinality(Ce7) == 0) then
-    Ce7.Q = 0;
-    Ce7.h = 1.e5;
-    Ce7.b = true;
-  end if;
-
-  if (cardinality(Ce8) == 0) then
-    Ce8.Q = 0;
-    Ce8.h = 1.e5;
-    Ce8.b = true;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h = 1.e5;
-    Cs.a = true;
-  end if;
-
-  /* Fluid pressure */
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Ce4.P;
-  P = Ce5.P;
-  P = Ce6.P;
-  P = Ce7.P;
-  P = Ce8.P;
-  P = Cs.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Ce3.h_vol = h;
-  Ce4.h_vol = h;
-  Ce5.h_vol = h;
-  Ce6.h_vol = h;
-  Ce7.h_vol = h;
-  Ce8.h_vol = h;
-  Cs.h_vol = h;
-
-  /* Mass balance equation */
-  0 = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q + Ce5.Q + Ce6.Q + Ce7.Q + Ce8.Q - Cs.Q;
-
-  /* Energy balance equation */
-  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h + Ce5.Q*Ce5.h + Ce6.Q*Ce6.h + Ce7.Q*Ce7.h + Ce8.Q*Ce8.h - Cs.Q*Cs.h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-40,2},{40,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{40,0},{92,0}}),
-        Line(points={{-92,-40},{-40,-40}}),
-        Line(points={{-30,90},{-30,66}}, color={0,0,255}),
-        Line(points={{30,92},{30,66}}, color={0,0,255}),
-        Line(points={{-30,-66},{-30,-90}}, color={0,0,255}),
-        Line(points={{30,-66},{30,-90}}, color={0,0,255}),
-        Line(points={{-92,40},{-40,40}}),
-        Line(points={{-38,-52},{-92,-90}}, color={0,0,255}),
-        Line(points={{-38,54},{-92,90}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-30,90},{-30,66}}, color={0,0,255}),
-        Line(points={{-30,-66},{-30,-90}}, color={0,0,255}),
-        Line(points={{30,92},{30,66}}, color={0,0,255}),
-        Line(points={{30,-66},{30,-90}}, color={0,0,255}),
-        Line(points={{-92,40},{-40,40}}),
-        Line(points={{-92,-40},{-40,-40}}),
-        Line(points={{40,0},{92,0}}),
-        Line(points={{-38,-52},{-92,-90}}, color={0,0,255}),
-        Line(points={{-38,54},{-92,90}}, color={0,0,255})}),
-    Window(
-      x=0.05,
-      y=0.07,
-      width=0.74,
-      height=0.85),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Mixer8;
+within ThermoSysPro.WaterSteam.Junctions;
+model Mixer8 "Mixer with eight inlets"
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+
+  Connectors.FluidInlet Ce5
+    annotation (                             layer="icon", Placement(
+        transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
+  Connectors.FluidInlet Ce6
+    annotation (                              layer="icon", Placement(
+        transformation(extent={{-112,-109},{-92,-89}}, rotation=0)));
+  Connectors.FluidInlet Ce7
+    annotation (                             layer="icon", Placement(
+        transformation(extent={{-40,-109},{-20,-89}}, rotation=0)));
+  Connectors.FluidInlet Ce3
+                           annotation (                            layer="icon",
+      Placement(transformation(extent={{-112,90},{-92,110}}, rotation=0)));
+  Connectors.FluidInlet Ce2
+                           annotation (                           layer="icon",
+      Placement(transformation(extent={{-40,90},{-20,110}}, rotation=0)));
+  Connectors.FluidInlet Ce1
+                           annotation (                          layer="icon",
+      Placement(transformation(extent={{20,92},{40,112}}, rotation=0)));
+  Connectors.FluidOutlet Cs
+                           annotation (                           layer="icon",
+      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  Connectors.FluidInlet Ce8
+                           annotation (                            layer="icon",
+      Placement(transformation(extent={{20,-109},{40,-89}}, rotation=0)));
+
+  Connectors.FluidInlet Ce4
+    annotation (                             layer="icon", Placement(
+        transformation(extent={{-112,30},{-92,50}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
+            0)));
+equation
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.b = true;
+  end if;
+
+  if (cardinality(Ce4) == 0) then
+    Ce4.Q = 0;
+    Ce4.h = 1.e5;
+    Ce4.b = true;
+  end if;
+
+  if (cardinality(Ce5) == 0) then
+    Ce5.Q = 0;
+    Ce5.h = 1.e5;
+    Ce5.b = true;
+  end if;
+
+  if (cardinality(Ce6) == 0) then
+    Ce6.Q = 0;
+    Ce6.h = 1.e5;
+    Ce6.b = true;
+  end if;
+
+  if (cardinality(Ce7) == 0) then
+    Ce7.Q = 0;
+    Ce7.h = 1.e5;
+    Ce7.b = true;
+  end if;
+
+  if (cardinality(Ce8) == 0) then
+    Ce8.Q = 0;
+    Ce8.h = 1.e5;
+    Ce8.b = true;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h = 1.e5;
+    Cs.a = true;
+  end if;
+
+  /* Fluid pressure */
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Ce4.P;
+  P = Ce5.P;
+  P = Ce6.P;
+  P = Ce7.P;
+  P = Ce8.P;
+  P = Cs.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Ce3.h_vol = h;
+  Ce4.h_vol = h;
+  Ce5.h_vol = h;
+  Ce6.h_vol = h;
+  Ce7.h_vol = h;
+  Ce8.h_vol = h;
+  Cs.h_vol = h;
+
+  /* Mass balance equation */
+  0 = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q + Ce5.Q + Ce6.Q + Ce7.Q + Ce8.Q - Cs.Q;
+
+  /* Energy balance equation */
+  0 = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h + Ce5.Q*Ce5.h + Ce6.Q*Ce6.h + Ce7.Q*Ce7.h + Ce8.Q*Ce8.h - Cs.Q*Cs.h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-40,2},{40,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{40,0},{92,0}}),
+        Line(points={{-92,-40},{-40,-40}}),
+        Line(points={{-30,90},{-30,66}}, color={0,0,255}),
+        Line(points={{30,92},{30,66}}, color={0,0,255}),
+        Line(points={{-30,-66},{-30,-90}}, color={0,0,255}),
+        Line(points={{30,-66},{30,-90}}, color={0,0,255}),
+        Line(points={{-92,40},{-40,40}}),
+        Line(points={{-38,-52},{-92,-90}}, color={0,0,255}),
+        Line(points={{-38,54},{-92,90}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-30,90},{-30,66}}, color={0,0,255}),
+        Line(points={{-30,-66},{-30,-90}}, color={0,0,255}),
+        Line(points={{30,92},{30,66}}, color={0,0,255}),
+        Line(points={{30,-66},{30,-90}}, color={0,0,255}),
+        Line(points={{-92,40},{-40,40}}),
+        Line(points={{-92,-40},{-40,-40}}),
+        Line(points={{40,0},{92,0}}),
+        Line(points={{-38,-52},{-92,-90}}, color={0,0,255}),
+        Line(points={{-38,54},{-92,90}}, color={0,0,255})}),
+    Window(
+      x=0.05,
+      y=0.07,
+      width=0.74,
+      height=0.85),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Mixer8;
diff --git a/ThermoSysPro/WaterSteam/Junctions/Splitter2.mo b/ThermoSysPro/WaterSteam/Junctions/Splitter2.mo
index 22fd9ce7616c080a2454dd3012ce9417c960f6fd..05724537ad9eabe0601b7c00ad850fcd93614c92 100644
--- a/ThermoSysPro/WaterSteam/Junctions/Splitter2.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/Splitter2.mo
@@ -1,113 +1,113 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model Splitter2 "Splitter with two outlets"
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-
-public
-  Connectors.FluidInlet Ce
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet Cs1
-    annotation (Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
-  Connectors.FluidOutlet Cs2
-    annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=
-            0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for outlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.5;
-  end if;
-
-  /* Fluid pressure */
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ce.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-
-  /* Mass balance equation */
-  0 = Ce.Q - Cs1.Q - Cs2.Q;
-
-  /* Energy balance equation */
-  0 = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h;
-
-  /* Mass flow at outlet 1 */
-  if (cardinality(Ialpha1) <> 0) then
-    Cs1.Q = Ialpha1.signal*Ce.Q;
-  end if;
-
-  alpha1 = Cs1.Q/Ce.Q;
-  Oalpha1.signal = alpha1;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
-              20,20},{20,100},{60,100}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{20,80},{60,40}}, textString=
-                                     "1"),
-        Text(extent={{20,-40},{60,-80}}, textString=
-                             "2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
-              20,20},{20,100},{60,100}},
-          lineColor={0,0,0},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(extent={{20,80},{60,40}}, textString=
-                                     "1"),
-        Text(extent={{20,-40},{60,-80}}, textString=
-                             "2")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 14.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end Splitter2;
+within ThermoSysPro.WaterSteam.Junctions;
+model Splitter2 "Splitter with two outlets"
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+
+public
+  Connectors.FluidInlet Ce
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet Cs1
+    annotation (Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
+  Connectors.FluidOutlet Cs2
+    annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=
+            0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for outlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.5;
+  end if;
+
+  /* Fluid pressure */
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ce.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+
+  /* Mass balance equation */
+  0 = Ce.Q - Cs1.Q - Cs2.Q;
+
+  /* Energy balance equation */
+  0 = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h;
+
+  /* Mass flow at outlet 1 */
+  if (cardinality(Ialpha1) <> 0) then
+    Cs1.Q = Ialpha1.signal*Ce.Q;
+  end if;
+
+  alpha1 = Cs1.Q/Ce.Q;
+  Oalpha1.signal = alpha1;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
+              20,20},{20,100},{60,100}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{20,80},{60,40}}, textString=
+                                     "1"),
+        Text(extent={{20,-40},{60,-80}}, textString=
+                             "2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
+              20,20},{20,100},{60,100}},
+          lineColor={0,0,0},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(extent={{20,80},{60,40}}, textString=
+                                     "1"),
+        Text(extent={{20,-40},{60,-80}}, textString=
+                             "2")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 14.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end Splitter2;
diff --git a/ThermoSysPro/WaterSteam/Junctions/Splitter3.mo b/ThermoSysPro/WaterSteam/Junctions/Splitter3.mo
index d32cb73ed4f1435090510069ae2e523082e250ab..9d8c95af0035888571a576492f4dbcbf8b808501 100644
--- a/ThermoSysPro/WaterSteam/Junctions/Splitter3.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/Splitter3.mo
@@ -1,172 +1,172 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model Splitter3 "Splitter with three outlets"
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
-  Real alpha2 "Extraction coefficient for outlet 2 (<=1)";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Units.SI.Temperature T "Fluid temperature";
-
-public
-  Connectors.FluidInlet Ce
-    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet Cs3
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs1
-    annotation (Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
-  Connectors.FluidOutlet Cs2
-    annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=
-            0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha1
-    "Extraction coefficient for outlet 1 (<=1)"
-    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.InputReal Ialpha2
-    "Extraction coefficient for outlet 2 (<=1)"
-    annotation (Placement(transformation(extent={{0,-70},{20,-50}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha1
-    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
-  InstrumentationAndControl.Connectors.OutputReal Oalpha2
-    annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-
-  if (cardinality(Ialpha1) == 0) then
-    Ialpha1.signal = 0.3;
-  end if;
-
-  if (cardinality(Ialpha2) == 0) then
-    Ialpha2.signal = 0.3;
-  end if;
-
-  /* Fluid pressure */
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ce.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-  Cs3.h_vol = h;
-
-  /* Mass balance equation */
-  0 = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
-
-  /* Energy balance equation */
-  0 = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h;
-
-  /* Mass flows at outlets 1 and 2 */
-  if (cardinality(Ialpha1) <> 0) then
-    Cs1.Q = Ialpha1.signal*Ce.Q;
-  end if;
-
-  if (cardinality(Ialpha2) <> 0) then
-    Cs2.Q = Ialpha2.signal*Ce.Q;
-  end if;
-
-  alpha1 = Cs1.Q/Ce.Q;
-  Oalpha1.signal = alpha1;
-
-  alpha2 =  Cs2.Q/Ce.Q;
-  Oalpha2.signal = alpha2;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  annotation (
-    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{
-            100,100}}), graphics={
-        Text(extent={{10,-60},{48,-90}}, textString =           "3"),
-        Rectangle(
-          extent={{44,-27},{50,-65}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100,
-              20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{20,80},{60,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "1"),
-        Text(
-          extent={{20,-40},{60,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "2"),
-        Text(
-          extent={{60,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "3")}),
-    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
-            100}}), graphics={
-        Text(extent={{10,-60},{48,-90}}, textString =           "3"),
-        Rectangle(
-          extent={{44,-27},{50,-65}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100,
-              20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{20,80},{60,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "1"),
-        Text(
-          extent={{20,-40},{60,-80}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "2"),
-        Text(
-          extent={{60,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "3")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 14.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u> </p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Splitter3;
+within ThermoSysPro.WaterSteam.Junctions;
+model Splitter3 "Splitter with three outlets"
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
+  Real alpha2 "Extraction coefficient for outlet 2 (<=1)";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Units.SI.Temperature T "Fluid temperature";
+
+public
+  Connectors.FluidInlet Ce
+    annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet Cs3
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs1
+    annotation (Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
+  Connectors.FluidOutlet Cs2
+    annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=
+            0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha1
+    "Extraction coefficient for outlet 1 (<=1)"
+    annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.InputReal Ialpha2
+    "Extraction coefficient for outlet 2 (<=1)"
+    annotation (Placement(transformation(extent={{0,-70},{20,-50}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha1
+    annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Oalpha2
+    annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+
+  if (cardinality(Ialpha1) == 0) then
+    Ialpha1.signal = 0.3;
+  end if;
+
+  if (cardinality(Ialpha2) == 0) then
+    Ialpha2.signal = 0.3;
+  end if;
+
+  /* Fluid pressure */
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ce.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+  Cs3.h_vol = h;
+
+  /* Mass balance equation */
+  0 = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
+
+  /* Energy balance equation */
+  0 = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h;
+
+  /* Mass flows at outlets 1 and 2 */
+  if (cardinality(Ialpha1) <> 0) then
+    Cs1.Q = Ialpha1.signal*Ce.Q;
+  end if;
+
+  if (cardinality(Ialpha2) <> 0) then
+    Cs2.Q = Ialpha2.signal*Ce.Q;
+  end if;
+
+  alpha1 = Cs1.Q/Ce.Q;
+  Oalpha1.signal = alpha1;
+
+  alpha2 =  Cs2.Q/Ce.Q;
+  Oalpha2.signal = alpha2;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  annotation (
+    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{
+            100,100}}), graphics={
+        Text(extent={{10,-60},{48,-90}}, textString =           "3"),
+        Rectangle(
+          extent={{44,-27},{50,-65}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100,
+              20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{20,80},{60,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "1"),
+        Text(
+          extent={{20,-40},{60,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "2"),
+        Text(
+          extent={{60,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "3")}),
+    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
+            100}}), graphics={
+        Text(extent={{10,-60},{48,-90}}, textString =           "3"),
+        Rectangle(
+          extent={{44,-27},{50,-65}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100,
+              20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{20,80},{60,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "1"),
+        Text(
+          extent={{20,-40},{60,-80}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "2"),
+        Text(
+          extent={{60,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "3")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 14.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u> </p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Splitter3;
diff --git a/ThermoSysPro/WaterSteam/Junctions/StaticDrum.mo b/ThermoSysPro/WaterSteam/Junctions/StaticDrum.mo
index 9196f257bf393051b6d4d073d95b19d414d03784..0ffdd1a518a4e9a278dd57a0f94e69b7039dbe99 100644
--- a/ThermoSysPro/WaterSteam/Junctions/StaticDrum.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/StaticDrum.mo
@@ -1,209 +1,209 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model StaticDrum "Static drum"
-  parameter Real x=1 "Vapor separation efficiency at the outlet";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=10.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy hl(start=100000) "Liquid phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hv(start=2800000) "Gas phase specific enthalpy";
-public
-  Connectors.FluidInlet Ce_eva
-    annotation (Placement(transformation(extent={{-104,-44},{-84,-24}},
-          rotation=0)));
-  Connectors.FluidInlet Ce_eco
-    annotation (Placement(transformation(extent={{-50,-104},{-30,-84}},
-          rotation=0)));
-  Connectors.FluidOutlet Cs_sup
-    annotation (Placement(transformation(extent={{84,24},{104,44}}, rotation=0)));
-  Connectors.FluidOutlet Cs_eva
-    annotation (Placement(transformation(extent={{30,-104},{50,-84}}, rotation=
-            0)));
-  Connectors.FluidOutlet Cs_sur
-    annotation (Placement(transformation(extent={{28,84},{48,104}}, rotation=0)));
-  Connectors.FluidOutlet Cs_purg
-    annotation (Placement(transformation(extent={{84,-44},{104,-24}}, rotation=
-            0)));
-  Connectors.FluidInlet Ce_steam
-    annotation (Placement(transformation(extent={{-48,84},{-28,104}}, rotation=
-            0)));
-  Connectors.FluidInlet Ce_sup
-    annotation (Placement(transformation(extent={{-104,26},{-84,46}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-104,66},{-78,98}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-    annotation (Placement(transformation(extent={{72,68},{100,100}}, rotation=0)));
-  Thermal.Connectors.ThermalPort              Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-equation
-  /* Unconnected connectors */
-
-  /* Steam input */
-  if (cardinality(Ce_steam) == 0) then
-    Ce_steam.Q = 0;
-    Ce_steam.h = 1.e5;
-    Ce_steam.b = true;
-  end if;
-
-  /* Extra input */
-  if (cardinality(Ce_sup) == 0) then
-    Ce_sup.Q = 0;
-    Ce_sup.h = 1.e5;
-    Ce_sup.b = true;
-  end if;
-
-  /* Input from evaporator */
-  if (cardinality(Ce_eva) == 0) then
-    Ce_eva.Q = 0;
-    Ce_eva.h = 1.e5;
-    Ce_eva.b = true;
-  end if;
-
-  /* Input from the economizer */
-  if (cardinality(Ce_eco) == 0) then
-    Ce_eco.Q = 0;
-    Ce_eco.h = 1.e5;
-    Ce_eco.b = true;
-  end if;
-
-  /* Output to the evaporator */
-  if (cardinality(Cs_eva) == 0) then
-    Cs_eva.Q = 0;
-    Cs_eva.h = 1.e5;
-    Cs_eva.a = true;
-  end if;
-
-  /* Extra output */
-  if (cardinality(Cs_purg) == 0) then
-    Cs_purg.Q = 0;
-    Cs_purg.h = 1.e5;
-    Cs_purg.a = true;
-  end if;
-
-  /* Extra output  */
-  if (cardinality(Cs_sup) == 0) then
-    Cs_sup.Q = 0;
-    Cs_sup.h = 1.e5;
-    Cs_sup.a = true;
-  end if;
-
-  /* Output to reheater */
-  if (cardinality(Cs_sur) == 0) then
-    Cs_sur.Q = 0;
-    Cs_sur.h = 1.e5;
-    Cs_sur.a = true;
-  end if;
-
-  /* Fluid pressure */
-  P = Ce_steam.P;
-  P = Ce_sup.P;
-  P = Ce_eva.P;
-  P = Ce_eco.P;
-  P = Cs_eva.P;
-  P = Cs_purg.P;
-  P = Cs_sup.P;
-  P = Cs_sur.P;
-
-  /* Fluid specific enthalpies at the inlets and outlets */
-  Ce_sup.h_vol = hl;
-  Ce_eva.h_vol = hl;
-  Ce_eco.h_vol = hl;
-  Ce_steam.h_vol = hv;
-
-  Cs_purg.h_vol = hl;
-  Cs_sup.h_vol = hl;
-  Cs_eva.h_vol = hl;
-  Cs_sur.h_vol = (1 - x)*hl + x*hv;
-
-  /* Mass balance equation */
-  Ce_eco.Q + Ce_steam.Q + Ce_sup.Q + Ce_eva.Q - Cs_eva.Q - Cs_sur.Q - Cs_purg.Q - Cs_sup.Q = 0;
-
-  /* Energy balance equation */
-  Ce_eco.Q*Ce_eco.h + Ce_steam.Q*Ce_steam.h + Ce_sup.Q*Ce_sup.h + Ce_eva.Q*Ce_eva.h - Cs_eva.Q*Cs_eva.h
-  - Cs_sur.Q*Cs_sur.h - Cs_purg.Q*Cs_purg.h - Cs_sup.Q*Cs_sup.h + Cth.W = 0;
-
-  /* Fluid thermodynamic properties */
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-
-  hl = lsat.h;
-  hv = vsat.h;
-  T = lsat.T;
-
-  Cth.T = T;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Ellipse(
-          extent={{-98,96},{98,-96}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-86,-44},{86,-44}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-44,-86},{44,-86}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-64,-72},{64,-72}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-78,-58},{76,-58}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Text(extent={{-56,94},{-56,92}}, textString=
-                                             "Esteam")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Ellipse(
-          extent={{-98,96},{98,-96}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-86,-44},{86,-44}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-44,-86},{44,-86}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-64,-72},{64,-72}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-78,-58},{76,-58}},
-          color={0,0,255},
-          pattern=LinePattern.Dash)}),
-    Window(
-      x=0.33,
-      y=0.08,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
-<p><b>ThermoSysPro Version 3.0</h4>
-<p>This component model is documented in Sect. 14.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u> </p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end StaticDrum;
+within ThermoSysPro.WaterSteam.Junctions;
+model StaticDrum "Static drum"
+  parameter Real x=1 "Vapor separation efficiency at the outlet";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=10.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy hl(start=100000) "Liquid phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hv(start=2800000) "Gas phase specific enthalpy";
+public
+  Connectors.FluidInlet Ce_eva
+    annotation (Placement(transformation(extent={{-104,-44},{-84,-24}},
+          rotation=0)));
+  Connectors.FluidInlet Ce_eco
+    annotation (Placement(transformation(extent={{-50,-104},{-30,-84}},
+          rotation=0)));
+  Connectors.FluidOutlet Cs_sup
+    annotation (Placement(transformation(extent={{84,24},{104,44}}, rotation=0)));
+  Connectors.FluidOutlet Cs_eva
+    annotation (Placement(transformation(extent={{30,-104},{50,-84}}, rotation=
+            0)));
+  Connectors.FluidOutlet Cs_sur
+    annotation (Placement(transformation(extent={{28,84},{48,104}}, rotation=0)));
+  Connectors.FluidOutlet Cs_purg
+    annotation (Placement(transformation(extent={{84,-44},{104,-24}}, rotation=
+            0)));
+  Connectors.FluidInlet Ce_steam
+    annotation (Placement(transformation(extent={{-48,84},{-28,104}}, rotation=
+            0)));
+  Connectors.FluidInlet Ce_sup
+    annotation (Placement(transformation(extent={{-104,26},{-84,46}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-104,66},{-78,98}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+    annotation (Placement(transformation(extent={{72,68},{100,100}}, rotation=0)));
+  Thermal.Connectors.ThermalPort              Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+equation
+  /* Unconnected connectors */
+
+  /* Steam input */
+  if (cardinality(Ce_steam) == 0) then
+    Ce_steam.Q = 0;
+    Ce_steam.h = 1.e5;
+    Ce_steam.b = true;
+  end if;
+
+  /* Extra input */
+  if (cardinality(Ce_sup) == 0) then
+    Ce_sup.Q = 0;
+    Ce_sup.h = 1.e5;
+    Ce_sup.b = true;
+  end if;
+
+  /* Input from evaporator */
+  if (cardinality(Ce_eva) == 0) then
+    Ce_eva.Q = 0;
+    Ce_eva.h = 1.e5;
+    Ce_eva.b = true;
+  end if;
+
+  /* Input from the economizer */
+  if (cardinality(Ce_eco) == 0) then
+    Ce_eco.Q = 0;
+    Ce_eco.h = 1.e5;
+    Ce_eco.b = true;
+  end if;
+
+  /* Output to the evaporator */
+  if (cardinality(Cs_eva) == 0) then
+    Cs_eva.Q = 0;
+    Cs_eva.h = 1.e5;
+    Cs_eva.a = true;
+  end if;
+
+  /* Extra output */
+  if (cardinality(Cs_purg) == 0) then
+    Cs_purg.Q = 0;
+    Cs_purg.h = 1.e5;
+    Cs_purg.a = true;
+  end if;
+
+  /* Extra output  */
+  if (cardinality(Cs_sup) == 0) then
+    Cs_sup.Q = 0;
+    Cs_sup.h = 1.e5;
+    Cs_sup.a = true;
+  end if;
+
+  /* Output to reheater */
+  if (cardinality(Cs_sur) == 0) then
+    Cs_sur.Q = 0;
+    Cs_sur.h = 1.e5;
+    Cs_sur.a = true;
+  end if;
+
+  /* Fluid pressure */
+  P = Ce_steam.P;
+  P = Ce_sup.P;
+  P = Ce_eva.P;
+  P = Ce_eco.P;
+  P = Cs_eva.P;
+  P = Cs_purg.P;
+  P = Cs_sup.P;
+  P = Cs_sur.P;
+
+  /* Fluid specific enthalpies at the inlets and outlets */
+  Ce_sup.h_vol = hl;
+  Ce_eva.h_vol = hl;
+  Ce_eco.h_vol = hl;
+  Ce_steam.h_vol = hv;
+
+  Cs_purg.h_vol = hl;
+  Cs_sup.h_vol = hl;
+  Cs_eva.h_vol = hl;
+  Cs_sur.h_vol = (1 - x)*hl + x*hv;
+
+  /* Mass balance equation */
+  Ce_eco.Q + Ce_steam.Q + Ce_sup.Q + Ce_eva.Q - Cs_eva.Q - Cs_sur.Q - Cs_purg.Q - Cs_sup.Q = 0;
+
+  /* Energy balance equation */
+  Ce_eco.Q*Ce_eco.h + Ce_steam.Q*Ce_steam.h + Ce_sup.Q*Ce_sup.h + Ce_eva.Q*Ce_eva.h - Cs_eva.Q*Cs_eva.h
+  - Cs_sur.Q*Cs_sur.h - Cs_purg.Q*Cs_purg.h - Cs_sup.Q*Cs_sup.h + Cth.W = 0;
+
+  /* Fluid thermodynamic properties */
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+
+  hl = lsat.h;
+  hv = vsat.h;
+  T = lsat.T;
+
+  Cth.T = T;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Ellipse(
+          extent={{-98,96},{98,-96}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-86,-44},{86,-44}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-44,-86},{44,-86}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-64,-72},{64,-72}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-78,-58},{76,-58}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Text(extent={{-56,94},{-56,92}}, textString=
+                                             "Esteam")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Ellipse(
+          extent={{-98,96},{98,-96}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-86,-44},{86,-44}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-44,-86},{44,-86}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-64,-72},{64,-72}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-78,-58},{76,-58}},
+          color={0,0,255},
+          pattern=LinePattern.Dash)}),
+    Window(
+      x=0.33,
+      y=0.08,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </p>
+<p><b>ThermoSysPro Version 3.0</h4>
+<p>This component model is documented in Sect. 14.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u> </p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end StaticDrum;
diff --git a/ThermoSysPro/WaterSteam/Junctions/SteamDryer.mo b/ThermoSysPro/WaterSteam/Junctions/SteamDryer.mo
index 3804f5319595ba8c6aa69d606e76d902d2ff0fe2..1e98ae39283bff5a3025e50f21dd829f2f08986d 100644
--- a/ThermoSysPro/WaterSteam/Junctions/SteamDryer.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/SteamDryer.mo
@@ -1,97 +1,97 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model SteamDryer "Steam dryer"
-  parameter Real eta=1
-    "Vapor mass fraction at outlet (0 < eta <= 1 and eta > Vapor mass fraction at the inlet)";
-  parameter Integer mode_e=0
-    "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-  Real xe(start=1.0) "Vapor mass fraction at the inlet";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Connectors.FluidInlet Cev
-    annotation (Placement(transformation(extent={{-109,30},{-89,50}}, rotation=
-            0)));
-  Connectors.FluidOutlet Csv               annotation (Placement(transformation(
-          extent={{89,30},{109,50}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1
-    annotation (Placement(transformation(extent={{-100,-98},{-80,-78}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1
-    annotation (Placement(transformation(extent={{-76,-98},{-56,-78}}, rotation=
-           0)));
-  Connectors.FluidOutlet Csl               annotation (Placement(transformation(
-          extent={{-9,-110},{11,-90}}, rotation=0)));
-
-equation
-  assert((eta > 0) and (eta <= 1), "SteamDryer - Parameter eta should be > 0 and <= 1");
-
-  /* Fluid pressure */
-  P = Cev.P;
-  P = Csv.P;
-  P = Csl.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Cev.h_vol = h;
-  Csv.h_vol = h;
-
-  Csl.h_vol = noEvent(if (xe > 0) then lsat1.h else Cev.h);
-
-  /* Mass flow at the vapor outlet*/
-  Csv.Q = noEvent(if (xe > 0) then Cev.Q*(1-eta*(1-xe)) else 0);
-
-  /* Mass balance equation */
-  0 = Cev.Q - Csv.Q - Csl.Q;
-
-  /* Energy balance equation */
-  0 = Cev.Q*Cev.h - Csv.Q*Csv.h - Csl.Q*Csl.h;
-
-  /* Fluid thermodynamic properties */
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cev.P, Cev.h, mode_e);
-
-  /* Vapor mass fraction at the inlet */
-  xe = proe.x;
-
-  /* Fluid thermodynamic properties at the saturation point */
-  (lsat1,vsat1) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Cev.P);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-98,40},{-18,-100},{22,-100},{102,40},{-98,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,40},{-20,-100},{20,-100},{100,40},{-100,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2 </h4>
-<p>This component model is documented in Sect. 14.9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SteamDryer;
+within ThermoSysPro.WaterSteam.Junctions;
+model SteamDryer "Steam dryer"
+  parameter Real eta=1
+    "Vapor mass fraction at outlet (0 < eta <= 1 and eta > Vapor mass fraction at the inlet)";
+  parameter Integer mode_e=0
+    "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+  Real xe(start=1.0) "Vapor mass fraction at the inlet";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Connectors.FluidInlet Cev
+    annotation (Placement(transformation(extent={{-109,30},{-89,50}}, rotation=
+            0)));
+  Connectors.FluidOutlet Csv               annotation (Placement(transformation(
+          extent={{89,30},{109,50}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1
+    annotation (Placement(transformation(extent={{-100,-98},{-80,-78}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1
+    annotation (Placement(transformation(extent={{-76,-98},{-56,-78}}, rotation=
+           0)));
+  Connectors.FluidOutlet Csl               annotation (Placement(transformation(
+          extent={{-9,-110},{11,-90}}, rotation=0)));
+
+equation
+  assert((eta > 0) and (eta <= 1), "SteamDryer - Parameter eta should be > 0 and <= 1");
+
+  /* Fluid pressure */
+  P = Cev.P;
+  P = Csv.P;
+  P = Csl.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Cev.h_vol = h;
+  Csv.h_vol = h;
+
+  Csl.h_vol = noEvent(if (xe > 0) then lsat1.h else Cev.h);
+
+  /* Mass flow at the vapor outlet*/
+  Csv.Q = noEvent(if (xe > 0) then Cev.Q*(1-eta*(1-xe)) else 0);
+
+  /* Mass balance equation */
+  0 = Cev.Q - Csv.Q - Csl.Q;
+
+  /* Energy balance equation */
+  0 = Cev.Q*Cev.h - Csv.Q*Csv.h - Csl.Q*Csl.h;
+
+  /* Fluid thermodynamic properties */
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Cev.P, Cev.h, mode_e);
+
+  /* Vapor mass fraction at the inlet */
+  xe = proe.x;
+
+  /* Fluid thermodynamic properties at the saturation point */
+  (lsat1,vsat1) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(Cev.P);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-98,40},{-18,-100},{22,-100},{102,40},{-98,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,40},{-20,-100},{20,-100},{100,40},{-100,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2 </h4>
+<p>This component model is documented in Sect. 14.9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SteamDryer;
diff --git a/ThermoSysPro/WaterSteam/Junctions/SteamExtractionSplitter.mo b/ThermoSysPro/WaterSteam/Junctions/SteamExtractionSplitter.mo
index d560723377de9889be086b50264173f69cbc2e95..67d40bf66706ce78b9d86261d059e95ab19119b6 100644
--- a/ThermoSysPro/WaterSteam/Junctions/SteamExtractionSplitter.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/SteamExtractionSplitter.mo
@@ -1,92 +1,92 @@
-within ThermoSysPro.WaterSteam.Junctions;
-model SteamExtractionSplitter "Splitter for steam extraction"
-  parameter Real alpha = 1
-    "Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 <= alpha <= 1)";
-  parameter Integer mode_e=0
-    "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Real x_ex(start=0.99) "Vapor mass fraction at the extraction outlet";
-  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Connectors.FluidInlet Ce
-    annotation (Placement(transformation(extent={{-113,-10},{-93,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet Cs      annotation (Placement(transformation(extent={{
-            93,-10},{113,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  Connectors.FluidOutlet Cex "Extraction outlet"
-                                 annotation (Placement(transformation(extent={{
-            30,-110},{50,-90}}, rotation=0)));
-equation
-
-  /* Fluid pressure */
-  P = Ce.P;
-  P = Cs.P;
-  P = Cex.P;
-
-  /* Fluid specific enthalpy (singular if all flows = 0) */
-  Ce.h_vol = h;
-  Cs.h_vol = h;
-  Cex.h_vol = if noEvent(x_ex < 1) then (1 - x_ex)*lsat.h + x_ex*vsat.h else h;
-
-  /* Mass balance equation */
-  0 = Ce.Q - Cs.Q - Cex.Q;
-
-  /* Energy balance equation */
-  0 = Ce.Q*Ce.h - Cs.Q*Cs.h - Cex.Q*Cex.h;
-
-  /* Fluid thermodynamic properties at the inlet */
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Ce.h, mode_e);
-
-  /* Fluid thermodynamic properties at the saturation point */
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-
-  /* Vapor mass fraction at the extraction outlet */
-  x_ex = alpha*proe.x;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,30},{-100,-30},{-40,-30},{20,-100},{20,-100},{60,-100},
-              {70,-100},{0,-30},{100,-30},{100,30},{-100,30}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,28},{-100,-32},{-40,-32},{20,-102},{20,-102},{60,-102},
-              {70,-102},{0,-32},{100,-32},{100,28},{-100,28}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SteamExtractionSplitter;
+within ThermoSysPro.WaterSteam.Junctions;
+model SteamExtractionSplitter "Splitter for steam extraction"
+  parameter Real alpha = 1
+    "Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 <= alpha <= 1)";
+  parameter Integer mode_e=0
+    "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Real x_ex(start=0.99) "Vapor mass fraction at the extraction outlet";
+  Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Connectors.FluidInlet Ce
+    annotation (Placement(transformation(extent={{-113,-10},{-93,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet Cs      annotation (Placement(transformation(extent={{
+            93,-10},{113,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  Connectors.FluidOutlet Cex "Extraction outlet"
+                                 annotation (Placement(transformation(extent={{
+            30,-110},{50,-90}}, rotation=0)));
+equation
+
+  /* Fluid pressure */
+  P = Ce.P;
+  P = Cs.P;
+  P = Cex.P;
+
+  /* Fluid specific enthalpy (singular if all flows = 0) */
+  Ce.h_vol = h;
+  Cs.h_vol = h;
+  Cex.h_vol = if noEvent(x_ex < 1) then (1 - x_ex)*lsat.h + x_ex*vsat.h else h;
+
+  /* Mass balance equation */
+  0 = Ce.Q - Cs.Q - Cex.Q;
+
+  /* Energy balance equation */
+  0 = Ce.Q*Ce.h - Cs.Q*Cs.h - Cex.Q*Cex.h;
+
+  /* Fluid thermodynamic properties at the inlet */
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Ce.h, mode_e);
+
+  /* Fluid thermodynamic properties at the saturation point */
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+
+  /* Vapor mass fraction at the extraction outlet */
+  x_ex = alpha*proe.x;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,30},{-100,-30},{-40,-30},{20,-100},{20,-100},{60,-100},
+              {70,-100},{0,-30},{100,-30},{100,30},{-100,30}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,28},{-100,-32},{-40,-32},{20,-102},{20,-102},{60,-102},
+              {70,-102},{0,-32},{100,-32},{100,28},{-100,28}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SteamExtractionSplitter;
diff --git a/ThermoSysPro/WaterSteam/Junctions/package.mo b/ThermoSysPro/WaterSteam/Junctions/package.mo
index 8eb6b9ef3746106ca28766525a95f80b7a1bccb1..a1fd4e9a1f6ed33905aea7f22ce64c63361bb98f 100644
--- a/ThermoSysPro/WaterSteam/Junctions/package.mo
+++ b/ThermoSysPro/WaterSteam/Junctions/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSteam;
-package Junctions "Junctions"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Junctions;
+within ThermoSysPro.WaterSteam;
+package Junctions "Junctions"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Junctions;
diff --git a/ThermoSysPro/WaterSteam/Junctions/package.order b/ThermoSysPro/WaterSteam/Junctions/package.order
index a6768c36c16dc6053cf06fbd0d8eeb587070e4c5..a5e732e4f6d6f29c66cbf3c011e12821a86d522b 100644
--- a/ThermoSysPro/WaterSteam/Junctions/package.order
+++ b/ThermoSysPro/WaterSteam/Junctions/package.order
@@ -1,10 +1,10 @@
-DeheaterMixer2
-MassFlowMultiplier
-Mixer2
-Mixer3
-Mixer8
-Splitter2
-Splitter3
-StaticDrum
-SteamDryer
-SteamExtractionSplitter
+DeheaterMixer2
+MassFlowMultiplier
+Mixer2
+Mixer3
+Mixer8
+Splitter2
+Splitter3
+StaticDrum
+SteamDryer
+SteamExtractionSplitter
diff --git a/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerH.mo b/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerH.mo
index 1c95d1bbd179a268ca5b2f504b1c8fec69cdc804..c176d05e712f3cadd3aa20817bb5946b77a775eb 100644
--- a/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerH.mo
+++ b/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerH.mo
@@ -1,69 +1,69 @@
-within ThermoSysPro.WaterSteam.LoopBreakers;
-model LoopBreakerH
-  "Specific enthalpy loop breaker for the water/steam connector"
-
-
-public
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.P = C2.P;
-
-  /* Flow reversal */
-  0 = if (C1.Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-38,38},{42,-42}},
-          lineColor={0,0,255},
-          textString=
-               "h"),
-        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Text(
-          extent={{-38,38},{42,-42}},
-          lineColor={0,0,255},
-          textString=
-               "h"),
-        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerH;
+within ThermoSysPro.WaterSteam.LoopBreakers;
+model LoopBreakerH
+  "Specific enthalpy loop breaker for the water/steam connector"
+
+
+public
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.P = C2.P;
+
+  /* Flow reversal */
+  0 = if (C1.Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-38,38},{42,-42}},
+          lineColor={0,0,255},
+          textString=
+               "h"),
+        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Text(
+          extent={{-38,38},{42,-42}},
+          lineColor={0,0,255},
+          textString=
+               "h"),
+        Line(points={{0,100},{0,-100}}, color={0,0,255})}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerH;
diff --git a/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerP.mo b/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerP.mo
index ee5b09c4c3f97ffcadd9891d831531ae763ecf85..eb22724b35dbaa20b12f1e42bec7f9c91730a4db 100644
--- a/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerP.mo
+++ b/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerP.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.WaterSteam.LoopBreakers;
-model LoopBreakerP "Pressure loop breaker for the water/steam connector"
-
-
-public
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  /* Flow reversal */
-  0 = if (C1.Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,38},{40,-42}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,255,0}),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-38,38},{42,-42}},
-          lineColor={0,0,255},
-          textString=
-               "P")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerP;
+within ThermoSysPro.WaterSteam.LoopBreakers;
+model LoopBreakerP "Pressure loop breaker for the water/steam connector"
+
+
+public
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  /* Flow reversal */
+  0 = if (C1.Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,38},{40,-42}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,255,0}),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-38,38},{42,-42}},
+          lineColor={0,0,255},
+          textString=
+               "P")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerP;
diff --git a/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerQ.mo b/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerQ.mo
index 0624b063dfcd25780e14ba65d49fdd836e39770a..4931130509058f1bd3936c59ae5859c5a36b7dea 100644
--- a/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerQ.mo
+++ b/ThermoSysPro/WaterSteam/LoopBreakers/LoopBreakerQ.mo
@@ -1,68 +1,68 @@
-within ThermoSysPro.WaterSteam.LoopBreakers;
-model LoopBreakerQ "Mass flow loop breaker for the water/steam connector"
-
-
-public
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-
-  /* Flow reversal */
-  0 = if (C1.Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.HorizontalCylinder,
-          fillColor={255,255,0}),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,38},{40,-42}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={255,255,0}),
-        Line(points={{0,100},{0,-100}}, color={0,0,255}),
-        Text(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          textString=
-               "Q")}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end LoopBreakerQ;
+within ThermoSysPro.WaterSteam.LoopBreakers;
+model LoopBreakerQ "Mass flow loop breaker for the water/steam connector"
+
+
+public
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+
+  /* Flow reversal */
+  0 = if (C1.Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.HorizontalCylinder,
+          fillColor={255,255,0}),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,38},{40,-42}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{100,0},{0,-100},{-100,0},{0,100}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={255,255,0}),
+        Line(points={{0,100},{0,-100}}, color={0,0,255}),
+        Text(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          textString=
+               "Q")}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end LoopBreakerQ;
diff --git a/ThermoSysPro/WaterSteam/LoopBreakers/LoopingPQ.mo b/ThermoSysPro/WaterSteam/LoopBreakers/LoopingPQ.mo
index e7e37368308405cffba603356aa99a17698f649e..c674f4326bcc644b79df9583c0dc1922060f3894 100644
--- a/ThermoSysPro/WaterSteam/LoopBreakers/LoopingPQ.mo
+++ b/ThermoSysPro/WaterSteam/LoopBreakers/LoopingPQ.mo
@@ -1,67 +1,67 @@
-within ThermoSysPro.WaterSteam.LoopBreakers;
-model LoopingPQ
-
-  parameter Units.SI.AbsolutePressure P=1e5 "Pression imposée en sortie";
-  parameter Units.SI.MassFlowRate Q=1.0 "Débit imposé";
-
-  ThermoSysPro.WaterSteam.Connectors.FluidInletI C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  ThermoSysPro.WaterSteam.Connectors.FluidOutletI C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerQ qLoopBreaker
-    annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.InvSingularPressureLoss
-    pressureCloserWaterSteam
-    annotation (Placement(transformation(extent={{20,-10},{40,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefP pressureReference
-    annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0)));
-  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ massFlowSetWaterSteam
-    annotation (Placement(transformation(extent={{-40,-10},{-20,10}}, rotation=
-            0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit(
-                                            k=Q)
-    annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
-                                               k=P)
-    annotation (Placement(transformation(extent={{20,30},{40,50}}, rotation=0)));
-equation
-  connect(Debit.y, massFlowSetWaterSteam.IMassFlow)
-    annotation (Line(points={{-59,40},{-30,40},{-30,11}}));
-  connect(Pression.y, pressureReference.IPressure)
-    annotation (Line(points={{41,40},{70,40},{70,11}}));
-  connect(C1, qLoopBreaker.C1) annotation (Line(points={{-100,0},{-80,0}}));
-  connect(qLoopBreaker.C2, massFlowSetWaterSteam.C1)
-    annotation (Line(points={{-60,0},{-40,0}}, color={0,0,255}));
-  connect(massFlowSetWaterSteam.C2, pressureCloserWaterSteam.C1)
-    annotation (Line(points={{-20,0},{20,0}}, color={0,0,255}));
-  connect(pressureCloserWaterSteam.C2, pressureReference.C1)
-    annotation (Line(points={{40,0},{60,0}}, color={0,0,255}));
-  connect(pressureReference.C2, C2)
-    annotation (Line(points={{80,0},{100,0}}, color={0,0,255}));
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.01), graphics),
-                          Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        initialScale=0.01), graphics={Rectangle(
-          extent={{-100,30},{100,-30}},
-          lineColor={0,0,255},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Bruno P&eacute;chin&eacute; </li>
-</ul>
-</html>"));
-end LoopingPQ;
+within ThermoSysPro.WaterSteam.LoopBreakers;
+model LoopingPQ
+
+  parameter Units.SI.AbsolutePressure P=1e5 "Pression imposée en sortie";
+  parameter Units.SI.MassFlowRate Q=1.0 "Débit imposé";
+
+  ThermoSysPro.WaterSteam.Connectors.FluidInletI C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  ThermoSysPro.WaterSteam.Connectors.FluidOutletI C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.LoopBreakers.LoopBreakerQ qLoopBreaker
+    annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.InvSingularPressureLoss
+    pressureCloserWaterSteam
+    annotation (Placement(transformation(extent={{20,-10},{40,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefP pressureReference
+    annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0)));
+  ThermoSysPro.WaterSteam.BoundaryConditions.RefQ massFlowSetWaterSteam
+    annotation (Placement(transformation(extent={{-40,-10},{-20,10}}, rotation=
+            0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Debit(
+                                            k=Q)
+    annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Pression(
+                                               k=P)
+    annotation (Placement(transformation(extent={{20,30},{40,50}}, rotation=0)));
+equation
+  connect(Debit.y, massFlowSetWaterSteam.IMassFlow)
+    annotation (Line(points={{-59,40},{-30,40},{-30,11}}));
+  connect(Pression.y, pressureReference.IPressure)
+    annotation (Line(points={{41,40},{70,40},{70,11}}));
+  connect(C1, qLoopBreaker.C1) annotation (Line(points={{-100,0},{-80,0}}));
+  connect(qLoopBreaker.C2, massFlowSetWaterSteam.C1)
+    annotation (Line(points={{-60,0},{-40,0}}, color={0,0,255}));
+  connect(massFlowSetWaterSteam.C2, pressureCloserWaterSteam.C1)
+    annotation (Line(points={{-20,0},{20,0}}, color={0,0,255}));
+  connect(pressureCloserWaterSteam.C2, pressureReference.C1)
+    annotation (Line(points={{40,0},{60,0}}, color={0,0,255}));
+  connect(pressureReference.C2, C2)
+    annotation (Line(points={{80,0},{100,0}}, color={0,0,255}));
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.01), graphics),
+                          Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        initialScale=0.01), graphics={Rectangle(
+          extent={{-100,30},{100,-30}},
+          lineColor={0,0,255},
+          fillColor={0,0,0},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Bruno P&eacute;chin&eacute; </li>
+</ul>
+</html>"));
+end LoopingPQ;
diff --git a/ThermoSysPro/WaterSteam/LoopBreakers/package.mo b/ThermoSysPro/WaterSteam/LoopBreakers/package.mo
index 1585700a505d5eb2f466ab966caa2f4d17af9cae..8a107f46f018f1465ee4d86cf32e5ff0e327d4f6 100644
--- a/ThermoSysPro/WaterSteam/LoopBreakers/package.mo
+++ b/ThermoSysPro/WaterSteam/LoopBreakers/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSteam;
-package LoopBreakers "Loop breakers"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end LoopBreakers;
+within ThermoSysPro.WaterSteam;
+package LoopBreakers "Loop breakers"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end LoopBreakers;
diff --git a/ThermoSysPro/WaterSteam/Machines/CentrifugalPump.mo b/ThermoSysPro/WaterSteam/Machines/CentrifugalPump.mo
index 38d429db2acefe66754a5d09cd7be14f186d977c..7c6f68a1ab24e931797709a7637b6a04bb90bef7 100644
--- a/ThermoSysPro/WaterSteam/Machines/CentrifugalPump.mo
+++ b/ThermoSysPro/WaterSteam/Machines/CentrifugalPump.mo
@@ -1,319 +1,318 @@
-within ThermoSysPro.WaterSteam.Machines;
-model CentrifugalPump "Centrifugal pump"
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N=1400
-    "Pump angular velocity in rpm (active if input M is not connected)";
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N_nom=1400
-    "Nominal angular velocity in rpm";
-  parameter Units.SI.MomentOfInertia J=10
-    "Rotating masses moment of inertia (active if dynamic_mech_equation=true)";
-  parameter Units.SI.Volume V=1
-    "Pump volume (active if dynamic_energy_balance=true)";
-  parameter Boolean dynamic_mech_equation=false
-    "true: dynamic mechanical equation - false: static mechanical equation (active if input M is connected)";
-  parameter Boolean dynamic_energy_balance=false
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=1
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-  parameter Integer mode_car=2
-    "1:nominal values and coef. c given by parameters - 2:nominal values and coef. c computed from semi-parabolic characteristics";
-  parameter Integer mode_car_hn=2
-    "1:complete pump head characteristics - 2:semi-parabolic pump head characteristics";
-  parameter Integer mode_car_Cr=2
-    "1:complete torque characteristics - 2:analytic formula";
-
-  parameter Units.SI.VolumeFlowRate Qv_nom_p=0.4781
-    "Nominal volumetric flow (active if mode_car=1)";
-  parameter Units.SI.Height hn_nom_p=22.879
-    "Nominal pump head (active if mode_car=1)";
-  parameter Units.SI.Height rh_nom_p=0.863
-    "Nominal pump efficiency (active if mode_car=1)";
-
-  parameter Real F_t[:]={ 0.634, 0.643, 0.646, 0.640, 0.629, 0.613, 0.595, 0.575, 0.552, 0.533, 0.516, 0.505,
-                          0.504, 0.510, 0.512, 0.522, 0.539, 0.559, 0.580, 0.601, 0.630, 0.662, 0.692, 0.722,
-                          0.753, 0.782, 0.808, 0.832, 0.857, 0.879, 0.904, 0.930, 0.959, 0.996, 1.027, 1.060,
-                          1.090, 1.124, 1.165, 1.204, 1.238, 1.258, 1.271, 1.282, 1.288, 1.281, 1.260, 1.225,
-                          1.172, 1.107, 1.031, 0.942, 0.842, 0.733, 0.617, 0.500, 0.368, 0.240, 0.125, 0.011,
-                         -0.102,-0.168,-0.255,-0.342,-0.423,-0.494,-0.556,-0.620,-0.655,-0.670,-0.670,-0.660,
-                         -0.655,-0.640,-0.600,-0.570,-0.520,-0.470,-0.430,-0.360,-0.275,-0.160,-0.040, 0.130,
-                          0.295, 0.430, 0.550, 0.620, 0.634}
-    "Head characteristics (active if mode_car_hn=1)";
-
-  parameter Real G_t[:]={-0.684,-0.547,-0.414,-0.292,-0.187,-0.105,-0.053,-0.012, 0.042, 0.097, 0.156, 0.227,
-                          0.300, 0.371, 0.444, 0.522, 0.596, 0.672, 0.738, 0.763, 0.797, 0.837, 0.865, 0.883,
-                          0.886, 0.877, 0.859, 0.838, 0.804, 0.758, 0.703, 0.645, 0.583, 0.520, 0.454, 0.408,
-                          0.370, 0.343, 0.331, 0.329, 0.338, 0.354, 0.372, 0.405, 0.450, 0.486, 0.520, 0.552,
-                          0.579, 0.603, 0.616, 0.617, 0.606, 0.582, 0.546, 0.500, 0.432, 0.360, 0.288, 0.214,
-                          0.123, 0.037,-0.053,-0.161,-0.248,-0.314,-0.372,-0.580,-0.740,-0.880,-1.000,-1.120,
-                         -1.250,-1.370,-1.490,-1.590,-1.660,-1.690,-1.770,-1.650,-1.590,-1.520,-1.420,-1.320,
-                         -1.230,-1.100,-0.980,-0.820, -0.684}
-    "Torque characteristics (active if mode_car_Cr=1)";
-
-  parameter Real c_p=1.288
-    "Dimensionless coef. of the semi-parabolic pump head characteristics (active if mode_car=1 and mode_car_hn=2)";
-  constant Real b=2
-    "Dimensionless coef. of the parabolic pump efficiency characteristics";
-
-  parameter Real hn_coef[2]={-88.67, 43.15}
-    "Coef. of the semi-parabolic pump head characteristics (active if mode_car=2)";
-  parameter Real rh_coef[2]={-3.7751, 3.61}
-    "Coef. of the parabolic pump efficiency characteristics (active if mode_car=2)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.AngularVelocity w_a_min=1.e-4 "Small angular velocity";
-  parameter Units.SI.VolumeFlowRate Qv_a_min=1.e-4 "Small volume flow rate";
-  parameter Real rh_min=0.05 "Minimum efficiency";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-  parameter Boolean dyn_mech_equation=((cardinality(M) <> 0) and dynamic_mech_equation);
-
-public
-  Real w_a "Dimensionless angular velocity";
-  Real Qv_a(start=1) "Dimensionless volumetric flow";
-  Real hn_a(start=1) "Dimensionless head";
-  Real Cr_a(start=1) "Dimensionless resistive torque";
-  Real rh_a(start=1) "Dimensionless pump efficiency";
-  Units.SI.AngularVelocity w_nom "Nominal angular velocity";
-  Units.SI.VolumeFlowRate Qv_nom "Nominal volumetric flow";
-  Units.SI.Height hn_nom "Nominal pump head";
-  Units.SI.Torque Cr_nom "Nominal resistive hydraulic torque";
-  Real rh_nom "Nominal pump efficiency";
-  Units.SI.Angle theta "Angle arctan(Qv_a/w_a) (rad)";
-  ThermoSysPro.Units.nonSI.Angle_deg theta_deg "Angle arctan(Qv_a/w_a) (deg)";
-  Units.SI.AngularVelocity w "Angular velocity in rad";
-  ThermoSysPro.Units.nonSI.AngularVelocity_rpm w_rpm "Angular velocity in rpm";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow rate";
-  Units.SI.Pressure deltaP
-    "Pressure variation between the outlet and the inlet";
-  Units.SI.Height hn(start=10) "Pump head";
-  Units.SI.Torque Cm "Motor torque";
-  Units.SI.Torque Cr "Resistive hydraulic torque";
-  Real rh "Pump efficiency";
-  Units.SI.Power Wr "Resistive power";
-  Units.SI.Power Wm "Motor power";
-  Units.SI.Energy Ec "Kinetic energy of the rotating masses";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.SpecificEnthalpy deltaH
-    "Specific enthalpy variation between the outlet and the inlet";
-  Units.SI.Pressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
-  Real c "Dimensionless coef. of the semi-parabolic pump head characteristics";
-  Real F "Function F";
-  Real G "Function G";
-  Real Z "Function Z";
-  Real i_h "Index in head characteristics table";
-  Real i_t "Index in torque characteristics table";
-  Real alpha=hn_coef[1] "Coef. alpha of the characteristics for hn";
-  Real beta=hn_coef[2] "Coef. beta of the characteristics for hn";
-  Real gamma=rh_coef[1] "Coef. gamma of the characteristics for rh";
-  Real delta=rh_coef[2] "Coef. delta of the characteristics for rh";
-
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ElectroMechanics.Connectors.MechanichalTorque M
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-initial equation
-  if dyn_mech_equation then
-    der(w) = 0;
-  end if;
-
-  if dynamic_energy_balance then
-    der(h) = 0;
-  end if;
-
-equation
-
-  if (cardinality(M) == 0) then
-    M.w = pi/30*N;
-  end if;
-
-  deltaP = C2.P - C1.P;
-  deltaH = C2.h - C1.h;
-
-  deltaP = rho*g*hn;
-
-  C1.Q = C2.Q;
-  Q = C1.Q;
-  Q = Qv*rho;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Energy balance equation */
-  if dynamic_energy_balance then
-    V*rho*der(h) = -Q*deltaH + Wr;
-  else
-    deltaH = ThermoSysPro.Functions.SmoothCond(Q, g*hn/ThermoSysPro.Functions.SmoothMax(rh, rh_min),
-                                                  g*hn/ThermoSysPro.Functions.SmoothMin(rh, -rh_min));
-  end if;
-
-  /* Nominal quantities */
-  w_nom = pi/30*N_nom;
-
-  if (mode_car == 1) then
-    Qv_nom = Qv_nom_p;
-    hn_nom = hn_nom_p;
-    rh_nom = rh_nom_p;
-  elseif (mode_car == 2) then
-    Qv_nom = -delta/2/gamma;
-    hn_nom = beta + alpha*delta^2/4/gamma^2;
-    rh_nom = -delta^2/4/gamma;
-  else
-    assert(false, "CentrifugalPump: invalid option");
-  end if;
-
-  Cr_nom = rho*g*Qv_nom*hn_nom/rh_nom/w_nom;
-
-  /* Dimensionless quantities */
-  w_a = w/w_nom;
-  Qv_a = Qv/Qv_nom;
-  hn_a = hn/hn_nom;
-  rh_a = rh/rh_nom;
-  Cr_a = Cr/Cr_nom;
-
-  /* Dimensionless coef. c */
-  if (mode_car == 1) then
-    c = c_p;
-  elseif (mode_car == 2) then
-    c = 1/(1 + alpha*delta^2/4/beta/gamma^2);
-  else
-    assert(false, "CentrifugalPump: invalid option");
-  end if;
-
-  /* Angle theta */
-  theta = noEvent(if (abs(w_a) > w_a_min) then atan(Qv_a/w_a) else
-                        if (abs(Qv_a) < Qv_a_min) then (if (w_a > 0) then 0 else -pi) else
-                        if (Qv_a > 0) then pi/2 else
-                        - pi/2);
-  theta_deg = 180/pi*theta;
-
-  i_h = (theta + pi)/(2*pi)*(size(F_t, 1) - 1) + 1;
-  i_t = (theta + pi)/(2*pi)*(size(G_t, 1) - 1) + 1;
-
-  /* Pump head */
-  if (mode_car_hn == 1) then
-    F = ThermoSysPro.Functions.SplineInterpolation(1:size(F_t, 1), F_t[:], i_h);
-    hn_a = (w_a^2 + Qv_a^2)*F;
-  elseif (mode_car_hn == 2) then
-    F = ((1 - c)*ThermoSysPro.Functions.SmoothSign(w_a)*tan(theta)*ThermoSysPro.Functions.SmoothAbs(tan(theta)) + c)/(1 + tan(theta)^2);
-    hn_a = (1 - c)*Qv_a*abs(Qv_a) + c*w_a^2;
-  else
-    assert(false, "CentrifugalPump: invalid option");
-  end if;
-
-  /* Pump resistive torque */
-  if (mode_car_Cr == 1) then
-    G = ThermoSysPro.Functions.SplineInterpolation(1:size(G_t, 1), G_t[:], i_t);
-    Z = 0;
-    Cr_a = (w_a^2 + Qv_a^2)*G;
-  elseif (mode_car_Cr == 2) then
-    G = 0;
-    Z = (1 + tan(theta)^2)/(b - (b - 1)*tan(theta))*F;
-    Cr_a = if noEvent(abs(w_a) > w_a_min) then w_a^2*Z else w_a^2/b*F;
-  else
-    assert(false, "CentrifugalPump: invalid option");
-  end if;
-
-  /* Pump efficiency */
-  rh_a = if noEvent(abs(w_a) > w_a_min) then
-              -(b - 1)*(Qv_a/w_a)^2 + b*Qv_a/w_a else
-              -(b - 1)*(Qv_a/w_a_min)^2 + b*Qv_a/w_a_min;
-
-  /* Motor power */
-  Wm = Cm*w;
-
-  /* Resistive hydraulic power */
-  Wr = Cr*w;
-
-  /* Kinetic energy of the rotating masses */
-  Ec = 1/2*J*w^2;
-
-  /* Rotating mass equation */
-  if dyn_mech_equation then
-    J*der(w) = Cm - Cr;
-  else
-    0 = Cm - Cr;
-  end if;
-
-  w_rpm = 30/pi*w;
-
-  w = M.w;
-  Cm = M.Ctr;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-  h = (C1.h + C2.h)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-30,40},{60,0},{-30,-40},{-30,40}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.03,
-      y=0.02,
-      width=0.95,
-      height=0.95),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-30,40},{60,0},{-30,-40},{-30,40}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 20129</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 12.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end CentrifugalPump;
+within ThermoSysPro.WaterSteam.Machines;
+model CentrifugalPump "Centrifugal pump"
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N=1400
+    "Pump angular velocity in rpm (active if input M is not connected)";
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N_nom=1400
+    "Nominal angular velocity in rpm";
+  parameter Units.SI.MomentOfInertia J=10
+    "Rotating masses moment of inertia (active if dynamic_mech_equation=true)";
+  parameter Units.SI.Volume V=1
+    "Pump volume (active if dynamic_energy_balance=true)";
+  parameter Boolean dynamic_mech_equation=false
+    "true: dynamic mechanical equation - false: static mechanical equation (active if input M is connected)";
+  parameter Boolean dynamic_energy_balance=false
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=1
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+  parameter Integer mode_car=2
+    "1:nominal values and coef. c given by parameters - 2:nominal values and coef. c computed from semi-parabolic characteristics";
+  parameter Integer mode_car_hn=2
+    "1:complete pump head characteristics - 2:semi-parabolic pump head characteristics";
+  parameter Integer mode_car_Cr=2
+    "1:complete torque characteristics - 2:analytic formula";
+
+  parameter Units.SI.VolumeFlowRate Qv_nom_p=0.4781
+    "Nominal volumetric flow (active if mode_car=1)";
+  parameter Units.SI.Height hn_nom_p=22.879
+    "Nominal pump head (active if mode_car=1)";
+  parameter Units.SI.Height rh_nom_p=0.863
+    "Nominal pump efficiency (active if mode_car=1)";
+
+  parameter Real F_t[:]={ 0.634, 0.643, 0.646, 0.640, 0.629, 0.613, 0.595, 0.575, 0.552, 0.533, 0.516, 0.505,
+                          0.504, 0.510, 0.512, 0.522, 0.539, 0.559, 0.580, 0.601, 0.630, 0.662, 0.692, 0.722,
+                          0.753, 0.782, 0.808, 0.832, 0.857, 0.879, 0.904, 0.930, 0.959, 0.996, 1.027, 1.060,
+                          1.090, 1.124, 1.165, 1.204, 1.238, 1.258, 1.271, 1.282, 1.288, 1.281, 1.260, 1.225,
+                          1.172, 1.107, 1.031, 0.942, 0.842, 0.733, 0.617, 0.500, 0.368, 0.240, 0.125, 0.011,
+                         -0.102,-0.168,-0.255,-0.342,-0.423,-0.494,-0.556,-0.620,-0.655,-0.670,-0.670,-0.660,
+                         -0.655,-0.640,-0.600,-0.570,-0.520,-0.470,-0.430,-0.360,-0.275,-0.160,-0.040, 0.130,
+                          0.295, 0.430, 0.550, 0.620, 0.634}
+    "Head characteristics (active if mode_car_hn=1)";
+
+  parameter Real G_t[:]={-0.684,-0.547,-0.414,-0.292,-0.187,-0.105,-0.053,-0.012, 0.042, 0.097, 0.156, 0.227,
+                          0.300, 0.371, 0.444, 0.522, 0.596, 0.672, 0.738, 0.763, 0.797, 0.837, 0.865, 0.883,
+                          0.886, 0.877, 0.859, 0.838, 0.804, 0.758, 0.703, 0.645, 0.583, 0.520, 0.454, 0.408,
+                          0.370, 0.343, 0.331, 0.329, 0.338, 0.354, 0.372, 0.405, 0.450, 0.486, 0.520, 0.552,
+                          0.579, 0.603, 0.616, 0.617, 0.606, 0.582, 0.546, 0.500, 0.432, 0.360, 0.288, 0.214,
+                          0.123, 0.037,-0.053,-0.161,-0.248,-0.314,-0.372,-0.580,-0.740,-0.880,-1.000,-1.120,
+                         -1.250,-1.370,-1.490,-1.590,-1.660,-1.690,-1.770,-1.650,-1.590,-1.520,-1.420,-1.320,
+                         -1.230,-1.100,-0.980,-0.820, -0.684}
+    "Torque characteristics (active if mode_car_Cr=1)";
+
+  parameter Real c_p=1.288
+    "Dimensionless coef. of the semi-parabolic pump head characteristics (active if mode_car=1 and mode_car_hn=2)";
+  constant Real b=2
+    "Dimensionless coef. of the parabolic pump efficiency characteristics";
+
+  parameter Real hn_coef[2]={-88.67, 43.15}
+    "Coef. of the semi-parabolic pump head characteristics (active if mode_car=2)";
+  parameter Real rh_coef[2]={-3.7751, 3.61}
+    "Coef. of the parabolic pump efficiency characteristics (active if mode_car=2)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.AngularVelocity w_a_min=1.e-4 "Small angular velocity";
+  parameter Units.SI.VolumeFlowRate Qv_a_min=1.e-4 "Small volume flow rate";
+  parameter Real rh_min=0.05 "Minimum efficiency";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Real w_a "Dimensionless angular velocity";
+  Real Qv_a(start=1) "Dimensionless volumetric flow";
+  Real hn_a(start=1) "Dimensionless head";
+  Real Cr_a(start=1) "Dimensionless resistive torque";
+  Real rh_a(start=1) "Dimensionless pump efficiency";
+  Units.SI.AngularVelocity w_nom "Nominal angular velocity";
+  Units.SI.VolumeFlowRate Qv_nom "Nominal volumetric flow";
+  Units.SI.Height hn_nom "Nominal pump head";
+  Units.SI.Torque Cr_nom "Nominal resistive hydraulic torque";
+  Real rh_nom "Nominal pump efficiency";
+  Units.SI.Angle theta "Angle arctan(Qv_a/w_a) (rad)";
+  ThermoSysPro.Units.nonSI.Angle_deg theta_deg "Angle arctan(Qv_a/w_a) (deg)";
+  Units.SI.AngularVelocity w "Angular velocity in rad";
+  ThermoSysPro.Units.nonSI.AngularVelocity_rpm w_rpm "Angular velocity in rpm";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow rate";
+  Units.SI.Pressure deltaP
+    "Pressure variation between the outlet and the inlet";
+  Units.SI.Height hn(start=10) "Pump head";
+  Units.SI.Torque Cm "Motor torque";
+  Units.SI.Torque Cr "Resistive hydraulic torque";
+  Real rh "Pump efficiency";
+  Units.SI.Power Wr "Resistive power";
+  Units.SI.Power Wm "Motor power";
+  Units.SI.Energy Ec "Kinetic energy of the rotating masses";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.SpecificEnthalpy deltaH
+    "Specific enthalpy variation between the outlet and the inlet";
+  Units.SI.Pressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
+  Real c "Dimensionless coef. of the semi-parabolic pump head characteristics";
+  Real F "Function F";
+  Real G "Function G";
+  Real Z "Function Z";
+  Real i_h "Index in head characteristics table";
+  Real i_t "Index in torque characteristics table";
+  Real alpha=hn_coef[1] "Coef. alpha of the characteristics for hn";
+  Real beta=hn_coef[2] "Coef. beta of the characteristics for hn";
+  Real gamma=rh_coef[1] "Coef. gamma of the characteristics for rh";
+  Real delta=rh_coef[2] "Coef. delta of the characteristics for rh";
+
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ElectroMechanics.Connectors.MechanichalTorque M
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+initial equation
+  if ((cardinality(M) <> 0) and dynamic_mech_equation) then
+    der(w) = 0;
+  end if;
+
+  if dynamic_energy_balance then
+    der(h) = 0;
+  end if;
+
+equation
+
+  if (cardinality(M) == 0) then
+    M.w = pi/30*N;
+  end if;
+
+  deltaP = C2.P - C1.P;
+  deltaH = C2.h - C1.h;
+
+  deltaP = rho*g*hn;
+
+  C1.Q = C2.Q;
+  Q = C1.Q;
+  Q = Qv*rho;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Energy balance equation */
+  if dynamic_energy_balance then
+    V*rho*der(h) = -Q*deltaH + Wr;
+  else
+    deltaH = ThermoSysPro.Functions.SmoothCond(Q, g*hn/ThermoSysPro.Functions.SmoothMax(rh, rh_min),
+                                                  g*hn/ThermoSysPro.Functions.SmoothMin(rh, -rh_min));
+  end if;
+
+  /* Nominal quantities */
+  w_nom = pi/30*N_nom;
+
+  if (mode_car == 1) then
+    Qv_nom = Qv_nom_p;
+    hn_nom = hn_nom_p;
+    rh_nom = rh_nom_p;
+  elseif (mode_car == 2) then
+    Qv_nom = -delta/2/gamma;
+    hn_nom = beta + alpha*delta^2/4/gamma^2;
+    rh_nom = -delta^2/4/gamma;
+  else
+    assert(false, "CentrifugalPump: invalid option");
+  end if;
+
+  Cr_nom = rho*g*Qv_nom*hn_nom/rh_nom/w_nom;
+
+  /* Dimensionless quantities */
+  w_a = w/w_nom;
+  Qv_a = Qv/Qv_nom;
+  hn_a = hn/hn_nom;
+  rh_a = rh/rh_nom;
+  Cr_a = Cr/Cr_nom;
+
+  /* Dimensionless coef. c */
+  if (mode_car == 1) then
+    c = c_p;
+  elseif (mode_car == 2) then
+    c = 1/(1 + alpha*delta^2/4/beta/gamma^2);
+  else
+    assert(false, "CentrifugalPump: invalid option");
+  end if;
+
+  /* Angle theta */
+  theta = noEvent(if (abs(w_a) > w_a_min) then atan(Qv_a/w_a) else
+                        if (abs(Qv_a) < Qv_a_min) then (if (w_a > 0) then 0 else -pi) else
+                        if (Qv_a > 0) then pi/2 else
+                        - pi/2);
+  theta_deg = 180/pi*theta;
+
+  i_h = (theta + pi)/(2*pi)*(size(F_t, 1) - 1) + 1;
+  i_t = (theta + pi)/(2*pi)*(size(G_t, 1) - 1) + 1;
+
+  /* Pump head */
+  if (mode_car_hn == 1) then
+    F = ThermoSysPro.Functions.SplineInterpolation(1:size(F_t, 1), F_t[:], i_h);
+    hn_a = (w_a^2 + Qv_a^2)*F;
+  elseif (mode_car_hn == 2) then
+    F = ((1 - c)*ThermoSysPro.Functions.SmoothSign(w_a)*tan(theta)*ThermoSysPro.Functions.SmoothAbs(tan(theta)) + c)/(1 + tan(theta)^2);
+    hn_a = (1 - c)*Qv_a*abs(Qv_a) + c*w_a^2;
+  else
+    assert(false, "CentrifugalPump: invalid option");
+  end if;
+
+  /* Pump resistive torque */
+  if (mode_car_Cr == 1) then
+    G = ThermoSysPro.Functions.SplineInterpolation(1:size(G_t, 1), G_t[:], i_t);
+    Z = 0;
+    Cr_a = (w_a^2 + Qv_a^2)*G;
+  elseif (mode_car_Cr == 2) then
+    G = 0;
+    Z = (1 + tan(theta)^2)/(b - (b - 1)*tan(theta))*F;
+    Cr_a = if noEvent(abs(w_a) > w_a_min) then w_a^2*Z else w_a^2/b*F;
+  else
+    assert(false, "CentrifugalPump: invalid option");
+  end if;
+
+  /* Pump efficiency */
+  rh_a = if noEvent(abs(w_a) > w_a_min) then
+              -(b - 1)*(Qv_a/w_a)^2 + b*Qv_a/w_a else
+              -(b - 1)*(Qv_a/w_a_min)^2 + b*Qv_a/w_a_min;
+
+  /* Motor power */
+  Wm = Cm*w;
+
+  /* Resistive hydraulic power */
+  Wr = Cr*w;
+
+  /* Kinetic energy of the rotating masses */
+  Ec = 1/2*J*w^2;
+
+  /* Rotating mass equation */
+  if ((cardinality(M) <> 0) and dynamic_mech_equation) then
+    J*der(w) = Cm - Cr;
+  else
+    0 = Cm - Cr;
+  end if;
+
+  w_rpm = 30/pi*w;
+
+  w = M.w;
+  Cm = M.Ctr;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+  h = (C1.h + C2.h)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-30,40},{60,0},{-30,-40},{-30,40}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.03,
+      y=0.02,
+      width=0.95,
+      height=0.95),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-30,40},{60,0},{-30,-40},{-30,40}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 20129</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 12.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end CentrifugalPump;
diff --git a/ThermoSysPro/WaterSteam/Machines/Compressor.mo b/ThermoSysPro/WaterSteam/Machines/Compressor.mo
index 244c6cf861afdc146560feba75a46000af5cdbe0..623edc478d342ebd0412cbfad5f7abdb1a6665e3 100644
--- a/ThermoSysPro/WaterSteam/Machines/Compressor.mo
+++ b/ThermoSysPro/WaterSteam/Machines/Compressor.mo
@@ -1,104 +1,104 @@
-within ThermoSysPro.WaterSteam.Machines;
-model Compressor "Heat pump compressor "
-  parameter Real pi=10.0 "Compression factor (Ps/Pe)";
-  parameter Real eta=0.85 "Isentropic efficiency";
-  parameter Units.SI.Power W_fric=0.0
-    "Power losses due to hydrodynamic friction (percent)";
-
-public
-  Units.SI.Power W "Mechanical power delivered to the compressor";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy His
-    "Fluid specific enthalpy after isentropic compression";
-  Units.SI.AbsolutePressure Pe(start=10e5) "Inlet pressure";
-  Units.SI.AbsolutePressure Ps(start=10e5) "Outlet pressure";
-  Units.SI.Temperature Te "Inlet temperature";
-  Units.SI.Temperature Ts "Outlet temperature";
-  Real xm(start=1.0) "Average vapor mass fraction";
-
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-
-  Pe = C1.P;
-  Ps = C2.P;
-
-  Q = C1.Q;
-
-  /* No flow reversal */
-  0 = C1.h - C1.h_vol;
-
-  /* Mechnical power delivered to the compressor */
-  W = Q*(C2.h - C1.h) / (1 - W_fric/100);
-
-  /* Compression factor */
-  pi = Ps/Pe;
-
-  /* Average vapor mass fraction */
-  xm = (proe.x + pros.x)/2.0;
-
-  /* Compression efficiency */
-  His - C1.h = max(xm, 0.01)*eta*(C2.h - C1.h);
-
-  /* Fluid thermodynamic properties before the compression */
-  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, 0, 2);
-  Te = proe.T;
-
-  /* Fluid thermodynamic properties after the compression */
-  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, 0, 2);
-  Ts = pros.T;
-
-  /* Fluid thermodynamic properties after the identropic compression */
-  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, 0, 2);
-  His = props.h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid), Line(points={{-60,80},{60,20},{60,-20},
-              {-60,-80}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid), Line(points={{-60,80},{60,20},{60,-20},
-              {-60,-80}}, color={0,0,255})}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Compressor;
+within ThermoSysPro.WaterSteam.Machines;
+model Compressor "Heat pump compressor "
+  parameter Real pi=10.0 "Compression factor (Ps/Pe)";
+  parameter Real eta=0.85 "Isentropic efficiency";
+  parameter Units.SI.Power W_fric=0.0
+    "Power losses due to hydrodynamic friction (percent)";
+
+public
+  Units.SI.Power W "Mechanical power delivered to the compressor";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy His
+    "Fluid specific enthalpy after isentropic compression";
+  Units.SI.AbsolutePressure Pe(start=10e5) "Inlet pressure";
+  Units.SI.AbsolutePressure Ps(start=10e5) "Outlet pressure";
+  Units.SI.Temperature Te "Inlet temperature";
+  Units.SI.Temperature Ts "Outlet temperature";
+  Real xm(start=1.0) "Average vapor mass fraction";
+
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+
+  Pe = C1.P;
+  Ps = C2.P;
+
+  Q = C1.Q;
+
+  /* No flow reversal */
+  0 = C1.h - C1.h_vol;
+
+  /* Mechnical power delivered to the compressor */
+  W = Q*(C2.h - C1.h) / (1 - W_fric/100);
+
+  /* Compression factor */
+  pi = Ps/Pe;
+
+  /* Average vapor mass fraction */
+  xm = (proe.x + pros.x)/2.0;
+
+  /* Compression efficiency */
+  His - C1.h = max(xm, 0.01)*eta*(C2.h - C1.h);
+
+  /* Fluid thermodynamic properties before the compression */
+  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, 0, 2);
+  Te = proe.T;
+
+  /* Fluid thermodynamic properties after the compression */
+  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, 0, 2);
+  Ts = pros.T;
+
+  /* Fluid thermodynamic properties after the identropic compression */
+  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, 0, 2);
+  His = props.h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid), Line(points={{-60,80},{60,20},{60,-20},
+              {-60,-80}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid), Line(points={{-60,80},{60,20},{60,-20},
+              {-60,-80}}, color={0,0,255})}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Compressor;
diff --git a/ThermoSysPro/WaterSteam/Machines/DynamicCentrifugalPump.mo b/ThermoSysPro/WaterSteam/Machines/DynamicCentrifugalPump.mo
index 2e15042f893cb6ded867aef09b8ceb237a9cd2ff..308e28922110ed8c8af7fd4e4708f2e8c9944e7d 100644
--- a/ThermoSysPro/WaterSteam/Machines/DynamicCentrifugalPump.mo
+++ b/ThermoSysPro/WaterSteam/Machines/DynamicCentrifugalPump.mo
@@ -1,200 +1,200 @@
-within ThermoSysPro.WaterSteam.Machines;
-model DynamicCentrifugalPump "Dynamic centrifugal pump"
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
-    "Nominal rotational speed";
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot0=0
-    "Initial rotational speed (active if steady_state_mech=false)";
-  parameter Units.SI.Volume V=1
-    "Pump volume (only if dynamic_energy_balance = true)";
-  parameter Units.SI.MomentOfInertia J=10 "Pump moment of inertia";
-  parameter Real Cf0=10 "Mechanical friction coefficient";
-  parameter Boolean steady_state_mech=true
-    "true: start from steady state - false: start from VRot0";
-  parameter Boolean dynamic_energy_balance=true
-    "true: dynamic energy balance equation - false: static energy balance equation";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=1
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-  parameter Real a1=-88.67
-    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-  parameter Real a2=0
-    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
-  parameter Real a3=43.15
-    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter Real b1=-3.7751
-    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
-  parameter Real b2=3.61
-    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
-  parameter Real b3=-0.0075464
-    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-6 "Small number";
-  parameter Real rhmin=0.05 "Minimum efficiency to avoid zero crossings";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Real rh "Hydraulic efficiency";
-  Units.SI.Height hn(start=10) "Pump head";
-  ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot(start=VRotn)
-    "Rotational speed";
-  Units.SI.AngularVelocity w "Angular speed";
-  Real R "Ratio VRot/VRotn (s.u.)";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
-  Units.SI.Torque Cm "Motor torque";
-  Units.SI.Torque Ch "Hydraulic torque";
-  Units.SI.Torque Cf "Mechanical friction torque";
-  Units.SI.Power Wm "Motor power";
-  Units.SI.Power Wh "Hydraulic power";
-  Units.SI.Power Wf "Mechanical friction power";
-  Units.SI.Density rho "Fluid density";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Pressure variation between the outlet and the inlet";
-  Units.SI.SpecificEnthalpy deltaH
-    "Specific enthalpy variation between the outlet and the inlet";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid average specific enthalpy";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
-           {{90,-12},{110,8}}, rotation=0)));
-initial equation
-  if steady_state_mech then
-    der(w) = 0;
-  else
-    w = (pi/30)*VRot0;
-  end if;
-
-  if dynamic_energy_balance then
-    der(h) = 0;
-  end if;
-
-equation
-
-  Cm = M.Ctr;
-  w = M.w;
-
-  deltaP = C2.P - C1.P;
-  deltaH = C2.h - C1.h;
-
-  C1.Q = C2.Q;
-  Q = C1.Q;
-  Q = Qv*rho;
-
-  deltaP = rho*g*hn;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Energy balance equation */
-  if dynamic_energy_balance then
-    V*rho*der(h) = -Q*deltaH + Wh + Wf;
-  else
-    0 = -Q*deltaH + Wh + Wf;
-  end if;
-
-  /* Pump characteristics */
-  VRot = (30/pi)*w;
-  R = VRot/VRotn;
-
-  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R*abs(R));
-  rh = noEvent(max(if (abs(R) > eps) then b1*Qv^2/R^2 + b2*Qv/R + b3 else b3, rhmin));
-
-  /* Rotating mass equation */
-  J*der(w) = Cm - Cf - Ch;
-
-  /* Mechanical power */
-  Wm = Cm*w;
-
-  /* Hydraulic power */
-  Wh = Qv*deltaP/rh;
-  Wh = Ch*w;
-
-  /* Friction power */
-  Cf = noEvent(if (abs(R) < 1) then ThermoSysPro.Functions.SmoothSign(R)*Cf0*(1 - abs(R)) else 0);
-  Wf = Cf*w;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-  h = (C1.h + C2.h)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,0},{80,0}}, color={0,0,0}),
-        Line(points={{80,0},{2,60}}, color={0,0,0}),
-        Line(points={{80,0},{0,-60}}, color={0,0,0})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-80,0},{80,0}}),
-        Line(points={{80,0},{2,60}}),
-        Line(points={{80,0},{0,-60}}),
-        Text(extent={{-28,-54},{32,-106}}, textString=
-                                               "Q"),
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{80,0},{2,60}}, color={0,0,0}),
-        Line(points={{-80,0},{80,0}}, color={0,0,0}),
-        Line(points={{80,0},{0,-60}}, color={0,0,0})}),
-    Window(
-      x=0.16,
-      y=0.01,
-      width=0.68,
-      height=0.94),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DynamicCentrifugalPump;
+within ThermoSysPro.WaterSteam.Machines;
+model DynamicCentrifugalPump "Dynamic centrifugal pump"
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
+    "Nominal rotational speed";
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot0=0
+    "Initial rotational speed (active if steady_state_mech=false)";
+  parameter Units.SI.Volume V=1
+    "Pump volume (only if dynamic_energy_balance = true)";
+  parameter Units.SI.MomentOfInertia J=10 "Pump moment of inertia";
+  parameter Real Cf0=10 "Mechanical friction coefficient";
+  parameter Boolean steady_state_mech=true
+    "true: start from steady state - false: start from VRot0";
+  parameter Boolean dynamic_energy_balance=true
+    "true: dynamic energy balance equation - false: static energy balance equation";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=1
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+  parameter Real a1=-88.67
+    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+  parameter Real a2=0
+    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
+  parameter Real a3=43.15
+    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter Real b1=-3.7751
+    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
+  parameter Real b2=3.61
+    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
+  parameter Real b3=-0.0075464
+    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-6 "Small number";
+  parameter Real rhmin=0.05 "Minimum efficiency to avoid zero crossings";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Real rh "Hydraulic efficiency";
+  Units.SI.Height hn(start=10) "Pump head";
+  ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot(start=VRotn)
+    "Rotational speed";
+  Units.SI.AngularVelocity w "Angular speed";
+  Real R "Ratio VRot/VRotn (s.u.)";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
+  Units.SI.Torque Cm "Motor torque";
+  Units.SI.Torque Ch "Hydraulic torque";
+  Units.SI.Torque Cf "Mechanical friction torque";
+  Units.SI.Power Wm "Motor power";
+  Units.SI.Power Wh "Hydraulic power";
+  Units.SI.Power Wf "Mechanical friction power";
+  Units.SI.Density rho "Fluid density";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Pressure variation between the outlet and the inlet";
+  Units.SI.SpecificEnthalpy deltaH
+    "Specific enthalpy variation between the outlet and the inlet";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid average specific enthalpy";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
+           {{90,-12},{110,8}}, rotation=0)));
+initial equation
+  if steady_state_mech then
+    der(w) = 0;
+  else
+    w = (pi/30)*VRot0;
+  end if;
+
+  if dynamic_energy_balance then
+    der(h) = 0;
+  end if;
+
+equation
+
+  Cm = M.Ctr;
+  w = M.w;
+
+  deltaP = C2.P - C1.P;
+  deltaH = C2.h - C1.h;
+
+  C1.Q = C2.Q;
+  Q = C1.Q;
+  Q = Qv*rho;
+
+  deltaP = rho*g*hn;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Energy balance equation */
+  if dynamic_energy_balance then
+    V*rho*der(h) = -Q*deltaH + Wh + Wf;
+  else
+    0 = -Q*deltaH + Wh + Wf;
+  end if;
+
+  /* Pump characteristics */
+  VRot = (30/pi)*w;
+  R = VRot/VRotn;
+
+  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R*abs(R));
+  rh = noEvent(max(if (abs(R) > eps) then b1*Qv^2/R^2 + b2*Qv/R + b3 else b3, rhmin));
+
+  /* Rotating mass equation */
+  J*der(w) = Cm - Cf - Ch;
+
+  /* Mechanical power */
+  Wm = Cm*w;
+
+  /* Hydraulic power */
+  Wh = Qv*deltaP/rh;
+  Wh = Ch*w;
+
+  /* Friction power */
+  Cf = noEvent(if (abs(R) < 1) then ThermoSysPro.Functions.SmoothSign(R)*Cf0*(1 - abs(R)) else 0);
+  Wf = Cf*w;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+  h = (C1.h + C2.h)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,0},{80,0}}, color={0,0,0}),
+        Line(points={{80,0},{2,60}}, color={0,0,0}),
+        Line(points={{80,0},{0,-60}}, color={0,0,0})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-80,0},{80,0}}),
+        Line(points={{80,0},{2,60}}),
+        Line(points={{80,0},{0,-60}}),
+        Text(extent={{-28,-54},{32,-106}}, textString=
+                                               "Q"),
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{80,0},{2,60}}, color={0,0,0}),
+        Line(points={{-80,0},{80,0}}, color={0,0,0}),
+        Line(points={{80,0},{0,-60}}, color={0,0,0})}),
+    Window(
+      x=0.16,
+      y=0.01,
+      width=0.68,
+      height=0.94),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DynamicCentrifugalPump;
diff --git a/ThermoSysPro/WaterSteam/Machines/Generator.mo b/ThermoSysPro/WaterSteam/Machines/Generator.mo
index 9775813757293742286913ac673dedd571e5d92c..f71d90cb3cee25f9417613105cbdf45e8254d0ec 100644
--- a/ThermoSysPro/WaterSteam/Machines/Generator.mo
+++ b/ThermoSysPro/WaterSteam/Machines/Generator.mo
@@ -1,183 +1,183 @@
-within ThermoSysPro.WaterSteam.Machines;
-model Generator "Eletrical generator"
-  parameter Real eta = 99.8 "Efficiency (percent)";
-
-public
-  Units.SI.Power Welec "Electrical power produced by the generator";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
-    annotation (Placement(transformation(extent={{-116,26},{-84,54}}, rotation=
-            0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
-    annotation (Placement(transformation(extent={{-116,66},{-84,94}}, rotation=
-            0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
-    annotation (Placement(transformation(extent={{-116,-14},{-84,14}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
-    annotation (Placement(transformation(extent={{-116,-54},{-84,-26}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
-    annotation (Placement(transformation(extent={{-116,-94},{-84,-66}},
-          rotation=0)));
-equation
-  /* Hnadling of unconnected connectors */
-  if (cardinality(Wmec1) == 0) then
-    Wmec1.signal = 0;
-  end if;
-  if (cardinality(Wmec2) == 0) then
-   Wmec2.signal = 0;
-  end if;
-  if (cardinality(Wmec3) == 0) then
-   Wmec3.signal = 0;
-  end if;
-  if (cardinality(Wmec4) == 0) then
-   Wmec4.signal = 0;
-  end if;
-  if (cardinality(Wmec5) == 0) then
-   Wmec5.signal = 0;
-  end if;
-
-  assert(eta <= 100, "Generator : efficiency over 100%");
-  assert(eta >= 0, "Generator : efficiency below 0%");
-
-  /* Electrical power produced by the generator */
-  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal)*eta/100;
-
-  annotation (Diagram(graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
-        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
-        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
-        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
-        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
-                                Icon(graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
-        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
-        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
-        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
-        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
-        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Generator;
+within ThermoSysPro.WaterSteam.Machines;
+model Generator "Eletrical generator"
+  parameter Real eta = 99.8 "Efficiency (percent)";
+
+public
+  Units.SI.Power Welec "Electrical power produced by the generator";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
+    annotation (Placement(transformation(extent={{-116,26},{-84,54}}, rotation=
+            0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
+    annotation (Placement(transformation(extent={{-116,66},{-84,94}}, rotation=
+            0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
+    annotation (Placement(transformation(extent={{-116,-14},{-84,14}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
+    annotation (Placement(transformation(extent={{-116,-54},{-84,-26}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
+    annotation (Placement(transformation(extent={{-116,-94},{-84,-66}},
+          rotation=0)));
+equation
+  /* Hnadling of unconnected connectors */
+  if (cardinality(Wmec1) == 0) then
+    Wmec1.signal = 0;
+  end if;
+  if (cardinality(Wmec2) == 0) then
+   Wmec2.signal = 0;
+  end if;
+  if (cardinality(Wmec3) == 0) then
+   Wmec3.signal = 0;
+  end if;
+  if (cardinality(Wmec4) == 0) then
+   Wmec4.signal = 0;
+  end if;
+  if (cardinality(Wmec5) == 0) then
+   Wmec5.signal = 0;
+  end if;
+
+  assert(eta <= 100, "Generator : efficiency over 100%");
+  assert(eta >= 0, "Generator : efficiency below 0%");
+
+  /* Electrical power produced by the generator */
+  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal)*eta/100;
+
+  annotation (Diagram(graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
+        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
+        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
+        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
+        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
+                                Icon(graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
+        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
+        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
+        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
+        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
+        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Generator;
diff --git a/ThermoSysPro/WaterSteam/Machines/Generator8.mo b/ThermoSysPro/WaterSteam/Machines/Generator8.mo
index 4475b48d905b764fea03b57a031e335119ba0119..b005ce272ad0b6f50e29d1cea99c10726bc13569 100644
--- a/ThermoSysPro/WaterSteam/Machines/Generator8.mo
+++ b/ThermoSysPro/WaterSteam/Machines/Generator8.mo
@@ -1,204 +1,204 @@
-within ThermoSysPro.WaterSteam.Machines;
-model Generator8 "Eletrical generator"
-  parameter Real eta = 99.8 "Efficiency (percent)";
-
-public
-  Units.SI.Power Welec "Electrical power produced by the generator";
-
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
-    annotation (Placement(transformation(extent={{-116,78},{-84,106}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
-    annotation (Placement(transformation(extent={{-116,116},{-84,144}},
-          rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
-    annotation (Placement(transformation(extent={{-116,40},{-84,68}}, rotation=
-            0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
-    annotation (Placement(transformation(extent={{-116,3},{-84,31}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
-    annotation (Placement(transformation(extent={{-116,-34},{-84,-6}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec6
-    annotation (Placement(transformation(extent={{-116,-71},{-84,-43}},
-          rotation=0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec7
-    annotation (Placement(transformation(extent={{-116,-108},{-84,-80}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec8
-    annotation (Placement(transformation(extent={{-116,-144},{-84,-116}},
-          rotation=0)));
-equation
-  /* Hnadling of unconnected connectors */
-  if (cardinality(Wmec1) == 0) then
-    Wmec1.signal = 0;
-  end if;
-  if (cardinality(Wmec2) == 0) then
-   Wmec2.signal = 0;
-  end if;
-  if (cardinality(Wmec3) == 0) then
-   Wmec3.signal = 0;
-  end if;
-  if (cardinality(Wmec4) == 0) then
-   Wmec4.signal = 0;
-  end if;
-  if (cardinality(Wmec5) == 0) then
-   Wmec5.signal = 0;
-  end if;
-  if (cardinality(Wmec6) == 0) then
-   Wmec3.signal = 0;
-  end if;
-  if (cardinality(Wmec7) == 0) then
-   Wmec4.signal = 0;
-  end if;
-  if (cardinality(Wmec8) == 0) then
-   Wmec5.signal = 0;
-  end if;
-
-  assert(eta <= 100, "Generator : efficiency over 100%");
-  assert(eta >= 0, "Generator : efficiency below 0%");
-
-  /* Electrical power produced by the generator */
-  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal + Wmec6.signal + Wmec7.signal + Wmec8.signal)*eta/100;
-
-  annotation (Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-130},{100,130}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-84,130},{-84,-130}},
-          color={0,0,255},
-          thickness=0.5)}),     Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-130},{100,130}},
-        initialScale=0.1), graphics={
-        Rectangle(
-          extent={{-56,33},{66,-33}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-56,-3},{66,1}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,17},{66,21}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-21},{66,-17}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{66,13},{78,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-68,13},{-56,-11}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
-              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
-              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
-              -44,21}}),
-        Rectangle(
-          extent={{-56,31},{66,35}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Rectangle(
-          extent={{-56,-35},{66,-31}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.Sphere,
-          fillColor={255,0,0}),
-        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
-        Polygon(
-          points={{42,13},{28,7},{36,-1},{42,13}},
-          lineColor={0,0,255},
-          lineThickness=1,
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
-        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
-        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
-        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
-        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
-        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
-        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Generator8;
+within ThermoSysPro.WaterSteam.Machines;
+model Generator8 "Eletrical generator"
+  parameter Real eta = 99.8 "Efficiency (percent)";
+
+public
+  Units.SI.Power Welec "Electrical power produced by the generator";
+
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec2
+    annotation (Placement(transformation(extent={{-116,78},{-84,106}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec1
+    annotation (Placement(transformation(extent={{-116,116},{-84,144}},
+          rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec3
+    annotation (Placement(transformation(extent={{-116,40},{-84,68}}, rotation=
+            0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec4
+    annotation (Placement(transformation(extent={{-116,3},{-84,31}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec5
+    annotation (Placement(transformation(extent={{-116,-34},{-84,-6}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec6
+    annotation (Placement(transformation(extent={{-116,-71},{-84,-43}},
+          rotation=0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec7
+    annotation (Placement(transformation(extent={{-116,-108},{-84,-80}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Wmec8
+    annotation (Placement(transformation(extent={{-116,-144},{-84,-116}},
+          rotation=0)));
+equation
+  /* Hnadling of unconnected connectors */
+  if (cardinality(Wmec1) == 0) then
+    Wmec1.signal = 0;
+  end if;
+  if (cardinality(Wmec2) == 0) then
+   Wmec2.signal = 0;
+  end if;
+  if (cardinality(Wmec3) == 0) then
+   Wmec3.signal = 0;
+  end if;
+  if (cardinality(Wmec4) == 0) then
+   Wmec4.signal = 0;
+  end if;
+  if (cardinality(Wmec5) == 0) then
+   Wmec5.signal = 0;
+  end if;
+  if (cardinality(Wmec6) == 0) then
+   Wmec3.signal = 0;
+  end if;
+  if (cardinality(Wmec7) == 0) then
+   Wmec4.signal = 0;
+  end if;
+  if (cardinality(Wmec8) == 0) then
+   Wmec5.signal = 0;
+  end if;
+
+  assert(eta <= 100, "Generator : efficiency over 100%");
+  assert(eta >= 0, "Generator : efficiency below 0%");
+
+  /* Electrical power produced by the generator */
+  Welec = (Wmec1.signal + Wmec2.signal + Wmec3.signal + Wmec4.signal + Wmec5.signal + Wmec6.signal + Wmec7.signal + Wmec8.signal)*eta/100;
+
+  annotation (Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-130},{100,130}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-84,130},{-84,-130}},
+          color={0,0,255},
+          thickness=0.5)}),     Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-130},{100,130}},
+        initialScale=0.1), graphics={
+        Rectangle(
+          extent={{-56,33},{66,-33}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-56,-3},{66,1}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,17},{66,21}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-21},{66,-17}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{66,13},{78,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-68,13},{-56,-11}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-42,-23},{-44,-27},{-46,-29},{-50,-31},{-54,-31},{-58,-29},
+              {-62,-23},{-64,-15},{-64,-7},{-64,15},{-62,21},{-60,25},{-58,27},
+              {-54,29},{-52,29},{-48,27},{-46,25},{-44,21},{-44,27},{-48,23},{
+              -44,21}}),
+        Rectangle(
+          extent={{-56,31},{66,35}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Rectangle(
+          extent={{-56,-35},{66,-31}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.Sphere,
+          fillColor={255,0,0}),
+        Line(points={{-26,-11},{-4,13},{16,-15},{42,13}}, color={0,0,255}),
+        Polygon(
+          points={{42,13},{28,7},{36,-1},{42,13}},
+          lineColor={0,0,255},
+          lineThickness=1,
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-74,0},{-68,0}}, color={0,128,255}),
+        Line(points={{-80,80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-82,0},{-68,0}}, color={0,0,255}),
+        Line(points={{-96,0},{-82,0}}, color={0,0,255}),
+        Line(points={{-96,-80},{-80,-80}}, color={0,0,255}),
+        Line(points={{-96,80},{-80,80}}, color={0,0,255}),
+        Line(points={{-96,40},{-80,40}}, color={0,0,255}),
+        Line(points={{-96,-40},{-80,-40}}, color={0,0,255})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Generator8;
diff --git a/ThermoSysPro/WaterSteam/Machines/StaticCentrifugalPump.mo b/ThermoSysPro/WaterSteam/Machines/StaticCentrifugalPump.mo
index da02b64abdc5198579fb237a8fdb16e00d157d97..9904bb20e08efe2c81218d12e42d19456e9ab19a 100644
--- a/ThermoSysPro/WaterSteam/Machines/StaticCentrifugalPump.mo
+++ b/ThermoSysPro/WaterSteam/Machines/StaticCentrifugalPump.mo
@@ -1,185 +1,185 @@
-within ThermoSysPro.WaterSteam.Machines;
-model StaticCentrifugalPump "Static centrifugal pump"
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
-    "Fixed rotational speed (active if fixed_rot_or_power=1 and rpm_or_mpower connector not connected)";
-  parameter Units.SI.Power MPower=0.1e6
-    "Fixed mechanical power (active if fixed_rot_or_power=2 and rpm_or_mpower connector not connected)";
-  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
-    "Nominal rotational speed";
-  parameter Real rm=0.85
-    "Product of the pump mechanical and electrical efficiencies";
-  parameter Integer fixed_rot_or_power=1
-    "1: fixed rotational speed - 2: fixed mechanical power";
-  parameter Boolean adiabatic_compression=false
-    "true: compression at constant enthalpy - false: compression with varying enthalpy";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=1
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-  parameter Real a1=-88.67
-    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
-  parameter Real a2=0
-    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
-  parameter Real a3=43.15
-    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
-
-  parameter Real b1=-3.7751
-    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
-  parameter Real b2=3.61
-    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
-  parameter Real b3=-0.0075464
-    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-6 "Small number";
-  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Real rh "Hydraulic efficiency";
-  Units.SI.Height hn(start=10) "Pump head";
-  Real R(start=VRot/VRotn) "Reduced rotational speed";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
-  Units.SI.Power Wh "Hydraulic power";
-  Units.SI.Power Wm "Mechanical power";
-  ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vr "Rotational speed";
-  Units.SI.Density rho(start=998) "Fluid density";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Pressure variation between the outlet and the inlet";
-  Units.SI.SpecificEnthalpy deltaH
-    "Specific enthalpy variation between the outlet and the inlet";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal rpm_or_mpower
-    annotation (Placement(transformation(
-        origin={0,-110},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-equation
-  if (cardinality(rpm_or_mpower) == 0) then
-    if (fixed_rot_or_power == 1) then
-      rpm_or_mpower.signal = VRot;
-    elseif (fixed_rot_or_power == 2) then
-      rpm_or_mpower.signal = MPower;
-    else
-      assert(false, "StaticCentrifugalPump: incorrect option");
-    end if;
-  end if;
-
-  deltaP = C2.P - C1.P;
-  deltaH = C2.h - C1.h;
-
-  deltaP = rho*g*hn;
-
-  C1.Q = C2.Q;
-  Q = C1.Q;
-  Q = Qv*rho;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Fixed rotational speed or fixed mechanical power */
-  if (fixed_rot_or_power == 1) then
-    Vr = rpm_or_mpower.signal;
-  elseif (fixed_rot_or_power == 2) then
-    Wm = rpm_or_mpower.signal;
-  else
-    assert(false, "StaticCentrifugalPump: incorrect option");
-  end if;
-
-  /* Energy balance equation */
-  if adiabatic_compression then
-    deltaH = 0;
-  else
-    deltaH = g*hn/rh;
-  end if;
-
-  /* Reduced rotational speed */
-  R = Vr/VRotn;
-
-  /* Pump characteristics */
-  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
-  rh = noEvent(max(if (abs(R) > eps) then b1*Qv*abs(Qv)/R^2 + b2*Qv/R + b3 else b3, rhmin));
-
-  /* Mechanical power */
-  Wm = Q*deltaH/rm;
-
-  /* Hydraulic power */
-  Wh = Qv*deltaP/rh;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-  h = (C1.h + C2.h)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,0},{80,0}}),
-        Line(points={{80,0},{2,60}}),
-        Line(points={{80,0},{0,-60}})}),
-    Window(
-      x=0.03,
-      y=0.02,
-      width=0.95,
-      height=0.95),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,0},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-80,0},{80,0}}),
-        Line(points={{80,0},{2,60}}),
-        Line(points={{80,0},{0,-60}})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 12.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    DymolaStoredErrors);
-end StaticCentrifugalPump;
+within ThermoSysPro.WaterSteam.Machines;
+model StaticCentrifugalPump "Static centrifugal pump"
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400
+    "Fixed rotational speed (active if fixed_rot_or_power=1 and rpm_or_mpower connector not connected)";
+  parameter Units.SI.Power MPower=0.1e6
+    "Fixed mechanical power (active if fixed_rot_or_power=2 and rpm_or_mpower connector not connected)";
+  parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400
+    "Nominal rotational speed";
+  parameter Real rm=0.85
+    "Product of the pump mechanical and electrical efficiencies";
+  parameter Integer fixed_rot_or_power=1
+    "1: fixed rotational speed - 2: fixed mechanical power";
+  parameter Boolean adiabatic_compression=false
+    "true: compression at constant enthalpy - false: compression with varying enthalpy";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=1
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+  parameter Real a1=-88.67
+    "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+  parameter Real a2=0
+    "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
+  parameter Real a3=43.15
+    "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+  parameter Real b1=-3.7751
+    "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
+  parameter Real b2=3.61
+    "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
+  parameter Real b3=-0.0075464
+    "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-6 "Small number";
+  parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Real rh "Hydraulic efficiency";
+  Units.SI.Height hn(start=10) "Pump head";
+  Real R(start=VRot/VRotn) "Reduced rotational speed";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
+  Units.SI.Power Wh "Hydraulic power";
+  Units.SI.Power Wm "Mechanical power";
+  ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vr "Rotational speed";
+  Units.SI.Density rho(start=998) "Fluid density";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Pressure variation between the outlet and the inlet";
+  Units.SI.SpecificEnthalpy deltaH
+    "Specific enthalpy variation between the outlet and the inlet";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal rpm_or_mpower
+    annotation (Placement(transformation(
+        origin={0,-110},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+equation
+  if (cardinality(rpm_or_mpower) == 0) then
+    if (fixed_rot_or_power == 1) then
+      rpm_or_mpower.signal = VRot;
+    elseif (fixed_rot_or_power == 2) then
+      rpm_or_mpower.signal = MPower;
+    else
+      assert(false, "StaticCentrifugalPump: incorrect option");
+    end if;
+  end if;
+
+  deltaP = C2.P - C1.P;
+  deltaH = C2.h - C1.h;
+
+  deltaP = rho*g*hn;
+
+  C1.Q = C2.Q;
+  Q = C1.Q;
+  Q = Qv*rho;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Fixed rotational speed or fixed mechanical power */
+  if (fixed_rot_or_power == 1) then
+    Vr = rpm_or_mpower.signal;
+  elseif (fixed_rot_or_power == 2) then
+    Wm = rpm_or_mpower.signal;
+  else
+    assert(false, "StaticCentrifugalPump: incorrect option");
+  end if;
+
+  /* Energy balance equation */
+  if adiabatic_compression then
+    deltaH = 0;
+  else
+    deltaH = g*hn/rh;
+  end if;
+
+  /* Reduced rotational speed */
+  R = Vr/VRotn;
+
+  /* Pump characteristics */
+  hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2);
+  rh = noEvent(max(if (abs(R) > eps) then b1*Qv*abs(Qv)/R^2 + b2*Qv/R + b3 else b3, rhmin));
+
+  /* Mechanical power */
+  Wm = Q*deltaH/rm;
+
+  /* Hydraulic power */
+  Wh = Qv*deltaP/rh;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+  h = (C1.h + C2.h)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,0},{80,0}}),
+        Line(points={{80,0},{2,60}}),
+        Line(points={{80,0},{0,-60}})}),
+    Window(
+      x=0.03,
+      y=0.02,
+      width=0.95,
+      height=0.95),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,0},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-80,0},{80,0}}),
+        Line(points={{80,0},{2,60}}),
+        Line(points={{80,0},{0,-60}})}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 12.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    DymolaStoredErrors);
+end StaticCentrifugalPump;
diff --git a/ThermoSysPro/WaterSteam/Machines/SteamEngine.mo b/ThermoSysPro/WaterSteam/Machines/SteamEngine.mo
index 21481bba97575aa1cc09e2b0dc5a6e0aec4236b1..8340ebebf037129ef3d0e76112d8e80560e8f964 100644
--- a/ThermoSysPro/WaterSteam/Machines/SteamEngine.mo
+++ b/ThermoSysPro/WaterSteam/Machines/SteamEngine.mo
@@ -1,151 +1,151 @@
-within ThermoSysPro.WaterSteam.Machines;
-model SteamEngine "Steam engine"
-  parameter Real caract[:, 2]=[0, 0; 15e5, 20.0]
-    "Engine charateristics Q=f(deltaP)";
-  parameter Real eta_is=0.85 "Isentropic efficiency";
-  parameter Real W_frot=0.0
-    "Power losses due to hydrodynamic friction (percent)";
-  parameter Real eta_stato=1.0
-    "Efficiency to account for cinetic losses (<= 1) (s.u.)";
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation";
-  parameter Integer mode_e=0
-    "Inlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_s=0
-    "Outlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Power W "Power produced by the engine";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy His
-    "Fluid specific enthalpy after isentropic expansion";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss";
-  Units.SI.AbsolutePressure Pe(start=10e5) "Pressure at the inlet";
-  Units.SI.AbsolutePressure Ps(start=10e5) "Pressure at the outlet";
-  Units.SI.Temperature Te "Temperature at the inlet";
-  Units.SI.Temperature Ts "Temperature at the outlet";
-  Real xm(start=1.0,min=0) "Average vapor mass fraction (n.u.)";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=
-            0)));
-  Connectors.FluidOutlet C2      annotation (Placement(transformation(extent={{
-            60,-10},{80,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
-    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
-equation
-
-  Pe = C1.P;
-  Ps = C2.P;
-  deltaP = Pe - Ps;
-
-  C1.Q = C2.Q;
-  Q = C1.Q;
-
-  /* No flow reversal */
-  0 = C1.h - C1.h_vol;
-
-  /* Average vapor mass fraction during the expansion */
-  xm = (proe.x + pros.x)/2.0;
-
-  /* Mass flow */
-  if (option_interpolation == 1) then
-    Q = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], deltaP);
-  elseif (option_interpolation == 2) then
-    Q = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], deltaP);
-  else
-    assert(false, "SteamEngine: incorrect interpolation option");
-  end if;
-
-  /* Fluid specific enthalpy at the outlet */
-  C2.h - C1.h = xm*eta_is*(His - C1.h);
-
-  /* Mechanical power produced by the engine */
-  W = Q*eta_stato*(C1.h - C2.h)*(1 - W_frot/100);
-
-  /* Fluid thermodynamic properties before the expansion */
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pe, C1.h, mode_e);
-  Te = proe.T;
-
-  /* Fluid thermodynamic properties after the expansion */
-  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ps, C2.h, mode_s);
-  Ts = pros.T;
-
-  /* Fluid thermodynamic properties after the isentropic expansion */
-  props = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps(Ps, proe.s, mode_s);
-  His = props.h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,100},{20,12}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-22,-16},{30,-66}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,60},{24,-42}}, color={0,0,255}),
-        Rectangle(
-          extent={{-20,80},{20,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Forward)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,100},{20,20}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-22,-16},{30,-66}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,60},{24,-42}}, color={0,0,255}),
-        Rectangle(
-          extent={{-20,80},{20,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Forward)}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Beno&icirc;t Bride</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SteamEngine;
+within ThermoSysPro.WaterSteam.Machines;
+model SteamEngine "Steam engine"
+  parameter Real caract[:, 2]=[0, 0; 15e5, 20.0]
+    "Engine charateristics Q=f(deltaP)";
+  parameter Real eta_is=0.85 "Isentropic efficiency";
+  parameter Real W_frot=0.0
+    "Power losses due to hydrodynamic friction (percent)";
+  parameter Real eta_stato=1.0
+    "Efficiency to account for cinetic losses (<= 1) (s.u.)";
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation";
+  parameter Integer mode_e=0
+    "Inlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_s=0
+    "Outlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Power W "Power produced by the engine";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy His
+    "Fluid specific enthalpy after isentropic expansion";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss";
+  Units.SI.AbsolutePressure Pe(start=10e5) "Pressure at the inlet";
+  Units.SI.AbsolutePressure Ps(start=10e5) "Pressure at the outlet";
+  Units.SI.Temperature Te "Temperature at the inlet";
+  Units.SI.Temperature Ts "Temperature at the outlet";
+  Real xm(start=1.0,min=0) "Average vapor mass fraction (n.u.)";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0)));
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=
+            0)));
+  Connectors.FluidOutlet C2      annotation (Placement(transformation(extent={{
+            60,-10},{80,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
+    annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0)));
+equation
+
+  Pe = C1.P;
+  Ps = C2.P;
+  deltaP = Pe - Ps;
+
+  C1.Q = C2.Q;
+  Q = C1.Q;
+
+  /* No flow reversal */
+  0 = C1.h - C1.h_vol;
+
+  /* Average vapor mass fraction during the expansion */
+  xm = (proe.x + pros.x)/2.0;
+
+  /* Mass flow */
+  if (option_interpolation == 1) then
+    Q = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], deltaP);
+  elseif (option_interpolation == 2) then
+    Q = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], deltaP);
+  else
+    assert(false, "SteamEngine: incorrect interpolation option");
+  end if;
+
+  /* Fluid specific enthalpy at the outlet */
+  C2.h - C1.h = xm*eta_is*(His - C1.h);
+
+  /* Mechanical power produced by the engine */
+  W = Q*eta_stato*(C1.h - C2.h)*(1 - W_frot/100);
+
+  /* Fluid thermodynamic properties before the expansion */
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pe, C1.h, mode_e);
+  Te = proe.T;
+
+  /* Fluid thermodynamic properties after the expansion */
+  pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Ps, C2.h, mode_s);
+  Ts = pros.T;
+
+  /* Fluid thermodynamic properties after the isentropic expansion */
+  props = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps(Ps, proe.s, mode_s);
+  His = props.h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,100},{20,12}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-22,-16},{30,-66}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,60},{24,-42}}, color={0,0,255}),
+        Rectangle(
+          extent={{-20,80},{20,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Forward)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,100},{20,20}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-22,-16},{30,-66}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,60},{24,-42}}, color={0,0,255}),
+        Rectangle(
+          extent={{-20,80},{20,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Forward)}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Beno&icirc;t Bride</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SteamEngine;
diff --git a/ThermoSysPro/WaterSteam/Machines/StodolaTurbine.mo b/ThermoSysPro/WaterSteam/Machines/StodolaTurbine.mo
index 7bc9956ccc8d861e506b98a8743c3df4ca858aa7..c74dfdb828ce9b493a063cd9336792602cd31c7a 100644
--- a/ThermoSysPro/WaterSteam/Machines/StodolaTurbine.mo
+++ b/ThermoSysPro/WaterSteam/Machines/StodolaTurbine.mo
@@ -1,184 +1,184 @@
-within ThermoSysPro.WaterSteam.Machines;
-model StodolaTurbine "Multistage turbine group using Stodola's ellipse"
-  parameter Real Cst=1.e7 "Stodola's ellipse coefficient";
-  parameter Real W_fric=0.0
-    "Power losses due to hydrodynamic friction (percent)";
-  parameter Real eta_stato=1.0
-    "Efficiency to account for cinetic losses (<= 1) (s.u.)";
-  parameter Units.SI.Area area_nz=1 "Nozzle area";
-  parameter Real eta_nz=1.0
-    "Nozzle efficency (eta_nz < 1 - turbine with nozzle - eta_nz = 1 - turbine without nozzle)";
-  parameter Units.SI.MassFlowRate Qmax=1
-    "Maximum mass flow through the turbine";
-  parameter Real eta_is_nom=0.8 "Nominal isentropic efficiency";
-  parameter Real eta_is_min=0.35 "Minimum isentropic efficiency";
-  parameter Real a=-1.3889
-    "x^2 coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
-  parameter Real b=2.6944
-    "x coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
-  parameter Real c=-0.5056
-    "Constant coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Integer mode_e=0
-    "IF97 region before expansion. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_s=0
-    "IF97 region after expansion. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  parameter Integer mode_ps=0
-    "IF97 region after isentropic expansion. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
-    "Critical pressure";
-  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
-    "Critical temperature";
-
-public
-  Real eta_is(start=0.85) "Isentropic efficiency";
-  Real eta_is_wet(start=0.83) "Isentropic efficiency for wet steam";
-  Units.SI.Power W "Mechanical power produced by the turbine";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.SpecificEnthalpy His
-    "Fluid specific enthalpy after isentropic expansion";
-  Units.SI.SpecificEnthalpy Hrs
-    "Fluid specific enthalpy after the real expansion";
-  Units.SI.AbsolutePressure Pe(start=10e5, min=0) "Pressure at the inlet";
-  Units.SI.AbsolutePressure Ps(start=10e5, min=0) "Pressure at the outlet";
-  Units.SI.Temperature Te(min=0) "Temperature at the inlet";
-  Units.SI.Temperature Ts(min=0) "Temperature at the outlet";
-  Units.SI.Velocity Vs "Fluid velocity at the outlet";
-  Units.SI.Density rhos(start=200) "Fluid density at the outlet";
-  Real xm(start=1.0,min=0) "Average vapor mass fraction";
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  Connectors.FluidInlet Ce
-    annotation (Placement(transformation(extent={{-111,-10},{-91,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet Cs                annotation (Placement(transformation(
-          extent={{91,-10},{111,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
-    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
-          rotation=0)));
-  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
-    annotation (Placement(transformation(
-        origin={0,-100},
-        extent={{10,-10},{-10,10}},
-        rotation=90)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
-                              annotation (Placement(transformation(
-        origin={110,-90},
-        extent={{10,-10},{-10,10}},
-        rotation=180)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros1
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-equation
-  if (cardinality(M) == 0) then
-    M.Ctr = 0;
-    M.w = 0;
-  else
-    M.Ctr*M.w = W;
-  end if;
-
-  Pe = Ce.P;
-  Ps = Cs.P;
-
-  Ce.Q = Cs.Q;
-
-  Q = Ce.Q;
-
-  /* No flow reversal */
-  0 = Ce.h - Ce.h_vol;
-
-  /* Isentropic efficiency */
-  eta_is = if (Q < Qmax) then (max(eta_is_min,(a*(Q/Qmax)^2 + b*(Q/Qmax) + c))) else eta_is_nom;
-  eta_is_wet = xm*eta_is;
-
-  /* Average vapor mass fraction during the expansion */
-  if noEvent((Pe > pcrit) or (Te > Tcrit)) then
-    xm = 1;
-  else
-    xm = (proe.x + pros1.x)/2.0;
-  end if;
-
-  /* Stodola's ellipse law */
-  if noEvent((Pe > pcrit) or (Te > Tcrit)) then
-    Q = sqrt((Pe^2 - Ps^2)/(Cst*Te));
-  else
-    Q = sqrt((Pe^2 - Ps^2)/(Cst*Te*proe.x));
-  end if;
-
-  /* Fluid specific enthalpy after the expansion */
-  Hrs - Ce.h = xm*eta_is*(His - Ce.h);
-
-  /* Fluid specific enthalpy at the outlet of the nozzle */
-  Vs = Q/rhos/area_nz;
-  Cs.h - Hrs = (1 - eta_nz)*Vs^2/2;
-
-  /* Mechanical power produced by the turbine */
-  W = Q*eta_stato*(Ce.h - Cs.h)*(1 - W_fric/100);
-  MechPower.signal = W;
-
-  /* Fluid thermodynamic properties before the expansion */
-  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, Ce.h, mode_e, fluid);
-
-  Te = proe.T;
-
-  /* Fluid thermodynamic properties after the expansion */
-  pros1 = ThermoSysPro.Properties.Fluid.Ph(Ps, Hrs, mode_s, fluid);
-
-  /* Fluid thermodynamic properties at the outlet of the nozzle */
-  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, Cs.h, mode_s, fluid);
-
-  Ts = pros.T;
-  rhos = pros.d;
-
-  /* Fluid thermodynamic properties after the isentropic expansion */
-  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_ps, fluid);
-  His = props.h;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid), Line(
-          points={{0,-70},{0,-90}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid), Line(
-          points={{0,-70},{0,-90}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Window(
-      x=0.17,
-      y=0.1,
-      width=0.76,
-      height=0.76),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 10.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end StodolaTurbine;
+within ThermoSysPro.WaterSteam.Machines;
+model StodolaTurbine "Multistage turbine group using Stodola's ellipse"
+  parameter Real Cst=1.e7 "Stodola's ellipse coefficient";
+  parameter Real W_fric=0.0
+    "Power losses due to hydrodynamic friction (percent)";
+  parameter Real eta_stato=1.0
+    "Efficiency to account for cinetic losses (<= 1) (s.u.)";
+  parameter Units.SI.Area area_nz=1 "Nozzle area";
+  parameter Real eta_nz=1.0
+    "Nozzle efficency (eta_nz < 1 - turbine with nozzle - eta_nz = 1 - turbine without nozzle)";
+  parameter Units.SI.MassFlowRate Qmax=1
+    "Maximum mass flow through the turbine";
+  parameter Real eta_is_nom=0.8 "Nominal isentropic efficiency";
+  parameter Real eta_is_min=0.35 "Minimum isentropic efficiency";
+  parameter Real a=-1.3889
+    "x^2 coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
+  parameter Real b=2.6944
+    "x coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
+  parameter Real c=-0.5056
+    "Constant coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Integer mode_e=0
+    "IF97 region before expansion. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_s=0
+    "IF97 region after expansion. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  parameter Integer mode_ps=0
+    "IF97 region after isentropic expansion. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT
+    "Critical pressure";
+  parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT
+    "Critical temperature";
+
+public
+  Real eta_is(start=0.85) "Isentropic efficiency";
+  Real eta_is_wet(start=0.83) "Isentropic efficiency for wet steam";
+  Units.SI.Power W "Mechanical power produced by the turbine";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.SpecificEnthalpy His
+    "Fluid specific enthalpy after isentropic expansion";
+  Units.SI.SpecificEnthalpy Hrs
+    "Fluid specific enthalpy after the real expansion";
+  Units.SI.AbsolutePressure Pe(start=10e5, min=0) "Pressure at the inlet";
+  Units.SI.AbsolutePressure Ps(start=10e5, min=0) "Pressure at the outlet";
+  Units.SI.Temperature Te(min=0) "Temperature at the inlet";
+  Units.SI.Temperature Ts(min=0) "Temperature at the outlet";
+  Units.SI.Velocity Vs "Fluid velocity at the outlet";
+  Units.SI.Density rhos(start=200) "Fluid density at the outlet";
+  Real xm(start=1.0,min=0) "Average vapor mass fraction";
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  Connectors.FluidInlet Ce
+    annotation (Placement(transformation(extent={{-111,-10},{-91,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet Cs                annotation (Placement(transformation(
+          extent={{91,-10},{111,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props
+    annotation (Placement(transformation(extent={{-100,-100},{-80,-80}},
+          rotation=0)));
+  ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M
+    annotation (Placement(transformation(
+        origin={0,-100},
+        extent={{10,-10},{-10,10}},
+        rotation=90)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower
+                              annotation (Placement(transformation(
+        origin={110,-90},
+        extent={{10,-10},{-10,10}},
+        rotation=180)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros1
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+equation
+  if (cardinality(M) == 0) then
+    M.Ctr = 0;
+    M.w = 0;
+  else
+    M.Ctr*M.w = W;
+  end if;
+
+  Pe = Ce.P;
+  Ps = Cs.P;
+
+  Ce.Q = Cs.Q;
+
+  Q = Ce.Q;
+
+  /* No flow reversal */
+  0 = Ce.h - Ce.h_vol;
+
+  /* Isentropic efficiency */
+  eta_is = if (Q < Qmax) then (max(eta_is_min,(a*(Q/Qmax)^2 + b*(Q/Qmax) + c))) else eta_is_nom;
+  eta_is_wet = xm*eta_is;
+
+  /* Average vapor mass fraction during the expansion */
+  if noEvent((Pe > pcrit) or (Te > Tcrit)) then
+    xm = 1;
+  else
+    xm = (proe.x + pros1.x)/2.0;
+  end if;
+
+  /* Stodola's ellipse law */
+  if noEvent((Pe > pcrit) or (Te > Tcrit)) then
+    Q = sqrt((Pe^2 - Ps^2)/(Cst*Te));
+  else
+    Q = sqrt((Pe^2 - Ps^2)/(Cst*Te*proe.x));
+  end if;
+
+  /* Fluid specific enthalpy after the expansion */
+  Hrs - Ce.h = xm*eta_is*(His - Ce.h);
+
+  /* Fluid specific enthalpy at the outlet of the nozzle */
+  Vs = Q/rhos/area_nz;
+  Cs.h - Hrs = (1 - eta_nz)*Vs^2/2;
+
+  /* Mechanical power produced by the turbine */
+  W = Q*eta_stato*(Ce.h - Cs.h)*(1 - W_fric/100);
+  MechPower.signal = W;
+
+  /* Fluid thermodynamic properties before the expansion */
+  proe = ThermoSysPro.Properties.Fluid.Ph(Pe, Ce.h, mode_e, fluid);
+
+  Te = proe.T;
+
+  /* Fluid thermodynamic properties after the expansion */
+  pros1 = ThermoSysPro.Properties.Fluid.Ph(Ps, Hrs, mode_s, fluid);
+
+  /* Fluid thermodynamic properties at the outlet of the nozzle */
+  pros = ThermoSysPro.Properties.Fluid.Ph(Ps, Cs.h, mode_s, fluid);
+
+  Ts = pros.T;
+  rhos = pros.d;
+
+  /* Fluid thermodynamic properties after the isentropic expansion */
+  props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_ps, fluid);
+  His = props.h;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid), Line(
+          points={{0,-70},{0,-90}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid), Line(
+          points={{0,-70},{0,-90}},
+          color={0,0,0},
+          thickness=0.5)}),
+    Window(
+      x=0.17,
+      y=0.1,
+      width=0.76,
+      height=0.76),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 10.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end StodolaTurbine;
diff --git a/ThermoSysPro/WaterSteam/Machines/package.mo b/ThermoSysPro/WaterSteam/Machines/package.mo
index 74cea520f7625619b34c9e7ae4d740be407f74f0..058750885c95cd5670c7304c71da86aa7200c1b3 100644
--- a/ThermoSysPro/WaterSteam/Machines/package.mo
+++ b/ThermoSysPro/WaterSteam/Machines/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSteam;
-package Machines "Machines"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Machines;
+within ThermoSysPro.WaterSteam;
+package Machines "Machines"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Machines;
diff --git a/ThermoSysPro/WaterSteam/Machines/package.order b/ThermoSysPro/WaterSteam/Machines/package.order
index ff4dbe515881c9b6f4e9b7f55b570008ea82eb87..a150a6150f1e1eeeb5eeaf164ba32003a7d26205 100644
--- a/ThermoSysPro/WaterSteam/Machines/package.order
+++ b/ThermoSysPro/WaterSteam/Machines/package.order
@@ -1,8 +1,8 @@
-CentrifugalPump
-Compressor
-DynamicCentrifugalPump
-Generator
-Generator8
-StaticCentrifugalPump
-SteamEngine
-StodolaTurbine
+CentrifugalPump
+Compressor
+DynamicCentrifugalPump
+Generator
+Generator8
+StaticCentrifugalPump
+SteamEngine
+StodolaTurbine
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/Bend.mo b/ThermoSysPro/WaterSteam/PressureLosses/Bend.mo
index 1f1b69b264284358ce7623321f96694f9590b1a4..44e9ec3787b8f7ba1c7d115346b98930fb3ea6b1 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/Bend.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/Bend.mo
@@ -1,223 +1,223 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model Bend "Bend"
-  parameter Units.SI.Diameter D=0.2 "Pipe diameter";
-  parameter Units.SI.Radius R0=0.2 "Pipe radius";
-  parameter ThermoSysPro.Units.nonSI.Angle_deg delta=90 "Pipe angle";
-  parameter Real rugosrel=0 "Pipe roughness";
-  parameter Boolean K_A1_Tabule=true
-    "true: A1 is computed using linear interpolation - false: A1 is computed using correlation formula";
-  parameter Boolean K_B1_Tabule=true
-    "true: B1 is computed using linear interpolation - false: B1 is computed using correlation formula";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Real khi "Hydraulic pressure loss coefficient";
-  Real khim "Singular pressure loss coefficient";
-  Real khif "Friction pressure loss coefficient";
-  Real kdelta "Roughness factor for the singular pressure loss";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Presure loss";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.ReynoldsNumber Re "Reynolds number";
-  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
-  Real yA1 "Output of table A1";
-  Real yB1 "Output of table B1";
-  Real yC1 "Output of table C1";
-  Real lambda "Friction pressure loss coefficient";
-  Units.SI.Density rho "Fluid density";
-  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-
-public
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TA1(
-                    Table=[0, 0; 20, 0.31; 30, 0.45; 45, 0.60; 60, 0.78;
-        75, 0.90; 90, 1; 110, 1.13; 130, 1.20; 150, 1.28; 180, 1.40])
-    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TB1(
-                    Table=[0.5, 1.18; 0.6, 0.77; 0.7, 0.51; 0.8, 0.37;
-        0.9, 0.28; 1, 0.21; 1.25, 0.19; 1.50, 0.17; 2, 0.15; 4, 0.11; 6, 0.09;
-        8, 0.07; 10, 0.07; 15, 0.06; 20, 0.05; 25, 0.05; 30, 0.04; 35, 0.04; 40,
-        0.03; 45, 0.03; 50, 0.03]) annotation (Placement(transformation(extent=
-            {{20,80},{40,100}}, rotation=0)));
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{-10,
-            -110},{10,-90}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-  C1.P - C2.P = deltaP;
-
-  h = C1.h;
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(
-                                                    Q, eps)/(pi^2*D^4*rho);
-
-    /* Coude à parois concentriques (Idel'cik p. 192). Quadratic flow regime is assumed and Re > 2e5 (Re > Relim). */
-  assert(R0/D > 0.5, "Coude: on doit avoir R0/D > 0.5");
-  assert((delta > 0) and not (delta > 180),
-    "Bend: parameter delta should be such as 0° < delta <= 180°");
-
-  khi = kdelta*khim + khif;
-
-  khim = yA1*yB1*yC1;
-
-  TA1.u.signal = delta;
-
-  if (K_A1_Tabule) then
-    yA1 = TA1.y.signal;
-  else
-    yA1 = if (delta < 70) then 0.9*sin(delta) else if (delta > 100) then 0.7 +
-      0.35*delta/90 else 1.0;
-  end if;
-
-  TB1.u.signal = R0/D;
-
-  if (K_B1_Tabule) then
-    yB1 = TB1.y.signal;
-  else
-    yB1 = if (R0/D < 1) then 0.21/(R0/D)^2.5 else 0.21/(R0/D)^0.5;
-  end if;
-
-  yC1 = 1;
-
-  kdelta = if ((rugosrel < 0.001)) and (R0/D < 1.5) then 1.0 + 1.e3*rugosrel else
-          if (rugosrel < 0.001) then 1.0 + 1.e6*rugosrel^2 else 2.0;
-
-  khif = 0.0175*lambda*R0*delta/D;
-
-  if (rugosrel > 0.00005) then
-    lambda = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
-  else
-    lambda = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else
-            0;
-  end if;
-
-  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 2.e5;
-
-  Re = 4*abs(Q)/(pi*D*mu);
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  mu = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T);
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{-20,-20}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-18},{20,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20,
-              -18},{-20,20}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,20},{-20,-20},{20,-18},{-20,20}},
-          lineColor={127,255,0},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}},
-          lineColor={192,192,192},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}}, color={0,0,255})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Rectangle(
-          extent={{-100,20},{-20,-20}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-20,-18},{20,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20,
-              -18},{-20,20}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,20},{-20,-20},{20,-18},{-20,20}},
-          lineColor={127,255,0},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}},
-          lineColor={192,192,192},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}})}),
-    Window(
-      x=0.04,
-      y=0.1,
-      width=0.84,
-      height=0.67),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 13.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Bend;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model Bend "Bend"
+  parameter Units.SI.Diameter D=0.2 "Pipe diameter";
+  parameter Units.SI.Radius R0=0.2 "Pipe radius";
+  parameter ThermoSysPro.Units.nonSI.Angle_deg delta=90 "Pipe angle";
+  parameter Real rugosrel=0 "Pipe roughness";
+  parameter Boolean K_A1_Tabule=true
+    "true: A1 is computed using linear interpolation - false: A1 is computed using correlation formula";
+  parameter Boolean K_B1_Tabule=true
+    "true: B1 is computed using linear interpolation - false: B1 is computed using correlation formula";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Real khi "Hydraulic pressure loss coefficient";
+  Real khim "Singular pressure loss coefficient";
+  Real khif "Friction pressure loss coefficient";
+  Real kdelta "Roughness factor for the singular pressure loss";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Presure loss";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.ReynoldsNumber Re "Reynolds number";
+  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
+  Real yA1 "Output of table A1";
+  Real yB1 "Output of table B1";
+  Real yC1 "Output of table C1";
+  Real lambda "Friction pressure loss coefficient";
+  Units.SI.Density rho "Fluid density";
+  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+
+public
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TA1(
+                    Table=[0, 0; 20, 0.31; 30, 0.45; 45, 0.60; 60, 0.78;
+        75, 0.90; 90, 1; 110, 1.13; 130, 1.20; 150, 1.28; 180, 1.40])
+    annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TB1(
+                    Table=[0.5, 1.18; 0.6, 0.77; 0.7, 0.51; 0.8, 0.37;
+        0.9, 0.28; 1, 0.21; 1.25, 0.19; 1.50, 0.17; 2, 0.15; 4, 0.11; 6, 0.09;
+        8, 0.07; 10, 0.07; 15, 0.06; 20, 0.05; 25, 0.05; 30, 0.04; 35, 0.04; 40,
+        0.03; 45, 0.03; 50, 0.03]) annotation (Placement(transformation(extent=
+            {{20,80},{40,100}}, rotation=0)));
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{-10,
+            -110},{10,-90}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+  C1.P - C2.P = deltaP;
+
+  h = C1.h;
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(
+                                                    Q, eps)/(pi^2*D^4*rho);
+
+    /* Coude à parois concentriques (Idel'cik p. 192). Quadratic flow regime is assumed and Re > 2e5 (Re > Relim). */
+  assert(R0/D > 0.5, "Coude: on doit avoir R0/D > 0.5");
+  assert((delta > 0) and not (delta > 180),
+    "Bend: parameter delta should be such as 0° < delta <= 180°");
+
+  khi = kdelta*khim + khif;
+
+  khim = yA1*yB1*yC1;
+
+  TA1.u.signal = delta;
+
+  if (K_A1_Tabule) then
+    yA1 = TA1.y.signal;
+  else
+    yA1 = if (delta < 70) then 0.9*sin(delta) else if (delta > 100) then 0.7 +
+      0.35*delta/90 else 1.0;
+  end if;
+
+  TB1.u.signal = R0/D;
+
+  if (K_B1_Tabule) then
+    yB1 = TB1.y.signal;
+  else
+    yB1 = if (R0/D < 1) then 0.21/(R0/D)^2.5 else 0.21/(R0/D)^0.5;
+  end if;
+
+  yC1 = 1;
+
+  kdelta = if ((rugosrel < 0.001)) and (R0/D < 1.5) then 1.0 + 1.e3*rugosrel else
+          if (rugosrel < 0.001) then 1.0 + 1.e6*rugosrel^2 else 2.0;
+
+  khif = 0.0175*lambda*R0*delta/D;
+
+  if (rugosrel > 0.00005) then
+    lambda = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
+  else
+    lambda = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else
+            0;
+  end if;
+
+  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 2.e5;
+
+  Re = 4*abs(Q)/(pi*D*mu);
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  mu = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T);
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{-20,-20}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-18},{20,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20,
+              -18},{-20,20}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,20},{-20,-20},{20,-18},{-20,20}},
+          lineColor={127,255,0},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}},
+          lineColor={192,192,192},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}}, color={0,0,255})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Rectangle(
+          extent={{-100,20},{-20,-20}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-20,-18},{20,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20,
+              -18},{-20,20}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,20},{-20,-20},{20,-18},{-20,20}},
+          lineColor={127,255,0},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}},
+          lineColor={192,192,192},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}})}),
+    Window(
+      x=0.04,
+      y=0.1,
+      width=0.84,
+      height=0.67),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 13.6 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Bend;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/CheckValve.mo b/ThermoSysPro/WaterSteam/PressureLosses/CheckValve.mo
index 7e88191a98aee21c4fca5aef4f8bb85cc375847d..2b2990222607807b22b063aa15d82cdd74220b75 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/CheckValve.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/CheckValve.mo
@@ -1,134 +1,134 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model CheckValve "Check valve"
-  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=10
-    "Pressure difference when the valve opens";
-  parameter ThermoSysPro.Units.SI.PressureDifference dPFerme=0
-    "Pressure difference when the valve closes";
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
-    "Pressure loss coefficient";
-  parameter Units.SI.MassFlowRate Qmin=1.e-6
-    "Mass flow when the valve is closed";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Boolean ouvert(start=true, fixed=true) "Valve state";
-  discrete Boolean touvert(start=false, fixed=true);
-  discrete Boolean tferme(start=false, fixed=true);
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
-           {{-120,-10},{-100,10}}, rotation=0)));
-  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
-           {{100,-10},{120,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  h = C1.h;
-  Q = C1.Q;
-
-  deltaP = C1.P - C2.P;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  if ouvert then
-    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
-  else
-    Q - Qmin = 0;
-  end if;
-
-  touvert = (deltaP > dPOuvert);
-  tferme = (deltaP < dPFerme);
-
-  when {pre(tferme),pre(touvert)} then
-    ouvert = pre(touvert);
-  end when;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,255},
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,255},
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.05,
-      width=0.91,
-      height=0.92),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 13.11 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end CheckValve;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model CheckValve "Check valve"
+  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=10
+    "Pressure difference when the valve opens";
+  parameter ThermoSysPro.Units.SI.PressureDifference dPFerme=0
+    "Pressure difference when the valve closes";
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
+    "Pressure loss coefficient";
+  parameter Units.SI.MassFlowRate Qmin=1.e-6
+    "Mass flow when the valve is closed";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Boolean ouvert(start=true, fixed=true) "Valve state";
+  discrete Boolean touvert(start=false, fixed=true);
+  discrete Boolean tferme(start=false, fixed=true);
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
+           {{-120,-10},{-100,10}}, rotation=0)));
+  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
+           {{100,-10},{120,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  h = C1.h;
+  Q = C1.Q;
+
+  deltaP = C1.P - C2.P;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  if ouvert then
+    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
+  else
+    Q - Qmin = 0;
+  end if;
+
+  touvert = (deltaP > dPOuvert);
+  tferme = (deltaP < dPFerme);
+
+  when {pre(tferme),pre(touvert)} then
+    ouvert = pre(touvert);
+  end when;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,255},
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,255},
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.05,
+      width=0.91,
+      height=0.92),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 13.11 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end CheckValve;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/ControlValve.mo b/ThermoSysPro/WaterSteam/PressureLosses/ControlValve.mo
index 1ac9ffcd4c0a5ec755e2695db22ebe211f4d97c0..58ff1ccb4b401306cc4645bb4db460ce482208ec 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/ControlValve.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/ControlValve.mo
@@ -1,173 +1,173 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model ControlValve "Control valve"
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42
-    "Maximum CV (active if mode_caract=0)";
-  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
-    "Position vs. Cv characteristics (active if mode_caract=1)";
-  parameter Integer mode_caract=0
-    "0:linear characteristics - 1:characteristics is given by caract[]";
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Integer option_rho_water=1
-    "1: using (deltaP*Cv^2=A.Q^2/rho^2) - 2: using (deltaP*Cv^2=A.Q^2/(rho*rho_15)); with rho_15 is the density of the water at 15.5556 °C)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.Density rho_15=999 "density of the water at 15.5556 °C";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  ThermoSysPro.Units.xSI.Cv Cv(start=100) "Cv";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -70},{-90,-50}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{90,-70},
-            {110,-50}}, rotation=0)));
-equation
-
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  h = C1.h;
-  Q = C1.Q;
-
-  deltaP = C1.P - C2.P;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  if (option_rho_water == 1) then
-    deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho^2;
-  elseif (option_rho_water == 2) then
-    deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho_15);
-  else
-    assert(false, "ControlValve - option_rho_water: invalid option");
-  end if;
-
-  /* Cv as a function of the valve position */
-  if (mode_caract == 0) then
-    Cv = Ouv.signal*Cvmax;
-  elseif (mode_caract == 1) then
-    if (option_interpolation == 1) then
-      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
-    elseif (option_interpolation == 2) then
-      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
-    else
-      assert(false, "ControlValve: incorrect interpolation option");
-    end if;
-  else
-    assert(false, "ControlValve: invalid option");
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
-              {20,94},{32,84},{38,72},{40,54},{40,40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{40,40},{-40,40},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{40,40},{-40,40},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
-              {20,94},{32,84},{38,72},{40,54},{40,40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.07,
-      y=0.13,
-      width=0.8,
-      height=0.77),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</h4></p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 13.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end ControlValve;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model ControlValve "Control valve"
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42
+    "Maximum CV (active if mode_caract=0)";
+  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
+    "Position vs. Cv characteristics (active if mode_caract=1)";
+  parameter Integer mode_caract=0
+    "0:linear characteristics - 1:characteristics is given by caract[]";
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Integer option_rho_water=1
+    "1: using (deltaP*Cv^2=A.Q^2/rho^2) - 2: using (deltaP*Cv^2=A.Q^2/(rho*rho_15)); with rho_15 is the density of the water at 15.5556 °C)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.Density rho_15=999 "density of the water at 15.5556 °C";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  ThermoSysPro.Units.xSI.Cv Cv(start=100) "Cv";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -70},{-90,-50}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{90,-70},
+            {110,-50}}, rotation=0)));
+equation
+
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  h = C1.h;
+  Q = C1.Q;
+
+  deltaP = C1.P - C2.P;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  if (option_rho_water == 1) then
+    deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho^2;
+  elseif (option_rho_water == 2) then
+    deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho_15);
+  else
+    assert(false, "ControlValve - option_rho_water: invalid option");
+  end if;
+
+  /* Cv as a function of the valve position */
+  if (mode_caract == 0) then
+    Cv = Ouv.signal*Cvmax;
+  elseif (mode_caract == 1) then
+    if (option_interpolation == 1) then
+      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
+    elseif (option_interpolation == 2) then
+      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv.signal);
+    else
+      assert(false, "ControlValve: incorrect interpolation option");
+    end if;
+  else
+    assert(false, "ControlValve: invalid option");
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
+              {20,94},{32,84},{38,72},{40,54},{40,40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{40,40},{-40,40},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{40,40},{-40,40},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
+              {20,94},{32,84},{38,72},{40,54},{40,40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.07,
+      y=0.13,
+      width=0.8,
+      height=0.77),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</h4></p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 13.8 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end ControlValve;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/Diaphragm.mo b/ThermoSysPro/WaterSteam/PressureLosses/Diaphragm.mo
index dc57652ea1753a0ea87e1d919a8c90f3ed33dd2f..4497460f2168706b5fbc45106afd3d989b1133ff 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/Diaphragm.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/Diaphragm.mo
@@ -1,140 +1,140 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model Diaphragm "Diaphragm"
-  parameter Real Ouv=0.5 "Diaphragm aperture";
-  parameter Units.SI.Diameter D=0.2 "Diaphragm diameter";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Real khi "Hydraulic pressure loss coefficient";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss";
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  Units.SI.ReynoldsNumber Re "Reynolds number";
-  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
-  Units.SI.Density rho "Fluid density";
-  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-public
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-  C1.P - C2.P = deltaP;
-
-  Q = C1.Q;
-  h = C1.h;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho);
-
-    /* Diaphragme avec ouvertures à arêtes vives (Idel'cik p. 103). One assumes that Re > 1.e5 (Re > Relim) */
-  assert((Ouv > 0) and not (Ouv > 1), "Diaphragm: parameter Ouv should be such as 0 < Ouv <= 1");
-
-  khi = ((1.707 - Ouv)/Ouv)^2;
-
-  Relim = 1.e5;
-
-  Re = 4*abs(Q)/(pi*D*mu*Ouv);
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  mu = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T);
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{-40,100},{-40,20}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(
-          points={{-40,-20},{-40,-100}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(
-          points={{40,100},{40,18}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(
-          points={{40,-20},{40,-100}},
-          color={0,203,0},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(
-          points={{-40,100},{-40,20}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(
-          points={{-40,-20},{-40,-100}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(
-          points={{40,100},{40,18}},
-          color={0,203,0},
-          thickness=0.5),
-        Line(
-          points={{40,-20},{40,-100}},
-          color={0,203,0},
-          thickness=0.5)}),
-    Window(
-      x=0.13,
-      y=0.05,
-      width=0.73,
-      height=0.73),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 13.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Diaphragm;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model Diaphragm "Diaphragm"
+  parameter Real Ouv=0.5 "Diaphragm aperture";
+  parameter Units.SI.Diameter D=0.2 "Diaphragm diameter";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Real khi "Hydraulic pressure loss coefficient";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss";
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  Units.SI.ReynoldsNumber Re "Reynolds number";
+  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
+  Units.SI.Density rho "Fluid density";
+  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+public
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+  C1.P - C2.P = deltaP;
+
+  Q = C1.Q;
+  h = C1.h;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho);
+
+    /* Diaphragme avec ouvertures à arêtes vives (Idel'cik p. 103). One assumes that Re > 1.e5 (Re > Relim) */
+  assert((Ouv > 0) and not (Ouv > 1), "Diaphragm: parameter Ouv should be such as 0 < Ouv <= 1");
+
+  khi = ((1.707 - Ouv)/Ouv)^2;
+
+  Relim = 1.e5;
+
+  Re = 4*abs(Q)/(pi*D*mu*Ouv);
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  mu = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T);
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{-40,100},{-40,20}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(
+          points={{-40,-20},{-40,-100}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(
+          points={{40,100},{40,18}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(
+          points={{40,-20},{40,-100}},
+          color={0,203,0},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(
+          points={{-40,100},{-40,20}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(
+          points={{-40,-20},{-40,-100}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(
+          points={{40,100},{40,18}},
+          color={0,203,0},
+          thickness=0.5),
+        Line(
+          points={{40,-20},{40,-100}},
+          color={0,203,0},
+          thickness=0.5)}),
+    Window(
+      x=0.13,
+      y=0.05,
+      width=0.73,
+      height=0.73),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 13.7 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Diaphragm;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/DynamicCheckValve.mo b/ThermoSysPro/WaterSteam/PressureLosses/DynamicCheckValve.mo
index df8102c7665013674fb9bc9d10594cf6be253ba2..1644477c33f7cc7e69114f0c952c53b2233c2146 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/DynamicCheckValve.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/DynamicCheckValve.mo
@@ -1,202 +1,202 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model DynamicCheckValve "Dynamic check valve"
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum CV";
-  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
-    "Position vs. Cv characteristics (active if mode_caract=1)";
-  parameter Units.SI.MomentOfInertia J=1 "Flap moment of inertia";
-  parameter Real Kf1=0 "Flap friction law coefficient #1";
-  parameter Real Kf2=100 "Flap friction law coefficient #2";
-  parameter Real n=5 "Flap friction law exponent";
-  parameter Units.SI.Mass m=1 "Flap mass";
-  parameter Units.SI.Area A=1 "Flap hydraulic area";
-  parameter Real Ouv0=0 "Initial valve position, between 0 and 1. 0:valve closed - 1: valve open (active if permanent_meca = false)";
-  parameter Integer mode_caract=0
-    "0:linear characteristics - 1:characteristics is given by caract[]";
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
-  parameter Boolean mech_steady_state=true
-    "true: start from mechanical steady state - false: start from 0";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  parameter Units.SI.Radius r=sqrt(A/pi) "Flap radius";
-  parameter Units.SI.Angle theta_min=0 "Minimum flap aperture angle";
-  parameter Units.SI.Angle theta_max=pi/2 "Maximum flap aperture angle";
-  parameter Units.SI.Angle theta_m=(theta_min + theta_max)/2;
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Boolean libre(start=true)
-    "Indicator whether the flap is free to move in both directions";
-  Units.SI.Torque Cp "Gravity torque";
-  Units.SI.Torque Cf "Friction torque";
-  Units.SI.Torque Ch "Hydraulic torque";
-  Units.SI.Torque Ct "Total torque";
-  Units.SI.Angle theta(start=theta_m) "Flap aperture angle";
-  Units.SI.AngularVelocity omega "Flap angular speed";
-  Units.SI.AngularAcceleration a "Flap angular acceleration";
-  Real Ouv "Valve position";
-  ThermoSysPro.Units.xSI.Cv Cv(start=Cvmax) "Cv";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressrue";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}},rotation=0)));
-initial equation
-  if mech_steady_state then
-    der(theta) = 0;
-    der(omega) = 0;
-  else
-    assert((0 <= Ouv0) and (Ouv0 <= 1), "DynamickCheckValve: Ouv0 should be between 0 and 1");
-    theta = acos(1 - Ouv0);
-    omega = 0;
-  end if;
-
-equation
-
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  h = C1.h;
-  Q = C1.Q;
-
-  deltaP = C1.P - C2.P;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Flap angle */
-  Ouv = 1 - cos(theta);
-
-  omega = der(theta);
-  a = der(omega);
-
-  Cp = -m*g*r*sin(theta);
-  Cf = -sign(omega)*(Kf1 + Kf2*abs(omega)^n);
-  Ch = deltaP*r*A*cos(theta);
-
-  Ct = Cp + Cf + Ch;
-
-  libre = ((theta > theta_min) and (theta < theta_max)) or ((theta <= theta_min)
-     and (Ct > 0)) or ((theta >= theta_max) and (Ct < 0));
-
-  if libre then
-    J*a = Ct;
-  else
-    a = 0;
-  end if;
-
-  when {theta <= theta_min,theta >= theta_max} then
-    reinit(omega, 0);
-  end when;
-
-  /* Pressure loss */
-  deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/
-    rho^2;
-
-  /* Cv as a function of the valve position */
-  if (mode_caract == 0) then
-    Cv = Ouv*Cvmax;
-  elseif (mode_caract == 1) then
-    if (option_interpolation == 1) then
-      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv);
-    elseif (option_interpolation == 2) then
-      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv);
-    else
-      assert(false, "DynamicCheckValve: incorrect interpolation option");
-    end if;
-  else
-    assert(false, "ClapetDyn : mode de calcul du Cv incorrect");
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={170,85,255},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={170,85,255},
-          thickness=0.5),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Text(extent={{-28,80},{32,20}}, textString=
-                                            "D")}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={170,85,255},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={170,85,255},
-          thickness=0.5),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Text(extent={{-28,80},{32,20}}, textString=
-                                            "D")}),
-    Window(
-      x=0.08,
-      y=0.01,
-      width=0.81,
-      height=0.87),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 13.12 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DynamicCheckValve;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model DynamicCheckValve "Dynamic check valve"
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum CV";
+  parameter Real caract[:, 2]=[0, 0; 1, Cvmax]
+    "Position vs. Cv characteristics (active if mode_caract=1)";
+  parameter Units.SI.MomentOfInertia J=1 "Flap moment of inertia";
+  parameter Real Kf1=0 "Flap friction law coefficient #1";
+  parameter Real Kf2=100 "Flap friction law coefficient #2";
+  parameter Real n=5 "Flap friction law exponent";
+  parameter Units.SI.Mass m=1 "Flap mass";
+  parameter Units.SI.Area A=1 "Flap hydraulic area";
+  parameter Real Ouv0=0 "Initial valve position, between 0 and 1. 0:valve closed - 1: valve open (active if permanent_meca = false)";
+  parameter Integer mode_caract=0
+    "0:linear characteristics - 1:characteristics is given by caract[]";
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
+  parameter Boolean mech_steady_state=true
+    "true: start from mechanical steady state - false: start from 0";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  parameter Units.SI.Radius r=sqrt(A/pi) "Flap radius";
+  parameter Units.SI.Angle theta_min=0 "Minimum flap aperture angle";
+  parameter Units.SI.Angle theta_max=pi/2 "Maximum flap aperture angle";
+  parameter Units.SI.Angle theta_m=(theta_min + theta_max)/2;
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Boolean libre(start=true)
+    "Indicator whether the flap is free to move in both directions";
+  Units.SI.Torque Cp "Gravity torque";
+  Units.SI.Torque Cf "Friction torque";
+  Units.SI.Torque Ch "Hydraulic torque";
+  Units.SI.Torque Ct "Total torque";
+  Units.SI.Angle theta(start=theta_m) "Flap aperture angle";
+  Units.SI.AngularVelocity omega "Flap angular speed";
+  Units.SI.AngularAcceleration a "Flap angular acceleration";
+  Real Ouv "Valve position";
+  ThermoSysPro.Units.xSI.Cv Cv(start=Cvmax) "Cv";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressrue";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}},rotation=0)));
+initial equation
+  if mech_steady_state then
+    der(theta) = 0;
+    der(omega) = 0;
+  else
+    assert((0 <= Ouv0) and (Ouv0 <= 1), "DynamickCheckValve: Ouv0 should be between 0 and 1");
+    theta = acos(1 - Ouv0);
+    omega = 0;
+  end if;
+
+equation
+
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  h = C1.h;
+  Q = C1.Q;
+
+  deltaP = C1.P - C2.P;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Flap angle */
+  Ouv = 1 - cos(theta);
+
+  omega = der(theta);
+  a = der(omega);
+
+  Cp = -m*g*r*sin(theta);
+  Cf = -sign(omega)*(Kf1 + Kf2*abs(omega)^n);
+  Ch = deltaP*r*A*cos(theta);
+
+  Ct = Cp + Cf + Ch;
+
+  libre = ((theta > theta_min) and (theta < theta_max)) or ((theta <= theta_min)
+     and (Ct > 0)) or ((theta >= theta_max) and (Ct < 0));
+
+  if libre then
+    J*a = Ct;
+  else
+    a = 0;
+  end if;
+
+  when {theta <= theta_min,theta >= theta_max} then
+    reinit(omega, 0);
+  end when;
+
+  /* Pressure loss */
+  deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/
+    rho^2;
+
+  /* Cv as a function of the valve position */
+  if (mode_caract == 0) then
+    Cv = Ouv*Cvmax;
+  elseif (mode_caract == 1) then
+    if (option_interpolation == 1) then
+      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv);
+    elseif (option_interpolation == 2) then
+      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv);
+    else
+      assert(false, "DynamicCheckValve: incorrect interpolation option");
+    end if;
+  else
+    assert(false, "ClapetDyn : mode de calcul du Cv incorrect");
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={170,85,255},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={170,85,255},
+          thickness=0.5),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Text(extent={{-28,80},{32,20}}, textString=
+                                            "D")}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={170,85,255},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={170,85,255},
+          thickness=0.5),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Text(extent={{-28,80},{32,20}}, textString=
+                                            "D")}),
+    Window(
+      x=0.08,
+      y=0.01,
+      width=0.81,
+      height=0.87),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 13.12 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DynamicCheckValve;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/DynamicReliefValve.mo b/ThermoSysPro/WaterSteam/PressureLosses/DynamicReliefValve.mo
index db65bb2d68e919b12c99c8c6e4dac40d22fe35fd..89e69c71efbf46221ca073c7613e23e91e157540 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/DynamicReliefValve.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/DynamicReliefValve.mo
@@ -1,232 +1,232 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model DynamicReliefValve "Dynamic relief valve"
-  parameter Units.SI.AbsolutePressure Popen=3e5 "Pressure that opens the valve";
-  parameter Units.SI.AbsolutePressure Pout=1e5
-    "Pressure at the valve outlet (for sizing)";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum Cv";
-  parameter Real caract[:, 2]=[0, 0; 1, Cvmax] "Position vs. Cv characteristics (active if mode_caract=1)";
-  parameter Units.SI.Area A1=0.1 "Hydraulic area upstream the clapper";
-  parameter Units.SI.Area A2=0.125 "Hydraulic area downstream the clapper";
-  parameter Units.SI.Area clapper_area[:,2]=[0,A1; 0.01,A2; 1,A2]
-    "Clapper area as a function of the clapper elevation";
-  parameter Real D=1 "Damping";
-  parameter Units.SI.Mass m=1 "Valve mass";
-  parameter Units.SI.Length z_max=0.1 "Maximum clapper elevation";
-  parameter Units.SI.Length z0=0
-    "Initial clapper elevation, between 0 and z_max. 0:valve closed - z_max: valve fully open (active if permanent_meca = false)";
-  parameter Real Ke=62500 "Valve spring stiffness";
-  parameter Real Cd=0 "Drag coefficient of the clapper";
-  parameter Integer mode_caract=0
-    "0:linear characteristics - 1:characteristics is given by caract[] - 2:characteristics for conic clapper";
-  parameter Integer option_interpolation=1
-    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
-  parameter Boolean mech_steady_state=true
-    "true: start from mechanical steady state - false: start from 0";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  constant Units.SI.Density rho60F=998.98 "Water density at 60°F";
-  constant Real K=1.733e12 "Valve constant";
-  parameter Real eps=1.e-0 "Small number for pressure loss equation";
-  parameter Units.SI.Length z_min=0 "Minimum clapper elevation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Boolean clapper_is_free(start=true) "true if clapper is free to move in both directions, false otherwise";
-  Units.SI.Force Fp "Gravity force";
-  Units.SI.Force Fr "Spring force";
-  Units.SI.Force Fd "Damping force";
-  Units.SI.Force Fh "Hydraulic force";
-  Units.SI.Force Fdyn "Dynamic pressure force";
-  Units.SI.Force Ft "Total force";
-  Units.SI.Length z(start=z_min) "Clapper elevation";
-  Units.SI.Velocity v=der(z) "Clapper velocity";
-  Units.SI.Acceleration a=der(v) "Clapper acceleration";
-  Real Ouv "Valve position";
-  Units.SI.Area A "Hydraulic area upstream the clapper";
-  Units.SI.Force Fr_min "Spring force when valve is closed";
-  ThermoSysPro.Units.xSI.Cv Cv "Cv";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.AbsolutePressure Pdyn "Dynamic pressure on the clapper";
-  Units.SI.Velocity vh "Fluid velocity through the valve";
-  Units.SI.Energy Wdyn "Dissipated fluid kinetic energy";
-  Real Re=rho*(vh - v)*sqrt(4*A/pi)/ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T) "Clapper Reynolds";
-
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-10,-108},{10,-88}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}},rotation=0), iconTransformation(extent={{
-            90,-10},{110,10}})));
-initial equation
-  if mech_steady_state then
-    der(z) = 0;
-    der(v) = 0;
-  else
-    z = z0;
-    der(z) = 0;
-  end if;
-
-  Wdyn = 0;
-
-equation
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  h = C1.h;
-  Q = C1.Q;
-  deltaP = C1.P - C2.P;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Hydraulic area upstream the clapper. It varies as a function of the valve elevation
-  between A1 (valve closed) and A2 (valve open) with a hysteresis */
-  A = ThermoSysPro.Functions.SplineInterpolation(clapper_area[:, 1], clapper_area[:, 2], z - z_min);
-
-  /* Dynamic pressure on the valve */
-  Pdyn = Cd*rho/2*(vh - v)^2;
-
-  /* Dissipated kinetic energy */
-  der(Wdyn) = Fdyn*v;
-
-  /* Fluid velocity through the valve */
-  rho*vh*A = Q;
-
-  /* Force balance */
-  Fp = -m*g;
-  Fr = -Ke*(z - z_min) + Fr_min;
-  Fd = -D*v;
-  Fh = C1.P*A - C2.P*A2;
-  Fdyn = sign(vh - v)*Pdyn*A;
-  Ft = Fp + Fr + Fd + Fh + Fdyn;
-
-  /* Newton's law */
-  clapper_is_free = ((z > z_min) and (z < z_max)) or ((z <= z_min) and (Ft > 0)) or ((z >= z_max) and (Ft < 0));
-
-  if clapper_is_free then
-    m*a = Ft;
-  else
-    a = 0;
-  end if;
-
-  when {z <= z_min,z >= z_max} then
-    reinit(v, 0);
-  end when;
-
-  /* Pressure that opens the valve */
-  m*g - Fr_min = Popen*A1 - Pout*A2;
-
-  /* Valve position */
-  Ouv = (z - z_min)/(z_max - z_min);
-
-  /* Pressure loss */
-  deltaP*Cv*abs(Cv) = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho60F);
-
-  /* Cv as a function of the valve position */
-  if (mode_caract == 0) then
-    Cv = Ouv*Cvmax;
-  elseif (mode_caract == 1) then
-    if (option_interpolation == 1) then
-      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv);
-    elseif (option_interpolation == 2) then
-      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv);
-    else
-      assert(false, "DynamicReliefValve: incorrect interpolation option");
-    end if;
-  elseif (mode_caract == 2) then
-    Cv = sqrt(pi*A1*K/(0.3*rho60F))*(z - z_min)/sqrt(1 + pi/A1*(z - z_min)^2);
-  else
-    assert(false, "DynamicReliefValve : incorrect Cv computation mode");
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pm, h, mode);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,0},{-30,-60},{30,-60},{0,0}},
-          lineColor={28,108,200},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,0},{60,-30},{60,30},{0,0}},
-          lineColor={28,108,200},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-60},{0,-98}}),
-        Line(points={{60,0},{90,0}}),
-        Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{
-              10,70}}, color={170,85,255})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,0},{-30,-60},{30,-60},{0,0}},
-          lineColor={28,108,200},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,0},{60,-30},{60,30},{0,0}},
-          lineColor={28,108,200},
-          fillColor={170,85,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-60},{0,-98}}),
-        Line(points={{60,0},{90,0}}),
-        Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{
-              10,70}})}),
-    Window(
-      x=0.12,
-      y=0.05,
-      width=0.8,
-      height=0.77),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 13.13 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end DynamicReliefValve;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model DynamicReliefValve "Dynamic relief valve"
+  parameter Units.SI.AbsolutePressure Popen=3e5 "Pressure that opens the valve";
+  parameter Units.SI.AbsolutePressure Pout=1e5
+    "Pressure at the valve outlet (for sizing)";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum Cv";
+  parameter Real caract[:, 2]=[0, 0; 1, Cvmax] "Position vs. Cv characteristics (active if mode_caract=1)";
+  parameter Units.SI.Area A1=0.1 "Hydraulic area upstream the clapper";
+  parameter Units.SI.Area A2=0.125 "Hydraulic area downstream the clapper";
+  parameter Units.SI.Area clapper_area[:,2]=[0,A1; 0.01,A2; 1,A2]
+    "Clapper area as a function of the clapper elevation";
+  parameter Real D=1 "Damping";
+  parameter Units.SI.Mass m=1 "Valve mass";
+  parameter Units.SI.Length z_max=0.1 "Maximum clapper elevation";
+  parameter Units.SI.Length z0=0
+    "Initial clapper elevation, between 0 and z_max. 0:valve closed - z_max: valve fully open (active if permanent_meca = false)";
+  parameter Real Ke=62500 "Valve spring stiffness";
+  parameter Real Cd=0 "Drag coefficient of the clapper";
+  parameter Integer mode_caract=0
+    "0:linear characteristics - 1:characteristics is given by caract[] - 2:characteristics for conic clapper";
+  parameter Integer option_interpolation=1
+    "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)";
+  parameter Boolean mech_steady_state=true
+    "true: start from mechanical steady state - false: start from 0";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  constant Units.SI.Density rho60F=998.98 "Water density at 60°F";
+  constant Real K=1.733e12 "Valve constant";
+  parameter Real eps=1.e-0 "Small number for pressure loss equation";
+  parameter Units.SI.Length z_min=0 "Minimum clapper elevation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Boolean clapper_is_free(start=true) "true if clapper is free to move in both directions, false otherwise";
+  Units.SI.Force Fp "Gravity force";
+  Units.SI.Force Fr "Spring force";
+  Units.SI.Force Fd "Damping force";
+  Units.SI.Force Fh "Hydraulic force";
+  Units.SI.Force Fdyn "Dynamic pressure force";
+  Units.SI.Force Ft "Total force";
+  Units.SI.Length z(start=z_min) "Clapper elevation";
+  Units.SI.Velocity v=der(z) "Clapper velocity";
+  Units.SI.Acceleration a=der(v) "Clapper acceleration";
+  Real Ouv "Valve position";
+  Units.SI.Area A "Hydraulic area upstream the clapper";
+  Units.SI.Force Fr_min "Spring force when valve is closed";
+  ThermoSysPro.Units.xSI.Cv Cv "Cv";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.AbsolutePressure Pdyn "Dynamic pressure on the clapper";
+  Units.SI.Velocity vh "Fluid velocity through the valve";
+  Units.SI.Energy Wdyn "Dissipated fluid kinetic energy";
+  Real Re=rho*(vh - v)*sqrt(4*A/pi)/ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T) "Clapper Reynolds";
+
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-10,-108},{10,-88}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}},rotation=0), iconTransformation(extent={{
+            90,-10},{110,10}})));
+initial equation
+  if mech_steady_state then
+    der(z) = 0;
+    der(v) = 0;
+  else
+    z = z0;
+    der(z) = 0;
+  end if;
+
+  Wdyn = 0;
+
+equation
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  h = C1.h;
+  Q = C1.Q;
+  deltaP = C1.P - C2.P;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Hydraulic area upstream the clapper. It varies as a function of the valve elevation
+  between A1 (valve closed) and A2 (valve open) with a hysteresis */
+  A = ThermoSysPro.Functions.SplineInterpolation(clapper_area[:, 1], clapper_area[:, 2], z - z_min);
+
+  /* Dynamic pressure on the valve */
+  Pdyn = Cd*rho/2*(vh - v)^2;
+
+  /* Dissipated kinetic energy */
+  der(Wdyn) = Fdyn*v;
+
+  /* Fluid velocity through the valve */
+  rho*vh*A = Q;
+
+  /* Force balance */
+  Fp = -m*g;
+  Fr = -Ke*(z - z_min) + Fr_min;
+  Fd = -D*v;
+  Fh = C1.P*A - C2.P*A2;
+  Fdyn = sign(vh - v)*Pdyn*A;
+  Ft = Fp + Fr + Fd + Fh + Fdyn;
+
+  /* Newton's law */
+  clapper_is_free = ((z > z_min) and (z < z_max)) or ((z <= z_min) and (Ft > 0)) or ((z >= z_max) and (Ft < 0));
+
+  if clapper_is_free then
+    m*a = Ft;
+  else
+    a = 0;
+  end if;
+
+  when {z <= z_min,z >= z_max} then
+    reinit(v, 0);
+  end when;
+
+  /* Pressure that opens the valve */
+  m*g - Fr_min = Popen*A1 - Pout*A2;
+
+  /* Valve position */
+  Ouv = (z - z_min)/(z_max - z_min);
+
+  /* Pressure loss */
+  deltaP*Cv*abs(Cv) = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho60F);
+
+  /* Cv as a function of the valve position */
+  if (mode_caract == 0) then
+    Cv = Ouv*Cvmax;
+  elseif (mode_caract == 1) then
+    if (option_interpolation == 1) then
+      Cv = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], Ouv);
+    elseif (option_interpolation == 2) then
+      Cv = ThermoSysPro.Functions.SplineInterpolation(caract[:, 1], caract[:, 2], Ouv);
+    else
+      assert(false, "DynamicReliefValve: incorrect interpolation option");
+    end if;
+  elseif (mode_caract == 2) then
+    Cv = sqrt(pi*A1*K/(0.3*rho60F))*(z - z_min)/sqrt(1 + pi/A1*(z - z_min)^2);
+  else
+    assert(false, "DynamicReliefValve : incorrect Cv computation mode");
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pm, h, mode);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,0},{-30,-60},{30,-60},{0,0}},
+          lineColor={28,108,200},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,0},{60,-30},{60,30},{0,0}},
+          lineColor={28,108,200},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-60},{0,-98}}),
+        Line(points={{60,0},{90,0}}),
+        Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{
+              10,70}}, color={170,85,255})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,0},{-30,-60},{30,-60},{0,0}},
+          lineColor={28,108,200},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,0},{60,-30},{60,30},{0,0}},
+          lineColor={28,108,200},
+          fillColor={170,85,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-60},{0,-98}}),
+        Line(points={{60,0},{90,0}}),
+        Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{
+              10,70}})}),
+    Window(
+      x=0.12,
+      y=0.05,
+      width=0.8,
+      height=0.77),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 13.13 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end DynamicReliefValve;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/IdealCheckValve.mo b/ThermoSysPro/WaterSteam/PressureLosses/IdealCheckValve.mo
index 7a543de03e5eef5c1b72db9efa12e5886dec51dd..d1ac3815d3a8157fe8731d2ed09eb3d795df98fe 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/IdealCheckValve.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/IdealCheckValve.mo
@@ -1,109 +1,109 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model IdealCheckValve "Ideal check valve"
-  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=0.01
-    "Pressure difference when the valve opens";
-  parameter Units.SI.MassFlowRate Qmin=1.e-6
-    "Mass flow trhough the valve when the valve is closed";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Boolean ouvert(start=true, fixed=true) "Valve state";
-  discrete Boolean touvert(start=false, fixed=true);
-  discrete Boolean tferme(start=false, fixed=true);
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Pressure difference between the inlet and the outlet";
-  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
-           {{90,-10},{110,10}}, rotation=0)));
-  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  Q = C1.Q;
-  deltaP = C1.P - C2.P;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  if ouvert then
-    deltaP = 0;
-  else
-   Q - Qmin = 0;
-  end if;
-
-  touvert = (deltaP > dPOuvert);
-  tferme = (not (Q > 0));
-
-  when {pre(tferme),pre(touvert)} then
-    ouvert = pre(touvert);
-  end when;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,255},
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Text(extent={{-96,-56},{96,-112}}, textString=
-                                               "DP=0"),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-70,70},{-50,50}},
-          lineColor={0,0,255},
-          fillColor={0,0,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-100,0},{-60,0}}),
-        Line(points={{60,0},{100,0}}),
-        Text(extent={{-96,-56},{96,-112}}, textString=
-                                               "DP=0"),
-        Line(
-          points={{-60,-60},{-60,60},{60,-60},{60,60}},
-          color={0,203,0},
-          thickness=0.5)}),
-    Window(
-      x=0.08,
-      y=0.02,
-      width=0.84,
-      height=0.9),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end IdealCheckValve;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model IdealCheckValve "Ideal check valve"
+  parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=0.01
+    "Pressure difference when the valve opens";
+  parameter Units.SI.MassFlowRate Qmin=1.e-6
+    "Mass flow trhough the valve when the valve is closed";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Boolean ouvert(start=true, fixed=true) "Valve state";
+  discrete Boolean touvert(start=false, fixed=true);
+  discrete Boolean tferme(start=false, fixed=true);
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Pressure difference between the inlet and the outlet";
+  Connectors.FluidOutlet C2         annotation (Placement(transformation(extent=
+           {{90,-10},{110,10}}, rotation=0)));
+  Connectors.FluidInlet C1          annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  Q = C1.Q;
+  deltaP = C1.P - C2.P;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  if ouvert then
+    deltaP = 0;
+  else
+   Q - Qmin = 0;
+  end if;
+
+  touvert = (deltaP > dPOuvert);
+  tferme = (not (Q > 0));
+
+  when {pre(tferme),pre(touvert)} then
+    ouvert = pre(touvert);
+  end when;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,255},
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Text(extent={{-96,-56},{96,-112}}, textString=
+                                               "DP=0"),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-70,70},{-50,50}},
+          lineColor={0,0,255},
+          fillColor={0,0,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-100,0},{-60,0}}),
+        Line(points={{60,0},{100,0}}),
+        Text(extent={{-96,-56},{96,-112}}, textString=
+                                               "DP=0"),
+        Line(
+          points={{-60,-60},{-60,60},{60,-60},{60,60}},
+          color={0,203,0},
+          thickness=0.5)}),
+    Window(
+      x=0.08,
+      y=0.02,
+      width=0.84,
+      height=0.9),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end IdealCheckValve;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/IdealSwitchValve.mo b/ThermoSysPro/WaterSteam/PressureLosses/IdealSwitchValve.mo
index 356b0bdb9fdda0b1c25a2e6377dac4bf599c7ad1..d0b6bf9db527e01f874f74b8d8c657abd6f6c4a5 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/IdealSwitchValve.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/IdealSwitchValve.mo
@@ -1,112 +1,112 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model IdealSwitchValve "Ideal switch valve"
-  parameter Units.SI.MassFlowRate Qmin=1.e-6
-    "Mass flow when the valve is closed";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP
-    "Pressure difference between the inlet and the outlet";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
-    annotation (Placement(transformation(
-        origin={0,70},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -72},{-90,-52}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{90,-70},
-            {110,-50}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  Q = C1.Q;
-  deltaP = C1.P - C2.P;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  if Ouv.signal then
-    deltaP = 0;
-  else
-    Q - Qmin = 0;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,60},{40,60}},
-          color={0,0,255},
-          thickness=1),
-        Line(points={{0,60},{0,-60}}),
-        Text(extent={{-104,34},{88,-22}}, textString=
-                                              "DP=0")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,60},{40,60}},
-          color={0,0,255},
-          thickness=1),
-        Line(points={{0,60},{0,-60}}),
-        Text(extent={{-104,34},{88,-22}}, textString=
-                                              "DP=0")}),
-    Window(
-      x=0.22,
-      y=0.12,
-      width=0.72,
-      height=0.74),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end IdealSwitchValve;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model IdealSwitchValve "Ideal switch valve"
+  parameter Units.SI.MassFlowRate Qmin=1.e-6
+    "Mass flow when the valve is closed";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP
+    "Pressure difference between the inlet and the outlet";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
+    annotation (Placement(transformation(
+        origin={0,70},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -72},{-90,-52}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{90,-70},
+            {110,-50}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  Q = C1.Q;
+  deltaP = C1.P - C2.P;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  if Ouv.signal then
+    deltaP = 0;
+  else
+    Q - Qmin = 0;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,60},{40,60}},
+          color={0,0,255},
+          thickness=1),
+        Line(points={{0,60},{0,-60}}),
+        Text(extent={{-104,34},{88,-22}}, textString=
+                                              "DP=0")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,60},{40,60}},
+          color={0,0,255},
+          thickness=1),
+        Line(points={{0,60},{0,-60}}),
+        Text(extent={{-104,34},{88,-22}}, textString=
+                                              "DP=0")}),
+    Window(
+      x=0.22,
+      y=0.12,
+      width=0.72,
+      height=0.74),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end IdealSwitchValve;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/InvSingularPressureLoss.mo b/ThermoSysPro/WaterSteam/PressureLosses/InvSingularPressureLoss.mo
index aa8a10454740c9391440d6fdb2f76d5ce09a2425..4d564f81a2262479b1f9b622e39039634a37aed3 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/InvSingularPressureLoss.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/InvSingularPressureLoss.mo
@@ -1,115 +1,115 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model InvSingularPressureLoss "Inverse singular pressure loss"
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Real K(start=1.e3) "Pressure loss coefficient";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-
-public
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-
-  C1.P - C2.P = deltaP;
-  C2.Q = C1.Q;
-  C2.h = C1.h;
-
-  h = C1.h;
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  deltaP = if noEvent(abs(Q) < Qeps) then 1.e-10 else K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.33,
-      y=0.09,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end InvSingularPressureLoss;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model InvSingularPressureLoss "Inverse singular pressure loss"
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Real K(start=1.e3) "Pressure loss coefficient";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+
+public
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+
+  C1.P - C2.P = deltaP;
+  C2.Q = C1.Q;
+  C2.h = C1.h;
+
+  h = C1.h;
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  deltaP = if noEvent(abs(Q) < Qeps) then 1.e-10 else K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.33,
+      y=0.09,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end InvSingularPressureLoss;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/WaterSteam/PressureLosses/LumpedStraightPipe.mo
index d167162f1af246610847cb3b0fbca74b89ff219c..07612a9225b0bb0cf23580c492ba6371e1865b62 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/LumpedStraightPipe.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/LumpedStraightPipe.mo
@@ -1,154 +1,154 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model LumpedStraightPipe "Lumped straight pipe (circular duct)"
-  parameter Units.SI.Length L=10. "Pipe length";
-  parameter Units.SI.Diameter D=0.2 "Pipe internal diameter";
-  parameter Integer ntubes=1 "Number of pipes in parallel";
-  parameter Real lambda=0.03
-    "Friction pressure loss coefficient (active if lambda_fixed=true)";
-  parameter Real rugosrel=0.0001
-    "Pipe roughness (active if lambda_fixed=false)";
-  parameter Units.SI.Position z1=0 "Inlet altitude";
-  parameter Units.SI.Position z2=0 "Outlet altitude";
-  parameter Boolean lambda_fixed=true
-    "true: lambda given by parameter - false: lambde computed using Idel'Cik correlation";
-  parameter Boolean inertia=false
-    "true: momentum balance equation with inertia - false: without inertia";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-  parameter Units.SI.Area A=ntubes*pi*D^2/4
-    "Pipes cross-sectional area (circular duct is assumed)";
-  parameter Units.SI.Area Pw=ntubes*pi*D
-    "Pipes wetted perimeter (circular duct is assumed)";
-
-public
-  Real khi "Hydraulic pressure loss coefficient";
-  ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss";
-  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
-  Units.SI.ReynoldsNumber Re "Reynolds number";
-  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
-  Real lam "Friction pressure loss coefficient";
-  Units.SI.Density rho "Fluid density";
-  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-public
-  Connectors.FluidInlet C1 annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,78},{-80,98}}, rotation=
-            0)));
-initial equation
-  if inertia then
-    der(Q) = 0;
-  end if;
-
-equation
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  C1.P - C2.P = deltaP;
-
-  h = C1.h;
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  if inertia then
-    deltaP = deltaPf + rho*g*(z2 - z1) + L/A*der(Q);
-  else
-    deltaP = deltaPf + rho*g*(z2 - z1);
-  end if;
-
-  deltaPf = khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(2*A^2*rho);
-
-  /* Darcy-Weisbach formula (Idel'cik p. 55). Quadratic flow regime is assumed and Re > 4000 (Re > Relim). */
-  khi = lam*L/D;
-
-  if lambda_fixed then
-    lam = lambda;
-  else
-    if (rugosrel > 0.00005) then
-      lam = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
-    else
-      lam = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else 0;
-    end if;
-  end if;
-
-  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 4000;
-  Re = 4*abs(Q)/(Pw*mu);
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm,h,fluid,mode,0.1,0.1,0.1,0);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.06,
-      y=0.08,
-      width=0.82,
-      height=0.65),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 13.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end LumpedStraightPipe;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model LumpedStraightPipe "Lumped straight pipe (circular duct)"
+  parameter Units.SI.Length L=10. "Pipe length";
+  parameter Units.SI.Diameter D=0.2 "Pipe internal diameter";
+  parameter Real ntubes=1 "Number of pipes in parallel";
+  parameter Real lambda=0.03
+    "Friction pressure loss coefficient (active if lambda_fixed=true)";
+  parameter Real rugosrel=0.0001
+    "Pipe roughness (active if lambda_fixed=false)";
+  parameter Units.SI.Position z1=0 "Inlet altitude";
+  parameter Units.SI.Position z2=0 "Outlet altitude";
+  parameter Boolean lambda_fixed=true
+    "true: lambda given by parameter - false: lambde computed using Idel'Cik correlation";
+  parameter Boolean inertia=false
+    "true: momentum balance equation with inertia - false: without inertia";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+  parameter Units.SI.Area A=ntubes*pi*D^2/4
+    "Pipes cross-sectional area (circular duct is assumed)";
+  parameter Units.SI.Area Pw=ntubes*pi*D
+    "Pipes wetted perimeter (circular duct is assumed)";
+
+public
+  Real khi "Hydraulic pressure loss coefficient";
+  ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss";
+  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
+  Units.SI.ReynoldsNumber Re "Reynolds number";
+  Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
+  Real lam "Friction pressure loss coefficient";
+  Units.SI.Density rho "Fluid density";
+  Units.SI.DynamicViscosity mu "Fluid dynamic viscosity";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+public
+  Connectors.FluidInlet C1 annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,78},{-80,98}}, rotation=
+            0)));
+initial equation
+  if inertia then
+    der(Q) = 0;
+  end if;
+
+equation
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  C1.P - C2.P = deltaP;
+
+  h = C1.h;
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  if inertia then
+    deltaP = deltaPf + rho*g*(z2 - z1) + L/A*der(Q);
+  else
+    deltaP = deltaPf + rho*g*(z2 - z1);
+  end if;
+
+  deltaPf = khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(2*A^2*rho);
+
+  /* Darcy-Weisbach formula (Idel'cik p. 55). Quadratic flow regime is assumed and Re > 4000 (Re > Relim). */
+  khi = lam*L/D;
+
+  if lambda_fixed then
+    lam = lambda;
+  else
+    if (rugosrel > 0.00005) then
+      lam = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2;
+    else
+      lam = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else 0;
+    end if;
+  end if;
+
+  Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 4000;
+  Re = 4*abs(Q)/(Pw*mu);
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm,h,fluid,mode,0.1,0.1,0.1,0);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.06,
+      y=0.08,
+      width=0.82,
+      height=0.65),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 13.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end LumpedStraightPipe;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/NonBoilingValve.mo b/ThermoSysPro/WaterSteam/PressureLosses/NonBoilingValve.mo
index b950a2b4f34cb997ab62c0336620b131016080a1..63f0714ad2f1a0b9471e2889760b30cfebf0b100 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/NonBoilingValve.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/NonBoilingValve.mo
@@ -1,103 +1,103 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model NonBoilingValve "Non boiling valve"
-  parameter ThermoSysPro.Units.SI.PressureDifference Psecu=1.e4
-    "Security margin to avoid boiling";
-  parameter Units.SI.SpecificEnthalpy Hmax=5.e6
-    "Fluid maximum specific enthalpy";
-  parameter Units.SI.SpecificEnthalpy Hmin=6.e4
-    "Fluid minimum specific enthalpy";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-
-protected
-  constant Units.SI.AbsolutePressure Pcrit=220.64e5 "Critical pressure";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.AbsolutePressure Pebul(start=1.e5)
-    "Fluid saturation pressure corresponding to Pec";
-  Units.SI.AbsolutePressure Pec(start=5.e5) "Pressure at the inlet";
-  Units.SI.AbsolutePressure Psc(start=5.e5) "Pressure at the outlet";
-  Units.SI.SpecificEnthalpy Hec(start=50.e4)
-    "Specific fluid enthalpy at the inlet";
-
-public
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-12},{-90,8}}, rotation=
-            0)));
-  Connectors.FluidOutlet C2                annotation (Placement(transformation(
-          extent={{90,-12},{110,8}}, rotation=0)));
-equation
-
-  Pec = C1.P;
-  Psc = C2.P;
-  Hec = C1.h;
-
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  Q = C1.Q;
-
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* The pressure at the inlet is increased if it is not high enough to avoid boiling */
-  if (Psc < Pcrit) then
-    Pebul = ThermoSysPro.Properties.WaterSteam.IF97.Pressure_sat_hl(Hec);
-    Pec = if ((Psc - Psecu) < Pebul) then Pebul + Psecu else Psc;
-  else
-    Pebul = Psc;
-    Pec = Psc + Psecu;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-100,-60},{0,0},{-100,60},{-100,-42},{-100,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{86,-52},{0,0},{100,60},{100,-60},{86,-52}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-90,-54},{0,0},{-100,60},{-100,-60},{-90,-54}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{100,-60},{0,0},{100,60},{100,-42},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.08,
-      width=0.81,
-      height=0.85),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end NonBoilingValve;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model NonBoilingValve "Non boiling valve"
+  parameter ThermoSysPro.Units.SI.PressureDifference Psecu=1.e4
+    "Security margin to avoid boiling";
+  parameter Units.SI.SpecificEnthalpy Hmax=5.e6
+    "Fluid maximum specific enthalpy";
+  parameter Units.SI.SpecificEnthalpy Hmin=6.e4
+    "Fluid minimum specific enthalpy";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+
+protected
+  constant Units.SI.AbsolutePressure Pcrit=220.64e5 "Critical pressure";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.AbsolutePressure Pebul(start=1.e5)
+    "Fluid saturation pressure corresponding to Pec";
+  Units.SI.AbsolutePressure Pec(start=5.e5) "Pressure at the inlet";
+  Units.SI.AbsolutePressure Psc(start=5.e5) "Pressure at the outlet";
+  Units.SI.SpecificEnthalpy Hec(start=50.e4)
+    "Specific fluid enthalpy at the inlet";
+
+public
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-12},{-90,8}}, rotation=
+            0)));
+  Connectors.FluidOutlet C2                annotation (Placement(transformation(
+          extent={{90,-12},{110,8}}, rotation=0)));
+equation
+
+  Pec = C1.P;
+  Psc = C2.P;
+  Hec = C1.h;
+
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  Q = C1.Q;
+
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* The pressure at the inlet is increased if it is not high enough to avoid boiling */
+  if (Psc < Pcrit) then
+    Pebul = ThermoSysPro.Properties.WaterSteam.IF97.Pressure_sat_hl(Hec);
+    Pec = if ((Psc - Psecu) < Pebul) then Pebul + Psecu else Psc;
+  else
+    Pebul = Psc;
+    Pec = Psc + Psecu;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-100,-60},{0,0},{-100,60},{-100,-42},{-100,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{86,-52},{0,0},{100,60},{100,-60},{86,-52}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-90,-54},{0,0},{-100,60},{-100,-60},{-90,-54}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{100,-60},{0,0},{100,60},{100,-42},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.08,
+      width=0.81,
+      height=0.85),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end NonBoilingValve;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/PipePressureLoss.mo b/ThermoSysPro/WaterSteam/PressureLosses/PipePressureLoss.mo
index 4c72bcb8a715470c05fe58aa133bf2ed837f1f18..f363e906050b6b1c717ebcb2ccfd35b95362ad9e 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/PipePressureLoss.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/PipePressureLoss.mo
@@ -1,121 +1,121 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model PipePressureLoss "Pipe generic pressure loss"
-  parameter Real K=10 "Friction pressure loss coefficient";
-  parameter Units.SI.Position z1=0 "Inlet altitude";
-  parameter Units.SI.Position z2=0 "Outlet altitude";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss";
-  ThermoSysPro.Units.SI.PressureDifference deltaPg "Gravity pressure loss";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss";
-  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,102}}, rotation=
-           0)));
-public
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-
-equation
-  C1.P - C2.P = deltaP;
-  C2.Q = C1.Q;
-  C2.h = C1.h;
-
-  h = C1.h;
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-  deltaPg = rho*g*(z2 - z1);
-  deltaP = deltaPf + deltaPg;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-12,14},{16,-14}},
-          lineColor={0,0,255},
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "K")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-20}},
-          lineColor={0,0,255},
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid), Text(
-          extent={{-12,14},{16,-14}},
-          lineColor={0,0,255},
-          fillColor={85,255,85},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "K")}),
-    Window(
-      x=0.11,
-      y=0.04,
-      width=0.71,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 13.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end PipePressureLoss;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model PipePressureLoss "Pipe generic pressure loss"
+  parameter Real K=10 "Friction pressure loss coefficient";
+  parameter Units.SI.Position z1=0 "Inlet altitude";
+  parameter Units.SI.Position z2=0 "Outlet altitude";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss";
+  ThermoSysPro.Units.SI.PressureDifference deltaPg "Gravity pressure loss";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss";
+  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,102}}, rotation=
+           0)));
+public
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+
+equation
+  C1.P - C2.P = deltaP;
+  C2.Q = C1.Q;
+  C2.h = C1.h;
+
+  h = C1.h;
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
+  deltaPg = rho*g*(z2 - z1);
+  deltaP = deltaPf + deltaPg;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-12,14},{16,-14}},
+          lineColor={0,0,255},
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "K")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-20}},
+          lineColor={0,0,255},
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid), Text(
+          extent={{-12,14},{16,-14}},
+          lineColor={0,0,255},
+          fillColor={85,255,85},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "K")}),
+    Window(
+      x=0.11,
+      y=0.04,
+      width=0.71,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 13.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end PipePressureLoss;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/SingularPressureLoss.mo b/ThermoSysPro/WaterSteam/PressureLosses/SingularPressureLoss.mo
index 88e9a10c54cfc2322401ea0ee5923013cc050503..1d51f667694c03f8f88d098068e7a59a820ac1a1 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/SingularPressureLoss.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/SingularPressureLoss.mo
@@ -1,113 +1,113 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model SingularPressureLoss "Singular pressure loss"
-  parameter Real K=1.e-4 "Pressure loss coefficient";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidOutlet C2                annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-equation
-
-  C1.P - C2.P = deltaP;
-  C2.Q = C1.Q;
-  C2.h = C1.h;
-
-  h = C1.h;
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  deltaP = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Polygon(
-          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
-              40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid), Polygon(
-          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
-              -40},{-60,-40}},
-          lineColor={0,0,255},
-          fillColor={128,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 13.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SingularPressureLoss;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model SingularPressureLoss "Singular pressure loss"
+  parameter Real K=1.e-4 "Pressure loss coefficient";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidOutlet C2                annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+equation
+
+  C1.P - C2.P = deltaP;
+  C2.Q = C1.Q;
+  C2.h = C1.h;
+
+  h = C1.h;
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  deltaP = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Polygon(
+          points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60,
+              40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid), Polygon(
+          points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60,
+              -40},{-60,-40}},
+          lineColor={0,0,255},
+          fillColor={128,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 13.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SingularPressureLoss;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/SwitchValve.mo b/ThermoSysPro/WaterSteam/PressureLosses/SwitchValve.mo
index 59f97a10a147275defc7fb0ac94870c37f8836e9..3d5f89c898db36b48c8f8f428e2b3d836e78a6c5 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/SwitchValve.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/SwitchValve.mo
@@ -1,136 +1,136 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model SwitchValve "Switch valve"
-  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
-    "Pressure loss coefficient";
-  parameter Units.SI.MassFlowRate Qmin=1.e-6
-    "Mass flow when the valve is closed";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  parameter Real eps=1.e-3 "Small number for pressure loss equation";
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Small mass flow for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.Temperature T(start=290) "Fluid temperature";
-  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
-    annotation (Placement(transformation(
-        origin={0,72},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -70},{-90,-50}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{90,-68},
-            {110,-48}}, rotation=0)));
-equation
-
-  C1.Q = C2.Q;
-  C1.h = C2.h;
-
-  h = C1.h;
-  Q = C1.Q;
-
-  deltaP = C1.P - C2.P;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Pressure loss */
-  if Ouv.signal then
-    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
-  else
-    Q - Qmin = 0;
-  end if;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,60},{40,60}},
-          color={0,0,255},
-          thickness=1),
-        Line(points={{0,60},{0,-60}})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-40,60},{40,60}},
-          color={0,0,255},
-          thickness=1),
-        Line(points={{0,60},{0,-60}})}),
-    Window(
-      x=0.1,
-      y=0.04,
-      width=0.79,
-      height=0.84),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 13.10 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SwitchValve;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model SwitchValve "Switch valve"
+  parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000
+    "Pressure loss coefficient";
+  parameter Units.SI.MassFlowRate Qmin=1.e-6
+    "Mass flow when the valve is closed";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  parameter Real eps=1.e-3 "Small number for pressure loss equation";
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Small mass flow for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.Temperature T(start=290) "Fluid temperature";
+  Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
+    annotation (Placement(transformation(
+        origin={0,72},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -70},{-90,-50}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{90,-68},
+            {110,-48}}, rotation=0)));
+equation
+
+  C1.Q = C2.Q;
+  C1.h = C2.h;
+
+  h = C1.h;
+  Q = C1.Q;
+
+  deltaP = C1.P - C2.P;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Pressure loss */
+  if Ouv.signal then
+    deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0;
+  else
+    Q - Qmin = 0;
+  end if;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(Pm, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,60},{40,60}},
+          color={0,0,255},
+          thickness=1),
+        Line(points={{0,60},{0,-60}})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-40,60},{40,60}},
+          color={0,0,255},
+          thickness=1),
+        Line(points={{0,60},{0,-60}})}),
+    Window(
+      x=0.1,
+      y=0.04,
+      width=0.79,
+      height=0.84),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 13.10 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SwitchValve;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/ThreeWayValve.mo b/ThermoSysPro/WaterSteam/PressureLosses/ThreeWayValve.mo
index 6e91c313ca4715279f0051750a52016deadbfe1f..51f36232dc84492138c6750adeedde73bac281f5 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/ThreeWayValve.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/ThreeWayValve.mo
@@ -1,151 +1,151 @@
-within ThermoSysPro.WaterSteam.PressureLosses;
-model ThreeWayValve "Three way valve"
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax1=8005.42 "Valve 1 max CV";
-  parameter ThermoSysPro.Units.xSI.Cv Cvmax2=8005.42 "Valve 2 max CV";
-  parameter Real caract1[:, 2]=[0, 0; 1, Cvmax1]
-    "Valve 1 - Position vs. Cv characteristics (active if mode_caract1=true)";
-  parameter Real caract2[:, 2]=[0, 0; 1, Cvmax2]
-    "Valve 2 - Position vs. Cv characteristics (active if mode_caract2=true)";
-  parameter Integer mode_caract1=0
-    "Valve 1 - 0:linear characteristics - 1:characteristics is given by caract1[]";
-  parameter Integer mode_caract2=0
-    "Valve 2 - 0:linear characteristics - 1:characteristics is given by caract2[]";
-  parameter Units.SI.Volume V=1 "Three way valve volume";
-  parameter Boolean continuous_flow_reversal=false
-    "true: continuous flow reversal - false: discontinuous flow reversal";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
-    annotation (Placement(transformation(
-        origin={0,110},
-        extent={{-10,-10},{10,10}},
-        rotation=270)));
-  Connectors.FluidInletI C1
-    annotation (                              layer="icon", Placement(
-        transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
-  Connectors.FluidOutletI C2
-    annotation (                            layer="icon", Placement(
-        transformation(extent={{90,-50},{110,-30}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve1(
-    Cvmax=Cvmax1,
-    caract=caract1,
-    mode_caract=mode_caract1,
-    p_rho=p_rho,
-    mode=mode,
-    continuous_flow_reversal=continuous_flow_reversal,
-    fluid=fluid)
-               annotation (Placement(transformation(
-        origin={6,-40},
-        extent={{10,10},{-10,-10}},
-        rotation=90)));
-  Connectors.FluidOutletI C3         annotation (Placement(transformation(
-          extent={{-10,-110},{10,-90}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve2(
-    Cvmax=Cvmax2,
-    caract=caract2,
-    mode_caract=mode_caract2,
-    p_rho=p_rho,
-    mode=mode,
-    continuous_flow_reversal=continuous_flow_reversal,
-    fluid=fluid)
-               annotation (Placement(transformation(extent={{40,-4},{60,16}},
-          rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1
-                                         annotation (Placement(transformation(
-          extent={{-80,60},{-60,80}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add Add1(
-                              k2=-1) annotation (Placement(transformation(
-          extent={{-40,40},{-20,60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeA1(
-    V=V,
-    p_rho=p_rho,
-    mode=mode) annotation (Placement(transformation(extent={{-10,-10},{10,10}},
-          rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss PerteDP1(K=0, continuous_flow_reversal=
-        continuous_flow_reversal,
-    fluid=fluid)
-    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
-            0)));
-equation
-  connect(Ouv, Valve2.Ouv)
-    annotation (Line(points={{0,110},{0,60},{50,60},{50,17}}));
-  connect(Constante1.y, Add1.u1)
-    annotation (Line(points={{-59,70},{-50,70},{-50,56},{-41,56}}, color={0,0,
-          255}));
-  connect(Ouv, Add1.u2)
-    annotation (Line(points={{0,110},{0,90},{-90,90},{-90,44},{-41,44}}));
-  connect(Add1.y, Valve1.Ouv)
-    annotation (Line(points={{-19,50},{20,50},{20,-40},{17,-40}}, color={0,0,
-          255}));
-  connect(VolumeA1.Cs1, Valve2.C1)
-    annotation (Line(points={{10,0},{40,0}}, color={0,0,255}));
-  connect(VolumeA1.Cs2, Valve1.C1)
-    annotation (Line(points={{0,-10},{0,-30},{0,-30}},            color={0,0,
-          255}));
-  connect(Valve1.C2, C3)
-    annotation (Line(points={{0,-50},{0,-78},{0,-78},{0,-100}},
-                  color={0,0,255}));
-  connect(PerteDP1.C2, VolumeA1.Ce1)
-    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,255}));
-  connect(Valve2.C2, C2)
-    annotation (Line(points={{60,0},{80,0},{80,-40},{100,-40}}, color={0,0,255}));
-  connect(PerteDP1.C1, C1)
-    annotation (Line(points={{-60,0},{-80,0},{-80,-40},{-100,-40}}, color={0,0,
-          255}));
-  annotation(structurallyIncomplete, Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 13.9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Text(extent={{-46,-30},{-12,-52}}, textString=
-                                                   "Valve 1"), Text(extent={{36,
-              -6},{70,-28}}, textString =       "Valve 2")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{-100,0},{-100,-80},{100,0},{100,-80},{-100,0}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{-20,-100},{0,-40},{20,-100},{-20,-100}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
-              {20,94},{32,84},{38,72},{40,54},{40,40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,-40},{40,40},{-40,40},{0,-40}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.11,
-      width=0.7,
-      height=0.66),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2003</b></p>
-</HTML>
-<html>
-<p><b>Version 1.4</b></p>
-</HTML>
-"), Diagram(Text(extent=[34, -4; 68, -26], string="Valve 2")));
-end ThreeWayValve;
+within ThermoSysPro.WaterSteam.PressureLosses;
+model ThreeWayValve "Three way valve"
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax1=8005.42 "Valve 1 max CV";
+  parameter ThermoSysPro.Units.xSI.Cv Cvmax2=8005.42 "Valve 2 max CV";
+  parameter Real caract1[:, 2]=[0, 0; 1, Cvmax1]
+    "Valve 1 - Position vs. Cv characteristics (active if mode_caract1=true)";
+  parameter Real caract2[:, 2]=[0, 0; 1, Cvmax2]
+    "Valve 2 - Position vs. Cv characteristics (active if mode_caract2=true)";
+  parameter Integer mode_caract1=0
+    "Valve 1 - 0:linear characteristics - 1:characteristics is given by caract1[]";
+  parameter Integer mode_caract2=0
+    "Valve 2 - 0:linear characteristics - 1:characteristics is given by caract2[]";
+  parameter Units.SI.Volume V=1 "Three way valve volume";
+  parameter Boolean continuous_flow_reversal=false
+    "true: continuous flow reversal - false: discontinuous flow reversal";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+  ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
+    annotation (Placement(transformation(
+        origin={0,110},
+        extent={{-10,-10},{10,10}},
+        rotation=270)));
+  Connectors.FluidInletI C1
+    annotation (                              layer="icon", Placement(
+        transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
+  Connectors.FluidOutletI C2
+    annotation (                            layer="icon", Placement(
+        transformation(extent={{90,-50},{110,-30}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve1(
+    Cvmax=Cvmax1,
+    caract=caract1,
+    mode_caract=mode_caract1,
+    p_rho=p_rho,
+    mode=mode,
+    continuous_flow_reversal=continuous_flow_reversal,
+    fluid=fluid)
+               annotation (Placement(transformation(
+        origin={6,-40},
+        extent={{10,10},{-10,-10}},
+        rotation=90)));
+  Connectors.FluidOutletI C3         annotation (Placement(transformation(
+          extent={{-10,-110},{10,-90}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.ControlValve Valve2(
+    Cvmax=Cvmax2,
+    caract=caract2,
+    mode_caract=mode_caract2,
+    p_rho=p_rho,
+    mode=mode,
+    continuous_flow_reversal=continuous_flow_reversal,
+    fluid=fluid)
+               annotation (Placement(transformation(extent={{40,-4},{60,16}},
+          rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1
+                                         annotation (Placement(transformation(
+          extent={{-80,60},{-60,80}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add Add1(
+                              k2=-1) annotation (Placement(transformation(
+          extent={{-40,40},{-20,60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.Volumes.VolumeA VolumeA1(
+    V=V,
+    p_rho=p_rho,
+    mode=mode) annotation (Placement(transformation(extent={{-10,-10},{10,10}},
+          rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.PipePressureLoss PerteDP1(K=0, continuous_flow_reversal=
+        continuous_flow_reversal,
+    fluid=fluid)
+    annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=
+            0)));
+equation
+  connect(Ouv, Valve2.Ouv)
+    annotation (Line(points={{0,110},{0,60},{50,60},{50,17}}));
+  connect(Constante1.y, Add1.u1)
+    annotation (Line(points={{-59,70},{-50,70},{-50,56},{-41,56}}, color={0,0,
+          255}));
+  connect(Ouv, Add1.u2)
+    annotation (Line(points={{0,110},{0,90},{-90,90},{-90,44},{-41,44}}));
+  connect(Add1.y, Valve1.Ouv)
+    annotation (Line(points={{-19,50},{20,50},{20,-40},{17,-40}}, color={0,0,
+          255}));
+  connect(VolumeA1.Cs1, Valve2.C1)
+    annotation (Line(points={{10,0},{40,0}}, color={0,0,255}));
+  connect(VolumeA1.Cs2, Valve1.C1)
+    annotation (Line(points={{0,-10},{0,-30},{0,-30}},            color={0,0,
+          255}));
+  connect(Valve1.C2, C3)
+    annotation (Line(points={{0,-50},{0,-78},{0,-78},{0,-100}},
+                  color={0,0,255}));
+  connect(PerteDP1.C2, VolumeA1.Ce1)
+    annotation (Line(points={{-40,0},{-10,0}}, color={0,0,255}));
+  connect(Valve2.C2, C2)
+    annotation (Line(points={{60,0},{80,0},{80,-40},{100,-40}}, color={0,0,255}));
+  connect(PerteDP1.C1, C1)
+    annotation (Line(points={{-60,0},{-80,0},{-80,-40},{-100,-40}}, color={0,0,
+          255}));
+  annotation(structurallyIncomplete, Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 13.9 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Text(extent={{-46,-30},{-12,-52}}, textString=
+                                                   "Valve 1"), Text(extent={{36,
+              -6},{70,-28}}, textString =       "Valve 2")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{-100,0},{-100,-80},{100,0},{100,-80},{-100,0}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{-20,-100},{0,-40},{20,-100},{-20,-100}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100},
+              {20,94},{32,84},{38,72},{40,54},{40,40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,-40},{40,40},{-40,40},{0,-40}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.11,
+      width=0.7,
+      height=0.66),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2003</b></p>
+</HTML>
+<html>
+<p><b>Version 1.4</b></p>
+</HTML>
+"), Diagram(Text(extent=[34, -4; 68, -26], string="Valve 2")));
+end ThreeWayValve;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/package.mo b/ThermoSysPro/WaterSteam/PressureLosses/package.mo
index db2001ba1e61b14715e9d08293a354c9d19c0a47..b7cdae9f7f60036fe236ce92cb4ccf7e4a6e8963 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/package.mo
+++ b/ThermoSysPro/WaterSteam/PressureLosses/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSteam;
-package PressureLosses "Pressure losses"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end PressureLosses;
+within ThermoSysPro.WaterSteam;
+package PressureLosses "Pressure losses"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end PressureLosses;
diff --git a/ThermoSysPro/WaterSteam/PressureLosses/package.order b/ThermoSysPro/WaterSteam/PressureLosses/package.order
index 644a94a92609c5dd49be959de6cdfd1fc8940476..7133de3d97f31c5266ff1c99fbbc721319932022 100644
--- a/ThermoSysPro/WaterSteam/PressureLosses/package.order
+++ b/ThermoSysPro/WaterSteam/PressureLosses/package.order
@@ -1,15 +1,15 @@
-Bend
-CheckValve
-ControlValve
-Diaphragm
-DynamicCheckValve
-DynamicReliefValve
-IdealCheckValve
-IdealSwitchValve
-InvSingularPressureLoss
-LumpedStraightPipe
-NonBoilingValve
-PipePressureLoss
-SingularPressureLoss
-SwitchValve
-ThreeWayValve
+Bend
+CheckValve
+ControlValve
+Diaphragm
+DynamicCheckValve
+DynamicReliefValve
+IdealCheckValve
+IdealSwitchValve
+InvSingularPressureLoss
+LumpedStraightPipe
+NonBoilingValve
+PipePressureLoss
+SingularPressureLoss
+SwitchValve
+ThreeWayValve
diff --git a/ThermoSysPro/WaterSteam/Sensors/SensorH.mo b/ThermoSysPro/WaterSteam/Sensors/SensorH.mo
index 1864e4fce48d9cad4019ba9740f3e52c8223230c..a22149f8cd284f2ae0d4527bcca8606fc449741c 100644
--- a/ThermoSysPro/WaterSteam/Sensors/SensorH.mo
+++ b/ThermoSysPro/WaterSteam/Sensors/SensorH.mo
@@ -1,92 +1,92 @@
-within ThermoSysPro.WaterSteam.Sensors;
-model SensorH "Specific enthalpy sensor"
-  parameter Boolean continuous_flow_reversal=false
-    "true : continuous flow reversal - false : discontinuous flow reversal";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Minimum mass flow for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -90},{-90,-70}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{92,-90},
-            {112,-70}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Sensor signal */
-  Measure.signal = C1.h;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                         "H")}),
-    Window(
-      x=0.62,
-      y=0.25,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,60},{60,0}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid,
-          textString =                    "H")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SensorH;
+within ThermoSysPro.WaterSteam.Sensors;
+model SensorH "Specific enthalpy sensor"
+  parameter Boolean continuous_flow_reversal=false
+    "true : continuous flow reversal - false : discontinuous flow reversal";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Minimum mass flow for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -90},{-90,-70}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{92,-90},
+            {112,-70}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Sensor signal */
+  Measure.signal = C1.h;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                         "H")}),
+    Window(
+      x=0.62,
+      y=0.25,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,60},{60,0}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid,
+          textString =                    "H")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SensorH;
diff --git a/ThermoSysPro/WaterSteam/Sensors/SensorP.mo b/ThermoSysPro/WaterSteam/Sensors/SensorP.mo
index 486a5c1fd61f190b88ed1c0ed0d13a60a022ec82..c501ddec813d8684fe3241c81ea57e41d5d6047d 100644
--- a/ThermoSysPro/WaterSteam/Sensors/SensorP.mo
+++ b/ThermoSysPro/WaterSteam/Sensors/SensorP.mo
@@ -1,88 +1,88 @@
-within ThermoSysPro.WaterSteam.Sensors;
-model SensorP "Pressure sensor"
-  parameter Boolean continuous_flow_reversal=false
-    "true : continuous flow reversal - false : discontinuous flow reversal";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Minimum mass flow for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -90},{-90,-70}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{92,-90},
-            {112,-70}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Sensor signal */
-  Measure.signal = C1.P;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "P")}),
-    Window(
-      x=0.62,
-      y=0.25,
-      width=0.35,
-      height=0.49),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "P")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SensorP;
+within ThermoSysPro.WaterSteam.Sensors;
+model SensorP "Pressure sensor"
+  parameter Boolean continuous_flow_reversal=false
+    "true : continuous flow reversal - false : discontinuous flow reversal";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Minimum mass flow for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -90},{-90,-70}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{92,-90},
+            {112,-70}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Sensor signal */
+  Measure.signal = C1.P;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "P")}),
+    Window(
+      x=0.62,
+      y=0.25,
+      width=0.35,
+      height=0.49),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "P")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SensorP;
diff --git a/ThermoSysPro/WaterSteam/Sensors/SensorQ.mo b/ThermoSysPro/WaterSteam/Sensors/SensorQ.mo
index 4517e4742129a41b8123f466634a59064e77ac68..cf7c7fdc3709a85ddb012acf519bbbd97d098a87 100644
--- a/ThermoSysPro/WaterSteam/Sensors/SensorQ.mo
+++ b/ThermoSysPro/WaterSteam/Sensors/SensorQ.mo
@@ -1,92 +1,92 @@
-within ThermoSysPro.WaterSteam.Sensors;
-model SensorQ "Mass flow sensor"
-  parameter Boolean continuous_flow_reversal=false
-    "true : continuous flow reversal - false : discontinuous flow reversal";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Minimum mass flow for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -90},{-90,-70}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{92,-90},
-            {112,-70}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Sensor signal */
-  Measure.signal = Q;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "Q")}),
-    Window(
-      x=0.25,
-      y=0.19,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-28},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,60},{60,0}},
-          lineColor={0,0,0},
-          fillPattern=FillPattern.VerticalCylinder,
-          fillColor={120,255,0},
-          textString =                      "Q")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SensorQ;
+within ThermoSysPro.WaterSteam.Sensors;
+model SensorQ "Mass flow sensor"
+  parameter Boolean continuous_flow_reversal=false
+    "true : continuous flow reversal - false : discontinuous flow reversal";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Minimum mass flow for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -90},{-90,-70}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{92,-90},
+            {112,-70}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Sensor signal */
+  Measure.signal = Q;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "Q")}),
+    Window(
+      x=0.25,
+      y=0.19,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-28},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,60},{60,0}},
+          lineColor={0,0,0},
+          fillPattern=FillPattern.VerticalCylinder,
+          fillColor={120,255,0},
+          textString =                      "Q")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SensorQ;
diff --git a/ThermoSysPro/WaterSteam/Sensors/SensorQv.mo b/ThermoSysPro/WaterSteam/Sensors/SensorQv.mo
index d82a15930bbfa45171b2430c80c74990190556d0..0e20eddfc2fd1b246c2ac20926beed926425be22 100644
--- a/ThermoSysPro/WaterSteam/Sensors/SensorQv.mo
+++ b/ThermoSysPro/WaterSteam/Sensors/SensorQv.mo
@@ -1,118 +1,118 @@
-within ThermoSysPro.WaterSteam.Sensors;
-model SensorQv "Volumetric flow sensor"
-  parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s";
-  parameter Boolean continuous_flow_reversal=false
-    "true : continuous flow reversal - false : discontinuous flow reversal";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Minimum mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
-  Units.SI.AbsolutePressure Pm "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-
-protected
-  Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor";
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,102},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  Connectors.FluidInlet C1
-    annotation (Placement(transformation(extent={{-110,-90},{-90,-70}},
-          rotation=0)));
-  Connectors.FluidOutlet C2
-    annotation (Placement(transformation(extent={{92,-90},{112,-70}}, rotation=
-            0)));
-equation
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Sensor signal */
-  Qv = Q/pro.d;
-  Measure.signal = Qv*facteur;
-
-  /* Fluid thermodynamic properties */
-  Pm = (C1.P + C2.P)/2;
-  h = C1.h;
-
-  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pm, h, mode);
-
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-30},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,64},{60,4}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString =                      "Qv")}),
-    Window(
-      x=0.3,
-      y=0.19,
-      width=0.6,
-      height=0.6),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,92},{60,-28}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-30},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,64},{60,4}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString =                      "Qv")}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El hefni </li>
-</ul>
-</html>"));
-end SensorQv;
+within ThermoSysPro.WaterSteam.Sensors;
+model SensorQv "Volumetric flow sensor"
+  parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s";
+  parameter Boolean continuous_flow_reversal=false
+    "true : continuous flow reversal - false : discontinuous flow reversal";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Minimum mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate";
+  Units.SI.AbsolutePressure Pm "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+
+protected
+  Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor";
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,102},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  Connectors.FluidInlet C1
+    annotation (Placement(transformation(extent={{-110,-90},{-90,-70}},
+          rotation=0)));
+  Connectors.FluidOutlet C2
+    annotation (Placement(transformation(extent={{92,-90},{112,-70}}, rotation=
+            0)));
+equation
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Sensor signal */
+  Qv = Q/pro.d;
+  Measure.signal = Qv*facteur;
+
+  /* Fluid thermodynamic properties */
+  Pm = (C1.P + C2.P)/2;
+  h = C1.h;
+
+  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pm, h, mode);
+
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-30},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,64},{60,4}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString =                      "Qv")}),
+    Window(
+      x=0.3,
+      y=0.19,
+      width=0.6,
+      height=0.6),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,92},{60,-28}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-30},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,64},{60,4}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString =                      "Qv")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El hefni </li>
+</ul>
+</html>"));
+end SensorQv;
diff --git a/ThermoSysPro/WaterSteam/Sensors/SensorT.mo b/ThermoSysPro/WaterSteam/Sensors/SensorT.mo
index 4789da393a9f8da0534f9df387bed848898322ea..3c9c48a95f0a2e7a5808698ee20a48f8f62affad 100644
--- a/ThermoSysPro/WaterSteam/Sensors/SensorT.mo
+++ b/ThermoSysPro/WaterSteam/Sensors/SensorT.mo
@@ -1,111 +1,111 @@
-within ThermoSysPro.WaterSteam.Sensors;
-model SensorT "Temperature sensor"
-  parameter Boolean continuous_flow_reversal=false
-    "true : continuous flow reversal - false : discontinuous flow reversal";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  parameter Units.SI.MassFlowRate Qeps=1.e-3
-    "Minimum mass flow rate for continuous flow reversal";
-
-public
-  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
-    annotation (Placement(transformation(
-        origin={0,100},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  Connectors.FluidInlet C1
-                          annotation (Placement(transformation(extent={{-110,
-            -90},{-90,-70}}, rotation=0)));
-  Connectors.FluidOutlet C2
-                          annotation (Placement(transformation(extent={{92,-90},
-            {112,-70}}, rotation=0)));
-equation
-
-  C1.P = C2.P;
-  C1.h = C2.h;
-  C1.Q = C2.Q;
-
-  Q = C1.Q;
-
-  /* Flow reversal */
-  if continuous_flow_reversal then
-    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
-      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
-      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
-  else
-    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
-  end if;
-
-  /* Sensor signal */
-  Measure.signal = T;
-
-  /* Fluid thermodynamic properties */
-  P = (C1.P + C2.P)/2;
-  h = (C1.h + C2.h)/2;
-
-  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
-                                                P, h, mode);
-
-  T = pro.T;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,90},{60,-30}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-30},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(
-          extent={{-60,60},{60,0}},
-          lineColor={0,0,255},
-          fillColor={127,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "T")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,90},{60,-30}},
-          lineColor={0,0,255},
-          fillColor={0,255,0},
-          fillPattern=FillPattern.Solid),
-        Line(points={{0,-30},{0,-80}}),
-        Line(points={{-98,-80},{102,-80}}),
-        Text(extent={{-60,60},{60,0}}, textString=
-                                            "T")}),
-    Window(
-      x=0.22,
-      y=0.21,
-      width=0.6,
-      height=0.6),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end SensorT;
+within ThermoSysPro.WaterSteam.Sensors;
+model SensorT "Temperature sensor"
+  parameter Boolean continuous_flow_reversal=false
+    "true : continuous flow reversal - false : discontinuous flow reversal";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  parameter Units.SI.MassFlowRate Qeps=1.e-3
+    "Minimum mass flow rate for continuous flow reversal";
+
+public
+  Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h "Fluid specific enthalpy";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure
+    annotation (Placement(transformation(
+        origin={0,100},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  Connectors.FluidInlet C1
+                          annotation (Placement(transformation(extent={{-110,
+            -90},{-90,-70}}, rotation=0)));
+  Connectors.FluidOutlet C2
+                          annotation (Placement(transformation(extent={{92,-90},
+            {112,-70}}, rotation=0)));
+equation
+
+  C1.P = C2.P;
+  C1.h = C2.h;
+  C1.Q = C2.Q;
+
+  Q = C1.Q;
+
+  /* Flow reversal */
+  if continuous_flow_reversal then
+    0 = noEvent(if (Q > Qeps) then C1.h - C1.h_vol else if (Q < -Qeps) then
+      C2.h - C2.h_vol else C1.h - 0.5*((C1.h_vol - C2.h_vol)*Modelica.Math.sin(pi
+      *Q/2/Qeps) + C1.h_vol + C2.h_vol));
+  else
+    0 = if (Q > 0) then C1.h - C1.h_vol else C2.h - C2.h_vol;
+  end if;
+
+  /* Sensor signal */
+  Measure.signal = T;
+
+  /* Fluid thermodynamic properties */
+  P = (C1.P + C2.P)/2;
+  h = (C1.h + C2.h)/2;
+
+  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(
+                                                P, h, mode);
+
+  T = pro.T;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,90},{60,-30}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-30},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(
+          extent={{-60,60},{60,0}},
+          lineColor={0,0,255},
+          fillColor={127,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "T")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,90},{60,-30}},
+          lineColor={0,0,255},
+          fillColor={0,255,0},
+          fillPattern=FillPattern.Solid),
+        Line(points={{0,-30},{0,-80}}),
+        Line(points={{-98,-80},{102,-80}}),
+        Text(extent={{-60,60},{60,0}}, textString=
+                                            "T")}),
+    Window(
+      x=0.22,
+      y=0.21,
+      width=0.6,
+      height=0.6),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end SensorT;
diff --git a/ThermoSysPro/WaterSteam/Sensors/package.mo b/ThermoSysPro/WaterSteam/Sensors/package.mo
index a73a21a6dedbfe1dadb8927880b082185c2db763..cad2837023c8260d90a532519abc4455a549fa5a 100644
--- a/ThermoSysPro/WaterSteam/Sensors/package.mo
+++ b/ThermoSysPro/WaterSteam/Sensors/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSteam;
-package Sensors "Sensors"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Sensors;
+within ThermoSysPro.WaterSteam;
+package Sensors "Sensors"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Sensors;
diff --git a/ThermoSysPro/WaterSteam/Volumes/Degasifier.mo b/ThermoSysPro/WaterSteam/Volumes/Degasifier.mo
index c8ac376595abd7b705754c241444ef23666e5d80..5c128844526394a1660cf7d25e92fedab897c705 100644
--- a/ThermoSysPro/WaterSteam/Volumes/Degasifier.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/Degasifier.mo
@@ -1,158 +1,158 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model Degasifier "Degasifier"
-
-  ThermoSysPro.WaterSteam.Volumes.DegasifierVolume dega1(
-    P0=0.11283e7,
-    P(start=0.11283e7),
-    steady_state=true,
-    h(start=700e3),
-    Cs(h_vol(start=700e3)))
-                    annotation (Placement(transformation(extent={{-20,20},{20,
-            60}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPEau(     D=1,
-    continuous_flow_reversal=true,
-    Q(start=1000),
-    Pm(start=1e6),
-    lambda=0.01,
-    L=1)
-    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
-  Connectors.FluidInletI sourceEau
-    annotation (Placement(transformation(extent={{-110,70},{-90,90}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPvapeur(
-    D=1,
-    continuous_flow_reversal=true,
-    Q(start=127.81, fixed=false),
-    h(start=0.25623e7, fixed=false),
-    Pm(start=1.100e6, fixed=false),
-    lambda=0.01,
-    L=1)
-    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
-  Connectors.FluidInletI sourceVapeur
-    annotation (Placement(transformation(extent={{-110,30},{-90,50}}, rotation=
-            0)));
-  ThermoSysPro.WaterSteam.Volumes.DynamicDrum ballon(
-    Vertical=false,
-    R=4.234,
-    L=33,
-    Cevap=0.09,
-    P0=0.1155e7,
-    Tp(start=300),
-    steady_state=true,
-    hv(start=700e3),
-    P(start=0.101283e7),
-    zl(start=8))    annotation (Placement(transformation(extent={{-30,-80},{30,
-            -20}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe TubeVap(L=0.1,
-    D=1,
-    continuous_flow_reversal=true,
-    Q(fixed=false, start=0),
-    lambda=0.01)
-    annotation (Placement(transformation(
-        origin={30,2},
-        extent={{-10,-10},{10,10}},
-        rotation=90)));
-  Connectors.FluidOutletI puitsEauFond   annotation (Placement(transformation(
-          extent={{-90,-90},{-110,-70}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPvapeur1(
-    D=1,
-    continuous_flow_reversal=true,
-    Q(start=1200),
-    h(start=700000),
-    Pm(start=1.100e6),
-    lambda=0.01,
-    L=1)
-    annotation (Placement(transformation(extent={{-60,-80},{-80,-60}}, rotation=
-           0)));
-  Connectors.FluidInletI sourceEauFond
-    annotation (Placement(transformation(extent={{90,-90},{110,-70}}, rotation=
-            0)));
-  Connectors.FluidInletI sourceSup
-    annotation (Placement(transformation(extent={{90,70},{110,90}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPEau1(    D=1,
-    continuous_flow_reversal=true,
-    Pm(start=1e6),
-    lambda=0.01,
-    L=1,
-    Q(start=1))
-    annotation (Placement(transformation(extent={{60,60},{40,80}}, rotation=0)));
-  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPEau2(    D=1,
-    continuous_flow_reversal=true,
-    Pm(start=1e6),
-    lambda=0.01,
-    L=1,
-    Q(start=1))
-    annotation (Placement(transformation(extent={{80,-80},{60,-60}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    annotation (Placement(transformation(extent={{100,-9},{126,10}}, rotation=0)));
-equation
-  connect(DPEau.C2, dega1.Ce2) annotation (Line(points={{-40,70},{-8,70},{-8,52}},
-        color={0,0,255}));
-  connect(DPvapeur.C2, dega1.Ce1) annotation (Line(points={{-40,30},{-32.6,30},
-          {-32.6,40},{-20,40}}, color={0,0,255}));
-  connect(TubeVap.C1,ballon. Cv)
-                               annotation (Line(points={{30,-8},{30,-20}}));
-  connect(DPvapeur1.C1, ballon.Cd) annotation (Line(points={{-60,-70},{-40,-70},
-          {-40,-80},{-30,-80}}));
-  connect(sourceEau, DPEau.C1) annotation (Line(points={{-100,80},{-80,80},{-80,
-          70},{-60,70}}));
-  connect(DPvapeur1.C2,puitsEauFond)  annotation (Line(points={{-80,-70},{-86,
-          -70},{-86,-80},{-100,-80}}, color={0,0,255}));
-  connect(sourceVapeur, DPvapeur.C1) annotation (Line(points={{-100,40},{-80,40},
-          {-80,30},{-60,30}}));
-  connect(ballon.Cm, DPEau2.C2) annotation (Line(points={{30,-80},{40,-80},{40,
-          -70},{60,-70}}));
-  connect(DPEau2.C1, sourceEauFond)
-    annotation (Line(points={{80,-70},{86,-70},{86,-80},{100,-80}}));
-  connect(dega1.Ce3, DPEau1.C2) annotation (Line(points={{8,52},{8,70},{40,70}}));
-  connect(DPEau1.C1, sourceSup) annotation (Line(points={{60,70},{80,70},{80,80},
-          {100,80}}));
-  connect(dega1.Cs, ballon.Ce1) annotation (Line(points={{-8,28},{-8,20},{-30,
-          20},{-30,-20}}, color={0,0,255}));
-  connect(dega1.Ce4, TubeVap.C2) annotation (Line(points={{8,28.4},{8,20},{30,
-          20},{30,12}}));
-  connect(ballon.yLevel, yLevel)
-    annotation (Line(points={{33,-50},{80,-50},{80,0.5},{113,0.5}}));
-  annotation (Diagram(graphics),
-                       Icon(graphics={
-        Rectangle(
-          extent={{-82,12},{82,-80}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-48,98},{48,20}},
-          lineColor={0,0,0},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{20,26},{24,12}},
-          lineColor={255,255,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-24,26},{-20,12}},
-          lineColor={255,255,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,80},{-40,80},{-40,80},{-40,80}}, color={0,0,0}),
-        Line(points={{-92,40},{-38,40}}, color={0,0,0}),
-        Line(points={{90,80},{40,80}}, color={0,0,0}),
-        Rectangle(
-          extent={{-82,12},{82,-34}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid)}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end Degasifier;
+within ThermoSysPro.WaterSteam.Volumes;
+model Degasifier "Degasifier"
+
+  ThermoSysPro.WaterSteam.Volumes.DegasifierVolume dega1(
+    P0=0.11283e7,
+    P(start=0.11283e7),
+    steady_state=true,
+    h(start=700e3),
+    Cs(h_vol(start=700e3)))
+                    annotation (Placement(transformation(extent={{-20,20},{20,
+            60}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPEau(     D=1,
+    continuous_flow_reversal=true,
+    Q(start=1000),
+    Pm(start=1e6),
+    lambda=0.01,
+    L=1)
+    annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0)));
+  Connectors.FluidInletI sourceEau
+    annotation (Placement(transformation(extent={{-110,70},{-90,90}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPvapeur(
+    D=1,
+    continuous_flow_reversal=true,
+    Q(start=127.81, fixed=false),
+    h(start=0.25623e7, fixed=false),
+    Pm(start=1.100e6, fixed=false),
+    lambda=0.01,
+    L=1)
+    annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0)));
+  Connectors.FluidInletI sourceVapeur
+    annotation (Placement(transformation(extent={{-110,30},{-90,50}}, rotation=
+            0)));
+  ThermoSysPro.WaterSteam.Volumes.DynamicDrum ballon(
+    Vertical=false,
+    R=4.234,
+    L=33,
+    Cevap=0.09,
+    P0=0.1155e7,
+    Tp(start=300),
+    steady_state=true,
+    hv(start=700e3),
+    P(start=0.101283e7),
+    zl(start=8))    annotation (Placement(transformation(extent={{-30,-80},{30,
+            -20}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe TubeVap(L=0.1,
+    D=1,
+    continuous_flow_reversal=true,
+    Q(fixed=false, start=0),
+    lambda=0.01)
+    annotation (Placement(transformation(
+        origin={30,2},
+        extent={{-10,-10},{10,10}},
+        rotation=90)));
+  Connectors.FluidOutletI puitsEauFond   annotation (Placement(transformation(
+          extent={{-90,-90},{-110,-70}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPvapeur1(
+    D=1,
+    continuous_flow_reversal=true,
+    Q(start=1200),
+    h(start=700000),
+    Pm(start=1.100e6),
+    lambda=0.01,
+    L=1)
+    annotation (Placement(transformation(extent={{-60,-80},{-80,-60}}, rotation=
+           0)));
+  Connectors.FluidInletI sourceEauFond
+    annotation (Placement(transformation(extent={{90,-90},{110,-70}}, rotation=
+            0)));
+  Connectors.FluidInletI sourceSup
+    annotation (Placement(transformation(extent={{90,70},{110,90}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPEau1(    D=1,
+    continuous_flow_reversal=true,
+    Pm(start=1e6),
+    lambda=0.01,
+    L=1,
+    Q(start=1))
+    annotation (Placement(transformation(extent={{60,60},{40,80}}, rotation=0)));
+  ThermoSysPro.WaterSteam.PressureLosses.LumpedStraightPipe DPEau2(    D=1,
+    continuous_flow_reversal=true,
+    Pm(start=1e6),
+    lambda=0.01,
+    L=1,
+    Q(start=1))
+    annotation (Placement(transformation(extent={{80,-80},{60,-60}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    annotation (Placement(transformation(extent={{100,-9},{126,10}}, rotation=0)));
+equation
+  connect(DPEau.C2, dega1.Ce2) annotation (Line(points={{-40,70},{-8,70},{-8,52}},
+        color={0,0,255}));
+  connect(DPvapeur.C2, dega1.Ce1) annotation (Line(points={{-40,30},{-32.6,30},
+          {-32.6,40},{-20,40}}, color={0,0,255}));
+  connect(TubeVap.C1,ballon. Cv)
+                               annotation (Line(points={{30,-8},{30,-20}}));
+  connect(DPvapeur1.C1, ballon.Cd) annotation (Line(points={{-60,-70},{-40,-70},
+          {-40,-80},{-30,-80}}));
+  connect(sourceEau, DPEau.C1) annotation (Line(points={{-100,80},{-80,80},{-80,
+          70},{-60,70}}));
+  connect(DPvapeur1.C2,puitsEauFond)  annotation (Line(points={{-80,-70},{-86,
+          -70},{-86,-80},{-100,-80}}, color={0,0,255}));
+  connect(sourceVapeur, DPvapeur.C1) annotation (Line(points={{-100,40},{-80,40},
+          {-80,30},{-60,30}}));
+  connect(ballon.Cm, DPEau2.C2) annotation (Line(points={{30,-80},{40,-80},{40,
+          -70},{60,-70}}));
+  connect(DPEau2.C1, sourceEauFond)
+    annotation (Line(points={{80,-70},{86,-70},{86,-80},{100,-80}}));
+  connect(dega1.Ce3, DPEau1.C2) annotation (Line(points={{8,52},{8,70},{40,70}}));
+  connect(DPEau1.C1, sourceSup) annotation (Line(points={{60,70},{80,70},{80,80},
+          {100,80}}));
+  connect(dega1.Cs, ballon.Ce1) annotation (Line(points={{-8,28},{-8,20},{-30,
+          20},{-30,-20}}, color={0,0,255}));
+  connect(dega1.Ce4, TubeVap.C2) annotation (Line(points={{8,28.4},{8,20},{30,
+          20},{30,12}}));
+  connect(ballon.yLevel, yLevel)
+    annotation (Line(points={{33,-50},{80,-50},{80,0.5},{113,0.5}}));
+  annotation (Diagram(graphics),
+                       Icon(graphics={
+        Rectangle(
+          extent={{-82,12},{82,-80}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-48,98},{48,20}},
+          lineColor={0,0,0},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{20,26},{24,12}},
+          lineColor={255,255,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-24,26},{-20,12}},
+          lineColor={255,255,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,80},{-40,80},{-40,80},{-40,80}}, color={0,0,0}),
+        Line(points={{-92,40},{-38,40}}, color={0,0,0}),
+        Line(points={{90,80},{40,80}}, color={0,0,0}),
+        Rectangle(
+          extent={{-82,12},{82,-34}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid)}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end Degasifier;
diff --git a/ThermoSysPro/WaterSteam/Volumes/DegasifierVolume.mo b/ThermoSysPro/WaterSteam/Volumes/DegasifierVolume.mo
index 69b67145218aeb79a7c2e31ebbb76d705d30b405..e075b48c27a730fb19a8060502fa79da6397b3db 100644
--- a/ThermoSysPro/WaterSteam/Volumes/DegasifierVolume.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/DegasifierVolume.mo
@@ -1,168 +1,168 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model DegasifierVolume "Degasifier volume"
-  parameter Units.SI.Volume V=160 "Degazifier volume";
-  parameter Units.SI.Volume Vmax=10
-    "Maximum volume of the liquid in the basins";
-  parameter Units.SI.SpecificHeatCapacity Cpmetal=460 "Metal specific heat";
-  parameter Units.SI.Mass Mmetal=10869 "Metal mass";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Power W "Thermal power exchanged between the liquid and the basins";
-  Units.SI.Temperature Tl "Saturation temperature of the liquid in the basins";
-  Real x "Vapor mass fraction";
-  Units.SI.AbsolutePressure P(start=1.e5) "Average fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  Real rhols;
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  Connectors.FluidInlet Ce1
-                           annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidInlet Ce2
-                           annotation (Placement(transformation(extent={{-50,50},
-            {-30,70}}, rotation=0)));
-  Connectors.FluidOutlet Cs
-                          annotation (Placement(transformation(extent={{-50,-70},
-            {-30,-50}}, rotation=0)));
-  Connectors.FluidInlet Ce3
-                           annotation (Placement(transformation(extent={{30,50},
-            {50,70}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
-            0)));
-  Connectors.FluidInlet Ce4
-                           annotation (Placement(transformation(extent={{30,-68},
-            {50,-48}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(P) = 0;
-    der(h) = 0;
-  else
-    P = P0;
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non strictement positif");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.b = true;
-  end if;
-
-  if (cardinality(Ce4) == 0) then
-    Ce4.Q = 0;
-    Ce4.h = 1.e5;
-    Ce4.b = true;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h = 1.e5;
-    Cs.a = true;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Ce4.P;
-  P = Cs.P;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs.Q;
-  V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs.Q*Cs.h - W;
-  V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Ce3.h_vol = h;
-  Ce4.h_vol = h;
-  Cs.h_vol = h;
-
-  /* Thermal power exchanged between the basins wall and the liquid */
-  W = Mmetal*Cpmetal*der(P)/lsat.pt;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
-  x=pro.x;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  (lsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-
-  rhols = lsat.rho;
-  Tl = lsat.T;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-102,60},{100,-60}},
-          lineColor={0,0,255},
-          pattern=LinePattern.None,
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Ellipse(
-          extent={{-102,60},{100,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-</HTML>
-<html>
-<p><b>ThermoSysPro Version 2.0</b></p>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end DegasifierVolume;
+within ThermoSysPro.WaterSteam.Volumes;
+model DegasifierVolume "Degasifier volume"
+  parameter Units.SI.Volume V=160 "Degazifier volume";
+  parameter Units.SI.Volume Vmax=10
+    "Maximum volume of the liquid in the basins";
+  parameter Units.SI.SpecificHeatCapacity Cpmetal=460 "Metal specific heat";
+  parameter Units.SI.Mass Mmetal=10869 "Metal mass";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Power W "Thermal power exchanged between the liquid and the basins";
+  Units.SI.Temperature Tl "Saturation temperature of the liquid in the basins";
+  Real x "Vapor mass fraction";
+  Units.SI.AbsolutePressure P(start=1.e5) "Average fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  Real rhols;
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  Connectors.FluidInlet Ce1
+                           annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidInlet Ce2
+                           annotation (Placement(transformation(extent={{-50,50},
+            {-30,70}}, rotation=0)));
+  Connectors.FluidOutlet Cs
+                          annotation (Placement(transformation(extent={{-50,-70},
+            {-30,-50}}, rotation=0)));
+  Connectors.FluidInlet Ce3
+                           annotation (Placement(transformation(extent={{30,50},
+            {50,70}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation=
+            0)));
+  Connectors.FluidInlet Ce4
+                           annotation (Placement(transformation(extent={{30,-68},
+            {50,-48}}, rotation=0)));
+initial equation
+  if steady_state then
+    der(P) = 0;
+    der(h) = 0;
+  else
+    P = P0;
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non strictement positif");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.b = true;
+  end if;
+
+  if (cardinality(Ce4) == 0) then
+    Ce4.Q = 0;
+    Ce4.h = 1.e5;
+    Ce4.b = true;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h = 1.e5;
+    Cs.a = true;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Ce4.P;
+  P = Cs.P;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs.Q;
+  V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs.Q*Cs.h - W;
+  V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Ce3.h_vol = h;
+  Ce4.h_vol = h;
+  Cs.h_vol = h;
+
+  /* Thermal power exchanged between the basins wall and the liquid */
+  W = Mmetal*Cpmetal*der(P)/lsat.pt;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, h, mode);
+  x=pro.x;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  (lsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+
+  rhols = lsat.rho;
+  Tl = lsat.T;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-102,60},{100,-60}},
+          lineColor={0,0,255},
+          pattern=LinePattern.None,
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Ellipse(
+          extent={{-102,60},{100,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+</HTML>
+<html>
+<p><b>ThermoSysPro Version 2.0</b></p>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end DegasifierVolume;
diff --git a/ThermoSysPro/WaterSteam/Volumes/DynamicDrum.mo b/ThermoSysPro/WaterSteam/Volumes/DynamicDrum.mo
index ea70191fd524c733fc1cc266a6813aad30454687..0677dc2a2c5374c3845da067e872fca872b8a72b 100644
--- a/ThermoSysPro/WaterSteam/Volumes/DynamicDrum.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/DynamicDrum.mo
@@ -1,347 +1,347 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model DynamicDrum "Dynamic drum"
-  parameter Boolean Vertical=true
-    "true: vertical cylinder - false: horizontal cylinder";
-  parameter Units.SI.Radius R=1.05 "Radius of the drum cross-sectional area";
-  parameter Units.SI.Length L=16.27 "Drum length";
-  parameter Real Vf0=0.5
-    "Fraction of initial water volume in the drum (active if steady_state=false)";
-  parameter Units.SI.AbsolutePressure P0=50.e5
-    "Fluid initial pressure (active if steady_state=false)";
-  parameter Real Ccond=0.01 "Condensation coefficient";
-  parameter Real Cevap=0.09 "Evaporation coefficient";
-  parameter Real Xlo=0.0025
-    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
-  parameter Real Xvo=0.9975
-    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
-  parameter Real Kvl=1000
-    "Heat exchange coefficient between the liquid and gas phases";
-  parameter Units.SI.CoefficientOfHeatTransfer Klp=400
-    "Heat exchange coefficient between the liquid phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kvp=100
-    "Heat exchange coefficient between the gas phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kpa=25
-    "Heat exchange coefficient between the wall and the outside";
-  parameter Units.SI.Mass Mp=117e3 "Wall mass";
-  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, Vf0)";
-
-protected
-  constant Real pi=Modelica.Constants.pi "pi";
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Units.SI.Volume V=pi*R^2*L "Drum volume";
-  parameter Units.SI.Volume Vmin=1.e-6;
-
-public
-  Units.SI.AbsolutePressure P "Fluid average pressure";
-  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the drum";
-  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
-  Units.SI.Temperature Tl "Liquid phase temperature";
-  Units.SI.Temperature Tv "Gas phase temperature";
-  Units.SI.Temperature Tp(start=550) "Wall temperature";
-  Units.SI.Temperature Ta "External temperature";
-  Units.SI.Volume Vl "Liquid phase volume";
-  Units.SI.Volume Vv "Gas phase volume";
-  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
-  Units.SI.Area Avp "Gas phase surface on contact with the wall";
-  Units.SI.Area Ape "Wall surface on contact with the outside";
-  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
-  Real xv(start=0) "Mass vapor fraction in the vapor phase";
-  Real xmv(start=0.5) "Mass vapor fraction in the ascending tube";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Gas phase density";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phase";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase";
-  Units.SI.MassFlowRate Qv "Steam mass flow rate from the riser";
-  Units.SI.Power Wlv
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  Units.SI.Power Wpl
-    "Thermal power exchanged from the liquid phase to the wall";
-  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
-  Units.SI.Power Wpa "Thermal power exchanged from the outside to the wall";
-  Units.SI.Position zl(start=1.05) "Liquid level in drum";
-  Units.SI.Area Al "Cross sectional area of the liquid phase";
-  Units.SI.Angle theta "Angle";
-  Units.SI.Area Avl(start=1.0)
-    "Heat exchange surface between the liquid and gas phases";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-60,40},{-20,80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Propriétés de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{0,40},{40,80}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom
-    annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation=
-            0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{0,-80},{40,-40}}, rotation=0)));
-  Connectors.FluidInlet Ce1 "Feedwater input 1"
-                                    annotation (Placement(transformation(extent=
-           {{-110,90},{-90,110}}, rotation=0)));
-  Connectors.FluidInlet Cm "Evaporation loop outlet"
-                                    annotation (Placement(transformation(extent=
-           {{90,-110},{110,-90}}, rotation=0)));
-  Connectors.FluidOutlet Cd "Evaporation loop inlet"
-                                    annotation (Placement(transformation(extent=
-           {{-110,-110},{-90,-90}}, rotation=0)));
-  Connectors.FluidOutlet Cv "Steam outlet"
-                                    annotation (Placement(transformation(extent=
-           {{90,90},{110,110}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level "
-    annotation (                            layer="icon", Placement(
-        transformation(extent={{100,-10},{120,10}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth "Thermal input to the liquid"
-                                     annotation (Placement(transformation(
-          extent={{-10,-60},{10,-40}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cex "Thermal input to the wall"
-                           annotation (Placement(transformation(extent={{-10,90},
-            {10,110}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{0,-20},{40,20}}, rotation=0)));
-  Connectors.FluidInlet Ce2 "Feedwater input 2"
-                                    annotation (Placement(transformation(extent=
-           {{-110,30},{-90,50}}, rotation=0)));
-  Connectors.FluidInlet Ce3 "Feedwater input 3"
-                                    annotation (Placement(transformation(extent=
-           {{-110,-50},{-90,-30}}, rotation=0)));
-  Connectors.FluidOutlet Cs "Water outlet"
-                                    annotation (Placement(transformation(extent=
-           {{90,-50},{110,-30}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(hl) = 0;
-    der(hv) = 0;
-    der(P) = 0;
-    der(Vl) = 0;
-    der(Tp) = 0;
-  else
-    hl = lsat.h;
-    hv = vsat.h;
-    P = P0;
-    Vl = Vf0*V;
-    der(Tp) = 0;
-  end if;
-
-equation
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.b = true;
-  end if;
-
-  if (cardinality(Cd) == 0) then
-    Cd.Q = 0;
-    Cd.h = 1.e5;
-    Cd.a = true;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h = 1.e5;
-    Cs.a = true;
-  end if;
-
-  if (cardinality(Cm) == 0) then
-    Cm.Q = 0;
-    Cm.h = 1.e5;
-    Cm.b = true;
-  end if;
-
-  if (cardinality(Cv) == 0) then
-    Cv.Q = 0;
-    Cv.h = 1.e5;
-    Cv.a = true;
-  end if;
-
-  Ce1.P = P;
-  Ce2.P = P;
-  Ce3.P = P;
-  Cv.P = P;
-  Cd.P = Pfond;
-  Cs.P = P;
-  Cm.P = P;
-
-  /* Liquid volume */
-  if Vertical then
-     theta = 1;
-     Al = pi*R^2;
-     Vl = Al*zl;
-     Avl = Al;
-  else
-     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
-     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
-     Vl = Al*L;
-     Avl = 2*R*Modelica.Math.cos(theta)*L;
-  end if;
-
-  /* Drum volume */
-  Vl + Vv = V;
-
-  /* Liquid level */
-  yLevel.signal = zl;
-
-  /* Liquid surface and vapor surface on contact with wall */
-  Alp = if Vertical then 2*pi*R*zl + Al else (pi - 2*theta)*R*L + 2*Al;
-  Avp = if Vertical then 2*pi*R*(L - zl) + Al else (pi + 2*theta)*R*L + 2*Al;
-
-  /* Wall surface on contact with the outside */
-  Ape = Alp + Avp;
-
-  /* Pressure at the bottom of the drum */
-  Pfond = P + prod.d*g*zl;
-
-  /* Liquid phase mass balance equation */
-  BQl = Ce1.Q + Ce2.Q + Ce3.Q - Cd.Q - Cs.Q + (1 - xmv)*Cm.Q + Qcond - Qevap;
-  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-
-  /* Gas phase mass balance equation */
-  BQv = xmv*Cm.Q - Cv.Q + Qevap - Qcond;
-  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-
-  /* Liquid phase energy balance equation */
-  BHl = Ce1.Q*(Ce1.h - (hl - P/rhol)) + Ce2.Q*(Ce2.h - (hl - P/rhol)) + Ce3.Q*(Ce3.h - (hl - P/rhol))
-    - Cd.Q*(Cd.h - (hl - P/rhol)) - Cs.Q*(Cs.h - (hl - P/rhol))
-    + (1 - xmv)*Cm.Q*((if (xmv > 0) then lsat.h else Cm.h) - (hl - P/rhol))
-    + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wlv - Wpl + Cth.W;
-
-  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-
-  Ce1.h_vol = hl;
-  Ce2.h_vol = hl;
-  Ce3.h_vol = hl;
-  Cd.h_vol = noEvent(min(lsat.h, hl));
-  Cs.h_vol = hl;
-
-  /* Gas phase energy balance equation */
-  BHv = xmv*Cm.Q*((if (xmv < 1) then vsat.h else Cm.h) - (hv - P/rhov))
-     - Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov))
-     - Wlv - Wpv;
-
-  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-
-  Cm.h_vol = hl;
-  Cv.h_vol = hv;
-
-  /* Energy balance equation at the wall */
-  Mp*cpp*der(Tp) = Wpl + Wpv + Wpa;
-
-  /* Heat exchange between liquid and gas phases */
-  Wlv = Kvl*Avl*(Tv - Tl);
-
-  /* Heat exchange between the liquid phase and the wall */
-  Wpl = Klp*Alp*(Tl - Tp);
-
-  /* Heat exchange between the gas phase and the wall */
-  Wpv = Kvp*Avp*(Tv - Tp);
-
-  /* Heat exchange between the wall and the outside */
-  Wpa = Kpa*Ape*(Ta - Tp);
-
-  /* Condensation and evaporation mass flow rates */
-  Qcond = if noEvent(xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
-  Qevap = if noEvent(xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
-
-  /* Fluid thermodynamic properties */
-  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hl);
-  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv);
-  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond, Cd.h);
-  prom = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Cm.h);
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-  rhov = prov.d;
-  xv = prov.x;
-
-  xmv = if noEvent(Cm.Q > 0) then prom.x else 0;
-  Qv = Cm.Q*xmv;
-
-  Cth.T = Tl;
-  Cex.T = Ta;
-  Cex.W = Wpa;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,100},{-68,100},{-60,80}}),
-        Line(points={{-90,-100},{-68,-100},{-60,-80}}),
-        Line(points={{62,80},{70,100},{90,100}}),
-        Polygon(
-          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
-              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
-              80},{40,92},{20,98},{0,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{60,-80},{72,-100},{90,-100}}),
-        Polygon(
-          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
-              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
-              80},{40,92},{20,98},{0,100}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.16,
-      y=0.04,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-<p>This component model is documented in Sect. 14.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end DynamicDrum;
+within ThermoSysPro.WaterSteam.Volumes;
+model DynamicDrum "Dynamic drum"
+  parameter Boolean Vertical=true
+    "true: vertical cylinder - false: horizontal cylinder";
+  parameter Units.SI.Radius R=1.05 "Radius of the drum cross-sectional area";
+  parameter Units.SI.Length L=16.27 "Drum length";
+  parameter Real Vf0=0.5
+    "Fraction of initial water volume in the drum (active if steady_state=false)";
+  parameter Units.SI.AbsolutePressure P0=50.e5
+    "Fluid initial pressure (active if steady_state=false)";
+  parameter Real Ccond=0.01 "Condensation coefficient";
+  parameter Real Cevap=0.09 "Evaporation coefficient";
+  parameter Real Xlo=0.0025
+    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
+  parameter Real Xvo=0.9975
+    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
+  parameter Real Kvl=1000
+    "Heat exchange coefficient between the liquid and gas phases";
+  parameter Units.SI.CoefficientOfHeatTransfer Klp=400
+    "Heat exchange coefficient between the liquid phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kvp=100
+    "Heat exchange coefficient between the gas phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kpa=25
+    "Heat exchange coefficient between the wall and the outside";
+  parameter Units.SI.Mass Mp=117e3 "Wall mass";
+  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, Vf0)";
+
+protected
+  constant Real pi=Modelica.Constants.pi "pi";
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Units.SI.Volume V=pi*R^2*L "Drum volume";
+  parameter Units.SI.Volume Vmin=1.e-6;
+
+public
+  Units.SI.AbsolutePressure P "Fluid average pressure";
+  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the drum";
+  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
+  Units.SI.Temperature Tl "Liquid phase temperature";
+  Units.SI.Temperature Tv "Gas phase temperature";
+  Units.SI.Temperature Tp(start=550) "Wall temperature";
+  Units.SI.Temperature Ta "External temperature";
+  Units.SI.Volume Vl "Liquid phase volume";
+  Units.SI.Volume Vv "Gas phase volume";
+  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
+  Units.SI.Area Avp "Gas phase surface on contact with the wall";
+  Units.SI.Area Ape "Wall surface on contact with the outside";
+  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
+  Real xv(start=0) "Mass vapor fraction in the vapor phase";
+  Real xmv(start=0.5) "Mass vapor fraction in the ascending tube";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Gas phase density";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phase";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase";
+  Units.SI.MassFlowRate Qv "Steam mass flow rate from the riser";
+  Units.SI.Power Wlv
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  Units.SI.Power Wpl
+    "Thermal power exchanged from the liquid phase to the wall";
+  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
+  Units.SI.Power Wpa "Thermal power exchanged from the outside to the wall";
+  Units.SI.Position zl(start=1.05) "Liquid level in drum";
+  Units.SI.Area Al "Cross sectional area of the liquid phase";
+  Units.SI.Angle theta "Angle";
+  Units.SI.Area Avl(start=1.0)
+    "Heat exchange surface between the liquid and gas phases";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-60,40},{-20,80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Propriétés de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{0,40},{40,80}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom
+    annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation=
+            0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{0,-80},{40,-40}}, rotation=0)));
+  Connectors.FluidInlet Ce1 "Feedwater input 1"
+                                    annotation (Placement(transformation(extent=
+           {{-110,90},{-90,110}}, rotation=0)));
+  Connectors.FluidInlet Cm "Evaporation loop outlet"
+                                    annotation (Placement(transformation(extent=
+           {{90,-110},{110,-90}}, rotation=0)));
+  Connectors.FluidOutlet Cd "Evaporation loop inlet"
+                                    annotation (Placement(transformation(extent=
+           {{-110,-110},{-90,-90}}, rotation=0)));
+  Connectors.FluidOutlet Cv "Steam outlet"
+                                    annotation (Placement(transformation(extent=
+           {{90,90},{110,110}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level "
+    annotation (                            layer="icon", Placement(
+        transformation(extent={{100,-10},{120,10}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth "Thermal input to the liquid"
+                                     annotation (Placement(transformation(
+          extent={{-10,-60},{10,-40}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cex "Thermal input to the wall"
+                           annotation (Placement(transformation(extent={{-10,90},
+            {10,110}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{0,-20},{40,20}}, rotation=0)));
+  Connectors.FluidInlet Ce2 "Feedwater input 2"
+                                    annotation (Placement(transformation(extent=
+           {{-110,30},{-90,50}}, rotation=0)));
+  Connectors.FluidInlet Ce3 "Feedwater input 3"
+                                    annotation (Placement(transformation(extent=
+           {{-110,-50},{-90,-30}}, rotation=0)));
+  Connectors.FluidOutlet Cs "Water outlet"
+                                    annotation (Placement(transformation(extent=
+           {{90,-50},{110,-30}}, rotation=0)));
+initial equation
+  if steady_state then
+    der(hl) = 0;
+    der(hv) = 0;
+    der(P) = 0;
+    der(Vl) = 0;
+    der(Tp) = 0;
+  else
+    hl = lsat.h;
+    hv = vsat.h;
+    P = P0;
+    Vl = Vf0*V;
+    der(Tp) = 0;
+  end if;
+
+equation
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.b = true;
+  end if;
+
+  if (cardinality(Cd) == 0) then
+    Cd.Q = 0;
+    Cd.h = 1.e5;
+    Cd.a = true;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h = 1.e5;
+    Cs.a = true;
+  end if;
+
+  if (cardinality(Cm) == 0) then
+    Cm.Q = 0;
+    Cm.h = 1.e5;
+    Cm.b = true;
+  end if;
+
+  if (cardinality(Cv) == 0) then
+    Cv.Q = 0;
+    Cv.h = 1.e5;
+    Cv.a = true;
+  end if;
+
+  Ce1.P = P;
+  Ce2.P = P;
+  Ce3.P = P;
+  Cv.P = P;
+  Cd.P = Pfond;
+  Cs.P = P;
+  Cm.P = P;
+
+  /* Liquid volume */
+  if Vertical then
+     theta = 1;
+     Al = pi*R^2;
+     Vl = Al*zl;
+     Avl = Al;
+  else
+     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
+     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
+     Vl = Al*L;
+     Avl = 2*R*Modelica.Math.cos(theta)*L;
+  end if;
+
+  /* Drum volume */
+  Vl + Vv = V;
+
+  /* Liquid level */
+  yLevel.signal = zl;
+
+  /* Liquid surface and vapor surface on contact with wall */
+  Alp = if Vertical then 2*pi*R*zl + Al else (pi - 2*theta)*R*L + 2*Al;
+  Avp = if Vertical then 2*pi*R*(L - zl) + Al else (pi + 2*theta)*R*L + 2*Al;
+
+  /* Wall surface on contact with the outside */
+  Ape = Alp + Avp;
+
+  /* Pressure at the bottom of the drum */
+  Pfond = P + prod.d*g*zl;
+
+  /* Liquid phase mass balance equation */
+  BQl = Ce1.Q + Ce2.Q + Ce3.Q - Cd.Q - Cs.Q + (1 - xmv)*Cm.Q + Qcond - Qevap;
+  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+
+  /* Gas phase mass balance equation */
+  BQv = xmv*Cm.Q - Cv.Q + Qevap - Qcond;
+  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+
+  /* Liquid phase energy balance equation */
+  BHl = Ce1.Q*(Ce1.h - (hl - P/rhol)) + Ce2.Q*(Ce2.h - (hl - P/rhol)) + Ce3.Q*(Ce3.h - (hl - P/rhol))
+    - Cd.Q*(Cd.h - (hl - P/rhol)) - Cs.Q*(Cs.h - (hl - P/rhol))
+    + (1 - xmv)*Cm.Q*((if (xmv > 0) then lsat.h else Cm.h) - (hl - P/rhol))
+    + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wlv - Wpl + Cth.W;
+
+  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+
+  Ce1.h_vol = hl;
+  Ce2.h_vol = hl;
+  Ce3.h_vol = hl;
+  Cd.h_vol = noEvent(min(lsat.h, hl));
+  Cs.h_vol = hl;
+
+  /* Gas phase energy balance equation */
+  BHv = xmv*Cm.Q*((if (xmv < 1) then vsat.h else Cm.h) - (hv - P/rhov))
+     - Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov))
+     - Wlv - Wpv;
+
+  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+
+  Cm.h_vol = hl;
+  Cv.h_vol = hv;
+
+  /* Energy balance equation at the wall */
+  Mp*cpp*der(Tp) = Wpl + Wpv + Wpa;
+
+  /* Heat exchange between liquid and gas phases */
+  Wlv = Kvl*Avl*(Tv - Tl);
+
+  /* Heat exchange between the liquid phase and the wall */
+  Wpl = Klp*Alp*(Tl - Tp);
+
+  /* Heat exchange between the gas phase and the wall */
+  Wpv = Kvp*Avp*(Tv - Tp);
+
+  /* Heat exchange between the wall and the outside */
+  Wpa = Kpa*Ape*(Ta - Tp);
+
+  /* Condensation and evaporation mass flow rates */
+  Qcond = if noEvent(xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
+  Qevap = if noEvent(xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
+
+  /* Fluid thermodynamic properties */
+  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hl);
+  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv);
+  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond, Cd.h);
+  prom = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Cm.h);
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+  rhov = prov.d;
+  xv = prov.x;
+
+  xmv = if noEvent(Cm.Q > 0) then prom.x else 0;
+  Qv = Cm.Q*xmv;
+
+  Cth.T = Tl;
+  Cex.T = Ta;
+  Cex.W = Wpa;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,100},{-68,100},{-60,80}}),
+        Line(points={{-90,-100},{-68,-100},{-60,-80}}),
+        Line(points={{62,80},{70,100},{90,100}}),
+        Polygon(
+          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
+              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
+              80},{40,92},{20,98},{0,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{60,-80},{72,-100},{90,-100}}),
+        Polygon(
+          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
+              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
+              80},{40,92},{20,98},{0,100}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.16,
+      y=0.04,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+<p>This component model is documented in Sect. 14.2 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end DynamicDrum;
diff --git a/ThermoSysPro/WaterSteam/Volumes/Pressurizer.mo b/ThermoSysPro/WaterSteam/Volumes/Pressurizer.mo
index 68d6e6b5d6a6bc9820bd889f5c80293855523e0f..e24085c2f2edfc9ef97729cc1c25b5b363c2a452 100644
--- a/ThermoSysPro/WaterSteam/Volumes/Pressurizer.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/Pressurizer.mo
@@ -1,275 +1,281 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model Pressurizer "Pressurizer"
-  parameter Units.SI.Volume V=61.1 "Pressurizer volume";
-  parameter Units.SI.Radius Rp=1.265 "Pressurizer cross-sectional radius";
-  parameter Units.SI.Area Ae=1 "Wall surface";
-  parameter Units.SI.Position Zm=10.15 "Hauteur de la gamme de mesure niveau";
-  parameter Real Yw0=50
-    "Initial water level - percent of the measure scale level (active if steady_state=false)";
-  parameter Units.SI.AbsolutePressure P0=155e5
-    "Initial fluid pressure (active if steady_state=false)";
-  parameter Real Ccond=0.1 "Condensation coefficient";
-  parameter Real Cevap=0.1 "Evaporation coefficient";
-  parameter Units.SI.CoefficientOfHeatTransfer Klv=0.5e6
-    "Heat exchange coefficient between the liquid and gas phases";
-  parameter Units.SI.CoefficientOfHeatTransfer Klp=50000
-    "Heat exchange coefficient between the liquid phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kvp=25
-    "Heat exchange coefficient between the gas phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kpa=542
-    "Heat exchange coefficient between the wall and the outside";
-  parameter Units.SI.Mass Mp=117e3 "Wall mass";
-  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, Yw0)";
-
-protected
-  constant Real pi=Modelica.Constants.pi "Pi";
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Units.SI.Area Ap=pi*Rp*Rp "Pressurizer cross-sectional area";
-
-public
-  Units.SI.Area Slpin "Exchange surface between the liquid and the wall";
-  Units.SI.Area Svpin "Exchange surface between the vapor and the wall";
-  Real Yw(start=50) "Liquid level as a percent of the measure scale";
-  Real y(start=0.5) "Liquid level as a proportion of the measure scale";
-  Units.SI.Position Zl(start=20) "Liquid level in the pressurizer";
-  Units.SI.Volume Vl "Liquid phase volume";
-  Units.SI.Volume Vv "Gas phase volume";
-  Units.SI.AbsolutePressure P(start=155.0e5) "Average fluid pressure";
-  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the drum";
-  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
-  Units.SI.SpecificEnthalpy hls "Liquid phase saturation specific enthalpy";
-  Units.SI.SpecificEnthalpy hvs "Gas phase saturation specific enthalpy";
-  Units.SI.Temperature Tl "Liquid phase temperature";
-  Units.SI.Temperature Tv "Gas phase temperature";
-  Units.SI.Temperature Tp(start=617.24) "Wall temperature";
-  Units.SI.Temperature Ta "External temperature";
-  Units.SI.Power Wlv
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  Units.SI.Power Wpl
-    "Thermal power exchanged from the liquid phase to the wall";
-  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
-  Units.SI.Power Wpa "Thermal power exchanged from the outside to the wall";
-  Units.SI.Power Wch "Power released by the electrical heaters";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Vapor phase density";
-
-  Connectors.FluidInlet Cas "Water input"
-                                 annotation (Placement(transformation(extent={{
-            -8,92},{8,108}}, rotation=0)));
-  Connectors.FluidOutlet Cs "Steam output"
-    annotation (Placement(transformation(extent={{92,90},{108,106}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Ca "Thermal input to the wall"
-    annotation (Placement(transformation(extent={{-100,-8},{-80,12}}, rotation=
-            0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cc "Thermal input to the liquid"
-    annotation (Placement(transformation(extent={{-10,-42},{10,-22}}, rotation=
-            0)));
-protected
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol;
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov;
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat;
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat;
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"
-    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
-  Connectors.FluidOutlet Cex "Water output"
-    annotation (Placement(transformation(extent={{-8,-108},{8,-92}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(P) = 0;
-    der(hl) = 0;
-    der(hv) = 0;
-    der(y) = 0;
-    der(Tp) = 0;
-  else
-    P = P0;
-    hl = hls;
-    hv = hvs;
-    Yw = Yw0;
-    der(Tp) = 0;
-  end if;
-
-equation
-  /* Unconnected connectors */
-  if (cardinality(Cas) == 0) then
-    Cas.Q = 0;
-    Cas.h = 1.e5;
-    Cas.b = true;
-  end if;
-
-  if (cardinality(Cex) == 0) then
-    Cex.Q = 0;
-    Cex.h = 1.e5;
-    Cex.a = true;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h = 1.e5;
-    Cs.a = true;
-  end if;
-
-  Cas.P = P;
-  Cs.P = P;
-  Cex.P = Pfond;
-
-  Cas.h_vol = hl;
-  Cs.h_vol = hv;
-  Cex.h_vol = hl;
-
-  Ca.W = Wpa;
-  Ca.T = Ta;
-
-  Cc.W = Wch;
-  Cc.T = Tl;
-
-  yLevel.signal = Yw;
-
-  /* Computation of the geometrical variables */
-  Yw = 100*y;
-  Zl = Zm*y + 0.5*(V/Ap - Zm);
-  Vl = Ap*Zl;
-  Vv = V - Vl;
-  Slpin = Zl*2*pi*Rp;
-  Svpin = (V/Ap - Zl)*2*pi*Rp;
-
-  /* Liquid phase mass balance equation */
-  rhol*Ap*Zm*der(y) + Vl*prol.ddph*der(P) + Vl*prol.ddhp*der(hl) = Cas.Q - Cex.Q + Qcond - Qevap;
-
-  /* Gas phase mass balance equation */
-  -rhov*Ap*Zm*der(y) + Vv*prov.ddph*der(P) + Vv*prov.ddhp*der(hv) = Qevap - Cs.Q - Qcond;
-
-  /* Liquid phase energy balance equation */
-  rhol*Vl*der(hl) - Vl*der(P) = (Qcond + Cas.Q)*(hls - hl) - Qevap*(hvs - hl)
-                                - Cex.Q*(Cex.h - hl) - Wpl + Wlv + Wch;
-
-  /* Gas phase energy balance equation */
-  rhov*Vv*der(hv) - Vv*der(P) = Qevap*(hvs - hv) - Qcond*(hls - hv)
-                                - Cas.Q*(hls - Cas.h) - Wpv - Wlv - Cs.Q*(Cs.h - hv);
-
-  /* Energy balance equation at the wall */
-  Mp*cpp*der(Tp) = Wpl + Wpv + Wpa;
-
-  /* Heat exchange between liquid and gas phases */
-  Wlv = Klv*Ap*(Tv - Tl);
-
-  /* Heat exchange between the liquid phase and the wall */
-  Wpl = Klp*Slpin*(Tl - Tp);
-
-  /* Heat exchange between the gas phase and the wall */
-  Wpv = Kvp*Svpin*(Tv - Tp);
-
-  /* Heat exchange between the wall and the outside */
-  Wpa = Kpa*Ae*(Ta - Tp);
-
-  /* Pressure in the expansion line */
-  Pfond = P + g*(Vl*rhol + Vv*rhov)/Ap;
-
-  /* Condensation and evaporation mass flows */
-  Qevap = Cevap*rhol*Vl*(hl - hls)/(hvs - hls);
-  //Qcond = noEvent(Ccond*rhov*Vv*(hvs - hv)/(hvs - hls) + (Cas.Q*(hls - Cas.h)
-  //   + 0.5*(Wpv + abs(Wpv)) + Wlv)/(hv - hls));
-  Qcond = Ccond*rhov*Vv*(hvs - hv)/(hvs - hls);
-
-  /* Fluid thermodynamic properties */
-  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hl, 0);
-  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv, 0);
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-
-  Tl = prol.T;
-  Tv = prov.T;
-  rhol = prol.d;
-  rhov = prov.d;
-  hls = lsat.h;
-  hvs = vsat.h;
-
-  annotation (Icon(graphics={
-        Line(
-          points={{100,90},{100,60},{80,60},{80,60}},
-          color={0,0,255},
-          thickness=1),
-        Ellipse(
-          extent={{-80,-92},{80,-42}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-80,-14},{80,-68}},
-          lineColor={85,170,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-80,42},{80,92}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{0,40},{0,92}},
-          color={0,0,255},
-          thickness=1),
-        Line(points={{0,38},{0,92}}, color={255,255,255}),
-        Rectangle(
-          extent={{-80,-14},{80,68}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-79,68},{80,68}}, color={255,255,255}),
-        Line(points={{80,60},{100,60},{100,90}}, color={255,255,255})}),
-                            Diagram(graphics={
-        Ellipse(
-          extent={{-80,-92},{80,-42}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-80,-14},{80,-68}},
-          lineColor={85,170,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-80,42},{80,92}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{0,40},{0,92}},
-          color={0,0,255},
-          thickness=1),
-        Line(points={{0,38},{0,92}}, color={255,255,255}),
-        Rectangle(
-          extent={{-80,-14},{80,68}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-79,68},{80,68}}, color={255,255,255}),
-        Text(
-          extent={{58,4},{58,-10}},
-          lineColor={0,0,255},
-          textString=
-               "Niveau"),
-        Line(
-          points={{100,90},{100,60},{80,60},{80,60}},
-          color={0,0,255},
-          thickness=1),
-        Line(points={{80,60},{100,60},{100,90}}, color={255,255,255})}),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 14.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end Pressurizer;
+within ThermoSysPro.WaterSteam.Volumes;
+model Pressurizer "Pressurizer"
+  parameter Units.SI.Volume V=61.1 "Pressurizer volume";
+  parameter Units.SI.Radius Rp=1.265 "Pressurizer cross-sectional radius";
+  parameter Units.SI.Area Ae=1 "Wall surface";
+  parameter Units.SI.Position Zm=10.15 "Hauteur de la gamme de mesure niveau";
+  parameter Real Yw0=50
+    "Initial water level - percent of the measure scale level (active if steady_state=false)";
+  parameter Units.SI.AbsolutePressure P0=155e5
+    "Initial fluid pressure (active if steady_state=false)";
+  parameter Real Ccond=0.1 "Condensation coefficient";
+  parameter Real Cevap=0.1 "Evaporation coefficient";
+  parameter Units.SI.CoefficientOfHeatTransfer Klv=0.5e6
+    "Heat exchange coefficient between the liquid and gas phases";
+  parameter Units.SI.CoefficientOfHeatTransfer Klp=50000
+    "Heat exchange coefficient between the liquid phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kvp=25
+    "Heat exchange coefficient between the gas phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kpa=542
+    "Heat exchange coefficient between the wall and the outside";
+  parameter Units.SI.Mass Mp=117e3 "Wall mass";
+  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, Yw0)";
+
+protected
+  constant Real pi=Modelica.Constants.pi "Pi";
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Units.SI.Area Ap=pi*Rp*Rp "Pressurizer cross-sectional area";
+
+public
+  Units.SI.Area Slpin "Exchange surface between the liquid and the wall";
+  Units.SI.Area Svpin "Exchange surface between the vapor and the wall";
+  Real Yw(start=50) "Liquid level as a percent of the measure scale";
+  Real y(start=0.5) "Liquid level as a proportion of the measure scale";
+  Units.SI.Position Zl(start=20) "Liquid level in the pressurizer";
+  Units.SI.Volume Vl "Liquid phase volume";
+  Units.SI.Volume Vv "Gas phase volume";
+  Units.SI.AbsolutePressure P(start=155.0e5) "Average fluid pressure";
+  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the drum";
+  Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Gas phase specific enthalpy";
+  Units.SI.SpecificEnthalpy hls "Liquid phase saturation specific enthalpy";
+  Units.SI.SpecificEnthalpy hvs "Gas phase saturation specific enthalpy";
+  Units.SI.Temperature Tl "Liquid phase temperature";
+  Units.SI.Temperature Tv "Gas phase temperature";
+  Units.SI.Temperature Tp(start=617.24) "Wall temperature";
+  Units.SI.Temperature Ta "External temperature";
+  Units.SI.Power Wlv
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  Units.SI.Power Wpl
+    "Thermal power exchanged from the liquid phase to the wall";
+  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
+  Units.SI.Power Wpa "Thermal power exchanged from the outside to the wall";
+  Units.SI.Power Wch "Power released by the electrical heaters";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Vapor phase density";
+
+  Connectors.FluidInlet Cas "Water input"
+                                 annotation (Placement(transformation(extent={{
+            -8,92},{8,108}}, rotation=0)));
+  Connectors.FluidOutlet Cs "Steam output"
+    annotation (Placement(transformation(extent={{92,90},{108,106}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Ca "Thermal input to the wall"
+    annotation (Placement(transformation(extent={{-100,-8},{-80,12}}, rotation=
+            0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cc "Thermal input to the liquid"
+    annotation (Placement(transformation(extent={{-10,-42},{10,-22}}, rotation=
+            0)));
+protected
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol;
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov;
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat;
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat;
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"
+    annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+  Connectors.FluidOutlet Cex "Water output"
+    annotation (Placement(transformation(extent={{-8,-108},{8,-92}}, rotation=0)));
+  InstrumentationAndControl.Connectors.OutputReal Pressure "Measured pressure in the volume"
+    annotation (Placement(transformation(extent={{80,20},{100,40}})));
+initial equation
+  if steady_state then
+    der(P) = 0;
+    der(hl) = 0;
+    der(hv) = 0;
+    der(y) = 0;
+    der(Tp) = 0;
+  else
+    P = P0;
+    hl = hls;
+    hv = hvs;
+    Yw = Yw0;
+    der(Tp) = 0;
+  end if;
+
+equation
+  /* Unconnected connectors */
+  if (cardinality(Cas) == 0) then
+    Cas.Q = 0;
+    Cas.h = 1.e5;
+    Cas.b = true;
+  end if;
+
+  if (cardinality(Cex) == 0) then
+    Cex.Q = 0;
+    Cex.h = 1.e5;
+    Cex.a = true;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h = 1.e5;
+    Cs.a = true;
+  end if;
+
+  Cas.P = P;
+  Cs.P = P;
+  Cex.P = Pfond;
+
+  Cas.h_vol = hl;
+  Cs.h_vol = hv;
+  Cex.h_vol = hl;
+
+  Ca.W = Wpa;
+  Ca.T = Ta;
+
+  Cc.W = Wch;
+  Cc.T = Tl;
+
+  yLevel.signal = Yw;
+  Pressure.signal = P;
+
+  /* Computation of the geometrical variables */
+  Yw = 100*y;
+  Zl = Zm*y + 0.5*(V/Ap - Zm);
+  Vl = Ap*Zl;
+  Vv = V - Vl;
+  Slpin = Zl*2*pi*Rp;
+  Svpin = (V/Ap - Zl)*2*pi*Rp;
+
+  /* Liquid phase mass balance equation */
+  rhol*Ap*Zm*der(y) + Vl*prol.ddph*der(P) + Vl*prol.ddhp*der(hl) = Cas.Q - Cex.Q + Qcond - Qevap;
+
+  /* Gas phase mass balance equation */
+  -rhov*Ap*Zm*der(y) + Vv*prov.ddph*der(P) + Vv*prov.ddhp*der(hv) = Qevap - Cs.Q - Qcond;
+
+  /* Liquid phase energy balance equation */
+  rhol*Vl*der(hl) - Vl*der(P) = (Qcond + Cas.Q)*(hls - hl) - Qevap*(hvs - hl)
+                                - Cex.Q*(Cex.h - hl) - Wpl + Wlv + Wch;
+
+  /* Gas phase energy balance equation */
+  rhov*Vv*der(hv) - Vv*der(P) = Qevap*(hvs - hv) - Qcond*(hls - hv)
+                                - Cas.Q*(hls - Cas.h) - Wpv - Wlv - Cs.Q*(Cs.h - hv);
+
+  /* Energy balance equation at the wall */
+  Mp*cpp*der(Tp) = Wpl + Wpv + Wpa;
+
+  /* Heat exchange between liquid and gas phases */
+  Wlv = Klv*Ap*(Tv - Tl);
+
+  /* Heat exchange between the liquid phase and the wall */
+  Wpl = Klp*Slpin*(Tl - Tp);
+
+  /* Heat exchange between the gas phase and the wall */
+  Wpv = Kvp*Svpin*(Tv - Tp);
+
+  /* Heat exchange between the wall and the outside */
+  Wpa = Kpa*Ae*(Ta - Tp);
+
+  /* Pressure in the expansion line */
+  Pfond = P + g*(Vl*rhol + Vv*rhov)/Ap;
+
+  /* Condensation and evaporation mass flows */
+  Qevap = Cevap*rhol*Vl*(hl - hls)/(hvs - hls);
+  //Qcond = noEvent(Ccond*rhov*Vv*(hvs - hv)/(hvs - hls) + (Cas.Q*(hls - Cas.h)
+  //   + 0.5*(Wpv + abs(Wpv)) + Wlv)/(hv - hls));
+  Qcond = Ccond*rhov*Vv*(hvs - hv)/(hvs - hls);
+
+  /* Fluid thermodynamic properties */
+  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hl, 0);
+  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv, 0);
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+
+  Tl = prol.T;
+  Tv = prov.T;
+  rhol = prol.d;
+  rhov = prov.d;
+  hls = lsat.h;
+  hvs = vsat.h;
+
+  annotation (Icon(graphics={
+        Line(
+          points={{100,90},{100,60},{80,60},{80,60}},
+          color={0,0,255},
+          thickness=1),
+        Ellipse(
+          extent={{-80,-92},{80,-42}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-80,-14},{80,-68}},
+          lineColor={85,170,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-80,42},{80,92}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{0,40},{0,92}},
+          color={0,0,255},
+          thickness=1),
+        Line(points={{0,38},{0,92}}, color={255,255,255}),
+        Rectangle(
+          extent={{-80,-14},{80,68}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-79,68},{80,68}}, color={255,255,255}),
+        Line(points={{80,60},{100,60},{100,90}}, color={255,255,255})}),
+                            Diagram(graphics={
+        Ellipse(
+          extent={{-80,-92},{80,-42}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-80,-14},{80,-68}},
+          lineColor={85,170,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-80,42},{80,92}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{0,40},{0,92}},
+          color={0,0,255},
+          thickness=1),
+        Line(points={{0,38},{0,92}}, color={255,255,255}),
+        Rectangle(
+          extent={{-80,-14},{80,68}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-79,68},{80,68}}, color={255,255,255}),
+        Text(
+          extent={{122,8},{122,-6}},
+          lineColor={0,0,255},
+          textString="Level"),
+        Line(
+          points={{100,90},{100,60},{80,60},{80,60}},
+          color={0,0,255},
+          thickness=1),
+        Line(points={{80,60},{100,60},{100,90}}, color={255,255,255}),
+        Text(
+          extent={{106,42},{148,20}},
+          textColor={0,0,255},
+          textString="Pressure")}),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 14.3 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end Pressurizer;
diff --git a/ThermoSysPro/WaterSteam/Volumes/Tank.mo b/ThermoSysPro/WaterSteam/Volumes/Tank.mo
index a3ca64fbda02ed10da0bcf67f06571fb0e8d51f3..455a7eaeb3a4741df244707d6d3d0a2baef0a2b6 100644
--- a/ThermoSysPro/WaterSteam/Volumes/Tank.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/Tank.mo
@@ -1,224 +1,224 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model Tank "Open tank"
-  parameter Units.SI.AbsolutePressure Patm=1.013e5
-    "Pressure above the fluid level";
-  parameter Units.SI.Area A=1 "Tank cross sectional area";
-  parameter Units.SI.Position ze1=40 "Altitude of inlet 1";
-  parameter Units.SI.Position ze2=de2/2 "Altitude of inlet 2";
-  parameter Units.SI.Position zs1=40 "Altitude of outlet 1";
-  parameter Units.SI.Position zs2=ds2/2 "Altitude of outlet 2";
-  parameter Units.SI.Diameter de1=0.20 "Diameter of inlet 1";
-  parameter Units.SI.Diameter de2=0.20 "Diameter of inlet 2";
-  parameter Units.SI.Diameter ds1=0.20 "Diameter of outlet 1";
-  parameter Units.SI.Diameter ds2=0.20 "Diameter of outlet 2";
-  parameter Units.SI.Position z0=30
-    "Initial fluid level (active if steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1.e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Real ke1=1
-    "Pressure loss coefficient for inlet e1";
-  parameter Real ke2=1
-    "Pressure loss coefficient for inlet e2";
-  parameter Real ks1=1
-    "Pressure loss coefficient for outlet s1";
-  parameter Real ks2=1
-    "Pressure loss coefficient for outlet s2";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=false
-    "true: start from steady state - false: start from h0";
-  parameter Boolean steady_state_mech=false
-    "true: start from steady state - false: start from z0";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-protected
-  parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  parameter Real eps=1.e-0 "Small number for ths square function";
-  parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level";
-  parameter Real pi=Modelica.Constants.pi;
-
-public
-  Units.SI.Position z "Fluid level";
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energy balance equation";
-  ThermoSysPro.Units.SI.PressureDifference deltaP_e1 "Presure loss for e1";
-  ThermoSysPro.Units.SI.PressureDifference deltaP_e2 "Presure loss for e2";
-  ThermoSysPro.Units.SI.PressureDifference deltaP_s1 "Presure loss for s1";
-  ThermoSysPro.Units.SI.PressureDifference deltaP_s2 "Presure loss for s2";
-  Real omega_e1;
-  Real omega_e2;
-  Real omega_s1;
-  Real omega_s2;
-  Units.SI.Angle theta_e1;
-  Units.SI.Angle theta_e2;
-  Units.SI.Angle theta_s1;
-  Units.SI.Angle theta_s2;
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Water properties"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"                        annotation (Placement(transformation(
-          extent={{100,10},{120,30}}, rotation=0)));
-  Connectors.FluidInlet Ce1          annotation (Placement(transformation(
-          extent={{-110,50},{-90,70}}, rotation=0)));
-  Connectors.FluidOutlet Cs2         annotation (Placement(transformation(
-          extent={{90,-70},{110,-50}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Connectors.FluidInlet Ce2          annotation (Placement(transformation(
-          extent={{-110,-70},{-90,-50}}, rotation=0)));
-  Connectors.FluidOutlet Cs1         annotation (Placement(transformation(
-          extent={{92,50},{112,70}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(h) = 0;
-  else
-    h = h0;
-  end if;
-
-  if steady_state_mech then
-    der(z) = 0;
-  else
-    z = z0;
-  end if;
-
-equation
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h = 1.e5;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h = 1.e5;
-    Cs2.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-  if dynamic_mass_balance then
-    A*(pro.ddph*der(P) + pro.ddhp*der(h))*z + A*rho*der(z) = BQ;
-  else
-    A*rho*der(z) = BQ;
-  end if;
-
-  /* Momentum balance equations */
-  theta_e1 = if (z > ze1 + de1/2) then pi/2
-             else if (z < ze1 - de1/2) then -pi/2
-             else asin((z - ze1)/de1/2);
-
-  theta_e2 = if (z > ze2 + de2/2) then pi/2
-             else if (z < ze2 - de2/2) then -pi/2
-             else asin((z - ze2)/de2/2);
-
-  theta_s1 = if (z > zs1 + ds1/2) then pi/2
-             else if (z < zs1 - ds1/2) then -pi/2
-             else asin((z - zs1)/ds1/2);
-
-  theta_s2 = if (z > zs2 + ds2/2) then pi/2
-             else if (z < zs2 - ds2/2) then -pi/2
-             else asin((z - zs2)/ds2/2);
-
-  omega_e1 = if (Ce1.Q >= 0) then 1 else (pi + 2*theta_e1 + sin(2*theta_e1))/2/pi;
-  omega_e2 = if (Ce2.Q >= 0) then 1 else (pi + 2*theta_e2 + sin(2*theta_e2))/2/pi;
-  omega_s1 = if (Cs1.Q <= 0) then 1 else (pi + 2*theta_s1 + sin(2*theta_s1))/2/pi;
-  omega_s2 = if (Cs2.Q <= 0) then 1 else (pi + 2*theta_s2 + sin(2*theta_s2))/2/pi;
-
-  deltaP_e1 = Ce1.P - (Patm + rho*g*max(z - ze1, 0));
-  deltaP_e2 = Ce2.P - (Patm + rho*g*max(z - ze2, 0));
-  deltaP_s1 = Patm + rho*g*max(z - zs1, 0) - Cs1.P;
-  deltaP_s2 = Patm + rho*g*max(z - zs2, 0) - Cs2.P;
-
-  deltaP_e1*omega_e1^2 = ke1*ThermoSysPro.Functions.ThermoSquare(Ce1.Q, eps)/2/rho;
-  deltaP_e2*omega_e2^2 = ke2*ThermoSysPro.Functions.ThermoSquare(Ce2.Q, eps)/2/rho;
-  deltaP_s1*omega_s1^2 = ks1*ThermoSysPro.Functions.ThermoSquare(Cs1.Q, eps)/2/rho;
-  deltaP_s2*omega_s2^2 = ks2*ThermoSysPro.Functions.ThermoSquare(Cs2.Q, eps)/2/rho;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*(Ce1.h - h) + Ce2.Q*(Ce2.h - h) - Cs1.Q*(Cs1.h - h) - Cs2.Q*(Cs2.h - h) + Cth.W;
-  if (z > zmin) then
-    A*rho*z*der(h) = BH;
-  else
-    der(h) = 0;
-  end if;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-
-  Cth.T = T;
-
-  /* Fluid level sensor */
-  yLevel.signal = z;
-
-  /* Fluid thermodynamic properties */
-  P = Patm + rho*g*z/2;
-
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-100}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid), Rectangle(extent={{-100,100},{100,20}})}),
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={Rectangle(
-          extent={{-100,20},{100,-100}},
-          lineColor={28,108,200},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid), Rectangle(extent={{-100,100},{100,20}},
-            lineColor={28,108,200})}),
-    Window(
-      x=0.16,
-      y=0.03,
-      width=0.81,
-      height=0.9),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</h4>
-<p><b>ThermoSysPro Version 3.2</h4>
-<p>This component model is documented in Sect. 14.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</html>",
-   revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end Tank;
+within ThermoSysPro.WaterSteam.Volumes;
+model Tank "Open tank"
+  parameter Units.SI.AbsolutePressure Patm=1.013e5
+    "Pressure above the fluid level";
+  parameter Units.SI.Area A=1 "Tank cross sectional area";
+  parameter Units.SI.Position ze1=40 "Altitude of inlet 1";
+  parameter Units.SI.Position ze2=de2/2 "Altitude of inlet 2";
+  parameter Units.SI.Position zs1=40 "Altitude of outlet 1";
+  parameter Units.SI.Position zs2=ds2/2 "Altitude of outlet 2";
+  parameter Units.SI.Diameter de1=0.20 "Diameter of inlet 1";
+  parameter Units.SI.Diameter de2=0.20 "Diameter of inlet 2";
+  parameter Units.SI.Diameter ds1=0.20 "Diameter of outlet 1";
+  parameter Units.SI.Diameter ds2=0.20 "Diameter of outlet 2";
+  parameter Units.SI.Position z0=30
+    "Initial fluid level (active if steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1.e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Real ke1=1
+    "Pressure loss coefficient for inlet e1";
+  parameter Real ke2=1
+    "Pressure loss coefficient for inlet e2";
+  parameter Real ks1=1
+    "Pressure loss coefficient for outlet s1";
+  parameter Real ks2=1
+    "Pressure loss coefficient for outlet s2";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=false
+    "true: start from steady state - false: start from h0";
+  parameter Boolean steady_state_mech=false
+    "true: start from steady state - false: start from z0";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+protected
+  parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  parameter Real eps=1.e-0 "Small number for ths square function";
+  parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level";
+  parameter Real pi=Modelica.Constants.pi;
+
+public
+  Units.SI.Position z "Fluid level";
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energy balance equation";
+  ThermoSysPro.Units.SI.PressureDifference deltaP_e1 "Presure loss for e1";
+  ThermoSysPro.Units.SI.PressureDifference deltaP_e2 "Presure loss for e2";
+  ThermoSysPro.Units.SI.PressureDifference deltaP_s1 "Presure loss for s1";
+  ThermoSysPro.Units.SI.PressureDifference deltaP_s2 "Presure loss for s2";
+  Real omega_e1;
+  Real omega_e2;
+  Real omega_s1;
+  Real omega_s2;
+  Units.SI.Angle theta_e1;
+  Units.SI.Angle theta_e2;
+  Units.SI.Angle theta_s1;
+  Units.SI.Angle theta_s2;
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Water properties"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"                        annotation (Placement(transformation(
+          extent={{100,10},{120,30}}, rotation=0)));
+  Connectors.FluidInlet Ce1          annotation (Placement(transformation(
+          extent={{-110,50},{-90,70}}, rotation=0)));
+  Connectors.FluidOutlet Cs2         annotation (Placement(transformation(
+          extent={{90,-70},{110,-50}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Connectors.FluidInlet Ce2          annotation (Placement(transformation(
+          extent={{-110,-70},{-90,-50}}, rotation=0)));
+  Connectors.FluidOutlet Cs1         annotation (Placement(transformation(
+          extent={{92,50},{112,70}}, rotation=0)));
+initial equation
+  if steady_state then
+    der(h) = 0;
+  else
+    h = h0;
+  end if;
+
+  if steady_state_mech then
+    der(z) = 0;
+  else
+    z = z0;
+  end if;
+
+equation
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h = 1.e5;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h = 1.e5;
+    Cs2.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+  if dynamic_mass_balance then
+    A*(pro.ddph*der(P) + pro.ddhp*der(h))*z + A*rho*der(z) = BQ;
+  else
+    A*rho*der(z) = BQ;
+  end if;
+
+  /* Momentum balance equations */
+  theta_e1 = if (z > ze1 + de1/2) then pi/2
+             else if (z < ze1 - de1/2) then -pi/2
+             else asin((z - ze1)/de1/2);
+
+  theta_e2 = if (z > ze2 + de2/2) then pi/2
+             else if (z < ze2 - de2/2) then -pi/2
+             else asin((z - ze2)/de2/2);
+
+  theta_s1 = if (z > zs1 + ds1/2) then pi/2
+             else if (z < zs1 - ds1/2) then -pi/2
+             else asin((z - zs1)/ds1/2);
+
+  theta_s2 = if (z > zs2 + ds2/2) then pi/2
+             else if (z < zs2 - ds2/2) then -pi/2
+             else asin((z - zs2)/ds2/2);
+
+  omega_e1 = if (Ce1.Q >= 0) then 1 else (pi + 2*theta_e1 + sin(2*theta_e1))/2/pi;
+  omega_e2 = if (Ce2.Q >= 0) then 1 else (pi + 2*theta_e2 + sin(2*theta_e2))/2/pi;
+  omega_s1 = if (Cs1.Q <= 0) then 1 else (pi + 2*theta_s1 + sin(2*theta_s1))/2/pi;
+  omega_s2 = if (Cs2.Q <= 0) then 1 else (pi + 2*theta_s2 + sin(2*theta_s2))/2/pi;
+
+  deltaP_e1 = Ce1.P - (Patm + rho*g*max(z - ze1, 0));
+  deltaP_e2 = Ce2.P - (Patm + rho*g*max(z - ze2, 0));
+  deltaP_s1 = Patm + rho*g*max(z - zs1, 0) - Cs1.P;
+  deltaP_s2 = Patm + rho*g*max(z - zs2, 0) - Cs2.P;
+
+  deltaP_e1*omega_e1^2 = ke1*ThermoSysPro.Functions.ThermoSquare(Ce1.Q, eps)/2/rho;
+  deltaP_e2*omega_e2^2 = ke2*ThermoSysPro.Functions.ThermoSquare(Ce2.Q, eps)/2/rho;
+  deltaP_s1*omega_s1^2 = ks1*ThermoSysPro.Functions.ThermoSquare(Cs1.Q, eps)/2/rho;
+  deltaP_s2*omega_s2^2 = ks2*ThermoSysPro.Functions.ThermoSquare(Cs2.Q, eps)/2/rho;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*(Ce1.h - h) + Ce2.Q*(Ce2.h - h) - Cs1.Q*(Cs1.h - h) - Cs2.Q*(Cs2.h - h) + Cth.W;
+  if (z > zmin) then
+    A*rho*z*der(h) = BH;
+  else
+    der(h) = 0;
+  end if;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+
+  Cth.T = T;
+
+  /* Fluid level sensor */
+  yLevel.signal = z;
+
+  /* Fluid thermodynamic properties */
+  P = Patm + rho*g*z/2;
+
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-100}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid), Rectangle(extent={{-100,100},{100,20}})}),
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={Rectangle(
+          extent={{-100,20},{100,-100}},
+          lineColor={28,108,200},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid), Rectangle(extent={{-100,100},{100,20}},
+            lineColor={28,108,200})}),
+    Window(
+      x=0.16,
+      y=0.03,
+      width=0.81,
+      height=0.9),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</h4>
+<p><b>ThermoSysPro Version 3.2</h4>
+<p>This component model is documented in Sect. 14.5 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</html>",
+   revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end Tank;
diff --git a/ThermoSysPro/WaterSteam/Volumes/TwoPhaseCavity.mo b/ThermoSysPro/WaterSteam/Volumes/TwoPhaseCavity.mo
index cbcf978a8c77986d2d30119db9e7d005e77b05c1..26636ebd1ea57936c13de3f34013df3226a2642d 100644
--- a/ThermoSysPro/WaterSteam/Volumes/TwoPhaseCavity.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/TwoPhaseCavity.mo
@@ -1,865 +1,865 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model TwoPhaseCavity "TwoPhaseCavity for one shell pass "
-  parameter Boolean Vertical=true
-    "true: vertical cylinder - false: horizontal cylinder";
-  parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area";
-  parameter Units.SI.Length Lc=2.5
-    "support plate spacing in cooling zone(Chicanes)";
-  parameter Units.SI.Volume V=50
-    "Cavity volume ( total volume + bleedings volume - pipes volume) ";
-  parameter Units.SI.Volume Vmin=1.e-6;
-  parameter Real Vf0=0.5
-    "Fraction of initial water volume in the Cavity (active if steady_state=false)";
-  parameter Integer Ns=10 "Number of segments for one tube pass";
-  parameter Integer NbTub1=500
-    "Numbers of drowned pipes in liquid; Pipe 1 (Hoizontal, Vertical Separate)";
-  parameter Integer NbTub2=500 "Number of total pipes immersed in steam = NbTub2; Pipe 2";
-  parameter Integer NbTub3=2000 "Number of total pipes immersed in steam ; Pipe 3";
-  parameter Integer NbTubV=15 "Numbers of pipes in a vertical row (tube bank)";
-  parameter Units.SI.Length L1=10
-    " Length of drowned pipes in liquid (pipes 1)";
-  parameter Units.SI.Length L2=10 " Length of Pipe 2 (in steam)";
-  parameter Units.SI.Length L3=20 " Length of Pipe 3 (in steam)";
-  parameter Units.SI.Diameter Dext=0.02 "External pipe diameter";
-  parameter Units.SI.Diameter DIc=1.40 "Internal calendre diameter";
-  parameter Units.SI.Length PasL=0.025
-    "Longitudianl step or Length bottom pipes triangular step";
-  parameter Units.SI.Length PasT=0.023 " Transverse step or pipes step";
-  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
-  parameter ThermoSysPro.Units.nonSI.Angle_deg Angle=60
-    "Average bend angle (deg)";
-  parameter Units.SI.Pressure P0=1e5
-    "Fluid initial pressure (active if steady_state=false)";
-  parameter Real Ccond=0.01 "Condensation coefficient";
-  parameter Real Cevap=0.09 "Evaporation coefficient";
-  parameter Real Xlo=0.0025
-    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
-  parameter Real Xvo=0.9975
-    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
-  //parameter Real Kvl=1000
-  // "Heat exchange coefficient between the liquid and gas phases";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, Vl0)";
-  parameter Real COPv( start=1)= 1
-    "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side";
-  parameter Real COPl(start=1) = 1
-    "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side";
-  parameter Boolean Cal_hconv=true
-    "false : heat transfer coefficient liquid and steam = parameter  - true: calculate by Nusselt corelation";
-  parameter Units.SI.CoefficientOfHeatTransfer hliq=1.5e3
-    "Heat transfer coefficient between the liquid and the cooling pipes ";
-  parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3
-    "Heat transfer coefficient between the vapor and the cooling pipes ";
-  parameter Units.SI.CoefficientOfHeatTransfer Kvl=1000
-    "Heat exchange coefficient between the liquid and gas phases";
-  parameter Units.SI.CoefficientOfHeatTransfer Klp=850
-    "Heat exchange coefficient between the liquid phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kvp=450
-    "Heat exchange coefficient between the gas phase and the wall";
-  parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.5
-    "Heat exchange coefficient between the wall and the outside ambiant";
-  parameter Units.SI.Temperature Ta=310 "External temperature";
-  parameter Units.SI.Mass Mp=100e3 "Wall mass";
-  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
-
-//***********************************
-  parameter Boolean step_square=true
-    "true: Aligned pipes   - false: staggered pipes (Step triangular)";
-
-//protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi;
-  parameter Integer Ns3=2*Ns "Number of segments for half pipes";
-  //parameter Modelica.SIunits.PathLength Ls1=L1/Ns "Section length for one pass pipe";
-  parameter Units.SI.CoefficientOfHeatTransfer h4=1
-    "h4 = 1, Heat exchange coefficient";
-  parameter Units.SI.Area S4=1 " S4 = 1, Heat exchange surface  ";
-
-public
-  Units.SI.Length L(start=15) "Cavity length";
-  Integer NbTubT "Number of total pipes in Cavity";
-  Units.SI.Pressure P "Fluid average pressure";
-  Units.SI.Pressure Pfond "Fluid pressure at the bottom of the cavity";
-  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy";
-  //Modelica.SIunits.SpecificEnthalpy hl0 "Liquid phase spepcific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy";
-  Units.SI.Temperature Tl "Liquid phase temperature";
-  Units.SI.Temperature Tv "Gas phase temperature";
-  Units.SI.Volume Vl "Liquid phase volume";
-  Units.SI.Volume Vv "Gas phase volume";
-
-  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
-  Real xv(start=0) "Mass vapor fraction in the gas phase";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Gas phase density";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phaser";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase";
-  Real QS "Surface mass flow rate of Water (kg/m2s)";
-  //Real QSm "Surface mass flow rate maximal of Water (kg/m2s)";
-
-  Units.SI.Power dW1[Ns](start=fill(10e5, Ns))
-    "Power exchange between the wall and the fluid in each section side 1";
-  Units.SI.Power dW2[Ns](start=fill(10e5, Ns))
-    "Power exchange between the wall and the fluid in each section side 2";
-  Units.SI.Power dW3[Ns3](start=fill(10e5, Ns3))
-    "Power exchange between the wall and the fluid in each section side 3";
-
-  Units.SI.Power W1t "Total power exchanged on the steam side 1";
-  Units.SI.Power W2t "Total power exchanged on the water side 2";
-  Units.SI.Power W3t "Total power exchanged on the water side 3";
-  Units.SI.Power W4t "Total power exchanged on the steam side 4";
-  Units.SI.Power Wvl
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  Units.SI.Power Wpl
-    "Thermal power exchanged from the liquid phase to the wall";
-  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
-  Units.SI.Power Wpa "Thermal power losses to ambiant";
-  Units.SI.Temperature Tp1[Ns](start=fill(400, Ns))
-    "Wall temperature in section i of side 1";
-  Units.SI.Temperature Tp2[Ns](start=fill(400, Ns))
-    "Wall temperature in section i of side 2";
-  Units.SI.Temperature Tp3[Ns3](start=fill(400, Ns3))
-    "Wall temperature in section i of side 3";
-  Units.SI.Temperature Tp(start=400) "Wall temperature of cavity";
-  Units.SI.Position zl(start=1.05) "Liquid level in Cavity";
-  Units.SI.Area Al(start=5) "Cross sectional area of the liquid phase";
-  Units.SI.Angle theta "Angle";
-  Units.SI.Area Avl(start=5)
-    "Heat exchange surface between the liquid and gas phases";
-  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
-  Units.SI.Area Avp "Gas phase surface on contact with the wall";
-  Units.SI.Area Ape "Wall surface on contact with the fluid";
-  Units.SI.Area Surf_tot(start=1.e4) "Total heat exchange surface";
-  Units.SI.Area Surf_ext1(start=1.e2)
-    "Heat exchange surface for drowned section ; pipe 1";
-  Units.SI.Area Surf_ext2(start=1.e2)
-    "Heat exchange surface for section 2 ; pipe 2 ";
-  Units.SI.Area Surf_ext3(start=1.e2)
-    "Heat exchange surface for section 3 ; pipe 3";
-  //Modelica.SIunits.ReynoldsNumber Rel (start= 6.e4)  "liquid Reynolds number";
-  Units.SI.ReynoldsNumber Rel(start=6.e4) "liquid Reynolds number";
-  // Modelica.SIunits.ReynoldsNumber Rev( start= 6.e3) "Steam Reynolds number";
-  Real Prl(start=1) "liquid Prandtl number in node i";
-  Units.SI.ThermalConductivity kl(start=1) "liquid thermal conductivity";
-  Units.SI.DynamicViscosity mul(start=2.e-4) "liquid dynamic viscosity ";
-  Units.SI.DynamicViscosity mult[Ns](start=fill(2.e-4, Ns))
-    "liquid dynamic viscosity at wall temperature";
-  Units.SI.CoefficientOfHeatTransfer hcond2[Ns](start=fill(1e4, Ns))
-    "Heat transfer coefficient between the vapor and the cooling pipes zone 2";
-  Units.SI.CoefficientOfHeatTransfer hcond3[Ns3](start=fill(1e4, Ns3))
-    "Heat transfer coefficient between the vapor and the cooling pipes zone 3";
-  Units.SI.CoefficientOfHeatTransfer hliqu[Ns](start=fill(1000, Ns))
-    "Heat transfer coefficient between the liquid and the cooling pipes zone 1";
-  Units.SI.Diameter DH(start=0.02) "hydraulic diameter";
-  Real EE[Ns](start=fill(1, Ns));
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-250,70},{-210,110}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Propriétés de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{60,70},{100,110}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-250,-200},{-210,-160}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{58,-200},{98,-160}}, rotation=0)));
-  Connectors.FluidInlet Cv "Steam input"
-                                    annotation (Placement(transformation(extent=
-           {{-86,50},{-66,70}}, rotation=0)));
-  Connectors.FluidOutlet Cl "Water output"
-                                     annotation (Placement(transformation(
-          extent={{-86,-170},{-66,-150}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns3]
-                                     annotation (Placement(transformation(
-          extent={{-59,-37},{-47,-25}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"                        annotation (Placement(transformation(
-          extent={{90,-105},{110,-85}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{-250,-20},{-210,20}},
-          rotation=0)));
-  Connectors.FluidInlet Ce "Water input"
-                                    annotation (Placement(transformation(extent=
-           {{-160,50},{-140,70}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth1[Ns]
-                                     annotation (Placement(transformation(
-          extent={{-59,-103},{-47,-90}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth2[Ns]
-                                     annotation (Placement(transformation(
-          extent={{-59,35},{-47,48}}, rotation=0)));
-
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    annotation (Placement(transformation(extent={{-250,-110},{-210,-70}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provIn
-    "Propriétés de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{12,70},{52,110}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(hl) = 0;
-    der(hv) = 0;
-    der(Vl) = 0;
-    der(P) = 0;
-    der(Tp) = 0;
-  else
-    hl = lsat.h;
-    hv = vsat.h;
-    Vl = Vf0*V;
-    P = P0;
-    der(Tp) = 0;
-  end if;
-
-equation
-  /* Unconnected connectors */
-  if (cardinality(Cl) == 0) then
-    Cl.Q = 0;
-    Cl.h = 1.e5;
-    Cl.a = true;
-  end if;
-
-  if (cardinality(Cv) == 0) then
-    Cv.Q = 0;
-    Cv.h = 1.e5;
-    Cv.b = true;
-  end if;
-
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.b = true;
-  end if;
-
-  /* Wall temperature and HeatFlowRate*/
-  Cth1.T = Tp1;
-  Cth1.W = dW1;
-  Cth2.T = Tp2;
-  Cth2.W = dW2;
-  Cth3.T = Tp3;
-  Cth3.W = dW3;
-
-  /* Model boundaries */
-  Cl.P = Pfond;
-  Cv.P = P;
-  Ce.P = P;
-
-  /* Cavity length */
-  V=pi*R*R*L;
-
-  /* Liquid volume */
-  if Vertical then
-     theta = 1;
-     Al = pi*R^2;
-     Vl = Al*zl;
-     Avl = Al;
-     NbTubT = NbTub1;
-  else
-     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
-     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
-     Vl = Al*L;
-     Avl = 2*R*Modelica.Math.cos(theta)*L;
-     NbTubT = NbTub1 + NbTub3;
-  end if;
-
-  /* Heat exchange surface*/
-  Surf_ext1 = pi*Dext*L1/Ns*NbTub1;
-  Surf_ext2 = pi*Dext*L2/Ns*NbTub2;
-  Surf_ext3 = pi*Dext*L3/Ns3*NbTub3;
-  Surf_tot  = Ns*Surf_ext1 + Ns*Surf_ext2 + Ns3*Surf_ext3;
-
-  /* Cavity volume */
-  V = Vl + Vv;
-
-  /* Water leval */
-  yLevel.signal = zl;
-
-  /* Liquid surface and vapor surface on contact with wall */
-  Alp = if Vertical then 2*sqrt(pi/Al)*Vl + Al else (pi - 2*theta)*R*L + 2*Al;
-  Avp = if Vertical then 2*sqrt(pi/Al)*Vv + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al);
-
-  /* Wall surface on contact with the outside */
-  Ape = Alp + Avp;
-
-  /* Pressure at the bottom of the cavity */
-  Pfond = P + prod.d*g*zl;
-
-  /* Liquid phase mass balance equation */
-  BQl = -Cl.Q + Qcond - Qevap + (1 - proe.x)*Ce.Q;
-  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-
-  /* Vapor phase mass balance equation */
-  BQv = Cv.Q + Qevap - Qcond + proe.x*Ce.Q;
-  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-
-  /* Liquid phase energy balance equation */
-  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wpl + Wvl + W1t;
-  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-
-  /* Gas phase energy balance equation */
-  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wpv + W2t + W3t;
-  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-
-  Cl.h_vol = hl;
-  Ce.h_vol = hl;
-  Cv.h_vol = hv;
-
-  /* Energy balance equation at the wall */
-  Mp*cpp*der(Tp) = Wpl + Wpv - Wpa;
-
-  /* Heat exchange between liquid and gas phases */
-  Wvl = Kvl*Avl*(Tv - Tl);
-
-  /* Heat exchange between the liquid phase and the wall */
-  Wpl = Klp*Alp*(Tl - Tp);
-
-  /* Heat exchange between the gas phase and the wall */
-  Wpv = Kvp*Avp*(Tv - Tp);
-
-  /* Thermal power losses to ambiant, for simplifid we use the wall surface on contact with the fluid (Ape)*/
-  Wpa = Kpa*Ape*(Tp - Ta);
-
-  /* Condensation and evaporation mass flow rates */
-  Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
-  Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
-
-  /* Fluid thermodynamic properties */
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Ce.h, 0);
-  //prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hl, 0);
-  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P+Pfond)/2, hl, 0);
-  provIn = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Cv.h, 0);
-  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv, 0);
-  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond, Cl.h, 0);
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-  rhov = prov.d;
-  xv = prov.x;
-
-  mul = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol, Tl);
-  kl = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol, Tl,P, 0));
-
-  /* Heat transfer coefficient of fluid
-                   And
-     Power exchanged for each section
-    ----------------------------------*/
-  /* Heat transfer coefficient of liquid*/
-  //SACADOURA
-  DH= if step_square then 4*PasL^2/(pi*Dext) - Dext else ( (2*PasL*PasT) - (pi*Dext^2*(Angle/120)))/(pi*Dext*(Angle/120));
-
-  QS = Cl.Q /(DIc*Lc*(PasL - Dext)/PasL);
-
-  Rel = noEvent( abs(QS*DH/mul));
-  Prl = mul*prol.cp/kl;
-
-  assert( (PasL - Dext) > 0,  "Error Data for TwoPhaseCavity model (PasL - Dext)<=0 ");
-
-  for i in 1:Ns loop
-
-    mult[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol, Tp1[i]);
-
-    EE[i]= max( (PasT/Dext-1/2/((((PasL/Dext)^2 + (PasT/Dext/2)^2)^0.5/Dext)-1)),1);
-
-    /* Heat transfer coefficient of liquid*/
-    if Cal_hconv then
-       // Kern corelation (SACADOURA)
-       hliqu[i] = noEvent(if ((Rel > 1.e-6) and (Prl > 1.e-6)) then (COPl * 0.36*kl/Dext *Rel^0.55 *Prl^0.3333 *(mul/mult[i])^0.14) else  10);
-    else
-       hliqu[i] = COPl * hliq;
-    end if;
-
-    if Cal_hconv then
-       /* Heat transfer coefficient of vapeur*/
-       if Vertical then
-         // Frank P. & David P. Fundamentals of Heat Transfer  For (PasL/Dext)= 1.4
-         hcond2[i]  = COPv * noEvent( min( 1.13*( max( (g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h -lsat.h))/(max(L2,1)*mul*abs(lsat.T-Tp2[i]+1e-6)),2.225e15))^0.25, 20000));
-       else
-         // Nusselt corelation
-         //******************
-         hcond2[i]  =  COPv * noEvent( min( 0.728*( max( (g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*abs(lsat.T-Tp2[i]+1e-6)),2.225e15))^0.25, 20000));
-       end if;
-    else
-       hcond2[i] = COPv * hcond;
-    end if;
-
-    /* Power exchanged for each section zone 1*/
-    if (noEvent( abs(dW1[i]) < 0.1)) then
-       dW1[i] = - h4*S4*(Tv - Tp1[i]);
-    else
-       dW1[i] = - hliqu[i]*Surf_ext1 *((Tv+Tl)/2 - (Tp1[1]+Tp1[Ns])/2);
-    end if;
-
-    /* Power exchanged for each section zone 2*/
-    if (noEvent( abs(dW2[i]) < 0.1)) then
-       dW2[i] = - h4*S4*(Tv - Tp2[i]);
-    else
-       dW2[i] = - hcond2[i]*Surf_ext2*(Tv - Tp2[i]);
-    end if;
-
-  end for;
-
-  for i in 1:Ns3 loop
-    if Cal_hconv then
-       /* Heat transfer coefficient of vapeur*/
-       if Vertical then
-          // Frank P. & David P. Fundamentals of Heat Transfer  For vertical plate
-          hcond3[i]  = COPv * noEvent( min( 1.13*( max( (g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h -lsat.h))/(max(L3,1)*mul*abs(lsat.T-Tp3[i]+1e-6)), 2.225e15))^0.25, 20000));
-       else
-          // Nusselt corelation
-          //******************
-          hcond3[i]  =  COPv * noEvent( min( 0.728*( max( (g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*abs(lsat.T-Tp3[i]+1e-6)), 2.225e15))^0.25, 20000));
-       end if;
-    else
-       hcond3[i] = COPv * hcond;
-    end if;
-
-    /* Power exchanged for each section  zone 3 + power exchanged for Deheating*/
-    if (noEvent( abs(dW3[i]) < 0.1)) then
-       dW3[i] = - h4*S4*(Tv - Tp3[i]);
-    else
-       dW3[i] = - hcond3[i]*Surf_ext3*(Tv - Tp3[i]) + W4t/Ns3;
-    end if;
-
-  end for;
-
-  W1t = sum(dW1);
-  W2t = sum(dW2);
-  W3t = sum(dW3);
-
-  /* Total power exchanged for Deheating*/
-  W4t = noEvent( if ( Cv.h > vsat.h) then - Cv.Q*(Cv.h - vsat.h) else -0.0001);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-200},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-142,2},{-124,-6}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{-164,55},{-88,19}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Horizontal_1pipe"),
-        Rectangle(
-          extent={{-158,-6},{-102,-10}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-184,16},{-166,16}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Text(
-          extent={{-198,-6},{-160,-24}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{-180,-8},{-162,-8}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-102,-8},{-96,-8},{-96,16},{-160,16},{-170,16}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{-162,28},{-90,-44}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Text(
-          extent={{-182,-56},{-86,-78}},
-          lineColor={0,0,255},
-          textString=
-               "Vertical Separate"),
-        Rectangle(
-          extent={{-170,-100},{-166,-152}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-114,-76},{-114,-94}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{-116,-100},{-112,-152}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-168,-76},{-168,-94}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Rectangle(
-          extent={{-166,-176},{-120,-180}},
-          lineColor={0,0,255},
-          fillColor={85,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-190,-128},{-172,-136}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 2"),
-        Text(
-          extent={{-152,-180},{-134,-188}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 1"),
-        Text(
-          extent={{-111,-122},{-93,-130}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{-210,-164},{-172,-182}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{-168,-150},{-168,-160},{-114,-160},{-114,-150}},
-          color={0,0,255},
-          pattern=LinePattern.Dash,
-          arrow={Arrow.Filled,Arrow.None}),
-        Line(
-          points={{-183,-168},{-105,-168}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{-182,-96},{-106,-192}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-114,-78},{-114,-72},{-92,-72},{-92,-178},{-120,-178}},
-          color={0,0,255},
-          pattern=LinePattern.Dash,
-          arrow={Arrow.Filled,Arrow.None}),
-        Line(
-          points={{-188,-178},{-170,-178}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Text(
-          extent={{12,-54},{54,-70}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Vertical"),
-        Rectangle(
-          extent={{4,-82},{8,-134}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{6,-58},{6,-76}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{58,-82},{62,-134}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{60,-60},{60,-78}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Rectangle(
-          extent={{10,-142},{56,-146}},
-          lineColor={0,0,255},
-          fillColor={85,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-16,-104},{2,-112}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 2"),
-        Text(
-          extent={{16,-162},{42,-154}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 1"),
-        Text(
-          extent={{65,-112},{83,-120}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{-20,-50},{18,-68}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{6,-134},{6,-144},{60,-144},{60,-134}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-7,-138},{71,-138}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{-8,-78},{70,-152}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{2,-20},{58,-24}},
-          lineColor={0,0,255},
-          fillColor={85,255,255},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{32,34},{50,26}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 2"),
-        Text(
-          extent={{16,-26},{34,-34}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 1"),
-        Text(
-          extent={{18,10},{36,2}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{4,60},{56,34}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Horizontal"),
-        Rectangle(
-          extent={{2,2},{58,-2}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{2,26},{58,22}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-24,24},{-6,24}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Line(
-          points={{-36,-22},{-4,-22}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Text(
-          extent={{-58,-10},{-20,-28}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{60,-22},{72,-22},{72,24},{60,24},{58,24}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-20,0},{-2,0}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-20,-22},{-20,-3},{-20,-1}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{58,0},{64,0},{64,12},{-10,12},{-10,24}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{-2,36},{76,-38}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-2,-16},{76,-16}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{-160,18},{-142,14}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{2,26},{20,22}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-170,-100},{-166,-116}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{58,-82},{62,-98}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-234,64},{-164,36}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe4=deheating pipes"),
-        Text(
-          extent={{-158,26},{-140,18}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 4"),
-        Text(
-          extent={{0,34},{18,26}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 4"),
-        Text(
-          extent={{64,-86},{82,-94}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 4"),
-        Text(
-          extent={{-190,-104},{-172,-112}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 4"),
-        Text(
-          extent={{-132,-36},{38,-50}},
-          lineColor={0,0,255},
-          textString=
-               "Connected here for one pipe only")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-200},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Ellipse(
-          extent={{-100,50},{100,-150}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-250,50},{-50,-150}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-160,50},{8,-150}},
-          lineColor={255,255,0},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-250,-48},{-160,-48}}, color={255,255,0}),
-        Line(
-          points={{-160,-48},{100,-48}},
-          color={255,255,0},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,50},{-160,-150}},
-          color={255,255,0},
-          thickness=0.5),
-        Line(
-          points={{-160,-98},{88,-98}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-112},{78,-112}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-126},{66,-126}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-106},{82,-106}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-118},{72,-118}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-132},{56,-132}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-150},{8,-150}},
-          color={0,0,255},
-          thickness=0.5),
-        Text(
-          extent={{-136,-12},{34,-26}},
-          lineColor={0,0,255},
-          textString=
-               "Connected here for one pipe only")}),
-    Window(
-      x=0.11,
-      y=0.06,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end TwoPhaseCavity;
+within ThermoSysPro.WaterSteam.Volumes;
+model TwoPhaseCavity "TwoPhaseCavity for one shell pass "
+  parameter Boolean Vertical=true
+    "true: vertical cylinder - false: horizontal cylinder";
+  parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area";
+  parameter Units.SI.Length Lc=2.5
+    "support plate spacing in cooling zone(Chicanes)";
+  parameter Units.SI.Volume V=50
+    "Cavity volume ( total volume + bleedings volume - pipes volume) ";
+  parameter Units.SI.Volume Vmin=1.e-6;
+  parameter Real Vf0=0.5
+    "Fraction of initial water volume in the Cavity (active if steady_state=false)";
+  parameter Integer Ns=10 "Number of segments for one tube pass";
+  parameter Integer NbTub1=500
+    "Numbers of drowned pipes in liquid; Pipe 1 (Hoizontal, Vertical Separate)";
+  parameter Integer NbTub2=500 "Number of total pipes immersed in steam = NbTub2; Pipe 2";
+  parameter Integer NbTub3=2000 "Number of total pipes immersed in steam ; Pipe 3";
+  parameter Integer NbTubV=15 "Numbers of pipes in a vertical row (tube bank)";
+  parameter Units.SI.Length L1=10
+    " Length of drowned pipes in liquid (pipes 1)";
+  parameter Units.SI.Length L2=10 " Length of Pipe 2 (in steam)";
+  parameter Units.SI.Length L3=20 " Length of Pipe 3 (in steam)";
+  parameter Units.SI.Diameter Dext=0.02 "External pipe diameter";
+  parameter Units.SI.Diameter DIc=1.40 "Internal calendre diameter";
+  parameter Units.SI.Length PasL=0.025
+    "Longitudianl step or Length bottom pipes triangular step";
+  parameter Units.SI.Length PasT=0.023 " Transverse step or pipes step";
+  //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)";
+  parameter ThermoSysPro.Units.nonSI.Angle_deg Angle=60
+    "Average bend angle (deg)";
+  parameter Units.SI.Pressure P0=1e5
+    "Fluid initial pressure (active if steady_state=false)";
+  parameter Real Ccond=0.01 "Condensation coefficient";
+  parameter Real Cevap=0.09 "Evaporation coefficient";
+  parameter Real Xlo=0.0025
+    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
+  parameter Real Xvo=0.9975
+    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
+  //parameter Real Kvl=1000
+  // "Heat exchange coefficient between the liquid and gas phases";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, Vl0)";
+  parameter Real COPv( start=1)= 1
+    "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side";
+  parameter Real COPl(start=1) = 1
+    "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side";
+  parameter Boolean Cal_hconv=true
+    "false : heat transfer coefficient liquid and steam = parameter  - true: calculate by Nusselt corelation";
+  parameter Units.SI.CoefficientOfHeatTransfer hliq=1.5e3
+    "Heat transfer coefficient between the liquid and the cooling pipes ";
+  parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3
+    "Heat transfer coefficient between the vapor and the cooling pipes ";
+  parameter Units.SI.CoefficientOfHeatTransfer Kvl=1000
+    "Heat exchange coefficient between the liquid and gas phases";
+  parameter Units.SI.CoefficientOfHeatTransfer Klp=850
+    "Heat exchange coefficient between the liquid phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kvp=450
+    "Heat exchange coefficient between the gas phase and the wall";
+  parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.5
+    "Heat exchange coefficient between the wall and the outside ambiant";
+  parameter Units.SI.Temperature Ta=310 "External temperature";
+  parameter Units.SI.Mass Mp=100e3 "Wall mass";
+  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
+
+//***********************************
+  parameter Boolean step_square=true
+    "true: Aligned pipes   - false: staggered pipes (Step triangular)";
+
+//protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi;
+  parameter Integer Ns3=2*Ns "Number of segments for half pipes";
+  //parameter Modelica.SIunits.PathLength Ls1=L1/Ns "Section length for one pass pipe";
+  parameter Units.SI.CoefficientOfHeatTransfer h4=1
+    "h4 = 1, Heat exchange coefficient";
+  parameter Units.SI.Area S4=1 " S4 = 1, Heat exchange surface  ";
+
+public
+  Units.SI.Length L(start=15) "Cavity length";
+  Integer NbTubT "Number of total pipes in Cavity";
+  Units.SI.Pressure P "Fluid average pressure";
+  Units.SI.Pressure Pfond "Fluid pressure at the bottom of the cavity";
+  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy";
+  //Modelica.SIunits.SpecificEnthalpy hl0 "Liquid phase spepcific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy";
+  Units.SI.Temperature Tl "Liquid phase temperature";
+  Units.SI.Temperature Tv "Gas phase temperature";
+  Units.SI.Volume Vl "Liquid phase volume";
+  Units.SI.Volume Vv "Gas phase volume";
+
+  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
+  Real xv(start=0) "Mass vapor fraction in the gas phase";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Gas phase density";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phaser";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase";
+  Real QS "Surface mass flow rate of Water (kg/m2s)";
+  //Real QSm "Surface mass flow rate maximal of Water (kg/m2s)";
+
+  Units.SI.Power dW1[Ns](start=fill(10e5, Ns))
+    "Power exchange between the wall and the fluid in each section side 1";
+  Units.SI.Power dW2[Ns](start=fill(10e5, Ns))
+    "Power exchange between the wall and the fluid in each section side 2";
+  Units.SI.Power dW3[Ns3](start=fill(10e5, Ns3))
+    "Power exchange between the wall and the fluid in each section side 3";
+
+  Units.SI.Power W1t "Total power exchanged on the steam side 1";
+  Units.SI.Power W2t "Total power exchanged on the water side 2";
+  Units.SI.Power W3t "Total power exchanged on the water side 3";
+  Units.SI.Power W4t "Total power exchanged on the steam side 4";
+  Units.SI.Power Wvl
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  Units.SI.Power Wpl
+    "Thermal power exchanged from the liquid phase to the wall";
+  Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall";
+  Units.SI.Power Wpa "Thermal power losses to ambiant";
+  Units.SI.Temperature Tp1[Ns](start=fill(400, Ns))
+    "Wall temperature in section i of side 1";
+  Units.SI.Temperature Tp2[Ns](start=fill(400, Ns))
+    "Wall temperature in section i of side 2";
+  Units.SI.Temperature Tp3[Ns3](start=fill(400, Ns3))
+    "Wall temperature in section i of side 3";
+  Units.SI.Temperature Tp(start=400) "Wall temperature of cavity";
+  Units.SI.Position zl(start=1.05) "Liquid level in Cavity";
+  Units.SI.Area Al(start=5) "Cross sectional area of the liquid phase";
+  Units.SI.Angle theta "Angle";
+  Units.SI.Area Avl(start=5)
+    "Heat exchange surface between the liquid and gas phases";
+  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
+  Units.SI.Area Avp "Gas phase surface on contact with the wall";
+  Units.SI.Area Ape "Wall surface on contact with the fluid";
+  Units.SI.Area Surf_tot(start=1.e4) "Total heat exchange surface";
+  Units.SI.Area Surf_ext1(start=1.e2)
+    "Heat exchange surface for drowned section ; pipe 1";
+  Units.SI.Area Surf_ext2(start=1.e2)
+    "Heat exchange surface for section 2 ; pipe 2 ";
+  Units.SI.Area Surf_ext3(start=1.e2)
+    "Heat exchange surface for section 3 ; pipe 3";
+  //Modelica.SIunits.ReynoldsNumber Rel (start= 6.e4)  "liquid Reynolds number";
+  Units.SI.ReynoldsNumber Rel(start=6.e4) "liquid Reynolds number";
+  // Modelica.SIunits.ReynoldsNumber Rev( start= 6.e3) "Steam Reynolds number";
+  Real Prl(start=1) "liquid Prandtl number in node i";
+  Units.SI.ThermalConductivity kl(start=1) "liquid thermal conductivity";
+  Units.SI.DynamicViscosity mul(start=2.e-4) "liquid dynamic viscosity ";
+  Units.SI.DynamicViscosity mult[Ns](start=fill(2.e-4, Ns))
+    "liquid dynamic viscosity at wall temperature";
+  Units.SI.CoefficientOfHeatTransfer hcond2[Ns](start=fill(1e4, Ns))
+    "Heat transfer coefficient between the vapor and the cooling pipes zone 2";
+  Units.SI.CoefficientOfHeatTransfer hcond3[Ns3](start=fill(1e4, Ns3))
+    "Heat transfer coefficient between the vapor and the cooling pipes zone 3";
+  Units.SI.CoefficientOfHeatTransfer hliqu[Ns](start=fill(1000, Ns))
+    "Heat transfer coefficient between the liquid and the cooling pipes zone 1";
+  Units.SI.Diameter DH(start=0.02) "hydraulic diameter";
+  Real EE[Ns](start=fill(1, Ns));
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-250,70},{-210,110}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Propriétés de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{60,70},{100,110}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-250,-200},{-210,-160}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{58,-200},{98,-160}}, rotation=0)));
+  Connectors.FluidInlet Cv "Steam input"
+                                    annotation (Placement(transformation(extent=
+           {{-86,50},{-66,70}}, rotation=0)));
+  Connectors.FluidOutlet Cl "Water output"
+                                     annotation (Placement(transformation(
+          extent={{-86,-170},{-66,-150}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns3]
+                                     annotation (Placement(transformation(
+          extent={{-59,-37},{-47,-25}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"                        annotation (Placement(transformation(
+          extent={{90,-105},{110,-85}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{-250,-20},{-210,20}},
+          rotation=0)));
+  Connectors.FluidInlet Ce "Water input"
+                                    annotation (Placement(transformation(extent=
+           {{-160,50},{-140,70}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth1[Ns]
+                                     annotation (Placement(transformation(
+          extent={{-59,-103},{-47,-90}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth2[Ns]
+                                     annotation (Placement(transformation(
+          extent={{-59,35},{-47,48}}, rotation=0)));
+
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    annotation (Placement(transformation(extent={{-250,-110},{-210,-70}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provIn
+    "Propriétés de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{12,70},{52,110}}, rotation=0)));
+initial equation
+  if steady_state then
+    der(hl) = 0;
+    der(hv) = 0;
+    der(Vl) = 0;
+    der(P) = 0;
+    der(Tp) = 0;
+  else
+    hl = lsat.h;
+    hv = vsat.h;
+    Vl = Vf0*V;
+    P = P0;
+    der(Tp) = 0;
+  end if;
+
+equation
+  /* Unconnected connectors */
+  if (cardinality(Cl) == 0) then
+    Cl.Q = 0;
+    Cl.h = 1.e5;
+    Cl.a = true;
+  end if;
+
+  if (cardinality(Cv) == 0) then
+    Cv.Q = 0;
+    Cv.h = 1.e5;
+    Cv.b = true;
+  end if;
+
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.b = true;
+  end if;
+
+  /* Wall temperature and HeatFlowRate*/
+  Cth1.T = Tp1;
+  Cth1.W = dW1;
+  Cth2.T = Tp2;
+  Cth2.W = dW2;
+  Cth3.T = Tp3;
+  Cth3.W = dW3;
+
+  /* Model boundaries */
+  Cl.P = Pfond;
+  Cv.P = P;
+  Ce.P = P;
+
+  /* Cavity length */
+  V=pi*R*R*L;
+
+  /* Liquid volume */
+  if Vertical then
+     theta = 1;
+     Al = pi*R^2;
+     Vl = Al*zl;
+     Avl = Al;
+     NbTubT = NbTub1;
+  else
+     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
+     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
+     Vl = Al*L;
+     Avl = 2*R*Modelica.Math.cos(theta)*L;
+     NbTubT = NbTub1 + NbTub3;
+  end if;
+
+  /* Heat exchange surface*/
+  Surf_ext1 = pi*Dext*L1/Ns*NbTub1;
+  Surf_ext2 = pi*Dext*L2/Ns*NbTub2;
+  Surf_ext3 = pi*Dext*L3/Ns3*NbTub3;
+  Surf_tot  = Ns*Surf_ext1 + Ns*Surf_ext2 + Ns3*Surf_ext3;
+
+  /* Cavity volume */
+  V = Vl + Vv;
+
+  /* Water leval */
+  yLevel.signal = zl;
+
+  /* Liquid surface and vapor surface on contact with wall */
+  Alp = if Vertical then 2*sqrt(pi/Al)*Vl + Al else (pi - 2*theta)*R*L + 2*Al;
+  Avp = if Vertical then 2*sqrt(pi/Al)*Vv + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al);
+
+  /* Wall surface on contact with the outside */
+  Ape = Alp + Avp;
+
+  /* Pressure at the bottom of the cavity */
+  Pfond = P + prod.d*g*zl;
+
+  /* Liquid phase mass balance equation */
+  BQl = -Cl.Q + Qcond - Qevap + (1 - proe.x)*Ce.Q;
+  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+
+  /* Vapor phase mass balance equation */
+  BQv = Cv.Q + Qevap - Qcond + proe.x*Ce.Q;
+  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+
+  /* Liquid phase energy balance equation */
+  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wpl + Wvl + W1t;
+  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+
+  /* Gas phase energy balance equation */
+  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wpv + W2t + W3t;
+  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+
+  Cl.h_vol = hl;
+  Ce.h_vol = hl;
+  Cv.h_vol = hv;
+
+  /* Energy balance equation at the wall */
+  Mp*cpp*der(Tp) = Wpl + Wpv - Wpa;
+
+  /* Heat exchange between liquid and gas phases */
+  Wvl = Kvl*Avl*(Tv - Tl);
+
+  /* Heat exchange between the liquid phase and the wall */
+  Wpl = Klp*Alp*(Tl - Tp);
+
+  /* Heat exchange between the gas phase and the wall */
+  Wpv = Kvp*Avp*(Tv - Tp);
+
+  /* Thermal power losses to ambiant, for simplifid we use the wall surface on contact with the fluid (Ape)*/
+  Wpa = Kpa*Ape*(Tp - Ta);
+
+  /* Condensation and evaporation mass flow rates */
+  Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
+  Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
+
+  /* Fluid thermodynamic properties */
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Ce.h, 0);
+  //prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hl, 0);
+  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P+Pfond)/2, hl, 0);
+  provIn = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Cv.h, 0);
+  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv, 0);
+  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond, Cl.h, 0);
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+  rhov = prov.d;
+  xv = prov.x;
+
+  mul = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol, Tl);
+  kl = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol, Tl,P, 0));
+
+  /* Heat transfer coefficient of fluid
+                   And
+     Power exchanged for each section
+    ----------------------------------*/
+  /* Heat transfer coefficient of liquid*/
+  //SACADOURA
+  DH= if step_square then 4*PasL^2/(pi*Dext) - Dext else ( (2*PasL*PasT) - (pi*Dext^2*(Angle/120)))/(pi*Dext*(Angle/120));
+
+  QS = Cl.Q /(DIc*Lc*(PasL - Dext)/PasL);
+
+  Rel = noEvent( abs(QS*DH/mul));
+  Prl = mul*prol.cp/kl;
+
+  assert( (PasL - Dext) > 0,  "Error Data for TwoPhaseCavity model (PasL - Dext)<=0 ");
+
+  for i in 1:Ns loop
+
+    mult[i] = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol, Tp1[i]);
+
+    EE[i]= max( (PasT/Dext-1/2/((((PasL/Dext)^2 + (PasT/Dext/2)^2)^0.5/Dext)-1)),1);
+
+    /* Heat transfer coefficient of liquid*/
+    if Cal_hconv then
+       // Kern corelation (SACADOURA)
+       hliqu[i] = noEvent(if ((Rel > 1.e-6) and (Prl > 1.e-6)) then (COPl * 0.36*kl/Dext *Rel^0.55 *Prl^0.3333 *(mul/mult[i])^0.14) else  10);
+    else
+       hliqu[i] = COPl * hliq;
+    end if;
+
+    if Cal_hconv then
+       /* Heat transfer coefficient of vapeur*/
+       if Vertical then
+         // Frank P. & David P. Fundamentals of Heat Transfer  For (PasL/Dext)= 1.4
+         hcond2[i]  = COPv * noEvent( min( 1.13*( max( (g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h -lsat.h))/(max(L2,1)*mul*abs(lsat.T-Tp2[i]+1e-6)),2.225e15))^0.25, 20000));
+       else
+         // Nusselt corelation
+         //******************
+         hcond2[i]  =  COPv * noEvent( min( 0.728*( max( (g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*abs(lsat.T-Tp2[i]+1e-6)),2.225e15))^0.25, 20000));
+       end if;
+    else
+       hcond2[i] = COPv * hcond;
+    end if;
+
+    /* Power exchanged for each section zone 1*/
+    if (noEvent( abs(dW1[i]) < 0.1)) then
+       dW1[i] = - h4*S4*(Tv - Tp1[i]);
+    else
+       dW1[i] = - hliqu[i]*Surf_ext1 *((Tv+Tl)/2 - (Tp1[1]+Tp1[Ns])/2);
+    end if;
+
+    /* Power exchanged for each section zone 2*/
+    if (noEvent( abs(dW2[i]) < 0.1)) then
+       dW2[i] = - h4*S4*(Tv - Tp2[i]);
+    else
+       dW2[i] = - hcond2[i]*Surf_ext2*(Tv - Tp2[i]);
+    end if;
+
+  end for;
+
+  for i in 1:Ns3 loop
+    if Cal_hconv then
+       /* Heat transfer coefficient of vapeur*/
+       if Vertical then
+          // Frank P. & David P. Fundamentals of Heat Transfer  For vertical plate
+          hcond3[i]  = COPv * noEvent( min( 1.13*( max( (g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h -lsat.h))/(max(L3,1)*mul*abs(lsat.T-Tp3[i]+1e-6)), 2.225e15))^0.25, 20000));
+       else
+          // Nusselt corelation
+          //******************
+          hcond3[i]  =  COPv * noEvent( min( 0.728*( max( (g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*abs(lsat.T-Tp3[i]+1e-6)), 2.225e15))^0.25, 20000));
+       end if;
+    else
+       hcond3[i] = COPv * hcond;
+    end if;
+
+    /* Power exchanged for each section  zone 3 + power exchanged for Deheating*/
+    if (noEvent( abs(dW3[i]) < 0.1)) then
+       dW3[i] = - h4*S4*(Tv - Tp3[i]);
+    else
+       dW3[i] = - hcond3[i]*Surf_ext3*(Tv - Tp3[i]) + W4t/Ns3;
+    end if;
+
+  end for;
+
+  W1t = sum(dW1);
+  W2t = sum(dW2);
+  W3t = sum(dW3);
+
+  /* Total power exchanged for Deheating*/
+  W4t = noEvent( if ( Cv.h > vsat.h) then - Cv.Q*(Cv.h - vsat.h) else -0.0001);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-200},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-142,2},{-124,-6}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{-164,55},{-88,19}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Horizontal_1pipe"),
+        Rectangle(
+          extent={{-158,-6},{-102,-10}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-184,16},{-166,16}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Text(
+          extent={{-198,-6},{-160,-24}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{-180,-8},{-162,-8}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-102,-8},{-96,-8},{-96,16},{-160,16},{-170,16}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{-162,28},{-90,-44}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Text(
+          extent={{-182,-56},{-86,-78}},
+          lineColor={0,0,255},
+          textString=
+               "Vertical Separate"),
+        Rectangle(
+          extent={{-170,-100},{-166,-152}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-114,-76},{-114,-94}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{-116,-100},{-112,-152}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-168,-76},{-168,-94}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Rectangle(
+          extent={{-166,-176},{-120,-180}},
+          lineColor={0,0,255},
+          fillColor={85,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-190,-128},{-172,-136}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 2"),
+        Text(
+          extent={{-152,-180},{-134,-188}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 1"),
+        Text(
+          extent={{-111,-122},{-93,-130}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{-210,-164},{-172,-182}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{-168,-150},{-168,-160},{-114,-160},{-114,-150}},
+          color={0,0,255},
+          pattern=LinePattern.Dash,
+          arrow={Arrow.Filled,Arrow.None}),
+        Line(
+          points={{-183,-168},{-105,-168}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{-182,-96},{-106,-192}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-114,-78},{-114,-72},{-92,-72},{-92,-178},{-120,-178}},
+          color={0,0,255},
+          pattern=LinePattern.Dash,
+          arrow={Arrow.Filled,Arrow.None}),
+        Line(
+          points={{-188,-178},{-170,-178}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Text(
+          extent={{12,-54},{54,-70}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Vertical"),
+        Rectangle(
+          extent={{4,-82},{8,-134}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{6,-58},{6,-76}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{58,-82},{62,-134}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{60,-60},{60,-78}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Rectangle(
+          extent={{10,-142},{56,-146}},
+          lineColor={0,0,255},
+          fillColor={85,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-16,-104},{2,-112}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 2"),
+        Text(
+          extent={{16,-162},{42,-154}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 1"),
+        Text(
+          extent={{65,-112},{83,-120}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{-20,-50},{18,-68}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{6,-134},{6,-144},{60,-144},{60,-134}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-7,-138},{71,-138}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{-8,-78},{70,-152}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{2,-20},{58,-24}},
+          lineColor={0,0,255},
+          fillColor={85,255,255},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{32,34},{50,26}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 2"),
+        Text(
+          extent={{16,-26},{34,-34}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 1"),
+        Text(
+          extent={{18,10},{36,2}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{4,60},{56,34}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Horizontal"),
+        Rectangle(
+          extent={{2,2},{58,-2}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{2,26},{58,22}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-24,24},{-6,24}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Line(
+          points={{-36,-22},{-4,-22}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Text(
+          extent={{-58,-10},{-20,-28}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{60,-22},{72,-22},{72,24},{60,24},{58,24}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-20,0},{-2,0}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-20,-22},{-20,-3},{-20,-1}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{58,0},{64,0},{64,12},{-10,12},{-10,24}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{-2,36},{76,-38}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-2,-16},{76,-16}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{-160,18},{-142,14}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{2,26},{20,22}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-170,-100},{-166,-116}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{58,-82},{62,-98}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-234,64},{-164,36}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe4=deheating pipes"),
+        Text(
+          extent={{-158,26},{-140,18}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 4"),
+        Text(
+          extent={{0,34},{18,26}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 4"),
+        Text(
+          extent={{64,-86},{82,-94}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 4"),
+        Text(
+          extent={{-190,-104},{-172,-112}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 4"),
+        Text(
+          extent={{-132,-36},{38,-50}},
+          lineColor={0,0,255},
+          textString=
+               "Connected here for one pipe only")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-200},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Ellipse(
+          extent={{-100,50},{100,-150}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-250,50},{-50,-150}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-160,50},{8,-150}},
+          lineColor={255,255,0},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-250,-48},{-160,-48}}, color={255,255,0}),
+        Line(
+          points={{-160,-48},{100,-48}},
+          color={255,255,0},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,50},{-160,-150}},
+          color={255,255,0},
+          thickness=0.5),
+        Line(
+          points={{-160,-98},{88,-98}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-112},{78,-112}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-126},{66,-126}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-106},{82,-106}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-118},{72,-118}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-132},{56,-132}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-150},{8,-150}},
+          color={0,0,255},
+          thickness=0.5),
+        Text(
+          extent={{-136,-12},{34,-26}},
+          lineColor={0,0,255},
+          textString=
+               "Connected here for one pipe only")}),
+    Window(
+      x=0.11,
+      y=0.06,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.4 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end TwoPhaseCavity;
diff --git a/ThermoSysPro/WaterSteam/Volumes/TwoPhaseCavityOnePipe.mo b/ThermoSysPro/WaterSteam/Volumes/TwoPhaseCavityOnePipe.mo
index 1009a08f7a4b7c0114f255070a3ce2638f0e52c7..67d68fe37ad556c96eee31dffd33c1ea7d0d20e0 100644
--- a/ThermoSysPro/WaterSteam/Volumes/TwoPhaseCavityOnePipe.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/TwoPhaseCavityOnePipe.mo
@@ -1,502 +1,502 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass "
-
-  parameter Boolean Vertical=true
-    "true: vertical cylinder - false: horizontal cylinder";
-  parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area";
-  parameter Units.SI.Length L=16.27 "Cavity length";
-  parameter Units.SI.Length Lc=2.5
-    "support plate spacing in cooling zone(Chicanes)";
-  parameter Units.SI.Volume V=pi*R^2*L "Cavity volume";
-  parameter Units.SI.Volume Vmin=1.e-6;
-  parameter Real Vf0=0.5
-    "Fraction of initial water volume in the Cavity (active if steady_state=false)";
-  parameter Integer Ns=10 "Number of segments";
-  parameter Integer NbTubT=10000 "Number of total pipes in Cavity";
-  parameter Integer NbTubV=150 "Numbers of pipes in a vertical plan in Cavity";
-  parameter Units.SI.Length L2=25 "tubes length";
-  parameter Units.SI.Diameter Dext=0.020 "External pipe diameter";
-  parameter Units.SI.Pressure P0=1e5
-    "Fluid initial pressure (active if steady_state=false)";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, Vl0)";
-  parameter Real COP = 1
-    "Corrective terme for heat exchange coefficient or Fouling coefficient";
-  parameter Real Kcorr = 1
-    "Corrective terme for heat exchange coefficient between the vapor and the liquid Kvl (with a stagnation point Kcorr = 0.5)";
-  parameter Boolean Cal_hcond=false
-    "false : Condensation heat transfer coefficient = hcond (parameter) - true: calculate by Nusselt corelation";
-  parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3
-    "Heat transfer coefficient between the vapor and the cooling pipes ";
-  parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.02
-    "Heat exchange coefficient between the wall and the outside ambiant";
-  parameter Units.SI.Temperature Ta=300 "External temperature";
-  parameter Units.SI.Mass Mp=50e3 "Wall mass";
-  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
-  parameter Boolean step_square=true
-    "true: Step square  - false: Step triangular";
-  parameter Units.SI.PathLength Ls=L2/Ns "Section length for pipe";
-  parameter Units.SI.Area Surf_exe=pi*Dext*Ls*NbTubT
-    "Section heat exchange surface";
-  parameter Units.SI.Area Surf_tot=Surf_exe*Ns "Total heat exchange surface";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-  constant Real pi=Modelica.Constants.pi;
-
-public
-  Units.SI.Pressure P(start=10000) "Fluid average pressure";
-  Units.SI.Pressure Pfond(start=11000)
-    "Fluid pressure at the bottom of the cavity";
-  Units.SI.SpecificEnthalpy hl(start=200e3) "Liquid phase spepcific enthalpy";
-  Units.SI.SpecificEnthalpy hv(start=250e3) "Gas phase spepcific enthalpy";
-  Units.SI.SpecificEnthalpy hvIn(start=2400000)
-    "Steam average spepcific enthalpy input cavity";
-  Units.SI.Temperature Tl(start=310) "Liquid phase temperature";
-  Units.SI.Temperature Tv(start=320) "Gas phase temperature";
-  Units.SI.Volume Vl(start=100) "Liquid phase volume";
-  Units.SI.Volume Vv(start=2000) "Gas phase volume";
-  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
-  Real xv(start=0) "Mass vapor fraction in the gas phase";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Gas phase density";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phaser";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond(start=1000)
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate QcondS(start=100)
-    " Splitter mass flow rate of the liquid phase from the input two phases";
-  Units.SI.Power Wvl
-    "Thermal power exchanged from the gas phase to the liquid phase";
-  Units.SI.Power Wlp
-    "Thermal power exchanged from the liquid phase to the wall";
-  Units.SI.Power Wvp "Thermal power exchanged from the gas phase to the wall";
-  Units.SI.Power Wpa "Thermal power losses to ambiant";
-  Units.SI.Power dW[Ns](start=fill(10e5, Ns))
-    "Power exchange between the wall and the fluid in each section side 3";
-  Units.SI.Power Wt "Total power exchanged on the water side 3";
-  Units.SI.Power Wt2(start=0) "Total power exchanged Deheating zone";
-  Units.SI.Temperature Tp1[Ns](start=fill(320, Ns))
-    "Wall temperature in section i of side 1";
-  Units.SI.Temperature Tp(start=320) "Wall temperature of cavity";
-  Units.SI.Position zl(start=1.05) "Liquid level in Cavity";
-  Units.SI.Area Al "Cross sectional area of the liquid phase";
-  Units.SI.Angle theta "Angle";
-  Units.SI.Area Avl(start=1.0)
-    "Heat exchange surface between the liquid and gas phases";
-  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
-  Units.SI.Area Avp "Gas phase surface on contact with the wall";
-  Units.SI.Area Ape "Wall surface on contact with the outside";
-  Units.SI.ReynoldsNumber Rel(start=6.e4) "liquid Reynolds number";
-  Units.SI.ReynoldsNumber Rev(start=6.e3) "Steam Reynolds number";
-  Units.SI.ReynoldsNumber Revl(start=6.e3) "Steam liquid Reynolds number";
-  Units.SI.ThermalConductivity kl(start=1) "liquid thermal conductivity";
-  Units.SI.ThermalConductivity kv(start=1) "steam thermal conductivity";
-  Units.SI.DynamicViscosity mul(start=2.e-4) "liquid dynamic viscosity ";
-  Units.SI.DynamicViscosity muv(start=2.e-5) "steam dynamic viscosity ";
-  Units.SI.CoefficientOfHeatTransfer hcond3[Ns](start=fill(1e4, Ns))
-    "Heat transfer coefficient between the vapor and the cooling pipes 2";
-  Units.SI.CoefficientOfHeatTransfer Kvl(start=10)
-    "Heat exchange coefficient between the liquid and gas phases";
-  Units.SI.CoefficientOfHeatTransfer Klp(start=10)
-    "Heat exchange coefficient between the liquid phase and the wall";
-  Units.SI.CoefficientOfHeatTransfer Kvp(start=10)
-    "Heat exchange coefficient between the gas phase and the wall";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-250,70},{-210,110}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Propriétés de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{60,70},{100,110}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-250,-200},{-210,-160}},
-          rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{58,-200},{98,-160}}, rotation=0)));
-  Connectors.FluidInlet CvBP "Steam input"
-                                    annotation (Placement(transformation(extent=
-           {{-86,50},{-66,70}}, rotation=0)));
-  Connectors.FluidOutlet Cl "Water output"
-                                     annotation (Placement(transformation(
-          extent={{-85,-170},{-65,-150}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns]
-                                     annotation (Placement(transformation(
-          extent={{-82,0},{-70,12}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"                        annotation (Placement(transformation(
-          extent={{88,-107},{108,-87}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{-250,-16},{-210,24}},
-          rotation=0)));
-  Connectors.FluidInlet Ce "Water input"
-                                    annotation (Placement(transformation(extent=
-           {{-219,19},{-199,39}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
-    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-250,-106},{-210,-66}}, rotation=0)));
-  Properties.WaterSteam.Common.ThermoProperties_ph provIn
-    "Propriétés de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{0,70},{40,110}}, rotation=0)));
-  Connectors.FluidInlet CvGCT "Steam input"
-                                    annotation (Placement(transformation(extent=
-           {{-160,50},{-140,70}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(hl) = 0;
-    der(hv) = 0;
-    Vl = Vf0*V;    // Without liquid level control
-    //der(Vl) = 0; // With liquid level control
-    der(P) = 0;
-    der(Tp) = 0;
-  else
-    hl = lsat.h;
-    hv = vsat.h;
-    Vl = Vf0*V;
-    P = P0;
-    Tp = 320;
-  end if;
-
-equation
-  /* Unconnected connectors */
-  if (cardinality(Cl) == 0) then
-    Cl.Q = 0;
-    Cl.h = 1.e5;
-    Cl.a = true;
-  end if;
-
-  if (cardinality(CvBP) == 0) then
-    CvBP.Q = 0;
-    CvBP.h = 1.e5;
-    CvBP.b = true;
-  end if;
-
-  if (cardinality(CvGCT) == 0) then
-    CvGCT.Q = 0;
-    CvGCT.h = 1.e5;
-    CvGCT.b = true;
-  end if;
-
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.b = true;
-  end if;
-
-  /* Wall temperature and HeatFlowRate*/
-  Cth3.T = Tp1;
-  Cth3.W = dW;
-
-  /* Model boundaries */
-  Cl.P = Pfond;
-  CvBP.P = P;
-  CvGCT.P = P;
-  Ce.P = P;
-
-  /* Liquid volume */
-  if Vertical then
-     theta = 1;
-     Al = pi*R^2;
-     Vl = Al*zl;
-     Avl = Al;
-  else
-     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
-     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
-     Vl = Al*L;
-     Avl = 2*R*Modelica.Math.cos(theta)*L;
-  end if;
-
-  /* Cavity volume */
-  V = Vl + Vv;
-
-  /* Water leval */
-  yLevel.signal = zl;
-
-  /* Liquid surface and vapor surface on contact with wall */
-  Alp = if Vertical then 2*pi*R*zl + Al else (pi - 2*theta)*R*L + 2*Al;
-  Avp = if Vertical then 2*pi*R*(L-zl) + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al);
-
-  /* Wall surface on contact with the outside */
-  Ape = Alp + Avp;
-
-  /* Pressure at the bottom of the cavity */
-  Pfond = P + prod.d*g*zl;
-
-  /* Liquid phase mass balance equation */
-  BQl = -Cl.Q + Qcond + QcondS + (1 - proe.x)*Ce.Q;
-  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-
-  /* Vapor phase mass balance equation */
-  BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + proe.x*Ce.Q;
-
-  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-
-  /* Liquid phase energy balance equation */
-  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + (Qcond+QcondS)*(lsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wlp + Wvl;
-
-  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-
-  Cl.h_vol = hl;
-  Ce.h_vol = hl;
-
-  /* Gas phase energy balance equation */
-  BHv = CvBP.Q*(CvBP.h - (hv - P/rhov)) + CvGCT.Q*(CvGCT.h - (hv - P/rhov)) - (Qcond+QcondS)*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wvp + Wt;
-
-  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-
-  CvBP.h_vol  = hv;
-  CvGCT.h_vol = hv;
-
-  /* Condensation mass flow rates */
-  /* Only the power used for steam condensation is considered */
-  Qcond = (-Wt + Wt2 + noEvent(max(Wvl,0)) + Wvp)/(vsat.h - lsat.h);
-
-  QcondS = (1-provIn.x)*(CvBP.Q + CvGCT.Q);
-
-  /* Steam average spepcific enthalpy input cavity */
-  0 = noEvent( hvIn*(max(CvBP.Q, 1e-10) + max(CvGCT.Q,1e-10)) - max(CvBP.Q,1e-10)*CvBP.h - max(CvGCT.Q,1e-10)*CvGCT.h);
-
-  /* Fluid thermodynamic properties*/
-  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Ce.h, 0);
-  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P + Pfond)/2, hl, 0);
-  provIn = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hvIn, 0);
-  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv, 0);
-  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond, Cl.h, 0);
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-
-  rhov = prov.d;
-  xv = prov.x;
-
-  muv = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(provIn.d, provIn.T);
-  mul = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol, Tl);
-  kl = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol, Tl, P, 0));
-  kv = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(provIn.d, provIn.T, P, 0));
-
-  /* Heat transfer coefficient between liquid and wall*/
-  /* SACADURA, Von Karman equation*/
-  Rel = noEvent( abs(Cl.Q*zl/(pi*R^2*mul)));
-  Klp = 0.037*kl*Rel^0.8*(mul*prol.cp/kl)^0.3333/zl;
-
-  /* Heat transfer coefficient between steam and wall*/
-  Rev = noEvent( abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(L-zl)/(pi*R^2*muv)));
-
-  Revl = noEvent( abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(2*R)/(pi*R^2*muv)));
-
-  Kvp = 0.037*kv*Rev^0.8*(muv*prov.cp/kv)^0.3333/(L-zl);
-
-  /* Heat transfer coefficient between steam and liquid */
-  Kvl = 0.105*kv*Revl^0.68*(muv*prov.cp/kv)^0.33333 *(L/2/R)^(-0.103)/(2*R);
-
-  /* Thermal power losses*/
-  /* Energy balance equation at the wall */
-  Mp*cpp*der(Tp) = Wlp + Wvp - Wpa;
-
-  /* Heat exchange between liquid and gas phases */
-  Wvl = Kcorr*Kvl*Avl*(Tv - Tl);
-
-  /* Heat exchange between the liquid phase and the wall */
-  Wlp = Klp*Alp*(Tl - Tp);
-
-  /* Heat exchange between the gas phase and the wall */
-  Wvp = Kvp*Avp*(Tv - Tp);
-
-  /* Thermal power losses to ambiant, for simplifid we use the wall surface on contact with the fluid (Ape)*/
-  Wpa = Kpa*Ape*(Tp - Ta);
-
-  for i in 1:Ns loop
-    /* Heat transfer coefficient of liquid*/
-    if Cal_hcond then
-       // Nusselt corelation
-       hcond3[i] = ThermoSysPro.Functions.SmoothCond((Tv-Tp1[i]), COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*ThermoSysPro.Functions.SmoothMax((Tv-Tp1[i]),0.1)))^0.25,
-                                                    COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*0.1))^0.25);
-    else
-       hcond3[i] = hcond;
-    end if;
-
-    /* Power exchanged for each section */
-    dW[i] = - hcond3[i]*(Tv - Tp1[i])*Surf_exe + Wt2/Ns;
-
-  end for;
-
-  Wt = sum(dW);
-
-  /* Total power exchanged for Deheating*/
-  /* This equation is not valid for mass flow rate in the pipes = 0*/
-  Wt2 = noEvent( if ( hvIn > vsat.h) then - (CvBP.Q + CvGCT.Q)*(hvIn - vsat.h) else 0);
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-200},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Text(
-          extent={{-96,-68},{-78,-76}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Pipe 3"),
-        Text(
-          extent={{-118,-15},{-42,-51}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Horizontal_1pipe"),
-        Rectangle(
-          extent={{-112,-76},{-56,-80}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-138,-54},{-120,-54}},
-          color={0,0,255},
-          arrow={Arrow.Filled,Arrow.None}),
-        Text(
-          extent={{-152,-76},{-114,-94}},
-          lineColor={0,0,255},
-          fillColor={95,95,95},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "in"),
-        Line(
-          points={{-134,-78},{-116,-78}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Line(
-          points={{-56,-78},{-50,-78},{-50,-54},{-114,-54},{-124,-54}},
-          color={0,0,255},
-          arrow={Arrow.None,Arrow.Filled}),
-        Rectangle(
-          extent={{-116,-42},{-44,-114}},
-          lineColor={0,0,255},
-          pattern=LinePattern.Dash),
-        Rectangle(
-          extent={{-114,-52},{-96,-56}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid),
-        Text(
-          extent={{-126,42},{-32,12}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Condensation pipes"),
-        Text(
-          extent={{-114,30},{-48,6}},
-          lineColor={0,0,0},
-          fillColor={255,0,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               " +  Deheating pipes")}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-250,-200},{100,100}},
-        grid={2,2},
-        initialScale=0.1), graphics={
-        Ellipse(
-          extent={{-100,50},{100,-150}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-250,50},{-50,-150}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-160,50},{8,-150}},
-          lineColor={255,255,0},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid),
-        Line(
-          points={{-238,-98},{88,-98}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-228,-112},{78,-112}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-214,-126},{66,-126}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-196,-138},{48,-138}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-232,-106},{82,-106}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-222,-118},{72,-118}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-206,-132},{56,-132}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-182,-144},{32,-144}},
-          color={0,0,255},
-          pattern=LinePattern.Dash),
-        Line(
-          points={{-160,-150},{8,-150}},
-          color={0,0,255},
-          thickness=0.5),
-        Line(points={{-160,50},{10,50}}, color={0,0,255}),
-        Text(
-          extent={{-90,84},{-58,70}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Steam BP"),
-        Text(
-          extent={{-164,84},{-132,70}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "Steam HP"),
-        Text(
-          extent={{-248,52},{-206,40}},
-          lineColor={0,0,255},
-          fillColor={255,255,0},
-          fillPattern=FillPattern.Solid,
-          textString=
-               "WaterSteam")}),
-    Window(
-      x=0.11,
-      y=0.06,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
-<p><b>ThermoSysPro Version 3.2</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Baligh El Hefni</li>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end TwoPhaseCavityOnePipe;
+within ThermoSysPro.WaterSteam.Volumes;
+model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass "
+
+  parameter Boolean Vertical=true
+    "true: vertical cylinder - false: horizontal cylinder";
+  parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area";
+  parameter Units.SI.Length L=16.27 "Cavity length";
+  parameter Units.SI.Length Lc=2.5
+    "support plate spacing in cooling zone(Chicanes)";
+  parameter Units.SI.Volume V=pi*R^2*L "Cavity volume";
+  parameter Units.SI.Volume Vmin=1.e-6;
+  parameter Real Vf0=0.5
+    "Fraction of initial water volume in the Cavity (active if steady_state=false)";
+  parameter Integer Ns=10 "Number of segments";
+  parameter Integer NbTubT=10000 "Number of total pipes in Cavity";
+  parameter Integer NbTubV=150 "Numbers of pipes in a vertical plan in Cavity";
+  parameter Units.SI.Length L2=25 "tubes length";
+  parameter Units.SI.Diameter Dext=0.020 "External pipe diameter";
+  parameter Units.SI.Pressure P0=1e5
+    "Fluid initial pressure (active if steady_state=false)";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, Vl0)";
+  parameter Real COP = 1
+    "Corrective terme for heat exchange coefficient or Fouling coefficient";
+  parameter Real Kcorr = 1
+    "Corrective terme for heat exchange coefficient between the vapor and the liquid Kvl (with a stagnation point Kcorr = 0.5)";
+  parameter Boolean Cal_hcond=false
+    "false : Condensation heat transfer coefficient = hcond (parameter) - true: calculate by Nusselt corelation";
+  parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3
+    "Heat transfer coefficient between the vapor and the cooling pipes ";
+  parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.02
+    "Heat exchange coefficient between the wall and the outside ambiant";
+  parameter Units.SI.Temperature Ta=300 "External temperature";
+  parameter Units.SI.Mass Mp=50e3 "Wall mass";
+  parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat";
+  parameter Boolean step_square=true
+    "true: Step square  - false: Step triangular";
+  parameter Units.SI.PathLength Ls=L2/Ns "Section length for pipe";
+  parameter Units.SI.Area Surf_exe=pi*Dext*Ls*NbTubT
+    "Section heat exchange surface";
+  parameter Units.SI.Area Surf_tot=Surf_exe*Ns "Total heat exchange surface";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+  constant Real pi=Modelica.Constants.pi;
+
+public
+  Units.SI.Pressure P(start=10000) "Fluid average pressure";
+  Units.SI.Pressure Pfond(start=11000)
+    "Fluid pressure at the bottom of the cavity";
+  Units.SI.SpecificEnthalpy hl(start=200e3) "Liquid phase spepcific enthalpy";
+  Units.SI.SpecificEnthalpy hv(start=250e3) "Gas phase spepcific enthalpy";
+  Units.SI.SpecificEnthalpy hvIn(start=2400000)
+    "Steam average spepcific enthalpy input cavity";
+  Units.SI.Temperature Tl(start=310) "Liquid phase temperature";
+  Units.SI.Temperature Tv(start=320) "Gas phase temperature";
+  Units.SI.Volume Vl(start=100) "Liquid phase volume";
+  Units.SI.Volume Vv(start=2000) "Gas phase volume";
+  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
+  Real xv(start=0) "Mass vapor fraction in the gas phase";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Gas phase density";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phaser";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond(start=1000)
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate QcondS(start=100)
+    " Splitter mass flow rate of the liquid phase from the input two phases";
+  Units.SI.Power Wvl
+    "Thermal power exchanged from the gas phase to the liquid phase";
+  Units.SI.Power Wlp
+    "Thermal power exchanged from the liquid phase to the wall";
+  Units.SI.Power Wvp "Thermal power exchanged from the gas phase to the wall";
+  Units.SI.Power Wpa "Thermal power losses to ambiant";
+  Units.SI.Power dW[Ns](start=fill(10e5, Ns))
+    "Power exchange between the wall and the fluid in each section side 3";
+  Units.SI.Power Wt "Total power exchanged on the water side 3";
+  Units.SI.Power Wt2(start=0) "Total power exchanged Deheating zone";
+  Units.SI.Temperature Tp1[Ns](start=fill(320, Ns))
+    "Wall temperature in section i of side 1";
+  Units.SI.Temperature Tp(start=320) "Wall temperature of cavity";
+  Units.SI.Position zl(start=1.05) "Liquid level in Cavity";
+  Units.SI.Area Al "Cross sectional area of the liquid phase";
+  Units.SI.Angle theta "Angle";
+  Units.SI.Area Avl(start=1.0)
+    "Heat exchange surface between the liquid and gas phases";
+  Units.SI.Area Alp "Liquid phase surface on contact with the wall";
+  Units.SI.Area Avp "Gas phase surface on contact with the wall";
+  Units.SI.Area Ape "Wall surface on contact with the outside";
+  Units.SI.ReynoldsNumber Rel(start=6.e4) "liquid Reynolds number";
+  Units.SI.ReynoldsNumber Rev(start=6.e3) "Steam Reynolds number";
+  Units.SI.ReynoldsNumber Revl(start=6.e3) "Steam liquid Reynolds number";
+  Units.SI.ThermalConductivity kl(start=1) "liquid thermal conductivity";
+  Units.SI.ThermalConductivity kv(start=1) "steam thermal conductivity";
+  Units.SI.DynamicViscosity mul(start=2.e-4) "liquid dynamic viscosity ";
+  Units.SI.DynamicViscosity muv(start=2.e-5) "steam dynamic viscosity ";
+  Units.SI.CoefficientOfHeatTransfer hcond3[Ns](start=fill(1e4, Ns))
+    "Heat transfer coefficient between the vapor and the cooling pipes 2";
+  Units.SI.CoefficientOfHeatTransfer Kvl(start=10)
+    "Heat exchange coefficient between the liquid and gas phases";
+  Units.SI.CoefficientOfHeatTransfer Klp(start=10)
+    "Heat exchange coefficient between the liquid phase and the wall";
+  Units.SI.CoefficientOfHeatTransfer Kvp(start=10)
+    "Heat exchange coefficient between the gas phase and the wall";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-250,70},{-210,110}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Propriétés de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{60,70},{100,110}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-250,-200},{-210,-160}},
+          rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{58,-200},{98,-160}}, rotation=0)));
+  Connectors.FluidInlet CvBP "Steam input"
+                                    annotation (Placement(transformation(extent=
+           {{-86,50},{-66,70}}, rotation=0)));
+  Connectors.FluidOutlet Cl "Water output"
+                                     annotation (Placement(transformation(
+          extent={{-85,-170},{-65,-150}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns]
+                                     annotation (Placement(transformation(
+          extent={{-82,0},{-70,12}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"                        annotation (Placement(transformation(
+          extent={{88,-107},{108,-87}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{-250,-16},{-210,24}},
+          rotation=0)));
+  Connectors.FluidInlet Ce "Water input"
+                                    annotation (Placement(transformation(extent=
+           {{-219,19},{-199,39}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe
+    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-250,-106},{-210,-66}}, rotation=0)));
+  Properties.WaterSteam.Common.ThermoProperties_ph provIn
+    "Propriétés de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{0,70},{40,110}}, rotation=0)));
+  Connectors.FluidInlet CvGCT "Steam input"
+                                    annotation (Placement(transformation(extent=
+           {{-160,50},{-140,70}}, rotation=0)));
+initial equation
+  if steady_state then
+    der(hl) = 0;
+    der(hv) = 0;
+    //Vl = Vf0*V;    // Without liquid level control
+    der(Vl) = 0; // With liquid level control
+    der(P) = 0;
+    der(Tp) = 0;
+  else
+    hl = lsat.h;
+    hv = vsat.h;
+    Vl = Vf0*V;
+    P = P0;
+    Tp = 320;
+  end if;
+
+equation
+  /* Unconnected connectors */
+  if (cardinality(Cl) == 0) then
+    Cl.Q = 0;
+    Cl.h = 1.e5;
+    Cl.a = true;
+  end if;
+
+  if (cardinality(CvBP) == 0) then
+    CvBP.Q = 0;
+    CvBP.h = 1.e5;
+    CvBP.b = true;
+  end if;
+
+  if (cardinality(CvGCT) == 0) then
+    CvGCT.Q = 0;
+    CvGCT.h = 1.e5;
+    CvGCT.b = true;
+  end if;
+
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.b = true;
+  end if;
+
+  /* Wall temperature and HeatFlowRate*/
+  Cth3.T = Tp1;
+  Cth3.W = dW;
+
+  /* Model boundaries */
+  Cl.P = Pfond;
+  CvBP.P = P;
+  CvGCT.P = P;
+  Ce.P = P;
+
+  /* Liquid volume */
+  if Vertical then
+     theta = 1;
+     Al = pi*R^2;
+     Vl = Al*zl;
+     Avl = Al;
+  else
+     theta = Modelica.Math.asin(max(-0.9999,min(0.9999,(R - zl)/R)));
+     Al = (pi/2 - theta)*R^2 - R*(R - zl)*Modelica.Math.cos(theta);
+     Vl = Al*L;
+     Avl = 2*R*Modelica.Math.cos(theta)*L;
+  end if;
+
+  /* Cavity volume */
+  V = Vl + Vv;
+
+  /* Water leval */
+  yLevel.signal = zl;
+
+  /* Liquid surface and vapor surface on contact with wall */
+  Alp = if Vertical then 2*pi*R*zl + Al else (pi - 2*theta)*R*L + 2*Al;
+  Avp = if Vertical then 2*pi*R*(L-zl) + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al);
+
+  /* Wall surface on contact with the outside */
+  Ape = Alp + Avp;
+
+  /* Pressure at the bottom of the cavity */
+  Pfond = P + prod.d*g*zl;
+
+  /* Liquid phase mass balance equation */
+  BQl = -Cl.Q + Qcond + QcondS + (1 - proe.x)*Ce.Q;
+  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+
+  /* Vapor phase mass balance equation */
+  BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + proe.x*Ce.Q;
+
+  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+
+  /* Liquid phase energy balance equation */
+  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + (Qcond+QcondS)*(lsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wlp + Wvl;
+
+  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+
+  Cl.h_vol = hl;
+  Ce.h_vol = hl;
+
+  /* Gas phase energy balance equation */
+  BHv = CvBP.Q*(CvBP.h - (hv - P/rhov)) + CvGCT.Q*(CvGCT.h - (hv - P/rhov)) - (Qcond+QcondS)*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wvp + Wt;
+
+  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+
+  CvBP.h_vol  = hv;
+  CvGCT.h_vol = hv;
+
+  /* Condensation mass flow rates */
+  /* Only the power used for steam condensation is considered */
+  Qcond = (-Wt + Wt2 + noEvent(max(Wvl,0)) + Wvp)/(vsat.h - lsat.h);
+
+  QcondS = (1-provIn.x)*(CvBP.Q + CvGCT.Q);
+
+  /* Steam average spepcific enthalpy input cavity */
+  0 = noEvent( hvIn*(max(CvBP.Q, 1e-10) + max(CvGCT.Q,1e-10)) - max(CvBP.Q,1e-10)*CvBP.h - max(CvGCT.Q,1e-10)*CvGCT.h);
+
+  /* Fluid thermodynamic properties*/
+  proe = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, Ce.h, 0);
+  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P + Pfond)/2, hl, 0);
+  provIn = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hvIn, 0);
+  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv, 0);
+  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond, Cl.h, 0);
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+
+  rhov = prov.d;
+  xv = prov.x;
+
+  muv = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(provIn.d, provIn.T);
+  mul = ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rhol, Tl);
+  kl = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rhol, Tl, P, 0));
+  kv = noEvent(ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(provIn.d, provIn.T, P, 0));
+
+  /* Heat transfer coefficient between liquid and wall*/
+  /* SACADURA, Von Karman equation*/
+  Rel = noEvent( abs(Cl.Q*zl/(pi*R^2*mul)));
+  Klp = 0.037*kl*Rel^0.8*(mul*prol.cp/kl)^0.3333/zl;
+
+  /* Heat transfer coefficient between steam and wall*/
+  Rev = noEvent( abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(L-zl)/(pi*R^2*muv)));
+
+  Revl = noEvent( abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(2*R)/(pi*R^2*muv)));
+
+  Kvp = 0.037*kv*Rev^0.8*(muv*prov.cp/kv)^0.3333/(L-zl);
+
+  /* Heat transfer coefficient between steam and liquid */
+  Kvl = 0.105*kv*Revl^0.68*(muv*prov.cp/kv)^0.33333 *(L/2/R)^(-0.103)/(2*R);
+
+  /* Thermal power losses*/
+  /* Energy balance equation at the wall */
+  Mp*cpp*der(Tp) = Wlp + Wvp - Wpa;
+
+  /* Heat exchange between liquid and gas phases */
+  Wvl = Kcorr*Kvl*Avl*(Tv - Tl);
+
+  /* Heat exchange between the liquid phase and the wall */
+  Wlp = Klp*Alp*(Tl - Tp);
+
+  /* Heat exchange between the gas phase and the wall */
+  Wvp = Kvp*Avp*(Tv - Tp);
+
+  /* Thermal power losses to ambiant, for simplifid we use the wall surface on contact with the fluid (Ape)*/
+  Wpa = Kpa*Ape*(Tp - Ta);
+
+  for i in 1:Ns loop
+    /* Heat transfer coefficient of liquid*/
+    if Cal_hcond then
+       // Nusselt corelation
+       hcond3[i] = ThermoSysPro.Functions.SmoothCond((Tv-Tp1[i]), COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*ThermoSysPro.Functions.SmoothMax((Tv-Tp1[i]),0.1)))^0.25,
+                                                    COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*0.1))^0.25);
+    else
+       hcond3[i] = hcond;
+    end if;
+
+    /* Power exchanged for each section */
+    dW[i] = - hcond3[i]*(Tv - Tp1[i])*Surf_exe + Wt2/Ns;
+
+  end for;
+
+  Wt = sum(dW);
+
+  /* Total power exchanged for Deheating*/
+  /* This equation is not valid for mass flow rate in the pipes = 0*/
+  Wt2 = noEvent( if ( hvIn > vsat.h) then - (CvBP.Q + CvGCT.Q)*(hvIn - vsat.h) else 0);
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-200},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Text(
+          extent={{-96,-68},{-78,-76}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Pipe 3"),
+        Text(
+          extent={{-118,-15},{-42,-51}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Horizontal_1pipe"),
+        Rectangle(
+          extent={{-112,-76},{-56,-80}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-138,-54},{-120,-54}},
+          color={0,0,255},
+          arrow={Arrow.Filled,Arrow.None}),
+        Text(
+          extent={{-152,-76},{-114,-94}},
+          lineColor={0,0,255},
+          fillColor={95,95,95},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "in"),
+        Line(
+          points={{-134,-78},{-116,-78}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Line(
+          points={{-56,-78},{-50,-78},{-50,-54},{-114,-54},{-124,-54}},
+          color={0,0,255},
+          arrow={Arrow.None,Arrow.Filled}),
+        Rectangle(
+          extent={{-116,-42},{-44,-114}},
+          lineColor={0,0,255},
+          pattern=LinePattern.Dash),
+        Rectangle(
+          extent={{-114,-52},{-96,-56}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid),
+        Text(
+          extent={{-126,42},{-32,12}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Condensation pipes"),
+        Text(
+          extent={{-114,30},{-48,6}},
+          lineColor={0,0,0},
+          fillColor={255,0,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               " +  Deheating pipes")}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-250,-200},{100,100}},
+        grid={2,2},
+        initialScale=0.1), graphics={
+        Ellipse(
+          extent={{-100,50},{100,-150}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-250,50},{-50,-150}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-160,50},{8,-150}},
+          lineColor={255,255,0},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid),
+        Line(
+          points={{-238,-98},{88,-98}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-228,-112},{78,-112}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-214,-126},{66,-126}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-196,-138},{48,-138}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-232,-106},{82,-106}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-222,-118},{72,-118}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-206,-132},{56,-132}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-182,-144},{32,-144}},
+          color={0,0,255},
+          pattern=LinePattern.Dash),
+        Line(
+          points={{-160,-150},{8,-150}},
+          color={0,0,255},
+          thickness=0.5),
+        Line(points={{-160,50},{10,50}}, color={0,0,255}),
+        Text(
+          extent={{-90,84},{-58,70}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Steam BP"),
+        Text(
+          extent={{-164,84},{-132,70}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "Steam HP"),
+        Text(
+          extent={{-248,52},{-206,40}},
+          lineColor={0,0,255},
+          fillColor={255,255,0},
+          fillPattern=FillPattern.Solid,
+          textString=
+               "WaterSteam")}),
+    Window(
+      x=0.11,
+      y=0.06,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2019</b> </p>
+<p><b>ThermoSysPro Version 3.2</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Baligh El Hefni</li>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end TwoPhaseCavityOnePipe;
diff --git a/ThermoSysPro/WaterSteam/Volumes/TwoPhaseVolume.mo b/ThermoSysPro/WaterSteam/Volumes/TwoPhaseVolume.mo
index d7d199d9a873457f59d02a2c64a501c49ff183cd..aaa2f9c33f124c505ac0802d11b2ffe13c16994b 100644
--- a/ThermoSysPro/WaterSteam/Volumes/TwoPhaseVolume.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/TwoPhaseVolume.mo
@@ -1,217 +1,217 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model TwoPhaseVolume "TwoPhaseVolume"
-  parameter Units.SI.Volume V=1 "Cavity volume";
-  parameter Units.SI.Area A=1 "Cavity cross-sectional area";
-  parameter Real Vf0=0.5
-    "Fraction of initial water volume in the drum (active if steady_state=false)";
-  parameter Units.SI.AbsolutePressure P0=0.1e5
-    "Fluid initial pressure (active if steady_state=false)";
-  parameter Real Ccond=0.01 "Condensation coefficient";
-  parameter Real Cevap=0.09 "Evaporation coefficient";
-  parameter Real Xlo=0.0025
-    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
-  parameter Real Xvo=0.9975
-    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
-  parameter Units.SI.Area Avl=A
-    "Heat exchange surface between the liquid and gas phases";
-  parameter Real Kvl=1000
-    "Heat exchange coefficient between the liquid and gas phases";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, Vl0)";
-
-protected
-  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
-
-public
-  Units.SI.AbsolutePressure P "Fluid average pressure";
-  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity";
-  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy";
-  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy";
-  Units.SI.Temperature Tl "Liquid phase temperature";
-  Units.SI.Temperature Tv "Gas phase temperature";
-  Units.SI.Volume Vl "Liquid phase volume";
-  Units.SI.Volume Vv "Gas phase volume";
-  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
-  Real xv(start=0) "Mass vapor fraction in the gas phase";
-  Units.SI.Density rhol(start=996) "Liquid phase density";
-  Units.SI.Density rhov(start=1.5) "Gas phase density";
-  Units.SI.MassFlowRate BQl
-    "Right hand side of the mass balance equation of the liquid phase";
-  Units.SI.MassFlowRate BQv
-    "Right hand side of the mass balance equation of the gas phaser";
-  Units.SI.Power BHl
-    "Right hand side of the energy balance equation of the liquid phase";
-  Units.SI.Power BHv
-    "Right hand side of the energy balance equation of the gas phase";
-  Units.SI.MassFlowRate Qcond
-    "Condensation mass flow rate from the vapor phase";
-  Units.SI.MassFlowRate Qevap
-    "Evaporation mass flow rate from the liquid phase";
-  Units.SI.Power Wvl
-    "Thermal power exchanged from the gas phase to the liquid phase";
-
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
-    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
-          extent={{-60,40},{-20,80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
-    "Propriétés de la vapeur dans le ballon" annotation (Placement(
-        transformation(extent={{0,40},{40,80}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
-    annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation=
-           0)));
-  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
-                                           annotation (Placement(transformation(
-          extent={{0,-80},{40,-40}}, rotation=0)));
-  Connectors.FluidInlet Cv "Steam input"
-                                    annotation (Placement(transformation(extent=
-           {{-10,90},{10,110}}, rotation=0)));
-  Connectors.FluidOutlet Cl "Water output"
-                                     annotation (Placement(transformation(
-          extent={{-10,-110},{10,-90}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,10},{10,30}}, rotation=0)));
-  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
-    "Water level"                        annotation (Placement(transformation(
-          extent={{100,-10},{120,10}}, rotation=0)));
-public
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
-    annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation=
-            0)));
-  Connectors.FluidInlet Ce "Water input"
-                                    annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-initial equation
-  if steady_state then
-    der(hl) = 0;
-    der(hv) = 0;
-    der(Vl) = 0;
-    der(P) = 0;
-  else
-    hl = lsat.h;
-    hv = vsat.h;
-    Vl = Vf0*V;
-    P = P0;
-  end if;
-
-equation
-  /* Unconnected connectors */
-  if (cardinality(Cl) == 0) then
-    Cl.Q = 0;
-    Cl.h = 1.e5;
-    Cl.a = true;
-  end if;
-
-  if (cardinality(Cv) == 0) then
-    Cv.Q = 0;
-    Cv.h = 1.e5;
-    Cv.b = true;
-  end if;
-
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.b = true;
-  end if;
-
-  Cl.P = Pfond;
-  Cv.P = P;
-  Ce.P = P;
-
-  V = Vl + Vv;
-
-  /* Pressure at the bottom of the cavity */
-  Pfond = P + prod.d*g*Vl/A;
-
-  /* Liquid phase mass balance equation */
-  BQl = -Cl.Q + Qcond - Qevap + Ce.Q;
-  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
-
-  /* Vapor phase mass balance equation */
-  BQv = Cv.Q + Qevap - Qcond;
-  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
-
-  /* Liquid phase energy balance equation */
-  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Ce.Q*(Ce.h - (hl - P/rhol)) + Wvl;
-  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
-
-  Cl.h_vol = hl;
-  Ce.h_vol = hl;
-
-  /* Gas phase energy balance equation */
-  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Cth.W;
-  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
-
-  Cv.h_vol = hv;
-
-  /* Heat exchange between liquid and gas phases */
-  Wvl = Kvl*Avl*(Tv - Tl);
-
-  /* Condensation and evaporation mass flow rates */
-  Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
-  Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
-
-  /* Water leval */
-  yLevel.signal = Vl/A;
-
-  /* Fluid thermodynamic properties */
-  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P + Pfond)/2, hl);
-  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv);
-  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond, Cl.h);
-  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
-
-  Tl = prol.T;
-  rhol = prol.d;
-  xl = prol.x;
-
-  Tv = prov.T;
-  rhov = prov.d;
-  xv = prov.x;
-
-  Cth.T = Tv;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Polygon(
-          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
-              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
-              80},{40,92},{20,98},{0,100}},
-          lineColor={0,0,255},
-          fillColor={255,255,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-100,100},{100,-100}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Polygon(
-          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
-              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
-              80},{40,92},{20,98},{0,100}},
-          lineColor={0,0,255},
-          fillColor={170,213,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.11,
-      y=0.06,
-      width=0.78,
-      height=0.88),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
-<p><b>ThermoSysPro Version 3.1</h4>
-</html>",
-   revisions="<html>
-<p><u><b>Authors</b></u></p>
-<ul>
-<li>Daniel Bouskela</li>
-<li>Baligh El Hefni </li>
-</ul>
-</html>"));
-end TwoPhaseVolume;
+within ThermoSysPro.WaterSteam.Volumes;
+model TwoPhaseVolume "TwoPhaseVolume"
+  parameter Units.SI.Volume V=1 "Cavity volume";
+  parameter Units.SI.Area A=1 "Cavity cross-sectional area";
+  parameter Real Vf0=0.5
+    "Fraction of initial water volume in the drum (active if steady_state=false)";
+  parameter Units.SI.AbsolutePressure P0=0.1e5
+    "Fluid initial pressure (active if steady_state=false)";
+  parameter Real Ccond=0.01 "Condensation coefficient";
+  parameter Real Cevap=0.09 "Evaporation coefficient";
+  parameter Real Xlo=0.0025
+    "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate";
+  parameter Real Xvo=0.9975
+    "Vapor mass fraction in the gas phase from which the liquid starts to condensate";
+  parameter Units.SI.Area Avl=A
+    "Heat exchange surface between the liquid and gas phases";
+  parameter Real Kvl=1000
+    "Heat exchange coefficient between the liquid and gas phases";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, Vl0)";
+
+protected
+  constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+
+public
+  Units.SI.AbsolutePressure P "Fluid average pressure";
+  Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity";
+  Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy";
+  Units.SI.SpecificEnthalpy hv "Gas phase spepcific enthalpy";
+  Units.SI.Temperature Tl "Liquid phase temperature";
+  Units.SI.Temperature Tv "Gas phase temperature";
+  Units.SI.Volume Vl "Liquid phase volume";
+  Units.SI.Volume Vv "Gas phase volume";
+  Real xl(start=0.5) "Mass vapor fraction in the liquid phase";
+  Real xv(start=0) "Mass vapor fraction in the gas phase";
+  Units.SI.Density rhol(start=996) "Liquid phase density";
+  Units.SI.Density rhov(start=1.5) "Gas phase density";
+  Units.SI.MassFlowRate BQl
+    "Right hand side of the mass balance equation of the liquid phase";
+  Units.SI.MassFlowRate BQv
+    "Right hand side of the mass balance equation of the gas phaser";
+  Units.SI.Power BHl
+    "Right hand side of the energy balance equation of the liquid phase";
+  Units.SI.Power BHv
+    "Right hand side of the energy balance equation of the gas phase";
+  Units.SI.MassFlowRate Qcond
+    "Condensation mass flow rate from the vapor phase";
+  Units.SI.MassFlowRate Qevap
+    "Evaporation mass flow rate from the liquid phase";
+  Units.SI.Power Wvl
+    "Thermal power exchanged from the gas phase to the liquid phase";
+
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol
+    "Propriétés de l'eau dans le ballon" annotation (Placement(transformation(
+          extent={{-60,40},{-20,80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov
+    "Propriétés de la vapeur dans le ballon" annotation (Placement(
+        transformation(extent={{0,40},{40,80}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat
+    annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation=
+           0)));
+  ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat
+                                           annotation (Placement(transformation(
+          extent={{0,-80},{40,-40}}, rotation=0)));
+  Connectors.FluidInlet Cv "Steam input"
+                                    annotation (Placement(transformation(extent=
+           {{-10,90},{10,110}}, rotation=0)));
+  Connectors.FluidOutlet Cl "Water output"
+                                     annotation (Placement(transformation(
+          extent={{-10,-110},{10,-90}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,10},{10,30}}, rotation=0)));
+  ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+    "Water level"                        annotation (Placement(transformation(
+          extent={{100,-10},{120,10}}, rotation=0)));
+public
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod
+    annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation=
+            0)));
+  Connectors.FluidInlet Ce "Water input"
+                                    annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+initial equation
+  if steady_state then
+    der(hl) = 0;
+    der(hv) = 0;
+    der(Vl) = 0;
+    der(P) = 0;
+  else
+    hl = lsat.h;
+    hv = vsat.h;
+    Vl = Vf0*V;
+    P = P0;
+  end if;
+
+equation
+  /* Unconnected connectors */
+  if (cardinality(Cl) == 0) then
+    Cl.Q = 0;
+    Cl.h = 1.e5;
+    Cl.a = true;
+  end if;
+
+  if (cardinality(Cv) == 0) then
+    Cv.Q = 0;
+    Cv.h = 1.e5;
+    Cv.b = true;
+  end if;
+
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.b = true;
+  end if;
+
+  Cl.P = Pfond;
+  Cv.P = P;
+  Ce.P = P;
+
+  V = Vl + Vv;
+
+  /* Pressure at the bottom of the cavity */
+  Pfond = P + prod.d*g*Vl/A;
+
+  /* Liquid phase mass balance equation */
+  BQl = -Cl.Q + Qcond - Qevap + Ce.Q;
+  rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+
+  /* Vapor phase mass balance equation */
+  BQv = Cv.Q + Qevap - Qcond;
+  rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+
+  /* Liquid phase energy balance equation */
+  BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Ce.Q*(Ce.h - (hl - P/rhol)) + Wvl;
+  Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl;
+
+  Cl.h_vol = hl;
+  Ce.h_vol = hl;
+
+  /* Gas phase energy balance equation */
+  BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Cth.W;
+  Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv;
+
+  Cv.h_vol = hv;
+
+  /* Heat exchange between liquid and gas phases */
+  Wvl = Kvl*Avl*(Tv - Tl);
+
+  /* Condensation and evaporation mass flow rates */
+  Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0;
+  Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0;
+
+  /* Water leval */
+  yLevel.signal = Vl/A;
+
+  /* Fluid thermodynamic properties */
+  prol = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((P + Pfond)/2, hl);
+  prov = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(P, hv);
+  prod = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pfond, Cl.h);
+  (lsat,vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(P);
+
+  Tl = prol.T;
+  rhol = prol.d;
+  xl = prol.x;
+
+  Tv = prov.T;
+  rhov = prov.d;
+  xv = prov.x;
+
+  Cth.T = Tv;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Polygon(
+          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
+              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
+              80},{40,92},{20,98},{0,100}},
+          lineColor={0,0,255},
+          fillColor={255,255,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-100,100},{100,-100}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Polygon(
+          points={{0,100},{-20,98},{-40,92},{-60,80},{-80,60},{-92,40},{-98,20},
+              {-100,0},{-98,-20},{98,-20},{100,0},{98,20},{92,40},{80,60},{60,
+              80},{40,92},{20,98},{0,100}},
+          lineColor={0,0,255},
+          fillColor={170,213,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.11,
+      y=0.06,
+      width=0.78,
+      height=0.88),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2013</b> </p>
+<p><b>ThermoSysPro Version 3.1</h4>
+</html>",
+   revisions="<html>
+<p><u><b>Authors</b></u></p>
+<ul>
+<li>Daniel Bouskela</li>
+<li>Baligh El Hefni </li>
+</ul>
+</html>"));
+end TwoPhaseVolume;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeA.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeA.mo
index b14f72ccb9da674b58a09396671b91b762a221d3..717e0aae388d98a9df76b8e4a5df35560164ff02 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeA.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeA.mo
@@ -1,160 +1,160 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeA "Mixing volume with 2 inlets and 2 outlets"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-public
-  Connectors.FluidInlet Ce1
-                           annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidInlet Ce2
-                           annotation (Placement(transformation(extent={{-10,88},
-            {10,108}}, rotation=0)));
-  Connectors.FluidOutlet Cs1
-                           annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Connectors.FluidOutlet Cs2
-                           annotation (Placement(transformation(extent={{-10,
-            -110},{10,-90}}, rotation=0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h = 1.e5;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h = 1.e5;
-    Cs2.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}),
-        Line(points={{0,90},{0,-100}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Line(points={{-90,0},{90,0}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.14,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeA;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeA "Mixing volume with 2 inlets and 2 outlets"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+public
+  Connectors.FluidInlet Ce1
+                           annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidInlet Ce2
+                           annotation (Placement(transformation(extent={{-10,88},
+            {10,108}}, rotation=0)));
+  Connectors.FluidOutlet Cs1
+                           annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Connectors.FluidOutlet Cs2
+                           annotation (Placement(transformation(extent={{-10,
+            -110},{10,-90}}, rotation=0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h = 1.e5;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h = 1.e5;
+    Cs2.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}),
+        Line(points={{0,90},{0,-100}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Line(points={{-90,0},{90,0}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.14,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeA;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeATh.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeATh.mo
index 3794fb4071f5c573bf8e7899c7a52cc8113d7ed3..d00916e9621fc11b0bca84f962e51efb9873c146 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeATh.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeATh.mo
@@ -1,163 +1,163 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeATh "Mixing volume with 2 inlets and 2 outlets and thermal input"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Connectors.FluidInlet Ce1
-                           annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidInlet Ce2
-                           annotation (Placement(transformation(extent={{-10,90},
-            {10,110}}, rotation=0)));
-  Connectors.FluidOutlet Cs1
-                           annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs2
-                           annotation (Placement(transformation(extent={{-10,
-            -108},{10,-88}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h = 1.e5;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h = 1.e5;
-    Cs2.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + Cth.W;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,0},{90,0}}),
-        Line(points={{0,90},{0,-100}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Line(points={{-90,0},{90,0}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.16,
-      y=0.27,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeATh;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeATh "Mixing volume with 2 inlets and 2 outlets and thermal input"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Connectors.FluidInlet Ce1
+                           annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidInlet Ce2
+                           annotation (Placement(transformation(extent={{-10,90},
+            {10,110}}, rotation=0)));
+  Connectors.FluidOutlet Cs1
+                           annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs2
+                           annotation (Placement(transformation(extent={{-10,
+            -108},{10,-88}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h = 1.e5;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h = 1.e5;
+    Cs2.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + Cth.W;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,0},{90,0}}),
+        Line(points={{0,90},{0,-100}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Line(points={{-90,0},{90,0}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.16,
+      y=0.27,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeATh;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeB.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeB.mo
index 6497d748ea0df28c925d5394f5f28ec1b35999b6..0feaf763490c34f5ffeee08a80f912e6f80d5625 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeB.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeB.mo
@@ -1,160 +1,160 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeB "Mixing volume with 2 inlets and 2 outlets"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  Connectors.FluidInlet Ce1
-                           annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidInlet Ce2
-                           annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs1
-                           annotation (Placement(transformation(extent={{-10,80},
-            {10,100}}, rotation=0)));
-  Connectors.FluidOutlet Cs2
-                           annotation (Placement(transformation(extent={{-10,
-            -108},{10,-88}}, rotation=0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h = 1.e5;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h = 1.e5;
-    Cs2.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}),
-        Line(points={{0,90},{0,-100}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Line(points={{-90,0},{90,0}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.07,
-      y=0.22,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeB;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeB "Mixing volume with 2 inlets and 2 outlets"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  Connectors.FluidInlet Ce1
+                           annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidInlet Ce2
+                           annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs1
+                           annotation (Placement(transformation(extent={{-10,80},
+            {10,100}}, rotation=0)));
+  Connectors.FluidOutlet Cs2
+                           annotation (Placement(transformation(extent={{-10,
+            -108},{10,-88}}, rotation=0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h = 1.e5;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h = 1.e5;
+    Cs2.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}),
+        Line(points={{0,90},{0,-100}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Line(points={{-90,0},{90,0}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.07,
+      y=0.22,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeB;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeBTh.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeBTh.mo
index c9a561ea639f641b394e2f79460f1cbeaea3b6e1..3033a6da5eec29fd089a877f2659a594b192613c 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeBTh.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeBTh.mo
@@ -1,162 +1,162 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeBTh "Mixing volume with 2 inlets and 2 outlets and thermal input"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Connectors.FluidInlet Ce1
-                           annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs1
-                           annotation (Placement(transformation(extent={{-10,80},
-            {10,100}}, rotation=0)));
-  Connectors.FluidInlet Ce2
-                           annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs2
-                           annotation (Placement(transformation(extent={{-10,
-            -108},{10,-88}}, rotation=0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h = 1.e5;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h = 1.e5;
-    Cs2.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Cs1.P;
-  P = Cs2.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + Cth.W;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,0},{90,0}}),
-        Line(points={{0,90},{0,-100}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Line(points={{-90,0},{90,0}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.21,
-      y=0.21,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeBTh;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeBTh "Mixing volume with 2 inlets and 2 outlets and thermal input"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Connectors.FluidInlet Ce1
+                           annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs1
+                           annotation (Placement(transformation(extent={{-10,80},
+            {10,100}}, rotation=0)));
+  Connectors.FluidInlet Ce2
+                           annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs2
+                           annotation (Placement(transformation(extent={{-10,
+            -108},{10,-88}}, rotation=0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h = 1.e5;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h = 1.e5;
+    Cs2.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Cs1.P;
+  P = Cs2.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + Cth.W;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,0},{90,0}}),
+        Line(points={{0,90},{0,-100}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Line(points={{-90,0},{90,0}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.21,
+      y=0.21,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeBTh;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeC.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeC.mo
index 9ada884319c32db619c001ac4525aab0bc0cacda..6cae515fcf9fdde7a4fa8e9014ec6d612dad09aa 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeC.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeC.mo
@@ -1,160 +1,160 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeC "Mixing volume with 3 inlets and 1 outlet"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  Connectors.FluidInlet Ce1
-                           annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidInlet Ce2
-                           annotation (Placement(transformation(extent={{-10,80},
-            {10,100}}, rotation=0)));
-  Connectors.FluidOutlet Cs
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  Connectors.FluidInlet Ce3
-                           annotation (Placement(transformation(extent={{-10,
-            -110},{10,-90}}, rotation=0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.b = true;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h = 1.e5;
-    Cs.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Ce3.h_vol = h;
-  Cs.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}),
-        Line(points={{0,90},{0,-100}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Line(points={{-90,0},{90,0}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.09,
-      y=0.2,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeC;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeC "Mixing volume with 3 inlets and 1 outlet"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  Connectors.FluidInlet Ce1
+                           annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidInlet Ce2
+                           annotation (Placement(transformation(extent={{-10,80},
+            {10,100}}, rotation=0)));
+  Connectors.FluidOutlet Cs
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  Connectors.FluidInlet Ce3
+                           annotation (Placement(transformation(extent={{-10,
+            -110},{10,-90}}, rotation=0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.b = true;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h = 1.e5;
+    Cs.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Ce3.h_vol = h;
+  Cs.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}),
+        Line(points={{0,90},{0,-100}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Line(points={{-90,0},{90,0}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.09,
+      y=0.2,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeC;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeCTh.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeCTh.mo
index efa3f817fdf161dfe50448f719bbdd91c1476393..d793cc069f678fe06feafadacdaf962a2087fc32 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeCTh.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeCTh.mo
@@ -1,163 +1,163 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeCTh "Mixing volume with 3 inlets and 1 outlet and thermal input"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Connectors.FluidInlet Ce1
-                           annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidInlet Ce2
-                           annotation (Placement(transformation(extent={{-10,80},
-            {10,100}}, rotation=0)));
-  Connectors.FluidOutlet Cs
-                          annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-  Connectors.FluidInlet Ce3
-                           annotation (Placement(transformation(extent={{-10,
-            -110},{10,-90}}, rotation=0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.b = true;
-  end if;
-
-  if (cardinality(Cs) == 0) then
-    Cs.Q = 0;
-    Cs.h = 1.e5;
-    Cs.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Cs.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + Cth.W;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Ce3.h_vol = h;
-  Cs.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,0},{90,0}}),
-        Line(points={{0,90},{0,-100}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Line(points={{-90,0},{90,0}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.19,
-      y=0.28,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeCTh;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeCTh "Mixing volume with 3 inlets and 1 outlet and thermal input"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Connectors.FluidInlet Ce1
+                           annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidInlet Ce2
+                           annotation (Placement(transformation(extent={{-10,80},
+            {10,100}}, rotation=0)));
+  Connectors.FluidOutlet Cs
+                          annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+  Connectors.FluidInlet Ce3
+                           annotation (Placement(transformation(extent={{-10,
+            -110},{10,-90}}, rotation=0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.b = true;
+  end if;
+
+  if (cardinality(Cs) == 0) then
+    Cs.Q = 0;
+    Cs.h = 1.e5;
+    Cs.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Cs.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + Cth.W;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Ce3.h_vol = h;
+  Cs.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,0},{90,0}}),
+        Line(points={{0,90},{0,-100}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Line(points={{-90,0},{90,0}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.19,
+      y=0.28,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeCTh;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeD.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeD.mo
index 7774a49dc93103c15179eeda47a360701a1248af..5d3a8c3a0d389c32e646e5e8f83a39e26f8539d5 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeD.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeD.mo
@@ -1,160 +1,160 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeD "Mixing volume with 1 inlet and 3 outlets"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-public
-  Connectors.FluidInlet Ce
-                          annotation (Placement(transformation(extent={{-110,
-            -10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs1
-                           annotation (Placement(transformation(extent={{-10,90},
-            {10,110}}, rotation=0)));
-  Connectors.FluidOutlet Cs2
-                           annotation (Placement(transformation(extent={{-10,
-            -108},{10,-88}}, rotation=0)));
-  Connectors.FluidOutlet Cs3
-                           annotation (Placement(transformation(extent={{90,-10},
-            {110,10}}, rotation=0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h = 1.e5;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h = 1.e5;
-    Cs2.a = true;
-  end if;
-
-  if (cardinality(Cs3) == 0) then
-    Cs3.Q = 0;
-    Cs3.h = 1.e5;
-    Cs3.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-
-  /* Energy balance equation */
-  BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-  Cs3.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{90,0}}),
-        Line(points={{0,90},{0,-100}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Line(points={{-90,0},{90,0}}),
-        Ellipse(
-          extent={{-58,60},{62,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.03,
-      y=0.23,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeD;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeD "Mixing volume with 1 inlet and 3 outlets"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+public
+  Connectors.FluidInlet Ce
+                          annotation (Placement(transformation(extent={{-110,
+            -10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs1
+                           annotation (Placement(transformation(extent={{-10,90},
+            {10,110}}, rotation=0)));
+  Connectors.FluidOutlet Cs2
+                           annotation (Placement(transformation(extent={{-10,
+            -108},{10,-88}}, rotation=0)));
+  Connectors.FluidOutlet Cs3
+                           annotation (Placement(transformation(extent={{90,-10},
+            {110,10}}, rotation=0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h = 1.e5;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h = 1.e5;
+    Cs2.a = true;
+  end if;
+
+  if (cardinality(Cs3) == 0) then
+    Cs3.Q = 0;
+    Cs3.h = 1.e5;
+    Cs3.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+
+  /* Energy balance equation */
+  BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+  Cs3.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{90,0}}),
+        Line(points={{0,90},{0,-100}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Line(points={{-90,0},{90,0}}),
+        Ellipse(
+          extent={{-58,60},{62,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.03,
+      y=0.23,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeD;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeDTh.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeDTh.mo
index ba079d7ab706e2a0efffb7857fd3192548c87536..48545a46e830f7d76c2299e97fc966f2383a0684 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeDTh.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeDTh.mo
@@ -1,160 +1,160 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeDTh "Mixing volume with 1 inlet and 3 outlets and thermal input"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-public
-  Connectors.FluidInlet Ce          annotation (Placement(transformation(extent=
-           {{-110,-10},{-90,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs1         annotation (Placement(transformation(
-          extent={{-10,90},{10,110}}, rotation=0)));
-  Connectors.FluidOutlet Cs2         annotation (Placement(transformation(
-          extent={{-10,-108},{10,-88}}, rotation=0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                                     annotation (Placement(transformation(
-          extent={{-10,-10},{10,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs3         annotation (Placement(transformation(
-          extent={{90,-10},{110,10}}, rotation=0)));
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce) == 0) then
-    Ce.Q = 0;
-    Ce.h = 1.e5;
-    Ce.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h = 1.e5;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h = 1.e5;
-    Cs2.a = true;
-  end if;
-
-  if (cardinality(Cs3) == 0) then
-    Cs3.Q = 0;
-    Cs3.h = 1.e5;
-    Cs3.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-
-  /* Energy balance equation */
-  BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + Cth.W;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-  Cs3.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,0},{90,0}}),
-        Line(points={{0,90},{0,-100}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{0,90},{0,-100}}),
-        Line(points={{-90,0},{90,0}}),
-        Ellipse(
-          extent={{-60,60},{60,-60}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid)}),
-    Window(
-      x=0.16,
-      y=0.23,
-      width=0.66,
-      height=0.69),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeDTh;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeDTh "Mixing volume with 1 inlet and 3 outlets and thermal input"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+public
+  Connectors.FluidInlet Ce          annotation (Placement(transformation(extent=
+           {{-110,-10},{-90,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs1         annotation (Placement(transformation(
+          extent={{-10,90},{10,110}}, rotation=0)));
+  Connectors.FluidOutlet Cs2         annotation (Placement(transformation(
+          extent={{-10,-108},{10,-88}}, rotation=0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                                     annotation (Placement(transformation(
+          extent={{-10,-10},{10,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs3         annotation (Placement(transformation(
+          extent={{90,-10},{110,10}}, rotation=0)));
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce) == 0) then
+    Ce.Q = 0;
+    Ce.h = 1.e5;
+    Ce.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h = 1.e5;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h = 1.e5;
+    Cs2.a = true;
+  end if;
+
+  if (cardinality(Cs3) == 0) then
+    Cs3.Q = 0;
+    Cs3.h = 1.e5;
+    Cs3.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+
+  /* Energy balance equation */
+  BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + Cth.W;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+  Cs3.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,0},{90,0}}),
+        Line(points={{0,90},{0,-100}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{0,90},{0,-100}}),
+        Line(points={{-90,0},{90,0}}),
+        Ellipse(
+          extent={{-60,60},{60,-60}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid)}),
+    Window(
+      x=0.16,
+      y=0.23,
+      width=0.66,
+      height=0.69),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeDTh;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeI.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeI.mo
index a4cd3da99e4ab9e1a5d4a3c6c7d15e0a0460ec43..f994823d13fdd16e1c28d397149643be98cd5ae4 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeI.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeI.mo
@@ -1,226 +1,226 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeI "Mixing volume with 4 inlets and 4 outlets"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
-           0)));
-  Connectors.FluidInlet Ce2
-    annotation (                             layer="icon", Placement(
-        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
-  Connectors.FluidInlet Ce3
-    annotation (                              layer="icon", Placement(
-        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
-  Connectors.FluidInlet Ce4
-    annotation (                             layer="icon", Placement(
-        transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
-  Connectors.FluidInlet Ce1
-                           annotation (                            layer="icon",
-      Placement(transformation(extent={{-110,70},{-90,90}}, rotation=0)));
-  Connectors.FluidOutlet Cs4
-                           annotation (                           layer="icon",
-      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Connectors.FluidOutlet Cs1
-                           annotation (                          layer="icon",
-      Placement(transformation(extent={{90,70},{110,90}}, rotation=0)));
-  Connectors.FluidOutlet Cs2
-                           annotation (                           layer="icon",
-      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs3
-                           annotation (                            layer="icon",
-      Placement(transformation(extent={{90,-90},{110,-70}}, rotation=0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.b = true;
-  end if;
-  if (cardinality(Ce4) == 0) then
-    Ce4.Q = 0;
-    Ce4.h = 1.e5;
-    Ce4.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h = 1.e5;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h = 1.e5;
-    Cs2.a = true;
-  end if;
-
-  if (cardinality(Cs3) == 0) then
-    Cs3.Q = 0;
-    Cs3.h = 1.e5;
-    Cs3.a = true;
-  end if;
-  if (cardinality(Cs4) == 0) then
-    Cs4.Q = 0;
-    Cs4.h = 1.e5;
-    Cs4.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Ce4.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-  P = Cs4.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h -
-       Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Ce3.h_vol = h;
-  Ce4.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-  Cs3.h_vol = h;
-  Cs4.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,80},{-60,80},{-40,46}}),
-        Line(points={{92,80},{60,80},{40,46}}),
-        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
-        Line(points={{92,-80},{60,-80},{40,-46}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{92,0}}),
-        Line(points={{0,92},{0,-100}}),
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,80},{-60,80},{-40,46}}),
-        Line(points={{92,80},{60,80},{40,46}}),
-        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
-        Line(points={{92,-80},{60,-80},{40,-46}})}),
-    Window(
-      x=0.05,
-      y=0.07,
-      width=0.74,
-      height=0.85),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeI;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeI "Mixing volume with 4 inlets and 4 outlets"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=
+           0)));
+  Connectors.FluidInlet Ce2
+    annotation (                             layer="icon", Placement(
+        transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+  Connectors.FluidInlet Ce3
+    annotation (                              layer="icon", Placement(
+        transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+  Connectors.FluidInlet Ce4
+    annotation (                             layer="icon", Placement(
+        transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+  Connectors.FluidInlet Ce1
+                           annotation (                            layer="icon",
+      Placement(transformation(extent={{-110,70},{-90,90}}, rotation=0)));
+  Connectors.FluidOutlet Cs4
+                           annotation (                           layer="icon",
+      Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Connectors.FluidOutlet Cs1
+                           annotation (                          layer="icon",
+      Placement(transformation(extent={{90,70},{110,90}}, rotation=0)));
+  Connectors.FluidOutlet Cs2
+                           annotation (                           layer="icon",
+      Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs3
+                           annotation (                            layer="icon",
+      Placement(transformation(extent={{90,-90},{110,-70}}, rotation=0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.b = true;
+  end if;
+  if (cardinality(Ce4) == 0) then
+    Ce4.Q = 0;
+    Ce4.h = 1.e5;
+    Ce4.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h = 1.e5;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h = 1.e5;
+    Cs2.a = true;
+  end if;
+
+  if (cardinality(Cs3) == 0) then
+    Cs3.Q = 0;
+    Cs3.h = 1.e5;
+    Cs3.a = true;
+  end if;
+  if (cardinality(Cs4) == 0) then
+    Cs4.Q = 0;
+    Cs4.h = 1.e5;
+    Cs4.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Ce4.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+  P = Cs4.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h -
+       Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Ce3.h_vol = h;
+  Ce4.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+  Cs3.h_vol = h;
+  Cs4.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,80},{-60,80},{-40,46}}),
+        Line(points={{92,80},{60,80},{40,46}}),
+        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
+        Line(points={{92,-80},{60,-80},{40,-46}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{92,0}}),
+        Line(points={{0,92},{0,-100}}),
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,80},{-60,80},{-40,46}}),
+        Line(points={{92,80},{60,80},{40,46}}),
+        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
+        Line(points={{92,-80},{60,-80},{40,-46}})}),
+    Window(
+      x=0.05,
+      y=0.07,
+      width=0.74,
+      height=0.85),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeI;
diff --git a/ThermoSysPro/WaterSteam/Volumes/VolumeITh.mo b/ThermoSysPro/WaterSteam/Volumes/VolumeITh.mo
index 9f6035efc1b415a5981c62a604044637a71b5178..b9dee4a19cb549e9e38a8f45d780d812dae9bff2 100644
--- a/ThermoSysPro/WaterSteam/Volumes/VolumeITh.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/VolumeITh.mo
@@ -1,229 +1,229 @@
-within ThermoSysPro.WaterSteam.Volumes;
-model VolumeITh "Mixing volume with 4 inlets and 4 outlets and thermal input"
-  parameter Units.SI.Volume V=1 "Volume";
-  parameter Units.SI.AbsolutePressure P0=1e5
-    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
-  parameter Units.SI.SpecificEnthalpy h0=1e5
-    "Initial fluid specific enthalpy (active if steady_state=false)";
-  parameter Boolean dynamic_mass_balance=false
-    "true: dynamic mass balance equation - false: static mass balance equation";
-  parameter Boolean steady_state=true
-    "true: start from steady state - false: start from (P0, h0)";
-  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
-  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
-  parameter Integer mode=0
-    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
-
-public
-  Units.SI.Temperature T "Fluid temperature";
-  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
-  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
-  Units.SI.Density rho(start=998) "Fluid density";
-  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
-  Units.SI.Power BH "Right hand side of the energybalance equation";
-  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
-    "Propriétés de l'eau"
-    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
-            0)));
-public
-  Connectors.FluidInlet Ce2
-    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
-           0)));
-  Connectors.FluidInlet Ce3
-    annotation (Placement(transformation(extent={{-110,-90},{-90,-70}},
-          rotation=0)));
-  Connectors.FluidInlet Ce4
-    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
-           0)));
-  Connectors.FluidInlet Ce1
-    annotation (Placement(transformation(extent={{-110,70},{-90,90}}, rotation=
-            0)));
-  Connectors.FluidOutlet Cs4
-    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
-  Connectors.FluidOutlet Cs1
-    annotation (Placement(transformation(extent={{90,70},{110,90}}, rotation=0)));
-  Connectors.FluidOutlet Cs2
-    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
-  Connectors.FluidOutlet Cs3
-    annotation (Placement(transformation(extent={{90,-90},{110,-70}}, rotation=
-            0)));
-  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
-                           annotation (Placement(transformation(extent={{-10,
-            -10},{10,10}}, rotation=0)));
-initial equation
-  if steady_state then
-    if dynamic_mass_balance then
-      der(P) = 0;
-    end if;
-
-    der(h) = 0;
-  else
-    if dynamic_mass_balance then
-      P = P0;
-    end if;
-
-    h = h0;
-  end if;
-
-equation
-  assert(V > 0, "Volume non-positive");
-
-  /* Unconnected connectors */
-  if (cardinality(Ce1) == 0) then
-    Ce1.Q = 0;
-    Ce1.h = 1.e5;
-    Ce1.b = true;
-  end if;
-  if (cardinality(Ce2) == 0) then
-    Ce2.Q = 0;
-    Ce2.h = 1.e5;
-    Ce2.b = true;
-  end if;
-  if (cardinality(Ce3) == 0) then
-    Ce3.Q = 0;
-    Ce3.h = 1.e5;
-    Ce3.b = true;
-  end if;
-  if (cardinality(Ce4) == 0) then
-    Ce4.Q = 0;
-    Ce4.h = 1.e5;
-    Ce4.b = true;
-  end if;
-
-  if (cardinality(Cs1) == 0) then
-    Cs1.Q = 0;
-    Cs1.h = 1.e5;
-    Cs1.a = true;
-  end if;
-
-  if (cardinality(Cs2) == 0) then
-    Cs2.Q = 0;
-    Cs2.h = 1.e5;
-    Cs2.a = true;
-  end if;
-
-  if (cardinality(Cs3) == 0) then
-    Cs3.Q = 0;
-    Cs3.h = 1.e5;
-    Cs3.a = true;
-  end if;
-  if (cardinality(Cs4) == 0) then
-    Cs4.Q = 0;
-    Cs4.h = 1.e5;
-    Cs4.a = true;
-  end if;
-
-  /* Mass balance equation */
-  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q;
-  if dynamic_mass_balance then
-    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
-  else
-    0 = BQ;
-  end if;
-
-  P = Ce1.P;
-  P = Ce2.P;
-  P = Ce3.P;
-  P = Ce4.P;
-  P = Cs1.P;
-  P = Cs2.P;
-  P = Cs3.P;
-  P = Cs4.P;
-
-  /* Energy balance equation */
-  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h -
-       Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h + Cth.W;
-  if dynamic_mass_balance then
-    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
-  else
-    V*rho*der(h) = BH;
-  end if;
-
-  Ce1.h_vol = h;
-  Ce2.h_vol = h;
-  Ce3.h_vol = h;
-  Ce4.h_vol = h;
-  Cs1.h_vol = h;
-  Cs2.h_vol = h;
-  Cs3.h_vol = h;
-  Cs4.h_vol = h;
-
-  /* Fluid thermodynamic properties */
-  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
-
-  T = pro.T;
-
-  Cth.T = T;
-
-  if (p_rho > 0) then
-    rho = p_rho;
-  else
-    rho = pro.d;
-  end if;
-
-  annotation (
-    Diagram(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,80},{-60,80},{-40,46}}),
-        Line(points={{92,80},{60,80},{40,46}}),
-        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
-        Line(points={{92,-80},{60,-80},{40,-46}})}),
-    Icon(coordinateSystem(
-        preserveAspectRatio=false,
-        extent={{-100,-100},{100,100}},
-        grid={2,2}), graphics={
-        Line(points={{-90,0},{92,0}}),
-        Line(points={{0,92},{0,-100}}),
-        Ellipse(
-          extent={{-40,80},{40,0}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Ellipse(
-          extent={{-40,0},{40,-80}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Rectangle(
-          extent={{-40,40},{40,-40}},
-          lineColor={0,0,255},
-          fillColor={85,170,255},
-          fillPattern=FillPattern.Solid),
-        Line(points={{-90,80},{-60,80},{-40,46}}),
-        Line(points={{92,80},{60,80},{40,46}}),
-        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
-        Line(points={{92,-80},{60,-80},{40,-46}})}),
-    Window(
-      x=0.31,
-      y=0.01,
-      width=0.74,
-      height=0.85),
-    Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
-<p><b>ThermoSysPro Version 2.0</b></p>
-<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
-</HTML>
-", revisions="<html>
-<p><u><b>Author</b></u></p>
-<ul>
-<li>Daniel Bouskela </li>
-</ul>
-</html>"));
-end VolumeITh;
+within ThermoSysPro.WaterSteam.Volumes;
+model VolumeITh "Mixing volume with 4 inlets and 4 outlets and thermal input"
+  parameter Units.SI.Volume V=1 "Volume";
+  parameter Units.SI.AbsolutePressure P0=1e5
+    "Initial fluid pressure (active if dynamic_mass_balance=true and steady_state=false)";
+  parameter Units.SI.SpecificEnthalpy h0=1e5
+    "Initial fluid specific enthalpy (active if steady_state=false)";
+  parameter Boolean dynamic_mass_balance=false
+    "true: dynamic mass balance equation - false: static mass balance equation";
+  parameter Boolean steady_state=true
+    "true: start from steady state - false: start from (P0, h0)";
+  parameter Integer fluid=1 "1: water/steam - 2: C3H3F5";
+  parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density";
+  parameter Integer mode=0
+    "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic";
+
+public
+  Units.SI.Temperature T "Fluid temperature";
+  Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure";
+  Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy";
+  Units.SI.Density rho(start=998) "Fluid density";
+  Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation";
+  Units.SI.Power BH "Right hand side of the energybalance equation";
+  ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro
+    "Propriétés de l'eau"
+    annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation=
+            0)));
+public
+  Connectors.FluidInlet Ce2
+    annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=
+           0)));
+  Connectors.FluidInlet Ce3
+    annotation (Placement(transformation(extent={{-110,-90},{-90,-70}},
+          rotation=0)));
+  Connectors.FluidInlet Ce4
+    annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+           0)));
+  Connectors.FluidInlet Ce1
+    annotation (Placement(transformation(extent={{-110,70},{-90,90}}, rotation=
+            0)));
+  Connectors.FluidOutlet Cs4
+    annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+  Connectors.FluidOutlet Cs1
+    annotation (Placement(transformation(extent={{90,70},{110,90}}, rotation=0)));
+  Connectors.FluidOutlet Cs2
+    annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+  Connectors.FluidOutlet Cs3
+    annotation (Placement(transformation(extent={{90,-90},{110,-70}}, rotation=
+            0)));
+  ThermoSysPro.Thermal.Connectors.ThermalPort Cth
+                           annotation (Placement(transformation(extent={{-10,
+            -10},{10,10}}, rotation=0)));
+initial equation
+  if steady_state then
+    if dynamic_mass_balance then
+      der(P) = 0;
+    end if;
+
+    der(h) = 0;
+  else
+    if dynamic_mass_balance then
+      P = P0;
+    end if;
+
+    h = h0;
+  end if;
+
+equation
+  assert(V > 0, "Volume non-positive");
+
+  /* Unconnected connectors */
+  if (cardinality(Ce1) == 0) then
+    Ce1.Q = 0;
+    Ce1.h = 1.e5;
+    Ce1.b = true;
+  end if;
+  if (cardinality(Ce2) == 0) then
+    Ce2.Q = 0;
+    Ce2.h = 1.e5;
+    Ce2.b = true;
+  end if;
+  if (cardinality(Ce3) == 0) then
+    Ce3.Q = 0;
+    Ce3.h = 1.e5;
+    Ce3.b = true;
+  end if;
+  if (cardinality(Ce4) == 0) then
+    Ce4.Q = 0;
+    Ce4.h = 1.e5;
+    Ce4.b = true;
+  end if;
+
+  if (cardinality(Cs1) == 0) then
+    Cs1.Q = 0;
+    Cs1.h = 1.e5;
+    Cs1.a = true;
+  end if;
+
+  if (cardinality(Cs2) == 0) then
+    Cs2.Q = 0;
+    Cs2.h = 1.e5;
+    Cs2.a = true;
+  end if;
+
+  if (cardinality(Cs3) == 0) then
+    Cs3.Q = 0;
+    Cs3.h = 1.e5;
+    Cs3.a = true;
+  end if;
+  if (cardinality(Cs4) == 0) then
+    Cs4.Q = 0;
+    Cs4.h = 1.e5;
+    Cs4.a = true;
+  end if;
+
+  /* Mass balance equation */
+  BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q;
+  if dynamic_mass_balance then
+    V*(pro.ddph*der(P) + pro.ddhp*der(h)) = BQ;
+  else
+    0 = BQ;
+  end if;
+
+  P = Ce1.P;
+  P = Ce2.P;
+  P = Ce3.P;
+  P = Ce4.P;
+  P = Cs1.P;
+  P = Cs2.P;
+  P = Cs3.P;
+  P = Cs4.P;
+
+  /* Energy balance equation */
+  BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h -
+       Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h + Cth.W;
+  if dynamic_mass_balance then
+    V*((h*pro.ddph - 1)*der(P) + (h*pro.ddhp + rho)*der(h)) = BH;
+  else
+    V*rho*der(h) = BH;
+  end if;
+
+  Ce1.h_vol = h;
+  Ce2.h_vol = h;
+  Ce3.h_vol = h;
+  Ce4.h_vol = h;
+  Cs1.h_vol = h;
+  Cs2.h_vol = h;
+  Cs3.h_vol = h;
+  Cs4.h_vol = h;
+
+  /* Fluid thermodynamic properties */
+  pro = ThermoSysPro.Properties.Fluid.Ph(P, h, mode, fluid);
+
+  T = pro.T;
+
+  Cth.T = T;
+
+  if (p_rho > 0) then
+    rho = p_rho;
+  else
+    rho = pro.d;
+  end if;
+
+  annotation (
+    Diagram(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,80},{-60,80},{-40,46}}),
+        Line(points={{92,80},{60,80},{40,46}}),
+        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
+        Line(points={{92,-80},{60,-80},{40,-46}})}),
+    Icon(coordinateSystem(
+        preserveAspectRatio=false,
+        extent={{-100,-100},{100,100}},
+        grid={2,2}), graphics={
+        Line(points={{-90,0},{92,0}}),
+        Line(points={{0,92},{0,-100}}),
+        Ellipse(
+          extent={{-40,80},{40,0}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Ellipse(
+          extent={{-40,0},{40,-80}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Rectangle(
+          extent={{-40,40},{40,-40}},
+          lineColor={0,0,255},
+          fillColor={85,170,255},
+          fillPattern=FillPattern.Solid),
+        Line(points={{-90,80},{-60,80},{-40,46}}),
+        Line(points={{92,80},{60,80},{40,46}}),
+        Line(points={{-90,-80},{-60,-80},{-40,-46}}),
+        Line(points={{92,-80},{60,-80},{40,-46}})}),
+    Window(
+      x=0.31,
+      y=0.01,
+      width=0.74,
+      height=0.85),
+    Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2010</b></p>
+<p><b>ThermoSysPro Version 2.0</b></p>
+<p>This component model is documented in Sect. 14.1 of the <a href=\"https://www.springer.com/us/book/9783030051044\">ThermoSysPro book</a>. </h4>
+</HTML>
+", revisions="<html>
+<p><u><b>Author</b></u></p>
+<ul>
+<li>Daniel Bouskela </li>
+</ul>
+</html>"));
+end VolumeITh;
diff --git a/ThermoSysPro/WaterSteam/Volumes/package.mo b/ThermoSysPro/WaterSteam/Volumes/package.mo
index ed8a57049193a2b64c157672419389d19def53cb..5bd66964ec7cf6a2c2fe665142b458eb2a949625 100644
--- a/ThermoSysPro/WaterSteam/Volumes/package.mo
+++ b/ThermoSysPro/WaterSteam/Volumes/package.mo
@@ -1,124 +1,124 @@
-within ThermoSysPro.WaterSteam;
-package Volumes "Volumes"
-
-
-
-annotation (Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end Volumes;
+within ThermoSysPro.WaterSteam;
+package Volumes "Volumes"
+
+
+
+annotation (Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end Volumes;
diff --git a/ThermoSysPro/WaterSteam/Volumes/package.order b/ThermoSysPro/WaterSteam/Volumes/package.order
index f88f209903d00d29c5e3dd7a2eecdf7164ca6c22..f9e70d585d04d04ef2e6c89f6be302c44b705e67 100644
--- a/ThermoSysPro/WaterSteam/Volumes/package.order
+++ b/ThermoSysPro/WaterSteam/Volumes/package.order
@@ -1,18 +1,18 @@
-Degasifier
-DegasifierVolume
-DynamicDrum
-Pressurizer
-Tank
-TwoPhaseCavity
-TwoPhaseCavityOnePipe
-TwoPhaseVolume
-VolumeA
-VolumeATh
-VolumeB
-VolumeBTh
-VolumeC
-VolumeCTh
-VolumeD
-VolumeDTh
-VolumeI
-VolumeITh
+Degasifier
+DegasifierVolume
+DynamicDrum
+Pressurizer
+Tank
+TwoPhaseCavity
+TwoPhaseCavityOnePipe
+TwoPhaseVolume
+VolumeA
+VolumeATh
+VolumeB
+VolumeBTh
+VolumeC
+VolumeCTh
+VolumeD
+VolumeDTh
+VolumeI
+VolumeITh
diff --git a/ThermoSysPro/WaterSteam/package.mo b/ThermoSysPro/WaterSteam/package.mo
index e211868bc0b615ac17f2875f5c47dfbed7065baf..587cb3781fa4c1a23b68a14fd2e4181c9304f35d 100644
--- a/ThermoSysPro/WaterSteam/package.mo
+++ b/ThermoSysPro/WaterSteam/package.mo
@@ -1,126 +1,126 @@
-within ThermoSysPro;
-package WaterSteam "Water/steam components library"
-
-
-
-annotation (Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
-</html>"), Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}));
-end WaterSteam;
+within ThermoSysPro;
+package WaterSteam "Water/steam components library"
+
+
+
+annotation (Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2012</b> </h4>
+</html>"), Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}));
+end WaterSteam;
diff --git a/ThermoSysPro/package.mo b/ThermoSysPro/package.mo
index 1af816798f21fe68d3712822582aa082650c1a3e..37d7751ccb3e8b8b955cd916726efb8a2bf6b367 100644
--- a/ThermoSysPro/package.mo
+++ b/ThermoSysPro/package.mo
@@ -1,130 +1,130 @@
-within ;
-package ThermoSysPro
-
-
-
-annotation (
-  Icon(graphics={
-      Text(
-        extent={{-102,0},{24,-26}},
-        lineColor={242,148,0},
-        textString=
-               "Thermo"),
-      Text(
-        extent={{-4,8},{68,-34}},
-        lineColor={46,170,220},
-        textString=
-               "SysPro"),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
-            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
-            -62,2}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
-            -42,22},{-42,30},{-44,38}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
-            {-26,12},{-28,12},{-26,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,30},{-6,26}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,36},{-6,32}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,42},{-6,38}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-8,48},{-6,44}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,32},{-2,28}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,38},{-2,34}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,44},{-2,40}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Rectangle(
-        extent={{-4,50},{-2,46}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Polygon(
-        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
-            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
-            2}},
-        lineColor={242,148,0},
-        fillColor={242,148,0},
-        fillPattern=FillPattern.Solid),
-      Line(
-        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
-        color={46,170,220},
-        thickness=0.5),
-      Line(
-        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
-        color={46,170,220},
-        thickness=0.5),
-      Polygon(
-        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
-        lineColor={46,170,220},
-        fillColor={46,170,220},
-        fillPattern=FillPattern.Solid),
-      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
-      Line(
-        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
-        color={0,0,255},
-        smooth=Smooth.None),
-      Line(
-        points={{80,80},{100,100}},
-        color={0,0,255},
-        smooth=Smooth.None)}),
-  Documentation(info="<html>
-<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
-<h4>ThermoSysPro version 4.0 </h4>
-</html>"),
-  version="4.0");
-end ThermoSysPro;
+within ;
+package ThermoSysPro
+
+
+
+annotation (
+  Icon(graphics={
+      Text(
+        extent={{-102,0},{24,-26}},
+        lineColor={242,148,0},
+        textString=
+               "Thermo"),
+      Text(
+        extent={{-4,8},{68,-34}},
+        lineColor={46,170,220},
+        textString=
+               "SysPro"),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},
+            {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{
+            -62,2}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{
+            -42,22},{-42,30},{-44,38}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},
+            {-26,12},{-28,12},{-26,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,30},{-6,26}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,36},{-6,32}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,42},{-6,38}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-8,48},{-6,44}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,32},{-2,28}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,38},{-2,34}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,44},{-2,40}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Rectangle(
+        extent={{-4,50},{-2,46}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Polygon(
+        points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},
+            {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,
+            2}},
+        lineColor={242,148,0},
+        fillColor={242,148,0},
+        fillPattern=FillPattern.Solid),
+      Line(
+        points={{22,12},{22,14},{22,16},{24,14},{20,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{26,12},{26,14},{26,16},{28,14},{24,18}},
+        color={46,170,220},
+        thickness=0.5),
+      Line(
+        points={{30,10},{30,12},{30,14},{32,12},{28,16}},
+        color={46,170,220},
+        thickness=0.5),
+      Polygon(
+        points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}},
+        lineColor={46,170,220},
+        fillColor={46,170,220},
+        fillPattern=FillPattern.Solid),
+      Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}),
+      Line(
+        points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}},
+        color={0,0,255},
+        smooth=Smooth.None),
+      Line(
+        points={{80,80},{100,100}},
+        color={0,0,255},
+        smooth=Smooth.None)}),
+  Documentation(info="<html>
+<p><b>Copyright &copy; EDF 2002 - 2020</b> </p>
+<h4>ThermoSysPro version 4.0 </h4>
+</html>"),
+  version="4.0");
+end ThermoSysPro;
diff --git a/ThermoSysPro/package.order b/ThermoSysPro/package.order
index da7a2129fc800da97230040b14f09809ca8964f1..6d01ead4f4ae963895d56a67b2100af0c5126428 100644
--- a/ThermoSysPro/package.order
+++ b/ThermoSysPro/package.order
@@ -1,17 +1,18 @@
-UsersGuide
-Combustion
-Correlations
-ElectroMechanics
-FlueGases
-Fluid
-Functions
-HeatNetworksCooling
-InstrumentationAndControl
-MultiFluids
-Properties
-Solar
-Thermal
-Units
-WaterSolution
-WaterSteam
-Examples
+UsersGuide
+Combustion
+Correlations
+ElectroMechanics
+FlueGases
+Fluid
+Functions
+HeatNetworksCooling
+InstrumentationAndControl
+MultiFluids
+NuclearCore
+Properties
+Solar
+Thermal
+Units
+WaterSolution
+WaterSteam
+Examples